From: support
Date: Fri, 10 Feb 2023 11:23:03 +0000 (+0000)
Subject: Built motion from commit dbf3a7e2.|2.6.30
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=0ed01286375077cd2955cdaf801db7a783b9f66d;p=motion2.git
Built motion from commit dbf3a7e2.|2.6.30
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 55666ab..3cc4f1b 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-02-02T13:19:12.717Z",
+ "time": "2023-02-10T11:13:46.981Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 5f6d914..a450d1f 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-02-02T13:19:12.717Z",
+ "time": "2023-02-10T11:13:46.981Z",
"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 83afe3c..0febe6e 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 _0x4134=['integration','jscripty','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[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]','STRING','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','contactManager'];(function(_0x5e3a45,_0x45f0c5){var _0x13419f=function(_0x5ac996){while(--_0x5ac996){_0x5e3a45['push'](_0x5e3a45['shift']());}};_0x13419f(++_0x45f0c5);}(_0x4134,0x89));var _0x4413=function(_0x4be9f5,_0x57ad55){_0x4be9f5=_0x4be9f5-0x0;var _0xe5636=_0x4134[_0x4be9f5];return _0xe5636;};'use strict';var Sequelize=require(_0x4413('0x0'));module['exports']={'name':{'type':Sequelize[_0x4413('0x1')],'get':function(_0x11dc8f){return this['getDataValue']('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x4413('0x2'),_0x4413('0x3'),'motionbar',_0x4413('0x4'),'urlForward','browser','bot','script']],'msg':_0x4413('0x5')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x4413('0x6')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x4413('0x7')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x4413('0x8')},'data5':{'type':Sequelize[_0x4413('0x9')](0x1000),'comments':_0x4413('0xa')},'data6':{'type':Sequelize['STRING'],'comments':_0x4413('0xb')},'data7':{'type':Sequelize[_0x4413('0xc')],'comments':_0x4413('0xd')}};
\ No newline at end of file
+var _0xdb26=['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)]','STRING','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','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x342038,_0x195968){var _0x378a87=function(_0x4a9f71){while(--_0x4a9f71){_0x342038['push'](_0x342038['shift']());}};_0x378a87(++_0x195968);}(_0xdb26,0x16e));var _0x6db2=function(_0x3f823a,_0x29330a){_0x3f823a=_0x3f823a-0x0;var _0x440e40=_0xdb26[_0x3f823a];return _0x440e40;};'use strict';var Sequelize=require(_0x6db2('0x0'));module['exports']={'name':{'type':Sequelize[_0x6db2('0x1')],'get':function(_0x2f491f){return this[_0x6db2('0x2')](_0x6db2('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x6db2('0x4'),_0x6db2('0x5'),_0x6db2('0x6'),_0x6db2('0x7'),'urlForward',_0x6db2('0x8'),_0x6db2('0x9'),_0x6db2('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x6db2('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x6db2('0xc')},'data2':{'type':Sequelize[_0x6db2('0xd')](0x1000),'comment':_0x6db2('0xe')},'data3':{'type':Sequelize[_0x6db2('0xd')](0x1000),'comment':_0x6db2('0xf')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x6db2('0x10')},'data5':{'type':Sequelize[_0x6db2('0xd')](0x1000),'comments':_0x6db2('0x11')},'data6':{'type':Sequelize[_0x6db2('0xd')],'comments':_0x6db2('0x12')},'data7':{'type':Sequelize[_0x6db2('0x13')],'comments':_0x6db2('0x14')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 117047a..9b42cc0 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 _0xf416=['bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','status','sendStatus','error','stack','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0xdf6852,_0x463851){var _0x1f8f7c=function(_0x2c76d8){while(--_0x2c76d8){_0xdf6852['push'](_0xdf6852['shift']());}};_0x1f8f7c(++_0x463851);}(_0xf416,0x199));var _0x6f41=function(_0x501d6e,_0x17ec39){_0x501d6e=_0x501d6e-0x0;var _0x679768=_0xf416[_0x501d6e];return _0x679768;};'use strict';var emlformat=require(_0x6f41('0x0'));var rimraf=require(_0x6f41('0x1'));var zipdir=require(_0x6f41('0x2'));var jsonpatch=require(_0x6f41('0x3'));var rp=require(_0x6f41('0x4'));var moment=require('moment');var BPromise=require(_0x6f41('0x5'));var Mustache=require(_0x6f41('0x6'));var util=require(_0x6f41('0x7'));var path=require('path');var sox=require(_0x6f41('0x8'));var csv=require(_0x6f41('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f41('0xa'));var _=require('lodash');var squel=require(_0x6f41('0xb'));var crypto=require(_0x6f41('0xc'));var jsforce=require(_0x6f41('0xd'));var deskjs=require(_0x6f41('0xe'));var toCsv=require(_0x6f41('0x9'));var querystring=require(_0x6f41('0xf'));var Papa=require(_0x6f41('0x10'));var Redis=require(_0x6f41('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6f41('0x12'));var as=require(_0x6f41('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f41('0x14'))(_0x6f41('0x15'));var utils=require(_0x6f41('0x16'));var config=require(_0x6f41('0x17'));var licenseUtil=require(_0x6f41('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2432ce,_0x1e4bee){_0x1e4bee=_0x1e4bee||0xcc;return function(_0x16ab96){if(_0x16ab96){return _0x2432ce['sendStatus'](_0x1e4bee);}return _0x2432ce['status'](_0x1e4bee)['end']();};}function respondWithResult(_0x53faf9,_0x2fae71){_0x2fae71=_0x2fae71||0xc8;return function(_0x441cc1){if(_0x441cc1){return _0x53faf9['status'](_0x2fae71)[_0x6f41('0x19')](_0x441cc1);}};}function respondWithFilteredResult(_0x21e19e,_0x364631){return function(_0x58bbfd){if(_0x58bbfd){var _0x542ebc=typeof _0x364631[_0x6f41('0x1a')]===_0x6f41('0x1b')&&typeof _0x364631[_0x6f41('0x1c')]==='undefined';var _0x474be1=_0x58bbfd['count'];var _0x5d3a06=_0x542ebc?0x0:_0x364631['offset'];var _0x12e046=_0x542ebc?_0x58bbfd[_0x6f41('0x1d')]:_0x364631[_0x6f41('0x1a')]+_0x364631[_0x6f41('0x1c')];var _0x438115;if(_0x12e046>=_0x474be1){_0x12e046=_0x474be1;_0x438115=0xc8;}else{_0x438115=0xce;}_0x21e19e['status'](_0x438115);return _0x21e19e[_0x6f41('0x1e')](_0x6f41('0x1f'),_0x5d3a06+'-'+_0x12e046+'/'+_0x474be1)[_0x6f41('0x19')](_0x58bbfd);}return null;};}function patchUpdates(_0x4ec7bc){return function(_0x4c036a){try{jsonpatch[_0x6f41('0x20')](_0x4c036a,_0x4ec7bc,!![]);}catch(_0x5d80db){return BPromise['reject'](_0x5d80db);}return _0x4c036a['save']();};}function saveUpdates(_0x787418,_0x1f4f75){return function(_0x477d34){if(_0x477d34){return _0x477d34[_0x6f41('0x21')](_0x787418)['then'](function(_0x16b9b2){return _0x16b9b2;});}return null;};}function removeEntity(_0x1f967e,_0x7bf27a){return function(_0x3cbd21){if(_0x3cbd21){return _0x3cbd21[_0x6f41('0x22')]()[_0x6f41('0x23')](function(){_0x1f967e[_0x6f41('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa16438,_0x115975){return function(_0x3360d7){if(!_0x3360d7){_0xa16438[_0x6f41('0x25')](0x194);}return _0x3360d7;};}function handleError(_0x5844b6,_0x5040f1){_0x5040f1=_0x5040f1||0x1f4;return function(_0x5f4086){logger[_0x6f41('0x26')](_0x5f4086[_0x6f41('0x27')]);if(_0x5f4086['name']){delete _0x5f4086['name'];}_0x5844b6[_0x6f41('0x24')](_0x5040f1)[_0x6f41('0x28')](_0x5f4086);};}exports[_0x6f41('0x21')]=function(_0x53dd43,_0x182157){if(_0x53dd43[_0x6f41('0x29')]['id']){delete _0x53dd43['body']['id'];}return db[_0x6f41('0x2a')][_0x6f41('0x2b')]({'where':{'id':_0x53dd43[_0x6f41('0x2c')]['id']}})[_0x6f41('0x23')](handleEntityNotFound(_0x182157,null))[_0x6f41('0x23')](saveUpdates(_0x53dd43[_0x6f41('0x29')],null))['then'](respondWithResult(_0x182157,null))[_0x6f41('0x2d')](handleError(_0x182157,null));};exports[_0x6f41('0x22')]=function(_0x412d97,_0x565301){return db[_0x6f41('0x2a')][_0x6f41('0x2b')]({'where':{'id':_0x412d97[_0x6f41('0x2c')]['id']}})[_0x6f41('0x23')](handleEntityNotFound(_0x565301,null))['then'](removeEntity(_0x565301,null))[_0x6f41('0x2d')](handleError(_0x565301,null));};
\ No newline at end of file
+var _0x5de7=['reject','save','update','then','destroy','end','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x5de7,0x1bd));var _0x75de=function(_0x3f4607,_0x1512b9){_0x3f4607=_0x3f4607-0x0;var _0x52084b=_0x5de7[_0x3f4607];return _0x52084b;};'use strict';var emlformat=require(_0x75de('0x0'));var rimraf=require(_0x75de('0x1'));var zipdir=require(_0x75de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x75de('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x75de('0x4'));var util=require(_0x75de('0x5'));var path=require(_0x75de('0x6'));var sox=require('sox');var csv=require(_0x75de('0x7'));var ejs=require(_0x75de('0x8'));var fs=require('fs');var fs_extra=require(_0x75de('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x75de('0xa'));var jsforce=require(_0x75de('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x75de('0x7'));var querystring=require(_0x75de('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x75de('0xd'));var qs=require(_0x75de('0xe'));var as=require(_0x75de('0xf'));var hardwareService=require(_0x75de('0x10'));var logger=require(_0x75de('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x75de('0x12'))['db'];function respondWithStatusCode(_0x453309,_0xee0154){_0xee0154=_0xee0154||0xcc;return function(_0x1b76db){if(_0x1b76db){return _0x453309[_0x75de('0x13')](_0xee0154);}return _0x453309['status'](_0xee0154)['end']();};}function respondWithResult(_0x4514e9,_0x1b29ea){_0x1b29ea=_0x1b29ea||0xc8;return function(_0x38d41e){if(_0x38d41e){return _0x4514e9[_0x75de('0x14')](_0x1b29ea)['json'](_0x38d41e);}};}function respondWithFilteredResult(_0x3d3ab2,_0x4b7d47){return function(_0x10ad0f){if(_0x10ad0f){var _0x1d014b=typeof _0x4b7d47[_0x75de('0x15')]===_0x75de('0x16')&&typeof _0x4b7d47[_0x75de('0x17')]==='undefined';var _0x3acddd=_0x10ad0f['count'];var _0x2b3aee=_0x1d014b?0x0:_0x4b7d47[_0x75de('0x15')];var _0x4b8815=_0x1d014b?_0x10ad0f[_0x75de('0x18')]:_0x4b7d47[_0x75de('0x15')]+_0x4b7d47[_0x75de('0x17')];var _0x590773;if(_0x4b8815>=_0x3acddd){_0x4b8815=_0x3acddd;_0x590773=0xc8;}else{_0x590773=0xce;}_0x3d3ab2[_0x75de('0x14')](_0x590773);return _0x3d3ab2[_0x75de('0x19')](_0x75de('0x1a'),_0x2b3aee+'-'+_0x4b8815+'/'+_0x3acddd)['json'](_0x10ad0f);}return null;};}function patchUpdates(_0xa35971){return function(_0x476dc5){try{jsonpatch[_0x75de('0x1b')](_0x476dc5,_0xa35971,!![]);}catch(_0x3a7a47){return BPromise[_0x75de('0x1c')](_0x3a7a47);}return _0x476dc5[_0x75de('0x1d')]();};}function saveUpdates(_0x4a177e,_0x4cfc37){return function(_0x54a01f){if(_0x54a01f){return _0x54a01f[_0x75de('0x1e')](_0x4a177e)[_0x75de('0x1f')](function(_0x31a0dc){return _0x31a0dc;});}return null;};}function removeEntity(_0xb04bc9,_0x393b8a){return function(_0x3f989d){if(_0x3f989d){return _0x3f989d[_0x75de('0x20')]()[_0x75de('0x1f')](function(){_0xb04bc9['status'](0xcc)[_0x75de('0x21')]();});}};}function handleEntityNotFound(_0x2f4d5e,_0x1d080a){return function(_0x4a3de6){if(!_0x4a3de6){_0x2f4d5e[_0x75de('0x13')](0x194);}return _0x4a3de6;};}function handleError(_0x35e9de,_0x306ded){_0x306ded=_0x306ded||0x1f4;return function(_0x1b2b07){logger[_0x75de('0x22')](_0x1b2b07[_0x75de('0x23')]);if(_0x1b2b07[_0x75de('0x24')]){delete _0x1b2b07[_0x75de('0x24')];}_0x35e9de[_0x75de('0x14')](_0x306ded)[_0x75de('0x25')](_0x1b2b07);};}exports['update']=function(_0x1e30cd,_0x11a092){if(_0x1e30cd[_0x75de('0x26')]['id']){delete _0x1e30cd[_0x75de('0x26')]['id'];}return db[_0x75de('0x27')][_0x75de('0x28')]({'where':{'id':_0x1e30cd['params']['id']}})[_0x75de('0x1f')](handleEntityNotFound(_0x11a092,null))['then'](saveUpdates(_0x1e30cd[_0x75de('0x26')],null))[_0x75de('0x1f')](respondWithResult(_0x11a092,null))['catch'](handleError(_0x11a092,null));};exports[_0x75de('0x20')]=function(_0x22afa3,_0x5cfad8){return db[_0x75de('0x27')][_0x75de('0x28')]({'where':{'id':_0x22afa3[_0x75de('0x29')]['id']}})['then'](handleEntityNotFound(_0x5cfad8,null))[_0x75de('0x1f')](removeEntity(_0x5cfad8,null))[_0x75de('0x2a')](handleError(_0x5cfad8,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index cb0a455..95c5d51 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 _0x17a5=['../../config/logger','moment','request-promise','rimraf','./action.attributes','exports','define','Action','tools_actions','util'];(function(_0x4a2384,_0x1586a7){var _0x5eee54=function(_0x1a130a){while(--_0x1a130a){_0x4a2384['push'](_0x4a2384['shift']());}};_0x5eee54(++_0x1586a7);}(_0x17a5,0x1d5));var _0x517a=function(_0xdfbe21,_0xbc92de){_0xdfbe21=_0xdfbe21-0x0;var _0x5e1e86=_0x17a5[_0xdfbe21];return _0x5e1e86;};'use strict';var _=require('lodash');var util=require(_0x517a('0x0'));var logger=require(_0x517a('0x1'))('api');var moment=require(_0x517a('0x2'));var BPromise=require('bluebird');var rp=require(_0x517a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x517a('0x4'));var config=require('../../config/environment');var attributes=require(_0x517a('0x5'));module[_0x517a('0x6')]=function(_0x3c34f8,_0x4db37b){return _0x3c34f8[_0x517a('0x7')](_0x517a('0x8'),attributes,{'tableName':_0x517a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7046=['rimraf','./action.attributes','define','Action','lodash','util','../../config/logger','moment','path'];(function(_0x19f02c,_0x19a152){var _0x38b31e=function(_0x346b84){while(--_0x346b84){_0x19f02c['push'](_0x19f02c['shift']());}};_0x38b31e(++_0x19a152);}(_0x7046,0x1c6));var _0x6704=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7046[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var logger=require(_0x6704('0x2'))('api');var moment=require(_0x6704('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6704('0x4'));var rimraf=require(_0x6704('0x5'));var config=require('../../config/environment');var attributes=require(_0x6704('0x6'));module['exports']=function(_0x3a2ef8,_0x3b99da){return _0x3a2ef8[_0x6704('0x7')](_0x6704('0x8'),attributes,{'tableName':'tools_actions','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 f67859f..178bb01 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x53ec,0x192));var _0xc53e=function(_0x10eb38,_0x2086bd){_0x10eb38=_0x10eb38-0x0;var _0x5af9b5=_0x53ec[_0x10eb38];return _0x5af9b5;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
+var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x1cb9,0x14e));var _0x91cb=function(_0x7307cd,_0x2df2ab){_0x7307cd=_0x7307cd-0x0;var _0x38cdb0=_0x1cb9[_0x7307cd];return _0x38cdb0;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 9a49986..487171b 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 _0x007d=['connect-timeout','express','fs-extra','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','destroy','exports','multer','util'];(function(_0xd8151c,_0x55918f){var _0x2e9c71=function(_0x12c66d){while(--_0x12c66d){_0xd8151c['push'](_0xd8151c['shift']());}};_0x2e9c71(++_0x55918f);}(_0x007d,0x11e));var _0xd007=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x007d[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xd007('0x0'));var util=require(_0xd007('0x1'));var path=require('path');var timeout=require(_0xd007('0x2'));var express=require(_0xd007('0x3'));var router=express['Router']();var fs_extra=require(_0xd007('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd007('0x5'));var config=require('../../config/environment');var controller=require(_0xd007('0x6'));router[_0xd007('0x7')](_0xd007('0x8'),auth[_0xd007('0x9')](),controller['update']);router['delete'](_0xd007('0x8'),auth[_0xd007('0x9')](),controller[_0xd007('0xa')]);module[_0xd007('0xb')]=router;
\ No newline at end of file
+var _0x1c33=['Router','./action.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','connect-timeout','express'];(function(_0x4f7bde,_0x27c8e1){var _0x5cc36b=function(_0x3a76ee){while(--_0x3a76ee){_0x4f7bde['push'](_0x4f7bde['shift']());}};_0x5cc36b(++_0x27c8e1);}(_0x1c33,0x10d));var _0x31c3=function(_0xdf2f4b,_0x235a6a){_0xdf2f4b=_0xdf2f4b-0x0;var _0x521c49=_0x1c33[_0xdf2f4b];return _0x521c49;};'use strict';var multer=require(_0x31c3('0x0'));var util=require(_0x31c3('0x1'));var path=require('path');var timeout=require(_0x31c3('0x2'));var express=require(_0x31c3('0x3'));var router=express[_0x31c3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x31c3('0x5'));router[_0x31c3('0x6')](_0x31c3('0x7'),auth['isAuthenticated'](),controller[_0x31c3('0x8')]);router[_0x31c3('0x9')](_0x31c3('0x7'),auth[_0x31c3('0xa')](),controller[_0x31c3('0xb')]);module[_0x31c3('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index dc10eaa..50282a9 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 _0x7c09=['exports','STRING','TEXT'];(function(_0x262d66,_0x3eb656){var _0x549a57=function(_0x5b0dc5){while(--_0x5b0dc5){_0x262d66['push'](_0x262d66['shift']());}};_0x549a57(++_0x3eb656);}(_0x7c09,0x102));var _0x97c0=function(_0x54a132,_0x481e8f){_0x54a132=_0x54a132-0x0;var _0x30aef6=_0x7c09[_0x54a132];return _0x30aef6;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}};
\ No newline at end of file
+var _0xe14b=['exports','STRING','TEXT','sequelize'];(function(_0x379ea0,_0x5f1136){var _0x46822e=function(_0x24a840){while(--_0x24a840){_0x379ea0['push'](_0x379ea0['shift']());}};_0x46822e(++_0x5f1136);}(_0xe14b,0x93));var _0xbe14=function(_0x571914,_0x2142ab){_0x571914=_0x571914-0x0;var _0x5744ec=_0xe14b[_0x571914];return _0x5744ec;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xbe14('0x2')]},'table':{'type':Sequelize[_0xbe14('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbe14('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 0bce553..d22e46c 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 _0xbb9e=['stack','send','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','name','query','keys','filters','attributes','hasOwnProperty','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','fields','length','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','create','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','field','replace','format','orderBy','order','DESC','alias','joins','parse','includes','foreignKey','%s.%s\x20=\x20%s.%s','table','parentKey','foreignTable','conditions','clone','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','left_join','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','groupBy','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','function','debug','eml-format','rimraf','zip-dir','request-promise','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','get','UserProfileResource','end','error'];(function(_0x5a194c,_0x315e13){var _0xa3e3ba=function(_0x2b1273){while(--_0x2b1273){_0x5a194c['push'](_0x5a194c['shift']());}};_0xa3e3ba(++_0x315e13);}(_0xbb9e,0x11e));var _0xebb9=function(_0x5d77be,_0x11ed48){_0x5d77be=_0x5d77be-0x0;var _0x2fb36c=_0xbb9e[_0x5d77be];return _0x2fb36c;};'use strict';var emlformat=require(_0xebb9('0x0'));var rimraf=require(_0xebb9('0x1'));var zipdir=require(_0xebb9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xebb9('0x3'));var moment=require('moment');var BPromise=require(_0xebb9('0x4'));var Mustache=require('mustache');var util=require(_0xebb9('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xebb9('0x6'));var ejs=require(_0xebb9('0x7'));var fs=require('fs');var fs_extra=require(_0xebb9('0x8'));var _=require('lodash');var squel=require(_0xebb9('0x9'));var crypto=require(_0xebb9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xebb9('0xb'));var toCsv=require(_0xebb9('0x6'));var querystring=require(_0xebb9('0xc'));var Papa=require(_0xebb9('0xd'));var Redis=require(_0xebb9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xebb9('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xebb9('0x10'));var logger=require(_0xebb9('0x11'))(_0xebb9('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xebb9('0x13'));var db=require(_0xebb9('0x14'))['db'];var dbH=require('../../mysqldb')[_0xebb9('0x15')];function respondWithStatusCode(_0x2b63a8,_0x596655){_0x596655=_0x596655||0xcc;return function(_0x491b08){if(_0x491b08){return _0x2b63a8[_0xebb9('0x16')](_0x596655);}return _0x2b63a8[_0xebb9('0x17')](_0x596655)['end']();};}function respondWithResult(_0x209c9f,_0xa910e9){_0xa910e9=_0xa910e9||0xc8;return function(_0xbdb7fb){if(_0xbdb7fb){return _0x209c9f[_0xebb9('0x17')](_0xa910e9)[_0xebb9('0x18')](_0xbdb7fb);}};}function respondWithFilteredResult(_0x4ac9bb,_0x2ed7b4){return function(_0x4ac45d){if(_0x4ac45d){var _0x19442c=typeof _0x2ed7b4['offset']==='undefined'&&typeof _0x2ed7b4['limit']===_0xebb9('0x19');var _0x39e90f=_0x4ac45d[_0xebb9('0x1a')];var _0x11ed8=_0x19442c?0x0:_0x2ed7b4[_0xebb9('0x1b')];var _0x305618=_0x19442c?_0x4ac45d[_0xebb9('0x1a')]:_0x2ed7b4[_0xebb9('0x1b')]+_0x2ed7b4[_0xebb9('0x1c')];var _0x5df964;if(_0x305618>=_0x39e90f){_0x305618=_0x39e90f;_0x5df964=0xc8;}else{_0x5df964=0xce;}_0x4ac9bb[_0xebb9('0x17')](_0x5df964);return _0x4ac9bb[_0xebb9('0x1d')](_0xebb9('0x1e'),_0x11ed8+'-'+_0x305618+'/'+_0x39e90f)['json'](_0x4ac45d);}return null;};}function patchUpdates(_0x3cbfa6){return function(_0x4b66fe){try{jsonpatch['apply'](_0x4b66fe,_0x3cbfa6,!![]);}catch(_0x337da9){return BPromise[_0xebb9('0x1f')](_0x337da9);}return _0x4b66fe[_0xebb9('0x20')]();};}function saveUpdates(_0x577ff1,_0x24aa14){return function(_0x155018){if(_0x155018){return _0x155018['update'](_0x577ff1)[_0xebb9('0x21')](function(_0x308406){return _0x308406;});}return null;};}function removeEntity(_0x4a1a6a,_0x4a14b9){return function(_0x4b190d){if(_0x4b190d){return _0x4b190d['destroy']()['then'](function(){var _0x161855=_0x4b190d[_0xebb9('0x22')]({'plain':!![]});var _0x3bde42='CustomReports';return db[_0xebb9('0x23')]['destroy']({'where':{'type':_0x3bde42,'resourceId':_0x161855['id']}})[_0xebb9('0x21')](function(){return _0x4b190d;});})[_0xebb9('0x21')](function(){_0x4a1a6a[_0xebb9('0x17')](0xcc)[_0xebb9('0x24')]();});}};}function handleEntityNotFound(_0x3dc296,_0xafe3a3){return function(_0x16e021){if(!_0x16e021){_0x3dc296[_0xebb9('0x16')](0x194);}return _0x16e021;};}function handleError(_0x5994c3,_0x2d7c85){_0x2d7c85=_0x2d7c85||0x1f4;return function(_0x3e3f62){logger[_0xebb9('0x25')](_0x3e3f62[_0xebb9('0x26')]);if(_0x3e3f62['name']){delete _0x3e3f62['name'];}_0x5994c3[_0xebb9('0x17')](_0x2d7c85)[_0xebb9('0x27')](_0x3e3f62);};}exports['index']=function(_0xf8c6f4,_0xffbc38){var _0x166e3f={},_0x1c33a4={},_0x3e2dca={'count':0x0,'rows':[]};var _0x1d5811=_[_0xebb9('0x28')](db[_0xebb9('0x29')][_0xebb9('0x2a')],function(_0x536266){return{'name':_0x536266[_0xebb9('0x2b')],'type':_0x536266['type'][_0xebb9('0x2c')]};});_0x1c33a4[_0xebb9('0x2d')]=_['map'](_0x1d5811,_0xebb9('0x2e'));_0x1c33a4[_0xebb9('0x2f')]=_[_0xebb9('0x30')](_0xf8c6f4['query']);_0x1c33a4[_0xebb9('0x31')]=_['intersection'](_0x1c33a4[_0xebb9('0x2d')],_0x1c33a4[_0xebb9('0x2f')]);_0x166e3f[_0xebb9('0x32')]=_['intersection'](_0x1c33a4[_0xebb9('0x2d')],qs['fields'](_0xf8c6f4[_0xebb9('0x2f')]['fields']));_0x166e3f['attributes']=_0x166e3f['attributes']['length']?_0x166e3f[_0xebb9('0x32')]:_0x1c33a4[_0xebb9('0x2d')];if(!_0xf8c6f4[_0xebb9('0x2f')][_0xebb9('0x33')]('nolimit')){_0x166e3f[_0xebb9('0x1c')]=qs[_0xebb9('0x1c')](_0xf8c6f4[_0xebb9('0x2f')][_0xebb9('0x1c')]);_0x166e3f[_0xebb9('0x1b')]=qs['offset'](_0xf8c6f4['query'][_0xebb9('0x1b')]);}_0x166e3f['order']=qs['sort'](_0xf8c6f4[_0xebb9('0x2f')][_0xebb9('0x34')]);_0x166e3f['where']=qs[_0xebb9('0x31')](_[_0xebb9('0x35')](_0xf8c6f4[_0xebb9('0x2f')],_0x1c33a4[_0xebb9('0x31')]),_0x1d5811);if(_0xf8c6f4[_0xebb9('0x2f')][_0xebb9('0x36')]){_0x166e3f[_0xebb9('0x37')]=_[_0xebb9('0x38')](_0x166e3f[_0xebb9('0x37')],{'$or':_[_0xebb9('0x28')](_0x1d5811,function(_0x374437){if(_0x374437[_0xebb9('0x39')]!==_0xebb9('0x3a')){var _0x257e74={};_0x257e74[_0x374437['name']]={'$like':'%'+_0xf8c6f4['query'][_0xebb9('0x36')]+'%'};return _0x257e74;}})});}_0x166e3f=_[_0xebb9('0x38')]({},_0x166e3f,_0xf8c6f4[_0xebb9('0x3b')]);var _0x5a88d1={'where':_0x166e3f[_0xebb9('0x37')]};return db[_0xebb9('0x29')][_0xebb9('0x1a')](_0x5a88d1)[_0xebb9('0x21')](function(_0x102126){_0x3e2dca['count']=_0x102126;if(_0xf8c6f4['query'][_0xebb9('0x3c')]){_0x166e3f[_0xebb9('0x3d')]=[{'all':!![]}];}return db[_0xebb9('0x29')][_0xebb9('0x3e')](_0x166e3f);})[_0xebb9('0x21')](function(_0x353dfa){_0x3e2dca[_0xebb9('0x3f')]=_0x353dfa;return _0x3e2dca;})[_0xebb9('0x21')](respondWithFilteredResult(_0xffbc38,_0x166e3f))[_0xebb9('0x40')](handleError(_0xffbc38,null));};exports[_0xebb9('0x41')]=function(_0x3e5306,_0xce287c){var _0x58ca9e={'raw':![],'where':{'id':_0x3e5306[_0xebb9('0x42')]['id']}},_0x138651={};_0x138651[_0xebb9('0x2d')]=_[_0xebb9('0x30')](db[_0xebb9('0x29')][_0xebb9('0x2a')]);_0x138651[_0xebb9('0x2f')]=_[_0xebb9('0x30')](_0x3e5306[_0xebb9('0x2f')]);_0x138651['filters']=_[_0xebb9('0x43')](_0x138651[_0xebb9('0x2d')],_0x138651[_0xebb9('0x2f')]);_0x58ca9e[_0xebb9('0x32')]=_[_0xebb9('0x43')](_0x138651[_0xebb9('0x2d')],qs['fields'](_0x3e5306[_0xebb9('0x2f')][_0xebb9('0x44')]));_0x58ca9e['attributes']=_0x58ca9e[_0xebb9('0x32')][_0xebb9('0x45')]?_0x58ca9e[_0xebb9('0x32')]:_0x138651[_0xebb9('0x2d')];if(_0x3e5306[_0xebb9('0x2f')][_0xebb9('0x3c')]){_0x58ca9e[_0xebb9('0x3d')]=[{'all':!![]}];}_0x58ca9e=_[_0xebb9('0x38')]({},_0x58ca9e,_0x3e5306['options']);return db['AnalyticCustomReport']['find'](_0x58ca9e)[_0xebb9('0x21')](handleEntityNotFound(_0xce287c,null))[_0xebb9('0x21')](respondWithResult(_0xce287c,null))[_0xebb9('0x40')](handleError(_0xce287c,null));};exports['create']=function(_0x59b9dc,_0x4115c0){return db['AnalyticCustomReport']['create'](_0x59b9dc[_0xebb9('0x46')],{})[_0xebb9('0x21')](function(_0x3a975d){var _0xa682b=_0x59b9dc[_0xebb9('0x47')]['get']({'plain':!![]});if(!_0xa682b)throw new Error(_0xebb9('0x48'));if(_0xa682b['role']===_0xebb9('0x47')){var _0x55f861=_0x3a975d[_0xebb9('0x22')]({'plain':!![]});var _0x6bb57e='Reports';return db['UserProfileSection'][_0xebb9('0x49')]({'where':{'name':_0x6bb57e,'userProfileId':_0xa682b['userProfileId']},'raw':!![]})[_0xebb9('0x21')](function(_0x33ab6c){if(_0x33ab6c&&_0x33ab6c[_0xebb9('0x4a')]===0x0){return db[_0xebb9('0x23')][_0xebb9('0x4b')]({'name':_0x55f861[_0xebb9('0x2e')],'resourceId':_0x55f861['id'],'type':_0xebb9('0x4c'),'sectionId':_0x33ab6c['id']},{})[_0xebb9('0x21')](function(){return _0x3a975d;});}else{return _0x3a975d;}})['catch'](function(_0x47dede){logger[_0xebb9('0x25')](_0xebb9('0x4d'),_0x47dede);throw _0x47dede;});}return _0x3a975d;})[_0xebb9('0x21')](respondWithResult(_0x4115c0,0xc9))[_0xebb9('0x40')](handleError(_0x4115c0,null));};exports[_0xebb9('0x4e')]=function(_0x5385a9,_0x477e3b){if(_0x5385a9['body']['id']){delete _0x5385a9['body']['id'];}return db[_0xebb9('0x29')][_0xebb9('0x49')]({'where':{'id':_0x5385a9['params']['id']}})[_0xebb9('0x21')](handleEntityNotFound(_0x477e3b,null))['then'](saveUpdates(_0x5385a9[_0xebb9('0x46')],null))[_0xebb9('0x21')](respondWithResult(_0x477e3b,null))[_0xebb9('0x40')](handleError(_0x477e3b,null));};exports['destroy']=function(_0x4c7dd2,_0x4248f1){return db[_0xebb9('0x29')][_0xebb9('0x49')]({'where':{'id':_0x4c7dd2[_0xebb9('0x42')]['id']}})['then'](handleEntityNotFound(_0x4248f1,null))[_0xebb9('0x21')](removeEntity(_0x4248f1,null))[_0xebb9('0x40')](handleError(_0x4248f1,null));};exports[_0xebb9('0x4f')]=function(_0x1f2e3f,_0x1c197d){var _0x1caaa=0xa;var _0x734350=['join','left_join',_0xebb9('0x50'),_0xebb9('0x51')];var _0x361b50={'SUM':_0xebb9('0x52'),'COUNT':_0xebb9('0x53'),'COUNT DISTINCT':_0xebb9('0x54'),'MAX':'MAX(%s)','MIN':_0xebb9('0x55'),'AVG':_0xebb9('0x56'),'GROUP_CONCAT':_0xebb9('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xebb9('0x58')};var _0x5a676b={'SEC_TO_TIME':_0xebb9('0x59'),'DATE':_0xebb9('0x5a'),'HOUR':_0xebb9('0x5b'),'ROUND':_0xebb9('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x37b29d=function(_0x19e390){return!_['includes'](['IS\x20NULL',_0xebb9('0x5d'),_0xebb9('0x5e'),_0xebb9('0x5f')],_0x19e390);};var _0x2732d2=function(_0x251f08){if(!_0x251f08||!_0x251f08[_0xebb9('0x60')][_0xebb9('0x45')]){return'';}for(var _0x1df289='(',_0x121eb2=0x0;_0x121eb2<_0x251f08['rules'][_0xebb9('0x45')];_0x121eb2+=0x1){_0x121eb2>0x0&&(_0x1df289+='\x20'+_0x251f08[_0xebb9('0x61')]+'\x20');_0x1df289+=_0x251f08['rules'][_0x121eb2][_0xebb9('0x62')]?_0x2732d2(_0x251f08[_0xebb9('0x60')][_0x121eb2][_0xebb9('0x62')]):_0x251f08[_0xebb9('0x60')][_0x121eb2]['field']+'\x20'+_0x251f08[_0xebb9('0x60')][_0x121eb2][_0xebb9('0x63')]+(_0x37b29d(_0x251f08[_0xebb9('0x60')][_0x121eb2][_0xebb9('0x63')])?'\x20'+_0x251f08[_0xebb9('0x60')][_0x121eb2][_0xebb9('0x64')]:'');}return _0x1df289+')';};var _0x39cea6={'where':{'id':_0x1f2e3f[_0xebb9('0x42')]['id']}},_0x4579f4,_0x3525ec,_0x5dcfc1,_0x4ae4d6,_0x443130;_0x39cea6=_[_0xebb9('0x38')]({},_0x39cea6,_0x1f2e3f[_0xebb9('0x3b')]);return db[_0xebb9('0x29')]['find'](_0x39cea6)[_0xebb9('0x21')](function(_0x2f33a0){if(_0x2f33a0){_0x4579f4=_0x2f33a0;return _0x2f33a0[_0xebb9('0x65')]();}return null;})[_0xebb9('0x21')](function(_0x255969){if(_0x255969){if(!_0x255969[_0xebb9('0x45')]){throw new db[(_0xebb9('0x66'))][(_0xebb9('0x67'))](_0xebb9('0x68'),0x193);}_0x3525ec=_0x255969;return db[_0xebb9('0x69')][_0xebb9('0x3e')]({'raw':!![]});}return null;})[_0xebb9('0x21')](function(_0x1eb045){if(_0x1eb045){_0x5dcfc1=_[_0xebb9('0x6a')](_0x1eb045,'id');var _0x4100f3;var _0x14406b=squel[_0xebb9('0x6b')]();_0x14406b[_0xebb9('0x6c')](_0x4579f4['table']);for(var _0x1415b1=0x0;_0x1415b1<_0x3525ec[_0xebb9('0x45')];_0x1415b1+=0x1){_0x4100f3=_0x3525ec[_0x1415b1][_0xebb9('0x6d')]?_0x5dcfc1[_0x3525ec[_0x1415b1][_0xebb9('0x6d')]][_0xebb9('0x6e')]:_0x3525ec[_0x1415b1][_0xebb9('0x6f')];_0x4100f3=_0x3525ec[_0x1415b1]['function']?_[_0xebb9('0x70')](_0x361b50[_0x3525ec[_0x1415b1]['function']],'%s',_0x4100f3):_0x4100f3;_0x4100f3=_0x3525ec[_0x1415b1]['format']?_[_0xebb9('0x70')](_0x5a676b[_0x3525ec[_0x1415b1][_0xebb9('0x71')]],'%s',_0x4100f3):_0x4100f3;if(_0x3525ec[_0x1415b1]['groupBy']){_0x14406b[_0xebb9('0x62')](_0x4100f3);}_0x3525ec[_0x1415b1][_0xebb9('0x72')]&&_0x14406b[_0xebb9('0x73')](_0x4100f3,_0x3525ec[_0x1415b1]['orderBy']===_0xebb9('0x74')?![]:!![]);_0x14406b[_0xebb9('0x6f')](_0x4100f3,_0x3525ec[_0x1415b1][_0xebb9('0x75')]||_0x4100f3);}if(_0x4579f4[_0xebb9('0x76')]){_0x4579f4['joins']=JSON[_0xebb9('0x77')](_0x4579f4[_0xebb9('0x76')]);for(var _0x382fed=0x0;_0x382fed<_0x4579f4[_0xebb9('0x76')][_0xebb9('0x45')];_0x382fed+=0x1){if(_0x4579f4[_0xebb9('0x76')][_0x382fed][_0xebb9('0x39')]&&_[_0xebb9('0x78')](_0x734350,_0x4579f4[_0xebb9('0x76')][_0x382fed]['type'])&&_0x4579f4[_0xebb9('0x76')][_0x382fed]['parentKey']&&_0x4579f4[_0xebb9('0x76')][_0x382fed]['foreignTable']&&_0x4579f4[_0xebb9('0x76')][_0x382fed][_0xebb9('0x79')]){_0x14406b[_0x4579f4[_0xebb9('0x76')][_0x382fed]['type']](_0x4579f4['joins'][_0x382fed]['foreignTable'],null,util[_0xebb9('0x71')](_0xebb9('0x7a'),_0x4579f4[_0xebb9('0x7b')],_0x4579f4['joins'][_0x382fed][_0xebb9('0x7c')],_0x4579f4[_0xebb9('0x76')][_0x382fed][_0xebb9('0x7d')],_0x4579f4['joins'][_0x382fed][_0xebb9('0x79')]));}}}if(_0x4579f4[_0xebb9('0x7e')]){_0x4579f4['conditions']=JSON[_0xebb9('0x77')](_0x4579f4['conditions']);_0x14406b[_0xebb9('0x37')](_0x2732d2(_0x4579f4['conditions'][_0xebb9('0x62')]));}_0x443130=_0x14406b[_0xebb9('0x7f')]();_0x14406b[_0xebb9('0x1c')](_0x1caaa);_0x14406b[_0xebb9('0x1b')](0x0);logger['debug'](_0xebb9('0x80'),_0x14406b['toString']());return dbH[_0xebb9('0x81')]['query'](_0x14406b[_0xebb9('0x82')](),{'type':dbH[_0xebb9('0x81')][_0xebb9('0x83')][_0xebb9('0x84')]});}})[_0xebb9('0x21')](respondWithResult(_0x1c197d,null))[_0xebb9('0x40')](handleError(_0x1c197d,null));};function runReport(_0x2cc099,_0x573e34,_0x501aea){var _0x38fe62=_0x573e34['name'];var _0x2a7f64=0xa;var _0x4e3d08=[_0xebb9('0x85'),_0xebb9('0x86'),_0xebb9('0x50'),_0xebb9('0x51')];var _0x353d35={'SUM':_0xebb9('0x52'),'COUNT':_0xebb9('0x53'),'COUNT DISTINCT':_0xebb9('0x54'),'MAX':_0xebb9('0x87'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xebb9('0x88'),'GROUP_CONCAT DESC':_0xebb9('0x58')};var _0x3d5b12={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xebb9('0x5a'),'HOUR':_0xebb9('0x5b'),'ROUND':_0xebb9('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2366d2=function(_0x221561){return!_[_0xebb9('0x78')]([_0xebb9('0x89'),_0xebb9('0x5d'),'IS\x20EMPTY',_0xebb9('0x5f')],_0x221561);};var _0x35b66d=function(_0x1f69b2){if(!_0x1f69b2||!_0x1f69b2[_0xebb9('0x60')][_0xebb9('0x45')]){return'';}for(var _0x3de965='(',_0x54dbdf=0x0;_0x54dbdf<_0x1f69b2[_0xebb9('0x60')][_0xebb9('0x45')];_0x54dbdf+=0x1){_0x54dbdf>0x0&&(_0x3de965+='\x20'+_0x1f69b2[_0xebb9('0x61')]+'\x20');_0x3de965+=_0x1f69b2['rules'][_0x54dbdf][_0xebb9('0x62')]?_0x35b66d(_0x1f69b2['rules'][_0x54dbdf]['group']):_0x1f69b2[_0xebb9('0x60')][_0x54dbdf][_0xebb9('0x6f')]+'\x20'+_0x1f69b2['rules'][_0x54dbdf][_0xebb9('0x63')]+(_0x2366d2(_0x1f69b2[_0xebb9('0x60')][_0x54dbdf]['condition'])?'\x20'+_0x1f69b2[_0xebb9('0x60')][_0x54dbdf][_0xebb9('0x64')]:'');}return _0x3de965+')';};var _0x1a4149={'where':{'id':_0x2cc099['id']}},_0x5e8413,_0x4c8513,_0x5102f0,_0x25b164,_0x425b05;_0x1a4149=_[_0xebb9('0x38')]({},_0x1a4149,_0x501aea);return db[_0xebb9('0x29')][_0xebb9('0x49')](_0x1a4149)['then'](function(_0x385e2f){if(_0x385e2f){_0x5e8413=_0x385e2f;return _0x385e2f[_0xebb9('0x65')]();}return null;})[_0xebb9('0x21')](function(_0x47325c){if(_0x47325c){if(!_0x47325c[_0xebb9('0x45')]){throw new db['Sequelize'][(_0xebb9('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4c8513=_0x47325c;return db[_0xebb9('0x69')][_0xebb9('0x3e')]({'raw':!![]});}return null;})[_0xebb9('0x21')](function(_0x6ab956){if(_0x6ab956){_0x5102f0=_['keyBy'](_0x6ab956,'id');var _0x507a1b;var _0x4c99cf=squel['select']();_0x4c99cf[_0xebb9('0x6c')](_0x5e8413[_0xebb9('0x7b')]);for(var _0xcf3bfc=0x0;_0xcf3bfc<_0x4c8513[_0xebb9('0x45')];_0xcf3bfc+=0x1){_0x507a1b=_0x4c8513[_0xcf3bfc][_0xebb9('0x6d')]?_0x5102f0[_0x4c8513[_0xcf3bfc][_0xebb9('0x6d')]][_0xebb9('0x6e')]:_0x4c8513[_0xcf3bfc][_0xebb9('0x6f')];_0x507a1b=_0x4c8513[_0xcf3bfc]['function']?_[_0xebb9('0x70')](_0x353d35[_0x4c8513[_0xcf3bfc]['function']],'%s',_0x507a1b):_0x507a1b;_0x507a1b=_0x4c8513[_0xcf3bfc]['format']?_[_0xebb9('0x70')](_0x3d5b12[_0x4c8513[_0xcf3bfc][_0xebb9('0x71')]],'%s',_0x507a1b):_0x507a1b;if(_0x4c8513[_0xcf3bfc][_0xebb9('0x8a')]){_0x4c99cf[_0xebb9('0x62')](_0x507a1b);}_0x4c8513[_0xcf3bfc][_0xebb9('0x72')]&&_0x4c99cf[_0xebb9('0x73')](_0x507a1b,_0x4c8513[_0xcf3bfc][_0xebb9('0x72')]===_0xebb9('0x74')?![]:!![]);_0x4c99cf['field'](_0x507a1b,_0x4c8513[_0xcf3bfc][_0xebb9('0x75')]||_0x507a1b);}if(_0x5e8413[_0xebb9('0x76')]){_0x5e8413[_0xebb9('0x76')]=JSON[_0xebb9('0x77')](_0x5e8413[_0xebb9('0x76')]);for(var _0x497e2d=0x0;_0x497e2d<_0x5e8413['joins'][_0xebb9('0x45')];_0x497e2d+=0x1){if(_0x5e8413[_0xebb9('0x76')][_0x497e2d][_0xebb9('0x39')]&&_['includes'](_0x4e3d08,_0x5e8413[_0xebb9('0x76')][_0x497e2d][_0xebb9('0x39')])&&_0x5e8413[_0xebb9('0x76')][_0x497e2d][_0xebb9('0x7c')]&&_0x5e8413[_0xebb9('0x76')][_0x497e2d][_0xebb9('0x7d')]&&_0x5e8413[_0xebb9('0x76')][_0x497e2d][_0xebb9('0x79')]){_0x4c99cf[_0x5e8413['joins'][_0x497e2d][_0xebb9('0x39')]](_0x5e8413[_0xebb9('0x76')][_0x497e2d]['foreignTable'],null,util[_0xebb9('0x71')](_0xebb9('0x7a'),_0x5e8413['table'],_0x5e8413[_0xebb9('0x76')][_0x497e2d]['parentKey'],_0x5e8413[_0xebb9('0x76')][_0x497e2d]['foreignTable'],_0x5e8413['joins'][_0x497e2d]['foreignKey']));}}}if(_0x5e8413[_0xebb9('0x7e')]){_0x5e8413[_0xebb9('0x7e')]=JSON[_0xebb9('0x77')](_0x5e8413[_0xebb9('0x7e')]);_0x4c99cf[_0xebb9('0x37')](_0x35b66d(_0x5e8413[_0xebb9('0x7e')][_0xebb9('0x62')]));}_0x425b05=_0x4c99cf['clone']();_0x4c99cf[_0xebb9('0x1c')](_0x2a7f64);_0x4c99cf[_0xebb9('0x1b')](0x0);return;}})[_0xebb9('0x21')](function(){if(_0x573e34[_0xebb9('0x8b')]===_0xebb9('0x8c')){return null;}var _0x451bae=_[_0xebb9('0x38')](_0x573e34,{'name':_0x573e34[_0xebb9('0x8d')]||_0x573e34[_0xebb9('0x2e')]||_0x5e8413[_0xebb9('0x2e')],'basename':_0x38fe62,'savename':util[_0xebb9('0x71')](_0xebb9('0x8e'),_0x573e34[_0xebb9('0x2e')]||_0x5e8413[_0xebb9('0x2e')],require(_0xebb9('0x8f'))[_0xebb9('0x90')](0x4),_0x573e34[_0xebb9('0x8b')]||_0xebb9('0x91')),'reportId':_0x5e8413['id'],'reportType':_0xebb9('0x92')});return db['AnalyticExtractedReport'][_0xebb9('0x4b')](_0x451bae,{'raw':!![]});})[_0xebb9('0x21')](function(_0x7fcb8a){if(_0x5e8413['table']===_0xebb9('0x93')){_0x425b05['where'](_0x5e8413[_0xebb9('0x7b')]+_0xebb9('0x94'),_0x573e34[_0xebb9('0x95')],_0x573e34[_0xebb9('0x96')]);}else{_0x425b05[_0xebb9('0x37')](_0x5e8413['table']+_0xebb9('0x97'),_0x573e34[_0xebb9('0x95')],_0x573e34[_0xebb9('0x96')]);}if(_0x7fcb8a){logger['info'](_0xebb9('0x98'),_0x425b05[_0xebb9('0x82')]());require('child_process')[_0xebb9('0x99')](path[_0xebb9('0x85')](__dirname,_0xebb9('0x9a'),_0x7fcb8a[_0xebb9('0x8b')]),[_0x7fcb8a['id'],_0x425b05['toString'](),path[_0xebb9('0x85')](__dirname,_0xebb9('0x9b'),_0x7fcb8a[_0xebb9('0x9c')]),_0x38fe62]);return _0x7fcb8a;}else{var _0x4be535=squel[_0xebb9('0x6b')]();_0x4be535[_0xebb9('0x6c')]('('+_0x425b05[_0xebb9('0x82')]()+')',_0xebb9('0x9d'));_0x4be535[_0xebb9('0x6f')](_0xebb9('0x9e'),_0xebb9('0x1a'));_0x425b05[_0xebb9('0x1c')](_0x573e34[_0xebb9('0x1c')]||_0x2a7f64);_0x425b05['offset'](_0x573e34[_0xebb9('0x1b')]||0x0);return dbH[_0xebb9('0x81')][_0xebb9('0x2f')](_0x4be535[_0xebb9('0x82')](),{'type':dbH[_0xebb9('0x81')]['QueryTypes']['SELECT']})[_0xebb9('0x21')](function(_0x195904){if(!_0x195904[_0xebb9('0x45')]){_0x25b164=0x0;}else{_0x25b164=_0x195904[0x0][_0xebb9('0x1a')]||0x0;}return dbH['sequelize'][_0xebb9('0x2f')](_0x425b05['toString'](),{'type':dbH[_0xebb9('0x81')][_0xebb9('0x83')]['SELECT']});})[_0xebb9('0x21')](function(_0x394065){return{'rows':_0x394065||[],'count':_0x25b164};});}});}exports['run']=function(_0x65d6ed,_0x1c09fe){return runReport(_0x65d6ed[_0xebb9('0x42')],_0x65d6ed[_0xebb9('0x2f')],_0x65d6ed['options'])[_0xebb9('0x21')](respondWithResult(_0x1c09fe,null))[_0xebb9('0x40')](handleError(_0x1c09fe,null));};exports[_0xebb9('0x9f')]=runReport;exports[_0xebb9('0x2f')]=function(_0x5867af,_0x10a40b){var _0x943392=0xa;var _0x1bdf62=['join','left_join',_0xebb9('0x50'),_0xebb9('0x51')];var _0x15cdf8={'SUM':'SUM(%s)','COUNT':_0xebb9('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xebb9('0x87'),'MIN':_0xebb9('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xebb9('0x57'),'GROUP_CONCAT ASC':_0xebb9('0x88'),'GROUP_CONCAT DESC':_0xebb9('0x58')};var _0x4ff385={'SEC_TO_TIME':_0xebb9('0x59'),'DATE':_0xebb9('0x5a'),'HOUR':_0xebb9('0x5b'),'ROUND':_0xebb9('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1ab074=function(_0x1c844f){return!_['includes']([_0xebb9('0x89'),'IS\x20NOT\x20NULL',_0xebb9('0x5e'),_0xebb9('0x5f')],_0x1c844f);};var _0x15c4ba=function(_0x43db8b){if(!_0x43db8b||!_0x43db8b[_0xebb9('0x60')][_0xebb9('0x45')]){return'';}for(var _0x466751='(',_0x52ed4b=0x0;_0x52ed4b<_0x43db8b[_0xebb9('0x60')][_0xebb9('0x45')];_0x52ed4b+=0x1){_0x52ed4b>0x0&&(_0x466751+='\x20'+_0x43db8b[_0xebb9('0x61')]+'\x20');_0x466751+=_0x43db8b[_0xebb9('0x60')][_0x52ed4b][_0xebb9('0x62')]?_0x15c4ba(_0x43db8b[_0xebb9('0x60')][_0x52ed4b][_0xebb9('0x62')]):_0x43db8b[_0xebb9('0x60')][_0x52ed4b][_0xebb9('0x6f')]+'\x20'+_0x43db8b[_0xebb9('0x60')][_0x52ed4b]['condition']+(_0x1ab074(_0x43db8b[_0xebb9('0x60')][_0x52ed4b]['condition'])?'\x20'+_0x43db8b[_0xebb9('0x60')][_0x52ed4b][_0xebb9('0x64')]:'');}return _0x466751+')';};var _0x29208f={'where':{'id':_0x5867af['params']['id']}},_0x43cfd3,_0x2a0f69,_0x549444,_0x456b21,_0x22f4dc;_0x29208f=_['merge']({},_0x29208f,_0x5867af[_0xebb9('0x3b')]);return db[_0xebb9('0x29')][_0xebb9('0x49')](_0x29208f)['then'](function(_0x503402){if(_0x503402){_0x43cfd3=_0x503402;return _0x503402['getFields']();}return null;})[_0xebb9('0x21')](function(_0x3f54e5){if(_0x3f54e5){if(!_0x3f54e5[_0xebb9('0x45')]){throw new db[(_0xebb9('0x66'))][(_0xebb9('0x67'))](_0xebb9('0x68'),0x193);}_0x2a0f69=_0x3f54e5;return db[_0xebb9('0x69')][_0xebb9('0x3e')]({'raw':!![]});}return null;})[_0xebb9('0x21')](function(_0x1f0a5d){if(_0x1f0a5d){_0x549444=_[_0xebb9('0x6a')](_0x1f0a5d,'id');var _0x31add8;var _0x272a3b=squel[_0xebb9('0x6b')]();_0x272a3b['from'](_0x43cfd3[_0xebb9('0x7b')]);for(var _0x285295=0x0;_0x285295<_0x2a0f69[_0xebb9('0x45')];_0x285295+=0x1){_0x31add8=_0x2a0f69[_0x285295][_0xebb9('0x6d')]?_0x549444[_0x2a0f69[_0x285295][_0xebb9('0x6d')]]['metric']:_0x2a0f69[_0x285295][_0xebb9('0x6f')];_0x31add8=_0x2a0f69[_0x285295][_0xebb9('0xa0')]?_[_0xebb9('0x70')](_0x15cdf8[_0x2a0f69[_0x285295][_0xebb9('0xa0')]],'%s',_0x31add8):_0x31add8;_0x31add8=_0x2a0f69[_0x285295][_0xebb9('0x71')]?_[_0xebb9('0x70')](_0x4ff385[_0x2a0f69[_0x285295][_0xebb9('0x71')]],'%s',_0x31add8):_0x31add8;if(_0x2a0f69[_0x285295][_0xebb9('0x8a')]){_0x272a3b['group'](_0x31add8);}_0x2a0f69[_0x285295][_0xebb9('0x72')]&&_0x272a3b[_0xebb9('0x73')](_0x31add8,_0x2a0f69[_0x285295][_0xebb9('0x72')]===_0xebb9('0x74')?![]:!![]);_0x272a3b[_0xebb9('0x6f')](_0x31add8,_0x2a0f69[_0x285295][_0xebb9('0x75')]||_0x31add8);}if(_0x43cfd3['joins']){_0x43cfd3[_0xebb9('0x76')]=JSON[_0xebb9('0x77')](_0x43cfd3['joins']);for(var _0xee197b=0x0;_0xee197b<_0x43cfd3['joins']['length'];_0xee197b+=0x1){if(_0x43cfd3[_0xebb9('0x76')][_0xee197b][_0xebb9('0x39')]&&_[_0xebb9('0x78')](_0x1bdf62,_0x43cfd3[_0xebb9('0x76')][_0xee197b]['type'])&&_0x43cfd3['joins'][_0xee197b]['parentKey']&&_0x43cfd3[_0xebb9('0x76')][_0xee197b][_0xebb9('0x7d')]&&_0x43cfd3[_0xebb9('0x76')][_0xee197b][_0xebb9('0x79')]){_0x272a3b[_0x43cfd3[_0xebb9('0x76')][_0xee197b]['type']](_0x43cfd3[_0xebb9('0x76')][_0xee197b][_0xebb9('0x7d')],null,util[_0xebb9('0x71')](_0xebb9('0x7a'),_0x43cfd3[_0xebb9('0x7b')],_0x43cfd3[_0xebb9('0x76')][_0xee197b]['parentKey'],_0x43cfd3[_0xebb9('0x76')][_0xee197b][_0xebb9('0x7d')],_0x43cfd3[_0xebb9('0x76')][_0xee197b][_0xebb9('0x79')]));}}}if(_0x43cfd3[_0xebb9('0x7e')]){_0x43cfd3[_0xebb9('0x7e')]=JSON[_0xebb9('0x77')](_0x43cfd3[_0xebb9('0x7e')]);_0x272a3b['where'](_0x15c4ba(_0x43cfd3[_0xebb9('0x7e')][_0xebb9('0x62')]));}_0x22f4dc=_0x272a3b[_0xebb9('0x7f')]();_0x272a3b['limit'](_0x943392);_0x272a3b[_0xebb9('0x1b')](0x0);logger[_0xebb9('0xa1')](_0xebb9('0x80'),_0x272a3b[_0xebb9('0x82')]());return dbH['sequelize'][_0xebb9('0x2f')](_0x272a3b[_0xebb9('0x82')](),{'type':dbH[_0xebb9('0x81')][_0xebb9('0x83')]['SELECT']});}})['then'](function(){return{'sql':_0x22f4dc['toString']()};})['then'](respondWithResult(_0x10a40b,null))[_0xebb9('0x40')](handleError(_0x10a40b,null));};
\ No newline at end of file
+var _0x6c1d=['../../mysqldb','sendStatus','end','undefined','count','offset','status','set','json','apply','save','update','destroy','then','get','CustomReports','UserProfileResource','error','name','send','index','AnalyticCustomReport','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','rows','catch','rawAttributes','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','body','params','preview','join','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','group','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20EMPTY','select','alias','clone','output','web','fullPath','%s-%s.%s','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','right_join','SUM(%s)','UNIX_TIMESTAMP(%s)','operator','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util'];(function(_0x3dfade,_0x54ad41){var _0xb51af7=function(_0x587b94){while(--_0x587b94){_0x3dfade['push'](_0x3dfade['shift']());}};_0xb51af7(++_0x54ad41);}(_0x6c1d,0x124));var _0xd6c1=function(_0x3c9e24,_0x2d3c82){_0x3c9e24=_0x3c9e24-0x0;var _0x33501c=_0x6c1d[_0x3c9e24];return _0x33501c;};'use strict';var emlformat=require(_0xd6c1('0x0'));var rimraf=require(_0xd6c1('0x1'));var zipdir=require(_0xd6c1('0x2'));var jsonpatch=require(_0xd6c1('0x3'));var rp=require(_0xd6c1('0x4'));var moment=require(_0xd6c1('0x5'));var BPromise=require(_0xd6c1('0x6'));var Mustache=require(_0xd6c1('0x7'));var util=require(_0xd6c1('0x8'));var path=require(_0xd6c1('0x9'));var sox=require(_0xd6c1('0xa'));var csv=require('to-csv');var ejs=require(_0xd6c1('0xb'));var fs=require('fs');var fs_extra=require(_0xd6c1('0xc'));var _=require(_0xd6c1('0xd'));var squel=require('squel');var crypto=require(_0xd6c1('0xe'));var jsforce=require(_0xd6c1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd6c1('0x10'));var querystring=require(_0xd6c1('0x11'));var Papa=require(_0xd6c1('0x12'));var Redis=require('ioredis');var authService=require(_0xd6c1('0x13'));var qs=require(_0xd6c1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd6c1('0x15'));var utils=require('../../config/utils');var config=require(_0xd6c1('0x16'));var licenseUtil=require(_0xd6c1('0x17'));var db=require(_0xd6c1('0x18'))['db'];var dbH=require(_0xd6c1('0x18'))['dbH'];function respondWithStatusCode(_0x58326d,_0xd28356){_0xd28356=_0xd28356||0xcc;return function(_0x57020c){if(_0x57020c){return _0x58326d[_0xd6c1('0x19')](_0xd28356);}return _0x58326d['status'](_0xd28356)[_0xd6c1('0x1a')]();};}function respondWithResult(_0x3fcb68,_0x8180eb){_0x8180eb=_0x8180eb||0xc8;return function(_0x4c4190){if(_0x4c4190){return _0x3fcb68['status'](_0x8180eb)['json'](_0x4c4190);}};}function respondWithFilteredResult(_0x4ca916,_0x501df0){return function(_0x5e6be8){if(_0x5e6be8){var _0x2016fb=typeof _0x501df0['offset']===_0xd6c1('0x1b')&&typeof _0x501df0['limit']==='undefined';var _0x2df02b=_0x5e6be8[_0xd6c1('0x1c')];var _0x5ea588=_0x2016fb?0x0:_0x501df0[_0xd6c1('0x1d')];var _0x1bb32a=_0x2016fb?_0x5e6be8[_0xd6c1('0x1c')]:_0x501df0[_0xd6c1('0x1d')]+_0x501df0['limit'];var _0x43ff21;if(_0x1bb32a>=_0x2df02b){_0x1bb32a=_0x2df02b;_0x43ff21=0xc8;}else{_0x43ff21=0xce;}_0x4ca916[_0xd6c1('0x1e')](_0x43ff21);return _0x4ca916[_0xd6c1('0x1f')]('Content-Range',_0x5ea588+'-'+_0x1bb32a+'/'+_0x2df02b)[_0xd6c1('0x20')](_0x5e6be8);}return null;};}function patchUpdates(_0x4bbddd){return function(_0x25cc71){try{jsonpatch[_0xd6c1('0x21')](_0x25cc71,_0x4bbddd,!![]);}catch(_0x329f79){return BPromise['reject'](_0x329f79);}return _0x25cc71[_0xd6c1('0x22')]();};}function saveUpdates(_0x499918,_0x43fbb9){return function(_0x55c588){if(_0x55c588){return _0x55c588[_0xd6c1('0x23')](_0x499918)['then'](function(_0x25c46e){return _0x25c46e;});}return null;};}function removeEntity(_0x52385b,_0x1b3eae){return function(_0x4621e1){if(_0x4621e1){return _0x4621e1[_0xd6c1('0x24')]()[_0xd6c1('0x25')](function(){var _0x533b96=_0x4621e1[_0xd6c1('0x26')]({'plain':!![]});var _0x4db381=_0xd6c1('0x27');return db[_0xd6c1('0x28')][_0xd6c1('0x24')]({'where':{'type':_0x4db381,'resourceId':_0x533b96['id']}})[_0xd6c1('0x25')](function(){return _0x4621e1;});})[_0xd6c1('0x25')](function(){_0x52385b[_0xd6c1('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d21a8,_0x308a14){return function(_0x30b841){if(!_0x30b841){_0x1d21a8[_0xd6c1('0x19')](0x194);}return _0x30b841;};}function handleError(_0x3284ab,_0x3d2ea6){_0x3d2ea6=_0x3d2ea6||0x1f4;return function(_0x13ab8e){logger[_0xd6c1('0x29')](_0x13ab8e['stack']);if(_0x13ab8e[_0xd6c1('0x2a')]){delete _0x13ab8e['name'];}_0x3284ab[_0xd6c1('0x1e')](_0x3d2ea6)[_0xd6c1('0x2b')](_0x13ab8e);};}exports[_0xd6c1('0x2c')]=function(_0x100b55,_0x12075c){var _0x5a047a={},_0x46d359={},_0x56b5d9={'count':0x0,'rows':[]};var _0x5bfbcf=_['map'](db[_0xd6c1('0x2d')]['rawAttributes'],function(_0x257f1f){return{'name':_0x257f1f['fieldName'],'type':_0x257f1f['type']['key']};});_0x46d359[_0xd6c1('0x2e')]=_['map'](_0x5bfbcf,_0xd6c1('0x2a'));_0x46d359[_0xd6c1('0x2f')]=_[_0xd6c1('0x30')](_0x100b55[_0xd6c1('0x2f')]);_0x46d359[_0xd6c1('0x31')]=_['intersection'](_0x46d359[_0xd6c1('0x2e')],_0x46d359[_0xd6c1('0x2f')]);_0x5a047a[_0xd6c1('0x32')]=_[_0xd6c1('0x33')](_0x46d359[_0xd6c1('0x2e')],qs[_0xd6c1('0x34')](_0x100b55[_0xd6c1('0x2f')][_0xd6c1('0x34')]));_0x5a047a[_0xd6c1('0x32')]=_0x5a047a[_0xd6c1('0x32')][_0xd6c1('0x35')]?_0x5a047a[_0xd6c1('0x32')]:_0x46d359[_0xd6c1('0x2e')];if(!_0x100b55[_0xd6c1('0x2f')]['hasOwnProperty'](_0xd6c1('0x36'))){_0x5a047a[_0xd6c1('0x37')]=qs[_0xd6c1('0x37')](_0x100b55[_0xd6c1('0x2f')][_0xd6c1('0x37')]);_0x5a047a['offset']=qs[_0xd6c1('0x1d')](_0x100b55[_0xd6c1('0x2f')][_0xd6c1('0x1d')]);}_0x5a047a[_0xd6c1('0x38')]=qs[_0xd6c1('0x39')](_0x100b55[_0xd6c1('0x2f')]['sort']);_0x5a047a[_0xd6c1('0x3a')]=qs['filters'](_[_0xd6c1('0x3b')](_0x100b55[_0xd6c1('0x2f')],_0x46d359[_0xd6c1('0x31')]),_0x5bfbcf);if(_0x100b55[_0xd6c1('0x2f')][_0xd6c1('0x3c')]){_0x5a047a[_0xd6c1('0x3a')]=_[_0xd6c1('0x3d')](_0x5a047a[_0xd6c1('0x3a')],{'$or':_['map'](_0x5bfbcf,function(_0x251d79){if(_0x251d79[_0xd6c1('0x3e')]!==_0xd6c1('0x3f')){var _0x5df1dd={};_0x5df1dd[_0x251d79['name']]={'$like':'%'+_0x100b55[_0xd6c1('0x2f')][_0xd6c1('0x3c')]+'%'};return _0x5df1dd;}})});}_0x5a047a=_[_0xd6c1('0x3d')]({},_0x5a047a,_0x100b55['options']);var _0x5569df={'where':_0x5a047a[_0xd6c1('0x3a')]};return db[_0xd6c1('0x2d')][_0xd6c1('0x1c')](_0x5569df)[_0xd6c1('0x25')](function(_0x470247){_0x56b5d9[_0xd6c1('0x1c')]=_0x470247;if(_0x100b55['query']['includeAll']){_0x5a047a[_0xd6c1('0x40')]=[{'all':!![]}];}return db[_0xd6c1('0x2d')][_0xd6c1('0x41')](_0x5a047a);})[_0xd6c1('0x25')](function(_0x3d1715){_0x56b5d9[_0xd6c1('0x42')]=_0x3d1715;return _0x56b5d9;})[_0xd6c1('0x25')](respondWithFilteredResult(_0x12075c,_0x5a047a))[_0xd6c1('0x43')](handleError(_0x12075c,null));};exports['show']=function(_0xd446db,_0x39ab9d){var _0xfdefc8={'raw':![],'where':{'id':_0xd446db['params']['id']}},_0x357a52={};_0x357a52['model']=_[_0xd6c1('0x30')](db[_0xd6c1('0x2d')][_0xd6c1('0x44')]);_0x357a52[_0xd6c1('0x2f')]=_['keys'](_0xd446db[_0xd6c1('0x2f')]);_0x357a52['filters']=_[_0xd6c1('0x33')](_0x357a52['model'],_0x357a52[_0xd6c1('0x2f')]);_0xfdefc8['attributes']=_['intersection'](_0x357a52[_0xd6c1('0x2e')],qs['fields'](_0xd446db[_0xd6c1('0x2f')]['fields']));_0xfdefc8[_0xd6c1('0x32')]=_0xfdefc8['attributes'][_0xd6c1('0x35')]?_0xfdefc8[_0xd6c1('0x32')]:_0x357a52[_0xd6c1('0x2e')];if(_0xd446db[_0xd6c1('0x2f')]['includeAll']){_0xfdefc8[_0xd6c1('0x40')]=[{'all':!![]}];}_0xfdefc8=_[_0xd6c1('0x3d')]({},_0xfdefc8,_0xd446db[_0xd6c1('0x45')]);return db[_0xd6c1('0x2d')][_0xd6c1('0x46')](_0xfdefc8)[_0xd6c1('0x25')](handleEntityNotFound(_0x39ab9d,null))[_0xd6c1('0x25')](respondWithResult(_0x39ab9d,null))[_0xd6c1('0x43')](handleError(_0x39ab9d,null));};exports['create']=function(_0x330533,_0x4562c9){return db['AnalyticCustomReport'][_0xd6c1('0x47')](_0x330533['body'],{})['then'](function(_0x447b8a){var _0xe19d3=_0x330533['user'][_0xd6c1('0x26')]({'plain':!![]});if(!_0xe19d3)throw new Error(_0xd6c1('0x48'));if(_0xe19d3['role']===_0xd6c1('0x49')){var _0x31ce18=_0x447b8a['get']({'plain':!![]});var _0x30ae38=_0xd6c1('0x4a');return db[_0xd6c1('0x4b')][_0xd6c1('0x46')]({'where':{'name':_0x30ae38,'userProfileId':_0xe19d3['userProfileId']},'raw':!![]})[_0xd6c1('0x25')](function(_0x2a3db7){if(_0x2a3db7&&_0x2a3db7['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x31ce18[_0xd6c1('0x2a')],'resourceId':_0x31ce18['id'],'type':'CustomReports','sectionId':_0x2a3db7['id']},{})['then'](function(){return _0x447b8a;});}else{return _0x447b8a;}})['catch'](function(_0x3b9608){logger[_0xd6c1('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b9608);throw _0x3b9608;});}return _0x447b8a;})['then'](respondWithResult(_0x4562c9,0xc9))[_0xd6c1('0x43')](handleError(_0x4562c9,null));};exports[_0xd6c1('0x23')]=function(_0x3f3fd8,_0x553d36){if(_0x3f3fd8[_0xd6c1('0x4c')]['id']){delete _0x3f3fd8[_0xd6c1('0x4c')]['id'];}return db[_0xd6c1('0x2d')][_0xd6c1('0x46')]({'where':{'id':_0x3f3fd8[_0xd6c1('0x4d')]['id']}})[_0xd6c1('0x25')](handleEntityNotFound(_0x553d36,null))['then'](saveUpdates(_0x3f3fd8[_0xd6c1('0x4c')],null))[_0xd6c1('0x25')](respondWithResult(_0x553d36,null))[_0xd6c1('0x43')](handleError(_0x553d36,null));};exports[_0xd6c1('0x24')]=function(_0x3a3cbd,_0x3c3bad){return db[_0xd6c1('0x2d')][_0xd6c1('0x46')]({'where':{'id':_0x3a3cbd[_0xd6c1('0x4d')]['id']}})[_0xd6c1('0x25')](handleEntityNotFound(_0x3c3bad,null))[_0xd6c1('0x25')](removeEntity(_0x3c3bad,null))[_0xd6c1('0x43')](handleError(_0x3c3bad,null));};exports[_0xd6c1('0x4e')]=function(_0x22a495,_0x2a5569){var _0x4d7e02=0xa;var _0x3a77d0=[_0xd6c1('0x4f'),_0xd6c1('0x50'),'right_join',_0xd6c1('0x51')];var _0x2f99df={'SUM':'SUM(%s)','COUNT':_0xd6c1('0x52'),'COUNT DISTINCT':_0xd6c1('0x53'),'MAX':_0xd6c1('0x54'),'MIN':_0xd6c1('0x55'),'AVG':_0xd6c1('0x56'),'GROUP_CONCAT':_0xd6c1('0x57'),'GROUP_CONCAT ASC':_0xd6c1('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15626a={'SEC_TO_TIME':_0xd6c1('0x59'),'DATE':_0xd6c1('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x369466=function(_0x476426){return!_[_0xd6c1('0x5b')]([_0xd6c1('0x5c'),_0xd6c1('0x5d'),_0xd6c1('0x5e'),'IS\x20NOT\x20EMPTY'],_0x476426);};var _0x264554=function(_0x5a87be){if(!_0x5a87be||!_0x5a87be[_0xd6c1('0x5f')][_0xd6c1('0x35')]){return'';}for(var _0x36dfac='(',_0x4608fb=0x0;_0x4608fb<_0x5a87be['rules'][_0xd6c1('0x35')];_0x4608fb+=0x1){_0x4608fb>0x0&&(_0x36dfac+='\x20'+_0x5a87be['operator']+'\x20');_0x36dfac+=_0x5a87be[_0xd6c1('0x5f')][_0x4608fb]['group']?_0x264554(_0x5a87be[_0xd6c1('0x5f')][_0x4608fb]['group']):_0x5a87be['rules'][_0x4608fb][_0xd6c1('0x60')]+'\x20'+_0x5a87be[_0xd6c1('0x5f')][_0x4608fb][_0xd6c1('0x61')]+(_0x369466(_0x5a87be[_0xd6c1('0x5f')][_0x4608fb][_0xd6c1('0x61')])?'\x20'+_0x5a87be[_0xd6c1('0x5f')][_0x4608fb][_0xd6c1('0x62')]:'');}return _0x36dfac+')';};var _0x174028={'where':{'id':_0x22a495[_0xd6c1('0x4d')]['id']}},_0x46dbe1,_0x4124c5,_0x2e849b,_0x41f088,_0x275141;_0x174028=_[_0xd6c1('0x3d')]({},_0x174028,_0x22a495[_0xd6c1('0x45')]);return db[_0xd6c1('0x2d')][_0xd6c1('0x46')](_0x174028)['then'](function(_0x209ee7){if(_0x209ee7){_0x46dbe1=_0x209ee7;return _0x209ee7[_0xd6c1('0x63')]();}return null;})[_0xd6c1('0x25')](function(_0x262a2a){if(_0x262a2a){if(!_0x262a2a[_0xd6c1('0x35')]){throw new db[(_0xd6c1('0x64'))][(_0xd6c1('0x65'))](_0xd6c1('0x66'),0x193);}_0x4124c5=_0x262a2a;return db[_0xd6c1('0x67')][_0xd6c1('0x41')]({'raw':!![]});}return null;})[_0xd6c1('0x25')](function(_0x270726){if(_0x270726){_0x2e849b=_[_0xd6c1('0x68')](_0x270726,'id');var _0x2c50b4;var _0x590d49=squel['select']();_0x590d49[_0xd6c1('0x69')](_0x46dbe1[_0xd6c1('0x6a')]);for(var _0x1c6e78=0x0;_0x1c6e78<_0x4124c5['length'];_0x1c6e78+=0x1){_0x2c50b4=_0x4124c5[_0x1c6e78][_0xd6c1('0x6b')]?_0x2e849b[_0x4124c5[_0x1c6e78][_0xd6c1('0x6b')]][_0xd6c1('0x6c')]:_0x4124c5[_0x1c6e78][_0xd6c1('0x60')];_0x2c50b4=_0x4124c5[_0x1c6e78][_0xd6c1('0x6d')]?_[_0xd6c1('0x6e')](_0x2f99df[_0x4124c5[_0x1c6e78][_0xd6c1('0x6d')]],'%s',_0x2c50b4):_0x2c50b4;_0x2c50b4=_0x4124c5[_0x1c6e78][_0xd6c1('0x6f')]?_[_0xd6c1('0x6e')](_0x15626a[_0x4124c5[_0x1c6e78][_0xd6c1('0x6f')]],'%s',_0x2c50b4):_0x2c50b4;if(_0x4124c5[_0x1c6e78][_0xd6c1('0x70')]){_0x590d49[_0xd6c1('0x71')](_0x2c50b4);}_0x4124c5[_0x1c6e78][_0xd6c1('0x72')]&&_0x590d49[_0xd6c1('0x38')](_0x2c50b4,_0x4124c5[_0x1c6e78][_0xd6c1('0x72')]===_0xd6c1('0x73')?![]:!![]);_0x590d49[_0xd6c1('0x60')](_0x2c50b4,_0x4124c5[_0x1c6e78]['alias']||_0x2c50b4);}if(_0x46dbe1[_0xd6c1('0x74')]){_0x46dbe1[_0xd6c1('0x74')]=JSON[_0xd6c1('0x75')](_0x46dbe1[_0xd6c1('0x74')]);for(var _0x24d22d=0x0;_0x24d22d<_0x46dbe1[_0xd6c1('0x74')]['length'];_0x24d22d+=0x1){if(_0x46dbe1[_0xd6c1('0x74')][_0x24d22d][_0xd6c1('0x3e')]&&_['includes'](_0x3a77d0,_0x46dbe1[_0xd6c1('0x74')][_0x24d22d][_0xd6c1('0x3e')])&&_0x46dbe1['joins'][_0x24d22d][_0xd6c1('0x76')]&&_0x46dbe1[_0xd6c1('0x74')][_0x24d22d][_0xd6c1('0x77')]&&_0x46dbe1[_0xd6c1('0x74')][_0x24d22d][_0xd6c1('0x78')]){_0x590d49[_0x46dbe1[_0xd6c1('0x74')][_0x24d22d][_0xd6c1('0x3e')]](_0x46dbe1[_0xd6c1('0x74')][_0x24d22d][_0xd6c1('0x77')],null,util[_0xd6c1('0x6f')](_0xd6c1('0x79'),_0x46dbe1['table'],_0x46dbe1[_0xd6c1('0x74')][_0x24d22d][_0xd6c1('0x76')],_0x46dbe1[_0xd6c1('0x74')][_0x24d22d][_0xd6c1('0x77')],_0x46dbe1[_0xd6c1('0x74')][_0x24d22d][_0xd6c1('0x78')]));}}}if(_0x46dbe1[_0xd6c1('0x7a')]){_0x46dbe1[_0xd6c1('0x7a')]=JSON['parse'](_0x46dbe1[_0xd6c1('0x7a')]);_0x590d49[_0xd6c1('0x3a')](_0x264554(_0x46dbe1['conditions'][_0xd6c1('0x71')]));}_0x275141=_0x590d49['clone']();_0x590d49[_0xd6c1('0x37')](_0x4d7e02);_0x590d49[_0xd6c1('0x1d')](0x0);logger[_0xd6c1('0x7b')](_0xd6c1('0x7c'),_0x590d49[_0xd6c1('0x7d')]());return dbH['sequelize'][_0xd6c1('0x2f')](_0x590d49[_0xd6c1('0x7d')](),{'type':dbH[_0xd6c1('0x7e')][_0xd6c1('0x7f')]['SELECT']});}})[_0xd6c1('0x25')](respondWithResult(_0x2a5569,null))['catch'](handleError(_0x2a5569,null));};function runReport(_0x1e1654,_0xbf7f07,_0x133866){var _0x251898=_0xbf7f07[_0xd6c1('0x2a')];var _0x738bca=0xa;var _0x49375f=[_0xd6c1('0x4f'),_0xd6c1('0x50'),'right_join',_0xd6c1('0x51')];var _0x25caa8={'SUM':'SUM(%s)','COUNT':_0xd6c1('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd6c1('0x54'),'MIN':_0xd6c1('0x55'),'AVG':_0xd6c1('0x56'),'GROUP_CONCAT':_0xd6c1('0x57'),'GROUP_CONCAT ASC':_0xd6c1('0x58'),'GROUP_CONCAT DESC':_0xd6c1('0x80')};var _0x5cf0b7={'SEC_TO_TIME':_0xd6c1('0x59'),'DATE':_0xd6c1('0x5a'),'HOUR':_0xd6c1('0x81'),'ROUND':_0xd6c1('0x82'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3f95b2=function(_0xb8a6a9){return!_[_0xd6c1('0x5b')]([_0xd6c1('0x5c'),_0xd6c1('0x5d'),_0xd6c1('0x5e'),_0xd6c1('0x83')],_0xb8a6a9);};var _0x57c39c=function(_0x83f4a){if(!_0x83f4a||!_0x83f4a[_0xd6c1('0x5f')][_0xd6c1('0x35')]){return'';}for(var _0x544c33='(',_0x5f348f=0x0;_0x5f348f<_0x83f4a['rules'][_0xd6c1('0x35')];_0x5f348f+=0x1){_0x5f348f>0x0&&(_0x544c33+='\x20'+_0x83f4a['operator']+'\x20');_0x544c33+=_0x83f4a[_0xd6c1('0x5f')][_0x5f348f][_0xd6c1('0x71')]?_0x57c39c(_0x83f4a[_0xd6c1('0x5f')][_0x5f348f][_0xd6c1('0x71')]):_0x83f4a[_0xd6c1('0x5f')][_0x5f348f]['field']+'\x20'+_0x83f4a[_0xd6c1('0x5f')][_0x5f348f][_0xd6c1('0x61')]+(_0x3f95b2(_0x83f4a[_0xd6c1('0x5f')][_0x5f348f][_0xd6c1('0x61')])?'\x20'+_0x83f4a['rules'][_0x5f348f][_0xd6c1('0x62')]:'');}return _0x544c33+')';};var _0x354481={'where':{'id':_0x1e1654['id']}},_0x15c021,_0x24c55c,_0x33294c,_0x56cc03,_0x51a0cb;_0x354481=_['merge']({},_0x354481,_0x133866);return db[_0xd6c1('0x2d')][_0xd6c1('0x46')](_0x354481)[_0xd6c1('0x25')](function(_0x2d4cd){if(_0x2d4cd){_0x15c021=_0x2d4cd;return _0x2d4cd[_0xd6c1('0x63')]();}return null;})[_0xd6c1('0x25')](function(_0x1b9e98){if(_0x1b9e98){if(!_0x1b9e98[_0xd6c1('0x35')]){throw new db[(_0xd6c1('0x64'))][(_0xd6c1('0x65'))](_0xd6c1('0x66'),0x193);}_0x24c55c=_0x1b9e98;return db[_0xd6c1('0x67')]['findAll']({'raw':!![]});}return null;})[_0xd6c1('0x25')](function(_0x392e98){if(_0x392e98){_0x33294c=_['keyBy'](_0x392e98,'id');var _0x25a97e;var _0x335e03=squel[_0xd6c1('0x84')]();_0x335e03[_0xd6c1('0x69')](_0x15c021[_0xd6c1('0x6a')]);for(var _0xa7271a=0x0;_0xa7271a<_0x24c55c[_0xd6c1('0x35')];_0xa7271a+=0x1){_0x25a97e=_0x24c55c[_0xa7271a][_0xd6c1('0x6b')]?_0x33294c[_0x24c55c[_0xa7271a][_0xd6c1('0x6b')]][_0xd6c1('0x6c')]:_0x24c55c[_0xa7271a][_0xd6c1('0x60')];_0x25a97e=_0x24c55c[_0xa7271a]['function']?_[_0xd6c1('0x6e')](_0x25caa8[_0x24c55c[_0xa7271a][_0xd6c1('0x6d')]],'%s',_0x25a97e):_0x25a97e;_0x25a97e=_0x24c55c[_0xa7271a]['format']?_['replace'](_0x5cf0b7[_0x24c55c[_0xa7271a][_0xd6c1('0x6f')]],'%s',_0x25a97e):_0x25a97e;if(_0x24c55c[_0xa7271a]['groupBy']){_0x335e03[_0xd6c1('0x71')](_0x25a97e);}_0x24c55c[_0xa7271a]['orderBy']&&_0x335e03['order'](_0x25a97e,_0x24c55c[_0xa7271a][_0xd6c1('0x72')]==='DESC'?![]:!![]);_0x335e03[_0xd6c1('0x60')](_0x25a97e,_0x24c55c[_0xa7271a][_0xd6c1('0x85')]||_0x25a97e);}if(_0x15c021[_0xd6c1('0x74')]){_0x15c021[_0xd6c1('0x74')]=JSON[_0xd6c1('0x75')](_0x15c021[_0xd6c1('0x74')]);for(var _0x1fceac=0x0;_0x1fceac<_0x15c021['joins'][_0xd6c1('0x35')];_0x1fceac+=0x1){if(_0x15c021[_0xd6c1('0x74')][_0x1fceac]['type']&&_[_0xd6c1('0x5b')](_0x49375f,_0x15c021[_0xd6c1('0x74')][_0x1fceac][_0xd6c1('0x3e')])&&_0x15c021['joins'][_0x1fceac][_0xd6c1('0x76')]&&_0x15c021[_0xd6c1('0x74')][_0x1fceac]['foreignTable']&&_0x15c021[_0xd6c1('0x74')][_0x1fceac][_0xd6c1('0x78')]){_0x335e03[_0x15c021[_0xd6c1('0x74')][_0x1fceac][_0xd6c1('0x3e')]](_0x15c021[_0xd6c1('0x74')][_0x1fceac][_0xd6c1('0x77')],null,util[_0xd6c1('0x6f')](_0xd6c1('0x79'),_0x15c021['table'],_0x15c021[_0xd6c1('0x74')][_0x1fceac][_0xd6c1('0x76')],_0x15c021[_0xd6c1('0x74')][_0x1fceac]['foreignTable'],_0x15c021[_0xd6c1('0x74')][_0x1fceac]['foreignKey']));}}}if(_0x15c021[_0xd6c1('0x7a')]){_0x15c021[_0xd6c1('0x7a')]=JSON[_0xd6c1('0x75')](_0x15c021[_0xd6c1('0x7a')]);_0x335e03['where'](_0x57c39c(_0x15c021['conditions'][_0xd6c1('0x71')]));}_0x51a0cb=_0x335e03[_0xd6c1('0x86')]();_0x335e03[_0xd6c1('0x37')](_0x738bca);_0x335e03[_0xd6c1('0x1d')](0x0);return;}})['then'](function(){if(_0xbf7f07[_0xd6c1('0x87')]===_0xd6c1('0x88')){return null;}var _0x2eac64=_['merge'](_0xbf7f07,{'name':_0xbf7f07[_0xd6c1('0x89')]||_0xbf7f07[_0xd6c1('0x2a')]||_0x15c021[_0xd6c1('0x2a')],'basename':_0x251898,'savename':util[_0xd6c1('0x6f')](_0xd6c1('0x8a'),_0xbf7f07['name']||_0x15c021[_0xd6c1('0x2a')],require('randomstring')['generate'](0x4),_0xbf7f07[_0xd6c1('0x87')]||_0xd6c1('0x8b')),'reportId':_0x15c021['id'],'reportType':'custom'});return db[_0xd6c1('0x8c')][_0xd6c1('0x47')](_0x2eac64,{'raw':!![]});})['then'](function(_0x75ba05){if(_0x15c021[_0xd6c1('0x6a')]==='cdr'){_0x51a0cb[_0xd6c1('0x3a')](_0x15c021[_0xd6c1('0x6a')]+_0xd6c1('0x8d'),_0xbf7f07[_0xd6c1('0x8e')],_0xbf7f07[_0xd6c1('0x8f')]);}else{_0x51a0cb[_0xd6c1('0x3a')](_0x15c021[_0xd6c1('0x6a')]+_0xd6c1('0x90'),_0xbf7f07[_0xd6c1('0x8e')],_0xbf7f07[_0xd6c1('0x8f')]);}if(_0x75ba05){logger[_0xd6c1('0x91')]('Run\x20Query:',_0x51a0cb[_0xd6c1('0x7d')]());require(_0xd6c1('0x92'))[_0xd6c1('0x93')](path[_0xd6c1('0x4f')](__dirname,_0xd6c1('0x94'),_0x75ba05[_0xd6c1('0x87')]),[_0x75ba05['id'],_0x51a0cb['toString'](),path[_0xd6c1('0x4f')](__dirname,_0xd6c1('0x95'),_0x75ba05[_0xd6c1('0x96')]),_0x251898]);return _0x75ba05;}else{var _0x41fd80=squel[_0xd6c1('0x84')]();_0x41fd80[_0xd6c1('0x69')]('('+_0x51a0cb['toString']()+')',_0xd6c1('0x97'));_0x41fd80[_0xd6c1('0x60')](_0xd6c1('0x98'),_0xd6c1('0x1c'));_0x51a0cb[_0xd6c1('0x37')](_0xbf7f07[_0xd6c1('0x37')]||_0x738bca);_0x51a0cb[_0xd6c1('0x1d')](_0xbf7f07[_0xd6c1('0x1d')]||0x0);return dbH[_0xd6c1('0x7e')][_0xd6c1('0x2f')](_0x41fd80[_0xd6c1('0x7d')](),{'type':dbH[_0xd6c1('0x7e')]['QueryTypes'][_0xd6c1('0x99')]})[_0xd6c1('0x25')](function(_0x391a1f){if(!_0x391a1f[_0xd6c1('0x35')]){_0x56cc03=0x0;}else{_0x56cc03=_0x391a1f[0x0][_0xd6c1('0x1c')]||0x0;}return dbH[_0xd6c1('0x7e')]['query'](_0x51a0cb[_0xd6c1('0x7d')](),{'type':dbH[_0xd6c1('0x7e')]['QueryTypes'][_0xd6c1('0x99')]});})[_0xd6c1('0x25')](function(_0x2cb8f3){return{'rows':_0x2cb8f3||[],'count':_0x56cc03};});}});}exports['run']=function(_0x5e3e4c,_0x580e50){return runReport(_0x5e3e4c['params'],_0x5e3e4c[_0xd6c1('0x2f')],_0x5e3e4c[_0xd6c1('0x45')])[_0xd6c1('0x25')](respondWithResult(_0x580e50,null))[_0xd6c1('0x43')](handleError(_0x580e50,null));};exports['runReport']=runReport;exports[_0xd6c1('0x2f')]=function(_0xd8dbac,_0x211d3d){var _0x55033c=0xa;var _0x4b9029=[_0xd6c1('0x4f'),_0xd6c1('0x50'),_0xd6c1('0x9a'),_0xd6c1('0x51')];var _0x54fb63={'SUM':_0xd6c1('0x9b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd6c1('0x53'),'MAX':_0xd6c1('0x54'),'MIN':_0xd6c1('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd6c1('0x57'),'GROUP_CONCAT ASC':_0xd6c1('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4b0b61={'SEC_TO_TIME':_0xd6c1('0x59'),'DATE':_0xd6c1('0x5a'),'HOUR':_0xd6c1('0x81'),'ROUND':_0xd6c1('0x82'),'UNIX_TIMESTAMP':_0xd6c1('0x9c')};var _0x5f4999=function(_0x15fde2){return!_[_0xd6c1('0x5b')]([_0xd6c1('0x5c'),_0xd6c1('0x5d'),'IS\x20EMPTY',_0xd6c1('0x83')],_0x15fde2);};var _0x39b974=function(_0x5c1ec4){if(!_0x5c1ec4||!_0x5c1ec4[_0xd6c1('0x5f')]['length']){return'';}for(var _0xfaaf75='(',_0x50c444=0x0;_0x50c444<_0x5c1ec4['rules'][_0xd6c1('0x35')];_0x50c444+=0x1){_0x50c444>0x0&&(_0xfaaf75+='\x20'+_0x5c1ec4[_0xd6c1('0x9d')]+'\x20');_0xfaaf75+=_0x5c1ec4['rules'][_0x50c444][_0xd6c1('0x71')]?_0x39b974(_0x5c1ec4[_0xd6c1('0x5f')][_0x50c444]['group']):_0x5c1ec4[_0xd6c1('0x5f')][_0x50c444][_0xd6c1('0x60')]+'\x20'+_0x5c1ec4[_0xd6c1('0x5f')][_0x50c444]['condition']+(_0x5f4999(_0x5c1ec4[_0xd6c1('0x5f')][_0x50c444][_0xd6c1('0x61')])?'\x20'+_0x5c1ec4[_0xd6c1('0x5f')][_0x50c444][_0xd6c1('0x62')]:'');}return _0xfaaf75+')';};var _0x4c5f13={'where':{'id':_0xd8dbac['params']['id']}},_0x257f4a,_0x320ee0,_0x4256e0,_0x25f7ba,_0x4611a4;_0x4c5f13=_[_0xd6c1('0x3d')]({},_0x4c5f13,_0xd8dbac[_0xd6c1('0x45')]);return db[_0xd6c1('0x2d')][_0xd6c1('0x46')](_0x4c5f13)['then'](function(_0x1f1f50){if(_0x1f1f50){_0x257f4a=_0x1f1f50;return _0x1f1f50[_0xd6c1('0x63')]();}return null;})[_0xd6c1('0x25')](function(_0x50076c){if(_0x50076c){if(!_0x50076c['length']){throw new db['Sequelize'][(_0xd6c1('0x65'))](_0xd6c1('0x66'),0x193);}_0x320ee0=_0x50076c;return db[_0xd6c1('0x67')][_0xd6c1('0x41')]({'raw':!![]});}return null;})[_0xd6c1('0x25')](function(_0x5ccbab){if(_0x5ccbab){_0x4256e0=_[_0xd6c1('0x68')](_0x5ccbab,'id');var _0x2bfaa6;var _0x529fd7=squel[_0xd6c1('0x84')]();_0x529fd7[_0xd6c1('0x69')](_0x257f4a[_0xd6c1('0x6a')]);for(var _0x7d2e54=0x0;_0x7d2e54<_0x320ee0['length'];_0x7d2e54+=0x1){_0x2bfaa6=_0x320ee0[_0x7d2e54][_0xd6c1('0x6b')]?_0x4256e0[_0x320ee0[_0x7d2e54]['MetricId']][_0xd6c1('0x6c')]:_0x320ee0[_0x7d2e54][_0xd6c1('0x60')];_0x2bfaa6=_0x320ee0[_0x7d2e54]['function']?_[_0xd6c1('0x6e')](_0x54fb63[_0x320ee0[_0x7d2e54][_0xd6c1('0x6d')]],'%s',_0x2bfaa6):_0x2bfaa6;_0x2bfaa6=_0x320ee0[_0x7d2e54][_0xd6c1('0x6f')]?_[_0xd6c1('0x6e')](_0x4b0b61[_0x320ee0[_0x7d2e54]['format']],'%s',_0x2bfaa6):_0x2bfaa6;if(_0x320ee0[_0x7d2e54]['groupBy']){_0x529fd7[_0xd6c1('0x71')](_0x2bfaa6);}_0x320ee0[_0x7d2e54][_0xd6c1('0x72')]&&_0x529fd7['order'](_0x2bfaa6,_0x320ee0[_0x7d2e54]['orderBy']==='DESC'?![]:!![]);_0x529fd7[_0xd6c1('0x60')](_0x2bfaa6,_0x320ee0[_0x7d2e54][_0xd6c1('0x85')]||_0x2bfaa6);}if(_0x257f4a[_0xd6c1('0x74')]){_0x257f4a[_0xd6c1('0x74')]=JSON['parse'](_0x257f4a['joins']);for(var _0x58af57=0x0;_0x58af57<_0x257f4a[_0xd6c1('0x74')][_0xd6c1('0x35')];_0x58af57+=0x1){if(_0x257f4a[_0xd6c1('0x74')][_0x58af57][_0xd6c1('0x3e')]&&_[_0xd6c1('0x5b')](_0x4b9029,_0x257f4a[_0xd6c1('0x74')][_0x58af57][_0xd6c1('0x3e')])&&_0x257f4a[_0xd6c1('0x74')][_0x58af57][_0xd6c1('0x76')]&&_0x257f4a['joins'][_0x58af57]['foreignTable']&&_0x257f4a['joins'][_0x58af57][_0xd6c1('0x78')]){_0x529fd7[_0x257f4a['joins'][_0x58af57]['type']](_0x257f4a[_0xd6c1('0x74')][_0x58af57][_0xd6c1('0x77')],null,util[_0xd6c1('0x6f')](_0xd6c1('0x79'),_0x257f4a[_0xd6c1('0x6a')],_0x257f4a[_0xd6c1('0x74')][_0x58af57][_0xd6c1('0x76')],_0x257f4a['joins'][_0x58af57][_0xd6c1('0x77')],_0x257f4a['joins'][_0x58af57][_0xd6c1('0x78')]));}}}if(_0x257f4a['conditions']){_0x257f4a[_0xd6c1('0x7a')]=JSON[_0xd6c1('0x75')](_0x257f4a[_0xd6c1('0x7a')]);_0x529fd7['where'](_0x39b974(_0x257f4a[_0xd6c1('0x7a')]['group']));}_0x4611a4=_0x529fd7[_0xd6c1('0x86')]();_0x529fd7[_0xd6c1('0x37')](_0x55033c);_0x529fd7[_0xd6c1('0x1d')](0x0);logger[_0xd6c1('0x7b')]('Limited\x20Query:',_0x529fd7['toString']());return dbH[_0xd6c1('0x7e')][_0xd6c1('0x2f')](_0x529fd7[_0xd6c1('0x7d')](),{'type':dbH[_0xd6c1('0x7e')][_0xd6c1('0x7f')][_0xd6c1('0x99')]});}})[_0xd6c1('0x25')](function(){return{'sql':_0x4611a4[_0xd6c1('0x7d')]()};})[_0xd6c1('0x25')](respondWithResult(_0x211d3d,null))['catch'](handleError(_0x211d3d,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 050df8b..538f298 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 _0x57a9=['bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','../../config/logger','api'];(function(_0x30de86,_0x3f067c){var _0x84c896=function(_0x59c517){while(--_0x59c517){_0x30de86['push'](_0x30de86['shift']());}};_0x84c896(++_0x3f067c);}(_0x57a9,0x158));var _0x957a=function(_0xf92e67,_0x5de510){_0xf92e67=_0xf92e67-0x0;var _0x23438d=_0x57a9[_0xf92e67];return _0x23438d;};'use strict';var _=require(_0x957a('0x0'));var util=require(_0x957a('0x1'));var logger=require(_0x957a('0x2'))(_0x957a('0x3'));var moment=require('moment');var BPromise=require(_0x957a('0x4'));var rp=require(_0x957a('0x5'));var fs=require('fs');var path=require(_0x957a('0x6'));var rimraf=require('rimraf');var config=require(_0x957a('0x7'));var attributes=require(_0x957a('0x8'));module[_0x957a('0x9')]=function(_0x19417e,_0x2792b1){return _0x19417e[_0x957a('0xa')](_0x957a('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf44b=['api','moment','bluebird','request-promise','path','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0x5a666a,_0x4b3a24){var _0x3800f1=function(_0x13c22f){while(--_0x13c22f){_0x5a666a['push'](_0x5a666a['shift']());}};_0x3800f1(++_0x4b3a24);}(_0xf44b,0x18c));var _0xbf44=function(_0x33fcbb,_0x291d0f){_0x33fcbb=_0x33fcbb-0x0;var _0x2efe40=_0xf44b[_0x33fcbb];return _0x2efe40;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbf44('0x0'));var moment=require(_0xbf44('0x1'));var BPromise=require(_0xbf44('0x2'));var rp=require(_0xbf44('0x3'));var fs=require('fs');var path=require(_0xbf44('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbf44('0x5'));module['exports']=function(_0x31cb34,_0x4b532d){return _0x31cb34[_0xbf44('0x6')](_0xbf44('0x7'),attributes,{'tableName':_0xbf44('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 8f8c8bf..7de3d3a 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 _0x05d0=['rpc','../../config/environment','jayson/promise','client','http','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x05d0,0x1ad));var _0x005d=function(_0x381aea,_0x340970){_0x381aea=_0x381aea-0x0;var _0x29a7c3=_0x05d0[_0x381aea];return _0x29a7c3;};'use strict';var _=require(_0x005d('0x0'));var util=require(_0x005d('0x1'));var moment=require(_0x005d('0x2'));var BPromise=require('bluebird');var rs=require(_0x005d('0x3'));var fs=require('fs');var Redis=require(_0x005d('0x4'));var db=require(_0x005d('0x5'))['db'];var utils=require(_0x005d('0x6'));var logger=require(_0x005d('0x7'))(_0x005d('0x8'));var config=require(_0x005d('0x9'));var jayson=require(_0x005d('0xa'));var client=jayson[_0x005d('0xb')][_0x005d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2aeabc,_0x4cf4bf,_0x14373f){return new BPromise(function(_0x50dee8,_0x25583b){return client['request'](_0x2aeabc,_0x14373f)['then'](function(_0x163c2b){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x4cf4bf,_0x005d('0xd'));logger[_0x005d('0xe')](_0x005d('0xf'),_0x4cf4bf,_0x005d('0xd'),JSON[_0x005d('0x10')](_0x163c2b));if(_0x163c2b['error']){if(_0x163c2b[_0x005d('0x11')][_0x005d('0x12')]===0x1f4){logger[_0x005d('0x11')](_0x005d('0x13'),_0x4cf4bf,_0x163c2b[_0x005d('0x11')][_0x005d('0x14')]);return _0x25583b(_0x163c2b[_0x005d('0x11')]['message']);}logger[_0x005d('0x11')](_0x005d('0x13'),_0x4cf4bf,_0x163c2b['error'][_0x005d('0x14')]);return _0x50dee8(_0x163c2b[_0x005d('0x11')][_0x005d('0x14')]);}else{logger[_0x005d('0x15')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4cf4bf,'request\x20sent');_0x50dee8(_0x163c2b[_0x005d('0x16')]['message']);}})['catch'](function(_0x40793d){logger[_0x005d('0x11')](_0x005d('0x13'),_0x4cf4bf,_0x40793d);_0x25583b(_0x40793d);});});}
\ No newline at end of file
+var _0x2ddc=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x5254a5,_0x682eaa){var _0x3a36b7=function(_0x54f40c){while(--_0x54f40c){_0x5254a5['push'](_0x5254a5['shift']());}};_0x3a36b7(++_0x682eaa);}(_0x2ddc,0x1b2));var _0xc2dd=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x2ddc[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require('lodash');var util=require(_0xc2dd('0x0'));var moment=require(_0xc2dd('0x1'));var BPromise=require(_0xc2dd('0x2'));var rs=require(_0xc2dd('0x3'));var fs=require('fs');var Redis=require(_0xc2dd('0x4'));var db=require(_0xc2dd('0x5'))['db'];var utils=require(_0xc2dd('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc2dd('0x7'));var jayson=require(_0xc2dd('0x8'));var client=jayson[_0xc2dd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41b3b0,_0x2493fa,_0x1b2ada){return new BPromise(function(_0x35deef,_0x5f1e4c){return client[_0xc2dd('0xa')](_0x41b3b0,_0x1b2ada)[_0xc2dd('0xb')](function(_0x3a985f){logger['info'](_0xc2dd('0xc'),_0x2493fa,_0xc2dd('0xd'));logger[_0xc2dd('0xe')](_0xc2dd('0xf'),_0x2493fa,_0xc2dd('0xd'),JSON[_0xc2dd('0x10')](_0x3a985f));if(_0x3a985f[_0xc2dd('0x11')]){if(_0x3a985f['error'][_0xc2dd('0x12')]===0x1f4){logger[_0xc2dd('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2493fa,_0x3a985f[_0xc2dd('0x11')][_0xc2dd('0x13')]);return _0x5f1e4c(_0x3a985f[_0xc2dd('0x11')][_0xc2dd('0x13')]);}logger[_0xc2dd('0x11')](_0xc2dd('0xc'),_0x2493fa,_0x3a985f[_0xc2dd('0x11')]['message']);return _0x35deef(_0x3a985f['error']['message']);}else{logger[_0xc2dd('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2493fa,'request\x20sent');_0x35deef(_0x3a985f[_0xc2dd('0x15')][_0xc2dd('0x13')]);}})[_0xc2dd('0x16')](function(_0x55c520){logger[_0xc2dd('0x11')](_0xc2dd('0xc'),_0x2493fa,_0x55c520);_0x5f1e4c(_0x55c520);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 767c688..72eebf8 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 _0xd753=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','exports','multer'];(function(_0x298bf2,_0x183093){var _0x39d076=function(_0xcb9356){while(--_0xcb9356){_0x298bf2['push'](_0x298bf2['shift']());}};_0x39d076(++_0x183093);}(_0xd753,0x137));var _0x3d75=function(_0x3f645e,_0x14b15b){_0x3f645e=_0x3f645e-0x0;var _0x277d67=_0xd753[_0x3f645e];return _0x277d67;};'use strict';var multer=require(_0x3d75('0x0'));var util=require(_0x3d75('0x1'));var path=require('path');var timeout=require(_0x3d75('0x2'));var express=require(_0x3d75('0x3'));var router=express[_0x3d75('0x4')]();var fs_extra=require(_0x3d75('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3d75('0x6'));var config=require(_0x3d75('0x7'));var controller=require('./analyticCustomReport.controller');router[_0x3d75('0x8')]('/',auth[_0x3d75('0x9')](),controller[_0x3d75('0xa')]);router[_0x3d75('0x8')](_0x3d75('0xb'),auth['isAuthenticated'](),controller[_0x3d75('0xc')]);router[_0x3d75('0x8')](_0x3d75('0xd'),auth[_0x3d75('0x9')](),controller['preview']);router['get'](_0x3d75('0xe'),auth[_0x3d75('0x9')](),controller[_0x3d75('0xf')]);router[_0x3d75('0x8')](_0x3d75('0x10'),auth[_0x3d75('0x9')](),controller[_0x3d75('0x11')]);router[_0x3d75('0x12')]('/',auth['isAuthenticated'](),controller[_0x3d75('0x13')]);router[_0x3d75('0x14')]('/:id',auth[_0x3d75('0x9')](),controller[_0x3d75('0x15')]);router[_0x3d75('0x16')](_0x3d75('0xb'),auth[_0x3d75('0x9')](),controller['destroy']);module[_0x3d75('0x17')]=router;
\ No newline at end of file
+var _0x554f=['preview','run','post','create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id'];(function(_0x2a24d9,_0xa1323d){var _0x640a7d=function(_0x237a56){while(--_0x237a56){_0x2a24d9['push'](_0x2a24d9['shift']());}};_0x640a7d(++_0xa1323d);}(_0x554f,0x170));var _0xf554=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x554f[_0x38537f];return _0x141e23;};'use strict';var multer=require(_0xf554('0x0'));var util=require(_0xf554('0x1'));var path=require(_0xf554('0x2'));var timeout=require(_0xf554('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf554('0x4'));var auth=require(_0xf554('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf554('0x6'));var controller=require(_0xf554('0x7'));router[_0xf554('0x8')]('/',auth[_0xf554('0x9')](),controller[_0xf554('0xa')]);router[_0xf554('0x8')](_0xf554('0xb'),auth[_0xf554('0x9')](),controller['show']);router[_0xf554('0x8')]('/:id/preview',auth[_0xf554('0x9')](),controller[_0xf554('0xc')]);router['get']('/:id/run',auth[_0xf554('0x9')](),controller[_0xf554('0xd')]);router[_0xf554('0x8')]('/:id/query',auth['isAuthenticated'](),controller['query']);router[_0xf554('0xe')]('/',auth[_0xf554('0x9')](),controller[_0xf554('0xf')]);router[_0xf554('0x10')](_0xf554('0xb'),auth[_0xf554('0x9')](),controller[_0xf554('0x11')]);router[_0xf554('0x12')](_0xf554('0xb'),auth[_0xf554('0x9')](),controller['destroy']);module[_0xf554('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index bf7ccc1..857b8be 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x4417e2,_0x4d53b1){var _0x58b483=function(_0x1857be){while(--_0x1857be){_0x4417e2['push'](_0x4417e2['shift']());}};_0x58b483(++_0x4d53b1);}(_0x814b,0x1a2));var _0xb814=function(_0x9a7ea6,_0x1807a2){_0x9a7ea6=_0x9a7ea6-0x0;var _0x1c2040=_0x814b[_0x9a7ea6];return _0x1c2040;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}};
\ No newline at end of file
+var _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x23f3e6,_0x18df9d){var _0x5e9bc4=function(_0x431195){while(--_0x431195){_0x23f3e6['push'](_0x23f3e6['shift']());}};_0x5e9bc4(++_0x18df9d);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x270cac,_0x2be790){_0x270cac=_0x270cac-0x0;var _0x4fe8ae=_0x9c5a[_0x270cac];return _0x4fe8ae;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 5988d08..8a77aae 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 _0x3f8a=['get','DefaultReports','end','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','keys','intersection','model','attributes','fields','query','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','condition','ValidationErrorItem','metric','DESC','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','run','runReport','%s.%s\x20=\x20%s.%s','debug','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then'];(function(_0x426f3a,_0x3ad8bb){var _0x1f01b3=function(_0x2b96e4){while(--_0x2b96e4){_0x426f3a['push'](_0x426f3a['shift']());}};_0x1f01b3(++_0x3ad8bb);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x5408c9,_0x19f8e7){_0x5408c9=_0x5408c9-0x0;var _0x4512df=_0x3f8a[_0x5408c9];return _0x4512df;};'use strict';var emlformat=require(_0xa3f8('0x0'));var rimraf=require(_0xa3f8('0x1'));var zipdir=require(_0xa3f8('0x2'));var jsonpatch=require(_0xa3f8('0x3'));var rp=require('request-promise');var moment=require(_0xa3f8('0x4'));var BPromise=require(_0xa3f8('0x5'));var Mustache=require(_0xa3f8('0x6'));var util=require(_0xa3f8('0x7'));var path=require(_0xa3f8('0x8'));var sox=require(_0xa3f8('0x9'));var csv=require(_0xa3f8('0xa'));var ejs=require(_0xa3f8('0xb'));var fs=require('fs');var fs_extra=require(_0xa3f8('0xc'));var _=require(_0xa3f8('0xd'));var squel=require(_0xa3f8('0xe'));var crypto=require(_0xa3f8('0xf'));var jsforce=require(_0xa3f8('0x10'));var deskjs=require(_0xa3f8('0x11'));var toCsv=require(_0xa3f8('0xa'));var querystring=require(_0xa3f8('0x12'));var Papa=require(_0xa3f8('0x13'));var Redis=require('ioredis');var authService=require(_0xa3f8('0x14'));var qs=require(_0xa3f8('0x15'));var as=require(_0xa3f8('0x16'));var hardwareService=require(_0xa3f8('0x17'));var logger=require('../../config/logger')(_0xa3f8('0x18'));var utils=require(_0xa3f8('0x19'));var config=require(_0xa3f8('0x1a'));var licenseUtil=require(_0xa3f8('0x1b'));var db=require(_0xa3f8('0x1c'))['db'];var dbH=require(_0xa3f8('0x1c'))[_0xa3f8('0x1d')];function respondWithStatusCode(_0x63de8b,_0x324aa8){_0x324aa8=_0x324aa8||0xcc;return function(_0x36b1b8){if(_0x36b1b8){return _0x63de8b[_0xa3f8('0x1e')](_0x324aa8);}return _0x63de8b[_0xa3f8('0x1f')](_0x324aa8)['end']();};}function respondWithResult(_0x2d8f74,_0xe55848){_0xe55848=_0xe55848||0xc8;return function(_0x45014f){if(_0x45014f){return _0x2d8f74[_0xa3f8('0x1f')](_0xe55848)['json'](_0x45014f);}};}function respondWithFilteredResult(_0x39c450,_0x33b98e){return function(_0x46a8d9){if(_0x46a8d9){var _0x8cd130=typeof _0x33b98e[_0xa3f8('0x20')]===_0xa3f8('0x21')&&typeof _0x33b98e[_0xa3f8('0x22')]===_0xa3f8('0x21');var _0x2cb49f=_0x46a8d9[_0xa3f8('0x23')];var _0x54b870=_0x8cd130?0x0:_0x33b98e[_0xa3f8('0x20')];var _0x5a0e18=_0x8cd130?_0x46a8d9[_0xa3f8('0x23')]:_0x33b98e[_0xa3f8('0x20')]+_0x33b98e[_0xa3f8('0x22')];var _0x46042d;if(_0x5a0e18>=_0x2cb49f){_0x5a0e18=_0x2cb49f;_0x46042d=0xc8;}else{_0x46042d=0xce;}_0x39c450['status'](_0x46042d);return _0x39c450[_0xa3f8('0x24')]('Content-Range',_0x54b870+'-'+_0x5a0e18+'/'+_0x2cb49f)[_0xa3f8('0x25')](_0x46a8d9);}return null;};}function patchUpdates(_0x58336d){return function(_0x4066bb){try{jsonpatch[_0xa3f8('0x26')](_0x4066bb,_0x58336d,!![]);}catch(_0x353daa){return BPromise[_0xa3f8('0x27')](_0x353daa);}return _0x4066bb[_0xa3f8('0x28')]();};}function saveUpdates(_0x1e5f30,_0x187352){return function(_0x490717){if(_0x490717){return _0x490717[_0xa3f8('0x29')](_0x1e5f30)['then'](function(_0x3ce57b){return _0x3ce57b;});}return null;};}function removeEntity(_0xa5a697,_0x24985a){return function(_0x37b290){if(_0x37b290){return _0x37b290[_0xa3f8('0x2a')]()[_0xa3f8('0x2b')](function(){var _0x6e3cb4=_0x37b290[_0xa3f8('0x2c')]({'plain':!![]});var _0x1e22b8=_0xa3f8('0x2d');return db['UserProfileResource'][_0xa3f8('0x2a')]({'where':{'type':_0x1e22b8,'resourceId':_0x6e3cb4['id']}})[_0xa3f8('0x2b')](function(){return _0x37b290;});})[_0xa3f8('0x2b')](function(){_0xa5a697['status'](0xcc)[_0xa3f8('0x2e')]();});}};}function handleEntityNotFound(_0x57f6be,_0xbad6a6){return function(_0x3a3746){if(!_0x3a3746){_0x57f6be[_0xa3f8('0x1e')](0x194);}return _0x3a3746;};}function handleError(_0x4ea213,_0x458824){_0x458824=_0x458824||0x1f4;return function(_0x5e69e2){logger[_0xa3f8('0x2f')](_0x5e69e2[_0xa3f8('0x30')]);if(_0x5e69e2[_0xa3f8('0x31')]){delete _0x5e69e2[_0xa3f8('0x31')];}_0x4ea213[_0xa3f8('0x1f')](_0x458824)[_0xa3f8('0x32')](_0x5e69e2);};}exports[_0xa3f8('0x33')]=function(_0x424a3e,_0x25f9f5){var _0x290a4e={},_0x6e83b0={},_0x57c465={'count':0x0,'rows':[]};var _0x4404da=_[_0xa3f8('0x34')](db[_0xa3f8('0x35')][_0xa3f8('0x36')],function(_0x3bb4b0){return{'name':_0x3bb4b0['fieldName'],'type':_0x3bb4b0[_0xa3f8('0x37')][_0xa3f8('0x38')]};});_0x6e83b0['model']=_[_0xa3f8('0x34')](_0x4404da,_0xa3f8('0x31'));_0x6e83b0['query']=_[_0xa3f8('0x39')](_0x424a3e['query']);_0x6e83b0['filters']=_[_0xa3f8('0x3a')](_0x6e83b0[_0xa3f8('0x3b')],_0x6e83b0['query']);_0x290a4e[_0xa3f8('0x3c')]=_['intersection'](_0x6e83b0[_0xa3f8('0x3b')],qs[_0xa3f8('0x3d')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x290a4e['attributes']=_0x290a4e[_0xa3f8('0x3c')]['length']?_0x290a4e[_0xa3f8('0x3c')]:_0x6e83b0['model'];if(!_0x424a3e[_0xa3f8('0x3e')]['hasOwnProperty']('nolimit')){_0x290a4e['limit']=qs[_0xa3f8('0x22')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x22')]);_0x290a4e[_0xa3f8('0x20')]=qs['offset'](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x20')]);}_0x290a4e[_0xa3f8('0x3f')]=qs[_0xa3f8('0x40')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x40')]);_0x290a4e['where']=qs[_0xa3f8('0x41')](_[_0xa3f8('0x42')](_0x424a3e[_0xa3f8('0x3e')],_0x6e83b0['filters']),_0x4404da);if(_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x43')]){_0x290a4e['where']=_[_0xa3f8('0x44')](_0x290a4e['where'],{'$or':_[_0xa3f8('0x34')](_0x4404da,function(_0x5a077c){if(_0x5a077c[_0xa3f8('0x37')]!==_0xa3f8('0x45')){var _0x9a00e7={};_0x9a00e7[_0x5a077c[_0xa3f8('0x31')]]={'$like':'%'+_0x424a3e[_0xa3f8('0x3e')]['filter']+'%'};return _0x9a00e7;}})});}_0x290a4e=_[_0xa3f8('0x44')]({},_0x290a4e,_0x424a3e[_0xa3f8('0x46')]);var _0x4db9c5={'where':_0x290a4e[_0xa3f8('0x47')]};return db['AnalyticDefaultReport'][_0xa3f8('0x23')](_0x4db9c5)[_0xa3f8('0x2b')](function(_0x1542cc){_0x57c465[_0xa3f8('0x23')]=_0x1542cc;if(_0x424a3e[_0xa3f8('0x3e')]['includeAll']){_0x290a4e[_0xa3f8('0x48')]=[{'all':!![]}];}return db[_0xa3f8('0x35')][_0xa3f8('0x49')](_0x290a4e);})[_0xa3f8('0x2b')](function(_0x337808){_0x57c465['rows']=_0x337808;return _0x57c465;})[_0xa3f8('0x2b')](respondWithFilteredResult(_0x25f9f5,_0x290a4e))[_0xa3f8('0x4a')](handleError(_0x25f9f5,null));};exports[_0xa3f8('0x4b')]=function(_0x32e371,_0x2a124b){var _0x314dba={'raw':!![],'where':{'id':_0x32e371[_0xa3f8('0x4c')]['id']}},_0x497217={};_0x497217[_0xa3f8('0x3b')]=_[_0xa3f8('0x39')](db[_0xa3f8('0x35')][_0xa3f8('0x36')]);_0x497217[_0xa3f8('0x3e')]=_['keys'](_0x32e371['query']);_0x497217['filters']=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],_0x497217[_0xa3f8('0x3e')]);_0x314dba[_0xa3f8('0x3c')]=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],qs['fields'](_0x32e371[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x314dba[_0xa3f8('0x3c')]=_0x314dba[_0xa3f8('0x3c')]['length']?_0x314dba[_0xa3f8('0x3c')]:_0x497217[_0xa3f8('0x3b')];if(_0x32e371[_0xa3f8('0x3e')]['includeAll']){_0x314dba['include']=[{'all':!![]}];}_0x314dba=_['merge']({},_0x314dba,_0x32e371[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')]['find'](_0x314dba)[_0xa3f8('0x2b')](handleEntityNotFound(_0x2a124b,null))[_0xa3f8('0x2b')](respondWithResult(_0x2a124b,null))[_0xa3f8('0x4a')](handleError(_0x2a124b,null));};exports[_0xa3f8('0x4d')]=function(_0x14932f,_0x3c74b5){return db[_0xa3f8('0x35')][_0xa3f8('0x4d')](_0x14932f[_0xa3f8('0x4e')],{})[_0xa3f8('0x2b')](function(_0x338554){var _0x29d8f5=_0x14932f[_0xa3f8('0x4f')][_0xa3f8('0x2c')]({'plain':!![]});if(!_0x29d8f5)throw new Error(_0xa3f8('0x50'));if(_0x29d8f5[_0xa3f8('0x51')]===_0xa3f8('0x4f')){var _0x559ae7=_0x338554['get']({'plain':!![]});var _0x1fad80=_0xa3f8('0x52');return db['UserProfileSection'][_0xa3f8('0x53')]({'where':{'name':_0x1fad80,'userProfileId':_0x29d8f5[_0xa3f8('0x54')]},'raw':!![]})[_0xa3f8('0x2b')](function(_0xaff79b){if(_0xaff79b&&_0xaff79b[_0xa3f8('0x55')]===0x0){return db[_0xa3f8('0x56')][_0xa3f8('0x4d')]({'name':_0x559ae7[_0xa3f8('0x31')],'resourceId':_0x559ae7['id'],'type':_0xa3f8('0x2d'),'sectionId':_0xaff79b['id']},{})[_0xa3f8('0x2b')](function(){return _0x338554;});}else{return _0x338554;}})[_0xa3f8('0x4a')](function(_0x3752fa){logger[_0xa3f8('0x2f')](_0xa3f8('0x57'),_0x3752fa);throw _0x3752fa;});}return _0x338554;})[_0xa3f8('0x2b')](respondWithResult(_0x3c74b5,0xc9))[_0xa3f8('0x4a')](handleError(_0x3c74b5,null));};exports['update']=function(_0x593614,_0xd0628e){if(_0x593614['body']['id']){delete _0x593614[_0xa3f8('0x4e')]['id'];}return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x593614['params']['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0xd0628e,null))[_0xa3f8('0x2b')](saveUpdates(_0x593614[_0xa3f8('0x4e')],null))[_0xa3f8('0x2b')](respondWithResult(_0xd0628e,null))['catch'](handleError(_0xd0628e,null));};exports[_0xa3f8('0x2a')]=function(_0x47cc0c,_0x392e1e){return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x47cc0c['params']['id']}})['then'](handleEntityNotFound(_0x392e1e,null))[_0xa3f8('0x2b')](removeEntity(_0x392e1e,null))[_0xa3f8('0x4a')](handleError(_0x392e1e,null));};exports[_0xa3f8('0x58')]=function(_0x6ad40a,_0x48f5a6){var _0x36eac9=0xa;var _0x3478e8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x5d7877={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x521719={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x27de61=function(_0x356643){return!_[_0xa3f8('0x68')](['IS\x20NULL',_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x356643);};var _0x42e3f8=function(_0x27c5aa){if(!_0x27c5aa||!_0x27c5aa[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x4d0404='(',_0x33ea06=0x0;_0x33ea06<_0x27c5aa[_0xa3f8('0x6c')]['length'];_0x33ea06+=0x1){_0x33ea06>0x0&&(_0x4d0404+='\x20'+_0x27c5aa[_0xa3f8('0x6e')]+'\x20');_0x4d0404+=_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]?_0x42e3f8(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]):_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x70')]+'\x20'+_0x27c5aa['rules'][_0x33ea06]['condition']+(_0x27de61(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06]['condition'])?'\x20'+_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x71')]:'');}return _0x4d0404+')';};var _0x3ff369={'where':{'id':_0x6ad40a[_0xa3f8('0x4c')]['id']}},_0x1dba7e,_0x452e99,_0x35d4d6,_0xeca2dc,_0x14508d;_0x3ff369=_[_0xa3f8('0x44')]({},_0x3ff369,_0x6ad40a[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x3ff369)['then'](function(_0x5efdcf){if(_0x5efdcf){_0x1dba7e=_0x5efdcf;return _0x5efdcf[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x1688ca){if(_0x1688ca){if(!_0x1688ca[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))]['ValidationErrorItem'](_0xa3f8('0x74'),0x193);}_0x452e99=_0x1688ca;return db[_0xa3f8('0x75')][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x28d359){if(_0x28d359){_0x35d4d6=_[_0xa3f8('0x76')](_0x28d359,'id');var _0x3d45ae;var _0x3a2362=squel[_0xa3f8('0x77')]();_0x3a2362[_0xa3f8('0x78')](_0x1dba7e[_0xa3f8('0x79')]);for(var _0x5d4fe5=0x0;_0x5d4fe5<_0x452e99[_0xa3f8('0x6d')];_0x5d4fe5+=0x1){_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7a')]?_0x35d4d6[_0x452e99[_0x5d4fe5]['MetricId']]['metric']:_0x452e99[_0x5d4fe5][_0xa3f8('0x70')];_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x5d7877[_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]],'%s',_0x3d45ae):_0x3d45ae;_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x521719[_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]],'%s',_0x3d45ae):_0x3d45ae;if(_0x452e99[_0x5d4fe5][_0xa3f8('0x7e')]){_0x3a2362['group'](_0x3d45ae);}_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]&&_0x3a2362[_0xa3f8('0x3f')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3a2362[_0xa3f8('0x70')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x80')]||_0x3d45ae);}if(_0x1dba7e['joins']){_0x1dba7e[_0xa3f8('0x81')]=JSON[_0xa3f8('0x82')](_0x1dba7e[_0xa3f8('0x81')]);for(var _0x14a5b5=0x0;_0x14a5b5<_0x1dba7e[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x14a5b5+=0x1){if(_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x3478e8,_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x37')])&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x83')]&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')]&&_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x85')]){_0x3a2362[_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]](_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')]('%s.%s\x20=\x20%s.%s',_0x1dba7e[_0xa3f8('0x79')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x83')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x84')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5]['foreignKey']));}}}if(_0x1dba7e[_0xa3f8('0x86')]){_0x1dba7e[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1dba7e['conditions']);_0x3a2362[_0xa3f8('0x47')](_0x42e3f8(_0x1dba7e['conditions'][_0xa3f8('0x6f')]));}_0x14508d=_0x3a2362['clone']();_0x3a2362['limit'](_0x36eac9);_0x3a2362[_0xa3f8('0x20')](0x0);logger['debug'](_0xa3f8('0x87'),_0x3a2362['toString']());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3a2362[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](respondWithResult(_0x48f5a6,null))['catch'](handleError(_0x48f5a6,null));};function runReport(_0x3187e0,_0xd0d568,_0x3715ea){var _0x345089=_0xd0d568[_0xa3f8('0x31')];var _0x20ae51=0xa;var _0x190ce8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x7dc5ec={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2e2d99={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x599484=function(_0x24fe62){return!_[_0xa3f8('0x68')]([_0xa3f8('0x8c'),_0xa3f8('0x69'),'IS\x20EMPTY',_0xa3f8('0x6b')],_0x24fe62);};var _0x427830=function(_0x3c5091){if(!_0x3c5091||!_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x2db7dd='(',_0x12fe03=0x0;_0x12fe03<_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')];_0x12fe03+=0x1){_0x12fe03>0x0&&(_0x2db7dd+='\x20'+_0x3c5091[_0xa3f8('0x6e')]+'\x20');_0x2db7dd+=_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']?_0x427830(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']):_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x70')]+'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')]+(_0x599484(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')])?'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x71')]:'');}return _0x2db7dd+')';};var _0x4bb7dd={'where':{'id':_0x3187e0['id']}},_0x2c6efe,_0x4f9513,_0x39bd5c,_0x52fcc3,_0x2d2883;_0x4bb7dd=_['merge']({},_0x4bb7dd,_0x3715ea);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x4bb7dd)[_0xa3f8('0x2b')](function(_0xe3cc6a){if(_0xe3cc6a){_0x2c6efe=_0xe3cc6a;return _0xe3cc6a['getFields']();}return null;})[_0xa3f8('0x2b')](function(_0x3d343f){if(_0x3d343f){if(!_0x3d343f[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f9513=_0x3d343f;return db['AnalyticMetric'][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0xbe1a54){if(_0xbe1a54){_0x39bd5c=_[_0xa3f8('0x76')](_0xbe1a54,'id');var _0x477b0a;var _0x565a10=squel[_0xa3f8('0x77')]();_0x565a10[_0xa3f8('0x78')](_0x2c6efe['table']);for(var _0x4494a5=0x0;_0x4494a5<_0x4f9513[_0xa3f8('0x6d')];_0x4494a5+=0x1){_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7a')]?_0x39bd5c[_0x4f9513[_0x4494a5]['MetricId']][_0xa3f8('0x8f')]:_0x4f9513[_0x4494a5][_0xa3f8('0x70')];_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x7dc5ec[_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]],'%s',_0x477b0a):_0x477b0a;_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x2e2d99[_0x4f9513[_0x4494a5]['format']],'%s',_0x477b0a):_0x477b0a;if(_0x4f9513[_0x4494a5][_0xa3f8('0x7e')]){_0x565a10[_0xa3f8('0x6f')](_0x477b0a);}_0x4f9513[_0x4494a5]['orderBy']&&_0x565a10[_0xa3f8('0x3f')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x7f')]===_0xa3f8('0x90')?![]:!![]);_0x565a10[_0xa3f8('0x70')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x80')]||_0x477b0a);}if(_0x2c6efe[_0xa3f8('0x81')]){_0x2c6efe[_0xa3f8('0x81')]=JSON['parse'](_0x2c6efe[_0xa3f8('0x81')]);for(var _0x151bab=0x0;_0x151bab<_0x2c6efe[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x151bab+=0x1){if(_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x190ce8,_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')])&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')]&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable']&&_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x85')]){_0x565a10[_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')]](_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x84')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2c6efe[_0xa3f8('0x79')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable'],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignKey']));}}}if(_0x2c6efe[_0xa3f8('0x86')]){_0x2c6efe[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x2c6efe['conditions']);_0x565a10['where'](_0x427830(_0x2c6efe['conditions'][_0xa3f8('0x6f')]));}_0x2d2883=_0x565a10[_0xa3f8('0x91')]();_0x565a10[_0xa3f8('0x22')](_0x20ae51);_0x565a10[_0xa3f8('0x20')](0x0);return;}})[_0xa3f8('0x2b')](function(){if(_0xd0d568[_0xa3f8('0x92')]===_0xa3f8('0x93')){return null;}var _0x18890e=_['merge'](_0xd0d568,{'name':_0xd0d568[_0xa3f8('0x94')]||_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe[_0xa3f8('0x31')],'basename':_0x345089,'savename':util['format'](_0xa3f8('0x95'),_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe['name'],require(_0xa3f8('0x96'))[_0xa3f8('0x97')](0x4),_0xd0d568['output']||_0xa3f8('0x98')),'reportId':_0x2c6efe['id'],'reportType':_0xa3f8('0x99')});return db['AnalyticExtractedReport'][_0xa3f8('0x4d')](_0x18890e,{'raw':!![]});})[_0xa3f8('0x2b')](function(_0x21cc1d){if(_0x2c6efe['table']===_0xa3f8('0x9a')){_0x2d2883[_0xa3f8('0x47')](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9b'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568['endDate']);}else{_0x2d2883['where'](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9d'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568[_0xa3f8('0x9e')]);}if(_0x21cc1d){logger['info'](_0xa3f8('0x9f'),_0x2d2883[_0xa3f8('0x89')]());require(_0xa3f8('0xa0'))[_0xa3f8('0xa1')](path[_0xa3f8('0x59')](__dirname,_0xa3f8('0xa2'),_0x21cc1d[_0xa3f8('0x92')]),[_0x21cc1d['id'],_0x2d2883[_0xa3f8('0x89')](),path['join'](__dirname,_0xa3f8('0xa3'),_0x21cc1d['savename']),_0x345089]);return _0x21cc1d;}else{var _0xe9842=squel['select']();_0xe9842['from']('('+_0x2d2883[_0xa3f8('0x89')]()+')',_0xa3f8('0xa4'));_0xe9842[_0xa3f8('0x70')](_0xa3f8('0xa5'),_0xa3f8('0x23'));_0x2d2883['limit'](_0xd0d568['limit']||_0x20ae51);_0x2d2883[_0xa3f8('0x20')](_0xd0d568[_0xa3f8('0x20')]||0x0);return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0xe9842[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]})[_0xa3f8('0x2b')](function(_0x5a4f4a){if(!_0x5a4f4a['length']){_0x52fcc3=0x0;}else{_0x52fcc3=_0x5a4f4a[0x0][_0xa3f8('0x23')]||0x0;}return dbH[_0xa3f8('0x88')]['query'](_0x2d2883[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});})[_0xa3f8('0x2b')](function(_0x52f592){return{'rows':_0x52f592||[],'count':_0x52fcc3};});}});}exports[_0xa3f8('0xa7')]=function(_0x59026b,_0x234636){return runReport(_0x59026b[_0xa3f8('0x4c')],_0x59026b['query'],_0x59026b['options'])[_0xa3f8('0x2b')](respondWithResult(_0x234636,null))[_0xa3f8('0x4a')](handleError(_0x234636,null));};exports[_0xa3f8('0xa8')]=runReport;exports[_0xa3f8('0x3e')]=function(_0x26ec07,_0x2c9db8){var _0x18ab67=0xa;var _0x1f21a2=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x15a11c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x481b70={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x1f776a=function(_0x5b1527){return!_['includes']([_0xa3f8('0x8c'),_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x5b1527);};var _0x4670cc=function(_0xfde509){if(!_0xfde509||!_0xfde509['rules']['length']){return'';}for(var _0x3d81fe='(',_0x15111a=0x0;_0x15111a<_0xfde509[_0xa3f8('0x6c')]['length'];_0x15111a+=0x1){_0x15111a>0x0&&(_0x3d81fe+='\x20'+_0xfde509[_0xa3f8('0x6e')]+'\x20');_0x3d81fe+=_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']?_0x4670cc(_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']):_0xfde509[_0xa3f8('0x6c')][_0x15111a]['field']+'\x20'+_0xfde509['rules'][_0x15111a][_0xa3f8('0x8d')]+(_0x1f776a(_0xfde509[_0xa3f8('0x6c')][_0x15111a][_0xa3f8('0x8d')])?'\x20'+_0xfde509[_0xa3f8('0x6c')][_0x15111a]['value']:'');}return _0x3d81fe+')';};var _0x2e694e={'where':{'id':_0x26ec07[_0xa3f8('0x4c')]['id']}},_0x1669be,_0x4f248f,_0x6ef1ad,_0xae3a31,_0x31d45c;_0x2e694e=_[_0xa3f8('0x44')]({},_0x2e694e,_0x26ec07[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x2e694e)[_0xa3f8('0x2b')](function(_0x529021){if(_0x529021){_0x1669be=_0x529021;return _0x529021[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x35c498){if(_0x35c498){if(!_0x35c498[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f248f=_0x35c498;return db[_0xa3f8('0x75')]['findAll']({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x286490){if(_0x286490){_0x6ef1ad=_['keyBy'](_0x286490,'id');var _0x16e98d;var _0x3be5c9=squel['select']();_0x3be5c9[_0xa3f8('0x78')](_0x1669be[_0xa3f8('0x79')]);for(var _0x5260e0=0x0;_0x5260e0<_0x4f248f[_0xa3f8('0x6d')];_0x5260e0+=0x1){_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7a')]?_0x6ef1ad[_0x4f248f[_0x5260e0]['MetricId']][_0xa3f8('0x8f')]:_0x4f248f[_0x5260e0][_0xa3f8('0x70')];_0x16e98d=_0x4f248f[_0x5260e0]['function']?_['replace'](_0x15a11c[_0x4f248f[_0x5260e0][_0xa3f8('0x7b')]],'%s',_0x16e98d):_0x16e98d;_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x481b70[_0x4f248f[_0x5260e0]['format']],'%s',_0x16e98d):_0x16e98d;if(_0x4f248f[_0x5260e0]['groupBy']){_0x3be5c9[_0xa3f8('0x6f')](_0x16e98d);}_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]&&_0x3be5c9['order'](_0x16e98d,_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3be5c9[_0xa3f8('0x70')](_0x16e98d,_0x4f248f[_0x5260e0]['alias']||_0x16e98d);}if(_0x1669be[_0xa3f8('0x81')]){_0x1669be['joins']=JSON['parse'](_0x1669be[_0xa3f8('0x81')]);for(var _0x5ac693=0x0;_0x5ac693<_0x1669be[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x5ac693+=0x1){if(_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x1f21a2,_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')])&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')]&&_0x1669be['joins'][_0x5ac693][_0xa3f8('0x84')]&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]){_0x3be5c9[_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]](_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')](_0xa3f8('0xa9'),_0x1669be[_0xa3f8('0x79')],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')],_0x1669be[_0xa3f8('0x81')][_0x5ac693]['foreignTable'],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]));}}}if(_0x1669be[_0xa3f8('0x86')]){_0x1669be[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1669be[_0xa3f8('0x86')]);_0x3be5c9['where'](_0x4670cc(_0x1669be[_0xa3f8('0x86')][_0xa3f8('0x6f')]));}_0x31d45c=_0x3be5c9[_0xa3f8('0x91')]();_0x3be5c9[_0xa3f8('0x22')](_0x18ab67);_0x3be5c9[_0xa3f8('0x20')](0x0);logger[_0xa3f8('0xaa')](_0xa3f8('0x87'),_0x3be5c9[_0xa3f8('0x89')]());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3be5c9[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](function(){return{'sql':_0x31d45c[_0xa3f8('0x89')]()};})[_0xa3f8('0x2b')](respondWithResult(_0x2c9db8,null))[_0xa3f8('0x4a')](handleError(_0x2c9db8,null));};
\ No newline at end of file
+var _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x32d466,_0x80b652){var _0x2256a8=function(_0x445dda){while(--_0x445dda){_0x32d466['push'](_0x32d466['shift']());}};_0x2256a8(++_0x80b652);}(_0x814b,0x1a2));var _0xb814=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0x814b[_0x2891d1];return _0x486948;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 258c62c..0f7ee20 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 _0x8e2e=['../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util'];(function(_0x307008,_0x5344cf){var _0x41c656=function(_0x4e4c2a){while(--_0x4e4c2a){_0x307008['push'](_0x307008['shift']());}};_0x41c656(++_0x5344cf);}(_0x8e2e,0x172));var _0xe8e2=function(_0x105c50,_0x29ba3e){_0x105c50=_0x105c50-0x0;var _0x570327=_0x8e2e[_0x105c50];return _0x570327;};'use strict';var _=require(_0xe8e2('0x0'));var util=require(_0xe8e2('0x1'));var logger=require(_0xe8e2('0x2'))(_0xe8e2('0x3'));var moment=require('moment');var BPromise=require(_0xe8e2('0x4'));var rp=require(_0xe8e2('0x5'));var fs=require('fs');var path=require(_0xe8e2('0x6'));var rimraf=require(_0xe8e2('0x7'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0xe8e2('0x8')]=function(_0x2b5a2d,_0x18480f){return _0x2b5a2d[_0xe8e2('0x9')](_0xe8e2('0xa'),attributes,{'tableName':_0xe8e2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3ae7=['AnalyticDefaultReport','lodash','api','bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define'];(function(_0x22c5e3,_0x226ea1){var _0x313bfd=function(_0xc47f0f){while(--_0xc47f0f){_0x22c5e3['push'](_0x22c5e3['shift']());}};_0x313bfd(++_0x226ea1);}(_0x3ae7,0x15f));var _0x73ae=function(_0x386292,_0x7e5d9a){_0x386292=_0x386292-0x0;var _0x2522e8=_0x3ae7[_0x386292];return _0x2522e8;};'use strict';var _=require(_0x73ae('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x73ae('0x1'));var moment=require('moment');var BPromise=require(_0x73ae('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x73ae('0x3'));var rimraf=require(_0x73ae('0x4'));var config=require(_0x73ae('0x5'));var attributes=require(_0x73ae('0x6'));module[_0x73ae('0x7')]=function(_0x42ecc9,_0xd2190d){return _0x42ecc9[_0x73ae('0x8')](_0x73ae('0x9'),attributes,{'tableName':'analytics_default_reports','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 4970ba0..443dbde 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 _0x2318=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x52ce8b,_0x51a3c1){var _0x5a7e57=function(_0x54f3d2){while(--_0x54f3d2){_0x52ce8b['push'](_0x52ce8b['shift']());}};_0x5a7e57(++_0x51a3c1);}(_0x2318,0x103));var _0x8231=function(_0x27d7ca,_0x111288){_0x27d7ca=_0x27d7ca-0x0;var _0x10f817=_0x2318[_0x27d7ca];return _0x10f817;};'use strict';var _=require(_0x8231('0x0'));var util=require(_0x8231('0x1'));var moment=require(_0x8231('0x2'));var BPromise=require(_0x8231('0x3'));var rs=require(_0x8231('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8231('0x5'))['db'];var utils=require(_0x8231('0x6'));var logger=require(_0x8231('0x7'))('rpc');var config=require(_0x8231('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8231('0x9')][_0x8231('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xba3a9c,_0x29fe0b,_0x3fec98){return new BPromise(function(_0x2f6512,_0x454324){return client[_0x8231('0xb')](_0xba3a9c,_0x3fec98)[_0x8231('0xc')](function(_0x28a7fa){logger[_0x8231('0xd')](_0x8231('0xe'),_0x29fe0b,_0x8231('0xf'));logger[_0x8231('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x29fe0b,_0x8231('0xf'),JSON[_0x8231('0x11')](_0x28a7fa));if(_0x28a7fa[_0x8231('0x12')]){if(_0x28a7fa['error'][_0x8231('0x13')]===0x1f4){logger['error'](_0x8231('0xe'),_0x29fe0b,_0x28a7fa[_0x8231('0x12')]['message']);return _0x454324(_0x28a7fa[_0x8231('0x12')][_0x8231('0x14')]);}logger['error'](_0x8231('0xe'),_0x29fe0b,_0x28a7fa['error']['message']);return _0x2f6512(_0x28a7fa[_0x8231('0x12')][_0x8231('0x14')]);}else{logger[_0x8231('0xd')](_0x8231('0xe'),_0x29fe0b,_0x8231('0xf'));_0x2f6512(_0x28a7fa['result'][_0x8231('0x14')]);}})['catch'](function(_0x11a519){logger[_0x8231('0x12')](_0x8231('0xe'),_0x29fe0b,_0x11a519);_0x454324(_0x11a519);});});}
\ No newline at end of file
+var _0xd911=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd911,0x18d));var _0x1d91=function(_0x22df4d,_0xa4790a){_0x22df4d=_0x22df4d-0x0;var _0x6a2020=_0xd911[_0x22df4d];return _0x6a2020;};'use strict';var _=require('lodash');var util=require(_0x1d91('0x0'));var moment=require(_0x1d91('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d91('0x2'));var db=require(_0x1d91('0x3'))['db'];var utils=require(_0x1d91('0x4'));var logger=require(_0x1d91('0x5'))(_0x1d91('0x6'));var config=require(_0x1d91('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38a302,_0x1857b1,_0x4d90f9){return new BPromise(function(_0x535af5,_0x3ceb7f){return client[_0x1d91('0x8')](_0x38a302,_0x4d90f9)[_0x1d91('0x9')](function(_0x279ad4){logger[_0x1d91('0xa')](_0x1d91('0xb'),_0x1857b1,_0x1d91('0xc'));logger[_0x1d91('0xd')](_0x1d91('0xe'),_0x1857b1,_0x1d91('0xc'),JSON[_0x1d91('0xf')](_0x279ad4));if(_0x279ad4[_0x1d91('0x10')]){if(_0x279ad4[_0x1d91('0x10')]['code']===0x1f4){logger[_0x1d91('0x10')](_0x1d91('0xb'),_0x1857b1,_0x279ad4[_0x1d91('0x10')][_0x1d91('0x11')]);return _0x3ceb7f(_0x279ad4[_0x1d91('0x10')][_0x1d91('0x11')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1857b1,_0x279ad4['error'][_0x1d91('0x11')]);return _0x535af5(_0x279ad4[_0x1d91('0x10')][_0x1d91('0x11')]);}else{logger['info'](_0x1d91('0xb'),_0x1857b1,'request\x20sent');_0x535af5(_0x279ad4[_0x1d91('0x12')][_0x1d91('0x11')]);}})[_0x1d91('0x13')](function(_0x3059d8){logger[_0x1d91('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1857b1,_0x3059d8);_0x3ceb7f(_0x3059d8);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index dc2eac2..677fc73 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 _0x13c6=['isAuthenticated','preview','/:id/run','/:id/query','query','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','show','/:id/preview'];(function(_0x2258c3,_0x38fa00){var _0x84c586=function(_0x130a2b){while(--_0x130a2b){_0x2258c3['push'](_0x2258c3['shift']());}};_0x84c586(++_0x38fa00);}(_0x13c6,0xb2));var _0x613c=function(_0x52338b,_0x295a6c){_0x52338b=_0x52338b-0x0;var _0x546138=_0x13c6[_0x52338b];return _0x546138;};'use strict';var multer=require(_0x613c('0x0'));var util=require(_0x613c('0x1'));var path=require(_0x613c('0x2'));var timeout=require(_0x613c('0x3'));var express=require(_0x613c('0x4'));var router=express[_0x613c('0x5')]();var fs_extra=require(_0x613c('0x6'));var auth=require(_0x613c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x613c('0x8'));var controller=require('./analyticDefaultReport.controller');router[_0x613c('0x9')]('/',auth['isAuthenticated'](),controller[_0x613c('0xa')]);router[_0x613c('0x9')](_0x613c('0xb'),auth['isAuthenticated'](),controller[_0x613c('0xc')]);router[_0x613c('0x9')](_0x613c('0xd'),auth[_0x613c('0xe')](),controller[_0x613c('0xf')]);router[_0x613c('0x9')](_0x613c('0x10'),auth['isAuthenticated'](),controller['run']);router[_0x613c('0x9')](_0x613c('0x11'),auth[_0x613c('0xe')](),controller[_0x613c('0x12')]);router[_0x613c('0x13')]('/',auth['isAuthenticated'](),controller[_0x613c('0x14')]);router['put'](_0x613c('0xb'),auth[_0x613c('0xe')](),controller[_0x613c('0x15')]);router[_0x613c('0x16')](_0x613c('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x613c('0x17')]=router;
\ No newline at end of file
+var _0xfaf6=['index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated'];(function(_0x23960f,_0x337d10){var _0x4157df=function(_0x1d3bd4){while(--_0x1d3bd4){_0x23960f['push'](_0x23960f['shift']());}};_0x4157df(++_0x337d10);}(_0xfaf6,0xcd));var _0x6faf=function(_0x4ab9de,_0x3bdf1a){_0x4ab9de=_0x4ab9de-0x0;var _0x516c92=_0xfaf6[_0x4ab9de];return _0x516c92;};'use strict';var multer=require('multer');var util=require(_0x6faf('0x0'));var path=require(_0x6faf('0x1'));var timeout=require(_0x6faf('0x2'));var express=require(_0x6faf('0x3'));var router=express[_0x6faf('0x4')]();var fs_extra=require(_0x6faf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6faf('0x6'));var config=require(_0x6faf('0x7'));var controller=require(_0x6faf('0x8'));router[_0x6faf('0x9')]('/',auth[_0x6faf('0xa')](),controller[_0x6faf('0xb')]);router['get'](_0x6faf('0xc'),auth[_0x6faf('0xa')](),controller[_0x6faf('0xd')]);router[_0x6faf('0x9')](_0x6faf('0xe'),auth['isAuthenticated'](),controller[_0x6faf('0xf')]);router[_0x6faf('0x9')](_0x6faf('0x10'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x11')]);router[_0x6faf('0x9')](_0x6faf('0x12'),auth[_0x6faf('0xa')](),controller['query']);router[_0x6faf('0x13')]('/',auth[_0x6faf('0xa')](),controller['create']);router[_0x6faf('0x14')](_0x6faf('0xc'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x15')]);router[_0x6faf('0x16')](_0x6faf('0xc'),auth[_0x6faf('0xa')](),controller[_0x6faf('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index e9632ec..6cd2d0b 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 _0x6edd=['DATE','ENUM','manual','UNSIGNED','exports','STRING','csv'];(function(_0x13c70c,_0x546b34){var _0x50f0f2=function(_0x2a2991){while(--_0x2a2991){_0x13c70c['push'](_0x13c70c['shift']());}};_0x50f0f2(++_0x546b34);}(_0x6edd,0x177));var _0xd6ed=function(_0x97abee,_0x2f7f31){_0x97abee=_0x97abee-0x0;var _0x4c734e=_0x6edd[_0x97abee];return _0x4c734e;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xd6ed('0x0')]={'name':{'type':Sequelize[_0xd6ed('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xd6ed('0x2'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0xd6ed('0x2')},'savename':{'type':Sequelize[_0xd6ed('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd6ed('0x3')]},'endDate':{'type':Sequelize[_0xd6ed('0x3')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xd6ed('0x4')](_0xd6ed('0x5'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xd6ed('0x6')]},'reportType':{'type':Sequelize[_0xd6ed('0x1')]}};
\ No newline at end of file
+var _0x1391=['Loading','manual','sequelize','moment','exports','STRING','ENUM','pdf','xlsx','csv','DATE'];(function(_0x4216cb,_0x189803){var _0xf72da2=function(_0x2cd181){while(--_0x2cd181){_0x4216cb['push'](_0x4216cb['shift']());}};_0xf72da2(++_0x189803);}(_0x1391,0x7b));var _0x1139=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x1391[_0x411add];return _0x238242;};'use strict';var Sequelize=require(_0x1139('0x0'));var moment=require(_0x1139('0x1'));module[_0x1139('0x2')]={'name':{'type':Sequelize[_0x1139('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x1139('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x1139('0x4')]('csv',_0x1139('0x5'),_0x1139('0x6')),'allowNull':![],'defaultValue':_0x1139('0x7')},'savename':{'type':Sequelize[_0x1139('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1139('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x1139('0x3')],'defaultValue':_0x1139('0x9')},'type':{'type':Sequelize[_0x1139('0x4')](_0x1139('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0x1139('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'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 baa49e7..fe9987e 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 _0x6517=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','output','existsSync','root','server/files/reports','savename','Sequelize','exists','download','format','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports'];(function(_0x59b229,_0x17f45b){var _0x4cf6a5=function(_0x391efa){while(--_0x391efa){_0x59b229['push'](_0x59b229['shift']());}};_0x4cf6a5(++_0x17f45b);}(_0x6517,0xca));var _0x7651=function(_0x4b49e7,_0x141f78){_0x4b49e7=_0x4b49e7-0x0;var _0x156258=_0x6517[_0x4b49e7];return _0x156258;};'use strict';var emlformat=require(_0x7651('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7651('0x1'));var jsonpatch=require(_0x7651('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7651('0x3'));var Mustache=require('mustache');var util=require(_0x7651('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x7651('0x5'));var ejs=require(_0x7651('0x6'));var fs=require('fs');var fs_extra=require(_0x7651('0x7'));var _=require(_0x7651('0x8'));var squel=require(_0x7651('0x9'));var crypto=require(_0x7651('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7651('0xb'));var toCsv=require(_0x7651('0x5'));var querystring=require(_0x7651('0xc'));var Papa=require(_0x7651('0xd'));var Redis=require(_0x7651('0xe'));var authService=require(_0x7651('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7651('0x10'));var hardwareService=require(_0x7651('0x11'));var logger=require('../../config/logger')(_0x7651('0x12'));var utils=require('../../config/utils');var config=require(_0x7651('0x13'));var licenseUtil=require(_0x7651('0x14'));var db=require(_0x7651('0x15'))['db'];function respondWithStatusCode(_0x5985de,_0x4a50bb){_0x4a50bb=_0x4a50bb||0xcc;return function(_0x2d7036){if(_0x2d7036){return _0x5985de[_0x7651('0x16')](_0x4a50bb);}return _0x5985de[_0x7651('0x17')](_0x4a50bb)[_0x7651('0x18')]();};}function respondWithResult(_0x1518d1,_0xa2913f){_0xa2913f=_0xa2913f||0xc8;return function(_0x1f1472){if(_0x1f1472){return _0x1518d1[_0x7651('0x17')](_0xa2913f)[_0x7651('0x19')](_0x1f1472);}};}function respondWithFilteredResult(_0x30f8bc,_0x33b0b7){return function(_0x467d5c){if(_0x467d5c){var _0x330d68=typeof _0x33b0b7[_0x7651('0x1a')]===_0x7651('0x1b')&&typeof _0x33b0b7[_0x7651('0x1c')]===_0x7651('0x1b');var _0x5a22b4=_0x467d5c[_0x7651('0x1d')];var _0x4c933f=_0x330d68?0x0:_0x33b0b7['offset'];var _0x44965d=_0x330d68?_0x467d5c[_0x7651('0x1d')]:_0x33b0b7['offset']+_0x33b0b7[_0x7651('0x1c')];var _0x58a3cb;if(_0x44965d>=_0x5a22b4){_0x44965d=_0x5a22b4;_0x58a3cb=0xc8;}else{_0x58a3cb=0xce;}_0x30f8bc[_0x7651('0x17')](_0x58a3cb);return _0x30f8bc['set'](_0x7651('0x1e'),_0x4c933f+'-'+_0x44965d+'/'+_0x5a22b4)[_0x7651('0x19')](_0x467d5c);}return null;};}function patchUpdates(_0x23b692){return function(_0x4835df){try{jsonpatch[_0x7651('0x1f')](_0x4835df,_0x23b692,!![]);}catch(_0x56afee){return BPromise[_0x7651('0x20')](_0x56afee);}return _0x4835df[_0x7651('0x21')]();};}function saveUpdates(_0x2eb5da,_0x59785e){return function(_0x12a667){if(_0x12a667){return _0x12a667[_0x7651('0x22')](_0x2eb5da)[_0x7651('0x23')](function(_0x584056){return _0x584056;});}return null;};}function removeEntity(_0x7a4c4b,_0x220482){return function(_0x5caef8){if(_0x5caef8){return _0x5caef8[_0x7651('0x24')]()[_0x7651('0x23')](function(){var _0x3d2d9a=_0x5caef8[_0x7651('0x25')]({'plain':!![]});var _0x14e071='ExtractedReports';return db[_0x7651('0x26')]['destroy']({'where':{'type':_0x14e071,'resourceId':_0x3d2d9a['id']}})['then'](function(){return _0x5caef8;});})[_0x7651('0x23')](function(){_0x7a4c4b['status'](0xcc)[_0x7651('0x18')]();});}};}function handleEntityNotFound(_0x5549de,_0x748c1c){return function(_0x44b0c1){if(!_0x44b0c1){_0x5549de['sendStatus'](0x194);}return _0x44b0c1;};}function handleError(_0x1a9c20,_0x22f9aa){_0x22f9aa=_0x22f9aa||0x1f4;return function(_0x451595){logger[_0x7651('0x27')](_0x451595[_0x7651('0x28')]);if(_0x451595[_0x7651('0x29')]){delete _0x451595[_0x7651('0x29')];}_0x1a9c20[_0x7651('0x17')](_0x22f9aa)[_0x7651('0x2a')](_0x451595);};}exports[_0x7651('0x2b')]=function(_0x36d189,_0x4b6d6b){var _0x413cc5={},_0x1b61b3={},_0x28ed85={'count':0x0,'rows':[]};var _0x5715a3=_[_0x7651('0x2c')](db[_0x7651('0x2d')][_0x7651('0x2e')],function(_0x272307){return{'name':_0x272307[_0x7651('0x2f')],'type':_0x272307['type']['key']};});_0x1b61b3[_0x7651('0x30')]=_[_0x7651('0x2c')](_0x5715a3,_0x7651('0x29'));_0x1b61b3[_0x7651('0x31')]=_['keys'](_0x36d189[_0x7651('0x31')]);_0x1b61b3[_0x7651('0x32')]=_[_0x7651('0x33')](_0x1b61b3[_0x7651('0x30')],_0x1b61b3[_0x7651('0x31')]);_0x413cc5[_0x7651('0x34')]=_['intersection'](_0x1b61b3[_0x7651('0x30')],qs[_0x7651('0x35')](_0x36d189['query'][_0x7651('0x35')]));_0x413cc5['attributes']=_0x413cc5[_0x7651('0x34')][_0x7651('0x36')]?_0x413cc5[_0x7651('0x34')]:_0x1b61b3[_0x7651('0x30')];if(!_0x36d189[_0x7651('0x31')][_0x7651('0x37')](_0x7651('0x38'))){_0x413cc5[_0x7651('0x1c')]=qs[_0x7651('0x1c')](_0x36d189[_0x7651('0x31')][_0x7651('0x1c')]);_0x413cc5[_0x7651('0x1a')]=qs[_0x7651('0x1a')](_0x36d189[_0x7651('0x31')][_0x7651('0x1a')]);}_0x413cc5['order']=qs[_0x7651('0x39')](_0x36d189['query'][_0x7651('0x39')]);_0x413cc5[_0x7651('0x3a')]=qs['filters'](_['pick'](_0x36d189[_0x7651('0x31')],_0x1b61b3[_0x7651('0x32')]),_0x5715a3);if(_0x36d189[_0x7651('0x31')][_0x7651('0x3b')]){_0x413cc5[_0x7651('0x3a')]=_['merge'](_0x413cc5[_0x7651('0x3a')],{'$or':_['map'](_0x5715a3,function(_0x21de96){if(_0x21de96[_0x7651('0x3c')]!==_0x7651('0x3d')){var _0xf3f1c5={};_0xf3f1c5[_0x21de96[_0x7651('0x29')]]={'$like':'%'+_0x36d189[_0x7651('0x31')][_0x7651('0x3b')]+'%'};return _0xf3f1c5;}})});}_0x413cc5=_['merge']({},_0x413cc5,_0x36d189[_0x7651('0x3e')]);var _0xcb08c2={'where':_0x413cc5[_0x7651('0x3a')]};return db[_0x7651('0x2d')][_0x7651('0x1d')](_0xcb08c2)[_0x7651('0x23')](function(_0x6c21fd){_0x28ed85['count']=_0x6c21fd;if(_0x36d189['query'][_0x7651('0x3f')]){_0x413cc5[_0x7651('0x40')]=[{'all':!![]}];}return db[_0x7651('0x2d')][_0x7651('0x41')](_0x413cc5);})[_0x7651('0x23')](function(_0x52138e){_0x28ed85[_0x7651('0x42')]=_0x52138e;return _0x28ed85;})['then'](respondWithFilteredResult(_0x4b6d6b,_0x413cc5))[_0x7651('0x43')](handleError(_0x4b6d6b,null));};exports['show']=function(_0x1e4432,_0x1ca909){var _0x3c1c81={'raw':!![],'where':{'id':_0x1e4432[_0x7651('0x44')]['id']}},_0x3f19b9={};_0x3f19b9[_0x7651('0x30')]=_[_0x7651('0x45')](db[_0x7651('0x2d')]['rawAttributes']);_0x3f19b9['query']=_[_0x7651('0x45')](_0x1e4432[_0x7651('0x31')]);_0x3f19b9[_0x7651('0x32')]=_[_0x7651('0x33')](_0x3f19b9[_0x7651('0x30')],_0x3f19b9[_0x7651('0x31')]);_0x3c1c81[_0x7651('0x34')]=_[_0x7651('0x33')](_0x3f19b9['model'],qs[_0x7651('0x35')](_0x1e4432['query'][_0x7651('0x35')]));_0x3c1c81['attributes']=_0x3c1c81[_0x7651('0x34')][_0x7651('0x36')]?_0x3c1c81[_0x7651('0x34')]:_0x3f19b9['model'];if(_0x1e4432['query'][_0x7651('0x3f')]){_0x3c1c81['include']=[{'all':!![]}];}_0x3c1c81=_['merge']({},_0x3c1c81,_0x1e4432[_0x7651('0x3e')]);return db['AnalyticExtractedReport'][_0x7651('0x46')](_0x3c1c81)[_0x7651('0x23')](handleEntityNotFound(_0x1ca909,null))[_0x7651('0x23')](respondWithResult(_0x1ca909,null))[_0x7651('0x43')](handleError(_0x1ca909,null));};exports['create']=function(_0x336d42,_0x4fdc9f){return db['AnalyticExtractedReport'][_0x7651('0x47')](_0x336d42[_0x7651('0x48')],{})['then'](function(_0x41160b){var _0x41cad6=_0x336d42[_0x7651('0x49')][_0x7651('0x25')]({'plain':!![]});if(!_0x41cad6)throw new Error(_0x7651('0x4a'));if(_0x41cad6[_0x7651('0x4b')]===_0x7651('0x49')){var _0x26ef0f=_0x41160b[_0x7651('0x25')]({'plain':!![]});var _0x3c3072=_0x7651('0x4c');return db[_0x7651('0x4d')]['find']({'where':{'name':_0x3c3072,'userProfileId':_0x41cad6[_0x7651('0x4e')]},'raw':!![]})[_0x7651('0x23')](function(_0x165ea4){if(_0x165ea4&&_0x165ea4[_0x7651('0x4f')]===0x0){return db['UserProfileResource'][_0x7651('0x47')]({'name':_0x26ef0f['name'],'resourceId':_0x26ef0f['id'],'type':_0x165ea4[_0x7651('0x29')],'sectionId':_0x165ea4['id']},{})[_0x7651('0x23')](function(){return _0x41160b;});}else{return _0x41160b;}})['catch'](function(_0x543b5d){logger[_0x7651('0x27')](_0x7651('0x50'),_0x543b5d);throw _0x543b5d;});}return _0x41160b;})[_0x7651('0x23')](respondWithResult(_0x4fdc9f,0xc9))[_0x7651('0x43')](handleError(_0x4fdc9f,null));};exports[_0x7651('0x22')]=function(_0x4b9feb,_0x523bb3){if(_0x4b9feb[_0x7651('0x48')]['id']){delete _0x4b9feb[_0x7651('0x48')]['id'];}return db['AnalyticExtractedReport'][_0x7651('0x46')]({'where':{'id':_0x4b9feb[_0x7651('0x44')]['id']}})[_0x7651('0x23')](handleEntityNotFound(_0x523bb3,null))[_0x7651('0x23')](saveUpdates(_0x4b9feb[_0x7651('0x48')],null))[_0x7651('0x23')](respondWithResult(_0x523bb3,null))[_0x7651('0x43')](handleError(_0x523bb3,null));};exports[_0x7651('0x24')]=function(_0x3d87b8,_0x12289a){return db[_0x7651('0x2d')][_0x7651('0x46')]({'where':{'id':_0x3d87b8[_0x7651('0x44')]['id']}})['then'](handleEntityNotFound(_0x12289a,null))[_0x7651('0x23')](removeEntity(_0x12289a,null))[_0x7651('0x43')](handleError(_0x12289a,null));};exports['download']=function(_0x2234aa,_0x340ef9,_0x396deb){return db[_0x7651('0x2d')][_0x7651('0x46')]({'where':{'id':_0x2234aa[_0x7651('0x44')]['id']},'attributes':[_0x7651('0x29'),_0x7651('0x51'),'savename',_0x7651('0x52')],'raw':!![]})[_0x7651('0x23')](handleEntityNotFound(_0x340ef9,null))['then'](function(_0x31c976){if(_0x31c976){if(!fs[_0x7651('0x53')](path['join'](config[_0x7651('0x54')],_0x7651('0x55'),_0x31c976[_0x7651('0x56')]))){throw new db[(_0x7651('0x57'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x2234aa['query'][_0x7651('0x58')]){return _0x340ef9[_0x7651('0x16')](0xc8);}return _0x340ef9[_0x7651('0x59')](path['join'](config[_0x7651('0x54')],'server/files/reports',_0x31c976['savename']),util[_0x7651('0x5a')](_0x7651('0x5b'),_0x31c976[_0x7651('0x51')]||_0x31c976[_0x7651('0x29')],_0x31c976['output'][_0x7651('0x5c')]()));}})[_0x7651('0x43')](handleError(_0x340ef9,null));};
\ No newline at end of file
+var _0x9564=['basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','format','%s.%s','toLowerCase','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','map','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','AnalyticExtractedReport','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','download'];(function(_0x44c301,_0x511f7a){var _0x549043=function(_0x4db677){while(--_0x4db677){_0x44c301['push'](_0x44c301['shift']());}};_0x549043(++_0x511f7a);}(_0x9564,0x1ca));var _0x4956=function(_0x33f2fa,_0x1411d5){_0x33f2fa=_0x33f2fa-0x0;var _0xe5b3b3=_0x9564[_0x33f2fa];return _0xe5b3b3;};'use strict';var emlformat=require(_0x4956('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4956('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4956('0x2'));var moment=require('moment');var BPromise=require(_0x4956('0x3'));var Mustache=require(_0x4956('0x4'));var util=require(_0x4956('0x5'));var path=require('path');var sox=require(_0x4956('0x6'));var csv=require('to-csv');var ejs=require(_0x4956('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4956('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x4956('0x9'));var toCsv=require(_0x4956('0xa'));var querystring=require(_0x4956('0xb'));var Papa=require(_0x4956('0xc'));var Redis=require('ioredis');var authService=require(_0x4956('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4956('0xe'));var logger=require(_0x4956('0xf'))(_0x4956('0x10'));var utils=require(_0x4956('0x11'));var config=require(_0x4956('0x12'));var licenseUtil=require(_0x4956('0x13'));var db=require(_0x4956('0x14'))['db'];function respondWithStatusCode(_0x66123e,_0x488bbb){_0x488bbb=_0x488bbb||0xcc;return function(_0x3ca588){if(_0x3ca588){return _0x66123e['sendStatus'](_0x488bbb);}return _0x66123e[_0x4956('0x15')](_0x488bbb)['end']();};}function respondWithResult(_0x214a7c,_0x170e7f){_0x170e7f=_0x170e7f||0xc8;return function(_0x1854a3){if(_0x1854a3){return _0x214a7c[_0x4956('0x15')](_0x170e7f)[_0x4956('0x16')](_0x1854a3);}};}function respondWithFilteredResult(_0x1e01e8,_0x3787fb){return function(_0x2a4719){if(_0x2a4719){var _0x283e57=typeof _0x3787fb[_0x4956('0x17')]===_0x4956('0x18')&&typeof _0x3787fb['limit']===_0x4956('0x18');var _0x88a0d5=_0x2a4719['count'];var _0x6acf3=_0x283e57?0x0:_0x3787fb['offset'];var _0x14a193=_0x283e57?_0x2a4719[_0x4956('0x19')]:_0x3787fb[_0x4956('0x17')]+_0x3787fb[_0x4956('0x1a')];var _0x600a4a;if(_0x14a193>=_0x88a0d5){_0x14a193=_0x88a0d5;_0x600a4a=0xc8;}else{_0x600a4a=0xce;}_0x1e01e8[_0x4956('0x15')](_0x600a4a);return _0x1e01e8[_0x4956('0x1b')](_0x4956('0x1c'),_0x6acf3+'-'+_0x14a193+'/'+_0x88a0d5)['json'](_0x2a4719);}return null;};}function patchUpdates(_0x398c04){return function(_0x4708ec){try{jsonpatch[_0x4956('0x1d')](_0x4708ec,_0x398c04,!![]);}catch(_0x2a0a0e){return BPromise['reject'](_0x2a0a0e);}return _0x4708ec[_0x4956('0x1e')]();};}function saveUpdates(_0x3de3cf,_0x54a77e){return function(_0x5f1aad){if(_0x5f1aad){return _0x5f1aad[_0x4956('0x1f')](_0x3de3cf)[_0x4956('0x20')](function(_0x284aee){return _0x284aee;});}return null;};}function removeEntity(_0x18612c,_0x219b54){return function(_0x5ea15d){if(_0x5ea15d){return _0x5ea15d[_0x4956('0x21')]()[_0x4956('0x20')](function(){var _0x5b1543=_0x5ea15d[_0x4956('0x22')]({'plain':!![]});var _0x5b8cc5=_0x4956('0x23');return db[_0x4956('0x24')]['destroy']({'where':{'type':_0x5b8cc5,'resourceId':_0x5b1543['id']}})['then'](function(){return _0x5ea15d;});})[_0x4956('0x20')](function(){_0x18612c[_0x4956('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49f564,_0x3ed9bc){return function(_0x53b643){if(!_0x53b643){_0x49f564[_0x4956('0x25')](0x194);}return _0x53b643;};}function handleError(_0x1a44eb,_0x5bb4b3){_0x5bb4b3=_0x5bb4b3||0x1f4;return function(_0x126252){logger[_0x4956('0x26')](_0x126252[_0x4956('0x27')]);if(_0x126252[_0x4956('0x28')]){delete _0x126252[_0x4956('0x28')];}_0x1a44eb[_0x4956('0x15')](_0x5bb4b3)[_0x4956('0x29')](_0x126252);};}exports['index']=function(_0x2371f1,_0x465da2){var _0x3de0fb={},_0x2cc546={},_0x927481={'count':0x0,'rows':[]};var _0x3b81e8=_[_0x4956('0x2a')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x5c8913){return{'name':_0x5c8913['fieldName'],'type':_0x5c8913[_0x4956('0x2b')]['key']};});_0x2cc546[_0x4956('0x2c')]=_['map'](_0x3b81e8,_0x4956('0x28'));_0x2cc546[_0x4956('0x2d')]=_[_0x4956('0x2e')](_0x2371f1['query']);_0x2cc546[_0x4956('0x2f')]=_['intersection'](_0x2cc546['model'],_0x2cc546[_0x4956('0x2d')]);_0x3de0fb[_0x4956('0x30')]=_['intersection'](_0x2cc546[_0x4956('0x2c')],qs[_0x4956('0x31')](_0x2371f1[_0x4956('0x2d')][_0x4956('0x31')]));_0x3de0fb['attributes']=_0x3de0fb[_0x4956('0x30')][_0x4956('0x32')]?_0x3de0fb[_0x4956('0x30')]:_0x2cc546['model'];if(!_0x2371f1[_0x4956('0x2d')][_0x4956('0x33')](_0x4956('0x34'))){_0x3de0fb[_0x4956('0x1a')]=qs['limit'](_0x2371f1[_0x4956('0x2d')]['limit']);_0x3de0fb['offset']=qs[_0x4956('0x17')](_0x2371f1[_0x4956('0x2d')][_0x4956('0x17')]);}_0x3de0fb['order']=qs[_0x4956('0x35')](_0x2371f1[_0x4956('0x2d')][_0x4956('0x35')]);_0x3de0fb[_0x4956('0x36')]=qs[_0x4956('0x2f')](_[_0x4956('0x37')](_0x2371f1[_0x4956('0x2d')],_0x2cc546[_0x4956('0x2f')]),_0x3b81e8);if(_0x2371f1[_0x4956('0x2d')][_0x4956('0x38')]){_0x3de0fb['where']=_[_0x4956('0x39')](_0x3de0fb['where'],{'$or':_['map'](_0x3b81e8,function(_0x10bd18){if(_0x10bd18[_0x4956('0x2b')]!==_0x4956('0x3a')){var _0x32b95e={};_0x32b95e[_0x10bd18[_0x4956('0x28')]]={'$like':'%'+_0x2371f1['query'][_0x4956('0x38')]+'%'};return _0x32b95e;}})});}_0x3de0fb=_[_0x4956('0x39')]({},_0x3de0fb,_0x2371f1['options']);var _0x5c4120={'where':_0x3de0fb[_0x4956('0x36')]};return db[_0x4956('0x3b')]['count'](_0x5c4120)['then'](function(_0x3faf2f){_0x927481['count']=_0x3faf2f;if(_0x2371f1[_0x4956('0x2d')][_0x4956('0x3c')]){_0x3de0fb[_0x4956('0x3d')]=[{'all':!![]}];}return db[_0x4956('0x3b')][_0x4956('0x3e')](_0x3de0fb);})[_0x4956('0x20')](function(_0x44df16){_0x927481[_0x4956('0x3f')]=_0x44df16;return _0x927481;})[_0x4956('0x20')](respondWithFilteredResult(_0x465da2,_0x3de0fb))['catch'](handleError(_0x465da2,null));};exports[_0x4956('0x40')]=function(_0x1ed04a,_0x5ae8d2){var _0x153a69={'raw':!![],'where':{'id':_0x1ed04a[_0x4956('0x41')]['id']}},_0x339aaa={};_0x339aaa['model']=_[_0x4956('0x2e')](db[_0x4956('0x3b')][_0x4956('0x42')]);_0x339aaa[_0x4956('0x2d')]=_[_0x4956('0x2e')](_0x1ed04a[_0x4956('0x2d')]);_0x339aaa['filters']=_['intersection'](_0x339aaa[_0x4956('0x2c')],_0x339aaa['query']);_0x153a69[_0x4956('0x30')]=_[_0x4956('0x43')](_0x339aaa['model'],qs[_0x4956('0x31')](_0x1ed04a[_0x4956('0x2d')]['fields']));_0x153a69[_0x4956('0x30')]=_0x153a69[_0x4956('0x30')][_0x4956('0x32')]?_0x153a69[_0x4956('0x30')]:_0x339aaa[_0x4956('0x2c')];if(_0x1ed04a[_0x4956('0x2d')][_0x4956('0x3c')]){_0x153a69[_0x4956('0x3d')]=[{'all':!![]}];}_0x153a69=_[_0x4956('0x39')]({},_0x153a69,_0x1ed04a['options']);return db[_0x4956('0x3b')][_0x4956('0x44')](_0x153a69)['then'](handleEntityNotFound(_0x5ae8d2,null))['then'](respondWithResult(_0x5ae8d2,null))[_0x4956('0x45')](handleError(_0x5ae8d2,null));};exports[_0x4956('0x46')]=function(_0x4056f9,_0x4fc6db){return db[_0x4956('0x3b')]['create'](_0x4056f9[_0x4956('0x47')],{})[_0x4956('0x20')](function(_0x5a1a79){var _0x230335=_0x4056f9[_0x4956('0x48')][_0x4956('0x22')]({'plain':!![]});if(!_0x230335)throw new Error(_0x4956('0x49'));if(_0x230335[_0x4956('0x4a')]==='user'){var _0x79d2f=_0x5a1a79[_0x4956('0x22')]({'plain':!![]});var _0x5d752c=_0x4956('0x23');return db['UserProfileSection'][_0x4956('0x44')]({'where':{'name':_0x5d752c,'userProfileId':_0x230335['userProfileId']},'raw':!![]})[_0x4956('0x20')](function(_0x499ac9){if(_0x499ac9&&_0x499ac9['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x79d2f[_0x4956('0x28')],'resourceId':_0x79d2f['id'],'type':_0x499ac9[_0x4956('0x28')],'sectionId':_0x499ac9['id']},{})['then'](function(){return _0x5a1a79;});}else{return _0x5a1a79;}})[_0x4956('0x45')](function(_0xb83011){logger[_0x4956('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb83011);throw _0xb83011;});}return _0x5a1a79;})[_0x4956('0x20')](respondWithResult(_0x4fc6db,0xc9))[_0x4956('0x45')](handleError(_0x4fc6db,null));};exports['update']=function(_0x36143b,_0x508935){if(_0x36143b[_0x4956('0x47')]['id']){delete _0x36143b[_0x4956('0x47')]['id'];}return db[_0x4956('0x3b')][_0x4956('0x44')]({'where':{'id':_0x36143b['params']['id']}})[_0x4956('0x20')](handleEntityNotFound(_0x508935,null))[_0x4956('0x20')](saveUpdates(_0x36143b[_0x4956('0x47')],null))[_0x4956('0x20')](respondWithResult(_0x508935,null))['catch'](handleError(_0x508935,null));};exports[_0x4956('0x21')]=function(_0x5029d2,_0x45b290){return db[_0x4956('0x3b')]['find']({'where':{'id':_0x5029d2[_0x4956('0x41')]['id']}})['then'](handleEntityNotFound(_0x45b290,null))[_0x4956('0x20')](removeEntity(_0x45b290,null))[_0x4956('0x45')](handleError(_0x45b290,null));};exports[_0x4956('0x4b')]=function(_0x3e45a7,_0x3b002e,_0x10d600){return db[_0x4956('0x3b')][_0x4956('0x44')]({'where':{'id':_0x3e45a7['params']['id']},'attributes':[_0x4956('0x28'),_0x4956('0x4c'),'savename',_0x4956('0x4d')],'raw':!![]})[_0x4956('0x20')](handleEntityNotFound(_0x3b002e,null))['then'](function(_0x51c945){if(_0x51c945){if(!fs[_0x4956('0x4e')](path[_0x4956('0x4f')](config[_0x4956('0x50')],_0x4956('0x51'),_0x51c945[_0x4956('0x52')]))){throw new db[(_0x4956('0x53'))][(_0x4956('0x54'))](_0x4956('0x55'));}if(_0x3e45a7[_0x4956('0x2d')]['exists']){return _0x3b002e[_0x4956('0x25')](0xc8);}return _0x3b002e[_0x4956('0x4b')](path[_0x4956('0x4f')](config[_0x4956('0x50')],_0x4956('0x51'),_0x51c945[_0x4956('0x52')]),util[_0x4956('0x56')](_0x4956('0x57'),_0x51c945[_0x4956('0x4c')]||_0x51c945[_0x4956('0x28')],_0x51c945[_0x4956('0x4d')][_0x4956('0x58')]()));}})[_0x4956('0x45')](handleError(_0x3b002e,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index dae15a0..b922836 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 _0xd975=['AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x16f89f,_0x3a8f2e){var _0x4968a8=function(_0x363eff){while(--_0x363eff){_0x16f89f['push'](_0x16f89f['shift']());}};_0x4968a8(++_0x3a8f2e);}(_0xd975,0xfe));var _0x5d97=function(_0x4ebe3d,_0x439c56){_0x4ebe3d=_0x4ebe3d-0x0;var _0x4adf00=_0xd975[_0x4ebe3d];return _0x4adf00;};'use strict';var _=require(_0x5d97('0x0'));var util=require(_0x5d97('0x1'));var logger=require(_0x5d97('0x2'))(_0x5d97('0x3'));var moment=require(_0x5d97('0x4'));var BPromise=require(_0x5d97('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d97('0x6'));var rimraf=require(_0x5d97('0x7'));var config=require(_0x5d97('0x8'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x3f5e05,_0x12f073){return _0x3f5e05[_0x5d97('0x9')](_0x5d97('0xa'),attributes,{'tableName':_0x5d97('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6edb=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0xbb772f,_0x299c73){var _0x3d7f23=function(_0xe38c44){while(--_0xe38c44){_0xbb772f['push'](_0xbb772f['shift']());}};_0x3d7f23(++_0x299c73);}(_0x6edb,0xa8));var _0xb6ed=function(_0x58df23,_0x3e9eb9){_0x58df23=_0x58df23-0x0;var _0x2fcd18=_0x6edb[_0x58df23];return _0x2fcd18;};'use strict';var _=require('lodash');var util=require(_0xb6ed('0x0'));var logger=require(_0xb6ed('0x1'))(_0xb6ed('0x2'));var moment=require(_0xb6ed('0x3'));var BPromise=require(_0xb6ed('0x4'));var rp=require(_0xb6ed('0x5'));var fs=require('fs');var path=require(_0xb6ed('0x6'));var rimraf=require(_0xb6ed('0x7'));var config=require(_0xb6ed('0x8'));var attributes=require('./analyticExtractedReport.attributes');module[_0xb6ed('0x9')]=function(_0x34fd02,_0x27cf58){return _0x34fd02['define'](_0xb6ed('0xa'),attributes,{'tableName':_0xb6ed('0xb'),'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 a072997..f7f7a95 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 _0xf4cf=['bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0xf4cf,0x1e0));var _0xff4c=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xf4cf[_0xa8883];return _0x479426;};'use strict';var _=require(_0xff4c('0x0'));var util=require(_0xff4c('0x1'));var moment=require(_0xff4c('0x2'));var BPromise=require(_0xff4c('0x3'));var rs=require(_0xff4c('0x4'));var fs=require('fs');var Redis=require(_0xff4c('0x5'));var db=require(_0xff4c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xff4c('0x7'));var config=require('../../config/environment');var jayson=require(_0xff4c('0x8'));var client=jayson[_0xff4c('0x9')][_0xff4c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9679a1,_0x351121,_0x566b18){return new BPromise(function(_0x294309,_0x1cc9c9){return client[_0xff4c('0xb')](_0x9679a1,_0x566b18)[_0xff4c('0xc')](function(_0xf17d3d){logger[_0xff4c('0xd')](_0xff4c('0xe'),_0x351121,_0xff4c('0xf'));logger[_0xff4c('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x351121,_0xff4c('0xf'),JSON[_0xff4c('0x11')](_0xf17d3d));if(_0xf17d3d[_0xff4c('0x12')]){if(_0xf17d3d[_0xff4c('0x12')][_0xff4c('0x13')]===0x1f4){logger[_0xff4c('0x12')](_0xff4c('0xe'),_0x351121,_0xf17d3d['error']['message']);return _0x1cc9c9(_0xf17d3d[_0xff4c('0x12')][_0xff4c('0x14')]);}logger[_0xff4c('0x12')](_0xff4c('0xe'),_0x351121,_0xf17d3d[_0xff4c('0x12')][_0xff4c('0x14')]);return _0x294309(_0xf17d3d[_0xff4c('0x12')][_0xff4c('0x14')]);}else{logger[_0xff4c('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x351121,_0xff4c('0xf'));_0x294309(_0xf17d3d[_0xff4c('0x15')][_0xff4c('0x14')]);}})[_0xff4c('0x16')](function(_0x188f33){logger[_0xff4c('0x12')](_0xff4c('0xe'),_0x351121,_0x188f33);_0x1cc9c9(_0x188f33);});});}
\ No newline at end of file
+var _0x42ec=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x173c15,_0x552670){var _0x10ded7=function(_0x5c1259){while(--_0x5c1259){_0x173c15['push'](_0x173c15['shift']());}};_0x10ded7(++_0x552670);}(_0x42ec,0x1bf));var _0xc42e=function(_0x2cc97b,_0x1ed001){_0x2cc97b=_0x2cc97b-0x0;var _0x28fb55=_0x42ec[_0x2cc97b];return _0x28fb55;};'use strict';var _=require('lodash');var util=require(_0xc42e('0x0'));var moment=require(_0xc42e('0x1'));var BPromise=require(_0xc42e('0x2'));var rs=require(_0xc42e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc42e('0x4'));var logger=require(_0xc42e('0x5'))(_0xc42e('0x6'));var config=require(_0xc42e('0x7'));var jayson=require(_0xc42e('0x8'));var client=jayson[_0xc42e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43977a,_0x31fc77,_0x113847){return new BPromise(function(_0x5c726b,_0x3130d7){return client[_0xc42e('0xa')](_0x43977a,_0x113847)[_0xc42e('0xb')](function(_0x164298){logger[_0xc42e('0xc')](_0xc42e('0xd'),_0x31fc77,_0xc42e('0xe'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x31fc77,_0xc42e('0xe'),JSON[_0xc42e('0xf')](_0x164298));if(_0x164298[_0xc42e('0x10')]){if(_0x164298[_0xc42e('0x10')][_0xc42e('0x11')]===0x1f4){logger[_0xc42e('0x10')](_0xc42e('0xd'),_0x31fc77,_0x164298[_0xc42e('0x10')][_0xc42e('0x12')]);return _0x3130d7(_0x164298[_0xc42e('0x10')][_0xc42e('0x12')]);}logger[_0xc42e('0x10')](_0xc42e('0xd'),_0x31fc77,_0x164298[_0xc42e('0x10')][_0xc42e('0x12')]);return _0x5c726b(_0x164298['error'][_0xc42e('0x12')]);}else{logger[_0xc42e('0xc')](_0xc42e('0xd'),_0x31fc77,'request\x20sent');_0x5c726b(_0x164298[_0xc42e('0x13')][_0xc42e('0x12')]);}})['catch'](function(_0xf366cd){logger[_0xc42e('0x10')](_0xc42e('0xd'),_0x31fc77,_0xf366cd);_0x3130d7(_0xf366cd);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index e90e4c7..09e90e8 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 _0x6210=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','post','create','put','update','delete','destroy','multer','Router'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x6210,0x1a0));var _0x0621=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x6210[_0x4a747d];return _0x3a5b5c;};'use strict';var multer=require(_0x0621('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0621('0x1')]();var fs_extra=require(_0x0621('0x2'));var auth=require(_0x0621('0x3'));var interaction=require(_0x0621('0x4'));var config=require(_0x0621('0x5'));var controller=require(_0x0621('0x6'));router[_0x0621('0x7')]('/',auth[_0x0621('0x8')](),controller[_0x0621('0x9')]);router['get'](_0x0621('0xa'),auth[_0x0621('0x8')](),controller[_0x0621('0xb')]);router[_0x0621('0x7')](_0x0621('0xc'),auth[_0x0621('0x8')](),controller['download']);router[_0x0621('0xd')]('/',auth[_0x0621('0x8')](),controller[_0x0621('0xe')]);router[_0x0621('0xf')](_0x0621('0xa'),auth['isAuthenticated'](),controller[_0x0621('0x10')]);router[_0x0621('0x11')]('/:id',auth[_0x0621('0x8')](),controller[_0x0621('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x0a0c=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','/:id','show','get','/:id/download','download'];(function(_0x272125,_0x3324c0){var _0x3b6a02=function(_0xa5c7cc){while(--_0xa5c7cc){_0x272125['push'](_0x272125['shift']());}};_0x3b6a02(++_0x3324c0);}(_0x0a0c,0x7a));var _0xc0a0=function(_0x1ec74d,_0x5644af){_0x1ec74d=_0x1ec74d-0x0;var _0x45bced=_0x0a0c[_0x1ec74d];return _0x45bced;};'use strict';var multer=require(_0xc0a0('0x0'));var util=require(_0xc0a0('0x1'));var path=require(_0xc0a0('0x2'));var timeout=require(_0xc0a0('0x3'));var express=require(_0xc0a0('0x4'));var router=express['Router']();var fs_extra=require(_0xc0a0('0x5'));var auth=require(_0xc0a0('0x6'));var interaction=require(_0xc0a0('0x7'));var config=require(_0xc0a0('0x8'));var controller=require(_0xc0a0('0x9'));router['get']('/',auth[_0xc0a0('0xa')](),controller['index']);router['get'](_0xc0a0('0xb'),auth[_0xc0a0('0xa')](),controller[_0xc0a0('0xc')]);router[_0xc0a0('0xd')](_0xc0a0('0xe'),auth[_0xc0a0('0xa')](),controller[_0xc0a0('0xf')]);router[_0xc0a0('0x10')]('/',auth[_0xc0a0('0xa')](),controller[_0xc0a0('0x11')]);router[_0xc0a0('0x12')](_0xc0a0('0xb'),auth[_0xc0a0('0xa')](),controller[_0xc0a0('0x13')]);router[_0xc0a0('0x14')](_0xc0a0('0xb'),auth[_0xc0a0('0xa')](),controller[_0xc0a0('0x15')]);module[_0xc0a0('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 204ebf4..b5faaa0 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 _0x5b7f=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x15a9df,_0x3eb9f3){var _0x20af34=function(_0x53e140){while(--_0x53e140){_0x15a9df['push'](_0x15a9df['shift']());}};_0x20af34(++_0x3eb9f3);}(_0x5b7f,0x81));var _0xf5b7=function(_0xd0424e,_0x16522d){_0xd0424e=_0xd0424e-0x0;var _0x3c60db=_0x5b7f[_0xd0424e];return _0x3c60db;};'use strict';var Sequelize=require(_0xf5b7('0x0'));module[_0xf5b7('0x1')]={'field':{'type':Sequelize[_0xf5b7('0x2')]},'alias':{'type':Sequelize[_0xf5b7('0x3')]},'function':{'type':Sequelize[_0xf5b7('0x3')]},'format':{'type':Sequelize[_0xf5b7('0x3')]},'groupBy':{'type':Sequelize[_0xf5b7('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xf5b7('0x3')]},'custom':{'type':Sequelize[_0xf5b7('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xa945=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x12fb0e,_0x430744){var _0x13f8d3=function(_0x229c3b){while(--_0x229c3b){_0x12fb0e['push'](_0x12fb0e['shift']());}};_0x13f8d3(++_0x430744);}(_0xa945,0x97));var _0x5a94=function(_0x35289d,_0x230ce7){_0x35289d=_0x35289d-0x0;var _0x2dec71=_0xa945[_0x35289d];return _0x2dec71;};'use strict';var Sequelize=require(_0x5a94('0x0'));module[_0x5a94('0x1')]={'field':{'type':Sequelize[_0x5a94('0x2')]},'alias':{'type':Sequelize[_0x5a94('0x3')]},'function':{'type':Sequelize[_0x5a94('0x3')]},'format':{'type':Sequelize[_0x5a94('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x5a94('0x3')]},'custom':{'type':Sequelize[_0x5a94('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 133e024..7b72582 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 _0x8c0e=['includeAll','catch','create','body','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params'];(function(_0x29518d,_0x1e5f3c){var _0x307961=function(_0x2a948e){while(--_0x2a948e){_0x29518d['push'](_0x29518d['shift']());}};_0x307961(++_0x1e5f3c);}(_0x8c0e,0x1a6));var _0xe8c0=function(_0x5dcac6,_0x16c78e){_0x5dcac6=_0x5dcac6-0x0;var _0x2b156d=_0x8c0e[_0x5dcac6];return _0x2b156d;};'use strict';var emlformat=require(_0xe8c0('0x0'));var rimraf=require(_0xe8c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe8c0('0x2'));var rp=require(_0xe8c0('0x3'));var moment=require(_0xe8c0('0x4'));var BPromise=require(_0xe8c0('0x5'));var Mustache=require(_0xe8c0('0x6'));var util=require(_0xe8c0('0x7'));var path=require(_0xe8c0('0x8'));var sox=require('sox');var csv=require(_0xe8c0('0x9'));var ejs=require(_0xe8c0('0xa'));var fs=require('fs');var fs_extra=require(_0xe8c0('0xb'));var _=require(_0xe8c0('0xc'));var squel=require(_0xe8c0('0xd'));var crypto=require(_0xe8c0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe8c0('0xf'));var toCsv=require(_0xe8c0('0x9'));var querystring=require(_0xe8c0('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe8c0('0x11'));var hardwareService=require(_0xe8c0('0x12'));var logger=require('../../config/logger')(_0xe8c0('0x13'));var utils=require(_0xe8c0('0x14'));var config=require(_0xe8c0('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24165a,_0x19c661){_0x19c661=_0x19c661||0xcc;return function(_0xcb594f){if(_0xcb594f){return _0x24165a[_0xe8c0('0x16')](_0x19c661);}return _0x24165a['status'](_0x19c661)[_0xe8c0('0x17')]();};}function respondWithResult(_0x29fe7d,_0x2f844a){_0x2f844a=_0x2f844a||0xc8;return function(_0x131d38){if(_0x131d38){return _0x29fe7d[_0xe8c0('0x18')](_0x2f844a)[_0xe8c0('0x19')](_0x131d38);}};}function respondWithFilteredResult(_0x2ee2dd,_0x3cac3a){return function(_0x419f14){if(_0x419f14){var _0x5f743c=typeof _0x3cac3a[_0xe8c0('0x1a')]===_0xe8c0('0x1b')&&typeof _0x3cac3a[_0xe8c0('0x1c')]===_0xe8c0('0x1b');var _0x35fdf4=_0x419f14[_0xe8c0('0x1d')];var _0x194d3b=_0x5f743c?0x0:_0x3cac3a[_0xe8c0('0x1a')];var _0x424575=_0x5f743c?_0x419f14['count']:_0x3cac3a[_0xe8c0('0x1a')]+_0x3cac3a[_0xe8c0('0x1c')];var _0x22c249;if(_0x424575>=_0x35fdf4){_0x424575=_0x35fdf4;_0x22c249=0xc8;}else{_0x22c249=0xce;}_0x2ee2dd[_0xe8c0('0x18')](_0x22c249);return _0x2ee2dd[_0xe8c0('0x1e')](_0xe8c0('0x1f'),_0x194d3b+'-'+_0x424575+'/'+_0x35fdf4)['json'](_0x419f14);}return null;};}function patchUpdates(_0x3094e3){return function(_0x343049){try{jsonpatch[_0xe8c0('0x20')](_0x343049,_0x3094e3,!![]);}catch(_0x1835c4){return BPromise[_0xe8c0('0x21')](_0x1835c4);}return _0x343049[_0xe8c0('0x22')]();};}function saveUpdates(_0x48c46e,_0xe3e420){return function(_0x1d2dfa){if(_0x1d2dfa){return _0x1d2dfa[_0xe8c0('0x23')](_0x48c46e)[_0xe8c0('0x24')](function(_0x5570e4){return _0x5570e4;});}return null;};}function removeEntity(_0x398112,_0x1e18c9){return function(_0x4dc38d){if(_0x4dc38d){return _0x4dc38d[_0xe8c0('0x25')]()[_0xe8c0('0x24')](function(){_0x398112[_0xe8c0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2504b4,_0x49e2e3){return function(_0x4f1855){if(!_0x4f1855){_0x2504b4[_0xe8c0('0x16')](0x194);}return _0x4f1855;};}function handleError(_0x550d10,_0x401b1a){_0x401b1a=_0x401b1a||0x1f4;return function(_0x1bceac){logger[_0xe8c0('0x26')](_0x1bceac['stack']);if(_0x1bceac[_0xe8c0('0x27')]){delete _0x1bceac['name'];}_0x550d10['status'](_0x401b1a)[_0xe8c0('0x28')](_0x1bceac);};}exports[_0xe8c0('0x29')]=function(_0x342c19,_0x248c02){var _0x285e10={},_0x4997cd={},_0x11c4a5={'count':0x0,'rows':[]};var _0x460da2=_[_0xe8c0('0x2a')](db[_0xe8c0('0x2b')][_0xe8c0('0x2c')],function(_0x14939e){return{'name':_0x14939e[_0xe8c0('0x2d')],'type':_0x14939e[_0xe8c0('0x2e')][_0xe8c0('0x2f')]};});_0x4997cd[_0xe8c0('0x30')]=_[_0xe8c0('0x2a')](_0x460da2,'name');_0x4997cd['query']=_[_0xe8c0('0x31')](_0x342c19[_0xe8c0('0x32')]);_0x4997cd[_0xe8c0('0x33')]=_['intersection'](_0x4997cd[_0xe8c0('0x30')],_0x4997cd[_0xe8c0('0x32')]);_0x285e10[_0xe8c0('0x34')]=_[_0xe8c0('0x35')](_0x4997cd['model'],qs[_0xe8c0('0x36')](_0x342c19[_0xe8c0('0x32')][_0xe8c0('0x36')]));_0x285e10[_0xe8c0('0x34')]=_0x285e10['attributes'][_0xe8c0('0x37')]?_0x285e10['attributes']:_0x4997cd[_0xe8c0('0x30')];if(!_0x342c19[_0xe8c0('0x32')]['hasOwnProperty'](_0xe8c0('0x38'))){_0x285e10[_0xe8c0('0x1c')]=qs[_0xe8c0('0x1c')](_0x342c19[_0xe8c0('0x32')][_0xe8c0('0x1c')]);_0x285e10['offset']=qs[_0xe8c0('0x1a')](_0x342c19['query'][_0xe8c0('0x1a')]);}_0x285e10[_0xe8c0('0x39')]=qs['sort'](_0x342c19[_0xe8c0('0x32')][_0xe8c0('0x3a')]);_0x285e10[_0xe8c0('0x3b')]=qs[_0xe8c0('0x33')](_[_0xe8c0('0x3c')](_0x342c19[_0xe8c0('0x32')],_0x4997cd['filters']),_0x460da2);if(_0x342c19[_0xe8c0('0x32')][_0xe8c0('0x3d')]){_0x285e10[_0xe8c0('0x3b')]=_[_0xe8c0('0x3e')](_0x285e10[_0xe8c0('0x3b')],{'$or':_[_0xe8c0('0x2a')](_0x460da2,function(_0x2b6b9c){if(_0x2b6b9c[_0xe8c0('0x2e')]!==_0xe8c0('0x3f')){var _0x51e3f6={};_0x51e3f6[_0x2b6b9c[_0xe8c0('0x27')]]={'$like':'%'+_0x342c19[_0xe8c0('0x32')][_0xe8c0('0x3d')]+'%'};return _0x51e3f6;}})});}_0x285e10=_[_0xe8c0('0x3e')]({},_0x285e10,_0x342c19[_0xe8c0('0x40')]);var _0x2cc35e={'where':_0x285e10[_0xe8c0('0x3b')]};return db[_0xe8c0('0x2b')][_0xe8c0('0x1d')](_0x2cc35e)['then'](function(_0x1f14d4){_0x11c4a5[_0xe8c0('0x1d')]=_0x1f14d4;if(_0x342c19['query']['includeAll']){_0x285e10[_0xe8c0('0x41')]=[{'all':!![]}];}return db[_0xe8c0('0x2b')][_0xe8c0('0x42')](_0x285e10);})[_0xe8c0('0x24')](function(_0x1dc5fa){_0x11c4a5[_0xe8c0('0x43')]=_0x1dc5fa;return _0x11c4a5;})[_0xe8c0('0x24')](respondWithFilteredResult(_0x248c02,_0x285e10))['catch'](handleError(_0x248c02,null));};exports[_0xe8c0('0x44')]=function(_0x583510,_0x2bfe37){var _0x5dcf92={'raw':![],'where':{'id':_0x583510[_0xe8c0('0x45')]['id']}},_0x2d0be2={};_0x2d0be2['model']=_['keys'](db[_0xe8c0('0x2b')][_0xe8c0('0x2c')]);_0x2d0be2[_0xe8c0('0x32')]=_[_0xe8c0('0x31')](_0x583510[_0xe8c0('0x32')]);_0x2d0be2[_0xe8c0('0x33')]=_['intersection'](_0x2d0be2[_0xe8c0('0x30')],_0x2d0be2[_0xe8c0('0x32')]);_0x5dcf92[_0xe8c0('0x34')]=_['intersection'](_0x2d0be2[_0xe8c0('0x30')],qs[_0xe8c0('0x36')](_0x583510[_0xe8c0('0x32')]['fields']));_0x5dcf92[_0xe8c0('0x34')]=_0x5dcf92[_0xe8c0('0x34')][_0xe8c0('0x37')]?_0x5dcf92['attributes']:_0x2d0be2[_0xe8c0('0x30')];if(_0x583510[_0xe8c0('0x32')][_0xe8c0('0x46')]){_0x5dcf92[_0xe8c0('0x41')]=[{'all':!![]}];}_0x5dcf92=_['merge']({},_0x5dcf92,_0x583510['options']);return db[_0xe8c0('0x2b')]['find'](_0x5dcf92)['then'](handleEntityNotFound(_0x2bfe37,null))[_0xe8c0('0x24')](respondWithResult(_0x2bfe37,null))[_0xe8c0('0x47')](handleError(_0x2bfe37,null));};exports[_0xe8c0('0x48')]=function(_0x1db4ec,_0x3b4511){return db[_0xe8c0('0x2b')][_0xe8c0('0x48')](_0x1db4ec[_0xe8c0('0x49')],{})[_0xe8c0('0x24')](respondWithResult(_0x3b4511,0xc9))[_0xe8c0('0x47')](handleError(_0x3b4511,null));};exports['bulkCreate']=function(_0x1b48c6,_0x3d1dd4){return db[_0xe8c0('0x2b')]['bulkCreate'](_0x1b48c6[_0xe8c0('0x49')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3d1dd4,0xc9))[_0xe8c0('0x47')](handleError(_0x3d1dd4,null));};exports[_0xe8c0('0x23')]=function(_0xdfec37,_0x2ee64c){if(_0xdfec37[_0xe8c0('0x49')]['id']){delete _0xdfec37[_0xe8c0('0x49')]['id'];}return db[_0xe8c0('0x2b')][_0xe8c0('0x4a')]({'where':{'id':_0xdfec37[_0xe8c0('0x45')]['id']}})[_0xe8c0('0x24')](handleEntityNotFound(_0x2ee64c,null))['then'](saveUpdates(_0xdfec37[_0xe8c0('0x49')],null))[_0xe8c0('0x24')](respondWithResult(_0x2ee64c,null))[_0xe8c0('0x47')](handleError(_0x2ee64c,null));};exports[_0xe8c0('0x25')]=function(_0x35e381,_0x1c5d9c){return db[_0xe8c0('0x2b')][_0xe8c0('0x4a')]({'where':{'id':_0x35e381[_0xe8c0('0x45')]['id']}})[_0xe8c0('0x24')](handleEntityNotFound(_0x1c5d9c,null))[_0xe8c0('0x24')](removeEntity(_0x1c5d9c,null))['catch'](handleError(_0x1c5d9c,null));};exports[_0xe8c0('0x4b')]=function(_0x30c6e5,_0x23f304){return db[_0xe8c0('0x2b')][_0xe8c0('0x25')]({'where':{'id':_0x30c6e5[_0xe8c0('0x32')][_0xe8c0('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xe8c0('0x24')](respondWithResult(_0x23f304,0xcc))[_0xe8c0('0x47')](handleError(_0x23f304,null));};exports[_0xe8c0('0x4d')]=function(_0x311ad2,_0x94160e,_0x4b37f8){return db[_0xe8c0('0x4e')][_0xe8c0('0x4f')]({'where':{'id':_0x311ad2['params']['id']}})[_0xe8c0('0x24')](handleEntityNotFound(_0x94160e,null))['then'](function(_0x2b27d5){if(_0x2b27d5){return db[_0xe8c0('0x50')]['transaction'](function(_0x9ee13b){return db[_0xe8c0('0x2b')][_0xe8c0('0x25')]({'where':{'CustomReportId':_0x311ad2[_0xe8c0('0x45')]['id']},'transaction':_0x9ee13b})[_0xe8c0('0x24')](function(_0x1cf7cc){var _0x1c23c4=_[_0xe8c0('0x2a')](_0x311ad2[_0xe8c0('0x49')],function(_0x3a0ebd){delete _0x3a0ebd['id'];_0x3a0ebd['CustomReportId']=_0x311ad2[_0xe8c0('0x45')]['id'];return _0x3a0ebd;});return db[_0xe8c0('0x2b')][_0xe8c0('0x51')](_0x1c23c4,{'transaction':_0x9ee13b});});})[_0xe8c0('0x24')](function(){return db[_0xe8c0('0x2b')]['findAll']({'where':{'CustomReportId':_0x311ad2[_0xe8c0('0x45')]['id']}});});}})[_0xe8c0('0x24')](respondWithResult(_0x94160e,null))[_0xe8c0('0x47')](handleError(_0x94160e,null));};
\ No newline at end of file
+var _0x5e3d=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','then','end','stack','name','send','index','AnalyticFieldReport','rawAttributes','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','pick','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x11622c,_0x1d945a){var _0x51e567=function(_0x8fbeb1){while(--_0x8fbeb1){_0x11622c['push'](_0x11622c['shift']());}};_0x51e567(++_0x1d945a);}(_0x5e3d,0x1c9));var _0xd5e3=function(_0x1eee56,_0x5ebe19){_0x1eee56=_0x1eee56-0x0;var _0x34a182=_0x5e3d[_0x1eee56];return _0x34a182;};'use strict';var emlformat=require(_0xd5e3('0x0'));var rimraf=require(_0xd5e3('0x1'));var zipdir=require(_0xd5e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd5e3('0x3'));var moment=require(_0xd5e3('0x4'));var BPromise=require(_0xd5e3('0x5'));var Mustache=require('mustache');var util=require(_0xd5e3('0x6'));var path=require(_0xd5e3('0x7'));var sox=require(_0xd5e3('0x8'));var csv=require(_0xd5e3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd5e3('0xa'));var squel=require('squel');var crypto=require(_0xd5e3('0xb'));var jsforce=require(_0xd5e3('0xc'));var deskjs=require(_0xd5e3('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd5e3('0xe'));var Redis=require(_0xd5e3('0xf'));var authService=require(_0xd5e3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd5e3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd5e3('0x12'))(_0xd5e3('0x13'));var utils=require(_0xd5e3('0x14'));var config=require(_0xd5e3('0x15'));var licenseUtil=require(_0xd5e3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ac5c0,_0x45993c){_0x45993c=_0x45993c||0xcc;return function(_0x3dc18c){if(_0x3dc18c){return _0x2ac5c0[_0xd5e3('0x17')](_0x45993c);}return _0x2ac5c0[_0xd5e3('0x18')](_0x45993c)['end']();};}function respondWithResult(_0xc4bb1d,_0x58a208){_0x58a208=_0x58a208||0xc8;return function(_0x45c785){if(_0x45c785){return _0xc4bb1d[_0xd5e3('0x18')](_0x58a208)[_0xd5e3('0x19')](_0x45c785);}};}function respondWithFilteredResult(_0xd1243b,_0x29883e){return function(_0x3f5f8b){if(_0x3f5f8b){var _0x23b034=typeof _0x29883e['offset']===_0xd5e3('0x1a')&&typeof _0x29883e['limit']===_0xd5e3('0x1a');var _0x5a5f35=_0x3f5f8b[_0xd5e3('0x1b')];var _0x2ecffa=_0x23b034?0x0:_0x29883e[_0xd5e3('0x1c')];var _0x5ede63=_0x23b034?_0x3f5f8b[_0xd5e3('0x1b')]:_0x29883e['offset']+_0x29883e[_0xd5e3('0x1d')];var _0x484bd7;if(_0x5ede63>=_0x5a5f35){_0x5ede63=_0x5a5f35;_0x484bd7=0xc8;}else{_0x484bd7=0xce;}_0xd1243b[_0xd5e3('0x18')](_0x484bd7);return _0xd1243b[_0xd5e3('0x1e')](_0xd5e3('0x1f'),_0x2ecffa+'-'+_0x5ede63+'/'+_0x5a5f35)['json'](_0x3f5f8b);}return null;};}function patchUpdates(_0x148704){return function(_0x4d34e2){try{jsonpatch[_0xd5e3('0x20')](_0x4d34e2,_0x148704,!![]);}catch(_0x9e5433){return BPromise['reject'](_0x9e5433);}return _0x4d34e2['save']();};}function saveUpdates(_0x55c090,_0x20941d){return function(_0x1e74d6){if(_0x1e74d6){return _0x1e74d6[_0xd5e3('0x21')](_0x55c090)['then'](function(_0x2a5b15){return _0x2a5b15;});}return null;};}function removeEntity(_0x47e23a,_0x483103){return function(_0x410def){if(_0x410def){return _0x410def[_0xd5e3('0x22')]()[_0xd5e3('0x23')](function(){_0x47e23a[_0xd5e3('0x18')](0xcc)[_0xd5e3('0x24')]();});}};}function handleEntityNotFound(_0x45d58c,_0x3bf220){return function(_0x3bc3e7){if(!_0x3bc3e7){_0x45d58c[_0xd5e3('0x17')](0x194);}return _0x3bc3e7;};}function handleError(_0x2bdfcd,_0x35f99b){_0x35f99b=_0x35f99b||0x1f4;return function(_0x1fe7b1){logger['error'](_0x1fe7b1[_0xd5e3('0x25')]);if(_0x1fe7b1[_0xd5e3('0x26')]){delete _0x1fe7b1[_0xd5e3('0x26')];}_0x2bdfcd[_0xd5e3('0x18')](_0x35f99b)[_0xd5e3('0x27')](_0x1fe7b1);};}exports[_0xd5e3('0x28')]=function(_0x5d5079,_0x1c9476){var _0x1b2f0c={},_0x355088={},_0x337284={'count':0x0,'rows':[]};var _0x231d31=_['map'](db[_0xd5e3('0x29')][_0xd5e3('0x2a')],function(_0x31a211){return{'name':_0x31a211['fieldName'],'type':_0x31a211[_0xd5e3('0x2b')][_0xd5e3('0x2c')]};});_0x355088['model']=_[_0xd5e3('0x2d')](_0x231d31,'name');_0x355088[_0xd5e3('0x2e')]=_[_0xd5e3('0x2f')](_0x5d5079[_0xd5e3('0x2e')]);_0x355088[_0xd5e3('0x30')]=_[_0xd5e3('0x31')](_0x355088['model'],_0x355088[_0xd5e3('0x2e')]);_0x1b2f0c[_0xd5e3('0x32')]=_[_0xd5e3('0x31')](_0x355088[_0xd5e3('0x33')],qs['fields'](_0x5d5079[_0xd5e3('0x2e')][_0xd5e3('0x34')]));_0x1b2f0c[_0xd5e3('0x32')]=_0x1b2f0c[_0xd5e3('0x32')][_0xd5e3('0x35')]?_0x1b2f0c[_0xd5e3('0x32')]:_0x355088['model'];if(!_0x5d5079[_0xd5e3('0x2e')]['hasOwnProperty'](_0xd5e3('0x36'))){_0x1b2f0c[_0xd5e3('0x1d')]=qs[_0xd5e3('0x1d')](_0x5d5079[_0xd5e3('0x2e')][_0xd5e3('0x1d')]);_0x1b2f0c['offset']=qs['offset'](_0x5d5079[_0xd5e3('0x2e')][_0xd5e3('0x1c')]);}_0x1b2f0c[_0xd5e3('0x37')]=qs['sort'](_0x5d5079[_0xd5e3('0x2e')]['sort']);_0x1b2f0c['where']=qs[_0xd5e3('0x30')](_[_0xd5e3('0x38')](_0x5d5079['query'],_0x355088[_0xd5e3('0x30')]),_0x231d31);if(_0x5d5079['query']['filter']){_0x1b2f0c[_0xd5e3('0x39')]=_[_0xd5e3('0x3a')](_0x1b2f0c[_0xd5e3('0x39')],{'$or':_[_0xd5e3('0x2d')](_0x231d31,function(_0x11bd1e){if(_0x11bd1e['type']!==_0xd5e3('0x3b')){var _0x2922b9={};_0x2922b9[_0x11bd1e[_0xd5e3('0x26')]]={'$like':'%'+_0x5d5079[_0xd5e3('0x2e')]['filter']+'%'};return _0x2922b9;}})});}_0x1b2f0c=_['merge']({},_0x1b2f0c,_0x5d5079[_0xd5e3('0x3c')]);var _0x3fbfe8={'where':_0x1b2f0c[_0xd5e3('0x39')]};return db['AnalyticFieldReport'][_0xd5e3('0x1b')](_0x3fbfe8)[_0xd5e3('0x23')](function(_0x240909){_0x337284[_0xd5e3('0x1b')]=_0x240909;if(_0x5d5079[_0xd5e3('0x2e')][_0xd5e3('0x3d')]){_0x1b2f0c[_0xd5e3('0x3e')]=[{'all':!![]}];}return db[_0xd5e3('0x29')]['findAll'](_0x1b2f0c);})[_0xd5e3('0x23')](function(_0xe93ce1){_0x337284[_0xd5e3('0x3f')]=_0xe93ce1;return _0x337284;})[_0xd5e3('0x23')](respondWithFilteredResult(_0x1c9476,_0x1b2f0c))['catch'](handleError(_0x1c9476,null));};exports[_0xd5e3('0x40')]=function(_0x312047,_0x57dce9){var _0x24da6e={'raw':![],'where':{'id':_0x312047[_0xd5e3('0x41')]['id']}},_0x5d6001={};_0x5d6001['model']=_['keys'](db['AnalyticFieldReport'][_0xd5e3('0x2a')]);_0x5d6001[_0xd5e3('0x2e')]=_['keys'](_0x312047[_0xd5e3('0x2e')]);_0x5d6001[_0xd5e3('0x30')]=_['intersection'](_0x5d6001['model'],_0x5d6001[_0xd5e3('0x2e')]);_0x24da6e[_0xd5e3('0x32')]=_[_0xd5e3('0x31')](_0x5d6001['model'],qs[_0xd5e3('0x34')](_0x312047[_0xd5e3('0x2e')][_0xd5e3('0x34')]));_0x24da6e['attributes']=_0x24da6e[_0xd5e3('0x32')][_0xd5e3('0x35')]?_0x24da6e[_0xd5e3('0x32')]:_0x5d6001[_0xd5e3('0x33')];if(_0x312047['query'][_0xd5e3('0x3d')]){_0x24da6e[_0xd5e3('0x3e')]=[{'all':!![]}];}_0x24da6e=_[_0xd5e3('0x3a')]({},_0x24da6e,_0x312047[_0xd5e3('0x3c')]);return db[_0xd5e3('0x29')][_0xd5e3('0x42')](_0x24da6e)[_0xd5e3('0x23')](handleEntityNotFound(_0x57dce9,null))['then'](respondWithResult(_0x57dce9,null))[_0xd5e3('0x43')](handleError(_0x57dce9,null));};exports['create']=function(_0x3eae7f,_0x2a0a2d){return db[_0xd5e3('0x29')][_0xd5e3('0x44')](_0x3eae7f[_0xd5e3('0x45')],{})['then'](respondWithResult(_0x2a0a2d,0xc9))[_0xd5e3('0x43')](handleError(_0x2a0a2d,null));};exports['bulkCreate']=function(_0x11c4cb,_0x3295cb){return db[_0xd5e3('0x29')][_0xd5e3('0x46')](_0x11c4cb[_0xd5e3('0x45')],{'raw':![],'individualHooks':!![]})[_0xd5e3('0x23')](respondWithResult(_0x3295cb,0xc9))['catch'](handleError(_0x3295cb,null));};exports[_0xd5e3('0x21')]=function(_0x2fd672,_0x1627f5){if(_0x2fd672[_0xd5e3('0x45')]['id']){delete _0x2fd672['body']['id'];}return db['AnalyticFieldReport'][_0xd5e3('0x42')]({'where':{'id':_0x2fd672[_0xd5e3('0x41')]['id']}})[_0xd5e3('0x23')](handleEntityNotFound(_0x1627f5,null))[_0xd5e3('0x23')](saveUpdates(_0x2fd672[_0xd5e3('0x45')],null))[_0xd5e3('0x23')](respondWithResult(_0x1627f5,null))['catch'](handleError(_0x1627f5,null));};exports[_0xd5e3('0x22')]=function(_0x57df68,_0x2868da){return db[_0xd5e3('0x29')][_0xd5e3('0x42')]({'where':{'id':_0x57df68[_0xd5e3('0x41')]['id']}})[_0xd5e3('0x23')](handleEntityNotFound(_0x2868da,null))[_0xd5e3('0x23')](removeEntity(_0x2868da,null))['catch'](handleError(_0x2868da,null));};exports[_0xd5e3('0x47')]=function(_0x46c8a0,_0x3dd69a){return db[_0xd5e3('0x29')][_0xd5e3('0x22')]({'where':{'id':_0x46c8a0[_0xd5e3('0x2e')][_0xd5e3('0x48')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3dd69a,0xcc))[_0xd5e3('0x43')](handleError(_0x3dd69a,null));};exports[_0xd5e3('0x49')]=function(_0xf5a1bb,_0x3fbc01,_0x56a3f8){return db[_0xd5e3('0x4a')][_0xd5e3('0x4b')]({'where':{'id':_0xf5a1bb[_0xd5e3('0x41')]['id']}})[_0xd5e3('0x23')](handleEntityNotFound(_0x3fbc01,null))[_0xd5e3('0x23')](function(_0x5117ca){if(_0x5117ca){return db[_0xd5e3('0x4c')][_0xd5e3('0x4d')](function(_0x1a69a2){return db[_0xd5e3('0x29')][_0xd5e3('0x22')]({'where':{'CustomReportId':_0xf5a1bb['params']['id']},'transaction':_0x1a69a2})['then'](function(_0x5dfc42){var _0x4bd53f=_[_0xd5e3('0x2d')](_0xf5a1bb[_0xd5e3('0x45')],function(_0x57a022){delete _0x57a022['id'];_0x57a022[_0xd5e3('0x4e')]=_0xf5a1bb[_0xd5e3('0x41')]['id'];return _0x57a022;});return db[_0xd5e3('0x29')][_0xd5e3('0x46')](_0x4bd53f,{'transaction':_0x1a69a2});});})[_0xd5e3('0x23')](function(){return db['AnalyticFieldReport'][_0xd5e3('0x4f')]({'where':{'CustomReportId':_0xf5a1bb[_0xd5e3('0x41')]['id']}});});}})[_0xd5e3('0x23')](respondWithResult(_0x3fbc01,null))[_0xd5e3('0x43')](handleError(_0x3fbc01,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 7d3c60e..78de996 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 _0x7eef=['request-promise','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','api','moment'];(function(_0x758c4c,_0x590551){var _0x59dd93=function(_0x50f870){while(--_0x50f870){_0x758c4c['push'](_0x758c4c['shift']());}};_0x59dd93(++_0x590551);}(_0x7eef,0xba));var _0xf7ee=function(_0x146a85,_0x529b52){_0x146a85=_0x146a85-0x0;var _0x1b59bf=_0x7eef[_0x146a85];return _0x1b59bf;};'use strict';var _=require(_0xf7ee('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf7ee('0x1'));var moment=require(_0xf7ee('0x2'));var BPromise=require('bluebird');var rp=require(_0xf7ee('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf7ee('0x4'));var attributes=require(_0xf7ee('0x5'));module[_0xf7ee('0x6')]=function(_0x3089ac,_0x12fac8){return _0x3089ac['define'](_0xf7ee('0x7'),attributes,{'tableName':_0xf7ee('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2766=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','util','../../config/logger','moment','request-promise'];(function(_0x85f059,_0x27d70e){var _0x3520f7=function(_0x5b7c68){while(--_0x5b7c68){_0x85f059['push'](_0x85f059['shift']());}};_0x3520f7(++_0x27d70e);}(_0x2766,0x1ac));var _0x6276=function(_0x57645b,_0x25f73a){_0x57645b=_0x57645b-0x0;var _0xe82f00=_0x2766[_0x57645b];return _0xe82f00;};'use strict';var _=require('lodash');var util=require(_0x6276('0x0'));var logger=require(_0x6276('0x1'))('api');var moment=require(_0x6276('0x2'));var BPromise=require('bluebird');var rp=require(_0x6276('0x3'));var fs=require('fs');var path=require(_0x6276('0x4'));var rimraf=require(_0x6276('0x5'));var config=require(_0x6276('0x6'));var attributes=require(_0x6276('0x7'));module['exports']=function(_0x1d0a7d,_0x450f12){return _0x1d0a7d[_0x6276('0x8')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','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 e240810..c0e00a2 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 _0x7efa=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x49daf3,_0x2f3779){var _0x5dff0a=function(_0x2b567b){while(--_0x2b567b){_0x49daf3['push'](_0x49daf3['shift']());}};_0x5dff0a(++_0x2f3779);}(_0x7efa,0x1cb));var _0xa7ef=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x7efa[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xa7ef('0x0'));var util=require(_0xa7ef('0x1'));var moment=require(_0xa7ef('0x2'));var BPromise=require('bluebird');var rs=require(_0xa7ef('0x3'));var fs=require('fs');var Redis=require(_0xa7ef('0x4'));var db=require(_0xa7ef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7ef('0x6'))('rpc');var config=require(_0xa7ef('0x7'));var jayson=require(_0xa7ef('0x8'));var client=jayson[_0xa7ef('0x9')][_0xa7ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cf8a,_0x242f16,_0x1cb36a){return new BPromise(function(_0x580282,_0xc04145){return client[_0xa7ef('0xb')](_0x4cf8a,_0x1cb36a)[_0xa7ef('0xc')](function(_0x232600){logger[_0xa7ef('0xd')](_0xa7ef('0xe'),_0x242f16,_0xa7ef('0xf'));logger[_0xa7ef('0x10')](_0xa7ef('0x11'),_0x242f16,'request\x20sent',JSON[_0xa7ef('0x12')](_0x232600));if(_0x232600[_0xa7ef('0x13')]){if(_0x232600[_0xa7ef('0x13')][_0xa7ef('0x14')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x242f16,_0x232600[_0xa7ef('0x13')][_0xa7ef('0x15')]);return _0xc04145(_0x232600[_0xa7ef('0x13')][_0xa7ef('0x15')]);}logger['error'](_0xa7ef('0xe'),_0x242f16,_0x232600['error']['message']);return _0x580282(_0x232600[_0xa7ef('0x13')][_0xa7ef('0x15')]);}else{logger[_0xa7ef('0xd')](_0xa7ef('0xe'),_0x242f16,_0xa7ef('0xf'));_0x580282(_0x232600[_0xa7ef('0x16')][_0xa7ef('0x15')]);}})['catch'](function(_0x40ddc1){logger[_0xa7ef('0x13')](_0xa7ef('0xe'),_0x242f16,_0x40ddc1);_0xc04145(_0x40ddc1);});});}
\ No newline at end of file
+var _0x6d66=['http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client'];(function(_0x44e4f3,_0x27770a){var _0x39b544=function(_0x3ecf81){while(--_0x3ecf81){_0x44e4f3['push'](_0x44e4f3['shift']());}};_0x39b544(++_0x27770a);}(_0x6d66,0x1c4));var _0x66d6=function(_0x4b0ec6,_0x20ca44){_0x4b0ec6=_0x4b0ec6-0x0;var _0x40044a=_0x6d66[_0x4b0ec6];return _0x40044a;};'use strict';var _=require(_0x66d6('0x0'));var util=require('util');var moment=require(_0x66d6('0x1'));var BPromise=require(_0x66d6('0x2'));var rs=require(_0x66d6('0x3'));var fs=require('fs');var Redis=require(_0x66d6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x66d6('0x5'))('rpc');var config=require(_0x66d6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x66d6('0x7')][_0x66d6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f77dd,_0x46677d,_0xbff7e5){return new BPromise(function(_0x413a9b,_0x192356){return client[_0x66d6('0x9')](_0x3f77dd,_0xbff7e5)[_0x66d6('0xa')](function(_0xede20c){logger[_0x66d6('0xb')](_0x66d6('0xc'),_0x46677d,'request\x20sent');logger[_0x66d6('0xd')](_0x66d6('0xe'),_0x46677d,_0x66d6('0xf'),JSON['stringify'](_0xede20c));if(_0xede20c[_0x66d6('0x10')]){if(_0xede20c[_0x66d6('0x10')][_0x66d6('0x11')]===0x1f4){logger[_0x66d6('0x10')](_0x66d6('0xc'),_0x46677d,_0xede20c[_0x66d6('0x10')][_0x66d6('0x12')]);return _0x192356(_0xede20c[_0x66d6('0x10')][_0x66d6('0x12')]);}logger['error'](_0x66d6('0xc'),_0x46677d,_0xede20c[_0x66d6('0x10')][_0x66d6('0x12')]);return _0x413a9b(_0xede20c[_0x66d6('0x10')][_0x66d6('0x12')]);}else{logger[_0x66d6('0xb')](_0x66d6('0xc'),_0x46677d,_0x66d6('0xf'));_0x413a9b(_0xede20c[_0x66d6('0x13')][_0x66d6('0x12')]);}})['catch'](function(_0x2b6e6e){logger[_0x66d6('0x10')](_0x66d6('0xc'),_0x46677d,_0x2b6e6e);_0x192356(_0x2b6e6e);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 8c8dc27..d71774c 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(_0xb12b49,_0x50c6d6){var _0x592f07=function(_0x63460d){while(--_0x63460d){_0xb12b49['push'](_0xb12b49['shift']());}};_0x592f07(++_0x50c6d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0x41e5e6,_0x358ad4){var _0x518d68=function(_0x27d1b2){while(--_0x27d1b2){_0x41e5e6['push'](_0x41e5e6['shift']());}};_0x518d68(++_0x358ad4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 b633b69..aa6531c 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 _0x23a3=['TEXT','STRING','name'];(function(_0x459437,_0x139ded){var _0x576989=function(_0x58a29b){while(--_0x58a29b){_0x459437['push'](_0x459437['shift']());}};_0x576989(++_0x139ded);}(_0x23a3,0x131));var _0x323a=function(_0x399822,_0x3667ef){_0x399822=_0x399822-0x0;var _0x943381=_0x23a3[_0x399822];return _0x943381;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x323a('0x0')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x323a('0x1')]},'description':{'type':Sequelize[_0x323a('0x2')]}};
\ No newline at end of file
+var _0x8580=['name','STRING','exports'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x8580,0x1c7));var _0x0858=function(_0x34f425,_0x568016){_0x34f425=_0x34f425-0x0;var _0x49c9b0=_0x8580[_0x34f425];return _0x49c9b0;};'use strict';var Sequelize=require('sequelize');module[_0x0858('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0858('0x1')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x0858('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 16842e9..e5e29ef 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 _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x2c407a,_0x46124a){var _0x1211c5=function(_0x2028e2){while(--_0x2028e2){_0x2c407a['push'](_0x2c407a['shift']());}};_0x1211c5(++_0x46124a);}(_0xe5b3,0x133));var _0x3e5b=function(_0x48ac19,_0x3c29fc){_0x48ac19=_0x48ac19-0x0;var _0x1cd27d=_0xe5b3[_0x48ac19];return _0x1cd27d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));};
\ No newline at end of file
+var _0x3e74=['status','set','Content-Range','apply','save','update','then','destroy','get','Metrics','sendStatus','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','rawAttributes','length','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count'];(function(_0x3dd8c7,_0x2fd962){var _0xe9d17a=function(_0xf2040e){while(--_0xf2040e){_0x3dd8c7['push'](_0x3dd8c7['shift']());}};_0xe9d17a(++_0x2fd962);}(_0x3e74,0x175));var _0x43e7=function(_0x4a783f,_0x3f70a9){_0x4a783f=_0x4a783f-0x0;var _0x2b2b03=_0x3e74[_0x4a783f];return _0x2b2b03;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){var _0x4b2b9f=_0x4c9df3[_0x43e7('0x23')]({'plain':!![]});var _0x4ca5cf=_0x43e7('0x24');return db['UserProfileResource'][_0x43e7('0x22')]({'where':{'type':_0x4ca5cf,'resourceId':_0x4b2b9f['id']}})[_0x43e7('0x21')](function(){return _0x4c9df3;});})[_0x43e7('0x21')](function(){_0x454359[_0x43e7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b7b3,_0x805b54){return function(_0x501551){if(!_0x501551){_0x52b7b3[_0x43e7('0x25')](0x194);}return _0x501551;};}function handleError(_0x40dc8f,_0x3565cf){_0x3565cf=_0x3565cf||0x1f4;return function(_0xb1fc63){logger['error'](_0xb1fc63[_0x43e7('0x26')]);if(_0xb1fc63[_0x43e7('0x27')]){delete _0xb1fc63[_0x43e7('0x27')];}_0x40dc8f[_0x43e7('0x1b')](_0x3565cf)[_0x43e7('0x28')](_0xb1fc63);};}exports[_0x43e7('0x29')]=function(_0x2b85a5,_0x31b2a6){var _0x3bf475={},_0x35dbcd={},_0x17df44={'count':0x0,'rows':[]};var _0x19725a=_[_0x43e7('0x2a')](db[_0x43e7('0x2b')]['rawAttributes'],function(_0x238321){return{'name':_0x238321[_0x43e7('0x2c')],'type':_0x238321[_0x43e7('0x2d')][_0x43e7('0x2e')]};});_0x35dbcd[_0x43e7('0x2f')]=_['map'](_0x19725a,_0x43e7('0x27'));_0x35dbcd[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x2b85a5[_0x43e7('0x30')]);_0x35dbcd['filters']=_['intersection'](_0x35dbcd['model'],_0x35dbcd[_0x43e7('0x30')]);_0x3bf475[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0x35dbcd[_0x43e7('0x2f')],qs[_0x43e7('0x34')](_0x2b85a5[_0x43e7('0x30')]['fields']));_0x3bf475['attributes']=_0x3bf475['attributes']['length']?_0x3bf475['attributes']:_0x35dbcd['model'];if(!_0x2b85a5['query'][_0x43e7('0x35')]('nolimit')){_0x3bf475[_0x43e7('0x18')]=qs[_0x43e7('0x18')](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x18')]);_0x3bf475[_0x43e7('0x19')]=qs[_0x43e7('0x19')](_0x2b85a5[_0x43e7('0x30')]['offset']);}_0x3bf475['order']=qs['sort'](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x36')]);_0x3bf475[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_[_0x43e7('0x39')](_0x2b85a5[_0x43e7('0x30')],_0x35dbcd[_0x43e7('0x38')]),_0x19725a);if(_0x2b85a5[_0x43e7('0x30')]['filter']){_0x3bf475[_0x43e7('0x37')]=_[_0x43e7('0x3a')](_0x3bf475['where'],{'$or':_[_0x43e7('0x2a')](_0x19725a,function(_0x4c0c7a){if(_0x4c0c7a[_0x43e7('0x2d')]!==_0x43e7('0x3b')){var _0x1c6f45={};_0x1c6f45[_0x4c0c7a[_0x43e7('0x27')]]={'$like':'%'+_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x3c')]+'%'};return _0x1c6f45;}})});}_0x3bf475=_['merge']({},_0x3bf475,_0x2b85a5['options']);var _0x30dfa9={'where':_0x3bf475[_0x43e7('0x37')]};return db[_0x43e7('0x2b')][_0x43e7('0x1a')](_0x30dfa9)[_0x43e7('0x21')](function(_0x4a4a85){_0x17df44[_0x43e7('0x1a')]=_0x4a4a85;if(_0x2b85a5[_0x43e7('0x30')]['includeAll']){_0x3bf475[_0x43e7('0x3d')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x43e7('0x3e')](_0x3bf475);})['then'](function(_0x3d81ae){_0x17df44[_0x43e7('0x3f')]=_0x3d81ae;return _0x17df44;})[_0x43e7('0x21')](respondWithFilteredResult(_0x31b2a6,_0x3bf475))[_0x43e7('0x40')](handleError(_0x31b2a6,null));};exports['show']=function(_0x47d6a1,_0x103393){var _0x40c509={'raw':!![],'where':{'id':_0x47d6a1[_0x43e7('0x41')]['id']}},_0xe979b5={};_0xe979b5['model']=_['keys'](db['AnalyticMetric'][_0x43e7('0x42')]);_0xe979b5['query']=_[_0x43e7('0x31')](_0x47d6a1['query']);_0xe979b5['filters']=_[_0x43e7('0x33')](_0xe979b5['model'],_0xe979b5[_0x43e7('0x30')]);_0x40c509[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0xe979b5[_0x43e7('0x2f')],qs['fields'](_0x47d6a1[_0x43e7('0x30')][_0x43e7('0x34')]));_0x40c509[_0x43e7('0x32')]=_0x40c509[_0x43e7('0x32')][_0x43e7('0x43')]?_0x40c509[_0x43e7('0x32')]:_0xe979b5['model'];if(_0x47d6a1['query'][_0x43e7('0x44')]){_0x40c509[_0x43e7('0x3d')]=[{'all':!![]}];}_0x40c509=_[_0x43e7('0x3a')]({},_0x40c509,_0x47d6a1['options']);return db['AnalyticMetric']['find'](_0x40c509)[_0x43e7('0x21')](handleEntityNotFound(_0x103393,null))[_0x43e7('0x21')](respondWithResult(_0x103393,null))['catch'](handleError(_0x103393,null));};exports[_0x43e7('0x45')]=function(_0x47686e,_0x3c96fe){return db['AnalyticMetric']['create'](_0x47686e['body'],{})['then'](function(_0x214e7e){var _0xe955fc=_0x47686e['user'][_0x43e7('0x23')]({'plain':!![]});if(!_0xe955fc)throw new Error(_0x43e7('0x46'));if(_0xe955fc[_0x43e7('0x47')]===_0x43e7('0x48')){var _0x4a0ce5=_0x214e7e[_0x43e7('0x23')]({'plain':!![]});var _0x483f20='Metrics';return db[_0x43e7('0x49')][_0x43e7('0x4a')]({'where':{'name':_0x483f20,'userProfileId':_0xe955fc[_0x43e7('0x4b')]},'raw':!![]})[_0x43e7('0x21')](function(_0x13503c){if(_0x13503c&&_0x13503c[_0x43e7('0x4c')]===0x0){return db[_0x43e7('0x4d')][_0x43e7('0x45')]({'name':_0x4a0ce5[_0x43e7('0x27')],'resourceId':_0x4a0ce5['id'],'type':_0x13503c[_0x43e7('0x27')],'sectionId':_0x13503c['id']},{})['then'](function(){return _0x214e7e;});}else{return _0x214e7e;}})[_0x43e7('0x40')](function(_0x46c910){logger['error'](_0x43e7('0x4e'),_0x46c910);throw _0x46c910;});}return _0x214e7e;})['then'](respondWithResult(_0x3c96fe,0xc9))[_0x43e7('0x40')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x20')]=function(_0x34e2ec,_0x1f561f){if(_0x34e2ec[_0x43e7('0x4f')]['id']){delete _0x34e2ec['body']['id'];}return db['AnalyticMetric'][_0x43e7('0x4a')]({'where':{'id':_0x34e2ec[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x1f561f,null))[_0x43e7('0x21')](saveUpdates(_0x34e2ec[_0x43e7('0x4f')],null))[_0x43e7('0x21')](respondWithResult(_0x1f561f,null))[_0x43e7('0x40')](handleError(_0x1f561f,null));};exports[_0x43e7('0x22')]=function(_0x26d86c,_0x24e758){return db[_0x43e7('0x2b')]['find']({'where':{'id':_0x26d86c[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x24e758,null))['then'](removeEntity(_0x24e758,null))[_0x43e7('0x40')](handleError(_0x24e758,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 5c2a322..e476c8f 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 _0x576b=['define','AnalyticMetric','analytics_metrics','api','moment','request-promise','path','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x26e727,_0x3e65be){var _0x563800=function(_0xbcf999){while(--_0xbcf999){_0x26e727['push'](_0x26e727['shift']());}};_0x563800(++_0x3e65be);}(_0x576b,0x1d9));var _0xb576=function(_0x123015,_0x43dd0f){_0x123015=_0x123015-0x0;var _0x237557=_0x576b[_0x123015];return _0x237557;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb576('0x0'));var moment=require(_0xb576('0x1'));var BPromise=require('bluebird');var rp=require(_0xb576('0x2'));var fs=require('fs');var path=require(_0xb576('0x3'));var rimraf=require('rimraf');var config=require(_0xb576('0x4'));var attributes=require(_0xb576('0x5'));module[_0xb576('0x6')]=function(_0x3039d9,_0x11427a){return _0x3039d9[_0xb576('0x7')](_0xb576('0x8'),attributes,{'tableName':_0xb576('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc91=['analytics_metrics','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0x493552,_0x2cd527){var _0x243ea8=function(_0x531f6e){while(--_0x531f6e){_0x493552['push'](_0x493552['shift']());}};_0x243ea8(++_0x2cd527);}(_0xfc91,0xb5));var _0x1fc9=function(_0x37579b,_0x458372){_0x37579b=_0x37579b-0x0;var _0x1d4e13=_0xfc91[_0x37579b];return _0x1d4e13;};'use strict';var _=require('lodash');var util=require(_0x1fc9('0x0'));var logger=require('../../config/logger')(_0x1fc9('0x1'));var moment=require(_0x1fc9('0x2'));var BPromise=require(_0x1fc9('0x3'));var rp=require(_0x1fc9('0x4'));var fs=require('fs');var path=require(_0x1fc9('0x5'));var rimraf=require(_0x1fc9('0x6'));var config=require(_0x1fc9('0x7'));var attributes=require(_0x1fc9('0x8'));module[_0x1fc9('0x9')]=function(_0xb6caac,_0xc81f3b){return _0xb6caac[_0x1fc9('0xa')]('AnalyticMetric',attributes,{'tableName':_0x1fc9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index c6543d2..ec6f6d9 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 _0x8afb=['rpc','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','lodash','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x484f06,_0x36e4ac){var _0x332d44=function(_0x1db42e){while(--_0x1db42e){_0x484f06['push'](_0x484f06['shift']());}};_0x332d44(++_0x36e4ac);}(_0x8afb,0x127));var _0xb8af=function(_0x2f0832,_0x268977){_0x2f0832=_0x2f0832-0x0;var _0x52db08=_0x8afb[_0x2f0832];return _0x52db08;};'use strict';var _=require(_0xb8af('0x0'));var util=require('util');var moment=require(_0xb8af('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8af('0x2'))['db'];var utils=require(_0xb8af('0x3'));var logger=require(_0xb8af('0x4'))(_0xb8af('0x5'));var config=require('../../config/environment');var jayson=require(_0xb8af('0x6'));var client=jayson[_0xb8af('0x7')][_0xb8af('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ec809,_0x863764,_0x2ca671){return new BPromise(function(_0x42abf5,_0x474d8b){return client[_0xb8af('0x9')](_0x4ec809,_0x2ca671)[_0xb8af('0xa')](function(_0x27c184){logger[_0xb8af('0xb')](_0xb8af('0xc'),_0x863764,'request\x20sent');logger[_0xb8af('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x863764,_0xb8af('0xe'),JSON[_0xb8af('0xf')](_0x27c184));if(_0x27c184['error']){if(_0x27c184['error'][_0xb8af('0x10')]===0x1f4){logger[_0xb8af('0x11')](_0xb8af('0xc'),_0x863764,_0x27c184['error'][_0xb8af('0x12')]);return _0x474d8b(_0x27c184[_0xb8af('0x11')]['message']);}logger[_0xb8af('0x11')](_0xb8af('0xc'),_0x863764,_0x27c184['error'][_0xb8af('0x12')]);return _0x42abf5(_0x27c184['error'][_0xb8af('0x12')]);}else{logger[_0xb8af('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x863764,_0xb8af('0xe'));_0x42abf5(_0x27c184[_0xb8af('0x13')][_0xb8af('0x12')]);}})['catch'](function(_0xc4fccf){logger[_0xb8af('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x863764,_0xc4fccf);_0x474d8b(_0xc4fccf);});});}
\ No newline at end of file
+var _0xa26f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch'];(function(_0x2c2ed9,_0x23501a){var _0x23d701=function(_0x2956fc){while(--_0x2956fc){_0x2c2ed9['push'](_0x2c2ed9['shift']());}};_0x23d701(++_0x23501a);}(_0xa26f,0x160));var _0xfa26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa26f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfa26('0x0'));var util=require(_0xfa26('0x1'));var moment=require(_0xfa26('0x2'));var BPromise=require(_0xfa26('0x3'));var rs=require(_0xfa26('0x4'));var fs=require('fs');var Redis=require(_0xfa26('0x5'));var db=require(_0xfa26('0x6'))['db'];var utils=require(_0xfa26('0x7'));var logger=require(_0xfa26('0x8'))(_0xfa26('0x9'));var config=require(_0xfa26('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xfa26('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x548f1a,_0x3e313c,_0xea135d){return new BPromise(function(_0x294f3c,_0x20b816){return client['request'](_0x548f1a,_0xea135d)[_0xfa26('0xc')](function(_0x1eb2ce){logger[_0xfa26('0xd')](_0xfa26('0xe'),_0x3e313c,'request\x20sent');logger[_0xfa26('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x3e313c,_0xfa26('0x10'),JSON[_0xfa26('0x11')](_0x1eb2ce));if(_0x1eb2ce[_0xfa26('0x12')]){if(_0x1eb2ce[_0xfa26('0x12')]['code']===0x1f4){logger[_0xfa26('0x12')](_0xfa26('0xe'),_0x3e313c,_0x1eb2ce[_0xfa26('0x12')][_0xfa26('0x13')]);return _0x20b816(_0x1eb2ce[_0xfa26('0x12')][_0xfa26('0x13')]);}logger[_0xfa26('0x12')](_0xfa26('0xe'),_0x3e313c,_0x1eb2ce['error'][_0xfa26('0x13')]);return _0x294f3c(_0x1eb2ce['error'][_0xfa26('0x13')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x3e313c,_0xfa26('0x10'));_0x294f3c(_0x1eb2ce[_0xfa26('0x14')]['message']);}})[_0xfa26('0x15')](function(_0x262160){logger[_0xfa26('0x12')](_0xfa26('0xe'),_0x3e313c,_0x262160);_0x20b816(_0x262160);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 5c340c4..01693cc 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 _0xfd8f=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0xfd8f,0xae));var _0xffd8=function(_0x2b72ca,_0x17a97a){_0x2b72ca=_0x2b72ca-0x0;var _0x2e662d=_0xfd8f[_0x2b72ca];return _0x2e662d;};'use strict';var multer=require(_0xffd8('0x0'));var util=require(_0xffd8('0x1'));var path=require('path');var timeout=require(_0xffd8('0x2'));var express=require(_0xffd8('0x3'));var router=express[_0xffd8('0x4')]();var fs_extra=require(_0xffd8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xffd8('0x6'));var config=require(_0xffd8('0x7'));var controller=require('./analyticMetric.controller');router[_0xffd8('0x8')]('/',auth[_0xffd8('0x9')](),controller[_0xffd8('0xa')]);router[_0xffd8('0x8')](_0xffd8('0xb'),auth[_0xffd8('0x9')](),controller['show']);router[_0xffd8('0xc')]('/',auth[_0xffd8('0x9')](),controller[_0xffd8('0xd')]);router[_0xffd8('0xe')]('/:id',auth[_0xffd8('0x9')](),controller[_0xffd8('0xf')]);router[_0xffd8('0x10')](_0xffd8('0xb'),auth[_0xffd8('0x9')](),controller[_0xffd8('0x11')]);module[_0xffd8('0x12')]=router;
\ No newline at end of file
+var _0x0618=['update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','put'];(function(_0xa2c86d,_0x2124dd){var _0x5152f1=function(_0x402cf2){while(--_0x402cf2){_0xa2c86d['push'](_0xa2c86d['shift']());}};_0x5152f1(++_0x2124dd);}(_0x0618,0x1c6));var _0x8061=function(_0x23f558,_0x34d026){_0x23f558=_0x23f558-0x0;var _0x55e9ec=_0x0618[_0x23f558];return _0x55e9ec;};'use strict';var multer=require(_0x8061('0x0'));var util=require(_0x8061('0x1'));var path=require('path');var timeout=require(_0x8061('0x2'));var express=require(_0x8061('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8061('0x4'));var interaction=require(_0x8061('0x5'));var config=require(_0x8061('0x6'));var controller=require(_0x8061('0x7'));router[_0x8061('0x8')]('/',auth[_0x8061('0x9')](),controller[_0x8061('0xa')]);router[_0x8061('0x8')](_0x8061('0xb'),auth[_0x8061('0x9')](),controller[_0x8061('0xc')]);router['post']('/',auth[_0x8061('0x9')](),controller['create']);router[_0x8061('0xd')](_0x8061('0xb'),auth[_0x8061('0x9')](),controller[_0x8061('0xe')]);router[_0x8061('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x8061('0x10')]);module[_0x8061('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index ed2943c..bf1fb9f 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 _0xf2d7=['exports','sequelize'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0xf2d7,0x157));var _0x7f2d=function(_0x58c53f,_0x39dbf8){_0x58c53f=_0x58c53f-0x0;var _0x355c2a=_0xf2d7[_0x58c53f];return _0x355c2a;};'use strict';var Sequelize=require(_0x7f2d('0x0'));module[_0x7f2d('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xa0af=['exports','TEXT','sequelize'];(function(_0x3ae716,_0x9d6f6f){var _0x96215e=function(_0x5d3b50){while(--_0x5d3b50){_0x3ae716['push'](_0x3ae716['shift']());}};_0x96215e(++_0x9d6f6f);}(_0xa0af,0x185));var _0xfa0a=function(_0x567bb3,_0x14684e){_0x567bb3=_0x567bb3-0x0;var _0x2c6503=_0xa0af[_0x567bb3];return _0x2c6503;};'use strict';var Sequelize=require(_0xfa0a('0x0'));module[_0xfa0a('0x1')]={'tree':{'type':Sequelize[_0xfa0a('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 3b5fc7f..96ee9c5 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 _0xc431=['AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','length','find','create','body','catch','destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','map'];(function(_0x20d56d,_0x29c493){var _0xfd33f2=function(_0x2fc23d){while(--_0x2fc23d){_0x20d56d['push'](_0x20d56d['shift']());}};_0xfd33f2(++_0x29c493);}(_0xc431,0x6d));var _0x1c43=function(_0x29a234,_0x1b10a1){_0x29a234=_0x29a234-0x0;var _0x4736c6=_0xc431[_0x29a234];return _0x4736c6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c43('0x0'));var zipdir=require(_0x1c43('0x1'));var jsonpatch=require(_0x1c43('0x2'));var rp=require('request-promise');var moment=require(_0x1c43('0x3'));var BPromise=require(_0x1c43('0x4'));var Mustache=require(_0x1c43('0x5'));var util=require(_0x1c43('0x6'));var path=require(_0x1c43('0x7'));var sox=require('sox');var csv=require(_0x1c43('0x8'));var ejs=require(_0x1c43('0x9'));var fs=require('fs');var fs_extra=require(_0x1c43('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1c43('0xb'));var jsforce=require(_0x1c43('0xc'));var deskjs=require(_0x1c43('0xd'));var toCsv=require(_0x1c43('0x8'));var querystring=require(_0x1c43('0xe'));var Papa=require('papaparse');var Redis=require(_0x1c43('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1c43('0x10'));var as=require(_0x1c43('0x11'));var hardwareService=require(_0x1c43('0x12'));var logger=require(_0x1c43('0x13'))(_0x1c43('0x14'));var utils=require('../../config/utils');var config=require(_0x1c43('0x15'));var licenseUtil=require(_0x1c43('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dd57a,_0x412ac0){_0x412ac0=_0x412ac0||0xcc;return function(_0x5c3ec7){if(_0x5c3ec7){return _0x5dd57a['sendStatus'](_0x412ac0);}return _0x5dd57a['status'](_0x412ac0)['end']();};}function respondWithResult(_0x4da6c3,_0x589b0d){_0x589b0d=_0x589b0d||0xc8;return function(_0x1a50fb){if(_0x1a50fb){return _0x4da6c3[_0x1c43('0x17')](_0x589b0d)[_0x1c43('0x18')](_0x1a50fb);}};}function respondWithFilteredResult(_0x3ea29b,_0x43094f){return function(_0x1327a9){if(_0x1327a9){var _0x534097=typeof _0x43094f[_0x1c43('0x19')]===_0x1c43('0x1a')&&typeof _0x43094f['limit']===_0x1c43('0x1a');var _0xca13bc=_0x1327a9['count'];var _0x10fae1=_0x534097?0x0:_0x43094f[_0x1c43('0x19')];var _0x33676a=_0x534097?_0x1327a9['count']:_0x43094f[_0x1c43('0x19')]+_0x43094f[_0x1c43('0x1b')];var _0x7b1862;if(_0x33676a>=_0xca13bc){_0x33676a=_0xca13bc;_0x7b1862=0xc8;}else{_0x7b1862=0xce;}_0x3ea29b[_0x1c43('0x17')](_0x7b1862);return _0x3ea29b[_0x1c43('0x1c')](_0x1c43('0x1d'),_0x10fae1+'-'+_0x33676a+'/'+_0xca13bc)[_0x1c43('0x18')](_0x1327a9);}return null;};}function patchUpdates(_0x2b80a3){return function(_0x2e1c28){try{jsonpatch['apply'](_0x2e1c28,_0x2b80a3,!![]);}catch(_0xcaa29){return BPromise[_0x1c43('0x1e')](_0xcaa29);}return _0x2e1c28[_0x1c43('0x1f')]();};}function saveUpdates(_0x164e51,_0x38c5d4){return function(_0x4bca34){if(_0x4bca34){return _0x4bca34[_0x1c43('0x20')](_0x164e51)[_0x1c43('0x21')](function(_0x1382b7){return _0x1382b7;});}return null;};}function removeEntity(_0x3c68b4,_0x4b194){return function(_0x10267d){if(_0x10267d){return _0x10267d['destroy']()[_0x1c43('0x21')](function(){_0x3c68b4[_0x1c43('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58e90e,_0x1b83e0){return function(_0x26a105){if(!_0x26a105){_0x58e90e[_0x1c43('0x22')](0x194);}return _0x26a105;};}function handleError(_0xebb50c,_0x3474d5){_0x3474d5=_0x3474d5||0x1f4;return function(_0x1cc0ad){logger[_0x1c43('0x23')](_0x1cc0ad[_0x1c43('0x24')]);if(_0x1cc0ad['name']){delete _0x1cc0ad[_0x1c43('0x25')];}_0xebb50c[_0x1c43('0x17')](_0x3474d5)[_0x1c43('0x26')](_0x1cc0ad);};}exports[_0x1c43('0x27')]=function(_0x2ff694,_0x2c539b){var _0x516b57={},_0x22534e={},_0x41baad={'count':0x0,'rows':[]};var _0x2f1980=_[_0x1c43('0x28')](db[_0x1c43('0x29')][_0x1c43('0x2a')],function(_0x4acc90){return{'name':_0x4acc90[_0x1c43('0x2b')],'type':_0x4acc90[_0x1c43('0x2c')][_0x1c43('0x2d')]};});_0x22534e['model']=_[_0x1c43('0x28')](_0x2f1980,_0x1c43('0x25'));_0x22534e[_0x1c43('0x2e')]=_[_0x1c43('0x2f')](_0x2ff694[_0x1c43('0x2e')]);_0x22534e[_0x1c43('0x30')]=_['intersection'](_0x22534e[_0x1c43('0x31')],_0x22534e[_0x1c43('0x2e')]);_0x516b57['attributes']=_[_0x1c43('0x32')](_0x22534e[_0x1c43('0x31')],qs['fields'](_0x2ff694[_0x1c43('0x2e')][_0x1c43('0x33')]));_0x516b57[_0x1c43('0x34')]=_0x516b57['attributes']['length']?_0x516b57[_0x1c43('0x34')]:_0x22534e['model'];if(!_0x2ff694[_0x1c43('0x2e')][_0x1c43('0x35')](_0x1c43('0x36'))){_0x516b57[_0x1c43('0x1b')]=qs['limit'](_0x2ff694[_0x1c43('0x2e')]['limit']);_0x516b57['offset']=qs[_0x1c43('0x19')](_0x2ff694[_0x1c43('0x2e')][_0x1c43('0x19')]);}_0x516b57[_0x1c43('0x37')]=qs[_0x1c43('0x38')](_0x2ff694[_0x1c43('0x2e')]['sort']);_0x516b57[_0x1c43('0x39')]=qs[_0x1c43('0x30')](_[_0x1c43('0x3a')](_0x2ff694[_0x1c43('0x2e')],_0x22534e[_0x1c43('0x30')]),_0x2f1980);if(_0x2ff694[_0x1c43('0x2e')][_0x1c43('0x3b')]){_0x516b57['where']=_[_0x1c43('0x3c')](_0x516b57['where'],{'$or':_[_0x1c43('0x28')](_0x2f1980,function(_0x5c2e79){if(_0x5c2e79['type']!==_0x1c43('0x3d')){var _0xe93cce={};_0xe93cce[_0x5c2e79[_0x1c43('0x25')]]={'$like':'%'+_0x2ff694['query'][_0x1c43('0x3b')]+'%'};return _0xe93cce;}})});}_0x516b57=_[_0x1c43('0x3c')]({},_0x516b57,_0x2ff694[_0x1c43('0x3e')]);var _0x521c94={'where':_0x516b57[_0x1c43('0x39')]};return db[_0x1c43('0x29')][_0x1c43('0x3f')](_0x521c94)['then'](function(_0x351c25){_0x41baad[_0x1c43('0x3f')]=_0x351c25;if(_0x2ff694[_0x1c43('0x2e')][_0x1c43('0x40')]){_0x516b57[_0x1c43('0x41')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x516b57);})['then'](function(_0x206d6b){_0x41baad[_0x1c43('0x42')]=_0x206d6b;return _0x41baad;})[_0x1c43('0x21')](respondWithFilteredResult(_0x2c539b,_0x516b57))['catch'](handleError(_0x2c539b,null));};exports[_0x1c43('0x43')]=function(_0xb4aefe,_0x2d4c44){var _0x21c143={'raw':!![],'where':{'id':_0xb4aefe[_0x1c43('0x44')]['id']}},_0x33c2a5={};_0x33c2a5['model']=_[_0x1c43('0x2f')](db[_0x1c43('0x29')][_0x1c43('0x2a')]);_0x33c2a5['query']=_[_0x1c43('0x2f')](_0xb4aefe[_0x1c43('0x2e')]);_0x33c2a5[_0x1c43('0x30')]=_['intersection'](_0x33c2a5[_0x1c43('0x31')],_0x33c2a5[_0x1c43('0x2e')]);_0x21c143[_0x1c43('0x34')]=_['intersection'](_0x33c2a5[_0x1c43('0x31')],qs[_0x1c43('0x33')](_0xb4aefe['query']['fields']));_0x21c143['attributes']=_0x21c143[_0x1c43('0x34')][_0x1c43('0x45')]?_0x21c143['attributes']:_0x33c2a5['model'];if(_0xb4aefe[_0x1c43('0x2e')][_0x1c43('0x40')]){_0x21c143[_0x1c43('0x41')]=[{'all':!![]}];}_0x21c143=_['merge']({},_0x21c143,_0xb4aefe[_0x1c43('0x3e')]);return db['AnalyticTreeReport'][_0x1c43('0x46')](_0x21c143)['then'](handleEntityNotFound(_0x2d4c44,null))[_0x1c43('0x21')](respondWithResult(_0x2d4c44,null))['catch'](handleError(_0x2d4c44,null));};exports['create']=function(_0x4e03ba,_0x57cf64){return db[_0x1c43('0x29')][_0x1c43('0x47')](_0x4e03ba[_0x1c43('0x48')],{})[_0x1c43('0x21')](respondWithResult(_0x57cf64,0xc9))[_0x1c43('0x49')](handleError(_0x57cf64,null));};exports[_0x1c43('0x20')]=function(_0x463bfc,_0x29f1a2){if(_0x463bfc[_0x1c43('0x48')]['id']){delete _0x463bfc['body']['id'];}return db[_0x1c43('0x29')]['find']({'where':{'id':_0x463bfc[_0x1c43('0x44')]['id']}})[_0x1c43('0x21')](handleEntityNotFound(_0x29f1a2,null))[_0x1c43('0x21')](saveUpdates(_0x463bfc[_0x1c43('0x48')],null))[_0x1c43('0x21')](respondWithResult(_0x29f1a2,null))[_0x1c43('0x49')](handleError(_0x29f1a2,null));};exports[_0x1c43('0x4a')]=function(_0x41420b,_0x979efa){return db[_0x1c43('0x29')][_0x1c43('0x46')]({'where':{'id':_0x41420b[_0x1c43('0x44')]['id']}})[_0x1c43('0x21')](handleEntityNotFound(_0x979efa,null))[_0x1c43('0x21')](removeEntity(_0x979efa,null))['catch'](handleError(_0x979efa,null));};
\ No newline at end of file
+var _0xb880=['json','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','count','set','Content-Range'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xb880,0x1b3));var _0x0b88=function(_0x2507a4,_0x4cfa9e){_0x2507a4=_0x2507a4-0x0;var _0x16db86=_0xb880[_0x2507a4];return _0x16db86;};'use strict';var emlformat=require(_0x0b88('0x0'));var rimraf=require(_0x0b88('0x1'));var zipdir=require(_0x0b88('0x2'));var jsonpatch=require(_0x0b88('0x3'));var rp=require(_0x0b88('0x4'));var moment=require('moment');var BPromise=require(_0x0b88('0x5'));var Mustache=require(_0x0b88('0x6'));var util=require(_0x0b88('0x7'));var path=require('path');var sox=require(_0x0b88('0x8'));var csv=require(_0x0b88('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b88('0xa'));var _=require(_0x0b88('0xb'));var squel=require(_0x0b88('0xc'));var crypto=require('crypto');var jsforce=require(_0x0b88('0xd'));var deskjs=require(_0x0b88('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0b88('0xf'));var Papa=require('papaparse');var Redis=require(_0x0b88('0x10'));var authService=require(_0x0b88('0x11'));var qs=require(_0x0b88('0x12'));var as=require(_0x0b88('0x13'));var hardwareService=require(_0x0b88('0x14'));var logger=require(_0x0b88('0x15'))(_0x0b88('0x16'));var utils=require(_0x0b88('0x17'));var config=require(_0x0b88('0x18'));var licenseUtil=require(_0x0b88('0x19'));var db=require(_0x0b88('0x1a'))['db'];function respondWithStatusCode(_0x2a3320,_0x2220f7){_0x2220f7=_0x2220f7||0xcc;return function(_0x1e49c2){if(_0x1e49c2){return _0x2a3320['sendStatus'](_0x2220f7);}return _0x2a3320[_0x0b88('0x1b')](_0x2220f7)['end']();};}function respondWithResult(_0x42ac54,_0x216831){_0x216831=_0x216831||0xc8;return function(_0x1654f3){if(_0x1654f3){return _0x42ac54['status'](_0x216831)['json'](_0x1654f3);}};}function respondWithFilteredResult(_0x6957e7,_0x884f25){return function(_0x4d2b1c){if(_0x4d2b1c){var _0x3bfe7f=typeof _0x884f25[_0x0b88('0x1c')]==='undefined'&&typeof _0x884f25[_0x0b88('0x1d')]==='undefined';var _0x256c29=_0x4d2b1c[_0x0b88('0x1e')];var _0x44a9e2=_0x3bfe7f?0x0:_0x884f25[_0x0b88('0x1c')];var _0x59618a=_0x3bfe7f?_0x4d2b1c[_0x0b88('0x1e')]:_0x884f25[_0x0b88('0x1c')]+_0x884f25[_0x0b88('0x1d')];var _0x8a157d;if(_0x59618a>=_0x256c29){_0x59618a=_0x256c29;_0x8a157d=0xc8;}else{_0x8a157d=0xce;}_0x6957e7[_0x0b88('0x1b')](_0x8a157d);return _0x6957e7[_0x0b88('0x1f')](_0x0b88('0x20'),_0x44a9e2+'-'+_0x59618a+'/'+_0x256c29)[_0x0b88('0x21')](_0x4d2b1c);}return null;};}function patchUpdates(_0x991fdf){return function(_0x2880ea){try{jsonpatch[_0x0b88('0x22')](_0x2880ea,_0x991fdf,!![]);}catch(_0x96913){return BPromise[_0x0b88('0x23')](_0x96913);}return _0x2880ea[_0x0b88('0x24')]();};}function saveUpdates(_0x2e708e,_0x40cf3b){return function(_0x6b22cf){if(_0x6b22cf){return _0x6b22cf[_0x0b88('0x25')](_0x2e708e)['then'](function(_0x37ed3f){return _0x37ed3f;});}return null;};}function removeEntity(_0x49caa4,_0x1161b2){return function(_0x90160c){if(_0x90160c){return _0x90160c[_0x0b88('0x26')]()[_0x0b88('0x27')](function(){_0x49caa4[_0x0b88('0x1b')](0xcc)[_0x0b88('0x28')]();});}};}function handleEntityNotFound(_0x48474c,_0x10985d){return function(_0x2d5148){if(!_0x2d5148){_0x48474c[_0x0b88('0x29')](0x194);}return _0x2d5148;};}function handleError(_0x3c5f4b,_0x2e455a){_0x2e455a=_0x2e455a||0x1f4;return function(_0x45cffd){logger[_0x0b88('0x2a')](_0x45cffd[_0x0b88('0x2b')]);if(_0x45cffd[_0x0b88('0x2c')]){delete _0x45cffd['name'];}_0x3c5f4b['status'](_0x2e455a)[_0x0b88('0x2d')](_0x45cffd);};}exports[_0x0b88('0x2e')]=function(_0x47da11,_0x5f47a0){var _0x4c0173={},_0x373fbb={},_0x596cde={'count':0x0,'rows':[]};var _0x4d424c=_[_0x0b88('0x2f')](db[_0x0b88('0x30')][_0x0b88('0x31')],function(_0x3587f1){return{'name':_0x3587f1['fieldName'],'type':_0x3587f1[_0x0b88('0x32')][_0x0b88('0x33')]};});_0x373fbb[_0x0b88('0x34')]=_[_0x0b88('0x2f')](_0x4d424c,'name');_0x373fbb[_0x0b88('0x35')]=_[_0x0b88('0x36')](_0x47da11['query']);_0x373fbb[_0x0b88('0x37')]=_[_0x0b88('0x38')](_0x373fbb[_0x0b88('0x34')],_0x373fbb['query']);_0x4c0173[_0x0b88('0x39')]=_[_0x0b88('0x38')](_0x373fbb[_0x0b88('0x34')],qs[_0x0b88('0x3a')](_0x47da11[_0x0b88('0x35')][_0x0b88('0x3a')]));_0x4c0173[_0x0b88('0x39')]=_0x4c0173[_0x0b88('0x39')][_0x0b88('0x3b')]?_0x4c0173['attributes']:_0x373fbb[_0x0b88('0x34')];if(!_0x47da11[_0x0b88('0x35')][_0x0b88('0x3c')](_0x0b88('0x3d'))){_0x4c0173['limit']=qs[_0x0b88('0x1d')](_0x47da11[_0x0b88('0x35')][_0x0b88('0x1d')]);_0x4c0173['offset']=qs[_0x0b88('0x1c')](_0x47da11[_0x0b88('0x35')][_0x0b88('0x1c')]);}_0x4c0173[_0x0b88('0x3e')]=qs[_0x0b88('0x3f')](_0x47da11[_0x0b88('0x35')][_0x0b88('0x3f')]);_0x4c0173[_0x0b88('0x40')]=qs['filters'](_[_0x0b88('0x41')](_0x47da11[_0x0b88('0x35')],_0x373fbb[_0x0b88('0x37')]),_0x4d424c);if(_0x47da11['query'][_0x0b88('0x42')]){_0x4c0173[_0x0b88('0x40')]=_['merge'](_0x4c0173[_0x0b88('0x40')],{'$or':_[_0x0b88('0x2f')](_0x4d424c,function(_0x19596c){if(_0x19596c[_0x0b88('0x32')]!=='VIRTUAL'){var _0x5cb3a8={};_0x5cb3a8[_0x19596c['name']]={'$like':'%'+_0x47da11[_0x0b88('0x35')][_0x0b88('0x42')]+'%'};return _0x5cb3a8;}})});}_0x4c0173=_[_0x0b88('0x43')]({},_0x4c0173,_0x47da11[_0x0b88('0x44')]);var _0x4c4fc2={'where':_0x4c0173[_0x0b88('0x40')]};return db[_0x0b88('0x30')][_0x0b88('0x1e')](_0x4c4fc2)['then'](function(_0x16d822){_0x596cde[_0x0b88('0x1e')]=_0x16d822;if(_0x47da11[_0x0b88('0x35')][_0x0b88('0x45')]){_0x4c0173[_0x0b88('0x46')]=[{'all':!![]}];}return db[_0x0b88('0x30')]['findAll'](_0x4c0173);})['then'](function(_0x4c9dec){_0x596cde[_0x0b88('0x47')]=_0x4c9dec;return _0x596cde;})[_0x0b88('0x27')](respondWithFilteredResult(_0x5f47a0,_0x4c0173))['catch'](handleError(_0x5f47a0,null));};exports[_0x0b88('0x48')]=function(_0x1f3cb9,_0x3571ec){var _0x5ec873={'raw':!![],'where':{'id':_0x1f3cb9[_0x0b88('0x49')]['id']}},_0x110810={};_0x110810[_0x0b88('0x34')]=_[_0x0b88('0x36')](db['AnalyticTreeReport'][_0x0b88('0x31')]);_0x110810['query']=_[_0x0b88('0x36')](_0x1f3cb9[_0x0b88('0x35')]);_0x110810[_0x0b88('0x37')]=_['intersection'](_0x110810[_0x0b88('0x34')],_0x110810[_0x0b88('0x35')]);_0x5ec873[_0x0b88('0x39')]=_['intersection'](_0x110810[_0x0b88('0x34')],qs[_0x0b88('0x3a')](_0x1f3cb9['query'][_0x0b88('0x3a')]));_0x5ec873['attributes']=_0x5ec873[_0x0b88('0x39')]['length']?_0x5ec873[_0x0b88('0x39')]:_0x110810[_0x0b88('0x34')];if(_0x1f3cb9['query'][_0x0b88('0x45')]){_0x5ec873['include']=[{'all':!![]}];}_0x5ec873=_[_0x0b88('0x43')]({},_0x5ec873,_0x1f3cb9[_0x0b88('0x44')]);return db[_0x0b88('0x30')][_0x0b88('0x4a')](_0x5ec873)['then'](handleEntityNotFound(_0x3571ec,null))[_0x0b88('0x27')](respondWithResult(_0x3571ec,null))[_0x0b88('0x4b')](handleError(_0x3571ec,null));};exports[_0x0b88('0x4c')]=function(_0x438f9b,_0x789aa3){return db['AnalyticTreeReport'][_0x0b88('0x4c')](_0x438f9b[_0x0b88('0x4d')],{})[_0x0b88('0x27')](respondWithResult(_0x789aa3,0xc9))['catch'](handleError(_0x789aa3,null));};exports[_0x0b88('0x25')]=function(_0x339e2e,_0x1058c1){if(_0x339e2e[_0x0b88('0x4d')]['id']){delete _0x339e2e[_0x0b88('0x4d')]['id'];}return db[_0x0b88('0x30')][_0x0b88('0x4a')]({'where':{'id':_0x339e2e[_0x0b88('0x49')]['id']}})['then'](handleEntityNotFound(_0x1058c1,null))[_0x0b88('0x27')](saveUpdates(_0x339e2e['body'],null))['then'](respondWithResult(_0x1058c1,null))[_0x0b88('0x4b')](handleError(_0x1058c1,null));};exports[_0x0b88('0x26')]=function(_0x6c5b48,_0x22f5bf){return db['AnalyticTreeReport'][_0x0b88('0x4a')]({'where':{'id':_0x6c5b48['params']['id']}})[_0x0b88('0x27')](handleEntityNotFound(_0x22f5bf,null))[_0x0b88('0x27')](removeEntity(_0x22f5bf,null))[_0x0b88('0x4b')](handleError(_0x22f5bf,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 9dd7899..6124a75 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 _0x728c=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./analyticTreeReport.attributes','exports','define'];(function(_0x40df5f,_0x8fd59f){var _0x1573f1=function(_0x57b8b8){while(--_0x57b8b8){_0x40df5f['push'](_0x40df5f['shift']());}};_0x1573f1(++_0x8fd59f);}(_0x728c,0x1f0));var _0xc728=function(_0x41859b,_0x4d2525){_0x41859b=_0x41859b-0x0;var _0x303ac9=_0x728c[_0x41859b];return _0x303ac9;};'use strict';var _=require(_0xc728('0x0'));var util=require(_0xc728('0x1'));var logger=require(_0xc728('0x2'))(_0xc728('0x3'));var moment=require(_0xc728('0x4'));var BPromise=require(_0xc728('0x5'));var rp=require(_0xc728('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc728('0x7'));var config=require('../../config/environment');var attributes=require(_0xc728('0x8'));module[_0xc728('0x9')]=function(_0x198004,_0x50777c){return _0x198004[_0xc728('0xa')](_0xc728('0xb'),attributes,{'tableName':_0xc728('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6400=['analytics_report_trees','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x6400,0x90));var _0x0640=function(_0x47645f,_0x629091){_0x47645f=_0x47645f-0x0;var _0x40a4ed=_0x6400[_0x47645f];return _0x40a4ed;};'use strict';var _=require(_0x0640('0x0'));var util=require('util');var logger=require(_0x0640('0x1'))(_0x0640('0x2'));var moment=require('moment');var BPromise=require(_0x0640('0x3'));var rp=require(_0x0640('0x4'));var fs=require('fs');var path=require(_0x0640('0x5'));var rimraf=require(_0x0640('0x6'));var config=require(_0x0640('0x7'));var attributes=require(_0x0640('0x8'));module[_0x0640('0x9')]=function(_0x177af6,_0x113509){return _0x177af6[_0x0640('0xa')](_0x0640('0xb'),attributes,{'tableName':_0x0640('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 8e11a53..898b789 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x367e14,_0x1aec22){var _0x3bf76e=function(_0x112fc4){while(--_0x112fc4){_0x367e14['push'](_0x367e14['shift']());}};_0x3bf76e(++_0x1aec22);}(_0x1261,0x144));var _0x1126=function(_0x11f598,_0x5a2990){_0x11f598=_0x11f598-0x0;var _0x2a37dc=_0x1261[_0x11f598];return _0x2a37dc;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _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(_0x21b762,_0xc8ef11){var _0x2ea6d4=function(_0x22bd14){while(--_0x22bd14){_0x21b762['push'](_0x21b762['shift']());}};_0x2ea6d4(++_0xc8ef11);}(_0x2ef3,0xba));var _0x32ef=function(_0x648ff5,_0x3c9306){_0x648ff5=_0x648ff5-0x0;var _0x3b4f94=_0x2ef3[_0x648ff5];return _0x3b4f94;};'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 e60bb50..d8c6960 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 _0x67e4=['path','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','destroy','exports','multer'];(function(_0x4dc953,_0x20cbc6){var _0x49fcd0=function(_0x6adb52){while(--_0x6adb52){_0x4dc953['push'](_0x4dc953['shift']());}};_0x49fcd0(++_0x20cbc6);}(_0x67e4,0x11f));var _0x467e=function(_0x28e2cd,_0x153b42){_0x28e2cd=_0x28e2cd-0x0;var _0x11fd46=_0x67e4[_0x28e2cd];return _0x11fd46;};'use strict';var multer=require(_0x467e('0x0'));var util=require('util');var path=require(_0x467e('0x1'));var timeout=require('connect-timeout');var express=require(_0x467e('0x2'));var router=express['Router']();var fs_extra=require(_0x467e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x467e('0x4'));var config=require(_0x467e('0x5'));var controller=require(_0x467e('0x6'));router[_0x467e('0x7')]('/',auth[_0x467e('0x8')](),controller[_0x467e('0x9')]);router[_0x467e('0x7')](_0x467e('0xa'),auth[_0x467e('0x8')](),controller[_0x467e('0xb')]);router[_0x467e('0xc')]('/',auth[_0x467e('0x8')](),controller[_0x467e('0xd')]);router['put'](_0x467e('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x467e('0xa'),auth[_0x467e('0x8')](),controller[_0x467e('0xe')]);module[_0x467e('0xf')]=router;
\ No newline at end of file
+var _0xe5ba=['../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x596d2e,_0xf247b0){var _0x35b47d=function(_0x2abc08){while(--_0x2abc08){_0x596d2e['push'](_0x596d2e['shift']());}};_0x35b47d(++_0xf247b0);}(_0xe5ba,0x149));var _0xae5b=function(_0x4f0c15,_0x2945d0){_0x4f0c15=_0x4f0c15-0x0;var _0x131818=_0xe5ba[_0x4f0c15];return _0x131818;};'use strict';var multer=require(_0xae5b('0x0'));var util=require('util');var path=require(_0xae5b('0x1'));var timeout=require(_0xae5b('0x2'));var express=require(_0xae5b('0x3'));var router=express[_0xae5b('0x4')]();var fs_extra=require(_0xae5b('0x5'));var auth=require(_0xae5b('0x6'));var interaction=require(_0xae5b('0x7'));var config=require(_0xae5b('0x8'));var controller=require(_0xae5b('0x9'));router[_0xae5b('0xa')]('/',auth[_0xae5b('0xb')](),controller[_0xae5b('0xc')]);router[_0xae5b('0xa')]('/:id',auth[_0xae5b('0xb')](),controller['show']);router[_0xae5b('0xd')]('/',auth[_0xae5b('0xb')](),controller[_0xae5b('0xe')]);router[_0xae5b('0xf')](_0xae5b('0x10'),auth[_0xae5b('0xb')](),controller[_0xae5b('0x11')]);router[_0xae5b('0x12')](_0xae5b('0x10'),auth[_0xae5b('0xb')](),controller[_0xae5b('0x13')]);module[_0xae5b('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 8854faf..c1b77b9 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 _0x448b=['exports','STRING','sequelize'];(function(_0x1ba57f,_0xb81938){var _0x5a7f02=function(_0x32b234){while(--_0x32b234){_0x1ba57f['push'](_0x1ba57f['shift']());}};_0x5a7f02(++_0xb81938);}(_0x448b,0x125));var _0xb448=function(_0x4c5087,_0x521a29){_0x4c5087=_0x4c5087-0x0;var _0x4c4b67=_0x448b[_0x4c5087];return _0x4c4b67;};'use strict';var Sequelize=require(_0xb448('0x0'));module[_0xb448('0x1')]={'name':{'type':Sequelize[_0xb448('0x2')]},'basename':{'type':Sequelize[_0xb448('0x2')]},'type':{'type':Sequelize[_0xb448('0x2')]}};
\ No newline at end of file
+var _0xee24=['exports','STRING'];(function(_0x57566a,_0x551a70){var _0x260af6=function(_0x5d3cac){while(--_0x5d3cac){_0x57566a['push'](_0x57566a['shift']());}};_0x260af6(++_0x551a70);}(_0xee24,0x1a6));var _0x4ee2=function(_0xe68132,_0x4a7e97){_0xe68132=_0xe68132-0x0;var _0x19ed56=_0xee24[_0xe68132];return _0x19ed56;};'use strict';var Sequelize=require('sequelize');module[_0x4ee2('0x0')]={'name':{'type':Sequelize[_0x4ee2('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4ee2('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 1a37d03..dd1e477 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 _0x155b=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','options','Attachment','includeAll','rows','show','params','include','find','catch','get','omit','createdAt','updatedAt','body','create','destroy','file','originalname','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','rawAttributes'];(function(_0x46505f,_0x26e394){var _0x2aa7af=function(_0x26df29){while(--_0x26df29){_0x46505f['push'](_0x46505f['shift']());}};_0x2aa7af(++_0x26e394);}(_0x155b,0x12e));var _0xb155=function(_0x65efc5,_0x5d978c){_0x65efc5=_0x65efc5-0x0;var _0x4c387a=_0x155b[_0x65efc5];return _0x4c387a;};'use strict';var emlformat=require(_0xb155('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb155('0x1'));var jsonpatch=require(_0xb155('0x2'));var rp=require(_0xb155('0x3'));var moment=require(_0xb155('0x4'));var BPromise=require(_0xb155('0x5'));var Mustache=require('mustache');var util=require(_0xb155('0x6'));var path=require(_0xb155('0x7'));var sox=require(_0xb155('0x8'));var csv=require(_0xb155('0x9'));var ejs=require(_0xb155('0xa'));var fs=require('fs');var fs_extra=require(_0xb155('0xb'));var _=require('lodash');var squel=require(_0xb155('0xc'));var crypto=require(_0xb155('0xd'));var jsforce=require(_0xb155('0xe'));var deskjs=require(_0xb155('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb155('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb155('0x11'));var hardwareService=require(_0xb155('0x12'));var logger=require(_0xb155('0x13'))(_0xb155('0x14'));var utils=require(_0xb155('0x15'));var config=require(_0xb155('0x16'));var licenseUtil=require(_0xb155('0x17'));var db=require(_0xb155('0x18'))['db'];function respondWithStatusCode(_0x330eaa,_0x1367c8){_0x1367c8=_0x1367c8||0xcc;return function(_0x20cebd){if(_0x20cebd){return _0x330eaa[_0xb155('0x19')](_0x1367c8);}return _0x330eaa[_0xb155('0x1a')](_0x1367c8)[_0xb155('0x1b')]();};}function respondWithResult(_0x402ec4,_0x8fac87){_0x8fac87=_0x8fac87||0xc8;return function(_0x2fb88d){if(_0x2fb88d){return _0x402ec4[_0xb155('0x1a')](_0x8fac87)[_0xb155('0x1c')](_0x2fb88d);}};}function respondWithFilteredResult(_0x48b06d,_0x37159c){return function(_0xe119e6){if(_0xe119e6){var _0x118017=typeof _0x37159c[_0xb155('0x1d')]===_0xb155('0x1e')&&typeof _0x37159c[_0xb155('0x1f')]===_0xb155('0x1e');var _0x3e7aa6=_0xe119e6[_0xb155('0x20')];var _0x3de179=_0x118017?0x0:_0x37159c['offset'];var _0x347002=_0x118017?_0xe119e6[_0xb155('0x20')]:_0x37159c[_0xb155('0x1d')]+_0x37159c[_0xb155('0x1f')];var _0x21776c;if(_0x347002>=_0x3e7aa6){_0x347002=_0x3e7aa6;_0x21776c=0xc8;}else{_0x21776c=0xce;}_0x48b06d['status'](_0x21776c);return _0x48b06d[_0xb155('0x21')](_0xb155('0x22'),_0x3de179+'-'+_0x347002+'/'+_0x3e7aa6)['json'](_0xe119e6);}return null;};}function patchUpdates(_0xacc21b){return function(_0x41bfc8){try{jsonpatch[_0xb155('0x23')](_0x41bfc8,_0xacc21b,!![]);}catch(_0x1884c7){return BPromise['reject'](_0x1884c7);}return _0x41bfc8[_0xb155('0x24')]();};}function saveUpdates(_0x411381,_0x3a6a28){return function(_0x4184a9){if(_0x4184a9){return _0x4184a9[_0xb155('0x25')](_0x411381)[_0xb155('0x26')](function(_0x179813){return _0x179813;});}return null;};}function removeEntity(_0x18d27c,_0x188ef7){return function(_0x5d334c){if(_0x5d334c){return _0x5d334c['destroy']()['then'](function(){_0x18d27c[_0xb155('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7898d8,_0x52609e){return function(_0x41d68c){if(!_0x41d68c){_0x7898d8[_0xb155('0x19')](0x194);}return _0x41d68c;};}function handleError(_0x3b7112,_0x4dfbb2){_0x4dfbb2=_0x4dfbb2||0x1f4;return function(_0x1d9ba0){logger[_0xb155('0x27')](_0x1d9ba0[_0xb155('0x28')]);if(_0x1d9ba0['name']){delete _0x1d9ba0[_0xb155('0x29')];}_0x3b7112[_0xb155('0x1a')](_0x4dfbb2)[_0xb155('0x2a')](_0x1d9ba0);};}exports[_0xb155('0x2b')]=function(_0x5f3ca2,_0x3854a6){var _0x4a85a5={},_0x4c1c76={},_0x57b299={'count':0x0,'rows':[]};var _0x3e84b1=_[_0xb155('0x2c')](db['Attachment'][_0xb155('0x2d')],function(_0xbb61c5){return{'name':_0xbb61c5[_0xb155('0x2e')],'type':_0xbb61c5[_0xb155('0x2f')][_0xb155('0x30')]};});_0x4c1c76[_0xb155('0x31')]=_['map'](_0x3e84b1,'name');_0x4c1c76[_0xb155('0x32')]=_[_0xb155('0x33')](_0x5f3ca2[_0xb155('0x32')]);_0x4c1c76[_0xb155('0x34')]=_[_0xb155('0x35')](_0x4c1c76[_0xb155('0x31')],_0x4c1c76[_0xb155('0x32')]);_0x4a85a5[_0xb155('0x36')]=_[_0xb155('0x35')](_0x4c1c76['model'],qs[_0xb155('0x37')](_0x5f3ca2[_0xb155('0x32')]['fields']));_0x4a85a5[_0xb155('0x36')]=_0x4a85a5[_0xb155('0x36')][_0xb155('0x38')]?_0x4a85a5[_0xb155('0x36')]:_0x4c1c76[_0xb155('0x31')];if(!_0x5f3ca2[_0xb155('0x32')]['hasOwnProperty'](_0xb155('0x39'))){_0x4a85a5[_0xb155('0x1f')]=qs[_0xb155('0x1f')](_0x5f3ca2[_0xb155('0x32')]['limit']);_0x4a85a5['offset']=qs[_0xb155('0x1d')](_0x5f3ca2[_0xb155('0x32')][_0xb155('0x1d')]);}_0x4a85a5['order']=qs[_0xb155('0x3a')](_0x5f3ca2[_0xb155('0x32')][_0xb155('0x3a')]);_0x4a85a5[_0xb155('0x3b')]=qs[_0xb155('0x34')](_['pick'](_0x5f3ca2[_0xb155('0x32')],_0x4c1c76[_0xb155('0x34')]),_0x3e84b1);if(_0x5f3ca2[_0xb155('0x32')][_0xb155('0x3c')]){_0x4a85a5[_0xb155('0x3b')]=_['merge'](_0x4a85a5[_0xb155('0x3b')],{'$or':_['map'](_0x3e84b1,function(_0x1bee29){if(_0x1bee29['type']!=='VIRTUAL'){var _0x4c08a4={};_0x4c08a4[_0x1bee29[_0xb155('0x29')]]={'$like':'%'+_0x5f3ca2[_0xb155('0x32')][_0xb155('0x3c')]+'%'};return _0x4c08a4;}})});}_0x4a85a5=_[_0xb155('0x3d')]({},_0x4a85a5,_0x5f3ca2[_0xb155('0x3e')]);var _0x2f820a={'where':_0x4a85a5['where']};return db[_0xb155('0x3f')][_0xb155('0x20')](_0x2f820a)[_0xb155('0x26')](function(_0x190757){_0x57b299['count']=_0x190757;if(_0x5f3ca2['query'][_0xb155('0x40')]){_0x4a85a5['include']=[{'all':!![]}];}return db[_0xb155('0x3f')]['findAll'](_0x4a85a5);})['then'](function(_0x27b842){_0x57b299[_0xb155('0x41')]=_0x27b842;return _0x57b299;})['then'](respondWithFilteredResult(_0x3854a6,_0x4a85a5))['catch'](handleError(_0x3854a6,null));};exports[_0xb155('0x42')]=function(_0x56e636,_0x347ce7){var _0x363cce={'raw':!![],'where':{'id':_0x56e636[_0xb155('0x43')]['id']}},_0x4562aa={};_0x4562aa[_0xb155('0x31')]=_[_0xb155('0x33')](db['Attachment']['rawAttributes']);_0x4562aa[_0xb155('0x32')]=_['keys'](_0x56e636[_0xb155('0x32')]);_0x4562aa[_0xb155('0x34')]=_[_0xb155('0x35')](_0x4562aa[_0xb155('0x31')],_0x4562aa[_0xb155('0x32')]);_0x363cce[_0xb155('0x36')]=_[_0xb155('0x35')](_0x4562aa[_0xb155('0x31')],qs[_0xb155('0x37')](_0x56e636[_0xb155('0x32')]['fields']));_0x363cce['attributes']=_0x363cce[_0xb155('0x36')]['length']?_0x363cce[_0xb155('0x36')]:_0x4562aa['model'];if(_0x56e636[_0xb155('0x32')][_0xb155('0x40')]){_0x363cce[_0xb155('0x44')]=[{'all':!![]}];}_0x363cce=_['merge']({},_0x363cce,_0x56e636[_0xb155('0x3e')]);return db[_0xb155('0x3f')][_0xb155('0x45')](_0x363cce)[_0xb155('0x26')](handleEntityNotFound(_0x347ce7,null))[_0xb155('0x26')](respondWithResult(_0x347ce7,null))[_0xb155('0x46')](handleError(_0x347ce7,null));};exports['clone']=function(_0x326bad,_0x2cabe4){var _0x28dfaa={'where':{'id':_0x326bad[_0xb155('0x43')]['id']}},_0xf84c88={};_0xf84c88[_0xb155('0x31')]=_[_0xb155('0x33')](db['Attachment']['rawAttributes']);_0x28dfaa[_0xb155('0x36')]=_['intersection'](_0xf84c88[_0xb155('0x31')],qs[_0xb155('0x37')](_0x326bad[_0xb155('0x32')][_0xb155('0x37')]));_0x28dfaa[_0xb155('0x36')]=_0x28dfaa['attributes'][_0xb155('0x38')]?_0x28dfaa[_0xb155('0x36')]:_0xf84c88[_0xb155('0x31')];if(_0x326bad['query'][_0xb155('0x40')]){_0x28dfaa[_0xb155('0x44')]=[{'all':!![]}];}_0x28dfaa=_[_0xb155('0x3d')]({},_0x28dfaa,_0x326bad[_0xb155('0x3e')]);return db[_0xb155('0x3f')][_0xb155('0x45')](_0x28dfaa)[_0xb155('0x26')](handleEntityNotFound(_0x2cabe4,null))['then'](function(_0xf04ab1){if(_0xf04ab1){var _0x45af67=_0xf04ab1[_0xb155('0x47')]({'plain':!![]});_0x45af67=qs[_0xb155('0x48')](_0x45af67,['id',_0xb155('0x49'),_0xb155('0x4a')]);_0x326bad['body']=_['omit'](_0x326bad[_0xb155('0x4b')],['id',_0xb155('0x49'),'updatedAt']);return db[_0xb155('0x3f')][_0xb155('0x4c')](_['merge'](_0x45af67,_0x326bad[_0xb155('0x4b')]),{'include':_0x326bad[_0xb155('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xb155('0x26')](respondWithResult(_0x2cabe4,0xc9))['catch'](handleError(_0x2cabe4,null));};exports['update']=function(_0x3dba6a,_0x3faa2b){if(_0x3dba6a[_0xb155('0x4b')]['id']){delete _0x3dba6a[_0xb155('0x4b')]['id'];}return db[_0xb155('0x3f')]['find']({'where':{'id':_0x3dba6a[_0xb155('0x43')]['id']}})[_0xb155('0x26')](handleEntityNotFound(_0x3faa2b,null))[_0xb155('0x26')](saveUpdates(_0x3dba6a[_0xb155('0x4b')],null))[_0xb155('0x26')](respondWithResult(_0x3faa2b,null))[_0xb155('0x46')](handleError(_0x3faa2b,null));};exports[_0xb155('0x4d')]=function(_0x48a383,_0x4b464f){return db['Attachment'][_0xb155('0x45')]({'where':{'id':_0x48a383['params']['id']}})[_0xb155('0x26')](handleEntityNotFound(_0x4b464f,null))[_0xb155('0x26')](removeEntity(_0x4b464f,null))['catch'](handleError(_0x4b464f,null));};exports[_0xb155('0x4c')]=function(_0x3b6cca,_0x11b487,_0x139385){_0x3b6cca[_0xb155('0x4b')][_0xb155('0x29')]=_0x3b6cca[_0xb155('0x4e')][_0xb155('0x4f')];_0x3b6cca[_0xb155('0x4b')]['basename']=_0x3b6cca['file']['filename'];_0x3b6cca['body'][_0xb155('0x2f')]=_0x3b6cca['file']['mimetype'];return db[_0xb155('0x3f')]['create'](_0x3b6cca[_0xb155('0x4b')])['then'](respondWithResult(_0x11b487,0xc9))[_0xb155('0x46')](handleError(_0x11b487,null));};exports[_0xb155('0x50')]=function(_0x378b55,_0x5cbf16,_0x2ca952){return db[_0xb155('0x3f')][_0xb155('0x51')]({'where':{'id':_0x378b55['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5cbf16,null))[_0xb155('0x26')](function(_0x5d9726){if(_0x5d9726){var _0x4b842d=_0x5d9726[_0xb155('0x52')]!==null;var _0x3a5d1c=path[_0xb155('0x53')](config['root'],_0xb155('0x54'));if(_0x4b842d){_0x3a5d1c=path[_0xb155('0x53')](_0x3a5d1c,_0xb155('0x55'));}var _0x1528f5=path['join'](_0x3a5d1c,_0x5d9726[_0xb155('0x56')]);return _0x5cbf16[_0xb155('0x50')](_0x1528f5);}})['catch'](handleError(_0x5cbf16,null));};
\ No newline at end of file
+var _0x89d8=['pick','filter','merge','type','VIRTUAL','options','Attachment','includeAll','include','findAll','rows','show','params','intersection','find','catch','clone','get','omit','createdAt','updatedAt','body','create','destroy','file','filename','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x98f66f,_0x1e5bf3){var _0xe41ec0=function(_0x190a73){while(--_0x190a73){_0x98f66f['push'](_0x98f66f['shift']());}};_0xe41ec0(++_0x1e5bf3);}(_0x89d8,0x1db));var _0x889d=function(_0x5cb71b,_0x6b7bea){_0x5cb71b=_0x5cb71b-0x0;var _0x1dff48=_0x89d8[_0x5cb71b];return _0x1dff48;};'use strict';var emlformat=require(_0x889d('0x0'));var rimraf=require(_0x889d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x889d('0x2'));var rp=require(_0x889d('0x3'));var moment=require(_0x889d('0x4'));var BPromise=require(_0x889d('0x5'));var Mustache=require(_0x889d('0x6'));var util=require(_0x889d('0x7'));var path=require(_0x889d('0x8'));var sox=require(_0x889d('0x9'));var csv=require('to-csv');var ejs=require(_0x889d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x889d('0xb'));var crypto=require(_0x889d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x889d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x889d('0xe'));var Papa=require(_0x889d('0xf'));var Redis=require(_0x889d('0x10'));var authService=require(_0x889d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x889d('0x12'));var logger=require(_0x889d('0x13'))(_0x889d('0x14'));var utils=require(_0x889d('0x15'));var config=require(_0x889d('0x16'));var licenseUtil=require(_0x889d('0x17'));var db=require(_0x889d('0x18'))['db'];function respondWithStatusCode(_0x4c0c98,_0x208fe4){_0x208fe4=_0x208fe4||0xcc;return function(_0x2a3f34){if(_0x2a3f34){return _0x4c0c98[_0x889d('0x19')](_0x208fe4);}return _0x4c0c98[_0x889d('0x1a')](_0x208fe4)[_0x889d('0x1b')]();};}function respondWithResult(_0x363293,_0x53d3d9){_0x53d3d9=_0x53d3d9||0xc8;return function(_0x2bb01c){if(_0x2bb01c){return _0x363293[_0x889d('0x1a')](_0x53d3d9)[_0x889d('0x1c')](_0x2bb01c);}};}function respondWithFilteredResult(_0x5c3369,_0x6ad2f7){return function(_0x5542c1){if(_0x5542c1){var _0x42eef8=typeof _0x6ad2f7['offset']==='undefined'&&typeof _0x6ad2f7[_0x889d('0x1d')]===_0x889d('0x1e');var _0x3b6638=_0x5542c1[_0x889d('0x1f')];var _0xab7f5f=_0x42eef8?0x0:_0x6ad2f7[_0x889d('0x20')];var _0x51c1b9=_0x42eef8?_0x5542c1[_0x889d('0x1f')]:_0x6ad2f7['offset']+_0x6ad2f7[_0x889d('0x1d')];var _0x345a22;if(_0x51c1b9>=_0x3b6638){_0x51c1b9=_0x3b6638;_0x345a22=0xc8;}else{_0x345a22=0xce;}_0x5c3369['status'](_0x345a22);return _0x5c3369[_0x889d('0x21')](_0x889d('0x22'),_0xab7f5f+'-'+_0x51c1b9+'/'+_0x3b6638)[_0x889d('0x1c')](_0x5542c1);}return null;};}function patchUpdates(_0x587ace){return function(_0x36e265){try{jsonpatch[_0x889d('0x23')](_0x36e265,_0x587ace,!![]);}catch(_0x2a3627){return BPromise[_0x889d('0x24')](_0x2a3627);}return _0x36e265['save']();};}function saveUpdates(_0x291188,_0x72882){return function(_0x145f1a){if(_0x145f1a){return _0x145f1a[_0x889d('0x25')](_0x291188)['then'](function(_0x13a775){return _0x13a775;});}return null;};}function removeEntity(_0x247a1f,_0x3fc72d){return function(_0x3c55e9){if(_0x3c55e9){return _0x3c55e9['destroy']()[_0x889d('0x26')](function(){_0x247a1f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43e1d2,_0x3b870b){return function(_0x24cc83){if(!_0x24cc83){_0x43e1d2[_0x889d('0x19')](0x194);}return _0x24cc83;};}function handleError(_0x1c4919,_0x4cca44){_0x4cca44=_0x4cca44||0x1f4;return function(_0x106af5){logger[_0x889d('0x27')](_0x106af5[_0x889d('0x28')]);if(_0x106af5['name']){delete _0x106af5[_0x889d('0x29')];}_0x1c4919[_0x889d('0x1a')](_0x4cca44)['send'](_0x106af5);};}exports[_0x889d('0x2a')]=function(_0x55eba2,_0x26756e){var _0x11499b={},_0x1ac70b={},_0x39deae={'count':0x0,'rows':[]};var _0x519931=_[_0x889d('0x2b')](db['Attachment'][_0x889d('0x2c')],function(_0x112a2f){return{'name':_0x112a2f[_0x889d('0x2d')],'type':_0x112a2f['type'][_0x889d('0x2e')]};});_0x1ac70b[_0x889d('0x2f')]=_[_0x889d('0x2b')](_0x519931,_0x889d('0x29'));_0x1ac70b[_0x889d('0x30')]=_[_0x889d('0x31')](_0x55eba2[_0x889d('0x30')]);_0x1ac70b[_0x889d('0x32')]=_['intersection'](_0x1ac70b[_0x889d('0x2f')],_0x1ac70b['query']);_0x11499b[_0x889d('0x33')]=_['intersection'](_0x1ac70b[_0x889d('0x2f')],qs[_0x889d('0x34')](_0x55eba2[_0x889d('0x30')][_0x889d('0x34')]));_0x11499b[_0x889d('0x33')]=_0x11499b[_0x889d('0x33')][_0x889d('0x35')]?_0x11499b[_0x889d('0x33')]:_0x1ac70b[_0x889d('0x2f')];if(!_0x55eba2[_0x889d('0x30')][_0x889d('0x36')](_0x889d('0x37'))){_0x11499b[_0x889d('0x1d')]=qs[_0x889d('0x1d')](_0x55eba2[_0x889d('0x30')][_0x889d('0x1d')]);_0x11499b[_0x889d('0x20')]=qs[_0x889d('0x20')](_0x55eba2['query']['offset']);}_0x11499b[_0x889d('0x38')]=qs[_0x889d('0x39')](_0x55eba2[_0x889d('0x30')]['sort']);_0x11499b[_0x889d('0x3a')]=qs['filters'](_[_0x889d('0x3b')](_0x55eba2[_0x889d('0x30')],_0x1ac70b[_0x889d('0x32')]),_0x519931);if(_0x55eba2[_0x889d('0x30')][_0x889d('0x3c')]){_0x11499b[_0x889d('0x3a')]=_[_0x889d('0x3d')](_0x11499b['where'],{'$or':_['map'](_0x519931,function(_0x4161f8){if(_0x4161f8[_0x889d('0x3e')]!==_0x889d('0x3f')){var _0x2e56c5={};_0x2e56c5[_0x4161f8[_0x889d('0x29')]]={'$like':'%'+_0x55eba2[_0x889d('0x30')]['filter']+'%'};return _0x2e56c5;}})});}_0x11499b=_[_0x889d('0x3d')]({},_0x11499b,_0x55eba2[_0x889d('0x40')]);var _0x5e1656={'where':_0x11499b[_0x889d('0x3a')]};return db[_0x889d('0x41')][_0x889d('0x1f')](_0x5e1656)[_0x889d('0x26')](function(_0x132611){_0x39deae[_0x889d('0x1f')]=_0x132611;if(_0x55eba2[_0x889d('0x30')][_0x889d('0x42')]){_0x11499b[_0x889d('0x43')]=[{'all':!![]}];}return db[_0x889d('0x41')][_0x889d('0x44')](_0x11499b);})['then'](function(_0x3ac214){_0x39deae[_0x889d('0x45')]=_0x3ac214;return _0x39deae;})['then'](respondWithFilteredResult(_0x26756e,_0x11499b))['catch'](handleError(_0x26756e,null));};exports[_0x889d('0x46')]=function(_0x127af3,_0x2437a8){var _0x2d29ec={'raw':!![],'where':{'id':_0x127af3[_0x889d('0x47')]['id']}},_0x3ee98f={};_0x3ee98f['model']=_[_0x889d('0x31')](db['Attachment']['rawAttributes']);_0x3ee98f[_0x889d('0x30')]=_[_0x889d('0x31')](_0x127af3[_0x889d('0x30')]);_0x3ee98f[_0x889d('0x32')]=_[_0x889d('0x48')](_0x3ee98f['model'],_0x3ee98f[_0x889d('0x30')]);_0x2d29ec[_0x889d('0x33')]=_[_0x889d('0x48')](_0x3ee98f[_0x889d('0x2f')],qs[_0x889d('0x34')](_0x127af3['query'][_0x889d('0x34')]));_0x2d29ec['attributes']=_0x2d29ec[_0x889d('0x33')][_0x889d('0x35')]?_0x2d29ec[_0x889d('0x33')]:_0x3ee98f[_0x889d('0x2f')];if(_0x127af3[_0x889d('0x30')][_0x889d('0x42')]){_0x2d29ec[_0x889d('0x43')]=[{'all':!![]}];}_0x2d29ec=_[_0x889d('0x3d')]({},_0x2d29ec,_0x127af3[_0x889d('0x40')]);return db[_0x889d('0x41')][_0x889d('0x49')](_0x2d29ec)['then'](handleEntityNotFound(_0x2437a8,null))[_0x889d('0x26')](respondWithResult(_0x2437a8,null))[_0x889d('0x4a')](handleError(_0x2437a8,null));};exports[_0x889d('0x4b')]=function(_0xe0b4f3,_0x4f0613){var _0x32443d={'where':{'id':_0xe0b4f3[_0x889d('0x47')]['id']}},_0x2b2292={};_0x2b2292[_0x889d('0x2f')]=_['keys'](db[_0x889d('0x41')][_0x889d('0x2c')]);_0x32443d[_0x889d('0x33')]=_[_0x889d('0x48')](_0x2b2292[_0x889d('0x2f')],qs['fields'](_0xe0b4f3[_0x889d('0x30')]['fields']));_0x32443d['attributes']=_0x32443d[_0x889d('0x33')][_0x889d('0x35')]?_0x32443d[_0x889d('0x33')]:_0x2b2292[_0x889d('0x2f')];if(_0xe0b4f3[_0x889d('0x30')][_0x889d('0x42')]){_0x32443d[_0x889d('0x43')]=[{'all':!![]}];}_0x32443d=_[_0x889d('0x3d')]({},_0x32443d,_0xe0b4f3[_0x889d('0x40')]);return db[_0x889d('0x41')]['find'](_0x32443d)[_0x889d('0x26')](handleEntityNotFound(_0x4f0613,null))[_0x889d('0x26')](function(_0x48a0a6){if(_0x48a0a6){var _0x2001ad=_0x48a0a6[_0x889d('0x4c')]({'plain':!![]});_0x2001ad=qs[_0x889d('0x4d')](_0x2001ad,['id',_0x889d('0x4e'),_0x889d('0x4f')]);_0xe0b4f3[_0x889d('0x50')]=_[_0x889d('0x4d')](_0xe0b4f3['body'],['id',_0x889d('0x4e'),_0x889d('0x4f')]);return db['Attachment'][_0x889d('0x51')](_[_0x889d('0x3d')](_0x2001ad,_0xe0b4f3['body']),{'include':_0xe0b4f3[_0x889d('0x30')][_0x889d('0x42')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4f0613,0xc9))[_0x889d('0x4a')](handleError(_0x4f0613,null));};exports[_0x889d('0x25')]=function(_0x31fcbc,_0x3040cb){if(_0x31fcbc['body']['id']){delete _0x31fcbc[_0x889d('0x50')]['id'];}return db[_0x889d('0x41')][_0x889d('0x49')]({'where':{'id':_0x31fcbc[_0x889d('0x47')]['id']}})[_0x889d('0x26')](handleEntityNotFound(_0x3040cb,null))[_0x889d('0x26')](saveUpdates(_0x31fcbc[_0x889d('0x50')],null))[_0x889d('0x26')](respondWithResult(_0x3040cb,null))[_0x889d('0x4a')](handleError(_0x3040cb,null));};exports[_0x889d('0x52')]=function(_0x19ce61,_0x375728){return db[_0x889d('0x41')][_0x889d('0x49')]({'where':{'id':_0x19ce61['params']['id']}})['then'](handleEntityNotFound(_0x375728,null))['then'](removeEntity(_0x375728,null))[_0x889d('0x4a')](handleError(_0x375728,null));};exports[_0x889d('0x51')]=function(_0x51df7e,_0x4db688,_0x3a5dc4){_0x51df7e[_0x889d('0x50')][_0x889d('0x29')]=_0x51df7e[_0x889d('0x53')]['originalname'];_0x51df7e[_0x889d('0x50')]['basename']=_0x51df7e['file'][_0x889d('0x54')];_0x51df7e[_0x889d('0x50')][_0x889d('0x3e')]=_0x51df7e[_0x889d('0x53')]['mimetype'];return db[_0x889d('0x41')][_0x889d('0x51')](_0x51df7e[_0x889d('0x50')])[_0x889d('0x26')](respondWithResult(_0x4db688,0xc9))[_0x889d('0x4a')](handleError(_0x4db688,null));};exports['download']=function(_0x4db3f3,_0x2df29e,_0x551290){return db[_0x889d('0x41')]['findOne']({'where':{'id':_0x4db3f3[_0x889d('0x47')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2df29e,null))[_0x889d('0x26')](function(_0x1a7bdf){if(_0x1a7bdf){var _0x24041d=_0x1a7bdf[_0x889d('0x55')]!==null;var _0x3bf433=path[_0x889d('0x56')](config[_0x889d('0x57')],'server/files/attachments/');if(_0x24041d){_0x3bf433=path['join'](_0x3bf433,_0x889d('0x58'));}var _0x1218ee=path[_0x889d('0x56')](_0x3bf433,_0x1a7bdf['basename']);return _0x2df29e['download'](_0x1218ee);}})[_0x889d('0x4a')](handleError(_0x2df29e,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 5c750e0..b2e8e5b 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 _0x0095=['./attachment.attributes','define','attachments','lodash','util','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0xe1a01b,_0x2657f7){var _0x2559b1=function(_0x304d72){while(--_0x304d72){_0xe1a01b['push'](_0xe1a01b['shift']());}};_0x2559b1(++_0x2657f7);}(_0x0095,0xf3));var _0x5009=function(_0x1f46c0,_0x1148b0){_0x1f46c0=_0x1f46c0-0x0;var _0x34d79d=_0x0095[_0x1f46c0];return _0x34d79d;};'use strict';var _=require(_0x5009('0x0'));var util=require(_0x5009('0x1'));var logger=require(_0x5009('0x2'))(_0x5009('0x3'));var moment=require('moment');var BPromise=require(_0x5009('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5009('0x5'));var rimraf=require('rimraf');var config=require(_0x5009('0x6'));var attributes=require(_0x5009('0x7'));module['exports']=function(_0x435cef,_0xd44a7a){return _0x435cef[_0x5009('0x8')]('Attachment',attributes,{'tableName':_0x5009('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e46=['define','Attachment','attachments','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x23d12f,_0x877e63){var _0x321ec0=function(_0x5c36ff){while(--_0x5c36ff){_0x23d12f['push'](_0x23d12f['shift']());}};_0x321ec0(++_0x877e63);}(_0x0e46,0x17c));var _0x60e4=function(_0x235563,_0x260ece){_0x235563=_0x235563-0x0;var _0x219be0=_0x0e46[_0x235563];return _0x219be0;};'use strict';var _=require(_0x60e4('0x0'));var util=require(_0x60e4('0x1'));var logger=require(_0x60e4('0x2'))(_0x60e4('0x3'));var moment=require('moment');var BPromise=require(_0x60e4('0x4'));var rp=require(_0x60e4('0x5'));var fs=require('fs');var path=require(_0x60e4('0x6'));var rimraf=require(_0x60e4('0x7'));var config=require(_0x60e4('0x8'));var attributes=require('./attachment.attributes');module[_0x60e4('0x9')]=function(_0x578d76,_0x5d6552){return _0x578d76[_0x60e4('0xa')](_0x60e4('0xb'),attributes,{'tableName':_0x60e4('0xc'),'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 3e47a2d..4245d85 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 _0x131e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','Attachment,\x20%s,\x20%s','catch','Attachment','create','options','raw','CreateAttachment','bluebird','randomstring'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x131e,0x1ec));var _0xe131=function(_0x3da04d,_0x1594e0){_0x3da04d=_0x3da04d-0x0;var _0x1f062c=_0x131e[_0x3da04d];return _0x1f062c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe131('0x0'));var rs=require(_0xe131('0x1'));var fs=require('fs');var Redis=require(_0xe131('0x2'));var db=require(_0xe131('0x3'))['db'];var utils=require(_0xe131('0x4'));var logger=require(_0xe131('0x5'))('rpc');var config=require(_0xe131('0x6'));var jayson=require(_0xe131('0x7'));var client=jayson[_0xe131('0x8')][_0xe131('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1002a6,_0x48a90e,_0x5c4eb5){return new BPromise(function(_0x562617,_0x4bf386){return client[_0xe131('0xa')](_0x1002a6,_0x5c4eb5)[_0xe131('0xb')](function(_0x530ecb){logger[_0xe131('0xc')]('Attachment,\x20%s,\x20%s',_0x48a90e,_0xe131('0xd'));logger[_0xe131('0xe')](_0xe131('0xf'),_0x48a90e,_0xe131('0xd'),JSON[_0xe131('0x10')](_0x530ecb));if(_0x530ecb[_0xe131('0x11')]){if(_0x530ecb[_0xe131('0x11')]['code']===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x48a90e,_0x530ecb['error'][_0xe131('0x12')]);return _0x4bf386(_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);}logger[_0xe131('0x11')](_0xe131('0x13'),_0x48a90e,_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);return _0x562617(_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x48a90e,'request\x20sent');_0x562617(_0x530ecb['result']['message']);}})[_0xe131('0x14')](function(_0x32091b){logger[_0xe131('0x11')]('Attachment,\x20%s,\x20%s',_0x48a90e,_0x32091b);_0x4bf386(_0x32091b);});});}exports['CreateAttachment']=function(_0x400f6b){var _0x2e2bf8=this;return new Promise(function(_0x3bbca8,_0x1a1e03){return db[_0xe131('0x15')][_0xe131('0x16')](_0x400f6b['body'],{'raw':_0x400f6b[_0xe131('0x17')]?_0x400f6b[_0xe131('0x17')][_0xe131('0x18')]===undefined?!![]:![]:!![]})[_0xe131('0xb')](function(_0x2d6c6b){logger['info']('CreateAttachment',_0x400f6b);logger[_0xe131('0xe')](_0xe131('0x19'),_0x400f6b,JSON['stringify'](_0x2d6c6b));_0x3bbca8(_0x2d6c6b);})[_0xe131('0x14')](function(_0x55b0c5){logger['error'](_0xe131('0x19'),_0x55b0c5[_0xe131('0x12')],_0x400f6b);_0x1a1e03(_0x2e2bf8[_0xe131('0x11')](0x1f4,_0x55b0c5[_0xe131('0x12')]));});});};
\ No newline at end of file
+var _0xedd9=['error','code','Attachment,\x20%s,\x20%s','message','catch','CreateAttachment','Attachment','create','options','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x56691a,_0x4e67c1){var _0x112a6d=function(_0x35ea94){while(--_0x35ea94){_0x56691a['push'](_0x56691a['shift']());}};_0x112a6d(++_0x4e67c1);}(_0xedd9,0xfc));var _0x9edd=function(_0x37c56c,_0x4d67fa){_0x37c56c=_0x37c56c-0x0;var _0x4bd3db=_0xedd9[_0x37c56c];return _0x4bd3db;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('Attachment,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('Attachment,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});}exports[_0x9edd('0x17')]=function(_0x40ba32){var _0x4d8f33=this;return new Promise(function(_0x43dc70,_0x5d879c){return db[_0x9edd('0x18')][_0x9edd('0x19')](_0x40ba32['body'],{'raw':_0x40ba32['options']?_0x40ba32[_0x9edd('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x9edd('0xd')](function(_0x54a03f){logger['info'](_0x9edd('0x17'),_0x40ba32);logger[_0x9edd('0x10')]('CreateAttachment',_0x40ba32,JSON['stringify'](_0x54a03f));_0x43dc70(_0x54a03f);})[_0x9edd('0x16')](function(_0x186186){logger[_0x9edd('0x12')]('CreateAttachment',_0x186186[_0x9edd('0x15')],_0x40ba32);_0x5d879c(_0x4d8f33[_0x9edd('0x12')](0x1f4,_0x186186[_0x9edd('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 24aae88..bcead27 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x3e1e5f,_0x3bd21b){var _0x5cddc3=function(_0x311318){while(--_0x311318){_0x3e1e5f['push'](_0x3e1e5f['shift']());}};_0x5cddc3(++_0x3bd21b);}(_0xb10b,0x12a));var _0xbb10=function(_0x1026d2,_0x42fe66){_0x1026d2=_0x1026d2-0x0;var _0x4a6773=_0xb10b[_0x1026d2];return _0x4a6773;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
+var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x0b0e,0x187));var _0xe0b0=function(_0xafdec6,_0x3d94df){_0xafdec6=_0xafdec6-0x0;var _0x372bdb=_0x0b0e[_0xafdec6];return _0x372bdb;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index bc8f75e..e42bec6 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 _0x85a7=['domain','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt','online','admin','disabled','add','clearBlockUser','getLicense','catch','status','send','message','ad-login','signToken','json','use','passport','passport-local','Strategy','moment','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','baseDN','url'];(function(_0x13d580,_0x53a187){var _0x5e124b=function(_0x5abc88){while(--_0x5abc88){_0x13d580['push'](_0x13d580['shift']());}};_0x5e124b(++_0x53a187);}(_0x85a7,0xa7));var _0x785a=function(_0x1040d1,_0x432965){_0x1040d1=_0x1040d1-0x0;var _0x25607d=_0x85a7[_0x1040d1];return _0x25607d;};'use strict';var passport=require(_0x785a('0x0'));var LocalStrategy=require(_0x785a('0x1'))[_0x785a('0x2')];var moment=require(_0x785a('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x785a('0x4'));var util=require(_0x785a('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x785a('0x6'));var utils=require(_0x785a('0x7'));var config=require(_0x785a('0x8'));var logger=require('../../config/logger')(_0x785a('0x9'));function isActiveDirectoryConfigured(_0x2547d1){var _0xcf33a6=![];if(typeof _0x2547d1[_0x785a('0xa')]!=='undefined'){_0xcf33a6=_0x2547d1[_0x785a('0xa')][_0x785a('0xb')]&&_0x2547d1['activedirectory'][_0x785a('0xc')]&&_0x2547d1[_0x785a('0xa')][_0x785a('0xd')];}return _0xcf33a6;}function adAuthenticate(_0x5af56b,_0x3c6111,_0x1d9350){return new BPromise(function(_0x143a0e,_0x3cf9da){try{var _0x5a0a6f=new ActiveDirectory(_0x5af56b);_0x5a0a6f[_0x785a('0xe')](_0x3c6111,_0x1d9350,function(_0x5016ac,_0x42356e){if(_0x5016ac){logger[_0x785a('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x3c6111,util[_0x785a('0x10')](_0x5016ac,{'showHidden':![],'depth':null}));_0x3cf9da(_0x785a('0x11'));}else if(!_0x42356e){logger[_0x785a('0xf')](_0x785a('0x12'),_0x3c6111);_0x3cf9da(_0x785a('0x11'));}else{_0x143a0e(_0x42356e);}});}catch(_0x88751f){_0x3cf9da(_0x88751f);}});}function ActiveDirectoryAuthenticate(_0x36dfc3,_0x39032c,_0x429d4b,_0xaab5b3){var _0x3fdf8f,_0x7c298c;if(!isActiveDirectoryConfigured(config)){logger[_0x785a('0xf')](_0x785a('0x13'),_0x39032c);return _0xaab5b3(null,![],{'message':_0x785a('0x11')});}return db['Setting'][_0x785a('0x14')]({'where':{'id':0x1},'attributes':[_0x785a('0x15'),_0x785a('0x16')],'raw':!![]})[_0x785a('0x17')](function(_0x1ac834){_0x3fdf8f=_0x1ac834;if(!_0x3fdf8f[_0x785a('0x15')]){logger[_0x785a('0xf')](_0x785a('0x18'),_0x39032c);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x36dfc3[_0x785a('0x14')]({'attributes':['id',_0x785a('0x19'),_0x785a('0x1a'),_0x785a('0x1b'),_0x785a('0x1c'),'disabled',_0x785a('0x1d'),_0x785a('0x1e'),_0x785a('0x1f')],'where':{'name':_0x39032c,'role':{'$or':[_0x785a('0x20'),'user','agent']},'adSsoEnabled':!![]}});})[_0x785a('0x17')](function(_0x3161f7){if(!_0x3161f7||_0x3161f7&&_0x3161f7[_0x785a('0x19')]!==_0x39032c){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x7c298c=_0x3161f7;var _0x4aa5bb=_0x7c298c[_0x785a('0x19')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0x785a('0xa')],_0x4aa5bb,_0x429d4b);})[_0x785a('0x17')](function(_0x5c6005){if(_0x7c298c[_0x785a('0x21')]){throw new Error(_0x785a('0x11'));}if(_0x3fdf8f[_0x785a('0x16')]>0x0){if(_0x7c298c[_0x785a('0x1d')]){if(moment(_0x7c298c[_0x785a('0x1e')])[_0x785a('0x22')](_0x3fdf8f[_0x785a('0x16')],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x785a('0x23')](_0x7c298c,0x0,![],null)[_0x785a('0x17')](function(){return utils[_0x785a('0x24')](_0x7c298c);})[_0x785a('0x17')](function(){return _0xaab5b3(null,_0x7c298c);});}else{return utils['getLicense'](_0x7c298c)[_0x785a('0x17')](function(){return _0xaab5b3(null,_0x7c298c);});}}else{return utils['getLicense'](_0x7c298c)[_0x785a('0x17')](function(){return _0xaab5b3(null,_0x7c298c);});}})[_0x785a('0x25')](function(_0x29284c){return _0xaab5b3(null,![],_0x29284c);});}function handleError(_0x574238,_0x31f74b,_0x51c36d){return _0x574238[_0x785a('0x26')](_0x31f74b||0x1f4)[_0x785a('0x27')]({'message':_0x51c36d?_0x51c36d[_0x785a('0x28')]||_0x51c36d:''});}exports['login']=function(_0x333df1,_0x2c6b14,_0xee3958){passport[_0x785a('0xe')](_0x785a('0x29'),function(_0x2e9e51,_0x9cf079,_0x14ce32){var _0x334a40=_0x2e9e51||_0x14ce32;if(_0x334a40){return handleError(_0x2c6b14,0x191,_0x334a40);}if(!_0x9cf079){return handleError(_0x2c6b14,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4f9666={'payload':{'id':_0x9cf079['id'],'role':_0x9cf079[_0x785a('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0x785a('0x2a')](_0x4f9666)['then'](function(_0x18cdb1){_0x2c6b14[_0x785a('0x2b')]({'id':_0x9cf079['id'],'token':_0x18cdb1,'statusCall':'','isAlreadyLogged':_0x9cf079[_0x785a('0x1f')]});});}})(_0x333df1,_0x2c6b14,_0xee3958);};passport[_0x785a('0x2c')](_0x785a('0x29'),new LocalStrategy({'usernameField':_0x785a('0x19'),'passwordField':_0x785a('0x1a')},function(_0xfbe339,_0x2cdecb,_0x503a6c){return ActiveDirectoryAuthenticate(db['User'],_0xfbe339,_0x2cdecb,_0x503a6c);}));
\ No newline at end of file
+var _0x9e91=['adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','role','disabled','blocked','online','user','agent','blockDuration','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','name','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne'];(function(_0x1d1a62,_0x580c68){var _0x7fdaaa=function(_0x11bfab){while(--_0x11bfab){_0x1d1a62['push'](_0x1d1a62['shift']());}};_0x7fdaaa(++_0x580c68);}(_0x9e91,0x1ca));var _0x19e9=function(_0xe8854b,_0x344e3b){_0xe8854b=_0xe8854b-0x0;var _0x35e804=_0x9e91[_0xe8854b];return _0x35e804;};'use strict';var passport=require(_0x19e9('0x0'));var LocalStrategy=require(_0x19e9('0x1'))[_0x19e9('0x2')];var moment=require(_0x19e9('0x3'));var ActiveDirectory=require(_0x19e9('0x4'));var BPromise=require(_0x19e9('0x5'));var util=require(_0x19e9('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x19e9('0x7'));var utils=require(_0x19e9('0x8'));var config=require(_0x19e9('0x9'));var logger=require('../../config/logger')(_0x19e9('0xa'));function isActiveDirectoryConfigured(_0x5557d4){var _0x5ba5f2=![];if(typeof _0x5557d4[_0x19e9('0xb')]!==_0x19e9('0xc')){_0x5ba5f2=_0x5557d4[_0x19e9('0xb')]['baseDN']&&_0x5557d4['activedirectory'][_0x19e9('0xd')]&&_0x5557d4[_0x19e9('0xb')][_0x19e9('0xe')];}return _0x5ba5f2;}function adAuthenticate(_0x34708a,_0xdd0fd6,_0x5dfd4f){return new BPromise(function(_0x227715,_0x141c73){try{var _0x2883fb=new ActiveDirectory(_0x34708a);_0x2883fb[_0x19e9('0xf')](_0xdd0fd6,_0x5dfd4f,function(_0x41e11c,_0x479155){if(_0x41e11c){logger['error'](_0x19e9('0x10'),_0xdd0fd6,util['inspect'](_0x41e11c,{'showHidden':![],'depth':null}));_0x141c73(_0x19e9('0x11'));}else if(!_0x479155){logger[_0x19e9('0x12')](_0x19e9('0x13'),_0xdd0fd6);_0x141c73(_0x19e9('0x11'));}else{_0x227715(_0x479155);}});}catch(_0x327fee){_0x141c73(_0x327fee);}});}function ActiveDirectoryAuthenticate(_0x1a2ed4,_0x6fd4b6,_0x42ba5e,_0x3ec1a8){var _0x21bb15,_0x1930be;if(!isActiveDirectoryConfigured(config)){logger[_0x19e9('0x12')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x6fd4b6);return _0x3ec1a8(null,![],{'message':_0x19e9('0x11')});}return db[_0x19e9('0x14')][_0x19e9('0x15')]({'where':{'id':0x1},'attributes':[_0x19e9('0x16'),'blockDuration'],'raw':!![]})[_0x19e9('0x17')](function(_0x2c241f){_0x21bb15=_0x2c241f;if(!_0x21bb15[_0x19e9('0x16')]){logger['error'](_0x19e9('0x18'),_0x6fd4b6);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x1a2ed4['findOne']({'attributes':['id','name',_0x19e9('0x19'),'salt',_0x19e9('0x1a'),_0x19e9('0x1b'),_0x19e9('0x1c'),'blockedAt',_0x19e9('0x1d')],'where':{'name':_0x6fd4b6,'role':{'$or':['admin',_0x19e9('0x1e'),_0x19e9('0x1f')]},'adSsoEnabled':!![]}});})[_0x19e9('0x17')](function(_0x1918e5){if(!_0x1918e5||_0x1918e5&&_0x1918e5['name']!==_0x6fd4b6){throw new Error(_0x19e9('0x11'));}_0x1930be=_0x1918e5;var _0x518128=_0x1930be['name']+'@'+config[_0x19e9('0xb')][_0x19e9('0xe')];return adAuthenticate(config[_0x19e9('0xb')],_0x518128,_0x42ba5e);})['then'](function(_0x20205c){if(_0x1930be[_0x19e9('0x1b')]){throw new Error(_0x19e9('0x11'));}if(_0x21bb15[_0x19e9('0x20')]>0x0){if(_0x1930be['blocked']){if(moment(_0x1930be[_0x19e9('0x21')])[_0x19e9('0x22')](_0x21bb15[_0x19e9('0x20')],_0x19e9('0x23'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x19e9('0x24')](_0x1930be,0x0,![],null)['then'](function(){return utils['getLicense'](_0x1930be);})[_0x19e9('0x17')](function(){return _0x3ec1a8(null,_0x1930be);});}else{return utils['getLicense'](_0x1930be)['then'](function(){return _0x3ec1a8(null,_0x1930be);});}}else{return utils[_0x19e9('0x25')](_0x1930be)['then'](function(){return _0x3ec1a8(null,_0x1930be);});}})[_0x19e9('0x26')](function(_0x5a60d8){return _0x3ec1a8(null,![],_0x5a60d8);});}function handleError(_0x258132,_0x29b72e,_0x3c9e97){return _0x258132[_0x19e9('0x27')](_0x29b72e||0x1f4)['send']({'message':_0x3c9e97?_0x3c9e97[_0x19e9('0x28')]||_0x3c9e97:''});}exports[_0x19e9('0x29')]=function(_0x42587e,_0x12b283,_0x55f0fb){passport[_0x19e9('0xf')](_0x19e9('0x2a'),function(_0x4a2d0e,_0x11bb5d,_0x3184c2){var _0x71268b=_0x4a2d0e||_0x3184c2;if(_0x71268b){return handleError(_0x12b283,0x191,_0x71268b);}if(!_0x11bb5d){return handleError(_0x12b283,0x194,{'message':_0x19e9('0x2b')});}else{var _0x31fdb9={'payload':{'id':_0x11bb5d['id'],'role':_0x11bb5d[_0x19e9('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x19e9('0x2c')](_0x31fdb9)['then'](function(_0x119816){_0x12b283['json']({'id':_0x11bb5d['id'],'token':_0x119816,'statusCall':'','isAlreadyLogged':_0x11bb5d[_0x19e9('0x1d')]});});}})(_0x42587e,_0x12b283,_0x55f0fb);};passport[_0x19e9('0x2d')]('ad-login',new LocalStrategy({'usernameField':_0x19e9('0x2e'),'passwordField':_0x19e9('0x19')},function(_0x5172cc,_0x43ea46,_0x14d03a){return ActiveDirectoryAuthenticate(db[_0x19e9('0x2f')],_0x5172cc,_0x43ea46,_0x14d03a);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 2583bad..136ced9 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 _0xd5ad=['exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x28f0cf,_0x460cda){var _0x5bac1f=function(_0x70e0b8){while(--_0x70e0b8){_0x28f0cf['push'](_0x28f0cf['shift']());}};_0x5bac1f(++_0x460cda);}(_0xd5ad,0x18c));var _0xdd5a=function(_0x1ce859,_0x2ae1f1){_0x1ce859=_0x1ce859-0x0;var _0x5b2df0=_0xd5ad[_0x1ce859];return _0x5b2df0;};'use strict';var express=require(_0xdd5a('0x0'));var router=express[_0xdd5a('0x1')]();var controller=require(_0xdd5a('0x2'));router[_0xdd5a('0x3')]('/',controller['login']);module[_0xdd5a('0x4')]=router;
\ No newline at end of file
+var _0x28ac=['Router','post','login','exports','express'];(function(_0x4bca0f,_0x38894c){var _0x5d62e4=function(_0x59daaf){while(--_0x59daaf){_0x4bca0f['push'](_0x4bca0f['shift']());}};_0x5d62e4(++_0x38894c);}(_0x28ac,0x10d));var _0xc28a=function(_0x4cfb59,_0x5befdc){_0x4cfb59=_0x4cfb59-0x0;var _0x31a61c=_0x28ac[_0x4cfb59];return _0x31a61c;};'use strict';var express=require(_0xc28a('0x0'));var router=express[_0xc28a('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0xc28a('0x2')]('/',controller[_0xc28a('0x3')]);module[_0xc28a('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 6050f1b..ac8cb16 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(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x7a54,0x106));var _0x47a5=function(_0xce52a9,_0x41cedd){_0xce52a9=_0xce52a9-0x0;var _0x32bd2b=_0x7a54[_0xce52a9];return _0x32bd2b;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x7a54,0x106));var _0x47a5=function(_0x2743ca,_0x3d191c){_0x2743ca=_0x2743ca-0x0;var _0x3f094d=_0x7a54[_0x2743ca];return _0x3f094d;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 55bc81e..8a2a1ed 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 _0xa220=['./authGoogle.controller','../../components/auth/service','get','login','/callback','callback','exports','passport'];(function(_0x5036fe,_0x188b6f){var _0x5a76d9=function(_0x3fdd77){while(--_0x3fdd77){_0x5036fe['push'](_0x5036fe['shift']());}};_0x5a76d9(++_0x188b6f);}(_0xa220,0x167));var _0x0a22=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa220[_0x42cae2];return _0x5f256f;};'use strict';var express=require('express');var passport=require(_0x0a22('0x0'));var router=express['Router']();var controller=require(_0x0a22('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0x0a22('0x2'));router[_0x0a22('0x3')]('/',controller[_0x0a22('0x4')]);router[_0x0a22('0x3')](_0x0a22('0x5'),controller[_0x0a22('0x6')],authService['isMiddleware'],userController['login'],authService['setTokenCookie']);module[_0x0a22('0x7')]=router;
\ No newline at end of file
+var _0x75d4=['../user/user.controller.js','../../components/auth/service','get','login','isMiddleware','setTokenCookie','exports','express','Router','./authGoogle.controller'];(function(_0x2298f0,_0x3bbf4f){var _0x39b136=function(_0xc2cd6e){while(--_0xc2cd6e){_0x2298f0['push'](_0x2298f0['shift']());}};_0x39b136(++_0x3bbf4f);}(_0x75d4,0x93));var _0x475d=function(_0x746e8d,_0x431fd9){_0x746e8d=_0x746e8d-0x0;var _0x5018f4=_0x75d4[_0x746e8d];return _0x5018f4;};'use strict';var express=require(_0x475d('0x0'));var passport=require('passport');var router=express[_0x475d('0x1')]();var controller=require(_0x475d('0x2'));var userController=require(_0x475d('0x3'));var authService=require(_0x475d('0x4'));router[_0x475d('0x5')]('/',controller[_0x475d('0x6')]);router['get']('/callback',controller['callback'],authService[_0x475d('0x7')],userController[_0x475d('0x6')],authService[_0x475d('0x8')]);module[_0x475d('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 2da515b..33d3684 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 _0x7a6b=['Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','findOne','allowedLoginAttempts','blockDuration','password','role','disabled','blocked','blockedAt','loginAttempts','user','agent','authenticate','add','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','then','getLicense','catch','MailAccount','name','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','stringify','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','Setting','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','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','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util'];(function(_0x2c658a,_0x18d39e){var _0x26806e=function(_0x1943f7){while(--_0x1943f7){_0x2c658a['push'](_0x2c658a['shift']());}};_0x26806e(++_0x18d39e);}(_0x7a6b,0xf5));var _0xb7a6=function(_0x13a45f,_0x533e58){_0x13a45f=_0x13a45f-0x0;var _0x145ef3=_0x7a6b[_0x13a45f];return _0x145ef3;};'use strict';var util=require(_0xb7a6('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xb7a6('0x1')];var jayson=require('jayson/promise');var _=require(_0xb7a6('0x2'));var rs=require(_0xb7a6('0x3'));var moment=require(_0xb7a6('0x4'));var db=require(_0xb7a6('0x5'))['db'];var authService=require(_0xb7a6('0x6'));var utils=require(_0xb7a6('0x7'));var client=jayson['client'][_0xb7a6('0x8')]({'port':0x232b});function localAuthenticate(_0xe364a1,_0x2cf874,_0x31cfe2,_0x4d6916){var _0x3b988d,_0x590516;return db['Setting'][_0xb7a6('0x9')]({'where':{'id':0x1},'attributes':[_0xb7a6('0xa'),_0xb7a6('0xb')],'raw':!![]})['then'](function(_0x28b293){_0x3b988d=_0x28b293;return _0xe364a1[_0xb7a6('0x9')]({'attributes':['id','name',_0xb7a6('0xc'),'salt',_0xb7a6('0xd'),_0xb7a6('0xe'),_0xb7a6('0xf'),_0xb7a6('0x10'),_0xb7a6('0x11')],'where':{'name':_0x2cf874,'role':{'$or':['admin',_0xb7a6('0x12'),_0xb7a6('0x13')]}}});})['then'](function(_0x1930b3){if(!_0x1930b3||_0x1930b3&&_0x1930b3['name']!==_0x2cf874){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x590516=_0x1930b3;return _0x590516;}})['then'](function(){_0x590516[_0xb7a6('0x14')](_0x31cfe2,function(_0x389adc,_0x4a5e42){var _0x3959b5=_0x590516[_0xb7a6('0x11')]+0x1;if(_0x389adc){return _0x4d6916(_0x389adc);}else if(!_0x4a5e42){if(_0x590516[_0xb7a6('0xe')]){return _0x4d6916(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3b988d[_0xb7a6('0xa')]>0x0){if(_0x590516[_0xb7a6('0xf')]){if(_0x3b988d[_0xb7a6('0xb')]>0x0){if(moment(_0x590516[_0xb7a6('0x10')])[_0xb7a6('0x15')](_0x3b988d[_0xb7a6('0xb')],'minutes')>moment()){return _0x4d6916(null,![],{'message':_0xb7a6('0x16')});}else{return utils[_0xb7a6('0x17')](_0x590516,_0x3959b5,![],null)[_0xb7a6('0x18')](function(){return _0x4d6916(null,![],{'message':_0xb7a6('0x16')});});}}else{return _0x4d6916(null,![],{'message':_0xb7a6('0x16')});}}else{if(_0x3959b5>=_0x3b988d[_0xb7a6('0xa')]){return utils['clearBlockUser'](_0x590516,0x0,!![],moment())['then'](function(){return _0x4d6916(null,![],{'message':_0xb7a6('0x16')});});}else{return utils['clearBlockUser'](_0x590516,_0x3959b5,![],null)[_0xb7a6('0x18')](function(){return _0x4d6916(null,![],{'message':_0xb7a6('0x16')});});}}}else{return _0x4d6916(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x590516[_0xb7a6('0xe')]){return _0x4d6916(null,![],{'message':_0xb7a6('0x16')});}else if(_0x3b988d[_0xb7a6('0xa')]>0x0){if(_0x590516[_0xb7a6('0xf')]){if(_0x3b988d['blockDuration']>0x0){if(moment(_0x590516['blockedAt'])[_0xb7a6('0x15')](_0x3b988d[_0xb7a6('0xb')],'minutes')>moment()){return _0x4d6916(null,![],{'message':_0xb7a6('0x16')});}else{return utils[_0xb7a6('0x17')](_0x590516,0x0,![],null)[_0xb7a6('0x18')](function(){return utils[_0xb7a6('0x19')](_0x590516);})[_0xb7a6('0x18')](function(){return _0x4d6916(null,_0x590516);});}}else{return _0x4d6916(null,![],{'message':_0xb7a6('0x16')});}}else{return utils[_0xb7a6('0x17')](_0x590516,0x0,![],null)[_0xb7a6('0x18')](function(){return utils[_0xb7a6('0x19')](_0x590516);})[_0xb7a6('0x18')](function(){return _0x4d6916(null,_0x590516);})[_0xb7a6('0x1a')](function(_0x432700){return _0x4d6916(null,![],_0x432700);});}}else{if(_0x590516[_0xb7a6('0xf')]){return _0x4d6916(null,![],{'message':_0xb7a6('0x16')});}else{return utils['getLicense'](_0x590516)[_0xb7a6('0x18')](function(){return _0x4d6916(null,_0x590516);});}}}});})[_0xb7a6('0x1a')](function(_0x4d50cb){return _0x4d6916(null,![],_0x4d50cb);});}function sendServiceMail(_0x510fc8){return db[_0xb7a6('0x1b')]['find']({'where':{'service':!![]},'attributes':['id',_0xb7a6('0x1c'),_0xb7a6('0x1d')],'include':[{'model':db[_0xb7a6('0x1e')],'as':_0xb7a6('0x1f'),'include':[{'model':db[_0xb7a6('0x20')],'as':_0xb7a6('0x20')}]}]})[_0xb7a6('0x18')](function(_0x2b413c){if(!_0x2b413c){throw new Error(_0xb7a6('0x21'));}var _0x25289c=_0x2b413c['getSmtpOptions']();var _0x32b8b8={'account':_0x25289c,'message':_[_0xb7a6('0x22')]({'from':util[_0xb7a6('0x23')](_0xb7a6('0x24'),_0x2b413c[_0xb7a6('0x1c')],_0x2b413c['email']||_0x2b413c['Smtp'][_0xb7a6('0x12')])},_0x510fc8)};return client['request'](_0xb7a6('0x25'),_0x32b8b8);})['then'](function(_0x4dd876){if(_0x4dd876['error']){throw new Error(util[_0xb7a6('0x23')](_0xb7a6('0x26'),_0x4dd876[_0xb7a6('0x27')]['message']||JSON[_0xb7a6('0x28')](_0x4dd876[_0xb7a6('0x27')])));}return!![];});}function handleError(_0x2f90d7,_0x477062,_0x3a0279){return _0x2f90d7['status'](_0x477062||0x1f4)['send']({'message':_0x3a0279?_0x3a0279[_0xb7a6('0x29')]||_0x3a0279:''});}exports[_0xb7a6('0x2a')]=function(_0x5b8d88,_0x14aadb,_0x863d0a){passport[_0xb7a6('0x14')](_0xb7a6('0x2b'),function(_0x4058d7,_0xdfc794,_0x289064){var _0x4774eb=_0x4058d7||_0x289064;if(_0x4774eb){return handleError(_0x14aadb,0x191,_0x4774eb);}if(!_0xdfc794){return handleError(_0x14aadb,0x194,{'message':_0xb7a6('0x2c')});}else{var _0x43ac32={'payload':{'id':_0xdfc794['id'],'role':_0xdfc794[_0xb7a6('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0xb7a6('0x2d')](_0x43ac32)[_0xb7a6('0x18')](function(_0x4e6d1d){_0x14aadb[_0xb7a6('0x2e')]({'id':_0xdfc794['id'],'token':_0x4e6d1d,'statusCall':'','isAlreadyLogged':_0xdfc794[_0xb7a6('0x2f')]});});}})(_0x5b8d88,_0x14aadb,_0x863d0a);};exports[_0xb7a6('0x30')]=function(_0xa867e2,_0x1eb4c6){if(!_0xa867e2['body'][_0xb7a6('0x1d')]){return handleError(_0x1eb4c6,0x1f4,{'message':_0xb7a6('0x31')});}var _0x15da70=rs[_0xb7a6('0x32')]();_0xa867e2[_0xb7a6('0x33')][_0xb7a6('0x1d')]=_0xa867e2[_0xb7a6('0x33')][_0xb7a6('0x1d')][_0xb7a6('0x34')]()['toLowerCase']();var _0x2e615a;return db[_0xb7a6('0x35')][_0xb7a6('0x9')]({'where':{'id':0x1},'attributes':[_0xb7a6('0xa'),_0xb7a6('0xb')],'raw':!![]})[_0xb7a6('0x18')](function(_0x25a2fb){_0x2e615a=_0x25a2fb;return db[_0xb7a6('0x36')][_0xb7a6('0x37')]({'where':{'email':_0xa867e2['body'][_0xb7a6('0x1d')]}});})[_0xb7a6('0x18')](function(_0x43aea2){if(!_0x43aea2){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x43aea2[_0xb7a6('0xe')]){throw new Error(_0xb7a6('0x38'));}if(_0x43aea2[_0xb7a6('0xf')]){if(moment(_0x43aea2[_0xb7a6('0x10')])[_0xb7a6('0x15')](_0x2e615a[_0xb7a6('0xb')],_0xb7a6('0x39'))>moment()){throw new Error(_0xb7a6('0x3a'));}else{_0x43aea2['blocked']=![];_0x43aea2[_0xb7a6('0x10')]=null;}}_0x43aea2[_0xb7a6('0x3b')]=_0x15da70;_0x43aea2[_0xb7a6('0x3c')]=Date[_0xb7a6('0x3d')]()+0x36ee80;return _0x43aea2[_0xb7a6('0x3e')]();})['then'](function(){return sendServiceMail({'to':_0xa867e2['body'][_0xb7a6('0x1d')],'subject':_0xb7a6('0x3f'),'text':_0xb7a6('0x40')+_0xb7a6('0x41')+_0xb7a6('0x42')+_0xa867e2[_0xb7a6('0x43')][_0xb7a6('0x44')]+_0xb7a6('0x45')+_0x15da70+'\x0a\x0a'+_0xb7a6('0x46')});})[_0xb7a6('0x18')](function(){_0x1eb4c6['status'](0xc8)[_0xb7a6('0x47')]({'message':_0xb7a6('0x48')});})[_0xb7a6('0x1a')](function(_0x261530){return handleError(_0x1eb4c6,0x1f4,_0x261530);});};exports['reset']=function(_0xde5df1,_0x241e4){return db[_0xb7a6('0x36')][_0xb7a6('0x37')]({'where':{'resetPasswordToken':_0xde5df1['params'][_0xb7a6('0x49')],'resetPasswordExpires':{'$gt':Date[_0xb7a6('0x3d')]()}}})[_0xb7a6('0x18')](function(_0x11d7e3){if(!_0x11d7e3){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xb7a6('0x35')][_0xb7a6('0x9')]({'attributes':['id',_0xb7a6('0x4a'),_0xb7a6('0x4b'),_0xb7a6('0x4c')]})[_0xb7a6('0x18')](function(_0x561a0c){if(_0x561a0c[_0xb7a6('0x4a')])authService[_0xb7a6('0x4d')](_0xde5df1[_0xb7a6('0x33')][_0xb7a6('0xc')]);if(!_0x561a0c[_0xb7a6('0x4b')]||!_0x11d7e3[_0xb7a6('0x4e')])return _0x11d7e3;authService[_0xb7a6('0x4f')](_0xde5df1[_0xb7a6('0x33')][_0xb7a6('0xc')],_0x11d7e3[_0xb7a6('0x4e')],_0x561a0c[_0xb7a6('0x4c')]);return _0x11d7e3;})['then'](function(){_0x11d7e3[_0xb7a6('0xc')]=_0xde5df1['body'][_0xb7a6('0xc')];_0x11d7e3['resetPasswordToken']=null;_0x11d7e3[_0xb7a6('0x3c')]=null;return _0x11d7e3['save']();});})[_0xb7a6('0x18')](function(){_0x241e4['status'](0xc8)[_0xb7a6('0x47')]({'message':_0xb7a6('0x50')});})[_0xb7a6('0x1a')](function(_0x53e426){return handleError(_0x241e4,0x1f4,_0x53e426);});};passport[_0xb7a6('0x51')](_0xb7a6('0x2b'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x14d22e,_0x24596a,_0x2bdb43){return localAuthenticate(db[_0xb7a6('0x36')],_0x14d22e,_0x24596a,_0x2bdb43);}));
\ No newline at end of file
+var _0x2867=['minutes','clearBlockUser','blockDuration','getLicense','catch','MailAccount','email','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local-login','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','Setting','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','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','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','password','resetPasswordToken','resetPasswordExpires','use','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','findOne','allowedLoginAttempts','then','salt','role','blocked','blockedAt','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add'];(function(_0x355815,_0x19ff33){var _0x59ce65=function(_0x10cbbb){while(--_0x10cbbb){_0x355815['push'](_0x355815['shift']());}};_0x59ce65(++_0x19ff33);}(_0x2867,0x1ae));var _0x7286=function(_0x28b7ab,_0x16a764){_0x28b7ab=_0x28b7ab-0x0;var _0x56791b=_0x2867[_0x28b7ab];return _0x56791b;};'use strict';var util=require('util');var passport=require(_0x7286('0x0'));var LocalStrategy=require(_0x7286('0x1'))[_0x7286('0x2')];var jayson=require(_0x7286('0x3'));var _=require(_0x7286('0x4'));var rs=require(_0x7286('0x5'));var moment=require(_0x7286('0x6'));var db=require(_0x7286('0x7'))['db'];var authService=require(_0x7286('0x8'));var utils=require(_0x7286('0x9'));var client=jayson['client'][_0x7286('0xa')]({'port':0x232b});function localAuthenticate(_0xb332f3,_0x4c0c51,_0x29e862,_0x3a7f05){var _0x35ffff,_0x2e5586;return db['Setting'][_0x7286('0xb')]({'where':{'id':0x1},'attributes':[_0x7286('0xc'),'blockDuration'],'raw':!![]})[_0x7286('0xd')](function(_0x1c6674){_0x35ffff=_0x1c6674;return _0xb332f3[_0x7286('0xb')]({'attributes':['id','name','password',_0x7286('0xe'),_0x7286('0xf'),'disabled',_0x7286('0x10'),_0x7286('0x11'),'loginAttempts'],'where':{'name':_0x4c0c51,'role':{'$or':[_0x7286('0x12'),_0x7286('0x13'),_0x7286('0x14')]}}});})[_0x7286('0xd')](function(_0x4cb406){if(!_0x4cb406||_0x4cb406&&_0x4cb406[_0x7286('0x15')]!==_0x4c0c51){throw new Error(_0x7286('0x16'));}else{_0x2e5586=_0x4cb406;return _0x2e5586;}})[_0x7286('0xd')](function(){_0x2e5586[_0x7286('0x17')](_0x29e862,function(_0x36c6fa,_0x57e767){var _0x3c1363=_0x2e5586['loginAttempts']+0x1;if(_0x36c6fa){return _0x3a7f05(_0x36c6fa);}else if(!_0x57e767){if(_0x2e5586[_0x7286('0x18')]){return _0x3a7f05(null,![],{'message':_0x7286('0x16')});}else if(_0x35ffff[_0x7286('0xc')]>0x0){if(_0x2e5586[_0x7286('0x10')]){if(_0x35ffff['blockDuration']>0x0){if(moment(_0x2e5586[_0x7286('0x11')])[_0x7286('0x19')](_0x35ffff['blockDuration'],_0x7286('0x1a'))>moment()){return _0x3a7f05(null,![],{'message':_0x7286('0x16')});}else{return utils[_0x7286('0x1b')](_0x2e5586,_0x3c1363,![],null)[_0x7286('0xd')](function(){return _0x3a7f05(null,![],{'message':_0x7286('0x16')});});}}else{return _0x3a7f05(null,![],{'message':_0x7286('0x16')});}}else{if(_0x3c1363>=_0x35ffff['allowedLoginAttempts']){return utils[_0x7286('0x1b')](_0x2e5586,0x0,!![],moment())[_0x7286('0xd')](function(){return _0x3a7f05(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x7286('0x1b')](_0x2e5586,_0x3c1363,![],null)[_0x7286('0xd')](function(){return _0x3a7f05(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x3a7f05(null,![],{'message':_0x7286('0x16')});}}else{if(_0x2e5586[_0x7286('0x18')]){return _0x3a7f05(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x35ffff['allowedLoginAttempts']>0x0){if(_0x2e5586['blocked']){if(_0x35ffff['blockDuration']>0x0){if(moment(_0x2e5586[_0x7286('0x11')])[_0x7286('0x19')](_0x35ffff[_0x7286('0x1c')],'minutes')>moment()){return _0x3a7f05(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x2e5586,0x0,![],null)[_0x7286('0xd')](function(){return utils[_0x7286('0x1d')](_0x2e5586);})[_0x7286('0xd')](function(){return _0x3a7f05(null,_0x2e5586);});}}else{return _0x3a7f05(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x7286('0x1b')](_0x2e5586,0x0,![],null)[_0x7286('0xd')](function(){return utils[_0x7286('0x1d')](_0x2e5586);})['then'](function(){return _0x3a7f05(null,_0x2e5586);})['catch'](function(_0x174580){return _0x3a7f05(null,![],_0x174580);});}}else{if(_0x2e5586[_0x7286('0x10')]){return _0x3a7f05(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x7286('0x1d')](_0x2e5586)[_0x7286('0xd')](function(){return _0x3a7f05(null,_0x2e5586);});}}}});})[_0x7286('0x1e')](function(_0x5ba120){return _0x3a7f05(null,![],_0x5ba120);});}function sendServiceMail(_0x427a69){return db[_0x7286('0x1f')]['find']({'where':{'service':!![]},'attributes':['id',_0x7286('0x15'),_0x7286('0x20')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x7286('0x21')],'as':_0x7286('0x21')}]}]})[_0x7286('0xd')](function(_0x1833d1){if(!_0x1833d1){throw new Error(_0x7286('0x22'));}var _0x4224d2=_0x1833d1[_0x7286('0x23')]();var _0x56dd31={'account':_0x4224d2,'message':_[_0x7286('0x24')]({'from':util[_0x7286('0x25')](_0x7286('0x26'),_0x1833d1[_0x7286('0x15')],_0x1833d1[_0x7286('0x20')]||_0x1833d1[_0x7286('0x27')][_0x7286('0x13')])},_0x427a69)};return client[_0x7286('0x28')]('SendMail',_0x56dd31);})[_0x7286('0xd')](function(_0x1efba0){if(_0x1efba0[_0x7286('0x29')]){throw new Error(util[_0x7286('0x25')](_0x7286('0x2a'),_0x1efba0[_0x7286('0x29')][_0x7286('0x2b')]||JSON['stringify'](_0x1efba0['error'])));}return!![];});}function handleError(_0xb793e2,_0x325c39,_0xe32630){return _0xb793e2[_0x7286('0x2c')](_0x325c39||0x1f4)[_0x7286('0x2d')]({'message':_0xe32630?_0xe32630[_0x7286('0x2b')]||_0xe32630:''});}exports[_0x7286('0x2e')]=function(_0x3892b9,_0x329d86,_0x3c575f){passport[_0x7286('0x17')](_0x7286('0x2f'),function(_0xead2de,_0x20698e,_0x4cd458){var _0x7642e=_0xead2de||_0x4cd458;if(_0x7642e){return handleError(_0x329d86,0x191,_0x7642e);}if(!_0x20698e){return handleError(_0x329d86,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3b2a88={'payload':{'id':_0x20698e['id'],'role':_0x20698e[_0x7286('0xf')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3b2a88)[_0x7286('0xd')](function(_0x1fc806){_0x329d86[_0x7286('0x30')]({'id':_0x20698e['id'],'token':_0x1fc806,'statusCall':'','isAlreadyLogged':_0x20698e[_0x7286('0x31')]});});}})(_0x3892b9,_0x329d86,_0x3c575f);};exports['forgot']=function(_0x10c056,_0x3210aa){if(!_0x10c056[_0x7286('0x32')][_0x7286('0x20')]){return handleError(_0x3210aa,0x1f4,{'message':_0x7286('0x33')});}var _0x4cf61e=rs[_0x7286('0x34')]();_0x10c056[_0x7286('0x32')][_0x7286('0x20')]=_0x10c056[_0x7286('0x32')][_0x7286('0x20')][_0x7286('0x35')]()['toLowerCase']();var _0x402f00;return db[_0x7286('0x36')][_0x7286('0xb')]({'where':{'id':0x1},'attributes':[_0x7286('0xc'),'blockDuration'],'raw':!![]})[_0x7286('0xd')](function(_0x3e84ad){_0x402f00=_0x3e84ad;return db[_0x7286('0x37')][_0x7286('0x38')]({'where':{'email':_0x10c056[_0x7286('0x32')][_0x7286('0x20')]}});})[_0x7286('0xd')](function(_0x3cc82a){if(!_0x3cc82a){throw new Error(_0x7286('0x39'));}if(_0x3cc82a[_0x7286('0x18')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x3cc82a[_0x7286('0x10')]){if(moment(_0x3cc82a['blockedAt'])[_0x7286('0x19')](_0x402f00['blockDuration'],'minutes')>moment()){throw new Error(_0x7286('0x3a'));}else{_0x3cc82a[_0x7286('0x10')]=![];_0x3cc82a['blockedAt']=null;}}_0x3cc82a['resetPasswordToken']=_0x4cf61e;_0x3cc82a['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x3cc82a[_0x7286('0x3b')]();})[_0x7286('0xd')](function(){return sendServiceMail({'to':_0x10c056[_0x7286('0x32')][_0x7286('0x20')],'subject':_0x7286('0x3c'),'text':_0x7286('0x3d')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x7286('0x3e')+_0x10c056['headers']['host']+_0x7286('0x3f')+_0x4cf61e+'\x0a\x0a'+_0x7286('0x40')});})['then'](function(){_0x3210aa[_0x7286('0x2c')](0xc8)[_0x7286('0x2d')]({'message':_0x7286('0x41')});})[_0x7286('0x1e')](function(_0x454c53){return handleError(_0x3210aa,0x1f4,_0x454c53);});};exports['reset']=function(_0x582c56,_0x315125){return db[_0x7286('0x37')][_0x7286('0x38')]({'where':{'resetPasswordToken':_0x582c56[_0x7286('0x42')][_0x7286('0x43')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x7286('0xd')](function(_0x55bf0f){if(!_0x55bf0f){throw new Error(_0x7286('0x44'));}return db[_0x7286('0x36')][_0x7286('0xb')]({'attributes':['id',_0x7286('0x45'),_0x7286('0x46'),_0x7286('0x47')]})[_0x7286('0xd')](function(_0x11f1e9){if(_0x11f1e9[_0x7286('0x45')])authService['validatePasswordPattern'](_0x582c56[_0x7286('0x32')]['password']);if(!_0x11f1e9[_0x7286('0x46')]||!_0x55bf0f['previousPasswords'])return _0x55bf0f;authService['validatePasswordHistory'](_0x582c56[_0x7286('0x32')][_0x7286('0x48')],_0x55bf0f['previousPasswords'],_0x11f1e9[_0x7286('0x47')]);return _0x55bf0f;})[_0x7286('0xd')](function(){_0x55bf0f[_0x7286('0x48')]=_0x582c56[_0x7286('0x32')]['password'];_0x55bf0f[_0x7286('0x49')]=null;_0x55bf0f[_0x7286('0x4a')]=null;return _0x55bf0f[_0x7286('0x3b')]();});})[_0x7286('0xd')](function(){_0x315125[_0x7286('0x2c')](0xc8)[_0x7286('0x2d')]({'message':'Password\x20reset!'});})[_0x7286('0x1e')](function(_0x4f2798){return handleError(_0x315125,0x1f4,_0x4f2798);});};passport[_0x7286('0x4b')]('local-login',new LocalStrategy({'usernameField':_0x7286('0x15'),'passwordField':'password'},function(_0x928d1f,_0x27f32e,_0x1449f3){return localAuthenticate(db[_0x7286('0x37')],_0x928d1f,_0x27f32e,_0x1449f3);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index fdc2387..3f2c996 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 _0xfd8b=['exports','express','Router','login','post','forgot','/reset/:token','reset'];(function(_0xd0b573,_0x3cbc25){var _0x1d31e0=function(_0x42fa21){while(--_0x42fa21){_0xd0b573['push'](_0xd0b573['shift']());}};_0x1d31e0(++_0x3cbc25);}(_0xfd8b,0x1d9));var _0xbfd8=function(_0x221b8c,_0x2c7afc){_0x221b8c=_0x221b8c-0x0;var _0x3fab9f=_0xfd8b[_0x221b8c];return _0x3fab9f;};'use strict';var express=require(_0xbfd8('0x0'));var router=express[_0xbfd8('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0xbfd8('0x2')]);router[_0xbfd8('0x3')]('/forgot',controller[_0xbfd8('0x4')]);router['post'](_0xbfd8('0x5'),controller[_0xbfd8('0x6')]);module[_0xbfd8('0x7')]=router;
\ No newline at end of file
+var _0x0df6=['forgot','/reset/:token','reset','express','Router','./authLocal.controller','post','login','/forgot'];(function(_0x1c1803,_0x2af614){var _0x2e8566=function(_0x15b929){while(--_0x15b929){_0x1c1803['push'](_0x1c1803['shift']());}};_0x2e8566(++_0x2af614);}(_0x0df6,0x8a));var _0x60df=function(_0xd57a8d,_0x4632cb){_0xd57a8d=_0xd57a8d-0x0;var _0x5c4582=_0x0df6[_0xd57a8d];return _0x5c4582;};'use strict';var express=require(_0x60df('0x0'));var router=express[_0x60df('0x1')]();var controller=require(_0x60df('0x2'));router[_0x60df('0x3')]('/',controller[_0x60df('0x4')]);router[_0x60df('0x3')](_0x60df('0x5'),controller[_0x60df('0x6')]);router[_0x60df('0x3')](_0x60df('0x7'),controller[_0x60df('0x8')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 793f710..ee2730b 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 _0x4129=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x58be00,_0xf98889){var _0x4b9818=function(_0xb574c2){while(--_0xb574c2){_0x58be00['push'](_0x58be00['shift']());}};_0x4b9818(++_0xf98889);}(_0x4129,0xd7));var _0x9412=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4129[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x9412('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x9412('0x1')]},'description':{'type':Sequelize[_0x9412('0x1')]},'status':{'type':Sequelize[_0x9412('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9412('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x0eba=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x628e47,_0x350ee4){var _0x368636=function(_0x21c560){while(--_0x21c560){_0x628e47['push'](_0x628e47['shift']());}};_0x368636(++_0x350ee4);}(_0x0eba,0x191));var _0xa0eb=function(_0x290304,_0x5e485f){_0x290304=_0x290304-0x0;var _0x57da47=_0x0eba[_0x290304];return _0x57da47;};'use strict';var Sequelize=require(_0xa0eb('0x0'));module[_0xa0eb('0x1')]={'name':{'type':Sequelize[_0xa0eb('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xa0eb('0x2')]},'description':{'type':Sequelize[_0xa0eb('0x2')]},'status':{'type':Sequelize[_0xa0eb('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xa0eb('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 eae9ddd..a66981c 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 _0x7552=['update','then','destroy','error','name','map','Automation','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','include','show','params','includeAll','options','catch','create','body','find','addConditions','Condition','omit','ids','findOne','keys','order','pick','getConditions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','reject','save'];(function(_0x15fdee,_0x3191d1){var _0x57ce2d=function(_0xe2c813){while(--_0xe2c813){_0x15fdee['push'](_0x15fdee['shift']());}};_0x57ce2d(++_0x3191d1);}(_0x7552,0x11c));var _0x2755=function(_0x244881,_0x468437){_0x244881=_0x244881-0x0;var _0xefae95=_0x7552[_0x244881];return _0xefae95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2755('0x0'));var zipdir=require(_0x2755('0x1'));var jsonpatch=require(_0x2755('0x2'));var rp=require(_0x2755('0x3'));var moment=require(_0x2755('0x4'));var BPromise=require(_0x2755('0x5'));var Mustache=require('mustache');var util=require(_0x2755('0x6'));var path=require(_0x2755('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2755('0x8'));var fs=require('fs');var fs_extra=require(_0x2755('0x9'));var _=require(_0x2755('0xa'));var squel=require(_0x2755('0xb'));var crypto=require(_0x2755('0xc'));var jsforce=require(_0x2755('0xd'));var deskjs=require(_0x2755('0xe'));var toCsv=require(_0x2755('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2755('0x10'));var authService=require(_0x2755('0x11'));var qs=require(_0x2755('0x12'));var as=require(_0x2755('0x13'));var hardwareService=require(_0x2755('0x14'));var logger=require(_0x2755('0x15'))(_0x2755('0x16'));var utils=require(_0x2755('0x17'));var config=require(_0x2755('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13b2ef,_0x428429){_0x428429=_0x428429||0xcc;return function(_0x4c848d){if(_0x4c848d){return _0x13b2ef[_0x2755('0x19')](_0x428429);}return _0x13b2ef[_0x2755('0x1a')](_0x428429)[_0x2755('0x1b')]();};}function respondWithResult(_0x1d7920,_0x422bb3){_0x422bb3=_0x422bb3||0xc8;return function(_0x1a9c50){if(_0x1a9c50){return _0x1d7920[_0x2755('0x1a')](_0x422bb3)['json'](_0x1a9c50);}};}function respondWithFilteredResult(_0x2ca7bc,_0x5ae116){return function(_0x37e765){if(_0x37e765){var _0x34a314=typeof _0x5ae116[_0x2755('0x1c')]===_0x2755('0x1d')&&typeof _0x5ae116['limit']===_0x2755('0x1d');var _0x28a00f=_0x37e765[_0x2755('0x1e')];var _0x9c524f=_0x34a314?0x0:_0x5ae116[_0x2755('0x1c')];var _0x5839a8=_0x34a314?_0x37e765['count']:_0x5ae116[_0x2755('0x1c')]+_0x5ae116[_0x2755('0x1f')];var _0xb35f91;if(_0x5839a8>=_0x28a00f){_0x5839a8=_0x28a00f;_0xb35f91=0xc8;}else{_0xb35f91=0xce;}_0x2ca7bc['status'](_0xb35f91);return _0x2ca7bc['set'](_0x2755('0x20'),_0x9c524f+'-'+_0x5839a8+'/'+_0x28a00f)['json'](_0x37e765);}return null;};}function patchUpdates(_0x1a4dcd){return function(_0x4b0513){try{jsonpatch[_0x2755('0x21')](_0x4b0513,_0x1a4dcd,!![]);}catch(_0x58db78){return BPromise[_0x2755('0x22')](_0x58db78);}return _0x4b0513[_0x2755('0x23')]();};}function saveUpdates(_0x31cdec,_0xc3d357){return function(_0x4929b7){if(_0x4929b7){return _0x4929b7[_0x2755('0x24')](_0x31cdec)[_0x2755('0x25')](function(_0x5d0391){return _0x5d0391;});}return null;};}function removeEntity(_0x3f0018,_0x529bdd){return function(_0x41dac){if(_0x41dac){return _0x41dac[_0x2755('0x26')]()[_0x2755('0x25')](function(){_0x3f0018[_0x2755('0x1a')](0xcc)[_0x2755('0x1b')]();});}};}function handleEntityNotFound(_0x44124c,_0x27242a){return function(_0x4cc0cf){if(!_0x4cc0cf){_0x44124c[_0x2755('0x19')](0x194);}return _0x4cc0cf;};}function handleError(_0x599249,_0x23b61f){_0x23b61f=_0x23b61f||0x1f4;return function(_0x59e2c5){logger[_0x2755('0x27')](_0x59e2c5['stack']);if(_0x59e2c5[_0x2755('0x28')]){delete _0x59e2c5[_0x2755('0x28')];}_0x599249[_0x2755('0x1a')](_0x23b61f)['send'](_0x59e2c5);};}exports['index']=function(_0x3026c9,_0x31a35f){var _0x401659={},_0xd55771={},_0x35fadb={'count':0x0,'rows':[]};var _0x216b86=_[_0x2755('0x29')](db[_0x2755('0x2a')][_0x2755('0x2b')],function(_0x5381e8){return{'name':_0x5381e8[_0x2755('0x2c')],'type':_0x5381e8[_0x2755('0x2d')][_0x2755('0x2e')]};});_0xd55771[_0x2755('0x2f')]=_[_0x2755('0x29')](_0x216b86,_0x2755('0x28'));_0xd55771['query']=_['keys'](_0x3026c9[_0x2755('0x30')]);_0xd55771['filters']=_[_0x2755('0x31')](_0xd55771['model'],_0xd55771[_0x2755('0x30')]);_0x401659[_0x2755('0x32')]=_['intersection'](_0xd55771[_0x2755('0x2f')],qs['fields'](_0x3026c9[_0x2755('0x30')][_0x2755('0x33')]));_0x401659[_0x2755('0x32')]=_0x401659[_0x2755('0x32')][_0x2755('0x34')]?_0x401659[_0x2755('0x32')]:_0xd55771[_0x2755('0x2f')];if(!_0x3026c9[_0x2755('0x30')][_0x2755('0x35')](_0x2755('0x36'))){_0x401659[_0x2755('0x1f')]=qs[_0x2755('0x1f')](_0x3026c9['query'][_0x2755('0x1f')]);_0x401659[_0x2755('0x1c')]=qs[_0x2755('0x1c')](_0x3026c9['query']['offset']);}_0x401659['order']=qs[_0x2755('0x37')](_0x3026c9[_0x2755('0x30')][_0x2755('0x37')]);_0x401659[_0x2755('0x38')]=qs[_0x2755('0x39')](_['pick'](_0x3026c9[_0x2755('0x30')],_0xd55771[_0x2755('0x39')]),_0x216b86);if(_0x3026c9[_0x2755('0x30')][_0x2755('0x3a')]){_0x401659[_0x2755('0x38')]=_[_0x2755('0x3b')](_0x401659[_0x2755('0x38')],{'$or':_['map'](_0x216b86,function(_0x438a6d){if(_0x438a6d[_0x2755('0x2d')]!=='VIRTUAL'){var _0x1fc52d={};_0x1fc52d[_0x438a6d[_0x2755('0x28')]]={'$like':'%'+_0x3026c9[_0x2755('0x30')][_0x2755('0x3a')]+'%'};return _0x1fc52d;}})});}_0x401659=_[_0x2755('0x3b')]({},_0x401659,_0x3026c9['options']);var _0x1e8e7d={'where':_0x401659['where']};return db[_0x2755('0x2a')]['count'](_0x1e8e7d)['then'](function(_0x33146d){_0x35fadb[_0x2755('0x1e')]=_0x33146d;if(_0x3026c9[_0x2755('0x30')]['includeAll']){_0x401659[_0x2755('0x3c')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x401659);})['then'](function(_0x5ae143){_0x35fadb['rows']=_0x5ae143;return _0x35fadb;})[_0x2755('0x25')](respondWithFilteredResult(_0x31a35f,_0x401659))['catch'](handleError(_0x31a35f,null));};exports[_0x2755('0x3d')]=function(_0x40f9b4,_0x4b40d8){var _0x1d9635={'raw':![],'where':{'id':_0x40f9b4[_0x2755('0x3e')]['id']}},_0x5f16be={};_0x5f16be[_0x2755('0x2f')]=_['keys'](db[_0x2755('0x2a')][_0x2755('0x2b')]);_0x5f16be[_0x2755('0x30')]=_['keys'](_0x40f9b4['query']);_0x5f16be[_0x2755('0x39')]=_[_0x2755('0x31')](_0x5f16be[_0x2755('0x2f')],_0x5f16be[_0x2755('0x30')]);_0x1d9635[_0x2755('0x32')]=_[_0x2755('0x31')](_0x5f16be[_0x2755('0x2f')],qs['fields'](_0x40f9b4[_0x2755('0x30')][_0x2755('0x33')]));_0x1d9635['attributes']=_0x1d9635[_0x2755('0x32')][_0x2755('0x34')]?_0x1d9635['attributes']:_0x5f16be[_0x2755('0x2f')];if(_0x40f9b4[_0x2755('0x30')][_0x2755('0x3f')]){_0x1d9635[_0x2755('0x3c')]=[{'all':!![]}];}_0x1d9635=_[_0x2755('0x3b')]({},_0x1d9635,_0x40f9b4[_0x2755('0x40')]);return db[_0x2755('0x2a')]['find'](_0x1d9635)[_0x2755('0x25')](handleEntityNotFound(_0x4b40d8,null))[_0x2755('0x25')](respondWithResult(_0x4b40d8,null))[_0x2755('0x41')](handleError(_0x4b40d8,null));};exports['create']=function(_0x5c8c4e,_0x1e4e11){return db[_0x2755('0x2a')][_0x2755('0x42')](_0x5c8c4e[_0x2755('0x43')],{})['then'](respondWithResult(_0x1e4e11,0xc9))[_0x2755('0x41')](handleError(_0x1e4e11,null));};exports[_0x2755('0x24')]=function(_0x4e9644,_0x3fe9da){if(_0x4e9644[_0x2755('0x43')]['id']){delete _0x4e9644[_0x2755('0x43')]['id'];}return db[_0x2755('0x2a')][_0x2755('0x44')]({'where':{'id':_0x4e9644[_0x2755('0x3e')]['id']}})[_0x2755('0x25')](handleEntityNotFound(_0x3fe9da,null))[_0x2755('0x25')](saveUpdates(_0x4e9644[_0x2755('0x43')],null))[_0x2755('0x25')](respondWithResult(_0x3fe9da,null))[_0x2755('0x41')](handleError(_0x3fe9da,null));};exports[_0x2755('0x26')]=function(_0x4b1dc0,_0x137247){return db[_0x2755('0x2a')][_0x2755('0x44')]({'where':{'id':_0x4b1dc0[_0x2755('0x3e')]['id']}})[_0x2755('0x25')](handleEntityNotFound(_0x137247,null))[_0x2755('0x25')](removeEntity(_0x137247,null))[_0x2755('0x41')](handleError(_0x137247,null));};exports[_0x2755('0x45')]=function(_0x8038f9,_0x502497,_0x1e842e){return db[_0x2755('0x46')][_0x2755('0x44')]({'where':{'id':_0x8038f9[_0x2755('0x3e')]['id']}})[_0x2755('0x25')](handleEntityNotFound(_0x502497,null))[_0x2755('0x25')](function(_0x23f583){if(_0x23f583){return _0x23f583['addConditions'](_0x8038f9[_0x2755('0x43')]['ids'],_[_0x2755('0x47')](_0x8038f9[_0x2755('0x43')],[_0x2755('0x48'),'id'])||{});}})[_0x2755('0x25')](respondWithResult(_0x502497,null))[_0x2755('0x41')](handleError(_0x502497,null));};exports['getConditions']=function(_0x52ffb0,_0x439a13,_0x118b4f){var _0x1d1701={};var _0x3b3e5a={};var _0x568fb5;var _0x57232e;return db['Automation'][_0x2755('0x49')]({'where':{'id':_0x52ffb0[_0x2755('0x3e')]['id']}})[_0x2755('0x25')](handleEntityNotFound(_0x439a13,null))[_0x2755('0x25')](function(_0x2ed3d3){if(_0x2ed3d3){_0x568fb5=_0x2ed3d3;_0x3b3e5a[_0x2755('0x2f')]=_[_0x2755('0x4a')](db['Condition'][_0x2755('0x2b')]);_0x3b3e5a[_0x2755('0x30')]=_[_0x2755('0x4a')](_0x52ffb0[_0x2755('0x30')]);_0x3b3e5a[_0x2755('0x39')]=_[_0x2755('0x31')](_0x3b3e5a[_0x2755('0x2f')],_0x3b3e5a[_0x2755('0x30')]);_0x1d1701[_0x2755('0x32')]=_['intersection'](_0x3b3e5a['model'],qs[_0x2755('0x33')](_0x52ffb0[_0x2755('0x30')][_0x2755('0x33')]));_0x1d1701['attributes']=_0x1d1701['attributes'][_0x2755('0x34')]?_0x1d1701['attributes']:_0x3b3e5a[_0x2755('0x2f')];_0x1d1701[_0x2755('0x4b')]=qs[_0x2755('0x37')](_0x52ffb0['query']['sort']);_0x1d1701['where']=qs[_0x2755('0x39')](_[_0x2755('0x4c')](_0x52ffb0[_0x2755('0x30')],_0x3b3e5a['filters']));if(_0x52ffb0[_0x2755('0x30')][_0x2755('0x3a')]){_0x1d1701['where']=_[_0x2755('0x3b')](_0x1d1701['where'],{'$or':_[_0x2755('0x29')](_0x1d1701['attributes'],function(_0x53850a){var _0x50d699={};_0x50d699[_0x53850a]={'$like':'%'+_0x52ffb0[_0x2755('0x30')][_0x2755('0x3a')]+'%'};return _0x50d699;})});}_0x1d1701=_[_0x2755('0x3b')]({},_0x1d1701,_0x52ffb0[_0x2755('0x40')]);return _0x568fb5[_0x2755('0x4d')](_0x1d1701);}})[_0x2755('0x25')](function(_0x2663e5){if(_0x2663e5){_0x57232e=_0x2663e5[_0x2755('0x34')];if(!_0x52ffb0['query']['hasOwnProperty']('nolimit')){_0x1d1701[_0x2755('0x1f')]=qs[_0x2755('0x1f')](_0x52ffb0['query'][_0x2755('0x1f')]);_0x1d1701[_0x2755('0x1c')]=qs['offset'](_0x52ffb0[_0x2755('0x30')][_0x2755('0x1c')]);}return _0x568fb5[_0x2755('0x4d')](_0x1d1701);}})[_0x2755('0x25')](function(_0x4f3d89){if(_0x4f3d89){return _0x4f3d89?{'count':_0x57232e,'rows':_0x4f3d89}:null;}})[_0x2755('0x25')](respondWithResult(_0x439a13,null))[_0x2755('0x41')](handleError(_0x439a13,null));};exports['addActions']=function(_0x2ec3d0,_0x36ee1b,_0x46eeb3){return db[_0x2755('0x4e')]['find']({'where':{'id':_0x2ec3d0[_0x2755('0x3e')]['id']}})[_0x2755('0x25')](handleEntityNotFound(_0x36ee1b,null))[_0x2755('0x25')](function(_0x1f034e){if(_0x1f034e){return _0x1f034e['addActions'](_0x2ec3d0[_0x2755('0x43')][_0x2755('0x48')],_[_0x2755('0x47')](_0x2ec3d0['body'],[_0x2755('0x48'),'id'])||{});}})[_0x2755('0x25')](respondWithResult(_0x36ee1b,null))[_0x2755('0x41')](handleError(_0x36ee1b,null));};exports['getActions']=function(_0x4c45b0,_0x2efecd,_0x435a80){var _0x1bbc70={};var _0x46330f={};var _0xf01d64;var _0xd11e88;return db[_0x2755('0x2a')][_0x2755('0x49')]({'where':{'id':_0x4c45b0['params']['id']}})[_0x2755('0x25')](handleEntityNotFound(_0x2efecd,null))[_0x2755('0x25')](function(_0xb2ff38){if(_0xb2ff38){_0xf01d64=_0xb2ff38;_0x46330f[_0x2755('0x2f')]=_[_0x2755('0x4a')](db[_0x2755('0x4e')][_0x2755('0x2b')]);_0x46330f['query']=_[_0x2755('0x4a')](_0x4c45b0[_0x2755('0x30')]);_0x46330f[_0x2755('0x39')]=_[_0x2755('0x31')](_0x46330f[_0x2755('0x2f')],_0x46330f['query']);_0x1bbc70['attributes']=_[_0x2755('0x31')](_0x46330f[_0x2755('0x2f')],qs[_0x2755('0x33')](_0x4c45b0[_0x2755('0x30')][_0x2755('0x33')]));_0x1bbc70[_0x2755('0x32')]=_0x1bbc70[_0x2755('0x32')][_0x2755('0x34')]?_0x1bbc70['attributes']:_0x46330f[_0x2755('0x2f')];_0x1bbc70[_0x2755('0x4b')]=qs['sort'](_0x4c45b0[_0x2755('0x30')][_0x2755('0x37')]);_0x1bbc70['where']=qs[_0x2755('0x39')](_[_0x2755('0x4c')](_0x4c45b0['query'],_0x46330f['filters']));if(_0x4c45b0['query'][_0x2755('0x3a')]){_0x1bbc70[_0x2755('0x38')]=_['merge'](_0x1bbc70['where'],{'$or':_['map'](_0x1bbc70['attributes'],function(_0x2ac0a8){var _0x5967d6={};_0x5967d6[_0x2ac0a8]={'$like':'%'+_0x4c45b0['query'][_0x2755('0x3a')]+'%'};return _0x5967d6;})});}_0x1bbc70=_[_0x2755('0x3b')]({},_0x1bbc70,_0x4c45b0[_0x2755('0x40')]);return _0xf01d64[_0x2755('0x4f')](_0x1bbc70);}})[_0x2755('0x25')](function(_0x3fea2d){if(_0x3fea2d){_0xd11e88=_0x3fea2d[_0x2755('0x34')];if(!_0x4c45b0[_0x2755('0x30')][_0x2755('0x35')](_0x2755('0x36'))){_0x1bbc70[_0x2755('0x1f')]=qs[_0x2755('0x1f')](_0x4c45b0[_0x2755('0x30')][_0x2755('0x1f')]);_0x1bbc70[_0x2755('0x1c')]=qs['offset'](_0x4c45b0[_0x2755('0x30')][_0x2755('0x1c')]);}return _0xf01d64[_0x2755('0x4f')](_0x1bbc70);}})['then'](function(_0x5ed979){if(_0x5ed979){return _0x5ed979?{'count':_0xd11e88,'rows':_0x5ed979}:null;}})[_0x2755('0x25')](respondWithResult(_0x2efecd,null))[_0x2755('0x41')](handleError(_0x2efecd,null));};
\ No newline at end of file
+var _0x0de2=['ids','omit','getConditions','length','addActions','getActions','findOne','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','show','params','find','catch','create','body','update','destroy','addConditions','Condition'];(function(_0x4ccd40,_0x1892e0){var _0x4c9ecf=function(_0xe17be2){while(--_0xe17be2){_0x4ccd40['push'](_0x4ccd40['shift']());}};_0x4c9ecf(++_0x1892e0);}(_0x0de2,0xac));var _0x20de=function(_0x12df52,_0x4dddf5){_0x12df52=_0x12df52-0x0;var _0x228658=_0x0de2[_0x12df52];return _0x228658;};'use strict';var emlformat=require(_0x20de('0x0'));var rimraf=require(_0x20de('0x1'));var zipdir=require(_0x20de('0x2'));var jsonpatch=require(_0x20de('0x3'));var rp=require(_0x20de('0x4'));var moment=require(_0x20de('0x5'));var BPromise=require(_0x20de('0x6'));var Mustache=require(_0x20de('0x7'));var util=require('util');var path=require(_0x20de('0x8'));var sox=require(_0x20de('0x9'));var csv=require(_0x20de('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x20de('0xb'));var squel=require(_0x20de('0xc'));var crypto=require(_0x20de('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x20de('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x20de('0xf'));var Redis=require('ioredis');var authService=require(_0x20de('0x10'));var qs=require(_0x20de('0x11'));var as=require(_0x20de('0x12'));var hardwareService=require(_0x20de('0x13'));var logger=require(_0x20de('0x14'))(_0x20de('0x15'));var utils=require(_0x20de('0x16'));var config=require(_0x20de('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x20de('0x18'))['db'];function respondWithStatusCode(_0x557102,_0x57d1e3){_0x57d1e3=_0x57d1e3||0xcc;return function(_0x9c853e){if(_0x9c853e){return _0x557102[_0x20de('0x19')](_0x57d1e3);}return _0x557102['status'](_0x57d1e3)[_0x20de('0x1a')]();};}function respondWithResult(_0x3ba03c,_0x5d17ee){_0x5d17ee=_0x5d17ee||0xc8;return function(_0x53ba8c){if(_0x53ba8c){return _0x3ba03c[_0x20de('0x1b')](_0x5d17ee)[_0x20de('0x1c')](_0x53ba8c);}};}function respondWithFilteredResult(_0x405568,_0x13d61c){return function(_0x2cbd3a){if(_0x2cbd3a){var _0x4ec351=typeof _0x13d61c[_0x20de('0x1d')]===_0x20de('0x1e')&&typeof _0x13d61c[_0x20de('0x1f')]==='undefined';var _0x4c502e=_0x2cbd3a[_0x20de('0x20')];var _0x3cc988=_0x4ec351?0x0:_0x13d61c[_0x20de('0x1d')];var _0x42cbea=_0x4ec351?_0x2cbd3a['count']:_0x13d61c[_0x20de('0x1d')]+_0x13d61c[_0x20de('0x1f')];var _0x432660;if(_0x42cbea>=_0x4c502e){_0x42cbea=_0x4c502e;_0x432660=0xc8;}else{_0x432660=0xce;}_0x405568[_0x20de('0x1b')](_0x432660);return _0x405568['set']('Content-Range',_0x3cc988+'-'+_0x42cbea+'/'+_0x4c502e)[_0x20de('0x1c')](_0x2cbd3a);}return null;};}function patchUpdates(_0x49b3a5){return function(_0xc48417){try{jsonpatch[_0x20de('0x21')](_0xc48417,_0x49b3a5,!![]);}catch(_0x5011d0){return BPromise['reject'](_0x5011d0);}return _0xc48417['save']();};}function saveUpdates(_0x1b17fe,_0x7b9905){return function(_0x80cfa6){if(_0x80cfa6){return _0x80cfa6['update'](_0x1b17fe)['then'](function(_0xadee50){return _0xadee50;});}return null;};}function removeEntity(_0x4adf36,_0x40dbf4){return function(_0x4ed3f5){if(_0x4ed3f5){return _0x4ed3f5['destroy']()['then'](function(){_0x4adf36[_0x20de('0x1b')](0xcc)[_0x20de('0x1a')]();});}};}function handleEntityNotFound(_0x4d1030,_0xf6688c){return function(_0x518b4d){if(!_0x518b4d){_0x4d1030[_0x20de('0x19')](0x194);}return _0x518b4d;};}function handleError(_0x4d24d8,_0x1bf4c6){_0x1bf4c6=_0x1bf4c6||0x1f4;return function(_0xf09a9b){logger[_0x20de('0x22')](_0xf09a9b[_0x20de('0x23')]);if(_0xf09a9b[_0x20de('0x24')]){delete _0xf09a9b[_0x20de('0x24')];}_0x4d24d8[_0x20de('0x1b')](_0x1bf4c6)[_0x20de('0x25')](_0xf09a9b);};}exports[_0x20de('0x26')]=function(_0x597117,_0x450859){var _0x4bb6f3={},_0x4181a4={},_0x289649={'count':0x0,'rows':[]};var _0x4be4f8=_['map'](db[_0x20de('0x27')][_0x20de('0x28')],function(_0x2d4c14){return{'name':_0x2d4c14[_0x20de('0x29')],'type':_0x2d4c14[_0x20de('0x2a')][_0x20de('0x2b')]};});_0x4181a4[_0x20de('0x2c')]=_[_0x20de('0x2d')](_0x4be4f8,_0x20de('0x24'));_0x4181a4[_0x20de('0x2e')]=_[_0x20de('0x2f')](_0x597117[_0x20de('0x2e')]);_0x4181a4[_0x20de('0x30')]=_['intersection'](_0x4181a4[_0x20de('0x2c')],_0x4181a4[_0x20de('0x2e')]);_0x4bb6f3['attributes']=_[_0x20de('0x31')](_0x4181a4[_0x20de('0x2c')],qs[_0x20de('0x32')](_0x597117[_0x20de('0x2e')][_0x20de('0x32')]));_0x4bb6f3[_0x20de('0x33')]=_0x4bb6f3[_0x20de('0x33')]['length']?_0x4bb6f3[_0x20de('0x33')]:_0x4181a4[_0x20de('0x2c')];if(!_0x597117[_0x20de('0x2e')][_0x20de('0x34')]('nolimit')){_0x4bb6f3['limit']=qs[_0x20de('0x1f')](_0x597117['query'][_0x20de('0x1f')]);_0x4bb6f3[_0x20de('0x1d')]=qs[_0x20de('0x1d')](_0x597117[_0x20de('0x2e')][_0x20de('0x1d')]);}_0x4bb6f3[_0x20de('0x35')]=qs[_0x20de('0x36')](_0x597117['query'][_0x20de('0x36')]);_0x4bb6f3[_0x20de('0x37')]=qs[_0x20de('0x30')](_[_0x20de('0x38')](_0x597117[_0x20de('0x2e')],_0x4181a4['filters']),_0x4be4f8);if(_0x597117['query'][_0x20de('0x39')]){_0x4bb6f3[_0x20de('0x37')]=_[_0x20de('0x3a')](_0x4bb6f3['where'],{'$or':_[_0x20de('0x2d')](_0x4be4f8,function(_0x3390fa){if(_0x3390fa[_0x20de('0x2a')]!==_0x20de('0x3b')){var _0x2942ac={};_0x2942ac[_0x3390fa[_0x20de('0x24')]]={'$like':'%'+_0x597117[_0x20de('0x2e')]['filter']+'%'};return _0x2942ac;}})});}_0x4bb6f3=_[_0x20de('0x3a')]({},_0x4bb6f3,_0x597117[_0x20de('0x3c')]);var _0xbdc5f6={'where':_0x4bb6f3[_0x20de('0x37')]};return db[_0x20de('0x27')][_0x20de('0x20')](_0xbdc5f6)[_0x20de('0x3d')](function(_0x346f38){_0x289649[_0x20de('0x20')]=_0x346f38;if(_0x597117[_0x20de('0x2e')][_0x20de('0x3e')]){_0x4bb6f3[_0x20de('0x3f')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x4bb6f3);})[_0x20de('0x3d')](function(_0x24563e){_0x289649['rows']=_0x24563e;return _0x289649;})[_0x20de('0x3d')](respondWithFilteredResult(_0x450859,_0x4bb6f3))['catch'](handleError(_0x450859,null));};exports[_0x20de('0x40')]=function(_0x598f3e,_0x4925f7){var _0x4e426e={'raw':![],'where':{'id':_0x598f3e[_0x20de('0x41')]['id']}},_0x1f34fb={};_0x1f34fb['model']=_[_0x20de('0x2f')](db['Automation']['rawAttributes']);_0x1f34fb['query']=_[_0x20de('0x2f')](_0x598f3e[_0x20de('0x2e')]);_0x1f34fb[_0x20de('0x30')]=_[_0x20de('0x31')](_0x1f34fb[_0x20de('0x2c')],_0x1f34fb['query']);_0x4e426e['attributes']=_[_0x20de('0x31')](_0x1f34fb[_0x20de('0x2c')],qs[_0x20de('0x32')](_0x598f3e[_0x20de('0x2e')]['fields']));_0x4e426e[_0x20de('0x33')]=_0x4e426e[_0x20de('0x33')]['length']?_0x4e426e['attributes']:_0x1f34fb[_0x20de('0x2c')];if(_0x598f3e[_0x20de('0x2e')][_0x20de('0x3e')]){_0x4e426e['include']=[{'all':!![]}];}_0x4e426e=_[_0x20de('0x3a')]({},_0x4e426e,_0x598f3e[_0x20de('0x3c')]);return db[_0x20de('0x27')][_0x20de('0x42')](_0x4e426e)[_0x20de('0x3d')](handleEntityNotFound(_0x4925f7,null))['then'](respondWithResult(_0x4925f7,null))[_0x20de('0x43')](handleError(_0x4925f7,null));};exports['create']=function(_0x46b9f5,_0xedc812){return db[_0x20de('0x27')][_0x20de('0x44')](_0x46b9f5[_0x20de('0x45')],{})[_0x20de('0x3d')](respondWithResult(_0xedc812,0xc9))[_0x20de('0x43')](handleError(_0xedc812,null));};exports[_0x20de('0x46')]=function(_0x41d9e1,_0x270b16){if(_0x41d9e1[_0x20de('0x45')]['id']){delete _0x41d9e1[_0x20de('0x45')]['id'];}return db['Automation'][_0x20de('0x42')]({'where':{'id':_0x41d9e1[_0x20de('0x41')]['id']}})['then'](handleEntityNotFound(_0x270b16,null))[_0x20de('0x3d')](saveUpdates(_0x41d9e1[_0x20de('0x45')],null))['then'](respondWithResult(_0x270b16,null))[_0x20de('0x43')](handleError(_0x270b16,null));};exports[_0x20de('0x47')]=function(_0x7279e3,_0x313839){return db[_0x20de('0x27')][_0x20de('0x42')]({'where':{'id':_0x7279e3[_0x20de('0x41')]['id']}})['then'](handleEntityNotFound(_0x313839,null))[_0x20de('0x3d')](removeEntity(_0x313839,null))[_0x20de('0x43')](handleError(_0x313839,null));};exports[_0x20de('0x48')]=function(_0x5b8e38,_0x3e50dd,_0x21fc6d){return db[_0x20de('0x49')][_0x20de('0x42')]({'where':{'id':_0x5b8e38[_0x20de('0x41')]['id']}})[_0x20de('0x3d')](handleEntityNotFound(_0x3e50dd,null))[_0x20de('0x3d')](function(_0x14e091){if(_0x14e091){return _0x14e091[_0x20de('0x48')](_0x5b8e38['body'][_0x20de('0x4a')],_[_0x20de('0x4b')](_0x5b8e38[_0x20de('0x45')],['ids','id'])||{});}})[_0x20de('0x3d')](respondWithResult(_0x3e50dd,null))[_0x20de('0x43')](handleError(_0x3e50dd,null));};exports[_0x20de('0x4c')]=function(_0x1d648b,_0x9bc4de,_0x637fc6){var _0x1e0deb={};var _0x2e70fc={};var _0x150c5d;var _0x3b7627;return db['Automation']['findOne']({'where':{'id':_0x1d648b['params']['id']}})[_0x20de('0x3d')](handleEntityNotFound(_0x9bc4de,null))['then'](function(_0x1b5bc5){if(_0x1b5bc5){_0x150c5d=_0x1b5bc5;_0x2e70fc[_0x20de('0x2c')]=_[_0x20de('0x2f')](db[_0x20de('0x49')][_0x20de('0x28')]);_0x2e70fc[_0x20de('0x2e')]=_['keys'](_0x1d648b[_0x20de('0x2e')]);_0x2e70fc[_0x20de('0x30')]=_[_0x20de('0x31')](_0x2e70fc[_0x20de('0x2c')],_0x2e70fc['query']);_0x1e0deb[_0x20de('0x33')]=_['intersection'](_0x2e70fc['model'],qs[_0x20de('0x32')](_0x1d648b[_0x20de('0x2e')][_0x20de('0x32')]));_0x1e0deb['attributes']=_0x1e0deb[_0x20de('0x33')][_0x20de('0x4d')]?_0x1e0deb['attributes']:_0x2e70fc[_0x20de('0x2c')];_0x1e0deb[_0x20de('0x35')]=qs[_0x20de('0x36')](_0x1d648b[_0x20de('0x2e')][_0x20de('0x36')]);_0x1e0deb[_0x20de('0x37')]=qs[_0x20de('0x30')](_['pick'](_0x1d648b['query'],_0x2e70fc['filters']));if(_0x1d648b[_0x20de('0x2e')][_0x20de('0x39')]){_0x1e0deb[_0x20de('0x37')]=_[_0x20de('0x3a')](_0x1e0deb[_0x20de('0x37')],{'$or':_['map'](_0x1e0deb[_0x20de('0x33')],function(_0x1fc2ba){var _0x2da60e={};_0x2da60e[_0x1fc2ba]={'$like':'%'+_0x1d648b[_0x20de('0x2e')][_0x20de('0x39')]+'%'};return _0x2da60e;})});}_0x1e0deb=_['merge']({},_0x1e0deb,_0x1d648b['options']);return _0x150c5d[_0x20de('0x4c')](_0x1e0deb);}})[_0x20de('0x3d')](function(_0x436cd7){if(_0x436cd7){_0x3b7627=_0x436cd7[_0x20de('0x4d')];if(!_0x1d648b['query'][_0x20de('0x34')]('nolimit')){_0x1e0deb[_0x20de('0x1f')]=qs[_0x20de('0x1f')](_0x1d648b[_0x20de('0x2e')]['limit']);_0x1e0deb[_0x20de('0x1d')]=qs[_0x20de('0x1d')](_0x1d648b['query']['offset']);}return _0x150c5d[_0x20de('0x4c')](_0x1e0deb);}})[_0x20de('0x3d')](function(_0x1d65a7){if(_0x1d65a7){return _0x1d65a7?{'count':_0x3b7627,'rows':_0x1d65a7}:null;}})['then'](respondWithResult(_0x9bc4de,null))[_0x20de('0x43')](handleError(_0x9bc4de,null));};exports['addActions']=function(_0x40841c,_0x457e88,_0x2d41cc){return db['Action']['find']({'where':{'id':_0x40841c[_0x20de('0x41')]['id']}})[_0x20de('0x3d')](handleEntityNotFound(_0x457e88,null))['then'](function(_0x4263ab){if(_0x4263ab){return _0x4263ab[_0x20de('0x4e')](_0x40841c['body']['ids'],_[_0x20de('0x4b')](_0x40841c[_0x20de('0x45')],[_0x20de('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x457e88,null))['catch'](handleError(_0x457e88,null));};exports[_0x20de('0x4f')]=function(_0x269e5a,_0xe63598,_0x169b83){var _0x538234={};var _0x2b3dae={};var _0x5f46d4;var _0x11cc18;return db[_0x20de('0x27')][_0x20de('0x50')]({'where':{'id':_0x269e5a[_0x20de('0x41')]['id']}})['then'](handleEntityNotFound(_0xe63598,null))['then'](function(_0x357fff){if(_0x357fff){_0x5f46d4=_0x357fff;_0x2b3dae[_0x20de('0x2c')]=_[_0x20de('0x2f')](db[_0x20de('0x51')][_0x20de('0x28')]);_0x2b3dae[_0x20de('0x2e')]=_[_0x20de('0x2f')](_0x269e5a['query']);_0x2b3dae['filters']=_[_0x20de('0x31')](_0x2b3dae[_0x20de('0x2c')],_0x2b3dae['query']);_0x538234[_0x20de('0x33')]=_[_0x20de('0x31')](_0x2b3dae[_0x20de('0x2c')],qs[_0x20de('0x32')](_0x269e5a['query'][_0x20de('0x32')]));_0x538234[_0x20de('0x33')]=_0x538234[_0x20de('0x33')][_0x20de('0x4d')]?_0x538234[_0x20de('0x33')]:_0x2b3dae[_0x20de('0x2c')];_0x538234[_0x20de('0x35')]=qs[_0x20de('0x36')](_0x269e5a[_0x20de('0x2e')][_0x20de('0x36')]);_0x538234[_0x20de('0x37')]=qs[_0x20de('0x30')](_[_0x20de('0x38')](_0x269e5a[_0x20de('0x2e')],_0x2b3dae[_0x20de('0x30')]));if(_0x269e5a['query'][_0x20de('0x39')]){_0x538234[_0x20de('0x37')]=_[_0x20de('0x3a')](_0x538234[_0x20de('0x37')],{'$or':_['map'](_0x538234[_0x20de('0x33')],function(_0x327499){var _0x2139c5={};_0x2139c5[_0x327499]={'$like':'%'+_0x269e5a[_0x20de('0x2e')]['filter']+'%'};return _0x2139c5;})});}_0x538234=_[_0x20de('0x3a')]({},_0x538234,_0x269e5a[_0x20de('0x3c')]);return _0x5f46d4[_0x20de('0x4f')](_0x538234);}})['then'](function(_0x8cc103){if(_0x8cc103){_0x11cc18=_0x8cc103[_0x20de('0x4d')];if(!_0x269e5a[_0x20de('0x2e')][_0x20de('0x34')]('nolimit')){_0x538234[_0x20de('0x1f')]=qs[_0x20de('0x1f')](_0x269e5a[_0x20de('0x2e')][_0x20de('0x1f')]);_0x538234['offset']=qs[_0x20de('0x1d')](_0x269e5a['query'][_0x20de('0x1d')]);}return _0x5f46d4['getActions'](_0x538234);}})[_0x20de('0x3d')](function(_0x14bfd4){if(_0x14bfd4){return _0x14bfd4?{'count':_0x11cc18,'rows':_0x14bfd4}:null;}})[_0x20de('0x3d')](respondWithResult(_0xe63598,null))[_0x20de('0x43')](handleError(_0xe63598,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index f2c7cb8..c688717 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 _0x4af9=['api','moment','request-promise','rimraf','exports','define','Automation','tools_automations','lodash','../../config/logger'];(function(_0x275621,_0x524302){var _0x2ad056=function(_0x1e962f){while(--_0x1e962f){_0x275621['push'](_0x275621['shift']());}};_0x2ad056(++_0x524302);}(_0x4af9,0xda));var _0x94af=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4af9[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x94af('0x0'));var util=require('util');var logger=require(_0x94af('0x1'))(_0x94af('0x2'));var moment=require(_0x94af('0x3'));var BPromise=require('bluebird');var rp=require(_0x94af('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x94af('0x5'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0x94af('0x6')]=function(_0x354c4b,_0x222989){return _0x354c4b[_0x94af('0x7')](_0x94af('0x8'),attributes,{'tableName':_0x94af('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ff7=['exports','define','tools_automations','../../config/logger','api','moment','bluebird','request-promise','./automation.attributes'];(function(_0x42c761,_0x4c8585){var _0x5af01f=function(_0x2b55fd){while(--_0x2b55fd){_0x42c761['push'](_0x42c761['shift']());}};_0x5af01f(++_0x4c8585);}(_0x9ff7,0x1bc));var _0x79ff=function(_0x3ae8fe,_0x428c4d){_0x3ae8fe=_0x3ae8fe-0x0;var _0x4edfe9=_0x9ff7[_0x3ae8fe];return _0x4edfe9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x79ff('0x0'))(_0x79ff('0x1'));var moment=require(_0x79ff('0x2'));var BPromise=require(_0x79ff('0x3'));var rp=require(_0x79ff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x79ff('0x5'));module[_0x79ff('0x6')]=function(_0x436b06,_0x34f00d){return _0x436b06[_0x79ff('0x7')]('Automation',attributes,{'tableName':_0x79ff('0x8'),'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 ee1218c..da9819b 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 _0xb03e=['debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Automation,\x20%s,\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb03e,0x1eb));var _0xeb03=function(_0x146ebc,_0x1124d0){_0x146ebc=_0x146ebc-0x0;var _0x22c869=_0xb03e[_0x146ebc];return _0x22c869;};'use strict';var _=require('lodash');var util=require(_0xeb03('0x0'));var moment=require(_0xeb03('0x1'));var BPromise=require(_0xeb03('0x2'));var rs=require(_0xeb03('0x3'));var fs=require('fs');var Redis=require(_0xeb03('0x4'));var db=require(_0xeb03('0x5'))['db'];var utils=require(_0xeb03('0x6'));var logger=require(_0xeb03('0x7'))(_0xeb03('0x8'));var config=require(_0xeb03('0x9'));var jayson=require(_0xeb03('0xa'));var client=jayson[_0xeb03('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b58a2,_0x3d3322,_0x3a6e31){return new BPromise(function(_0x246c6e,_0x3f2c74){return client[_0xeb03('0xc')](_0x3b58a2,_0x3a6e31)['then'](function(_0x403b77){logger[_0xeb03('0xd')](_0xeb03('0xe'),_0x3d3322,'request\x20sent');logger[_0xeb03('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x3d3322,_0xeb03('0x10'),JSON[_0xeb03('0x11')](_0x403b77));if(_0x403b77[_0xeb03('0x12')]){if(_0x403b77[_0xeb03('0x12')][_0xeb03('0x13')]===0x1f4){logger[_0xeb03('0x12')](_0xeb03('0xe'),_0x3d3322,_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);return _0x3f2c74(_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);}logger[_0xeb03('0x12')]('Automation,\x20%s,\x20%s',_0x3d3322,_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);return _0x246c6e(_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);}else{logger['info'](_0xeb03('0xe'),_0x3d3322,_0xeb03('0x10'));_0x246c6e(_0x403b77[_0xeb03('0x15')]['message']);}})[_0xeb03('0x16')](function(_0x46dd1b){logger[_0xeb03('0x12')](_0xeb03('0xe'),_0x3d3322,_0x46dd1b);_0x3f2c74(_0x46dd1b);});});}
\ No newline at end of file
+var _0x29b6=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x14df77,_0x46aedb){var _0x3a9e30=function(_0x1e5da2){while(--_0x1e5da2){_0x14df77['push'](_0x14df77['shift']());}};_0x3a9e30(++_0x46aedb);}(_0x29b6,0x17e));var _0x629b=function(_0xee5490,_0x9ae8dc){_0xee5490=_0xee5490-0x0;var _0x50de55=_0x29b6[_0xee5490];return _0x50de55;};'use strict';var _=require(_0x629b('0x0'));var util=require(_0x629b('0x1'));var moment=require(_0x629b('0x2'));var BPromise=require(_0x629b('0x3'));var rs=require(_0x629b('0x4'));var fs=require('fs');var Redis=require(_0x629b('0x5'));var db=require(_0x629b('0x6'))['db'];var utils=require(_0x629b('0x7'));var logger=require(_0x629b('0x8'))(_0x629b('0x9'));var config=require('../../config/environment');var jayson=require(_0x629b('0xa'));var client=jayson['client'][_0x629b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4acc5a,_0x26e439,_0x398ecb){return new BPromise(function(_0x4e90cd,_0xc44b27){return client[_0x629b('0xc')](_0x4acc5a,_0x398ecb)['then'](function(_0x28c152){logger[_0x629b('0xd')](_0x629b('0xe'),_0x26e439,_0x629b('0xf'));logger[_0x629b('0x10')](_0x629b('0x11'),_0x26e439,_0x629b('0xf'),JSON[_0x629b('0x12')](_0x28c152));if(_0x28c152[_0x629b('0x13')]){if(_0x28c152[_0x629b('0x13')]['code']===0x1f4){logger['error'](_0x629b('0xe'),_0x26e439,_0x28c152[_0x629b('0x13')][_0x629b('0x14')]);return _0xc44b27(_0x28c152['error'][_0x629b('0x14')]);}logger[_0x629b('0x13')](_0x629b('0xe'),_0x26e439,_0x28c152[_0x629b('0x13')]['message']);return _0x4e90cd(_0x28c152[_0x629b('0x13')][_0x629b('0x14')]);}else{logger[_0x629b('0xd')](_0x629b('0xe'),_0x26e439,_0x629b('0xf'));_0x4e90cd(_0x28c152['result'][_0x629b('0x14')]);}})['catch'](function(_0x151b93){logger[_0x629b('0x13')](_0x629b('0xe'),_0x26e439,_0x151b93);_0xc44b27(_0x151b93);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 25e6e75..66ffdea 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 _0x7df1=['/:id/actions','post','/:id/conditions','put','/:id','update','delete','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','get','show','getConditions'];(function(_0x3dacef,_0x513c82){var _0x14e9b5=function(_0xb1ba8c){while(--_0xb1ba8c){_0x3dacef['push'](_0x3dacef['shift']());}};_0x14e9b5(++_0x513c82);}(_0x7df1,0xe4));var _0x17df=function(_0x3d8b32,_0x5381e0){_0x3d8b32=_0x3d8b32-0x0;var _0xf081c3=_0x7df1[_0x3d8b32];return _0xf081c3;};'use strict';var multer=require(_0x17df('0x0'));var util=require(_0x17df('0x1'));var path=require(_0x17df('0x2'));var timeout=require('connect-timeout');var express=require(_0x17df('0x3'));var router=express[_0x17df('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x17df('0x5'));var config=require(_0x17df('0x6'));var controller=require(_0x17df('0x7'));router['get']('/',auth[_0x17df('0x8')](),controller['index']);router[_0x17df('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x17df('0xa')]);router[_0x17df('0x9')]('/:id/conditions',auth[_0x17df('0x8')](),controller[_0x17df('0xb')]);router[_0x17df('0x9')](_0x17df('0xc'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth[_0x17df('0x8')](),controller['create']);router[_0x17df('0xd')](_0x17df('0xe'),auth['isAuthenticated'](),controller['addConditions']);router[_0x17df('0xd')](_0x17df('0xc'),auth[_0x17df('0x8')](),controller['addActions']);router[_0x17df('0xf')](_0x17df('0x10'),auth[_0x17df('0x8')](),controller[_0x17df('0x11')]);router[_0x17df('0x12')](_0x17df('0x10'),auth[_0x17df('0x8')](),controller[_0x17df('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xe2cc=['/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get'];(function(_0x1530a4,_0x5abb24){var _0x53cda2=function(_0x4a42c0){while(--_0x4a42c0){_0x1530a4['push'](_0x1530a4['shift']());}};_0x53cda2(++_0x5abb24);}(_0xe2cc,0x69));var _0xce2c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe2cc[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xce2c('0x0'));var util=require(_0xce2c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xce2c('0x2'));var router=express[_0xce2c('0x3')]();var fs_extra=require(_0xce2c('0x4'));var auth=require(_0xce2c('0x5'));var interaction=require(_0xce2c('0x6'));var config=require(_0xce2c('0x7'));var controller=require(_0xce2c('0x8'));router[_0xce2c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xce2c('0x9')](_0xce2c('0xa'),auth[_0xce2c('0xb')](),controller[_0xce2c('0xc')]);router[_0xce2c('0x9')](_0xce2c('0xd'),auth['isAuthenticated'](),controller[_0xce2c('0xe')]);router[_0xce2c('0x9')](_0xce2c('0xf'),auth[_0xce2c('0xb')](),controller[_0xce2c('0x10')]);router[_0xce2c('0x11')]('/',auth[_0xce2c('0xb')](),controller[_0xce2c('0x12')]);router[_0xce2c('0x11')](_0xce2c('0xd'),auth[_0xce2c('0xb')](),controller[_0xce2c('0x13')]);router[_0xce2c('0x11')](_0xce2c('0xf'),auth[_0xce2c('0xb')](),controller['addActions']);router['put'](_0xce2c('0xa'),auth['isAuthenticated'](),controller[_0xce2c('0x14')]);router[_0xce2c('0x15')](_0xce2c('0xa'),auth[_0xce2c('0xb')](),controller['destroy']);module[_0xce2c('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 73e26ed..43ff91b 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 _0xf9ae=['onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','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)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','name','ENUM','ivr','STRING','BOOLEAN','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)','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,*,*,*','never'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xf9ae,0x19b));var _0xef9a=function(_0x5c77b1,_0x180269){_0x5c77b1=_0x5c77b1-0x0;var _0x401464=_0xf9ae[_0x5c77b1];return _0x401464;};'use strict';var Sequelize=require('sequelize');module[_0xef9a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xef9a('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xef9a('0x2')](_0xef9a('0x3')),'allowNull':![],'defaultValue':_0xef9a('0x3')},'description':{'type':Sequelize[_0xef9a('0x4')]},'active':{'type':Sequelize[_0xef9a('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xef9a('0x6')](0x4)[_0xef9a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xef9a('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xef9a('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0xef9a('0x6')](0x3)[_0xef9a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef9a('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xef9a('0x6')](0x3)[_0xef9a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xef9a('0x6')](0x5)[_0xef9a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef9a('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xef9a('0x6')](0x3)[_0xef9a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef9a('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xef9a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef9a('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xef9a('0x6')](0x3)[_0xef9a('0x7')],'defaultValue':0x3,'comment':_0xef9a('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xef9a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef9a('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xef9a('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xef9a('0xf')},'dialTimezone':{'type':Sequelize[_0xef9a('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xef9a('0x4')],'defaultValue':_0xef9a('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xef9a('0x2')]('always',_0xef9a('0x11'),_0xef9a('0x12')),'defaultValue':_0xef9a('0x13')},'dialAMDActive':{'type':Sequelize[_0xef9a('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xef9a('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xef9a('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xef9a('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xef9a('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xef9a('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xef9a('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xef9a('0x6')](0x9)[_0xef9a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xef9a('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xef9a('0x6')](0x9)[_0xef9a('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xef9a('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xef9a('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xef9a('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xef9a('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xef9a('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xef9a('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xef9a('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xef9a('0x6')](0x9)[_0xef9a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xef9a('0x2')]('DESC',_0xef9a('0x1c')),'defaultValue':_0xef9a('0x1d')},'dialPrefix':{'type':Sequelize[_0xef9a('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xef9a('0x6')](0x3)[_0xef9a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xef9a('0x1e')},'dialCutDigit':{'type':Sequelize[_0xef9a('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xef9a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xef9a('0x6')](0x5)[_0xef9a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef9a('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xef9a('0x6')](0x3)[_0xef9a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef9a('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xef9a('0x6')](0x5)[_0xef9a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef9a('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xef9a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef9a('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xef9a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef9a('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xef9a('0x6')](0x3)[_0xef9a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef9a('0x24')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xef9a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef9a('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xef9a('0x6')](0x3)[_0xef9a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef9a('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xef9a('0x6')](0x5)[_0xef9a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0xf603=['always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\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','STRING','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#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,*,*,*','onlyIfOpen'];(function(_0x48881c,_0x2e5317){var _0x443406=function(_0x5ce5e8){while(--_0x5ce5e8){_0x48881c['push'](_0x48881c['shift']());}};_0x443406(++_0x2e5317);}(_0xf603,0xeb));var _0x3f60=function(_0xd303ff,_0x45dae0){_0xd303ff=_0xd303ff-0x0;var _0x52b270=_0xf603[_0xd303ff];return _0x52b270;};'use strict';var Sequelize=require(_0x3f60('0x0'));module[_0x3f60('0x1')]={'name':{'type':Sequelize[_0x3f60('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x3f60('0x3')](_0x3f60('0x4')),'allowNull':![],'defaultValue':_0x3f60('0x4')},'description':{'type':Sequelize[_0x3f60('0x2')]},'active':{'type':Sequelize[_0x3f60('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x3f60('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x3f60('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3f60('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x3f60('0x6')](0x3)[_0x3f60('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f60('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3f60('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f60('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3f60('0x6')](0x5)[_0x3f60('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f60('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f60('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3f60('0x6')](0x5)[_0x3f60('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3f60('0x6')](0x3)[_0x3f60('0x7')],'defaultValue':0x3,'comment':_0x3f60('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3f60('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f60('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3f60('0x6')](0x3)[_0x3f60('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3f60('0xe')},'dialTimezone':{'type':Sequelize[_0x3f60('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3f60('0x2')],'defaultValue':_0x3f60('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never',_0x3f60('0x10')),'defaultValue':_0x3f60('0x11')},'dialAMDActive':{'type':Sequelize[_0x3f60('0x5')],'defaultValue':0x0,'comment':_0x3f60('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x3f60('0x6')](0x9)[_0x3f60('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3f60('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x3f60('0x6')](0x9)[_0x3f60('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3f60('0x6')](0x9)[_0x3f60('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3f60('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3f60('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x3f60('0x6')](0x9)[_0x3f60('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3f60('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3f60('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3f60('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3f60('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3f60('0x6')](0x5)[_0x3f60('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3f60('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3f60('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3f60('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3f60('0x3')](_0x3f60('0x19'),_0x3f60('0x1a')),'defaultValue':_0x3f60('0x19')},'dialPrefix':{'type':Sequelize[_0x3f60('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3f60('0x6')](0x3)[_0x3f60('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3f60('0x1b')},'dialCutDigit':{'type':Sequelize[_0x3f60('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3f60('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3f60('0x6')](0x3)[_0x3f60('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f60('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3f60('0x6')](0x5)[_0x3f60('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x3f60('0x6')](0x3)[_0x3f60('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f60('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3f60('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f60('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3f60('0x6')](0x5)[_0x3f60('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f60('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x3f60('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3f60('0x21')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3f60('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f60('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3f60('0x6')](0x3)[_0x3f60('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3f60('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3f60('0x23')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index a75c7a8..3bbf6ec 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 _0x1596=['UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','getHoppers','findOne','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','phone','ListId','field','NOW()','ContactId','toString','from','cm_contacts','CmListId','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','fromQuery','scheduledAt','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CampaignId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','CmHopper','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','reject','save','update','then','destroy','IvrCampaigns','error','name','send','index','map','Campaign','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x1596,0x16f));var _0x6159=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1596[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x6159('0x0'));var rimraf=require(_0x6159('0x1'));var zipdir=require(_0x6159('0x2'));var jsonpatch=require(_0x6159('0x3'));var rp=require('request-promise');var moment=require(_0x6159('0x4'));var BPromise=require(_0x6159('0x5'));var Mustache=require(_0x6159('0x6'));var util=require('util');var path=require(_0x6159('0x7'));var sox=require(_0x6159('0x8'));var csv=require(_0x6159('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6159('0xa'));var _=require(_0x6159('0xb'));var squel=require(_0x6159('0xc'));var crypto=require(_0x6159('0xd'));var jsforce=require(_0x6159('0xe'));var deskjs=require(_0x6159('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6159('0x10'));var Papa=require('papaparse');var Redis=require(_0x6159('0x11'));var authService=require(_0x6159('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6159('0x13'));var hardwareService=require(_0x6159('0x14'));var logger=require(_0x6159('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6159('0x16'));var licenseUtil=require(_0x6159('0x17'));var db=require(_0x6159('0x18'))['db'];function respondWithStatusCode(_0x366dda,_0x2864b5){_0x2864b5=_0x2864b5||0xcc;return function(_0x2d2f8b){if(_0x2d2f8b){return _0x366dda[_0x6159('0x19')](_0x2864b5);}return _0x366dda[_0x6159('0x1a')](_0x2864b5)[_0x6159('0x1b')]();};}function respondWithResult(_0x17cb83,_0x2e0cd9){_0x2e0cd9=_0x2e0cd9||0xc8;return function(_0x1c50e5){if(_0x1c50e5){return _0x17cb83[_0x6159('0x1a')](_0x2e0cd9)[_0x6159('0x1c')](_0x1c50e5);}};}function respondWithFilteredResult(_0x3572c0,_0xe3f67d){return function(_0x210fe8){if(_0x210fe8){var _0x35b27c=typeof _0xe3f67d['offset']==='undefined'&&typeof _0xe3f67d[_0x6159('0x1d')]===_0x6159('0x1e');var _0x143c7f=_0x210fe8['count'];var _0x368d1f=_0x35b27c?0x0:_0xe3f67d[_0x6159('0x1f')];var _0x141199=_0x35b27c?_0x210fe8[_0x6159('0x20')]:_0xe3f67d['offset']+_0xe3f67d[_0x6159('0x1d')];var _0x47deee;if(_0x141199>=_0x143c7f){_0x141199=_0x143c7f;_0x47deee=0xc8;}else{_0x47deee=0xce;}_0x3572c0[_0x6159('0x1a')](_0x47deee);return _0x3572c0[_0x6159('0x21')](_0x6159('0x22'),_0x368d1f+'-'+_0x141199+'/'+_0x143c7f)['json'](_0x210fe8);}return null;};}function patchUpdates(_0x54f210){return function(_0x2ece57){try{jsonpatch['apply'](_0x2ece57,_0x54f210,!![]);}catch(_0x31dd68){return BPromise[_0x6159('0x23')](_0x31dd68);}return _0x2ece57[_0x6159('0x24')]();};}function saveUpdates(_0x1f1ec5,_0x4a0863){return function(_0x1fe11d){if(_0x1fe11d){return _0x1fe11d[_0x6159('0x25')](_0x1f1ec5)[_0x6159('0x26')](function(_0x130d73){return _0x130d73;});}return null;};}function removeEntity(_0xba9d9,_0x29024f){return function(_0x5685a7){if(_0x5685a7){return _0x5685a7[_0x6159('0x27')]()['then'](function(){var _0x478722=_0x5685a7['get']({'plain':!![]});var _0x4bf0c1=_0x6159('0x28');return db['UserProfileResource'][_0x6159('0x27')]({'where':{'type':_0x4bf0c1,'resourceId':_0x478722['id']}})['then'](function(){return _0x5685a7;});})[_0x6159('0x26')](function(){_0xba9d9[_0x6159('0x1a')](0xcc)[_0x6159('0x1b')]();});}};}function handleEntityNotFound(_0x4059ef,_0x587247){return function(_0x524354){if(!_0x524354){_0x4059ef[_0x6159('0x19')](0x194);}return _0x524354;};}function handleError(_0x7167b4,_0x26a959){_0x26a959=_0x26a959||0x1f4;return function(_0x4fa594){logger[_0x6159('0x29')](_0x4fa594['stack']);if(_0x4fa594[_0x6159('0x2a')]){delete _0x4fa594[_0x6159('0x2a')];}_0x7167b4[_0x6159('0x1a')](_0x26a959)[_0x6159('0x2b')](_0x4fa594);};}exports[_0x6159('0x2c')]=function(_0x16545b,_0x426411){var _0x351ff2={},_0x142c8c={},_0x843b6b={'count':0x0,'rows':[]};var _0x4cd683=_[_0x6159('0x2d')](db[_0x6159('0x2e')][_0x6159('0x2f')],function(_0x17d2b0){return{'name':_0x17d2b0['fieldName'],'type':_0x17d2b0['type'][_0x6159('0x30')]};});_0x142c8c[_0x6159('0x31')]=_[_0x6159('0x2d')](_0x4cd683,_0x6159('0x2a'));_0x142c8c['query']=_[_0x6159('0x32')](_0x16545b[_0x6159('0x33')]);_0x142c8c[_0x6159('0x34')]=_[_0x6159('0x35')](_0x142c8c['model'],_0x142c8c[_0x6159('0x33')]);_0x351ff2[_0x6159('0x36')]=_[_0x6159('0x35')](_0x142c8c[_0x6159('0x31')],qs[_0x6159('0x37')](_0x16545b[_0x6159('0x33')][_0x6159('0x37')]));_0x351ff2[_0x6159('0x36')]=_0x351ff2[_0x6159('0x36')][_0x6159('0x38')]?_0x351ff2[_0x6159('0x36')]:_0x142c8c[_0x6159('0x31')];if(!_0x16545b[_0x6159('0x33')][_0x6159('0x39')](_0x6159('0x3a'))){_0x351ff2[_0x6159('0x1d')]=qs['limit'](_0x16545b[_0x6159('0x33')][_0x6159('0x1d')]);_0x351ff2[_0x6159('0x1f')]=qs[_0x6159('0x1f')](_0x16545b[_0x6159('0x33')][_0x6159('0x1f')]);}_0x351ff2[_0x6159('0x3b')]=qs[_0x6159('0x3c')](_0x16545b[_0x6159('0x33')][_0x6159('0x3c')]);_0x351ff2['where']=qs[_0x6159('0x34')](_['pick'](_0x16545b['query'],_0x142c8c[_0x6159('0x34')]),_0x4cd683);if(_0x16545b['query'][_0x6159('0x3d')]){_0x351ff2[_0x6159('0x3e')]=_['merge'](_0x351ff2[_0x6159('0x3e')],{'$or':_[_0x6159('0x2d')](_0x4cd683,function(_0x5b4420){if(_0x5b4420[_0x6159('0x3f')]!==_0x6159('0x40')){var _0x9e93c4={};_0x9e93c4[_0x5b4420[_0x6159('0x2a')]]={'$like':'%'+_0x16545b['query'][_0x6159('0x3d')]+'%'};return _0x9e93c4;}})});}_0x351ff2=_[_0x6159('0x41')]({},_0x351ff2,_0x16545b[_0x6159('0x42')]);var _0x4e3e2e={'where':_0x351ff2[_0x6159('0x3e')]};return db[_0x6159('0x2e')][_0x6159('0x20')](_0x4e3e2e)[_0x6159('0x26')](function(_0x4f26d3){_0x843b6b['count']=_0x4f26d3;if(_0x16545b[_0x6159('0x33')][_0x6159('0x43')]){_0x351ff2[_0x6159('0x44')]=[{'all':!![]}];}return db[_0x6159('0x2e')][_0x6159('0x45')](_0x351ff2);})['then'](function(_0x6bfa40){_0x843b6b[_0x6159('0x46')]=_0x6bfa40;return _0x843b6b;})[_0x6159('0x26')](respondWithFilteredResult(_0x426411,_0x351ff2))[_0x6159('0x47')](handleError(_0x426411,null));};exports['show']=function(_0x453107,_0x312906){var _0x54a6f4={'raw':![],'where':{'id':_0x453107[_0x6159('0x48')]['id']}},_0x3b9f46={};_0x3b9f46[_0x6159('0x31')]=_[_0x6159('0x32')](db[_0x6159('0x2e')][_0x6159('0x2f')]);_0x3b9f46[_0x6159('0x33')]=_[_0x6159('0x32')](_0x453107[_0x6159('0x33')]);_0x3b9f46[_0x6159('0x34')]=_['intersection'](_0x3b9f46['model'],_0x3b9f46[_0x6159('0x33')]);_0x54a6f4[_0x6159('0x36')]=_[_0x6159('0x35')](_0x3b9f46[_0x6159('0x31')],qs['fields'](_0x453107[_0x6159('0x33')][_0x6159('0x37')]));_0x54a6f4[_0x6159('0x36')]=_0x54a6f4[_0x6159('0x36')][_0x6159('0x38')]?_0x54a6f4[_0x6159('0x36')]:_0x3b9f46[_0x6159('0x31')];if(_0x453107[_0x6159('0x33')][_0x6159('0x43')]){_0x54a6f4[_0x6159('0x44')]=[{'all':!![]}];}_0x54a6f4=_[_0x6159('0x41')]({},_0x54a6f4,_0x453107[_0x6159('0x42')]);return db[_0x6159('0x2e')][_0x6159('0x49')](_0x54a6f4)['then'](handleEntityNotFound(_0x312906,null))[_0x6159('0x26')](respondWithResult(_0x312906,null))['catch'](handleError(_0x312906,null));};exports[_0x6159('0x4a')]=function(_0x4d581f,_0x45e002){return db['Campaign']['create'](_0x4d581f[_0x6159('0x4b')],{})['then'](function(_0x36b3b8){var _0x3ff676=_0x4d581f[_0x6159('0x4c')][_0x6159('0x4d')]({'plain':!![]});if(!_0x3ff676)throw new Error(_0x6159('0x4e'));if(_0x3ff676[_0x6159('0x4f')]===_0x6159('0x4c')){var _0x534864=_0x36b3b8[_0x6159('0x4d')]({'plain':!![]});var _0x7cacb4='IvrCampaigns';return db[_0x6159('0x50')][_0x6159('0x49')]({'where':{'name':_0x7cacb4,'userProfileId':_0x3ff676['userProfileId']},'raw':!![]})['then'](function(_0x49b85d){if(_0x49b85d&&_0x49b85d[_0x6159('0x51')]===0x0){return db[_0x6159('0x52')][_0x6159('0x4a')]({'name':_0x534864[_0x6159('0x2a')],'resourceId':_0x534864['id'],'type':_0x49b85d[_0x6159('0x2a')],'sectionId':_0x49b85d['id']},{})[_0x6159('0x26')](function(){return _0x36b3b8;});}else{return _0x36b3b8;}})['catch'](function(_0x420354){logger['error'](_0x6159('0x53'),_0x420354);throw _0x420354;});}return _0x36b3b8;})[_0x6159('0x26')](respondWithResult(_0x45e002,0xc9))[_0x6159('0x47')](handleError(_0x45e002,null));};exports[_0x6159('0x54')]=function(_0x2140a2,_0x19a73f){var _0x991e46={'where':{'id':_0x2140a2[_0x6159('0x48')]['id']}},_0x773b21={};_0x773b21[_0x6159('0x31')]=_[_0x6159('0x32')](db[_0x6159('0x2e')][_0x6159('0x2f')]);_0x991e46[_0x6159('0x36')]=_[_0x6159('0x35')](_0x773b21[_0x6159('0x31')],qs[_0x6159('0x37')](_0x2140a2[_0x6159('0x33')][_0x6159('0x37')]));_0x991e46[_0x6159('0x36')]=_0x991e46[_0x6159('0x36')][_0x6159('0x38')]?_0x991e46[_0x6159('0x36')]:_0x773b21['model'];if(_0x2140a2[_0x6159('0x33')]['includeAll']){_0x991e46[_0x6159('0x44')]=[{'all':!![]}];}_0x991e46=_['merge']({},_0x991e46,_0x2140a2[_0x6159('0x42')]);return db['Campaign'][_0x6159('0x49')](_0x991e46)[_0x6159('0x26')](handleEntityNotFound(_0x19a73f,null))['then'](function(_0x5bbf0d){if(_0x5bbf0d){var _0x29659c=_0x5bbf0d[_0x6159('0x4d')]({'plain':!![]});_0x29659c=qs[_0x6159('0x55')](_0x29659c,['id',_0x6159('0x56'),_0x6159('0x57')]);_0x2140a2[_0x6159('0x4b')]=_[_0x6159('0x55')](_0x2140a2['body'],['id',_0x6159('0x56'),'updatedAt']);return db[_0x6159('0x2e')][_0x6159('0x4a')](_['merge'](_0x29659c,_0x2140a2['body']),{'include':_0x2140a2['query'][_0x6159('0x43')]?[{'all':!![]}]:undefined})[_0x6159('0x26')](function(_0x41fd1c){var _0x56f1ce=_0x2140a2[_0x6159('0x4c')]['get']({'plain':!![]});if(!_0x56f1ce)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56f1ce[_0x6159('0x4f')]==='user'){var _0x33d698=_0x41fd1c[_0x6159('0x4d')]({'plain':!![]});var _0x591882=_0x6159('0x28');return db[_0x6159('0x50')]['find']({'where':{'name':_0x591882,'userProfileId':_0x56f1ce[_0x6159('0x58')]},'raw':!![]})['then'](function(_0x2666d1){if(_0x2666d1&&_0x2666d1[_0x6159('0x51')]===0x0){return db[_0x6159('0x52')][_0x6159('0x4a')]({'name':_0x33d698['name'],'resourceId':_0x33d698['id'],'type':_0x2666d1['name'],'sectionId':_0x2666d1['id']},{})['then'](function(){return _0x41fd1c;});}else{return _0x41fd1c;}})[_0x6159('0x47')](function(_0x35857b){logger['error'](_0x6159('0x53'),_0x35857b);throw _0x35857b;});}return _0x41fd1c;});}})[_0x6159('0x26')](respondWithResult(_0x19a73f,0xc9))[_0x6159('0x47')](handleError(_0x19a73f,null));};exports[_0x6159('0x25')]=function(_0x459214,_0x1803c){if(_0x459214['body']['id']){delete _0x459214['body']['id'];}return db[_0x6159('0x2e')][_0x6159('0x49')]({'where':{'id':_0x459214[_0x6159('0x48')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x1803c,null))[_0x6159('0x26')](saveUpdates(_0x459214[_0x6159('0x4b')],null))[_0x6159('0x26')](respondWithResult(_0x1803c,null))['catch'](handleError(_0x1803c,null));};exports[_0x6159('0x27')]=function(_0x3e87ef,_0xf6e08e){return db[_0x6159('0x2e')]['find']({'where':{'id':_0x3e87ef[_0x6159('0x48')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0xf6e08e,null))[_0x6159('0x26')](removeEntity(_0xf6e08e,null))[_0x6159('0x47')](handleError(_0xf6e08e,null));};exports[_0x6159('0x59')]=function(_0x271498,_0x199a36,_0x529fbc){var _0x5cf685={'raw':!![],'where':{}};var _0x317c21={};var _0x4ef7db={'count':0x0,'rows':[]};return db['Campaign'][_0x6159('0x5a')]({'where':{'id':_0x271498[_0x6159('0x48')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x199a36,null))[_0x6159('0x26')](function(_0xdbb84e){if(_0xdbb84e){_0x317c21[_0x6159('0x31')]=_[_0x6159('0x32')](db['CmHopper'][_0x6159('0x2f')]);_0x317c21[_0x6159('0x33')]=_[_0x6159('0x32')](_0x271498[_0x6159('0x33')]);_0x317c21[_0x6159('0x34')]=_['intersection'](_0x317c21['model'],_0x317c21[_0x6159('0x33')]);_0x5cf685[_0x6159('0x36')]=_['intersection'](_0x317c21[_0x6159('0x31')],qs[_0x6159('0x37')](_0x271498['query'][_0x6159('0x37')]));_0x5cf685['attributes']=_0x5cf685[_0x6159('0x36')]['length']?_0x5cf685[_0x6159('0x36')]:_0x317c21['model'];if(!_0x271498[_0x6159('0x33')][_0x6159('0x39')]('nolimit')){_0x5cf685[_0x6159('0x1d')]=qs['limit'](_0x271498[_0x6159('0x33')]['limit']);_0x5cf685[_0x6159('0x1f')]=qs[_0x6159('0x1f')](_0x271498[_0x6159('0x33')][_0x6159('0x1f')]);}_0x5cf685['order']=qs['sort'](_0x271498[_0x6159('0x33')][_0x6159('0x3c')]);_0x5cf685[_0x6159('0x3e')]=qs['filters'](_[_0x6159('0x5b')](_0x271498[_0x6159('0x33')],_0x317c21[_0x6159('0x34')]));_0x5cf685['where'][_0x6159('0x5c')]=_0xdbb84e['id'];if(_0x271498['query'][_0x6159('0x3d')]){_0x5cf685['where']=_[_0x6159('0x41')](_0x5cf685[_0x6159('0x3e')],{'$or':_[_0x6159('0x2d')](_0x5cf685['attributes'],function(_0x3a8dca){var _0x34fb2f={};_0x34fb2f[_0x3a8dca]={'$like':'%'+_0x271498[_0x6159('0x33')][_0x6159('0x3d')]+'%'};return _0x34fb2f;})});}_0x5cf685=_[_0x6159('0x41')]({},_0x5cf685,_0x271498['options']);return db['CmHopper'][_0x6159('0x20')]({'where':_0x5cf685[_0x6159('0x3e')]})[_0x6159('0x26')](function(_0x25cbca){_0x4ef7db['count']=_0x25cbca;if(_0x271498[_0x6159('0x33')][_0x6159('0x43')]){_0x5cf685[_0x6159('0x44')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x5cf685);})[_0x6159('0x26')](function(_0x59ebba){_0x4ef7db['rows']=_0x59ebba;return _0x4ef7db;});}})['then'](respondWithFilteredResult(_0x199a36,_0x5cf685))['catch'](handleError(_0x199a36,null));};exports[_0x6159('0x5d')]=function(_0x5f1653,_0x5cda27,_0x2aa0a7){var _0x3d88ce={'raw':!![],'where':{}};var _0x418337={};var _0x1ea80c={'count':0x0,'rows':[]};return db[_0x6159('0x2e')][_0x6159('0x5a')]({'where':{'id':_0x5f1653[_0x6159('0x48')]['id']}})['then'](handleEntityNotFound(_0x5cda27,null))['then'](function(_0x5536d5){if(_0x5536d5){_0x418337[_0x6159('0x31')]=_['keys'](db[_0x6159('0x5e')]['rawAttributes']);_0x418337[_0x6159('0x33')]=_[_0x6159('0x32')](_0x5f1653['query']);_0x418337[_0x6159('0x34')]=_['intersection'](_0x418337[_0x6159('0x31')],_0x418337[_0x6159('0x33')]);_0x3d88ce['attributes']=_[_0x6159('0x35')](_0x418337[_0x6159('0x31')],qs[_0x6159('0x37')](_0x5f1653['query']['fields']));_0x3d88ce['attributes']=_0x3d88ce[_0x6159('0x36')]['length']?_0x3d88ce['attributes']:_0x418337['model'];if(!_0x5f1653[_0x6159('0x33')][_0x6159('0x39')](_0x6159('0x3a'))){_0x3d88ce[_0x6159('0x1d')]=qs[_0x6159('0x1d')](_0x5f1653['query'][_0x6159('0x1d')]);_0x3d88ce['offset']=qs[_0x6159('0x1f')](_0x5f1653[_0x6159('0x33')][_0x6159('0x1f')]);}_0x3d88ce['order']=qs[_0x6159('0x3c')](_0x5f1653[_0x6159('0x33')][_0x6159('0x3c')]);_0x3d88ce[_0x6159('0x3e')]=qs[_0x6159('0x34')](_[_0x6159('0x5b')](_0x5f1653[_0x6159('0x33')],_0x418337[_0x6159('0x34')]));_0x3d88ce[_0x6159('0x3e')][_0x6159('0x5c')]=_0x5536d5['id'];if(_0x5f1653[_0x6159('0x33')]['filter']){_0x3d88ce[_0x6159('0x3e')]=_[_0x6159('0x41')](_0x3d88ce[_0x6159('0x3e')],{'$or':_['map'](_0x3d88ce['attributes'],function(_0x21059a){var _0x415916={};_0x415916[_0x21059a]={'$like':'%'+_0x5f1653[_0x6159('0x33')][_0x6159('0x3d')]+'%'};return _0x415916;})});}_0x3d88ce=_[_0x6159('0x41')]({},_0x3d88ce,_0x5f1653[_0x6159('0x42')]);return db[_0x6159('0x5e')][_0x6159('0x20')]({'where':_0x3d88ce['where']})[_0x6159('0x26')](function(_0x53fd10){_0x1ea80c[_0x6159('0x20')]=_0x53fd10;if(_0x5f1653[_0x6159('0x33')][_0x6159('0x43')]){_0x3d88ce[_0x6159('0x44')]=[{'all':!![]}];}return db[_0x6159('0x5e')][_0x6159('0x45')](_0x3d88ce);})[_0x6159('0x26')](function(_0x6d39c){_0x1ea80c[_0x6159('0x46')]=_0x6d39c;return _0x1ea80c;});}})[_0x6159('0x26')](respondWithFilteredResult(_0x5cda27,_0x3d88ce))['catch'](handleError(_0x5cda27,null));};exports[_0x6159('0x5f')]=function(_0xcf35ec,_0x31e2c3,_0x4b3ac1){var _0x534df4={'raw':!![],'where':{}};var _0x23e1f3={};var _0xf1665d={'count':0x0,'rows':[]};return db['Campaign'][_0x6159('0x5a')]({'where':{'id':_0xcf35ec[_0x6159('0x48')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x31e2c3,null))[_0x6159('0x26')](function(_0x4ee3a3){if(_0x4ee3a3){_0x23e1f3[_0x6159('0x31')]=_[_0x6159('0x32')](db[_0x6159('0x60')][_0x6159('0x2f')]);_0x23e1f3['query']=_[_0x6159('0x32')](_0xcf35ec[_0x6159('0x33')]);_0x23e1f3[_0x6159('0x34')]=_[_0x6159('0x35')](_0x23e1f3['model'],_0x23e1f3[_0x6159('0x33')]);_0x534df4['attributes']=_[_0x6159('0x35')](_0x23e1f3['model'],qs['fields'](_0xcf35ec['query'][_0x6159('0x37')]));_0x534df4['attributes']=_0x534df4[_0x6159('0x36')][_0x6159('0x38')]?_0x534df4[_0x6159('0x36')]:_0x23e1f3[_0x6159('0x31')];if(!_0xcf35ec[_0x6159('0x33')][_0x6159('0x39')](_0x6159('0x3a'))){_0x534df4[_0x6159('0x1d')]=qs['limit'](_0xcf35ec[_0x6159('0x33')][_0x6159('0x1d')]);_0x534df4[_0x6159('0x1f')]=qs[_0x6159('0x1f')](_0xcf35ec[_0x6159('0x33')][_0x6159('0x1f')]);}_0x534df4['order']=qs[_0x6159('0x3c')](_0xcf35ec[_0x6159('0x33')][_0x6159('0x3c')]);_0x534df4[_0x6159('0x3e')]=qs[_0x6159('0x34')](_[_0x6159('0x5b')](_0xcf35ec[_0x6159('0x33')],_0x23e1f3[_0x6159('0x34')]));_0x534df4[_0x6159('0x3e')]['CampaignId']=_0x4ee3a3['id'];if(_0xcf35ec[_0x6159('0x33')][_0x6159('0x3d')]){_0x534df4[_0x6159('0x3e')]=_[_0x6159('0x41')](_0x534df4[_0x6159('0x3e')],{'$or':_[_0x6159('0x2d')](_0x534df4[_0x6159('0x36')],function(_0x3f9721){var _0x368526={};_0x368526[_0x3f9721]={'$like':'%'+_0xcf35ec[_0x6159('0x33')][_0x6159('0x3d')]+'%'};return _0x368526;})});}_0x534df4=_[_0x6159('0x41')]({},_0x534df4,_0xcf35ec[_0x6159('0x42')]);return db[_0x6159('0x60')][_0x6159('0x20')]({'where':_0x534df4[_0x6159('0x3e')]})['then'](function(_0x5cd4e2){_0xf1665d[_0x6159('0x20')]=_0x5cd4e2;if(_0xcf35ec[_0x6159('0x33')][_0x6159('0x43')]){_0x534df4[_0x6159('0x44')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x6159('0x45')](_0x534df4);})['then'](function(_0x3a0d23){_0xf1665d['rows']=_0x3a0d23;return _0xf1665d;});}})[_0x6159('0x26')](respondWithFilteredResult(_0x31e2c3,_0x534df4))[_0x6159('0x47')](handleError(_0x31e2c3,null));};exports[_0x6159('0x61')]=function(_0x3666a1,_0xced867,_0x33000a){var _0x16a2f5={'raw':!![],'where':{}};var _0x132f78={};var _0x1643ea={'count':0x0,'rows':[]};return db[_0x6159('0x2e')][_0x6159('0x5a')]({'where':{'id':_0x3666a1[_0x6159('0x48')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0xced867,null))['then'](function(_0x1f52ba){if(_0x1f52ba){_0x132f78[_0x6159('0x31')]=_[_0x6159('0x32')](db[_0x6159('0x62')][_0x6159('0x2f')]);_0x132f78[_0x6159('0x33')]=_[_0x6159('0x32')](_0x3666a1[_0x6159('0x33')]);_0x132f78[_0x6159('0x34')]=_[_0x6159('0x35')](_0x132f78[_0x6159('0x31')],_0x132f78[_0x6159('0x33')]);_0x16a2f5[_0x6159('0x36')]=_[_0x6159('0x35')](_0x132f78[_0x6159('0x31')],qs[_0x6159('0x37')](_0x3666a1[_0x6159('0x33')]['fields']));_0x16a2f5[_0x6159('0x36')]=_0x16a2f5[_0x6159('0x36')]['length']?_0x16a2f5[_0x6159('0x36')]:_0x132f78['model'];if(!_0x3666a1[_0x6159('0x33')][_0x6159('0x39')]('nolimit')){_0x16a2f5['limit']=qs['limit'](_0x3666a1[_0x6159('0x33')]['limit']);_0x16a2f5[_0x6159('0x1f')]=qs['offset'](_0x3666a1[_0x6159('0x33')][_0x6159('0x1f')]);}_0x16a2f5[_0x6159('0x3b')]=qs['sort'](_0x3666a1[_0x6159('0x33')][_0x6159('0x3c')]);_0x16a2f5[_0x6159('0x3e')]=qs[_0x6159('0x34')](_['pick'](_0x3666a1[_0x6159('0x33')],_0x132f78[_0x6159('0x34')]));_0x16a2f5[_0x6159('0x3e')]['CampaignId']=_0x1f52ba['id'];if(_0x3666a1[_0x6159('0x33')][_0x6159('0x3d')]){_0x16a2f5[_0x6159('0x3e')]=_['merge'](_0x16a2f5[_0x6159('0x3e')],{'$or':_['map'](_0x16a2f5[_0x6159('0x36')],function(_0x52ad69){var _0x1c1a85={};_0x1c1a85[_0x52ad69]={'$like':'%'+_0x3666a1[_0x6159('0x33')][_0x6159('0x3d')]+'%'};return _0x1c1a85;})});}_0x16a2f5=_['merge']({},_0x16a2f5,_0x3666a1[_0x6159('0x42')]);return db['CmHopperBlack'][_0x6159('0x20')]({'where':_0x16a2f5['where']})['then'](function(_0x21781c){_0x1643ea[_0x6159('0x20')]=_0x21781c;if(_0x3666a1[_0x6159('0x33')][_0x6159('0x43')]){_0x16a2f5['include']=[{'all':!![]}];}return db[_0x6159('0x62')][_0x6159('0x45')](_0x16a2f5);})[_0x6159('0x26')](function(_0x35f224){_0x1643ea[_0x6159('0x46')]=_0x35f224;return _0x1643ea;});}})[_0x6159('0x26')](respondWithFilteredResult(_0xced867,_0x16a2f5))[_0x6159('0x47')](handleError(_0xced867,null));};exports[_0x6159('0x63')]=function(_0x3662d6,_0x2e53b9,_0x102e79){var _0x574811={};var _0x46dec7={};var _0x3acd55;var _0x4b79b2;return db[_0x6159('0x2e')][_0x6159('0x5a')]({'where':{'id':_0x3662d6['params']['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x2e53b9,null))[_0x6159('0x26')](function(_0x11467d){if(_0x11467d){_0x3acd55=_0x11467d;_0x46dec7[_0x6159('0x31')]=_['keys'](db[_0x6159('0x64')][_0x6159('0x2f')]);_0x46dec7[_0x6159('0x33')]=_[_0x6159('0x32')](_0x3662d6[_0x6159('0x33')]);_0x46dec7[_0x6159('0x34')]=_[_0x6159('0x35')](_0x46dec7[_0x6159('0x31')],_0x46dec7[_0x6159('0x33')]);_0x574811[_0x6159('0x36')]=_[_0x6159('0x35')](_0x46dec7[_0x6159('0x31')],qs[_0x6159('0x37')](_0x3662d6['query'][_0x6159('0x37')]));_0x574811[_0x6159('0x36')]=_0x574811[_0x6159('0x36')][_0x6159('0x38')]?_0x574811[_0x6159('0x36')]:_0x46dec7[_0x6159('0x31')];_0x574811['order']=qs[_0x6159('0x3c')](_0x3662d6['query']['sort']);_0x574811['where']=qs[_0x6159('0x34')](_[_0x6159('0x5b')](_0x3662d6['query'],_0x46dec7[_0x6159('0x34')]));if(_0x3662d6['query'][_0x6159('0x3d')]){_0x574811['where']=_['merge'](_0x574811['where'],{'$or':_[_0x6159('0x2d')](_0x574811[_0x6159('0x36')],function(_0x1f4a8c){var _0x13afaa={};_0x13afaa[_0x1f4a8c]={'$like':'%'+_0x3662d6[_0x6159('0x33')][_0x6159('0x3d')]+'%'};return _0x13afaa;})});}_0x574811=_[_0x6159('0x41')]({},_0x574811,_0x3662d6['options']);return _0x3acd55[_0x6159('0x63')](_0x574811);}})[_0x6159('0x26')](function(_0x1404aa){if(_0x1404aa){_0x4b79b2=_0x1404aa['length'];if(!_0x3662d6['query'][_0x6159('0x39')](_0x6159('0x3a'))){_0x574811[_0x6159('0x1d')]=qs[_0x6159('0x1d')](_0x3662d6['query'][_0x6159('0x1d')]);_0x574811[_0x6159('0x1f')]=qs[_0x6159('0x1f')](_0x3662d6[_0x6159('0x33')]['offset']);}return _0x3acd55[_0x6159('0x63')](_0x574811);}})[_0x6159('0x26')](function(_0x199944){if(_0x199944){return _0x199944?{'count':_0x4b79b2,'rows':_0x199944}:null;}})[_0x6159('0x26')](respondWithResult(_0x2e53b9,null))[_0x6159('0x47')](handleError(_0x2e53b9,null));};exports['addLists']=function(_0x2f672d,_0x3d8038,_0x4becd2){var _0x594ce3,_0x5b71c6;var _0x260a0b=[];var _0x3b2d4d=moment()[_0x6159('0x65')](_0x6159('0x66'));return db[_0x6159('0x2e')]['find']({'where':{'id':_0x2f672d[_0x6159('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d8038,null))[_0x6159('0x26')](function(_0x172e73){if(_0x172e73){_0x5b71c6=_0x172e73;return _0x172e73[_0x6159('0x67')](_0x2f672d[_0x6159('0x4b')][_0x6159('0x68')],_[_0x6159('0x55')](_0x2f672d[_0x6159('0x4b')],[_0x6159('0x68'),'id'])||{});}return null;})[_0x6159('0x69')](function(_0x2213de){var _0x4e2b70;var _0x29c03f;_0x594ce3=_0x2213de||[];var _0x5042c9=[];if(_0x2213de){for(var _0x6b7ec4=0x0;_0x6b7ec4<_0x2213de[_0x6159('0x38')];_0x6b7ec4+=0x1){var _0x1bfe66=_0x2213de[_0x6b7ec4][_0x6159('0x4d')]({'plain':!![]});_0x5b71c6['dialCheckDuplicateType']=_0x2f672d[_0x6159('0x4b')][_0x6159('0x6a')]?_0x2f672d[_0x6159('0x4b')][_0x6159('0x6a')]:_0x5b71c6[_0x6159('0x6a')];switch(_0x5b71c6[_0x6159('0x6a')]){case'always':_0x4e2b70=squel[_0x6159('0x6b')]()[_0x6159('0x6c')](_0x6159('0x6d'))['fromQuery']([_0x6159('0x6e'),'scheduledAt','ContactId',_0x6159('0x6f'),'CampaignId',_0x6159('0x56'),'updatedAt'],squel['select']()[_0x6159('0x70')](_0x6159('0x6e'),'phone')['field'](_0x6159('0x71'),'scheduledAt')[_0x6159('0x70')]('id',_0x6159('0x72'))['field'](_0x1bfe66['CmListId'][_0x6159('0x73')](),_0x6159('0x6f'))['field'](_0x2f672d[_0x6159('0x48')]['id']['toString'](),_0x6159('0x5c'))[_0x6159('0x70')]('\x27'+_0x3b2d4d+'\x27',_0x6159('0x56'))[_0x6159('0x70')]('\x27'+_0x3b2d4d+'\x27','updatedAt')[_0x6159('0x74')](_0x6159('0x75'))[_0x6159('0x3e')]('deletedAt\x20IS\x20NULL')[_0x6159('0x3e')]('ListId\x20=\x20?',_0x1bfe66[_0x6159('0x76')][_0x6159('0x73')]())['where'](_0x6159('0x77'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x6159('0x78')]()['field'](_0x6159('0x79'))[_0x6159('0x74')](_0x6159('0x7a'))['where']('CampaignId\x20=\x20?',_0x2f672d[_0x6159('0x48')]['id']['toString']()))[_0x6159('0x3e')](_0x6159('0x7b'),squel[_0x6159('0x78')]()[_0x6159('0x70')](_0x6159('0x7c'))[_0x6159('0x74')](_0x6159('0x6d'))['where']('CampaignId\x20=\x20?',_0x2f672d['params']['id'][_0x6159('0x73')]())))[_0x6159('0x73')]();break;case'onlyIfOpen':_0x4e2b70=squel[_0x6159('0x6b')]()[_0x6159('0x6c')]('cm_hopper')[_0x6159('0x7d')]([_0x6159('0x6e'),_0x6159('0x7e'),_0x6159('0x72'),'ListId',_0x6159('0x5c'),'createdAt',_0x6159('0x57')],squel[_0x6159('0x78')]()[_0x6159('0x70')](_0x6159('0x6e'),_0x6159('0x6e'))[_0x6159('0x70')]('NOW()',_0x6159('0x7e'))[_0x6159('0x70')]('id',_0x6159('0x72'))['field'](_0x1bfe66[_0x6159('0x76')][_0x6159('0x73')](),_0x6159('0x6f'))['field'](_0x2f672d[_0x6159('0x48')]['id'][_0x6159('0x73')](),_0x6159('0x5c'))[_0x6159('0x70')]('\x27'+_0x3b2d4d+'\x27',_0x6159('0x56'))[_0x6159('0x70')]('\x27'+_0x3b2d4d+'\x27',_0x6159('0x57'))[_0x6159('0x74')](_0x6159('0x75'))[_0x6159('0x3e')](_0x6159('0x7f'))[_0x6159('0x3e')](_0x6159('0x80'),_0x1bfe66[_0x6159('0x76')][_0x6159('0x73')]())['where'](_0x6159('0x77'))[_0x6159('0x3e')](_0x6159('0x7b'),squel[_0x6159('0x78')]()[_0x6159('0x70')](_0x6159('0x7c'))[_0x6159('0x74')](_0x6159('0x6d'))[_0x6159('0x3e')](_0x6159('0x81'),_0x2f672d[_0x6159('0x48')]['id']['toString']())))[_0x6159('0x73')]();break;default:_0x4e2b70=squel[_0x6159('0x6b')]()['into'](_0x6159('0x6d'))['fromQuery']([_0x6159('0x6e'),_0x6159('0x7e'),_0x6159('0x72'),'ListId',_0x6159('0x5c'),_0x6159('0x56'),_0x6159('0x57')],squel[_0x6159('0x78')]()[_0x6159('0x70')](_0x6159('0x6e'),_0x6159('0x6e'))[_0x6159('0x70')]('NOW()','scheduledAt')[_0x6159('0x70')]('id',_0x6159('0x72'))['field'](_0x1bfe66['CmListId'][_0x6159('0x73')](),'ListId')[_0x6159('0x70')](_0x2f672d[_0x6159('0x48')]['id'][_0x6159('0x73')](),_0x6159('0x5c'))[_0x6159('0x70')]('\x27'+_0x3b2d4d+'\x27',_0x6159('0x56'))['field']('\x27'+_0x3b2d4d+'\x27',_0x6159('0x57'))[_0x6159('0x74')](_0x6159('0x75'))[_0x6159('0x3e')]('deletedAt\x20IS\x20NULL')[_0x6159('0x3e')](_0x6159('0x80'),_0x1bfe66[_0x6159('0x76')][_0x6159('0x73')]())[_0x6159('0x3e')](_0x6159('0x77')))['toString']();}_0x29c03f=squel[_0x6159('0x6b')]()[_0x6159('0x6c')](_0x6159('0x82'))[_0x6159('0x7d')]([_0x6159('0x83'),_0x6159('0x7e'),_0x6159('0x6e'),_0x6159('0x84'),_0x6159('0x56'),_0x6159('0x57')],squel[_0x6159('0x78')]()['field'](_0x6159('0x85'),'id')[_0x6159('0x70')]('NOW()',_0x6159('0x7e'))[_0x6159('0x70')](_0x6159('0x86'),_0x6159('0x6e'))[_0x6159('0x70')](_0x6159('0x87'),_0x6159('0x84'))[_0x6159('0x70')]('\x27'+_0x3b2d4d+'\x27','createdAt')[_0x6159('0x70')]('\x27'+_0x3b2d4d+'\x27','updatedAt')[_0x6159('0x74')](_0x6159('0x88'),'ci')['join']('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0x6159('0x3e')](_0x6159('0x89'),_0x1bfe66[_0x6159('0x76')][_0x6159('0x73')]())[_0x6159('0x3e')](_0x6159('0x8a'),_0x2f672d['params']['id'][_0x6159('0x73')]())[_0x6159('0x3e')](_0x6159('0x8b'),_0x3b2d4d))[_0x6159('0x73')]();_0x5042c9['push'](db[_0x6159('0x8c')][_0x6159('0x33')](_0x4e2b70));_0x260a0b[_0x6159('0x8d')](db[_0x6159('0x8c')]['query'](_0x29c03f));}return BPromise[_0x6159('0x8e')](_0x5042c9);}})[_0x6159('0x26')](function(){return BPromise[_0x6159('0x8e')](_0x260a0b);})[_0x6159('0x26')](function(){return _0x594ce3;})[_0x6159('0x26')](respondWithResult(_0x3d8038,null))[_0x6159('0x47')](handleError(_0x3d8038,null));};exports[_0x6159('0x8f')]=function(_0x4f5585,_0x166cff,_0x241cc4){return db['Campaign']['find']({'where':{'id':_0x4f5585[_0x6159('0x48')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x166cff,null))[_0x6159('0x26')](function(_0x5237f5){if(_0x5237f5){return _0x5237f5[_0x6159('0x8f')](_0x4f5585[_0x6159('0x33')][_0x6159('0x68')]);}})[_0x6159('0x26')](function(_0x1e2c5a){if(_0x1e2c5a){return db[_0x6159('0x90')][_0x6159('0x27')]({'where':{'ListId':_0x4f5585[_0x6159('0x33')]['ids'],'CampaignId':_0x4f5585['params']['id']}})[_0x6159('0x26')](function(){return _0x1e2c5a;});}})[_0x6159('0x26')](respondWithStatusCode(_0x166cff,null))[_0x6159('0x47')](handleError(_0x166cff,null));};exports[_0x6159('0x91')]=function(_0x30f953,_0xd75647,_0x5acb0c){var _0x12d2c4={};var _0x4ed37d={};var _0x2af794;var _0x170d85;return db[_0x6159('0x2e')][_0x6159('0x5a')]({'where':{'id':_0x30f953[_0x6159('0x48')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0xd75647,null))[_0x6159('0x26')](function(_0x33f0e6){if(_0x33f0e6){_0x2af794=_0x33f0e6;_0x4ed37d['model']=_[_0x6159('0x32')](db['CmList'][_0x6159('0x2f')]);_0x4ed37d[_0x6159('0x33')]=_['keys'](_0x30f953['query']);_0x4ed37d[_0x6159('0x34')]=_[_0x6159('0x35')](_0x4ed37d[_0x6159('0x31')],_0x4ed37d[_0x6159('0x33')]);_0x12d2c4[_0x6159('0x36')]=_['intersection'](_0x4ed37d[_0x6159('0x31')],qs[_0x6159('0x37')](_0x30f953['query']['fields']));_0x12d2c4[_0x6159('0x36')]=_0x12d2c4[_0x6159('0x36')]['length']?_0x12d2c4[_0x6159('0x36')]:_0x4ed37d['model'];_0x12d2c4[_0x6159('0x3b')]=qs[_0x6159('0x3c')](_0x30f953['query']['sort']);_0x12d2c4[_0x6159('0x3e')]=qs['filters'](_[_0x6159('0x5b')](_0x30f953['query'],_0x4ed37d[_0x6159('0x34')]));if(_0x30f953[_0x6159('0x33')][_0x6159('0x3d')]){_0x12d2c4['where']=_[_0x6159('0x41')](_0x12d2c4['where'],{'$or':_[_0x6159('0x2d')](_0x12d2c4[_0x6159('0x36')],function(_0x5df74f){var _0x46b7ac={};_0x46b7ac[_0x5df74f]={'$like':'%'+_0x30f953[_0x6159('0x33')][_0x6159('0x3d')]+'%'};return _0x46b7ac;})});}_0x12d2c4=_['merge']({},_0x12d2c4,_0x30f953[_0x6159('0x42')]);return _0x2af794[_0x6159('0x91')](_0x12d2c4);}})['then'](function(_0x238110){if(_0x238110){_0x170d85=_0x238110['length'];if(!_0x30f953[_0x6159('0x33')][_0x6159('0x39')](_0x6159('0x3a'))){_0x12d2c4[_0x6159('0x1d')]=qs[_0x6159('0x1d')](_0x30f953['query'][_0x6159('0x1d')]);_0x12d2c4[_0x6159('0x1f')]=qs[_0x6159('0x1f')](_0x30f953['query'][_0x6159('0x1f')]);}return _0x2af794[_0x6159('0x91')](_0x12d2c4);}})[_0x6159('0x26')](function(_0x5580b0){if(_0x5580b0){return _0x5580b0?{'count':_0x170d85,'rows':_0x5580b0}:null;}})['then'](respondWithResult(_0xd75647,null))[_0x6159('0x47')](handleError(_0xd75647,null));};exports[_0x6159('0x92')]=function(_0x3e6f5e,_0x1ee452,_0x323e47){var _0x2b477c,_0x4296c8;var _0x2107fc=[];var _0x265ff4=moment()[_0x6159('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x6159('0x49')]({'where':{'id':_0x3e6f5e[_0x6159('0x48')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x1ee452,null))[_0x6159('0x26')](function(_0x2c0697){if(_0x2c0697){_0x4296c8=_0x2c0697;return _0x2c0697[_0x6159('0x92')](_0x3e6f5e[_0x6159('0x4b')][_0x6159('0x68')],_[_0x6159('0x55')](_0x3e6f5e['body'],[_0x6159('0x68'),'id'])||{});}return null;})[_0x6159('0x69')](function(_0x173623){var _0x18c33f;var _0x2fe1ef;_0x2b477c=_0x173623||[];var _0x5e0f04=[];if(_0x173623){for(var _0xfff1f8=0x0;_0xfff1f8<_0x173623[_0x6159('0x38')];_0xfff1f8+=0x1){var _0x57f7e1=_0x173623[_0xfff1f8]['get']({'plain':!![]});_0x18c33f=squel[_0x6159('0x6b')]()['into'](_0x6159('0x93'))[_0x6159('0x7d')](['phone',_0x6159('0x72'),_0x6159('0x6f'),_0x6159('0x5c'),_0x6159('0x56'),_0x6159('0x57')],squel[_0x6159('0x78')]()['field'](_0x6159('0x6e'),_0x6159('0x6e'))['field']('id','ContactId')['field'](_0x57f7e1['CmListId']['toString'](),_0x6159('0x6f'))[_0x6159('0x70')](_0x3e6f5e[_0x6159('0x48')]['id'][_0x6159('0x73')](),_0x6159('0x5c'))[_0x6159('0x70')](_0x6159('0x71'),'createdAt')[_0x6159('0x70')]('NOW()',_0x6159('0x57'))[_0x6159('0x74')](_0x6159('0x75'))[_0x6159('0x3e')](_0x6159('0x7f'))[_0x6159('0x3e')](_0x6159('0x80'),_0x57f7e1[_0x6159('0x76')][_0x6159('0x73')]())['where'](_0x6159('0x77')))[_0x6159('0x73')]();_0x5e0f04['push'](db[_0x6159('0x8c')][_0x6159('0x33')](_0x18c33f));}return BPromise[_0x6159('0x8e')](_0x5e0f04);}})[_0x6159('0x26')](function(){return _0x2b477c;})['then'](respondWithResult(_0x1ee452,null))[_0x6159('0x47')](handleError(_0x1ee452,null));};exports[_0x6159('0x94')]=function(_0x15a275,_0x4fe624,_0x104690){return db[_0x6159('0x2e')][_0x6159('0x49')]({'where':{'id':_0x15a275[_0x6159('0x48')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x4fe624,null))[_0x6159('0x26')](function(_0x52069a){if(_0x52069a){return _0x52069a[_0x6159('0x94')](_0x15a275[_0x6159('0x33')][_0x6159('0x68')]);}})[_0x6159('0x26')](function(_0x25f393){if(_0x25f393){return db[_0x6159('0x62')][_0x6159('0x27')]({'where':{'ListId':_0x15a275[_0x6159('0x33')][_0x6159('0x68')],'CampaignId':_0x15a275[_0x6159('0x48')]['id']}})[_0x6159('0x26')](function(){return _0x25f393;});}})[_0x6159('0x26')](respondWithStatusCode(_0x4fe624,null))[_0x6159('0x47')](handleError(_0x4fe624,null));};
\ No newline at end of file
+var _0xf8ff=['cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','IvrCampaigns','error','stack','name','index','Campaign','fieldName','key','map','query','keys','intersection','attributes','model','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','get','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','userProfileId','getHoppers','findOne','CmHopper','nolimit','CampaignId','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ListId','field','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(phone,\x27\x27)','onlyIfOpen','into','NOW()','CampaignId\x20=\x20?','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf8ff,0x127));var _0xff8f=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0xf8ff[_0x8c1005];return _0x175354;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xff8f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff8f('0x1'));var moment=require(_0xff8f('0x2'));var BPromise=require(_0xff8f('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xff8f('0x4'));var sox=require('sox');var csv=require(_0xff8f('0x5'));var ejs=require(_0xff8f('0x6'));var fs=require('fs');var fs_extra=require(_0xff8f('0x7'));var _=require('lodash');var squel=require(_0xff8f('0x8'));var crypto=require(_0xff8f('0x9'));var jsforce=require(_0xff8f('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xff8f('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xff8f('0xb'));var authService=require(_0xff8f('0xc'));var qs=require(_0xff8f('0xd'));var as=require(_0xff8f('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff8f('0xf'))(_0xff8f('0x10'));var utils=require(_0xff8f('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xff8f('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8de29e,_0x41b45f){_0x41b45f=_0x41b45f||0xcc;return function(_0x99791b){if(_0x99791b){return _0x8de29e[_0xff8f('0x13')](_0x41b45f);}return _0x8de29e[_0xff8f('0x14')](_0x41b45f)[_0xff8f('0x15')]();};}function respondWithResult(_0x5af7da,_0x27ea91){_0x27ea91=_0x27ea91||0xc8;return function(_0x2b9cd1){if(_0x2b9cd1){return _0x5af7da['status'](_0x27ea91)['json'](_0x2b9cd1);}};}function respondWithFilteredResult(_0xb45836,_0x59e2a8){return function(_0x159441){if(_0x159441){var _0x55d2d3=typeof _0x59e2a8[_0xff8f('0x16')]==='undefined'&&typeof _0x59e2a8[_0xff8f('0x17')]===_0xff8f('0x18');var _0x411cc7=_0x159441[_0xff8f('0x19')];var _0x1aa37b=_0x55d2d3?0x0:_0x59e2a8[_0xff8f('0x16')];var _0x595c44=_0x55d2d3?_0x159441['count']:_0x59e2a8[_0xff8f('0x16')]+_0x59e2a8[_0xff8f('0x17')];var _0xb8bb32;if(_0x595c44>=_0x411cc7){_0x595c44=_0x411cc7;_0xb8bb32=0xc8;}else{_0xb8bb32=0xce;}_0xb45836[_0xff8f('0x14')](_0xb8bb32);return _0xb45836[_0xff8f('0x1a')]('Content-Range',_0x1aa37b+'-'+_0x595c44+'/'+_0x411cc7)['json'](_0x159441);}return null;};}function patchUpdates(_0x3a6c4b){return function(_0x5a58ee){try{jsonpatch[_0xff8f('0x1b')](_0x5a58ee,_0x3a6c4b,!![]);}catch(_0x5ce4be){return BPromise[_0xff8f('0x1c')](_0x5ce4be);}return _0x5a58ee[_0xff8f('0x1d')]();};}function saveUpdates(_0xb0f80a,_0x44fb06){return function(_0xeaf441){if(_0xeaf441){return _0xeaf441[_0xff8f('0x1e')](_0xb0f80a)['then'](function(_0x120a59){return _0x120a59;});}return null;};}function removeEntity(_0x30810d,_0x21058c){return function(_0x20c390){if(_0x20c390){return _0x20c390[_0xff8f('0x1f')]()[_0xff8f('0x20')](function(){var _0x51c599=_0x20c390['get']({'plain':!![]});var _0x59c197=_0xff8f('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x59c197,'resourceId':_0x51c599['id']}})['then'](function(){return _0x20c390;});})['then'](function(){_0x30810d[_0xff8f('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45359a,_0x5385fe){return function(_0x271252){if(!_0x271252){_0x45359a[_0xff8f('0x13')](0x194);}return _0x271252;};}function handleError(_0x3519ab,_0xb1ed64){_0xb1ed64=_0xb1ed64||0x1f4;return function(_0x4ea0f2){logger[_0xff8f('0x22')](_0x4ea0f2[_0xff8f('0x23')]);if(_0x4ea0f2[_0xff8f('0x24')]){delete _0x4ea0f2[_0xff8f('0x24')];}_0x3519ab[_0xff8f('0x14')](_0xb1ed64)['send'](_0x4ea0f2);};}exports[_0xff8f('0x25')]=function(_0x21b2ea,_0x2ee06c){var _0x186e21={},_0x575de7={},_0x269390={'count':0x0,'rows':[]};var _0x5e3e71=_['map'](db[_0xff8f('0x26')]['rawAttributes'],function(_0x2fc432){return{'name':_0x2fc432[_0xff8f('0x27')],'type':_0x2fc432['type'][_0xff8f('0x28')]};});_0x575de7['model']=_[_0xff8f('0x29')](_0x5e3e71,_0xff8f('0x24'));_0x575de7[_0xff8f('0x2a')]=_[_0xff8f('0x2b')](_0x21b2ea['query']);_0x575de7['filters']=_[_0xff8f('0x2c')](_0x575de7['model'],_0x575de7['query']);_0x186e21[_0xff8f('0x2d')]=_[_0xff8f('0x2c')](_0x575de7[_0xff8f('0x2e')],qs['fields'](_0x21b2ea['query'][_0xff8f('0x2f')]));_0x186e21[_0xff8f('0x2d')]=_0x186e21['attributes'][_0xff8f('0x30')]?_0x186e21[_0xff8f('0x2d')]:_0x575de7[_0xff8f('0x2e')];if(!_0x21b2ea[_0xff8f('0x2a')]['hasOwnProperty']('nolimit')){_0x186e21['limit']=qs['limit'](_0x21b2ea[_0xff8f('0x2a')][_0xff8f('0x17')]);_0x186e21[_0xff8f('0x16')]=qs[_0xff8f('0x16')](_0x21b2ea[_0xff8f('0x2a')][_0xff8f('0x16')]);}_0x186e21[_0xff8f('0x31')]=qs[_0xff8f('0x32')](_0x21b2ea[_0xff8f('0x2a')]['sort']);_0x186e21[_0xff8f('0x33')]=qs[_0xff8f('0x34')](_[_0xff8f('0x35')](_0x21b2ea[_0xff8f('0x2a')],_0x575de7[_0xff8f('0x34')]),_0x5e3e71);if(_0x21b2ea[_0xff8f('0x2a')][_0xff8f('0x36')]){_0x186e21[_0xff8f('0x33')]=_[_0xff8f('0x37')](_0x186e21['where'],{'$or':_['map'](_0x5e3e71,function(_0x5b9f72){if(_0x5b9f72['type']!==_0xff8f('0x38')){var _0xb51e0e={};_0xb51e0e[_0x5b9f72[_0xff8f('0x24')]]={'$like':'%'+_0x21b2ea[_0xff8f('0x2a')][_0xff8f('0x36')]+'%'};return _0xb51e0e;}})});}_0x186e21=_[_0xff8f('0x37')]({},_0x186e21,_0x21b2ea[_0xff8f('0x39')]);var _0x5c1d62={'where':_0x186e21[_0xff8f('0x33')]};return db[_0xff8f('0x26')]['count'](_0x5c1d62)['then'](function(_0x386685){_0x269390[_0xff8f('0x19')]=_0x386685;if(_0x21b2ea[_0xff8f('0x2a')][_0xff8f('0x3a')]){_0x186e21[_0xff8f('0x3b')]=[{'all':!![]}];}return db[_0xff8f('0x26')][_0xff8f('0x3c')](_0x186e21);})[_0xff8f('0x20')](function(_0x583a0f){_0x269390[_0xff8f('0x3d')]=_0x583a0f;return _0x269390;})[_0xff8f('0x20')](respondWithFilteredResult(_0x2ee06c,_0x186e21))[_0xff8f('0x3e')](handleError(_0x2ee06c,null));};exports[_0xff8f('0x3f')]=function(_0x142c78,_0x558968){var _0x1ad922={'raw':![],'where':{'id':_0x142c78[_0xff8f('0x40')]['id']}},_0x2385f4={};_0x2385f4[_0xff8f('0x2e')]=_[_0xff8f('0x2b')](db['Campaign'][_0xff8f('0x41')]);_0x2385f4['query']=_[_0xff8f('0x2b')](_0x142c78[_0xff8f('0x2a')]);_0x2385f4[_0xff8f('0x34')]=_[_0xff8f('0x2c')](_0x2385f4[_0xff8f('0x2e')],_0x2385f4[_0xff8f('0x2a')]);_0x1ad922[_0xff8f('0x2d')]=_[_0xff8f('0x2c')](_0x2385f4[_0xff8f('0x2e')],qs['fields'](_0x142c78[_0xff8f('0x2a')][_0xff8f('0x2f')]));_0x1ad922[_0xff8f('0x2d')]=_0x1ad922[_0xff8f('0x2d')][_0xff8f('0x30')]?_0x1ad922[_0xff8f('0x2d')]:_0x2385f4['model'];if(_0x142c78[_0xff8f('0x2a')]['includeAll']){_0x1ad922[_0xff8f('0x3b')]=[{'all':!![]}];}_0x1ad922=_[_0xff8f('0x37')]({},_0x1ad922,_0x142c78[_0xff8f('0x39')]);return db[_0xff8f('0x26')][_0xff8f('0x42')](_0x1ad922)[_0xff8f('0x20')](handleEntityNotFound(_0x558968,null))[_0xff8f('0x20')](respondWithResult(_0x558968,null))[_0xff8f('0x3e')](handleError(_0x558968,null));};exports[_0xff8f('0x43')]=function(_0x16ff6d,_0x3e43b1){return db[_0xff8f('0x26')][_0xff8f('0x43')](_0x16ff6d['body'],{})[_0xff8f('0x20')](function(_0x5bcb6b){var _0xa4ed9e=_0x16ff6d['user'][_0xff8f('0x44')]({'plain':!![]});if(!_0xa4ed9e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa4ed9e[_0xff8f('0x45')]===_0xff8f('0x46')){var _0x3ea6aa=_0x5bcb6b[_0xff8f('0x44')]({'plain':!![]});var _0x1a1bdf=_0xff8f('0x21');return db[_0xff8f('0x47')][_0xff8f('0x42')]({'where':{'name':_0x1a1bdf,'userProfileId':_0xa4ed9e['userProfileId']},'raw':!![]})[_0xff8f('0x20')](function(_0x3f27cc){if(_0x3f27cc&&_0x3f27cc[_0xff8f('0x48')]===0x0){return db[_0xff8f('0x49')]['create']({'name':_0x3ea6aa[_0xff8f('0x24')],'resourceId':_0x3ea6aa['id'],'type':_0x3f27cc[_0xff8f('0x24')],'sectionId':_0x3f27cc['id']},{})[_0xff8f('0x20')](function(){return _0x5bcb6b;});}else{return _0x5bcb6b;}})[_0xff8f('0x3e')](function(_0x415e95){logger[_0xff8f('0x22')](_0xff8f('0x4a'),_0x415e95);throw _0x415e95;});}return _0x5bcb6b;})[_0xff8f('0x20')](respondWithResult(_0x3e43b1,0xc9))[_0xff8f('0x3e')](handleError(_0x3e43b1,null));};exports[_0xff8f('0x4b')]=function(_0x6e246e,_0x29c10c){var _0x1ea089={'where':{'id':_0x6e246e[_0xff8f('0x40')]['id']}},_0x5e007e={};_0x5e007e[_0xff8f('0x2e')]=_['keys'](db[_0xff8f('0x26')][_0xff8f('0x41')]);_0x1ea089[_0xff8f('0x2d')]=_[_0xff8f('0x2c')](_0x5e007e[_0xff8f('0x2e')],qs['fields'](_0x6e246e[_0xff8f('0x2a')][_0xff8f('0x2f')]));_0x1ea089[_0xff8f('0x2d')]=_0x1ea089['attributes']['length']?_0x1ea089[_0xff8f('0x2d')]:_0x5e007e[_0xff8f('0x2e')];if(_0x6e246e[_0xff8f('0x2a')]['includeAll']){_0x1ea089['include']=[{'all':!![]}];}_0x1ea089=_['merge']({},_0x1ea089,_0x6e246e[_0xff8f('0x39')]);return db[_0xff8f('0x26')][_0xff8f('0x42')](_0x1ea089)['then'](handleEntityNotFound(_0x29c10c,null))[_0xff8f('0x20')](function(_0x6f4d60){if(_0x6f4d60){var _0x349064=_0x6f4d60['get']({'plain':!![]});_0x349064=qs[_0xff8f('0x4c')](_0x349064,['id',_0xff8f('0x4d'),_0xff8f('0x4e')]);_0x6e246e['body']=_[_0xff8f('0x4c')](_0x6e246e[_0xff8f('0x4f')],['id',_0xff8f('0x4d'),'updatedAt']);return db[_0xff8f('0x26')][_0xff8f('0x43')](_[_0xff8f('0x37')](_0x349064,_0x6e246e[_0xff8f('0x4f')]),{'include':_0x6e246e[_0xff8f('0x2a')]['includeAll']?[{'all':!![]}]:undefined})[_0xff8f('0x20')](function(_0x163430){var _0x3e3d27=_0x6e246e[_0xff8f('0x46')][_0xff8f('0x44')]({'plain':!![]});if(!_0x3e3d27)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e3d27[_0xff8f('0x45')]==='user'){var _0x3247ec=_0x163430[_0xff8f('0x44')]({'plain':!![]});var _0x33a525='IvrCampaigns';return db[_0xff8f('0x47')][_0xff8f('0x42')]({'where':{'name':_0x33a525,'userProfileId':_0x3e3d27[_0xff8f('0x50')]},'raw':!![]})[_0xff8f('0x20')](function(_0x16ede2){if(_0x16ede2&&_0x16ede2[_0xff8f('0x48')]===0x0){return db[_0xff8f('0x49')]['create']({'name':_0x3247ec[_0xff8f('0x24')],'resourceId':_0x3247ec['id'],'type':_0x16ede2['name'],'sectionId':_0x16ede2['id']},{})[_0xff8f('0x20')](function(){return _0x163430;});}else{return _0x163430;}})[_0xff8f('0x3e')](function(_0x13169d){logger[_0xff8f('0x22')](_0xff8f('0x4a'),_0x13169d);throw _0x13169d;});}return _0x163430;});}})['then'](respondWithResult(_0x29c10c,0xc9))[_0xff8f('0x3e')](handleError(_0x29c10c,null));};exports[_0xff8f('0x1e')]=function(_0x3bcecc,_0x390e85){if(_0x3bcecc[_0xff8f('0x4f')]['id']){delete _0x3bcecc[_0xff8f('0x4f')]['id'];}return db[_0xff8f('0x26')][_0xff8f('0x42')]({'where':{'id':_0x3bcecc['params']['id']}})[_0xff8f('0x20')](handleEntityNotFound(_0x390e85,null))[_0xff8f('0x20')](saveUpdates(_0x3bcecc[_0xff8f('0x4f')],null))[_0xff8f('0x20')](respondWithResult(_0x390e85,null))[_0xff8f('0x3e')](handleError(_0x390e85,null));};exports[_0xff8f('0x1f')]=function(_0x2c724f,_0x22be9c){return db[_0xff8f('0x26')][_0xff8f('0x42')]({'where':{'id':_0x2c724f[_0xff8f('0x40')]['id']}})['then'](handleEntityNotFound(_0x22be9c,null))[_0xff8f('0x20')](removeEntity(_0x22be9c,null))[_0xff8f('0x3e')](handleError(_0x22be9c,null));};exports[_0xff8f('0x51')]=function(_0x44ac79,_0x119340,_0x2a9b9f){var _0x5e8868={'raw':!![],'where':{}};var _0x374c9f={};var _0x5d8c01={'count':0x0,'rows':[]};return db[_0xff8f('0x26')][_0xff8f('0x52')]({'where':{'id':_0x44ac79[_0xff8f('0x40')]['id']}})['then'](handleEntityNotFound(_0x119340,null))[_0xff8f('0x20')](function(_0xb7db16){if(_0xb7db16){_0x374c9f[_0xff8f('0x2e')]=_['keys'](db[_0xff8f('0x53')][_0xff8f('0x41')]);_0x374c9f['query']=_[_0xff8f('0x2b')](_0x44ac79[_0xff8f('0x2a')]);_0x374c9f[_0xff8f('0x34')]=_[_0xff8f('0x2c')](_0x374c9f['model'],_0x374c9f[_0xff8f('0x2a')]);_0x5e8868[_0xff8f('0x2d')]=_[_0xff8f('0x2c')](_0x374c9f[_0xff8f('0x2e')],qs[_0xff8f('0x2f')](_0x44ac79[_0xff8f('0x2a')][_0xff8f('0x2f')]));_0x5e8868['attributes']=_0x5e8868[_0xff8f('0x2d')][_0xff8f('0x30')]?_0x5e8868[_0xff8f('0x2d')]:_0x374c9f[_0xff8f('0x2e')];if(!_0x44ac79['query']['hasOwnProperty'](_0xff8f('0x54'))){_0x5e8868['limit']=qs[_0xff8f('0x17')](_0x44ac79[_0xff8f('0x2a')][_0xff8f('0x17')]);_0x5e8868[_0xff8f('0x16')]=qs[_0xff8f('0x16')](_0x44ac79['query'][_0xff8f('0x16')]);}_0x5e8868[_0xff8f('0x31')]=qs[_0xff8f('0x32')](_0x44ac79[_0xff8f('0x2a')][_0xff8f('0x32')]);_0x5e8868[_0xff8f('0x33')]=qs[_0xff8f('0x34')](_['pick'](_0x44ac79['query'],_0x374c9f[_0xff8f('0x34')]));_0x5e8868['where'][_0xff8f('0x55')]=_0xb7db16['id'];if(_0x44ac79[_0xff8f('0x2a')]['filter']){_0x5e8868['where']=_[_0xff8f('0x37')](_0x5e8868[_0xff8f('0x33')],{'$or':_[_0xff8f('0x29')](_0x5e8868[_0xff8f('0x2d')],function(_0x5f3bfb){var _0x3b4303={};_0x3b4303[_0x5f3bfb]={'$like':'%'+_0x44ac79[_0xff8f('0x2a')][_0xff8f('0x36')]+'%'};return _0x3b4303;})});}_0x5e8868=_[_0xff8f('0x37')]({},_0x5e8868,_0x44ac79['options']);return db[_0xff8f('0x53')][_0xff8f('0x19')]({'where':_0x5e8868[_0xff8f('0x33')]})[_0xff8f('0x20')](function(_0x3d9905){_0x5d8c01['count']=_0x3d9905;if(_0x44ac79[_0xff8f('0x2a')][_0xff8f('0x3a')]){_0x5e8868[_0xff8f('0x3b')]=[{'all':!![]}];}return db['CmHopper'][_0xff8f('0x3c')](_0x5e8868);})[_0xff8f('0x20')](function(_0x4f31c4){_0x5d8c01[_0xff8f('0x3d')]=_0x4f31c4;return _0x5d8c01;});}})[_0xff8f('0x20')](respondWithFilteredResult(_0x119340,_0x5e8868))['catch'](handleError(_0x119340,null));};exports['getHopperHistories']=function(_0x176757,_0xa15761,_0x5091a3){var _0x33f18a={'raw':!![],'where':{}};var _0xff5b43={};var _0x75f44c={'count':0x0,'rows':[]};return db[_0xff8f('0x26')][_0xff8f('0x52')]({'where':{'id':_0x176757[_0xff8f('0x40')]['id']}})[_0xff8f('0x20')](handleEntityNotFound(_0xa15761,null))[_0xff8f('0x20')](function(_0x1bb2e4){if(_0x1bb2e4){_0xff5b43[_0xff8f('0x2e')]=_[_0xff8f('0x2b')](db[_0xff8f('0x56')][_0xff8f('0x41')]);_0xff5b43[_0xff8f('0x2a')]=_[_0xff8f('0x2b')](_0x176757[_0xff8f('0x2a')]);_0xff5b43[_0xff8f('0x34')]=_[_0xff8f('0x2c')](_0xff5b43[_0xff8f('0x2e')],_0xff5b43[_0xff8f('0x2a')]);_0x33f18a['attributes']=_[_0xff8f('0x2c')](_0xff5b43[_0xff8f('0x2e')],qs[_0xff8f('0x2f')](_0x176757['query']['fields']));_0x33f18a[_0xff8f('0x2d')]=_0x33f18a[_0xff8f('0x2d')][_0xff8f('0x30')]?_0x33f18a[_0xff8f('0x2d')]:_0xff5b43['model'];if(!_0x176757['query'][_0xff8f('0x57')]('nolimit')){_0x33f18a[_0xff8f('0x17')]=qs['limit'](_0x176757[_0xff8f('0x2a')]['limit']);_0x33f18a['offset']=qs[_0xff8f('0x16')](_0x176757['query'][_0xff8f('0x16')]);}_0x33f18a['order']=qs[_0xff8f('0x32')](_0x176757['query'][_0xff8f('0x32')]);_0x33f18a[_0xff8f('0x33')]=qs[_0xff8f('0x34')](_['pick'](_0x176757[_0xff8f('0x2a')],_0xff5b43[_0xff8f('0x34')]));_0x33f18a[_0xff8f('0x33')][_0xff8f('0x55')]=_0x1bb2e4['id'];if(_0x176757[_0xff8f('0x2a')][_0xff8f('0x36')]){_0x33f18a[_0xff8f('0x33')]=_[_0xff8f('0x37')](_0x33f18a['where'],{'$or':_[_0xff8f('0x29')](_0x33f18a[_0xff8f('0x2d')],function(_0x508840){var _0xd48ca4={};_0xd48ca4[_0x508840]={'$like':'%'+_0x176757['query'][_0xff8f('0x36')]+'%'};return _0xd48ca4;})});}_0x33f18a=_[_0xff8f('0x37')]({},_0x33f18a,_0x176757[_0xff8f('0x39')]);return db[_0xff8f('0x56')][_0xff8f('0x19')]({'where':_0x33f18a[_0xff8f('0x33')]})[_0xff8f('0x20')](function(_0x463ac0){_0x75f44c['count']=_0x463ac0;if(_0x176757[_0xff8f('0x2a')][_0xff8f('0x3a')]){_0x33f18a['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xff8f('0x3c')](_0x33f18a);})[_0xff8f('0x20')](function(_0x2defc0){_0x75f44c[_0xff8f('0x3d')]=_0x2defc0;return _0x75f44c;});}})[_0xff8f('0x20')](respondWithFilteredResult(_0xa15761,_0x33f18a))[_0xff8f('0x3e')](handleError(_0xa15761,null));};exports[_0xff8f('0x58')]=function(_0x539974,_0x269f60,_0x120f12){var _0x3a70b0={'raw':!![],'where':{}};var _0x4b7c3b={};var _0x25c1ec={'count':0x0,'rows':[]};return db[_0xff8f('0x26')]['findOne']({'where':{'id':_0x539974[_0xff8f('0x40')]['id']}})[_0xff8f('0x20')](handleEntityNotFound(_0x269f60,null))[_0xff8f('0x20')](function(_0x1da75f){if(_0x1da75f){_0x4b7c3b[_0xff8f('0x2e')]=_['keys'](db[_0xff8f('0x59')][_0xff8f('0x41')]);_0x4b7c3b[_0xff8f('0x2a')]=_[_0xff8f('0x2b')](_0x539974[_0xff8f('0x2a')]);_0x4b7c3b[_0xff8f('0x34')]=_[_0xff8f('0x2c')](_0x4b7c3b['model'],_0x4b7c3b[_0xff8f('0x2a')]);_0x3a70b0[_0xff8f('0x2d')]=_[_0xff8f('0x2c')](_0x4b7c3b[_0xff8f('0x2e')],qs[_0xff8f('0x2f')](_0x539974[_0xff8f('0x2a')][_0xff8f('0x2f')]));_0x3a70b0[_0xff8f('0x2d')]=_0x3a70b0[_0xff8f('0x2d')]['length']?_0x3a70b0[_0xff8f('0x2d')]:_0x4b7c3b[_0xff8f('0x2e')];if(!_0x539974[_0xff8f('0x2a')][_0xff8f('0x57')](_0xff8f('0x54'))){_0x3a70b0[_0xff8f('0x17')]=qs[_0xff8f('0x17')](_0x539974[_0xff8f('0x2a')]['limit']);_0x3a70b0[_0xff8f('0x16')]=qs[_0xff8f('0x16')](_0x539974['query']['offset']);}_0x3a70b0[_0xff8f('0x31')]=qs[_0xff8f('0x32')](_0x539974['query'][_0xff8f('0x32')]);_0x3a70b0['where']=qs['filters'](_[_0xff8f('0x35')](_0x539974['query'],_0x4b7c3b[_0xff8f('0x34')]));_0x3a70b0[_0xff8f('0x33')]['CampaignId']=_0x1da75f['id'];if(_0x539974[_0xff8f('0x2a')][_0xff8f('0x36')]){_0x3a70b0[_0xff8f('0x33')]=_[_0xff8f('0x37')](_0x3a70b0[_0xff8f('0x33')],{'$or':_['map'](_0x3a70b0['attributes'],function(_0x17af22){var _0x344153={};_0x344153[_0x17af22]={'$like':'%'+_0x539974[_0xff8f('0x2a')]['filter']+'%'};return _0x344153;})});}_0x3a70b0=_[_0xff8f('0x37')]({},_0x3a70b0,_0x539974[_0xff8f('0x39')]);return db[_0xff8f('0x59')][_0xff8f('0x19')]({'where':_0x3a70b0[_0xff8f('0x33')]})[_0xff8f('0x20')](function(_0x28f3f9){_0x25c1ec['count']=_0x28f3f9;if(_0x539974[_0xff8f('0x2a')][_0xff8f('0x3a')]){_0x3a70b0[_0xff8f('0x3b')]=[{'all':!![]}];}return db[_0xff8f('0x59')][_0xff8f('0x3c')](_0x3a70b0);})[_0xff8f('0x20')](function(_0xf6093f){_0x25c1ec['rows']=_0xf6093f;return _0x25c1ec;});}})[_0xff8f('0x20')](respondWithFilteredResult(_0x269f60,_0x3a70b0))['catch'](handleError(_0x269f60,null));};exports[_0xff8f('0x5a')]=function(_0x4e97ba,_0x4ec5df,_0x1de2d8){var _0x41102f={'raw':!![],'where':{}};var _0x47f079={};var _0x5aaae6={'count':0x0,'rows':[]};return db[_0xff8f('0x26')][_0xff8f('0x52')]({'where':{'id':_0x4e97ba['params']['id']}})['then'](handleEntityNotFound(_0x4ec5df,null))[_0xff8f('0x20')](function(_0x437826){if(_0x437826){_0x47f079[_0xff8f('0x2e')]=_[_0xff8f('0x2b')](db['CmHopperBlack'][_0xff8f('0x41')]);_0x47f079['query']=_['keys'](_0x4e97ba[_0xff8f('0x2a')]);_0x47f079[_0xff8f('0x34')]=_[_0xff8f('0x2c')](_0x47f079['model'],_0x47f079[_0xff8f('0x2a')]);_0x41102f[_0xff8f('0x2d')]=_[_0xff8f('0x2c')](_0x47f079[_0xff8f('0x2e')],qs[_0xff8f('0x2f')](_0x4e97ba[_0xff8f('0x2a')][_0xff8f('0x2f')]));_0x41102f[_0xff8f('0x2d')]=_0x41102f[_0xff8f('0x2d')][_0xff8f('0x30')]?_0x41102f['attributes']:_0x47f079['model'];if(!_0x4e97ba[_0xff8f('0x2a')][_0xff8f('0x57')](_0xff8f('0x54'))){_0x41102f[_0xff8f('0x17')]=qs[_0xff8f('0x17')](_0x4e97ba[_0xff8f('0x2a')][_0xff8f('0x17')]);_0x41102f['offset']=qs[_0xff8f('0x16')](_0x4e97ba[_0xff8f('0x2a')]['offset']);}_0x41102f['order']=qs[_0xff8f('0x32')](_0x4e97ba[_0xff8f('0x2a')][_0xff8f('0x32')]);_0x41102f[_0xff8f('0x33')]=qs[_0xff8f('0x34')](_[_0xff8f('0x35')](_0x4e97ba[_0xff8f('0x2a')],_0x47f079['filters']));_0x41102f[_0xff8f('0x33')]['CampaignId']=_0x437826['id'];if(_0x4e97ba[_0xff8f('0x2a')][_0xff8f('0x36')]){_0x41102f[_0xff8f('0x33')]=_['merge'](_0x41102f['where'],{'$or':_[_0xff8f('0x29')](_0x41102f[_0xff8f('0x2d')],function(_0xc2ee13){var _0x1187cb={};_0x1187cb[_0xc2ee13]={'$like':'%'+_0x4e97ba[_0xff8f('0x2a')][_0xff8f('0x36')]+'%'};return _0x1187cb;})});}_0x41102f=_[_0xff8f('0x37')]({},_0x41102f,_0x4e97ba['options']);return db['CmHopperBlack'][_0xff8f('0x19')]({'where':_0x41102f[_0xff8f('0x33')]})[_0xff8f('0x20')](function(_0x12064f){_0x5aaae6[_0xff8f('0x19')]=_0x12064f;if(_0x4e97ba[_0xff8f('0x2a')][_0xff8f('0x3a')]){_0x41102f[_0xff8f('0x3b')]=[{'all':!![]}];}return db[_0xff8f('0x5b')][_0xff8f('0x3c')](_0x41102f);})[_0xff8f('0x20')](function(_0x3cb736){_0x5aaae6[_0xff8f('0x3d')]=_0x3cb736;return _0x5aaae6;});}})[_0xff8f('0x20')](respondWithFilteredResult(_0x4ec5df,_0x41102f))[_0xff8f('0x3e')](handleError(_0x4ec5df,null));};exports['getLists']=function(_0x533b04,_0x2386e6,_0x174953){var _0x4bbe49={};var _0x31c443={};var _0x2e853a;var _0x2618a9;return db[_0xff8f('0x26')][_0xff8f('0x52')]({'where':{'id':_0x533b04['params']['id']}})[_0xff8f('0x20')](handleEntityNotFound(_0x2386e6,null))['then'](function(_0x70caa0){if(_0x70caa0){_0x2e853a=_0x70caa0;_0x31c443[_0xff8f('0x2e')]=_[_0xff8f('0x2b')](db[_0xff8f('0x5c')]['rawAttributes']);_0x31c443[_0xff8f('0x2a')]=_['keys'](_0x533b04[_0xff8f('0x2a')]);_0x31c443[_0xff8f('0x34')]=_[_0xff8f('0x2c')](_0x31c443[_0xff8f('0x2e')],_0x31c443[_0xff8f('0x2a')]);_0x4bbe49[_0xff8f('0x2d')]=_[_0xff8f('0x2c')](_0x31c443[_0xff8f('0x2e')],qs[_0xff8f('0x2f')](_0x533b04['query'][_0xff8f('0x2f')]));_0x4bbe49[_0xff8f('0x2d')]=_0x4bbe49[_0xff8f('0x2d')][_0xff8f('0x30')]?_0x4bbe49['attributes']:_0x31c443[_0xff8f('0x2e')];_0x4bbe49[_0xff8f('0x31')]=qs[_0xff8f('0x32')](_0x533b04[_0xff8f('0x2a')][_0xff8f('0x32')]);_0x4bbe49['where']=qs[_0xff8f('0x34')](_[_0xff8f('0x35')](_0x533b04[_0xff8f('0x2a')],_0x31c443['filters']));if(_0x533b04[_0xff8f('0x2a')][_0xff8f('0x36')]){_0x4bbe49['where']=_[_0xff8f('0x37')](_0x4bbe49[_0xff8f('0x33')],{'$or':_[_0xff8f('0x29')](_0x4bbe49[_0xff8f('0x2d')],function(_0x4bdfaa){var _0x280604={};_0x280604[_0x4bdfaa]={'$like':'%'+_0x533b04[_0xff8f('0x2a')][_0xff8f('0x36')]+'%'};return _0x280604;})});}_0x4bbe49=_[_0xff8f('0x37')]({},_0x4bbe49,_0x533b04[_0xff8f('0x39')]);return _0x2e853a[_0xff8f('0x5d')](_0x4bbe49);}})[_0xff8f('0x20')](function(_0x209d57){if(_0x209d57){_0x2618a9=_0x209d57[_0xff8f('0x30')];if(!_0x533b04['query'][_0xff8f('0x57')](_0xff8f('0x54'))){_0x4bbe49['limit']=qs[_0xff8f('0x17')](_0x533b04[_0xff8f('0x2a')][_0xff8f('0x17')]);_0x4bbe49[_0xff8f('0x16')]=qs[_0xff8f('0x16')](_0x533b04[_0xff8f('0x2a')][_0xff8f('0x16')]);}return _0x2e853a['getLists'](_0x4bbe49);}})[_0xff8f('0x20')](function(_0x33746b){if(_0x33746b){return _0x33746b?{'count':_0x2618a9,'rows':_0x33746b}:null;}})['then'](respondWithResult(_0x2386e6,null))[_0xff8f('0x3e')](handleError(_0x2386e6,null));};exports[_0xff8f('0x5e')]=function(_0x2f5ee1,_0x1dbfd4,_0x5f5059){var _0x15c7af,_0x2fd6b4;var _0x1c4bbf=[];var _0x4a9d99=moment()[_0xff8f('0x5f')](_0xff8f('0x60'));return db[_0xff8f('0x26')][_0xff8f('0x42')]({'where':{'id':_0x2f5ee1[_0xff8f('0x40')]['id']}})[_0xff8f('0x20')](handleEntityNotFound(_0x1dbfd4,null))[_0xff8f('0x20')](function(_0x548ada){if(_0x548ada){_0x2fd6b4=_0x548ada;return _0x548ada['addLists'](_0x2f5ee1[_0xff8f('0x4f')][_0xff8f('0x61')],_[_0xff8f('0x4c')](_0x2f5ee1[_0xff8f('0x4f')],[_0xff8f('0x61'),'id'])||{});}return null;})[_0xff8f('0x62')](function(_0xd63313){var _0x9257c5;var _0x1baca1;_0x15c7af=_0xd63313||[];var _0x1e1a0a=[];if(_0xd63313){for(var _0x2ef148=0x0;_0x2ef148<_0xd63313[_0xff8f('0x30')];_0x2ef148+=0x1){var _0x45676e=_0xd63313[_0x2ef148]['get']({'plain':!![]});_0x2fd6b4['dialCheckDuplicateType']=_0x2f5ee1[_0xff8f('0x4f')][_0xff8f('0x63')]?_0x2f5ee1[_0xff8f('0x4f')][_0xff8f('0x63')]:_0x2fd6b4[_0xff8f('0x63')];switch(_0x2fd6b4[_0xff8f('0x63')]){case _0xff8f('0x64'):_0x9257c5=squel[_0xff8f('0x65')]()['into'](_0xff8f('0x66'))[_0xff8f('0x67')]([_0xff8f('0x68'),_0xff8f('0x69'),'ContactId',_0xff8f('0x6a'),_0xff8f('0x55'),_0xff8f('0x4d'),'updatedAt'],squel['select']()[_0xff8f('0x6b')](_0xff8f('0x68'),_0xff8f('0x68'))[_0xff8f('0x6b')]('NOW()',_0xff8f('0x69'))[_0xff8f('0x6b')]('id',_0xff8f('0x6c'))[_0xff8f('0x6b')](_0x45676e[_0xff8f('0x6d')][_0xff8f('0x6e')](),_0xff8f('0x6a'))[_0xff8f('0x6b')](_0x2f5ee1[_0xff8f('0x40')]['id'][_0xff8f('0x6e')](),_0xff8f('0x55'))[_0xff8f('0x6b')]('\x27'+_0x4a9d99+'\x27',_0xff8f('0x4d'))[_0xff8f('0x6b')]('\x27'+_0x4a9d99+'\x27',_0xff8f('0x4e'))[_0xff8f('0x6f')](_0xff8f('0x70'))[_0xff8f('0x33')](_0xff8f('0x71'))['where']('ListId\x20=\x20?',_0x45676e[_0xff8f('0x6d')][_0xff8f('0x6e')]())[_0xff8f('0x33')](_0xff8f('0x72'))[_0xff8f('0x33')](_0xff8f('0x73'),squel[_0xff8f('0x74')]()[_0xff8f('0x6b')]('COALESCE(calleridnum,\x27\x27)')[_0xff8f('0x6f')]('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x2f5ee1['params']['id']['toString']()))[_0xff8f('0x33')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xff8f('0x6b')](_0xff8f('0x75'))[_0xff8f('0x6f')](_0xff8f('0x66'))[_0xff8f('0x33')]('CampaignId\x20=\x20?',_0x2f5ee1[_0xff8f('0x40')]['id'][_0xff8f('0x6e')]())))[_0xff8f('0x6e')]();break;case _0xff8f('0x76'):_0x9257c5=squel[_0xff8f('0x65')]()[_0xff8f('0x77')]('cm_hopper')['fromQuery'](['phone','scheduledAt','ContactId',_0xff8f('0x6a'),'CampaignId',_0xff8f('0x4d'),_0xff8f('0x4e')],squel['select']()['field'](_0xff8f('0x68'),_0xff8f('0x68'))['field'](_0xff8f('0x78'),_0xff8f('0x69'))[_0xff8f('0x6b')]('id',_0xff8f('0x6c'))[_0xff8f('0x6b')](_0x45676e[_0xff8f('0x6d')]['toString'](),'ListId')[_0xff8f('0x6b')](_0x2f5ee1['params']['id'][_0xff8f('0x6e')](),_0xff8f('0x55'))[_0xff8f('0x6b')]('\x27'+_0x4a9d99+'\x27',_0xff8f('0x4d'))[_0xff8f('0x6b')]('\x27'+_0x4a9d99+'\x27',_0xff8f('0x4e'))[_0xff8f('0x6f')](_0xff8f('0x70'))[_0xff8f('0x33')](_0xff8f('0x71'))['where']('ListId\x20=\x20?',_0x45676e[_0xff8f('0x6d')]['toString']())[_0xff8f('0x33')](_0xff8f('0x72'))[_0xff8f('0x33')](_0xff8f('0x73'),squel[_0xff8f('0x74')]()[_0xff8f('0x6b')](_0xff8f('0x75'))[_0xff8f('0x6f')](_0xff8f('0x66'))[_0xff8f('0x33')](_0xff8f('0x79'),_0x2f5ee1['params']['id'][_0xff8f('0x6e')]())))[_0xff8f('0x6e')]();break;default:_0x9257c5=squel[_0xff8f('0x65')]()[_0xff8f('0x77')]('cm_hopper')[_0xff8f('0x67')]([_0xff8f('0x68'),'scheduledAt',_0xff8f('0x6c'),_0xff8f('0x6a'),_0xff8f('0x55'),_0xff8f('0x4d'),_0xff8f('0x4e')],squel[_0xff8f('0x74')]()['field']('phone',_0xff8f('0x68'))['field'](_0xff8f('0x78'),_0xff8f('0x69'))[_0xff8f('0x6b')]('id',_0xff8f('0x6c'))['field'](_0x45676e['CmListId'][_0xff8f('0x6e')](),_0xff8f('0x6a'))['field'](_0x2f5ee1[_0xff8f('0x40')]['id']['toString'](),_0xff8f('0x55'))[_0xff8f('0x6b')]('\x27'+_0x4a9d99+'\x27',_0xff8f('0x4d'))['field']('\x27'+_0x4a9d99+'\x27',_0xff8f('0x4e'))['from']('cm_contacts')['where'](_0xff8f('0x71'))['where'](_0xff8f('0x7a'),_0x45676e['CmListId']['toString']())[_0xff8f('0x33')](_0xff8f('0x72')))[_0xff8f('0x6e')]();}_0x1baca1=squel[_0xff8f('0x65')]()['into'](_0xff8f('0x7b'))['fromQuery']([_0xff8f('0x7c'),_0xff8f('0x69'),_0xff8f('0x68'),_0xff8f('0x7d'),_0xff8f('0x4d'),_0xff8f('0x4e')],squel[_0xff8f('0x74')]()['field']('h.id','id')[_0xff8f('0x6b')](_0xff8f('0x78'),_0xff8f('0x69'))['field'](_0xff8f('0x7e'),_0xff8f('0x68'))[_0xff8f('0x6b')](_0xff8f('0x7f'),_0xff8f('0x7d'))['field']('\x27'+_0x4a9d99+'\x27',_0xff8f('0x4d'))[_0xff8f('0x6b')]('\x27'+_0x4a9d99+'\x27',_0xff8f('0x4e'))['from'](_0xff8f('0x80'),'ci')[_0xff8f('0x81')](_0xff8f('0x66'),'h',_0xff8f('0x82'))[_0xff8f('0x33')](_0xff8f('0x83'),_0x45676e[_0xff8f('0x6d')]['toString']())['where'](_0xff8f('0x84'),_0x2f5ee1[_0xff8f('0x40')]['id'][_0xff8f('0x6e')]())[_0xff8f('0x33')]('h.createdAt\x20=\x20?',_0x4a9d99))[_0xff8f('0x6e')]();_0x1e1a0a['push'](db[_0xff8f('0x85')][_0xff8f('0x2a')](_0x9257c5));_0x1c4bbf[_0xff8f('0x86')](db['sequelize'][_0xff8f('0x2a')](_0x1baca1));}return BPromise[_0xff8f('0x87')](_0x1e1a0a);}})[_0xff8f('0x20')](function(){return BPromise[_0xff8f('0x87')](_0x1c4bbf);})[_0xff8f('0x20')](function(){return _0x15c7af;})[_0xff8f('0x20')](respondWithResult(_0x1dbfd4,null))[_0xff8f('0x3e')](handleError(_0x1dbfd4,null));};exports['removeLists']=function(_0x526824,_0x1037da,_0x1eff31){return db[_0xff8f('0x26')][_0xff8f('0x42')]({'where':{'id':_0x526824[_0xff8f('0x40')]['id']}})[_0xff8f('0x20')](handleEntityNotFound(_0x1037da,null))[_0xff8f('0x20')](function(_0x24d720){if(_0x24d720){return _0x24d720[_0xff8f('0x88')](_0x526824['query'][_0xff8f('0x61')]);}})['then'](function(_0x4b45b8){if(_0x4b45b8){return db[_0xff8f('0x53')][_0xff8f('0x1f')]({'where':{'ListId':_0x526824[_0xff8f('0x2a')][_0xff8f('0x61')],'CampaignId':_0x526824['params']['id']}})[_0xff8f('0x20')](function(){return _0x4b45b8;});}})[_0xff8f('0x20')](respondWithStatusCode(_0x1037da,null))[_0xff8f('0x3e')](handleError(_0x1037da,null));};exports['getBlackLists']=function(_0x30783c,_0x59c445,_0xb19f99){var _0x3b65da={};var _0x4aaeb2={};var _0x52348a;var _0x117f44;return db['Campaign'][_0xff8f('0x52')]({'where':{'id':_0x30783c[_0xff8f('0x40')]['id']}})[_0xff8f('0x20')](handleEntityNotFound(_0x59c445,null))[_0xff8f('0x20')](function(_0x3128f5){if(_0x3128f5){_0x52348a=_0x3128f5;_0x4aaeb2[_0xff8f('0x2e')]=_[_0xff8f('0x2b')](db[_0xff8f('0x5c')][_0xff8f('0x41')]);_0x4aaeb2['query']=_[_0xff8f('0x2b')](_0x30783c[_0xff8f('0x2a')]);_0x4aaeb2['filters']=_[_0xff8f('0x2c')](_0x4aaeb2[_0xff8f('0x2e')],_0x4aaeb2[_0xff8f('0x2a')]);_0x3b65da[_0xff8f('0x2d')]=_[_0xff8f('0x2c')](_0x4aaeb2[_0xff8f('0x2e')],qs[_0xff8f('0x2f')](_0x30783c[_0xff8f('0x2a')][_0xff8f('0x2f')]));_0x3b65da[_0xff8f('0x2d')]=_0x3b65da[_0xff8f('0x2d')][_0xff8f('0x30')]?_0x3b65da[_0xff8f('0x2d')]:_0x4aaeb2[_0xff8f('0x2e')];_0x3b65da['order']=qs[_0xff8f('0x32')](_0x30783c['query']['sort']);_0x3b65da[_0xff8f('0x33')]=qs[_0xff8f('0x34')](_[_0xff8f('0x35')](_0x30783c[_0xff8f('0x2a')],_0x4aaeb2['filters']));if(_0x30783c[_0xff8f('0x2a')]['filter']){_0x3b65da['where']=_['merge'](_0x3b65da[_0xff8f('0x33')],{'$or':_[_0xff8f('0x29')](_0x3b65da[_0xff8f('0x2d')],function(_0x226f03){var _0x1a031e={};_0x1a031e[_0x226f03]={'$like':'%'+_0x30783c['query'][_0xff8f('0x36')]+'%'};return _0x1a031e;})});}_0x3b65da=_['merge']({},_0x3b65da,_0x30783c[_0xff8f('0x39')]);return _0x52348a[_0xff8f('0x89')](_0x3b65da);}})[_0xff8f('0x20')](function(_0x38d220){if(_0x38d220){_0x117f44=_0x38d220['length'];if(!_0x30783c['query'][_0xff8f('0x57')](_0xff8f('0x54'))){_0x3b65da[_0xff8f('0x17')]=qs['limit'](_0x30783c[_0xff8f('0x2a')]['limit']);_0x3b65da[_0xff8f('0x16')]=qs['offset'](_0x30783c[_0xff8f('0x2a')][_0xff8f('0x16')]);}return _0x52348a[_0xff8f('0x89')](_0x3b65da);}})['then'](function(_0x5e81c0){if(_0x5e81c0){return _0x5e81c0?{'count':_0x117f44,'rows':_0x5e81c0}:null;}})[_0xff8f('0x20')](respondWithResult(_0x59c445,null))[_0xff8f('0x3e')](handleError(_0x59c445,null));};exports['addBlackLists']=function(_0x45a312,_0x56ec66,_0x496e37){var _0x328ed2,_0x392a1e;var _0x1b9cfd=[];var _0x99a1b2=moment()[_0xff8f('0x5f')](_0xff8f('0x60'));return db[_0xff8f('0x26')][_0xff8f('0x42')]({'where':{'id':_0x45a312[_0xff8f('0x40')]['id']}})[_0xff8f('0x20')](handleEntityNotFound(_0x56ec66,null))[_0xff8f('0x20')](function(_0x1162d1){if(_0x1162d1){_0x392a1e=_0x1162d1;return _0x1162d1[_0xff8f('0x8a')](_0x45a312[_0xff8f('0x4f')][_0xff8f('0x61')],_[_0xff8f('0x4c')](_0x45a312[_0xff8f('0x4f')],[_0xff8f('0x61'),'id'])||{});}return null;})['spread'](function(_0x286c33){var _0x4c3e07;var _0x20f0cd;_0x328ed2=_0x286c33||[];var _0x51f1be=[];if(_0x286c33){for(var _0x345ec8=0x0;_0x345ec8<_0x286c33[_0xff8f('0x30')];_0x345ec8+=0x1){var _0x31cc59=_0x286c33[_0x345ec8][_0xff8f('0x44')]({'plain':!![]});_0x4c3e07=squel[_0xff8f('0x65')]()[_0xff8f('0x77')](_0xff8f('0x8b'))[_0xff8f('0x67')]([_0xff8f('0x68'),_0xff8f('0x6c'),_0xff8f('0x6a'),_0xff8f('0x55'),'createdAt','updatedAt'],squel[_0xff8f('0x74')]()[_0xff8f('0x6b')]('phone',_0xff8f('0x68'))[_0xff8f('0x6b')]('id',_0xff8f('0x6c'))[_0xff8f('0x6b')](_0x31cc59['CmListId']['toString'](),'ListId')[_0xff8f('0x6b')](_0x45a312[_0xff8f('0x40')]['id'][_0xff8f('0x6e')](),_0xff8f('0x55'))[_0xff8f('0x6b')](_0xff8f('0x78'),'createdAt')[_0xff8f('0x6b')](_0xff8f('0x78'),'updatedAt')['from'](_0xff8f('0x70'))[_0xff8f('0x33')](_0xff8f('0x71'))[_0xff8f('0x33')](_0xff8f('0x7a'),_0x31cc59[_0xff8f('0x6d')]['toString']())[_0xff8f('0x33')]('phone\x20IS\x20NOT\x20NULL'))[_0xff8f('0x6e')]();_0x51f1be[_0xff8f('0x86')](db[_0xff8f('0x85')]['query'](_0x4c3e07));}return BPromise[_0xff8f('0x87')](_0x51f1be);}})[_0xff8f('0x20')](function(){return _0x328ed2;})['then'](respondWithResult(_0x56ec66,null))[_0xff8f('0x3e')](handleError(_0x56ec66,null));};exports[_0xff8f('0x8c')]=function(_0x416d18,_0x38b920,_0x45dde2){return db['Campaign'][_0xff8f('0x42')]({'where':{'id':_0x416d18[_0xff8f('0x40')]['id']}})[_0xff8f('0x20')](handleEntityNotFound(_0x38b920,null))[_0xff8f('0x20')](function(_0x1fd20d){if(_0x1fd20d){return _0x1fd20d[_0xff8f('0x8c')](_0x416d18[_0xff8f('0x2a')][_0xff8f('0x61')]);}})[_0xff8f('0x20')](function(_0xfe8723){if(_0xfe8723){return db[_0xff8f('0x5b')][_0xff8f('0x1f')]({'where':{'ListId':_0x416d18[_0xff8f('0x2a')]['ids'],'CampaignId':_0x416d18['params']['id']}})[_0xff8f('0x20')](function(){return _0xfe8723;});}})['then'](respondWithStatusCode(_0x38b920,null))[_0xff8f('0x3e')](handleError(_0x38b920,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 6b6bebb..d7761bb 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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','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(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 b6567c0..af58efe 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 _0x4584=['info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x57a699,_0x29e647){var _0x88b917=function(_0x498acc){while(--_0x498acc){_0x57a699['push'](_0x57a699['shift']());}};_0x88b917(++_0x29e647);}(_0x4584,0x1cf));var _0x4458=function(_0x58712a,_0x1d88a9){_0x58712a=_0x58712a-0x0;var _0x342032=_0x4584[_0x58712a];return _0x342032;};'use strict';var _=require(_0x4458('0x0'));var util=require('util');var moment=require(_0x4458('0x1'));var BPromise=require(_0x4458('0x2'));var rs=require(_0x4458('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4458('0x4'));var logger=require(_0x4458('0x5'))(_0x4458('0x6'));var config=require(_0x4458('0x7'));var jayson=require(_0x4458('0x8'));var client=jayson[_0x4458('0x9')][_0x4458('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x215b2d,_0x102b5f,_0x51da14){return new BPromise(function(_0x14bb0f,_0x83fb96){return client[_0x4458('0xb')](_0x215b2d,_0x51da14)[_0x4458('0xc')](function(_0x1ab8c3){logger[_0x4458('0xd')](_0x4458('0xe'),_0x102b5f,_0x4458('0xf'));logger[_0x4458('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x102b5f,_0x4458('0xf'),JSON[_0x4458('0x11')](_0x1ab8c3));if(_0x1ab8c3[_0x4458('0x12')]){if(_0x1ab8c3[_0x4458('0x12')][_0x4458('0x13')]===0x1f4){logger['error'](_0x4458('0xe'),_0x102b5f,_0x1ab8c3['error'][_0x4458('0x14')]);return _0x83fb96(_0x1ab8c3['error'][_0x4458('0x14')]);}logger[_0x4458('0x12')]('Campaign,\x20%s,\x20%s',_0x102b5f,_0x1ab8c3['error'][_0x4458('0x14')]);return _0x14bb0f(_0x1ab8c3[_0x4458('0x12')][_0x4458('0x14')]);}else{logger[_0x4458('0xd')](_0x4458('0xe'),_0x102b5f,_0x4458('0xf'));_0x14bb0f(_0x1ab8c3[_0x4458('0x15')][_0x4458('0x14')]);}})['catch'](function(_0x31e500){logger['error'](_0x4458('0xe'),_0x102b5f,_0x31e500);_0x83fb96(_0x31e500);});});}exports[_0x4458('0x16')]=function(_0x130d39){var _0x587cbb=this;return new Promise(function(_0x319247,_0x422e35){return db[_0x4458('0x17')][_0x4458('0x18')]({'raw':_0x130d39[_0x4458('0x19')]?_0x130d39[_0x4458('0x19')][_0x4458('0x1a')]===undefined?!![]:![]:!![],'where':_0x130d39[_0x4458('0x19')]?_0x130d39[_0x4458('0x19')][_0x4458('0x1b')]||null:null,'attributes':_0x130d39['options']?_0x130d39[_0x4458('0x19')][_0x4458('0x1c')]||null:null,'limit':_0x130d39[_0x4458('0x19')]?_0x130d39['options'][_0x4458('0x1d')]||null:null,'include':_0x130d39[_0x4458('0x19')]?_0x130d39['options'][_0x4458('0x1e')]?_[_0x4458('0x1f')](_0x130d39['options'][_0x4458('0x1e')],function(_0x17e482){return{'model':db[_0x17e482[_0x4458('0x20')]],'as':_0x17e482['as'],'attributes':_0x17e482['attributes'],'include':_0x17e482[_0x4458('0x1e')]?_['map'](_0x17e482[_0x4458('0x1e')],function(_0x504a86){return{'model':db[_0x504a86['model']],'as':_0x504a86['as'],'attributes':_0x504a86[_0x4458('0x1c')],'include':_0x504a86[_0x4458('0x1e')]?_[_0x4458('0x1f')](_0x504a86[_0x4458('0x1e')],function(_0x153a98){return{'model':db[_0x153a98[_0x4458('0x20')]],'as':_0x153a98['as'],'attributes':_0x153a98[_0x4458('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4458('0xc')](function(_0x452ec4){logger[_0x4458('0xd')](_0x4458('0x16'),_0x130d39);logger['debug'](_0x4458('0x16'),_0x130d39,JSON['stringify'](_0x452ec4));_0x319247(_0x452ec4);})[_0x4458('0x21')](function(_0x5f22be){logger[_0x4458('0x12')](_0x4458('0x16'),_0x5f22be[_0x4458('0x14')],_0x130d39);_0x422e35(_0x587cbb[_0x4458('0x12')](0x1f4,_0x5f22be[_0x4458('0x14')]));});});};
\ No newline at end of file
+var _0x17ba=['../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Campaign','findAll','options','raw','where','limit','include','model','map','attributes','GetCampaign','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x17ba,0xab));var _0xa17b=function(_0x390c49,_0x39ca85){_0x390c49=_0x390c49-0x0;var _0x4dfc51=_0x17ba[_0x390c49];return _0x4dfc51;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var moment=require('moment');var BPromise=require(_0xa17b('0x2'));var rs=require(_0xa17b('0x3'));var fs=require('fs');var Redis=require(_0xa17b('0x4'));var db=require(_0xa17b('0x5'))['db'];var utils=require(_0xa17b('0x6'));var logger=require(_0xa17b('0x7'))(_0xa17b('0x8'));var config=require(_0xa17b('0x9'));var jayson=require(_0xa17b('0xa'));var client=jayson[_0xa17b('0xb')][_0xa17b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e3d43,_0x1957be,_0x57f9cd){return new BPromise(function(_0x2ca4d3,_0x17d1d2){return client[_0xa17b('0xd')](_0x2e3d43,_0x57f9cd)[_0xa17b('0xe')](function(_0x15bdfc){logger['info'](_0xa17b('0xf'),_0x1957be,_0xa17b('0x10'));logger[_0xa17b('0x11')](_0xa17b('0x12'),_0x1957be,_0xa17b('0x10'),JSON[_0xa17b('0x13')](_0x15bdfc));if(_0x15bdfc[_0xa17b('0x14')]){if(_0x15bdfc['error'][_0xa17b('0x15')]===0x1f4){logger[_0xa17b('0x14')](_0xa17b('0xf'),_0x1957be,_0x15bdfc['error'][_0xa17b('0x16')]);return _0x17d1d2(_0x15bdfc[_0xa17b('0x14')][_0xa17b('0x16')]);}logger[_0xa17b('0x14')]('Campaign,\x20%s,\x20%s',_0x1957be,_0x15bdfc[_0xa17b('0x14')]['message']);return _0x2ca4d3(_0x15bdfc[_0xa17b('0x14')][_0xa17b('0x16')]);}else{logger['info'](_0xa17b('0xf'),_0x1957be,_0xa17b('0x10'));_0x2ca4d3(_0x15bdfc[_0xa17b('0x17')][_0xa17b('0x16')]);}})['catch'](function(_0x98a295){logger['error']('Campaign,\x20%s,\x20%s',_0x1957be,_0x98a295);_0x17d1d2(_0x98a295);});});}exports['GetCampaign']=function(_0x36f985){var _0x197237=this;return new Promise(function(_0x53a0f7,_0x2ceafa){return db[_0xa17b('0x18')][_0xa17b('0x19')]({'raw':_0x36f985[_0xa17b('0x1a')]?_0x36f985[_0xa17b('0x1a')][_0xa17b('0x1b')]===undefined?!![]:![]:!![],'where':_0x36f985[_0xa17b('0x1a')]?_0x36f985['options'][_0xa17b('0x1c')]||null:null,'attributes':_0x36f985[_0xa17b('0x1a')]?_0x36f985[_0xa17b('0x1a')]['attributes']||null:null,'limit':_0x36f985[_0xa17b('0x1a')]?_0x36f985[_0xa17b('0x1a')][_0xa17b('0x1d')]||null:null,'include':_0x36f985[_0xa17b('0x1a')]?_0x36f985[_0xa17b('0x1a')][_0xa17b('0x1e')]?_['map'](_0x36f985[_0xa17b('0x1a')]['include'],function(_0xa34739){return{'model':db[_0xa34739[_0xa17b('0x1f')]],'as':_0xa34739['as'],'attributes':_0xa34739['attributes'],'include':_0xa34739['include']?_[_0xa17b('0x20')](_0xa34739[_0xa17b('0x1e')],function(_0x4216ca){return{'model':db[_0x4216ca[_0xa17b('0x1f')]],'as':_0x4216ca['as'],'attributes':_0x4216ca[_0xa17b('0x21')],'include':_0x4216ca[_0xa17b('0x1e')]?_['map'](_0x4216ca['include'],function(_0x5c98fe){return{'model':db[_0x5c98fe['model']],'as':_0x5c98fe['as'],'attributes':_0x5c98fe[_0xa17b('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x295e67){logger['info'](_0xa17b('0x22'),_0x36f985);logger[_0xa17b('0x11')](_0xa17b('0x22'),_0x36f985,JSON[_0xa17b('0x13')](_0x295e67));_0x53a0f7(_0x295e67);})[_0xa17b('0x23')](function(_0x3ccdb8){logger[_0xa17b('0x14')](_0xa17b('0x22'),_0x3ccdb8[_0xa17b('0x16')],_0x36f985);_0x2ceafa(_0x197237[_0xa17b('0x14')](0x1f4,_0x3ccdb8[_0xa17b('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index a383605..f8e7a97 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 _0x7cb9=['/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','clone','addLists','addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories'];(function(_0x3a6e4b,_0x118cd9){var _0x36572d=function(_0x2a53cf){while(--_0x2a53cf){_0x3a6e4b['push'](_0x3a6e4b['shift']());}};_0x36572d(++_0x118cd9);}(_0x7cb9,0x160));var _0x97cb=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7cb9[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x97cb('0x0'));var util=require(_0x97cb('0x1'));var path=require(_0x97cb('0x2'));var timeout=require(_0x97cb('0x3'));var express=require(_0x97cb('0x4'));var router=express[_0x97cb('0x5')]();var fs_extra=require(_0x97cb('0x6'));var auth=require(_0x97cb('0x7'));var interaction=require(_0x97cb('0x8'));var config=require(_0x97cb('0x9'));var controller=require(_0x97cb('0xa'));router[_0x97cb('0xb')]('/',auth[_0x97cb('0xc')](),controller[_0x97cb('0xd')]);router[_0x97cb('0xb')](_0x97cb('0xe'),auth['isAuthenticated'](),controller[_0x97cb('0xf')]);router[_0x97cb('0xb')]('/:id/hoppers',auth[_0x97cb('0xc')](),controller[_0x97cb('0x10')]);router[_0x97cb('0xb')](_0x97cb('0x11'),auth[_0x97cb('0xc')](),controller['getHopperHistories']);router[_0x97cb('0xb')](_0x97cb('0x12'),auth[_0x97cb('0xc')](),controller[_0x97cb('0x13')]);router['get'](_0x97cb('0x14'),auth['isAuthenticated'](),controller[_0x97cb('0x15')]);router[_0x97cb('0xb')](_0x97cb('0x16'),auth[_0x97cb('0xc')](),controller[_0x97cb('0x17')]);router[_0x97cb('0xb')](_0x97cb('0x18'),auth[_0x97cb('0xc')](),controller[_0x97cb('0x19')]);router[_0x97cb('0x1a')]('/',auth[_0x97cb('0xc')](),controller[_0x97cb('0x1b')]);router[_0x97cb('0x1a')]('/:id/clone',auth[_0x97cb('0xc')](),controller[_0x97cb('0x1c')]);router['post']('/:id/lists',auth['isAuthenticated'](),controller[_0x97cb('0x1d')]);router[_0x97cb('0x1a')]('/:id/blacklists',auth[_0x97cb('0xc')](),controller[_0x97cb('0x1e')]);router[_0x97cb('0x1f')](_0x97cb('0xe'),auth[_0x97cb('0xc')](),controller[_0x97cb('0x20')]);router[_0x97cb('0x21')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x97cb('0x21')](_0x97cb('0x16'),auth[_0x97cb('0xc')](),controller[_0x97cb('0x22')]);router[_0x97cb('0x21')](_0x97cb('0x18'),auth[_0x97cb('0xc')](),controller[_0x97cb('0x23')]);module[_0x97cb('0x24')]=router;
\ No newline at end of file
+var _0x79d6=['../../components/auth/service','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','update','destroy','delete','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router'];(function(_0x17615e,_0x483a49){var _0xa4c97e=function(_0x24ecf7){while(--_0x24ecf7){_0x17615e['push'](_0x17615e['shift']());}};_0xa4c97e(++_0x483a49);}(_0x79d6,0x166));var _0x679d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x79d6[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x679d('0x0'));var path=require(_0x679d('0x1'));var timeout=require(_0x679d('0x2'));var express=require(_0x679d('0x3'));var router=express[_0x679d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x679d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0x679d('0x6')]('/',auth[_0x679d('0x7')](),controller[_0x679d('0x8')]);router[_0x679d('0x6')](_0x679d('0x9'),auth[_0x679d('0x7')](),controller[_0x679d('0xa')]);router[_0x679d('0x6')]('/:id/hoppers',auth[_0x679d('0x7')](),controller[_0x679d('0xb')]);router[_0x679d('0x6')](_0x679d('0xc'),auth[_0x679d('0x7')](),controller[_0x679d('0xd')]);router[_0x679d('0x6')](_0x679d('0xe'),auth[_0x679d('0x7')](),controller[_0x679d('0xf')]);router[_0x679d('0x6')](_0x679d('0x10'),auth[_0x679d('0x7')](),controller['getHopperBlacks']);router[_0x679d('0x6')](_0x679d('0x11'),auth[_0x679d('0x7')](),controller[_0x679d('0x12')]);router[_0x679d('0x6')](_0x679d('0x13'),auth[_0x679d('0x7')](),controller[_0x679d('0x14')]);router[_0x679d('0x15')]('/',auth[_0x679d('0x7')](),controller[_0x679d('0x16')]);router['post'](_0x679d('0x17'),auth[_0x679d('0x7')](),controller[_0x679d('0x18')]);router['post']('/:id/lists',auth[_0x679d('0x7')](),controller[_0x679d('0x19')]);router[_0x679d('0x15')](_0x679d('0x13'),auth[_0x679d('0x7')](),controller[_0x679d('0x1a')]);router['put'](_0x679d('0x9'),auth[_0x679d('0x7')](),controller[_0x679d('0x1b')]);router['delete'](_0x679d('0x9'),auth[_0x679d('0x7')](),controller[_0x679d('0x1c')]);router[_0x679d('0x1d')]('/:id/lists',auth[_0x679d('0x7')](),controller[_0x679d('0x1e')]);router[_0x679d('0x1d')](_0x679d('0x13'),auth[_0x679d('0x7')](),controller[_0x679d('0x1f')]);module[_0x679d('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index a3dd274..034178b 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 _0xeab6=['key','sequelize','TEXT','medium','STRING','VIRTUAL','getDataValue'];(function(_0x575f22,_0x4413e3){var _0xaf149a=function(_0x493d89){while(--_0x493d89){_0x575f22['push'](_0x575f22['shift']());}};_0xaf149a(++_0x4413e3);}(_0xeab6,0x19e));var _0x6eab=function(_0xc6b104,_0x1d805a){_0xc6b104=_0xc6b104-0x0;var _0x1c6fce=_0xeab6[_0xc6b104];return _0x1c6fce;};'use strict';var Sequelize=require(_0x6eab('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x6eab('0x1')],'length':_0x6eab('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x6eab('0x3')]},'name':{'type':Sequelize[_0x6eab('0x4')],'get':function(){return this[_0x6eab('0x5')](_0x6eab('0x6'));}}};
\ No newline at end of file
+var _0x06c6=['VIRTUAL','getDataValue','STRING'];(function(_0x3bf181,_0x217849){var _0x41eb54=function(_0x18fb4e){while(--_0x18fb4e){_0x3bf181['push'](_0x3bf181['shift']());}};_0x41eb54(++_0x217849);}(_0x06c6,0xc5));var _0x606c=function(_0x373a0e,_0x4e6519){_0x373a0e=_0x373a0e-0x0;var _0x219314=_0x06c6[_0x373a0e];return _0x219314;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x606c('0x0')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x606c('0x0')]},'name':{'type':Sequelize[_0x606c('0x1')],'get':function(){return this[_0x606c('0x2')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 6400540..ba45b22 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 _0xbac9=['set','Content-Range','apply','reject','save','update','then','get','CannedAnswers','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','options','include','show','params','keys','CannedAnswer','intersection','find','body','catch','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count'];(function(_0x264530,_0xbfb41){var _0xe1e19e=function(_0x2a501a){while(--_0x2a501a){_0x264530['push'](_0x264530['shift']());}};_0xe1e19e(++_0xbfb41);}(_0xbac9,0x86));var _0x9bac=function(_0x212721,_0x1c0edc){_0x212721=_0x212721-0x0;var _0x369f08=_0xbac9[_0x212721];return _0x369f08;};'use strict';var emlformat=require(_0x9bac('0x0'));var rimraf=require(_0x9bac('0x1'));var zipdir=require(_0x9bac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9bac('0x3'));var moment=require(_0x9bac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9bac('0x5'));var util=require(_0x9bac('0x6'));var path=require(_0x9bac('0x7'));var sox=require(_0x9bac('0x8'));var csv=require(_0x9bac('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9bac('0xa'));var squel=require(_0x9bac('0xb'));var crypto=require(_0x9bac('0xc'));var jsforce=require(_0x9bac('0xd'));var deskjs=require(_0x9bac('0xe'));var toCsv=require(_0x9bac('0x9'));var querystring=require(_0x9bac('0xf'));var Papa=require(_0x9bac('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9bac('0x11'));var as=require(_0x9bac('0x12'));var hardwareService=require(_0x9bac('0x13'));var logger=require('../../config/logger')(_0x9bac('0x14'));var utils=require(_0x9bac('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9bac('0x16'))['db'];function respondWithStatusCode(_0x5da6a8,_0xe7561b){_0xe7561b=_0xe7561b||0xcc;return function(_0x372323){if(_0x372323){return _0x5da6a8['sendStatus'](_0xe7561b);}return _0x5da6a8[_0x9bac('0x17')](_0xe7561b)[_0x9bac('0x18')]();};}function respondWithResult(_0x4fb951,_0x245ba9){_0x245ba9=_0x245ba9||0xc8;return function(_0x31ce63){if(_0x31ce63){return _0x4fb951[_0x9bac('0x17')](_0x245ba9)[_0x9bac('0x19')](_0x31ce63);}};}function respondWithFilteredResult(_0x74419f,_0x12f225){return function(_0x19d265){if(_0x19d265){var _0x264270=typeof _0x12f225[_0x9bac('0x1a')]===_0x9bac('0x1b')&&typeof _0x12f225[_0x9bac('0x1c')]===_0x9bac('0x1b');var _0x22930a=_0x19d265['count'];var _0xb808b2=_0x264270?0x0:_0x12f225[_0x9bac('0x1a')];var _0x26fcba=_0x264270?_0x19d265[_0x9bac('0x1d')]:_0x12f225['offset']+_0x12f225[_0x9bac('0x1c')];var _0x3a9d7c;if(_0x26fcba>=_0x22930a){_0x26fcba=_0x22930a;_0x3a9d7c=0xc8;}else{_0x3a9d7c=0xce;}_0x74419f[_0x9bac('0x17')](_0x3a9d7c);return _0x74419f[_0x9bac('0x1e')](_0x9bac('0x1f'),_0xb808b2+'-'+_0x26fcba+'/'+_0x22930a)[_0x9bac('0x19')](_0x19d265);}return null;};}function patchUpdates(_0x242400){return function(_0x530604){try{jsonpatch[_0x9bac('0x20')](_0x530604,_0x242400,!![]);}catch(_0x24e1be){return BPromise[_0x9bac('0x21')](_0x24e1be);}return _0x530604[_0x9bac('0x22')]();};}function saveUpdates(_0x5373cf,_0xc6155b){return function(_0x5a3246){if(_0x5a3246){return _0x5a3246[_0x9bac('0x23')](_0x5373cf)[_0x9bac('0x24')](function(_0x1314c9){return _0x1314c9;});}return null;};}function removeEntity(_0xbb1800,_0x15762a){return function(_0x5ba4df){if(_0x5ba4df){return _0x5ba4df['destroy']()[_0x9bac('0x24')](function(){var _0x23dc19=_0x5ba4df[_0x9bac('0x25')]({'plain':!![]});var _0x47d0b2=_0x9bac('0x26');return db[_0x9bac('0x27')]['destroy']({'where':{'type':_0x47d0b2,'resourceId':_0x23dc19['id']}})[_0x9bac('0x24')](function(){return _0x5ba4df;});})[_0x9bac('0x24')](function(){_0xbb1800[_0x9bac('0x17')](0xcc)[_0x9bac('0x18')]();});}};}function handleEntityNotFound(_0x45525b,_0x3af06e){return function(_0x28f695){if(!_0x28f695){_0x45525b[_0x9bac('0x28')](0x194);}return _0x28f695;};}function handleError(_0x5902cf,_0x346237){_0x346237=_0x346237||0x1f4;return function(_0x26434d){logger['error'](_0x26434d[_0x9bac('0x29')]);if(_0x26434d[_0x9bac('0x2a')]){delete _0x26434d[_0x9bac('0x2a')];}_0x5902cf['status'](_0x346237)[_0x9bac('0x2b')](_0x26434d);};}exports[_0x9bac('0x2c')]=function(_0x429808,_0x3a94ad){var _0x368657={},_0x191ff6={},_0x289077={'count':0x0,'rows':[]};var _0x4aa371=_[_0x9bac('0x2d')](db['CannedAnswer'][_0x9bac('0x2e')],function(_0x462533){return{'name':_0x462533[_0x9bac('0x2f')],'type':_0x462533[_0x9bac('0x30')][_0x9bac('0x31')]};});_0x191ff6[_0x9bac('0x32')]=_[_0x9bac('0x2d')](_0x4aa371,'name');_0x191ff6[_0x9bac('0x33')]=_['keys'](_0x429808['query']);_0x191ff6['filters']=_['intersection'](_0x191ff6[_0x9bac('0x32')],_0x191ff6[_0x9bac('0x33')]);_0x368657[_0x9bac('0x34')]=_['intersection'](_0x191ff6[_0x9bac('0x32')],qs[_0x9bac('0x35')](_0x429808['query'][_0x9bac('0x35')]));_0x368657[_0x9bac('0x34')]=_0x368657['attributes'][_0x9bac('0x36')]?_0x368657[_0x9bac('0x34')]:_0x191ff6[_0x9bac('0x32')];if(!_0x429808[_0x9bac('0x33')][_0x9bac('0x37')](_0x9bac('0x38'))){_0x368657[_0x9bac('0x1c')]=qs['limit'](_0x429808[_0x9bac('0x33')][_0x9bac('0x1c')]);_0x368657[_0x9bac('0x1a')]=qs[_0x9bac('0x1a')](_0x429808['query'][_0x9bac('0x1a')]);}_0x368657['order']=qs['sort'](_0x429808[_0x9bac('0x33')][_0x9bac('0x39')]);_0x368657['where']=qs[_0x9bac('0x3a')](_['pick'](_0x429808[_0x9bac('0x33')],_0x191ff6[_0x9bac('0x3a')]),_0x4aa371);if(_0x429808[_0x9bac('0x33')][_0x9bac('0x3b')]){_0x368657[_0x9bac('0x3c')]=_[_0x9bac('0x3d')](_0x368657[_0x9bac('0x3c')],{'$or':[{'key':{'$like':'%'+_0x429808[_0x9bac('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0x429808[_0x9bac('0x33')][_0x9bac('0x3b')]+'%'}}]});}_0x368657=_[_0x9bac('0x3d')]({},_0x368657,_0x429808[_0x9bac('0x3e')]);var _0x1acfe4={'where':_0x368657['where']};return db['CannedAnswer'][_0x9bac('0x1d')](_0x1acfe4)[_0x9bac('0x24')](function(_0x2dd43a){_0x289077[_0x9bac('0x1d')]=_0x2dd43a;if(_0x429808[_0x9bac('0x33')]['includeAll']){_0x368657[_0x9bac('0x3f')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x368657);})[_0x9bac('0x24')](function(_0x15bad8){_0x289077['rows']=_0x15bad8;return _0x289077;})['then'](respondWithFilteredResult(_0x3a94ad,_0x368657))['catch'](handleError(_0x3a94ad,null));};exports[_0x9bac('0x40')]=function(_0x46963d,_0x57172f){var _0x3d0881={'raw':!![],'where':{'id':_0x46963d[_0x9bac('0x41')]['id']}},_0x13faa4={};_0x13faa4[_0x9bac('0x32')]=_[_0x9bac('0x42')](db[_0x9bac('0x43')][_0x9bac('0x2e')]);_0x13faa4[_0x9bac('0x33')]=_[_0x9bac('0x42')](_0x46963d['query']);_0x13faa4[_0x9bac('0x3a')]=_[_0x9bac('0x44')](_0x13faa4['model'],_0x13faa4[_0x9bac('0x33')]);_0x3d0881[_0x9bac('0x34')]=_[_0x9bac('0x44')](_0x13faa4[_0x9bac('0x32')],qs[_0x9bac('0x35')](_0x46963d['query']['fields']));_0x3d0881['attributes']=_0x3d0881[_0x9bac('0x34')][_0x9bac('0x36')]?_0x3d0881[_0x9bac('0x34')]:_0x13faa4[_0x9bac('0x32')];if(_0x46963d['query']['includeAll']){_0x3d0881[_0x9bac('0x3f')]=[{'all':!![]}];}_0x3d0881=_[_0x9bac('0x3d')]({},_0x3d0881,_0x46963d[_0x9bac('0x3e')]);return db[_0x9bac('0x43')][_0x9bac('0x45')](_0x3d0881)[_0x9bac('0x24')](handleEntityNotFound(_0x57172f,null))[_0x9bac('0x24')](respondWithResult(_0x57172f,null))['catch'](handleError(_0x57172f,null));};exports[_0x9bac('0x23')]=function(_0x2cae0a,_0x4bb85d){if(_0x2cae0a['body']['id']){delete _0x2cae0a['body']['id'];}return db[_0x9bac('0x43')][_0x9bac('0x45')]({'where':{'id':_0x2cae0a[_0x9bac('0x41')]['id']}})[_0x9bac('0x24')](handleEntityNotFound(_0x4bb85d,null))[_0x9bac('0x24')](saveUpdates(_0x2cae0a[_0x9bac('0x46')],null))['then'](respondWithResult(_0x4bb85d,null))[_0x9bac('0x47')](handleError(_0x4bb85d,null));};exports['destroy']=function(_0x391336,_0x5a2e3a){return db[_0x9bac('0x43')][_0x9bac('0x45')]({'where':{'id':_0x391336[_0x9bac('0x41')]['id']}})[_0x9bac('0x24')](handleEntityNotFound(_0x5a2e3a,null))[_0x9bac('0x24')](removeEntity(_0x5a2e3a,null))[_0x9bac('0x47')](handleError(_0x5a2e3a,null));};exports[_0x9bac('0x48')]=function(_0x217bd3,_0x5f3aa3){var _0x1df92f={'key':_0x217bd3[_0x9bac('0x46')]['key']};if(_0x217bd3[_0x9bac('0x46')][_0x9bac('0x49')]){_0x1df92f[_0x9bac('0x49')]=_0x217bd3[_0x9bac('0x46')][_0x9bac('0x49')];}else if(_0x217bd3[_0x9bac('0x46')][_0x9bac('0x4a')]){_0x1df92f[_0x9bac('0x4a')]=_0x217bd3[_0x9bac('0x46')][_0x9bac('0x4a')];}else if(_0x217bd3[_0x9bac('0x46')]['OpenchannelAccountId']){_0x1df92f[_0x9bac('0x4b')]=_0x217bd3[_0x9bac('0x46')][_0x9bac('0x4b')];}else if(_0x217bd3['body'][_0x9bac('0x4c')]){_0x1df92f[_0x9bac('0x4c')]=_0x217bd3[_0x9bac('0x46')]['ChatWebsiteId'];}return db[_0x9bac('0x43')][_0x9bac('0x45')]({'where':_0x1df92f})[_0x9bac('0x24')](function(_0x335d2d){if(_0x335d2d){throw new db['Sequelize']['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x9bac('0x43')][_0x9bac('0x48')](_0x217bd3[_0x9bac('0x46')]);})['then'](function(_0x315369){var _0xa5d6ea=_0x217bd3[_0x9bac('0x4d')][_0x9bac('0x25')]({'plain':!![]});if(!_0xa5d6ea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa5d6ea[_0x9bac('0x4e')]===_0x9bac('0x4d')){var _0x2ee60e=_0x315369[_0x9bac('0x25')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x9bac('0x26'),'userProfileId':_0xa5d6ea['userProfileId']},'raw':!![]})['then'](function(_0x2cb933){if(_0x2cb933&&_0x2cb933[_0x9bac('0x4f')]===0x0){return db[_0x9bac('0x27')][_0x9bac('0x48')]({'name':_0x2ee60e['name'],'resourceId':_0x2ee60e['id'],'type':_0x2cb933[_0x9bac('0x2a')],'sectionId':_0x2cb933['id']},{})[_0x9bac('0x24')](function(){return _0x315369;});}else{return _0x315369;}})[_0x9bac('0x47')](function(_0x303e7f){logger[_0x9bac('0x50')](_0x9bac('0x51'),_0x303e7f);throw _0x303e7f;});}return _0x315369;})[_0x9bac('0x24')](respondWithResult(_0x5f3aa3,0xc9))[_0x9bac('0x47')](handleError(_0x5f3aa3,null));};
\ No newline at end of file
+var _0xea3b=['name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','options','find','update','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','request-promise','moment','mustache','util','path','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','then','CannedAnswers','UserProfileResource','destroy','error','stack'];(function(_0x26389c,_0x761ed6){var _0x432a39=function(_0x571e77){while(--_0x571e77){_0x26389c['push'](_0x26389c['shift']());}};_0x432a39(++_0x761ed6);}(_0xea3b,0x133));var _0xbea3=function(_0x3b16e1,_0x3bda3e){_0x3b16e1=_0x3b16e1-0x0;var _0x311d1b=_0xea3b[_0x3b16e1];return _0x311d1b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbea3('0x0'));var moment=require(_0xbea3('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xbea3('0x2'));var util=require(_0xbea3('0x3'));var path=require(_0xbea3('0x4'));var sox=require('sox');var csv=require(_0xbea3('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbea3('0x6'));var _=require('lodash');var squel=require(_0xbea3('0x7'));var crypto=require(_0xbea3('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbea3('0x9'));var Papa=require(_0xbea3('0xa'));var Redis=require(_0xbea3('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xbea3('0xc'));var as=require(_0xbea3('0xd'));var hardwareService=require(_0xbea3('0xe'));var logger=require(_0xbea3('0xf'))(_0xbea3('0x10'));var utils=require('../../config/utils');var config=require(_0xbea3('0x11'));var licenseUtil=require(_0xbea3('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4db077,_0x13094a){_0x13094a=_0x13094a||0xcc;return function(_0x1d10c1){if(_0x1d10c1){return _0x4db077[_0xbea3('0x13')](_0x13094a);}return _0x4db077[_0xbea3('0x14')](_0x13094a)[_0xbea3('0x15')]();};}function respondWithResult(_0x41bdbc,_0x478ae6){_0x478ae6=_0x478ae6||0xc8;return function(_0x4e6609){if(_0x4e6609){return _0x41bdbc[_0xbea3('0x14')](_0x478ae6)[_0xbea3('0x16')](_0x4e6609);}};}function respondWithFilteredResult(_0x4ff9c6,_0x31dd60){return function(_0x1a4687){if(_0x1a4687){var _0x508dca=typeof _0x31dd60['offset']==='undefined'&&typeof _0x31dd60[_0xbea3('0x17')]===_0xbea3('0x18');var _0x4165e2=_0x1a4687[_0xbea3('0x19')];var _0x12027d=_0x508dca?0x0:_0x31dd60['offset'];var _0x2b03f8=_0x508dca?_0x1a4687[_0xbea3('0x19')]:_0x31dd60[_0xbea3('0x1a')]+_0x31dd60[_0xbea3('0x17')];var _0x524e34;if(_0x2b03f8>=_0x4165e2){_0x2b03f8=_0x4165e2;_0x524e34=0xc8;}else{_0x524e34=0xce;}_0x4ff9c6[_0xbea3('0x14')](_0x524e34);return _0x4ff9c6['set'](_0xbea3('0x1b'),_0x12027d+'-'+_0x2b03f8+'/'+_0x4165e2)['json'](_0x1a4687);}return null;};}function patchUpdates(_0x23e762){return function(_0x565056){try{jsonpatch[_0xbea3('0x1c')](_0x565056,_0x23e762,!![]);}catch(_0x15936b){return BPromise[_0xbea3('0x1d')](_0x15936b);}return _0x565056[_0xbea3('0x1e')]();};}function saveUpdates(_0x4af4be,_0xd90926){return function(_0x40f97f){if(_0x40f97f){return _0x40f97f['update'](_0x4af4be)['then'](function(_0x450d86){return _0x450d86;});}return null;};}function removeEntity(_0x2851ee,_0x556079){return function(_0x47e612){if(_0x47e612){return _0x47e612['destroy']()[_0xbea3('0x1f')](function(){var _0xad4ef1=_0x47e612['get']({'plain':!![]});var _0x34548d=_0xbea3('0x20');return db[_0xbea3('0x21')][_0xbea3('0x22')]({'where':{'type':_0x34548d,'resourceId':_0xad4ef1['id']}})[_0xbea3('0x1f')](function(){return _0x47e612;});})[_0xbea3('0x1f')](function(){_0x2851ee['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e3286,_0x3191d8){return function(_0x328b6d){if(!_0x328b6d){_0x1e3286['sendStatus'](0x194);}return _0x328b6d;};}function handleError(_0x24bee6,_0x2a2201){_0x2a2201=_0x2a2201||0x1f4;return function(_0x3a7a39){logger[_0xbea3('0x23')](_0x3a7a39[_0xbea3('0x24')]);if(_0x3a7a39['name']){delete _0x3a7a39[_0xbea3('0x25')];}_0x24bee6[_0xbea3('0x14')](_0x2a2201)[_0xbea3('0x26')](_0x3a7a39);};}exports[_0xbea3('0x27')]=function(_0x267f2d,_0x3981c7){var _0x40bf44={},_0x4d9bc9={},_0x4d6002={'count':0x0,'rows':[]};var _0x341122=_[_0xbea3('0x28')](db[_0xbea3('0x29')][_0xbea3('0x2a')],function(_0x36da18){return{'name':_0x36da18['fieldName'],'type':_0x36da18[_0xbea3('0x2b')][_0xbea3('0x2c')]};});_0x4d9bc9[_0xbea3('0x2d')]=_[_0xbea3('0x28')](_0x341122,'name');_0x4d9bc9[_0xbea3('0x2e')]=_[_0xbea3('0x2f')](_0x267f2d['query']);_0x4d9bc9[_0xbea3('0x30')]=_['intersection'](_0x4d9bc9['model'],_0x4d9bc9['query']);_0x40bf44[_0xbea3('0x31')]=_[_0xbea3('0x32')](_0x4d9bc9[_0xbea3('0x2d')],qs[_0xbea3('0x33')](_0x267f2d[_0xbea3('0x2e')][_0xbea3('0x33')]));_0x40bf44['attributes']=_0x40bf44['attributes'][_0xbea3('0x34')]?_0x40bf44[_0xbea3('0x31')]:_0x4d9bc9[_0xbea3('0x2d')];if(!_0x267f2d[_0xbea3('0x2e')][_0xbea3('0x35')]('nolimit')){_0x40bf44['limit']=qs['limit'](_0x267f2d[_0xbea3('0x2e')]['limit']);_0x40bf44[_0xbea3('0x1a')]=qs[_0xbea3('0x1a')](_0x267f2d['query']['offset']);}_0x40bf44[_0xbea3('0x36')]=qs[_0xbea3('0x37')](_0x267f2d[_0xbea3('0x2e')][_0xbea3('0x37')]);_0x40bf44['where']=qs[_0xbea3('0x30')](_[_0xbea3('0x38')](_0x267f2d[_0xbea3('0x2e')],_0x4d9bc9['filters']),_0x341122);if(_0x267f2d[_0xbea3('0x2e')][_0xbea3('0x39')]){_0x40bf44[_0xbea3('0x3a')]=_[_0xbea3('0x3b')](_0x40bf44[_0xbea3('0x3a')],{'$or':[{'key':{'$like':'%'+_0x267f2d[_0xbea3('0x2e')][_0xbea3('0x39')]+'%'}},{'value':{'$like':'%'+_0x267f2d['query'][_0xbea3('0x39')]+'%'}}]});}_0x40bf44=_[_0xbea3('0x3b')]({},_0x40bf44,_0x267f2d['options']);var _0x1c52fd={'where':_0x40bf44[_0xbea3('0x3a')]};return db[_0xbea3('0x29')]['count'](_0x1c52fd)[_0xbea3('0x1f')](function(_0x181754){_0x4d6002[_0xbea3('0x19')]=_0x181754;if(_0x267f2d[_0xbea3('0x2e')][_0xbea3('0x3c')]){_0x40bf44[_0xbea3('0x3d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xbea3('0x3e')](_0x40bf44);})[_0xbea3('0x1f')](function(_0x2453b1){_0x4d6002[_0xbea3('0x3f')]=_0x2453b1;return _0x4d6002;})[_0xbea3('0x1f')](respondWithFilteredResult(_0x3981c7,_0x40bf44))[_0xbea3('0x40')](handleError(_0x3981c7,null));};exports[_0xbea3('0x41')]=function(_0x1a3481,_0x1ad8b1){var _0x9e40c6={'raw':!![],'where':{'id':_0x1a3481[_0xbea3('0x42')]['id']}},_0x4b9550={};_0x4b9550['model']=_['keys'](db['CannedAnswer'][_0xbea3('0x2a')]);_0x4b9550[_0xbea3('0x2e')]=_['keys'](_0x1a3481[_0xbea3('0x2e')]);_0x4b9550['filters']=_[_0xbea3('0x32')](_0x4b9550[_0xbea3('0x2d')],_0x4b9550[_0xbea3('0x2e')]);_0x9e40c6['attributes']=_[_0xbea3('0x32')](_0x4b9550[_0xbea3('0x2d')],qs[_0xbea3('0x33')](_0x1a3481[_0xbea3('0x2e')]['fields']));_0x9e40c6[_0xbea3('0x31')]=_0x9e40c6['attributes'][_0xbea3('0x34')]?_0x9e40c6[_0xbea3('0x31')]:_0x4b9550[_0xbea3('0x2d')];if(_0x1a3481[_0xbea3('0x2e')][_0xbea3('0x3c')]){_0x9e40c6[_0xbea3('0x3d')]=[{'all':!![]}];}_0x9e40c6=_['merge']({},_0x9e40c6,_0x1a3481[_0xbea3('0x43')]);return db['CannedAnswer'][_0xbea3('0x44')](_0x9e40c6)[_0xbea3('0x1f')](handleEntityNotFound(_0x1ad8b1,null))[_0xbea3('0x1f')](respondWithResult(_0x1ad8b1,null))['catch'](handleError(_0x1ad8b1,null));};exports[_0xbea3('0x45')]=function(_0x5868fe,_0x17b9a0){if(_0x5868fe[_0xbea3('0x46')]['id']){delete _0x5868fe[_0xbea3('0x46')]['id'];}return db['CannedAnswer'][_0xbea3('0x44')]({'where':{'id':_0x5868fe[_0xbea3('0x42')]['id']}})[_0xbea3('0x1f')](handleEntityNotFound(_0x17b9a0,null))[_0xbea3('0x1f')](saveUpdates(_0x5868fe[_0xbea3('0x46')],null))[_0xbea3('0x1f')](respondWithResult(_0x17b9a0,null))[_0xbea3('0x40')](handleError(_0x17b9a0,null));};exports[_0xbea3('0x22')]=function(_0x286873,_0x56913b){return db[_0xbea3('0x29')][_0xbea3('0x44')]({'where':{'id':_0x286873[_0xbea3('0x42')]['id']}})['then'](handleEntityNotFound(_0x56913b,null))[_0xbea3('0x1f')](removeEntity(_0x56913b,null))[_0xbea3('0x40')](handleError(_0x56913b,null));};exports['create']=function(_0x44ea6c,_0x39df5d){var _0x25cf99={'key':_0x44ea6c[_0xbea3('0x46')]['key']};if(_0x44ea6c[_0xbea3('0x46')][_0xbea3('0x47')]){_0x25cf99['MailAccountId']=_0x44ea6c['body']['MailAccountId'];}else if(_0x44ea6c['body']['SmsAccountId']){_0x25cf99[_0xbea3('0x48')]=_0x44ea6c['body'][_0xbea3('0x48')];}else if(_0x44ea6c['body'][_0xbea3('0x49')]){_0x25cf99[_0xbea3('0x49')]=_0x44ea6c['body'][_0xbea3('0x49')];}else if(_0x44ea6c[_0xbea3('0x46')][_0xbea3('0x4a')]){_0x25cf99['ChatWebsiteId']=_0x44ea6c[_0xbea3('0x46')][_0xbea3('0x4a')];}return db[_0xbea3('0x29')][_0xbea3('0x44')]({'where':_0x25cf99})[_0xbea3('0x1f')](function(_0x32f482){if(_0x32f482){throw new db[(_0xbea3('0x4b'))][(_0xbea3('0x4c'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xbea3('0x29')][_0xbea3('0x4d')](_0x44ea6c['body']);})[_0xbea3('0x1f')](function(_0x3269d7){var _0x4584b8=_0x44ea6c['user'][_0xbea3('0x4e')]({'plain':!![]});if(!_0x4584b8)throw new Error(_0xbea3('0x4f'));if(_0x4584b8[_0xbea3('0x50')]===_0xbea3('0x51')){var _0x40da9f=_0x3269d7[_0xbea3('0x4e')]({'plain':!![]});return db[_0xbea3('0x52')][_0xbea3('0x44')]({'where':{'name':'CannedAnswers','userProfileId':_0x4584b8[_0xbea3('0x53')]},'raw':!![]})[_0xbea3('0x1f')](function(_0x406de6){if(_0x406de6&&_0x406de6[_0xbea3('0x54')]===0x0){return db[_0xbea3('0x21')]['create']({'name':_0x40da9f['name'],'resourceId':_0x40da9f['id'],'type':_0x406de6[_0xbea3('0x25')],'sectionId':_0x406de6['id']},{})[_0xbea3('0x1f')](function(){return _0x3269d7;});}else{return _0x3269d7;}})[_0xbea3('0x40')](function(_0x61c3a0){logger[_0xbea3('0x23')](_0xbea3('0x55'),_0x61c3a0);throw _0x61c3a0;});}return _0x3269d7;})[_0xbea3('0x1f')](respondWithResult(_0x39df5d,0xc9))[_0xbea3('0x40')](handleError(_0x39df5d,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 0736d51..dbcb3ed 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 _0x3c66=['define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2cc711,_0x300328){var _0x31a52e=function(_0x588378){while(--_0x588378){_0x2cc711['push'](_0x2cc711['shift']());}};_0x31a52e(++_0x300328);}(_0x3c66,0xdc));var _0x63c6=function(_0x588b13,_0x245938){_0x588b13=_0x588b13-0x0;var _0x3861ec=_0x3c66[_0x588b13];return _0x3861ec;};'use strict';var _=require(_0x63c6('0x0'));var util=require(_0x63c6('0x1'));var logger=require('../../config/logger')(_0x63c6('0x2'));var moment=require(_0x63c6('0x3'));var BPromise=require(_0x63c6('0x4'));var rp=require(_0x63c6('0x5'));var fs=require('fs');var path=require(_0x63c6('0x6'));var rimraf=require('rimraf');var config=require(_0x63c6('0x7'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0xd79c07,_0x4677cf){return _0xd79c07[_0x63c6('0x8')]('CannedAnswer',attributes,{'tableName':_0x63c6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x63c6('0xa'),'collate':_0x63c6('0xb')});};
\ No newline at end of file
+var _0x874f=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x2652ef,_0x234230){var _0x2db578=function(_0x56b137){while(--_0x56b137){_0x2652ef['push'](_0x2652ef['shift']());}};_0x2db578(++_0x234230);}(_0x874f,0x145));var _0xf874=function(_0x4d03d6,_0x438a06){_0x4d03d6=_0x4d03d6-0x0;var _0x22752e=_0x874f[_0x4d03d6];return _0x22752e;};'use strict';var _=require(_0xf874('0x0'));var util=require(_0xf874('0x1'));var logger=require('../../config/logger')(_0xf874('0x2'));var moment=require(_0xf874('0x3'));var BPromise=require('bluebird');var rp=require(_0xf874('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf874('0x5'));var config=require(_0xf874('0x6'));var attributes=require(_0xf874('0x7'));module[_0xf874('0x8')]=function(_0x4d230f,_0x1d8dae){return _0x4d230f[_0xf874('0x9')](_0xf874('0xa'),attributes,{'tableName':_0xf874('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf874('0xc'),'collate':_0xf874('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 58a0c93..fb772a5 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(_0x3b4621,_0x4d2c4d){var _0x5f5120=function(_0x11fcf3){while(--_0x11fcf3){_0x3b4621['push'](_0x3b4621['shift']());}};_0x5f5120(++_0x4d2c4d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x49cbed,_0x4eb100){var _0xe30f6=function(_0x2714f2){while(--_0x2714f2){_0x49cbed['push'](_0x49cbed['shift']());}};_0xe30f6(++_0x4eb100);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 7e0a9ac..c011762 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 _0xbd1e=['isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller'];(function(_0x2faa2b,_0x1af296){var _0x3d0ec7=function(_0x363f29){while(--_0x363f29){_0x2faa2b['push'](_0x2faa2b['shift']());}};_0x3d0ec7(++_0x1af296);}(_0xbd1e,0x14b));var _0xebd1=function(_0x70bb8,_0x1da278){_0x70bb8=_0x70bb8-0x0;var _0x48ba84=_0xbd1e[_0x70bb8];return _0x48ba84;};'use strict';var multer=require(_0xebd1('0x0'));var util=require(_0xebd1('0x1'));var path=require(_0xebd1('0x2'));var timeout=require('connect-timeout');var express=require(_0xebd1('0x3'));var router=express['Router']();var fs_extra=require(_0xebd1('0x4'));var auth=require(_0xebd1('0x5'));var interaction=require(_0xebd1('0x6'));var config=require(_0xebd1('0x7'));var controller=require(_0xebd1('0x8'));router['get']('/',auth[_0xebd1('0x9')](),controller[_0xebd1('0xa')]);router[_0xebd1('0xb')](_0xebd1('0xc'),auth[_0xebd1('0x9')](),controller[_0xebd1('0xd')]);router[_0xebd1('0xe')]('/',auth[_0xebd1('0x9')](),controller[_0xebd1('0xf')]);router[_0xebd1('0x10')](_0xebd1('0xc'),auth[_0xebd1('0x9')](),controller[_0xebd1('0x11')]);router['delete'](_0xebd1('0xc'),auth[_0xebd1('0x9')](),controller[_0xebd1('0x12')]);module[_0xebd1('0x13')]=router;
\ No newline at end of file
+var _0xa62b=['get','index','/:id','isAuthenticated','create','put','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller'];(function(_0x124f88,_0x3ad501){var _0xed0e3b=function(_0x43a67d){while(--_0x43a67d){_0x124f88['push'](_0x124f88['shift']());}};_0xed0e3b(++_0x3ad501);}(_0xa62b,0x129));var _0xba62=function(_0x485d08,_0x428c32){_0x485d08=_0x485d08-0x0;var _0x55c64c=_0xa62b[_0x485d08];return _0x55c64c;};'use strict';var multer=require('multer');var util=require(_0xba62('0x0'));var path=require(_0xba62('0x1'));var timeout=require(_0xba62('0x2'));var express=require(_0xba62('0x3'));var router=express[_0xba62('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xba62('0x5'));var interaction=require(_0xba62('0x6'));var config=require(_0xba62('0x7'));var controller=require(_0xba62('0x8'));router[_0xba62('0x9')]('/',auth['isAuthenticated'](),controller[_0xba62('0xa')]);router[_0xba62('0x9')](_0xba62('0xb'),auth[_0xba62('0xc')](),controller['show']);router['post']('/',auth[_0xba62('0xc')](),controller[_0xba62('0xd')]);router[_0xba62('0xe')]('/:id',auth[_0xba62('0xc')](),controller[_0xba62('0xf')]);router[_0xba62('0x10')](_0xba62('0xb'),auth[_0xba62('0xc')](),controller['destroy']);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 dce03da..a5c96c4 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 _0x3b43=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3b43,0x71));var _0x33b4=function(_0x107da1,_0x1de358){_0x107da1=_0x107da1-0x0;var _0x5c4ced=_0x3b43[_0x107da1];return _0x5c4ced;};'use strict';var Sequelize=require(_0x33b4('0x0'));module[_0x33b4('0x1')]={'calldate':{'type':Sequelize[_0x33b4('0x2')],'allowNull':![],'defaultValue':_0x33b4('0x3')},'clid':{'type':Sequelize[_0x33b4('0x4')]},'src':{'type':Sequelize[_0x33b4('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x33b4('0x4')]},'channel':{'type':Sequelize[_0x33b4('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x33b4('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x33b4('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x33b4('0x4')]},'amaflags':{'type':Sequelize[_0x33b4('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x33b4('0x4')]},'userfield':{'type':Sequelize[_0x33b4('0x4')]},'uniqueid':{'type':Sequelize[_0x33b4('0x4')]},'linkedid':{'type':Sequelize[_0x33b4('0x4')]},'sequence':{'type':Sequelize[_0x33b4('0x4')]},'peeraccount':{'type':Sequelize[_0x33b4('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x33b4('0x4')]}};
\ No newline at end of file
+var _0x5bb7=['sequelize','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x5d82d9,_0x3d7694){var _0x3dfd86=function(_0x53735e){while(--_0x53735e){_0x5d82d9['push'](_0x5d82d9['shift']());}};_0x3dfd86(++_0x3d7694);}(_0x5bb7,0x104));var _0x75bb=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x5bb7[_0xf50820];return _0x2a9b10;};'use strict';var Sequelize=require(_0x75bb('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x75bb('0x1')],'allowNull':![],'defaultValue':_0x75bb('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x75bb('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x75bb('0x3')]},'dstchannel':{'type':Sequelize[_0x75bb('0x3')]},'lastapp':{'type':Sequelize[_0x75bb('0x3')]},'lastdata':{'type':Sequelize[_0x75bb('0x3')]},'duration':{'type':Sequelize[_0x75bb('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x75bb('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x75bb('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x75bb('0x3')]},'userfield':{'type':Sequelize[_0x75bb('0x3')]},'uniqueid':{'type':Sequelize[_0x75bb('0x3')]},'linkedid':{'type':Sequelize[_0x75bb('0x3')]},'sequence':{'type':Sequelize[_0x75bb('0x3')]},'peeraccount':{'type':Sequelize[_0x75bb('0x3')]},'type':{'type':Sequelize[_0x75bb('0x3')]},'tag':{'type':Sequelize[_0x75bb('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index b0ee079..25dd2d8 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 _0xf725=['save','update','then','destroy','error','stack','name','send','index','map','Cdr','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','keys','rawAttributes','length','include','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../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','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x483dfa,_0x1942b9){var _0x5ccfee=function(_0x1b8c95){while(--_0x1b8c95){_0x483dfa['push'](_0x483dfa['shift']());}};_0x5ccfee(++_0x1942b9);}(_0xf725,0x7e));var _0x5f72=function(_0x2f20ad,_0x137cfc){_0x2f20ad=_0x2f20ad-0x0;var _0x5dd3ae=_0xf725[_0x2f20ad];return _0x5dd3ae;};'use strict';var emlformat=require(_0x5f72('0x0'));var rimraf=require(_0x5f72('0x1'));var zipdir=require(_0x5f72('0x2'));var jsonpatch=require(_0x5f72('0x3'));var rp=require(_0x5f72('0x4'));var moment=require(_0x5f72('0x5'));var BPromise=require(_0x5f72('0x6'));var Mustache=require(_0x5f72('0x7'));var util=require(_0x5f72('0x8'));var path=require(_0x5f72('0x9'));var sox=require('sox');var csv=require(_0x5f72('0xa'));var ejs=require(_0x5f72('0xb'));var fs=require('fs');var fs_extra=require(_0x5f72('0xc'));var _=require(_0x5f72('0xd'));var squel=require(_0x5f72('0xe'));var crypto=require(_0x5f72('0xf'));var jsforce=require(_0x5f72('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5f72('0x11'));var Papa=require(_0x5f72('0x12'));var Redis=require('ioredis');var authService=require(_0x5f72('0x13'));var qs=require(_0x5f72('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f72('0x15'));var logger=require(_0x5f72('0x16'))(_0x5f72('0x17'));var utils=require(_0x5f72('0x18'));var config=require(_0x5f72('0x19'));var licenseUtil=require(_0x5f72('0x1a'));var db=require(_0x5f72('0x1b'))['db'];function respondWithStatusCode(_0x537d7d,_0x1ac591){_0x1ac591=_0x1ac591||0xcc;return function(_0x3307ed){if(_0x3307ed){return _0x537d7d[_0x5f72('0x1c')](_0x1ac591);}return _0x537d7d[_0x5f72('0x1d')](_0x1ac591)[_0x5f72('0x1e')]();};}function respondWithResult(_0x57007a,_0x43d1fd){_0x43d1fd=_0x43d1fd||0xc8;return function(_0x4f81e9){if(_0x4f81e9){return _0x57007a['status'](_0x43d1fd)[_0x5f72('0x1f')](_0x4f81e9);}};}function respondWithFilteredResult(_0x5a036c,_0x3267a){return function(_0x4adc76){if(_0x4adc76){var _0x317eed=typeof _0x3267a['offset']===_0x5f72('0x20')&&typeof _0x3267a[_0x5f72('0x21')]==='undefined';var _0xea99d5=_0x4adc76[_0x5f72('0x22')];var _0x1497d4=_0x317eed?0x0:_0x3267a['offset'];var _0x490d14=_0x317eed?_0x4adc76['count']:_0x3267a[_0x5f72('0x23')]+_0x3267a[_0x5f72('0x21')];var _0x269dae;if(_0x490d14>=_0xea99d5){_0x490d14=_0xea99d5;_0x269dae=0xc8;}else{_0x269dae=0xce;}_0x5a036c[_0x5f72('0x1d')](_0x269dae);return _0x5a036c[_0x5f72('0x24')](_0x5f72('0x25'),_0x1497d4+'-'+_0x490d14+'/'+_0xea99d5)[_0x5f72('0x1f')](_0x4adc76);}return null;};}function patchUpdates(_0x5859fc){return function(_0x151a67){try{jsonpatch[_0x5f72('0x26')](_0x151a67,_0x5859fc,!![]);}catch(_0xd6dff9){return BPromise[_0x5f72('0x27')](_0xd6dff9);}return _0x151a67[_0x5f72('0x28')]();};}function saveUpdates(_0x2c599a,_0x30235e){return function(_0x367716){if(_0x367716){return _0x367716[_0x5f72('0x29')](_0x2c599a)[_0x5f72('0x2a')](function(_0x21c7d2){return _0x21c7d2;});}return null;};}function removeEntity(_0x530009,_0x433935){return function(_0x21f4a3){if(_0x21f4a3){return _0x21f4a3[_0x5f72('0x2b')]()[_0x5f72('0x2a')](function(){_0x530009['status'](0xcc)[_0x5f72('0x1e')]();});}};}function handleEntityNotFound(_0x3d05bc,_0x5c3325){return function(_0x447019){if(!_0x447019){_0x3d05bc[_0x5f72('0x1c')](0x194);}return _0x447019;};}function handleError(_0x347723,_0x521174){_0x521174=_0x521174||0x1f4;return function(_0x58ff77){logger[_0x5f72('0x2c')](_0x58ff77[_0x5f72('0x2d')]);if(_0x58ff77[_0x5f72('0x2e')]){delete _0x58ff77[_0x5f72('0x2e')];}_0x347723[_0x5f72('0x1d')](_0x521174)[_0x5f72('0x2f')](_0x58ff77);};}exports[_0x5f72('0x30')]=function(_0x59af82,_0x1b12cd){var _0x49eea5={},_0xc8ca5a={},_0x35fa31={'count':0x0,'rows':[]};var _0x7cce31=_[_0x5f72('0x31')](db[_0x5f72('0x32')]['rawAttributes'],function(_0x502057){return{'name':_0x502057[_0x5f72('0x33')],'type':_0x502057[_0x5f72('0x34')][_0x5f72('0x35')]};});_0xc8ca5a[_0x5f72('0x36')]=_[_0x5f72('0x31')](_0x7cce31,_0x5f72('0x2e'));_0xc8ca5a[_0x5f72('0x37')]=_['keys'](_0x59af82[_0x5f72('0x37')]);_0xc8ca5a[_0x5f72('0x38')]=_[_0x5f72('0x39')](_0xc8ca5a[_0x5f72('0x36')],_0xc8ca5a[_0x5f72('0x37')]);_0x49eea5['attributes']=_[_0x5f72('0x39')](_0xc8ca5a[_0x5f72('0x36')],qs[_0x5f72('0x3a')](_0x59af82[_0x5f72('0x37')][_0x5f72('0x3a')]));_0x49eea5[_0x5f72('0x3b')]=_0x49eea5['attributes']['length']?_0x49eea5[_0x5f72('0x3b')]:_0xc8ca5a[_0x5f72('0x36')];if(!_0x59af82['query'][_0x5f72('0x3c')](_0x5f72('0x3d'))){_0x49eea5[_0x5f72('0x21')]=qs[_0x5f72('0x21')](_0x59af82[_0x5f72('0x37')][_0x5f72('0x21')]);_0x49eea5[_0x5f72('0x23')]=qs[_0x5f72('0x23')](_0x59af82[_0x5f72('0x37')][_0x5f72('0x23')]);}_0x49eea5[_0x5f72('0x3e')]=qs[_0x5f72('0x3f')](_0x59af82[_0x5f72('0x37')][_0x5f72('0x3f')]);_0x49eea5['where']=qs[_0x5f72('0x38')](_['pick'](_0x59af82['query'],_0xc8ca5a[_0x5f72('0x38')]),_0x7cce31);if(_0x59af82[_0x5f72('0x37')][_0x5f72('0x40')]){_0x49eea5[_0x5f72('0x41')]=_[_0x5f72('0x42')](_0x49eea5[_0x5f72('0x41')],{'$or':_['map'](_0x7cce31,function(_0x1b9692){if(_0x1b9692[_0x5f72('0x34')]!==_0x5f72('0x43')){var _0x40d988={};_0x40d988[_0x1b9692[_0x5f72('0x2e')]]={'$like':'%'+_0x59af82[_0x5f72('0x37')][_0x5f72('0x40')]+'%'};return _0x40d988;}})});}_0x49eea5=_[_0x5f72('0x42')]({},_0x49eea5,_0x59af82[_0x5f72('0x44')]);var _0x2b8549={'where':_0x49eea5[_0x5f72('0x41')]};return db[_0x5f72('0x32')][_0x5f72('0x22')](_0x2b8549)[_0x5f72('0x2a')](function(_0xefdf17){_0x35fa31['count']=_0xefdf17;if(_0x59af82['query'][_0x5f72('0x45')]){_0x49eea5['include']=[{'all':!![]}];}return db['Cdr'][_0x5f72('0x46')](_0x49eea5);})[_0x5f72('0x2a')](function(_0x57d320){_0x35fa31[_0x5f72('0x47')]=_0x57d320;return _0x35fa31;})[_0x5f72('0x2a')](respondWithFilteredResult(_0x1b12cd,_0x49eea5))['catch'](handleError(_0x1b12cd,null));};exports[_0x5f72('0x48')]=function(_0x2314ea,_0x4f2d4a){var _0xcfefc5={'raw':!![],'where':{'id':_0x2314ea['params']['id']}},_0x4f57a6={};_0x4f57a6[_0x5f72('0x36')]=_[_0x5f72('0x49')](db[_0x5f72('0x32')][_0x5f72('0x4a')]);_0x4f57a6[_0x5f72('0x37')]=_[_0x5f72('0x49')](_0x2314ea[_0x5f72('0x37')]);_0x4f57a6['filters']=_[_0x5f72('0x39')](_0x4f57a6[_0x5f72('0x36')],_0x4f57a6[_0x5f72('0x37')]);_0xcfefc5[_0x5f72('0x3b')]=_['intersection'](_0x4f57a6[_0x5f72('0x36')],qs[_0x5f72('0x3a')](_0x2314ea[_0x5f72('0x37')][_0x5f72('0x3a')]));_0xcfefc5['attributes']=_0xcfefc5[_0x5f72('0x3b')][_0x5f72('0x4b')]?_0xcfefc5[_0x5f72('0x3b')]:_0x4f57a6[_0x5f72('0x36')];if(_0x2314ea['query'][_0x5f72('0x45')]){_0xcfefc5[_0x5f72('0x4c')]=[{'all':!![]}];}_0xcfefc5=_['merge']({},_0xcfefc5,_0x2314ea[_0x5f72('0x44')]);return db[_0x5f72('0x32')]['find'](_0xcfefc5)[_0x5f72('0x2a')](handleEntityNotFound(_0x4f2d4a,null))[_0x5f72('0x2a')](respondWithResult(_0x4f2d4a,null))[_0x5f72('0x4d')](handleError(_0x4f2d4a,null));};exports['create']=function(_0xc30598,_0x5efa48){return db[_0x5f72('0x32')][_0x5f72('0x4e')](_0xc30598['body'],{})[_0x5f72('0x2a')](respondWithResult(_0x5efa48,0xc9))[_0x5f72('0x4d')](handleError(_0x5efa48,null));};exports[_0x5f72('0x29')]=function(_0x302fff,_0x506774){if(_0x302fff[_0x5f72('0x4f')]['id']){delete _0x302fff[_0x5f72('0x4f')]['id'];}return db[_0x5f72('0x32')][_0x5f72('0x50')]({'where':{'id':_0x302fff['params']['id']}})[_0x5f72('0x2a')](handleEntityNotFound(_0x506774,null))['then'](saveUpdates(_0x302fff[_0x5f72('0x4f')],null))[_0x5f72('0x2a')](respondWithResult(_0x506774,null))[_0x5f72('0x4d')](handleError(_0x506774,null));};exports[_0x5f72('0x2b')]=function(_0x142089,_0x3f071c){return db[_0x5f72('0x32')][_0x5f72('0x50')]({'where':{'id':_0x142089[_0x5f72('0x51')]['id']}})[_0x5f72('0x2a')](handleEntityNotFound(_0x3f071c,null))['then'](removeEntity(_0x3f071c,null))[_0x5f72('0x4d')](handleError(_0x3f071c,null));};exports[_0x5f72('0x52')]=function(_0x5c5d94,_0x30e03){return db[_0x5f72('0x32')]['describe']()[_0x5f72('0x2a')](respondWithResult(_0x30e03,null))[_0x5f72('0x4d')](handleError(_0x30e03,null));};
\ No newline at end of file
+var _0xc7a3=['Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set'];(function(_0x1ec76d,_0x55096e){var _0x2121d8=function(_0x4be3af){while(--_0x4be3af){_0x1ec76d['push'](_0x1ec76d['shift']());}};_0x2121d8(++_0x55096e);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x2bd458,_0x1d1832){_0x2bd458=_0x2bd458-0x0;var _0x46d991=_0xc7a3[_0x2bd458];return _0x46d991;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c7a('0x0'));var zipdir=require(_0x3c7a('0x1'));var jsonpatch=require(_0x3c7a('0x2'));var rp=require(_0x3c7a('0x3'));var moment=require(_0x3c7a('0x4'));var BPromise=require(_0x3c7a('0x5'));var Mustache=require('mustache');var util=require(_0x3c7a('0x6'));var path=require(_0x3c7a('0x7'));var sox=require('sox');var csv=require(_0x3c7a('0x8'));var ejs=require(_0x3c7a('0x9'));var fs=require('fs');var fs_extra=require(_0x3c7a('0xa'));var _=require('lodash');var squel=require(_0x3c7a('0xb'));var crypto=require('crypto');var jsforce=require(_0x3c7a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3c7a('0x8'));var querystring=require(_0x3c7a('0xd'));var Papa=require(_0x3c7a('0xe'));var Redis=require('ioredis');var authService=require(_0x3c7a('0xf'));var qs=require(_0x3c7a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c7a('0x11'));var logger=require('../../config/logger')(_0x3c7a('0x12'));var utils=require('../../config/utils');var config=require(_0x3c7a('0x13'));var licenseUtil=require(_0x3c7a('0x14'));var db=require(_0x3c7a('0x15'))['db'];function respondWithStatusCode(_0x16ea63,_0x3d47c3){_0x3d47c3=_0x3d47c3||0xcc;return function(_0x53e5d7){if(_0x53e5d7){return _0x16ea63[_0x3c7a('0x16')](_0x3d47c3);}return _0x16ea63[_0x3c7a('0x17')](_0x3d47c3)[_0x3c7a('0x18')]();};}function respondWithResult(_0x36185c,_0x24d188){_0x24d188=_0x24d188||0xc8;return function(_0x4e6ca5){if(_0x4e6ca5){return _0x36185c[_0x3c7a('0x17')](_0x24d188)[_0x3c7a('0x19')](_0x4e6ca5);}};}function respondWithFilteredResult(_0x5af0a6,_0x539270){return function(_0x3044e6){if(_0x3044e6){var _0xb9201c=typeof _0x539270[_0x3c7a('0x1a')]==='undefined'&&typeof _0x539270[_0x3c7a('0x1b')]==='undefined';var _0x74fd1e=_0x3044e6[_0x3c7a('0x1c')];var _0x36e8c2=_0xb9201c?0x0:_0x539270[_0x3c7a('0x1a')];var _0x3cb5bf=_0xb9201c?_0x3044e6[_0x3c7a('0x1c')]:_0x539270['offset']+_0x539270[_0x3c7a('0x1b')];var _0x2db9df;if(_0x3cb5bf>=_0x74fd1e){_0x3cb5bf=_0x74fd1e;_0x2db9df=0xc8;}else{_0x2db9df=0xce;}_0x5af0a6[_0x3c7a('0x17')](_0x2db9df);return _0x5af0a6[_0x3c7a('0x1d')](_0x3c7a('0x1e'),_0x36e8c2+'-'+_0x3cb5bf+'/'+_0x74fd1e)[_0x3c7a('0x19')](_0x3044e6);}return null;};}function patchUpdates(_0x11a06b){return function(_0x34f4a6){try{jsonpatch[_0x3c7a('0x1f')](_0x34f4a6,_0x11a06b,!![]);}catch(_0x544742){return BPromise[_0x3c7a('0x20')](_0x544742);}return _0x34f4a6['save']();};}function saveUpdates(_0x3c75ff,_0x557518){return function(_0x40d24e){if(_0x40d24e){return _0x40d24e[_0x3c7a('0x21')](_0x3c75ff)[_0x3c7a('0x22')](function(_0x7dbe38){return _0x7dbe38;});}return null;};}function removeEntity(_0x283568,_0x245dde){return function(_0x8251d4){if(_0x8251d4){return _0x8251d4[_0x3c7a('0x23')]()[_0x3c7a('0x22')](function(){_0x283568[_0x3c7a('0x17')](0xcc)[_0x3c7a('0x18')]();});}};}function handleEntityNotFound(_0x317fbd,_0x56539f){return function(_0x3984a1){if(!_0x3984a1){_0x317fbd[_0x3c7a('0x16')](0x194);}return _0x3984a1;};}function handleError(_0x37cc40,_0x3829de){_0x3829de=_0x3829de||0x1f4;return function(_0x9b910c){logger[_0x3c7a('0x24')](_0x9b910c[_0x3c7a('0x25')]);if(_0x9b910c[_0x3c7a('0x26')]){delete _0x9b910c['name'];}_0x37cc40[_0x3c7a('0x17')](_0x3829de)[_0x3c7a('0x27')](_0x9b910c);};}exports[_0x3c7a('0x28')]=function(_0x197012,_0x33065b){var _0x1a96a0={},_0xccf304={},_0x1ff595={'count':0x0,'rows':[]};var _0x508d2e=_[_0x3c7a('0x29')](db[_0x3c7a('0x2a')][_0x3c7a('0x2b')],function(_0x18a346){return{'name':_0x18a346[_0x3c7a('0x2c')],'type':_0x18a346[_0x3c7a('0x2d')][_0x3c7a('0x2e')]};});_0xccf304[_0x3c7a('0x2f')]=_[_0x3c7a('0x29')](_0x508d2e,_0x3c7a('0x26'));_0xccf304[_0x3c7a('0x30')]=_[_0x3c7a('0x31')](_0x197012[_0x3c7a('0x30')]);_0xccf304['filters']=_['intersection'](_0xccf304['model'],_0xccf304['query']);_0x1a96a0[_0x3c7a('0x32')]=_[_0x3c7a('0x33')](_0xccf304[_0x3c7a('0x2f')],qs[_0x3c7a('0x34')](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x34')]));_0x1a96a0[_0x3c7a('0x32')]=_0x1a96a0[_0x3c7a('0x32')][_0x3c7a('0x35')]?_0x1a96a0[_0x3c7a('0x32')]:_0xccf304[_0x3c7a('0x2f')];if(!_0x197012[_0x3c7a('0x30')][_0x3c7a('0x36')](_0x3c7a('0x37'))){_0x1a96a0['limit']=qs[_0x3c7a('0x1b')](_0x197012[_0x3c7a('0x30')]['limit']);_0x1a96a0[_0x3c7a('0x1a')]=qs['offset'](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x1a')]);}_0x1a96a0['order']=qs[_0x3c7a('0x38')](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x38')]);_0x1a96a0[_0x3c7a('0x39')]=qs[_0x3c7a('0x3a')](_[_0x3c7a('0x3b')](_0x197012[_0x3c7a('0x30')],_0xccf304[_0x3c7a('0x3a')]),_0x508d2e);if(_0x197012[_0x3c7a('0x30')][_0x3c7a('0x3c')]){_0x1a96a0['where']=_[_0x3c7a('0x3d')](_0x1a96a0[_0x3c7a('0x39')],{'$or':_[_0x3c7a('0x29')](_0x508d2e,function(_0x43c236){if(_0x43c236[_0x3c7a('0x2d')]!==_0x3c7a('0x3e')){var _0x101e5d={};_0x101e5d[_0x43c236[_0x3c7a('0x26')]]={'$like':'%'+_0x197012['query'][_0x3c7a('0x3c')]+'%'};return _0x101e5d;}})});}_0x1a96a0=_[_0x3c7a('0x3d')]({},_0x1a96a0,_0x197012['options']);var _0x442087={'where':_0x1a96a0['where']};return db['Cdr']['count'](_0x442087)['then'](function(_0x44e935){_0x1ff595[_0x3c7a('0x1c')]=_0x44e935;if(_0x197012[_0x3c7a('0x30')]['includeAll']){_0x1a96a0[_0x3c7a('0x3f')]=[{'all':!![]}];}return db[_0x3c7a('0x2a')]['findAll'](_0x1a96a0);})['then'](function(_0x491335){_0x1ff595[_0x3c7a('0x40')]=_0x491335;return _0x1ff595;})[_0x3c7a('0x22')](respondWithFilteredResult(_0x33065b,_0x1a96a0))[_0x3c7a('0x41')](handleError(_0x33065b,null));};exports[_0x3c7a('0x42')]=function(_0x8d805a,_0x3e6a70){var _0x3f6060={'raw':!![],'where':{'id':_0x8d805a[_0x3c7a('0x43')]['id']}},_0x302556={};_0x302556[_0x3c7a('0x2f')]=_[_0x3c7a('0x31')](db[_0x3c7a('0x2a')][_0x3c7a('0x2b')]);_0x302556[_0x3c7a('0x30')]=_[_0x3c7a('0x31')](_0x8d805a['query']);_0x302556[_0x3c7a('0x3a')]=_[_0x3c7a('0x33')](_0x302556['model'],_0x302556['query']);_0x3f6060['attributes']=_[_0x3c7a('0x33')](_0x302556[_0x3c7a('0x2f')],qs[_0x3c7a('0x34')](_0x8d805a[_0x3c7a('0x30')][_0x3c7a('0x34')]));_0x3f6060[_0x3c7a('0x32')]=_0x3f6060[_0x3c7a('0x32')][_0x3c7a('0x35')]?_0x3f6060[_0x3c7a('0x32')]:_0x302556[_0x3c7a('0x2f')];if(_0x8d805a[_0x3c7a('0x30')]['includeAll']){_0x3f6060['include']=[{'all':!![]}];}_0x3f6060=_['merge']({},_0x3f6060,_0x8d805a[_0x3c7a('0x44')]);return db[_0x3c7a('0x2a')][_0x3c7a('0x45')](_0x3f6060)[_0x3c7a('0x22')](handleEntityNotFound(_0x3e6a70,null))[_0x3c7a('0x22')](respondWithResult(_0x3e6a70,null))['catch'](handleError(_0x3e6a70,null));};exports[_0x3c7a('0x46')]=function(_0x12b69a,_0x2eb9e2){return db[_0x3c7a('0x2a')][_0x3c7a('0x46')](_0x12b69a[_0x3c7a('0x47')],{})[_0x3c7a('0x22')](respondWithResult(_0x2eb9e2,0xc9))['catch'](handleError(_0x2eb9e2,null));};exports['update']=function(_0x420fa7,_0x350ea7){if(_0x420fa7[_0x3c7a('0x47')]['id']){delete _0x420fa7[_0x3c7a('0x47')]['id'];}return db[_0x3c7a('0x2a')][_0x3c7a('0x45')]({'where':{'id':_0x420fa7['params']['id']}})[_0x3c7a('0x22')](handleEntityNotFound(_0x350ea7,null))['then'](saveUpdates(_0x420fa7['body'],null))[_0x3c7a('0x22')](respondWithResult(_0x350ea7,null))[_0x3c7a('0x41')](handleError(_0x350ea7,null));};exports[_0x3c7a('0x23')]=function(_0x50b5e4,_0x5759a0){return db['Cdr']['find']({'where':{'id':_0x50b5e4[_0x3c7a('0x43')]['id']}})[_0x3c7a('0x22')](handleEntityNotFound(_0x5759a0,null))[_0x3c7a('0x22')](removeEntity(_0x5759a0,null))[_0x3c7a('0x41')](handleError(_0x5759a0,null));};exports[_0x3c7a('0x48')]=function(_0x11f7ee,_0x124411){return db[_0x3c7a('0x2a')][_0x3c7a('0x48')]()[_0x3c7a('0x22')](respondWithResult(_0x124411,null))[_0x3c7a('0x41')](handleError(_0x124411,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index de2774d..8e8f4f9 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3218ca,_0x1f2034){var _0x3a0275=function(_0x43f384){while(--_0x43f384){_0x3218ca['push'](_0x3218ca['shift']());}};_0x3a0275(++_0x1f2034);}(_0x7a54,0x106));var _0x47a5=function(_0x36c0a5,_0x56db03){_0x36c0a5=_0x36c0a5-0x0;var _0x4fab3a=_0x7a54[_0x36c0a5];return _0x4fab3a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x4c7808,_0x472d7f){var _0x6d61fb=function(_0x294115){while(--_0x294115){_0x4c7808['push'](_0x4c7808['shift']());}};_0x6d61fb(++_0x472d7f);}(_0x7a54,0x106));var _0x47a5=function(_0x38e784,_0x184fde){_0x38e784=_0x38e784-0x0;var _0x4a47c4=_0x7a54[_0x38e784];return _0x4a47c4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index af9ea7a..225716a 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 _0xebc7=['lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','Cdr,\x20%s,\x20%s','info','result','catch'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0xebc7,0x118));var _0x7ebc=function(_0x2fc28e,_0x53e804){_0x2fc28e=_0x2fc28e-0x0;var _0x3f6923=_0xebc7[_0x2fc28e];return _0x3f6923;};'use strict';var _=require(_0x7ebc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7ebc('0x1'));var rs=require(_0x7ebc('0x2'));var fs=require('fs');var Redis=require(_0x7ebc('0x3'));var db=require(_0x7ebc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7ebc('0x5'));var config=require(_0x7ebc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7ebc('0x7')][_0x7ebc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f0ea5,_0x3d33b8,_0x156f80){return new BPromise(function(_0x376683,_0x52e971){return client[_0x7ebc('0x9')](_0x4f0ea5,_0x156f80)['then'](function(_0x45e301){logger['info']('Cdr,\x20%s,\x20%s',_0x3d33b8,_0x7ebc('0xa'));logger[_0x7ebc('0xb')](_0x7ebc('0xc'),_0x3d33b8,'request\x20sent',JSON['stringify'](_0x45e301));if(_0x45e301[_0x7ebc('0xd')]){if(_0x45e301[_0x7ebc('0xd')][_0x7ebc('0xe')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x3d33b8,_0x45e301[_0x7ebc('0xd')][_0x7ebc('0xf')]);return _0x52e971(_0x45e301[_0x7ebc('0xd')][_0x7ebc('0xf')]);}logger[_0x7ebc('0xd')](_0x7ebc('0x10'),_0x3d33b8,_0x45e301[_0x7ebc('0xd')][_0x7ebc('0xf')]);return _0x376683(_0x45e301[_0x7ebc('0xd')][_0x7ebc('0xf')]);}else{logger[_0x7ebc('0x11')](_0x7ebc('0x10'),_0x3d33b8,_0x7ebc('0xa'));_0x376683(_0x45e301[_0x7ebc('0x12')][_0x7ebc('0xf')]);}})[_0x7ebc('0x13')](function(_0x257ce4){logger[_0x7ebc('0xd')]('Cdr,\x20%s,\x20%s',_0x3d33b8,_0x257ce4);_0x52e971(_0x257ce4);});});}
\ No newline at end of file
+var _0x4cb4=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','message','Cdr,\x20%s,\x20%s','lodash','util','moment'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x4cb4,0xc3));var _0x44cb=function(_0x477491,_0x5ca700){_0x477491=_0x477491-0x0;var _0xac6aec=_0x4cb4[_0x477491];return _0xac6aec;};'use strict';var _=require(_0x44cb('0x0'));var util=require(_0x44cb('0x1'));var moment=require(_0x44cb('0x2'));var BPromise=require(_0x44cb('0x3'));var rs=require(_0x44cb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x44cb('0x5'))['db'];var utils=require(_0x44cb('0x6'));var logger=require(_0x44cb('0x7'))(_0x44cb('0x8'));var config=require(_0x44cb('0x9'));var jayson=require(_0x44cb('0xa'));var client=jayson['client'][_0x44cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x381370,_0x40e01e,_0x132990){return new BPromise(function(_0x223062,_0x4c331d){return client[_0x44cb('0xc')](_0x381370,_0x132990)[_0x44cb('0xd')](function(_0xb30720){logger[_0x44cb('0xe')]('Cdr,\x20%s,\x20%s',_0x40e01e,_0x44cb('0xf'));logger[_0x44cb('0x10')]('Cdr,\x20%s,\x20%s,\x20%s',_0x40e01e,_0x44cb('0xf'),JSON[_0x44cb('0x11')](_0xb30720));if(_0xb30720[_0x44cb('0x12')]){if(_0xb30720['error'][_0x44cb('0x13')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x40e01e,_0xb30720[_0x44cb('0x12')][_0x44cb('0x14')]);return _0x4c331d(_0xb30720[_0x44cb('0x12')][_0x44cb('0x14')]);}logger[_0x44cb('0x12')](_0x44cb('0x15'),_0x40e01e,_0xb30720['error']['message']);return _0x223062(_0xb30720['error'][_0x44cb('0x14')]);}else{logger[_0x44cb('0xe')]('Cdr,\x20%s,\x20%s',_0x40e01e,_0x44cb('0xf'));_0x223062(_0xb30720['result']['message']);}})['catch'](function(_0x3a989c){logger[_0x44cb('0x12')](_0x44cb('0x15'),_0x40e01e,_0x3a989c);_0x4c331d(_0x3a989c);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index bf5826e..1387375 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(_0xb03f9,_0x588391){var _0x3ec30a=function(_0x3ef5e7){while(--_0x3ef5e7){_0xb03f9['push'](_0xb03f9['shift']());}};_0x3ec30a(++_0x588391);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x22eb5d,_0x2e519d){var _0x4a39ad=function(_0x4a1206){while(--_0x4a1206){_0x22eb5d['push'](_0x22eb5d['shift']());}};_0x4a39ad(++_0x2e519d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index a027eea..3ac4cc4 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 _0xfc18=['TEXT','STRING','sequelize','INTEGER','noop'];(function(_0x479db7,_0x2e5a83){var _0x4a8fad=function(_0x5c4669){while(--_0x5c4669){_0x479db7['push'](_0x479db7['shift']());}};_0x4a8fad(++_0x2e5a83);}(_0xfc18,0xa2));var _0x8fc1=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xfc18[_0x3c8e9a];return _0x2d4c57;};'use strict';var Sequelize=require(_0x8fc1('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8fc1('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8fc1('0x2')},'appdata':{'type':Sequelize[_0x8fc1('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8fc1('0x4')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x805b=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0xbb5bce,_0x15a8f2){var _0x38fdad=function(_0x44c123){while(--_0x44c123){_0xbb5bce['push'](_0xbb5bce['shift']());}};_0x38fdad(++_0x15a8f2);}(_0x805b,0x159));var _0xb805=function(_0x122592,_0x14c92b){_0x122592=_0x122592-0x0;var _0x2c1c6f=_0x805b[_0x122592];return _0x2c1c6f;};'use strict';var Sequelize=require(_0xb805('0x0'));module[_0xb805('0x1')]={'priority':{'type':Sequelize[_0xb805('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb805('0x3')],'allowNull':![],'defaultValue':_0xb805('0x4')},'appdata':{'type':Sequelize[_0xb805('0x5')]()},'description':{'type':Sequelize[_0xb805('0x3')]},'interval':{'type':Sequelize[_0xb805('0x3')],'defaultValue':_0xb805('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index c7cc166..a86dad8 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 _0x0db9=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','stack','name','send','show','model','keys','rawAttributes','query','intersection','fields','attributes','includeAll','include','merge','options','catch','body','ChatApplication','find','destroy','params','eml-format','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring'];(function(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0x0db9,0xa3));var _0x90db=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0x0db9[_0x2cc569];return _0x1bfc2e;};'use strict';var emlformat=require(_0x90db('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x90db('0x1'));var moment=require(_0x90db('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x90db('0x3'));var util=require('util');var path=require(_0x90db('0x4'));var sox=require(_0x90db('0x5'));var csv=require('to-csv');var ejs=require(_0x90db('0x6'));var fs=require('fs');var fs_extra=require(_0x90db('0x7'));var _=require(_0x90db('0x8'));var squel=require(_0x90db('0x9'));var crypto=require(_0x90db('0xa'));var jsforce=require(_0x90db('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x90db('0xc'));var querystring=require(_0x90db('0xd'));var Papa=require(_0x90db('0xe'));var Redis=require(_0x90db('0xf'));var authService=require(_0x90db('0x10'));var qs=require(_0x90db('0x11'));var as=require(_0x90db('0x12'));var hardwareService=require(_0x90db('0x13'));var logger=require(_0x90db('0x14'))(_0x90db('0x15'));var utils=require(_0x90db('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x90db('0x17'));var db=require(_0x90db('0x18'))['db'];function respondWithStatusCode(_0x45ad3c,_0x436327){_0x436327=_0x436327||0xcc;return function(_0x1b410d){if(_0x1b410d){return _0x45ad3c[_0x90db('0x19')](_0x436327);}return _0x45ad3c[_0x90db('0x1a')](_0x436327)[_0x90db('0x1b')]();};}function respondWithResult(_0x7826f7,_0x309aea){_0x309aea=_0x309aea||0xc8;return function(_0x334e22){if(_0x334e22){return _0x7826f7[_0x90db('0x1a')](_0x309aea)[_0x90db('0x1c')](_0x334e22);}};}function respondWithFilteredResult(_0xda2abe,_0x544226){return function(_0x3124d4){if(_0x3124d4){var _0x5ef456=typeof _0x544226[_0x90db('0x1d')]===_0x90db('0x1e')&&typeof _0x544226[_0x90db('0x1f')]===_0x90db('0x1e');var _0x32ff04=_0x3124d4[_0x90db('0x20')];var _0x15e33e=_0x5ef456?0x0:_0x544226[_0x90db('0x1d')];var _0x24a16a=_0x5ef456?_0x3124d4[_0x90db('0x20')]:_0x544226['offset']+_0x544226[_0x90db('0x1f')];var _0x445a22;if(_0x24a16a>=_0x32ff04){_0x24a16a=_0x32ff04;_0x445a22=0xc8;}else{_0x445a22=0xce;}_0xda2abe['status'](_0x445a22);return _0xda2abe['set'](_0x90db('0x21'),_0x15e33e+'-'+_0x24a16a+'/'+_0x32ff04)[_0x90db('0x1c')](_0x3124d4);}return null;};}function patchUpdates(_0x300dc2){return function(_0x3a58c4){try{jsonpatch[_0x90db('0x22')](_0x3a58c4,_0x300dc2,!![]);}catch(_0x168eaf){return BPromise[_0x90db('0x23')](_0x168eaf);}return _0x3a58c4['save']();};}function saveUpdates(_0xb45340,_0x1aeab9){return function(_0x23934a){if(_0x23934a){return _0x23934a[_0x90db('0x24')](_0xb45340)['then'](function(_0x43028e){return _0x43028e;});}return null;};}function removeEntity(_0x5a98f6,_0x459068){return function(_0x19f9c6){if(_0x19f9c6){return _0x19f9c6['destroy']()[_0x90db('0x25')](function(){_0x5a98f6[_0x90db('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f8469,_0x3e3fbd){return function(_0x5b3c09){if(!_0x5b3c09){_0x2f8469[_0x90db('0x19')](0x194);}return _0x5b3c09;};}function handleError(_0xe026cf,_0x1cc660){_0x1cc660=_0x1cc660||0x1f4;return function(_0x94cd84){logger['error'](_0x94cd84[_0x90db('0x26')]);if(_0x94cd84[_0x90db('0x27')]){delete _0x94cd84[_0x90db('0x27')];}_0xe026cf[_0x90db('0x1a')](_0x1cc660)[_0x90db('0x28')](_0x94cd84);};}exports[_0x90db('0x29')]=function(_0x44b5b6,_0x3c7f67){var _0x4c6311={'raw':!![],'where':{'id':_0x44b5b6['params']['id']}},_0x3489d1={};_0x3489d1[_0x90db('0x2a')]=_[_0x90db('0x2b')](db['ChatApplication'][_0x90db('0x2c')]);_0x3489d1[_0x90db('0x2d')]=_[_0x90db('0x2b')](_0x44b5b6[_0x90db('0x2d')]);_0x3489d1['filters']=_[_0x90db('0x2e')](_0x3489d1[_0x90db('0x2a')],_0x3489d1[_0x90db('0x2d')]);_0x4c6311['attributes']=_['intersection'](_0x3489d1[_0x90db('0x2a')],qs[_0x90db('0x2f')](_0x44b5b6[_0x90db('0x2d')]['fields']));_0x4c6311[_0x90db('0x30')]=_0x4c6311[_0x90db('0x30')]['length']?_0x4c6311[_0x90db('0x30')]:_0x3489d1[_0x90db('0x2a')];if(_0x44b5b6['query'][_0x90db('0x31')]){_0x4c6311[_0x90db('0x32')]=[{'all':!![]}];}_0x4c6311=_[_0x90db('0x33')]({},_0x4c6311,_0x44b5b6[_0x90db('0x34')]);return db['ChatApplication']['find'](_0x4c6311)[_0x90db('0x25')](handleEntityNotFound(_0x3c7f67,null))['then'](respondWithResult(_0x3c7f67,null))[_0x90db('0x35')](handleError(_0x3c7f67,null));};exports[_0x90db('0x24')]=function(_0x45cebb,_0x540176){if(_0x45cebb[_0x90db('0x36')]['id']){delete _0x45cebb['body']['id'];}return db[_0x90db('0x37')][_0x90db('0x38')]({'where':{'id':_0x45cebb['params']['id']}})[_0x90db('0x25')](handleEntityNotFound(_0x540176,null))[_0x90db('0x25')](saveUpdates(_0x45cebb[_0x90db('0x36')],null))[_0x90db('0x25')](respondWithResult(_0x540176,null))[_0x90db('0x35')](handleError(_0x540176,null));};exports[_0x90db('0x39')]=function(_0x4de656,_0x88789f){return db[_0x90db('0x37')]['find']({'where':{'id':_0x4de656[_0x90db('0x3a')]['id']}})[_0x90db('0x25')](handleEntityNotFound(_0x88789f,null))[_0x90db('0x25')](removeEntity(_0x88789f,null))['catch'](handleError(_0x88789f,null));};
\ No newline at end of file
+var _0x138d=['filters','intersection','model','fields','attributes','length','includeAll','merge','ChatApplication','find','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','then','destroy','error','name','params','keys','rawAttributes','query'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0x138d,0x1ab));var _0xd138=function(_0x5a6cef,_0x1697df){_0x5a6cef=_0x5a6cef-0x0;var _0x37f76f=_0x138d[_0x5a6cef];return _0x37f76f;};'use strict';var emlformat=require(_0xd138('0x0'));var rimraf=require(_0xd138('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd138('0x2'));var rp=require(_0xd138('0x3'));var moment=require(_0xd138('0x4'));var BPromise=require(_0xd138('0x5'));var Mustache=require(_0xd138('0x6'));var util=require(_0xd138('0x7'));var path=require('path');var sox=require(_0xd138('0x8'));var csv=require(_0xd138('0x9'));var ejs=require(_0xd138('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd138('0xb'));var squel=require(_0xd138('0xc'));var crypto=require(_0xd138('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd138('0x9'));var querystring=require(_0xd138('0xe'));var Papa=require(_0xd138('0xf'));var Redis=require('ioredis');var authService=require(_0xd138('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd138('0x11'));var logger=require(_0xd138('0x12'))(_0xd138('0x13'));var utils=require(_0xd138('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd138('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x429f16,_0x29e963){_0x29e963=_0x29e963||0xcc;return function(_0x11ed68){if(_0x11ed68){return _0x429f16[_0xd138('0x16')](_0x29e963);}return _0x429f16[_0xd138('0x17')](_0x29e963)[_0xd138('0x18')]();};}function respondWithResult(_0x24f99,_0x297102){_0x297102=_0x297102||0xc8;return function(_0x402d2c){if(_0x402d2c){return _0x24f99[_0xd138('0x17')](_0x297102)[_0xd138('0x19')](_0x402d2c);}};}function respondWithFilteredResult(_0x1f4ac1,_0x5cbee9){return function(_0x1526e9){if(_0x1526e9){var _0x3f8932=typeof _0x5cbee9['offset']==='undefined'&&typeof _0x5cbee9['limit']===_0xd138('0x1a');var _0x3a0d9b=_0x1526e9['count'];var _0x43a67d=_0x3f8932?0x0:_0x5cbee9[_0xd138('0x1b')];var _0x421d25=_0x3f8932?_0x1526e9[_0xd138('0x1c')]:_0x5cbee9['offset']+_0x5cbee9[_0xd138('0x1d')];var _0x36f021;if(_0x421d25>=_0x3a0d9b){_0x421d25=_0x3a0d9b;_0x36f021=0xc8;}else{_0x36f021=0xce;}_0x1f4ac1[_0xd138('0x17')](_0x36f021);return _0x1f4ac1[_0xd138('0x1e')](_0xd138('0x1f'),_0x43a67d+'-'+_0x421d25+'/'+_0x3a0d9b)[_0xd138('0x19')](_0x1526e9);}return null;};}function patchUpdates(_0x1755e5){return function(_0x4bd987){try{jsonpatch[_0xd138('0x20')](_0x4bd987,_0x1755e5,!![]);}catch(_0x2a5bfb){return BPromise['reject'](_0x2a5bfb);}return _0x4bd987['save']();};}function saveUpdates(_0x20c57a,_0x5e0f89){return function(_0x5ef010){if(_0x5ef010){return _0x5ef010['update'](_0x20c57a)[_0xd138('0x21')](function(_0x1bc6ef){return _0x1bc6ef;});}return null;};}function removeEntity(_0x2700ae,_0x4569f5){return function(_0x5bd0eb){if(_0x5bd0eb){return _0x5bd0eb[_0xd138('0x22')]()[_0xd138('0x21')](function(){_0x2700ae[_0xd138('0x17')](0xcc)[_0xd138('0x18')]();});}};}function handleEntityNotFound(_0x425cd8,_0x5b11d0){return function(_0x294757){if(!_0x294757){_0x425cd8[_0xd138('0x16')](0x194);}return _0x294757;};}function handleError(_0x136048,_0x413d5c){_0x413d5c=_0x413d5c||0x1f4;return function(_0x1d45b7){logger[_0xd138('0x23')](_0x1d45b7['stack']);if(_0x1d45b7[_0xd138('0x24')]){delete _0x1d45b7['name'];}_0x136048[_0xd138('0x17')](_0x413d5c)['send'](_0x1d45b7);};}exports['show']=function(_0x5df7c1,_0x15c73e){var _0x46acdf={'raw':!![],'where':{'id':_0x5df7c1[_0xd138('0x25')]['id']}},_0x250da9={};_0x250da9['model']=_[_0xd138('0x26')](db['ChatApplication'][_0xd138('0x27')]);_0x250da9[_0xd138('0x28')]=_[_0xd138('0x26')](_0x5df7c1['query']);_0x250da9[_0xd138('0x29')]=_[_0xd138('0x2a')](_0x250da9['model'],_0x250da9[_0xd138('0x28')]);_0x46acdf['attributes']=_[_0xd138('0x2a')](_0x250da9[_0xd138('0x2b')],qs[_0xd138('0x2c')](_0x5df7c1[_0xd138('0x28')][_0xd138('0x2c')]));_0x46acdf[_0xd138('0x2d')]=_0x46acdf['attributes'][_0xd138('0x2e')]?_0x46acdf[_0xd138('0x2d')]:_0x250da9[_0xd138('0x2b')];if(_0x5df7c1['query'][_0xd138('0x2f')]){_0x46acdf['include']=[{'all':!![]}];}_0x46acdf=_[_0xd138('0x30')]({},_0x46acdf,_0x5df7c1['options']);return db[_0xd138('0x31')][_0xd138('0x32')](_0x46acdf)[_0xd138('0x21')](handleEntityNotFound(_0x15c73e,null))['then'](respondWithResult(_0x15c73e,null))[_0xd138('0x33')](handleError(_0x15c73e,null));};exports['update']=function(_0xb4b855,_0x3b00e7){if(_0xb4b855['body']['id']){delete _0xb4b855['body']['id'];}return db[_0xd138('0x31')]['find']({'where':{'id':_0xb4b855[_0xd138('0x25')]['id']}})[_0xd138('0x21')](handleEntityNotFound(_0x3b00e7,null))['then'](saveUpdates(_0xb4b855['body'],null))['then'](respondWithResult(_0x3b00e7,null))['catch'](handleError(_0x3b00e7,null));};exports[_0xd138('0x22')]=function(_0x539778,_0x1a3c43){return db[_0xd138('0x31')][_0xd138('0x32')]({'where':{'id':_0x539778[_0xd138('0x25')]['id']}})[_0xd138('0x21')](handleEntityNotFound(_0x1a3c43,null))[_0xd138('0x21')](removeEntity(_0x1a3c43,null))[_0xd138('0x33')](handleError(_0x1a3c43,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 18a5810..5c5664c 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 _0xe45c=['../../config/environment','exports','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x484e5c,_0x13f5d2){var _0x5d65ef=function(_0x3bde98){while(--_0x3bde98){_0x484e5c['push'](_0x484e5c['shift']());}};_0x5d65ef(++_0x13f5d2);}(_0xe45c,0xae));var _0xce45=function(_0x570886,_0xda87f0){_0x570886=_0x570886-0x0;var _0x1b7471=_0xe45c[_0x570886];return _0x1b7471;};'use strict';var _=require(_0xce45('0x0'));var util=require(_0xce45('0x1'));var logger=require(_0xce45('0x2'))(_0xce45('0x3'));var moment=require('moment');var BPromise=require(_0xce45('0x4'));var rp=require(_0xce45('0x5'));var fs=require('fs');var path=require(_0xce45('0x6'));var rimraf=require(_0xce45('0x7'));var config=require(_0xce45('0x8'));var attributes=require('./chatApplication.attributes');module[_0xce45('0x9')]=function(_0x1007ee,_0x1abde5){return _0x1007ee['define'](_0xce45('0xa'),attributes,{'tableName':_0xce45('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xce45('0xc')});};
\ No newline at end of file
+var _0x2f07=['request-promise','path','./chatApplication.attributes','exports','define','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f07,0xb0));var _0x72f0=function(_0x29e3d5,_0x3bd486){_0x29e3d5=_0x29e3d5-0x0;var _0x5e3590=_0x2f07[_0x29e3d5];return _0x5e3590;};'use strict';var _=require(_0x72f0('0x0'));var util=require(_0x72f0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x72f0('0x2'));var BPromise=require(_0x72f0('0x3'));var rp=require(_0x72f0('0x4'));var fs=require('fs');var path=require(_0x72f0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x72f0('0x6'));module[_0x72f0('0x7')]=function(_0x502702,_0x52237a){return _0x502702[_0x72f0('0x8')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 5f00744..1fb1d74 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 _0xe8e0=['stringify','error','code','ChatApplication,\x20%s,\x20%s','message','catch','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x45bcb1,_0x46cad0){var _0x4bd6a3=function(_0x1f197f){while(--_0x1f197f){_0x45bcb1['push'](_0x45bcb1['shift']());}};_0x4bd6a3(++_0x46cad0);}(_0xe8e0,0x138));var _0x0e8e=function(_0x263e15,_0x5d14f8){_0x263e15=_0x263e15-0x0;var _0x2d2dfb=_0xe8e0[_0x263e15];return _0x2d2dfb;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0e8e('0x0'));var rs=require(_0x0e8e('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0e8e('0x2'));var logger=require(_0x0e8e('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0e8e('0x4'));var client=jayson[_0x0e8e('0x5')][_0x0e8e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a27a1,_0x18be5a,_0x1190a2){return new BPromise(function(_0x2958e5,_0x322ce8){return client[_0x0e8e('0x7')](_0x5a27a1,_0x1190a2)['then'](function(_0x416b6b){logger[_0x0e8e('0x8')]('ChatApplication,\x20%s,\x20%s',_0x18be5a,'request\x20sent');logger['debug'](_0x0e8e('0x9'),_0x18be5a,_0x0e8e('0xa'),JSON[_0x0e8e('0xb')](_0x416b6b));if(_0x416b6b[_0x0e8e('0xc')]){if(_0x416b6b[_0x0e8e('0xc')][_0x0e8e('0xd')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x18be5a,_0x416b6b[_0x0e8e('0xc')]['message']);return _0x322ce8(_0x416b6b['error']['message']);}logger[_0x0e8e('0xc')](_0x0e8e('0xe'),_0x18be5a,_0x416b6b[_0x0e8e('0xc')]['message']);return _0x2958e5(_0x416b6b[_0x0e8e('0xc')][_0x0e8e('0xf')]);}else{logger[_0x0e8e('0x8')](_0x0e8e('0xe'),_0x18be5a,'request\x20sent');_0x2958e5(_0x416b6b['result']['message']);}})[_0x0e8e('0x10')](function(_0x4826d4){logger[_0x0e8e('0xc')](_0x0e8e('0xe'),_0x18be5a,_0x4826d4);_0x322ce8(_0x4826d4);});});}
\ No newline at end of file
+var _0x87c3=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x5053d0,_0x49fa5e){var _0x548d6a=function(_0xf9f9a){while(--_0xf9f9a){_0x5053d0['push'](_0x5053d0['shift']());}};_0x548d6a(++_0x49fa5e);}(_0x87c3,0x178));var _0x387c=function(_0x36d7bb,_0xcff402){_0x36d7bb=_0x36d7bb-0x0;var _0x42ed5a=_0x87c3[_0x36d7bb];return _0x42ed5a;};'use strict';var _=require(_0x387c('0x0'));var util=require(_0x387c('0x1'));var moment=require('moment');var BPromise=require(_0x387c('0x2'));var rs=require(_0x387c('0x3'));var fs=require('fs');var Redis=require(_0x387c('0x4'));var db=require(_0x387c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x387c('0x6'))(_0x387c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x387c('0x8')][_0x387c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5063e9,_0x56b47e,_0x3e3d3c){return new BPromise(function(_0x3f41e6,_0x15d9f1){return client[_0x387c('0xa')](_0x5063e9,_0x3e3d3c)[_0x387c('0xb')](function(_0x52e8cb){logger[_0x387c('0xc')](_0x387c('0xd'),_0x56b47e,_0x387c('0xe'));logger[_0x387c('0xf')](_0x387c('0x10'),_0x56b47e,_0x387c('0xe'),JSON[_0x387c('0x11')](_0x52e8cb));if(_0x52e8cb[_0x387c('0x12')]){if(_0x52e8cb['error'][_0x387c('0x13')]===0x1f4){logger[_0x387c('0x12')](_0x387c('0xd'),_0x56b47e,_0x52e8cb[_0x387c('0x12')]['message']);return _0x15d9f1(_0x52e8cb[_0x387c('0x12')]['message']);}logger[_0x387c('0x12')](_0x387c('0xd'),_0x56b47e,_0x52e8cb['error'][_0x387c('0x14')]);return _0x3f41e6(_0x52e8cb[_0x387c('0x12')][_0x387c('0x14')]);}else{logger[_0x387c('0xc')](_0x387c('0xd'),_0x56b47e,_0x387c('0xe'));_0x3f41e6(_0x52e8cb[_0x387c('0x15')]['message']);}})[_0x387c('0x16')](function(_0x29137b){logger[_0x387c('0x12')](_0x387c('0xd'),_0x56b47e,_0x29137b);_0x15d9f1(_0x29137b);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 5cefd02..3ffeaf1 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 _0x0302=['multer','util','path','connect-timeout','express','Router','fs-extra','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','destroy','exports'];(function(_0x281e76,_0x8bde50){var _0x5ecce5=function(_0x2382bc){while(--_0x2382bc){_0x281e76['push'](_0x281e76['shift']());}};_0x5ecce5(++_0x8bde50);}(_0x0302,0x1b0));var _0x2030=function(_0x2ee4a5,_0x3f6f7c){_0x2ee4a5=_0x2ee4a5-0x0;var _0x5590c9=_0x0302[_0x2ee4a5];return _0x5590c9;};'use strict';var multer=require(_0x2030('0x0'));var util=require(_0x2030('0x1'));var path=require(_0x2030('0x2'));var timeout=require(_0x2030('0x3'));var express=require(_0x2030('0x4'));var router=express[_0x2030('0x5')]();var fs_extra=require(_0x2030('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2030('0x7'));router['get'](_0x2030('0x8'),auth[_0x2030('0x9')](),controller[_0x2030('0xa')]);router[_0x2030('0xb')]('/:id',auth[_0x2030('0x9')](),controller[_0x2030('0xc')]);router[_0x2030('0xd')](_0x2030('0x8'),auth[_0x2030('0x9')](),controller[_0x2030('0xe')]);module[_0x2030('0xf')]=router;
\ No newline at end of file
+var _0x8b86=['put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show'];(function(_0x42f692,_0xcc86b5){var _0x1d25e4=function(_0x5eafd9){while(--_0x5eafd9){_0x42f692['push'](_0x42f692['shift']());}};_0x1d25e4(++_0xcc86b5);}(_0x8b86,0xb9));var _0x68b8=function(_0x4bb5de,_0x1806d9){_0x4bb5de=_0x4bb5de-0x0;var _0x5bb0ff=_0x8b86[_0x4bb5de];return _0x5bb0ff;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x68b8('0x0'));var express=require(_0x68b8('0x1'));var router=express[_0x68b8('0x2')]();var fs_extra=require(_0x68b8('0x3'));var auth=require(_0x68b8('0x4'));var interaction=require(_0x68b8('0x5'));var config=require(_0x68b8('0x6'));var controller=require('./chatApplication.controller');router['get'](_0x68b8('0x7'),auth[_0x68b8('0x8')](),controller[_0x68b8('0x9')]);router[_0x68b8('0xa')](_0x68b8('0x7'),auth[_0x68b8('0x8')](),controller[_0x68b8('0xb')]);router[_0x68b8('0xc')]('/:id',auth[_0x68b8('0x8')](),controller[_0x68b8('0xd')]);module[_0x68b8('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 8a03756..2fee790 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 _0x6636=['BOOLEAN','sequelize','exports','STRING'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x6636,0x119));var _0x6663=function(_0x4320f9,_0x583285){_0x4320f9=_0x4320f9-0x0;var _0x5c71a9=_0x6636[_0x4320f9];return _0x5c71a9;};'use strict';var Sequelize=require(_0x6663('0x0'));module[_0x6663('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6663('0x2')]},'write':{'type':Sequelize[_0x6663('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xbc37=['STRING','BOOLEAN','sequelize','exports'];(function(_0x773a33,_0x1d39fb){var _0x13e4dd=function(_0x520e7a){while(--_0x520e7a){_0x773a33['push'](_0x773a33['shift']());}};_0x13e4dd(++_0x1d39fb);}(_0xbc37,0x11a));var _0x7bc3=function(_0x21405d,_0x49392d){_0x21405d=_0x21405d-0x0;var _0x4a7ba6=_0xbc37[_0x21405d];return _0x4a7ba6;};'use strict';var Sequelize=require(_0x7bc3('0x0'));module[_0x7bc3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x7bc3('0x2')]},'write':{'type':Sequelize[_0x7bc3('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 15e5a19..92e3575 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 _0x692f=['squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatGroup','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','user','addMembers','ids','omit','getMembers','findOne','pick','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash'];(function(_0x445c46,_0x3cebeb){var _0x26bcf4=function(_0x3f7426){while(--_0x3f7426){_0x445c46['push'](_0x445c46['shift']());}};_0x26bcf4(++_0x3cebeb);}(_0x692f,0x184));var _0xf692=function(_0x480fc2,_0x482fba){_0x480fc2=_0x480fc2-0x0;var _0x540a95=_0x692f[_0x480fc2];return _0x540a95;};'use strict';var emlformat=require(_0xf692('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf692('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf692('0x2'));var moment=require(_0xf692('0x3'));var BPromise=require(_0xf692('0x4'));var Mustache=require(_0xf692('0x5'));var util=require(_0xf692('0x6'));var path=require(_0xf692('0x7'));var sox=require(_0xf692('0x8'));var csv=require('to-csv');var ejs=require(_0xf692('0x9'));var fs=require('fs');var fs_extra=require(_0xf692('0xa'));var _=require(_0xf692('0xb'));var squel=require(_0xf692('0xc'));var crypto=require(_0xf692('0xd'));var jsforce=require(_0xf692('0xe'));var deskjs=require(_0xf692('0xf'));var toCsv=require(_0xf692('0x10'));var querystring=require(_0xf692('0x11'));var Papa=require(_0xf692('0x12'));var Redis=require(_0xf692('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf692('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf692('0x15'));var logger=require(_0xf692('0x16'))(_0xf692('0x17'));var utils=require(_0xf692('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf692('0x19'))['db'];config[_0xf692('0x1a')]=_[_0xf692('0x1b')](config[_0xf692('0x1a')],{'host':_0xf692('0x1c'),'port':0x18eb});var socket=require(_0xf692('0x1d'))(new Redis(config[_0xf692('0x1a')]));require('./chatGroup.socket')[_0xf692('0x1e')](socket);function respondWithStatusCode(_0x110183,_0x8064e0){_0x8064e0=_0x8064e0||0xcc;return function(_0x401ff2){if(_0x401ff2){return _0x110183[_0xf692('0x1f')](_0x8064e0);}return _0x110183[_0xf692('0x20')](_0x8064e0)[_0xf692('0x21')]();};}function respondWithResult(_0x327be2,_0x50b6ed){_0x50b6ed=_0x50b6ed||0xc8;return function(_0x893de5){if(_0x893de5){return _0x327be2[_0xf692('0x20')](_0x50b6ed)[_0xf692('0x22')](_0x893de5);}};}function respondWithFilteredResult(_0x5c6ca0,_0x1dddde){return function(_0x45b7be){if(_0x45b7be){var _0x302f8e=typeof _0x1dddde[_0xf692('0x23')]==='undefined'&&typeof _0x1dddde[_0xf692('0x24')]===_0xf692('0x25');var _0x4d3159=_0x45b7be['count'];var _0x1914af=_0x302f8e?0x0:_0x1dddde[_0xf692('0x23')];var _0x235694=_0x302f8e?_0x45b7be[_0xf692('0x26')]:_0x1dddde['offset']+_0x1dddde[_0xf692('0x24')];var _0x15df0c;if(_0x235694>=_0x4d3159){_0x235694=_0x4d3159;_0x15df0c=0xc8;}else{_0x15df0c=0xce;}_0x5c6ca0[_0xf692('0x20')](_0x15df0c);return _0x5c6ca0[_0xf692('0x27')](_0xf692('0x28'),_0x1914af+'-'+_0x235694+'/'+_0x4d3159)[_0xf692('0x22')](_0x45b7be);}return null;};}function patchUpdates(_0x4af974){return function(_0x224174){try{jsonpatch[_0xf692('0x29')](_0x224174,_0x4af974,!![]);}catch(_0x1b7bda){return BPromise[_0xf692('0x2a')](_0x1b7bda);}return _0x224174[_0xf692('0x2b')]();};}function saveUpdates(_0x59cb73,_0x5c1cb8){return function(_0x3d9960){if(_0x3d9960){return _0x3d9960[_0xf692('0x2c')](_0x59cb73)[_0xf692('0x2d')](function(_0x13307d){return _0x13307d;});}return null;};}function removeEntity(_0x5707fb,_0x3b66e8){return function(_0x45e754){if(_0x45e754){return _0x45e754[_0xf692('0x2e')]()[_0xf692('0x2d')](function(){_0x5707fb[_0xf692('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f28c0,_0x421d58){return function(_0x4b8076){if(!_0x4b8076){_0x3f28c0['sendStatus'](0x194);}return _0x4b8076;};}function handleError(_0x1845ba,_0x155631){_0x155631=_0x155631||0x1f4;return function(_0x38660c){logger[_0xf692('0x2f')](_0x38660c[_0xf692('0x30')]);if(_0x38660c[_0xf692('0x31')]){delete _0x38660c[_0xf692('0x31')];}_0x1845ba[_0xf692('0x20')](_0x155631)[_0xf692('0x32')](_0x38660c);};}exports[_0xf692('0x33')]=function(_0x2ba01b,_0x11341e){var _0x395502={},_0x2a744f={},_0x55922b={'count':0x0,'rows':[]};var _0x4fa321=_['map'](db[_0xf692('0x34')]['rawAttributes'],function(_0x39c06a){return{'name':_0x39c06a[_0xf692('0x35')],'type':_0x39c06a[_0xf692('0x36')][_0xf692('0x37')]};});_0x2a744f['model']=_[_0xf692('0x38')](_0x4fa321,'name');_0x2a744f[_0xf692('0x39')]=_[_0xf692('0x3a')](_0x2ba01b[_0xf692('0x39')]);_0x2a744f[_0xf692('0x3b')]=_[_0xf692('0x3c')](_0x2a744f[_0xf692('0x3d')],_0x2a744f[_0xf692('0x39')]);_0x395502[_0xf692('0x3e')]=_[_0xf692('0x3c')](_0x2a744f[_0xf692('0x3d')],qs['fields'](_0x2ba01b[_0xf692('0x39')][_0xf692('0x3f')]));_0x395502[_0xf692('0x3e')]=_0x395502[_0xf692('0x3e')][_0xf692('0x40')]?_0x395502[_0xf692('0x3e')]:_0x2a744f[_0xf692('0x3d')];if(!_0x2ba01b['query'][_0xf692('0x41')](_0xf692('0x42'))){_0x395502[_0xf692('0x24')]=qs[_0xf692('0x24')](_0x2ba01b['query'][_0xf692('0x24')]);_0x395502['offset']=qs[_0xf692('0x23')](_0x2ba01b[_0xf692('0x39')]['offset']);}_0x395502[_0xf692('0x43')]=qs[_0xf692('0x44')](_0x2ba01b[_0xf692('0x39')]['sort']);_0x395502['where']=qs[_0xf692('0x3b')](_['pick'](_0x2ba01b[_0xf692('0x39')],_0x2a744f['filters']),_0x4fa321);if(_0x2ba01b[_0xf692('0x39')][_0xf692('0x45')]){_0x395502[_0xf692('0x46')]=_[_0xf692('0x47')](_0x395502[_0xf692('0x46')],{'$or':_[_0xf692('0x38')](_0x4fa321,function(_0x1e795b){if(_0x1e795b[_0xf692('0x36')]!==_0xf692('0x48')){var _0x4f9b65={};_0x4f9b65[_0x1e795b[_0xf692('0x31')]]={'$like':'%'+_0x2ba01b[_0xf692('0x39')][_0xf692('0x45')]+'%'};return _0x4f9b65;}})});}_0x395502=_[_0xf692('0x47')]({},_0x395502,_0x2ba01b[_0xf692('0x49')]);var _0x5cf399={'where':_0x395502[_0xf692('0x46')]};return db['ChatGroup'][_0xf692('0x26')](_0x5cf399)['then'](function(_0x950929){_0x55922b[_0xf692('0x26')]=_0x950929;if(_0x2ba01b[_0xf692('0x39')][_0xf692('0x4a')]){_0x395502[_0xf692('0x4b')]=[{'all':!![]}];}return db[_0xf692('0x34')][_0xf692('0x4c')](_0x395502);})[_0xf692('0x2d')](function(_0x319605){_0x55922b[_0xf692('0x4d')]=_0x319605;return _0x55922b;})[_0xf692('0x2d')](respondWithFilteredResult(_0x11341e,_0x395502))[_0xf692('0x4e')](handleError(_0x11341e,null));};exports[_0xf692('0x4f')]=function(_0xe37e82,_0xe8bcdf){var _0x3b1d93={'raw':!![],'where':{'id':_0xe37e82[_0xf692('0x50')]['id']}},_0x4ac60b={};_0x4ac60b[_0xf692('0x3d')]=_[_0xf692('0x3a')](db[_0xf692('0x34')][_0xf692('0x51')]);_0x4ac60b[_0xf692('0x39')]=_[_0xf692('0x3a')](_0xe37e82['query']);_0x4ac60b[_0xf692('0x3b')]=_[_0xf692('0x3c')](_0x4ac60b['model'],_0x4ac60b[_0xf692('0x39')]);_0x3b1d93[_0xf692('0x3e')]=_[_0xf692('0x3c')](_0x4ac60b[_0xf692('0x3d')],qs['fields'](_0xe37e82['query'][_0xf692('0x3f')]));_0x3b1d93[_0xf692('0x3e')]=_0x3b1d93[_0xf692('0x3e')][_0xf692('0x40')]?_0x3b1d93[_0xf692('0x3e')]:_0x4ac60b['model'];if(_0xe37e82[_0xf692('0x39')][_0xf692('0x4a')]){_0x3b1d93[_0xf692('0x4b')]=[{'all':!![]}];}_0x3b1d93=_[_0xf692('0x47')]({},_0x3b1d93,_0xe37e82[_0xf692('0x49')]);return db['ChatGroup'][_0xf692('0x52')](_0x3b1d93)[_0xf692('0x2d')](handleEntityNotFound(_0xe8bcdf,null))[_0xf692('0x2d')](respondWithResult(_0xe8bcdf,null))[_0xf692('0x4e')](handleError(_0xe8bcdf,null));};exports[_0xf692('0x53')]=function(_0x198f21,_0x135a93){return db[_0xf692('0x34')][_0xf692('0x53')](_0x198f21[_0xf692('0x54')],{})[_0xf692('0x2d')](respondWithResult(_0x135a93,0xc9))[_0xf692('0x4e')](handleError(_0x135a93,null));};exports['update']=function(_0x1a3eb3,_0x432e52){if(_0x1a3eb3[_0xf692('0x54')]['id']){delete _0x1a3eb3[_0xf692('0x54')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x1a3eb3['params']['id']}})['then'](handleEntityNotFound(_0x432e52,null))[_0xf692('0x2d')](saveUpdates(_0x1a3eb3['body'],null))['then'](respondWithResult(_0x432e52,null))[_0xf692('0x4e')](handleError(_0x432e52,null));};exports[_0xf692('0x2e')]=function(_0xb0a5c7,_0x597aef){return db[_0xf692('0x34')][_0xf692('0x52')]({'where':{'id':_0xb0a5c7[_0xf692('0x50')]['id']}})[_0xf692('0x2d')](handleEntityNotFound(_0x597aef,null))[_0xf692('0x2d')](removeEntity(_0x597aef,null))[_0xf692('0x4e')](handleError(_0x597aef,null));};exports['describe']=function(_0x827a78,_0x45a316){return db['ChatGroup'][_0xf692('0x55')]()['then'](respondWithResult(_0x45a316,null))['catch'](handleError(_0x45a316,null));};exports['getUnread']=function(_0xf98dd9,_0x47962f,_0x5a01c5){return db['ChatInternalMessage'][_0xf692('0x26')]({'where':{'ChatGroupId':_0xf98dd9[_0xf692('0x50')]['id'],'ToId':_0xf98dd9[_0xf692('0x56')]['id'],'read':![]}})[_0xf692('0x2d')](function(_0x1b61b0){return{'id':_['toInteger'](_0xf98dd9[_0xf692('0x50')]['id']),'count':_0x1b61b0};})[_0xf692('0x2d')](respondWithResult(_0x47962f,null))[_0xf692('0x4e')](handleError(_0x47962f,null));};exports[_0xf692('0x57')]=function(_0x414150,_0x29192e,_0xc33cd2){return db[_0xf692('0x34')][_0xf692('0x52')]({'where':{'id':_0x414150[_0xf692('0x50')]['id']}})['then'](handleEntityNotFound(_0x29192e,null))[_0xf692('0x2d')](function(_0x122eb2){if(_0x122eb2){return _0x122eb2[_0xf692('0x57')](_0x414150[_0xf692('0x54')][_0xf692('0x58')],_[_0xf692('0x59')](_0x414150[_0xf692('0x54')],[_0xf692('0x58'),'id'])||{});}})[_0xf692('0x2d')](respondWithResult(_0x29192e,null))['catch'](handleError(_0x29192e,null));};exports[_0xf692('0x5a')]=function(_0x4112b7,_0x342852,_0x3a5e02){var _0x46749f={};var _0x51d7f6={};var _0x49123d;var _0x773874;return db[_0xf692('0x34')][_0xf692('0x5b')]({'where':{'id':_0x4112b7[_0xf692('0x50')]['id']}})[_0xf692('0x2d')](handleEntityNotFound(_0x342852,null))[_0xf692('0x2d')](function(_0x11e17f){if(_0x11e17f){_0x49123d=_0x11e17f;_0x51d7f6[_0xf692('0x3d')]=_[_0xf692('0x3a')](db['User'][_0xf692('0x51')]);_0x51d7f6[_0xf692('0x39')]=_[_0xf692('0x3a')](_0x4112b7[_0xf692('0x39')]);_0x51d7f6[_0xf692('0x3b')]=_['intersection'](_0x51d7f6['model'],_0x51d7f6[_0xf692('0x39')]);_0x46749f[_0xf692('0x3e')]=_['intersection'](_0x51d7f6[_0xf692('0x3d')],qs[_0xf692('0x3f')](_0x4112b7[_0xf692('0x39')]['fields']));_0x46749f[_0xf692('0x3e')]=_0x46749f['attributes'][_0xf692('0x40')]?_0x46749f['attributes']:_0x51d7f6['model'];_0x46749f[_0xf692('0x43')]=qs['sort'](_0x4112b7[_0xf692('0x39')][_0xf692('0x44')]);_0x46749f[_0xf692('0x46')]=qs[_0xf692('0x3b')](_[_0xf692('0x5c')](_0x4112b7[_0xf692('0x39')],_0x51d7f6[_0xf692('0x3b')]));if(_0x4112b7[_0xf692('0x39')][_0xf692('0x45')]){_0x46749f[_0xf692('0x46')]=_[_0xf692('0x47')](_0x46749f[_0xf692('0x46')],{'$or':_[_0xf692('0x38')](_0x46749f['attributes'],function(_0x329e65){var _0x4af8be={};_0x4af8be[_0x329e65]={'$like':'%'+_0x4112b7[_0xf692('0x39')]['filter']+'%'};return _0x4af8be;})});}_0x46749f=_[_0xf692('0x47')]({},_0x46749f,_0x4112b7['options']);return _0x49123d[_0xf692('0x5a')](_0x46749f);}})[_0xf692('0x2d')](function(_0x405c11){if(_0x405c11){_0x773874=_0x405c11['length'];if(!_0x4112b7[_0xf692('0x39')][_0xf692('0x41')](_0xf692('0x42'))){_0x46749f[_0xf692('0x24')]=qs[_0xf692('0x24')](_0x4112b7[_0xf692('0x39')][_0xf692('0x24')]);_0x46749f[_0xf692('0x23')]=qs['offset'](_0x4112b7[_0xf692('0x39')]['offset']);}return _0x49123d[_0xf692('0x5a')](_0x46749f);}})[_0xf692('0x2d')](function(_0x4eb826){if(_0x4eb826){return _0x4eb826?{'count':_0x773874,'rows':_0x4eb826}:null;}})[_0xf692('0x2d')](respondWithResult(_0x342852,null))[_0xf692('0x4e')](handleError(_0x342852,null));};exports[_0xf692('0x5d')]=function(_0x9c7a85,_0x378bc7,_0x1aefda){return db[_0xf692('0x34')][_0xf692('0x52')]({'where':{'id':_0x9c7a85['params']['id']}})['then'](handleEntityNotFound(_0x378bc7,null))[_0xf692('0x2d')](function(_0x307b93){if(_0x307b93){return _0x307b93[_0xf692('0x5d')](_0x9c7a85[_0xf692('0x39')][_0xf692('0x58')]);}})['then'](respondWithStatusCode(_0x378bc7,null))['catch'](handleError(_0x378bc7,null));};exports[_0xf692('0x5e')]=function(_0x4e5e8e,_0x1f0843,_0x4301fe){if(_0x4e5e8e[_0xf692('0x54')]['id']){delete _0x4e5e8e[_0xf692('0x54')]['id'];}return db[_0xf692('0x34')][_0xf692('0x52')]({'where':{'id':_0x4e5e8e[_0xf692('0x50')]['id']}})[_0xf692('0x2d')](handleEntityNotFound(_0x1f0843,null))[_0xf692('0x2d')](function(_0x21d0af){if(_0x21d0af){_0x4e5e8e[_0xf692('0x54')][_0xf692('0x5f')]=_0x21d0af['id'];return db[_0xf692('0x60')]['create'](_0x4e5e8e[_0xf692('0x54')]);}})[_0xf692('0x2d')](respondWithResult(_0x1f0843,null))['catch'](handleError(_0x1f0843,null));};exports[_0xf692('0x61')]=function(_0x30fa08,_0x2c5e04,_0x51cf04){var _0x246cae={};var _0x1c1a43={};var _0x526ca9;var _0x2faf30;return db[_0xf692('0x34')][_0xf692('0x5b')]({'where':{'id':_0x30fa08[_0xf692('0x50')]['id']}})['then'](handleEntityNotFound(_0x2c5e04,null))[_0xf692('0x2d')](function(_0x2eb70d){if(_0x2eb70d){_0x526ca9=_0x2eb70d;_0x1c1a43[_0xf692('0x3d')]=_[_0xf692('0x3a')](db[_0xf692('0x60')]['rawAttributes']);_0x1c1a43[_0xf692('0x39')]=_['keys'](_0x30fa08[_0xf692('0x39')]);_0x1c1a43['filters']=_[_0xf692('0x3c')](_0x1c1a43[_0xf692('0x3d')],_0x1c1a43['query']);_0x246cae[_0xf692('0x3e')]=_['intersection'](_0x1c1a43['model'],qs[_0xf692('0x3f')](_0x30fa08[_0xf692('0x39')][_0xf692('0x3f')]));_0x246cae[_0xf692('0x3e')]=_0x246cae['attributes'][_0xf692('0x40')]?_0x246cae[_0xf692('0x3e')]:_0x1c1a43[_0xf692('0x3d')];_0x246cae[_0xf692('0x43')]=qs['sort'](_0x30fa08[_0xf692('0x39')][_0xf692('0x44')]);_0x246cae[_0xf692('0x46')]=qs[_0xf692('0x3b')](_['pick'](_0x30fa08[_0xf692('0x39')],_0x1c1a43[_0xf692('0x3b')]));if(_0x30fa08[_0xf692('0x39')][_0xf692('0x45')]){_0x246cae['where']=_[_0xf692('0x47')](_0x246cae[_0xf692('0x46')],{'$or':_[_0xf692('0x38')](_0x246cae[_0xf692('0x3e')],function(_0x588ca6){var _0x3cc206={};_0x3cc206[_0x588ca6]={'$like':'%'+_0x30fa08[_0xf692('0x39')]['filter']+'%'};return _0x3cc206;})});}if(_0x30fa08[_0xf692('0x39')][_0xf692('0x62')]){var _0xeae014=_0x30fa08[_0xf692('0x39')]['$gte']['split'](',');var _0x5485d1={};_0x5485d1[_0xeae014[0x0]]={'$gte':moment(_0xeae014[0x1])['format'](_0xf692('0x63'))};_0x246cae['where']=_[_0xf692('0x47')](_0x246cae['where'],_0x5485d1);}_0x246cae=_['merge']({},_0x246cae,_0x30fa08[_0xf692('0x49')]);return _0x526ca9[_0xf692('0x61')](_0x246cae);}})['then'](function(_0x5aed88){if(_0x5aed88){_0x2faf30=_0x5aed88['length'];if(!_0x30fa08[_0xf692('0x39')]['hasOwnProperty']('nolimit')){_0x246cae[_0xf692('0x24')]=qs[_0xf692('0x24')](_0x30fa08[_0xf692('0x39')]['limit']);_0x246cae[_0xf692('0x23')]=qs[_0xf692('0x23')](_0x30fa08[_0xf692('0x39')][_0xf692('0x23')]);}return _0x526ca9[_0xf692('0x61')](_0x246cae);}})['then'](function(_0x2a0854){if(_0x2a0854){return _0x2a0854?{'count':_0x2faf30,'rows':_0x2a0854}:null;}})[_0xf692('0x2d')](respondWithResult(_0x2c5e04,null))[_0xf692('0x4e')](handleError(_0x2c5e04,null));};
\ No newline at end of file
+var _0x6ba9=['$gte','format','YYYY-MM-DD\x20HH:mm:ss','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','length','options','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','ChatInternalMessage'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x6ba9,0x126));var _0x96ba=function(_0x315dd7,_0x5da2e8){_0x315dd7=_0x315dd7-0x0;var _0x1e7dd5=_0x6ba9[_0x315dd7];return _0x1e7dd5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x96ba('0x0'));var jsonpatch=require(_0x96ba('0x1'));var rp=require('request-promise');var moment=require(_0x96ba('0x2'));var BPromise=require(_0x96ba('0x3'));var Mustache=require(_0x96ba('0x4'));var util=require('util');var path=require('path');var sox=require(_0x96ba('0x5'));var csv=require(_0x96ba('0x6'));var ejs=require(_0x96ba('0x7'));var fs=require('fs');var fs_extra=require(_0x96ba('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x96ba('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x96ba('0xa'));var toCsv=require(_0x96ba('0x6'));var querystring=require(_0x96ba('0xb'));var Papa=require(_0x96ba('0xc'));var Redis=require(_0x96ba('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x96ba('0xe'));var as=require(_0x96ba('0xf'));var hardwareService=require(_0x96ba('0x10'));var logger=require(_0x96ba('0x11'))(_0x96ba('0x12'));var utils=require(_0x96ba('0x13'));var config=require(_0x96ba('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x96ba('0x15'))['db'];config[_0x96ba('0x16')]=_[_0x96ba('0x17')](config[_0x96ba('0x16')],{'host':_0x96ba('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x96ba('0x16')]));require(_0x96ba('0x19'))[_0x96ba('0x1a')](socket);function respondWithStatusCode(_0x2750d3,_0x3d817b){_0x3d817b=_0x3d817b||0xcc;return function(_0x39d667){if(_0x39d667){return _0x2750d3[_0x96ba('0x1b')](_0x3d817b);}return _0x2750d3[_0x96ba('0x1c')](_0x3d817b)[_0x96ba('0x1d')]();};}function respondWithResult(_0x3a29b8,_0x58a7de){_0x58a7de=_0x58a7de||0xc8;return function(_0x3074ac){if(_0x3074ac){return _0x3a29b8['status'](_0x58a7de)[_0x96ba('0x1e')](_0x3074ac);}};}function respondWithFilteredResult(_0x72ce71,_0x1dec2f){return function(_0x1e5cbf){if(_0x1e5cbf){var _0x46bda1=typeof _0x1dec2f[_0x96ba('0x1f')]===_0x96ba('0x20')&&typeof _0x1dec2f[_0x96ba('0x21')]==='undefined';var _0x4e3c09=_0x1e5cbf[_0x96ba('0x22')];var _0x5de5ff=_0x46bda1?0x0:_0x1dec2f[_0x96ba('0x1f')];var _0x52b055=_0x46bda1?_0x1e5cbf[_0x96ba('0x22')]:_0x1dec2f[_0x96ba('0x1f')]+_0x1dec2f['limit'];var _0x445980;if(_0x52b055>=_0x4e3c09){_0x52b055=_0x4e3c09;_0x445980=0xc8;}else{_0x445980=0xce;}_0x72ce71[_0x96ba('0x1c')](_0x445980);return _0x72ce71[_0x96ba('0x23')](_0x96ba('0x24'),_0x5de5ff+'-'+_0x52b055+'/'+_0x4e3c09)['json'](_0x1e5cbf);}return null;};}function patchUpdates(_0x5e9a9a){return function(_0x3665ef){try{jsonpatch[_0x96ba('0x25')](_0x3665ef,_0x5e9a9a,!![]);}catch(_0x5349c9){return BPromise[_0x96ba('0x26')](_0x5349c9);}return _0x3665ef[_0x96ba('0x27')]();};}function saveUpdates(_0x31fb19,_0x1be60f){return function(_0x425b86){if(_0x425b86){return _0x425b86[_0x96ba('0x28')](_0x31fb19)[_0x96ba('0x29')](function(_0x13d7ee){return _0x13d7ee;});}return null;};}function removeEntity(_0x306821,_0x347889){return function(_0x4d3e7d){if(_0x4d3e7d){return _0x4d3e7d[_0x96ba('0x2a')]()[_0x96ba('0x29')](function(){_0x306821['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37f5a7,_0x4ec50c){return function(_0x5a97ae){if(!_0x5a97ae){_0x37f5a7['sendStatus'](0x194);}return _0x5a97ae;};}function handleError(_0x25a97d,_0x33ad3f){_0x33ad3f=_0x33ad3f||0x1f4;return function(_0x299cd4){logger[_0x96ba('0x2b')](_0x299cd4[_0x96ba('0x2c')]);if(_0x299cd4[_0x96ba('0x2d')]){delete _0x299cd4[_0x96ba('0x2d')];}_0x25a97d[_0x96ba('0x1c')](_0x33ad3f)['send'](_0x299cd4);};}exports[_0x96ba('0x2e')]=function(_0x493c6f,_0x101637){var _0x1bcf4b={},_0x4411cf={},_0x488d57={'count':0x0,'rows':[]};var _0x3c57db=_[_0x96ba('0x2f')](db[_0x96ba('0x30')][_0x96ba('0x31')],function(_0x1b6148){return{'name':_0x1b6148[_0x96ba('0x32')],'type':_0x1b6148[_0x96ba('0x33')][_0x96ba('0x34')]};});_0x4411cf[_0x96ba('0x35')]=_[_0x96ba('0x2f')](_0x3c57db,_0x96ba('0x2d'));_0x4411cf[_0x96ba('0x36')]=_[_0x96ba('0x37')](_0x493c6f[_0x96ba('0x36')]);_0x4411cf[_0x96ba('0x38')]=_['intersection'](_0x4411cf[_0x96ba('0x35')],_0x4411cf[_0x96ba('0x36')]);_0x1bcf4b['attributes']=_[_0x96ba('0x39')](_0x4411cf['model'],qs[_0x96ba('0x3a')](_0x493c6f['query']['fields']));_0x1bcf4b[_0x96ba('0x3b')]=_0x1bcf4b[_0x96ba('0x3b')]['length']?_0x1bcf4b['attributes']:_0x4411cf[_0x96ba('0x35')];if(!_0x493c6f['query'][_0x96ba('0x3c')](_0x96ba('0x3d'))){_0x1bcf4b[_0x96ba('0x21')]=qs[_0x96ba('0x21')](_0x493c6f[_0x96ba('0x36')][_0x96ba('0x21')]);_0x1bcf4b[_0x96ba('0x1f')]=qs['offset'](_0x493c6f[_0x96ba('0x36')]['offset']);}_0x1bcf4b[_0x96ba('0x3e')]=qs[_0x96ba('0x3f')](_0x493c6f[_0x96ba('0x36')][_0x96ba('0x3f')]);_0x1bcf4b[_0x96ba('0x40')]=qs[_0x96ba('0x38')](_[_0x96ba('0x41')](_0x493c6f[_0x96ba('0x36')],_0x4411cf[_0x96ba('0x38')]),_0x3c57db);if(_0x493c6f['query'][_0x96ba('0x42')]){_0x1bcf4b['where']=_[_0x96ba('0x43')](_0x1bcf4b[_0x96ba('0x40')],{'$or':_[_0x96ba('0x2f')](_0x3c57db,function(_0x18ee88){if(_0x18ee88['type']!==_0x96ba('0x44')){var _0x539b2b={};_0x539b2b[_0x18ee88[_0x96ba('0x2d')]]={'$like':'%'+_0x493c6f[_0x96ba('0x36')][_0x96ba('0x42')]+'%'};return _0x539b2b;}})});}_0x1bcf4b=_['merge']({},_0x1bcf4b,_0x493c6f['options']);var _0x4e75a5={'where':_0x1bcf4b[_0x96ba('0x40')]};return db[_0x96ba('0x30')]['count'](_0x4e75a5)[_0x96ba('0x29')](function(_0xef889c){_0x488d57[_0x96ba('0x22')]=_0xef889c;if(_0x493c6f['query'][_0x96ba('0x45')]){_0x1bcf4b[_0x96ba('0x46')]=[{'all':!![]}];}return db[_0x96ba('0x30')][_0x96ba('0x47')](_0x1bcf4b);})['then'](function(_0xa4f8e3){_0x488d57['rows']=_0xa4f8e3;return _0x488d57;})[_0x96ba('0x29')](respondWithFilteredResult(_0x101637,_0x1bcf4b))[_0x96ba('0x48')](handleError(_0x101637,null));};exports[_0x96ba('0x49')]=function(_0x29dad9,_0x3b1295){var _0x9f738a={'raw':!![],'where':{'id':_0x29dad9[_0x96ba('0x4a')]['id']}},_0x370ba9={};_0x370ba9['model']=_['keys'](db['ChatGroup'][_0x96ba('0x31')]);_0x370ba9[_0x96ba('0x36')]=_[_0x96ba('0x37')](_0x29dad9[_0x96ba('0x36')]);_0x370ba9[_0x96ba('0x38')]=_[_0x96ba('0x39')](_0x370ba9['model'],_0x370ba9[_0x96ba('0x36')]);_0x9f738a[_0x96ba('0x3b')]=_[_0x96ba('0x39')](_0x370ba9[_0x96ba('0x35')],qs[_0x96ba('0x3a')](_0x29dad9[_0x96ba('0x36')][_0x96ba('0x3a')]));_0x9f738a['attributes']=_0x9f738a[_0x96ba('0x3b')][_0x96ba('0x4b')]?_0x9f738a['attributes']:_0x370ba9[_0x96ba('0x35')];if(_0x29dad9['query'][_0x96ba('0x45')]){_0x9f738a[_0x96ba('0x46')]=[{'all':!![]}];}_0x9f738a=_[_0x96ba('0x43')]({},_0x9f738a,_0x29dad9[_0x96ba('0x4c')]);return db[_0x96ba('0x30')][_0x96ba('0x4d')](_0x9f738a)[_0x96ba('0x29')](handleEntityNotFound(_0x3b1295,null))[_0x96ba('0x29')](respondWithResult(_0x3b1295,null))[_0x96ba('0x48')](handleError(_0x3b1295,null));};exports[_0x96ba('0x4e')]=function(_0x401c00,_0x1886f1){return db[_0x96ba('0x30')]['create'](_0x401c00[_0x96ba('0x4f')],{})[_0x96ba('0x29')](respondWithResult(_0x1886f1,0xc9))['catch'](handleError(_0x1886f1,null));};exports[_0x96ba('0x28')]=function(_0x5f5ac2,_0x1b87b7){if(_0x5f5ac2['body']['id']){delete _0x5f5ac2[_0x96ba('0x4f')]['id'];}return db['ChatGroup'][_0x96ba('0x4d')]({'where':{'id':_0x5f5ac2[_0x96ba('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1b87b7,null))['then'](saveUpdates(_0x5f5ac2[_0x96ba('0x4f')],null))['then'](respondWithResult(_0x1b87b7,null))[_0x96ba('0x48')](handleError(_0x1b87b7,null));};exports[_0x96ba('0x2a')]=function(_0x24cc30,_0x1c718b){return db[_0x96ba('0x30')]['find']({'where':{'id':_0x24cc30['params']['id']}})[_0x96ba('0x29')](handleEntityNotFound(_0x1c718b,null))[_0x96ba('0x29')](removeEntity(_0x1c718b,null))[_0x96ba('0x48')](handleError(_0x1c718b,null));};exports[_0x96ba('0x50')]=function(_0x508bde,_0xe4c8c5){return db[_0x96ba('0x30')][_0x96ba('0x50')]()[_0x96ba('0x29')](respondWithResult(_0xe4c8c5,null))[_0x96ba('0x48')](handleError(_0xe4c8c5,null));};exports[_0x96ba('0x51')]=function(_0x399349,_0x2221c9,_0x29b9a7){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x399349['params']['id'],'ToId':_0x399349[_0x96ba('0x52')]['id'],'read':![]}})[_0x96ba('0x29')](function(_0x2207ff){return{'id':_[_0x96ba('0x53')](_0x399349[_0x96ba('0x4a')]['id']),'count':_0x2207ff};})[_0x96ba('0x29')](respondWithResult(_0x2221c9,null))[_0x96ba('0x48')](handleError(_0x2221c9,null));};exports['addMembers']=function(_0x32d63d,_0x589153,_0x2837de){return db['ChatGroup'][_0x96ba('0x4d')]({'where':{'id':_0x32d63d[_0x96ba('0x4a')]['id']}})['then'](handleEntityNotFound(_0x589153,null))[_0x96ba('0x29')](function(_0x476b2d){if(_0x476b2d){return _0x476b2d[_0x96ba('0x54')](_0x32d63d[_0x96ba('0x4f')][_0x96ba('0x55')],_['omit'](_0x32d63d[_0x96ba('0x4f')],['ids','id'])||{});}})[_0x96ba('0x29')](respondWithResult(_0x589153,null))[_0x96ba('0x48')](handleError(_0x589153,null));};exports[_0x96ba('0x56')]=function(_0x160cc5,_0x19552e,_0x4d44b6){var _0x93bbf7={};var _0x46b57b={};var _0xdab875;var _0x186812;return db[_0x96ba('0x30')][_0x96ba('0x57')]({'where':{'id':_0x160cc5[_0x96ba('0x4a')]['id']}})['then'](handleEntityNotFound(_0x19552e,null))[_0x96ba('0x29')](function(_0x2826af){if(_0x2826af){_0xdab875=_0x2826af;_0x46b57b['model']=_[_0x96ba('0x37')](db[_0x96ba('0x58')][_0x96ba('0x31')]);_0x46b57b['query']=_['keys'](_0x160cc5[_0x96ba('0x36')]);_0x46b57b[_0x96ba('0x38')]=_[_0x96ba('0x39')](_0x46b57b['model'],_0x46b57b['query']);_0x93bbf7[_0x96ba('0x3b')]=_['intersection'](_0x46b57b['model'],qs['fields'](_0x160cc5[_0x96ba('0x36')][_0x96ba('0x3a')]));_0x93bbf7[_0x96ba('0x3b')]=_0x93bbf7[_0x96ba('0x3b')][_0x96ba('0x4b')]?_0x93bbf7[_0x96ba('0x3b')]:_0x46b57b[_0x96ba('0x35')];_0x93bbf7[_0x96ba('0x3e')]=qs[_0x96ba('0x3f')](_0x160cc5['query'][_0x96ba('0x3f')]);_0x93bbf7['where']=qs[_0x96ba('0x38')](_[_0x96ba('0x41')](_0x160cc5[_0x96ba('0x36')],_0x46b57b['filters']));if(_0x160cc5[_0x96ba('0x36')]['filter']){_0x93bbf7[_0x96ba('0x40')]=_['merge'](_0x93bbf7['where'],{'$or':_['map'](_0x93bbf7['attributes'],function(_0x1f9f85){var _0x37109a={};_0x37109a[_0x1f9f85]={'$like':'%'+_0x160cc5[_0x96ba('0x36')][_0x96ba('0x42')]+'%'};return _0x37109a;})});}_0x93bbf7=_[_0x96ba('0x43')]({},_0x93bbf7,_0x160cc5[_0x96ba('0x4c')]);return _0xdab875[_0x96ba('0x56')](_0x93bbf7);}})['then'](function(_0xc010fc){if(_0xc010fc){_0x186812=_0xc010fc[_0x96ba('0x4b')];if(!_0x160cc5[_0x96ba('0x36')][_0x96ba('0x3c')](_0x96ba('0x3d'))){_0x93bbf7[_0x96ba('0x21')]=qs[_0x96ba('0x21')](_0x160cc5[_0x96ba('0x36')][_0x96ba('0x21')]);_0x93bbf7['offset']=qs['offset'](_0x160cc5[_0x96ba('0x36')][_0x96ba('0x1f')]);}return _0xdab875[_0x96ba('0x56')](_0x93bbf7);}})[_0x96ba('0x29')](function(_0x3d410a){if(_0x3d410a){return _0x3d410a?{'count':_0x186812,'rows':_0x3d410a}:null;}})['then'](respondWithResult(_0x19552e,null))[_0x96ba('0x48')](handleError(_0x19552e,null));};exports['removeMembers']=function(_0xfa599f,_0x113926,_0x44c697){return db[_0x96ba('0x30')][_0x96ba('0x4d')]({'where':{'id':_0xfa599f[_0x96ba('0x4a')]['id']}})[_0x96ba('0x29')](handleEntityNotFound(_0x113926,null))['then'](function(_0x594804){if(_0x594804){return _0x594804[_0x96ba('0x59')](_0xfa599f[_0x96ba('0x36')]['ids']);}})[_0x96ba('0x29')](respondWithStatusCode(_0x113926,null))[_0x96ba('0x48')](handleError(_0x113926,null));};exports[_0x96ba('0x5a')]=function(_0x14f06d,_0x3f834d,_0x579a9e){if(_0x14f06d[_0x96ba('0x4f')]['id']){delete _0x14f06d[_0x96ba('0x4f')]['id'];}return db[_0x96ba('0x30')][_0x96ba('0x4d')]({'where':{'id':_0x14f06d[_0x96ba('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f834d,null))[_0x96ba('0x29')](function(_0x156ca6){if(_0x156ca6){_0x14f06d[_0x96ba('0x4f')][_0x96ba('0x5b')]=_0x156ca6['id'];return db['ChatInternalMessage'][_0x96ba('0x4e')](_0x14f06d[_0x96ba('0x4f')]);}})[_0x96ba('0x29')](respondWithResult(_0x3f834d,null))[_0x96ba('0x48')](handleError(_0x3f834d,null));};exports[_0x96ba('0x5c')]=function(_0x127dac,_0x5cfbe0,_0x1652c){var _0x19f865={};var _0xf1fca6={};var _0x554329;var _0x4015bc;return db[_0x96ba('0x30')][_0x96ba('0x57')]({'where':{'id':_0x127dac[_0x96ba('0x4a')]['id']}})[_0x96ba('0x29')](handleEntityNotFound(_0x5cfbe0,null))[_0x96ba('0x29')](function(_0x2bd898){if(_0x2bd898){_0x554329=_0x2bd898;_0xf1fca6[_0x96ba('0x35')]=_['keys'](db[_0x96ba('0x5d')][_0x96ba('0x31')]);_0xf1fca6[_0x96ba('0x36')]=_[_0x96ba('0x37')](_0x127dac[_0x96ba('0x36')]);_0xf1fca6[_0x96ba('0x38')]=_[_0x96ba('0x39')](_0xf1fca6[_0x96ba('0x35')],_0xf1fca6['query']);_0x19f865[_0x96ba('0x3b')]=_[_0x96ba('0x39')](_0xf1fca6['model'],qs[_0x96ba('0x3a')](_0x127dac['query'][_0x96ba('0x3a')]));_0x19f865[_0x96ba('0x3b')]=_0x19f865[_0x96ba('0x3b')][_0x96ba('0x4b')]?_0x19f865[_0x96ba('0x3b')]:_0xf1fca6[_0x96ba('0x35')];_0x19f865[_0x96ba('0x3e')]=qs[_0x96ba('0x3f')](_0x127dac[_0x96ba('0x36')][_0x96ba('0x3f')]);_0x19f865[_0x96ba('0x40')]=qs['filters'](_[_0x96ba('0x41')](_0x127dac[_0x96ba('0x36')],_0xf1fca6[_0x96ba('0x38')]));if(_0x127dac[_0x96ba('0x36')][_0x96ba('0x42')]){_0x19f865['where']=_['merge'](_0x19f865[_0x96ba('0x40')],{'$or':_[_0x96ba('0x2f')](_0x19f865['attributes'],function(_0x514960){var _0x2c71c6={};_0x2c71c6[_0x514960]={'$like':'%'+_0x127dac[_0x96ba('0x36')]['filter']+'%'};return _0x2c71c6;})});}if(_0x127dac['query'][_0x96ba('0x5e')]){var _0x59e0a5=_0x127dac['query'][_0x96ba('0x5e')]['split'](',');var _0x3238ca={};_0x3238ca[_0x59e0a5[0x0]]={'$gte':moment(_0x59e0a5[0x1])[_0x96ba('0x5f')](_0x96ba('0x60'))};_0x19f865[_0x96ba('0x40')]=_[_0x96ba('0x43')](_0x19f865[_0x96ba('0x40')],_0x3238ca);}_0x19f865=_[_0x96ba('0x43')]({},_0x19f865,_0x127dac[_0x96ba('0x4c')]);return _0x554329[_0x96ba('0x5c')](_0x19f865);}})[_0x96ba('0x29')](function(_0xc9b6f9){if(_0xc9b6f9){_0x4015bc=_0xc9b6f9[_0x96ba('0x4b')];if(!_0x127dac[_0x96ba('0x36')][_0x96ba('0x3c')](_0x96ba('0x3d'))){_0x19f865['limit']=qs[_0x96ba('0x21')](_0x127dac[_0x96ba('0x36')][_0x96ba('0x21')]);_0x19f865[_0x96ba('0x1f')]=qs[_0x96ba('0x1f')](_0x127dac[_0x96ba('0x36')][_0x96ba('0x1f')]);}return _0x554329[_0x96ba('0x5c')](_0x19f865);}})['then'](function(_0xb5a234){if(_0xb5a234){return _0xb5a234?{'count':_0x4015bc,'rows':_0xb5a234}:null;}})['then'](respondWithResult(_0x5cfbe0,null))['catch'](handleError(_0x5cfbe0,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index fe93928..7017e37 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 _0x71af=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x71af,0x194));var _0xf71a=function(_0xb0adba,_0x4399a9){_0xb0adba=_0xb0adba-0x0;var _0x2da679=_0x71af[_0xb0adba];return _0x2da679;};'use strict';var EventEmitter=require(_0xf71a('0x0'));var ChatGroup=require(_0xf71a('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf71a('0x2')](0x0);var events={'afterCreate':_0xf71a('0x3'),'afterUpdate':_0xf71a('0x4'),'afterDestroy':_0xf71a('0x5')};function emitEvent(_0x2158ea){return function(_0xee5102,_0x4863d6,_0x580200){ChatGroupEvents[_0xf71a('0x6')](_0x2158ea+':'+_0xee5102['id'],_0xee5102);ChatGroupEvents[_0xf71a('0x6')](_0x2158ea,_0xee5102);_0x580200(null);};}for(var e in events){if(events[_0xf71a('0x7')](e)){var event=events[e];ChatGroup[_0xf71a('0x8')](e,emitEvent(event));}}module[_0xf71a('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0xb5bf=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','save','remove','emit'];(function(_0x3f6b12,_0x50f264){var _0x37e441=function(_0x4f352a){while(--_0x4f352a){_0x3f6b12['push'](_0x3f6b12['shift']());}};_0x37e441(++_0x50f264);}(_0xb5bf,0x1d7));var _0xfb5b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb5bf[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0xfb5b('0x0'));var ChatGroup=require(_0xfb5b('0x1'))['db'][_0xfb5b('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfb5b('0x3'),'afterUpdate':'update','afterDestroy':_0xfb5b('0x4')};function emitEvent(_0x315c48){return function(_0x2e8dd6,_0x72f94d,_0x23dfaf){ChatGroupEvents[_0xfb5b('0x5')](_0x315c48+':'+_0x2e8dd6['id'],_0x2e8dd6);ChatGroupEvents['emit'](_0x315c48,_0x2e8dd6);_0x23dfaf(null);};}for(var e in events){if(events[_0xfb5b('0x6')](e)){var event=events[e];ChatGroup[_0xfb5b('0x7')](e,emitEvent(event));}}module[_0xfb5b('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index e90ccd6..80e03ab 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 _0xb834=['ChatGroup','chat_groups','../../config/logger','api','moment','path','rimraf','./chatGroup.attributes','exports'];(function(_0x3c17fb,_0x5f20ff){var _0x38e1f6=function(_0x1464ca){while(--_0x1464ca){_0x3c17fb['push'](_0x3c17fb['shift']());}};_0x38e1f6(++_0x5f20ff);}(_0xb834,0xda));var _0x4b83=function(_0x573c9e,_0xd4ab71){_0x573c9e=_0x573c9e-0x0;var _0x5d0714=_0xb834[_0x573c9e];return _0x5d0714;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4b83('0x0'))(_0x4b83('0x1'));var moment=require(_0x4b83('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b83('0x3'));var rimraf=require(_0x4b83('0x4'));var config=require('../../config/environment');var attributes=require(_0x4b83('0x5'));module[_0x4b83('0x6')]=function(_0xc4495f,_0x5b3170){return _0xc4495f['define'](_0x4b83('0x7'),attributes,{'tableName':_0x4b83('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfa37=['exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x38a28c,_0x49f522){var _0x544ae1=function(_0x289048){while(--_0x289048){_0x38a28c['push'](_0x38a28c['shift']());}};_0x544ae1(++_0x49f522);}(_0xfa37,0x93));var _0x7fa3=function(_0x4e0d9f,_0x43912a){_0x4e0d9f=_0x4e0d9f-0x0;var _0x341952=_0xfa37[_0x4e0d9f];return _0x341952;};'use strict';var _=require(_0x7fa3('0x0'));var util=require(_0x7fa3('0x1'));var logger=require(_0x7fa3('0x2'))(_0x7fa3('0x3'));var moment=require(_0x7fa3('0x4'));var BPromise=require(_0x7fa3('0x5'));var rp=require(_0x7fa3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7fa3('0x7'));var config=require(_0x7fa3('0x8'));var attributes=require('./chatGroup.attributes');module[_0x7fa3('0x9')]=function(_0x37f6a8,_0x582e67){return _0x37f6a8[_0x7fa3('0xa')](_0x7fa3('0xb'),attributes,{'tableName':_0x7fa3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index d985860..c63189c 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 _0xe009=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','debug','request\x20sent','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x233331,_0x177c38){var _0x3dff68=function(_0x6b3de9){while(--_0x6b3de9){_0x233331['push'](_0x233331['shift']());}};_0x3dff68(++_0x177c38);}(_0xe009,0x122));var _0x9e00=function(_0x2ae91b,_0x16b0f2){_0x2ae91b=_0x2ae91b-0x0;var _0x350099=_0xe009[_0x2ae91b];return _0x350099;};'use strict';var _=require(_0x9e00('0x0'));var util=require(_0x9e00('0x1'));var moment=require(_0x9e00('0x2'));var BPromise=require(_0x9e00('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e00('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e00('0x5'));var logger=require(_0x9e00('0x6'))(_0x9e00('0x7'));var config=require(_0x9e00('0x8'));var jayson=require(_0x9e00('0x9'));var client=jayson[_0x9e00('0xa')][_0x9e00('0xb')]({'port':0x232a});config[_0x9e00('0xc')]=_[_0x9e00('0xd')](config[_0x9e00('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9e00('0xe'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x9e00('0xf')](socket);function respondWithRpcPromise(_0x9d62ed,_0x9aa2b6,_0x278208){return new BPromise(function(_0x4a73fc,_0x1fcd0c){return client[_0x9e00('0x10')](_0x9d62ed,_0x278208)[_0x9e00('0x11')](function(_0x484db6){logger[_0x9e00('0x12')]('ChatGroup,\x20%s,\x20%s',_0x9aa2b6,'request\x20sent');logger[_0x9e00('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x9aa2b6,_0x9e00('0x14'),JSON[_0x9e00('0x15')](_0x484db6));if(_0x484db6[_0x9e00('0x16')]){if(_0x484db6[_0x9e00('0x16')][_0x9e00('0x17')]===0x1f4){logger[_0x9e00('0x16')]('ChatGroup,\x20%s,\x20%s',_0x9aa2b6,_0x484db6['error'][_0x9e00('0x18')]);return _0x1fcd0c(_0x484db6['error'][_0x9e00('0x18')]);}logger[_0x9e00('0x16')](_0x9e00('0x19'),_0x9aa2b6,_0x484db6[_0x9e00('0x16')]['message']);return _0x4a73fc(_0x484db6['error']['message']);}else{logger['info'](_0x9e00('0x19'),_0x9aa2b6,'request\x20sent');_0x4a73fc(_0x484db6[_0x9e00('0x1a')][_0x9e00('0x18')]);}})['catch'](function(_0x3113bd){logger[_0x9e00('0x16')](_0x9e00('0x19'),_0x9aa2b6,_0x3113bd);_0x1fcd0c(_0x3113bd);});});}
\ No newline at end of file
+var _0xa8eb=['jayson/promise','http','defaults','redis','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x1f8e6e,_0x3c1296){var _0x4d2d6d=function(_0x9b53d3){while(--_0x9b53d3){_0x1f8e6e['push'](_0x1f8e6e['shift']());}};_0x4d2d6d(++_0x3c1296);}(_0xa8eb,0x179));var _0xba8e=function(_0x17f3ac,_0x167137){_0x17f3ac=_0x17f3ac-0x0;var _0x4ab47e=_0xa8eb[_0x17f3ac];return _0x4ab47e;};'use strict';var _=require(_0xba8e('0x0'));var util=require('util');var moment=require(_0xba8e('0x1'));var BPromise=require('bluebird');var rs=require(_0xba8e('0x2'));var fs=require('fs');var Redis=require(_0xba8e('0x3'));var db=require(_0xba8e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xba8e('0x5'))(_0xba8e('0x6'));var config=require('../../config/environment');var jayson=require(_0xba8e('0x7'));var client=jayson['client'][_0xba8e('0x8')]({'port':0x232a});config['redis']=_[_0xba8e('0x9')](config[_0xba8e('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba8e('0xa')]));require(_0xba8e('0xb'))[_0xba8e('0xc')](socket);function respondWithRpcPromise(_0x876db9,_0x441bc3,_0x4c93d9){return new BPromise(function(_0x374d03,_0x2fb45c){return client[_0xba8e('0xd')](_0x876db9,_0x4c93d9)['then'](function(_0x1ee232){logger[_0xba8e('0xe')](_0xba8e('0xf'),_0x441bc3,_0xba8e('0x10'));logger[_0xba8e('0x11')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x441bc3,'request\x20sent',JSON[_0xba8e('0x12')](_0x1ee232));if(_0x1ee232[_0xba8e('0x13')]){if(_0x1ee232[_0xba8e('0x13')][_0xba8e('0x14')]===0x1f4){logger[_0xba8e('0x13')](_0xba8e('0xf'),_0x441bc3,_0x1ee232[_0xba8e('0x13')][_0xba8e('0x15')]);return _0x2fb45c(_0x1ee232[_0xba8e('0x13')][_0xba8e('0x15')]);}logger[_0xba8e('0x13')]('ChatGroup,\x20%s,\x20%s',_0x441bc3,_0x1ee232[_0xba8e('0x13')]['message']);return _0x374d03(_0x1ee232[_0xba8e('0x13')][_0xba8e('0x15')]);}else{logger[_0xba8e('0xe')]('ChatGroup,\x20%s,\x20%s',_0x441bc3,_0xba8e('0x10'));_0x374d03(_0x1ee232[_0xba8e('0x16')][_0xba8e('0x15')]);}})[_0xba8e('0x17')](function(_0x1d98c9){logger[_0xba8e('0x13')](_0xba8e('0xf'),_0x441bc3,_0x1d98c9);_0x2fb45c(_0x1d98c9);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index d55d504..7b7a540 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 _0x683a=['update','emit','removeListener','register','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x44379c,_0x63c052){var _0x2254a9=function(_0x5df134){while(--_0x5df134){_0x44379c['push'](_0x44379c['shift']());}};_0x2254a9(++_0x63c052);}(_0x683a,0x189));var _0xa683=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x683a[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require(_0xa683('0x0'));var events=[_0xa683('0x1'),_0xa683('0x2'),_0xa683('0x3')];function createListener(_0x123040,_0x55d636){return function(_0x508d77){_0x55d636[_0xa683('0x4')](_0x123040,_0x508d77);};}function removeListener(_0x57f35a,_0x41af92){return function(){ChatGroupEvents[_0xa683('0x5')](_0x57f35a,_0x41af92);};}exports[_0xa683('0x6')]=function(_0x1dd7ca){for(var _0x1ba059=0x0,_0x45d4e4=events[_0xa683('0x7')];_0x1ba059<_0x45d4e4;_0x1ba059++){var _0x2cb23b=events[_0x1ba059];var _0x1e34c9=createListener(_0xa683('0x8')+_0x2cb23b,_0x1dd7ca);ChatGroupEvents['on'](_0x2cb23b,_0x1e34c9);}};
\ No newline at end of file
+var _0xab46=['register','chatGroup:','remove','update'];(function(_0x5f2fea,_0x9fde07){var _0x198a0c=function(_0x2bb11a){while(--_0x2bb11a){_0x5f2fea['push'](_0x5f2fea['shift']());}};_0x198a0c(++_0x9fde07);}(_0xab46,0xfa));var _0x6ab4=function(_0x3f553b,_0x49a9c2){_0x3f553b=_0x3f553b-0x0;var _0x183c4e=_0xab46[_0x3f553b];return _0x183c4e;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x6ab4('0x0'),_0x6ab4('0x1')];function createListener(_0xd97eef,_0x2a076e){return function(_0xdaf976){_0x2a076e['emit'](_0xd97eef,_0xdaf976);};}function removeListener(_0x26fa35,_0x40ea2a){return function(){ChatGroupEvents['removeListener'](_0x26fa35,_0x40ea2a);};}exports[_0x6ab4('0x2')]=function(_0x302aef){for(var _0x5a6acc=0x0,_0x5bdcfe=events['length'];_0x5a6acc<_0x5bdcfe;_0x5a6acc++){var _0xcd83c1=events[_0x5a6acc];var _0x1e5a12=createListener(_0x6ab4('0x3')+_0xcd83c1,_0x302aef);ChatGroupEvents['on'](_0xcd83c1,_0x1e5a12);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index c264832..fa8b78d 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 _0x6c2e=['addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create'];(function(_0x57a776,_0x260c94){var _0x195520=function(_0x4e4ac3){while(--_0x4e4ac3){_0x57a776['push'](_0x57a776['shift']());}};_0x195520(++_0x260c94);}(_0x6c2e,0xf8));var _0xe6c2=function(_0x33e665,_0x6cbf9e){_0x33e665=_0x33e665-0x0;var _0x5ad37c=_0x6c2e[_0x33e665];return _0x5ad37c;};'use strict';var multer=require(_0xe6c2('0x0'));var util=require(_0xe6c2('0x1'));var path=require('path');var timeout=require(_0xe6c2('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe6c2('0x3'));var auth=require(_0xe6c2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe6c2('0x5'));var controller=require(_0xe6c2('0x6'));router[_0xe6c2('0x7')]('/',auth[_0xe6c2('0x8')](),controller[_0xe6c2('0x9')]);router[_0xe6c2('0x7')](_0xe6c2('0xa'),auth[_0xe6c2('0x8')](),controller[_0xe6c2('0xb')]);router[_0xe6c2('0x7')](_0xe6c2('0xc'),auth['isAuthenticated'](),controller[_0xe6c2('0xd')]);router[_0xe6c2('0x7')](_0xe6c2('0xe'),auth[_0xe6c2('0x8')](),controller[_0xe6c2('0xf')]);router[_0xe6c2('0x7')](_0xe6c2('0x10'),auth[_0xe6c2('0x8')](),controller[_0xe6c2('0x11')]);router['get'](_0xe6c2('0x12'),auth['isAuthenticated'](),controller[_0xe6c2('0x13')]);router[_0xe6c2('0x14')]('/',auth[_0xe6c2('0x8')](),controller[_0xe6c2('0x15')]);router[_0xe6c2('0x14')](_0xe6c2('0x10'),auth[_0xe6c2('0x8')](),controller[_0xe6c2('0x16')]);router[_0xe6c2('0x14')](_0xe6c2('0x12'),auth['isAuthenticated'](),controller[_0xe6c2('0x17')]);router[_0xe6c2('0x18')](_0xe6c2('0xc'),auth['isAuthenticated'](),controller[_0xe6c2('0x19')]);router[_0xe6c2('0x1a')]('/:id',auth[_0xe6c2('0x8')](),controller[_0xe6c2('0x1b')]);router[_0xe6c2('0x1a')]('/:id/members',auth[_0xe6c2('0x8')](),controller[_0xe6c2('0x1c')]);module[_0xe6c2('0x1d')]=router;
\ No newline at end of file
+var _0x54d6=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','create','addMembers','addMessage','put','update','delete','/:id','destroy','removeMembers','exports','multer','util'];(function(_0x55b745,_0x36e0fa){var _0x1772a7=function(_0x2bf1e3){while(--_0x2bf1e3){_0x55b745['push'](_0x55b745['shift']());}};_0x1772a7(++_0x36e0fa);}(_0x54d6,0x1b1));var _0x654d=function(_0x3eca38,_0x29419d){_0x3eca38=_0x3eca38-0x0;var _0x22a03f=_0x54d6[_0x3eca38];return _0x22a03f;};'use strict';var multer=require(_0x654d('0x0'));var util=require(_0x654d('0x1'));var path=require(_0x654d('0x2'));var timeout=require(_0x654d('0x3'));var express=require('express');var router=express[_0x654d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x654d('0x5'));var config=require(_0x654d('0x6'));var controller=require('./chatGroup.controller');router[_0x654d('0x7')]('/',auth[_0x654d('0x8')](),controller[_0x654d('0x9')]);router[_0x654d('0x7')](_0x654d('0xa'),auth[_0x654d('0x8')](),controller[_0x654d('0xb')]);router[_0x654d('0x7')]('/:id',auth[_0x654d('0x8')](),controller[_0x654d('0xc')]);router[_0x654d('0x7')](_0x654d('0xd'),auth[_0x654d('0x8')](),controller[_0x654d('0xe')]);router['get'](_0x654d('0xf'),auth['isAuthenticated'](),controller[_0x654d('0x10')]);router['get']('/:id/messages',auth[_0x654d('0x8')](),controller[_0x654d('0x11')]);router[_0x654d('0x12')]('/',auth[_0x654d('0x8')](),controller[_0x654d('0x13')]);router[_0x654d('0x12')](_0x654d('0xf'),auth[_0x654d('0x8')](),controller[_0x654d('0x14')]);router['post']('/:id/messages',auth[_0x654d('0x8')](),controller[_0x654d('0x15')]);router[_0x654d('0x16')]('/:id',auth[_0x654d('0x8')](),controller[_0x654d('0x17')]);router[_0x654d('0x18')](_0x654d('0x19'),auth[_0x654d('0x8')](),controller[_0x654d('0x1a')]);router[_0x654d('0x18')](_0x654d('0xf'),auth[_0x654d('0x8')](),controller[_0x654d('0x1b')]);module[_0x654d('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 42bfc97..908a81c 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 _0xf760=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','sequelize','exports'];(function(_0x27da43,_0x12984a){var _0x357d34=function(_0x5e3145){while(--_0x5e3145){_0x27da43['push'](_0x27da43['shift']());}};_0x357d34(++_0x12984a);}(_0xf760,0x1b6));var _0x0f76=function(_0x5335f8,_0x53fdf8){_0x5335f8=_0x5335f8-0x0;var _0x335558=_0xf760[_0x5335f8];return _0x335558;};'use strict';var Sequelize=require(_0x0f76('0x0'));module[_0x0f76('0x1')]={'closed':{'type':Sequelize[_0x0f76('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x0f76('0x3')]},'ratingType':{'type':Sequelize[_0x0f76('0x4')](_0x0f76('0x5'),_0x0f76('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x0f76('0x7')]},'pathTranscript':{'type':Sequelize[_0x0f76('0x7')]},'mailTranscript':{'type':Sequelize[_0x0f76('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x0f76('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0f76('0x8')]},'thirdDisposition':{'type':Sequelize[_0x0f76('0x8')]},'note':{'type':Sequelize[_0x0f76('0x8')]},'browserName':{'type':Sequelize[_0x0f76('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x0f76('0x8')]},'osVersion':{'type':Sequelize[_0x0f76('0x8')]},'deviceModel':{'type':Sequelize[_0x0f76('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x0f76('0x7')]},'customerIp':{'type':Sequelize[_0x0f76('0x8')]},'formData':{'type':Sequelize[_0x0f76('0x7')](_0x0f76('0xa'))},'read1stAt':{'type':Sequelize[_0x0f76('0x9')]},'lastMsgAt':{'type':Sequelize[_0x0f76('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x0f76('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x0f76('0x8')]},'customerPort':{'type':Sequelize[_0x0f76('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x0f76('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x0f76('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x9702=['out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','TEXT','STRING','long','DATE'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x9702,0x1c4));var _0x2970=function(_0x4fe5e4,_0xa61696){_0x4fe5e4=_0x4fe5e4-0x0;var _0x527332=_0x9702[_0x4fe5e4];return _0x527332;};'use strict';var Sequelize=require(_0x2970('0x0'));module[_0x2970('0x1')]={'closed':{'type':Sequelize[_0x2970('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2970('0x3')]},'ratingType':{'type':Sequelize[_0x2970('0x4')](_0x2970('0x5'),'thumb'),'defaultValue':_0x2970('0x5')},'ratingMessage':{'type':Sequelize[_0x2970('0x6')]},'pathTranscript':{'type':Sequelize[_0x2970('0x6')]},'mailTranscript':{'type':Sequelize[_0x2970('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2970('0x7')]},'secondDisposition':{'type':Sequelize[_0x2970('0x7')]},'thirdDisposition':{'type':Sequelize[_0x2970('0x7')]},'note':{'type':Sequelize[_0x2970('0x7')]},'browserName':{'type':Sequelize[_0x2970('0x7')]},'browserVersion':{'type':Sequelize[_0x2970('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x2970('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x2970('0x7')]},'referer':{'type':Sequelize[_0x2970('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x2970('0x6')](_0x2970('0x8'))},'read1stAt':{'type':Sequelize[_0x2970('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2970('0x4')]('in',_0x2970('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2970('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x2970('0x6')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x2970('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index dd5074d..1324e2d 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 _0x9a2e=['Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','User','ChatWebsite','ContactId','length','Messages','UserId','%s%d','agentAlias','customer','format','agentIdentifier','agent_alias','alias','System','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','hasOwnProperty','nolimit','sort','where','pick','ChatInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','order','includeAgent','push','addTags','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','secret','Account','get','mkdirSync','Chat','Owner','closedAt','osName','customerIp','customerPort','tail','filter','existsSync','createReadStream','createWriteStream','lastName','basename','read','value','downloadInteraction.ejs','transcript-','err','zip-dir','request-promise','bluebird','path','lodash','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','name','send','render','body','agent','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','user','show','model','keys','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','update','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','create','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','closed','disposition','file','originalname','filename','mimetype'];(function(_0x705836,_0x391b3a){var _0x15be6b=function(_0x1b08a7){while(--_0x1b08a7){_0x705836['push'](_0x705836['shift']());}};_0x15be6b(++_0x391b3a);}(_0x9a2e,0x12a));var _0xe9a2=function(_0x27976d,_0x1cc15f){_0x27976d=_0x27976d-0x0;var _0x5d3357=_0x9a2e[_0x27976d];return _0x5d3357;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xe9a2('0x0'));var rp=require(_0xe9a2('0x1'));var moment=require('moment');var BPromise=require(_0xe9a2('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe9a2('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe9a2('0x4'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0xe9a2('0x5'));var pdf=require(_0xe9a2('0x6'));var logger=require(_0xe9a2('0x7'))(_0xe9a2('0x8'));var config=require(_0xe9a2('0x9'));var db=require(_0xe9a2('0xa'))['db'];config[_0xe9a2('0xb')]=_[_0xe9a2('0xc')](config[_0xe9a2('0xb')],{'host':_0xe9a2('0xd'),'port':0x18eb});var socket=require(_0xe9a2('0xe'))(new Redis(config[_0xe9a2('0xb')]));require(_0xe9a2('0xf'))[_0xe9a2('0x10')](socket);var jayson=require(_0xe9a2('0x11'));var client=jayson[_0xe9a2('0x12')]['http']({'port':0x232b});var client9004=jayson[_0xe9a2('0x12')][_0xe9a2('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x2a09ba,_0x1750f5,_0x42cd88,_0x4b466b){return new BPromise(function(_0x4ce3d2,_0xce919c){var _0x49e2ce=_0x4b466b||client;return _0x49e2ce[_0xe9a2('0x14')](_0x2a09ba,_0x42cd88)[_0xe9a2('0x15')](function(_0x42b2e0){logger[_0xe9a2('0x16')](_0xe9a2('0x17'),_0x1750f5,_0xe9a2('0x18'));logger[_0xe9a2('0x19')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x1750f5,'request\x20sent',JSON['stringify'](_0x42b2e0));if(_0x42b2e0['error']){if(_0x42b2e0[_0xe9a2('0x1a')][_0xe9a2('0x1b')]===0x1f4){logger[_0xe9a2('0x1a')](_0xe9a2('0x17'),_0x1750f5,_0x42b2e0[_0xe9a2('0x1a')][_0xe9a2('0x1c')]);return _0xce919c(_0x42b2e0[_0xe9a2('0x1a')][_0xe9a2('0x1c')]);}logger[_0xe9a2('0x1a')](_0xe9a2('0x17'),_0x1750f5,_0x42b2e0[_0xe9a2('0x1a')][_0xe9a2('0x1c')]);return _0x4ce3d2(_0x42b2e0[_0xe9a2('0x1a')][_0xe9a2('0x1c')]);}else{logger[_0xe9a2('0x16')](_0xe9a2('0x17'),_0x1750f5,_0xe9a2('0x18'));_0x4ce3d2(_0x42b2e0[_0xe9a2('0x1d')]['message']);}})[_0xe9a2('0x1e')](function(_0x2fed32){logger[_0xe9a2('0x1a')](_0xe9a2('0x17'),_0x1750f5,_0x2fed32);_0xce919c(_0x2fed32);});});}function respondWithStatusCode(_0x11ea3c,_0x135031){_0x135031=_0x135031||0xcc;return function(_0x4e31a6){if(_0x4e31a6){return _0x11ea3c[_0xe9a2('0x1f')](_0x135031);}return _0x11ea3c[_0xe9a2('0x20')](_0x135031)[_0xe9a2('0x21')]();};}function respondWithResult(_0x216f7e,_0xaae22){_0xaae22=_0xaae22||0xc8;return function(_0x10c466){if(_0x10c466){return _0x216f7e['status'](_0xaae22)[_0xe9a2('0x22')](_0x10c466);}};}function respondWithFilteredResult(_0x282b73,_0x5b30d1){return function(_0x4bd54d){if(_0x4bd54d){var _0x23e3c7=typeof _0x5b30d1[_0xe9a2('0x23')]===_0xe9a2('0x24')&&typeof _0x5b30d1[_0xe9a2('0x25')]===_0xe9a2('0x24');var _0x497e6f=_0x4bd54d['count'];var _0x3d5cbd=_0x23e3c7?0x0:_0x5b30d1[_0xe9a2('0x23')];var _0x51e516=_0x23e3c7?_0x4bd54d[_0xe9a2('0x26')]:_0x5b30d1[_0xe9a2('0x23')]+_0x5b30d1[_0xe9a2('0x25')];var _0x39fc87;if(_0x51e516>=_0x497e6f){_0x51e516=_0x497e6f;_0x39fc87=0xc8;}else{_0x39fc87=0xce;}_0x282b73[_0xe9a2('0x20')](_0x39fc87);return _0x282b73[_0xe9a2('0x27')](_0xe9a2('0x28'),_0x3d5cbd+'-'+_0x51e516+'/'+_0x497e6f)[_0xe9a2('0x22')](_0x4bd54d);}return null;};}function saveUpdates(_0x24a424){return function(_0x17c9f3){if(_0x17c9f3){return _0x17c9f3['update'](_0x24a424)[_0xe9a2('0x15')](function(_0x3a1903){return _0x3a1903;});}return null;};}function removeEntity(_0x15213f){return function(_0x419fc9){if(_0x419fc9){return _0x419fc9[_0xe9a2('0x29')]()[_0xe9a2('0x15')](function(){_0x15213f[_0xe9a2('0x20')](0xcc)[_0xe9a2('0x21')]();});}};}function handleEntityNotFound(_0x18ea0a){return function(_0x3ff333){if(!_0x3ff333){_0x18ea0a['sendStatus'](0x194);}return _0x3ff333;};}function handleError(_0x22dbdb,_0x8e2add){_0x8e2add=_0x8e2add||0x1f4;return function(_0x499e86){logger[_0xe9a2('0x1a')](_0x499e86['stack']);if(_0x499e86[_0xe9a2('0x2a')]){delete _0x499e86['name'];}_0x22dbdb['status'](_0x8e2add)[_0xe9a2('0x2b')](_0x499e86);};}function getMustacheRender(_0x10f16f,_0x459df8){return Mustache[_0xe9a2('0x2c')](_0x10f16f,_['merge'](_0x459df8[_0xe9a2('0x2d')],{'contact':_0x459df8['contact'],'message':_0x459df8[_0xe9a2('0x1c')],'agent':_0x459df8[_0xe9a2('0x2e')],'interaction':_0x459df8['interaction'],'account':_0x459df8[_0xe9a2('0x2f')]}))||'';}exports[_0xe9a2('0x30')]=function(_0x135b90,_0x31b203){var _0x445d4c={};var _0x38254a=_[_0xe9a2('0x31')](db[_0xe9a2('0x32')][_0xe9a2('0x33')],function(_0x40785c){return{'name':_0x40785c[_0xe9a2('0x34')],'type':_0x40785c[_0xe9a2('0x35')][_0xe9a2('0x36')]};});_0x445d4c=qs[_0xe9a2('0x37')](_0x38254a,_0x135b90);return interaction[_0xe9a2('0x38')](_0xe9a2('0x39'),_0x135b90['query'],_0x135b90[_0xe9a2('0x3a')],_0x445d4c,_0x38254a)['then'](respondWithFilteredResult(_0x31b203,_0x445d4c))['catch'](handleError(_0x31b203,null));};exports[_0xe9a2('0x3b')]=function(_0x33247b,_0x45240f){var _0x44f4af={'raw':![],'where':{'id':_0x33247b['params']['id']}},_0x1ab33c={};_0x1ab33c[_0xe9a2('0x3c')]=_[_0xe9a2('0x3d')](db[_0xe9a2('0x32')][_0xe9a2('0x33')]);_0x1ab33c[_0xe9a2('0x3e')]=_[_0xe9a2('0x3d')](_0x33247b[_0xe9a2('0x3e')]);_0x1ab33c[_0xe9a2('0x3f')]=_['intersection'](_0x1ab33c[_0xe9a2('0x3c')],_0x1ab33c[_0xe9a2('0x3e')]);_0x44f4af['attributes']=_[_0xe9a2('0x40')](_0x1ab33c[_0xe9a2('0x3c')],qs[_0xe9a2('0x41')](_0x33247b[_0xe9a2('0x3e')][_0xe9a2('0x41')]));_0x44f4af[_0xe9a2('0x42')]=_0x44f4af['attributes']['length']?_0x44f4af[_0xe9a2('0x42')]:_0x1ab33c[_0xe9a2('0x3c')];if(_0x33247b[_0xe9a2('0x3e')][_0xe9a2('0x43')]){_0x44f4af[_0xe9a2('0x44')]=[{'all':!![]}];}_0x44f4af=_[_0xe9a2('0x45')]({},_0x44f4af,_0x33247b[_0xe9a2('0x46')]);return db[_0xe9a2('0x32')][_0xe9a2('0x47')](_0x44f4af)[_0xe9a2('0x15')](handleEntityNotFound(_0x45240f,null))[_0xe9a2('0x15')](respondWithResult(_0x45240f,null))[_0xe9a2('0x1e')](handleError(_0x45240f,null));};exports['create']=function(_0x259343,_0x59a11e){return db[_0xe9a2('0x32')]['create'](_0x259343[_0xe9a2('0x2d')],{})[_0xe9a2('0x15')](respondWithResult(_0x59a11e,0xc9))[_0xe9a2('0x1e')](handleError(_0x59a11e,null));};exports[_0xe9a2('0x48')]=function(_0xda6ad1,_0x4682ed){if(_0xda6ad1['body']['id']){delete _0xda6ad1[_0xe9a2('0x2d')]['id'];}return db[_0xe9a2('0x32')][_0xe9a2('0x47')]({'where':{'id':_0xda6ad1['params']['id']}})[_0xe9a2('0x15')](handleEntityNotFound(_0x4682ed,null))['then'](saveUpdates(_0xda6ad1[_0xe9a2('0x2d')],null))[_0xe9a2('0x15')](respondWithResult(_0x4682ed,null))[_0xe9a2('0x1e')](handleError(_0x4682ed,null));};exports[_0xe9a2('0x29')]=function(_0x1ef7a7,_0x5853bc){return db[_0xe9a2('0x32')]['find']({'where':{'id':_0x1ef7a7[_0xe9a2('0x49')]['id']}})[_0xe9a2('0x15')](handleEntityNotFound(_0x5853bc,null))[_0xe9a2('0x15')](removeEntity(_0x5853bc,null))[_0xe9a2('0x1e')](handleError(_0x5853bc,null));};exports[_0xe9a2('0x4a')]=function(_0x4c968c,_0x4db074){return db[_0xe9a2('0x32')][_0xe9a2('0x4a')]()[_0xe9a2('0x15')](respondWithResult(_0x4db074,null))['catch'](handleError(_0x4db074,null));};exports[_0xe9a2('0x4b')]=function(_0x27ec84,_0x4c68f4){var _0x5216ca=_0x27ec84[_0xe9a2('0x49')]['id'];var _0x552712;var _0x3cad60;var _0x1722ea;return db['ChatInteraction'][_0xe9a2('0x4c')]({'where':{'id':_0x5216ca}})[_0xe9a2('0x15')](function(_0x146377){_0x552712=_0x146377;return db['ChatWebsite'][_0xe9a2('0x4c')]({'where':{'id':_0x146377['ChatWebsiteId']},'attributes':['id',_0xe9a2('0x4d'),_0xe9a2('0x4e'),'vidaooTopic',_0xe9a2('0x4f'),_0xe9a2('0x50')],'raw':!![]});})[_0xe9a2('0x15')](function(_0x2fd406){if(_0x2fd406&&_0x2fd406[_0xe9a2('0x4d')]&&_0x2fd406[_0xe9a2('0x4e')]){_0x3cad60=_0x2fd406;var _0x4ebaa9={'interaction':{'id':_0x5216ca},'agent':{'id':_0x27ec84['user']['id'],'name':_0x27ec84[_0xe9a2('0x3a')][_0xe9a2('0x2a')],'fullname':_0x27ec84['user'][_0xe9a2('0x51')],'email':_0x27ec84[_0xe9a2('0x3a')][_0xe9a2('0x52')]},'contact':_0x27ec84[_0xe9a2('0x2d')][_0xe9a2('0x53')],'account':_0x27ec84['body'][_0xe9a2('0x2f')]};var _0x1d76aa={'rejectUnauthorized':![],'method':_0xe9a2('0x54'),'url':_0xe9a2('0x55'),'headers':{'X-APIKEY':_0x2fd406[_0xe9a2('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x27ec84[_0xe9a2('0x3a')][_0xe9a2('0x52')]],'buttons':null,'topic':_0x3cad60[_0xe9a2('0x56')],'note':_[_0xe9a2('0x57')](_0x3cad60[_0xe9a2('0x4f')])?null:getMustacheRender(_0x3cad60[_0xe9a2('0x4f')],_0x4ebaa9),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x3cad60['vidaooMetadata'])){var _0x2698df=getMustacheRender(_0x3cad60['vidaooMetadata'],_0x4ebaa9);var _0x20a657=JSON[_0xe9a2('0x58')](_0x2698df);_0x1d76aa[_0xe9a2('0x2d')][_0xe9a2('0x59')]=_0x20a657;}}catch(_0x4cca42){throw new db[(_0xe9a2('0x5a'))][(_0xe9a2('0x5b'))](_0xe9a2('0x5c'));}return rp(_0x1d76aa);}else{throw new db[(_0xe9a2('0x5a'))][(_0xe9a2('0x5b'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xe9a2('0x15')](function(_0x31e1d8){_0x1722ea=_0x31e1d8;if(_0x1722ea['id']){var _0x379d7f={'body':_0x1722ea[_0xe9a2('0x5d')],'ChatWebsiteId':_0x3cad60['id'],'ChatInteractionId':_0x552712['id'],'direction':_0xe9a2('0x5e'),'UserId':_0x27ec84[_0xe9a2('0x3a')]['id']};return db[_0xe9a2('0x5f')][_0xe9a2('0x60')](_0x379d7f,{});}else{throw new db['Sequelize'][(_0xe9a2('0x5b'))](_0xe9a2('0x61'));}})[_0xe9a2('0x15')](function(){return _0x552712[_0xe9a2('0x62')]({'vidaooSessionId':_0x1722ea['id']});})[_0xe9a2('0x15')](respondWithResult(_0x4c68f4,null))[_0xe9a2('0x1e')](handleError(_0x4c68f4,null));};exports['customUpdate']=function(_0x4301e3,_0x527671){if(_0x4301e3[_0xe9a2('0x2d')]['id']){delete _0x4301e3[_0xe9a2('0x2d')]['id'];}return db[_0xe9a2('0x32')]['find']({'where':{'id':_0x4301e3[_0xe9a2('0x49')]['id']},'include':[{'model':db[_0xe9a2('0x63')],'as':_0xe9a2('0x64')}]})[_0xe9a2('0x15')](handleEntityNotFound(_0x527671,null))[_0xe9a2('0x15')](saveUpdates(_0x4301e3[_0xe9a2('0x2d')],null))[_0xe9a2('0x15')](respondWithResult(_0x527671,null))[_0xe9a2('0x1e')](handleError(_0x527671,null));};exports[_0xe9a2('0x65')]=function(_0x374ef5,_0x376a63){if(_0x374ef5[_0xe9a2('0x2d')]['id']){delete _0x374ef5[_0xe9a2('0x2d')]['id'];}return db[_0xe9a2('0x32')][_0xe9a2('0x47')]({'where':{'id':_0x374ef5[_0xe9a2('0x49')]['id']}})[_0xe9a2('0x15')](function(_0x575cc6){if(!_0x575cc6){logger['error'](_0xe9a2('0x66'),_0xe9a2('0x65'),0x194,_0xe9a2('0x67'));_0x376a63[_0xe9a2('0x1f')](0x194);}else{if(_0x575cc6['UserId']){throw new db['Sequelize'][(_0xe9a2('0x5b'))]('Interaction\x20already\x20assigned');}}return _0x575cc6;})['then'](function(_0x3448f9){if(_0x3448f9){return _0x3448f9[_0xe9a2('0x48')]({'closed':_0x374ef5[_0xe9a2('0x2d')][_0xe9a2('0x68')],'disposition':_0x374ef5['body'][_0xe9a2('0x69')]})[_0xe9a2('0x15')](function(_0x372d3c){return _0x372d3c;});}})[_0xe9a2('0x15')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x374ef5[_0xe9a2('0x2d')],client9004);})[_0xe9a2('0x15')](respondWithResult(_0x376a63,null))[_0xe9a2('0x1e')](handleError(_0x376a63,null));};exports['attachmentUpload']=function(_0x523e57,_0xe0649d){_0x523e57[_0xe9a2('0x2d')][_0xe9a2('0x2a')]=_0x523e57[_0xe9a2('0x6a')][_0xe9a2('0x6b')];_0x523e57[_0xe9a2('0x2d')]['basename']=_0x523e57[_0xe9a2('0x6a')][_0xe9a2('0x6c')];_0x523e57[_0xe9a2('0x2d')]['type']=_0x523e57['file'][_0xe9a2('0x6d')];return db[_0xe9a2('0x6e')]['create'](_0x523e57[_0xe9a2('0x2d')])[_0xe9a2('0x15')](respondWithResult(_0xe0649d,0xc9))[_0xe9a2('0x1e')](handleError(_0xe0649d,null));};exports[_0xe9a2('0x6f')]=function(_0x4152a7,_0x4a806b){return db[_0xe9a2('0x32')][_0xe9a2('0x4c')]({'where':{'id':_0x4152a7[_0xe9a2('0x49')]['id']},'raw':!![]})[_0xe9a2('0x15')](handleEntityNotFound(_0x4a806b,null))[_0xe9a2('0x15')](function(_0x2a2658){if(_0x2a2658){if(_0x2a2658['closed']){return _0x4a806b[_0xe9a2('0x20')](0x193)[_0xe9a2('0x22')]({'status':0x193,'message':_0xe9a2('0x70')});}return db[_0xe9a2('0x6e')][_0xe9a2('0x4c')]({'where':{'id':_0x4152a7[_0xe9a2('0x3e')][_0xe9a2('0x71')]},'raw':!![]})[_0xe9a2('0x15')](handleEntityNotFound(_0x4a806b,null));}})[_0xe9a2('0x15')](function(_0x3e9109){if(_0x3e9109){var _0x3da02e=_0x3e9109[_0xe9a2('0x72')]!==null;var _0x3467fd=path['join'](config[_0xe9a2('0x73')],'server/files/attachments/');if(_0x3da02e){_0x3467fd=path[_0xe9a2('0x74')](_0x3467fd,_0xe9a2('0x75'));}var _0x1f833a=path[_0xe9a2('0x74')](_0x3467fd,_0x3e9109['basename']);return _0x4a806b[_0xe9a2('0x76')](_0x1f833a);}})[_0xe9a2('0x1e')](handleError(_0x4a806b,null));};exports[_0xe9a2('0x77')]=function(_0x414d43,_0x4f34ac){var _0x47ed8b=null;var _0x55c2d5=null;var _0x4fe647=null;if(_0x414d43['body']['id']){delete _0x414d43[_0xe9a2('0x2d')]['id'];}if(_0x414d43[_0xe9a2('0x2d')][_0xe9a2('0x78')]){_0x4fe647=path['join'](config[_0xe9a2('0x73')],_0xe9a2('0x79'),util['format'](_0xe9a2('0x7a'),Date['now']()));_0x414d43[_0xe9a2('0x2d')][_0xe9a2('0x7b')]=_0x4fe647;}return db[_0xe9a2('0x32')][_0xe9a2('0x47')]({'where':{'id':_0x414d43[_0xe9a2('0x49')]['id']},'include':[{'model':db[_0xe9a2('0x5f')],'as':'Messages','include':[{'model':db[_0xe9a2('0x7c')],'as':_0xe9a2('0x7c')}]}]})[_0xe9a2('0x15')](handleEntityNotFound(_0x4f34ac,null))[_0xe9a2('0x15')](saveUpdates(_0x414d43[_0xe9a2('0x2d')],null))[_0xe9a2('0x15')](function(_0x5a1a10){if(_0x5a1a10){_0x47ed8b=_0x5a1a10;return db[_0xe9a2('0x7d')]['find']({'where':{'id':_0x47ed8b['ChatWebsiteId']}});}})[_0xe9a2('0x15')](function(_0x43e907){if(_0x43e907){_0x55c2d5=_0x43e907;return db[_0xe9a2('0x63')][_0xe9a2('0x47')]({'where':{'id':_0x47ed8b[_0xe9a2('0x7e')]}});}})['then'](function(_0x44c63a){if(_0x44c63a){if(_0x4fe647){var _0x53dec0=null;for(var _0x1e9d57=0x1;_0x1e9d57<_0x47ed8b['Messages'][_0xe9a2('0x7f')];++_0x1e9d57){_0x53dec0=_0x47ed8b[_0xe9a2('0x80')][_0x1e9d57];var _0x20d0d7=_0x53dec0[_0xe9a2('0x81')]?util['format'](_0xe9a2('0x82'),_0x55c2d5[_0xe9a2('0x83')],_0x53dec0[_0xe9a2('0x81')]):'System';var _0x1d9fdf=_0x414d43[_0xe9a2('0x2d')][_0xe9a2('0x84')]||util[_0xe9a2('0x85')]('%s%d','Visitor',_0x53dec0[_0xe9a2('0x7e')]);switch(_0x55c2d5[_0xe9a2('0x86')]){case'website_alias':_0x20d0d7=_0x53dec0['UserId']?util['format'](_0xe9a2('0x82'),_0x55c2d5['agentAlias'],_0x53dec0[_0xe9a2('0x81')]):'System';break;case _0xe9a2('0x87'):_0x20d0d7=_0x53dec0[_0xe9a2('0x81')]?_0x53dec0[_0xe9a2('0x7c')][_0xe9a2('0x88')]||_0x53dec0[_0xe9a2('0x7c')][_0xe9a2('0x51')]:'System';break;case'agent_fullname':_0x20d0d7=_0x53dec0[_0xe9a2('0x81')]?_0x53dec0[_0xe9a2('0x7c')][_0xe9a2('0x51')]:_0xe9a2('0x89');break;default:_0x20d0d7=_0x53dec0[_0xe9a2('0x81')]?util[_0xe9a2('0x85')]('%s%d',_0x55c2d5[_0xe9a2('0x83')],_0x53dec0[_0xe9a2('0x81')]):'System';}var _0x2b5057=util[_0xe9a2('0x85')](_0xe9a2('0x8a'),moment(_0x53dec0[_0xe9a2('0x8b')])['format'](_0xe9a2('0x8c')),_0x53dec0[_0xe9a2('0x8d')]==='in'?_0x1d9fdf:_0x20d0d7,_0x53dec0[_0xe9a2('0x2d')]);if(!_0x53dec0['secret']){fs[_0xe9a2('0x8e')](_0x4fe647,_0x2b5057);}}return db[_0xe9a2('0x8f')][_0xe9a2('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0xe9a2('0x90')],'as':_0xe9a2('0x91'),'raw':!![],'include':[{'model':db[_0xe9a2('0x92')],'as':_0xe9a2('0x92'),'raw':!![]}]}]});}}})['then'](function(_0x210451){if(!_0x210451||!_0x210451[_0xe9a2('0x91')]||!_0x414d43[_0xe9a2('0x2d')])return _0x47ed8b;var _0x4ed904=_0x210451[_0xe9a2('0x93')]();return respondWithRpcPromise(_0xe9a2('0x94'),'sendMail',{'account':_0x4ed904,'message':{'from':util[_0xe9a2('0x85')]('\x22%s\x22\x20<%s>',_0x210451[_0xe9a2('0x2a')],_0x210451[_0xe9a2('0x52')]||_0x210451[_0xe9a2('0x91')]['user']),'to':_0x414d43['body'][_0xe9a2('0x78')],'subject':_0xe9a2('0x95'),'text':util[_0xe9a2('0x85')](_0xe9a2('0x96'),_0x414d43[_0xe9a2('0x2d')][_0xe9a2('0x78')]),'attachments':[{'path':_0x4fe647}]}})[_0xe9a2('0x15')](function(){return _0x47ed8b;})[_0xe9a2('0x1e')](function(_0xb8fc6c){logger[_0xe9a2('0x1a')](_0xb8fc6c);});})[_0xe9a2('0x15')](respondWithStatusCode(_0x4f34ac,0xc8))[_0xe9a2('0x1e')](handleError(_0x4f34ac,null));};exports[_0xe9a2('0x97')]=function(_0x3870fc,_0x58860d){return db[_0xe9a2('0x5f')][_0xe9a2('0x47')]({'where':{'id':_0x3870fc[_0xe9a2('0x49')]['id']}})[_0xe9a2('0x15')](handleEntityNotFound(_0x58860d,null))[_0xe9a2('0x15')](function(_0x282fe7){if(_0x282fe7){return _0x282fe7['addMessage'](_0x3870fc[_0xe9a2('0x2d')][_0xe9a2('0x98')],_['omit'](_0x3870fc['body'],[_0xe9a2('0x98'),'id'])||{});}})['then'](respondWithResult(_0x58860d,null))[_0xe9a2('0x1e')](handleError(_0x58860d,null));};exports['getMessages']=function(_0x12abcd,_0x236d8f){var _0x4cd863={'raw':![],'where':{}};var _0x416263={};var _0x3386e9={'count':0x0,'rows':[]};return db[_0xe9a2('0x32')]['findOne']({'where':{'id':_0x12abcd['params']['id']}})[_0xe9a2('0x15')](handleEntityNotFound(_0x236d8f,null))[_0xe9a2('0x15')](function(_0x57907a){if(_0x57907a){_0x416263['model']=_[_0xe9a2('0x3d')](db[_0xe9a2('0x5f')][_0xe9a2('0x33')]);_0x416263[_0xe9a2('0x3e')]=_[_0xe9a2('0x3d')](_0x12abcd[_0xe9a2('0x3e')]);_0x416263[_0xe9a2('0x3f')]=_[_0xe9a2('0x40')](_0x416263[_0xe9a2('0x3c')],_0x416263['query']);_0x4cd863[_0xe9a2('0x42')]=_[_0xe9a2('0x40')](_0x416263[_0xe9a2('0x3c')],qs[_0xe9a2('0x41')](_0x12abcd[_0xe9a2('0x3e')][_0xe9a2('0x41')]));_0x4cd863[_0xe9a2('0x42')]=_0x4cd863[_0xe9a2('0x42')]['length']?_0x4cd863['attributes']:_0x416263['model'];if(!_0x12abcd[_0xe9a2('0x3e')][_0xe9a2('0x99')](_0xe9a2('0x9a'))){_0x4cd863[_0xe9a2('0x25')]=qs[_0xe9a2('0x25')](_0x12abcd['query']['limit']);_0x4cd863[_0xe9a2('0x23')]=qs[_0xe9a2('0x23')](_0x12abcd[_0xe9a2('0x3e')][_0xe9a2('0x23')]);}_0x4cd863['order']=qs[_0xe9a2('0x9b')](_0x12abcd[_0xe9a2('0x3e')][_0xe9a2('0x9b')]);_0x4cd863[_0xe9a2('0x9c')]=qs[_0xe9a2('0x3f')](_[_0xe9a2('0x9d')](_0x12abcd['query'],_0x416263[_0xe9a2('0x3f')]));_0x4cd863[_0xe9a2('0x9c')][_0xe9a2('0x9e')]=_0x57907a['id'];if(_0x12abcd[_0xe9a2('0x3e')]['filter']){_0x4cd863[_0xe9a2('0x9c')]=_[_0xe9a2('0x45')](_0x4cd863[_0xe9a2('0x9c')],{'$or':_[_0xe9a2('0x31')](_0x4cd863[_0xe9a2('0x42')],function(_0x119ab8){var _0x5bbb84={};_0x5bbb84[_0x119ab8]={'$like':'%'+_0x12abcd[_0xe9a2('0x3e')]['filter']+'%'};return _0x5bbb84;})});}if(_0x12abcd['query'][_0xe9a2('0x9f')]){var _0x393da7=_0x12abcd[_0xe9a2('0x3e')][_0xe9a2('0x9f')][_0xe9a2('0xa0')](',');var _0x256fd2={};_0x256fd2[_0x393da7[0x0]]={'$gte':moment(_0x393da7[0x1])['format'](_0xe9a2('0xa1'))};_0x4cd863[_0xe9a2('0x9c')]=_[_0xe9a2('0x45')](_0x4cd863['where'],_0x256fd2);}_0x4cd863=_[_0xe9a2('0x45')]({},_0x4cd863,_0x12abcd['options']);return db[_0xe9a2('0x5f')][_0xe9a2('0x26')]({'where':_0x4cd863[_0xe9a2('0x9c')]})['then'](function(_0x2079eb){_0x3386e9[_0xe9a2('0x26')]=_0x2079eb;if(_0x12abcd['query'][_0xe9a2('0x43')]){_0x4cd863[_0xe9a2('0x44')]=[{'all':!![]}];}return db[_0xe9a2('0x5f')][_0xe9a2('0x38')](_0x4cd863);})[_0xe9a2('0x15')](function(_0x49b1a8){_0x3386e9[_0xe9a2('0xa2')]=_0x49b1a8;return _0x3386e9;});}})['then'](respondWithFilteredResult(_0x236d8f,_0x4cd863))[_0xe9a2('0x1e')](handleError(_0x236d8f,null));};exports[_0xe9a2('0xa3')]=function(_0x22bb59,_0x524d2d){var _0x3a398e={'where':{}},_0x39c85c={},_0x136708={'count':0x0,'rows':[]};return db[_0xe9a2('0x32')]['findOne']({'where':{'id':_0x22bb59['params']['id']}})[_0xe9a2('0x15')](handleEntityNotFound(_0x524d2d,null))[_0xe9a2('0x15')](function(_0x1434a4){if(_0x1434a4){_0x39c85c[_0xe9a2('0x3c')]=_['keys'](db[_0xe9a2('0x5f')]['rawAttributes']);_0x39c85c[_0xe9a2('0x3e')]=_['keys'](_0x22bb59['query']);_0x39c85c[_0xe9a2('0x3f')]=_['intersection'](_0x39c85c['model'],_0x39c85c[_0xe9a2('0x3e')]);_0x3a398e[_0xe9a2('0x42')]=_[_0xe9a2('0x40')](_0x39c85c['model'],qs['fields'](_0x22bb59[_0xe9a2('0x3e')][_0xe9a2('0x41')]));_0x3a398e[_0xe9a2('0x42')]=_0x3a398e[_0xe9a2('0x42')]['length']?_0x3a398e[_0xe9a2('0x42')]:_0x39c85c[_0xe9a2('0x3c')];if(!_0x22bb59[_0xe9a2('0x3e')][_0xe9a2('0x99')](_0xe9a2('0x9a'))){_0x3a398e['limit']=qs[_0xe9a2('0x25')](_0x22bb59[_0xe9a2('0x3e')]['limit']);_0x3a398e['offset']=qs['offset'](_0x22bb59[_0xe9a2('0x3e')][_0xe9a2('0x23')]);}_0x3a398e[_0xe9a2('0xa4')]=qs[_0xe9a2('0x9b')](_0x22bb59[_0xe9a2('0x3e')][_0xe9a2('0x9b')]);_0x3a398e[_0xe9a2('0x9c')]=qs['filters'](_[_0xe9a2('0x9d')](_0x22bb59[_0xe9a2('0x3e')],_0x39c85c[_0xe9a2('0x3f')]));_0x3a398e['where'][_0xe9a2('0x9e')]=_0x1434a4['id'];if(_0x22bb59[_0xe9a2('0x3e')]['filter']){_0x3a398e[_0xe9a2('0x9c')]=_['merge'](_0x3a398e[_0xe9a2('0x9c')],{'$or':_['map'](_0x3a398e[_0xe9a2('0x42')],function(_0x10f800){var _0xf1968d={};_0xf1968d[_0x10f800]={'$like':'%'+_0x22bb59[_0xe9a2('0x3e')]['filter']+'%'};return _0xf1968d;})});}_0x3a398e[_0xe9a2('0x9c')]['secret']=![];if(_0x22bb59['query']['id']){_0x3a398e[_0xe9a2('0x9c')]['id']={'$gt':_0x22bb59[_0xe9a2('0x3e')]['id']};}_0x3a398e=_[_0xe9a2('0x45')]({},_0x3a398e,_0x22bb59[_0xe9a2('0x46')]);return db[_0xe9a2('0x5f')]['count']({'where':_0x3a398e['where']})[_0xe9a2('0x15')](function(_0x590307){_0x136708[_0xe9a2('0x26')]=_0x590307;_0x3a398e['include']=[];if(_0x22bb59[_0xe9a2('0x3e')][_0xe9a2('0xa5')]){_0x3a398e[_0xe9a2('0x44')][_0xe9a2('0xa6')]({'model':db[_0xe9a2('0x7c')],'as':_0xe9a2('0x7c'),'attributes':['id',_0xe9a2('0x51'),_0xe9a2('0x88')]});}if(_0x22bb59[_0xe9a2('0x3e')][_0xe9a2('0x43')]){_0x3a398e['include']=[{'all':!![]}];}return db['ChatMessage'][_0xe9a2('0x38')](_0x3a398e);})[_0xe9a2('0x15')](function(_0x4f492b){_0x136708[_0xe9a2('0xa2')]=_0x4f492b;return _0x136708;});}})[_0xe9a2('0x15')](respondWithFilteredResult(_0x524d2d,_0x3a398e))[_0xe9a2('0x1e')](handleError(_0x524d2d,null));};exports[_0xe9a2('0xa7')]=function(_0x3a8b38,_0x50da38){return db[_0xe9a2('0x32')][_0xe9a2('0x47')]({'where':{'id':_0x3a8b38[_0xe9a2('0x49')]['id']}})['then'](handleEntityNotFound(_0x50da38,null))[_0xe9a2('0x15')](function(_0x5ba59e){if(_0x5ba59e){return _0x5ba59e[_0xe9a2('0xa8')](_0x3a8b38[_0xe9a2('0x2d')][_0xe9a2('0x98')],_['omit'](_0x3a8b38['body'],[_0xe9a2('0x98'),'id'])||{})[_0xe9a2('0xa9')](function(){return db[_0xe9a2('0xaa')]['findAll']({'attributes':['id',_0xe9a2('0x2a'),'color'],'where':{'id':_0x3a8b38['body'][_0xe9a2('0x98')]}});})[_0xe9a2('0x15')](function(_0xcc3509){socket[_0xe9a2('0xab')](_0xe9a2('0xac'),{'id':Number(_0x3a8b38[_0xe9a2('0x49')]['id']),'tags':_0xcc3509||[]});return{'id':Number(_0x3a8b38[_0xe9a2('0x49')]['id']),'tags':_0xcc3509||[]};});}})[_0xe9a2('0x15')](respondWithResult(_0x50da38,null))[_0xe9a2('0x1e')](handleError(_0x50da38,null));};exports[_0xe9a2('0xad')]=function(_0x169434,_0x44d67e){return db[_0xe9a2('0x32')][_0xe9a2('0x47')]({'where':{'id':_0x169434[_0xe9a2('0x49')]['id']}})['then'](handleEntityNotFound(_0x44d67e,null))[_0xe9a2('0x15')](function(_0x5107f1){if(_0x5107f1){return _0x5107f1[_0xe9a2('0xad')](_0x169434[_0xe9a2('0x3e')]['ids']);}})['then'](respondWithStatusCode(_0x44d67e,null))[_0xe9a2('0x1e')](handleError(_0x44d67e,null));};exports[_0xe9a2('0x76')]=function(_0x277e79,_0x4ac3ba){var _0x1a2b83=moment()[_0xe9a2('0xae')]()[_0xe9a2('0xaf')]();var _0x140bd9=path[_0xe9a2('0x74')](config[_0xe9a2('0x73')],_0xe9a2('0xb0'),_0xe9a2('0xb1'),_0xe9a2('0xb2'));var _0x3ebc56=path[_0xe9a2('0x74')](config['root'],'server',_0xe9a2('0xb1'),_0xe9a2('0xb3'));var _0x4e7205=path[_0xe9a2('0x74')](_0x140bd9,_0x1a2b83);var _0x1538c6=util[_0xe9a2('0x85')](_0xe9a2('0xb4'),_0x277e79[_0xe9a2('0x49')]['id'],_0x1a2b83);var _0x2a91bf=path[_0xe9a2('0x74')](_0x140bd9,_0x1538c6);var _0x59853f=[];_0x59853f[_0xe9a2('0xa6')]({'model':db['User'],'as':_0xe9a2('0x7c'),'attributes':['id',_0xe9a2('0x51')],'raw':!![]});_0x59853f['push']({'model':db[_0xe9a2('0x63')],'as':_0xe9a2('0x64'),'attributes':['id',_0xe9a2('0xb5'),'lastName'],'raw':!![]});if(_0x277e79['query'][_0xe9a2('0xb3')]){_0x59853f['push']({'model':db['Attachment'],'as':_0xe9a2('0x6e'),'raw':!![]});}var _0x424e96=[{'model':db[_0xe9a2('0x5f')],'as':_0xe9a2('0x80'),'attributes':['id',_0xe9a2('0x2d'),'createdAt','direction',_0xe9a2('0xb6'),'read'],'include':_0x59853f}];_0x424e96['push']({'model':db[_0xe9a2('0x7d')],'as':_0xe9a2('0xb7'),'attributes':['id',_0xe9a2('0x2a')]});_0x424e96[_0xe9a2('0xa6')]({'model':db[_0xe9a2('0x7c')],'as':'Owner','attributes':['id',_0xe9a2('0x51')]});return db[_0xe9a2('0x32')][_0xe9a2('0x47')]({'where':{'id':_0x277e79[_0xe9a2('0x49')]['id']},'include':_0x424e96})[_0xe9a2('0x15')](handleEntityNotFound(_0x4ac3ba,null))[_0xe9a2('0x15')](function(_0x59e64d){if(_0x59e64d){var _0x290fd9=_0x59e64d[_0xe9a2('0xb8')]({'plain':!![]});fs[_0xe9a2('0xb9')](_0x4e7205);var _0x1e08b6={'channel':_0xe9a2('0xba'),'account':_0x290fd9['Account'][_0xe9a2('0x2a')],'agent':_0x290fd9['Owner']?_0x290fd9[_0xe9a2('0xbb')][_0xe9a2('0x51')]:'N.A.','createdAt':moment(_0x290fd9[_0xe9a2('0x8b')])[_0xe9a2('0x85')](_0xe9a2('0xa1'))['toString'](),'closedAt':_0x290fd9[_0xe9a2('0x68')]?moment(_0x290fd9[_0xe9a2('0xbc')])[_0xe9a2('0x85')](_0xe9a2('0xa1'))[_0xe9a2('0xaf')]():'','disposition':_0x290fd9[_0xe9a2('0x69')],'chatInfo':{'browser':_0x290fd9['browserName'],'os':_0x290fd9[_0xe9a2('0xbd')],'referer':_0x290fd9['referer'],'customerIp':_0x290fd9[_0xe9a2('0xbe')],'customerPort':_0x290fd9[_0xe9a2('0xbf')]?_0x290fd9[_0xe9a2('0xbf')]:'N.A.'},'messages':_(_0x290fd9['Messages'])[_0xe9a2('0xc0')]()[_0xe9a2('0xc1')]({'secret':![]})[_0xe9a2('0x31')](function(_0x366888){if(_0x366888[_0xe9a2('0x6e')]){var _0xef6a4c=path[_0xe9a2('0x74')](_0x3ebc56,_0x366888[_0xe9a2('0x6e')]['basename']);if(fs[_0xe9a2('0xc2')](_0xef6a4c)){fs[_0xe9a2('0xc3')](_0xef6a4c)['pipe'](fs[_0xe9a2('0xc4')](path['join'](_0x4e7205,_0x366888[_0xe9a2('0x6e')]['basename'])));}}return{'date':moment(_0x366888[_0xe9a2('0x8b')])['format'](_0xe9a2('0xa1'))[_0xe9a2('0xaf')](),'sender':_0x366888[_0xe9a2('0x8d')]===_0xe9a2('0x5e')?_0x366888['User']?_0x366888['User'][_0xe9a2('0x51')]:_0xe9a2('0x89'):_0x366888[_0xe9a2('0x64')]['firstName']+(_0x366888[_0xe9a2('0x64')][_0xe9a2('0xc5')]?'\x20'+_0x366888[_0xe9a2('0x64')]['lastName']:''),'body':_0x366888[_0xe9a2('0x6e')]?_0x366888[_0xe9a2('0x6e')][_0xe9a2('0xc6')]:_0x366888['body'],'direction':_0x366888[_0xe9a2('0x8d')]===_0xe9a2('0x5e')?'A':'C','secret':_0x366888[_0xe9a2('0xb6')],'read':_0x366888[_0xe9a2('0xc7')],'attachment':_0x366888['Attachment']};})[_0xe9a2('0xc8')]()};return ejs['renderFile'](path[_0xe9a2('0x74')](config[_0xe9a2('0x73')],_0xe9a2('0xb0'),'views',_0xe9a2('0xc9')),{'interaction':_0x1e08b6})[_0xe9a2('0x15')](function(_0x490aad){var _0x17d437=path[_0xe9a2('0x74')](_0x4e7205,_0xe9a2('0xca')+_0x290fd9['id']+'-'+_0x1a2b83+'.pdf');var _0x5dc253={'path':_0x17d437,'channel':_0xe9a2('0xba'),'interactionId':_0x290fd9['id']};return pdf['createPdfFromHTML'](_0x490aad,_0x5dc253);})['then'](function(){return new Promise(function(_0x41f40d,_0x3fb957){zipdir(_0x4e7205,{'saveTo':_0x2a91bf},function(_0x1d4ec8,_0x5a5b05){if(_0x1d4ec8)return _0x3fb957(_0x1d4ec8);return _0x41f40d(_0x5a5b05);});})[_0xe9a2('0x15')](function(){return new BPromise(function(_0x14f8ed,_0x2c9238){rimraf(_0x4e7205,function(_0x745470){if(_0x745470)_0x2c9238(_0x745470);return _0x14f8ed();});});})[_0xe9a2('0x15')](function(){return _0x4ac3ba['download'](_0x2a91bf,_0x1538c6,function(_0x4dc85a){if(_0x4dc85a){logger['error'](_0xe9a2('0xcb'),_0x4dc85a);}else{fs['unlinkSync'](_0x2a91bf);}});});});}else{return _0x4ac3ba[_0xe9a2('0x1f')](0xc8);}})[_0xe9a2('0x1e')](handleError(_0x4ac3ba,null));};
\ No newline at end of file
+var _0x5b18=['findAll','query','user','catch','show','params','model','keys','ChatInteraction','rawAttributes','filters','intersection','attributes','length','includeAll','merge','create','find','destroy','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','POST','email','isNull','follow','parse','ValidationError','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','type','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','ContactId','%s%d','System','customer','agentIdentifier','agentAlias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','fields','hasOwnProperty','nolimit','order','sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','rows','getMyMessages','pick','includeAgent','include','addTags','setTags','spread','Tag','color','chatInteractionTags:save','unix','toString','server','files','tmp','push','firstName','lastName','attachments','createdAt','direction','secret','ChatWebsite','Account','Owner','get','mkdirSync','Chat','N.A.','browserName','osName','referer','customerIp','customerPort','tail','createReadStream','createWriteStream','Contact','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','stack','name','send','body','contact','agent','interaction','account','index','map','fieldName','getOptions'];(function(_0xb77d35,_0x291854){var _0x5389a8=function(_0x52b4d2){while(--_0x52b4d2){_0xb77d35['push'](_0xb77d35['shift']());}};_0x5389a8(++_0x291854);}(_0x5b18,0x16d));var _0x85b1=function(_0x18307e,_0x1898e8){_0x18307e=_0x18307e-0x0;var _0x24186b=_0x5b18[_0x18307e];return _0x24186b;};'use strict';var rimraf=require(_0x85b1('0x0'));var zipdir=require(_0x85b1('0x1'));var rp=require('request-promise');var moment=require(_0x85b1('0x2'));var BPromise=require(_0x85b1('0x3'));var Mustache=require(_0x85b1('0x4'));var util=require(_0x85b1('0x5'));var path=require(_0x85b1('0x6'));var ejs=require(_0x85b1('0x7'));var fs=require('fs');var _=require(_0x85b1('0x8'));var Redis=require(_0x85b1('0x9'));var interaction=require('../../components/interaction/service');var qs=require(_0x85b1('0xa'));var pdf=require(_0x85b1('0xb'));var logger=require(_0x85b1('0xc'))(_0x85b1('0xd'));var config=require('../../config/environment');var db=require(_0x85b1('0xe'))['db'];config[_0x85b1('0xf')]=_[_0x85b1('0x10')](config[_0x85b1('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x85b1('0x11'))(new Redis(config[_0x85b1('0xf')]));require(_0x85b1('0x12'))[_0x85b1('0x13')](socket);var jayson=require(_0x85b1('0x14'));var client=jayson[_0x85b1('0x15')]['http']({'port':0x232b});var client9004=jayson[_0x85b1('0x15')][_0x85b1('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x496dd1,_0x3d042e,_0x3ca15e,_0x4a624e){return new BPromise(function(_0x3b5933,_0x3f67cc){var _0x361fdb=_0x4a624e||client;return _0x361fdb[_0x85b1('0x17')](_0x496dd1,_0x3ca15e)[_0x85b1('0x18')](function(_0x1ff66d){logger[_0x85b1('0x19')](_0x85b1('0x1a'),_0x3d042e,_0x85b1('0x1b'));logger[_0x85b1('0x1c')](_0x85b1('0x1d'),_0x3d042e,_0x85b1('0x1b'),JSON[_0x85b1('0x1e')](_0x1ff66d));if(_0x1ff66d[_0x85b1('0x1f')]){if(_0x1ff66d['error']['code']===0x1f4){logger['error'](_0x85b1('0x1a'),_0x3d042e,_0x1ff66d[_0x85b1('0x1f')][_0x85b1('0x20')]);return _0x3f67cc(_0x1ff66d['error'][_0x85b1('0x20')]);}logger['error'](_0x85b1('0x1a'),_0x3d042e,_0x1ff66d[_0x85b1('0x1f')][_0x85b1('0x20')]);return _0x3b5933(_0x1ff66d[_0x85b1('0x1f')][_0x85b1('0x20')]);}else{logger[_0x85b1('0x19')](_0x85b1('0x1a'),_0x3d042e,'request\x20sent');_0x3b5933(_0x1ff66d[_0x85b1('0x21')][_0x85b1('0x20')]);}})['catch'](function(_0x5f4892){logger['error'](_0x85b1('0x1a'),_0x3d042e,_0x5f4892);_0x3f67cc(_0x5f4892);});});}function respondWithStatusCode(_0x57facb,_0x2f63a4){_0x2f63a4=_0x2f63a4||0xcc;return function(_0x50aeed){if(_0x50aeed){return _0x57facb[_0x85b1('0x22')](_0x2f63a4);}return _0x57facb[_0x85b1('0x23')](_0x2f63a4)[_0x85b1('0x24')]();};}function respondWithResult(_0x2bee2e,_0x1524f0){_0x1524f0=_0x1524f0||0xc8;return function(_0x1568d8){if(_0x1568d8){return _0x2bee2e[_0x85b1('0x23')](_0x1524f0)[_0x85b1('0x25')](_0x1568d8);}};}function respondWithFilteredResult(_0xa887ad,_0x654d3d){return function(_0x45ca1c){if(_0x45ca1c){var _0x6d000e=typeof _0x654d3d[_0x85b1('0x26')]===_0x85b1('0x27')&&typeof _0x654d3d[_0x85b1('0x28')]===_0x85b1('0x27');var _0x1ce164=_0x45ca1c[_0x85b1('0x29')];var _0x5486b2=_0x6d000e?0x0:_0x654d3d[_0x85b1('0x26')];var _0x1ca0a8=_0x6d000e?_0x45ca1c['count']:_0x654d3d[_0x85b1('0x26')]+_0x654d3d[_0x85b1('0x28')];var _0x611d0d;if(_0x1ca0a8>=_0x1ce164){_0x1ca0a8=_0x1ce164;_0x611d0d=0xc8;}else{_0x611d0d=0xce;}_0xa887ad[_0x85b1('0x23')](_0x611d0d);return _0xa887ad[_0x85b1('0x2a')](_0x85b1('0x2b'),_0x5486b2+'-'+_0x1ca0a8+'/'+_0x1ce164)[_0x85b1('0x25')](_0x45ca1c);}return null;};}function saveUpdates(_0x2fc2ff){return function(_0xc8f6da){if(_0xc8f6da){return _0xc8f6da[_0x85b1('0x2c')](_0x2fc2ff)['then'](function(_0xdd7689){return _0xdd7689;});}return null;};}function removeEntity(_0x1a37d2){return function(_0x4cd6e0){if(_0x4cd6e0){return _0x4cd6e0['destroy']()[_0x85b1('0x18')](function(){_0x1a37d2[_0x85b1('0x23')](0xcc)[_0x85b1('0x24')]();});}};}function handleEntityNotFound(_0x5716c2){return function(_0x38c327){if(!_0x38c327){_0x5716c2[_0x85b1('0x22')](0x194);}return _0x38c327;};}function handleError(_0x50e888,_0xc604b1){_0xc604b1=_0xc604b1||0x1f4;return function(_0x42ec70){logger[_0x85b1('0x1f')](_0x42ec70[_0x85b1('0x2d')]);if(_0x42ec70[_0x85b1('0x2e')]){delete _0x42ec70[_0x85b1('0x2e')];}_0x50e888['status'](_0xc604b1)[_0x85b1('0x2f')](_0x42ec70);};}function getMustacheRender(_0x52acf1,_0x1a9381){return Mustache['render'](_0x52acf1,_['merge'](_0x1a9381[_0x85b1('0x30')],{'contact':_0x1a9381[_0x85b1('0x31')],'message':_0x1a9381[_0x85b1('0x20')],'agent':_0x1a9381[_0x85b1('0x32')],'interaction':_0x1a9381[_0x85b1('0x33')],'account':_0x1a9381[_0x85b1('0x34')]}))||'';}exports[_0x85b1('0x35')]=function(_0x313711,_0x5b5959){var _0x21ab47={};var _0x350b1f=_[_0x85b1('0x36')](db['ChatInteraction']['rawAttributes'],function(_0x482947){return{'name':_0x482947[_0x85b1('0x37')],'type':_0x482947['type']['key']};});_0x21ab47=qs[_0x85b1('0x38')](_0x350b1f,_0x313711);return interaction[_0x85b1('0x39')]('chat',_0x313711[_0x85b1('0x3a')],_0x313711[_0x85b1('0x3b')],_0x21ab47,_0x350b1f)[_0x85b1('0x18')](respondWithFilteredResult(_0x5b5959,_0x21ab47))[_0x85b1('0x3c')](handleError(_0x5b5959,null));};exports[_0x85b1('0x3d')]=function(_0x2529fb,_0x598f6b){var _0x347b88={'raw':![],'where':{'id':_0x2529fb[_0x85b1('0x3e')]['id']}},_0x367d57={};_0x367d57[_0x85b1('0x3f')]=_[_0x85b1('0x40')](db[_0x85b1('0x41')][_0x85b1('0x42')]);_0x367d57['query']=_[_0x85b1('0x40')](_0x2529fb[_0x85b1('0x3a')]);_0x367d57[_0x85b1('0x43')]=_[_0x85b1('0x44')](_0x367d57[_0x85b1('0x3f')],_0x367d57['query']);_0x347b88['attributes']=_[_0x85b1('0x44')](_0x367d57[_0x85b1('0x3f')],qs['fields'](_0x2529fb[_0x85b1('0x3a')]['fields']));_0x347b88[_0x85b1('0x45')]=_0x347b88[_0x85b1('0x45')][_0x85b1('0x46')]?_0x347b88[_0x85b1('0x45')]:_0x367d57['model'];if(_0x2529fb[_0x85b1('0x3a')][_0x85b1('0x47')]){_0x347b88['include']=[{'all':!![]}];}_0x347b88=_[_0x85b1('0x48')]({},_0x347b88,_0x2529fb['options']);return db[_0x85b1('0x41')]['find'](_0x347b88)[_0x85b1('0x18')](handleEntityNotFound(_0x598f6b,null))[_0x85b1('0x18')](respondWithResult(_0x598f6b,null))[_0x85b1('0x3c')](handleError(_0x598f6b,null));};exports[_0x85b1('0x49')]=function(_0x14354e,_0x4657dc){return db[_0x85b1('0x41')][_0x85b1('0x49')](_0x14354e['body'],{})[_0x85b1('0x18')](respondWithResult(_0x4657dc,0xc9))[_0x85b1('0x3c')](handleError(_0x4657dc,null));};exports[_0x85b1('0x2c')]=function(_0x52cc7f,_0x11ea1d){if(_0x52cc7f[_0x85b1('0x30')]['id']){delete _0x52cc7f[_0x85b1('0x30')]['id'];}return db[_0x85b1('0x41')][_0x85b1('0x4a')]({'where':{'id':_0x52cc7f[_0x85b1('0x3e')]['id']}})['then'](handleEntityNotFound(_0x11ea1d,null))[_0x85b1('0x18')](saveUpdates(_0x52cc7f[_0x85b1('0x30')],null))['then'](respondWithResult(_0x11ea1d,null))[_0x85b1('0x3c')](handleError(_0x11ea1d,null));};exports[_0x85b1('0x4b')]=function(_0x35d0e6,_0x5b005c){return db['ChatInteraction']['find']({'where':{'id':_0x35d0e6[_0x85b1('0x3e')]['id']}})[_0x85b1('0x18')](handleEntityNotFound(_0x5b005c,null))[_0x85b1('0x18')](removeEntity(_0x5b005c,null))[_0x85b1('0x3c')](handleError(_0x5b005c,null));};exports['describe']=function(_0x496a2f,_0x1771ae){return db['ChatInteraction'][_0x85b1('0x4c')]()[_0x85b1('0x18')](respondWithResult(_0x1771ae,null))[_0x85b1('0x3c')](handleError(_0x1771ae,null));};exports[_0x85b1('0x4d')]=function(_0x492bb7,_0x51d382){var _0x44bc17=_0x492bb7[_0x85b1('0x3e')]['id'];var _0x37691c;var _0x29e53d;var _0x155a3f;return db[_0x85b1('0x41')][_0x85b1('0x4e')]({'where':{'id':_0x44bc17}})[_0x85b1('0x18')](function(_0x3dceb1){_0x37691c=_0x3dceb1;return db['ChatWebsite']['findOne']({'where':{'id':_0x3dceb1[_0x85b1('0x4f')]},'attributes':['id',_0x85b1('0x50'),_0x85b1('0x51'),_0x85b1('0x52'),_0x85b1('0x53'),_0x85b1('0x54')],'raw':!![]});})[_0x85b1('0x18')](function(_0x4f8509){if(_0x4f8509&&_0x4f8509[_0x85b1('0x50')]&&_0x4f8509[_0x85b1('0x51')]){_0x29e53d=_0x4f8509;var _0x3d7979={'interaction':{'id':_0x44bc17},'agent':{'id':_0x492bb7[_0x85b1('0x3b')]['id'],'name':_0x492bb7['user'][_0x85b1('0x2e')],'fullname':_0x492bb7[_0x85b1('0x3b')]['fullname'],'email':_0x492bb7[_0x85b1('0x3b')]['email']},'contact':_0x492bb7[_0x85b1('0x30')][_0x85b1('0x31')],'account':_0x492bb7[_0x85b1('0x30')][_0x85b1('0x34')]};var _0x21994c={'rejectUnauthorized':![],'method':_0x85b1('0x55'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x4f8509[_0x85b1('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x492bb7[_0x85b1('0x3b')][_0x85b1('0x56')]],'buttons':null,'topic':_0x29e53d['vidaooTopic'],'note':_[_0x85b1('0x57')](_0x29e53d[_0x85b1('0x53')])?null:getMustacheRender(_0x29e53d[_0x85b1('0x53')],_0x3d7979),'metadata':null},'redirect':_0x85b1('0x58'),'json':!![]};try{if(!_[_0x85b1('0x57')](_0x29e53d[_0x85b1('0x54')])){var _0x3c41b1=getMustacheRender(_0x29e53d['vidaooMetadata'],_0x3d7979);var _0x6e05f7=JSON[_0x85b1('0x59')](_0x3c41b1);_0x21994c[_0x85b1('0x30')]['metadata']=_0x6e05f7;}}catch(_0x55c259){throw new db['Sequelize'][(_0x85b1('0x5a'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x21994c);}else{throw new db[(_0x85b1('0x5b'))][(_0x85b1('0x5a'))](_0x85b1('0x5c'));}})[_0x85b1('0x18')](function(_0x2bd097){_0x155a3f=_0x2bd097;if(_0x155a3f['id']){var _0x11f13a={'body':_0x155a3f[_0x85b1('0x5d')],'ChatWebsiteId':_0x29e53d['id'],'ChatInteractionId':_0x37691c['id'],'direction':_0x85b1('0x5e'),'UserId':_0x492bb7[_0x85b1('0x3b')]['id']};return db[_0x85b1('0x5f')][_0x85b1('0x49')](_0x11f13a,{});}else{throw new db[(_0x85b1('0x5b'))][(_0x85b1('0x5a'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x37691c[_0x85b1('0x60')]({'vidaooSessionId':_0x155a3f['id']});})[_0x85b1('0x18')](respondWithResult(_0x51d382,null))[_0x85b1('0x3c')](handleError(_0x51d382,null));};exports['customUpdate']=function(_0x569064,_0x8faa02){if(_0x569064[_0x85b1('0x30')]['id']){delete _0x569064[_0x85b1('0x30')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x569064[_0x85b1('0x3e')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x85b1('0x18')](handleEntityNotFound(_0x8faa02,null))[_0x85b1('0x18')](saveUpdates(_0x569064[_0x85b1('0x30')],null))[_0x85b1('0x18')](respondWithResult(_0x8faa02,null))['catch'](handleError(_0x8faa02,null));};exports['abandon']=function(_0x18cfe8,_0x408c63){if(_0x18cfe8[_0x85b1('0x30')]['id']){delete _0x18cfe8[_0x85b1('0x30')]['id'];}return db['ChatInteraction'][_0x85b1('0x4a')]({'where':{'id':_0x18cfe8[_0x85b1('0x3e')]['id']}})[_0x85b1('0x18')](function(_0x3e023a){if(!_0x3e023a){logger[_0x85b1('0x1f')](_0x85b1('0x61'),_0x85b1('0x62'),0x194,_0x85b1('0x63'));_0x408c63[_0x85b1('0x22')](0x194);}else{if(_0x3e023a[_0x85b1('0x64')]){throw new db[(_0x85b1('0x5b'))][(_0x85b1('0x5a'))](_0x85b1('0x65'));}}return _0x3e023a;})[_0x85b1('0x18')](function(_0x46dba7){if(_0x46dba7){return _0x46dba7[_0x85b1('0x2c')]({'closed':_0x18cfe8[_0x85b1('0x30')][_0x85b1('0x66')],'disposition':_0x18cfe8[_0x85b1('0x30')][_0x85b1('0x67')]})[_0x85b1('0x18')](function(_0x28ca02){return _0x28ca02;});}})[_0x85b1('0x18')](function(){return respondWithRpcPromise(_0x85b1('0x68'),_0x85b1('0x62'),_0x18cfe8[_0x85b1('0x30')],client9004);})[_0x85b1('0x18')](respondWithResult(_0x408c63,null))[_0x85b1('0x3c')](handleError(_0x408c63,null));};exports[_0x85b1('0x69')]=function(_0x53063d,_0x32e93c){_0x53063d[_0x85b1('0x30')]['name']=_0x53063d[_0x85b1('0x6a')][_0x85b1('0x6b')];_0x53063d['body'][_0x85b1('0x6c')]=_0x53063d[_0x85b1('0x6a')][_0x85b1('0x6d')];_0x53063d[_0x85b1('0x30')][_0x85b1('0x6e')]=_0x53063d[_0x85b1('0x6a')][_0x85b1('0x6f')];return db[_0x85b1('0x70')][_0x85b1('0x49')](_0x53063d[_0x85b1('0x30')])[_0x85b1('0x18')](respondWithResult(_0x32e93c,0xc9))[_0x85b1('0x3c')](handleError(_0x32e93c,null));};exports['attachmentDownload']=function(_0x3a4a90,_0x3ead56){return db['ChatInteraction'][_0x85b1('0x4e')]({'where':{'id':_0x3a4a90['params']['id']},'raw':!![]})[_0x85b1('0x18')](handleEntityNotFound(_0x3ead56,null))['then'](function(_0x2bde83){if(_0x2bde83){if(_0x2bde83[_0x85b1('0x66')]){return _0x3ead56[_0x85b1('0x23')](0x193)[_0x85b1('0x25')]({'status':0x193,'message':_0x85b1('0x71')});}return db[_0x85b1('0x70')][_0x85b1('0x4e')]({'where':{'id':_0x3a4a90[_0x85b1('0x3a')][_0x85b1('0x72')]},'raw':!![]})['then'](handleEntityNotFound(_0x3ead56,null));}})[_0x85b1('0x18')](function(_0x410653){if(_0x410653){var _0x4b8d64=_0x410653[_0x85b1('0x73')]!==null;var _0x14a220=path[_0x85b1('0x74')](config[_0x85b1('0x75')],'server/files/attachments/');if(_0x4b8d64){_0x14a220=path[_0x85b1('0x74')](_0x14a220,_0x85b1('0x76'));}var _0x385c49=path['join'](_0x14a220,_0x410653[_0x85b1('0x6c')]);return _0x3ead56[_0x85b1('0x77')](_0x385c49);}})[_0x85b1('0x3c')](handleError(_0x3ead56,null));};exports[_0x85b1('0x78')]=function(_0x21220d,_0x258eb7){var _0x2e69ce=null;var _0xb140fd=null;var _0x59e0d5=null;if(_0x21220d[_0x85b1('0x30')]['id']){delete _0x21220d['body']['id'];}if(_0x21220d[_0x85b1('0x30')][_0x85b1('0x79')]){_0x59e0d5=path[_0x85b1('0x74')](config[_0x85b1('0x75')],_0x85b1('0x7a'),util[_0x85b1('0x7b')](_0x85b1('0x7c'),Date[_0x85b1('0x7d')]()));_0x21220d[_0x85b1('0x30')][_0x85b1('0x7e')]=_0x59e0d5;}return db[_0x85b1('0x41')][_0x85b1('0x4a')]({'where':{'id':_0x21220d[_0x85b1('0x3e')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x85b1('0x7f'),'include':[{'model':db[_0x85b1('0x80')],'as':_0x85b1('0x80')}]}]})[_0x85b1('0x18')](handleEntityNotFound(_0x258eb7,null))[_0x85b1('0x18')](saveUpdates(_0x21220d[_0x85b1('0x30')],null))[_0x85b1('0x18')](function(_0x43b762){if(_0x43b762){_0x2e69ce=_0x43b762;return db['ChatWebsite'][_0x85b1('0x4a')]({'where':{'id':_0x2e69ce[_0x85b1('0x4f')]}});}})['then'](function(_0x396027){if(_0x396027){_0xb140fd=_0x396027;return db[_0x85b1('0x81')][_0x85b1('0x4a')]({'where':{'id':_0x2e69ce[_0x85b1('0x82')]}});}})['then'](function(_0x45b639){if(_0x45b639){if(_0x59e0d5){var _0x154fef=null;for(var _0x2b6524=0x1;_0x2b6524<_0x2e69ce[_0x85b1('0x7f')]['length'];++_0x2b6524){_0x154fef=_0x2e69ce['Messages'][_0x2b6524];var _0x26511a=_0x154fef[_0x85b1('0x64')]?util[_0x85b1('0x7b')](_0x85b1('0x83'),_0xb140fd['agentAlias'],_0x154fef[_0x85b1('0x64')]):_0x85b1('0x84');var _0x5702f5=_0x21220d[_0x85b1('0x30')][_0x85b1('0x85')]||util[_0x85b1('0x7b')]('%s%d','Visitor',_0x154fef['ContactId']);switch(_0xb140fd[_0x85b1('0x86')]){case'website_alias':_0x26511a=_0x154fef[_0x85b1('0x64')]?util['format']('%s%d',_0xb140fd[_0x85b1('0x87')],_0x154fef[_0x85b1('0x64')]):'System';break;case'agent_alias':_0x26511a=_0x154fef[_0x85b1('0x64')]?_0x154fef[_0x85b1('0x80')][_0x85b1('0x88')]||_0x154fef[_0x85b1('0x80')][_0x85b1('0x89')]:_0x85b1('0x84');break;case _0x85b1('0x8a'):_0x26511a=_0x154fef['UserId']?_0x154fef[_0x85b1('0x80')][_0x85b1('0x89')]:_0x85b1('0x84');break;default:_0x26511a=_0x154fef['UserId']?util[_0x85b1('0x7b')]('%s%d',_0xb140fd[_0x85b1('0x87')],_0x154fef[_0x85b1('0x64')]):_0x85b1('0x84');}var _0x3c5e67=util[_0x85b1('0x7b')](_0x85b1('0x8b'),moment(_0x154fef['createdAt'])[_0x85b1('0x7b')](_0x85b1('0x8c')),_0x154fef['direction']==='in'?_0x5702f5:_0x26511a,_0x154fef['body']);if(!_0x154fef['secret']){fs[_0x85b1('0x8d')](_0x59e0d5,_0x3c5e67);}}return db[_0x85b1('0x8e')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x85b1('0x8f'),'raw':!![],'include':[{'model':db[_0x85b1('0x90')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x85b1('0x18')](function(_0x2d884d){if(!_0x2d884d||!_0x2d884d[_0x85b1('0x8f')]||!_0x21220d[_0x85b1('0x30')])return _0x2e69ce;var _0x32260e=_0x2d884d[_0x85b1('0x91')]();return respondWithRpcPromise('SendMail',_0x85b1('0x92'),{'account':_0x32260e,'message':{'from':util['format'](_0x85b1('0x93'),_0x2d884d[_0x85b1('0x2e')],_0x2d884d[_0x85b1('0x56')]||_0x2d884d['Smtp'][_0x85b1('0x3b')]),'to':_0x21220d[_0x85b1('0x30')][_0x85b1('0x79')],'subject':_0x85b1('0x94'),'text':util[_0x85b1('0x7b')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x21220d[_0x85b1('0x30')][_0x85b1('0x79')]),'attachments':[{'path':_0x59e0d5}]}})[_0x85b1('0x18')](function(){return _0x2e69ce;})[_0x85b1('0x3c')](function(_0x1e5df){logger[_0x85b1('0x1f')](_0x1e5df);});})[_0x85b1('0x18')](respondWithStatusCode(_0x258eb7,0xc8))[_0x85b1('0x3c')](handleError(_0x258eb7,null));};exports['addMessage']=function(_0x498d68,_0x300efc){return db['ChatMessage'][_0x85b1('0x4a')]({'where':{'id':_0x498d68[_0x85b1('0x3e')]['id']}})[_0x85b1('0x18')](handleEntityNotFound(_0x300efc,null))['then'](function(_0x41879d){if(_0x41879d){return _0x41879d[_0x85b1('0x95')](_0x498d68['body'][_0x85b1('0x96')],_[_0x85b1('0x97')](_0x498d68[_0x85b1('0x30')],['ids','id'])||{});}})['then'](respondWithResult(_0x300efc,null))['catch'](handleError(_0x300efc,null));};exports[_0x85b1('0x98')]=function(_0x54443d,_0x52da69){var _0x3898d1={'raw':![],'where':{}};var _0x26e35f={};var _0x2dff04={'count':0x0,'rows':[]};return db[_0x85b1('0x41')][_0x85b1('0x4e')]({'where':{'id':_0x54443d['params']['id']}})[_0x85b1('0x18')](handleEntityNotFound(_0x52da69,null))[_0x85b1('0x18')](function(_0xc03470){if(_0xc03470){_0x26e35f['model']=_[_0x85b1('0x40')](db[_0x85b1('0x5f')][_0x85b1('0x42')]);_0x26e35f[_0x85b1('0x3a')]=_[_0x85b1('0x40')](_0x54443d[_0x85b1('0x3a')]);_0x26e35f[_0x85b1('0x43')]=_[_0x85b1('0x44')](_0x26e35f[_0x85b1('0x3f')],_0x26e35f[_0x85b1('0x3a')]);_0x3898d1['attributes']=_[_0x85b1('0x44')](_0x26e35f[_0x85b1('0x3f')],qs[_0x85b1('0x99')](_0x54443d[_0x85b1('0x3a')][_0x85b1('0x99')]));_0x3898d1[_0x85b1('0x45')]=_0x3898d1[_0x85b1('0x45')][_0x85b1('0x46')]?_0x3898d1[_0x85b1('0x45')]:_0x26e35f[_0x85b1('0x3f')];if(!_0x54443d['query'][_0x85b1('0x9a')](_0x85b1('0x9b'))){_0x3898d1[_0x85b1('0x28')]=qs[_0x85b1('0x28')](_0x54443d[_0x85b1('0x3a')][_0x85b1('0x28')]);_0x3898d1[_0x85b1('0x26')]=qs[_0x85b1('0x26')](_0x54443d['query']['offset']);}_0x3898d1[_0x85b1('0x9c')]=qs[_0x85b1('0x9d')](_0x54443d['query'][_0x85b1('0x9d')]);_0x3898d1['where']=qs[_0x85b1('0x43')](_['pick'](_0x54443d['query'],_0x26e35f['filters']));_0x3898d1[_0x85b1('0x9e')][_0x85b1('0x9f')]=_0xc03470['id'];if(_0x54443d[_0x85b1('0x3a')][_0x85b1('0xa0')]){_0x3898d1[_0x85b1('0x9e')]=_[_0x85b1('0x48')](_0x3898d1[_0x85b1('0x9e')],{'$or':_[_0x85b1('0x36')](_0x3898d1[_0x85b1('0x45')],function(_0x56ea84){var _0x23e4ac={};_0x23e4ac[_0x56ea84]={'$like':'%'+_0x54443d['query'][_0x85b1('0xa0')]+'%'};return _0x23e4ac;})});}if(_0x54443d[_0x85b1('0x3a')][_0x85b1('0xa1')]){var _0x3831db=_0x54443d[_0x85b1('0x3a')][_0x85b1('0xa1')][_0x85b1('0xa2')](',');var _0x5145be={};_0x5145be[_0x3831db[0x0]]={'$gte':moment(_0x3831db[0x1])[_0x85b1('0x7b')](_0x85b1('0xa3'))};_0x3898d1[_0x85b1('0x9e')]=_[_0x85b1('0x48')](_0x3898d1[_0x85b1('0x9e')],_0x5145be);}_0x3898d1=_['merge']({},_0x3898d1,_0x54443d[_0x85b1('0xa4')]);return db[_0x85b1('0x5f')][_0x85b1('0x29')]({'where':_0x3898d1['where']})[_0x85b1('0x18')](function(_0x521750){_0x2dff04['count']=_0x521750;if(_0x54443d[_0x85b1('0x3a')]['includeAll']){_0x3898d1['include']=[{'all':!![]}];}return db[_0x85b1('0x5f')][_0x85b1('0x39')](_0x3898d1);})['then'](function(_0x41cdc7){_0x2dff04[_0x85b1('0xa5')]=_0x41cdc7;return _0x2dff04;});}})[_0x85b1('0x18')](respondWithFilteredResult(_0x52da69,_0x3898d1))[_0x85b1('0x3c')](handleError(_0x52da69,null));};exports[_0x85b1('0xa6')]=function(_0x151fd8,_0x2a1d1d){var _0x8e4627={'where':{}},_0x479d95={},_0xe50cf9={'count':0x0,'rows':[]};return db[_0x85b1('0x41')]['findOne']({'where':{'id':_0x151fd8[_0x85b1('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2a1d1d,null))[_0x85b1('0x18')](function(_0x2f0377){if(_0x2f0377){_0x479d95[_0x85b1('0x3f')]=_[_0x85b1('0x40')](db[_0x85b1('0x5f')][_0x85b1('0x42')]);_0x479d95[_0x85b1('0x3a')]=_[_0x85b1('0x40')](_0x151fd8[_0x85b1('0x3a')]);_0x479d95[_0x85b1('0x43')]=_['intersection'](_0x479d95[_0x85b1('0x3f')],_0x479d95[_0x85b1('0x3a')]);_0x8e4627['attributes']=_['intersection'](_0x479d95[_0x85b1('0x3f')],qs['fields'](_0x151fd8[_0x85b1('0x3a')]['fields']));_0x8e4627[_0x85b1('0x45')]=_0x8e4627[_0x85b1('0x45')]['length']?_0x8e4627[_0x85b1('0x45')]:_0x479d95[_0x85b1('0x3f')];if(!_0x151fd8[_0x85b1('0x3a')][_0x85b1('0x9a')](_0x85b1('0x9b'))){_0x8e4627[_0x85b1('0x28')]=qs[_0x85b1('0x28')](_0x151fd8[_0x85b1('0x3a')][_0x85b1('0x28')]);_0x8e4627[_0x85b1('0x26')]=qs['offset'](_0x151fd8[_0x85b1('0x3a')][_0x85b1('0x26')]);}_0x8e4627[_0x85b1('0x9c')]=qs[_0x85b1('0x9d')](_0x151fd8[_0x85b1('0x3a')]['sort']);_0x8e4627[_0x85b1('0x9e')]=qs[_0x85b1('0x43')](_[_0x85b1('0xa7')](_0x151fd8['query'],_0x479d95['filters']));_0x8e4627[_0x85b1('0x9e')][_0x85b1('0x9f')]=_0x2f0377['id'];if(_0x151fd8['query']['filter']){_0x8e4627['where']=_[_0x85b1('0x48')](_0x8e4627[_0x85b1('0x9e')],{'$or':_[_0x85b1('0x36')](_0x8e4627[_0x85b1('0x45')],function(_0x58a1e8){var _0x53db5d={};_0x53db5d[_0x58a1e8]={'$like':'%'+_0x151fd8[_0x85b1('0x3a')][_0x85b1('0xa0')]+'%'};return _0x53db5d;})});}_0x8e4627[_0x85b1('0x9e')]['secret']=![];if(_0x151fd8[_0x85b1('0x3a')]['id']){_0x8e4627[_0x85b1('0x9e')]['id']={'$gt':_0x151fd8[_0x85b1('0x3a')]['id']};}_0x8e4627=_[_0x85b1('0x48')]({},_0x8e4627,_0x151fd8['options']);return db[_0x85b1('0x5f')][_0x85b1('0x29')]({'where':_0x8e4627[_0x85b1('0x9e')]})[_0x85b1('0x18')](function(_0x5cfd72){_0xe50cf9[_0x85b1('0x29')]=_0x5cfd72;_0x8e4627['include']=[];if(_0x151fd8[_0x85b1('0x3a')][_0x85b1('0xa8')]){_0x8e4627[_0x85b1('0xa9')]['push']({'model':db['User'],'as':_0x85b1('0x80'),'attributes':['id',_0x85b1('0x89'),_0x85b1('0x88')]});}if(_0x151fd8[_0x85b1('0x3a')][_0x85b1('0x47')]){_0x8e4627[_0x85b1('0xa9')]=[{'all':!![]}];}return db[_0x85b1('0x5f')][_0x85b1('0x39')](_0x8e4627);})[_0x85b1('0x18')](function(_0x5685d1){_0xe50cf9[_0x85b1('0xa5')]=_0x5685d1;return _0xe50cf9;});}})[_0x85b1('0x18')](respondWithFilteredResult(_0x2a1d1d,_0x8e4627))['catch'](handleError(_0x2a1d1d,null));};exports[_0x85b1('0xaa')]=function(_0x47ebb5,_0x45fff0){return db[_0x85b1('0x41')][_0x85b1('0x4a')]({'where':{'id':_0x47ebb5[_0x85b1('0x3e')]['id']}})[_0x85b1('0x18')](handleEntityNotFound(_0x45fff0,null))[_0x85b1('0x18')](function(_0x253154){if(_0x253154){return _0x253154[_0x85b1('0xab')](_0x47ebb5['body'][_0x85b1('0x96')],_[_0x85b1('0x97')](_0x47ebb5[_0x85b1('0x30')],['ids','id'])||{})[_0x85b1('0xac')](function(){return db[_0x85b1('0xad')][_0x85b1('0x39')]({'attributes':['id','name',_0x85b1('0xae')],'where':{'id':_0x47ebb5[_0x85b1('0x30')]['ids']}});})[_0x85b1('0x18')](function(_0x204fc7){socket['emit'](_0x85b1('0xaf'),{'id':Number(_0x47ebb5[_0x85b1('0x3e')]['id']),'tags':_0x204fc7||[]});return{'id':Number(_0x47ebb5[_0x85b1('0x3e')]['id']),'tags':_0x204fc7||[]};});}})['then'](respondWithResult(_0x45fff0,null))[_0x85b1('0x3c')](handleError(_0x45fff0,null));};exports['removeTags']=function(_0x4deb77,_0x46a3de){return db[_0x85b1('0x41')][_0x85b1('0x4a')]({'where':{'id':_0x4deb77[_0x85b1('0x3e')]['id']}})[_0x85b1('0x18')](handleEntityNotFound(_0x46a3de,null))['then'](function(_0x24f91c){if(_0x24f91c){return _0x24f91c['removeTags'](_0x4deb77['query'][_0x85b1('0x96')]);}})['then'](respondWithStatusCode(_0x46a3de,null))[_0x85b1('0x3c')](handleError(_0x46a3de,null));};exports[_0x85b1('0x77')]=function(_0x582600,_0x3b8246){var _0x101b7e=moment()[_0x85b1('0xb0')]()[_0x85b1('0xb1')]();var _0x583646=path['join'](config[_0x85b1('0x75')],_0x85b1('0xb2'),_0x85b1('0xb3'),_0x85b1('0xb4'));var _0x53baee=path[_0x85b1('0x74')](config[_0x85b1('0x75')],_0x85b1('0xb2'),_0x85b1('0xb3'),'attachments');var _0x4e9b4e=path[_0x85b1('0x74')](_0x583646,_0x101b7e);var _0x562358=util[_0x85b1('0x7b')]('transcript-%d-%s.zip',_0x582600[_0x85b1('0x3e')]['id'],_0x101b7e);var _0x5a7675=path[_0x85b1('0x74')](_0x583646,_0x562358);var _0x7339b=[];_0x7339b[_0x85b1('0xb5')]({'model':db[_0x85b1('0x80')],'as':'User','attributes':['id',_0x85b1('0x89')],'raw':!![]});_0x7339b[_0x85b1('0xb5')]({'model':db[_0x85b1('0x81')],'as':'Contact','attributes':['id',_0x85b1('0xb6'),_0x85b1('0xb7')],'raw':!![]});if(_0x582600['query'][_0x85b1('0xb8')]){_0x7339b['push']({'model':db[_0x85b1('0x70')],'as':'Attachment','raw':!![]});}var _0xce464d=[{'model':db[_0x85b1('0x5f')],'as':'Messages','attributes':['id',_0x85b1('0x30'),_0x85b1('0xb9'),_0x85b1('0xba'),_0x85b1('0xbb'),'read'],'include':_0x7339b}];_0xce464d[_0x85b1('0xb5')]({'model':db[_0x85b1('0xbc')],'as':_0x85b1('0xbd'),'attributes':['id',_0x85b1('0x2e')]});_0xce464d[_0x85b1('0xb5')]({'model':db[_0x85b1('0x80')],'as':_0x85b1('0xbe'),'attributes':['id','fullname']});return db['ChatInteraction'][_0x85b1('0x4a')]({'where':{'id':_0x582600[_0x85b1('0x3e')]['id']},'include':_0xce464d})[_0x85b1('0x18')](handleEntityNotFound(_0x3b8246,null))['then'](function(_0xddb3f3){if(_0xddb3f3){var _0x2d728e=_0xddb3f3[_0x85b1('0xbf')]({'plain':!![]});fs[_0x85b1('0xc0')](_0x4e9b4e);var _0x125262={'channel':_0x85b1('0xc1'),'account':_0x2d728e[_0x85b1('0xbd')][_0x85b1('0x2e')],'agent':_0x2d728e[_0x85b1('0xbe')]?_0x2d728e[_0x85b1('0xbe')][_0x85b1('0x89')]:_0x85b1('0xc2'),'createdAt':moment(_0x2d728e['createdAt'])[_0x85b1('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')[_0x85b1('0xb1')](),'closedAt':_0x2d728e[_0x85b1('0x66')]?moment(_0x2d728e['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x85b1('0xb1')]():'','disposition':_0x2d728e['disposition'],'chatInfo':{'browser':_0x2d728e[_0x85b1('0xc3')],'os':_0x2d728e[_0x85b1('0xc4')],'referer':_0x2d728e[_0x85b1('0xc5')],'customerIp':_0x2d728e[_0x85b1('0xc6')],'customerPort':_0x2d728e[_0x85b1('0xc7')]?_0x2d728e[_0x85b1('0xc7')]:_0x85b1('0xc2')},'messages':_(_0x2d728e[_0x85b1('0x7f')])[_0x85b1('0xc8')]()[_0x85b1('0xa0')]({'secret':![]})[_0x85b1('0x36')](function(_0x284b52){if(_0x284b52[_0x85b1('0x70')]){var _0x20dcfa=path[_0x85b1('0x74')](_0x53baee,_0x284b52[_0x85b1('0x70')][_0x85b1('0x6c')]);if(fs['existsSync'](_0x20dcfa)){fs[_0x85b1('0xc9')](_0x20dcfa)['pipe'](fs[_0x85b1('0xca')](path[_0x85b1('0x74')](_0x4e9b4e,_0x284b52[_0x85b1('0x70')][_0x85b1('0x6c')])));}}return{'date':moment(_0x284b52[_0x85b1('0xb9')])[_0x85b1('0x7b')](_0x85b1('0xa3'))['toString'](),'sender':_0x284b52[_0x85b1('0xba')]===_0x85b1('0x5e')?_0x284b52[_0x85b1('0x80')]?_0x284b52[_0x85b1('0x80')][_0x85b1('0x89')]:_0x85b1('0x84'):_0x284b52['Contact']['firstName']+(_0x284b52[_0x85b1('0xcb')]['lastName']?'\x20'+_0x284b52[_0x85b1('0xcb')][_0x85b1('0xb7')]:''),'body':_0x284b52['Attachment']?_0x284b52[_0x85b1('0x70')][_0x85b1('0x6c')]:_0x284b52[_0x85b1('0x30')],'direction':_0x284b52['direction']===_0x85b1('0x5e')?'A':'C','secret':_0x284b52[_0x85b1('0xbb')],'read':_0x284b52['read'],'attachment':_0x284b52['Attachment']};})[_0x85b1('0xcc')]()};return ejs[_0x85b1('0xcd')](path['join'](config[_0x85b1('0x75')],_0x85b1('0xb2'),_0x85b1('0xce'),'downloadInteraction.ejs'),{'interaction':_0x125262})[_0x85b1('0x18')](function(_0x570aed){var _0x4649cd=path['join'](_0x4e9b4e,_0x85b1('0xcf')+_0x2d728e['id']+'-'+_0x101b7e+_0x85b1('0xd0'));var _0x30d4f6={'path':_0x4649cd,'channel':'Chat','interactionId':_0x2d728e['id']};return pdf[_0x85b1('0xd1')](_0x570aed,_0x30d4f6);})['then'](function(){return new Promise(function(_0x54a95c,_0x5ac411){zipdir(_0x4e9b4e,{'saveTo':_0x5a7675},function(_0x12f64b,_0x193a35){if(_0x12f64b)return _0x5ac411(_0x12f64b);return _0x54a95c(_0x193a35);});})[_0x85b1('0x18')](function(){return new BPromise(function(_0x4148b1,_0xc3fdcd){rimraf(_0x4e9b4e,function(_0x7c2255){if(_0x7c2255)_0xc3fdcd(_0x7c2255);return _0x4148b1();});});})[_0x85b1('0x18')](function(){return _0x3b8246[_0x85b1('0x77')](_0x5a7675,_0x562358,function(_0x350515){if(_0x350515){logger[_0x85b1('0x1f')](_0x85b1('0xd2'),_0x350515);}else{fs['unlinkSync'](_0x5a7675);}});});});}else{return _0x3b8246[_0x85b1('0x22')](0xc8);}})['catch'](handleError(_0x3b8246,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 7dffc10..a9e06dc 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 _0xdfe3=['ChatMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','unreadMessages','emit','catch','exports','../../mysqldb'];(function(_0x40f64d,_0x3f88fa){var _0x53171c=function(_0x5d4ded){while(--_0x5d4ded){_0x40f64d['push'](_0x40f64d['shift']());}};_0x53171c(++_0x3f88fa);}(_0xdfe3,0x67));var _0x3dfe=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xdfe3[_0x1deb03];return _0x189fe7;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x3dfe('0x0'))['db'][_0x3dfe('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3dfe('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3dfe('0x3'),'afterDestroy':_0x3dfe('0x4')};function emitEvent(_0x185da8){return function(_0x4c74a9,_0x806125,_0x1dcdac){_0x4c74a9[_0x3dfe('0x5')]({'attributes':['id'],'raw':!![]})[_0x3dfe('0x6')](function(_0x592770){_0x4c74a9[_0x3dfe('0x7')](_0x3dfe('0x8'),_0x592770['map'](function(_0x40cbcd){return{'id':_0x40cbcd['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4c74a9['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3f7e81){_0x4c74a9[_0x3dfe('0x7')](_0x3dfe('0x9'),_0x3f7e81['length']);ChatInteractionEvents[_0x3dfe('0xa')](_0x185da8+':'+_0x4c74a9['id'],_0x4c74a9);ChatInteractionEvents[_0x3dfe('0xa')](_0x185da8,_0x4c74a9);_0x1dcdac(null);})[_0x3dfe('0xb')](_0x1dcdac(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x3dfe('0xc')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x0f43=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','getUsers','then','setDataValue','map'];(function(_0x111ccc,_0x4f5094){var _0x5bd2a5=function(_0x3a31dd){while(--_0x3a31dd){_0x111ccc['push'](_0x111ccc['shift']());}};_0x5bd2a5(++_0x4f5094);}(_0x0f43,0x184));var _0x30f4=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x0f43[_0x47aa64];return _0x549c7a;};'use strict';var EventEmitter=require(_0x30f4('0x0'));var ChatInteraction=require(_0x30f4('0x1'))['db'][_0x30f4('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x30f4('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x30f4('0x4')](0x0);var events={'afterCreate':_0x30f4('0x5'),'afterUpdate':_0x30f4('0x6'),'afterDestroy':'remove'};function emitEvent(_0x517deb){return function(_0x1bfb22,_0x5a2e05,_0x7a6a7b){_0x1bfb22[_0x30f4('0x7')]({'attributes':['id'],'raw':!![]})[_0x30f4('0x8')](function(_0x1158b3){_0x1bfb22[_0x30f4('0x9')]('Users',_0x1158b3[_0x30f4('0xa')](function(_0x19dd7d){return{'id':_0x19dd7d['id']};}));return ChatMessage[_0x30f4('0xb')]({'where':{'ChatInteractionId':_0x1bfb22['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x23c2f0){_0x1bfb22[_0x30f4('0x9')](_0x30f4('0xc'),_0x23c2f0[_0x30f4('0xd')]);ChatInteractionEvents['emit'](_0x517deb+':'+_0x1bfb22['id'],_0x1bfb22);ChatInteractionEvents[_0x30f4('0xe')](_0x517deb,_0x1bfb22);_0x7a6a7b(null);})[_0x30f4('0xf')](_0x7a6a7b(null));};}for(var e in events){if(events[_0x30f4('0x10')](e)){var event=events[e];ChatInteraction[_0x30f4('0x11')](e,emitEvent(event));}}module[_0x30f4('0x12')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index cc28a19..257e224 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 _0xec6e=['ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatInteraction.attributes','exports','define'];(function(_0x5b19fe,_0x1671fa){var _0x4e2b4d=function(_0x5e2326){while(--_0x5e2326){_0x5b19fe['push'](_0x5b19fe['shift']());}};_0x4e2b4d(++_0x1671fa);}(_0xec6e,0x1aa));var _0xeec6=function(_0x5c883f,_0x38f092){_0x5c883f=_0x5c883f-0x0;var _0x4210cc=_0xec6e[_0x5c883f];return _0x4210cc;};'use strict';var _=require(_0xeec6('0x0'));var util=require(_0xeec6('0x1'));var logger=require(_0xeec6('0x2'))(_0xeec6('0x3'));var moment=require(_0xeec6('0x4'));var BPromise=require(_0xeec6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeec6('0x6'));var rimraf=require(_0xeec6('0x7'));var config=require('../../config/environment');var attributes=require(_0xeec6('0x8'));module[_0xeec6('0x9')]=function(_0x388d29,_0x1674f2){return _0x388d29[_0xeec6('0xa')](_0xeec6('0xb'),attributes,{'tableName':_0xeec6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x19af09,_0x246274,_0x970213){if(_0x19af09[_0xeec6('0xd')](_0xeec6('0xe'))){_0x19af09[_0xeec6('0xf')]=moment()[_0xeec6('0x10')](_0xeec6('0x11'));}_0x970213(null,_0x19af09);}},'charset':'utf8mb4','collate':_0xeec6('0x12')});};
\ No newline at end of file
+var _0x777d=['api','moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x777d,0x140));var _0xd777=function(_0x1c3386,_0x2868c0){_0x1c3386=_0x1c3386-0x0;var _0x2cc8e9=_0x777d[_0x1c3386];return _0x2cc8e9;};'use strict';var _=require(_0xd777('0x0'));var util=require(_0xd777('0x1'));var logger=require(_0xd777('0x2'))(_0xd777('0x3'));var moment=require(_0xd777('0x4'));var BPromise=require('bluebird');var rp=require(_0xd777('0x5'));var fs=require('fs');var path=require(_0xd777('0x6'));var rimraf=require(_0xd777('0x7'));var config=require(_0xd777('0x8'));var attributes=require(_0xd777('0x9'));module['exports']=function(_0x59ff84,_0x2a307b){return _0x59ff84[_0xd777('0xa')](_0xd777('0xb'),attributes,{'tableName':_0xd777('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3ee61c,_0x22f48c,_0x235d96){if(_0x3ee61c['changed']('closed')){_0x3ee61c[_0xd777('0xd')]=moment()[_0xd777('0xe')](_0xd777('0xf'));}_0x235d96(null,_0x3ee61c);}},'charset':_0xd777('0x10'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index f1cbe5a..2d86a02 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 _0xd8bb=['redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','ChatInteraction','find','addTags','ids','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x507b5f,_0xc798c8){var _0x30af9d=function(_0x225f1d){while(--_0x225f1d){_0x507b5f['push'](_0x507b5f['shift']());}};_0x30af9d(++_0xc798c8);}(_0xd8bb,0x1cf));var _0xbd8b=function(_0x577398,_0x3da6d7){_0x577398=_0x577398-0x0;var _0x46da2f=_0xd8bb[_0x577398];return _0x46da2f;};'use strict';var _=require('lodash');var util=require(_0xbd8b('0x0'));var moment=require(_0xbd8b('0x1'));var BPromise=require(_0xbd8b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd8b('0x3'));var db=require(_0xbd8b('0x4'))['db'];var utils=require(_0xbd8b('0x5'));var logger=require(_0xbd8b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbd8b('0x7'));var client=jayson[_0xbd8b('0x8')][_0xbd8b('0x9')]({'port':0x232a});config[_0xbd8b('0xa')]=_[_0xbd8b('0xb')](config['redis'],{'host':_0xbd8b('0xc'),'port':0x18eb});var socket=require(_0xbd8b('0xd'))(new Redis(config['redis']));require(_0xbd8b('0xe'))[_0xbd8b('0xf')](socket);function respondWithRpcPromise(_0x61bf75,_0x35feeb,_0x397ca9){return new BPromise(function(_0xed869a,_0x3a13a4){return client[_0xbd8b('0x10')](_0x61bf75,_0x397ca9)[_0xbd8b('0x11')](function(_0xc2dccc){logger[_0xbd8b('0x12')](_0xbd8b('0x13'),_0x35feeb,'request\x20sent');logger[_0xbd8b('0x14')](_0xbd8b('0x15'),_0x35feeb,_0xbd8b('0x16'),JSON[_0xbd8b('0x17')](_0xc2dccc));if(_0xc2dccc[_0xbd8b('0x18')]){if(_0xc2dccc['error'][_0xbd8b('0x19')]===0x1f4){logger[_0xbd8b('0x18')](_0xbd8b('0x13'),_0x35feeb,_0xc2dccc[_0xbd8b('0x18')][_0xbd8b('0x1a')]);return _0x3a13a4(_0xc2dccc[_0xbd8b('0x18')][_0xbd8b('0x1a')]);}logger[_0xbd8b('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x35feeb,_0xc2dccc[_0xbd8b('0x18')][_0xbd8b('0x1a')]);return _0xed869a(_0xc2dccc[_0xbd8b('0x18')][_0xbd8b('0x1a')]);}else{logger[_0xbd8b('0x12')](_0xbd8b('0x13'),_0x35feeb,'request\x20sent');_0xed869a(_0xc2dccc[_0xbd8b('0x1b')]['message']);}})[_0xbd8b('0x1c')](function(_0x530310){logger[_0xbd8b('0x18')](_0xbd8b('0x13'),_0x35feeb,_0x530310);_0x3a13a4(_0x530310);});});}exports[_0xbd8b('0x1d')]=function(_0x34a4c0){var _0x21ee60=this;return new Promise(function(_0x57b152,_0x174a47){return db['ChatInteraction'][_0xbd8b('0x1e')](_0x34a4c0[_0xbd8b('0x1f')],{'raw':_0x34a4c0[_0xbd8b('0x20')]?_0x34a4c0[_0xbd8b('0x20')][_0xbd8b('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34a4c0[_0xbd8b('0x20')]?_0x34a4c0[_0xbd8b('0x20')][_0xbd8b('0x22')]||null:null,'attributes':_0x34a4c0['options']?_0x34a4c0[_0xbd8b('0x20')][_0xbd8b('0x23')]||null:null,'limit':_0x34a4c0['options']?_0x34a4c0[_0xbd8b('0x20')][_0xbd8b('0x24')]||null:null})[_0xbd8b('0x11')](function(_0x444f97){logger['info'](_0xbd8b('0x1d'),_0x34a4c0);logger[_0xbd8b('0x14')]('UpdateChatInteraction',_0x34a4c0,JSON[_0xbd8b('0x17')](_0x444f97));_0x57b152(_0x444f97);})[_0xbd8b('0x1c')](function(_0x414acc){logger['error'](_0xbd8b('0x1d'),_0x414acc[_0xbd8b('0x1a')],_0x34a4c0);_0x174a47(_0x21ee60[_0xbd8b('0x18')](0x1f4,_0x414acc[_0xbd8b('0x1a')]));});});};exports[_0xbd8b('0x25')]=function(_0x2b0630){return new Promise(function(_0x4e8bdc,_0x686609){return db[_0xbd8b('0x26')][_0xbd8b('0x27')]({'where':_0x2b0630['options']?_0x2b0630[_0xbd8b('0x20')]['where']||null:null})[_0xbd8b('0x11')](function(_0x2b56ba){if(_0x2b56ba){return _0x2b56ba[_0xbd8b('0x28')](_0x2b0630['body'][_0xbd8b('0x29')],_['omit'](_0x2b0630[_0xbd8b('0x1f')],[_0xbd8b('0x29'),'id'])||{});}})['spread'](function(_0x140516){logger[_0xbd8b('0x12')](_0xbd8b('0x2a'),_0x2b0630);logger[_0xbd8b('0x14')](_0xbd8b('0x2a'),_0x2b0630,JSON[_0xbd8b('0x17')](_0x140516));_0x4e8bdc(_0x140516);})[_0xbd8b('0x1c')](function(_0x5c23b9){logger[_0xbd8b('0x18')](_0xbd8b('0x2a'),_0x5c23b9[_0xbd8b('0x1a')],_0x2b0630);_0x686609(_this[_0xbd8b('0x18')](0x1f4,_0x5c23b9[_0xbd8b('0x1a')]));});});};
\ No newline at end of file
+var _0xdbfd=['body','options','limit','AddTagsToChatInteraction','find','where','addTags','omit','ids','AddTags','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update'];(function(_0x1e5cfb,_0x56d0b5){var _0x35a401=function(_0x5b92a9){while(--_0x5b92a9){_0x1e5cfb['push'](_0x1e5cfb['shift']());}};_0x35a401(++_0x56d0b5);}(_0xdbfd,0x129));var _0xddbf=function(_0x259dbb,_0x213269){_0x259dbb=_0x259dbb-0x0;var _0x4a6371=_0xdbfd[_0x259dbb];return _0x4a6371;};'use strict';var _=require(_0xddbf('0x0'));var util=require(_0xddbf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xddbf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddbf('0x3'))['db'];var utils=require(_0xddbf('0x4'));var logger=require(_0xddbf('0x5'))(_0xddbf('0x6'));var config=require(_0xddbf('0x7'));var jayson=require(_0xddbf('0x8'));var client=jayson[_0xddbf('0x9')][_0xddbf('0xa')]({'port':0x232a});config[_0xddbf('0xb')]=_['defaults'](config[_0xddbf('0xb')],{'host':_0xddbf('0xc'),'port':0x18eb});var socket=require(_0xddbf('0xd'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xddbf('0xe')](socket);function respondWithRpcPromise(_0x1993b1,_0x779e9,_0x194c40){return new BPromise(function(_0x270192,_0x895557){return client[_0xddbf('0xf')](_0x1993b1,_0x194c40)[_0xddbf('0x10')](function(_0x8262d6){logger[_0xddbf('0x11')](_0xddbf('0x12'),_0x779e9,'request\x20sent');logger[_0xddbf('0x13')](_0xddbf('0x14'),_0x779e9,_0xddbf('0x15'),JSON[_0xddbf('0x16')](_0x8262d6));if(_0x8262d6[_0xddbf('0x17')]){if(_0x8262d6[_0xddbf('0x17')][_0xddbf('0x18')]===0x1f4){logger[_0xddbf('0x17')](_0xddbf('0x12'),_0x779e9,_0x8262d6[_0xddbf('0x17')][_0xddbf('0x19')]);return _0x895557(_0x8262d6[_0xddbf('0x17')][_0xddbf('0x19')]);}logger[_0xddbf('0x17')](_0xddbf('0x12'),_0x779e9,_0x8262d6[_0xddbf('0x17')]['message']);return _0x270192(_0x8262d6[_0xddbf('0x17')]['message']);}else{logger[_0xddbf('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x779e9,'request\x20sent');_0x270192(_0x8262d6[_0xddbf('0x1a')]['message']);}})[_0xddbf('0x1b')](function(_0xec6f75){logger[_0xddbf('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x779e9,_0xec6f75);_0x895557(_0xec6f75);});});}exports[_0xddbf('0x1c')]=function(_0x2ff072){var _0x398724=this;return new Promise(function(_0x55c3f0,_0x1ecb47){return db[_0xddbf('0x1d')][_0xddbf('0x1e')](_0x2ff072[_0xddbf('0x1f')],{'raw':_0x2ff072[_0xddbf('0x20')]?_0x2ff072[_0xddbf('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ff072[_0xddbf('0x20')]?_0x2ff072[_0xddbf('0x20')]['where']||null:null,'attributes':_0x2ff072[_0xddbf('0x20')]?_0x2ff072[_0xddbf('0x20')]['attributes']||null:null,'limit':_0x2ff072['options']?_0x2ff072[_0xddbf('0x20')][_0xddbf('0x21')]||null:null})['then'](function(_0x5b749a){logger[_0xddbf('0x11')]('UpdateChatInteraction',_0x2ff072);logger['debug'](_0xddbf('0x1c'),_0x2ff072,JSON[_0xddbf('0x16')](_0x5b749a));_0x55c3f0(_0x5b749a);})['catch'](function(_0x428808){logger[_0xddbf('0x17')](_0xddbf('0x1c'),_0x428808['message'],_0x2ff072);_0x1ecb47(_0x398724['error'](0x1f4,_0x428808[_0xddbf('0x19')]));});});};exports[_0xddbf('0x22')]=function(_0x5f55d3){return new Promise(function(_0x411260,_0x32e4a1){return db[_0xddbf('0x1d')][_0xddbf('0x23')]({'where':_0x5f55d3[_0xddbf('0x20')]?_0x5f55d3['options'][_0xddbf('0x24')]||null:null})[_0xddbf('0x10')](function(_0x174d12){if(_0x174d12){return _0x174d12[_0xddbf('0x25')](_0x5f55d3[_0xddbf('0x1f')]['ids'],_[_0xddbf('0x26')](_0x5f55d3[_0xddbf('0x1f')],[_0xddbf('0x27'),'id'])||{});}})['spread'](function(_0x2ca59d){logger['info']('AddTags',_0x5f55d3);logger[_0xddbf('0x13')]('AddTags',_0x5f55d3,JSON[_0xddbf('0x16')](_0x2ca59d));_0x411260(_0x2ca59d);})['catch'](function(_0x5cde59){logger['error'](_0xddbf('0x28'),_0x5cde59[_0xddbf('0x19')],_0x5f55d3);_0x32e4a1(_this[_0xddbf('0x17')](0x1f4,_0x5cde59[_0xddbf('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 5c88167..216a524 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 _0xf0e5=['remove','update','emit','removeListener','register','length','chatInteraction:'];(function(_0x5d36d9,_0x1b7e5e){var _0xb4ed5f=function(_0x50152a){while(--_0x50152a){_0x5d36d9['push'](_0x5d36d9['shift']());}};_0xb4ed5f(++_0x1b7e5e);}(_0xf0e5,0x1e3));var _0x5f0e=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xf0e5[_0x263a74];return _0x2aa86c;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x5f0e('0x0'),_0x5f0e('0x1')];function createListener(_0xb1c2b4,_0x29e869){return function(_0x53f8b8){_0x29e869[_0x5f0e('0x2')](_0xb1c2b4,_0x53f8b8);};}function removeListener(_0x2881e9,_0x7d51ee){return function(){ChatInteractionEvents[_0x5f0e('0x3')](_0x2881e9,_0x7d51ee);};}exports[_0x5f0e('0x4')]=function(_0x24b01d){for(var _0x23ef12=0x0,_0x3aa22b=events[_0x5f0e('0x5')];_0x23ef12<_0x3aa22b;_0x23ef12++){var _0x3c8679=events[_0x23ef12];var _0x305854=createListener(_0x5f0e('0x6')+_0x3c8679,_0x24b01d);ChatInteractionEvents['on'](_0x3c8679,_0x305854);}};
\ No newline at end of file
+var _0x1dc2=['./chatInteraction.events','save','remove','update','emit','removeListener','register','chatInteraction:'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1dc2,0xb0));var _0x21dc=function(_0x459bea,_0x188d0a){_0x459bea=_0x459bea-0x0;var _0x43fe4d=_0x1dc2[_0x459bea];return _0x43fe4d;};'use strict';var ChatInteractionEvents=require(_0x21dc('0x0'));var events=[_0x21dc('0x1'),_0x21dc('0x2'),_0x21dc('0x3')];function createListener(_0x59b0a1,_0x12b92b){return function(_0x4c8d90){_0x12b92b[_0x21dc('0x4')](_0x59b0a1,_0x4c8d90);};}function removeListener(_0x328896,_0x2353e6){return function(){ChatInteractionEvents[_0x21dc('0x5')](_0x328896,_0x2353e6);};}exports[_0x21dc('0x6')]=function(_0x1de21c){for(var _0x250848=0x0,_0xb19e15=events['length'];_0x250848<_0xb19e15;_0x250848++){var _0x8d620c=events[_0x250848];var _0x2bb9d3=createListener(_0x21dc('0x7')+_0x8d620c,_0x1de21c);ChatInteractionEvents['on'](_0x8d620c,_0x2bb9d3);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 2675d11..bf8542f 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 _0xcc0d=['/:id/messages','getMessages','/:id/download','post','/:id/vidaoo','root','format','originalname','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','/:id','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','attachmentDownload'];(function(_0x30df8d,_0x40b784){var _0x458428=function(_0x5ef49d){while(--_0x5ef49d){_0x30df8d['push'](_0x30df8d['shift']());}};_0x458428(++_0x40b784);}(_0xcc0d,0x187));var _0xdcc0=function(_0x585761,_0x276e8e){_0x585761=_0x585761-0x0;var _0x14a673=_0xcc0d[_0x585761];return _0x14a673;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdcc0('0x0'));var timeout=require(_0xdcc0('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdcc0('0x2'));var auth=require(_0xdcc0('0x3'));var interaction=require(_0xdcc0('0x4'));var config=require(_0xdcc0('0x5'));var controller=require(_0xdcc0('0x6'));router[_0xdcc0('0x7')]('/',auth[_0xdcc0('0x8')](),controller[_0xdcc0('0x9')]);router['get'](_0xdcc0('0xa'),auth[_0xdcc0('0x8')](),controller[_0xdcc0('0xb')]);router[_0xdcc0('0x7')]('/:id',auth[_0xdcc0('0xc')](),controller['show']);router[_0xdcc0('0x7')]('/:id/attachment_download',auth[_0xdcc0('0xc')](),controller[_0xdcc0('0xd')]);router[_0xdcc0('0x7')](_0xdcc0('0xe'),auth[_0xdcc0('0x8')](),controller[_0xdcc0('0xf')]);router[_0xdcc0('0x7')]('/:id/my_messages',auth[_0xdcc0('0xc')](),controller['getMyMessages']);router[_0xdcc0('0x7')](_0xdcc0('0x10'),auth['isAuthenticated'](),controller['download']);router[_0xdcc0('0x11')]('/',auth[_0xdcc0('0x8')](),controller['create']);router['post'](_0xdcc0('0x12'),auth[_0xdcc0('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x406269,_0x19b1bf,_0x1f1946){_0x1f1946(null,path['join'](config[_0xdcc0('0x13')],'server/files/attachments/'));},'filename':function(_0x1473c0,_0x55fadc,_0x2179ab){_0x2179ab(null,util[_0xdcc0('0x14')]('%s-%s',Date['now'](),_0x55fadc[_0xdcc0('0x15')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xdcc0('0x16'),upload[_0xdcc0('0x17')]('file'),controller[_0xdcc0('0x18')]);router[_0xdcc0('0x11')](_0xdcc0('0xe'),auth[_0xdcc0('0xc')](),controller[_0xdcc0('0x19')]);router[_0xdcc0('0x11')](_0xdcc0('0x1a'),auth[_0xdcc0('0x8')](),interaction['tracked'](_0xdcc0('0x1b'),_0xdcc0('0x1c')),controller[_0xdcc0('0x1d')]);router[_0xdcc0('0x1e')](_0xdcc0('0x1f'),auth[_0xdcc0('0x8')](),interaction[_0xdcc0('0x20')]('chat',_0xdcc0('0x21')),controller[_0xdcc0('0x22')]);router[_0xdcc0('0x1e')](_0xdcc0('0x23'),controller[_0xdcc0('0x24')]);router[_0xdcc0('0x1e')](_0xdcc0('0x25'),auth['isChatInteractionAuthorized'](),controller[_0xdcc0('0x26')]);router[_0xdcc0('0x1e')](_0xdcc0('0x27'),controller[_0xdcc0('0x28')]);router['delete']('/:id',auth[_0xdcc0('0x8')](),interaction[_0xdcc0('0x20')]('chat',_0xdcc0('0x29')),controller[_0xdcc0('0x2a')]);router['delete']('/:id/tags',auth[_0xdcc0('0x8')](),controller[_0xdcc0('0x2b')]);module[_0xdcc0('0x2c')]=router;
\ No newline at end of file
+var _0x0dfb=['chat','chatinteraction:addtags','chatinteraction:update','customUpdate','/:id/abandon','abandon','put','/:id/close','close','delete','/:id','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked'];(function(_0x5c0a22,_0x3e0eb3){var _0x292d8e=function(_0x28c9e6){while(--_0x28c9e6){_0x5c0a22['push'](_0x5c0a22['shift']());}};_0x292d8e(++_0x3e0eb3);}(_0x0dfb,0xfe));var _0xb0df=function(_0x5df9bf,_0x163e5e){_0x5df9bf=_0x5df9bf-0x0;var _0x4a7c89=_0x0dfb[_0x5df9bf];return _0x4a7c89;};'use strict';var multer=require(_0xb0df('0x0'));var util=require(_0xb0df('0x1'));var path=require(_0xb0df('0x2'));var timeout=require(_0xb0df('0x3'));var express=require(_0xb0df('0x4'));var router=express[_0xb0df('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb0df('0x6'));var config=require('../../config/environment');var controller=require(_0xb0df('0x7'));router[_0xb0df('0x8')]('/',auth[_0xb0df('0x9')](),controller[_0xb0df('0xa')]);router[_0xb0df('0x8')]('/describe',auth[_0xb0df('0x9')](),controller['describe']);router['get']('/:id',auth[_0xb0df('0xb')](),controller['show']);router[_0xb0df('0x8')](_0xb0df('0xc'),auth[_0xb0df('0xb')](),controller['attachmentDownload']);router[_0xb0df('0x8')](_0xb0df('0xd'),auth[_0xb0df('0x9')](),controller[_0xb0df('0xe')]);router['get'](_0xb0df('0xf'),auth[_0xb0df('0xb')](),controller[_0xb0df('0x10')]);router[_0xb0df('0x8')](_0xb0df('0x11'),auth[_0xb0df('0x9')](),controller[_0xb0df('0x12')]);router['post']('/',auth[_0xb0df('0x9')](),controller['create']);router[_0xb0df('0x13')](_0xb0df('0x14'),auth[_0xb0df('0x9')](),controller[_0xb0df('0x15')]);var upload=multer({'storage':multer[_0xb0df('0x16')]({'destination':function(_0x4cf29a,_0x2df449,_0x48a67c){_0x48a67c(null,path[_0xb0df('0x17')](config[_0xb0df('0x18')],'server/files/attachments/'));},'filename':function(_0xcd8330,_0x3ef1c5,_0x5b432a){_0x5b432a(null,util[_0xb0df('0x19')]('%s-%s',Date['now'](),_0x3ef1c5['originalname'][_0xb0df('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb0df('0x13')](_0xb0df('0x1b'),upload[_0xb0df('0x1c')](_0xb0df('0x1d')),controller[_0xb0df('0x1e')]);router['post'](_0xb0df('0xd'),auth[_0xb0df('0xb')](),controller[_0xb0df('0x1f')]);router[_0xb0df('0x13')](_0xb0df('0x20'),auth[_0xb0df('0x9')](),interaction[_0xb0df('0x21')](_0xb0df('0x22'),_0xb0df('0x23')),controller['addTags']);router['put']('/:id',auth['isAuthenticated'](),interaction[_0xb0df('0x21')]('chat',_0xb0df('0x24')),controller['update']);router['put']('/:id/custom_update',controller[_0xb0df('0x25')]);router['put'](_0xb0df('0x26'),auth[_0xb0df('0xb')](),controller[_0xb0df('0x27')]);router[_0xb0df('0x28')](_0xb0df('0x29'),controller[_0xb0df('0x2a')]);router[_0xb0df('0x2b')](_0xb0df('0x2c'),auth[_0xb0df('0x9')](),interaction[_0xb0df('0x21')](_0xb0df('0x22'),_0xb0df('0x2d')),controller[_0xb0df('0x2e')]);router[_0xb0df('0x2b')](_0xb0df('0x20'),auth[_0xb0df('0x9')](),controller[_0xb0df('0x2f')]);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 58ea7aa..7af8825 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 _0xb7ee=['sequelize','exports','TEXT','BOOLEAN','INTEGER'];(function(_0x5b5c87,_0x101049){var _0x26605d=function(_0x6f0e0e){while(--_0x6f0e0e){_0x5b5c87['push'](_0x5b5c87['shift']());}};_0x26605d(++_0x101049);}(_0xb7ee,0xff));var _0xeb7e=function(_0x12dfa1,_0x36ff32){_0x12dfa1=_0x12dfa1-0x0;var _0x5db581=_0xb7ee[_0x12dfa1];return _0x5db581;};'use strict';var Sequelize=require(_0xeb7e('0x0'));module[_0xeb7e('0x1')]={'body':{'type':Sequelize[_0xeb7e('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xeb7e('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xeb7e('0x4')]}};
\ No newline at end of file
+var _0x2795=['exports','TEXT','medium','sequelize'];(function(_0x44f1ce,_0x243e88){var _0x207173=function(_0x218db1){while(--_0x218db1){_0x44f1ce['push'](_0x44f1ce['shift']());}};_0x207173(++_0x243e88);}(_0x2795,0x123));var _0x5279=function(_0x46e607,_0x590b96){_0x46e607=_0x46e607-0x0;var _0x59602d=_0x2795[_0x46e607];return _0x59602d;};'use strict';var Sequelize=require(_0x5279('0x0'));module[_0x5279('0x1')]={'body':{'type':Sequelize[_0x5279('0x2')](_0x5279('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 0fbd080..dcc709b 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 _0x4749=['map','VIRTUAL','options','includeAll','findAll','catch','keys','rawAttributes','include','find','create','body','params','destroy','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','admin','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','agent','FromId','-createdAt','all','eml-format','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','error','stack','name','send','ChatInternalMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge'];(function(_0xea23f8,_0x2b76d2){var _0x437658=function(_0x22af97){while(--_0x22af97){_0xea23f8['push'](_0xea23f8['shift']());}};_0x437658(++_0x2b76d2);}(_0x4749,0x1da));var _0x9474=function(_0x258717,_0x3060cc){_0x258717=_0x258717-0x0;var _0x15a6ae=_0x4749[_0x258717];return _0x15a6ae;};'use strict';var emlformat=require(_0x9474('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9474('0x1'));var moment=require('moment');var BPromise=require(_0x9474('0x2'));var Mustache=require(_0x9474('0x3'));var util=require('util');var path=require(_0x9474('0x4'));var sox=require(_0x9474('0x5'));var csv=require(_0x9474('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9474('0x7'));var squel=require(_0x9474('0x8'));var crypto=require('crypto');var jsforce=require(_0x9474('0x9'));var deskjs=require(_0x9474('0xa'));var toCsv=require(_0x9474('0x6'));var querystring=require(_0x9474('0xb'));var Papa=require(_0x9474('0xc'));var Redis=require(_0x9474('0xd'));var authService=require(_0x9474('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x9474('0xf'));var hardwareService=require(_0x9474('0x10'));var logger=require(_0x9474('0x11'))(_0x9474('0x12'));var utils=require(_0x9474('0x13'));var config=require(_0x9474('0x14'));var licenseUtil=require(_0x9474('0x15'));var db=require(_0x9474('0x16'))['db'];config[_0x9474('0x17')]=_['defaults'](config[_0x9474('0x17')],{'host':_0x9474('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9474('0x17')]));require(_0x9474('0x19'))[_0x9474('0x1a')](socket);function respondWithStatusCode(_0x2d0d02,_0x4a95ab){_0x4a95ab=_0x4a95ab||0xcc;return function(_0x149065){if(_0x149065){return _0x2d0d02[_0x9474('0x1b')](_0x4a95ab);}return _0x2d0d02[_0x9474('0x1c')](_0x4a95ab)[_0x9474('0x1d')]();};}function respondWithResult(_0x36eac5,_0x544d2d){_0x544d2d=_0x544d2d||0xc8;return function(_0x5bd2f5){if(_0x5bd2f5){return _0x36eac5[_0x9474('0x1c')](_0x544d2d)['json'](_0x5bd2f5);}};}function respondWithFilteredResult(_0x538aaf,_0x55e1b2){return function(_0x19691b){if(_0x19691b){var _0xae8d68=typeof _0x55e1b2[_0x9474('0x1e')]===_0x9474('0x1f')&&typeof _0x55e1b2['limit']===_0x9474('0x1f');var _0x126321=_0x19691b[_0x9474('0x20')];var _0x8c1668=_0xae8d68?0x0:_0x55e1b2['offset'];var _0x34f4c7=_0xae8d68?_0x19691b[_0x9474('0x20')]:_0x55e1b2[_0x9474('0x1e')]+_0x55e1b2[_0x9474('0x21')];var _0x49aa21;if(_0x34f4c7>=_0x126321){_0x34f4c7=_0x126321;_0x49aa21=0xc8;}else{_0x49aa21=0xce;}_0x538aaf[_0x9474('0x1c')](_0x49aa21);return _0x538aaf[_0x9474('0x22')](_0x9474('0x23'),_0x8c1668+'-'+_0x34f4c7+'/'+_0x126321)[_0x9474('0x24')](_0x19691b);}return null;};}function patchUpdates(_0x5cc757){return function(_0x3f2de7){try{jsonpatch['apply'](_0x3f2de7,_0x5cc757,!![]);}catch(_0x1a0377){return BPromise[_0x9474('0x25')](_0x1a0377);}return _0x3f2de7[_0x9474('0x26')]();};}function saveUpdates(_0x1fce66,_0x4b1f12){return function(_0x4f0830){if(_0x4f0830){return _0x4f0830[_0x9474('0x27')](_0x1fce66)[_0x9474('0x28')](function(_0x2f95fd){return _0x2f95fd;});}return null;};}function removeEntity(_0x37dd31,_0x57d0d6){return function(_0x2a967a){if(_0x2a967a){return _0x2a967a['destroy']()['then'](function(){_0x37dd31[_0x9474('0x1c')](0xcc)[_0x9474('0x1d')]();});}};}function handleEntityNotFound(_0x3f10f3,_0x4c1a29){return function(_0x59da74){if(!_0x59da74){_0x3f10f3[_0x9474('0x1b')](0x194);}return _0x59da74;};}function handleError(_0x9f0047,_0x5bb564){_0x5bb564=_0x5bb564||0x1f4;return function(_0x1f50f5){logger[_0x9474('0x29')](_0x1f50f5[_0x9474('0x2a')]);if(_0x1f50f5[_0x9474('0x2b')]){delete _0x1f50f5[_0x9474('0x2b')];}_0x9f0047[_0x9474('0x1c')](_0x5bb564)[_0x9474('0x2c')](_0x1f50f5);};}exports['index']=function(_0x40b5b6,_0x21b347){var _0x4dfd8c={},_0x101f86={},_0x42a3b1={'count':0x0,'rows':[]};var _0x3f65e4=_['map'](db[_0x9474('0x2d')]['rawAttributes'],function(_0x5cf875){return{'name':_0x5cf875[_0x9474('0x2e')],'type':_0x5cf875[_0x9474('0x2f')][_0x9474('0x30')]};});_0x101f86[_0x9474('0x31')]=_['map'](_0x3f65e4,_0x9474('0x2b'));_0x101f86[_0x9474('0x32')]=_['keys'](_0x40b5b6['query']);_0x101f86[_0x9474('0x33')]=_[_0x9474('0x34')](_0x101f86[_0x9474('0x31')],_0x101f86['query']);_0x4dfd8c[_0x9474('0x35')]=_['intersection'](_0x101f86['model'],qs[_0x9474('0x36')](_0x40b5b6[_0x9474('0x32')]['fields']));_0x4dfd8c[_0x9474('0x35')]=_0x4dfd8c[_0x9474('0x35')][_0x9474('0x37')]?_0x4dfd8c[_0x9474('0x35')]:_0x101f86[_0x9474('0x31')];if(!_0x40b5b6[_0x9474('0x32')]['hasOwnProperty'](_0x9474('0x38'))){_0x4dfd8c[_0x9474('0x21')]=qs[_0x9474('0x21')](_0x40b5b6[_0x9474('0x32')]['limit']);_0x4dfd8c[_0x9474('0x1e')]=qs['offset'](_0x40b5b6[_0x9474('0x32')][_0x9474('0x1e')]);}_0x4dfd8c['order']=qs[_0x9474('0x39')](_0x40b5b6['query'][_0x9474('0x39')]);_0x4dfd8c[_0x9474('0x3a')]=qs['filters'](_['pick'](_0x40b5b6[_0x9474('0x32')],_0x101f86[_0x9474('0x33')]),_0x3f65e4);if(_0x40b5b6[_0x9474('0x32')][_0x9474('0x3b')]){_0x4dfd8c[_0x9474('0x3a')]=_[_0x9474('0x3c')](_0x4dfd8c[_0x9474('0x3a')],{'$or':_[_0x9474('0x3d')](_0x3f65e4,function(_0xa49c5){if(_0xa49c5[_0x9474('0x2f')]!==_0x9474('0x3e')){var _0x410d33={};_0x410d33[_0xa49c5[_0x9474('0x2b')]]={'$like':'%'+_0x40b5b6[_0x9474('0x32')]['filter']+'%'};return _0x410d33;}})});}_0x4dfd8c=_[_0x9474('0x3c')]({},_0x4dfd8c,_0x40b5b6[_0x9474('0x3f')]);var _0x455035={'where':_0x4dfd8c[_0x9474('0x3a')]};return db[_0x9474('0x2d')][_0x9474('0x20')](_0x455035)[_0x9474('0x28')](function(_0x47f198){_0x42a3b1[_0x9474('0x20')]=_0x47f198;if(_0x40b5b6[_0x9474('0x32')][_0x9474('0x40')]){_0x4dfd8c['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x9474('0x41')](_0x4dfd8c);})[_0x9474('0x28')](function(_0x1daa8c){_0x42a3b1['rows']=_0x1daa8c;return _0x42a3b1;})[_0x9474('0x28')](respondWithFilteredResult(_0x21b347,_0x4dfd8c))[_0x9474('0x42')](handleError(_0x21b347,null));};exports['show']=function(_0x54c1ad,_0x4892b6){var _0x2542c5={'raw':!![],'where':{'id':_0x54c1ad['params']['id']}},_0x479e4f={};_0x479e4f[_0x9474('0x31')]=_[_0x9474('0x43')](db['ChatInternalMessage'][_0x9474('0x44')]);_0x479e4f[_0x9474('0x32')]=_['keys'](_0x54c1ad[_0x9474('0x32')]);_0x479e4f['filters']=_['intersection'](_0x479e4f[_0x9474('0x31')],_0x479e4f[_0x9474('0x32')]);_0x2542c5[_0x9474('0x35')]=_['intersection'](_0x479e4f[_0x9474('0x31')],qs[_0x9474('0x36')](_0x54c1ad[_0x9474('0x32')][_0x9474('0x36')]));_0x2542c5['attributes']=_0x2542c5[_0x9474('0x35')][_0x9474('0x37')]?_0x2542c5[_0x9474('0x35')]:_0x479e4f['model'];if(_0x54c1ad[_0x9474('0x32')][_0x9474('0x40')]){_0x2542c5[_0x9474('0x45')]=[{'all':!![]}];}_0x2542c5=_['merge']({},_0x2542c5,_0x54c1ad['options']);return db[_0x9474('0x2d')][_0x9474('0x46')](_0x2542c5)[_0x9474('0x28')](handleEntityNotFound(_0x4892b6,null))['then'](respondWithResult(_0x4892b6,null))[_0x9474('0x42')](handleError(_0x4892b6,null));};exports['create']=function(_0xb7037d,_0x13d683){return db[_0x9474('0x2d')][_0x9474('0x47')](_0xb7037d[_0x9474('0x48')],{})['then'](respondWithResult(_0x13d683,0xc9))[_0x9474('0x42')](handleError(_0x13d683,null));};exports[_0x9474('0x27')]=function(_0xd515ca,_0x40f4e4){if(_0xd515ca[_0x9474('0x48')]['id']){delete _0xd515ca[_0x9474('0x48')]['id'];}return db[_0x9474('0x2d')][_0x9474('0x46')]({'where':{'id':_0xd515ca[_0x9474('0x49')]['id']}})[_0x9474('0x28')](handleEntityNotFound(_0x40f4e4,null))[_0x9474('0x28')](saveUpdates(_0xd515ca['body'],null))[_0x9474('0x28')](respondWithResult(_0x40f4e4,null))[_0x9474('0x42')](handleError(_0x40f4e4,null));};exports[_0x9474('0x4a')]=function(_0x22cfaa,_0x5a1685){return db[_0x9474('0x2d')][_0x9474('0x46')]({'where':{'id':_0x22cfaa[_0x9474('0x49')]['id']}})[_0x9474('0x28')](handleEntityNotFound(_0x5a1685,null))['then'](removeEntity(_0x5a1685,null))['catch'](handleError(_0x5a1685,null));};exports['describe']=function(_0x314719,_0x34949a){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0x34949a,null))[_0x9474('0x42')](handleError(_0x34949a,null));};function wrapUser(_0x2a2fb5){return function(_0x172443){var _0x2a1c95=_0x2a2fb5[_0x9474('0x4b')]({'plain':!![]});_0x2a1c95[_0x9474('0x4c')]=[];if(_0x172443){_0x2a1c95[_0x9474('0x4d')]=_0x172443[_0x9474('0x4e')];_0x2a1c95[_0x9474('0x4f')]=_0x172443;}else{_0x2a1c95['lastMessageAt']=moment(0x0)[_0x9474('0x50')](_0x9474('0x51'));_0x2a1c95['lastMessage']={};}return _0x2a1c95;};}exports[_0x9474('0x52')]=function(_0x17a29d,_0x69c4bd,_0x51754c){var _0x1f691c=[];return db['User'][_0x9474('0x41')]({'where':{'role':['agent',_0x9474('0x53'),'user']},'attributes':['id','fullname','name',_0x9474('0x54'),_0x9474('0x55'),_0x9474('0x56'),_0x9474('0x57'),_0x9474('0x58'),_0x9474('0x59'),_0x9474('0x5a')],'order':qs[_0x9474('0x39')](_0x9474('0x5b')),'include':[{'model':db[_0x9474('0x5c')],'as':_0x9474('0x5d'),'attributes':['id',_0x9474('0x2b'),_0x9474('0x2f')],'through':{'attributes':[]}}]})['then'](function(_0x1fb122){if(_0x1fb122){var _0x115d92=_0x17a29d[_0x9474('0x5e')][_0x9474('0x4b')]({'plain':!![]});if(!_0x115d92)throw new Error(_0x9474('0x5f'));if(_0x115d92[_0x9474('0x54')]===_0x9474('0x5e')){return db[_0x9474('0x60')][_0x9474('0x46')]({'where':{'name':_0x9474('0x61'),'userProfileId':_0x115d92['userProfileId']},'raw':!![]})[_0x9474('0x28')](function(_0x70afc1){if(_0x70afc1){if(_0x70afc1[_0x9474('0x62')]===0x0){return db[_0x9474('0x63')]['findAll']({'where':{'sectionId':_0x70afc1['id']},'raw':!![]})[_0x9474('0x28')](function(_0xff9fde){var _0x5a7da7=[];if(_[_0x9474('0x64')](_0xff9fde)){_0x5a7da7=_[_0x9474('0x3b')](_0x1fb122,function(_0x61761f){if(_0x61761f[_0x9474('0x54')]!=='agent'){return _0x61761f;}});return _0x5a7da7;}else{for(var _0x386ccd=0x0;_0x386ccd<_0x1fb122['length'];_0x386ccd++){var _0xcc1b5=_0x1fb122[_0x386ccd];if(_0xcc1b5[_0x9474('0x54')]==='agent'){var _0xd99753=_[_0x9474('0x46')](_0xff9fde,function(_0x1d148a){return _0x1d148a[_0x9474('0x65')]===_0xcc1b5['id'];});if(_0xd99753)_0x5a7da7['push'](_0xcc1b5);}else{_0x5a7da7[_0x9474('0x66')](_0xcc1b5);}}return _0x5a7da7;}});}else{return _0x1fb122;}}else{var _0x182806=_[_0x9474('0x3b')](_0x1fb122,function(_0x41b66d){if(_0x41b66d[_0x9474('0x54')]!==_0x9474('0x67')){return _0x41b66d;}});return _0x182806;}});}else{return _0x1fb122;}}})[_0x9474('0x28')](function(_0x2c2f38){var _0x225a3a=[];if(_0x2c2f38){_0x1f691c=_0x2c2f38;for(var _0x519e49=0x0;_0x519e49<_0x2c2f38[_0x9474('0x37')];_0x519e49+=0x1){_0x1f691c[_0x519e49][_0x9474('0x4c')]=[];_0x225a3a[_0x9474('0x66')](db[_0x9474('0x2d')][_0x9474('0x46')]({'where':{'FromId':[_0x17a29d[_0x9474('0x5e')]['id'],_0x2c2f38[_0x519e49]['id']],'ToId':[_0x17a29d[_0x9474('0x5e')]['id'],_0x2c2f38[_0x519e49]['id']],'ChatGroupId':null},'attributes':['id',_0x9474('0x4e'),_0x9474('0x68'),'ToId','read','body'],'order':qs[_0x9474('0x39')](_0x9474('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9474('0x28')](wrapUser(_0x2c2f38[_0x519e49])));}return BPromise[_0x9474('0x6a')](_0x225a3a);}return[];})[_0x9474('0x28')](function(_0x7d6234){return{'rows':_0x7d6234,'count':_0x7d6234[_0x9474('0x37')]};})[_0x9474('0x28')](respondWithResult(_0x69c4bd,null))[_0x9474('0x42')](handleError(_0x69c4bd,null));};
\ No newline at end of file
+var _0x8f84=['undefined','count','limit','Content-Range','save','destroy','then','error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','update','body','describe','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','FromId','-createdAt','all','eml-format','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0x8f84,0x18e));var _0x48f8=function(_0x5da74e,_0xf1ba94){_0x5da74e=_0x5da74e-0x0;var _0x3b0d93=_0x8f84[_0x5da74e];return _0x3b0d93;};'use strict';var emlformat=require(_0x48f8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x48f8('0x1'));var rp=require('request-promise');var moment=require(_0x48f8('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x48f8('0x3'));var util=require('util');var path=require(_0x48f8('0x4'));var sox=require(_0x48f8('0x5'));var csv=require(_0x48f8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x48f8('0x7'));var _=require(_0x48f8('0x8'));var squel=require(_0x48f8('0x9'));var crypto=require(_0x48f8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x48f8('0xb'));var toCsv=require(_0x48f8('0x6'));var querystring=require(_0x48f8('0xc'));var Papa=require(_0x48f8('0xd'));var Redis=require(_0x48f8('0xe'));var authService=require(_0x48f8('0xf'));var qs=require(_0x48f8('0x10'));var as=require(_0x48f8('0x11'));var hardwareService=require(_0x48f8('0x12'));var logger=require('../../config/logger')(_0x48f8('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x48f8('0x14'))['db'];config[_0x48f8('0x15')]=_[_0x48f8('0x16')](config['redis'],{'host':_0x48f8('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x48f8('0x15')]));require('./chatInternalMessage.socket')[_0x48f8('0x18')](socket);function respondWithStatusCode(_0x29094e,_0x1f9cd7){_0x1f9cd7=_0x1f9cd7||0xcc;return function(_0x10904b){if(_0x10904b){return _0x29094e[_0x48f8('0x19')](_0x1f9cd7);}return _0x29094e[_0x48f8('0x1a')](_0x1f9cd7)[_0x48f8('0x1b')]();};}function respondWithResult(_0xab1ca,_0x1928f0){_0x1928f0=_0x1928f0||0xc8;return function(_0x321400){if(_0x321400){return _0xab1ca[_0x48f8('0x1a')](_0x1928f0)[_0x48f8('0x1c')](_0x321400);}};}function respondWithFilteredResult(_0x3e4659,_0x44112a){return function(_0x4a29df){if(_0x4a29df){var _0xd340d7=typeof _0x44112a[_0x48f8('0x1d')]===_0x48f8('0x1e')&&typeof _0x44112a['limit']===_0x48f8('0x1e');var _0x56b1e1=_0x4a29df[_0x48f8('0x1f')];var _0x5f1d0b=_0xd340d7?0x0:_0x44112a['offset'];var _0x5dc59d=_0xd340d7?_0x4a29df[_0x48f8('0x1f')]:_0x44112a[_0x48f8('0x1d')]+_0x44112a[_0x48f8('0x20')];var _0x101031;if(_0x5dc59d>=_0x56b1e1){_0x5dc59d=_0x56b1e1;_0x101031=0xc8;}else{_0x101031=0xce;}_0x3e4659['status'](_0x101031);return _0x3e4659['set'](_0x48f8('0x21'),_0x5f1d0b+'-'+_0x5dc59d+'/'+_0x56b1e1)['json'](_0x4a29df);}return null;};}function patchUpdates(_0x35e7ed){return function(_0x503ee0){try{jsonpatch['apply'](_0x503ee0,_0x35e7ed,!![]);}catch(_0x2d37c5){return BPromise['reject'](_0x2d37c5);}return _0x503ee0[_0x48f8('0x22')]();};}function saveUpdates(_0x3f5f0e,_0x155313){return function(_0x46a159){if(_0x46a159){return _0x46a159['update'](_0x3f5f0e)['then'](function(_0x271b88){return _0x271b88;});}return null;};}function removeEntity(_0x4156d2,_0x372498){return function(_0x4a4c2b){if(_0x4a4c2b){return _0x4a4c2b[_0x48f8('0x23')]()[_0x48f8('0x24')](function(){_0x4156d2[_0x48f8('0x1a')](0xcc)[_0x48f8('0x1b')]();});}};}function handleEntityNotFound(_0x53f120,_0x455d66){return function(_0x4b9326){if(!_0x4b9326){_0x53f120[_0x48f8('0x19')](0x194);}return _0x4b9326;};}function handleError(_0x2bf134,_0x230f4b){_0x230f4b=_0x230f4b||0x1f4;return function(_0x421d44){logger[_0x48f8('0x25')](_0x421d44[_0x48f8('0x26')]);if(_0x421d44[_0x48f8('0x27')]){delete _0x421d44[_0x48f8('0x27')];}_0x2bf134['status'](_0x230f4b)[_0x48f8('0x28')](_0x421d44);};}exports[_0x48f8('0x29')]=function(_0x5c6b42,_0x372a2b){var _0x26e5c2={},_0x2a9c1e={},_0x1601ca={'count':0x0,'rows':[]};var _0x50a4c0=_['map'](db[_0x48f8('0x2a')][_0x48f8('0x2b')],function(_0x2e009c){return{'name':_0x2e009c[_0x48f8('0x2c')],'type':_0x2e009c[_0x48f8('0x2d')][_0x48f8('0x2e')]};});_0x2a9c1e[_0x48f8('0x2f')]=_['map'](_0x50a4c0,_0x48f8('0x27'));_0x2a9c1e[_0x48f8('0x30')]=_[_0x48f8('0x31')](_0x5c6b42[_0x48f8('0x30')]);_0x2a9c1e['filters']=_[_0x48f8('0x32')](_0x2a9c1e[_0x48f8('0x2f')],_0x2a9c1e[_0x48f8('0x30')]);_0x26e5c2[_0x48f8('0x33')]=_['intersection'](_0x2a9c1e['model'],qs['fields'](_0x5c6b42[_0x48f8('0x30')][_0x48f8('0x34')]));_0x26e5c2[_0x48f8('0x33')]=_0x26e5c2[_0x48f8('0x33')][_0x48f8('0x35')]?_0x26e5c2['attributes']:_0x2a9c1e[_0x48f8('0x2f')];if(!_0x5c6b42[_0x48f8('0x30')][_0x48f8('0x36')]('nolimit')){_0x26e5c2[_0x48f8('0x20')]=qs['limit'](_0x5c6b42[_0x48f8('0x30')][_0x48f8('0x20')]);_0x26e5c2['offset']=qs[_0x48f8('0x1d')](_0x5c6b42[_0x48f8('0x30')]['offset']);}_0x26e5c2[_0x48f8('0x37')]=qs[_0x48f8('0x38')](_0x5c6b42['query']['sort']);_0x26e5c2[_0x48f8('0x39')]=qs[_0x48f8('0x3a')](_[_0x48f8('0x3b')](_0x5c6b42[_0x48f8('0x30')],_0x2a9c1e[_0x48f8('0x3a')]),_0x50a4c0);if(_0x5c6b42[_0x48f8('0x30')][_0x48f8('0x3c')]){_0x26e5c2[_0x48f8('0x39')]=_[_0x48f8('0x3d')](_0x26e5c2[_0x48f8('0x39')],{'$or':_[_0x48f8('0x3e')](_0x50a4c0,function(_0x49189c){if(_0x49189c[_0x48f8('0x2d')]!==_0x48f8('0x3f')){var _0x38b335={};_0x38b335[_0x49189c[_0x48f8('0x27')]]={'$like':'%'+_0x5c6b42['query']['filter']+'%'};return _0x38b335;}})});}_0x26e5c2=_['merge']({},_0x26e5c2,_0x5c6b42[_0x48f8('0x40')]);var _0x3ed600={'where':_0x26e5c2[_0x48f8('0x39')]};return db['ChatInternalMessage'][_0x48f8('0x1f')](_0x3ed600)[_0x48f8('0x24')](function(_0x222525){_0x1601ca['count']=_0x222525;if(_0x5c6b42[_0x48f8('0x30')][_0x48f8('0x41')]){_0x26e5c2[_0x48f8('0x42')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x48f8('0x43')](_0x26e5c2);})['then'](function(_0x5d59e4){_0x1601ca[_0x48f8('0x44')]=_0x5d59e4;return _0x1601ca;})['then'](respondWithFilteredResult(_0x372a2b,_0x26e5c2))['catch'](handleError(_0x372a2b,null));};exports[_0x48f8('0x45')]=function(_0x41c93f,_0x5bb84c){var _0x9dc099={'raw':!![],'where':{'id':_0x41c93f[_0x48f8('0x46')]['id']}},_0x42dbd0={};_0x42dbd0['model']=_[_0x48f8('0x31')](db[_0x48f8('0x2a')]['rawAttributes']);_0x42dbd0['query']=_[_0x48f8('0x31')](_0x41c93f[_0x48f8('0x30')]);_0x42dbd0[_0x48f8('0x3a')]=_[_0x48f8('0x32')](_0x42dbd0[_0x48f8('0x2f')],_0x42dbd0[_0x48f8('0x30')]);_0x9dc099['attributes']=_[_0x48f8('0x32')](_0x42dbd0[_0x48f8('0x2f')],qs[_0x48f8('0x34')](_0x41c93f[_0x48f8('0x30')][_0x48f8('0x34')]));_0x9dc099['attributes']=_0x9dc099[_0x48f8('0x33')][_0x48f8('0x35')]?_0x9dc099['attributes']:_0x42dbd0[_0x48f8('0x2f')];if(_0x41c93f[_0x48f8('0x30')][_0x48f8('0x41')]){_0x9dc099[_0x48f8('0x42')]=[{'all':!![]}];}_0x9dc099=_[_0x48f8('0x3d')]({},_0x9dc099,_0x41c93f[_0x48f8('0x40')]);return db['ChatInternalMessage'][_0x48f8('0x47')](_0x9dc099)[_0x48f8('0x24')](handleEntityNotFound(_0x5bb84c,null))[_0x48f8('0x24')](respondWithResult(_0x5bb84c,null))[_0x48f8('0x48')](handleError(_0x5bb84c,null));};exports['create']=function(_0x548fbc,_0x30cfa6){return db[_0x48f8('0x2a')]['create'](_0x548fbc['body'],{})['then'](respondWithResult(_0x30cfa6,0xc9))[_0x48f8('0x48')](handleError(_0x30cfa6,null));};exports[_0x48f8('0x49')]=function(_0x3f7fdb,_0x37d416){if(_0x3f7fdb['body']['id']){delete _0x3f7fdb[_0x48f8('0x4a')]['id'];}return db[_0x48f8('0x2a')]['find']({'where':{'id':_0x3f7fdb['params']['id']}})['then'](handleEntityNotFound(_0x37d416,null))[_0x48f8('0x24')](saveUpdates(_0x3f7fdb['body'],null))[_0x48f8('0x24')](respondWithResult(_0x37d416,null))[_0x48f8('0x48')](handleError(_0x37d416,null));};exports['destroy']=function(_0x370e69,_0x568959){return db[_0x48f8('0x2a')][_0x48f8('0x47')]({'where':{'id':_0x370e69[_0x48f8('0x46')]['id']}})[_0x48f8('0x24')](handleEntityNotFound(_0x568959,null))[_0x48f8('0x24')](removeEntity(_0x568959,null))[_0x48f8('0x48')](handleError(_0x568959,null));};exports[_0x48f8('0x4b')]=function(_0x5c2915,_0x16b26f){return db[_0x48f8('0x2a')][_0x48f8('0x4b')]()[_0x48f8('0x24')](respondWithResult(_0x16b26f,null))[_0x48f8('0x48')](handleError(_0x16b26f,null));};function wrapUser(_0x2e9920){return function(_0x3e516f){var _0x952c38=_0x2e9920['get']({'plain':!![]});_0x952c38[_0x48f8('0x4c')]=[];if(_0x3e516f){_0x952c38['lastMessageAt']=_0x3e516f[_0x48f8('0x4d')];_0x952c38[_0x48f8('0x4e')]=_0x3e516f;}else{_0x952c38[_0x48f8('0x4f')]=moment(0x0)[_0x48f8('0x50')](_0x48f8('0x51'));_0x952c38['lastMessage']={};}return _0x952c38;};}exports[_0x48f8('0x52')]=function(_0x42b8db,_0x1f6b89,_0x4dbac6){var _0x11ff9d=[];return db[_0x48f8('0x53')][_0x48f8('0x43')]({'where':{'role':[_0x48f8('0x54'),_0x48f8('0x55'),'user']},'attributes':['id','fullname',_0x48f8('0x27'),'role','userpic',_0x48f8('0x56'),_0x48f8('0x57'),'lastLoginAt',_0x48f8('0x58'),_0x48f8('0x59')],'order':qs[_0x48f8('0x38')](_0x48f8('0x5a')),'include':[{'model':db[_0x48f8('0x5b')],'as':_0x48f8('0x5c'),'attributes':['id','name',_0x48f8('0x2d')],'through':{'attributes':[]}}]})[_0x48f8('0x24')](function(_0x2b20f2){if(_0x2b20f2){var _0x1d9a85=_0x42b8db[_0x48f8('0x5d')][_0x48f8('0x5e')]({'plain':!![]});if(!_0x1d9a85)throw new Error(_0x48f8('0x5f'));if(_0x1d9a85[_0x48f8('0x60')]===_0x48f8('0x5d')){return db[_0x48f8('0x61')][_0x48f8('0x47')]({'where':{'name':_0x48f8('0x62'),'userProfileId':_0x1d9a85[_0x48f8('0x63')]},'raw':!![]})['then'](function(_0x4c67f6){if(_0x4c67f6){if(_0x4c67f6[_0x48f8('0x64')]===0x0){return db[_0x48f8('0x65')][_0x48f8('0x43')]({'where':{'sectionId':_0x4c67f6['id']},'raw':!![]})['then'](function(_0x219c3f){var _0x5e9d99=[];if(_['isEmpty'](_0x219c3f)){_0x5e9d99=_[_0x48f8('0x3c')](_0x2b20f2,function(_0x53397c){if(_0x53397c['role']!==_0x48f8('0x54')){return _0x53397c;}});return _0x5e9d99;}else{for(var _0x58213f=0x0;_0x58213f<_0x2b20f2['length'];_0x58213f++){var _0x1014e9=_0x2b20f2[_0x58213f];if(_0x1014e9['role']===_0x48f8('0x54')){var _0x28a245=_[_0x48f8('0x47')](_0x219c3f,function(_0x46dbe9){return _0x46dbe9[_0x48f8('0x66')]===_0x1014e9['id'];});if(_0x28a245)_0x5e9d99[_0x48f8('0x67')](_0x1014e9);}else{_0x5e9d99['push'](_0x1014e9);}}return _0x5e9d99;}});}else{return _0x2b20f2;}}else{var _0x4155b9=_[_0x48f8('0x3c')](_0x2b20f2,function(_0x4d203d){if(_0x4d203d[_0x48f8('0x60')]!==_0x48f8('0x54')){return _0x4d203d;}});return _0x4155b9;}});}else{return _0x2b20f2;}}})[_0x48f8('0x24')](function(_0x2c481a){var _0x4d4523=[];if(_0x2c481a){_0x11ff9d=_0x2c481a;for(var _0x47bf77=0x0;_0x47bf77<_0x2c481a['length'];_0x47bf77+=0x1){_0x11ff9d[_0x47bf77][_0x48f8('0x4c')]=[];_0x4d4523[_0x48f8('0x67')](db[_0x48f8('0x2a')][_0x48f8('0x47')]({'where':{'FromId':[_0x42b8db[_0x48f8('0x5d')]['id'],_0x2c481a[_0x47bf77]['id']],'ToId':[_0x42b8db[_0x48f8('0x5d')]['id'],_0x2c481a[_0x47bf77]['id']],'ChatGroupId':null},'attributes':['id',_0x48f8('0x4d'),_0x48f8('0x68'),'ToId','read',_0x48f8('0x4a')],'order':qs['sort'](_0x48f8('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x48f8('0x24')](wrapUser(_0x2c481a[_0x47bf77])));}return BPromise[_0x48f8('0x6a')](_0x4d4523);}return[];})[_0x48f8('0x24')](function(_0x363e4c){return{'rows':_0x363e4c,'count':_0x363e4c[_0x48f8('0x35')]};})['then'](respondWithResult(_0x1f6b89,null))['catch'](handleError(_0x1f6b89,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 756a989..2e45df9 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 _0x93e8=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x392ddc,_0xead658){var _0x220027=function(_0x12b700){while(--_0x12b700){_0x392ddc['push'](_0x392ddc['shift']());}};_0x220027(++_0xead658);}(_0x93e8,0x176));var _0x893e=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x93e8[_0x5f0089];return _0x193892;};'use strict';var EventEmitter=require(_0x893e('0x0'));var ChatInternalMessage=require(_0x893e('0x1'))['db'][_0x893e('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x893e('0x3')](0x0);var events={'afterCreate':_0x893e('0x4'),'afterUpdate':_0x893e('0x5'),'afterDestroy':_0x893e('0x6')};function emitEvent(_0x37f8db){return function(_0x4e8b9a,_0x5c01c0,_0x6d00be){ChatInternalMessageEvents[_0x893e('0x7')](_0x37f8db+':'+_0x4e8b9a['id'],_0x4e8b9a);ChatInternalMessageEvents['emit'](_0x37f8db,_0x4e8b9a);_0x6d00be(null);};}for(var e in events){if(events[_0x893e('0x8')](e)){var event=events[e];ChatInternalMessage[_0x893e('0x9')](e,emitEvent(event));}}module[_0x893e('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x22f0=['emit','hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x4e01da,_0x3d1000){var _0x5bea9a=function(_0x1ade0a){while(--_0x1ade0a){_0x4e01da['push'](_0x4e01da['shift']());}};_0x5bea9a(++_0x3d1000);}(_0x22f0,0x159));var _0x022f=function(_0x15df45,_0x2b7b4d){_0x15df45=_0x15df45-0x0;var _0x256bfd=_0x22f0[_0x15df45];return _0x256bfd;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x022f('0x0'))['db'][_0x022f('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x022f('0x2')](0x0);var events={'afterCreate':_0x022f('0x3'),'afterUpdate':_0x022f('0x4'),'afterDestroy':_0x022f('0x5')};function emitEvent(_0x45a936){return function(_0x2baf00,_0x45a6dd,_0x1fb35c){ChatInternalMessageEvents[_0x022f('0x6')](_0x45a936+':'+_0x2baf00['id'],_0x2baf00);ChatInternalMessageEvents['emit'](_0x45a936,_0x2baf00);_0x1fb35c(null);};}for(var e in events){if(events[_0x022f('0x7')](e)){var event=events[e];ChatInternalMessage[_0x022f('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 52f56ec..e8dc257 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 _0x2dd0=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','chat_internal_messages','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2dd0,0x1ba));var _0x02dd=function(_0x476798,_0x4e4bbd){_0x476798=_0x476798-0x0;var _0x4ea9c7=_0x2dd0[_0x476798];return _0x4ea9c7;};'use strict';var _=require(_0x02dd('0x0'));var util=require('util');var logger=require(_0x02dd('0x1'))(_0x02dd('0x2'));var moment=require(_0x02dd('0x3'));var BPromise=require(_0x02dd('0x4'));var rp=require(_0x02dd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x02dd('0x6'));var config=require(_0x02dd('0x7'));var attributes=require(_0x02dd('0x8'));module[_0x02dd('0x9')]=function(_0x45779d,_0x435617){return _0x45779d['define']('ChatInternalMessage',attributes,{'tableName':_0x02dd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x02dd('0xb')});};
\ No newline at end of file
+var _0x63d7=['./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x63d7,0x17e));var _0x763d=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x63d7[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x763d('0x0'))(_0x763d('0x1'));var moment=require(_0x763d('0x2'));var BPromise=require(_0x763d('0x3'));var rp=require(_0x763d('0x4'));var fs=require('fs');var path=require(_0x763d('0x5'));var rimraf=require(_0x763d('0x6'));var config=require(_0x763d('0x7'));var attributes=require(_0x763d('0x8'));module[_0x763d('0x9')]=function(_0x17ace9,_0x183a2d){return _0x17ace9[_0x763d('0xa')]('ChatInternalMessage',attributes,{'tableName':_0x763d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x763d('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index d366401..53bf22e 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 _0x3464=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2e60b2,_0x5f2d9e){var _0x3514b8=function(_0x5115b1){while(--_0x5115b1){_0x2e60b2['push'](_0x2e60b2['shift']());}};_0x3514b8(++_0x5f2d9e);}(_0x3464,0x16e));var _0x4346=function(_0x25a31f,_0x1cf424){_0x25a31f=_0x25a31f-0x0;var _0x3c03e2=_0x3464[_0x25a31f];return _0x3c03e2;};'use strict';var _=require(_0x4346('0x0'));var util=require(_0x4346('0x1'));var moment=require(_0x4346('0x2'));var BPromise=require(_0x4346('0x3'));var rs=require(_0x4346('0x4'));var fs=require('fs');var Redis=require(_0x4346('0x5'));var db=require(_0x4346('0x6'))['db'];var utils=require(_0x4346('0x7'));var logger=require(_0x4346('0x8'))(_0x4346('0x9'));var config=require(_0x4346('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4346('0xb')]['http']({'port':0x232a});config[_0x4346('0xc')]=_[_0x4346('0xd')](config[_0x4346('0xc')],{'host':_0x4346('0xe'),'port':0x18eb});var socket=require(_0x4346('0xf'))(new Redis(config[_0x4346('0xc')]));require(_0x4346('0x10'))[_0x4346('0x11')](socket);function respondWithRpcPromise(_0x195c6d,_0xc6a466,_0x3d0aa0){return new BPromise(function(_0x47d05b,_0x2aac79){return client[_0x4346('0x12')](_0x195c6d,_0x3d0aa0)['then'](function(_0x1b377c){logger[_0x4346('0x13')](_0x4346('0x14'),_0xc6a466,_0x4346('0x15'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0xc6a466,_0x4346('0x15'),JSON[_0x4346('0x16')](_0x1b377c));if(_0x1b377c[_0x4346('0x17')]){if(_0x1b377c[_0x4346('0x17')][_0x4346('0x18')]===0x1f4){logger[_0x4346('0x17')](_0x4346('0x14'),_0xc6a466,_0x1b377c[_0x4346('0x17')][_0x4346('0x19')]);return _0x2aac79(_0x1b377c[_0x4346('0x17')][_0x4346('0x19')]);}logger[_0x4346('0x17')](_0x4346('0x14'),_0xc6a466,_0x1b377c['error']['message']);return _0x47d05b(_0x1b377c[_0x4346('0x17')][_0x4346('0x19')]);}else{logger[_0x4346('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0xc6a466,_0x4346('0x15'));_0x47d05b(_0x1b377c['result'][_0x4346('0x19')]);}})['catch'](function(_0x31abd0){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0xc6a466,_0x31abd0);_0x2aac79(_0x31abd0);});});}
\ No newline at end of file
+var _0x3f47=['request','then','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0x313f80,_0x208939){var _0x12ecd4=function(_0x3fa617){while(--_0x3fa617){_0x313f80['push'](_0x313f80['shift']());}};_0x12ecd4(++_0x208939);}(_0x3f47,0x10e));var _0x73f4=function(_0x5b6a14,_0x34c906){_0x5b6a14=_0x5b6a14-0x0;var _0x27b968=_0x3f47[_0x5b6a14];return _0x27b968;};'use strict';var _=require(_0x73f4('0x0'));var util=require(_0x73f4('0x1'));var moment=require('moment');var BPromise=require(_0x73f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x73f4('0x3'));var db=require(_0x73f4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x73f4('0x5'))(_0x73f4('0x6'));var config=require(_0x73f4('0x7'));var jayson=require(_0x73f4('0x8'));var client=jayson['client'][_0x73f4('0x9')]({'port':0x232a});config[_0x73f4('0xa')]=_[_0x73f4('0xb')](config[_0x73f4('0xa')],{'host':_0x73f4('0xc'),'port':0x18eb});var socket=require(_0x73f4('0xd'))(new Redis(config['redis']));require(_0x73f4('0xe'))[_0x73f4('0xf')](socket);function respondWithRpcPromise(_0xfbf315,_0x41ea92,_0xe22dc5){return new BPromise(function(_0xe25bb4,_0x94e2e4){return client[_0x73f4('0x10')](_0xfbf315,_0xe22dc5)[_0x73f4('0x11')](function(_0xfffe89){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x41ea92,_0x73f4('0x12'));logger['debug'](_0x73f4('0x13'),_0x41ea92,_0x73f4('0x12'),JSON[_0x73f4('0x14')](_0xfffe89));if(_0xfffe89[_0x73f4('0x15')]){if(_0xfffe89[_0x73f4('0x15')]['code']===0x1f4){logger[_0x73f4('0x15')](_0x73f4('0x16'),_0x41ea92,_0xfffe89[_0x73f4('0x15')][_0x73f4('0x17')]);return _0x94e2e4(_0xfffe89[_0x73f4('0x15')][_0x73f4('0x17')]);}logger['error'](_0x73f4('0x16'),_0x41ea92,_0xfffe89['error']['message']);return _0xe25bb4(_0xfffe89[_0x73f4('0x15')][_0x73f4('0x17')]);}else{logger[_0x73f4('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x41ea92,_0x73f4('0x12'));_0xe25bb4(_0xfffe89[_0x73f4('0x19')][_0x73f4('0x17')]);}})['catch'](function(_0x2294c0){logger[_0x73f4('0x15')](_0x73f4('0x16'),_0x41ea92,_0x2294c0);_0x94e2e4(_0x2294c0);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 11aca95..b2d38d6 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 _0x535b=['./chatInternalMessage.events','emit','removeListener','length','chatInternalMessage:'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0x535b,0x87));var _0xb535=function(_0x51c4b2,_0x512fff){_0x51c4b2=_0x51c4b2-0x0;var _0x35578f=_0x535b[_0x51c4b2];return _0x35578f;};'use strict';var ChatInternalMessageEvents=require(_0xb535('0x0'));var events=['save','remove','update'];function createListener(_0x357e4b,_0x18fce4){return function(_0x8c1312){_0x18fce4[_0xb535('0x1')](_0x357e4b,_0x8c1312);};}function removeListener(_0x293e30,_0x5647d0){return function(){ChatInternalMessageEvents[_0xb535('0x2')](_0x293e30,_0x5647d0);};}exports['register']=function(_0x5e9b43){for(var _0x4a7608=0x0,_0x556969=events[_0xb535('0x3')];_0x4a7608<_0x556969;_0x4a7608++){var _0x515c92=events[_0x4a7608];var _0x1406b0=createListener(_0xb535('0x4')+_0x515c92,_0x5e9b43);ChatInternalMessageEvents['on'](_0x515c92,_0x1406b0);}};
\ No newline at end of file
+var _0x19ab=['emit','removeListener','register','./chatInternalMessage.events','save','update'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x19ab,0x1c5));var _0xb19a=function(_0x9f7468,_0x451d53){_0x9f7468=_0x9f7468-0x0;var _0x2db317=_0x19ab[_0x9f7468];return _0x2db317;};'use strict';var ChatInternalMessageEvents=require(_0xb19a('0x0'));var events=[_0xb19a('0x1'),'remove',_0xb19a('0x2')];function createListener(_0x2178ed,_0x43119e){return function(_0x567114){_0x43119e[_0xb19a('0x3')](_0x2178ed,_0x567114);};}function removeListener(_0x449908,_0x2137bd){return function(){ChatInternalMessageEvents[_0xb19a('0x4')](_0x449908,_0x2137bd);};}exports[_0xb19a('0x5')]=function(_0x31e39f){for(var _0x10ed90=0x0,_0x358632=events['length'];_0x10ed90<_0x358632;_0x10ed90++){var _0x1a5426=events[_0x10ed90];var _0x1877cf=createListener('chatInternalMessage:'+_0x1a5426,_0x31e39f);ChatInternalMessageEvents['on'](_0x1a5426,_0x1877cf);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 4f6b1ba..e72e341 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 _0x15ea=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','isAuthenticated','describe','/users','getUsers','/:id','show','create','delete','destroy','exports','multer','util'];(function(_0x1e99d7,_0x18fa1f){var _0x3970bf=function(_0x453284){while(--_0x453284){_0x1e99d7['push'](_0x1e99d7['shift']());}};_0x3970bf(++_0x18fa1f);}(_0x15ea,0xfa));var _0xa15e=function(_0x1393cc,_0x3d0294){_0x1393cc=_0x1393cc-0x0;var _0x4fd93f=_0x15ea[_0x1393cc];return _0x4fd93f;};'use strict';var multer=require(_0xa15e('0x0'));var util=require(_0xa15e('0x1'));var path=require('path');var timeout=require(_0xa15e('0x2'));var express=require('express');var router=express[_0xa15e('0x3')]();var fs_extra=require(_0xa15e('0x4'));var auth=require(_0xa15e('0x5'));var interaction=require(_0xa15e('0x6'));var config=require(_0xa15e('0x7'));var controller=require(_0xa15e('0x8'));router[_0xa15e('0x9')]('/',auth['isAuthenticated'](),controller[_0xa15e('0xa')]);router[_0xa15e('0x9')]('/describe',auth[_0xa15e('0xb')](),controller[_0xa15e('0xc')]);router['get'](_0xa15e('0xd'),auth['isAuthenticated'](),controller[_0xa15e('0xe')]);router[_0xa15e('0x9')](_0xa15e('0xf'),auth['isAuthenticated'](),controller[_0xa15e('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa15e('0x11')]);router['put'](_0xa15e('0xf'),controller['update']);router[_0xa15e('0x12')](_0xa15e('0xf'),auth[_0xa15e('0xb')](),controller[_0xa15e('0x13')]);module[_0xa15e('0x14')]=router;
\ No newline at end of file
+var _0xbce8=['/:id','show','post','create','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/users','getUsers'];(function(_0x16d3e8,_0x3a026f){var _0x4f0d06=function(_0x448790){while(--_0x448790){_0x16d3e8['push'](_0x16d3e8['shift']());}};_0x4f0d06(++_0x3a026f);}(_0xbce8,0x156));var _0x8bce=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xbce8[_0x122096];return _0x3d1966;};'use strict';var multer=require(_0x8bce('0x0'));var util=require(_0x8bce('0x1'));var path=require('path');var timeout=require(_0x8bce('0x2'));var express=require(_0x8bce('0x3'));var router=express[_0x8bce('0x4')]();var fs_extra=require(_0x8bce('0x5'));var auth=require(_0x8bce('0x6'));var interaction=require(_0x8bce('0x7'));var config=require(_0x8bce('0x8'));var controller=require(_0x8bce('0x9'));router[_0x8bce('0xa')]('/',auth[_0x8bce('0xb')](),controller[_0x8bce('0xc')]);router[_0x8bce('0xa')]('/describe',auth[_0x8bce('0xb')](),controller['describe']);router[_0x8bce('0xa')](_0x8bce('0xd'),auth[_0x8bce('0xb')](),controller[_0x8bce('0xe')]);router[_0x8bce('0xa')](_0x8bce('0xf'),auth['isAuthenticated'](),controller[_0x8bce('0x10')]);router[_0x8bce('0x11')]('/',auth[_0x8bce('0xb')](),controller[_0x8bce('0x12')]);router['put'](_0x8bce('0xf'),controller['update']);router['delete'](_0x8bce('0xf'),auth[_0x8bce('0xb')](),controller[_0x8bce('0x13')]);module[_0x8bce('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index b81faea..7ba870a 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 _0xfd7b=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x58e5de,_0x2c3cda){var _0x9cac27=function(_0x496095){while(--_0x496095){_0x58e5de['push'](_0x58e5de['shift']());}};_0x9cac27(++_0x2c3cda);}(_0xfd7b,0xd1));var _0xbfd7=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0xfd7b[_0x4953da];return _0x2d3780;};'use strict';var Sequelize=require(_0xbfd7('0x0'));module[_0xbfd7('0x1')]={'body':{'type':Sequelize[_0xbfd7('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbfd7('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbfd7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbfd7('0x4')]('in','out'),'defaultValue':_0xbfd7('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbfd7('0x6')]},'providerName':{'type':Sequelize[_0xbfd7('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x8c7a=['sequelize','medium','BOOLEAN','ENUM','out','STRING','TEXT'];(function(_0x5ec09a,_0x35b386){var _0x1f3c39=function(_0xe1b250){while(--_0xe1b250){_0x5ec09a['push'](_0x5ec09a['shift']());}};_0x1f3c39(++_0x35b386);}(_0x8c7a,0x8c));var _0xa8c7=function(_0x552000,_0x5c8e4c){_0x552000=_0x552000-0x0;var _0xe210ae=_0x8c7a[_0x552000];return _0xe210ae;};'use strict';var Sequelize=require(_0xa8c7('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xa8c7('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xa8c7('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa8c7('0x3')]('in',_0xa8c7('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xa8c7('0x5')]},'providerResponse':{'type':Sequelize[_0xa8c7('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 66616a5..67e2b0e 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 _0x38fd=['util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','ChatMessage','includeAll','include','rows','show','intersection','find','create','body','params','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x37e23b,_0x9a5f01){var _0x3f1e87=function(_0x15c85e){while(--_0x15c85e){_0x37e23b['push'](_0x37e23b['shift']());}};_0x3f1e87(++_0x9a5f01);}(_0x38fd,0x7e));var _0xd38f=function(_0x5801d8,_0x4ecd3a){_0x5801d8=_0x5801d8-0x0;var _0xb03bfa=_0x38fd[_0x5801d8];return _0xb03bfa;};'use strict';var emlformat=require(_0xd38f('0x0'));var rimraf=require(_0xd38f('0x1'));var zipdir=require(_0xd38f('0x2'));var jsonpatch=require(_0xd38f('0x3'));var rp=require(_0xd38f('0x4'));var moment=require(_0xd38f('0x5'));var BPromise=require(_0xd38f('0x6'));var Mustache=require(_0xd38f('0x7'));var util=require(_0xd38f('0x8'));var path=require(_0xd38f('0x9'));var sox=require(_0xd38f('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd38f('0xb'));var _=require('lodash');var squel=require(_0xd38f('0xc'));var crypto=require(_0xd38f('0xd'));var jsforce=require(_0xd38f('0xe'));var deskjs=require(_0xd38f('0xf'));var toCsv=require(_0xd38f('0x10'));var querystring=require('querystring');var Papa=require(_0xd38f('0x11'));var Redis=require('ioredis');var authService=require(_0xd38f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd38f('0x13'));var hardwareService=require(_0xd38f('0x14'));var logger=require(_0xd38f('0x15'))(_0xd38f('0x16'));var utils=require('../../config/utils');var config=require(_0xd38f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd38f('0x18'))['db'];config[_0xd38f('0x19')]=_[_0xd38f('0x1a')](config[_0xd38f('0x19')],{'host':_0xd38f('0x1b'),'port':0x18eb});var socket=require(_0xd38f('0x1c'))(new Redis(config[_0xd38f('0x19')]));require(_0xd38f('0x1d'))['register'](socket);var jayson=require(_0xd38f('0x1e'));var client=jayson['client'][_0xd38f('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xd38f('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f88,_0x555fc5,_0x47caa0,_0x19fdfb){return new BPromise(function(_0x26b154,_0x5a8cbb){var _0x3b2b65=_0x19fdfb||client;return _0x3b2b65[_0xd38f('0x20')](_0x4b1f88,_0x47caa0)[_0xd38f('0x21')](function(_0x49ac34){logger[_0xd38f('0x22')](_0xd38f('0x23'),_0x555fc5,_0xd38f('0x24'));logger[_0xd38f('0x25')](_0xd38f('0x26'),_0x555fc5,_0xd38f('0x24'),JSON['stringify'](_0x49ac34));if(_0x49ac34['error']){if(_0x49ac34[_0xd38f('0x27')][_0xd38f('0x28')]===0x1f4){logger[_0xd38f('0x27')](_0xd38f('0x23'),_0x555fc5,_0x49ac34['error'][_0xd38f('0x29')]);return _0x5a8cbb(_0x49ac34[_0xd38f('0x27')][_0xd38f('0x29')]);}logger[_0xd38f('0x27')](_0xd38f('0x23'),_0x555fc5,_0x49ac34[_0xd38f('0x27')][_0xd38f('0x29')]);return _0x26b154(_0x49ac34[_0xd38f('0x27')]['message']);}else{logger[_0xd38f('0x22')](_0xd38f('0x23'),_0x555fc5,_0xd38f('0x24'));_0x26b154(_0x49ac34[_0xd38f('0x2a')][_0xd38f('0x29')]);}})[_0xd38f('0x2b')](function(_0x3aae32){logger[_0xd38f('0x27')](_0xd38f('0x23'),_0x555fc5,_0x3aae32);_0x5a8cbb(_0x3aae32);});});}function respondWithStatusCode(_0x2f2347,_0x3fc1bd){_0x3fc1bd=_0x3fc1bd||0xcc;return function(_0x118e5e){if(_0x118e5e){return _0x2f2347[_0xd38f('0x2c')](_0x3fc1bd);}return _0x2f2347[_0xd38f('0x2d')](_0x3fc1bd)[_0xd38f('0x2e')]();};}function respondWithResult(_0x57b69d,_0x59b646){_0x59b646=_0x59b646||0xc8;return function(_0x284254){if(_0x284254){return _0x57b69d[_0xd38f('0x2d')](_0x59b646)['json'](_0x284254);}};}function respondWithFilteredResult(_0x2eae13,_0x1eb358){return function(_0xc3ec69){if(_0xc3ec69){var _0x53f7b1=typeof _0x1eb358[_0xd38f('0x2f')]==='undefined'&&typeof _0x1eb358[_0xd38f('0x30')]===_0xd38f('0x31');var _0xb49d3c=_0xc3ec69[_0xd38f('0x32')];var _0x3bcf5e=_0x53f7b1?0x0:_0x1eb358[_0xd38f('0x2f')];var _0x4d585a=_0x53f7b1?_0xc3ec69[_0xd38f('0x32')]:_0x1eb358[_0xd38f('0x2f')]+_0x1eb358[_0xd38f('0x30')];var _0x4fbc1c;if(_0x4d585a>=_0xb49d3c){_0x4d585a=_0xb49d3c;_0x4fbc1c=0xc8;}else{_0x4fbc1c=0xce;}_0x2eae13[_0xd38f('0x2d')](_0x4fbc1c);return _0x2eae13[_0xd38f('0x33')](_0xd38f('0x34'),_0x3bcf5e+'-'+_0x4d585a+'/'+_0xb49d3c)['json'](_0xc3ec69);}return null;};}function patchUpdates(_0x5cb82b){return function(_0xcc57c9){try{jsonpatch['apply'](_0xcc57c9,_0x5cb82b,!![]);}catch(_0x174a75){return BPromise[_0xd38f('0x35')](_0x174a75);}return _0xcc57c9[_0xd38f('0x36')]();};}function saveUpdates(_0x14a557,_0x487e0b){return function(_0x2fe457){if(_0x2fe457){return _0x2fe457[_0xd38f('0x37')](_0x14a557)['then'](function(_0x617ac0){return _0x617ac0;});}return null;};}function removeEntity(_0x4e5659,_0x37aa10){return function(_0x5ed714){if(_0x5ed714){return _0x5ed714[_0xd38f('0x38')]()[_0xd38f('0x21')](function(){_0x4e5659[_0xd38f('0x2d')](0xcc)[_0xd38f('0x2e')]();});}};}function handleEntityNotFound(_0x3cdcdd,_0x54f207){return function(_0x27aa7f){if(!_0x27aa7f){_0x3cdcdd[_0xd38f('0x2c')](0x194);}return _0x27aa7f;};}function handleError(_0x4fb4c5,_0x6e5b13){_0x6e5b13=_0x6e5b13||0x1f4;return function(_0x5e8e91){logger[_0xd38f('0x27')](_0x5e8e91['stack']);if(_0x5e8e91[_0xd38f('0x39')]){delete _0x5e8e91[_0xd38f('0x39')];}_0x4fb4c5['status'](_0x6e5b13)[_0xd38f('0x3a')](_0x5e8e91);};}exports[_0xd38f('0x3b')]=function(_0x44bb52,_0x1f042a){var _0x4ca695={},_0x442976={},_0x436d84={'count':0x0,'rows':[]};var _0xbe7c4b=_[_0xd38f('0x3c')](db['ChatMessage'][_0xd38f('0x3d')],function(_0x5672dc){return{'name':_0x5672dc[_0xd38f('0x3e')],'type':_0x5672dc[_0xd38f('0x3f')][_0xd38f('0x40')]};});_0x442976[_0xd38f('0x41')]=_[_0xd38f('0x3c')](_0xbe7c4b,_0xd38f('0x39'));_0x442976[_0xd38f('0x42')]=_[_0xd38f('0x43')](_0x44bb52[_0xd38f('0x42')]);_0x442976['filters']=_['intersection'](_0x442976[_0xd38f('0x41')],_0x442976[_0xd38f('0x42')]);_0x4ca695[_0xd38f('0x44')]=_['intersection'](_0x442976['model'],qs[_0xd38f('0x45')](_0x44bb52[_0xd38f('0x42')][_0xd38f('0x45')]));_0x4ca695[_0xd38f('0x44')]=_0x4ca695[_0xd38f('0x44')][_0xd38f('0x46')]?_0x4ca695[_0xd38f('0x44')]:_0x442976[_0xd38f('0x41')];if(!_0x44bb52['query']['hasOwnProperty'](_0xd38f('0x47'))){_0x4ca695[_0xd38f('0x30')]=qs[_0xd38f('0x30')](_0x44bb52[_0xd38f('0x42')]['limit']);_0x4ca695[_0xd38f('0x2f')]=qs['offset'](_0x44bb52[_0xd38f('0x42')][_0xd38f('0x2f')]);}_0x4ca695[_0xd38f('0x48')]=qs[_0xd38f('0x49')](_0x44bb52[_0xd38f('0x42')][_0xd38f('0x49')]);_0x4ca695[_0xd38f('0x4a')]=qs['filters'](_['pick'](_0x44bb52[_0xd38f('0x42')],_0x442976['filters']),_0xbe7c4b);if(_0x44bb52[_0xd38f('0x42')][_0xd38f('0x4b')]){_0x4ca695['where']=_['merge'](_0x4ca695['where'],{'$or':_['map'](_0xbe7c4b,function(_0x58151b){if(_0x58151b['type']!==_0xd38f('0x4c')){var _0x566b6b={};_0x566b6b[_0x58151b[_0xd38f('0x39')]]={'$like':'%'+_0x44bb52[_0xd38f('0x42')][_0xd38f('0x4b')]+'%'};return _0x566b6b;}})});}_0x4ca695=_[_0xd38f('0x4d')]({},_0x4ca695,_0x44bb52[_0xd38f('0x4e')]);var _0x2b25e3={'where':_0x4ca695[_0xd38f('0x4a')]};return db[_0xd38f('0x4f')][_0xd38f('0x32')](_0x2b25e3)[_0xd38f('0x21')](function(_0x2e9f2a){_0x436d84[_0xd38f('0x32')]=_0x2e9f2a;if(_0x44bb52[_0xd38f('0x42')][_0xd38f('0x50')]){_0x4ca695[_0xd38f('0x51')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4ca695);})['then'](function(_0x935881){_0x436d84[_0xd38f('0x52')]=_0x935881;return _0x436d84;})[_0xd38f('0x21')](respondWithFilteredResult(_0x1f042a,_0x4ca695))[_0xd38f('0x2b')](handleError(_0x1f042a,null));};exports[_0xd38f('0x53')]=function(_0x5c8503,_0x38dcb6){var _0x1d9bde={'raw':!![],'where':{'id':_0x5c8503['params']['id']}},_0x3a88d7={};_0x3a88d7['model']=_[_0xd38f('0x43')](db[_0xd38f('0x4f')][_0xd38f('0x3d')]);_0x3a88d7[_0xd38f('0x42')]=_[_0xd38f('0x43')](_0x5c8503[_0xd38f('0x42')]);_0x3a88d7['filters']=_[_0xd38f('0x54')](_0x3a88d7[_0xd38f('0x41')],_0x3a88d7[_0xd38f('0x42')]);_0x1d9bde[_0xd38f('0x44')]=_[_0xd38f('0x54')](_0x3a88d7['model'],qs[_0xd38f('0x45')](_0x5c8503[_0xd38f('0x42')][_0xd38f('0x45')]));_0x1d9bde[_0xd38f('0x44')]=_0x1d9bde[_0xd38f('0x44')][_0xd38f('0x46')]?_0x1d9bde[_0xd38f('0x44')]:_0x3a88d7[_0xd38f('0x41')];if(_0x5c8503['query'][_0xd38f('0x50')]){_0x1d9bde[_0xd38f('0x51')]=[{'all':!![]}];}_0x1d9bde=_['merge']({},_0x1d9bde,_0x5c8503[_0xd38f('0x4e')]);return db[_0xd38f('0x4f')][_0xd38f('0x55')](_0x1d9bde)['then'](handleEntityNotFound(_0x38dcb6,null))[_0xd38f('0x21')](respondWithResult(_0x38dcb6,null))[_0xd38f('0x2b')](handleError(_0x38dcb6,null));};exports[_0xd38f('0x56')]=function(_0x5d1c52,_0x412bca){return db[_0xd38f('0x4f')]['create'](_0x5d1c52[_0xd38f('0x57')],{})[_0xd38f('0x21')](respondWithResult(_0x412bca,0xc9))[_0xd38f('0x2b')](handleError(_0x412bca,null));};exports[_0xd38f('0x37')]=function(_0x5d901e,_0xf36ccc){if(_0x5d901e[_0xd38f('0x57')]['id']){delete _0x5d901e[_0xd38f('0x57')]['id'];}return db[_0xd38f('0x4f')][_0xd38f('0x55')]({'where':{'id':_0x5d901e[_0xd38f('0x58')]['id']}})['then'](handleEntityNotFound(_0xf36ccc,null))['then'](saveUpdates(_0x5d901e[_0xd38f('0x57')],null))['then'](respondWithResult(_0xf36ccc,null))[_0xd38f('0x2b')](handleError(_0xf36ccc,null));};exports[_0xd38f('0x38')]=function(_0x1c5309,_0x38794b){return db[_0xd38f('0x4f')][_0xd38f('0x55')]({'where':{'id':_0x1c5309[_0xd38f('0x58')]['id']}})[_0xd38f('0x21')](handleEntityNotFound(_0x38794b,null))[_0xd38f('0x21')](removeEntity(_0x38794b,null))[_0xd38f('0x2b')](handleError(_0x38794b,null));};exports['describe']=function(_0xd2f302,_0x26d777){return db['ChatMessage'][_0xd38f('0x59')]()['then'](respondWithResult(_0x26d777,null))['catch'](handleError(_0x26d777,null));};var interaction_log=require(_0xd38f('0x15'))(_0xd38f('0x5a'));exports[_0xd38f('0x5b')]=function(_0x5ec94b,_0x4462a9,_0x31c69e){var _0x38dbec={'agent':{},'channel':_0xd38f('0x5c')};if(_0x5ec94b[_0xd38f('0x57')]['id']){delete _0x5ec94b[_0xd38f('0x57')]['id'];}_0x5ec94b['body'][_0xd38f('0x5d')]=!![];_0x5ec94b[_0xd38f('0x57')][_0xd38f('0x5e')]=moment()[_0xd38f('0x5f')](_0xd38f('0x60'));_0x5ec94b['body'][_0xd38f('0x61')]=_0x5ec94b[_0xd38f('0x57')]['UserId']||_0x5ec94b[_0xd38f('0x62')]['id'];_0x38dbec['agent']['id']=_0x5ec94b['body'][_0xd38f('0x61')];return db[_0xd38f('0x4f')][_0xd38f('0x55')]({'where':{'id':_0x5ec94b[_0xd38f('0x58')]['id'],'UserId':null}})[_0xd38f('0x21')](handleEntityNotFound(_0x4462a9,null))[_0xd38f('0x21')](saveUpdates(_0x5ec94b[_0xd38f('0x57')],null))['then'](function(_0x421d9e){if(_0x421d9e){_0x38dbec[_0xd38f('0x29')]=_0x421d9e[_0xd38f('0x63')]({'plain':!![]});return db[_0xd38f('0x64')][_0xd38f('0x55')]({'where':{'id':_0x421d9e[_0xd38f('0x65')]}});}return null;})[_0xd38f('0x21')](handleEntityNotFound(_0x4462a9,null))[_0xd38f('0x21')](function(_0x319e56){if(_0x319e56){return _0x319e56[_0xd38f('0x37')]({'UserId':_0x5ec94b[_0xd38f('0x57')][_0xd38f('0x61')],'read1stAt':_[_0xd38f('0x66')](_0x319e56[_0xd38f('0x67')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xd38f('0x21')](function(_0x43f49a){if(_0x43f49a){_0x38dbec[_0xd38f('0x68')]=_0x43f49a[_0xd38f('0x63')]({'plain':!![]});interaction_log[_0xd38f('0x22')](_0xd38f('0x69'),_0x5ec94b[_0xd38f('0x62')]['id'],_0x5ec94b[_0xd38f('0x62')]['name'],_0x5ec94b[_0xd38f('0x62')][_0xd38f('0x6a')],_0x38dbec[_0xd38f('0x68')]['id'],_0x5ec94b[_0xd38f('0x57')]?JSON[_0xd38f('0x6b')](_0x5ec94b[_0xd38f('0x57')]):_0xd38f('0x6c'));return respondWithRpcPromise(_0xd38f('0x6d'),_0xd38f('0x6e'),_0x38dbec);}return null;})['then'](function(_0x4dd755){var _0x474999=_0xd38f('0x6f')+_0x4dd755[_0xd38f('0x29')][_0xd38f('0x70')];return db[_0xd38f('0x71')][_0xd38f('0x42')](_0x474999,{'type':db[_0xd38f('0x72')][_0xd38f('0x73')]['SELECT'],'raw':!![]})['then'](function(_0x385506){return _0x385506;});})[_0xd38f('0x21')](function(_0x2647e8){if(_0x2647e8){_0x38dbec[_0xd38f('0x29')][_0xd38f('0x74')]=_0x2647e8[0x0];if(!_0x5ec94b[_0xd38f('0x57')][_0xd38f('0x61')])return;return db[_0xd38f('0x75')][_0xd38f('0x55')]({'where':{'id':_0x5ec94b[_0xd38f('0x57')][_0xd38f('0x61')],'role':_0xd38f('0x76')},'attributes':['id',_0xd38f('0x39'),'fullname',_0xd38f('0x77'),_0xd38f('0x78')],'raw':!![]});}return null;})[_0xd38f('0x21')](function(_0x491535){if(!_0x491535)return null;_0x38dbec[_0xd38f('0x29')][_0xd38f('0x76')]=_0x491535;return _0x38dbec;})[_0xd38f('0x21')](function(_0x25cf48){if(_0x25cf48){if(_0x5ec94b[_0xd38f('0x57')]['manual']){_0x38dbec[_0xd38f('0x29')][_0xd38f('0x79')]=util[_0xd38f('0x5f')](_0xd38f('0x7a'),_0x5ec94b[_0xd38f('0x62')][_0xd38f('0x39')]);_0x38dbec['message'][_0xd38f('0x7b')]=_0x38dbec[_0xd38f('0x7b')];_0x38dbec[_0xd38f('0x29')][_0xd38f('0x7c')]=_0x38dbec[_0xd38f('0x7b')];_0x38dbec[_0xd38f('0x29')][_0xd38f('0x7d')]=_0xd38f('0x5b');return respondWithRpcPromise(_0xd38f('0x7e'),_0xd38f('0x7e'),{'event':_0xd38f('0x7f'),'message':_[_0xd38f('0x4d')](_0x38dbec[_0xd38f('0x29')],JSON['parse'](_0x38dbec[_0xd38f('0x68')]['formData']))},client9002)['then'](function(){return _0x38dbec;});}return _0x38dbec;}return null;})[_0xd38f('0x21')](respondWithResult(_0x4462a9,null))[_0xd38f('0x2b')](handleError(_0x4462a9,null));};var interaction_log=require(_0xd38f('0x15'))(_0xd38f('0x5a'));exports[_0xd38f('0x35')]=function(_0x30e758,_0x471d13,_0x22f25b){var _0x27aa01={'agent':{},'channel':'chat'};if(_0x30e758[_0xd38f('0x57')]['id']){delete _0x30e758[_0xd38f('0x57')]['id'];}_0x30e758[_0xd38f('0x57')][_0xd38f('0x61')]=_0x30e758['body']['UserId']||_0x30e758[_0xd38f('0x62')]['id'];_0x27aa01['agent']['id']=_0x30e758[_0xd38f('0x57')][_0xd38f('0x61')];return db[_0xd38f('0x4f')][_0xd38f('0x55')]({'where':{'id':_0x30e758[_0xd38f('0x58')]['id'],'UserId':null}})[_0xd38f('0x21')](handleEntityNotFound(_0x471d13,null))[_0xd38f('0x21')](function(_0x534b93){if(_0x534b93){_0x27aa01[_0xd38f('0x29')]=_0x534b93[_0xd38f('0x63')]({'plain':!![]});return db[_0xd38f('0x64')]['find']({'where':{'id':_0x534b93[_0xd38f('0x65')]}});}return null;})[_0xd38f('0x21')](handleEntityNotFound(_0x471d13,null))['then'](function(_0x35af27){if(_0x35af27){_0x27aa01[_0xd38f('0x68')]=_0x35af27[_0xd38f('0x63')]({'plain':!![]});interaction_log[_0xd38f('0x22')](_0xd38f('0x80'),_0x30e758[_0xd38f('0x62')]['id'],_0x30e758[_0xd38f('0x62')][_0xd38f('0x39')],_0x30e758[_0xd38f('0x62')][_0xd38f('0x6a')],_0x27aa01[_0xd38f('0x68')]['id'],_0x30e758['body']?JSON[_0xd38f('0x6b')](_0x30e758[_0xd38f('0x57')]):_0xd38f('0x6c'));return respondWithRpcPromise(_0xd38f('0x81'),_0xd38f('0x82'),_0x27aa01);}return null;})[_0xd38f('0x21')](function(_0x4107cb){var _0x4bfb8b=_0xd38f('0x6f')+_0x4107cb[_0xd38f('0x29')][_0xd38f('0x70')];return db[_0xd38f('0x71')][_0xd38f('0x42')](_0x4bfb8b,{'type':db['Sequelize']['QueryTypes'][_0xd38f('0x83')],'raw':!![]})[_0xd38f('0x21')](function(_0x426b65){return _0x426b65;});})[_0xd38f('0x21')](function(_0xd2d303){if(_0xd2d303){_0x27aa01[_0xd38f('0x29')]['contact']=_0xd2d303[0x0];if(!_0x30e758[_0xd38f('0x57')][_0xd38f('0x61')])return;return db[_0xd38f('0x75')][_0xd38f('0x55')]({'where':{'id':_0x30e758[_0xd38f('0x57')][_0xd38f('0x61')],'role':_0xd38f('0x76')},'attributes':['id',_0xd38f('0x39'),'fullname',_0xd38f('0x77'),'internal'],'raw':!![]});}return null;})[_0xd38f('0x21')](function(_0x5abd7a){if(!_0x5abd7a)return null;_0x27aa01[_0xd38f('0x29')][_0xd38f('0x76')]=_0x5abd7a;return _0x27aa01;})['then'](function(_0x595dc1){if(_0x595dc1){_0x595dc1[_0xd38f('0x29')]['interface']=util[_0xd38f('0x5f')](_0xd38f('0x7a'),_0x30e758[_0xd38f('0x62')][_0xd38f('0x39')]);_0x595dc1['message']['channel']=_0x27aa01[_0xd38f('0x7b')];_0x595dc1['message']['motionChannel']=_0x27aa01[_0xd38f('0x7b')];_0x595dc1[_0xd38f('0x29')][_0xd38f('0x7d')]=_0xd38f('0x35');respondWithRpcPromise(_0xd38f('0x7e'),_0xd38f('0x7e'),{'event':_0xd38f('0x84'),'message':_[_0xd38f('0x4d')](_0x27aa01[_0xd38f('0x29')],JSON[_0xd38f('0x85')](_0x27aa01[_0xd38f('0x68')]['formData']))},client9002);return _0x27aa01;}return null;})[_0xd38f('0x21')](respondWithResult(_0x471d13,null))[_0xd38f('0x2b')](handleError(_0x471d13,null));};
\ No newline at end of file
+var _0x7795=['send','map','ChatMessage','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','length','options','find','create','update','body','params','destroy','describe','chat-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','ContactId','QueryTypes','SELECT','fullname','email','manual','format','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','reject','agent','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','contact','User','internal','interface','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','request','request\x20sent','debug','stringify','error','code','message','info','ChatMessage,\x20%s,\x20%s','result','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','then','sendStatus','name'];(function(_0x2516d2,_0x4eca45){var _0x3b0a31=function(_0xaee4bd){while(--_0xaee4bd){_0x2516d2['push'](_0x2516d2['shift']());}};_0x3b0a31(++_0x4eca45);}(_0x7795,0x162));var _0x5779=function(_0x475c2e,_0xa1151c){_0x475c2e=_0x475c2e-0x0;var _0x47bb9a=_0x7795[_0x475c2e];return _0x47bb9a;};'use strict';var emlformat=require(_0x5779('0x0'));var rimraf=require(_0x5779('0x1'));var zipdir=require(_0x5779('0x2'));var jsonpatch=require(_0x5779('0x3'));var rp=require(_0x5779('0x4'));var moment=require(_0x5779('0x5'));var BPromise=require(_0x5779('0x6'));var Mustache=require('mustache');var util=require(_0x5779('0x7'));var path=require('path');var sox=require(_0x5779('0x8'));var csv=require(_0x5779('0x9'));var ejs=require(_0x5779('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5779('0xb'));var crypto=require(_0x5779('0xc'));var jsforce=require(_0x5779('0xd'));var deskjs=require(_0x5779('0xe'));var toCsv=require(_0x5779('0x9'));var querystring=require('querystring');var Papa=require(_0x5779('0xf'));var Redis=require(_0x5779('0x10'));var authService=require(_0x5779('0x11'));var qs=require(_0x5779('0x12'));var as=require(_0x5779('0x13'));var hardwareService=require(_0x5779('0x14'));var logger=require(_0x5779('0x15'))(_0x5779('0x16'));var utils=require(_0x5779('0x17'));var config=require(_0x5779('0x18'));var licenseUtil=require(_0x5779('0x19'));var db=require('../../mysqldb')['db'];config[_0x5779('0x1a')]=_[_0x5779('0x1b')](config['redis'],{'host':_0x5779('0x1c'),'port':0x18eb});var socket=require(_0x5779('0x1d'))(new Redis(config[_0x5779('0x1a')]));require(_0x5779('0x1e'))[_0x5779('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5779('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x5779('0x20')][_0x5779('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x598136,_0x52b6f9,_0x244b6a,_0x56ea97){return new BPromise(function(_0xdb2fdf,_0x58aacc){var _0x1b52f7=_0x56ea97||client;return _0x1b52f7[_0x5779('0x22')](_0x598136,_0x244b6a)['then'](function(_0x2a4a2e){logger['info']('ChatMessage,\x20%s,\x20%s',_0x52b6f9,_0x5779('0x23'));logger[_0x5779('0x24')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x52b6f9,_0x5779('0x23'),JSON[_0x5779('0x25')](_0x2a4a2e));if(_0x2a4a2e[_0x5779('0x26')]){if(_0x2a4a2e[_0x5779('0x26')][_0x5779('0x27')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x52b6f9,_0x2a4a2e[_0x5779('0x26')][_0x5779('0x28')]);return _0x58aacc(_0x2a4a2e[_0x5779('0x26')][_0x5779('0x28')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x52b6f9,_0x2a4a2e[_0x5779('0x26')]['message']);return _0xdb2fdf(_0x2a4a2e[_0x5779('0x26')]['message']);}else{logger[_0x5779('0x29')](_0x5779('0x2a'),_0x52b6f9,'request\x20sent');_0xdb2fdf(_0x2a4a2e[_0x5779('0x2b')][_0x5779('0x28')]);}})['catch'](function(_0x14db88){logger[_0x5779('0x26')]('ChatMessage,\x20%s,\x20%s',_0x52b6f9,_0x14db88);_0x58aacc(_0x14db88);});});}function respondWithStatusCode(_0x231737,_0x240e1d){_0x240e1d=_0x240e1d||0xcc;return function(_0x21dcec){if(_0x21dcec){return _0x231737['sendStatus'](_0x240e1d);}return _0x231737['status'](_0x240e1d)[_0x5779('0x2c')]();};}function respondWithResult(_0x46779f,_0x16fc9b){_0x16fc9b=_0x16fc9b||0xc8;return function(_0x39aa33){if(_0x39aa33){return _0x46779f[_0x5779('0x2d')](_0x16fc9b)[_0x5779('0x2e')](_0x39aa33);}};}function respondWithFilteredResult(_0x24f1e8,_0x365434){return function(_0x5323f4){if(_0x5323f4){var _0xcf25bb=typeof _0x365434[_0x5779('0x2f')]===_0x5779('0x30')&&typeof _0x365434['limit']==='undefined';var _0x18f53a=_0x5323f4[_0x5779('0x31')];var _0x73ec98=_0xcf25bb?0x0:_0x365434[_0x5779('0x2f')];var _0x2a891a=_0xcf25bb?_0x5323f4[_0x5779('0x31')]:_0x365434[_0x5779('0x2f')]+_0x365434[_0x5779('0x32')];var _0x1bc77e;if(_0x2a891a>=_0x18f53a){_0x2a891a=_0x18f53a;_0x1bc77e=0xc8;}else{_0x1bc77e=0xce;}_0x24f1e8[_0x5779('0x2d')](_0x1bc77e);return _0x24f1e8[_0x5779('0x33')](_0x5779('0x34'),_0x73ec98+'-'+_0x2a891a+'/'+_0x18f53a)['json'](_0x5323f4);}return null;};}function patchUpdates(_0x1ee79d){return function(_0x58d4ef){try{jsonpatch[_0x5779('0x35')](_0x58d4ef,_0x1ee79d,!![]);}catch(_0x498d2b){return BPromise['reject'](_0x498d2b);}return _0x58d4ef['save']();};}function saveUpdates(_0x13a23c,_0x2d6c00){return function(_0x33fd05){if(_0x33fd05){return _0x33fd05['update'](_0x13a23c)[_0x5779('0x36')](function(_0xc5f843){return _0xc5f843;});}return null;};}function removeEntity(_0x5d16c3,_0x51a72d){return function(_0x1f6022){if(_0x1f6022){return _0x1f6022['destroy']()['then'](function(){_0x5d16c3[_0x5779('0x2d')](0xcc)[_0x5779('0x2c')]();});}};}function handleEntityNotFound(_0xe7cc75,_0x5695bd){return function(_0x42c4ca){if(!_0x42c4ca){_0xe7cc75[_0x5779('0x37')](0x194);}return _0x42c4ca;};}function handleError(_0xafe3a2,_0x39e9b6){_0x39e9b6=_0x39e9b6||0x1f4;return function(_0x2a903f){logger[_0x5779('0x26')](_0x2a903f['stack']);if(_0x2a903f[_0x5779('0x38')]){delete _0x2a903f[_0x5779('0x38')];}_0xafe3a2[_0x5779('0x2d')](_0x39e9b6)[_0x5779('0x39')](_0x2a903f);};}exports['index']=function(_0x4f4e5d,_0x57e4b9){var _0x156d8d={},_0x5a3cc0={},_0x497f70={'count':0x0,'rows':[]};var _0x153f95=_[_0x5779('0x3a')](db[_0x5779('0x3b')]['rawAttributes'],function(_0x165826){return{'name':_0x165826[_0x5779('0x3c')],'type':_0x165826[_0x5779('0x3d')][_0x5779('0x3e')]};});_0x5a3cc0[_0x5779('0x3f')]=_[_0x5779('0x3a')](_0x153f95,_0x5779('0x38'));_0x5a3cc0[_0x5779('0x40')]=_[_0x5779('0x41')](_0x4f4e5d[_0x5779('0x40')]);_0x5a3cc0[_0x5779('0x42')]=_['intersection'](_0x5a3cc0[_0x5779('0x3f')],_0x5a3cc0[_0x5779('0x40')]);_0x156d8d[_0x5779('0x43')]=_[_0x5779('0x44')](_0x5a3cc0[_0x5779('0x3f')],qs[_0x5779('0x45')](_0x4f4e5d[_0x5779('0x40')][_0x5779('0x45')]));_0x156d8d[_0x5779('0x43')]=_0x156d8d[_0x5779('0x43')]['length']?_0x156d8d[_0x5779('0x43')]:_0x5a3cc0[_0x5779('0x3f')];if(!_0x4f4e5d[_0x5779('0x40')][_0x5779('0x46')](_0x5779('0x47'))){_0x156d8d[_0x5779('0x32')]=qs['limit'](_0x4f4e5d[_0x5779('0x40')][_0x5779('0x32')]);_0x156d8d['offset']=qs[_0x5779('0x2f')](_0x4f4e5d[_0x5779('0x40')][_0x5779('0x2f')]);}_0x156d8d[_0x5779('0x48')]=qs[_0x5779('0x49')](_0x4f4e5d['query'][_0x5779('0x49')]);_0x156d8d[_0x5779('0x4a')]=qs[_0x5779('0x42')](_[_0x5779('0x4b')](_0x4f4e5d[_0x5779('0x40')],_0x5a3cc0['filters']),_0x153f95);if(_0x4f4e5d[_0x5779('0x40')][_0x5779('0x4c')]){_0x156d8d[_0x5779('0x4a')]=_[_0x5779('0x4d')](_0x156d8d['where'],{'$or':_[_0x5779('0x3a')](_0x153f95,function(_0x44502f){if(_0x44502f[_0x5779('0x3d')]!==_0x5779('0x4e')){var _0x3d94ef={};_0x3d94ef[_0x44502f['name']]={'$like':'%'+_0x4f4e5d[_0x5779('0x40')][_0x5779('0x4c')]+'%'};return _0x3d94ef;}})});}_0x156d8d=_[_0x5779('0x4d')]({},_0x156d8d,_0x4f4e5d['options']);var _0x1e6d17={'where':_0x156d8d[_0x5779('0x4a')]};return db[_0x5779('0x3b')]['count'](_0x1e6d17)[_0x5779('0x36')](function(_0x327c28){_0x497f70[_0x5779('0x31')]=_0x327c28;if(_0x4f4e5d[_0x5779('0x40')][_0x5779('0x4f')]){_0x156d8d[_0x5779('0x50')]=[{'all':!![]}];}return db[_0x5779('0x3b')][_0x5779('0x51')](_0x156d8d);})[_0x5779('0x36')](function(_0x3f2f5a){_0x497f70[_0x5779('0x52')]=_0x3f2f5a;return _0x497f70;})[_0x5779('0x36')](respondWithFilteredResult(_0x57e4b9,_0x156d8d))[_0x5779('0x53')](handleError(_0x57e4b9,null));};exports[_0x5779('0x54')]=function(_0x4a3490,_0x45ab80){var _0x5f0f95={'raw':!![],'where':{'id':_0x4a3490['params']['id']}},_0x3d2c7c={};_0x3d2c7c['model']=_[_0x5779('0x41')](db[_0x5779('0x3b')][_0x5779('0x55')]);_0x3d2c7c[_0x5779('0x40')]=_['keys'](_0x4a3490[_0x5779('0x40')]);_0x3d2c7c[_0x5779('0x42')]=_[_0x5779('0x44')](_0x3d2c7c['model'],_0x3d2c7c[_0x5779('0x40')]);_0x5f0f95[_0x5779('0x43')]=_[_0x5779('0x44')](_0x3d2c7c[_0x5779('0x3f')],qs['fields'](_0x4a3490[_0x5779('0x40')][_0x5779('0x45')]));_0x5f0f95['attributes']=_0x5f0f95[_0x5779('0x43')][_0x5779('0x56')]?_0x5f0f95['attributes']:_0x3d2c7c[_0x5779('0x3f')];if(_0x4a3490[_0x5779('0x40')][_0x5779('0x4f')]){_0x5f0f95[_0x5779('0x50')]=[{'all':!![]}];}_0x5f0f95=_['merge']({},_0x5f0f95,_0x4a3490[_0x5779('0x57')]);return db[_0x5779('0x3b')][_0x5779('0x58')](_0x5f0f95)[_0x5779('0x36')](handleEntityNotFound(_0x45ab80,null))[_0x5779('0x36')](respondWithResult(_0x45ab80,null))[_0x5779('0x53')](handleError(_0x45ab80,null));};exports[_0x5779('0x59')]=function(_0x19c9e9,_0x146116){return db[_0x5779('0x3b')][_0x5779('0x59')](_0x19c9e9['body'],{})[_0x5779('0x36')](respondWithResult(_0x146116,0xc9))['catch'](handleError(_0x146116,null));};exports[_0x5779('0x5a')]=function(_0x281ac4,_0x430369){if(_0x281ac4['body']['id']){delete _0x281ac4[_0x5779('0x5b')]['id'];}return db[_0x5779('0x3b')][_0x5779('0x58')]({'where':{'id':_0x281ac4[_0x5779('0x5c')]['id']}})[_0x5779('0x36')](handleEntityNotFound(_0x430369,null))[_0x5779('0x36')](saveUpdates(_0x281ac4[_0x5779('0x5b')],null))['then'](respondWithResult(_0x430369,null))[_0x5779('0x53')](handleError(_0x430369,null));};exports[_0x5779('0x5d')]=function(_0x1dcfca,_0x5d7621){return db[_0x5779('0x3b')][_0x5779('0x58')]({'where':{'id':_0x1dcfca[_0x5779('0x5c')]['id']}})[_0x5779('0x36')](handleEntityNotFound(_0x5d7621,null))['then'](removeEntity(_0x5d7621,null))[_0x5779('0x53')](handleError(_0x5d7621,null));};exports[_0x5779('0x5e')]=function(_0x1b8ca0,_0x5d5282){return db[_0x5779('0x3b')][_0x5779('0x5e')]()[_0x5779('0x36')](respondWithResult(_0x5d5282,null))[_0x5779('0x53')](handleError(_0x5d5282,null));};var interaction_log=require(_0x5779('0x15'))(_0x5779('0x5f'));exports[_0x5779('0x60')]=function(_0x1e388a,_0x548907,_0x55a6c7){var _0x1637dc={'agent':{},'channel':'chat'};if(_0x1e388a['body']['id']){delete _0x1e388a['body']['id'];}_0x1e388a[_0x5779('0x5b')][_0x5779('0x61')]=!![];_0x1e388a[_0x5779('0x5b')][_0x5779('0x62')]=moment()['format'](_0x5779('0x63'));_0x1e388a[_0x5779('0x5b')][_0x5779('0x64')]=_0x1e388a[_0x5779('0x5b')]['UserId']||_0x1e388a[_0x5779('0x65')]['id'];_0x1637dc['agent']['id']=_0x1e388a[_0x5779('0x5b')][_0x5779('0x64')];return db[_0x5779('0x3b')][_0x5779('0x58')]({'where':{'id':_0x1e388a['params']['id'],'UserId':null}})[_0x5779('0x36')](handleEntityNotFound(_0x548907,null))[_0x5779('0x36')](saveUpdates(_0x1e388a['body'],null))['then'](function(_0x33f906){if(_0x33f906){_0x1637dc[_0x5779('0x28')]=_0x33f906[_0x5779('0x66')]({'plain':!![]});return db[_0x5779('0x67')]['find']({'where':{'id':_0x33f906['ChatInteractionId']}});}return null;})[_0x5779('0x36')](handleEntityNotFound(_0x548907,null))[_0x5779('0x36')](function(_0x1c4133){if(_0x1c4133){return _0x1c4133[_0x5779('0x5a')]({'UserId':_0x1e388a[_0x5779('0x5b')]['UserId'],'read1stAt':_[_0x5779('0x68')](_0x1c4133['read1stAt'])?moment()['format'](_0x5779('0x63')):undefined});}return null;})[_0x5779('0x36')](function(_0x5c0733){if(_0x5c0733){_0x1637dc[_0x5779('0x69')]=_0x5c0733[_0x5779('0x66')]({'plain':!![]});interaction_log[_0x5779('0x29')](_0x5779('0x6a'),_0x1e388a[_0x5779('0x65')]['id'],_0x1e388a[_0x5779('0x65')][_0x5779('0x38')],_0x1e388a[_0x5779('0x65')]['role'],_0x1637dc['interaction']['id'],_0x1e388a['body']?JSON['stringify'](_0x1e388a[_0x5779('0x5b')]):_0x5779('0x6b'));return respondWithRpcPromise(_0x5779('0x6c'),_0x5779('0x6d'),_0x1637dc);}return null;})[_0x5779('0x36')](function(_0x2039ae){var _0x3a3d19='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2039ae[_0x5779('0x28')][_0x5779('0x6e')];return db['sequelize'][_0x5779('0x40')](_0x3a3d19,{'type':db['Sequelize'][_0x5779('0x6f')][_0x5779('0x70')],'raw':!![]})[_0x5779('0x36')](function(_0x9f74c3){return _0x9f74c3;});})[_0x5779('0x36')](function(_0x22841d){if(_0x22841d){_0x1637dc[_0x5779('0x28')]['contact']=_0x22841d[0x0];if(!_0x1e388a['body'][_0x5779('0x64')])return;return db['User'][_0x5779('0x58')]({'where':{'id':_0x1e388a[_0x5779('0x5b')][_0x5779('0x64')],'role':'agent'},'attributes':['id',_0x5779('0x38'),_0x5779('0x71'),_0x5779('0x72'),'internal'],'raw':!![]});}return null;})[_0x5779('0x36')](function(_0x2ac4b0){if(!_0x2ac4b0)return null;_0x1637dc['message']['agent']=_0x2ac4b0;return _0x1637dc;})[_0x5779('0x36')](function(_0x5eb57c){if(_0x5eb57c){if(_0x1e388a[_0x5779('0x5b')][_0x5779('0x73')]){_0x1637dc[_0x5779('0x28')]['interface']=util[_0x5779('0x74')](_0x5779('0x75'),_0x1e388a[_0x5779('0x65')][_0x5779('0x38')]);_0x1637dc[_0x5779('0x28')][_0x5779('0x76')]=_0x1637dc[_0x5779('0x76')];_0x1637dc[_0x5779('0x28')][_0x5779('0x77')]=_0x1637dc['channel'];_0x1637dc[_0x5779('0x28')][_0x5779('0x78')]=_0x5779('0x60');return respondWithRpcPromise(_0x5779('0x79'),_0x5779('0x79'),{'event':'acceptmessage','message':_['merge'](_0x1637dc[_0x5779('0x28')],JSON[_0x5779('0x7a')](_0x1637dc[_0x5779('0x69')][_0x5779('0x7b')]))},client9002)['then'](function(){return _0x1637dc;});}return _0x1637dc;}return null;})['then'](respondWithResult(_0x548907,null))[_0x5779('0x53')](handleError(_0x548907,null));};var interaction_log=require(_0x5779('0x15'))('chat-interactions');exports[_0x5779('0x7c')]=function(_0x38deab,_0x11c70d,_0x4538f0){var _0x13d3ae={'agent':{},'channel':'chat'};if(_0x38deab['body']['id']){delete _0x38deab[_0x5779('0x5b')]['id'];}_0x38deab[_0x5779('0x5b')][_0x5779('0x64')]=_0x38deab[_0x5779('0x5b')][_0x5779('0x64')]||_0x38deab[_0x5779('0x65')]['id'];_0x13d3ae[_0x5779('0x7d')]['id']=_0x38deab[_0x5779('0x5b')][_0x5779('0x64')];return db[_0x5779('0x3b')]['find']({'where':{'id':_0x38deab[_0x5779('0x5c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x11c70d,null))[_0x5779('0x36')](function(_0x2ede33){if(_0x2ede33){_0x13d3ae[_0x5779('0x28')]=_0x2ede33['get']({'plain':!![]});return db[_0x5779('0x67')]['find']({'where':{'id':_0x2ede33[_0x5779('0x7e')]}});}return null;})['then'](handleEntityNotFound(_0x11c70d,null))[_0x5779('0x36')](function(_0x503ed5){if(_0x503ed5){_0x13d3ae[_0x5779('0x69')]=_0x503ed5[_0x5779('0x66')]({'plain':!![]});interaction_log['info'](_0x5779('0x7f'),_0x38deab[_0x5779('0x65')]['id'],_0x38deab[_0x5779('0x65')][_0x5779('0x38')],_0x38deab[_0x5779('0x65')][_0x5779('0x80')],_0x13d3ae[_0x5779('0x69')]['id'],_0x38deab[_0x5779('0x5b')]?JSON[_0x5779('0x25')](_0x38deab[_0x5779('0x5b')]):_0x5779('0x6b'));return respondWithRpcPromise(_0x5779('0x81'),'rejectMessage',_0x13d3ae);}return null;})[_0x5779('0x36')](function(_0x329a3a){var _0x75c15=_0x5779('0x82')+_0x329a3a['message'][_0x5779('0x6e')];return db[_0x5779('0x83')][_0x5779('0x40')](_0x75c15,{'type':db[_0x5779('0x84')]['QueryTypes'][_0x5779('0x70')],'raw':!![]})[_0x5779('0x36')](function(_0x1b8468){return _0x1b8468;});})['then'](function(_0x449e97){if(_0x449e97){_0x13d3ae['message'][_0x5779('0x85')]=_0x449e97[0x0];if(!_0x38deab[_0x5779('0x5b')][_0x5779('0x64')])return;return db[_0x5779('0x86')]['find']({'where':{'id':_0x38deab[_0x5779('0x5b')][_0x5779('0x64')],'role':_0x5779('0x7d')},'attributes':['id',_0x5779('0x38'),_0x5779('0x71'),_0x5779('0x72'),_0x5779('0x87')],'raw':!![]});}return null;})['then'](function(_0x4242e3){if(!_0x4242e3)return null;_0x13d3ae[_0x5779('0x28')]['agent']=_0x4242e3;return _0x13d3ae;})['then'](function(_0x59618d){if(_0x59618d){_0x59618d['message'][_0x5779('0x88')]=util[_0x5779('0x74')](_0x5779('0x75'),_0x38deab[_0x5779('0x65')][_0x5779('0x38')]);_0x59618d[_0x5779('0x28')][_0x5779('0x76')]=_0x13d3ae['channel'];_0x59618d[_0x5779('0x28')]['motionChannel']=_0x13d3ae['channel'];_0x59618d[_0x5779('0x28')]['event']='reject';respondWithRpcPromise('EventManager',_0x5779('0x79'),{'event':'rejectmessage','message':_['merge'](_0x13d3ae[_0x5779('0x28')],JSON[_0x5779('0x7a')](_0x13d3ae[_0x5779('0x69')][_0x5779('0x7b')]))},client9002);return _0x13d3ae;}return null;})[_0x5779('0x36')](respondWithResult(_0x11c70d,null))['catch'](handleError(_0x11c70d,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index de91402..2a8f89e 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 _0x2d2b=['../../mysqldb','ChatMessage','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x124926,_0x1af73f){var _0x560e76=function(_0x18c60b){while(--_0x18c60b){_0x124926['push'](_0x124926['shift']());}};_0x560e76(++_0x1af73f);}(_0x2d2b,0x10d));var _0xb2d2=function(_0x23d78f,_0x37f247){_0x23d78f=_0x23d78f-0x0;var _0x11f02c=_0x2d2b[_0x23d78f];return _0x11f02c;};'use strict';var EventEmitter=require(_0xb2d2('0x0'));var ChatMessage=require(_0xb2d2('0x1'))['db'][_0xb2d2('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb2d2('0x3')](0x0);var events={'afterCreate':_0xb2d2('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b3705){return function(_0x1787f0,_0x2a2f59,_0x433109){ChatMessageEvents[_0xb2d2('0x5')](_0x1b3705+':'+_0x1787f0['id'],_0x1787f0);ChatMessageEvents[_0xb2d2('0x5')](_0x1b3705,_0x1787f0);_0x433109(null);};}for(var e in events){if(events[_0xb2d2('0x6')](e)){var event=events[e];ChatMessage[_0xb2d2('0x7')](e,emitEvent(event));}}module[_0xb2d2('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x11d2=['emit','hook','exports','../../mysqldb','ChatMessage','save','remove'];(function(_0x23dada,_0x38079a){var _0x47bc23=function(_0x413140){while(--_0x413140){_0x23dada['push'](_0x23dada['shift']());}};_0x47bc23(++_0x38079a);}(_0x11d2,0x1a7));var _0x211d=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x11d2[_0x26462c];return _0x509a42;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x211d('0x0'))['db'][_0x211d('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x211d('0x2'),'afterUpdate':'update','afterDestroy':_0x211d('0x3')};function emitEvent(_0x292c96){return function(_0x5b92bc,_0x393ed0,_0x1c16ae){ChatMessageEvents[_0x211d('0x4')](_0x292c96+':'+_0x5b92bc['id'],_0x5b92bc);ChatMessageEvents[_0x211d('0x4')](_0x292c96,_0x5b92bc);_0x1c16ae(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x211d('0x5')](e,emitEvent(event));}}module[_0x211d('0x6')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index b1c99cf..2fe2c32 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 _0xfb54=['./chatMessage.attributes','exports','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','findOne','ChatInteractionId','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x484156,_0x266ff1){var _0x5a4bef=function(_0x1894e0){while(--_0x1894e0){_0x484156['push'](_0x484156['shift']());}};_0x5a4bef(++_0x266ff1);}(_0xfb54,0x153));var _0x4fb5=function(_0xdc94d5,_0x2dbb36){_0xdc94d5=_0xdc94d5-0x0;var _0x5d9ef2=_0xfb54[_0xdc94d5];return _0x5d9ef2;};'use strict';var _=require(_0x4fb5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4fb5('0x1'));var BPromise=require(_0x4fb5('0x2'));var rp=require(_0x4fb5('0x3'));var fs=require('fs');var path=require(_0x4fb5('0x4'));var rimraf=require('rimraf');var config=require(_0x4fb5('0x5'));var attributes=require(_0x4fb5('0x6'));module[_0x4fb5('0x7')]=function(_0x14c042,_0x55a027){return _0x14c042['define']('ChatMessage',attributes,{'tableName':_0x4fb5('0x8'),'paranoid':![],'indexes':[{'name':_0x4fb5('0x9'),'fields':['body'],'type':_0x4fb5('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2814f6,_0x1c2b80,_0x38d9a5){var _0x1f9567=_0x14c042[_0x4fb5('0xb')];var _0x7eec35=_0x2814f6[_0x4fb5('0xc')]({'plain':!![]});if(_0x7eec35[_0x4fb5('0xd')][_0x4fb5('0xe')]()==='in'||_0x7eec35[_0x4fb5('0xd')][_0x4fb5('0xe')]()===_0x4fb5('0xf')&&!_0x7eec35[_0x4fb5('0x10')]&&!_[_0x4fb5('0x11')](_0x7eec35['UserId'])){_0x1f9567['ChatInteraction'][_0x4fb5('0x12')]({'where':{'id':_0x7eec35[_0x4fb5('0x13')]}})['then'](function(_0x36bf40){if(_0x36bf40){_0x36bf40['update']({'lastMsgAt':_0x7eec35[_0x4fb5('0x14')],'lastMsgDirection':_0x7eec35[_0x4fb5('0xd')][_0x4fb5('0xe')]()});}})['catch'](function(_0x169933){console['error'](_0x169933);});}_0x38d9a5();}},'charset':_0x4fb5('0x15'),'collate':_0x4fb5('0x16')});};
\ No newline at end of file
+var _0x0124=['request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','get','direction','toLowerCase','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2254bd,_0x486271){var _0x8bae47=function(_0x32d998){while(--_0x32d998){_0x2254bd['push'](_0x2254bd['shift']());}};_0x8bae47(++_0x486271);}(_0x0124,0x108));var _0x4012=function(_0x4b2873,_0x368dcc){_0x4b2873=_0x4b2873-0x0;var _0x169a18=_0x0124[_0x4b2873];return _0x169a18;};'use strict';var _=require(_0x4012('0x0'));var util=require(_0x4012('0x1'));var logger=require(_0x4012('0x2'))(_0x4012('0x3'));var moment=require(_0x4012('0x4'));var BPromise=require(_0x4012('0x5'));var rp=require(_0x4012('0x6'));var fs=require('fs');var path=require(_0x4012('0x7'));var rimraf=require('rimraf');var config=require(_0x4012('0x8'));var attributes=require(_0x4012('0x9'));module[_0x4012('0xa')]=function(_0x5e86cb,_0x3643cc){return _0x5e86cb[_0x4012('0xb')](_0x4012('0xc'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x4012('0xd'),'fields':[_0x4012('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1cbe47,_0x1f2528,_0x3640d5){var _0x4dcc9b=_0x5e86cb['models'];var _0xfc859a=_0x1cbe47[_0x4012('0xf')]({'plain':!![]});if(_0xfc859a[_0x4012('0x10')]['toLowerCase']()==='in'||_0xfc859a[_0x4012('0x10')][_0x4012('0x11')]()==='out'&&!_0xfc859a[_0x4012('0x12')]&&!_['isNil'](_0xfc859a[_0x4012('0x13')])){_0x4dcc9b[_0x4012('0x14')][_0x4012('0x15')]({'where':{'id':_0xfc859a[_0x4012('0x16')]}})[_0x4012('0x17')](function(_0x45122d){if(_0x45122d){_0x45122d['update']({'lastMsgAt':_0xfc859a[_0x4012('0x18')],'lastMsgDirection':_0xfc859a['direction'][_0x4012('0x11')]()});}})[_0x4012('0x19')](function(_0x3f4efb){console['error'](_0x3f4efb);});}_0x3640d5();}},'charset':_0x4012('0x1a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index d459845..83210e6 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 _0xbc22=['options','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatMessage.socket','register','request','then','request\x20sent','debug','stringify','error','ChatMessage,\x20%s,\x20%s','message','info','result','catch','CreateChatMessage','ChatMessage','body'];(function(_0x486341,_0x207631){var _0x5c7706=function(_0x4d8331){while(--_0x4d8331){_0x486341['push'](_0x486341['shift']());}};_0x5c7706(++_0x207631);}(_0xbc22,0x79));var _0x2bc2=function(_0x4a8bad,_0x4bfb2f){_0x4a8bad=_0x4a8bad-0x0;var _0x30cf32=_0xbc22[_0x4a8bad];return _0x30cf32;};'use strict';var _=require('lodash');var util=require(_0x2bc2('0x0'));var moment=require('moment');var BPromise=require(_0x2bc2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2bc2('0x2'));var db=require(_0x2bc2('0x3'))['db'];var utils=require(_0x2bc2('0x4'));var logger=require(_0x2bc2('0x5'))(_0x2bc2('0x6'));var config=require(_0x2bc2('0x7'));var jayson=require(_0x2bc2('0x8'));var client=jayson[_0x2bc2('0x9')]['http']({'port':0x232a});config[_0x2bc2('0xa')]=_[_0x2bc2('0xb')](config[_0x2bc2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x2bc2('0xc'))(new Redis(config[_0x2bc2('0xa')]));require(_0x2bc2('0xd'))[_0x2bc2('0xe')](socket);function respondWithRpcPromise(_0xeb4c0e,_0x31fb07,_0x3af1cf){return new BPromise(function(_0x540a15,_0x3224f4){return client[_0x2bc2('0xf')](_0xeb4c0e,_0x3af1cf)[_0x2bc2('0x10')](function(_0x20629c){logger['info']('ChatMessage,\x20%s,\x20%s',_0x31fb07,_0x2bc2('0x11'));logger[_0x2bc2('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x31fb07,_0x2bc2('0x11'),JSON[_0x2bc2('0x13')](_0x20629c));if(_0x20629c[_0x2bc2('0x14')]){if(_0x20629c[_0x2bc2('0x14')]['code']===0x1f4){logger[_0x2bc2('0x14')](_0x2bc2('0x15'),_0x31fb07,_0x20629c['error'][_0x2bc2('0x16')]);return _0x3224f4(_0x20629c[_0x2bc2('0x14')]['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x31fb07,_0x20629c['error'][_0x2bc2('0x16')]);return _0x540a15(_0x20629c['error'][_0x2bc2('0x16')]);}else{logger[_0x2bc2('0x17')]('ChatMessage,\x20%s,\x20%s',_0x31fb07,'request\x20sent');_0x540a15(_0x20629c[_0x2bc2('0x18')]['message']);}})[_0x2bc2('0x19')](function(_0x415992){logger[_0x2bc2('0x14')](_0x2bc2('0x15'),_0x31fb07,_0x415992);_0x3224f4(_0x415992);});});}exports[_0x2bc2('0x1a')]=function(_0x406333){var _0x54bb55=this;return new Promise(function(_0x358d22,_0x358065){return db[_0x2bc2('0x1b')]['create'](_0x406333[_0x2bc2('0x1c')],{'raw':_0x406333[_0x2bc2('0x1d')]?_0x406333[_0x2bc2('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x2bc2('0x10')](function(_0x523dc1){logger[_0x2bc2('0x17')](_0x2bc2('0x1a'),_0x406333);logger['debug'](_0x2bc2('0x1a'),_0x406333,JSON['stringify'](_0x523dc1));_0x358d22(_0x523dc1);})['catch'](function(_0x154885){logger['error'](_0x2bc2('0x1a'),_0x154885[_0x2bc2('0x16')],_0x406333);_0x358065(_0x54bb55['error'](0x1f4,_0x154885[_0x2bc2('0x16')]));});});};
\ No newline at end of file
+var _0xa34b=['localhost','socket.io-emitter','./chatMessage.socket','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','debug','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0xd99cf1,_0x249d57){var _0x18ea78=function(_0x17555f){while(--_0x17555f){_0xd99cf1['push'](_0xd99cf1['shift']());}};_0x18ea78(++_0x249d57);}(_0xa34b,0x6a));var _0xba34=function(_0x22ef44,_0x298742){_0x22ef44=_0x22ef44-0x0;var _0x56b740=_0xa34b[_0x22ef44];return _0x56b740;};'use strict';var _=require('lodash');var util=require(_0xba34('0x0'));var moment=require('moment');var BPromise=require(_0xba34('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba34('0x2'))['db'];var utils=require(_0xba34('0x3'));var logger=require(_0xba34('0x4'))(_0xba34('0x5'));var config=require(_0xba34('0x6'));var jayson=require(_0xba34('0x7'));var client=jayson['client'][_0xba34('0x8')]({'port':0x232a});config[_0xba34('0x9')]=_['defaults'](config[_0xba34('0x9')],{'host':_0xba34('0xa'),'port':0x18eb});var socket=require(_0xba34('0xb'))(new Redis(config[_0xba34('0x9')]));require(_0xba34('0xc'))['register'](socket);function respondWithRpcPromise(_0x341cbf,_0x912231,_0x7561cf){return new BPromise(function(_0x129853,_0x56b49a){return client['request'](_0x341cbf,_0x7561cf)[_0xba34('0xd')](function(_0xc4a874){logger[_0xba34('0xe')](_0xba34('0xf'),_0x912231,_0xba34('0x10'));logger['debug'](_0xba34('0x11'),_0x912231,'request\x20sent',JSON[_0xba34('0x12')](_0xc4a874));if(_0xc4a874['error']){if(_0xc4a874['error']['code']===0x1f4){logger['error'](_0xba34('0xf'),_0x912231,_0xc4a874['error']['message']);return _0x56b49a(_0xc4a874[_0xba34('0x13')][_0xba34('0x14')]);}logger[_0xba34('0x13')](_0xba34('0xf'),_0x912231,_0xc4a874[_0xba34('0x13')][_0xba34('0x14')]);return _0x129853(_0xc4a874['error']['message']);}else{logger[_0xba34('0xe')](_0xba34('0xf'),_0x912231,'request\x20sent');_0x129853(_0xc4a874[_0xba34('0x15')][_0xba34('0x14')]);}})[_0xba34('0x16')](function(_0x1c8391){logger[_0xba34('0x13')](_0xba34('0xf'),_0x912231,_0x1c8391);_0x56b49a(_0x1c8391);});});}exports[_0xba34('0x17')]=function(_0x3c36da){var _0x2bfff9=this;return new Promise(function(_0xc7942,_0x2e969c){return db[_0xba34('0x18')][_0xba34('0x19')](_0x3c36da['body'],{'raw':_0x3c36da[_0xba34('0x1a')]?_0x3c36da[_0xba34('0x1a')][_0xba34('0x1b')]===undefined?!![]:![]:!![]})[_0xba34('0xd')](function(_0x3ca1f5){logger['info']('CreateChatMessage',_0x3c36da);logger[_0xba34('0x1c')](_0xba34('0x17'),_0x3c36da,JSON[_0xba34('0x12')](_0x3ca1f5));_0xc7942(_0x3ca1f5);})[_0xba34('0x16')](function(_0x48d641){logger[_0xba34('0x13')](_0xba34('0x17'),_0x48d641[_0xba34('0x14')],_0x3c36da);_0x2e969c(_0x2bfff9[_0xba34('0x13')](0x1f4,_0x48d641[_0xba34('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 56817d0..f1f86bb 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 _0xcee8=['removeListener','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x4975c5,_0x1ca463){var _0x5ebf72=function(_0x3dfd32){while(--_0x3dfd32){_0x4975c5['push'](_0x4975c5['shift']());}};_0x5ebf72(++_0x1ca463);}(_0xcee8,0xb1));var _0x8cee=function(_0x455792,_0x374066){_0x455792=_0x455792-0x0;var _0x1fc9b2=_0xcee8[_0x455792];return _0x1fc9b2;};'use strict';var ChatMessageEvents=require(_0x8cee('0x0'));var events=[_0x8cee('0x1'),_0x8cee('0x2'),_0x8cee('0x3')];function createListener(_0x1c570c,_0x6608db){return function(_0x5b82bd){_0x6608db[_0x8cee('0x4')](_0x1c570c,_0x5b82bd);};}function removeListener(_0x4e4143,_0xffd42d){return function(){ChatMessageEvents[_0x8cee('0x5')](_0x4e4143,_0xffd42d);};}exports['register']=function(_0x295471){for(var _0xfea4e3=0x0,_0x4f57f1=events['length'];_0xfea4e3<_0x4f57f1;_0xfea4e3++){var _0x341c63=events[_0xfea4e3];var _0x49a070=createListener(_0x8cee('0x6')+_0x341c63,_0x295471);ChatMessageEvents['on'](_0x341c63,_0x49a070);}};
\ No newline at end of file
+var _0x1d25=['register','chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x1d25,0xba));var _0x51d2=function(_0x4429e0,_0xee6f1f){_0x4429e0=_0x4429e0-0x0;var _0x51a5b3=_0x1d25[_0x4429e0];return _0x51a5b3;};'use strict';var ChatMessageEvents=require(_0x51d2('0x0'));var events=[_0x51d2('0x1'),_0x51d2('0x2'),_0x51d2('0x3')];function createListener(_0x17f896,_0x5aac21){return function(_0x1b276e){_0x5aac21[_0x51d2('0x4')](_0x17f896,_0x1b276e);};}function removeListener(_0x4c93f2,_0x1f9fc8){return function(){ChatMessageEvents[_0x51d2('0x5')](_0x4c93f2,_0x1f9fc8);};}exports[_0x51d2('0x6')]=function(_0x407091){for(var _0x449fec=0x0,_0x2e6956=events['length'];_0x449fec<_0x2e6956;_0x449fec++){var _0x18e8a9=events[_0x449fec];var _0x5a6b5f=createListener(_0x51d2('0x7')+_0x18e8a9,_0x407091);ChatMessageEvents['on'](_0x18e8a9,_0x5a6b5f);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index c38ca6c..46b2fce 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 _0x12ca=['chatmessage:create','create','update','put','/:id/accept','accept','/:id/reject','destroy','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','chat'];(function(_0x4e680e,_0x5bcf97){var _0x48ee25=function(_0x49eccc){while(--_0x49eccc){_0x4e680e['push'](_0x4e680e['shift']());}};_0x48ee25(++_0x5bcf97);}(_0x12ca,0x134));var _0xa12c=function(_0x2abca8,_0x4c63d3){_0x2abca8=_0x2abca8-0x0;var _0x45d797=_0x12ca[_0x2abca8];return _0x45d797;};'use strict';var multer=require('multer');var util=require(_0xa12c('0x0'));var path=require(_0xa12c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa12c('0x2')]();var fs_extra=require(_0xa12c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa12c('0x4'));var config=require(_0xa12c('0x5'));var controller=require(_0xa12c('0x6'));router[_0xa12c('0x7')]('/',auth['isAuthenticated'](),controller[_0xa12c('0x8')]);router[_0xa12c('0x7')](_0xa12c('0x9'),auth[_0xa12c('0xa')](),controller[_0xa12c('0xb')]);router['get'](_0xa12c('0xc'),auth['isAuthenticated'](),controller[_0xa12c('0xd')]);router[_0xa12c('0xe')]('/',auth[_0xa12c('0xa')](),interaction[_0xa12c('0xf')](_0xa12c('0x10'),_0xa12c('0x11')),controller[_0xa12c('0x12')]);router['put']('/:id',controller[_0xa12c('0x13')]);router[_0xa12c('0x14')](_0xa12c('0x15'),auth[_0xa12c('0xa')](),controller[_0xa12c('0x16')]);router[_0xa12c('0x14')](_0xa12c('0x17'),auth[_0xa12c('0xa')](),controller['reject']);router['delete'](_0xa12c('0xc'),auth[_0xa12c('0xa')](),controller[_0xa12c('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0xe324=['chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','describe','/:id','show','post','tracked'];(function(_0x5ede26,_0x25019a){var _0x58b7dd=function(_0x51086f){while(--_0x51086f){_0x5ede26['push'](_0x5ede26['shift']());}};_0x58b7dd(++_0x25019a);}(_0xe324,0x184));var _0x4e32=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xe324[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require('multer');var util=require(_0x4e32('0x0'));var path=require(_0x4e32('0x1'));var timeout=require(_0x4e32('0x2'));var express=require(_0x4e32('0x3'));var router=express[_0x4e32('0x4')]();var fs_extra=require(_0x4e32('0x5'));var auth=require(_0x4e32('0x6'));var interaction=require(_0x4e32('0x7'));var config=require(_0x4e32('0x8'));var controller=require(_0x4e32('0x9'));router[_0x4e32('0xa')]('/',auth[_0x4e32('0xb')](),controller['index']);router['get']('/describe',auth[_0x4e32('0xb')](),controller[_0x4e32('0xc')]);router[_0x4e32('0xa')](_0x4e32('0xd'),auth[_0x4e32('0xb')](),controller[_0x4e32('0xe')]);router[_0x4e32('0xf')]('/',auth[_0x4e32('0xb')](),interaction[_0x4e32('0x10')](_0x4e32('0x11'),_0x4e32('0x12')),controller[_0x4e32('0x13')]);router[_0x4e32('0x14')]('/:id',controller[_0x4e32('0x15')]);router[_0x4e32('0x14')](_0x4e32('0x16'),auth[_0x4e32('0xb')](),controller[_0x4e32('0x17')]);router['put'](_0x4e32('0x18'),auth[_0x4e32('0xb')](),controller['reject']);router[_0x4e32('0x19')](_0x4e32('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x4e32('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index aedda8f..31e3620 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x45e5a3,_0x1c7c77){var _0x5ed3a9=function(_0x2d50b2){while(--_0x2d50b2){_0x45e5a3['push'](_0x45e5a3['shift']());}};_0x5ed3a9(++_0x1c7c77);}(_0xdb28,0x106));var _0x8db2=function(_0x3cd52e,_0x14377e){_0x3cd52e=_0x3cd52e-0x0;var _0x754e56=_0xdb28[_0x3cd52e];return _0x754e56;};'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
+var _0xb10b=['medium','sequelize','TEXT'];(function(_0x3ecc60,_0x548dfb){var _0x32b53c=function(_0x10935a){while(--_0x10935a){_0x3ecc60['push'](_0x3ecc60['shift']());}};_0x32b53c(++_0x548dfb);}(_0xb10b,0x12a));var _0xbb10=function(_0xabbd65,_0x546d99){_0xabbd65=_0xabbd65-0x0;var _0x1d005a=_0xb10b[_0xabbd65];return _0x1d005a;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index fdc87be..91a90f7 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a54,0x106));var _0x47a5=function(_0x48384c,_0x5e89a4){_0x48384c=_0x48384c-0x0;var _0x2f46e3=_0x7a54[_0x48384c];return _0x2f46e3;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x204c63,_0x17fb92){var _0x2f0039=function(_0x4e02d0){while(--_0x4e02d0){_0x204c63['push'](_0x204c63['shift']());}};_0x2f0039(++_0x17fb92);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 641aa12..e851675 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 _0xe899=['hasOwnProperty','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe899,0x1cc));var _0x9e89=function(_0x3f6e26,_0x811a34){_0x3f6e26=_0x3f6e26-0x0;var _0x474345=_0xe899[_0x3f6e26];return _0x474345;};'use strict';var EventEmitter=require(_0x9e89('0x0'));var ChatOfflineMessage=require(_0x9e89('0x1'))['db'][_0x9e89('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9e89('0x3')](0x0);var events={'afterCreate':_0x9e89('0x4'),'afterUpdate':_0x9e89('0x5'),'afterDestroy':_0x9e89('0x6')};function emitEvent(_0xc2aa22){return function(_0x5d129f,_0x277f6a,_0x1815f3){ChatOfflineMessageEvents['emit'](_0xc2aa22+':'+_0x5d129f['id'],_0x5d129f);ChatOfflineMessageEvents[_0x9e89('0x7')](_0xc2aa22,_0x5d129f);_0x1815f3(null);};}for(var e in events){if(events[_0x9e89('0x8')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x3c0c=['emit','hasOwnProperty','hook','exports','events','ChatOfflineMessage','save','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3c0c,0x94));var _0xc3c0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3c0c[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0xc3c0('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xc3c0('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc3c0('0x2'),'afterUpdate':'update','afterDestroy':_0xc3c0('0x3')};function emitEvent(_0x3915fc){return function(_0x315640,_0x83cf54,_0x578f19){ChatOfflineMessageEvents[_0xc3c0('0x4')](_0x3915fc+':'+_0x315640['id'],_0x315640);ChatOfflineMessageEvents['emit'](_0x3915fc,_0x315640);_0x578f19(null);};}for(var e in events){if(events[_0xc3c0('0x5')](e)){var event=events[e];ChatOfflineMessage[_0xc3c0('0x6')](e,emitEvent(event));}}module[_0xc3c0('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index b7bff3b..d81508b 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 _0x3c49=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x55bbe3,_0x5acd20){var _0x3d5455=function(_0x3a912f){while(--_0x3a912f){_0x55bbe3['push'](_0x55bbe3['shift']());}};_0x3d5455(++_0x5acd20);}(_0x3c49,0x1ed));var _0x93c4=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3c49[_0x1facfa];return _0x9ec701;};'use strict';var attributes=require(_0x93c4('0x0'));module[_0x93c4('0x1')]=function(_0x2fc691){return _0x2fc691[_0x93c4('0x2')](_0x93c4('0x3'),attributes,{'tableName':_0x93c4('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x93c4('0x5')});};
\ No newline at end of file
+var _0x2735=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x16acdd,_0x302f75){var _0x572c4c=function(_0x4071e9){while(--_0x4071e9){_0x16acdd['push'](_0x16acdd['shift']());}};_0x572c4c(++_0x302f75);}(_0x2735,0x12e));var _0x5273=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x2735[_0xc4001c];return _0x49f7bc;};'use strict';var attributes=require(_0x5273('0x0'));module[_0x5273('0x1')]=function(_0x5d4a4d){return _0x5d4a4d[_0x5273('0x2')](_0x5273('0x3'),attributes,{'tableName':_0x5273('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5273('0x5'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 5780917..5423ec0 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 _0x13c6=['ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','request','then','info'];(function(_0x499608,_0x187e5b){var _0x29eddf=function(_0x47ccfd){while(--_0x47ccfd){_0x499608['push'](_0x499608['shift']());}};_0x29eddf(++_0x187e5b);}(_0x13c6,0x94));var _0x613c=function(_0x179207,_0x3f1af5){_0x179207=_0x179207-0x0;var _0x5585c8=_0x13c6[_0x179207];return _0x5585c8;};'use strict';var _=require(_0x613c('0x0'));var util=require(_0x613c('0x1'));var moment=require(_0x613c('0x2'));var BPromise=require(_0x613c('0x3'));var rs=require(_0x613c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x613c('0x5'));var logger=require('../../config/logger')(_0x613c('0x6'));var config=require(_0x613c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x613c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x411bda,_0x266b12,_0x2d3865){return new BPromise(function(_0x2d99df,_0x3306ec){return client[_0x613c('0x9')](_0x411bda,_0x2d3865)[_0x613c('0xa')](function(_0x1dfa38){logger[_0x613c('0xb')](_0x613c('0xc'),_0x266b12,_0x613c('0xd'));logger[_0x613c('0xe')](_0x613c('0xf'),_0x266b12,'request\x20sent',JSON['stringify'](_0x1dfa38));if(_0x1dfa38['error']){if(_0x1dfa38[_0x613c('0x10')][_0x613c('0x11')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x266b12,_0x1dfa38[_0x613c('0x10')]['message']);return _0x3306ec(_0x1dfa38[_0x613c('0x10')][_0x613c('0x12')]);}logger[_0x613c('0x10')](_0x613c('0xc'),_0x266b12,_0x1dfa38[_0x613c('0x10')][_0x613c('0x12')]);return _0x2d99df(_0x1dfa38[_0x613c('0x10')][_0x613c('0x12')]);}else{logger['info'](_0x613c('0xc'),_0x266b12,_0x613c('0xd'));_0x2d99df(_0x1dfa38[_0x613c('0x13')][_0x613c('0x12')]);}})['catch'](function(_0x23e600){logger[_0x613c('0x10')](_0x613c('0xc'),_0x266b12,_0x23e600);_0x3306ec(_0x23e600);});});}
\ No newline at end of file
+var _0xbda9=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x7e1acb,_0x5a8b14){var _0x4c3e01=function(_0x362951){while(--_0x362951){_0x7e1acb['push'](_0x7e1acb['shift']());}};_0x4c3e01(++_0x5a8b14);}(_0xbda9,0x101));var _0x9bda=function(_0x13d3ca,_0x4c7214){_0x13d3ca=_0x13d3ca-0x0;var _0x3bd9b7=_0xbda9[_0x13d3ca];return _0x3bd9b7;};'use strict';var _=require(_0x9bda('0x0'));var util=require(_0x9bda('0x1'));var moment=require(_0x9bda('0x2'));var BPromise=require(_0x9bda('0x3'));var rs=require(_0x9bda('0x4'));var fs=require('fs');var Redis=require(_0x9bda('0x5'));var db=require(_0x9bda('0x6'))['db'];var utils=require(_0x9bda('0x7'));var logger=require(_0x9bda('0x8'))('rpc');var config=require(_0x9bda('0x9'));var jayson=require(_0x9bda('0xa'));var client=jayson[_0x9bda('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xaf199d,_0x537c1e,_0x5c2623){return new BPromise(function(_0x1f0a0d,_0x1933d4){return client['request'](_0xaf199d,_0x5c2623)[_0x9bda('0xc')](function(_0x360573){logger[_0x9bda('0xd')](_0x9bda('0xe'),_0x537c1e,_0x9bda('0xf'));logger[_0x9bda('0x10')](_0x9bda('0x11'),_0x537c1e,'request\x20sent',JSON[_0x9bda('0x12')](_0x360573));if(_0x360573[_0x9bda('0x13')]){if(_0x360573[_0x9bda('0x13')]['code']===0x1f4){logger[_0x9bda('0x13')](_0x9bda('0xe'),_0x537c1e,_0x360573[_0x9bda('0x13')]['message']);return _0x1933d4(_0x360573[_0x9bda('0x13')][_0x9bda('0x14')]);}logger[_0x9bda('0x13')](_0x9bda('0xe'),_0x537c1e,_0x360573[_0x9bda('0x13')][_0x9bda('0x14')]);return _0x1f0a0d(_0x360573[_0x9bda('0x13')][_0x9bda('0x14')]);}else{logger[_0x9bda('0xd')](_0x9bda('0xe'),_0x537c1e,_0x9bda('0xf'));_0x1f0a0d(_0x360573[_0x9bda('0x15')][_0x9bda('0x14')]);}})[_0x9bda('0x16')](function(_0x4cfaa2){logger[_0x9bda('0x13')](_0x9bda('0xe'),_0x537c1e,_0x4cfaa2);_0x1933d4(_0x4cfaa2);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 9fbc502..e568ee8 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 _0x03e0=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','isAuthenticated','describe','/:id','show','update','delete','multer'];(function(_0x217523,_0x5d793a){var _0x43e3e1=function(_0x477f77){while(--_0x477f77){_0x217523['push'](_0x217523['shift']());}};_0x43e3e1(++_0x5d793a);}(_0x03e0,0x1a8));var _0x003e=function(_0x3083d0,_0x4998ef){_0x3083d0=_0x3083d0-0x0;var _0x3abb1c=_0x03e0[_0x3083d0];return _0x3abb1c;};'use strict';var multer=require(_0x003e('0x0'));var util=require('util');var path=require(_0x003e('0x1'));var timeout=require('connect-timeout');var express=require(_0x003e('0x2'));var router=express[_0x003e('0x3')]();var fs_extra=require(_0x003e('0x4'));var auth=require(_0x003e('0x5'));var interaction=require(_0x003e('0x6'));var config=require(_0x003e('0x7'));var controller=require(_0x003e('0x8'));router[_0x003e('0x9')]('/',auth['isAuthenticated'](),controller[_0x003e('0xa')]);router[_0x003e('0x9')]('/describe',auth[_0x003e('0xb')](),controller[_0x003e('0xc')]);router[_0x003e('0x9')](_0x003e('0xd'),auth['isAuthenticated'](),controller[_0x003e('0xe')]);router['post']('/',auth[_0x003e('0xb')](),controller['create']);router['put'](_0x003e('0xd'),auth['isAuthenticated'](),controller[_0x003e('0xf')]);router[_0x003e('0x10')](_0x003e('0xd'),auth[_0x003e('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xb0db=['path','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','index','get','/describe','describe','isAuthenticated','post','create','put','update','/:id','destroy','exports','multer','util'];(function(_0x1cac1c,_0x310b72){var _0xefccb=function(_0x40771c){while(--_0x40771c){_0x1cac1c['push'](_0x1cac1c['shift']());}};_0xefccb(++_0x310b72);}(_0xb0db,0x8a));var _0xbb0d=function(_0x1dab8c,_0x2fd0a0){_0x1dab8c=_0x1dab8c-0x0;var _0x44ffab=_0xb0db[_0x1dab8c];return _0x44ffab;};'use strict';var multer=require(_0xbb0d('0x0'));var util=require(_0xbb0d('0x1'));var path=require(_0xbb0d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbb0d('0x3')]();var fs_extra=require(_0xbb0d('0x4'));var auth=require(_0xbb0d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbb0d('0x6'));var controller=require(_0xbb0d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb0d('0x8')]);router[_0xbb0d('0x9')](_0xbb0d('0xa'),auth['isAuthenticated'](),controller[_0xbb0d('0xb')]);router[_0xbb0d('0x9')]('/:id',auth[_0xbb0d('0xc')](),controller['show']);router[_0xbb0d('0xd')]('/',auth[_0xbb0d('0xc')](),controller[_0xbb0d('0xe')]);router[_0xbb0d('0xf')]('/:id',auth[_0xbb0d('0xc')](),controller[_0xbb0d('0x10')]);router['delete'](_0xbb0d('0x11'),auth[_0xbb0d('0xc')](),controller[_0xbb0d('0x12')]);module[_0xbb0d('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 3808878..21902a8 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 _0x9a24=['INTEGER','exports','STRING','ENUM','mouseOver'];(function(_0x7fb404,_0x35907e){var _0x14d9c1=function(_0x1b0e69){while(--_0x1b0e69){_0x7fb404['push'](_0x7fb404['shift']());}};_0x14d9c1(++_0x35907e);}(_0x9a24,0x1d7));var _0x49a2=function(_0x1f2696,_0x22ea03){_0x1f2696=_0x1f2696-0x0;var _0x73a5fa=_0x9a24[_0x1f2696];return _0x73a5fa;};'use strict';var Sequelize=require('sequelize');module[_0x49a2('0x0')]={'name':{'type':Sequelize[_0x49a2('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49a2('0x2')](_0x49a2('0x3'),'timeout'),'defaultValue':_0x49a2('0x3')},'selector':{'type':Sequelize[_0x49a2('0x1')]},'timeout':{'type':Sequelize[_0x49a2('0x4')]}};
\ No newline at end of file
+var _0x27c1=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x27c1,0xc7));var _0x127c=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x27c1[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0x127c('0x0'));module[_0x127c('0x1')]={'name':{'type':Sequelize[_0x127c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x127c('0x3')](_0x127c('0x4'),'timeout'),'defaultValue':_0x127c('0x4')},'selector':{'type':Sequelize[_0x127c('0x2')]},'timeout':{'type':Sequelize[_0x127c('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index ee22bc6..6ae8841 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 _0xc3a8=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','show','params','keys','ChatProactiveAction','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','catch','create','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc3a8,0xe8));var _0x8c3a=function(_0x16eb61,_0x43dfa2){_0x16eb61=_0x16eb61-0x0;var _0x46905c=_0xc3a8[_0x16eb61];return _0x46905c;};'use strict';var emlformat=require(_0x8c3a('0x0'));var rimraf=require(_0x8c3a('0x1'));var zipdir=require(_0x8c3a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c3a('0x3'));var moment=require('moment');var BPromise=require(_0x8c3a('0x4'));var Mustache=require(_0x8c3a('0x5'));var util=require(_0x8c3a('0x6'));var path=require(_0x8c3a('0x7'));var sox=require('sox');var csv=require(_0x8c3a('0x8'));var ejs=require(_0x8c3a('0x9'));var fs=require('fs');var fs_extra=require(_0x8c3a('0xa'));var _=require(_0x8c3a('0xb'));var squel=require(_0x8c3a('0xc'));var crypto=require(_0x8c3a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8c3a('0xe'));var toCsv=require(_0x8c3a('0x8'));var querystring=require(_0x8c3a('0xf'));var Papa=require(_0x8c3a('0x10'));var Redis=require(_0x8c3a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c3a('0x12'));var as=require(_0x8c3a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c3a('0x14'))(_0x8c3a('0x15'));var utils=require(_0x8c3a('0x16'));var config=require(_0x8c3a('0x17'));var licenseUtil=require(_0x8c3a('0x18'));var db=require(_0x8c3a('0x19'))['db'];function respondWithStatusCode(_0x5eb124,_0x99edce){_0x99edce=_0x99edce||0xcc;return function(_0x57e0ec){if(_0x57e0ec){return _0x5eb124['sendStatus'](_0x99edce);}return _0x5eb124[_0x8c3a('0x1a')](_0x99edce)[_0x8c3a('0x1b')]();};}function respondWithResult(_0x271d3d,_0x31f3d4){_0x31f3d4=_0x31f3d4||0xc8;return function(_0x290298){if(_0x290298){return _0x271d3d[_0x8c3a('0x1a')](_0x31f3d4)[_0x8c3a('0x1c')](_0x290298);}};}function respondWithFilteredResult(_0x513e00,_0x43b853){return function(_0x5be4ea){if(_0x5be4ea){var _0x1d8b7b=typeof _0x43b853[_0x8c3a('0x1d')]===_0x8c3a('0x1e')&&typeof _0x43b853[_0x8c3a('0x1f')]===_0x8c3a('0x1e');var _0x54fe05=_0x5be4ea['count'];var _0x51acdb=_0x1d8b7b?0x0:_0x43b853['offset'];var _0x29502b=_0x1d8b7b?_0x5be4ea[_0x8c3a('0x20')]:_0x43b853[_0x8c3a('0x1d')]+_0x43b853[_0x8c3a('0x1f')];var _0x365ab8;if(_0x29502b>=_0x54fe05){_0x29502b=_0x54fe05;_0x365ab8=0xc8;}else{_0x365ab8=0xce;}_0x513e00[_0x8c3a('0x1a')](_0x365ab8);return _0x513e00['set'](_0x8c3a('0x21'),_0x51acdb+'-'+_0x29502b+'/'+_0x54fe05)[_0x8c3a('0x1c')](_0x5be4ea);}return null;};}function patchUpdates(_0x4f77df){return function(_0x1590a7){try{jsonpatch['apply'](_0x1590a7,_0x4f77df,!![]);}catch(_0x3efbc4){return BPromise[_0x8c3a('0x22')](_0x3efbc4);}return _0x1590a7[_0x8c3a('0x23')]();};}function saveUpdates(_0x58ca7a,_0x429ca6){return function(_0xb78cfc){if(_0xb78cfc){return _0xb78cfc[_0x8c3a('0x24')](_0x58ca7a)[_0x8c3a('0x25')](function(_0x718982){return _0x718982;});}return null;};}function removeEntity(_0x3c5f12,_0x427917){return function(_0x5546c3){if(_0x5546c3){return _0x5546c3[_0x8c3a('0x26')]()['then'](function(){_0x3c5f12[_0x8c3a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb9f4bf,_0xe50c44){return function(_0x530e9c){if(!_0x530e9c){_0xb9f4bf[_0x8c3a('0x27')](0x194);}return _0x530e9c;};}function handleError(_0x4a1c24,_0x9cc5a8){_0x9cc5a8=_0x9cc5a8||0x1f4;return function(_0x295fb9){logger[_0x8c3a('0x28')](_0x295fb9['stack']);if(_0x295fb9['name']){delete _0x295fb9[_0x8c3a('0x29')];}_0x4a1c24[_0x8c3a('0x1a')](_0x9cc5a8)['send'](_0x295fb9);};}exports[_0x8c3a('0x2a')]=function(_0x2f77b1,_0x4ae1e4){var _0xd5353d={'raw':!![],'where':{'id':_0x2f77b1[_0x8c3a('0x2b')]['id']}},_0x31cad9={};_0x31cad9['model']=_[_0x8c3a('0x2c')](db[_0x8c3a('0x2d')]['rawAttributes']);_0x31cad9[_0x8c3a('0x2e')]=_[_0x8c3a('0x2c')](_0x2f77b1['query']);_0x31cad9[_0x8c3a('0x2f')]=_[_0x8c3a('0x30')](_0x31cad9[_0x8c3a('0x31')],_0x31cad9['query']);_0xd5353d[_0x8c3a('0x32')]=_[_0x8c3a('0x30')](_0x31cad9[_0x8c3a('0x31')],qs[_0x8c3a('0x33')](_0x2f77b1['query']['fields']));_0xd5353d[_0x8c3a('0x32')]=_0xd5353d[_0x8c3a('0x32')][_0x8c3a('0x34')]?_0xd5353d[_0x8c3a('0x32')]:_0x31cad9[_0x8c3a('0x31')];if(_0x2f77b1['query'][_0x8c3a('0x35')]){_0xd5353d[_0x8c3a('0x36')]=[{'all':!![]}];}_0xd5353d=_[_0x8c3a('0x37')]({},_0xd5353d,_0x2f77b1[_0x8c3a('0x38')]);return db[_0x8c3a('0x2d')]['find'](_0xd5353d)[_0x8c3a('0x25')](handleEntityNotFound(_0x4ae1e4,null))['then'](respondWithResult(_0x4ae1e4,null))[_0x8c3a('0x39')](handleError(_0x4ae1e4,null));};exports['create']=function(_0x8170c1,_0x51aa22){return db[_0x8c3a('0x2d')][_0x8c3a('0x3a')](_0x8170c1[_0x8c3a('0x3b')],{})[_0x8c3a('0x25')](respondWithResult(_0x51aa22,0xc9))['catch'](handleError(_0x51aa22,null));};exports[_0x8c3a('0x24')]=function(_0x3bf20b,_0x3586e2){if(_0x3bf20b['body']['id']){delete _0x3bf20b[_0x8c3a('0x3b')]['id'];}return db[_0x8c3a('0x2d')][_0x8c3a('0x3c')]({'where':{'id':_0x3bf20b[_0x8c3a('0x2b')]['id']}})[_0x8c3a('0x25')](handleEntityNotFound(_0x3586e2,null))[_0x8c3a('0x25')](saveUpdates(_0x3bf20b[_0x8c3a('0x3b')],null))[_0x8c3a('0x25')](respondWithResult(_0x3586e2,null))[_0x8c3a('0x39')](handleError(_0x3586e2,null));};exports[_0x8c3a('0x26')]=function(_0x3ae65c,_0x582cdc){return db[_0x8c3a('0x2d')][_0x8c3a('0x3c')]({'where':{'id':_0x3ae65c[_0x8c3a('0x2b')]['id']}})['then'](handleEntityNotFound(_0x582cdc,null))[_0x8c3a('0x25')](removeEntity(_0x582cdc,null))['catch'](handleError(_0x582cdc,null));};
\ No newline at end of file
+var _0xb90d=['count','offset','set','apply','reject','update','destroy','then','end','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit'];(function(_0x2eec0b,_0x43753b){var _0x5b86e9=function(_0x2c66e8){while(--_0x2c66e8){_0x2eec0b['push'](_0x2eec0b['shift']());}};_0x5b86e9(++_0x43753b);}(_0xb90d,0x17a));var _0xdb90=function(_0x33539a,_0xab9aa5){_0x33539a=_0x33539a-0x0;var _0x1a99a7=_0xb90d[_0x33539a];return _0x1a99a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb90('0x0'));var zipdir=require(_0xdb90('0x1'));var jsonpatch=require(_0xdb90('0x2'));var rp=require(_0xdb90('0x3'));var moment=require(_0xdb90('0x4'));var BPromise=require(_0xdb90('0x5'));var Mustache=require('mustache');var util=require(_0xdb90('0x6'));var path=require(_0xdb90('0x7'));var sox=require(_0xdb90('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb90('0x9'));var _=require(_0xdb90('0xa'));var squel=require(_0xdb90('0xb'));var crypto=require(_0xdb90('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdb90('0xd'));var toCsv=require(_0xdb90('0xe'));var querystring=require(_0xdb90('0xf'));var Papa=require('papaparse');var Redis=require(_0xdb90('0x10'));var authService=require(_0xdb90('0x11'));var qs=require(_0xdb90('0x12'));var as=require(_0xdb90('0x13'));var hardwareService=require(_0xdb90('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xdb90('0x15'));var licenseUtil=require(_0xdb90('0x16'));var db=require(_0xdb90('0x17'))['db'];function respondWithStatusCode(_0xb5ea64,_0xdc179e){_0xdc179e=_0xdc179e||0xcc;return function(_0x113659){if(_0x113659){return _0xb5ea64['sendStatus'](_0xdc179e);}return _0xb5ea64['status'](_0xdc179e)['end']();};}function respondWithResult(_0x511592,_0x569d40){_0x569d40=_0x569d40||0xc8;return function(_0x5eb6ef){if(_0x5eb6ef){return _0x511592[_0xdb90('0x18')](_0x569d40)[_0xdb90('0x19')](_0x5eb6ef);}};}function respondWithFilteredResult(_0x5b93b1,_0x19b02e){return function(_0x1cde0d){if(_0x1cde0d){var _0x4db002=typeof _0x19b02e['offset']===_0xdb90('0x1a')&&typeof _0x19b02e[_0xdb90('0x1b')]===_0xdb90('0x1a');var _0x5101e9=_0x1cde0d[_0xdb90('0x1c')];var _0x13f6df=_0x4db002?0x0:_0x19b02e[_0xdb90('0x1d')];var _0x44d4d4=_0x4db002?_0x1cde0d[_0xdb90('0x1c')]:_0x19b02e[_0xdb90('0x1d')]+_0x19b02e[_0xdb90('0x1b')];var _0x1838ed;if(_0x44d4d4>=_0x5101e9){_0x44d4d4=_0x5101e9;_0x1838ed=0xc8;}else{_0x1838ed=0xce;}_0x5b93b1[_0xdb90('0x18')](_0x1838ed);return _0x5b93b1[_0xdb90('0x1e')]('Content-Range',_0x13f6df+'-'+_0x44d4d4+'/'+_0x5101e9)['json'](_0x1cde0d);}return null;};}function patchUpdates(_0x4110c7){return function(_0x1c2dbe){try{jsonpatch[_0xdb90('0x1f')](_0x1c2dbe,_0x4110c7,!![]);}catch(_0x13f84d){return BPromise[_0xdb90('0x20')](_0x13f84d);}return _0x1c2dbe['save']();};}function saveUpdates(_0x31f9df,_0x922395){return function(_0x590e6a){if(_0x590e6a){return _0x590e6a[_0xdb90('0x21')](_0x31f9df)['then'](function(_0x185b08){return _0x185b08;});}return null;};}function removeEntity(_0x2fdb1b,_0x1fe5ab){return function(_0x463199){if(_0x463199){return _0x463199[_0xdb90('0x22')]()[_0xdb90('0x23')](function(){_0x2fdb1b[_0xdb90('0x18')](0xcc)[_0xdb90('0x24')]();});}};}function handleEntityNotFound(_0x1ef44a,_0x1fed39){return function(_0x64268c){if(!_0x64268c){_0x1ef44a['sendStatus'](0x194);}return _0x64268c;};}function handleError(_0x1a27c3,_0xedb1a6){_0xedb1a6=_0xedb1a6||0x1f4;return function(_0x3fcafd){logger['error'](_0x3fcafd['stack']);if(_0x3fcafd[_0xdb90('0x25')]){delete _0x3fcafd[_0xdb90('0x25')];}_0x1a27c3[_0xdb90('0x18')](_0xedb1a6)[_0xdb90('0x26')](_0x3fcafd);};}exports[_0xdb90('0x27')]=function(_0x321efc,_0x46f743){var _0x67aebc={'raw':!![],'where':{'id':_0x321efc[_0xdb90('0x28')]['id']}},_0x554d8f={};_0x554d8f[_0xdb90('0x29')]=_[_0xdb90('0x2a')](db[_0xdb90('0x2b')][_0xdb90('0x2c')]);_0x554d8f[_0xdb90('0x2d')]=_[_0xdb90('0x2a')](_0x321efc[_0xdb90('0x2d')]);_0x554d8f[_0xdb90('0x2e')]=_[_0xdb90('0x2f')](_0x554d8f[_0xdb90('0x29')],_0x554d8f[_0xdb90('0x2d')]);_0x67aebc[_0xdb90('0x30')]=_[_0xdb90('0x2f')](_0x554d8f['model'],qs[_0xdb90('0x31')](_0x321efc[_0xdb90('0x2d')][_0xdb90('0x31')]));_0x67aebc[_0xdb90('0x30')]=_0x67aebc[_0xdb90('0x30')][_0xdb90('0x32')]?_0x67aebc[_0xdb90('0x30')]:_0x554d8f[_0xdb90('0x29')];if(_0x321efc[_0xdb90('0x2d')][_0xdb90('0x33')]){_0x67aebc['include']=[{'all':!![]}];}_0x67aebc=_[_0xdb90('0x34')]({},_0x67aebc,_0x321efc[_0xdb90('0x35')]);return db['ChatProactiveAction'][_0xdb90('0x36')](_0x67aebc)[_0xdb90('0x23')](handleEntityNotFound(_0x46f743,null))[_0xdb90('0x23')](respondWithResult(_0x46f743,null))[_0xdb90('0x37')](handleError(_0x46f743,null));};exports[_0xdb90('0x38')]=function(_0x579279,_0x430c37){return db[_0xdb90('0x2b')][_0xdb90('0x38')](_0x579279['body'],{})[_0xdb90('0x23')](respondWithResult(_0x430c37,0xc9))[_0xdb90('0x37')](handleError(_0x430c37,null));};exports['update']=function(_0x42d6ff,_0x2b2942){if(_0x42d6ff[_0xdb90('0x39')]['id']){delete _0x42d6ff[_0xdb90('0x39')]['id'];}return db['ChatProactiveAction'][_0xdb90('0x36')]({'where':{'id':_0x42d6ff[_0xdb90('0x28')]['id']}})['then'](handleEntityNotFound(_0x2b2942,null))['then'](saveUpdates(_0x42d6ff[_0xdb90('0x39')],null))[_0xdb90('0x23')](respondWithResult(_0x2b2942,null))[_0xdb90('0x37')](handleError(_0x2b2942,null));};exports[_0xdb90('0x22')]=function(_0x49c745,_0x13ae1b){return db['ChatProactiveAction']['find']({'where':{'id':_0x49c745['params']['id']}})[_0xdb90('0x23')](handleEntityNotFound(_0x13ae1b,null))[_0xdb90('0x23')](removeEntity(_0x13ae1b,null))[_0xdb90('0x37')](handleError(_0x13ae1b,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index b55d3cf..bf5793b 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 _0xc5b5=['../../config/logger','moment','path','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash'];(function(_0x671369,_0x433da5){var _0x33f2b4=function(_0x2e9db2){while(--_0x2e9db2){_0x671369['push'](_0x671369['shift']());}};_0x33f2b4(++_0x433da5);}(_0xc5b5,0x1c1));var _0x5c5b=function(_0x490c02,_0x2faa1b){_0x490c02=_0x490c02-0x0;var _0x4604ab=_0xc5b5[_0x490c02];return _0x4604ab;};'use strict';var _=require(_0x5c5b('0x0'));var util=require('util');var logger=require(_0x5c5b('0x1'))('api');var moment=require(_0x5c5b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5c5b('0x3'));var rimraf=require(_0x5c5b('0x4'));var config=require('../../config/environment');var attributes=require(_0x5c5b('0x5'));module['exports']=function(_0x570087,_0x49d5ee){return _0x570087[_0x5c5b('0x6')](_0x5c5b('0x7'),attributes,{'tableName':_0x5c5b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7575=['exports','define','ChatProactiveAction','chat_proactive_actions','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x22ca9e,_0x2f6d54){var _0x3cb526=function(_0x3241e9){while(--_0x3241e9){_0x22ca9e['push'](_0x22ca9e['shift']());}};_0x3cb526(++_0x2f6d54);}(_0x7575,0x185));var _0x5757=function(_0x36775c,_0x33e992){_0x36775c=_0x36775c-0x0;var _0x31ff61=_0x7575[_0x36775c];return _0x31ff61;};'use strict';var _=require(_0x5757('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5757('0x1'));var moment=require(_0x5757('0x2'));var BPromise=require(_0x5757('0x3'));var rp=require(_0x5757('0x4'));var fs=require('fs');var path=require(_0x5757('0x5'));var rimraf=require(_0x5757('0x6'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0x5757('0x7')]=function(_0x494c01,_0x910b2d){return _0x494c01[_0x5757('0x8')](_0x5757('0x9'),attributes,{'tableName':_0x5757('0xa'),'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 8e882c3..3f672d8 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 _0xa54f=['../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xa54f,0x1e9));var _0xfa54=function(_0x27694f,_0x150986){_0x27694f=_0x27694f-0x0;var _0xce032d=_0xa54f[_0x27694f];return _0xce032d;};'use strict';var _=require(_0xfa54('0x0'));var util=require('util');var moment=require(_0xfa54('0x1'));var BPromise=require(_0xfa54('0x2'));var rs=require(_0xfa54('0x3'));var fs=require('fs');var Redis=require(_0xfa54('0x4'));var db=require(_0xfa54('0x5'))['db'];var utils=require(_0xfa54('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfa54('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa54('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10afa6,_0x4bb498,_0x1a69bf){return new BPromise(function(_0x4befd7,_0x5777bb){return client[_0xfa54('0x9')](_0x10afa6,_0x1a69bf)[_0xfa54('0xa')](function(_0x362544){logger[_0xfa54('0xb')](_0xfa54('0xc'),_0x4bb498,_0xfa54('0xd'));logger[_0xfa54('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4bb498,_0xfa54('0xd'),JSON['stringify'](_0x362544));if(_0x362544[_0xfa54('0xf')]){if(_0x362544[_0xfa54('0xf')][_0xfa54('0x10')]===0x1f4){logger['error'](_0xfa54('0xc'),_0x4bb498,_0x362544['error'][_0xfa54('0x11')]);return _0x5777bb(_0x362544[_0xfa54('0xf')][_0xfa54('0x11')]);}logger[_0xfa54('0xf')](_0xfa54('0xc'),_0x4bb498,_0x362544['error'][_0xfa54('0x11')]);return _0x4befd7(_0x362544['error'][_0xfa54('0x11')]);}else{logger[_0xfa54('0xb')](_0xfa54('0xc'),_0x4bb498,_0xfa54('0xd'));_0x4befd7(_0x362544[_0xfa54('0x12')]['message']);}})['catch'](function(_0x5ef68f){logger[_0xfa54('0xf')](_0xfa54('0xc'),_0x4bb498,_0x5ef68f);_0x5777bb(_0x5ef68f);});});}
\ No newline at end of file
+var _0x534d=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0x534d,0xa4));var _0xd534=function(_0x1c2878,_0x4986a3){_0x1c2878=_0x1c2878-0x0;var _0xa73f7c=_0x534d[_0x1c2878];return _0xa73f7c;};'use strict';var _=require(_0xd534('0x0'));var util=require(_0xd534('0x1'));var moment=require(_0xd534('0x2'));var BPromise=require('bluebird');var rs=require(_0xd534('0x3'));var fs=require('fs');var Redis=require(_0xd534('0x4'));var db=require(_0xd534('0x5'))['db'];var utils=require(_0xd534('0x6'));var logger=require(_0xd534('0x7'))(_0xd534('0x8'));var config=require(_0xd534('0x9'));var jayson=require(_0xd534('0xa'));var client=jayson[_0xd534('0xb')][_0xd534('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x51a998,_0x56b8fa,_0x176c2c){return new BPromise(function(_0x2ec633,_0x5c5410){return client['request'](_0x51a998,_0x176c2c)[_0xd534('0xd')](function(_0x33512b){logger[_0xd534('0xe')](_0xd534('0xf'),_0x56b8fa,'request\x20sent');logger['debug'](_0xd534('0x10'),_0x56b8fa,_0xd534('0x11'),JSON['stringify'](_0x33512b));if(_0x33512b[_0xd534('0x12')]){if(_0x33512b[_0xd534('0x12')][_0xd534('0x13')]===0x1f4){logger[_0xd534('0x12')](_0xd534('0xf'),_0x56b8fa,_0x33512b['error'][_0xd534('0x14')]);return _0x5c5410(_0x33512b[_0xd534('0x12')][_0xd534('0x14')]);}logger[_0xd534('0x12')](_0xd534('0xf'),_0x56b8fa,_0x33512b[_0xd534('0x12')][_0xd534('0x14')]);return _0x2ec633(_0x33512b[_0xd534('0x12')][_0xd534('0x14')]);}else{logger[_0xd534('0xe')](_0xd534('0xf'),_0x56b8fa,'request\x20sent');_0x2ec633(_0x33512b[_0xd534('0x15')]['message']);}})[_0xd534('0x16')](function(_0x569dc2){logger[_0xd534('0x12')](_0xd534('0xf'),_0x56b8fa,_0x569dc2);_0x5c5410(_0x569dc2);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index f6db09f..0ff0799 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 _0x55ca=['multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','destroy','exports'];(function(_0x5f031a,_0x3f65cd){var _0x1a777a=function(_0x549230){while(--_0x549230){_0x5f031a['push'](_0x5f031a['shift']());}};_0x1a777a(++_0x3f65cd);}(_0x55ca,0x126));var _0xa55c=function(_0x1d291d,_0x17314a){_0x1d291d=_0x1d291d-0x0;var _0x44cc4e=_0x55ca[_0x1d291d];return _0x44cc4e;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')](_0xa55c('0x8'),auth[_0xa55c('0x9')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x9')](),controller[_0xa55c('0xb')]);router['put'](_0xa55c('0x8'),auth[_0xa55c('0x9')](),controller['update']);router['delete'](_0xa55c('0x8'),auth[_0xa55c('0x9')](),controller[_0xa55c('0xc')]);module[_0xa55c('0xd')]=router;
\ No newline at end of file
+var _0xee14=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x3e2735,_0x802dae){var _0x31421b=function(_0x115b72){while(--_0x115b72){_0x3e2735['push'](_0x3e2735['shift']());}};_0x31421b(++_0x802dae);}(_0xee14,0x13a));var _0x4ee1=function(_0x547577,_0x2b4c0d){_0x547577=_0x547577-0x0;var _0x5072d0=_0xee14[_0x547577];return _0x5072d0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee1('0x0'));var timeout=require(_0x4ee1('0x1'));var express=require(_0x4ee1('0x2'));var router=express[_0x4ee1('0x3')]();var fs_extra=require(_0x4ee1('0x4'));var auth=require(_0x4ee1('0x5'));var interaction=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var controller=require(_0x4ee1('0x8'));router['get'](_0x4ee1('0x9'),auth['isAuthenticated'](),controller[_0x4ee1('0xa')]);router[_0x4ee1('0xb')]('/',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0xd')]);router[_0x4ee1('0xe')](_0x4ee1('0x9'),auth['isAuthenticated'](),controller[_0x4ee1('0xf')]);router[_0x4ee1('0x10')]('/:id',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x11')]);module[_0x4ee1('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 83e1cb0..afe2e62 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 _0x46c8=['sequelize','STRING','name','ENUM','beepall','roundrobin'];(function(_0x16eec5,_0x46b882){var _0x470ec8=function(_0x4592cf){while(--_0x4592cf){_0x16eec5['push'](_0x16eec5['shift']());}};_0x470ec8(++_0x46b882);}(_0x46c8,0x108));var _0x846c=function(_0x223a62,_0xbd9202){_0x223a62=_0x223a62-0x0;var _0x582902=_0x46c8[_0x223a62];return _0x582902;};'use strict';var Sequelize=require(_0x846c('0x0'));module['exports']={'name':{'type':Sequelize[_0x846c('0x1')],'unique':_0x846c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x846c('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x846c('0x3')]('rrmemory',_0x846c('0x4'),_0x846c('0x5'))}};
\ No newline at end of file
+var _0x2479=['INTEGER','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x1b775d,_0x4b3506){var _0x524480=function(_0x1f74f7){while(--_0x1f74f7){_0x1b775d['push'](_0x1b775d['shift']());}};_0x524480(++_0x4b3506);}(_0x2479,0x73));var _0x9247=function(_0x52ca9f,_0x4143eb){_0x52ca9f=_0x52ca9f-0x0;var _0x50e7d4=_0x2479[_0x52ca9f];return _0x50e7d4;};'use strict';var Sequelize=require(_0x9247('0x0'));module[_0x9247('0x1')]={'name':{'type':Sequelize[_0x9247('0x2')],'unique':_0x9247('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9247('0x2')]},'timeout':{'type':Sequelize[_0x9247('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x9247('0x5'),_0x9247('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 72b5141..c37c09c 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 _0xede7=['forEach','emit','userChatQueue:save','removeTeams','ids','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','every','TeamId','includes','all','union','value','isEmpty','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','ChatQueues','UserProfileResource','error','name','send','map','key','getOptions','ChatQueue','include','query','findAll','rows','catch','show','model','keys','rawAttributes','filters','intersection','fields','attributes','length','includeAll','merge','find','create','body','user','get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserChatQueue','hasOwnProperty','nolimit','order','sort','where','pick','ChatQueueId','filter','options','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','Agents','online','voicePause','flatMap','sequelize','transaction','findOrCreate'];(function(_0x76dd04,_0x3435b2){var _0x169555=function(_0x1319f6){while(--_0x1319f6){_0x76dd04['push'](_0x76dd04['shift']());}};_0x169555(++_0x3435b2);}(_0xede7,0x187));var _0x7ede=function(_0x398bdb,_0x1d0c93){_0x398bdb=_0x398bdb-0x0;var _0x7ec9a4=_0xede7[_0x398bdb];return _0x7ec9a4;};'use strict';var BPromise=require(_0x7ede('0x0'));var util=require('util');var _=require(_0x7ede('0x1'));var squel=require(_0x7ede('0x2'));var Redis=require(_0x7ede('0x3'));var qs=require(_0x7ede('0x4'));var logger=require(_0x7ede('0x5'))(_0x7ede('0x6'));var config=require('../../config/environment');var db=require(_0x7ede('0x7'))['db'];config[_0x7ede('0x8')]=_[_0x7ede('0x9')](config['redis'],{'host':_0x7ede('0xa'),'port':0x18eb});var socket=require(_0x7ede('0xb'))(new Redis(config[_0x7ede('0x8')]));require(_0x7ede('0xc'))[_0x7ede('0xd')](socket);function respondWithStatusCode(_0x944e0b,_0x2ba383){_0x2ba383=_0x2ba383||0xcc;return function(_0xe75dd9){if(_0xe75dd9){return _0x944e0b[_0x7ede('0xe')](_0x2ba383);}return _0x944e0b[_0x7ede('0xf')](_0x2ba383)[_0x7ede('0x10')]();};}function respondWithResult(_0x2ea530,_0x5bc2f9){_0x5bc2f9=_0x5bc2f9||0xc8;return function(_0x2c6517){if(_0x2c6517){return _0x2ea530['status'](_0x5bc2f9)['json'](_0x2c6517);}};}function respondWithFilteredResult(_0x509336,_0x5ed352){return function(_0x1e1676){if(_0x1e1676){var _0x10cc44=typeof _0x5ed352[_0x7ede('0x11')]===_0x7ede('0x12')&&typeof _0x5ed352[_0x7ede('0x13')]===_0x7ede('0x12');var _0x457924=_0x1e1676[_0x7ede('0x14')];var _0x2ce0f1=_0x10cc44?0x0:_0x5ed352[_0x7ede('0x11')];var _0x4f05d0=_0x10cc44?_0x1e1676[_0x7ede('0x14')]:_0x5ed352[_0x7ede('0x11')]+_0x5ed352[_0x7ede('0x13')];var _0x57e7e8;if(_0x4f05d0>=_0x457924){_0x4f05d0=_0x457924;_0x57e7e8=0xc8;}else{_0x57e7e8=0xce;}_0x509336[_0x7ede('0xf')](_0x57e7e8);return _0x509336[_0x7ede('0x15')](_0x7ede('0x16'),_0x2ce0f1+'-'+_0x4f05d0+'/'+_0x457924)[_0x7ede('0x17')](_0x1e1676);}return null;};}function saveUpdates(_0x29f022){return function(_0x4217e5){if(_0x4217e5){return _0x4217e5[_0x7ede('0x18')](_0x29f022)[_0x7ede('0x19')](function(_0x157d4b){return _0x157d4b;});}return null;};}function removeEntity(_0x447d0b){return function(_0x1ed269){if(_0x1ed269){return _0x1ed269[_0x7ede('0x1a')]()['then'](function(){var _0x24a312=_0x1ed269['get']({'plain':!![]});var _0x34a44e=_0x7ede('0x1b');return db[_0x7ede('0x1c')][_0x7ede('0x1a')]({'where':{'type':_0x34a44e,'resourceId':_0x24a312['id']}})[_0x7ede('0x19')](function(){return _0x1ed269;});})['then'](function(){_0x447d0b[_0x7ede('0xf')](0xcc)[_0x7ede('0x10')]();});}};}function handleEntityNotFound(_0x454bc5){return function(_0x3312e4){if(!_0x3312e4){_0x454bc5['sendStatus'](0x194);}return _0x3312e4;};}function handleError(_0x3d8ed6,_0x220d6b){_0x220d6b=_0x220d6b||0x1f4;return function(_0x1209c5){logger[_0x7ede('0x1d')](_0x1209c5['stack']);if(_0x1209c5[_0x7ede('0x1e')]){delete _0x1209c5[_0x7ede('0x1e')];}_0x3d8ed6[_0x7ede('0xf')](_0x220d6b)[_0x7ede('0x1f')](_0x1209c5);};}exports['index']=function(_0x50a03c,_0x5786b1){var _0x3ed927={};var _0x4c4a2a={'count':0x0,'rows':[]};var _0x28f287=_[_0x7ede('0x20')](db['ChatQueue']['rawAttributes'],function(_0x3f44d8){return{'name':_0x3f44d8['fieldName'],'type':_0x3f44d8['type'][_0x7ede('0x21')]};});_0x3ed927=qs[_0x7ede('0x22')](_0x28f287,_0x50a03c);var _0x28d311={'where':_0x3ed927['where']};return db[_0x7ede('0x23')][_0x7ede('0x14')](_0x28d311)[_0x7ede('0x19')](function(_0x285560){_0x4c4a2a['count']=_0x285560;_0x3ed927[_0x7ede('0x24')]=qs['include'](_0x50a03c[_0x7ede('0x25')]);return db[_0x7ede('0x23')][_0x7ede('0x26')](_0x3ed927);})[_0x7ede('0x19')](function(_0x303cc2){_0x4c4a2a[_0x7ede('0x27')]=_0x303cc2;return _0x4c4a2a;})[_0x7ede('0x19')](respondWithFilteredResult(_0x5786b1,_0x3ed927))[_0x7ede('0x28')](handleError(_0x5786b1,null));};exports[_0x7ede('0x29')]=function(_0x29cf9e,_0x4ca287){var _0x233ac4={'raw':!![],'where':{'id':_0x29cf9e['params']['id']}},_0x3a7405={};_0x3a7405[_0x7ede('0x2a')]=_[_0x7ede('0x2b')](db['ChatQueue'][_0x7ede('0x2c')]);_0x3a7405[_0x7ede('0x25')]=_[_0x7ede('0x2b')](_0x29cf9e['query']);_0x3a7405[_0x7ede('0x2d')]=_[_0x7ede('0x2e')](_0x3a7405[_0x7ede('0x2a')],_0x3a7405['query']);_0x233ac4['attributes']=_[_0x7ede('0x2e')](_0x3a7405[_0x7ede('0x2a')],qs[_0x7ede('0x2f')](_0x29cf9e[_0x7ede('0x25')][_0x7ede('0x2f')]));_0x233ac4[_0x7ede('0x30')]=_0x233ac4[_0x7ede('0x30')][_0x7ede('0x31')]?_0x233ac4[_0x7ede('0x30')]:_0x3a7405[_0x7ede('0x2a')];if(_0x29cf9e[_0x7ede('0x25')][_0x7ede('0x32')]){_0x233ac4[_0x7ede('0x24')]=[{'all':!![]}];}_0x233ac4=_[_0x7ede('0x33')]({},_0x233ac4,_0x29cf9e['options']);return db[_0x7ede('0x23')][_0x7ede('0x34')](_0x233ac4)['then'](handleEntityNotFound(_0x4ca287,null))[_0x7ede('0x19')](respondWithResult(_0x4ca287,null))[_0x7ede('0x28')](handleError(_0x4ca287,null));};exports[_0x7ede('0x35')]=function(_0x17eb8,_0x9f498){return db[_0x7ede('0x23')][_0x7ede('0x35')](_0x17eb8[_0x7ede('0x36')],{})[_0x7ede('0x19')](function(_0x4499ff){var _0xa1801b=_0x17eb8[_0x7ede('0x37')][_0x7ede('0x38')]({'plain':!![]});if(!_0xa1801b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa1801b[_0x7ede('0x39')]===_0x7ede('0x37')){var _0x298a78=_0x4499ff[_0x7ede('0x38')]({'plain':!![]});var _0x2c7bc3=_0x7ede('0x1b');return db[_0x7ede('0x3a')][_0x7ede('0x34')]({'where':{'name':_0x2c7bc3,'userProfileId':_0xa1801b['userProfileId']},'raw':!![]})[_0x7ede('0x19')](function(_0x599baa){if(_0x599baa&&_0x599baa[_0x7ede('0x3b')]===0x0){return db[_0x7ede('0x1c')][_0x7ede('0x35')]({'name':_0x298a78[_0x7ede('0x1e')],'resourceId':_0x298a78['id'],'type':_0x599baa[_0x7ede('0x1e')],'sectionId':_0x599baa['id']},{})[_0x7ede('0x19')](function(){return _0x4499ff;});}else{return _0x4499ff;}})['catch'](function(_0x243e95){logger[_0x7ede('0x1d')](_0x7ede('0x3c'),_0x243e95);throw _0x243e95;});}return _0x4499ff;})[_0x7ede('0x19')](respondWithResult(_0x9f498,0xc9))[_0x7ede('0x28')](handleError(_0x9f498,null));};exports['update']=function(_0x3649c1,_0x6eba2f){if(_0x3649c1['body']['id']){delete _0x3649c1[_0x7ede('0x36')]['id'];}return db[_0x7ede('0x23')]['find']({'where':{'id':_0x3649c1[_0x7ede('0x3d')]['id']}})[_0x7ede('0x19')](handleEntityNotFound(_0x6eba2f,null))[_0x7ede('0x19')](saveUpdates(_0x3649c1[_0x7ede('0x36')],null))[_0x7ede('0x19')](respondWithResult(_0x6eba2f,null))[_0x7ede('0x28')](handleError(_0x6eba2f,null));};exports['destroy']=function(_0x1deacd,_0x5b6d4b){return db[_0x7ede('0x23')][_0x7ede('0x34')]({'where':{'id':_0x1deacd[_0x7ede('0x3d')]['id']}})[_0x7ede('0x19')](handleEntityNotFound(_0x5b6d4b,null))[_0x7ede('0x19')](removeEntity(_0x5b6d4b,null))[_0x7ede('0x28')](handleError(_0x5b6d4b,null));};exports[_0x7ede('0x3e')]=function(_0x37b070,_0x1236bb){return db[_0x7ede('0x23')][_0x7ede('0x3e')]()[_0x7ede('0x19')](respondWithResult(_0x1236bb,null))['catch'](handleError(_0x1236bb,null));};exports['getMembers']=function(_0x15b3e9,_0x5daf2e){var _0x2a2b5e={'raw':!![],'where':{}},_0x538a6a={},_0x24e009;return db['ChatQueue'][_0x7ede('0x3f')]({'where':{'id':_0x15b3e9[_0x7ede('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5daf2e,null))['then'](function(_0x33a71a){if(_0x33a71a){_0x24e009=_0x33a71a[_0x7ede('0x38')]({'plain':!![]});_0x538a6a[_0x7ede('0x2a')]=_[_0x7ede('0x2b')](db[_0x7ede('0x40')][_0x7ede('0x2c')]);_0x538a6a[_0x7ede('0x25')]=_[_0x7ede('0x2b')](_0x15b3e9[_0x7ede('0x25')]);_0x538a6a[_0x7ede('0x2d')]=_[_0x7ede('0x2e')](_0x538a6a[_0x7ede('0x2a')],_0x538a6a[_0x7ede('0x25')]);_0x2a2b5e[_0x7ede('0x30')]=_[_0x7ede('0x2e')](_0x538a6a['model'],qs['fields'](_0x15b3e9[_0x7ede('0x25')]['fields']));_0x2a2b5e[_0x7ede('0x30')]=_0x2a2b5e[_0x7ede('0x30')]['length']?_0x2a2b5e['attributes']:_0x538a6a[_0x7ede('0x2a')];if(!_0x15b3e9[_0x7ede('0x25')][_0x7ede('0x41')](_0x7ede('0x42'))){_0x2a2b5e[_0x7ede('0x13')]=qs[_0x7ede('0x13')](_0x15b3e9[_0x7ede('0x25')][_0x7ede('0x13')]);_0x2a2b5e[_0x7ede('0x11')]=qs[_0x7ede('0x11')](_0x15b3e9['query'][_0x7ede('0x11')]);}_0x2a2b5e[_0x7ede('0x43')]=qs['sort'](_0x15b3e9['query'][_0x7ede('0x44')]);_0x2a2b5e[_0x7ede('0x45')]=qs[_0x7ede('0x2d')](_[_0x7ede('0x46')](_0x15b3e9[_0x7ede('0x25')],_0x538a6a[_0x7ede('0x2d')]));_0x2a2b5e[_0x7ede('0x45')][_0x7ede('0x47')]=_0x33a71a['id'];if(_0x15b3e9[_0x7ede('0x25')][_0x7ede('0x48')]){_0x2a2b5e['where']=_[_0x7ede('0x33')](_0x2a2b5e[_0x7ede('0x45')],{'$or':_[_0x7ede('0x20')](_0x2a2b5e[_0x7ede('0x30')],function(_0x3c1de7){var _0x4efbee={};_0x4efbee[_0x3c1de7]={'$like':'%'+_0x15b3e9[_0x7ede('0x25')]['filter']+'%'};return _0x4efbee;})});}_0x2a2b5e=_[_0x7ede('0x33')]({},_0x2a2b5e,_0x15b3e9[_0x7ede('0x49')]);return db[_0x7ede('0x40')]['findAll'](_0x2a2b5e);}})['then'](function(_0x5008f1){if(_0x5008f1){return db[_0x7ede('0x4a')][_0x7ede('0x4b')]({'where':{'id':_[_0x7ede('0x20')](_0x5008f1,_0x7ede('0x4c')),'role':_0x7ede('0x4d')},'attributes':['id',_0x7ede('0x1e'),_0x7ede('0x4e'),_0x7ede('0x4f'),_0x7ede('0x50')]});}})[_0x7ede('0x19')](function(_0x509ba4){if(_0x509ba4){return{'count':_0x509ba4['count'],'rows':_[_0x7ede('0x20')](_0x509ba4[_0x7ede('0x27')],function(_0x102c34){return{'membername':_0x102c34['name'],'UserId':_0x102c34['id'],'queue_name':_0x24e009[_0x7ede('0x1e')],'ChatQueueId':_0x24e009['id'],'interface':util[_0x7ede('0x51')](_0x7ede('0x52'),'SIP',_0x102c34['name']),'penalty':0x0,'paused':_0x102c34['chatPause'],'createdAt':_0x102c34[_0x7ede('0x50')],'updatedAt':_0x102c34['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7ede('0x19')](respondWithFilteredResult(_0x5daf2e,_0x2a2b5e))[_0x7ede('0x28')](handleError(_0x5daf2e,null));};exports[_0x7ede('0x53')]=function(_0x1c02d7,_0x2506a6){var _0x16b210={};var _0x3d6129={};var _0x416bcb;var _0x476a0d;return db[_0x7ede('0x23')][_0x7ede('0x3f')]({'where':{'id':_0x1c02d7[_0x7ede('0x3d')]['id']}})[_0x7ede('0x19')](handleEntityNotFound(_0x2506a6,null))[_0x7ede('0x19')](function(_0x3edcfa){if(_0x3edcfa){_0x416bcb=_0x3edcfa;_0x3d6129['model']=_['keys'](db[_0x7ede('0x54')][_0x7ede('0x2c')]);_0x3d6129['query']=_[_0x7ede('0x2b')](_0x1c02d7['query']);_0x3d6129[_0x7ede('0x2d')]=_[_0x7ede('0x2e')](_0x3d6129[_0x7ede('0x2a')],_0x3d6129[_0x7ede('0x25')]);_0x16b210[_0x7ede('0x30')]=_['intersection'](_0x3d6129[_0x7ede('0x2a')],qs[_0x7ede('0x2f')](_0x1c02d7[_0x7ede('0x25')][_0x7ede('0x2f')]));_0x16b210['attributes']=_0x16b210[_0x7ede('0x30')][_0x7ede('0x31')]?_0x16b210[_0x7ede('0x30')]:_0x3d6129['model'];_0x16b210[_0x7ede('0x43')]=qs['sort'](_0x1c02d7[_0x7ede('0x25')][_0x7ede('0x44')]);_0x16b210[_0x7ede('0x45')]=qs['filters'](_[_0x7ede('0x46')](_0x1c02d7[_0x7ede('0x25')],_0x3d6129[_0x7ede('0x2d')]));if(_0x1c02d7[_0x7ede('0x25')][_0x7ede('0x48')]){_0x16b210[_0x7ede('0x45')]=_[_0x7ede('0x33')](_0x16b210[_0x7ede('0x45')],{'$or':_[_0x7ede('0x20')](_0x16b210[_0x7ede('0x30')],function(_0x2d132a){var _0x5162f4={};_0x5162f4[_0x2d132a]={'$like':'%'+_0x1c02d7[_0x7ede('0x25')][_0x7ede('0x48')]+'%'};return _0x5162f4;})});}_0x16b210=_[_0x7ede('0x33')]({},_0x16b210,_0x1c02d7[_0x7ede('0x49')]);return _0x416bcb[_0x7ede('0x53')](_0x16b210);}})['then'](function(_0x5a5dd7){if(_0x5a5dd7){_0x476a0d=_0x5a5dd7[_0x7ede('0x31')];if(!_0x1c02d7[_0x7ede('0x25')][_0x7ede('0x41')](_0x7ede('0x42'))){_0x16b210[_0x7ede('0x13')]=qs[_0x7ede('0x13')](_0x1c02d7['query'][_0x7ede('0x13')]);_0x16b210[_0x7ede('0x11')]=qs[_0x7ede('0x11')](_0x1c02d7[_0x7ede('0x25')][_0x7ede('0x11')]);}return _0x416bcb[_0x7ede('0x53')](_0x16b210);}})[_0x7ede('0x19')](function(_0x5227b7){if(_0x5227b7){return _0x5227b7?{'count':_0x476a0d,'rows':_0x5227b7}:null;}})['then'](respondWithResult(_0x2506a6,null))[_0x7ede('0x28')](handleError(_0x2506a6,null));};exports[_0x7ede('0x55')]=function(_0x547ff1,_0x2f81ee){var _0x35f163=_0x547ff1[_0x7ede('0x36')]['ids'];return db[_0x7ede('0x54')][_0x7ede('0x26')]({'where':{'id':_0x35f163},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7ede('0x56'),'attributes':['id',_0x7ede('0x1e'),_0x7ede('0x57'),_0x7ede('0x58'),'interface'],'raw':!![]}]})[_0x7ede('0x19')](function(_0x323bfc){if(_0x323bfc){var _0x400b0c=_[_0x7ede('0x59')](_0x323bfc,function(_0x43f81f){var _0x45fc1b=_0x43f81f[_0x7ede('0x38')]({'plain':!![]});return _0x45fc1b[_0x7ede('0x56')];});return db[_0x7ede('0x23')]['find']({'where':{'id':_0x547ff1['params']['id']}})['then'](function(_0x38ced4){return db[_0x7ede('0x5a')][_0x7ede('0x5b')](function(_0x3375f7){return _0x38ced4[_0x7ede('0x55')](_0x35f163,{'transaction':_0x3375f7})['then'](function(){return BPromise['each'](_0x400b0c,function(_0x40eaba){return db[_0x7ede('0x40')][_0x7ede('0x5c')]({'where':{'UserId':_0x40eaba['id'],'ChatQueueId':_0x547ff1[_0x7ede('0x3d')]['id']},'transaction':_0x3375f7});});})[_0x7ede('0x19')](function(){_0x400b0c[_0x7ede('0x5d')](function(_0x1007dd){socket[_0x7ede('0x5e')](_0x7ede('0x5f'),{'UserId':_0x1007dd['id'],'ChatQueueId':_0x38ced4['id']});});});});});}})[_0x7ede('0x19')](respondWithStatusCode(_0x2f81ee,null))[_0x7ede('0x28')](handleError(_0x2f81ee,null));};exports[_0x7ede('0x60')]=function(_0x19edb4,_0x24d3b6){return db['Team'][_0x7ede('0x26')]({'where':{'id':_0x19edb4[_0x7ede('0x25')][_0x7ede('0x61')]},'attributes':['id'],'include':[{'model':db[_0x7ede('0x4a')],'as':_0x7ede('0x56'),'attributes':['id'],'raw':!![]}]})[_0x7ede('0x19')](handleEntityNotFound(_0x24d3b6,null))[_0x7ede('0x19')](function(_0x1b3450){var _0x339126=_[_0x7ede('0x20')](_0x1b3450,'id');var _0x1415af=[];var _0xd6643a=[];var _0xd06d8a=squel['select']();_0xd06d8a[_0x7ede('0x62')](_0x7ede('0x63'))['from'](_0x7ede('0x64'),'tq')[_0x7ede('0x65')](_0x7ede('0x66'),'ut',_0x7ede('0x67'))[_0x7ede('0x45')]('ChatQueueId\x20=\x20?',_0x19edb4[_0x7ede('0x3d')]['id']);for(var _0x212320=0x0;_0x212320<_0x1b3450[_0x7ede('0x31')];_0x212320+=0x1){let _0x1653fd=_0x1b3450[_0x212320];for(var _0x2d584e=0x0;_0x2d584e<_0x1653fd['Agents'][_0x7ede('0x31')];_0x2d584e+=0x1){let _0x50660d=_0x1653fd[_0x7ede('0x56')][_0x2d584e];var _0x3303e1=_0xd06d8a[_0x7ede('0x68')]();_0x3303e1[_0x7ede('0x45')](_0x7ede('0x69'),_0x50660d['id']);_0xd6643a[_0x7ede('0x6a')](db['sequelize'][_0x7ede('0x25')](_0x3303e1['toString'](),{'type':db[_0x7ede('0x5a')]['QueryTypes']['SELECT']})[_0x7ede('0x19')](function(_0x4fb27e){if(_0x4fb27e[_0x7ede('0x31')]===0x1){return _0x50660d['id'];}else{var _0x1203cf=_[_0x7ede('0x6b')](_[_0x7ede('0x20')](_0x4fb27e,_0x7ede('0x6c')),function(_0x24de4b){return _[_0x7ede('0x6d')](_0x339126,_0x24de4b);});if(_0x1203cf){return _0x50660d['id'];}}}));}}return BPromise[_0x7ede('0x6e')](_0xd6643a)[_0x7ede('0x19')](function(_0x78c6e1){_0x1415af=_(_0x1415af)[_0x7ede('0x6f')](_0x78c6e1)['compact']()[_0x7ede('0x70')]();return db[_0x7ede('0x23')][_0x7ede('0x34')]({'where':{'id':_0x19edb4[_0x7ede('0x3d')]['id']}})[_0x7ede('0x19')](function(_0xcff138){return db[_0x7ede('0x5a')][_0x7ede('0x5b')](function(_0x58ded8){return _0xcff138[_0x7ede('0x60')](_0x19edb4[_0x7ede('0x25')][_0x7ede('0x61')],{'transaction':_0x58ded8})[_0x7ede('0x19')](function(){if(!_[_0x7ede('0x71')](_0x1415af)){return _0xcff138['removeAgents'](_0x1415af,{'transaction':_0x58ded8});}})[_0x7ede('0x19')](function(){_0x1415af[_0x7ede('0x5d')](function(_0x378f7a){socket['emit'](_0x7ede('0x72'),{'UserId':_0x378f7a,'ChatQueueId':_0xcff138['id']});});});});});});})['then'](respondWithStatusCode(_0x24d3b6,null))[_0x7ede('0x28')](handleError(_0x24d3b6,null));};exports[_0x7ede('0x73')]=function(_0x4f2240,_0x4593c3){return db[_0x7ede('0x23')][_0x7ede('0x34')]({'where':{'id':_0x4f2240[_0x7ede('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4593c3,null))[_0x7ede('0x19')](function(_0x1f2b47){if(_0x1f2b47){return _0x1f2b47['addAgents'](_0x4f2240['body'][_0x7ede('0x61')],_[_0x7ede('0x74')](_0x4f2240[_0x7ede('0x36')],[_0x7ede('0x61'),'id'])||{})[_0x7ede('0x75')](function(_0x5cfc51){for(var _0x261a5c=0x0;_0x261a5c<_0x4f2240[_0x7ede('0x36')][_0x7ede('0x61')]['length'];_0x261a5c+=0x1){socket[_0x7ede('0x5e')](_0x7ede('0x5f'),{'UserId':Number(_0x4f2240[_0x7ede('0x36')][_0x7ede('0x61')][_0x261a5c]),'ChatQueueId':Number(_0x4f2240[_0x7ede('0x3d')]['id'])});}return _0x5cfc51;});}})['then'](respondWithResult(_0x4593c3,null))[_0x7ede('0x28')](handleError(_0x4593c3,null));};exports[_0x7ede('0x76')]=function(_0x3235d0,_0x18f562){return db[_0x7ede('0x23')][_0x7ede('0x34')]({'where':{'id':_0x3235d0['params']['id']}})[_0x7ede('0x19')](handleEntityNotFound(_0x18f562,null))['then'](function(_0x1a599e){if(_0x1a599e){return _0x1a599e['removeAgents'](_0x3235d0[_0x7ede('0x25')]['ids'])['then'](function(){if(_[_0x7ede('0x77')](_0x3235d0[_0x7ede('0x25')][_0x7ede('0x61')])){for(var _0x4ec037=0x0;_0x4ec037<_0x3235d0[_0x7ede('0x25')][_0x7ede('0x61')][_0x7ede('0x31')];_0x4ec037+=0x1){socket[_0x7ede('0x5e')](_0x7ede('0x72'),{'UserId':Number(_0x3235d0[_0x7ede('0x25')][_0x7ede('0x61')][_0x4ec037]),'ChatQueueId':Number(_0x3235d0[_0x7ede('0x3d')]['id'])});}}else{socket[_0x7ede('0x5e')](_0x7ede('0x72'),{'UserId':Number(_0x3235d0['query'][_0x7ede('0x61')]),'ChatQueueId':Number(_0x3235d0[_0x7ede('0x3d')]['id'])});}});}})['then'](respondWithStatusCode(_0x18f562,null))[_0x7ede('0x28')](handleError(_0x18f562,null));};exports[_0x7ede('0x78')]=function(_0x31b08a,_0xccb022){var _0x99bd14={};var _0x18effa={};var _0x598513;var _0x461087;return db[_0x7ede('0x23')]['findOne']({'where':{'id':_0x31b08a['params']['id']}})[_0x7ede('0x19')](handleEntityNotFound(_0xccb022,null))[_0x7ede('0x19')](function(_0x560750){if(_0x560750){_0x598513=_0x560750;_0x18effa[_0x7ede('0x2a')]=_[_0x7ede('0x2b')](db['User'][_0x7ede('0x2c')]);_0x18effa[_0x7ede('0x25')]=_[_0x7ede('0x2b')](_0x31b08a[_0x7ede('0x25')]);_0x18effa[_0x7ede('0x2d')]=_['intersection'](_0x18effa[_0x7ede('0x2a')],_0x18effa['query']);_0x99bd14['attributes']=_[_0x7ede('0x2e')](_0x18effa[_0x7ede('0x2a')],qs[_0x7ede('0x2f')](_0x31b08a['query'][_0x7ede('0x2f')]));_0x99bd14['attributes']=_0x99bd14[_0x7ede('0x30')][_0x7ede('0x31')]?_0x99bd14[_0x7ede('0x30')]:_0x18effa[_0x7ede('0x2a')];_0x99bd14['order']=qs['sort'](_0x31b08a[_0x7ede('0x25')][_0x7ede('0x44')]);_0x99bd14[_0x7ede('0x45')]=qs[_0x7ede('0x2d')](_[_0x7ede('0x46')](_0x31b08a[_0x7ede('0x25')],_0x18effa[_0x7ede('0x2d')]));if(_0x31b08a[_0x7ede('0x25')]['filter']){_0x99bd14['where']=_[_0x7ede('0x33')](_0x99bd14[_0x7ede('0x45')],{'$or':_[_0x7ede('0x20')](_0x99bd14[_0x7ede('0x30')],function(_0x21f4f9){var _0x1968ec={};_0x1968ec[_0x21f4f9]={'$like':'%'+_0x31b08a[_0x7ede('0x25')][_0x7ede('0x48')]+'%'};return _0x1968ec;})});}_0x99bd14=_[_0x7ede('0x33')]({},_0x99bd14,_0x31b08a[_0x7ede('0x49')]);return _0x598513['getAgents'](_0x99bd14);}})['then'](function(_0x4e1ddb){if(_0x4e1ddb){_0x461087=_0x4e1ddb['length'];if(!_0x31b08a[_0x7ede('0x25')][_0x7ede('0x41')](_0x7ede('0x42'))){_0x99bd14[_0x7ede('0x13')]=qs[_0x7ede('0x13')](_0x31b08a[_0x7ede('0x25')][_0x7ede('0x13')]);_0x99bd14[_0x7ede('0x11')]=qs['offset'](_0x31b08a['query'][_0x7ede('0x11')]);}return _0x598513[_0x7ede('0x78')](_0x99bd14);}})[_0x7ede('0x19')](function(_0x513714){if(_0x513714){return _0x513714?{'count':_0x461087,'rows':_0x513714}:null;}})['then'](respondWithResult(_0xccb022,null))[_0x7ede('0x28')](handleError(_0xccb022,null));};
\ No newline at end of file
+var _0x0d42=['omit','spread','userChatQueue:save','isArray','userChatQueue:remove','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','update','then','get','ChatQueues','destroy','error','stack','name','send','index','map','key','getOptions','where','ChatQueue','include','query','rows','show','params','model','keys','intersection','fields','attributes','includeAll','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserChatQueue','rawAttributes','filters','length','hasOwnProperty','nolimit','sort','pick','filter','findAll','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','getTeams','Team','order','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','forEach','emit','removeTeams','select','field','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','addAgents'];(function(_0x9faff7,_0x59a564){var _0x4f8043=function(_0x5f060d){while(--_0x5f060d){_0x9faff7['push'](_0x9faff7['shift']());}};_0x4f8043(++_0x59a564);}(_0x0d42,0x1ea));var _0x20d4=function(_0x5e4a9c,_0x2c0d9b){_0x5e4a9c=_0x5e4a9c-0x0;var _0x7f3c28=_0x0d42[_0x5e4a9c];return _0x7f3c28;};'use strict';var BPromise=require(_0x20d4('0x0'));var util=require(_0x20d4('0x1'));var _=require('lodash');var squel=require(_0x20d4('0x2'));var Redis=require(_0x20d4('0x3'));var qs=require(_0x20d4('0x4'));var logger=require(_0x20d4('0x5'))(_0x20d4('0x6'));var config=require(_0x20d4('0x7'));var db=require(_0x20d4('0x8'))['db'];config[_0x20d4('0x9')]=_[_0x20d4('0xa')](config[_0x20d4('0x9')],{'host':_0x20d4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x20d4('0x9')]));require('./chatQueue.socket')[_0x20d4('0xc')](socket);function respondWithStatusCode(_0x45291f,_0x24d44d){_0x24d44d=_0x24d44d||0xcc;return function(_0x5684f7){if(_0x5684f7){return _0x45291f[_0x20d4('0xd')](_0x24d44d);}return _0x45291f[_0x20d4('0xe')](_0x24d44d)[_0x20d4('0xf')]();};}function respondWithResult(_0x369574,_0x44dba1){_0x44dba1=_0x44dba1||0xc8;return function(_0x3aa4f7){if(_0x3aa4f7){return _0x369574[_0x20d4('0xe')](_0x44dba1)['json'](_0x3aa4f7);}};}function respondWithFilteredResult(_0x32d120,_0x49234a){return function(_0x57e66b){if(_0x57e66b){var _0x30a5e1=typeof _0x49234a[_0x20d4('0x10')]===_0x20d4('0x11')&&typeof _0x49234a[_0x20d4('0x12')]==='undefined';var _0x31a4cc=_0x57e66b['count'];var _0x2d19a4=_0x30a5e1?0x0:_0x49234a['offset'];var _0xe6e85b=_0x30a5e1?_0x57e66b[_0x20d4('0x13')]:_0x49234a[_0x20d4('0x10')]+_0x49234a[_0x20d4('0x12')];var _0x42ff3d;if(_0xe6e85b>=_0x31a4cc){_0xe6e85b=_0x31a4cc;_0x42ff3d=0xc8;}else{_0x42ff3d=0xce;}_0x32d120[_0x20d4('0xe')](_0x42ff3d);return _0x32d120['set'](_0x20d4('0x14'),_0x2d19a4+'-'+_0xe6e85b+'/'+_0x31a4cc)[_0x20d4('0x15')](_0x57e66b);}return null;};}function saveUpdates(_0x3d721e){return function(_0x23afcc){if(_0x23afcc){return _0x23afcc[_0x20d4('0x16')](_0x3d721e)[_0x20d4('0x17')](function(_0xcdcd82){return _0xcdcd82;});}return null;};}function removeEntity(_0x11a43d){return function(_0x5195dd){if(_0x5195dd){return _0x5195dd['destroy']()['then'](function(){var _0x2162e0=_0x5195dd[_0x20d4('0x18')]({'plain':!![]});var _0x1a9333=_0x20d4('0x19');return db['UserProfileResource'][_0x20d4('0x1a')]({'where':{'type':_0x1a9333,'resourceId':_0x2162e0['id']}})['then'](function(){return _0x5195dd;});})[_0x20d4('0x17')](function(){_0x11a43d[_0x20d4('0xe')](0xcc)[_0x20d4('0xf')]();});}};}function handleEntityNotFound(_0x6640b3){return function(_0x1900eb){if(!_0x1900eb){_0x6640b3[_0x20d4('0xd')](0x194);}return _0x1900eb;};}function handleError(_0x5aa8db,_0x55682c){_0x55682c=_0x55682c||0x1f4;return function(_0x498fd7){logger[_0x20d4('0x1b')](_0x498fd7[_0x20d4('0x1c')]);if(_0x498fd7[_0x20d4('0x1d')]){delete _0x498fd7[_0x20d4('0x1d')];}_0x5aa8db['status'](_0x55682c)[_0x20d4('0x1e')](_0x498fd7);};}exports[_0x20d4('0x1f')]=function(_0x477a82,_0x3b029f){var _0x5bb299={};var _0x45898e={'count':0x0,'rows':[]};var _0x1db65a=_[_0x20d4('0x20')](db['ChatQueue']['rawAttributes'],function(_0x55606d){return{'name':_0x55606d['fieldName'],'type':_0x55606d['type'][_0x20d4('0x21')]};});_0x5bb299=qs[_0x20d4('0x22')](_0x1db65a,_0x477a82);var _0x469738={'where':_0x5bb299[_0x20d4('0x23')]};return db[_0x20d4('0x24')][_0x20d4('0x13')](_0x469738)['then'](function(_0x3e6c00){_0x45898e[_0x20d4('0x13')]=_0x3e6c00;_0x5bb299[_0x20d4('0x25')]=qs[_0x20d4('0x25')](_0x477a82[_0x20d4('0x26')]);return db[_0x20d4('0x24')]['findAll'](_0x5bb299);})[_0x20d4('0x17')](function(_0x343247){_0x45898e[_0x20d4('0x27')]=_0x343247;return _0x45898e;})[_0x20d4('0x17')](respondWithFilteredResult(_0x3b029f,_0x5bb299))['catch'](handleError(_0x3b029f,null));};exports[_0x20d4('0x28')]=function(_0x1bb21e,_0x6a78fa){var _0x58cb11={'raw':!![],'where':{'id':_0x1bb21e[_0x20d4('0x29')]['id']}},_0x3415c9={};_0x3415c9[_0x20d4('0x2a')]=_[_0x20d4('0x2b')](db[_0x20d4('0x24')]['rawAttributes']);_0x3415c9[_0x20d4('0x26')]=_[_0x20d4('0x2b')](_0x1bb21e[_0x20d4('0x26')]);_0x3415c9['filters']=_[_0x20d4('0x2c')](_0x3415c9[_0x20d4('0x2a')],_0x3415c9[_0x20d4('0x26')]);_0x58cb11['attributes']=_[_0x20d4('0x2c')](_0x3415c9['model'],qs[_0x20d4('0x2d')](_0x1bb21e[_0x20d4('0x26')][_0x20d4('0x2d')]));_0x58cb11[_0x20d4('0x2e')]=_0x58cb11[_0x20d4('0x2e')]['length']?_0x58cb11[_0x20d4('0x2e')]:_0x3415c9[_0x20d4('0x2a')];if(_0x1bb21e['query'][_0x20d4('0x2f')]){_0x58cb11[_0x20d4('0x25')]=[{'all':!![]}];}_0x58cb11=_[_0x20d4('0x30')]({},_0x58cb11,_0x1bb21e[_0x20d4('0x31')]);return db[_0x20d4('0x24')]['find'](_0x58cb11)['then'](handleEntityNotFound(_0x6a78fa,null))[_0x20d4('0x17')](respondWithResult(_0x6a78fa,null))['catch'](handleError(_0x6a78fa,null));};exports[_0x20d4('0x32')]=function(_0x5f1812,_0x59e0c7){return db[_0x20d4('0x24')][_0x20d4('0x32')](_0x5f1812[_0x20d4('0x33')],{})[_0x20d4('0x17')](function(_0x490e1f){var _0x3344e3=_0x5f1812[_0x20d4('0x34')][_0x20d4('0x18')]({'plain':!![]});if(!_0x3344e3)throw new Error(_0x20d4('0x35'));if(_0x3344e3[_0x20d4('0x36')]===_0x20d4('0x34')){var _0x455aed=_0x490e1f[_0x20d4('0x18')]({'plain':!![]});var _0x3708dc=_0x20d4('0x19');return db[_0x20d4('0x37')][_0x20d4('0x38')]({'where':{'name':_0x3708dc,'userProfileId':_0x3344e3[_0x20d4('0x39')]},'raw':!![]})[_0x20d4('0x17')](function(_0x346861){if(_0x346861&&_0x346861['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x455aed[_0x20d4('0x1d')],'resourceId':_0x455aed['id'],'type':_0x346861[_0x20d4('0x1d')],'sectionId':_0x346861['id']},{})[_0x20d4('0x17')](function(){return _0x490e1f;});}else{return _0x490e1f;}})[_0x20d4('0x3a')](function(_0x167827){logger[_0x20d4('0x1b')](_0x20d4('0x3b'),_0x167827);throw _0x167827;});}return _0x490e1f;})[_0x20d4('0x17')](respondWithResult(_0x59e0c7,0xc9))[_0x20d4('0x3a')](handleError(_0x59e0c7,null));};exports[_0x20d4('0x16')]=function(_0x5ad163,_0x4b1f93){if(_0x5ad163['body']['id']){delete _0x5ad163['body']['id'];}return db[_0x20d4('0x24')][_0x20d4('0x38')]({'where':{'id':_0x5ad163[_0x20d4('0x29')]['id']}})[_0x20d4('0x17')](handleEntityNotFound(_0x4b1f93,null))[_0x20d4('0x17')](saveUpdates(_0x5ad163['body'],null))[_0x20d4('0x17')](respondWithResult(_0x4b1f93,null))['catch'](handleError(_0x4b1f93,null));};exports[_0x20d4('0x1a')]=function(_0x106c09,_0x59f156){return db[_0x20d4('0x24')][_0x20d4('0x38')]({'where':{'id':_0x106c09[_0x20d4('0x29')]['id']}})['then'](handleEntityNotFound(_0x59f156,null))[_0x20d4('0x17')](removeEntity(_0x59f156,null))['catch'](handleError(_0x59f156,null));};exports['describe']=function(_0x4915ec,_0x5a0697){return db[_0x20d4('0x24')]['describe']()[_0x20d4('0x17')](respondWithResult(_0x5a0697,null))[_0x20d4('0x3a')](handleError(_0x5a0697,null));};exports[_0x20d4('0x3c')]=function(_0x1b621c,_0x2b7bf7){var _0x2a5838={'raw':!![],'where':{}},_0x387595={},_0x3ae3b0;return db[_0x20d4('0x24')][_0x20d4('0x3d')]({'where':{'id':_0x1b621c[_0x20d4('0x29')]['id']}})['then'](handleEntityNotFound(_0x2b7bf7,null))[_0x20d4('0x17')](function(_0x1a3deb){if(_0x1a3deb){_0x3ae3b0=_0x1a3deb[_0x20d4('0x18')]({'plain':!![]});_0x387595[_0x20d4('0x2a')]=_[_0x20d4('0x2b')](db[_0x20d4('0x3e')][_0x20d4('0x3f')]);_0x387595['query']=_[_0x20d4('0x2b')](_0x1b621c[_0x20d4('0x26')]);_0x387595[_0x20d4('0x40')]=_[_0x20d4('0x2c')](_0x387595['model'],_0x387595[_0x20d4('0x26')]);_0x2a5838[_0x20d4('0x2e')]=_[_0x20d4('0x2c')](_0x387595[_0x20d4('0x2a')],qs[_0x20d4('0x2d')](_0x1b621c['query']['fields']));_0x2a5838['attributes']=_0x2a5838[_0x20d4('0x2e')][_0x20d4('0x41')]?_0x2a5838['attributes']:_0x387595[_0x20d4('0x2a')];if(!_0x1b621c[_0x20d4('0x26')][_0x20d4('0x42')](_0x20d4('0x43'))){_0x2a5838[_0x20d4('0x12')]=qs[_0x20d4('0x12')](_0x1b621c[_0x20d4('0x26')][_0x20d4('0x12')]);_0x2a5838[_0x20d4('0x10')]=qs[_0x20d4('0x10')](_0x1b621c[_0x20d4('0x26')][_0x20d4('0x10')]);}_0x2a5838['order']=qs['sort'](_0x1b621c[_0x20d4('0x26')][_0x20d4('0x44')]);_0x2a5838['where']=qs[_0x20d4('0x40')](_[_0x20d4('0x45')](_0x1b621c['query'],_0x387595['filters']));_0x2a5838[_0x20d4('0x23')]['ChatQueueId']=_0x1a3deb['id'];if(_0x1b621c[_0x20d4('0x26')]['filter']){_0x2a5838['where']=_[_0x20d4('0x30')](_0x2a5838['where'],{'$or':_[_0x20d4('0x20')](_0x2a5838[_0x20d4('0x2e')],function(_0x50ae08){var _0x36594f={};_0x36594f[_0x50ae08]={'$like':'%'+_0x1b621c[_0x20d4('0x26')][_0x20d4('0x46')]+'%'};return _0x36594f;})});}_0x2a5838=_['merge']({},_0x2a5838,_0x1b621c[_0x20d4('0x31')]);return db[_0x20d4('0x3e')][_0x20d4('0x47')](_0x2a5838);}})[_0x20d4('0x17')](function(_0x42b4de){if(_0x42b4de){return db[_0x20d4('0x48')][_0x20d4('0x49')]({'where':{'id':_['map'](_0x42b4de,'UserId'),'role':_0x20d4('0x4a')},'attributes':['id','name',_0x20d4('0x4b'),_0x20d4('0x4c'),_0x20d4('0x4d')]});}})[_0x20d4('0x17')](function(_0x59bbed){if(_0x59bbed){return{'count':_0x59bbed[_0x20d4('0x13')],'rows':_[_0x20d4('0x20')](_0x59bbed[_0x20d4('0x27')],function(_0x3d06b9){return{'membername':_0x3d06b9[_0x20d4('0x1d')],'UserId':_0x3d06b9['id'],'queue_name':_0x3ae3b0[_0x20d4('0x1d')],'ChatQueueId':_0x3ae3b0['id'],'interface':util[_0x20d4('0x4e')]('%s/%s','SIP',_0x3d06b9[_0x20d4('0x1d')]),'penalty':0x0,'paused':_0x3d06b9[_0x20d4('0x4b')],'createdAt':_0x3d06b9[_0x20d4('0x4d')],'updatedAt':_0x3d06b9[_0x20d4('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x20d4('0x17')](respondWithFilteredResult(_0x2b7bf7,_0x2a5838))[_0x20d4('0x3a')](handleError(_0x2b7bf7,null));};exports[_0x20d4('0x4f')]=function(_0x33816c,_0x344b7b){var _0x4e6bb6={};var _0x50e2d7={};var _0x1bf85d;var _0x58b53d;return db[_0x20d4('0x24')]['findOne']({'where':{'id':_0x33816c['params']['id']}})[_0x20d4('0x17')](handleEntityNotFound(_0x344b7b,null))[_0x20d4('0x17')](function(_0x1d7ce9){if(_0x1d7ce9){_0x1bf85d=_0x1d7ce9;_0x50e2d7[_0x20d4('0x2a')]=_[_0x20d4('0x2b')](db[_0x20d4('0x50')][_0x20d4('0x3f')]);_0x50e2d7['query']=_['keys'](_0x33816c[_0x20d4('0x26')]);_0x50e2d7[_0x20d4('0x40')]=_[_0x20d4('0x2c')](_0x50e2d7[_0x20d4('0x2a')],_0x50e2d7[_0x20d4('0x26')]);_0x4e6bb6[_0x20d4('0x2e')]=_[_0x20d4('0x2c')](_0x50e2d7[_0x20d4('0x2a')],qs[_0x20d4('0x2d')](_0x33816c[_0x20d4('0x26')][_0x20d4('0x2d')]));_0x4e6bb6[_0x20d4('0x2e')]=_0x4e6bb6[_0x20d4('0x2e')]['length']?_0x4e6bb6['attributes']:_0x50e2d7[_0x20d4('0x2a')];_0x4e6bb6[_0x20d4('0x51')]=qs['sort'](_0x33816c[_0x20d4('0x26')]['sort']);_0x4e6bb6[_0x20d4('0x23')]=qs[_0x20d4('0x40')](_[_0x20d4('0x45')](_0x33816c[_0x20d4('0x26')],_0x50e2d7['filters']));if(_0x33816c[_0x20d4('0x26')][_0x20d4('0x46')]){_0x4e6bb6[_0x20d4('0x23')]=_[_0x20d4('0x30')](_0x4e6bb6[_0x20d4('0x23')],{'$or':_[_0x20d4('0x20')](_0x4e6bb6['attributes'],function(_0x37484d){var _0x2b7903={};_0x2b7903[_0x37484d]={'$like':'%'+_0x33816c['query'][_0x20d4('0x46')]+'%'};return _0x2b7903;})});}_0x4e6bb6=_[_0x20d4('0x30')]({},_0x4e6bb6,_0x33816c['options']);return _0x1bf85d[_0x20d4('0x4f')](_0x4e6bb6);}})[_0x20d4('0x17')](function(_0x4e57a8){if(_0x4e57a8){_0x58b53d=_0x4e57a8['length'];if(!_0x33816c['query'][_0x20d4('0x42')](_0x20d4('0x43'))){_0x4e6bb6[_0x20d4('0x12')]=qs[_0x20d4('0x12')](_0x33816c[_0x20d4('0x26')][_0x20d4('0x12')]);_0x4e6bb6[_0x20d4('0x10')]=qs['offset'](_0x33816c[_0x20d4('0x26')][_0x20d4('0x10')]);}return _0x1bf85d[_0x20d4('0x4f')](_0x4e6bb6);}})['then'](function(_0x54575f){if(_0x54575f){return _0x54575f?{'count':_0x58b53d,'rows':_0x54575f}:null;}})[_0x20d4('0x17')](respondWithResult(_0x344b7b,null))[_0x20d4('0x3a')](handleError(_0x344b7b,null));};exports[_0x20d4('0x52')]=function(_0x1f9d6d,_0x447866){var _0x135c5d=_0x1f9d6d[_0x20d4('0x33')][_0x20d4('0x53')];return db[_0x20d4('0x50')][_0x20d4('0x47')]({'where':{'id':_0x135c5d},'attributes':['id'],'include':[{'model':db[_0x20d4('0x48')],'as':_0x20d4('0x54'),'attributes':['id','name',_0x20d4('0x55'),_0x20d4('0x56'),_0x20d4('0x57')],'raw':!![]}]})[_0x20d4('0x17')](function(_0x445428){if(_0x445428){var _0x259bc3=_[_0x20d4('0x58')](_0x445428,function(_0x480fd7){var _0x4f457c=_0x480fd7[_0x20d4('0x18')]({'plain':!![]});return _0x4f457c[_0x20d4('0x54')];});return db[_0x20d4('0x24')]['find']({'where':{'id':_0x1f9d6d[_0x20d4('0x29')]['id']}})['then'](function(_0x595213){return db[_0x20d4('0x59')][_0x20d4('0x5a')](function(_0x16bdd2){return _0x595213['addTeams'](_0x135c5d,{'transaction':_0x16bdd2})[_0x20d4('0x17')](function(){return BPromise['each'](_0x259bc3,function(_0x31efe1){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x31efe1['id'],'ChatQueueId':_0x1f9d6d[_0x20d4('0x29')]['id']},'transaction':_0x16bdd2});});})[_0x20d4('0x17')](function(){_0x259bc3[_0x20d4('0x5b')](function(_0x4ec9d7){socket[_0x20d4('0x5c')]('userChatQueue:save',{'UserId':_0x4ec9d7['id'],'ChatQueueId':_0x595213['id']});});});});});}})[_0x20d4('0x17')](respondWithStatusCode(_0x447866,null))[_0x20d4('0x3a')](handleError(_0x447866,null));};exports[_0x20d4('0x5d')]=function(_0x3240d2,_0x43bf2d){return db[_0x20d4('0x50')][_0x20d4('0x47')]({'where':{'id':_0x3240d2[_0x20d4('0x26')][_0x20d4('0x53')]},'attributes':['id'],'include':[{'model':db[_0x20d4('0x48')],'as':_0x20d4('0x54'),'attributes':['id'],'raw':!![]}]})[_0x20d4('0x17')](handleEntityNotFound(_0x43bf2d,null))['then'](function(_0x399843){var _0x23fd80=_['map'](_0x399843,'id');var _0x572a29=[];var _0x50a2d9=[];var _0x382795=squel[_0x20d4('0x5e')]();_0x382795[_0x20d4('0x5f')]('tq.TeamId')[_0x20d4('0x60')](_0x20d4('0x61'),'tq')[_0x20d4('0x62')](_0x20d4('0x63'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x20d4('0x23')](_0x20d4('0x64'),_0x3240d2[_0x20d4('0x29')]['id']);for(var _0x516b2d=0x0;_0x516b2d<_0x399843['length'];_0x516b2d+=0x1){let _0x3a3f68=_0x399843[_0x516b2d];for(var _0x580ec0=0x0;_0x580ec0<_0x3a3f68[_0x20d4('0x54')][_0x20d4('0x41')];_0x580ec0+=0x1){let _0x5dcb21=_0x3a3f68[_0x20d4('0x54')][_0x580ec0];var _0x10db9a=_0x382795['clone']();_0x10db9a[_0x20d4('0x23')](_0x20d4('0x65'),_0x5dcb21['id']);_0x50a2d9[_0x20d4('0x66')](db[_0x20d4('0x59')][_0x20d4('0x26')](_0x10db9a[_0x20d4('0x67')](),{'type':db['sequelize'][_0x20d4('0x68')][_0x20d4('0x69')]})[_0x20d4('0x17')](function(_0x1d873f){if(_0x1d873f[_0x20d4('0x41')]===0x1){return _0x5dcb21['id'];}else{var _0x388e57=_[_0x20d4('0x6a')](_[_0x20d4('0x20')](_0x1d873f,_0x20d4('0x6b')),function(_0x1d50bb){return _[_0x20d4('0x6c')](_0x23fd80,_0x1d50bb);});if(_0x388e57){return _0x5dcb21['id'];}}}));}}return BPromise[_0x20d4('0x6d')](_0x50a2d9)[_0x20d4('0x17')](function(_0x220f37){_0x572a29=_(_0x572a29)[_0x20d4('0x6e')](_0x220f37)[_0x20d4('0x6f')]()['value']();return db[_0x20d4('0x24')][_0x20d4('0x38')]({'where':{'id':_0x3240d2['params']['id']}})[_0x20d4('0x17')](function(_0x4b60e5){return db[_0x20d4('0x59')][_0x20d4('0x5a')](function(_0x39b3a5){return _0x4b60e5[_0x20d4('0x5d')](_0x3240d2[_0x20d4('0x26')]['ids'],{'transaction':_0x39b3a5})[_0x20d4('0x17')](function(){if(!_[_0x20d4('0x70')](_0x572a29)){return _0x4b60e5[_0x20d4('0x71')](_0x572a29,{'transaction':_0x39b3a5});}})['then'](function(){_0x572a29['forEach'](function(_0x4dd8fa){socket[_0x20d4('0x5c')]('userChatQueue:remove',{'UserId':_0x4dd8fa,'ChatQueueId':_0x4b60e5['id']});});});});});});})[_0x20d4('0x17')](respondWithStatusCode(_0x43bf2d,null))[_0x20d4('0x3a')](handleError(_0x43bf2d,null));};exports[_0x20d4('0x72')]=function(_0x3d26a5,_0x18bb32){return db[_0x20d4('0x24')]['find']({'where':{'id':_0x3d26a5[_0x20d4('0x29')]['id']}})[_0x20d4('0x17')](handleEntityNotFound(_0x18bb32,null))[_0x20d4('0x17')](function(_0x45a998){if(_0x45a998){return _0x45a998['addAgents'](_0x3d26a5['body'][_0x20d4('0x53')],_[_0x20d4('0x73')](_0x3d26a5[_0x20d4('0x33')],[_0x20d4('0x53'),'id'])||{})[_0x20d4('0x74')](function(_0x49756d){for(var _0x2d9dfb=0x0;_0x2d9dfb<_0x3d26a5[_0x20d4('0x33')]['ids'][_0x20d4('0x41')];_0x2d9dfb+=0x1){socket[_0x20d4('0x5c')](_0x20d4('0x75'),{'UserId':Number(_0x3d26a5['body'][_0x20d4('0x53')][_0x2d9dfb]),'ChatQueueId':Number(_0x3d26a5[_0x20d4('0x29')]['id'])});}return _0x49756d;});}})[_0x20d4('0x17')](respondWithResult(_0x18bb32,null))['catch'](handleError(_0x18bb32,null));};exports['removeAgents']=function(_0x35ae49,_0x2db847){return db[_0x20d4('0x24')]['find']({'where':{'id':_0x35ae49[_0x20d4('0x29')]['id']}})[_0x20d4('0x17')](handleEntityNotFound(_0x2db847,null))[_0x20d4('0x17')](function(_0xf0685f){if(_0xf0685f){return _0xf0685f[_0x20d4('0x71')](_0x35ae49[_0x20d4('0x26')]['ids'])[_0x20d4('0x17')](function(){if(_[_0x20d4('0x76')](_0x35ae49['query']['ids'])){for(var _0x5233cf=0x0;_0x5233cf<_0x35ae49[_0x20d4('0x26')][_0x20d4('0x53')][_0x20d4('0x41')];_0x5233cf+=0x1){socket['emit'](_0x20d4('0x77'),{'UserId':Number(_0x35ae49['query'][_0x20d4('0x53')][_0x5233cf]),'ChatQueueId':Number(_0x35ae49[_0x20d4('0x29')]['id'])});}}else{socket['emit'](_0x20d4('0x77'),{'UserId':Number(_0x35ae49[_0x20d4('0x26')][_0x20d4('0x53')]),'ChatQueueId':Number(_0x35ae49[_0x20d4('0x29')]['id'])});}});}})[_0x20d4('0x17')](respondWithStatusCode(_0x2db847,null))[_0x20d4('0x3a')](handleError(_0x2db847,null));};exports[_0x20d4('0x78')]=function(_0x46e200,_0x2ceff9){var _0x3fea7e={};var _0x1d6a2c={};var _0x107ee8;var _0x48fb7b;return db[_0x20d4('0x24')][_0x20d4('0x3d')]({'where':{'id':_0x46e200[_0x20d4('0x29')]['id']}})['then'](handleEntityNotFound(_0x2ceff9,null))[_0x20d4('0x17')](function(_0x19447a){if(_0x19447a){_0x107ee8=_0x19447a;_0x1d6a2c[_0x20d4('0x2a')]=_[_0x20d4('0x2b')](db['User']['rawAttributes']);_0x1d6a2c[_0x20d4('0x26')]=_[_0x20d4('0x2b')](_0x46e200[_0x20d4('0x26')]);_0x1d6a2c['filters']=_[_0x20d4('0x2c')](_0x1d6a2c[_0x20d4('0x2a')],_0x1d6a2c[_0x20d4('0x26')]);_0x3fea7e[_0x20d4('0x2e')]=_[_0x20d4('0x2c')](_0x1d6a2c['model'],qs[_0x20d4('0x2d')](_0x46e200[_0x20d4('0x26')][_0x20d4('0x2d')]));_0x3fea7e['attributes']=_0x3fea7e['attributes'][_0x20d4('0x41')]?_0x3fea7e[_0x20d4('0x2e')]:_0x1d6a2c[_0x20d4('0x2a')];_0x3fea7e[_0x20d4('0x51')]=qs[_0x20d4('0x44')](_0x46e200[_0x20d4('0x26')][_0x20d4('0x44')]);_0x3fea7e['where']=qs['filters'](_['pick'](_0x46e200['query'],_0x1d6a2c['filters']));if(_0x46e200['query']['filter']){_0x3fea7e[_0x20d4('0x23')]=_[_0x20d4('0x30')](_0x3fea7e[_0x20d4('0x23')],{'$or':_['map'](_0x3fea7e[_0x20d4('0x2e')],function(_0x580730){var _0x2a4dce={};_0x2a4dce[_0x580730]={'$like':'%'+_0x46e200[_0x20d4('0x26')][_0x20d4('0x46')]+'%'};return _0x2a4dce;})});}_0x3fea7e=_[_0x20d4('0x30')]({},_0x3fea7e,_0x46e200[_0x20d4('0x31')]);return _0x107ee8['getAgents'](_0x3fea7e);}})[_0x20d4('0x17')](function(_0x406bb9){if(_0x406bb9){_0x48fb7b=_0x406bb9[_0x20d4('0x41')];if(!_0x46e200[_0x20d4('0x26')]['hasOwnProperty'](_0x20d4('0x43'))){_0x3fea7e[_0x20d4('0x12')]=qs[_0x20d4('0x12')](_0x46e200[_0x20d4('0x26')]['limit']);_0x3fea7e['offset']=qs['offset'](_0x46e200[_0x20d4('0x26')]['offset']);}return _0x107ee8[_0x20d4('0x78')](_0x3fea7e);}})['then'](function(_0x5f08ab){if(_0x5f08ab){return _0x5f08ab?{'count':_0x48fb7b,'rows':_0x5f08ab}:null;}})[_0x20d4('0x17')](respondWithResult(_0x2ceff9,null))[_0x20d4('0x3a')](handleError(_0x2ceff9,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 651c59f..102e8da 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 _0x0911=['hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','setMaxListeners','update','remove','emit'];(function(_0x4a130c,_0x4283a4){var _0x2c75e9=function(_0x564252){while(--_0x564252){_0x4a130c['push'](_0x4a130c['shift']());}};_0x2c75e9(++_0x4283a4);}(_0x0911,0xed));var _0x1091=function(_0x5ca5bc,_0x5b8a9d){_0x5ca5bc=_0x5ca5bc-0x0;var _0x26ca86=_0x0911[_0x5ca5bc];return _0x26ca86;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x1091('0x0'))['db'][_0x1091('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1091('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1091('0x3'),'afterDestroy':_0x1091('0x4')};function emitEvent(_0x4517f9){return function(_0x1202e2,_0x53f2f5,_0x1ab2ed){ChatQueueEvents['emit'](_0x4517f9+':'+_0x1202e2['id'],_0x1202e2);ChatQueueEvents[_0x1091('0x5')](_0x4517f9,_0x1202e2);_0x1ab2ed(null);};}for(var e in events){if(events[_0x1091('0x6')](e)){var event=events[e];ChatQueue[_0x1091('0x7')](e,emitEvent(event));}}module[_0x1091('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x57d4=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x57d4,0x78));var _0x457d=function(_0x1075ac,_0x3a72f7){_0x1075ac=_0x1075ac-0x0;var _0x1146cf=_0x57d4[_0x1075ac];return _0x1146cf;};'use strict';var EventEmitter=require(_0x457d('0x0'));var ChatQueue=require(_0x457d('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x457d('0x2')](0x0);var events={'afterCreate':_0x457d('0x3'),'afterUpdate':_0x457d('0x4'),'afterDestroy':_0x457d('0x5')};function emitEvent(_0x1219e1){return function(_0x3c89b2,_0x3e2239,_0x1f5b4e){ChatQueueEvents[_0x457d('0x6')](_0x1219e1+':'+_0x3c89b2['id'],_0x3c89b2);ChatQueueEvents[_0x457d('0x6')](_0x1219e1,_0x3c89b2);_0x1f5b4e(null);};}for(var e in events){if(events[_0x457d('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x457d('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 aca24c9..1e699c4 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 _0xbb76=['define','ChatQueue','chat_queues','lodash','util','../../config/logger','moment','path','../../config/environment','./chatQueue.attributes','exports'];(function(_0x60d09,_0x26cd05){var _0x515079=function(_0x5e951a){while(--_0x5e951a){_0x60d09['push'](_0x60d09['shift']());}};_0x515079(++_0x26cd05);}(_0xbb76,0x14d));var _0x6bb7=function(_0x333fed,_0x3d2122){_0x333fed=_0x333fed-0x0;var _0x12cac2=_0xbb76[_0x333fed];return _0x12cac2;};'use strict';var _=require(_0x6bb7('0x0'));var util=require(_0x6bb7('0x1'));var logger=require(_0x6bb7('0x2'))('api');var moment=require(_0x6bb7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6bb7('0x4'));var rimraf=require('rimraf');var config=require(_0x6bb7('0x5'));var attributes=require(_0x6bb7('0x6'));module[_0x6bb7('0x7')]=function(_0x161690,_0x554632){return _0x161690[_0x6bb7('0x8')](_0x6bb7('0x9'),attributes,{'tableName':_0x6bb7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x22c9=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues'];(function(_0x4c404f,_0x26dfd){var _0x18a1e5=function(_0x3776e7){while(--_0x3776e7){_0x4c404f['push'](_0x4c404f['shift']());}};_0x18a1e5(++_0x26dfd);}(_0x22c9,0x1ec));var _0x922c=function(_0x41a596,_0x9963c){_0x41a596=_0x41a596-0x0;var _0x48cad1=_0x22c9[_0x41a596];return _0x48cad1;};'use strict';var _=require('lodash');var util=require(_0x922c('0x0'));var logger=require(_0x922c('0x1'))('api');var moment=require(_0x922c('0x2'));var BPromise=require('bluebird');var rp=require(_0x922c('0x3'));var fs=require('fs');var path=require(_0x922c('0x4'));var rimraf=require(_0x922c('0x5'));var config=require(_0x922c('0x6'));var attributes=require(_0x922c('0x7'));module[_0x922c('0x8')]=function(_0x167731,_0x2dee10){return _0x167731[_0x922c('0x9')](_0x922c('0xa'),attributes,{'tableName':_0x922c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 1486b55..d2ec311 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 _0x4060=['ChatQueue','findAll','options','attributes','limit','include','map','model','catch','ShowChatQueue','find','raw','where','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetChatQueue'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x4060,0x89));var _0x0406=function(_0x53a5f2,_0x5e3a35){_0x53a5f2=_0x53a5f2-0x0;var _0x4666ac=_0x4060[_0x53a5f2];return _0x4666ac;};'use strict';var _=require('lodash');var util=require(_0x0406('0x0'));var moment=require('moment');var BPromise=require(_0x0406('0x1'));var rs=require(_0x0406('0x2'));var fs=require('fs');var Redis=require(_0x0406('0x3'));var db=require(_0x0406('0x4'))['db'];var utils=require(_0x0406('0x5'));var logger=require(_0x0406('0x6'))('rpc');var config=require(_0x0406('0x7'));var jayson=require(_0x0406('0x8'));var client=jayson['client'][_0x0406('0x9')]({'port':0x232a});config[_0x0406('0xa')]=_['defaults'](config[_0x0406('0xa')],{'host':_0x0406('0xb'),'port':0x18eb});var socket=require(_0x0406('0xc'))(new Redis(config[_0x0406('0xa')]));require(_0x0406('0xd'))[_0x0406('0xe')](socket);function respondWithRpcPromise(_0x22a46d,_0x397bb5,_0x514b78){return new BPromise(function(_0x93f6da,_0x28bccc){return client[_0x0406('0xf')](_0x22a46d,_0x514b78)[_0x0406('0x10')](function(_0x40af0a){logger[_0x0406('0x11')](_0x0406('0x12'),_0x397bb5,_0x0406('0x13'));logger['debug'](_0x0406('0x14'),_0x397bb5,_0x0406('0x13'),JSON[_0x0406('0x15')](_0x40af0a));if(_0x40af0a['error']){if(_0x40af0a['error'][_0x0406('0x16')]===0x1f4){logger[_0x0406('0x17')](_0x0406('0x12'),_0x397bb5,_0x40af0a[_0x0406('0x17')][_0x0406('0x18')]);return _0x28bccc(_0x40af0a[_0x0406('0x17')][_0x0406('0x18')]);}logger[_0x0406('0x17')](_0x0406('0x12'),_0x397bb5,_0x40af0a[_0x0406('0x17')][_0x0406('0x18')]);return _0x93f6da(_0x40af0a[_0x0406('0x17')][_0x0406('0x18')]);}else{logger['info'](_0x0406('0x12'),_0x397bb5,_0x0406('0x13'));_0x93f6da(_0x40af0a[_0x0406('0x19')]['message']);}})['catch'](function(_0x41a8c1){logger['error']('ChatQueue,\x20%s,\x20%s',_0x397bb5,_0x41a8c1);_0x28bccc(_0x41a8c1);});});}exports[_0x0406('0x1a')]=function(_0x5a4914){var _0x462fb8=this;return new Promise(function(_0x21ff6a,_0x3696b3){return db[_0x0406('0x1b')][_0x0406('0x1c')]({'raw':_0x5a4914[_0x0406('0x1d')]?_0x5a4914[_0x0406('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5a4914[_0x0406('0x1d')]?_0x5a4914[_0x0406('0x1d')]['where']||null:null,'attributes':_0x5a4914[_0x0406('0x1d')]?_0x5a4914[_0x0406('0x1d')][_0x0406('0x1e')]||null:null,'limit':_0x5a4914[_0x0406('0x1d')]?_0x5a4914[_0x0406('0x1d')][_0x0406('0x1f')]||null:null,'include':_0x5a4914['options']?_0x5a4914['options'][_0x0406('0x20')]?_[_0x0406('0x21')](_0x5a4914[_0x0406('0x1d')][_0x0406('0x20')],function(_0x56bbe2){return{'model':db[_0x56bbe2[_0x0406('0x22')]],'as':_0x56bbe2['as'],'attributes':_0x56bbe2[_0x0406('0x1e')],'include':_0x56bbe2[_0x0406('0x20')]?_['map'](_0x56bbe2['include'],function(_0x5eb69c){return{'model':db[_0x5eb69c['model']],'as':_0x5eb69c['as'],'attributes':_0x5eb69c['attributes'],'include':_0x5eb69c[_0x0406('0x20')]?_['map'](_0x5eb69c[_0x0406('0x20')],function(_0x59a683){return{'model':db[_0x59a683['model']],'as':_0x59a683['as'],'attributes':_0x59a683[_0x0406('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0406('0x10')](function(_0x134b80){logger[_0x0406('0x11')]('GetChatQueue',_0x5a4914);logger['debug']('GetChatQueue',_0x5a4914,JSON[_0x0406('0x15')](_0x134b80));_0x21ff6a(_0x134b80);})[_0x0406('0x23')](function(_0x2ebed6){logger[_0x0406('0x17')](_0x0406('0x1a'),_0x2ebed6[_0x0406('0x18')],_0x5a4914);_0x3696b3(_0x462fb8[_0x0406('0x17')](0x1f4,_0x2ebed6['message']));});});};exports[_0x0406('0x24')]=function(_0x5357e5){var _0x3cc40b=this;return new Promise(function(_0x391857,_0xf39b71){return db[_0x0406('0x1b')][_0x0406('0x25')]({'raw':_0x5357e5[_0x0406('0x1d')]?_0x5357e5['options'][_0x0406('0x26')]===undefined?!![]:![]:!![],'where':_0x5357e5[_0x0406('0x1d')]?_0x5357e5[_0x0406('0x1d')][_0x0406('0x27')]||null:null,'attributes':_0x5357e5[_0x0406('0x1d')]?_0x5357e5['options'][_0x0406('0x1e')]||null:null,'include':_0x5357e5['options']?_0x5357e5['options']['include']?_['map'](_0x5357e5[_0x0406('0x1d')][_0x0406('0x20')],function(_0x3dbe3e){return{'model':db[_0x3dbe3e[_0x0406('0x22')]],'as':_0x3dbe3e['as'],'attributes':_0x3dbe3e['attributes'],'include':_0x3dbe3e['include']?_[_0x0406('0x21')](_0x3dbe3e[_0x0406('0x20')],function(_0x4e420a){return{'model':db[_0x4e420a[_0x0406('0x22')]],'as':_0x4e420a['as'],'attributes':_0x4e420a['attributes'],'include':_0x4e420a[_0x0406('0x20')]?_[_0x0406('0x21')](_0x4e420a[_0x0406('0x20')],function(_0x29bdb5){return{'model':db[_0x29bdb5[_0x0406('0x22')]],'as':_0x29bdb5['as'],'attributes':_0x29bdb5['attributes']};}):[]};}):[]};}):[]:[]})[_0x0406('0x10')](function(_0x229ab1){logger['info'](_0x0406('0x24'),_0x5357e5);logger[_0x0406('0x28')](_0x0406('0x24'),_0x5357e5,JSON[_0x0406('0x15')](_0x229ab1));_0x391857(_0x229ab1);})['catch'](function(_0x2b6c69){logger[_0x0406('0x17')]('ShowChatQueue',_0x2b6c69[_0x0406('0x18')],_0x5357e5);_0xf39b71(_0x3cc40b[_0x0406('0x17')](0x1f4,_0x2b6c69[_0x0406('0x18')]));});});};
\ No newline at end of file
+var _0x3c32=['GetChatQueue','ChatQueue','options','raw','attributes','limit','include','model','map','find','ShowChatQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x356926,_0x3ce0a8){var _0x1969a3=function(_0x3ccb40){while(--_0x3ccb40){_0x356926['push'](_0x356926['shift']());}};_0x1969a3(++_0x3ce0a8);}(_0x3c32,0x161));var _0x23c3=function(_0x4e2f0a,_0x41ad99){_0x4e2f0a=_0x4e2f0a-0x0;var _0x320e0f=_0x3c32[_0x4e2f0a];return _0x320e0f;};'use strict';var _=require(_0x23c3('0x0'));var util=require(_0x23c3('0x1'));var moment=require(_0x23c3('0x2'));var BPromise=require('bluebird');var rs=require(_0x23c3('0x3'));var fs=require('fs');var Redis=require(_0x23c3('0x4'));var db=require(_0x23c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x23c3('0x6'))('rpc');var config=require(_0x23c3('0x7'));var jayson=require(_0x23c3('0x8'));var client=jayson[_0x23c3('0x9')][_0x23c3('0xa')]({'port':0x232a});config[_0x23c3('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x23c3('0xc'))(new Redis(config[_0x23c3('0xb')]));require(_0x23c3('0xd'))[_0x23c3('0xe')](socket);function respondWithRpcPromise(_0x277606,_0x1835b0,_0x28abc0){return new BPromise(function(_0x2e774f,_0x2c50a3){return client[_0x23c3('0xf')](_0x277606,_0x28abc0)[_0x23c3('0x10')](function(_0x105b8e){logger[_0x23c3('0x11')](_0x23c3('0x12'),_0x1835b0,_0x23c3('0x13'));logger[_0x23c3('0x14')](_0x23c3('0x15'),_0x1835b0,_0x23c3('0x13'),JSON[_0x23c3('0x16')](_0x105b8e));if(_0x105b8e[_0x23c3('0x17')]){if(_0x105b8e['error']['code']===0x1f4){logger[_0x23c3('0x17')](_0x23c3('0x12'),_0x1835b0,_0x105b8e[_0x23c3('0x17')][_0x23c3('0x18')]);return _0x2c50a3(_0x105b8e[_0x23c3('0x17')][_0x23c3('0x18')]);}logger[_0x23c3('0x17')]('ChatQueue,\x20%s,\x20%s',_0x1835b0,_0x105b8e['error'][_0x23c3('0x18')]);return _0x2e774f(_0x105b8e[_0x23c3('0x17')]['message']);}else{logger[_0x23c3('0x11')](_0x23c3('0x12'),_0x1835b0,_0x23c3('0x13'));_0x2e774f(_0x105b8e[_0x23c3('0x19')][_0x23c3('0x18')]);}})[_0x23c3('0x1a')](function(_0x56cc03){logger[_0x23c3('0x17')](_0x23c3('0x12'),_0x1835b0,_0x56cc03);_0x2c50a3(_0x56cc03);});});}exports[_0x23c3('0x1b')]=function(_0x47abe2){var _0x1b769b=this;return new Promise(function(_0x48a50a,_0x4c8369){return db[_0x23c3('0x1c')]['findAll']({'raw':_0x47abe2['options']?_0x47abe2[_0x23c3('0x1d')][_0x23c3('0x1e')]===undefined?!![]:![]:!![],'where':_0x47abe2[_0x23c3('0x1d')]?_0x47abe2[_0x23c3('0x1d')]['where']||null:null,'attributes':_0x47abe2[_0x23c3('0x1d')]?_0x47abe2['options'][_0x23c3('0x1f')]||null:null,'limit':_0x47abe2[_0x23c3('0x1d')]?_0x47abe2[_0x23c3('0x1d')][_0x23c3('0x20')]||null:null,'include':_0x47abe2['options']?_0x47abe2[_0x23c3('0x1d')][_0x23c3('0x21')]?_['map'](_0x47abe2[_0x23c3('0x1d')][_0x23c3('0x21')],function(_0x2864c6){return{'model':db[_0x2864c6[_0x23c3('0x22')]],'as':_0x2864c6['as'],'attributes':_0x2864c6[_0x23c3('0x1f')],'include':_0x2864c6['include']?_[_0x23c3('0x23')](_0x2864c6[_0x23c3('0x21')],function(_0x2c3a6a){return{'model':db[_0x2c3a6a[_0x23c3('0x22')]],'as':_0x2c3a6a['as'],'attributes':_0x2c3a6a[_0x23c3('0x1f')],'include':_0x2c3a6a[_0x23c3('0x21')]?_[_0x23c3('0x23')](_0x2c3a6a[_0x23c3('0x21')],function(_0x856e72){return{'model':db[_0x856e72[_0x23c3('0x22')]],'as':_0x856e72['as'],'attributes':_0x856e72[_0x23c3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x23c3('0x10')](function(_0x28c59c){logger[_0x23c3('0x11')](_0x23c3('0x1b'),_0x47abe2);logger[_0x23c3('0x14')](_0x23c3('0x1b'),_0x47abe2,JSON[_0x23c3('0x16')](_0x28c59c));_0x48a50a(_0x28c59c);})[_0x23c3('0x1a')](function(_0xd732d7){logger[_0x23c3('0x17')]('GetChatQueue',_0xd732d7['message'],_0x47abe2);_0x4c8369(_0x1b769b['error'](0x1f4,_0xd732d7[_0x23c3('0x18')]));});});};exports['ShowChatQueue']=function(_0x218b84){var _0x4cc578=this;return new Promise(function(_0x25e453,_0x66a50c){return db[_0x23c3('0x1c')][_0x23c3('0x24')]({'raw':_0x218b84[_0x23c3('0x1d')]?_0x218b84[_0x23c3('0x1d')][_0x23c3('0x1e')]===undefined?!![]:![]:!![],'where':_0x218b84['options']?_0x218b84[_0x23c3('0x1d')]['where']||null:null,'attributes':_0x218b84[_0x23c3('0x1d')]?_0x218b84[_0x23c3('0x1d')]['attributes']||null:null,'include':_0x218b84['options']?_0x218b84['options'][_0x23c3('0x21')]?_[_0x23c3('0x23')](_0x218b84[_0x23c3('0x1d')]['include'],function(_0x1201b1){return{'model':db[_0x1201b1[_0x23c3('0x22')]],'as':_0x1201b1['as'],'attributes':_0x1201b1[_0x23c3('0x1f')],'include':_0x1201b1[_0x23c3('0x21')]?_[_0x23c3('0x23')](_0x1201b1['include'],function(_0x1af626){return{'model':db[_0x1af626[_0x23c3('0x22')]],'as':_0x1af626['as'],'attributes':_0x1af626[_0x23c3('0x1f')],'include':_0x1af626['include']?_['map'](_0x1af626[_0x23c3('0x21')],function(_0x46c4cb){return{'model':db[_0x46c4cb[_0x23c3('0x22')]],'as':_0x46c4cb['as'],'attributes':_0x46c4cb[_0x23c3('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36ef2d){logger[_0x23c3('0x11')](_0x23c3('0x25'),_0x218b84);logger[_0x23c3('0x14')](_0x23c3('0x25'),_0x218b84,JSON[_0x23c3('0x16')](_0x36ef2d));_0x25e453(_0x36ef2d);})['catch'](function(_0x5876b1){logger[_0x23c3('0x17')]('ShowChatQueue',_0x5876b1[_0x23c3('0x18')],_0x218b84);_0x66a50c(_0x4cc578[_0x23c3('0x17')](0x1f4,_0x5876b1[_0x23c3('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index af5b4ed..f28af40 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 _0xd0bb=['chatQueue:','./chatQueue.events','save','remove','emit','register','length'];(function(_0x454024,_0x58ac85){var _0x47b17e=function(_0x1274ae){while(--_0x1274ae){_0x454024['push'](_0x454024['shift']());}};_0x47b17e(++_0x58ac85);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x3d0678,_0x10e9ae){_0x3d0678=_0x3d0678-0x0;var _0x7f9a43=_0xd0bb[_0x3d0678];return _0x7f9a43;};'use strict';var ChatQueueEvents=require(_0xbd0b('0x0'));var events=[_0xbd0b('0x1'),_0xbd0b('0x2'),'update'];function createListener(_0x68ea36,_0x4ab08f){return function(_0x39b03a){_0x4ab08f[_0xbd0b('0x3')](_0x68ea36,_0x39b03a);};}function removeListener(_0x53e6ce,_0x432acf){return function(){ChatQueueEvents['removeListener'](_0x53e6ce,_0x432acf);};}exports[_0xbd0b('0x4')]=function(_0x1b2499){for(var _0x158b5c=0x0,_0x37c205=events[_0xbd0b('0x5')];_0x158b5c<_0x37c205;_0x158b5c++){var _0x5eb975=events[_0x158b5c];var _0x2a4075=createListener(_0xbd0b('0x6')+_0x5eb975,_0x1b2499);ChatQueueEvents['on'](_0x5eb975,_0x2a4075);}};
\ No newline at end of file
+var _0x8d0e=['save','remove','update','emit','removeListener','length','chatQueue:','./chatQueue.events'];(function(_0x276cc9,_0x17774c){var _0x31ac6b=function(_0x3197da){while(--_0x3197da){_0x276cc9['push'](_0x276cc9['shift']());}};_0x31ac6b(++_0x17774c);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x52acab,_0x49b6e8){_0x52acab=_0x52acab-0x0;var _0x5118f1=_0x8d0e[_0x52acab];return _0x5118f1;};'use strict';var ChatQueueEvents=require(_0xe8d0('0x0'));var events=[_0xe8d0('0x1'),_0xe8d0('0x2'),_0xe8d0('0x3')];function createListener(_0x2eae0c,_0x3584ab){return function(_0x15521e){_0x3584ab[_0xe8d0('0x4')](_0x2eae0c,_0x15521e);};}function removeListener(_0x32cee9,_0x579cb9){return function(){ChatQueueEvents[_0xe8d0('0x5')](_0x32cee9,_0x579cb9);};}exports['register']=function(_0x560dab){for(var _0x2e2985=0x0,_0x92483d=events[_0xe8d0('0x6')];_0x2e2985<_0x92483d;_0x2e2985++){var _0xcc03d0=events[_0x2e2985];var _0x2b6dce=createListener(_0xe8d0('0x7')+_0xcc03d0,_0x560dab);ChatQueueEvents['on'](_0xcc03d0,_0x2b6dce);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 8c8972f..401189c 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0x5fc3[_0x382c73];return _0x1dd0bf;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x5fc3,0xa8));var _0x35fc=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x5fc3[_0x166742];return _0xb7814a;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 460deaa..a3b09bc 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 _0x3827=['STRING','DATE','moment'];(function(_0x97a9a9,_0x301335){var _0x221cc9=function(_0x38efcb){while(--_0x38efcb){_0x97a9a9['push'](_0x97a9a9['shift']());}};_0x221cc9(++_0x301335);}(_0x3827,0x1c4));var _0x7382=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x3827[_0x62c958];return _0x57ec61;};'use strict';var moment=require(_0x7382('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x7382('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x7382('0x1')]},'joinAt':{'type':Sequelize[_0x7382('0x2')]},'leaveAt':{'type':Sequelize[_0x7382('0x2')]},'acceptAt':{'type':Sequelize[_0x7382('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3e84=['moment','sequelize','exports','STRING','DATE'];(function(_0x49aeff,_0xc94346){var _0x2ba529=function(_0x3900c5){while(--_0x3900c5){_0x49aeff['push'](_0x49aeff['shift']());}};_0x2ba529(++_0xc94346);}(_0x3e84,0xaf));var _0x43e8=function(_0x15ad3f,_0x1d6280){_0x15ad3f=_0x15ad3f-0x0;var _0xfb1d10=_0x3e84[_0x15ad3f];return _0xfb1d10;};'use strict';var moment=require(_0x43e8('0x0'));var Sequelize=require(_0x43e8('0x1'));module[_0x43e8('0x2')]={'uniqueid':{'type':Sequelize[_0x43e8('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x43e8('0x3')]},'joinAt':{'type':Sequelize[_0x43e8('0x4')]},'leaveAt':{'type':Sequelize[_0x43e8('0x4')]},'acceptAt':{'type':Sequelize[_0x43e8('0x4')]},'exitAt':{'type':Sequelize[_0x43e8('0x4')]},'reason':{'type':Sequelize[_0x43e8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index f22962a..00b61a4 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 _0x9264=['key','model','query','filters','attributes','intersection','fields','length','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','show','params','keys','includeAll','include','options','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x4926('0x0'));var rimraf=require(_0x4926('0x1'));var zipdir=require(_0x4926('0x2'));var jsonpatch=require(_0x4926('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4926('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4926('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4926('0x6'));var _=require(_0x4926('0x7'));var squel=require('squel');var crypto=require(_0x4926('0x8'));var jsforce=require(_0x4926('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x4926('0xa'));var querystring=require(_0x4926('0xb'));var Papa=require(_0x4926('0xc'));var Redis=require('ioredis');var authService=require(_0x4926('0xd'));var qs=require(_0x4926('0xe'));var as=require(_0x4926('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4926('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x4926('0x11'));var licenseUtil=require(_0x4926('0x12'));var db=require(_0x4926('0x13'))['db'];function respondWithStatusCode(_0x5423a3,_0xd3cbc){_0xd3cbc=_0xd3cbc||0xcc;return function(_0x21eae1){if(_0x21eae1){return _0x5423a3[_0x4926('0x14')](_0xd3cbc);}return _0x5423a3[_0x4926('0x15')](_0xd3cbc)[_0x4926('0x16')]();};}function respondWithResult(_0x2a2105,_0x2f466b){_0x2f466b=_0x2f466b||0xc8;return function(_0x1a280b){if(_0x1a280b){return _0x2a2105[_0x4926('0x15')](_0x2f466b)[_0x4926('0x17')](_0x1a280b);}};}function respondWithFilteredResult(_0xac0db7,_0x1fbb5d){return function(_0x3018cb){if(_0x3018cb){var _0x1ac74f=typeof _0x1fbb5d['offset']===_0x4926('0x18')&&typeof _0x1fbb5d[_0x4926('0x19')]===_0x4926('0x18');var _0x5736dd=_0x3018cb['count'];var _0x1dd78e=_0x1ac74f?0x0:_0x1fbb5d['offset'];var _0x214e36=_0x1ac74f?_0x3018cb[_0x4926('0x1a')]:_0x1fbb5d['offset']+_0x1fbb5d[_0x4926('0x19')];var _0x49461e;if(_0x214e36>=_0x5736dd){_0x214e36=_0x5736dd;_0x49461e=0xc8;}else{_0x49461e=0xce;}_0xac0db7[_0x4926('0x15')](_0x49461e);return _0xac0db7[_0x4926('0x1b')](_0x4926('0x1c'),_0x1dd78e+'-'+_0x214e36+'/'+_0x5736dd)[_0x4926('0x17')](_0x3018cb);}return null;};}function patchUpdates(_0x5b7588){return function(_0x59dc6a){try{jsonpatch[_0x4926('0x1d')](_0x59dc6a,_0x5b7588,!![]);}catch(_0x588c7a){return BPromise['reject'](_0x588c7a);}return _0x59dc6a[_0x4926('0x1e')]();};}function saveUpdates(_0x309c71,_0x55d055){return function(_0xfd1095){if(_0xfd1095){return _0xfd1095['update'](_0x309c71)[_0x4926('0x1f')](function(_0x55e459){return _0x55e459;});}return null;};}function removeEntity(_0x10d0b2,_0x34d600){return function(_0x2df18c){if(_0x2df18c){return _0x2df18c[_0x4926('0x20')]()['then'](function(){_0x10d0b2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c02e7,_0xbfbe1b){return function(_0x43c077){if(!_0x43c077){_0x1c02e7[_0x4926('0x14')](0x194);}return _0x43c077;};}function handleError(_0x51be4f,_0x508dea){_0x508dea=_0x508dea||0x1f4;return function(_0x55413a){logger[_0x4926('0x21')](_0x55413a[_0x4926('0x22')]);if(_0x55413a[_0x4926('0x23')]){delete _0x55413a['name'];}_0x51be4f['status'](_0x508dea)['send'](_0x55413a);};}exports[_0x4926('0x24')]=function(_0x3f06a3,_0xbfe28d){var _0x4bd08d={},_0x180421={},_0x9d610c={'count':0x0,'rows':[]};var _0x3f4a69=_[_0x4926('0x25')](db[_0x4926('0x26')][_0x4926('0x27')],function(_0x5a44a9){return{'name':_0x5a44a9[_0x4926('0x28')],'type':_0x5a44a9[_0x4926('0x29')][_0x4926('0x2a')]};});_0x180421[_0x4926('0x2b')]=_[_0x4926('0x25')](_0x3f4a69,_0x4926('0x23'));_0x180421[_0x4926('0x2c')]=_['keys'](_0x3f06a3[_0x4926('0x2c')]);_0x180421[_0x4926('0x2d')]=_['intersection'](_0x180421[_0x4926('0x2b')],_0x180421[_0x4926('0x2c')]);_0x4bd08d[_0x4926('0x2e')]=_[_0x4926('0x2f')](_0x180421[_0x4926('0x2b')],qs[_0x4926('0x30')](_0x3f06a3[_0x4926('0x2c')][_0x4926('0x30')]));_0x4bd08d[_0x4926('0x2e')]=_0x4bd08d[_0x4926('0x2e')][_0x4926('0x31')]?_0x4bd08d[_0x4926('0x2e')]:_0x180421[_0x4926('0x2b')];if(!_0x3f06a3[_0x4926('0x2c')]['hasOwnProperty'](_0x4926('0x32'))){_0x4bd08d[_0x4926('0x19')]=qs[_0x4926('0x19')](_0x3f06a3[_0x4926('0x2c')]['limit']);_0x4bd08d[_0x4926('0x33')]=qs[_0x4926('0x33')](_0x3f06a3[_0x4926('0x2c')][_0x4926('0x33')]);}_0x4bd08d[_0x4926('0x34')]=qs['sort'](_0x3f06a3[_0x4926('0x2c')][_0x4926('0x35')]);_0x4bd08d[_0x4926('0x36')]=qs['filters'](_[_0x4926('0x37')](_0x3f06a3[_0x4926('0x2c')],_0x180421[_0x4926('0x2d')]),_0x3f4a69);if(_0x3f06a3[_0x4926('0x2c')][_0x4926('0x38')]){_0x4bd08d[_0x4926('0x36')]=_['merge'](_0x4bd08d[_0x4926('0x36')],{'$or':_[_0x4926('0x25')](_0x3f4a69,function(_0x3c5595){if(_0x3c5595[_0x4926('0x29')]!==_0x4926('0x39')){var _0x5237f4={};_0x5237f4[_0x3c5595[_0x4926('0x23')]]={'$like':'%'+_0x3f06a3[_0x4926('0x2c')][_0x4926('0x38')]+'%'};return _0x5237f4;}})});}_0x4bd08d=_[_0x4926('0x3a')]({},_0x4bd08d,_0x3f06a3['options']);var _0x505de3={'where':_0x4bd08d['where']};return db[_0x4926('0x26')][_0x4926('0x1a')](_0x505de3)[_0x4926('0x1f')](function(_0x1d97db){_0x9d610c[_0x4926('0x1a')]=_0x1d97db;if(_0x3f06a3['query']['includeAll']){_0x4bd08d['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x4926('0x3b')](_0x4bd08d);})[_0x4926('0x1f')](function(_0x4380da){_0x9d610c[_0x4926('0x3c')]=_0x4380da;return _0x9d610c;})[_0x4926('0x1f')](respondWithFilteredResult(_0xbfe28d,_0x4bd08d))['catch'](handleError(_0xbfe28d,null));};exports[_0x4926('0x3d')]=function(_0x203f24,_0x218631){var _0x9dc879={'raw':!![],'where':{'id':_0x203f24[_0x4926('0x3e')]['id']}},_0x437800={};_0x437800[_0x4926('0x2b')]=_[_0x4926('0x3f')](db[_0x4926('0x26')][_0x4926('0x27')]);_0x437800['query']=_['keys'](_0x203f24[_0x4926('0x2c')]);_0x437800['filters']=_[_0x4926('0x2f')](_0x437800[_0x4926('0x2b')],_0x437800[_0x4926('0x2c')]);_0x9dc879['attributes']=_[_0x4926('0x2f')](_0x437800[_0x4926('0x2b')],qs[_0x4926('0x30')](_0x203f24[_0x4926('0x2c')][_0x4926('0x30')]));_0x9dc879[_0x4926('0x2e')]=_0x9dc879[_0x4926('0x2e')][_0x4926('0x31')]?_0x9dc879[_0x4926('0x2e')]:_0x437800[_0x4926('0x2b')];if(_0x203f24[_0x4926('0x2c')][_0x4926('0x40')]){_0x9dc879[_0x4926('0x41')]=[{'all':!![]}];}_0x9dc879=_[_0x4926('0x3a')]({},_0x9dc879,_0x203f24[_0x4926('0x42')]);return db['ChatQueueReport'][_0x4926('0x43')](_0x9dc879)[_0x4926('0x1f')](handleEntityNotFound(_0x218631,null))['then'](respondWithResult(_0x218631,null))[_0x4926('0x44')](handleError(_0x218631,null));};exports[_0x4926('0x45')]=function(_0x416968,_0x572c91){return db[_0x4926('0x26')][_0x4926('0x45')](_0x416968[_0x4926('0x46')],{})[_0x4926('0x1f')](respondWithResult(_0x572c91,0xc9))[_0x4926('0x44')](handleError(_0x572c91,null));};exports[_0x4926('0x47')]=function(_0x43764f,_0x12a89b){if(_0x43764f['body']['id']){delete _0x43764f[_0x4926('0x46')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x43764f[_0x4926('0x3e')]['id']}})[_0x4926('0x1f')](handleEntityNotFound(_0x12a89b,null))['then'](saveUpdates(_0x43764f[_0x4926('0x46')],null))[_0x4926('0x1f')](respondWithResult(_0x12a89b,null))[_0x4926('0x44')](handleError(_0x12a89b,null));};exports[_0x4926('0x20')]=function(_0x15d338,_0x84f5b0){return db['ChatQueueReport']['find']({'where':{'id':_0x15d338['params']['id']}})['then'](handleEntityNotFound(_0x84f5b0,null))[_0x4926('0x1f')](removeEntity(_0x84f5b0,null))[_0x4926('0x44')](handleError(_0x84f5b0,null));};exports[_0x4926('0x48')]=function(_0x298818,_0x1abcdd){return db[_0x4926('0x26')]['describe']()[_0x4926('0x1f')](respondWithResult(_0x1abcdd,null))[_0x4926('0x44')](handleError(_0x1abcdd,null));};
\ No newline at end of file
+var _0x8fcd=['order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','rows','catch','params','intersection','merge','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','then','destroy','end','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3bcc49,_0x113059){var _0x6d0f75=function(_0x305a86){while(--_0x305a86){_0x3bcc49['push'](_0x3bcc49['shift']());}};_0x6d0f75(++_0x113059);}(_0x8fcd,0xa1));var _0xd8fc=function(_0x66ff8e,_0x56ecee){_0x66ff8e=_0x66ff8e-0x0;var _0x50a1f3=_0x8fcd[_0x66ff8e];return _0x50a1f3;};'use strict';var emlformat=require(_0xd8fc('0x0'));var rimraf=require(_0xd8fc('0x1'));var zipdir=require(_0xd8fc('0x2'));var jsonpatch=require(_0xd8fc('0x3'));var rp=require(_0xd8fc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd8fc('0x5'));var util=require(_0xd8fc('0x6'));var path=require(_0xd8fc('0x7'));var sox=require(_0xd8fc('0x8'));var csv=require(_0xd8fc('0x9'));var ejs=require(_0xd8fc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd8fc('0xb'));var crypto=require('crypto');var jsforce=require(_0xd8fc('0xc'));var deskjs=require(_0xd8fc('0xd'));var toCsv=require(_0xd8fc('0x9'));var querystring=require(_0xd8fc('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd8fc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd8fc('0x10'));var logger=require(_0xd8fc('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xd8fc('0x12'));var licenseUtil=require(_0xd8fc('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c41e9,_0x955550){_0x955550=_0x955550||0xcc;return function(_0x2b9d7e){if(_0x2b9d7e){return _0x3c41e9[_0xd8fc('0x14')](_0x955550);}return _0x3c41e9[_0xd8fc('0x15')](_0x955550)['end']();};}function respondWithResult(_0x32b375,_0x4f1064){_0x4f1064=_0x4f1064||0xc8;return function(_0x4761f){if(_0x4761f){return _0x32b375[_0xd8fc('0x15')](_0x4f1064)[_0xd8fc('0x16')](_0x4761f);}};}function respondWithFilteredResult(_0x524bac,_0x426e56){return function(_0x233c7e){if(_0x233c7e){var _0x57838b=typeof _0x426e56['offset']===_0xd8fc('0x17')&&typeof _0x426e56[_0xd8fc('0x18')]===_0xd8fc('0x17');var _0x4daf69=_0x233c7e[_0xd8fc('0x19')];var _0x1c744d=_0x57838b?0x0:_0x426e56[_0xd8fc('0x1a')];var _0x1cb0d4=_0x57838b?_0x233c7e[_0xd8fc('0x19')]:_0x426e56[_0xd8fc('0x1a')]+_0x426e56[_0xd8fc('0x18')];var _0x1d7e77;if(_0x1cb0d4>=_0x4daf69){_0x1cb0d4=_0x4daf69;_0x1d7e77=0xc8;}else{_0x1d7e77=0xce;}_0x524bac[_0xd8fc('0x15')](_0x1d7e77);return _0x524bac['set'](_0xd8fc('0x1b'),_0x1c744d+'-'+_0x1cb0d4+'/'+_0x4daf69)[_0xd8fc('0x16')](_0x233c7e);}return null;};}function patchUpdates(_0x24001d){return function(_0x3f9d57){try{jsonpatch[_0xd8fc('0x1c')](_0x3f9d57,_0x24001d,!![]);}catch(_0xd24b3f){return BPromise['reject'](_0xd24b3f);}return _0x3f9d57[_0xd8fc('0x1d')]();};}function saveUpdates(_0x3f0196,_0x5cd1f9){return function(_0x37a93b){if(_0x37a93b){return _0x37a93b['update'](_0x3f0196)[_0xd8fc('0x1e')](function(_0x370a62){return _0x370a62;});}return null;};}function removeEntity(_0x59b0ef,_0x5c852a){return function(_0x47ccff){if(_0x47ccff){return _0x47ccff[_0xd8fc('0x1f')]()[_0xd8fc('0x1e')](function(){_0x59b0ef[_0xd8fc('0x15')](0xcc)[_0xd8fc('0x20')]();});}};}function handleEntityNotFound(_0x495bd2,_0x71dcc1){return function(_0x45ac21){if(!_0x45ac21){_0x495bd2['sendStatus'](0x194);}return _0x45ac21;};}function handleError(_0x270204,_0x5e50c4){_0x5e50c4=_0x5e50c4||0x1f4;return function(_0x200a2b){logger[_0xd8fc('0x21')](_0x200a2b[_0xd8fc('0x22')]);if(_0x200a2b[_0xd8fc('0x23')]){delete _0x200a2b['name'];}_0x270204[_0xd8fc('0x15')](_0x5e50c4)['send'](_0x200a2b);};}exports[_0xd8fc('0x24')]=function(_0x1692d0,_0x4e823d){var _0x4a5383={},_0x56a980={},_0x3bec97={'count':0x0,'rows':[]};var _0x2081ca=_[_0xd8fc('0x25')](db[_0xd8fc('0x26')][_0xd8fc('0x27')],function(_0x281559){return{'name':_0x281559[_0xd8fc('0x28')],'type':_0x281559[_0xd8fc('0x29')][_0xd8fc('0x2a')]};});_0x56a980['model']=_[_0xd8fc('0x25')](_0x2081ca,_0xd8fc('0x23'));_0x56a980['query']=_[_0xd8fc('0x2b')](_0x1692d0[_0xd8fc('0x2c')]);_0x56a980[_0xd8fc('0x2d')]=_['intersection'](_0x56a980[_0xd8fc('0x2e')],_0x56a980[_0xd8fc('0x2c')]);_0x4a5383[_0xd8fc('0x2f')]=_['intersection'](_0x56a980['model'],qs['fields'](_0x1692d0[_0xd8fc('0x2c')][_0xd8fc('0x30')]));_0x4a5383[_0xd8fc('0x2f')]=_0x4a5383[_0xd8fc('0x2f')][_0xd8fc('0x31')]?_0x4a5383[_0xd8fc('0x2f')]:_0x56a980[_0xd8fc('0x2e')];if(!_0x1692d0[_0xd8fc('0x2c')][_0xd8fc('0x32')](_0xd8fc('0x33'))){_0x4a5383['limit']=qs[_0xd8fc('0x18')](_0x1692d0['query'][_0xd8fc('0x18')]);_0x4a5383['offset']=qs['offset'](_0x1692d0[_0xd8fc('0x2c')][_0xd8fc('0x1a')]);}_0x4a5383[_0xd8fc('0x34')]=qs[_0xd8fc('0x35')](_0x1692d0[_0xd8fc('0x2c')][_0xd8fc('0x35')]);_0x4a5383['where']=qs[_0xd8fc('0x2d')](_[_0xd8fc('0x36')](_0x1692d0[_0xd8fc('0x2c')],_0x56a980['filters']),_0x2081ca);if(_0x1692d0[_0xd8fc('0x2c')][_0xd8fc('0x37')]){_0x4a5383['where']=_['merge'](_0x4a5383[_0xd8fc('0x38')],{'$or':_['map'](_0x2081ca,function(_0x1ac864){if(_0x1ac864['type']!==_0xd8fc('0x39')){var _0x2cd726={};_0x2cd726[_0x1ac864[_0xd8fc('0x23')]]={'$like':'%'+_0x1692d0['query'][_0xd8fc('0x37')]+'%'};return _0x2cd726;}})});}_0x4a5383=_['merge']({},_0x4a5383,_0x1692d0[_0xd8fc('0x3a')]);var _0x16f411={'where':_0x4a5383['where']};return db[_0xd8fc('0x26')][_0xd8fc('0x19')](_0x16f411)[_0xd8fc('0x1e')](function(_0x17dba2){_0x3bec97['count']=_0x17dba2;if(_0x1692d0[_0xd8fc('0x2c')][_0xd8fc('0x3b')]){_0x4a5383[_0xd8fc('0x3c')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x4a5383);})['then'](function(_0x17ffbb){_0x3bec97[_0xd8fc('0x3d')]=_0x17ffbb;return _0x3bec97;})[_0xd8fc('0x1e')](respondWithFilteredResult(_0x4e823d,_0x4a5383))[_0xd8fc('0x3e')](handleError(_0x4e823d,null));};exports['show']=function(_0x32c555,_0x145f37){var _0xaaa4b2={'raw':!![],'where':{'id':_0x32c555[_0xd8fc('0x3f')]['id']}},_0x126ff4={};_0x126ff4[_0xd8fc('0x2e')]=_[_0xd8fc('0x2b')](db['ChatQueueReport'][_0xd8fc('0x27')]);_0x126ff4[_0xd8fc('0x2c')]=_['keys'](_0x32c555[_0xd8fc('0x2c')]);_0x126ff4[_0xd8fc('0x2d')]=_[_0xd8fc('0x40')](_0x126ff4[_0xd8fc('0x2e')],_0x126ff4[_0xd8fc('0x2c')]);_0xaaa4b2[_0xd8fc('0x2f')]=_[_0xd8fc('0x40')](_0x126ff4[_0xd8fc('0x2e')],qs[_0xd8fc('0x30')](_0x32c555[_0xd8fc('0x2c')][_0xd8fc('0x30')]));_0xaaa4b2[_0xd8fc('0x2f')]=_0xaaa4b2[_0xd8fc('0x2f')][_0xd8fc('0x31')]?_0xaaa4b2['attributes']:_0x126ff4['model'];if(_0x32c555['query'][_0xd8fc('0x3b')]){_0xaaa4b2[_0xd8fc('0x3c')]=[{'all':!![]}];}_0xaaa4b2=_[_0xd8fc('0x41')]({},_0xaaa4b2,_0x32c555[_0xd8fc('0x3a')]);return db['ChatQueueReport'][_0xd8fc('0x42')](_0xaaa4b2)[_0xd8fc('0x1e')](handleEntityNotFound(_0x145f37,null))[_0xd8fc('0x1e')](respondWithResult(_0x145f37,null))[_0xd8fc('0x3e')](handleError(_0x145f37,null));};exports[_0xd8fc('0x43')]=function(_0x19b43e,_0xc12ace){return db['ChatQueueReport']['create'](_0x19b43e['body'],{})[_0xd8fc('0x1e')](respondWithResult(_0xc12ace,0xc9))[_0xd8fc('0x3e')](handleError(_0xc12ace,null));};exports[_0xd8fc('0x44')]=function(_0x13cd5d,_0x2dd8e0){if(_0x13cd5d[_0xd8fc('0x45')]['id']){delete _0x13cd5d[_0xd8fc('0x45')]['id'];}return db[_0xd8fc('0x26')][_0xd8fc('0x42')]({'where':{'id':_0x13cd5d['params']['id']}})['then'](handleEntityNotFound(_0x2dd8e0,null))[_0xd8fc('0x1e')](saveUpdates(_0x13cd5d['body'],null))[_0xd8fc('0x1e')](respondWithResult(_0x2dd8e0,null))['catch'](handleError(_0x2dd8e0,null));};exports[_0xd8fc('0x1f')]=function(_0x3d913a,_0x57206c){return db[_0xd8fc('0x26')][_0xd8fc('0x42')]({'where':{'id':_0x3d913a[_0xd8fc('0x3f')]['id']}})[_0xd8fc('0x1e')](handleEntityNotFound(_0x57206c,null))[_0xd8fc('0x1e')](removeEntity(_0x57206c,null))[_0xd8fc('0x3e')](handleError(_0x57206c,null));};exports[_0xd8fc('0x46')]=function(_0x53b2cb,_0x1d1d40){return db[_0xd8fc('0x26')]['describe']()['then'](respondWithResult(_0x1d1d40,null))[_0xd8fc('0x3e')](handleError(_0x1d1d40,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 1149803..791dcc3 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x10cf47,_0x37ecd9){var _0x4c5b51=function(_0x390360){while(--_0x390360){_0x10cf47['push'](_0x10cf47['shift']());}};_0x4c5b51(++_0x37ecd9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x5ea85d,_0x480513){var _0x4f7237=function(_0x39eac8){while(--_0x39eac8){_0x5ea85d['push'](_0x5ea85d['shift']());}};_0x4f7237(++_0x480513);}(_0xb7e7,0x121));var _0x7b7e=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xb7e7[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index d5a25cb..1605a5a 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 _0xdcc1=['../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','update','body','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xdcc1,0x15f));var _0x1dcc=function(_0x3b8868,_0x582cfd){_0x3b8868=_0x3b8868-0x0;var _0x504818=_0xdcc1[_0x3b8868];return _0x504818;};'use strict';var _=require(_0x1dcc('0x0'));var util=require('util');var moment=require(_0x1dcc('0x1'));var BPromise=require(_0x1dcc('0x2'));var rs=require(_0x1dcc('0x3'));var fs=require('fs');var Redis=require(_0x1dcc('0x4'));var db=require(_0x1dcc('0x5'))['db'];var utils=require(_0x1dcc('0x6'));var logger=require(_0x1dcc('0x7'))(_0x1dcc('0x8'));var config=require(_0x1dcc('0x9'));var jayson=require(_0x1dcc('0xa'));var client=jayson[_0x1dcc('0xb')][_0x1dcc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x548fd5,_0x3ac3ad,_0xa00a3){return new BPromise(function(_0x100a9e,_0x362c46){return client[_0x1dcc('0xd')](_0x548fd5,_0xa00a3)[_0x1dcc('0xe')](function(_0x39c716){logger[_0x1dcc('0xf')](_0x1dcc('0x10'),_0x3ac3ad,_0x1dcc('0x11'));logger[_0x1dcc('0x12')](_0x1dcc('0x13'),_0x3ac3ad,_0x1dcc('0x11'),JSON[_0x1dcc('0x14')](_0x39c716));if(_0x39c716[_0x1dcc('0x15')]){if(_0x39c716[_0x1dcc('0x15')][_0x1dcc('0x16')]===0x1f4){logger[_0x1dcc('0x15')](_0x1dcc('0x10'),_0x3ac3ad,_0x39c716[_0x1dcc('0x15')]['message']);return _0x362c46(_0x39c716[_0x1dcc('0x15')][_0x1dcc('0x17')]);}logger[_0x1dcc('0x15')](_0x1dcc('0x10'),_0x3ac3ad,_0x39c716['error']['message']);return _0x100a9e(_0x39c716[_0x1dcc('0x15')][_0x1dcc('0x17')]);}else{logger[_0x1dcc('0xf')](_0x1dcc('0x10'),_0x3ac3ad,'request\x20sent');_0x100a9e(_0x39c716[_0x1dcc('0x18')][_0x1dcc('0x17')]);}})[_0x1dcc('0x19')](function(_0x522406){logger[_0x1dcc('0x15')](_0x1dcc('0x10'),_0x3ac3ad,_0x522406);_0x362c46(_0x522406);});});}exports[_0x1dcc('0x1a')]=function(_0xcc8b18){var _0x23f38f=this;return new Promise(function(_0x132c04,_0x30b0fa){return db[_0x1dcc('0x1b')][_0x1dcc('0x1c')](_0xcc8b18['body'],{'raw':_0xcc8b18[_0x1dcc('0x1d')]?_0xcc8b18['options'][_0x1dcc('0x1e')]===undefined?!![]:![]:!![]})[_0x1dcc('0xe')](function(_0x3cf4cf){logger[_0x1dcc('0xf')]('CreateChatQueueReport',_0xcc8b18);logger[_0x1dcc('0x12')](_0x1dcc('0x1a'),_0xcc8b18,JSON['stringify'](_0x3cf4cf));_0x132c04(_0x3cf4cf);})['catch'](function(_0x5b01d6){logger[_0x1dcc('0x15')](_0x1dcc('0x1a'),_0x5b01d6['message'],_0xcc8b18);_0x30b0fa(_0x23f38f[_0x1dcc('0x15')](0x1f4,_0x5b01d6[_0x1dcc('0x17')]));});});};exports[_0x1dcc('0x1f')]=function(_0x5d4958){var _0x4d3843=this;return new Promise(function(_0x5ce00c,_0x2404a1){return db['ChatQueueReport'][_0x1dcc('0x20')](_0x5d4958[_0x1dcc('0x21')],{'raw':_0x5d4958[_0x1dcc('0x1d')]?_0x5d4958[_0x1dcc('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d4958[_0x1dcc('0x1d')]?_0x5d4958[_0x1dcc('0x1d')][_0x1dcc('0x22')]||null:null,'attributes':_0x5d4958[_0x1dcc('0x1d')]?_0x5d4958[_0x1dcc('0x1d')][_0x1dcc('0x23')]||null:null,'limit':_0x5d4958['options']?_0x5d4958[_0x1dcc('0x1d')]['limit']||null:null})['then'](function(_0xf24d04){logger[_0x1dcc('0xf')](_0x1dcc('0x1f'),_0x5d4958);logger[_0x1dcc('0x12')](_0x1dcc('0x1f'),_0x5d4958,JSON[_0x1dcc('0x14')](_0xf24d04));_0x5ce00c(_0xf24d04);})[_0x1dcc('0x19')](function(_0x416426){logger['error']('UpdateChatQueueReport',_0x416426['message'],_0x5d4958);_0x2404a1(_0x4d3843[_0x1dcc('0x15')](0x1f4,_0x416426['message']));});});};
\ No newline at end of file
+var _0x552b=['../../config/environment','jayson/promise','client','http','request','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','body','options','then','CreateChatQueueReport','UpdateChatQueueReport','update','raw','where','limit','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x26af6c,_0x13f7ff){var _0x3cb79a=function(_0x203ec8){while(--_0x203ec8){_0x26af6c['push'](_0x26af6c['shift']());}};_0x3cb79a(++_0x13f7ff);}(_0x552b,0x16d));var _0xb552=function(_0x45ecd9,_0x16e7dc){_0x45ecd9=_0x45ecd9-0x0;var _0x513a0c=_0x552b[_0x45ecd9];return _0x513a0c;};'use strict';var _=require(_0xb552('0x0'));var util=require('util');var moment=require(_0xb552('0x1'));var BPromise=require(_0xb552('0x2'));var rs=require(_0xb552('0x3'));var fs=require('fs');var Redis=require(_0xb552('0x4'));var db=require(_0xb552('0x5'))['db'];var utils=require(_0xb552('0x6'));var logger=require(_0xb552('0x7'))(_0xb552('0x8'));var config=require(_0xb552('0x9'));var jayson=require(_0xb552('0xa'));var client=jayson[_0xb552('0xb')][_0xb552('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c07d9,_0x4e1f99,_0x52ef68){return new BPromise(function(_0x1e858f,_0x4aed58){return client[_0xb552('0xd')](_0x3c07d9,_0x52ef68)['then'](function(_0x2f2c7d){logger[_0xb552('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x4e1f99,'request\x20sent');logger[_0xb552('0xf')](_0xb552('0x10'),_0x4e1f99,_0xb552('0x11'),JSON['stringify'](_0x2f2c7d));if(_0x2f2c7d[_0xb552('0x12')]){if(_0x2f2c7d[_0xb552('0x12')]['code']===0x1f4){logger[_0xb552('0x12')](_0xb552('0x13'),_0x4e1f99,_0x2f2c7d[_0xb552('0x12')]['message']);return _0x4aed58(_0x2f2c7d['error'][_0xb552('0x14')]);}logger['error'](_0xb552('0x13'),_0x4e1f99,_0x2f2c7d[_0xb552('0x12')][_0xb552('0x14')]);return _0x1e858f(_0x2f2c7d[_0xb552('0x12')]['message']);}else{logger[_0xb552('0xe')](_0xb552('0x13'),_0x4e1f99,_0xb552('0x11'));_0x1e858f(_0x2f2c7d[_0xb552('0x15')][_0xb552('0x14')]);}})[_0xb552('0x16')](function(_0x44b963){logger[_0xb552('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x4e1f99,_0x44b963);_0x4aed58(_0x44b963);});});}exports['CreateChatQueueReport']=function(_0x5418e5){var _0x4c187f=this;return new Promise(function(_0x4e84eb,_0x1de252){return db[_0xb552('0x17')]['create'](_0x5418e5[_0xb552('0x18')],{'raw':_0x5418e5[_0xb552('0x19')]?_0x5418e5[_0xb552('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xb552('0x1a')](function(_0x23f5e9){logger[_0xb552('0xe')]('CreateChatQueueReport',_0x5418e5);logger[_0xb552('0xf')]('CreateChatQueueReport',_0x5418e5,JSON['stringify'](_0x23f5e9));_0x4e84eb(_0x23f5e9);})['catch'](function(_0x2c26ad){logger[_0xb552('0x12')](_0xb552('0x1b'),_0x2c26ad[_0xb552('0x14')],_0x5418e5);_0x1de252(_0x4c187f[_0xb552('0x12')](0x1f4,_0x2c26ad['message']));});});};exports[_0xb552('0x1c')]=function(_0xe460fe){var _0x31acc0=this;return new Promise(function(_0x52a65e,_0x27936b){return db['ChatQueueReport'][_0xb552('0x1d')](_0xe460fe[_0xb552('0x18')],{'raw':_0xe460fe[_0xb552('0x19')]?_0xe460fe[_0xb552('0x19')][_0xb552('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe460fe[_0xb552('0x19')]?_0xe460fe[_0xb552('0x19')][_0xb552('0x1f')]||null:null,'attributes':_0xe460fe[_0xb552('0x19')]?_0xe460fe[_0xb552('0x19')]['attributes']||null:null,'limit':_0xe460fe[_0xb552('0x19')]?_0xe460fe[_0xb552('0x19')][_0xb552('0x20')]||null:null})['then'](function(_0x292673){logger[_0xb552('0xe')](_0xb552('0x1c'),_0xe460fe);logger[_0xb552('0xf')]('UpdateChatQueueReport',_0xe460fe,JSON[_0xb552('0x21')](_0x292673));_0x52a65e(_0x292673);})['catch'](function(_0x16a298){logger['error'](_0xb552('0x1c'),_0x16a298[_0xb552('0x14')],_0xe460fe);_0x27936b(_0x31acc0[_0xb552('0x12')](0x1f4,_0x16a298[_0xb552('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 6d8062d..d786ce6 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 _0x5545=['post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x4e7544,_0x17891b){var _0x1c20ee=function(_0x2c068b){while(--_0x2c068b){_0x4e7544['push'](_0x4e7544['shift']());}};_0x1c20ee(++_0x17891b);}(_0x5545,0x9e));var _0x5554=function(_0x16906e,_0x4dbb0d){_0x16906e=_0x16906e-0x0;var _0x59c212=_0x5545[_0x16906e];return _0x59c212;};'use strict';var multer=require(_0x5554('0x0'));var util=require(_0x5554('0x1'));var path=require(_0x5554('0x2'));var timeout=require(_0x5554('0x3'));var express=require(_0x5554('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5554('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5554('0x6'));var controller=require(_0x5554('0x7'));router[_0x5554('0x8')]('/',auth[_0x5554('0x9')](),controller['index']);router[_0x5554('0x8')](_0x5554('0xa'),auth['isAuthenticated'](),controller[_0x5554('0xb')]);router[_0x5554('0x8')](_0x5554('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x5554('0xd')]('/',auth[_0x5554('0x9')](),controller[_0x5554('0xe')]);router[_0x5554('0xf')](_0x5554('0xc'),auth['isAuthenticated'](),controller[_0x5554('0x10')]);router[_0x5554('0x11')](_0x5554('0xc'),auth['isAuthenticated'](),controller[_0x5554('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x849e=['get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller'];(function(_0x194a74,_0x30e27e){var _0x247694=function(_0x19963a){while(--_0x19963a){_0x194a74['push'](_0x194a74['shift']());}};_0x247694(++_0x30e27e);}(_0x849e,0x137));var _0xe849=function(_0x1abb11,_0xd68915){_0x1abb11=_0x1abb11-0x0;var _0x149a9f=_0x849e[_0x1abb11];return _0x149a9f;};'use strict';var multer=require(_0xe849('0x0'));var util=require(_0xe849('0x1'));var path=require(_0xe849('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe849('0x3')]();var fs_extra=require(_0xe849('0x4'));var auth=require(_0xe849('0x5'));var interaction=require(_0xe849('0x6'));var config=require(_0xe849('0x7'));var controller=require(_0xe849('0x8'));router[_0xe849('0x9')]('/',auth[_0xe849('0xa')](),controller[_0xe849('0xb')]);router[_0xe849('0x9')](_0xe849('0xc'),auth[_0xe849('0xa')](),controller['describe']);router[_0xe849('0x9')](_0xe849('0xd'),auth[_0xe849('0xa')](),controller[_0xe849('0xe')]);router[_0xe849('0xf')]('/',auth[_0xe849('0xa')](),controller[_0xe849('0x10')]);router[_0xe849('0x11')](_0xe849('0xd'),auth[_0xe849('0xa')](),controller[_0xe849('0x12')]);router[_0xe849('0x13')](_0xe849('0xd'),auth[_0xe849('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 508d3dd..277e9c6 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x26b985,_0xab9d1){var _0x23d808=function(_0x4b264b){while(--_0x4b264b){_0x26b985['push'](_0x26b985['shift']());}};_0x23d808(++_0xab9d1);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4184f4,_0x1cf45b){_0x4184f4=_0x4184f4-0x0;var _0x3c0e5c=_0xf4eb[_0x4184f4];return _0x3c0e5c;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
+var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x3b5ad2,_0x1e1558){var _0x584bc9=function(_0x1bfa11){while(--_0x1bfa11){_0x3b5ad2['push'](_0x3b5ad2['shift']());}};_0x584bc9(++_0x1e1558);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x45b1ba,_0x5a6a21){_0x45b1ba=_0x45b1ba-0x0;var _0x145ddb=_0xf3cd[_0x45b1ba];return _0x145ddb;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 2effe19..2460529 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 _0xaa38=['sort','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','length','find','create','ChatTransferReport','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit'];(function(_0x39fd11,_0x5d7883){var _0x302799=function(_0x4a0615){while(--_0x4a0615){_0x39fd11['push'](_0x39fd11['shift']());}};_0x302799(++_0x5d7883);}(_0xaa38,0x1da));var _0x8aa3=function(_0x1a2455,_0x578d37){_0x1a2455=_0x1a2455-0x0;var _0x336ea1=_0xaa38[_0x1a2455];return _0x336ea1;};'use strict';var emlformat=require(_0x8aa3('0x0'));var rimraf=require(_0x8aa3('0x1'));var zipdir=require(_0x8aa3('0x2'));var jsonpatch=require(_0x8aa3('0x3'));var rp=require(_0x8aa3('0x4'));var moment=require(_0x8aa3('0x5'));var BPromise=require(_0x8aa3('0x6'));var Mustache=require(_0x8aa3('0x7'));var util=require(_0x8aa3('0x8'));var path=require(_0x8aa3('0x9'));var sox=require(_0x8aa3('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa3('0xb'));var _=require(_0x8aa3('0xc'));var squel=require(_0x8aa3('0xd'));var crypto=require(_0x8aa3('0xe'));var jsforce=require(_0x8aa3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8aa3('0x10'));var querystring=require(_0x8aa3('0x11'));var Papa=require(_0x8aa3('0x12'));var Redis=require(_0x8aa3('0x13'));var authService=require(_0x8aa3('0x14'));var qs=require(_0x8aa3('0x15'));var as=require(_0x8aa3('0x16'));var hardwareService=require(_0x8aa3('0x17'));var logger=require(_0x8aa3('0x18'))(_0x8aa3('0x19'));var utils=require(_0x8aa3('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8aa3('0x1b'))['db'];function respondWithStatusCode(_0x3ed657,_0x97e0d6){_0x97e0d6=_0x97e0d6||0xcc;return function(_0x5331e4){if(_0x5331e4){return _0x3ed657[_0x8aa3('0x1c')](_0x97e0d6);}return _0x3ed657[_0x8aa3('0x1d')](_0x97e0d6)[_0x8aa3('0x1e')]();};}function respondWithResult(_0x2ffcfc,_0x2dfad2){_0x2dfad2=_0x2dfad2||0xc8;return function(_0x154b0f){if(_0x154b0f){return _0x2ffcfc['status'](_0x2dfad2)[_0x8aa3('0x1f')](_0x154b0f);}};}function respondWithFilteredResult(_0x82331e,_0x5d8f66){return function(_0x4ea09e){if(_0x4ea09e){var _0x5a6a45=typeof _0x5d8f66[_0x8aa3('0x20')]===_0x8aa3('0x21')&&typeof _0x5d8f66['limit']===_0x8aa3('0x21');var _0x129b8b=_0x4ea09e[_0x8aa3('0x22')];var _0x17ebb7=_0x5a6a45?0x0:_0x5d8f66[_0x8aa3('0x20')];var _0x1317bb=_0x5a6a45?_0x4ea09e[_0x8aa3('0x22')]:_0x5d8f66[_0x8aa3('0x20')]+_0x5d8f66['limit'];var _0x4b9d0a;if(_0x1317bb>=_0x129b8b){_0x1317bb=_0x129b8b;_0x4b9d0a=0xc8;}else{_0x4b9d0a=0xce;}_0x82331e[_0x8aa3('0x1d')](_0x4b9d0a);return _0x82331e['set'](_0x8aa3('0x23'),_0x17ebb7+'-'+_0x1317bb+'/'+_0x129b8b)[_0x8aa3('0x1f')](_0x4ea09e);}return null;};}function patchUpdates(_0x307244){return function(_0x400a19){try{jsonpatch[_0x8aa3('0x24')](_0x400a19,_0x307244,!![]);}catch(_0x369ab2){return BPromise['reject'](_0x369ab2);}return _0x400a19[_0x8aa3('0x25')]();};}function saveUpdates(_0x5d340c,_0x419197){return function(_0x24f4da){if(_0x24f4da){return _0x24f4da[_0x8aa3('0x26')](_0x5d340c)[_0x8aa3('0x27')](function(_0x215b74){return _0x215b74;});}return null;};}function removeEntity(_0x1cede2,_0x1b8a79){return function(_0x2b734b){if(_0x2b734b){return _0x2b734b['destroy']()[_0x8aa3('0x27')](function(){_0x1cede2[_0x8aa3('0x1d')](0xcc)[_0x8aa3('0x1e')]();});}};}function handleEntityNotFound(_0xa1bc81,_0x59ba5e){return function(_0x2e3749){if(!_0x2e3749){_0xa1bc81[_0x8aa3('0x1c')](0x194);}return _0x2e3749;};}function handleError(_0x2f1a7f,_0x21f223){_0x21f223=_0x21f223||0x1f4;return function(_0x273207){logger[_0x8aa3('0x28')](_0x273207[_0x8aa3('0x29')]);if(_0x273207[_0x8aa3('0x2a')]){delete _0x273207[_0x8aa3('0x2a')];}_0x2f1a7f[_0x8aa3('0x1d')](_0x21f223)[_0x8aa3('0x2b')](_0x273207);};}exports[_0x8aa3('0x2c')]=function(_0x55726b,_0x51624a){var _0x4ceae9={},_0x1649b2={},_0x53edab={'count':0x0,'rows':[]};var _0x3c3a14=_['map'](db['ChatTransferReport'][_0x8aa3('0x2d')],function(_0x4cce1d){return{'name':_0x4cce1d[_0x8aa3('0x2e')],'type':_0x4cce1d[_0x8aa3('0x2f')]['key']};});_0x1649b2[_0x8aa3('0x30')]=_[_0x8aa3('0x31')](_0x3c3a14,_0x8aa3('0x2a'));_0x1649b2[_0x8aa3('0x32')]=_[_0x8aa3('0x33')](_0x55726b[_0x8aa3('0x32')]);_0x1649b2[_0x8aa3('0x34')]=_[_0x8aa3('0x35')](_0x1649b2[_0x8aa3('0x30')],_0x1649b2[_0x8aa3('0x32')]);_0x4ceae9[_0x8aa3('0x36')]=_[_0x8aa3('0x35')](_0x1649b2[_0x8aa3('0x30')],qs[_0x8aa3('0x37')](_0x55726b[_0x8aa3('0x32')][_0x8aa3('0x37')]));_0x4ceae9[_0x8aa3('0x36')]=_0x4ceae9[_0x8aa3('0x36')]['length']?_0x4ceae9[_0x8aa3('0x36')]:_0x1649b2[_0x8aa3('0x30')];if(!_0x55726b[_0x8aa3('0x32')][_0x8aa3('0x38')]('nolimit')){_0x4ceae9[_0x8aa3('0x39')]=qs[_0x8aa3('0x39')](_0x55726b[_0x8aa3('0x32')][_0x8aa3('0x39')]);_0x4ceae9[_0x8aa3('0x20')]=qs[_0x8aa3('0x20')](_0x55726b[_0x8aa3('0x32')][_0x8aa3('0x20')]);}_0x4ceae9['order']=qs[_0x8aa3('0x3a')](_0x55726b[_0x8aa3('0x32')][_0x8aa3('0x3a')]);_0x4ceae9['where']=qs[_0x8aa3('0x34')](_['pick'](_0x55726b[_0x8aa3('0x32')],_0x1649b2['filters']),_0x3c3a14);if(_0x55726b[_0x8aa3('0x32')][_0x8aa3('0x3b')]){_0x4ceae9[_0x8aa3('0x3c')]=_[_0x8aa3('0x3d')](_0x4ceae9['where'],{'$or':_[_0x8aa3('0x31')](_0x3c3a14,function(_0x46c31c){if(_0x46c31c[_0x8aa3('0x2f')]!==_0x8aa3('0x3e')){var _0x21f516={};_0x21f516[_0x46c31c[_0x8aa3('0x2a')]]={'$like':'%'+_0x55726b['query'][_0x8aa3('0x3b')]+'%'};return _0x21f516;}})});}_0x4ceae9=_[_0x8aa3('0x3d')]({},_0x4ceae9,_0x55726b[_0x8aa3('0x3f')]);var _0x781c94={'where':_0x4ceae9[_0x8aa3('0x3c')]};return db['ChatTransferReport']['count'](_0x781c94)[_0x8aa3('0x27')](function(_0x34305d){_0x53edab[_0x8aa3('0x22')]=_0x34305d;if(_0x55726b[_0x8aa3('0x32')][_0x8aa3('0x40')]){_0x4ceae9[_0x8aa3('0x41')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x4ceae9);})[_0x8aa3('0x27')](function(_0xc46166){_0x53edab['rows']=_0xc46166;return _0x53edab;})[_0x8aa3('0x27')](respondWithFilteredResult(_0x51624a,_0x4ceae9))[_0x8aa3('0x42')](handleError(_0x51624a,null));};exports[_0x8aa3('0x43')]=function(_0x720086,_0x378449){var _0x59c17a={'raw':!![],'where':{'id':_0x720086[_0x8aa3('0x44')]['id']}},_0x38e917={};_0x38e917[_0x8aa3('0x30')]=_[_0x8aa3('0x33')](db['ChatTransferReport'][_0x8aa3('0x2d')]);_0x38e917[_0x8aa3('0x32')]=_[_0x8aa3('0x33')](_0x720086[_0x8aa3('0x32')]);_0x38e917[_0x8aa3('0x34')]=_[_0x8aa3('0x35')](_0x38e917['model'],_0x38e917[_0x8aa3('0x32')]);_0x59c17a['attributes']=_['intersection'](_0x38e917[_0x8aa3('0x30')],qs[_0x8aa3('0x37')](_0x720086[_0x8aa3('0x32')][_0x8aa3('0x37')]));_0x59c17a[_0x8aa3('0x36')]=_0x59c17a[_0x8aa3('0x36')][_0x8aa3('0x45')]?_0x59c17a[_0x8aa3('0x36')]:_0x38e917[_0x8aa3('0x30')];if(_0x720086[_0x8aa3('0x32')][_0x8aa3('0x40')]){_0x59c17a[_0x8aa3('0x41')]=[{'all':!![]}];}_0x59c17a=_['merge']({},_0x59c17a,_0x720086[_0x8aa3('0x3f')]);return db['ChatTransferReport'][_0x8aa3('0x46')](_0x59c17a)[_0x8aa3('0x27')](handleEntityNotFound(_0x378449,null))[_0x8aa3('0x27')](respondWithResult(_0x378449,null))[_0x8aa3('0x42')](handleError(_0x378449,null));};exports[_0x8aa3('0x47')]=function(_0x726e21,_0x577a47){return db[_0x8aa3('0x48')]['create'](_0x726e21['body'],{})[_0x8aa3('0x27')](respondWithResult(_0x577a47,0xc9))[_0x8aa3('0x42')](handleError(_0x577a47,null));};exports[_0x8aa3('0x26')]=function(_0x5b7517,_0x239397){if(_0x5b7517[_0x8aa3('0x49')]['id']){delete _0x5b7517[_0x8aa3('0x49')]['id'];}return db[_0x8aa3('0x48')][_0x8aa3('0x46')]({'where':{'id':_0x5b7517[_0x8aa3('0x44')]['id']}})['then'](handleEntityNotFound(_0x239397,null))[_0x8aa3('0x27')](saveUpdates(_0x5b7517['body'],null))[_0x8aa3('0x27')](respondWithResult(_0x239397,null))['catch'](handleError(_0x239397,null));};exports[_0x8aa3('0x4a')]=function(_0x1453ec,_0x31efdc){return db['ChatTransferReport'][_0x8aa3('0x46')]({'where':{'id':_0x1453ec[_0x8aa3('0x44')]['id']}})[_0x8aa3('0x27')](handleEntityNotFound(_0x31efdc,null))[_0x8aa3('0x27')](removeEntity(_0x31efdc,null))[_0x8aa3('0x42')](handleError(_0x31efdc,null));};exports[_0x8aa3('0x4b')]=function(_0x3f27e3,_0x5b09dd){return db[_0x8aa3('0x48')][_0x8aa3('0x4b')]()[_0x8aa3('0x27')](respondWithResult(_0x5b09dd,null))[_0x8aa3('0x42')](handleError(_0x5b09dd,null));};
\ No newline at end of file
+var _0x02c1=['params','merge','create','body','update','find','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','destroy','then','sendStatus','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','include','findAll','catch','show'];(function(_0x460522,_0x1018fe){var _0x3deee0=function(_0xd0a315){while(--_0xd0a315){_0x460522['push'](_0x460522['shift']());}};_0x3deee0(++_0x1018fe);}(_0x02c1,0xdf));var _0x102c=function(_0x180fe2,_0x5bdd03){_0x180fe2=_0x180fe2-0x0;var _0x43af94=_0x02c1[_0x180fe2];return _0x43af94;};'use strict';var emlformat=require(_0x102c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x102c('0x1'));var rp=require(_0x102c('0x2'));var moment=require(_0x102c('0x3'));var BPromise=require(_0x102c('0x4'));var Mustache=require('mustache');var util=require(_0x102c('0x5'));var path=require('path');var sox=require(_0x102c('0x6'));var csv=require(_0x102c('0x7'));var ejs=require(_0x102c('0x8'));var fs=require('fs');var fs_extra=require(_0x102c('0x9'));var _=require(_0x102c('0xa'));var squel=require(_0x102c('0xb'));var crypto=require('crypto');var jsforce=require(_0x102c('0xc'));var deskjs=require(_0x102c('0xd'));var toCsv=require(_0x102c('0x7'));var querystring=require('querystring');var Papa=require(_0x102c('0xe'));var Redis=require(_0x102c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x102c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x102c('0x11'));var logger=require(_0x102c('0x12'))(_0x102c('0x13'));var utils=require(_0x102c('0x14'));var config=require(_0x102c('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x86c4fa,_0x6976c7){_0x6976c7=_0x6976c7||0xcc;return function(_0x2f00ba){if(_0x2f00ba){return _0x86c4fa['sendStatus'](_0x6976c7);}return _0x86c4fa[_0x102c('0x16')](_0x6976c7)[_0x102c('0x17')]();};}function respondWithResult(_0xfdb18a,_0x5f5bc2){_0x5f5bc2=_0x5f5bc2||0xc8;return function(_0xb6c190){if(_0xb6c190){return _0xfdb18a[_0x102c('0x16')](_0x5f5bc2)[_0x102c('0x18')](_0xb6c190);}};}function respondWithFilteredResult(_0x202b3c,_0x49b792){return function(_0x29d711){if(_0x29d711){var _0x42ab9b=typeof _0x49b792[_0x102c('0x19')]==='undefined'&&typeof _0x49b792['limit']===_0x102c('0x1a');var _0x39dc98=_0x29d711[_0x102c('0x1b')];var _0x19becf=_0x42ab9b?0x0:_0x49b792[_0x102c('0x19')];var _0x1017da=_0x42ab9b?_0x29d711['count']:_0x49b792[_0x102c('0x19')]+_0x49b792[_0x102c('0x1c')];var _0x1d04c3;if(_0x1017da>=_0x39dc98){_0x1017da=_0x39dc98;_0x1d04c3=0xc8;}else{_0x1d04c3=0xce;}_0x202b3c[_0x102c('0x16')](_0x1d04c3);return _0x202b3c['set'](_0x102c('0x1d'),_0x19becf+'-'+_0x1017da+'/'+_0x39dc98)[_0x102c('0x18')](_0x29d711);}return null;};}function patchUpdates(_0x200630){return function(_0x5bded0){try{jsonpatch[_0x102c('0x1e')](_0x5bded0,_0x200630,!![]);}catch(_0x5d6e52){return BPromise[_0x102c('0x1f')](_0x5d6e52);}return _0x5bded0['save']();};}function saveUpdates(_0x520970,_0xb19974){return function(_0x5e15a9){if(_0x5e15a9){return _0x5e15a9['update'](_0x520970)['then'](function(_0x3d50bc){return _0x3d50bc;});}return null;};}function removeEntity(_0x5d9adf,_0x3aa0f8){return function(_0x4ccc9e){if(_0x4ccc9e){return _0x4ccc9e[_0x102c('0x20')]()[_0x102c('0x21')](function(){_0x5d9adf[_0x102c('0x16')](0xcc)[_0x102c('0x17')]();});}};}function handleEntityNotFound(_0xfeef04,_0x3401c3){return function(_0x2b9e94){if(!_0x2b9e94){_0xfeef04[_0x102c('0x22')](0x194);}return _0x2b9e94;};}function handleError(_0x42e36c,_0x3dbb62){_0x3dbb62=_0x3dbb62||0x1f4;return function(_0x3c2659){logger['error'](_0x3c2659[_0x102c('0x23')]);if(_0x3c2659[_0x102c('0x24')]){delete _0x3c2659[_0x102c('0x24')];}_0x42e36c[_0x102c('0x16')](_0x3dbb62)[_0x102c('0x25')](_0x3c2659);};}exports[_0x102c('0x26')]=function(_0x44fc8d,_0x2c1c9d){var _0x3289ac={},_0x2ce5e7={},_0x27e087={'count':0x0,'rows':[]};var _0x14b26e=_[_0x102c('0x27')](db[_0x102c('0x28')][_0x102c('0x29')],function(_0x119f4c){return{'name':_0x119f4c[_0x102c('0x2a')],'type':_0x119f4c[_0x102c('0x2b')][_0x102c('0x2c')]};});_0x2ce5e7[_0x102c('0x2d')]=_[_0x102c('0x27')](_0x14b26e,_0x102c('0x24'));_0x2ce5e7[_0x102c('0x2e')]=_[_0x102c('0x2f')](_0x44fc8d[_0x102c('0x2e')]);_0x2ce5e7[_0x102c('0x30')]=_[_0x102c('0x31')](_0x2ce5e7[_0x102c('0x2d')],_0x2ce5e7[_0x102c('0x2e')]);_0x3289ac[_0x102c('0x32')]=_[_0x102c('0x31')](_0x2ce5e7[_0x102c('0x2d')],qs[_0x102c('0x33')](_0x44fc8d[_0x102c('0x2e')]['fields']));_0x3289ac[_0x102c('0x32')]=_0x3289ac[_0x102c('0x32')][_0x102c('0x34')]?_0x3289ac[_0x102c('0x32')]:_0x2ce5e7['model'];if(!_0x44fc8d[_0x102c('0x2e')][_0x102c('0x35')](_0x102c('0x36'))){_0x3289ac[_0x102c('0x1c')]=qs[_0x102c('0x1c')](_0x44fc8d['query'][_0x102c('0x1c')]);_0x3289ac[_0x102c('0x19')]=qs[_0x102c('0x19')](_0x44fc8d[_0x102c('0x2e')]['offset']);}_0x3289ac['order']=qs['sort'](_0x44fc8d[_0x102c('0x2e')][_0x102c('0x37')]);_0x3289ac[_0x102c('0x38')]=qs['filters'](_[_0x102c('0x39')](_0x44fc8d[_0x102c('0x2e')],_0x2ce5e7[_0x102c('0x30')]),_0x14b26e);if(_0x44fc8d['query'][_0x102c('0x3a')]){_0x3289ac[_0x102c('0x38')]=_['merge'](_0x3289ac['where'],{'$or':_['map'](_0x14b26e,function(_0xa57a35){if(_0xa57a35[_0x102c('0x2b')]!==_0x102c('0x3b')){var _0x2163df={};_0x2163df[_0xa57a35[_0x102c('0x24')]]={'$like':'%'+_0x44fc8d['query'][_0x102c('0x3a')]+'%'};return _0x2163df;}})});}_0x3289ac=_['merge']({},_0x3289ac,_0x44fc8d[_0x102c('0x3c')]);var _0x51e718={'where':_0x3289ac[_0x102c('0x38')]};return db[_0x102c('0x28')][_0x102c('0x1b')](_0x51e718)['then'](function(_0x29ac0f){_0x27e087[_0x102c('0x1b')]=_0x29ac0f;if(_0x44fc8d[_0x102c('0x2e')]['includeAll']){_0x3289ac[_0x102c('0x3d')]=[{'all':!![]}];}return db[_0x102c('0x28')][_0x102c('0x3e')](_0x3289ac);})['then'](function(_0x2826a3){_0x27e087['rows']=_0x2826a3;return _0x27e087;})['then'](respondWithFilteredResult(_0x2c1c9d,_0x3289ac))[_0x102c('0x3f')](handleError(_0x2c1c9d,null));};exports[_0x102c('0x40')]=function(_0x4dcc64,_0x291bff){var _0x4995da={'raw':!![],'where':{'id':_0x4dcc64[_0x102c('0x41')]['id']}},_0x40e776={};_0x40e776[_0x102c('0x2d')]=_['keys'](db[_0x102c('0x28')]['rawAttributes']);_0x40e776[_0x102c('0x2e')]=_['keys'](_0x4dcc64[_0x102c('0x2e')]);_0x40e776[_0x102c('0x30')]=_[_0x102c('0x31')](_0x40e776[_0x102c('0x2d')],_0x40e776['query']);_0x4995da['attributes']=_['intersection'](_0x40e776[_0x102c('0x2d')],qs[_0x102c('0x33')](_0x4dcc64[_0x102c('0x2e')][_0x102c('0x33')]));_0x4995da[_0x102c('0x32')]=_0x4995da['attributes'][_0x102c('0x34')]?_0x4995da[_0x102c('0x32')]:_0x40e776[_0x102c('0x2d')];if(_0x4dcc64[_0x102c('0x2e')]['includeAll']){_0x4995da['include']=[{'all':!![]}];}_0x4995da=_[_0x102c('0x42')]({},_0x4995da,_0x4dcc64[_0x102c('0x3c')]);return db[_0x102c('0x28')]['find'](_0x4995da)[_0x102c('0x21')](handleEntityNotFound(_0x291bff,null))['then'](respondWithResult(_0x291bff,null))[_0x102c('0x3f')](handleError(_0x291bff,null));};exports[_0x102c('0x43')]=function(_0x12cbd1,_0x29ed7b){return db['ChatTransferReport'][_0x102c('0x43')](_0x12cbd1[_0x102c('0x44')],{})[_0x102c('0x21')](respondWithResult(_0x29ed7b,0xc9))[_0x102c('0x3f')](handleError(_0x29ed7b,null));};exports[_0x102c('0x45')]=function(_0x175c3f,_0x31f4fb){if(_0x175c3f[_0x102c('0x44')]['id']){delete _0x175c3f[_0x102c('0x44')]['id'];}return db[_0x102c('0x28')]['find']({'where':{'id':_0x175c3f[_0x102c('0x41')]['id']}})[_0x102c('0x21')](handleEntityNotFound(_0x31f4fb,null))['then'](saveUpdates(_0x175c3f[_0x102c('0x44')],null))[_0x102c('0x21')](respondWithResult(_0x31f4fb,null))[_0x102c('0x3f')](handleError(_0x31f4fb,null));};exports[_0x102c('0x20')]=function(_0x14ceaf,_0x5c7d7d){return db[_0x102c('0x28')][_0x102c('0x46')]({'where':{'id':_0x14ceaf[_0x102c('0x41')]['id']}})[_0x102c('0x21')](handleEntityNotFound(_0x5c7d7d,null))[_0x102c('0x21')](removeEntity(_0x5c7d7d,null))[_0x102c('0x3f')](handleError(_0x5c7d7d,null));};exports[_0x102c('0x47')]=function(_0x56ca11,_0x37870f){return db[_0x102c('0x28')][_0x102c('0x47')]()[_0x102c('0x21')](respondWithResult(_0x37870f,null))['catch'](handleError(_0x37870f,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 9350cca..f07dc72 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 _0x4604=['ChatTransferReport','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x45de85,_0x21c71d){var _0x28146d=function(_0x35d8a8){while(--_0x35d8a8){_0x45de85['push'](_0x45de85['shift']());}};_0x28146d(++_0x21c71d);}(_0x4604,0x152));var _0x4460=function(_0x46415b,_0x513b58){_0x46415b=_0x46415b-0x0;var _0x5bf723=_0x4604[_0x46415b];return _0x5bf723;};'use strict';var _=require(_0x4460('0x0'));var util=require('util');var logger=require(_0x4460('0x1'))('api');var moment=require(_0x4460('0x2'));var BPromise=require(_0x4460('0x3'));var rp=require(_0x4460('0x4'));var fs=require('fs');var path=require(_0x4460('0x5'));var rimraf=require(_0x4460('0x6'));var config=require(_0x4460('0x7'));var attributes=require(_0x4460('0x8'));module[_0x4460('0x9')]=function(_0xf7f02a,_0x1c0d5d){return _0xf7f02a['define'](_0x4460('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x4460('0xb'),'fields':[_0x4460('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xee12=['util','../../config/logger','api','moment','bluebird','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x440e51,_0x4fc63a){var _0x9be905=function(_0x3e685e){while(--_0x3e685e){_0x440e51['push'](_0x440e51['shift']());}};_0x9be905(++_0x4fc63a);}(_0xee12,0x137));var _0x2ee1=function(_0x32d7ae,_0x3bb40a){_0x32d7ae=_0x32d7ae-0x0;var _0x4572d0=_0xee12[_0x32d7ae];return _0x4572d0;};'use strict';var _=require(_0x2ee1('0x0'));var util=require(_0x2ee1('0x1'));var logger=require(_0x2ee1('0x2'))(_0x2ee1('0x3'));var moment=require(_0x2ee1('0x4'));var BPromise=require(_0x2ee1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2ee1('0x6'));var config=require('../../config/environment');var attributes=require(_0x2ee1('0x7'));module[_0x2ee1('0x8')]=function(_0x46ae02,_0x73ad94){return _0x46ae02[_0x2ee1('0x9')](_0x2ee1('0xa'),attributes,{'tableName':_0x2ee1('0xb'),'paranoid':![],'indexes':[{'name':_0x2ee1('0xc'),'fields':[_0x2ee1('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 7a82e9e..b1a143e 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 _0xb48a=['error','code','request\x20sent','result','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4561b5,_0x3459cb){var _0x13f689=function(_0x5877b3){while(--_0x5877b3){_0x4561b5['push'](_0x4561b5['shift']());}};_0x13f689(++_0x3459cb);}(_0xb48a,0x17c));var _0xab48=function(_0x3cd46c,_0x48428e){_0x3cd46c=_0x3cd46c-0x0;var _0x3f6ab1=_0xb48a[_0x3cd46c];return _0x3f6ab1;};'use strict';var _=require(_0xab48('0x0'));var util=require(_0xab48('0x1'));var moment=require(_0xab48('0x2'));var BPromise=require('bluebird');var rs=require(_0xab48('0x3'));var fs=require('fs');var Redis=require(_0xab48('0x4'));var db=require(_0xab48('0x5'))['db'];var utils=require(_0xab48('0x6'));var logger=require(_0xab48('0x7'))('rpc');var config=require(_0xab48('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xab48('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56f73a,_0x1cc165,_0x2fe624){return new BPromise(function(_0x2fdd2c,_0x5c9000){return client['request'](_0x56f73a,_0x2fe624)[_0xab48('0xa')](function(_0x2f3aa9){logger[_0xab48('0xb')](_0xab48('0xc'),_0x1cc165,'request\x20sent');logger[_0xab48('0xd')](_0xab48('0xe'),_0x1cc165,'request\x20sent',JSON[_0xab48('0xf')](_0x2f3aa9));if(_0x2f3aa9['error']){if(_0x2f3aa9[_0xab48('0x10')][_0xab48('0x11')]===0x1f4){logger[_0xab48('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x1cc165,_0x2f3aa9[_0xab48('0x10')]['message']);return _0x5c9000(_0x2f3aa9[_0xab48('0x10')]['message']);}logger[_0xab48('0x10')](_0xab48('0xc'),_0x1cc165,_0x2f3aa9[_0xab48('0x10')]['message']);return _0x2fdd2c(_0x2f3aa9[_0xab48('0x10')]['message']);}else{logger[_0xab48('0xb')](_0xab48('0xc'),_0x1cc165,_0xab48('0x12'));_0x2fdd2c(_0x2f3aa9[_0xab48('0x13')][_0xab48('0x14')]);}})[_0xab48('0x15')](function(_0x54a894){logger['error'](_0xab48('0xc'),_0x1cc165,_0x54a894);_0x5c9000(_0x54a894);});});}
\ No newline at end of file
+var _0xa084=['error','code','message','ChatTransferReport,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2a1f72,_0x511f42){var _0x76661=function(_0xe7f7b2){while(--_0xe7f7b2){_0x2a1f72['push'](_0x2a1f72['shift']());}};_0x76661(++_0x511f42);}(_0xa084,0x1d1));var _0x4a08=function(_0x1e9581,_0x3df1e0){_0x1e9581=_0x1e9581-0x0;var _0x1bd771=_0xa084[_0x1e9581];return _0x1bd771;};'use strict';var _=require(_0x4a08('0x0'));var util=require(_0x4a08('0x1'));var moment=require('moment');var BPromise=require(_0x4a08('0x2'));var rs=require(_0x4a08('0x3'));var fs=require('fs');var Redis=require(_0x4a08('0x4'));var db=require(_0x4a08('0x5'))['db'];var utils=require(_0x4a08('0x6'));var logger=require(_0x4a08('0x7'))(_0x4a08('0x8'));var config=require('../../config/environment');var jayson=require(_0x4a08('0x9'));var client=jayson[_0x4a08('0xa')][_0x4a08('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15b13c,_0x2d9bd4,_0x5460dd){return new BPromise(function(_0x268350,_0x348c6c){return client['request'](_0x15b13c,_0x5460dd)[_0x4a08('0xc')](function(_0x6461c9){logger[_0x4a08('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x2d9bd4,_0x4a08('0xe'));logger[_0x4a08('0xf')](_0x4a08('0x10'),_0x2d9bd4,_0x4a08('0xe'),JSON[_0x4a08('0x11')](_0x6461c9));if(_0x6461c9[_0x4a08('0x12')]){if(_0x6461c9[_0x4a08('0x12')][_0x4a08('0x13')]===0x1f4){logger[_0x4a08('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x2d9bd4,_0x6461c9[_0x4a08('0x12')][_0x4a08('0x14')]);return _0x348c6c(_0x6461c9[_0x4a08('0x12')][_0x4a08('0x14')]);}logger['error'](_0x4a08('0x15'),_0x2d9bd4,_0x6461c9[_0x4a08('0x12')][_0x4a08('0x14')]);return _0x268350(_0x6461c9[_0x4a08('0x12')]['message']);}else{logger[_0x4a08('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x2d9bd4,_0x4a08('0xe'));_0x268350(_0x6461c9[_0x4a08('0x16')][_0x4a08('0x14')]);}})['catch'](function(_0x24e157){logger[_0x4a08('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x2d9bd4,_0x24e157);_0x348c6c(_0x24e157);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index d7f9c27..7d4ffd5 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 _0xe0be=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','describe','show','post','put','/:id','update','destroy','util','connect-timeout','fs-extra','../../components/interaction/service'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0xe0be,0x1a0));var _0xee0b=function(_0x5f3e13,_0x5332fb){_0x5f3e13=_0x5f3e13-0x0;var _0x3d95a5=_0xe0be[_0x5f3e13];return _0x3d95a5;};'use strict';var multer=require('multer');var util=require(_0xee0b('0x0'));var path=require('path');var timeout=require(_0xee0b('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xee0b('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xee0b('0x3'));var config=require(_0xee0b('0x4'));var controller=require(_0xee0b('0x5'));router[_0xee0b('0x6')]('/',auth[_0xee0b('0x7')](),controller['index']);router[_0xee0b('0x6')]('/describe',auth[_0xee0b('0x7')](),controller[_0xee0b('0x8')]);router[_0xee0b('0x6')]('/:id',auth[_0xee0b('0x7')](),controller[_0xee0b('0x9')]);router[_0xee0b('0xa')]('/',auth[_0xee0b('0x7')](),controller['create']);router[_0xee0b('0xb')](_0xee0b('0xc'),auth[_0xee0b('0x7')](),controller[_0xee0b('0xd')]);router['delete']('/:id',auth[_0xee0b('0x7')](),controller[_0xee0b('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x8038=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x8038,0x145));var _0x8803=function(_0x90a465,_0x2a3516){_0x90a465=_0x90a465-0x0;var _0x3451ca=_0x8038[_0x90a465];return _0x3451ca;};'use strict';var multer=require(_0x8803('0x0'));var util=require(_0x8803('0x1'));var path=require(_0x8803('0x2'));var timeout=require(_0x8803('0x3'));var express=require(_0x8803('0x4'));var router=express[_0x8803('0x5')]();var fs_extra=require(_0x8803('0x6'));var auth=require(_0x8803('0x7'));var interaction=require(_0x8803('0x8'));var config=require(_0x8803('0x9'));var controller=require(_0x8803('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8803('0xb')](_0x8803('0xc'),auth[_0x8803('0xd')](),controller[_0x8803('0xe')]);router[_0x8803('0xb')](_0x8803('0xf'),auth[_0x8803('0xd')](),controller[_0x8803('0x10')]);router[_0x8803('0x11')]('/',auth[_0x8803('0xd')](),controller[_0x8803('0x12')]);router['put']('/:id',auth[_0x8803('0xd')](),controller['update']);router[_0x8803('0x13')](_0x8803('0xf'),auth[_0x8803('0xd')](),controller[_0x8803('0x14')]);module[_0x8803('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index aebcf13..cd9a780 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 _0x0ab9=['stringify','input','name','text','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Contact\x20us','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','thumb'];(function(_0x5e33d5,_0x967036){var _0x41fcd5=function(_0x49ae20){while(--_0x49ae20){_0x5e33d5['push'](_0x5e33d5['shift']());}};_0x41fcd5(++_0x967036);}(_0x0ab9,0xd7));var _0x90ab=function(_0x185b54,_0x2ff7b4){_0x185b54=_0x185b54-0x0;var _0x225ec9=_0x0ab9[_0x185b54];return _0x225ec9;};'use strict';var Sequelize=require(_0x90ab('0x0'));var rs=require(_0x90ab('0x1'));module['exports']={'name':{'type':Sequelize[_0x90ab('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x90ab('0x2')],'allowNull':![],'unique':_0x90ab('0x3')},'description':{'type':Sequelize[_0x90ab('0x2')]},'mapKey':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':_0x90ab('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':_0x90ab('0x5')},'customerAlias':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x90ab('0x2')],'allowNull':![],'defaultValue':_0x90ab('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x90ab('0x2')],'allowNull':![],'defaultValue':_0x90ab('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x90ab('0x2')],'allowNull':![],'defaultValue':_0x90ab('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x90ab('0x2')],'allowNull':![],'defaultValue':_0x90ab('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x90ab('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x90ab('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x90ab('0x9')](_0x90ab('0xa'),_0x90ab('0xb')),'defaultValue':_0x90ab('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x90ab('0xc')},'start_chat_button':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x90ab('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x90ab('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x90ab('0xf')]},'closingQuestion':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':_0x90ab('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x90ab('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x90ab('0x12')},'closingMessage':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':_0x90ab('0x13')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x90ab('0x14')},'skipMessageButton':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':_0x90ab('0x15')},'conditionAgreement':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x90ab('0x16')},'ratingType':{'type':Sequelize[_0x90ab('0x9')](_0x90ab('0x17'),_0x90ab('0x18')),'defaultValue':_0x90ab('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x90ab('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x90ab('0xf')],'defaultValue':function(){return JSON[_0x90ab('0x19')]({'items':[{'type':_0x90ab('0x1a'),'variable':null,'config':{'placeholder':_0x90ab('0x1b'),'type':_0x90ab('0x1c'),'required':!![]},'props':{'title':_0x90ab('0x1b'),'helpText':''}},{'type':_0x90ab('0x1a'),'props':{'title':_0x90ab('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x90ab('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x90ab('0x1d'))?JSON[_0x90ab('0x1e')](this[_0x90ab('0x1f')]('onlineForm')):{};},'set':function(_0xb26300){return this[_0x90ab('0x20')](_0x90ab('0x1d'),JSON[_0x90ab('0x19')](_0xb26300));}},'offlineForm':{'type':Sequelize[_0x90ab('0xf')],'defaultValue':function(){return JSON[_0x90ab('0x19')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x90ab('0x4')},'variable':null},{'type':_0x90ab('0x21'),'config':{'placeholder':_0x90ab('0x22')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x90ab('0x1f')]('offlineForm')?JSON[_0x90ab('0x1e')](this[_0x90ab('0x1f')]('offlineForm')):{};},'set':function(_0xdb3c09){return this['setDataValue'](_0x90ab('0x23'),JSON[_0x90ab('0x19')](_0xdb3c09));}},'token':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':function(){return rs[_0x90ab('0x24')]();}},'autoclose':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x90ab('0x2')]},'waitingTitle':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':_0x90ab('0x25')},'waitingMessage':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':_0x90ab('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':_0x90ab('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x90ab('0x15')},'sendUnmanaged':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x90ab('0xf')],'defaultValue':function(){return _0x90ab('0x28');}},'notificationSound':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x90ab('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':_0x90ab('0x29')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':_0x90ab('0x2a')},'messagesAlignment':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':_0x90ab('0x2b')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x90ab('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x90ab('0x2')],'allowNull':![],'defaultValue':_0x90ab('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x90ab('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x90ab('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x90ab('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x9004b8){if(!_0x9004b8)this[_0x90ab('0x20')](_0x90ab('0x2e'),null);this['setDataValue']('mandatoryDisposition',_0x9004b8);}},'vidaooEscalation':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x90ab('0x2')]},'vidaooTopic':{'type':Sequelize[_0x90ab('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x90ab('0x2')],'defaultValue':function(){return _0x90ab('0x2f');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x90ab('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x90ab('0xf')]}};
\ No newline at end of file
+var _0x1a9f=['Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','INTEGER','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','email','Agent','#011F6A','#ffffff','ENUM','rounded'];(function(_0x15bd08,_0x805ab4){var _0x375cc5=function(_0x28701e){while(--_0x28701e){_0x15bd08['push'](_0x15bd08['shift']());}};_0x375cc5(++_0x805ab4);}(_0x1a9f,0xbb));var _0xf1a9=function(_0x581182,_0x4d140b){_0x581182=_0x581182-0x0;var _0x27eed2=_0x1a9f[_0x581182];return _0x27eed2;};'use strict';var Sequelize=require(_0xf1a9('0x0'));var rs=require('randomstring');module[_0xf1a9('0x1')]={'name':{'type':Sequelize[_0xf1a9('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xf1a9('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xf1a9('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf1a9('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xf1a9('0x3')},'key':{'type':Sequelize[_0xf1a9('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0x4')},'customerAlias':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf1a9('0x2')],'allowNull':![],'defaultValue':_0xf1a9('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf1a9('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf1a9('0x2')],'allowNull':![],'defaultValue':_0xf1a9('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xf1a9('0x2')],'allowNull':![],'defaultValue':_0xf1a9('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf1a9('0x7')](_0xf1a9('0x8'),'squared'),'defaultValue':_0xf1a9('0x8')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0x9')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xf1a9('0xa')},'header_offline':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0xb')},'download_transcript':{'type':Sequelize[_0xf1a9('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0xf1a9('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf1a9('0xe')]},'closingQuestion':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0x10')},'noteTitle':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0x11')},'placeholderMessage':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0x12')},'closingMessage':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0x13')},'closingMessageButton':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xf1a9('0x14')},'conditionAgreement':{'type':Sequelize[_0xf1a9('0xc')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf1a9('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf1a9('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0x15')},'ratingType':{'type':Sequelize[_0xf1a9('0x7')]('star',_0xf1a9('0x16')),'defaultValue':_0xf1a9('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xf1a9('0x18')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf1a9('0xe')],'defaultValue':function(){return JSON[_0xf1a9('0x19')]({'items':[{'type':_0xf1a9('0x1a'),'variable':null,'config':{'placeholder':_0xf1a9('0x1b'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xf1a9('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xf1a9('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf1a9('0x1c')](_0xf1a9('0x1d'))?JSON[_0xf1a9('0x1e')](this[_0xf1a9('0x1c')]('onlineForm')):{};},'set':function(_0x5717b1){return this[_0xf1a9('0x1f')](_0xf1a9('0x1d'),JSON[_0xf1a9('0x19')](_0x5717b1));}},'offlineForm':{'type':Sequelize[_0xf1a9('0xe')],'defaultValue':function(){return JSON[_0xf1a9('0x19')]({'items':[{'type':_0xf1a9('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xf1a9('0x3'),'type':'email'},'variable':null},{'type':_0xf1a9('0x20'),'config':{'placeholder':_0xf1a9('0x21')},'props':{'title':_0xf1a9('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xf1a9('0x1c')](_0xf1a9('0x22'))?JSON[_0xf1a9('0x1e')](this['getDataValue'](_0xf1a9('0x22'))):{};},'set':function(_0x1194dc){return this[_0xf1a9('0x1f')](_0xf1a9('0x22'),JSON['stringify'](_0x1194dc));}},'token':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':function(){return rs[_0xf1a9('0x23')]();}},'autoclose':{'type':Sequelize[_0xf1a9('0xc')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf1a9('0xc')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf1a9('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf1a9('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf1a9('0x24')},'waitingMessage':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0x14')},'sendUnmanaged':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0xf1a9('0xc')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf1a9('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf1a9('0xe')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf1a9('0xe')],'defaultValue':function(){return _0xf1a9('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf1a9('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf1a9('0x18')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xf1a9('0x29')},'verticalAlignment':{'type':Sequelize[_0xf1a9('0x18')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0x2a')},'messagesAlignment':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':_0xf1a9('0x2b')},'defaultTitle':{'type':Sequelize[_0xf1a9('0x2')]},'customerAvatar':{'type':Sequelize[_0xf1a9('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xf1a9('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf1a9('0x18')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf1a9('0x2')],'allowNull':![],'defaultValue':_0xf1a9('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf1a9('0x18')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf1a9('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xf1a9('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xf1a9('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3dafe8){if(!_0x3dafe8)this[_0xf1a9('0x1f')](_0xf1a9('0x2e'),null);this[_0xf1a9('0x1f')]('mandatoryDisposition',_0x3dafe8);}},'vidaooEscalation':{'type':Sequelize[_0xf1a9('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf1a9('0x2')]},'vidaooTopic':{'type':Sequelize[_0xf1a9('0x2')],'allowNull':![],'defaultValue':_0xf1a9('0x2f')},'vidaooNote':{'type':Sequelize[_0xf1a9('0x2')],'defaultValue':function(){return _0xf1a9('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xf1a9('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf1a9('0xe')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 71c7df1..b36e756 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 _0x9bde=['query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','ChatWebsite','include','findAll','rows','show','params','keys','find','create','body','address','forEach','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','Disposition','hasOwnProperty','order','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','customerAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','Interval','resolve','timezone','ifTime','notify','chat','from','From\x20is\x20mandatory','mapKey','isEmpty','Body\x20is\x20mandatory','updatedAt','includes','createdAt','CompanyId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','ListId','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','interaction','contact','messageId','update','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','ChatQueue','queue','Start','startRouting','EventManager','offline','ValidationError','no\x20available\x20attributes','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','files','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','subjectOffline','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','omit','includeAll','internal','Tags','tag','getSnippet','interval','getProactiveActions','virtual','increment','server/files/chat/iframe.ejs','utf8','headers','origin','http://localhost:9000','remote','connection','replace','alignment','verticalAlignment','color','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','bulkCreate','findAndCountAll','stack','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','fromKey','Contact','Attachments','addAgents','spread','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','util','ejs','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','url','URL','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','then','get','ChatWebsites','UserProfileResource','destroy','name','send','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','%s\x20%s','version','unknown','device','model','vendor','format','%s\x20%s\x20%s','type','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9bde,0xe1));var _0xe9bd=function(_0x275cbe,_0x5545b5){_0x275cbe=_0x275cbe-0x0;var _0x49144f=_0x9bde[_0x275cbe];return _0x49144f;};'use strict';var Mustache=require('mustache');var util=require(_0xe9bd('0x0'));var path=require('path');var ejs=require(_0xe9bd('0x1'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9bd('0x2'));var querystring=require(_0xe9bd('0x3'));var htmlToText=require(_0xe9bd('0x4'));var Redis=require(_0xe9bd('0x5'));var jayson=require(_0xe9bd('0x6'));var qs=require(_0xe9bd('0x7'));var logger=require(_0xe9bd('0x8'))('api');var config=require(_0xe9bd('0x9'));var APIBadRequestError=require(_0xe9bd('0xa'))[_0xe9bd('0xb')];var APINotFoundError=require(_0xe9bd('0xa'))[_0xe9bd('0xc')];var APIOutOfIntervalError=require(_0xe9bd('0xa'))[_0xe9bd('0xd')];var APIHandleError=require(_0xe9bd('0xa'))[_0xe9bd('0xe')];var APIConflictError=require(_0xe9bd('0xa'))['APIConflictError'];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require(_0xe9bd('0xf'))[_0xe9bd('0x10')];var db=require(_0xe9bd('0x11'))['db'];config['redis']=_[_0xe9bd('0x12')](config[_0xe9bd('0x13')],{'host':_0xe9bd('0x14'),'port':0x18eb});var socket=require(_0xe9bd('0x15'))(new Redis(config['redis']));require(_0xe9bd('0x16'))['register'](socket);var client=jayson[_0xe9bd('0x17')][_0xe9bd('0x18')]({'port':0x232c});var client9002=jayson[_0xe9bd('0x17')]['http']({'port':0x232a});var client9003=jayson['client'][_0xe9bd('0x18')]({'port':0x232b});var client9001=jayson[_0xe9bd('0x17')][_0xe9bd('0x18')]({'port':0x2329});function respondWithRpcPromise(_0x46a59b,_0x3360bd,_0x389e7b,_0x45a9f2){return new Promise(function(_0x573350,_0x1d11a0){var _0x464a1b=_0x45a9f2||client;return _0x464a1b[_0xe9bd('0x19')](_0x46a59b,_0x389e7b)['then'](function(_0x36f03d){logger[_0xe9bd('0x1a')](_0xe9bd('0x1b'),_0x3360bd,_0xe9bd('0x1c'));logger['debug'](_0xe9bd('0x1d'),_0x3360bd,'request\x20sent',JSON[_0xe9bd('0x1e')](_0x36f03d));if(_0x36f03d['error']){if(_0x36f03d[_0xe9bd('0x1f')][_0xe9bd('0x20')]===0x1f4){logger[_0xe9bd('0x1f')](_0xe9bd('0x1b'),_0x3360bd,_0x36f03d[_0xe9bd('0x1f')][_0xe9bd('0x21')]);return _0x1d11a0(_0x36f03d[_0xe9bd('0x1f')]['message']);}logger[_0xe9bd('0x1f')](_0xe9bd('0x1b'),_0x3360bd,_0x36f03d['error'][_0xe9bd('0x21')]);return _0x573350(_0x36f03d['error'][_0xe9bd('0x21')]);}else{logger[_0xe9bd('0x1a')](_0xe9bd('0x1b'),_0x3360bd,_0xe9bd('0x1c'));_0x573350(_0x36f03d['result'][_0xe9bd('0x21')]);}})[_0xe9bd('0x22')](function(_0x2c9a57){logger[_0xe9bd('0x1f')](_0xe9bd('0x1b'),_0x3360bd,_0x2c9a57);_0x1d11a0(_0x2c9a57);});});}function respondWithStatusCode(_0xb52d45,_0x399f3c){_0x399f3c=_0x399f3c||0xcc;return function(_0x43ea90){if(_0x43ea90){return _0xb52d45[_0xe9bd('0x23')](_0x399f3c);}return _0xb52d45['status'](_0x399f3c)[_0xe9bd('0x24')]();};}function respondWithResult(_0x38fdfa,_0x5ba1d6){_0x5ba1d6=_0x5ba1d6||0xc8;return function(_0x3b13b7){if(_0x3b13b7){return _0x38fdfa[_0xe9bd('0x25')](_0x5ba1d6)[_0xe9bd('0x26')](_0x3b13b7);}};}function respondWithFilteredResult(_0x429055,_0x141b95){return function(_0x183601){if(_0x183601){var _0x519f48=typeof _0x141b95['offset']===_0xe9bd('0x27')&&typeof _0x141b95['limit']===_0xe9bd('0x27');var _0x1f2c0e=_0x183601[_0xe9bd('0x28')];var _0x36aa80=_0x519f48?0x0:_0x141b95[_0xe9bd('0x29')];var _0x509e36=_0x519f48?_0x183601['count']:_0x141b95[_0xe9bd('0x29')]+_0x141b95[_0xe9bd('0x2a')];var _0x3f96a0;if(_0x509e36>=_0x1f2c0e){_0x509e36=_0x1f2c0e;_0x3f96a0=0xc8;}else{_0x3f96a0=0xce;}_0x429055[_0xe9bd('0x25')](_0x3f96a0);return _0x429055[_0xe9bd('0x2b')](_0xe9bd('0x2c'),_0x36aa80+'-'+_0x509e36+'/'+_0x1f2c0e)[_0xe9bd('0x26')](_0x183601);}return null;};}function saveUpdates(_0x66213a){return function(_0x45703e){if(_0x45703e){return _0x45703e['update'](_0x66213a)[_0xe9bd('0x2d')](function(_0x81a31f){return _0x81a31f;});}return null;};}function removeEntity(_0x390a43){return function(_0x5117bc){if(_0x5117bc){return _0x5117bc['destroy']()[_0xe9bd('0x2d')](function(){var _0x2e9593=_0x5117bc[_0xe9bd('0x2e')]({'plain':!![]});var _0x3ed60a=_0xe9bd('0x2f');return db[_0xe9bd('0x30')][_0xe9bd('0x31')]({'where':{'type':_0x3ed60a,'resourceId':_0x2e9593['id']}})[_0xe9bd('0x2d')](function(){return _0x5117bc;});})[_0xe9bd('0x2d')](function(){_0x390a43[_0xe9bd('0x25')](0xcc)[_0xe9bd('0x24')]();});}};}function handleEntityNotFound(_0x549dd1){return function(_0x2ad46e){if(!_0x2ad46e){_0x549dd1[_0xe9bd('0x23')](0x194);}return _0x2ad46e;};}function handleError(_0xc50476,_0x8ff624){_0x8ff624=_0x8ff624||0x1f4;return function(_0x264ba0){logger[_0xe9bd('0x1f')](_0x264ba0['stack']);if(_0x264ba0[_0xe9bd('0x32')]){delete _0x264ba0[_0xe9bd('0x32')];}_0xc50476['status'](_0x8ff624)[_0xe9bd('0x33')](_0x264ba0);};}function createInteractionObject(_0x264c87,_0x4c7d47,_0x4b1da0,_0x2785e6){var _0xdf43b9=require('user-agent-parser');var _0x2d1289=new _0xdf43b9();var _0x3ea705=_0x2d1289[_0xe9bd('0x34')](_0x4b1da0['user-agent'])[_0xe9bd('0x35')]();var _0x4d1945=_0x4c7d47[_0xe9bd('0x36')];if(_0x4b1da0[_0xe9bd('0x37')]){_0x4d1945=_0x4b1da0[_0xe9bd('0x37')];}else if(_0x4b1da0[_0xe9bd('0x38')]){_0x4d1945=_['first'](_0x4b1da0[_0xe9bd('0x38')][_0xe9bd('0x39')](','));}return{'ContactId':_0x2785e6['id'],'ChatWebsiteId':_0x264c87,'from':(_0x2785e6[_0xe9bd('0x3a')]||'')+'\x20'+(_0x2785e6[_0xe9bd('0x3b')]||''),'customerIp':_0x4d1945,'customerPort':_0x4b1da0[_0xe9bd('0x3c')]?_0x4b1da0[_0xe9bd('0x3c')]:null,'referer':_0x4c7d47[_0xe9bd('0x3d')],'browserName':_0x3ea705[_0xe9bd('0x3e')][_0xe9bd('0x32')]&&_0x3ea705[_0xe9bd('0x3e')]['version']?util['format'](_0xe9bd('0x3f'),_0x3ea705['browser'][_0xe9bd('0x32')],_0x3ea705[_0xe9bd('0x3e')][_0xe9bd('0x40')]):'unknown','browserVersion':_0x3ea705[_0xe9bd('0x3e')][_0xe9bd('0x40')]||_0xe9bd('0x41'),'osName':util['format'](_0xe9bd('0x3f'),_0x3ea705['os'][_0xe9bd('0x32')],_0x3ea705['os'][_0xe9bd('0x40')]),'osVersion':_0x3ea705['os'][_0xe9bd('0x40')],'deviceModel':_0x3ea705[_0xe9bd('0x42')][_0xe9bd('0x43')]&&_0x3ea705[_0xe9bd('0x42')][_0xe9bd('0x44')]?util[_0xe9bd('0x45')](_0xe9bd('0x46'),_0x3ea705[_0xe9bd('0x42')][_0xe9bd('0x43')],_0x3ea705[_0xe9bd('0x42')][_0xe9bd('0x44')],_0x3ea705[_0xe9bd('0x42')]['type']):null,'deviceVendor':_0x3ea705['device'][_0xe9bd('0x44')],'deviceType':_0x3ea705[_0xe9bd('0x42')][_0xe9bd('0x47')],'formData':JSON['stringify'](_0x4c7d47)};}exports['index']=function(_0x43cf7d,_0x3f6f22){var _0x165942={'include':[{'model':db[_0xe9bd('0x48')],'as':_0xe9bd('0x49')}]},_0x15da40={},_0x39fb61={'count':0x0,'rows':[]};var _0x512899=_[_0xe9bd('0x4a')](db['ChatWebsite'][_0xe9bd('0x4b')],function(_0x2277f9){return{'name':_0x2277f9[_0xe9bd('0x4c')],'type':_0x2277f9[_0xe9bd('0x47')][_0xe9bd('0x4d')]};});_0x15da40['model']=_[_0xe9bd('0x4a')](_0x512899,_0xe9bd('0x32'));_0x15da40[_0xe9bd('0x4e')]=_['keys'](_0x43cf7d[_0xe9bd('0x4e')]);_0x15da40[_0xe9bd('0x4f')]=_[_0xe9bd('0x50')](_0x15da40['model'],_0x15da40[_0xe9bd('0x4e')]);_0x165942[_0xe9bd('0x51')]=_[_0xe9bd('0x50')](_0x15da40[_0xe9bd('0x43')],qs[_0xe9bd('0x52')](_0x43cf7d['query'][_0xe9bd('0x52')]));_0x165942['attributes']=_0x165942[_0xe9bd('0x51')][_0xe9bd('0x53')]?_0x165942[_0xe9bd('0x51')]:_0x15da40[_0xe9bd('0x43')];if(!_0x43cf7d[_0xe9bd('0x4e')]['hasOwnProperty'](_0xe9bd('0x54'))){_0x165942['limit']=qs[_0xe9bd('0x2a')](_0x43cf7d[_0xe9bd('0x4e')]['limit']);_0x165942['offset']=qs[_0xe9bd('0x29')](_0x43cf7d['query'][_0xe9bd('0x29')]);}_0x165942['order']=qs[_0xe9bd('0x55')](_0x43cf7d[_0xe9bd('0x4e')]['sort']);_0x165942[_0xe9bd('0x56')]=qs['filters'](_[_0xe9bd('0x57')](_0x43cf7d[_0xe9bd('0x4e')],_0x15da40[_0xe9bd('0x4f')]),_0x512899);if(_0x43cf7d['query'][_0xe9bd('0x58')]){_0x165942[_0xe9bd('0x56')]=_[_0xe9bd('0x59')](_0x165942[_0xe9bd('0x56')],{'$or':_['map'](_0x512899,function(_0x56362e){if(_0x56362e[_0xe9bd('0x47')]!=='VIRTUAL'){var _0x43c83c={};_0x43c83c[_0x56362e[_0xe9bd('0x32')]]={'$like':'%'+_0x43cf7d[_0xe9bd('0x4e')][_0xe9bd('0x58')]+'%'};return _0x43c83c;}})});}_0x165942=_[_0xe9bd('0x59')]({},_0x165942,_0x43cf7d[_0xe9bd('0x5a')]);var _0x373057={'where':_0x165942[_0xe9bd('0x56')]};return db[_0xe9bd('0x5b')][_0xe9bd('0x28')](_0x373057)[_0xe9bd('0x2d')](function(_0x78fab0){_0x39fb61['count']=_0x78fab0;if(_0x43cf7d['query']['includeAll']){_0x165942[_0xe9bd('0x5c')]=[{'all':!![]}];}return db['ChatWebsite'][_0xe9bd('0x5d')](_0x165942);})[_0xe9bd('0x2d')](function(_0x90db01){_0x39fb61[_0xe9bd('0x5e')]=_0x90db01;return _0x39fb61;})[_0xe9bd('0x2d')](respondWithFilteredResult(_0x3f6f22,_0x165942))[_0xe9bd('0x22')](handleError(_0x3f6f22,null));};exports[_0xe9bd('0x5f')]=function(_0x46797c,_0x61b691){var _0x57f24e={'raw':![],'where':{'id':_0x46797c[_0xe9bd('0x60')]['id']},'include':[{'model':db[_0xe9bd('0x48')],'as':_0xe9bd('0x49')}]},_0x242f9f={};_0x242f9f['model']=_[_0xe9bd('0x61')](db[_0xe9bd('0x5b')][_0xe9bd('0x4b')]);_0x242f9f['query']=_[_0xe9bd('0x61')](_0x46797c[_0xe9bd('0x4e')]);_0x242f9f[_0xe9bd('0x4f')]=_[_0xe9bd('0x50')](_0x242f9f['model'],_0x242f9f['query']);_0x57f24e[_0xe9bd('0x51')]=_[_0xe9bd('0x50')](_0x242f9f[_0xe9bd('0x43')],qs[_0xe9bd('0x52')](_0x46797c['query']['fields']));_0x57f24e[_0xe9bd('0x51')]=_0x57f24e[_0xe9bd('0x51')][_0xe9bd('0x53')]?_0x57f24e[_0xe9bd('0x51')]:_0x242f9f[_0xe9bd('0x43')];if(_0x46797c[_0xe9bd('0x4e')]['includeAll']){_0x57f24e[_0xe9bd('0x5c')]=[{'all':!![]}];}_0x57f24e=_['merge']({},_0x57f24e,_0x46797c[_0xe9bd('0x5a')]);return db[_0xe9bd('0x5b')][_0xe9bd('0x62')](_0x57f24e)[_0xe9bd('0x2d')](handleEntityNotFound(_0x61b691,null))['then'](respondWithResult(_0x61b691,null))[_0xe9bd('0x22')](handleError(_0x61b691,null));};exports[_0xe9bd('0x63')]=function(_0x3b0190,_0x4f35c4){var _0x20731c=null;_0x3b0190[_0xe9bd('0x64')][_0xe9bd('0x65')][_0xe9bd('0x39')](',')[_0xe9bd('0x66')](_0x16b66c=>{if(_0x16b66c[_0xe9bd('0x67')]()!==''&&!wildcardUtils[_0xe9bd('0x68')](_0x16b66c[_0xe9bd('0x67')]())){_0x20731c=new APIBadRequestError('\x22'+_0x16b66c[_0xe9bd('0x67')]()+_0xe9bd('0x69'));}});if(_0x20731c){return handleError(_0x4f35c4,null)(_0x20731c);}return db[_0xe9bd('0x5b')]['create'](_0x3b0190[_0xe9bd('0x64')],{})[_0xe9bd('0x2d')](function(_0x481368){var _0x2c2d78=_0x3b0190[_0xe9bd('0x6a')]['get']({'plain':!![]});if(!_0x2c2d78)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c2d78[_0xe9bd('0x6b')]===_0xe9bd('0x6a')){var _0x4ec6ec=_0x481368['get']({'plain':!![]});var _0x4a6422=_0xe9bd('0x2f');return db['UserProfileSection']['find']({'where':{'name':_0x4a6422,'userProfileId':_0x2c2d78['userProfileId']},'raw':!![]})['then'](function(_0x1fc88d){if(_0x1fc88d&&_0x1fc88d[_0xe9bd('0x6c')]===0x0){return db[_0xe9bd('0x30')]['create']({'name':_0x4ec6ec[_0xe9bd('0x32')],'resourceId':_0x4ec6ec['id'],'type':_0x1fc88d[_0xe9bd('0x32')],'sectionId':_0x1fc88d['id']},{})[_0xe9bd('0x2d')](function(){return _0x481368;});}else{return _0x481368;}})[_0xe9bd('0x22')](function(_0x5dc598){logger[_0xe9bd('0x1f')](_0xe9bd('0x6d'),_0x5dc598);throw _0x5dc598;});}return _0x481368;})[_0xe9bd('0x2d')](respondWithResult(_0x4f35c4,0xc9))['catch'](handleError(_0x4f35c4,null));};exports['update']=function(_0x3e68fb,_0x2530e1){var _0x1f41fc=null;_0x3e68fb[_0xe9bd('0x64')][_0xe9bd('0x65')][_0xe9bd('0x39')](',')[_0xe9bd('0x66')](_0x22c5ed=>{if(_0x22c5ed['trim']()!==''&&!wildcardUtils[_0xe9bd('0x68')](_0x22c5ed[_0xe9bd('0x67')]())){_0x1f41fc=new APIBadRequestError('\x22'+_0x22c5ed[_0xe9bd('0x67')]()+_0xe9bd('0x69'));}});if(_0x1f41fc){return handleError(_0x2530e1,null)(_0x1f41fc);}if(_0x3e68fb[_0xe9bd('0x64')]['id']){delete _0x3e68fb['body']['id'];}return db[_0xe9bd('0x5b')]['find']({'where':{'id':_0x3e68fb['params']['id']},'include':[{'model':db[_0xe9bd('0x48')],'as':_0xe9bd('0x49')}]})['then'](handleEntityNotFound(_0x2530e1,null))[_0xe9bd('0x2d')](saveUpdates(_0x3e68fb[_0xe9bd('0x64')],null))[_0xe9bd('0x2d')](respondWithResult(_0x2530e1,null))[_0xe9bd('0x22')](handleError(_0x2530e1,null));};exports['destroy']=function(_0x3c1ab9,_0x41fb41){return db['ChatWebsite'][_0xe9bd('0x62')]({'where':{'id':_0x3c1ab9[_0xe9bd('0x60')]['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x41fb41,null))[_0xe9bd('0x2d')](removeEntity(_0x41fb41,null))[_0xe9bd('0x22')](handleError(_0x41fb41,null));};exports[_0xe9bd('0x6e')]=function(_0x466a89,_0x5e127b){return db[_0xe9bd('0x5b')][_0xe9bd('0x6e')]()[_0xe9bd('0x2d')](respondWithResult(_0x5e127b,null))[_0xe9bd('0x22')](handleError(_0x5e127b,null));};exports[_0xe9bd('0x6f')]=function(_0x8f51aa,_0x18a387){if(_0x8f51aa[_0xe9bd('0x64')]['id']){delete _0x8f51aa[_0xe9bd('0x64')]['id'];}return db['ChatWebsite'][_0xe9bd('0x62')]({'where':{'id':_0x8f51aa[_0xe9bd('0x60')]['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x18a387,null))[_0xe9bd('0x2d')](function(_0x383e0c){if(_0x383e0c){_0x8f51aa[_0xe9bd('0x64')][_0xe9bd('0x70')]=_0x383e0c['id'];return db['Disposition'][_0xe9bd('0x63')](_0x8f51aa[_0xe9bd('0x64')]);}})['then'](respondWithResult(_0x18a387,null))[_0xe9bd('0x22')](handleError(_0x18a387,null));};exports[_0xe9bd('0x71')]=function(_0x2d86b6,_0x2083c4){var _0x242110={'raw':![],'where':{}};var _0x332228={};var _0x28331d={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x2d86b6[_0xe9bd('0x60')]['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x2083c4,null))[_0xe9bd('0x2d')](function(_0x1b863f){if(_0x1b863f){_0x332228[_0xe9bd('0x43')]=_[_0xe9bd('0x61')](db[_0xe9bd('0x72')]['rawAttributes']);_0x332228[_0xe9bd('0x4e')]=_[_0xe9bd('0x61')](_0x2d86b6[_0xe9bd('0x4e')]);_0x332228[_0xe9bd('0x4f')]=_[_0xe9bd('0x50')](_0x332228[_0xe9bd('0x43')],_0x332228[_0xe9bd('0x4e')]);_0x242110['attributes']=_['intersection'](_0x332228['model'],qs[_0xe9bd('0x52')](_0x2d86b6['query']['fields']));_0x242110['attributes']=_0x242110[_0xe9bd('0x51')][_0xe9bd('0x53')]?_0x242110[_0xe9bd('0x51')]:_0x332228[_0xe9bd('0x43')];if(!_0x2d86b6[_0xe9bd('0x4e')][_0xe9bd('0x73')](_0xe9bd('0x54'))){_0x242110[_0xe9bd('0x2a')]=qs[_0xe9bd('0x2a')](_0x2d86b6['query'][_0xe9bd('0x2a')]);_0x242110['offset']=qs[_0xe9bd('0x29')](_0x2d86b6[_0xe9bd('0x4e')][_0xe9bd('0x29')]);}_0x242110[_0xe9bd('0x74')]=qs[_0xe9bd('0x55')](_0x2d86b6['query']['sort']);_0x242110['where']=qs[_0xe9bd('0x4f')](_[_0xe9bd('0x57')](_0x2d86b6['query'],_0x332228[_0xe9bd('0x4f')]));_0x242110[_0xe9bd('0x56')][_0xe9bd('0x70')]=_0x1b863f['id'];if(_0x2d86b6[_0xe9bd('0x4e')][_0xe9bd('0x58')]){_0x242110['where']=_[_0xe9bd('0x59')](_0x242110[_0xe9bd('0x56')],{'$or':_[_0xe9bd('0x4a')](_0x242110[_0xe9bd('0x51')],function(_0x399429){var _0x1f9829={};_0x1f9829[_0x399429]={'$like':'%'+_0x2d86b6[_0xe9bd('0x4e')][_0xe9bd('0x58')]+'%'};return _0x1f9829;})});}_0x242110=_[_0xe9bd('0x59')]({},_0x242110,_0x2d86b6[_0xe9bd('0x5a')]);return db['Disposition']['count']({'where':_0x242110['where']})['then'](function(_0x4039c7){_0x28331d[_0xe9bd('0x28')]=_0x4039c7;if(_0x2d86b6[_0xe9bd('0x4e')]['includeAll']){_0x242110[_0xe9bd('0x5c')]=[{'all':!![]}];}return db[_0xe9bd('0x72')]['findAll'](_0x242110);})['then'](function(_0xb607c0){_0x28331d[_0xe9bd('0x5e')]=_0xb607c0;return _0x28331d;});}})[_0xe9bd('0x2d')](respondWithFilteredResult(_0x2083c4,_0x242110))[_0xe9bd('0x22')](handleError(_0x2083c4,null));};exports[_0xe9bd('0x75')]=function(_0x59364c,_0x5bd400){return db['ChatWebsite'][_0xe9bd('0x62')]({'where':{'id':_0x59364c[_0xe9bd('0x60')]['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x5bd400,null))[_0xe9bd('0x2d')](function(_0x1880e7){if(_0x1880e7){return _0x1880e7[_0xe9bd('0x75')](_0x59364c[_0xe9bd('0x4e')][_0xe9bd('0x76')]);}})[_0xe9bd('0x2d')](respondWithStatusCode(_0x5bd400,null))[_0xe9bd('0x22')](handleError(_0x5bd400,null));};exports['addAnswer']=function(_0xb1203d,_0x5b8938){if(_0xb1203d[_0xe9bd('0x64')]['id']){delete _0xb1203d['body']['id'];}return db['ChatWebsite'][_0xe9bd('0x62')]({'where':{'id':_0xb1203d['params']['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x5b8938,null))['then'](function(_0x2efc16){if(_0x2efc16){_0xb1203d[_0xe9bd('0x64')][_0xe9bd('0x70')]=_0x2efc16['id'];return db[_0xe9bd('0x77')][_0xe9bd('0x63')](_0xb1203d[_0xe9bd('0x64')]);}})['then'](respondWithResult(_0x5b8938,null))[_0xe9bd('0x22')](handleError(_0x5b8938,null));};exports[_0xe9bd('0x78')]=function(_0x4ee8a3,_0x46461d){var _0x180117={'raw':![],'where':{}};var _0x141fe2={};var _0x59897b={'count':0x0,'rows':[]};return db[_0xe9bd('0x5b')][_0xe9bd('0x79')]({'where':{'id':_0x4ee8a3[_0xe9bd('0x60')]['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x46461d,null))[_0xe9bd('0x2d')](function(_0x48d4a2){if(_0x48d4a2){_0x141fe2[_0xe9bd('0x43')]=_[_0xe9bd('0x61')](db['CannedAnswer'][_0xe9bd('0x4b')]);_0x141fe2[_0xe9bd('0x4e')]=_[_0xe9bd('0x61')](_0x4ee8a3[_0xe9bd('0x4e')]);_0x141fe2['filters']=_[_0xe9bd('0x50')](_0x141fe2[_0xe9bd('0x43')],_0x141fe2[_0xe9bd('0x4e')]);_0x180117[_0xe9bd('0x51')]=_[_0xe9bd('0x50')](_0x141fe2[_0xe9bd('0x43')],qs[_0xe9bd('0x52')](_0x4ee8a3['query'][_0xe9bd('0x52')]));_0x180117['attributes']=_0x180117[_0xe9bd('0x51')][_0xe9bd('0x53')]?_0x180117[_0xe9bd('0x51')]:_0x141fe2['model'];if(!_0x4ee8a3[_0xe9bd('0x4e')]['hasOwnProperty'](_0xe9bd('0x54'))){_0x180117[_0xe9bd('0x2a')]=qs[_0xe9bd('0x2a')](_0x4ee8a3[_0xe9bd('0x4e')][_0xe9bd('0x2a')]);_0x180117[_0xe9bd('0x29')]=qs[_0xe9bd('0x29')](_0x4ee8a3[_0xe9bd('0x4e')][_0xe9bd('0x29')]);}_0x180117[_0xe9bd('0x74')]=qs[_0xe9bd('0x55')](_0x4ee8a3['query'][_0xe9bd('0x55')]);_0x180117[_0xe9bd('0x56')]=qs[_0xe9bd('0x4f')](_['pick'](_0x4ee8a3[_0xe9bd('0x4e')],_0x141fe2[_0xe9bd('0x4f')]));_0x180117['where']['ChatWebsiteId']=_0x48d4a2['id'];if(_0x4ee8a3['query']['filter']){_0x180117[_0xe9bd('0x56')]=_[_0xe9bd('0x59')](_0x180117[_0xe9bd('0x56')],{'$or':_['map'](_0x180117[_0xe9bd('0x51')],function(_0x3b72cd){var _0x51fab7={};_0x51fab7[_0x3b72cd]={'$like':'%'+_0x4ee8a3[_0xe9bd('0x4e')][_0xe9bd('0x58')]+'%'};return _0x51fab7;})});}_0x180117=_[_0xe9bd('0x59')]({},_0x180117,_0x4ee8a3[_0xe9bd('0x5a')]);return db[_0xe9bd('0x77')]['count']({'where':_0x180117[_0xe9bd('0x56')]})[_0xe9bd('0x2d')](function(_0x5cc2ff){_0x59897b['count']=_0x5cc2ff;if(_0x4ee8a3['query']['includeAll']){_0x180117[_0xe9bd('0x5c')]=[{'all':!![]}];}return db[_0xe9bd('0x77')][_0xe9bd('0x5d')](_0x180117);})[_0xe9bd('0x2d')](function(_0x4d9cfa){_0x59897b['rows']=_0x4d9cfa;return _0x59897b;});}})[_0xe9bd('0x2d')](respondWithFilteredResult(_0x46461d,_0x180117))[_0xe9bd('0x22')](handleError(_0x46461d,null));};exports[_0xe9bd('0x7a')]=function(_0x4ee46c,_0x220f1f){return db[_0xe9bd('0x5b')]['find']({'where':{'id':_0x4ee46c['params']['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x220f1f,null))[_0xe9bd('0x2d')](function(_0x346da7){if(_0x346da7){return _0x346da7[_0xe9bd('0x7a')](_0x4ee46c[_0xe9bd('0x4e')][_0xe9bd('0x76')]);}})[_0xe9bd('0x2d')](respondWithStatusCode(_0x220f1f,null))[_0xe9bd('0x22')](handleError(_0x220f1f,null));};exports[_0xe9bd('0x7b')]=function(_0x47f09c,_0x3484df){_0x47f09c[_0xe9bd('0x64')][_0xe9bd('0x7c')]=_0x47f09c[_0xe9bd('0x7d')][_0xe9bd('0x7e')];return db[_0xe9bd('0x5b')]['find']({'where':{'id':_0x47f09c[_0xe9bd('0x60')]['id']}})['then'](handleEntityNotFound(_0x3484df,null))[_0xe9bd('0x2d')](saveUpdates(_0x47f09c['body'],null))[_0xe9bd('0x2d')](respondWithResult(_0x3484df,null))[_0xe9bd('0x22')](handleError(_0x3484df,null));};exports['addAvatar']=function(_0x343479,_0x2c4665){_0x343479['body'][_0xe9bd('0x7f')]=_0x343479[_0xe9bd('0x7d')][_0xe9bd('0x7e')];return db[_0xe9bd('0x5b')]['find']({'where':{'id':_0x343479[_0xe9bd('0x60')]['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x2c4665,null))['then'](saveUpdates(_0x343479[_0xe9bd('0x64')],null))[_0xe9bd('0x2d')](respondWithResult(_0x2c4665,null))[_0xe9bd('0x22')](handleError(_0x2c4665,null));};exports['addCustomerAvatar']=function(_0x1454e5,_0x23ee4e){_0x1454e5[_0xe9bd('0x64')][_0xe9bd('0x80')]=_0x1454e5[_0xe9bd('0x7d')][_0xe9bd('0x7e')];return db[_0xe9bd('0x5b')]['find']({'where':{'id':_0x1454e5[_0xe9bd('0x60')]['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x23ee4e,null))[_0xe9bd('0x2d')](saveUpdates(_0x1454e5['body'],null))[_0xe9bd('0x2d')](respondWithResult(_0x23ee4e,null))['catch'](handleError(_0x23ee4e,null));};exports['addSystemAvatar']=function(_0x4e1eb8,_0x1939ed){_0x4e1eb8['body']['systemAvatar']=_0x4e1eb8[_0xe9bd('0x7d')][_0xe9bd('0x7e')];return db['ChatWebsite'][_0xe9bd('0x62')]({'where':{'id':_0x4e1eb8[_0xe9bd('0x60')]['id']}})['then'](handleEntityNotFound(_0x1939ed,null))['then'](saveUpdates(_0x4e1eb8[_0xe9bd('0x64')],null))['then'](respondWithResult(_0x1939ed,null))['catch'](handleError(_0x1939ed,null));};exports[_0xe9bd('0x81')]=function(_0x1771b1,_0x3b14dc){var _0x4fa1e1=path[_0xe9bd('0x82')](config[_0xe9bd('0x83')],_0xe9bd('0x84'));var _0x5ebe24={'where':{'id':_0x1771b1[_0xe9bd('0x60')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x573640=![];return require(_0xe9bd('0x85'))[_0xe9bd('0x86')]()[_0xe9bd('0x2d')](function(_0x3d168b){if(_0x3d168b){_0x573640=_0x3d168b[_0xe9bd('0x87')];}})['then'](function(){return db[_0xe9bd('0x5b')][_0xe9bd('0x62')](_0x5ebe24);})[_0xe9bd('0x2d')](handleEntityNotFound(_0x3b14dc,null))[_0xe9bd('0x2d')](function(_0x351fcd){if(_0x351fcd){if(!_[_0xe9bd('0x88')](_0x351fcd['sitepic'])){if(fs[_0xe9bd('0x89')](path[_0xe9bd('0x82')](config[_0xe9bd('0x83')],_0xe9bd('0x8a'),_0x351fcd[_0xe9bd('0x7c')]))&&_0x573640){_0x4fa1e1=path[_0xe9bd('0x82')](config['root'],_0xe9bd('0x8a'),_0x351fcd[_0xe9bd('0x7c')]);}}return _0x3b14dc['download'](_0x4fa1e1);}})[_0xe9bd('0x22')](handleError(_0x3b14dc,null));};exports[_0xe9bd('0x8b')]=function(_0x316022,_0x1e63d3){var _0x5befe7=path[_0xe9bd('0x82')](config[_0xe9bd('0x83')],_0xe9bd('0x8c'));var _0xcee066={'where':{'id':_0x316022[_0xe9bd('0x60')]['id']},'attributes':['id',_0xe9bd('0x7f')],'raw':!![]};return db[_0xe9bd('0x5b')][_0xe9bd('0x62')](_0xcee066)[_0xe9bd('0x2d')](handleEntityNotFound(_0x1e63d3,null))['then'](function(_0x2fa992){if(_0x2fa992){if(!_[_0xe9bd('0x88')](_0x2fa992[_0xe9bd('0x7f')])){if(fs[_0xe9bd('0x89')](path[_0xe9bd('0x82')](config[_0xe9bd('0x83')],_0xe9bd('0x8d'),_0x2fa992['agentAvatar']))){_0x5befe7=path[_0xe9bd('0x82')](config['root'],_0xe9bd('0x8d'),_0x2fa992[_0xe9bd('0x7f')]);}}return _0x1e63d3[_0xe9bd('0x8e')](_0x5befe7);}})[_0xe9bd('0x22')](handleError(_0x1e63d3,null));};exports[_0xe9bd('0x8f')]=function(_0x2b8645,_0x5bf65b){var _0x33b1fe=path[_0xe9bd('0x82')](config[_0xe9bd('0x83')],'server/files/images/avatars/customer_avatar.png');var _0x457536={'where':{'id':_0x2b8645[_0xe9bd('0x60')]['id']},'attributes':['id',_0xe9bd('0x80'),_0xe9bd('0x90')],'raw':!![]};return db[_0xe9bd('0x5b')][_0xe9bd('0x62')](_0x457536)[_0xe9bd('0x2d')](handleEntityNotFound(_0x5bf65b,null))[_0xe9bd('0x2d')](function(_0x20a8ce){if(_0x20a8ce){if(!_[_0xe9bd('0x88')](_0x20a8ce['customerAvatar'])){if(fs[_0xe9bd('0x89')](path[_0xe9bd('0x82')](config[_0xe9bd('0x83')],'server/files/images/avatars/',_0x20a8ce[_0xe9bd('0x80')]))&&_0x20a8ce[_0xe9bd('0x90')]){_0x33b1fe=path[_0xe9bd('0x82')](config['root'],'server/files/images/avatars/',_0x20a8ce[_0xe9bd('0x80')]);}}return _0x5bf65b[_0xe9bd('0x8e')](_0x33b1fe);}})[_0xe9bd('0x22')](handleError(_0x5bf65b,null));};exports[_0xe9bd('0x91')]=function(_0x25ee5d,_0x464102){var _0xc57d62=path['join'](config[_0xe9bd('0x83')],_0xe9bd('0x92'));var _0x4cdea7={'where':{'id':_0x25ee5d[_0xe9bd('0x60')]['id']},'attributes':['id',_0xe9bd('0x93')],'raw':!![]};return db[_0xe9bd('0x5b')][_0xe9bd('0x62')](_0x4cdea7)[_0xe9bd('0x2d')](handleEntityNotFound(_0x464102,null))[_0xe9bd('0x2d')](function(_0x428a2e){if(_0x428a2e){if(!_[_0xe9bd('0x88')](_0x428a2e[_0xe9bd('0x93')])){if(fs[_0xe9bd('0x89')](path[_0xe9bd('0x82')](config[_0xe9bd('0x83')],_0xe9bd('0x8d'),_0x428a2e[_0xe9bd('0x93')]))){_0xc57d62=path[_0xe9bd('0x82')](config['root'],_0xe9bd('0x8d'),_0x428a2e[_0xe9bd('0x93')]);}}return _0x464102[_0xe9bd('0x8e')](_0xc57d62);}})[_0xe9bd('0x22')](handleError(_0x464102,null));};function checkWebsiteInterval(_0x217eff){var _0x552d2a=_0x217eff[_0xe9bd('0x94')];if(!_0x552d2a){return Promise[_0xe9bd('0x95')](_0x217eff);}var _0x1eeb25=_0x217eff[_0xe9bd('0x96')]||undefined;return _0x552d2a[_0xe9bd('0x97')](_0x1eeb25)[_0xe9bd('0x2d')](function(_0x1b40a8){if(!_0x1b40a8){throw new APIOutOfIntervalError();}return _0x217eff;});}exports[_0xe9bd('0x98')]=function(_0x3c1785,_0xab57a8){var _0x2a8861={'body':_0x3c1785[_0xe9bd('0x64')],'channel':_0xe9bd('0x99')};var _0x5953ca=[];var _0x1412ed=[];var _0x3acd14={};var _0x1f6f2e=![];if(_0x3c1785[_0xe9bd('0x64')]['id']){delete _0x3c1785[_0xe9bd('0x64')]['id'];}if(_[_0xe9bd('0x88')](_0x3c1785[_0xe9bd('0x64')][_0xe9bd('0x9a')])){throw new APIBadRequestError(_0xe9bd('0x9b'));}if(_[_0xe9bd('0x88')](_0x3c1785[_0xe9bd('0x64')][_0xe9bd('0x9c')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0xe9bd('0x9d')](_0x3c1785[_0xe9bd('0x64')][_0xe9bd('0x64')])){throw new APIBadRequestError(_0xe9bd('0x9e'));}var _0x1958fa=_0x3c1785['body'][_0xe9bd('0x36')]&&_0x3c1785[_0xe9bd('0x64')][_0xe9bd('0x3d')];return db['CmContact'][_0xe9bd('0x6e')]()[_0xe9bd('0x2d')](function(_0x496640){if(!_0x496640){throw new Error('No\x20available\x20attributes');}_0x5953ca=Object['keys'](_0x496640)[_0xe9bd('0x58')](function(_0x46017e){return!['createdAt',_0xe9bd('0x9f')][_0xe9bd('0xa0')](_0x46017e);});_0x1412ed=Object[_0xe9bd('0x61')](_0x496640)['filter'](function(_0x15ad87){return![_0xe9bd('0xa1'),_0xe9bd('0x9f'),_0xe9bd('0xa2'),'ListId'][_0xe9bd('0xa0')](_0x15ad87);});if(!_[_0xe9bd('0xa0')](_0x1412ed,_0x3c1785['body'][_0xe9bd('0x9c')])){throw new APIBadRequestError(_0xe9bd('0xa3')+_0x1412ed[_0xe9bd('0x82')](',\x20'));}_0x3acd14[_0x3c1785[_0xe9bd('0x64')]['mapKey']]=_0x3c1785['body']['from'];})[_0xe9bd('0x2d')](function(){return db['ChatWebsite'][_0xe9bd('0x62')]({'where':{'id':_0x3c1785[_0xe9bd('0x60')]['id']},'include':[{'model':db[_0xe9bd('0xa4')],'as':_0xe9bd('0xa5'),'include':[{'model':db[_0xe9bd('0xa6')],'as':_0xe9bd('0xa7'),'where':_0x3acd14,'limit':0x1,'order':[['updatedAt',_0xe9bd('0xa8')]]}]},{'model':db[_0xe9bd('0xa9')],'as':_0xe9bd('0xaa')},{'model':db[_0xe9bd('0x94')],'as':_0xe9bd('0x94'),'include':[{'model':db[_0xe9bd('0x94')],'as':_0xe9bd('0xab'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0xe9bd('0x2d')](function(_0x40abfd){if(!_0x40abfd){throw new APINotFoundError(util[_0xe9bd('0x45')](_0xe9bd('0xac'),_0x3c1785['params']['id']));}if(_0x1958fa){return checkWebsiteInterval(_0x40abfd);}return _0x40abfd;})[_0xe9bd('0x2d')](function(_0x16ff7b){_0x2a8861[_0xe9bd('0xad')]=_0x16ff7b;_0x2a8861[_0xe9bd('0xae')]=_[_0xe9bd('0xaf')](_0x16ff7b[_0xe9bd('0xaa')],[_0xe9bd('0xb0')],[_0xe9bd('0xb1')]);if(_0x2a8861[_0xe9bd('0xad')][_0xe9bd('0xaa')]){delete _0x2a8861[_0xe9bd('0xad')][_0xe9bd('0xaa')];}_0x2a8861[_0xe9bd('0xb2')]=_0x16ff7b['List']||{'id':_0x16ff7b[_0xe9bd('0xb3')]};if(_0x2a8861[_0xe9bd('0xb2')]&&_0x2a8861['list'][_0xe9bd('0xa7')][_0xe9bd('0x53')]){return _0x2a8861[_0xe9bd('0xb2')]['Contacts'][0x0];}var _0x29d6c9=_[_0xe9bd('0x12')](_0x3c1785[_0xe9bd('0x64')],{'firstName':_0x3c1785[_0xe9bd('0x64')]['from'],'ListId':_0x16ff7b[_0xe9bd('0xb3')]});_0x29d6c9[_0x3c1785[_0xe9bd('0x64')][_0xe9bd('0x9c')]]=_0x3c1785[_0xe9bd('0x64')][_0xe9bd('0x9a')];return db[_0xe9bd('0xa6')]['create'](_0x29d6c9,{'fields':_0x5953ca,'raw':!![]});})[_0xe9bd('0x2d')](function(_0x55d50f){_0x2a8861['contact']=_0x55d50f;var _0x3fc20a=createInteractionObject(_0x3c1785['params']['id'],_0x3c1785[_0xe9bd('0x64')],_0x3c1785['headers'],_0x55d50f);var _0x2febfb={'ChatWebsiteId':_0x3c1785[_0xe9bd('0x60')]['id']};if(_0x3c1785['body'][_0xe9bd('0xb4')]){_0x2febfb[_0xe9bd('0xb4')]=_0x3c1785[_0xe9bd('0x64')][_0xe9bd('0xb4')];_0x2febfb[_0xe9bd('0xb5')]=![];return db[_0xe9bd('0xb6')][_0xe9bd('0x62')]({'where':_0x2febfb})['then'](function(_0x23be6d){var _0x1e8c01=_0x3c1785[_0xe9bd('0x64')][_0xe9bd('0x36')]&&_0x3c1785[_0xe9bd('0x64')][_0xe9bd('0x3d')];if(_0x23be6d){_0x1f6f2e=!![];return _0x23be6d;}else if(!_0x1e8c01&&_0x23be6d&&_0x23be6d['closed']){throw new APIConflictError(_0xe9bd('0xb7'));}_0x3fc20a[_0xe9bd('0xb4')]=_0x3c1785[_0xe9bd('0x64')][_0xe9bd('0xb4')];_0x3fc20a[_0xe9bd('0xb8')]=_0x3c1785['body']['externalUrl'];return db['ChatInteraction'][_0xe9bd('0x63')](_0x3fc20a);});}_0x2febfb['ContactId']=_0x55d50f['id'];if(_0x3c1785[_0xe9bd('0x64')][_0xe9bd('0xb9')]&&_0x3c1785['body'][_0xe9bd('0xb9')]['id']){_0x2febfb['id']=_0x3c1785[_0xe9bd('0x64')][_0xe9bd('0xb9')]['id'];return db[_0xe9bd('0xb6')][_0xe9bd('0x62')]({'where':_0x2febfb})[_0xe9bd('0x2d')](function(_0x914313){var _0x54eeed=_0x3c1785['body'][_0xe9bd('0x36')]&&_0x3c1785['body']['referer'];if(!_0x54eeed&&_0x914313&&_0x914313[_0xe9bd('0xb5')]){throw new APIConflictError(_0xe9bd('0xb7'));}else if(_0x914313){_0x1f6f2e=!![];return _0x914313;}else{return db[_0xe9bd('0xb6')][_0xe9bd('0x63')](_0x3fc20a);}});}return db[_0xe9bd('0xb6')][_0xe9bd('0x63')](_0x3fc20a);})[_0xe9bd('0x2d')](function(_0x4339cd){if(!_0x1f6f2e){return _0x4339cd;}var _0xe55ad1={'from':(_0x2a8861[_0xe9bd('0xba')][_0xe9bd('0x3a')]||'')+'\x20'+(_0x2a8861['contact'][_0xe9bd('0x3b')]||'')};if(_0x3c1785['body'][_0xe9bd('0xb4')]&&_0x3c1785[_0xe9bd('0x64')][_0xe9bd('0xbb')]&&_0x3c1785[_0xe9bd('0x64')]['threadId']!=_0x3c1785[_0xe9bd('0x64')][_0xe9bd('0xbb')]){_0xe55ad1[_0xe9bd('0xb4')]=_0x3c1785['body']['messageId'];}return _0x4339cd[_0xe9bd('0xbc')](_0xe55ad1);})[_0xe9bd('0x2d')](function(_0x6e1fd3){_0x2a8861[_0xe9bd('0xb9')]=_0x6e1fd3[_0xe9bd('0x2e')]({'plain':!![]});_0x2a8861[_0xe9bd('0xb9')]['created']=!_0x1f6f2e;if(_0x2a8861[_0xe9bd('0xb9')][_0xe9bd('0xbd')]){if(_0x2a8861[_0xe9bd('0xad')][_0xe9bd('0xbe')]){_0x2a8861['applications'][_0xe9bd('0xbf')]({'id':0x0,'priority':_0x2a8861[_0xe9bd('0xae')][_0xe9bd('0x53')]+0x1,'app':'close','appdata':_0xe9bd('0xc0'),'interval':_0xe9bd('0xc1')});}}return db[_0xe9bd('0xc2')][_0xe9bd('0x63')]({'body':_0x3c1785[_0xe9bd('0x64')][_0xe9bd('0x64')],'ChatWebsiteId':_0x3c1785[_0xe9bd('0x60')]['id'],'ChatInteractionId':_0x6e1fd3['id'],'direction':'in','ContactId':_0x2a8861['contact']['id'],'AttachmentId':_0x3c1785['body'][_0xe9bd('0xc3')]});})[_0xe9bd('0x2d')](function(_0x1e6b83){_0x2a8861['message']=_0x1e6b83;if(!_0x2a8861['interaction'][_0xe9bd('0xc4')]){return;}return db[_0xe9bd('0xc5')][_0xe9bd('0x62')]({'attributes':['id','name'],'where':{'id':_0x2a8861[_0xe9bd('0xb9')]['UserId']}});})[_0xe9bd('0x2d')](function(_0xe52e79){if(_0xe52e79){_0x2a8861[_0xe9bd('0xae')][_0xe9bd('0xc6')]({'id':0x0,'priority':0x0,'app':_0xe9bd('0xc7'),'appdata':_0xe52e79[_0xe9bd('0x32')]+','+(_0x2a8861[_0xe9bd('0xad')][_0xe9bd('0xc8')]||0xa),'interval':_0xe9bd('0xc1')});_0x2a8861['forcedOwnership']=!![];}if(!_0x2a8861['interaction'][_0xe9bd('0xc9')]){return;}return db[_0xe9bd('0xca')][_0xe9bd('0x62')]({'attributes':['id',_0xe9bd('0x32')],'where':{'id':_0x2a8861[_0xe9bd('0xb9')][_0xe9bd('0xc9')]}});})[_0xe9bd('0x2d')](function(_0xdfc5ca){if(_0xdfc5ca){_0x2a8861['applications'][_0xe9bd('0xc6')]({'id':0x0,'priority':0x1,'app':_0xe9bd('0xcb'),'appdata':_0xdfc5ca['name']+','+(_0x2a8861[_0xe9bd('0xad')]['waitForTheAssignedQueue']||0x12c),'interval':_0xe9bd('0xc1')});}return respondWithRpcPromise(_0xe9bd('0xcc'),_0xe9bd('0xcd'),_0x2a8861);})['then'](function(_0x4c7419){respondWithRpcPromise(_0xe9bd('0xce'),'EventManager',{'event':_0xe9bd('0x98'),'message':_0x4c7419},client9002);return _0x4c7419;})[_0xe9bd('0x2d')](respondWithResult(_0xab57a8,null))[_0xe9bd('0x22')](APIHandleError(_0xab57a8));};exports[_0xe9bd('0xcf')]=function(_0x2256c2,_0x4eb22e){var _0x3000a9,_0x2648bd,_0x993518;var _0x2c9342=[];var _0x30c3ed={};var _0x156dfc=_0x2256c2['files']||[];var _0x39e8e5=[];var _0x5a2edb;return db[_0xe9bd('0xa6')]['describe']()[_0xe9bd('0x2d')](function(_0x1ec28e){if(!_0x1ec28e){throw new db['Sequelize'][(_0xe9bd('0xd0'))](_0xe9bd('0xd1'));}_0x2c9342=_['difference'](_[_0xe9bd('0x61')](_0x1ec28e),['createdAt','updatedAt','CompanyId',_0xe9bd('0xb3')]);if(_0x2256c2[_0xe9bd('0x64')]['id']){delete _0x2256c2['body']['id'];}if(_['isNil'](_0x2256c2[_0xe9bd('0x64')]['from'])){throw _0x4eb22e[_0xe9bd('0x25')](0x1f4)[_0xe9bd('0x33')](new db['Sequelize'][(_0xe9bd('0xd0'))](_0xe9bd('0xd2')));}if(_[_0xe9bd('0x88')](_0x2256c2[_0xe9bd('0x64')][_0xe9bd('0x64')])||_0x2256c2[_0xe9bd('0x64')][_0xe9bd('0x64')]===''){throw _0x4eb22e[_0xe9bd('0x25')](0x1f4)[_0xe9bd('0x33')](new db[(_0xe9bd('0xd3'))][(_0xe9bd('0xd0'))](_0xe9bd('0xd4')));}if(_[_0xe9bd('0x88')](_0x2256c2['body'][_0xe9bd('0xd5')])){throw _0x4eb22e[_0xe9bd('0x25')](0x1f4)[_0xe9bd('0x33')](new db[(_0xe9bd('0xd3'))][(_0xe9bd('0xd0'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2c9342));}if(!_[_0xe9bd('0xa0')](_0x2c9342,_0x2256c2[_0xe9bd('0x64')][_0xe9bd('0xd5')])){throw _0x4eb22e[_0xe9bd('0x25')](0x1f4)[_0xe9bd('0x33')](new db[(_0xe9bd('0xd3'))][(_0xe9bd('0xd0'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2c9342));}_0x30c3ed[_0x2256c2[_0xe9bd('0x64')][_0xe9bd('0xd5')]]=_0x2256c2['body'][_0xe9bd('0x9a')];})[_0xe9bd('0x2d')](function(){return db[_0xe9bd('0x5b')][_0xe9bd('0x62')]({'where':{'id':_0x2256c2[_0xe9bd('0x60')]['id']},'include':[{'model':db[_0xe9bd('0xa4')],'as':_0xe9bd('0xa5')},{'model':db[_0xe9bd('0xd6')],'as':'MailAccount'}]});})[_0xe9bd('0x2d')](handleEntityNotFound(_0x4eb22e,null))[_0xe9bd('0x2d')](function(_0x381ad4){if(_0x381ad4&&_0x381ad4['List']){_0x2648bd=_0x381ad4;var _0x351200=_[_0xe9bd('0x12')](_0x2256c2['body'],{'firstName':_0x2256c2['body'][_0xe9bd('0x9a')],'phone':_0x2256c2['body'][_0xe9bd('0x9a')],'ListId':_0x381ad4[_0xe9bd('0xb3')]});_0x351200[_0x2256c2[_0xe9bd('0x64')][_0xe9bd('0xd5')]]=_0x2256c2[_0xe9bd('0x64')][_0xe9bd('0x9a')];return db[_0xe9bd('0xa6')][_0xe9bd('0xd7')]({'where':_0x30c3ed,'defaults':_0x351200});}})['spread'](function(_0x199b78){if(_0x199b78){_0x993518=_0x199b78;var _0x418136=fs[_0xe9bd('0xd8')](path[_0xe9bd('0x82')](config[_0xe9bd('0x83')],_0xe9bd('0xd9')),'utf8');var _0x29ead4=ejs[_0xe9bd('0xda')](_0x418136,{'body':_[_0xe9bd('0xdb')](_0x2256c2[_0xe9bd('0x64')][_0xe9bd('0x64')]),'bodyTitle':_0x2648bd[_0xe9bd('0xdc')]});return db[_0xe9bd('0xdd')][_0xe9bd('0x63')]({'body':_0x29ead4,'plainBody':htmlToText['fromString'](_0x29ead4),'ContactId':_0x199b78['id'],'ChatWebsiteId':_0x2648bd['id']});}})['then'](function(_0x332b06){_0x5a2edb=_0x332b06;if(_0x156dfc[_0xe9bd('0x53')]){var _0x423da1=_0x156dfc[_0xe9bd('0x4a')](function(_0x2db8f4){return{'name':_0x2db8f4[_0xe9bd('0xde')],'basename':_0x2db8f4[_0xe9bd('0x7e')],'type':_0x2db8f4[_0xe9bd('0xdf')],'ChatOfflineMessageId':_0x332b06['id']};});_0x39e8e5=_0x423da1[_0xe9bd('0x4a')](_0x2301ce=>{var _0x4a781d={'filename':_0x2301ce[_0xe9bd('0x32')],'path':path[_0xe9bd('0x82')](config[_0xe9bd('0x83')],_0xe9bd('0xe0'),_0xe9bd('0xe1'),_0xe9bd('0xe2'),_0xe9bd('0xe3'),_0x2301ce['basename'])};return _0x4a781d;});if(!_0x2648bd[_0xe9bd('0xe4')]){return db[_0xe9bd('0xe5')][_0xe9bd('0xe6')](function(_0x23b222){return db[_0xe9bd('0xe7')]['bulkCreate'](_0x423da1,{'transaction':_0x23b222});});}}})[_0xe9bd('0x2d')](function(){if(_0x5a2edb){_0x3000a9=_0x5a2edb;return db[_0xe9bd('0xd6')][_0xe9bd('0x79')]({'where':{'service':!![]},'include':[{'model':db[_0xe9bd('0xe8')],'as':_0xe9bd('0xe9'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xe9bd('0xea'),'raw':!![]}]}]});}})['then'](function(_0x34ae3d){if(_0x34ae3d&&_0x34ae3d[_0xe9bd('0xe9')]&&_0x2648bd[_0xe9bd('0xeb')]&&_0x2648bd['forwardOfflineAddress']){var _0x5b3190=_0x34ae3d[_0xe9bd('0xec')]();return respondWithRpcPromise(_0xe9bd('0xed'),_0xe9bd('0xee'),{'account':_0x5b3190,'message':{'from':util['format'](_0xe9bd('0xef'),_0x34ae3d[_0xe9bd('0x32')],_0x34ae3d[_0xe9bd('0xf0')]||_0x34ae3d[_0xe9bd('0xe9')][_0xe9bd('0x6a')]),'to':_0x2648bd[_0xe9bd('0xf1')],'subject':_0x2648bd[_0xe9bd('0xf2')],'html':_0x3000a9[_0xe9bd('0x64')],'attachments':_0x39e8e5}},client9003)[_0xe9bd('0x2d')](function(){return _0x3000a9;})[_0xe9bd('0x22')](function(_0x1bae64){logger[_0xe9bd('0x1f')](_0x1bae64);});}})[_0xe9bd('0x2d')](function(){if(_0x2648bd&&_0x2648bd[_0xe9bd('0xe4')]&&_0x2648bd['MailAccountId']){var _0x3fe9ca=[];if(_0x156dfc[_0xe9bd('0x53')]){_0x3fe9ca=_0x156dfc['map'](function(_0x94a906){return{'name':_0x94a906[_0xe9bd('0xde')],'basename':_0x94a906[_0xe9bd('0x7e')],'type':_0x94a906[_0xe9bd('0xdf')],'ChatOfflineMessageId':_0x5a2edb['id']};});}var _0x52e35a;if(!_[_0xe9bd('0x88')](_0x2648bd[_0xe9bd('0xf3')])){var _0x287fab=_[_0xe9bd('0x4a')](_0x2256c2[_0xe9bd('0x64')],function(_0x4c25cb){return _0x4c25cb;});var _0x3107f0=_['toPairsIn'](_0x287fab)[0x0];var _0xc162df=_[_0xe9bd('0xf4')](_0x3107f0,function(_0x8f8874){return _0x8f8874;});_0x52e35a=_0xc162df[0x1][_0x2648bd[_0xe9bd('0xf3')]];}var _0x240cd0={'from':_0x993518['email'],'firstName':_0x993518[_0xe9bd('0x3a')],'lastName':_0x993518[_0xe9bd('0x3b')],'mapKey':_0xe9bd('0xf0'),'message':{'from':_0x993518[_0xe9bd('0xf0')],'to':_0x2648bd[_0xe9bd('0xd6')][_0xe9bd('0xf0')],'cc':'','subject':_[_0xe9bd('0x88')](_0x52e35a)?_0x2648bd['offlineMessageSubject']:_0x52e35a,'messageId':'','sentAt':new Date(),'attach':_0x3fe9ca[_0xe9bd('0x53')],'attachments':_0x3fe9ca,'originChannel':_0xe9bd('0xf5'),'ChatWebsiteId':_0x2648bd['id'],'ChatOfflineMessageId':_0x3000a9['id'],'originTo':_0x2648bd[_0xe9bd('0xd6')][_0xe9bd('0xf0')]},'body':_0x3000a9[_0xe9bd('0x64')]};var _0x5f3e76={'account':{'id':_0x2648bd[_0xe9bd('0xf6')]},'body':_0x240cd0,'log':_0xe9bd('0xf7')};return respondWithRpcPromise(_0xe9bd('0xf7'),_0xe9bd('0xf8'),_0x5f3e76,client9001)[_0xe9bd('0x2d')](function(){return _0x3000a9;})[_0xe9bd('0x22')](function(_0xe79615){logger[_0xe9bd('0x1f')](_0xe79615);});}return;})[_0xe9bd('0x2d')](function(){if(_0x3000a9){return _0x3000a9;}})[_0xe9bd('0x2d')](respondWithResult(_0x4eb22e,null))[_0xe9bd('0x22')](function(){for(var _0x3a563a of _0x156dfc){var _0x11461a=path[_0xe9bd('0x82')](config[_0xe9bd('0x83')],_0xe9bd('0xe0'),_0xe9bd('0xe1'),_0xe9bd('0xe2'),_0xe9bd('0xe3'),_0x3a563a[_0xe9bd('0x7e')]);fs_extra['remove'](_0x11461a)[_0xe9bd('0x22')](function(_0x1189fb){logger[_0xe9bd('0x1f')](_0xe9bd('0xf9'),_0x11461a,_0x1189fb);});}});};exports['addInteraction']=function(_0x28756c,_0x5e04d5){return db['ChatInteraction']['find']({'where':{'id':_0x28756c['params']['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x5e04d5,null))[_0xe9bd('0x2d')](function(_0x950ca7){if(_0x950ca7){return _0x950ca7['addInteraction'](_0x28756c[_0xe9bd('0x64')]['ids'],_[_0xe9bd('0xfa')](_0x28756c[_0xe9bd('0x64')],['ids','id'])||{});}})[_0xe9bd('0x2d')](respondWithResult(_0x5e04d5,null))['catch'](handleError(_0x5e04d5,null));};exports['getInteractions']=function(_0x237de3,_0x3a1813){var _0x1ae682={'raw':![],'where':{}};var _0x58ca5e={};var _0x2c1177={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe9bd('0x79')]({'where':{'id':_0x237de3['params']['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x3a1813,null))[_0xe9bd('0x2d')](function(_0x38aa10){if(_0x38aa10){_0x58ca5e['model']=_[_0xe9bd('0x61')](db['ChatInteraction'][_0xe9bd('0x4b')]);_0x58ca5e[_0xe9bd('0x4e')]=_[_0xe9bd('0x61')](_0x237de3[_0xe9bd('0x4e')]);_0x58ca5e[_0xe9bd('0x4f')]=_[_0xe9bd('0x50')](_0x58ca5e[_0xe9bd('0x43')],_0x58ca5e[_0xe9bd('0x4e')]);_0x1ae682[_0xe9bd('0x51')]=_[_0xe9bd('0x50')](_0x58ca5e[_0xe9bd('0x43')],qs[_0xe9bd('0x52')](_0x237de3[_0xe9bd('0x4e')][_0xe9bd('0x52')]));_0x1ae682[_0xe9bd('0x51')]=_0x1ae682[_0xe9bd('0x51')][_0xe9bd('0x53')]?_0x1ae682[_0xe9bd('0x51')]:_0x58ca5e[_0xe9bd('0x43')];if(!_0x237de3[_0xe9bd('0x4e')][_0xe9bd('0x73')]('nolimit')){_0x1ae682[_0xe9bd('0x2a')]=qs[_0xe9bd('0x2a')](_0x237de3['query'][_0xe9bd('0x2a')]);_0x1ae682[_0xe9bd('0x29')]=qs[_0xe9bd('0x29')](_0x237de3[_0xe9bd('0x4e')][_0xe9bd('0x29')]);}_0x1ae682['order']=qs[_0xe9bd('0x55')](_0x237de3[_0xe9bd('0x4e')][_0xe9bd('0x55')]);_0x1ae682[_0xe9bd('0x56')]=qs[_0xe9bd('0x4f')](_[_0xe9bd('0x57')](_0x237de3[_0xe9bd('0x4e')],_0x58ca5e[_0xe9bd('0x4f')]));_0x1ae682[_0xe9bd('0x56')][_0xe9bd('0x70')]=_0x38aa10['id'];if(_0x237de3['query'][_0xe9bd('0x58')]){_0x1ae682[_0xe9bd('0x56')]=_[_0xe9bd('0x59')](_0x1ae682[_0xe9bd('0x56')],{'$or':_[_0xe9bd('0x4a')](_0x1ae682[_0xe9bd('0x51')],function(_0x46f48b){var _0x44403c={};_0x44403c[_0x46f48b]={'$like':'%'+_0x237de3['query'][_0xe9bd('0x58')]+'%'};return _0x44403c;})});}_0x1ae682=_[_0xe9bd('0x59')]({},_0x1ae682,_0x237de3[_0xe9bd('0x5a')]);return db[_0xe9bd('0xb6')]['count']({'where':_0x1ae682[_0xe9bd('0x56')]})[_0xe9bd('0x2d')](function(_0x298c03){_0x2c1177[_0xe9bd('0x28')]=_0x298c03;if(_0x237de3[_0xe9bd('0x4e')][_0xe9bd('0xfb')]){_0x1ae682[_0xe9bd('0x5c')]=[{'model':db[_0xe9bd('0xa6')],'as':'Contact','required':![]},{'model':db[_0xe9bd('0xc5')],'as':'Owner','attributes':['name','fullname',_0xe9bd('0xfc')],'required':![]},{'model':db['Tag'],'as':_0xe9bd('0xfd'),'attributes':['id','name','color'],'where':_0x237de3[_0xe9bd('0x4e')]['tag']?{'id':_0x237de3[_0xe9bd('0x4e')][_0xe9bd('0xfe')]}:undefined,'required':_0x237de3[_0xe9bd('0x4e')][_0xe9bd('0xfe')]?!![]:![]}];}return db[_0xe9bd('0xb6')][_0xe9bd('0x5d')](_0x1ae682);})['then'](function(_0x379afa){_0x2c1177[_0xe9bd('0x5e')]=_0x379afa;return _0x2c1177;});}})[_0xe9bd('0x2d')](respondWithFilteredResult(_0x3a1813,_0x1ae682))['catch'](handleError(_0x3a1813,null));};exports[_0xe9bd('0xff')]=function(_0x3c0224,_0x513d7e){var _0x364dc2=0x0;var _0x3da15a=0x0;var _0x44af86=![];var _0x794246;var _0x415fdf;return db['ChatWebsite']['find']({'where':{'id':_0x3c0224[_0xe9bd('0x60')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db['Interval'],'as':_0xe9bd('0xab'),'attributes':['id',_0xe9bd('0x100')]}]}]})[_0xe9bd('0x2d')](handleEntityNotFound(_0x513d7e,null))[_0xe9bd('0x2d')](function(_0xeb2582){if(_0xeb2582){_0x794246=_0xeb2582;return _0xeb2582[_0xe9bd('0x101')]({'raw':!![]});}})[_0xe9bd('0x2d')](function(_0x49077e){if(_0x794246){if(_0x49077e){_0x415fdf=_0x49077e;}}return require(_0xe9bd('0x85'))[_0xe9bd('0x86')]();})[_0xe9bd('0x2d')](function(_0x5e2013){if(_0x5e2013){_0x3da15a=_0x5e2013[_0xe9bd('0x102')];_0x44af86=_0x5e2013[_0xe9bd('0x87')];}})[_0xe9bd('0x2d')](function(){return db['ChatInteraction'][_0xe9bd('0x28')]({'where':{'closed':![]}});})[_0xe9bd('0x2d')](function(_0xbf887){_0x364dc2=_0xbf887;if(_0x3da15a&&_0xbf887>_0x3da15a){return db['License'][_0xe9bd('0x79')]({'where':{'id':0x1}})[_0xe9bd('0x2d')](function(_0xfe63bf){if(_0xfe63bf){_0xfe63bf[_0xe9bd('0x103')]('chatLicenseExceeded');}});}})[_0xe9bd('0x2d')](function(){var _0x3988df=_0x794246[_0xe9bd('0x94')];var _0x1628d4=_0x794246['timezone']||undefined;return _0x3988df?_0x3988df[_0xe9bd('0x97')](_0x1628d4):!![];})[_0xe9bd('0x2d')](function(_0x3262b5){var _0x13f1d7=fs[_0xe9bd('0xd8')](path['join'](config[_0xe9bd('0x83')],_0xe9bd('0x104')),_0xe9bd('0x105'));var _0x34d333='3.10.1';var _0xc7c9a8=![];var _0x3d7e87,_0x225a35;if(_0x3c0224[_0xe9bd('0x106')]['referer']){_0x3d7e87=new URL(_0x3c0224[_0xe9bd('0x106')][_0xe9bd('0x3d')])[_0xe9bd('0x107')];}else if(_0x3c0224[_0xe9bd('0x106')]['origin']){_0x3d7e87=new URL(_0x3c0224[_0xe9bd('0x106')][_0xe9bd('0x107')])[_0xe9bd('0x107')];}else{_0x3d7e87=_0xe9bd('0x108');}_0x225a35=typeof _0x794246[_0xe9bd('0x65')][_0xe9bd('0x39')](',')[_0xe9bd('0x62')](function(_0x3f44d9){return wildcardUtils['testWebsiteWithWildcard'](_0x3f44d9,_0x3d7e87);})!==_0xe9bd('0x27');var _0xb835d7={'chatVersion':_0x34d333,'chatWebsiteAddressOrigin':_0x225a35?_0x3d7e87:_0x794246[_0xe9bd('0x65')],'remote':_0x794246[_0xe9bd('0x109')],'query':querystring['stringify'](_[_0xe9bd('0x59')](_0x794246[_0xe9bd('0x2e')]({'plain':!![]}),{'customerIp':_0x3c0224[_0xe9bd('0x106')][_0xe9bd('0x38')]||_0x3c0224['headers']['x-real-ip']||_0x3c0224[_0xe9bd('0x10a')]['remoteAddress']||_0x3c0224['ip'],'referer':_0x3c0224['headers'][_0xe9bd('0x3d')],'openedInteractions':_0x364dc2,'maxInteractions':_0x3da15a,'virtual':_0x44af86['virtual'],'online':_0x3262b5,'custom':_0x44af86,'address':_0x225a35?_0x3d7e87:null}))[_0xe9bd('0x10b')](/'/g,'\x5c\x27')};_0x513d7e[_0xe9bd('0x33')](ejs[_0xe9bd('0xda')](Mustache[_0xe9bd('0xda')](_0x13f1d7,_0xb835d7),{'proactiveActions':_0x415fdf,'alignment':_0x794246[_0xe9bd('0x10c')],'verticalAlignment':_0x794246[_0xe9bd('0x10d')],'div_color':_0x794246[_0xe9bd('0x10e')],'labelText':_0x794246[_0xe9bd('0x10f')],'text_color':_0x794246[_0xe9bd('0x110')],'text_button_color':_0x794246[_0xe9bd('0x111')],'button_color':_0x794246[_0xe9bd('0x112')],'background_color':_0x794246[_0xe9bd('0x113')],'hideWhenOffline':_0x794246[_0xe9bd('0x114')],'intervalId':_0x794246[_0xe9bd('0x115')],'isDevelopment':_0xc7c9a8,'chatVersion':_0x34d333}));})[_0xe9bd('0x22')](handleError(_0x513d7e,null));};exports[_0xe9bd('0x116')]=function(_0x52ffd7,_0x38c5d6){var _0x3a801e=_0x52ffd7[_0xe9bd('0x60')]['id'];var _0x367e1f=_0x52ffd7[_0xe9bd('0x64')];var _0x4f9ce9=0xc8;var _0x13076f=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xe9bd('0xe5')][_0xe9bd('0x117')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x5029a4){return db[_0xe9bd('0x5b')]['findOne']({'where':{'id':_0x3a801e},'transaction':_0x5029a4})['then'](function(_0x22a1fe){if(_0x22a1fe){return db['ChatApplication'][_0xe9bd('0x31')]({'where':{'ChatWebsiteId':_0x3a801e},'transaction':_0x5029a4})[_0xe9bd('0x2d')](function(){var _0x17907b=_[_0xe9bd('0x4a')](_0x367e1f,function(_0x54a544){_0x54a544[_0xe9bd('0x70')]=_0x3a801e;return _0x54a544;});return db[_0xe9bd('0xa9')][_0xe9bd('0x118')](_0x17907b,{'transaction':_0x5029a4});});}else{_0x4f9ce9=0x194;_0x13076f=[];}});})[_0xe9bd('0x2d')](function(){if(_0x4f9ce9!==0x194){return db[_0xe9bd('0xa9')][_0xe9bd('0x119')]({'where':{'ChatWebsiteId':_0x3a801e},'order':_0xe9bd('0xb0')})['then'](function(_0x51801a){_0x13076f=_0x51801a;});}})['catch'](function(_0x57bb20){_0x4f9ce9=0x1f4;logger[_0xe9bd('0x1f')](_0x57bb20[_0xe9bd('0x11a')]);if(_0x57bb20[_0xe9bd('0x32')]){delete _0x57bb20[_0xe9bd('0x32')];}_0x13076f=_0x57bb20;})[_0xe9bd('0x11b')](function(){if(_0x13076f===null){_0x38c5d6[_0xe9bd('0x23')](_0x4f9ce9);}else{if(_0x4f9ce9===0x1f4){_0x38c5d6[_0xe9bd('0x25')](_0x4f9ce9)[_0xe9bd('0x33')](_0x13076f);}else{_0x38c5d6['status'](_0x4f9ce9)[_0xe9bd('0x26')](_0x13076f);}}});};exports[_0xe9bd('0x11c')]=function(_0x2dcbb5,_0x34c059){var _0x16b9ff={};var _0x6fafa8={};var _0x510de3;var _0x1a68ff;return db[_0xe9bd('0x5b')][_0xe9bd('0x79')]({'where':{'id':_0x2dcbb5[_0xe9bd('0x60')]['id']}})['then'](handleEntityNotFound(_0x34c059,null))['then'](function(_0x5344b2){if(_0x5344b2){_0x510de3=_0x5344b2;_0x6fafa8[_0xe9bd('0x43')]=_['keys'](db[_0xe9bd('0xa9')][_0xe9bd('0x4b')]);_0x6fafa8[_0xe9bd('0x4e')]=_[_0xe9bd('0x61')](_0x2dcbb5[_0xe9bd('0x4e')]);_0x6fafa8[_0xe9bd('0x4f')]=_[_0xe9bd('0x50')](_0x6fafa8[_0xe9bd('0x43')],_0x6fafa8['query']);_0x16b9ff[_0xe9bd('0x51')]=_[_0xe9bd('0x50')](_0x6fafa8[_0xe9bd('0x43')],qs[_0xe9bd('0x52')](_0x2dcbb5[_0xe9bd('0x4e')][_0xe9bd('0x52')]));_0x16b9ff[_0xe9bd('0x51')]=_0x16b9ff['attributes'][_0xe9bd('0x53')]?_0x16b9ff[_0xe9bd('0x51')]:_0x6fafa8[_0xe9bd('0x43')];_0x16b9ff[_0xe9bd('0x74')]=qs[_0xe9bd('0x55')](_0x2dcbb5['query'][_0xe9bd('0x55')]);_0x16b9ff[_0xe9bd('0x56')]=qs[_0xe9bd('0x4f')](_['pick'](_0x2dcbb5['query'],_0x6fafa8[_0xe9bd('0x4f')]));if(_0x2dcbb5[_0xe9bd('0x4e')][_0xe9bd('0x58')]){_0x16b9ff[_0xe9bd('0x56')]=_[_0xe9bd('0x59')](_0x16b9ff['where'],{'$or':_[_0xe9bd('0x4a')](_0x16b9ff[_0xe9bd('0x51')],function(_0x230dc3){var _0x293858={};_0x293858[_0x230dc3]={'$like':'%'+_0x2dcbb5[_0xe9bd('0x4e')][_0xe9bd('0x58')]+'%'};return _0x293858;})});}_0x16b9ff=_[_0xe9bd('0x59')]({},_0x16b9ff,_0x2dcbb5[_0xe9bd('0x5a')]);return _0x510de3[_0xe9bd('0x11c')](_0x16b9ff);}})['then'](function(_0x3ebd5d){if(_0x3ebd5d){_0x1a68ff=_0x3ebd5d[_0xe9bd('0x53')];if(!_0x2dcbb5['query'][_0xe9bd('0x73')](_0xe9bd('0x54'))){_0x16b9ff[_0xe9bd('0x2a')]=qs[_0xe9bd('0x2a')](_0x2dcbb5['query'][_0xe9bd('0x2a')]);_0x16b9ff['offset']=qs[_0xe9bd('0x29')](_0x2dcbb5[_0xe9bd('0x4e')]['offset']);}return _0x510de3[_0xe9bd('0x11c')](_0x16b9ff);}})[_0xe9bd('0x2d')](function(_0x2eb64d){if(_0x2eb64d){return _0x2eb64d?{'count':_0x1a68ff,'rows':_0x2eb64d}:null;}})['then'](respondWithResult(_0x34c059,null))[_0xe9bd('0x22')](handleError(_0x34c059,null));};exports[_0xe9bd('0x11d')]=function(_0x352484,_0x46f994){return db['chatProactiveAction'][_0xe9bd('0x62')]({'where':{'id':_0x352484[_0xe9bd('0x60')]['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x46f994,null))[_0xe9bd('0x2d')](function(_0x9ca060){if(_0x9ca060){return _0x9ca060[_0xe9bd('0x11d')](_0x352484[_0xe9bd('0x64')][_0xe9bd('0x76')],_['omit'](_0x352484[_0xe9bd('0x64')],[_0xe9bd('0x76'),'id'])||{});}})[_0xe9bd('0x2d')](respondWithResult(_0x46f994,null))[_0xe9bd('0x22')](handleError(_0x46f994,null));};exports['getProactiveActions']=function(_0xcce209,_0x1b7d5b){var _0x2f0a5d={};var _0x5a1e21={};var _0x4a3260;var _0x11dc0d;return db[_0xe9bd('0x5b')][_0xe9bd('0x79')]({'where':{'id':_0xcce209[_0xe9bd('0x60')]['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x1b7d5b,null))['then'](function(_0x5c9f1a){if(_0x5c9f1a){_0x4a3260=_0x5c9f1a;_0x5a1e21[_0xe9bd('0x43')]=_[_0xe9bd('0x61')](db[_0xe9bd('0x11e')][_0xe9bd('0x4b')]);_0x5a1e21[_0xe9bd('0x4e')]=_['keys'](_0xcce209[_0xe9bd('0x4e')]);_0x5a1e21[_0xe9bd('0x4f')]=_[_0xe9bd('0x50')](_0x5a1e21[_0xe9bd('0x43')],_0x5a1e21[_0xe9bd('0x4e')]);_0x2f0a5d['attributes']=_[_0xe9bd('0x50')](_0x5a1e21['model'],qs[_0xe9bd('0x52')](_0xcce209['query']['fields']));_0x2f0a5d['attributes']=_0x2f0a5d[_0xe9bd('0x51')][_0xe9bd('0x53')]?_0x2f0a5d[_0xe9bd('0x51')]:_0x5a1e21[_0xe9bd('0x43')];_0x2f0a5d[_0xe9bd('0x74')]=qs[_0xe9bd('0x55')](_0xcce209[_0xe9bd('0x4e')][_0xe9bd('0x55')]);_0x2f0a5d[_0xe9bd('0x56')]=qs[_0xe9bd('0x4f')](_['pick'](_0xcce209[_0xe9bd('0x4e')],_0x5a1e21[_0xe9bd('0x4f')]));if(_0xcce209['query'][_0xe9bd('0x58')]){_0x2f0a5d['where']=_['merge'](_0x2f0a5d[_0xe9bd('0x56')],{'$or':_[_0xe9bd('0x4a')](_0x2f0a5d[_0xe9bd('0x51')],function(_0x5d756a){var _0x5d5a7a={};_0x5d5a7a[_0x5d756a]={'$like':'%'+_0xcce209[_0xe9bd('0x4e')][_0xe9bd('0x58')]+'%'};return _0x5d5a7a;})});}_0x2f0a5d=_[_0xe9bd('0x59')]({},_0x2f0a5d,_0xcce209['options']);return _0x4a3260[_0xe9bd('0x101')](_0x2f0a5d);}})[_0xe9bd('0x2d')](function(_0x1096f4){if(_0x1096f4){_0x11dc0d=_0x1096f4['length'];if(!_0xcce209[_0xe9bd('0x4e')][_0xe9bd('0x73')](_0xe9bd('0x54'))){_0x2f0a5d[_0xe9bd('0x2a')]=qs['limit'](_0xcce209[_0xe9bd('0x4e')][_0xe9bd('0x2a')]);_0x2f0a5d[_0xe9bd('0x29')]=qs[_0xe9bd('0x29')](_0xcce209['query'][_0xe9bd('0x29')]);}return _0x4a3260[_0xe9bd('0x101')](_0x2f0a5d);}})[_0xe9bd('0x2d')](function(_0x5eefaf){if(_0x5eefaf){return _0x5eefaf?{'count':_0x11dc0d,'rows':_0x5eefaf}:null;}})[_0xe9bd('0x2d')](respondWithResult(_0x1b7d5b,null))[_0xe9bd('0x22')](handleError(_0x1b7d5b,null));};exports[_0xe9bd('0x11f')]=function(_0x47c137,_0x4ab2e9){var _0x52dc90=_0x47c137['query'][_0xe9bd('0x120')]===_0xe9bd('0x121')?_0xe9bd('0x122'):_0xe9bd('0x123');return db['ChatWebsite']['find']({'attributes':['id',_0x52dc90],'where':{'id':_0x47c137[_0xe9bd('0x60')]['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x4ab2e9,null))['then'](function(_0x24d661){if(_0x24d661){var _0x565b57=_0x24d661[_0x52dc90];var _0x4b0a01=_0x565b57&&_0x565b57['items']?_0x565b57['items']:[];_0x4ab2e9[_0xe9bd('0x33')]({'fromKey':_[_0xe9bd('0x88')](_0x565b57[_0xe9bd('0x124')])?undefined:_0x565b57[_0xe9bd('0x124')],'count':_0x4b0a01[_0xe9bd('0x53')],'rows':_0x4b0a01});}})[_0xe9bd('0x22')](handleError(_0x4ab2e9,null));};exports['getOfflineMessages']=function(_0x5eb33b,_0x15e9a9){var _0x142f33={'raw':![],'where':{}};var _0x17a4c8={};var _0x457c02={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x5eb33b['params']['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x15e9a9,null))['then'](function(_0x25f0ef){if(_0x25f0ef){_0x17a4c8[_0xe9bd('0x43')]=_['keys'](db['ChatOfflineMessage'][_0xe9bd('0x4b')]);_0x17a4c8['query']=_[_0xe9bd('0x61')](_0x5eb33b[_0xe9bd('0x4e')]);_0x17a4c8[_0xe9bd('0x4f')]=_[_0xe9bd('0x50')](_0x17a4c8[_0xe9bd('0x43')],_0x17a4c8['query']);_0x142f33[_0xe9bd('0x51')]=_[_0xe9bd('0x50')](_0x17a4c8[_0xe9bd('0x43')],qs[_0xe9bd('0x52')](_0x5eb33b[_0xe9bd('0x4e')][_0xe9bd('0x52')]));_0x142f33['attributes']=_0x142f33[_0xe9bd('0x51')]['length']?_0x142f33[_0xe9bd('0x51')]:_0x17a4c8[_0xe9bd('0x43')];if(!_0x5eb33b[_0xe9bd('0x4e')][_0xe9bd('0x73')]('nolimit')){_0x142f33[_0xe9bd('0x2a')]=qs[_0xe9bd('0x2a')](_0x5eb33b[_0xe9bd('0x4e')][_0xe9bd('0x2a')]);_0x142f33['offset']=qs[_0xe9bd('0x29')](_0x5eb33b[_0xe9bd('0x4e')][_0xe9bd('0x29')]);}_0x142f33['order']=qs[_0xe9bd('0x55')](_0x5eb33b[_0xe9bd('0x4e')][_0xe9bd('0x55')]);_0x142f33['where']=qs[_0xe9bd('0x4f')](_[_0xe9bd('0x57')](_0x5eb33b[_0xe9bd('0x4e')],_0x17a4c8[_0xe9bd('0x4f')]));_0x142f33[_0xe9bd('0x56')][_0xe9bd('0x70')]=_0x25f0ef['id'];if(_0x5eb33b[_0xe9bd('0x4e')]['filter']){_0x142f33['where']=_[_0xe9bd('0x59')](_0x142f33[_0xe9bd('0x56')],{'$or':_[_0xe9bd('0x4a')](_0x142f33['attributes'],function(_0x5c96f9){var _0x1dc840={};_0x1dc840[_0x5c96f9]={'$like':'%'+_0x5eb33b[_0xe9bd('0x4e')][_0xe9bd('0x58')]+'%'};return _0x1dc840;})});}_0x142f33=_['merge']({},_0x142f33,_0x5eb33b[_0xe9bd('0x5a')]);return db[_0xe9bd('0xdd')][_0xe9bd('0x28')]({'where':_0x142f33[_0xe9bd('0x56')]})[_0xe9bd('0x2d')](function(_0x476af9){_0x457c02[_0xe9bd('0x28')]=_0x476af9;if(_0x5eb33b[_0xe9bd('0x4e')][_0xe9bd('0xfb')]){_0x142f33['include']=[{'all':!![]}];}else{_0x142f33['include']=[{'model':db[_0xe9bd('0xa6')],'as':_0xe9bd('0x125'),'required':![]},{'model':db[_0xe9bd('0xe7')],'as':_0xe9bd('0x126'),'required':![]}];}return db['ChatOfflineMessage'][_0xe9bd('0x5d')](_0x142f33);})[_0xe9bd('0x2d')](function(_0x8ec7a3){_0x457c02[_0xe9bd('0x5e')]=_0x8ec7a3;return _0x457c02;});}})[_0xe9bd('0x2d')](respondWithFilteredResult(_0x15e9a9,_0x142f33))['catch'](handleError(_0x15e9a9,null));};exports[_0xe9bd('0x127')]=function(_0x259361,_0x4212f6){return db[_0xe9bd('0x5b')]['find']({'where':{'id':_0x259361['params']['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x4212f6,null))['then'](function(_0x3e45ba){if(_0x3e45ba){return _0x3e45ba[_0xe9bd('0x127')](_0x259361[_0xe9bd('0x64')][_0xe9bd('0x76')],_[_0xe9bd('0xfa')](_0x259361['body'],['ids','id'])||{})[_0xe9bd('0x128')](function(_0x5690ee){for(var _0x4210c7=0x0;_0x4210c7<_0x259361[_0xe9bd('0x64')]['ids']['length'];_0x4210c7+=0x1){socket[_0xe9bd('0x129')](_0xe9bd('0x12a'),{'UserId':Number(_0x259361[_0xe9bd('0x64')][_0xe9bd('0x76')][_0x4210c7]),'ChatWebsiteId':Number(_0x259361['params']['id'])});}return _0x5690ee;});}})[_0xe9bd('0x2d')](respondWithResult(_0x4212f6,null))[_0xe9bd('0x22')](handleError(_0x4212f6,null));};exports[_0xe9bd('0x12b')]=function(_0x2b7c73,_0xb75604){return db[_0xe9bd('0x5b')][_0xe9bd('0x62')]({'where':{'id':_0x2b7c73['params']['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0xb75604,null))['then'](function(_0x3ccd6f){if(_0x3ccd6f){return _0x3ccd6f[_0xe9bd('0x12b')](_0x2b7c73['query'][_0xe9bd('0x76')])[_0xe9bd('0x2d')](function(){if(_[_0xe9bd('0x12c')](_0x2b7c73[_0xe9bd('0x4e')][_0xe9bd('0x76')])){for(var _0x1ce2e7=0x0;_0x1ce2e7<_0x2b7c73['query'][_0xe9bd('0x76')][_0xe9bd('0x53')];_0x1ce2e7+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x2b7c73[_0xe9bd('0x4e')]['ids'][_0x1ce2e7]),'ChatWebsiteId':Number(_0x2b7c73[_0xe9bd('0x60')]['id'])});}}else{socket[_0xe9bd('0x129')](_0xe9bd('0x12d'),{'UserId':Number(_0x2b7c73[_0xe9bd('0x4e')]['ids']),'ChatWebsiteId':Number(_0x2b7c73[_0xe9bd('0x60')]['id'])});}});}})[_0xe9bd('0x2d')](respondWithStatusCode(_0xb75604,null))[_0xe9bd('0x22')](handleError(_0xb75604,null));};exports[_0xe9bd('0x12e')]=function(_0x33c25d,_0x337721){var _0x4703c7={};var _0xc877fd={};var _0x14fcdc;var _0x3f3e29;return db[_0xe9bd('0x5b')][_0xe9bd('0x79')]({'where':{'id':_0x33c25d[_0xe9bd('0x60')]['id']}})[_0xe9bd('0x2d')](handleEntityNotFound(_0x337721,null))['then'](function(_0x3f929f){if(_0x3f929f){_0x14fcdc=_0x3f929f;_0xc877fd[_0xe9bd('0x43')]=_[_0xe9bd('0x61')](db[_0xe9bd('0xc5')][_0xe9bd('0x4b')]);_0xc877fd[_0xe9bd('0x4e')]=_['keys'](_0x33c25d[_0xe9bd('0x4e')]);_0xc877fd[_0xe9bd('0x4f')]=_['intersection'](_0xc877fd[_0xe9bd('0x43')],_0xc877fd[_0xe9bd('0x4e')]);_0x4703c7[_0xe9bd('0x51')]=_[_0xe9bd('0x50')](_0xc877fd[_0xe9bd('0x43')],qs[_0xe9bd('0x52')](_0x33c25d[_0xe9bd('0x4e')][_0xe9bd('0x52')]));_0x4703c7[_0xe9bd('0x51')]=_0x4703c7[_0xe9bd('0x51')]['length']?_0x4703c7[_0xe9bd('0x51')]:_0xc877fd[_0xe9bd('0x43')];_0x4703c7[_0xe9bd('0x74')]=qs[_0xe9bd('0x55')](_0x33c25d[_0xe9bd('0x4e')][_0xe9bd('0x55')]);_0x4703c7['where']=qs[_0xe9bd('0x4f')](_[_0xe9bd('0x57')](_0x33c25d[_0xe9bd('0x4e')],_0xc877fd[_0xe9bd('0x4f')]));if(_0x33c25d[_0xe9bd('0x4e')][_0xe9bd('0x58')]){_0x4703c7['where']=_[_0xe9bd('0x59')](_0x4703c7[_0xe9bd('0x56')],{'$or':_[_0xe9bd('0x4a')](_0x4703c7[_0xe9bd('0x51')],function(_0x43b790){var _0x15485c={};_0x15485c[_0x43b790]={'$like':'%'+_0x33c25d[_0xe9bd('0x4e')]['filter']+'%'};return _0x15485c;})});}_0x4703c7=_[_0xe9bd('0x59')]({},_0x4703c7,_0x33c25d[_0xe9bd('0x5a')]);return _0x14fcdc['getAgents'](_0x4703c7);}})[_0xe9bd('0x2d')](function(_0x1cf9f0){if(_0x1cf9f0){_0x3f3e29=_0x1cf9f0[_0xe9bd('0x53')];if(!_0x33c25d[_0xe9bd('0x4e')][_0xe9bd('0x73')](_0xe9bd('0x54'))){_0x4703c7[_0xe9bd('0x2a')]=qs[_0xe9bd('0x2a')](_0x33c25d[_0xe9bd('0x4e')]['limit']);_0x4703c7['offset']=qs['offset'](_0x33c25d[_0xe9bd('0x4e')][_0xe9bd('0x29')]);}return _0x14fcdc[_0xe9bd('0x12e')](_0x4703c7);}})['then'](function(_0x21ac1f){if(_0x21ac1f){return _0x21ac1f?{'count':_0x3f3e29,'rows':_0x21ac1f}:null;}})[_0xe9bd('0x2d')](respondWithResult(_0x337721,null))[_0xe9bd('0x22')](handleError(_0x337721,null));};
\ No newline at end of file
+var _0x98a8=['emit','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../errors/api','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','redis','socket.io-emitter','./chatWebsite.socket','client','http','request','info','ChatWebsite,\x20%s,\x20%s','debug','stringify','error','message','result','catch','end','status','json','limit','undefined','count','offset','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','then','sendStatus','name','user-agent-parser','setUA','customerIp','x-forwarded-for','first','split','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','model','type','index','mandatoryDispositionPause','map','ChatWebsite','fieldName','key','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','params','Pause','rawAttributes','includeAll','find','create','body','forEach','trim','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','address','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','describe','addDisposition','ChatWebsiteId','findOne','Disposition','hasOwnProperty','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','root','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','notify','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','referer','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','Contacts','ChatApplication','interval','account','applications','orderBy','Applications','priority','asc','list','List','defaults','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','contact','messageId','created','autoclose','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','files','Sequelize','no\x20available\x20attributes','difference','ValidationError','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','render','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','email','firstName','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','getSnippet','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','utf8','3.10.1','headers','origin','http://localhost:9000','x-real-ip','verticalAlignment','textButtonColor','color_button','backgroundColor','IntervalId','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x98a8,0x12c));var _0x898a=function(_0x35d80c,_0x1aa9a6){_0x35d80c=_0x35d80c-0x0;var _0x185739=_0x98a8[_0x35d80c];return _0x185739;};'use strict';var Mustache=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var ejs=require(_0x898a('0x3'));var fs=require('fs');var fs_extra=require(_0x898a('0x4'));var _=require(_0x898a('0x5'));var querystring=require(_0x898a('0x6'));var htmlToText=require('html-to-text');var Redis=require(_0x898a('0x7'));var jayson=require(_0x898a('0x8'));var qs=require(_0x898a('0x9'));var logger=require(_0x898a('0xa'))(_0x898a('0xb'));var config=require('../../config/environment');var APIBadRequestError=require(_0x898a('0xc'))['APIBadRequestError'];var APINotFoundError=require(_0x898a('0xc'))['APINotFoundError'];var APIOutOfIntervalError=require(_0x898a('0xc'))[_0x898a('0xd')];var APIHandleError=require(_0x898a('0xc'))[_0x898a('0xe')];var APIConflictError=require(_0x898a('0xc'))[_0x898a('0xf')];var wildcardUtils=require(_0x898a('0x10'));var URL=require(_0x898a('0x11'))[_0x898a('0x12')];var db=require('../../mysqldb')['db'];config[_0x898a('0x13')]=_['defaults'](config[_0x898a('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x898a('0x14'))(new Redis(config[_0x898a('0x13')]));require(_0x898a('0x15'))['register'](socket);var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x898a('0x16')][_0x898a('0x17')]({'port':0x232a});var client9003=jayson[_0x898a('0x16')][_0x898a('0x17')]({'port':0x232b});var client9001=jayson[_0x898a('0x16')][_0x898a('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x506023,_0x47033c,_0x53a4b8,_0x3fec7a){return new Promise(function(_0x5c96a6,_0x303321){var _0x4fb05b=_0x3fec7a||client;return _0x4fb05b[_0x898a('0x18')](_0x506023,_0x53a4b8)['then'](function(_0xee4408){logger[_0x898a('0x19')](_0x898a('0x1a'),_0x47033c,'request\x20sent');logger[_0x898a('0x1b')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x47033c,'request\x20sent',JSON[_0x898a('0x1c')](_0xee4408));if(_0xee4408[_0x898a('0x1d')]){if(_0xee4408['error']['code']===0x1f4){logger[_0x898a('0x1d')](_0x898a('0x1a'),_0x47033c,_0xee4408[_0x898a('0x1d')][_0x898a('0x1e')]);return _0x303321(_0xee4408[_0x898a('0x1d')][_0x898a('0x1e')]);}logger[_0x898a('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x47033c,_0xee4408[_0x898a('0x1d')][_0x898a('0x1e')]);return _0x5c96a6(_0xee4408[_0x898a('0x1d')][_0x898a('0x1e')]);}else{logger[_0x898a('0x19')](_0x898a('0x1a'),_0x47033c,'request\x20sent');_0x5c96a6(_0xee4408[_0x898a('0x1f')][_0x898a('0x1e')]);}})[_0x898a('0x20')](function(_0x32eca5){logger[_0x898a('0x1d')](_0x898a('0x1a'),_0x47033c,_0x32eca5);_0x303321(_0x32eca5);});});}function respondWithStatusCode(_0x5b7719,_0x20bde0){_0x20bde0=_0x20bde0||0xcc;return function(_0x51d501){if(_0x51d501){return _0x5b7719['sendStatus'](_0x20bde0);}return _0x5b7719['status'](_0x20bde0)[_0x898a('0x21')]();};}function respondWithResult(_0x1f4d86,_0x420b25){_0x420b25=_0x420b25||0xc8;return function(_0x40b3db){if(_0x40b3db){return _0x1f4d86[_0x898a('0x22')](_0x420b25)[_0x898a('0x23')](_0x40b3db);}};}function respondWithFilteredResult(_0x398e98,_0xac1fc4){return function(_0xd31922){if(_0xd31922){var _0x58149d=typeof _0xac1fc4['offset']==='undefined'&&typeof _0xac1fc4[_0x898a('0x24')]===_0x898a('0x25');var _0x3b7704=_0xd31922[_0x898a('0x26')];var _0x34f447=_0x58149d?0x0:_0xac1fc4[_0x898a('0x27')];var _0xe3c983=_0x58149d?_0xd31922[_0x898a('0x26')]:_0xac1fc4[_0x898a('0x27')]+_0xac1fc4[_0x898a('0x24')];var _0x44c5d2;if(_0xe3c983>=_0x3b7704){_0xe3c983=_0x3b7704;_0x44c5d2=0xc8;}else{_0x44c5d2=0xce;}_0x398e98[_0x898a('0x22')](_0x44c5d2);return _0x398e98['set'](_0x898a('0x28'),_0x34f447+'-'+_0xe3c983+'/'+_0x3b7704)[_0x898a('0x23')](_0xd31922);}return null;};}function saveUpdates(_0x26eead){return function(_0x17a980){if(_0x17a980){return _0x17a980[_0x898a('0x29')](_0x26eead)['then'](function(_0x48cefb){return _0x48cefb;});}return null;};}function removeEntity(_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x2a')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x2b')]({'plain':!![]});var _0x5eafc7=_0x898a('0x2c');return db[_0x898a('0x2d')][_0x898a('0x2a')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x2e')](function(){return _0x1e2fd4;});})[_0x898a('0x2e')](function(){_0x20a3fe['status'](0xcc)[_0x898a('0x21')]();});}};}function handleEntityNotFound(_0x5baf5b){return function(_0x573eb3){if(!_0x573eb3){_0x5baf5b[_0x898a('0x2f')](0x194);}return _0x573eb3;};}function handleError(_0x58d997,_0x3c9588){_0x3c9588=_0x3c9588||0x1f4;return function(_0x4b3aac){logger[_0x898a('0x1d')](_0x4b3aac['stack']);if(_0x4b3aac[_0x898a('0x30')]){delete _0x4b3aac[_0x898a('0x30')];}_0x58d997[_0x898a('0x22')](_0x3c9588)['send'](_0x4b3aac);};}function createInteractionObject(_0x554897,_0x47966e,_0x1575d2,_0x429c32){var _0x5a228f=require(_0x898a('0x31'));var _0x3d3463=new _0x5a228f();var _0xe84f7e=_0x3d3463[_0x898a('0x32')](_0x1575d2['user-agent'])['getResult']();var _0x3aed01=_0x47966e[_0x898a('0x33')];if(_0x1575d2['cf-connecting-ip']){_0x3aed01=_0x1575d2['cf-connecting-ip'];}else if(_0x1575d2[_0x898a('0x34')]){_0x3aed01=_[_0x898a('0x35')](_0x1575d2[_0x898a('0x34')][_0x898a('0x36')](','));}return{'ContactId':_0x429c32['id'],'ChatWebsiteId':_0x554897,'from':(_0x429c32['firstName']||'')+'\x20'+(_0x429c32[_0x898a('0x37')]||''),'customerIp':_0x3aed01,'customerPort':_0x1575d2[_0x898a('0x38')]?_0x1575d2['x-real-port']:null,'referer':_0x47966e['referer'],'browserName':_0xe84f7e['browser'][_0x898a('0x30')]&&_0xe84f7e[_0x898a('0x39')][_0x898a('0x3a')]?util[_0x898a('0x3b')](_0x898a('0x3c'),_0xe84f7e[_0x898a('0x39')][_0x898a('0x30')],_0xe84f7e[_0x898a('0x39')][_0x898a('0x3a')]):_0x898a('0x3d'),'browserVersion':_0xe84f7e[_0x898a('0x39')][_0x898a('0x3a')]||_0x898a('0x3d'),'osName':util[_0x898a('0x3b')](_0x898a('0x3c'),_0xe84f7e['os']['name'],_0xe84f7e['os'][_0x898a('0x3a')]),'osVersion':_0xe84f7e['os'][_0x898a('0x3a')],'deviceModel':_0xe84f7e[_0x898a('0x3e')]['model']&&_0xe84f7e[_0x898a('0x3e')][_0x898a('0x3f')]?util[_0x898a('0x3b')](_0x898a('0x40'),_0xe84f7e[_0x898a('0x3e')][_0x898a('0x41')],_0xe84f7e[_0x898a('0x3e')][_0x898a('0x3f')],_0xe84f7e['device'][_0x898a('0x42')]):null,'deviceVendor':_0xe84f7e[_0x898a('0x3e')][_0x898a('0x3f')],'deviceType':_0xe84f7e[_0x898a('0x3e')]['type'],'formData':JSON[_0x898a('0x1c')](_0x47966e)};}exports[_0x898a('0x43')]=function(_0x5964df,_0x241677){var _0x4ce00e={'include':[{'model':db['Pause'],'as':_0x898a('0x44')}]},_0x56a40c={},_0x5137c4={'count':0x0,'rows':[]};var _0x49e603=_[_0x898a('0x45')](db[_0x898a('0x46')]['rawAttributes'],function(_0x247347){return{'name':_0x247347[_0x898a('0x47')],'type':_0x247347['type'][_0x898a('0x48')]};});_0x56a40c[_0x898a('0x41')]=_[_0x898a('0x45')](_0x49e603,_0x898a('0x30'));_0x56a40c['query']=_[_0x898a('0x49')](_0x5964df[_0x898a('0x4a')]);_0x56a40c['filters']=_[_0x898a('0x4b')](_0x56a40c[_0x898a('0x41')],_0x56a40c['query']);_0x4ce00e[_0x898a('0x4c')]=_['intersection'](_0x56a40c[_0x898a('0x41')],qs[_0x898a('0x4d')](_0x5964df[_0x898a('0x4a')]['fields']));_0x4ce00e[_0x898a('0x4c')]=_0x4ce00e[_0x898a('0x4c')][_0x898a('0x4e')]?_0x4ce00e[_0x898a('0x4c')]:_0x56a40c['model'];if(!_0x5964df[_0x898a('0x4a')]['hasOwnProperty'](_0x898a('0x4f'))){_0x4ce00e[_0x898a('0x24')]=qs[_0x898a('0x24')](_0x5964df['query'][_0x898a('0x24')]);_0x4ce00e[_0x898a('0x27')]=qs[_0x898a('0x27')](_0x5964df['query']['offset']);}_0x4ce00e[_0x898a('0x50')]=qs[_0x898a('0x51')](_0x5964df[_0x898a('0x4a')][_0x898a('0x51')]);_0x4ce00e[_0x898a('0x52')]=qs[_0x898a('0x53')](_[_0x898a('0x54')](_0x5964df[_0x898a('0x4a')],_0x56a40c[_0x898a('0x53')]),_0x49e603);if(_0x5964df[_0x898a('0x4a')][_0x898a('0x55')]){_0x4ce00e['where']=_[_0x898a('0x56')](_0x4ce00e[_0x898a('0x52')],{'$or':_['map'](_0x49e603,function(_0x36d7aa){if(_0x36d7aa['type']!=='VIRTUAL'){var _0x15f11e={};_0x15f11e[_0x36d7aa[_0x898a('0x30')]]={'$like':'%'+_0x5964df[_0x898a('0x4a')]['filter']+'%'};return _0x15f11e;}})});}_0x4ce00e=_['merge']({},_0x4ce00e,_0x5964df[_0x898a('0x57')]);var _0x1f5e4b={'where':_0x4ce00e['where']};return db[_0x898a('0x46')][_0x898a('0x26')](_0x1f5e4b)['then'](function(_0x299a6d){_0x5137c4[_0x898a('0x26')]=_0x299a6d;if(_0x5964df[_0x898a('0x4a')]['includeAll']){_0x4ce00e[_0x898a('0x58')]=[{'all':!![]}];}return db[_0x898a('0x46')][_0x898a('0x59')](_0x4ce00e);})[_0x898a('0x2e')](function(_0xd37f94){_0x5137c4[_0x898a('0x5a')]=_0xd37f94;return _0x5137c4;})['then'](respondWithFilteredResult(_0x241677,_0x4ce00e))[_0x898a('0x20')](handleError(_0x241677,null));};exports['show']=function(_0x253f51,_0x1dc177){var _0x15b203={'raw':![],'where':{'id':_0x253f51[_0x898a('0x5b')]['id']},'include':[{'model':db[_0x898a('0x5c')],'as':_0x898a('0x44')}]},_0x43780e={};_0x43780e[_0x898a('0x41')]=_[_0x898a('0x49')](db['ChatWebsite'][_0x898a('0x5d')]);_0x43780e[_0x898a('0x4a')]=_[_0x898a('0x49')](_0x253f51[_0x898a('0x4a')]);_0x43780e[_0x898a('0x53')]=_[_0x898a('0x4b')](_0x43780e[_0x898a('0x41')],_0x43780e[_0x898a('0x4a')]);_0x15b203[_0x898a('0x4c')]=_[_0x898a('0x4b')](_0x43780e[_0x898a('0x41')],qs[_0x898a('0x4d')](_0x253f51[_0x898a('0x4a')][_0x898a('0x4d')]));_0x15b203[_0x898a('0x4c')]=_0x15b203['attributes'][_0x898a('0x4e')]?_0x15b203[_0x898a('0x4c')]:_0x43780e['model'];if(_0x253f51[_0x898a('0x4a')][_0x898a('0x5e')]){_0x15b203['include']=[{'all':!![]}];}_0x15b203=_[_0x898a('0x56')]({},_0x15b203,_0x253f51[_0x898a('0x57')]);return db[_0x898a('0x46')][_0x898a('0x5f')](_0x15b203)['then'](handleEntityNotFound(_0x1dc177,null))[_0x898a('0x2e')](respondWithResult(_0x1dc177,null))[_0x898a('0x20')](handleError(_0x1dc177,null));};exports[_0x898a('0x60')]=function(_0xf86633,_0x5b4e60){var _0x285ec9=null;_0xf86633[_0x898a('0x61')]['address'][_0x898a('0x36')](',')[_0x898a('0x62')](_0x5b7019=>{if(_0x5b7019[_0x898a('0x63')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x5b7019[_0x898a('0x63')]())){_0x285ec9=new APIBadRequestError('\x22'+_0x5b7019['trim']()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x285ec9){return handleError(_0x5b4e60,null)(_0x285ec9);}return db['ChatWebsite'][_0x898a('0x60')](_0xf86633[_0x898a('0x61')],{})[_0x898a('0x2e')](function(_0x37c6f6){var _0x5e0535=_0xf86633['user'][_0x898a('0x2b')]({'plain':!![]});if(!_0x5e0535)throw new Error(_0x898a('0x64'));if(_0x5e0535[_0x898a('0x65')]===_0x898a('0x66')){var _0x3d9966=_0x37c6f6[_0x898a('0x2b')]({'plain':!![]});var _0x30051d=_0x898a('0x2c');return db['UserProfileSection'][_0x898a('0x5f')]({'where':{'name':_0x30051d,'userProfileId':_0x5e0535[_0x898a('0x67')]},'raw':!![]})['then'](function(_0x42fda8){if(_0x42fda8&&_0x42fda8[_0x898a('0x68')]===0x0){return db[_0x898a('0x2d')][_0x898a('0x60')]({'name':_0x3d9966[_0x898a('0x30')],'resourceId':_0x3d9966['id'],'type':_0x42fda8[_0x898a('0x30')],'sectionId':_0x42fda8['id']},{})[_0x898a('0x2e')](function(){return _0x37c6f6;});}else{return _0x37c6f6;}})[_0x898a('0x20')](function(_0x16c48d){logger[_0x898a('0x1d')](_0x898a('0x69'),_0x16c48d);throw _0x16c48d;});}return _0x37c6f6;})[_0x898a('0x2e')](respondWithResult(_0x5b4e60,0xc9))[_0x898a('0x20')](handleError(_0x5b4e60,null));};exports['update']=function(_0x2d9a9c,_0x554cb7){var _0x2be3a8=null;_0x2d9a9c[_0x898a('0x61')][_0x898a('0x6a')]['split'](',')[_0x898a('0x62')](_0x3f0d9f=>{if(_0x3f0d9f[_0x898a('0x63')]()!==''&&!wildcardUtils[_0x898a('0x6b')](_0x3f0d9f[_0x898a('0x63')]())){_0x2be3a8=new APIBadRequestError('\x22'+_0x3f0d9f['trim']()+_0x898a('0x6c'));}});if(_0x2be3a8){return handleError(_0x554cb7,null)(_0x2be3a8);}if(_0x2d9a9c[_0x898a('0x61')]['id']){delete _0x2d9a9c[_0x898a('0x61')]['id'];}return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0x2d9a9c['params']['id']},'include':[{'model':db[_0x898a('0x5c')],'as':_0x898a('0x44')}]})[_0x898a('0x2e')](handleEntityNotFound(_0x554cb7,null))[_0x898a('0x2e')](saveUpdates(_0x2d9a9c[_0x898a('0x61')],null))[_0x898a('0x2e')](respondWithResult(_0x554cb7,null))[_0x898a('0x20')](handleError(_0x554cb7,null));};exports[_0x898a('0x2a')]=function(_0x51836c,_0x32a207){return db[_0x898a('0x46')]['find']({'where':{'id':_0x51836c[_0x898a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x32a207,null))[_0x898a('0x2e')](removeEntity(_0x32a207,null))['catch'](handleError(_0x32a207,null));};exports[_0x898a('0x6d')]=function(_0x387f2c,_0x3b07dc){return db[_0x898a('0x46')][_0x898a('0x6d')]()[_0x898a('0x2e')](respondWithResult(_0x3b07dc,null))[_0x898a('0x20')](handleError(_0x3b07dc,null));};exports[_0x898a('0x6e')]=function(_0x1f46b5,_0x59073f){if(_0x1f46b5[_0x898a('0x61')]['id']){delete _0x1f46b5[_0x898a('0x61')]['id'];}return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0x1f46b5[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x59073f,null))[_0x898a('0x2e')](function(_0x4bcf85){if(_0x4bcf85){_0x1f46b5[_0x898a('0x61')][_0x898a('0x6f')]=_0x4bcf85['id'];return db['Disposition']['create'](_0x1f46b5[_0x898a('0x61')]);}})[_0x898a('0x2e')](respondWithResult(_0x59073f,null))['catch'](handleError(_0x59073f,null));};exports['getDispositions']=function(_0x34e1f2,_0x4a79a4){var _0x2fdeb5={'raw':![],'where':{}};var _0x41077f={};var _0x5dbe6c={'count':0x0,'rows':[]};return db[_0x898a('0x46')][_0x898a('0x70')]({'where':{'id':_0x34e1f2[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x4a79a4,null))[_0x898a('0x2e')](function(_0x2d047a){if(_0x2d047a){_0x41077f[_0x898a('0x41')]=_['keys'](db[_0x898a('0x71')][_0x898a('0x5d')]);_0x41077f[_0x898a('0x4a')]=_['keys'](_0x34e1f2[_0x898a('0x4a')]);_0x41077f[_0x898a('0x53')]=_['intersection'](_0x41077f[_0x898a('0x41')],_0x41077f['query']);_0x2fdeb5['attributes']=_['intersection'](_0x41077f[_0x898a('0x41')],qs[_0x898a('0x4d')](_0x34e1f2[_0x898a('0x4a')][_0x898a('0x4d')]));_0x2fdeb5[_0x898a('0x4c')]=_0x2fdeb5[_0x898a('0x4c')][_0x898a('0x4e')]?_0x2fdeb5['attributes']:_0x41077f[_0x898a('0x41')];if(!_0x34e1f2['query'][_0x898a('0x72')](_0x898a('0x4f'))){_0x2fdeb5['limit']=qs[_0x898a('0x24')](_0x34e1f2[_0x898a('0x4a')][_0x898a('0x24')]);_0x2fdeb5[_0x898a('0x27')]=qs[_0x898a('0x27')](_0x34e1f2['query']['offset']);}_0x2fdeb5['order']=qs[_0x898a('0x51')](_0x34e1f2[_0x898a('0x4a')][_0x898a('0x51')]);_0x2fdeb5['where']=qs[_0x898a('0x53')](_['pick'](_0x34e1f2['query'],_0x41077f[_0x898a('0x53')]));_0x2fdeb5[_0x898a('0x52')][_0x898a('0x6f')]=_0x2d047a['id'];if(_0x34e1f2[_0x898a('0x4a')][_0x898a('0x55')]){_0x2fdeb5[_0x898a('0x52')]=_[_0x898a('0x56')](_0x2fdeb5[_0x898a('0x52')],{'$or':_[_0x898a('0x45')](_0x2fdeb5[_0x898a('0x4c')],function(_0x5ce499){var _0x122682={};_0x122682[_0x5ce499]={'$like':'%'+_0x34e1f2[_0x898a('0x4a')][_0x898a('0x55')]+'%'};return _0x122682;})});}_0x2fdeb5=_[_0x898a('0x56')]({},_0x2fdeb5,_0x34e1f2[_0x898a('0x57')]);return db['Disposition'][_0x898a('0x26')]({'where':_0x2fdeb5[_0x898a('0x52')]})[_0x898a('0x2e')](function(_0xc187e7){_0x5dbe6c[_0x898a('0x26')]=_0xc187e7;if(_0x34e1f2[_0x898a('0x4a')][_0x898a('0x5e')]){_0x2fdeb5[_0x898a('0x58')]=[{'all':!![]}];}return db[_0x898a('0x71')][_0x898a('0x59')](_0x2fdeb5);})[_0x898a('0x2e')](function(_0x381071){_0x5dbe6c['rows']=_0x381071;return _0x5dbe6c;});}})[_0x898a('0x2e')](respondWithFilteredResult(_0x4a79a4,_0x2fdeb5))['catch'](handleError(_0x4a79a4,null));};exports[_0x898a('0x73')]=function(_0x34e463,_0xc510c0){return db['ChatWebsite'][_0x898a('0x5f')]({'where':{'id':_0x34e463[_0x898a('0x5b')]['id']}})['then'](handleEntityNotFound(_0xc510c0,null))[_0x898a('0x2e')](function(_0x3ebb81){if(_0x3ebb81){return _0x3ebb81[_0x898a('0x73')](_0x34e463[_0x898a('0x4a')][_0x898a('0x74')]);}})[_0x898a('0x2e')](respondWithStatusCode(_0xc510c0,null))['catch'](handleError(_0xc510c0,null));};exports['addAnswer']=function(_0x19b6f4,_0x4b7334){if(_0x19b6f4[_0x898a('0x61')]['id']){delete _0x19b6f4[_0x898a('0x61')]['id'];}return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0x19b6f4[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x4b7334,null))['then'](function(_0x4d7431){if(_0x4d7431){_0x19b6f4[_0x898a('0x61')]['ChatWebsiteId']=_0x4d7431['id'];return db[_0x898a('0x75')][_0x898a('0x60')](_0x19b6f4['body']);}})[_0x898a('0x2e')](respondWithResult(_0x4b7334,null))['catch'](handleError(_0x4b7334,null));};exports[_0x898a('0x76')]=function(_0xc8763f,_0xed8829){var _0x5ef14d={'raw':![],'where':{}};var _0x546c80={};var _0x541241={'count':0x0,'rows':[]};return db[_0x898a('0x46')][_0x898a('0x70')]({'where':{'id':_0xc8763f[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0xed8829,null))[_0x898a('0x2e')](function(_0x1c989f){if(_0x1c989f){_0x546c80['model']=_[_0x898a('0x49')](db[_0x898a('0x75')]['rawAttributes']);_0x546c80['query']=_[_0x898a('0x49')](_0xc8763f[_0x898a('0x4a')]);_0x546c80['filters']=_[_0x898a('0x4b')](_0x546c80['model'],_0x546c80[_0x898a('0x4a')]);_0x5ef14d[_0x898a('0x4c')]=_[_0x898a('0x4b')](_0x546c80[_0x898a('0x41')],qs[_0x898a('0x4d')](_0xc8763f[_0x898a('0x4a')][_0x898a('0x4d')]));_0x5ef14d[_0x898a('0x4c')]=_0x5ef14d[_0x898a('0x4c')][_0x898a('0x4e')]?_0x5ef14d[_0x898a('0x4c')]:_0x546c80[_0x898a('0x41')];if(!_0xc8763f[_0x898a('0x4a')][_0x898a('0x72')](_0x898a('0x4f'))){_0x5ef14d['limit']=qs['limit'](_0xc8763f['query'][_0x898a('0x24')]);_0x5ef14d['offset']=qs[_0x898a('0x27')](_0xc8763f[_0x898a('0x4a')][_0x898a('0x27')]);}_0x5ef14d[_0x898a('0x50')]=qs[_0x898a('0x51')](_0xc8763f[_0x898a('0x4a')][_0x898a('0x51')]);_0x5ef14d[_0x898a('0x52')]=qs['filters'](_[_0x898a('0x54')](_0xc8763f['query'],_0x546c80['filters']));_0x5ef14d['where'][_0x898a('0x6f')]=_0x1c989f['id'];if(_0xc8763f['query'][_0x898a('0x55')]){_0x5ef14d[_0x898a('0x52')]=_[_0x898a('0x56')](_0x5ef14d['where'],{'$or':_['map'](_0x5ef14d[_0x898a('0x4c')],function(_0x2f3d65){var _0x3a1bc5={};_0x3a1bc5[_0x2f3d65]={'$like':'%'+_0xc8763f[_0x898a('0x4a')][_0x898a('0x55')]+'%'};return _0x3a1bc5;})});}_0x5ef14d=_[_0x898a('0x56')]({},_0x5ef14d,_0xc8763f[_0x898a('0x57')]);return db[_0x898a('0x75')][_0x898a('0x26')]({'where':_0x5ef14d['where']})[_0x898a('0x2e')](function(_0x21a4f6){_0x541241['count']=_0x21a4f6;if(_0xc8763f[_0x898a('0x4a')][_0x898a('0x5e')]){_0x5ef14d[_0x898a('0x58')]=[{'all':!![]}];}return db[_0x898a('0x75')][_0x898a('0x59')](_0x5ef14d);})['then'](function(_0xe3fea){_0x541241[_0x898a('0x5a')]=_0xe3fea;return _0x541241;});}})[_0x898a('0x2e')](respondWithFilteredResult(_0xed8829,_0x5ef14d))[_0x898a('0x20')](handleError(_0xed8829,null));};exports['removeAnswers']=function(_0x58f08e,_0x2724e1){return db['ChatWebsite'][_0x898a('0x5f')]({'where':{'id':_0x58f08e[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x2724e1,null))[_0x898a('0x2e')](function(_0x32cbfa){if(_0x32cbfa){return _0x32cbfa[_0x898a('0x77')](_0x58f08e[_0x898a('0x4a')]['ids']);}})[_0x898a('0x2e')](respondWithStatusCode(_0x2724e1,null))['catch'](handleError(_0x2724e1,null));};exports[_0x898a('0x78')]=function(_0x110a2d,_0x5b8504){_0x110a2d[_0x898a('0x61')][_0x898a('0x79')]=_0x110a2d[_0x898a('0x7a')][_0x898a('0x7b')];return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0x110a2d[_0x898a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5b8504,null))[_0x898a('0x2e')](saveUpdates(_0x110a2d[_0x898a('0x61')],null))[_0x898a('0x2e')](respondWithResult(_0x5b8504,null))[_0x898a('0x20')](handleError(_0x5b8504,null));};exports[_0x898a('0x7c')]=function(_0x171691,_0x1259f0){_0x171691['body'][_0x898a('0x7d')]=_0x171691[_0x898a('0x7a')]['filename'];return db['ChatWebsite'][_0x898a('0x5f')]({'where':{'id':_0x171691['params']['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x1259f0,null))[_0x898a('0x2e')](saveUpdates(_0x171691[_0x898a('0x61')],null))['then'](respondWithResult(_0x1259f0,null))[_0x898a('0x20')](handleError(_0x1259f0,null));};exports[_0x898a('0x7e')]=function(_0xdef811,_0x1777a9){_0xdef811[_0x898a('0x61')][_0x898a('0x7f')]=_0xdef811[_0x898a('0x7a')][_0x898a('0x7b')];return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0xdef811['params']['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x1777a9,null))[_0x898a('0x2e')](saveUpdates(_0xdef811[_0x898a('0x61')],null))[_0x898a('0x2e')](respondWithResult(_0x1777a9,null))[_0x898a('0x20')](handleError(_0x1777a9,null));};exports[_0x898a('0x80')]=function(_0x31b0d8,_0x4863aa){_0x31b0d8['body'][_0x898a('0x81')]=_0x31b0d8[_0x898a('0x7a')]['filename'];return db[_0x898a('0x46')]['find']({'where':{'id':_0x31b0d8[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x4863aa,null))['then'](saveUpdates(_0x31b0d8[_0x898a('0x61')],null))[_0x898a('0x2e')](respondWithResult(_0x4863aa,null))[_0x898a('0x20')](handleError(_0x4863aa,null));};exports['getLogo']=function(_0x5b7790,_0x5a0689){var _0x1cabde=path[_0x898a('0x82')](config['root'],_0x898a('0x83'));var _0x4a9c3b={'where':{'id':_0x5b7790[_0x898a('0x5b')]['id']},'attributes':['id',_0x898a('0x79')],'raw':!![]};var _0x210ce7=![];return require(_0x898a('0x84'))[_0x898a('0x85')]()[_0x898a('0x2e')](function(_0x389fda){if(_0x389fda){_0x210ce7=_0x389fda[_0x898a('0x86')];}})[_0x898a('0x2e')](function(){return db[_0x898a('0x46')][_0x898a('0x5f')](_0x4a9c3b);})[_0x898a('0x2e')](handleEntityNotFound(_0x5a0689,null))[_0x898a('0x2e')](function(_0x5e76f2){if(_0x5e76f2){if(!_['isNil'](_0x5e76f2[_0x898a('0x79')])){if(fs[_0x898a('0x87')](path[_0x898a('0x82')](config[_0x898a('0x88')],_0x898a('0x89'),_0x5e76f2[_0x898a('0x79')]))&&_0x210ce7){_0x1cabde=path[_0x898a('0x82')](config['root'],_0x898a('0x89'),_0x5e76f2[_0x898a('0x79')]);}}return _0x5a0689[_0x898a('0x8a')](_0x1cabde);}})[_0x898a('0x20')](handleError(_0x5a0689,null));};exports['getAvatar']=function(_0x41b9e1,_0x1cbc52){var _0xbadb62=path[_0x898a('0x82')](config['root'],_0x898a('0x8b'));var _0xba9062={'where':{'id':_0x41b9e1[_0x898a('0x5b')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0xba9062)[_0x898a('0x2e')](handleEntityNotFound(_0x1cbc52,null))['then'](function(_0x40b532){if(_0x40b532){if(!_[_0x898a('0x8c')](_0x40b532[_0x898a('0x7d')])){if(fs[_0x898a('0x87')](path[_0x898a('0x82')](config['root'],_0x898a('0x8d'),_0x40b532[_0x898a('0x7d')]))){_0xbadb62=path[_0x898a('0x82')](config[_0x898a('0x88')],_0x898a('0x8d'),_0x40b532[_0x898a('0x7d')]);}}return _0x1cbc52[_0x898a('0x8a')](_0xbadb62);}})[_0x898a('0x20')](handleError(_0x1cbc52,null));};exports['getCustomerAvatar']=function(_0x2f1a65,_0x167a4d){var _0x2614e7=path[_0x898a('0x82')](config[_0x898a('0x88')],_0x898a('0x8e'));var _0x1779db={'where':{'id':_0x2f1a65[_0x898a('0x5b')]['id']},'attributes':['id',_0x898a('0x7f'),_0x898a('0x8f')],'raw':!![]};return db['ChatWebsite']['find'](_0x1779db)['then'](handleEntityNotFound(_0x167a4d,null))[_0x898a('0x2e')](function(_0x380ae7){if(_0x380ae7){if(!_[_0x898a('0x8c')](_0x380ae7[_0x898a('0x7f')])){if(fs[_0x898a('0x87')](path['join'](config[_0x898a('0x88')],_0x898a('0x8d'),_0x380ae7[_0x898a('0x7f')]))&&_0x380ae7[_0x898a('0x8f')]){_0x2614e7=path['join'](config[_0x898a('0x88')],_0x898a('0x8d'),_0x380ae7[_0x898a('0x7f')]);}}return _0x167a4d[_0x898a('0x8a')](_0x2614e7);}})[_0x898a('0x20')](handleError(_0x167a4d,null));};exports['getSystemAvatar']=function(_0x199a17,_0x4a862e){var _0x5367d5=path[_0x898a('0x82')](config['root'],_0x898a('0x90'));var _0x3359c1={'where':{'id':_0x199a17[_0x898a('0x5b')]['id']},'attributes':['id',_0x898a('0x81')],'raw':!![]};return db[_0x898a('0x46')][_0x898a('0x5f')](_0x3359c1)[_0x898a('0x2e')](handleEntityNotFound(_0x4a862e,null))[_0x898a('0x2e')](function(_0xa1c4a2){if(_0xa1c4a2){if(!_[_0x898a('0x8c')](_0xa1c4a2[_0x898a('0x81')])){if(fs[_0x898a('0x87')](path[_0x898a('0x82')](config['root'],_0x898a('0x8d'),_0xa1c4a2['systemAvatar']))){_0x5367d5=path[_0x898a('0x82')](config[_0x898a('0x88')],'server/files/images/avatars/',_0xa1c4a2[_0x898a('0x81')]);}}return _0x4a862e['download'](_0x5367d5);}})[_0x898a('0x20')](handleError(_0x4a862e,null));};function checkWebsiteInterval(_0x8054b){var _0x5aa358=_0x8054b[_0x898a('0x91')];if(!_0x5aa358){return Promise[_0x898a('0x92')](_0x8054b);}var _0x877820=_0x8054b[_0x898a('0x93')]||undefined;return _0x5aa358[_0x898a('0x94')](_0x877820)['then'](function(_0x285f0e){if(!_0x285f0e){throw new APIOutOfIntervalError();}return _0x8054b;});}exports[_0x898a('0x95')]=function(_0x4e759e,_0x4f1ff1){var _0xb64850={'body':_0x4e759e[_0x898a('0x61')],'channel':'chat'};var _0x51c0c2=[];var _0x1bfbc3=[];var _0x4de42c={};var _0xb1d9c4=![];if(_0x4e759e['body']['id']){delete _0x4e759e[_0x898a('0x61')]['id'];}if(_['isNil'](_0x4e759e['body'][_0x898a('0x96')])){throw new APIBadRequestError(_0x898a('0x97'));}if(_[_0x898a('0x8c')](_0x4e759e[_0x898a('0x61')][_0x898a('0x98')])){throw new APIBadRequestError(_0x898a('0x99'));}if(_[_0x898a('0x9a')](_0x4e759e[_0x898a('0x61')][_0x898a('0x61')])){throw new APIBadRequestError(_0x898a('0x9b'));}var _0x2dd49c=_0x4e759e['body'][_0x898a('0x33')]&&_0x4e759e[_0x898a('0x61')][_0x898a('0x9c')];return db[_0x898a('0x9d')]['describe']()['then'](function(_0x3522d2){if(!_0x3522d2){throw new Error(_0x898a('0x9e'));}_0x51c0c2=Object[_0x898a('0x49')](_0x3522d2)['filter'](function(_0x3f622a){return![_0x898a('0x9f'),_0x898a('0xa0')][_0x898a('0xa1')](_0x3f622a);});_0x1bfbc3=Object[_0x898a('0x49')](_0x3522d2)[_0x898a('0x55')](function(_0x54de91){return![_0x898a('0x9f'),_0x898a('0xa0'),_0x898a('0xa2'),_0x898a('0xa3')][_0x898a('0xa1')](_0x54de91);});if(!_[_0x898a('0xa1')](_0x1bfbc3,_0x4e759e['body'][_0x898a('0x98')])){throw new APIBadRequestError(_0x898a('0xa4')+_0x1bfbc3[_0x898a('0x82')](',\x20'));}_0x4de42c[_0x4e759e[_0x898a('0x61')]['mapKey']]=_0x4e759e[_0x898a('0x61')][_0x898a('0x96')];})[_0x898a('0x2e')](function(){return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0x4e759e['params']['id']},'include':[{'model':db[_0x898a('0xa5')],'as':'List','include':[{'model':db[_0x898a('0x9d')],'as':_0x898a('0xa6'),'where':_0x4de42c,'limit':0x1,'order':[[_0x898a('0xa0'),'DESC']]}]},{'model':db[_0x898a('0xa7')],'as':'Applications'},{'model':db[_0x898a('0x91')],'as':_0x898a('0x91'),'include':[{'model':db[_0x898a('0x91')],'as':'Intervals','attributes':['id',_0x898a('0xa8')],'raw':!![]}]}]});})[_0x898a('0x2e')](function(_0x5a5762){if(!_0x5a5762){throw new APINotFoundError(util['format']('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x4e759e[_0x898a('0x5b')]['id']));}if(_0x2dd49c){return checkWebsiteInterval(_0x5a5762);}return _0x5a5762;})[_0x898a('0x2e')](function(_0x4e5adf){_0xb64850[_0x898a('0xa9')]=_0x4e5adf;_0xb64850[_0x898a('0xaa')]=_[_0x898a('0xab')](_0x4e5adf[_0x898a('0xac')],[_0x898a('0xad')],[_0x898a('0xae')]);if(_0xb64850['account']['Applications']){delete _0xb64850[_0x898a('0xa9')][_0x898a('0xac')];}_0xb64850[_0x898a('0xaf')]=_0x4e5adf[_0x898a('0xb0')]||{'id':_0x4e5adf[_0x898a('0xa3')]};if(_0xb64850[_0x898a('0xaf')]&&_0xb64850[_0x898a('0xaf')][_0x898a('0xa6')][_0x898a('0x4e')]){return _0xb64850[_0x898a('0xaf')][_0x898a('0xa6')][0x0];}var _0x271a04=_[_0x898a('0xb1')](_0x4e759e['body'],{'firstName':_0x4e759e[_0x898a('0x61')]['from'],'ListId':_0x4e5adf[_0x898a('0xa3')]});_0x271a04[_0x4e759e[_0x898a('0x61')]['mapKey']]=_0x4e759e[_0x898a('0x61')][_0x898a('0x96')];return db['CmContact']['create'](_0x271a04,{'fields':_0x51c0c2,'raw':!![]});})[_0x898a('0x2e')](function(_0x4a791f){_0xb64850['contact']=_0x4a791f;var _0x2e0593=createInteractionObject(_0x4e759e[_0x898a('0x5b')]['id'],_0x4e759e[_0x898a('0x61')],_0x4e759e['headers'],_0x4a791f);var _0x2f675e={'ChatWebsiteId':_0x4e759e[_0x898a('0x5b')]['id']};if(_0x4e759e[_0x898a('0x61')][_0x898a('0xb2')]){_0x2f675e[_0x898a('0xb2')]=_0x4e759e['body'][_0x898a('0xb2')];_0x2f675e[_0x898a('0xb3')]=![];return db[_0x898a('0xb4')][_0x898a('0x5f')]({'where':_0x2f675e})[_0x898a('0x2e')](function(_0x539518){var _0x3bd71e=_0x4e759e[_0x898a('0x61')][_0x898a('0x33')]&&_0x4e759e[_0x898a('0x61')][_0x898a('0x9c')];if(_0x539518){_0xb1d9c4=!![];return _0x539518;}else if(!_0x3bd71e&&_0x539518&&_0x539518[_0x898a('0xb3')]){throw new APIConflictError(_0x898a('0xb5'));}_0x2e0593[_0x898a('0xb2')]=_0x4e759e[_0x898a('0x61')][_0x898a('0xb2')];_0x2e0593[_0x898a('0xb6')]=_0x4e759e['body'][_0x898a('0xb6')];return db[_0x898a('0xb4')][_0x898a('0x60')](_0x2e0593);});}_0x2f675e[_0x898a('0xb7')]=_0x4a791f['id'];if(_0x4e759e[_0x898a('0x61')][_0x898a('0xb8')]&&_0x4e759e[_0x898a('0x61')]['interaction']['id']){_0x2f675e['id']=_0x4e759e[_0x898a('0x61')]['interaction']['id'];return db[_0x898a('0xb4')][_0x898a('0x5f')]({'where':_0x2f675e})[_0x898a('0x2e')](function(_0x5acc72){var _0x55b9ca=_0x4e759e[_0x898a('0x61')][_0x898a('0x33')]&&_0x4e759e[_0x898a('0x61')][_0x898a('0x9c')];if(!_0x55b9ca&&_0x5acc72&&_0x5acc72[_0x898a('0xb3')]){throw new APIConflictError(_0x898a('0xb5'));}else if(_0x5acc72){_0xb1d9c4=!![];return _0x5acc72;}else{return db[_0x898a('0xb4')][_0x898a('0x60')](_0x2e0593);}});}return db['ChatInteraction'][_0x898a('0x60')](_0x2e0593);})[_0x898a('0x2e')](function(_0x390503){if(!_0xb1d9c4){return _0x390503;}var _0x237a1c={'from':(_0xb64850['contact']['firstName']||'')+'\x20'+(_0xb64850[_0x898a('0xb9')][_0x898a('0x37')]||'')};if(_0x4e759e[_0x898a('0x61')]['threadId']&&_0x4e759e[_0x898a('0x61')]['messageId']&&_0x4e759e[_0x898a('0x61')][_0x898a('0xb2')]!=_0x4e759e[_0x898a('0x61')][_0x898a('0xba')]){_0x237a1c[_0x898a('0xb2')]=_0x4e759e[_0x898a('0x61')]['messageId'];}return _0x390503[_0x898a('0x29')](_0x237a1c);})[_0x898a('0x2e')](function(_0x1d6dff){_0xb64850['interaction']=_0x1d6dff['get']({'plain':!![]});_0xb64850[_0x898a('0xb8')]['created']=!_0xb1d9c4;if(_0xb64850[_0x898a('0xb8')][_0x898a('0xbb')]){if(_0xb64850[_0x898a('0xa9')][_0x898a('0xbc')]){_0xb64850[_0x898a('0xaa')]['push']({'id':0x0,'priority':_0xb64850[_0x898a('0xaa')][_0x898a('0x4e')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x898a('0xbd')});}}return db[_0x898a('0xbe')][_0x898a('0x60')]({'body':_0x4e759e[_0x898a('0x61')][_0x898a('0x61')],'ChatWebsiteId':_0x4e759e['params']['id'],'ChatInteractionId':_0x1d6dff['id'],'direction':'in','ContactId':_0xb64850[_0x898a('0xb9')]['id'],'AttachmentId':_0x4e759e[_0x898a('0x61')][_0x898a('0xbf')]});})[_0x898a('0x2e')](function(_0x4b0c1b){_0xb64850[_0x898a('0x1e')]=_0x4b0c1b;if(!_0xb64850[_0x898a('0xb8')][_0x898a('0xc0')]){return;}return db[_0x898a('0xc1')][_0x898a('0x5f')]({'attributes':['id','name'],'where':{'id':_0xb64850['interaction'][_0x898a('0xc0')]}});})[_0x898a('0x2e')](function(_0x24366d){if(_0x24366d){_0xb64850[_0x898a('0xaa')][_0x898a('0xc2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x24366d[_0x898a('0x30')]+','+(_0xb64850[_0x898a('0xa9')][_0x898a('0xc3')]||0xa),'interval':_0x898a('0xbd')});_0xb64850[_0x898a('0xc4')]=!![];}if(!_0xb64850[_0x898a('0xb8')][_0x898a('0xc5')]){return;}return db[_0x898a('0xc6')][_0x898a('0x5f')]({'attributes':['id',_0x898a('0x30')],'where':{'id':_0xb64850[_0x898a('0xb8')][_0x898a('0xc5')]}});})[_0x898a('0x2e')](function(_0x46f2c5){if(_0x46f2c5){_0xb64850['applications'][_0x898a('0xc2')]({'id':0x0,'priority':0x1,'app':_0x898a('0xc7'),'appdata':_0x46f2c5[_0x898a('0x30')]+','+(_0xb64850[_0x898a('0xa9')][_0x898a('0xc8')]||0x12c),'interval':_0x898a('0xbd')});}return respondWithRpcPromise(_0x898a('0xc9'),_0x898a('0xca'),_0xb64850);})['then'](function(_0x2ca7ee){respondWithRpcPromise(_0x898a('0xcb'),_0x898a('0xcb'),{'event':'notify','message':_0x2ca7ee},client9002);return _0x2ca7ee;})[_0x898a('0x2e')](respondWithResult(_0x4f1ff1,null))[_0x898a('0x20')](APIHandleError(_0x4f1ff1));};exports['offline']=function(_0xf8a823,_0x3dc746){var _0x3ed2bf,_0x1def1b,_0x2ffba3;var _0x12ff13=[];var _0x2314a2={};var _0x2c5037=_0xf8a823[_0x898a('0xcc')]||[];var _0x57f3e1=[];var _0x230030;return db[_0x898a('0x9d')][_0x898a('0x6d')]()[_0x898a('0x2e')](function(_0x9a3e8c){if(!_0x9a3e8c){throw new db[(_0x898a('0xcd'))]['ValidationError'](_0x898a('0xce'));}_0x12ff13=_[_0x898a('0xcf')](_[_0x898a('0x49')](_0x9a3e8c),[_0x898a('0x9f'),_0x898a('0xa0'),_0x898a('0xa2'),'ListId']);if(_0xf8a823[_0x898a('0x61')]['id']){delete _0xf8a823[_0x898a('0x61')]['id'];}if(_[_0x898a('0x8c')](_0xf8a823[_0x898a('0x61')][_0x898a('0x96')])){throw _0x3dc746['status'](0x1f4)['send'](new db['Sequelize'][(_0x898a('0xd0'))]('from\x20is\x20mandatory'));}if(_[_0x898a('0x8c')](_0xf8a823[_0x898a('0x61')][_0x898a('0x61')])||_0xf8a823[_0x898a('0x61')][_0x898a('0x61')]===''){throw _0x3dc746[_0x898a('0x22')](0x1f4)[_0x898a('0xd1')](new db[(_0x898a('0xcd'))][(_0x898a('0xd0'))](_0x898a('0xd2')));}if(_[_0x898a('0x8c')](_0xf8a823[_0x898a('0x61')][_0x898a('0xd3')])){throw _0x3dc746['status'](0x1f4)[_0x898a('0xd1')](new db[(_0x898a('0xcd'))]['ValidationError'](_0x898a('0xd4')+_0x12ff13));}if(!_[_0x898a('0xa1')](_0x12ff13,_0xf8a823[_0x898a('0x61')][_0x898a('0xd3')])){throw _0x3dc746[_0x898a('0x22')](0x1f4)[_0x898a('0xd1')](new db[(_0x898a('0xcd'))][(_0x898a('0xd0'))](_0x898a('0xd5')+_0x12ff13));}_0x2314a2[_0xf8a823['body'][_0x898a('0xd3')]]=_0xf8a823[_0x898a('0x61')][_0x898a('0x96')];})[_0x898a('0x2e')](function(){return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0xf8a823[_0x898a('0x5b')]['id']},'include':[{'model':db[_0x898a('0xa5')],'as':_0x898a('0xb0')},{'model':db[_0x898a('0xd6')],'as':_0x898a('0xd6')}]});})[_0x898a('0x2e')](handleEntityNotFound(_0x3dc746,null))[_0x898a('0x2e')](function(_0x3549f6){if(_0x3549f6&&_0x3549f6[_0x898a('0xb0')]){_0x1def1b=_0x3549f6;var _0x95287e=_[_0x898a('0xb1')](_0xf8a823['body'],{'firstName':_0xf8a823['body']['from'],'phone':_0xf8a823[_0x898a('0x61')][_0x898a('0x96')],'ListId':_0x3549f6[_0x898a('0xa3')]});_0x95287e[_0xf8a823[_0x898a('0x61')]['mapKeyOffline']]=_0xf8a823['body'][_0x898a('0x96')];return db[_0x898a('0x9d')][_0x898a('0xd7')]({'where':_0x2314a2,'defaults':_0x95287e});}})[_0x898a('0xd8')](function(_0xaa3b87){if(_0xaa3b87){_0x2ffba3=_0xaa3b87;var _0x1b4b54=fs['readFileSync'](path[_0x898a('0x82')](config['root'],_0x898a('0xd9')),'utf8');var _0x4d1b8b=ejs[_0x898a('0xda')](_0x1b4b54,{'body':_['toPairs'](_0xf8a823[_0x898a('0x61')][_0x898a('0x61')]),'bodyTitle':_0x1def1b[_0x898a('0xdb')]});return db[_0x898a('0xdc')][_0x898a('0x60')]({'body':_0x4d1b8b,'plainBody':htmlToText[_0x898a('0xdd')](_0x4d1b8b),'ContactId':_0xaa3b87['id'],'ChatWebsiteId':_0x1def1b['id']});}})[_0x898a('0x2e')](function(_0x3da4a5){_0x230030=_0x3da4a5;if(_0x2c5037['length']){var _0x194181=_0x2c5037['map'](function(_0x15663d){return{'name':_0x15663d[_0x898a('0xde')],'basename':_0x15663d[_0x898a('0x7b')],'type':_0x15663d[_0x898a('0xdf')],'ChatOfflineMessageId':_0x3da4a5['id']};});_0x57f3e1=_0x194181[_0x898a('0x45')](_0x4da5c9=>{var _0x2ae8b6={'filename':_0x4da5c9[_0x898a('0x30')],'path':path[_0x898a('0x82')](config[_0x898a('0x88')],_0x898a('0xe0'),'files',_0x898a('0xe1'),'offline-chat',_0x4da5c9['basename'])};return _0x2ae8b6;});if(!_0x1def1b[_0x898a('0xe2')]){return db[_0x898a('0xe3')][_0x898a('0xe4')](function(_0x3ab9b6){return db[_0x898a('0xe5')][_0x898a('0xe6')](_0x194181,{'transaction':_0x3ab9b6});});}}})[_0x898a('0x2e')](function(){if(_0x230030){_0x3ed2bf=_0x230030;return db[_0x898a('0xd6')][_0x898a('0x70')]({'where':{'service':!![]},'include':[{'model':db[_0x898a('0xe7')],'as':_0x898a('0xe8'),'raw':!![],'include':[{'model':db[_0x898a('0xe9')],'as':_0x898a('0xe9'),'raw':!![]}]}]});}})['then'](function(_0x4b2f30){if(_0x4b2f30&&_0x4b2f30[_0x898a('0xe8')]&&_0x1def1b['forwardOffline']&&_0x1def1b[_0x898a('0xea')]){var _0x216e76=_0x4b2f30['getSmtpOptions']();return respondWithRpcPromise(_0x898a('0xeb'),_0x898a('0xec'),{'account':_0x216e76,'message':{'from':util[_0x898a('0x3b')](_0x898a('0xed'),_0x4b2f30[_0x898a('0x30')],_0x4b2f30['email']||_0x4b2f30[_0x898a('0xe8')][_0x898a('0x66')]),'to':_0x1def1b[_0x898a('0xea')],'subject':_0x1def1b[_0x898a('0xee')],'html':_0x3ed2bf[_0x898a('0x61')],'attachments':_0x57f3e1}},client9003)[_0x898a('0x2e')](function(){return _0x3ed2bf;})[_0x898a('0x20')](function(_0x179513){logger[_0x898a('0x1d')](_0x179513);});}})[_0x898a('0x2e')](function(){if(_0x1def1b&&_0x1def1b[_0x898a('0xe2')]&&_0x1def1b[_0x898a('0xef')]){var _0x3d85b2=[];if(_0x2c5037[_0x898a('0x4e')]){_0x3d85b2=_0x2c5037[_0x898a('0x45')](function(_0x3065a2){return{'name':_0x3065a2[_0x898a('0xde')],'basename':_0x3065a2[_0x898a('0x7b')],'type':_0x3065a2['mimetype'],'ChatOfflineMessageId':_0x230030['id']};});}var _0x4dd1aa;if(!_[_0x898a('0x8c')](_0x1def1b['subjectOffline'])){var _0x46696c=_[_0x898a('0x45')](_0xf8a823[_0x898a('0x61')],function(_0x1fefd0){return _0x1fefd0;});var _0x244b0e=_['toPairsIn'](_0x46696c)[0x0];var _0x2ba5f8=_['mapValues'](_0x244b0e,function(_0x3c46d2){return _0x3c46d2;});_0x4dd1aa=_0x2ba5f8[0x1][_0x1def1b['subjectOffline']];}var _0x44f4c3={'from':_0x2ffba3[_0x898a('0xf0')],'firstName':_0x2ffba3[_0x898a('0xf1')],'lastName':_0x2ffba3[_0x898a('0x37')],'mapKey':_0x898a('0xf0'),'message':{'from':_0x2ffba3[_0x898a('0xf0')],'to':_0x1def1b['MailAccount'][_0x898a('0xf0')],'cc':'','subject':_['isNil'](_0x4dd1aa)?_0x1def1b['offlineMessageSubject']:_0x4dd1aa,'messageId':'','sentAt':new Date(),'attach':_0x3d85b2[_0x898a('0x4e')],'attachments':_0x3d85b2,'originChannel':_0x898a('0xf2'),'ChatWebsiteId':_0x1def1b['id'],'ChatOfflineMessageId':_0x3ed2bf['id'],'originTo':_0x1def1b['MailAccount'][_0x898a('0xf0')]},'body':_0x3ed2bf[_0x898a('0x61')]};var _0x4663fe={'account':{'id':_0x1def1b[_0x898a('0xef')]},'body':_0x44f4c3,'log':_0x898a('0xf3')};return respondWithRpcPromise('NotifyMailAccount',_0x898a('0xf4'),_0x4663fe,client9001)[_0x898a('0x2e')](function(){return _0x3ed2bf;})[_0x898a('0x20')](function(_0x456365){logger['error'](_0x456365);});}return;})[_0x898a('0x2e')](function(){if(_0x3ed2bf){return _0x3ed2bf;}})['then'](respondWithResult(_0x3dc746,null))[_0x898a('0x20')](function(){for(var _0x3712b0 of _0x2c5037){var _0x51f314=path['join'](config[_0x898a('0x88')],_0x898a('0xe0'),'files',_0x898a('0xe1'),'offline-chat',_0x3712b0[_0x898a('0x7b')]);fs_extra[_0x898a('0xf5')](_0x51f314)[_0x898a('0x20')](function(_0x4fc478){logger[_0x898a('0x1d')]('Could\x20not\x20remove\x20attachment\x20file',_0x51f314,_0x4fc478);});}});};exports[_0x898a('0xf6')]=function(_0x351def,_0x51ede4){return db[_0x898a('0xb4')]['find']({'where':{'id':_0x351def[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x51ede4,null))[_0x898a('0x2e')](function(_0x2e6706){if(_0x2e6706){return _0x2e6706['addInteraction'](_0x351def[_0x898a('0x61')][_0x898a('0x74')],_[_0x898a('0xf7')](_0x351def[_0x898a('0x61')],[_0x898a('0x74'),'id'])||{});}})[_0x898a('0x2e')](respondWithResult(_0x51ede4,null))[_0x898a('0x20')](handleError(_0x51ede4,null));};exports[_0x898a('0xf8')]=function(_0x19e347,_0x19c8ca){var _0x47a5bf={'raw':![],'where':{}};var _0xcc083a={};var _0x1370aa={'count':0x0,'rows':[]};return db[_0x898a('0x46')]['findOne']({'where':{'id':_0x19e347['params']['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x19c8ca,null))[_0x898a('0x2e')](function(_0x349289){if(_0x349289){_0xcc083a[_0x898a('0x41')]=_['keys'](db['ChatInteraction'][_0x898a('0x5d')]);_0xcc083a[_0x898a('0x4a')]=_[_0x898a('0x49')](_0x19e347[_0x898a('0x4a')]);_0xcc083a['filters']=_[_0x898a('0x4b')](_0xcc083a[_0x898a('0x41')],_0xcc083a[_0x898a('0x4a')]);_0x47a5bf[_0x898a('0x4c')]=_[_0x898a('0x4b')](_0xcc083a['model'],qs[_0x898a('0x4d')](_0x19e347[_0x898a('0x4a')][_0x898a('0x4d')]));_0x47a5bf[_0x898a('0x4c')]=_0x47a5bf[_0x898a('0x4c')]['length']?_0x47a5bf[_0x898a('0x4c')]:_0xcc083a['model'];if(!_0x19e347['query'][_0x898a('0x72')](_0x898a('0x4f'))){_0x47a5bf[_0x898a('0x24')]=qs['limit'](_0x19e347['query'][_0x898a('0x24')]);_0x47a5bf[_0x898a('0x27')]=qs['offset'](_0x19e347[_0x898a('0x4a')][_0x898a('0x27')]);}_0x47a5bf[_0x898a('0x50')]=qs['sort'](_0x19e347[_0x898a('0x4a')][_0x898a('0x51')]);_0x47a5bf[_0x898a('0x52')]=qs['filters'](_[_0x898a('0x54')](_0x19e347[_0x898a('0x4a')],_0xcc083a[_0x898a('0x53')]));_0x47a5bf[_0x898a('0x52')]['ChatWebsiteId']=_0x349289['id'];if(_0x19e347[_0x898a('0x4a')][_0x898a('0x55')]){_0x47a5bf[_0x898a('0x52')]=_['merge'](_0x47a5bf[_0x898a('0x52')],{'$or':_[_0x898a('0x45')](_0x47a5bf[_0x898a('0x4c')],function(_0x9ddbdd){var _0x2f3fba={};_0x2f3fba[_0x9ddbdd]={'$like':'%'+_0x19e347[_0x898a('0x4a')][_0x898a('0x55')]+'%'};return _0x2f3fba;})});}_0x47a5bf=_[_0x898a('0x56')]({},_0x47a5bf,_0x19e347['options']);return db['ChatInteraction']['count']({'where':_0x47a5bf[_0x898a('0x52')]})[_0x898a('0x2e')](function(_0x77571d){_0x1370aa[_0x898a('0x26')]=_0x77571d;if(_0x19e347[_0x898a('0x4a')][_0x898a('0x5e')]){_0x47a5bf[_0x898a('0x58')]=[{'model':db[_0x898a('0x9d')],'as':_0x898a('0xf9'),'required':![]},{'model':db[_0x898a('0xc1')],'as':_0x898a('0xfa'),'attributes':[_0x898a('0x30'),_0x898a('0xfb'),_0x898a('0xfc')],'required':![]},{'model':db[_0x898a('0xfd')],'as':'Tags','attributes':['id',_0x898a('0x30'),_0x898a('0xfe')],'where':_0x19e347[_0x898a('0x4a')][_0x898a('0xff')]?{'id':_0x19e347[_0x898a('0x4a')][_0x898a('0xff')]}:undefined,'required':_0x19e347[_0x898a('0x4a')][_0x898a('0xff')]?!![]:![]}];}return db[_0x898a('0xb4')]['findAll'](_0x47a5bf);})[_0x898a('0x2e')](function(_0x33cf8c){_0x1370aa[_0x898a('0x5a')]=_0x33cf8c;return _0x1370aa;});}})[_0x898a('0x2e')](respondWithFilteredResult(_0x19c8ca,_0x47a5bf))[_0x898a('0x20')](handleError(_0x19c8ca,null));};exports[_0x898a('0x100')]=function(_0x3bdd73,_0x51691a){var _0x4fede7=0x0;var _0x2ee5e0=0x0;var _0x47dece=![];var _0x33ab74;var _0xfc0299;return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0x3bdd73[_0x898a('0x5b')]['id']},'include':[{'model':db[_0x898a('0x91')],'as':_0x898a('0x91'),'include':[{'model':db[_0x898a('0x91')],'as':_0x898a('0x101'),'attributes':['id',_0x898a('0xa8')]}]}]})['then'](handleEntityNotFound(_0x51691a,null))['then'](function(_0x284113){if(_0x284113){_0x33ab74=_0x284113;return _0x284113[_0x898a('0x102')]({'raw':!![]});}})[_0x898a('0x2e')](function(_0x16e208){if(_0x33ab74){if(_0x16e208){_0xfc0299=_0x16e208;}}return require(_0x898a('0x84'))['getLicense']();})[_0x898a('0x2e')](function(_0x18ac46){if(_0x18ac46){_0x2ee5e0=_0x18ac46[_0x898a('0x103')];_0x47dece=_0x18ac46[_0x898a('0x86')];}})['then'](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0x898a('0x2e')](function(_0x481584){_0x4fede7=_0x481584;if(_0x2ee5e0&&_0x481584>_0x2ee5e0){return db[_0x898a('0x104')][_0x898a('0x70')]({'where':{'id':0x1}})[_0x898a('0x2e')](function(_0x228aa0){if(_0x228aa0){_0x228aa0[_0x898a('0x105')](_0x898a('0x106'));}});}})['then'](function(){var _0x43ff97=_0x33ab74[_0x898a('0x91')];var _0x1bdfd2=_0x33ab74[_0x898a('0x93')]||undefined;return _0x43ff97?_0x43ff97[_0x898a('0x94')](_0x1bdfd2):!![];})[_0x898a('0x2e')](function(_0x41d16d){var _0x275c04=fs['readFileSync'](path[_0x898a('0x82')](config[_0x898a('0x88')],'server/files/chat/iframe.ejs'),_0x898a('0x107'));var _0x22ebe9=_0x898a('0x108');var _0x355f0c=![];var _0x2b10c4,_0x3d1004;if(_0x3bdd73[_0x898a('0x109')][_0x898a('0x9c')]){_0x2b10c4=new URL(_0x3bdd73['headers'][_0x898a('0x9c')])['origin'];}else if(_0x3bdd73[_0x898a('0x109')][_0x898a('0x10a')]){_0x2b10c4=new URL(_0x3bdd73['headers'][_0x898a('0x10a')])[_0x898a('0x10a')];}else{_0x2b10c4=_0x898a('0x10b');}_0x3d1004=typeof _0x33ab74[_0x898a('0x6a')][_0x898a('0x36')](',')[_0x898a('0x5f')](function(_0x4bbe0d){return wildcardUtils['testWebsiteWithWildcard'](_0x4bbe0d,_0x2b10c4);})!==_0x898a('0x25');var _0x575c4c={'chatVersion':_0x22ebe9,'chatWebsiteAddressOrigin':_0x3d1004?_0x2b10c4:_0x33ab74['address'],'remote':_0x33ab74['remote'],'query':querystring[_0x898a('0x1c')](_[_0x898a('0x56')](_0x33ab74[_0x898a('0x2b')]({'plain':!![]}),{'customerIp':_0x3bdd73[_0x898a('0x109')][_0x898a('0x34')]||_0x3bdd73['headers'][_0x898a('0x10c')]||_0x3bdd73['connection']['remoteAddress']||_0x3bdd73['ip'],'referer':_0x3bdd73[_0x898a('0x109')][_0x898a('0x9c')],'openedInteractions':_0x4fede7,'maxInteractions':_0x2ee5e0,'virtual':_0x47dece['virtual'],'online':_0x41d16d,'custom':_0x47dece,'address':_0x3d1004?_0x2b10c4:null}))['replace'](/'/g,'\x5c\x27')};_0x51691a[_0x898a('0xd1')](ejs[_0x898a('0xda')](Mustache['render'](_0x275c04,_0x575c4c),{'proactiveActions':_0xfc0299,'alignment':_0x33ab74['alignment'],'verticalAlignment':_0x33ab74[_0x898a('0x10d')],'div_color':_0x33ab74['color'],'labelText':_0x33ab74['labelText'],'text_color':_0x33ab74['textColor'],'text_button_color':_0x33ab74[_0x898a('0x10e')],'button_color':_0x33ab74[_0x898a('0x10f')],'background_color':_0x33ab74[_0x898a('0x110')],'hideWhenOffline':_0x33ab74['hideWhenOffline'],'intervalId':_0x33ab74[_0x898a('0x111')],'isDevelopment':_0x355f0c,'chatVersion':_0x22ebe9}));})[_0x898a('0x20')](handleError(_0x51691a,null));};exports['addApplications']=function(_0x4dbc0e,_0x2d4890){var _0x1f1d55=_0x4dbc0e[_0x898a('0x5b')]['id'];var _0x1d1f9c=_0x4dbc0e[_0x898a('0x61')];var _0x358118=0xc8;var _0xd58e7d=null;return db[_0x898a('0xe3')][_0x898a('0xe4')]({'isolationLevel':db[_0x898a('0xe3')]['Transaction'][_0x898a('0x112')][_0x898a('0x113')]},function(_0x4a0e51){return db[_0x898a('0x46')][_0x898a('0x70')]({'where':{'id':_0x1f1d55},'transaction':_0x4a0e51})[_0x898a('0x2e')](function(_0x725e3f){if(_0x725e3f){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x1f1d55},'transaction':_0x4a0e51})['then'](function(){var _0x347450=_[_0x898a('0x45')](_0x1d1f9c,function(_0x343bf3){_0x343bf3[_0x898a('0x6f')]=_0x1f1d55;return _0x343bf3;});return db['ChatApplication']['bulkCreate'](_0x347450,{'transaction':_0x4a0e51});});}else{_0x358118=0x194;_0xd58e7d=[];}});})[_0x898a('0x2e')](function(){if(_0x358118!==0x194){return db[_0x898a('0xa7')][_0x898a('0x114')]({'where':{'ChatWebsiteId':_0x1f1d55},'order':'priority'})['then'](function(_0x8b63e0){_0xd58e7d=_0x8b63e0;});}})[_0x898a('0x20')](function(_0x21a249){_0x358118=0x1f4;logger[_0x898a('0x1d')](_0x21a249[_0x898a('0x115')]);if(_0x21a249[_0x898a('0x30')]){delete _0x21a249[_0x898a('0x30')];}_0xd58e7d=_0x21a249;})[_0x898a('0x116')](function(){if(_0xd58e7d===null){_0x2d4890[_0x898a('0x2f')](_0x358118);}else{if(_0x358118===0x1f4){_0x2d4890[_0x898a('0x22')](_0x358118)['send'](_0xd58e7d);}else{_0x2d4890[_0x898a('0x22')](_0x358118)[_0x898a('0x23')](_0xd58e7d);}}});};exports[_0x898a('0x117')]=function(_0x26bc49,_0x1ed373){var _0x59200f={};var _0x3b84bb={};var _0x1b5e6a;var _0x210f31;return db[_0x898a('0x46')][_0x898a('0x70')]({'where':{'id':_0x26bc49['params']['id']}})['then'](handleEntityNotFound(_0x1ed373,null))[_0x898a('0x2e')](function(_0x1e57a2){if(_0x1e57a2){_0x1b5e6a=_0x1e57a2;_0x3b84bb['model']=_[_0x898a('0x49')](db['ChatApplication'][_0x898a('0x5d')]);_0x3b84bb[_0x898a('0x4a')]=_[_0x898a('0x49')](_0x26bc49['query']);_0x3b84bb[_0x898a('0x53')]=_[_0x898a('0x4b')](_0x3b84bb[_0x898a('0x41')],_0x3b84bb['query']);_0x59200f[_0x898a('0x4c')]=_[_0x898a('0x4b')](_0x3b84bb[_0x898a('0x41')],qs[_0x898a('0x4d')](_0x26bc49[_0x898a('0x4a')][_0x898a('0x4d')]));_0x59200f[_0x898a('0x4c')]=_0x59200f[_0x898a('0x4c')][_0x898a('0x4e')]?_0x59200f[_0x898a('0x4c')]:_0x3b84bb[_0x898a('0x41')];_0x59200f[_0x898a('0x50')]=qs['sort'](_0x26bc49[_0x898a('0x4a')]['sort']);_0x59200f[_0x898a('0x52')]=qs['filters'](_[_0x898a('0x54')](_0x26bc49[_0x898a('0x4a')],_0x3b84bb[_0x898a('0x53')]));if(_0x26bc49['query'][_0x898a('0x55')]){_0x59200f[_0x898a('0x52')]=_[_0x898a('0x56')](_0x59200f[_0x898a('0x52')],{'$or':_[_0x898a('0x45')](_0x59200f[_0x898a('0x4c')],function(_0x5db4ae){var _0xa752f6={};_0xa752f6[_0x5db4ae]={'$like':'%'+_0x26bc49[_0x898a('0x4a')][_0x898a('0x55')]+'%'};return _0xa752f6;})});}_0x59200f=_[_0x898a('0x56')]({},_0x59200f,_0x26bc49[_0x898a('0x57')]);return _0x1b5e6a[_0x898a('0x117')](_0x59200f);}})[_0x898a('0x2e')](function(_0x2caedd){if(_0x2caedd){_0x210f31=_0x2caedd[_0x898a('0x4e')];if(!_0x26bc49['query']['hasOwnProperty']('nolimit')){_0x59200f[_0x898a('0x24')]=qs[_0x898a('0x24')](_0x26bc49[_0x898a('0x4a')][_0x898a('0x24')]);_0x59200f[_0x898a('0x27')]=qs[_0x898a('0x27')](_0x26bc49['query']['offset']);}return _0x1b5e6a['getApplications'](_0x59200f);}})[_0x898a('0x2e')](function(_0x514f08){if(_0x514f08){return _0x514f08?{'count':_0x210f31,'rows':_0x514f08}:null;}})[_0x898a('0x2e')](respondWithResult(_0x1ed373,null))[_0x898a('0x20')](handleError(_0x1ed373,null));};exports[_0x898a('0x118')]=function(_0x3930bd,_0xaa6842){return db[_0x898a('0x119')][_0x898a('0x5f')]({'where':{'id':_0x3930bd[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0xaa6842,null))[_0x898a('0x2e')](function(_0x162efb){if(_0x162efb){return _0x162efb[_0x898a('0x118')](_0x3930bd[_0x898a('0x61')][_0x898a('0x74')],_['omit'](_0x3930bd[_0x898a('0x61')],['ids','id'])||{});}})[_0x898a('0x2e')](respondWithResult(_0xaa6842,null))[_0x898a('0x20')](handleError(_0xaa6842,null));};exports[_0x898a('0x102')]=function(_0x5710fc,_0x3347f0){var _0x4fe5a6={};var _0xf18619={};var _0x59e163;var _0x2c56ff;return db[_0x898a('0x46')]['findOne']({'where':{'id':_0x5710fc[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x3347f0,null))[_0x898a('0x2e')](function(_0x1e2d7a){if(_0x1e2d7a){_0x59e163=_0x1e2d7a;_0xf18619['model']=_['keys'](db['ChatProactiveAction'][_0x898a('0x5d')]);_0xf18619[_0x898a('0x4a')]=_[_0x898a('0x49')](_0x5710fc[_0x898a('0x4a')]);_0xf18619[_0x898a('0x53')]=_[_0x898a('0x4b')](_0xf18619[_0x898a('0x41')],_0xf18619[_0x898a('0x4a')]);_0x4fe5a6[_0x898a('0x4c')]=_[_0x898a('0x4b')](_0xf18619['model'],qs[_0x898a('0x4d')](_0x5710fc['query'][_0x898a('0x4d')]));_0x4fe5a6[_0x898a('0x4c')]=_0x4fe5a6[_0x898a('0x4c')][_0x898a('0x4e')]?_0x4fe5a6[_0x898a('0x4c')]:_0xf18619[_0x898a('0x41')];_0x4fe5a6[_0x898a('0x50')]=qs[_0x898a('0x51')](_0x5710fc[_0x898a('0x4a')][_0x898a('0x51')]);_0x4fe5a6[_0x898a('0x52')]=qs['filters'](_['pick'](_0x5710fc[_0x898a('0x4a')],_0xf18619['filters']));if(_0x5710fc[_0x898a('0x4a')][_0x898a('0x55')]){_0x4fe5a6[_0x898a('0x52')]=_[_0x898a('0x56')](_0x4fe5a6[_0x898a('0x52')],{'$or':_[_0x898a('0x45')](_0x4fe5a6['attributes'],function(_0x360da6){var _0x24bec4={};_0x24bec4[_0x360da6]={'$like':'%'+_0x5710fc[_0x898a('0x4a')]['filter']+'%'};return _0x24bec4;})});}_0x4fe5a6=_[_0x898a('0x56')]({},_0x4fe5a6,_0x5710fc[_0x898a('0x57')]);return _0x59e163[_0x898a('0x102')](_0x4fe5a6);}})[_0x898a('0x2e')](function(_0x26afad){if(_0x26afad){_0x2c56ff=_0x26afad[_0x898a('0x4e')];if(!_0x5710fc[_0x898a('0x4a')][_0x898a('0x72')](_0x898a('0x4f'))){_0x4fe5a6['limit']=qs[_0x898a('0x24')](_0x5710fc[_0x898a('0x4a')]['limit']);_0x4fe5a6[_0x898a('0x27')]=qs['offset'](_0x5710fc[_0x898a('0x4a')][_0x898a('0x27')]);}return _0x59e163['getProactiveActions'](_0x4fe5a6);}})[_0x898a('0x2e')](function(_0x2213f4){if(_0x2213f4){return _0x2213f4?{'count':_0x2c56ff,'rows':_0x2213f4}:null;}})[_0x898a('0x2e')](respondWithResult(_0x3347f0,null))[_0x898a('0x20')](handleError(_0x3347f0,null));};exports[_0x898a('0x11a')]=function(_0x526133,_0x555cae){var _0x361eba=_0x526133['query'][_0x898a('0x11b')]==='false'?_0x898a('0x11c'):_0x898a('0x11d');return db[_0x898a('0x46')]['find']({'attributes':['id',_0x361eba],'where':{'id':_0x526133['params']['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x555cae,null))[_0x898a('0x2e')](function(_0x1d430e){if(_0x1d430e){var _0x18c54f=_0x1d430e[_0x361eba];var _0x14c03e=_0x18c54f&&_0x18c54f[_0x898a('0x11e')]?_0x18c54f[_0x898a('0x11e')]:[];_0x555cae[_0x898a('0xd1')]({'fromKey':_[_0x898a('0x8c')](_0x18c54f['fromKey'])?undefined:_0x18c54f[_0x898a('0x11f')],'count':_0x14c03e['length'],'rows':_0x14c03e});}})[_0x898a('0x20')](handleError(_0x555cae,null));};exports[_0x898a('0x120')]=function(_0x545403,_0x546610){var _0x1e4625={'raw':![],'where':{}};var _0x405be4={};var _0x1b1e9a={'count':0x0,'rows':[]};return db[_0x898a('0x46')][_0x898a('0x70')]({'where':{'id':_0x545403[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x546610,null))[_0x898a('0x2e')](function(_0x521d01){if(_0x521d01){_0x405be4[_0x898a('0x41')]=_[_0x898a('0x49')](db[_0x898a('0xdc')]['rawAttributes']);_0x405be4[_0x898a('0x4a')]=_['keys'](_0x545403[_0x898a('0x4a')]);_0x405be4[_0x898a('0x53')]=_[_0x898a('0x4b')](_0x405be4[_0x898a('0x41')],_0x405be4[_0x898a('0x4a')]);_0x1e4625[_0x898a('0x4c')]=_[_0x898a('0x4b')](_0x405be4['model'],qs[_0x898a('0x4d')](_0x545403[_0x898a('0x4a')][_0x898a('0x4d')]));_0x1e4625[_0x898a('0x4c')]=_0x1e4625[_0x898a('0x4c')][_0x898a('0x4e')]?_0x1e4625[_0x898a('0x4c')]:_0x405be4[_0x898a('0x41')];if(!_0x545403['query'][_0x898a('0x72')]('nolimit')){_0x1e4625['limit']=qs['limit'](_0x545403[_0x898a('0x4a')][_0x898a('0x24')]);_0x1e4625[_0x898a('0x27')]=qs[_0x898a('0x27')](_0x545403[_0x898a('0x4a')][_0x898a('0x27')]);}_0x1e4625[_0x898a('0x50')]=qs[_0x898a('0x51')](_0x545403['query'][_0x898a('0x51')]);_0x1e4625[_0x898a('0x52')]=qs['filters'](_[_0x898a('0x54')](_0x545403[_0x898a('0x4a')],_0x405be4['filters']));_0x1e4625[_0x898a('0x52')]['ChatWebsiteId']=_0x521d01['id'];if(_0x545403[_0x898a('0x4a')][_0x898a('0x55')]){_0x1e4625[_0x898a('0x52')]=_[_0x898a('0x56')](_0x1e4625['where'],{'$or':_[_0x898a('0x45')](_0x1e4625[_0x898a('0x4c')],function(_0x525d61){var _0x844e5e={};_0x844e5e[_0x525d61]={'$like':'%'+_0x545403[_0x898a('0x4a')][_0x898a('0x55')]+'%'};return _0x844e5e;})});}_0x1e4625=_[_0x898a('0x56')]({},_0x1e4625,_0x545403[_0x898a('0x57')]);return db[_0x898a('0xdc')][_0x898a('0x26')]({'where':_0x1e4625[_0x898a('0x52')]})[_0x898a('0x2e')](function(_0x10be38){_0x1b1e9a[_0x898a('0x26')]=_0x10be38;if(_0x545403[_0x898a('0x4a')][_0x898a('0x5e')]){_0x1e4625['include']=[{'all':!![]}];}else{_0x1e4625[_0x898a('0x58')]=[{'model':db[_0x898a('0x9d')],'as':_0x898a('0xf9'),'required':![]},{'model':db['Attachment'],'as':_0x898a('0x121'),'required':![]}];}return db[_0x898a('0xdc')][_0x898a('0x59')](_0x1e4625);})['then'](function(_0x199be5){_0x1b1e9a[_0x898a('0x5a')]=_0x199be5;return _0x1b1e9a;});}})['then'](respondWithFilteredResult(_0x546610,_0x1e4625))[_0x898a('0x20')](handleError(_0x546610,null));};exports[_0x898a('0x122')]=function(_0x13d875,_0x448fd7){return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0x13d875['params']['id']}})['then'](handleEntityNotFound(_0x448fd7,null))['then'](function(_0x85aa2d){if(_0x85aa2d){return _0x85aa2d['addAgents'](_0x13d875[_0x898a('0x61')]['ids'],_[_0x898a('0xf7')](_0x13d875[_0x898a('0x61')],[_0x898a('0x74'),'id'])||{})['spread'](function(_0x3d092e){for(var _0x4f4e79=0x0;_0x4f4e79<_0x13d875['body']['ids'][_0x898a('0x4e')];_0x4f4e79+=0x1){socket['emit'](_0x898a('0x123'),{'UserId':Number(_0x13d875[_0x898a('0x61')][_0x898a('0x74')][_0x4f4e79]),'ChatWebsiteId':Number(_0x13d875[_0x898a('0x5b')]['id'])});}return _0x3d092e;});}})[_0x898a('0x2e')](respondWithResult(_0x448fd7,null))['catch'](handleError(_0x448fd7,null));};exports[_0x898a('0x124')]=function(_0x27e060,_0x2eff5c){return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0x27e060[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x2eff5c,null))[_0x898a('0x2e')](function(_0x31e8fa){if(_0x31e8fa){return _0x31e8fa['removeAgents'](_0x27e060[_0x898a('0x4a')][_0x898a('0x74')])['then'](function(){if(_[_0x898a('0x125')](_0x27e060[_0x898a('0x4a')][_0x898a('0x74')])){for(var _0x224868=0x0;_0x224868<_0x27e060[_0x898a('0x4a')][_0x898a('0x74')]['length'];_0x224868+=0x1){socket[_0x898a('0x126')](_0x898a('0x127'),{'UserId':Number(_0x27e060['query'][_0x898a('0x74')][_0x224868]),'ChatWebsiteId':Number(_0x27e060[_0x898a('0x5b')]['id'])});}}else{socket[_0x898a('0x126')](_0x898a('0x127'),{'UserId':Number(_0x27e060[_0x898a('0x4a')][_0x898a('0x74')]),'ChatWebsiteId':Number(_0x27e060['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2eff5c,null))[_0x898a('0x20')](handleError(_0x2eff5c,null));};exports[_0x898a('0x128')]=function(_0x227787,_0x3acb2f){var _0x35737f={};var _0x21c989={};var _0x1c02c5;var _0x1e93fa;return db[_0x898a('0x46')]['findOne']({'where':{'id':_0x227787['params']['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x3acb2f,null))[_0x898a('0x2e')](function(_0x255766){if(_0x255766){_0x1c02c5=_0x255766;_0x21c989[_0x898a('0x41')]=_[_0x898a('0x49')](db[_0x898a('0xc1')][_0x898a('0x5d')]);_0x21c989[_0x898a('0x4a')]=_[_0x898a('0x49')](_0x227787[_0x898a('0x4a')]);_0x21c989['filters']=_['intersection'](_0x21c989[_0x898a('0x41')],_0x21c989['query']);_0x35737f[_0x898a('0x4c')]=_[_0x898a('0x4b')](_0x21c989[_0x898a('0x41')],qs[_0x898a('0x4d')](_0x227787['query'][_0x898a('0x4d')]));_0x35737f[_0x898a('0x4c')]=_0x35737f[_0x898a('0x4c')]['length']?_0x35737f[_0x898a('0x4c')]:_0x21c989[_0x898a('0x41')];_0x35737f['order']=qs[_0x898a('0x51')](_0x227787[_0x898a('0x4a')][_0x898a('0x51')]);_0x35737f[_0x898a('0x52')]=qs[_0x898a('0x53')](_['pick'](_0x227787[_0x898a('0x4a')],_0x21c989['filters']));if(_0x227787['query']['filter']){_0x35737f[_0x898a('0x52')]=_[_0x898a('0x56')](_0x35737f[_0x898a('0x52')],{'$or':_[_0x898a('0x45')](_0x35737f[_0x898a('0x4c')],function(_0x3c57ac){var _0x54d0b2={};_0x54d0b2[_0x3c57ac]={'$like':'%'+_0x227787[_0x898a('0x4a')][_0x898a('0x55')]+'%'};return _0x54d0b2;})});}_0x35737f=_[_0x898a('0x56')]({},_0x35737f,_0x227787[_0x898a('0x57')]);return _0x1c02c5['getAgents'](_0x35737f);}})[_0x898a('0x2e')](function(_0x413331){if(_0x413331){_0x1e93fa=_0x413331[_0x898a('0x4e')];if(!_0x227787[_0x898a('0x4a')][_0x898a('0x72')](_0x898a('0x4f'))){_0x35737f[_0x898a('0x24')]=qs[_0x898a('0x24')](_0x227787['query'][_0x898a('0x24')]);_0x35737f[_0x898a('0x27')]=qs['offset'](_0x227787[_0x898a('0x4a')][_0x898a('0x27')]);}return _0x1c02c5[_0x898a('0x128')](_0x35737f);}})[_0x898a('0x2e')](function(_0x183ff5){if(_0x183ff5){return _0x183ff5?{'count':_0x1e93fa,'rows':_0x183ff5}:null;}})[_0x898a('0x2e')](respondWithResult(_0x3acb2f,null))[_0x898a('0x20')](handleError(_0x3acb2f,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 200a8f3..9569229 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 _0x2392=['events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x11bb60,_0x3dc734){var _0x37357e=function(_0x1b6a33){while(--_0x1b6a33){_0x11bb60['push'](_0x11bb60['shift']());}};_0x37357e(++_0x3dc734);}(_0x2392,0xd0));var _0x2239=function(_0x2308f0,_0x3e2ecc){_0x2308f0=_0x2308f0-0x0;var _0x9146b=_0x2392[_0x2308f0];return _0x9146b;};'use strict';var EventEmitter=require(_0x2239('0x0'));var ChatWebsite=require(_0x2239('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x2239('0x2')](0x0);var events={'afterCreate':_0x2239('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x277193){return function(_0x420e52,_0x3f3b7c,_0x42dcec){ChatWebsiteEvents[_0x2239('0x4')](_0x277193+':'+_0x420e52['id'],_0x420e52);ChatWebsiteEvents[_0x2239('0x4')](_0x277193,_0x420e52);_0x42dcec(null);};}for(var e in events){if(events[_0x2239('0x5')](e)){var event=events[e];ChatWebsite[_0x2239('0x6')](e,emitEvent(event));}}module[_0x2239('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xe0c3=['events','ChatWebsite','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0x5327f0,_0x2b7158){var _0x792bfa=function(_0x4ae9c9){while(--_0x4ae9c9){_0x5327f0['push'](_0x5327f0['shift']());}};_0x792bfa(++_0x2b7158);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x3e0c('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x3e0c('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3e0c('0x2')](0x0);var events={'afterCreate':_0x3e0c('0x3'),'afterUpdate':_0x3e0c('0x4'),'afterDestroy':_0x3e0c('0x5')};function emitEvent(_0x410ec4){return function(_0x31851c,_0x26c964,_0x1a026f){ChatWebsiteEvents['emit'](_0x410ec4+':'+_0x31851c['id'],_0x31851c);ChatWebsiteEvents['emit'](_0x410ec4,_0x31851c);_0x1a026f(null);};}for(var e in events){if(events[_0x3e0c('0x6')](e)){var event=events[e];ChatWebsite[_0x3e0c('0x7')](e,emitEvent(event));}}module[_0x3e0c('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 07e0fad..4d0d228 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 _0x7503=['define','ChatWebsite','chat_websites','../../config/logger','api','moment','rimraf','../../config/environment','exports'];(function(_0x401ade,_0x465ef6){var _0x24c85e=function(_0x43cbc7){while(--_0x43cbc7){_0x401ade['push'](_0x401ade['shift']());}};_0x24c85e(++_0x465ef6);}(_0x7503,0x1e0));var _0x3750=function(_0x414f67,_0x861aed){_0x414f67=_0x414f67-0x0;var _0x338537=_0x7503[_0x414f67];return _0x338537;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3750('0x0'))(_0x3750('0x1'));var moment=require(_0x3750('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3750('0x3'));var config=require(_0x3750('0x4'));var attributes=require('./chatWebsite.attributes');module[_0x3750('0x5')]=function(_0x1bf8db,_0x5ccbe9){return _0x1bf8db[_0x3750('0x6')](_0x3750('0x7'),attributes,{'tableName':_0x3750('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8a0c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x37705e,_0x4cb922){var _0x23dd73=function(_0x367f0a){while(--_0x367f0a){_0x37705e['push'](_0x37705e['shift']());}};_0x23dd73(++_0x4cb922);}(_0x8a0c,0xcf));var _0xc8a0=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x8a0c[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0xc8a0('0x0'));var util=require(_0xc8a0('0x1'));var logger=require(_0xc8a0('0x2'))(_0xc8a0('0x3'));var moment=require(_0xc8a0('0x4'));var BPromise=require(_0xc8a0('0x5'));var rp=require(_0xc8a0('0x6'));var fs=require('fs');var path=require(_0xc8a0('0x7'));var rimraf=require(_0xc8a0('0x8'));var config=require(_0xc8a0('0x9'));var attributes=require('./chatWebsite.attributes');module[_0xc8a0('0xa')]=function(_0x274739,_0x2c0514){return _0x274739[_0xc8a0('0xb')](_0xc8a0('0xc'),attributes,{'tableName':_0xc8a0('0xd'),'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 b82a349..dab4ea2 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 _0xb49a=['../../config/logger','jayson/promise','client','redis','defaults','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','../../mysqldb'];(function(_0x550b54,_0x406a8f){var _0x2e7863=function(_0x1659d8){while(--_0x1659d8){_0x550b54['push'](_0x550b54['shift']());}};_0x2e7863(++_0x406a8f);}(_0xb49a,0x9d));var _0xab49=function(_0x6d394d,_0x185b80){_0x6d394d=_0x6d394d-0x0;var _0x1f0621=_0xb49a[_0x6d394d];return _0x1f0621;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab49('0x0'));var BPromise=require(_0xab49('0x1'));var rs=require(_0xab49('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab49('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xab49('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xab49('0x5'));var client=jayson[_0xab49('0x6')]['http']({'port':0x232a});config[_0xab49('0x7')]=_[_0xab49('0x8')](config[_0xab49('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xab49('0x9'))(new Redis(config[_0xab49('0x7')]));require(_0xab49('0xa'))['register'](socket);function respondWithRpcPromise(_0x3a79fa,_0x394c52,_0x43117b){return new BPromise(function(_0x1a9e6d,_0xd7cc42){return client[_0xab49('0xb')](_0x3a79fa,_0x43117b)[_0xab49('0xc')](function(_0x2bbfcc){logger[_0xab49('0xd')](_0xab49('0xe'),_0x394c52,_0xab49('0xf'));logger[_0xab49('0x10')](_0xab49('0x11'),_0x394c52,'request\x20sent',JSON[_0xab49('0x12')](_0x2bbfcc));if(_0x2bbfcc[_0xab49('0x13')]){if(_0x2bbfcc[_0xab49('0x13')]['code']===0x1f4){logger[_0xab49('0x13')](_0xab49('0xe'),_0x394c52,_0x2bbfcc['error'][_0xab49('0x14')]);return _0xd7cc42(_0x2bbfcc[_0xab49('0x13')][_0xab49('0x14')]);}logger[_0xab49('0x13')](_0xab49('0xe'),_0x394c52,_0x2bbfcc[_0xab49('0x13')]['message']);return _0x1a9e6d(_0x2bbfcc[_0xab49('0x13')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x394c52,_0xab49('0xf'));_0x1a9e6d(_0x2bbfcc[_0xab49('0x15')][_0xab49('0x14')]);}})[_0xab49('0x16')](function(_0x28cd7b){logger[_0xab49('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x394c52,_0x28cd7b);_0xd7cc42(_0x28cd7b);});});}
\ No newline at end of file
+var _0xeced=['localhost','socket.io-emitter','redis','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','defaults'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xeced,0x92));var _0xdece=function(_0x4f9a55,_0x27f15d){_0x4f9a55=_0x4f9a55-0x0;var _0x4542ba=_0xeced[_0x4f9a55];return _0x4542ba;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xdece('0x0'));var rs=require(_0xdece('0x1'));var fs=require('fs');var Redis=require(_0xdece('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdece('0x3'));var logger=require(_0xdece('0x4'))('rpc');var config=require(_0xdece('0x5'));var jayson=require(_0xdece('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xdece('0x7')](config['redis'],{'host':_0xdece('0x8'),'port':0x18eb});var socket=require(_0xdece('0x9'))(new Redis(config[_0xdece('0xa')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x1114f0,_0x47fb9d,_0x2ed10a){return new BPromise(function(_0x2de7a9,_0x17432c){return client['request'](_0x1114f0,_0x2ed10a)[_0xdece('0xb')](function(_0x4f4654){logger[_0xdece('0xc')](_0xdece('0xd'),_0x47fb9d,_0xdece('0xe'));logger[_0xdece('0xf')](_0xdece('0x10'),_0x47fb9d,_0xdece('0xe'),JSON[_0xdece('0x11')](_0x4f4654));if(_0x4f4654[_0xdece('0x12')]){if(_0x4f4654[_0xdece('0x12')][_0xdece('0x13')]===0x1f4){logger[_0xdece('0x12')](_0xdece('0xd'),_0x47fb9d,_0x4f4654[_0xdece('0x12')][_0xdece('0x14')]);return _0x17432c(_0x4f4654[_0xdece('0x12')][_0xdece('0x14')]);}logger[_0xdece('0x12')](_0xdece('0xd'),_0x47fb9d,_0x4f4654[_0xdece('0x12')][_0xdece('0x14')]);return _0x2de7a9(_0x4f4654[_0xdece('0x12')][_0xdece('0x14')]);}else{logger[_0xdece('0xc')](_0xdece('0xd'),_0x47fb9d,_0xdece('0xe'));_0x2de7a9(_0x4f4654['result'][_0xdece('0x14')]);}})[_0xdece('0x15')](function(_0x274965){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x47fb9d,_0x274965);_0x17432c(_0x274965);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index a133cef..ba9e8b1 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 _0xfbef=['length','./chatWebsite.events','save','remove','update','emit','removeListener','register'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xfbef,0x69));var _0xffbe=function(_0x31a69c,_0xf01fa5){_0x31a69c=_0x31a69c-0x0;var _0x129a04=_0xfbef[_0x31a69c];return _0x129a04;};'use strict';var ChatWebsiteEvents=require(_0xffbe('0x0'));var events=[_0xffbe('0x1'),_0xffbe('0x2'),_0xffbe('0x3')];function createListener(_0x4e4b04,_0x5b2039){return function(_0x2d8dd7){_0x5b2039[_0xffbe('0x4')](_0x4e4b04,_0x2d8dd7);};}function removeListener(_0x4103ab,_0x27bfb4){return function(){ChatWebsiteEvents[_0xffbe('0x5')](_0x4103ab,_0x27bfb4);};}exports[_0xffbe('0x6')]=function(_0x111d7a){for(var _0x56018e=0x0,_0x1fb5de=events[_0xffbe('0x7')];_0x56018e<_0x1fb5de;_0x56018e++){var _0x468ebf=events[_0x56018e];var _0x5db5e0=createListener('chatWebsite:'+_0x468ebf,_0x111d7a);ChatWebsiteEvents['on'](_0x468ebf,_0x5db5e0);}};
\ No newline at end of file
+var _0x6857=['register','length','./chatWebsite.events','save','emit','removeListener'];(function(_0x35e948,_0x434095){var _0xa0faa6=function(_0x1c890d){while(--_0x1c890d){_0x35e948['push'](_0x35e948['shift']());}};_0xa0faa6(++_0x434095);}(_0x6857,0x12e));var _0x7685=function(_0x5a11ea,_0x385b46){_0x5a11ea=_0x5a11ea-0x0;var _0x266b0f=_0x6857[_0x5a11ea];return _0x266b0f;};'use strict';var ChatWebsiteEvents=require(_0x7685('0x0'));var events=[_0x7685('0x1'),'remove','update'];function createListener(_0x29f57d,_0x4c533b){return function(_0x3cdcbc){_0x4c533b[_0x7685('0x2')](_0x29f57d,_0x3cdcbc);};}function removeListener(_0x5af731,_0x398126){return function(){ChatWebsiteEvents[_0x7685('0x3')](_0x5af731,_0x398126);};}exports[_0x7685('0x4')]=function(_0x2bb4a4){for(var _0x5d51c4=0x0,_0x33cdfb=events[_0x7685('0x5')];_0x5d51c4<_0x33cdfb;_0x5d51c4++){var _0x4ee7d1=events[_0x5d51c4];var _0x4d5533=createListener('chatWebsite:'+_0x4ee7d1,_0x2bb4a4);ChatWebsiteEvents['on'](_0x4ee7d1,_0x4d5533);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index e4aa780..bac1fcf 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd4a2=['../../../utils/misc','URL','localhost','test','replace','([\x5cw]+)','exports'];(function(_0x5ed5e4,_0x15d7fc){var _0xcc956a=function(_0x53130a){while(--_0x53130a){_0x5ed5e4['push'](_0x5ed5e4['shift']());}};_0xcc956a(++_0x15d7fc);}(_0xd4a2,0x173));var _0x2d4a=function(_0x2b158b,_0x224c8d){_0x2b158b=_0x2b158b-0x0;var _0x46ba5b=_0xd4a2[_0x2b158b];return _0x46ba5b;};var escapeRegExp=require(_0x2d4a('0x0'))['escapeRegExp'];var URL=require('url')[_0x2d4a('0x1')];function testWildcardValidity(_0x576ffe){var _0x2a8a71=!![];try{new URL(_0x576ffe['replace']('*',_0x2d4a('0x2')));}catch(_0x5d435a){_0x2a8a71=![];}return _0x2a8a71&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x2d4a('0x3')](_0x576ffe);}function testWebsiteWithWildcard(_0x40d744,_0x2624b5){var _0x3a88e2;var _0x1ca10b=escapeRegExp(_0x40d744['trim']()[_0x2d4a('0x4')](/\/$/,''))[_0x2d4a('0x4')]('\x5c*',_0x2d4a('0x5'));try{new URL(_0x40d744[_0x2d4a('0x4')]('\x5c*',_0x2d4a('0x2')));_0x3a88e2=new RegExp(_0x1ca10b)[_0x2d4a('0x3')](_0x2624b5);}catch(_0xb9f016){_0x3a88e2=![];}return _0x3a88e2;}module[_0x2d4a('0x6')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x16a2=['localhost','test','trim','replace','([\x5cw]+)','../../../utils/misc','escapeRegExp','url','URL'];(function(_0x884913,_0x2ef196){var _0x13e338=function(_0x254a09){while(--_0x254a09){_0x884913['push'](_0x884913['shift']());}};_0x13e338(++_0x2ef196);}(_0x16a2,0x1d0));var _0x216a=function(_0x5c1345,_0x40116e){_0x5c1345=_0x5c1345-0x0;var _0x1c070d=_0x16a2[_0x5c1345];return _0x1c070d;};var escapeRegExp=require(_0x216a('0x0'))[_0x216a('0x1')];var URL=require(_0x216a('0x2'))[_0x216a('0x3')];function testWildcardValidity(_0x194a77){var _0x4fb28f=!![];try{new URL(_0x194a77['replace']('*',_0x216a('0x4')));}catch(_0x22c4a1){_0x4fb28f=![];}return _0x4fb28f&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x216a('0x5')](_0x194a77);}function testWebsiteWithWildcard(_0x188a8d,_0x5d5f57){var _0x4d97cd;var _0x4456ad=escapeRegExp(_0x188a8d[_0x216a('0x6')]()[_0x216a('0x7')](/\/$/,''))['replace']('\x5c*',_0x216a('0x8'));try{new URL(_0x188a8d[_0x216a('0x7')]('\x5c*',_0x216a('0x4')));_0x4d97cd=new RegExp(_0x4456ad)[_0x216a('0x5')](_0x5d5f57);}catch(_0x4ce00d){_0x4d97cd=![];}return _0x4d97cd;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 7dc314f..3d29a41 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 _0xcef5=['root','server/files/images/logos/','format','%s-%s','originalname','single','addLogo','server/files/images/avatars/','now','/:id/avatar','file','/:id/system_avatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','addInteraction','addApplications','/:id/users','addAgents','put','/:id','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','getFields','getAgents','post','create','addDisposition','addAnswer','diskStorage','join'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xcef5,0xec));var _0x5cef=function(_0x5115ad,_0x3e199d){_0x5115ad=_0x5115ad-0x0;var _0xa47006=_0xcef5[_0x5115ad];return _0xa47006;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5cef('0x0'));var express=require(_0x5cef('0x1'));var router=express[_0x5cef('0x2')]();var fs_extra=require(_0x5cef('0x3'));var auth=require(_0x5cef('0x4'));var interaction=require(_0x5cef('0x5'));var config=require(_0x5cef('0x6'));var controller=require(_0x5cef('0x7'));router[_0x5cef('0x8')]('/',auth[_0x5cef('0x9')](),controller[_0x5cef('0xa')]);router[_0x5cef('0x8')](_0x5cef('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x5cef('0x9')](),controller[_0x5cef('0xc')]);router[_0x5cef('0x8')](_0x5cef('0xd'),auth[_0x5cef('0x9')](),controller[_0x5cef('0xe')]);router['get'](_0x5cef('0xf'),auth[_0x5cef('0x9')](),controller[_0x5cef('0x10')]);router[_0x5cef('0x8')](_0x5cef('0x11'),controller[_0x5cef('0x12')]);router[_0x5cef('0x8')]('/:id/avatar',controller[_0x5cef('0x13')]);router['get'](_0x5cef('0x14'),controller['getCustomerAvatar']);router['get']('/:id/system_avatar',controller[_0x5cef('0x15')]);router[_0x5cef('0x8')](_0x5cef('0x16'),auth[_0x5cef('0x9')](),controller[_0x5cef('0x17')]);router['get']('/:id/snippet',controller[_0x5cef('0x18')]);router[_0x5cef('0x8')](_0x5cef('0x19'),auth['isAuthenticated'](),controller['getApplications']);router[_0x5cef('0x8')](_0x5cef('0x1a'),auth[_0x5cef('0x9')](),controller[_0x5cef('0x1b')]);router['get']('/:id/fields',controller[_0x5cef('0x1c')]);router[_0x5cef('0x8')]('/:id/offline_messages',auth[_0x5cef('0x9')](),controller['getOfflineMessages']);router[_0x5cef('0x8')]('/:id/users',auth[_0x5cef('0x9')](),controller[_0x5cef('0x1d')]);router[_0x5cef('0x1e')]('/',auth[_0x5cef('0x9')](),controller[_0x5cef('0x1f')]);router[_0x5cef('0x1e')](_0x5cef('0xd'),auth[_0x5cef('0x9')](),controller[_0x5cef('0x20')]);router['post'](_0x5cef('0xf'),auth[_0x5cef('0x9')](),controller[_0x5cef('0x21')]);var upload=multer({'storage':multer[_0x5cef('0x22')]({'destination':function(_0x11fe3f,_0x34e478,_0x9413a0){_0x9413a0(null,path[_0x5cef('0x23')](config[_0x5cef('0x24')],_0x5cef('0x25')));},'filename':function(_0x513dd5,_0x1cee41,_0x3511dd){_0x3511dd(null,util[_0x5cef('0x26')](_0x5cef('0x27'),Date['now'](),_0x1cee41[_0x5cef('0x28')]));}})});router['post']('/:id/logo',upload[_0x5cef('0x29')]('file'),controller[_0x5cef('0x2a')]);var upload=multer({'storage':multer[_0x5cef('0x22')]({'destination':function(_0x273fc7,_0x3384ea,_0x32b6a8){_0x32b6a8(null,path[_0x5cef('0x23')](config[_0x5cef('0x24')],_0x5cef('0x2b')));},'filename':function(_0x51f3a4,_0x3eae48,_0x3f8166){_0x3f8166(null,util[_0x5cef('0x26')]('%s-%s',Date[_0x5cef('0x2c')](),_0x3eae48[_0x5cef('0x28')]));}})});router[_0x5cef('0x1e')](_0x5cef('0x2d'),upload[_0x5cef('0x29')](_0x5cef('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer[_0x5cef('0x22')]({'destination':function(_0x504378,_0x4a5c6f,_0x1cdcb0){_0x1cdcb0(null,path['join'](config[_0x5cef('0x24')],_0x5cef('0x2b')));},'filename':function(_0xb7bcdf,_0x59fb69,_0x29088c){_0x29088c(null,util[_0x5cef('0x26')]('%s-%s',Date['now'](),_0x59fb69[_0x5cef('0x28')]));}})});router[_0x5cef('0x1e')]('/:id/customer_avatar',upload['single'](_0x5cef('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x333bcf,_0x484ac3,_0x53b6ab){_0x53b6ab(null,path['join'](config[_0x5cef('0x24')],_0x5cef('0x2b')));},'filename':function(_0x57af9d,_0x41154e,_0x4d09ca){_0x4d09ca(null,util[_0x5cef('0x26')](_0x5cef('0x27'),Date[_0x5cef('0x2c')](),_0x41154e[_0x5cef('0x28')]));}})});router[_0x5cef('0x1e')](_0x5cef('0x2f'),upload[_0x5cef('0x29')](_0x5cef('0x2e')),controller[_0x5cef('0x30')]);router['post'](_0x5cef('0x31'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x5cef('0x22')]({'destination':function(_0x3b20ba,_0x5f0e6f,_0x1c5b65){const _0x57f868=path[_0x5cef('0x23')](config['root'],_0x5cef('0x32'),_0x5cef('0x33'),_0x5cef('0x34'));fs_extra[_0x5cef('0x35')](_0x57f868,function(){_0x1c5b65(null,_0x57f868);});},'filename':function(_0x182f61,_0x25c8df,_0x59fbc4){const _0x2a1b9a=_0x25c8df['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xd8ae88=path[_0x5cef('0x36')](_0x2a1b9a);const _0x3f990f=Date[_0x5cef('0x2c')]()+'-'+_0x2a1b9a[_0x5cef('0x37')](_0xd8ae88,'')+_0xd8ae88;_0x59fbc4(null,_0x3f990f);}})});router['post'](_0x5cef('0x38'),offlineUploadMulter[_0x5cef('0x39')](),controller['offline']);router[_0x5cef('0x1e')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x5cef('0x3a')]);router[_0x5cef('0x1e')](_0x5cef('0x19'),auth['isAuthenticated'](),controller[_0x5cef('0x3b')]);router[_0x5cef('0x1e')](_0x5cef('0x1a'),auth[_0x5cef('0x9')](),controller['addProactiveActions']);router['post'](_0x5cef('0x3c'),auth['isAuthenticated'](),controller[_0x5cef('0x3d')]);router[_0x5cef('0x3e')](_0x5cef('0x3f'),auth['isAuthenticated'](),controller[_0x5cef('0x40')]);router[_0x5cef('0x41')](_0x5cef('0x3f'),auth[_0x5cef('0x9')](),controller[_0x5cef('0x42')]);router[_0x5cef('0x41')](_0x5cef('0xd'),auth[_0x5cef('0x9')](),controller['removeDispositions']);router[_0x5cef('0x41')](_0x5cef('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x5cef('0x3c'),auth[_0x5cef('0x9')](),controller['removeAgents']);module[_0x5cef('0x43')]=router;
\ No newline at end of file
+var _0x5a1a=['addLogo','join','root','addAvatar','server/files/images/avatars/','now','/:id/customer_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','diskStorage','server/files/images/logos/','format','%s-%s','originalname','single','file'];(function(_0x41ed8a,_0x5918cb){var _0x37b0c8=function(_0xcd5072){while(--_0xcd5072){_0x41ed8a['push'](_0x41ed8a['shift']());}};_0x37b0c8(++_0x5918cb);}(_0x5a1a,0x1bc));var _0xa5a1=function(_0x1f8921,_0x38bd21){_0x1f8921=_0x1f8921-0x0;var _0x2c2f34=_0x5a1a[_0x1f8921];return _0x2c2f34;};'use strict';var multer=require('multer');var util=require(_0xa5a1('0x0'));var path=require(_0xa5a1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa5a1('0x2')]();var fs_extra=require(_0xa5a1('0x3'));var auth=require(_0xa5a1('0x4'));var interaction=require(_0xa5a1('0x5'));var config=require(_0xa5a1('0x6'));var controller=require('./chatWebsite.controller');router[_0xa5a1('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xa5a1('0x8')](),controller[_0xa5a1('0x9')]);router[_0xa5a1('0x7')]('/:id',auth[_0xa5a1('0x8')](),controller[_0xa5a1('0xa')]);router['get'](_0xa5a1('0xb'),auth[_0xa5a1('0x8')](),controller[_0xa5a1('0xc')]);router['get'](_0xa5a1('0xd'),auth[_0xa5a1('0x8')](),controller[_0xa5a1('0xe')]);router[_0xa5a1('0x7')](_0xa5a1('0xf'),controller['getLogo']);router[_0xa5a1('0x7')](_0xa5a1('0x10'),controller[_0xa5a1('0x11')]);router['get']('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0xa5a1('0x7')](_0xa5a1('0x12'),controller[_0xa5a1('0x13')]);router[_0xa5a1('0x7')](_0xa5a1('0x14'),auth[_0xa5a1('0x8')](),controller['getInteractions']);router[_0xa5a1('0x7')]('/:id/snippet',controller['getSnippet']);router['get']('/:id/applications',auth[_0xa5a1('0x8')](),controller[_0xa5a1('0x15')]);router[_0xa5a1('0x7')](_0xa5a1('0x16'),auth[_0xa5a1('0x8')](),controller[_0xa5a1('0x17')]);router[_0xa5a1('0x7')]('/:id/fields',controller[_0xa5a1('0x18')]);router['get'](_0xa5a1('0x19'),auth[_0xa5a1('0x8')](),controller[_0xa5a1('0x1a')]);router[_0xa5a1('0x7')](_0xa5a1('0x1b'),auth[_0xa5a1('0x8')](),controller[_0xa5a1('0x1c')]);router[_0xa5a1('0x1d')]('/',auth[_0xa5a1('0x8')](),controller[_0xa5a1('0x1e')]);router[_0xa5a1('0x1d')]('/:id/dispositions',auth[_0xa5a1('0x8')](),controller[_0xa5a1('0x1f')]);router[_0xa5a1('0x1d')](_0xa5a1('0xd'),auth[_0xa5a1('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xa5a1('0x20')]({'destination':function(_0x40c22e,_0x375a86,_0x130a78){_0x130a78(null,path['join'](config['root'],_0xa5a1('0x21')));},'filename':function(_0xa5326e,_0x2cbc26,_0x54db61){_0x54db61(null,util[_0xa5a1('0x22')](_0xa5a1('0x23'),Date['now'](),_0x2cbc26[_0xa5a1('0x24')]));}})});router[_0xa5a1('0x1d')](_0xa5a1('0xf'),upload[_0xa5a1('0x25')](_0xa5a1('0x26')),controller[_0xa5a1('0x27')]);var upload=multer({'storage':multer[_0xa5a1('0x20')]({'destination':function(_0x161dfa,_0x2118aa,_0x2aa6c0){_0x2aa6c0(null,path[_0xa5a1('0x28')](config[_0xa5a1('0x29')],'server/files/images/avatars/'));},'filename':function(_0x4b56b4,_0x48bf0d,_0x57faaa){_0x57faaa(null,util[_0xa5a1('0x22')](_0xa5a1('0x23'),Date['now'](),_0x48bf0d['originalname']));}})});router[_0xa5a1('0x1d')](_0xa5a1('0x10'),upload[_0xa5a1('0x25')](_0xa5a1('0x26')),controller[_0xa5a1('0x2a')]);var upload=multer({'storage':multer[_0xa5a1('0x20')]({'destination':function(_0x52d13c,_0x299d55,_0x1ac714){_0x1ac714(null,path[_0xa5a1('0x28')](config[_0xa5a1('0x29')],_0xa5a1('0x2b')));},'filename':function(_0x2d9b5b,_0x115b77,_0x15956c){_0x15956c(null,util[_0xa5a1('0x22')]('%s-%s',Date[_0xa5a1('0x2c')](),_0x115b77['originalname']));}})});router['post'](_0xa5a1('0x2d'),upload['single'](_0xa5a1('0x26')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2043ba,_0x1bca85,_0x3b3606){_0x3b3606(null,path[_0xa5a1('0x28')](config[_0xa5a1('0x29')],_0xa5a1('0x2b')));},'filename':function(_0xf39581,_0x255fc6,_0x1eafda){_0x1eafda(null,util[_0xa5a1('0x22')](_0xa5a1('0x23'),Date[_0xa5a1('0x2c')](),_0x255fc6[_0xa5a1('0x24')]));}})});router[_0xa5a1('0x1d')](_0xa5a1('0x12'),upload[_0xa5a1('0x25')](_0xa5a1('0x26')),controller[_0xa5a1('0x2e')]);router[_0xa5a1('0x1d')](_0xa5a1('0x2f'),controller[_0xa5a1('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0xa5a1('0x20')]({'destination':function(_0x49ac09,_0x529570,_0x8f730){const _0x223fd7=path[_0xa5a1('0x28')](config[_0xa5a1('0x29')],_0xa5a1('0x31'),_0xa5a1('0x32'),_0xa5a1('0x33'));fs_extra[_0xa5a1('0x34')](_0x223fd7,function(){_0x8f730(null,_0x223fd7);});},'filename':function(_0x4cc354,_0x9855a2,_0x249482){const _0x2338a8=_0x9855a2[_0xa5a1('0x24')][_0xa5a1('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x9a6fad=path[_0xa5a1('0x36')](_0x2338a8);const _0x1c8a01=Date[_0xa5a1('0x2c')]()+'-'+_0x2338a8[_0xa5a1('0x35')](_0x9a6fad,'')+_0x9a6fad;_0x249482(null,_0x1c8a01);}})});router[_0xa5a1('0x1d')]('/:id/offline',offlineUploadMulter[_0xa5a1('0x37')](),controller[_0xa5a1('0x38')]);router[_0xa5a1('0x1d')]('/:id/interactions',auth[_0xa5a1('0x8')](),controller[_0xa5a1('0x39')]);router[_0xa5a1('0x1d')]('/:id/applications',auth[_0xa5a1('0x8')](),controller[_0xa5a1('0x3a')]);router[_0xa5a1('0x1d')](_0xa5a1('0x16'),auth[_0xa5a1('0x8')](),controller[_0xa5a1('0x3b')]);router[_0xa5a1('0x1d')](_0xa5a1('0x1b'),auth['isAuthenticated'](),controller[_0xa5a1('0x3c')]);router[_0xa5a1('0x3d')](_0xa5a1('0x3e'),auth[_0xa5a1('0x8')](),controller['update']);router[_0xa5a1('0x3f')](_0xa5a1('0x3e'),auth[_0xa5a1('0x8')](),controller[_0xa5a1('0x40')]);router[_0xa5a1('0x3f')](_0xa5a1('0xb'),auth[_0xa5a1('0x8')](),controller[_0xa5a1('0x41')]);router[_0xa5a1('0x3f')]('/:id/canned_answers',auth[_0xa5a1('0x8')](),controller[_0xa5a1('0x42')]);router[_0xa5a1('0x3f')](_0xa5a1('0x1b'),auth[_0xa5a1('0x8')](),controller[_0xa5a1('0x43')]);module[_0xa5a1('0x44')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 823b697..a589bfe 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 _0x2940=['beaver-logger/server','express','../components/auth/service','../config/environment','production','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','exports'];(function(_0x27604f,_0x5ae336){var _0x40d189=function(_0xebacde){while(--_0xebacde){_0x27604f['push'](_0x27604f['shift']());}};_0x40d189(++_0x5ae336);}(_0x2940,0xb4));var _0x0294=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0x2940[_0x1fafa5];return _0xcf08c9;};var beaverLogger=require(_0x0294('0x0'));var express=require(_0x0294('0x1'));var auth=require(_0x0294('0x2'));var config=require(_0x0294('0x3'));var router=express['Router']();var isProduction=config['env']===_0x0294('0x4')||![];function clientSideLogs(_0x12caab,_0x174db1,_0x18798c){var _0x4002db=_0x12caab['app'][_0x0294('0x5')](_0x0294('0x6'));if(!_0x4002db){throw new Error(_0x0294('0x7'));}return beaverLogger[_0x0294('0x8')]({'uri':_0x0294('0x9'),'logger':_0x4002db,'enableCors':!isProduction})(_0x12caab,_0x174db1,_0x18798c);}router['use'](auth[_0x0294('0xa')](),clientSideLogs);module[_0x0294('0xb')]=router;
\ No newline at end of file
+var _0x20fe=['env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','express','../config/environment'];(function(_0x192cca,_0x2d27c3){var _0x434f47=function(_0x2fae2a){while(--_0x2fae2a){_0x192cca['push'](_0x192cca['shift']());}};_0x434f47(++_0x2d27c3);}(_0x20fe,0xb3));var _0xe20f=function(_0x27a7f0,_0x1f638c){_0x27a7f0=_0x27a7f0-0x0;var _0x3b586a=_0x20fe[_0x27a7f0];return _0x3b586a;};var beaverLogger=require(_0xe20f('0x0'));var express=require(_0xe20f('0x1'));var auth=require('../components/auth/service');var config=require(_0xe20f('0x2'));var router=express['Router']();var isProduction=config[_0xe20f('0x3')]===_0xe20f('0x4')||![];function clientSideLogs(_0x484c5a,_0x5e445a,_0x44d761){var _0x186899=_0x484c5a[_0xe20f('0x5')][_0xe20f('0x6')](_0xe20f('0x7'));if(!_0x186899){throw new Error(_0xe20f('0x8'));}return beaverLogger[_0xe20f('0x9')]({'uri':'/client-logs','logger':_0x186899,'enableCors':!isProduction})(_0x484c5a,_0x5e445a,_0x44d761);}router[_0xe20f('0xa')](auth[_0xe20f('0xb')](),clientSideLogs);module[_0xe20f('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index f449af6..c00b4be 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 _0xfbad=['ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING'];(function(_0x3d3ae9,_0x334c52){var _0x31b364=function(_0x6aa61c){while(--_0x6aa61c){_0x3d3ae9['push'](_0x3d3ae9['shift']());}};_0x31b364(++_0x334c52);}(_0xfbad,0x129));var _0xdfba=function(_0xc86286,_0x47ec96){_0xc86286=_0xc86286-0x0;var _0x5df59d=_0xfbad[_0xc86286];return _0x5df59d;};'use strict';var Sequelize=require(_0xdfba('0x0'));module[_0xdfba('0x1')]={'name':{'type':Sequelize[_0xdfba('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xdfba('0x3')](_0xdfba('0x4'),_0xdfba('0x5'),_0xdfba('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xdfba('0x3')](_0xdfba('0x7'),_0xdfba('0x8'))},'data1':{'type':Sequelize[_0xdfba('0x2')],'comment':_0xdfba('0x9')},'data2':{'type':Sequelize[_0xdfba('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xdfba('0x2')],'comment':_0xdfba('0xa')},'data4':{'type':Sequelize['STRING'],'comment':_0xdfba('0xb')},'data5':{'type':Sequelize[_0xdfba('0xc')],'comment':_0xdfba('0xd')},'data6':{'type':Sequelize[_0xdfba('0xc')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xdfba('0xc')],'comment':_0xdfba('0xe')}};
\ No newline at end of file
+var _0xd7b7=['ENUM','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING'];(function(_0x1c9c9b,_0x26e0cf){var _0x3ec604=function(_0x4d2c52){while(--_0x4d2c52){_0x1c9c9b['push'](_0x1c9c9b['shift']());}};_0x3ec604(++_0x26e0cf);}(_0xd7b7,0x135));var _0x7d7b=function(_0x1d5441,_0x5214a9){_0x1d5441=_0x1d5441-0x0;var _0x165157=_0xd7b7[_0x1d5441];return _0x165157;};'use strict';var Sequelize=require(_0x7d7b('0x0'));module[_0x7d7b('0x1')]={'name':{'type':Sequelize[_0x7d7b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7d7b('0x3')]('AmazonAWS','Google',_0x7d7b('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x7d7b('0x5'),_0x7d7b('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0x7d7b('0x7')},'data2':{'type':Sequelize[_0x7d7b('0x2')],'comment':_0x7d7b('0x8')},'data3':{'type':Sequelize[_0x7d7b('0x2')],'comment':_0x7d7b('0x9')},'data4':{'type':Sequelize[_0x7d7b('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x7d7b('0xa')],'comment':_0x7d7b('0xb')},'data6':{'type':Sequelize[_0x7d7b('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x7d7b('0xa')],'comment':_0x7d7b('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 2f366d5..b0f23d8 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 _0xe236=['show','params','includeAll','include','find','body','Name\x20parameter\x20not\x20specified','values','includes','join','encryptString','create','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','parse','from','base64','isValidIdToken','id_token','oauth2Claims','getOauth2MicrosoftAccessToken','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','end','stack','name','slice','index','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','merge','options','service','MicrosoftAzure','decryptString','data3','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe236,0x136));var _0x6e23=function(_0x438fe1,_0x3308d5){_0x438fe1=_0x438fe1-0x0;var _0x3c8e1b=_0xe236[_0x438fe1];return _0x3c8e1b;};'use strict';var _=require('lodash');var Redis=require(_0x6e23('0x0'));var qs=require(_0x6e23('0x1'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x6e23('0x2'))(_0x6e23('0x3'));var db=require(_0x6e23('0x4'))['db'];var oauth=require(_0x6e23('0x5'));config[_0x6e23('0x6')]=_[_0x6e23('0x7')](config[_0x6e23('0x6')],{'host':_0x6e23('0x8'),'port':0x18eb});var socket=require(_0x6e23('0x9'))(new Redis(config[_0x6e23('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x5d44f3,_0x3b5538){_0x3b5538=_0x3b5538||0xcc;return function(_0x1c42cc){if(_0x1c42cc){return _0x5d44f3[_0x6e23('0xa')](_0x3b5538);}return _0x5d44f3[_0x6e23('0xb')](_0x3b5538)['end']();};}function respondWithResult(_0xbfe41e,_0x5d6547){_0x5d6547=_0x5d6547||0xc8;return function(_0x51bd18){if(_0x51bd18){return _0xbfe41e[_0x6e23('0xb')](_0x5d6547)['json'](_0x51bd18);}};}function respondWithFilteredResult(_0x9910ea,_0x2adfd6){return function(_0x4eb056){if(_0x4eb056){var _0x3eb104=typeof _0x2adfd6[_0x6e23('0xc')]===_0x6e23('0xd')&&typeof _0x2adfd6['limit']==='undefined';var _0x12e000=_0x4eb056[_0x6e23('0xe')];var _0x576aa3=_0x3eb104?0x0:_0x2adfd6['offset'];var _0x851b76=_0x3eb104?_0x4eb056[_0x6e23('0xe')]:_0x2adfd6['offset']+_0x2adfd6[_0x6e23('0xf')];var _0x3aa387;if(_0x851b76>=_0x12e000){_0x851b76=_0x12e000;_0x3aa387=0xc8;}else{_0x3aa387=0xce;}_0x9910ea[_0x6e23('0xb')](_0x3aa387);return _0x9910ea[_0x6e23('0x10')](_0x6e23('0x11'),_0x576aa3+'-'+_0x851b76+'/'+_0x12e000)[_0x6e23('0x12')](_0x4eb056);}return null;};}function saveUpdates(_0x5691c0){return function(_0x4f0666){if(_0x4f0666){return _0x4f0666[_0x6e23('0x13')](_0x5691c0)[_0x6e23('0x14')](function(_0x2ebaaf){return _0x2ebaaf;});}return null;};}function removeEntity(_0x43807c){return function(_0xe6dace){if(_0xe6dace){return _0xe6dace[_0x6e23('0x15')]()[_0x6e23('0x14')](function(){_0x43807c[_0x6e23('0xb')](0xcc)[_0x6e23('0x16')]();});}};}function handleEntityNotFound(_0x3db11b){return function(_0x4a6300){if(!_0x4a6300){_0x3db11b['sendStatus'](0x194);}return _0x4a6300;};}function handleError(_0x500e3b,_0x1df26d){_0x1df26d=_0x1df26d||0x1f4;return function(_0x38ac20){logger['error'](_0x38ac20[_0x6e23('0x17')]);if(_0x38ac20['name']){delete _0x38ac20[_0x6e23('0x18')];}_0x500e3b[_0x6e23('0xb')](_0x1df26d)['send'](_0x38ac20);};}function maskClientSecret(_0x5f31a9){return _['padEnd'](_0x5f31a9[_0x6e23('0x19')](0x0,0x3),0x14,'*');}exports[_0x6e23('0x1a')]=function(_0x520dce,_0xb8f65f){var _0x1e9f4c={},_0x51667c={},_0x5b4fc9={'count':0x0,'rows':[]};var _0x32b003=_['map'](db[_0x6e23('0x1b')][_0x6e23('0x1c')],function(_0xb0f322){return{'name':_0xb0f322[_0x6e23('0x1d')],'type':_0xb0f322[_0x6e23('0x1e')][_0x6e23('0x1f')]};});_0x51667c[_0x6e23('0x20')]=_['map'](_0x32b003,_0x6e23('0x18'));_0x51667c[_0x6e23('0x21')]=_[_0x6e23('0x22')](_0x520dce['query']);_0x51667c[_0x6e23('0x23')]=_[_0x6e23('0x24')](_0x51667c[_0x6e23('0x20')],_0x51667c['query']);_0x1e9f4c[_0x6e23('0x25')]=_[_0x6e23('0x24')](_0x51667c[_0x6e23('0x20')],qs['fields'](_0x520dce[_0x6e23('0x21')][_0x6e23('0x26')]));_0x1e9f4c['attributes']=_0x1e9f4c[_0x6e23('0x25')][_0x6e23('0x27')]?_0x1e9f4c[_0x6e23('0x25')]:_0x51667c[_0x6e23('0x20')];if(!_0x520dce[_0x6e23('0x21')][_0x6e23('0x28')](_0x6e23('0x29'))){_0x1e9f4c[_0x6e23('0xf')]=qs[_0x6e23('0xf')](_0x520dce['query'][_0x6e23('0xf')]);_0x1e9f4c['offset']=qs[_0x6e23('0xc')](_0x520dce[_0x6e23('0x21')][_0x6e23('0xc')]);}_0x1e9f4c['order']=qs['sort'](_0x520dce[_0x6e23('0x21')][_0x6e23('0x2a')]);_0x1e9f4c[_0x6e23('0x2b')]=qs[_0x6e23('0x23')](_[_0x6e23('0x2c')](_0x520dce[_0x6e23('0x21')],_0x51667c[_0x6e23('0x23')]),_0x32b003);if(_0x520dce['query'][_0x6e23('0x2d')]){_0x1e9f4c[_0x6e23('0x2b')]=_['merge'](_0x1e9f4c['where'],{'$or':_[_0x6e23('0x2e')](_0x32b003,function(_0xe2104d){if(_0xe2104d[_0x6e23('0x1e')]!=='VIRTUAL'){var _0x51b60f={};_0x51b60f[_0xe2104d[_0x6e23('0x18')]]={'$like':'%'+_0x520dce[_0x6e23('0x21')][_0x6e23('0x2d')]+'%'};return _0x51b60f;}})});}_0x1e9f4c=_[_0x6e23('0x2f')]({},_0x1e9f4c,_0x520dce[_0x6e23('0x30')]);var _0x4b9d36={'where':_0x1e9f4c[_0x6e23('0x2b')]};return db[_0x6e23('0x1b')]['count'](_0x4b9d36)[_0x6e23('0x14')](function(_0x171fd7){_0x5b4fc9[_0x6e23('0xe')]=_0x171fd7;if(_0x520dce[_0x6e23('0x21')]['includeAll']){_0x1e9f4c['include']=[{'all':!![]}];}return db[_0x6e23('0x1b')]['findAll'](_0x1e9f4c);})['then'](function(_0x4636a4){_0x5b4fc9['rows']=_['map'](_0x4636a4,function(_0x9ebe90){if(_0x9ebe90[_0x6e23('0x31')]===_0x6e23('0x32')){var _0x553b3d=encryptor[_0x6e23('0x33')](_0x9ebe90['data3']);_0x9ebe90[_0x6e23('0x34')]=maskClientSecret(_0x553b3d);}return _0x9ebe90;});return _0x5b4fc9;})['then'](respondWithFilteredResult(_0xb8f65f,_0x1e9f4c))[_0x6e23('0x35')](handleError(_0xb8f65f,null));};exports[_0x6e23('0x36')]=function(_0x1cfb5c,_0x247135){var _0xb88ec1={'raw':!![],'where':{'id':_0x1cfb5c[_0x6e23('0x37')]['id']}},_0x1a9098={};_0x1a9098['model']=_['keys'](db[_0x6e23('0x1b')]['rawAttributes']);_0x1a9098[_0x6e23('0x21')]=_[_0x6e23('0x22')](_0x1cfb5c['query']);_0x1a9098[_0x6e23('0x23')]=_[_0x6e23('0x24')](_0x1a9098[_0x6e23('0x20')],_0x1a9098['query']);_0xb88ec1[_0x6e23('0x25')]=_[_0x6e23('0x24')](_0x1a9098[_0x6e23('0x20')],qs[_0x6e23('0x26')](_0x1cfb5c[_0x6e23('0x21')]['fields']));_0xb88ec1[_0x6e23('0x25')]=_0xb88ec1[_0x6e23('0x25')][_0x6e23('0x27')]?_0xb88ec1[_0x6e23('0x25')]:_0x1a9098[_0x6e23('0x20')];if(_0x1cfb5c[_0x6e23('0x21')][_0x6e23('0x38')]){_0xb88ec1[_0x6e23('0x39')]=[{'all':!![]}];}_0xb88ec1=_[_0x6e23('0x2f')]({},_0xb88ec1,_0x1cfb5c[_0x6e23('0x30')]);return db[_0x6e23('0x1b')][_0x6e23('0x3a')](_0xb88ec1)[_0x6e23('0x14')](handleEntityNotFound(_0x247135,null))[_0x6e23('0x14')](function(_0x2eecb1){if(_0x2eecb1[_0x6e23('0x31')]===_0x6e23('0x32')){var _0x385956=encryptor[_0x6e23('0x33')](_0x2eecb1[_0x6e23('0x34')]);_0x2eecb1['data3']=maskClientSecret(_0x385956);}return _0x2eecb1;})[_0x6e23('0x14')](respondWithResult(_0x247135,null))[_0x6e23('0x35')](handleError(_0x247135,null));};exports['create']=function(_0x3f616c,_0x169120){if(!_0x3f616c[_0x6e23('0x3b')][_0x6e23('0x18')])throw new Error(_0x6e23('0x3c'));if(!_0x3f616c['body'][_0x6e23('0x31')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x2931f0=db[_0x6e23('0x1b')][_0x6e23('0x1c')][_0x6e23('0x31')][_0x6e23('0x3d')];if(!_0x2931f0[_0x6e23('0x3e')](_0x3f616c[_0x6e23('0x3b')][_0x6e23('0x31')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x2931f0[_0x6e23('0x3f')](',\x20'));if(_0x3f616c['body'][_0x6e23('0x31')]===_0x6e23('0x32')&&_0x3f616c[_0x6e23('0x3b')][_0x6e23('0x34')]){_0x3f616c[_0x6e23('0x3b')][_0x6e23('0x34')]=encryptor[_0x6e23('0x40')](_0x3f616c[_0x6e23('0x3b')][_0x6e23('0x34')]);}return db['CloudProvider'][_0x6e23('0x41')](_0x3f616c[_0x6e23('0x3b')],{})['then'](respondWithResult(_0x169120,0xc9))[_0x6e23('0x35')](handleError(_0x169120,null));};exports[_0x6e23('0x13')]=function(_0x56a15f,_0x63db8e){if(_0x56a15f[_0x6e23('0x3b')]['id']){delete _0x56a15f[_0x6e23('0x3b')]['id'];}return db[_0x6e23('0x1b')][_0x6e23('0x3a')]({'where':{'id':_0x56a15f[_0x6e23('0x37')]['id']}})[_0x6e23('0x14')](handleEntityNotFound(_0x63db8e,null))[_0x6e23('0x14')](function(_0x485f23){if(_0x485f23[_0x6e23('0x31')]==='MicrosoftAzure'&&_0x56a15f[_0x6e23('0x3b')][_0x6e23('0x34')]){_0x56a15f['body'][_0x6e23('0x34')]=encryptor[_0x6e23('0x40')](_0x56a15f[_0x6e23('0x3b')]['data3']);}return _0x485f23;})[_0x6e23('0x14')](saveUpdates(_0x56a15f['body'],null))['then'](respondWithResult(_0x63db8e,null))[_0x6e23('0x35')](handleError(_0x63db8e,null));};exports[_0x6e23('0x15')]=function(_0x457c4f,_0x54c058){return db['CloudProvider'][_0x6e23('0x3a')]({'where':{'id':_0x457c4f[_0x6e23('0x37')]['id']}})[_0x6e23('0x14')](handleEntityNotFound(_0x54c058,null))[_0x6e23('0x14')](removeEntity(_0x54c058,null))[_0x6e23('0x35')](handleError(_0x54c058,null));};exports[_0x6e23('0x42')]=function(_0x4cef1e,_0xe0539a){return db[_0x6e23('0x1b')][_0x6e23('0x43')]({'where':{'id':_0x4cef1e[_0x6e23('0x37')]['id']},'raw':!![]})['then'](function(_0x1fe5d1){if(!_0x1fe5d1)return _0xe0539a[_0x6e23('0xa')](0x194);return{'url':oauth[_0x6e23('0x44')](_0x1fe5d1,_0x4cef1e[_0x6e23('0x45')]['id'])};})[_0x6e23('0x14')](respondWithResult(_0xe0539a,null))[_0x6e23('0x35')](handleError(_0xe0539a,null));};exports[_0x6e23('0x46')]=function(_0x8e0d89,_0x45f3ef){var _0x59718a=_0x8e0d89[_0x6e23('0x3b')];var _0x536c9f;var _0x243b0b;if(_0x59718a[_0x6e23('0x47')])throw _0x59718a;redis[_0x6e23('0x48')](_0x59718a[_0x6e23('0x49')])[_0x6e23('0x14')](function(_0x46eb44){if(!_0x46eb44)throw new Error(_0x6e23('0x4a'));_0x536c9f=JSON[_0x6e23('0x4b')](_0x46eb44);var _0x378b60=Buffer[_0x6e23('0x4c')](_0x59718a[_0x6e23('0x49')],_0x6e23('0x4d'))['toString']('ascii');_0x243b0b=JSON[_0x6e23('0x4b')](_0x378b60);if(!oauth[_0x6e23('0x4e')](_0x59718a[_0x6e23('0x4f')],_0x536c9f[_0x6e23('0x50')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x59718a[_0x6e23('0x49')]);return oauth[_0x6e23('0x51')](_0x59718a['code'],_0x536c9f);})[_0x6e23('0x14')](function(_0x273c3c){_0x536c9f['data5']=_0x273c3c['access_token'];_0x536c9f[_0x6e23('0x52')]=_0x273c3c[_0x6e23('0x53')];return db[_0x6e23('0x1b')][_0x6e23('0x13')]({'data5':_0x536c9f['data5'],'data6':_0x536c9f[_0x6e23('0x52')]},{'where':{'id':_0x536c9f['id']}});})[_0x6e23('0x14')](function(){oauth['startRefreshInterval'](_0x536c9f);socket[_0x6e23('0x54')](_0x6e23('0x55'),{'id':_0x243b0b['id']});return;})[_0x6e23('0x14')](respondWithStatusCode(_0x45f3ef,null))['catch'](function(_0x39076d){if(_0x243b0b){socket[_0x6e23('0x54')](_0x6e23('0x56'),{'id':_0x243b0b['id']});}if(!_0x536c9f){logger[_0x6e23('0x47')](_0x6e23('0x57'),_0x39076d);return _0x45f3ef[_0x6e23('0xb')](0x1f4)['send'](_0x39076d[_0x6e23('0x58')]);}logger[_0x6e23('0x47')](_0x6e23('0x59'),_0x536c9f['id'],JSON[_0x6e23('0x5a')](_0x39076d));});};
\ No newline at end of file
+var _0xd695=['set','Content-Range','destroy','error','stack','send','slice','map','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','CloudProvider','then','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','find','Name\x20parameter\x20not\x20specified','body','service','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','update','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','oauth2Claims','del','getOauth2MicrosoftAccessToken','access_token','refresh_token','data5','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','count'];(function(_0x1d3a5d,_0x17fc32){var _0x257078=function(_0x482f3a){while(--_0x482f3a){_0x1d3a5d['push'](_0x1d3a5d['shift']());}};_0x257078(++_0x17fc32);}(_0xd695,0xad));var _0x5d69=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xd695[_0x17928f];return _0x500b63;};'use strict';var _=require(_0x5d69('0x0'));var Redis=require(_0x5d69('0x1'));var qs=require(_0x5d69('0x2'));var encryptor=require(_0x5d69('0x3'));var config=require(_0x5d69('0x4'));var logger=require(_0x5d69('0x5'))(_0x5d69('0x6'));var db=require('../../mysqldb')['db'];var oauth=require(_0x5d69('0x7'));config[_0x5d69('0x8')]=_['defaults'](config[_0x5d69('0x8')],{'host':_0x5d69('0x9'),'port':0x18eb});var socket=require(_0x5d69('0xa'))(new Redis(config[_0x5d69('0x8')]));var redis=new Redis(config[_0x5d69('0x8')]);function respondWithStatusCode(_0x4f8840,_0x259688){_0x259688=_0x259688||0xcc;return function(_0x40ab60){if(_0x40ab60){return _0x4f8840[_0x5d69('0xb')](_0x259688);}return _0x4f8840[_0x5d69('0xc')](_0x259688)[_0x5d69('0xd')]();};}function respondWithResult(_0x101feb,_0x55d649){_0x55d649=_0x55d649||0xc8;return function(_0x4f8cbe){if(_0x4f8cbe){return _0x101feb['status'](_0x55d649)[_0x5d69('0xe')](_0x4f8cbe);}};}function respondWithFilteredResult(_0x41d642,_0x3405dd){return function(_0x4a671f){if(_0x4a671f){var _0x2e3792=typeof _0x3405dd['offset']==='undefined'&&typeof _0x3405dd['limit']==='undefined';var _0x34c496=_0x4a671f['count'];var _0xb3fb2e=_0x2e3792?0x0:_0x3405dd[_0x5d69('0xf')];var _0xb7c4c3=_0x2e3792?_0x4a671f[_0x5d69('0x10')]:_0x3405dd[_0x5d69('0xf')]+_0x3405dd['limit'];var _0xa5712f;if(_0xb7c4c3>=_0x34c496){_0xb7c4c3=_0x34c496;_0xa5712f=0xc8;}else{_0xa5712f=0xce;}_0x41d642[_0x5d69('0xc')](_0xa5712f);return _0x41d642[_0x5d69('0x11')](_0x5d69('0x12'),_0xb3fb2e+'-'+_0xb7c4c3+'/'+_0x34c496)[_0x5d69('0xe')](_0x4a671f);}return null;};}function saveUpdates(_0x499abb){return function(_0x5638fa){if(_0x5638fa){return _0x5638fa['update'](_0x499abb)['then'](function(_0x2961e3){return _0x2961e3;});}return null;};}function removeEntity(_0x44fc8a){return function(_0x34f7d0){if(_0x34f7d0){return _0x34f7d0[_0x5d69('0x13')]()['then'](function(){_0x44fc8a[_0x5d69('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c59f9){return function(_0x58a46b){if(!_0x58a46b){_0x4c59f9[_0x5d69('0xb')](0x194);}return _0x58a46b;};}function handleError(_0x4026ac,_0x1d6cf4){_0x1d6cf4=_0x1d6cf4||0x1f4;return function(_0x3c5f05){logger[_0x5d69('0x14')](_0x3c5f05[_0x5d69('0x15')]);if(_0x3c5f05['name']){delete _0x3c5f05['name'];}_0x4026ac['status'](_0x1d6cf4)[_0x5d69('0x16')](_0x3c5f05);};}function maskClientSecret(_0x4bb146){return _['padEnd'](_0x4bb146[_0x5d69('0x17')](0x0,0x3),0x14,'*');}exports['index']=function(_0x182c90,_0x492b5b){var _0x14d32a={},_0x2de9ff={},_0x3c21c5={'count':0x0,'rows':[]};var _0x4998a5=_[_0x5d69('0x18')](db['CloudProvider'][_0x5d69('0x19')],function(_0x6ba0f0){return{'name':_0x6ba0f0[_0x5d69('0x1a')],'type':_0x6ba0f0[_0x5d69('0x1b')]['key']};});_0x2de9ff['model']=_[_0x5d69('0x18')](_0x4998a5,_0x5d69('0x1c'));_0x2de9ff[_0x5d69('0x1d')]=_[_0x5d69('0x1e')](_0x182c90[_0x5d69('0x1d')]);_0x2de9ff[_0x5d69('0x1f')]=_[_0x5d69('0x20')](_0x2de9ff[_0x5d69('0x21')],_0x2de9ff['query']);_0x14d32a[_0x5d69('0x22')]=_[_0x5d69('0x20')](_0x2de9ff[_0x5d69('0x21')],qs[_0x5d69('0x23')](_0x182c90[_0x5d69('0x1d')][_0x5d69('0x23')]));_0x14d32a['attributes']=_0x14d32a[_0x5d69('0x22')][_0x5d69('0x24')]?_0x14d32a[_0x5d69('0x22')]:_0x2de9ff[_0x5d69('0x21')];if(!_0x182c90[_0x5d69('0x1d')][_0x5d69('0x25')]('nolimit')){_0x14d32a[_0x5d69('0x26')]=qs['limit'](_0x182c90[_0x5d69('0x1d')][_0x5d69('0x26')]);_0x14d32a[_0x5d69('0xf')]=qs[_0x5d69('0xf')](_0x182c90[_0x5d69('0x1d')][_0x5d69('0xf')]);}_0x14d32a[_0x5d69('0x27')]=qs[_0x5d69('0x28')](_0x182c90[_0x5d69('0x1d')][_0x5d69('0x28')]);_0x14d32a[_0x5d69('0x29')]=qs[_0x5d69('0x1f')](_['pick'](_0x182c90['query'],_0x2de9ff[_0x5d69('0x1f')]),_0x4998a5);if(_0x182c90[_0x5d69('0x1d')][_0x5d69('0x2a')]){_0x14d32a['where']=_[_0x5d69('0x2b')](_0x14d32a[_0x5d69('0x29')],{'$or':_[_0x5d69('0x18')](_0x4998a5,function(_0x152736){if(_0x152736['type']!==_0x5d69('0x2c')){var _0x56a844={};_0x56a844[_0x152736[_0x5d69('0x1c')]]={'$like':'%'+_0x182c90[_0x5d69('0x1d')][_0x5d69('0x2a')]+'%'};return _0x56a844;}})});}_0x14d32a=_[_0x5d69('0x2b')]({},_0x14d32a,_0x182c90[_0x5d69('0x2d')]);var _0x53954e={'where':_0x14d32a[_0x5d69('0x29')]};return db[_0x5d69('0x2e')][_0x5d69('0x10')](_0x53954e)[_0x5d69('0x2f')](function(_0x4a945d){_0x3c21c5[_0x5d69('0x10')]=_0x4a945d;if(_0x182c90[_0x5d69('0x1d')][_0x5d69('0x30')]){_0x14d32a[_0x5d69('0x31')]=[{'all':!![]}];}return db['CloudProvider'][_0x5d69('0x32')](_0x14d32a);})[_0x5d69('0x2f')](function(_0x4626a6){_0x3c21c5[_0x5d69('0x33')]=_[_0x5d69('0x18')](_0x4626a6,function(_0x10cb40){if(_0x10cb40['service']===_0x5d69('0x34')){var _0x15f506=encryptor[_0x5d69('0x35')](_0x10cb40['data3']);_0x10cb40[_0x5d69('0x36')]=maskClientSecret(_0x15f506);}return _0x10cb40;});return _0x3c21c5;})[_0x5d69('0x2f')](respondWithFilteredResult(_0x492b5b,_0x14d32a))[_0x5d69('0x37')](handleError(_0x492b5b,null));};exports[_0x5d69('0x38')]=function(_0x1f5540,_0x4e190b){var _0x315133={'raw':!![],'where':{'id':_0x1f5540[_0x5d69('0x39')]['id']}},_0x42a13c={};_0x42a13c['model']=_['keys'](db['CloudProvider'][_0x5d69('0x19')]);_0x42a13c['query']=_[_0x5d69('0x1e')](_0x1f5540[_0x5d69('0x1d')]);_0x42a13c[_0x5d69('0x1f')]=_[_0x5d69('0x20')](_0x42a13c[_0x5d69('0x21')],_0x42a13c[_0x5d69('0x1d')]);_0x315133[_0x5d69('0x22')]=_[_0x5d69('0x20')](_0x42a13c[_0x5d69('0x21')],qs['fields'](_0x1f5540[_0x5d69('0x1d')][_0x5d69('0x23')]));_0x315133[_0x5d69('0x22')]=_0x315133[_0x5d69('0x22')][_0x5d69('0x24')]?_0x315133[_0x5d69('0x22')]:_0x42a13c[_0x5d69('0x21')];if(_0x1f5540[_0x5d69('0x1d')][_0x5d69('0x30')]){_0x315133[_0x5d69('0x31')]=[{'all':!![]}];}_0x315133=_['merge']({},_0x315133,_0x1f5540['options']);return db[_0x5d69('0x2e')][_0x5d69('0x3a')](_0x315133)[_0x5d69('0x2f')](handleEntityNotFound(_0x4e190b,null))[_0x5d69('0x2f')](function(_0x3a90aa){if(_0x3a90aa['service']===_0x5d69('0x34')){var _0x43aaa6=encryptor['decryptString'](_0x3a90aa[_0x5d69('0x36')]);_0x3a90aa[_0x5d69('0x36')]=maskClientSecret(_0x43aaa6);}return _0x3a90aa;})['then'](respondWithResult(_0x4e190b,null))[_0x5d69('0x37')](handleError(_0x4e190b,null));};exports['create']=function(_0x5dadf4,_0x2c558e){if(!_0x5dadf4['body'][_0x5d69('0x1c')])throw new Error(_0x5d69('0x3b'));if(!_0x5dadf4[_0x5d69('0x3c')][_0x5d69('0x3d')])throw new Error(_0x5d69('0x3e'));var _0x4bfcbf=db[_0x5d69('0x2e')][_0x5d69('0x19')]['service'][_0x5d69('0x3f')];if(!_0x4bfcbf[_0x5d69('0x40')](_0x5dadf4[_0x5d69('0x3c')]['service']))throw new Error(_0x5d69('0x41')+_0x4bfcbf[_0x5d69('0x42')](',\x20'));if(_0x5dadf4[_0x5d69('0x3c')][_0x5d69('0x3d')]==='MicrosoftAzure'&&_0x5dadf4[_0x5d69('0x3c')]['data3']){_0x5dadf4[_0x5d69('0x3c')]['data3']=encryptor['encryptString'](_0x5dadf4['body'][_0x5d69('0x36')]);}return db['CloudProvider']['create'](_0x5dadf4[_0x5d69('0x3c')],{})[_0x5d69('0x2f')](respondWithResult(_0x2c558e,0xc9))[_0x5d69('0x37')](handleError(_0x2c558e,null));};exports[_0x5d69('0x43')]=function(_0x5c69ed,_0x5cbecb){if(_0x5c69ed[_0x5d69('0x3c')]['id']){delete _0x5c69ed[_0x5d69('0x3c')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x5c69ed[_0x5d69('0x39')]['id']}})[_0x5d69('0x2f')](handleEntityNotFound(_0x5cbecb,null))['then'](function(_0x4e94fc){if(_0x4e94fc[_0x5d69('0x3d')]===_0x5d69('0x34')&&_0x5c69ed[_0x5d69('0x3c')][_0x5d69('0x36')]){_0x5c69ed[_0x5d69('0x3c')][_0x5d69('0x36')]=encryptor[_0x5d69('0x44')](_0x5c69ed[_0x5d69('0x3c')]['data3']);}return _0x4e94fc;})[_0x5d69('0x2f')](saveUpdates(_0x5c69ed['body'],null))['then'](respondWithResult(_0x5cbecb,null))[_0x5d69('0x37')](handleError(_0x5cbecb,null));};exports[_0x5d69('0x13')]=function(_0xe2924c,_0x3accd6){return db[_0x5d69('0x2e')][_0x5d69('0x3a')]({'where':{'id':_0xe2924c['params']['id']}})[_0x5d69('0x2f')](handleEntityNotFound(_0x3accd6,null))[_0x5d69('0x2f')](removeEntity(_0x3accd6,null))[_0x5d69('0x37')](handleError(_0x3accd6,null));};exports[_0x5d69('0x45')]=function(_0x50f459,_0x3a7bb0){return db[_0x5d69('0x2e')][_0x5d69('0x46')]({'where':{'id':_0x50f459[_0x5d69('0x39')]['id']},'raw':!![]})[_0x5d69('0x2f')](function(_0x4c0a76){if(!_0x4c0a76)return _0x3a7bb0['sendStatus'](0x194);return{'url':oauth[_0x5d69('0x47')](_0x4c0a76,_0x50f459['user']['id'])};})[_0x5d69('0x2f')](respondWithResult(_0x3a7bb0,null))[_0x5d69('0x37')](handleError(_0x3a7bb0,null));};exports[_0x5d69('0x48')]=function(_0x159ccf,_0x4982b1){var _0x152a12=_0x159ccf[_0x5d69('0x3c')];var _0x40c9c2;var _0x4e073b;if(_0x152a12[_0x5d69('0x14')])throw _0x152a12;redis['get'](_0x152a12[_0x5d69('0x49')])['then'](function(_0x4a648a){if(!_0x4a648a)throw new Error(_0x5d69('0x4a'));_0x40c9c2=JSON[_0x5d69('0x4b')](_0x4a648a);var _0x46a40c=Buffer[_0x5d69('0x4c')](_0x152a12[_0x5d69('0x49')],_0x5d69('0x4d'))[_0x5d69('0x4e')](_0x5d69('0x4f'));_0x4e073b=JSON['parse'](_0x46a40c);if(!oauth[_0x5d69('0x50')](_0x152a12['id_token'],_0x40c9c2[_0x5d69('0x51')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x5d69('0x52')](_0x152a12[_0x5d69('0x49')]);return oauth[_0x5d69('0x53')](_0x152a12['code'],_0x40c9c2);})[_0x5d69('0x2f')](function(_0x685f63){_0x40c9c2['data5']=_0x685f63[_0x5d69('0x54')];_0x40c9c2['data6']=_0x685f63[_0x5d69('0x55')];return db['CloudProvider'][_0x5d69('0x43')]({'data5':_0x40c9c2[_0x5d69('0x56')],'data6':_0x40c9c2[_0x5d69('0x57')]},{'where':{'id':_0x40c9c2['id']}});})[_0x5d69('0x2f')](function(){oauth[_0x5d69('0x58')](_0x40c9c2);socket[_0x5d69('0x59')](_0x5d69('0x5a'),{'id':_0x4e073b['id']});return;})[_0x5d69('0x2f')](respondWithStatusCode(_0x4982b1,null))[_0x5d69('0x37')](function(_0x4b22dd){if(_0x4e073b){socket[_0x5d69('0x59')](_0x5d69('0x5b'),{'id':_0x4e073b['id']});}if(!_0x40c9c2){logger[_0x5d69('0x14')](_0x5d69('0x5c'),_0x4b22dd);return _0x4982b1[_0x5d69('0xc')](0x1f4)[_0x5d69('0x16')](_0x4b22dd[_0x5d69('0x5d')]);}logger[_0x5d69('0x14')](_0x5d69('0x5e'),_0x40c9c2['id'],JSON['stringify'](_0x4b22dd));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 6dfa3e5..168851c 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 _0x2964=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers'];(function(_0x341a17,_0x2a5857){var _0x205e03=function(_0x4054bb){while(--_0x4054bb){_0x341a17['push'](_0x341a17['shift']());}};_0x205e03(++_0x2a5857);}(_0x2964,0x68));var _0x4296=function(_0x2f48cd,_0x34d2b7){_0x2f48cd=_0x2f48cd-0x0;var _0x3ef4b0=_0x2964[_0x2f48cd];return _0x3ef4b0;};'use strict';var _=require(_0x4296('0x0'));var util=require(_0x4296('0x1'));var logger=require(_0x4296('0x2'))('api');var moment=require(_0x4296('0x3'));var BPromise=require(_0x4296('0x4'));var rp=require(_0x4296('0x5'));var fs=require('fs');var path=require(_0x4296('0x6'));var rimraf=require(_0x4296('0x7'));var config=require(_0x4296('0x8'));var attributes=require(_0x4296('0x9'));module['exports']=function(_0x284302,_0x113c0){return _0x284302[_0x4296('0xa')](_0x4296('0xb'),attributes,{'tableName':_0x4296('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8230=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cloudProvider.attributes','CloudProvider','cloud_providers'];(function(_0x36dca0,_0x9594b1){var _0x20433e=function(_0x47303b){while(--_0x47303b){_0x36dca0['push'](_0x36dca0['shift']());}};_0x20433e(++_0x9594b1);}(_0x8230,0x84));var _0x0823=function(_0x220394,_0x490c8b){_0x220394=_0x220394-0x0;var _0x1dae12=_0x8230[_0x220394];return _0x1dae12;};'use strict';var _=require('lodash');var util=require(_0x0823('0x0'));var logger=require(_0x0823('0x1'))(_0x0823('0x2'));var moment=require(_0x0823('0x3'));var BPromise=require(_0x0823('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0823('0x5'));var rimraf=require(_0x0823('0x6'));var config=require(_0x0823('0x7'));var attributes=require(_0x0823('0x8'));module['exports']=function(_0x1ff994,_0x2b011f){return _0x1ff994['define'](_0x0823('0x9'),attributes,{'tableName':_0x0823('0xa'),'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 11696d5..836b66b 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 _0xad66=['all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','map','type','Dynamics365','push','data7','/.default','replace','{TENANT_ID}','data2','code','id_token','from','toString','base64','hex','client_id','data1','response_type','join','data4','response_mode','form_post','scope','state','nonce','key','value','oauth2Claims','decode','iss','audience','exp','resolve','CloudProvider','findOne','then','refresh_token','data6','data3','POST','data5','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','bind','intervals','findAll'];(function(_0x4b03c9,_0x17ce03){var _0x161ba2=function(_0xb952db){while(--_0xb952db){_0x4b03c9['push'](_0x4b03c9['shift']());}};_0x161ba2(++_0x17ce03);}(_0xad66,0xe5));var _0x6ad6=function(_0x5e06f0,_0x12f101){_0x5e06f0=_0x5e06f0-0x0;var _0x57673c=_0xad66[_0x5e06f0];return _0x57673c;};'use strict';var _=require(_0x6ad6('0x0'));var crypto=require(_0x6ad6('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x6ad6('0x2'));var Redis=require(_0x6ad6('0x3'));var rp=require(_0x6ad6('0x4'));var util=require(_0x6ad6('0x5'));var encryptor=require(_0x6ad6('0x6'));var config=require(_0x6ad6('0x7'));var logger=require('../../config/logger')(_0x6ad6('0x8'));var schedule=require(_0x6ad6('0x9'));var db=require(_0x6ad6('0xa'))['db'];config[_0x6ad6('0xb')]=_[_0x6ad6('0xc')](config[_0x6ad6('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x6ad6('0xb')]);var MICROSOFT_AUTH_URL=_0x6ad6('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x6ad6('0xe'),_0x6ad6('0xf'),'email','offline_access',_0x6ad6('0x10'),_0x6ad6('0x11'),_0x6ad6('0x12')],'Dynamics365':['openid',_0x6ad6('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0x6ad6('0x14');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xbf9d22){var _0x5c970e=_[_0x6ad6('0x15')](AZURE_AUTH_SCOPES[_0xbf9d22['type']]);if(_0xbf9d22[_0x6ad6('0x16')]===_0x6ad6('0x17'))_0x5c970e[_0x6ad6('0x18')](_0xbf9d22[_0x6ad6('0x19')]+_0x6ad6('0x1a'));return _0x5c970e['join']('\x20');}function getAccessTokenScope(_0x5c69b2){if(_0x5c69b2[_0x6ad6('0x16')]==='Outlook365')return _0x6ad6('0x10');if(_0x5c69b2['type']===_0x6ad6('0x17'))return _0x5c69b2[_0x6ad6('0x19')]+_0x6ad6('0x1a');}function generateMicrosoftAuthorizationUrl(_0x1796cd,_0x49c889){var _0x277814=MICROSOFT_AUTH_URL[_0x6ad6('0x1b')](_0x6ad6('0x1c'),_0x1796cd[_0x6ad6('0x1d')]);var _0x21f974=[_0x6ad6('0x1e'),_0x6ad6('0x1f')];var _0x1b0ced=Buffer[_0x6ad6('0x20')](JSON['stringify']({'id':_0x49c889}))[_0x6ad6('0x21')](_0x6ad6('0x22'));var _0x518f1f=crypto['randomBytes'](0x10)[_0x6ad6('0x21')](_0x6ad6('0x23'));var _0x5cf3ec=getAuthorizationScopes(_0x1796cd);var _0xef93be=[{'key':_0x6ad6('0x24'),'value':_0x1796cd[_0x6ad6('0x25')]},{'key':_0x6ad6('0x26'),'value':encodeURIComponent(_0x21f974[_0x6ad6('0x27')]('\x20'))},{'key':'redirect_uri','value':_0x1796cd[_0x6ad6('0x28')]},{'key':_0x6ad6('0x29'),'value':_0x6ad6('0x2a')},{'key':_0x6ad6('0x2b'),'value':encodeURIComponent(_0x5cf3ec)},{'key':_0x6ad6('0x2c'),'value':_0x1b0ced},{'key':_0x6ad6('0x2d'),'value':_0x518f1f},{'key':'prompt','value':'login'}];var _0x45111e=_0x277814+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0xef93be,function(_0x22efa8){return _0x22efa8[_0x6ad6('0x2e')]+'='+_0x22efa8[_0x6ad6('0x2f')];})[_0x6ad6('0x27')]('&');_0x1796cd[_0x6ad6('0x30')]={'issuer':_0x277814[_0x6ad6('0x1b')]('oauth2/',''),'audience':_0x1796cd['data1'],'state':_0x1b0ced,'nonce':_0x518f1f};redis['set'](_0x1b0ced,JSON['stringify'](_0x1796cd));return _0x45111e;}function isValidIdToken(_0x52c4d2,_0x405dd1){try{var _0x106acc=jwt[_0x6ad6('0x31')](_0x52c4d2,{'complete':!![]});var _0x3eb8ef=_0x106acc['payload'];if(_0x3eb8ef[_0x6ad6('0x32')]!==_0x405dd1['issuer'])return![];if(_0x3eb8ef['aud']!==_0x405dd1[_0x6ad6('0x33')])return![];if(_0x3eb8ef[_0x6ad6('0x2d')]!==_0x405dd1['nonce'])return![];if(moment()['isAfter'](moment['unix'](_0x3eb8ef[_0x6ad6('0x34')])))return![];return!![];}catch(_0x1a8f7a){throw _0x1a8f7a;}}function refreshOauth2MicrosoftAccessToken(_0x329eef){return Promise[_0x6ad6('0x35')]()['then'](function(){if(_0x329eef['data3'])return _0x329eef;return db[_0x6ad6('0x36')][_0x6ad6('0x37')]({'where':{'id':_0x329eef['id']},'raw':!![]});})[_0x6ad6('0x38')](function(_0x4b8392){var _0x93870d={'grant_type':_0x6ad6('0x39'),'refresh_token':_0x4b8392[_0x6ad6('0x3a')],'scope':getAccessTokenScope(_0x4b8392),'redirect_uri':_0x4b8392[_0x6ad6('0x28')],'client_id':_0x4b8392[_0x6ad6('0x25')],'client_secret':encryptor['decryptString'](_0x4b8392[_0x6ad6('0x3b')])};var _0xb6f93a={'method':_0x6ad6('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x6ad6('0x1b')](_0x6ad6('0x1c'),_0x4b8392[_0x6ad6('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x93870d,'json':!![]};return rp(_0xb6f93a);})[_0x6ad6('0x38')](function(_0x34bf15){_0x329eef[_0x6ad6('0x3d')]=_0x34bf15[_0x6ad6('0x3e')];_0x329eef[_0x6ad6('0x3a')]=_0x34bf15[_0x6ad6('0x39')];return db[_0x6ad6('0x36')]['update']({'data5':_0x329eef[_0x6ad6('0x3d')],'data6':_0x329eef['data6']},{'where':{'id':_0x329eef['id']}});})[_0x6ad6('0x38')](function(){return _0x329eef;})[_0x6ad6('0x3f')](function(_0x55b4cb){logger[_0x6ad6('0x40')](_0x6ad6('0x41'),_0x329eef['id'],_0x55b4cb);});}function getOauth2MicrosoftAccessToken(_0x415c99,_0x2d702b){var _0x51a4d8={'grant_type':_0x6ad6('0x42'),'code':_0x415c99,'scope':getAccessTokenScope(_0x2d702b),'redirect_uri':_0x2d702b[_0x6ad6('0x28')],'client_id':_0x2d702b[_0x6ad6('0x25')],'client_secret':encryptor[_0x6ad6('0x43')](_0x2d702b[_0x6ad6('0x3b')])};var _0x233a8d={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x6ad6('0x1c'),_0x2d702b[_0x6ad6('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x51a4d8,'json':!![]};return rp(_0x233a8d);}function startRefreshInterval(_0x1353ca){var _0x5a03d1=schedule['intervals'];if(_0x5a03d1[_0x1353ca['id']])clearInterval(_0x5a03d1[_0x1353ca['id']]);_0x5a03d1[_0x1353ca['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x6ad6('0x44')](this,{'id':_0x1353ca['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x6ad6('0x45')]=_0x5a03d1;}function startAllRefreshIntervals(){return db[_0x6ad6('0x36')][_0x6ad6('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x6ad6('0x38')](function(_0x528198){var _0x5101cc=_0x528198[_0x6ad6('0x15')](function(_0x1344b9){return refreshOauth2MicrosoftAccessToken(_0x1344b9)[_0x6ad6('0x38')](function(_0x492ca8){startRefreshInterval(_0x492ca8);});});return Promise[_0x6ad6('0x47')](_0x5101cc);})[_0x6ad6('0x3f')](function(_0x49d3e8){var _0x56768c=_0x49d3e8?util[_0x6ad6('0x48')](_0x49d3e8,{'showHidden':![],'depth':null}):'';logger[_0x6ad6('0x40')](_0x6ad6('0x49'),_0x56768c);});}module[_0x6ad6('0x4a')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x2f1c=['data7','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','data2','stringify','toString','randomBytes','hex','client_id','response_type','redirect_uri','form_post','scope','state','nonce','prompt','login','map','key','value','oauth2Claims','decode','payload','aud','isAfter','resolve','then','data3','CloudProvider','findOne','data6','data4','data1','decryptString','POST','data5','access_token','refresh_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','api','defaults','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','type','push'];(function(_0x3c9d9e,_0x5b9888){var _0xfa1029=function(_0x4c9948){while(--_0x4c9948){_0x3c9d9e['push'](_0x3c9d9e['shift']());}};_0xfa1029(++_0x5b9888);}(_0x2f1c,0xbf));var _0xc2f1=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0x2f1c[_0x2e76a7];return _0x454cde;};'use strict';var _=require(_0xc2f1('0x0'));var crypto=require(_0xc2f1('0x1'));var jwt=require(_0xc2f1('0x2'));var moment=require(_0xc2f1('0x3'));var Redis=require(_0xc2f1('0x4'));var rp=require(_0xc2f1('0x5'));var util=require('util');var encryptor=require(_0xc2f1('0x6'));var config=require(_0xc2f1('0x7'));var logger=require('../../config/logger')(_0xc2f1('0x8'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config['redis']=_[_0xc2f1('0x9')](config[_0xc2f1('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xc2f1('0xa')]);var MICROSOFT_AUTH_URL=_0xc2f1('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xc2f1('0xc'),'profile',_0xc2f1('0xd'),_0xc2f1('0xe'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xc2f1('0xf'),_0xc2f1('0x10')],'Dynamics365':[_0xc2f1('0xc'),_0xc2f1('0xe')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xb80209){var _0x36b8bf=_['map'](AZURE_AUTH_SCOPES[_0xb80209[_0xc2f1('0x11')]]);if(_0xb80209[_0xc2f1('0x11')]==='Dynamics365')_0x36b8bf[_0xc2f1('0x12')](_0xb80209[_0xc2f1('0x13')]+'/.default');return _0x36b8bf[_0xc2f1('0x14')]('\x20');}function getAccessTokenScope(_0x2c246e){if(_0x2c246e[_0xc2f1('0x11')]===_0xc2f1('0x15'))return _0xc2f1('0x16');if(_0x2c246e[_0xc2f1('0x11')]==='Dynamics365')return _0x2c246e[_0xc2f1('0x13')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x284877,_0x77e471){var _0xae8ba4=MICROSOFT_AUTH_URL[_0xc2f1('0x17')](_0xc2f1('0x18'),_0x284877[_0xc2f1('0x19')]);var _0x137826=['code','id_token'];var _0x3b65d2=Buffer['from'](JSON[_0xc2f1('0x1a')]({'id':_0x77e471}))[_0xc2f1('0x1b')]('base64');var _0x145b16=crypto[_0xc2f1('0x1c')](0x10)[_0xc2f1('0x1b')](_0xc2f1('0x1d'));var _0x147adc=getAuthorizationScopes(_0x284877);var _0x20e09d=[{'key':_0xc2f1('0x1e'),'value':_0x284877['data1']},{'key':_0xc2f1('0x1f'),'value':encodeURIComponent(_0x137826[_0xc2f1('0x14')]('\x20'))},{'key':_0xc2f1('0x20'),'value':_0x284877['data4']},{'key':'response_mode','value':_0xc2f1('0x21')},{'key':_0xc2f1('0x22'),'value':encodeURIComponent(_0x147adc)},{'key':_0xc2f1('0x23'),'value':_0x3b65d2},{'key':_0xc2f1('0x24'),'value':_0x145b16},{'key':_0xc2f1('0x25'),'value':_0xc2f1('0x26')}];var _0x324d7d=_0xae8ba4+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xc2f1('0x27')](_0x20e09d,function(_0xa9e6c4){return _0xa9e6c4[_0xc2f1('0x28')]+'='+_0xa9e6c4[_0xc2f1('0x29')];})['join']('&');_0x284877[_0xc2f1('0x2a')]={'issuer':_0xae8ba4[_0xc2f1('0x17')]('oauth2/',''),'audience':_0x284877['data1'],'state':_0x3b65d2,'nonce':_0x145b16};redis['set'](_0x3b65d2,JSON['stringify'](_0x284877));return _0x324d7d;}function isValidIdToken(_0x15edec,_0x25f239){try{var _0x17a376=jwt[_0xc2f1('0x2b')](_0x15edec,{'complete':!![]});var _0x46dc98=_0x17a376[_0xc2f1('0x2c')];if(_0x46dc98['iss']!==_0x25f239['issuer'])return![];if(_0x46dc98[_0xc2f1('0x2d')]!==_0x25f239['audience'])return![];if(_0x46dc98[_0xc2f1('0x24')]!==_0x25f239[_0xc2f1('0x24')])return![];if(moment()[_0xc2f1('0x2e')](moment['unix'](_0x46dc98['exp'])))return![];return!![];}catch(_0x669740){throw _0x669740;}}function refreshOauth2MicrosoftAccessToken(_0x1900f0){return Promise[_0xc2f1('0x2f')]()[_0xc2f1('0x30')](function(){if(_0x1900f0[_0xc2f1('0x31')])return _0x1900f0;return db[_0xc2f1('0x32')][_0xc2f1('0x33')]({'where':{'id':_0x1900f0['id']},'raw':!![]});})[_0xc2f1('0x30')](function(_0x1837fe){var _0x431ff7={'grant_type':'refresh_token','refresh_token':_0x1837fe[_0xc2f1('0x34')],'scope':getAccessTokenScope(_0x1837fe),'redirect_uri':_0x1837fe[_0xc2f1('0x35')],'client_id':_0x1837fe[_0xc2f1('0x36')],'client_secret':encryptor[_0xc2f1('0x37')](_0x1837fe[_0xc2f1('0x31')])};var _0x3a62c9={'method':_0xc2f1('0x38'),'uri':MICROSOFT_AUTH_URL['replace'](_0xc2f1('0x18'),_0x1837fe['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x431ff7,'json':!![]};return rp(_0x3a62c9);})[_0xc2f1('0x30')](function(_0x5882d4){_0x1900f0[_0xc2f1('0x39')]=_0x5882d4[_0xc2f1('0x3a')];_0x1900f0['data6']=_0x5882d4[_0xc2f1('0x3b')];return db['CloudProvider'][_0xc2f1('0x3c')]({'data5':_0x1900f0[_0xc2f1('0x39')],'data6':_0x1900f0[_0xc2f1('0x34')]},{'where':{'id':_0x1900f0['id']}});})[_0xc2f1('0x30')](function(){return _0x1900f0;})[_0xc2f1('0x3d')](function(_0x37e94a){logger[_0xc2f1('0x3e')](_0xc2f1('0x3f'),_0x1900f0['id'],_0x37e94a);});}function getOauth2MicrosoftAccessToken(_0x13ada5,_0x168524){var _0x4b6e2f={'grant_type':_0xc2f1('0x40'),'code':_0x13ada5,'scope':getAccessTokenScope(_0x168524),'redirect_uri':_0x168524[_0xc2f1('0x35')],'client_id':_0x168524[_0xc2f1('0x36')],'client_secret':encryptor['decryptString'](_0x168524['data3'])};var _0x2dad31={'method':_0xc2f1('0x38'),'uri':MICROSOFT_AUTH_URL[_0xc2f1('0x17')]('{TENANT_ID}',_0x168524[_0xc2f1('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4b6e2f,'json':!![]};return rp(_0x2dad31);}function startRefreshInterval(_0x84aa7e){var _0x1287fb=schedule[_0xc2f1('0x41')];if(_0x1287fb[_0x84aa7e['id']])clearInterval(_0x1287fb[_0x84aa7e['id']]);_0x1287fb[_0x84aa7e['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x84aa7e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xc2f1('0x41')]=_0x1287fb;}function startAllRefreshIntervals(){return db[_0xc2f1('0x32')][_0xc2f1('0x42')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xc2f1('0x30')](function(_0xf1b943){var _0x56da65=_0xf1b943[_0xc2f1('0x27')](function(_0x2bafa9){return refreshOauth2MicrosoftAccessToken(_0x2bafa9)[_0xc2f1('0x30')](function(_0x8259a8){startRefreshInterval(_0x8259a8);});});return Promise[_0xc2f1('0x43')](_0x56da65);})['catch'](function(_0x5de4c1){var _0x27d167=_0x5de4c1?util[_0xc2f1('0x44')](_0x5de4c1,{'showHidden':![],'depth':null}):'';logger[_0xc2f1('0x3e')](_0xc2f1('0x45'),_0x27d167);});}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 cda2b7f..b68c835 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 _0xa329=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird'];(function(_0x2af2a5,_0x4089fa){var _0x4ef35e=function(_0x5605d7){while(--_0x5605d7){_0x2af2a5['push'](_0x2af2a5['shift']());}};_0x4ef35e(++_0x4089fa);}(_0xa329,0x162));var _0x9a32=function(_0x4212c9,_0x26c526){_0x4212c9=_0x4212c9-0x0;var _0x6b7476=_0xa329[_0x4212c9];return _0x6b7476;};'use strict';var _=require(_0x9a32('0x0'));var util=require(_0x9a32('0x1'));var moment=require('moment');var BPromise=require(_0x9a32('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a32('0x3'));var db=require(_0x9a32('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9a32('0x5'));var config=require(_0x9a32('0x6'));var jayson=require(_0x9a32('0x7'));var client=jayson[_0x9a32('0x8')][_0x9a32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x235b92,_0x4a8fba,_0x5b8b5e){return new BPromise(function(_0x4dc7f8,_0x344b35){return client[_0x9a32('0xa')](_0x235b92,_0x5b8b5e)['then'](function(_0x38f6cc){logger[_0x9a32('0xb')](_0x9a32('0xc'),_0x4a8fba,_0x9a32('0xd'));logger[_0x9a32('0xe')](_0x9a32('0xf'),_0x4a8fba,'request\x20sent',JSON[_0x9a32('0x10')](_0x38f6cc));if(_0x38f6cc[_0x9a32('0x11')]){if(_0x38f6cc['error']['code']===0x1f4){logger[_0x9a32('0x11')](_0x9a32('0xc'),_0x4a8fba,_0x38f6cc['error']['message']);return _0x344b35(_0x38f6cc[_0x9a32('0x11')][_0x9a32('0x12')]);}logger[_0x9a32('0x11')](_0x9a32('0xc'),_0x4a8fba,_0x38f6cc['error'][_0x9a32('0x12')]);return _0x4dc7f8(_0x38f6cc[_0x9a32('0x11')]['message']);}else{logger[_0x9a32('0xb')](_0x9a32('0xc'),_0x4a8fba,_0x9a32('0xd'));_0x4dc7f8(_0x38f6cc[_0x9a32('0x13')][_0x9a32('0x12')]);}})[_0x9a32('0x14')](function(_0x4fa645){logger[_0x9a32('0x11')](_0x9a32('0xc'),_0x4a8fba,_0x4fa645);_0x344b35(_0x4fa645);});});}
\ No newline at end of file
+var _0xb016=['error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x454db5,_0x11b082){var _0x5e1f82=function(_0x5f05cb){while(--_0x5f05cb){_0x454db5['push'](_0x454db5['shift']());}};_0x5e1f82(++_0x11b082);}(_0xb016,0x159));var _0x6b01=function(_0x186253,_0x44da6c){_0x186253=_0x186253-0x0;var _0x5896de=_0xb016[_0x186253];return _0x5896de;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b01('0x3'))['db'];var utils=require(_0x6b01('0x4'));var logger=require(_0x6b01('0x5'))(_0x6b01('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b01('0x7'));var client=jayson[_0x6b01('0x8')][_0x6b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5759a1,_0x5c5bfb,_0x374aab){return new BPromise(function(_0x39f9fa,_0x526a7d){return client['request'](_0x5759a1,_0x374aab)[_0x6b01('0xa')](function(_0x1cb3a6){logger[_0x6b01('0xb')](_0x6b01('0xc'),_0x5c5bfb,_0x6b01('0xd'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'),JSON[_0x6b01('0xe')](_0x1cb3a6));if(_0x1cb3a6[_0x6b01('0xf')]){if(_0x1cb3a6['error'][_0x6b01('0x10')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x5c5bfb,_0x1cb3a6[_0x6b01('0xf')]['message']);return _0x526a7d(_0x1cb3a6[_0x6b01('0xf')][_0x6b01('0x11')]);}logger['error'](_0x6b01('0xc'),_0x5c5bfb,_0x1cb3a6['error']['message']);return _0x39f9fa(_0x1cb3a6['error'][_0x6b01('0x11')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'));_0x39f9fa(_0x1cb3a6[_0x6b01('0x12')][_0x6b01('0x11')]);}})[_0x6b01('0x13')](function(_0x3d7045){logger[_0x6b01('0xf')](_0x6b01('0xc'),_0x5c5bfb,_0x3d7045);_0x526a7d(_0x3d7045);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index d4402e5..85474a9 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 _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x2300f2,_0x315c5f){var _0x6bd508=function(_0x2fa0f6){while(--_0x2fa0f6){_0x2300f2['push'](_0x2300f2['shift']());}};_0x6bd508(++_0x315c5f);}(_0x1261,0x144));var _0x1126=function(_0x28e0f1,_0xd1bfa0){_0x28e0f1=_0x28e0f1-0x0;var _0x13aedc=_0x1261[_0x28e0f1];return _0x13aedc;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x5c27f7,_0x20b0cc){var _0x44ac58=function(_0x345d43){while(--_0x345d43){_0x5c27f7['push'](_0x5c27f7['shift']());}};_0x44ac58(++_0x20b0cc);}(_0x2ef3,0xba));var _0x32ef=function(_0x346f66,_0x1e91e3){_0x346f66=_0x346f66-0x0;var _0x3502b8=_0x2ef3[_0x346f66];return _0x3502b8;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 5d55c32..ff31d49 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 _0xa7ac=['STRING','exports','name'];(function(_0x4d4437,_0x196f65){var _0x4a89db=function(_0x597cfc){while(--_0x597cfc){_0x4d4437['push'](_0x4d4437['shift']());}};_0x4a89db(++_0x196f65);}(_0xa7ac,0x14e));var _0xca7a=function(_0x24f927,_0x53d117){_0x24f927=_0x24f927-0x0;var _0x528c44=_0xa7ac[_0x24f927];return _0x528c44;};'use strict';var Sequelize=require('sequelize');module[_0xca7a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xca7a('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xca7a('0x2')]},'website':{'type':Sequelize[_0xca7a('0x2')]},'phone':{'type':Sequelize[_0xca7a('0x2')]},'fax':{'type':Sequelize[_0xca7a('0x2')]},'type':{'type':Sequelize[_0xca7a('0x2')]},'street':{'type':Sequelize[_0xca7a('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xca7a('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xca7a('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xca7a('0x2')]},'sCity':{'type':Sequelize[_0xca7a('0x2')]},'sCountry':{'type':Sequelize[_0xca7a('0x2')]},'description':{'type':Sequelize[_0xca7a('0x2')]}};
\ No newline at end of file
+var _0x9fe3=['name','sequelize','STRING'];(function(_0x5bbb86,_0x31386a){var _0x41f61d=function(_0x4a29d4){while(--_0x4a29d4){_0x5bbb86['push'](_0x5bbb86['shift']());}};_0x41f61d(++_0x31386a);}(_0x9fe3,0x1b1));var _0x39fe=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0x9fe3[_0x4b03c9];return _0x161ba2;};'use strict';var Sequelize=require(_0x39fe('0x0'));module['exports']={'name':{'type':Sequelize[_0x39fe('0x1')],'unique':_0x39fe('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x39fe('0x1')]},'companyId':{'type':Sequelize[_0x39fe('0x1')]},'website':{'type':Sequelize[_0x39fe('0x1')]},'phone':{'type':Sequelize[_0x39fe('0x1')]},'fax':{'type':Sequelize[_0x39fe('0x1')]},'type':{'type':Sequelize[_0x39fe('0x1')]},'street':{'type':Sequelize[_0x39fe('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x39fe('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x39fe('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x39fe('0x1')]},'sStreet':{'type':Sequelize[_0x39fe('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x39fe('0x1')]},'sCountry':{'type':Sequelize[_0x39fe('0x1')]},'description':{'type':Sequelize[_0x39fe('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 79b30b7..e0273b5 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 _0xee93=['show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','addContacts','CmContact','ids','getContacts','findOne','nolimit','rimraf','fast-json-patch','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','destroy','stack','name','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','map','merge','include','findAll','rows','catch'];(function(_0xf7831f,_0x1c6188){var _0x3f88e7=function(_0x2c6d4e){while(--_0x2c6d4e){_0xf7831f['push'](_0xf7831f['shift']());}};_0x3f88e7(++_0x1c6188);}(_0xee93,0xb7));var _0x3ee9=function(_0x5071e6,_0x2d2133){_0x5071e6=_0x5071e6-0x0;var _0x1d70c0=_0xee93[_0x5071e6];return _0x1d70c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ee9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ee9('0x1'));var rp=require('request-promise');var moment=require(_0x3ee9('0x2'));var BPromise=require(_0x3ee9('0x3'));var Mustache=require('mustache');var util=require(_0x3ee9('0x4'));var path=require(_0x3ee9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3ee9('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ee9('0x7'));var squel=require(_0x3ee9('0x8'));var crypto=require(_0x3ee9('0x9'));var jsforce=require(_0x3ee9('0xa'));var deskjs=require(_0x3ee9('0xb'));var toCsv=require(_0x3ee9('0xc'));var querystring=require(_0x3ee9('0xd'));var Papa=require(_0x3ee9('0xe'));var Redis=require(_0x3ee9('0xf'));var authService=require(_0x3ee9('0x10'));var qs=require(_0x3ee9('0x11'));var as=require(_0x3ee9('0x12'));var hardwareService=require(_0x3ee9('0x13'));var logger=require(_0x3ee9('0x14'))(_0x3ee9('0x15'));var utils=require(_0x3ee9('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3ee9('0x17'))['db'];function respondWithStatusCode(_0x6a06c4,_0x34306f){_0x34306f=_0x34306f||0xcc;return function(_0x508e6f){if(_0x508e6f){return _0x6a06c4[_0x3ee9('0x18')](_0x34306f);}return _0x6a06c4[_0x3ee9('0x19')](_0x34306f)[_0x3ee9('0x1a')]();};}function respondWithResult(_0x161493,_0x1232a3){_0x1232a3=_0x1232a3||0xc8;return function(_0x8bb3a2){if(_0x8bb3a2){return _0x161493[_0x3ee9('0x19')](_0x1232a3)[_0x3ee9('0x1b')](_0x8bb3a2);}};}function respondWithFilteredResult(_0x4ffa1e,_0x3904d8){return function(_0x331297){if(_0x331297){var _0x2a6b64=typeof _0x3904d8[_0x3ee9('0x1c')]==='undefined'&&typeof _0x3904d8[_0x3ee9('0x1d')]===_0x3ee9('0x1e');var _0x1a7058=_0x331297[_0x3ee9('0x1f')];var _0x3d34f1=_0x2a6b64?0x0:_0x3904d8[_0x3ee9('0x1c')];var _0x24692a=_0x2a6b64?_0x331297[_0x3ee9('0x1f')]:_0x3904d8['offset']+_0x3904d8[_0x3ee9('0x1d')];var _0x496793;if(_0x24692a>=_0x1a7058){_0x24692a=_0x1a7058;_0x496793=0xc8;}else{_0x496793=0xce;}_0x4ffa1e[_0x3ee9('0x19')](_0x496793);return _0x4ffa1e['set'](_0x3ee9('0x20'),_0x3d34f1+'-'+_0x24692a+'/'+_0x1a7058)[_0x3ee9('0x1b')](_0x331297);}return null;};}function patchUpdates(_0x4cd0e0){return function(_0x2d72b6){try{jsonpatch[_0x3ee9('0x21')](_0x2d72b6,_0x4cd0e0,!![]);}catch(_0x338252){return BPromise[_0x3ee9('0x22')](_0x338252);}return _0x2d72b6[_0x3ee9('0x23')]();};}function saveUpdates(_0x5f331b,_0x1d97fc){return function(_0x327dbc){if(_0x327dbc){return _0x327dbc[_0x3ee9('0x24')](_0x5f331b)[_0x3ee9('0x25')](function(_0x1d395f){return _0x1d395f;});}return null;};}function removeEntity(_0x5f4309,_0x398930){return function(_0x51e0e3){if(_0x51e0e3){return _0x51e0e3['destroy']()[_0x3ee9('0x25')](function(){var _0x49709d=_0x51e0e3[_0x3ee9('0x26')]({'plain':!![]});var _0x340def=_0x3ee9('0x27');return db[_0x3ee9('0x28')][_0x3ee9('0x29')]({'where':{'type':_0x340def,'resourceId':_0x49709d['id']}})[_0x3ee9('0x25')](function(){return _0x51e0e3;});})[_0x3ee9('0x25')](function(){_0x5f4309[_0x3ee9('0x19')](0xcc)[_0x3ee9('0x1a')]();});}};}function handleEntityNotFound(_0x37ae69,_0x3dc86e){return function(_0x37a396){if(!_0x37a396){_0x37ae69[_0x3ee9('0x18')](0x194);}return _0x37a396;};}function handleError(_0x5e22da,_0x204d99){_0x204d99=_0x204d99||0x1f4;return function(_0xb49ff6){logger['error'](_0xb49ff6[_0x3ee9('0x2a')]);if(_0xb49ff6[_0x3ee9('0x2b')]){delete _0xb49ff6[_0x3ee9('0x2b')];}_0x5e22da[_0x3ee9('0x19')](_0x204d99)['send'](_0xb49ff6);};}exports[_0x3ee9('0x2c')]=function(_0x331ab3,_0x20e902){var _0x539bdb={},_0x2ca988={},_0x482ab4={'count':0x0,'rows':[]};return db[_0x3ee9('0x2d')][_0x3ee9('0x2e')]()[_0x3ee9('0x25')](function(_0x3a6463){_0x2ca988[_0x3ee9('0x2f')]=_[_0x3ee9('0x30')](_0x3a6463);_0x2ca988['query']=_['keys'](_0x331ab3[_0x3ee9('0x31')]);_0x2ca988['filters']=_[_0x3ee9('0x32')](_0x2ca988[_0x3ee9('0x2f')],_0x2ca988[_0x3ee9('0x31')]);_0x539bdb[_0x3ee9('0x33')]=_[_0x3ee9('0x32')](_0x2ca988[_0x3ee9('0x2f')],qs[_0x3ee9('0x34')](_0x331ab3[_0x3ee9('0x31')]['fields']));_0x539bdb[_0x3ee9('0x33')]=_0x539bdb['attributes'][_0x3ee9('0x35')]?_0x539bdb[_0x3ee9('0x33')]:_0x2ca988['model'];if(!_0x331ab3[_0x3ee9('0x31')][_0x3ee9('0x36')]('nolimit')){_0x539bdb[_0x3ee9('0x1d')]=qs[_0x3ee9('0x1d')](_0x331ab3['query'][_0x3ee9('0x1d')]);_0x539bdb[_0x3ee9('0x1c')]=qs[_0x3ee9('0x1c')](_0x331ab3[_0x3ee9('0x31')][_0x3ee9('0x1c')]);}_0x539bdb[_0x3ee9('0x37')]=qs[_0x3ee9('0x38')](_0x331ab3[_0x3ee9('0x31')][_0x3ee9('0x38')]);_0x539bdb[_0x3ee9('0x39')]=qs[_0x3ee9('0x3a')](_['pick'](_0x331ab3[_0x3ee9('0x31')],_0x2ca988[_0x3ee9('0x3a')]),_0x3a6463);if(_0x331ab3[_0x3ee9('0x31')][_0x3ee9('0x3b')]){_0x539bdb[_0x3ee9('0x39')]=_['merge'](_0x539bdb['where'],{'$or':_[_0x3ee9('0x3c')](_0x539bdb['attributes'],function(_0x1704a6){var _0x26e08d={};_0x26e08d[_0x1704a6]={'$like':'%'+_0x331ab3[_0x3ee9('0x31')]['filter']+'%'};return _0x26e08d;})});}_0x539bdb=_[_0x3ee9('0x3d')]({},_0x539bdb,_0x331ab3['options']);var _0x4c21aa={'where':_0x539bdb['where']};return db[_0x3ee9('0x2d')]['count'](_0x4c21aa)['then'](function(_0x20a4e5){_0x482ab4[_0x3ee9('0x1f')]=_0x20a4e5;if(_0x331ab3[_0x3ee9('0x31')]['includeAll']){_0x539bdb[_0x3ee9('0x3e')]=[{'all':!![]}];}return db[_0x3ee9('0x2d')][_0x3ee9('0x3f')](_0x539bdb);})['then'](function(_0x2dedea){_0x482ab4[_0x3ee9('0x40')]=_0x2dedea;return _0x482ab4;})[_0x3ee9('0x25')](respondWithFilteredResult(_0x20e902,_0x539bdb))[_0x3ee9('0x41')](handleError(_0x20e902,null));})[_0x3ee9('0x41')](handleError(_0x20e902,null));};exports[_0x3ee9('0x42')]=function(_0x321c03,_0x4903e9){var _0x479eb7={'raw':![],'where':{'id':_0x321c03[_0x3ee9('0x43')]['id']}},_0xbe2438={};_0xbe2438[_0x3ee9('0x2f')]=_[_0x3ee9('0x30')](db[_0x3ee9('0x2d')]['rawAttributes']);_0xbe2438[_0x3ee9('0x31')]=_[_0x3ee9('0x30')](_0x321c03['query']);_0xbe2438['filters']=_[_0x3ee9('0x32')](_0xbe2438['model'],_0xbe2438[_0x3ee9('0x31')]);_0x479eb7[_0x3ee9('0x33')]=_[_0x3ee9('0x32')](_0xbe2438[_0x3ee9('0x2f')],qs[_0x3ee9('0x34')](_0x321c03[_0x3ee9('0x31')][_0x3ee9('0x34')]));_0x479eb7[_0x3ee9('0x33')]=_0x479eb7['attributes'][_0x3ee9('0x35')]?_0x479eb7[_0x3ee9('0x33')]:_0xbe2438[_0x3ee9('0x2f')];if(_0x321c03[_0x3ee9('0x31')]['includeAll']){_0x479eb7[_0x3ee9('0x3e')]=[{'all':!![]}];}_0x479eb7=_[_0x3ee9('0x3d')]({},_0x479eb7,_0x321c03[_0x3ee9('0x44')]);return db[_0x3ee9('0x2d')][_0x3ee9('0x45')](_0x479eb7)[_0x3ee9('0x25')](handleEntityNotFound(_0x4903e9,null))[_0x3ee9('0x25')](respondWithResult(_0x4903e9,null))[_0x3ee9('0x41')](handleError(_0x4903e9,null));};exports[_0x3ee9('0x46')]=function(_0x223289,_0x3e7a1e){return db[_0x3ee9('0x2d')]['create'](_0x223289[_0x3ee9('0x47')],{})[_0x3ee9('0x25')](function(_0x19ea60){var _0xae10d=_0x223289['user'][_0x3ee9('0x26')]({'plain':!![]});if(!_0xae10d)throw new Error(_0x3ee9('0x48'));if(_0xae10d[_0x3ee9('0x49')]==='user'){var _0xf7456a=_0x19ea60[_0x3ee9('0x26')]({'plain':!![]});var _0x54073a=_0x3ee9('0x27');return db[_0x3ee9('0x4a')][_0x3ee9('0x45')]({'where':{'name':_0x54073a,'userProfileId':_0xae10d[_0x3ee9('0x4b')]},'raw':!![]})[_0x3ee9('0x25')](function(_0x519049){if(_0x519049&&_0x519049[_0x3ee9('0x4c')]===0x0){return db[_0x3ee9('0x28')][_0x3ee9('0x46')]({'name':_0xf7456a[_0x3ee9('0x2b')],'resourceId':_0xf7456a['id'],'type':_0x519049['name'],'sectionId':_0x519049['id']},{})[_0x3ee9('0x25')](function(){return _0x19ea60;});}else{return _0x19ea60;}})[_0x3ee9('0x41')](function(_0x44616e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44616e);throw _0x44616e;});}return _0x19ea60;})[_0x3ee9('0x25')](respondWithResult(_0x3e7a1e,0xc9))['catch'](handleError(_0x3e7a1e,null));};exports[_0x3ee9('0x24')]=function(_0x58b4ac,_0x3ba862){if(_0x58b4ac[_0x3ee9('0x47')]['id']){delete _0x58b4ac[_0x3ee9('0x47')]['id'];}return db['CmCompany'][_0x3ee9('0x45')]({'where':{'id':_0x58b4ac[_0x3ee9('0x43')]['id']}})[_0x3ee9('0x25')](handleEntityNotFound(_0x3ba862,null))[_0x3ee9('0x25')](saveUpdates(_0x58b4ac[_0x3ee9('0x47')],null))[_0x3ee9('0x25')](respondWithResult(_0x3ba862,null))[_0x3ee9('0x41')](handleError(_0x3ba862,null));};exports[_0x3ee9('0x29')]=function(_0x1da407,_0x483cbe){return db[_0x3ee9('0x2d')][_0x3ee9('0x45')]({'where':{'id':_0x1da407['params']['id']}})[_0x3ee9('0x25')](handleEntityNotFound(_0x483cbe,null))[_0x3ee9('0x25')](removeEntity(_0x483cbe,null))[_0x3ee9('0x41')](handleError(_0x483cbe,null));};exports[_0x3ee9('0x2e')]=function(_0x900814,_0x29cefc){return db[_0x3ee9('0x2d')]['describe']()[_0x3ee9('0x25')](respondWithResult(_0x29cefc,null))[_0x3ee9('0x41')](handleError(_0x29cefc,null));};exports[_0x3ee9('0x4d')]=function(_0x401846,_0x58cb8b,_0x37d7ec){return db[_0x3ee9('0x4e')][_0x3ee9('0x45')]({'where':{'id':_0x401846[_0x3ee9('0x43')]['id']}})[_0x3ee9('0x25')](handleEntityNotFound(_0x58cb8b,null))[_0x3ee9('0x25')](function(_0x3fc687){if(_0x3fc687){return _0x3fc687[_0x3ee9('0x4d')](_0x401846[_0x3ee9('0x47')][_0x3ee9('0x4f')],_['omit'](_0x401846[_0x3ee9('0x47')],[_0x3ee9('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x58cb8b,null))['catch'](handleError(_0x58cb8b,null));};exports[_0x3ee9('0x50')]=function(_0x147eed,_0xcfa16f,_0x4d3bf2){var _0x1d67c0={};var _0x442ff3={};var _0x3c8340;var _0x286600;return db[_0x3ee9('0x2d')][_0x3ee9('0x51')]({'where':{'id':_0x147eed['params']['id']}})['then'](handleEntityNotFound(_0xcfa16f,null))[_0x3ee9('0x25')](function(_0x497f36){if(_0x497f36){_0x3c8340=_0x497f36;_0x442ff3['model']=_[_0x3ee9('0x30')](db[_0x3ee9('0x4e')]['rawAttributes']);_0x442ff3[_0x3ee9('0x31')]=_['keys'](_0x147eed[_0x3ee9('0x31')]);_0x442ff3[_0x3ee9('0x3a')]=_['intersection'](_0x442ff3[_0x3ee9('0x2f')],_0x442ff3[_0x3ee9('0x31')]);_0x1d67c0[_0x3ee9('0x33')]=_[_0x3ee9('0x32')](_0x442ff3[_0x3ee9('0x2f')],qs[_0x3ee9('0x34')](_0x147eed[_0x3ee9('0x31')][_0x3ee9('0x34')]));_0x1d67c0['attributes']=_0x1d67c0[_0x3ee9('0x33')][_0x3ee9('0x35')]?_0x1d67c0['attributes']:_0x442ff3[_0x3ee9('0x2f')];_0x1d67c0[_0x3ee9('0x37')]=qs[_0x3ee9('0x38')](_0x147eed[_0x3ee9('0x31')][_0x3ee9('0x38')]);_0x1d67c0[_0x3ee9('0x39')]=qs['filters'](_['pick'](_0x147eed[_0x3ee9('0x31')],_0x442ff3[_0x3ee9('0x3a')]));if(_0x147eed[_0x3ee9('0x31')][_0x3ee9('0x3b')]){_0x1d67c0['where']=_['merge'](_0x1d67c0[_0x3ee9('0x39')],{'$or':_[_0x3ee9('0x3c')](_0x1d67c0[_0x3ee9('0x33')],function(_0x1f6d3a){var _0x23a7c5={};_0x23a7c5[_0x1f6d3a]={'$like':'%'+_0x147eed[_0x3ee9('0x31')][_0x3ee9('0x3b')]+'%'};return _0x23a7c5;})});}_0x1d67c0=_['merge']({},_0x1d67c0,_0x147eed[_0x3ee9('0x44')]);return _0x3c8340[_0x3ee9('0x50')](_0x1d67c0);}})[_0x3ee9('0x25')](function(_0x252c2a){if(_0x252c2a){_0x286600=_0x252c2a[_0x3ee9('0x35')];if(!_0x147eed[_0x3ee9('0x31')][_0x3ee9('0x36')](_0x3ee9('0x52'))){_0x1d67c0[_0x3ee9('0x1d')]=qs[_0x3ee9('0x1d')](_0x147eed[_0x3ee9('0x31')]['limit']);_0x1d67c0[_0x3ee9('0x1c')]=qs[_0x3ee9('0x1c')](_0x147eed[_0x3ee9('0x31')][_0x3ee9('0x1c')]);}return _0x3c8340[_0x3ee9('0x50')](_0x1d67c0);}})[_0x3ee9('0x25')](function(_0x2f260d){if(_0x2f260d){return _0x2f260d?{'count':_0x286600,'rows':_0x2f260d}:null;}})['then'](respondWithResult(_0xcfa16f,null))['catch'](handleError(_0xcfa16f,null));};
\ No newline at end of file
+var _0x4b8c=['find','userProfileId','autoAssociation','UserProfileResource','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','findOne','CmContact','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','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','sendStatus','status','offset','limit','undefined','count','json','apply','then','destroy','get','Companies','end','stack','send','index','CmCompany','describe','model','keys','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','options','include','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b8c,0x115));var _0xc4b8=function(_0x308b9c,_0x1a840e){_0x308b9c=_0x308b9c-0x0;var _0x8e7288=_0x4b8c[_0x308b9c];return _0x8e7288;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc4b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc4b8('0x1'));var rp=require(_0xc4b8('0x2'));var moment=require(_0xc4b8('0x3'));var BPromise=require(_0xc4b8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc4b8('0x5'));var sox=require(_0xc4b8('0x6'));var csv=require(_0xc4b8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc4b8('0x8'));var _=require(_0xc4b8('0x9'));var squel=require(_0xc4b8('0xa'));var crypto=require(_0xc4b8('0xb'));var jsforce=require(_0xc4b8('0xc'));var deskjs=require(_0xc4b8('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc4b8('0xe'));var Papa=require(_0xc4b8('0xf'));var Redis=require(_0xc4b8('0x10'));var authService=require(_0xc4b8('0x11'));var qs=require(_0xc4b8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4b8('0x13'));var logger=require(_0xc4b8('0x14'))(_0xc4b8('0x15'));var utils=require(_0xc4b8('0x16'));var config=require(_0xc4b8('0x17'));var licenseUtil=require(_0xc4b8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8cdeae,_0xa024f8){_0xa024f8=_0xa024f8||0xcc;return function(_0x1ca666){if(_0x1ca666){return _0x8cdeae[_0xc4b8('0x19')](_0xa024f8);}return _0x8cdeae[_0xc4b8('0x1a')](_0xa024f8)['end']();};}function respondWithResult(_0x53b7d1,_0x5346c6){_0x5346c6=_0x5346c6||0xc8;return function(_0x78a28c){if(_0x78a28c){return _0x53b7d1[_0xc4b8('0x1a')](_0x5346c6)['json'](_0x78a28c);}};}function respondWithFilteredResult(_0x40bd8f,_0x2e3154){return function(_0x309f97){if(_0x309f97){var _0x385b63=typeof _0x2e3154[_0xc4b8('0x1b')]==='undefined'&&typeof _0x2e3154[_0xc4b8('0x1c')]===_0xc4b8('0x1d');var _0x1812a4=_0x309f97[_0xc4b8('0x1e')];var _0x38f3f8=_0x385b63?0x0:_0x2e3154[_0xc4b8('0x1b')];var _0x41ed8a=_0x385b63?_0x309f97['count']:_0x2e3154['offset']+_0x2e3154['limit'];var _0xf2fc72;if(_0x41ed8a>=_0x1812a4){_0x41ed8a=_0x1812a4;_0xf2fc72=0xc8;}else{_0xf2fc72=0xce;}_0x40bd8f[_0xc4b8('0x1a')](_0xf2fc72);return _0x40bd8f['set']('Content-Range',_0x38f3f8+'-'+_0x41ed8a+'/'+_0x1812a4)[_0xc4b8('0x1f')](_0x309f97);}return null;};}function patchUpdates(_0x1d6ff4){return function(_0x32556f){try{jsonpatch[_0xc4b8('0x20')](_0x32556f,_0x1d6ff4,!![]);}catch(_0x385ee5){return BPromise['reject'](_0x385ee5);}return _0x32556f['save']();};}function saveUpdates(_0x4af354,_0x3b02ec){return function(_0x2b405d){if(_0x2b405d){return _0x2b405d['update'](_0x4af354)[_0xc4b8('0x21')](function(_0x3a3f99){return _0x3a3f99;});}return null;};}function removeEntity(_0x508734,_0x54ccd5){return function(_0x5fc905){if(_0x5fc905){return _0x5fc905[_0xc4b8('0x22')]()[_0xc4b8('0x21')](function(){var _0x5ee1ec=_0x5fc905[_0xc4b8('0x23')]({'plain':!![]});var _0x1dc24e=_0xc4b8('0x24');return db['UserProfileResource'][_0xc4b8('0x22')]({'where':{'type':_0x1dc24e,'resourceId':_0x5ee1ec['id']}})[_0xc4b8('0x21')](function(){return _0x5fc905;});})[_0xc4b8('0x21')](function(){_0x508734[_0xc4b8('0x1a')](0xcc)[_0xc4b8('0x25')]();});}};}function handleEntityNotFound(_0x19071b,_0x86cdf5){return function(_0x5a489e){if(!_0x5a489e){_0x19071b['sendStatus'](0x194);}return _0x5a489e;};}function handleError(_0x7682b0,_0x404cc3){_0x404cc3=_0x404cc3||0x1f4;return function(_0x2a7138){logger['error'](_0x2a7138[_0xc4b8('0x26')]);if(_0x2a7138['name']){delete _0x2a7138['name'];}_0x7682b0['status'](_0x404cc3)[_0xc4b8('0x27')](_0x2a7138);};}exports[_0xc4b8('0x28')]=function(_0x39bc74,_0x11ff24){var _0x820b70={},_0x169ae5={},_0x429af9={'count':0x0,'rows':[]};return db[_0xc4b8('0x29')][_0xc4b8('0x2a')]()[_0xc4b8('0x21')](function(_0x2d9c3f){_0x169ae5[_0xc4b8('0x2b')]=_[_0xc4b8('0x2c')](_0x2d9c3f);_0x169ae5[_0xc4b8('0x2d')]=_[_0xc4b8('0x2c')](_0x39bc74[_0xc4b8('0x2d')]);_0x169ae5['filters']=_['intersection'](_0x169ae5['model'],_0x169ae5[_0xc4b8('0x2d')]);_0x820b70['attributes']=_['intersection'](_0x169ae5['model'],qs[_0xc4b8('0x2e')](_0x39bc74[_0xc4b8('0x2d')][_0xc4b8('0x2e')]));_0x820b70[_0xc4b8('0x2f')]=_0x820b70['attributes'][_0xc4b8('0x30')]?_0x820b70[_0xc4b8('0x2f')]:_0x169ae5[_0xc4b8('0x2b')];if(!_0x39bc74['query'][_0xc4b8('0x31')](_0xc4b8('0x32'))){_0x820b70[_0xc4b8('0x1c')]=qs[_0xc4b8('0x1c')](_0x39bc74['query'][_0xc4b8('0x1c')]);_0x820b70['offset']=qs[_0xc4b8('0x1b')](_0x39bc74[_0xc4b8('0x2d')][_0xc4b8('0x1b')]);}_0x820b70[_0xc4b8('0x33')]=qs[_0xc4b8('0x34')](_0x39bc74[_0xc4b8('0x2d')][_0xc4b8('0x34')]);_0x820b70[_0xc4b8('0x35')]=qs['filters'](_[_0xc4b8('0x36')](_0x39bc74[_0xc4b8('0x2d')],_0x169ae5[_0xc4b8('0x37')]),_0x2d9c3f);if(_0x39bc74['query'][_0xc4b8('0x38')]){_0x820b70[_0xc4b8('0x35')]=_[_0xc4b8('0x39')](_0x820b70[_0xc4b8('0x35')],{'$or':_[_0xc4b8('0x3a')](_0x820b70[_0xc4b8('0x2f')],function(_0x3460e4){var _0xe3a3d0={};_0xe3a3d0[_0x3460e4]={'$like':'%'+_0x39bc74[_0xc4b8('0x2d')][_0xc4b8('0x38')]+'%'};return _0xe3a3d0;})});}_0x820b70=_['merge']({},_0x820b70,_0x39bc74[_0xc4b8('0x3b')]);var _0x3d2863={'where':_0x820b70['where']};return db[_0xc4b8('0x29')][_0xc4b8('0x1e')](_0x3d2863)[_0xc4b8('0x21')](function(_0x11088d){_0x429af9[_0xc4b8('0x1e')]=_0x11088d;if(_0x39bc74[_0xc4b8('0x2d')]['includeAll']){_0x820b70[_0xc4b8('0x3c')]=[{'all':!![]}];}return db[_0xc4b8('0x29')][_0xc4b8('0x3d')](_0x820b70);})['then'](function(_0x5859da){_0x429af9[_0xc4b8('0x3e')]=_0x5859da;return _0x429af9;})[_0xc4b8('0x21')](respondWithFilteredResult(_0x11ff24,_0x820b70))['catch'](handleError(_0x11ff24,null));})[_0xc4b8('0x3f')](handleError(_0x11ff24,null));};exports[_0xc4b8('0x40')]=function(_0x61203c,_0x5efd22){var _0x445f0f={'raw':![],'where':{'id':_0x61203c[_0xc4b8('0x41')]['id']}},_0x459875={};_0x459875[_0xc4b8('0x2b')]=_['keys'](db[_0xc4b8('0x29')][_0xc4b8('0x42')]);_0x459875[_0xc4b8('0x2d')]=_[_0xc4b8('0x2c')](_0x61203c[_0xc4b8('0x2d')]);_0x459875[_0xc4b8('0x37')]=_[_0xc4b8('0x43')](_0x459875[_0xc4b8('0x2b')],_0x459875['query']);_0x445f0f[_0xc4b8('0x2f')]=_[_0xc4b8('0x43')](_0x459875[_0xc4b8('0x2b')],qs['fields'](_0x61203c[_0xc4b8('0x2d')][_0xc4b8('0x2e')]));_0x445f0f[_0xc4b8('0x2f')]=_0x445f0f['attributes']['length']?_0x445f0f[_0xc4b8('0x2f')]:_0x459875[_0xc4b8('0x2b')];if(_0x61203c[_0xc4b8('0x2d')][_0xc4b8('0x44')]){_0x445f0f[_0xc4b8('0x3c')]=[{'all':!![]}];}_0x445f0f=_[_0xc4b8('0x39')]({},_0x445f0f,_0x61203c[_0xc4b8('0x3b')]);return db[_0xc4b8('0x29')]['find'](_0x445f0f)[_0xc4b8('0x21')](handleEntityNotFound(_0x5efd22,null))['then'](respondWithResult(_0x5efd22,null))[_0xc4b8('0x3f')](handleError(_0x5efd22,null));};exports[_0xc4b8('0x45')]=function(_0x46a60d,_0x25720a){return db[_0xc4b8('0x29')][_0xc4b8('0x45')](_0x46a60d[_0xc4b8('0x46')],{})[_0xc4b8('0x21')](function(_0x4bd98a){var _0x2f88cc=_0x46a60d['user'][_0xc4b8('0x23')]({'plain':!![]});if(!_0x2f88cc)throw new Error(_0xc4b8('0x47'));if(_0x2f88cc[_0xc4b8('0x48')]===_0xc4b8('0x49')){var _0x54460b=_0x4bd98a[_0xc4b8('0x23')]({'plain':!![]});var _0x301e53='Companies';return db[_0xc4b8('0x4a')][_0xc4b8('0x4b')]({'where':{'name':_0x301e53,'userProfileId':_0x2f88cc[_0xc4b8('0x4c')]},'raw':!![]})[_0xc4b8('0x21')](function(_0x47ebcf){if(_0x47ebcf&&_0x47ebcf[_0xc4b8('0x4d')]===0x0){return db[_0xc4b8('0x4e')]['create']({'name':_0x54460b[_0xc4b8('0x4f')],'resourceId':_0x54460b['id'],'type':_0x47ebcf[_0xc4b8('0x4f')],'sectionId':_0x47ebcf['id']},{})['then'](function(){return _0x4bd98a;});}else{return _0x4bd98a;}})['catch'](function(_0x2b6f03){logger[_0xc4b8('0x50')](_0xc4b8('0x51'),_0x2b6f03);throw _0x2b6f03;});}return _0x4bd98a;})[_0xc4b8('0x21')](respondWithResult(_0x25720a,0xc9))['catch'](handleError(_0x25720a,null));};exports['update']=function(_0x46a711,_0x5c3e8d){if(_0x46a711['body']['id']){delete _0x46a711[_0xc4b8('0x46')]['id'];}return db[_0xc4b8('0x29')][_0xc4b8('0x4b')]({'where':{'id':_0x46a711[_0xc4b8('0x41')]['id']}})[_0xc4b8('0x21')](handleEntityNotFound(_0x5c3e8d,null))['then'](saveUpdates(_0x46a711[_0xc4b8('0x46')],null))[_0xc4b8('0x21')](respondWithResult(_0x5c3e8d,null))[_0xc4b8('0x3f')](handleError(_0x5c3e8d,null));};exports[_0xc4b8('0x22')]=function(_0x471da2,_0x5f1c92){return db[_0xc4b8('0x29')][_0xc4b8('0x4b')]({'where':{'id':_0x471da2[_0xc4b8('0x41')]['id']}})[_0xc4b8('0x21')](handleEntityNotFound(_0x5f1c92,null))[_0xc4b8('0x21')](removeEntity(_0x5f1c92,null))[_0xc4b8('0x3f')](handleError(_0x5f1c92,null));};exports[_0xc4b8('0x2a')]=function(_0x6d23b6,_0x16d001){return db[_0xc4b8('0x29')][_0xc4b8('0x2a')]()[_0xc4b8('0x21')](respondWithResult(_0x16d001,null))[_0xc4b8('0x3f')](handleError(_0x16d001,null));};exports[_0xc4b8('0x52')]=function(_0x58da60,_0x544f1d,_0x17a99e){return db['CmContact']['find']({'where':{'id':_0x58da60[_0xc4b8('0x41')]['id']}})['then'](handleEntityNotFound(_0x544f1d,null))[_0xc4b8('0x21')](function(_0x1a9a32){if(_0x1a9a32){return _0x1a9a32[_0xc4b8('0x52')](_0x58da60[_0xc4b8('0x46')][_0xc4b8('0x53')],_[_0xc4b8('0x54')](_0x58da60[_0xc4b8('0x46')],[_0xc4b8('0x53'),'id'])||{});}})['then'](respondWithResult(_0x544f1d,null))['catch'](handleError(_0x544f1d,null));};exports[_0xc4b8('0x55')]=function(_0xd09a39,_0x487fe8,_0x432267){var _0x4cddc1={};var _0x42a615={};var _0x273241;var _0x5a5a9a;return db[_0xc4b8('0x29')][_0xc4b8('0x56')]({'where':{'id':_0xd09a39[_0xc4b8('0x41')]['id']}})[_0xc4b8('0x21')](handleEntityNotFound(_0x487fe8,null))[_0xc4b8('0x21')](function(_0x4a8709){if(_0x4a8709){_0x273241=_0x4a8709;_0x42a615[_0xc4b8('0x2b')]=_['keys'](db[_0xc4b8('0x57')][_0xc4b8('0x42')]);_0x42a615['query']=_[_0xc4b8('0x2c')](_0xd09a39[_0xc4b8('0x2d')]);_0x42a615[_0xc4b8('0x37')]=_['intersection'](_0x42a615['model'],_0x42a615[_0xc4b8('0x2d')]);_0x4cddc1['attributes']=_[_0xc4b8('0x43')](_0x42a615[_0xc4b8('0x2b')],qs[_0xc4b8('0x2e')](_0xd09a39[_0xc4b8('0x2d')][_0xc4b8('0x2e')]));_0x4cddc1['attributes']=_0x4cddc1[_0xc4b8('0x2f')][_0xc4b8('0x30')]?_0x4cddc1[_0xc4b8('0x2f')]:_0x42a615['model'];_0x4cddc1['order']=qs[_0xc4b8('0x34')](_0xd09a39['query']['sort']);_0x4cddc1[_0xc4b8('0x35')]=qs[_0xc4b8('0x37')](_[_0xc4b8('0x36')](_0xd09a39[_0xc4b8('0x2d')],_0x42a615[_0xc4b8('0x37')]));if(_0xd09a39[_0xc4b8('0x2d')][_0xc4b8('0x38')]){_0x4cddc1[_0xc4b8('0x35')]=_[_0xc4b8('0x39')](_0x4cddc1[_0xc4b8('0x35')],{'$or':_[_0xc4b8('0x3a')](_0x4cddc1['attributes'],function(_0x34c698){var _0x5c624e={};_0x5c624e[_0x34c698]={'$like':'%'+_0xd09a39['query'][_0xc4b8('0x38')]+'%'};return _0x5c624e;})});}_0x4cddc1=_[_0xc4b8('0x39')]({},_0x4cddc1,_0xd09a39[_0xc4b8('0x3b')]);return _0x273241[_0xc4b8('0x55')](_0x4cddc1);}})['then'](function(_0xe74894){if(_0xe74894){_0x5a5a9a=_0xe74894[_0xc4b8('0x30')];if(!_0xd09a39[_0xc4b8('0x2d')][_0xc4b8('0x31')]('nolimit')){_0x4cddc1[_0xc4b8('0x1c')]=qs[_0xc4b8('0x1c')](_0xd09a39[_0xc4b8('0x2d')][_0xc4b8('0x1c')]);_0x4cddc1['offset']=qs[_0xc4b8('0x1b')](_0xd09a39['query'][_0xc4b8('0x1b')]);}return _0x273241[_0xc4b8('0x55')](_0x4cddc1);}})['then'](function(_0x1fb371){if(_0x1fb371){return _0x1fb371?{'count':_0x5a5a9a,'rows':_0x1fb371}:null;}})[_0xc4b8('0x21')](respondWithResult(_0x487fe8,null))[_0xc4b8('0x3f')](handleError(_0x487fe8,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 98d578a..5cda857 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 _0x3243=['CmCompany','cm_companies','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x3f2d02,_0x2c7deb){var _0x54092b=function(_0x427ff8){while(--_0x427ff8){_0x3f2d02['push'](_0x3f2d02['shift']());}};_0x54092b(++_0x2c7deb);}(_0x3243,0x188));var _0x3324=function(_0x125217,_0x1732ba){_0x125217=_0x125217-0x0;var _0x67dfb1=_0x3243[_0x125217];return _0x67dfb1;};'use strict';var _=require('lodash');var util=require(_0x3324('0x0'));var logger=require(_0x3324('0x1'))(_0x3324('0x2'));var moment=require('moment');var BPromise=require(_0x3324('0x3'));var rp=require(_0x3324('0x4'));var fs=require('fs');var path=require(_0x3324('0x5'));var rimraf=require(_0x3324('0x6'));var config=require(_0x3324('0x7'));var attributes=require(_0x3324('0x8'));module[_0x3324('0x9')]=function(_0x3b07f0,_0x27336e){return _0x3b07f0[_0x3324('0xa')](_0x3324('0xb'),attributes,{'tableName':_0x3324('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdf18=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','cm_companies','lodash','util','../../config/logger','api'];(function(_0x23a4dc,_0xe2e6da){var _0x20a866=function(_0x10688a){while(--_0x10688a){_0x23a4dc['push'](_0x23a4dc['shift']());}};_0x20a866(++_0xe2e6da);}(_0xdf18,0xb2));var _0x8df1=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0xdf18[_0x79b649];return _0x1af9b1;};'use strict';var _=require(_0x8df1('0x0'));var util=require(_0x8df1('0x1'));var logger=require(_0x8df1('0x2'))(_0x8df1('0x3'));var moment=require(_0x8df1('0x4'));var BPromise=require(_0x8df1('0x5'));var rp=require(_0x8df1('0x6'));var fs=require('fs');var path=require(_0x8df1('0x7'));var rimraf=require(_0x8df1('0x8'));var config=require(_0x8df1('0x9'));var attributes=require(_0x8df1('0xa'));module[_0x8df1('0xb')]=function(_0x2f0ab4,_0x2c996d){return _0x2f0ab4[_0x8df1('0xc')]('CmCompany',attributes,{'tableName':_0x8df1('0xd'),'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 0111047..17222f0 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 _0xd676=['request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x12adc,_0x1bb467){var _0x547ee0=function(_0x31af14){while(--_0x31af14){_0x12adc['push'](_0x12adc['shift']());}};_0x547ee0(++_0x1bb467);}(_0xd676,0x146));var _0x6d67=function(_0x48535c,_0x33c086){_0x48535c=_0x48535c-0x0;var _0x2cf084=_0xd676[_0x48535c];return _0x2cf084;};'use strict';var _=require(_0x6d67('0x0'));var util=require(_0x6d67('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6d67('0x2'));var fs=require('fs');var Redis=require(_0x6d67('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d67('0x4'));var logger=require(_0x6d67('0x5'))(_0x6d67('0x6'));var config=require('../../config/environment');var jayson=require(_0x6d67('0x7'));var client=jayson[_0x6d67('0x8')][_0x6d67('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x496481,_0x3baee3,_0x1be523){return new BPromise(function(_0x411a33,_0xe22eac){return client[_0x6d67('0xa')](_0x496481,_0x1be523)[_0x6d67('0xb')](function(_0x5a2245){logger[_0x6d67('0xc')](_0x6d67('0xd'),_0x3baee3,'request\x20sent');logger[_0x6d67('0xe')](_0x6d67('0xf'),_0x3baee3,'request\x20sent',JSON['stringify'](_0x5a2245));if(_0x5a2245[_0x6d67('0x10')]){if(_0x5a2245[_0x6d67('0x10')]['code']===0x1f4){logger[_0x6d67('0x10')](_0x6d67('0xd'),_0x3baee3,_0x5a2245[_0x6d67('0x10')][_0x6d67('0x11')]);return _0xe22eac(_0x5a2245[_0x6d67('0x10')][_0x6d67('0x11')]);}logger[_0x6d67('0x10')](_0x6d67('0xd'),_0x3baee3,_0x5a2245[_0x6d67('0x10')][_0x6d67('0x11')]);return _0x411a33(_0x5a2245['error'][_0x6d67('0x11')]);}else{logger['info'](_0x6d67('0xd'),_0x3baee3,_0x6d67('0x12'));_0x411a33(_0x5a2245[_0x6d67('0x13')][_0x6d67('0x11')]);}})[_0x6d67('0x14')](function(_0x521aa3){logger[_0x6d67('0x10')](_0x6d67('0xd'),_0x3baee3,_0x521aa3);_0xe22eac(_0x521aa3);});});}
\ No newline at end of file
+var _0xd895=['request\x20sent','debug','stringify','error','CmCompany,\x20%s,\x20%s','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x36a3fc,_0x54b61d){var _0x364501=function(_0x881910){while(--_0x881910){_0x36a3fc['push'](_0x36a3fc['shift']());}};_0x364501(++_0x54b61d);}(_0xd895,0x1e1));var _0x5d89=function(_0x59734f,_0x2c9524){_0x59734f=_0x59734f-0x0;var _0xbc0ede=_0xd895[_0x59734f];return _0xbc0ede;};'use strict';var _=require(_0x5d89('0x0'));var util=require(_0x5d89('0x1'));var moment=require('moment');var BPromise=require(_0x5d89('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d89('0x3'));var db=require(_0x5d89('0x4'))['db'];var utils=require(_0x5d89('0x5'));var logger=require(_0x5d89('0x6'))('rpc');var config=require(_0x5d89('0x7'));var jayson=require(_0x5d89('0x8'));var client=jayson['client'][_0x5d89('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e2767,_0x560c7e,_0x4bfc7d){return new BPromise(function(_0x523b7c,_0x3e34d0){return client[_0x5d89('0xa')](_0x4e2767,_0x4bfc7d)[_0x5d89('0xb')](function(_0x2f8ada){logger[_0x5d89('0xc')]('CmCompany,\x20%s,\x20%s',_0x560c7e,_0x5d89('0xd'));logger[_0x5d89('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x560c7e,_0x5d89('0xd'),JSON[_0x5d89('0xf')](_0x2f8ada));if(_0x2f8ada[_0x5d89('0x10')]){if(_0x2f8ada['error']['code']===0x1f4){logger[_0x5d89('0x10')](_0x5d89('0x11'),_0x560c7e,_0x2f8ada[_0x5d89('0x10')][_0x5d89('0x12')]);return _0x3e34d0(_0x2f8ada[_0x5d89('0x10')][_0x5d89('0x12')]);}logger['error'](_0x5d89('0x11'),_0x560c7e,_0x2f8ada[_0x5d89('0x10')]['message']);return _0x523b7c(_0x2f8ada[_0x5d89('0x10')][_0x5d89('0x12')]);}else{logger[_0x5d89('0xc')]('CmCompany,\x20%s,\x20%s',_0x560c7e,'request\x20sent');_0x523b7c(_0x2f8ada['result'][_0x5d89('0x12')]);}})['catch'](function(_0x28c8e0){logger[_0x5d89('0x10')](_0x5d89('0x11'),_0x560c7e,_0x28c8e0);_0x3e34d0(_0x28c8e0);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 309e6e4..30539cc 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 _0x2f99=['post','create','addContacts','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./cmCompany.controller','get','isAuthenticated','/describe','/:id/contacts'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0x2f99,0x184));var _0x92f9=function(_0x29dedd,_0x3c7419){_0x29dedd=_0x29dedd-0x0;var _0x4e6d4f=_0x2f99[_0x29dedd];return _0x4e6d4f;};'use strict';var multer=require(_0x92f9('0x0'));var util=require(_0x92f9('0x1'));var path=require(_0x92f9('0x2'));var timeout=require(_0x92f9('0x3'));var express=require(_0x92f9('0x4'));var router=express['Router']();var fs_extra=require(_0x92f9('0x5'));var auth=require(_0x92f9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x92f9('0x7'));router[_0x92f9('0x8')]('/',auth[_0x92f9('0x9')](),controller['index']);router['get'](_0x92f9('0xa'),auth[_0x92f9('0x9')](),controller['describe']);router[_0x92f9('0x8')]('/:id',auth[_0x92f9('0x9')](),controller['show']);router[_0x92f9('0x8')](_0x92f9('0xb'),auth['isAuthenticated'](),controller['getContacts']);router[_0x92f9('0xc')]('/',auth['isAuthenticated'](),controller[_0x92f9('0xd')]);router[_0x92f9('0xc')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x92f9('0xe')]);router[_0x92f9('0xf')](_0x92f9('0x10'),auth[_0x92f9('0x9')](),controller['update']);router[_0x92f9('0x11')](_0x92f9('0x10'),auth[_0x92f9('0x9')](),controller[_0x92f9('0x12')]);module[_0x92f9('0x13')]=router;
\ No newline at end of file
+var _0xda21=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','show','/:id/contacts','getContacts','post','create','addContacts','put','/:id','delete','destroy','multer','util'];(function(_0x6e6892,_0x3eda78){var _0x89a9fc=function(_0x339810){while(--_0x339810){_0x6e6892['push'](_0x6e6892['shift']());}};_0x89a9fc(++_0x3eda78);}(_0xda21,0x11c));var _0x1da2=function(_0x379aff,_0x3fb886){_0x379aff=_0x379aff-0x0;var _0x43150b=_0xda21[_0x379aff];return _0x43150b;};'use strict';var multer=require(_0x1da2('0x0'));var util=require(_0x1da2('0x1'));var path=require(_0x1da2('0x2'));var timeout=require(_0x1da2('0x3'));var express=require(_0x1da2('0x4'));var router=express[_0x1da2('0x5')]();var fs_extra=require(_0x1da2('0x6'));var auth=require(_0x1da2('0x7'));var interaction=require(_0x1da2('0x8'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x1da2('0x9')]('/',auth[_0x1da2('0xa')](),controller['index']);router['get']('/describe',auth[_0x1da2('0xa')](),controller[_0x1da2('0xb')]);router[_0x1da2('0x9')]('/:id',auth[_0x1da2('0xa')](),controller[_0x1da2('0xc')]);router[_0x1da2('0x9')](_0x1da2('0xd'),auth['isAuthenticated'](),controller[_0x1da2('0xe')]);router[_0x1da2('0xf')]('/',auth['isAuthenticated'](),controller[_0x1da2('0x10')]);router[_0x1da2('0xf')](_0x1da2('0xd'),auth[_0x1da2('0xa')](),controller[_0x1da2('0x11')]);router[_0x1da2('0x12')](_0x1da2('0x13'),auth[_0x1da2('0xa')](),controller['update']);router[_0x1da2('0x14')](_0x1da2('0x13'),auth[_0x1da2('0xa')](),controller[_0x1da2('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 60c50ad..2ee4afb 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 _0x0b34=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x1eafee,_0x3f5d73){var _0x356c18=function(_0x3f6514){while(--_0x3f6514){_0x1eafee['push'](_0x1eafee['shift']());}};_0x356c18(++_0x3f5d73);}(_0x0b34,0x6b));var _0x40b3=function(_0x58603b,_0x12e69d){_0x58603b=_0x58603b-0x0;var _0x34048d=_0x0b34[_0x58603b];return _0x34048d;};'use strict';var _=require(_0x40b3('0x0'));var Sequelize=require(_0x40b3('0x1'));module[_0x40b3('0x2')]={'firstName':{'type':Sequelize[_0x40b3('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x40b3('0x3')]},'street':{'type':Sequelize[_0x40b3('0x3')]},'postalCode':{'type':Sequelize[_0x40b3('0x3')]},'city':{'type':Sequelize[_0x40b3('0x3')]},'country':{'type':Sequelize[_0x40b3('0x3')]},'dateOfBirth':{'type':Sequelize[_0x40b3('0x3')]},'description':{'type':Sequelize[_0x40b3('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x40b3('0x3')]},'fax':{'type':Sequelize[_0x40b3('0x3')]},'email':{'type':Sequelize[_0x40b3('0x3')]},'url':{'type':Sequelize[_0x40b3('0x3')]},'facebook':{'type':Sequelize[_0x40b3('0x3')]},'fb_data':{'type':Sequelize[_0x40b3('0x3')]},'twitter':{'type':Sequelize[_0x40b3('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x40b3('0x3')]},'viber':{'type':Sequelize[_0x40b3('0x3')]},'line':{'type':Sequelize[_0x40b3('0x3')]},'wechat':{'type':Sequelize[_0x40b3('0x3')]},'telegram':{'type':Sequelize[_0x40b3('0x3')]},'UserId':{'type':Sequelize[_0x40b3('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x40b3('0x5')](0x2)[_0x40b3('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x40b3('0x7')],'defaultValue':Sequelize[_0x40b3('0x8')]},'dialTimezone':{'type':Sequelize[_0x40b3('0x3')]},'utcOffset':{'type':Sequelize[_0x40b3('0x5')]}};
\ No newline at end of file
+var _0x3b64=['UNSIGNED','DATE','lodash','sequelize','exports','STRING','INTEGER'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x3b64,0x1d0));var _0x43b6=function(_0x16c3d6,_0x42b416){_0x16c3d6=_0x16c3d6-0x0;var _0x5a6803=_0x3b64[_0x16c3d6];return _0x5a6803;};'use strict';var _=require(_0x43b6('0x0'));var Sequelize=require(_0x43b6('0x1'));module[_0x43b6('0x2')]={'firstName':{'type':Sequelize[_0x43b6('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x43b6('0x3')]},'street':{'type':Sequelize[_0x43b6('0x3')]},'postalCode':{'type':Sequelize[_0x43b6('0x3')]},'city':{'type':Sequelize[_0x43b6('0x3')]},'country':{'type':Sequelize[_0x43b6('0x3')]},'dateOfBirth':{'type':Sequelize[_0x43b6('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x43b6('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x43b6('0x3')]},'email':{'type':Sequelize[_0x43b6('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x43b6('0x3')]},'skype':{'type':Sequelize[_0x43b6('0x3')]},'teams':{'type':Sequelize[_0x43b6('0x3')]},'viber':{'type':Sequelize[_0x43b6('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x43b6('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x43b6('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x43b6('0x4')](0x2)[_0x43b6('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x43b6('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x43b6('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 378796e..e18b100 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 _0x3b19=['name','send','index','describe','getOptions','findAll','query','catch','CmContact','find','keys','length','startsWith','columnName','displayName','analytics','CmCustomField','cf_','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','from','get','mergeWith','tags','isArray','join','[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','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','utcOffset','timezones','additionalPhones','each','duplicates','$or','push','where','ListId','findOrCreate','hasOwnProperty','contact','show','params','Tag','Tags','color','tag','CmContactHasItem','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','omit','map','format','cf_%d','pickBy','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','text','phone','getTags','findOne','model','rawAttributes','filters','attributes','fields','sort','pick','filter','options','nolimit','setTags','ids','all','items','item_types','ItemTypeId','OrderBy','PHONE','CmHopperAdditionalPhone','`ItemType`.OrderBy','item','ItemType.OrderBy','bulkCreate','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','intersection','includeAll','rows','ContactId','include','getHopperFinals','getJscriptySessions','order','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','createReadStream','parse','meta','import','User','agent','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','getJourney','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','includes','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','callerid','starttime','endtime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','DESC','VoiceCallReport','findAndCountAll','fullname','startCase','chat','Website','closed','closedAt','note','secondDisposition','thirdDisposition','Account','key','Owner','browserName','customerIp','deviceModel','substatus','externalUrl','threadId','Interaction','flatten','sortBy','reverse','value','bluebird','util','path','squel','papaparse','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','status','offset','undefined','limit','count','set','Content-Range','json','then','destroy','end','sendStatus','error','stack'];(function(_0x26960e,_0x1d9cd3){var _0x19112e=function(_0x295f6e){while(--_0x295f6e){_0x26960e['push'](_0x26960e['shift']());}};_0x19112e(++_0x1d9cd3);}(_0x3b19,0x1e9));var _0x93b1=function(_0x12119e,_0x2c61e6){_0x12119e=_0x12119e-0x0;var _0x42cf30=_0x3b19[_0x12119e];return _0x42cf30;};'use strict';var moment=require('moment');var BPromise=require(_0x93b1('0x0'));var util=require(_0x93b1('0x1'));var path=require(_0x93b1('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x93b1('0x3'));var Papa=require(_0x93b1('0x4'));var Redis=require('ioredis');var contacts=require(_0x93b1('0x5'));var qs=require(_0x93b1('0x6'));var logger=require(_0x93b1('0x7'))(_0x93b1('0x8'));var config=require(_0x93b1('0x9'));var shared=require(_0x93b1('0xa'));var db=require(_0x93b1('0xb'))['db'];config[_0x93b1('0xc')]=_[_0x93b1('0xd')](config[_0x93b1('0xc')],{'host':_0x93b1('0xe'),'port':0x18eb});var socket=require(_0x93b1('0xf'))(new Redis(config[_0x93b1('0xc')]));require(_0x93b1('0x10'))['register'](socket);function respondWithResult(_0x806052,_0x5b49dd){_0x5b49dd=_0x5b49dd||0xc8;return function(_0x82db05){if(_0x82db05){return _0x806052[_0x93b1('0x11')](_0x5b49dd)['json'](_0x82db05);}};}function respondWithFilteredResult(_0x5c4728,_0x3244d8){return function(_0x52f65d){if(_0x52f65d){var _0x3d02f7=typeof _0x3244d8[_0x93b1('0x12')]===_0x93b1('0x13')&&typeof _0x3244d8[_0x93b1('0x14')]===_0x93b1('0x13');var _0x3617d7=_0x52f65d[_0x93b1('0x15')];var _0x250646=_0x3d02f7?0x0:_0x3244d8[_0x93b1('0x12')];var _0x436403=_0x3d02f7?_0x52f65d['count']:_0x3244d8[_0x93b1('0x12')]+_0x3244d8[_0x93b1('0x14')];var _0x160a4b;if(_0x436403>=_0x3617d7){_0x436403=_0x3617d7;_0x160a4b=0xc8;}else{_0x160a4b=0xce;}_0x5c4728[_0x93b1('0x11')](_0x160a4b);return _0x5c4728[_0x93b1('0x16')](_0x93b1('0x17'),_0x250646+'-'+_0x436403+'/'+_0x3617d7)[_0x93b1('0x18')](_0x52f65d);}return null;};}function saveUpdates(_0xdf2815){return function(_0x29712b){if(_0x29712b){return _0x29712b['update'](_0xdf2815)[_0x93b1('0x19')](function(_0x325f5e){return _0x325f5e;});}return null;};}function removeEntity(_0x573758){return function(_0x205718){if(_0x205718){return _0x205718[_0x93b1('0x1a')]()[_0x93b1('0x19')](function(){_0x573758[_0x93b1('0x11')](0xcc)[_0x93b1('0x1b')]();});}};}function handleEntityNotFound(_0xa87f8b){return function(_0x417ec5){if(!_0x417ec5){_0xa87f8b[_0x93b1('0x1c')](0x194);}return _0x417ec5;};}function handleError(_0x1f0877,_0x28d5b4){_0x28d5b4=_0x28d5b4||0x1f4;return function(_0x48a401){logger[_0x93b1('0x1d')](_0x48a401[_0x93b1('0x1e')]);if(_0x48a401[_0x93b1('0x1f')]){delete _0x48a401['name'];}_0x1f0877[_0x93b1('0x11')](_0x28d5b4)[_0x93b1('0x20')](_0x48a401);};}exports[_0x93b1('0x21')]=function(_0x22a17c,_0x4fb3a0){var _0x2c8257={};return contacts[_0x93b1('0x22')]()[_0x93b1('0x19')](function(_0x358f00){_0x2c8257=qs[_0x93b1('0x23')](_0x358f00,_0x22a17c);return contacts[_0x93b1('0x24')](_0x22a17c[_0x93b1('0x25')],_0x22a17c['user'],_0x2c8257,_0x358f00);})['then'](respondWithFilteredResult(_0x4fb3a0,_0x2c8257))[_0x93b1('0x26')](handleError(_0x4fb3a0,null));};exports['destroy']=function(_0x32a888,_0x210932){return db[_0x93b1('0x27')][_0x93b1('0x28')]({'where':{'id':_0x32a888['params']['id']}})['then'](handleEntityNotFound(_0x210932,null))['then'](removeEntity(_0x210932,null))[_0x93b1('0x26')](handleError(_0x210932,null));};exports[_0x93b1('0x22')]=function(_0x3d3724,_0x2f3c0b){return db[_0x93b1('0x27')]['describe']()['then'](function(_0x3b2fc7){delete _0x3b2fc7['tags'];for(var _0xf71b9f=0x0;_0xf71b9f
','Attachments','Title','Data','generateXOAuth2Token','user=','toString','base64','lodash','moment','randomstring','path','node-tnef','email','../../../config/environment','head','address','anonymous','generate','value','name'];(function(_0x9353e9,_0x569417){var _0x23341e=function(_0x11bb7c){while(--_0x11bb7c){_0x9353e9['push'](_0x9353e9['shift']());}};_0x23341e(++_0x569417);}(_0x3edc,0x160));var _0xc3ed=function(_0x3e751a,_0x4804ae){_0x3e751a=_0x3e751a-0x0;var _0x1d5aa1=_0x3edc[_0x3e751a];return _0x1d5aa1;};'use strict';var _=require(_0xc3ed('0x0'));var moment=require(_0xc3ed('0x1'));var random=require(_0xc3ed('0x2'));var fs=require('fs');var path=require(_0xc3ed('0x3'));var util=require('util');var tnef=require(_0xc3ed('0x4'));var logger=require('../../../config/logger')(_0xc3ed('0x5'));var config=require(_0xc3ed('0x6'));function getAddress(_0x526d98){var _0x3f15f5=_[_0xc3ed('0x7')](_0x526d98['value']);return _0x3f15f5&&_0x3f15f5[_0xc3ed('0x8')]?_0x3f15f5[_0xc3ed('0x8')]:_0xc3ed('0x9')+random[_0xc3ed('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x2aa130){var _0x4a55c4=_[_0xc3ed('0x7')](_0x2aa130[_0xc3ed('0xb')]);if(_0x4a55c4&&_0x4a55c4[_0xc3ed('0xc')]){if(_0x4a55c4[_0xc3ed('0xc')]==_0x4a55c4['address']){return _0x4a55c4[_0xc3ed('0xc')]['substring'](0x0,_0x4a55c4[_0xc3ed('0xc')][_0xc3ed('0xd')]('@'));}var _0x348b64=_0x4a55c4[_0xc3ed('0xc')][_0xc3ed('0xe')](/\s+/);return _0x348b64[_0xc3ed('0xf')]>0x1?_0x348b64[_0xc3ed('0x10')](0x0,-0x1)[_0xc3ed('0x11')]('\x20'):_0x4a55c4[_0xc3ed('0xc')];}return'Anonymous';}function getLastName(_0x5ef050){var _0x337df8=_['head'](_0x5ef050['value']);if(_0x337df8&&_0x337df8[_0xc3ed('0xc')]){var _0x13863b=_0x337df8[_0xc3ed('0xc')][_0xc3ed('0xe')](/\s+/);return _0x13863b[_0xc3ed('0xf')]>0x1?_0x13863b[_0xc3ed('0x12')]():'';}return'';}function getMails(_0x442337,_0x2fb91f){var _0x4a42b1='';for(var _0x1c404c=0x0;_0x1c404c<_0x2fb91f[_0xc3ed('0xb')]['length'];_0x1c404c+=0x1){if(_0x2fb91f[_0xc3ed('0xb')][_0x1c404c][_0xc3ed('0x8')]!==_0x442337){if(!_[_0xc3ed('0x13')](_0x4a42b1)){_0x4a42b1+=',';}_0x4a42b1+=_0x2fb91f[_0xc3ed('0xb')][_0x1c404c][_0xc3ed('0xc')]||_0x2fb91f[_0xc3ed('0xb')][_0x1c404c]['address']||'';_0x4a42b1+='\x20<';_0x4a42b1+=_0x2fb91f[_0xc3ed('0xb')][_0x1c404c][_0xc3ed('0x8')]?_0x2fb91f['value'][_0x1c404c][_0xc3ed('0x8')]:_0xc3ed('0x9')+random[_0xc3ed('0xa')](0x6)+'@xcally.com';_0x4a42b1+='>';}}return _0x4a42b1;}function parseEmail(_0x28983d,_0x422f6d,_0x33f7cb){if(_0x422f6d['html']){var _0x27a78d=/