From: support
Date: Tue, 4 Apr 2023 07:53:19 +0000 (+0000)
Subject: Built motion from commit 511216ff.|2.6.34
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=5d208f93332d20e93b1c8c83fce82ebc382519df;p=motion2.git
Built motion from commit 511216ff.|2.6.34
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 137a5a3..0c3d32a 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-04-04T07:25:29.663Z",
+ "time": "2023-04-04T07:41:54.877Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 5317a45..d2ff86a 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-04-04T07:25:29.663Z",
+ "time": "2023-04-04T07:41:54.877Z",
"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 62c3afe..87d1f5f 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 _0x5ff9=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','action','contactManager','integration','motionbar','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING'];(function(_0x3da096,_0x59b644){var _0x144fbf=function(_0x14c243){while(--_0x14c243){_0x3da096['push'](_0x3da096['shift']());}};_0x144fbf(++_0x59b644);}(_0x5ff9,0x155));var _0x95ff=function(_0x3262c5,_0x2773e0){_0x3262c5=_0x3262c5-0x0;var _0x2737da=_0x5ff9[_0x3262c5];return _0x2737da;};'use strict';var Sequelize=require(_0x95ff('0x0'));module[_0x95ff('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x312ecc){return this['getDataValue'](_0x95ff('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x95ff('0x3'),_0x95ff('0x4'),_0x95ff('0x5'),_0x95ff('0x6'),'urlForward','browser',_0x95ff('0x7'),_0x95ff('0x8')]],'msg':_0x95ff('0x9')}},'comment':_0x95ff('0x9')},'data1':{'type':Sequelize[_0x95ff('0xa')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x95ff('0xa')](0x1000),'comment':_0x95ff('0xb')},'data3':{'type':Sequelize[_0x95ff('0xa')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x95ff('0xa')](0x1000),'comments':_0x95ff('0xc')},'data5':{'type':Sequelize[_0x95ff('0xa')](0x1000),'comments':_0x95ff('0xd')},'data6':{'type':Sequelize[_0x95ff('0xa')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x95ff('0xe')],'comments':_0x95ff('0xf')}};
\ No newline at end of file
+var _0x6af2=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','getDataValue','STRING','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6af2,0x1d9));var _0x26af=function(_0x1c11a6,_0x154a32){_0x1c11a6=_0x1c11a6-0x0;var _0x1d9786=_0x6af2[_0x1c11a6];return _0x1d9786;};'use strict';var Sequelize=require(_0x26af('0x0'));module[_0x26af('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x191a6d){return this[_0x26af('0x2')]('action');}},'action':{'type':Sequelize[_0x26af('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x26af('0x4'),_0x26af('0x5'),_0x26af('0x6'),_0x26af('0x7'),_0x26af('0x8'),_0x26af('0x9'),_0x26af('0xa')]],'msg':_0x26af('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x26af('0x3')](0x1000),'comment':_0x26af('0xc')},'data2':{'type':Sequelize[_0x26af('0x3')](0x1000),'comment':_0x26af('0xd')},'data3':{'type':Sequelize[_0x26af('0x3')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x26af('0x3')](0x1000),'comments':_0x26af('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x26af('0xf')},'data6':{'type':Sequelize['STRING'],'comments':_0x26af('0x10')},'data7':{'type':Sequelize[_0x26af('0x11')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 5d8ae06..25a5892 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 _0x5709=['apply','reject','save','update','then','destroy','end','error','stack','name','body','params','catch','Action','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','count','offset','limit','json'];(function(_0x11a83e,_0x1533ee){var _0xbd3bd5=function(_0xc15afd){while(--_0xc15afd){_0x11a83e['push'](_0x11a83e['shift']());}};_0xbd3bd5(++_0x1533ee);}(_0x5709,0x158));var _0x9570=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5709[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9570('0x0'));var rimraf=require(_0x9570('0x1'));var zipdir=require(_0x9570('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9570('0x3'));var moment=require(_0x9570('0x4'));var BPromise=require(_0x9570('0x5'));var Mustache=require('mustache');var util=require(_0x9570('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9570('0x7'));var ejs=require(_0x9570('0x8'));var fs=require('fs');var fs_extra=require(_0x9570('0x9'));var _=require(_0x9570('0xa'));var squel=require(_0x9570('0xb'));var crypto=require(_0x9570('0xc'));var jsforce=require(_0x9570('0xd'));var deskjs=require(_0x9570('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9570('0xf'));var Redis=require(_0x9570('0x10'));var authService=require(_0x9570('0x11'));var qs=require(_0x9570('0x12'));var as=require(_0x9570('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9570('0x14'))(_0x9570('0x15'));var utils=require(_0x9570('0x16'));var config=require(_0x9570('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9570('0x18'))['db'];function respondWithStatusCode(_0x4e1e96,_0x2575c5){_0x2575c5=_0x2575c5||0xcc;return function(_0x588aa5){if(_0x588aa5){return _0x4e1e96[_0x9570('0x19')](_0x2575c5);}return _0x4e1e96[_0x9570('0x1a')](_0x2575c5)['end']();};}function respondWithResult(_0x26b898,_0x43a3cd){_0x43a3cd=_0x43a3cd||0xc8;return function(_0xb8d323){if(_0xb8d323){return _0x26b898[_0x9570('0x1a')](_0x43a3cd)['json'](_0xb8d323);}};}function respondWithFilteredResult(_0x29dff8,_0x1e628d){return function(_0x44fad0){if(_0x44fad0){var _0x362ebd=typeof _0x1e628d['offset']===_0x9570('0x1b')&&typeof _0x1e628d['limit']==='undefined';var _0x2c8cac=_0x44fad0[_0x9570('0x1c')];var _0x1ca5ec=_0x362ebd?0x0:_0x1e628d[_0x9570('0x1d')];var _0x8a3dc8=_0x362ebd?_0x44fad0[_0x9570('0x1c')]:_0x1e628d[_0x9570('0x1d')]+_0x1e628d[_0x9570('0x1e')];var _0x427ce3;if(_0x8a3dc8>=_0x2c8cac){_0x8a3dc8=_0x2c8cac;_0x427ce3=0xc8;}else{_0x427ce3=0xce;}_0x29dff8[_0x9570('0x1a')](_0x427ce3);return _0x29dff8['set']('Content-Range',_0x1ca5ec+'-'+_0x8a3dc8+'/'+_0x2c8cac)[_0x9570('0x1f')](_0x44fad0);}return null;};}function patchUpdates(_0x21807d){return function(_0x43cf3e){try{jsonpatch[_0x9570('0x20')](_0x43cf3e,_0x21807d,!![]);}catch(_0x4b0f0a){return BPromise[_0x9570('0x21')](_0x4b0f0a);}return _0x43cf3e[_0x9570('0x22')]();};}function saveUpdates(_0x4508f1,_0x4c7493){return function(_0xaac112){if(_0xaac112){return _0xaac112[_0x9570('0x23')](_0x4508f1)[_0x9570('0x24')](function(_0x5f069){return _0x5f069;});}return null;};}function removeEntity(_0x1104f8,_0x5066bc){return function(_0x2f5032){if(_0x2f5032){return _0x2f5032[_0x9570('0x25')]()[_0x9570('0x24')](function(){_0x1104f8[_0x9570('0x1a')](0xcc)[_0x9570('0x26')]();});}};}function handleEntityNotFound(_0x2c0664,_0x3717b1){return function(_0x48f3bf){if(!_0x48f3bf){_0x2c0664[_0x9570('0x19')](0x194);}return _0x48f3bf;};}function handleError(_0xb402c0,_0xcd2097){_0xcd2097=_0xcd2097||0x1f4;return function(_0x1e7378){logger[_0x9570('0x27')](_0x1e7378[_0x9570('0x28')]);if(_0x1e7378['name']){delete _0x1e7378[_0x9570('0x29')];}_0xb402c0[_0x9570('0x1a')](_0xcd2097)['send'](_0x1e7378);};}exports[_0x9570('0x23')]=function(_0x3ccb08,_0x170a51){if(_0x3ccb08[_0x9570('0x2a')]['id']){delete _0x3ccb08[_0x9570('0x2a')]['id'];}return db['Action']['find']({'where':{'id':_0x3ccb08[_0x9570('0x2b')]['id']}})['then'](handleEntityNotFound(_0x170a51,null))[_0x9570('0x24')](saveUpdates(_0x3ccb08[_0x9570('0x2a')],null))['then'](respondWithResult(_0x170a51,null))[_0x9570('0x2c')](handleError(_0x170a51,null));};exports[_0x9570('0x25')]=function(_0x53edaf,_0x463aa6){return db[_0x9570('0x2d')][_0x9570('0x2e')]({'where':{'id':_0x53edaf[_0x9570('0x2b')]['id']}})[_0x9570('0x24')](handleEntityNotFound(_0x463aa6,null))[_0x9570('0x24')](removeEntity(_0x463aa6,null))[_0x9570('0x2c')](handleError(_0x463aa6,null));};
\ No newline at end of file
+var _0xc76f=['params','catch','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','body','find'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0xc76f,0x1ba));var _0xfc76=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc76f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfc76('0x0'));var rimraf=require(_0xfc76('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc76('0x2'));var rp=require('request-promise');var moment=require(_0xfc76('0x3'));var BPromise=require(_0xfc76('0x4'));var Mustache=require('mustache');var util=require(_0xfc76('0x5'));var path=require(_0xfc76('0x6'));var sox=require(_0xfc76('0x7'));var csv=require('to-csv');var ejs=require(_0xfc76('0x8'));var fs=require('fs');var fs_extra=require(_0xfc76('0x9'));var _=require(_0xfc76('0xa'));var squel=require(_0xfc76('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfc76('0xc'));var toCsv=require(_0xfc76('0xd'));var querystring=require(_0xfc76('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfc76('0xf'));var as=require(_0xfc76('0x10'));var hardwareService=require(_0xfc76('0x11'));var logger=require(_0xfc76('0x12'))(_0xfc76('0x13'));var utils=require(_0xfc76('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5be805,_0x4d038b){_0x4d038b=_0x4d038b||0xcc;return function(_0x292e29){if(_0x292e29){return _0x5be805[_0xfc76('0x15')](_0x4d038b);}return _0x5be805[_0xfc76('0x16')](_0x4d038b)[_0xfc76('0x17')]();};}function respondWithResult(_0x69fc7a,_0x5e9530){_0x5e9530=_0x5e9530||0xc8;return function(_0x2abee2){if(_0x2abee2){return _0x69fc7a['status'](_0x5e9530)[_0xfc76('0x18')](_0x2abee2);}};}function respondWithFilteredResult(_0x5834e0,_0x45ac7a){return function(_0x4a721c){if(_0x4a721c){var _0x2e71dc=typeof _0x45ac7a[_0xfc76('0x19')]===_0xfc76('0x1a')&&typeof _0x45ac7a[_0xfc76('0x1b')]===_0xfc76('0x1a');var _0x542e1c=_0x4a721c['count'];var _0x44a3c=_0x2e71dc?0x0:_0x45ac7a[_0xfc76('0x19')];var _0x39725e=_0x2e71dc?_0x4a721c[_0xfc76('0x1c')]:_0x45ac7a[_0xfc76('0x19')]+_0x45ac7a[_0xfc76('0x1b')];var _0x49cc6b;if(_0x39725e>=_0x542e1c){_0x39725e=_0x542e1c;_0x49cc6b=0xc8;}else{_0x49cc6b=0xce;}_0x5834e0['status'](_0x49cc6b);return _0x5834e0[_0xfc76('0x1d')](_0xfc76('0x1e'),_0x44a3c+'-'+_0x39725e+'/'+_0x542e1c)[_0xfc76('0x18')](_0x4a721c);}return null;};}function patchUpdates(_0x1a0483){return function(_0x431a64){try{jsonpatch[_0xfc76('0x1f')](_0x431a64,_0x1a0483,!![]);}catch(_0x1a8dbb){return BPromise[_0xfc76('0x20')](_0x1a8dbb);}return _0x431a64['save']();};}function saveUpdates(_0x4e673b,_0x5ad14a){return function(_0x547b3a){if(_0x547b3a){return _0x547b3a[_0xfc76('0x21')](_0x4e673b)[_0xfc76('0x22')](function(_0x4f379e){return _0x4f379e;});}return null;};}function removeEntity(_0x128687,_0xbaffad){return function(_0x4790d6){if(_0x4790d6){return _0x4790d6[_0xfc76('0x23')]()[_0xfc76('0x22')](function(){_0x128687['status'](0xcc)[_0xfc76('0x17')]();});}};}function handleEntityNotFound(_0x2d0421,_0x8d4b8){return function(_0x1c8f3d){if(!_0x1c8f3d){_0x2d0421[_0xfc76('0x15')](0x194);}return _0x1c8f3d;};}function handleError(_0x474f1e,_0x3663a3){_0x3663a3=_0x3663a3||0x1f4;return function(_0x1a70bd){logger[_0xfc76('0x24')](_0x1a70bd[_0xfc76('0x25')]);if(_0x1a70bd['name']){delete _0x1a70bd[_0xfc76('0x26')];}_0x474f1e['status'](_0x3663a3)[_0xfc76('0x27')](_0x1a70bd);};}exports[_0xfc76('0x21')]=function(_0x551b81,_0x2a53c1){if(_0x551b81['body']['id']){delete _0x551b81[_0xfc76('0x28')]['id'];}return db['Action'][_0xfc76('0x29')]({'where':{'id':_0x551b81[_0xfc76('0x2a')]['id']}})[_0xfc76('0x22')](handleEntityNotFound(_0x2a53c1,null))[_0xfc76('0x22')](saveUpdates(_0x551b81['body'],null))[_0xfc76('0x22')](respondWithResult(_0x2a53c1,null))[_0xfc76('0x2b')](handleError(_0x2a53c1,null));};exports['destroy']=function(_0x10504c,_0xce724c){return db['Action']['find']({'where':{'id':_0x10504c[_0xfc76('0x2a')]['id']}})[_0xfc76('0x22')](handleEntityNotFound(_0xce724c,null))['then'](removeEntity(_0xce724c,null))[_0xfc76('0x2b')](handleError(_0xce724c,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 3d40cef..47d82a1 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 _0x4d41=['path','rimraf','./action.attributes','exports','define','Action','lodash','../../config/logger','moment','bluebird'];(function(_0x5b734f,_0x474dbe){var _0x50ce5c=function(_0x144911){while(--_0x144911){_0x5b734f['push'](_0x5b734f['shift']());}};_0x50ce5c(++_0x474dbe);}(_0x4d41,0x1a0));var _0x14d4=function(_0x3a833e,_0x5a1878){_0x3a833e=_0x3a833e-0x0;var _0xdff445=_0x4d41[_0x3a833e];return _0xdff445;};'use strict';var _=require(_0x14d4('0x0'));var util=require('util');var logger=require(_0x14d4('0x1'))('api');var moment=require(_0x14d4('0x2'));var BPromise=require(_0x14d4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x14d4('0x4'));var rimraf=require(_0x14d4('0x5'));var config=require('../../config/environment');var attributes=require(_0x14d4('0x6'));module[_0x14d4('0x7')]=function(_0x2b1c1d,_0x2fb9b5){return _0x2b1c1d[_0x14d4('0x8')](_0x14d4('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa893=['path','rimraf','../../config/environment','./action.attributes','exports','define','Action','lodash','util','moment','bluebird','request-promise'];(function(_0x882c95,_0x2fd99f){var _0x26d96b=function(_0x2d73a6){while(--_0x2d73a6){_0x882c95['push'](_0x882c95['shift']());}};_0x26d96b(++_0x2fd99f);}(_0xa893,0x1c3));var _0x3a89=function(_0x39bc8f,_0x5f4e5d){_0x39bc8f=_0x39bc8f-0x0;var _0x162014=_0xa893[_0x39bc8f];return _0x162014;};'use strict';var _=require(_0x3a89('0x0'));var util=require(_0x3a89('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3a89('0x2'));var BPromise=require(_0x3a89('0x3'));var rp=require(_0x3a89('0x4'));var fs=require('fs');var path=require(_0x3a89('0x5'));var rimraf=require(_0x3a89('0x6'));var config=require(_0x3a89('0x7'));var attributes=require(_0x3a89('0x8'));module[_0x3a89('0x9')]=function(_0x3946e7,_0x1b85d0){return _0x3946e7[_0x3a89('0xa')](_0x3a89('0xb'),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 6e87f51..e7737b4 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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\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(_0x2091fd,_0x54cb51){var _0x1169e6=function(_0x205526){while(--_0x205526){_0x2091fd['push'](_0x2091fd['shift']());}};_0x1169e6(++_0x54cb51);}(_0x1261,0x144));var _0x1126=function(_0x1c3b41,_0x50f776){_0x1c3b41=_0x1c3b41-0x0;var _0x41e3fe=_0x1261[_0x1c3b41];return _0x41e3fe;};'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')]('Action,\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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x37de7d,_0x1e80f4){var _0x53211c=function(_0xdfeb92){while(--_0xdfeb92){_0x37de7d['push'](_0x37de7d['shift']());}};_0x53211c(++_0x1e80f4);}(_0x5fc3,0xa8));var _0x35fc=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x5fc3[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 6df1b26..92fe177 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 _0xd3af=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','multer','path'];(function(_0x4291bc,_0x153760){var _0x7167ed=function(_0x433d5c){while(--_0x433d5c){_0x4291bc['push'](_0x4291bc['shift']());}};_0x7167ed(++_0x153760);}(_0xd3af,0x8a));var _0xfd3a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd3af[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xfd3a('0x0'));var util=require('util');var path=require(_0xfd3a('0x1'));var timeout=require('connect-timeout');var express=require(_0xfd3a('0x2'));var router=express[_0xfd3a('0x3')]();var fs_extra=require(_0xfd3a('0x4'));var auth=require(_0xfd3a('0x5'));var interaction=require(_0xfd3a('0x6'));var config=require(_0xfd3a('0x7'));var controller=require(_0xfd3a('0x8'));router['put'](_0xfd3a('0x9'),auth[_0xfd3a('0xa')](),controller[_0xfd3a('0xb')]);router[_0xfd3a('0xc')](_0xfd3a('0x9'),auth['isAuthenticated'](),controller[_0xfd3a('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x94bf=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','delete','destroy','exports','multer','connect-timeout'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x94bf,0x1da));var _0xf94b=function(_0x44c596,_0xe8d581){_0x44c596=_0x44c596-0x0;var _0x37930f=_0x94bf[_0x44c596];return _0x37930f;};'use strict';var multer=require(_0xf94b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf94b('0x1'));var express=require(_0xf94b('0x2'));var router=express[_0xf94b('0x3')]();var fs_extra=require(_0xf94b('0x4'));var auth=require(_0xf94b('0x5'));var interaction=require(_0xf94b('0x6'));var config=require(_0xf94b('0x7'));var controller=require(_0xf94b('0x8'));router['put'](_0xf94b('0x9'),auth[_0xf94b('0xa')](),controller['update']);router[_0xf94b('0xb')](_0xf94b('0x9'),auth[_0xf94b('0xa')](),controller[_0xf94b('0xc')]);module[_0xf94b('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 3c7549c..1b37389 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 _0x31f0=['sequelize','STRING','TEXT'];(function(_0x2ce6ea,_0x4f06f6){var _0x512085=function(_0x315de3){while(--_0x315de3){_0x2ce6ea['push'](_0x2ce6ea['shift']());}};_0x512085(++_0x4f06f6);}(_0x31f0,0xb7));var _0x031f=function(_0x1447fd,_0x313162){_0x1447fd=_0x1447fd-0x0;var _0x721a7e=_0x31f0[_0x1447fd];return _0x721a7e;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}};
\ No newline at end of file
+var _0xa630=['STRING','TEXT','sequelize','exports'];(function(_0x1a8651,_0x5252e4){var _0x50984b=function(_0x37ebfb){while(--_0x37ebfb){_0x1a8651['push'](_0x1a8651['shift']());}};_0x50984b(++_0x5252e4);}(_0xa630,0xbe));var _0x0a63=function(_0x337fb9,_0x2c5935){_0x337fb9=_0x337fb9-0x0;var _0x1e1d20=_0xa630[_0x337fb9];return _0x1e1d20;};'use strict';var Sequelize=require(_0x0a63('0x0'));module[_0x0a63('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x0a63('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x0a63('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 1e6d013..b91f29a 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 _0x1aac=['right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','replace','function','format','groupBy','orderBy','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','toString','sequelize','QueryTypes','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','select','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','SELECT','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','IS\x20NOT\x20NULL','DESC','alias','debug','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','get','CustomReports','UserProfileResource','error','name','send','map','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join'];(function(_0x40b3f2,_0x2c4f5f){var _0x4ce90c=function(_0x516f31){while(--_0x516f31){_0x40b3f2['push'](_0x40b3f2['shift']());}};_0x4ce90c(++_0x2c4f5f);}(_0x1aac,0xf7));var _0xc1aa=function(_0x33eb9b,_0x58cfb6){_0x33eb9b=_0x33eb9b-0x0;var _0x4ee9bd=_0x1aac[_0x33eb9b];return _0x4ee9bd;};'use strict';var emlformat=require(_0xc1aa('0x0'));var rimraf=require(_0xc1aa('0x1'));var zipdir=require(_0xc1aa('0x2'));var jsonpatch=require(_0xc1aa('0x3'));var rp=require(_0xc1aa('0x4'));var moment=require('moment');var BPromise=require(_0xc1aa('0x5'));var Mustache=require(_0xc1aa('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc1aa('0x7'));var csv=require(_0xc1aa('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1aa('0x9'));var squel=require('squel');var crypto=require(_0xc1aa('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc1aa('0x8'));var querystring=require(_0xc1aa('0xb'));var Papa=require(_0xc1aa('0xc'));var Redis=require(_0xc1aa('0xd'));var authService=require(_0xc1aa('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1aa('0xf'));var logger=require(_0xc1aa('0x10'))(_0xc1aa('0x11'));var utils=require(_0xc1aa('0x12'));var config=require(_0xc1aa('0x13'));var licenseUtil=require(_0xc1aa('0x14'));var db=require(_0xc1aa('0x15'))['db'];var dbH=require('../../mysqldb')[_0xc1aa('0x16')];function respondWithStatusCode(_0x44eeb3,_0x41a57c){_0x41a57c=_0x41a57c||0xcc;return function(_0xb69689){if(_0xb69689){return _0x44eeb3[_0xc1aa('0x17')](_0x41a57c);}return _0x44eeb3[_0xc1aa('0x18')](_0x41a57c)['end']();};}function respondWithResult(_0x393fb2,_0x4a8859){_0x4a8859=_0x4a8859||0xc8;return function(_0x28ce5b){if(_0x28ce5b){return _0x393fb2['status'](_0x4a8859)['json'](_0x28ce5b);}};}function respondWithFilteredResult(_0x224a68,_0x441d00){return function(_0x46ae13){if(_0x46ae13){var _0x14a4a0=typeof _0x441d00[_0xc1aa('0x19')]===_0xc1aa('0x1a')&&typeof _0x441d00[_0xc1aa('0x1b')]===_0xc1aa('0x1a');var _0xa8a1b5=_0x46ae13[_0xc1aa('0x1c')];var _0x9a33b8=_0x14a4a0?0x0:_0x441d00[_0xc1aa('0x19')];var _0x3d3ae7=_0x14a4a0?_0x46ae13[_0xc1aa('0x1c')]:_0x441d00[_0xc1aa('0x19')]+_0x441d00[_0xc1aa('0x1b')];var _0x455c5b;if(_0x3d3ae7>=_0xa8a1b5){_0x3d3ae7=_0xa8a1b5;_0x455c5b=0xc8;}else{_0x455c5b=0xce;}_0x224a68['status'](_0x455c5b);return _0x224a68[_0xc1aa('0x1d')](_0xc1aa('0x1e'),_0x9a33b8+'-'+_0x3d3ae7+'/'+_0xa8a1b5)[_0xc1aa('0x1f')](_0x46ae13);}return null;};}function patchUpdates(_0x7596b0){return function(_0x351a87){try{jsonpatch[_0xc1aa('0x20')](_0x351a87,_0x7596b0,!![]);}catch(_0x3b0867){return BPromise['reject'](_0x3b0867);}return _0x351a87[_0xc1aa('0x21')]();};}function saveUpdates(_0x16d0c0,_0x831d12){return function(_0x372848){if(_0x372848){return _0x372848['update'](_0x16d0c0)[_0xc1aa('0x22')](function(_0x4ad892){return _0x4ad892;});}return null;};}function removeEntity(_0x277907,_0x477e84){return function(_0x413d26){if(_0x413d26){return _0x413d26[_0xc1aa('0x23')]()[_0xc1aa('0x22')](function(){var _0x14dc74=_0x413d26[_0xc1aa('0x24')]({'plain':!![]});var _0x49396d=_0xc1aa('0x25');return db[_0xc1aa('0x26')]['destroy']({'where':{'type':_0x49396d,'resourceId':_0x14dc74['id']}})['then'](function(){return _0x413d26;});})[_0xc1aa('0x22')](function(){_0x277907[_0xc1aa('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11eaa9,_0xc3d52){return function(_0x4a6858){if(!_0x4a6858){_0x11eaa9[_0xc1aa('0x17')](0x194);}return _0x4a6858;};}function handleError(_0x21ff83,_0x68f243){_0x68f243=_0x68f243||0x1f4;return function(_0x4fac78){logger[_0xc1aa('0x27')](_0x4fac78['stack']);if(_0x4fac78[_0xc1aa('0x28')]){delete _0x4fac78['name'];}_0x21ff83['status'](_0x68f243)[_0xc1aa('0x29')](_0x4fac78);};}exports['index']=function(_0x56b21b,_0x23186e){var _0x242f8d={},_0x227aee={},_0x1c3e9b={'count':0x0,'rows':[]};var _0xae966e=_[_0xc1aa('0x2a')](db['AnalyticCustomReport']['rawAttributes'],function(_0x39c00c){return{'name':_0x39c00c['fieldName'],'type':_0x39c00c['type'][_0xc1aa('0x2b')]};});_0x227aee['model']=_[_0xc1aa('0x2a')](_0xae966e,'name');_0x227aee[_0xc1aa('0x2c')]=_['keys'](_0x56b21b[_0xc1aa('0x2c')]);_0x227aee[_0xc1aa('0x2d')]=_[_0xc1aa('0x2e')](_0x227aee[_0xc1aa('0x2f')],_0x227aee[_0xc1aa('0x2c')]);_0x242f8d[_0xc1aa('0x30')]=_[_0xc1aa('0x2e')](_0x227aee[_0xc1aa('0x2f')],qs[_0xc1aa('0x31')](_0x56b21b[_0xc1aa('0x2c')][_0xc1aa('0x31')]));_0x242f8d[_0xc1aa('0x30')]=_0x242f8d[_0xc1aa('0x30')][_0xc1aa('0x32')]?_0x242f8d[_0xc1aa('0x30')]:_0x227aee['model'];if(!_0x56b21b['query'][_0xc1aa('0x33')]('nolimit')){_0x242f8d[_0xc1aa('0x1b')]=qs['limit'](_0x56b21b[_0xc1aa('0x2c')][_0xc1aa('0x1b')]);_0x242f8d[_0xc1aa('0x19')]=qs[_0xc1aa('0x19')](_0x56b21b[_0xc1aa('0x2c')]['offset']);}_0x242f8d[_0xc1aa('0x34')]=qs[_0xc1aa('0x35')](_0x56b21b[_0xc1aa('0x2c')][_0xc1aa('0x35')]);_0x242f8d[_0xc1aa('0x36')]=qs[_0xc1aa('0x2d')](_[_0xc1aa('0x37')](_0x56b21b['query'],_0x227aee[_0xc1aa('0x2d')]),_0xae966e);if(_0x56b21b[_0xc1aa('0x2c')][_0xc1aa('0x38')]){_0x242f8d[_0xc1aa('0x36')]=_[_0xc1aa('0x39')](_0x242f8d['where'],{'$or':_[_0xc1aa('0x2a')](_0xae966e,function(_0x2735df){if(_0x2735df['type']!==_0xc1aa('0x3a')){var _0x2d7bfe={};_0x2d7bfe[_0x2735df[_0xc1aa('0x28')]]={'$like':'%'+_0x56b21b['query'][_0xc1aa('0x38')]+'%'};return _0x2d7bfe;}})});}_0x242f8d=_[_0xc1aa('0x39')]({},_0x242f8d,_0x56b21b[_0xc1aa('0x3b')]);var _0x30a5ed={'where':_0x242f8d['where']};return db[_0xc1aa('0x3c')]['count'](_0x30a5ed)[_0xc1aa('0x22')](function(_0x2c782b){_0x1c3e9b[_0xc1aa('0x1c')]=_0x2c782b;if(_0x56b21b['query'][_0xc1aa('0x3d')]){_0x242f8d[_0xc1aa('0x3e')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xc1aa('0x3f')](_0x242f8d);})[_0xc1aa('0x22')](function(_0xa07b3a){_0x1c3e9b[_0xc1aa('0x40')]=_0xa07b3a;return _0x1c3e9b;})[_0xc1aa('0x22')](respondWithFilteredResult(_0x23186e,_0x242f8d))[_0xc1aa('0x41')](handleError(_0x23186e,null));};exports[_0xc1aa('0x42')]=function(_0xeebe07,_0x2ef2bc){var _0x19334e={'raw':![],'where':{'id':_0xeebe07[_0xc1aa('0x43')]['id']}},_0x7c124={};_0x7c124[_0xc1aa('0x2f')]=_[_0xc1aa('0x44')](db[_0xc1aa('0x3c')][_0xc1aa('0x45')]);_0x7c124[_0xc1aa('0x2c')]=_[_0xc1aa('0x44')](_0xeebe07[_0xc1aa('0x2c')]);_0x7c124['filters']=_[_0xc1aa('0x2e')](_0x7c124[_0xc1aa('0x2f')],_0x7c124[_0xc1aa('0x2c')]);_0x19334e[_0xc1aa('0x30')]=_[_0xc1aa('0x2e')](_0x7c124['model'],qs[_0xc1aa('0x31')](_0xeebe07[_0xc1aa('0x2c')][_0xc1aa('0x31')]));_0x19334e[_0xc1aa('0x30')]=_0x19334e['attributes'][_0xc1aa('0x32')]?_0x19334e[_0xc1aa('0x30')]:_0x7c124[_0xc1aa('0x2f')];if(_0xeebe07[_0xc1aa('0x2c')][_0xc1aa('0x3d')]){_0x19334e[_0xc1aa('0x3e')]=[{'all':!![]}];}_0x19334e=_[_0xc1aa('0x39')]({},_0x19334e,_0xeebe07[_0xc1aa('0x3b')]);return db['AnalyticCustomReport'][_0xc1aa('0x46')](_0x19334e)['then'](handleEntityNotFound(_0x2ef2bc,null))[_0xc1aa('0x22')](respondWithResult(_0x2ef2bc,null))[_0xc1aa('0x41')](handleError(_0x2ef2bc,null));};exports[_0xc1aa('0x47')]=function(_0x56ce29,_0x150180){return db[_0xc1aa('0x3c')][_0xc1aa('0x47')](_0x56ce29['body'],{})[_0xc1aa('0x22')](function(_0x9ce796){var _0x30a113=_0x56ce29[_0xc1aa('0x48')][_0xc1aa('0x24')]({'plain':!![]});if(!_0x30a113)throw new Error(_0xc1aa('0x49'));if(_0x30a113[_0xc1aa('0x4a')]===_0xc1aa('0x48')){var _0x42383e=_0x9ce796[_0xc1aa('0x24')]({'plain':!![]});var _0x3d6bc5=_0xc1aa('0x4b');return db[_0xc1aa('0x4c')][_0xc1aa('0x46')]({'where':{'name':_0x3d6bc5,'userProfileId':_0x30a113[_0xc1aa('0x4d')]},'raw':!![]})[_0xc1aa('0x22')](function(_0xb27003){if(_0xb27003&&_0xb27003[_0xc1aa('0x4e')]===0x0){return db[_0xc1aa('0x26')][_0xc1aa('0x47')]({'name':_0x42383e[_0xc1aa('0x28')],'resourceId':_0x42383e['id'],'type':'CustomReports','sectionId':_0xb27003['id']},{})['then'](function(){return _0x9ce796;});}else{return _0x9ce796;}})[_0xc1aa('0x41')](function(_0x4083fe){logger[_0xc1aa('0x27')](_0xc1aa('0x4f'),_0x4083fe);throw _0x4083fe;});}return _0x9ce796;})[_0xc1aa('0x22')](respondWithResult(_0x150180,0xc9))[_0xc1aa('0x41')](handleError(_0x150180,null));};exports[_0xc1aa('0x50')]=function(_0x2ff238,_0x50877c){if(_0x2ff238[_0xc1aa('0x51')]['id']){delete _0x2ff238[_0xc1aa('0x51')]['id'];}return db[_0xc1aa('0x3c')][_0xc1aa('0x46')]({'where':{'id':_0x2ff238[_0xc1aa('0x43')]['id']}})[_0xc1aa('0x22')](handleEntityNotFound(_0x50877c,null))[_0xc1aa('0x22')](saveUpdates(_0x2ff238['body'],null))[_0xc1aa('0x22')](respondWithResult(_0x50877c,null))[_0xc1aa('0x41')](handleError(_0x50877c,null));};exports['destroy']=function(_0x3f873c,_0x288362){return db['AnalyticCustomReport'][_0xc1aa('0x46')]({'where':{'id':_0x3f873c[_0xc1aa('0x43')]['id']}})[_0xc1aa('0x22')](handleEntityNotFound(_0x288362,null))[_0xc1aa('0x22')](removeEntity(_0x288362,null))[_0xc1aa('0x41')](handleError(_0x288362,null));};exports[_0xc1aa('0x52')]=function(_0x24980f,_0x572060){var _0x53cd73=0xa;var _0x5843e7=[_0xc1aa('0x53'),_0xc1aa('0x54'),_0xc1aa('0x55'),_0xc1aa('0x56')];var _0x157d9f={'SUM':_0xc1aa('0x57'),'COUNT':_0xc1aa('0x58'),'COUNT DISTINCT':_0xc1aa('0x59'),'MAX':_0xc1aa('0x5a'),'MIN':_0xc1aa('0x5b'),'AVG':_0xc1aa('0x5c'),'GROUP_CONCAT':_0xc1aa('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x423ad3={'SEC_TO_TIME':_0xc1aa('0x5e'),'DATE':_0xc1aa('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xc1aa('0x60'),'UNIX_TIMESTAMP':_0xc1aa('0x61')};var _0x547c3c=function(_0x35e814){return!_[_0xc1aa('0x62')]([_0xc1aa('0x63'),'IS\x20NOT\x20NULL',_0xc1aa('0x64'),_0xc1aa('0x65')],_0x35e814);};var _0x5dae7d=function(_0x35f8d8){if(!_0x35f8d8||!_0x35f8d8[_0xc1aa('0x66')][_0xc1aa('0x32')]){return'';}for(var _0x4c1db4='(',_0x1fc32a=0x0;_0x1fc32a<_0x35f8d8[_0xc1aa('0x66')][_0xc1aa('0x32')];_0x1fc32a+=0x1){_0x1fc32a>0x0&&(_0x4c1db4+='\x20'+_0x35f8d8[_0xc1aa('0x67')]+'\x20');_0x4c1db4+=_0x35f8d8[_0xc1aa('0x66')][_0x1fc32a][_0xc1aa('0x68')]?_0x5dae7d(_0x35f8d8['rules'][_0x1fc32a][_0xc1aa('0x68')]):_0x35f8d8['rules'][_0x1fc32a][_0xc1aa('0x69')]+'\x20'+_0x35f8d8[_0xc1aa('0x66')][_0x1fc32a]['condition']+(_0x547c3c(_0x35f8d8[_0xc1aa('0x66')][_0x1fc32a][_0xc1aa('0x6a')])?'\x20'+_0x35f8d8[_0xc1aa('0x66')][_0x1fc32a][_0xc1aa('0x6b')]:'');}return _0x4c1db4+')';};var _0x28769c={'where':{'id':_0x24980f['params']['id']}},_0x3fe7ce,_0x529171,_0x3389b1,_0x21e802,_0x4e509c;_0x28769c=_['merge']({},_0x28769c,_0x24980f[_0xc1aa('0x3b')]);return db[_0xc1aa('0x3c')]['find'](_0x28769c)[_0xc1aa('0x22')](function(_0x336eb0){if(_0x336eb0){_0x3fe7ce=_0x336eb0;return _0x336eb0[_0xc1aa('0x6c')]();}return null;})['then'](function(_0x13548c){if(_0x13548c){if(!_0x13548c[_0xc1aa('0x32')]){throw new db[(_0xc1aa('0x6d'))][(_0xc1aa('0x6e'))](_0xc1aa('0x6f'),0x193);}_0x529171=_0x13548c;return db[_0xc1aa('0x70')][_0xc1aa('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x3da79d){if(_0x3da79d){_0x3389b1=_[_0xc1aa('0x71')](_0x3da79d,'id');var _0x6d94f5;var _0xb1505=squel['select']();_0xb1505[_0xc1aa('0x72')](_0x3fe7ce[_0xc1aa('0x73')]);for(var _0x40fb18=0x0;_0x40fb18<_0x529171[_0xc1aa('0x32')];_0x40fb18+=0x1){_0x6d94f5=_0x529171[_0x40fb18][_0xc1aa('0x74')]?_0x3389b1[_0x529171[_0x40fb18][_0xc1aa('0x74')]]['metric']:_0x529171[_0x40fb18][_0xc1aa('0x69')];_0x6d94f5=_0x529171[_0x40fb18]['function']?_[_0xc1aa('0x75')](_0x157d9f[_0x529171[_0x40fb18][_0xc1aa('0x76')]],'%s',_0x6d94f5):_0x6d94f5;_0x6d94f5=_0x529171[_0x40fb18][_0xc1aa('0x77')]?_['replace'](_0x423ad3[_0x529171[_0x40fb18][_0xc1aa('0x77')]],'%s',_0x6d94f5):_0x6d94f5;if(_0x529171[_0x40fb18][_0xc1aa('0x78')]){_0xb1505[_0xc1aa('0x68')](_0x6d94f5);}_0x529171[_0x40fb18]['orderBy']&&_0xb1505[_0xc1aa('0x34')](_0x6d94f5,_0x529171[_0x40fb18][_0xc1aa('0x79')]==='DESC'?![]:!![]);_0xb1505[_0xc1aa('0x69')](_0x6d94f5,_0x529171[_0x40fb18]['alias']||_0x6d94f5);}if(_0x3fe7ce[_0xc1aa('0x7a')]){_0x3fe7ce[_0xc1aa('0x7a')]=JSON[_0xc1aa('0x7b')](_0x3fe7ce[_0xc1aa('0x7a')]);for(var _0x613e01=0x0;_0x613e01<_0x3fe7ce[_0xc1aa('0x7a')][_0xc1aa('0x32')];_0x613e01+=0x1){if(_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01][_0xc1aa('0x7c')]&&_[_0xc1aa('0x62')](_0x5843e7,_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01]['type'])&&_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01][_0xc1aa('0x7d')]&&_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01][_0xc1aa('0x7e')]&&_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01][_0xc1aa('0x7f')]){_0xb1505[_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01][_0xc1aa('0x7c')]](_0x3fe7ce['joins'][_0x613e01][_0xc1aa('0x7e')],null,util['format'](_0xc1aa('0x80'),_0x3fe7ce[_0xc1aa('0x73')],_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01]['parentKey'],_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01][_0xc1aa('0x7e')],_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01]['foreignKey']));}}}if(_0x3fe7ce['conditions']){_0x3fe7ce[_0xc1aa('0x81')]=JSON[_0xc1aa('0x7b')](_0x3fe7ce[_0xc1aa('0x81')]);_0xb1505[_0xc1aa('0x36')](_0x5dae7d(_0x3fe7ce[_0xc1aa('0x81')][_0xc1aa('0x68')]));}_0x4e509c=_0xb1505[_0xc1aa('0x82')]();_0xb1505['limit'](_0x53cd73);_0xb1505['offset'](0x0);logger['debug']('Limited\x20Query:',_0xb1505[_0xc1aa('0x83')]());return dbH['sequelize']['query'](_0xb1505[_0xc1aa('0x83')](),{'type':dbH[_0xc1aa('0x84')][_0xc1aa('0x85')]['SELECT']});}})[_0xc1aa('0x22')](respondWithResult(_0x572060,null))[_0xc1aa('0x41')](handleError(_0x572060,null));};function runReport(_0x3ec401,_0x256293,_0x312047){var _0x407622=_0x256293['name'];var _0x476337=0xa;var _0x1a93de=[_0xc1aa('0x53'),_0xc1aa('0x54'),_0xc1aa('0x55'),_0xc1aa('0x56')];var _0x582f89={'SUM':_0xc1aa('0x57'),'COUNT':_0xc1aa('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc1aa('0x5a'),'MIN':_0xc1aa('0x5b'),'AVG':_0xc1aa('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc1aa('0x86')};var _0x1cccb8={'SEC_TO_TIME':_0xc1aa('0x5e'),'DATE':_0xc1aa('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xc1aa('0x60'),'UNIX_TIMESTAMP':_0xc1aa('0x61')};var _0x5d3d67=function(_0x14213e){return!_[_0xc1aa('0x62')]([_0xc1aa('0x63'),'IS\x20NOT\x20NULL',_0xc1aa('0x64'),_0xc1aa('0x65')],_0x14213e);};var _0x37a967=function(_0x122cd4){if(!_0x122cd4||!_0x122cd4[_0xc1aa('0x66')][_0xc1aa('0x32')]){return'';}for(var _0x295fcd='(',_0x320227=0x0;_0x320227<_0x122cd4['rules'][_0xc1aa('0x32')];_0x320227+=0x1){_0x320227>0x0&&(_0x295fcd+='\x20'+_0x122cd4[_0xc1aa('0x67')]+'\x20');_0x295fcd+=_0x122cd4[_0xc1aa('0x66')][_0x320227][_0xc1aa('0x68')]?_0x37a967(_0x122cd4['rules'][_0x320227][_0xc1aa('0x68')]):_0x122cd4[_0xc1aa('0x66')][_0x320227][_0xc1aa('0x69')]+'\x20'+_0x122cd4[_0xc1aa('0x66')][_0x320227]['condition']+(_0x5d3d67(_0x122cd4[_0xc1aa('0x66')][_0x320227][_0xc1aa('0x6a')])?'\x20'+_0x122cd4['rules'][_0x320227][_0xc1aa('0x6b')]:'');}return _0x295fcd+')';};var _0x800f31={'where':{'id':_0x3ec401['id']}},_0x5886af,_0x2952e5,_0x42987d,_0x259f7e,_0x5abd74;_0x800f31=_[_0xc1aa('0x39')]({},_0x800f31,_0x312047);return db[_0xc1aa('0x3c')][_0xc1aa('0x46')](_0x800f31)[_0xc1aa('0x22')](function(_0x243fd8){if(_0x243fd8){_0x5886af=_0x243fd8;return _0x243fd8[_0xc1aa('0x6c')]();}return null;})[_0xc1aa('0x22')](function(_0xc63595){if(_0xc63595){if(!_0xc63595[_0xc1aa('0x32')]){throw new db[(_0xc1aa('0x6d'))][(_0xc1aa('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2952e5=_0xc63595;return db['AnalyticMetric'][_0xc1aa('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x4973b8){if(_0x4973b8){_0x42987d=_[_0xc1aa('0x71')](_0x4973b8,'id');var _0xd860ba;var _0x91a980=squel[_0xc1aa('0x87')]();_0x91a980[_0xc1aa('0x72')](_0x5886af[_0xc1aa('0x73')]);for(var _0x573fc9=0x0;_0x573fc9<_0x2952e5[_0xc1aa('0x32')];_0x573fc9+=0x1){_0xd860ba=_0x2952e5[_0x573fc9][_0xc1aa('0x74')]?_0x42987d[_0x2952e5[_0x573fc9]['MetricId']][_0xc1aa('0x88')]:_0x2952e5[_0x573fc9]['field'];_0xd860ba=_0x2952e5[_0x573fc9][_0xc1aa('0x76')]?_['replace'](_0x582f89[_0x2952e5[_0x573fc9][_0xc1aa('0x76')]],'%s',_0xd860ba):_0xd860ba;_0xd860ba=_0x2952e5[_0x573fc9][_0xc1aa('0x77')]?_[_0xc1aa('0x75')](_0x1cccb8[_0x2952e5[_0x573fc9][_0xc1aa('0x77')]],'%s',_0xd860ba):_0xd860ba;if(_0x2952e5[_0x573fc9]['groupBy']){_0x91a980[_0xc1aa('0x68')](_0xd860ba);}_0x2952e5[_0x573fc9][_0xc1aa('0x79')]&&_0x91a980[_0xc1aa('0x34')](_0xd860ba,_0x2952e5[_0x573fc9][_0xc1aa('0x79')]==='DESC'?![]:!![]);_0x91a980[_0xc1aa('0x69')](_0xd860ba,_0x2952e5[_0x573fc9]['alias']||_0xd860ba);}if(_0x5886af['joins']){_0x5886af[_0xc1aa('0x7a')]=JSON[_0xc1aa('0x7b')](_0x5886af[_0xc1aa('0x7a')]);for(var _0x5ea8f4=0x0;_0x5ea8f4<_0x5886af[_0xc1aa('0x7a')]['length'];_0x5ea8f4+=0x1){if(_0x5886af[_0xc1aa('0x7a')][_0x5ea8f4]['type']&&_[_0xc1aa('0x62')](_0x1a93de,_0x5886af[_0xc1aa('0x7a')][_0x5ea8f4][_0xc1aa('0x7c')])&&_0x5886af[_0xc1aa('0x7a')][_0x5ea8f4][_0xc1aa('0x7d')]&&_0x5886af['joins'][_0x5ea8f4][_0xc1aa('0x7e')]&&_0x5886af[_0xc1aa('0x7a')][_0x5ea8f4]['foreignKey']){_0x91a980[_0x5886af[_0xc1aa('0x7a')][_0x5ea8f4][_0xc1aa('0x7c')]](_0x5886af['joins'][_0x5ea8f4][_0xc1aa('0x7e')],null,util[_0xc1aa('0x77')](_0xc1aa('0x80'),_0x5886af[_0xc1aa('0x73')],_0x5886af['joins'][_0x5ea8f4][_0xc1aa('0x7d')],_0x5886af[_0xc1aa('0x7a')][_0x5ea8f4]['foreignTable'],_0x5886af[_0xc1aa('0x7a')][_0x5ea8f4]['foreignKey']));}}}if(_0x5886af[_0xc1aa('0x81')]){_0x5886af[_0xc1aa('0x81')]=JSON[_0xc1aa('0x7b')](_0x5886af[_0xc1aa('0x81')]);_0x91a980[_0xc1aa('0x36')](_0x37a967(_0x5886af[_0xc1aa('0x81')][_0xc1aa('0x68')]));}_0x5abd74=_0x91a980[_0xc1aa('0x82')]();_0x91a980['limit'](_0x476337);_0x91a980[_0xc1aa('0x19')](0x0);return;}})[_0xc1aa('0x22')](function(){if(_0x256293[_0xc1aa('0x89')]===_0xc1aa('0x8a')){return null;}var _0x5297d6=_[_0xc1aa('0x39')](_0x256293,{'name':_0x256293[_0xc1aa('0x8b')]||_0x256293[_0xc1aa('0x28')]||_0x5886af[_0xc1aa('0x28')],'basename':_0x407622,'savename':util[_0xc1aa('0x77')](_0xc1aa('0x8c'),_0x256293[_0xc1aa('0x28')]||_0x5886af[_0xc1aa('0x28')],require(_0xc1aa('0x8d'))[_0xc1aa('0x8e')](0x4),_0x256293[_0xc1aa('0x89')]||_0xc1aa('0x8f')),'reportId':_0x5886af['id'],'reportType':'custom'});return db[_0xc1aa('0x90')][_0xc1aa('0x47')](_0x5297d6,{'raw':!![]});})[_0xc1aa('0x22')](function(_0x3f8f3e){if(_0x5886af['table']===_0xc1aa('0x91')){_0x5abd74[_0xc1aa('0x36')](_0x5886af[_0xc1aa('0x73')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x256293[_0xc1aa('0x92')],_0x256293[_0xc1aa('0x93')]);}else{_0x5abd74[_0xc1aa('0x36')](_0x5886af['table']+_0xc1aa('0x94'),_0x256293[_0xc1aa('0x92')],_0x256293[_0xc1aa('0x93')]);}if(_0x3f8f3e){logger['info'](_0xc1aa('0x95'),_0x5abd74[_0xc1aa('0x83')]());require(_0xc1aa('0x96'))[_0xc1aa('0x97')](path[_0xc1aa('0x53')](__dirname,_0xc1aa('0x98'),_0x3f8f3e[_0xc1aa('0x89')]),[_0x3f8f3e['id'],_0x5abd74[_0xc1aa('0x83')](),path[_0xc1aa('0x53')](__dirname,'../../files/reports',_0x3f8f3e[_0xc1aa('0x99')]),_0x407622]);return _0x3f8f3e;}else{var _0x9af7fc=squel['select']();_0x9af7fc[_0xc1aa('0x72')]('('+_0x5abd74[_0xc1aa('0x83')]()+')',_0xc1aa('0x9a'));_0x9af7fc['field'](_0xc1aa('0x9b'),_0xc1aa('0x1c'));_0x5abd74['limit'](_0x256293[_0xc1aa('0x1b')]||_0x476337);_0x5abd74[_0xc1aa('0x19')](_0x256293['offset']||0x0);return dbH[_0xc1aa('0x84')][_0xc1aa('0x2c')](_0x9af7fc['toString'](),{'type':dbH[_0xc1aa('0x84')][_0xc1aa('0x85')][_0xc1aa('0x9c')]})[_0xc1aa('0x22')](function(_0x5f1303){if(!_0x5f1303[_0xc1aa('0x32')]){_0x259f7e=0x0;}else{_0x259f7e=_0x5f1303[0x0]['count']||0x0;}return dbH[_0xc1aa('0x84')]['query'](_0x5abd74[_0xc1aa('0x83')](),{'type':dbH['sequelize'][_0xc1aa('0x85')][_0xc1aa('0x9c')]});})[_0xc1aa('0x22')](function(_0x1b5b00){return{'rows':_0x1b5b00||[],'count':_0x259f7e};});}});}exports[_0xc1aa('0x9d')]=function(_0x82d754,_0x2cca8b){return runReport(_0x82d754[_0xc1aa('0x43')],_0x82d754[_0xc1aa('0x2c')],_0x82d754[_0xc1aa('0x3b')])['then'](respondWithResult(_0x2cca8b,null))[_0xc1aa('0x41')](handleError(_0x2cca8b,null));};exports[_0xc1aa('0x9e')]=runReport;exports[_0xc1aa('0x2c')]=function(_0x2c9511,_0x22cd7d){var _0x3a83f6=0xa;var _0x5d6c2c=[_0xc1aa('0x53'),_0xc1aa('0x54'),_0xc1aa('0x55'),_0xc1aa('0x56')];var _0x4ec664={'SUM':_0xc1aa('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc1aa('0x59'),'MAX':_0xc1aa('0x5a'),'MIN':'MIN(%s)','AVG':_0xc1aa('0x5c'),'GROUP_CONCAT':_0xc1aa('0x5d'),'GROUP_CONCAT ASC':_0xc1aa('0x9f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x151873={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc1aa('0x5f'),'HOUR':_0xc1aa('0xa0'),'ROUND':_0xc1aa('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x426980=function(_0x10af7a){return!_[_0xc1aa('0x62')](['IS\x20NULL',_0xc1aa('0xa1'),_0xc1aa('0x64'),_0xc1aa('0x65')],_0x10af7a);};var _0x4cb823=function(_0x360a10){if(!_0x360a10||!_0x360a10[_0xc1aa('0x66')][_0xc1aa('0x32')]){return'';}for(var _0x3aa935='(',_0x535ef3=0x0;_0x535ef3<_0x360a10[_0xc1aa('0x66')][_0xc1aa('0x32')];_0x535ef3+=0x1){_0x535ef3>0x0&&(_0x3aa935+='\x20'+_0x360a10['operator']+'\x20');_0x3aa935+=_0x360a10[_0xc1aa('0x66')][_0x535ef3][_0xc1aa('0x68')]?_0x4cb823(_0x360a10['rules'][_0x535ef3][_0xc1aa('0x68')]):_0x360a10[_0xc1aa('0x66')][_0x535ef3][_0xc1aa('0x69')]+'\x20'+_0x360a10['rules'][_0x535ef3]['condition']+(_0x426980(_0x360a10[_0xc1aa('0x66')][_0x535ef3][_0xc1aa('0x6a')])?'\x20'+_0x360a10['rules'][_0x535ef3][_0xc1aa('0x6b')]:'');}return _0x3aa935+')';};var _0x4bd2cc={'where':{'id':_0x2c9511[_0xc1aa('0x43')]['id']}},_0x5e3ed6,_0x1551c5,_0x1d189c,_0x26e98f,_0x4c9c7f;_0x4bd2cc=_[_0xc1aa('0x39')]({},_0x4bd2cc,_0x2c9511[_0xc1aa('0x3b')]);return db[_0xc1aa('0x3c')][_0xc1aa('0x46')](_0x4bd2cc)[_0xc1aa('0x22')](function(_0x5a893e){if(_0x5a893e){_0x5e3ed6=_0x5a893e;return _0x5a893e['getFields']();}return null;})['then'](function(_0x222a3f){if(_0x222a3f){if(!_0x222a3f['length']){throw new db[(_0xc1aa('0x6d'))][(_0xc1aa('0x6e'))](_0xc1aa('0x6f'),0x193);}_0x1551c5=_0x222a3f;return db[_0xc1aa('0x70')][_0xc1aa('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x5a6188){if(_0x5a6188){_0x1d189c=_[_0xc1aa('0x71')](_0x5a6188,'id');var _0x1f1a31;var _0x2fc693=squel['select']();_0x2fc693[_0xc1aa('0x72')](_0x5e3ed6['table']);for(var _0x52b978=0x0;_0x52b978<_0x1551c5[_0xc1aa('0x32')];_0x52b978+=0x1){_0x1f1a31=_0x1551c5[_0x52b978][_0xc1aa('0x74')]?_0x1d189c[_0x1551c5[_0x52b978][_0xc1aa('0x74')]][_0xc1aa('0x88')]:_0x1551c5[_0x52b978][_0xc1aa('0x69')];_0x1f1a31=_0x1551c5[_0x52b978]['function']?_['replace'](_0x4ec664[_0x1551c5[_0x52b978][_0xc1aa('0x76')]],'%s',_0x1f1a31):_0x1f1a31;_0x1f1a31=_0x1551c5[_0x52b978][_0xc1aa('0x77')]?_[_0xc1aa('0x75')](_0x151873[_0x1551c5[_0x52b978][_0xc1aa('0x77')]],'%s',_0x1f1a31):_0x1f1a31;if(_0x1551c5[_0x52b978][_0xc1aa('0x78')]){_0x2fc693[_0xc1aa('0x68')](_0x1f1a31);}_0x1551c5[_0x52b978][_0xc1aa('0x79')]&&_0x2fc693[_0xc1aa('0x34')](_0x1f1a31,_0x1551c5[_0x52b978][_0xc1aa('0x79')]===_0xc1aa('0xa2')?![]:!![]);_0x2fc693[_0xc1aa('0x69')](_0x1f1a31,_0x1551c5[_0x52b978][_0xc1aa('0xa3')]||_0x1f1a31);}if(_0x5e3ed6[_0xc1aa('0x7a')]){_0x5e3ed6['joins']=JSON[_0xc1aa('0x7b')](_0x5e3ed6['joins']);for(var _0x335994=0x0;_0x335994<_0x5e3ed6[_0xc1aa('0x7a')][_0xc1aa('0x32')];_0x335994+=0x1){if(_0x5e3ed6[_0xc1aa('0x7a')][_0x335994]['type']&&_[_0xc1aa('0x62')](_0x5d6c2c,_0x5e3ed6[_0xc1aa('0x7a')][_0x335994][_0xc1aa('0x7c')])&&_0x5e3ed6[_0xc1aa('0x7a')][_0x335994]['parentKey']&&_0x5e3ed6[_0xc1aa('0x7a')][_0x335994][_0xc1aa('0x7e')]&&_0x5e3ed6[_0xc1aa('0x7a')][_0x335994][_0xc1aa('0x7f')]){_0x2fc693[_0x5e3ed6[_0xc1aa('0x7a')][_0x335994]['type']](_0x5e3ed6['joins'][_0x335994][_0xc1aa('0x7e')],null,util['format'](_0xc1aa('0x80'),_0x5e3ed6[_0xc1aa('0x73')],_0x5e3ed6[_0xc1aa('0x7a')][_0x335994]['parentKey'],_0x5e3ed6[_0xc1aa('0x7a')][_0x335994][_0xc1aa('0x7e')],_0x5e3ed6[_0xc1aa('0x7a')][_0x335994][_0xc1aa('0x7f')]));}}}if(_0x5e3ed6[_0xc1aa('0x81')]){_0x5e3ed6[_0xc1aa('0x81')]=JSON['parse'](_0x5e3ed6[_0xc1aa('0x81')]);_0x2fc693[_0xc1aa('0x36')](_0x4cb823(_0x5e3ed6[_0xc1aa('0x81')][_0xc1aa('0x68')]));}_0x4c9c7f=_0x2fc693['clone']();_0x2fc693['limit'](_0x3a83f6);_0x2fc693[_0xc1aa('0x19')](0x0);logger[_0xc1aa('0xa4')](_0xc1aa('0xa5'),_0x2fc693[_0xc1aa('0x83')]());return dbH[_0xc1aa('0x84')]['query'](_0x2fc693[_0xc1aa('0x83')](),{'type':dbH['sequelize'][_0xc1aa('0x85')][_0xc1aa('0x9c')]});}})[_0xc1aa('0x22')](function(){return{'sql':_0x4c9c7f['toString']()};})[_0xc1aa('0x22')](respondWithResult(_0x22cd7d,null))[_0xc1aa('0x41')](handleError(_0x22cd7d,null));};
\ No newline at end of file
+var _0xba5c=['COUNT(*)','SELECT','run','runReport','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','value','options','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','operator','field','ValidationErrorItem','select','DESC','includes','clone','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable'];(function(_0x275550,_0x1be9f6){var _0x2655ec=function(_0x6fc2cf){while(--_0x6fc2cf){_0x275550['push'](_0x275550['shift']());}};_0x2655ec(++_0x1be9f6);}(_0xba5c,0x154));var _0xcba5=function(_0x3638dd,_0x238cb4){_0x3638dd=_0x3638dd-0x0;var _0x3ab130=_0xba5c[_0x3638dd];return _0x3ab130;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcba5('0x0'));var jsonpatch=require(_0xcba5('0x1'));var rp=require(_0xcba5('0x2'));var moment=require(_0xcba5('0x3'));var BPromise=require(_0xcba5('0x4'));var Mustache=require('mustache');var util=require(_0xcba5('0x5'));var path=require(_0xcba5('0x6'));var sox=require(_0xcba5('0x7'));var csv=require(_0xcba5('0x8'));var ejs=require(_0xcba5('0x9'));var fs=require('fs');var fs_extra=require(_0xcba5('0xa'));var _=require(_0xcba5('0xb'));var squel=require('squel');var crypto=require(_0xcba5('0xc'));var jsforce=require(_0xcba5('0xd'));var deskjs=require(_0xcba5('0xe'));var toCsv=require(_0xcba5('0x8'));var querystring=require('querystring');var Papa=require(_0xcba5('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcba5('0x10'));var as=require(_0xcba5('0x11'));var hardwareService=require(_0xcba5('0x12'));var logger=require('../../config/logger')(_0xcba5('0x13'));var utils=require(_0xcba5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xcba5('0x15'));var db=require(_0xcba5('0x16'))['db'];var dbH=require(_0xcba5('0x16'))[_0xcba5('0x17')];function respondWithStatusCode(_0x41adcc,_0x37530e){_0x37530e=_0x37530e||0xcc;return function(_0x1b0cd4){if(_0x1b0cd4){return _0x41adcc['sendStatus'](_0x37530e);}return _0x41adcc[_0xcba5('0x18')](_0x37530e)[_0xcba5('0x19')]();};}function respondWithResult(_0x4adc49,_0x2233a1){_0x2233a1=_0x2233a1||0xc8;return function(_0x592e41){if(_0x592e41){return _0x4adc49['status'](_0x2233a1)[_0xcba5('0x1a')](_0x592e41);}};}function respondWithFilteredResult(_0x350914,_0xfb50e0){return function(_0x3d7f12){if(_0x3d7f12){var _0x3fb0d9=typeof _0xfb50e0[_0xcba5('0x1b')]===_0xcba5('0x1c')&&typeof _0xfb50e0[_0xcba5('0x1d')]===_0xcba5('0x1c');var _0x4f9c5b=_0x3d7f12['count'];var _0xd12b0f=_0x3fb0d9?0x0:_0xfb50e0[_0xcba5('0x1b')];var _0x239744=_0x3fb0d9?_0x3d7f12['count']:_0xfb50e0['offset']+_0xfb50e0[_0xcba5('0x1d')];var _0x514b41;if(_0x239744>=_0x4f9c5b){_0x239744=_0x4f9c5b;_0x514b41=0xc8;}else{_0x514b41=0xce;}_0x350914[_0xcba5('0x18')](_0x514b41);return _0x350914[_0xcba5('0x1e')](_0xcba5('0x1f'),_0xd12b0f+'-'+_0x239744+'/'+_0x4f9c5b)['json'](_0x3d7f12);}return null;};}function patchUpdates(_0x1580b9){return function(_0x36db21){try{jsonpatch[_0xcba5('0x20')](_0x36db21,_0x1580b9,!![]);}catch(_0x3a57f4){return BPromise['reject'](_0x3a57f4);}return _0x36db21[_0xcba5('0x21')]();};}function saveUpdates(_0x56c494,_0x1d3e80){return function(_0x510f6f){if(_0x510f6f){return _0x510f6f[_0xcba5('0x22')](_0x56c494)[_0xcba5('0x23')](function(_0x3addcb){return _0x3addcb;});}return null;};}function removeEntity(_0x4cada7,_0x4205f7){return function(_0x2032b7){if(_0x2032b7){return _0x2032b7[_0xcba5('0x24')]()[_0xcba5('0x23')](function(){var _0x22fe93=_0x2032b7['get']({'plain':!![]});var _0x71a928='CustomReports';return db[_0xcba5('0x25')][_0xcba5('0x24')]({'where':{'type':_0x71a928,'resourceId':_0x22fe93['id']}})[_0xcba5('0x23')](function(){return _0x2032b7;});})[_0xcba5('0x23')](function(){_0x4cada7['status'](0xcc)[_0xcba5('0x19')]();});}};}function handleEntityNotFound(_0x4916cc,_0x3f327d){return function(_0x262e6a){if(!_0x262e6a){_0x4916cc[_0xcba5('0x26')](0x194);}return _0x262e6a;};}function handleError(_0xa5d4b8,_0x3375e8){_0x3375e8=_0x3375e8||0x1f4;return function(_0x21a109){logger[_0xcba5('0x27')](_0x21a109[_0xcba5('0x28')]);if(_0x21a109[_0xcba5('0x29')]){delete _0x21a109[_0xcba5('0x29')];}_0xa5d4b8[_0xcba5('0x18')](_0x3375e8)[_0xcba5('0x2a')](_0x21a109);};}exports[_0xcba5('0x2b')]=function(_0x2c352a,_0x28f6d7){var _0x27899d={},_0x5f00c9={},_0x24fb9b={'count':0x0,'rows':[]};var _0x214aa3=_[_0xcba5('0x2c')](db[_0xcba5('0x2d')][_0xcba5('0x2e')],function(_0x43b0a5){return{'name':_0x43b0a5['fieldName'],'type':_0x43b0a5[_0xcba5('0x2f')][_0xcba5('0x30')]};});_0x5f00c9[_0xcba5('0x31')]=_[_0xcba5('0x2c')](_0x214aa3,_0xcba5('0x29'));_0x5f00c9[_0xcba5('0x32')]=_[_0xcba5('0x33')](_0x2c352a['query']);_0x5f00c9[_0xcba5('0x34')]=_[_0xcba5('0x35')](_0x5f00c9['model'],_0x5f00c9[_0xcba5('0x32')]);_0x27899d[_0xcba5('0x36')]=_[_0xcba5('0x35')](_0x5f00c9[_0xcba5('0x31')],qs[_0xcba5('0x37')](_0x2c352a[_0xcba5('0x32')][_0xcba5('0x37')]));_0x27899d[_0xcba5('0x36')]=_0x27899d[_0xcba5('0x36')][_0xcba5('0x38')]?_0x27899d[_0xcba5('0x36')]:_0x5f00c9['model'];if(!_0x2c352a[_0xcba5('0x32')][_0xcba5('0x39')](_0xcba5('0x3a'))){_0x27899d[_0xcba5('0x1d')]=qs[_0xcba5('0x1d')](_0x2c352a['query']['limit']);_0x27899d['offset']=qs[_0xcba5('0x1b')](_0x2c352a[_0xcba5('0x32')][_0xcba5('0x1b')]);}_0x27899d[_0xcba5('0x3b')]=qs[_0xcba5('0x3c')](_0x2c352a[_0xcba5('0x32')][_0xcba5('0x3c')]);_0x27899d[_0xcba5('0x3d')]=qs[_0xcba5('0x34')](_[_0xcba5('0x3e')](_0x2c352a['query'],_0x5f00c9[_0xcba5('0x34')]),_0x214aa3);if(_0x2c352a['query'][_0xcba5('0x3f')]){_0x27899d[_0xcba5('0x3d')]=_['merge'](_0x27899d[_0xcba5('0x3d')],{'$or':_[_0xcba5('0x2c')](_0x214aa3,function(_0x45ada4){if(_0x45ada4[_0xcba5('0x2f')]!==_0xcba5('0x40')){var _0x187ce2={};_0x187ce2[_0x45ada4[_0xcba5('0x29')]]={'$like':'%'+_0x2c352a[_0xcba5('0x32')][_0xcba5('0x3f')]+'%'};return _0x187ce2;}})});}_0x27899d=_[_0xcba5('0x41')]({},_0x27899d,_0x2c352a['options']);var _0x45faa7={'where':_0x27899d['where']};return db[_0xcba5('0x2d')][_0xcba5('0x42')](_0x45faa7)[_0xcba5('0x23')](function(_0xddad8b){_0x24fb9b['count']=_0xddad8b;if(_0x2c352a[_0xcba5('0x32')][_0xcba5('0x43')]){_0x27899d[_0xcba5('0x44')]=[{'all':!![]}];}return db[_0xcba5('0x2d')][_0xcba5('0x45')](_0x27899d);})[_0xcba5('0x23')](function(_0x247df1){_0x24fb9b[_0xcba5('0x46')]=_0x247df1;return _0x24fb9b;})[_0xcba5('0x23')](respondWithFilteredResult(_0x28f6d7,_0x27899d))[_0xcba5('0x47')](handleError(_0x28f6d7,null));};exports[_0xcba5('0x48')]=function(_0x8307,_0x3cc5f3){var _0x3d33aa={'raw':![],'where':{'id':_0x8307[_0xcba5('0x49')]['id']}},_0x418b3d={};_0x418b3d[_0xcba5('0x31')]=_['keys'](db['AnalyticCustomReport'][_0xcba5('0x2e')]);_0x418b3d[_0xcba5('0x32')]=_[_0xcba5('0x33')](_0x8307[_0xcba5('0x32')]);_0x418b3d[_0xcba5('0x34')]=_[_0xcba5('0x35')](_0x418b3d[_0xcba5('0x31')],_0x418b3d[_0xcba5('0x32')]);_0x3d33aa[_0xcba5('0x36')]=_[_0xcba5('0x35')](_0x418b3d['model'],qs[_0xcba5('0x37')](_0x8307[_0xcba5('0x32')][_0xcba5('0x37')]));_0x3d33aa[_0xcba5('0x36')]=_0x3d33aa['attributes'][_0xcba5('0x38')]?_0x3d33aa[_0xcba5('0x36')]:_0x418b3d[_0xcba5('0x31')];if(_0x8307[_0xcba5('0x32')][_0xcba5('0x43')]){_0x3d33aa[_0xcba5('0x44')]=[{'all':!![]}];}_0x3d33aa=_['merge']({},_0x3d33aa,_0x8307['options']);return db['AnalyticCustomReport'][_0xcba5('0x4a')](_0x3d33aa)[_0xcba5('0x23')](handleEntityNotFound(_0x3cc5f3,null))[_0xcba5('0x23')](respondWithResult(_0x3cc5f3,null))['catch'](handleError(_0x3cc5f3,null));};exports[_0xcba5('0x4b')]=function(_0x57a3fa,_0x2e91c6){return db[_0xcba5('0x2d')][_0xcba5('0x4b')](_0x57a3fa['body'],{})[_0xcba5('0x23')](function(_0x2160be){var _0x845dc9=_0x57a3fa['user']['get']({'plain':!![]});if(!_0x845dc9)throw new Error(_0xcba5('0x4c'));if(_0x845dc9['role']===_0xcba5('0x4d')){var _0x85ebd5=_0x2160be[_0xcba5('0x4e')]({'plain':!![]});var _0x2a85f6=_0xcba5('0x4f');return db[_0xcba5('0x50')][_0xcba5('0x4a')]({'where':{'name':_0x2a85f6,'userProfileId':_0x845dc9[_0xcba5('0x51')]},'raw':!![]})[_0xcba5('0x23')](function(_0x43765d){if(_0x43765d&&_0x43765d[_0xcba5('0x52')]===0x0){return db[_0xcba5('0x25')][_0xcba5('0x4b')]({'name':_0x85ebd5[_0xcba5('0x29')],'resourceId':_0x85ebd5['id'],'type':'CustomReports','sectionId':_0x43765d['id']},{})['then'](function(){return _0x2160be;});}else{return _0x2160be;}})[_0xcba5('0x47')](function(_0x7b4a3d){logger[_0xcba5('0x27')](_0xcba5('0x53'),_0x7b4a3d);throw _0x7b4a3d;});}return _0x2160be;})[_0xcba5('0x23')](respondWithResult(_0x2e91c6,0xc9))['catch'](handleError(_0x2e91c6,null));};exports['update']=function(_0x1dc235,_0x8750ff){if(_0x1dc235[_0xcba5('0x54')]['id']){delete _0x1dc235[_0xcba5('0x54')]['id'];}return db[_0xcba5('0x2d')][_0xcba5('0x4a')]({'where':{'id':_0x1dc235[_0xcba5('0x49')]['id']}})[_0xcba5('0x23')](handleEntityNotFound(_0x8750ff,null))[_0xcba5('0x23')](saveUpdates(_0x1dc235[_0xcba5('0x54')],null))['then'](respondWithResult(_0x8750ff,null))['catch'](handleError(_0x8750ff,null));};exports[_0xcba5('0x24')]=function(_0x525102,_0x1d9f8d){return db[_0xcba5('0x2d')]['find']({'where':{'id':_0x525102[_0xcba5('0x49')]['id']}})[_0xcba5('0x23')](handleEntityNotFound(_0x1d9f8d,null))[_0xcba5('0x23')](removeEntity(_0x1d9f8d,null))[_0xcba5('0x47')](handleError(_0x1d9f8d,null));};exports['preview']=function(_0x2d0273,_0x21a770){var _0xc2acd1=0xa;var _0x1780fe=[_0xcba5('0x55'),_0xcba5('0x56'),_0xcba5('0x57'),_0xcba5('0x58')];var _0xa4f65b={'SUM':_0xcba5('0x59'),'COUNT':_0xcba5('0x5a'),'COUNT DISTINCT':_0xcba5('0x5b'),'MAX':_0xcba5('0x5c'),'MIN':_0xcba5('0x5d'),'AVG':_0xcba5('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcba5('0x5f')};var _0x5239d4={'SEC_TO_TIME':_0xcba5('0x60'),'DATE':_0xcba5('0x61'),'HOUR':_0xcba5('0x62'),'ROUND':_0xcba5('0x63'),'UNIX_TIMESTAMP':_0xcba5('0x64')};var _0x5bfc19=function(_0x10c838){return!_['includes']([_0xcba5('0x65'),_0xcba5('0x66'),_0xcba5('0x67'),_0xcba5('0x68')],_0x10c838);};var _0x43f109=function(_0x2b68d5){if(!_0x2b68d5||!_0x2b68d5[_0xcba5('0x69')][_0xcba5('0x38')]){return'';}for(var _0x489a63='(',_0x387352=0x0;_0x387352<_0x2b68d5['rules']['length'];_0x387352+=0x1){_0x387352>0x0&&(_0x489a63+='\x20'+_0x2b68d5['operator']+'\x20');_0x489a63+=_0x2b68d5['rules'][_0x387352]['group']?_0x43f109(_0x2b68d5['rules'][_0x387352][_0xcba5('0x6a')]):_0x2b68d5[_0xcba5('0x69')][_0x387352]['field']+'\x20'+_0x2b68d5[_0xcba5('0x69')][_0x387352][_0xcba5('0x6b')]+(_0x5bfc19(_0x2b68d5[_0xcba5('0x69')][_0x387352][_0xcba5('0x6b')])?'\x20'+_0x2b68d5[_0xcba5('0x69')][_0x387352][_0xcba5('0x6c')]:'');}return _0x489a63+')';};var _0x192794={'where':{'id':_0x2d0273['params']['id']}},_0x54f11c,_0x39408e,_0x589d16,_0xa96998,_0x1c6ac8;_0x192794=_[_0xcba5('0x41')]({},_0x192794,_0x2d0273[_0xcba5('0x6d')]);return db[_0xcba5('0x2d')][_0xcba5('0x4a')](_0x192794)[_0xcba5('0x23')](function(_0x1df0dd){if(_0x1df0dd){_0x54f11c=_0x1df0dd;return _0x1df0dd[_0xcba5('0x6e')]();}return null;})[_0xcba5('0x23')](function(_0x3bdc00){if(_0x3bdc00){if(!_0x3bdc00[_0xcba5('0x38')]){throw new db[(_0xcba5('0x6f'))]['ValidationErrorItem'](_0xcba5('0x70'),0x193);}_0x39408e=_0x3bdc00;return db[_0xcba5('0x71')][_0xcba5('0x45')]({'raw':!![]});}return null;})['then'](function(_0x4216fd){if(_0x4216fd){_0x589d16=_[_0xcba5('0x72')](_0x4216fd,'id');var _0x31ed6f;var _0x3cff1e=squel['select']();_0x3cff1e[_0xcba5('0x73')](_0x54f11c[_0xcba5('0x74')]);for(var _0x134067=0x0;_0x134067<_0x39408e[_0xcba5('0x38')];_0x134067+=0x1){_0x31ed6f=_0x39408e[_0x134067]['MetricId']?_0x589d16[_0x39408e[_0x134067][_0xcba5('0x75')]][_0xcba5('0x76')]:_0x39408e[_0x134067]['field'];_0x31ed6f=_0x39408e[_0x134067][_0xcba5('0x77')]?_[_0xcba5('0x78')](_0xa4f65b[_0x39408e[_0x134067]['function']],'%s',_0x31ed6f):_0x31ed6f;_0x31ed6f=_0x39408e[_0x134067][_0xcba5('0x79')]?_[_0xcba5('0x78')](_0x5239d4[_0x39408e[_0x134067]['format']],'%s',_0x31ed6f):_0x31ed6f;if(_0x39408e[_0x134067][_0xcba5('0x7a')]){_0x3cff1e[_0xcba5('0x6a')](_0x31ed6f);}_0x39408e[_0x134067][_0xcba5('0x7b')]&&_0x3cff1e[_0xcba5('0x3b')](_0x31ed6f,_0x39408e[_0x134067][_0xcba5('0x7b')]==='DESC'?![]:!![]);_0x3cff1e['field'](_0x31ed6f,_0x39408e[_0x134067][_0xcba5('0x7c')]||_0x31ed6f);}if(_0x54f11c[_0xcba5('0x7d')]){_0x54f11c[_0xcba5('0x7d')]=JSON[_0xcba5('0x7e')](_0x54f11c[_0xcba5('0x7d')]);for(var _0x29083f=0x0;_0x29083f<_0x54f11c[_0xcba5('0x7d')][_0xcba5('0x38')];_0x29083f+=0x1){if(_0x54f11c['joins'][_0x29083f][_0xcba5('0x2f')]&&_['includes'](_0x1780fe,_0x54f11c[_0xcba5('0x7d')][_0x29083f][_0xcba5('0x2f')])&&_0x54f11c[_0xcba5('0x7d')][_0x29083f][_0xcba5('0x7f')]&&_0x54f11c[_0xcba5('0x7d')][_0x29083f][_0xcba5('0x80')]&&_0x54f11c[_0xcba5('0x7d')][_0x29083f][_0xcba5('0x81')]){_0x3cff1e[_0x54f11c[_0xcba5('0x7d')][_0x29083f][_0xcba5('0x2f')]](_0x54f11c[_0xcba5('0x7d')][_0x29083f]['foreignTable'],null,util[_0xcba5('0x79')](_0xcba5('0x82'),_0x54f11c[_0xcba5('0x74')],_0x54f11c['joins'][_0x29083f][_0xcba5('0x7f')],_0x54f11c[_0xcba5('0x7d')][_0x29083f][_0xcba5('0x80')],_0x54f11c[_0xcba5('0x7d')][_0x29083f][_0xcba5('0x81')]));}}}if(_0x54f11c[_0xcba5('0x83')]){_0x54f11c[_0xcba5('0x83')]=JSON[_0xcba5('0x7e')](_0x54f11c[_0xcba5('0x83')]);_0x3cff1e[_0xcba5('0x3d')](_0x43f109(_0x54f11c['conditions']['group']));}_0x1c6ac8=_0x3cff1e['clone']();_0x3cff1e[_0xcba5('0x1d')](_0xc2acd1);_0x3cff1e[_0xcba5('0x1b')](0x0);logger[_0xcba5('0x84')](_0xcba5('0x85'),_0x3cff1e[_0xcba5('0x86')]());return dbH[_0xcba5('0x87')]['query'](_0x3cff1e[_0xcba5('0x86')](),{'type':dbH[_0xcba5('0x87')][_0xcba5('0x88')]['SELECT']});}})['then'](respondWithResult(_0x21a770,null))[_0xcba5('0x47')](handleError(_0x21a770,null));};function runReport(_0x3ae65a,_0x9fbb19,_0x3181e2){var _0x170e3d=_0x9fbb19[_0xcba5('0x29')];var _0x46a38f=0xa;var _0xe511bb=[_0xcba5('0x55'),_0xcba5('0x56'),_0xcba5('0x57'),_0xcba5('0x58')];var _0x1f517b={'SUM':_0xcba5('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcba5('0x5b'),'MAX':'MAX(%s)','MIN':_0xcba5('0x5d'),'AVG':_0xcba5('0x5e'),'GROUP_CONCAT':_0xcba5('0x89'),'GROUP_CONCAT ASC':_0xcba5('0x8a'),'GROUP_CONCAT DESC':_0xcba5('0x5f')};var _0x41aef3={'SEC_TO_TIME':_0xcba5('0x60'),'DATE':_0xcba5('0x61'),'HOUR':_0xcba5('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xcba5('0x64')};var _0x6d5e48=function(_0x244a6c){return!_['includes']([_0xcba5('0x65'),_0xcba5('0x66'),_0xcba5('0x67'),_0xcba5('0x68')],_0x244a6c);};var _0x3d1895=function(_0x79a571){if(!_0x79a571||!_0x79a571[_0xcba5('0x69')][_0xcba5('0x38')]){return'';}for(var _0x176f1b='(',_0x5090ae=0x0;_0x5090ae<_0x79a571[_0xcba5('0x69')][_0xcba5('0x38')];_0x5090ae+=0x1){_0x5090ae>0x0&&(_0x176f1b+='\x20'+_0x79a571[_0xcba5('0x8b')]+'\x20');_0x176f1b+=_0x79a571[_0xcba5('0x69')][_0x5090ae][_0xcba5('0x6a')]?_0x3d1895(_0x79a571[_0xcba5('0x69')][_0x5090ae][_0xcba5('0x6a')]):_0x79a571[_0xcba5('0x69')][_0x5090ae][_0xcba5('0x8c')]+'\x20'+_0x79a571['rules'][_0x5090ae][_0xcba5('0x6b')]+(_0x6d5e48(_0x79a571[_0xcba5('0x69')][_0x5090ae]['condition'])?'\x20'+_0x79a571[_0xcba5('0x69')][_0x5090ae][_0xcba5('0x6c')]:'');}return _0x176f1b+')';};var _0x6a6ed0={'where':{'id':_0x3ae65a['id']}},_0x290b2a,_0x57c7c4,_0xe18f8e,_0x5d35b4,_0x1c9ff2;_0x6a6ed0=_[_0xcba5('0x41')]({},_0x6a6ed0,_0x3181e2);return db[_0xcba5('0x2d')]['find'](_0x6a6ed0)[_0xcba5('0x23')](function(_0x261bd4){if(_0x261bd4){_0x290b2a=_0x261bd4;return _0x261bd4[_0xcba5('0x6e')]();}return null;})['then'](function(_0x1abf6b){if(_0x1abf6b){if(!_0x1abf6b[_0xcba5('0x38')]){throw new db[(_0xcba5('0x6f'))][(_0xcba5('0x8d'))](_0xcba5('0x70'),0x193);}_0x57c7c4=_0x1abf6b;return db['AnalyticMetric'][_0xcba5('0x45')]({'raw':!![]});}return null;})[_0xcba5('0x23')](function(_0x10ac0f){if(_0x10ac0f){_0xe18f8e=_[_0xcba5('0x72')](_0x10ac0f,'id');var _0x239da6;var _0x3335e3=squel[_0xcba5('0x8e')]();_0x3335e3[_0xcba5('0x73')](_0x290b2a[_0xcba5('0x74')]);for(var _0x5f08a7=0x0;_0x5f08a7<_0x57c7c4[_0xcba5('0x38')];_0x5f08a7+=0x1){_0x239da6=_0x57c7c4[_0x5f08a7][_0xcba5('0x75')]?_0xe18f8e[_0x57c7c4[_0x5f08a7][_0xcba5('0x75')]]['metric']:_0x57c7c4[_0x5f08a7]['field'];_0x239da6=_0x57c7c4[_0x5f08a7][_0xcba5('0x77')]?_[_0xcba5('0x78')](_0x1f517b[_0x57c7c4[_0x5f08a7][_0xcba5('0x77')]],'%s',_0x239da6):_0x239da6;_0x239da6=_0x57c7c4[_0x5f08a7][_0xcba5('0x79')]?_[_0xcba5('0x78')](_0x41aef3[_0x57c7c4[_0x5f08a7][_0xcba5('0x79')]],'%s',_0x239da6):_0x239da6;if(_0x57c7c4[_0x5f08a7][_0xcba5('0x7a')]){_0x3335e3[_0xcba5('0x6a')](_0x239da6);}_0x57c7c4[_0x5f08a7]['orderBy']&&_0x3335e3[_0xcba5('0x3b')](_0x239da6,_0x57c7c4[_0x5f08a7][_0xcba5('0x7b')]===_0xcba5('0x8f')?![]:!![]);_0x3335e3[_0xcba5('0x8c')](_0x239da6,_0x57c7c4[_0x5f08a7]['alias']||_0x239da6);}if(_0x290b2a[_0xcba5('0x7d')]){_0x290b2a['joins']=JSON[_0xcba5('0x7e')](_0x290b2a[_0xcba5('0x7d')]);for(var _0x344bd2=0x0;_0x344bd2<_0x290b2a[_0xcba5('0x7d')][_0xcba5('0x38')];_0x344bd2+=0x1){if(_0x290b2a[_0xcba5('0x7d')][_0x344bd2][_0xcba5('0x2f')]&&_[_0xcba5('0x90')](_0xe511bb,_0x290b2a[_0xcba5('0x7d')][_0x344bd2][_0xcba5('0x2f')])&&_0x290b2a[_0xcba5('0x7d')][_0x344bd2][_0xcba5('0x7f')]&&_0x290b2a[_0xcba5('0x7d')][_0x344bd2][_0xcba5('0x80')]&&_0x290b2a['joins'][_0x344bd2]['foreignKey']){_0x3335e3[_0x290b2a[_0xcba5('0x7d')][_0x344bd2]['type']](_0x290b2a[_0xcba5('0x7d')][_0x344bd2]['foreignTable'],null,util[_0xcba5('0x79')](_0xcba5('0x82'),_0x290b2a[_0xcba5('0x74')],_0x290b2a[_0xcba5('0x7d')][_0x344bd2][_0xcba5('0x7f')],_0x290b2a[_0xcba5('0x7d')][_0x344bd2][_0xcba5('0x80')],_0x290b2a[_0xcba5('0x7d')][_0x344bd2][_0xcba5('0x81')]));}}}if(_0x290b2a[_0xcba5('0x83')]){_0x290b2a[_0xcba5('0x83')]=JSON[_0xcba5('0x7e')](_0x290b2a[_0xcba5('0x83')]);_0x3335e3[_0xcba5('0x3d')](_0x3d1895(_0x290b2a[_0xcba5('0x83')][_0xcba5('0x6a')]));}_0x1c9ff2=_0x3335e3[_0xcba5('0x91')]();_0x3335e3[_0xcba5('0x1d')](_0x46a38f);_0x3335e3[_0xcba5('0x1b')](0x0);return;}})[_0xcba5('0x23')](function(){if(_0x9fbb19[_0xcba5('0x92')]===_0xcba5('0x93')){return null;}var _0x14557c=_['merge'](_0x9fbb19,{'name':_0x9fbb19[_0xcba5('0x94')]||_0x9fbb19['name']||_0x290b2a[_0xcba5('0x29')],'basename':_0x170e3d,'savename':util[_0xcba5('0x79')](_0xcba5('0x95'),_0x9fbb19[_0xcba5('0x29')]||_0x290b2a[_0xcba5('0x29')],require('randomstring')[_0xcba5('0x96')](0x4),_0x9fbb19[_0xcba5('0x92')]||_0xcba5('0x97')),'reportId':_0x290b2a['id'],'reportType':_0xcba5('0x98')});return db[_0xcba5('0x99')][_0xcba5('0x4b')](_0x14557c,{'raw':!![]});})[_0xcba5('0x23')](function(_0x290183){if(_0x290b2a[_0xcba5('0x74')]===_0xcba5('0x9a')){_0x1c9ff2[_0xcba5('0x3d')](_0x290b2a[_0xcba5('0x74')]+_0xcba5('0x9b'),_0x9fbb19[_0xcba5('0x9c')],_0x9fbb19['endDate']);}else{_0x1c9ff2[_0xcba5('0x3d')](_0x290b2a[_0xcba5('0x74')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x9fbb19[_0xcba5('0x9c')],_0x9fbb19['endDate']);}if(_0x290183){logger['info'](_0xcba5('0x9d'),_0x1c9ff2[_0xcba5('0x86')]());require(_0xcba5('0x9e'))[_0xcba5('0x9f')](path['join'](__dirname,_0xcba5('0xa0'),_0x290183[_0xcba5('0x92')]),[_0x290183['id'],_0x1c9ff2[_0xcba5('0x86')](),path[_0xcba5('0x55')](__dirname,_0xcba5('0xa1'),_0x290183[_0xcba5('0xa2')]),_0x170e3d]);return _0x290183;}else{var _0xa0e481=squel[_0xcba5('0x8e')]();_0xa0e481[_0xcba5('0x73')]('('+_0x1c9ff2[_0xcba5('0x86')]()+')',_0xcba5('0xa3'));_0xa0e481['field'](_0xcba5('0xa4'),_0xcba5('0x42'));_0x1c9ff2[_0xcba5('0x1d')](_0x9fbb19[_0xcba5('0x1d')]||_0x46a38f);_0x1c9ff2[_0xcba5('0x1b')](_0x9fbb19[_0xcba5('0x1b')]||0x0);return dbH[_0xcba5('0x87')][_0xcba5('0x32')](_0xa0e481[_0xcba5('0x86')](),{'type':dbH[_0xcba5('0x87')]['QueryTypes']['SELECT']})[_0xcba5('0x23')](function(_0x3d14cb){if(!_0x3d14cb[_0xcba5('0x38')]){_0x5d35b4=0x0;}else{_0x5d35b4=_0x3d14cb[0x0][_0xcba5('0x42')]||0x0;}return dbH['sequelize'][_0xcba5('0x32')](_0x1c9ff2[_0xcba5('0x86')](),{'type':dbH['sequelize'][_0xcba5('0x88')][_0xcba5('0xa5')]});})[_0xcba5('0x23')](function(_0x48abce){return{'rows':_0x48abce||[],'count':_0x5d35b4};});}});}exports[_0xcba5('0xa6')]=function(_0x32b12b,_0x2a04ad){return runReport(_0x32b12b[_0xcba5('0x49')],_0x32b12b[_0xcba5('0x32')],_0x32b12b[_0xcba5('0x6d')])[_0xcba5('0x23')](respondWithResult(_0x2a04ad,null))[_0xcba5('0x47')](handleError(_0x2a04ad,null));};exports[_0xcba5('0xa7')]=runReport;exports['query']=function(_0x4196e2,_0xa3a8a4){var _0x4e3da5=0xa;var _0x436e4a=[_0xcba5('0x55'),_0xcba5('0x56'),_0xcba5('0x57'),_0xcba5('0x58')];var _0x54547a={'SUM':_0xcba5('0x59'),'COUNT':_0xcba5('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xcba5('0x5d'),'AVG':_0xcba5('0x5e'),'GROUP_CONCAT':_0xcba5('0x89'),'GROUP_CONCAT ASC':_0xcba5('0x8a'),'GROUP_CONCAT DESC':_0xcba5('0x5f')};var _0x5118ef={'SEC_TO_TIME':_0xcba5('0x60'),'DATE':_0xcba5('0x61'),'HOUR':'HOUR(%s)','ROUND':_0xcba5('0x63'),'UNIX_TIMESTAMP':_0xcba5('0x64')};var _0x55dd4e=function(_0x1eee35){return!_[_0xcba5('0x90')]([_0xcba5('0x65'),_0xcba5('0x66'),_0xcba5('0x67'),_0xcba5('0x68')],_0x1eee35);};var _0x2cfab9=function(_0x564bd6){if(!_0x564bd6||!_0x564bd6[_0xcba5('0x69')]['length']){return'';}for(var _0x28f01e='(',_0x332777=0x0;_0x332777<_0x564bd6[_0xcba5('0x69')][_0xcba5('0x38')];_0x332777+=0x1){_0x332777>0x0&&(_0x28f01e+='\x20'+_0x564bd6[_0xcba5('0x8b')]+'\x20');_0x28f01e+=_0x564bd6[_0xcba5('0x69')][_0x332777][_0xcba5('0x6a')]?_0x2cfab9(_0x564bd6[_0xcba5('0x69')][_0x332777][_0xcba5('0x6a')]):_0x564bd6[_0xcba5('0x69')][_0x332777][_0xcba5('0x8c')]+'\x20'+_0x564bd6[_0xcba5('0x69')][_0x332777][_0xcba5('0x6b')]+(_0x55dd4e(_0x564bd6[_0xcba5('0x69')][_0x332777][_0xcba5('0x6b')])?'\x20'+_0x564bd6['rules'][_0x332777][_0xcba5('0x6c')]:'');}return _0x28f01e+')';};var _0x565338={'where':{'id':_0x4196e2[_0xcba5('0x49')]['id']}},_0x179217,_0x22f7b0,_0x18b783,_0x903a09,_0x4e9724;_0x565338=_[_0xcba5('0x41')]({},_0x565338,_0x4196e2[_0xcba5('0x6d')]);return db[_0xcba5('0x2d')][_0xcba5('0x4a')](_0x565338)[_0xcba5('0x23')](function(_0x512811){if(_0x512811){_0x179217=_0x512811;return _0x512811[_0xcba5('0x6e')]();}return null;})[_0xcba5('0x23')](function(_0x4227ac){if(_0x4227ac){if(!_0x4227ac[_0xcba5('0x38')]){throw new db[(_0xcba5('0x6f'))][(_0xcba5('0x8d'))](_0xcba5('0x70'),0x193);}_0x22f7b0=_0x4227ac;return db['AnalyticMetric'][_0xcba5('0x45')]({'raw':!![]});}return null;})[_0xcba5('0x23')](function(_0x30ed05){if(_0x30ed05){_0x18b783=_['keyBy'](_0x30ed05,'id');var _0x46c214;var _0x5a8e16=squel['select']();_0x5a8e16['from'](_0x179217[_0xcba5('0x74')]);for(var _0x54f67a=0x0;_0x54f67a<_0x22f7b0[_0xcba5('0x38')];_0x54f67a+=0x1){_0x46c214=_0x22f7b0[_0x54f67a]['MetricId']?_0x18b783[_0x22f7b0[_0x54f67a][_0xcba5('0x75')]][_0xcba5('0x76')]:_0x22f7b0[_0x54f67a][_0xcba5('0x8c')];_0x46c214=_0x22f7b0[_0x54f67a][_0xcba5('0x77')]?_['replace'](_0x54547a[_0x22f7b0[_0x54f67a][_0xcba5('0x77')]],'%s',_0x46c214):_0x46c214;_0x46c214=_0x22f7b0[_0x54f67a][_0xcba5('0x79')]?_[_0xcba5('0x78')](_0x5118ef[_0x22f7b0[_0x54f67a]['format']],'%s',_0x46c214):_0x46c214;if(_0x22f7b0[_0x54f67a][_0xcba5('0x7a')]){_0x5a8e16[_0xcba5('0x6a')](_0x46c214);}_0x22f7b0[_0x54f67a][_0xcba5('0x7b')]&&_0x5a8e16[_0xcba5('0x3b')](_0x46c214,_0x22f7b0[_0x54f67a][_0xcba5('0x7b')]===_0xcba5('0x8f')?![]:!![]);_0x5a8e16[_0xcba5('0x8c')](_0x46c214,_0x22f7b0[_0x54f67a]['alias']||_0x46c214);}if(_0x179217[_0xcba5('0x7d')]){_0x179217['joins']=JSON[_0xcba5('0x7e')](_0x179217['joins']);for(var _0x5b778c=0x0;_0x5b778c<_0x179217[_0xcba5('0x7d')][_0xcba5('0x38')];_0x5b778c+=0x1){if(_0x179217['joins'][_0x5b778c]['type']&&_[_0xcba5('0x90')](_0x436e4a,_0x179217[_0xcba5('0x7d')][_0x5b778c]['type'])&&_0x179217[_0xcba5('0x7d')][_0x5b778c][_0xcba5('0x7f')]&&_0x179217[_0xcba5('0x7d')][_0x5b778c][_0xcba5('0x80')]&&_0x179217[_0xcba5('0x7d')][_0x5b778c][_0xcba5('0x81')]){_0x5a8e16[_0x179217[_0xcba5('0x7d')][_0x5b778c][_0xcba5('0x2f')]](_0x179217['joins'][_0x5b778c][_0xcba5('0x80')],null,util[_0xcba5('0x79')]('%s.%s\x20=\x20%s.%s',_0x179217['table'],_0x179217[_0xcba5('0x7d')][_0x5b778c][_0xcba5('0x7f')],_0x179217[_0xcba5('0x7d')][_0x5b778c][_0xcba5('0x80')],_0x179217[_0xcba5('0x7d')][_0x5b778c][_0xcba5('0x81')]));}}}if(_0x179217[_0xcba5('0x83')]){_0x179217[_0xcba5('0x83')]=JSON['parse'](_0x179217[_0xcba5('0x83')]);_0x5a8e16['where'](_0x2cfab9(_0x179217['conditions']['group']));}_0x4e9724=_0x5a8e16[_0xcba5('0x91')]();_0x5a8e16[_0xcba5('0x1d')](_0x4e3da5);_0x5a8e16[_0xcba5('0x1b')](0x0);logger[_0xcba5('0x84')]('Limited\x20Query:',_0x5a8e16['toString']());return dbH[_0xcba5('0x87')][_0xcba5('0x32')](_0x5a8e16[_0xcba5('0x86')](),{'type':dbH[_0xcba5('0x87')]['QueryTypes'][_0xcba5('0xa5')]});}})[_0xcba5('0x23')](function(){return{'sql':_0x4e9724[_0xcba5('0x86')]()};})[_0xcba5('0x23')](respondWithResult(_0xa3a8a4,null))[_0xcba5('0x47')](handleError(_0xa3a8a4,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 5170c20..08da3d7 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 _0x434d=['util','../../config/logger','api','moment','request-promise','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x434d,0x11f));var _0xd434=function(_0x657cd3,_0x52504f){_0x657cd3=_0x657cd3-0x0;var _0x4671d4=_0x434d[_0x657cd3];return _0x4671d4;};'use strict';var _=require(_0xd434('0x0'));var util=require(_0xd434('0x1'));var logger=require(_0xd434('0x2'))(_0xd434('0x3'));var moment=require(_0xd434('0x4'));var BPromise=require('bluebird');var rp=require(_0xd434('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd434('0x6'));var config=require('../../config/environment');var attributes=require(_0xd434('0x7'));module[_0xd434('0x8')]=function(_0x31057e,_0x335500){return _0x31057e[_0xd434('0x9')](_0xd434('0xa'),attributes,{'tableName':_0xd434('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8f52=['analytics_custom_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport'];(function(_0x499be0,_0x44d273){var _0x212ec6=function(_0x44397a){while(--_0x44397a){_0x499be0['push'](_0x499be0['shift']());}};_0x212ec6(++_0x44d273);}(_0x8f52,0x76));var _0x28f5=function(_0x11dc39,_0x491115){_0x11dc39=_0x11dc39-0x0;var _0x457277=_0x8f52[_0x11dc39];return _0x457277;};'use strict';var _=require('lodash');var util=require(_0x28f5('0x0'));var logger=require(_0x28f5('0x1'))(_0x28f5('0x2'));var moment=require(_0x28f5('0x3'));var BPromise=require(_0x28f5('0x4'));var rp=require(_0x28f5('0x5'));var fs=require('fs');var path=require(_0x28f5('0x6'));var rimraf=require(_0x28f5('0x7'));var config=require(_0x28f5('0x8'));var attributes=require(_0x28f5('0x9'));module[_0x28f5('0xa')]=function(_0x504845,_0x123931){return _0x504845['define'](_0x28f5('0xb'),attributes,{'tableName':_0x28f5('0xc'),'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 c0e9db5..40246b3 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 _0x272c=['debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x272c,0x196));var _0xc272=function(_0x44c5ca,_0x2148fe){_0x44c5ca=_0x44c5ca-0x0;var _0x2c4085=_0x272c[_0x44c5ca];return _0x2c4085;};'use strict';var _=require(_0xc272('0x0'));var util=require(_0xc272('0x1'));var moment=require(_0xc272('0x2'));var BPromise=require(_0xc272('0x3'));var rs=require(_0xc272('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc272('0x5'));var logger=require(_0xc272('0x6'))('rpc');var config=require(_0xc272('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc272('0x8')][_0xc272('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45eb0d,_0x4034f6,_0x1e7943){return new BPromise(function(_0x5938a4,_0x159eb4){return client['request'](_0x45eb0d,_0x1e7943)[_0xc272('0xa')](function(_0x256325){logger[_0xc272('0xb')](_0xc272('0xc'),_0x4034f6,_0xc272('0xd'));logger[_0xc272('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x4034f6,'request\x20sent',JSON[_0xc272('0xf')](_0x256325));if(_0x256325[_0xc272('0x10')]){if(_0x256325['error']['code']===0x1f4){logger[_0xc272('0x10')](_0xc272('0xc'),_0x4034f6,_0x256325[_0xc272('0x10')][_0xc272('0x11')]);return _0x159eb4(_0x256325['error']['message']);}logger[_0xc272('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4034f6,_0x256325[_0xc272('0x10')][_0xc272('0x11')]);return _0x5938a4(_0x256325['error'][_0xc272('0x11')]);}else{logger['info'](_0xc272('0xc'),_0x4034f6,'request\x20sent');_0x5938a4(_0x256325[_0xc272('0x12')][_0xc272('0x11')]);}})[_0xc272('0x13')](function(_0x291d98){logger[_0xc272('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4034f6,_0x291d98);_0x159eb4(_0x291d98);});});}
\ No newline at end of file
+var _0x0794=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug'];(function(_0x1541d2,_0x4c1463){var _0x4a7e10=function(_0x48a3a9){while(--_0x48a3a9){_0x1541d2['push'](_0x1541d2['shift']());}};_0x4a7e10(++_0x4c1463);}(_0x0794,0xd5));var _0x4079=function(_0x428d93,_0x16b0ba){_0x428d93=_0x428d93-0x0;var _0x2a2002=_0x0794[_0x428d93];return _0x2a2002;};'use strict';var _=require(_0x4079('0x0'));var util=require(_0x4079('0x1'));var moment=require('moment');var BPromise=require(_0x4079('0x2'));var rs=require(_0x4079('0x3'));var fs=require('fs');var Redis=require(_0x4079('0x4'));var db=require(_0x4079('0x5'))['db'];var utils=require(_0x4079('0x6'));var logger=require(_0x4079('0x7'))('rpc');var config=require(_0x4079('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4079('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x378592,_0x5edcaa,_0x1f1b58){return new BPromise(function(_0x590517,_0x266a5f){return client[_0x4079('0xa')](_0x378592,_0x1f1b58)[_0x4079('0xb')](function(_0x2457eb){logger[_0x4079('0xc')](_0x4079('0xd'),_0x5edcaa,'request\x20sent');logger[_0x4079('0xe')](_0x4079('0xf'),_0x5edcaa,'request\x20sent',JSON['stringify'](_0x2457eb));if(_0x2457eb[_0x4079('0x10')]){if(_0x2457eb[_0x4079('0x10')]['code']===0x1f4){logger[_0x4079('0x10')](_0x4079('0xd'),_0x5edcaa,_0x2457eb[_0x4079('0x10')][_0x4079('0x11')]);return _0x266a5f(_0x2457eb[_0x4079('0x10')]['message']);}logger[_0x4079('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5edcaa,_0x2457eb[_0x4079('0x10')][_0x4079('0x11')]);return _0x590517(_0x2457eb[_0x4079('0x10')][_0x4079('0x11')]);}else{logger['info'](_0x4079('0xd'),_0x5edcaa,'request\x20sent');_0x590517(_0x2457eb[_0x4079('0x12')][_0x4079('0x11')]);}})['catch'](function(_0x42d6af){logger[_0x4079('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5edcaa,_0x42d6af);_0x266a5f(_0x42d6af);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 1d7bb64..8f44461 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 _0x283a=['show','/:id/preview','preview','run','query','post','create','put','destroy','multer','util','connect-timeout','express','Router','get','isAuthenticated','/:id'];(function(_0x2a93b1,_0x3563d9){var _0xfb1537=function(_0x5e12f1){while(--_0x5e12f1){_0x2a93b1['push'](_0x2a93b1['shift']());}};_0xfb1537(++_0x3563d9);}(_0x283a,0xe6));var _0xa283=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0x283a[_0x4c1ec2];return _0x3f6f1c;};'use strict';var multer=require(_0xa283('0x0'));var util=require(_0xa283('0x1'));var path=require('path');var timeout=require(_0xa283('0x2'));var express=require(_0xa283('0x3'));var router=express[_0xa283('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('./analyticCustomReport.controller');router[_0xa283('0x5')]('/',auth[_0xa283('0x6')](),controller['index']);router['get'](_0xa283('0x7'),auth['isAuthenticated'](),controller[_0xa283('0x8')]);router[_0xa283('0x5')](_0xa283('0x9'),auth[_0xa283('0x6')](),controller[_0xa283('0xa')]);router[_0xa283('0x5')]('/:id/run',auth[_0xa283('0x6')](),controller[_0xa283('0xb')]);router[_0xa283('0x5')]('/:id/query',auth['isAuthenticated'](),controller[_0xa283('0xc')]);router[_0xa283('0xd')]('/',auth[_0xa283('0x6')](),controller[_0xa283('0xe')]);router[_0xa283('0xf')](_0xa283('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xa283('0x7'),auth[_0xa283('0x6')](),controller[_0xa283('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xaee4=['../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaee4,0x65));var _0x4aee=function(_0x70f3ff,_0x3599b0){_0x70f3ff=_0x70f3ff-0x0;var _0x87a145=_0xaee4[_0x70f3ff];return _0x87a145;};'use strict';var multer=require('multer');var util=require(_0x4aee('0x0'));var path=require(_0x4aee('0x1'));var timeout=require(_0x4aee('0x2'));var express=require(_0x4aee('0x3'));var router=express[_0x4aee('0x4')]();var fs_extra=require(_0x4aee('0x5'));var auth=require(_0x4aee('0x6'));var interaction=require(_0x4aee('0x7'));var config=require(_0x4aee('0x8'));var controller=require(_0x4aee('0x9'));router['get']('/',auth[_0x4aee('0xa')](),controller[_0x4aee('0xb')]);router[_0x4aee('0xc')]('/:id',auth[_0x4aee('0xa')](),controller[_0x4aee('0xd')]);router[_0x4aee('0xc')](_0x4aee('0xe'),auth['isAuthenticated'](),controller[_0x4aee('0xf')]);router['get'](_0x4aee('0x10'),auth[_0x4aee('0xa')](),controller[_0x4aee('0x11')]);router[_0x4aee('0xc')](_0x4aee('0x12'),auth[_0x4aee('0xa')](),controller[_0x4aee('0x13')]);router[_0x4aee('0x14')]('/',auth[_0x4aee('0xa')](),controller[_0x4aee('0x15')]);router[_0x4aee('0x16')](_0x4aee('0x17'),auth[_0x4aee('0xa')](),controller[_0x4aee('0x18')]);router[_0x4aee('0x19')]('/:id',auth[_0x4aee('0xa')](),controller['destroy']);module[_0x4aee('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index d65d34c..50801ad 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 _0x326f=['STRING','TEXT','sequelize'];(function(_0x1ed19e,_0x48e01c){var _0x53a7e3=function(_0x37c41b){while(--_0x37c41b){_0x1ed19e['push'](_0x1ed19e['shift']());}};_0x53a7e3(++_0x48e01c);}(_0x326f,0xd1));var _0xf326=function(_0x141eb8,_0x4e2201){_0x141eb8=_0x141eb8-0x0;var _0x139f8d=_0x326f[_0x141eb8];return _0x139f8d;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}};
\ No newline at end of file
+var _0x6f47=['TEXT','exports','STRING'];(function(_0x31259c,_0x31488d){var _0x220546=function(_0x347f7a){while(--_0x347f7a){_0x31259c['push'](_0x31259c['shift']());}};_0x220546(++_0x31488d);}(_0x6f47,0xc7));var _0x76f4=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x6f47[_0x576170];return _0x397c70;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 36aef66..e1b82a0 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 _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(_0x5bdc18,_0x57552b){var _0x4fb79e=function(_0x565faf){while(--_0x565faf){_0x5bdc18['push'](_0x5bdc18['shift']());}};_0x4fb79e(++_0x57552b);}(_0x814b,0x1a2));var _0xb814=function(_0x2abd13,_0x501317){_0x2abd13=_0x2abd13-0x0;var _0x5ad645=_0x814b[_0x2abd13];return _0x5ad645;};'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
+var _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0xb331b1,_0x1e66e6){var _0x1ba713=function(_0x26ab5e){while(--_0x26ab5e){_0xb331b1['push'](_0xb331b1['shift']());}};_0x1ba713(++_0x1e66e6);}(_0x1967,0x173));var _0x7196=function(_0x3a7497,_0x2a27a4){_0x3a7497=_0x3a7497-0x0;var _0x5b8342=_0x1967[_0x3a7497];return _0x5b8342;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 7f35440..da78ea2 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 _0x594f=['exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','bluebird','path','./analyticDefaultReport.attributes'];(function(_0x3a76e4,_0x82586d){var _0x56fd7c=function(_0x5ab5af){while(--_0x5ab5af){_0x3a76e4['push'](_0x3a76e4['shift']());}};_0x56fd7c(++_0x82586d);}(_0x594f,0x78));var _0xf594=function(_0xb27b4b,_0x17546c){_0xb27b4b=_0xb27b4b-0x0;var _0x2dc7a9=_0x594f[_0xb27b4b];return _0x2dc7a9;};'use strict';var _=require(_0xf594('0x0'));var util=require(_0xf594('0x1'));var logger=require(_0xf594('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf594('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf594('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf594('0x5'));module[_0xf594('0x6')]=function(_0x3c25eb,_0x2303f4){return _0x3c25eb[_0xf594('0x7')](_0xf594('0x8'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1749=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x36edd2,_0x44c0b5){var _0x55bdb7=function(_0x12a3a7){while(--_0x12a3a7){_0x36edd2['push'](_0x36edd2['shift']());}};_0x55bdb7(++_0x44c0b5);}(_0x1749,0xba));var _0x9174=function(_0x4f5b11,_0x44a329){_0x4f5b11=_0x4f5b11-0x0;var _0x1d81a8=_0x1749[_0x4f5b11];return _0x1d81a8;};'use strict';var _=require(_0x9174('0x0'));var util=require(_0x9174('0x1'));var logger=require(_0x9174('0x2'))('api');var moment=require(_0x9174('0x3'));var BPromise=require(_0x9174('0x4'));var rp=require(_0x9174('0x5'));var fs=require('fs');var path=require(_0x9174('0x6'));var rimraf=require(_0x9174('0x7'));var config=require(_0x9174('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0x9174('0x9')]=function(_0x85b92d,_0x185cd6){return _0x85b92d[_0x9174('0xa')](_0x9174('0xb'),attributes,{'tableName':_0x9174('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 5c85172..9eb36d2 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 _0x338c=['then','info','request\x20sent','debug','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x1dfdd5,_0x3e2af3){var _0x4524b6=function(_0x45a29b){while(--_0x45a29b){_0x1dfdd5['push'](_0x1dfdd5['shift']());}};_0x4524b6(++_0x3e2af3);}(_0x338c,0xf1));var _0xc338=function(_0x4ea1bb,_0x35efe8){_0x4ea1bb=_0x4ea1bb-0x0;var _0x2b6fab=_0x338c[_0x4ea1bb];return _0x2b6fab;};'use strict';var _=require(_0xc338('0x0'));var util=require('util');var moment=require(_0xc338('0x1'));var BPromise=require(_0xc338('0x2'));var rs=require(_0xc338('0x3'));var fs=require('fs');var Redis=require(_0xc338('0x4'));var db=require(_0xc338('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc338('0x6'))('rpc');var config=require(_0xc338('0x7'));var jayson=require(_0xc338('0x8'));var client=jayson[_0xc338('0x9')][_0xc338('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1eaa24,_0x305e74,_0x10cad0){return new BPromise(function(_0x30f9cb,_0xd3d3a1){return client[_0xc338('0xb')](_0x1eaa24,_0x10cad0)[_0xc338('0xc')](function(_0x20da44){logger[_0xc338('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x305e74,_0xc338('0xe'));logger[_0xc338('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x305e74,'request\x20sent',JSON[_0xc338('0x10')](_0x20da44));if(_0x20da44[_0xc338('0x11')]){if(_0x20da44[_0xc338('0x11')][_0xc338('0x12')]===0x1f4){logger['error'](_0xc338('0x13'),_0x305e74,_0x20da44[_0xc338('0x11')][_0xc338('0x14')]);return _0xd3d3a1(_0x20da44[_0xc338('0x11')][_0xc338('0x14')]);}logger[_0xc338('0x11')](_0xc338('0x13'),_0x305e74,_0x20da44[_0xc338('0x11')]['message']);return _0x30f9cb(_0x20da44['error']['message']);}else{logger[_0xc338('0xd')](_0xc338('0x13'),_0x305e74,'request\x20sent');_0x30f9cb(_0x20da44[_0xc338('0x15')][_0xc338('0x14')]);}})[_0xc338('0x16')](function(_0x58cc19){logger[_0xc338('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x305e74,_0x58cc19);_0xd3d3a1(_0x58cc19);});});}
\ No newline at end of file
+var _0x5c1d=['code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xd988e6,_0x4f84fa){var _0x5b2947=function(_0x405a30){while(--_0x405a30){_0xd988e6['push'](_0xd988e6['shift']());}};_0x5b2947(++_0x4f84fa);}(_0x5c1d,0x1bb));var _0xd5c1=function(_0x7bb360,_0x1984aa){_0x7bb360=_0x7bb360-0x0;var _0x19f0a0=_0x5c1d[_0x7bb360];return _0x19f0a0;};'use strict';var _=require(_0xd5c1('0x0'));var util=require(_0xd5c1('0x1'));var moment=require(_0xd5c1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5c1('0x3'));var db=require(_0xd5c1('0x4'))['db'];var utils=require(_0xd5c1('0x5'));var logger=require('../../config/logger')(_0xd5c1('0x6'));var config=require('../../config/environment');var jayson=require(_0xd5c1('0x7'));var client=jayson[_0xd5c1('0x8')][_0xd5c1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42798b,_0x819d2f,_0x258681){return new BPromise(function(_0x3983aa,_0x15ee50){return client[_0xd5c1('0xa')](_0x42798b,_0x258681)['then'](function(_0x4dfc26){logger[_0xd5c1('0xb')](_0xd5c1('0xc'),_0x819d2f,'request\x20sent');logger['debug'](_0xd5c1('0xd'),_0x819d2f,_0xd5c1('0xe'),JSON[_0xd5c1('0xf')](_0x4dfc26));if(_0x4dfc26[_0xd5c1('0x10')]){if(_0x4dfc26[_0xd5c1('0x10')][_0xd5c1('0x11')]===0x1f4){logger[_0xd5c1('0x10')](_0xd5c1('0xc'),_0x819d2f,_0x4dfc26[_0xd5c1('0x10')][_0xd5c1('0x12')]);return _0x15ee50(_0x4dfc26['error'][_0xd5c1('0x12')]);}logger['error'](_0xd5c1('0xc'),_0x819d2f,_0x4dfc26['error'][_0xd5c1('0x12')]);return _0x3983aa(_0x4dfc26['error'][_0xd5c1('0x12')]);}else{logger[_0xd5c1('0xb')](_0xd5c1('0xc'),_0x819d2f,_0xd5c1('0xe'));_0x3983aa(_0x4dfc26['result']['message']);}})[_0xd5c1('0x13')](function(_0x2f4a10){logger[_0xd5c1('0x10')](_0xd5c1('0xc'),_0x819d2f,_0x2f4a10);_0x15ee50(_0x2f4a10);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index f6825bc..d279a74 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 _0x8c25=['../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','show','/:id/preview','preview','run','get','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x51ef6c,_0x1ecc7c){var _0x4ae3a5=function(_0x34b006){while(--_0x34b006){_0x51ef6c['push'](_0x51ef6c['shift']());}};_0x4ae3a5(++_0x1ecc7c);}(_0x8c25,0xe2));var _0x58c2=function(_0x5508a6,_0x41cb72){_0x5508a6=_0x5508a6-0x0;var _0x4660a1=_0x8c25[_0x5508a6];return _0x4660a1;};'use strict';var multer=require('multer');var util=require(_0x58c2('0x0'));var path=require('path');var timeout=require(_0x58c2('0x1'));var express=require(_0x58c2('0x2'));var router=express[_0x58c2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x58c2('0x4'));var config=require(_0x58c2('0x5'));var controller=require(_0x58c2('0x6'));router['get']('/',auth[_0x58c2('0x7')](),controller[_0x58c2('0x8')]);router['get']('/:id',auth[_0x58c2('0x7')](),controller[_0x58c2('0x9')]);router['get'](_0x58c2('0xa'),auth[_0x58c2('0x7')](),controller[_0x58c2('0xb')]);router['get']('/:id/run',auth[_0x58c2('0x7')](),controller[_0x58c2('0xc')]);router[_0x58c2('0xd')]('/:id/query',auth[_0x58c2('0x7')](),controller['query']);router['post']('/',auth[_0x58c2('0x7')](),controller[_0x58c2('0xe')]);router[_0x58c2('0xf')](_0x58c2('0x10'),auth[_0x58c2('0x7')](),controller[_0x58c2('0x11')]);router[_0x58c2('0x12')]('/:id',auth[_0x58c2('0x7')](),controller[_0x58c2('0x13')]);module[_0x58c2('0x14')]=router;
\ No newline at end of file
+var _0x08d4=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer'];(function(_0x2f8ef3,_0xc96ff2){var _0x223a26=function(_0x22aa0a){while(--_0x22aa0a){_0x2f8ef3['push'](_0x2f8ef3['shift']());}};_0x223a26(++_0xc96ff2);}(_0x08d4,0x1af));var _0x408d=function(_0x402b42,_0x205681){_0x402b42=_0x402b42-0x0;var _0x1b4560=_0x08d4[_0x402b42];return _0x1b4560;};'use strict';var multer=require(_0x408d('0x0'));var util=require(_0x408d('0x1'));var path=require(_0x408d('0x2'));var timeout=require(_0x408d('0x3'));var express=require(_0x408d('0x4'));var router=express[_0x408d('0x5')]();var fs_extra=require(_0x408d('0x6'));var auth=require(_0x408d('0x7'));var interaction=require(_0x408d('0x8'));var config=require(_0x408d('0x9'));var controller=require('./analyticDefaultReport.controller');router[_0x408d('0xa')]('/',auth[_0x408d('0xb')](),controller[_0x408d('0xc')]);router[_0x408d('0xa')](_0x408d('0xd'),auth[_0x408d('0xb')](),controller[_0x408d('0xe')]);router[_0x408d('0xa')](_0x408d('0xf'),auth[_0x408d('0xb')](),controller[_0x408d('0x10')]);router['get']('/:id/run',auth[_0x408d('0xb')](),controller[_0x408d('0x11')]);router['get'](_0x408d('0x12'),auth['isAuthenticated'](),controller[_0x408d('0x13')]);router[_0x408d('0x14')]('/',auth[_0x408d('0xb')](),controller[_0x408d('0x15')]);router[_0x408d('0x16')]('/:id',auth[_0x408d('0xb')](),controller[_0x408d('0x17')]);router[_0x408d('0x18')](_0x408d('0xd'),auth[_0x408d('0xb')](),controller[_0x408d('0x19')]);module[_0x408d('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index f9ccae4..4b98df0 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 _0xe3f7=['sequelize','moment','STRING','pdf','xlsx','csv','DATE','Loading','ENUM','manual','scheduled','INTEGER'];(function(_0x38043c,_0x46d1ec){var _0x32088d=function(_0x56d01a){while(--_0x56d01a){_0x38043c['push'](_0x38043c['shift']());}};_0x32088d(++_0x46d1ec);}(_0xe3f7,0x1ec));var _0x7e3f=function(_0xfc2c73,_0x2a6325){_0xfc2c73=_0xfc2c73-0x0;var _0x2c0ba5=_0xe3f7[_0xfc2c73];return _0x2c0ba5;};'use strict';var Sequelize=require(_0x7e3f('0x0'));var moment=require(_0x7e3f('0x1'));module['exports']={'name':{'type':Sequelize[_0x7e3f('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0x7e3f('0x3'),_0x7e3f('0x4')),'allowNull':![],'defaultValue':_0x7e3f('0x5')},'savename':{'type':Sequelize[_0x7e3f('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x7e3f('0x6')]},'status':{'type':Sequelize[_0x7e3f('0x2')],'defaultValue':_0x7e3f('0x7')},'type':{'type':Sequelize[_0x7e3f('0x8')](_0x7e3f('0x9'),_0x7e3f('0xa')),'allowNull':![],'defaultValue':_0x7e3f('0x9')},'reportId':{'type':Sequelize[_0x7e3f('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x7e3f('0x2')]}};
\ No newline at end of file
+var _0x3e2c=['DATE','Loading','scheduled','manual','INTEGER','sequelize','moment','exports','STRING','ENUM','pdf','xlsx'];(function(_0x4a1315,_0x58b7d5){var _0x16125a=function(_0x4854f7){while(--_0x4854f7){_0x4a1315['push'](_0x4a1315['shift']());}};_0x16125a(++_0x58b7d5);}(_0x3e2c,0x1cd));var _0xc3e2=function(_0x486f8e,_0x52fb5f){_0x486f8e=_0x486f8e-0x0;var _0x528b66=_0x3e2c[_0x486f8e];return _0x528b66;};'use strict';var Sequelize=require(_0xc3e2('0x0'));var moment=require(_0xc3e2('0x1'));module[_0xc3e2('0x2')]={'name':{'type':Sequelize[_0xc3e2('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xc3e2('0x4')]('csv',_0xc3e2('0x5'),_0xc3e2('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xc3e2('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc3e2('0x7')]},'endDate':{'type':Sequelize[_0xc3e2('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xc3e2('0x8')},'type':{'type':Sequelize[_0xc3e2('0x4')]('manual',_0xc3e2('0x9')),'allowNull':![],'defaultValue':_0xc3e2('0xa')},'reportId':{'type':Sequelize[_0xc3e2('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xc3e2('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 5e3c851..3693d97 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 _0xaf76=['sox','fs-extra','lodash','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','ExtractedReports','destroy','then','stack','name','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','%s.%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x123599,_0x374e14){var _0x3bf01d=function(_0x60b9bc){while(--_0x60b9bc){_0x123599['push'](_0x123599['shift']());}};_0x3bf01d(++_0x374e14);}(_0xaf76,0xb0));var _0x6af7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf76[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6af7('0x0'));var rimraf=require(_0x6af7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6af7('0x2'));var rp=require(_0x6af7('0x3'));var moment=require(_0x6af7('0x4'));var BPromise=require(_0x6af7('0x5'));var Mustache=require('mustache');var util=require(_0x6af7('0x6'));var path=require(_0x6af7('0x7'));var sox=require(_0x6af7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6af7('0x9'));var _=require(_0x6af7('0xa'));var squel=require('squel');var crypto=require(_0x6af7('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6af7('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6af7('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x6af7('0xe'));var hardwareService=require(_0x6af7('0xf'));var logger=require(_0x6af7('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x6af7('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x6af7('0x12'))['db'];function respondWithStatusCode(_0x22135d,_0x1c3604){_0x1c3604=_0x1c3604||0xcc;return function(_0x3d4301){if(_0x3d4301){return _0x22135d[_0x6af7('0x13')](_0x1c3604);}return _0x22135d[_0x6af7('0x14')](_0x1c3604)[_0x6af7('0x15')]();};}function respondWithResult(_0x447ccf,_0x1f4eef){_0x1f4eef=_0x1f4eef||0xc8;return function(_0x507372){if(_0x507372){return _0x447ccf['status'](_0x1f4eef)[_0x6af7('0x16')](_0x507372);}};}function respondWithFilteredResult(_0x3a94a4,_0x4e7f76){return function(_0x432896){if(_0x432896){var _0x3fa345=typeof _0x4e7f76[_0x6af7('0x17')]===_0x6af7('0x18')&&typeof _0x4e7f76[_0x6af7('0x19')]===_0x6af7('0x18');var _0x57d79d=_0x432896[_0x6af7('0x1a')];var _0x351fdb=_0x3fa345?0x0:_0x4e7f76[_0x6af7('0x17')];var _0x495c75=_0x3fa345?_0x432896[_0x6af7('0x1a')]:_0x4e7f76[_0x6af7('0x17')]+_0x4e7f76[_0x6af7('0x19')];var _0x4a071a;if(_0x495c75>=_0x57d79d){_0x495c75=_0x57d79d;_0x4a071a=0xc8;}else{_0x4a071a=0xce;}_0x3a94a4[_0x6af7('0x14')](_0x4a071a);return _0x3a94a4[_0x6af7('0x1b')]('Content-Range',_0x351fdb+'-'+_0x495c75+'/'+_0x57d79d)[_0x6af7('0x16')](_0x432896);}return null;};}function patchUpdates(_0x50e996){return function(_0x499567){try{jsonpatch[_0x6af7('0x1c')](_0x499567,_0x50e996,!![]);}catch(_0x202e4c){return BPromise[_0x6af7('0x1d')](_0x202e4c);}return _0x499567[_0x6af7('0x1e')]();};}function saveUpdates(_0x54ecdf,_0x3b550d){return function(_0x23e8b5){if(_0x23e8b5){return _0x23e8b5[_0x6af7('0x1f')](_0x54ecdf)['then'](function(_0xb93ce2){return _0xb93ce2;});}return null;};}function removeEntity(_0xd8eb5b,_0x1243d6){return function(_0x38b97c){if(_0x38b97c){return _0x38b97c['destroy']()['then'](function(){var _0x32642f=_0x38b97c['get']({'plain':!![]});var _0x40c380=_0x6af7('0x20');return db['UserProfileResource'][_0x6af7('0x21')]({'where':{'type':_0x40c380,'resourceId':_0x32642f['id']}})['then'](function(){return _0x38b97c;});})[_0x6af7('0x22')](function(){_0xd8eb5b[_0x6af7('0x14')](0xcc)[_0x6af7('0x15')]();});}};}function handleEntityNotFound(_0x15d50d,_0x262654){return function(_0x46e99f){if(!_0x46e99f){_0x15d50d[_0x6af7('0x13')](0x194);}return _0x46e99f;};}function handleError(_0x57023e,_0x7b6191){_0x7b6191=_0x7b6191||0x1f4;return function(_0x435cc6){logger['error'](_0x435cc6[_0x6af7('0x23')]);if(_0x435cc6[_0x6af7('0x24')]){delete _0x435cc6[_0x6af7('0x24')];}_0x57023e[_0x6af7('0x14')](_0x7b6191)['send'](_0x435cc6);};}exports[_0x6af7('0x25')]=function(_0x3304a3,_0x1adb71){var _0x1648f5={},_0x489c22={},_0xf562fe={'count':0x0,'rows':[]};var _0x26ace8=_[_0x6af7('0x26')](db[_0x6af7('0x27')]['rawAttributes'],function(_0x56a35b){return{'name':_0x56a35b[_0x6af7('0x28')],'type':_0x56a35b[_0x6af7('0x29')][_0x6af7('0x2a')]};});_0x489c22[_0x6af7('0x2b')]=_[_0x6af7('0x26')](_0x26ace8,_0x6af7('0x24'));_0x489c22[_0x6af7('0x2c')]=_[_0x6af7('0x2d')](_0x3304a3[_0x6af7('0x2c')]);_0x489c22[_0x6af7('0x2e')]=_['intersection'](_0x489c22['model'],_0x489c22[_0x6af7('0x2c')]);_0x1648f5[_0x6af7('0x2f')]=_[_0x6af7('0x30')](_0x489c22['model'],qs[_0x6af7('0x31')](_0x3304a3['query'][_0x6af7('0x31')]));_0x1648f5[_0x6af7('0x2f')]=_0x1648f5[_0x6af7('0x2f')][_0x6af7('0x32')]?_0x1648f5[_0x6af7('0x2f')]:_0x489c22['model'];if(!_0x3304a3[_0x6af7('0x2c')][_0x6af7('0x33')](_0x6af7('0x34'))){_0x1648f5[_0x6af7('0x19')]=qs[_0x6af7('0x19')](_0x3304a3[_0x6af7('0x2c')][_0x6af7('0x19')]);_0x1648f5[_0x6af7('0x17')]=qs[_0x6af7('0x17')](_0x3304a3[_0x6af7('0x2c')][_0x6af7('0x17')]);}_0x1648f5[_0x6af7('0x35')]=qs[_0x6af7('0x36')](_0x3304a3[_0x6af7('0x2c')][_0x6af7('0x36')]);_0x1648f5[_0x6af7('0x37')]=qs[_0x6af7('0x2e')](_[_0x6af7('0x38')](_0x3304a3[_0x6af7('0x2c')],_0x489c22[_0x6af7('0x2e')]),_0x26ace8);if(_0x3304a3['query'][_0x6af7('0x39')]){_0x1648f5['where']=_[_0x6af7('0x3a')](_0x1648f5[_0x6af7('0x37')],{'$or':_[_0x6af7('0x26')](_0x26ace8,function(_0x10cda5){if(_0x10cda5['type']!=='VIRTUAL'){var _0x106fa5={};_0x106fa5[_0x10cda5[_0x6af7('0x24')]]={'$like':'%'+_0x3304a3[_0x6af7('0x2c')][_0x6af7('0x39')]+'%'};return _0x106fa5;}})});}_0x1648f5=_[_0x6af7('0x3a')]({},_0x1648f5,_0x3304a3[_0x6af7('0x3b')]);var _0x37a6bd={'where':_0x1648f5[_0x6af7('0x37')]};return db[_0x6af7('0x27')][_0x6af7('0x1a')](_0x37a6bd)[_0x6af7('0x22')](function(_0x2426b5){_0xf562fe[_0x6af7('0x1a')]=_0x2426b5;if(_0x3304a3[_0x6af7('0x2c')][_0x6af7('0x3c')]){_0x1648f5['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x6af7('0x3d')](_0x1648f5);})[_0x6af7('0x22')](function(_0x193cc4){_0xf562fe[_0x6af7('0x3e')]=_0x193cc4;return _0xf562fe;})['then'](respondWithFilteredResult(_0x1adb71,_0x1648f5))[_0x6af7('0x3f')](handleError(_0x1adb71,null));};exports[_0x6af7('0x40')]=function(_0x335c51,_0x1a4515){var _0x45bb37={'raw':!![],'where':{'id':_0x335c51[_0x6af7('0x41')]['id']}},_0x1d5a76={};_0x1d5a76[_0x6af7('0x2b')]=_[_0x6af7('0x2d')](db[_0x6af7('0x27')]['rawAttributes']);_0x1d5a76[_0x6af7('0x2c')]=_[_0x6af7('0x2d')](_0x335c51['query']);_0x1d5a76[_0x6af7('0x2e')]=_['intersection'](_0x1d5a76['model'],_0x1d5a76[_0x6af7('0x2c')]);_0x45bb37[_0x6af7('0x2f')]=_[_0x6af7('0x30')](_0x1d5a76[_0x6af7('0x2b')],qs[_0x6af7('0x31')](_0x335c51[_0x6af7('0x2c')][_0x6af7('0x31')]));_0x45bb37[_0x6af7('0x2f')]=_0x45bb37[_0x6af7('0x2f')][_0x6af7('0x32')]?_0x45bb37[_0x6af7('0x2f')]:_0x1d5a76[_0x6af7('0x2b')];if(_0x335c51[_0x6af7('0x2c')][_0x6af7('0x3c')]){_0x45bb37[_0x6af7('0x42')]=[{'all':!![]}];}_0x45bb37=_[_0x6af7('0x3a')]({},_0x45bb37,_0x335c51['options']);return db['AnalyticExtractedReport'][_0x6af7('0x43')](_0x45bb37)['then'](handleEntityNotFound(_0x1a4515,null))[_0x6af7('0x22')](respondWithResult(_0x1a4515,null))[_0x6af7('0x3f')](handleError(_0x1a4515,null));};exports[_0x6af7('0x44')]=function(_0x4e73c9,_0x3f738f){return db[_0x6af7('0x27')][_0x6af7('0x44')](_0x4e73c9[_0x6af7('0x45')],{})[_0x6af7('0x22')](function(_0x4e0e50){var _0x43ccf5=_0x4e73c9['user']['get']({'plain':!![]});if(!_0x43ccf5)throw new Error(_0x6af7('0x46'));if(_0x43ccf5[_0x6af7('0x47')]===_0x6af7('0x48')){var _0x3c737d=_0x4e0e50[_0x6af7('0x49')]({'plain':!![]});var _0x59ffbc='ExtractedReports';return db[_0x6af7('0x4a')][_0x6af7('0x43')]({'where':{'name':_0x59ffbc,'userProfileId':_0x43ccf5[_0x6af7('0x4b')]},'raw':!![]})[_0x6af7('0x22')](function(_0x332a60){if(_0x332a60&&_0x332a60[_0x6af7('0x4c')]===0x0){return db[_0x6af7('0x4d')]['create']({'name':_0x3c737d[_0x6af7('0x24')],'resourceId':_0x3c737d['id'],'type':_0x332a60[_0x6af7('0x24')],'sectionId':_0x332a60['id']},{})[_0x6af7('0x22')](function(){return _0x4e0e50;});}else{return _0x4e0e50;}})[_0x6af7('0x3f')](function(_0x3acb42){logger[_0x6af7('0x4e')](_0x6af7('0x4f'),_0x3acb42);throw _0x3acb42;});}return _0x4e0e50;})[_0x6af7('0x22')](respondWithResult(_0x3f738f,0xc9))[_0x6af7('0x3f')](handleError(_0x3f738f,null));};exports[_0x6af7('0x1f')]=function(_0xaf09b1,_0x36528f){if(_0xaf09b1[_0x6af7('0x45')]['id']){delete _0xaf09b1['body']['id'];}return db[_0x6af7('0x27')][_0x6af7('0x43')]({'where':{'id':_0xaf09b1[_0x6af7('0x41')]['id']}})['then'](handleEntityNotFound(_0x36528f,null))[_0x6af7('0x22')](saveUpdates(_0xaf09b1['body'],null))['then'](respondWithResult(_0x36528f,null))[_0x6af7('0x3f')](handleError(_0x36528f,null));};exports[_0x6af7('0x21')]=function(_0x24534a,_0x1e7e73){return db[_0x6af7('0x27')][_0x6af7('0x43')]({'where':{'id':_0x24534a[_0x6af7('0x41')]['id']}})[_0x6af7('0x22')](handleEntityNotFound(_0x1e7e73,null))[_0x6af7('0x22')](removeEntity(_0x1e7e73,null))[_0x6af7('0x3f')](handleError(_0x1e7e73,null));};exports[_0x6af7('0x50')]=function(_0x584c14,_0x423e86,_0x21e1cb){return db[_0x6af7('0x27')][_0x6af7('0x43')]({'where':{'id':_0x584c14[_0x6af7('0x41')]['id']},'attributes':[_0x6af7('0x24'),_0x6af7('0x51'),_0x6af7('0x52'),'output'],'raw':!![]})[_0x6af7('0x22')](handleEntityNotFound(_0x423e86,null))['then'](function(_0x3e2a4e){if(_0x3e2a4e){if(!fs[_0x6af7('0x53')](path[_0x6af7('0x54')](config[_0x6af7('0x55')],'server/files/reports',_0x3e2a4e[_0x6af7('0x52')]))){throw new db[(_0x6af7('0x56'))][(_0x6af7('0x57'))](_0x6af7('0x58'));}if(_0x584c14[_0x6af7('0x2c')][_0x6af7('0x59')]){return _0x423e86[_0x6af7('0x13')](0xc8);}return _0x423e86[_0x6af7('0x50')](path[_0x6af7('0x54')](config[_0x6af7('0x55')],_0x6af7('0x5a'),_0x3e2a4e['savename']),util['format'](_0x6af7('0x5b'),_0x3e2a4e[_0x6af7('0x51')]||_0x3e2a4e[_0x6af7('0x24')],_0x3e2a4e['output']['toLowerCase']()));}})[_0x6af7('0x3f')](handleError(_0x423e86,null));};
\ No newline at end of file
+var _0x7759=['AnalyticExtractedReport','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','savename','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','index','map'];(function(_0x451353,_0x19710b){var _0x102315=function(_0x51204c){while(--_0x51204c){_0x451353['push'](_0x451353['shift']());}};_0x102315(++_0x19710b);}(_0x7759,0x194));var _0x9775=function(_0x22662a,_0x1cbd57){_0x22662a=_0x22662a-0x0;var _0x2aba64=_0x7759[_0x22662a];return _0x2aba64;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9775('0x0'));var zipdir=require(_0x9775('0x1'));var jsonpatch=require(_0x9775('0x2'));var rp=require(_0x9775('0x3'));var moment=require('moment');var BPromise=require(_0x9775('0x4'));var Mustache=require(_0x9775('0x5'));var util=require(_0x9775('0x6'));var path=require(_0x9775('0x7'));var sox=require('sox');var csv=require(_0x9775('0x8'));var ejs=require(_0x9775('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9775('0xa'));var squel=require(_0x9775('0xb'));var crypto=require(_0x9775('0xc'));var jsforce=require(_0x9775('0xd'));var deskjs=require(_0x9775('0xe'));var toCsv=require(_0x9775('0x8'));var querystring=require(_0x9775('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9775('0x10'));var qs=require(_0x9775('0x11'));var as=require(_0x9775('0x12'));var hardwareService=require(_0x9775('0x13'));var logger=require(_0x9775('0x14'))('api');var utils=require(_0x9775('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9775('0x16'));var db=require(_0x9775('0x17'))['db'];function respondWithStatusCode(_0x5b6809,_0xd1c228){_0xd1c228=_0xd1c228||0xcc;return function(_0x282fb5){if(_0x282fb5){return _0x5b6809[_0x9775('0x18')](_0xd1c228);}return _0x5b6809['status'](_0xd1c228)[_0x9775('0x19')]();};}function respondWithResult(_0x253102,_0x4bb0cd){_0x4bb0cd=_0x4bb0cd||0xc8;return function(_0x636671){if(_0x636671){return _0x253102[_0x9775('0x1a')](_0x4bb0cd)[_0x9775('0x1b')](_0x636671);}};}function respondWithFilteredResult(_0x47e5fa,_0x2483f9){return function(_0x584f82){if(_0x584f82){var _0x426fc5=typeof _0x2483f9[_0x9775('0x1c')]===_0x9775('0x1d')&&typeof _0x2483f9[_0x9775('0x1e')]===_0x9775('0x1d');var _0x307af3=_0x584f82[_0x9775('0x1f')];var _0x532fc8=_0x426fc5?0x0:_0x2483f9[_0x9775('0x1c')];var _0x2320e0=_0x426fc5?_0x584f82['count']:_0x2483f9[_0x9775('0x1c')]+_0x2483f9[_0x9775('0x1e')];var _0x1ed595;if(_0x2320e0>=_0x307af3){_0x2320e0=_0x307af3;_0x1ed595=0xc8;}else{_0x1ed595=0xce;}_0x47e5fa[_0x9775('0x1a')](_0x1ed595);return _0x47e5fa[_0x9775('0x20')]('Content-Range',_0x532fc8+'-'+_0x2320e0+'/'+_0x307af3)['json'](_0x584f82);}return null;};}function patchUpdates(_0x38cf19){return function(_0x448f4b){try{jsonpatch['apply'](_0x448f4b,_0x38cf19,!![]);}catch(_0x4d004e){return BPromise[_0x9775('0x21')](_0x4d004e);}return _0x448f4b[_0x9775('0x22')]();};}function saveUpdates(_0x428b48,_0x5a280f){return function(_0x28d255){if(_0x28d255){return _0x28d255[_0x9775('0x23')](_0x428b48)[_0x9775('0x24')](function(_0x5d948a){return _0x5d948a;});}return null;};}function removeEntity(_0x4c1042,_0xfd46de){return function(_0x2247b1){if(_0x2247b1){return _0x2247b1[_0x9775('0x25')]()[_0x9775('0x24')](function(){var _0x9bd5a8=_0x2247b1[_0x9775('0x26')]({'plain':!![]});var _0x2517a4=_0x9775('0x27');return db[_0x9775('0x28')]['destroy']({'where':{'type':_0x2517a4,'resourceId':_0x9bd5a8['id']}})[_0x9775('0x24')](function(){return _0x2247b1;});})['then'](function(){_0x4c1042[_0x9775('0x1a')](0xcc)[_0x9775('0x19')]();});}};}function handleEntityNotFound(_0x5f409e,_0x8806a6){return function(_0x57af3d){if(!_0x57af3d){_0x5f409e[_0x9775('0x18')](0x194);}return _0x57af3d;};}function handleError(_0x1b8d84,_0x173f2b){_0x173f2b=_0x173f2b||0x1f4;return function(_0x1f385b){logger[_0x9775('0x29')](_0x1f385b[_0x9775('0x2a')]);if(_0x1f385b[_0x9775('0x2b')]){delete _0x1f385b['name'];}_0x1b8d84['status'](_0x173f2b)['send'](_0x1f385b);};}exports[_0x9775('0x2c')]=function(_0x5c5751,_0x5e7f1f){var _0x366530={},_0x573909={},_0x3971ef={'count':0x0,'rows':[]};var _0x114b91=_[_0x9775('0x2d')](db[_0x9775('0x2e')][_0x9775('0x2f')],function(_0x55726d){return{'name':_0x55726d['fieldName'],'type':_0x55726d[_0x9775('0x30')][_0x9775('0x31')]};});_0x573909[_0x9775('0x32')]=_[_0x9775('0x2d')](_0x114b91,_0x9775('0x2b'));_0x573909['query']=_[_0x9775('0x33')](_0x5c5751[_0x9775('0x34')]);_0x573909['filters']=_[_0x9775('0x35')](_0x573909[_0x9775('0x32')],_0x573909['query']);_0x366530[_0x9775('0x36')]=_[_0x9775('0x35')](_0x573909[_0x9775('0x32')],qs[_0x9775('0x37')](_0x5c5751[_0x9775('0x34')][_0x9775('0x37')]));_0x366530[_0x9775('0x36')]=_0x366530['attributes'][_0x9775('0x38')]?_0x366530['attributes']:_0x573909[_0x9775('0x32')];if(!_0x5c5751['query']['hasOwnProperty'](_0x9775('0x39'))){_0x366530[_0x9775('0x1e')]=qs[_0x9775('0x1e')](_0x5c5751[_0x9775('0x34')][_0x9775('0x1e')]);_0x366530[_0x9775('0x1c')]=qs[_0x9775('0x1c')](_0x5c5751[_0x9775('0x34')][_0x9775('0x1c')]);}_0x366530['order']=qs[_0x9775('0x3a')](_0x5c5751[_0x9775('0x34')]['sort']);_0x366530['where']=qs[_0x9775('0x3b')](_['pick'](_0x5c5751[_0x9775('0x34')],_0x573909[_0x9775('0x3b')]),_0x114b91);if(_0x5c5751[_0x9775('0x34')][_0x9775('0x3c')]){_0x366530[_0x9775('0x3d')]=_[_0x9775('0x3e')](_0x366530[_0x9775('0x3d')],{'$or':_[_0x9775('0x2d')](_0x114b91,function(_0x30fa76){if(_0x30fa76[_0x9775('0x30')]!==_0x9775('0x3f')){var _0x2466dc={};_0x2466dc[_0x30fa76['name']]={'$like':'%'+_0x5c5751[_0x9775('0x34')][_0x9775('0x3c')]+'%'};return _0x2466dc;}})});}_0x366530=_[_0x9775('0x3e')]({},_0x366530,_0x5c5751[_0x9775('0x40')]);var _0x582ee2={'where':_0x366530[_0x9775('0x3d')]};return db[_0x9775('0x2e')]['count'](_0x582ee2)[_0x9775('0x24')](function(_0x2df0ce){_0x3971ef['count']=_0x2df0ce;if(_0x5c5751[_0x9775('0x34')][_0x9775('0x41')]){_0x366530[_0x9775('0x42')]=[{'all':!![]}];}return db[_0x9775('0x2e')]['findAll'](_0x366530);})[_0x9775('0x24')](function(_0x5c8031){_0x3971ef[_0x9775('0x43')]=_0x5c8031;return _0x3971ef;})['then'](respondWithFilteredResult(_0x5e7f1f,_0x366530))[_0x9775('0x44')](handleError(_0x5e7f1f,null));};exports[_0x9775('0x45')]=function(_0x4e858f,_0x4891db){var _0xcc1c42={'raw':!![],'where':{'id':_0x4e858f[_0x9775('0x46')]['id']}},_0x395970={};_0x395970[_0x9775('0x32')]=_['keys'](db['AnalyticExtractedReport'][_0x9775('0x2f')]);_0x395970[_0x9775('0x34')]=_[_0x9775('0x33')](_0x4e858f[_0x9775('0x34')]);_0x395970[_0x9775('0x3b')]=_[_0x9775('0x35')](_0x395970['model'],_0x395970[_0x9775('0x34')]);_0xcc1c42['attributes']=_[_0x9775('0x35')](_0x395970[_0x9775('0x32')],qs[_0x9775('0x37')](_0x4e858f['query'][_0x9775('0x37')]));_0xcc1c42[_0x9775('0x36')]=_0xcc1c42[_0x9775('0x36')][_0x9775('0x38')]?_0xcc1c42[_0x9775('0x36')]:_0x395970['model'];if(_0x4e858f['query'][_0x9775('0x41')]){_0xcc1c42[_0x9775('0x42')]=[{'all':!![]}];}_0xcc1c42=_['merge']({},_0xcc1c42,_0x4e858f[_0x9775('0x40')]);return db[_0x9775('0x2e')][_0x9775('0x47')](_0xcc1c42)[_0x9775('0x24')](handleEntityNotFound(_0x4891db,null))['then'](respondWithResult(_0x4891db,null))['catch'](handleError(_0x4891db,null));};exports[_0x9775('0x48')]=function(_0x10c69f,_0x383eb9){return db['AnalyticExtractedReport'][_0x9775('0x48')](_0x10c69f[_0x9775('0x49')],{})[_0x9775('0x24')](function(_0x1dd075){var _0xa1687d=_0x10c69f[_0x9775('0x4a')][_0x9775('0x26')]({'plain':!![]});if(!_0xa1687d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa1687d[_0x9775('0x4b')]===_0x9775('0x4a')){var _0x527546=_0x1dd075[_0x9775('0x26')]({'plain':!![]});var _0x57e073=_0x9775('0x27');return db[_0x9775('0x4c')][_0x9775('0x47')]({'where':{'name':_0x57e073,'userProfileId':_0xa1687d[_0x9775('0x4d')]},'raw':!![]})[_0x9775('0x24')](function(_0x2cf963){if(_0x2cf963&&_0x2cf963['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x527546[_0x9775('0x2b')],'resourceId':_0x527546['id'],'type':_0x2cf963['name'],'sectionId':_0x2cf963['id']},{})[_0x9775('0x24')](function(){return _0x1dd075;});}else{return _0x1dd075;}})['catch'](function(_0x50dbb0){logger['error'](_0x9775('0x4e'),_0x50dbb0);throw _0x50dbb0;});}return _0x1dd075;})[_0x9775('0x24')](respondWithResult(_0x383eb9,0xc9))['catch'](handleError(_0x383eb9,null));};exports['update']=function(_0x236004,_0x275f00){if(_0x236004['body']['id']){delete _0x236004[_0x9775('0x49')]['id'];}return db[_0x9775('0x2e')][_0x9775('0x47')]({'where':{'id':_0x236004[_0x9775('0x46')]['id']}})[_0x9775('0x24')](handleEntityNotFound(_0x275f00,null))[_0x9775('0x24')](saveUpdates(_0x236004[_0x9775('0x49')],null))[_0x9775('0x24')](respondWithResult(_0x275f00,null))[_0x9775('0x44')](handleError(_0x275f00,null));};exports[_0x9775('0x25')]=function(_0x3bc5f1,_0x1159ff){return db[_0x9775('0x2e')][_0x9775('0x47')]({'where':{'id':_0x3bc5f1[_0x9775('0x46')]['id']}})[_0x9775('0x24')](handleEntityNotFound(_0x1159ff,null))[_0x9775('0x24')](removeEntity(_0x1159ff,null))[_0x9775('0x44')](handleError(_0x1159ff,null));};exports[_0x9775('0x4f')]=function(_0x1b3f96,_0xee0fc0,_0x53fa5d){return db[_0x9775('0x2e')][_0x9775('0x47')]({'where':{'id':_0x1b3f96[_0x9775('0x46')]['id']},'attributes':[_0x9775('0x2b'),_0x9775('0x50'),'savename',_0x9775('0x51')],'raw':!![]})[_0x9775('0x24')](handleEntityNotFound(_0xee0fc0,null))[_0x9775('0x24')](function(_0x1403ff){if(_0x1403ff){if(!fs[_0x9775('0x52')](path['join'](config[_0x9775('0x53')],_0x9775('0x54'),_0x1403ff['savename']))){throw new db['Sequelize'][(_0x9775('0x55'))](_0x9775('0x56'));}if(_0x1b3f96[_0x9775('0x34')][_0x9775('0x57')]){return _0xee0fc0['sendStatus'](0xc8);}return _0xee0fc0[_0x9775('0x4f')](path['join'](config[_0x9775('0x53')],'server/files/reports',_0x1403ff[_0x9775('0x58')]),util['format']('%s.%s',_0x1403ff[_0x9775('0x50')]||_0x1403ff[_0x9775('0x2b')],_0x1403ff[_0x9775('0x51')][_0x9775('0x59')]()));}})['catch'](handleError(_0xee0fc0,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index d3abc2b..4de52ac 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 _0xa02f=['analytics_extracted_reports','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x998637,_0x16e418){var _0x32e308=function(_0x4ad169){while(--_0x4ad169){_0x998637['push'](_0x998637['shift']());}};_0x32e308(++_0x16e418);}(_0xa02f,0xbc));var _0xfa02=function(_0x427bee,_0x173029){_0x427bee=_0x427bee-0x0;var _0x1d7f7a=_0xa02f[_0x427bee];return _0x1d7f7a;};'use strict';var _=require(_0xfa02('0x0'));var util=require(_0xfa02('0x1'));var logger=require(_0xfa02('0x2'))('api');var moment=require('moment');var BPromise=require(_0xfa02('0x3'));var rp=require(_0xfa02('0x4'));var fs=require('fs');var path=require(_0xfa02('0x5'));var rimraf=require(_0xfa02('0x6'));var config=require(_0xfa02('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0xfa02('0x8')]=function(_0x492275,_0x19af77){return _0x492275[_0xfa02('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0xfa02('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x10da=['exports','define','AnalyticExtractedReport','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./analyticExtractedReport.attributes'];(function(_0x3854e6,_0x45df01){var _0x1ee60d=function(_0x569ec0){while(--_0x569ec0){_0x3854e6['push'](_0x3854e6['shift']());}};_0x1ee60d(++_0x45df01);}(_0x10da,0x1b0));var _0xa10d=function(_0x48912e,_0x2276f4){_0x48912e=_0x48912e-0x0;var _0x4d00c2=_0x10da[_0x48912e];return _0x4d00c2;};'use strict';var _=require(_0xa10d('0x0'));var util=require(_0xa10d('0x1'));var logger=require(_0xa10d('0x2'))(_0xa10d('0x3'));var moment=require('moment');var BPromise=require(_0xa10d('0x4'));var rp=require(_0xa10d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa10d('0x6'));var config=require('../../config/environment');var attributes=require(_0xa10d('0x7'));module[_0xa10d('0x8')]=function(_0x398681,_0x1443b8){return _0x398681[_0xa10d('0x9')](_0xa10d('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 27060ef..de852df 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 _0x8748=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x52ab80,_0x3878bd){var _0x3ba0bb=function(_0x362694){while(--_0x362694){_0x52ab80['push'](_0x52ab80['shift']());}};_0x3ba0bb(++_0x3878bd);}(_0x8748,0x9e));var _0x8874=function(_0x1d2323,_0x2b56f1){_0x1d2323=_0x1d2323-0x0;var _0x36cdd8=_0x8748[_0x1d2323];return _0x36cdd8;};'use strict';var _=require(_0x8874('0x0'));var util=require(_0x8874('0x1'));var moment=require(_0x8874('0x2'));var BPromise=require(_0x8874('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8874('0x4'));var db=require(_0x8874('0x5'))['db'];var utils=require(_0x8874('0x6'));var logger=require(_0x8874('0x7'))(_0x8874('0x8'));var config=require(_0x8874('0x9'));var jayson=require(_0x8874('0xa'));var client=jayson['client'][_0x8874('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b372a,_0x1f57b3,_0x482f29){return new BPromise(function(_0x548467,_0x424872){return client['request'](_0x5b372a,_0x482f29)[_0x8874('0xc')](function(_0x21b54d){logger[_0x8874('0xd')](_0x8874('0xe'),_0x1f57b3,_0x8874('0xf'));logger[_0x8874('0x10')](_0x8874('0x11'),_0x1f57b3,_0x8874('0xf'),JSON[_0x8874('0x12')](_0x21b54d));if(_0x21b54d[_0x8874('0x13')]){if(_0x21b54d[_0x8874('0x13')][_0x8874('0x14')]===0x1f4){logger[_0x8874('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f57b3,_0x21b54d[_0x8874('0x13')][_0x8874('0x15')]);return _0x424872(_0x21b54d['error'][_0x8874('0x15')]);}logger['error'](_0x8874('0xe'),_0x1f57b3,_0x21b54d[_0x8874('0x13')][_0x8874('0x15')]);return _0x548467(_0x21b54d[_0x8874('0x13')]['message']);}else{logger[_0x8874('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f57b3,_0x8874('0xf'));_0x548467(_0x21b54d[_0x8874('0x16')][_0x8874('0x15')]);}})['catch'](function(_0x1b0501){logger['error'](_0x8874('0xe'),_0x1f57b3,_0x1b0501);_0x424872(_0x1b0501);});});}
\ No newline at end of file
+var _0xa153=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0xa153,0x85));var _0x3a15=function(_0xf8bfc3,_0x29cf48){_0xf8bfc3=_0xf8bfc3-0x0;var _0x4d7a6b=_0xa153[_0xf8bfc3];return _0x4d7a6b;};'use strict';var _=require(_0x3a15('0x0'));var util=require(_0x3a15('0x1'));var moment=require(_0x3a15('0x2'));var BPromise=require(_0x3a15('0x3'));var rs=require(_0x3a15('0x4'));var fs=require('fs');var Redis=require(_0x3a15('0x5'));var db=require(_0x3a15('0x6'))['db'];var utils=require(_0x3a15('0x7'));var logger=require(_0x3a15('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3a15('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x476fb0,_0xd33b23,_0x22eaf8){return new BPromise(function(_0x35b5cc,_0x46bde5){return client['request'](_0x476fb0,_0x22eaf8)[_0x3a15('0xa')](function(_0x21eee8){logger[_0x3a15('0xb')](_0x3a15('0xc'),_0xd33b23,_0x3a15('0xd'));logger[_0x3a15('0xe')](_0x3a15('0xf'),_0xd33b23,_0x3a15('0xd'),JSON[_0x3a15('0x10')](_0x21eee8));if(_0x21eee8['error']){if(_0x21eee8[_0x3a15('0x11')][_0x3a15('0x12')]===0x1f4){logger['error'](_0x3a15('0xc'),_0xd33b23,_0x21eee8['error']['message']);return _0x46bde5(_0x21eee8[_0x3a15('0x11')]['message']);}logger['error'](_0x3a15('0xc'),_0xd33b23,_0x21eee8['error'][_0x3a15('0x13')]);return _0x35b5cc(_0x21eee8[_0x3a15('0x11')][_0x3a15('0x13')]);}else{logger['info'](_0x3a15('0xc'),_0xd33b23,_0x3a15('0xd'));_0x35b5cc(_0x21eee8[_0x3a15('0x14')][_0x3a15('0x13')]);}})[_0x3a15('0x15')](function(_0x5a8111){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0xd33b23,_0x5a8111);_0x46bde5(_0x5a8111);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index a806e7b..9538a1e 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 _0x539f=['index','/:id','show','/:id/download','post','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated'];(function(_0x270a54,_0x307ff6){var _0x4d07d0=function(_0x59ac5a){while(--_0x59ac5a){_0x270a54['push'](_0x270a54['shift']());}};_0x4d07d0(++_0x307ff6);}(_0x539f,0x100));var _0xf539=function(_0x592b77,_0x5b35f1){_0x592b77=_0x592b77-0x0;var _0x3a4849=_0x539f[_0x592b77];return _0x3a4849;};'use strict';var multer=require(_0xf539('0x0'));var util=require(_0xf539('0x1'));var path=require(_0xf539('0x2'));var timeout=require(_0xf539('0x3'));var express=require('express');var router=express[_0xf539('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf539('0x5'));var interaction=require(_0xf539('0x6'));var config=require(_0xf539('0x7'));var controller=require(_0xf539('0x8'));router['get']('/',auth[_0xf539('0x9')](),controller[_0xf539('0xa')]);router['get'](_0xf539('0xb'),auth[_0xf539('0x9')](),controller[_0xf539('0xc')]);router['get'](_0xf539('0xd'),auth[_0xf539('0x9')](),controller['download']);router[_0xf539('0xe')]('/',auth[_0xf539('0x9')](),controller['create']);router['put'](_0xf539('0xb'),auth[_0xf539('0x9')](),controller[_0xf539('0xf')]);router[_0xf539('0x10')](_0xf539('0xb'),auth['isAuthenticated'](),controller[_0xf539('0x11')]);module[_0xf539('0x12')]=router;
\ No newline at end of file
+var _0xc6e4=['../../config/environment','get','isAuthenticated','index','show','download','post','create','/:id','delete','destroy','exports','multer','path','Router','fs-extra','../../components/interaction/service'];(function(_0x2371a3,_0x84a147){var _0x41f614=function(_0x219ba7){while(--_0x219ba7){_0x2371a3['push'](_0x2371a3['shift']());}};_0x41f614(++_0x84a147);}(_0xc6e4,0x11c));var _0x4c6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc6e4[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4c6e('0x0'));var util=require('util');var path=require(_0x4c6e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4c6e('0x2')]();var fs_extra=require(_0x4c6e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4c6e('0x4'));var config=require(_0x4c6e('0x5'));var controller=require('./analyticExtractedReport.controller');router[_0x4c6e('0x6')]('/',auth[_0x4c6e('0x7')](),controller[_0x4c6e('0x8')]);router['get']('/:id',auth[_0x4c6e('0x7')](),controller[_0x4c6e('0x9')]);router[_0x4c6e('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x4c6e('0xa')]);router[_0x4c6e('0xb')]('/',auth[_0x4c6e('0x7')](),controller[_0x4c6e('0xc')]);router['put'](_0x4c6e('0xd'),auth[_0x4c6e('0x7')](),controller['update']);router[_0x4c6e('0xe')](_0x4c6e('0xd'),auth[_0x4c6e('0x7')](),controller[_0x4c6e('0xf')]);module[_0x4c6e('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 494a0e5..aa34234 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 _0x1b9b=['exports','TEXT','STRING','BOOLEAN'];(function(_0x964d16,_0x22e8b2){var _0x5af22b=function(_0x16bcb9){while(--_0x16bcb9){_0x964d16['push'](_0x964d16['shift']());}};_0x5af22b(++_0x22e8b2);}(_0x1b9b,0x1dc));var _0xb1b9=function(_0x17809c,_0xa6ceb9){_0x17809c=_0x17809c-0x0;var _0x144a29=_0x1b9b[_0x17809c];return _0x144a29;};'use strict';var Sequelize=require('sequelize');module[_0xb1b9('0x0')]={'field':{'type':Sequelize[_0xb1b9('0x1')]},'alias':{'type':Sequelize[_0xb1b9('0x2')]},'function':{'type':Sequelize[_0xb1b9('0x2')]},'format':{'type':Sequelize[_0xb1b9('0x2')]},'groupBy':{'type':Sequelize[_0xb1b9('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb1b9('0x2')]},'custom':{'type':Sequelize[_0xb1b9('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x86f2=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x5a4795,_0x7db3ad){var _0x3549d6=function(_0x2e66e9){while(--_0x2e66e9){_0x5a4795['push'](_0x5a4795['shift']());}};_0x3549d6(++_0x7db3ad);}(_0x86f2,0x76));var _0x286f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x86f2[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x286f('0x0'));module['exports']={'field':{'type':Sequelize[_0x286f('0x1')]},'alias':{'type':Sequelize[_0x286f('0x2')]},'function':{'type':Sequelize[_0x286f('0x2')]},'format':{'type':Sequelize[_0x286f('0x2')]},'groupBy':{'type':Sequelize[_0x286f('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x286f('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 403a6ea..7fe080f 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 _0xc6af=['json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','index','map','AnalyticFieldReport','fieldName','key','keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0xc6af,0x137));var _0xfc6a=function(_0x4ea38e,_0xc50e8a){_0x4ea38e=_0x4ea38e-0x0;var _0x31dc07=_0xc6af[_0x4ea38e];return _0x31dc07;};'use strict';var emlformat=require(_0xfc6a('0x0'));var rimraf=require(_0xfc6a('0x1'));var zipdir=require(_0xfc6a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc6a('0x3'));var moment=require(_0xfc6a('0x4'));var BPromise=require(_0xfc6a('0x5'));var Mustache=require(_0xfc6a('0x6'));var util=require(_0xfc6a('0x7'));var path=require(_0xfc6a('0x8'));var sox=require(_0xfc6a('0x9'));var csv=require(_0xfc6a('0xa'));var ejs=require(_0xfc6a('0xb'));var fs=require('fs');var fs_extra=require(_0xfc6a('0xc'));var _=require(_0xfc6a('0xd'));var squel=require('squel');var crypto=require(_0xfc6a('0xe'));var jsforce=require(_0xfc6a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xfc6a('0xa'));var querystring=require(_0xfc6a('0x10'));var Papa=require('papaparse');var Redis=require(_0xfc6a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfc6a('0x12'));var as=require(_0xfc6a('0x13'));var hardwareService=require(_0xfc6a('0x14'));var logger=require(_0xfc6a('0x15'))(_0xfc6a('0x16'));var utils=require(_0xfc6a('0x17'));var config=require(_0xfc6a('0x18'));var licenseUtil=require(_0xfc6a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a6321,_0x304cd4){_0x304cd4=_0x304cd4||0xcc;return function(_0x3156a5){if(_0x3156a5){return _0x2a6321[_0xfc6a('0x1a')](_0x304cd4);}return _0x2a6321[_0xfc6a('0x1b')](_0x304cd4)[_0xfc6a('0x1c')]();};}function respondWithResult(_0x39fb0a,_0x33461e){_0x33461e=_0x33461e||0xc8;return function(_0x566647){if(_0x566647){return _0x39fb0a[_0xfc6a('0x1b')](_0x33461e)[_0xfc6a('0x1d')](_0x566647);}};}function respondWithFilteredResult(_0x39d866,_0x50881b){return function(_0x433210){if(_0x433210){var _0x322eab=typeof _0x50881b[_0xfc6a('0x1e')]===_0xfc6a('0x1f')&&typeof _0x50881b[_0xfc6a('0x20')]===_0xfc6a('0x1f');var _0x4f1709=_0x433210[_0xfc6a('0x21')];var _0x2a7868=_0x322eab?0x0:_0x50881b['offset'];var _0x2dc33d=_0x322eab?_0x433210[_0xfc6a('0x21')]:_0x50881b['offset']+_0x50881b[_0xfc6a('0x20')];var _0x5d51cb;if(_0x2dc33d>=_0x4f1709){_0x2dc33d=_0x4f1709;_0x5d51cb=0xc8;}else{_0x5d51cb=0xce;}_0x39d866[_0xfc6a('0x1b')](_0x5d51cb);return _0x39d866[_0xfc6a('0x22')](_0xfc6a('0x23'),_0x2a7868+'-'+_0x2dc33d+'/'+_0x4f1709)[_0xfc6a('0x1d')](_0x433210);}return null;};}function patchUpdates(_0x142c8f){return function(_0x5938e5){try{jsonpatch['apply'](_0x5938e5,_0x142c8f,!![]);}catch(_0x7bee97){return BPromise['reject'](_0x7bee97);}return _0x5938e5[_0xfc6a('0x24')]();};}function saveUpdates(_0x3fcf99,_0x21cfdf){return function(_0x23119f){if(_0x23119f){return _0x23119f[_0xfc6a('0x25')](_0x3fcf99)[_0xfc6a('0x26')](function(_0x4d3c6a){return _0x4d3c6a;});}return null;};}function removeEntity(_0x3a3e70,_0x1ad5e9){return function(_0x5f4c1e){if(_0x5f4c1e){return _0x5f4c1e[_0xfc6a('0x27')]()[_0xfc6a('0x26')](function(){_0x3a3e70['status'](0xcc)[_0xfc6a('0x1c')]();});}};}function handleEntityNotFound(_0x8c8cde,_0x37d2a4){return function(_0x45537a){if(!_0x45537a){_0x8c8cde[_0xfc6a('0x1a')](0x194);}return _0x45537a;};}function handleError(_0x569392,_0x4ae030){_0x4ae030=_0x4ae030||0x1f4;return function(_0x40f8bc){logger[_0xfc6a('0x28')](_0x40f8bc['stack']);if(_0x40f8bc[_0xfc6a('0x29')]){delete _0x40f8bc[_0xfc6a('0x29')];}_0x569392[_0xfc6a('0x1b')](_0x4ae030)[_0xfc6a('0x2a')](_0x40f8bc);};}exports[_0xfc6a('0x2b')]=function(_0x141134,_0x7b7923){var _0x1b74c5={},_0x1a700f={},_0x3e0fa3={'count':0x0,'rows':[]};var _0x5bbda2=_[_0xfc6a('0x2c')](db[_0xfc6a('0x2d')]['rawAttributes'],function(_0x4852ec){return{'name':_0x4852ec[_0xfc6a('0x2e')],'type':_0x4852ec['type'][_0xfc6a('0x2f')]};});_0x1a700f['model']=_[_0xfc6a('0x2c')](_0x5bbda2,_0xfc6a('0x29'));_0x1a700f['query']=_[_0xfc6a('0x30')](_0x141134['query']);_0x1a700f[_0xfc6a('0x31')]=_['intersection'](_0x1a700f[_0xfc6a('0x32')],_0x1a700f[_0xfc6a('0x33')]);_0x1b74c5[_0xfc6a('0x34')]=_[_0xfc6a('0x35')](_0x1a700f['model'],qs[_0xfc6a('0x36')](_0x141134[_0xfc6a('0x33')][_0xfc6a('0x36')]));_0x1b74c5[_0xfc6a('0x34')]=_0x1b74c5[_0xfc6a('0x34')][_0xfc6a('0x37')]?_0x1b74c5[_0xfc6a('0x34')]:_0x1a700f[_0xfc6a('0x32')];if(!_0x141134[_0xfc6a('0x33')][_0xfc6a('0x38')](_0xfc6a('0x39'))){_0x1b74c5[_0xfc6a('0x20')]=qs[_0xfc6a('0x20')](_0x141134['query'][_0xfc6a('0x20')]);_0x1b74c5[_0xfc6a('0x1e')]=qs[_0xfc6a('0x1e')](_0x141134['query']['offset']);}_0x1b74c5[_0xfc6a('0x3a')]=qs[_0xfc6a('0x3b')](_0x141134[_0xfc6a('0x33')][_0xfc6a('0x3b')]);_0x1b74c5['where']=qs[_0xfc6a('0x31')](_['pick'](_0x141134[_0xfc6a('0x33')],_0x1a700f[_0xfc6a('0x31')]),_0x5bbda2);if(_0x141134[_0xfc6a('0x33')][_0xfc6a('0x3c')]){_0x1b74c5[_0xfc6a('0x3d')]=_[_0xfc6a('0x3e')](_0x1b74c5[_0xfc6a('0x3d')],{'$or':_['map'](_0x5bbda2,function(_0x5069d7){if(_0x5069d7[_0xfc6a('0x3f')]!==_0xfc6a('0x40')){var _0x3ae67e={};_0x3ae67e[_0x5069d7[_0xfc6a('0x29')]]={'$like':'%'+_0x141134[_0xfc6a('0x33')][_0xfc6a('0x3c')]+'%'};return _0x3ae67e;}})});}_0x1b74c5=_[_0xfc6a('0x3e')]({},_0x1b74c5,_0x141134[_0xfc6a('0x41')]);var _0x49910b={'where':_0x1b74c5[_0xfc6a('0x3d')]};return db[_0xfc6a('0x2d')][_0xfc6a('0x21')](_0x49910b)[_0xfc6a('0x26')](function(_0x1b1008){_0x3e0fa3[_0xfc6a('0x21')]=_0x1b1008;if(_0x141134[_0xfc6a('0x33')][_0xfc6a('0x42')]){_0x1b74c5[_0xfc6a('0x43')]=[{'all':!![]}];}return db[_0xfc6a('0x2d')][_0xfc6a('0x44')](_0x1b74c5);})[_0xfc6a('0x26')](function(_0x3c9225){_0x3e0fa3['rows']=_0x3c9225;return _0x3e0fa3;})[_0xfc6a('0x26')](respondWithFilteredResult(_0x7b7923,_0x1b74c5))[_0xfc6a('0x45')](handleError(_0x7b7923,null));};exports[_0xfc6a('0x46')]=function(_0x5c055d,_0x14004b){var _0x3c17e3={'raw':![],'where':{'id':_0x5c055d[_0xfc6a('0x47')]['id']}},_0x42f972={};_0x42f972[_0xfc6a('0x32')]=_[_0xfc6a('0x30')](db[_0xfc6a('0x2d')][_0xfc6a('0x48')]);_0x42f972['query']=_[_0xfc6a('0x30')](_0x5c055d[_0xfc6a('0x33')]);_0x42f972[_0xfc6a('0x31')]=_[_0xfc6a('0x35')](_0x42f972[_0xfc6a('0x32')],_0x42f972['query']);_0x3c17e3[_0xfc6a('0x34')]=_[_0xfc6a('0x35')](_0x42f972[_0xfc6a('0x32')],qs['fields'](_0x5c055d[_0xfc6a('0x33')][_0xfc6a('0x36')]));_0x3c17e3[_0xfc6a('0x34')]=_0x3c17e3[_0xfc6a('0x34')]['length']?_0x3c17e3['attributes']:_0x42f972[_0xfc6a('0x32')];if(_0x5c055d[_0xfc6a('0x33')][_0xfc6a('0x42')]){_0x3c17e3[_0xfc6a('0x43')]=[{'all':!![]}];}_0x3c17e3=_[_0xfc6a('0x3e')]({},_0x3c17e3,_0x5c055d[_0xfc6a('0x41')]);return db[_0xfc6a('0x2d')][_0xfc6a('0x49')](_0x3c17e3)['then'](handleEntityNotFound(_0x14004b,null))[_0xfc6a('0x26')](respondWithResult(_0x14004b,null))['catch'](handleError(_0x14004b,null));};exports['create']=function(_0x40da92,_0x19e293){return db[_0xfc6a('0x2d')][_0xfc6a('0x4a')](_0x40da92[_0xfc6a('0x4b')],{})['then'](respondWithResult(_0x19e293,0xc9))[_0xfc6a('0x45')](handleError(_0x19e293,null));};exports['bulkCreate']=function(_0x27d782,_0x5dfe5e){return db['AnalyticFieldReport'][_0xfc6a('0x4c')](_0x27d782[_0xfc6a('0x4b')],{'raw':![],'individualHooks':!![]})[_0xfc6a('0x26')](respondWithResult(_0x5dfe5e,0xc9))[_0xfc6a('0x45')](handleError(_0x5dfe5e,null));};exports[_0xfc6a('0x25')]=function(_0x13ce17,_0x52ab42){if(_0x13ce17['body']['id']){delete _0x13ce17[_0xfc6a('0x4b')]['id'];}return db[_0xfc6a('0x2d')]['find']({'where':{'id':_0x13ce17[_0xfc6a('0x47')]['id']}})[_0xfc6a('0x26')](handleEntityNotFound(_0x52ab42,null))[_0xfc6a('0x26')](saveUpdates(_0x13ce17['body'],null))[_0xfc6a('0x26')](respondWithResult(_0x52ab42,null))[_0xfc6a('0x45')](handleError(_0x52ab42,null));};exports[_0xfc6a('0x27')]=function(_0x159f9f,_0x3dff6a){return db[_0xfc6a('0x2d')][_0xfc6a('0x49')]({'where':{'id':_0x159f9f[_0xfc6a('0x47')]['id']}})[_0xfc6a('0x26')](handleEntityNotFound(_0x3dff6a,null))['then'](removeEntity(_0x3dff6a,null))[_0xfc6a('0x45')](handleError(_0x3dff6a,null));};exports[_0xfc6a('0x4d')]=function(_0x134a92,_0x31efcc){return db[_0xfc6a('0x2d')][_0xfc6a('0x27')]({'where':{'id':_0x134a92[_0xfc6a('0x33')][_0xfc6a('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xfc6a('0x26')](respondWithResult(_0x31efcc,0xcc))[_0xfc6a('0x45')](handleError(_0x31efcc,null));};exports[_0xfc6a('0x4f')]=function(_0x37ae5a,_0x5a258c,_0x68b9b4){return db[_0xfc6a('0x50')][_0xfc6a('0x51')]({'where':{'id':_0x37ae5a[_0xfc6a('0x47')]['id']}})[_0xfc6a('0x26')](handleEntityNotFound(_0x5a258c,null))['then'](function(_0x1d354c){if(_0x1d354c){return db[_0xfc6a('0x52')][_0xfc6a('0x53')](function(_0x12c002){return db['AnalyticFieldReport'][_0xfc6a('0x27')]({'where':{'CustomReportId':_0x37ae5a['params']['id']},'transaction':_0x12c002})['then'](function(_0x4de021){var _0x2dad31=_[_0xfc6a('0x2c')](_0x37ae5a[_0xfc6a('0x4b')],function(_0x5c0328){delete _0x5c0328['id'];_0x5c0328[_0xfc6a('0x54')]=_0x37ae5a[_0xfc6a('0x47')]['id'];return _0x5c0328;});return db[_0xfc6a('0x2d')][_0xfc6a('0x4c')](_0x2dad31,{'transaction':_0x12c002});});})['then'](function(){return db[_0xfc6a('0x2d')]['findAll']({'where':{'CustomReportId':_0x37ae5a[_0xfc6a('0x47')]['id']}});});}})[_0xfc6a('0x26')](respondWithResult(_0x5a258c,null))[_0xfc6a('0x45')](handleError(_0x5a258c,null));};
\ No newline at end of file
+var _0xaffb=['length','options','find','create','body','bulkCreate','bulkDestroy','ids','findOne','transaction','CustomReportId','findAll','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','status','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','params','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaffb,0x1e6));var _0xbaff=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0xaffb[_0x55d8c5];return _0x225ae5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbaff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbaff('0x1'));var moment=require(_0xbaff('0x2'));var BPromise=require(_0xbaff('0x3'));var Mustache=require(_0xbaff('0x4'));var util=require(_0xbaff('0x5'));var path=require(_0xbaff('0x6'));var sox=require(_0xbaff('0x7'));var csv=require(_0xbaff('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbaff('0x9'));var squel=require(_0xbaff('0xa'));var crypto=require(_0xbaff('0xb'));var jsforce=require(_0xbaff('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbaff('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbaff('0xd'));var authService=require(_0xbaff('0xe'));var qs=require(_0xbaff('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbaff('0x10'))(_0xbaff('0x11'));var utils=require('../../config/utils');var config=require(_0xbaff('0x12'));var licenseUtil=require(_0xbaff('0x13'));var db=require(_0xbaff('0x14'))['db'];function respondWithStatusCode(_0x574fd4,_0x12917f){_0x12917f=_0x12917f||0xcc;return function(_0x578409){if(_0x578409){return _0x574fd4[_0xbaff('0x15')](_0x12917f);}return _0x574fd4['status'](_0x12917f)[_0xbaff('0x16')]();};}function respondWithResult(_0x34420d,_0x23fb1c){_0x23fb1c=_0x23fb1c||0xc8;return function(_0x16e356){if(_0x16e356){return _0x34420d['status'](_0x23fb1c)[_0xbaff('0x17')](_0x16e356);}};}function respondWithFilteredResult(_0x30e3fa,_0x541636){return function(_0x5c4c6c){if(_0x5c4c6c){var _0x1f3506=typeof _0x541636[_0xbaff('0x18')]===_0xbaff('0x19')&&typeof _0x541636['limit']===_0xbaff('0x19');var _0x5a01e0=_0x5c4c6c[_0xbaff('0x1a')];var _0x3947e0=_0x1f3506?0x0:_0x541636[_0xbaff('0x18')];var _0x3f9258=_0x1f3506?_0x5c4c6c[_0xbaff('0x1a')]:_0x541636[_0xbaff('0x18')]+_0x541636[_0xbaff('0x1b')];var _0x5dcb6a;if(_0x3f9258>=_0x5a01e0){_0x3f9258=_0x5a01e0;_0x5dcb6a=0xc8;}else{_0x5dcb6a=0xce;}_0x30e3fa['status'](_0x5dcb6a);return _0x30e3fa[_0xbaff('0x1c')](_0xbaff('0x1d'),_0x3947e0+'-'+_0x3f9258+'/'+_0x5a01e0)[_0xbaff('0x17')](_0x5c4c6c);}return null;};}function patchUpdates(_0x4382de){return function(_0xddf46f){try{jsonpatch[_0xbaff('0x1e')](_0xddf46f,_0x4382de,!![]);}catch(_0x2df365){return BPromise[_0xbaff('0x1f')](_0x2df365);}return _0xddf46f['save']();};}function saveUpdates(_0x4009a4,_0x1fbb65){return function(_0x36b462){if(_0x36b462){return _0x36b462[_0xbaff('0x20')](_0x4009a4)[_0xbaff('0x21')](function(_0x524501){return _0x524501;});}return null;};}function removeEntity(_0x302765,_0x3598d4){return function(_0x52f1e8){if(_0x52f1e8){return _0x52f1e8[_0xbaff('0x22')]()[_0xbaff('0x21')](function(){_0x302765[_0xbaff('0x23')](0xcc)[_0xbaff('0x16')]();});}};}function handleEntityNotFound(_0x444296,_0x4cafc9){return function(_0x36d017){if(!_0x36d017){_0x444296[_0xbaff('0x15')](0x194);}return _0x36d017;};}function handleError(_0x390ce3,_0x340225){_0x340225=_0x340225||0x1f4;return function(_0x4aa8b4){logger[_0xbaff('0x24')](_0x4aa8b4[_0xbaff('0x25')]);if(_0x4aa8b4['name']){delete _0x4aa8b4[_0xbaff('0x26')];}_0x390ce3[_0xbaff('0x23')](_0x340225)[_0xbaff('0x27')](_0x4aa8b4);};}exports[_0xbaff('0x28')]=function(_0x1bd18e,_0x13c91f){var _0x5a096e={},_0x14300c={},_0x62292f={'count':0x0,'rows':[]};var _0x5b6f01=_['map'](db[_0xbaff('0x29')][_0xbaff('0x2a')],function(_0x48d2d1){return{'name':_0x48d2d1[_0xbaff('0x2b')],'type':_0x48d2d1[_0xbaff('0x2c')][_0xbaff('0x2d')]};});_0x14300c[_0xbaff('0x2e')]=_[_0xbaff('0x2f')](_0x5b6f01,_0xbaff('0x26'));_0x14300c[_0xbaff('0x30')]=_[_0xbaff('0x31')](_0x1bd18e[_0xbaff('0x30')]);_0x14300c[_0xbaff('0x32')]=_[_0xbaff('0x33')](_0x14300c['model'],_0x14300c[_0xbaff('0x30')]);_0x5a096e[_0xbaff('0x34')]=_[_0xbaff('0x33')](_0x14300c[_0xbaff('0x2e')],qs['fields'](_0x1bd18e['query']['fields']));_0x5a096e[_0xbaff('0x34')]=_0x5a096e[_0xbaff('0x34')]['length']?_0x5a096e['attributes']:_0x14300c[_0xbaff('0x2e')];if(!_0x1bd18e[_0xbaff('0x30')][_0xbaff('0x35')]('nolimit')){_0x5a096e[_0xbaff('0x1b')]=qs[_0xbaff('0x1b')](_0x1bd18e[_0xbaff('0x30')][_0xbaff('0x1b')]);_0x5a096e[_0xbaff('0x18')]=qs[_0xbaff('0x18')](_0x1bd18e[_0xbaff('0x30')][_0xbaff('0x18')]);}_0x5a096e[_0xbaff('0x36')]=qs[_0xbaff('0x37')](_0x1bd18e[_0xbaff('0x30')][_0xbaff('0x37')]);_0x5a096e['where']=qs['filters'](_[_0xbaff('0x38')](_0x1bd18e[_0xbaff('0x30')],_0x14300c[_0xbaff('0x32')]),_0x5b6f01);if(_0x1bd18e['query'][_0xbaff('0x39')]){_0x5a096e[_0xbaff('0x3a')]=_[_0xbaff('0x3b')](_0x5a096e['where'],{'$or':_[_0xbaff('0x2f')](_0x5b6f01,function(_0x35f980){if(_0x35f980['type']!==_0xbaff('0x3c')){var _0x114fe5={};_0x114fe5[_0x35f980[_0xbaff('0x26')]]={'$like':'%'+_0x1bd18e[_0xbaff('0x30')][_0xbaff('0x39')]+'%'};return _0x114fe5;}})});}_0x5a096e=_[_0xbaff('0x3b')]({},_0x5a096e,_0x1bd18e['options']);var _0x18c543={'where':_0x5a096e[_0xbaff('0x3a')]};return db[_0xbaff('0x29')][_0xbaff('0x1a')](_0x18c543)['then'](function(_0x40c6c7){_0x62292f[_0xbaff('0x1a')]=_0x40c6c7;if(_0x1bd18e[_0xbaff('0x30')][_0xbaff('0x3d')]){_0x5a096e[_0xbaff('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x5a096e);})[_0xbaff('0x21')](function(_0x4c8604){_0x62292f[_0xbaff('0x3f')]=_0x4c8604;return _0x62292f;})[_0xbaff('0x21')](respondWithFilteredResult(_0x13c91f,_0x5a096e))[_0xbaff('0x40')](handleError(_0x13c91f,null));};exports['show']=function(_0x2a7159,_0x2c24ef){var _0x183b9c={'raw':![],'where':{'id':_0x2a7159[_0xbaff('0x41')]['id']}},_0x25262a={};_0x25262a[_0xbaff('0x2e')]=_[_0xbaff('0x31')](db[_0xbaff('0x29')][_0xbaff('0x2a')]);_0x25262a['query']=_['keys'](_0x2a7159['query']);_0x25262a[_0xbaff('0x32')]=_[_0xbaff('0x33')](_0x25262a[_0xbaff('0x2e')],_0x25262a[_0xbaff('0x30')]);_0x183b9c[_0xbaff('0x34')]=_[_0xbaff('0x33')](_0x25262a[_0xbaff('0x2e')],qs['fields'](_0x2a7159[_0xbaff('0x30')][_0xbaff('0x42')]));_0x183b9c['attributes']=_0x183b9c[_0xbaff('0x34')][_0xbaff('0x43')]?_0x183b9c[_0xbaff('0x34')]:_0x25262a['model'];if(_0x2a7159[_0xbaff('0x30')]['includeAll']){_0x183b9c[_0xbaff('0x3e')]=[{'all':!![]}];}_0x183b9c=_['merge']({},_0x183b9c,_0x2a7159[_0xbaff('0x44')]);return db['AnalyticFieldReport'][_0xbaff('0x45')](_0x183b9c)[_0xbaff('0x21')](handleEntityNotFound(_0x2c24ef,null))[_0xbaff('0x21')](respondWithResult(_0x2c24ef,null))[_0xbaff('0x40')](handleError(_0x2c24ef,null));};exports[_0xbaff('0x46')]=function(_0x3fb500,_0x56d08d){return db[_0xbaff('0x29')][_0xbaff('0x46')](_0x3fb500[_0xbaff('0x47')],{})[_0xbaff('0x21')](respondWithResult(_0x56d08d,0xc9))[_0xbaff('0x40')](handleError(_0x56d08d,null));};exports[_0xbaff('0x48')]=function(_0x14c4ac,_0x52bacf){return db[_0xbaff('0x29')][_0xbaff('0x48')](_0x14c4ac[_0xbaff('0x47')],{'raw':![],'individualHooks':!![]})[_0xbaff('0x21')](respondWithResult(_0x52bacf,0xc9))['catch'](handleError(_0x52bacf,null));};exports[_0xbaff('0x20')]=function(_0x980c31,_0x93936c){if(_0x980c31[_0xbaff('0x47')]['id']){delete _0x980c31[_0xbaff('0x47')]['id'];}return db[_0xbaff('0x29')][_0xbaff('0x45')]({'where':{'id':_0x980c31[_0xbaff('0x41')]['id']}})[_0xbaff('0x21')](handleEntityNotFound(_0x93936c,null))['then'](saveUpdates(_0x980c31[_0xbaff('0x47')],null))[_0xbaff('0x21')](respondWithResult(_0x93936c,null))[_0xbaff('0x40')](handleError(_0x93936c,null));};exports[_0xbaff('0x22')]=function(_0x327c53,_0x54bd9f){return db[_0xbaff('0x29')][_0xbaff('0x45')]({'where':{'id':_0x327c53[_0xbaff('0x41')]['id']}})['then'](handleEntityNotFound(_0x54bd9f,null))[_0xbaff('0x21')](removeEntity(_0x54bd9f,null))[_0xbaff('0x40')](handleError(_0x54bd9f,null));};exports[_0xbaff('0x49')]=function(_0x660c88,_0x53b3e3){return db[_0xbaff('0x29')][_0xbaff('0x22')]({'where':{'id':_0x660c88[_0xbaff('0x30')][_0xbaff('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xbaff('0x21')](respondWithResult(_0x53b3e3,0xcc))[_0xbaff('0x40')](handleError(_0x53b3e3,null));};exports['addFields']=function(_0x24ac62,_0x94618a,_0xbd3a69){return db['AnalyticCustomReport'][_0xbaff('0x4b')]({'where':{'id':_0x24ac62[_0xbaff('0x41')]['id']}})[_0xbaff('0x21')](handleEntityNotFound(_0x94618a,null))[_0xbaff('0x21')](function(_0x4542ba){if(_0x4542ba){return db['sequelize'][_0xbaff('0x4c')](function(_0x4c3771){return db[_0xbaff('0x29')]['destroy']({'where':{'CustomReportId':_0x24ac62[_0xbaff('0x41')]['id']},'transaction':_0x4c3771})[_0xbaff('0x21')](function(_0x14b8c7){var _0x40f159=_[_0xbaff('0x2f')](_0x24ac62[_0xbaff('0x47')],function(_0x197f48){delete _0x197f48['id'];_0x197f48[_0xbaff('0x4d')]=_0x24ac62[_0xbaff('0x41')]['id'];return _0x197f48;});return db[_0xbaff('0x29')][_0xbaff('0x48')](_0x40f159,{'transaction':_0x4c3771});});})[_0xbaff('0x21')](function(){return db['AnalyticFieldReport'][_0xbaff('0x4e')]({'where':{'CustomReportId':_0x24ac62[_0xbaff('0x41')]['id']}});});}})['then'](respondWithResult(_0x94618a,null))['catch'](handleError(_0x94618a,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 5fbb89e..4e35902 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 _0xb0cb=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','define'];(function(_0x253b7b,_0x5f4bf9){var _0xab484=function(_0x12ef6f){while(--_0x12ef6f){_0x253b7b['push'](_0x253b7b['shift']());}};_0xab484(++_0x5f4bf9);}(_0xb0cb,0x17b));var _0xbb0c=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xb0cb[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0xbb0c('0x0'));var util=require(_0xbb0c('0x1'));var logger=require(_0xbb0c('0x2'))(_0xbb0c('0x3'));var moment=require(_0xbb0c('0x4'));var BPromise=require(_0xbb0c('0x5'));var rp=require(_0xbb0c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb0c('0x7'));var config=require(_0xbb0c('0x8'));var attributes=require(_0xbb0c('0x9'));module['exports']=function(_0x1a19f0,_0x49bc9f){return _0x1a19f0[_0xbb0c('0xa')](_0xbb0c('0xb'),attributes,{'tableName':_0xbb0c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc9dc=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define'];(function(_0x3ec744,_0x340800){var _0x239fba=function(_0x256f79){while(--_0x256f79){_0x3ec744['push'](_0x3ec744['shift']());}};_0x239fba(++_0x340800);}(_0xc9dc,0xda));var _0xcc9d=function(_0x5e8ba5,_0x40e58d){_0x5e8ba5=_0x5e8ba5-0x0;var _0x420ab4=_0xc9dc[_0x5e8ba5];return _0x420ab4;};'use strict';var _=require(_0xcc9d('0x0'));var util=require(_0xcc9d('0x1'));var logger=require(_0xcc9d('0x2'))(_0xcc9d('0x3'));var moment=require(_0xcc9d('0x4'));var BPromise=require(_0xcc9d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc9d('0x6'));var rimraf=require('rimraf');var config=require(_0xcc9d('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0xcc9d('0x8')]=function(_0x480968,_0xbaf26b){return _0x480968[_0xcc9d('0x9')](_0xcc9d('0xa'),attributes,{'tableName':_0xcc9d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 580cb3e..7405631 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 _0x374e=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x374e,0xba));var _0xe374=function(_0x1f2e32,_0x5eb322){_0x1f2e32=_0x1f2e32-0x0;var _0x4e0b6d=_0x374e[_0x1f2e32];return _0x4e0b6d;};'use strict';var _=require(_0xe374('0x0'));var util=require('util');var moment=require(_0xe374('0x1'));var BPromise=require(_0xe374('0x2'));var rs=require(_0xe374('0x3'));var fs=require('fs');var Redis=require(_0xe374('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe374('0x5'));var logger=require(_0xe374('0x6'))('rpc');var config=require(_0xe374('0x7'));var jayson=require(_0xe374('0x8'));var client=jayson[_0xe374('0x9')][_0xe374('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x227423,_0x3b9afd,_0x39fea0){return new BPromise(function(_0x37922a,_0x4f31e3){return client[_0xe374('0xb')](_0x227423,_0x39fea0)[_0xe374('0xc')](function(_0x3da1d1){logger[_0xe374('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3b9afd,'request\x20sent');logger[_0xe374('0xe')](_0xe374('0xf'),_0x3b9afd,_0xe374('0x10'),JSON[_0xe374('0x11')](_0x3da1d1));if(_0x3da1d1[_0xe374('0x12')]){if(_0x3da1d1[_0xe374('0x12')][_0xe374('0x13')]===0x1f4){logger[_0xe374('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3b9afd,_0x3da1d1[_0xe374('0x12')]['message']);return _0x4f31e3(_0x3da1d1[_0xe374('0x12')][_0xe374('0x14')]);}logger[_0xe374('0x12')](_0xe374('0x15'),_0x3b9afd,_0x3da1d1['error'][_0xe374('0x14')]);return _0x37922a(_0x3da1d1['error'][_0xe374('0x14')]);}else{logger[_0xe374('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3b9afd,_0xe374('0x10'));_0x37922a(_0x3da1d1[_0xe374('0x16')]['message']);}})[_0xe374('0x17')](function(_0x58ddc4){logger[_0xe374('0x12')](_0xe374('0x15'),_0x3b9afd,_0x58ddc4);_0x4f31e3(_0x58ddc4);});});}
\ No newline at end of file
+var _0x25d5=['../../mysqldb','../../config/utils','../../config/logger','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x2921a8,_0x30e287){var _0xc8ff65=function(_0x469ac0){while(--_0x469ac0){_0x2921a8['push'](_0x2921a8['shift']());}};_0xc8ff65(++_0x30e287);}(_0x25d5,0x165));var _0x525d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x525d('0x0'));var moment=require('moment');var BPromise=require(_0x525d('0x1'));var rs=require(_0x525d('0x2'));var fs=require('fs');var Redis=require(_0x525d('0x3'));var db=require(_0x525d('0x4'))['db'];var utils=require(_0x525d('0x5'));var logger=require(_0x525d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x525d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x17bb4d,_0x2bd3e4,_0x4021c7){return new BPromise(function(_0x56c076,_0x8210c3){return client[_0x525d('0x8')](_0x17bb4d,_0x4021c7)[_0x525d('0x9')](function(_0x439b18){logger[_0x525d('0xa')](_0x525d('0xb'),_0x2bd3e4,_0x525d('0xc'));logger['debug'](_0x525d('0xd'),_0x2bd3e4,_0x525d('0xc'),JSON[_0x525d('0xe')](_0x439b18));if(_0x439b18[_0x525d('0xf')]){if(_0x439b18['error']['code']===0x1f4){logger[_0x525d('0xf')](_0x525d('0xb'),_0x2bd3e4,_0x439b18['error'][_0x525d('0x10')]);return _0x8210c3(_0x439b18[_0x525d('0xf')][_0x525d('0x10')]);}logger[_0x525d('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2bd3e4,_0x439b18[_0x525d('0xf')][_0x525d('0x10')]);return _0x56c076(_0x439b18[_0x525d('0xf')][_0x525d('0x10')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x2bd3e4,_0x525d('0xc'));_0x56c076(_0x439b18[_0x525d('0x11')][_0x525d('0x10')]);}})[_0x525d('0x12')](function(_0x3844f3){logger[_0x525d('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2bd3e4,_0x3844f3);_0x8210c3(_0x3844f3);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 17bc258..2b2907f 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(_0x1d638b,_0x52dd72){var _0x492ad9=function(_0x4ae4d7){while(--_0x4ae4d7){_0x1d638b['push'](_0x1d638b['shift']());}};_0x492ad9(++_0x52dd72);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x3c9010,_0x970251){var _0x373e8a=function(_0x3a8a9e){while(--_0x3a8a9e){_0x3c9010['push'](_0x3c9010['shift']());}};_0x373e8a(++_0x970251);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 7e17130..c8b6b78 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 _0xede3=['exports','name','STRING','TEXT'];(function(_0xdba210,_0x17d434){var _0x5c7712=function(_0x36ad83){while(--_0x36ad83){_0xdba210['push'](_0xdba210['shift']());}};_0x5c7712(++_0x17d434);}(_0xede3,0xc0));var _0x3ede=function(_0x1f1ea6,_0x51eb08){_0x1f1ea6=_0x1f1ea6-0x0;var _0x4ead57=_0xede3[_0x1f1ea6];return _0x4ead57;};'use strict';var Sequelize=require('sequelize');module[_0x3ede('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3ede('0x1')},'table':{'type':Sequelize[_0x3ede('0x2')]},'metric':{'type':Sequelize[_0x3ede('0x3')]},'description':{'type':Sequelize[_0x3ede('0x2')]}};
\ No newline at end of file
+var _0x0c1a=['exports','STRING','TEXT','sequelize'];(function(_0x18412f,_0x441675){var _0x130b9d=function(_0x4a3aff){while(--_0x4a3aff){_0x18412f['push'](_0x18412f['shift']());}};_0x130b9d(++_0x441675);}(_0x0c1a,0x127));var _0xa0c1=function(_0xb496cf,_0x45e1fa){_0xb496cf=_0xb496cf-0x0;var _0x769aac=_0x0c1a[_0xb496cf];return _0x769aac;};'use strict';var Sequelize=require(_0xa0c1('0x0'));module[_0xa0c1('0x1')]={'name':{'type':Sequelize[_0xa0c1('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xa0c1('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 4ca3d27..7d53070 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 _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x6c1057,_0x1e35a6){var _0x515a94=function(_0x355b51){while(--_0x355b51){_0x6c1057['push'](_0x6c1057['shift']());}};_0x515a94(++_0x1e35a6);}(_0x98a8,0x12c));var _0x898a=function(_0xf84bc9,_0x27d951){_0xf84bc9=_0xf84bc9-0x0;var _0x55fc35=_0x98a8[_0xf84bc9];return _0x55fc35;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));};
\ No newline at end of file
+var _0x84ab=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','map','AnalyticMetric','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','include','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x448f8,_0x2aa1d7){var _0xa73126=function(_0x1fcafa){while(--_0x1fcafa){_0x448f8['push'](_0x448f8['shift']());}};_0xa73126(++_0x2aa1d7);}(_0x84ab,0x12f));var _0xb84a=function(_0x77d310,_0x2b2fe7){_0x77d310=_0x77d310-0x0;var _0x2cdce4=_0x84ab[_0x77d310];return _0x2cdce4;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];function respondWithStatusCode(_0x4d3758,_0x83444e){_0x83444e=_0x83444e||0xcc;return function(_0x4777dc){if(_0x4777dc){return _0x4d3758[_0xb84a('0x16')](_0x83444e);}return _0x4d3758[_0xb84a('0x17')](_0x83444e)[_0xb84a('0x18')]();};}function respondWithResult(_0x11dfe9,_0x12ccab){_0x12ccab=_0x12ccab||0xc8;return function(_0x475b){if(_0x475b){return _0x11dfe9[_0xb84a('0x17')](_0x12ccab)[_0xb84a('0x19')](_0x475b);}};}function respondWithFilteredResult(_0xc0b2e0,_0x1251ec){return function(_0x5716bd){if(_0x5716bd){var _0x11dd4d=typeof _0x1251ec[_0xb84a('0x1a')]===_0xb84a('0x1b')&&typeof _0x1251ec[_0xb84a('0x1c')]===_0xb84a('0x1b');var _0x1be87a=_0x5716bd[_0xb84a('0x1d')];var _0x34d82f=_0x11dd4d?0x0:_0x1251ec[_0xb84a('0x1a')];var _0x3f7437=_0x11dd4d?_0x5716bd[_0xb84a('0x1d')]:_0x1251ec[_0xb84a('0x1a')]+_0x1251ec[_0xb84a('0x1c')];var _0x200289;if(_0x3f7437>=_0x1be87a){_0x3f7437=_0x1be87a;_0x200289=0xc8;}else{_0x200289=0xce;}_0xc0b2e0['status'](_0x200289);return _0xc0b2e0[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x34d82f+'-'+_0x3f7437+'/'+_0x1be87a)['json'](_0x5716bd);}return null;};}function patchUpdates(_0xac76d3){return function(_0x61ef03){try{jsonpatch[_0xb84a('0x20')](_0x61ef03,_0xac76d3,!![]);}catch(_0x19f637){return BPromise['reject'](_0x19f637);}return _0x61ef03['save']();};}function saveUpdates(_0x1466ae,_0x19097d){return function(_0x2d70fd){if(_0x2d70fd){return _0x2d70fd[_0xb84a('0x21')](_0x1466ae)[_0xb84a('0x22')](function(_0x3b8fb2){return _0x3b8fb2;});}return null;};}function removeEntity(_0x8b28cd,_0x21d0d3){return function(_0x3aa06f){if(_0x3aa06f){return _0x3aa06f[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){var _0x1aab7d=_0x3aa06f[_0xb84a('0x24')]({'plain':!![]});var _0x409df0=_0xb84a('0x25');return db[_0xb84a('0x26')][_0xb84a('0x23')]({'where':{'type':_0x409df0,'resourceId':_0x1aab7d['id']}})[_0xb84a('0x22')](function(){return _0x3aa06f;});})[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x1db72c,_0x2fe40d){return function(_0x35d1f7){if(!_0x35d1f7){_0x1db72c[_0xb84a('0x16')](0x194);}return _0x35d1f7;};}function handleError(_0x97d71b,_0x5349ea){_0x5349ea=_0x5349ea||0x1f4;return function(_0x582954){logger[_0xb84a('0x27')](_0x582954[_0xb84a('0x28')]);if(_0x582954['name']){delete _0x582954[_0xb84a('0x29')];}_0x97d71b[_0xb84a('0x17')](_0x5349ea)['send'](_0x582954);};}exports['index']=function(_0x28f2e7,_0x8e9319){var _0x49ba3d={},_0x251778={},_0xba1147={'count':0x0,'rows':[]};var _0x3abc22=_[_0xb84a('0x2a')](db[_0xb84a('0x2b')][_0xb84a('0x2c')],function(_0x34b212){return{'name':_0x34b212[_0xb84a('0x2d')],'type':_0x34b212['type'][_0xb84a('0x2e')]};});_0x251778['model']=_['map'](_0x3abc22,_0xb84a('0x29'));_0x251778[_0xb84a('0x2f')]=_['keys'](_0x28f2e7['query']);_0x251778[_0xb84a('0x30')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],_0x251778[_0xb84a('0x2f')]);_0x49ba3d[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],qs[_0xb84a('0x34')](_0x28f2e7['query'][_0xb84a('0x34')]));_0x49ba3d[_0xb84a('0x33')]=_0x49ba3d[_0xb84a('0x33')][_0xb84a('0x35')]?_0x49ba3d[_0xb84a('0x33')]:_0x251778[_0xb84a('0x32')];if(!_0x28f2e7[_0xb84a('0x2f')]['hasOwnProperty'](_0xb84a('0x36'))){_0x49ba3d['limit']=qs[_0xb84a('0x1c')](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x49ba3d['offset']=qs['offset'](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1a')]);}_0x49ba3d[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_0x28f2e7[_0xb84a('0x2f')]['sort']);_0x49ba3d[_0xb84a('0x39')]=qs[_0xb84a('0x30')](_['pick'](_0x28f2e7[_0xb84a('0x2f')],_0x251778[_0xb84a('0x30')]),_0x3abc22);if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3a')]){_0x49ba3d['where']=_['merge'](_0x49ba3d['where'],{'$or':_[_0xb84a('0x2a')](_0x3abc22,function(_0x11e1ac){if(_0x11e1ac[_0xb84a('0x3b')]!==_0xb84a('0x3c')){var _0x55b0b8={};_0x55b0b8[_0x11e1ac[_0xb84a('0x29')]]={'$like':'%'+_0x28f2e7['query'][_0xb84a('0x3a')]+'%'};return _0x55b0b8;}})});}_0x49ba3d=_['merge']({},_0x49ba3d,_0x28f2e7['options']);var _0x59d7a1={'where':_0x49ba3d[_0xb84a('0x39')]};return db[_0xb84a('0x2b')][_0xb84a('0x1d')](_0x59d7a1)[_0xb84a('0x22')](function(_0x5e547e){_0xba1147[_0xb84a('0x1d')]=_0x5e547e;if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x49ba3d[_0xb84a('0x3e')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x49ba3d);})[_0xb84a('0x22')](function(_0x1f3e04){_0xba1147['rows']=_0x1f3e04;return _0xba1147;})[_0xb84a('0x22')](respondWithFilteredResult(_0x8e9319,_0x49ba3d))[_0xb84a('0x3f')](handleError(_0x8e9319,null));};exports[_0xb84a('0x40')]=function(_0x25280a,_0x3f005b){var _0x241536={'raw':!![],'where':{'id':_0x25280a[_0xb84a('0x41')]['id']}},_0x24d700={};_0x24d700[_0xb84a('0x32')]=_[_0xb84a('0x42')](db[_0xb84a('0x2b')][_0xb84a('0x2c')]);_0x24d700[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x25280a[_0xb84a('0x2f')]);_0x24d700['filters']=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],_0x24d700[_0xb84a('0x2f')]);_0x241536[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],qs['fields'](_0x25280a[_0xb84a('0x2f')]['fields']));_0x241536[_0xb84a('0x33')]=_0x241536[_0xb84a('0x33')][_0xb84a('0x35')]?_0x241536[_0xb84a('0x33')]:_0x24d700['model'];if(_0x25280a[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x241536[_0xb84a('0x3e')]=[{'all':!![]}];}_0x241536=_['merge']({},_0x241536,_0x25280a['options']);return db[_0xb84a('0x2b')][_0xb84a('0x43')](_0x241536)[_0xb84a('0x22')](handleEntityNotFound(_0x3f005b,null))['then'](respondWithResult(_0x3f005b,null))['catch'](handleError(_0x3f005b,null));};exports['create']=function(_0x45630d,_0x384a0d){return db[_0xb84a('0x2b')][_0xb84a('0x44')](_0x45630d[_0xb84a('0x45')],{})['then'](function(_0x4b40fe){var _0x5b853a=_0x45630d['user'][_0xb84a('0x24')]({'plain':!![]});if(!_0x5b853a)throw new Error(_0xb84a('0x46'));if(_0x5b853a['role']===_0xb84a('0x47')){var _0xc8bac2=_0x4b40fe[_0xb84a('0x24')]({'plain':!![]});var _0x2f70f0=_0xb84a('0x25');return db[_0xb84a('0x48')]['find']({'where':{'name':_0x2f70f0,'userProfileId':_0x5b853a['userProfileId']},'raw':!![]})[_0xb84a('0x22')](function(_0x50172a){if(_0x50172a&&_0x50172a[_0xb84a('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0xc8bac2['name'],'resourceId':_0xc8bac2['id'],'type':_0x50172a[_0xb84a('0x29')],'sectionId':_0x50172a['id']},{})[_0xb84a('0x22')](function(){return _0x4b40fe;});}else{return _0x4b40fe;}})[_0xb84a('0x3f')](function(_0x25b6a0){logger[_0xb84a('0x27')](_0xb84a('0x4a'),_0x25b6a0);throw _0x25b6a0;});}return _0x4b40fe;})[_0xb84a('0x22')](respondWithResult(_0x384a0d,0xc9))[_0xb84a('0x3f')](handleError(_0x384a0d,null));};exports['update']=function(_0x5afdd0,_0x4c5bdf){if(_0x5afdd0[_0xb84a('0x45')]['id']){delete _0x5afdd0[_0xb84a('0x45')]['id'];}return db['AnalyticMetric'][_0xb84a('0x43')]({'where':{'id':_0x5afdd0['params']['id']}})['then'](handleEntityNotFound(_0x4c5bdf,null))['then'](saveUpdates(_0x5afdd0[_0xb84a('0x45')],null))[_0xb84a('0x22')](respondWithResult(_0x4c5bdf,null))[_0xb84a('0x3f')](handleError(_0x4c5bdf,null));};exports['destroy']=function(_0x5f757e,_0x2e98bf){return db[_0xb84a('0x2b')]['find']({'where':{'id':_0x5f757e[_0xb84a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e98bf,null))['then'](removeEntity(_0x2e98bf,null))[_0xb84a('0x3f')](handleError(_0x2e98bf,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 6c84d39..fe0680c 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 _0xdfa0=['path','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x214ec2,_0x3a437b){var _0x18b531=function(_0x48234f){while(--_0x48234f){_0x214ec2['push'](_0x214ec2['shift']());}};_0x18b531(++_0x3a437b);}(_0xdfa0,0x69));var _0x0dfa=function(_0x2761f8,_0x54996e){_0x2761f8=_0x2761f8-0x0;var _0x33f750=_0xdfa0[_0x2761f8];return _0x33f750;};'use strict';var _=require(_0x0dfa('0x0'));var util=require('util');var logger=require(_0x0dfa('0x1'))(_0x0dfa('0x2'));var moment=require('moment');var BPromise=require(_0x0dfa('0x3'));var rp=require(_0x0dfa('0x4'));var fs=require('fs');var path=require(_0x0dfa('0x5'));var rimraf=require('rimraf');var config=require(_0x0dfa('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x0dfa('0x7')]=function(_0x2efe20,_0x4830b6){return _0x2efe20[_0x0dfa('0x8')](_0x0dfa('0x9'),attributes,{'tableName':_0x0dfa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae30=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xc153db,_0x516c10){var _0x4dc97d=function(_0x10fc05){while(--_0x10fc05){_0xc153db['push'](_0xc153db['shift']());}};_0x4dc97d(++_0x516c10);}(_0xae30,0x10a));var _0x0ae3=function(_0x40c9bc,_0x6eb340){_0x40c9bc=_0x40c9bc-0x0;var _0x3acedf=_0xae30[_0x40c9bc];return _0x3acedf;};'use strict';var _=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var logger=require(_0x0ae3('0x2'))('api');var moment=require(_0x0ae3('0x3'));var BPromise=require(_0x0ae3('0x4'));var rp=require(_0x0ae3('0x5'));var fs=require('fs');var path=require(_0x0ae3('0x6'));var rimraf=require('rimraf');var config=require(_0x0ae3('0x7'));var attributes=require(_0x0ae3('0x8'));module[_0x0ae3('0x9')]=function(_0x7ce33e,_0x2b8c53){return _0x7ce33e[_0x0ae3('0xa')](_0x0ae3('0xb'),attributes,{'tableName':_0x0ae3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index f434bec..e3d0de5 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 _0xff84=['rpc','../../config/environment','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x26d720,_0x25c8eb){var _0x37fcc1=function(_0x40b59e){while(--_0x40b59e){_0x26d720['push'](_0x26d720['shift']());}};_0x37fcc1(++_0x25c8eb);}(_0xff84,0x120));var _0x4ff8=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xff84[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x4ff8('0x0'));var moment=require(_0x4ff8('0x1'));var BPromise=require(_0x4ff8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ff8('0x3'));var db=require(_0x4ff8('0x4'))['db'];var utils=require(_0x4ff8('0x5'));var logger=require('../../config/logger')(_0x4ff8('0x6'));var config=require(_0x4ff8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4ff8('0x8')][_0x4ff8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cabe5,_0x2effc6,_0x811f5f){return new BPromise(function(_0x11a6db,_0x4bb5ef){return client['request'](_0x5cabe5,_0x811f5f)[_0x4ff8('0xa')](function(_0x3037c7){logger[_0x4ff8('0xb')](_0x4ff8('0xc'),_0x2effc6,_0x4ff8('0xd'));logger['debug'](_0x4ff8('0xe'),_0x2effc6,'request\x20sent',JSON[_0x4ff8('0xf')](_0x3037c7));if(_0x3037c7['error']){if(_0x3037c7[_0x4ff8('0x10')][_0x4ff8('0x11')]===0x1f4){logger[_0x4ff8('0x10')](_0x4ff8('0xc'),_0x2effc6,_0x3037c7['error']['message']);return _0x4bb5ef(_0x3037c7[_0x4ff8('0x10')][_0x4ff8('0x12')]);}logger[_0x4ff8('0x10')](_0x4ff8('0xc'),_0x2effc6,_0x3037c7[_0x4ff8('0x10')][_0x4ff8('0x12')]);return _0x11a6db(_0x3037c7[_0x4ff8('0x10')]['message']);}else{logger[_0x4ff8('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x2effc6,_0x4ff8('0xd'));_0x11a6db(_0x3037c7[_0x4ff8('0x13')]['message']);}})[_0x4ff8('0x14')](function(_0x2843b3){logger[_0x4ff8('0x10')](_0x4ff8('0xc'),_0x2effc6,_0x2843b3);_0x4bb5ef(_0x2843b3);});});}
\ No newline at end of file
+var _0x0849=['error','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code'];(function(_0x59f0dc,_0x1e2497){var _0x5b5445=function(_0x57ca91){while(--_0x57ca91){_0x59f0dc['push'](_0x59f0dc['shift']());}};_0x5b5445(++_0x1e2497);}(_0x0849,0x1bc));var _0x9084=function(_0xf090bb,_0x4b4d9f){_0xf090bb=_0xf090bb-0x0;var _0x4a57f5=_0x0849[_0xf090bb];return _0x4a57f5;};'use strict';var _=require('lodash');var util=require(_0x9084('0x0'));var moment=require('moment');var BPromise=require(_0x9084('0x1'));var rs=require(_0x9084('0x2'));var fs=require('fs');var Redis=require(_0x9084('0x3'));var db=require(_0x9084('0x4'))['db'];var utils=require(_0x9084('0x5'));var logger=require(_0x9084('0x6'))(_0x9084('0x7'));var config=require('../../config/environment');var jayson=require(_0x9084('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42c3c2,_0x5f1321,_0x1e506d){return new BPromise(function(_0x179906,_0x461599){return client[_0x9084('0x9')](_0x42c3c2,_0x1e506d)[_0x9084('0xa')](function(_0x35753a){logger[_0x9084('0xb')](_0x9084('0xc'),_0x5f1321,'request\x20sent');logger[_0x9084('0xd')](_0x9084('0xe'),_0x5f1321,_0x9084('0xf'),JSON[_0x9084('0x10')](_0x35753a));if(_0x35753a['error']){if(_0x35753a['error'][_0x9084('0x11')]===0x1f4){logger[_0x9084('0x12')](_0x9084('0xc'),_0x5f1321,_0x35753a[_0x9084('0x12')][_0x9084('0x13')]);return _0x461599(_0x35753a[_0x9084('0x12')][_0x9084('0x13')]);}logger[_0x9084('0x12')](_0x9084('0xc'),_0x5f1321,_0x35753a[_0x9084('0x12')][_0x9084('0x13')]);return _0x179906(_0x35753a[_0x9084('0x12')][_0x9084('0x13')]);}else{logger[_0x9084('0xb')](_0x9084('0xc'),_0x5f1321,_0x9084('0xf'));_0x179906(_0x35753a[_0x9084('0x14')][_0x9084('0x13')]);}})['catch'](function(_0x3e2c10){logger[_0x9084('0x12')](_0x9084('0xc'),_0x5f1321,_0x3e2c10);_0x461599(_0x3e2c10);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 7ff0441..b993540 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 _0x37a7=['util','Router','fs-extra','./analyticMetric.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer'];(function(_0x2de753,_0x4a544d){var _0x8e70a5=function(_0x498455){while(--_0x498455){_0x2de753['push'](_0x2de753['shift']());}};_0x8e70a5(++_0x4a544d);}(_0x37a7,0x6f));var _0x737a=function(_0x4cf382,_0x1533d4){_0x4cf382=_0x4cf382-0x0;var _0x1fed91=_0x37a7[_0x4cf382];return _0x1fed91;};'use strict';var multer=require(_0x737a('0x0'));var util=require(_0x737a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x737a('0x2')]();var fs_extra=require(_0x737a('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x737a('0x4'));router[_0x737a('0x5')]('/',auth[_0x737a('0x6')](),controller[_0x737a('0x7')]);router[_0x737a('0x5')]('/:id',auth[_0x737a('0x6')](),controller[_0x737a('0x8')]);router[_0x737a('0x9')]('/',auth[_0x737a('0x6')](),controller['create']);router[_0x737a('0xa')](_0x737a('0xb'),auth['isAuthenticated'](),controller[_0x737a('0xc')]);router[_0x737a('0xd')](_0x737a('0xb'),auth[_0x737a('0x6')](),controller[_0x737a('0xe')]);module[_0x737a('0xf')]=router;
\ No newline at end of file
+var _0x5785=['../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x16a637,_0x5eb627){var _0x25126d=function(_0x54e016){while(--_0x54e016){_0x16a637['push'](_0x16a637['shift']());}};_0x25126d(++_0x5eb627);}(_0x5785,0x119));var _0x5578=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x5785[_0x468b0f];return _0x3e74d9;};'use strict';var multer=require(_0x5578('0x0'));var util=require(_0x5578('0x1'));var path=require(_0x5578('0x2'));var timeout=require(_0x5578('0x3'));var express=require(_0x5578('0x4'));var router=express['Router']();var fs_extra=require(_0x5578('0x5'));var auth=require(_0x5578('0x6'));var interaction=require(_0x5578('0x7'));var config=require(_0x5578('0x8'));var controller=require(_0x5578('0x9'));router[_0x5578('0xa')]('/',auth[_0x5578('0xb')](),controller[_0x5578('0xc')]);router[_0x5578('0xa')](_0x5578('0xd'),auth['isAuthenticated'](),controller[_0x5578('0xe')]);router[_0x5578('0xf')]('/',auth[_0x5578('0xb')](),controller['create']);router[_0x5578('0x10')]('/:id',auth[_0x5578('0xb')](),controller['update']);router[_0x5578('0x11')](_0x5578('0xd'),auth[_0x5578('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 8a6dd55..f6cf58a 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 _0xdedc=['TEXT','sequelize'];(function(_0x2dcefe,_0x1b804a){var _0x47c352=function(_0x1a4fdf){while(--_0x1a4fdf){_0x2dcefe['push'](_0x2dcefe['shift']());}};_0x47c352(++_0x1b804a);}(_0xdedc,0x151));var _0xcded=function(_0x4b078b,_0x53030c){_0x4b078b=_0x4b078b-0x0;var _0x4bc65c=_0xdedc[_0x4b078b];return _0x4bc65c;};'use strict';var Sequelize=require(_0xcded('0x0'));module['exports']={'tree':{'type':Sequelize[_0xcded('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x5142=['TEXT','sequelize','exports'];(function(_0x58c654,_0x56f774){var _0x1b1164=function(_0x4ed7db){while(--_0x4ed7db){_0x58c654['push'](_0x58c654['shift']());}};_0x1b1164(++_0x56f774);}(_0x5142,0xbb));var _0x2514=function(_0x1e3d2a,_0x103793){_0x1e3d2a=_0x1e3d2a-0x0;var _0x18c87e=_0x5142[_0x1e3d2a];return _0x18c87e;};'use strict';var Sequelize=require(_0x2514('0x0'));module[_0x2514('0x1')]={'tree':{'type':Sequelize[_0x2514('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 14476c5..5e0c49f 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 _0x610c=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','json','apply','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','attributes','intersection','fields','length','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','include','AnalyticTreeReport','findAll','rows','show','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x610c,0x1b4));var _0xc610=function(_0x31281a,_0x10040e){_0x31281a=_0x31281a-0x0;var _0x23aa3f=_0x610c[_0x31281a];return _0x23aa3f;};'use strict';var emlformat=require(_0xc610('0x0'));var rimraf=require(_0xc610('0x1'));var zipdir=require(_0xc610('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc610('0x3'));var moment=require(_0xc610('0x4'));var BPromise=require(_0xc610('0x5'));var Mustache=require(_0xc610('0x6'));var util=require(_0xc610('0x7'));var path=require(_0xc610('0x8'));var sox=require(_0xc610('0x9'));var csv=require('to-csv');var ejs=require(_0xc610('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc610('0xb'));var squel=require(_0xc610('0xc'));var crypto=require(_0xc610('0xd'));var jsforce=require(_0xc610('0xe'));var deskjs=require(_0xc610('0xf'));var toCsv=require(_0xc610('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc610('0x11'));var authService=require(_0xc610('0x12'));var qs=require(_0xc610('0x13'));var as=require(_0xc610('0x14'));var hardwareService=require(_0xc610('0x15'));var logger=require('../../config/logger')(_0xc610('0x16'));var utils=require(_0xc610('0x17'));var config=require(_0xc610('0x18'));var licenseUtil=require(_0xc610('0x19'));var db=require(_0xc610('0x1a'))['db'];function respondWithStatusCode(_0x88bac0,_0x26f697){_0x26f697=_0x26f697||0xcc;return function(_0x449b69){if(_0x449b69){return _0x88bac0[_0xc610('0x1b')](_0x26f697);}return _0x88bac0[_0xc610('0x1c')](_0x26f697)[_0xc610('0x1d')]();};}function respondWithResult(_0x2b4070,_0x28ef86){_0x28ef86=_0x28ef86||0xc8;return function(_0x494c1c){if(_0x494c1c){return _0x2b4070[_0xc610('0x1c')](_0x28ef86)['json'](_0x494c1c);}};}function respondWithFilteredResult(_0xa1eefc,_0x178373){return function(_0x3d9d17){if(_0x3d9d17){var _0x1432ef=typeof _0x178373['offset']===_0xc610('0x1e')&&typeof _0x178373[_0xc610('0x1f')]===_0xc610('0x1e');var _0x3441de=_0x3d9d17[_0xc610('0x20')];var _0x2caa07=_0x1432ef?0x0:_0x178373[_0xc610('0x21')];var _0x139e16=_0x1432ef?_0x3d9d17[_0xc610('0x20')]:_0x178373[_0xc610('0x21')]+_0x178373['limit'];var _0x114dab;if(_0x139e16>=_0x3441de){_0x139e16=_0x3441de;_0x114dab=0xc8;}else{_0x114dab=0xce;}_0xa1eefc[_0xc610('0x1c')](_0x114dab);return _0xa1eefc['set']('Content-Range',_0x2caa07+'-'+_0x139e16+'/'+_0x3441de)[_0xc610('0x22')](_0x3d9d17);}return null;};}function patchUpdates(_0x171e79){return function(_0x376d8f){try{jsonpatch[_0xc610('0x23')](_0x376d8f,_0x171e79,!![]);}catch(_0x2b2f4e){return BPromise[_0xc610('0x24')](_0x2b2f4e);}return _0x376d8f[_0xc610('0x25')]();};}function saveUpdates(_0x5986b8,_0x55a19f){return function(_0x436826){if(_0x436826){return _0x436826[_0xc610('0x26')](_0x5986b8)[_0xc610('0x27')](function(_0x59f3fb){return _0x59f3fb;});}return null;};}function removeEntity(_0x1a9aa4,_0x4e2180){return function(_0x4d2471){if(_0x4d2471){return _0x4d2471[_0xc610('0x28')]()[_0xc610('0x27')](function(){_0x1a9aa4[_0xc610('0x1c')](0xcc)[_0xc610('0x1d')]();});}};}function handleEntityNotFound(_0x4ef396,_0x55a7fd){return function(_0x3e202e){if(!_0x3e202e){_0x4ef396[_0xc610('0x1b')](0x194);}return _0x3e202e;};}function handleError(_0x3ad415,_0x472403){_0x472403=_0x472403||0x1f4;return function(_0x1dd4a9){logger['error'](_0x1dd4a9[_0xc610('0x29')]);if(_0x1dd4a9[_0xc610('0x2a')]){delete _0x1dd4a9[_0xc610('0x2a')];}_0x3ad415[_0xc610('0x1c')](_0x472403)[_0xc610('0x2b')](_0x1dd4a9);};}exports[_0xc610('0x2c')]=function(_0x285839,_0x225ffd){var _0x3353de={},_0x311cdb={},_0x1d70e3={'count':0x0,'rows':[]};var _0x3dde9f=_['map'](db['AnalyticTreeReport'][_0xc610('0x2d')],function(_0x23ad48){return{'name':_0x23ad48[_0xc610('0x2e')],'type':_0x23ad48['type'][_0xc610('0x2f')]};});_0x311cdb[_0xc610('0x30')]=_[_0xc610('0x31')](_0x3dde9f,_0xc610('0x2a'));_0x311cdb[_0xc610('0x32')]=_[_0xc610('0x33')](_0x285839[_0xc610('0x32')]);_0x311cdb['filters']=_['intersection'](_0x311cdb['model'],_0x311cdb[_0xc610('0x32')]);_0x3353de[_0xc610('0x34')]=_[_0xc610('0x35')](_0x311cdb[_0xc610('0x30')],qs[_0xc610('0x36')](_0x285839[_0xc610('0x32')][_0xc610('0x36')]));_0x3353de[_0xc610('0x34')]=_0x3353de[_0xc610('0x34')][_0xc610('0x37')]?_0x3353de[_0xc610('0x34')]:_0x311cdb[_0xc610('0x30')];if(!_0x285839['query']['hasOwnProperty'](_0xc610('0x38'))){_0x3353de[_0xc610('0x1f')]=qs[_0xc610('0x1f')](_0x285839['query'][_0xc610('0x1f')]);_0x3353de['offset']=qs[_0xc610('0x21')](_0x285839[_0xc610('0x32')]['offset']);}_0x3353de['order']=qs[_0xc610('0x39')](_0x285839[_0xc610('0x32')][_0xc610('0x39')]);_0x3353de[_0xc610('0x3a')]=qs[_0xc610('0x3b')](_['pick'](_0x285839['query'],_0x311cdb[_0xc610('0x3b')]),_0x3dde9f);if(_0x285839[_0xc610('0x32')][_0xc610('0x3c')]){_0x3353de[_0xc610('0x3a')]=_[_0xc610('0x3d')](_0x3353de['where'],{'$or':_[_0xc610('0x31')](_0x3dde9f,function(_0x35fa6c){if(_0x35fa6c[_0xc610('0x3e')]!==_0xc610('0x3f')){var _0x34e365={};_0x34e365[_0x35fa6c[_0xc610('0x2a')]]={'$like':'%'+_0x285839[_0xc610('0x32')]['filter']+'%'};return _0x34e365;}})});}_0x3353de=_[_0xc610('0x3d')]({},_0x3353de,_0x285839['options']);var _0x56e4ac={'where':_0x3353de[_0xc610('0x3a')]};return db['AnalyticTreeReport'][_0xc610('0x20')](_0x56e4ac)[_0xc610('0x27')](function(_0x1e1fd7){_0x1d70e3[_0xc610('0x20')]=_0x1e1fd7;if(_0x285839[_0xc610('0x32')][_0xc610('0x40')]){_0x3353de[_0xc610('0x41')]=[{'all':!![]}];}return db[_0xc610('0x42')][_0xc610('0x43')](_0x3353de);})['then'](function(_0x30f7f4){_0x1d70e3[_0xc610('0x44')]=_0x30f7f4;return _0x1d70e3;})['then'](respondWithFilteredResult(_0x225ffd,_0x3353de))['catch'](handleError(_0x225ffd,null));};exports[_0xc610('0x45')]=function(_0x4c1717,_0x5e476e){var _0x2aad46={'raw':!![],'where':{'id':_0x4c1717[_0xc610('0x46')]['id']}},_0x4bbe4f={};_0x4bbe4f[_0xc610('0x30')]=_[_0xc610('0x33')](db['AnalyticTreeReport']['rawAttributes']);_0x4bbe4f[_0xc610('0x32')]=_[_0xc610('0x33')](_0x4c1717[_0xc610('0x32')]);_0x4bbe4f[_0xc610('0x3b')]=_[_0xc610('0x35')](_0x4bbe4f['model'],_0x4bbe4f['query']);_0x2aad46[_0xc610('0x34')]=_[_0xc610('0x35')](_0x4bbe4f[_0xc610('0x30')],qs[_0xc610('0x36')](_0x4c1717[_0xc610('0x32')][_0xc610('0x36')]));_0x2aad46[_0xc610('0x34')]=_0x2aad46[_0xc610('0x34')][_0xc610('0x37')]?_0x2aad46[_0xc610('0x34')]:_0x4bbe4f[_0xc610('0x30')];if(_0x4c1717['query'][_0xc610('0x40')]){_0x2aad46[_0xc610('0x41')]=[{'all':!![]}];}_0x2aad46=_[_0xc610('0x3d')]({},_0x2aad46,_0x4c1717[_0xc610('0x47')]);return db[_0xc610('0x42')][_0xc610('0x48')](_0x2aad46)[_0xc610('0x27')](handleEntityNotFound(_0x5e476e,null))['then'](respondWithResult(_0x5e476e,null))[_0xc610('0x49')](handleError(_0x5e476e,null));};exports[_0xc610('0x4a')]=function(_0x4c1135,_0x455f70){return db[_0xc610('0x42')][_0xc610('0x4a')](_0x4c1135[_0xc610('0x4b')],{})[_0xc610('0x27')](respondWithResult(_0x455f70,0xc9))[_0xc610('0x49')](handleError(_0x455f70,null));};exports[_0xc610('0x26')]=function(_0x47b94a,_0x42b85a){if(_0x47b94a[_0xc610('0x4b')]['id']){delete _0x47b94a[_0xc610('0x4b')]['id'];}return db[_0xc610('0x42')]['find']({'where':{'id':_0x47b94a[_0xc610('0x46')]['id']}})['then'](handleEntityNotFound(_0x42b85a,null))[_0xc610('0x27')](saveUpdates(_0x47b94a[_0xc610('0x4b')],null))['then'](respondWithResult(_0x42b85a,null))[_0xc610('0x49')](handleError(_0x42b85a,null));};exports[_0xc610('0x28')]=function(_0x10c1bb,_0x48ff77){return db[_0xc610('0x42')][_0xc610('0x48')]({'where':{'id':_0x10c1bb[_0xc610('0x46')]['id']}})[_0xc610('0x27')](handleEntityNotFound(_0x48ff77,null))[_0xc610('0x27')](removeEntity(_0x48ff77,null))[_0xc610('0x49')](handleError(_0x48ff77,null));};
\ No newline at end of file
+var _0xdd52=['params','keys','includeAll','merge','find','create','body','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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','include','findAll','rows','catch','show'];(function(_0x1eccef,_0x1181d4){var _0x51c6f2=function(_0x151fba){while(--_0x151fba){_0x1eccef['push'](_0x1eccef['shift']());}};_0x51c6f2(++_0x1181d4);}(_0xdd52,0xa9));var _0x2dd5=function(_0x11a2e9,_0x3c112b){_0x11a2e9=_0x11a2e9-0x0;var _0x20388f=_0xdd52[_0x11a2e9];return _0x20388f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2dd5('0x0'));var zipdir=require(_0x2dd5('0x1'));var jsonpatch=require(_0x2dd5('0x2'));var rp=require(_0x2dd5('0x3'));var moment=require(_0x2dd5('0x4'));var BPromise=require(_0x2dd5('0x5'));var Mustache=require(_0x2dd5('0x6'));var util=require(_0x2dd5('0x7'));var path=require(_0x2dd5('0x8'));var sox=require(_0x2dd5('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2dd5('0xa'));var _=require(_0x2dd5('0xb'));var squel=require(_0x2dd5('0xc'));var crypto=require(_0x2dd5('0xd'));var jsforce=require(_0x2dd5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2dd5('0xf'));var querystring=require(_0x2dd5('0x10'));var Papa=require(_0x2dd5('0x11'));var Redis=require(_0x2dd5('0x12'));var authService=require(_0x2dd5('0x13'));var qs=require(_0x2dd5('0x14'));var as=require(_0x2dd5('0x15'));var hardwareService=require(_0x2dd5('0x16'));var logger=require(_0x2dd5('0x17'))(_0x2dd5('0x18'));var utils=require(_0x2dd5('0x19'));var config=require(_0x2dd5('0x1a'));var licenseUtil=require(_0x2dd5('0x1b'));var db=require(_0x2dd5('0x1c'))['db'];function respondWithStatusCode(_0x3b8371,_0xaf3738){_0xaf3738=_0xaf3738||0xcc;return function(_0x293e85){if(_0x293e85){return _0x3b8371[_0x2dd5('0x1d')](_0xaf3738);}return _0x3b8371[_0x2dd5('0x1e')](_0xaf3738)[_0x2dd5('0x1f')]();};}function respondWithResult(_0x5d19be,_0x93d250){_0x93d250=_0x93d250||0xc8;return function(_0x208266){if(_0x208266){return _0x5d19be[_0x2dd5('0x1e')](_0x93d250)[_0x2dd5('0x20')](_0x208266);}};}function respondWithFilteredResult(_0x153cc1,_0x72d724){return function(_0x162fe3){if(_0x162fe3){var _0x203544=typeof _0x72d724[_0x2dd5('0x21')]===_0x2dd5('0x22')&&typeof _0x72d724[_0x2dd5('0x23')]===_0x2dd5('0x22');var _0x2e95d6=_0x162fe3['count'];var _0x1f17e1=_0x203544?0x0:_0x72d724[_0x2dd5('0x21')];var _0x159e30=_0x203544?_0x162fe3[_0x2dd5('0x24')]:_0x72d724['offset']+_0x72d724['limit'];var _0xcc557d;if(_0x159e30>=_0x2e95d6){_0x159e30=_0x2e95d6;_0xcc557d=0xc8;}else{_0xcc557d=0xce;}_0x153cc1['status'](_0xcc557d);return _0x153cc1[_0x2dd5('0x25')]('Content-Range',_0x1f17e1+'-'+_0x159e30+'/'+_0x2e95d6)[_0x2dd5('0x20')](_0x162fe3);}return null;};}function patchUpdates(_0x169f9f){return function(_0x423f1d){try{jsonpatch[_0x2dd5('0x26')](_0x423f1d,_0x169f9f,!![]);}catch(_0x4d67bf){return BPromise[_0x2dd5('0x27')](_0x4d67bf);}return _0x423f1d[_0x2dd5('0x28')]();};}function saveUpdates(_0x3a75da,_0x512280){return function(_0x545e6a){if(_0x545e6a){return _0x545e6a[_0x2dd5('0x29')](_0x3a75da)[_0x2dd5('0x2a')](function(_0x4911cf){return _0x4911cf;});}return null;};}function removeEntity(_0x5bbde9,_0x4e65de){return function(_0x2d6d6b){if(_0x2d6d6b){return _0x2d6d6b[_0x2dd5('0x2b')]()['then'](function(){_0x5bbde9[_0x2dd5('0x1e')](0xcc)[_0x2dd5('0x1f')]();});}};}function handleEntityNotFound(_0x505708,_0x42a6af){return function(_0x4e556e){if(!_0x4e556e){_0x505708['sendStatus'](0x194);}return _0x4e556e;};}function handleError(_0x48f8d5,_0x4f299a){_0x4f299a=_0x4f299a||0x1f4;return function(_0x324075){logger[_0x2dd5('0x2c')](_0x324075[_0x2dd5('0x2d')]);if(_0x324075['name']){delete _0x324075[_0x2dd5('0x2e')];}_0x48f8d5[_0x2dd5('0x1e')](_0x4f299a)[_0x2dd5('0x2f')](_0x324075);};}exports[_0x2dd5('0x30')]=function(_0x4d7066,_0x4614fe){var _0x5bea29={},_0x56aa79={},_0x2cb076={'count':0x0,'rows':[]};var _0x435d18=_[_0x2dd5('0x31')](db[_0x2dd5('0x32')][_0x2dd5('0x33')],function(_0x36d875){return{'name':_0x36d875[_0x2dd5('0x34')],'type':_0x36d875[_0x2dd5('0x35')][_0x2dd5('0x36')]};});_0x56aa79[_0x2dd5('0x37')]=_['map'](_0x435d18,'name');_0x56aa79['query']=_['keys'](_0x4d7066['query']);_0x56aa79[_0x2dd5('0x38')]=_[_0x2dd5('0x39')](_0x56aa79[_0x2dd5('0x37')],_0x56aa79[_0x2dd5('0x3a')]);_0x5bea29[_0x2dd5('0x3b')]=_[_0x2dd5('0x39')](_0x56aa79['model'],qs[_0x2dd5('0x3c')](_0x4d7066['query'][_0x2dd5('0x3c')]));_0x5bea29[_0x2dd5('0x3b')]=_0x5bea29[_0x2dd5('0x3b')][_0x2dd5('0x3d')]?_0x5bea29[_0x2dd5('0x3b')]:_0x56aa79['model'];if(!_0x4d7066[_0x2dd5('0x3a')][_0x2dd5('0x3e')](_0x2dd5('0x3f'))){_0x5bea29['limit']=qs[_0x2dd5('0x23')](_0x4d7066[_0x2dd5('0x3a')][_0x2dd5('0x23')]);_0x5bea29[_0x2dd5('0x21')]=qs[_0x2dd5('0x21')](_0x4d7066[_0x2dd5('0x3a')]['offset']);}_0x5bea29['order']=qs[_0x2dd5('0x40')](_0x4d7066[_0x2dd5('0x3a')][_0x2dd5('0x40')]);_0x5bea29[_0x2dd5('0x41')]=qs['filters'](_['pick'](_0x4d7066[_0x2dd5('0x3a')],_0x56aa79[_0x2dd5('0x38')]),_0x435d18);if(_0x4d7066[_0x2dd5('0x3a')][_0x2dd5('0x42')]){_0x5bea29[_0x2dd5('0x41')]=_['merge'](_0x5bea29[_0x2dd5('0x41')],{'$or':_['map'](_0x435d18,function(_0x142071){if(_0x142071['type']!==_0x2dd5('0x43')){var _0x36565d={};_0x36565d[_0x142071[_0x2dd5('0x2e')]]={'$like':'%'+_0x4d7066[_0x2dd5('0x3a')][_0x2dd5('0x42')]+'%'};return _0x36565d;}})});}_0x5bea29=_['merge']({},_0x5bea29,_0x4d7066[_0x2dd5('0x44')]);var _0x1dd56e={'where':_0x5bea29['where']};return db['AnalyticTreeReport'][_0x2dd5('0x24')](_0x1dd56e)[_0x2dd5('0x2a')](function(_0x429e0e){_0x2cb076[_0x2dd5('0x24')]=_0x429e0e;if(_0x4d7066['query']['includeAll']){_0x5bea29[_0x2dd5('0x45')]=[{'all':!![]}];}return db[_0x2dd5('0x32')][_0x2dd5('0x46')](_0x5bea29);})[_0x2dd5('0x2a')](function(_0x4e45ac){_0x2cb076[_0x2dd5('0x47')]=_0x4e45ac;return _0x2cb076;})[_0x2dd5('0x2a')](respondWithFilteredResult(_0x4614fe,_0x5bea29))[_0x2dd5('0x48')](handleError(_0x4614fe,null));};exports[_0x2dd5('0x49')]=function(_0x456f24,_0x276f84){var _0x5fa1b1={'raw':!![],'where':{'id':_0x456f24[_0x2dd5('0x4a')]['id']}},_0xc75a25={};_0xc75a25['model']=_[_0x2dd5('0x4b')](db[_0x2dd5('0x32')][_0x2dd5('0x33')]);_0xc75a25['query']=_[_0x2dd5('0x4b')](_0x456f24[_0x2dd5('0x3a')]);_0xc75a25[_0x2dd5('0x38')]=_['intersection'](_0xc75a25[_0x2dd5('0x37')],_0xc75a25['query']);_0x5fa1b1[_0x2dd5('0x3b')]=_[_0x2dd5('0x39')](_0xc75a25[_0x2dd5('0x37')],qs['fields'](_0x456f24[_0x2dd5('0x3a')][_0x2dd5('0x3c')]));_0x5fa1b1[_0x2dd5('0x3b')]=_0x5fa1b1[_0x2dd5('0x3b')][_0x2dd5('0x3d')]?_0x5fa1b1[_0x2dd5('0x3b')]:_0xc75a25[_0x2dd5('0x37')];if(_0x456f24[_0x2dd5('0x3a')][_0x2dd5('0x4c')]){_0x5fa1b1['include']=[{'all':!![]}];}_0x5fa1b1=_[_0x2dd5('0x4d')]({},_0x5fa1b1,_0x456f24[_0x2dd5('0x44')]);return db[_0x2dd5('0x32')][_0x2dd5('0x4e')](_0x5fa1b1)[_0x2dd5('0x2a')](handleEntityNotFound(_0x276f84,null))[_0x2dd5('0x2a')](respondWithResult(_0x276f84,null))[_0x2dd5('0x48')](handleError(_0x276f84,null));};exports['create']=function(_0x2bca55,_0x320cb3){return db[_0x2dd5('0x32')][_0x2dd5('0x4f')](_0x2bca55[_0x2dd5('0x50')],{})[_0x2dd5('0x2a')](respondWithResult(_0x320cb3,0xc9))[_0x2dd5('0x48')](handleError(_0x320cb3,null));};exports[_0x2dd5('0x29')]=function(_0x57d0c2,_0x516909){if(_0x57d0c2[_0x2dd5('0x50')]['id']){delete _0x57d0c2[_0x2dd5('0x50')]['id'];}return db[_0x2dd5('0x32')]['find']({'where':{'id':_0x57d0c2['params']['id']}})[_0x2dd5('0x2a')](handleEntityNotFound(_0x516909,null))[_0x2dd5('0x2a')](saveUpdates(_0x57d0c2[_0x2dd5('0x50')],null))[_0x2dd5('0x2a')](respondWithResult(_0x516909,null))[_0x2dd5('0x48')](handleError(_0x516909,null));};exports[_0x2dd5('0x2b')]=function(_0x565e4d,_0x8a7cf6){return db[_0x2dd5('0x32')]['find']({'where':{'id':_0x565e4d[_0x2dd5('0x4a')]['id']}})[_0x2dd5('0x2a')](handleEntityNotFound(_0x8a7cf6,null))[_0x2dd5('0x2a')](removeEntity(_0x8a7cf6,null))[_0x2dd5('0x48')](handleError(_0x8a7cf6,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index e187928..0508fef 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 _0xd8b9=['AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define'];(function(_0xd250ec,_0x446153){var _0x108b01=function(_0x3ce68f){while(--_0x3ce68f){_0xd250ec['push'](_0xd250ec['shift']());}};_0x108b01(++_0x446153);}(_0xd8b9,0x6a));var _0x9d8b=function(_0x25b4b7,_0x315052){_0x25b4b7=_0x25b4b7-0x0;var _0x5edf88=_0xd8b9[_0x25b4b7];return _0x5edf88;};'use strict';var _=require(_0x9d8b('0x0'));var util=require('util');var logger=require(_0x9d8b('0x1'))(_0x9d8b('0x2'));var moment=require(_0x9d8b('0x3'));var BPromise=require(_0x9d8b('0x4'));var rp=require(_0x9d8b('0x5'));var fs=require('fs');var path=require(_0x9d8b('0x6'));var rimraf=require(_0x9d8b('0x7'));var config=require(_0x9d8b('0x8'));var attributes=require(_0x9d8b('0x9'));module['exports']=function(_0x21b3fd,_0x4813ab){return _0x21b3fd[_0x9d8b('0xa')](_0x9d8b('0xb'),attributes,{'tableName':_0x9d8b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5710=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util','../../config/logger','api','moment'];(function(_0x169630,_0x2a57b1){var _0x1641dd=function(_0x5aabbb){while(--_0x5aabbb){_0x169630['push'](_0x169630['shift']());}};_0x1641dd(++_0x2a57b1);}(_0x5710,0xb1));var _0x0571=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5710[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x0571('0x0'));var util=require(_0x0571('0x1'));var logger=require(_0x0571('0x2'))(_0x0571('0x3'));var moment=require(_0x0571('0x4'));var BPromise=require(_0x0571('0x5'));var rp=require(_0x0571('0x6'));var fs=require('fs');var path=require(_0x0571('0x7'));var rimraf=require(_0x0571('0x8'));var config=require(_0x0571('0x9'));var attributes=require(_0x0571('0xa'));module[_0x0571('0xb')]=function(_0x96ded2,_0x3bbbe7){return _0x96ded2[_0x0571('0xc')]('AnalyticTreeReport',attributes,{'tableName':_0x0571('0xd'),'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 edab94f..127a158 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x5516a1,_0x215ca4){var _0x4a957b=function(_0x39b0e6){while(--_0x39b0e6){_0x5516a1['push'](_0x5516a1['shift']());}};_0x4a957b(++_0x215ca4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xc4aa[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2eebf2,_0x15e7ca){var _0x1ca79=function(_0x430405){while(--_0x430405){_0x2eebf2['push'](_0x2eebf2['shift']());}};_0x1ca79(++_0x15e7ca);}(_0x5f2f,0x73));var _0xf5f2=function(_0xe92bc6,_0x35937e){_0xe92bc6=_0xe92bc6-0x0;var _0x4d5b66=_0x5f2f[_0xe92bc6];return _0x4d5b66;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 7a0ffdf..53293c1 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 _0xc03d=['/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get'];(function(_0x3fdf10,_0x420bb1){var _0x3acf07=function(_0x7dd2ea){while(--_0x7dd2ea){_0x3fdf10['push'](_0x3fdf10['shift']());}};_0x3acf07(++_0x420bb1);}(_0xc03d,0xef));var _0xdc03=function(_0x3d76e8,_0x1f965d){_0x3d76e8=_0x3d76e8-0x0;var _0x198af2=_0xc03d[_0x3d76e8];return _0x198af2;};'use strict';var multer=require(_0xdc03('0x0'));var util=require(_0xdc03('0x1'));var path=require(_0xdc03('0x2'));var timeout=require(_0xdc03('0x3'));var express=require(_0xdc03('0x4'));var router=express[_0xdc03('0x5')]();var fs_extra=require(_0xdc03('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdc03('0x7'));var config=require(_0xdc03('0x8'));var controller=require(_0xdc03('0x9'));router['get']('/',auth[_0xdc03('0xa')](),controller[_0xdc03('0xb')]);router[_0xdc03('0xc')](_0xdc03('0xd'),auth[_0xdc03('0xa')](),controller[_0xdc03('0xe')]);router[_0xdc03('0xf')]('/',auth[_0xdc03('0xa')](),controller[_0xdc03('0x10')]);router[_0xdc03('0x11')](_0xdc03('0xd'),auth[_0xdc03('0xa')](),controller[_0xdc03('0x12')]);router[_0xdc03('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xdc03('0x14')]=router;
\ No newline at end of file
+var _0x5ec2=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0x5f6171,_0x308104){var _0x3e5257=function(_0x42d8ce){while(--_0x42d8ce){_0x5f6171['push'](_0x5f6171['shift']());}};_0x3e5257(++_0x308104);}(_0x5ec2,0x18a));var _0x25ec=function(_0x2e6dee,_0x1a61b0){_0x2e6dee=_0x2e6dee-0x0;var _0x47706=_0x5ec2[_0x2e6dee];return _0x47706;};'use strict';var multer=require(_0x25ec('0x0'));var util=require(_0x25ec('0x1'));var path=require(_0x25ec('0x2'));var timeout=require(_0x25ec('0x3'));var express=require('express');var router=express[_0x25ec('0x4')]();var fs_extra=require(_0x25ec('0x5'));var auth=require(_0x25ec('0x6'));var interaction=require(_0x25ec('0x7'));var config=require(_0x25ec('0x8'));var controller=require(_0x25ec('0x9'));router[_0x25ec('0xa')]('/',auth[_0x25ec('0xb')](),controller['index']);router[_0x25ec('0xa')](_0x25ec('0xc'),auth[_0x25ec('0xb')](),controller['show']);router[_0x25ec('0xd')]('/',auth[_0x25ec('0xb')](),controller[_0x25ec('0xe')]);router[_0x25ec('0xf')](_0x25ec('0xc'),auth['isAuthenticated'](),controller[_0x25ec('0x10')]);router[_0x25ec('0x11')]('/:id',auth[_0x25ec('0xb')](),controller[_0x25ec('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 5920897..7c03353 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 _0x2d17=['STRING','sequelize','exports'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x2d17,0x17e));var _0x72d1=function(_0x5bcae4,_0x5f56d0){_0x5bcae4=_0x5bcae4-0x0;var _0x18289d=_0x2d17[_0x5bcae4];return _0x18289d;};'use strict';var Sequelize=require(_0x72d1('0x0'));module[_0x72d1('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x72d1('0x2')]},'type':{'type':Sequelize[_0x72d1('0x2')]}};
\ No newline at end of file
+var _0xbb53=['STRING','sequelize','exports'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xbb53,0x121));var _0x3bb5=function(_0x358436,_0x5c3c5f){_0x358436=_0x358436-0x0;var _0x343cb=_0xbb53[_0x358436];return _0x343cb;};'use strict';var Sequelize=require(_0x3bb5('0x0'));module[_0x3bb5('0x1')]={'name':{'type':Sequelize[_0x3bb5('0x2')]},'basename':{'type':Sequelize[_0x3bb5('0x2')]},'type':{'type':Sequelize[_0x3bb5('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 87a5140..5203038 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 _0xe5fd=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','rows','catch','keys','rawAttributes','length','merge','find','clone','params','omit','updatedAt','body','createdAt','create','file','originalname','basename','mimetype','findOne','root','server/files/attachments/','join','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Attachment','fieldName','type','key','model','query','filters','intersection'];(function(_0x372d95,_0x14b2e8){var _0x258f8e=function(_0x62d3c0){while(--_0x62d3c0){_0x372d95['push'](_0x372d95['shift']());}};_0x258f8e(++_0x14b2e8);}(_0xe5fd,0x7d));var _0xde5f=function(_0x23a6b7,_0x5a3533){_0x23a6b7=_0x23a6b7-0x0;var _0x43bf1f=_0xe5fd[_0x23a6b7];return _0x43bf1f;};'use strict';var emlformat=require(_0xde5f('0x0'));var rimraf=require(_0xde5f('0x1'));var zipdir=require(_0xde5f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde5f('0x3'));var moment=require(_0xde5f('0x4'));var BPromise=require(_0xde5f('0x5'));var Mustache=require(_0xde5f('0x6'));var util=require(_0xde5f('0x7'));var path=require(_0xde5f('0x8'));var sox=require(_0xde5f('0x9'));var csv=require(_0xde5f('0xa'));var ejs=require(_0xde5f('0xb'));var fs=require('fs');var fs_extra=require(_0xde5f('0xc'));var _=require(_0xde5f('0xd'));var squel=require('squel');var crypto=require(_0xde5f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xde5f('0xf'));var toCsv=require(_0xde5f('0xa'));var querystring=require(_0xde5f('0x10'));var Papa=require(_0xde5f('0x11'));var Redis=require(_0xde5f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xde5f('0x13'));var hardwareService=require(_0xde5f('0x14'));var logger=require(_0xde5f('0x15'))('api');var utils=require(_0xde5f('0x16'));var config=require(_0xde5f('0x17'));var licenseUtil=require(_0xde5f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44eb64,_0x586236){_0x586236=_0x586236||0xcc;return function(_0x5f3ae1){if(_0x5f3ae1){return _0x44eb64['sendStatus'](_0x586236);}return _0x44eb64[_0xde5f('0x19')](_0x586236)['end']();};}function respondWithResult(_0x5f18a5,_0x1251b5){_0x1251b5=_0x1251b5||0xc8;return function(_0x34f433){if(_0x34f433){return _0x5f18a5['status'](_0x1251b5)['json'](_0x34f433);}};}function respondWithFilteredResult(_0x85ac7c,_0x20215c){return function(_0x4312e8){if(_0x4312e8){var _0x9bac3a=typeof _0x20215c[_0xde5f('0x1a')]===_0xde5f('0x1b')&&typeof _0x20215c[_0xde5f('0x1c')]==='undefined';var _0x56c110=_0x4312e8['count'];var _0x23a19f=_0x9bac3a?0x0:_0x20215c['offset'];var _0xf232c8=_0x9bac3a?_0x4312e8[_0xde5f('0x1d')]:_0x20215c[_0xde5f('0x1a')]+_0x20215c[_0xde5f('0x1c')];var _0x44f842;if(_0xf232c8>=_0x56c110){_0xf232c8=_0x56c110;_0x44f842=0xc8;}else{_0x44f842=0xce;}_0x85ac7c[_0xde5f('0x19')](_0x44f842);return _0x85ac7c[_0xde5f('0x1e')]('Content-Range',_0x23a19f+'-'+_0xf232c8+'/'+_0x56c110)[_0xde5f('0x1f')](_0x4312e8);}return null;};}function patchUpdates(_0x4ddec9){return function(_0x2ade30){try{jsonpatch[_0xde5f('0x20')](_0x2ade30,_0x4ddec9,!![]);}catch(_0x333918){return BPromise[_0xde5f('0x21')](_0x333918);}return _0x2ade30[_0xde5f('0x22')]();};}function saveUpdates(_0x32c71e,_0x7adf){return function(_0x41c58f){if(_0x41c58f){return _0x41c58f[_0xde5f('0x23')](_0x32c71e)[_0xde5f('0x24')](function(_0x397dd3){return _0x397dd3;});}return null;};}function removeEntity(_0x16fcf,_0x6180ed){return function(_0x586ec3){if(_0x586ec3){return _0x586ec3[_0xde5f('0x25')]()['then'](function(){_0x16fcf[_0xde5f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb013e9,_0x385869){return function(_0xadbd4b){if(!_0xadbd4b){_0xb013e9[_0xde5f('0x26')](0x194);}return _0xadbd4b;};}function handleError(_0x545874,_0x31b07e){_0x31b07e=_0x31b07e||0x1f4;return function(_0x288c90){logger[_0xde5f('0x27')](_0x288c90[_0xde5f('0x28')]);if(_0x288c90[_0xde5f('0x29')]){delete _0x288c90[_0xde5f('0x29')];}_0x545874[_0xde5f('0x19')](_0x31b07e)[_0xde5f('0x2a')](_0x288c90);};}exports[_0xde5f('0x2b')]=function(_0x17ad3c,_0x7f0eb7){var _0x95006e={},_0x391384={},_0x18d335={'count':0x0,'rows':[]};var _0x50f094=_[_0xde5f('0x2c')](db[_0xde5f('0x2d')]['rawAttributes'],function(_0x575366){return{'name':_0x575366[_0xde5f('0x2e')],'type':_0x575366[_0xde5f('0x2f')][_0xde5f('0x30')]};});_0x391384[_0xde5f('0x31')]=_[_0xde5f('0x2c')](_0x50f094,_0xde5f('0x29'));_0x391384['query']=_['keys'](_0x17ad3c[_0xde5f('0x32')]);_0x391384[_0xde5f('0x33')]=_[_0xde5f('0x34')](_0x391384[_0xde5f('0x31')],_0x391384[_0xde5f('0x32')]);_0x95006e[_0xde5f('0x35')]=_[_0xde5f('0x34')](_0x391384[_0xde5f('0x31')],qs[_0xde5f('0x36')](_0x17ad3c[_0xde5f('0x32')][_0xde5f('0x36')]));_0x95006e['attributes']=_0x95006e[_0xde5f('0x35')]['length']?_0x95006e[_0xde5f('0x35')]:_0x391384[_0xde5f('0x31')];if(!_0x17ad3c[_0xde5f('0x32')][_0xde5f('0x37')](_0xde5f('0x38'))){_0x95006e[_0xde5f('0x1c')]=qs[_0xde5f('0x1c')](_0x17ad3c[_0xde5f('0x32')][_0xde5f('0x1c')]);_0x95006e[_0xde5f('0x1a')]=qs[_0xde5f('0x1a')](_0x17ad3c[_0xde5f('0x32')][_0xde5f('0x1a')]);}_0x95006e[_0xde5f('0x39')]=qs[_0xde5f('0x3a')](_0x17ad3c['query']['sort']);_0x95006e[_0xde5f('0x3b')]=qs[_0xde5f('0x33')](_[_0xde5f('0x3c')](_0x17ad3c[_0xde5f('0x32')],_0x391384[_0xde5f('0x33')]),_0x50f094);if(_0x17ad3c[_0xde5f('0x32')]['filter']){_0x95006e[_0xde5f('0x3b')]=_['merge'](_0x95006e[_0xde5f('0x3b')],{'$or':_[_0xde5f('0x2c')](_0x50f094,function(_0x5a80a1){if(_0x5a80a1[_0xde5f('0x2f')]!==_0xde5f('0x3d')){var _0x4fa755={};_0x4fa755[_0x5a80a1[_0xde5f('0x29')]]={'$like':'%'+_0x17ad3c[_0xde5f('0x32')][_0xde5f('0x3e')]+'%'};return _0x4fa755;}})});}_0x95006e=_['merge']({},_0x95006e,_0x17ad3c[_0xde5f('0x3f')]);var _0x2741c3={'where':_0x95006e[_0xde5f('0x3b')]};return db['Attachment'][_0xde5f('0x1d')](_0x2741c3)[_0xde5f('0x24')](function(_0x46c204){_0x18d335[_0xde5f('0x1d')]=_0x46c204;if(_0x17ad3c[_0xde5f('0x32')][_0xde5f('0x40')]){_0x95006e[_0xde5f('0x41')]=[{'all':!![]}];}return db[_0xde5f('0x2d')]['findAll'](_0x95006e);})['then'](function(_0x24df70){_0x18d335[_0xde5f('0x42')]=_0x24df70;return _0x18d335;})[_0xde5f('0x24')](respondWithFilteredResult(_0x7f0eb7,_0x95006e))[_0xde5f('0x43')](handleError(_0x7f0eb7,null));};exports['show']=function(_0x47b6aa,_0x5e41ce){var _0x2556f7={'raw':!![],'where':{'id':_0x47b6aa['params']['id']}},_0x5503d1={};_0x5503d1[_0xde5f('0x31')]=_[_0xde5f('0x44')](db[_0xde5f('0x2d')][_0xde5f('0x45')]);_0x5503d1[_0xde5f('0x32')]=_[_0xde5f('0x44')](_0x47b6aa['query']);_0x5503d1[_0xde5f('0x33')]=_[_0xde5f('0x34')](_0x5503d1[_0xde5f('0x31')],_0x5503d1[_0xde5f('0x32')]);_0x2556f7[_0xde5f('0x35')]=_['intersection'](_0x5503d1[_0xde5f('0x31')],qs['fields'](_0x47b6aa[_0xde5f('0x32')][_0xde5f('0x36')]));_0x2556f7[_0xde5f('0x35')]=_0x2556f7[_0xde5f('0x35')][_0xde5f('0x46')]?_0x2556f7[_0xde5f('0x35')]:_0x5503d1['model'];if(_0x47b6aa[_0xde5f('0x32')]['includeAll']){_0x2556f7['include']=[{'all':!![]}];}_0x2556f7=_[_0xde5f('0x47')]({},_0x2556f7,_0x47b6aa['options']);return db['Attachment'][_0xde5f('0x48')](_0x2556f7)[_0xde5f('0x24')](handleEntityNotFound(_0x5e41ce,null))[_0xde5f('0x24')](respondWithResult(_0x5e41ce,null))[_0xde5f('0x43')](handleError(_0x5e41ce,null));};exports[_0xde5f('0x49')]=function(_0xf9b310,_0x3f99ca){var _0x1a6676={'where':{'id':_0xf9b310[_0xde5f('0x4a')]['id']}},_0xdaef1a={};_0xdaef1a[_0xde5f('0x31')]=_['keys'](db[_0xde5f('0x2d')][_0xde5f('0x45')]);_0x1a6676[_0xde5f('0x35')]=_[_0xde5f('0x34')](_0xdaef1a[_0xde5f('0x31')],qs[_0xde5f('0x36')](_0xf9b310[_0xde5f('0x32')][_0xde5f('0x36')]));_0x1a6676[_0xde5f('0x35')]=_0x1a6676[_0xde5f('0x35')][_0xde5f('0x46')]?_0x1a6676[_0xde5f('0x35')]:_0xdaef1a[_0xde5f('0x31')];if(_0xf9b310['query'][_0xde5f('0x40')]){_0x1a6676[_0xde5f('0x41')]=[{'all':!![]}];}_0x1a6676=_[_0xde5f('0x47')]({},_0x1a6676,_0xf9b310[_0xde5f('0x3f')]);return db[_0xde5f('0x2d')][_0xde5f('0x48')](_0x1a6676)['then'](handleEntityNotFound(_0x3f99ca,null))[_0xde5f('0x24')](function(_0x2f3a53){if(_0x2f3a53){var _0xbe17d4=_0x2f3a53['get']({'plain':!![]});_0xbe17d4=qs[_0xde5f('0x4b')](_0xbe17d4,['id','createdAt',_0xde5f('0x4c')]);_0xf9b310[_0xde5f('0x4d')]=_[_0xde5f('0x4b')](_0xf9b310[_0xde5f('0x4d')],['id',_0xde5f('0x4e'),_0xde5f('0x4c')]);return db[_0xde5f('0x2d')][_0xde5f('0x4f')](_[_0xde5f('0x47')](_0xbe17d4,_0xf9b310[_0xde5f('0x4d')]),{'include':_0xf9b310['query'][_0xde5f('0x40')]?[{'all':!![]}]:undefined});}})[_0xde5f('0x24')](respondWithResult(_0x3f99ca,0xc9))[_0xde5f('0x43')](handleError(_0x3f99ca,null));};exports[_0xde5f('0x23')]=function(_0x3d24ed,_0xc7c722){if(_0x3d24ed['body']['id']){delete _0x3d24ed[_0xde5f('0x4d')]['id'];}return db[_0xde5f('0x2d')][_0xde5f('0x48')]({'where':{'id':_0x3d24ed[_0xde5f('0x4a')]['id']}})[_0xde5f('0x24')](handleEntityNotFound(_0xc7c722,null))['then'](saveUpdates(_0x3d24ed[_0xde5f('0x4d')],null))['then'](respondWithResult(_0xc7c722,null))[_0xde5f('0x43')](handleError(_0xc7c722,null));};exports[_0xde5f('0x25')]=function(_0x390e96,_0x4e173f){return db['Attachment'][_0xde5f('0x48')]({'where':{'id':_0x390e96[_0xde5f('0x4a')]['id']}})[_0xde5f('0x24')](handleEntityNotFound(_0x4e173f,null))['then'](removeEntity(_0x4e173f,null))[_0xde5f('0x43')](handleError(_0x4e173f,null));};exports[_0xde5f('0x4f')]=function(_0x3b9925,_0x2170b4,_0x5b334b){_0x3b9925[_0xde5f('0x4d')][_0xde5f('0x29')]=_0x3b9925[_0xde5f('0x50')][_0xde5f('0x51')];_0x3b9925['body'][_0xde5f('0x52')]=_0x3b9925[_0xde5f('0x50')]['filename'];_0x3b9925[_0xde5f('0x4d')][_0xde5f('0x2f')]=_0x3b9925['file'][_0xde5f('0x53')];return db[_0xde5f('0x2d')][_0xde5f('0x4f')](_0x3b9925[_0xde5f('0x4d')])['then'](respondWithResult(_0x2170b4,0xc9))[_0xde5f('0x43')](handleError(_0x2170b4,null));};exports['download']=function(_0x587178,_0x5b6b14,_0xd5c96d){return db[_0xde5f('0x2d')][_0xde5f('0x54')]({'where':{'id':_0x587178[_0xde5f('0x4a')]['id']},'raw':!![]})[_0xde5f('0x24')](handleEntityNotFound(_0x5b6b14,null))[_0xde5f('0x24')](function(_0x45ec1e){if(_0x45ec1e){var _0x430b69=_0x45ec1e['ChatOfflineMessageId']!==null;var _0x4b4205=path['join'](config[_0xde5f('0x55')],_0xde5f('0x56'));if(_0x430b69){_0x4b4205=path[_0xde5f('0x57')](_0x4b4205,'offline-chat/');}var _0x223512=path[_0xde5f('0x57')](_0x4b4205,_0x45ec1e[_0xde5f('0x52')]);return _0x5b6b14[_0xde5f('0x58')](_0x223512);}})[_0xde5f('0x43')](handleError(_0x5b6b14,null));};
\ No newline at end of file
+var _0xd387=['params','includeAll','include','options','find','get','updatedAt','body','omit','create','file','originalname','basename','filename','type','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','sendStatus','error','stack','name','index','map','Attachment','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','findAll','rows','catch','show'];(function(_0x319cb9,_0x4b8d35){var _0x1735fc=function(_0x43b061){while(--_0x43b061){_0x319cb9['push'](_0x319cb9['shift']());}};_0x1735fc(++_0x4b8d35);}(_0xd387,0x1ca));var _0x7d38=function(_0xb8eb35,_0x3e0b35){_0xb8eb35=_0xb8eb35-0x0;var _0x35cd19=_0xd387[_0xb8eb35];return _0x35cd19;};'use strict';var emlformat=require(_0x7d38('0x0'));var rimraf=require(_0x7d38('0x1'));var zipdir=require(_0x7d38('0x2'));var jsonpatch=require(_0x7d38('0x3'));var rp=require(_0x7d38('0x4'));var moment=require(_0x7d38('0x5'));var BPromise=require(_0x7d38('0x6'));var Mustache=require(_0x7d38('0x7'));var util=require(_0x7d38('0x8'));var path=require(_0x7d38('0x9'));var sox=require('sox');var csv=require(_0x7d38('0xa'));var ejs=require(_0x7d38('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d38('0xc'));var squel=require(_0x7d38('0xd'));var crypto=require(_0x7d38('0xe'));var jsforce=require(_0x7d38('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7d38('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7d38('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7d38('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d38('0x12'))('api');var utils=require(_0x7d38('0x13'));var config=require(_0x7d38('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d38('0x15'))['db'];function respondWithStatusCode(_0x3f376a,_0x52621f){_0x52621f=_0x52621f||0xcc;return function(_0x5846ab){if(_0x5846ab){return _0x3f376a['sendStatus'](_0x52621f);}return _0x3f376a[_0x7d38('0x16')](_0x52621f)[_0x7d38('0x17')]();};}function respondWithResult(_0xb9a7e9,_0x59945f){_0x59945f=_0x59945f||0xc8;return function(_0x26af27){if(_0x26af27){return _0xb9a7e9[_0x7d38('0x16')](_0x59945f)[_0x7d38('0x18')](_0x26af27);}};}function respondWithFilteredResult(_0x2c075d,_0x1f10fe){return function(_0x12b494){if(_0x12b494){var _0x4b4e5f=typeof _0x1f10fe[_0x7d38('0x19')]===_0x7d38('0x1a')&&typeof _0x1f10fe[_0x7d38('0x1b')]===_0x7d38('0x1a');var _0x24035d=_0x12b494[_0x7d38('0x1c')];var _0x1b8fb1=_0x4b4e5f?0x0:_0x1f10fe[_0x7d38('0x19')];var _0x1e7dec=_0x4b4e5f?_0x12b494['count']:_0x1f10fe[_0x7d38('0x19')]+_0x1f10fe[_0x7d38('0x1b')];var _0x300bd4;if(_0x1e7dec>=_0x24035d){_0x1e7dec=_0x24035d;_0x300bd4=0xc8;}else{_0x300bd4=0xce;}_0x2c075d[_0x7d38('0x16')](_0x300bd4);return _0x2c075d['set'](_0x7d38('0x1d'),_0x1b8fb1+'-'+_0x1e7dec+'/'+_0x24035d)[_0x7d38('0x18')](_0x12b494);}return null;};}function patchUpdates(_0x4ce5fc){return function(_0x275170){try{jsonpatch['apply'](_0x275170,_0x4ce5fc,!![]);}catch(_0x548003){return BPromise[_0x7d38('0x1e')](_0x548003);}return _0x275170[_0x7d38('0x1f')]();};}function saveUpdates(_0xf669ef,_0x2fe995){return function(_0x481614){if(_0x481614){return _0x481614[_0x7d38('0x20')](_0xf669ef)[_0x7d38('0x21')](function(_0x5494d2){return _0x5494d2;});}return null;};}function removeEntity(_0x181a5b,_0x3ad26d){return function(_0xb6da75){if(_0xb6da75){return _0xb6da75['destroy']()[_0x7d38('0x21')](function(){_0x181a5b[_0x7d38('0x16')](0xcc)[_0x7d38('0x17')]();});}};}function handleEntityNotFound(_0x488c70,_0x1ce8dd){return function(_0x54164c){if(!_0x54164c){_0x488c70[_0x7d38('0x22')](0x194);}return _0x54164c;};}function handleError(_0x1e8236,_0x1a5a4a){_0x1a5a4a=_0x1a5a4a||0x1f4;return function(_0x3aaa96){logger[_0x7d38('0x23')](_0x3aaa96[_0x7d38('0x24')]);if(_0x3aaa96['name']){delete _0x3aaa96[_0x7d38('0x25')];}_0x1e8236[_0x7d38('0x16')](_0x1a5a4a)['send'](_0x3aaa96);};}exports[_0x7d38('0x26')]=function(_0x676441,_0x36130c){var _0xd0d3a7={},_0x5a7580={},_0x4d6502={'count':0x0,'rows':[]};var _0x172856=_[_0x7d38('0x27')](db[_0x7d38('0x28')][_0x7d38('0x29')],function(_0x30a2e1){return{'name':_0x30a2e1[_0x7d38('0x2a')],'type':_0x30a2e1['type'][_0x7d38('0x2b')]};});_0x5a7580['model']=_['map'](_0x172856,_0x7d38('0x25'));_0x5a7580['query']=_[_0x7d38('0x2c')](_0x676441[_0x7d38('0x2d')]);_0x5a7580['filters']=_[_0x7d38('0x2e')](_0x5a7580[_0x7d38('0x2f')],_0x5a7580['query']);_0xd0d3a7[_0x7d38('0x30')]=_[_0x7d38('0x2e')](_0x5a7580['model'],qs[_0x7d38('0x31')](_0x676441[_0x7d38('0x2d')][_0x7d38('0x31')]));_0xd0d3a7[_0x7d38('0x30')]=_0xd0d3a7[_0x7d38('0x30')]['length']?_0xd0d3a7['attributes']:_0x5a7580[_0x7d38('0x2f')];if(!_0x676441['query'][_0x7d38('0x32')](_0x7d38('0x33'))){_0xd0d3a7['limit']=qs[_0x7d38('0x1b')](_0x676441[_0x7d38('0x2d')][_0x7d38('0x1b')]);_0xd0d3a7['offset']=qs[_0x7d38('0x19')](_0x676441[_0x7d38('0x2d')][_0x7d38('0x19')]);}_0xd0d3a7[_0x7d38('0x34')]=qs[_0x7d38('0x35')](_0x676441[_0x7d38('0x2d')]['sort']);_0xd0d3a7[_0x7d38('0x36')]=qs[_0x7d38('0x37')](_[_0x7d38('0x38')](_0x676441[_0x7d38('0x2d')],_0x5a7580[_0x7d38('0x37')]),_0x172856);if(_0x676441[_0x7d38('0x2d')]['filter']){_0xd0d3a7[_0x7d38('0x36')]=_[_0x7d38('0x39')](_0xd0d3a7[_0x7d38('0x36')],{'$or':_['map'](_0x172856,function(_0x371371){if(_0x371371['type']!==_0x7d38('0x3a')){var _0x526f81={};_0x526f81[_0x371371[_0x7d38('0x25')]]={'$like':'%'+_0x676441['query'][_0x7d38('0x3b')]+'%'};return _0x526f81;}})});}_0xd0d3a7=_[_0x7d38('0x39')]({},_0xd0d3a7,_0x676441['options']);var _0x4f8dd6={'where':_0xd0d3a7[_0x7d38('0x36')]};return db[_0x7d38('0x28')]['count'](_0x4f8dd6)['then'](function(_0x170d80){_0x4d6502[_0x7d38('0x1c')]=_0x170d80;if(_0x676441[_0x7d38('0x2d')]['includeAll']){_0xd0d3a7['include']=[{'all':!![]}];}return db['Attachment'][_0x7d38('0x3c')](_0xd0d3a7);})[_0x7d38('0x21')](function(_0x1d8a15){_0x4d6502[_0x7d38('0x3d')]=_0x1d8a15;return _0x4d6502;})[_0x7d38('0x21')](respondWithFilteredResult(_0x36130c,_0xd0d3a7))[_0x7d38('0x3e')](handleError(_0x36130c,null));};exports[_0x7d38('0x3f')]=function(_0x5a4834,_0x5c78a9){var _0xb1093a={'raw':!![],'where':{'id':_0x5a4834[_0x7d38('0x40')]['id']}},_0x20c1be={};_0x20c1be[_0x7d38('0x2f')]=_[_0x7d38('0x2c')](db[_0x7d38('0x28')][_0x7d38('0x29')]);_0x20c1be[_0x7d38('0x2d')]=_[_0x7d38('0x2c')](_0x5a4834[_0x7d38('0x2d')]);_0x20c1be['filters']=_['intersection'](_0x20c1be['model'],_0x20c1be['query']);_0xb1093a['attributes']=_['intersection'](_0x20c1be[_0x7d38('0x2f')],qs['fields'](_0x5a4834[_0x7d38('0x2d')][_0x7d38('0x31')]));_0xb1093a[_0x7d38('0x30')]=_0xb1093a[_0x7d38('0x30')]['length']?_0xb1093a[_0x7d38('0x30')]:_0x20c1be[_0x7d38('0x2f')];if(_0x5a4834['query'][_0x7d38('0x41')]){_0xb1093a[_0x7d38('0x42')]=[{'all':!![]}];}_0xb1093a=_[_0x7d38('0x39')]({},_0xb1093a,_0x5a4834[_0x7d38('0x43')]);return db[_0x7d38('0x28')][_0x7d38('0x44')](_0xb1093a)[_0x7d38('0x21')](handleEntityNotFound(_0x5c78a9,null))[_0x7d38('0x21')](respondWithResult(_0x5c78a9,null))[_0x7d38('0x3e')](handleError(_0x5c78a9,null));};exports['clone']=function(_0x25de27,_0x51d563){var _0x236ed9={'where':{'id':_0x25de27[_0x7d38('0x40')]['id']}},_0x371462={};_0x371462[_0x7d38('0x2f')]=_[_0x7d38('0x2c')](db[_0x7d38('0x28')][_0x7d38('0x29')]);_0x236ed9[_0x7d38('0x30')]=_[_0x7d38('0x2e')](_0x371462[_0x7d38('0x2f')],qs['fields'](_0x25de27[_0x7d38('0x2d')][_0x7d38('0x31')]));_0x236ed9[_0x7d38('0x30')]=_0x236ed9[_0x7d38('0x30')]['length']?_0x236ed9[_0x7d38('0x30')]:_0x371462[_0x7d38('0x2f')];if(_0x25de27[_0x7d38('0x2d')][_0x7d38('0x41')]){_0x236ed9[_0x7d38('0x42')]=[{'all':!![]}];}_0x236ed9=_[_0x7d38('0x39')]({},_0x236ed9,_0x25de27[_0x7d38('0x43')]);return db['Attachment'][_0x7d38('0x44')](_0x236ed9)[_0x7d38('0x21')](handleEntityNotFound(_0x51d563,null))[_0x7d38('0x21')](function(_0x5048cc){if(_0x5048cc){var _0x5b45a9=_0x5048cc[_0x7d38('0x45')]({'plain':!![]});_0x5b45a9=qs['omit'](_0x5b45a9,['id','createdAt',_0x7d38('0x46')]);_0x25de27[_0x7d38('0x47')]=_[_0x7d38('0x48')](_0x25de27[_0x7d38('0x47')],['id','createdAt',_0x7d38('0x46')]);return db[_0x7d38('0x28')][_0x7d38('0x49')](_['merge'](_0x5b45a9,_0x25de27[_0x7d38('0x47')]),{'include':_0x25de27[_0x7d38('0x2d')][_0x7d38('0x41')]?[{'all':!![]}]:undefined});}})[_0x7d38('0x21')](respondWithResult(_0x51d563,0xc9))[_0x7d38('0x3e')](handleError(_0x51d563,null));};exports[_0x7d38('0x20')]=function(_0x382a94,_0x3f287b){if(_0x382a94['body']['id']){delete _0x382a94['body']['id'];}return db[_0x7d38('0x28')][_0x7d38('0x44')]({'where':{'id':_0x382a94[_0x7d38('0x40')]['id']}})['then'](handleEntityNotFound(_0x3f287b,null))[_0x7d38('0x21')](saveUpdates(_0x382a94['body'],null))[_0x7d38('0x21')](respondWithResult(_0x3f287b,null))[_0x7d38('0x3e')](handleError(_0x3f287b,null));};exports['destroy']=function(_0x3e4145,_0x28be2a){return db[_0x7d38('0x28')][_0x7d38('0x44')]({'where':{'id':_0x3e4145[_0x7d38('0x40')]['id']}})[_0x7d38('0x21')](handleEntityNotFound(_0x28be2a,null))[_0x7d38('0x21')](removeEntity(_0x28be2a,null))[_0x7d38('0x3e')](handleError(_0x28be2a,null));};exports['create']=function(_0x1b92d6,_0x1c9e80,_0x27fb3c){_0x1b92d6['body']['name']=_0x1b92d6[_0x7d38('0x4a')][_0x7d38('0x4b')];_0x1b92d6[_0x7d38('0x47')][_0x7d38('0x4c')]=_0x1b92d6[_0x7d38('0x4a')][_0x7d38('0x4d')];_0x1b92d6[_0x7d38('0x47')][_0x7d38('0x4e')]=_0x1b92d6['file'][_0x7d38('0x4f')];return db['Attachment'][_0x7d38('0x49')](_0x1b92d6['body'])['then'](respondWithResult(_0x1c9e80,0xc9))[_0x7d38('0x3e')](handleError(_0x1c9e80,null));};exports[_0x7d38('0x50')]=function(_0x45d099,_0x2e3f0e,_0x5695a5){return db[_0x7d38('0x28')][_0x7d38('0x51')]({'where':{'id':_0x45d099[_0x7d38('0x40')]['id']},'raw':!![]})[_0x7d38('0x21')](handleEntityNotFound(_0x2e3f0e,null))['then'](function(_0x13d7c5){if(_0x13d7c5){var _0x4537af=_0x13d7c5[_0x7d38('0x52')]!==null;var _0x209053=path['join'](config[_0x7d38('0x53')],_0x7d38('0x54'));if(_0x4537af){_0x209053=path['join'](_0x209053,_0x7d38('0x55'));}var _0x311e62=path[_0x7d38('0x56')](_0x209053,_0x13d7c5[_0x7d38('0x4c')]);return _0x2e3f0e[_0x7d38('0x50')](_0x311e62);}})[_0x7d38('0x3e')](handleError(_0x2e3f0e,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 0679cc1..2a519f5 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 _0x8438=['./attachment.attributes','exports','define','attachments','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5292ed,_0x74bd26){var _0x2a2bc7=function(_0x5b3dbe){while(--_0x5b3dbe){_0x5292ed['push'](_0x5292ed['shift']());}};_0x2a2bc7(++_0x74bd26);}(_0x8438,0x13c));var _0x8843=function(_0xe94610,_0x2e3b8b){_0xe94610=_0xe94610-0x0;var _0x9b6f20=_0x8438[_0xe94610];return _0x9b6f20;};'use strict';var _=require(_0x8843('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8843('0x1'));var moment=require(_0x8843('0x2'));var BPromise=require(_0x8843('0x3'));var rp=require(_0x8843('0x4'));var fs=require('fs');var path=require(_0x8843('0x5'));var rimraf=require(_0x8843('0x6'));var config=require(_0x8843('0x7'));var attributes=require(_0x8843('0x8'));module[_0x8843('0x9')]=function(_0x5ee512,_0x213ddc){return _0x5ee512[_0x8843('0xa')]('Attachment',attributes,{'tableName':_0x8843('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4824=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x55ea33,_0x448c1e){var _0x3e4081=function(_0x290b02){while(--_0x290b02){_0x55ea33['push'](_0x55ea33['shift']());}};_0x3e4081(++_0x448c1e);}(_0x4824,0xd9));var _0x4482=function(_0x23ed50,_0x483c69){_0x23ed50=_0x23ed50-0x0;var _0x1eff7d=_0x4824[_0x23ed50];return _0x1eff7d;};'use strict';var _=require(_0x4482('0x0'));var util=require(_0x4482('0x1'));var logger=require(_0x4482('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4482('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4482('0x4'));var rimraf=require(_0x4482('0x5'));var config=require(_0x4482('0x6'));var attributes=require(_0x4482('0x7'));module['exports']=function(_0xa645fc,_0x3fe9fb){return _0xa645fc[_0x4482('0x8')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index d071351..b678bc8 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 _0x202c=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateAttachment','Attachment','options','raw','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x1e896c,_0x3f9948){var _0xd149d9=function(_0x3281e5){while(--_0x3281e5){_0x1e896c['push'](_0x1e896c['shift']());}};_0xd149d9(++_0x3f9948);}(_0x202c,0x178));var _0xc202=function(_0x5e5d33,_0x3f76f5){_0x5e5d33=_0x5e5d33-0x0;var _0x8d2331=_0x202c[_0x5e5d33];return _0x8d2331;};'use strict';var _=require(_0xc202('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc202('0x1'));var rs=require(_0xc202('0x2'));var fs=require('fs');var Redis=require(_0xc202('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc202('0x4'));var logger=require(_0xc202('0x5'))(_0xc202('0x6'));var config=require(_0xc202('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc202('0x8')][_0xc202('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59563a,_0xc2b3eb,_0x574549){return new BPromise(function(_0x872c1a,_0x5978fe){return client[_0xc202('0xa')](_0x59563a,_0x574549)[_0xc202('0xb')](function(_0x36fcb7){logger[_0xc202('0xc')](_0xc202('0xd'),_0xc2b3eb,_0xc202('0xe'));logger[_0xc202('0xf')](_0xc202('0x10'),_0xc2b3eb,_0xc202('0xe'),JSON[_0xc202('0x11')](_0x36fcb7));if(_0x36fcb7[_0xc202('0x12')]){if(_0x36fcb7['error'][_0xc202('0x13')]===0x1f4){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);return _0x5978fe(_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);}logger['error'](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')]['message']);return _0x872c1a(_0x36fcb7['error']['message']);}else{logger[_0xc202('0xc')]('Attachment,\x20%s,\x20%s',_0xc2b3eb,_0xc202('0xe'));_0x872c1a(_0x36fcb7['result'][_0xc202('0x14')]);}})[_0xc202('0x15')](function(_0x3018c8){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x3018c8);_0x5978fe(_0x3018c8);});});}exports[_0xc202('0x16')]=function(_0x9620a0){var _0x591ecc=this;return new Promise(function(_0x16ec7c,_0x2c5557){return db[_0xc202('0x17')]['create'](_0x9620a0['body'],{'raw':_0x9620a0[_0xc202('0x18')]?_0x9620a0[_0xc202('0x18')][_0xc202('0x19')]===undefined?!![]:![]:!![]})[_0xc202('0xb')](function(_0x2ae3c1){logger['info']('CreateAttachment',_0x9620a0);logger[_0xc202('0xf')]('CreateAttachment',_0x9620a0,JSON[_0xc202('0x11')](_0x2ae3c1));_0x16ec7c(_0x2ae3c1);})[_0xc202('0x15')](function(_0x56e979){logger['error'](_0xc202('0x16'),_0x56e979['message'],_0x9620a0);_0x2c5557(_0x591ecc[_0xc202('0x12')](0x1f4,_0x56e979[_0xc202('0x14')]));});});};
\ No newline at end of file
+var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','options','raw'];(function(_0x2f0bfc,_0x1e0d82){var _0x2e4ed1=function(_0x1f3821){while(--_0x1f3821){_0x2f0bfc['push'](_0x2f0bfc['shift']());}};_0x2e4ed1(++_0x1e0d82);}(_0x34e8,0x12c));var _0x834e=function(_0x39bd93,_0x1cd986){_0x39bd93=_0x39bd93-0x0;var _0x368ce7=_0x34e8[_0x39bd93];return _0x368ce7;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('Attachment,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('Attachment,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});}exports[_0x834e('0x19')]=function(_0x211e9a){var _0x34e41a=this;return new Promise(function(_0xb993a1,_0x237947){return db[_0x834e('0x1a')][_0x834e('0x1b')](_0x211e9a['body'],{'raw':_0x211e9a[_0x834e('0x1c')]?_0x211e9a[_0x834e('0x1c')][_0x834e('0x1d')]===undefined?!![]:![]:!![]})[_0x834e('0xd')](function(_0x4ab05d){logger[_0x834e('0xe')](_0x834e('0x19'),_0x211e9a);logger['debug'](_0x834e('0x19'),_0x211e9a,JSON[_0x834e('0x13')](_0x4ab05d));_0xb993a1(_0x4ab05d);})[_0x834e('0x18')](function(_0x5c55ca){logger['error'](_0x834e('0x19'),_0x5c55ca[_0x834e('0x16')],_0x211e9a);_0x237947(_0x34e41a['error'](0x1f4,_0x5c55ca[_0x834e('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 88f0783..346b227 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(_0x509e7f,_0x2d9f99){var _0x28a735=function(_0x1c080a){while(--_0x1c080a){_0x509e7f['push'](_0x509e7f['shift']());}};_0x28a735(++_0x2d9f99);}(_0xb10b,0x12a));var _0xbb10=function(_0x14eb9e,_0x29fe9e){_0x14eb9e=_0x14eb9e-0x0;var _0x4c59c4=_0xb10b[_0x14eb9e];return _0x4c59c4;};'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 _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x5891f6,_0x280aef){var _0x33114b=function(_0x580fd8){while(--_0x580fd8){_0x5891f6['push'](_0x5891f6['shift']());}};_0x33114b(++_0x280aef);}(_0x757a,0xde));var _0xa757=function(_0x18f693,_0x312616){_0x18f693=_0x18f693-0x0;var _0x13a5c9=_0x757a[_0x18f693];return _0x13a5c9;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 071b8b7..1e1e60b 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 _0x8ba5=['../../mysqldb','../../components/auth/service','../../config/logger','activedirectory','undefined','baseDN','url','domain','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','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','user','then','getLicense','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','util'];(function(_0x426bdf,_0x45f9be){var _0x5aad3a=function(_0x2ead03){while(--_0x2ead03){_0x426bdf['push'](_0x426bdf['shift']());}};_0x5aad3a(++_0x45f9be);}(_0x8ba5,0x1da));var _0x58ba=function(_0x2199db,_0x64fe69){_0x2199db=_0x2199db-0x0;var _0x1823bc=_0x8ba5[_0x2199db];return _0x1823bc;};'use strict';var passport=require(_0x58ba('0x0'));var LocalStrategy=require(_0x58ba('0x1'))[_0x58ba('0x2')];var moment=require(_0x58ba('0x3'));var ActiveDirectory=require(_0x58ba('0x4'));var BPromise=require('bluebird');var util=require(_0x58ba('0x5'));var db=require(_0x58ba('0x6'))['db'];var authService=require(_0x58ba('0x7'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0x58ba('0x8'))('api');function isActiveDirectoryConfigured(_0x4fb96e){var _0x48b43b=![];if(typeof _0x4fb96e[_0x58ba('0x9')]!==_0x58ba('0xa')){_0x48b43b=_0x4fb96e[_0x58ba('0x9')][_0x58ba('0xb')]&&_0x4fb96e['activedirectory'][_0x58ba('0xc')]&&_0x4fb96e['activedirectory'][_0x58ba('0xd')];}return _0x48b43b;}function adAuthenticate(_0x223b7e,_0x63c802,_0x5b1607){return new BPromise(function(_0x44bf4d,_0x57a2e5){try{var _0xfbe7f1=new ActiveDirectory(_0x223b7e);_0xfbe7f1['authenticate'](_0x63c802,_0x5b1607,function(_0x4ba989,_0x11aa55){if(_0x4ba989){logger[_0x58ba('0xe')]('Error\x20authenticate\x20%s:\x20%s',_0x63c802,util[_0x58ba('0xf')](_0x4ba989,{'showHidden':![],'depth':null}));_0x57a2e5(_0x58ba('0x10'));}else if(!_0x11aa55){logger[_0x58ba('0xe')](_0x58ba('0x11'),_0x63c802);_0x57a2e5(_0x58ba('0x10'));}else{_0x44bf4d(_0x11aa55);}});}catch(_0x5b6cc0){_0x57a2e5(_0x5b6cc0);}});}function ActiveDirectoryAuthenticate(_0x2be273,_0x235a5a,_0x4c5cd1,_0x43107d){var _0x3dbbdb,_0x464b8e;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x58ba('0x12'),_0x235a5a);return _0x43107d(null,![],{'message':_0x58ba('0x10')});}return db['Setting'][_0x58ba('0x13')]({'where':{'id':0x1},'attributes':[_0x58ba('0x14'),_0x58ba('0x15')],'raw':!![]})['then'](function(_0x5783de){_0x3dbbdb=_0x5783de;if(!_0x3dbbdb[_0x58ba('0x14')]){logger[_0x58ba('0xe')](_0x58ba('0x16'),_0x235a5a);throw new Error(_0x58ba('0x10'));}return _0x2be273[_0x58ba('0x13')]({'attributes':['id',_0x58ba('0x17'),_0x58ba('0x18'),_0x58ba('0x19'),_0x58ba('0x1a'),_0x58ba('0x1b'),_0x58ba('0x1c'),_0x58ba('0x1d'),_0x58ba('0x1e')],'where':{'name':_0x235a5a,'role':{'$or':['admin',_0x58ba('0x1f'),'agent']},'adSsoEnabled':!![]}});})[_0x58ba('0x20')](function(_0x78c779){if(!_0x78c779||_0x78c779&&_0x78c779[_0x58ba('0x17')]!==_0x235a5a){throw new Error(_0x58ba('0x10'));}_0x464b8e=_0x78c779;var _0x3d8b11=_0x464b8e[_0x58ba('0x17')]+'@'+config['activedirectory'][_0x58ba('0xd')];return adAuthenticate(config['activedirectory'],_0x3d8b11,_0x4c5cd1);})[_0x58ba('0x20')](function(_0x56d333){if(_0x464b8e[_0x58ba('0x1b')]){throw new Error(_0x58ba('0x10'));}if(_0x3dbbdb[_0x58ba('0x15')]>0x0){if(_0x464b8e[_0x58ba('0x1c')]){if(moment(_0x464b8e[_0x58ba('0x1d')])['add'](_0x3dbbdb[_0x58ba('0x15')],'minutes')>moment()){throw new Error(_0x58ba('0x10'));}return utils['clearBlockUser'](_0x464b8e,0x0,![],null)[_0x58ba('0x20')](function(){return utils['getLicense'](_0x464b8e);})[_0x58ba('0x20')](function(){return _0x43107d(null,_0x464b8e);});}else{return utils[_0x58ba('0x21')](_0x464b8e)[_0x58ba('0x20')](function(){return _0x43107d(null,_0x464b8e);});}}else{return utils[_0x58ba('0x21')](_0x464b8e)['then'](function(){return _0x43107d(null,_0x464b8e);});}})['catch'](function(_0x13e87b){return _0x43107d(null,![],_0x13e87b);});}function handleError(_0x596236,_0x30238b,_0x14cf8a){return _0x596236['status'](_0x30238b||0x1f4)['send']({'message':_0x14cf8a?_0x14cf8a['message']||_0x14cf8a:''});}exports['login']=function(_0x7d7698,_0x157ed0,_0x40fa38){passport[_0x58ba('0x22')](_0x58ba('0x23'),function(_0x447638,_0x4abae0,_0x50c59e){var _0x4651fa=_0x447638||_0x50c59e;if(_0x4651fa){return handleError(_0x157ed0,0x191,_0x4651fa);}if(!_0x4abae0){return handleError(_0x157ed0,0x194,{'message':_0x58ba('0x24')});}else{var _0x36714c={'payload':{'id':_0x4abae0['id'],'role':_0x4abae0[_0x58ba('0x1a')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x36714c)['then'](function(_0x3cd688){_0x157ed0[_0x58ba('0x25')]({'id':_0x4abae0['id'],'token':_0x3cd688,'statusCall':'','isAlreadyLogged':_0x4abae0[_0x58ba('0x1e')]});});}})(_0x7d7698,_0x157ed0,_0x40fa38);};passport[_0x58ba('0x26')](_0x58ba('0x23'),new LocalStrategy({'usernameField':'name','passwordField':_0x58ba('0x18')},function(_0x13aefd,_0x288d61,_0x3bbb99){return ActiveDirectoryAuthenticate(db[_0x58ba('0x27')],_0x13aefd,_0x288d61,_0x3bbb99);}));
\ No newline at end of file
+var _0x697e=['status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','ad-login','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/environment','activedirectory','undefined','baseDN','url','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','admin','agent','domain','blockedAt','clearBlockUser','getLicense','catch'];(function(_0x2a5bc6,_0x4f72e3){var _0x22348a=function(_0x4bb6a6){while(--_0x4bb6a6){_0x2a5bc6['push'](_0x2a5bc6['shift']());}};_0x22348a(++_0x4f72e3);}(_0x697e,0x178));var _0xe697=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x697e[_0x20a584];return _0x4b41a8;};'use strict';var passport=require(_0xe697('0x0'));var LocalStrategy=require(_0xe697('0x1'))[_0xe697('0x2')];var moment=require(_0xe697('0x3'));var ActiveDirectory=require(_0xe697('0x4'));var BPromise=require(_0xe697('0x5'));var util=require(_0xe697('0x6'));var db=require(_0xe697('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require(_0xe697('0x8'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x4908df){var _0x2cfd52=![];if(typeof _0x4908df[_0xe697('0x9')]!==_0xe697('0xa')){_0x2cfd52=_0x4908df['activedirectory'][_0xe697('0xb')]&&_0x4908df[_0xe697('0x9')][_0xe697('0xc')]&&_0x4908df[_0xe697('0x9')]['domain'];}return _0x2cfd52;}function adAuthenticate(_0x5c845d,_0x33787b,_0x713797){return new BPromise(function(_0x390a7a,_0x53daef){try{var _0x341b76=new ActiveDirectory(_0x5c845d);_0x341b76[_0xe697('0xd')](_0x33787b,_0x713797,function(_0x1bc10e,_0x4286ef){if(_0x1bc10e){logger['error'](_0xe697('0xe'),_0x33787b,util[_0xe697('0xf')](_0x1bc10e,{'showHidden':![],'depth':null}));_0x53daef(_0xe697('0x10'));}else if(!_0x4286ef){logger['error'](_0xe697('0x11'),_0x33787b);_0x53daef(_0xe697('0x10'));}else{_0x390a7a(_0x4286ef);}});}catch(_0x142140){_0x53daef(_0x142140);}});}function ActiveDirectoryAuthenticate(_0x2abd5d,_0x25cc29,_0x31a514,_0x203e48){var _0x12128d,_0x5ce42c;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xe697('0x12'),_0x25cc29);return _0x203e48(null,![],{'message':_0xe697('0x10')});}return db[_0xe697('0x13')][_0xe697('0x14')]({'where':{'id':0x1},'attributes':[_0xe697('0x15'),_0xe697('0x16')],'raw':!![]})[_0xe697('0x17')](function(_0x37f417){_0x12128d=_0x37f417;if(!_0x12128d[_0xe697('0x15')]){logger['error'](_0xe697('0x18'),_0x25cc29);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x2abd5d['findOne']({'attributes':['id',_0xe697('0x19'),_0xe697('0x1a'),_0xe697('0x1b'),_0xe697('0x1c'),_0xe697('0x1d'),_0xe697('0x1e'),'blockedAt','online'],'where':{'name':_0x25cc29,'role':{'$or':[_0xe697('0x1f'),'user',_0xe697('0x20')]},'adSsoEnabled':!![]}});})['then'](function(_0x26b78d){if(!_0x26b78d||_0x26b78d&&_0x26b78d[_0xe697('0x19')]!==_0x25cc29){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x5ce42c=_0x26b78d;var _0xfd7965=_0x5ce42c[_0xe697('0x19')]+'@'+config[_0xe697('0x9')][_0xe697('0x21')];return adAuthenticate(config['activedirectory'],_0xfd7965,_0x31a514);})[_0xe697('0x17')](function(_0x15746f){if(_0x5ce42c[_0xe697('0x1d')]){throw new Error(_0xe697('0x10'));}if(_0x12128d[_0xe697('0x16')]>0x0){if(_0x5ce42c[_0xe697('0x1e')]){if(moment(_0x5ce42c[_0xe697('0x22')])['add'](_0x12128d[_0xe697('0x16')],'minutes')>moment()){throw new Error(_0xe697('0x10'));}return utils[_0xe697('0x23')](_0x5ce42c,0x0,![],null)[_0xe697('0x17')](function(){return utils['getLicense'](_0x5ce42c);})[_0xe697('0x17')](function(){return _0x203e48(null,_0x5ce42c);});}else{return utils[_0xe697('0x24')](_0x5ce42c)[_0xe697('0x17')](function(){return _0x203e48(null,_0x5ce42c);});}}else{return utils['getLicense'](_0x5ce42c)[_0xe697('0x17')](function(){return _0x203e48(null,_0x5ce42c);});}})[_0xe697('0x25')](function(_0x120230){return _0x203e48(null,![],_0x120230);});}function handleError(_0x17e16e,_0x522236,_0x1e9817){return _0x17e16e[_0xe697('0x26')](_0x522236||0x1f4)[_0xe697('0x27')]({'message':_0x1e9817?_0x1e9817[_0xe697('0x28')]||_0x1e9817:''});}exports[_0xe697('0x29')]=function(_0x117bc4,_0x50e40f,_0x22ff8c){passport[_0xe697('0xd')]('ad-login',function(_0x570ae1,_0x4c9381,_0x57840e){var _0x1e8574=_0x570ae1||_0x57840e;if(_0x1e8574){return handleError(_0x50e40f,0x191,_0x1e8574);}if(!_0x4c9381){return handleError(_0x50e40f,0x194,{'message':_0xe697('0x2a')});}else{var _0x1f2f1c={'payload':{'id':_0x4c9381['id'],'role':_0x4c9381['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1f2f1c)[_0xe697('0x17')](function(_0x2ddec3){_0x50e40f['json']({'id':_0x4c9381['id'],'token':_0x2ddec3,'statusCall':'','isAlreadyLogged':_0x4c9381[_0xe697('0x2b')]});});}})(_0x117bc4,_0x50e40f,_0x22ff8c);};passport['use'](_0xe697('0x2c'),new LocalStrategy({'usernameField':_0xe697('0x19'),'passwordField':_0xe697('0x1a')},function(_0x2bb42e,_0x3927d1,_0x5fdd92){return ActiveDirectoryAuthenticate(db[_0xe697('0x2d')],_0x2bb42e,_0x3927d1,_0x5fdd92);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 0c29f7d..e61e5c3 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 _0xace5=['login','exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xace5,0x1ca));var _0x5ace=function(_0x55bb3e,_0x55846c){_0x55bb3e=_0x55bb3e-0x0;var _0x335c3f=_0xace5[_0x55bb3e];return _0x335c3f;};'use strict';var express=require(_0x5ace('0x0'));var router=express[_0x5ace('0x1')]();var controller=require(_0x5ace('0x2'));router[_0x5ace('0x3')]('/',controller[_0x5ace('0x4')]);module[_0x5ace('0x5')]=router;
\ No newline at end of file
+var _0x8202=['./authActiveDirectory.controller','post','login','exports','express'];(function(_0x5d9af0,_0x52930a){var _0x23ac2d=function(_0x35cdb6){while(--_0x35cdb6){_0x5d9af0['push'](_0x5d9af0['shift']());}};_0x23ac2d(++_0x52930a);}(_0x8202,0x1e9));var _0x2820=function(_0xf0abca,_0x23ccaf){_0xf0abca=_0xf0abca-0x0;var _0x242f10=_0x8202[_0xf0abca];return _0x242f10;};'use strict';var express=require(_0x2820('0x0'));var router=express['Router']();var controller=require(_0x2820('0x1'));router[_0x2820('0x2')]('/',controller[_0x2820('0x3')]);module[_0x2820('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 27a5829..8a4efee 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x3840fc,_0x403990){var _0x1af7ae=function(_0x4153b3){while(--_0x4153b3){_0x3840fc['push'](_0x3840fc['shift']());}};_0x1af7ae(++_0x403990);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x428029,_0x1a5eb3){var _0x52033a=function(_0x5d73a8){while(--_0x5d73a8){_0x428029['push'](_0x428029['shift']());}};_0x52033a(++_0x1a5eb3);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 6cfd8e6..c397e3b 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 _0xb555=['exports','express','passport','Router','./authGoogle.controller','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie'];(function(_0x5d8c9a,_0x5858ea){var _0x45d9a5=function(_0x506850){while(--_0x506850){_0x5d8c9a['push'](_0x5d8c9a['shift']());}};_0x45d9a5(++_0x5858ea);}(_0xb555,0xe5));var _0x5b55=function(_0x4d0b53,_0xb4d39a){_0x4d0b53=_0x4d0b53-0x0;var _0x3638db=_0xb555[_0x4d0b53];return _0x3638db;};'use strict';var express=require(_0x5b55('0x0'));var passport=require(_0x5b55('0x1'));var router=express[_0x5b55('0x2')]();var controller=require(_0x5b55('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x5b55('0x4'));router[_0x5b55('0x5')]('/',controller[_0x5b55('0x6')]);router[_0x5b55('0x5')](_0x5b55('0x7'),controller[_0x5b55('0x8')],authService[_0x5b55('0x9')],userController['login'],authService[_0x5b55('0xa')]);module[_0x5b55('0xb')]=router;
\ No newline at end of file
+var _0xb879=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','setTokenCookie','exports','Router'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb879,0x15d));var _0x9b87=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xb879[_0x1694f5];return _0x5b4321;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0x9b87('0x0')]();var controller=require(_0x9b87('0x1'));var userController=require(_0x9b87('0x2'));var authService=require(_0x9b87('0x3'));router['get']('/',controller[_0x9b87('0x4')]);router[_0x9b87('0x5')](_0x9b87('0x6'),controller[_0x9b87('0x7')],authService['isMiddleware'],userController[_0x9b87('0x4')],authService[_0x9b87('0x8')]);module[_0x9b87('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 cbb788a..9cad76b 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 _0x9d27=['signToken','json','online','generate','trim','toLowerCase','User','body','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','password','enforcePasswordHistory','validatePasswordHistory','previousPasswords','passwordHistoryLimit','use','util','passport','jayson/promise','randomstring','moment','../../components/auth/service','../../config/utils','client','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','salt','role','disabled','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','email','Smtp','user','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.'];(function(_0xe19c82,_0x2e9ec9){var _0x60433d=function(_0xaf76a7){while(--_0xaf76a7){_0xe19c82['push'](_0xe19c82['shift']());}};_0x60433d(++_0x2e9ec9);}(_0x9d27,0xcd));var _0x79d2=function(_0x34b6aa,_0x5ddd29){_0x34b6aa=_0x34b6aa-0x0;var _0x3ead29=_0x9d27[_0x34b6aa];return _0x3ead29;};'use strict';var util=require(_0x79d2('0x0'));var passport=require(_0x79d2('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x79d2('0x2'));var _=require('lodash');var rs=require(_0x79d2('0x3'));var moment=require(_0x79d2('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x79d2('0x5'));var utils=require(_0x79d2('0x6'));var client=jayson[_0x79d2('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x221af7,_0x2fe8fc,_0x5c5720,_0x36a09a){var _0x3b521c,_0x24f06c;return db[_0x79d2('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0x79d2('0x9'),_0x79d2('0xa')],'raw':!![]})[_0x79d2('0xb')](function(_0x7b01fa){_0x3b521c=_0x7b01fa;return _0x221af7[_0x79d2('0xc')]({'attributes':['id',_0x79d2('0xd'),'password',_0x79d2('0xe'),_0x79d2('0xf'),_0x79d2('0x10'),'blocked',_0x79d2('0x11'),_0x79d2('0x12')],'where':{'name':_0x2fe8fc,'role':{'$or':[_0x79d2('0x13'),'user',_0x79d2('0x14')]}}});})[_0x79d2('0xb')](function(_0x309c02){if(!_0x309c02||_0x309c02&&_0x309c02[_0x79d2('0xd')]!==_0x2fe8fc){throw new Error(_0x79d2('0x15'));}else{_0x24f06c=_0x309c02;return _0x24f06c;}})['then'](function(){_0x24f06c[_0x79d2('0x16')](_0x5c5720,function(_0xd283c9,_0x563461){var _0x569e33=_0x24f06c[_0x79d2('0x12')]+0x1;if(_0xd283c9){return _0x36a09a(_0xd283c9);}else if(!_0x563461){if(_0x24f06c['disabled']){return _0x36a09a(null,![],{'message':_0x79d2('0x15')});}else if(_0x3b521c[_0x79d2('0x9')]>0x0){if(_0x24f06c[_0x79d2('0x17')]){if(_0x3b521c[_0x79d2('0xa')]>0x0){if(moment(_0x24f06c['blockedAt'])[_0x79d2('0x18')](_0x3b521c[_0x79d2('0xa')],_0x79d2('0x19'))>moment()){return _0x36a09a(null,![],{'message':_0x79d2('0x15')});}else{return utils[_0x79d2('0x1a')](_0x24f06c,_0x569e33,![],null)[_0x79d2('0xb')](function(){return _0x36a09a(null,![],{'message':_0x79d2('0x15')});});}}else{return _0x36a09a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x569e33>=_0x3b521c[_0x79d2('0x9')]){return utils['clearBlockUser'](_0x24f06c,0x0,!![],moment())[_0x79d2('0xb')](function(){return _0x36a09a(null,![],{'message':_0x79d2('0x15')});});}else{return utils[_0x79d2('0x1a')](_0x24f06c,_0x569e33,![],null)[_0x79d2('0xb')](function(){return _0x36a09a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x36a09a(null,![],{'message':_0x79d2('0x15')});}}else{if(_0x24f06c[_0x79d2('0x10')]){return _0x36a09a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3b521c[_0x79d2('0x9')]>0x0){if(_0x24f06c[_0x79d2('0x17')]){if(_0x3b521c[_0x79d2('0xa')]>0x0){if(moment(_0x24f06c['blockedAt'])[_0x79d2('0x18')](_0x3b521c[_0x79d2('0xa')],_0x79d2('0x19'))>moment()){return _0x36a09a(null,![],{'message':_0x79d2('0x15')});}else{return utils[_0x79d2('0x1a')](_0x24f06c,0x0,![],null)['then'](function(){return utils[_0x79d2('0x1b')](_0x24f06c);})['then'](function(){return _0x36a09a(null,_0x24f06c);});}}else{return _0x36a09a(null,![],{'message':_0x79d2('0x15')});}}else{return utils[_0x79d2('0x1a')](_0x24f06c,0x0,![],null)[_0x79d2('0xb')](function(){return utils[_0x79d2('0x1b')](_0x24f06c);})[_0x79d2('0xb')](function(){return _0x36a09a(null,_0x24f06c);})[_0x79d2('0x1c')](function(_0x59382d){return _0x36a09a(null,![],_0x59382d);});}}else{if(_0x24f06c[_0x79d2('0x17')]){return _0x36a09a(null,![],{'message':_0x79d2('0x15')});}else{return utils[_0x79d2('0x1b')](_0x24f06c)['then'](function(){return _0x36a09a(null,_0x24f06c);});}}}});})[_0x79d2('0x1c')](function(_0x2280eb){return _0x36a09a(null,![],_0x2280eb);});}function sendServiceMail(_0x4f4407){return db[_0x79d2('0x1d')][_0x79d2('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x79d2('0xd'),'email'],'include':[{'model':db[_0x79d2('0x1f')],'as':'Smtp','include':[{'model':db[_0x79d2('0x20')],'as':_0x79d2('0x20')}]}]})['then'](function(_0xcc1d80){if(!_0xcc1d80){throw new Error(_0x79d2('0x21'));}var _0x4bc086=_0xcc1d80[_0x79d2('0x22')]();var _0x583655={'account':_0x4bc086,'message':_[_0x79d2('0x23')]({'from':util[_0x79d2('0x24')]('\x22%s\x22\x20<%s>',_0xcc1d80[_0x79d2('0xd')],_0xcc1d80[_0x79d2('0x25')]||_0xcc1d80[_0x79d2('0x26')][_0x79d2('0x27')])},_0x4f4407)};return client['request'](_0x79d2('0x28'),_0x583655);})[_0x79d2('0xb')](function(_0xae6f26){if(_0xae6f26[_0x79d2('0x29')]){throw new Error(util[_0x79d2('0x24')](_0x79d2('0x2a'),_0xae6f26['error'][_0x79d2('0x2b')]||JSON[_0x79d2('0x2c')](_0xae6f26[_0x79d2('0x29')])));}return!![];});}function handleError(_0x46d06b,_0x141569,_0x4ce9eb){return _0x46d06b[_0x79d2('0x2d')](_0x141569||0x1f4)[_0x79d2('0x2e')]({'message':_0x4ce9eb?_0x4ce9eb['message']||_0x4ce9eb:''});}exports[_0x79d2('0x2f')]=function(_0x2f0c6b,_0x1e02d6,_0x5dc7d6){passport[_0x79d2('0x16')](_0x79d2('0x30'),function(_0x20ce31,_0x867957,_0x5a6c53){var _0x575511=_0x20ce31||_0x5a6c53;if(_0x575511){return handleError(_0x1e02d6,0x191,_0x575511);}if(!_0x867957){return handleError(_0x1e02d6,0x194,{'message':_0x79d2('0x31')});}else{var _0x176d74={'payload':{'id':_0x867957['id'],'role':_0x867957[_0x79d2('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x79d2('0x32')](_0x176d74)[_0x79d2('0xb')](function(_0x1261c5){_0x1e02d6[_0x79d2('0x33')]({'id':_0x867957['id'],'token':_0x1261c5,'statusCall':'','isAlreadyLogged':_0x867957[_0x79d2('0x34')]});});}})(_0x2f0c6b,_0x1e02d6,_0x5dc7d6);};exports['forgot']=function(_0x183da7,_0x2470a5){if(!_0x183da7['body'][_0x79d2('0x25')]){return handleError(_0x2470a5,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x4141c8=rs[_0x79d2('0x35')]();_0x183da7['body']['email']=_0x183da7['body'][_0x79d2('0x25')][_0x79d2('0x36')]()[_0x79d2('0x37')]();var _0x510a2b;return db[_0x79d2('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0x79d2('0x9'),_0x79d2('0xa')],'raw':!![]})['then'](function(_0x27a339){_0x510a2b=_0x27a339;return db[_0x79d2('0x38')][_0x79d2('0x1e')]({'where':{'email':_0x183da7[_0x79d2('0x39')]['email']}});})['then'](function(_0x364353){if(!_0x364353){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x364353[_0x79d2('0x10')]){throw new Error(_0x79d2('0x3a'));}if(_0x364353[_0x79d2('0x17')]){if(moment(_0x364353[_0x79d2('0x11')])[_0x79d2('0x18')](_0x510a2b[_0x79d2('0xa')],'minutes')>moment()){throw new Error(_0x79d2('0x3b'));}else{_0x364353[_0x79d2('0x17')]=![];_0x364353[_0x79d2('0x11')]=null;}}_0x364353[_0x79d2('0x3c')]=_0x4141c8;_0x364353[_0x79d2('0x3d')]=Date[_0x79d2('0x3e')]()+0x36ee80;return _0x364353[_0x79d2('0x3f')]();})[_0x79d2('0xb')](function(){return sendServiceMail({'to':_0x183da7[_0x79d2('0x39')][_0x79d2('0x25')],'subject':_0x79d2('0x40'),'text':_0x79d2('0x41')+_0x79d2('0x42')+_0x79d2('0x43')+_0x183da7[_0x79d2('0x44')][_0x79d2('0x45')]+_0x79d2('0x46')+_0x4141c8+'\x0a\x0a'+_0x79d2('0x47')});})[_0x79d2('0xb')](function(){_0x2470a5['status'](0xc8)[_0x79d2('0x2e')]({'message':_0x79d2('0x48')});})[_0x79d2('0x1c')](function(_0x382434){return handleError(_0x2470a5,0x1f4,_0x382434);});};exports[_0x79d2('0x49')]=function(_0x43994c,_0x56586d){return db['User'][_0x79d2('0x1e')]({'where':{'resetPasswordToken':_0x43994c[_0x79d2('0x4a')][_0x79d2('0x4b')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x79d2('0xb')](function(_0x5e9171){if(!_0x5e9171){throw new Error(_0x79d2('0x4c'));}return db[_0x79d2('0x8')][_0x79d2('0xc')]({'attributes':['id',_0x79d2('0x4d'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x79d2('0xb')](function(_0x9bf9c2){if(_0x9bf9c2[_0x79d2('0x4d')])authService[_0x79d2('0x4e')](_0x43994c[_0x79d2('0x39')][_0x79d2('0x4f')]);if(!_0x9bf9c2[_0x79d2('0x50')]||!_0x5e9171['previousPasswords'])return _0x5e9171;authService[_0x79d2('0x51')](_0x43994c[_0x79d2('0x39')][_0x79d2('0x4f')],_0x5e9171[_0x79d2('0x52')],_0x9bf9c2[_0x79d2('0x53')]);return _0x5e9171;})['then'](function(){_0x5e9171[_0x79d2('0x4f')]=_0x43994c['body'][_0x79d2('0x4f')];_0x5e9171[_0x79d2('0x3c')]=null;_0x5e9171['resetPasswordExpires']=null;return _0x5e9171[_0x79d2('0x3f')]();});})[_0x79d2('0xb')](function(){_0x56586d['status'](0xc8)[_0x79d2('0x2e')]({'message':'Password\x20reset!'});})['catch'](function(_0x7ba7aa){return handleError(_0x56586d,0x1f4,_0x7ba7aa);});};passport[_0x79d2('0x54')](_0x79d2('0x30'),new LocalStrategy({'usernameField':_0x79d2('0xd'),'passwordField':'password'},function(_0x10b13f,_0x2186de,_0x2fb732){return localAuthenticate(db[_0x79d2('0x38')],_0x10b13f,_0x2186de,_0x2fb732);}));
\ No newline at end of file
+var _0xa5b9=['CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','request','error','format','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','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','https://','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','use','local-login','util','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','then','findOne','name','password','salt','role','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','disabled','blockDuration','add','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','Smtp'];(function(_0x15c5b8,_0x3b670f){var _0xd45fe6=function(_0x15a775){while(--_0x15a775){_0x15c5b8['push'](_0x15c5b8['shift']());}};_0xd45fe6(++_0x3b670f);}(_0xa5b9,0x1cc));var _0x9a5b=function(_0x41ba8c,_0x304ef3){_0x41ba8c=_0x41ba8c-0x0;var _0x5245fa=_0xa5b9[_0x41ba8c];return _0x5245fa;};'use strict';var util=require(_0x9a5b('0x0'));var passport=require('passport');var LocalStrategy=require(_0x9a5b('0x1'))['Strategy'];var jayson=require(_0x9a5b('0x2'));var _=require(_0x9a5b('0x3'));var rs=require(_0x9a5b('0x4'));var moment=require(_0x9a5b('0x5'));var db=require(_0x9a5b('0x6'))['db'];var authService=require(_0x9a5b('0x7'));var utils=require(_0x9a5b('0x8'));var client=jayson[_0x9a5b('0x9')][_0x9a5b('0xa')]({'port':0x232b});function localAuthenticate(_0x302ada,_0x599918,_0x4b80a1,_0x34a315){var _0x25a525,_0xd1737a;return db[_0x9a5b('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x9a5b('0xc'),'blockDuration'],'raw':!![]})[_0x9a5b('0xd')](function(_0x413d4c){_0x25a525=_0x413d4c;return _0x302ada[_0x9a5b('0xe')]({'attributes':['id',_0x9a5b('0xf'),_0x9a5b('0x10'),_0x9a5b('0x11'),_0x9a5b('0x12'),'disabled',_0x9a5b('0x13'),_0x9a5b('0x14'),'loginAttempts'],'where':{'name':_0x599918,'role':{'$or':[_0x9a5b('0x15'),_0x9a5b('0x16'),_0x9a5b('0x17')]}}});})[_0x9a5b('0xd')](function(_0x3f8e55){if(!_0x3f8e55||_0x3f8e55&&_0x3f8e55[_0x9a5b('0xf')]!==_0x599918){throw new Error(_0x9a5b('0x18'));}else{_0xd1737a=_0x3f8e55;return _0xd1737a;}})['then'](function(){_0xd1737a[_0x9a5b('0x19')](_0x4b80a1,function(_0x2aa4bc,_0x1d9d2a){var _0x2385d2=_0xd1737a[_0x9a5b('0x1a')]+0x1;if(_0x2aa4bc){return _0x34a315(_0x2aa4bc);}else if(!_0x1d9d2a){if(_0xd1737a[_0x9a5b('0x1b')]){return _0x34a315(null,![],{'message':_0x9a5b('0x18')});}else if(_0x25a525['allowedLoginAttempts']>0x0){if(_0xd1737a[_0x9a5b('0x13')]){if(_0x25a525[_0x9a5b('0x1c')]>0x0){if(moment(_0xd1737a[_0x9a5b('0x14')])[_0x9a5b('0x1d')](_0x25a525[_0x9a5b('0x1c')],_0x9a5b('0x1e'))>moment()){return _0x34a315(null,![],{'message':_0x9a5b('0x18')});}else{return utils[_0x9a5b('0x1f')](_0xd1737a,_0x2385d2,![],null)[_0x9a5b('0xd')](function(){return _0x34a315(null,![],{'message':_0x9a5b('0x18')});});}}else{return _0x34a315(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2385d2>=_0x25a525[_0x9a5b('0xc')]){return utils[_0x9a5b('0x1f')](_0xd1737a,0x0,!![],moment())[_0x9a5b('0xd')](function(){return _0x34a315(null,![],{'message':_0x9a5b('0x18')});});}else{return utils[_0x9a5b('0x1f')](_0xd1737a,_0x2385d2,![],null)[_0x9a5b('0xd')](function(){return _0x34a315(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x34a315(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xd1737a[_0x9a5b('0x1b')]){return _0x34a315(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x25a525[_0x9a5b('0xc')]>0x0){if(_0xd1737a[_0x9a5b('0x13')]){if(_0x25a525['blockDuration']>0x0){if(moment(_0xd1737a[_0x9a5b('0x14')])[_0x9a5b('0x1d')](_0x25a525[_0x9a5b('0x1c')],_0x9a5b('0x1e'))>moment()){return _0x34a315(null,![],{'message':_0x9a5b('0x18')});}else{return utils[_0x9a5b('0x1f')](_0xd1737a,0x0,![],null)['then'](function(){return utils['getLicense'](_0xd1737a);})[_0x9a5b('0xd')](function(){return _0x34a315(null,_0xd1737a);});}}else{return _0x34a315(null,![],{'message':_0x9a5b('0x18')});}}else{return utils['clearBlockUser'](_0xd1737a,0x0,![],null)[_0x9a5b('0xd')](function(){return utils[_0x9a5b('0x20')](_0xd1737a);})[_0x9a5b('0xd')](function(){return _0x34a315(null,_0xd1737a);})[_0x9a5b('0x21')](function(_0x33eebe){return _0x34a315(null,![],_0x33eebe);});}}else{if(_0xd1737a[_0x9a5b('0x13')]){return _0x34a315(null,![],{'message':_0x9a5b('0x18')});}else{return utils['getLicense'](_0xd1737a)[_0x9a5b('0xd')](function(){return _0x34a315(null,_0xd1737a);});}}}});})['catch'](function(_0x17a7dc){return _0x34a315(null,![],_0x17a7dc);});}function sendServiceMail(_0x2e9038){return db['MailAccount'][_0x9a5b('0x22')]({'where':{'service':!![]},'attributes':['id',_0x9a5b('0xf'),_0x9a5b('0x23')],'include':[{'model':db[_0x9a5b('0x24')],'as':_0x9a5b('0x25'),'include':[{'model':db['CloudProvider'],'as':_0x9a5b('0x26')}]}]})['then'](function(_0x2a3f65){if(!_0x2a3f65){throw new Error(_0x9a5b('0x27'));}var _0xdea8b7=_0x2a3f65[_0x9a5b('0x28')]();var _0x37a49d={'account':_0xdea8b7,'message':_[_0x9a5b('0x29')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x2a3f65[_0x9a5b('0xf')],_0x2a3f65['email']||_0x2a3f65['Smtp'][_0x9a5b('0x16')])},_0x2e9038)};return client[_0x9a5b('0x2a')]('SendMail',_0x37a49d);})[_0x9a5b('0xd')](function(_0x66f609){if(_0x66f609[_0x9a5b('0x2b')]){throw new Error(util[_0x9a5b('0x2c')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x66f609[_0x9a5b('0x2b')][_0x9a5b('0x2d')]||JSON[_0x9a5b('0x2e')](_0x66f609[_0x9a5b('0x2b')])));}return!![];});}function handleError(_0x5d17ef,_0x13875f,_0x9fe6dd){return _0x5d17ef[_0x9a5b('0x2f')](_0x13875f||0x1f4)[_0x9a5b('0x30')]({'message':_0x9fe6dd?_0x9fe6dd[_0x9a5b('0x2d')]||_0x9fe6dd:''});}exports[_0x9a5b('0x31')]=function(_0x1fda88,_0x502b72,_0x220f9d){passport[_0x9a5b('0x19')]('local-login',function(_0x2f8704,_0x47a295,_0x42b818){var _0x5ec66c=_0x2f8704||_0x42b818;if(_0x5ec66c){return handleError(_0x502b72,0x191,_0x5ec66c);}if(!_0x47a295){return handleError(_0x502b72,0x194,{'message':_0x9a5b('0x32')});}else{var _0x7c7b1d={'payload':{'id':_0x47a295['id'],'role':_0x47a295[_0x9a5b('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x9a5b('0x33')](_0x7c7b1d)[_0x9a5b('0xd')](function(_0x3288e0){_0x502b72[_0x9a5b('0x34')]({'id':_0x47a295['id'],'token':_0x3288e0,'statusCall':'','isAlreadyLogged':_0x47a295[_0x9a5b('0x35')]});});}})(_0x1fda88,_0x502b72,_0x220f9d);};exports[_0x9a5b('0x36')]=function(_0x376872,_0x23670e){if(!_0x376872[_0x9a5b('0x37')][_0x9a5b('0x23')]){return handleError(_0x23670e,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xa1faf8=rs['generate']();_0x376872[_0x9a5b('0x37')][_0x9a5b('0x23')]=_0x376872[_0x9a5b('0x37')]['email'][_0x9a5b('0x38')]()[_0x9a5b('0x39')]();var _0x107a20;return db[_0x9a5b('0xb')][_0x9a5b('0xe')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x9a5b('0x1c')],'raw':!![]})[_0x9a5b('0xd')](function(_0x2d03e2){_0x107a20=_0x2d03e2;return db[_0x9a5b('0x3a')][_0x9a5b('0x22')]({'where':{'email':_0x376872[_0x9a5b('0x37')]['email']}});})[_0x9a5b('0xd')](function(_0x101848){if(!_0x101848){throw new Error(_0x9a5b('0x3b'));}if(_0x101848[_0x9a5b('0x1b')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x101848['blocked']){if(moment(_0x101848[_0x9a5b('0x14')])[_0x9a5b('0x1d')](_0x107a20['blockDuration'],_0x9a5b('0x1e'))>moment()){throw new Error(_0x9a5b('0x3c'));}else{_0x101848['blocked']=![];_0x101848[_0x9a5b('0x14')]=null;}}_0x101848[_0x9a5b('0x3d')]=_0xa1faf8;_0x101848[_0x9a5b('0x3e')]=Date[_0x9a5b('0x3f')]()+0x36ee80;return _0x101848[_0x9a5b('0x40')]();})[_0x9a5b('0xd')](function(){return sendServiceMail({'to':_0x376872[_0x9a5b('0x37')][_0x9a5b('0x23')],'subject':_0x9a5b('0x41'),'text':_0x9a5b('0x42')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x9a5b('0x43')+_0x376872['headers'][_0x9a5b('0x44')]+'/reset/'+_0xa1faf8+'\x0a\x0a'+_0x9a5b('0x45')});})[_0x9a5b('0xd')](function(){_0x23670e[_0x9a5b('0x2f')](0xc8)[_0x9a5b('0x30')]({'message':_0x9a5b('0x46')});})[_0x9a5b('0x21')](function(_0x9824b5){return handleError(_0x23670e,0x1f4,_0x9824b5);});};exports[_0x9a5b('0x47')]=function(_0x15ac14,_0x15dcb6){return db[_0x9a5b('0x3a')]['find']({'where':{'resetPasswordToken':_0x15ac14[_0x9a5b('0x48')][_0x9a5b('0x49')],'resetPasswordExpires':{'$gt':Date[_0x9a5b('0x3f')]()}}})[_0x9a5b('0xd')](function(_0x5d4171){if(!_0x5d4171){throw new Error(_0x9a5b('0x4a'));}return db[_0x9a5b('0xb')]['findOne']({'attributes':['id',_0x9a5b('0x4b'),_0x9a5b('0x4c'),_0x9a5b('0x4d')]})[_0x9a5b('0xd')](function(_0x23a0ef){if(_0x23a0ef[_0x9a5b('0x4b')])authService['validatePasswordPattern'](_0x15ac14[_0x9a5b('0x37')][_0x9a5b('0x10')]);if(!_0x23a0ef[_0x9a5b('0x4c')]||!_0x5d4171[_0x9a5b('0x4e')])return _0x5d4171;authService[_0x9a5b('0x4f')](_0x15ac14[_0x9a5b('0x37')][_0x9a5b('0x10')],_0x5d4171[_0x9a5b('0x4e')],_0x23a0ef[_0x9a5b('0x4d')]);return _0x5d4171;})[_0x9a5b('0xd')](function(){_0x5d4171[_0x9a5b('0x10')]=_0x15ac14[_0x9a5b('0x37')]['password'];_0x5d4171[_0x9a5b('0x3d')]=null;_0x5d4171[_0x9a5b('0x3e')]=null;return _0x5d4171[_0x9a5b('0x40')]();});})['then'](function(){_0x15dcb6['status'](0xc8)[_0x9a5b('0x30')]({'message':_0x9a5b('0x50')});})['catch'](function(_0xffaea3){return handleError(_0x15dcb6,0x1f4,_0xffaea3);});};passport[_0x9a5b('0x51')](_0x9a5b('0x52'),new LocalStrategy({'usernameField':_0x9a5b('0xf'),'passwordField':'password'},function(_0x4bab76,_0xa35269,_0x404321){return localAuthenticate(db[_0x9a5b('0x3a')],_0x4bab76,_0xa35269,_0x404321);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index d39329e..022744f 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 _0x248c=['/reset/:token','exports','express','Router','./authLocal.controller','post','login','forgot'];(function(_0x1c95d5,_0xc1059b){var _0x20f69b=function(_0x18128b){while(--_0x18128b){_0x1c95d5['push'](_0x1c95d5['shift']());}};_0x20f69b(++_0xc1059b);}(_0x248c,0x10a));var _0xc248=function(_0x18b42a,_0x226226){_0x18b42a=_0x18b42a-0x0;var _0x4e3ed3=_0x248c[_0x18b42a];return _0x4e3ed3;};'use strict';var express=require(_0xc248('0x0'));var router=express[_0xc248('0x1')]();var controller=require(_0xc248('0x2'));router[_0xc248('0x3')]('/',controller[_0xc248('0x4')]);router['post']('/forgot',controller[_0xc248('0x5')]);router[_0xc248('0x3')](_0xc248('0x6'),controller['reset']);module[_0xc248('0x7')]=router;
\ No newline at end of file
+var _0x2cd9=['post','/reset/:token','exports','express','Router','./authLocal.controller','login','/forgot','forgot'];(function(_0x4cb394,_0x2922dd){var _0xfaa442=function(_0x14470f){while(--_0x14470f){_0x4cb394['push'](_0x4cb394['shift']());}};_0xfaa442(++_0x2922dd);}(_0x2cd9,0x135));var _0x92cd=function(_0x454b43,_0xbbd840){_0x454b43=_0x454b43-0x0;var _0x18b44b=_0x2cd9[_0x454b43];return _0x18b44b;};'use strict';var express=require(_0x92cd('0x0'));var router=express[_0x92cd('0x1')]();var controller=require(_0x92cd('0x2'));router['post']('/',controller[_0x92cd('0x3')]);router['post'](_0x92cd('0x4'),controller[_0x92cd('0x5')]);router[_0x92cd('0x6')](_0x92cd('0x7'),controller['reset']);module[_0x92cd('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index e9a42cb..eb6d89b 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 _0x042a=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x2e54cb,_0x268ff3){var _0x2aedfc=function(_0x3a05e3){while(--_0x3a05e3){_0x2e54cb['push'](_0x2e54cb['shift']());}};_0x2aedfc(++_0x268ff3);}(_0x042a,0x14c));var _0xa042=function(_0x4f993a,_0x1f3a4b){_0x4f993a=_0x4f993a-0x0;var _0xaaaef6=_0x042a[_0x4f993a];return _0xaaaef6;};'use strict';var Sequelize=require(_0xa042('0x0'));module[_0xa042('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xa042('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xa042('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xa042('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x3e31=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x1b60e6,_0x2e8a31){var _0x1bbb3d=function(_0x3b07f0){while(--_0x3b07f0){_0x1b60e6['push'](_0x1b60e6['shift']());}};_0x1bbb3d(++_0x2e8a31);}(_0x3e31,0xfe));var _0x13e3=function(_0xf3fd05,_0x23ce73){_0xf3fd05=_0xf3fd05-0x0;var _0x7b9231=_0x3e31[_0xf3fd05];return _0x7b9231;};'use strict';var Sequelize=require(_0x13e3('0x0'));module[_0x13e3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x13e3('0x2')]},'description':{'type':Sequelize[_0x13e3('0x2')]},'status':{'type':Sequelize[_0x13e3('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x13e3('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 05342e1..5cfe34e 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 _0xade5=['limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','intersection','include','merge','find','create','update','body','addConditions','ids','omit','findOne','Condition','order','getConditions','Action','addActions','getActions','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x5b7eee,_0x50f167){var _0x506ad8=function(_0x11edcd){while(--_0x11edcd){_0x5b7eee['push'](_0x5b7eee['shift']());}};_0x506ad8(++_0x50f167);}(_0xade5,0x143));var _0x5ade=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xade5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ade('0x0'));var zipdir=require(_0x5ade('0x1'));var jsonpatch=require(_0x5ade('0x2'));var rp=require(_0x5ade('0x3'));var moment=require(_0x5ade('0x4'));var BPromise=require(_0x5ade('0x5'));var Mustache=require('mustache');var util=require(_0x5ade('0x6'));var path=require(_0x5ade('0x7'));var sox=require(_0x5ade('0x8'));var csv=require(_0x5ade('0x9'));var ejs=require(_0x5ade('0xa'));var fs=require('fs');var fs_extra=require(_0x5ade('0xb'));var _=require(_0x5ade('0xc'));var squel=require(_0x5ade('0xd'));var crypto=require(_0x5ade('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5ade('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5ade('0x10'));var Papa=require(_0x5ade('0x11'));var Redis=require(_0x5ade('0x12'));var authService=require(_0x5ade('0x13'));var qs=require(_0x5ade('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ade('0x15'));var logger=require(_0x5ade('0x16'))(_0x5ade('0x17'));var utils=require(_0x5ade('0x18'));var config=require(_0x5ade('0x19'));var licenseUtil=require(_0x5ade('0x1a'));var db=require(_0x5ade('0x1b'))['db'];function respondWithStatusCode(_0x2b51da,_0x35f52a){_0x35f52a=_0x35f52a||0xcc;return function(_0x2a7393){if(_0x2a7393){return _0x2b51da[_0x5ade('0x1c')](_0x35f52a);}return _0x2b51da[_0x5ade('0x1d')](_0x35f52a)[_0x5ade('0x1e')]();};}function respondWithResult(_0x34c9ad,_0x10f676){_0x10f676=_0x10f676||0xc8;return function(_0x8bdf90){if(_0x8bdf90){return _0x34c9ad[_0x5ade('0x1d')](_0x10f676)[_0x5ade('0x1f')](_0x8bdf90);}};}function respondWithFilteredResult(_0x3d19fa,_0x1dc8b3){return function(_0xf6a03c){if(_0xf6a03c){var _0x17ea65=typeof _0x1dc8b3[_0x5ade('0x20')]==='undefined'&&typeof _0x1dc8b3['limit']==='undefined';var _0x2f1f79=_0xf6a03c['count'];var _0x451d8a=_0x17ea65?0x0:_0x1dc8b3[_0x5ade('0x20')];var _0x5d0c48=_0x17ea65?_0xf6a03c['count']:_0x1dc8b3['offset']+_0x1dc8b3[_0x5ade('0x21')];var _0x102b79;if(_0x5d0c48>=_0x2f1f79){_0x5d0c48=_0x2f1f79;_0x102b79=0xc8;}else{_0x102b79=0xce;}_0x3d19fa['status'](_0x102b79);return _0x3d19fa[_0x5ade('0x22')](_0x5ade('0x23'),_0x451d8a+'-'+_0x5d0c48+'/'+_0x2f1f79)[_0x5ade('0x1f')](_0xf6a03c);}return null;};}function patchUpdates(_0x2ff7ec){return function(_0x208ee9){try{jsonpatch[_0x5ade('0x24')](_0x208ee9,_0x2ff7ec,!![]);}catch(_0x47c080){return BPromise[_0x5ade('0x25')](_0x47c080);}return _0x208ee9['save']();};}function saveUpdates(_0x367dcc,_0x56923d){return function(_0x3344ac){if(_0x3344ac){return _0x3344ac['update'](_0x367dcc)[_0x5ade('0x26')](function(_0x170102){return _0x170102;});}return null;};}function removeEntity(_0x1a8da4,_0x2741fa){return function(_0x4dcb26){if(_0x4dcb26){return _0x4dcb26[_0x5ade('0x27')]()['then'](function(){_0x1a8da4[_0x5ade('0x1d')](0xcc)[_0x5ade('0x1e')]();});}};}function handleEntityNotFound(_0x5cca47,_0x16b6a0){return function(_0x731eed){if(!_0x731eed){_0x5cca47['sendStatus'](0x194);}return _0x731eed;};}function handleError(_0x4f9628,_0x144dd0){_0x144dd0=_0x144dd0||0x1f4;return function(_0x27db87){logger[_0x5ade('0x28')](_0x27db87[_0x5ade('0x29')]);if(_0x27db87[_0x5ade('0x2a')]){delete _0x27db87[_0x5ade('0x2a')];}_0x4f9628[_0x5ade('0x1d')](_0x144dd0)[_0x5ade('0x2b')](_0x27db87);};}exports[_0x5ade('0x2c')]=function(_0x367c94,_0x4f6878){var _0x358c5b={},_0x3b6f2a={},_0x3887c8={'count':0x0,'rows':[]};var _0x154252=_['map'](db[_0x5ade('0x2d')][_0x5ade('0x2e')],function(_0x470be4){return{'name':_0x470be4[_0x5ade('0x2f')],'type':_0x470be4[_0x5ade('0x30')]['key']};});_0x3b6f2a[_0x5ade('0x31')]=_['map'](_0x154252,_0x5ade('0x2a'));_0x3b6f2a['query']=_[_0x5ade('0x32')](_0x367c94[_0x5ade('0x33')]);_0x3b6f2a[_0x5ade('0x34')]=_['intersection'](_0x3b6f2a[_0x5ade('0x31')],_0x3b6f2a['query']);_0x358c5b[_0x5ade('0x35')]=_['intersection'](_0x3b6f2a[_0x5ade('0x31')],qs[_0x5ade('0x36')](_0x367c94[_0x5ade('0x33')]['fields']));_0x358c5b['attributes']=_0x358c5b[_0x5ade('0x35')][_0x5ade('0x37')]?_0x358c5b[_0x5ade('0x35')]:_0x3b6f2a[_0x5ade('0x31')];if(!_0x367c94[_0x5ade('0x33')][_0x5ade('0x38')](_0x5ade('0x39'))){_0x358c5b['limit']=qs[_0x5ade('0x21')](_0x367c94[_0x5ade('0x33')][_0x5ade('0x21')]);_0x358c5b[_0x5ade('0x20')]=qs[_0x5ade('0x20')](_0x367c94[_0x5ade('0x33')][_0x5ade('0x20')]);}_0x358c5b['order']=qs[_0x5ade('0x3a')](_0x367c94[_0x5ade('0x33')][_0x5ade('0x3a')]);_0x358c5b[_0x5ade('0x3b')]=qs[_0x5ade('0x34')](_[_0x5ade('0x3c')](_0x367c94['query'],_0x3b6f2a[_0x5ade('0x34')]),_0x154252);if(_0x367c94[_0x5ade('0x33')][_0x5ade('0x3d')]){_0x358c5b[_0x5ade('0x3b')]=_['merge'](_0x358c5b[_0x5ade('0x3b')],{'$or':_['map'](_0x154252,function(_0x4c980a){if(_0x4c980a['type']!==_0x5ade('0x3e')){var _0x523c26={};_0x523c26[_0x4c980a[_0x5ade('0x2a')]]={'$like':'%'+_0x367c94['query'][_0x5ade('0x3d')]+'%'};return _0x523c26;}})});}_0x358c5b=_['merge']({},_0x358c5b,_0x367c94[_0x5ade('0x3f')]);var _0x1b7d63={'where':_0x358c5b['where']};return db[_0x5ade('0x2d')][_0x5ade('0x40')](_0x1b7d63)[_0x5ade('0x26')](function(_0x4ded5c){_0x3887c8[_0x5ade('0x40')]=_0x4ded5c;if(_0x367c94['query'][_0x5ade('0x41')]){_0x358c5b['include']=[{'all':!![]}];}return db[_0x5ade('0x2d')][_0x5ade('0x42')](_0x358c5b);})[_0x5ade('0x26')](function(_0x4c6fe4){_0x3887c8[_0x5ade('0x43')]=_0x4c6fe4;return _0x3887c8;})[_0x5ade('0x26')](respondWithFilteredResult(_0x4f6878,_0x358c5b))[_0x5ade('0x44')](handleError(_0x4f6878,null));};exports[_0x5ade('0x45')]=function(_0x55038a,_0x25a3dd){var _0x4b184d={'raw':![],'where':{'id':_0x55038a[_0x5ade('0x46')]['id']}},_0x1be665={};_0x1be665[_0x5ade('0x31')]=_[_0x5ade('0x32')](db[_0x5ade('0x2d')][_0x5ade('0x2e')]);_0x1be665['query']=_['keys'](_0x55038a[_0x5ade('0x33')]);_0x1be665[_0x5ade('0x34')]=_[_0x5ade('0x47')](_0x1be665[_0x5ade('0x31')],_0x1be665[_0x5ade('0x33')]);_0x4b184d[_0x5ade('0x35')]=_[_0x5ade('0x47')](_0x1be665[_0x5ade('0x31')],qs[_0x5ade('0x36')](_0x55038a[_0x5ade('0x33')][_0x5ade('0x36')]));_0x4b184d[_0x5ade('0x35')]=_0x4b184d[_0x5ade('0x35')][_0x5ade('0x37')]?_0x4b184d['attributes']:_0x1be665[_0x5ade('0x31')];if(_0x55038a[_0x5ade('0x33')][_0x5ade('0x41')]){_0x4b184d[_0x5ade('0x48')]=[{'all':!![]}];}_0x4b184d=_[_0x5ade('0x49')]({},_0x4b184d,_0x55038a[_0x5ade('0x3f')]);return db[_0x5ade('0x2d')][_0x5ade('0x4a')](_0x4b184d)['then'](handleEntityNotFound(_0x25a3dd,null))[_0x5ade('0x26')](respondWithResult(_0x25a3dd,null))[_0x5ade('0x44')](handleError(_0x25a3dd,null));};exports[_0x5ade('0x4b')]=function(_0x169317,_0x441cc2){return db[_0x5ade('0x2d')][_0x5ade('0x4b')](_0x169317['body'],{})[_0x5ade('0x26')](respondWithResult(_0x441cc2,0xc9))['catch'](handleError(_0x441cc2,null));};exports[_0x5ade('0x4c')]=function(_0x3fcbb8,_0x593df1){if(_0x3fcbb8['body']['id']){delete _0x3fcbb8[_0x5ade('0x4d')]['id'];}return db[_0x5ade('0x2d')][_0x5ade('0x4a')]({'where':{'id':_0x3fcbb8[_0x5ade('0x46')]['id']}})[_0x5ade('0x26')](handleEntityNotFound(_0x593df1,null))[_0x5ade('0x26')](saveUpdates(_0x3fcbb8[_0x5ade('0x4d')],null))[_0x5ade('0x26')](respondWithResult(_0x593df1,null))[_0x5ade('0x44')](handleError(_0x593df1,null));};exports['destroy']=function(_0x1253c4,_0x5c7f69){return db[_0x5ade('0x2d')][_0x5ade('0x4a')]({'where':{'id':_0x1253c4[_0x5ade('0x46')]['id']}})[_0x5ade('0x26')](handleEntityNotFound(_0x5c7f69,null))[_0x5ade('0x26')](removeEntity(_0x5c7f69,null))['catch'](handleError(_0x5c7f69,null));};exports[_0x5ade('0x4e')]=function(_0x50f4c2,_0x51c7ee,_0x135c2c){return db['Condition'][_0x5ade('0x4a')]({'where':{'id':_0x50f4c2[_0x5ade('0x46')]['id']}})[_0x5ade('0x26')](handleEntityNotFound(_0x51c7ee,null))['then'](function(_0x5b2e07){if(_0x5b2e07){return _0x5b2e07[_0x5ade('0x4e')](_0x50f4c2[_0x5ade('0x4d')][_0x5ade('0x4f')],_[_0x5ade('0x50')](_0x50f4c2['body'],[_0x5ade('0x4f'),'id'])||{});}})[_0x5ade('0x26')](respondWithResult(_0x51c7ee,null))[_0x5ade('0x44')](handleError(_0x51c7ee,null));};exports['getConditions']=function(_0x1a1a5d,_0x5514ba,_0xe31a5){var _0x4c382b={};var _0x42bd8c={};var _0x4aca4e;var _0x3ae420;return db[_0x5ade('0x2d')][_0x5ade('0x51')]({'where':{'id':_0x1a1a5d[_0x5ade('0x46')]['id']}})[_0x5ade('0x26')](handleEntityNotFound(_0x5514ba,null))[_0x5ade('0x26')](function(_0x33a1ee){if(_0x33a1ee){_0x4aca4e=_0x33a1ee;_0x42bd8c[_0x5ade('0x31')]=_[_0x5ade('0x32')](db[_0x5ade('0x52')][_0x5ade('0x2e')]);_0x42bd8c['query']=_[_0x5ade('0x32')](_0x1a1a5d[_0x5ade('0x33')]);_0x42bd8c[_0x5ade('0x34')]=_['intersection'](_0x42bd8c[_0x5ade('0x31')],_0x42bd8c['query']);_0x4c382b[_0x5ade('0x35')]=_['intersection'](_0x42bd8c[_0x5ade('0x31')],qs[_0x5ade('0x36')](_0x1a1a5d[_0x5ade('0x33')]['fields']));_0x4c382b[_0x5ade('0x35')]=_0x4c382b[_0x5ade('0x35')][_0x5ade('0x37')]?_0x4c382b[_0x5ade('0x35')]:_0x42bd8c[_0x5ade('0x31')];_0x4c382b[_0x5ade('0x53')]=qs['sort'](_0x1a1a5d[_0x5ade('0x33')][_0x5ade('0x3a')]);_0x4c382b['where']=qs[_0x5ade('0x34')](_['pick'](_0x1a1a5d[_0x5ade('0x33')],_0x42bd8c[_0x5ade('0x34')]));if(_0x1a1a5d[_0x5ade('0x33')][_0x5ade('0x3d')]){_0x4c382b[_0x5ade('0x3b')]=_['merge'](_0x4c382b['where'],{'$or':_['map'](_0x4c382b[_0x5ade('0x35')],function(_0x3dd551){var _0x485594={};_0x485594[_0x3dd551]={'$like':'%'+_0x1a1a5d[_0x5ade('0x33')][_0x5ade('0x3d')]+'%'};return _0x485594;})});}_0x4c382b=_[_0x5ade('0x49')]({},_0x4c382b,_0x1a1a5d[_0x5ade('0x3f')]);return _0x4aca4e[_0x5ade('0x54')](_0x4c382b);}})[_0x5ade('0x26')](function(_0x49487d){if(_0x49487d){_0x3ae420=_0x49487d[_0x5ade('0x37')];if(!_0x1a1a5d[_0x5ade('0x33')]['hasOwnProperty']('nolimit')){_0x4c382b[_0x5ade('0x21')]=qs[_0x5ade('0x21')](_0x1a1a5d[_0x5ade('0x33')][_0x5ade('0x21')]);_0x4c382b[_0x5ade('0x20')]=qs['offset'](_0x1a1a5d[_0x5ade('0x33')][_0x5ade('0x20')]);}return _0x4aca4e[_0x5ade('0x54')](_0x4c382b);}})[_0x5ade('0x26')](function(_0x3068ca){if(_0x3068ca){return _0x3068ca?{'count':_0x3ae420,'rows':_0x3068ca}:null;}})[_0x5ade('0x26')](respondWithResult(_0x5514ba,null))[_0x5ade('0x44')](handleError(_0x5514ba,null));};exports['addActions']=function(_0xe2090c,_0x240426,_0x15266c){return db[_0x5ade('0x55')]['find']({'where':{'id':_0xe2090c[_0x5ade('0x46')]['id']}})[_0x5ade('0x26')](handleEntityNotFound(_0x240426,null))[_0x5ade('0x26')](function(_0x53e25c){if(_0x53e25c){return _0x53e25c[_0x5ade('0x56')](_0xe2090c[_0x5ade('0x4d')][_0x5ade('0x4f')],_[_0x5ade('0x50')](_0xe2090c[_0x5ade('0x4d')],[_0x5ade('0x4f'),'id'])||{});}})[_0x5ade('0x26')](respondWithResult(_0x240426,null))[_0x5ade('0x44')](handleError(_0x240426,null));};exports[_0x5ade('0x57')]=function(_0x3045dc,_0x29fdc4,_0xca5ddf){var _0x5667c7={};var _0x2cfd2f={};var _0xc569df;var _0x299f15;return db[_0x5ade('0x2d')][_0x5ade('0x51')]({'where':{'id':_0x3045dc[_0x5ade('0x46')]['id']}})[_0x5ade('0x26')](handleEntityNotFound(_0x29fdc4,null))[_0x5ade('0x26')](function(_0x4f543d){if(_0x4f543d){_0xc569df=_0x4f543d;_0x2cfd2f[_0x5ade('0x31')]=_[_0x5ade('0x32')](db['Action'][_0x5ade('0x2e')]);_0x2cfd2f[_0x5ade('0x33')]=_['keys'](_0x3045dc[_0x5ade('0x33')]);_0x2cfd2f[_0x5ade('0x34')]=_['intersection'](_0x2cfd2f[_0x5ade('0x31')],_0x2cfd2f[_0x5ade('0x33')]);_0x5667c7['attributes']=_[_0x5ade('0x47')](_0x2cfd2f['model'],qs[_0x5ade('0x36')](_0x3045dc[_0x5ade('0x33')][_0x5ade('0x36')]));_0x5667c7[_0x5ade('0x35')]=_0x5667c7[_0x5ade('0x35')][_0x5ade('0x37')]?_0x5667c7[_0x5ade('0x35')]:_0x2cfd2f['model'];_0x5667c7[_0x5ade('0x53')]=qs[_0x5ade('0x3a')](_0x3045dc[_0x5ade('0x33')][_0x5ade('0x3a')]);_0x5667c7[_0x5ade('0x3b')]=qs[_0x5ade('0x34')](_[_0x5ade('0x3c')](_0x3045dc['query'],_0x2cfd2f[_0x5ade('0x34')]));if(_0x3045dc[_0x5ade('0x33')][_0x5ade('0x3d')]){_0x5667c7[_0x5ade('0x3b')]=_[_0x5ade('0x49')](_0x5667c7[_0x5ade('0x3b')],{'$or':_[_0x5ade('0x58')](_0x5667c7[_0x5ade('0x35')],function(_0x1b0e12){var _0x1863b8={};_0x1863b8[_0x1b0e12]={'$like':'%'+_0x3045dc[_0x5ade('0x33')][_0x5ade('0x3d')]+'%'};return _0x1863b8;})});}_0x5667c7=_[_0x5ade('0x49')]({},_0x5667c7,_0x3045dc[_0x5ade('0x3f')]);return _0xc569df[_0x5ade('0x57')](_0x5667c7);}})[_0x5ade('0x26')](function(_0x475383){if(_0x475383){_0x299f15=_0x475383[_0x5ade('0x37')];if(!_0x3045dc[_0x5ade('0x33')][_0x5ade('0x38')](_0x5ade('0x39'))){_0x5667c7['limit']=qs[_0x5ade('0x21')](_0x3045dc[_0x5ade('0x33')][_0x5ade('0x21')]);_0x5667c7[_0x5ade('0x20')]=qs[_0x5ade('0x20')](_0x3045dc['query'][_0x5ade('0x20')]);}return _0xc569df[_0x5ade('0x57')](_0x5667c7);}})[_0x5ade('0x26')](function(_0x500c18){if(_0x500c18){return _0x500c18?{'count':_0x299f15,'rows':_0x500c18}:null;}})[_0x5ade('0x26')](respondWithResult(_0x29fdc4,null))['catch'](handleError(_0x29fdc4,null));};
\ No newline at end of file
+var _0x1248=['../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','filters','intersection','model','attributes','length','query','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','Automation','includeAll','include','findAll','params','fields','options','find','catch','create','body','addConditions','Condition','ids','getConditions','findOne','addActions','Action','omit','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x56716d,_0x2f6690){var _0x126a2c=function(_0x5bf306){while(--_0x5bf306){_0x56716d['push'](_0x56716d['shift']());}};_0x126a2c(++_0x2f6690);}(_0x1248,0xe9));var _0x8124=function(_0x9f90cf,_0x503641){_0x9f90cf=_0x9f90cf-0x0;var _0x4d2bd3=_0x1248[_0x9f90cf];return _0x4d2bd3;};'use strict';var emlformat=require(_0x8124('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8124('0x1'));var jsonpatch=require(_0x8124('0x2'));var rp=require(_0x8124('0x3'));var moment=require(_0x8124('0x4'));var BPromise=require(_0x8124('0x5'));var Mustache=require(_0x8124('0x6'));var util=require(_0x8124('0x7'));var path=require(_0x8124('0x8'));var sox=require(_0x8124('0x9'));var csv=require(_0x8124('0xa'));var ejs=require(_0x8124('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8124('0xc'));var squel=require(_0x8124('0xd'));var crypto=require('crypto');var jsforce=require(_0x8124('0xe'));var deskjs=require(_0x8124('0xf'));var toCsv=require(_0x8124('0xa'));var querystring=require(_0x8124('0x10'));var Papa=require(_0x8124('0x11'));var Redis=require(_0x8124('0x12'));var authService=require(_0x8124('0x13'));var qs=require(_0x8124('0x14'));var as=require(_0x8124('0x15'));var hardwareService=require(_0x8124('0x16'));var logger=require(_0x8124('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8124('0x18'));var db=require(_0x8124('0x19'))['db'];function respondWithStatusCode(_0x508a45,_0x4a9785){_0x4a9785=_0x4a9785||0xcc;return function(_0x54d42b){if(_0x54d42b){return _0x508a45[_0x8124('0x1a')](_0x4a9785);}return _0x508a45[_0x8124('0x1b')](_0x4a9785)[_0x8124('0x1c')]();};}function respondWithResult(_0x4fbe93,_0x12b0e6){_0x12b0e6=_0x12b0e6||0xc8;return function(_0xc735a5){if(_0xc735a5){return _0x4fbe93['status'](_0x12b0e6)['json'](_0xc735a5);}};}function respondWithFilteredResult(_0x4a9816,_0x3aaf5d){return function(_0x352064){if(_0x352064){var _0x6bee46=typeof _0x3aaf5d[_0x8124('0x1d')]===_0x8124('0x1e')&&typeof _0x3aaf5d['limit']===_0x8124('0x1e');var _0x732edb=_0x352064[_0x8124('0x1f')];var _0x1b6810=_0x6bee46?0x0:_0x3aaf5d[_0x8124('0x1d')];var _0x441dbd=_0x6bee46?_0x352064[_0x8124('0x1f')]:_0x3aaf5d[_0x8124('0x1d')]+_0x3aaf5d['limit'];var _0x5410aa;if(_0x441dbd>=_0x732edb){_0x441dbd=_0x732edb;_0x5410aa=0xc8;}else{_0x5410aa=0xce;}_0x4a9816[_0x8124('0x1b')](_0x5410aa);return _0x4a9816['set'](_0x8124('0x20'),_0x1b6810+'-'+_0x441dbd+'/'+_0x732edb)[_0x8124('0x21')](_0x352064);}return null;};}function patchUpdates(_0x5f4290){return function(_0x207aec){try{jsonpatch[_0x8124('0x22')](_0x207aec,_0x5f4290,!![]);}catch(_0x5a770d){return BPromise[_0x8124('0x23')](_0x5a770d);}return _0x207aec[_0x8124('0x24')]();};}function saveUpdates(_0x1d77ac,_0x407ea9){return function(_0x33e63d){if(_0x33e63d){return _0x33e63d[_0x8124('0x25')](_0x1d77ac)[_0x8124('0x26')](function(_0x558721){return _0x558721;});}return null;};}function removeEntity(_0xb1d8ec,_0x1003eb){return function(_0x280607){if(_0x280607){return _0x280607[_0x8124('0x27')]()[_0x8124('0x26')](function(){_0xb1d8ec[_0x8124('0x1b')](0xcc)[_0x8124('0x1c')]();});}};}function handleEntityNotFound(_0x5387f4,_0x4db46b){return function(_0x566ac4){if(!_0x566ac4){_0x5387f4['sendStatus'](0x194);}return _0x566ac4;};}function handleError(_0x2a8332,_0x303171){_0x303171=_0x303171||0x1f4;return function(_0xfb5031){logger[_0x8124('0x28')](_0xfb5031[_0x8124('0x29')]);if(_0xfb5031['name']){delete _0xfb5031[_0x8124('0x2a')];}_0x2a8332[_0x8124('0x1b')](_0x303171)[_0x8124('0x2b')](_0xfb5031);};}exports[_0x8124('0x2c')]=function(_0x2bb32c,_0x451d85){var _0x2fca90={},_0x216f17={},_0xb114c2={'count':0x0,'rows':[]};var _0x158a79=_[_0x8124('0x2d')](db['Automation'][_0x8124('0x2e')],function(_0x5b03d3){return{'name':_0x5b03d3[_0x8124('0x2f')],'type':_0x5b03d3[_0x8124('0x30')]['key']};});_0x216f17['model']=_['map'](_0x158a79,_0x8124('0x2a'));_0x216f17['query']=_[_0x8124('0x31')](_0x2bb32c['query']);_0x216f17[_0x8124('0x32')]=_[_0x8124('0x33')](_0x216f17[_0x8124('0x34')],_0x216f17['query']);_0x2fca90[_0x8124('0x35')]=_[_0x8124('0x33')](_0x216f17[_0x8124('0x34')],qs['fields'](_0x2bb32c['query']['fields']));_0x2fca90['attributes']=_0x2fca90[_0x8124('0x35')][_0x8124('0x36')]?_0x2fca90[_0x8124('0x35')]:_0x216f17[_0x8124('0x34')];if(!_0x2bb32c[_0x8124('0x37')][_0x8124('0x38')](_0x8124('0x39'))){_0x2fca90[_0x8124('0x3a')]=qs[_0x8124('0x3a')](_0x2bb32c[_0x8124('0x37')][_0x8124('0x3a')]);_0x2fca90[_0x8124('0x1d')]=qs[_0x8124('0x1d')](_0x2bb32c[_0x8124('0x37')][_0x8124('0x1d')]);}_0x2fca90[_0x8124('0x3b')]=qs[_0x8124('0x3c')](_0x2bb32c['query']['sort']);_0x2fca90['where']=qs[_0x8124('0x32')](_[_0x8124('0x3d')](_0x2bb32c[_0x8124('0x37')],_0x216f17['filters']),_0x158a79);if(_0x2bb32c[_0x8124('0x37')][_0x8124('0x3e')]){_0x2fca90['where']=_[_0x8124('0x3f')](_0x2fca90[_0x8124('0x40')],{'$or':_[_0x8124('0x2d')](_0x158a79,function(_0x21f1d8){if(_0x21f1d8[_0x8124('0x30')]!=='VIRTUAL'){var _0x5439a6={};_0x5439a6[_0x21f1d8[_0x8124('0x2a')]]={'$like':'%'+_0x2bb32c[_0x8124('0x37')]['filter']+'%'};return _0x5439a6;}})});}_0x2fca90=_[_0x8124('0x3f')]({},_0x2fca90,_0x2bb32c['options']);var _0x55478f={'where':_0x2fca90[_0x8124('0x40')]};return db[_0x8124('0x41')][_0x8124('0x1f')](_0x55478f)[_0x8124('0x26')](function(_0x5648ae){_0xb114c2[_0x8124('0x1f')]=_0x5648ae;if(_0x2bb32c[_0x8124('0x37')][_0x8124('0x42')]){_0x2fca90[_0x8124('0x43')]=[{'all':!![]}];}return db[_0x8124('0x41')][_0x8124('0x44')](_0x2fca90);})[_0x8124('0x26')](function(_0x2a6a89){_0xb114c2['rows']=_0x2a6a89;return _0xb114c2;})[_0x8124('0x26')](respondWithFilteredResult(_0x451d85,_0x2fca90))['catch'](handleError(_0x451d85,null));};exports['show']=function(_0x4d2ff8,_0xabaf08){var _0x371e40={'raw':![],'where':{'id':_0x4d2ff8[_0x8124('0x45')]['id']}},_0x35edd7={};_0x35edd7[_0x8124('0x34')]=_[_0x8124('0x31')](db[_0x8124('0x41')][_0x8124('0x2e')]);_0x35edd7[_0x8124('0x37')]=_[_0x8124('0x31')](_0x4d2ff8[_0x8124('0x37')]);_0x35edd7[_0x8124('0x32')]=_[_0x8124('0x33')](_0x35edd7[_0x8124('0x34')],_0x35edd7[_0x8124('0x37')]);_0x371e40[_0x8124('0x35')]=_[_0x8124('0x33')](_0x35edd7['model'],qs[_0x8124('0x46')](_0x4d2ff8[_0x8124('0x37')]['fields']));_0x371e40[_0x8124('0x35')]=_0x371e40[_0x8124('0x35')][_0x8124('0x36')]?_0x371e40[_0x8124('0x35')]:_0x35edd7[_0x8124('0x34')];if(_0x4d2ff8['query'][_0x8124('0x42')]){_0x371e40[_0x8124('0x43')]=[{'all':!![]}];}_0x371e40=_[_0x8124('0x3f')]({},_0x371e40,_0x4d2ff8[_0x8124('0x47')]);return db['Automation'][_0x8124('0x48')](_0x371e40)['then'](handleEntityNotFound(_0xabaf08,null))['then'](respondWithResult(_0xabaf08,null))[_0x8124('0x49')](handleError(_0xabaf08,null));};exports[_0x8124('0x4a')]=function(_0x4ea287,_0x37edb1){return db[_0x8124('0x41')][_0x8124('0x4a')](_0x4ea287[_0x8124('0x4b')],{})['then'](respondWithResult(_0x37edb1,0xc9))[_0x8124('0x49')](handleError(_0x37edb1,null));};exports[_0x8124('0x25')]=function(_0x172414,_0x1f8311){if(_0x172414['body']['id']){delete _0x172414['body']['id'];}return db[_0x8124('0x41')][_0x8124('0x48')]({'where':{'id':_0x172414[_0x8124('0x45')]['id']}})['then'](handleEntityNotFound(_0x1f8311,null))[_0x8124('0x26')](saveUpdates(_0x172414[_0x8124('0x4b')],null))[_0x8124('0x26')](respondWithResult(_0x1f8311,null))[_0x8124('0x49')](handleError(_0x1f8311,null));};exports['destroy']=function(_0x343450,_0x2c878a){return db[_0x8124('0x41')][_0x8124('0x48')]({'where':{'id':_0x343450['params']['id']}})[_0x8124('0x26')](handleEntityNotFound(_0x2c878a,null))[_0x8124('0x26')](removeEntity(_0x2c878a,null))[_0x8124('0x49')](handleError(_0x2c878a,null));};exports[_0x8124('0x4c')]=function(_0xee7f87,_0x20a0c9,_0x4a093f){return db[_0x8124('0x4d')][_0x8124('0x48')]({'where':{'id':_0xee7f87[_0x8124('0x45')]['id']}})['then'](handleEntityNotFound(_0x20a0c9,null))['then'](function(_0x3b6d4c){if(_0x3b6d4c){return _0x3b6d4c[_0x8124('0x4c')](_0xee7f87[_0x8124('0x4b')][_0x8124('0x4e')],_['omit'](_0xee7f87[_0x8124('0x4b')],[_0x8124('0x4e'),'id'])||{});}})[_0x8124('0x26')](respondWithResult(_0x20a0c9,null))[_0x8124('0x49')](handleError(_0x20a0c9,null));};exports[_0x8124('0x4f')]=function(_0x1c6d72,_0x28c5cb,_0x17bb2a){var _0x4edf6f={};var _0x524e1f={};var _0x4da122;var _0x4a82c8;return db[_0x8124('0x41')][_0x8124('0x50')]({'where':{'id':_0x1c6d72[_0x8124('0x45')]['id']}})['then'](handleEntityNotFound(_0x28c5cb,null))[_0x8124('0x26')](function(_0x293981){if(_0x293981){_0x4da122=_0x293981;_0x524e1f[_0x8124('0x34')]=_[_0x8124('0x31')](db[_0x8124('0x4d')][_0x8124('0x2e')]);_0x524e1f['query']=_[_0x8124('0x31')](_0x1c6d72[_0x8124('0x37')]);_0x524e1f[_0x8124('0x32')]=_['intersection'](_0x524e1f[_0x8124('0x34')],_0x524e1f[_0x8124('0x37')]);_0x4edf6f[_0x8124('0x35')]=_[_0x8124('0x33')](_0x524e1f['model'],qs['fields'](_0x1c6d72[_0x8124('0x37')][_0x8124('0x46')]));_0x4edf6f[_0x8124('0x35')]=_0x4edf6f['attributes'][_0x8124('0x36')]?_0x4edf6f[_0x8124('0x35')]:_0x524e1f['model'];_0x4edf6f['order']=qs['sort'](_0x1c6d72[_0x8124('0x37')][_0x8124('0x3c')]);_0x4edf6f[_0x8124('0x40')]=qs['filters'](_[_0x8124('0x3d')](_0x1c6d72['query'],_0x524e1f[_0x8124('0x32')]));if(_0x1c6d72[_0x8124('0x37')][_0x8124('0x3e')]){_0x4edf6f['where']=_[_0x8124('0x3f')](_0x4edf6f['where'],{'$or':_[_0x8124('0x2d')](_0x4edf6f[_0x8124('0x35')],function(_0x325fef){var _0x290ca3={};_0x290ca3[_0x325fef]={'$like':'%'+_0x1c6d72[_0x8124('0x37')][_0x8124('0x3e')]+'%'};return _0x290ca3;})});}_0x4edf6f=_['merge']({},_0x4edf6f,_0x1c6d72[_0x8124('0x47')]);return _0x4da122['getConditions'](_0x4edf6f);}})[_0x8124('0x26')](function(_0x3a9ece){if(_0x3a9ece){_0x4a82c8=_0x3a9ece[_0x8124('0x36')];if(!_0x1c6d72[_0x8124('0x37')]['hasOwnProperty']('nolimit')){_0x4edf6f[_0x8124('0x3a')]=qs[_0x8124('0x3a')](_0x1c6d72[_0x8124('0x37')]['limit']);_0x4edf6f[_0x8124('0x1d')]=qs['offset'](_0x1c6d72[_0x8124('0x37')][_0x8124('0x1d')]);}return _0x4da122[_0x8124('0x4f')](_0x4edf6f);}})[_0x8124('0x26')](function(_0x13c71e){if(_0x13c71e){return _0x13c71e?{'count':_0x4a82c8,'rows':_0x13c71e}:null;}})[_0x8124('0x26')](respondWithResult(_0x28c5cb,null))[_0x8124('0x49')](handleError(_0x28c5cb,null));};exports[_0x8124('0x51')]=function(_0x273d3c,_0x5403b5,_0x5dadfd){return db[_0x8124('0x52')][_0x8124('0x48')]({'where':{'id':_0x273d3c['params']['id']}})[_0x8124('0x26')](handleEntityNotFound(_0x5403b5,null))[_0x8124('0x26')](function(_0x574cc4){if(_0x574cc4){return _0x574cc4[_0x8124('0x51')](_0x273d3c[_0x8124('0x4b')][_0x8124('0x4e')],_[_0x8124('0x53')](_0x273d3c[_0x8124('0x4b')],[_0x8124('0x4e'),'id'])||{});}})[_0x8124('0x26')](respondWithResult(_0x5403b5,null))[_0x8124('0x49')](handleError(_0x5403b5,null));};exports['getActions']=function(_0x25b580,_0x355aa2,_0x202996){var _0xb03614={};var _0x41f1e4={};var _0x41f1a0;var _0x4f7599;return db['Automation'][_0x8124('0x50')]({'where':{'id':_0x25b580['params']['id']}})[_0x8124('0x26')](handleEntityNotFound(_0x355aa2,null))['then'](function(_0x13a140){if(_0x13a140){_0x41f1a0=_0x13a140;_0x41f1e4['model']=_[_0x8124('0x31')](db[_0x8124('0x52')][_0x8124('0x2e')]);_0x41f1e4[_0x8124('0x37')]=_[_0x8124('0x31')](_0x25b580[_0x8124('0x37')]);_0x41f1e4[_0x8124('0x32')]=_[_0x8124('0x33')](_0x41f1e4[_0x8124('0x34')],_0x41f1e4[_0x8124('0x37')]);_0xb03614[_0x8124('0x35')]=_[_0x8124('0x33')](_0x41f1e4['model'],qs[_0x8124('0x46')](_0x25b580[_0x8124('0x37')][_0x8124('0x46')]));_0xb03614['attributes']=_0xb03614[_0x8124('0x35')][_0x8124('0x36')]?_0xb03614[_0x8124('0x35')]:_0x41f1e4['model'];_0xb03614['order']=qs[_0x8124('0x3c')](_0x25b580[_0x8124('0x37')][_0x8124('0x3c')]);_0xb03614[_0x8124('0x40')]=qs['filters'](_[_0x8124('0x3d')](_0x25b580['query'],_0x41f1e4[_0x8124('0x32')]));if(_0x25b580[_0x8124('0x37')][_0x8124('0x3e')]){_0xb03614[_0x8124('0x40')]=_['merge'](_0xb03614['where'],{'$or':_[_0x8124('0x2d')](_0xb03614[_0x8124('0x35')],function(_0x26c669){var _0x1ea639={};_0x1ea639[_0x26c669]={'$like':'%'+_0x25b580[_0x8124('0x37')][_0x8124('0x3e')]+'%'};return _0x1ea639;})});}_0xb03614=_['merge']({},_0xb03614,_0x25b580['options']);return _0x41f1a0[_0x8124('0x54')](_0xb03614);}})[_0x8124('0x26')](function(_0x639570){if(_0x639570){_0x4f7599=_0x639570[_0x8124('0x36')];if(!_0x25b580['query'][_0x8124('0x38')](_0x8124('0x39'))){_0xb03614[_0x8124('0x3a')]=qs[_0x8124('0x3a')](_0x25b580['query']['limit']);_0xb03614[_0x8124('0x1d')]=qs[_0x8124('0x1d')](_0x25b580[_0x8124('0x37')][_0x8124('0x1d')]);}return _0x41f1a0[_0x8124('0x54')](_0xb03614);}})[_0x8124('0x26')](function(_0x137b9d){if(_0x137b9d){return _0x137b9d?{'count':_0x4f7599,'rows':_0x137b9d}:null;}})[_0x8124('0x26')](respondWithResult(_0x355aa2,null))[_0x8124('0x49')](handleError(_0x355aa2,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 88c181e..40d6118 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 _0x19b9=['./automation.attributes','exports','Automation','tools_automations','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x4114dd,_0x2ad862){var _0x26f44c=function(_0xad2246){while(--_0xad2246){_0x4114dd['push'](_0x4114dd['shift']());}};_0x26f44c(++_0x2ad862);}(_0x19b9,0xc2));var _0x919b=function(_0x1cb890,_0x3b3a68){_0x1cb890=_0x1cb890-0x0;var _0x143993=_0x19b9[_0x1cb890];return _0x143993;};'use strict';var _=require(_0x919b('0x0'));var util=require(_0x919b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x919b('0x2'));var rp=require(_0x919b('0x3'));var fs=require('fs');var path=require(_0x919b('0x4'));var rimraf=require(_0x919b('0x5'));var config=require('../../config/environment');var attributes=require(_0x919b('0x6'));module[_0x919b('0x7')]=function(_0x58c530,_0x33a0ac){return _0x58c530['define'](_0x919b('0x8'),attributes,{'tableName':_0x919b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb270=['../../config/logger','api','moment','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','util'];(function(_0x4b4b0e,_0x6c674){var _0x4c2d91=function(_0x4d440d){while(--_0x4d440d){_0x4b4b0e['push'](_0x4b4b0e['shift']());}};_0x4c2d91(++_0x6c674);}(_0xb270,0x167));var _0x0b27=function(_0x2b0690,_0x4f742f){_0x2b0690=_0x2b0690-0x0;var _0x82be1=_0xb270[_0x2b0690];return _0x82be1;};'use strict';var _=require('lodash');var util=require(_0x0b27('0x0'));var logger=require(_0x0b27('0x1'))(_0x0b27('0x2'));var moment=require(_0x0b27('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b27('0x4'));var rimraf=require(_0x0b27('0x5'));var config=require(_0x0b27('0x6'));var attributes=require(_0x0b27('0x7'));module[_0x0b27('0x8')]=function(_0x2cab45,_0x436017){return _0x2cab45[_0x0b27('0x9')](_0x0b27('0xa'),attributes,{'tableName':_0x0b27('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index a51f423..dfbab14 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 _0x17a7=['Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info'];(function(_0x1569fc,_0x115095){var _0x277783=function(_0x49e9c1){while(--_0x49e9c1){_0x1569fc['push'](_0x1569fc['shift']());}};_0x277783(++_0x115095);}(_0x17a7,0xc2));var _0x717a=function(_0x8d5d35,_0x4e289b){_0x8d5d35=_0x8d5d35-0x0;var _0x309712=_0x17a7[_0x8d5d35];return _0x309712;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x717a('0x0'));var rs=require(_0x717a('0x1'));var fs=require('fs');var Redis=require(_0x717a('0x2'));var db=require(_0x717a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x717a('0x4'))('rpc');var config=require(_0x717a('0x5'));var jayson=require(_0x717a('0x6'));var client=jayson['client'][_0x717a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ca7a6,_0xd7d2ce,_0x311738){return new BPromise(function(_0x536824,_0x1066d4){return client['request'](_0x1ca7a6,_0x311738)[_0x717a('0x8')](function(_0x567130){logger[_0x717a('0x9')](_0x717a('0xa'),_0xd7d2ce,_0x717a('0xb'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'),JSON[_0x717a('0xc')](_0x567130));if(_0x567130[_0x717a('0xd')]){if(_0x567130[_0x717a('0xd')][_0x717a('0xe')]===0x1f4){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x567130['error'][_0x717a('0xf')]);return _0x1066d4(_0x567130['error']['message']);}logger['error']('Automation,\x20%s,\x20%s',_0xd7d2ce,_0x567130[_0x717a('0xd')]['message']);return _0x536824(_0x567130[_0x717a('0xd')]['message']);}else{logger[_0x717a('0x9')]('Automation,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'));_0x536824(_0x567130[_0x717a('0x10')][_0x717a('0xf')]);}})['catch'](function(_0x186b4d){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x186b4d);_0x1066d4(_0x186b4d);});});}
\ No newline at end of file
+var _0x4959=['../../config/logger','rpc','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4959,0x9b));var _0x9495=function(_0x3156c9,_0x3ee8b8){_0x3156c9=_0x3156c9-0x0;var _0x486742=_0x4959[_0x3156c9];return _0x486742;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9495('0x0'));var BPromise=require(_0x9495('0x1'));var rs=require(_0x9495('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9495('0x3'))['db'];var utils=require(_0x9495('0x4'));var logger=require(_0x9495('0x5'))(_0x9495('0x6'));var config=require('../../config/environment');var jayson=require(_0x9495('0x7'));var client=jayson[_0x9495('0x8')][_0x9495('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21f4e7,_0xd77231,_0x34744d){return new BPromise(function(_0x2a4754,_0x19f08c){return client[_0x9495('0xa')](_0x21f4e7,_0x34744d)[_0x9495('0xb')](function(_0x6b1466){logger['info'](_0x9495('0xc'),_0xd77231,'request\x20sent');logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0xd77231,'request\x20sent',JSON[_0x9495('0xd')](_0x6b1466));if(_0x6b1466[_0x9495('0xe')]){if(_0x6b1466[_0x9495('0xe')][_0x9495('0xf')]===0x1f4){logger[_0x9495('0xe')](_0x9495('0xc'),_0xd77231,_0x6b1466[_0x9495('0xe')][_0x9495('0x10')]);return _0x19f08c(_0x6b1466[_0x9495('0xe')][_0x9495('0x10')]);}logger[_0x9495('0xe')](_0x9495('0xc'),_0xd77231,_0x6b1466[_0x9495('0xe')][_0x9495('0x10')]);return _0x2a4754(_0x6b1466[_0x9495('0xe')][_0x9495('0x10')]);}else{logger['info'](_0x9495('0xc'),_0xd77231,_0x9495('0x11'));_0x2a4754(_0x6b1466[_0x9495('0x12')][_0x9495('0x10')]);}})[_0x9495('0x13')](function(_0x4c1d9d){logger[_0x9495('0xe')](_0x9495('0xc'),_0xd77231,_0x4c1d9d);_0x19f08c(_0x4c1d9d);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 8cc5f05..af5dfcc 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 _0xbefb=['get','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','delete','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xbefb,0x13c));var _0xbbef=function(_0x1ebd5c,_0x36150e){_0x1ebd5c=_0x1ebd5c-0x0;var _0x26eefc=_0xbefb[_0x1ebd5c];return _0x26eefc;};'use strict';var multer=require(_0xbbef('0x0'));var util=require(_0xbbef('0x1'));var path=require('path');var timeout=require(_0xbbef('0x2'));var express=require(_0xbbef('0x3'));var router=express['Router']();var fs_extra=require(_0xbbef('0x4'));var auth=require(_0xbbef('0x5'));var interaction=require(_0xbbef('0x6'));var config=require('../../config/environment');var controller=require('./automation.controller');router['get']('/',auth[_0xbbef('0x7')](),controller['index']);router[_0xbbef('0x8')](_0xbbef('0x9'),auth[_0xbbef('0x7')](),controller['show']);router[_0xbbef('0x8')](_0xbbef('0xa'),auth[_0xbbef('0x7')](),controller[_0xbbef('0xb')]);router['get'](_0xbbef('0xc'),auth['isAuthenticated'](),controller[_0xbbef('0xd')]);router[_0xbbef('0xe')]('/',auth[_0xbbef('0x7')](),controller['create']);router['post'](_0xbbef('0xa'),auth[_0xbbef('0x7')](),controller[_0xbbef('0xf')]);router['post']('/:id/actions',auth[_0xbbef('0x7')](),controller[_0xbbef('0x10')]);router['put'](_0xbbef('0x9'),auth[_0xbbef('0x7')](),controller['update']);router[_0xbbef('0x11')](_0xbbef('0x9'),auth[_0xbbef('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xb205=['Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','getActions','post','create','addActions','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x28e459,_0x1a066b){var _0x5ccc9e=function(_0x36e31a){while(--_0x36e31a){_0x28e459['push'](_0x28e459['shift']());}};_0x5ccc9e(++_0x1a066b);}(_0xb205,0x156));var _0x5b20=function(_0x43a129,_0x17d8ab){_0x43a129=_0x43a129-0x0;var _0x314353=_0xb205[_0x43a129];return _0x314353;};'use strict';var multer=require(_0x5b20('0x0'));var util=require('util');var path=require(_0x5b20('0x1'));var timeout=require(_0x5b20('0x2'));var express=require('express');var router=express[_0x5b20('0x3')]();var fs_extra=require(_0x5b20('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5b20('0x5'));var config=require(_0x5b20('0x6'));var controller=require(_0x5b20('0x7'));router[_0x5b20('0x8')]('/',auth[_0x5b20('0x9')](),controller[_0x5b20('0xa')]);router[_0x5b20('0x8')](_0x5b20('0xb'),auth[_0x5b20('0x9')](),controller[_0x5b20('0xc')]);router[_0x5b20('0x8')](_0x5b20('0xd'),auth[_0x5b20('0x9')](),controller['getConditions']);router[_0x5b20('0x8')](_0x5b20('0xe'),auth[_0x5b20('0x9')](),controller[_0x5b20('0xf')]);router[_0x5b20('0x10')]('/',auth[_0x5b20('0x9')](),controller[_0x5b20('0x11')]);router['post']('/:id/conditions',auth[_0x5b20('0x9')](),controller['addConditions']);router[_0x5b20('0x10')](_0x5b20('0xe'),auth[_0x5b20('0x9')](),controller[_0x5b20('0x12')]);router['put'](_0x5b20('0xb'),auth[_0x5b20('0x9')](),controller[_0x5b20('0x13')]);router[_0x5b20('0x14')](_0x5b20('0xb'),auth['isAuthenticated'](),controller[_0x5b20('0x15')]);module[_0x5b20('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 22f9ad5..66ce21e 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 _0x5857=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','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,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','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)'];(function(_0x145450,_0x8d1918){var _0x39b89d=function(_0x51f5e7){while(--_0x51f5e7){_0x145450['push'](_0x145450['shift']());}};_0x39b89d(++_0x8d1918);}(_0x5857,0xbf));var _0x7585=function(_0x4ac523,_0x5ce50e){_0x4ac523=_0x4ac523-0x0;var _0x53aa8d=_0x5857[_0x4ac523];return _0x53aa8d;};'use strict';var Sequelize=require(_0x7585('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7585('0x1')](_0x7585('0x2')),'allowNull':![],'defaultValue':_0x7585('0x2')},'description':{'type':Sequelize[_0x7585('0x3')]},'active':{'type':Sequelize[_0x7585('0x4')],'defaultValue':0x0,'comment':_0x7585('0x5')},'limitCalls':{'type':Sequelize[_0x7585('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7585('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7585('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x7585('0x6')](0x3)[_0x7585('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7585('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7585('0x6')](0x3)[_0x7585('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7585('0x6')](0x5)[_0x7585('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7585('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x7585('0x6')](0x3)[_0x7585('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7585('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7585('0x6')](0x5)[_0x7585('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7585('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7585('0x6')](0x3)[_0x7585('0x8')],'defaultValue':0x3,'comment':_0x7585('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7585('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7585('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7585('0x6')](0x3)[_0x7585('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7585('0xf')},'dialTimezone':{'type':Sequelize[_0x7585('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7585('0x3')],'defaultValue':_0x7585('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x7585('0x1')](_0x7585('0x11'),_0x7585('0x12'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x7585('0x4')],'defaultValue':0x0,'comment':_0x7585('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7585('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7585('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x7585('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7585('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7585('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7585('0x6')](0x9)[_0x7585('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x7585('0x6')](0x9)[_0x7585('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7585('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7585('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7585('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x7585('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7585('0x6')](0x5)[_0x7585('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7585('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x7585('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7585('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7585('0x1')](_0x7585('0x1b'),_0x7585('0x1c')),'defaultValue':_0x7585('0x1b')},'dialPrefix':{'type':Sequelize[_0x7585('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x7585('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7585('0x1d')},'dialCutDigit':{'type':Sequelize[_0x7585('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7585('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7585('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7585('0x6')](0x5)[_0x7585('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7585('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7585('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x7585('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7585('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7585('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7585('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7585('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7585('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x7585('0x6')](0x3)[_0x7585('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7585('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7585('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7585('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7585('0x6')](0x3)[_0x7585('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7585('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7585('0x6')](0x5)[_0x7585('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x0f46=['name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING'];(function(_0x53d93e,_0x371336){var _0x11b182=function(_0x3e87fe){while(--_0x3e87fe){_0x53d93e['push'](_0x53d93e['shift']());}};_0x11b182(++_0x371336);}(_0x0f46,0x1a1));var _0x60f4=function(_0x812db,_0x2e8c4d){_0x812db=_0x812db-0x0;var _0xbff811=_0x0f46[_0x812db];return _0xbff811;};'use strict';var Sequelize=require(_0x60f4('0x0'));module[_0x60f4('0x1')]={'name':{'type':Sequelize[_0x60f4('0x2')],'unique':_0x60f4('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x60f4('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x60f4('0x5')],'defaultValue':0x0,'comment':_0x60f4('0x6')},'limitCalls':{'type':Sequelize[_0x60f4('0x7')](0x4)[_0x60f4('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x60f4('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x60f4('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x60f4('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x60f4('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60f4('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x60f4('0x7')](0x3)[_0x60f4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x60f4('0x7')](0x5)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x60f4('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x60f4('0x7')](0x3)[_0x60f4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60f4('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x60f4('0x7')](0x5)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x60f4('0x8')],'defaultValue':0x3,'comment':_0x60f4('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x60f4('0x7')](0x5)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x60f4('0xe')},'dialTimezone':{'type':Sequelize[_0x60f4('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x60f4('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x60f4('0xf')](_0x60f4('0x10'),'never','onlyIfOpen'),'defaultValue':_0x60f4('0x10')},'dialAMDActive':{'type':Sequelize[_0x60f4('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x60f4('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x60f4('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x60f4('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x60f4('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x60f4('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x60f4('0x7')](0x9)[_0x60f4('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x60f4('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x60f4('0x7')](0x9)[_0x60f4('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x60f4('0x7')](0x9)[_0x60f4('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x60f4('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x60f4('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x60f4('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x60f4('0x7')](0x5)[_0x60f4('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x60f4('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x60f4('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x60f4('0xf')](_0x60f4('0x17'),_0x60f4('0x18')),'defaultValue':_0x60f4('0x17')},'dialPrefix':{'type':Sequelize[_0x60f4('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x60f4('0x7')](0x3)[_0x60f4('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x60f4('0x19')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x60f4('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x60f4('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x60f4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60f4('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x60f4('0x7')](0x5)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x60f4('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0x60f4('0x7')](0x3)[_0x60f4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60f4('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x60f4('0x7')](0x5)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x60f4('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x60f4('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60f4('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x60f4('0x7')](0x5)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x60f4('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x60f4('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60f4('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x60f4('0x7')](0x5)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x60f4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60f4('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index b97a0c6..3e01ead 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 _0x3276=['hasOwnProperty','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','field','NOW()','CmListId','toString','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','select','onlyIfOpen','ContactId','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','OrderBy','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','ListId\x20=\x20?','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','IvrCampaigns','error','stack','name','send','Campaign','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filters','filter','merge','where','map','type','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','getHoppers','findOne'];(function(_0x24e91d,_0x5d6ffe){var _0x324d8d=function(_0x53a0e0){while(--_0x53a0e0){_0x24e91d['push'](_0x24e91d['shift']());}};_0x324d8d(++_0x5d6ffe);}(_0x3276,0xc7));var _0x6327=function(_0xd49307,_0x494d50){_0xd49307=_0xd49307-0x0;var _0x5c519=_0x3276[_0xd49307];return _0x5c519;};'use strict';var emlformat=require(_0x6327('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6327('0x1'));var rp=require(_0x6327('0x2'));var moment=require(_0x6327('0x3'));var BPromise=require(_0x6327('0x4'));var Mustache=require(_0x6327('0x5'));var util=require(_0x6327('0x6'));var path=require(_0x6327('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6327('0x8'));var fs=require('fs');var fs_extra=require(_0x6327('0x9'));var _=require(_0x6327('0xa'));var squel=require('squel');var crypto=require(_0x6327('0xb'));var jsforce=require(_0x6327('0xc'));var deskjs=require(_0x6327('0xd'));var toCsv=require(_0x6327('0xe'));var querystring=require('querystring');var Papa=require(_0x6327('0xf'));var Redis=require(_0x6327('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6327('0x11'));var as=require(_0x6327('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6327('0x13'))(_0x6327('0x14'));var utils=require(_0x6327('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6327('0x16'));var db=require(_0x6327('0x17'))['db'];function respondWithStatusCode(_0xb6de72,_0x32408c){_0x32408c=_0x32408c||0xcc;return function(_0x3ff61b){if(_0x3ff61b){return _0xb6de72[_0x6327('0x18')](_0x32408c);}return _0xb6de72[_0x6327('0x19')](_0x32408c)[_0x6327('0x1a')]();};}function respondWithResult(_0x576b1c,_0x306095){_0x306095=_0x306095||0xc8;return function(_0x48eb75){if(_0x48eb75){return _0x576b1c[_0x6327('0x19')](_0x306095)['json'](_0x48eb75);}};}function respondWithFilteredResult(_0x441ff9,_0x1e850c){return function(_0x43186f){if(_0x43186f){var _0x4e9741=typeof _0x1e850c[_0x6327('0x1b')]===_0x6327('0x1c')&&typeof _0x1e850c[_0x6327('0x1d')]===_0x6327('0x1c');var _0x3ea016=_0x43186f[_0x6327('0x1e')];var _0x341a51=_0x4e9741?0x0:_0x1e850c[_0x6327('0x1b')];var _0x287899=_0x4e9741?_0x43186f[_0x6327('0x1e')]:_0x1e850c[_0x6327('0x1b')]+_0x1e850c[_0x6327('0x1d')];var _0x55cf65;if(_0x287899>=_0x3ea016){_0x287899=_0x3ea016;_0x55cf65=0xc8;}else{_0x55cf65=0xce;}_0x441ff9[_0x6327('0x19')](_0x55cf65);return _0x441ff9[_0x6327('0x1f')](_0x6327('0x20'),_0x341a51+'-'+_0x287899+'/'+_0x3ea016)[_0x6327('0x21')](_0x43186f);}return null;};}function patchUpdates(_0x4cbc80){return function(_0x56249b){try{jsonpatch[_0x6327('0x22')](_0x56249b,_0x4cbc80,!![]);}catch(_0x700766){return BPromise[_0x6327('0x23')](_0x700766);}return _0x56249b[_0x6327('0x24')]();};}function saveUpdates(_0x3078c5,_0x76c718){return function(_0x5754e1){if(_0x5754e1){return _0x5754e1[_0x6327('0x25')](_0x3078c5)[_0x6327('0x26')](function(_0x2f153c){return _0x2f153c;});}return null;};}function removeEntity(_0x1c3d7f,_0x302b3f){return function(_0x254c2f){if(_0x254c2f){return _0x254c2f[_0x6327('0x27')]()[_0x6327('0x26')](function(){var _0x10e312=_0x254c2f['get']({'plain':!![]});var _0x51dbe9=_0x6327('0x28');return db['UserProfileResource'][_0x6327('0x27')]({'where':{'type':_0x51dbe9,'resourceId':_0x10e312['id']}})['then'](function(){return _0x254c2f;});})[_0x6327('0x26')](function(){_0x1c3d7f['status'](0xcc)[_0x6327('0x1a')]();});}};}function handleEntityNotFound(_0x1eae65,_0x486f8e){return function(_0x44caac){if(!_0x44caac){_0x1eae65[_0x6327('0x18')](0x194);}return _0x44caac;};}function handleError(_0x14b41b,_0x2540bf){_0x2540bf=_0x2540bf||0x1f4;return function(_0x894157){logger[_0x6327('0x29')](_0x894157[_0x6327('0x2a')]);if(_0x894157[_0x6327('0x2b')]){delete _0x894157['name'];}_0x14b41b[_0x6327('0x19')](_0x2540bf)[_0x6327('0x2c')](_0x894157);};}exports['index']=function(_0x269c33,_0x40e927){var _0x5e8ff5={},_0x43bcd0={},_0x41ecd5={'count':0x0,'rows':[]};var _0x330471=_['map'](db[_0x6327('0x2d')][_0x6327('0x2e')],function(_0x1066d9){return{'name':_0x1066d9[_0x6327('0x2f')],'type':_0x1066d9['type'][_0x6327('0x30')]};});_0x43bcd0['model']=_['map'](_0x330471,_0x6327('0x2b'));_0x43bcd0[_0x6327('0x31')]=_[_0x6327('0x32')](_0x269c33[_0x6327('0x31')]);_0x43bcd0['filters']=_[_0x6327('0x33')](_0x43bcd0[_0x6327('0x34')],_0x43bcd0[_0x6327('0x31')]);_0x5e8ff5[_0x6327('0x35')]=_['intersection'](_0x43bcd0[_0x6327('0x34')],qs[_0x6327('0x36')](_0x269c33[_0x6327('0x31')]['fields']));_0x5e8ff5[_0x6327('0x35')]=_0x5e8ff5[_0x6327('0x35')][_0x6327('0x37')]?_0x5e8ff5['attributes']:_0x43bcd0['model'];if(!_0x269c33[_0x6327('0x31')]['hasOwnProperty'](_0x6327('0x38'))){_0x5e8ff5['limit']=qs[_0x6327('0x1d')](_0x269c33[_0x6327('0x31')][_0x6327('0x1d')]);_0x5e8ff5[_0x6327('0x1b')]=qs[_0x6327('0x1b')](_0x269c33[_0x6327('0x31')]['offset']);}_0x5e8ff5[_0x6327('0x39')]=qs[_0x6327('0x3a')](_0x269c33[_0x6327('0x31')][_0x6327('0x3a')]);_0x5e8ff5['where']=qs['filters'](_[_0x6327('0x3b')](_0x269c33[_0x6327('0x31')],_0x43bcd0[_0x6327('0x3c')]),_0x330471);if(_0x269c33[_0x6327('0x31')][_0x6327('0x3d')]){_0x5e8ff5['where']=_[_0x6327('0x3e')](_0x5e8ff5[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x330471,function(_0x10b988){if(_0x10b988[_0x6327('0x41')]!=='VIRTUAL'){var _0x49a887={};_0x49a887[_0x10b988[_0x6327('0x2b')]]={'$like':'%'+_0x269c33['query'][_0x6327('0x3d')]+'%'};return _0x49a887;}})});}_0x5e8ff5=_[_0x6327('0x3e')]({},_0x5e8ff5,_0x269c33[_0x6327('0x42')]);var _0x46b813={'where':_0x5e8ff5['where']};return db[_0x6327('0x2d')][_0x6327('0x1e')](_0x46b813)[_0x6327('0x26')](function(_0x592f0e){_0x41ecd5[_0x6327('0x1e')]=_0x592f0e;if(_0x269c33[_0x6327('0x31')]['includeAll']){_0x5e8ff5[_0x6327('0x43')]=[{'all':!![]}];}return db[_0x6327('0x2d')][_0x6327('0x44')](_0x5e8ff5);})[_0x6327('0x26')](function(_0xab88fb){_0x41ecd5[_0x6327('0x45')]=_0xab88fb;return _0x41ecd5;})[_0x6327('0x26')](respondWithFilteredResult(_0x40e927,_0x5e8ff5))[_0x6327('0x46')](handleError(_0x40e927,null));};exports[_0x6327('0x47')]=function(_0xc73e4a,_0x446f7c){var _0x3550c9={'raw':![],'where':{'id':_0xc73e4a[_0x6327('0x48')]['id']}},_0x115ed4={};_0x115ed4[_0x6327('0x34')]=_[_0x6327('0x32')](db[_0x6327('0x2d')][_0x6327('0x2e')]);_0x115ed4['query']=_[_0x6327('0x32')](_0xc73e4a[_0x6327('0x31')]);_0x115ed4['filters']=_['intersection'](_0x115ed4['model'],_0x115ed4[_0x6327('0x31')]);_0x3550c9[_0x6327('0x35')]=_['intersection'](_0x115ed4[_0x6327('0x34')],qs[_0x6327('0x36')](_0xc73e4a[_0x6327('0x31')][_0x6327('0x36')]));_0x3550c9[_0x6327('0x35')]=_0x3550c9[_0x6327('0x35')][_0x6327('0x37')]?_0x3550c9[_0x6327('0x35')]:_0x115ed4[_0x6327('0x34')];if(_0xc73e4a['query'][_0x6327('0x49')]){_0x3550c9[_0x6327('0x43')]=[{'all':!![]}];}_0x3550c9=_[_0x6327('0x3e')]({},_0x3550c9,_0xc73e4a['options']);return db[_0x6327('0x2d')][_0x6327('0x4a')](_0x3550c9)[_0x6327('0x26')](handleEntityNotFound(_0x446f7c,null))[_0x6327('0x26')](respondWithResult(_0x446f7c,null))['catch'](handleError(_0x446f7c,null));};exports[_0x6327('0x4b')]=function(_0x317edf,_0x3fc622){return db[_0x6327('0x2d')][_0x6327('0x4b')](_0x317edf[_0x6327('0x4c')],{})[_0x6327('0x26')](function(_0x33e8d3){var _0x11030e=_0x317edf[_0x6327('0x4d')][_0x6327('0x4e')]({'plain':!![]});if(!_0x11030e)throw new Error(_0x6327('0x4f'));if(_0x11030e[_0x6327('0x50')]===_0x6327('0x4d')){var _0x5e664d=_0x33e8d3['get']({'plain':!![]});var _0x1f95b6=_0x6327('0x28');return db[_0x6327('0x51')][_0x6327('0x4a')]({'where':{'name':_0x1f95b6,'userProfileId':_0x11030e[_0x6327('0x52')]},'raw':!![]})[_0x6327('0x26')](function(_0xc07c32){if(_0xc07c32&&_0xc07c32[_0x6327('0x53')]===0x0){return db[_0x6327('0x54')][_0x6327('0x4b')]({'name':_0x5e664d[_0x6327('0x2b')],'resourceId':_0x5e664d['id'],'type':_0xc07c32[_0x6327('0x2b')],'sectionId':_0xc07c32['id']},{})[_0x6327('0x26')](function(){return _0x33e8d3;});}else{return _0x33e8d3;}})[_0x6327('0x46')](function(_0x5daaed){logger[_0x6327('0x29')](_0x6327('0x55'),_0x5daaed);throw _0x5daaed;});}return _0x33e8d3;})[_0x6327('0x26')](respondWithResult(_0x3fc622,0xc9))[_0x6327('0x46')](handleError(_0x3fc622,null));};exports['clone']=function(_0x3e2b4f,_0x2ad46b){var _0x12862d={'where':{'id':_0x3e2b4f[_0x6327('0x48')]['id']}},_0x1bf90e={};_0x1bf90e['model']=_[_0x6327('0x32')](db['Campaign'][_0x6327('0x2e')]);_0x12862d[_0x6327('0x35')]=_[_0x6327('0x33')](_0x1bf90e[_0x6327('0x34')],qs[_0x6327('0x36')](_0x3e2b4f[_0x6327('0x31')]['fields']));_0x12862d[_0x6327('0x35')]=_0x12862d[_0x6327('0x35')]['length']?_0x12862d[_0x6327('0x35')]:_0x1bf90e[_0x6327('0x34')];if(_0x3e2b4f[_0x6327('0x31')][_0x6327('0x49')]){_0x12862d[_0x6327('0x43')]=[{'all':!![]}];}_0x12862d=_[_0x6327('0x3e')]({},_0x12862d,_0x3e2b4f[_0x6327('0x42')]);return db[_0x6327('0x2d')]['find'](_0x12862d)[_0x6327('0x26')](handleEntityNotFound(_0x2ad46b,null))[_0x6327('0x26')](function(_0x46c6bd){if(_0x46c6bd){var _0x2188c2=_0x46c6bd[_0x6327('0x4e')]({'plain':!![]});_0x2188c2=qs[_0x6327('0x56')](_0x2188c2,['id','createdAt',_0x6327('0x57')]);_0x3e2b4f['body']=_[_0x6327('0x56')](_0x3e2b4f[_0x6327('0x4c')],['id',_0x6327('0x58'),_0x6327('0x57')]);return db[_0x6327('0x2d')][_0x6327('0x4b')](_[_0x6327('0x3e')](_0x2188c2,_0x3e2b4f[_0x6327('0x4c')]),{'include':_0x3e2b4f[_0x6327('0x31')][_0x6327('0x49')]?[{'all':!![]}]:undefined})[_0x6327('0x26')](function(_0x36f28a){var _0x3f0115=_0x3e2b4f['user'][_0x6327('0x4e')]({'plain':!![]});if(!_0x3f0115)throw new Error(_0x6327('0x4f'));if(_0x3f0115[_0x6327('0x50')]==='user'){var _0xbf5d09=_0x36f28a[_0x6327('0x4e')]({'plain':!![]});var _0x57ca83='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x57ca83,'userProfileId':_0x3f0115[_0x6327('0x52')]},'raw':!![]})[_0x6327('0x26')](function(_0x36f8c2){if(_0x36f8c2&&_0x36f8c2[_0x6327('0x53')]===0x0){return db[_0x6327('0x54')]['create']({'name':_0xbf5d09['name'],'resourceId':_0xbf5d09['id'],'type':_0x36f8c2[_0x6327('0x2b')],'sectionId':_0x36f8c2['id']},{})[_0x6327('0x26')](function(){return _0x36f28a;});}else{return _0x36f28a;}})['catch'](function(_0x28f13e){logger[_0x6327('0x29')](_0x6327('0x55'),_0x28f13e);throw _0x28f13e;});}return _0x36f28a;});}})[_0x6327('0x26')](respondWithResult(_0x2ad46b,0xc9))[_0x6327('0x46')](handleError(_0x2ad46b,null));};exports[_0x6327('0x25')]=function(_0x4b4031,_0x5446db){if(_0x4b4031['body']['id']){delete _0x4b4031[_0x6327('0x4c')]['id'];}return db[_0x6327('0x2d')]['find']({'where':{'id':_0x4b4031['params']['id']}})['then'](handleEntityNotFound(_0x5446db,null))[_0x6327('0x26')](saveUpdates(_0x4b4031[_0x6327('0x4c')],null))[_0x6327('0x26')](respondWithResult(_0x5446db,null))[_0x6327('0x46')](handleError(_0x5446db,null));};exports['destroy']=function(_0x3e66b5,_0x276fe1){return db[_0x6327('0x2d')]['find']({'where':{'id':_0x3e66b5['params']['id']}})['then'](handleEntityNotFound(_0x276fe1,null))[_0x6327('0x26')](removeEntity(_0x276fe1,null))[_0x6327('0x46')](handleError(_0x276fe1,null));};exports[_0x6327('0x59')]=function(_0x4c9e12,_0x513e06,_0x54326a){var _0x17b571={'raw':!![],'where':{}};var _0x5bbc4a={};var _0x1e2376={'count':0x0,'rows':[]};return db['Campaign'][_0x6327('0x5a')]({'where':{'id':_0x4c9e12[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x513e06,null))['then'](function(_0x4bdeab){if(_0x4bdeab){_0x5bbc4a[_0x6327('0x34')]=_[_0x6327('0x32')](db['CmHopper'][_0x6327('0x2e')]);_0x5bbc4a[_0x6327('0x31')]=_[_0x6327('0x32')](_0x4c9e12['query']);_0x5bbc4a[_0x6327('0x3c')]=_['intersection'](_0x5bbc4a[_0x6327('0x34')],_0x5bbc4a[_0x6327('0x31')]);_0x17b571[_0x6327('0x35')]=_[_0x6327('0x33')](_0x5bbc4a[_0x6327('0x34')],qs[_0x6327('0x36')](_0x4c9e12[_0x6327('0x31')][_0x6327('0x36')]));_0x17b571['attributes']=_0x17b571[_0x6327('0x35')][_0x6327('0x37')]?_0x17b571[_0x6327('0x35')]:_0x5bbc4a[_0x6327('0x34')];if(!_0x4c9e12['query'][_0x6327('0x5b')](_0x6327('0x38'))){_0x17b571[_0x6327('0x1d')]=qs[_0x6327('0x1d')](_0x4c9e12['query'][_0x6327('0x1d')]);_0x17b571[_0x6327('0x1b')]=qs['offset'](_0x4c9e12[_0x6327('0x31')][_0x6327('0x1b')]);}_0x17b571['order']=qs[_0x6327('0x3a')](_0x4c9e12['query'][_0x6327('0x3a')]);_0x17b571[_0x6327('0x3f')]=qs[_0x6327('0x3c')](_['pick'](_0x4c9e12[_0x6327('0x31')],_0x5bbc4a['filters']));_0x17b571['where'][_0x6327('0x5c')]=_0x4bdeab['id'];if(_0x4c9e12['query'][_0x6327('0x3d')]){_0x17b571[_0x6327('0x3f')]=_[_0x6327('0x3e')](_0x17b571[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x17b571[_0x6327('0x35')],function(_0x1b3a5e){var _0x29ee0f={};_0x29ee0f[_0x1b3a5e]={'$like':'%'+_0x4c9e12[_0x6327('0x31')][_0x6327('0x3d')]+'%'};return _0x29ee0f;})});}_0x17b571=_['merge']({},_0x17b571,_0x4c9e12[_0x6327('0x42')]);return db[_0x6327('0x5d')][_0x6327('0x1e')]({'where':_0x17b571['where']})['then'](function(_0x55645d){_0x1e2376['count']=_0x55645d;if(_0x4c9e12[_0x6327('0x31')][_0x6327('0x49')]){_0x17b571[_0x6327('0x43')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x17b571);})[_0x6327('0x26')](function(_0x45bc3d){_0x1e2376[_0x6327('0x45')]=_0x45bc3d;return _0x1e2376;});}})[_0x6327('0x26')](respondWithFilteredResult(_0x513e06,_0x17b571))['catch'](handleError(_0x513e06,null));};exports[_0x6327('0x5e')]=function(_0x7d3f15,_0x4346b8,_0x3973dd){var _0x188557={'raw':!![],'where':{}};var _0x33b36f={};var _0x3ecb75={'count':0x0,'rows':[]};return db['Campaign'][_0x6327('0x5a')]({'where':{'id':_0x7d3f15['params']['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x4346b8,null))[_0x6327('0x26')](function(_0x101a46){if(_0x101a46){_0x33b36f['model']=_[_0x6327('0x32')](db[_0x6327('0x5f')][_0x6327('0x2e')]);_0x33b36f[_0x6327('0x31')]=_[_0x6327('0x32')](_0x7d3f15['query']);_0x33b36f['filters']=_[_0x6327('0x33')](_0x33b36f[_0x6327('0x34')],_0x33b36f[_0x6327('0x31')]);_0x188557['attributes']=_[_0x6327('0x33')](_0x33b36f[_0x6327('0x34')],qs[_0x6327('0x36')](_0x7d3f15[_0x6327('0x31')]['fields']));_0x188557['attributes']=_0x188557[_0x6327('0x35')][_0x6327('0x37')]?_0x188557['attributes']:_0x33b36f['model'];if(!_0x7d3f15[_0x6327('0x31')][_0x6327('0x5b')](_0x6327('0x38'))){_0x188557[_0x6327('0x1d')]=qs[_0x6327('0x1d')](_0x7d3f15[_0x6327('0x31')][_0x6327('0x1d')]);_0x188557[_0x6327('0x1b')]=qs['offset'](_0x7d3f15['query'][_0x6327('0x1b')]);}_0x188557[_0x6327('0x39')]=qs[_0x6327('0x3a')](_0x7d3f15['query']['sort']);_0x188557['where']=qs[_0x6327('0x3c')](_['pick'](_0x7d3f15[_0x6327('0x31')],_0x33b36f['filters']));_0x188557['where']['CampaignId']=_0x101a46['id'];if(_0x7d3f15[_0x6327('0x31')]['filter']){_0x188557[_0x6327('0x3f')]=_[_0x6327('0x3e')](_0x188557[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x188557['attributes'],function(_0x2936da){var _0x5e721b={};_0x5e721b[_0x2936da]={'$like':'%'+_0x7d3f15[_0x6327('0x31')][_0x6327('0x3d')]+'%'};return _0x5e721b;})});}_0x188557=_[_0x6327('0x3e')]({},_0x188557,_0x7d3f15[_0x6327('0x42')]);return db[_0x6327('0x5f')][_0x6327('0x1e')]({'where':_0x188557[_0x6327('0x3f')]})[_0x6327('0x26')](function(_0x52b63f){_0x3ecb75['count']=_0x52b63f;if(_0x7d3f15[_0x6327('0x31')][_0x6327('0x49')]){_0x188557[_0x6327('0x43')]=[{'all':!![]}];}return db[_0x6327('0x5f')][_0x6327('0x44')](_0x188557);})[_0x6327('0x26')](function(_0x561b1a){_0x3ecb75[_0x6327('0x45')]=_0x561b1a;return _0x3ecb75;});}})[_0x6327('0x26')](respondWithFilteredResult(_0x4346b8,_0x188557))[_0x6327('0x46')](handleError(_0x4346b8,null));};exports['getHopperFinals']=function(_0x59a5cc,_0x15a1dc,_0x424e54){var _0x35477c={'raw':!![],'where':{}};var _0x1193c5={};var _0x12726d={'count':0x0,'rows':[]};return db[_0x6327('0x2d')]['findOne']({'where':{'id':_0x59a5cc[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x15a1dc,null))[_0x6327('0x26')](function(_0x40019b){if(_0x40019b){_0x1193c5[_0x6327('0x34')]=_[_0x6327('0x32')](db[_0x6327('0x60')]['rawAttributes']);_0x1193c5[_0x6327('0x31')]=_[_0x6327('0x32')](_0x59a5cc[_0x6327('0x31')]);_0x1193c5[_0x6327('0x3c')]=_[_0x6327('0x33')](_0x1193c5['model'],_0x1193c5['query']);_0x35477c[_0x6327('0x35')]=_[_0x6327('0x33')](_0x1193c5[_0x6327('0x34')],qs[_0x6327('0x36')](_0x59a5cc[_0x6327('0x31')][_0x6327('0x36')]));_0x35477c['attributes']=_0x35477c[_0x6327('0x35')][_0x6327('0x37')]?_0x35477c[_0x6327('0x35')]:_0x1193c5['model'];if(!_0x59a5cc[_0x6327('0x31')][_0x6327('0x5b')](_0x6327('0x38'))){_0x35477c[_0x6327('0x1d')]=qs['limit'](_0x59a5cc[_0x6327('0x31')][_0x6327('0x1d')]);_0x35477c[_0x6327('0x1b')]=qs[_0x6327('0x1b')](_0x59a5cc[_0x6327('0x31')][_0x6327('0x1b')]);}_0x35477c[_0x6327('0x39')]=qs[_0x6327('0x3a')](_0x59a5cc[_0x6327('0x31')]['sort']);_0x35477c[_0x6327('0x3f')]=qs['filters'](_[_0x6327('0x3b')](_0x59a5cc[_0x6327('0x31')],_0x1193c5['filters']));_0x35477c[_0x6327('0x3f')]['CampaignId']=_0x40019b['id'];if(_0x59a5cc[_0x6327('0x31')]['filter']){_0x35477c[_0x6327('0x3f')]=_['merge'](_0x35477c[_0x6327('0x3f')],{'$or':_['map'](_0x35477c[_0x6327('0x35')],function(_0xb46760){var _0x173560={};_0x173560[_0xb46760]={'$like':'%'+_0x59a5cc['query']['filter']+'%'};return _0x173560;})});}_0x35477c=_[_0x6327('0x3e')]({},_0x35477c,_0x59a5cc[_0x6327('0x42')]);return db['CmHopperFinal'][_0x6327('0x1e')]({'where':_0x35477c[_0x6327('0x3f')]})[_0x6327('0x26')](function(_0x5d6a16){_0x12726d[_0x6327('0x1e')]=_0x5d6a16;if(_0x59a5cc[_0x6327('0x31')]['includeAll']){_0x35477c['include']=[{'all':!![]}];}return db[_0x6327('0x60')][_0x6327('0x44')](_0x35477c);})[_0x6327('0x26')](function(_0x3f23c4){_0x12726d['rows']=_0x3f23c4;return _0x12726d;});}})[_0x6327('0x26')](respondWithFilteredResult(_0x15a1dc,_0x35477c))[_0x6327('0x46')](handleError(_0x15a1dc,null));};exports[_0x6327('0x61')]=function(_0x48645b,_0xf25a85,_0x18cba6){var _0x6c8c4c={'raw':!![],'where':{}};var _0x1b6b96={};var _0x254fdc={'count':0x0,'rows':[]};return db[_0x6327('0x2d')][_0x6327('0x5a')]({'where':{'id':_0x48645b[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0xf25a85,null))[_0x6327('0x26')](function(_0x43eae1){if(_0x43eae1){_0x1b6b96['model']=_[_0x6327('0x32')](db['CmHopperBlack'][_0x6327('0x2e')]);_0x1b6b96[_0x6327('0x31')]=_[_0x6327('0x32')](_0x48645b[_0x6327('0x31')]);_0x1b6b96[_0x6327('0x3c')]=_['intersection'](_0x1b6b96[_0x6327('0x34')],_0x1b6b96['query']);_0x6c8c4c[_0x6327('0x35')]=_[_0x6327('0x33')](_0x1b6b96[_0x6327('0x34')],qs[_0x6327('0x36')](_0x48645b[_0x6327('0x31')][_0x6327('0x36')]));_0x6c8c4c[_0x6327('0x35')]=_0x6c8c4c[_0x6327('0x35')][_0x6327('0x37')]?_0x6c8c4c[_0x6327('0x35')]:_0x1b6b96[_0x6327('0x34')];if(!_0x48645b[_0x6327('0x31')][_0x6327('0x5b')]('nolimit')){_0x6c8c4c[_0x6327('0x1d')]=qs['limit'](_0x48645b['query'][_0x6327('0x1d')]);_0x6c8c4c[_0x6327('0x1b')]=qs[_0x6327('0x1b')](_0x48645b[_0x6327('0x31')]['offset']);}_0x6c8c4c[_0x6327('0x39')]=qs['sort'](_0x48645b['query']['sort']);_0x6c8c4c['where']=qs[_0x6327('0x3c')](_['pick'](_0x48645b[_0x6327('0x31')],_0x1b6b96[_0x6327('0x3c')]));_0x6c8c4c[_0x6327('0x3f')]['CampaignId']=_0x43eae1['id'];if(_0x48645b[_0x6327('0x31')][_0x6327('0x3d')]){_0x6c8c4c[_0x6327('0x3f')]=_['merge'](_0x6c8c4c[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x6c8c4c[_0x6327('0x35')],function(_0x267bdc){var _0x30e33c={};_0x30e33c[_0x267bdc]={'$like':'%'+_0x48645b[_0x6327('0x31')][_0x6327('0x3d')]+'%'};return _0x30e33c;})});}_0x6c8c4c=_[_0x6327('0x3e')]({},_0x6c8c4c,_0x48645b[_0x6327('0x42')]);return db[_0x6327('0x62')][_0x6327('0x1e')]({'where':_0x6c8c4c['where']})['then'](function(_0x2a225b){_0x254fdc[_0x6327('0x1e')]=_0x2a225b;if(_0x48645b[_0x6327('0x31')]['includeAll']){_0x6c8c4c['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x6327('0x44')](_0x6c8c4c);})['then'](function(_0x43381e){_0x254fdc[_0x6327('0x45')]=_0x43381e;return _0x254fdc;});}})['then'](respondWithFilteredResult(_0xf25a85,_0x6c8c4c))[_0x6327('0x46')](handleError(_0xf25a85,null));};exports[_0x6327('0x63')]=function(_0x2bb6e5,_0x59b7f0,_0x1c9921){var _0x3fed01={};var _0x345f6c={};var _0xd091e1;var _0x9f1c8d;return db[_0x6327('0x2d')][_0x6327('0x5a')]({'where':{'id':_0x2bb6e5['params']['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x59b7f0,null))[_0x6327('0x26')](function(_0x27e847){if(_0x27e847){_0xd091e1=_0x27e847;_0x345f6c[_0x6327('0x34')]=_[_0x6327('0x32')](db[_0x6327('0x64')][_0x6327('0x2e')]);_0x345f6c['query']=_[_0x6327('0x32')](_0x2bb6e5[_0x6327('0x31')]);_0x345f6c[_0x6327('0x3c')]=_[_0x6327('0x33')](_0x345f6c[_0x6327('0x34')],_0x345f6c[_0x6327('0x31')]);_0x3fed01[_0x6327('0x35')]=_[_0x6327('0x33')](_0x345f6c[_0x6327('0x34')],qs[_0x6327('0x36')](_0x2bb6e5[_0x6327('0x31')][_0x6327('0x36')]));_0x3fed01[_0x6327('0x35')]=_0x3fed01['attributes']['length']?_0x3fed01[_0x6327('0x35')]:_0x345f6c[_0x6327('0x34')];_0x3fed01[_0x6327('0x39')]=qs[_0x6327('0x3a')](_0x2bb6e5[_0x6327('0x31')][_0x6327('0x3a')]);_0x3fed01[_0x6327('0x3f')]=qs[_0x6327('0x3c')](_[_0x6327('0x3b')](_0x2bb6e5[_0x6327('0x31')],_0x345f6c['filters']));if(_0x2bb6e5[_0x6327('0x31')][_0x6327('0x3d')]){_0x3fed01[_0x6327('0x3f')]=_[_0x6327('0x3e')](_0x3fed01[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x3fed01[_0x6327('0x35')],function(_0x13abc5){var _0x518315={};_0x518315[_0x13abc5]={'$like':'%'+_0x2bb6e5[_0x6327('0x31')][_0x6327('0x3d')]+'%'};return _0x518315;})});}_0x3fed01=_[_0x6327('0x3e')]({},_0x3fed01,_0x2bb6e5['options']);return _0xd091e1[_0x6327('0x63')](_0x3fed01);}})[_0x6327('0x26')](function(_0x42d4ff){if(_0x42d4ff){_0x9f1c8d=_0x42d4ff[_0x6327('0x37')];if(!_0x2bb6e5[_0x6327('0x31')][_0x6327('0x5b')](_0x6327('0x38'))){_0x3fed01[_0x6327('0x1d')]=qs[_0x6327('0x1d')](_0x2bb6e5[_0x6327('0x31')]['limit']);_0x3fed01[_0x6327('0x1b')]=qs[_0x6327('0x1b')](_0x2bb6e5[_0x6327('0x31')][_0x6327('0x1b')]);}return _0xd091e1[_0x6327('0x63')](_0x3fed01);}})['then'](function(_0x48888c){if(_0x48888c){return _0x48888c?{'count':_0x9f1c8d,'rows':_0x48888c}:null;}})['then'](respondWithResult(_0x59b7f0,null))[_0x6327('0x46')](handleError(_0x59b7f0,null));};exports[_0x6327('0x65')]=function(_0x3f1526,_0x3cd50a,_0x718062){var _0x132990,_0x486571;var _0x56c2b0=[];var _0x364719=moment()[_0x6327('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x6327('0x4a')]({'where':{'id':_0x3f1526[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x3cd50a,null))[_0x6327('0x26')](function(_0x594fb3){if(_0x594fb3){_0x486571=_0x594fb3;return _0x594fb3[_0x6327('0x65')](_0x3f1526[_0x6327('0x4c')][_0x6327('0x67')],_[_0x6327('0x56')](_0x3f1526[_0x6327('0x4c')],[_0x6327('0x67'),'id'])||{});}return null;})[_0x6327('0x68')](function(_0x9e2e85){var _0x4174e4;var _0x4fa038;_0x132990=_0x9e2e85||[];var _0x570605=[];if(_0x9e2e85){for(var _0x1aa3ba=0x0;_0x1aa3ba<_0x9e2e85[_0x6327('0x37')];_0x1aa3ba+=0x1){var _0x3534a9=_0x9e2e85[_0x1aa3ba]['get']({'plain':!![]});_0x486571['dialCheckDuplicateType']=_0x3f1526[_0x6327('0x4c')]['dialCheckDuplicateType']?_0x3f1526[_0x6327('0x4c')][_0x6327('0x69')]:_0x486571[_0x6327('0x69')];switch(_0x486571[_0x6327('0x69')]){case _0x6327('0x6a'):_0x4174e4=squel[_0x6327('0x6b')]()[_0x6327('0x6c')](_0x6327('0x6d'))[_0x6327('0x6e')]([_0x6327('0x6f'),_0x6327('0x70'),'ContactId',_0x6327('0x71'),_0x6327('0x5c'),_0x6327('0x58'),_0x6327('0x57')],squel['select']()[_0x6327('0x72')](_0x6327('0x6f'),_0x6327('0x6f'))[_0x6327('0x72')](_0x6327('0x73'),_0x6327('0x70'))[_0x6327('0x72')]('id','ContactId')[_0x6327('0x72')](_0x3534a9[_0x6327('0x74')][_0x6327('0x75')](),'ListId')[_0x6327('0x72')](_0x3f1526['params']['id'][_0x6327('0x75')](),_0x6327('0x5c'))[_0x6327('0x72')]('\x27'+_0x364719+'\x27','createdAt')[_0x6327('0x72')]('\x27'+_0x364719+'\x27',_0x6327('0x57'))[_0x6327('0x76')](_0x6327('0x77'))[_0x6327('0x3f')]('deletedAt\x20IS\x20NULL')[_0x6327('0x3f')]('ListId\x20=\x20?',_0x3534a9[_0x6327('0x74')][_0x6327('0x75')]())[_0x6327('0x3f')](_0x6327('0x78'))[_0x6327('0x3f')](_0x6327('0x79'),squel['select']()['field'](_0x6327('0x7a'))['from'](_0x6327('0x7b'))[_0x6327('0x3f')](_0x6327('0x7c'),_0x3f1526[_0x6327('0x48')]['id'][_0x6327('0x75')]()))[_0x6327('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6327('0x7d')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x6327('0x6d'))[_0x6327('0x3f')]('CampaignId\x20=\x20?',_0x3f1526[_0x6327('0x48')]['id'][_0x6327('0x75')]())))['toString']();break;case _0x6327('0x7e'):_0x4174e4=squel[_0x6327('0x6b')]()[_0x6327('0x6c')](_0x6327('0x6d'))[_0x6327('0x6e')]([_0x6327('0x6f'),_0x6327('0x70'),_0x6327('0x7f'),_0x6327('0x71'),_0x6327('0x5c'),_0x6327('0x58'),_0x6327('0x57')],squel[_0x6327('0x7d')]()[_0x6327('0x72')](_0x6327('0x6f'),_0x6327('0x6f'))[_0x6327('0x72')]('NOW()',_0x6327('0x70'))[_0x6327('0x72')]('id',_0x6327('0x7f'))[_0x6327('0x72')](_0x3534a9[_0x6327('0x74')][_0x6327('0x75')](),_0x6327('0x71'))[_0x6327('0x72')](_0x3f1526[_0x6327('0x48')]['id']['toString'](),_0x6327('0x5c'))[_0x6327('0x72')]('\x27'+_0x364719+'\x27','createdAt')[_0x6327('0x72')]('\x27'+_0x364719+'\x27','updatedAt')[_0x6327('0x76')](_0x6327('0x77'))[_0x6327('0x3f')]('deletedAt\x20IS\x20NULL')[_0x6327('0x3f')]('ListId\x20=\x20?',_0x3534a9[_0x6327('0x74')][_0x6327('0x75')]())[_0x6327('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0x6327('0x3f')](_0x6327('0x79'),squel[_0x6327('0x7d')]()[_0x6327('0x72')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x6327('0x3f')]('CampaignId\x20=\x20?',_0x3f1526['params']['id'][_0x6327('0x75')]())))[_0x6327('0x75')]();break;default:_0x4174e4=squel[_0x6327('0x6b')]()[_0x6327('0x6c')]('cm_hopper')['fromQuery']([_0x6327('0x6f'),'scheduledAt',_0x6327('0x7f'),_0x6327('0x71'),'CampaignId',_0x6327('0x58'),'updatedAt'],squel[_0x6327('0x7d')]()['field'](_0x6327('0x6f'),'phone')[_0x6327('0x72')](_0x6327('0x73'),_0x6327('0x70'))[_0x6327('0x72')]('id',_0x6327('0x7f'))[_0x6327('0x72')](_0x3534a9['CmListId'][_0x6327('0x75')](),_0x6327('0x71'))['field'](_0x3f1526['params']['id']['toString'](),_0x6327('0x5c'))['field']('\x27'+_0x364719+'\x27',_0x6327('0x58'))[_0x6327('0x72')]('\x27'+_0x364719+'\x27',_0x6327('0x57'))['from']('cm_contacts')['where'](_0x6327('0x80'))[_0x6327('0x3f')]('ListId\x20=\x20?',_0x3534a9['CmListId'][_0x6327('0x75')]())[_0x6327('0x3f')](_0x6327('0x78')))['toString']();}_0x4fa038=squel[_0x6327('0x6b')]()[_0x6327('0x6c')](_0x6327('0x81'))['fromQuery'](['cmHopperId',_0x6327('0x70'),_0x6327('0x6f'),_0x6327('0x82'),'createdAt','updatedAt'],squel[_0x6327('0x7d')]()[_0x6327('0x72')]('h.id','id')[_0x6327('0x72')](_0x6327('0x73'),'scheduledAt')[_0x6327('0x72')]('ci.item','phone')[_0x6327('0x72')](_0x6327('0x83'),_0x6327('0x82'))[_0x6327('0x72')]('\x27'+_0x364719+'\x27',_0x6327('0x58'))[_0x6327('0x72')]('\x27'+_0x364719+'\x27',_0x6327('0x57'))[_0x6327('0x76')](_0x6327('0x84'),'ci')[_0x6327('0x85')](_0x6327('0x6d'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x6327('0x3f')](_0x6327('0x86'),_0x3534a9[_0x6327('0x74')][_0x6327('0x75')]())[_0x6327('0x3f')](_0x6327('0x87'),_0x3f1526[_0x6327('0x48')]['id'][_0x6327('0x75')]())[_0x6327('0x3f')](_0x6327('0x88'),_0x364719))[_0x6327('0x75')]();_0x570605[_0x6327('0x89')](db[_0x6327('0x8a')]['query'](_0x4174e4));_0x56c2b0[_0x6327('0x89')](db[_0x6327('0x8a')][_0x6327('0x31')](_0x4fa038));}return BPromise[_0x6327('0x8b')](_0x570605);}})['then'](function(){return BPromise[_0x6327('0x8b')](_0x56c2b0);})[_0x6327('0x26')](function(){return _0x132990;})[_0x6327('0x26')](respondWithResult(_0x3cd50a,null))[_0x6327('0x46')](handleError(_0x3cd50a,null));};exports[_0x6327('0x8c')]=function(_0x1a719a,_0x13a38c,_0x457343){return db[_0x6327('0x2d')][_0x6327('0x4a')]({'where':{'id':_0x1a719a[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x13a38c,null))[_0x6327('0x26')](function(_0xdad37e){if(_0xdad37e){return _0xdad37e[_0x6327('0x8c')](_0x1a719a[_0x6327('0x31')][_0x6327('0x67')]);}})[_0x6327('0x26')](function(_0x1f4b95){if(_0x1f4b95){return db[_0x6327('0x5d')][_0x6327('0x27')]({'where':{'ListId':_0x1a719a[_0x6327('0x31')][_0x6327('0x67')],'CampaignId':_0x1a719a[_0x6327('0x48')]['id']}})[_0x6327('0x26')](function(){return _0x1f4b95;});}})[_0x6327('0x26')](respondWithStatusCode(_0x13a38c,null))[_0x6327('0x46')](handleError(_0x13a38c,null));};exports[_0x6327('0x8d')]=function(_0x49975c,_0x6546a9,_0x526d09){var _0x26582e={};var _0x4f0579={};var _0x4ec482;var _0xf593bf;return db[_0x6327('0x2d')][_0x6327('0x5a')]({'where':{'id':_0x49975c[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x6546a9,null))[_0x6327('0x26')](function(_0xaee17e){if(_0xaee17e){_0x4ec482=_0xaee17e;_0x4f0579[_0x6327('0x34')]=_[_0x6327('0x32')](db[_0x6327('0x64')][_0x6327('0x2e')]);_0x4f0579[_0x6327('0x31')]=_[_0x6327('0x32')](_0x49975c[_0x6327('0x31')]);_0x4f0579['filters']=_[_0x6327('0x33')](_0x4f0579[_0x6327('0x34')],_0x4f0579[_0x6327('0x31')]);_0x26582e['attributes']=_['intersection'](_0x4f0579['model'],qs['fields'](_0x49975c[_0x6327('0x31')][_0x6327('0x36')]));_0x26582e[_0x6327('0x35')]=_0x26582e['attributes'][_0x6327('0x37')]?_0x26582e[_0x6327('0x35')]:_0x4f0579[_0x6327('0x34')];_0x26582e[_0x6327('0x39')]=qs[_0x6327('0x3a')](_0x49975c[_0x6327('0x31')][_0x6327('0x3a')]);_0x26582e[_0x6327('0x3f')]=qs[_0x6327('0x3c')](_[_0x6327('0x3b')](_0x49975c[_0x6327('0x31')],_0x4f0579[_0x6327('0x3c')]));if(_0x49975c[_0x6327('0x31')][_0x6327('0x3d')]){_0x26582e[_0x6327('0x3f')]=_[_0x6327('0x3e')](_0x26582e[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x26582e[_0x6327('0x35')],function(_0x3d7eea){var _0x30f233={};_0x30f233[_0x3d7eea]={'$like':'%'+_0x49975c[_0x6327('0x31')][_0x6327('0x3d')]+'%'};return _0x30f233;})});}_0x26582e=_[_0x6327('0x3e')]({},_0x26582e,_0x49975c[_0x6327('0x42')]);return _0x4ec482[_0x6327('0x8d')](_0x26582e);}})[_0x6327('0x26')](function(_0x21df66){if(_0x21df66){_0xf593bf=_0x21df66[_0x6327('0x37')];if(!_0x49975c[_0x6327('0x31')][_0x6327('0x5b')]('nolimit')){_0x26582e['limit']=qs[_0x6327('0x1d')](_0x49975c[_0x6327('0x31')]['limit']);_0x26582e[_0x6327('0x1b')]=qs['offset'](_0x49975c[_0x6327('0x31')]['offset']);}return _0x4ec482[_0x6327('0x8d')](_0x26582e);}})[_0x6327('0x26')](function(_0x52c67a){if(_0x52c67a){return _0x52c67a?{'count':_0xf593bf,'rows':_0x52c67a}:null;}})['then'](respondWithResult(_0x6546a9,null))[_0x6327('0x46')](handleError(_0x6546a9,null));};exports[_0x6327('0x8e')]=function(_0x4e7082,_0x497d7f,_0x3f5ddc){var _0x40047b,_0xf8d14c;var _0x431412=[];var _0x3f1690=moment()[_0x6327('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x6327('0x2d')][_0x6327('0x4a')]({'where':{'id':_0x4e7082[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x497d7f,null))[_0x6327('0x26')](function(_0x4bf469){if(_0x4bf469){_0xf8d14c=_0x4bf469;return _0x4bf469['addBlackLists'](_0x4e7082['body'][_0x6327('0x67')],_['omit'](_0x4e7082[_0x6327('0x4c')],['ids','id'])||{});}return null;})[_0x6327('0x68')](function(_0x2e28c7){var _0x464324;var _0x86039;_0x40047b=_0x2e28c7||[];var _0x2980d1=[];if(_0x2e28c7){for(var _0x589d31=0x0;_0x589d31<_0x2e28c7[_0x6327('0x37')];_0x589d31+=0x1){var _0x2d6ed2=_0x2e28c7[_0x589d31][_0x6327('0x4e')]({'plain':!![]});_0x464324=squel[_0x6327('0x6b')]()['into']('cm_hopper_black')[_0x6327('0x6e')]([_0x6327('0x6f'),_0x6327('0x7f'),_0x6327('0x71'),_0x6327('0x5c'),_0x6327('0x58'),_0x6327('0x57')],squel['select']()[_0x6327('0x72')](_0x6327('0x6f'),_0x6327('0x6f'))['field']('id','ContactId')[_0x6327('0x72')](_0x2d6ed2[_0x6327('0x74')][_0x6327('0x75')](),'ListId')['field'](_0x4e7082[_0x6327('0x48')]['id'][_0x6327('0x75')](),'CampaignId')[_0x6327('0x72')](_0x6327('0x73'),'createdAt')[_0x6327('0x72')](_0x6327('0x73'),_0x6327('0x57'))[_0x6327('0x76')](_0x6327('0x77'))[_0x6327('0x3f')](_0x6327('0x80'))[_0x6327('0x3f')](_0x6327('0x8f'),_0x2d6ed2[_0x6327('0x74')][_0x6327('0x75')]())[_0x6327('0x3f')](_0x6327('0x78')))[_0x6327('0x75')]();_0x2980d1[_0x6327('0x89')](db[_0x6327('0x8a')][_0x6327('0x31')](_0x464324));}return BPromise[_0x6327('0x8b')](_0x2980d1);}})['then'](function(){return _0x40047b;})[_0x6327('0x26')](respondWithResult(_0x497d7f,null))['catch'](handleError(_0x497d7f,null));};exports['removeBlackLists']=function(_0x458d83,_0x440bb7,_0xb44077){return db[_0x6327('0x2d')]['find']({'where':{'id':_0x458d83['params']['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x440bb7,null))[_0x6327('0x26')](function(_0x1dc095){if(_0x1dc095){return _0x1dc095[_0x6327('0x90')](_0x458d83['query'][_0x6327('0x67')]);}})[_0x6327('0x26')](function(_0x593782){if(_0x593782){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x458d83[_0x6327('0x31')][_0x6327('0x67')],'CampaignId':_0x458d83[_0x6327('0x48')]['id']}})[_0x6327('0x26')](function(){return _0x593782;});}})[_0x6327('0x26')](respondWithStatusCode(_0x440bb7,null))[_0x6327('0x46')](handleError(_0x440bb7,null));};
\ No newline at end of file
+var _0x0f92=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','clone','find','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getHoppers','findOne','CmHopper','getHopperHistories','CampaignId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','field','phone','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','phone\x20NOT\x20IN\x20(?)','cm_hopper_additional_phones','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','ListId\x20=\x20?','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','IvrCampaigns','UserProfileResource','name','send','index','Campaign','fieldName','type'];(function(_0xd94f9c,_0x12791e){var _0x2e867a=function(_0x59d098){while(--_0x59d098){_0xd94f9c['push'](_0xd94f9c['shift']());}};_0x2e867a(++_0x12791e);}(_0x0f92,0xfd));var _0x20f9=function(_0x2d733c,_0x5893ce){_0x2d733c=_0x2d733c-0x0;var _0x10582d=_0x0f92[_0x2d733c];return _0x10582d;};'use strict';var emlformat=require(_0x20f9('0x0'));var rimraf=require(_0x20f9('0x1'));var zipdir=require(_0x20f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x20f9('0x3'));var moment=require(_0x20f9('0x4'));var BPromise=require(_0x20f9('0x5'));var Mustache=require(_0x20f9('0x6'));var util=require(_0x20f9('0x7'));var path=require(_0x20f9('0x8'));var sox=require(_0x20f9('0x9'));var csv=require(_0x20f9('0xa'));var ejs=require(_0x20f9('0xb'));var fs=require('fs');var fs_extra=require(_0x20f9('0xc'));var _=require(_0x20f9('0xd'));var squel=require('squel');var crypto=require(_0x20f9('0xe'));var jsforce=require(_0x20f9('0xf'));var deskjs=require(_0x20f9('0x10'));var toCsv=require(_0x20f9('0xa'));var querystring=require(_0x20f9('0x11'));var Papa=require('papaparse');var Redis=require(_0x20f9('0x12'));var authService=require(_0x20f9('0x13'));var qs=require(_0x20f9('0x14'));var as=require(_0x20f9('0x15'));var hardwareService=require(_0x20f9('0x16'));var logger=require('../../config/logger')(_0x20f9('0x17'));var utils=require(_0x20f9('0x18'));var config=require(_0x20f9('0x19'));var licenseUtil=require(_0x20f9('0x1a'));var db=require(_0x20f9('0x1b'))['db'];function respondWithStatusCode(_0x44a279,_0x15cc0d){_0x15cc0d=_0x15cc0d||0xcc;return function(_0x128cbf){if(_0x128cbf){return _0x44a279[_0x20f9('0x1c')](_0x15cc0d);}return _0x44a279[_0x20f9('0x1d')](_0x15cc0d)[_0x20f9('0x1e')]();};}function respondWithResult(_0x510cdf,_0x57b2ba){_0x57b2ba=_0x57b2ba||0xc8;return function(_0x56091c){if(_0x56091c){return _0x510cdf['status'](_0x57b2ba)[_0x20f9('0x1f')](_0x56091c);}};}function respondWithFilteredResult(_0x2a8e47,_0x50b9d0){return function(_0x520dd6){if(_0x520dd6){var _0x342fa8=typeof _0x50b9d0[_0x20f9('0x20')]==='undefined'&&typeof _0x50b9d0[_0x20f9('0x21')]==='undefined';var _0x42a7b0=_0x520dd6['count'];var _0x47b815=_0x342fa8?0x0:_0x50b9d0[_0x20f9('0x20')];var _0x55bf75=_0x342fa8?_0x520dd6[_0x20f9('0x22')]:_0x50b9d0[_0x20f9('0x20')]+_0x50b9d0[_0x20f9('0x21')];var _0x1ba7ef;if(_0x55bf75>=_0x42a7b0){_0x55bf75=_0x42a7b0;_0x1ba7ef=0xc8;}else{_0x1ba7ef=0xce;}_0x2a8e47[_0x20f9('0x1d')](_0x1ba7ef);return _0x2a8e47[_0x20f9('0x23')](_0x20f9('0x24'),_0x47b815+'-'+_0x55bf75+'/'+_0x42a7b0)[_0x20f9('0x1f')](_0x520dd6);}return null;};}function patchUpdates(_0x1ab050){return function(_0x7bece3){try{jsonpatch[_0x20f9('0x25')](_0x7bece3,_0x1ab050,!![]);}catch(_0x3e3768){return BPromise[_0x20f9('0x26')](_0x3e3768);}return _0x7bece3['save']();};}function saveUpdates(_0x39fd68,_0x35f54d){return function(_0x555b1a){if(_0x555b1a){return _0x555b1a[_0x20f9('0x27')](_0x39fd68)['then'](function(_0x4497d4){return _0x4497d4;});}return null;};}function removeEntity(_0x525aaa,_0x41cb76){return function(_0x51c604){if(_0x51c604){return _0x51c604[_0x20f9('0x28')]()[_0x20f9('0x29')](function(){var _0x576539=_0x51c604[_0x20f9('0x2a')]({'plain':!![]});var _0x2d466a=_0x20f9('0x2b');return db[_0x20f9('0x2c')]['destroy']({'where':{'type':_0x2d466a,'resourceId':_0x576539['id']}})[_0x20f9('0x29')](function(){return _0x51c604;});})['then'](function(){_0x525aaa['status'](0xcc)[_0x20f9('0x1e')]();});}};}function handleEntityNotFound(_0x180045,_0x3b3379){return function(_0x3b94e3){if(!_0x3b94e3){_0x180045[_0x20f9('0x1c')](0x194);}return _0x3b94e3;};}function handleError(_0x190cc8,_0x64e240){_0x64e240=_0x64e240||0x1f4;return function(_0x21bf24){logger['error'](_0x21bf24['stack']);if(_0x21bf24[_0x20f9('0x2d')]){delete _0x21bf24['name'];}_0x190cc8[_0x20f9('0x1d')](_0x64e240)[_0x20f9('0x2e')](_0x21bf24);};}exports[_0x20f9('0x2f')]=function(_0x39bfde,_0x1d8259){var _0x56eb57={},_0x3d4bf7={},_0x85a502={'count':0x0,'rows':[]};var _0x511acf=_['map'](db[_0x20f9('0x30')]['rawAttributes'],function(_0x460c78){return{'name':_0x460c78[_0x20f9('0x31')],'type':_0x460c78[_0x20f9('0x32')]['key']};});_0x3d4bf7[_0x20f9('0x33')]=_['map'](_0x511acf,_0x20f9('0x2d'));_0x3d4bf7[_0x20f9('0x34')]=_['keys'](_0x39bfde['query']);_0x3d4bf7[_0x20f9('0x35')]=_[_0x20f9('0x36')](_0x3d4bf7[_0x20f9('0x33')],_0x3d4bf7['query']);_0x56eb57[_0x20f9('0x37')]=_[_0x20f9('0x36')](_0x3d4bf7[_0x20f9('0x33')],qs[_0x20f9('0x38')](_0x39bfde['query'][_0x20f9('0x38')]));_0x56eb57[_0x20f9('0x37')]=_0x56eb57[_0x20f9('0x37')][_0x20f9('0x39')]?_0x56eb57[_0x20f9('0x37')]:_0x3d4bf7[_0x20f9('0x33')];if(!_0x39bfde[_0x20f9('0x34')][_0x20f9('0x3a')](_0x20f9('0x3b'))){_0x56eb57[_0x20f9('0x21')]=qs['limit'](_0x39bfde[_0x20f9('0x34')][_0x20f9('0x21')]);_0x56eb57['offset']=qs[_0x20f9('0x20')](_0x39bfde['query'][_0x20f9('0x20')]);}_0x56eb57[_0x20f9('0x3c')]=qs[_0x20f9('0x3d')](_0x39bfde['query']['sort']);_0x56eb57[_0x20f9('0x3e')]=qs[_0x20f9('0x35')](_[_0x20f9('0x3f')](_0x39bfde[_0x20f9('0x34')],_0x3d4bf7[_0x20f9('0x35')]),_0x511acf);if(_0x39bfde[_0x20f9('0x34')][_0x20f9('0x40')]){_0x56eb57['where']=_['merge'](_0x56eb57[_0x20f9('0x3e')],{'$or':_[_0x20f9('0x41')](_0x511acf,function(_0x207369){if(_0x207369[_0x20f9('0x32')]!==_0x20f9('0x42')){var _0x3979e4={};_0x3979e4[_0x207369[_0x20f9('0x2d')]]={'$like':'%'+_0x39bfde[_0x20f9('0x34')][_0x20f9('0x40')]+'%'};return _0x3979e4;}})});}_0x56eb57=_[_0x20f9('0x43')]({},_0x56eb57,_0x39bfde[_0x20f9('0x44')]);var _0x57d30b={'where':_0x56eb57['where']};return db[_0x20f9('0x30')][_0x20f9('0x22')](_0x57d30b)['then'](function(_0x1e49fe){_0x85a502['count']=_0x1e49fe;if(_0x39bfde[_0x20f9('0x34')][_0x20f9('0x45')]){_0x56eb57[_0x20f9('0x46')]=[{'all':!![]}];}return db[_0x20f9('0x30')][_0x20f9('0x47')](_0x56eb57);})['then'](function(_0x3693b7){_0x85a502[_0x20f9('0x48')]=_0x3693b7;return _0x85a502;})[_0x20f9('0x29')](respondWithFilteredResult(_0x1d8259,_0x56eb57))[_0x20f9('0x49')](handleError(_0x1d8259,null));};exports[_0x20f9('0x4a')]=function(_0x29ff1f,_0x11e65f){var _0x1c2fdd={'raw':![],'where':{'id':_0x29ff1f['params']['id']}},_0x3d97b1={};_0x3d97b1[_0x20f9('0x33')]=_['keys'](db[_0x20f9('0x30')][_0x20f9('0x4b')]);_0x3d97b1[_0x20f9('0x34')]=_[_0x20f9('0x4c')](_0x29ff1f[_0x20f9('0x34')]);_0x3d97b1[_0x20f9('0x35')]=_[_0x20f9('0x36')](_0x3d97b1['model'],_0x3d97b1[_0x20f9('0x34')]);_0x1c2fdd[_0x20f9('0x37')]=_['intersection'](_0x3d97b1['model'],qs[_0x20f9('0x38')](_0x29ff1f[_0x20f9('0x34')][_0x20f9('0x38')]));_0x1c2fdd[_0x20f9('0x37')]=_0x1c2fdd['attributes'][_0x20f9('0x39')]?_0x1c2fdd[_0x20f9('0x37')]:_0x3d97b1['model'];if(_0x29ff1f[_0x20f9('0x34')][_0x20f9('0x45')]){_0x1c2fdd['include']=[{'all':!![]}];}_0x1c2fdd=_[_0x20f9('0x43')]({},_0x1c2fdd,_0x29ff1f[_0x20f9('0x44')]);return db[_0x20f9('0x30')]['find'](_0x1c2fdd)[_0x20f9('0x29')](handleEntityNotFound(_0x11e65f,null))[_0x20f9('0x29')](respondWithResult(_0x11e65f,null))['catch'](handleError(_0x11e65f,null));};exports['create']=function(_0x153a8e,_0x5694e0){return db[_0x20f9('0x30')][_0x20f9('0x4d')](_0x153a8e[_0x20f9('0x4e')],{})[_0x20f9('0x29')](function(_0x10a94d){var _0x5e8e5f=_0x153a8e[_0x20f9('0x4f')][_0x20f9('0x2a')]({'plain':!![]});if(!_0x5e8e5f)throw new Error(_0x20f9('0x50'));if(_0x5e8e5f[_0x20f9('0x51')]===_0x20f9('0x4f')){var _0x261b2b=_0x10a94d[_0x20f9('0x2a')]({'plain':!![]});var _0x4fa068=_0x20f9('0x2b');return db[_0x20f9('0x52')]['find']({'where':{'name':_0x4fa068,'userProfileId':_0x5e8e5f[_0x20f9('0x53')]},'raw':!![]})['then'](function(_0x454948){if(_0x454948&&_0x454948[_0x20f9('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x261b2b[_0x20f9('0x2d')],'resourceId':_0x261b2b['id'],'type':_0x454948[_0x20f9('0x2d')],'sectionId':_0x454948['id']},{})[_0x20f9('0x29')](function(){return _0x10a94d;});}else{return _0x10a94d;}})[_0x20f9('0x49')](function(_0x45475e){logger[_0x20f9('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45475e);throw _0x45475e;});}return _0x10a94d;})[_0x20f9('0x29')](respondWithResult(_0x5694e0,0xc9))[_0x20f9('0x49')](handleError(_0x5694e0,null));};exports[_0x20f9('0x56')]=function(_0x13e638,_0x575b57){var _0x3c3e46={'where':{'id':_0x13e638['params']['id']}},_0x18a97d={};_0x18a97d[_0x20f9('0x33')]=_[_0x20f9('0x4c')](db[_0x20f9('0x30')]['rawAttributes']);_0x3c3e46[_0x20f9('0x37')]=_[_0x20f9('0x36')](_0x18a97d[_0x20f9('0x33')],qs[_0x20f9('0x38')](_0x13e638[_0x20f9('0x34')][_0x20f9('0x38')]));_0x3c3e46[_0x20f9('0x37')]=_0x3c3e46[_0x20f9('0x37')]['length']?_0x3c3e46[_0x20f9('0x37')]:_0x18a97d[_0x20f9('0x33')];if(_0x13e638['query'][_0x20f9('0x45')]){_0x3c3e46[_0x20f9('0x46')]=[{'all':!![]}];}_0x3c3e46=_[_0x20f9('0x43')]({},_0x3c3e46,_0x13e638[_0x20f9('0x44')]);return db[_0x20f9('0x30')][_0x20f9('0x57')](_0x3c3e46)[_0x20f9('0x29')](handleEntityNotFound(_0x575b57,null))['then'](function(_0x5e7cec){if(_0x5e7cec){var _0x4046dc=_0x5e7cec[_0x20f9('0x2a')]({'plain':!![]});_0x4046dc=qs[_0x20f9('0x58')](_0x4046dc,['id',_0x20f9('0x59'),_0x20f9('0x5a')]);_0x13e638['body']=_[_0x20f9('0x58')](_0x13e638[_0x20f9('0x4e')],['id','createdAt',_0x20f9('0x5a')]);return db[_0x20f9('0x30')][_0x20f9('0x4d')](_[_0x20f9('0x43')](_0x4046dc,_0x13e638[_0x20f9('0x4e')]),{'include':_0x13e638['query']['includeAll']?[{'all':!![]}]:undefined})[_0x20f9('0x29')](function(_0x15b746){var _0x2c0255=_0x13e638['user'][_0x20f9('0x2a')]({'plain':!![]});if(!_0x2c0255)throw new Error(_0x20f9('0x50'));if(_0x2c0255[_0x20f9('0x51')]===_0x20f9('0x4f')){var _0x502e1d=_0x15b746[_0x20f9('0x2a')]({'plain':!![]});var _0x8c2388=_0x20f9('0x2b');return db[_0x20f9('0x52')][_0x20f9('0x57')]({'where':{'name':_0x8c2388,'userProfileId':_0x2c0255[_0x20f9('0x53')]},'raw':!![]})[_0x20f9('0x29')](function(_0x57514c){if(_0x57514c&&_0x57514c[_0x20f9('0x54')]===0x0){return db[_0x20f9('0x2c')][_0x20f9('0x4d')]({'name':_0x502e1d[_0x20f9('0x2d')],'resourceId':_0x502e1d['id'],'type':_0x57514c[_0x20f9('0x2d')],'sectionId':_0x57514c['id']},{})[_0x20f9('0x29')](function(){return _0x15b746;});}else{return _0x15b746;}})[_0x20f9('0x49')](function(_0x640f44){logger[_0x20f9('0x55')](_0x20f9('0x5b'),_0x640f44);throw _0x640f44;});}return _0x15b746;});}})[_0x20f9('0x29')](respondWithResult(_0x575b57,0xc9))[_0x20f9('0x49')](handleError(_0x575b57,null));};exports['update']=function(_0x3e3ef2,_0x156421){if(_0x3e3ef2[_0x20f9('0x4e')]['id']){delete _0x3e3ef2[_0x20f9('0x4e')]['id'];}return db[_0x20f9('0x30')][_0x20f9('0x57')]({'where':{'id':_0x3e3ef2[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0x156421,null))[_0x20f9('0x29')](saveUpdates(_0x3e3ef2[_0x20f9('0x4e')],null))[_0x20f9('0x29')](respondWithResult(_0x156421,null))['catch'](handleError(_0x156421,null));};exports['destroy']=function(_0x334fe0,_0x49e293){return db[_0x20f9('0x30')][_0x20f9('0x57')]({'where':{'id':_0x334fe0[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0x49e293,null))['then'](removeEntity(_0x49e293,null))[_0x20f9('0x49')](handleError(_0x49e293,null));};exports[_0x20f9('0x5d')]=function(_0x3f62c3,_0x574403,_0x3aa622){var _0x18cb22={'raw':!![],'where':{}};var _0x3b2739={};var _0x3cb783={'count':0x0,'rows':[]};return db[_0x20f9('0x30')][_0x20f9('0x5e')]({'where':{'id':_0x3f62c3[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0x574403,null))[_0x20f9('0x29')](function(_0x1d6c14){if(_0x1d6c14){_0x3b2739[_0x20f9('0x33')]=_[_0x20f9('0x4c')](db[_0x20f9('0x5f')][_0x20f9('0x4b')]);_0x3b2739[_0x20f9('0x34')]=_[_0x20f9('0x4c')](_0x3f62c3['query']);_0x3b2739[_0x20f9('0x35')]=_['intersection'](_0x3b2739[_0x20f9('0x33')],_0x3b2739[_0x20f9('0x34')]);_0x18cb22['attributes']=_[_0x20f9('0x36')](_0x3b2739[_0x20f9('0x33')],qs[_0x20f9('0x38')](_0x3f62c3[_0x20f9('0x34')][_0x20f9('0x38')]));_0x18cb22[_0x20f9('0x37')]=_0x18cb22[_0x20f9('0x37')]['length']?_0x18cb22[_0x20f9('0x37')]:_0x3b2739[_0x20f9('0x33')];if(!_0x3f62c3[_0x20f9('0x34')][_0x20f9('0x3a')](_0x20f9('0x3b'))){_0x18cb22[_0x20f9('0x21')]=qs[_0x20f9('0x21')](_0x3f62c3['query']['limit']);_0x18cb22[_0x20f9('0x20')]=qs[_0x20f9('0x20')](_0x3f62c3[_0x20f9('0x34')][_0x20f9('0x20')]);}_0x18cb22[_0x20f9('0x3c')]=qs[_0x20f9('0x3d')](_0x3f62c3[_0x20f9('0x34')][_0x20f9('0x3d')]);_0x18cb22['where']=qs[_0x20f9('0x35')](_['pick'](_0x3f62c3['query'],_0x3b2739[_0x20f9('0x35')]));_0x18cb22[_0x20f9('0x3e')]['CampaignId']=_0x1d6c14['id'];if(_0x3f62c3['query']['filter']){_0x18cb22[_0x20f9('0x3e')]=_['merge'](_0x18cb22[_0x20f9('0x3e')],{'$or':_[_0x20f9('0x41')](_0x18cb22[_0x20f9('0x37')],function(_0x24f606){var _0x15638b={};_0x15638b[_0x24f606]={'$like':'%'+_0x3f62c3[_0x20f9('0x34')][_0x20f9('0x40')]+'%'};return _0x15638b;})});}_0x18cb22=_[_0x20f9('0x43')]({},_0x18cb22,_0x3f62c3['options']);return db['CmHopper']['count']({'where':_0x18cb22[_0x20f9('0x3e')]})[_0x20f9('0x29')](function(_0x256c14){_0x3cb783['count']=_0x256c14;if(_0x3f62c3['query'][_0x20f9('0x45')]){_0x18cb22[_0x20f9('0x46')]=[{'all':!![]}];}return db[_0x20f9('0x5f')][_0x20f9('0x47')](_0x18cb22);})[_0x20f9('0x29')](function(_0x4d7493){_0x3cb783[_0x20f9('0x48')]=_0x4d7493;return _0x3cb783;});}})[_0x20f9('0x29')](respondWithFilteredResult(_0x574403,_0x18cb22))[_0x20f9('0x49')](handleError(_0x574403,null));};exports[_0x20f9('0x60')]=function(_0x4680a0,_0xab2b20,_0xe74ea4){var _0x24d68c={'raw':!![],'where':{}};var _0x44b524={};var _0x12d386={'count':0x0,'rows':[]};return db[_0x20f9('0x30')][_0x20f9('0x5e')]({'where':{'id':_0x4680a0[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0xab2b20,null))[_0x20f9('0x29')](function(_0x4e1813){if(_0x4e1813){_0x44b524[_0x20f9('0x33')]=_[_0x20f9('0x4c')](db['CmHopperHistory'][_0x20f9('0x4b')]);_0x44b524[_0x20f9('0x34')]=_[_0x20f9('0x4c')](_0x4680a0[_0x20f9('0x34')]);_0x44b524[_0x20f9('0x35')]=_[_0x20f9('0x36')](_0x44b524[_0x20f9('0x33')],_0x44b524[_0x20f9('0x34')]);_0x24d68c[_0x20f9('0x37')]=_['intersection'](_0x44b524[_0x20f9('0x33')],qs['fields'](_0x4680a0[_0x20f9('0x34')][_0x20f9('0x38')]));_0x24d68c['attributes']=_0x24d68c[_0x20f9('0x37')][_0x20f9('0x39')]?_0x24d68c[_0x20f9('0x37')]:_0x44b524[_0x20f9('0x33')];if(!_0x4680a0[_0x20f9('0x34')][_0x20f9('0x3a')](_0x20f9('0x3b'))){_0x24d68c[_0x20f9('0x21')]=qs[_0x20f9('0x21')](_0x4680a0[_0x20f9('0x34')][_0x20f9('0x21')]);_0x24d68c[_0x20f9('0x20')]=qs[_0x20f9('0x20')](_0x4680a0[_0x20f9('0x34')][_0x20f9('0x20')]);}_0x24d68c['order']=qs['sort'](_0x4680a0['query'][_0x20f9('0x3d')]);_0x24d68c['where']=qs['filters'](_['pick'](_0x4680a0[_0x20f9('0x34')],_0x44b524[_0x20f9('0x35')]));_0x24d68c[_0x20f9('0x3e')][_0x20f9('0x61')]=_0x4e1813['id'];if(_0x4680a0[_0x20f9('0x34')][_0x20f9('0x40')]){_0x24d68c[_0x20f9('0x3e')]=_[_0x20f9('0x43')](_0x24d68c[_0x20f9('0x3e')],{'$or':_[_0x20f9('0x41')](_0x24d68c['attributes'],function(_0x16026b){var _0x29b6ce={};_0x29b6ce[_0x16026b]={'$like':'%'+_0x4680a0[_0x20f9('0x34')][_0x20f9('0x40')]+'%'};return _0x29b6ce;})});}_0x24d68c=_['merge']({},_0x24d68c,_0x4680a0['options']);return db[_0x20f9('0x62')][_0x20f9('0x22')]({'where':_0x24d68c[_0x20f9('0x3e')]})['then'](function(_0x28f0b3){_0x12d386[_0x20f9('0x22')]=_0x28f0b3;if(_0x4680a0[_0x20f9('0x34')]['includeAll']){_0x24d68c[_0x20f9('0x46')]=[{'all':!![]}];}return db[_0x20f9('0x62')]['findAll'](_0x24d68c);})[_0x20f9('0x29')](function(_0x2fdd2a){_0x12d386[_0x20f9('0x48')]=_0x2fdd2a;return _0x12d386;});}})[_0x20f9('0x29')](respondWithFilteredResult(_0xab2b20,_0x24d68c))['catch'](handleError(_0xab2b20,null));};exports['getHopperFinals']=function(_0x59ca1f,_0x48ec95,_0x4bee73){var _0xcbacf9={'raw':!![],'where':{}};var _0x1f88f8={};var _0x291c7e={'count':0x0,'rows':[]};return db[_0x20f9('0x30')]['findOne']({'where':{'id':_0x59ca1f['params']['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0x48ec95,null))['then'](function(_0x263503){if(_0x263503){_0x1f88f8['model']=_[_0x20f9('0x4c')](db[_0x20f9('0x63')][_0x20f9('0x4b')]);_0x1f88f8['query']=_[_0x20f9('0x4c')](_0x59ca1f[_0x20f9('0x34')]);_0x1f88f8[_0x20f9('0x35')]=_['intersection'](_0x1f88f8['model'],_0x1f88f8[_0x20f9('0x34')]);_0xcbacf9[_0x20f9('0x37')]=_[_0x20f9('0x36')](_0x1f88f8['model'],qs[_0x20f9('0x38')](_0x59ca1f['query'][_0x20f9('0x38')]));_0xcbacf9['attributes']=_0xcbacf9[_0x20f9('0x37')][_0x20f9('0x39')]?_0xcbacf9[_0x20f9('0x37')]:_0x1f88f8[_0x20f9('0x33')];if(!_0x59ca1f[_0x20f9('0x34')][_0x20f9('0x3a')](_0x20f9('0x3b'))){_0xcbacf9[_0x20f9('0x21')]=qs[_0x20f9('0x21')](_0x59ca1f['query'][_0x20f9('0x21')]);_0xcbacf9[_0x20f9('0x20')]=qs[_0x20f9('0x20')](_0x59ca1f[_0x20f9('0x34')][_0x20f9('0x20')]);}_0xcbacf9['order']=qs[_0x20f9('0x3d')](_0x59ca1f[_0x20f9('0x34')][_0x20f9('0x3d')]);_0xcbacf9['where']=qs[_0x20f9('0x35')](_['pick'](_0x59ca1f[_0x20f9('0x34')],_0x1f88f8[_0x20f9('0x35')]));_0xcbacf9['where'][_0x20f9('0x61')]=_0x263503['id'];if(_0x59ca1f['query']['filter']){_0xcbacf9[_0x20f9('0x3e')]=_[_0x20f9('0x43')](_0xcbacf9[_0x20f9('0x3e')],{'$or':_[_0x20f9('0x41')](_0xcbacf9[_0x20f9('0x37')],function(_0x20a323){var _0x2373f5={};_0x2373f5[_0x20a323]={'$like':'%'+_0x59ca1f[_0x20f9('0x34')][_0x20f9('0x40')]+'%'};return _0x2373f5;})});}_0xcbacf9=_[_0x20f9('0x43')]({},_0xcbacf9,_0x59ca1f[_0x20f9('0x44')]);return db['CmHopperFinal'][_0x20f9('0x22')]({'where':_0xcbacf9[_0x20f9('0x3e')]})[_0x20f9('0x29')](function(_0x3dd80e){_0x291c7e[_0x20f9('0x22')]=_0x3dd80e;if(_0x59ca1f['query'][_0x20f9('0x45')]){_0xcbacf9['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x20f9('0x47')](_0xcbacf9);})[_0x20f9('0x29')](function(_0x1f10f5){_0x291c7e[_0x20f9('0x48')]=_0x1f10f5;return _0x291c7e;});}})['then'](respondWithFilteredResult(_0x48ec95,_0xcbacf9))['catch'](handleError(_0x48ec95,null));};exports[_0x20f9('0x64')]=function(_0x43f05e,_0x213cb6,_0x312e5d){var _0x2ab112={'raw':!![],'where':{}};var _0x4d6b7d={};var _0x4f8e07={'count':0x0,'rows':[]};return db[_0x20f9('0x30')][_0x20f9('0x5e')]({'where':{'id':_0x43f05e[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0x213cb6,null))['then'](function(_0x22a1f4){if(_0x22a1f4){_0x4d6b7d[_0x20f9('0x33')]=_['keys'](db[_0x20f9('0x65')][_0x20f9('0x4b')]);_0x4d6b7d[_0x20f9('0x34')]=_[_0x20f9('0x4c')](_0x43f05e[_0x20f9('0x34')]);_0x4d6b7d[_0x20f9('0x35')]=_[_0x20f9('0x36')](_0x4d6b7d['model'],_0x4d6b7d[_0x20f9('0x34')]);_0x2ab112['attributes']=_[_0x20f9('0x36')](_0x4d6b7d['model'],qs[_0x20f9('0x38')](_0x43f05e[_0x20f9('0x34')][_0x20f9('0x38')]));_0x2ab112[_0x20f9('0x37')]=_0x2ab112['attributes'][_0x20f9('0x39')]?_0x2ab112[_0x20f9('0x37')]:_0x4d6b7d['model'];if(!_0x43f05e[_0x20f9('0x34')][_0x20f9('0x3a')](_0x20f9('0x3b'))){_0x2ab112[_0x20f9('0x21')]=qs['limit'](_0x43f05e[_0x20f9('0x34')][_0x20f9('0x21')]);_0x2ab112[_0x20f9('0x20')]=qs['offset'](_0x43f05e[_0x20f9('0x34')]['offset']);}_0x2ab112['order']=qs[_0x20f9('0x3d')](_0x43f05e[_0x20f9('0x34')][_0x20f9('0x3d')]);_0x2ab112['where']=qs[_0x20f9('0x35')](_['pick'](_0x43f05e[_0x20f9('0x34')],_0x4d6b7d[_0x20f9('0x35')]));_0x2ab112[_0x20f9('0x3e')][_0x20f9('0x61')]=_0x22a1f4['id'];if(_0x43f05e['query']['filter']){_0x2ab112[_0x20f9('0x3e')]=_[_0x20f9('0x43')](_0x2ab112[_0x20f9('0x3e')],{'$or':_[_0x20f9('0x41')](_0x2ab112[_0x20f9('0x37')],function(_0x434269){var _0x1ca22f={};_0x1ca22f[_0x434269]={'$like':'%'+_0x43f05e[_0x20f9('0x34')][_0x20f9('0x40')]+'%'};return _0x1ca22f;})});}_0x2ab112=_[_0x20f9('0x43')]({},_0x2ab112,_0x43f05e[_0x20f9('0x44')]);return db[_0x20f9('0x65')][_0x20f9('0x22')]({'where':_0x2ab112[_0x20f9('0x3e')]})[_0x20f9('0x29')](function(_0x548742){_0x4f8e07[_0x20f9('0x22')]=_0x548742;if(_0x43f05e[_0x20f9('0x34')][_0x20f9('0x45')]){_0x2ab112[_0x20f9('0x46')]=[{'all':!![]}];}return db[_0x20f9('0x65')][_0x20f9('0x47')](_0x2ab112);})['then'](function(_0x2689ac){_0x4f8e07['rows']=_0x2689ac;return _0x4f8e07;});}})[_0x20f9('0x29')](respondWithFilteredResult(_0x213cb6,_0x2ab112))['catch'](handleError(_0x213cb6,null));};exports[_0x20f9('0x66')]=function(_0x14a48c,_0x30a713,_0x65e3a){var _0x5925cc={};var _0x5ad507={};var _0x538be1;var _0x7929f5;return db[_0x20f9('0x30')][_0x20f9('0x5e')]({'where':{'id':_0x14a48c['params']['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0x30a713,null))[_0x20f9('0x29')](function(_0x221f97){if(_0x221f97){_0x538be1=_0x221f97;_0x5ad507['model']=_[_0x20f9('0x4c')](db[_0x20f9('0x67')][_0x20f9('0x4b')]);_0x5ad507[_0x20f9('0x34')]=_['keys'](_0x14a48c['query']);_0x5ad507['filters']=_[_0x20f9('0x36')](_0x5ad507['model'],_0x5ad507[_0x20f9('0x34')]);_0x5925cc[_0x20f9('0x37')]=_['intersection'](_0x5ad507[_0x20f9('0x33')],qs['fields'](_0x14a48c[_0x20f9('0x34')]['fields']));_0x5925cc[_0x20f9('0x37')]=_0x5925cc[_0x20f9('0x37')][_0x20f9('0x39')]?_0x5925cc[_0x20f9('0x37')]:_0x5ad507['model'];_0x5925cc['order']=qs[_0x20f9('0x3d')](_0x14a48c[_0x20f9('0x34')][_0x20f9('0x3d')]);_0x5925cc[_0x20f9('0x3e')]=qs['filters'](_[_0x20f9('0x3f')](_0x14a48c[_0x20f9('0x34')],_0x5ad507[_0x20f9('0x35')]));if(_0x14a48c[_0x20f9('0x34')][_0x20f9('0x40')]){_0x5925cc[_0x20f9('0x3e')]=_[_0x20f9('0x43')](_0x5925cc[_0x20f9('0x3e')],{'$or':_[_0x20f9('0x41')](_0x5925cc['attributes'],function(_0x54d801){var _0x4483d9={};_0x4483d9[_0x54d801]={'$like':'%'+_0x14a48c[_0x20f9('0x34')][_0x20f9('0x40')]+'%'};return _0x4483d9;})});}_0x5925cc=_[_0x20f9('0x43')]({},_0x5925cc,_0x14a48c[_0x20f9('0x44')]);return _0x538be1['getLists'](_0x5925cc);}})[_0x20f9('0x29')](function(_0x1a1165){if(_0x1a1165){_0x7929f5=_0x1a1165[_0x20f9('0x39')];if(!_0x14a48c[_0x20f9('0x34')]['hasOwnProperty'](_0x20f9('0x3b'))){_0x5925cc['limit']=qs['limit'](_0x14a48c[_0x20f9('0x34')][_0x20f9('0x21')]);_0x5925cc[_0x20f9('0x20')]=qs[_0x20f9('0x20')](_0x14a48c[_0x20f9('0x34')][_0x20f9('0x20')]);}return _0x538be1['getLists'](_0x5925cc);}})[_0x20f9('0x29')](function(_0x31d1e7){if(_0x31d1e7){return _0x31d1e7?{'count':_0x7929f5,'rows':_0x31d1e7}:null;}})['then'](respondWithResult(_0x30a713,null))[_0x20f9('0x49')](handleError(_0x30a713,null));};exports[_0x20f9('0x68')]=function(_0x5bd33b,_0x1a2f9d,_0x503cca){var _0x2dc66a,_0x488f2a;var _0x1bd3c8=[];var _0x1ce109=moment()[_0x20f9('0x69')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x20f9('0x57')]({'where':{'id':_0x5bd33b[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0x1a2f9d,null))[_0x20f9('0x29')](function(_0xa1aa8e){if(_0xa1aa8e){_0x488f2a=_0xa1aa8e;return _0xa1aa8e[_0x20f9('0x68')](_0x5bd33b[_0x20f9('0x4e')]['ids'],_[_0x20f9('0x58')](_0x5bd33b['body'],[_0x20f9('0x6a'),'id'])||{});}return null;})[_0x20f9('0x6b')](function(_0x2fc634){var _0x3d0708;var _0x5cfb58;_0x2dc66a=_0x2fc634||[];var _0x59bf20=[];if(_0x2fc634){for(var _0x481371=0x0;_0x481371<_0x2fc634[_0x20f9('0x39')];_0x481371+=0x1){var _0x2e6dfd=_0x2fc634[_0x481371][_0x20f9('0x2a')]({'plain':!![]});_0x488f2a['dialCheckDuplicateType']=_0x5bd33b[_0x20f9('0x4e')]['dialCheckDuplicateType']?_0x5bd33b[_0x20f9('0x4e')]['dialCheckDuplicateType']:_0x488f2a[_0x20f9('0x6c')];switch(_0x488f2a[_0x20f9('0x6c')]){case _0x20f9('0x6d'):_0x3d0708=squel[_0x20f9('0x6e')]()[_0x20f9('0x6f')]('cm_hopper')[_0x20f9('0x70')](['phone',_0x20f9('0x71'),_0x20f9('0x72'),_0x20f9('0x73'),_0x20f9('0x61'),_0x20f9('0x59'),'updatedAt'],squel['select']()[_0x20f9('0x74')](_0x20f9('0x75'),_0x20f9('0x75'))['field'](_0x20f9('0x76'),_0x20f9('0x71'))['field']('id',_0x20f9('0x72'))[_0x20f9('0x74')](_0x2e6dfd[_0x20f9('0x77')][_0x20f9('0x78')](),_0x20f9('0x73'))['field'](_0x5bd33b[_0x20f9('0x5c')]['id'][_0x20f9('0x78')](),'CampaignId')[_0x20f9('0x74')]('\x27'+_0x1ce109+'\x27','createdAt')['field']('\x27'+_0x1ce109+'\x27','updatedAt')[_0x20f9('0x79')](_0x20f9('0x7a'))[_0x20f9('0x3e')](_0x20f9('0x7b'))[_0x20f9('0x3e')]('ListId\x20=\x20?',_0x2e6dfd[_0x20f9('0x77')][_0x20f9('0x78')]())[_0x20f9('0x3e')](_0x20f9('0x7c'))[_0x20f9('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x20f9('0x7d')]()['field'](_0x20f9('0x7e'))[_0x20f9('0x79')](_0x20f9('0x7f'))[_0x20f9('0x3e')](_0x20f9('0x80'),_0x5bd33b[_0x20f9('0x5c')]['id'][_0x20f9('0x78')]()))[_0x20f9('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x20f9('0x74')](_0x20f9('0x81'))[_0x20f9('0x79')](_0x20f9('0x82'))[_0x20f9('0x3e')]('CampaignId\x20=\x20?',_0x5bd33b[_0x20f9('0x5c')]['id'][_0x20f9('0x78')]())))[_0x20f9('0x78')]();break;case _0x20f9('0x83'):_0x3d0708=squel[_0x20f9('0x6e')]()[_0x20f9('0x6f')](_0x20f9('0x82'))[_0x20f9('0x70')]([_0x20f9('0x75'),_0x20f9('0x71'),'ContactId',_0x20f9('0x73'),'CampaignId','createdAt',_0x20f9('0x5a')],squel[_0x20f9('0x7d')]()['field'](_0x20f9('0x75'),_0x20f9('0x75'))[_0x20f9('0x74')](_0x20f9('0x76'),_0x20f9('0x71'))[_0x20f9('0x74')]('id',_0x20f9('0x72'))[_0x20f9('0x74')](_0x2e6dfd[_0x20f9('0x77')][_0x20f9('0x78')](),'ListId')[_0x20f9('0x74')](_0x5bd33b[_0x20f9('0x5c')]['id']['toString'](),'CampaignId')[_0x20f9('0x74')]('\x27'+_0x1ce109+'\x27',_0x20f9('0x59'))[_0x20f9('0x74')]('\x27'+_0x1ce109+'\x27',_0x20f9('0x5a'))['from'](_0x20f9('0x7a'))[_0x20f9('0x3e')](_0x20f9('0x7b'))[_0x20f9('0x3e')]('ListId\x20=\x20?',_0x2e6dfd[_0x20f9('0x77')][_0x20f9('0x78')]())[_0x20f9('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x20f9('0x3e')](_0x20f9('0x84'),squel[_0x20f9('0x7d')]()[_0x20f9('0x74')](_0x20f9('0x81'))[_0x20f9('0x79')](_0x20f9('0x82'))[_0x20f9('0x3e')]('CampaignId\x20=\x20?',_0x5bd33b[_0x20f9('0x5c')]['id'][_0x20f9('0x78')]())))['toString']();break;default:_0x3d0708=squel[_0x20f9('0x6e')]()['into']('cm_hopper')['fromQuery']([_0x20f9('0x75'),'scheduledAt',_0x20f9('0x72'),_0x20f9('0x73'),_0x20f9('0x61'),_0x20f9('0x59'),_0x20f9('0x5a')],squel[_0x20f9('0x7d')]()[_0x20f9('0x74')](_0x20f9('0x75'),_0x20f9('0x75'))[_0x20f9('0x74')](_0x20f9('0x76'),'scheduledAt')[_0x20f9('0x74')]('id','ContactId')[_0x20f9('0x74')](_0x2e6dfd[_0x20f9('0x77')]['toString'](),_0x20f9('0x73'))[_0x20f9('0x74')](_0x5bd33b['params']['id'][_0x20f9('0x78')](),'CampaignId')[_0x20f9('0x74')]('\x27'+_0x1ce109+'\x27',_0x20f9('0x59'))[_0x20f9('0x74')]('\x27'+_0x1ce109+'\x27','updatedAt')[_0x20f9('0x79')](_0x20f9('0x7a'))[_0x20f9('0x3e')](_0x20f9('0x7b'))[_0x20f9('0x3e')]('ListId\x20=\x20?',_0x2e6dfd[_0x20f9('0x77')][_0x20f9('0x78')]())[_0x20f9('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0x20f9('0x78')]();}_0x5cfb58=squel[_0x20f9('0x6e')]()[_0x20f9('0x6f')](_0x20f9('0x85'))[_0x20f9('0x70')](['cmHopperId',_0x20f9('0x71'),_0x20f9('0x75'),_0x20f9('0x86'),_0x20f9('0x59'),_0x20f9('0x5a')],squel[_0x20f9('0x7d')]()[_0x20f9('0x74')](_0x20f9('0x87'),'id')[_0x20f9('0x74')]('NOW()',_0x20f9('0x71'))[_0x20f9('0x74')](_0x20f9('0x88'),_0x20f9('0x75'))[_0x20f9('0x74')]('ci.OrderBY',_0x20f9('0x86'))[_0x20f9('0x74')]('\x27'+_0x1ce109+'\x27',_0x20f9('0x59'))[_0x20f9('0x74')]('\x27'+_0x1ce109+'\x27','updatedAt')['from'](_0x20f9('0x89'),'ci')[_0x20f9('0x8a')]('cm_hopper','h',_0x20f9('0x8b'))['where']('h.ListId\x20=\x20?',_0x2e6dfd[_0x20f9('0x77')]['toString']())[_0x20f9('0x3e')](_0x20f9('0x8c'),_0x5bd33b[_0x20f9('0x5c')]['id'][_0x20f9('0x78')]())[_0x20f9('0x3e')](_0x20f9('0x8d'),_0x1ce109))['toString']();_0x59bf20[_0x20f9('0x8e')](db[_0x20f9('0x8f')]['query'](_0x3d0708));_0x1bd3c8['push'](db[_0x20f9('0x8f')][_0x20f9('0x34')](_0x5cfb58));}return BPromise['all'](_0x59bf20);}})[_0x20f9('0x29')](function(){return BPromise[_0x20f9('0x90')](_0x1bd3c8);})[_0x20f9('0x29')](function(){return _0x2dc66a;})[_0x20f9('0x29')](respondWithResult(_0x1a2f9d,null))[_0x20f9('0x49')](handleError(_0x1a2f9d,null));};exports[_0x20f9('0x91')]=function(_0x4deb28,_0xbdf2cf,_0x319926){return db[_0x20f9('0x30')][_0x20f9('0x57')]({'where':{'id':_0x4deb28['params']['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0xbdf2cf,null))[_0x20f9('0x29')](function(_0x4353d2){if(_0x4353d2){return _0x4353d2[_0x20f9('0x91')](_0x4deb28['query']['ids']);}})[_0x20f9('0x29')](function(_0x4fc9c6){if(_0x4fc9c6){return db[_0x20f9('0x5f')][_0x20f9('0x28')]({'where':{'ListId':_0x4deb28[_0x20f9('0x34')][_0x20f9('0x6a')],'CampaignId':_0x4deb28['params']['id']}})[_0x20f9('0x29')](function(){return _0x4fc9c6;});}})[_0x20f9('0x29')](respondWithStatusCode(_0xbdf2cf,null))['catch'](handleError(_0xbdf2cf,null));};exports['getBlackLists']=function(_0x32ea1b,_0x77e4ab,_0x485b18){var _0x164918={};var _0x1726e3={};var _0x399d19;var _0x408a47;return db[_0x20f9('0x30')][_0x20f9('0x5e')]({'where':{'id':_0x32ea1b[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0x77e4ab,null))[_0x20f9('0x29')](function(_0x68f949){if(_0x68f949){_0x399d19=_0x68f949;_0x1726e3[_0x20f9('0x33')]=_['keys'](db['CmList'][_0x20f9('0x4b')]);_0x1726e3[_0x20f9('0x34')]=_[_0x20f9('0x4c')](_0x32ea1b[_0x20f9('0x34')]);_0x1726e3[_0x20f9('0x35')]=_[_0x20f9('0x36')](_0x1726e3[_0x20f9('0x33')],_0x1726e3[_0x20f9('0x34')]);_0x164918['attributes']=_[_0x20f9('0x36')](_0x1726e3[_0x20f9('0x33')],qs[_0x20f9('0x38')](_0x32ea1b[_0x20f9('0x34')][_0x20f9('0x38')]));_0x164918[_0x20f9('0x37')]=_0x164918[_0x20f9('0x37')][_0x20f9('0x39')]?_0x164918[_0x20f9('0x37')]:_0x1726e3[_0x20f9('0x33')];_0x164918[_0x20f9('0x3c')]=qs[_0x20f9('0x3d')](_0x32ea1b[_0x20f9('0x34')][_0x20f9('0x3d')]);_0x164918[_0x20f9('0x3e')]=qs['filters'](_[_0x20f9('0x3f')](_0x32ea1b[_0x20f9('0x34')],_0x1726e3[_0x20f9('0x35')]));if(_0x32ea1b['query'][_0x20f9('0x40')]){_0x164918[_0x20f9('0x3e')]=_['merge'](_0x164918['where'],{'$or':_['map'](_0x164918[_0x20f9('0x37')],function(_0x1260dd){var _0x834ae6={};_0x834ae6[_0x1260dd]={'$like':'%'+_0x32ea1b['query'][_0x20f9('0x40')]+'%'};return _0x834ae6;})});}_0x164918=_[_0x20f9('0x43')]({},_0x164918,_0x32ea1b[_0x20f9('0x44')]);return _0x399d19[_0x20f9('0x92')](_0x164918);}})[_0x20f9('0x29')](function(_0x7e6695){if(_0x7e6695){_0x408a47=_0x7e6695[_0x20f9('0x39')];if(!_0x32ea1b[_0x20f9('0x34')][_0x20f9('0x3a')](_0x20f9('0x3b'))){_0x164918[_0x20f9('0x21')]=qs['limit'](_0x32ea1b[_0x20f9('0x34')]['limit']);_0x164918[_0x20f9('0x20')]=qs[_0x20f9('0x20')](_0x32ea1b['query'][_0x20f9('0x20')]);}return _0x399d19[_0x20f9('0x92')](_0x164918);}})[_0x20f9('0x29')](function(_0x400c29){if(_0x400c29){return _0x400c29?{'count':_0x408a47,'rows':_0x400c29}:null;}})[_0x20f9('0x29')](respondWithResult(_0x77e4ab,null))['catch'](handleError(_0x77e4ab,null));};exports[_0x20f9('0x93')]=function(_0xaf1354,_0x759a7c,_0x3fa404){var _0x2af093,_0x56bc21;var _0x149a0f=[];var _0x3faad1=moment()['format'](_0x20f9('0x94'));return db['Campaign'][_0x20f9('0x57')]({'where':{'id':_0xaf1354[_0x20f9('0x5c')]['id']}})['then'](handleEntityNotFound(_0x759a7c,null))[_0x20f9('0x29')](function(_0x501fda){if(_0x501fda){_0x56bc21=_0x501fda;return _0x501fda[_0x20f9('0x93')](_0xaf1354['body'][_0x20f9('0x6a')],_[_0x20f9('0x58')](_0xaf1354[_0x20f9('0x4e')],['ids','id'])||{});}return null;})[_0x20f9('0x6b')](function(_0x14d06c){var _0x1be974;var _0x13bdf9;_0x2af093=_0x14d06c||[];var _0x1841f9=[];if(_0x14d06c){for(var _0xb71fb6=0x0;_0xb71fb6<_0x14d06c[_0x20f9('0x39')];_0xb71fb6+=0x1){var _0x460eb9=_0x14d06c[_0xb71fb6][_0x20f9('0x2a')]({'plain':!![]});_0x1be974=squel[_0x20f9('0x6e')]()[_0x20f9('0x6f')](_0x20f9('0x95'))['fromQuery']([_0x20f9('0x75'),_0x20f9('0x72'),'ListId','CampaignId',_0x20f9('0x59'),_0x20f9('0x5a')],squel[_0x20f9('0x7d')]()[_0x20f9('0x74')](_0x20f9('0x75'),'phone')[_0x20f9('0x74')]('id',_0x20f9('0x72'))['field'](_0x460eb9[_0x20f9('0x77')][_0x20f9('0x78')](),'ListId')[_0x20f9('0x74')](_0xaf1354[_0x20f9('0x5c')]['id'][_0x20f9('0x78')](),_0x20f9('0x61'))['field'](_0x20f9('0x76'),'createdAt')[_0x20f9('0x74')](_0x20f9('0x76'),_0x20f9('0x5a'))[_0x20f9('0x79')](_0x20f9('0x7a'))[_0x20f9('0x3e')](_0x20f9('0x7b'))[_0x20f9('0x3e')](_0x20f9('0x96'),_0x460eb9[_0x20f9('0x77')][_0x20f9('0x78')]())[_0x20f9('0x3e')](_0x20f9('0x7c')))['toString']();_0x1841f9['push'](db['sequelize']['query'](_0x1be974));}return BPromise[_0x20f9('0x90')](_0x1841f9);}})[_0x20f9('0x29')](function(){return _0x2af093;})[_0x20f9('0x29')](respondWithResult(_0x759a7c,null))[_0x20f9('0x49')](handleError(_0x759a7c,null));};exports[_0x20f9('0x97')]=function(_0x5c0dde,_0xde96d2,_0x327ad7){return db[_0x20f9('0x30')][_0x20f9('0x57')]({'where':{'id':_0x5c0dde[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0xde96d2,null))[_0x20f9('0x29')](function(_0x166c3f){if(_0x166c3f){return _0x166c3f[_0x20f9('0x97')](_0x5c0dde['query'][_0x20f9('0x6a')]);}})['then'](function(_0x4e64be){if(_0x4e64be){return db[_0x20f9('0x65')]['destroy']({'where':{'ListId':_0x5c0dde['query'][_0x20f9('0x6a')],'CampaignId':_0x5c0dde[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](function(){return _0x4e64be;});}})[_0x20f9('0x29')](respondWithStatusCode(_0xde96d2,null))[_0x20f9('0x49')](handleError(_0xde96d2,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index dd7dfbd..011347a 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(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 b54298e..fc995f3 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 _0xbbb8=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','attributes','limit','include','model','map','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2c5bc7,_0x4975a6){var _0x4273b1=function(_0x4d82a0){while(--_0x4d82a0){_0x2c5bc7['push'](_0x2c5bc7['shift']());}};_0x4273b1(++_0x4975a6);}(_0xbbb8,0x7d));var _0x8bbb=function(_0x3a268d,_0xef058a){_0x3a268d=_0x3a268d-0x0;var _0x224362=_0xbbb8[_0x3a268d];return _0x224362;};'use strict';var _=require(_0x8bbb('0x0'));var util=require(_0x8bbb('0x1'));var moment=require('moment');var BPromise=require(_0x8bbb('0x2'));var rs=require(_0x8bbb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bbb('0x4'))['db'];var utils=require(_0x8bbb('0x5'));var logger=require(_0x8bbb('0x6'))(_0x8bbb('0x7'));var config=require(_0x8bbb('0x8'));var jayson=require(_0x8bbb('0x9'));var client=jayson[_0x8bbb('0xa')][_0x8bbb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d7098,_0x4bbc55,_0x5c744c){return new BPromise(function(_0x4da98e,_0x2d69aa){return client[_0x8bbb('0xc')](_0x2d7098,_0x5c744c)[_0x8bbb('0xd')](function(_0x3a6ced){logger[_0x8bbb('0xe')](_0x8bbb('0xf'),_0x4bbc55,_0x8bbb('0x10'));logger[_0x8bbb('0x11')]('Campaign,\x20%s,\x20%s,\x20%s',_0x4bbc55,_0x8bbb('0x10'),JSON[_0x8bbb('0x12')](_0x3a6ced));if(_0x3a6ced[_0x8bbb('0x13')]){if(_0x3a6ced['error'][_0x8bbb('0x14')]===0x1f4){logger[_0x8bbb('0x13')](_0x8bbb('0xf'),_0x4bbc55,_0x3a6ced['error'][_0x8bbb('0x15')]);return _0x2d69aa(_0x3a6ced[_0x8bbb('0x13')][_0x8bbb('0x15')]);}logger[_0x8bbb('0x13')]('Campaign,\x20%s,\x20%s',_0x4bbc55,_0x3a6ced[_0x8bbb('0x13')][_0x8bbb('0x15')]);return _0x4da98e(_0x3a6ced['error'][_0x8bbb('0x15')]);}else{logger[_0x8bbb('0xe')](_0x8bbb('0xf'),_0x4bbc55,_0x8bbb('0x10'));_0x4da98e(_0x3a6ced[_0x8bbb('0x16')][_0x8bbb('0x15')]);}})[_0x8bbb('0x17')](function(_0x15643c){logger[_0x8bbb('0x13')](_0x8bbb('0xf'),_0x4bbc55,_0x15643c);_0x2d69aa(_0x15643c);});});}exports[_0x8bbb('0x18')]=function(_0x2c2cd4){var _0x12486b=this;return new Promise(function(_0x4abd04,_0x2a6e0){return db[_0x8bbb('0x19')][_0x8bbb('0x1a')]({'raw':_0x2c2cd4[_0x8bbb('0x1b')]?_0x2c2cd4[_0x8bbb('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2c2cd4[_0x8bbb('0x1b')]?_0x2c2cd4['options']['where']||null:null,'attributes':_0x2c2cd4[_0x8bbb('0x1b')]?_0x2c2cd4['options'][_0x8bbb('0x1c')]||null:null,'limit':_0x2c2cd4['options']?_0x2c2cd4[_0x8bbb('0x1b')][_0x8bbb('0x1d')]||null:null,'include':_0x2c2cd4['options']?_0x2c2cd4[_0x8bbb('0x1b')][_0x8bbb('0x1e')]?_['map'](_0x2c2cd4[_0x8bbb('0x1b')][_0x8bbb('0x1e')],function(_0x4b2ba6){return{'model':db[_0x4b2ba6[_0x8bbb('0x1f')]],'as':_0x4b2ba6['as'],'attributes':_0x4b2ba6['attributes'],'include':_0x4b2ba6[_0x8bbb('0x1e')]?_[_0x8bbb('0x20')](_0x4b2ba6[_0x8bbb('0x1e')],function(_0x2fff2e){return{'model':db[_0x2fff2e['model']],'as':_0x2fff2e['as'],'attributes':_0x2fff2e[_0x8bbb('0x1c')],'include':_0x2fff2e['include']?_[_0x8bbb('0x20')](_0x2fff2e['include'],function(_0x22a074){return{'model':db[_0x22a074[_0x8bbb('0x1f')]],'as':_0x22a074['as'],'attributes':_0x22a074[_0x8bbb('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1375a9){logger['info'](_0x8bbb('0x18'),_0x2c2cd4);logger[_0x8bbb('0x11')](_0x8bbb('0x18'),_0x2c2cd4,JSON[_0x8bbb('0x12')](_0x1375a9));_0x4abd04(_0x1375a9);})['catch'](function(_0x51c251){logger[_0x8bbb('0x13')]('GetCampaign',_0x51c251[_0x8bbb('0x15')],_0x2c2cd4);_0x2a6e0(_0x12486b[_0x8bbb('0x13')](0x1f4,_0x51c251['message']));});});};
\ No newline at end of file
+var _0xd6ce=['raw','attributes','limit','map','include','model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','GetCampaign','Campaign','options'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xd6ce,0x127));var _0xed6c=function(_0x1a3663,_0x48e1ec){_0x1a3663=_0x1a3663-0x0;var _0x57a0ce=_0xd6ce[_0x1a3663];return _0x57a0ce;};'use strict';var _=require(_0xed6c('0x0'));var util=require(_0xed6c('0x1'));var moment=require(_0xed6c('0x2'));var BPromise=require(_0xed6c('0x3'));var rs=require(_0xed6c('0x4'));var fs=require('fs');var Redis=require(_0xed6c('0x5'));var db=require(_0xed6c('0x6'))['db'];var utils=require(_0xed6c('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xed6c('0x8'));var jayson=require(_0xed6c('0x9'));var client=jayson[_0xed6c('0xa')][_0xed6c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a6546,_0x5e0e3a,_0x7668a7){return new BPromise(function(_0x46e2c4,_0x4fd673){return client['request'](_0x4a6546,_0x7668a7)[_0xed6c('0xc')](function(_0xc996c4){logger[_0xed6c('0xd')](_0xed6c('0xe'),_0x5e0e3a,'request\x20sent');logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x5e0e3a,'request\x20sent',JSON[_0xed6c('0xf')](_0xc996c4));if(_0xc996c4['error']){if(_0xc996c4['error'][_0xed6c('0x10')]===0x1f4){logger[_0xed6c('0x11')]('Campaign,\x20%s,\x20%s',_0x5e0e3a,_0xc996c4[_0xed6c('0x11')]['message']);return _0x4fd673(_0xc996c4[_0xed6c('0x11')][_0xed6c('0x12')]);}logger['error'](_0xed6c('0xe'),_0x5e0e3a,_0xc996c4[_0xed6c('0x11')][_0xed6c('0x12')]);return _0x46e2c4(_0xc996c4[_0xed6c('0x11')]['message']);}else{logger['info'](_0xed6c('0xe'),_0x5e0e3a,_0xed6c('0x13'));_0x46e2c4(_0xc996c4[_0xed6c('0x14')]['message']);}})[_0xed6c('0x15')](function(_0x526c54){logger[_0xed6c('0x11')](_0xed6c('0xe'),_0x5e0e3a,_0x526c54);_0x4fd673(_0x526c54);});});}exports[_0xed6c('0x16')]=function(_0x1fe8c0){var _0x4a920e=this;return new Promise(function(_0x387ba1,_0x1856f7){return db[_0xed6c('0x17')]['findAll']({'raw':_0x1fe8c0[_0xed6c('0x18')]?_0x1fe8c0[_0xed6c('0x18')][_0xed6c('0x19')]===undefined?!![]:![]:!![],'where':_0x1fe8c0[_0xed6c('0x18')]?_0x1fe8c0[_0xed6c('0x18')]['where']||null:null,'attributes':_0x1fe8c0[_0xed6c('0x18')]?_0x1fe8c0['options'][_0xed6c('0x1a')]||null:null,'limit':_0x1fe8c0[_0xed6c('0x18')]?_0x1fe8c0[_0xed6c('0x18')][_0xed6c('0x1b')]||null:null,'include':_0x1fe8c0['options']?_0x1fe8c0[_0xed6c('0x18')]['include']?_[_0xed6c('0x1c')](_0x1fe8c0['options'][_0xed6c('0x1d')],function(_0x21e0ba){return{'model':db[_0x21e0ba[_0xed6c('0x1e')]],'as':_0x21e0ba['as'],'attributes':_0x21e0ba[_0xed6c('0x1a')],'include':_0x21e0ba[_0xed6c('0x1d')]?_[_0xed6c('0x1c')](_0x21e0ba[_0xed6c('0x1d')],function(_0x27fb6c){return{'model':db[_0x27fb6c[_0xed6c('0x1e')]],'as':_0x27fb6c['as'],'attributes':_0x27fb6c[_0xed6c('0x1a')],'include':_0x27fb6c[_0xed6c('0x1d')]?_['map'](_0x27fb6c[_0xed6c('0x1d')],function(_0x27484c){return{'model':db[_0x27484c[_0xed6c('0x1e')]],'as':_0x27484c['as'],'attributes':_0x27484c[_0xed6c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xed6c('0xc')](function(_0x3574a3){logger['info'](_0xed6c('0x16'),_0x1fe8c0);logger[_0xed6c('0x1f')](_0xed6c('0x16'),_0x1fe8c0,JSON['stringify'](_0x3574a3));_0x387ba1(_0x3574a3);})['catch'](function(_0x531cd0){logger['error'](_0xed6c('0x16'),_0x531cd0['message'],_0x1fe8c0);_0x1856f7(_0x4a920e[_0xed6c('0x11')](0x1f4,_0x531cd0['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 79ffbda..62924a2 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 _0x6cf2=['/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','delete','removeLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x4c42da,_0x2b1f58){var _0x11c56a=function(_0x3a297d){while(--_0x3a297d){_0x4c42da['push'](_0x4c42da['shift']());}};_0x11c56a(++_0x2b1f58);}(_0x6cf2,0x7c));var _0x26cf=function(_0x39197d,_0x785a79){_0x39197d=_0x39197d-0x0;var _0x48cfab=_0x6cf2[_0x39197d];return _0x48cfab;};'use strict';var multer=require('multer');var util=require(_0x26cf('0x0'));var path=require(_0x26cf('0x1'));var timeout=require(_0x26cf('0x2'));var express=require(_0x26cf('0x3'));var router=express[_0x26cf('0x4')]();var fs_extra=require(_0x26cf('0x5'));var auth=require(_0x26cf('0x6'));var interaction=require(_0x26cf('0x7'));var config=require(_0x26cf('0x8'));var controller=require(_0x26cf('0x9'));router[_0x26cf('0xa')]('/',auth[_0x26cf('0xb')](),controller[_0x26cf('0xc')]);router[_0x26cf('0xa')](_0x26cf('0xd'),auth['isAuthenticated'](),controller[_0x26cf('0xe')]);router['get'](_0x26cf('0xf'),auth[_0x26cf('0xb')](),controller['getHoppers']);router[_0x26cf('0xa')](_0x26cf('0x10'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x11')]);router[_0x26cf('0xa')](_0x26cf('0x12'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x13')]);router['get'](_0x26cf('0x14'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x15')]);router[_0x26cf('0xa')](_0x26cf('0x16'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x17')]);router['get'](_0x26cf('0x18'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x19')]);router[_0x26cf('0x1a')]('/',auth[_0x26cf('0xb')](),controller[_0x26cf('0x1b')]);router[_0x26cf('0x1a')](_0x26cf('0x1c'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x1d')]);router[_0x26cf('0x1a')](_0x26cf('0x16'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x1e')]);router[_0x26cf('0x1a')]('/:id/blacklists',auth[_0x26cf('0xb')](),controller[_0x26cf('0x1f')]);router[_0x26cf('0x20')](_0x26cf('0xd'),auth[_0x26cf('0xb')](),controller['update']);router['delete']('/:id',auth[_0x26cf('0xb')](),controller['destroy']);router[_0x26cf('0x21')](_0x26cf('0x16'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x22')]);router[_0x26cf('0x21')](_0x26cf('0x18'),auth[_0x26cf('0xb')](),controller['removeBlackLists']);module[_0x26cf('0x23')]=router;
\ No newline at end of file
+var _0x2932=['post','/:id/clone','clone','/:id/lists','addLists','put','/:id','update','delete','destroy','removeLists','removeBlackLists','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getLists','/:id/blacklists'];(function(_0x12e930,_0x3b89df){var _0x82603c=function(_0x39ec44){while(--_0x39ec44){_0x12e930['push'](_0x12e930['shift']());}};_0x82603c(++_0x3b89df);}(_0x2932,0x198));var _0x2293=function(_0x310990,_0x245984){_0x310990=_0x310990-0x0;var _0x648534=_0x2932[_0x310990];return _0x648534;};'use strict';var multer=require(_0x2293('0x0'));var util=require(_0x2293('0x1'));var path=require(_0x2293('0x2'));var timeout=require('connect-timeout');var express=require(_0x2293('0x3'));var router=express[_0x2293('0x4')]();var fs_extra=require(_0x2293('0x5'));var auth=require(_0x2293('0x6'));var interaction=require(_0x2293('0x7'));var config=require(_0x2293('0x8'));var controller=require('./campaign.controller');router[_0x2293('0x9')]('/',auth['isAuthenticated'](),controller[_0x2293('0xa')]);router['get']('/:id',auth[_0x2293('0xb')](),controller['show']);router['get'](_0x2293('0xc'),auth['isAuthenticated'](),controller[_0x2293('0xd')]);router[_0x2293('0x9')](_0x2293('0xe'),auth[_0x2293('0xb')](),controller[_0x2293('0xf')]);router[_0x2293('0x9')](_0x2293('0x10'),auth[_0x2293('0xb')](),controller[_0x2293('0x11')]);router[_0x2293('0x9')](_0x2293('0x12'),auth[_0x2293('0xb')](),controller['getHopperBlacks']);router[_0x2293('0x9')]('/:id/lists',auth[_0x2293('0xb')](),controller[_0x2293('0x13')]);router[_0x2293('0x9')](_0x2293('0x14'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x2293('0x15')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x2293('0x16'),auth[_0x2293('0xb')](),controller[_0x2293('0x17')]);router[_0x2293('0x15')](_0x2293('0x18'),auth[_0x2293('0xb')](),controller[_0x2293('0x19')]);router[_0x2293('0x15')](_0x2293('0x14'),auth[_0x2293('0xb')](),controller['addBlackLists']);router[_0x2293('0x1a')](_0x2293('0x1b'),auth[_0x2293('0xb')](),controller[_0x2293('0x1c')]);router[_0x2293('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x2293('0x1e')]);router[_0x2293('0x1d')]('/:id/lists',auth['isAuthenticated'](),controller[_0x2293('0x1f')]);router[_0x2293('0x1d')]('/:id/blacklists',auth[_0x2293('0xb')](),controller[_0x2293('0x20')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 4a3182a..7f4d009 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 _0x8cd3=['exports','TEXT','medium','VIRTUAL','getDataValue','key','sequelize'];(function(_0x255a0a,_0x4d809f){var _0xcb9924=function(_0x52d945){while(--_0x52d945){_0x255a0a['push'](_0x255a0a['shift']());}};_0xcb9924(++_0x4d809f);}(_0x8cd3,0xe6));var _0x38cd=function(_0x1987c2,_0x25e5ea){_0x1987c2=_0x1987c2-0x0;var _0x3fbcf3=_0x8cd3[_0x1987c2];return _0x3fbcf3;};'use strict';var Sequelize=require(_0x38cd('0x0'));module[_0x38cd('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x38cd('0x2')],'length':_0x38cd('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x38cd('0x4')],'get':function(){return this[_0x38cd('0x5')](_0x38cd('0x6'));}}};
\ No newline at end of file
+var _0x3d36=['key','sequelize','exports','STRING','TEXT','medium','VIRTUAL','getDataValue'];(function(_0x392750,_0x5c5b7d){var _0x514afd=function(_0x1be1b4){while(--_0x1be1b4){_0x392750['push'](_0x392750['shift']());}};_0x514afd(++_0x5c5b7d);}(_0x3d36,0x171));var _0x63d3=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0x3d36[_0x237546];return _0x233e29;};'use strict';var Sequelize=require(_0x63d3('0x0'));module[_0x63d3('0x1')]={'key':{'type':Sequelize[_0x63d3('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x63d3('0x3')],'length':_0x63d3('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x63d3('0x2')]},'name':{'type':Sequelize[_0x63d3('0x5')],'get':function(){return this[_0x63d3('0x6')](_0x63d3('0x7'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index a637e01..08cde5e 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 _0x6107=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','rawAttributes','fields','includeAll','find','body','params','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x2a5b1f,_0x14f7a8){var _0x374b10=function(_0x5f039e){while(--_0x5f039e){_0x2a5b1f['push'](_0x2a5b1f['shift']());}};_0x374b10(++_0x14f7a8);}(_0x6107,0x9e));var _0x7610=function(_0x3ef412,_0x28691b){_0x3ef412=_0x3ef412-0x0;var _0x2cbaeb=_0x6107[_0x3ef412];return _0x2cbaeb;};'use strict';var emlformat=require(_0x7610('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7610('0x1'));var jsonpatch=require(_0x7610('0x2'));var rp=require(_0x7610('0x3'));var moment=require(_0x7610('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7610('0x5'));var util=require('util');var path=require(_0x7610('0x6'));var sox=require(_0x7610('0x7'));var csv=require(_0x7610('0x8'));var ejs=require(_0x7610('0x9'));var fs=require('fs');var fs_extra=require(_0x7610('0xa'));var _=require(_0x7610('0xb'));var squel=require(_0x7610('0xc'));var crypto=require(_0x7610('0xd'));var jsforce=require(_0x7610('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7610('0x8'));var querystring=require(_0x7610('0xf'));var Papa=require(_0x7610('0x10'));var Redis=require(_0x7610('0x11'));var authService=require(_0x7610('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7610('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7610('0x14'))(_0x7610('0x15'));var utils=require(_0x7610('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7610('0x17'));var db=require(_0x7610('0x18'))['db'];function respondWithStatusCode(_0x22fd75,_0x36e45c){_0x36e45c=_0x36e45c||0xcc;return function(_0x11fc2c){if(_0x11fc2c){return _0x22fd75[_0x7610('0x19')](_0x36e45c);}return _0x22fd75[_0x7610('0x1a')](_0x36e45c)[_0x7610('0x1b')]();};}function respondWithResult(_0x11c178,_0x35a6fb){_0x35a6fb=_0x35a6fb||0xc8;return function(_0x52884e){if(_0x52884e){return _0x11c178[_0x7610('0x1a')](_0x35a6fb)[_0x7610('0x1c')](_0x52884e);}};}function respondWithFilteredResult(_0x39a851,_0x20e869){return function(_0x5e6a39){if(_0x5e6a39){var _0x5e3bb3=typeof _0x20e869[_0x7610('0x1d')]===_0x7610('0x1e')&&typeof _0x20e869[_0x7610('0x1f')]==='undefined';var _0x112218=_0x5e6a39[_0x7610('0x20')];var _0x41f5b6=_0x5e3bb3?0x0:_0x20e869[_0x7610('0x1d')];var _0x4f30b3=_0x5e3bb3?_0x5e6a39[_0x7610('0x20')]:_0x20e869[_0x7610('0x1d')]+_0x20e869[_0x7610('0x1f')];var _0x3b2e2d;if(_0x4f30b3>=_0x112218){_0x4f30b3=_0x112218;_0x3b2e2d=0xc8;}else{_0x3b2e2d=0xce;}_0x39a851[_0x7610('0x1a')](_0x3b2e2d);return _0x39a851[_0x7610('0x21')](_0x7610('0x22'),_0x41f5b6+'-'+_0x4f30b3+'/'+_0x112218)[_0x7610('0x1c')](_0x5e6a39);}return null;};}function patchUpdates(_0x443d4e){return function(_0x41ee76){try{jsonpatch[_0x7610('0x23')](_0x41ee76,_0x443d4e,!![]);}catch(_0x12c64d){return BPromise[_0x7610('0x24')](_0x12c64d);}return _0x41ee76['save']();};}function saveUpdates(_0x4144f7,_0x501f8a){return function(_0x35dd30){if(_0x35dd30){return _0x35dd30[_0x7610('0x25')](_0x4144f7)[_0x7610('0x26')](function(_0x44af3d){return _0x44af3d;});}return null;};}function removeEntity(_0x4aa706,_0x4d7eaa){return function(_0x30fdca){if(_0x30fdca){return _0x30fdca['destroy']()[_0x7610('0x26')](function(){var _0x339d3f=_0x30fdca[_0x7610('0x27')]({'plain':!![]});var _0x22b929=_0x7610('0x28');return db[_0x7610('0x29')]['destroy']({'where':{'type':_0x22b929,'resourceId':_0x339d3f['id']}})[_0x7610('0x26')](function(){return _0x30fdca;});})[_0x7610('0x26')](function(){_0x4aa706[_0x7610('0x1a')](0xcc)[_0x7610('0x1b')]();});}};}function handleEntityNotFound(_0xcccc58,_0x1ed072){return function(_0x458200){if(!_0x458200){_0xcccc58[_0x7610('0x19')](0x194);}return _0x458200;};}function handleError(_0x13e771,_0x30ae04){_0x30ae04=_0x30ae04||0x1f4;return function(_0x3c494f){logger[_0x7610('0x2a')](_0x3c494f[_0x7610('0x2b')]);if(_0x3c494f[_0x7610('0x2c')]){delete _0x3c494f[_0x7610('0x2c')];}_0x13e771[_0x7610('0x1a')](_0x30ae04)[_0x7610('0x2d')](_0x3c494f);};}exports[_0x7610('0x2e')]=function(_0x530025,_0x1508a5){var _0x49d692={},_0x24d5ed={},_0x4c9564={'count':0x0,'rows':[]};var _0x57ef2d=_[_0x7610('0x2f')](db[_0x7610('0x30')]['rawAttributes'],function(_0x3375e2){return{'name':_0x3375e2[_0x7610('0x31')],'type':_0x3375e2[_0x7610('0x32')][_0x7610('0x33')]};});_0x24d5ed[_0x7610('0x34')]=_[_0x7610('0x2f')](_0x57ef2d,_0x7610('0x2c'));_0x24d5ed[_0x7610('0x35')]=_[_0x7610('0x36')](_0x530025[_0x7610('0x35')]);_0x24d5ed[_0x7610('0x37')]=_['intersection'](_0x24d5ed['model'],_0x24d5ed[_0x7610('0x35')]);_0x49d692[_0x7610('0x38')]=_[_0x7610('0x39')](_0x24d5ed['model'],qs['fields'](_0x530025[_0x7610('0x35')]['fields']));_0x49d692['attributes']=_0x49d692['attributes'][_0x7610('0x3a')]?_0x49d692[_0x7610('0x38')]:_0x24d5ed[_0x7610('0x34')];if(!_0x530025['query'][_0x7610('0x3b')](_0x7610('0x3c'))){_0x49d692[_0x7610('0x1f')]=qs[_0x7610('0x1f')](_0x530025[_0x7610('0x35')][_0x7610('0x1f')]);_0x49d692[_0x7610('0x1d')]=qs[_0x7610('0x1d')](_0x530025['query'][_0x7610('0x1d')]);}_0x49d692['order']=qs[_0x7610('0x3d')](_0x530025[_0x7610('0x35')][_0x7610('0x3d')]);_0x49d692['where']=qs[_0x7610('0x37')](_[_0x7610('0x3e')](_0x530025[_0x7610('0x35')],_0x24d5ed[_0x7610('0x37')]),_0x57ef2d);if(_0x530025[_0x7610('0x35')][_0x7610('0x3f')]){_0x49d692[_0x7610('0x40')]=_[_0x7610('0x41')](_0x49d692[_0x7610('0x40')],{'$or':[{'key':{'$like':'%'+_0x530025['query'][_0x7610('0x3f')]+'%'}},{'value':{'$like':'%'+_0x530025[_0x7610('0x35')][_0x7610('0x3f')]+'%'}}]});}_0x49d692=_[_0x7610('0x41')]({},_0x49d692,_0x530025[_0x7610('0x42')]);var _0x103103={'where':_0x49d692[_0x7610('0x40')]};return db[_0x7610('0x30')][_0x7610('0x20')](_0x103103)[_0x7610('0x26')](function(_0xc64d8f){_0x4c9564[_0x7610('0x20')]=_0xc64d8f;if(_0x530025[_0x7610('0x35')]['includeAll']){_0x49d692[_0x7610('0x43')]=[{'all':!![]}];}return db[_0x7610('0x30')][_0x7610('0x44')](_0x49d692);})['then'](function(_0x5c983d){_0x4c9564[_0x7610('0x45')]=_0x5c983d;return _0x4c9564;})[_0x7610('0x26')](respondWithFilteredResult(_0x1508a5,_0x49d692))[_0x7610('0x46')](handleError(_0x1508a5,null));};exports[_0x7610('0x47')]=function(_0x280d48,_0x96dfb3){var _0x331cff={'raw':!![],'where':{'id':_0x280d48['params']['id']}},_0x579949={};_0x579949['model']=_['keys'](db[_0x7610('0x30')][_0x7610('0x48')]);_0x579949[_0x7610('0x35')]=_['keys'](_0x280d48[_0x7610('0x35')]);_0x579949['filters']=_[_0x7610('0x39')](_0x579949[_0x7610('0x34')],_0x579949[_0x7610('0x35')]);_0x331cff[_0x7610('0x38')]=_['intersection'](_0x579949['model'],qs[_0x7610('0x49')](_0x280d48[_0x7610('0x35')][_0x7610('0x49')]));_0x331cff['attributes']=_0x331cff[_0x7610('0x38')][_0x7610('0x3a')]?_0x331cff[_0x7610('0x38')]:_0x579949['model'];if(_0x280d48['query'][_0x7610('0x4a')]){_0x331cff[_0x7610('0x43')]=[{'all':!![]}];}_0x331cff=_[_0x7610('0x41')]({},_0x331cff,_0x280d48[_0x7610('0x42')]);return db['CannedAnswer'][_0x7610('0x4b')](_0x331cff)[_0x7610('0x26')](handleEntityNotFound(_0x96dfb3,null))[_0x7610('0x26')](respondWithResult(_0x96dfb3,null))[_0x7610('0x46')](handleError(_0x96dfb3,null));};exports[_0x7610('0x25')]=function(_0x11ff14,_0x4f7adf){if(_0x11ff14[_0x7610('0x4c')]['id']){delete _0x11ff14[_0x7610('0x4c')]['id'];}return db[_0x7610('0x30')]['find']({'where':{'id':_0x11ff14[_0x7610('0x4d')]['id']}})[_0x7610('0x26')](handleEntityNotFound(_0x4f7adf,null))['then'](saveUpdates(_0x11ff14[_0x7610('0x4c')],null))[_0x7610('0x26')](respondWithResult(_0x4f7adf,null))[_0x7610('0x46')](handleError(_0x4f7adf,null));};exports[_0x7610('0x4e')]=function(_0x1c8032,_0x4d8115){return db[_0x7610('0x30')][_0x7610('0x4b')]({'where':{'id':_0x1c8032['params']['id']}})[_0x7610('0x26')](handleEntityNotFound(_0x4d8115,null))[_0x7610('0x26')](removeEntity(_0x4d8115,null))[_0x7610('0x46')](handleError(_0x4d8115,null));};exports[_0x7610('0x4f')]=function(_0x3530f9,_0x2a51a3){var _0x1b9116={'key':_0x3530f9[_0x7610('0x4c')][_0x7610('0x33')]};if(_0x3530f9[_0x7610('0x4c')][_0x7610('0x50')]){_0x1b9116[_0x7610('0x50')]=_0x3530f9['body'][_0x7610('0x50')];}else if(_0x3530f9[_0x7610('0x4c')][_0x7610('0x51')]){_0x1b9116[_0x7610('0x51')]=_0x3530f9['body'][_0x7610('0x51')];}else if(_0x3530f9['body'][_0x7610('0x52')]){_0x1b9116[_0x7610('0x52')]=_0x3530f9[_0x7610('0x4c')][_0x7610('0x52')];}else if(_0x3530f9[_0x7610('0x4c')][_0x7610('0x53')]){_0x1b9116[_0x7610('0x53')]=_0x3530f9[_0x7610('0x4c')][_0x7610('0x53')];}return db['CannedAnswer']['find']({'where':_0x1b9116})[_0x7610('0x26')](function(_0x2262fd){if(_0x2262fd){throw new db[(_0x7610('0x54'))][(_0x7610('0x55'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x7610('0x30')]['create'](_0x3530f9[_0x7610('0x4c')]);})[_0x7610('0x26')](function(_0x142766){var _0x374852=_0x3530f9['user'][_0x7610('0x27')]({'plain':!![]});if(!_0x374852)throw new Error(_0x7610('0x56'));if(_0x374852[_0x7610('0x57')]==='user'){var _0x4bea7b=_0x142766[_0x7610('0x27')]({'plain':!![]});return db[_0x7610('0x58')][_0x7610('0x4b')]({'where':{'name':_0x7610('0x28'),'userProfileId':_0x374852['userProfileId']},'raw':!![]})[_0x7610('0x26')](function(_0x2f43f0){if(_0x2f43f0&&_0x2f43f0['autoAssociation']===0x0){return db[_0x7610('0x29')][_0x7610('0x4f')]({'name':_0x4bea7b[_0x7610('0x2c')],'resourceId':_0x4bea7b['id'],'type':_0x2f43f0[_0x7610('0x2c')],'sectionId':_0x2f43f0['id']},{})[_0x7610('0x26')](function(){return _0x142766;});}else{return _0x142766;}})[_0x7610('0x46')](function(_0x3a684b){logger['error'](_0x7610('0x59'),_0x3a684b);throw _0x3a684b;});}return _0x142766;})[_0x7610('0x26')](respondWithResult(_0x2a51a3,0xc9))[_0x7610('0x46')](handleError(_0x2a51a3,null));};
\ No newline at end of file
+var _0x09e2=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','rows','catch','show','params','body','find','create','key','MailAccountId','SmsAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x09e2,0x1b6));var _0x209e=function(_0x25cfcd,_0x5a294d){_0x25cfcd=_0x25cfcd-0x0;var _0x421a40=_0x09e2[_0x25cfcd];return _0x421a40;};'use strict';var emlformat=require(_0x209e('0x0'));var rimraf=require(_0x209e('0x1'));var zipdir=require(_0x209e('0x2'));var jsonpatch=require(_0x209e('0x3'));var rp=require(_0x209e('0x4'));var moment=require(_0x209e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x209e('0x6'));var util=require(_0x209e('0x7'));var path=require(_0x209e('0x8'));var sox=require(_0x209e('0x9'));var csv=require(_0x209e('0xa'));var ejs=require(_0x209e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x209e('0xc'));var squel=require(_0x209e('0xd'));var crypto=require(_0x209e('0xe'));var jsforce=require(_0x209e('0xf'));var deskjs=require(_0x209e('0x10'));var toCsv=require(_0x209e('0xa'));var querystring=require(_0x209e('0x11'));var Papa=require(_0x209e('0x12'));var Redis=require(_0x209e('0x13'));var authService=require(_0x209e('0x14'));var qs=require(_0x209e('0x15'));var as=require(_0x209e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x209e('0x17'))(_0x209e('0x18'));var utils=require('../../config/utils');var config=require(_0x209e('0x19'));var licenseUtil=require(_0x209e('0x1a'));var db=require(_0x209e('0x1b'))['db'];function respondWithStatusCode(_0x59c41c,_0x3a1040){_0x3a1040=_0x3a1040||0xcc;return function(_0x96c550){if(_0x96c550){return _0x59c41c[_0x209e('0x1c')](_0x3a1040);}return _0x59c41c['status'](_0x3a1040)[_0x209e('0x1d')]();};}function respondWithResult(_0x8627be,_0x55b607){_0x55b607=_0x55b607||0xc8;return function(_0x39c45d){if(_0x39c45d){return _0x8627be[_0x209e('0x1e')](_0x55b607)[_0x209e('0x1f')](_0x39c45d);}};}function respondWithFilteredResult(_0x548200,_0x4a40c1){return function(_0xb0151c){if(_0xb0151c){var _0x4c7eee=typeof _0x4a40c1['offset']==='undefined'&&typeof _0x4a40c1[_0x209e('0x20')]===_0x209e('0x21');var _0x3f5685=_0xb0151c[_0x209e('0x22')];var _0x19460b=_0x4c7eee?0x0:_0x4a40c1[_0x209e('0x23')];var _0x4a3a44=_0x4c7eee?_0xb0151c[_0x209e('0x22')]:_0x4a40c1['offset']+_0x4a40c1[_0x209e('0x20')];var _0x4b204d;if(_0x4a3a44>=_0x3f5685){_0x4a3a44=_0x3f5685;_0x4b204d=0xc8;}else{_0x4b204d=0xce;}_0x548200[_0x209e('0x1e')](_0x4b204d);return _0x548200[_0x209e('0x24')](_0x209e('0x25'),_0x19460b+'-'+_0x4a3a44+'/'+_0x3f5685)[_0x209e('0x1f')](_0xb0151c);}return null;};}function patchUpdates(_0x59cd19){return function(_0x5a1fdb){try{jsonpatch[_0x209e('0x26')](_0x5a1fdb,_0x59cd19,!![]);}catch(_0x4c41b0){return BPromise[_0x209e('0x27')](_0x4c41b0);}return _0x5a1fdb[_0x209e('0x28')]();};}function saveUpdates(_0x2ffcc6,_0x57dfe1){return function(_0x4d383c){if(_0x4d383c){return _0x4d383c[_0x209e('0x29')](_0x2ffcc6)[_0x209e('0x2a')](function(_0xba442e){return _0xba442e;});}return null;};}function removeEntity(_0x113d3d,_0x4ae2e1){return function(_0xbda9d6){if(_0xbda9d6){return _0xbda9d6[_0x209e('0x2b')]()[_0x209e('0x2a')](function(){var _0x29f378=_0xbda9d6['get']({'plain':!![]});var _0x530057=_0x209e('0x2c');return db[_0x209e('0x2d')]['destroy']({'where':{'type':_0x530057,'resourceId':_0x29f378['id']}})[_0x209e('0x2a')](function(){return _0xbda9d6;});})['then'](function(){_0x113d3d[_0x209e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e2938,_0x4de8af){return function(_0x513e3b){if(!_0x513e3b){_0x4e2938[_0x209e('0x1c')](0x194);}return _0x513e3b;};}function handleError(_0x36ccfe,_0x2dad3b){_0x2dad3b=_0x2dad3b||0x1f4;return function(_0x4c6d4){logger['error'](_0x4c6d4[_0x209e('0x2e')]);if(_0x4c6d4[_0x209e('0x2f')]){delete _0x4c6d4[_0x209e('0x2f')];}_0x36ccfe[_0x209e('0x1e')](_0x2dad3b)['send'](_0x4c6d4);};}exports[_0x209e('0x30')]=function(_0x47456a,_0x2b9b8f){var _0x4e3499={},_0x430c9a={},_0x2bccf1={'count':0x0,'rows':[]};var _0x59072a=_[_0x209e('0x31')](db[_0x209e('0x32')][_0x209e('0x33')],function(_0x274992){return{'name':_0x274992[_0x209e('0x34')],'type':_0x274992[_0x209e('0x35')]['key']};});_0x430c9a[_0x209e('0x36')]=_['map'](_0x59072a,_0x209e('0x2f'));_0x430c9a[_0x209e('0x37')]=_[_0x209e('0x38')](_0x47456a[_0x209e('0x37')]);_0x430c9a[_0x209e('0x39')]=_[_0x209e('0x3a')](_0x430c9a['model'],_0x430c9a[_0x209e('0x37')]);_0x4e3499[_0x209e('0x3b')]=_[_0x209e('0x3a')](_0x430c9a[_0x209e('0x36')],qs[_0x209e('0x3c')](_0x47456a[_0x209e('0x37')][_0x209e('0x3c')]));_0x4e3499['attributes']=_0x4e3499[_0x209e('0x3b')][_0x209e('0x3d')]?_0x4e3499[_0x209e('0x3b')]:_0x430c9a[_0x209e('0x36')];if(!_0x47456a['query'][_0x209e('0x3e')]('nolimit')){_0x4e3499[_0x209e('0x20')]=qs[_0x209e('0x20')](_0x47456a['query']['limit']);_0x4e3499[_0x209e('0x23')]=qs[_0x209e('0x23')](_0x47456a['query'][_0x209e('0x23')]);}_0x4e3499[_0x209e('0x3f')]=qs[_0x209e('0x40')](_0x47456a[_0x209e('0x37')][_0x209e('0x40')]);_0x4e3499[_0x209e('0x41')]=qs['filters'](_[_0x209e('0x42')](_0x47456a[_0x209e('0x37')],_0x430c9a[_0x209e('0x39')]),_0x59072a);if(_0x47456a[_0x209e('0x37')][_0x209e('0x43')]){_0x4e3499['where']=_[_0x209e('0x44')](_0x4e3499[_0x209e('0x41')],{'$or':[{'key':{'$like':'%'+_0x47456a['query']['filter']+'%'}},{'value':{'$like':'%'+_0x47456a[_0x209e('0x37')][_0x209e('0x43')]+'%'}}]});}_0x4e3499=_[_0x209e('0x44')]({},_0x4e3499,_0x47456a[_0x209e('0x45')]);var _0x3f41ba={'where':_0x4e3499[_0x209e('0x41')]};return db['CannedAnswer'][_0x209e('0x22')](_0x3f41ba)[_0x209e('0x2a')](function(_0x4a412e){_0x2bccf1[_0x209e('0x22')]=_0x4a412e;if(_0x47456a[_0x209e('0x37')]['includeAll']){_0x4e3499['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x4e3499);})[_0x209e('0x2a')](function(_0x114978){_0x2bccf1[_0x209e('0x46')]=_0x114978;return _0x2bccf1;})[_0x209e('0x2a')](respondWithFilteredResult(_0x2b9b8f,_0x4e3499))[_0x209e('0x47')](handleError(_0x2b9b8f,null));};exports[_0x209e('0x48')]=function(_0x418b59,_0xb3fc48){var _0x475208={'raw':!![],'where':{'id':_0x418b59[_0x209e('0x49')]['id']}},_0x193ca7={};_0x193ca7[_0x209e('0x36')]=_[_0x209e('0x38')](db[_0x209e('0x32')][_0x209e('0x33')]);_0x193ca7[_0x209e('0x37')]=_[_0x209e('0x38')](_0x418b59[_0x209e('0x37')]);_0x193ca7['filters']=_[_0x209e('0x3a')](_0x193ca7['model'],_0x193ca7[_0x209e('0x37')]);_0x475208[_0x209e('0x3b')]=_['intersection'](_0x193ca7['model'],qs[_0x209e('0x3c')](_0x418b59[_0x209e('0x37')][_0x209e('0x3c')]));_0x475208['attributes']=_0x475208[_0x209e('0x3b')]['length']?_0x475208[_0x209e('0x3b')]:_0x193ca7['model'];if(_0x418b59['query']['includeAll']){_0x475208['include']=[{'all':!![]}];}_0x475208=_[_0x209e('0x44')]({},_0x475208,_0x418b59[_0x209e('0x45')]);return db[_0x209e('0x32')]['find'](_0x475208)['then'](handleEntityNotFound(_0xb3fc48,null))['then'](respondWithResult(_0xb3fc48,null))[_0x209e('0x47')](handleError(_0xb3fc48,null));};exports[_0x209e('0x29')]=function(_0x4a06a9,_0x456c05){if(_0x4a06a9[_0x209e('0x4a')]['id']){delete _0x4a06a9[_0x209e('0x4a')]['id'];}return db['CannedAnswer'][_0x209e('0x4b')]({'where':{'id':_0x4a06a9[_0x209e('0x49')]['id']}})['then'](handleEntityNotFound(_0x456c05,null))['then'](saveUpdates(_0x4a06a9[_0x209e('0x4a')],null))[_0x209e('0x2a')](respondWithResult(_0x456c05,null))[_0x209e('0x47')](handleError(_0x456c05,null));};exports[_0x209e('0x2b')]=function(_0x28f2fb,_0x1b285f){return db[_0x209e('0x32')][_0x209e('0x4b')]({'where':{'id':_0x28f2fb[_0x209e('0x49')]['id']}})[_0x209e('0x2a')](handleEntityNotFound(_0x1b285f,null))[_0x209e('0x2a')](removeEntity(_0x1b285f,null))['catch'](handleError(_0x1b285f,null));};exports[_0x209e('0x4c')]=function(_0x298cad,_0x37f2ae){var _0x53a30e={'key':_0x298cad[_0x209e('0x4a')][_0x209e('0x4d')]};if(_0x298cad[_0x209e('0x4a')][_0x209e('0x4e')]){_0x53a30e[_0x209e('0x4e')]=_0x298cad['body'][_0x209e('0x4e')];}else if(_0x298cad[_0x209e('0x4a')]['SmsAccountId']){_0x53a30e[_0x209e('0x4f')]=_0x298cad[_0x209e('0x4a')][_0x209e('0x4f')];}else if(_0x298cad[_0x209e('0x4a')]['OpenchannelAccountId']){_0x53a30e['OpenchannelAccountId']=_0x298cad[_0x209e('0x4a')]['OpenchannelAccountId'];}else if(_0x298cad[_0x209e('0x4a')][_0x209e('0x50')]){_0x53a30e[_0x209e('0x50')]=_0x298cad['body'][_0x209e('0x50')];}return db[_0x209e('0x32')][_0x209e('0x4b')]({'where':_0x53a30e})[_0x209e('0x2a')](function(_0x3e9cd3){if(_0x3e9cd3){throw new db[(_0x209e('0x51'))][(_0x209e('0x52'))](_0x209e('0x53'));}return db[_0x209e('0x32')][_0x209e('0x4c')](_0x298cad['body']);})[_0x209e('0x2a')](function(_0x327ae5){var _0x1337d9=_0x298cad['user'][_0x209e('0x54')]({'plain':!![]});if(!_0x1337d9)throw new Error(_0x209e('0x55'));if(_0x1337d9['role']===_0x209e('0x56')){var _0x51883f=_0x327ae5[_0x209e('0x54')]({'plain':!![]});return db['UserProfileSection'][_0x209e('0x4b')]({'where':{'name':_0x209e('0x2c'),'userProfileId':_0x1337d9[_0x209e('0x57')]},'raw':!![]})[_0x209e('0x2a')](function(_0x1a4d5c){if(_0x1a4d5c&&_0x1a4d5c[_0x209e('0x58')]===0x0){return db['UserProfileResource'][_0x209e('0x4c')]({'name':_0x51883f[_0x209e('0x2f')],'resourceId':_0x51883f['id'],'type':_0x1a4d5c[_0x209e('0x2f')],'sectionId':_0x1a4d5c['id']},{})[_0x209e('0x2a')](function(){return _0x327ae5;});}else{return _0x327ae5;}})[_0x209e('0x47')](function(_0x361aa6){logger[_0x209e('0x59')](_0x209e('0x5a'),_0x361aa6);throw _0x361aa6;});}return _0x327ae5;})[_0x209e('0x2a')](respondWithResult(_0x37f2ae,0xc9))[_0x209e('0x47')](handleError(_0x37f2ae,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 20e49e9..0818f91 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 _0xff28=['lodash','util','../../config/logger','api','bluebird','path','rimraf','exports','define','tools_canned_answers','utf8mb4'];(function(_0x7b484,_0x195ad4){var _0x2ae1cf=function(_0x2e6247){while(--_0x2e6247){_0x7b484['push'](_0x7b484['shift']());}};_0x2ae1cf(++_0x195ad4);}(_0xff28,0xdc));var _0x8ff2=function(_0x443494,_0x51fc7e){_0x443494=_0x443494-0x0;var _0x4a6794=_0xff28[_0x443494];return _0x4a6794;};'use strict';var _=require(_0x8ff2('0x0'));var util=require(_0x8ff2('0x1'));var logger=require(_0x8ff2('0x2'))(_0x8ff2('0x3'));var moment=require('moment');var BPromise=require(_0x8ff2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ff2('0x5'));var rimraf=require(_0x8ff2('0x6'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x8ff2('0x7')]=function(_0x3bc7e4,_0x2e8993){return _0x3bc7e4[_0x8ff2('0x8')]('CannedAnswer',attributes,{'tableName':_0x8ff2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8ff2('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8f59=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x58d86a,_0x5b2505){var _0x3f5008=function(_0x53ad18){while(--_0x53ad18){_0x58d86a['push'](_0x58d86a['shift']());}};_0x3f5008(++_0x5b2505);}(_0x8f59,0x11d));var _0x98f5=function(_0x5ba736,_0x3470bb){_0x5ba736=_0x5ba736-0x0;var _0xa338e4=_0x8f59[_0x5ba736];return _0xa338e4;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var logger=require(_0x98f5('0x2'))(_0x98f5('0x3'));var moment=require(_0x98f5('0x4'));var BPromise=require(_0x98f5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98f5('0x6'));var rimraf=require(_0x98f5('0x7'));var config=require(_0x98f5('0x8'));var attributes=require(_0x98f5('0x9'));module['exports']=function(_0xdcce7a,_0x358618){return _0xdcce7a[_0x98f5('0xa')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x98f5('0xb'),'collate':_0x98f5('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index fa50cd4..c65f87c 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(_0x23f553,_0x445bf3){var _0x26ab08=function(_0x44d3a3){while(--_0x44d3a3){_0x23f553['push'](_0x23f553['shift']());}};_0x26ab08(++_0x445bf3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x3b5ffd,_0x2548d1){var _0x1fa6d5=function(_0x2237c){while(--_0x2237c){_0x3b5ffd['push'](_0x3b5ffd['shift']());}};_0x1fa6d5(++_0x2548d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 2b2d411..e6e1d0a 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 _0x6ff1=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','post'];(function(_0x41daaf,_0x9c8ae8){var _0x492873=function(_0x4283b3){while(--_0x4283b3){_0x41daaf['push'](_0x41daaf['shift']());}};_0x492873(++_0x9c8ae8);}(_0x6ff1,0xf0));var _0x16ff=function(_0x48787a,_0x13f971){_0x48787a=_0x48787a-0x0;var _0x452d03=_0x6ff1[_0x48787a];return _0x452d03;};'use strict';var multer=require(_0x16ff('0x0'));var util=require(_0x16ff('0x1'));var path=require('path');var timeout=require(_0x16ff('0x2'));var express=require(_0x16ff('0x3'));var router=express['Router']();var fs_extra=require(_0x16ff('0x4'));var auth=require(_0x16ff('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x16ff('0x6'));var controller=require(_0x16ff('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x16ff('0x8')](_0x16ff('0x9'),auth[_0x16ff('0xa')](),controller['show']);router[_0x16ff('0xb')]('/',auth[_0x16ff('0xa')](),controller[_0x16ff('0xc')]);router[_0x16ff('0xd')](_0x16ff('0x9'),auth['isAuthenticated'](),controller[_0x16ff('0xe')]);router[_0x16ff('0xf')]('/:id',auth[_0x16ff('0xa')](),controller[_0x16ff('0x10')]);module[_0x16ff('0x11')]=router;
\ No newline at end of file
+var _0x6e54=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','index','get','/:id','post','isAuthenticated','create'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x6e54,0x101));var _0x46e5=function(_0x324fe8,_0x1ccb46){_0x324fe8=_0x324fe8-0x0;var _0x4a1cd9=_0x6e54[_0x324fe8];return _0x4a1cd9;};'use strict';var multer=require(_0x46e5('0x0'));var util=require(_0x46e5('0x1'));var path=require(_0x46e5('0x2'));var timeout=require(_0x46e5('0x3'));var express=require(_0x46e5('0x4'));var router=express[_0x46e5('0x5')]();var fs_extra=require(_0x46e5('0x6'));var auth=require(_0x46e5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x46e5('0x8'));var controller=require(_0x46e5('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x46e5('0xa')]);router[_0x46e5('0xb')](_0x46e5('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x46e5('0xd')]('/',auth[_0x46e5('0xe')](),controller[_0x46e5('0xf')]);router[_0x46e5('0x10')](_0x46e5('0xc'),auth['isAuthenticated'](),controller[_0x46e5('0x11')]);router[_0x46e5('0x12')](_0x46e5('0xc'),auth[_0x46e5('0xe')](),controller[_0x46e5('0x13')]);module[_0x46e5('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index e5b5345..d3c72b4 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 _0xc540=['INTEGER','1970-01-01\x2000:00:01','STRING'];(function(_0xc1c93f,_0x1fba71){var _0x3f81cb=function(_0x20b66f){while(--_0x20b66f){_0xc1c93f['push'](_0xc1c93f['shift']());}};_0x3f81cb(++_0x1fba71);}(_0xc540,0x184));var _0x0c54=function(_0x3956ff,_0x4cd334){_0x3956ff=_0x3956ff-0x0;var _0x3bd57d=_0xc540[_0x3956ff];return _0x3bd57d;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x0c54('0x0')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x0c54('0x1')]},'dst':{'type':Sequelize[_0x0c54('0x1')]},'dcontext':{'type':Sequelize[_0x0c54('0x1')]},'channel':{'type':Sequelize[_0x0c54('0x1')]},'dstchannel':{'type':Sequelize[_0x0c54('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x0c54('0x1')]},'duration':{'type':Sequelize[_0x0c54('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0c54('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0c54('0x1')]},'amaflags':{'type':Sequelize[_0x0c54('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0c54('0x1')]},'userfield':{'type':Sequelize[_0x0c54('0x1')]},'uniqueid':{'type':Sequelize[_0x0c54('0x1')]},'linkedid':{'type':Sequelize[_0x0c54('0x1')]},'sequence':{'type':Sequelize[_0x0c54('0x1')]},'peeraccount':{'type':Sequelize[_0x0c54('0x1')]},'type':{'type':Sequelize[_0x0c54('0x1')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3a41=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x1ba0f3,_0x4e7ab8){var _0x313c21=function(_0x423f79){while(--_0x423f79){_0x1ba0f3['push'](_0x1ba0f3['shift']());}};_0x313c21(++_0x4e7ab8);}(_0x3a41,0x86));var _0x13a4=function(_0x56de9d,_0x413b89){_0x56de9d=_0x56de9d-0x0;var _0x5b63fd=_0x3a41[_0x56de9d];return _0x5b63fd;};'use strict';var Sequelize=require(_0x13a4('0x0'));module[_0x13a4('0x1')]={'calldate':{'type':Sequelize[_0x13a4('0x2')],'allowNull':![],'defaultValue':_0x13a4('0x3')},'clid':{'type':Sequelize[_0x13a4('0x4')]},'src':{'type':Sequelize[_0x13a4('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x13a4('0x4')]},'channel':{'type':Sequelize[_0x13a4('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x13a4('0x4')]},'duration':{'type':Sequelize[_0x13a4('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x13a4('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x13a4('0x4')]},'amaflags':{'type':Sequelize[_0x13a4('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x13a4('0x4')]},'uniqueid':{'type':Sequelize[_0x13a4('0x4')]},'linkedid':{'type':Sequelize[_0x13a4('0x4')]},'sequence':{'type':Sequelize[_0x13a4('0x4')]},'peeraccount':{'type':Sequelize[_0x13a4('0x4')]},'type':{'type':Sequelize[_0x13a4('0x4')]},'tag':{'type':Sequelize[_0x13a4('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 30a37b5..adf83cf 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 _0xf006=['fieldName','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','destroy','describe','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','Cdr','rawAttributes'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0xf006,0x146));var _0x6f00=function(_0x57ab57,_0x35db53){_0x57ab57=_0x57ab57-0x0;var _0x5ddf03=_0xf006[_0x57ab57];return _0x5ddf03;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6f00('0x0'));var jsonpatch=require(_0x6f00('0x1'));var rp=require('request-promise');var moment=require(_0x6f00('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6f00('0x3'));var util=require('util');var path=require('path');var sox=require(_0x6f00('0x4'));var csv=require(_0x6f00('0x5'));var ejs=require(_0x6f00('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f00('0x7'));var squel=require('squel');var crypto=require(_0x6f00('0x8'));var jsforce=require(_0x6f00('0x9'));var deskjs=require(_0x6f00('0xa'));var toCsv=require(_0x6f00('0x5'));var querystring=require(_0x6f00('0xb'));var Papa=require(_0x6f00('0xc'));var Redis=require(_0x6f00('0xd'));var authService=require(_0x6f00('0xe'));var qs=require(_0x6f00('0xf'));var as=require(_0x6f00('0x10'));var hardwareService=require(_0x6f00('0x11'));var logger=require(_0x6f00('0x12'))(_0x6f00('0x13'));var utils=require('../../config/utils');var config=require(_0x6f00('0x14'));var licenseUtil=require(_0x6f00('0x15'));var db=require(_0x6f00('0x16'))['db'];function respondWithStatusCode(_0x36a2ec,_0x289fe9){_0x289fe9=_0x289fe9||0xcc;return function(_0x5e3264){if(_0x5e3264){return _0x36a2ec[_0x6f00('0x17')](_0x289fe9);}return _0x36a2ec['status'](_0x289fe9)[_0x6f00('0x18')]();};}function respondWithResult(_0x5047f5,_0x324e67){_0x324e67=_0x324e67||0xc8;return function(_0x220e68){if(_0x220e68){return _0x5047f5[_0x6f00('0x19')](_0x324e67)[_0x6f00('0x1a')](_0x220e68);}};}function respondWithFilteredResult(_0xa6e7a1,_0x411203){return function(_0x46bc2c){if(_0x46bc2c){var _0x4d8aee=typeof _0x411203[_0x6f00('0x1b')]==='undefined'&&typeof _0x411203[_0x6f00('0x1c')]==='undefined';var _0x534275=_0x46bc2c[_0x6f00('0x1d')];var _0x6cf83f=_0x4d8aee?0x0:_0x411203[_0x6f00('0x1b')];var _0x340f78=_0x4d8aee?_0x46bc2c[_0x6f00('0x1d')]:_0x411203[_0x6f00('0x1b')]+_0x411203[_0x6f00('0x1c')];var _0x295640;if(_0x340f78>=_0x534275){_0x340f78=_0x534275;_0x295640=0xc8;}else{_0x295640=0xce;}_0xa6e7a1[_0x6f00('0x19')](_0x295640);return _0xa6e7a1[_0x6f00('0x1e')](_0x6f00('0x1f'),_0x6cf83f+'-'+_0x340f78+'/'+_0x534275)[_0x6f00('0x1a')](_0x46bc2c);}return null;};}function patchUpdates(_0x4e11de){return function(_0x4f3031){try{jsonpatch['apply'](_0x4f3031,_0x4e11de,!![]);}catch(_0x2a5286){return BPromise[_0x6f00('0x20')](_0x2a5286);}return _0x4f3031[_0x6f00('0x21')]();};}function saveUpdates(_0x57340f,_0xe301e5){return function(_0x9066ff){if(_0x9066ff){return _0x9066ff[_0x6f00('0x22')](_0x57340f)[_0x6f00('0x23')](function(_0x388983){return _0x388983;});}return null;};}function removeEntity(_0x1cbf1c,_0x90d74c){return function(_0x1ea061){if(_0x1ea061){return _0x1ea061['destroy']()[_0x6f00('0x23')](function(){_0x1cbf1c[_0x6f00('0x19')](0xcc)[_0x6f00('0x18')]();});}};}function handleEntityNotFound(_0x4d41ef,_0x37f062){return function(_0x4f7e29){if(!_0x4f7e29){_0x4d41ef[_0x6f00('0x17')](0x194);}return _0x4f7e29;};}function handleError(_0x511293,_0x434735){_0x434735=_0x434735||0x1f4;return function(_0x39375d){logger[_0x6f00('0x24')](_0x39375d[_0x6f00('0x25')]);if(_0x39375d[_0x6f00('0x26')]){delete _0x39375d['name'];}_0x511293[_0x6f00('0x19')](_0x434735)[_0x6f00('0x27')](_0x39375d);};}exports[_0x6f00('0x28')]=function(_0x4366a4,_0x2671fe){var _0x235a86={},_0xff36ce={},_0x451849={'count':0x0,'rows':[]};var _0x22f107=_[_0x6f00('0x29')](db[_0x6f00('0x2a')][_0x6f00('0x2b')],function(_0x29555d){return{'name':_0x29555d[_0x6f00('0x2c')],'type':_0x29555d['type']['key']};});_0xff36ce['model']=_['map'](_0x22f107,'name');_0xff36ce['query']=_[_0x6f00('0x2d')](_0x4366a4['query']);_0xff36ce[_0x6f00('0x2e')]=_[_0x6f00('0x2f')](_0xff36ce[_0x6f00('0x30')],_0xff36ce[_0x6f00('0x31')]);_0x235a86[_0x6f00('0x32')]=_[_0x6f00('0x2f')](_0xff36ce['model'],qs[_0x6f00('0x33')](_0x4366a4[_0x6f00('0x31')][_0x6f00('0x33')]));_0x235a86[_0x6f00('0x32')]=_0x235a86[_0x6f00('0x32')]['length']?_0x235a86['attributes']:_0xff36ce['model'];if(!_0x4366a4[_0x6f00('0x31')][_0x6f00('0x34')](_0x6f00('0x35'))){_0x235a86[_0x6f00('0x1c')]=qs[_0x6f00('0x1c')](_0x4366a4['query'][_0x6f00('0x1c')]);_0x235a86[_0x6f00('0x1b')]=qs[_0x6f00('0x1b')](_0x4366a4[_0x6f00('0x31')][_0x6f00('0x1b')]);}_0x235a86[_0x6f00('0x36')]=qs[_0x6f00('0x37')](_0x4366a4['query'][_0x6f00('0x37')]);_0x235a86[_0x6f00('0x38')]=qs[_0x6f00('0x2e')](_['pick'](_0x4366a4[_0x6f00('0x31')],_0xff36ce[_0x6f00('0x2e')]),_0x22f107);if(_0x4366a4[_0x6f00('0x31')]['filter']){_0x235a86[_0x6f00('0x38')]=_['merge'](_0x235a86[_0x6f00('0x38')],{'$or':_['map'](_0x22f107,function(_0x3dc8e3){if(_0x3dc8e3[_0x6f00('0x39')]!==_0x6f00('0x3a')){var _0x896b3f={};_0x896b3f[_0x3dc8e3['name']]={'$like':'%'+_0x4366a4[_0x6f00('0x31')]['filter']+'%'};return _0x896b3f;}})});}_0x235a86=_[_0x6f00('0x3b')]({},_0x235a86,_0x4366a4['options']);var _0x7785e1={'where':_0x235a86[_0x6f00('0x38')]};return db[_0x6f00('0x2a')][_0x6f00('0x1d')](_0x7785e1)['then'](function(_0x53dc8c){_0x451849[_0x6f00('0x1d')]=_0x53dc8c;if(_0x4366a4['query'][_0x6f00('0x3c')]){_0x235a86[_0x6f00('0x3d')]=[{'all':!![]}];}return db['Cdr'][_0x6f00('0x3e')](_0x235a86);})['then'](function(_0x4cac2c){_0x451849[_0x6f00('0x3f')]=_0x4cac2c;return _0x451849;})[_0x6f00('0x23')](respondWithFilteredResult(_0x2671fe,_0x235a86))[_0x6f00('0x40')](handleError(_0x2671fe,null));};exports[_0x6f00('0x41')]=function(_0x56399a,_0x38ee25){var _0x4523f2={'raw':!![],'where':{'id':_0x56399a[_0x6f00('0x42')]['id']}},_0x2bb5aa={};_0x2bb5aa[_0x6f00('0x30')]=_[_0x6f00('0x2d')](db['Cdr'][_0x6f00('0x2b')]);_0x2bb5aa[_0x6f00('0x31')]=_[_0x6f00('0x2d')](_0x56399a[_0x6f00('0x31')]);_0x2bb5aa[_0x6f00('0x2e')]=_[_0x6f00('0x2f')](_0x2bb5aa['model'],_0x2bb5aa[_0x6f00('0x31')]);_0x4523f2[_0x6f00('0x32')]=_[_0x6f00('0x2f')](_0x2bb5aa['model'],qs[_0x6f00('0x33')](_0x56399a['query'][_0x6f00('0x33')]));_0x4523f2[_0x6f00('0x32')]=_0x4523f2['attributes'][_0x6f00('0x43')]?_0x4523f2['attributes']:_0x2bb5aa[_0x6f00('0x30')];if(_0x56399a[_0x6f00('0x31')][_0x6f00('0x3c')]){_0x4523f2[_0x6f00('0x3d')]=[{'all':!![]}];}_0x4523f2=_['merge']({},_0x4523f2,_0x56399a[_0x6f00('0x44')]);return db['Cdr'][_0x6f00('0x45')](_0x4523f2)['then'](handleEntityNotFound(_0x38ee25,null))[_0x6f00('0x23')](respondWithResult(_0x38ee25,null))[_0x6f00('0x40')](handleError(_0x38ee25,null));};exports[_0x6f00('0x46')]=function(_0x9b003,_0x470ff3){return db[_0x6f00('0x2a')][_0x6f00('0x46')](_0x9b003[_0x6f00('0x47')],{})['then'](respondWithResult(_0x470ff3,0xc9))[_0x6f00('0x40')](handleError(_0x470ff3,null));};exports['update']=function(_0x265666,_0x31fb17){if(_0x265666[_0x6f00('0x47')]['id']){delete _0x265666['body']['id'];}return db['Cdr'][_0x6f00('0x45')]({'where':{'id':_0x265666[_0x6f00('0x42')]['id']}})['then'](handleEntityNotFound(_0x31fb17,null))[_0x6f00('0x23')](saveUpdates(_0x265666['body'],null))[_0x6f00('0x23')](respondWithResult(_0x31fb17,null))['catch'](handleError(_0x31fb17,null));};exports[_0x6f00('0x48')]=function(_0x222b4c,_0x4c6e06){return db['Cdr'][_0x6f00('0x45')]({'where':{'id':_0x222b4c[_0x6f00('0x42')]['id']}})['then'](handleEntityNotFound(_0x4c6e06,null))[_0x6f00('0x23')](removeEntity(_0x4c6e06,null))['catch'](handleError(_0x4c6e06,null));};exports[_0x6f00('0x49')]=function(_0x7f80ed,_0x3100ee){return db[_0x6f00('0x2a')][_0x6f00('0x49')]()[_0x6f00('0x23')](respondWithResult(_0x3100ee,null))[_0x6f00('0x40')](handleError(_0x3100ee,null));};
\ No newline at end of file
+var _0x5292=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','fields','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Cdr'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x5292,0xf7));var _0x2529=function(_0x5e3ac2,_0x225614){_0x5e3ac2=_0x5e3ac2-0x0;var _0x29a007=_0x5292[_0x5e3ac2];return _0x29a007;};'use strict';var emlformat=require(_0x2529('0x0'));var rimraf=require(_0x2529('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2529('0x2'));var rp=require('request-promise');var moment=require(_0x2529('0x3'));var BPromise=require(_0x2529('0x4'));var Mustache=require(_0x2529('0x5'));var util=require(_0x2529('0x6'));var path=require('path');var sox=require(_0x2529('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2529('0x8'));var squel=require(_0x2529('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2529('0xa'));var toCsv=require(_0x2529('0xb'));var querystring=require('querystring');var Papa=require(_0x2529('0xc'));var Redis=require(_0x2529('0xd'));var authService=require(_0x2529('0xe'));var qs=require(_0x2529('0xf'));var as=require(_0x2529('0x10'));var hardwareService=require(_0x2529('0x11'));var logger=require(_0x2529('0x12'))(_0x2529('0x13'));var utils=require('../../config/utils');var config=require(_0x2529('0x14'));var licenseUtil=require(_0x2529('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe333c9,_0x23bfaf){_0x23bfaf=_0x23bfaf||0xcc;return function(_0x149692){if(_0x149692){return _0xe333c9[_0x2529('0x16')](_0x23bfaf);}return _0xe333c9[_0x2529('0x17')](_0x23bfaf)[_0x2529('0x18')]();};}function respondWithResult(_0x3f3b40,_0x5245cf){_0x5245cf=_0x5245cf||0xc8;return function(_0x101668){if(_0x101668){return _0x3f3b40[_0x2529('0x17')](_0x5245cf)[_0x2529('0x19')](_0x101668);}};}function respondWithFilteredResult(_0x19e4bf,_0x1cc716){return function(_0x2598a1){if(_0x2598a1){var _0x1a1ccc=typeof _0x1cc716[_0x2529('0x1a')]==='undefined'&&typeof _0x1cc716[_0x2529('0x1b')]==='undefined';var _0x337720=_0x2598a1[_0x2529('0x1c')];var _0x89be58=_0x1a1ccc?0x0:_0x1cc716['offset'];var _0x5b4d0d=_0x1a1ccc?_0x2598a1[_0x2529('0x1c')]:_0x1cc716[_0x2529('0x1a')]+_0x1cc716[_0x2529('0x1b')];var _0x37204a;if(_0x5b4d0d>=_0x337720){_0x5b4d0d=_0x337720;_0x37204a=0xc8;}else{_0x37204a=0xce;}_0x19e4bf[_0x2529('0x17')](_0x37204a);return _0x19e4bf['set'](_0x2529('0x1d'),_0x89be58+'-'+_0x5b4d0d+'/'+_0x337720)[_0x2529('0x19')](_0x2598a1);}return null;};}function patchUpdates(_0x1ca15f){return function(_0xeff5a6){try{jsonpatch['apply'](_0xeff5a6,_0x1ca15f,!![]);}catch(_0x1fa873){return BPromise[_0x2529('0x1e')](_0x1fa873);}return _0xeff5a6[_0x2529('0x1f')]();};}function saveUpdates(_0x5b4760,_0x3d5d17){return function(_0x3f57da){if(_0x3f57da){return _0x3f57da[_0x2529('0x20')](_0x5b4760)[_0x2529('0x21')](function(_0x5540e4){return _0x5540e4;});}return null;};}function removeEntity(_0x2736f6,_0x2d0c6d){return function(_0x400a01){if(_0x400a01){return _0x400a01[_0x2529('0x22')]()[_0x2529('0x21')](function(){_0x2736f6[_0x2529('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5539ef,_0x856e50){return function(_0x40f42b){if(!_0x40f42b){_0x5539ef[_0x2529('0x16')](0x194);}return _0x40f42b;};}function handleError(_0x431c40,_0x24418a){_0x24418a=_0x24418a||0x1f4;return function(_0x2a8371){logger[_0x2529('0x23')](_0x2a8371[_0x2529('0x24')]);if(_0x2a8371[_0x2529('0x25')]){delete _0x2a8371[_0x2529('0x25')];}_0x431c40['status'](_0x24418a)[_0x2529('0x26')](_0x2a8371);};}exports[_0x2529('0x27')]=function(_0x4dd0fb,_0x1822ce){var _0x3c46c6={},_0x5bea2d={},_0x17bcbd={'count':0x0,'rows':[]};var _0x1d7e98=_['map'](db[_0x2529('0x28')][_0x2529('0x29')],function(_0x4a18f6){return{'name':_0x4a18f6[_0x2529('0x2a')],'type':_0x4a18f6[_0x2529('0x2b')][_0x2529('0x2c')]};});_0x5bea2d[_0x2529('0x2d')]=_[_0x2529('0x2e')](_0x1d7e98,'name');_0x5bea2d[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x4dd0fb[_0x2529('0x2f')]);_0x5bea2d[_0x2529('0x31')]=_[_0x2529('0x32')](_0x5bea2d[_0x2529('0x2d')],_0x5bea2d[_0x2529('0x2f')]);_0x3c46c6['attributes']=_['intersection'](_0x5bea2d[_0x2529('0x2d')],qs['fields'](_0x4dd0fb[_0x2529('0x2f')]['fields']));_0x3c46c6['attributes']=_0x3c46c6['attributes'][_0x2529('0x33')]?_0x3c46c6[_0x2529('0x34')]:_0x5bea2d[_0x2529('0x2d')];if(!_0x4dd0fb['query'][_0x2529('0x35')]('nolimit')){_0x3c46c6['limit']=qs['limit'](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1b')]);_0x3c46c6[_0x2529('0x1a')]=qs[_0x2529('0x1a')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1a')]);}_0x3c46c6[_0x2529('0x36')]=qs[_0x2529('0x37')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x37')]);_0x3c46c6[_0x2529('0x38')]=qs[_0x2529('0x31')](_[_0x2529('0x39')](_0x4dd0fb['query'],_0x5bea2d['filters']),_0x1d7e98);if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]){_0x3c46c6['where']=_[_0x2529('0x3b')](_0x3c46c6[_0x2529('0x38')],{'$or':_[_0x2529('0x2e')](_0x1d7e98,function(_0x1b1f81){if(_0x1b1f81[_0x2529('0x2b')]!==_0x2529('0x3c')){var _0x1b8226={};_0x1b8226[_0x1b1f81['name']]={'$like':'%'+_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]+'%'};return _0x1b8226;}})});}_0x3c46c6=_[_0x2529('0x3b')]({},_0x3c46c6,_0x4dd0fb['options']);var _0x1393b7={'where':_0x3c46c6[_0x2529('0x38')]};return db[_0x2529('0x28')][_0x2529('0x1c')](_0x1393b7)[_0x2529('0x21')](function(_0x33acbf){_0x17bcbd[_0x2529('0x1c')]=_0x33acbf;if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3d')]){_0x3c46c6['include']=[{'all':!![]}];}return db[_0x2529('0x28')][_0x2529('0x3e')](_0x3c46c6);})[_0x2529('0x21')](function(_0x3b4e47){_0x17bcbd[_0x2529('0x3f')]=_0x3b4e47;return _0x17bcbd;})[_0x2529('0x21')](respondWithFilteredResult(_0x1822ce,_0x3c46c6))[_0x2529('0x40')](handleError(_0x1822ce,null));};exports['show']=function(_0x8ced2e,_0x33a13e){var _0x3f76e8={'raw':!![],'where':{'id':_0x8ced2e[_0x2529('0x41')]['id']}},_0x2aaecb={};_0x2aaecb['model']=_[_0x2529('0x30')](db[_0x2529('0x28')][_0x2529('0x29')]);_0x2aaecb[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x8ced2e[_0x2529('0x2f')]);_0x2aaecb['filters']=_['intersection'](_0x2aaecb['model'],_0x2aaecb['query']);_0x3f76e8[_0x2529('0x34')]=_['intersection'](_0x2aaecb[_0x2529('0x2d')],qs[_0x2529('0x42')](_0x8ced2e[_0x2529('0x2f')][_0x2529('0x42')]));_0x3f76e8[_0x2529('0x34')]=_0x3f76e8['attributes'][_0x2529('0x33')]?_0x3f76e8['attributes']:_0x2aaecb[_0x2529('0x2d')];if(_0x8ced2e['query'][_0x2529('0x3d')]){_0x3f76e8['include']=[{'all':!![]}];}_0x3f76e8=_[_0x2529('0x3b')]({},_0x3f76e8,_0x8ced2e[_0x2529('0x43')]);return db['Cdr'][_0x2529('0x44')](_0x3f76e8)['then'](handleEntityNotFound(_0x33a13e,null))[_0x2529('0x21')](respondWithResult(_0x33a13e,null))[_0x2529('0x40')](handleError(_0x33a13e,null));};exports[_0x2529('0x45')]=function(_0x3c6d79,_0xdc4bef){return db[_0x2529('0x28')][_0x2529('0x45')](_0x3c6d79[_0x2529('0x46')],{})[_0x2529('0x21')](respondWithResult(_0xdc4bef,0xc9))['catch'](handleError(_0xdc4bef,null));};exports['update']=function(_0x5e72d1,_0x37a23a){if(_0x5e72d1[_0x2529('0x46')]['id']){delete _0x5e72d1[_0x2529('0x46')]['id'];}return db['Cdr']['find']({'where':{'id':_0x5e72d1[_0x2529('0x41')]['id']}})['then'](handleEntityNotFound(_0x37a23a,null))[_0x2529('0x21')](saveUpdates(_0x5e72d1[_0x2529('0x46')],null))[_0x2529('0x21')](respondWithResult(_0x37a23a,null))[_0x2529('0x40')](handleError(_0x37a23a,null));};exports[_0x2529('0x22')]=function(_0x196ee8,_0x4583ba){return db[_0x2529('0x28')]['find']({'where':{'id':_0x196ee8['params']['id']}})[_0x2529('0x21')](handleEntityNotFound(_0x4583ba,null))[_0x2529('0x21')](removeEntity(_0x4583ba,null))[_0x2529('0x40')](handleError(_0x4583ba,null));};exports[_0x2529('0x47')]=function(_0x1f76d3,_0x3ac799){return db[_0x2529('0x28')][_0x2529('0x47')]()[_0x2529('0x21')](respondWithResult(_0x3ac799,null))[_0x2529('0x40')](handleError(_0x3ac799,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index a45d0e5..988c4d7 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x1220c0,_0x5c06f9){var _0x1cc1b7=function(_0x2ab880){while(--_0x2ab880){_0x1220c0['push'](_0x1220c0['shift']());}};_0x1cc1b7(++_0x5c06f9);}(_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':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x178961,_0x55fce6){var _0x18a2c8=function(_0x3412d4){while(--_0x3412d4){_0x178961['push'](_0x178961['shift']());}};_0x18a2c8(++_0x55fce6);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index ded0adb..f7c008d 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 _0xb5f9=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','randomstring'];(function(_0x4dc3a4,_0x886144){var _0x45b80c=function(_0x40f6f8){while(--_0x40f6f8){_0x4dc3a4['push'](_0x4dc3a4['shift']());}};_0x45b80c(++_0x886144);}(_0xb5f9,0x13d));var _0x9b5f=function(_0x137092,_0x446f4f){_0x137092=_0x137092-0x0;var _0x4c0917=_0xb5f9[_0x137092];return _0x4c0917;};'use strict';var _=require('lodash');var util=require(_0x9b5f('0x0'));var moment=require(_0x9b5f('0x1'));var BPromise=require('bluebird');var rs=require(_0x9b5f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9b5f('0x3'));var logger=require(_0x9b5f('0x4'))(_0x9b5f('0x5'));var config=require(_0x9b5f('0x6'));var jayson=require(_0x9b5f('0x7'));var client=jayson[_0x9b5f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cdbdf,_0x255352,_0xacf955){return new BPromise(function(_0x5ada19,_0x272249){return client[_0x9b5f('0x9')](_0x4cdbdf,_0xacf955)['then'](function(_0x17d892){logger[_0x9b5f('0xa')](_0x9b5f('0xb'),_0x255352,_0x9b5f('0xc'));logger[_0x9b5f('0xd')]('Cdr,\x20%s,\x20%s,\x20%s',_0x255352,'request\x20sent',JSON[_0x9b5f('0xe')](_0x17d892));if(_0x17d892[_0x9b5f('0xf')]){if(_0x17d892[_0x9b5f('0xf')][_0x9b5f('0x10')]===0x1f4){logger[_0x9b5f('0xf')](_0x9b5f('0xb'),_0x255352,_0x17d892[_0x9b5f('0xf')][_0x9b5f('0x11')]);return _0x272249(_0x17d892[_0x9b5f('0xf')][_0x9b5f('0x11')]);}logger['error'](_0x9b5f('0xb'),_0x255352,_0x17d892[_0x9b5f('0xf')]['message']);return _0x5ada19(_0x17d892[_0x9b5f('0xf')][_0x9b5f('0x11')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x255352,'request\x20sent');_0x5ada19(_0x17d892[_0x9b5f('0x12')][_0x9b5f('0x11')]);}})[_0x9b5f('0x13')](function(_0x1b3f4a){logger[_0x9b5f('0xf')](_0x9b5f('0xb'),_0x255352,_0x1b3f4a);_0x272249(_0x1b3f4a);});});}
\ No newline at end of file
+var _0x642e=['error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','then','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x113e32,_0x5339f0){var _0x4ff939=function(_0x2be9ca){while(--_0x2be9ca){_0x113e32['push'](_0x113e32['shift']());}};_0x4ff939(++_0x5339f0);}(_0x642e,0x1be));var _0xe642=function(_0x41376e,_0x1eb56f){_0x41376e=_0x41376e-0x0;var _0x38a918=_0x642e[_0x41376e];return _0x38a918;};'use strict';var _=require(_0xe642('0x0'));var util=require(_0xe642('0x1'));var moment=require(_0xe642('0x2'));var BPromise=require(_0xe642('0x3'));var rs=require(_0xe642('0x4'));var fs=require('fs');var Redis=require(_0xe642('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe642('0x6'))(_0xe642('0x7'));var config=require(_0xe642('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe642('0x9')][_0xe642('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cab94,_0x56c389,_0x1191c3){return new BPromise(function(_0x3a4297,_0x8e3c35){return client['request'](_0x1cab94,_0x1191c3)[_0xe642('0xb')](function(_0x26c22f){logger['info']('Cdr,\x20%s,\x20%s',_0x56c389,'request\x20sent');logger[_0xe642('0xc')](_0xe642('0xd'),_0x56c389,_0xe642('0xe'),JSON[_0xe642('0xf')](_0x26c22f));if(_0x26c22f['error']){if(_0x26c22f[_0xe642('0x10')][_0xe642('0x11')]===0x1f4){logger[_0xe642('0x10')](_0xe642('0x12'),_0x56c389,_0x26c22f[_0xe642('0x10')][_0xe642('0x13')]);return _0x8e3c35(_0x26c22f[_0xe642('0x10')][_0xe642('0x13')]);}logger[_0xe642('0x10')](_0xe642('0x12'),_0x56c389,_0x26c22f[_0xe642('0x10')]['message']);return _0x3a4297(_0x26c22f['error'][_0xe642('0x13')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x56c389,_0xe642('0xe'));_0x3a4297(_0x26c22f[_0xe642('0x14')]['message']);}})[_0xe642('0x15')](function(_0x5edf4a){logger[_0xe642('0x10')]('Cdr,\x20%s,\x20%s',_0x56c389,_0x5edf4a);_0x8e3c35(_0x5edf4a);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 40bf504..4749265 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(_0x608e20,_0x2c546d){var _0x5f498a=function(_0x7ee427){while(--_0x7ee427){_0x608e20['push'](_0x608e20['shift']());}};_0x5f498a(++_0x2c546d);}(_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(_0x10548e,_0x80eaff){var _0x540aa4=function(_0x277e0e){while(--_0x277e0e){_0x10548e['push'](_0x10548e['shift']());}};_0x540aa4(++_0x80eaff);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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 2205af9..ac42c10 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 _0xfc22=['*,*,*,*','exports','INTEGER','STRING'];(function(_0x9adf1b,_0x3ac695){var _0x960269=function(_0x368ca6){while(--_0x368ca6){_0x9adf1b['push'](_0x9adf1b['shift']());}};_0x960269(++_0x3ac695);}(_0xfc22,0x79));var _0x2fc2=function(_0x40a614,_0x2ac5ee){_0x40a614=_0x40a614-0x0;var _0x40eeac=_0xfc22[_0x40a614];return _0x40eeac;};'use strict';var Sequelize=require('sequelize');module[_0x2fc2('0x0')]={'priority':{'type':Sequelize[_0x2fc2('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x2fc2('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2fc2('0x2')],'defaultValue':_0x2fc2('0x3')}};
\ No newline at end of file
+var _0x9e1b=['*,*,*,*','exports','INTEGER','STRING','TEXT'];(function(_0x46d772,_0x485fbc){var _0x1fd083=function(_0x4ff622){while(--_0x4ff622){_0x46d772['push'](_0x46d772['shift']());}};_0x1fd083(++_0x485fbc);}(_0x9e1b,0x196));var _0xb9e1=function(_0x23e567,_0x21e539){_0x23e567=_0x23e567-0x0;var _0x5db05c=_0x9e1b[_0x23e567];return _0x5db05c;};'use strict';var Sequelize=require('sequelize');module[_0xb9e1('0x0')]={'priority':{'type':Sequelize[_0xb9e1('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb9e1('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb9e1('0x3')]()},'description':{'type':Sequelize[_0xb9e1('0x2')]},'interval':{'type':Sequelize[_0xb9e1('0x2')],'defaultValue':_0xb9e1('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index a3e95ff..ef53151 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 _0x3e5c=['Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','params','rawAttributes','query','keys','filters','intersection','attributes','model','fields','length','include','merge','options','ChatApplication','body','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x40b54c,_0x19014b){_0x40b54c=_0x40b54c-0x0;var _0x272365=_0x3e5c[_0x40b54c];return _0x272365;};'use strict';var emlformat=require(_0xc3e5('0x0'));var rimraf=require(_0xc3e5('0x1'));var zipdir=require(_0xc3e5('0x2'));var jsonpatch=require(_0xc3e5('0x3'));var rp=require('request-promise');var moment=require(_0xc3e5('0x4'));var BPromise=require(_0xc3e5('0x5'));var Mustache=require(_0xc3e5('0x6'));var util=require(_0xc3e5('0x7'));var path=require(_0xc3e5('0x8'));var sox=require(_0xc3e5('0x9'));var csv=require('to-csv');var ejs=require(_0xc3e5('0xa'));var fs=require('fs');var fs_extra=require(_0xc3e5('0xb'));var _=require(_0xc3e5('0xc'));var squel=require(_0xc3e5('0xd'));var crypto=require(_0xc3e5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc3e5('0xf'));var toCsv=require(_0xc3e5('0x10'));var querystring=require(_0xc3e5('0x11'));var Papa=require(_0xc3e5('0x12'));var Redis=require(_0xc3e5('0x13'));var authService=require(_0xc3e5('0x14'));var qs=require(_0xc3e5('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3e5('0x16'));var logger=require(_0xc3e5('0x17'))(_0xc3e5('0x18'));var utils=require(_0xc3e5('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc3e5('0x1a'));var db=require(_0xc3e5('0x1b'))['db'];function respondWithStatusCode(_0x36193e,_0x3f0395){_0x3f0395=_0x3f0395||0xcc;return function(_0x3b7441){if(_0x3b7441){return _0x36193e[_0xc3e5('0x1c')](_0x3f0395);}return _0x36193e['status'](_0x3f0395)['end']();};}function respondWithResult(_0x52cca7,_0x27c226){_0x27c226=_0x27c226||0xc8;return function(_0x5a52f1){if(_0x5a52f1){return _0x52cca7[_0xc3e5('0x1d')](_0x27c226)[_0xc3e5('0x1e')](_0x5a52f1);}};}function respondWithFilteredResult(_0x4d1ad9,_0x353dc0){return function(_0x3e3eaa){if(_0x3e3eaa){var _0x2cc476=typeof _0x353dc0[_0xc3e5('0x1f')]===_0xc3e5('0x20')&&typeof _0x353dc0['limit']===_0xc3e5('0x20');var _0x277063=_0x3e3eaa[_0xc3e5('0x21')];var _0xa33d84=_0x2cc476?0x0:_0x353dc0[_0xc3e5('0x1f')];var _0x1e1eea=_0x2cc476?_0x3e3eaa['count']:_0x353dc0[_0xc3e5('0x1f')]+_0x353dc0[_0xc3e5('0x22')];var _0x4a1d86;if(_0x1e1eea>=_0x277063){_0x1e1eea=_0x277063;_0x4a1d86=0xc8;}else{_0x4a1d86=0xce;}_0x4d1ad9[_0xc3e5('0x1d')](_0x4a1d86);return _0x4d1ad9['set'](_0xc3e5('0x23'),_0xa33d84+'-'+_0x1e1eea+'/'+_0x277063)[_0xc3e5('0x1e')](_0x3e3eaa);}return null;};}function patchUpdates(_0x2d551b){return function(_0xebf6dc){try{jsonpatch[_0xc3e5('0x24')](_0xebf6dc,_0x2d551b,!![]);}catch(_0x4a7806){return BPromise[_0xc3e5('0x25')](_0x4a7806);}return _0xebf6dc[_0xc3e5('0x26')]();};}function saveUpdates(_0x2d8c6f,_0x3eb513){return function(_0x414ba9){if(_0x414ba9){return _0x414ba9[_0xc3e5('0x27')](_0x2d8c6f)[_0xc3e5('0x28')](function(_0x47f344){return _0x47f344;});}return null;};}function removeEntity(_0x3a2800,_0x430cb4){return function(_0x43d01e){if(_0x43d01e){return _0x43d01e[_0xc3e5('0x29')]()[_0xc3e5('0x28')](function(){_0x3a2800[_0xc3e5('0x1d')](0xcc)[_0xc3e5('0x2a')]();});}};}function handleEntityNotFound(_0x45556e,_0x564748){return function(_0x25d3a3){if(!_0x25d3a3){_0x45556e['sendStatus'](0x194);}return _0x25d3a3;};}function handleError(_0x4c0cf4,_0x8815af){_0x8815af=_0x8815af||0x1f4;return function(_0x12ad6e){logger[_0xc3e5('0x2b')](_0x12ad6e['stack']);if(_0x12ad6e[_0xc3e5('0x2c')]){delete _0x12ad6e[_0xc3e5('0x2c')];}_0x4c0cf4[_0xc3e5('0x1d')](_0x8815af)[_0xc3e5('0x2d')](_0x12ad6e);};}exports['show']=function(_0xa6766d,_0x497ecf){var _0x45ca6d={'raw':!![],'where':{'id':_0xa6766d[_0xc3e5('0x2e')]['id']}},_0xc0e6e7={};_0xc0e6e7['model']=_['keys'](db['ChatApplication'][_0xc3e5('0x2f')]);_0xc0e6e7[_0xc3e5('0x30')]=_[_0xc3e5('0x31')](_0xa6766d[_0xc3e5('0x30')]);_0xc0e6e7[_0xc3e5('0x32')]=_[_0xc3e5('0x33')](_0xc0e6e7['model'],_0xc0e6e7[_0xc3e5('0x30')]);_0x45ca6d[_0xc3e5('0x34')]=_[_0xc3e5('0x33')](_0xc0e6e7[_0xc3e5('0x35')],qs[_0xc3e5('0x36')](_0xa6766d[_0xc3e5('0x30')][_0xc3e5('0x36')]));_0x45ca6d[_0xc3e5('0x34')]=_0x45ca6d[_0xc3e5('0x34')][_0xc3e5('0x37')]?_0x45ca6d[_0xc3e5('0x34')]:_0xc0e6e7['model'];if(_0xa6766d[_0xc3e5('0x30')]['includeAll']){_0x45ca6d[_0xc3e5('0x38')]=[{'all':!![]}];}_0x45ca6d=_[_0xc3e5('0x39')]({},_0x45ca6d,_0xa6766d[_0xc3e5('0x3a')]);return db[_0xc3e5('0x3b')]['find'](_0x45ca6d)[_0xc3e5('0x28')](handleEntityNotFound(_0x497ecf,null))['then'](respondWithResult(_0x497ecf,null))['catch'](handleError(_0x497ecf,null));};exports[_0xc3e5('0x27')]=function(_0x4f6fe1,_0x3c407f){if(_0x4f6fe1[_0xc3e5('0x3c')]['id']){delete _0x4f6fe1[_0xc3e5('0x3c')]['id'];}return db[_0xc3e5('0x3b')][_0xc3e5('0x3d')]({'where':{'id':_0x4f6fe1['params']['id']}})[_0xc3e5('0x28')](handleEntityNotFound(_0x3c407f,null))[_0xc3e5('0x28')](saveUpdates(_0x4f6fe1[_0xc3e5('0x3c')],null))[_0xc3e5('0x28')](respondWithResult(_0x3c407f,null))[_0xc3e5('0x3e')](handleError(_0x3c407f,null));};exports['destroy']=function(_0x3ab3be,_0x484e21){return db[_0xc3e5('0x3b')][_0xc3e5('0x3d')]({'where':{'id':_0x3ab3be['params']['id']}})[_0xc3e5('0x28')](handleEntityNotFound(_0x484e21,null))['then'](removeEntity(_0x484e21,null))[_0xc3e5('0x3e')](handleError(_0x484e21,null));};
\ No newline at end of file
+var _0x2083=['destroy','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','attributes','fields','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','update','then'];(function(_0x322590,_0x324ba9){var _0x3b12b3=function(_0x588c92){while(--_0x588c92){_0x322590['push'](_0x322590['shift']());}};_0x3b12b3(++_0x324ba9);}(_0x2083,0x137));var _0x3208=function(_0x5d2a59,_0x1d517b){_0x5d2a59=_0x5d2a59-0x0;var _0x361157=_0x2083[_0x5d2a59];return _0x361157;};'use strict';var emlformat=require(_0x3208('0x0'));var rimraf=require(_0x3208('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3208('0x2'));var rp=require(_0x3208('0x3'));var moment=require(_0x3208('0x4'));var BPromise=require(_0x3208('0x5'));var Mustache=require(_0x3208('0x6'));var util=require(_0x3208('0x7'));var path=require(_0x3208('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3208('0x9'));var _=require(_0x3208('0xa'));var squel=require(_0x3208('0xb'));var crypto=require(_0x3208('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3208('0xd'));var toCsv=require(_0x3208('0xe'));var querystring=require(_0x3208('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3208('0x10'));var qs=require(_0x3208('0x11'));var as=require(_0x3208('0x12'));var hardwareService=require(_0x3208('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3208('0x14'));var config=require(_0x3208('0x15'));var licenseUtil=require(_0x3208('0x16'));var db=require(_0x3208('0x17'))['db'];function respondWithStatusCode(_0x174620,_0x394883){_0x394883=_0x394883||0xcc;return function(_0xf232e5){if(_0xf232e5){return _0x174620[_0x3208('0x18')](_0x394883);}return _0x174620[_0x3208('0x19')](_0x394883)[_0x3208('0x1a')]();};}function respondWithResult(_0x3deca8,_0x14c24f){_0x14c24f=_0x14c24f||0xc8;return function(_0xa5067){if(_0xa5067){return _0x3deca8[_0x3208('0x19')](_0x14c24f)['json'](_0xa5067);}};}function respondWithFilteredResult(_0x2f1eaf,_0x153cf8){return function(_0x41cdcf){if(_0x41cdcf){var _0x1ef359=typeof _0x153cf8[_0x3208('0x1b')]==='undefined'&&typeof _0x153cf8[_0x3208('0x1c')]===_0x3208('0x1d');var _0x4c1e4d=_0x41cdcf[_0x3208('0x1e')];var _0x3590c5=_0x1ef359?0x0:_0x153cf8[_0x3208('0x1b')];var _0x28e291=_0x1ef359?_0x41cdcf[_0x3208('0x1e')]:_0x153cf8[_0x3208('0x1b')]+_0x153cf8['limit'];var _0x3d44bd;if(_0x28e291>=_0x4c1e4d){_0x28e291=_0x4c1e4d;_0x3d44bd=0xc8;}else{_0x3d44bd=0xce;}_0x2f1eaf[_0x3208('0x19')](_0x3d44bd);return _0x2f1eaf[_0x3208('0x1f')](_0x3208('0x20'),_0x3590c5+'-'+_0x28e291+'/'+_0x4c1e4d)[_0x3208('0x21')](_0x41cdcf);}return null;};}function patchUpdates(_0x46b227){return function(_0x468cca){try{jsonpatch['apply'](_0x468cca,_0x46b227,!![]);}catch(_0x42d97a){return BPromise[_0x3208('0x22')](_0x42d97a);}return _0x468cca['save']();};}function saveUpdates(_0x28d665,_0x361d1c){return function(_0x3c6e34){if(_0x3c6e34){return _0x3c6e34[_0x3208('0x23')](_0x28d665)[_0x3208('0x24')](function(_0x2ce30e){return _0x2ce30e;});}return null;};}function removeEntity(_0x4673c2,_0x523d75){return function(_0x54aa98){if(_0x54aa98){return _0x54aa98[_0x3208('0x25')]()[_0x3208('0x24')](function(){_0x4673c2[_0x3208('0x19')](0xcc)[_0x3208('0x1a')]();});}};}function handleEntityNotFound(_0x14e491,_0x21dc00){return function(_0x47a021){if(!_0x47a021){_0x14e491[_0x3208('0x18')](0x194);}return _0x47a021;};}function handleError(_0x125ae3,_0x270c69){_0x270c69=_0x270c69||0x1f4;return function(_0x10e471){logger['error'](_0x10e471[_0x3208('0x26')]);if(_0x10e471[_0x3208('0x27')]){delete _0x10e471[_0x3208('0x27')];}_0x125ae3['status'](_0x270c69)[_0x3208('0x28')](_0x10e471);};}exports[_0x3208('0x29')]=function(_0xf9e10c,_0x22b561){var _0x283193={'raw':!![],'where':{'id':_0xf9e10c[_0x3208('0x2a')]['id']}},_0x2b153f={};_0x2b153f[_0x3208('0x2b')]=_[_0x3208('0x2c')](db[_0x3208('0x2d')][_0x3208('0x2e')]);_0x2b153f[_0x3208('0x2f')]=_[_0x3208('0x2c')](_0xf9e10c[_0x3208('0x2f')]);_0x2b153f['filters']=_['intersection'](_0x2b153f[_0x3208('0x2b')],_0x2b153f[_0x3208('0x2f')]);_0x283193[_0x3208('0x30')]=_['intersection'](_0x2b153f[_0x3208('0x2b')],qs[_0x3208('0x31')](_0xf9e10c['query'][_0x3208('0x31')]));_0x283193[_0x3208('0x30')]=_0x283193[_0x3208('0x30')][_0x3208('0x32')]?_0x283193[_0x3208('0x30')]:_0x2b153f[_0x3208('0x2b')];if(_0xf9e10c[_0x3208('0x2f')][_0x3208('0x33')]){_0x283193[_0x3208('0x34')]=[{'all':!![]}];}_0x283193=_[_0x3208('0x35')]({},_0x283193,_0xf9e10c[_0x3208('0x36')]);return db[_0x3208('0x2d')][_0x3208('0x37')](_0x283193)['then'](handleEntityNotFound(_0x22b561,null))[_0x3208('0x24')](respondWithResult(_0x22b561,null))[_0x3208('0x38')](handleError(_0x22b561,null));};exports['update']=function(_0x93b8cd,_0x17f0f6){if(_0x93b8cd[_0x3208('0x39')]['id']){delete _0x93b8cd[_0x3208('0x39')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x93b8cd[_0x3208('0x2a')]['id']}})['then'](handleEntityNotFound(_0x17f0f6,null))[_0x3208('0x24')](saveUpdates(_0x93b8cd[_0x3208('0x39')],null))[_0x3208('0x24')](respondWithResult(_0x17f0f6,null))[_0x3208('0x38')](handleError(_0x17f0f6,null));};exports[_0x3208('0x25')]=function(_0x1588f4,_0x7544fc){return db[_0x3208('0x2d')][_0x3208('0x37')]({'where':{'id':_0x1588f4['params']['id']}})[_0x3208('0x24')](handleEntityNotFound(_0x7544fc,null))['then'](removeEntity(_0x7544fc,null))[_0x3208('0x38')](handleError(_0x7544fc,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 9f30292..4e370c2 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 _0x12d7=['request-promise','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x28394f,_0x5ebdd2){var _0x2618d2=function(_0x2ffed6){while(--_0x2ffed6){_0x28394f['push'](_0x28394f['shift']());}};_0x2618d2(++_0x5ebdd2);}(_0x12d7,0x181));var _0x712d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12d7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x712d('0x0'));var util=require('util');var logger=require(_0x712d('0x1'))(_0x712d('0x2'));var moment=require(_0x712d('0x3'));var BPromise=require(_0x712d('0x4'));var rp=require(_0x712d('0x5'));var fs=require('fs');var path=require(_0x712d('0x6'));var rimraf=require('rimraf');var config=require(_0x712d('0x7'));var attributes=require(_0x712d('0x8'));module[_0x712d('0x9')]=function(_0x2cf71a,_0x498a92){return _0x2cf71a[_0x712d('0xa')](_0x712d('0xb'),attributes,{'tableName':_0x712d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x712d('0xd'),'collate':_0x712d('0xe')});};
\ No newline at end of file
+var _0xa678=['exports','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5c9162,_0x3a87bc){var _0x4d427d=function(_0x4c616a){while(--_0x4c616a){_0x5c9162['push'](_0x5c9162['shift']());}};_0x4d427d(++_0x3a87bc);}(_0xa678,0xe1));var _0x8a67=function(_0x41035d,_0x468124){_0x41035d=_0x41035d-0x0;var _0x53d186=_0xa678[_0x41035d];return _0x53d186;};'use strict';var _=require(_0x8a67('0x0'));var util=require(_0x8a67('0x1'));var logger=require(_0x8a67('0x2'))(_0x8a67('0x3'));var moment=require(_0x8a67('0x4'));var BPromise=require(_0x8a67('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a67('0x6'));var rimraf=require(_0x8a67('0x7'));var config=require(_0x8a67('0x8'));var attributes=require('./chatApplication.attributes');module[_0x8a67('0x9')]=function(_0x5ba4dd,_0x16c745){return _0x5ba4dd['define']('ChatApplication',attributes,{'tableName':_0x8a67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8a67('0xb'),'collate':_0x8a67('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 57e561e..0e03ef6 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 _0x3a4a=['error','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x27eda0,_0x42a3cf){var _0x2b63a5=function(_0x431084){while(--_0x431084){_0x27eda0['push'](_0x27eda0['shift']());}};_0x2b63a5(++_0x42a3cf);}(_0x3a4a,0x15e));var _0xa3a4=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0x3a4a[_0x1a7550];return _0x426e22;};'use strict';var _=require(_0xa3a4('0x0'));var util=require(_0xa3a4('0x1'));var moment=require(_0xa3a4('0x2'));var BPromise=require(_0xa3a4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3a4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3a4('0x5'));var logger=require(_0xa3a4('0x6'))(_0xa3a4('0x7'));var config=require(_0xa3a4('0x8'));var jayson=require(_0xa3a4('0x9'));var client=jayson[_0xa3a4('0xa')][_0xa3a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d4546,_0x1b145d,_0x6c0f54){return new BPromise(function(_0x22cc83,_0x5d79dc){return client[_0xa3a4('0xc')](_0x3d4546,_0x6c0f54)[_0xa3a4('0xd')](function(_0x1e57dd){logger[_0xa3a4('0xe')]('ChatApplication,\x20%s,\x20%s',_0x1b145d,_0xa3a4('0xf'));logger[_0xa3a4('0x10')](_0xa3a4('0x11'),_0x1b145d,_0xa3a4('0xf'),JSON['stringify'](_0x1e57dd));if(_0x1e57dd[_0xa3a4('0x12')]){if(_0x1e57dd[_0xa3a4('0x12')]['code']===0x1f4){logger[_0xa3a4('0x12')](_0xa3a4('0x13'),_0x1b145d,_0x1e57dd['error']['message']);return _0x5d79dc(_0x1e57dd[_0xa3a4('0x12')][_0xa3a4('0x14')]);}logger[_0xa3a4('0x12')](_0xa3a4('0x13'),_0x1b145d,_0x1e57dd[_0xa3a4('0x12')]['message']);return _0x22cc83(_0x1e57dd['error'][_0xa3a4('0x14')]);}else{logger[_0xa3a4('0xe')]('ChatApplication,\x20%s,\x20%s',_0x1b145d,_0xa3a4('0xf'));_0x22cc83(_0x1e57dd[_0xa3a4('0x15')][_0xa3a4('0x14')]);}})[_0xa3a4('0x16')](function(_0x49be11){logger[_0xa3a4('0x12')](_0xa3a4('0x13'),_0x1b145d,_0x49be11);_0x5d79dc(_0x49be11);});});}
\ No newline at end of file
+var _0x82b9=['info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0xd05d0e,_0x222ec6){var _0xa812c=function(_0x207028){while(--_0x207028){_0xd05d0e['push'](_0xd05d0e['shift']());}};_0xa812c(++_0x222ec6);}(_0x82b9,0x149));var _0x982b=function(_0x21745c,_0x186f06){_0x21745c=_0x21745c-0x0;var _0x12e0b8=_0x82b9[_0x21745c];return _0x12e0b8;};'use strict';var _=require(_0x982b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x982b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x982b('0x2'));var db=require(_0x982b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x982b('0x4'))(_0x982b('0x5'));var config=require('../../config/environment');var jayson=require(_0x982b('0x6'));var client=jayson[_0x982b('0x7')][_0x982b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x529a26,_0x4006c4,_0x1479d8){return new BPromise(function(_0x3cdf7b,_0x2df147){return client[_0x982b('0x9')](_0x529a26,_0x1479d8)[_0x982b('0xa')](function(_0x5aa8ec){logger[_0x982b('0xb')](_0x982b('0xc'),_0x4006c4,_0x982b('0xd'));logger[_0x982b('0xe')](_0x982b('0xf'),_0x4006c4,_0x982b('0xd'),JSON[_0x982b('0x10')](_0x5aa8ec));if(_0x5aa8ec[_0x982b('0x11')]){if(_0x5aa8ec[_0x982b('0x11')]['code']===0x1f4){logger[_0x982b('0x11')](_0x982b('0xc'),_0x4006c4,_0x5aa8ec['error'][_0x982b('0x12')]);return _0x2df147(_0x5aa8ec[_0x982b('0x11')][_0x982b('0x12')]);}logger[_0x982b('0x11')](_0x982b('0xc'),_0x4006c4,_0x5aa8ec[_0x982b('0x11')][_0x982b('0x12')]);return _0x3cdf7b(_0x5aa8ec[_0x982b('0x11')][_0x982b('0x12')]);}else{logger[_0x982b('0xb')](_0x982b('0xc'),_0x4006c4,'request\x20sent');_0x3cdf7b(_0x5aa8ec['result']['message']);}})[_0x982b('0x13')](function(_0x38b70a){logger[_0x982b('0x11')](_0x982b('0xc'),_0x4006c4,_0x38b70a);_0x2df147(_0x38b70a);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 7266147..9ff5bd7 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 _0xdfc2=['connect-timeout','express','fs-extra','../../components/auth/service','./chatApplication.controller','get','/:id','show','update','isAuthenticated','destroy','exports','multer','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdfc2,0xfc));var _0x2dfc=function(_0x321d0b,_0x41fbca){_0x321d0b=_0x321d0b-0x0;var _0x24b79a=_0xdfc2[_0x321d0b];return _0x24b79a;};'use strict';var multer=require(_0x2dfc('0x0'));var util=require(_0x2dfc('0x1'));var path=require(_0x2dfc('0x2'));var timeout=require(_0x2dfc('0x3'));var express=require(_0x2dfc('0x4'));var router=express['Router']();var fs_extra=require(_0x2dfc('0x5'));var auth=require(_0x2dfc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2dfc('0x7'));router[_0x2dfc('0x8')](_0x2dfc('0x9'),auth['isAuthenticated'](),controller[_0x2dfc('0xa')]);router['put'](_0x2dfc('0x9'),auth['isAuthenticated'](),controller[_0x2dfc('0xb')]);router['delete'](_0x2dfc('0x9'),auth[_0x2dfc('0xc')](),controller[_0x2dfc('0xd')]);module[_0x2dfc('0xe')]=router;
\ No newline at end of file
+var _0xa051=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','destroy','exports','path','connect-timeout','express'];(function(_0xeb6583,_0x7360e0){var _0x326af8=function(_0x3113fd){while(--_0x3113fd){_0xeb6583['push'](_0xeb6583['shift']());}};_0x326af8(++_0x7360e0);}(_0xa051,0xfd));var _0x1a05=function(_0x6c7a8e,_0x1a3ed6){_0x6c7a8e=_0x6c7a8e-0x0;var _0xafab52=_0xa051[_0x6c7a8e];return _0xafab52;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1a05('0x0'));var timeout=require(_0x1a05('0x1'));var express=require(_0x1a05('0x2'));var router=express[_0x1a05('0x3')]();var fs_extra=require(_0x1a05('0x4'));var auth=require(_0x1a05('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1a05('0x6'));var controller=require(_0x1a05('0x7'));router[_0x1a05('0x8')]('/:id',auth[_0x1a05('0x9')](),controller[_0x1a05('0xa')]);router[_0x1a05('0xb')](_0x1a05('0xc'),auth['isAuthenticated'](),controller[_0x1a05('0xd')]);router['delete'](_0x1a05('0xc'),auth['isAuthenticated'](),controller[_0x1a05('0xe')]);module[_0x1a05('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 08ac495..9191503 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 _0x8786=['sequelize','STRING'];(function(_0x4f4c85,_0x1fba10){var _0x1a189a=function(_0x4c88a1){while(--_0x4c88a1){_0x4f4c85['push'](_0x4f4c85['shift']());}};_0x1a189a(++_0x1fba10);}(_0x8786,0x138));var _0x6878=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8786[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x6878('0x0'));module['exports']={'name':{'type':Sequelize[_0x6878('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6878('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2087=['sequelize','exports','STRING'];(function(_0x491e30,_0x1579c2){var _0x53f649=function(_0x42cfbc){while(--_0x42cfbc){_0x491e30['push'](_0x491e30['shift']());}};_0x53f649(++_0x1579c2);}(_0x2087,0xf3));var _0x7208=function(_0x2f70d2,_0x49da1c){_0x2f70d2=_0x2f70d2-0x0;var _0x3581d0=_0x2087[_0x2f70d2];return _0x3581d0;};'use strict';var Sequelize=require(_0x7208('0x0'));module[_0x7208('0x1')]={'name':{'type':Sequelize[_0x7208('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7208('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index b4d2891..54f4a1c 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 _0xc277=['send','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','rows','show','params','includeAll','find','catch','create','body','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','User','pick','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error'];(function(_0x253c18,_0x405d0a){var _0xe2752b=function(_0xc0c166){while(--_0xc0c166){_0x253c18['push'](_0x253c18['shift']());}};_0xe2752b(++_0x405d0a);}(_0xc277,0x1b9));var _0x7c27=function(_0x4c1f7b,_0x312d83){_0x4c1f7b=_0x4c1f7b-0x0;var _0x1a0ead=_0xc277[_0x4c1f7b];return _0x1a0ead;};'use strict';var emlformat=require(_0x7c27('0x0'));var rimraf=require(_0x7c27('0x1'));var zipdir=require(_0x7c27('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c27('0x3'));var moment=require('moment');var BPromise=require(_0x7c27('0x4'));var Mustache=require(_0x7c27('0x5'));var util=require(_0x7c27('0x6'));var path=require(_0x7c27('0x7'));var sox=require('sox');var csv=require(_0x7c27('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7c27('0x9'));var _=require(_0x7c27('0xa'));var squel=require('squel');var crypto=require(_0x7c27('0xb'));var jsforce=require(_0x7c27('0xc'));var deskjs=require(_0x7c27('0xd'));var toCsv=require(_0x7c27('0x8'));var querystring=require('querystring');var Papa=require(_0x7c27('0xe'));var Redis=require('ioredis');var authService=require(_0x7c27('0xf'));var qs=require(_0x7c27('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c27('0x11'));var logger=require(_0x7c27('0x12'))(_0x7c27('0x13'));var utils=require(_0x7c27('0x14'));var config=require(_0x7c27('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x7c27('0x16')]=_['defaults'](config[_0x7c27('0x16')],{'host':_0x7c27('0x17'),'port':0x18eb});var socket=require(_0x7c27('0x18'))(new Redis(config[_0x7c27('0x16')]));require(_0x7c27('0x19'))[_0x7c27('0x1a')](socket);function respondWithStatusCode(_0x559e8d,_0x1fcc4c){_0x1fcc4c=_0x1fcc4c||0xcc;return function(_0x53cf31){if(_0x53cf31){return _0x559e8d['sendStatus'](_0x1fcc4c);}return _0x559e8d[_0x7c27('0x1b')](_0x1fcc4c)[_0x7c27('0x1c')]();};}function respondWithResult(_0x4f7e9c,_0x276363){_0x276363=_0x276363||0xc8;return function(_0x492888){if(_0x492888){return _0x4f7e9c[_0x7c27('0x1b')](_0x276363)[_0x7c27('0x1d')](_0x492888);}};}function respondWithFilteredResult(_0x2dd073,_0x5d41c3){return function(_0x5f7eda){if(_0x5f7eda){var _0x454ea9=typeof _0x5d41c3[_0x7c27('0x1e')]==='undefined'&&typeof _0x5d41c3[_0x7c27('0x1f')]===_0x7c27('0x20');var _0xd9a4e9=_0x5f7eda['count'];var _0x29e33c=_0x454ea9?0x0:_0x5d41c3['offset'];var _0x2f9943=_0x454ea9?_0x5f7eda[_0x7c27('0x21')]:_0x5d41c3[_0x7c27('0x1e')]+_0x5d41c3[_0x7c27('0x1f')];var _0x3dcd37;if(_0x2f9943>=_0xd9a4e9){_0x2f9943=_0xd9a4e9;_0x3dcd37=0xc8;}else{_0x3dcd37=0xce;}_0x2dd073[_0x7c27('0x1b')](_0x3dcd37);return _0x2dd073[_0x7c27('0x22')](_0x7c27('0x23'),_0x29e33c+'-'+_0x2f9943+'/'+_0xd9a4e9)['json'](_0x5f7eda);}return null;};}function patchUpdates(_0x1feef8){return function(_0x41f9cc){try{jsonpatch[_0x7c27('0x24')](_0x41f9cc,_0x1feef8,!![]);}catch(_0x5c5bc9){return BPromise[_0x7c27('0x25')](_0x5c5bc9);}return _0x41f9cc[_0x7c27('0x26')]();};}function saveUpdates(_0x3bf5c5,_0x56955a){return function(_0x5651ea){if(_0x5651ea){return _0x5651ea[_0x7c27('0x27')](_0x3bf5c5)[_0x7c27('0x28')](function(_0x1ede25){return _0x1ede25;});}return null;};}function removeEntity(_0x1d8b03,_0x37d215){return function(_0x5bbde0){if(_0x5bbde0){return _0x5bbde0[_0x7c27('0x29')]()['then'](function(){_0x1d8b03[_0x7c27('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x298d7a,_0x219935){return function(_0x19c452){if(!_0x19c452){_0x298d7a[_0x7c27('0x2a')](0x194);}return _0x19c452;};}function handleError(_0x509825,_0x5eb260){_0x5eb260=_0x5eb260||0x1f4;return function(_0x24d0d9){logger[_0x7c27('0x2b')](_0x24d0d9['stack']);if(_0x24d0d9['name']){delete _0x24d0d9['name'];}_0x509825[_0x7c27('0x1b')](_0x5eb260)[_0x7c27('0x2c')](_0x24d0d9);};}exports[_0x7c27('0x2d')]=function(_0x5f1d02,_0x9b7e3f){var _0x5941a0={},_0x126143={},_0x25ca1e={'count':0x0,'rows':[]};var _0x37dc5f=_['map'](db[_0x7c27('0x2e')][_0x7c27('0x2f')],function(_0x2a88ca){return{'name':_0x2a88ca[_0x7c27('0x30')],'type':_0x2a88ca[_0x7c27('0x31')][_0x7c27('0x32')]};});_0x126143[_0x7c27('0x33')]=_[_0x7c27('0x34')](_0x37dc5f,_0x7c27('0x35'));_0x126143[_0x7c27('0x36')]=_[_0x7c27('0x37')](_0x5f1d02[_0x7c27('0x36')]);_0x126143[_0x7c27('0x38')]=_[_0x7c27('0x39')](_0x126143[_0x7c27('0x33')],_0x126143[_0x7c27('0x36')]);_0x5941a0['attributes']=_[_0x7c27('0x39')](_0x126143['model'],qs[_0x7c27('0x3a')](_0x5f1d02[_0x7c27('0x36')][_0x7c27('0x3a')]));_0x5941a0[_0x7c27('0x3b')]=_0x5941a0[_0x7c27('0x3b')][_0x7c27('0x3c')]?_0x5941a0[_0x7c27('0x3b')]:_0x126143[_0x7c27('0x33')];if(!_0x5f1d02['query']['hasOwnProperty'](_0x7c27('0x3d'))){_0x5941a0[_0x7c27('0x1f')]=qs[_0x7c27('0x1f')](_0x5f1d02['query'][_0x7c27('0x1f')]);_0x5941a0[_0x7c27('0x1e')]=qs['offset'](_0x5f1d02[_0x7c27('0x36')]['offset']);}_0x5941a0[_0x7c27('0x3e')]=qs[_0x7c27('0x3f')](_0x5f1d02[_0x7c27('0x36')][_0x7c27('0x3f')]);_0x5941a0[_0x7c27('0x40')]=qs[_0x7c27('0x38')](_['pick'](_0x5f1d02[_0x7c27('0x36')],_0x126143[_0x7c27('0x38')]),_0x37dc5f);if(_0x5f1d02[_0x7c27('0x36')][_0x7c27('0x41')]){_0x5941a0['where']=_[_0x7c27('0x42')](_0x5941a0[_0x7c27('0x40')],{'$or':_[_0x7c27('0x34')](_0x37dc5f,function(_0x143e74){if(_0x143e74[_0x7c27('0x31')]!==_0x7c27('0x43')){var _0x4982fe={};_0x4982fe[_0x143e74[_0x7c27('0x35')]]={'$like':'%'+_0x5f1d02['query'][_0x7c27('0x41')]+'%'};return _0x4982fe;}})});}_0x5941a0=_[_0x7c27('0x42')]({},_0x5941a0,_0x5f1d02[_0x7c27('0x44')]);var _0x217e05={'where':_0x5941a0[_0x7c27('0x40')]};return db[_0x7c27('0x2e')][_0x7c27('0x21')](_0x217e05)[_0x7c27('0x28')](function(_0x37ac66){_0x25ca1e[_0x7c27('0x21')]=_0x37ac66;if(_0x5f1d02[_0x7c27('0x36')]['includeAll']){_0x5941a0['include']=[{'all':!![]}];}return db[_0x7c27('0x2e')]['findAll'](_0x5941a0);})['then'](function(_0x3885bc){_0x25ca1e[_0x7c27('0x45')]=_0x3885bc;return _0x25ca1e;})[_0x7c27('0x28')](respondWithFilteredResult(_0x9b7e3f,_0x5941a0))['catch'](handleError(_0x9b7e3f,null));};exports[_0x7c27('0x46')]=function(_0x1a1a79,_0x589fd4){var _0x41cac6={'raw':!![],'where':{'id':_0x1a1a79[_0x7c27('0x47')]['id']}},_0x3528fe={};_0x3528fe[_0x7c27('0x33')]=_[_0x7c27('0x37')](db['ChatGroup'][_0x7c27('0x2f')]);_0x3528fe['query']=_['keys'](_0x1a1a79[_0x7c27('0x36')]);_0x3528fe['filters']=_[_0x7c27('0x39')](_0x3528fe[_0x7c27('0x33')],_0x3528fe[_0x7c27('0x36')]);_0x41cac6[_0x7c27('0x3b')]=_['intersection'](_0x3528fe[_0x7c27('0x33')],qs['fields'](_0x1a1a79[_0x7c27('0x36')][_0x7c27('0x3a')]));_0x41cac6['attributes']=_0x41cac6['attributes'][_0x7c27('0x3c')]?_0x41cac6[_0x7c27('0x3b')]:_0x3528fe['model'];if(_0x1a1a79[_0x7c27('0x36')][_0x7c27('0x48')]){_0x41cac6['include']=[{'all':!![]}];}_0x41cac6=_[_0x7c27('0x42')]({},_0x41cac6,_0x1a1a79[_0x7c27('0x44')]);return db[_0x7c27('0x2e')][_0x7c27('0x49')](_0x41cac6)[_0x7c27('0x28')](handleEntityNotFound(_0x589fd4,null))[_0x7c27('0x28')](respondWithResult(_0x589fd4,null))[_0x7c27('0x4a')](handleError(_0x589fd4,null));};exports['create']=function(_0x111117,_0x4cbe47){return db['ChatGroup'][_0x7c27('0x4b')](_0x111117[_0x7c27('0x4c')],{})[_0x7c27('0x28')](respondWithResult(_0x4cbe47,0xc9))['catch'](handleError(_0x4cbe47,null));};exports[_0x7c27('0x27')]=function(_0x462c48,_0x16e150){if(_0x462c48[_0x7c27('0x4c')]['id']){delete _0x462c48[_0x7c27('0x4c')]['id'];}return db[_0x7c27('0x2e')][_0x7c27('0x49')]({'where':{'id':_0x462c48[_0x7c27('0x47')]['id']}})[_0x7c27('0x28')](handleEntityNotFound(_0x16e150,null))[_0x7c27('0x28')](saveUpdates(_0x462c48[_0x7c27('0x4c')],null))[_0x7c27('0x28')](respondWithResult(_0x16e150,null))['catch'](handleError(_0x16e150,null));};exports['destroy']=function(_0x2a3299,_0xa5ebfd){return db['ChatGroup'][_0x7c27('0x49')]({'where':{'id':_0x2a3299['params']['id']}})[_0x7c27('0x28')](handleEntityNotFound(_0xa5ebfd,null))['then'](removeEntity(_0xa5ebfd,null))[_0x7c27('0x4a')](handleError(_0xa5ebfd,null));};exports['describe']=function(_0x1ab399,_0x4105b1){return db[_0x7c27('0x2e')]['describe']()[_0x7c27('0x28')](respondWithResult(_0x4105b1,null))[_0x7c27('0x4a')](handleError(_0x4105b1,null));};exports[_0x7c27('0x4d')]=function(_0x48b66d,_0x4a9424,_0x43651d){return db[_0x7c27('0x4e')][_0x7c27('0x21')]({'where':{'ChatGroupId':_0x48b66d[_0x7c27('0x47')]['id'],'ToId':_0x48b66d[_0x7c27('0x4f')]['id'],'read':![]}})['then'](function(_0x4ec4c3){return{'id':_[_0x7c27('0x50')](_0x48b66d[_0x7c27('0x47')]['id']),'count':_0x4ec4c3};})[_0x7c27('0x28')](respondWithResult(_0x4a9424,null))[_0x7c27('0x4a')](handleError(_0x4a9424,null));};exports[_0x7c27('0x51')]=function(_0xbeecac,_0x18dd50,_0x165910){return db[_0x7c27('0x2e')][_0x7c27('0x49')]({'where':{'id':_0xbeecac[_0x7c27('0x47')]['id']}})[_0x7c27('0x28')](handleEntityNotFound(_0x18dd50,null))[_0x7c27('0x28')](function(_0x55e65a){if(_0x55e65a){return _0x55e65a[_0x7c27('0x51')](_0xbeecac[_0x7c27('0x4c')]['ids'],_[_0x7c27('0x52')](_0xbeecac[_0x7c27('0x4c')],[_0x7c27('0x53'),'id'])||{});}})[_0x7c27('0x28')](respondWithResult(_0x18dd50,null))[_0x7c27('0x4a')](handleError(_0x18dd50,null));};exports[_0x7c27('0x54')]=function(_0xcebf5b,_0x552a2d,_0x37c8c6){var _0x1ef71b={};var _0x5c2624={};var _0x40f43e;var _0x269541;return db[_0x7c27('0x2e')]['findOne']({'where':{'id':_0xcebf5b['params']['id']}})[_0x7c27('0x28')](handleEntityNotFound(_0x552a2d,null))[_0x7c27('0x28')](function(_0x26201c){if(_0x26201c){_0x40f43e=_0x26201c;_0x5c2624['model']=_[_0x7c27('0x37')](db[_0x7c27('0x55')][_0x7c27('0x2f')]);_0x5c2624[_0x7c27('0x36')]=_[_0x7c27('0x37')](_0xcebf5b[_0x7c27('0x36')]);_0x5c2624['filters']=_['intersection'](_0x5c2624[_0x7c27('0x33')],_0x5c2624['query']);_0x1ef71b[_0x7c27('0x3b')]=_[_0x7c27('0x39')](_0x5c2624[_0x7c27('0x33')],qs['fields'](_0xcebf5b[_0x7c27('0x36')][_0x7c27('0x3a')]));_0x1ef71b['attributes']=_0x1ef71b[_0x7c27('0x3b')][_0x7c27('0x3c')]?_0x1ef71b[_0x7c27('0x3b')]:_0x5c2624[_0x7c27('0x33')];_0x1ef71b['order']=qs['sort'](_0xcebf5b['query'][_0x7c27('0x3f')]);_0x1ef71b['where']=qs['filters'](_[_0x7c27('0x56')](_0xcebf5b['query'],_0x5c2624[_0x7c27('0x38')]));if(_0xcebf5b['query'][_0x7c27('0x41')]){_0x1ef71b[_0x7c27('0x40')]=_[_0x7c27('0x42')](_0x1ef71b[_0x7c27('0x40')],{'$or':_[_0x7c27('0x34')](_0x1ef71b[_0x7c27('0x3b')],function(_0x108f98){var _0x203df2={};_0x203df2[_0x108f98]={'$like':'%'+_0xcebf5b[_0x7c27('0x36')][_0x7c27('0x41')]+'%'};return _0x203df2;})});}_0x1ef71b=_['merge']({},_0x1ef71b,_0xcebf5b['options']);return _0x40f43e[_0x7c27('0x54')](_0x1ef71b);}})[_0x7c27('0x28')](function(_0x47c4b0){if(_0x47c4b0){_0x269541=_0x47c4b0[_0x7c27('0x3c')];if(!_0xcebf5b[_0x7c27('0x36')][_0x7c27('0x57')](_0x7c27('0x3d'))){_0x1ef71b[_0x7c27('0x1f')]=qs[_0x7c27('0x1f')](_0xcebf5b[_0x7c27('0x36')][_0x7c27('0x1f')]);_0x1ef71b[_0x7c27('0x1e')]=qs['offset'](_0xcebf5b['query'][_0x7c27('0x1e')]);}return _0x40f43e[_0x7c27('0x54')](_0x1ef71b);}})[_0x7c27('0x28')](function(_0x22d718){if(_0x22d718){return _0x22d718?{'count':_0x269541,'rows':_0x22d718}:null;}})[_0x7c27('0x28')](respondWithResult(_0x552a2d,null))['catch'](handleError(_0x552a2d,null));};exports[_0x7c27('0x58')]=function(_0x17a50f,_0x1c9f62,_0x423134){return db[_0x7c27('0x2e')][_0x7c27('0x49')]({'where':{'id':_0x17a50f[_0x7c27('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c9f62,null))[_0x7c27('0x28')](function(_0x11b120){if(_0x11b120){return _0x11b120[_0x7c27('0x58')](_0x17a50f[_0x7c27('0x36')][_0x7c27('0x53')]);}})['then'](respondWithStatusCode(_0x1c9f62,null))[_0x7c27('0x4a')](handleError(_0x1c9f62,null));};exports[_0x7c27('0x59')]=function(_0x3fe3ea,_0x10e081,_0x3921b3){if(_0x3fe3ea[_0x7c27('0x4c')]['id']){delete _0x3fe3ea[_0x7c27('0x4c')]['id'];}return db[_0x7c27('0x2e')]['find']({'where':{'id':_0x3fe3ea[_0x7c27('0x47')]['id']}})[_0x7c27('0x28')](handleEntityNotFound(_0x10e081,null))[_0x7c27('0x28')](function(_0x2c6c60){if(_0x2c6c60){_0x3fe3ea[_0x7c27('0x4c')][_0x7c27('0x5a')]=_0x2c6c60['id'];return db[_0x7c27('0x4e')][_0x7c27('0x4b')](_0x3fe3ea[_0x7c27('0x4c')]);}})[_0x7c27('0x28')](respondWithResult(_0x10e081,null))[_0x7c27('0x4a')](handleError(_0x10e081,null));};exports[_0x7c27('0x5b')]=function(_0x16c65c,_0x15d3dd,_0x50b147){var _0x56aa6c={};var _0xfcc6fa={};var _0x38c786;var _0x2e5827;return db['ChatGroup'][_0x7c27('0x5c')]({'where':{'id':_0x16c65c[_0x7c27('0x47')]['id']}})[_0x7c27('0x28')](handleEntityNotFound(_0x15d3dd,null))[_0x7c27('0x28')](function(_0x4ab432){if(_0x4ab432){_0x38c786=_0x4ab432;_0xfcc6fa[_0x7c27('0x33')]=_[_0x7c27('0x37')](db['ChatInternalMessage'][_0x7c27('0x2f')]);_0xfcc6fa['query']=_[_0x7c27('0x37')](_0x16c65c[_0x7c27('0x36')]);_0xfcc6fa[_0x7c27('0x38')]=_[_0x7c27('0x39')](_0xfcc6fa[_0x7c27('0x33')],_0xfcc6fa['query']);_0x56aa6c[_0x7c27('0x3b')]=_[_0x7c27('0x39')](_0xfcc6fa[_0x7c27('0x33')],qs[_0x7c27('0x3a')](_0x16c65c[_0x7c27('0x36')][_0x7c27('0x3a')]));_0x56aa6c[_0x7c27('0x3b')]=_0x56aa6c[_0x7c27('0x3b')][_0x7c27('0x3c')]?_0x56aa6c['attributes']:_0xfcc6fa['model'];_0x56aa6c['order']=qs['sort'](_0x16c65c['query'][_0x7c27('0x3f')]);_0x56aa6c[_0x7c27('0x40')]=qs[_0x7c27('0x38')](_['pick'](_0x16c65c['query'],_0xfcc6fa['filters']));if(_0x16c65c['query']['filter']){_0x56aa6c['where']=_[_0x7c27('0x42')](_0x56aa6c['where'],{'$or':_[_0x7c27('0x34')](_0x56aa6c['attributes'],function(_0x263e36){var _0x437f27={};_0x437f27[_0x263e36]={'$like':'%'+_0x16c65c[_0x7c27('0x36')][_0x7c27('0x41')]+'%'};return _0x437f27;})});}if(_0x16c65c[_0x7c27('0x36')][_0x7c27('0x5d')]){var _0x6ed7f5=_0x16c65c[_0x7c27('0x36')][_0x7c27('0x5d')][_0x7c27('0x5e')](',');var _0x3bc2bd={};_0x3bc2bd[_0x6ed7f5[0x0]]={'$gte':moment(_0x6ed7f5[0x1])[_0x7c27('0x5f')](_0x7c27('0x60'))};_0x56aa6c[_0x7c27('0x40')]=_[_0x7c27('0x42')](_0x56aa6c[_0x7c27('0x40')],_0x3bc2bd);}_0x56aa6c=_[_0x7c27('0x42')]({},_0x56aa6c,_0x16c65c[_0x7c27('0x44')]);return _0x38c786['getMessages'](_0x56aa6c);}})[_0x7c27('0x28')](function(_0x43eeec){if(_0x43eeec){_0x2e5827=_0x43eeec[_0x7c27('0x3c')];if(!_0x16c65c[_0x7c27('0x36')]['hasOwnProperty']('nolimit')){_0x56aa6c[_0x7c27('0x1f')]=qs[_0x7c27('0x1f')](_0x16c65c[_0x7c27('0x36')][_0x7c27('0x1f')]);_0x56aa6c[_0x7c27('0x1e')]=qs[_0x7c27('0x1e')](_0x16c65c[_0x7c27('0x36')][_0x7c27('0x1e')]);}return _0x38c786[_0x7c27('0x5b')](_0x56aa6c);}})[_0x7c27('0x28')](function(_0x9a6299){if(_0x9a6299){return _0x9a6299?{'count':_0x2e5827,'rows':_0x9a6299}:null;}})[_0x7c27('0x28')](respondWithResult(_0x15d3dd,null))[_0x7c27('0x4a')](handleError(_0x15d3dd,null));};
\ No newline at end of file
+var _0xa7ee=['mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','ChatGroup','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','params','filters','find','create','body','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','rawAttributes','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','hasOwnProperty','eml-format','zip-dir','request-promise','moment','bluebird'];(function(_0x3fbe46,_0x12a0d1){var _0x27c406=function(_0x4a1020){while(--_0x4a1020){_0x3fbe46['push'](_0x3fbe46['shift']());}};_0x27c406(++_0x12a0d1);}(_0xa7ee,0xb7));var _0xea7e=function(_0x1546c2,_0x22e822){_0x1546c2=_0x1546c2-0x0;var _0x24583c=_0xa7ee[_0x1546c2];return _0x24583c;};'use strict';var emlformat=require(_0xea7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea7e('0x2'));var moment=require(_0xea7e('0x3'));var BPromise=require(_0xea7e('0x4'));var Mustache=require(_0xea7e('0x5'));var util=require('util');var path=require(_0xea7e('0x6'));var sox=require('sox');var csv=require(_0xea7e('0x7'));var ejs=require(_0xea7e('0x8'));var fs=require('fs');var fs_extra=require(_0xea7e('0x9'));var _=require(_0xea7e('0xa'));var squel=require(_0xea7e('0xb'));var crypto=require(_0xea7e('0xc'));var jsforce=require(_0xea7e('0xd'));var deskjs=require(_0xea7e('0xe'));var toCsv=require(_0xea7e('0x7'));var querystring=require('querystring');var Papa=require(_0xea7e('0xf'));var Redis=require(_0xea7e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xea7e('0x11'));var as=require(_0xea7e('0x12'));var hardwareService=require(_0xea7e('0x13'));var logger=require('../../config/logger')(_0xea7e('0x14'));var utils=require(_0xea7e('0x15'));var config=require(_0xea7e('0x16'));var licenseUtil=require(_0xea7e('0x17'));var db=require('../../mysqldb')['db'];config[_0xea7e('0x18')]=_[_0xea7e('0x19')](config[_0xea7e('0x18')],{'host':_0xea7e('0x1a'),'port':0x18eb});var socket=require(_0xea7e('0x1b'))(new Redis(config[_0xea7e('0x18')]));require(_0xea7e('0x1c'))['register'](socket);function respondWithStatusCode(_0x269418,_0xbfebb0){_0xbfebb0=_0xbfebb0||0xcc;return function(_0x4881e0){if(_0x4881e0){return _0x269418['sendStatus'](_0xbfebb0);}return _0x269418[_0xea7e('0x1d')](_0xbfebb0)[_0xea7e('0x1e')]();};}function respondWithResult(_0x14fea9,_0x5b2661){_0x5b2661=_0x5b2661||0xc8;return function(_0x27fc7a){if(_0x27fc7a){return _0x14fea9[_0xea7e('0x1d')](_0x5b2661)['json'](_0x27fc7a);}};}function respondWithFilteredResult(_0xe9e38b,_0xb2da33){return function(_0x4ea52b){if(_0x4ea52b){var _0x2f3207=typeof _0xb2da33[_0xea7e('0x1f')]===_0xea7e('0x20')&&typeof _0xb2da33['limit']==='undefined';var _0x257c35=_0x4ea52b[_0xea7e('0x21')];var _0x21334d=_0x2f3207?0x0:_0xb2da33[_0xea7e('0x1f')];var _0xa0e5b0=_0x2f3207?_0x4ea52b[_0xea7e('0x21')]:_0xb2da33[_0xea7e('0x1f')]+_0xb2da33[_0xea7e('0x22')];var _0x5ddf7e;if(_0xa0e5b0>=_0x257c35){_0xa0e5b0=_0x257c35;_0x5ddf7e=0xc8;}else{_0x5ddf7e=0xce;}_0xe9e38b[_0xea7e('0x1d')](_0x5ddf7e);return _0xe9e38b[_0xea7e('0x23')](_0xea7e('0x24'),_0x21334d+'-'+_0xa0e5b0+'/'+_0x257c35)[_0xea7e('0x25')](_0x4ea52b);}return null;};}function patchUpdates(_0x44bf8b){return function(_0x105edb){try{jsonpatch[_0xea7e('0x26')](_0x105edb,_0x44bf8b,!![]);}catch(_0x43b2b9){return BPromise[_0xea7e('0x27')](_0x43b2b9);}return _0x105edb[_0xea7e('0x28')]();};}function saveUpdates(_0x330754,_0x39bba8){return function(_0x2e4ac9){if(_0x2e4ac9){return _0x2e4ac9[_0xea7e('0x29')](_0x330754)[_0xea7e('0x2a')](function(_0x284d6b){return _0x284d6b;});}return null;};}function removeEntity(_0x371a68,_0x409c34){return function(_0x2ec42f){if(_0x2ec42f){return _0x2ec42f[_0xea7e('0x2b')]()[_0xea7e('0x2a')](function(){_0x371a68[_0xea7e('0x1d')](0xcc)[_0xea7e('0x1e')]();});}};}function handleEntityNotFound(_0x8bf0d6,_0x5104d1){return function(_0x3405a7){if(!_0x3405a7){_0x8bf0d6[_0xea7e('0x2c')](0x194);}return _0x3405a7;};}function handleError(_0xf5d8,_0x420b7e){_0x420b7e=_0x420b7e||0x1f4;return function(_0x17c212){logger[_0xea7e('0x2d')](_0x17c212[_0xea7e('0x2e')]);if(_0x17c212[_0xea7e('0x2f')]){delete _0x17c212[_0xea7e('0x2f')];}_0xf5d8[_0xea7e('0x1d')](_0x420b7e)[_0xea7e('0x30')](_0x17c212);};}exports['index']=function(_0x25974b,_0x2ad0b3){var _0x12f4e0={},_0x3214ec={},_0x123e23={'count':0x0,'rows':[]};var _0x1a54ac=_[_0xea7e('0x31')](db[_0xea7e('0x32')]['rawAttributes'],function(_0x30ec98){return{'name':_0x30ec98[_0xea7e('0x33')],'type':_0x30ec98[_0xea7e('0x34')][_0xea7e('0x35')]};});_0x3214ec[_0xea7e('0x36')]=_['map'](_0x1a54ac,_0xea7e('0x2f'));_0x3214ec['query']=_[_0xea7e('0x37')](_0x25974b['query']);_0x3214ec['filters']=_[_0xea7e('0x38')](_0x3214ec[_0xea7e('0x36')],_0x3214ec[_0xea7e('0x39')]);_0x12f4e0[_0xea7e('0x3a')]=_['intersection'](_0x3214ec[_0xea7e('0x36')],qs[_0xea7e('0x3b')](_0x25974b[_0xea7e('0x39')][_0xea7e('0x3b')]));_0x12f4e0[_0xea7e('0x3a')]=_0x12f4e0['attributes'][_0xea7e('0x3c')]?_0x12f4e0[_0xea7e('0x3a')]:_0x3214ec[_0xea7e('0x36')];if(!_0x25974b['query']['hasOwnProperty'](_0xea7e('0x3d'))){_0x12f4e0[_0xea7e('0x22')]=qs[_0xea7e('0x22')](_0x25974b['query'][_0xea7e('0x22')]);_0x12f4e0['offset']=qs[_0xea7e('0x1f')](_0x25974b['query'][_0xea7e('0x1f')]);}_0x12f4e0[_0xea7e('0x3e')]=qs[_0xea7e('0x3f')](_0x25974b['query'][_0xea7e('0x3f')]);_0x12f4e0[_0xea7e('0x40')]=qs['filters'](_[_0xea7e('0x41')](_0x25974b[_0xea7e('0x39')],_0x3214ec['filters']),_0x1a54ac);if(_0x25974b['query']['filter']){_0x12f4e0[_0xea7e('0x40')]=_[_0xea7e('0x42')](_0x12f4e0[_0xea7e('0x40')],{'$or':_[_0xea7e('0x31')](_0x1a54ac,function(_0x432fe2){if(_0x432fe2['type']!=='VIRTUAL'){var _0x52ffff={};_0x52ffff[_0x432fe2['name']]={'$like':'%'+_0x25974b[_0xea7e('0x39')][_0xea7e('0x43')]+'%'};return _0x52ffff;}})});}_0x12f4e0=_['merge']({},_0x12f4e0,_0x25974b[_0xea7e('0x44')]);var _0x31ca22={'where':_0x12f4e0[_0xea7e('0x40')]};return db[_0xea7e('0x32')][_0xea7e('0x21')](_0x31ca22)[_0xea7e('0x2a')](function(_0x306803){_0x123e23[_0xea7e('0x21')]=_0x306803;if(_0x25974b[_0xea7e('0x39')][_0xea7e('0x45')]){_0x12f4e0[_0xea7e('0x46')]=[{'all':!![]}];}return db[_0xea7e('0x32')]['findAll'](_0x12f4e0);})[_0xea7e('0x2a')](function(_0x203b13){_0x123e23[_0xea7e('0x47')]=_0x203b13;return _0x123e23;})['then'](respondWithFilteredResult(_0x2ad0b3,_0x12f4e0))[_0xea7e('0x48')](handleError(_0x2ad0b3,null));};exports[_0xea7e('0x49')]=function(_0x5120d3,_0x3e10d9){var _0x193e9a={'raw':!![],'where':{'id':_0x5120d3[_0xea7e('0x4a')]['id']}},_0x4990dc={};_0x4990dc[_0xea7e('0x36')]=_[_0xea7e('0x37')](db[_0xea7e('0x32')]['rawAttributes']);_0x4990dc[_0xea7e('0x39')]=_['keys'](_0x5120d3[_0xea7e('0x39')]);_0x4990dc[_0xea7e('0x4b')]=_[_0xea7e('0x38')](_0x4990dc[_0xea7e('0x36')],_0x4990dc[_0xea7e('0x39')]);_0x193e9a[_0xea7e('0x3a')]=_[_0xea7e('0x38')](_0x4990dc['model'],qs[_0xea7e('0x3b')](_0x5120d3[_0xea7e('0x39')]['fields']));_0x193e9a[_0xea7e('0x3a')]=_0x193e9a[_0xea7e('0x3a')][_0xea7e('0x3c')]?_0x193e9a[_0xea7e('0x3a')]:_0x4990dc['model'];if(_0x5120d3[_0xea7e('0x39')][_0xea7e('0x45')]){_0x193e9a[_0xea7e('0x46')]=[{'all':!![]}];}_0x193e9a=_['merge']({},_0x193e9a,_0x5120d3[_0xea7e('0x44')]);return db[_0xea7e('0x32')][_0xea7e('0x4c')](_0x193e9a)[_0xea7e('0x2a')](handleEntityNotFound(_0x3e10d9,null))['then'](respondWithResult(_0x3e10d9,null))[_0xea7e('0x48')](handleError(_0x3e10d9,null));};exports['create']=function(_0x74ff2d,_0x4cdbb8){return db[_0xea7e('0x32')][_0xea7e('0x4d')](_0x74ff2d[_0xea7e('0x4e')],{})[_0xea7e('0x2a')](respondWithResult(_0x4cdbb8,0xc9))[_0xea7e('0x48')](handleError(_0x4cdbb8,null));};exports[_0xea7e('0x29')]=function(_0x1c786c,_0x4f1693){if(_0x1c786c[_0xea7e('0x4e')]['id']){delete _0x1c786c[_0xea7e('0x4e')]['id'];}return db[_0xea7e('0x32')][_0xea7e('0x4c')]({'where':{'id':_0x1c786c[_0xea7e('0x4a')]['id']}})[_0xea7e('0x2a')](handleEntityNotFound(_0x4f1693,null))[_0xea7e('0x2a')](saveUpdates(_0x1c786c[_0xea7e('0x4e')],null))[_0xea7e('0x2a')](respondWithResult(_0x4f1693,null))[_0xea7e('0x48')](handleError(_0x4f1693,null));};exports[_0xea7e('0x2b')]=function(_0x9465bf,_0x1f6fe1){return db['ChatGroup'][_0xea7e('0x4c')]({'where':{'id':_0x9465bf[_0xea7e('0x4a')]['id']}})[_0xea7e('0x2a')](handleEntityNotFound(_0x1f6fe1,null))[_0xea7e('0x2a')](removeEntity(_0x1f6fe1,null))[_0xea7e('0x48')](handleError(_0x1f6fe1,null));};exports['describe']=function(_0x266f4e,_0x551976){return db[_0xea7e('0x32')]['describe']()[_0xea7e('0x2a')](respondWithResult(_0x551976,null))[_0xea7e('0x48')](handleError(_0x551976,null));};exports['getUnread']=function(_0x3ed578,_0x5a0f35,_0x161b55){return db[_0xea7e('0x4f')][_0xea7e('0x21')]({'where':{'ChatGroupId':_0x3ed578[_0xea7e('0x4a')]['id'],'ToId':_0x3ed578['user']['id'],'read':![]}})[_0xea7e('0x2a')](function(_0x44c68b){return{'id':_[_0xea7e('0x50')](_0x3ed578['params']['id']),'count':_0x44c68b};})[_0xea7e('0x2a')](respondWithResult(_0x5a0f35,null))[_0xea7e('0x48')](handleError(_0x5a0f35,null));};exports['addMembers']=function(_0x4e1ebd,_0x15eca1,_0x12e767){return db[_0xea7e('0x32')][_0xea7e('0x4c')]({'where':{'id':_0x4e1ebd[_0xea7e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x15eca1,null))['then'](function(_0x1ded86){if(_0x1ded86){return _0x1ded86[_0xea7e('0x51')](_0x4e1ebd[_0xea7e('0x4e')]['ids'],_['omit'](_0x4e1ebd[_0xea7e('0x4e')],[_0xea7e('0x52'),'id'])||{});}})['then'](respondWithResult(_0x15eca1,null))['catch'](handleError(_0x15eca1,null));};exports[_0xea7e('0x53')]=function(_0x58303e,_0x3614bb,_0x104fb6){var _0x3cd0a9={};var _0x1a228a={};var _0x5ed490;var _0x4863b3;return db[_0xea7e('0x32')][_0xea7e('0x54')]({'where':{'id':_0x58303e['params']['id']}})[_0xea7e('0x2a')](handleEntityNotFound(_0x3614bb,null))['then'](function(_0x136313){if(_0x136313){_0x5ed490=_0x136313;_0x1a228a[_0xea7e('0x36')]=_['keys'](db['User'][_0xea7e('0x55')]);_0x1a228a['query']=_[_0xea7e('0x37')](_0x58303e['query']);_0x1a228a[_0xea7e('0x4b')]=_['intersection'](_0x1a228a['model'],_0x1a228a[_0xea7e('0x39')]);_0x3cd0a9[_0xea7e('0x3a')]=_['intersection'](_0x1a228a[_0xea7e('0x36')],qs[_0xea7e('0x3b')](_0x58303e[_0xea7e('0x39')]['fields']));_0x3cd0a9[_0xea7e('0x3a')]=_0x3cd0a9[_0xea7e('0x3a')]['length']?_0x3cd0a9['attributes']:_0x1a228a['model'];_0x3cd0a9[_0xea7e('0x3e')]=qs[_0xea7e('0x3f')](_0x58303e[_0xea7e('0x39')][_0xea7e('0x3f')]);_0x3cd0a9[_0xea7e('0x40')]=qs[_0xea7e('0x4b')](_['pick'](_0x58303e[_0xea7e('0x39')],_0x1a228a[_0xea7e('0x4b')]));if(_0x58303e['query'][_0xea7e('0x43')]){_0x3cd0a9['where']=_[_0xea7e('0x42')](_0x3cd0a9[_0xea7e('0x40')],{'$or':_[_0xea7e('0x31')](_0x3cd0a9[_0xea7e('0x3a')],function(_0x584e9f){var _0x155024={};_0x155024[_0x584e9f]={'$like':'%'+_0x58303e[_0xea7e('0x39')]['filter']+'%'};return _0x155024;})});}_0x3cd0a9=_['merge']({},_0x3cd0a9,_0x58303e['options']);return _0x5ed490[_0xea7e('0x53')](_0x3cd0a9);}})[_0xea7e('0x2a')](function(_0x35d29b){if(_0x35d29b){_0x4863b3=_0x35d29b[_0xea7e('0x3c')];if(!_0x58303e[_0xea7e('0x39')]['hasOwnProperty'](_0xea7e('0x3d'))){_0x3cd0a9['limit']=qs[_0xea7e('0x22')](_0x58303e[_0xea7e('0x39')][_0xea7e('0x22')]);_0x3cd0a9[_0xea7e('0x1f')]=qs[_0xea7e('0x1f')](_0x58303e[_0xea7e('0x39')][_0xea7e('0x1f')]);}return _0x5ed490[_0xea7e('0x53')](_0x3cd0a9);}})[_0xea7e('0x2a')](function(_0x590eaa){if(_0x590eaa){return _0x590eaa?{'count':_0x4863b3,'rows':_0x590eaa}:null;}})[_0xea7e('0x2a')](respondWithResult(_0x3614bb,null))[_0xea7e('0x48')](handleError(_0x3614bb,null));};exports[_0xea7e('0x56')]=function(_0xa825de,_0x4136d4,_0x29d878){return db[_0xea7e('0x32')][_0xea7e('0x4c')]({'where':{'id':_0xa825de[_0xea7e('0x4a')]['id']}})[_0xea7e('0x2a')](handleEntityNotFound(_0x4136d4,null))[_0xea7e('0x2a')](function(_0x2f9d8d){if(_0x2f9d8d){return _0x2f9d8d[_0xea7e('0x56')](_0xa825de[_0xea7e('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x4136d4,null))[_0xea7e('0x48')](handleError(_0x4136d4,null));};exports[_0xea7e('0x57')]=function(_0x120700,_0x547c0f,_0x219fb9){if(_0x120700[_0xea7e('0x4e')]['id']){delete _0x120700['body']['id'];}return db['ChatGroup'][_0xea7e('0x4c')]({'where':{'id':_0x120700['params']['id']}})[_0xea7e('0x2a')](handleEntityNotFound(_0x547c0f,null))[_0xea7e('0x2a')](function(_0x52f355){if(_0x52f355){_0x120700[_0xea7e('0x4e')][_0xea7e('0x58')]=_0x52f355['id'];return db[_0xea7e('0x4f')][_0xea7e('0x4d')](_0x120700[_0xea7e('0x4e')]);}})[_0xea7e('0x2a')](respondWithResult(_0x547c0f,null))[_0xea7e('0x48')](handleError(_0x547c0f,null));};exports[_0xea7e('0x59')]=function(_0x2025ae,_0x305a23,_0x566a2f){var _0x1ae8f2={};var _0x631eff={};var _0x1632f1;var _0x15ea33;return db['ChatGroup'][_0xea7e('0x54')]({'where':{'id':_0x2025ae[_0xea7e('0x4a')]['id']}})[_0xea7e('0x2a')](handleEntityNotFound(_0x305a23,null))[_0xea7e('0x2a')](function(_0x47c84d){if(_0x47c84d){_0x1632f1=_0x47c84d;_0x631eff[_0xea7e('0x36')]=_[_0xea7e('0x37')](db['ChatInternalMessage'][_0xea7e('0x55')]);_0x631eff[_0xea7e('0x39')]=_[_0xea7e('0x37')](_0x2025ae[_0xea7e('0x39')]);_0x631eff[_0xea7e('0x4b')]=_[_0xea7e('0x38')](_0x631eff[_0xea7e('0x36')],_0x631eff['query']);_0x1ae8f2['attributes']=_[_0xea7e('0x38')](_0x631eff[_0xea7e('0x36')],qs[_0xea7e('0x3b')](_0x2025ae[_0xea7e('0x39')][_0xea7e('0x3b')]));_0x1ae8f2[_0xea7e('0x3a')]=_0x1ae8f2[_0xea7e('0x3a')][_0xea7e('0x3c')]?_0x1ae8f2[_0xea7e('0x3a')]:_0x631eff['model'];_0x1ae8f2[_0xea7e('0x3e')]=qs[_0xea7e('0x3f')](_0x2025ae[_0xea7e('0x39')]['sort']);_0x1ae8f2[_0xea7e('0x40')]=qs[_0xea7e('0x4b')](_[_0xea7e('0x41')](_0x2025ae['query'],_0x631eff[_0xea7e('0x4b')]));if(_0x2025ae['query'][_0xea7e('0x43')]){_0x1ae8f2[_0xea7e('0x40')]=_['merge'](_0x1ae8f2[_0xea7e('0x40')],{'$or':_['map'](_0x1ae8f2[_0xea7e('0x3a')],function(_0x480b27){var _0x20ea44={};_0x20ea44[_0x480b27]={'$like':'%'+_0x2025ae[_0xea7e('0x39')]['filter']+'%'};return _0x20ea44;})});}if(_0x2025ae['query'][_0xea7e('0x5a')]){var _0x41295b=_0x2025ae[_0xea7e('0x39')][_0xea7e('0x5a')][_0xea7e('0x5b')](',');var _0x2ddb34={};_0x2ddb34[_0x41295b[0x0]]={'$gte':moment(_0x41295b[0x1])[_0xea7e('0x5c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1ae8f2[_0xea7e('0x40')]=_[_0xea7e('0x42')](_0x1ae8f2['where'],_0x2ddb34);}_0x1ae8f2=_[_0xea7e('0x42')]({},_0x1ae8f2,_0x2025ae['options']);return _0x1632f1['getMessages'](_0x1ae8f2);}})['then'](function(_0x31c80f){if(_0x31c80f){_0x15ea33=_0x31c80f['length'];if(!_0x2025ae[_0xea7e('0x39')][_0xea7e('0x5d')]('nolimit')){_0x1ae8f2['limit']=qs['limit'](_0x2025ae['query'][_0xea7e('0x22')]);_0x1ae8f2['offset']=qs[_0xea7e('0x1f')](_0x2025ae['query'][_0xea7e('0x1f')]);}return _0x1632f1[_0xea7e('0x59')](_0x1ae8f2);}})[_0xea7e('0x2a')](function(_0x3cbd41){if(_0x3cbd41){return _0x3cbd41?{'count':_0x15ea33,'rows':_0x3cbd41}:null;}})[_0xea7e('0x2a')](respondWithResult(_0x305a23,null))[_0xea7e('0x48')](handleError(_0x305a23,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 9021ba0..484ed01 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 _0xc5e4=['ChatGroup','save','update','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x2d06b1,_0x3aef78){var _0x40532d=function(_0x262c1a){while(--_0x262c1a){_0x2d06b1['push'](_0x2d06b1['shift']());}};_0x40532d(++_0x3aef78);}(_0xc5e4,0x117));var _0x4c5e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc5e4[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x4c5e('0x0'))['db'][_0x4c5e('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c5e('0x2'),'afterUpdate':_0x4c5e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1197ab){return function(_0xbf9f24,_0x202246,_0x45cfd9){ChatGroupEvents[_0x4c5e('0x4')](_0x1197ab+':'+_0xbf9f24['id'],_0xbf9f24);ChatGroupEvents[_0x4c5e('0x4')](_0x1197ab,_0xbf9f24);_0x45cfd9(null);};}for(var e in events){if(events[_0x4c5e('0x5')](e)){var event=events[e];ChatGroup[_0x4c5e('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x0b79=['hasOwnProperty','exports','events','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit'];(function(_0x15eb1a,_0x16dc02){var _0x1e7205=function(_0x32fad8){while(--_0x32fad8){_0x15eb1a['push'](_0x15eb1a['shift']());}};_0x1e7205(++_0x16dc02);}(_0x0b79,0xad));var _0x90b7=function(_0xc85b17,_0x2b981f){_0xc85b17=_0xc85b17-0x0;var _0x490ef8=_0x0b79[_0xc85b17];return _0x490ef8;};'use strict';var EventEmitter=require(_0x90b7('0x0'));var ChatGroup=require(_0x90b7('0x1'))['db'][_0x90b7('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x90b7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x90b7('0x4'),'afterDestroy':_0x90b7('0x5')};function emitEvent(_0x497698){return function(_0xd3671f,_0x4cd6c5,_0xd50b1b){ChatGroupEvents[_0x90b7('0x6')](_0x497698+':'+_0xd3671f['id'],_0xd3671f);ChatGroupEvents[_0x90b7('0x6')](_0x497698,_0xd3671f);_0xd50b1b(null);};}for(var e in events){if(events[_0x90b7('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x90b7('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 9462000..d03dd2c 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 _0xc587=['define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports'];(function(_0x3ed86a,_0x2e6a73){var _0x5a71f1=function(_0x47f9e5){while(--_0x47f9e5){_0x3ed86a['push'](_0x3ed86a['shift']());}};_0x5a71f1(++_0x2e6a73);}(_0xc587,0x129));var _0x7c58=function(_0x1865ff,_0x34ab23){_0x1865ff=_0x1865ff-0x0;var _0x493d64=_0xc587[_0x1865ff];return _0x493d64;};'use strict';var _=require(_0x7c58('0x0'));var util=require(_0x7c58('0x1'));var logger=require(_0x7c58('0x2'))(_0x7c58('0x3'));var moment=require(_0x7c58('0x4'));var BPromise=require(_0x7c58('0x5'));var rp=require(_0x7c58('0x6'));var fs=require('fs');var path=require(_0x7c58('0x7'));var rimraf=require(_0x7c58('0x8'));var config=require('../../config/environment');var attributes=require(_0x7c58('0x9'));module[_0x7c58('0xa')]=function(_0x6c954,_0x2581fd){return _0x6c954[_0x7c58('0xb')](_0x7c58('0xc'),attributes,{'tableName':_0x7c58('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7855=['request-promise','path','./chatGroup.attributes','define','ChatGroup','util','../../config/logger','api','moment','bluebird'];(function(_0xc7f728,_0x4d812f){var _0x3a6dc5=function(_0x8615cd){while(--_0x8615cd){_0xc7f728['push'](_0xc7f728['shift']());}};_0x3a6dc5(++_0x4d812f);}(_0x7855,0x1c7));var _0x5785=function(_0x453c99,_0x4a0d59){_0x453c99=_0x453c99-0x0;var _0x3dc60b=_0x7855[_0x453c99];return _0x3dc60b;};'use strict';var _=require('lodash');var util=require(_0x5785('0x0'));var logger=require(_0x5785('0x1'))(_0x5785('0x2'));var moment=require(_0x5785('0x3'));var BPromise=require(_0x5785('0x4'));var rp=require(_0x5785('0x5'));var fs=require('fs');var path=require(_0x5785('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5785('0x7'));module['exports']=function(_0x483743,_0x2df770){return _0x483743[_0x5785('0x8')](_0x5785('0x9'),attributes,{'tableName':'chat_groups','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 9ea74a9..2da4c14 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 _0x22d3=['stringify','error','message','result','catch','ChatGroup,\x20%s,\x20%s','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x525646,_0x5e435b){var _0x47ce97=function(_0x30e17a){while(--_0x30e17a){_0x525646['push'](_0x525646['shift']());}};_0x47ce97(++_0x5e435b);}(_0x22d3,0x66));var _0x322d=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0x22d3[_0x3ceb54];return _0x26d8a6;};'use strict';var _=require('lodash');var util=require(_0x322d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x322d('0x1'));var fs=require('fs');var Redis=require(_0x322d('0x2'));var db=require(_0x322d('0x3'))['db'];var utils=require(_0x322d('0x4'));var logger=require(_0x322d('0x5'))('rpc');var config=require(_0x322d('0x6'));var jayson=require(_0x322d('0x7'));var client=jayson['client'][_0x322d('0x8')]({'port':0x232a});config[_0x322d('0x9')]=_[_0x322d('0xa')](config[_0x322d('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x322d('0xb'))(new Redis(config[_0x322d('0x9')]));require(_0x322d('0xc'))[_0x322d('0xd')](socket);function respondWithRpcPromise(_0x2a6b87,_0x29c770,_0xf41a3e){return new BPromise(function(_0x3710a4,_0x2b3a39){return client[_0x322d('0xe')](_0x2a6b87,_0xf41a3e)['then'](function(_0x4e08a3){logger[_0x322d('0xf')]('ChatGroup,\x20%s,\x20%s',_0x29c770,_0x322d('0x10'));logger['debug'](_0x322d('0x11'),_0x29c770,_0x322d('0x10'),JSON[_0x322d('0x12')](_0x4e08a3));if(_0x4e08a3[_0x322d('0x13')]){if(_0x4e08a3[_0x322d('0x13')]['code']===0x1f4){logger[_0x322d('0x13')]('ChatGroup,\x20%s,\x20%s',_0x29c770,_0x4e08a3[_0x322d('0x13')]['message']);return _0x2b3a39(_0x4e08a3['error'][_0x322d('0x14')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x29c770,_0x4e08a3[_0x322d('0x13')][_0x322d('0x14')]);return _0x3710a4(_0x4e08a3[_0x322d('0x13')][_0x322d('0x14')]);}else{logger[_0x322d('0xf')]('ChatGroup,\x20%s,\x20%s',_0x29c770,_0x322d('0x10'));_0x3710a4(_0x4e08a3[_0x322d('0x15')][_0x322d('0x14')]);}})[_0x322d('0x16')](function(_0x497a4f){logger[_0x322d('0x13')](_0x322d('0x17'),_0x29c770,_0x497a4f);_0x2b3a39(_0x497a4f);});});}
\ No newline at end of file
+var _0x20ce=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x20ce,0x10d));var _0xe20c=function(_0x45fa95,_0x308dd6){_0x45fa95=_0x45fa95-0x0;var _0x414317=_0x20ce[_0x45fa95];return _0x414317;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var moment=require(_0xe20c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe20c('0x3'));var fs=require('fs');var Redis=require(_0xe20c('0x4'));var db=require(_0xe20c('0x5'))['db'];var utils=require(_0xe20c('0x6'));var logger=require(_0xe20c('0x7'))(_0xe20c('0x8'));var config=require(_0xe20c('0x9'));var jayson=require(_0xe20c('0xa'));var client=jayson[_0xe20c('0xb')][_0xe20c('0xc')]({'port':0x232a});config[_0xe20c('0xd')]=_[_0xe20c('0xe')](config[_0xe20c('0xd')],{'host':_0xe20c('0xf'),'port':0x18eb});var socket=require(_0xe20c('0x10'))(new Redis(config[_0xe20c('0xd')]));require(_0xe20c('0x11'))[_0xe20c('0x12')](socket);function respondWithRpcPromise(_0x41379b,_0x16aaaa,_0xb46255){return new BPromise(function(_0x17ecc8,_0x4517d7){return client[_0xe20c('0x13')](_0x41379b,_0xb46255)['then'](function(_0x201b08){logger[_0xe20c('0x14')](_0xe20c('0x15'),_0x16aaaa,_0xe20c('0x16'));logger[_0xe20c('0x17')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x16aaaa,_0xe20c('0x16'),JSON[_0xe20c('0x18')](_0x201b08));if(_0x201b08['error']){if(_0x201b08[_0xe20c('0x19')][_0xe20c('0x1a')]===0x1f4){logger[_0xe20c('0x19')]('ChatGroup,\x20%s,\x20%s',_0x16aaaa,_0x201b08[_0xe20c('0x19')][_0xe20c('0x1b')]);return _0x4517d7(_0x201b08[_0xe20c('0x19')][_0xe20c('0x1b')]);}logger['error'](_0xe20c('0x15'),_0x16aaaa,_0x201b08['error'][_0xe20c('0x1b')]);return _0x17ecc8(_0x201b08[_0xe20c('0x19')][_0xe20c('0x1b')]);}else{logger[_0xe20c('0x14')](_0xe20c('0x15'),_0x16aaaa,_0xe20c('0x16'));_0x17ecc8(_0x201b08[_0xe20c('0x1c')][_0xe20c('0x1b')]);}})[_0xe20c('0x1d')](function(_0x3768b0){logger['error'](_0xe20c('0x15'),_0x16aaaa,_0x3768b0);_0x4517d7(_0x3768b0);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index e5259ad..ac5f9c4 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 _0xfe30=['chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0xd48ed9,_0x4aa193){var _0x6cf52a=function(_0x254f76){while(--_0x254f76){_0xd48ed9['push'](_0xd48ed9['shift']());}};_0x6cf52a(++_0x4aa193);}(_0xfe30,0x1ed));var _0x0fe3=function(_0x1adf19,_0x44af9c){_0x1adf19=_0x1adf19-0x0;var _0x17faa2=_0xfe30[_0x1adf19];return _0x17faa2;};'use strict';var ChatGroupEvents=require(_0x0fe3('0x0'));var events=[_0x0fe3('0x1'),_0x0fe3('0x2'),_0x0fe3('0x3')];function createListener(_0x2a7a8e,_0x2e16ff){return function(_0x20d741){_0x2e16ff[_0x0fe3('0x4')](_0x2a7a8e,_0x20d741);};}function removeListener(_0x4cbbdf,_0x491be0){return function(){ChatGroupEvents['removeListener'](_0x4cbbdf,_0x491be0);};}exports['register']=function(_0x1da10e){for(var _0x366347=0x0,_0x466129=events['length'];_0x366347<_0x466129;_0x366347++){var _0x7d2dd4=events[_0x366347];var _0x1a125b=createListener(_0x0fe3('0x5')+_0x7d2dd4,_0x1da10e);ChatGroupEvents['on'](_0x7d2dd4,_0x1a125b);}};
\ No newline at end of file
+var _0x37c6=['chatGroup:','./chatGroup.events','save','remove','update','emit','removeListener','register'];(function(_0x1c47e4,_0x86ec7a){var _0x16e15a=function(_0x4663cb){while(--_0x4663cb){_0x1c47e4['push'](_0x1c47e4['shift']());}};_0x16e15a(++_0x86ec7a);}(_0x37c6,0x109));var _0x637c=function(_0x139994,_0x57f3bb){_0x139994=_0x139994-0x0;var _0x40898b=_0x37c6[_0x139994];return _0x40898b;};'use strict';var ChatGroupEvents=require(_0x637c('0x0'));var events=[_0x637c('0x1'),_0x637c('0x2'),_0x637c('0x3')];function createListener(_0x3500ef,_0x52dfde){return function(_0x227182){_0x52dfde[_0x637c('0x4')](_0x3500ef,_0x227182);};}function removeListener(_0x3fd066,_0x319e60){return function(){ChatGroupEvents[_0x637c('0x5')](_0x3fd066,_0x319e60);};}exports[_0x637c('0x6')]=function(_0x3486a5){for(var _0x5f546a=0x0,_0xf638c9=events['length'];_0x5f546a<_0xf638c9;_0x5f546a++){var _0x5d718c=events[_0x5f546a];var _0x4dde1f=createListener(_0x637c('0x7')+_0x5d718c,_0x3486a5);ChatGroupEvents['on'](_0x5d718c,_0x4dde1f);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 90a6e3f..55d50d7 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 _0x81db=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','delete','/:id','destroy','multer','util','path'];(function(_0x494aab,_0x4e1cef){var _0x1bc60f=function(_0xfbc68e){while(--_0xfbc68e){_0x494aab['push'](_0x494aab['shift']());}};_0x1bc60f(++_0x4e1cef);}(_0x81db,0x183));var _0xb81d=function(_0x52e572,_0x4c318b){_0x52e572=_0x52e572-0x0;var _0x112a42=_0x81db[_0x52e572];return _0x112a42;};'use strict';var multer=require(_0xb81d('0x0'));var util=require(_0xb81d('0x1'));var path=require(_0xb81d('0x2'));var timeout=require(_0xb81d('0x3'));var express=require(_0xb81d('0x4'));var router=express[_0xb81d('0x5')]();var fs_extra=require(_0xb81d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb81d('0x7'));var config=require(_0xb81d('0x8'));var controller=require('./chatGroup.controller');router[_0xb81d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb81d('0x9')](_0xb81d('0xa'),auth[_0xb81d('0xb')](),controller[_0xb81d('0xc')]);router[_0xb81d('0x9')]('/:id',auth[_0xb81d('0xb')](),controller['show']);router[_0xb81d('0x9')](_0xb81d('0xd'),auth[_0xb81d('0xb')](),controller['getUnread']);router[_0xb81d('0x9')](_0xb81d('0xe'),auth[_0xb81d('0xb')](),controller[_0xb81d('0xf')]);router[_0xb81d('0x9')](_0xb81d('0x10'),auth[_0xb81d('0xb')](),controller[_0xb81d('0x11')]);router[_0xb81d('0x12')]('/',auth[_0xb81d('0xb')](),controller[_0xb81d('0x13')]);router[_0xb81d('0x12')]('/:id/members',auth['isAuthenticated'](),controller[_0xb81d('0x14')]);router[_0xb81d('0x12')]('/:id/messages',auth[_0xb81d('0xb')](),controller[_0xb81d('0x15')]);router[_0xb81d('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb81d('0x17')](_0xb81d('0x18'),auth[_0xb81d('0xb')](),controller[_0xb81d('0x19')]);router[_0xb81d('0x17')]('/:id/members',auth['isAuthenticated'](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
+var _0xac4d=['get','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','put','update','delete','destroy','removeMembers','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','index','/describe','isAuthenticated'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xac4d,0x104));var _0xdac4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xac4d[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xdac4('0x0'));var util=require('util');var path=require(_0xdac4('0x1'));var timeout=require('connect-timeout');var express=require(_0xdac4('0x2'));var router=express['Router']();var fs_extra=require(_0xdac4('0x3'));var auth=require(_0xdac4('0x4'));var interaction=require(_0xdac4('0x5'));var config=require('../../config/environment');var controller=require(_0xdac4('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xdac4('0x7')]);router['get'](_0xdac4('0x8'),auth[_0xdac4('0x9')](),controller['describe']);router[_0xdac4('0xa')](_0xdac4('0xb'),auth[_0xdac4('0x9')](),controller[_0xdac4('0xc')]);router['get'](_0xdac4('0xd'),auth['isAuthenticated'](),controller['getUnread']);router[_0xdac4('0xa')](_0xdac4('0xe'),auth[_0xdac4('0x9')](),controller[_0xdac4('0xf')]);router['get'](_0xdac4('0x10'),auth['isAuthenticated'](),controller[_0xdac4('0x11')]);router['post']('/',auth[_0xdac4('0x9')](),controller[_0xdac4('0x12')]);router[_0xdac4('0x13')]('/:id/members',auth[_0xdac4('0x9')](),controller[_0xdac4('0x14')]);router[_0xdac4('0x13')](_0xdac4('0x10'),auth[_0xdac4('0x9')](),controller['addMessage']);router[_0xdac4('0x15')](_0xdac4('0xb'),auth[_0xdac4('0x9')](),controller[_0xdac4('0x16')]);router[_0xdac4('0x17')]('/:id',auth[_0xdac4('0x9')](),controller[_0xdac4('0x18')]);router[_0xdac4('0x17')]('/:id/members',auth[_0xdac4('0x9')](),controller[_0xdac4('0x19')]);module[_0xdac4('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 9cf99fa..b36a988 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 _0x6c1a=['BOOLEAN','sequelize','exports','INTEGER','star','thumb','TEXT','STRING','DATE','long','out'];(function(_0x2697ff,_0x1850ac){var _0x5b56d7=function(_0x114886){while(--_0x114886){_0x2697ff['push'](_0x2697ff['shift']());}};_0x5b56d7(++_0x1850ac);}(_0x6c1a,0x1f0));var _0xa6c1=function(_0x2a6a75,_0x1df599){_0x2a6a75=_0x2a6a75-0x0;var _0x227550=_0x6c1a[_0x2a6a75];return _0x227550;};'use strict';var Sequelize=require(_0xa6c1('0x0'));module[_0xa6c1('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa6c1('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0xa6c1('0x3'),_0xa6c1('0x4')),'defaultValue':_0xa6c1('0x3')},'ratingMessage':{'type':Sequelize[_0xa6c1('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xa6c1('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa6c1('0x7')]},'disposition':{'type':Sequelize[_0xa6c1('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xa6c1('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xa6c1('0x6')]},'deviceVendor':{'type':Sequelize[_0xa6c1('0x6')]},'deviceType':{'type':Sequelize[_0xa6c1('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xa6c1('0x6')]},'formData':{'type':Sequelize[_0xa6c1('0x5')](_0xa6c1('0x8'))},'read1stAt':{'type':Sequelize[_0xa6c1('0x7')]},'lastMsgAt':{'type':Sequelize[_0xa6c1('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa6c1('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa6c1('0x6')]},'customerPort':{'type':Sequelize[_0xa6c1('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xa6c1('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x421c=['TEXT','STRING','DATE','long','out','BOOLEAN','INTEGER','ENUM','star','thumb'];(function(_0x1f62c2,_0x3977a6){var _0x302a55=function(_0x53ab47){while(--_0x53ab47){_0x1f62c2['push'](_0x1f62c2['shift']());}};_0x302a55(++_0x3977a6);}(_0x421c,0x1bd));var _0xc421=function(_0x2e6428,_0x37e95e){_0x2e6428=_0x2e6428-0x0;var _0x1e0ee7=_0x421c[_0x2e6428];return _0x1e0ee7;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xc421('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc421('0x1')]},'ratingType':{'type':Sequelize[_0xc421('0x2')](_0xc421('0x3'),_0xc421('0x4')),'defaultValue':_0xc421('0x3')},'ratingMessage':{'type':Sequelize[_0xc421('0x5')]},'pathTranscript':{'type':Sequelize[_0xc421('0x5')]},'mailTranscript':{'type':Sequelize[_0xc421('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc421('0x7')]},'disposition':{'type':Sequelize[_0xc421('0x6')]},'secondDisposition':{'type':Sequelize[_0xc421('0x6')]},'thirdDisposition':{'type':Sequelize[_0xc421('0x6')]},'note':{'type':Sequelize[_0xc421('0x6')]},'browserName':{'type':Sequelize[_0xc421('0x6')]},'browserVersion':{'type':Sequelize[_0xc421('0x6')]},'osName':{'type':Sequelize[_0xc421('0x6')]},'osVersion':{'type':Sequelize[_0xc421('0x6')]},'deviceModel':{'type':Sequelize[_0xc421('0x6')]},'deviceVendor':{'type':Sequelize[_0xc421('0x6')]},'deviceType':{'type':Sequelize[_0xc421('0x6')]},'referer':{'type':Sequelize[_0xc421('0x5')]},'customerIp':{'type':Sequelize[_0xc421('0x6')]},'formData':{'type':Sequelize['TEXT'](_0xc421('0x8'))},'read1stAt':{'type':Sequelize[_0xc421('0x7')]},'lastMsgAt':{'type':Sequelize[_0xc421('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc421('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc421('0x6')]},'customerPort':{'type':Sequelize[_0xc421('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xc421('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index ae215f2..4c8dc71 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 _0xfff7=['Chat','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','out','Contact','lastName','views','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','defaults','redis','./chatInteraction.socket','register','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','destroy','then','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','fieldName','type','key','findAll','chat','query','user','show','params','keys','rawAttributes','filters','intersection','attributes','model','fields','length','includeAll','include','options','ChatInteraction','find','create','update','describe','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooNote','vidaooEscalation','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Sequelize','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','disposition','attachmentUpload','file','originalname','basename','filename','mimetype','Unauthorized','Attachment','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','server/files/chat/upload/','format','now','pathTranscript','Messages','User','CmContact','%s%d','agentAlias','customer','ContactId','agentIdentifier','agent_alias','alias','System','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','ids','getMessages','hasOwnProperty','sort','pick','where','ChatInteractionId','filter','$gte','split','count','rows','nolimit','order','includeAgent','push','setTags','omit','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','createdAt','read','Owner','get','mkdirSync'];(function(_0x5c6bc9,_0x4276f7){var _0x5b1fa5=function(_0x351e82){while(--_0x351e82){_0x5c6bc9['push'](_0x5c6bc9['shift']());}};_0x5b1fa5(++_0x4276f7);}(_0xfff7,0x1b5));var _0x7fff=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfff7[_0x122ef9];return _0x42fba0;};'use strict';var rimraf=require(_0x7fff('0x0'));var zipdir=require(_0x7fff('0x1'));var rp=require(_0x7fff('0x2'));var moment=require(_0x7fff('0x3'));var BPromise=require(_0x7fff('0x4'));var Mustache=require(_0x7fff('0x5'));var util=require(_0x7fff('0x6'));var path=require(_0x7fff('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7fff('0x8'));var Redis=require(_0x7fff('0x9'));var interaction=require(_0x7fff('0xa'));var qs=require(_0x7fff('0xb'));var pdf=require(_0x7fff('0xc'));var logger=require(_0x7fff('0xd'))(_0x7fff('0xe'));var config=require(_0x7fff('0xf'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7fff('0x10')](config[_0x7fff('0x11')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7fff('0x11')]));require(_0x7fff('0x12'))[_0x7fff('0x13')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7fff('0x14')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x3173c9,_0x23cab8,_0x2009df,_0x55a2d5){return new BPromise(function(_0x2fef2d,_0x5e9446){var _0x34dc86=_0x55a2d5||client;return _0x34dc86[_0x7fff('0x15')](_0x3173c9,_0x2009df)['then'](function(_0x1a7cb8){logger[_0x7fff('0x16')](_0x7fff('0x17'),_0x23cab8,_0x7fff('0x18'));logger[_0x7fff('0x19')](_0x7fff('0x1a'),_0x23cab8,_0x7fff('0x18'),JSON['stringify'](_0x1a7cb8));if(_0x1a7cb8[_0x7fff('0x1b')]){if(_0x1a7cb8[_0x7fff('0x1b')][_0x7fff('0x1c')]===0x1f4){logger[_0x7fff('0x1b')](_0x7fff('0x17'),_0x23cab8,_0x1a7cb8[_0x7fff('0x1b')]['message']);return _0x5e9446(_0x1a7cb8[_0x7fff('0x1b')][_0x7fff('0x1d')]);}logger[_0x7fff('0x1b')](_0x7fff('0x17'),_0x23cab8,_0x1a7cb8[_0x7fff('0x1b')][_0x7fff('0x1d')]);return _0x2fef2d(_0x1a7cb8[_0x7fff('0x1b')][_0x7fff('0x1d')]);}else{logger['info'](_0x7fff('0x17'),_0x23cab8,_0x7fff('0x18'));_0x2fef2d(_0x1a7cb8['result']['message']);}})[_0x7fff('0x1e')](function(_0x2473f6){logger[_0x7fff('0x1b')](_0x7fff('0x17'),_0x23cab8,_0x2473f6);_0x5e9446(_0x2473f6);});});}function respondWithStatusCode(_0x408b8b,_0xe00102){_0xe00102=_0xe00102||0xcc;return function(_0x1c21db){if(_0x1c21db){return _0x408b8b[_0x7fff('0x1f')](_0xe00102);}return _0x408b8b[_0x7fff('0x20')](_0xe00102)[_0x7fff('0x21')]();};}function respondWithResult(_0x3b3300,_0x1cbc11){_0x1cbc11=_0x1cbc11||0xc8;return function(_0x594cdc){if(_0x594cdc){return _0x3b3300[_0x7fff('0x20')](_0x1cbc11)[_0x7fff('0x22')](_0x594cdc);}};}function respondWithFilteredResult(_0x496645,_0x4c19ef){return function(_0xc8c6af){if(_0xc8c6af){var _0x391611=typeof _0x4c19ef[_0x7fff('0x23')]===_0x7fff('0x24')&&typeof _0x4c19ef[_0x7fff('0x25')]===_0x7fff('0x24');var _0x26ac9c=_0xc8c6af['count'];var _0x2e0b3f=_0x391611?0x0:_0x4c19ef[_0x7fff('0x23')];var _0x490aea=_0x391611?_0xc8c6af['count']:_0x4c19ef[_0x7fff('0x23')]+_0x4c19ef[_0x7fff('0x25')];var _0x2a8fdf;if(_0x490aea>=_0x26ac9c){_0x490aea=_0x26ac9c;_0x2a8fdf=0xc8;}else{_0x2a8fdf=0xce;}_0x496645['status'](_0x2a8fdf);return _0x496645[_0x7fff('0x26')](_0x7fff('0x27'),_0x2e0b3f+'-'+_0x490aea+'/'+_0x26ac9c)['json'](_0xc8c6af);}return null;};}function saveUpdates(_0x49e7b3){return function(_0x1349f1){if(_0x1349f1){return _0x1349f1['update'](_0x49e7b3)['then'](function(_0x3cf50c){return _0x3cf50c;});}return null;};}function removeEntity(_0x281d73){return function(_0x514496){if(_0x514496){return _0x514496[_0x7fff('0x28')]()[_0x7fff('0x29')](function(){_0x281d73[_0x7fff('0x20')](0xcc)[_0x7fff('0x21')]();});}};}function handleEntityNotFound(_0x1b9b0b){return function(_0x12dd0b){if(!_0x12dd0b){_0x1b9b0b[_0x7fff('0x1f')](0x194);}return _0x12dd0b;};}function handleError(_0xd7b598,_0x168748){_0x168748=_0x168748||0x1f4;return function(_0x45910e){logger[_0x7fff('0x1b')](_0x45910e[_0x7fff('0x2a')]);if(_0x45910e[_0x7fff('0x2b')]){delete _0x45910e[_0x7fff('0x2b')];}_0xd7b598[_0x7fff('0x20')](_0x168748)[_0x7fff('0x2c')](_0x45910e);};}function getMustacheRender(_0x31aa1e,_0xbe71d8){return Mustache[_0x7fff('0x2d')](_0x31aa1e,_[_0x7fff('0x2e')](_0xbe71d8[_0x7fff('0x2f')],{'contact':_0xbe71d8[_0x7fff('0x30')],'message':_0xbe71d8['message'],'agent':_0xbe71d8[_0x7fff('0x31')],'interaction':_0xbe71d8[_0x7fff('0x32')],'account':_0xbe71d8[_0x7fff('0x33')]}))||'';}exports[_0x7fff('0x34')]=function(_0x2f785a,_0x485d2f){var _0x3fd41e={};var _0x3f0c9c=_[_0x7fff('0x35')](db['ChatInteraction']['rawAttributes'],function(_0x15e0b3){return{'name':_0x15e0b3[_0x7fff('0x36')],'type':_0x15e0b3[_0x7fff('0x37')][_0x7fff('0x38')]};});_0x3fd41e=qs['getOptions'](_0x3f0c9c,_0x2f785a);return interaction[_0x7fff('0x39')](_0x7fff('0x3a'),_0x2f785a[_0x7fff('0x3b')],_0x2f785a[_0x7fff('0x3c')],_0x3fd41e,_0x3f0c9c)['then'](respondWithFilteredResult(_0x485d2f,_0x3fd41e))['catch'](handleError(_0x485d2f,null));};exports[_0x7fff('0x3d')]=function(_0x155eac,_0x33ce23){var _0xec44={'raw':![],'where':{'id':_0x155eac[_0x7fff('0x3e')]['id']}},_0x5e33f8={};_0x5e33f8['model']=_[_0x7fff('0x3f')](db['ChatInteraction'][_0x7fff('0x40')]);_0x5e33f8[_0x7fff('0x3b')]=_['keys'](_0x155eac['query']);_0x5e33f8[_0x7fff('0x41')]=_[_0x7fff('0x42')](_0x5e33f8['model'],_0x5e33f8['query']);_0xec44[_0x7fff('0x43')]=_['intersection'](_0x5e33f8[_0x7fff('0x44')],qs[_0x7fff('0x45')](_0x155eac['query'][_0x7fff('0x45')]));_0xec44[_0x7fff('0x43')]=_0xec44[_0x7fff('0x43')][_0x7fff('0x46')]?_0xec44[_0x7fff('0x43')]:_0x5e33f8[_0x7fff('0x44')];if(_0x155eac[_0x7fff('0x3b')][_0x7fff('0x47')]){_0xec44[_0x7fff('0x48')]=[{'all':!![]}];}_0xec44=_['merge']({},_0xec44,_0x155eac[_0x7fff('0x49')]);return db[_0x7fff('0x4a')][_0x7fff('0x4b')](_0xec44)[_0x7fff('0x29')](handleEntityNotFound(_0x33ce23,null))[_0x7fff('0x29')](respondWithResult(_0x33ce23,null))[_0x7fff('0x1e')](handleError(_0x33ce23,null));};exports[_0x7fff('0x4c')]=function(_0x21c33b,_0x3c7f28){return db['ChatInteraction'][_0x7fff('0x4c')](_0x21c33b[_0x7fff('0x2f')],{})[_0x7fff('0x29')](respondWithResult(_0x3c7f28,0xc9))[_0x7fff('0x1e')](handleError(_0x3c7f28,null));};exports[_0x7fff('0x4d')]=function(_0x343ec3,_0x428d59){if(_0x343ec3[_0x7fff('0x2f')]['id']){delete _0x343ec3['body']['id'];}return db['ChatInteraction'][_0x7fff('0x4b')]({'where':{'id':_0x343ec3[_0x7fff('0x3e')]['id']}})['then'](handleEntityNotFound(_0x428d59,null))['then'](saveUpdates(_0x343ec3[_0x7fff('0x2f')],null))[_0x7fff('0x29')](respondWithResult(_0x428d59,null))[_0x7fff('0x1e')](handleError(_0x428d59,null));};exports[_0x7fff('0x28')]=function(_0x3c55f8,_0x447bdb){return db[_0x7fff('0x4a')][_0x7fff('0x4b')]({'where':{'id':_0x3c55f8[_0x7fff('0x3e')]['id']}})[_0x7fff('0x29')](handleEntityNotFound(_0x447bdb,null))['then'](removeEntity(_0x447bdb,null))['catch'](handleError(_0x447bdb,null));};exports[_0x7fff('0x4e')]=function(_0x28cfea,_0x2dc272){return db[_0x7fff('0x4a')]['describe']()[_0x7fff('0x29')](respondWithResult(_0x2dc272,null))[_0x7fff('0x1e')](handleError(_0x2dc272,null));};exports['createVidaooSession']=function(_0x2bf4a6,_0x55fa3e){var _0x292e93=_0x2bf4a6['params']['id'];var _0x1bf1d0;var _0x14426f;var _0x5c0961;return db[_0x7fff('0x4a')]['findOne']({'where':{'id':_0x292e93}})['then'](function(_0x36f3a4){_0x1bf1d0=_0x36f3a4;return db[_0x7fff('0x4f')][_0x7fff('0x50')]({'where':{'id':_0x36f3a4[_0x7fff('0x51')]},'attributes':['id',_0x7fff('0x52'),'vidaooEscalation',_0x7fff('0x53'),_0x7fff('0x54'),'vidaooMetadata'],'raw':!![]});})[_0x7fff('0x29')](function(_0x594e1b){if(_0x594e1b&&_0x594e1b[_0x7fff('0x52')]&&_0x594e1b[_0x7fff('0x55')]){_0x14426f=_0x594e1b;var _0x3396d2={'interaction':{'id':_0x292e93},'agent':{'id':_0x2bf4a6[_0x7fff('0x3c')]['id'],'name':_0x2bf4a6[_0x7fff('0x3c')][_0x7fff('0x2b')],'fullname':_0x2bf4a6[_0x7fff('0x3c')][_0x7fff('0x56')],'email':_0x2bf4a6[_0x7fff('0x3c')][_0x7fff('0x57')]},'contact':_0x2bf4a6[_0x7fff('0x2f')][_0x7fff('0x30')],'account':_0x2bf4a6[_0x7fff('0x2f')][_0x7fff('0x33')]};var _0x5929c1={'rejectUnauthorized':![],'method':_0x7fff('0x58'),'url':_0x7fff('0x59'),'headers':{'X-APIKEY':_0x594e1b[_0x7fff('0x52')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2bf4a6[_0x7fff('0x3c')][_0x7fff('0x57')]],'buttons':null,'topic':_0x14426f[_0x7fff('0x53')],'note':_[_0x7fff('0x5a')](_0x14426f['vidaooNote'])?null:getMustacheRender(_0x14426f['vidaooNote'],_0x3396d2),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x7fff('0x5a')](_0x14426f['vidaooMetadata'])){var _0x464a0a=getMustacheRender(_0x14426f['vidaooMetadata'],_0x3396d2);var _0xaebe30=JSON[_0x7fff('0x5b')](_0x464a0a);_0x5929c1[_0x7fff('0x2f')]['metadata']=_0xaebe30;}}catch(_0x4ac08b){throw new db['Sequelize'][(_0x7fff('0x5c'))](_0x7fff('0x5d'));}return rp(_0x5929c1);}else{throw new db['Sequelize']['ValidationError'](_0x7fff('0x5e'));}})['then'](function(_0x41ec9a){_0x5c0961=_0x41ec9a;if(_0x5c0961['id']){var _0x1a8e7e={'body':_0x5c0961['join_url'],'ChatWebsiteId':_0x14426f['id'],'ChatInteractionId':_0x1bf1d0['id'],'direction':'out','UserId':_0x2bf4a6[_0x7fff('0x3c')]['id']};return db[_0x7fff('0x5f')][_0x7fff('0x4c')](_0x1a8e7e,{});}else{throw new db[(_0x7fff('0x60'))]['ValidationError'](_0x7fff('0x61'));}})[_0x7fff('0x29')](function(){return _0x1bf1d0[_0x7fff('0x62')]({'vidaooSessionId':_0x5c0961['id']});})['then'](respondWithResult(_0x55fa3e,null))['catch'](handleError(_0x55fa3e,null));};exports[_0x7fff('0x63')]=function(_0x531331,_0x31ed3b){if(_0x531331['body']['id']){delete _0x531331[_0x7fff('0x2f')]['id'];}return db[_0x7fff('0x4a')][_0x7fff('0x4b')]({'where':{'id':_0x531331['params']['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x7fff('0x29')](handleEntityNotFound(_0x31ed3b,null))[_0x7fff('0x29')](saveUpdates(_0x531331['body'],null))['then'](respondWithResult(_0x31ed3b,null))[_0x7fff('0x1e')](handleError(_0x31ed3b,null));};exports['abandon']=function(_0x365a36,_0xc84c15){if(_0x365a36['body']['id']){delete _0x365a36[_0x7fff('0x2f')]['id'];}return db[_0x7fff('0x4a')][_0x7fff('0x4b')]({'where':{'id':_0x365a36[_0x7fff('0x3e')]['id']}})[_0x7fff('0x29')](function(_0x28d6a1){if(!_0x28d6a1){logger[_0x7fff('0x1b')](_0x7fff('0x64'),'abandon',0x194,_0x7fff('0x65'));_0xc84c15[_0x7fff('0x1f')](0x194);}else{if(_0x28d6a1[_0x7fff('0x66')]){throw new db[(_0x7fff('0x60'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x28d6a1;})[_0x7fff('0x29')](function(_0x44bffa){if(_0x44bffa){return _0x44bffa[_0x7fff('0x4d')]({'closed':_0x365a36[_0x7fff('0x2f')][_0x7fff('0x67')],'disposition':_0x365a36[_0x7fff('0x2f')][_0x7fff('0x68')]})['then'](function(_0x340022){return _0x340022;});}})[_0x7fff('0x29')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x365a36[_0x7fff('0x2f')],client9004);})[_0x7fff('0x29')](respondWithResult(_0xc84c15,null))[_0x7fff('0x1e')](handleError(_0xc84c15,null));};exports[_0x7fff('0x69')]=function(_0x1f033a,_0x406d42){_0x1f033a['body'][_0x7fff('0x2b')]=_0x1f033a[_0x7fff('0x6a')][_0x7fff('0x6b')];_0x1f033a['body'][_0x7fff('0x6c')]=_0x1f033a['file'][_0x7fff('0x6d')];_0x1f033a['body'][_0x7fff('0x37')]=_0x1f033a[_0x7fff('0x6a')][_0x7fff('0x6e')];return db['Attachment']['create'](_0x1f033a['body'])[_0x7fff('0x29')](respondWithResult(_0x406d42,0xc9))[_0x7fff('0x1e')](handleError(_0x406d42,null));};exports['attachmentDownload']=function(_0x1fafdd,_0x53db10){return db['ChatInteraction'][_0x7fff('0x50')]({'where':{'id':_0x1fafdd['params']['id']},'raw':!![]})[_0x7fff('0x29')](handleEntityNotFound(_0x53db10,null))[_0x7fff('0x29')](function(_0x30258f){if(_0x30258f){if(_0x30258f[_0x7fff('0x67')]){return _0x53db10['status'](0x193)['json']({'status':0x193,'message':_0x7fff('0x6f')});}return db[_0x7fff('0x70')]['findOne']({'where':{'id':_0x1fafdd['query']['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x53db10,null));}})[_0x7fff('0x29')](function(_0x27ae53){if(_0x27ae53){var _0xeaf5f4=_0x27ae53[_0x7fff('0x71')]!==null;var _0x4e9124=path[_0x7fff('0x72')](config[_0x7fff('0x73')],_0x7fff('0x74'));if(_0xeaf5f4){_0x4e9124=path[_0x7fff('0x72')](_0x4e9124,'offline-chat/');}var _0x103109=path['join'](_0x4e9124,_0x27ae53[_0x7fff('0x6c')]);return _0x53db10[_0x7fff('0x75')](_0x103109);}})[_0x7fff('0x1e')](handleError(_0x53db10,null));};exports[_0x7fff('0x76')]=function(_0x131392,_0x2c552c){var _0x1a8931=null;var _0x3d367c=null;var _0x267f78=null;if(_0x131392[_0x7fff('0x2f')]['id']){delete _0x131392[_0x7fff('0x2f')]['id'];}if(_0x131392[_0x7fff('0x2f')]['mailTranscript']){_0x267f78=path[_0x7fff('0x72')](config['root'],_0x7fff('0x77'),util[_0x7fff('0x78')]('transcript-%s.txt',Date[_0x7fff('0x79')]()));_0x131392[_0x7fff('0x2f')][_0x7fff('0x7a')]=_0x267f78;}return db[_0x7fff('0x4a')][_0x7fff('0x4b')]({'where':{'id':_0x131392[_0x7fff('0x3e')]['id']},'include':[{'model':db[_0x7fff('0x5f')],'as':_0x7fff('0x7b'),'include':[{'model':db[_0x7fff('0x7c')],'as':_0x7fff('0x7c')}]}]})[_0x7fff('0x29')](handleEntityNotFound(_0x2c552c,null))[_0x7fff('0x29')](saveUpdates(_0x131392[_0x7fff('0x2f')],null))['then'](function(_0x3d991c){if(_0x3d991c){_0x1a8931=_0x3d991c;return db[_0x7fff('0x4f')][_0x7fff('0x4b')]({'where':{'id':_0x1a8931[_0x7fff('0x51')]}});}})[_0x7fff('0x29')](function(_0x2c76fd){if(_0x2c76fd){_0x3d367c=_0x2c76fd;return db[_0x7fff('0x7d')][_0x7fff('0x4b')]({'where':{'id':_0x1a8931['ContactId']}});}})[_0x7fff('0x29')](function(_0x2cdc5b){if(_0x2cdc5b){if(_0x267f78){var _0x44fd2c=null;for(var _0xdc32dd=0x1;_0xdc32dd<_0x1a8931['Messages'][_0x7fff('0x46')];++_0xdc32dd){_0x44fd2c=_0x1a8931[_0x7fff('0x7b')][_0xdc32dd];var _0x5ef227=_0x44fd2c['UserId']?util[_0x7fff('0x78')](_0x7fff('0x7e'),_0x3d367c[_0x7fff('0x7f')],_0x44fd2c[_0x7fff('0x66')]):'System';var _0x2054c6=_0x131392[_0x7fff('0x2f')][_0x7fff('0x80')]||util[_0x7fff('0x78')](_0x7fff('0x7e'),'Visitor',_0x44fd2c[_0x7fff('0x81')]);switch(_0x3d367c[_0x7fff('0x82')]){case'website_alias':_0x5ef227=_0x44fd2c[_0x7fff('0x66')]?util['format'](_0x7fff('0x7e'),_0x3d367c[_0x7fff('0x7f')],_0x44fd2c['UserId']):'System';break;case _0x7fff('0x83'):_0x5ef227=_0x44fd2c[_0x7fff('0x66')]?_0x44fd2c[_0x7fff('0x7c')][_0x7fff('0x84')]||_0x44fd2c[_0x7fff('0x7c')][_0x7fff('0x56')]:_0x7fff('0x85');break;case'agent_fullname':_0x5ef227=_0x44fd2c[_0x7fff('0x66')]?_0x44fd2c['User'][_0x7fff('0x56')]:_0x7fff('0x85');break;default:_0x5ef227=_0x44fd2c[_0x7fff('0x66')]?util['format'](_0x7fff('0x7e'),_0x3d367c[_0x7fff('0x7f')],_0x44fd2c[_0x7fff('0x66')]):_0x7fff('0x85');}var _0x23ba0c=util[_0x7fff('0x78')](_0x7fff('0x86'),moment(_0x44fd2c['createdAt'])[_0x7fff('0x78')]('MM/DD/YYYY\x20HH:mm:ss'),_0x44fd2c[_0x7fff('0x87')]==='in'?_0x2054c6:_0x5ef227,_0x44fd2c[_0x7fff('0x2f')]);if(!_0x44fd2c[_0x7fff('0x88')]){fs[_0x7fff('0x89')](_0x267f78,_0x23ba0c);}}return db[_0x7fff('0x8a')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x7fff('0x8b')],'as':_0x7fff('0x8c'),'raw':!![],'include':[{'model':db[_0x7fff('0x8d')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x7fff('0x29')](function(_0x13c07e){if(!_0x13c07e||!_0x13c07e['Smtp']||!_0x131392[_0x7fff('0x2f')])return _0x1a8931;var _0x4381df=_0x13c07e['getSmtpOptions']();return respondWithRpcPromise(_0x7fff('0x8e'),_0x7fff('0x8f'),{'account':_0x4381df,'message':{'from':util[_0x7fff('0x78')](_0x7fff('0x90'),_0x13c07e[_0x7fff('0x2b')],_0x13c07e[_0x7fff('0x57')]||_0x13c07e[_0x7fff('0x8c')][_0x7fff('0x3c')]),'to':_0x131392['body']['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x7fff('0x78')](_0x7fff('0x91'),_0x131392[_0x7fff('0x2f')][_0x7fff('0x92')]),'attachments':[{'path':_0x267f78}]}})[_0x7fff('0x29')](function(){return _0x1a8931;})[_0x7fff('0x1e')](function(_0x5f7bb0){logger[_0x7fff('0x1b')](_0x5f7bb0);});})[_0x7fff('0x29')](respondWithStatusCode(_0x2c552c,0xc8))['catch'](handleError(_0x2c552c,null));};exports['addMessage']=function(_0x5f5ad3,_0x17dbc2){return db[_0x7fff('0x5f')]['find']({'where':{'id':_0x5f5ad3[_0x7fff('0x3e')]['id']}})[_0x7fff('0x29')](handleEntityNotFound(_0x17dbc2,null))[_0x7fff('0x29')](function(_0x2b88d4){if(_0x2b88d4){return _0x2b88d4['addMessage'](_0x5f5ad3['body'][_0x7fff('0x93')],_['omit'](_0x5f5ad3['body'],['ids','id'])||{});}})[_0x7fff('0x29')](respondWithResult(_0x17dbc2,null))[_0x7fff('0x1e')](handleError(_0x17dbc2,null));};exports[_0x7fff('0x94')]=function(_0x4f0e51,_0x54b4e2){var _0x1771ad={'raw':![],'where':{}};var _0x406aa6={};var _0x607e4d={'count':0x0,'rows':[]};return db[_0x7fff('0x4a')]['findOne']({'where':{'id':_0x4f0e51['params']['id']}})[_0x7fff('0x29')](handleEntityNotFound(_0x54b4e2,null))[_0x7fff('0x29')](function(_0x22a481){if(_0x22a481){_0x406aa6[_0x7fff('0x44')]=_[_0x7fff('0x3f')](db['ChatMessage'][_0x7fff('0x40')]);_0x406aa6[_0x7fff('0x3b')]=_[_0x7fff('0x3f')](_0x4f0e51['query']);_0x406aa6[_0x7fff('0x41')]=_[_0x7fff('0x42')](_0x406aa6[_0x7fff('0x44')],_0x406aa6[_0x7fff('0x3b')]);_0x1771ad[_0x7fff('0x43')]=_[_0x7fff('0x42')](_0x406aa6[_0x7fff('0x44')],qs['fields'](_0x4f0e51[_0x7fff('0x3b')][_0x7fff('0x45')]));_0x1771ad[_0x7fff('0x43')]=_0x1771ad['attributes'][_0x7fff('0x46')]?_0x1771ad[_0x7fff('0x43')]:_0x406aa6[_0x7fff('0x44')];if(!_0x4f0e51[_0x7fff('0x3b')][_0x7fff('0x95')]('nolimit')){_0x1771ad[_0x7fff('0x25')]=qs['limit'](_0x4f0e51['query'][_0x7fff('0x25')]);_0x1771ad['offset']=qs[_0x7fff('0x23')](_0x4f0e51[_0x7fff('0x3b')][_0x7fff('0x23')]);}_0x1771ad['order']=qs['sort'](_0x4f0e51[_0x7fff('0x3b')][_0x7fff('0x96')]);_0x1771ad['where']=qs[_0x7fff('0x41')](_[_0x7fff('0x97')](_0x4f0e51[_0x7fff('0x3b')],_0x406aa6[_0x7fff('0x41')]));_0x1771ad[_0x7fff('0x98')][_0x7fff('0x99')]=_0x22a481['id'];if(_0x4f0e51[_0x7fff('0x3b')][_0x7fff('0x9a')]){_0x1771ad[_0x7fff('0x98')]=_['merge'](_0x1771ad[_0x7fff('0x98')],{'$or':_[_0x7fff('0x35')](_0x1771ad[_0x7fff('0x43')],function(_0x6f67ce){var _0x5083c7={};_0x5083c7[_0x6f67ce]={'$like':'%'+_0x4f0e51[_0x7fff('0x3b')][_0x7fff('0x9a')]+'%'};return _0x5083c7;})});}if(_0x4f0e51['query'][_0x7fff('0x9b')]){var _0x1ae7ee=_0x4f0e51[_0x7fff('0x3b')]['$gte'][_0x7fff('0x9c')](',');var _0x58d4de={};_0x58d4de[_0x1ae7ee[0x0]]={'$gte':moment(_0x1ae7ee[0x1])[_0x7fff('0x78')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1771ad[_0x7fff('0x98')]=_[_0x7fff('0x2e')](_0x1771ad[_0x7fff('0x98')],_0x58d4de);}_0x1771ad=_[_0x7fff('0x2e')]({},_0x1771ad,_0x4f0e51[_0x7fff('0x49')]);return db['ChatMessage']['count']({'where':_0x1771ad[_0x7fff('0x98')]})[_0x7fff('0x29')](function(_0x3c6fdd){_0x607e4d[_0x7fff('0x9d')]=_0x3c6fdd;if(_0x4f0e51[_0x7fff('0x3b')][_0x7fff('0x47')]){_0x1771ad[_0x7fff('0x48')]=[{'all':!![]}];}return db[_0x7fff('0x5f')][_0x7fff('0x39')](_0x1771ad);})['then'](function(_0x5668b9){_0x607e4d[_0x7fff('0x9e')]=_0x5668b9;return _0x607e4d;});}})['then'](respondWithFilteredResult(_0x54b4e2,_0x1771ad))[_0x7fff('0x1e')](handleError(_0x54b4e2,null));};exports['getMyMessages']=function(_0x4afdbc,_0x1a5b16){var _0x267ed2={'where':{}},_0x1e4c7f={},_0x5d7cb7={'count':0x0,'rows':[]};return db[_0x7fff('0x4a')][_0x7fff('0x50')]({'where':{'id':_0x4afdbc['params']['id']}})[_0x7fff('0x29')](handleEntityNotFound(_0x1a5b16,null))[_0x7fff('0x29')](function(_0x301788){if(_0x301788){_0x1e4c7f['model']=_['keys'](db['ChatMessage'][_0x7fff('0x40')]);_0x1e4c7f[_0x7fff('0x3b')]=_[_0x7fff('0x3f')](_0x4afdbc[_0x7fff('0x3b')]);_0x1e4c7f[_0x7fff('0x41')]=_[_0x7fff('0x42')](_0x1e4c7f[_0x7fff('0x44')],_0x1e4c7f[_0x7fff('0x3b')]);_0x267ed2['attributes']=_[_0x7fff('0x42')](_0x1e4c7f[_0x7fff('0x44')],qs['fields'](_0x4afdbc[_0x7fff('0x3b')]['fields']));_0x267ed2['attributes']=_0x267ed2[_0x7fff('0x43')][_0x7fff('0x46')]?_0x267ed2[_0x7fff('0x43')]:_0x1e4c7f[_0x7fff('0x44')];if(!_0x4afdbc[_0x7fff('0x3b')]['hasOwnProperty'](_0x7fff('0x9f'))){_0x267ed2['limit']=qs['limit'](_0x4afdbc[_0x7fff('0x3b')]['limit']);_0x267ed2['offset']=qs[_0x7fff('0x23')](_0x4afdbc[_0x7fff('0x3b')][_0x7fff('0x23')]);}_0x267ed2[_0x7fff('0xa0')]=qs[_0x7fff('0x96')](_0x4afdbc[_0x7fff('0x3b')][_0x7fff('0x96')]);_0x267ed2[_0x7fff('0x98')]=qs[_0x7fff('0x41')](_[_0x7fff('0x97')](_0x4afdbc[_0x7fff('0x3b')],_0x1e4c7f['filters']));_0x267ed2['where'][_0x7fff('0x99')]=_0x301788['id'];if(_0x4afdbc[_0x7fff('0x3b')][_0x7fff('0x9a')]){_0x267ed2[_0x7fff('0x98')]=_[_0x7fff('0x2e')](_0x267ed2['where'],{'$or':_['map'](_0x267ed2[_0x7fff('0x43')],function(_0x472859){var _0x3d5ff8={};_0x3d5ff8[_0x472859]={'$like':'%'+_0x4afdbc[_0x7fff('0x3b')][_0x7fff('0x9a')]+'%'};return _0x3d5ff8;})});}_0x267ed2[_0x7fff('0x98')]['secret']=![];if(_0x4afdbc[_0x7fff('0x3b')]['id']){_0x267ed2[_0x7fff('0x98')]['id']={'$gt':_0x4afdbc['query']['id']};}_0x267ed2=_[_0x7fff('0x2e')]({},_0x267ed2,_0x4afdbc[_0x7fff('0x49')]);return db[_0x7fff('0x5f')][_0x7fff('0x9d')]({'where':_0x267ed2[_0x7fff('0x98')]})['then'](function(_0x2f2ac7){_0x5d7cb7['count']=_0x2f2ac7;_0x267ed2[_0x7fff('0x48')]=[];if(_0x4afdbc[_0x7fff('0x3b')][_0x7fff('0xa1')]){_0x267ed2[_0x7fff('0x48')][_0x7fff('0xa2')]({'model':db['User'],'as':_0x7fff('0x7c'),'attributes':['id',_0x7fff('0x56'),_0x7fff('0x84')]});}if(_0x4afdbc['query']['includeAll']){_0x267ed2[_0x7fff('0x48')]=[{'all':!![]}];}return db[_0x7fff('0x5f')][_0x7fff('0x39')](_0x267ed2);})['then'](function(_0x4a8f98){_0x5d7cb7[_0x7fff('0x9e')]=_0x4a8f98;return _0x5d7cb7;});}})['then'](respondWithFilteredResult(_0x1a5b16,_0x267ed2))[_0x7fff('0x1e')](handleError(_0x1a5b16,null));};exports['addTags']=function(_0x4b1dcd,_0x520b84){return db[_0x7fff('0x4a')][_0x7fff('0x4b')]({'where':{'id':_0x4b1dcd[_0x7fff('0x3e')]['id']}})[_0x7fff('0x29')](handleEntityNotFound(_0x520b84,null))[_0x7fff('0x29')](function(_0x43fb79){if(_0x43fb79){return _0x43fb79[_0x7fff('0xa3')](_0x4b1dcd['body']['ids'],_[_0x7fff('0xa4')](_0x4b1dcd['body'],[_0x7fff('0x93'),'id'])||{})[_0x7fff('0xa5')](function(){return db[_0x7fff('0xa6')]['findAll']({'attributes':['id',_0x7fff('0x2b'),_0x7fff('0xa7')],'where':{'id':_0x4b1dcd[_0x7fff('0x2f')][_0x7fff('0x93')]}});})['then'](function(_0x2e47ae){socket[_0x7fff('0xa8')](_0x7fff('0xa9'),{'id':Number(_0x4b1dcd[_0x7fff('0x3e')]['id']),'tags':_0x2e47ae||[]});return{'id':Number(_0x4b1dcd[_0x7fff('0x3e')]['id']),'tags':_0x2e47ae||[]};});}})[_0x7fff('0x29')](respondWithResult(_0x520b84,null))[_0x7fff('0x1e')](handleError(_0x520b84,null));};exports[_0x7fff('0xaa')]=function(_0x4db5de,_0x85136b){return db['ChatInteraction'][_0x7fff('0x4b')]({'where':{'id':_0x4db5de[_0x7fff('0x3e')]['id']}})[_0x7fff('0x29')](handleEntityNotFound(_0x85136b,null))[_0x7fff('0x29')](function(_0x5ab450){if(_0x5ab450){return _0x5ab450['removeTags'](_0x4db5de[_0x7fff('0x3b')][_0x7fff('0x93')]);}})[_0x7fff('0x29')](respondWithStatusCode(_0x85136b,null))[_0x7fff('0x1e')](handleError(_0x85136b,null));};exports[_0x7fff('0x75')]=function(_0x3cf840,_0x261a43){var _0x1b4479=moment()[_0x7fff('0xab')]()[_0x7fff('0xac')]();var _0x1c30f4=path['join'](config[_0x7fff('0x73')],_0x7fff('0xad'),'files',_0x7fff('0xae'));var _0x24c334=path[_0x7fff('0x72')](config['root'],_0x7fff('0xad'),_0x7fff('0xaf'),_0x7fff('0xb0'));var _0x50be2e=path['join'](_0x1c30f4,_0x1b4479);var _0x2622da=util['format'](_0x7fff('0xb1'),_0x3cf840['params']['id'],_0x1b4479);var _0x159c79=path[_0x7fff('0x72')](_0x1c30f4,_0x2622da);var _0x21b94e=[];_0x21b94e[_0x7fff('0xa2')]({'model':db['User'],'as':_0x7fff('0x7c'),'attributes':['id',_0x7fff('0x56')],'raw':!![]});_0x21b94e['push']({'model':db[_0x7fff('0x7d')],'as':'Contact','attributes':['id',_0x7fff('0xb2'),'lastName'],'raw':!![]});if(_0x3cf840['query'][_0x7fff('0xb0')]){_0x21b94e[_0x7fff('0xa2')]({'model':db[_0x7fff('0x70')],'as':'Attachment','raw':!![]});}var _0x33ba6a=[{'model':db[_0x7fff('0x5f')],'as':'Messages','attributes':['id',_0x7fff('0x2f'),_0x7fff('0xb3'),_0x7fff('0x87'),_0x7fff('0x88'),_0x7fff('0xb4')],'include':_0x21b94e}];_0x33ba6a[_0x7fff('0xa2')]({'model':db[_0x7fff('0x4f')],'as':'Account','attributes':['id',_0x7fff('0x2b')]});_0x33ba6a['push']({'model':db[_0x7fff('0x7c')],'as':_0x7fff('0xb5'),'attributes':['id',_0x7fff('0x56')]});return db[_0x7fff('0x4a')][_0x7fff('0x4b')]({'where':{'id':_0x3cf840[_0x7fff('0x3e')]['id']},'include':_0x33ba6a})[_0x7fff('0x29')](handleEntityNotFound(_0x261a43,null))[_0x7fff('0x29')](function(_0x3f17bd){if(_0x3f17bd){var _0x1b3581=_0x3f17bd[_0x7fff('0xb6')]({'plain':!![]});fs[_0x7fff('0xb7')](_0x50be2e);var _0x4bc558={'channel':_0x7fff('0xb8'),'account':_0x1b3581[_0x7fff('0xb9')]['name'],'agent':_0x1b3581[_0x7fff('0xb5')]?_0x1b3581[_0x7fff('0xb5')]['fullname']:_0x7fff('0xba'),'createdAt':moment(_0x1b3581['createdAt'])[_0x7fff('0x78')](_0x7fff('0xbb'))['toString'](),'closedAt':_0x1b3581[_0x7fff('0x67')]?moment(_0x1b3581[_0x7fff('0xbc')])['format'](_0x7fff('0xbb'))['toString']():'','disposition':_0x1b3581[_0x7fff('0x68')],'chatInfo':{'browser':_0x1b3581[_0x7fff('0xbd')],'os':_0x1b3581[_0x7fff('0xbe')],'referer':_0x1b3581[_0x7fff('0xbf')],'customerIp':_0x1b3581[_0x7fff('0xc0')],'customerPort':_0x1b3581[_0x7fff('0xc1')]?_0x1b3581['customerPort']:_0x7fff('0xba')},'messages':_(_0x1b3581[_0x7fff('0x7b')])[_0x7fff('0xc2')]()['filter']({'secret':![]})[_0x7fff('0x35')](function(_0x1bc8ab){if(_0x1bc8ab['Attachment']){var _0x2b2d71=path[_0x7fff('0x72')](_0x24c334,_0x1bc8ab['Attachment'][_0x7fff('0x6c')]);if(fs[_0x7fff('0xc3')](_0x2b2d71)){fs['createReadStream'](_0x2b2d71)[_0x7fff('0xc4')](fs[_0x7fff('0xc5')](path['join'](_0x50be2e,_0x1bc8ab[_0x7fff('0x70')][_0x7fff('0x6c')])));}}return{'date':moment(_0x1bc8ab[_0x7fff('0xb3')])[_0x7fff('0x78')](_0x7fff('0xbb'))[_0x7fff('0xac')](),'sender':_0x1bc8ab[_0x7fff('0x87')]===_0x7fff('0xc6')?_0x1bc8ab['User']?_0x1bc8ab[_0x7fff('0x7c')]['fullname']:_0x7fff('0x85'):_0x1bc8ab[_0x7fff('0xc7')][_0x7fff('0xb2')]+(_0x1bc8ab[_0x7fff('0xc7')][_0x7fff('0xc8')]?'\x20'+_0x1bc8ab[_0x7fff('0xc7')][_0x7fff('0xc8')]:''),'body':_0x1bc8ab[_0x7fff('0x70')]?_0x1bc8ab[_0x7fff('0x70')]['basename']:_0x1bc8ab[_0x7fff('0x2f')],'direction':_0x1bc8ab[_0x7fff('0x87')]===_0x7fff('0xc6')?'A':'C','secret':_0x1bc8ab[_0x7fff('0x88')],'read':_0x1bc8ab[_0x7fff('0xb4')],'attachment':_0x1bc8ab[_0x7fff('0x70')]};})['value']()};return ejs['renderFile'](path[_0x7fff('0x72')](config[_0x7fff('0x73')],_0x7fff('0xad'),_0x7fff('0xc9'),_0x7fff('0xca')),{'interaction':_0x4bc558})['then'](function(_0x504d4d){var _0x3e1159=path['join'](_0x50be2e,_0x7fff('0xcb')+_0x1b3581['id']+'-'+_0x1b4479+_0x7fff('0xcc'));var _0x433c4e={'path':_0x3e1159,'channel':_0x7fff('0xb8'),'interactionId':_0x1b3581['id']};return pdf['createPdfFromHTML'](_0x504d4d,_0x433c4e);})[_0x7fff('0x29')](function(){return new Promise(function(_0x3ca6db,_0x1481bb){zipdir(_0x50be2e,{'saveTo':_0x159c79},function(_0x418737,_0x618339){if(_0x418737)return _0x1481bb(_0x418737);return _0x3ca6db(_0x618339);});})[_0x7fff('0x29')](function(){return new BPromise(function(_0x480ece,_0x157b7d){rimraf(_0x50be2e,function(_0x2f209d){if(_0x2f209d)_0x157b7d(_0x2f209d);return _0x480ece();});});})[_0x7fff('0x29')](function(){return _0x261a43['download'](_0x159c79,_0x2622da,function(_0x568f8b){if(_0x568f8b){logger[_0x7fff('0x1b')](_0x7fff('0xcd'),_0x568f8b);}else{fs[_0x7fff('0xce')](_0x159c79);}});});});}else{return _0x261a43['sendStatus'](0xc8);}})[_0x7fff('0x1e')](handleError(_0x261a43,null));};
\ No newline at end of file
+var _0x3d7e=['entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','attachmentUpload','originalname','basename','filename','file','mimetype','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','now','Messages','User','%s%d','agentAlias','System','Visitor','ContactId','website_alias','agent_alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','intersection','hasOwnProperty','sort','where','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','nolimit','order','includeAgent','alias','addTags','setTags','Tag','emit','chatInteractionTags:save','removeTags','server','files','tmp','attachments','push','firstName','lastName','Attachment','Account','Owner','get','mkdirSync','Chat','closedAt','toString','disposition','browserName','referer','customerPort','N.A.','tail','createReadStream','pipe','createWriteStream','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','zip-dir','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','sendStatus','name','merge','body','contact','agent','interaction','account','index','ChatInteraction','rawAttributes','type','getOptions','findAll','chat','user','show','params','keys','query','filters','model','attributes','fields','length','includeAll','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','metadata','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','ValidationError','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x4b4b4e,_0x341f0c){var _0xf1a943=function(_0x36fb59){while(--_0x36fb59){_0x4b4b4e['push'](_0x4b4b4e['shift']());}};_0xf1a943(++_0x341f0c);}(_0x3d7e,0x133));var _0xe3d7=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0x3d7e[_0x3df223];return _0x562d11;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xe3d7('0x0'));var rp=require('request-promise');var moment=require(_0xe3d7('0x1'));var BPromise=require(_0xe3d7('0x2'));var Mustache=require(_0xe3d7('0x3'));var util=require('util');var path=require(_0xe3d7('0x4'));var ejs=require(_0xe3d7('0x5'));var fs=require('fs');var _=require(_0xe3d7('0x6'));var Redis=require(_0xe3d7('0x7'));var interaction=require(_0xe3d7('0x8'));var qs=require(_0xe3d7('0x9'));var pdf=require(_0xe3d7('0xa'));var logger=require(_0xe3d7('0xb'))(_0xe3d7('0xc'));var config=require(_0xe3d7('0xd'));var db=require(_0xe3d7('0xe'))['db'];config['redis']=_[_0xe3d7('0xf')](config['redis'],{'host':_0xe3d7('0x10'),'port':0x18eb});var socket=require(_0xe3d7('0x11'))(new Redis(config[_0xe3d7('0x12')]));require(_0xe3d7('0x13'))[_0xe3d7('0x14')](socket);var jayson=require(_0xe3d7('0x15'));var client=jayson[_0xe3d7('0x16')][_0xe3d7('0x17')]({'port':0x232b});var client9004=jayson[_0xe3d7('0x16')][_0xe3d7('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x8217e0,_0x2e5042,_0x5efa13,_0x4941fc){return new BPromise(function(_0x518fe3,_0x2a18ef){var _0x367588=_0x4941fc||client;return _0x367588[_0xe3d7('0x18')](_0x8217e0,_0x5efa13)[_0xe3d7('0x19')](function(_0x5c5db4){logger[_0xe3d7('0x1a')](_0xe3d7('0x1b'),_0x2e5042,'request\x20sent');logger['debug'](_0xe3d7('0x1c'),_0x2e5042,_0xe3d7('0x1d'),JSON[_0xe3d7('0x1e')](_0x5c5db4));if(_0x5c5db4['error']){if(_0x5c5db4[_0xe3d7('0x1f')][_0xe3d7('0x20')]===0x1f4){logger[_0xe3d7('0x1f')](_0xe3d7('0x1b'),_0x2e5042,_0x5c5db4['error'][_0xe3d7('0x21')]);return _0x2a18ef(_0x5c5db4[_0xe3d7('0x1f')][_0xe3d7('0x21')]);}logger[_0xe3d7('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x2e5042,_0x5c5db4['error'][_0xe3d7('0x21')]);return _0x518fe3(_0x5c5db4[_0xe3d7('0x1f')][_0xe3d7('0x21')]);}else{logger[_0xe3d7('0x1a')](_0xe3d7('0x1b'),_0x2e5042,_0xe3d7('0x1d'));_0x518fe3(_0x5c5db4[_0xe3d7('0x22')][_0xe3d7('0x21')]);}})[_0xe3d7('0x23')](function(_0x43ae31){logger[_0xe3d7('0x1f')](_0xe3d7('0x1b'),_0x2e5042,_0x43ae31);_0x2a18ef(_0x43ae31);});});}function respondWithStatusCode(_0x55d2ec,_0x1a0adb){_0x1a0adb=_0x1a0adb||0xcc;return function(_0x2589ec){if(_0x2589ec){return _0x55d2ec['sendStatus'](_0x1a0adb);}return _0x55d2ec[_0xe3d7('0x24')](_0x1a0adb)[_0xe3d7('0x25')]();};}function respondWithResult(_0x3d8755,_0x1a5513){_0x1a5513=_0x1a5513||0xc8;return function(_0x1a7a29){if(_0x1a7a29){return _0x3d8755[_0xe3d7('0x24')](_0x1a5513)[_0xe3d7('0x26')](_0x1a7a29);}};}function respondWithFilteredResult(_0x2aa9d8,_0x183e90){return function(_0x21bfcb){if(_0x21bfcb){var _0x20328a=typeof _0x183e90[_0xe3d7('0x27')]===_0xe3d7('0x28')&&typeof _0x183e90[_0xe3d7('0x29')]===_0xe3d7('0x28');var _0x159d05=_0x21bfcb[_0xe3d7('0x2a')];var _0x2df044=_0x20328a?0x0:_0x183e90[_0xe3d7('0x27')];var _0x2c0e5d=_0x20328a?_0x21bfcb['count']:_0x183e90[_0xe3d7('0x27')]+_0x183e90[_0xe3d7('0x29')];var _0x316ee3;if(_0x2c0e5d>=_0x159d05){_0x2c0e5d=_0x159d05;_0x316ee3=0xc8;}else{_0x316ee3=0xce;}_0x2aa9d8['status'](_0x316ee3);return _0x2aa9d8[_0xe3d7('0x2b')](_0xe3d7('0x2c'),_0x2df044+'-'+_0x2c0e5d+'/'+_0x159d05)[_0xe3d7('0x26')](_0x21bfcb);}return null;};}function saveUpdates(_0x5f30c2){return function(_0x165a29){if(_0x165a29){return _0x165a29[_0xe3d7('0x2d')](_0x5f30c2)[_0xe3d7('0x19')](function(_0x246421){return _0x246421;});}return null;};}function removeEntity(_0x545862){return function(_0x444236){if(_0x444236){return _0x444236[_0xe3d7('0x2e')]()[_0xe3d7('0x19')](function(){_0x545862[_0xe3d7('0x24')](0xcc)[_0xe3d7('0x25')]();});}};}function handleEntityNotFound(_0x4fa5f2){return function(_0x2bf64e){if(!_0x2bf64e){_0x4fa5f2[_0xe3d7('0x2f')](0x194);}return _0x2bf64e;};}function handleError(_0xcc39e9,_0x46fcf9){_0x46fcf9=_0x46fcf9||0x1f4;return function(_0x42fd61){logger['error'](_0x42fd61['stack']);if(_0x42fd61[_0xe3d7('0x30')]){delete _0x42fd61[_0xe3d7('0x30')];}_0xcc39e9[_0xe3d7('0x24')](_0x46fcf9)['send'](_0x42fd61);};}function getMustacheRender(_0xa93ba3,_0x2644f8){return Mustache['render'](_0xa93ba3,_[_0xe3d7('0x31')](_0x2644f8[_0xe3d7('0x32')],{'contact':_0x2644f8[_0xe3d7('0x33')],'message':_0x2644f8[_0xe3d7('0x21')],'agent':_0x2644f8[_0xe3d7('0x34')],'interaction':_0x2644f8[_0xe3d7('0x35')],'account':_0x2644f8[_0xe3d7('0x36')]}))||'';}exports[_0xe3d7('0x37')]=function(_0x464c01,_0x1ad0f3){var _0x3f8c46={};var _0x142be5=_['map'](db[_0xe3d7('0x38')][_0xe3d7('0x39')],function(_0x48862e){return{'name':_0x48862e['fieldName'],'type':_0x48862e[_0xe3d7('0x3a')]['key']};});_0x3f8c46=qs[_0xe3d7('0x3b')](_0x142be5,_0x464c01);return interaction[_0xe3d7('0x3c')](_0xe3d7('0x3d'),_0x464c01['query'],_0x464c01[_0xe3d7('0x3e')],_0x3f8c46,_0x142be5)[_0xe3d7('0x19')](respondWithFilteredResult(_0x1ad0f3,_0x3f8c46))[_0xe3d7('0x23')](handleError(_0x1ad0f3,null));};exports[_0xe3d7('0x3f')]=function(_0x55a53c,_0x2d3468){var _0x39b9f4={'raw':![],'where':{'id':_0x55a53c[_0xe3d7('0x40')]['id']}},_0x57a2ea={};_0x57a2ea['model']=_[_0xe3d7('0x41')](db[_0xe3d7('0x38')][_0xe3d7('0x39')]);_0x57a2ea[_0xe3d7('0x42')]=_[_0xe3d7('0x41')](_0x55a53c[_0xe3d7('0x42')]);_0x57a2ea[_0xe3d7('0x43')]=_['intersection'](_0x57a2ea[_0xe3d7('0x44')],_0x57a2ea['query']);_0x39b9f4[_0xe3d7('0x45')]=_['intersection'](_0x57a2ea[_0xe3d7('0x44')],qs['fields'](_0x55a53c[_0xe3d7('0x42')][_0xe3d7('0x46')]));_0x39b9f4[_0xe3d7('0x45')]=_0x39b9f4[_0xe3d7('0x45')][_0xe3d7('0x47')]?_0x39b9f4[_0xe3d7('0x45')]:_0x57a2ea[_0xe3d7('0x44')];if(_0x55a53c['query'][_0xe3d7('0x48')]){_0x39b9f4[_0xe3d7('0x49')]=[{'all':!![]}];}_0x39b9f4=_['merge']({},_0x39b9f4,_0x55a53c[_0xe3d7('0x4a')]);return db[_0xe3d7('0x38')][_0xe3d7('0x4b')](_0x39b9f4)[_0xe3d7('0x19')](handleEntityNotFound(_0x2d3468,null))['then'](respondWithResult(_0x2d3468,null))[_0xe3d7('0x23')](handleError(_0x2d3468,null));};exports[_0xe3d7('0x4c')]=function(_0x21e94f,_0x10b7fa){return db[_0xe3d7('0x38')]['create'](_0x21e94f[_0xe3d7('0x32')],{})[_0xe3d7('0x19')](respondWithResult(_0x10b7fa,0xc9))['catch'](handleError(_0x10b7fa,null));};exports[_0xe3d7('0x2d')]=function(_0x21e00c,_0x32deff){if(_0x21e00c[_0xe3d7('0x32')]['id']){delete _0x21e00c[_0xe3d7('0x32')]['id'];}return db[_0xe3d7('0x38')]['find']({'where':{'id':_0x21e00c[_0xe3d7('0x40')]['id']}})[_0xe3d7('0x19')](handleEntityNotFound(_0x32deff,null))[_0xe3d7('0x19')](saveUpdates(_0x21e00c[_0xe3d7('0x32')],null))['then'](respondWithResult(_0x32deff,null))[_0xe3d7('0x23')](handleError(_0x32deff,null));};exports[_0xe3d7('0x2e')]=function(_0x49b2be,_0x32f7db){return db['ChatInteraction'][_0xe3d7('0x4b')]({'where':{'id':_0x49b2be[_0xe3d7('0x40')]['id']}})['then'](handleEntityNotFound(_0x32f7db,null))[_0xe3d7('0x19')](removeEntity(_0x32f7db,null))[_0xe3d7('0x23')](handleError(_0x32f7db,null));};exports[_0xe3d7('0x4d')]=function(_0x3036ff,_0x5befd9){return db[_0xe3d7('0x38')]['describe']()['then'](respondWithResult(_0x5befd9,null))[_0xe3d7('0x23')](handleError(_0x5befd9,null));};exports[_0xe3d7('0x4e')]=function(_0x5d4644,_0x397d13){var _0x3ef358=_0x5d4644[_0xe3d7('0x40')]['id'];var _0x17fe58;var _0x3ed197;var _0x2055c2;return db[_0xe3d7('0x38')][_0xe3d7('0x4f')]({'where':{'id':_0x3ef358}})[_0xe3d7('0x19')](function(_0x687293){_0x17fe58=_0x687293;return db['ChatWebsite'][_0xe3d7('0x4f')]({'where':{'id':_0x687293[_0xe3d7('0x50')]},'attributes':['id','vidaooApiKey','vidaooEscalation',_0xe3d7('0x51'),_0xe3d7('0x52'),_0xe3d7('0x53')],'raw':!![]});})['then'](function(_0x2c354b){if(_0x2c354b&&_0x2c354b[_0xe3d7('0x54')]&&_0x2c354b['vidaooEscalation']){_0x3ed197=_0x2c354b;var _0x1ad71f={'interaction':{'id':_0x3ef358},'agent':{'id':_0x5d4644[_0xe3d7('0x3e')]['id'],'name':_0x5d4644[_0xe3d7('0x3e')][_0xe3d7('0x30')],'fullname':_0x5d4644[_0xe3d7('0x3e')][_0xe3d7('0x55')],'email':_0x5d4644[_0xe3d7('0x3e')][_0xe3d7('0x56')]},'contact':_0x5d4644['body'][_0xe3d7('0x33')],'account':_0x5d4644[_0xe3d7('0x32')][_0xe3d7('0x36')]};var _0x57d18f={'rejectUnauthorized':![],'method':'POST','url':_0xe3d7('0x57'),'headers':{'X-APIKEY':_0x2c354b['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5d4644[_0xe3d7('0x3e')][_0xe3d7('0x56')]],'buttons':null,'topic':_0x3ed197['vidaooTopic'],'note':_['isNull'](_0x3ed197[_0xe3d7('0x52')])?null:getMustacheRender(_0x3ed197[_0xe3d7('0x52')],_0x1ad71f),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xe3d7('0x58')](_0x3ed197['vidaooMetadata'])){var _0x4b9300=getMustacheRender(_0x3ed197[_0xe3d7('0x53')],_0x1ad71f);var _0x113998=JSON[_0xe3d7('0x59')](_0x4b9300);_0x57d18f[_0xe3d7('0x32')][_0xe3d7('0x5a')]=_0x113998;}}catch(_0x214f82){throw new db['Sequelize']['ValidationError'](_0xe3d7('0x5b'));}return rp(_0x57d18f);}else{throw new db[(_0xe3d7('0x5c'))][(_0xe3d7('0x5d'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xe3d7('0x19')](function(_0x297581){_0x2055c2=_0x297581;if(_0x2055c2['id']){var _0x25d5fb={'body':_0x2055c2['join_url'],'ChatWebsiteId':_0x3ed197['id'],'ChatInteractionId':_0x17fe58['id'],'direction':_0xe3d7('0x5e'),'UserId':_0x5d4644['user']['id']};return db[_0xe3d7('0x5f')]['create'](_0x25d5fb,{});}else{throw new db[(_0xe3d7('0x5c'))]['ValidationError'](_0xe3d7('0x60'));}})[_0xe3d7('0x19')](function(){return _0x17fe58[_0xe3d7('0x61')]({'vidaooSessionId':_0x2055c2['id']});})[_0xe3d7('0x19')](respondWithResult(_0x397d13,null))[_0xe3d7('0x23')](handleError(_0x397d13,null));};exports[_0xe3d7('0x62')]=function(_0xa76c6e,_0x3f5749){if(_0xa76c6e[_0xe3d7('0x32')]['id']){delete _0xa76c6e[_0xe3d7('0x32')]['id'];}return db[_0xe3d7('0x38')][_0xe3d7('0x4b')]({'where':{'id':_0xa76c6e[_0xe3d7('0x40')]['id']},'include':[{'model':db[_0xe3d7('0x63')],'as':_0xe3d7('0x64')}]})[_0xe3d7('0x19')](handleEntityNotFound(_0x3f5749,null))['then'](saveUpdates(_0xa76c6e[_0xe3d7('0x32')],null))['then'](respondWithResult(_0x3f5749,null))[_0xe3d7('0x23')](handleError(_0x3f5749,null));};exports[_0xe3d7('0x65')]=function(_0xa59867,_0x1ddac0){if(_0xa59867[_0xe3d7('0x32')]['id']){delete _0xa59867[_0xe3d7('0x32')]['id'];}return db[_0xe3d7('0x38')]['find']({'where':{'id':_0xa59867[_0xe3d7('0x40')]['id']}})[_0xe3d7('0x19')](function(_0x4c291e){if(!_0x4c291e){logger['error'](_0xe3d7('0x66'),_0xe3d7('0x65'),0x194,_0xe3d7('0x67'));_0x1ddac0[_0xe3d7('0x2f')](0x194);}else{if(_0x4c291e[_0xe3d7('0x68')]){throw new db[(_0xe3d7('0x5c'))][(_0xe3d7('0x5d'))](_0xe3d7('0x69'));}}return _0x4c291e;})[_0xe3d7('0x19')](function(_0x3022ed){if(_0x3022ed){return _0x3022ed['update']({'closed':_0xa59867['body'][_0xe3d7('0x6a')],'disposition':_0xa59867[_0xe3d7('0x32')]['disposition']})['then'](function(_0x37b4c0){return _0x37b4c0;});}})[_0xe3d7('0x19')](function(){return respondWithRpcPromise('AbandonInteraction',_0xe3d7('0x65'),_0xa59867[_0xe3d7('0x32')],client9004);})[_0xe3d7('0x19')](respondWithResult(_0x1ddac0,null))[_0xe3d7('0x23')](handleError(_0x1ddac0,null));};exports[_0xe3d7('0x6b')]=function(_0x1cfc67,_0x46d178){_0x1cfc67[_0xe3d7('0x32')]['name']=_0x1cfc67['file'][_0xe3d7('0x6c')];_0x1cfc67[_0xe3d7('0x32')][_0xe3d7('0x6d')]=_0x1cfc67['file'][_0xe3d7('0x6e')];_0x1cfc67[_0xe3d7('0x32')]['type']=_0x1cfc67[_0xe3d7('0x6f')][_0xe3d7('0x70')];return db['Attachment'][_0xe3d7('0x4c')](_0x1cfc67[_0xe3d7('0x32')])['then'](respondWithResult(_0x46d178,0xc9))[_0xe3d7('0x23')](handleError(_0x46d178,null));};exports[_0xe3d7('0x71')]=function(_0x54826d,_0x31578f){return db[_0xe3d7('0x38')][_0xe3d7('0x4f')]({'where':{'id':_0x54826d[_0xe3d7('0x40')]['id']},'raw':!![]})[_0xe3d7('0x19')](handleEntityNotFound(_0x31578f,null))['then'](function(_0x58faa5){if(_0x58faa5){if(_0x58faa5[_0xe3d7('0x6a')]){return _0x31578f['status'](0x193)[_0xe3d7('0x26')]({'status':0x193,'message':_0xe3d7('0x72')});}return db['Attachment'][_0xe3d7('0x4f')]({'where':{'id':_0x54826d[_0xe3d7('0x42')][_0xe3d7('0x73')]},'raw':!![]})[_0xe3d7('0x19')](handleEntityNotFound(_0x31578f,null));}})[_0xe3d7('0x19')](function(_0x23e9a3){if(_0x23e9a3){var _0x4220ba=_0x23e9a3[_0xe3d7('0x74')]!==null;var _0x1d1ab9=path['join'](config[_0xe3d7('0x75')],_0xe3d7('0x76'));if(_0x4220ba){_0x1d1ab9=path[_0xe3d7('0x77')](_0x1d1ab9,_0xe3d7('0x78'));}var _0x1b6c53=path[_0xe3d7('0x77')](_0x1d1ab9,_0x23e9a3[_0xe3d7('0x6d')]);return _0x31578f[_0xe3d7('0x79')](_0x1b6c53);}})[_0xe3d7('0x23')](handleError(_0x31578f,null));};exports[_0xe3d7('0x7a')]=function(_0x12582e,_0x28b098){var _0x2ada23=null;var _0x292d2f=null;var _0x19af44=null;if(_0x12582e['body']['id']){delete _0x12582e[_0xe3d7('0x32')]['id'];}if(_0x12582e[_0xe3d7('0x32')][_0xe3d7('0x7b')]){_0x19af44=path[_0xe3d7('0x77')](config[_0xe3d7('0x75')],_0xe3d7('0x7c'),util[_0xe3d7('0x7d')]('transcript-%s.txt',Date[_0xe3d7('0x7e')]()));_0x12582e[_0xe3d7('0x32')]['pathTranscript']=_0x19af44;}return db[_0xe3d7('0x38')]['find']({'where':{'id':_0x12582e[_0xe3d7('0x40')]['id']},'include':[{'model':db[_0xe3d7('0x5f')],'as':_0xe3d7('0x7f'),'include':[{'model':db[_0xe3d7('0x80')],'as':'User'}]}]})[_0xe3d7('0x19')](handleEntityNotFound(_0x28b098,null))[_0xe3d7('0x19')](saveUpdates(_0x12582e[_0xe3d7('0x32')],null))[_0xe3d7('0x19')](function(_0x188067){if(_0x188067){_0x2ada23=_0x188067;return db['ChatWebsite'][_0xe3d7('0x4b')]({'where':{'id':_0x2ada23['ChatWebsiteId']}});}})[_0xe3d7('0x19')](function(_0x8e9812){if(_0x8e9812){_0x292d2f=_0x8e9812;return db[_0xe3d7('0x63')][_0xe3d7('0x4b')]({'where':{'id':_0x2ada23['ContactId']}});}})[_0xe3d7('0x19')](function(_0x2ee191){if(_0x2ee191){if(_0x19af44){var _0x236da5=null;for(var _0x3cd5b0=0x1;_0x3cd5b0<_0x2ada23[_0xe3d7('0x7f')][_0xe3d7('0x47')];++_0x3cd5b0){_0x236da5=_0x2ada23[_0xe3d7('0x7f')][_0x3cd5b0];var _0x4db57e=_0x236da5['UserId']?util[_0xe3d7('0x7d')](_0xe3d7('0x81'),_0x292d2f[_0xe3d7('0x82')],_0x236da5['UserId']):_0xe3d7('0x83');var _0x5bb26c=_0x12582e[_0xe3d7('0x32')]['customer']||util[_0xe3d7('0x7d')](_0xe3d7('0x81'),_0xe3d7('0x84'),_0x236da5[_0xe3d7('0x85')]);switch(_0x292d2f['agentIdentifier']){case _0xe3d7('0x86'):_0x4db57e=_0x236da5[_0xe3d7('0x68')]?util[_0xe3d7('0x7d')]('%s%d',_0x292d2f[_0xe3d7('0x82')],_0x236da5[_0xe3d7('0x68')]):_0xe3d7('0x83');break;case _0xe3d7('0x87'):_0x4db57e=_0x236da5[_0xe3d7('0x68')]?_0x236da5[_0xe3d7('0x80')]['alias']||_0x236da5[_0xe3d7('0x80')]['fullname']:_0xe3d7('0x83');break;case _0xe3d7('0x88'):_0x4db57e=_0x236da5[_0xe3d7('0x68')]?_0x236da5[_0xe3d7('0x80')][_0xe3d7('0x55')]:_0xe3d7('0x83');break;default:_0x4db57e=_0x236da5[_0xe3d7('0x68')]?util['format']('%s%d',_0x292d2f['agentAlias'],_0x236da5['UserId']):_0xe3d7('0x83');}var _0x57e033=util[_0xe3d7('0x7d')]('[%s]\x20%s:\x20%s\x0a',moment(_0x236da5[_0xe3d7('0x89')])[_0xe3d7('0x7d')](_0xe3d7('0x8a')),_0x236da5[_0xe3d7('0x8b')]==='in'?_0x5bb26c:_0x4db57e,_0x236da5[_0xe3d7('0x32')]);if(!_0x236da5[_0xe3d7('0x8c')]){fs['appendFileSync'](_0x19af44,_0x57e033);}}return db[_0xe3d7('0x8d')][_0xe3d7('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0xe3d7('0x8e')],'as':_0xe3d7('0x8f'),'raw':!![],'include':[{'model':db[_0xe3d7('0x90')],'as':_0xe3d7('0x90'),'raw':!![]}]}]});}}})[_0xe3d7('0x19')](function(_0x1975ff){if(!_0x1975ff||!_0x1975ff[_0xe3d7('0x8f')]||!_0x12582e['body'])return _0x2ada23;var _0x32b15c=_0x1975ff[_0xe3d7('0x91')]();return respondWithRpcPromise(_0xe3d7('0x92'),_0xe3d7('0x93'),{'account':_0x32b15c,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1975ff[_0xe3d7('0x30')],_0x1975ff['email']||_0x1975ff['Smtp'][_0xe3d7('0x3e')]),'to':_0x12582e[_0xe3d7('0x32')][_0xe3d7('0x7b')],'subject':_0xe3d7('0x94'),'text':util[_0xe3d7('0x7d')](_0xe3d7('0x95'),_0x12582e['body'][_0xe3d7('0x7b')]),'attachments':[{'path':_0x19af44}]}})[_0xe3d7('0x19')](function(){return _0x2ada23;})[_0xe3d7('0x23')](function(_0x12e2f5){logger[_0xe3d7('0x1f')](_0x12e2f5);});})[_0xe3d7('0x19')](respondWithStatusCode(_0x28b098,0xc8))[_0xe3d7('0x23')](handleError(_0x28b098,null));};exports['addMessage']=function(_0x2f6a65,_0x1d3a0c){return db[_0xe3d7('0x5f')][_0xe3d7('0x4b')]({'where':{'id':_0x2f6a65[_0xe3d7('0x40')]['id']}})[_0xe3d7('0x19')](handleEntityNotFound(_0x1d3a0c,null))['then'](function(_0xfbe9e5){if(_0xfbe9e5){return _0xfbe9e5[_0xe3d7('0x96')](_0x2f6a65['body'][_0xe3d7('0x97')],_[_0xe3d7('0x98')](_0x2f6a65['body'],['ids','id'])||{});}})[_0xe3d7('0x19')](respondWithResult(_0x1d3a0c,null))[_0xe3d7('0x23')](handleError(_0x1d3a0c,null));};exports[_0xe3d7('0x99')]=function(_0x1a1711,_0x434abd){var _0x23bead={'raw':![],'where':{}};var _0x4881c8={};var _0x3ed29b={'count':0x0,'rows':[]};return db[_0xe3d7('0x38')][_0xe3d7('0x4f')]({'where':{'id':_0x1a1711['params']['id']}})[_0xe3d7('0x19')](handleEntityNotFound(_0x434abd,null))[_0xe3d7('0x19')](function(_0x284d27){if(_0x284d27){_0x4881c8['model']=_['keys'](db[_0xe3d7('0x5f')]['rawAttributes']);_0x4881c8[_0xe3d7('0x42')]=_[_0xe3d7('0x41')](_0x1a1711['query']);_0x4881c8[_0xe3d7('0x43')]=_[_0xe3d7('0x9a')](_0x4881c8[_0xe3d7('0x44')],_0x4881c8[_0xe3d7('0x42')]);_0x23bead[_0xe3d7('0x45')]=_[_0xe3d7('0x9a')](_0x4881c8['model'],qs['fields'](_0x1a1711[_0xe3d7('0x42')][_0xe3d7('0x46')]));_0x23bead[_0xe3d7('0x45')]=_0x23bead[_0xe3d7('0x45')][_0xe3d7('0x47')]?_0x23bead['attributes']:_0x4881c8[_0xe3d7('0x44')];if(!_0x1a1711[_0xe3d7('0x42')][_0xe3d7('0x9b')]('nolimit')){_0x23bead[_0xe3d7('0x29')]=qs[_0xe3d7('0x29')](_0x1a1711[_0xe3d7('0x42')][_0xe3d7('0x29')]);_0x23bead['offset']=qs[_0xe3d7('0x27')](_0x1a1711[_0xe3d7('0x42')][_0xe3d7('0x27')]);}_0x23bead['order']=qs[_0xe3d7('0x9c')](_0x1a1711['query'][_0xe3d7('0x9c')]);_0x23bead[_0xe3d7('0x9d')]=qs[_0xe3d7('0x43')](_['pick'](_0x1a1711[_0xe3d7('0x42')],_0x4881c8[_0xe3d7('0x43')]));_0x23bead[_0xe3d7('0x9d')][_0xe3d7('0x9e')]=_0x284d27['id'];if(_0x1a1711[_0xe3d7('0x42')][_0xe3d7('0x9f')]){_0x23bead[_0xe3d7('0x9d')]=_[_0xe3d7('0x31')](_0x23bead['where'],{'$or':_['map'](_0x23bead[_0xe3d7('0x45')],function(_0x1eab8d){var _0x192a4b={};_0x192a4b[_0x1eab8d]={'$like':'%'+_0x1a1711[_0xe3d7('0x42')][_0xe3d7('0x9f')]+'%'};return _0x192a4b;})});}if(_0x1a1711['query'][_0xe3d7('0xa0')]){var _0x26484b=_0x1a1711[_0xe3d7('0x42')][_0xe3d7('0xa0')]['split'](',');var _0x2a0eed={};_0x2a0eed[_0x26484b[0x0]]={'$gte':moment(_0x26484b[0x1])[_0xe3d7('0x7d')](_0xe3d7('0xa1'))};_0x23bead['where']=_['merge'](_0x23bead['where'],_0x2a0eed);}_0x23bead=_[_0xe3d7('0x31')]({},_0x23bead,_0x1a1711['options']);return db['ChatMessage'][_0xe3d7('0x2a')]({'where':_0x23bead[_0xe3d7('0x9d')]})[_0xe3d7('0x19')](function(_0x3f402c){_0x3ed29b[_0xe3d7('0x2a')]=_0x3f402c;if(_0x1a1711[_0xe3d7('0x42')][_0xe3d7('0x48')]){_0x23bead[_0xe3d7('0x49')]=[{'all':!![]}];}return db[_0xe3d7('0x5f')][_0xe3d7('0x3c')](_0x23bead);})['then'](function(_0x21e252){_0x3ed29b[_0xe3d7('0xa2')]=_0x21e252;return _0x3ed29b;});}})['then'](respondWithFilteredResult(_0x434abd,_0x23bead))[_0xe3d7('0x23')](handleError(_0x434abd,null));};exports[_0xe3d7('0xa3')]=function(_0x404053,_0x242949){var _0x5ae2db={'where':{}},_0x30c228={},_0xe35f4={'count':0x0,'rows':[]};return db[_0xe3d7('0x38')][_0xe3d7('0x4f')]({'where':{'id':_0x404053[_0xe3d7('0x40')]['id']}})[_0xe3d7('0x19')](handleEntityNotFound(_0x242949,null))['then'](function(_0x39ac3d){if(_0x39ac3d){_0x30c228['model']=_['keys'](db[_0xe3d7('0x5f')][_0xe3d7('0x39')]);_0x30c228[_0xe3d7('0x42')]=_[_0xe3d7('0x41')](_0x404053[_0xe3d7('0x42')]);_0x30c228['filters']=_['intersection'](_0x30c228[_0xe3d7('0x44')],_0x30c228[_0xe3d7('0x42')]);_0x5ae2db[_0xe3d7('0x45')]=_[_0xe3d7('0x9a')](_0x30c228[_0xe3d7('0x44')],qs[_0xe3d7('0x46')](_0x404053[_0xe3d7('0x42')][_0xe3d7('0x46')]));_0x5ae2db[_0xe3d7('0x45')]=_0x5ae2db[_0xe3d7('0x45')][_0xe3d7('0x47')]?_0x5ae2db[_0xe3d7('0x45')]:_0x30c228[_0xe3d7('0x44')];if(!_0x404053[_0xe3d7('0x42')][_0xe3d7('0x9b')](_0xe3d7('0xa4'))){_0x5ae2db[_0xe3d7('0x29')]=qs[_0xe3d7('0x29')](_0x404053[_0xe3d7('0x42')][_0xe3d7('0x29')]);_0x5ae2db[_0xe3d7('0x27')]=qs[_0xe3d7('0x27')](_0x404053[_0xe3d7('0x42')]['offset']);}_0x5ae2db[_0xe3d7('0xa5')]=qs[_0xe3d7('0x9c')](_0x404053[_0xe3d7('0x42')]['sort']);_0x5ae2db['where']=qs[_0xe3d7('0x43')](_['pick'](_0x404053[_0xe3d7('0x42')],_0x30c228[_0xe3d7('0x43')]));_0x5ae2db[_0xe3d7('0x9d')][_0xe3d7('0x9e')]=_0x39ac3d['id'];if(_0x404053[_0xe3d7('0x42')]['filter']){_0x5ae2db[_0xe3d7('0x9d')]=_['merge'](_0x5ae2db[_0xe3d7('0x9d')],{'$or':_['map'](_0x5ae2db[_0xe3d7('0x45')],function(_0x2e1d5c){var _0x4e3acd={};_0x4e3acd[_0x2e1d5c]={'$like':'%'+_0x404053[_0xe3d7('0x42')][_0xe3d7('0x9f')]+'%'};return _0x4e3acd;})});}_0x5ae2db['where'][_0xe3d7('0x8c')]=![];if(_0x404053['query']['id']){_0x5ae2db['where']['id']={'$gt':_0x404053[_0xe3d7('0x42')]['id']};}_0x5ae2db=_[_0xe3d7('0x31')]({},_0x5ae2db,_0x404053[_0xe3d7('0x4a')]);return db[_0xe3d7('0x5f')][_0xe3d7('0x2a')]({'where':_0x5ae2db[_0xe3d7('0x9d')]})[_0xe3d7('0x19')](function(_0x22a518){_0xe35f4[_0xe3d7('0x2a')]=_0x22a518;_0x5ae2db['include']=[];if(_0x404053[_0xe3d7('0x42')][_0xe3d7('0xa6')]){_0x5ae2db[_0xe3d7('0x49')]['push']({'model':db['User'],'as':'User','attributes':['id',_0xe3d7('0x55'),_0xe3d7('0xa7')]});}if(_0x404053[_0xe3d7('0x42')][_0xe3d7('0x48')]){_0x5ae2db[_0xe3d7('0x49')]=[{'all':!![]}];}return db[_0xe3d7('0x5f')][_0xe3d7('0x3c')](_0x5ae2db);})[_0xe3d7('0x19')](function(_0x22a42d){_0xe35f4[_0xe3d7('0xa2')]=_0x22a42d;return _0xe35f4;});}})['then'](respondWithFilteredResult(_0x242949,_0x5ae2db))[_0xe3d7('0x23')](handleError(_0x242949,null));};exports[_0xe3d7('0xa8')]=function(_0x3022c4,_0x5cd74b){return db[_0xe3d7('0x38')]['find']({'where':{'id':_0x3022c4[_0xe3d7('0x40')]['id']}})['then'](handleEntityNotFound(_0x5cd74b,null))[_0xe3d7('0x19')](function(_0x1cb3c5){if(_0x1cb3c5){return _0x1cb3c5[_0xe3d7('0xa9')](_0x3022c4[_0xe3d7('0x32')][_0xe3d7('0x97')],_[_0xe3d7('0x98')](_0x3022c4[_0xe3d7('0x32')],['ids','id'])||{})['spread'](function(){return db[_0xe3d7('0xaa')][_0xe3d7('0x3c')]({'attributes':['id',_0xe3d7('0x30'),'color'],'where':{'id':_0x3022c4['body'][_0xe3d7('0x97')]}});})['then'](function(_0x49de37){socket[_0xe3d7('0xab')](_0xe3d7('0xac'),{'id':Number(_0x3022c4['params']['id']),'tags':_0x49de37||[]});return{'id':Number(_0x3022c4[_0xe3d7('0x40')]['id']),'tags':_0x49de37||[]};});}})['then'](respondWithResult(_0x5cd74b,null))[_0xe3d7('0x23')](handleError(_0x5cd74b,null));};exports[_0xe3d7('0xad')]=function(_0x258982,_0x3f500c){return db[_0xe3d7('0x38')][_0xe3d7('0x4b')]({'where':{'id':_0x258982[_0xe3d7('0x40')]['id']}})['then'](handleEntityNotFound(_0x3f500c,null))[_0xe3d7('0x19')](function(_0x3faa22){if(_0x3faa22){return _0x3faa22[_0xe3d7('0xad')](_0x258982[_0xe3d7('0x42')][_0xe3d7('0x97')]);}})[_0xe3d7('0x19')](respondWithStatusCode(_0x3f500c,null))[_0xe3d7('0x23')](handleError(_0x3f500c,null));};exports[_0xe3d7('0x79')]=function(_0x1acf73,_0x304340){var _0xdef376=moment()['unix']()['toString']();var _0x50be80=path[_0xe3d7('0x77')](config[_0xe3d7('0x75')],_0xe3d7('0xae'),_0xe3d7('0xaf'),_0xe3d7('0xb0'));var _0x274b8c=path[_0xe3d7('0x77')](config[_0xe3d7('0x75')],_0xe3d7('0xae'),_0xe3d7('0xaf'),_0xe3d7('0xb1'));var _0x3cc87e=path[_0xe3d7('0x77')](_0x50be80,_0xdef376);var _0x28d423=util[_0xe3d7('0x7d')]('transcript-%d-%s.zip',_0x1acf73['params']['id'],_0xdef376);var _0xe78852=path['join'](_0x50be80,_0x28d423);var _0x31ae0e=[];_0x31ae0e[_0xe3d7('0xb2')]({'model':db[_0xe3d7('0x80')],'as':_0xe3d7('0x80'),'attributes':['id',_0xe3d7('0x55')],'raw':!![]});_0x31ae0e[_0xe3d7('0xb2')]({'model':db['CmContact'],'as':_0xe3d7('0x64'),'attributes':['id',_0xe3d7('0xb3'),_0xe3d7('0xb4')],'raw':!![]});if(_0x1acf73[_0xe3d7('0x42')][_0xe3d7('0xb1')]){_0x31ae0e[_0xe3d7('0xb2')]({'model':db[_0xe3d7('0xb5')],'as':'Attachment','raw':!![]});}var _0x1ab073=[{'model':db[_0xe3d7('0x5f')],'as':_0xe3d7('0x7f'),'attributes':['id','body',_0xe3d7('0x89'),_0xe3d7('0x8b'),_0xe3d7('0x8c'),'read'],'include':_0x31ae0e}];_0x1ab073[_0xe3d7('0xb2')]({'model':db['ChatWebsite'],'as':_0xe3d7('0xb6'),'attributes':['id',_0xe3d7('0x30')]});_0x1ab073[_0xe3d7('0xb2')]({'model':db['User'],'as':_0xe3d7('0xb7'),'attributes':['id',_0xe3d7('0x55')]});return db[_0xe3d7('0x38')][_0xe3d7('0x4b')]({'where':{'id':_0x1acf73[_0xe3d7('0x40')]['id']},'include':_0x1ab073})['then'](handleEntityNotFound(_0x304340,null))[_0xe3d7('0x19')](function(_0x4f0d21){if(_0x4f0d21){var _0x1a25d9=_0x4f0d21[_0xe3d7('0xb8')]({'plain':!![]});fs[_0xe3d7('0xb9')](_0x3cc87e);var _0x3a35ab={'channel':_0xe3d7('0xba'),'account':_0x1a25d9[_0xe3d7('0xb6')][_0xe3d7('0x30')],'agent':_0x1a25d9[_0xe3d7('0xb7')]?_0x1a25d9[_0xe3d7('0xb7')][_0xe3d7('0x55')]:'N.A.','createdAt':moment(_0x1a25d9[_0xe3d7('0x89')])[_0xe3d7('0x7d')](_0xe3d7('0xa1'))['toString'](),'closedAt':_0x1a25d9['closed']?moment(_0x1a25d9[_0xe3d7('0xbb')])['format'](_0xe3d7('0xa1'))[_0xe3d7('0xbc')]():'','disposition':_0x1a25d9[_0xe3d7('0xbd')],'chatInfo':{'browser':_0x1a25d9[_0xe3d7('0xbe')],'os':_0x1a25d9['osName'],'referer':_0x1a25d9[_0xe3d7('0xbf')],'customerIp':_0x1a25d9['customerIp'],'customerPort':_0x1a25d9[_0xe3d7('0xc0')]?_0x1a25d9[_0xe3d7('0xc0')]:_0xe3d7('0xc1')},'messages':_(_0x1a25d9[_0xe3d7('0x7f')])[_0xe3d7('0xc2')]()[_0xe3d7('0x9f')]({'secret':![]})['map'](function(_0x416a57){if(_0x416a57[_0xe3d7('0xb5')]){var _0x5aa021=path['join'](_0x274b8c,_0x416a57['Attachment'][_0xe3d7('0x6d')]);if(fs['existsSync'](_0x5aa021)){fs[_0xe3d7('0xc3')](_0x5aa021)[_0xe3d7('0xc4')](fs[_0xe3d7('0xc5')](path[_0xe3d7('0x77')](_0x3cc87e,_0x416a57[_0xe3d7('0xb5')]['basename'])));}}return{'date':moment(_0x416a57[_0xe3d7('0x89')])['format'](_0xe3d7('0xa1'))[_0xe3d7('0xbc')](),'sender':_0x416a57[_0xe3d7('0x8b')]===_0xe3d7('0x5e')?_0x416a57[_0xe3d7('0x80')]?_0x416a57[_0xe3d7('0x80')][_0xe3d7('0x55')]:_0xe3d7('0x83'):_0x416a57[_0xe3d7('0x64')][_0xe3d7('0xb3')]+(_0x416a57['Contact']['lastName']?'\x20'+_0x416a57['Contact'][_0xe3d7('0xb4')]:''),'body':_0x416a57[_0xe3d7('0xb5')]?_0x416a57['Attachment'][_0xe3d7('0x6d')]:_0x416a57['body'],'direction':_0x416a57[_0xe3d7('0x8b')]===_0xe3d7('0x5e')?'A':'C','secret':_0x416a57[_0xe3d7('0x8c')],'read':_0x416a57['read'],'attachment':_0x416a57[_0xe3d7('0xb5')]};})[_0xe3d7('0xc6')]()};return ejs['renderFile'](path[_0xe3d7('0x77')](config[_0xe3d7('0x75')],_0xe3d7('0xae'),_0xe3d7('0xc7'),_0xe3d7('0xc8')),{'interaction':_0x3a35ab})[_0xe3d7('0x19')](function(_0x798f9e){var _0x30be1b=path[_0xe3d7('0x77')](_0x3cc87e,_0xe3d7('0xc9')+_0x1a25d9['id']+'-'+_0xdef376+_0xe3d7('0xca'));var _0x1e39f4={'path':_0x30be1b,'channel':_0xe3d7('0xba'),'interactionId':_0x1a25d9['id']};return pdf[_0xe3d7('0xcb')](_0x798f9e,_0x1e39f4);})[_0xe3d7('0x19')](function(){return new Promise(function(_0x460708,_0x209a70){zipdir(_0x3cc87e,{'saveTo':_0xe78852},function(_0x34eef1,_0x1c766f){if(_0x34eef1)return _0x209a70(_0x34eef1);return _0x460708(_0x1c766f);});})['then'](function(){return new BPromise(function(_0x1dd09d,_0x5ceac5){rimraf(_0x3cc87e,function(_0x46a526){if(_0x46a526)_0x5ceac5(_0x46a526);return _0x1dd09d();});});})[_0xe3d7('0x19')](function(){return _0x304340[_0xe3d7('0x79')](_0xe78852,_0x28d423,function(_0x38bd23){if(_0x38bd23){logger[_0xe3d7('0x1f')]('err',_0x38bd23);}else{fs[_0xe3d7('0xcc')](_0xe78852);}});});});}else{return _0x304340['sendStatus'](0xc8);}})[_0xe3d7('0x23')](handleError(_0x304340,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 38d6566..8a29c1d 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 _0xec0a=['ChatMessage','setMaxListeners','update','getUsers','then','setDataValue','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x218c0c,_0x2b21e3){var _0xf0347d=function(_0xb3b51c){while(--_0xb3b51c){_0x218c0c['push'](_0x218c0c['shift']());}};_0xf0347d(++_0x2b21e3);}(_0xec0a,0x17e));var _0xaec0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xec0a[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xaec0('0x0'));var ChatInteraction=require(_0xaec0('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xaec0('0x1'))['db'][_0xaec0('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xaec0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaec0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5f4c58){return function(_0x2e5ea7,_0x9495ef,_0x239765){_0x2e5ea7[_0xaec0('0x5')]({'attributes':['id'],'raw':!![]})[_0xaec0('0x6')](function(_0x4cbd60){_0x2e5ea7[_0xaec0('0x7')]('Users',_0x4cbd60['map'](function(_0x12db3e){return{'id':_0x12db3e['id']};}));return ChatMessage[_0xaec0('0x8')]({'where':{'ChatInteractionId':_0x2e5ea7['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x8cd841){_0x2e5ea7[_0xaec0('0x7')](_0xaec0('0x9'),_0x8cd841[_0xaec0('0xa')]);ChatInteractionEvents[_0xaec0('0xb')](_0x5f4c58+':'+_0x2e5ea7['id'],_0x2e5ea7);ChatInteractionEvents[_0xaec0('0xb')](_0x5f4c58,_0x2e5ea7);_0x239765(null);})[_0xaec0('0xc')](_0x239765(null));};}for(var e in events){if(events[_0xaec0('0xd')](e)){var event=events[e];ChatInteraction[_0xaec0('0xe')](e,emitEvent(event));}}module[_0xaec0('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xd563=['update','remove','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x74e673,_0x15b0c7){var _0x479ed8=function(_0x2f5e98){while(--_0x2f5e98){_0x74e673['push'](_0x74e673['shift']());}};_0x479ed8(++_0x15b0c7);}(_0xd563,0x182));var _0x3d56=function(_0x5670f2,_0x1ce340){_0x5670f2=_0x5670f2-0x0;var _0x1f8715=_0xd563[_0x5670f2];return _0x1f8715;};'use strict';var EventEmitter=require(_0x3d56('0x0'));var ChatInteraction=require(_0x3d56('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x3d56('0x1'))['db'][_0x3d56('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3d56('0x3')](0x0);var events={'afterCreate':_0x3d56('0x4'),'afterUpdate':_0x3d56('0x5'),'afterDestroy':_0x3d56('0x6')};function emitEvent(_0x13642a){return function(_0x57fad5,_0x5f2f77,_0x58bc46){_0x57fad5[_0x3d56('0x7')]({'attributes':['id'],'raw':!![]})[_0x3d56('0x8')](function(_0x17572f){_0x57fad5[_0x3d56('0x9')](_0x3d56('0xa'),_0x17572f['map'](function(_0x1179db){return{'id':_0x1179db['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x57fad5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3d56('0x8')](function(_0x215aed){_0x57fad5['setDataValue'](_0x3d56('0xb'),_0x215aed[_0x3d56('0xc')]);ChatInteractionEvents[_0x3d56('0xd')](_0x13642a+':'+_0x57fad5['id'],_0x57fad5);ChatInteractionEvents[_0x3d56('0xd')](_0x13642a,_0x57fad5);_0x58bc46(null);})[_0x3d56('0xe')](_0x58bc46(null));};}for(var e in events){if(events[_0x3d56('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x3d56('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index ab22805..d2d8050 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 _0xd85b=['request-promise','rimraf','../../config/environment','exports','define','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird'];(function(_0x2acb93,_0x419a08){var _0x50ffbd=function(_0x34c094){while(--_0x34c094){_0x2acb93['push'](_0x2acb93['shift']());}};_0x50ffbd(++_0x419a08);}(_0xd85b,0xfb));var _0xbd85=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd85b[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbd85('0x0'))(_0xbd85('0x1'));var moment=require(_0xbd85('0x2'));var BPromise=require(_0xbd85('0x3'));var rp=require(_0xbd85('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd85('0x5'));var config=require(_0xbd85('0x6'));var attributes=require('./chatInteraction.attributes');module[_0xbd85('0x7')]=function(_0xaa5286,_0x4b7294){return _0xaa5286[_0xbd85('0x8')](_0xbd85('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8b7c06,_0x3c9ad9,_0x4f2065){if(_0x8b7c06[_0xbd85('0xa')](_0xbd85('0xb'))){_0x8b7c06[_0xbd85('0xc')]=moment()[_0xbd85('0xd')](_0xbd85('0xe'));}_0x4f2065(null,_0x8b7c06);}},'charset':_0xbd85('0xf'),'collate':_0xbd85('0x10')});};
\ No newline at end of file
+var _0xb5d3=['path','rimraf','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment'];(function(_0x366783,_0x339fd8){var _0x3562b7=function(_0x29b013){while(--_0x29b013){_0x366783['push'](_0x366783['shift']());}};_0x3562b7(++_0x339fd8);}(_0xb5d3,0xa2));var _0x3b5d=function(_0x2e913b,_0x4b7071){_0x2e913b=_0x2e913b-0x0;var _0x173899=_0xb5d3[_0x2e913b];return _0x173899;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3b5d('0x0'))(_0x3b5d('0x1'));var moment=require(_0x3b5d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b5d('0x3'));var rimraf=require(_0x3b5d('0x4'));var config=require('../../config/environment');var attributes=require(_0x3b5d('0x5'));module['exports']=function(_0x510b41,_0x15a7ad){return _0x510b41[_0x3b5d('0x6')](_0x3b5d('0x7'),attributes,{'tableName':_0x3b5d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51d9d4,_0x2966ef,_0x3d2cf0){if(_0x51d9d4['changed'](_0x3b5d('0x9'))){_0x51d9d4[_0x3b5d('0xa')]=moment()[_0x3b5d('0xb')](_0x3b5d('0xc'));}_0x3d2cf0(null,_0x51d9d4);}},'charset':_0x3b5d('0xd'),'collate':_0x3b5d('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 4093051..cbfff7f 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 _0x75ad=['localhost','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','find','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x5520bf,_0x30866b){var _0x3c5ef2=function(_0x1bcc23){while(--_0x1bcc23){_0x5520bf['push'](_0x5520bf['shift']());}};_0x3c5ef2(++_0x30866b);}(_0x75ad,0xc4));var _0xd75a=function(_0x4b6ec2,_0x13725c){_0x4b6ec2=_0x4b6ec2-0x0;var _0x3fe2c5=_0x75ad[_0x4b6ec2];return _0x3fe2c5;};'use strict';var _=require(_0xd75a('0x0'));var util=require(_0xd75a('0x1'));var moment=require(_0xd75a('0x2'));var BPromise=require(_0xd75a('0x3'));var rs=require(_0xd75a('0x4'));var fs=require('fs');var Redis=require(_0xd75a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd75a('0x6'));var logger=require(_0xd75a('0x7'))(_0xd75a('0x8'));var config=require(_0xd75a('0x9'));var jayson=require(_0xd75a('0xa'));var client=jayson[_0xd75a('0xb')][_0xd75a('0xc')]({'port':0x232a});config[_0xd75a('0xd')]=_['defaults'](config[_0xd75a('0xd')],{'host':_0xd75a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd75a('0xd')]));require(_0xd75a('0xf'))[_0xd75a('0x10')](socket);function respondWithRpcPromise(_0x166cd4,_0x3b8610,_0x513455){return new BPromise(function(_0xb36732,_0x202e5a){return client['request'](_0x166cd4,_0x513455)[_0xd75a('0x11')](function(_0x44a98e){logger[_0xd75a('0x12')](_0xd75a('0x13'),_0x3b8610,_0xd75a('0x14'));logger[_0xd75a('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3b8610,_0xd75a('0x14'),JSON[_0xd75a('0x16')](_0x44a98e));if(_0x44a98e['error']){if(_0x44a98e[_0xd75a('0x17')][_0xd75a('0x18')]===0x1f4){logger['error'](_0xd75a('0x13'),_0x3b8610,_0x44a98e['error'][_0xd75a('0x19')]);return _0x202e5a(_0x44a98e[_0xd75a('0x17')]['message']);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3b8610,_0x44a98e[_0xd75a('0x17')][_0xd75a('0x19')]);return _0xb36732(_0x44a98e[_0xd75a('0x17')][_0xd75a('0x19')]);}else{logger[_0xd75a('0x12')](_0xd75a('0x13'),_0x3b8610,_0xd75a('0x14'));_0xb36732(_0x44a98e[_0xd75a('0x1a')][_0xd75a('0x19')]);}})['catch'](function(_0x457c8f){logger[_0xd75a('0x17')](_0xd75a('0x13'),_0x3b8610,_0x457c8f);_0x202e5a(_0x457c8f);});});}exports[_0xd75a('0x1b')]=function(_0x5d7279){var _0xe3ae73=this;return new Promise(function(_0x4e76d5,_0x494489){return db[_0xd75a('0x1c')][_0xd75a('0x1d')](_0x5d7279[_0xd75a('0x1e')],{'raw':_0x5d7279[_0xd75a('0x1f')]?_0x5d7279[_0xd75a('0x1f')][_0xd75a('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d7279[_0xd75a('0x1f')]?_0x5d7279[_0xd75a('0x1f')][_0xd75a('0x21')]||null:null,'attributes':_0x5d7279[_0xd75a('0x1f')]?_0x5d7279['options'][_0xd75a('0x22')]||null:null,'limit':_0x5d7279[_0xd75a('0x1f')]?_0x5d7279['options'][_0xd75a('0x23')]||null:null})['then'](function(_0x5b6ebb){logger[_0xd75a('0x12')](_0xd75a('0x1b'),_0x5d7279);logger[_0xd75a('0x15')]('UpdateChatInteraction',_0x5d7279,JSON[_0xd75a('0x16')](_0x5b6ebb));_0x4e76d5(_0x5b6ebb);})[_0xd75a('0x24')](function(_0x24feb8){logger[_0xd75a('0x17')](_0xd75a('0x1b'),_0x24feb8['message'],_0x5d7279);_0x494489(_0xe3ae73[_0xd75a('0x17')](0x1f4,_0x24feb8[_0xd75a('0x19')]));});});};exports[_0xd75a('0x25')]=function(_0xe55f98){return new Promise(function(_0x4d67af,_0x283c1a){return db['ChatInteraction'][_0xd75a('0x26')]({'where':_0xe55f98['options']?_0xe55f98[_0xd75a('0x1f')][_0xd75a('0x21')]||null:null})[_0xd75a('0x11')](function(_0xfcbb10){if(_0xfcbb10){return _0xfcbb10[_0xd75a('0x27')](_0xe55f98[_0xd75a('0x1e')][_0xd75a('0x28')],_['omit'](_0xe55f98[_0xd75a('0x1e')],[_0xd75a('0x28'),'id'])||{});}})['spread'](function(_0x4af248){logger[_0xd75a('0x12')](_0xd75a('0x29'),_0xe55f98);logger[_0xd75a('0x15')](_0xd75a('0x29'),_0xe55f98,JSON[_0xd75a('0x16')](_0x4af248));_0x4d67af(_0x4af248);})[_0xd75a('0x24')](function(_0x1a2a28){logger[_0xd75a('0x17')](_0xd75a('0x29'),_0x1a2a28['message'],_0xe55f98);_0x283c1a(_this[_0xd75a('0x17')](0x1f4,_0x1a2a28['message']));});});};
\ No newline at end of file
+var _0x1117=['ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','catch','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x46ef1d,_0x24926){var _0x49ce69=function(_0x5db4fc){while(--_0x5db4fc){_0x46ef1d['push'](_0x46ef1d['shift']());}};_0x49ce69(++_0x24926);}(_0x1117,0x117));var _0x7111=function(_0x458eef,_0x551783){_0x458eef=_0x458eef-0x0;var _0x2fb384=_0x1117[_0x458eef];return _0x2fb384;};'use strict';var _=require('lodash');var util=require(_0x7111('0x0'));var moment=require(_0x7111('0x1'));var BPromise=require(_0x7111('0x2'));var rs=require(_0x7111('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7111('0x4'))['db'];var utils=require(_0x7111('0x5'));var logger=require('../../config/logger')(_0x7111('0x6'));var config=require(_0x7111('0x7'));var jayson=require(_0x7111('0x8'));var client=jayson[_0x7111('0x9')][_0x7111('0xa')]({'port':0x232a});config[_0x7111('0xb')]=_[_0x7111('0xc')](config[_0x7111('0xb')],{'host':_0x7111('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7111('0xb')]));require(_0x7111('0xe'))[_0x7111('0xf')](socket);function respondWithRpcPromise(_0x22794c,_0xfb969c,_0x1f3988){return new BPromise(function(_0x39e9d7,_0x16549e){return client[_0x7111('0x10')](_0x22794c,_0x1f3988)[_0x7111('0x11')](function(_0x157181){logger[_0x7111('0x12')](_0x7111('0x13'),_0xfb969c,_0x7111('0x14'));logger[_0x7111('0x15')](_0x7111('0x16'),_0xfb969c,_0x7111('0x14'),JSON[_0x7111('0x17')](_0x157181));if(_0x157181[_0x7111('0x18')]){if(_0x157181[_0x7111('0x18')][_0x7111('0x19')]===0x1f4){logger[_0x7111('0x18')](_0x7111('0x13'),_0xfb969c,_0x157181[_0x7111('0x18')]['message']);return _0x16549e(_0x157181[_0x7111('0x18')][_0x7111('0x1a')]);}logger['error'](_0x7111('0x13'),_0xfb969c,_0x157181[_0x7111('0x18')][_0x7111('0x1a')]);return _0x39e9d7(_0x157181[_0x7111('0x18')][_0x7111('0x1a')]);}else{logger[_0x7111('0x12')](_0x7111('0x13'),_0xfb969c,_0x7111('0x14'));_0x39e9d7(_0x157181[_0x7111('0x1b')][_0x7111('0x1a')]);}})['catch'](function(_0x45cde5){logger[_0x7111('0x18')](_0x7111('0x13'),_0xfb969c,_0x45cde5);_0x16549e(_0x45cde5);});});}exports[_0x7111('0x1c')]=function(_0x3f620e){var _0x29e27b=this;return new Promise(function(_0x346579,_0x250bd0){return db[_0x7111('0x1d')][_0x7111('0x1e')](_0x3f620e[_0x7111('0x1f')],{'raw':_0x3f620e[_0x7111('0x20')]?_0x3f620e[_0x7111('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f620e[_0x7111('0x20')]?_0x3f620e['options'][_0x7111('0x21')]||null:null,'attributes':_0x3f620e[_0x7111('0x20')]?_0x3f620e[_0x7111('0x20')][_0x7111('0x22')]||null:null,'limit':_0x3f620e['options']?_0x3f620e[_0x7111('0x20')][_0x7111('0x23')]||null:null})[_0x7111('0x11')](function(_0x1bca1f){logger[_0x7111('0x12')](_0x7111('0x1c'),_0x3f620e);logger['debug'](_0x7111('0x1c'),_0x3f620e,JSON['stringify'](_0x1bca1f));_0x346579(_0x1bca1f);})[_0x7111('0x24')](function(_0x251f22){logger['error'](_0x7111('0x1c'),_0x251f22[_0x7111('0x1a')],_0x3f620e);_0x250bd0(_0x29e27b[_0x7111('0x18')](0x1f4,_0x251f22['message']));});});};exports[_0x7111('0x25')]=function(_0x1f3f30){return new Promise(function(_0x278afa,_0x9ad464){return db['ChatInteraction'][_0x7111('0x26')]({'where':_0x1f3f30[_0x7111('0x20')]?_0x1f3f30[_0x7111('0x20')][_0x7111('0x21')]||null:null})[_0x7111('0x11')](function(_0x24277d){if(_0x24277d){return _0x24277d[_0x7111('0x27')](_0x1f3f30[_0x7111('0x1f')][_0x7111('0x28')],_[_0x7111('0x29')](_0x1f3f30[_0x7111('0x1f')],[_0x7111('0x28'),'id'])||{});}})['spread'](function(_0xfcfd8d){logger[_0x7111('0x12')](_0x7111('0x2a'),_0x1f3f30);logger[_0x7111('0x15')](_0x7111('0x2a'),_0x1f3f30,JSON[_0x7111('0x17')](_0xfcfd8d));_0x278afa(_0xfcfd8d);})[_0x7111('0x24')](function(_0x39df17){logger[_0x7111('0x18')](_0x7111('0x2a'),_0x39df17[_0x7111('0x1a')],_0x1f3f30);_0x9ad464(_this[_0x7111('0x18')](0x1f4,_0x39df17[_0x7111('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 15c8143..0db110e 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 _0x0064=['remove','update','removeListener','register','length','chatInteraction:','save'];(function(_0x3d8240,_0x2663d4){var _0x3d0372=function(_0xc47c6b){while(--_0xc47c6b){_0x3d8240['push'](_0x3d8240['shift']());}};_0x3d0372(++_0x2663d4);}(_0x0064,0x68));var _0x4006=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0064[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x4006('0x0'),_0x4006('0x1'),_0x4006('0x2')];function createListener(_0x24571d,_0x4022ac){return function(_0x221755){_0x4022ac['emit'](_0x24571d,_0x221755);};}function removeListener(_0x212654,_0x5643a9){return function(){ChatInteractionEvents[_0x4006('0x3')](_0x212654,_0x5643a9);};}exports[_0x4006('0x4')]=function(_0x14aaa5){for(var _0x2544c3=0x0,_0x5d86c6=events[_0x4006('0x5')];_0x2544c3<_0x5d86c6;_0x2544c3++){var _0x28792a=events[_0x2544c3];var _0x165e0b=createListener(_0x4006('0x6')+_0x28792a,_0x14aaa5);ChatInteractionEvents['on'](_0x28792a,_0x165e0b);}};
\ No newline at end of file
+var _0x5d9d=['length','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x3c7db0,_0x5a8f48){var _0x4e1435=function(_0x5367fe){while(--_0x5367fe){_0x3c7db0['push'](_0x3c7db0['shift']());}};_0x4e1435(++_0x5a8f48);}(_0x5d9d,0x101));var _0xd5d9=function(_0x4c3f98,_0x30a8a6){_0x4c3f98=_0x4c3f98-0x0;var _0x54612c=_0x5d9d[_0x4c3f98];return _0x54612c;};'use strict';var ChatInteractionEvents=require(_0xd5d9('0x0'));var events=[_0xd5d9('0x1'),_0xd5d9('0x2'),_0xd5d9('0x3')];function createListener(_0x1c1b10,_0x21a891){return function(_0x5ea221){_0x21a891[_0xd5d9('0x4')](_0x1c1b10,_0x5ea221);};}function removeListener(_0x2bc6a1,_0x44f8e2){return function(){ChatInteractionEvents[_0xd5d9('0x5')](_0x2bc6a1,_0x44f8e2);};}exports[_0xd5d9('0x6')]=function(_0x1233dc){for(var _0x2c489e=0x0,_0x3833fe=events[_0xd5d9('0x7')];_0x2c489e<_0x3833fe;_0x2c489e++){var _0x211416=events[_0x2c489e];var _0x2a673a=createListener('chatInteraction:'+_0x211416,_0x1233dc);ChatInteractionEvents['on'](_0x211416,_0x2a673a);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 3ec59ab..765c7b9 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 _0x201e=['getMyMessages','/:id/download','post','createVidaooSession','diskStorage','join','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','/:id/messages','addMessage','/:id/tags','tracked','chat','addTags','/:id','chatinteraction:update','update','put','/:id/custom_update','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','getMessages','/:id/my_messages'];(function(_0x2bc810,_0x4a1300){var _0x56b881=function(_0x447fa2){while(--_0x447fa2){_0x2bc810['push'](_0x2bc810['shift']());}};_0x56b881(++_0x4a1300);}(_0x201e,0xb0));var _0xe201=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x201e[_0x1a9204];return _0x17ca68;};'use strict';var multer=require('multer');var util=require(_0xe201('0x0'));var path=require(_0xe201('0x1'));var timeout=require(_0xe201('0x2'));var express=require(_0xe201('0x3'));var router=express[_0xe201('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe201('0x5'));var interaction=require(_0xe201('0x6'));var config=require(_0xe201('0x7'));var controller=require('./chatInteraction.controller');router[_0xe201('0x8')]('/',auth[_0xe201('0x9')](),controller[_0xe201('0xa')]);router[_0xe201('0x8')](_0xe201('0xb'),auth[_0xe201('0x9')](),controller[_0xe201('0xc')]);router[_0xe201('0x8')]('/:id',auth[_0xe201('0xd')](),controller['show']);router[_0xe201('0x8')]('/:id/attachment_download',auth[_0xe201('0xd')](),controller['attachmentDownload']);router[_0xe201('0x8')]('/:id/messages',auth[_0xe201('0x9')](),controller[_0xe201('0xe')]);router[_0xe201('0x8')](_0xe201('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xe201('0x10')]);router[_0xe201('0x8')](_0xe201('0x11'),auth[_0xe201('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe201('0x12')]('/:id/vidaoo',auth[_0xe201('0x9')](),controller[_0xe201('0x13')]);var upload=multer({'storage':multer[_0xe201('0x14')]({'destination':function(_0x333f35,_0x20d444,_0x8aa5b4){_0x8aa5b4(null,path[_0xe201('0x15')](config['root'],_0xe201('0x16')));},'filename':function(_0x3e96cc,_0x570461,_0x2a6306){_0x2a6306(null,util[_0xe201('0x17')]('%s-%s',Date[_0xe201('0x18')](),_0x570461[_0xe201('0x19')][_0xe201('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe201('0x12')](_0xe201('0x1b'),upload[_0xe201('0x1c')]('file'),controller['attachmentUpload']);router['post'](_0xe201('0x1d'),auth[_0xe201('0xd')](),controller[_0xe201('0x1e')]);router[_0xe201('0x12')](_0xe201('0x1f'),auth[_0xe201('0x9')](),interaction[_0xe201('0x20')](_0xe201('0x21'),'chatinteraction:addtags'),controller[_0xe201('0x22')]);router['put'](_0xe201('0x23'),auth['isAuthenticated'](),interaction[_0xe201('0x20')]('chat',_0xe201('0x24')),controller[_0xe201('0x25')]);router[_0xe201('0x26')](_0xe201('0x27'),controller['customUpdate']);router[_0xe201('0x26')](_0xe201('0x28'),auth[_0xe201('0xd')](),controller['abandon']);router[_0xe201('0x26')](_0xe201('0x29'),controller[_0xe201('0x2a')]);router[_0xe201('0x2b')](_0xe201('0x23'),auth[_0xe201('0x9')](),interaction[_0xe201('0x20')](_0xe201('0x21'),_0xe201('0x2c')),controller[_0xe201('0x2d')]);router[_0xe201('0x2b')](_0xe201('0x1f'),auth['isAuthenticated'](),controller[_0xe201('0x2e')]);module[_0xe201('0x2f')]=router;
\ No newline at end of file
+var _0xb983=['tracked','chat','chatinteraction:addtags','addTags','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','now','originalname','replace','single','file','attachmentUpload','/:id/tags'];(function(_0x44d9f8,_0xd9f940){var _0x310b84=function(_0x5f3990){while(--_0x5f3990){_0x44d9f8['push'](_0x44d9f8['shift']());}};_0x310b84(++_0xd9f940);}(_0xb983,0xdb));var _0x3b98=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0xb983[_0x5447aa];return _0xb21e53;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3b98('0x0'));var timeout=require(_0x3b98('0x1'));var express=require(_0x3b98('0x2'));var router=express[_0x3b98('0x3')]();var fs_extra=require(_0x3b98('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3b98('0x5'));var config=require(_0x3b98('0x6'));var controller=require(_0x3b98('0x7'));router[_0x3b98('0x8')]('/',auth[_0x3b98('0x9')](),controller[_0x3b98('0xa')]);router['get'](_0x3b98('0xb'),auth[_0x3b98('0x9')](),controller['describe']);router['get'](_0x3b98('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x3b98('0xd')]);router[_0x3b98('0x8')](_0x3b98('0xe'),auth[_0x3b98('0xf')](),controller[_0x3b98('0x10')]);router['get'](_0x3b98('0x11'),auth['isAuthenticated'](),controller['getMessages']);router[_0x3b98('0x8')](_0x3b98('0x12'),auth[_0x3b98('0xf')](),controller[_0x3b98('0x13')]);router[_0x3b98('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x3b98('0x14')]);router[_0x3b98('0x15')]('/',auth[_0x3b98('0x9')](),controller[_0x3b98('0x16')]);router[_0x3b98('0x15')](_0x3b98('0x17'),auth['isAuthenticated'](),controller[_0x3b98('0x18')]);var upload=multer({'storage':multer[_0x3b98('0x19')]({'destination':function(_0x543741,_0x2b89ec,_0x1d0969){_0x1d0969(null,path['join'](config[_0x3b98('0x1a')],_0x3b98('0x1b')));},'filename':function(_0x30c44d,_0x304bbf,_0xb06b40){_0xb06b40(null,util[_0x3b98('0x1c')]('%s-%s',Date[_0x3b98('0x1d')](),_0x304bbf[_0x3b98('0x1e')][_0x3b98('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3b98('0x15')]('/:id/attachment_upload',upload[_0x3b98('0x20')](_0x3b98('0x21')),controller[_0x3b98('0x22')]);router['post']('/:id/messages',auth[_0x3b98('0xf')](),controller['addMessage']);router['post'](_0x3b98('0x23'),auth[_0x3b98('0x9')](),interaction[_0x3b98('0x24')](_0x3b98('0x25'),_0x3b98('0x26')),controller[_0x3b98('0x27')]);router['put']('/:id',auth[_0x3b98('0x9')](),interaction[_0x3b98('0x24')](_0x3b98('0x25'),'chatinteraction:update'),controller['update']);router[_0x3b98('0x28')](_0x3b98('0x29'),controller[_0x3b98('0x2a')]);router[_0x3b98('0x28')](_0x3b98('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0x3b98('0x2c')]);router[_0x3b98('0x28')](_0x3b98('0x2d'),controller[_0x3b98('0x2e')]);router[_0x3b98('0x2f')]('/:id',auth[_0x3b98('0x9')](),interaction[_0x3b98('0x24')]('chat',_0x3b98('0x30')),controller[_0x3b98('0x31')]);router['delete'](_0x3b98('0x23'),auth['isAuthenticated'](),controller['removeTags']);module[_0x3b98('0x32')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index cf00b05..e078b77 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 _0x3a0d=['INTEGER','medium','BOOLEAN'];(function(_0x31b59c,_0x136fc7){var _0x56db60=function(_0x38f02e){while(--_0x38f02e){_0x31b59c['push'](_0x31b59c['shift']());}};_0x56db60(++_0x136fc7);}(_0x3a0d,0x14b));var _0xd3a0=function(_0x4a1196,_0x21e0c3){_0x4a1196=_0x4a1196-0x0;var _0x58604e=_0x3a0d[_0x4a1196];return _0x58604e;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xd3a0('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0xd3a0('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd3a0('0x2')]}};
\ No newline at end of file
+var _0x5a80=['TEXT','BOOLEAN','sequelize'];(function(_0x331f32,_0x194684){var _0x462529=function(_0x301e9c){while(--_0x301e9c){_0x331f32['push'](_0x331f32['shift']());}};_0x462529(++_0x194684);}(_0x5a80,0xf5));var _0x05a8=function(_0x2571f6,_0x555e23){_0x2571f6=_0x2571f6-0x0;var _0x24e6d7=_0x5a80[_0x2571f6];return _0x24e6d7;};'use strict';var Sequelize=require(_0x05a8('0x0'));module['exports']={'body':{'type':Sequelize[_0x05a8('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x05a8('0x2')],'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 d367817..428c680 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 _0xe285=['redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','apply','save','update','then','destroy','stack','name','index','map','ChatInternalMessage','fieldName','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','format','getUsers','findAll','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0xe285,0x19a));var _0x5e28=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xe285[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require(_0x5e28('0x0'));var rimraf=require(_0x5e28('0x1'));var zipdir=require(_0x5e28('0x2'));var jsonpatch=require(_0x5e28('0x3'));var rp=require(_0x5e28('0x4'));var moment=require(_0x5e28('0x5'));var BPromise=require(_0x5e28('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5e28('0x7'));var sox=require(_0x5e28('0x8'));var csv=require(_0x5e28('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e28('0xa'));var _=require(_0x5e28('0xb'));var squel=require(_0x5e28('0xc'));var crypto=require(_0x5e28('0xd'));var jsforce=require(_0x5e28('0xe'));var deskjs=require(_0x5e28('0xf'));var toCsv=require(_0x5e28('0x9'));var querystring=require('querystring');var Papa=require(_0x5e28('0x10'));var Redis=require(_0x5e28('0x11'));var authService=require(_0x5e28('0x12'));var qs=require(_0x5e28('0x13'));var as=require(_0x5e28('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e28('0x15'))(_0x5e28('0x16'));var utils=require(_0x5e28('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5e28('0x18'));var db=require(_0x5e28('0x19'))['db'];config[_0x5e28('0x1a')]=_[_0x5e28('0x1b')](config[_0x5e28('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x5e28('0x1c'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x5e28('0x1d')](socket);function respondWithStatusCode(_0x486c03,_0x17cea6){_0x17cea6=_0x17cea6||0xcc;return function(_0x20d197){if(_0x20d197){return _0x486c03[_0x5e28('0x1e')](_0x17cea6);}return _0x486c03[_0x5e28('0x1f')](_0x17cea6)[_0x5e28('0x20')]();};}function respondWithResult(_0x3af812,_0xf74a7f){_0xf74a7f=_0xf74a7f||0xc8;return function(_0x50ea92){if(_0x50ea92){return _0x3af812[_0x5e28('0x1f')](_0xf74a7f)['json'](_0x50ea92);}};}function respondWithFilteredResult(_0x5308bb,_0x455bab){return function(_0x4be1b9){if(_0x4be1b9){var _0x4e7d05=typeof _0x455bab[_0x5e28('0x21')]===_0x5e28('0x22')&&typeof _0x455bab['limit']===_0x5e28('0x22');var _0x10e5dd=_0x4be1b9[_0x5e28('0x23')];var _0x252ce3=_0x4e7d05?0x0:_0x455bab[_0x5e28('0x21')];var _0x229d40=_0x4e7d05?_0x4be1b9[_0x5e28('0x23')]:_0x455bab[_0x5e28('0x21')]+_0x455bab[_0x5e28('0x24')];var _0x3ddfd1;if(_0x229d40>=_0x10e5dd){_0x229d40=_0x10e5dd;_0x3ddfd1=0xc8;}else{_0x3ddfd1=0xce;}_0x5308bb[_0x5e28('0x1f')](_0x3ddfd1);return _0x5308bb['set']('Content-Range',_0x252ce3+'-'+_0x229d40+'/'+_0x10e5dd)['json'](_0x4be1b9);}return null;};}function patchUpdates(_0x485388){return function(_0x25762d){try{jsonpatch[_0x5e28('0x25')](_0x25762d,_0x485388,!![]);}catch(_0x28b28b){return BPromise['reject'](_0x28b28b);}return _0x25762d[_0x5e28('0x26')]();};}function saveUpdates(_0x461b86,_0x1da8cc){return function(_0x1f3e9f){if(_0x1f3e9f){return _0x1f3e9f[_0x5e28('0x27')](_0x461b86)[_0x5e28('0x28')](function(_0x531595){return _0x531595;});}return null;};}function removeEntity(_0x11bee5,_0x51e9bf){return function(_0x2ea05a){if(_0x2ea05a){return _0x2ea05a[_0x5e28('0x29')]()['then'](function(){_0x11bee5[_0x5e28('0x1f')](0xcc)[_0x5e28('0x20')]();});}};}function handleEntityNotFound(_0x5e7144,_0x528921){return function(_0xcb8b60){if(!_0xcb8b60){_0x5e7144[_0x5e28('0x1e')](0x194);}return _0xcb8b60;};}function handleError(_0x353a3b,_0x419c61){_0x419c61=_0x419c61||0x1f4;return function(_0x4a9036){logger['error'](_0x4a9036[_0x5e28('0x2a')]);if(_0x4a9036[_0x5e28('0x2b')]){delete _0x4a9036[_0x5e28('0x2b')];}_0x353a3b[_0x5e28('0x1f')](_0x419c61)['send'](_0x4a9036);};}exports[_0x5e28('0x2c')]=function(_0x152315,_0xbc7ddf){var _0x554939={},_0x3d1091={},_0x1c15a3={'count':0x0,'rows':[]};var _0x25b512=_[_0x5e28('0x2d')](db[_0x5e28('0x2e')]['rawAttributes'],function(_0x497652){return{'name':_0x497652[_0x5e28('0x2f')],'type':_0x497652['type']['key']};});_0x3d1091[_0x5e28('0x30')]=_['map'](_0x25b512,'name');_0x3d1091['query']=_[_0x5e28('0x31')](_0x152315['query']);_0x3d1091[_0x5e28('0x32')]=_[_0x5e28('0x33')](_0x3d1091['model'],_0x3d1091[_0x5e28('0x34')]);_0x554939['attributes']=_[_0x5e28('0x33')](_0x3d1091[_0x5e28('0x30')],qs[_0x5e28('0x35')](_0x152315[_0x5e28('0x34')]['fields']));_0x554939['attributes']=_0x554939[_0x5e28('0x36')][_0x5e28('0x37')]?_0x554939['attributes']:_0x3d1091['model'];if(!_0x152315[_0x5e28('0x34')][_0x5e28('0x38')](_0x5e28('0x39'))){_0x554939[_0x5e28('0x24')]=qs[_0x5e28('0x24')](_0x152315['query'][_0x5e28('0x24')]);_0x554939[_0x5e28('0x21')]=qs[_0x5e28('0x21')](_0x152315[_0x5e28('0x34')][_0x5e28('0x21')]);}_0x554939['order']=qs[_0x5e28('0x3a')](_0x152315[_0x5e28('0x34')][_0x5e28('0x3a')]);_0x554939['where']=qs[_0x5e28('0x32')](_[_0x5e28('0x3b')](_0x152315[_0x5e28('0x34')],_0x3d1091[_0x5e28('0x32')]),_0x25b512);if(_0x152315[_0x5e28('0x34')]['filter']){_0x554939[_0x5e28('0x3c')]=_[_0x5e28('0x3d')](_0x554939[_0x5e28('0x3c')],{'$or':_['map'](_0x25b512,function(_0x113c62){if(_0x113c62[_0x5e28('0x3e')]!==_0x5e28('0x3f')){var _0x58522e={};_0x58522e[_0x113c62[_0x5e28('0x2b')]]={'$like':'%'+_0x152315['query'][_0x5e28('0x40')]+'%'};return _0x58522e;}})});}_0x554939=_[_0x5e28('0x3d')]({},_0x554939,_0x152315[_0x5e28('0x41')]);var _0x3ecb3d={'where':_0x554939[_0x5e28('0x3c')]};return db[_0x5e28('0x2e')][_0x5e28('0x23')](_0x3ecb3d)['then'](function(_0x26bb37){_0x1c15a3[_0x5e28('0x23')]=_0x26bb37;if(_0x152315[_0x5e28('0x34')][_0x5e28('0x42')]){_0x554939[_0x5e28('0x43')]=[{'all':!![]}];}return db[_0x5e28('0x2e')]['findAll'](_0x554939);})[_0x5e28('0x28')](function(_0x1e681b){_0x1c15a3[_0x5e28('0x44')]=_0x1e681b;return _0x1c15a3;})[_0x5e28('0x28')](respondWithFilteredResult(_0xbc7ddf,_0x554939))[_0x5e28('0x45')](handleError(_0xbc7ddf,null));};exports[_0x5e28('0x46')]=function(_0x31cdff,_0x52ac7a){var _0x22c82d={'raw':!![],'where':{'id':_0x31cdff[_0x5e28('0x47')]['id']}},_0x68eaff={};_0x68eaff['model']=_[_0x5e28('0x31')](db[_0x5e28('0x2e')]['rawAttributes']);_0x68eaff[_0x5e28('0x34')]=_['keys'](_0x31cdff[_0x5e28('0x34')]);_0x68eaff[_0x5e28('0x32')]=_[_0x5e28('0x33')](_0x68eaff[_0x5e28('0x30')],_0x68eaff[_0x5e28('0x34')]);_0x22c82d[_0x5e28('0x36')]=_[_0x5e28('0x33')](_0x68eaff[_0x5e28('0x30')],qs[_0x5e28('0x35')](_0x31cdff[_0x5e28('0x34')][_0x5e28('0x35')]));_0x22c82d[_0x5e28('0x36')]=_0x22c82d[_0x5e28('0x36')]['length']?_0x22c82d['attributes']:_0x68eaff[_0x5e28('0x30')];if(_0x31cdff[_0x5e28('0x34')][_0x5e28('0x42')]){_0x22c82d['include']=[{'all':!![]}];}_0x22c82d=_[_0x5e28('0x3d')]({},_0x22c82d,_0x31cdff[_0x5e28('0x41')]);return db[_0x5e28('0x2e')][_0x5e28('0x48')](_0x22c82d)[_0x5e28('0x28')](handleEntityNotFound(_0x52ac7a,null))['then'](respondWithResult(_0x52ac7a,null))[_0x5e28('0x45')](handleError(_0x52ac7a,null));};exports[_0x5e28('0x49')]=function(_0x41579c,_0x47372f){return db[_0x5e28('0x2e')]['create'](_0x41579c['body'],{})['then'](respondWithResult(_0x47372f,0xc9))[_0x5e28('0x45')](handleError(_0x47372f,null));};exports['update']=function(_0x431958,_0x268f42){if(_0x431958[_0x5e28('0x4a')]['id']){delete _0x431958[_0x5e28('0x4a')]['id'];}return db['ChatInternalMessage'][_0x5e28('0x48')]({'where':{'id':_0x431958['params']['id']}})[_0x5e28('0x28')](handleEntityNotFound(_0x268f42,null))[_0x5e28('0x28')](saveUpdates(_0x431958[_0x5e28('0x4a')],null))[_0x5e28('0x28')](respondWithResult(_0x268f42,null))[_0x5e28('0x45')](handleError(_0x268f42,null));};exports[_0x5e28('0x29')]=function(_0xb4b1ad,_0x3da50d){return db[_0x5e28('0x2e')][_0x5e28('0x48')]({'where':{'id':_0xb4b1ad[_0x5e28('0x47')]['id']}})[_0x5e28('0x28')](handleEntityNotFound(_0x3da50d,null))[_0x5e28('0x28')](removeEntity(_0x3da50d,null))[_0x5e28('0x45')](handleError(_0x3da50d,null));};exports[_0x5e28('0x4b')]=function(_0x4035a0,_0x8cb609){return db[_0x5e28('0x2e')]['describe']()[_0x5e28('0x28')](respondWithResult(_0x8cb609,null))['catch'](handleError(_0x8cb609,null));};function wrapUser(_0x2107ae){return function(_0x5293f3){var _0x278d45=_0x2107ae[_0x5e28('0x4c')]({'plain':!![]});_0x278d45[_0x5e28('0x4d')]=[];if(_0x5293f3){_0x278d45[_0x5e28('0x4e')]=_0x5293f3['createdAt'];_0x278d45['lastMessage']=_0x5293f3;}else{_0x278d45['lastMessageAt']=moment(0x0)[_0x5e28('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x278d45['lastMessage']={};}return _0x278d45;};}exports[_0x5e28('0x50')]=function(_0x3dbc95,_0x532549,_0x3183b2){var _0x1b01a6=[];return db['User'][_0x5e28('0x51')]({'where':{'role':[_0x5e28('0x52'),_0x5e28('0x53'),_0x5e28('0x54')]},'attributes':['id',_0x5e28('0x55'),_0x5e28('0x2b'),_0x5e28('0x56'),_0x5e28('0x57'),_0x5e28('0x58'),_0x5e28('0x59'),_0x5e28('0x5a'),_0x5e28('0x5b'),_0x5e28('0x5c')],'order':qs['sort'](_0x5e28('0x5d')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0x5e28('0x2b'),_0x5e28('0x3e')],'through':{'attributes':[]}}]})['then'](function(_0x22e6c3){if(_0x22e6c3){var _0x404567=_0x3dbc95[_0x5e28('0x54')][_0x5e28('0x4c')]({'plain':!![]});if(!_0x404567)throw new Error(_0x5e28('0x5e'));if(_0x404567[_0x5e28('0x56')]===_0x5e28('0x54')){return db[_0x5e28('0x5f')][_0x5e28('0x48')]({'where':{'name':_0x5e28('0x60'),'userProfileId':_0x404567[_0x5e28('0x61')]},'raw':!![]})[_0x5e28('0x28')](function(_0x2e1cac){if(_0x2e1cac){if(_0x2e1cac[_0x5e28('0x62')]===0x0){return db[_0x5e28('0x63')][_0x5e28('0x51')]({'where':{'sectionId':_0x2e1cac['id']},'raw':!![]})[_0x5e28('0x28')](function(_0x46e3c5){var _0x5a3095=[];if(_[_0x5e28('0x64')](_0x46e3c5)){_0x5a3095=_[_0x5e28('0x40')](_0x22e6c3,function(_0x543740){if(_0x543740[_0x5e28('0x56')]!==_0x5e28('0x52')){return _0x543740;}});return _0x5a3095;}else{for(var _0x2e9e11=0x0;_0x2e9e11<_0x22e6c3[_0x5e28('0x37')];_0x2e9e11++){var _0x41348e=_0x22e6c3[_0x2e9e11];if(_0x41348e[_0x5e28('0x56')]===_0x5e28('0x52')){var _0x3da5d8=_['find'](_0x46e3c5,function(_0xc135ab){return _0xc135ab[_0x5e28('0x65')]===_0x41348e['id'];});if(_0x3da5d8)_0x5a3095['push'](_0x41348e);}else{_0x5a3095[_0x5e28('0x66')](_0x41348e);}}return _0x5a3095;}});}else{return _0x22e6c3;}}else{var _0x330227=_[_0x5e28('0x40')](_0x22e6c3,function(_0x29aaa5){if(_0x29aaa5[_0x5e28('0x56')]!==_0x5e28('0x52')){return _0x29aaa5;}});return _0x330227;}});}else{return _0x22e6c3;}}})[_0x5e28('0x28')](function(_0x176ca4){var _0x2364f2=[];if(_0x176ca4){_0x1b01a6=_0x176ca4;for(var _0x135b81=0x0;_0x135b81<_0x176ca4[_0x5e28('0x37')];_0x135b81+=0x1){_0x1b01a6[_0x135b81][_0x5e28('0x4d')]=[];_0x2364f2['push'](db[_0x5e28('0x2e')]['find']({'where':{'FromId':[_0x3dbc95[_0x5e28('0x54')]['id'],_0x176ca4[_0x135b81]['id']],'ToId':[_0x3dbc95['user']['id'],_0x176ca4[_0x135b81]['id']],'ChatGroupId':null},'attributes':['id',_0x5e28('0x67'),_0x5e28('0x68'),_0x5e28('0x69'),_0x5e28('0x6a'),_0x5e28('0x4a')],'order':qs[_0x5e28('0x3a')](_0x5e28('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5e28('0x28')](wrapUser(_0x176ca4[_0x135b81])));}return BPromise[_0x5e28('0x6c')](_0x2364f2);}return[];})[_0x5e28('0x28')](function(_0x10acb2){return{'rows':_0x10acb2,'count':_0x10acb2['length']};})[_0x5e28('0x28')](respondWithResult(_0x532549,null))['catch'](handleError(_0x532549,null));};
\ No newline at end of file
+var _0x9d32=['admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','findAll','isEmpty','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','ChatInternalMessage','includeAll','include','rows','catch','params','options','create','body','update','find','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent'];(function(_0xff1f6a,_0x4f6b5c){var _0x13673a=function(_0x3fd516){while(--_0x3fd516){_0xff1f6a['push'](_0xff1f6a['shift']());}};_0x13673a(++_0x4f6b5c);}(_0x9d32,0xff));var _0x29d3=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0x9d32[_0x30abff];return _0x4c571e;};'use strict';var emlformat=require(_0x29d3('0x0'));var rimraf=require(_0x29d3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29d3('0x2'));var rp=require(_0x29d3('0x3'));var moment=require('moment');var BPromise=require(_0x29d3('0x4'));var Mustache=require('mustache');var util=require(_0x29d3('0x5'));var path=require(_0x29d3('0x6'));var sox=require(_0x29d3('0x7'));var csv=require(_0x29d3('0x8'));var ejs=require(_0x29d3('0x9'));var fs=require('fs');var fs_extra=require(_0x29d3('0xa'));var _=require('lodash');var squel=require(_0x29d3('0xb'));var crypto=require(_0x29d3('0xc'));var jsforce=require(_0x29d3('0xd'));var deskjs=require(_0x29d3('0xe'));var toCsv=require(_0x29d3('0x8'));var querystring=require(_0x29d3('0xf'));var Papa=require('papaparse');var Redis=require(_0x29d3('0x10'));var authService=require(_0x29d3('0x11'));var qs=require(_0x29d3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29d3('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x29d3('0x14'));var config=require(_0x29d3('0x15'));var licenseUtil=require(_0x29d3('0x16'));var db=require(_0x29d3('0x17'))['db'];config[_0x29d3('0x18')]=_[_0x29d3('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x29d3('0x1a'))(new Redis(config[_0x29d3('0x18')]));require(_0x29d3('0x1b'))[_0x29d3('0x1c')](socket);function respondWithStatusCode(_0x1a97ec,_0x3a8681){_0x3a8681=_0x3a8681||0xcc;return function(_0x260d83){if(_0x260d83){return _0x1a97ec[_0x29d3('0x1d')](_0x3a8681);}return _0x1a97ec[_0x29d3('0x1e')](_0x3a8681)[_0x29d3('0x1f')]();};}function respondWithResult(_0x246138,_0x2705bc){_0x2705bc=_0x2705bc||0xc8;return function(_0x47074c){if(_0x47074c){return _0x246138[_0x29d3('0x1e')](_0x2705bc)[_0x29d3('0x20')](_0x47074c);}};}function respondWithFilteredResult(_0x32aa16,_0x8e2d4b){return function(_0x448912){if(_0x448912){var _0x3564a7=typeof _0x8e2d4b[_0x29d3('0x21')]===_0x29d3('0x22')&&typeof _0x8e2d4b['limit']==='undefined';var _0x19cf2c=_0x448912[_0x29d3('0x23')];var _0x345296=_0x3564a7?0x0:_0x8e2d4b[_0x29d3('0x21')];var _0x3c4090=_0x3564a7?_0x448912[_0x29d3('0x23')]:_0x8e2d4b[_0x29d3('0x21')]+_0x8e2d4b[_0x29d3('0x24')];var _0x325287;if(_0x3c4090>=_0x19cf2c){_0x3c4090=_0x19cf2c;_0x325287=0xc8;}else{_0x325287=0xce;}_0x32aa16['status'](_0x325287);return _0x32aa16[_0x29d3('0x25')](_0x29d3('0x26'),_0x345296+'-'+_0x3c4090+'/'+_0x19cf2c)[_0x29d3('0x20')](_0x448912);}return null;};}function patchUpdates(_0x2b4c60){return function(_0x8c56aa){try{jsonpatch[_0x29d3('0x27')](_0x8c56aa,_0x2b4c60,!![]);}catch(_0x31d4c4){return BPromise[_0x29d3('0x28')](_0x31d4c4);}return _0x8c56aa[_0x29d3('0x29')]();};}function saveUpdates(_0x3a60c0,_0xd1e9dd){return function(_0xaf86bc){if(_0xaf86bc){return _0xaf86bc['update'](_0x3a60c0)[_0x29d3('0x2a')](function(_0x190214){return _0x190214;});}return null;};}function removeEntity(_0x1b0541,_0x5eb7c6){return function(_0x4ae44d){if(_0x4ae44d){return _0x4ae44d[_0x29d3('0x2b')]()[_0x29d3('0x2a')](function(){_0x1b0541[_0x29d3('0x1e')](0xcc)[_0x29d3('0x1f')]();});}};}function handleEntityNotFound(_0x507cdf,_0x463a76){return function(_0x5ee4e8){if(!_0x5ee4e8){_0x507cdf[_0x29d3('0x1d')](0x194);}return _0x5ee4e8;};}function handleError(_0x58df45,_0x1b5833){_0x1b5833=_0x1b5833||0x1f4;return function(_0x43c658){logger[_0x29d3('0x2c')](_0x43c658['stack']);if(_0x43c658[_0x29d3('0x2d')]){delete _0x43c658[_0x29d3('0x2d')];}_0x58df45[_0x29d3('0x1e')](_0x1b5833)['send'](_0x43c658);};}exports[_0x29d3('0x2e')]=function(_0x3b61c9,_0x55fbf0){var _0x1bb61a={},_0x321928={},_0x35970c={'count':0x0,'rows':[]};var _0x4f0b4f=_[_0x29d3('0x2f')](db['ChatInternalMessage'][_0x29d3('0x30')],function(_0x1c0430){return{'name':_0x1c0430[_0x29d3('0x31')],'type':_0x1c0430[_0x29d3('0x32')][_0x29d3('0x33')]};});_0x321928[_0x29d3('0x34')]=_['map'](_0x4f0b4f,'name');_0x321928[_0x29d3('0x35')]=_[_0x29d3('0x36')](_0x3b61c9[_0x29d3('0x35')]);_0x321928[_0x29d3('0x37')]=_[_0x29d3('0x38')](_0x321928[_0x29d3('0x34')],_0x321928[_0x29d3('0x35')]);_0x1bb61a['attributes']=_[_0x29d3('0x38')](_0x321928[_0x29d3('0x34')],qs[_0x29d3('0x39')](_0x3b61c9['query'][_0x29d3('0x39')]));_0x1bb61a[_0x29d3('0x3a')]=_0x1bb61a['attributes'][_0x29d3('0x3b')]?_0x1bb61a[_0x29d3('0x3a')]:_0x321928[_0x29d3('0x34')];if(!_0x3b61c9[_0x29d3('0x35')][_0x29d3('0x3c')](_0x29d3('0x3d'))){_0x1bb61a[_0x29d3('0x24')]=qs[_0x29d3('0x24')](_0x3b61c9[_0x29d3('0x35')][_0x29d3('0x24')]);_0x1bb61a['offset']=qs[_0x29d3('0x21')](_0x3b61c9[_0x29d3('0x35')][_0x29d3('0x21')]);}_0x1bb61a['order']=qs[_0x29d3('0x3e')](_0x3b61c9[_0x29d3('0x35')][_0x29d3('0x3e')]);_0x1bb61a[_0x29d3('0x3f')]=qs[_0x29d3('0x37')](_[_0x29d3('0x40')](_0x3b61c9[_0x29d3('0x35')],_0x321928[_0x29d3('0x37')]),_0x4f0b4f);if(_0x3b61c9[_0x29d3('0x35')]['filter']){_0x1bb61a['where']=_[_0x29d3('0x41')](_0x1bb61a[_0x29d3('0x3f')],{'$or':_['map'](_0x4f0b4f,function(_0x438afb){if(_0x438afb[_0x29d3('0x32')]!==_0x29d3('0x42')){var _0x295708={};_0x295708[_0x438afb[_0x29d3('0x2d')]]={'$like':'%'+_0x3b61c9[_0x29d3('0x35')][_0x29d3('0x43')]+'%'};return _0x295708;}})});}_0x1bb61a=_[_0x29d3('0x41')]({},_0x1bb61a,_0x3b61c9['options']);var _0x4bb49a={'where':_0x1bb61a[_0x29d3('0x3f')]};return db[_0x29d3('0x44')]['count'](_0x4bb49a)[_0x29d3('0x2a')](function(_0x30a637){_0x35970c[_0x29d3('0x23')]=_0x30a637;if(_0x3b61c9[_0x29d3('0x35')][_0x29d3('0x45')]){_0x1bb61a[_0x29d3('0x46')]=[{'all':!![]}];}return db[_0x29d3('0x44')]['findAll'](_0x1bb61a);})[_0x29d3('0x2a')](function(_0x5c9025){_0x35970c[_0x29d3('0x47')]=_0x5c9025;return _0x35970c;})[_0x29d3('0x2a')](respondWithFilteredResult(_0x55fbf0,_0x1bb61a))[_0x29d3('0x48')](handleError(_0x55fbf0,null));};exports['show']=function(_0x491a3d,_0x2a1cdc){var _0x112f9e={'raw':!![],'where':{'id':_0x491a3d[_0x29d3('0x49')]['id']}},_0x5d9b0c={};_0x5d9b0c[_0x29d3('0x34')]=_[_0x29d3('0x36')](db[_0x29d3('0x44')][_0x29d3('0x30')]);_0x5d9b0c['query']=_['keys'](_0x491a3d['query']);_0x5d9b0c[_0x29d3('0x37')]=_[_0x29d3('0x38')](_0x5d9b0c[_0x29d3('0x34')],_0x5d9b0c[_0x29d3('0x35')]);_0x112f9e[_0x29d3('0x3a')]=_[_0x29d3('0x38')](_0x5d9b0c[_0x29d3('0x34')],qs[_0x29d3('0x39')](_0x491a3d['query']['fields']));_0x112f9e[_0x29d3('0x3a')]=_0x112f9e[_0x29d3('0x3a')][_0x29d3('0x3b')]?_0x112f9e[_0x29d3('0x3a')]:_0x5d9b0c[_0x29d3('0x34')];if(_0x491a3d['query'][_0x29d3('0x45')]){_0x112f9e['include']=[{'all':!![]}];}_0x112f9e=_[_0x29d3('0x41')]({},_0x112f9e,_0x491a3d[_0x29d3('0x4a')]);return db[_0x29d3('0x44')]['find'](_0x112f9e)[_0x29d3('0x2a')](handleEntityNotFound(_0x2a1cdc,null))[_0x29d3('0x2a')](respondWithResult(_0x2a1cdc,null))['catch'](handleError(_0x2a1cdc,null));};exports['create']=function(_0x18331e,_0x2bcb31){return db[_0x29d3('0x44')][_0x29d3('0x4b')](_0x18331e[_0x29d3('0x4c')],{})[_0x29d3('0x2a')](respondWithResult(_0x2bcb31,0xc9))[_0x29d3('0x48')](handleError(_0x2bcb31,null));};exports[_0x29d3('0x4d')]=function(_0x4b2423,_0x1abb7a){if(_0x4b2423[_0x29d3('0x4c')]['id']){delete _0x4b2423[_0x29d3('0x4c')]['id'];}return db[_0x29d3('0x44')][_0x29d3('0x4e')]({'where':{'id':_0x4b2423[_0x29d3('0x49')]['id']}})[_0x29d3('0x2a')](handleEntityNotFound(_0x1abb7a,null))[_0x29d3('0x2a')](saveUpdates(_0x4b2423[_0x29d3('0x4c')],null))[_0x29d3('0x2a')](respondWithResult(_0x1abb7a,null))[_0x29d3('0x48')](handleError(_0x1abb7a,null));};exports['destroy']=function(_0x3ecd70,_0x249ade){return db[_0x29d3('0x44')][_0x29d3('0x4e')]({'where':{'id':_0x3ecd70[_0x29d3('0x49')]['id']}})['then'](handleEntityNotFound(_0x249ade,null))[_0x29d3('0x2a')](removeEntity(_0x249ade,null))[_0x29d3('0x48')](handleError(_0x249ade,null));};exports[_0x29d3('0x4f')]=function(_0xdc8d4,_0x4fea19){return db[_0x29d3('0x44')][_0x29d3('0x4f')]()[_0x29d3('0x2a')](respondWithResult(_0x4fea19,null))[_0x29d3('0x48')](handleError(_0x4fea19,null));};function wrapUser(_0x38e909){return function(_0x1c297d){var _0x3048c7=_0x38e909[_0x29d3('0x50')]({'plain':!![]});_0x3048c7[_0x29d3('0x51')]=[];if(_0x1c297d){_0x3048c7[_0x29d3('0x52')]=_0x1c297d[_0x29d3('0x53')];_0x3048c7['lastMessage']=_0x1c297d;}else{_0x3048c7[_0x29d3('0x52')]=moment(0x0)[_0x29d3('0x54')](_0x29d3('0x55'));_0x3048c7[_0x29d3('0x56')]={};}return _0x3048c7;};}exports[_0x29d3('0x57')]=function(_0x83be9e,_0x5ba7e9,_0x288757){var _0x316a33=[];return db[_0x29d3('0x58')]['findAll']({'where':{'role':[_0x29d3('0x59'),_0x29d3('0x5a'),'user']},'attributes':['id',_0x29d3('0x5b'),'name',_0x29d3('0x5c'),_0x29d3('0x5d'),_0x29d3('0x5e'),_0x29d3('0x5f'),_0x29d3('0x60'),_0x29d3('0x61'),_0x29d3('0x62')],'order':qs[_0x29d3('0x3e')](_0x29d3('0x63')),'include':[{'model':db[_0x29d3('0x64')],'as':'VoiceQueues','attributes':['id',_0x29d3('0x2d'),_0x29d3('0x32')],'through':{'attributes':[]}}]})['then'](function(_0x2ee61c){if(_0x2ee61c){var _0x12e6ba=_0x83be9e[_0x29d3('0x65')][_0x29d3('0x50')]({'plain':!![]});if(!_0x12e6ba)throw new Error(_0x29d3('0x66'));if(_0x12e6ba[_0x29d3('0x5c')]==='user'){return db[_0x29d3('0x67')]['find']({'where':{'name':_0x29d3('0x68'),'userProfileId':_0x12e6ba[_0x29d3('0x69')]},'raw':!![]})[_0x29d3('0x2a')](function(_0x154ce9){if(_0x154ce9){if(_0x154ce9[_0x29d3('0x6a')]===0x0){return db['UserProfileResource'][_0x29d3('0x6b')]({'where':{'sectionId':_0x154ce9['id']},'raw':!![]})[_0x29d3('0x2a')](function(_0x438e4b){var _0x2afdb4=[];if(_[_0x29d3('0x6c')](_0x438e4b)){_0x2afdb4=_[_0x29d3('0x43')](_0x2ee61c,function(_0x27b87e){if(_0x27b87e[_0x29d3('0x5c')]!==_0x29d3('0x59')){return _0x27b87e;}});return _0x2afdb4;}else{for(var _0x257ddb=0x0;_0x257ddb<_0x2ee61c[_0x29d3('0x3b')];_0x257ddb++){var _0x3a8a70=_0x2ee61c[_0x257ddb];if(_0x3a8a70[_0x29d3('0x5c')]===_0x29d3('0x59')){var _0x5074c7=_[_0x29d3('0x4e')](_0x438e4b,function(_0x1c27de){return _0x1c27de[_0x29d3('0x6d')]===_0x3a8a70['id'];});if(_0x5074c7)_0x2afdb4[_0x29d3('0x6e')](_0x3a8a70);}else{_0x2afdb4[_0x29d3('0x6e')](_0x3a8a70);}}return _0x2afdb4;}});}else{return _0x2ee61c;}}else{var _0x513600=_['filter'](_0x2ee61c,function(_0x3d03e8){if(_0x3d03e8[_0x29d3('0x5c')]!=='agent'){return _0x3d03e8;}});return _0x513600;}});}else{return _0x2ee61c;}}})[_0x29d3('0x2a')](function(_0x5a0984){var _0x548d01=[];if(_0x5a0984){_0x316a33=_0x5a0984;for(var _0x37801e=0x0;_0x37801e<_0x5a0984[_0x29d3('0x3b')];_0x37801e+=0x1){_0x316a33[_0x37801e]['messages']=[];_0x548d01['push'](db[_0x29d3('0x44')]['find']({'where':{'FromId':[_0x83be9e[_0x29d3('0x65')]['id'],_0x5a0984[_0x37801e]['id']],'ToId':[_0x83be9e[_0x29d3('0x65')]['id'],_0x5a0984[_0x37801e]['id']],'ChatGroupId':null},'attributes':['id',_0x29d3('0x53'),'FromId',_0x29d3('0x6f'),_0x29d3('0x70'),_0x29d3('0x4c')],'order':qs[_0x29d3('0x3e')](_0x29d3('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5a0984[_0x37801e])));}return BPromise[_0x29d3('0x72')](_0x548d01);}return[];})[_0x29d3('0x2a')](function(_0x38f6e3){return{'rows':_0x38f6e3,'count':_0x38f6e3['length']};})[_0x29d3('0x2a')](respondWithResult(_0x5ba7e9,null))[_0x29d3('0x48')](handleError(_0x5ba7e9,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 0ed7172..1d6f46a 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 _0xea69=['exports','events','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x356d31,_0x151a64){var _0x3b6088=function(_0x26654a){while(--_0x26654a){_0x356d31['push'](_0x356d31['shift']());}};_0x3b6088(++_0x151a64);}(_0xea69,0x97));var _0x9ea6=function(_0x59c45a,_0x1886c4){_0x59c45a=_0x59c45a-0x0;var _0x527e17=_0xea69[_0x59c45a];return _0x527e17;};'use strict';var EventEmitter=require(_0x9ea6('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x9ea6('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x9ea6('0x2')](0x0);var events={'afterCreate':_0x9ea6('0x3'),'afterUpdate':_0x9ea6('0x4'),'afterDestroy':_0x9ea6('0x5')};function emitEvent(_0x43df72){return function(_0x2326e9,_0x58927f,_0x43ecb9){ChatInternalMessageEvents[_0x9ea6('0x6')](_0x43df72+':'+_0x2326e9['id'],_0x2326e9);ChatInternalMessageEvents[_0x9ea6('0x6')](_0x43df72,_0x2326e9);_0x43ecb9(null);};}for(var e in events){if(events[_0x9ea6('0x7')](e)){var event=events[e];ChatInternalMessage[_0x9ea6('0x8')](e,emitEvent(event));}}module[_0x9ea6('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xef2b=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x166b39,_0x2c7292){var _0x196a87=function(_0x99af69){while(--_0x99af69){_0x166b39['push'](_0x166b39['shift']());}};_0x196a87(++_0x2c7292);}(_0xef2b,0x164));var _0xbef2=function(_0x5e3f0f,_0x16c6c7){_0x5e3f0f=_0x5e3f0f-0x0;var _0xbd8d66=_0xef2b[_0x5e3f0f];return _0xbd8d66;};'use strict';var EventEmitter=require(_0xbef2('0x0'));var ChatInternalMessage=require(_0xbef2('0x1'))['db'][_0xbef2('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xbef2('0x3')](0x0);var events={'afterCreate':_0xbef2('0x4'),'afterUpdate':'update','afterDestroy':_0xbef2('0x5')};function emitEvent(_0x56e61a){return function(_0x29619f,_0x114f0e,_0x159f26){ChatInternalMessageEvents[_0xbef2('0x6')](_0x56e61a+':'+_0x29619f['id'],_0x29619f);ChatInternalMessageEvents['emit'](_0x56e61a,_0x29619f);_0x159f26(null);};}for(var e in events){if(events[_0xbef2('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xbef2('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 7d0361d..3bc9e41 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 _0xc006=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x31ed20,_0x2709b4){var _0x2379c9=function(_0x20ed02){while(--_0x20ed02){_0x31ed20['push'](_0x31ed20['shift']());}};_0x2379c9(++_0x2709b4);}(_0xc006,0x1de));var _0x6c00=function(_0x5c8f3e,_0x33ba70){_0x5c8f3e=_0x5c8f3e-0x0;var _0xb55f35=_0xc006[_0x5c8f3e];return _0xb55f35;};'use strict';var _=require(_0x6c00('0x0'));var util=require(_0x6c00('0x1'));var logger=require(_0x6c00('0x2'))(_0x6c00('0x3'));var moment=require(_0x6c00('0x4'));var BPromise=require(_0x6c00('0x5'));var rp=require(_0x6c00('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c00('0x7'));var config=require(_0x6c00('0x8'));var attributes=require(_0x6c00('0x9'));module[_0x6c00('0xa')]=function(_0x215e5b,_0x25671c){return _0x215e5b[_0x6c00('0xb')]('ChatInternalMessage',attributes,{'tableName':_0x6c00('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6c00('0xd'),'collate':_0x6c00('0xe')});};
\ No newline at end of file
+var _0xa5d6=['../../config/logger','api','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xa5d6,0x7c));var _0x6a5d=function(_0x3f71a4,_0x30c6fe){_0x3f71a4=_0x3f71a4-0x0;var _0x11f064=_0xa5d6[_0x3f71a4];return _0x11f064;};'use strict';var _=require(_0x6a5d('0x0'));var util=require(_0x6a5d('0x1'));var logger=require(_0x6a5d('0x2'))(_0x6a5d('0x3'));var moment=require('moment');var BPromise=require(_0x6a5d('0x4'));var rp=require(_0x6a5d('0x5'));var fs=require('fs');var path=require(_0x6a5d('0x6'));var rimraf=require(_0x6a5d('0x7'));var config=require('../../config/environment');var attributes=require(_0x6a5d('0x8'));module[_0x6a5d('0x9')]=function(_0x481847,_0x30d703){return _0x481847[_0x6a5d('0xa')](_0x6a5d('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6a5d('0xc'),'collate':_0x6a5d('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 335eb99..826b603 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 _0xbe43=['../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4ded39,_0x146dd4){var _0x1259b1=function(_0x3f3ae4){while(--_0x3f3ae4){_0x4ded39['push'](_0x4ded39['shift']());}};_0x1259b1(++_0x146dd4);}(_0xbe43,0xbb));var _0x3be4=function(_0x2cc338,_0x5585d8){_0x2cc338=_0x2cc338-0x0;var _0x2a8920=_0xbe43[_0x2cc338];return _0x2a8920;};'use strict';var _=require(_0x3be4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3be4('0x1'));var fs=require('fs');var Redis=require(_0x3be4('0x2'));var db=require(_0x3be4('0x3'))['db'];var utils=require(_0x3be4('0x4'));var logger=require(_0x3be4('0x5'))('rpc');var config=require(_0x3be4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3be4('0x7')][_0x3be4('0x8')]({'port':0x232a});config[_0x3be4('0x9')]=_['defaults'](config['redis'],{'host':_0x3be4('0xa'),'port':0x18eb});var socket=require(_0x3be4('0xb'))(new Redis(config[_0x3be4('0x9')]));require(_0x3be4('0xc'))['register'](socket);function respondWithRpcPromise(_0x3d7c0d,_0x15b4e6,_0x5ef2ea){return new BPromise(function(_0x11209b,_0x5effd4){return client[_0x3be4('0xd')](_0x3d7c0d,_0x5ef2ea)[_0x3be4('0xe')](function(_0x4ae979){logger[_0x3be4('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x15b4e6,_0x3be4('0x10'));logger['debug'](_0x3be4('0x11'),_0x15b4e6,_0x3be4('0x10'),JSON[_0x3be4('0x12')](_0x4ae979));if(_0x4ae979[_0x3be4('0x13')]){if(_0x4ae979[_0x3be4('0x13')][_0x3be4('0x14')]===0x1f4){logger['error'](_0x3be4('0x15'),_0x15b4e6,_0x4ae979[_0x3be4('0x13')]['message']);return _0x5effd4(_0x4ae979[_0x3be4('0x13')][_0x3be4('0x16')]);}logger['error'](_0x3be4('0x15'),_0x15b4e6,_0x4ae979['error'][_0x3be4('0x16')]);return _0x11209b(_0x4ae979['error'][_0x3be4('0x16')]);}else{logger[_0x3be4('0xf')](_0x3be4('0x15'),_0x15b4e6,_0x3be4('0x10'));_0x11209b(_0x4ae979[_0x3be4('0x17')][_0x3be4('0x16')]);}})['catch'](function(_0x547a92){logger[_0x3be4('0x13')](_0x3be4('0x15'),_0x15b4e6,_0x547a92);_0x5effd4(_0x547a92);});});}
\ No newline at end of file
+var _0x0e7a=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then'];(function(_0x4b1ea1,_0xff5112){var _0x1cf493=function(_0x4ceec6){while(--_0x4ceec6){_0x4b1ea1['push'](_0x4b1ea1['shift']());}};_0x1cf493(++_0xff5112);}(_0x0e7a,0x71));var _0xa0e7=function(_0x214266,_0x1f6f52){_0x214266=_0x214266-0x0;var _0x568f75=_0x0e7a[_0x214266];return _0x568f75;};'use strict';var _=require(_0xa0e7('0x0'));var util=require(_0xa0e7('0x1'));var moment=require(_0xa0e7('0x2'));var BPromise=require('bluebird');var rs=require(_0xa0e7('0x3'));var fs=require('fs');var Redis=require(_0xa0e7('0x4'));var db=require(_0xa0e7('0x5'))['db'];var utils=require(_0xa0e7('0x6'));var logger=require('../../config/logger')(_0xa0e7('0x7'));var config=require(_0xa0e7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa0e7('0x9')][_0xa0e7('0xa')]({'port':0x232a});config[_0xa0e7('0xb')]=_[_0xa0e7('0xc')](config['redis'],{'host':_0xa0e7('0xd'),'port':0x18eb});var socket=require(_0xa0e7('0xe'))(new Redis(config[_0xa0e7('0xb')]));require('./chatInternalMessage.socket')[_0xa0e7('0xf')](socket);function respondWithRpcPromise(_0x992df1,_0xc4dc84,_0x24cc32){return new BPromise(function(_0x44f3ec,_0x4cd892){return client['request'](_0x992df1,_0x24cc32)[_0xa0e7('0x10')](function(_0x293867){logger['info'](_0xa0e7('0x11'),_0xc4dc84,_0xa0e7('0x12'));logger['debug'](_0xa0e7('0x13'),_0xc4dc84,'request\x20sent',JSON[_0xa0e7('0x14')](_0x293867));if(_0x293867[_0xa0e7('0x15')]){if(_0x293867[_0xa0e7('0x15')][_0xa0e7('0x16')]===0x1f4){logger[_0xa0e7('0x15')](_0xa0e7('0x11'),_0xc4dc84,_0x293867['error'][_0xa0e7('0x17')]);return _0x4cd892(_0x293867[_0xa0e7('0x15')][_0xa0e7('0x17')]);}logger[_0xa0e7('0x15')](_0xa0e7('0x11'),_0xc4dc84,_0x293867[_0xa0e7('0x15')]['message']);return _0x44f3ec(_0x293867[_0xa0e7('0x15')][_0xa0e7('0x17')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0xc4dc84,_0xa0e7('0x12'));_0x44f3ec(_0x293867[_0xa0e7('0x18')][_0xa0e7('0x17')]);}})[_0xa0e7('0x19')](function(_0x49d432){logger[_0xa0e7('0x15')](_0xa0e7('0x11'),_0xc4dc84,_0x49d432);_0x4cd892(_0x49d432);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 4cd5f7c..4764813 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 _0xacea=['update','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xacea,0x1ed));var _0xaace=function(_0x21e75a,_0x40dc8a){_0x21e75a=_0x21e75a-0x0;var _0x6972f8=_0xacea[_0x21e75a];return _0x6972f8;};'use strict';var ChatInternalMessageEvents=require(_0xaace('0x0'));var events=[_0xaace('0x1'),_0xaace('0x2'),_0xaace('0x3')];function createListener(_0x53a913,_0x22ac89){return function(_0x335bb4){_0x22ac89['emit'](_0x53a913,_0x335bb4);};}function removeListener(_0x376786,_0x92c34){return function(){ChatInternalMessageEvents[_0xaace('0x4')](_0x376786,_0x92c34);};}exports[_0xaace('0x5')]=function(_0x203fcf){for(var _0x30e7b0=0x0,_0x52a453=events[_0xaace('0x6')];_0x30e7b0<_0x52a453;_0x30e7b0++){var _0x4d6d51=events[_0x30e7b0];var _0xbd98e0=createListener(_0xaace('0x7')+_0x4d6d51,_0x203fcf);ChatInternalMessageEvents['on'](_0x4d6d51,_0xbd98e0);}};
\ No newline at end of file
+var _0x3d45=['save','remove','update','removeListener','register','chatInternalMessage:'];(function(_0x48b55f,_0x2a17e7){var _0x524a3c=function(_0x4d834a){while(--_0x4d834a){_0x48b55f['push'](_0x48b55f['shift']());}};_0x524a3c(++_0x2a17e7);}(_0x3d45,0x66));var _0x53d4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3d45[_0x3b380d];return _0x54502b;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x53d4('0x0'),_0x53d4('0x1'),_0x53d4('0x2')];function createListener(_0x2ef7cf,_0x3c660f){return function(_0x203329){_0x3c660f['emit'](_0x2ef7cf,_0x203329);};}function removeListener(_0x3ff2fe,_0x1a31fa){return function(){ChatInternalMessageEvents[_0x53d4('0x3')](_0x3ff2fe,_0x1a31fa);};}exports[_0x53d4('0x4')]=function(_0x571070){for(var _0x2f8160=0x0,_0xce6568=events['length'];_0x2f8160<_0xce6568;_0x2f8160++){var _0x57bd0d=events[_0x2f8160];var _0x59e469=createListener(_0x53d4('0x5')+_0x57bd0d,_0x571070);ChatInternalMessageEvents['on'](_0x57bd0d,_0x59e469);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index c956304..7ee3758 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 _0x0b59=['index','/describe','describe','/users','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get'];(function(_0x391127,_0x5cb2df){var _0x3c4c11=function(_0x350e7){while(--_0x350e7){_0x391127['push'](_0x391127['shift']());}};_0x3c4c11(++_0x5cb2df);}(_0x0b59,0xae));var _0x90b5=function(_0x6a3b0,_0x3ffffe){_0x6a3b0=_0x6a3b0-0x0;var _0x124558=_0x0b59[_0x6a3b0];return _0x124558;};'use strict';var multer=require(_0x90b5('0x0'));var util=require(_0x90b5('0x1'));var path=require(_0x90b5('0x2'));var timeout=require(_0x90b5('0x3'));var express=require(_0x90b5('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x90b5('0x5'));var interaction=require(_0x90b5('0x6'));var config=require(_0x90b5('0x7'));var controller=require(_0x90b5('0x8'));router[_0x90b5('0x9')]('/',auth['isAuthenticated'](),controller[_0x90b5('0xa')]);router[_0x90b5('0x9')](_0x90b5('0xb'),auth['isAuthenticated'](),controller[_0x90b5('0xc')]);router[_0x90b5('0x9')](_0x90b5('0xd'),auth[_0x90b5('0xe')](),controller['getUsers']);router[_0x90b5('0x9')](_0x90b5('0xf'),auth[_0x90b5('0xe')](),controller[_0x90b5('0x10')]);router['post']('/',auth[_0x90b5('0xe')](),controller[_0x90b5('0x11')]);router[_0x90b5('0x12')](_0x90b5('0xf'),controller[_0x90b5('0x13')]);router[_0x90b5('0x14')]('/:id',auth[_0x90b5('0xe')](),controller[_0x90b5('0x15')]);module[_0x90b5('0x16')]=router;
\ No newline at end of file
+var _0x9ad3=['fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','/users','getUsers','/:id','show','post','put','update','destroy','util','path','connect-timeout','express'];(function(_0x2b0686,_0xff7aca){var _0xe364a0=function(_0x317360){while(--_0x317360){_0x2b0686['push'](_0x2b0686['shift']());}};_0xe364a0(++_0xff7aca);}(_0x9ad3,0x161));var _0x39ad=function(_0x348088,_0xfdc11d){_0x348088=_0x348088-0x0;var _0x4d43a7=_0x9ad3[_0x348088];return _0x4d43a7;};'use strict';var multer=require('multer');var util=require(_0x39ad('0x0'));var path=require(_0x39ad('0x1'));var timeout=require(_0x39ad('0x2'));var express=require(_0x39ad('0x3'));var router=express['Router']();var fs_extra=require(_0x39ad('0x4'));var auth=require(_0x39ad('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x39ad('0x6'));var controller=require(_0x39ad('0x7'));router[_0x39ad('0x8')]('/',auth['isAuthenticated'](),controller[_0x39ad('0x9')]);router['get'](_0x39ad('0xa'),auth[_0x39ad('0xb')](),controller[_0x39ad('0xc')]);router['get'](_0x39ad('0xd'),auth[_0x39ad('0xb')](),controller[_0x39ad('0xe')]);router['get'](_0x39ad('0xf'),auth[_0x39ad('0xb')](),controller[_0x39ad('0x10')]);router[_0x39ad('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x39ad('0x12')]('/:id',controller[_0x39ad('0x13')]);router['delete'](_0x39ad('0xf'),auth[_0x39ad('0xb')](),controller[_0x39ad('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index ce2fe3f..8225655 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 _0x8580=['medium','ENUM','out','DATE','STRING','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8580,0x1c7));var _0x0858=function(_0x1ded08,_0x137e95){_0x1ded08=_0x1ded08-0x0;var _0x290eff=_0x8580[_0x1ded08];return _0x290eff;};'use strict';var Sequelize=require('sequelize');module[_0x0858('0x0')]={'body':{'type':Sequelize['TEXT'](_0x0858('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0858('0x2')]('in',_0x0858('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x0858('0x4')]},'providerName':{'type':Sequelize[_0x0858('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x1bc6=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x1bc6,0x94));var _0x61bc=function(_0x1a841e,_0x5d813e){_0x1a841e=_0x1a841e-0x0;var _0x32d59e=_0x1bc6[_0x1a841e];return _0x32d59e;};'use strict';var Sequelize=require(_0x61bc('0x0'));module[_0x61bc('0x1')]={'body':{'type':Sequelize[_0x61bc('0x2')](_0x61bc('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x61bc('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x61bc('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x61bc('0x5')]('in','out'),'defaultValue':_0x61bc('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x61bc('0x7')]},'providerName':{'type':Sequelize[_0x61bc('0x8')]},'providerResponse':{'type':Sequelize[_0x61bc('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 5e2b0e4..bb62a65 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 _0x0e87=['../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','chat-interactions','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','count','limit','Content-Range','json','update','destroy','sendStatus','stack','name','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','rows','includeAll','create','body','find','params','describe','chat','acceptMessage','reject','UserId','user','agent','get','ChatInteraction','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','internal','interface','format','SIP/%s','channel','motionChannel','EventManager','rejectmessage','interaction','util','lodash','../../components/interaction/service'];(function(_0x9709ce,_0x5765af){var _0x414c87=function(_0x51149b){while(--_0x51149b){_0x9709ce['push'](_0x9709ce['shift']());}};_0x414c87(++_0x5765af);}(_0x0e87,0x64));var _0x70e8=function(_0x1b72de,_0x525ddc){_0x1b72de=_0x1b72de-0x0;var _0x17618f=_0x0e87[_0x1b72de];return _0x17618f;};'use strict';var util=require(_0x70e8('0x0'));var _=require(_0x70e8('0x1'));var Redis=require('ioredis');var interactionService=require(_0x70e8('0x2'));var qs=require(_0x70e8('0x3'));var logger=require(_0x70e8('0x4'))(_0x70e8('0x5'));var config=require(_0x70e8('0x6'));var db=require(_0x70e8('0x7'))['db'];config[_0x70e8('0x8')]=_[_0x70e8('0x9')](config[_0x70e8('0x8')],{'host':_0x70e8('0xa'),'port':0x18eb});var socket=require(_0x70e8('0xb'))(new Redis(config['redis']));require(_0x70e8('0xc'))[_0x70e8('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0x70e8('0xe')][_0x70e8('0xf')]({'port':0x232c});var client9002=jayson[_0x70e8('0xe')][_0x70e8('0xf')]({'port':0x232a});var interaction_log=require(_0x70e8('0x4'))(_0x70e8('0x10'));function respondWithRpcPromise(_0x40b2f8,_0x64512f,_0x763b4e,_0x3c7ff0){return new Promise(function(_0x13f9df,_0xcb74ad){var _0x3f618d=_0x3c7ff0||client;return _0x3f618d[_0x70e8('0x11')](_0x40b2f8,_0x763b4e)[_0x70e8('0x12')](function(_0x3b6e81){logger[_0x70e8('0x13')](_0x70e8('0x14'),_0x64512f,_0x70e8('0x15'));logger[_0x70e8('0x16')](_0x70e8('0x17'),_0x64512f,'request\x20sent',JSON[_0x70e8('0x18')](_0x3b6e81));if(_0x3b6e81[_0x70e8('0x19')]){if(_0x3b6e81[_0x70e8('0x19')][_0x70e8('0x1a')]===0x1f4){logger[_0x70e8('0x19')](_0x70e8('0x14'),_0x64512f,_0x3b6e81[_0x70e8('0x19')]['message']);return _0xcb74ad(_0x3b6e81[_0x70e8('0x19')][_0x70e8('0x1b')]);}logger[_0x70e8('0x19')]('ChatMessage,\x20%s,\x20%s',_0x64512f,_0x3b6e81[_0x70e8('0x19')][_0x70e8('0x1b')]);return _0x13f9df(_0x3b6e81[_0x70e8('0x19')][_0x70e8('0x1b')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x64512f,_0x70e8('0x15'));_0x13f9df(_0x3b6e81[_0x70e8('0x1c')]['message']);}})[_0x70e8('0x1d')](function(_0x42eca9){logger[_0x70e8('0x19')](_0x70e8('0x14'),_0x64512f,_0x42eca9);_0xcb74ad(_0x42eca9);});});}function respondWithResult(_0x2d1e4b,_0x3a68b4){_0x3a68b4=_0x3a68b4||0xc8;return function(_0x458d22){if(_0x458d22){return _0x2d1e4b[_0x70e8('0x1e')](_0x3a68b4)['json'](_0x458d22);}};}function respondWithFilteredResult(_0x294f9b,_0x3a5d00){return function(_0x4cbc81){if(_0x4cbc81){var _0x241645=typeof _0x3a5d00[_0x70e8('0x1f')]==='undefined'&&typeof _0x3a5d00['limit']===_0x70e8('0x20');var _0x3bd1c5=_0x4cbc81['count'];var _0x37b862=_0x241645?0x0:_0x3a5d00[_0x70e8('0x1f')];var _0x9c664a=_0x241645?_0x4cbc81[_0x70e8('0x21')]:_0x3a5d00[_0x70e8('0x1f')]+_0x3a5d00[_0x70e8('0x22')];var _0x1882d5;if(_0x9c664a>=_0x3bd1c5){_0x9c664a=_0x3bd1c5;_0x1882d5=0xc8;}else{_0x1882d5=0xce;}_0x294f9b[_0x70e8('0x1e')](_0x1882d5);return _0x294f9b['set'](_0x70e8('0x23'),_0x37b862+'-'+_0x9c664a+'/'+_0x3bd1c5)[_0x70e8('0x24')](_0x4cbc81);}return null;};}function saveUpdates(_0x16fd20){return function(_0x128471){if(_0x128471){return _0x128471[_0x70e8('0x25')](_0x16fd20)['then'](function(_0x4550bd){return _0x4550bd;});}return null;};}function removeEntity(_0x7d5821){return function(_0x10091f){if(_0x10091f){return _0x10091f[_0x70e8('0x26')]()[_0x70e8('0x12')](function(){_0x7d5821[_0x70e8('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e9d43){return function(_0x25dc34){if(!_0x25dc34){_0x3e9d43[_0x70e8('0x27')](0x194);}return _0x25dc34;};}function handleError(_0x53a543,_0x39905f){_0x39905f=_0x39905f||0x1f4;return function(_0x58eb84){logger['error'](_0x58eb84[_0x70e8('0x28')]);if(_0x58eb84[_0x70e8('0x29')]){delete _0x58eb84[_0x70e8('0x29')];}_0x53a543['status'](_0x39905f)['send'](_0x58eb84);};}exports['index']=function(_0x1cd4dc,_0x2eb92a){var _0x1ee6e2={},_0x11eba0={},_0x29a1be={'count':0x0,'rows':[]};var _0x3990ab=_['map'](db[_0x70e8('0x2a')][_0x70e8('0x2b')],function(_0x3f4f5b){return{'name':_0x3f4f5b[_0x70e8('0x2c')],'type':_0x3f4f5b[_0x70e8('0x2d')][_0x70e8('0x2e')]};});_0x11eba0[_0x70e8('0x2f')]=_['map'](_0x3990ab,_0x70e8('0x29'));_0x11eba0[_0x70e8('0x30')]=_[_0x70e8('0x31')](_0x1cd4dc[_0x70e8('0x30')]);_0x11eba0[_0x70e8('0x32')]=_[_0x70e8('0x33')](_0x11eba0['model'],_0x11eba0[_0x70e8('0x30')]);_0x1ee6e2[_0x70e8('0x34')]=_[_0x70e8('0x33')](_0x11eba0[_0x70e8('0x2f')],qs[_0x70e8('0x35')](_0x1cd4dc[_0x70e8('0x30')]['fields']));_0x1ee6e2[_0x70e8('0x34')]=_0x1ee6e2[_0x70e8('0x34')][_0x70e8('0x36')]?_0x1ee6e2[_0x70e8('0x34')]:_0x11eba0[_0x70e8('0x2f')];if(!_0x1cd4dc[_0x70e8('0x30')][_0x70e8('0x37')](_0x70e8('0x38'))){_0x1ee6e2[_0x70e8('0x22')]=qs[_0x70e8('0x22')](_0x1cd4dc['query'][_0x70e8('0x22')]);_0x1ee6e2['offset']=qs['offset'](_0x1cd4dc[_0x70e8('0x30')][_0x70e8('0x1f')]);}_0x1ee6e2[_0x70e8('0x39')]=qs[_0x70e8('0x3a')](_0x1cd4dc[_0x70e8('0x30')]['sort']);_0x1ee6e2[_0x70e8('0x3b')]=qs[_0x70e8('0x32')](_[_0x70e8('0x3c')](_0x1cd4dc[_0x70e8('0x30')],_0x11eba0[_0x70e8('0x32')]),_0x3990ab);if(_0x1cd4dc[_0x70e8('0x30')][_0x70e8('0x3d')]){_0x1ee6e2[_0x70e8('0x3b')]=_[_0x70e8('0x3e')](_0x1ee6e2['where'],{'$or':_[_0x70e8('0x3f')](_0x3990ab,function(_0xc72a61){if(_0xc72a61[_0x70e8('0x2d')]!==_0x70e8('0x40')){var _0x53e0a8={};_0x53e0a8[_0xc72a61[_0x70e8('0x29')]]={'$like':'%'+_0x1cd4dc[_0x70e8('0x30')][_0x70e8('0x3d')]+'%'};return _0x53e0a8;}})});}_0x1ee6e2=_['merge']({},_0x1ee6e2,_0x1cd4dc[_0x70e8('0x41')]);var _0x4c1956={'where':_0x1ee6e2[_0x70e8('0x3b')]};return db['ChatMessage'][_0x70e8('0x21')](_0x4c1956)[_0x70e8('0x12')](function(_0x210347){_0x29a1be['count']=_0x210347;if(_0x1cd4dc[_0x70e8('0x30')]['includeAll']){_0x1ee6e2[_0x70e8('0x42')]=[{'all':!![]}];}return db[_0x70e8('0x2a')]['findAll'](_0x1ee6e2);})[_0x70e8('0x12')](function(_0x293eb3){_0x29a1be[_0x70e8('0x43')]=_0x293eb3;return _0x29a1be;})[_0x70e8('0x12')](respondWithFilteredResult(_0x2eb92a,_0x1ee6e2))[_0x70e8('0x1d')](handleError(_0x2eb92a,null));};exports['show']=function(_0x2b1b11,_0x209e0c){var _0x205f48={'raw':!![],'where':{'id':_0x2b1b11['params']['id']}},_0x3f8093={};_0x3f8093['model']=_['keys'](db[_0x70e8('0x2a')][_0x70e8('0x2b')]);_0x3f8093[_0x70e8('0x30')]=_[_0x70e8('0x31')](_0x2b1b11[_0x70e8('0x30')]);_0x3f8093['filters']=_[_0x70e8('0x33')](_0x3f8093[_0x70e8('0x2f')],_0x3f8093[_0x70e8('0x30')]);_0x205f48[_0x70e8('0x34')]=_[_0x70e8('0x33')](_0x3f8093[_0x70e8('0x2f')],qs[_0x70e8('0x35')](_0x2b1b11['query'][_0x70e8('0x35')]));_0x205f48[_0x70e8('0x34')]=_0x205f48['attributes'][_0x70e8('0x36')]?_0x205f48[_0x70e8('0x34')]:_0x3f8093[_0x70e8('0x2f')];if(_0x2b1b11[_0x70e8('0x30')][_0x70e8('0x44')]){_0x205f48['include']=[{'all':!![]}];}_0x205f48=_[_0x70e8('0x3e')]({},_0x205f48,_0x2b1b11['options']);return db[_0x70e8('0x2a')]['find'](_0x205f48)[_0x70e8('0x12')](handleEntityNotFound(_0x209e0c,null))[_0x70e8('0x12')](respondWithResult(_0x209e0c,null))[_0x70e8('0x1d')](handleError(_0x209e0c,null));};exports[_0x70e8('0x45')]=function(_0x497fa6,_0xc56069){return db[_0x70e8('0x2a')][_0x70e8('0x45')](_0x497fa6[_0x70e8('0x46')],{})[_0x70e8('0x12')](respondWithResult(_0xc56069,0xc9))[_0x70e8('0x1d')](handleError(_0xc56069,null));};exports[_0x70e8('0x25')]=function(_0x17d1db,_0x3ac69b){if(_0x17d1db[_0x70e8('0x46')]['id']){delete _0x17d1db['body']['id'];}return db[_0x70e8('0x2a')][_0x70e8('0x47')]({'where':{'id':_0x17d1db[_0x70e8('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ac69b,null))[_0x70e8('0x12')](saveUpdates(_0x17d1db[_0x70e8('0x46')],null))[_0x70e8('0x12')](respondWithResult(_0x3ac69b,null))[_0x70e8('0x1d')](handleError(_0x3ac69b,null));};exports[_0x70e8('0x26')]=function(_0x4011a,_0x39bc54){return db[_0x70e8('0x2a')]['find']({'where':{'id':_0x4011a[_0x70e8('0x48')]['id']}})[_0x70e8('0x12')](handleEntityNotFound(_0x39bc54,null))[_0x70e8('0x12')](removeEntity(_0x39bc54,null))[_0x70e8('0x1d')](handleError(_0x39bc54,null));};exports['describe']=function(_0x51aa77,_0x55dc4a){return db[_0x70e8('0x2a')][_0x70e8('0x49')]()['then'](respondWithResult(_0x55dc4a,null))['catch'](handleError(_0x55dc4a,null));};exports['accept']=function(_0x28b77a,_0x3eb6dd){var _0x5c5f4a=_0x70e8('0x4a');return interactionService[_0x70e8('0x4b')](_0x28b77a,_0x5c5f4a)[_0x70e8('0x12')](respondWithResult(_0x3eb6dd,null))[_0x70e8('0x1d')](handleError(_0x3eb6dd,null));};exports[_0x70e8('0x4c')]=function(_0x503428,_0x57923d){var _0x2c83d2={'agent':{},'channel':_0x70e8('0x4a')};if(_0x503428[_0x70e8('0x46')]['id']){delete _0x503428[_0x70e8('0x46')]['id'];}_0x503428['body'][_0x70e8('0x4d')]=_0x503428[_0x70e8('0x46')][_0x70e8('0x4d')]||_0x503428[_0x70e8('0x4e')]['id'];_0x2c83d2[_0x70e8('0x4f')]['id']=_0x503428[_0x70e8('0x46')][_0x70e8('0x4d')];return db[_0x70e8('0x2a')]['find']({'where':{'id':_0x503428[_0x70e8('0x48')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x57923d,null))[_0x70e8('0x12')](function(_0x1b783d){if(_0x1b783d){_0x2c83d2[_0x70e8('0x1b')]=_0x1b783d[_0x70e8('0x50')]({'plain':!![]});return db[_0x70e8('0x51')][_0x70e8('0x47')]({'where':{'id':_0x1b783d[_0x70e8('0x52')]}});}return null;})[_0x70e8('0x12')](handleEntityNotFound(_0x57923d,null))[_0x70e8('0x12')](function(_0x357c85){if(_0x357c85){_0x2c83d2['interaction']=_0x357c85['get']({'plain':!![]});interaction_log[_0x70e8('0x13')](_0x70e8('0x53'),_0x503428['user']['id'],_0x503428[_0x70e8('0x4e')][_0x70e8('0x29')],_0x503428[_0x70e8('0x4e')]['role'],_0x2c83d2['interaction']['id'],_0x503428['body']?JSON['stringify'](_0x503428[_0x70e8('0x46')]):_0x70e8('0x54'));return respondWithRpcPromise(_0x70e8('0x55'),_0x70e8('0x56'),_0x2c83d2);}return null;})['then'](function(_0x38d478){var _0x18ce5f=_0x70e8('0x57')+_0x38d478[_0x70e8('0x1b')][_0x70e8('0x58')];return db[_0x70e8('0x59')][_0x70e8('0x30')](_0x18ce5f,{'type':db['Sequelize'][_0x70e8('0x5a')][_0x70e8('0x5b')],'raw':!![]})['then'](function(_0x1d52f4){return _0x1d52f4;});})[_0x70e8('0x12')](function(_0x16b862){if(_0x16b862){_0x2c83d2[_0x70e8('0x1b')][_0x70e8('0x5c')]=_0x16b862[0x0];if(!_0x503428[_0x70e8('0x46')][_0x70e8('0x4d')])return;return db['User']['find']({'where':{'id':_0x503428['body'][_0x70e8('0x4d')],'role':_0x70e8('0x4f')},'attributes':['id','name',_0x70e8('0x5d'),'email',_0x70e8('0x5e')],'raw':!![]});}return null;})[_0x70e8('0x12')](function(_0x4ba089){if(!_0x4ba089)return null;_0x2c83d2[_0x70e8('0x1b')][_0x70e8('0x4f')]=_0x4ba089;return _0x2c83d2;})[_0x70e8('0x12')](function(_0xbf2a9b){if(_0xbf2a9b){_0xbf2a9b['message'][_0x70e8('0x5f')]=util[_0x70e8('0x60')](_0x70e8('0x61'),_0x503428['user'][_0x70e8('0x29')]);_0xbf2a9b['message'][_0x70e8('0x62')]=_0x2c83d2['channel'];_0xbf2a9b['message'][_0x70e8('0x63')]=_0x2c83d2[_0x70e8('0x62')];_0xbf2a9b[_0x70e8('0x1b')]['event']=_0x70e8('0x4c');respondWithRpcPromise(_0x70e8('0x64'),'EventManager',{'event':_0x70e8('0x65'),'message':_[_0x70e8('0x3e')](_0x2c83d2[_0x70e8('0x1b')],JSON['parse'](_0x2c83d2[_0x70e8('0x66')]['formData']))},client9002);return _0x2c83d2;}return null;})[_0x70e8('0x12')](respondWithResult(_0x57923d,null))[_0x70e8('0x1d')](handleError(_0x57923d,null));};
\ No newline at end of file
+var _0xe8f3=['role','null','RejectMessage','ContactId','Sequelize','QueryTypes','contact','User','fullname','email','internal','format','channel','motionChannel','event','EventManager','rejectmessage','parse','interaction','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','client','http','chat-interactions','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','undefined','limit','count','offset','set','Content-Range','json','update','then','end','sendStatus','stack','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','ChatMessage','findAll','rows','length','find','create','body','params','describe','accept','chat','reject','UserId','user','agent','get','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x218d84,_0x2f43d2){var _0xdbeedf=function(_0x16db2a){while(--_0x16db2a){_0x218d84['push'](_0x218d84['shift']());}};_0xdbeedf(++_0x2f43d2);}(_0xe8f3,0x77));var _0x3e8f=function(_0x3018eb,_0x570c63){_0x3018eb=_0x3018eb-0x0;var _0x23131f=_0xe8f3[_0x3018eb];return _0x23131f;};'use strict';var util=require(_0x3e8f('0x0'));var _=require(_0x3e8f('0x1'));var Redis=require(_0x3e8f('0x2'));var interactionService=require(_0x3e8f('0x3'));var qs=require(_0x3e8f('0x4'));var logger=require(_0x3e8f('0x5'))('api');var config=require(_0x3e8f('0x6'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3e8f('0x7')](config[_0x3e8f('0x8')],{'host':_0x3e8f('0x9'),'port':0x18eb});var socket=require(_0x3e8f('0xa'))(new Redis(config[_0x3e8f('0x8')]));require(_0x3e8f('0xb'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x3e8f('0xc')][_0x3e8f('0xd')]({'port':0x232c});var client9002=jayson[_0x3e8f('0xc')][_0x3e8f('0xd')]({'port':0x232a});var interaction_log=require('../../config/logger')(_0x3e8f('0xe'));function respondWithRpcPromise(_0x1c7949,_0x244066,_0x4931f6,_0x4ab24f){return new Promise(function(_0x2054e6,_0x1b5f57){var _0x5bf946=_0x4ab24f||client;return _0x5bf946[_0x3e8f('0xf')](_0x1c7949,_0x4931f6)['then'](function(_0x255f60){logger[_0x3e8f('0x10')](_0x3e8f('0x11'),_0x244066,_0x3e8f('0x12'));logger[_0x3e8f('0x13')](_0x3e8f('0x14'),_0x244066,'request\x20sent',JSON[_0x3e8f('0x15')](_0x255f60));if(_0x255f60[_0x3e8f('0x16')]){if(_0x255f60[_0x3e8f('0x16')]['code']===0x1f4){logger['error'](_0x3e8f('0x11'),_0x244066,_0x255f60[_0x3e8f('0x16')]['message']);return _0x1b5f57(_0x255f60[_0x3e8f('0x16')][_0x3e8f('0x17')]);}logger[_0x3e8f('0x16')](_0x3e8f('0x11'),_0x244066,_0x255f60[_0x3e8f('0x16')][_0x3e8f('0x17')]);return _0x2054e6(_0x255f60[_0x3e8f('0x16')]['message']);}else{logger[_0x3e8f('0x10')](_0x3e8f('0x11'),_0x244066,_0x3e8f('0x12'));_0x2054e6(_0x255f60[_0x3e8f('0x18')][_0x3e8f('0x17')]);}})[_0x3e8f('0x19')](function(_0x348a3c){logger['error']('ChatMessage,\x20%s,\x20%s',_0x244066,_0x348a3c);_0x1b5f57(_0x348a3c);});});}function respondWithResult(_0x5acff4,_0x1cc394){_0x1cc394=_0x1cc394||0xc8;return function(_0x18c487){if(_0x18c487){return _0x5acff4[_0x3e8f('0x1a')](_0x1cc394)['json'](_0x18c487);}};}function respondWithFilteredResult(_0x523a77,_0x585ea9){return function(_0x1c995d){if(_0x1c995d){var _0x55071b=typeof _0x585ea9['offset']===_0x3e8f('0x1b')&&typeof _0x585ea9[_0x3e8f('0x1c')]===_0x3e8f('0x1b');var _0x555b60=_0x1c995d[_0x3e8f('0x1d')];var _0x530c34=_0x55071b?0x0:_0x585ea9[_0x3e8f('0x1e')];var _0x3a8511=_0x55071b?_0x1c995d[_0x3e8f('0x1d')]:_0x585ea9['offset']+_0x585ea9[_0x3e8f('0x1c')];var _0x5f5412;if(_0x3a8511>=_0x555b60){_0x3a8511=_0x555b60;_0x5f5412=0xc8;}else{_0x5f5412=0xce;}_0x523a77[_0x3e8f('0x1a')](_0x5f5412);return _0x523a77[_0x3e8f('0x1f')](_0x3e8f('0x20'),_0x530c34+'-'+_0x3a8511+'/'+_0x555b60)[_0x3e8f('0x21')](_0x1c995d);}return null;};}function saveUpdates(_0x2f884c){return function(_0x2aed88){if(_0x2aed88){return _0x2aed88[_0x3e8f('0x22')](_0x2f884c)[_0x3e8f('0x23')](function(_0x4e1694){return _0x4e1694;});}return null;};}function removeEntity(_0x2b17cc){return function(_0x3cba8f){if(_0x3cba8f){return _0x3cba8f['destroy']()[_0x3e8f('0x23')](function(){_0x2b17cc[_0x3e8f('0x1a')](0xcc)[_0x3e8f('0x24')]();});}};}function handleEntityNotFound(_0x36b126){return function(_0x4dd400){if(!_0x4dd400){_0x36b126[_0x3e8f('0x25')](0x194);}return _0x4dd400;};}function handleError(_0x280d9b,_0x50fa7f){_0x50fa7f=_0x50fa7f||0x1f4;return function(_0x182390){logger['error'](_0x182390[_0x3e8f('0x26')]);if(_0x182390[_0x3e8f('0x27')]){delete _0x182390[_0x3e8f('0x27')];}_0x280d9b[_0x3e8f('0x1a')](_0x50fa7f)['send'](_0x182390);};}exports[_0x3e8f('0x28')]=function(_0x4e0c77,_0x353180){var _0x556eab={},_0x58220e={},_0x316923={'count':0x0,'rows':[]};var _0x4c37d8=_['map'](db['ChatMessage'][_0x3e8f('0x29')],function(_0x59e5c3){return{'name':_0x59e5c3[_0x3e8f('0x2a')],'type':_0x59e5c3['type'][_0x3e8f('0x2b')]};});_0x58220e[_0x3e8f('0x2c')]=_[_0x3e8f('0x2d')](_0x4c37d8,'name');_0x58220e[_0x3e8f('0x2e')]=_[_0x3e8f('0x2f')](_0x4e0c77[_0x3e8f('0x2e')]);_0x58220e[_0x3e8f('0x30')]=_[_0x3e8f('0x31')](_0x58220e[_0x3e8f('0x2c')],_0x58220e[_0x3e8f('0x2e')]);_0x556eab[_0x3e8f('0x32')]=_[_0x3e8f('0x31')](_0x58220e[_0x3e8f('0x2c')],qs[_0x3e8f('0x33')](_0x4e0c77[_0x3e8f('0x2e')][_0x3e8f('0x33')]));_0x556eab[_0x3e8f('0x32')]=_0x556eab[_0x3e8f('0x32')]['length']?_0x556eab['attributes']:_0x58220e[_0x3e8f('0x2c')];if(!_0x4e0c77[_0x3e8f('0x2e')][_0x3e8f('0x34')](_0x3e8f('0x35'))){_0x556eab[_0x3e8f('0x1c')]=qs[_0x3e8f('0x1c')](_0x4e0c77[_0x3e8f('0x2e')][_0x3e8f('0x1c')]);_0x556eab['offset']=qs[_0x3e8f('0x1e')](_0x4e0c77['query'][_0x3e8f('0x1e')]);}_0x556eab[_0x3e8f('0x36')]=qs[_0x3e8f('0x37')](_0x4e0c77[_0x3e8f('0x2e')]['sort']);_0x556eab[_0x3e8f('0x38')]=qs['filters'](_[_0x3e8f('0x39')](_0x4e0c77[_0x3e8f('0x2e')],_0x58220e[_0x3e8f('0x30')]),_0x4c37d8);if(_0x4e0c77[_0x3e8f('0x2e')][_0x3e8f('0x3a')]){_0x556eab[_0x3e8f('0x38')]=_['merge'](_0x556eab[_0x3e8f('0x38')],{'$or':_['map'](_0x4c37d8,function(_0x55b628){if(_0x55b628['type']!=='VIRTUAL'){var _0x10755e={};_0x10755e[_0x55b628[_0x3e8f('0x27')]]={'$like':'%'+_0x4e0c77[_0x3e8f('0x2e')][_0x3e8f('0x3a')]+'%'};return _0x10755e;}})});}_0x556eab=_[_0x3e8f('0x3b')]({},_0x556eab,_0x4e0c77[_0x3e8f('0x3c')]);var _0x1b11a3={'where':_0x556eab[_0x3e8f('0x38')]};return db['ChatMessage']['count'](_0x1b11a3)[_0x3e8f('0x23')](function(_0x2422ed){_0x316923[_0x3e8f('0x1d')]=_0x2422ed;if(_0x4e0c77[_0x3e8f('0x2e')][_0x3e8f('0x3d')]){_0x556eab[_0x3e8f('0x3e')]=[{'all':!![]}];}return db[_0x3e8f('0x3f')][_0x3e8f('0x40')](_0x556eab);})['then'](function(_0x29bd09){_0x316923[_0x3e8f('0x41')]=_0x29bd09;return _0x316923;})[_0x3e8f('0x23')](respondWithFilteredResult(_0x353180,_0x556eab))[_0x3e8f('0x19')](handleError(_0x353180,null));};exports['show']=function(_0x4d2f36,_0x5dfa49){var _0x35c2e5={'raw':!![],'where':{'id':_0x4d2f36['params']['id']}},_0x10dd46={};_0x10dd46[_0x3e8f('0x2c')]=_[_0x3e8f('0x2f')](db['ChatMessage'][_0x3e8f('0x29')]);_0x10dd46[_0x3e8f('0x2e')]=_['keys'](_0x4d2f36['query']);_0x10dd46[_0x3e8f('0x30')]=_[_0x3e8f('0x31')](_0x10dd46[_0x3e8f('0x2c')],_0x10dd46[_0x3e8f('0x2e')]);_0x35c2e5[_0x3e8f('0x32')]=_['intersection'](_0x10dd46[_0x3e8f('0x2c')],qs[_0x3e8f('0x33')](_0x4d2f36['query'][_0x3e8f('0x33')]));_0x35c2e5[_0x3e8f('0x32')]=_0x35c2e5[_0x3e8f('0x32')][_0x3e8f('0x42')]?_0x35c2e5[_0x3e8f('0x32')]:_0x10dd46[_0x3e8f('0x2c')];if(_0x4d2f36['query'][_0x3e8f('0x3d')]){_0x35c2e5['include']=[{'all':!![]}];}_0x35c2e5=_[_0x3e8f('0x3b')]({},_0x35c2e5,_0x4d2f36[_0x3e8f('0x3c')]);return db[_0x3e8f('0x3f')][_0x3e8f('0x43')](_0x35c2e5)['then'](handleEntityNotFound(_0x5dfa49,null))['then'](respondWithResult(_0x5dfa49,null))[_0x3e8f('0x19')](handleError(_0x5dfa49,null));};exports['create']=function(_0x19a6cc,_0x4a8f2a){return db[_0x3e8f('0x3f')][_0x3e8f('0x44')](_0x19a6cc['body'],{})[_0x3e8f('0x23')](respondWithResult(_0x4a8f2a,0xc9))[_0x3e8f('0x19')](handleError(_0x4a8f2a,null));};exports[_0x3e8f('0x22')]=function(_0x350ef6,_0x5348ff){if(_0x350ef6[_0x3e8f('0x45')]['id']){delete _0x350ef6['body']['id'];}return db['ChatMessage'][_0x3e8f('0x43')]({'where':{'id':_0x350ef6[_0x3e8f('0x46')]['id']}})[_0x3e8f('0x23')](handleEntityNotFound(_0x5348ff,null))['then'](saveUpdates(_0x350ef6[_0x3e8f('0x45')],null))[_0x3e8f('0x23')](respondWithResult(_0x5348ff,null))[_0x3e8f('0x19')](handleError(_0x5348ff,null));};exports['destroy']=function(_0x541d99,_0x4ce51b){return db[_0x3e8f('0x3f')][_0x3e8f('0x43')]({'where':{'id':_0x541d99[_0x3e8f('0x46')]['id']}})[_0x3e8f('0x23')](handleEntityNotFound(_0x4ce51b,null))['then'](removeEntity(_0x4ce51b,null))[_0x3e8f('0x19')](handleError(_0x4ce51b,null));};exports['describe']=function(_0x46f1a,_0xe52e19){return db[_0x3e8f('0x3f')][_0x3e8f('0x47')]()[_0x3e8f('0x23')](respondWithResult(_0xe52e19,null))[_0x3e8f('0x19')](handleError(_0xe52e19,null));};exports[_0x3e8f('0x48')]=function(_0x59692c,_0x466c94){var _0x5d1a8f=_0x3e8f('0x49');return interactionService['acceptMessage'](_0x59692c,_0x5d1a8f)['then'](respondWithResult(_0x466c94,null))[_0x3e8f('0x19')](handleError(_0x466c94,null));};exports[_0x3e8f('0x4a')]=function(_0x56a342,_0x5caa7a){var _0x1748fa={'agent':{},'channel':_0x3e8f('0x49')};if(_0x56a342['body']['id']){delete _0x56a342[_0x3e8f('0x45')]['id'];}_0x56a342[_0x3e8f('0x45')][_0x3e8f('0x4b')]=_0x56a342[_0x3e8f('0x45')][_0x3e8f('0x4b')]||_0x56a342[_0x3e8f('0x4c')]['id'];_0x1748fa[_0x3e8f('0x4d')]['id']=_0x56a342['body']['UserId'];return db[_0x3e8f('0x3f')]['find']({'where':{'id':_0x56a342[_0x3e8f('0x46')]['id'],'UserId':null}})[_0x3e8f('0x23')](handleEntityNotFound(_0x5caa7a,null))[_0x3e8f('0x23')](function(_0x3845db){if(_0x3845db){_0x1748fa[_0x3e8f('0x17')]=_0x3845db[_0x3e8f('0x4e')]({'plain':!![]});return db['ChatInteraction'][_0x3e8f('0x43')]({'where':{'id':_0x3845db[_0x3e8f('0x4f')]}});}return null;})[_0x3e8f('0x23')](handleEntityNotFound(_0x5caa7a,null))[_0x3e8f('0x23')](function(_0x5cbad9){if(_0x5cbad9){_0x1748fa['interaction']=_0x5cbad9[_0x3e8f('0x4e')]({'plain':!![]});interaction_log[_0x3e8f('0x10')](_0x3e8f('0x50'),_0x56a342['user']['id'],_0x56a342[_0x3e8f('0x4c')]['name'],_0x56a342[_0x3e8f('0x4c')][_0x3e8f('0x51')],_0x1748fa['interaction']['id'],_0x56a342[_0x3e8f('0x45')]?JSON['stringify'](_0x56a342[_0x3e8f('0x45')]):_0x3e8f('0x52'));return respondWithRpcPromise(_0x3e8f('0x53'),'rejectMessage',_0x1748fa);}return null;})[_0x3e8f('0x23')](function(_0x54156e){var _0x6c3b6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x54156e['message'][_0x3e8f('0x54')];return db['sequelize'][_0x3e8f('0x2e')](_0x6c3b6,{'type':db[_0x3e8f('0x55')][_0x3e8f('0x56')]['SELECT'],'raw':!![]})['then'](function(_0x3bc1d4){return _0x3bc1d4;});})[_0x3e8f('0x23')](function(_0x565fef){if(_0x565fef){_0x1748fa[_0x3e8f('0x17')][_0x3e8f('0x57')]=_0x565fef[0x0];if(!_0x56a342[_0x3e8f('0x45')][_0x3e8f('0x4b')])return;return db[_0x3e8f('0x58')]['find']({'where':{'id':_0x56a342[_0x3e8f('0x45')]['UserId'],'role':_0x3e8f('0x4d')},'attributes':['id',_0x3e8f('0x27'),_0x3e8f('0x59'),_0x3e8f('0x5a'),_0x3e8f('0x5b')],'raw':!![]});}return null;})['then'](function(_0x458fe9){if(!_0x458fe9)return null;_0x1748fa['message'][_0x3e8f('0x4d')]=_0x458fe9;return _0x1748fa;})[_0x3e8f('0x23')](function(_0x2949df){if(_0x2949df){_0x2949df[_0x3e8f('0x17')]['interface']=util[_0x3e8f('0x5c')]('SIP/%s',_0x56a342[_0x3e8f('0x4c')]['name']);_0x2949df[_0x3e8f('0x17')][_0x3e8f('0x5d')]=_0x1748fa[_0x3e8f('0x5d')];_0x2949df[_0x3e8f('0x17')][_0x3e8f('0x5e')]=_0x1748fa[_0x3e8f('0x5d')];_0x2949df[_0x3e8f('0x17')][_0x3e8f('0x5f')]=_0x3e8f('0x4a');respondWithRpcPromise(_0x3e8f('0x60'),_0x3e8f('0x60'),{'event':_0x3e8f('0x61'),'message':_[_0x3e8f('0x3b')](_0x1748fa[_0x3e8f('0x17')],JSON[_0x3e8f('0x62')](_0x1748fa[_0x3e8f('0x63')]['formData']))},client9002);return _0x1748fa;}return null;})[_0x3e8f('0x23')](respondWithResult(_0x5caa7a,null))['catch'](handleError(_0x5caa7a,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 7b0868a..a07716d 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 _0x07e3=['update','remove','emit','hasOwnProperty','hook','events','ChatMessage','setMaxListeners','save'];(function(_0x442ece,_0x1c5c60){var _0x303ff5=function(_0x5a94a3){while(--_0x5a94a3){_0x442ece['push'](_0x442ece['shift']());}};_0x303ff5(++_0x1c5c60);}(_0x07e3,0xd4));var _0x307e=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x07e3[_0xbc346f];return _0x9f9260;};'use strict';var EventEmitter=require(_0x307e('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x307e('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x307e('0x2')](0x0);var events={'afterCreate':_0x307e('0x3'),'afterUpdate':_0x307e('0x4'),'afterDestroy':_0x307e('0x5')};function emitEvent(_0x196f4b){return function(_0x52b6b0,_0x14a025,_0x3f22aa){ChatMessageEvents['emit'](_0x196f4b+':'+_0x52b6b0['id'],_0x52b6b0);ChatMessageEvents[_0x307e('0x6')](_0x196f4b,_0x52b6b0);_0x3f22aa(null);};}for(var e in events){if(events[_0x307e('0x7')](e)){var event=events[e];ChatMessage[_0x307e('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x56e3=['update','emit','hook','events','../../mysqldb','ChatMessage','save'];(function(_0x318f2,_0x3bc7b3){var _0x3bcab8=function(_0x19bc02){while(--_0x19bc02){_0x318f2['push'](_0x318f2['shift']());}};_0x3bcab8(++_0x3bc7b3);}(_0x56e3,0x17d));var _0x356e=function(_0x536da7,_0x5686ee){_0x536da7=_0x536da7-0x0;var _0x744edf=_0x56e3[_0x536da7];return _0x744edf;};'use strict';var EventEmitter=require(_0x356e('0x0'));var ChatMessage=require(_0x356e('0x1'))['db'][_0x356e('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x356e('0x3'),'afterUpdate':_0x356e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x561596){return function(_0x5c66c9,_0x253610,_0x40a2ba){ChatMessageEvents[_0x356e('0x5')](_0x561596+':'+_0x5c66c9['id'],_0x5c66c9);ChatMessageEvents[_0x356e('0x5')](_0x561596,_0x5c66c9);_0x40a2ba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x356e('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index e3b36fc..8fe9294 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 _0xad2c=['get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xad2c,0x13a));var _0xcad2=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xad2c[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xcad2('0x0'));var util=require(_0xcad2('0x1'));var logger=require(_0xcad2('0x2'))('api');var moment=require(_0xcad2('0x3'));var BPromise=require(_0xcad2('0x4'));var rp=require(_0xcad2('0x5'));var fs=require('fs');var path=require(_0xcad2('0x6'));var rimraf=require(_0xcad2('0x7'));var config=require('../../config/environment');var attributes=require(_0xcad2('0x8'));module[_0xcad2('0x9')]=function(_0x1203e0,_0x220af1){return _0x1203e0[_0xcad2('0xa')](_0xcad2('0xb'),attributes,{'tableName':_0xcad2('0xc'),'paranoid':![],'indexes':[{'name':_0xcad2('0xd'),'fields':['body'],'type':_0xcad2('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x23d966,_0x3a2d16,_0x3e63ce){var _0x552ce9=_0x1203e0[_0xcad2('0xf')];var _0x48d76a=_0x23d966[_0xcad2('0x10')]({'plain':!![]});if(_0x48d76a[_0xcad2('0x11')][_0xcad2('0x12')]()==='in'||_0x48d76a[_0xcad2('0x11')][_0xcad2('0x12')]()===_0xcad2('0x13')&&!_0x48d76a[_0xcad2('0x14')]&&!_[_0xcad2('0x15')](_0x48d76a[_0xcad2('0x16')])){_0x552ce9[_0xcad2('0x17')][_0xcad2('0x18')]({'where':{'id':_0x48d76a[_0xcad2('0x19')]}})['then'](function(_0x1438aa){if(_0x1438aa){_0x1438aa[_0xcad2('0x1a')]({'lastMsgAt':_0x48d76a[_0xcad2('0x1b')],'lastMsgDirection':_0x48d76a[_0xcad2('0x11')][_0xcad2('0x12')]()});}})[_0xcad2('0x1c')](function(_0x46e7c2){console['error'](_0x46e7c2);});}_0x3e63ce();}},'charset':'utf8mb4','collate':_0xcad2('0x1d')});};
\ No newline at end of file
+var _0x2395=['request-promise','rimraf','../../config/environment','./chatMessage.attributes','define','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird'];(function(_0x49ad45,_0x175d1d){var _0xf043c=function(_0x5b93a2){while(--_0x5b93a2){_0x49ad45['push'](_0x49ad45['shift']());}};_0xf043c(++_0x175d1d);}(_0x2395,0x114));var _0x5239=function(_0x886007,_0x55cca6){_0x886007=_0x886007-0x0;var _0x866e9f=_0x2395[_0x886007];return _0x866e9f;};'use strict';var _=require('lodash');var util=require(_0x5239('0x0'));var logger=require(_0x5239('0x1'))(_0x5239('0x2'));var moment=require('moment');var BPromise=require(_0x5239('0x3'));var rp=require(_0x5239('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5239('0x5'));var config=require(_0x5239('0x6'));var attributes=require(_0x5239('0x7'));module['exports']=function(_0x5c4428,_0x30e7b5){return _0x5c4428[_0x5239('0x8')]('ChatMessage',attributes,{'tableName':_0x5239('0x9'),'paranoid':![],'indexes':[{'name':_0x5239('0xa'),'fields':[_0x5239('0xb')],'type':_0x5239('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x12e8ef,_0x3674a9,_0x5c5e6e){var _0xd2988c=_0x5c4428['models'];var _0x373c90=_0x12e8ef[_0x5239('0xd')]({'plain':!![]});if(_0x373c90[_0x5239('0xe')][_0x5239('0xf')]()==='in'||_0x373c90[_0x5239('0xe')][_0x5239('0xf')]()===_0x5239('0x10')&&!_0x373c90[_0x5239('0x11')]&&!_[_0x5239('0x12')](_0x373c90[_0x5239('0x13')])){_0xd2988c[_0x5239('0x14')]['findOne']({'where':{'id':_0x373c90[_0x5239('0x15')]}})[_0x5239('0x16')](function(_0x25c541){if(_0x25c541){_0x25c541[_0x5239('0x17')]({'lastMsgAt':_0x373c90[_0x5239('0x18')],'lastMsgDirection':_0x373c90[_0x5239('0xe')][_0x5239('0xf')]()});}})[_0x5239('0x19')](function(_0x40d9fb){console[_0x5239('0x1a')](_0x40d9fb);});}_0x5c5e6e();}},'charset':'utf8mb4','collate':_0x5239('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 59b2b6a..2a72f16 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 _0x9127=['message','info','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x7b7181,_0x5f065e){var _0x3ea6ef=function(_0x2d6e06){while(--_0x2d6e06){_0x7b7181['push'](_0x7b7181['shift']());}};_0x3ea6ef(++_0x5f065e);}(_0x9127,0x180));var _0x7912=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0x9127[_0x581af1];return _0x54c22e;};'use strict';var _=require(_0x7912('0x0'));var util=require(_0x7912('0x1'));var moment=require(_0x7912('0x2'));var BPromise=require(_0x7912('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7912('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7912('0x5'))(_0x7912('0x6'));var config=require(_0x7912('0x7'));var jayson=require(_0x7912('0x8'));var client=jayson[_0x7912('0x9')][_0x7912('0xa')]({'port':0x232a});config[_0x7912('0xb')]=_[_0x7912('0xc')](config['redis'],{'host':_0x7912('0xd'),'port':0x18eb});var socket=require(_0x7912('0xe'))(new Redis(config[_0x7912('0xb')]));require(_0x7912('0xf'))['register'](socket);function respondWithRpcPromise(_0x218dc9,_0x586ccb,_0x438339){return new BPromise(function(_0x9ddd99,_0x4d7522){return client[_0x7912('0x10')](_0x218dc9,_0x438339)[_0x7912('0x11')](function(_0x3b56aa){logger['info'](_0x7912('0x12'),_0x586ccb,_0x7912('0x13'));logger['debug'](_0x7912('0x14'),_0x586ccb,'request\x20sent',JSON[_0x7912('0x15')](_0x3b56aa));if(_0x3b56aa['error']){if(_0x3b56aa[_0x7912('0x16')][_0x7912('0x17')]===0x1f4){logger[_0x7912('0x16')](_0x7912('0x12'),_0x586ccb,_0x3b56aa['error'][_0x7912('0x18')]);return _0x4d7522(_0x3b56aa['error'][_0x7912('0x18')]);}logger[_0x7912('0x16')](_0x7912('0x12'),_0x586ccb,_0x3b56aa[_0x7912('0x16')][_0x7912('0x18')]);return _0x9ddd99(_0x3b56aa[_0x7912('0x16')]['message']);}else{logger[_0x7912('0x19')](_0x7912('0x12'),_0x586ccb,_0x7912('0x13'));_0x9ddd99(_0x3b56aa['result'][_0x7912('0x18')]);}})[_0x7912('0x1a')](function(_0x8173e6){logger[_0x7912('0x16')](_0x7912('0x12'),_0x586ccb,_0x8173e6);_0x4d7522(_0x8173e6);});});}exports[_0x7912('0x1b')]=function(_0x5e1b4e){var _0x15f148=this;return new Promise(function(_0x116390,_0x27f312){return db[_0x7912('0x1c')][_0x7912('0x1d')](_0x5e1b4e[_0x7912('0x1e')],{'raw':_0x5e1b4e[_0x7912('0x1f')]?_0x5e1b4e[_0x7912('0x1f')][_0x7912('0x20')]===undefined?!![]:![]:!![]})[_0x7912('0x11')](function(_0x3e3447){logger[_0x7912('0x19')](_0x7912('0x1b'),_0x5e1b4e);logger[_0x7912('0x21')](_0x7912('0x1b'),_0x5e1b4e,JSON['stringify'](_0x3e3447));_0x116390(_0x3e3447);})[_0x7912('0x1a')](function(_0x4410b4){logger[_0x7912('0x16')](_0x7912('0x1b'),_0x4410b4[_0x7912('0x18')],_0x5e1b4e);_0x27f312(_0x15f148[_0x7912('0x16')](0x1f4,_0x4410b4['message']));});});};
\ No newline at end of file
+var _0x1a9a=['client','defaults','redis','localhost','socket.io-emitter','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','options','raw','debug','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x52ce8e,_0x4dacf5){var _0x489cf9=function(_0x374ab2){while(--_0x374ab2){_0x52ce8e['push'](_0x52ce8e['shift']());}};_0x489cf9(++_0x4dacf5);}(_0x1a9a,0x19b));var _0xa1a9=function(_0x3d0a2c,_0x18e9b8){_0x3d0a2c=_0x3d0a2c-0x0;var _0x2265ab=_0x1a9a[_0x3d0a2c];return _0x2265ab;};'use strict';var _=require(_0xa1a9('0x0'));var util=require(_0xa1a9('0x1'));var moment=require(_0xa1a9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1a9('0x3'))['db'];var utils=require(_0xa1a9('0x4'));var logger=require(_0xa1a9('0x5'))(_0xa1a9('0x6'));var config=require(_0xa1a9('0x7'));var jayson=require(_0xa1a9('0x8'));var client=jayson[_0xa1a9('0x9')]['http']({'port':0x232a});config['redis']=_[_0xa1a9('0xa')](config[_0xa1a9('0xb')],{'host':_0xa1a9('0xc'),'port':0x18eb});var socket=require(_0xa1a9('0xd'))(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a61bb,_0x56ac7f,_0x2550a7){return new BPromise(function(_0x3744cf,_0x4001e0){return client['request'](_0x2a61bb,_0x2550a7)[_0xa1a9('0xe')](function(_0x510b9e){logger['info'](_0xa1a9('0xf'),_0x56ac7f,_0xa1a9('0x10'));logger['debug'](_0xa1a9('0x11'),_0x56ac7f,'request\x20sent',JSON['stringify'](_0x510b9e));if(_0x510b9e[_0xa1a9('0x12')]){if(_0x510b9e['error'][_0xa1a9('0x13')]===0x1f4){logger['error'](_0xa1a9('0xf'),_0x56ac7f,_0x510b9e[_0xa1a9('0x12')][_0xa1a9('0x14')]);return _0x4001e0(_0x510b9e[_0xa1a9('0x12')][_0xa1a9('0x14')]);}logger[_0xa1a9('0x12')](_0xa1a9('0xf'),_0x56ac7f,_0x510b9e[_0xa1a9('0x12')][_0xa1a9('0x14')]);return _0x3744cf(_0x510b9e[_0xa1a9('0x12')]['message']);}else{logger[_0xa1a9('0x15')](_0xa1a9('0xf'),_0x56ac7f,_0xa1a9('0x10'));_0x3744cf(_0x510b9e[_0xa1a9('0x16')]['message']);}})[_0xa1a9('0x17')](function(_0x422d5b){logger['error'](_0xa1a9('0xf'),_0x56ac7f,_0x422d5b);_0x4001e0(_0x422d5b);});});}exports[_0xa1a9('0x18')]=function(_0x537d74){var _0x86d348=this;return new Promise(function(_0x278136,_0x3f8e5f){return db[_0xa1a9('0x19')][_0xa1a9('0x1a')](_0x537d74['body'],{'raw':_0x537d74[_0xa1a9('0x1b')]?_0x537d74[_0xa1a9('0x1b')][_0xa1a9('0x1c')]===undefined?!![]:![]:!![]})[_0xa1a9('0xe')](function(_0x4b8f7e){logger[_0xa1a9('0x15')](_0xa1a9('0x18'),_0x537d74);logger[_0xa1a9('0x1d')](_0xa1a9('0x18'),_0x537d74,JSON['stringify'](_0x4b8f7e));_0x278136(_0x4b8f7e);})[_0xa1a9('0x17')](function(_0x5aa0e0){logger[_0xa1a9('0x12')](_0xa1a9('0x18'),_0x5aa0e0['message'],_0x537d74);_0x3f8e5f(_0x86d348['error'](0x1f4,_0x5aa0e0[_0xa1a9('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index abe1e35..37ff7ce 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 _0x5162=['chatMessage:','./chatMessage.events','emit','removeListener','register','length'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x5162,0x103));var _0x2516=function(_0x57f7ea,_0x54da6b){_0x57f7ea=_0x57f7ea-0x0;var _0x54a7e4=_0x5162[_0x57f7ea];return _0x54a7e4;};'use strict';var ChatMessageEvents=require(_0x2516('0x0'));var events=['save','remove','update'];function createListener(_0x4db25c,_0x41fd28){return function(_0x2aaef5){_0x41fd28[_0x2516('0x1')](_0x4db25c,_0x2aaef5);};}function removeListener(_0x2d0b53,_0x2e48b6){return function(){ChatMessageEvents[_0x2516('0x2')](_0x2d0b53,_0x2e48b6);};}exports[_0x2516('0x3')]=function(_0x5b71b5){for(var _0x48f411=0x0,_0x5beeb3=events[_0x2516('0x4')];_0x48f411<_0x5beeb3;_0x48f411++){var _0xba4b36=events[_0x48f411];var _0xa1557=createListener(_0x2516('0x5')+_0xba4b36,_0x5b71b5);ChatMessageEvents['on'](_0xba4b36,_0xa1557);}};
\ No newline at end of file
+var _0x0e85=['update','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x4fe1e3,_0x587148){var _0x474845=function(_0x2c8876){while(--_0x2c8876){_0x4fe1e3['push'](_0x4fe1e3['shift']());}};_0x474845(++_0x587148);}(_0x0e85,0x7c));var _0x50e8=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x0e85[_0x369151];return _0x4292d5;};'use strict';var ChatMessageEvents=require(_0x50e8('0x0'));var events=[_0x50e8('0x1'),'remove',_0x50e8('0x2')];function createListener(_0x682d10,_0x55e515){return function(_0x55cba3){_0x55e515['emit'](_0x682d10,_0x55cba3);};}function removeListener(_0x236cf3,_0x4e90e7){return function(){ChatMessageEvents[_0x50e8('0x3')](_0x236cf3,_0x4e90e7);};}exports[_0x50e8('0x4')]=function(_0xe3151e){for(var _0xfde42=0x0,_0x5e8b01=events[_0x50e8('0x5')];_0xfde42<_0x5e8b01;_0xfde42++){var _0x108edc=events[_0xfde42];var _0x42665e=createListener(_0x50e8('0x6')+_0x108edc,_0xe3151e);ChatMessageEvents['on'](_0x108edc,_0x42665e);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 0873fae..cbf0549 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 _0xb43a=['create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','/:id','post','tracked','chatmessage:create'];(function(_0x5b33ac,_0x359e75){var _0x304b3f=function(_0xf6f90d){while(--_0xf6f90d){_0x5b33ac['push'](_0x5b33ac['shift']());}};_0x304b3f(++_0x359e75);}(_0xb43a,0x199));var _0xab43=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xb43a[_0x44a64f];return _0x52024b;};'use strict';var multer=require('multer');var util=require(_0xab43('0x0'));var path=require(_0xab43('0x1'));var timeout=require(_0xab43('0x2'));var express=require(_0xab43('0x3'));var router=express[_0xab43('0x4')]();var fs_extra=require(_0xab43('0x5'));var auth=require(_0xab43('0x6'));var interaction=require(_0xab43('0x7'));var config=require(_0xab43('0x8'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0xab43('0x9')](),controller[_0xab43('0xa')]);router['get'](_0xab43('0xb'),auth[_0xab43('0x9')](),controller['describe']);router['get'](_0xab43('0xc'),auth[_0xab43('0x9')](),controller['show']);router[_0xab43('0xd')]('/',auth['isAuthenticated'](),interaction[_0xab43('0xe')]('chat',_0xab43('0xf')),controller[_0xab43('0x10')]);router[_0xab43('0x11')](_0xab43('0xc'),controller[_0xab43('0x12')]);router[_0xab43('0x11')](_0xab43('0x13'),auth[_0xab43('0x9')](),controller[_0xab43('0x14')]);router[_0xab43('0x11')](_0xab43('0x15'),auth['isAuthenticated'](),controller[_0xab43('0x16')]);router[_0xab43('0x17')](_0xab43('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xab43('0x18')]=router;
\ No newline at end of file
+var _0x4596=['../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','post','chat','chatmessage:create','create','put','update','/:id/accept','accept','reject','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2f5dad,_0x4313ad){var _0x38e02d=function(_0x44833a){while(--_0x44833a){_0x2f5dad['push'](_0x2f5dad['shift']());}};_0x38e02d(++_0x4313ad);}(_0x4596,0xe3));var _0x6459=function(_0x498b2e,_0x34a4ed){_0x498b2e=_0x498b2e-0x0;var _0x10ff45=_0x4596[_0x498b2e];return _0x10ff45;};'use strict';var multer=require(_0x6459('0x0'));var util=require(_0x6459('0x1'));var path=require('path');var timeout=require(_0x6459('0x2'));var express=require(_0x6459('0x3'));var router=express[_0x6459('0x4')]();var fs_extra=require(_0x6459('0x5'));var auth=require(_0x6459('0x6'));var interaction=require(_0x6459('0x7'));var config=require(_0x6459('0x8'));var controller=require(_0x6459('0x9'));router[_0x6459('0xa')]('/',auth[_0x6459('0xb')](),controller[_0x6459('0xc')]);router[_0x6459('0xa')]('/describe',auth[_0x6459('0xb')](),controller[_0x6459('0xd')]);router['get'](_0x6459('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x6459('0xf')]('/',auth[_0x6459('0xb')](),interaction['tracked'](_0x6459('0x10'),_0x6459('0x11')),controller[_0x6459('0x12')]);router[_0x6459('0x13')]('/:id',controller[_0x6459('0x14')]);router['put'](_0x6459('0x15'),auth[_0x6459('0xb')](),controller[_0x6459('0x16')]);router[_0x6459('0x13')]('/:id/reject',auth[_0x6459('0xb')](),controller[_0x6459('0x17')]);router['delete'](_0x6459('0xe'),auth[_0x6459('0xb')](),controller[_0x6459('0x18')]);module[_0x6459('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 899d288..8b588dc 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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x26ec0a,_0x3d532d){var _0x48a447=function(_0x4d6705){while(--_0x4d6705){_0x26ec0a['push'](_0x26ec0a['shift']());}};_0x48a447(++_0x3d532d);}(_0xb10b,0x12a));var _0xbb10=function(_0x503d00,_0x323df1){_0x503d00=_0x503d00-0x0;var _0x2263d8=_0xb10b[_0x503d00];return _0x2263d8;};'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
+var _0x2032=['medium','exports','TEXT'];(function(_0x3411f8,_0x1681d1){var _0x2a7fd2=function(_0x2cda1a){while(--_0x2cda1a){_0x3411f8['push'](_0x3411f8['shift']());}};_0x2a7fd2(++_0x1681d1);}(_0x2032,0xd9));var _0x2203=function(_0x429633,_0x44ea98){_0x429633=_0x429633-0x0;var _0x60087b=_0x2032[_0x429633];return _0x60087b;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 96117e3..9c03507 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(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x7a54,0x106));var _0x47a5=function(_0x5185b8,_0x4282ea){_0x5185b8=_0x5185b8-0x0;var _0x38edb2=_0x7a54[_0x5185b8];return _0x38edb2;};'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(_0x1cf6df,_0x1ce352){var _0x1fd96a=function(_0x3400d2){while(--_0x3400d2){_0x1cf6df['push'](_0x1cf6df['shift']());}};_0x1fd96a(++_0x1ce352);}(_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 2708980..0021db4 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 _0xa009=['../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x18a7f3,_0x4cf3c5){var _0x1b070c=function(_0x1a664a){while(--_0x1a664a){_0x18a7f3['push'](_0x18a7f3['shift']());}};_0x1b070c(++_0x4cf3c5);}(_0xa009,0x13a));var _0x9a00=function(_0x4adc6d,_0x11275c){_0x4adc6d=_0x4adc6d-0x0;var _0x4d42e5=_0xa009[_0x4adc6d];return _0x4d42e5;};'use strict';var EventEmitter=require(_0x9a00('0x0'));var ChatOfflineMessage=require(_0x9a00('0x1'))['db'][_0x9a00('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9a00('0x3')](0x0);var events={'afterCreate':_0x9a00('0x4'),'afterUpdate':_0x9a00('0x5'),'afterDestroy':_0x9a00('0x6')};function emitEvent(_0x15730f){return function(_0xf578ba,_0x399968,_0x398e60){ChatOfflineMessageEvents[_0x9a00('0x7')](_0x15730f+':'+_0xf578ba['id'],_0xf578ba);ChatOfflineMessageEvents[_0x9a00('0x7')](_0x15730f,_0xf578ba);_0x398e60(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x9a00('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xd7ea=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save'];(function(_0xeb5f8d,_0x2549bf){var _0x4b3727=function(_0x337bbd){while(--_0x337bbd){_0xeb5f8d['push'](_0xeb5f8d['shift']());}};_0x4b3727(++_0x2549bf);}(_0xd7ea,0xeb));var _0xad7e=function(_0x180f0f,_0x1d2dc2){_0x180f0f=_0x180f0f-0x0;var _0xfd4e6c=_0xd7ea[_0x180f0f];return _0xfd4e6c;};'use strict';var EventEmitter=require(_0xad7e('0x0'));var ChatOfflineMessage=require(_0xad7e('0x1'))['db'][_0xad7e('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xad7e('0x3')](0x0);var events={'afterCreate':_0xad7e('0x4'),'afterUpdate':'update','afterDestroy':_0xad7e('0x5')};function emitEvent(_0x2c987b){return function(_0x532f0d,_0x33aeb1,_0x4972a9){ChatOfflineMessageEvents['emit'](_0x2c987b+':'+_0x532f0d['id'],_0x532f0d);ChatOfflineMessageEvents[_0xad7e('0x6')](_0x2c987b,_0x532f0d);_0x4972a9(null);};}for(var e in events){if(events[_0xad7e('0x7')](e)){var event=events[e];ChatOfflineMessage[_0xad7e('0x8')](e,emitEvent(event));}}module[_0xad7e('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index a70a58c..e86be47 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 _0xb35f=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4abd58,_0x523c62){var _0x3608a8=function(_0xa5878){while(--_0xa5878){_0x4abd58['push'](_0x4abd58['shift']());}};_0x3608a8(++_0x523c62);}(_0xb35f,0x131));var _0xfb35=function(_0x6cc07,_0x813f5d){_0x6cc07=_0x6cc07-0x0;var _0x5e745c=_0xb35f[_0x6cc07];return _0x5e745c;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x506702){return _0x506702[_0xfb35('0x0')](_0xfb35('0x1'),attributes,{'tableName':_0xfb35('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfb35('0x3'),'collate':_0xfb35('0x4')});};
\ No newline at end of file
+var _0x6b78=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x4c3344,_0x4c9e10){var _0x358bde=function(_0x1a1acc){while(--_0x1a1acc){_0x4c3344['push'](_0x4c3344['shift']());}};_0x358bde(++_0x4c9e10);}(_0x6b78,0x1b7));var _0x86b7=function(_0x5b3a85,_0x41f90c){_0x5b3a85=_0x5b3a85-0x0;var _0x1a580b=_0x6b78[_0x5b3a85];return _0x1a580b;};'use strict';var attributes=require(_0x86b7('0x0'));module[_0x86b7('0x1')]=function(_0x3d62f6){return _0x3d62f6[_0x86b7('0x2')](_0x86b7('0x3'),attributes,{'tableName':_0x86b7('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x86b7('0x5'),'collate':_0x86b7('0x6')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 4623b15..e333c13 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 _0xc164=['message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5ac71e,_0x440c86){var _0x2aaa2b=function(_0x5f37e0){while(--_0x5f37e0){_0x5ac71e['push'](_0x5ac71e['shift']());}};_0x2aaa2b(++_0x440c86);}(_0xc164,0x18e));var _0x4c16=function(_0x1c5104,_0x3bb9cc){_0x1c5104=_0x1c5104-0x0;var _0x21e4b6=_0xc164[_0x1c5104];return _0x21e4b6;};'use strict';var _=require('lodash');var util=require(_0x4c16('0x0'));var moment=require(_0x4c16('0x1'));var BPromise=require(_0x4c16('0x2'));var rs=require(_0x4c16('0x3'));var fs=require('fs');var Redis=require(_0x4c16('0x4'));var db=require(_0x4c16('0x5'))['db'];var utils=require(_0x4c16('0x6'));var logger=require(_0x4c16('0x7'))('rpc');var config=require(_0x4c16('0x8'));var jayson=require(_0x4c16('0x9'));var client=jayson[_0x4c16('0xa')][_0x4c16('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10525f,_0x5e62a8,_0xa6488e){return new BPromise(function(_0x236aa7,_0x233f0a){return client[_0x4c16('0xc')](_0x10525f,_0xa6488e)['then'](function(_0x3ed462){logger[_0x4c16('0xd')](_0x4c16('0xe'),_0x5e62a8,_0x4c16('0xf'));logger[_0x4c16('0x10')](_0x4c16('0x11'),_0x5e62a8,_0x4c16('0xf'),JSON[_0x4c16('0x12')](_0x3ed462));if(_0x3ed462[_0x4c16('0x13')]){if(_0x3ed462['error']['code']===0x1f4){logger[_0x4c16('0x13')](_0x4c16('0xe'),_0x5e62a8,_0x3ed462['error'][_0x4c16('0x14')]);return _0x233f0a(_0x3ed462[_0x4c16('0x13')][_0x4c16('0x14')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x5e62a8,_0x3ed462[_0x4c16('0x13')][_0x4c16('0x14')]);return _0x236aa7(_0x3ed462[_0x4c16('0x13')][_0x4c16('0x14')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x5e62a8,_0x4c16('0xf'));_0x236aa7(_0x3ed462[_0x4c16('0x15')][_0x4c16('0x14')]);}})['catch'](function(_0x3aa010){logger['error'](_0x4c16('0xe'),_0x5e62a8,_0x3aa010);_0x233f0a(_0x3aa010);});});}
\ No newline at end of file
+var _0x68c6=['then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','catch','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x34e48b,_0x43ee22){var _0x26ff12=function(_0x1890b4){while(--_0x1890b4){_0x34e48b['push'](_0x34e48b['shift']());}};_0x26ff12(++_0x43ee22);}(_0x68c6,0x137));var _0x668c=function(_0x545bed,_0x221e96){_0x545bed=_0x545bed-0x0;var _0x16c79c=_0x68c6[_0x545bed];return _0x16c79c;};'use strict';var _=require('lodash');var util=require(_0x668c('0x0'));var moment=require(_0x668c('0x1'));var BPromise=require(_0x668c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x668c('0x3'));var logger=require(_0x668c('0x4'))(_0x668c('0x5'));var config=require(_0x668c('0x6'));var jayson=require(_0x668c('0x7'));var client=jayson['client'][_0x668c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3420d5,_0x3c4f87,_0x44b279){return new BPromise(function(_0x483ef6,_0x29758b){return client['request'](_0x3420d5,_0x44b279)[_0x668c('0x9')](function(_0x5ba1b8){logger[_0x668c('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3c4f87,_0x668c('0xb'));logger[_0x668c('0xc')](_0x668c('0xd'),_0x3c4f87,_0x668c('0xb'),JSON[_0x668c('0xe')](_0x5ba1b8));if(_0x5ba1b8[_0x668c('0xf')]){if(_0x5ba1b8[_0x668c('0xf')][_0x668c('0x10')]===0x1f4){logger['error'](_0x668c('0x11'),_0x3c4f87,_0x5ba1b8[_0x668c('0xf')][_0x668c('0x12')]);return _0x29758b(_0x5ba1b8['error'][_0x668c('0x12')]);}logger[_0x668c('0xf')](_0x668c('0x11'),_0x3c4f87,_0x5ba1b8['error']['message']);return _0x483ef6(_0x5ba1b8[_0x668c('0xf')][_0x668c('0x12')]);}else{logger[_0x668c('0xa')](_0x668c('0x11'),_0x3c4f87,_0x668c('0xb'));_0x483ef6(_0x5ba1b8['result'][_0x668c('0x12')]);}})[_0x668c('0x13')](function(_0x1cdb1d){logger[_0x668c('0xf')](_0x668c('0x11'),_0x3c4f87,_0x1cdb1d);_0x29758b(_0x1cdb1d);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 3bdf499..6e9b502 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 _0x056e=['show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x4624d7,_0x2482e9){var _0x41c718=function(_0x5e099e){while(--_0x5e099e){_0x4624d7['push'](_0x4624d7['shift']());}};_0x41c718(++_0x2482e9);}(_0x056e,0x15a));var _0xe056=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0x056e[_0x39cf70];return _0x580424;};'use strict';var multer=require(_0xe056('0x0'));var util=require(_0xe056('0x1'));var path=require(_0xe056('0x2'));var timeout=require(_0xe056('0x3'));var express=require(_0xe056('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe056('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe056('0x6'));var controller=require(_0xe056('0x7'));router[_0xe056('0x8')]('/',auth['isAuthenticated'](),controller[_0xe056('0x9')]);router[_0xe056('0x8')](_0xe056('0xa'),auth[_0xe056('0xb')](),controller[_0xe056('0xc')]);router[_0xe056('0x8')](_0xe056('0xd'),auth[_0xe056('0xb')](),controller[_0xe056('0xe')]);router['post']('/',auth[_0xe056('0xb')](),controller[_0xe056('0xf')]);router[_0xe056('0x10')]('/:id',auth[_0xe056('0xb')](),controller[_0xe056('0x11')]);router[_0xe056('0x12')](_0xe056('0xd'),auth['isAuthenticated'](),controller[_0xe056('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x915c=['update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put'];(function(_0x1d4297,_0x3cf1f9){var _0x3ba0c9=function(_0x23685d){while(--_0x23685d){_0x1d4297['push'](_0x1d4297['shift']());}};_0x3ba0c9(++_0x3cf1f9);}(_0x915c,0xea));var _0xc915=function(_0x1a98af,_0x377906){_0x1a98af=_0x1a98af-0x0;var _0x23023c=_0x915c[_0x1a98af];return _0x23023c;};'use strict';var multer=require(_0xc915('0x0'));var util=require('util');var path=require(_0xc915('0x1'));var timeout=require(_0xc915('0x2'));var express=require(_0xc915('0x3'));var router=express[_0xc915('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc915('0x5'));var interaction=require(_0xc915('0x6'));var config=require(_0xc915('0x7'));var controller=require(_0xc915('0x8'));router[_0xc915('0x9')]('/',auth[_0xc915('0xa')](),controller[_0xc915('0xb')]);router[_0xc915('0x9')]('/describe',auth[_0xc915('0xa')](),controller[_0xc915('0xc')]);router[_0xc915('0x9')](_0xc915('0xd'),auth[_0xc915('0xa')](),controller[_0xc915('0xe')]);router[_0xc915('0xf')]('/',auth[_0xc915('0xa')](),controller[_0xc915('0x10')]);router[_0xc915('0x11')](_0xc915('0xd'),auth[_0xc915('0xa')](),controller[_0xc915('0x12')]);router['delete'](_0xc915('0xd'),auth[_0xc915('0xa')](),controller[_0xc915('0x13')]);module[_0xc915('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 93fe955..cb1e12f 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 _0xfc31=['mouseOver','timeout','STRING','sequelize'];(function(_0x5c6022,_0x5cd10b){var _0x4ab5af=function(_0x988aff){while(--_0x988aff){_0x5c6022['push'](_0x5c6022['shift']());}};_0x4ab5af(++_0x5cd10b);}(_0xfc31,0x1e3));var _0x1fc3=function(_0x56b6b4,_0x4b81d0){_0x56b6b4=_0x56b6b4-0x0;var _0xe97eeb=_0xfc31[_0x56b6b4];return _0xe97eeb;};'use strict';var Sequelize=require(_0x1fc3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1fc3('0x1'),_0x1fc3('0x2')),'defaultValue':_0x1fc3('0x1')},'selector':{'type':Sequelize[_0x1fc3('0x3')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xdadb=['mouseOver','sequelize','exports','STRING','ENUM'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0xdadb,0x15a));var _0xbdad=function(_0x34584e,_0x6616f4){_0x34584e=_0x34584e-0x0;var _0x570a60=_0xdadb[_0x34584e];return _0x570a60;};'use strict';var Sequelize=require(_0xbdad('0x0'));module[_0xbdad('0x1')]={'name':{'type':Sequelize[_0xbdad('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbdad('0x3')](_0xbdad('0x4'),'timeout'),'defaultValue':_0xbdad('0x4')},'selector':{'type':Sequelize[_0xbdad('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index cf08a9c..76fdba7 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 _0x5243=['mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','name','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','catch','destroy','eml-format','fast-json-patch','request-promise'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x5243,0x71));var _0x3524=function(_0x36b0ca,_0x19b1ab){_0x36b0ca=_0x36b0ca-0x0;var _0x49b07c=_0x5243[_0x36b0ca];return _0x49b07c;};'use strict';var emlformat=require(_0x3524('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3524('0x1'));var rp=require(_0x3524('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3524('0x3'));var util=require(_0x3524('0x4'));var path=require('path');var sox=require(_0x3524('0x5'));var csv=require('to-csv');var ejs=require(_0x3524('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3524('0x7'));var squel=require(_0x3524('0x8'));var crypto=require(_0x3524('0x9'));var jsforce=require(_0x3524('0xa'));var deskjs=require(_0x3524('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3524('0xc'));var Redis=require(_0x3524('0xd'));var authService=require(_0x3524('0xe'));var qs=require(_0x3524('0xf'));var as=require(_0x3524('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3524('0x11'))(_0x3524('0x12'));var utils=require('../../config/utils');var config=require(_0x3524('0x13'));var licenseUtil=require(_0x3524('0x14'));var db=require(_0x3524('0x15'))['db'];function respondWithStatusCode(_0x5d5a60,_0x4f49da){_0x4f49da=_0x4f49da||0xcc;return function(_0x50c11f){if(_0x50c11f){return _0x5d5a60['sendStatus'](_0x4f49da);}return _0x5d5a60[_0x3524('0x16')](_0x4f49da)[_0x3524('0x17')]();};}function respondWithResult(_0x58cd29,_0x3aa2da){_0x3aa2da=_0x3aa2da||0xc8;return function(_0x253d92){if(_0x253d92){return _0x58cd29[_0x3524('0x16')](_0x3aa2da)[_0x3524('0x18')](_0x253d92);}};}function respondWithFilteredResult(_0xe5df67,_0x235cfd){return function(_0x34d9a0){if(_0x34d9a0){var _0x8440a4=typeof _0x235cfd[_0x3524('0x19')]==='undefined'&&typeof _0x235cfd[_0x3524('0x1a')]==='undefined';var _0x2eb681=_0x34d9a0[_0x3524('0x1b')];var _0x44ee2e=_0x8440a4?0x0:_0x235cfd[_0x3524('0x19')];var _0x1ca615=_0x8440a4?_0x34d9a0[_0x3524('0x1b')]:_0x235cfd['offset']+_0x235cfd['limit'];var _0x1acbd1;if(_0x1ca615>=_0x2eb681){_0x1ca615=_0x2eb681;_0x1acbd1=0xc8;}else{_0x1acbd1=0xce;}_0xe5df67['status'](_0x1acbd1);return _0xe5df67[_0x3524('0x1c')](_0x3524('0x1d'),_0x44ee2e+'-'+_0x1ca615+'/'+_0x2eb681)[_0x3524('0x18')](_0x34d9a0);}return null;};}function patchUpdates(_0xd285a3){return function(_0x1d25f8){try{jsonpatch[_0x3524('0x1e')](_0x1d25f8,_0xd285a3,!![]);}catch(_0x4f584a){return BPromise[_0x3524('0x1f')](_0x4f584a);}return _0x1d25f8[_0x3524('0x20')]();};}function saveUpdates(_0x1ab2c5,_0xf1b3b1){return function(_0x2d20c8){if(_0x2d20c8){return _0x2d20c8['update'](_0x1ab2c5)[_0x3524('0x21')](function(_0x52600c){return _0x52600c;});}return null;};}function removeEntity(_0x2eb72f,_0x26c20e){return function(_0x101e9a){if(_0x101e9a){return _0x101e9a['destroy']()[_0x3524('0x21')](function(){_0x2eb72f[_0x3524('0x16')](0xcc)[_0x3524('0x17')]();});}};}function handleEntityNotFound(_0x27bd6a,_0x4dfd49){return function(_0x4256ca){if(!_0x4256ca){_0x27bd6a[_0x3524('0x22')](0x194);}return _0x4256ca;};}function handleError(_0x1765a4,_0x5dc071){_0x5dc071=_0x5dc071||0x1f4;return function(_0x1d351e){logger[_0x3524('0x23')](_0x1d351e['stack']);if(_0x1d351e[_0x3524('0x24')]){delete _0x1d351e[_0x3524('0x24')];}_0x1765a4['status'](_0x5dc071)['send'](_0x1d351e);};}exports[_0x3524('0x25')]=function(_0x3fddc1,_0x225b26){var _0x651f11={'raw':!![],'where':{'id':_0x3fddc1[_0x3524('0x26')]['id']}},_0x5bf38e={};_0x5bf38e['model']=_[_0x3524('0x27')](db[_0x3524('0x28')][_0x3524('0x29')]);_0x5bf38e['query']=_['keys'](_0x3fddc1[_0x3524('0x2a')]);_0x5bf38e[_0x3524('0x2b')]=_['intersection'](_0x5bf38e[_0x3524('0x2c')],_0x5bf38e[_0x3524('0x2a')]);_0x651f11[_0x3524('0x2d')]=_[_0x3524('0x2e')](_0x5bf38e[_0x3524('0x2c')],qs['fields'](_0x3fddc1[_0x3524('0x2a')][_0x3524('0x2f')]));_0x651f11[_0x3524('0x2d')]=_0x651f11['attributes'][_0x3524('0x30')]?_0x651f11[_0x3524('0x2d')]:_0x5bf38e[_0x3524('0x2c')];if(_0x3fddc1[_0x3524('0x2a')][_0x3524('0x31')]){_0x651f11[_0x3524('0x32')]=[{'all':!![]}];}_0x651f11=_[_0x3524('0x33')]({},_0x651f11,_0x3fddc1[_0x3524('0x34')]);return db[_0x3524('0x28')][_0x3524('0x35')](_0x651f11)[_0x3524('0x21')](handleEntityNotFound(_0x225b26,null))['then'](respondWithResult(_0x225b26,null))['catch'](handleError(_0x225b26,null));};exports['create']=function(_0x197f78,_0x48b54b){return db[_0x3524('0x28')][_0x3524('0x36')](_0x197f78[_0x3524('0x37')],{})['then'](respondWithResult(_0x48b54b,0xc9))[_0x3524('0x38')](handleError(_0x48b54b,null));};exports['update']=function(_0x18ee71,_0xcc63d5){if(_0x18ee71[_0x3524('0x37')]['id']){delete _0x18ee71[_0x3524('0x37')]['id'];}return db[_0x3524('0x28')]['find']({'where':{'id':_0x18ee71[_0x3524('0x26')]['id']}})[_0x3524('0x21')](handleEntityNotFound(_0xcc63d5,null))[_0x3524('0x21')](saveUpdates(_0x18ee71[_0x3524('0x37')],null))['then'](respondWithResult(_0xcc63d5,null))[_0x3524('0x38')](handleError(_0xcc63d5,null));};exports[_0x3524('0x39')]=function(_0x449c51,_0x97b711){return db[_0x3524('0x28')]['find']({'where':{'id':_0x449c51['params']['id']}})[_0x3524('0x21')](handleEntityNotFound(_0x97b711,null))[_0x3524('0x21')](removeEntity(_0x97b711,null))[_0x3524('0x38')](handleError(_0x97b711,null));};
\ No newline at end of file
+var _0x74f3=['moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','length','includeAll','include','options','create','body','catch','find','eml-format','rimraf','zip-dir','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x74f3,0x164));var _0x374f=function(_0x4f61a1,_0x35820b){_0x4f61a1=_0x4f61a1-0x0;var _0xae8b64=_0x74f3[_0x4f61a1];return _0xae8b64;};'use strict';var emlformat=require(_0x374f('0x0'));var rimraf=require(_0x374f('0x1'));var zipdir=require(_0x374f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x374f('0x3'));var moment=require(_0x374f('0x4'));var BPromise=require(_0x374f('0x5'));var Mustache=require(_0x374f('0x6'));var util=require('util');var path=require(_0x374f('0x7'));var sox=require(_0x374f('0x8'));var csv=require('to-csv');var ejs=require(_0x374f('0x9'));var fs=require('fs');var fs_extra=require(_0x374f('0xa'));var _=require(_0x374f('0xb'));var squel=require(_0x374f('0xc'));var crypto=require(_0x374f('0xd'));var jsforce=require(_0x374f('0xe'));var deskjs=require(_0x374f('0xf'));var toCsv=require(_0x374f('0x10'));var querystring=require('querystring');var Papa=require(_0x374f('0x11'));var Redis=require(_0x374f('0x12'));var authService=require(_0x374f('0x13'));var qs=require(_0x374f('0x14'));var as=require(_0x374f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x374f('0x16'))(_0x374f('0x17'));var utils=require('../../config/utils');var config=require(_0x374f('0x18'));var licenseUtil=require(_0x374f('0x19'));var db=require(_0x374f('0x1a'))['db'];function respondWithStatusCode(_0x5ac724,_0x46c396){_0x46c396=_0x46c396||0xcc;return function(_0x3abcdb){if(_0x3abcdb){return _0x5ac724['sendStatus'](_0x46c396);}return _0x5ac724[_0x374f('0x1b')](_0x46c396)[_0x374f('0x1c')]();};}function respondWithResult(_0x5eca08,_0xcfcc04){_0xcfcc04=_0xcfcc04||0xc8;return function(_0x504dc8){if(_0x504dc8){return _0x5eca08[_0x374f('0x1b')](_0xcfcc04)[_0x374f('0x1d')](_0x504dc8);}};}function respondWithFilteredResult(_0x1060c4,_0x3ae58d){return function(_0x1215d5){if(_0x1215d5){var _0x21db8c=typeof _0x3ae58d[_0x374f('0x1e')]===_0x374f('0x1f')&&typeof _0x3ae58d[_0x374f('0x20')]===_0x374f('0x1f');var _0x729572=_0x1215d5[_0x374f('0x21')];var _0x13c210=_0x21db8c?0x0:_0x3ae58d['offset'];var _0x55eb4f=_0x21db8c?_0x1215d5[_0x374f('0x21')]:_0x3ae58d['offset']+_0x3ae58d[_0x374f('0x20')];var _0x39532b;if(_0x55eb4f>=_0x729572){_0x55eb4f=_0x729572;_0x39532b=0xc8;}else{_0x39532b=0xce;}_0x1060c4[_0x374f('0x1b')](_0x39532b);return _0x1060c4['set'](_0x374f('0x22'),_0x13c210+'-'+_0x55eb4f+'/'+_0x729572)['json'](_0x1215d5);}return null;};}function patchUpdates(_0xbcc48f){return function(_0x3bcd1e){try{jsonpatch[_0x374f('0x23')](_0x3bcd1e,_0xbcc48f,!![]);}catch(_0x4df021){return BPromise[_0x374f('0x24')](_0x4df021);}return _0x3bcd1e['save']();};}function saveUpdates(_0x42dff9,_0x27b9ae){return function(_0x2de93d){if(_0x2de93d){return _0x2de93d[_0x374f('0x25')](_0x42dff9)[_0x374f('0x26')](function(_0x188db8){return _0x188db8;});}return null;};}function removeEntity(_0x56f727,_0x4d7ccf){return function(_0x1146a3){if(_0x1146a3){return _0x1146a3[_0x374f('0x27')]()[_0x374f('0x26')](function(){_0x56f727['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d13e4,_0x5a6ddd){return function(_0x5418cd){if(!_0x5418cd){_0x2d13e4['sendStatus'](0x194);}return _0x5418cd;};}function handleError(_0x5ada90,_0x29d2b2){_0x29d2b2=_0x29d2b2||0x1f4;return function(_0x253239){logger['error'](_0x253239[_0x374f('0x28')]);if(_0x253239[_0x374f('0x29')]){delete _0x253239[_0x374f('0x29')];}_0x5ada90[_0x374f('0x1b')](_0x29d2b2)['send'](_0x253239);};}exports[_0x374f('0x2a')]=function(_0x4900b9,_0x2b6664){var _0x3d42f0={'raw':!![],'where':{'id':_0x4900b9[_0x374f('0x2b')]['id']}},_0x2a21d6={};_0x2a21d6[_0x374f('0x2c')]=_[_0x374f('0x2d')](db[_0x374f('0x2e')][_0x374f('0x2f')]);_0x2a21d6[_0x374f('0x30')]=_[_0x374f('0x2d')](_0x4900b9['query']);_0x2a21d6[_0x374f('0x31')]=_[_0x374f('0x32')](_0x2a21d6['model'],_0x2a21d6[_0x374f('0x30')]);_0x3d42f0['attributes']=_[_0x374f('0x32')](_0x2a21d6[_0x374f('0x2c')],qs['fields'](_0x4900b9[_0x374f('0x30')]['fields']));_0x3d42f0[_0x374f('0x33')]=_0x3d42f0[_0x374f('0x33')][_0x374f('0x34')]?_0x3d42f0['attributes']:_0x2a21d6[_0x374f('0x2c')];if(_0x4900b9[_0x374f('0x30')][_0x374f('0x35')]){_0x3d42f0[_0x374f('0x36')]=[{'all':!![]}];}_0x3d42f0=_['merge']({},_0x3d42f0,_0x4900b9[_0x374f('0x37')]);return db[_0x374f('0x2e')]['find'](_0x3d42f0)[_0x374f('0x26')](handleEntityNotFound(_0x2b6664,null))['then'](respondWithResult(_0x2b6664,null))['catch'](handleError(_0x2b6664,null));};exports['create']=function(_0x1b84ac,_0x34bdec){return db[_0x374f('0x2e')][_0x374f('0x38')](_0x1b84ac[_0x374f('0x39')],{})[_0x374f('0x26')](respondWithResult(_0x34bdec,0xc9))['catch'](handleError(_0x34bdec,null));};exports[_0x374f('0x25')]=function(_0x50c898,_0x59ff69){if(_0x50c898[_0x374f('0x39')]['id']){delete _0x50c898['body']['id'];}return db[_0x374f('0x2e')]['find']({'where':{'id':_0x50c898['params']['id']}})[_0x374f('0x26')](handleEntityNotFound(_0x59ff69,null))[_0x374f('0x26')](saveUpdates(_0x50c898[_0x374f('0x39')],null))[_0x374f('0x26')](respondWithResult(_0x59ff69,null))[_0x374f('0x3a')](handleError(_0x59ff69,null));};exports[_0x374f('0x27')]=function(_0x134fb1,_0x4138b9){return db['ChatProactiveAction'][_0x374f('0x3b')]({'where':{'id':_0x134fb1['params']['id']}})[_0x374f('0x26')](handleEntityNotFound(_0x4138b9,null))[_0x374f('0x26')](removeEntity(_0x4138b9,null))['catch'](handleError(_0x4138b9,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index aa377f8..5e64145 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 _0x5c1d=['util','api','moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash'];(function(_0x5773ed,_0x2270ce){var _0x4a75d9=function(_0x31a9a3){while(--_0x31a9a3){_0x5773ed['push'](_0x5773ed['shift']());}};_0x4a75d9(++_0x2270ce);}(_0x5c1d,0x103));var _0xd5c1=function(_0x910cb0,_0x32746d){_0x910cb0=_0x910cb0-0x0;var _0x474d65=_0x5c1d[_0x910cb0];return _0x474d65;};'use strict';var _=require(_0xd5c1('0x0'));var util=require(_0xd5c1('0x1'));var logger=require('../../config/logger')(_0xd5c1('0x2'));var moment=require(_0xd5c1('0x3'));var BPromise=require(_0xd5c1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd5c1('0x5'));var rimraf=require(_0xd5c1('0x6'));var config=require(_0xd5c1('0x7'));var attributes=require(_0xd5c1('0x8'));module[_0xd5c1('0x9')]=function(_0x4d7b76,_0x18ead7){return _0x4d7b76[_0xd5c1('0xa')](_0xd5c1('0xb'),attributes,{'tableName':_0xd5c1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdbaf=['rimraf','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','bluebird'];(function(_0x284000,_0x3d5360){var _0x45d224=function(_0x4c4385){while(--_0x4c4385){_0x284000['push'](_0x284000['shift']());}};_0x45d224(++_0x3d5360);}(_0xdbaf,0x125));var _0xfdba=function(_0x13eda3,_0x3c908b){_0x13eda3=_0x13eda3-0x0;var _0x419f73=_0xdbaf[_0x13eda3];return _0x419f73;};'use strict';var _=require(_0xfdba('0x0'));var util=require('util');var logger=require(_0xfdba('0x1'))(_0xfdba('0x2'));var moment=require('moment');var BPromise=require(_0xfdba('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfdba('0x4'));var config=require('../../config/environment');var attributes=require(_0xfdba('0x5'));module[_0xfdba('0x6')]=function(_0x264ff1,_0x5dead8){return _0x264ff1['define'](_0xfdba('0x7'),attributes,{'tableName':_0xfdba('0x8'),'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 de572b0..790a492 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 _0xd0ba=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd0ba,0x17c));var _0xad0b=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0xd0ba[_0x2b5513];return _0x578fd2;};'use strict';var _=require('lodash');var util=require(_0xad0b('0x0'));var moment=require(_0xad0b('0x1'));var BPromise=require(_0xad0b('0x2'));var rs=require(_0xad0b('0x3'));var fs=require('fs');var Redis=require(_0xad0b('0x4'));var db=require(_0xad0b('0x5'))['db'];var utils=require(_0xad0b('0x6'));var logger=require(_0xad0b('0x7'))(_0xad0b('0x8'));var config=require('../../config/environment');var jayson=require(_0xad0b('0x9'));var client=jayson[_0xad0b('0xa')][_0xad0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x482525,_0x407d30,_0x10cf14){return new BPromise(function(_0x529785,_0x4981c3){return client['request'](_0x482525,_0x10cf14)['then'](function(_0x278f33){logger['info'](_0xad0b('0xc'),_0x407d30,_0xad0b('0xd'));logger['debug'](_0xad0b('0xe'),_0x407d30,_0xad0b('0xd'),JSON[_0xad0b('0xf')](_0x278f33));if(_0x278f33[_0xad0b('0x10')]){if(_0x278f33['error']['code']===0x1f4){logger[_0xad0b('0x10')](_0xad0b('0xc'),_0x407d30,_0x278f33[_0xad0b('0x10')][_0xad0b('0x11')]);return _0x4981c3(_0x278f33[_0xad0b('0x10')][_0xad0b('0x11')]);}logger[_0xad0b('0x10')](_0xad0b('0xc'),_0x407d30,_0x278f33[_0xad0b('0x10')][_0xad0b('0x11')]);return _0x529785(_0x278f33['error'][_0xad0b('0x11')]);}else{logger[_0xad0b('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x407d30,_0xad0b('0xd'));_0x529785(_0x278f33['result'][_0xad0b('0x11')]);}})[_0xad0b('0x13')](function(_0x4394be){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x407d30,_0x4394be);_0x4981c3(_0x4394be);});});}
\ No newline at end of file
+var _0x469c=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3f0bfc,_0x104792){var _0x52b0c3=function(_0x573330){while(--_0x573330){_0x3f0bfc['push'](_0x3f0bfc['shift']());}};_0x52b0c3(++_0x104792);}(_0x469c,0xff));var _0xc469=function(_0x19a90e,_0xe14b0b){_0x19a90e=_0x19a90e-0x0;var _0xa49b11=_0x469c[_0x19a90e];return _0xa49b11;};'use strict';var _=require(_0xc469('0x0'));var util=require(_0xc469('0x1'));var moment=require(_0xc469('0x2'));var BPromise=require(_0xc469('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc469('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc469('0x5'));var logger=require(_0xc469('0x6'))(_0xc469('0x7'));var config=require('../../config/environment');var jayson=require(_0xc469('0x8'));var client=jayson[_0xc469('0x9')][_0xc469('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x476bec,_0x3b7480,_0x22e0c6){return new BPromise(function(_0x427227,_0x44daac){return client['request'](_0x476bec,_0x22e0c6)[_0xc469('0xb')](function(_0x3b27e8){logger[_0xc469('0xc')](_0xc469('0xd'),_0x3b7480,_0xc469('0xe'));logger[_0xc469('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x3b7480,_0xc469('0xe'),JSON[_0xc469('0x10')](_0x3b27e8));if(_0x3b27e8['error']){if(_0x3b27e8['error']['code']===0x1f4){logger[_0xc469('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x3b7480,_0x3b27e8['error'][_0xc469('0x12')]);return _0x44daac(_0x3b27e8[_0xc469('0x11')]['message']);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x3b7480,_0x3b27e8[_0xc469('0x11')][_0xc469('0x12')]);return _0x427227(_0x3b27e8[_0xc469('0x11')][_0xc469('0x12')]);}else{logger['info'](_0xc469('0xd'),_0x3b7480,_0xc469('0xe'));_0x427227(_0x3b27e8[_0xc469('0x13')]['message']);}})[_0xc469('0x14')](function(_0x12aaf3){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x3b7480,_0x12aaf3);_0x44daac(_0x12aaf3);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index c65672c..ee6740c 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 _0x6f47=['show','post','create','put','/:id','update','destroy','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated'];(function(_0x2f56b5,_0x582964){var _0x13f229=function(_0x2e81fb){while(--_0x2e81fb){_0x2f56b5['push'](_0x2f56b5['shift']());}};_0x13f229(++_0x582964);}(_0x6f47,0xc7));var _0x76f4=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x6f47[_0xaa0309];return _0x5de7ce;};'use strict';var multer=require('multer');var util=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f4('0x2'));var router=express['Router']();var fs_extra=require(_0x76f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var controller=require(_0x76f4('0x6'));router[_0x76f4('0x7')]('/:id',auth[_0x76f4('0x8')](),controller[_0x76f4('0x9')]);router[_0x76f4('0xa')]('/',auth['isAuthenticated'](),controller[_0x76f4('0xb')]);router[_0x76f4('0xc')](_0x76f4('0xd'),auth[_0x76f4('0x8')](),controller[_0x76f4('0xe')]);router['delete']('/:id',auth[_0x76f4('0x8')](),controller[_0x76f4('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x3eea=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','post','create','update','isAuthenticated','destroy','multer'];(function(_0x12546e,_0x49a072){var _0x5173d9=function(_0x4b860a){while(--_0x4b860a){_0x12546e['push'](_0x12546e['shift']());}};_0x5173d9(++_0x49a072);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x39ab21,_0x265ac4){_0x39ab21=_0x39ab21-0x0;var _0x403d45=_0x3eea[_0x39ab21];return _0x403d45;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')](_0xa3ee('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa3ee('0xc')]('/',auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['put'](_0xa3ee('0xb'),auth['isAuthenticated'](),controller[_0xa3ee('0xe')]);router['delete'](_0xa3ee('0xb'),auth[_0xa3ee('0xf')](),controller[_0xa3ee('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 9dfe46b..6742a2f 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 _0x23ac=['beepall','roundrobin','STRING','name','ENUM'];(function(_0x5e0d54,_0x493251){var _0x280def=function(_0x18bf09){while(--_0x18bf09){_0x5e0d54['push'](_0x5e0d54['shift']());}};_0x280def(++_0x493251);}(_0x23ac,0x11f));var _0xc23a=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0x23ac[_0x261e29];return _0x25ef43;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc23a('0x0')],'unique':_0xc23a('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc23a('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc23a('0x2')]('rrmemory',_0xc23a('0x3'),_0xc23a('0x4'))}};
\ No newline at end of file
+var _0x0982=['beepall','roundrobin','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x585e84,_0x1d8489){var _0x39f3c4=function(_0x1855a3){while(--_0x1855a3){_0x585e84['push'](_0x585e84['shift']());}};_0x39f3c4(++_0x1d8489);}(_0x0982,0x14b));var _0x2098=function(_0x3c1e73,_0x4b5325){_0x3c1e73=_0x3c1e73-0x0;var _0x4229a3=_0x0982[_0x3c1e73];return _0x4229a3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2098('0x0')],'unique':_0x2098('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2098('0x0')]},'timeout':{'type':Sequelize[_0x2098('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2098('0x3')](_0x2098('0x4'),_0x2098('0x5'),_0x2098('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 2ada005..02caf9e 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 _0xf2d9=['select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','compact','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','order','bluebird','util','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','update','then','get','ChatQueues','error','stack','name','index','map','ChatQueue','rawAttributes','type','key','getOptions','where','include','show','params','model','keys','query','filters','intersection','fields','attributes','length','merge','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','destroy','getMembers','UserChatQueue','hasOwnProperty','nolimit','sort','pick','ChatQueueId','filter','options','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','forEach','emit','userChatQueue:save','removeTeams'];(function(_0x13c1ac,_0x19325c){var _0x85cd90=function(_0x35861c){while(--_0x35861c){_0x13c1ac['push'](_0x13c1ac['shift']());}};_0x85cd90(++_0x19325c);}(_0xf2d9,0x17c));var _0x9f2d=function(_0x23d97c,_0x20d452){_0x23d97c=_0x23d97c-0x0;var _0x510fdd=_0xf2d9[_0x23d97c];return _0x510fdd;};'use strict';var BPromise=require(_0x9f2d('0x0'));var util=require(_0x9f2d('0x1'));var _=require('lodash');var squel=require(_0x9f2d('0x2'));var Redis=require(_0x9f2d('0x3'));var qs=require(_0x9f2d('0x4'));var logger=require('../../config/logger')(_0x9f2d('0x5'));var config=require(_0x9f2d('0x6'));var db=require(_0x9f2d('0x7'))['db'];config[_0x9f2d('0x8')]=_[_0x9f2d('0x9')](config[_0x9f2d('0x8')],{'host':_0x9f2d('0xa'),'port':0x18eb});var socket=require(_0x9f2d('0xb'))(new Redis(config[_0x9f2d('0x8')]));require(_0x9f2d('0xc'))[_0x9f2d('0xd')](socket);function respondWithStatusCode(_0x52ab0f,_0x216ae1){_0x216ae1=_0x216ae1||0xcc;return function(_0x26f244){if(_0x26f244){return _0x52ab0f[_0x9f2d('0xe')](_0x216ae1);}return _0x52ab0f[_0x9f2d('0xf')](_0x216ae1)[_0x9f2d('0x10')]();};}function respondWithResult(_0x312f6b,_0x451cfb){_0x451cfb=_0x451cfb||0xc8;return function(_0x32f752){if(_0x32f752){return _0x312f6b[_0x9f2d('0xf')](_0x451cfb)[_0x9f2d('0x11')](_0x32f752);}};}function respondWithFilteredResult(_0x5c2e8f,_0x3d3124){return function(_0x1a06e3){if(_0x1a06e3){var _0x15aa07=typeof _0x3d3124[_0x9f2d('0x12')]===_0x9f2d('0x13')&&typeof _0x3d3124['limit']===_0x9f2d('0x13');var _0x293bcc=_0x1a06e3[_0x9f2d('0x14')];var _0x4e1cb6=_0x15aa07?0x0:_0x3d3124['offset'];var _0x49bc3f=_0x15aa07?_0x1a06e3[_0x9f2d('0x14')]:_0x3d3124['offset']+_0x3d3124[_0x9f2d('0x15')];var _0x2dba24;if(_0x49bc3f>=_0x293bcc){_0x49bc3f=_0x293bcc;_0x2dba24=0xc8;}else{_0x2dba24=0xce;}_0x5c2e8f['status'](_0x2dba24);return _0x5c2e8f[_0x9f2d('0x16')]('Content-Range',_0x4e1cb6+'-'+_0x49bc3f+'/'+_0x293bcc)[_0x9f2d('0x11')](_0x1a06e3);}return null;};}function saveUpdates(_0x3375b2){return function(_0x5bd820){if(_0x5bd820){return _0x5bd820[_0x9f2d('0x17')](_0x3375b2)[_0x9f2d('0x18')](function(_0x56fc62){return _0x56fc62;});}return null;};}function removeEntity(_0x443419){return function(_0x4639b7){if(_0x4639b7){return _0x4639b7['destroy']()[_0x9f2d('0x18')](function(){var _0x4b09d3=_0x4639b7[_0x9f2d('0x19')]({'plain':!![]});var _0x48b647=_0x9f2d('0x1a');return db['UserProfileResource']['destroy']({'where':{'type':_0x48b647,'resourceId':_0x4b09d3['id']}})[_0x9f2d('0x18')](function(){return _0x4639b7;});})[_0x9f2d('0x18')](function(){_0x443419[_0x9f2d('0xf')](0xcc)[_0x9f2d('0x10')]();});}};}function handleEntityNotFound(_0x2c7008){return function(_0x22f715){if(!_0x22f715){_0x2c7008['sendStatus'](0x194);}return _0x22f715;};}function handleError(_0x419128,_0x205973){_0x205973=_0x205973||0x1f4;return function(_0x409fef){logger[_0x9f2d('0x1b')](_0x409fef[_0x9f2d('0x1c')]);if(_0x409fef['name']){delete _0x409fef[_0x9f2d('0x1d')];}_0x419128[_0x9f2d('0xf')](_0x205973)['send'](_0x409fef);};}exports[_0x9f2d('0x1e')]=function(_0x4be0d1,_0x109e85){var _0x1ccfb5={};var _0x510820={'count':0x0,'rows':[]};var _0x43a68f=_[_0x9f2d('0x1f')](db[_0x9f2d('0x20')][_0x9f2d('0x21')],function(_0x2d2736){return{'name':_0x2d2736['fieldName'],'type':_0x2d2736[_0x9f2d('0x22')][_0x9f2d('0x23')]};});_0x1ccfb5=qs[_0x9f2d('0x24')](_0x43a68f,_0x4be0d1);var _0x1d69bf={'where':_0x1ccfb5[_0x9f2d('0x25')]};return db[_0x9f2d('0x20')][_0x9f2d('0x14')](_0x1d69bf)[_0x9f2d('0x18')](function(_0x2d976c){_0x510820['count']=_0x2d976c;_0x1ccfb5[_0x9f2d('0x26')]=qs[_0x9f2d('0x26')](_0x4be0d1['query']);return db[_0x9f2d('0x20')]['findAll'](_0x1ccfb5);})[_0x9f2d('0x18')](function(_0x434193){_0x510820['rows']=_0x434193;return _0x510820;})[_0x9f2d('0x18')](respondWithFilteredResult(_0x109e85,_0x1ccfb5))['catch'](handleError(_0x109e85,null));};exports[_0x9f2d('0x27')]=function(_0x50da43,_0x3a3005){var _0x2323d4={'raw':!![],'where':{'id':_0x50da43[_0x9f2d('0x28')]['id']}},_0x38f17b={};_0x38f17b[_0x9f2d('0x29')]=_[_0x9f2d('0x2a')](db['ChatQueue']['rawAttributes']);_0x38f17b['query']=_[_0x9f2d('0x2a')](_0x50da43[_0x9f2d('0x2b')]);_0x38f17b[_0x9f2d('0x2c')]=_[_0x9f2d('0x2d')](_0x38f17b[_0x9f2d('0x29')],_0x38f17b[_0x9f2d('0x2b')]);_0x2323d4['attributes']=_[_0x9f2d('0x2d')](_0x38f17b[_0x9f2d('0x29')],qs['fields'](_0x50da43['query'][_0x9f2d('0x2e')]));_0x2323d4[_0x9f2d('0x2f')]=_0x2323d4[_0x9f2d('0x2f')][_0x9f2d('0x30')]?_0x2323d4[_0x9f2d('0x2f')]:_0x38f17b[_0x9f2d('0x29')];if(_0x50da43[_0x9f2d('0x2b')]['includeAll']){_0x2323d4[_0x9f2d('0x26')]=[{'all':!![]}];}_0x2323d4=_[_0x9f2d('0x31')]({},_0x2323d4,_0x50da43['options']);return db['ChatQueue'][_0x9f2d('0x32')](_0x2323d4)['then'](handleEntityNotFound(_0x3a3005,null))[_0x9f2d('0x18')](respondWithResult(_0x3a3005,null))[_0x9f2d('0x33')](handleError(_0x3a3005,null));};exports[_0x9f2d('0x34')]=function(_0x4683fd,_0x3db017){return db[_0x9f2d('0x20')][_0x9f2d('0x34')](_0x4683fd[_0x9f2d('0x35')],{})[_0x9f2d('0x18')](function(_0x2e65a8){var _0x28c1aa=_0x4683fd[_0x9f2d('0x36')]['get']({'plain':!![]});if(!_0x28c1aa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28c1aa[_0x9f2d('0x37')]===_0x9f2d('0x36')){var _0x15888d=_0x2e65a8[_0x9f2d('0x19')]({'plain':!![]});var _0x1d20c7=_0x9f2d('0x1a');return db[_0x9f2d('0x38')]['find']({'where':{'name':_0x1d20c7,'userProfileId':_0x28c1aa[_0x9f2d('0x39')]},'raw':!![]})[_0x9f2d('0x18')](function(_0x5020b6){if(_0x5020b6&&_0x5020b6[_0x9f2d('0x3a')]===0x0){return db[_0x9f2d('0x3b')][_0x9f2d('0x34')]({'name':_0x15888d['name'],'resourceId':_0x15888d['id'],'type':_0x5020b6[_0x9f2d('0x1d')],'sectionId':_0x5020b6['id']},{})[_0x9f2d('0x18')](function(){return _0x2e65a8;});}else{return _0x2e65a8;}})['catch'](function(_0x2b8e20){logger[_0x9f2d('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b8e20);throw _0x2b8e20;});}return _0x2e65a8;})[_0x9f2d('0x18')](respondWithResult(_0x3db017,0xc9))[_0x9f2d('0x33')](handleError(_0x3db017,null));};exports['update']=function(_0x17f8f4,_0x23bea5){if(_0x17f8f4[_0x9f2d('0x35')]['id']){delete _0x17f8f4[_0x9f2d('0x35')]['id'];}return db[_0x9f2d('0x20')][_0x9f2d('0x32')]({'where':{'id':_0x17f8f4[_0x9f2d('0x28')]['id']}})[_0x9f2d('0x18')](handleEntityNotFound(_0x23bea5,null))[_0x9f2d('0x18')](saveUpdates(_0x17f8f4['body'],null))[_0x9f2d('0x18')](respondWithResult(_0x23bea5,null))['catch'](handleError(_0x23bea5,null));};exports[_0x9f2d('0x3c')]=function(_0x511ac0,_0x569331){return db[_0x9f2d('0x20')]['find']({'where':{'id':_0x511ac0['params']['id']}})[_0x9f2d('0x18')](handleEntityNotFound(_0x569331,null))[_0x9f2d('0x18')](removeEntity(_0x569331,null))[_0x9f2d('0x33')](handleError(_0x569331,null));};exports['describe']=function(_0xe90b0a,_0x1e3e24){return db[_0x9f2d('0x20')]['describe']()['then'](respondWithResult(_0x1e3e24,null))[_0x9f2d('0x33')](handleError(_0x1e3e24,null));};exports[_0x9f2d('0x3d')]=function(_0xb533bd,_0x5a3c52){var _0x3a2fa9={'raw':!![],'where':{}},_0x4adbff={},_0x3eb373;return db[_0x9f2d('0x20')]['findOne']({'where':{'id':_0xb533bd[_0x9f2d('0x28')]['id']}})[_0x9f2d('0x18')](handleEntityNotFound(_0x5a3c52,null))[_0x9f2d('0x18')](function(_0x274b95){if(_0x274b95){_0x3eb373=_0x274b95[_0x9f2d('0x19')]({'plain':!![]});_0x4adbff[_0x9f2d('0x29')]=_[_0x9f2d('0x2a')](db[_0x9f2d('0x3e')][_0x9f2d('0x21')]);_0x4adbff[_0x9f2d('0x2b')]=_[_0x9f2d('0x2a')](_0xb533bd['query']);_0x4adbff[_0x9f2d('0x2c')]=_[_0x9f2d('0x2d')](_0x4adbff[_0x9f2d('0x29')],_0x4adbff[_0x9f2d('0x2b')]);_0x3a2fa9[_0x9f2d('0x2f')]=_[_0x9f2d('0x2d')](_0x4adbff[_0x9f2d('0x29')],qs[_0x9f2d('0x2e')](_0xb533bd[_0x9f2d('0x2b')][_0x9f2d('0x2e')]));_0x3a2fa9[_0x9f2d('0x2f')]=_0x3a2fa9[_0x9f2d('0x2f')][_0x9f2d('0x30')]?_0x3a2fa9[_0x9f2d('0x2f')]:_0x4adbff[_0x9f2d('0x29')];if(!_0xb533bd[_0x9f2d('0x2b')][_0x9f2d('0x3f')](_0x9f2d('0x40'))){_0x3a2fa9[_0x9f2d('0x15')]=qs[_0x9f2d('0x15')](_0xb533bd[_0x9f2d('0x2b')][_0x9f2d('0x15')]);_0x3a2fa9[_0x9f2d('0x12')]=qs['offset'](_0xb533bd[_0x9f2d('0x2b')][_0x9f2d('0x12')]);}_0x3a2fa9['order']=qs[_0x9f2d('0x41')](_0xb533bd[_0x9f2d('0x2b')][_0x9f2d('0x41')]);_0x3a2fa9[_0x9f2d('0x25')]=qs[_0x9f2d('0x2c')](_[_0x9f2d('0x42')](_0xb533bd['query'],_0x4adbff['filters']));_0x3a2fa9[_0x9f2d('0x25')][_0x9f2d('0x43')]=_0x274b95['id'];if(_0xb533bd[_0x9f2d('0x2b')][_0x9f2d('0x44')]){_0x3a2fa9[_0x9f2d('0x25')]=_[_0x9f2d('0x31')](_0x3a2fa9['where'],{'$or':_[_0x9f2d('0x1f')](_0x3a2fa9[_0x9f2d('0x2f')],function(_0x44bf3e){var _0x4687e9={};_0x4687e9[_0x44bf3e]={'$like':'%'+_0xb533bd['query'][_0x9f2d('0x44')]+'%'};return _0x4687e9;})});}_0x3a2fa9=_['merge']({},_0x3a2fa9,_0xb533bd[_0x9f2d('0x45')]);return db[_0x9f2d('0x3e')][_0x9f2d('0x46')](_0x3a2fa9);}})[_0x9f2d('0x18')](function(_0x2afa03){if(_0x2afa03){return db[_0x9f2d('0x47')][_0x9f2d('0x48')]({'where':{'id':_[_0x9f2d('0x1f')](_0x2afa03,_0x9f2d('0x49')),'role':_0x9f2d('0x4a')},'attributes':['id','name',_0x9f2d('0x4b'),_0x9f2d('0x4c'),_0x9f2d('0x4d')]});}})[_0x9f2d('0x18')](function(_0x85814d){if(_0x85814d){return{'count':_0x85814d[_0x9f2d('0x14')],'rows':_[_0x9f2d('0x1f')](_0x85814d['rows'],function(_0x4c4dc7){return{'membername':_0x4c4dc7[_0x9f2d('0x1d')],'UserId':_0x4c4dc7['id'],'queue_name':_0x3eb373['name'],'ChatQueueId':_0x3eb373['id'],'interface':util[_0x9f2d('0x4e')](_0x9f2d('0x4f'),_0x9f2d('0x50'),_0x4c4dc7[_0x9f2d('0x1d')]),'penalty':0x0,'paused':_0x4c4dc7[_0x9f2d('0x4b')],'createdAt':_0x4c4dc7[_0x9f2d('0x4d')],'updatedAt':_0x4c4dc7[_0x9f2d('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9f2d('0x18')](respondWithFilteredResult(_0x5a3c52,_0x3a2fa9))['catch'](handleError(_0x5a3c52,null));};exports['getTeams']=function(_0x4a615b,_0x36bd8a){var _0x38e3b6={};var _0x369f78={};var _0x5b9d88;var _0x57cd22;return db['ChatQueue'][_0x9f2d('0x51')]({'where':{'id':_0x4a615b[_0x9f2d('0x28')]['id']}})['then'](handleEntityNotFound(_0x36bd8a,null))[_0x9f2d('0x18')](function(_0x4ad11c){if(_0x4ad11c){_0x5b9d88=_0x4ad11c;_0x369f78[_0x9f2d('0x29')]=_[_0x9f2d('0x2a')](db[_0x9f2d('0x52')]['rawAttributes']);_0x369f78['query']=_[_0x9f2d('0x2a')](_0x4a615b[_0x9f2d('0x2b')]);_0x369f78[_0x9f2d('0x2c')]=_[_0x9f2d('0x2d')](_0x369f78[_0x9f2d('0x29')],_0x369f78['query']);_0x38e3b6[_0x9f2d('0x2f')]=_[_0x9f2d('0x2d')](_0x369f78[_0x9f2d('0x29')],qs[_0x9f2d('0x2e')](_0x4a615b[_0x9f2d('0x2b')][_0x9f2d('0x2e')]));_0x38e3b6['attributes']=_0x38e3b6['attributes']['length']?_0x38e3b6[_0x9f2d('0x2f')]:_0x369f78['model'];_0x38e3b6['order']=qs[_0x9f2d('0x41')](_0x4a615b[_0x9f2d('0x2b')][_0x9f2d('0x41')]);_0x38e3b6[_0x9f2d('0x25')]=qs[_0x9f2d('0x2c')](_[_0x9f2d('0x42')](_0x4a615b['query'],_0x369f78[_0x9f2d('0x2c')]));if(_0x4a615b[_0x9f2d('0x2b')][_0x9f2d('0x44')]){_0x38e3b6[_0x9f2d('0x25')]=_[_0x9f2d('0x31')](_0x38e3b6[_0x9f2d('0x25')],{'$or':_['map'](_0x38e3b6[_0x9f2d('0x2f')],function(_0x26ceca){var _0x2e8e22={};_0x2e8e22[_0x26ceca]={'$like':'%'+_0x4a615b[_0x9f2d('0x2b')][_0x9f2d('0x44')]+'%'};return _0x2e8e22;})});}_0x38e3b6=_[_0x9f2d('0x31')]({},_0x38e3b6,_0x4a615b[_0x9f2d('0x45')]);return _0x5b9d88['getTeams'](_0x38e3b6);}})[_0x9f2d('0x18')](function(_0x3cae0e){if(_0x3cae0e){_0x57cd22=_0x3cae0e[_0x9f2d('0x30')];if(!_0x4a615b[_0x9f2d('0x2b')][_0x9f2d('0x3f')](_0x9f2d('0x40'))){_0x38e3b6['limit']=qs[_0x9f2d('0x15')](_0x4a615b[_0x9f2d('0x2b')][_0x9f2d('0x15')]);_0x38e3b6[_0x9f2d('0x12')]=qs[_0x9f2d('0x12')](_0x4a615b['query'][_0x9f2d('0x12')]);}return _0x5b9d88['getTeams'](_0x38e3b6);}})[_0x9f2d('0x18')](function(_0x3b39fa){if(_0x3b39fa){return _0x3b39fa?{'count':_0x57cd22,'rows':_0x3b39fa}:null;}})[_0x9f2d('0x18')](respondWithResult(_0x36bd8a,null))['catch'](handleError(_0x36bd8a,null));};exports[_0x9f2d('0x53')]=function(_0x1a99e2,_0x3f8195){var _0x274672=_0x1a99e2[_0x9f2d('0x35')][_0x9f2d('0x54')];return db[_0x9f2d('0x52')]['findAll']({'where':{'id':_0x274672},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9f2d('0x55'),'attributes':['id',_0x9f2d('0x1d'),_0x9f2d('0x56'),_0x9f2d('0x57'),'interface'],'raw':!![]}]})[_0x9f2d('0x18')](function(_0x328c98){if(_0x328c98){var _0x135930=_[_0x9f2d('0x58')](_0x328c98,function(_0x51de04){var _0x1fd719=_0x51de04[_0x9f2d('0x19')]({'plain':!![]});return _0x1fd719[_0x9f2d('0x55')];});return db[_0x9f2d('0x20')]['find']({'where':{'id':_0x1a99e2[_0x9f2d('0x28')]['id']}})[_0x9f2d('0x18')](function(_0x43c8d2){return db[_0x9f2d('0x59')][_0x9f2d('0x5a')](function(_0x38c3c3){return _0x43c8d2[_0x9f2d('0x53')](_0x274672,{'transaction':_0x38c3c3})[_0x9f2d('0x18')](function(){return BPromise[_0x9f2d('0x5b')](_0x135930,function(_0x30d0b1){return db[_0x9f2d('0x3e')]['findOrCreate']({'where':{'UserId':_0x30d0b1['id'],'ChatQueueId':_0x1a99e2[_0x9f2d('0x28')]['id']},'transaction':_0x38c3c3});});})[_0x9f2d('0x18')](function(){_0x135930[_0x9f2d('0x5c')](function(_0x117a52){socket[_0x9f2d('0x5d')](_0x9f2d('0x5e'),{'UserId':_0x117a52['id'],'ChatQueueId':_0x43c8d2['id']});});});});});}})['then'](respondWithStatusCode(_0x3f8195,null))[_0x9f2d('0x33')](handleError(_0x3f8195,null));};exports[_0x9f2d('0x5f')]=function(_0x587ee9,_0x3e654e){return db[_0x9f2d('0x52')][_0x9f2d('0x46')]({'where':{'id':_0x587ee9[_0x9f2d('0x2b')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9f2d('0x55'),'attributes':['id'],'raw':!![]}]})[_0x9f2d('0x18')](handleEntityNotFound(_0x3e654e,null))[_0x9f2d('0x18')](function(_0x1df143){var _0x1de1d5=_['map'](_0x1df143,'id');var _0x50449a=[];var _0x333870=[];var _0x325a38=squel[_0x9f2d('0x60')]();_0x325a38[_0x9f2d('0x61')](_0x9f2d('0x62'))['from'](_0x9f2d('0x63'),'tq')[_0x9f2d('0x64')](_0x9f2d('0x65'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x9f2d('0x66'),_0x587ee9['params']['id']);for(var _0xf7427a=0x0;_0xf7427a<_0x1df143[_0x9f2d('0x30')];_0xf7427a+=0x1){let _0x2ec18f=_0x1df143[_0xf7427a];for(var _0x2b6450=0x0;_0x2b6450<_0x2ec18f[_0x9f2d('0x55')][_0x9f2d('0x30')];_0x2b6450+=0x1){let _0x4f7875=_0x2ec18f[_0x9f2d('0x55')][_0x2b6450];var _0x552b3e=_0x325a38['clone']();_0x552b3e[_0x9f2d('0x25')](_0x9f2d('0x67'),_0x4f7875['id']);_0x333870['push'](db[_0x9f2d('0x59')][_0x9f2d('0x2b')](_0x552b3e[_0x9f2d('0x68')](),{'type':db['sequelize'][_0x9f2d('0x69')][_0x9f2d('0x6a')]})[_0x9f2d('0x18')](function(_0x52d9f1){if(_0x52d9f1[_0x9f2d('0x30')]===0x1){return _0x4f7875['id'];}else{var _0x10e333=_[_0x9f2d('0x6b')](_['map'](_0x52d9f1,_0x9f2d('0x6c')),function(_0xa2564f){return _['includes'](_0x1de1d5,_0xa2564f);});if(_0x10e333){return _0x4f7875['id'];}}}));}}return BPromise[_0x9f2d('0x6d')](_0x333870)[_0x9f2d('0x18')](function(_0x57cf5b){_0x50449a=_(_0x50449a)['union'](_0x57cf5b)[_0x9f2d('0x6e')]()['value']();return db[_0x9f2d('0x20')]['find']({'where':{'id':_0x587ee9[_0x9f2d('0x28')]['id']}})[_0x9f2d('0x18')](function(_0x425629){return db[_0x9f2d('0x59')][_0x9f2d('0x5a')](function(_0x1ef5e2){return _0x425629[_0x9f2d('0x5f')](_0x587ee9[_0x9f2d('0x2b')][_0x9f2d('0x54')],{'transaction':_0x1ef5e2})['then'](function(){if(!_['isEmpty'](_0x50449a)){return _0x425629[_0x9f2d('0x6f')](_0x50449a,{'transaction':_0x1ef5e2});}})[_0x9f2d('0x18')](function(){_0x50449a[_0x9f2d('0x5c')](function(_0x4f6aa5){socket[_0x9f2d('0x5d')](_0x9f2d('0x70'),{'UserId':_0x4f6aa5,'ChatQueueId':_0x425629['id']});});});});});});})['then'](respondWithStatusCode(_0x3e654e,null))[_0x9f2d('0x33')](handleError(_0x3e654e,null));};exports[_0x9f2d('0x71')]=function(_0x1116a7,_0x56a060){return db['ChatQueue'][_0x9f2d('0x32')]({'where':{'id':_0x1116a7[_0x9f2d('0x28')]['id']}})['then'](handleEntityNotFound(_0x56a060,null))[_0x9f2d('0x18')](function(_0x548926){if(_0x548926){return _0x548926[_0x9f2d('0x71')](_0x1116a7[_0x9f2d('0x35')][_0x9f2d('0x54')],_[_0x9f2d('0x72')](_0x1116a7[_0x9f2d('0x35')],[_0x9f2d('0x54'),'id'])||{})[_0x9f2d('0x73')](function(_0x250e60){for(var _0x2094bc=0x0;_0x2094bc<_0x1116a7[_0x9f2d('0x35')][_0x9f2d('0x54')][_0x9f2d('0x30')];_0x2094bc+=0x1){socket[_0x9f2d('0x5d')](_0x9f2d('0x5e'),{'UserId':Number(_0x1116a7[_0x9f2d('0x35')][_0x9f2d('0x54')][_0x2094bc]),'ChatQueueId':Number(_0x1116a7[_0x9f2d('0x28')]['id'])});}return _0x250e60;});}})[_0x9f2d('0x18')](respondWithResult(_0x56a060,null))[_0x9f2d('0x33')](handleError(_0x56a060,null));};exports[_0x9f2d('0x6f')]=function(_0x23a16b,_0xe53192){return db[_0x9f2d('0x20')]['find']({'where':{'id':_0x23a16b['params']['id']}})[_0x9f2d('0x18')](handleEntityNotFound(_0xe53192,null))[_0x9f2d('0x18')](function(_0x387f04){if(_0x387f04){return _0x387f04[_0x9f2d('0x6f')](_0x23a16b[_0x9f2d('0x2b')][_0x9f2d('0x54')])['then'](function(){if(_[_0x9f2d('0x74')](_0x23a16b['query'][_0x9f2d('0x54')])){for(var _0x2ae343=0x0;_0x2ae343<_0x23a16b[_0x9f2d('0x2b')]['ids']['length'];_0x2ae343+=0x1){socket['emit'](_0x9f2d('0x70'),{'UserId':Number(_0x23a16b[_0x9f2d('0x2b')][_0x9f2d('0x54')][_0x2ae343]),'ChatQueueId':Number(_0x23a16b['params']['id'])});}}else{socket[_0x9f2d('0x5d')](_0x9f2d('0x70'),{'UserId':Number(_0x23a16b[_0x9f2d('0x2b')]['ids']),'ChatQueueId':Number(_0x23a16b[_0x9f2d('0x28')]['id'])});}});}})[_0x9f2d('0x18')](respondWithStatusCode(_0xe53192,null))[_0x9f2d('0x33')](handleError(_0xe53192,null));};exports[_0x9f2d('0x75')]=function(_0x23df95,_0x20daa9){var _0x3e9498={};var _0x36a326={};var _0x352982;var _0x36f63a;return db[_0x9f2d('0x20')][_0x9f2d('0x51')]({'where':{'id':_0x23df95[_0x9f2d('0x28')]['id']}})[_0x9f2d('0x18')](handleEntityNotFound(_0x20daa9,null))[_0x9f2d('0x18')](function(_0x4a366d){if(_0x4a366d){_0x352982=_0x4a366d;_0x36a326[_0x9f2d('0x29')]=_[_0x9f2d('0x2a')](db['User'][_0x9f2d('0x21')]);_0x36a326['query']=_['keys'](_0x23df95[_0x9f2d('0x2b')]);_0x36a326[_0x9f2d('0x2c')]=_[_0x9f2d('0x2d')](_0x36a326[_0x9f2d('0x29')],_0x36a326['query']);_0x3e9498[_0x9f2d('0x2f')]=_[_0x9f2d('0x2d')](_0x36a326['model'],qs['fields'](_0x23df95[_0x9f2d('0x2b')][_0x9f2d('0x2e')]));_0x3e9498[_0x9f2d('0x2f')]=_0x3e9498[_0x9f2d('0x2f')]['length']?_0x3e9498[_0x9f2d('0x2f')]:_0x36a326[_0x9f2d('0x29')];_0x3e9498[_0x9f2d('0x76')]=qs[_0x9f2d('0x41')](_0x23df95[_0x9f2d('0x2b')][_0x9f2d('0x41')]);_0x3e9498[_0x9f2d('0x25')]=qs[_0x9f2d('0x2c')](_[_0x9f2d('0x42')](_0x23df95[_0x9f2d('0x2b')],_0x36a326[_0x9f2d('0x2c')]));if(_0x23df95[_0x9f2d('0x2b')][_0x9f2d('0x44')]){_0x3e9498[_0x9f2d('0x25')]=_[_0x9f2d('0x31')](_0x3e9498[_0x9f2d('0x25')],{'$or':_[_0x9f2d('0x1f')](_0x3e9498[_0x9f2d('0x2f')],function(_0x35f2e8){var _0x55a17c={};_0x55a17c[_0x35f2e8]={'$like':'%'+_0x23df95[_0x9f2d('0x2b')][_0x9f2d('0x44')]+'%'};return _0x55a17c;})});}_0x3e9498=_[_0x9f2d('0x31')]({},_0x3e9498,_0x23df95['options']);return _0x352982[_0x9f2d('0x75')](_0x3e9498);}})['then'](function(_0x667607){if(_0x667607){_0x36f63a=_0x667607[_0x9f2d('0x30')];if(!_0x23df95[_0x9f2d('0x2b')]['hasOwnProperty']('nolimit')){_0x3e9498[_0x9f2d('0x15')]=qs[_0x9f2d('0x15')](_0x23df95[_0x9f2d('0x2b')][_0x9f2d('0x15')]);_0x3e9498[_0x9f2d('0x12')]=qs[_0x9f2d('0x12')](_0x23df95[_0x9f2d('0x2b')][_0x9f2d('0x12')]);}return _0x352982[_0x9f2d('0x75')](_0x3e9498);}})[_0x9f2d('0x18')](function(_0xc3e31a){if(_0xc3e31a){return _0xc3e31a?{'count':_0x36f63a,'rows':_0xc3e31a}:null;}})[_0x9f2d('0x18')](respondWithResult(_0x20daa9,null))[_0x9f2d('0x33')](handleError(_0x20daa9,null));};
\ No newline at end of file
+var _0xe49d=['each','UserChatQueue','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','User','select','tq.TeamId','from','join','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','addAgents','isArray','userChatQueue:remove','getAgents','bluebird','util','squel','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','status','end','json','offset','undefined','limit','count','set','update','then','destroy','ChatQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','ChatQueue','rawAttributes','type','getOptions','where','include','query','rows','show','params','model','keys','filters','attributes','intersection','fields','options','find','catch','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','findOne','length','hasOwnProperty','order','sort','pick','ChatQueueId','filter','merge','findAndCountAll','agent','chatPause','createdAt','updatedAt','getTeams','nolimit','addTeams','ids','Team','findAll','online','interface','Agents','sequelize','transaction'];(function(_0x4b775b,_0x2aadc6){var _0xf84d39=function(_0x55ac96){while(--_0x55ac96){_0x4b775b['push'](_0x4b775b['shift']());}};_0xf84d39(++_0x2aadc6);}(_0xe49d,0x1ee));var _0xde49=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe49d[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0xde49('0x0'));var util=require(_0xde49('0x1'));var _=require('lodash');var squel=require(_0xde49('0x2'));var Redis=require(_0xde49('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xde49('0x4'))(_0xde49('0x5'));var config=require(_0xde49('0x6'));var db=require(_0xde49('0x7'))['db'];config[_0xde49('0x8')]=_[_0xde49('0x9')](config['redis'],{'host':_0xde49('0xa'),'port':0x18eb});var socket=require(_0xde49('0xb'))(new Redis(config[_0xde49('0x8')]));require(_0xde49('0xc'))[_0xde49('0xd')](socket);function respondWithStatusCode(_0x406d47,_0x2e4cd3){_0x2e4cd3=_0x2e4cd3||0xcc;return function(_0x1efdb7){if(_0x1efdb7){return _0x406d47['sendStatus'](_0x2e4cd3);}return _0x406d47[_0xde49('0xe')](_0x2e4cd3)[_0xde49('0xf')]();};}function respondWithResult(_0x5715a0,_0x4fcd11){_0x4fcd11=_0x4fcd11||0xc8;return function(_0x36baae){if(_0x36baae){return _0x5715a0[_0xde49('0xe')](_0x4fcd11)[_0xde49('0x10')](_0x36baae);}};}function respondWithFilteredResult(_0x364b6d,_0x8dfb87){return function(_0x589485){if(_0x589485){var _0x11187b=typeof _0x8dfb87[_0xde49('0x11')]===_0xde49('0x12')&&typeof _0x8dfb87[_0xde49('0x13')]===_0xde49('0x12');var _0x28d452=_0x589485[_0xde49('0x14')];var _0x30c3de=_0x11187b?0x0:_0x8dfb87[_0xde49('0x11')];var _0x1bef97=_0x11187b?_0x589485[_0xde49('0x14')]:_0x8dfb87['offset']+_0x8dfb87[_0xde49('0x13')];var _0x100dbd;if(_0x1bef97>=_0x28d452){_0x1bef97=_0x28d452;_0x100dbd=0xc8;}else{_0x100dbd=0xce;}_0x364b6d[_0xde49('0xe')](_0x100dbd);return _0x364b6d[_0xde49('0x15')]('Content-Range',_0x30c3de+'-'+_0x1bef97+'/'+_0x28d452)['json'](_0x589485);}return null;};}function saveUpdates(_0x3b4b7b){return function(_0x200f30){if(_0x200f30){return _0x200f30[_0xde49('0x16')](_0x3b4b7b)[_0xde49('0x17')](function(_0x6e5376){return _0x6e5376;});}return null;};}function removeEntity(_0x34bd53){return function(_0x388093){if(_0x388093){return _0x388093[_0xde49('0x18')]()[_0xde49('0x17')](function(){var _0x14515d=_0x388093['get']({'plain':!![]});var _0x21a2f7=_0xde49('0x19');return db[_0xde49('0x1a')][_0xde49('0x18')]({'where':{'type':_0x21a2f7,'resourceId':_0x14515d['id']}})[_0xde49('0x17')](function(){return _0x388093;});})[_0xde49('0x17')](function(){_0x34bd53[_0xde49('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x113b40){return function(_0x6c6a8){if(!_0x6c6a8){_0x113b40[_0xde49('0x1b')](0x194);}return _0x6c6a8;};}function handleError(_0x25725a,_0x2c593d){_0x2c593d=_0x2c593d||0x1f4;return function(_0x870ff3){logger[_0xde49('0x1c')](_0x870ff3[_0xde49('0x1d')]);if(_0x870ff3[_0xde49('0x1e')]){delete _0x870ff3['name'];}_0x25725a[_0xde49('0xe')](_0x2c593d)[_0xde49('0x1f')](_0x870ff3);};}exports[_0xde49('0x20')]=function(_0x107af0,_0xfd9682){var _0x1547e9={};var _0x3bd9b4={'count':0x0,'rows':[]};var _0x72cdad=_[_0xde49('0x21')](db[_0xde49('0x22')][_0xde49('0x23')],function(_0x1f9422){return{'name':_0x1f9422['fieldName'],'type':_0x1f9422[_0xde49('0x24')]['key']};});_0x1547e9=qs[_0xde49('0x25')](_0x72cdad,_0x107af0);var _0x4fd45a={'where':_0x1547e9[_0xde49('0x26')]};return db[_0xde49('0x22')][_0xde49('0x14')](_0x4fd45a)[_0xde49('0x17')](function(_0x281830){_0x3bd9b4[_0xde49('0x14')]=_0x281830;_0x1547e9[_0xde49('0x27')]=qs[_0xde49('0x27')](_0x107af0[_0xde49('0x28')]);return db[_0xde49('0x22')]['findAll'](_0x1547e9);})[_0xde49('0x17')](function(_0x2a0542){_0x3bd9b4[_0xde49('0x29')]=_0x2a0542;return _0x3bd9b4;})[_0xde49('0x17')](respondWithFilteredResult(_0xfd9682,_0x1547e9))['catch'](handleError(_0xfd9682,null));};exports[_0xde49('0x2a')]=function(_0x427262,_0x366f3b){var _0x5cf36d={'raw':!![],'where':{'id':_0x427262[_0xde49('0x2b')]['id']}},_0x5c3c82={};_0x5c3c82[_0xde49('0x2c')]=_['keys'](db[_0xde49('0x22')]['rawAttributes']);_0x5c3c82['query']=_[_0xde49('0x2d')](_0x427262['query']);_0x5c3c82[_0xde49('0x2e')]=_['intersection'](_0x5c3c82[_0xde49('0x2c')],_0x5c3c82[_0xde49('0x28')]);_0x5cf36d[_0xde49('0x2f')]=_[_0xde49('0x30')](_0x5c3c82[_0xde49('0x2c')],qs[_0xde49('0x31')](_0x427262[_0xde49('0x28')][_0xde49('0x31')]));_0x5cf36d[_0xde49('0x2f')]=_0x5cf36d[_0xde49('0x2f')]['length']?_0x5cf36d[_0xde49('0x2f')]:_0x5c3c82['model'];if(_0x427262[_0xde49('0x28')]['includeAll']){_0x5cf36d[_0xde49('0x27')]=[{'all':!![]}];}_0x5cf36d=_['merge']({},_0x5cf36d,_0x427262[_0xde49('0x32')]);return db[_0xde49('0x22')][_0xde49('0x33')](_0x5cf36d)['then'](handleEntityNotFound(_0x366f3b,null))['then'](respondWithResult(_0x366f3b,null))[_0xde49('0x34')](handleError(_0x366f3b,null));};exports[_0xde49('0x35')]=function(_0x1aa804,_0x5d85fe){return db['ChatQueue'][_0xde49('0x35')](_0x1aa804[_0xde49('0x36')],{})[_0xde49('0x17')](function(_0x30e8d1){var _0x41281f=_0x1aa804['user'][_0xde49('0x37')]({'plain':!![]});if(!_0x41281f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41281f[_0xde49('0x38')]===_0xde49('0x39')){var _0x136998=_0x30e8d1[_0xde49('0x37')]({'plain':!![]});var _0x15928c=_0xde49('0x19');return db[_0xde49('0x3a')][_0xde49('0x33')]({'where':{'name':_0x15928c,'userProfileId':_0x41281f[_0xde49('0x3b')]},'raw':!![]})[_0xde49('0x17')](function(_0x2d669f){if(_0x2d669f&&_0x2d669f[_0xde49('0x3c')]===0x0){return db[_0xde49('0x1a')]['create']({'name':_0x136998[_0xde49('0x1e')],'resourceId':_0x136998['id'],'type':_0x2d669f[_0xde49('0x1e')],'sectionId':_0x2d669f['id']},{})[_0xde49('0x17')](function(){return _0x30e8d1;});}else{return _0x30e8d1;}})[_0xde49('0x34')](function(_0x1006ec){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1006ec);throw _0x1006ec;});}return _0x30e8d1;})['then'](respondWithResult(_0x5d85fe,0xc9))[_0xde49('0x34')](handleError(_0x5d85fe,null));};exports['update']=function(_0x56503b,_0x10502c){if(_0x56503b[_0xde49('0x36')]['id']){delete _0x56503b[_0xde49('0x36')]['id'];}return db[_0xde49('0x22')][_0xde49('0x33')]({'where':{'id':_0x56503b[_0xde49('0x2b')]['id']}})[_0xde49('0x17')](handleEntityNotFound(_0x10502c,null))[_0xde49('0x17')](saveUpdates(_0x56503b['body'],null))[_0xde49('0x17')](respondWithResult(_0x10502c,null))[_0xde49('0x34')](handleError(_0x10502c,null));};exports[_0xde49('0x18')]=function(_0x53e772,_0x44a246){return db['ChatQueue'][_0xde49('0x33')]({'where':{'id':_0x53e772[_0xde49('0x2b')]['id']}})[_0xde49('0x17')](handleEntityNotFound(_0x44a246,null))[_0xde49('0x17')](removeEntity(_0x44a246,null))[_0xde49('0x34')](handleError(_0x44a246,null));};exports['describe']=function(_0x1e56a2,_0x91fc48){return db[_0xde49('0x22')]['describe']()[_0xde49('0x17')](respondWithResult(_0x91fc48,null))[_0xde49('0x34')](handleError(_0x91fc48,null));};exports['getMembers']=function(_0xa11662,_0x12ecd5){var _0x25b15d={'raw':!![],'where':{}},_0x535d76={},_0x1317f4;return db[_0xde49('0x22')][_0xde49('0x3d')]({'where':{'id':_0xa11662[_0xde49('0x2b')]['id']}})['then'](handleEntityNotFound(_0x12ecd5,null))[_0xde49('0x17')](function(_0x5f016f){if(_0x5f016f){_0x1317f4=_0x5f016f[_0xde49('0x37')]({'plain':!![]});_0x535d76[_0xde49('0x2c')]=_[_0xde49('0x2d')](db['UserChatQueue']['rawAttributes']);_0x535d76[_0xde49('0x28')]=_[_0xde49('0x2d')](_0xa11662[_0xde49('0x28')]);_0x535d76[_0xde49('0x2e')]=_[_0xde49('0x30')](_0x535d76[_0xde49('0x2c')],_0x535d76[_0xde49('0x28')]);_0x25b15d[_0xde49('0x2f')]=_[_0xde49('0x30')](_0x535d76['model'],qs[_0xde49('0x31')](_0xa11662['query']['fields']));_0x25b15d['attributes']=_0x25b15d['attributes'][_0xde49('0x3e')]?_0x25b15d['attributes']:_0x535d76[_0xde49('0x2c')];if(!_0xa11662[_0xde49('0x28')][_0xde49('0x3f')]('nolimit')){_0x25b15d[_0xde49('0x13')]=qs['limit'](_0xa11662[_0xde49('0x28')]['limit']);_0x25b15d[_0xde49('0x11')]=qs['offset'](_0xa11662[_0xde49('0x28')][_0xde49('0x11')]);}_0x25b15d[_0xde49('0x40')]=qs[_0xde49('0x41')](_0xa11662[_0xde49('0x28')][_0xde49('0x41')]);_0x25b15d[_0xde49('0x26')]=qs['filters'](_[_0xde49('0x42')](_0xa11662[_0xde49('0x28')],_0x535d76[_0xde49('0x2e')]));_0x25b15d['where'][_0xde49('0x43')]=_0x5f016f['id'];if(_0xa11662[_0xde49('0x28')][_0xde49('0x44')]){_0x25b15d[_0xde49('0x26')]=_[_0xde49('0x45')](_0x25b15d[_0xde49('0x26')],{'$or':_[_0xde49('0x21')](_0x25b15d[_0xde49('0x2f')],function(_0x5da66a){var _0x1a8436={};_0x1a8436[_0x5da66a]={'$like':'%'+_0xa11662[_0xde49('0x28')][_0xde49('0x44')]+'%'};return _0x1a8436;})});}_0x25b15d=_['merge']({},_0x25b15d,_0xa11662[_0xde49('0x32')]);return db['UserChatQueue']['findAll'](_0x25b15d);}})[_0xde49('0x17')](function(_0x3f8472){if(_0x3f8472){return db['User'][_0xde49('0x46')]({'where':{'id':_[_0xde49('0x21')](_0x3f8472,'UserId'),'role':_0xde49('0x47')},'attributes':['id','name',_0xde49('0x48'),'updatedAt',_0xde49('0x49')]});}})[_0xde49('0x17')](function(_0x11004c){if(_0x11004c){return{'count':_0x11004c[_0xde49('0x14')],'rows':_[_0xde49('0x21')](_0x11004c[_0xde49('0x29')],function(_0x3d2f36){return{'membername':_0x3d2f36[_0xde49('0x1e')],'UserId':_0x3d2f36['id'],'queue_name':_0x1317f4[_0xde49('0x1e')],'ChatQueueId':_0x1317f4['id'],'interface':util['format']('%s/%s','SIP',_0x3d2f36[_0xde49('0x1e')]),'penalty':0x0,'paused':_0x3d2f36[_0xde49('0x48')],'createdAt':_0x3d2f36[_0xde49('0x49')],'updatedAt':_0x3d2f36[_0xde49('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xde49('0x17')](respondWithFilteredResult(_0x12ecd5,_0x25b15d))[_0xde49('0x34')](handleError(_0x12ecd5,null));};exports[_0xde49('0x4b')]=function(_0x4f35f2,_0x1bde6f){var _0x292455={};var _0x383c2f={};var _0xe576f5;var _0x17282f;return db['ChatQueue'][_0xde49('0x3d')]({'where':{'id':_0x4f35f2[_0xde49('0x2b')]['id']}})[_0xde49('0x17')](handleEntityNotFound(_0x1bde6f,null))['then'](function(_0x3004de){if(_0x3004de){_0xe576f5=_0x3004de;_0x383c2f['model']=_[_0xde49('0x2d')](db['Team'][_0xde49('0x23')]);_0x383c2f[_0xde49('0x28')]=_['keys'](_0x4f35f2['query']);_0x383c2f[_0xde49('0x2e')]=_[_0xde49('0x30')](_0x383c2f[_0xde49('0x2c')],_0x383c2f[_0xde49('0x28')]);_0x292455[_0xde49('0x2f')]=_[_0xde49('0x30')](_0x383c2f[_0xde49('0x2c')],qs['fields'](_0x4f35f2['query'][_0xde49('0x31')]));_0x292455[_0xde49('0x2f')]=_0x292455[_0xde49('0x2f')][_0xde49('0x3e')]?_0x292455[_0xde49('0x2f')]:_0x383c2f['model'];_0x292455['order']=qs[_0xde49('0x41')](_0x4f35f2[_0xde49('0x28')][_0xde49('0x41')]);_0x292455['where']=qs['filters'](_[_0xde49('0x42')](_0x4f35f2[_0xde49('0x28')],_0x383c2f[_0xde49('0x2e')]));if(_0x4f35f2[_0xde49('0x28')][_0xde49('0x44')]){_0x292455[_0xde49('0x26')]=_[_0xde49('0x45')](_0x292455[_0xde49('0x26')],{'$or':_['map'](_0x292455[_0xde49('0x2f')],function(_0x1131da){var _0x451f0b={};_0x451f0b[_0x1131da]={'$like':'%'+_0x4f35f2['query']['filter']+'%'};return _0x451f0b;})});}_0x292455=_['merge']({},_0x292455,_0x4f35f2[_0xde49('0x32')]);return _0xe576f5['getTeams'](_0x292455);}})[_0xde49('0x17')](function(_0x41cddc){if(_0x41cddc){_0x17282f=_0x41cddc[_0xde49('0x3e')];if(!_0x4f35f2[_0xde49('0x28')][_0xde49('0x3f')](_0xde49('0x4c'))){_0x292455['limit']=qs['limit'](_0x4f35f2[_0xde49('0x28')][_0xde49('0x13')]);_0x292455['offset']=qs['offset'](_0x4f35f2[_0xde49('0x28')][_0xde49('0x11')]);}return _0xe576f5[_0xde49('0x4b')](_0x292455);}})[_0xde49('0x17')](function(_0x4290f1){if(_0x4290f1){return _0x4290f1?{'count':_0x17282f,'rows':_0x4290f1}:null;}})[_0xde49('0x17')](respondWithResult(_0x1bde6f,null))['catch'](handleError(_0x1bde6f,null));};exports[_0xde49('0x4d')]=function(_0x358e75,_0x4d25ff){var _0x2f2f41=_0x358e75[_0xde49('0x36')][_0xde49('0x4e')];return db[_0xde49('0x4f')][_0xde49('0x50')]({'where':{'id':_0x2f2f41},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0xde49('0x51'),'voicePause',_0xde49('0x52')],'raw':!![]}]})[_0xde49('0x17')](function(_0x5d5ac2){if(_0x5d5ac2){var _0x3506aa=_['flatMap'](_0x5d5ac2,function(_0x11bfe4){var _0x53750e=_0x11bfe4['get']({'plain':!![]});return _0x53750e[_0xde49('0x53')];});return db[_0xde49('0x22')][_0xde49('0x33')]({'where':{'id':_0x358e75[_0xde49('0x2b')]['id']}})[_0xde49('0x17')](function(_0x3b41ee){return db[_0xde49('0x54')][_0xde49('0x55')](function(_0x3bf59a){return _0x3b41ee[_0xde49('0x4d')](_0x2f2f41,{'transaction':_0x3bf59a})[_0xde49('0x17')](function(){return BPromise[_0xde49('0x56')](_0x3506aa,function(_0x27fff2){return db[_0xde49('0x57')][_0xde49('0x58')]({'where':{'UserId':_0x27fff2['id'],'ChatQueueId':_0x358e75[_0xde49('0x2b')]['id']},'transaction':_0x3bf59a});});})[_0xde49('0x17')](function(){_0x3506aa[_0xde49('0x59')](function(_0x246957){socket[_0xde49('0x5a')](_0xde49('0x5b'),{'UserId':_0x246957['id'],'ChatQueueId':_0x3b41ee['id']});});});});});}})[_0xde49('0x17')](respondWithStatusCode(_0x4d25ff,null))[_0xde49('0x34')](handleError(_0x4d25ff,null));};exports[_0xde49('0x5c')]=function(_0x92c259,_0x4ee992){return db['Team'][_0xde49('0x50')]({'where':{'id':_0x92c259['query'][_0xde49('0x4e')]},'attributes':['id'],'include':[{'model':db[_0xde49('0x5d')],'as':_0xde49('0x53'),'attributes':['id'],'raw':!![]}]})[_0xde49('0x17')](handleEntityNotFound(_0x4ee992,null))[_0xde49('0x17')](function(_0x189805){var _0x8af480=_['map'](_0x189805,'id');var _0x1314b5=[];var _0x49d4f2=[];var _0x1128e3=squel[_0xde49('0x5e')]();_0x1128e3['field'](_0xde49('0x5f'))[_0xde49('0x60')]('team_has_chat_queues','tq')[_0xde49('0x61')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xde49('0x26')](_0xde49('0x62'),_0x92c259['params']['id']);for(var _0x4c27cf=0x0;_0x4c27cf<_0x189805['length'];_0x4c27cf+=0x1){let _0x38d1ce=_0x189805[_0x4c27cf];for(var _0x302f64=0x0;_0x302f64<_0x38d1ce[_0xde49('0x53')][_0xde49('0x3e')];_0x302f64+=0x1){let _0x488ae1=_0x38d1ce[_0xde49('0x53')][_0x302f64];var _0x3cb7be=_0x1128e3[_0xde49('0x63')]();_0x3cb7be[_0xde49('0x26')](_0xde49('0x64'),_0x488ae1['id']);_0x49d4f2[_0xde49('0x65')](db[_0xde49('0x54')][_0xde49('0x28')](_0x3cb7be[_0xde49('0x66')](),{'type':db['sequelize']['QueryTypes'][_0xde49('0x67')]})[_0xde49('0x17')](function(_0x56ae21){if(_0x56ae21['length']===0x1){return _0x488ae1['id'];}else{var _0x2edb49=_[_0xde49('0x68')](_[_0xde49('0x21')](_0x56ae21,_0xde49('0x69')),function(_0xb7d482){return _[_0xde49('0x6a')](_0x8af480,_0xb7d482);});if(_0x2edb49){return _0x488ae1['id'];}}}));}}return BPromise[_0xde49('0x6b')](_0x49d4f2)[_0xde49('0x17')](function(_0x7c7c0d){_0x1314b5=_(_0x1314b5)['union'](_0x7c7c0d)[_0xde49('0x6c')]()[_0xde49('0x6d')]();return db['ChatQueue']['find']({'where':{'id':_0x92c259[_0xde49('0x2b')]['id']}})[_0xde49('0x17')](function(_0x320255){return db[_0xde49('0x54')][_0xde49('0x55')](function(_0x1b2418){return _0x320255[_0xde49('0x5c')](_0x92c259['query'][_0xde49('0x4e')],{'transaction':_0x1b2418})[_0xde49('0x17')](function(){if(!_[_0xde49('0x6e')](_0x1314b5)){return _0x320255[_0xde49('0x6f')](_0x1314b5,{'transaction':_0x1b2418});}})[_0xde49('0x17')](function(){_0x1314b5[_0xde49('0x59')](function(_0x1c3b45){socket[_0xde49('0x5a')]('userChatQueue:remove',{'UserId':_0x1c3b45,'ChatQueueId':_0x320255['id']});});});});});});})[_0xde49('0x17')](respondWithStatusCode(_0x4ee992,null))[_0xde49('0x34')](handleError(_0x4ee992,null));};exports[_0xde49('0x70')]=function(_0xdc582d,_0x1058a7){return db[_0xde49('0x22')][_0xde49('0x33')]({'where':{'id':_0xdc582d[_0xde49('0x2b')]['id']}})[_0xde49('0x17')](handleEntityNotFound(_0x1058a7,null))[_0xde49('0x17')](function(_0x22e078){if(_0x22e078){return _0x22e078[_0xde49('0x70')](_0xdc582d[_0xde49('0x36')][_0xde49('0x4e')],_['omit'](_0xdc582d[_0xde49('0x36')],[_0xde49('0x4e'),'id'])||{})['spread'](function(_0x4d73f4){for(var _0x8b06b5=0x0;_0x8b06b5<_0xdc582d[_0xde49('0x36')][_0xde49('0x4e')][_0xde49('0x3e')];_0x8b06b5+=0x1){socket[_0xde49('0x5a')](_0xde49('0x5b'),{'UserId':Number(_0xdc582d[_0xde49('0x36')][_0xde49('0x4e')][_0x8b06b5]),'ChatQueueId':Number(_0xdc582d['params']['id'])});}return _0x4d73f4;});}})[_0xde49('0x17')](respondWithResult(_0x1058a7,null))['catch'](handleError(_0x1058a7,null));};exports['removeAgents']=function(_0x186805,_0x55e91a){return db[_0xde49('0x22')][_0xde49('0x33')]({'where':{'id':_0x186805[_0xde49('0x2b')]['id']}})[_0xde49('0x17')](handleEntityNotFound(_0x55e91a,null))[_0xde49('0x17')](function(_0x584ed7){if(_0x584ed7){return _0x584ed7[_0xde49('0x6f')](_0x186805['query'][_0xde49('0x4e')])[_0xde49('0x17')](function(){if(_[_0xde49('0x71')](_0x186805[_0xde49('0x28')][_0xde49('0x4e')])){for(var _0x3c3a36=0x0;_0x3c3a36<_0x186805[_0xde49('0x28')][_0xde49('0x4e')][_0xde49('0x3e')];_0x3c3a36+=0x1){socket[_0xde49('0x5a')](_0xde49('0x72'),{'UserId':Number(_0x186805['query'][_0xde49('0x4e')][_0x3c3a36]),'ChatQueueId':Number(_0x186805[_0xde49('0x2b')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x186805['query'][_0xde49('0x4e')]),'ChatQueueId':Number(_0x186805['params']['id'])});}});}})[_0xde49('0x17')](respondWithStatusCode(_0x55e91a,null))[_0xde49('0x34')](handleError(_0x55e91a,null));};exports['getAgents']=function(_0x2d66e4,_0x351ed8){var _0x395c67={};var _0x505a93={};var _0x38d1a4;var _0x198ec8;return db[_0xde49('0x22')]['findOne']({'where':{'id':_0x2d66e4[_0xde49('0x2b')]['id']}})[_0xde49('0x17')](handleEntityNotFound(_0x351ed8,null))[_0xde49('0x17')](function(_0x4eedbc){if(_0x4eedbc){_0x38d1a4=_0x4eedbc;_0x505a93[_0xde49('0x2c')]=_['keys'](db[_0xde49('0x5d')][_0xde49('0x23')]);_0x505a93['query']=_[_0xde49('0x2d')](_0x2d66e4['query']);_0x505a93[_0xde49('0x2e')]=_[_0xde49('0x30')](_0x505a93['model'],_0x505a93[_0xde49('0x28')]);_0x395c67[_0xde49('0x2f')]=_[_0xde49('0x30')](_0x505a93[_0xde49('0x2c')],qs[_0xde49('0x31')](_0x2d66e4[_0xde49('0x28')][_0xde49('0x31')]));_0x395c67[_0xde49('0x2f')]=_0x395c67[_0xde49('0x2f')][_0xde49('0x3e')]?_0x395c67['attributes']:_0x505a93['model'];_0x395c67['order']=qs[_0xde49('0x41')](_0x2d66e4[_0xde49('0x28')][_0xde49('0x41')]);_0x395c67[_0xde49('0x26')]=qs[_0xde49('0x2e')](_[_0xde49('0x42')](_0x2d66e4['query'],_0x505a93[_0xde49('0x2e')]));if(_0x2d66e4['query']['filter']){_0x395c67[_0xde49('0x26')]=_[_0xde49('0x45')](_0x395c67['where'],{'$or':_[_0xde49('0x21')](_0x395c67[_0xde49('0x2f')],function(_0x30b1c7){var _0x1a1964={};_0x1a1964[_0x30b1c7]={'$like':'%'+_0x2d66e4['query'][_0xde49('0x44')]+'%'};return _0x1a1964;})});}_0x395c67=_[_0xde49('0x45')]({},_0x395c67,_0x2d66e4['options']);return _0x38d1a4[_0xde49('0x73')](_0x395c67);}})[_0xde49('0x17')](function(_0x30fc76){if(_0x30fc76){_0x198ec8=_0x30fc76[_0xde49('0x3e')];if(!_0x2d66e4[_0xde49('0x28')][_0xde49('0x3f')]('nolimit')){_0x395c67[_0xde49('0x13')]=qs[_0xde49('0x13')](_0x2d66e4['query'][_0xde49('0x13')]);_0x395c67[_0xde49('0x11')]=qs['offset'](_0x2d66e4[_0xde49('0x28')][_0xde49('0x11')]);}return _0x38d1a4['getAgents'](_0x395c67);}})[_0xde49('0x17')](function(_0x255f2c){if(_0x255f2c){return _0x255f2c?{'count':_0x198ec8,'rows':_0x255f2c}:null;}})[_0xde49('0x17')](respondWithResult(_0x351ed8,null))[_0xde49('0x34')](handleError(_0x351ed8,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index acf059c..eb229d4 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 _0x279d=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','remove'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0x279d,0x1d8));var _0xd279=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x279d[_0x369151];return _0x4292d5;};'use strict';var EventEmitter=require(_0xd279('0x0'));var ChatQueue=require(_0xd279('0x1'))['db'][_0xd279('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd279('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd279('0x4')};function emitEvent(_0x44441d){return function(_0x47cfee,_0x15d034,_0x2a9e8c){ChatQueueEvents[_0xd279('0x5')](_0x44441d+':'+_0x47cfee['id'],_0x47cfee);ChatQueueEvents[_0xd279('0x5')](_0x44441d,_0x47cfee);_0x2a9e8c(null);};}for(var e in events){if(events[_0xd279('0x6')](e)){var event=events[e];ChatQueue[_0xd279('0x7')](e,emitEvent(event));}}module[_0xd279('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x3f5c=['events','ChatQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x159924,_0x39a170){var _0x7aa9b0=function(_0x4cd6ae){while(--_0x4cd6ae){_0x159924['push'](_0x159924['shift']());}};_0x7aa9b0(++_0x39a170);}(_0x3f5c,0x129));var _0xc3f5=function(_0x3a88c4,_0x11773b){_0x3a88c4=_0x3a88c4-0x0;var _0x411580=_0x3f5c[_0x3a88c4];return _0x411580;};'use strict';var EventEmitter=require(_0xc3f5('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xc3f5('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xc3f5('0x2')](0x0);var events={'afterCreate':_0xc3f5('0x3'),'afterUpdate':'update','afterDestroy':_0xc3f5('0x4')};function emitEvent(_0x49be7c){return function(_0x5ccfe2,_0x238645,_0x57a172){ChatQueueEvents[_0xc3f5('0x5')](_0x49be7c+':'+_0x5ccfe2['id'],_0x5ccfe2);ChatQueueEvents[_0xc3f5('0x5')](_0x49be7c,_0x5ccfe2);_0x57a172(null);};}for(var e in events){if(events[_0xc3f5('0x6')](e)){var event=events[e];ChatQueue[_0xc3f5('0x7')](e,emitEvent(event));}}module[_0xc3f5('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 47951f4..aa7983a 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 _0xa787=['./chatQueue.attributes','exports','define','ChatQueue','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x167dc,_0x2e5bf3){var _0x30bbbb=function(_0x3384a5){while(--_0x3384a5){_0x167dc['push'](_0x167dc['shift']());}};_0x30bbbb(++_0x2e5bf3);}(_0xa787,0x19b));var _0x7a78=function(_0x3326f3,_0x27919d){_0x3326f3=_0x3326f3-0x0;var _0x3fc066=_0xa787[_0x3326f3];return _0x3fc066;};'use strict';var _=require('lodash');var util=require(_0x7a78('0x0'));var logger=require(_0x7a78('0x1'))('api');var moment=require(_0x7a78('0x2'));var BPromise=require(_0x7a78('0x3'));var rp=require(_0x7a78('0x4'));var fs=require('fs');var path=require(_0x7a78('0x5'));var rimraf=require(_0x7a78('0x6'));var config=require('../../config/environment');var attributes=require(_0x7a78('0x7'));module[_0x7a78('0x8')]=function(_0x3ac7c5,_0x10d563){return _0x3ac7c5[_0x7a78('0x9')](_0x7a78('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x50e5=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash'];(function(_0x5267cd,_0x30cf7b){var _0x3419ce=function(_0x3a1dfb){while(--_0x3a1dfb){_0x5267cd['push'](_0x5267cd['shift']());}};_0x3419ce(++_0x30cf7b);}(_0x50e5,0xef));var _0x550e=function(_0x1cc666,_0x272d12){_0x1cc666=_0x1cc666-0x0;var _0x3c3764=_0x50e5[_0x1cc666];return _0x3c3764;};'use strict';var _=require(_0x550e('0x0'));var util=require('util');var logger=require(_0x550e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x550e('0x2'));var rp=require(_0x550e('0x3'));var fs=require('fs');var path=require(_0x550e('0x4'));var rimraf=require(_0x550e('0x5'));var config=require(_0x550e('0x6'));var attributes=require(_0x550e('0x7'));module[_0x550e('0x8')]=function(_0x202fca,_0x1303d5){return _0x202fca[_0x550e('0x9')](_0x550e('0xa'),attributes,{'tableName':_0x550e('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 7da80fa..882a507 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 _0x0d74=['jayson/promise','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetChatQueue','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','ChatQueue','find','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x57f8af,_0x3a881a){var _0x1ef58a=function(_0x14c7b4){while(--_0x14c7b4){_0x57f8af['push'](_0x57f8af['shift']());}};_0x1ef58a(++_0x3a881a);}(_0x0d74,0x146));var _0x40d7=function(_0x119709,_0x43cc9d){_0x119709=_0x119709-0x0;var _0x24ef6a=_0x0d74[_0x119709];return _0x24ef6a;};'use strict';var _=require(_0x40d7('0x0'));var util=require(_0x40d7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x40d7('0x2'));var fs=require('fs');var Redis=require(_0x40d7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x40d7('0x4'))(_0x40d7('0x5'));var config=require(_0x40d7('0x6'));var jayson=require(_0x40d7('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x40d7('0x8')](config['redis'],{'host':_0x40d7('0x9'),'port':0x18eb});var socket=require(_0x40d7('0xa'))(new Redis(config['redis']));require(_0x40d7('0xb'))[_0x40d7('0xc')](socket);function respondWithRpcPromise(_0x354f80,_0x2bae78,_0xcb37e3){return new BPromise(function(_0x517d88,_0x5208be){return client[_0x40d7('0xd')](_0x354f80,_0xcb37e3)[_0x40d7('0xe')](function(_0x229937){logger[_0x40d7('0xf')](_0x40d7('0x10'),_0x2bae78,'request\x20sent');logger[_0x40d7('0x11')](_0x40d7('0x12'),_0x2bae78,_0x40d7('0x13'),JSON[_0x40d7('0x14')](_0x229937));if(_0x229937['error']){if(_0x229937[_0x40d7('0x15')][_0x40d7('0x16')]===0x1f4){logger[_0x40d7('0x15')](_0x40d7('0x10'),_0x2bae78,_0x229937[_0x40d7('0x15')][_0x40d7('0x17')]);return _0x5208be(_0x229937[_0x40d7('0x15')][_0x40d7('0x17')]);}logger[_0x40d7('0x15')]('ChatQueue,\x20%s,\x20%s',_0x2bae78,_0x229937['error']['message']);return _0x517d88(_0x229937[_0x40d7('0x15')][_0x40d7('0x17')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2bae78,_0x40d7('0x13'));_0x517d88(_0x229937['result']['message']);}})[_0x40d7('0x18')](function(_0x22de5a){logger[_0x40d7('0x15')](_0x40d7('0x10'),_0x2bae78,_0x22de5a);_0x5208be(_0x22de5a);});});}exports[_0x40d7('0x19')]=function(_0x28bbc0){var _0x3d2afa=this;return new Promise(function(_0x3ec437,_0x5eb3c1){return db['ChatQueue']['findAll']({'raw':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0['options'][_0x40d7('0x1b')]===undefined?!![]:![]:!![],'where':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1c')]||null:null,'attributes':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1d')]||null:null,'limit':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1e')]||null:null,'include':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0['options'][_0x40d7('0x1f')]?_[_0x40d7('0x20')](_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1f')],function(_0x528ab5){return{'model':db[_0x528ab5['model']],'as':_0x528ab5['as'],'attributes':_0x528ab5[_0x40d7('0x1d')],'include':_0x528ab5['include']?_['map'](_0x528ab5[_0x40d7('0x1f')],function(_0x1ef074){return{'model':db[_0x1ef074[_0x40d7('0x21')]],'as':_0x1ef074['as'],'attributes':_0x1ef074[_0x40d7('0x1d')],'include':_0x1ef074['include']?_['map'](_0x1ef074[_0x40d7('0x1f')],function(_0x2b5f11){return{'model':db[_0x2b5f11[_0x40d7('0x21')]],'as':_0x2b5f11['as'],'attributes':_0x2b5f11['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1102d3){logger[_0x40d7('0xf')]('GetChatQueue',_0x28bbc0);logger[_0x40d7('0x11')](_0x40d7('0x19'),_0x28bbc0,JSON[_0x40d7('0x14')](_0x1102d3));_0x3ec437(_0x1102d3);})[_0x40d7('0x18')](function(_0x555a3b){logger['error'](_0x40d7('0x19'),_0x555a3b[_0x40d7('0x17')],_0x28bbc0);_0x5eb3c1(_0x3d2afa[_0x40d7('0x15')](0x1f4,_0x555a3b[_0x40d7('0x17')]));});});};exports[_0x40d7('0x22')]=function(_0x4a2bc2){var _0x23e560=this;return new Promise(function(_0x5af456,_0x22edd1){return db[_0x40d7('0x23')][_0x40d7('0x24')]({'raw':_0x4a2bc2['options']?_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1b')]===undefined?!![]:![]:!![],'where':_0x4a2bc2[_0x40d7('0x1a')]?_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1c')]||null:null,'attributes':_0x4a2bc2[_0x40d7('0x1a')]?_0x4a2bc2[_0x40d7('0x1a')]['attributes']||null:null,'include':_0x4a2bc2[_0x40d7('0x1a')]?_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1f')]?_[_0x40d7('0x20')](_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1f')],function(_0x1e6f08){return{'model':db[_0x1e6f08[_0x40d7('0x21')]],'as':_0x1e6f08['as'],'attributes':_0x1e6f08['attributes'],'include':_0x1e6f08['include']?_[_0x40d7('0x20')](_0x1e6f08[_0x40d7('0x1f')],function(_0x4902a1){return{'model':db[_0x4902a1['model']],'as':_0x4902a1['as'],'attributes':_0x4902a1['attributes'],'include':_0x4902a1[_0x40d7('0x1f')]?_['map'](_0x4902a1[_0x40d7('0x1f')],function(_0x56b17c){return{'model':db[_0x56b17c[_0x40d7('0x21')]],'as':_0x56b17c['as'],'attributes':_0x56b17c[_0x40d7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x40d7('0xe')](function(_0x2e4ccb){logger[_0x40d7('0xf')]('ShowChatQueue',_0x4a2bc2);logger[_0x40d7('0x11')](_0x40d7('0x22'),_0x4a2bc2,JSON[_0x40d7('0x14')](_0x2e4ccb));_0x5af456(_0x2e4ccb);})[_0x40d7('0x18')](function(_0x21a675){logger['error']('ShowChatQueue',_0x21a675['message'],_0x4a2bc2);_0x22edd1(_0x23e560[_0x40d7('0x15')](0x1f4,_0x21a675['message']));});});};
\ No newline at end of file
+var _0x2cf5=['model','stringify','catch','find','ShowChatQueue','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','limit','include','map'];(function(_0x7ec7b4,_0x1c8b0e){var _0x307680=function(_0x100a2c){while(--_0x100a2c){_0x7ec7b4['push'](_0x7ec7b4['shift']());}};_0x307680(++_0x1c8b0e);}(_0x2cf5,0x19f));var _0x52cf=function(_0x170b9c,_0x532a97){_0x170b9c=_0x170b9c-0x0;var _0x4d111d=_0x2cf5[_0x170b9c];return _0x4d111d;};'use strict';var _=require(_0x52cf('0x0'));var util=require(_0x52cf('0x1'));var moment=require('moment');var BPromise=require(_0x52cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52cf('0x3'));var db=require(_0x52cf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x52cf('0x5'));var config=require(_0x52cf('0x6'));var jayson=require(_0x52cf('0x7'));var client=jayson[_0x52cf('0x8')][_0x52cf('0x9')]({'port':0x232a});config[_0x52cf('0xa')]=_[_0x52cf('0xb')](config[_0x52cf('0xa')],{'host':_0x52cf('0xc'),'port':0x18eb});var socket=require(_0x52cf('0xd'))(new Redis(config[_0x52cf('0xa')]));require('./chatQueue.socket')[_0x52cf('0xe')](socket);function respondWithRpcPromise(_0x201710,_0x2b9974,_0x120dab){return new BPromise(function(_0x4e5b19,_0xadb2a6){return client[_0x52cf('0xf')](_0x201710,_0x120dab)[_0x52cf('0x10')](function(_0x54806d){logger[_0x52cf('0x11')](_0x52cf('0x12'),_0x2b9974,_0x52cf('0x13'));logger[_0x52cf('0x14')](_0x52cf('0x15'),_0x2b9974,_0x52cf('0x13'),JSON['stringify'](_0x54806d));if(_0x54806d['error']){if(_0x54806d[_0x52cf('0x16')][_0x52cf('0x17')]===0x1f4){logger[_0x52cf('0x16')](_0x52cf('0x12'),_0x2b9974,_0x54806d[_0x52cf('0x16')][_0x52cf('0x18')]);return _0xadb2a6(_0x54806d[_0x52cf('0x16')][_0x52cf('0x18')]);}logger['error'](_0x52cf('0x12'),_0x2b9974,_0x54806d[_0x52cf('0x16')][_0x52cf('0x18')]);return _0x4e5b19(_0x54806d['error'][_0x52cf('0x18')]);}else{logger['info'](_0x52cf('0x12'),_0x2b9974,_0x52cf('0x13'));_0x4e5b19(_0x54806d[_0x52cf('0x19')][_0x52cf('0x18')]);}})['catch'](function(_0x229595){logger[_0x52cf('0x16')](_0x52cf('0x12'),_0x2b9974,_0x229595);_0xadb2a6(_0x229595);});});}exports[_0x52cf('0x1a')]=function(_0x4ab08f){var _0x326311=this;return new Promise(function(_0x5f5200,_0x1d9fdd){return db[_0x52cf('0x1b')][_0x52cf('0x1c')]({'raw':_0x4ab08f['options']?_0x4ab08f['options'][_0x52cf('0x1d')]===undefined?!![]:![]:!![],'where':_0x4ab08f[_0x52cf('0x1e')]?_0x4ab08f[_0x52cf('0x1e')][_0x52cf('0x1f')]||null:null,'attributes':_0x4ab08f[_0x52cf('0x1e')]?_0x4ab08f[_0x52cf('0x1e')][_0x52cf('0x20')]||null:null,'limit':_0x4ab08f[_0x52cf('0x1e')]?_0x4ab08f[_0x52cf('0x1e')][_0x52cf('0x21')]||null:null,'include':_0x4ab08f['options']?_0x4ab08f['options'][_0x52cf('0x22')]?_[_0x52cf('0x23')](_0x4ab08f[_0x52cf('0x1e')][_0x52cf('0x22')],function(_0x499ac7){return{'model':db[_0x499ac7['model']],'as':_0x499ac7['as'],'attributes':_0x499ac7[_0x52cf('0x20')],'include':_0x499ac7[_0x52cf('0x22')]?_[_0x52cf('0x23')](_0x499ac7[_0x52cf('0x22')],function(_0x42132c){return{'model':db[_0x42132c[_0x52cf('0x24')]],'as':_0x42132c['as'],'attributes':_0x42132c[_0x52cf('0x20')],'include':_0x42132c[_0x52cf('0x22')]?_[_0x52cf('0x23')](_0x42132c['include'],function(_0x4796b5){return{'model':db[_0x4796b5[_0x52cf('0x24')]],'as':_0x4796b5['as'],'attributes':_0x4796b5[_0x52cf('0x20')]};}):[]};}):[]};}):[]:[]})[_0x52cf('0x10')](function(_0x1e1318){logger['info'](_0x52cf('0x1a'),_0x4ab08f);logger[_0x52cf('0x14')](_0x52cf('0x1a'),_0x4ab08f,JSON[_0x52cf('0x25')](_0x1e1318));_0x5f5200(_0x1e1318);})[_0x52cf('0x26')](function(_0x1ed92a){logger['error'](_0x52cf('0x1a'),_0x1ed92a[_0x52cf('0x18')],_0x4ab08f);_0x1d9fdd(_0x326311[_0x52cf('0x16')](0x1f4,_0x1ed92a[_0x52cf('0x18')]));});});};exports['ShowChatQueue']=function(_0x1c6bc2){var _0xcffed3=this;return new Promise(function(_0x46eca4,_0x141871){return db[_0x52cf('0x1b')][_0x52cf('0x27')]({'raw':_0x1c6bc2[_0x52cf('0x1e')]?_0x1c6bc2[_0x52cf('0x1e')][_0x52cf('0x1d')]===undefined?!![]:![]:!![],'where':_0x1c6bc2[_0x52cf('0x1e')]?_0x1c6bc2['options']['where']||null:null,'attributes':_0x1c6bc2[_0x52cf('0x1e')]?_0x1c6bc2[_0x52cf('0x1e')][_0x52cf('0x20')]||null:null,'include':_0x1c6bc2[_0x52cf('0x1e')]?_0x1c6bc2['options']['include']?_[_0x52cf('0x23')](_0x1c6bc2[_0x52cf('0x1e')][_0x52cf('0x22')],function(_0xafd307){return{'model':db[_0xafd307[_0x52cf('0x24')]],'as':_0xafd307['as'],'attributes':_0xafd307[_0x52cf('0x20')],'include':_0xafd307[_0x52cf('0x22')]?_[_0x52cf('0x23')](_0xafd307[_0x52cf('0x22')],function(_0x163181){return{'model':db[_0x163181[_0x52cf('0x24')]],'as':_0x163181['as'],'attributes':_0x163181[_0x52cf('0x20')],'include':_0x163181[_0x52cf('0x22')]?_[_0x52cf('0x23')](_0x163181[_0x52cf('0x22')],function(_0x50d881){return{'model':db[_0x50d881[_0x52cf('0x24')]],'as':_0x50d881['as'],'attributes':_0x50d881[_0x52cf('0x20')]};}):[]};}):[]};}):[]:[]})[_0x52cf('0x10')](function(_0x2f9a0a){logger[_0x52cf('0x11')](_0x52cf('0x28'),_0x1c6bc2);logger[_0x52cf('0x14')]('ShowChatQueue',_0x1c6bc2,JSON[_0x52cf('0x25')](_0x2f9a0a));_0x46eca4(_0x2f9a0a);})[_0x52cf('0x26')](function(_0x5e56cc){logger['error'](_0x52cf('0x28'),_0x5e56cc['message'],_0x1c6bc2);_0x141871(_0xcffed3['error'](0x1f4,_0x5e56cc[_0x52cf('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 122f429..f89fc33 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 _0xcb99=['chatQueue:','./chatQueue.events','remove','emit','removeListener','length'];(function(_0x747115,_0x570320){var _0x1d8acf=function(_0x5f3087){while(--_0x5f3087){_0x747115['push'](_0x747115['shift']());}};_0x1d8acf(++_0x570320);}(_0xcb99,0x8b));var _0x9cb9=function(_0x1440d9,_0x4a2c7e){_0x1440d9=_0x1440d9-0x0;var _0x4a0cfb=_0xcb99[_0x1440d9];return _0x4a0cfb;};'use strict';var ChatQueueEvents=require(_0x9cb9('0x0'));var events=['save',_0x9cb9('0x1'),'update'];function createListener(_0x480364,_0x3a2f21){return function(_0x1308a8){_0x3a2f21[_0x9cb9('0x2')](_0x480364,_0x1308a8);};}function removeListener(_0x51f2ee,_0x167735){return function(){ChatQueueEvents[_0x9cb9('0x3')](_0x51f2ee,_0x167735);};}exports['register']=function(_0x214b72){for(var _0x509cfc=0x0,_0x2ed26a=events[_0x9cb9('0x4')];_0x509cfc<_0x2ed26a;_0x509cfc++){var _0x1bf9b7=events[_0x509cfc];var _0x1dd62f=createListener(_0x9cb9('0x5')+_0x1bf9b7,_0x214b72);ChatQueueEvents['on'](_0x1bf9b7,_0x1dd62f);}};
\ No newline at end of file
+var _0xfd28=['emit','removeListener','register','chatQueue:','save','remove'];(function(_0x7f3a0f,_0x163bbf){var _0x4ff4e9=function(_0x27c49f){while(--_0x27c49f){_0x7f3a0f['push'](_0x7f3a0f['shift']());}};_0x4ff4e9(++_0x163bbf);}(_0xfd28,0x148));var _0x8fd2=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xfd28[_0x9c2427];return _0x51984f;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8fd2('0x0'),_0x8fd2('0x1'),'update'];function createListener(_0x56f4d0,_0x4e5c5e){return function(_0x37baf5){_0x4e5c5e[_0x8fd2('0x2')](_0x56f4d0,_0x37baf5);};}function removeListener(_0x4e2108,_0x4b22ae){return function(){ChatQueueEvents[_0x8fd2('0x3')](_0x4e2108,_0x4b22ae);};}exports[_0x8fd2('0x4')]=function(_0x2ee87e){for(var _0x36178a=0x0,_0x2f0afc=events['length'];_0x36178a<_0x2f0afc;_0x36178a++){var _0x53d938=events[_0x36178a];var _0x10fccf=createListener(_0x8fd2('0x5')+_0x53d938,_0x2ee87e);ChatQueueEvents['on'](_0x53d938,_0x10fccf);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index f86c2ce..c2f9c2d 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x4af72f,_0xd67b2e){var _0x5a25e4=function(_0x3f7724){while(--_0x3f7724){_0x4af72f['push'](_0x4af72f['shift']());}};_0x5a25e4(++_0xd67b2e);}(_0x55ca,0x126));var _0xa55c=function(_0x57a9e5,_0x5009df){_0x57a9e5=_0x57a9e5-0x0;var _0x36d39e=_0x55ca[_0x57a9e5];return _0x36d39e;};'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')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
+var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x5c3505,_0x3770ce){var _0x5eec90=function(_0x34157c){while(--_0x34157c){_0x5c3505['push'](_0x5c3505['shift']());}};_0x5eec90(++_0x3770ce);}(_0xe14b,0x93));var _0xbe14=function(_0x2c588c,_0x1f0d55){_0x2c588c=_0x2c588c-0x0;var _0x25f6a6=_0xe14b[_0x2c588c];return _0x25f6a6;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 2971427..549b180 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 _0x5a47=['moment','exports','STRING','DATE'];(function(_0x15961d,_0x13827d){var _0x2519ab=function(_0x24dd53){while(--_0x24dd53){_0x15961d['push'](_0x15961d['shift']());}};_0x2519ab(++_0x13827d);}(_0x5a47,0x12c));var _0x75a4=function(_0x12de66,_0x357deb){_0x12de66=_0x12de66-0x0;var _0x2465d7=_0x5a47[_0x12de66];return _0x2465d7;};'use strict';var moment=require(_0x75a4('0x0'));var Sequelize=require('sequelize');module[_0x75a4('0x1')]={'uniqueid':{'type':Sequelize[_0x75a4('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x75a4('0x3')]},'leaveAt':{'type':Sequelize[_0x75a4('0x3')]},'acceptAt':{'type':Sequelize[_0x75a4('0x3')]},'exitAt':{'type':Sequelize[_0x75a4('0x3')]},'reason':{'type':Sequelize[_0x75a4('0x2')]}};
\ No newline at end of file
+var _0xf2f5=['DATE','sequelize','STRING'];(function(_0x146b09,_0x345cd3){var _0x4e9e36=function(_0x1d9749){while(--_0x1d9749){_0x146b09['push'](_0x146b09['shift']());}};_0x4e9e36(++_0x345cd3);}(_0xf2f5,0x8e));var _0x5f2f=function(_0x3112ac,_0x4d5efd){_0x3112ac=_0x3112ac-0x0;var _0x343812=_0xf2f5[_0x3112ac];return _0x343812;};'use strict';var moment=require('moment');var Sequelize=require(_0x5f2f('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5f2f('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5f2f('0x1')]},'joinAt':{'type':Sequelize[_0x5f2f('0x2')]},'leaveAt':{'type':Sequelize[_0x5f2f('0x2')]},'acceptAt':{'type':Sequelize[_0x5f2f('0x2')]},'exitAt':{'type':Sequelize[_0x5f2f('0x2')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index e16bb3c..a30ef59 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 _0xcd0e=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','destroy','end','error','stack','name','index','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','then','includeAll','include','findAll','rows','params','length','options','catch','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3ef5e5,_0x5bbc62){var _0x212d0a=function(_0x18d566){while(--_0x18d566){_0x3ef5e5['push'](_0x3ef5e5['shift']());}};_0x212d0a(++_0x5bbc62);}(_0xcd0e,0xe9));var _0xecd0=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xcd0e[_0x24259d];return _0x5a701;};'use strict';var emlformat=require(_0xecd0('0x0'));var rimraf=require(_0xecd0('0x1'));var zipdir=require(_0xecd0('0x2'));var jsonpatch=require(_0xecd0('0x3'));var rp=require(_0xecd0('0x4'));var moment=require(_0xecd0('0x5'));var BPromise=require(_0xecd0('0x6'));var Mustache=require(_0xecd0('0x7'));var util=require(_0xecd0('0x8'));var path=require(_0xecd0('0x9'));var sox=require(_0xecd0('0xa'));var csv=require(_0xecd0('0xb'));var ejs=require(_0xecd0('0xc'));var fs=require('fs');var fs_extra=require(_0xecd0('0xd'));var _=require(_0xecd0('0xe'));var squel=require(_0xecd0('0xf'));var crypto=require(_0xecd0('0x10'));var jsforce=require(_0xecd0('0x11'));var deskjs=require(_0xecd0('0x12'));var toCsv=require('to-csv');var querystring=require(_0xecd0('0x13'));var Papa=require(_0xecd0('0x14'));var Redis=require(_0xecd0('0x15'));var authService=require(_0xecd0('0x16'));var qs=require(_0xecd0('0x17'));var as=require(_0xecd0('0x18'));var hardwareService=require(_0xecd0('0x19'));var logger=require(_0xecd0('0x1a'))(_0xecd0('0x1b'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xecd0('0x1c'))['db'];function respondWithStatusCode(_0x33af86,_0x241974){_0x241974=_0x241974||0xcc;return function(_0x3bccd2){if(_0x3bccd2){return _0x33af86[_0xecd0('0x1d')](_0x241974);}return _0x33af86[_0xecd0('0x1e')](_0x241974)['end']();};}function respondWithResult(_0x595dd8,_0x35b69b){_0x35b69b=_0x35b69b||0xc8;return function(_0xe13b00){if(_0xe13b00){return _0x595dd8['status'](_0x35b69b)[_0xecd0('0x1f')](_0xe13b00);}};}function respondWithFilteredResult(_0x45184c,_0x4b96d8){return function(_0x51d3bd){if(_0x51d3bd){var _0x118746=typeof _0x4b96d8['offset']===_0xecd0('0x20')&&typeof _0x4b96d8[_0xecd0('0x21')]==='undefined';var _0x367c38=_0x51d3bd[_0xecd0('0x22')];var _0x291300=_0x118746?0x0:_0x4b96d8['offset'];var _0x1b0054=_0x118746?_0x51d3bd[_0xecd0('0x22')]:_0x4b96d8[_0xecd0('0x23')]+_0x4b96d8['limit'];var _0x22a703;if(_0x1b0054>=_0x367c38){_0x1b0054=_0x367c38;_0x22a703=0xc8;}else{_0x22a703=0xce;}_0x45184c[_0xecd0('0x1e')](_0x22a703);return _0x45184c['set'](_0xecd0('0x24'),_0x291300+'-'+_0x1b0054+'/'+_0x367c38)[_0xecd0('0x1f')](_0x51d3bd);}return null;};}function patchUpdates(_0x51ec16){return function(_0x409e0b){try{jsonpatch[_0xecd0('0x25')](_0x409e0b,_0x51ec16,!![]);}catch(_0x4a488c){return BPromise['reject'](_0x4a488c);}return _0x409e0b[_0xecd0('0x26')]();};}function saveUpdates(_0x48fb4c,_0x26ea52){return function(_0x5c0153){if(_0x5c0153){return _0x5c0153['update'](_0x48fb4c)['then'](function(_0x355846){return _0x355846;});}return null;};}function removeEntity(_0x5b0183,_0x25d9e9){return function(_0x4ce453){if(_0x4ce453){return _0x4ce453[_0xecd0('0x27')]()['then'](function(){_0x5b0183['status'](0xcc)[_0xecd0('0x28')]();});}};}function handleEntityNotFound(_0x4f00c9,_0x3625a4){return function(_0x918e){if(!_0x918e){_0x4f00c9[_0xecd0('0x1d')](0x194);}return _0x918e;};}function handleError(_0x133ecd,_0x3b2f14){_0x3b2f14=_0x3b2f14||0x1f4;return function(_0x482321){logger[_0xecd0('0x29')](_0x482321[_0xecd0('0x2a')]);if(_0x482321[_0xecd0('0x2b')]){delete _0x482321[_0xecd0('0x2b')];}_0x133ecd[_0xecd0('0x1e')](_0x3b2f14)['send'](_0x482321);};}exports[_0xecd0('0x2c')]=function(_0x4c0dcb,_0x4374a5){var _0x45fc62={},_0x2a99a2={},_0x22efb3={'count':0x0,'rows':[]};var _0x511ef2=_['map'](db[_0xecd0('0x2d')][_0xecd0('0x2e')],function(_0x1dbfdf){return{'name':_0x1dbfdf[_0xecd0('0x2f')],'type':_0x1dbfdf[_0xecd0('0x30')]['key']};});_0x2a99a2[_0xecd0('0x31')]=_['map'](_0x511ef2,_0xecd0('0x2b'));_0x2a99a2[_0xecd0('0x32')]=_[_0xecd0('0x33')](_0x4c0dcb[_0xecd0('0x32')]);_0x2a99a2['filters']=_[_0xecd0('0x34')](_0x2a99a2[_0xecd0('0x31')],_0x2a99a2[_0xecd0('0x32')]);_0x45fc62[_0xecd0('0x35')]=_[_0xecd0('0x34')](_0x2a99a2[_0xecd0('0x31')],qs[_0xecd0('0x36')](_0x4c0dcb['query'][_0xecd0('0x36')]));_0x45fc62[_0xecd0('0x35')]=_0x45fc62[_0xecd0('0x35')]['length']?_0x45fc62['attributes']:_0x2a99a2[_0xecd0('0x31')];if(!_0x4c0dcb[_0xecd0('0x32')][_0xecd0('0x37')](_0xecd0('0x38'))){_0x45fc62[_0xecd0('0x21')]=qs[_0xecd0('0x21')](_0x4c0dcb[_0xecd0('0x32')][_0xecd0('0x21')]);_0x45fc62[_0xecd0('0x23')]=qs['offset'](_0x4c0dcb['query'][_0xecd0('0x23')]);}_0x45fc62[_0xecd0('0x39')]=qs[_0xecd0('0x3a')](_0x4c0dcb['query'][_0xecd0('0x3a')]);_0x45fc62[_0xecd0('0x3b')]=qs[_0xecd0('0x3c')](_[_0xecd0('0x3d')](_0x4c0dcb[_0xecd0('0x32')],_0x2a99a2[_0xecd0('0x3c')]),_0x511ef2);if(_0x4c0dcb['query']['filter']){_0x45fc62[_0xecd0('0x3b')]=_[_0xecd0('0x3e')](_0x45fc62[_0xecd0('0x3b')],{'$or':_['map'](_0x511ef2,function(_0x58b2a0){if(_0x58b2a0[_0xecd0('0x30')]!==_0xecd0('0x3f')){var _0x30728d={};_0x30728d[_0x58b2a0[_0xecd0('0x2b')]]={'$like':'%'+_0x4c0dcb[_0xecd0('0x32')][_0xecd0('0x40')]+'%'};return _0x30728d;}})});}_0x45fc62=_['merge']({},_0x45fc62,_0x4c0dcb['options']);var _0xed68aa={'where':_0x45fc62[_0xecd0('0x3b')]};return db['ChatQueueReport'][_0xecd0('0x22')](_0xed68aa)[_0xecd0('0x41')](function(_0x3a4fb5){_0x22efb3['count']=_0x3a4fb5;if(_0x4c0dcb[_0xecd0('0x32')][_0xecd0('0x42')]){_0x45fc62[_0xecd0('0x43')]=[{'all':!![]}];}return db[_0xecd0('0x2d')][_0xecd0('0x44')](_0x45fc62);})[_0xecd0('0x41')](function(_0xfc1eee){_0x22efb3[_0xecd0('0x45')]=_0xfc1eee;return _0x22efb3;})[_0xecd0('0x41')](respondWithFilteredResult(_0x4374a5,_0x45fc62))['catch'](handleError(_0x4374a5,null));};exports['show']=function(_0x5cab5e,_0xaa5340){var _0x94e9dd={'raw':!![],'where':{'id':_0x5cab5e[_0xecd0('0x46')]['id']}},_0x3b08ca={};_0x3b08ca['model']=_['keys'](db[_0xecd0('0x2d')][_0xecd0('0x2e')]);_0x3b08ca[_0xecd0('0x32')]=_[_0xecd0('0x33')](_0x5cab5e[_0xecd0('0x32')]);_0x3b08ca['filters']=_['intersection'](_0x3b08ca['model'],_0x3b08ca[_0xecd0('0x32')]);_0x94e9dd['attributes']=_[_0xecd0('0x34')](_0x3b08ca[_0xecd0('0x31')],qs[_0xecd0('0x36')](_0x5cab5e['query'][_0xecd0('0x36')]));_0x94e9dd['attributes']=_0x94e9dd['attributes'][_0xecd0('0x47')]?_0x94e9dd[_0xecd0('0x35')]:_0x3b08ca[_0xecd0('0x31')];if(_0x5cab5e[_0xecd0('0x32')][_0xecd0('0x42')]){_0x94e9dd[_0xecd0('0x43')]=[{'all':!![]}];}_0x94e9dd=_[_0xecd0('0x3e')]({},_0x94e9dd,_0x5cab5e[_0xecd0('0x48')]);return db[_0xecd0('0x2d')]['find'](_0x94e9dd)[_0xecd0('0x41')](handleEntityNotFound(_0xaa5340,null))['then'](respondWithResult(_0xaa5340,null))[_0xecd0('0x49')](handleError(_0xaa5340,null));};exports[_0xecd0('0x4a')]=function(_0x496e2b,_0x563b3c){return db[_0xecd0('0x2d')][_0xecd0('0x4a')](_0x496e2b[_0xecd0('0x4b')],{})['then'](respondWithResult(_0x563b3c,0xc9))[_0xecd0('0x49')](handleError(_0x563b3c,null));};exports[_0xecd0('0x4c')]=function(_0x565829,_0x54de11){if(_0x565829[_0xecd0('0x4b')]['id']){delete _0x565829[_0xecd0('0x4b')]['id'];}return db[_0xecd0('0x2d')][_0xecd0('0x4d')]({'where':{'id':_0x565829[_0xecd0('0x46')]['id']}})[_0xecd0('0x41')](handleEntityNotFound(_0x54de11,null))[_0xecd0('0x41')](saveUpdates(_0x565829['body'],null))[_0xecd0('0x41')](respondWithResult(_0x54de11,null))[_0xecd0('0x49')](handleError(_0x54de11,null));};exports[_0xecd0('0x27')]=function(_0x1806cf,_0x3aef3e){return db['ChatQueueReport'][_0xecd0('0x4d')]({'where':{'id':_0x1806cf[_0xecd0('0x46')]['id']}})[_0xecd0('0x41')](handleEntityNotFound(_0x3aef3e,null))['then'](removeEntity(_0x3aef3e,null))[_0xecd0('0x49')](handleError(_0x3aef3e,null));};exports[_0xecd0('0x4e')]=function(_0x495b6d,_0x39cc8e){return db['ChatQueueReport'][_0xecd0('0x4e')]()[_0xecd0('0x41')](respondWithResult(_0x39cc8e,null))[_0xecd0('0x49')](handleError(_0x39cc8e,null));};
\ No newline at end of file
+var _0xb3d8=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','ChatQueueReport','fieldName','type','key','name','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','options','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x2402ce,_0xa8ef8f){var _0x3434ef=function(_0x1028f2){while(--_0x1028f2){_0x2402ce['push'](_0x2402ce['shift']());}};_0x3434ef(++_0xa8ef8f);}(_0xb3d8,0xdc));var _0x8b3d=function(_0xb75c06,_0x344d72){_0xb75c06=_0xb75c06-0x0;var _0x5a84ba=_0xb3d8[_0xb75c06];return _0x5a84ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b3d('0x0'));var zipdir=require(_0x8b3d('0x1'));var jsonpatch=require(_0x8b3d('0x2'));var rp=require(_0x8b3d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8b3d('0x4'));var util=require(_0x8b3d('0x5'));var path=require(_0x8b3d('0x6'));var sox=require(_0x8b3d('0x7'));var csv=require(_0x8b3d('0x8'));var ejs=require(_0x8b3d('0x9'));var fs=require('fs');var fs_extra=require(_0x8b3d('0xa'));var _=require(_0x8b3d('0xb'));var squel=require(_0x8b3d('0xc'));var crypto=require('crypto');var jsforce=require(_0x8b3d('0xd'));var deskjs=require(_0x8b3d('0xe'));var toCsv=require(_0x8b3d('0x8'));var querystring=require(_0x8b3d('0xf'));var Papa=require(_0x8b3d('0x10'));var Redis=require(_0x8b3d('0x11'));var authService=require(_0x8b3d('0x12'));var qs=require(_0x8b3d('0x13'));var as=require(_0x8b3d('0x14'));var hardwareService=require(_0x8b3d('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x8b3d('0x16'));var config=require(_0x8b3d('0x17'));var licenseUtil=require(_0x8b3d('0x18'));var db=require(_0x8b3d('0x19'))['db'];function respondWithStatusCode(_0x16e1fb,_0x1fa985){_0x1fa985=_0x1fa985||0xcc;return function(_0x63293){if(_0x63293){return _0x16e1fb[_0x8b3d('0x1a')](_0x1fa985);}return _0x16e1fb[_0x8b3d('0x1b')](_0x1fa985)[_0x8b3d('0x1c')]();};}function respondWithResult(_0x984b9a,_0x3f03ee){_0x3f03ee=_0x3f03ee||0xc8;return function(_0xb0a303){if(_0xb0a303){return _0x984b9a[_0x8b3d('0x1b')](_0x3f03ee)[_0x8b3d('0x1d')](_0xb0a303);}};}function respondWithFilteredResult(_0x14611e,_0x4fc552){return function(_0x2c624d){if(_0x2c624d){var _0x381c0d=typeof _0x4fc552['offset']===_0x8b3d('0x1e')&&typeof _0x4fc552[_0x8b3d('0x1f')]==='undefined';var _0xb493ac=_0x2c624d[_0x8b3d('0x20')];var _0xcc9b46=_0x381c0d?0x0:_0x4fc552[_0x8b3d('0x21')];var _0x1d96ae=_0x381c0d?_0x2c624d['count']:_0x4fc552['offset']+_0x4fc552[_0x8b3d('0x1f')];var _0x4f1b21;if(_0x1d96ae>=_0xb493ac){_0x1d96ae=_0xb493ac;_0x4f1b21=0xc8;}else{_0x4f1b21=0xce;}_0x14611e['status'](_0x4f1b21);return _0x14611e['set'](_0x8b3d('0x22'),_0xcc9b46+'-'+_0x1d96ae+'/'+_0xb493ac)[_0x8b3d('0x1d')](_0x2c624d);}return null;};}function patchUpdates(_0x4867e4){return function(_0x45c245){try{jsonpatch[_0x8b3d('0x23')](_0x45c245,_0x4867e4,!![]);}catch(_0xff346c){return BPromise[_0x8b3d('0x24')](_0xff346c);}return _0x45c245[_0x8b3d('0x25')]();};}function saveUpdates(_0x43a68,_0x3510f4){return function(_0x116ea4){if(_0x116ea4){return _0x116ea4[_0x8b3d('0x26')](_0x43a68)[_0x8b3d('0x27')](function(_0x338f6b){return _0x338f6b;});}return null;};}function removeEntity(_0x5462c6,_0x37c98e){return function(_0x584a71){if(_0x584a71){return _0x584a71[_0x8b3d('0x28')]()[_0x8b3d('0x27')](function(){_0x5462c6[_0x8b3d('0x1b')](0xcc)[_0x8b3d('0x1c')]();});}};}function handleEntityNotFound(_0x57fe10,_0x219ecb){return function(_0x4fc627){if(!_0x4fc627){_0x57fe10['sendStatus'](0x194);}return _0x4fc627;};}function handleError(_0x39a4bf,_0x513bb1){_0x513bb1=_0x513bb1||0x1f4;return function(_0x4eefbf){logger[_0x8b3d('0x29')](_0x4eefbf[_0x8b3d('0x2a')]);if(_0x4eefbf['name']){delete _0x4eefbf['name'];}_0x39a4bf[_0x8b3d('0x1b')](_0x513bb1)[_0x8b3d('0x2b')](_0x4eefbf);};}exports[_0x8b3d('0x2c')]=function(_0x1cab3a,_0x36f329){var _0x591a4c={},_0x261070={},_0x747446={'count':0x0,'rows':[]};var _0x1125dc=_[_0x8b3d('0x2d')](db[_0x8b3d('0x2e')]['rawAttributes'],function(_0x520a69){return{'name':_0x520a69[_0x8b3d('0x2f')],'type':_0x520a69[_0x8b3d('0x30')][_0x8b3d('0x31')]};});_0x261070['model']=_[_0x8b3d('0x2d')](_0x1125dc,_0x8b3d('0x32'));_0x261070[_0x8b3d('0x33')]=_['keys'](_0x1cab3a[_0x8b3d('0x33')]);_0x261070[_0x8b3d('0x34')]=_[_0x8b3d('0x35')](_0x261070['model'],_0x261070['query']);_0x591a4c[_0x8b3d('0x36')]=_[_0x8b3d('0x35')](_0x261070[_0x8b3d('0x37')],qs[_0x8b3d('0x38')](_0x1cab3a[_0x8b3d('0x33')][_0x8b3d('0x38')]));_0x591a4c[_0x8b3d('0x36')]=_0x591a4c['attributes'][_0x8b3d('0x39')]?_0x591a4c[_0x8b3d('0x36')]:_0x261070[_0x8b3d('0x37')];if(!_0x1cab3a[_0x8b3d('0x33')][_0x8b3d('0x3a')](_0x8b3d('0x3b'))){_0x591a4c[_0x8b3d('0x1f')]=qs[_0x8b3d('0x1f')](_0x1cab3a[_0x8b3d('0x33')][_0x8b3d('0x1f')]);_0x591a4c[_0x8b3d('0x21')]=qs[_0x8b3d('0x21')](_0x1cab3a[_0x8b3d('0x33')][_0x8b3d('0x21')]);}_0x591a4c[_0x8b3d('0x3c')]=qs[_0x8b3d('0x3d')](_0x1cab3a[_0x8b3d('0x33')]['sort']);_0x591a4c['where']=qs[_0x8b3d('0x34')](_['pick'](_0x1cab3a[_0x8b3d('0x33')],_0x261070[_0x8b3d('0x34')]),_0x1125dc);if(_0x1cab3a[_0x8b3d('0x33')]['filter']){_0x591a4c['where']=_[_0x8b3d('0x3e')](_0x591a4c[_0x8b3d('0x3f')],{'$or':_[_0x8b3d('0x2d')](_0x1125dc,function(_0x4b8fef){if(_0x4b8fef['type']!=='VIRTUAL'){var _0xbb0ca9={};_0xbb0ca9[_0x4b8fef[_0x8b3d('0x32')]]={'$like':'%'+_0x1cab3a['query']['filter']+'%'};return _0xbb0ca9;}})});}_0x591a4c=_['merge']({},_0x591a4c,_0x1cab3a[_0x8b3d('0x40')]);var _0x56a690={'where':_0x591a4c[_0x8b3d('0x3f')]};return db[_0x8b3d('0x2e')][_0x8b3d('0x20')](_0x56a690)[_0x8b3d('0x27')](function(_0x328b0c){_0x747446[_0x8b3d('0x20')]=_0x328b0c;if(_0x1cab3a[_0x8b3d('0x33')][_0x8b3d('0x41')]){_0x591a4c[_0x8b3d('0x42')]=[{'all':!![]}];}return db[_0x8b3d('0x2e')][_0x8b3d('0x43')](_0x591a4c);})[_0x8b3d('0x27')](function(_0x42790b){_0x747446[_0x8b3d('0x44')]=_0x42790b;return _0x747446;})[_0x8b3d('0x27')](respondWithFilteredResult(_0x36f329,_0x591a4c))[_0x8b3d('0x45')](handleError(_0x36f329,null));};exports[_0x8b3d('0x46')]=function(_0x26d01a,_0x45c73e){var _0x4b5ac6={'raw':!![],'where':{'id':_0x26d01a['params']['id']}},_0x2d2c5e={};_0x2d2c5e[_0x8b3d('0x37')]=_['keys'](db[_0x8b3d('0x2e')]['rawAttributes']);_0x2d2c5e[_0x8b3d('0x33')]=_[_0x8b3d('0x47')](_0x26d01a[_0x8b3d('0x33')]);_0x2d2c5e[_0x8b3d('0x34')]=_[_0x8b3d('0x35')](_0x2d2c5e[_0x8b3d('0x37')],_0x2d2c5e[_0x8b3d('0x33')]);_0x4b5ac6[_0x8b3d('0x36')]=_['intersection'](_0x2d2c5e[_0x8b3d('0x37')],qs[_0x8b3d('0x38')](_0x26d01a['query'][_0x8b3d('0x38')]));_0x4b5ac6[_0x8b3d('0x36')]=_0x4b5ac6[_0x8b3d('0x36')][_0x8b3d('0x39')]?_0x4b5ac6[_0x8b3d('0x36')]:_0x2d2c5e[_0x8b3d('0x37')];if(_0x26d01a[_0x8b3d('0x33')][_0x8b3d('0x41')]){_0x4b5ac6[_0x8b3d('0x42')]=[{'all':!![]}];}_0x4b5ac6=_[_0x8b3d('0x3e')]({},_0x4b5ac6,_0x26d01a['options']);return db[_0x8b3d('0x2e')]['find'](_0x4b5ac6)[_0x8b3d('0x27')](handleEntityNotFound(_0x45c73e,null))[_0x8b3d('0x27')](respondWithResult(_0x45c73e,null))[_0x8b3d('0x45')](handleError(_0x45c73e,null));};exports[_0x8b3d('0x48')]=function(_0x33507f,_0x52ecc6){return db[_0x8b3d('0x2e')][_0x8b3d('0x48')](_0x33507f[_0x8b3d('0x49')],{})[_0x8b3d('0x27')](respondWithResult(_0x52ecc6,0xc9))['catch'](handleError(_0x52ecc6,null));};exports[_0x8b3d('0x26')]=function(_0x4a49d6,_0x5d94e7){if(_0x4a49d6[_0x8b3d('0x49')]['id']){delete _0x4a49d6[_0x8b3d('0x49')]['id'];}return db[_0x8b3d('0x2e')][_0x8b3d('0x4a')]({'where':{'id':_0x4a49d6['params']['id']}})[_0x8b3d('0x27')](handleEntityNotFound(_0x5d94e7,null))[_0x8b3d('0x27')](saveUpdates(_0x4a49d6['body'],null))[_0x8b3d('0x27')](respondWithResult(_0x5d94e7,null))[_0x8b3d('0x45')](handleError(_0x5d94e7,null));};exports[_0x8b3d('0x28')]=function(_0x455623,_0x2bb19a){return db[_0x8b3d('0x2e')][_0x8b3d('0x4a')]({'where':{'id':_0x455623[_0x8b3d('0x4b')]['id']}})[_0x8b3d('0x27')](handleEntityNotFound(_0x2bb19a,null))[_0x8b3d('0x27')](removeEntity(_0x2bb19a,null))['catch'](handleError(_0x2bb19a,null));};exports[_0x8b3d('0x4c')]=function(_0x5e1353,_0x262e5d){return db['ChatQueueReport'][_0x8b3d('0x4c')]()[_0x8b3d('0x27')](respondWithResult(_0x262e5d,null))[_0x8b3d('0x45')](handleError(_0x262e5d,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index b34f1f0..0057bbc 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5a6669,_0x417479){var _0x543d49=function(_0x1f72ad){while(--_0x1f72ad){_0x5a6669['push'](_0x5a6669['shift']());}};_0x543d49(++_0x417479);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x3e775f,_0x3b55d1){var _0x5f3b28=function(_0x51a351){while(--_0x51a351){_0x3e775f['push'](_0x3e775f['shift']());}};_0x5f3b28(++_0x3b55d1);}(_0x757a,0xde));var _0xa757=function(_0x42e243,_0x132f93){_0x42e243=_0x42e243-0x0;var _0x18261b=_0x757a[_0x42e243];return _0x18261b;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 760eb31..7426160 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 _0xbf5a=['message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','debug','raw','where','attributes','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x21f3c2,_0x406840){var _0xf1069d=function(_0x263ccd){while(--_0x263ccd){_0x21f3c2['push'](_0x21f3c2['shift']());}};_0xf1069d(++_0x406840);}(_0xbf5a,0x16c));var _0xabf5=function(_0x5e4f0e,_0x5a28b3){_0x5e4f0e=_0x5e4f0e-0x0;var _0x4f18a2=_0xbf5a[_0x5e4f0e];return _0x4f18a2;};'use strict';var _=require(_0xabf5('0x0'));var util=require('util');var moment=require(_0xabf5('0x1'));var BPromise=require(_0xabf5('0x2'));var rs=require(_0xabf5('0x3'));var fs=require('fs');var Redis=require(_0xabf5('0x4'));var db=require(_0xabf5('0x5'))['db'];var utils=require(_0xabf5('0x6'));var logger=require(_0xabf5('0x7'))(_0xabf5('0x8'));var config=require(_0xabf5('0x9'));var jayson=require(_0xabf5('0xa'));var client=jayson[_0xabf5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32f17d,_0x1dfe7f,_0x7152cd){return new BPromise(function(_0x12a821,_0x15f970){return client[_0xabf5('0xc')](_0x32f17d,_0x7152cd)[_0xabf5('0xd')](function(_0x56c6fd){logger[_0xabf5('0xe')](_0xabf5('0xf'),_0x1dfe7f,_0xabf5('0x10'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x1dfe7f,'request\x20sent',JSON[_0xabf5('0x11')](_0x56c6fd));if(_0x56c6fd[_0xabf5('0x12')]){if(_0x56c6fd[_0xabf5('0x12')][_0xabf5('0x13')]===0x1f4){logger['error'](_0xabf5('0xf'),_0x1dfe7f,_0x56c6fd['error']['message']);return _0x15f970(_0x56c6fd[_0xabf5('0x12')]['message']);}logger[_0xabf5('0x12')](_0xabf5('0xf'),_0x1dfe7f,_0x56c6fd[_0xabf5('0x12')]['message']);return _0x12a821(_0x56c6fd[_0xabf5('0x12')][_0xabf5('0x14')]);}else{logger[_0xabf5('0xe')](_0xabf5('0xf'),_0x1dfe7f,_0xabf5('0x10'));_0x12a821(_0x56c6fd[_0xabf5('0x15')][_0xabf5('0x14')]);}})[_0xabf5('0x16')](function(_0x2e8d4e){logger[_0xabf5('0x12')](_0xabf5('0xf'),_0x1dfe7f,_0x2e8d4e);_0x15f970(_0x2e8d4e);});});}exports[_0xabf5('0x17')]=function(_0x19c4be){var _0x9f72a6=this;return new Promise(function(_0x1c7214,_0x3e5c90){return db[_0xabf5('0x18')]['create'](_0x19c4be[_0xabf5('0x19')],{'raw':_0x19c4be[_0xabf5('0x1a')]?_0x19c4be[_0xabf5('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xabf5('0xd')](function(_0x24115a){logger[_0xabf5('0xe')](_0xabf5('0x17'),_0x19c4be);logger[_0xabf5('0x1b')](_0xabf5('0x17'),_0x19c4be,JSON['stringify'](_0x24115a));_0x1c7214(_0x24115a);})['catch'](function(_0x2bc8ad){logger[_0xabf5('0x12')](_0xabf5('0x17'),_0x2bc8ad[_0xabf5('0x14')],_0x19c4be);_0x3e5c90(_0x9f72a6[_0xabf5('0x12')](0x1f4,_0x2bc8ad[_0xabf5('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x2b17d8){var _0x4f2e9e=this;return new Promise(function(_0x34878d,_0x599816){return db[_0xabf5('0x18')]['update'](_0x2b17d8['body'],{'raw':_0x2b17d8[_0xabf5('0x1a')]?_0x2b17d8[_0xabf5('0x1a')][_0xabf5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b17d8['options']?_0x2b17d8[_0xabf5('0x1a')][_0xabf5('0x1d')]||null:null,'attributes':_0x2b17d8[_0xabf5('0x1a')]?_0x2b17d8['options'][_0xabf5('0x1e')]||null:null,'limit':_0x2b17d8['options']?_0x2b17d8[_0xabf5('0x1a')]['limit']||null:null})[_0xabf5('0xd')](function(_0x46c1ec){logger[_0xabf5('0xe')](_0xabf5('0x1f'),_0x2b17d8);logger[_0xabf5('0x1b')]('UpdateChatQueueReport',_0x2b17d8,JSON[_0xabf5('0x11')](_0x46c1ec));_0x34878d(_0x46c1ec);})[_0xabf5('0x16')](function(_0x18bf14){logger[_0xabf5('0x12')](_0xabf5('0x1f'),_0x18bf14['message'],_0x2b17d8);_0x599816(_0x4f2e9e['error'](0x1f4,_0x18bf14[_0xabf5('0x14')]));});});};
\ No newline at end of file
+var _0x0ae2=['http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateChatQueueReport','create','body','raw','debug','stringify','ChatQueueReport','update','options','where','attributes','limit','UpdateChatQueueReport','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0x0ae2,0xa5));var _0x20ae=function(_0x13cab0,_0x14d825){_0x13cab0=_0x13cab0-0x0;var _0x38804f=_0x0ae2[_0x13cab0];return _0x38804f;};'use strict';var _=require(_0x20ae('0x0'));var util=require('util');var moment=require(_0x20ae('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20ae('0x2'));var db=require(_0x20ae('0x3'))['db'];var utils=require(_0x20ae('0x4'));var logger=require(_0x20ae('0x5'))(_0x20ae('0x6'));var config=require(_0x20ae('0x7'));var jayson=require(_0x20ae('0x8'));var client=jayson[_0x20ae('0x9')][_0x20ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56c9e7,_0x2ea7c4,_0x38696e){return new BPromise(function(_0x361b55,_0x13dd09){return client[_0x20ae('0xb')](_0x56c9e7,_0x38696e)[_0x20ae('0xc')](function(_0x463563){logger['info'](_0x20ae('0xd'),_0x2ea7c4,_0x20ae('0xe'));logger['debug'](_0x20ae('0xf'),_0x2ea7c4,'request\x20sent',JSON['stringify'](_0x463563));if(_0x463563[_0x20ae('0x10')]){if(_0x463563[_0x20ae('0x10')][_0x20ae('0x11')]===0x1f4){logger[_0x20ae('0x10')](_0x20ae('0xd'),_0x2ea7c4,_0x463563[_0x20ae('0x10')][_0x20ae('0x12')]);return _0x13dd09(_0x463563[_0x20ae('0x10')][_0x20ae('0x12')]);}logger[_0x20ae('0x10')](_0x20ae('0xd'),_0x2ea7c4,_0x463563[_0x20ae('0x10')]['message']);return _0x361b55(_0x463563['error'][_0x20ae('0x12')]);}else{logger[_0x20ae('0x13')](_0x20ae('0xd'),_0x2ea7c4,'request\x20sent');_0x361b55(_0x463563[_0x20ae('0x14')]['message']);}})[_0x20ae('0x15')](function(_0x156488){logger[_0x20ae('0x10')](_0x20ae('0xd'),_0x2ea7c4,_0x156488);_0x13dd09(_0x156488);});});}exports[_0x20ae('0x16')]=function(_0x2e9b47){var _0x2682ca=this;return new Promise(function(_0x4adcb9,_0x2acfb6){return db['ChatQueueReport'][_0x20ae('0x17')](_0x2e9b47[_0x20ae('0x18')],{'raw':_0x2e9b47['options']?_0x2e9b47['options'][_0x20ae('0x19')]===undefined?!![]:![]:!![]})[_0x20ae('0xc')](function(_0x1ef2d0){logger[_0x20ae('0x13')](_0x20ae('0x16'),_0x2e9b47);logger[_0x20ae('0x1a')]('CreateChatQueueReport',_0x2e9b47,JSON[_0x20ae('0x1b')](_0x1ef2d0));_0x4adcb9(_0x1ef2d0);})[_0x20ae('0x15')](function(_0x38df75){logger['error']('CreateChatQueueReport',_0x38df75[_0x20ae('0x12')],_0x2e9b47);_0x2acfb6(_0x2682ca['error'](0x1f4,_0x38df75[_0x20ae('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x5f19bc){var _0x4e4bbe=this;return new Promise(function(_0x525972,_0x14458b){return db[_0x20ae('0x1c')][_0x20ae('0x1d')](_0x5f19bc[_0x20ae('0x18')],{'raw':_0x5f19bc['options']?_0x5f19bc[_0x20ae('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f19bc[_0x20ae('0x1e')]?_0x5f19bc['options'][_0x20ae('0x1f')]||null:null,'attributes':_0x5f19bc[_0x20ae('0x1e')]?_0x5f19bc[_0x20ae('0x1e')][_0x20ae('0x20')]||null:null,'limit':_0x5f19bc[_0x20ae('0x1e')]?_0x5f19bc[_0x20ae('0x1e')][_0x20ae('0x21')]||null:null})[_0x20ae('0xc')](function(_0x87af23){logger[_0x20ae('0x13')](_0x20ae('0x22'),_0x5f19bc);logger[_0x20ae('0x1a')]('UpdateChatQueueReport',_0x5f19bc,JSON[_0x20ae('0x1b')](_0x87af23));_0x525972(_0x87af23);})['catch'](function(_0x2bdf2b){logger[_0x20ae('0x10')]('UpdateChatQueueReport',_0x2bdf2b[_0x20ae('0x12')],_0x5f19bc);_0x14458b(_0x4e4bbe[_0x20ae('0x10')](0x1f4,_0x2bdf2b[_0x20ae('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index d28e1a6..a417248 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 _0x6912=['../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3b22e9,_0x354406){var _0x230314=function(_0x29ae96){while(--_0x29ae96){_0x3b22e9['push'](_0x3b22e9['shift']());}};_0x230314(++_0x354406);}(_0x6912,0xa1));var _0x2691=function(_0x468467,_0x1dee78){_0x468467=_0x468467-0x0;var _0x488fc2=_0x6912[_0x468467];return _0x488fc2;};'use strict';var multer=require('multer');var util=require(_0x2691('0x0'));var path=require(_0x2691('0x1'));var timeout=require(_0x2691('0x2'));var express=require(_0x2691('0x3'));var router=express[_0x2691('0x4')]();var fs_extra=require(_0x2691('0x5'));var auth=require(_0x2691('0x6'));var interaction=require(_0x2691('0x7'));var config=require('../../config/environment');var controller=require(_0x2691('0x8'));router[_0x2691('0x9')]('/',auth[_0x2691('0xa')](),controller[_0x2691('0xb')]);router['get'](_0x2691('0xc'),auth[_0x2691('0xa')](),controller[_0x2691('0xd')]);router[_0x2691('0x9')](_0x2691('0xe'),auth['isAuthenticated'](),controller[_0x2691('0xf')]);router[_0x2691('0x10')]('/',auth[_0x2691('0xa')](),controller[_0x2691('0x11')]);router['put'](_0x2691('0xe'),auth[_0x2691('0xa')](),controller[_0x2691('0x12')]);router[_0x2691('0x13')](_0x2691('0xe'),auth[_0x2691('0xa')](),controller['destroy']);module[_0x2691('0x14')]=router;
\ No newline at end of file
+var _0x3005=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','post','create','put','delete','exports','path','express','Router','fs-extra'];(function(_0x42c6f1,_0x338d7b){var _0x3c7398=function(_0x151494){while(--_0x151494){_0x42c6f1['push'](_0x42c6f1['shift']());}};_0x3c7398(++_0x338d7b);}(_0x3005,0x183));var _0x5300=function(_0x21d951,_0x511bd9){_0x21d951=_0x21d951-0x0;var _0x149d77=_0x3005[_0x21d951];return _0x149d77;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5300('0x0'));var timeout=require('connect-timeout');var express=require(_0x5300('0x1'));var router=express[_0x5300('0x2')]();var fs_extra=require(_0x5300('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5300('0x4'));var config=require(_0x5300('0x5'));var controller=require('./chatQueueReport.controller');router[_0x5300('0x6')]('/',auth['isAuthenticated'](),controller[_0x5300('0x7')]);router[_0x5300('0x6')](_0x5300('0x8'),auth[_0x5300('0x9')](),controller['describe']);router[_0x5300('0x6')](_0x5300('0xa'),auth[_0x5300('0x9')](),controller[_0x5300('0xb')]);router[_0x5300('0xc')]('/',auth[_0x5300('0x9')](),controller[_0x5300('0xd')]);router[_0x5300('0xe')](_0x5300('0xa'),auth[_0x5300('0x9')](),controller['update']);router[_0x5300('0xf')](_0x5300('0xa'),auth[_0x5300('0x9')](),controller['destroy']);module[_0x5300('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 95ed28f..f785f3f 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(_0x4617a5,_0x582345){var _0x2629f9=function(_0x56543c){while(--_0x56543c){_0x4617a5['push'](_0x4617a5['shift']());}};_0x2629f9(++_0x582345);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2bbba5,_0x24e84b){_0x2bbba5=_0x2bbba5-0x0;var _0x3c477c=_0xf4eb[_0x2bbba5];return _0x3c477c;};'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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x5f5cce,_0x138cc5){var _0x705ecf=function(_0x28bc5d){while(--_0x28bc5d){_0x5f5cce['push'](_0x5f5cce['shift']());}};_0x705ecf(++_0x138cc5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4d8cf0,_0x1a581f){_0x4d8cf0=_0x4d8cf0-0x0;var _0x251e52=_0xb43b[_0x4d8cf0];return _0x251e52;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 81a2fa6..3cbb711 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 _0xedf5=['sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','merge','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2328f3,_0x48d111){var _0x2fc749=function(_0x43f897){while(--_0x43f897){_0x2328f3['push'](_0x2328f3['shift']());}};_0x2fc749(++_0x48d111);}(_0xedf5,0x10e));var _0x5edf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xedf5[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5edf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5edf('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5edf('0x2'));var Mustache=require(_0x5edf('0x3'));var util=require('util');var path=require(_0x5edf('0x4'));var sox=require('sox');var csv=require(_0x5edf('0x5'));var ejs=require(_0x5edf('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5edf('0x7'));var squel=require(_0x5edf('0x8'));var crypto=require(_0x5edf('0x9'));var jsforce=require(_0x5edf('0xa'));var deskjs=require(_0x5edf('0xb'));var toCsv=require(_0x5edf('0x5'));var querystring=require('querystring');var Papa=require(_0x5edf('0xc'));var Redis=require(_0x5edf('0xd'));var authService=require(_0x5edf('0xe'));var qs=require(_0x5edf('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5edf('0x10'));var logger=require(_0x5edf('0x11'))('api');var utils=require(_0x5edf('0x12'));var config=require(_0x5edf('0x13'));var licenseUtil=require(_0x5edf('0x14'));var db=require(_0x5edf('0x15'))['db'];function respondWithStatusCode(_0x22682b,_0x5ad188){_0x5ad188=_0x5ad188||0xcc;return function(_0x462d4f){if(_0x462d4f){return _0x22682b[_0x5edf('0x16')](_0x5ad188);}return _0x22682b['status'](_0x5ad188)['end']();};}function respondWithResult(_0x218d11,_0x5f2016){_0x5f2016=_0x5f2016||0xc8;return function(_0x36aa39){if(_0x36aa39){return _0x218d11[_0x5edf('0x17')](_0x5f2016)[_0x5edf('0x18')](_0x36aa39);}};}function respondWithFilteredResult(_0x98ea8b,_0x1129c6){return function(_0x56feba){if(_0x56feba){var _0x4905fa=typeof _0x1129c6['offset']===_0x5edf('0x19')&&typeof _0x1129c6[_0x5edf('0x1a')]===_0x5edf('0x19');var _0x223ee1=_0x56feba[_0x5edf('0x1b')];var _0x5f12d2=_0x4905fa?0x0:_0x1129c6[_0x5edf('0x1c')];var _0x1839e1=_0x4905fa?_0x56feba[_0x5edf('0x1b')]:_0x1129c6[_0x5edf('0x1c')]+_0x1129c6[_0x5edf('0x1a')];var _0xc20065;if(_0x1839e1>=_0x223ee1){_0x1839e1=_0x223ee1;_0xc20065=0xc8;}else{_0xc20065=0xce;}_0x98ea8b[_0x5edf('0x17')](_0xc20065);return _0x98ea8b['set'](_0x5edf('0x1d'),_0x5f12d2+'-'+_0x1839e1+'/'+_0x223ee1)[_0x5edf('0x18')](_0x56feba);}return null;};}function patchUpdates(_0x44e74c){return function(_0xbaade0){try{jsonpatch[_0x5edf('0x1e')](_0xbaade0,_0x44e74c,!![]);}catch(_0x20dade){return BPromise['reject'](_0x20dade);}return _0xbaade0[_0x5edf('0x1f')]();};}function saveUpdates(_0x347a34,_0x1679dd){return function(_0x1dee83){if(_0x1dee83){return _0x1dee83[_0x5edf('0x20')](_0x347a34)[_0x5edf('0x21')](function(_0x1a7b77){return _0x1a7b77;});}return null;};}function removeEntity(_0x312cb2,_0x4d7d79){return function(_0xced655){if(_0xced655){return _0xced655[_0x5edf('0x22')]()[_0x5edf('0x21')](function(){_0x312cb2[_0x5edf('0x17')](0xcc)[_0x5edf('0x23')]();});}};}function handleEntityNotFound(_0x240ad0,_0x891a3d){return function(_0xe3c0a9){if(!_0xe3c0a9){_0x240ad0[_0x5edf('0x16')](0x194);}return _0xe3c0a9;};}function handleError(_0x1ec19f,_0x195f5b){_0x195f5b=_0x195f5b||0x1f4;return function(_0x180893){logger['error'](_0x180893[_0x5edf('0x24')]);if(_0x180893[_0x5edf('0x25')]){delete _0x180893['name'];}_0x1ec19f['status'](_0x195f5b)[_0x5edf('0x26')](_0x180893);};}exports[_0x5edf('0x27')]=function(_0x23ee4c,_0xe765e){var _0x38a368={},_0xbe4a47={},_0x48698f={'count':0x0,'rows':[]};var _0x23c9b6=_[_0x5edf('0x28')](db[_0x5edf('0x29')][_0x5edf('0x2a')],function(_0x4bbbcf){return{'name':_0x4bbbcf[_0x5edf('0x2b')],'type':_0x4bbbcf['type'][_0x5edf('0x2c')]};});_0xbe4a47['model']=_[_0x5edf('0x28')](_0x23c9b6,_0x5edf('0x25'));_0xbe4a47[_0x5edf('0x2d')]=_[_0x5edf('0x2e')](_0x23ee4c[_0x5edf('0x2d')]);_0xbe4a47[_0x5edf('0x2f')]=_['intersection'](_0xbe4a47['model'],_0xbe4a47[_0x5edf('0x2d')]);_0x38a368[_0x5edf('0x30')]=_[_0x5edf('0x31')](_0xbe4a47[_0x5edf('0x32')],qs[_0x5edf('0x33')](_0x23ee4c[_0x5edf('0x2d')]['fields']));_0x38a368[_0x5edf('0x30')]=_0x38a368['attributes'][_0x5edf('0x34')]?_0x38a368['attributes']:_0xbe4a47[_0x5edf('0x32')];if(!_0x23ee4c['query'][_0x5edf('0x35')](_0x5edf('0x36'))){_0x38a368[_0x5edf('0x1a')]=qs['limit'](_0x23ee4c[_0x5edf('0x2d')][_0x5edf('0x1a')]);_0x38a368['offset']=qs[_0x5edf('0x1c')](_0x23ee4c[_0x5edf('0x2d')][_0x5edf('0x1c')]);}_0x38a368[_0x5edf('0x37')]=qs[_0x5edf('0x38')](_0x23ee4c[_0x5edf('0x2d')][_0x5edf('0x38')]);_0x38a368[_0x5edf('0x39')]=qs[_0x5edf('0x2f')](_['pick'](_0x23ee4c[_0x5edf('0x2d')],_0xbe4a47[_0x5edf('0x2f')]),_0x23c9b6);if(_0x23ee4c[_0x5edf('0x2d')][_0x5edf('0x3a')]){_0x38a368[_0x5edf('0x39')]=_['merge'](_0x38a368['where'],{'$or':_[_0x5edf('0x28')](_0x23c9b6,function(_0x2e4b60){if(_0x2e4b60[_0x5edf('0x3b')]!==_0x5edf('0x3c')){var _0x199d67={};_0x199d67[_0x2e4b60[_0x5edf('0x25')]]={'$like':'%'+_0x23ee4c[_0x5edf('0x2d')]['filter']+'%'};return _0x199d67;}})});}_0x38a368=_['merge']({},_0x38a368,_0x23ee4c[_0x5edf('0x3d')]);var _0x1f747e={'where':_0x38a368['where']};return db['ChatTransferReport'][_0x5edf('0x1b')](_0x1f747e)['then'](function(_0x394b52){_0x48698f['count']=_0x394b52;if(_0x23ee4c[_0x5edf('0x2d')][_0x5edf('0x3e')]){_0x38a368[_0x5edf('0x3f')]=[{'all':!![]}];}return db[_0x5edf('0x29')]['findAll'](_0x38a368);})['then'](function(_0x25e0d7){_0x48698f[_0x5edf('0x40')]=_0x25e0d7;return _0x48698f;})[_0x5edf('0x21')](respondWithFilteredResult(_0xe765e,_0x38a368))[_0x5edf('0x41')](handleError(_0xe765e,null));};exports[_0x5edf('0x42')]=function(_0xa53fd4,_0x31226b){var _0x139e6b={'raw':!![],'where':{'id':_0xa53fd4[_0x5edf('0x43')]['id']}},_0x5ce3e0={};_0x5ce3e0[_0x5edf('0x32')]=_[_0x5edf('0x2e')](db[_0x5edf('0x29')][_0x5edf('0x2a')]);_0x5ce3e0['query']=_[_0x5edf('0x2e')](_0xa53fd4['query']);_0x5ce3e0[_0x5edf('0x2f')]=_[_0x5edf('0x31')](_0x5ce3e0[_0x5edf('0x32')],_0x5ce3e0['query']);_0x139e6b['attributes']=_[_0x5edf('0x31')](_0x5ce3e0[_0x5edf('0x32')],qs[_0x5edf('0x33')](_0xa53fd4[_0x5edf('0x2d')][_0x5edf('0x33')]));_0x139e6b[_0x5edf('0x30')]=_0x139e6b[_0x5edf('0x30')][_0x5edf('0x34')]?_0x139e6b[_0x5edf('0x30')]:_0x5ce3e0[_0x5edf('0x32')];if(_0xa53fd4[_0x5edf('0x2d')][_0x5edf('0x3e')]){_0x139e6b[_0x5edf('0x3f')]=[{'all':!![]}];}_0x139e6b=_[_0x5edf('0x44')]({},_0x139e6b,_0xa53fd4[_0x5edf('0x3d')]);return db['ChatTransferReport'][_0x5edf('0x45')](_0x139e6b)['then'](handleEntityNotFound(_0x31226b,null))['then'](respondWithResult(_0x31226b,null))[_0x5edf('0x41')](handleError(_0x31226b,null));};exports[_0x5edf('0x46')]=function(_0xa6a7b8,_0x1fb776){return db[_0x5edf('0x29')][_0x5edf('0x46')](_0xa6a7b8['body'],{})[_0x5edf('0x21')](respondWithResult(_0x1fb776,0xc9))[_0x5edf('0x41')](handleError(_0x1fb776,null));};exports[_0x5edf('0x20')]=function(_0x116dda,_0x2ce7b3){if(_0x116dda[_0x5edf('0x47')]['id']){delete _0x116dda[_0x5edf('0x47')]['id'];}return db[_0x5edf('0x29')][_0x5edf('0x45')]({'where':{'id':_0x116dda[_0x5edf('0x43')]['id']}})[_0x5edf('0x21')](handleEntityNotFound(_0x2ce7b3,null))[_0x5edf('0x21')](saveUpdates(_0x116dda['body'],null))[_0x5edf('0x21')](respondWithResult(_0x2ce7b3,null))[_0x5edf('0x41')](handleError(_0x2ce7b3,null));};exports[_0x5edf('0x22')]=function(_0x461525,_0x2308ca){return db[_0x5edf('0x29')][_0x5edf('0x45')]({'where':{'id':_0x461525[_0x5edf('0x43')]['id']}})[_0x5edf('0x21')](handleEntityNotFound(_0x2308ca,null))[_0x5edf('0x21')](removeEntity(_0x2308ca,null))[_0x5edf('0x41')](handleError(_0x2308ca,null));};exports['describe']=function(_0x52ad2e,_0x14b658){return db[_0x5edf('0x29')][_0x5edf('0x48')]()[_0x5edf('0x21')](respondWithResult(_0x14b658,null))[_0x5edf('0x41')](handleError(_0x14b658,null));};
\ No newline at end of file
+var _0xcc09=['query','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','ChatTransferReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','options','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','apply','reject','save','update','then','destroy','stack','name','send','map','type','keys'];(function(_0x57c1f7,_0x257f29){var _0xc7013c=function(_0x24031e){while(--_0x24031e){_0x57c1f7['push'](_0x57c1f7['shift']());}};_0xc7013c(++_0x257f29);}(_0xcc09,0x1e1));var _0x9cc0=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xcc09[_0x5d2803];return _0xdcad2c;};'use strict';var emlformat=require(_0x9cc0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9cc0('0x1'));var rp=require(_0x9cc0('0x2'));var moment=require(_0x9cc0('0x3'));var BPromise=require(_0x9cc0('0x4'));var Mustache=require('mustache');var util=require(_0x9cc0('0x5'));var path=require(_0x9cc0('0x6'));var sox=require(_0x9cc0('0x7'));var csv=require(_0x9cc0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9cc0('0x9'));var _=require(_0x9cc0('0xa'));var squel=require('squel');var crypto=require(_0x9cc0('0xb'));var jsforce=require(_0x9cc0('0xc'));var deskjs=require(_0x9cc0('0xd'));var toCsv=require(_0x9cc0('0x8'));var querystring=require(_0x9cc0('0xe'));var Papa=require(_0x9cc0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9cc0('0x10'));var utils=require(_0x9cc0('0x11'));var config=require(_0x9cc0('0x12'));var licenseUtil=require(_0x9cc0('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d3f5b,_0x35aef7){_0x35aef7=_0x35aef7||0xcc;return function(_0x561314){if(_0x561314){return _0x1d3f5b[_0x9cc0('0x14')](_0x35aef7);}return _0x1d3f5b[_0x9cc0('0x15')](_0x35aef7)[_0x9cc0('0x16')]();};}function respondWithResult(_0x1f30fa,_0x3057b8){_0x3057b8=_0x3057b8||0xc8;return function(_0x1c42f9){if(_0x1c42f9){return _0x1f30fa[_0x9cc0('0x15')](_0x3057b8)['json'](_0x1c42f9);}};}function respondWithFilteredResult(_0x1a523f,_0x2f7df9){return function(_0xdd1763){if(_0xdd1763){var _0x54d0aa=typeof _0x2f7df9[_0x9cc0('0x17')]===_0x9cc0('0x18')&&typeof _0x2f7df9[_0x9cc0('0x19')]===_0x9cc0('0x18');var _0x38291d=_0xdd1763[_0x9cc0('0x1a')];var _0x39bbc2=_0x54d0aa?0x0:_0x2f7df9[_0x9cc0('0x17')];var _0x52b020=_0x54d0aa?_0xdd1763['count']:_0x2f7df9[_0x9cc0('0x17')]+_0x2f7df9[_0x9cc0('0x19')];var _0xfd0fd0;if(_0x52b020>=_0x38291d){_0x52b020=_0x38291d;_0xfd0fd0=0xc8;}else{_0xfd0fd0=0xce;}_0x1a523f[_0x9cc0('0x15')](_0xfd0fd0);return _0x1a523f['set']('Content-Range',_0x39bbc2+'-'+_0x52b020+'/'+_0x38291d)['json'](_0xdd1763);}return null;};}function patchUpdates(_0x2ce382){return function(_0x1afa11){try{jsonpatch[_0x9cc0('0x1b')](_0x1afa11,_0x2ce382,!![]);}catch(_0x4e5b03){return BPromise[_0x9cc0('0x1c')](_0x4e5b03);}return _0x1afa11[_0x9cc0('0x1d')]();};}function saveUpdates(_0x21aae9,_0x3f8ff2){return function(_0x48e610){if(_0x48e610){return _0x48e610[_0x9cc0('0x1e')](_0x21aae9)[_0x9cc0('0x1f')](function(_0x41bc21){return _0x41bc21;});}return null;};}function removeEntity(_0x3da676,_0x5cd7a1){return function(_0x2ddc11){if(_0x2ddc11){return _0x2ddc11[_0x9cc0('0x20')]()[_0x9cc0('0x1f')](function(){_0x3da676['status'](0xcc)[_0x9cc0('0x16')]();});}};}function handleEntityNotFound(_0x5bf0c3,_0xb6b7b3){return function(_0x4a5fc4){if(!_0x4a5fc4){_0x5bf0c3[_0x9cc0('0x14')](0x194);}return _0x4a5fc4;};}function handleError(_0x54a581,_0x332ef5){_0x332ef5=_0x332ef5||0x1f4;return function(_0x4cff79){logger['error'](_0x4cff79[_0x9cc0('0x21')]);if(_0x4cff79[_0x9cc0('0x22')]){delete _0x4cff79[_0x9cc0('0x22')];}_0x54a581[_0x9cc0('0x15')](_0x332ef5)[_0x9cc0('0x23')](_0x4cff79);};}exports['index']=function(_0x11ecad,_0x216ea5){var _0x2e947d={},_0x225a64={},_0x4c0471={'count':0x0,'rows':[]};var _0x2ea35b=_[_0x9cc0('0x24')](db['ChatTransferReport']['rawAttributes'],function(_0x30ee8){return{'name':_0x30ee8['fieldName'],'type':_0x30ee8[_0x9cc0('0x25')]['key']};});_0x225a64['model']=_[_0x9cc0('0x24')](_0x2ea35b,_0x9cc0('0x22'));_0x225a64['query']=_[_0x9cc0('0x26')](_0x11ecad[_0x9cc0('0x27')]);_0x225a64['filters']=_['intersection'](_0x225a64[_0x9cc0('0x28')],_0x225a64[_0x9cc0('0x27')]);_0x2e947d[_0x9cc0('0x29')]=_['intersection'](_0x225a64['model'],qs[_0x9cc0('0x2a')](_0x11ecad[_0x9cc0('0x27')]['fields']));_0x2e947d[_0x9cc0('0x29')]=_0x2e947d[_0x9cc0('0x29')][_0x9cc0('0x2b')]?_0x2e947d[_0x9cc0('0x29')]:_0x225a64[_0x9cc0('0x28')];if(!_0x11ecad[_0x9cc0('0x27')][_0x9cc0('0x2c')]('nolimit')){_0x2e947d[_0x9cc0('0x19')]=qs[_0x9cc0('0x19')](_0x11ecad[_0x9cc0('0x27')][_0x9cc0('0x19')]);_0x2e947d[_0x9cc0('0x17')]=qs[_0x9cc0('0x17')](_0x11ecad[_0x9cc0('0x27')][_0x9cc0('0x17')]);}_0x2e947d['order']=qs[_0x9cc0('0x2d')](_0x11ecad[_0x9cc0('0x27')][_0x9cc0('0x2d')]);_0x2e947d[_0x9cc0('0x2e')]=qs['filters'](_[_0x9cc0('0x2f')](_0x11ecad[_0x9cc0('0x27')],_0x225a64['filters']),_0x2ea35b);if(_0x11ecad['query'][_0x9cc0('0x30')]){_0x2e947d['where']=_[_0x9cc0('0x31')](_0x2e947d[_0x9cc0('0x2e')],{'$or':_[_0x9cc0('0x24')](_0x2ea35b,function(_0x302049){if(_0x302049[_0x9cc0('0x25')]!=='VIRTUAL'){var _0x5868ad={};_0x5868ad[_0x302049[_0x9cc0('0x22')]]={'$like':'%'+_0x11ecad['query'][_0x9cc0('0x30')]+'%'};return _0x5868ad;}})});}_0x2e947d=_[_0x9cc0('0x31')]({},_0x2e947d,_0x11ecad['options']);var _0x4e39bc={'where':_0x2e947d[_0x9cc0('0x2e')]};return db[_0x9cc0('0x32')][_0x9cc0('0x1a')](_0x4e39bc)[_0x9cc0('0x1f')](function(_0x1a8938){_0x4c0471[_0x9cc0('0x1a')]=_0x1a8938;if(_0x11ecad[_0x9cc0('0x27')][_0x9cc0('0x33')]){_0x2e947d[_0x9cc0('0x34')]=[{'all':!![]}];}return db[_0x9cc0('0x32')][_0x9cc0('0x35')](_0x2e947d);})[_0x9cc0('0x1f')](function(_0x4599d1){_0x4c0471[_0x9cc0('0x36')]=_0x4599d1;return _0x4c0471;})[_0x9cc0('0x1f')](respondWithFilteredResult(_0x216ea5,_0x2e947d))[_0x9cc0('0x37')](handleError(_0x216ea5,null));};exports[_0x9cc0('0x38')]=function(_0x554adb,_0x356b74){var _0x1285c7={'raw':!![],'where':{'id':_0x554adb[_0x9cc0('0x39')]['id']}},_0x41fadd={};_0x41fadd[_0x9cc0('0x28')]=_[_0x9cc0('0x26')](db[_0x9cc0('0x32')][_0x9cc0('0x3a')]);_0x41fadd[_0x9cc0('0x27')]=_[_0x9cc0('0x26')](_0x554adb[_0x9cc0('0x27')]);_0x41fadd['filters']=_[_0x9cc0('0x3b')](_0x41fadd['model'],_0x41fadd['query']);_0x1285c7['attributes']=_[_0x9cc0('0x3b')](_0x41fadd[_0x9cc0('0x28')],qs[_0x9cc0('0x2a')](_0x554adb[_0x9cc0('0x27')][_0x9cc0('0x2a')]));_0x1285c7[_0x9cc0('0x29')]=_0x1285c7[_0x9cc0('0x29')][_0x9cc0('0x2b')]?_0x1285c7[_0x9cc0('0x29')]:_0x41fadd['model'];if(_0x554adb[_0x9cc0('0x27')]['includeAll']){_0x1285c7[_0x9cc0('0x34')]=[{'all':!![]}];}_0x1285c7=_['merge']({},_0x1285c7,_0x554adb[_0x9cc0('0x3c')]);return db[_0x9cc0('0x32')][_0x9cc0('0x3d')](_0x1285c7)['then'](handleEntityNotFound(_0x356b74,null))['then'](respondWithResult(_0x356b74,null))['catch'](handleError(_0x356b74,null));};exports[_0x9cc0('0x3e')]=function(_0x3dfe3b,_0x56749b){return db[_0x9cc0('0x32')][_0x9cc0('0x3e')](_0x3dfe3b[_0x9cc0('0x3f')],{})[_0x9cc0('0x1f')](respondWithResult(_0x56749b,0xc9))[_0x9cc0('0x37')](handleError(_0x56749b,null));};exports[_0x9cc0('0x1e')]=function(_0x51bfab,_0x28a578){if(_0x51bfab[_0x9cc0('0x3f')]['id']){delete _0x51bfab[_0x9cc0('0x3f')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x51bfab[_0x9cc0('0x39')]['id']}})[_0x9cc0('0x1f')](handleEntityNotFound(_0x28a578,null))[_0x9cc0('0x1f')](saveUpdates(_0x51bfab[_0x9cc0('0x3f')],null))[_0x9cc0('0x1f')](respondWithResult(_0x28a578,null))[_0x9cc0('0x37')](handleError(_0x28a578,null));};exports[_0x9cc0('0x20')]=function(_0x3c86cf,_0x1b146c){return db[_0x9cc0('0x32')][_0x9cc0('0x3d')]({'where':{'id':_0x3c86cf[_0x9cc0('0x39')]['id']}})['then'](handleEntityNotFound(_0x1b146c,null))['then'](removeEntity(_0x1b146c,null))[_0x9cc0('0x37')](handleError(_0x1b146c,null));};exports[_0x9cc0('0x40')]=function(_0x2ae93a,_0x1d5401){return db[_0x9cc0('0x32')]['describe']()[_0x9cc0('0x1f')](respondWithResult(_0x1d5401,null))[_0x9cc0('0x37')](handleError(_0x1d5401,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 412953d..54b26d0 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 _0x36a5=['path','rimraf','../../config/environment','./chatTransferReport.attributes','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3732d4,_0x46447d){var _0x155edf=function(_0x546c7f){while(--_0x546c7f){_0x3732d4['push'](_0x3732d4['shift']());}};_0x155edf(++_0x46447d);}(_0x36a5,0x7d));var _0x536a=function(_0x4dd2aa,_0x5037a9){_0x4dd2aa=_0x4dd2aa-0x0;var _0x1b24ad=_0x36a5[_0x4dd2aa];return _0x1b24ad;};'use strict';var _=require(_0x536a('0x0'));var util=require(_0x536a('0x1'));var logger=require(_0x536a('0x2'))(_0x536a('0x3'));var moment=require(_0x536a('0x4'));var BPromise=require(_0x536a('0x5'));var rp=require(_0x536a('0x6'));var fs=require('fs');var path=require(_0x536a('0x7'));var rimraf=require(_0x536a('0x8'));var config=require(_0x536a('0x9'));var attributes=require(_0x536a('0xa'));module['exports']=function(_0x30d282,_0x35ae4b){return _0x30d282['define']('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x536a('0xb'),'fields':[_0x536a('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a82=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x56d5f8,_0x26b8f7){var _0x1afb43=function(_0x217553){while(--_0x217553){_0x56d5f8['push'](_0x56d5f8['shift']());}};_0x1afb43(++_0x26b8f7);}(_0x5a82,0x197));var _0x25a8=function(_0x434660,_0x33aa96){_0x434660=_0x434660-0x0;var _0x26f786=_0x5a82[_0x434660];return _0x26f786;};'use strict';var _=require('lodash');var util=require(_0x25a8('0x0'));var logger=require(_0x25a8('0x1'))(_0x25a8('0x2'));var moment=require(_0x25a8('0x3'));var BPromise=require(_0x25a8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x25a8('0x5'));var config=require(_0x25a8('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0x25a8('0x7')]=function(_0x3cec3e,_0x25c5d4){return _0x3cec3e['define'](_0x25a8('0x8'),attributes,{'tableName':_0x25a8('0x9'),'paranoid':![],'indexes':[{'name':_0x25a8('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 919f83a..9be0dfe 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 _0xd55f=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xd55f,0x149));var _0xfd55=function(_0x925a4f,_0x124a3f){_0x925a4f=_0x925a4f-0x0;var _0x50120a=_0xd55f[_0x925a4f];return _0x50120a;};'use strict';var _=require(_0xfd55('0x0'));var util=require(_0xfd55('0x1'));var moment=require(_0xfd55('0x2'));var BPromise=require(_0xfd55('0x3'));var rs=require(_0xfd55('0x4'));var fs=require('fs');var Redis=require(_0xfd55('0x5'));var db=require(_0xfd55('0x6'))['db'];var utils=require(_0xfd55('0x7'));var logger=require(_0xfd55('0x8'))(_0xfd55('0x9'));var config=require(_0xfd55('0xa'));var jayson=require(_0xfd55('0xb'));var client=jayson[_0xfd55('0xc')][_0xfd55('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x33a879,_0x1a727b,_0xfd4c1){return new BPromise(function(_0x2f5cc8,_0x2537db){return client['request'](_0x33a879,_0xfd4c1)['then'](function(_0x3c5e13){logger[_0xfd55('0xe')](_0xfd55('0xf'),_0x1a727b,_0xfd55('0x10'));logger[_0xfd55('0x11')](_0xfd55('0x12'),_0x1a727b,_0xfd55('0x10'),JSON[_0xfd55('0x13')](_0x3c5e13));if(_0x3c5e13[_0xfd55('0x14')]){if(_0x3c5e13[_0xfd55('0x14')][_0xfd55('0x15')]===0x1f4){logger[_0xfd55('0x14')](_0xfd55('0xf'),_0x1a727b,_0x3c5e13[_0xfd55('0x14')][_0xfd55('0x16')]);return _0x2537db(_0x3c5e13[_0xfd55('0x14')][_0xfd55('0x16')]);}logger[_0xfd55('0x14')](_0xfd55('0xf'),_0x1a727b,_0x3c5e13['error'][_0xfd55('0x16')]);return _0x2f5cc8(_0x3c5e13['error']['message']);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x1a727b,_0xfd55('0x10'));_0x2f5cc8(_0x3c5e13[_0xfd55('0x17')][_0xfd55('0x16')]);}})[_0xfd55('0x18')](function(_0x5ec6fa){logger[_0xfd55('0x14')](_0xfd55('0xf'),_0x1a727b,_0x5ec6fa);_0x2537db(_0x5ec6fa);});});}
\ No newline at end of file
+var _0x3622=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x41640b,_0x112967){var _0x59a6c2=function(_0xdfe556){while(--_0xdfe556){_0x41640b['push'](_0x41640b['shift']());}};_0x59a6c2(++_0x112967);}(_0x3622,0x1a5));var _0x2362=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x3622[_0xc4001c];return _0x49f7bc;};'use strict';var _=require('lodash');var util=require(_0x2362('0x0'));var moment=require(_0x2362('0x1'));var BPromise=require(_0x2362('0x2'));var rs=require(_0x2362('0x3'));var fs=require('fs');var Redis=require(_0x2362('0x4'));var db=require(_0x2362('0x5'))['db'];var utils=require(_0x2362('0x6'));var logger=require(_0x2362('0x7'))('rpc');var config=require(_0x2362('0x8'));var jayson=require(_0x2362('0x9'));var client=jayson[_0x2362('0xa')][_0x2362('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c8aef,_0x59acc4,_0x1381bc){return new BPromise(function(_0x3b11e2,_0x4ada03){return client[_0x2362('0xc')](_0x2c8aef,_0x1381bc)[_0x2362('0xd')](function(_0x4c35d4){logger['info'](_0x2362('0xe'),_0x59acc4,_0x2362('0xf'));logger[_0x2362('0x10')](_0x2362('0x11'),_0x59acc4,'request\x20sent',JSON[_0x2362('0x12')](_0x4c35d4));if(_0x4c35d4[_0x2362('0x13')]){if(_0x4c35d4[_0x2362('0x13')]['code']===0x1f4){logger[_0x2362('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x59acc4,_0x4c35d4['error'][_0x2362('0x14')]);return _0x4ada03(_0x4c35d4['error'][_0x2362('0x14')]);}logger[_0x2362('0x13')](_0x2362('0xe'),_0x59acc4,_0x4c35d4[_0x2362('0x13')]['message']);return _0x3b11e2(_0x4c35d4[_0x2362('0x13')][_0x2362('0x14')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x59acc4,_0x2362('0xf'));_0x3b11e2(_0x4c35d4[_0x2362('0x15')][_0x2362('0x14')]);}})[_0x2362('0x16')](function(_0x3a092e){logger['error'](_0x2362('0xe'),_0x59acc4,_0x3a092e);_0x4ada03(_0x3a092e);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index b8bf205..250fc82 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 _0x41a0=['./chatTransferReport.controller','get','index','/describe','/:id','isAuthenticated','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x41a0,0x123));var _0x041a=function(_0x2efd9a,_0x2bd7d8){_0x2efd9a=_0x2efd9a-0x0;var _0x20c413=_0x41a0[_0x2efd9a];return _0x20c413;};'use strict';var multer=require('multer');var util=require(_0x041a('0x0'));var path=require(_0x041a('0x1'));var timeout=require(_0x041a('0x2'));var express=require(_0x041a('0x3'));var router=express[_0x041a('0x4')]();var fs_extra=require(_0x041a('0x5'));var auth=require(_0x041a('0x6'));var interaction=require(_0x041a('0x7'));var config=require(_0x041a('0x8'));var controller=require(_0x041a('0x9'));router[_0x041a('0xa')]('/',auth['isAuthenticated'](),controller[_0x041a('0xb')]);router['get'](_0x041a('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x041a('0xa')](_0x041a('0xd'),auth[_0x041a('0xe')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x041a('0xf')]);router[_0x041a('0x10')](_0x041a('0xd'),auth[_0x041a('0xe')](),controller[_0x041a('0x11')]);router[_0x041a('0x12')](_0x041a('0xd'),auth[_0x041a('0xe')](),controller['destroy']);module[_0x041a('0x13')]=router;
\ No newline at end of file
+var _0x7c1f=['express','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','/describe','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x541d74,_0x4d8ac1){var _0x1bd9c4=function(_0x34ecf6){while(--_0x34ecf6){_0x541d74['push'](_0x541d74['shift']());}};_0x1bd9c4(++_0x4d8ac1);}(_0x7c1f,0x1b6));var _0xf7c1=function(_0xbdeccb,_0x1716aa){_0xbdeccb=_0xbdeccb-0x0;var _0x1e8ddf=_0x7c1f[_0xbdeccb];return _0x1e8ddf;};'use strict';var multer=require(_0xf7c1('0x0'));var util=require(_0xf7c1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf7c1('0x2'));var router=express['Router']();var fs_extra=require(_0xf7c1('0x3'));var auth=require(_0xf7c1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf7c1('0x5'));var controller=require(_0xf7c1('0x6'));router['get']('/',auth[_0xf7c1('0x7')](),controller[_0xf7c1('0x8')]);router['get'](_0xf7c1('0x9'),auth[_0xf7c1('0x7')](),controller['describe']);router[_0xf7c1('0xa')](_0xf7c1('0xb'),auth[_0xf7c1('0x7')](),controller[_0xf7c1('0xc')]);router[_0xf7c1('0xd')]('/',auth[_0xf7c1('0x7')](),controller[_0xf7c1('0xe')]);router[_0xf7c1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf7c1('0x10')]);router[_0xf7c1('0x11')](_0xf7c1('0xb'),auth[_0xf7c1('0x7')](),controller[_0xf7c1('0x12')]);module[_0xf7c1('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 5236685..6a03917 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 _0x8a2f=['squared','We\x20are\x20here!','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','star','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','BOOLEAN','rounded'];(function(_0x40ff89,_0x22ea0c){var _0x462cab=function(_0x1a7edf){while(--_0x1a7edf){_0x40ff89['push'](_0x40ff89['shift']());}};_0x462cab(++_0x22ea0c);}(_0x8a2f,0xcf));var _0xf8a2=function(_0x3e49cb,_0x429d1f){_0x3e49cb=_0x3e49cb-0x0;var _0x270b16=_0x8a2f[_0x3e49cb];return _0x270b16;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xf8a2('0x0'));module[_0xf8a2('0x1')]={'name':{'type':Sequelize[_0xf8a2('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xf8a2('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf8a2('0x2')],'allowNull':![],'defaultValue':_0xf8a2('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf8a2('0x2')],'allowNull':![],'defaultValue':_0xf8a2('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf8a2('0x2')],'allowNull':![],'defaultValue':_0xf8a2('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xf8a2('0x2')],'allowNull':![],'defaultValue':_0xf8a2('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf8a2('0x2')]},'animation':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xf8a2('0x8'),_0xf8a2('0x9')),'defaultValue':_0xf8a2('0x8')},'header_online':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0xa')},'start_chat_button':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0xb')},'header_offline':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0xc')},'download_transcript':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf8a2('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf8a2('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xf8a2('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x12')},'noteTitle':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x13')},'placeholderMessage':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x14')},'closingMessage':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x15')},'closingMessageButton':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0xb')},'skipMessageButton':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x16')},'conditionAgreement':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xf8a2('0x17')](_0xf8a2('0x18'),'thumb'),'defaultValue':_0xf8a2('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xf8a2('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf8a2('0xf')],'defaultValue':function(){return JSON[_0xf8a2('0x19')]({'items':[{'type':_0xf8a2('0x1a'),'variable':null,'config':{'placeholder':_0xf8a2('0x1b'),'type':_0xf8a2('0x1c'),'required':!![]},'props':{'title':_0xf8a2('0x1b'),'helpText':''}},{'type':_0xf8a2('0x1a'),'props':{'title':_0xf8a2('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xf8a2('0x3'),'type':_0xf8a2('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf8a2('0x1d')](_0xf8a2('0x1e'))?JSON[_0xf8a2('0x1f')](this['getDataValue'](_0xf8a2('0x1e'))):{};},'set':function(_0x425af4){return this['setDataValue'](_0xf8a2('0x1e'),JSON[_0xf8a2('0x19')](_0x425af4));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf8a2('0x1a'),'props':{'title':_0xf8a2('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xf8a2('0x3'),'type':_0xf8a2('0x3')},'variable':null},{'type':_0xf8a2('0x20'),'config':{'placeholder':_0xf8a2('0x21')},'props':{'title':'Comments','helpText':_0xf8a2('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xf8a2('0x1d')](_0xf8a2('0x23'))?JSON[_0xf8a2('0x1f')](this[_0xf8a2('0x1d')](_0xf8a2('0x23'))):{};},'set':function(_0x2ffdf2){return this['setDataValue'](_0xf8a2('0x23'),JSON[_0xf8a2('0x19')](_0x2ffdf2));}},'token':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':function(){return rs[_0xf8a2('0x24')]();}},'autoclose':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf8a2('0x2')]},'forwardOffline':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf8a2('0x2')]},'waitingTitle':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x25')},'waitingMessage':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x28')},'skipUnmanaged':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x16')},'sendUnmanaged':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf8a2('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf8a2('0xf')],'defaultValue':function(){return _0xf8a2('0x29');}},'notificationSound':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf8a2('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x2b')},'verticalAlignment':{'type':Sequelize[_0xf8a2('0xd')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x2c')},'messagesAlignment':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x2d')},'defaultTitle':{'type':Sequelize[_0xf8a2('0x2')]},'customerAvatar':{'type':Sequelize[_0xf8a2('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf8a2('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf8a2('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf8a2('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf8a2('0x2e')},'systemAvatar':{'type':Sequelize[_0xf8a2('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf8a2('0xd')],'comment':_0xf8a2('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf8a2('0x30'),'set':function(_0x4e8d63){if(!_0x4e8d63)this[_0xf8a2('0x31')](_0xf8a2('0x32'),null);this[_0xf8a2('0x31')](_0xf8a2('0x33'),_0x4e8d63);}},'vidaooEscalation':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf8a2('0x34')},'vidaooNote':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':function(){return _0xf8a2('0x35');}},'vidaooMetadata':{'type':Sequelize[_0xf8a2('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf8a2('0xf')]}};
\ No newline at end of file
+var _0xe76d=['textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','CHAT','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','input','name','parse','getDataValue','setDataValue','onlineForm','stringify'];(function(_0x5b959e,_0x2f221a){var _0x4c3e9c=function(_0xb799f1){while(--_0xb799f1){_0x5b959e['push'](_0x5b959e['shift']());}};_0x4c3e9c(++_0x2f221a);}(_0xe76d,0x13a));var _0xde76=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xe76d[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require(_0xde76('0x0'));var rs=require(_0xde76('0x1'));module[_0xde76('0x2')]={'name':{'type':Sequelize[_0xde76('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xde76('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xde76('0x5')},'mapKeyOffline':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x5')},'key':{'type':Sequelize[_0xde76('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x6')},'customerAlias':{'type':Sequelize[_0xde76('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xde76('0x3')],'allowNull':![],'defaultValue':_0xde76('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xde76('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xde76('0x3')],'allowNull':![],'defaultValue':_0xde76('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xde76('0x3')]},'animation':{'type':Sequelize[_0xde76('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xde76('0xa')](_0xde76('0xb'),_0xde76('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0xd')},'start_chat_button':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0xe')},'offline_chat_button':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0xf')},'header_offline':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x10')},'download_transcript':{'type':Sequelize[_0xde76('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xde76('0x11')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x12')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xde76('0x13')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xde76('0x14')},'formSubmitSuccessMessage':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x15')},'formSubmitFailureMessage':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x16')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xde76('0x17')},'placeholderMessage':{'type':Sequelize[_0xde76('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xde76('0x18')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xde76('0xf')},'skipMessageButton':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x19')},'conditionAgreement':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x1a')},'ratingType':{'type':Sequelize[_0xde76('0xa')](_0xde76('0x1b'),_0xde76('0x1c')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xde76('0x11')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xde76('0x13')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xde76('0x1d'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0xde76('0x1e'),'helpText':''}},{'type':_0xde76('0x1d'),'props':{'title':_0xde76('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xde76('0x5'),'type':_0xde76('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0xde76('0x1f')](this[_0xde76('0x20')]('onlineForm')):{};},'set':function(_0x58540b){return this[_0xde76('0x21')](_0xde76('0x22'),JSON[_0xde76('0x23')](_0x58540b));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xde76('0x23')]({'items':[{'type':_0xde76('0x1d'),'props':{'title':_0xde76('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xde76('0x5'),'type':_0xde76('0x5')},'variable':null},{'type':_0xde76('0x24'),'config':{'placeholder':_0xde76('0x25')},'props':{'title':_0xde76('0x25'),'helpText':_0xde76('0x26')}}],'fromKey':0x0});},'get':function(){return this[_0xde76('0x20')](_0xde76('0x27'))?JSON[_0xde76('0x1f')](this[_0xde76('0x20')](_0xde76('0x27'))):{};},'set':function(_0x544029){return this[_0xde76('0x21')](_0xde76('0x27'),JSON['stringify'](_0x544029));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xde76('0x28')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xde76('0x3')]},'forwardOffline':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xde76('0x3')]},'waitingTitle':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x29')},'waitingMessage':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x2a')},'offlineMessageSubject':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x2b')},'offlineMessageBody':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x2c')},'enableUnmanagedNote':{'type':Sequelize[_0xde76('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xde76('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x19')},'sendUnmanaged':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xde76('0x3')]},'notificationTemplate':{'type':Sequelize[_0xde76('0x13')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xde76('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xde76('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xde76('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xde76('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x2d')},'messagesAlignment':{'type':Sequelize[_0xde76('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xde76('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xde76('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xde76('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x2e')},'systemAvatar':{'type':Sequelize[_0xde76('0x13')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xde76('0x11')],'comment':_0xde76('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x105651){if(!_0x105651)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xde76('0x21')](_0xde76('0x30'),_0x105651);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xde76('0x3')]},'vidaooTopic':{'type':Sequelize[_0xde76('0x3')],'allowNull':![],'defaultValue':_0xde76('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xde76('0x13')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 4c85bfa..3652936 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 _0x81bd=['autoclose','close','*,*,*,*','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','ChatQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','ValidationError','no\x20available\x20attributes','difference','CompanyId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','files','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','Smtp','mimetype','subjectOffline','mapValues','offlineMessageSubject','Chat','MailAccountId','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','virtual','custom','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.13.0','headers','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','spread','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','api','../../config/environment','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','redis','defaults','localhost','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','destroy','UserProfileResource','name','send','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','model','device','vendor','%s\x20%s\x20%s','type','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','params','Pause','options','find','create','body','address','forEach','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','getDispositions','findAll','rows','removeDispositions','ids','ChatWebsiteId','CannedAnswer','getAnswers','findOne','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','notify','chat','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','createdAt','includes','updatedAt','ListId','from','CmList','CmContact','Contacts','DESC','ChatApplication','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','priority','asc','list','contact','threadId','closed','externalUrl','ContactId','interaction','ChatInteraction','Writing\x20on\x20closed\x20interaction','messageId','created'];(function(_0x503b03,_0x216a86){var _0x8a53d6=function(_0x85e932){while(--_0x85e932){_0x503b03['push'](_0x503b03['shift']());}};_0x8a53d6(++_0x216a86);}(_0x81bd,0x7c));var _0xd81b=function(_0x427502,_0x4e6214){_0x427502=_0x427502-0x0;var _0x1baeff=_0x81bd[_0x427502];return _0x1baeff;};'use strict';var Mustache=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var path=require(_0xd81b('0x2'));var ejs=require(_0xd81b('0x3'));var fs=require('fs');var fs_extra=require(_0xd81b('0x4'));var _=require(_0xd81b('0x5'));var querystring=require(_0xd81b('0x6'));var htmlToText=require('html-to-text');var Redis=require(_0xd81b('0x7'));var jayson=require(_0xd81b('0x8'));var qs=require(_0xd81b('0x9'));var logger=require('../../config/logger')(_0xd81b('0xa'));var config=require(_0xd81b('0xb'));var APIBadRequestError=require(_0xd81b('0xc'))['APIBadRequestError'];var APINotFoundError=require('../../errors/api')[_0xd81b('0xd')];var APIOutOfIntervalError=require('../../errors/api')[_0xd81b('0xe')];var APIHandleError=require(_0xd81b('0xc'))[_0xd81b('0xf')];var APIConflictError=require(_0xd81b('0xc'))[_0xd81b('0x10')];var wildcardUtils=require(_0xd81b('0x11'));var URL=require(_0xd81b('0x12'))[_0xd81b('0x13')];var db=require(_0xd81b('0x14'))['db'];config[_0xd81b('0x15')]=_[_0xd81b('0x16')](config[_0xd81b('0x15')],{'host':_0xd81b('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd81b('0x15')]));require('./chatWebsite.socket')[_0xd81b('0x18')](socket);var client=jayson[_0xd81b('0x19')]['http']({'port':0x232c});var client9002=jayson[_0xd81b('0x19')]['http']({'port':0x232a});var client9003=jayson[_0xd81b('0x19')][_0xd81b('0x1a')]({'port':0x232b});var client9001=jayson[_0xd81b('0x19')][_0xd81b('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0x128162,_0x552215,_0x1c620d,_0x27b7a0){return new Promise(function(_0x5c2863,_0x2abef4){var _0x26df61=_0x27b7a0||client;return _0x26df61[_0xd81b('0x1b')](_0x128162,_0x1c620d)[_0xd81b('0x1c')](function(_0x5f7db6){logger[_0xd81b('0x1d')](_0xd81b('0x1e'),_0x552215,_0xd81b('0x1f'));logger[_0xd81b('0x20')](_0xd81b('0x21'),_0x552215,_0xd81b('0x1f'),JSON[_0xd81b('0x22')](_0x5f7db6));if(_0x5f7db6[_0xd81b('0x23')]){if(_0x5f7db6[_0xd81b('0x23')][_0xd81b('0x24')]===0x1f4){logger[_0xd81b('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x552215,_0x5f7db6['error'][_0xd81b('0x25')]);return _0x2abef4(_0x5f7db6[_0xd81b('0x23')][_0xd81b('0x25')]);}logger['error'](_0xd81b('0x1e'),_0x552215,_0x5f7db6[_0xd81b('0x23')]['message']);return _0x5c2863(_0x5f7db6[_0xd81b('0x23')][_0xd81b('0x25')]);}else{logger[_0xd81b('0x1d')](_0xd81b('0x1e'),_0x552215,_0xd81b('0x1f'));_0x5c2863(_0x5f7db6[_0xd81b('0x26')][_0xd81b('0x25')]);}})[_0xd81b('0x27')](function(_0x341aec){logger[_0xd81b('0x23')](_0xd81b('0x1e'),_0x552215,_0x341aec);_0x2abef4(_0x341aec);});});}function respondWithStatusCode(_0x1bf351,_0x596389){_0x596389=_0x596389||0xcc;return function(_0x28768f){if(_0x28768f){return _0x1bf351[_0xd81b('0x28')](_0x596389);}return _0x1bf351[_0xd81b('0x29')](_0x596389)[_0xd81b('0x2a')]();};}function respondWithResult(_0x3266c2,_0x2d0d02){_0x2d0d02=_0x2d0d02||0xc8;return function(_0x3e28dd){if(_0x3e28dd){return _0x3266c2[_0xd81b('0x29')](_0x2d0d02)[_0xd81b('0x2b')](_0x3e28dd);}};}function respondWithFilteredResult(_0x483a3d,_0x469cc4){return function(_0x4e2eff){if(_0x4e2eff){var _0x5c8aee=typeof _0x469cc4[_0xd81b('0x2c')]===_0xd81b('0x2d')&&typeof _0x469cc4['limit']==='undefined';var _0x4093c8=_0x4e2eff[_0xd81b('0x2e')];var _0x1b1434=_0x5c8aee?0x0:_0x469cc4[_0xd81b('0x2c')];var _0x1a1572=_0x5c8aee?_0x4e2eff[_0xd81b('0x2e')]:_0x469cc4['offset']+_0x469cc4[_0xd81b('0x2f')];var _0x26f629;if(_0x1a1572>=_0x4093c8){_0x1a1572=_0x4093c8;_0x26f629=0xc8;}else{_0x26f629=0xce;}_0x483a3d['status'](_0x26f629);return _0x483a3d['set'](_0xd81b('0x30'),_0x1b1434+'-'+_0x1a1572+'/'+_0x4093c8)[_0xd81b('0x2b')](_0x4e2eff);}return null;};}function saveUpdates(_0x50472a){return function(_0x50ce25){if(_0x50ce25){return _0x50ce25['update'](_0x50472a)[_0xd81b('0x1c')](function(_0x3ead68){return _0x3ead68;});}return null;};}function removeEntity(_0x1d2f46){return function(_0x1c4cf7){if(_0x1c4cf7){return _0x1c4cf7[_0xd81b('0x31')]()[_0xd81b('0x1c')](function(){var _0x29aabf=_0x1c4cf7['get']({'plain':!![]});var _0x28782f='ChatWebsites';return db[_0xd81b('0x32')][_0xd81b('0x31')]({'where':{'type':_0x28782f,'resourceId':_0x29aabf['id']}})[_0xd81b('0x1c')](function(){return _0x1c4cf7;});})[_0xd81b('0x1c')](function(){_0x1d2f46[_0xd81b('0x29')](0xcc)[_0xd81b('0x2a')]();});}};}function handleEntityNotFound(_0x1c20d3){return function(_0x2d23b9){if(!_0x2d23b9){_0x1c20d3[_0xd81b('0x28')](0x194);}return _0x2d23b9;};}function handleError(_0xe88a33,_0x1be4e2){_0x1be4e2=_0x1be4e2||0x1f4;return function(_0x3c8371){logger[_0xd81b('0x23')](_0x3c8371['stack']);if(_0x3c8371['name']){delete _0x3c8371[_0xd81b('0x33')];}_0xe88a33[_0xd81b('0x29')](_0x1be4e2)[_0xd81b('0x34')](_0x3c8371);};}function createInteractionObject(_0x59c066,_0x362ebc,_0x37ba34,_0x5a236a){var _0x46f058=require(_0xd81b('0x35'));var _0x512e39=new _0x46f058();var _0xed5272=_0x512e39['setUA'](_0x37ba34[_0xd81b('0x36')])[_0xd81b('0x37')]();var _0x203365=_0x362ebc[_0xd81b('0x38')];if(_0x37ba34['cf-connecting-ip']){_0x203365=_0x37ba34[_0xd81b('0x39')];}else if(_0x37ba34[_0xd81b('0x3a')]){_0x203365=_[_0xd81b('0x3b')](_0x37ba34[_0xd81b('0x3a')][_0xd81b('0x3c')](','));}return{'ContactId':_0x5a236a['id'],'ChatWebsiteId':_0x59c066,'from':(_0x5a236a[_0xd81b('0x3d')]||'')+'\x20'+(_0x5a236a[_0xd81b('0x3e')]||''),'customerIp':_0x203365,'customerPort':_0x37ba34['x-real-port']?_0x37ba34[_0xd81b('0x3f')]:null,'referer':_0x362ebc[_0xd81b('0x40')],'browserName':_0xed5272[_0xd81b('0x41')]['name']&&_0xed5272[_0xd81b('0x41')][_0xd81b('0x42')]?util[_0xd81b('0x43')](_0xd81b('0x44'),_0xed5272[_0xd81b('0x41')]['name'],_0xed5272[_0xd81b('0x41')][_0xd81b('0x42')]):_0xd81b('0x45'),'browserVersion':_0xed5272[_0xd81b('0x41')][_0xd81b('0x42')]||_0xd81b('0x45'),'osName':util[_0xd81b('0x43')](_0xd81b('0x44'),_0xed5272['os'][_0xd81b('0x33')],_0xed5272['os'][_0xd81b('0x42')]),'osVersion':_0xed5272['os'][_0xd81b('0x42')],'deviceModel':_0xed5272['device'][_0xd81b('0x46')]&&_0xed5272[_0xd81b('0x47')][_0xd81b('0x48')]?util[_0xd81b('0x43')](_0xd81b('0x49'),_0xed5272[_0xd81b('0x47')][_0xd81b('0x46')],_0xed5272[_0xd81b('0x47')]['vendor'],_0xed5272['device'][_0xd81b('0x4a')]):null,'deviceVendor':_0xed5272[_0xd81b('0x47')][_0xd81b('0x48')],'deviceType':_0xed5272[_0xd81b('0x47')][_0xd81b('0x4a')],'formData':JSON[_0xd81b('0x22')](_0x362ebc)};}exports[_0xd81b('0x4b')]=function(_0x2e44f3,_0x2fa588){var _0xcfbbc2={'include':[{'model':db['Pause'],'as':_0xd81b('0x4c')}]},_0x41e2e6={},_0x38e436={'count':0x0,'rows':[]};var _0x2b61fc=_[_0xd81b('0x4d')](db[_0xd81b('0x4e')][_0xd81b('0x4f')],function(_0x410ef3){return{'name':_0x410ef3[_0xd81b('0x50')],'type':_0x410ef3[_0xd81b('0x4a')][_0xd81b('0x51')]};});_0x41e2e6['model']=_[_0xd81b('0x4d')](_0x2b61fc,_0xd81b('0x33'));_0x41e2e6[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0x2e44f3['query']);_0x41e2e6[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x41e2e6[_0xd81b('0x46')],_0x41e2e6[_0xd81b('0x52')]);_0xcfbbc2[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x41e2e6[_0xd81b('0x46')],qs[_0xd81b('0x57')](_0x2e44f3[_0xd81b('0x52')]['fields']));_0xcfbbc2['attributes']=_0xcfbbc2[_0xd81b('0x56')][_0xd81b('0x58')]?_0xcfbbc2[_0xd81b('0x56')]:_0x41e2e6[_0xd81b('0x46')];if(!_0x2e44f3[_0xd81b('0x52')][_0xd81b('0x59')](_0xd81b('0x5a'))){_0xcfbbc2[_0xd81b('0x2f')]=qs['limit'](_0x2e44f3[_0xd81b('0x52')][_0xd81b('0x2f')]);_0xcfbbc2[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0x2e44f3[_0xd81b('0x52')]['offset']);}_0xcfbbc2[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x2e44f3['query'][_0xd81b('0x5c')]);_0xcfbbc2[_0xd81b('0x5d')]=qs[_0xd81b('0x54')](_[_0xd81b('0x5e')](_0x2e44f3[_0xd81b('0x52')],_0x41e2e6[_0xd81b('0x54')]),_0x2b61fc);if(_0x2e44f3[_0xd81b('0x52')][_0xd81b('0x5f')]){_0xcfbbc2[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0xcfbbc2[_0xd81b('0x5d')],{'$or':_['map'](_0x2b61fc,function(_0x285e82){if(_0x285e82['type']!==_0xd81b('0x61')){var _0x7b438c={};_0x7b438c[_0x285e82[_0xd81b('0x33')]]={'$like':'%'+_0x2e44f3[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x7b438c;}})});}_0xcfbbc2=_[_0xd81b('0x60')]({},_0xcfbbc2,_0x2e44f3['options']);var _0x2d978d={'where':_0xcfbbc2[_0xd81b('0x5d')]};return db['ChatWebsite']['count'](_0x2d978d)[_0xd81b('0x1c')](function(_0x59e018){_0x38e436[_0xd81b('0x2e')]=_0x59e018;if(_0x2e44f3['query'][_0xd81b('0x62')]){_0xcfbbc2[_0xd81b('0x63')]=[{'all':!![]}];}return db[_0xd81b('0x4e')]['findAll'](_0xcfbbc2);})[_0xd81b('0x1c')](function(_0x10ed99){_0x38e436['rows']=_0x10ed99;return _0x38e436;})[_0xd81b('0x1c')](respondWithFilteredResult(_0x2fa588,_0xcfbbc2))[_0xd81b('0x27')](handleError(_0x2fa588,null));};exports['show']=function(_0x1ba5d6,_0x5e1cd7){var _0x3c9264={'raw':![],'where':{'id':_0x1ba5d6[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0x65')],'as':_0xd81b('0x4c')}]},_0x31553e={};_0x31553e[_0xd81b('0x46')]=_[_0xd81b('0x53')](db[_0xd81b('0x4e')][_0xd81b('0x4f')]);_0x31553e[_0xd81b('0x52')]=_['keys'](_0x1ba5d6[_0xd81b('0x52')]);_0x31553e[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x31553e[_0xd81b('0x46')],_0x31553e[_0xd81b('0x52')]);_0x3c9264[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x31553e['model'],qs['fields'](_0x1ba5d6['query'][_0xd81b('0x57')]));_0x3c9264[_0xd81b('0x56')]=_0x3c9264[_0xd81b('0x56')][_0xd81b('0x58')]?_0x3c9264[_0xd81b('0x56')]:_0x31553e[_0xd81b('0x46')];if(_0x1ba5d6[_0xd81b('0x52')]['includeAll']){_0x3c9264[_0xd81b('0x63')]=[{'all':!![]}];}_0x3c9264=_[_0xd81b('0x60')]({},_0x3c9264,_0x1ba5d6[_0xd81b('0x66')]);return db[_0xd81b('0x4e')][_0xd81b('0x67')](_0x3c9264)[_0xd81b('0x1c')](handleEntityNotFound(_0x5e1cd7,null))[_0xd81b('0x1c')](respondWithResult(_0x5e1cd7,null))['catch'](handleError(_0x5e1cd7,null));};exports[_0xd81b('0x68')]=function(_0x15f003,_0x12b2a7){var _0x8cf25d=null;_0x15f003[_0xd81b('0x69')][_0xd81b('0x6a')][_0xd81b('0x3c')](',')[_0xd81b('0x6b')](_0x8fa8cd=>{if(_0x8fa8cd[_0xd81b('0x6c')]()!==''&&!wildcardUtils[_0xd81b('0x6d')](_0x8fa8cd[_0xd81b('0x6c')]())){_0x8cf25d=new APIBadRequestError('\x22'+_0x8fa8cd['trim']()+_0xd81b('0x6e'));}});if(_0x8cf25d){return handleError(_0x12b2a7,null)(_0x8cf25d);}return db['ChatWebsite'][_0xd81b('0x68')](_0x15f003[_0xd81b('0x69')],{})[_0xd81b('0x1c')](function(_0xc3c117){var _0xb94a69=_0x15f003[_0xd81b('0x6f')][_0xd81b('0x70')]({'plain':!![]});if(!_0xb94a69)throw new Error(_0xd81b('0x71'));if(_0xb94a69[_0xd81b('0x72')]===_0xd81b('0x6f')){var _0x5bcfd7=_0xc3c117[_0xd81b('0x70')]({'plain':!![]});var _0x344c32=_0xd81b('0x73');return db[_0xd81b('0x74')][_0xd81b('0x67')]({'where':{'name':_0x344c32,'userProfileId':_0xb94a69['userProfileId']},'raw':!![]})['then'](function(_0x3274d2){if(_0x3274d2&&_0x3274d2[_0xd81b('0x75')]===0x0){return db[_0xd81b('0x32')][_0xd81b('0x68')]({'name':_0x5bcfd7[_0xd81b('0x33')],'resourceId':_0x5bcfd7['id'],'type':_0x3274d2[_0xd81b('0x33')],'sectionId':_0x3274d2['id']},{})[_0xd81b('0x1c')](function(){return _0xc3c117;});}else{return _0xc3c117;}})['catch'](function(_0x2190df){logger[_0xd81b('0x23')](_0xd81b('0x76'),_0x2190df);throw _0x2190df;});}return _0xc3c117;})[_0xd81b('0x1c')](respondWithResult(_0x12b2a7,0xc9))[_0xd81b('0x27')](handleError(_0x12b2a7,null));};exports[_0xd81b('0x77')]=function(_0x1e0da3,_0x185f28){var _0x2315db=null;_0x1e0da3['body'][_0xd81b('0x6a')][_0xd81b('0x3c')](',')[_0xd81b('0x6b')](_0x9c30e7=>{if(_0x9c30e7[_0xd81b('0x6c')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x9c30e7[_0xd81b('0x6c')]())){_0x2315db=new APIBadRequestError('\x22'+_0x9c30e7[_0xd81b('0x6c')]()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x2315db){return handleError(_0x185f28,null)(_0x2315db);}if(_0x1e0da3[_0xd81b('0x69')]['id']){delete _0x1e0da3[_0xd81b('0x69')]['id'];}return db['ChatWebsite'][_0xd81b('0x67')]({'where':{'id':_0x1e0da3[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0x65')],'as':'mandatoryDispositionPause'}]})[_0xd81b('0x1c')](handleEntityNotFound(_0x185f28,null))[_0xd81b('0x1c')](saveUpdates(_0x1e0da3[_0xd81b('0x69')],null))['then'](respondWithResult(_0x185f28,null))['catch'](handleError(_0x185f28,null));};exports[_0xd81b('0x31')]=function(_0x950cc3,_0x36c694){return db['ChatWebsite'][_0xd81b('0x67')]({'where':{'id':_0x950cc3[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x36c694,null))[_0xd81b('0x1c')](removeEntity(_0x36c694,null))['catch'](handleError(_0x36c694,null));};exports['describe']=function(_0x42ae01,_0x256696){return db[_0xd81b('0x4e')][_0xd81b('0x78')]()['then'](respondWithResult(_0x256696,null))[_0xd81b('0x27')](handleError(_0x256696,null));};exports[_0xd81b('0x79')]=function(_0x4b8294,_0x46e36b){if(_0x4b8294['body']['id']){delete _0x4b8294[_0xd81b('0x69')]['id'];}return db[_0xd81b('0x4e')]['find']({'where':{'id':_0x4b8294[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x46e36b,null))[_0xd81b('0x1c')](function(_0x2490f1){if(_0x2490f1){_0x4b8294[_0xd81b('0x69')]['ChatWebsiteId']=_0x2490f1['id'];return db[_0xd81b('0x7a')][_0xd81b('0x68')](_0x4b8294[_0xd81b('0x69')]);}})[_0xd81b('0x1c')](respondWithResult(_0x46e36b,null))[_0xd81b('0x27')](handleError(_0x46e36b,null));};exports[_0xd81b('0x7b')]=function(_0x579052,_0x5c8ea0){var _0x31509d={'raw':![],'where':{}};var _0x3023d9={};var _0x97bd3e={'count':0x0,'rows':[]};return db[_0xd81b('0x4e')]['findOne']({'where':{'id':_0x579052[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x5c8ea0,null))[_0xd81b('0x1c')](function(_0x195f1c){if(_0x195f1c){_0x3023d9[_0xd81b('0x46')]=_['keys'](db[_0xd81b('0x7a')][_0xd81b('0x4f')]);_0x3023d9[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0x579052[_0xd81b('0x52')]);_0x3023d9[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x3023d9['model'],_0x3023d9[_0xd81b('0x52')]);_0x31509d[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x3023d9[_0xd81b('0x46')],qs[_0xd81b('0x57')](_0x579052[_0xd81b('0x52')]['fields']));_0x31509d[_0xd81b('0x56')]=_0x31509d['attributes'][_0xd81b('0x58')]?_0x31509d[_0xd81b('0x56')]:_0x3023d9[_0xd81b('0x46')];if(!_0x579052['query'][_0xd81b('0x59')](_0xd81b('0x5a'))){_0x31509d[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x579052[_0xd81b('0x52')][_0xd81b('0x2f')]);_0x31509d['offset']=qs[_0xd81b('0x2c')](_0x579052['query']['offset']);}_0x31509d[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x579052[_0xd81b('0x52')]['sort']);_0x31509d[_0xd81b('0x5d')]=qs[_0xd81b('0x54')](_[_0xd81b('0x5e')](_0x579052[_0xd81b('0x52')],_0x3023d9[_0xd81b('0x54')]));_0x31509d[_0xd81b('0x5d')]['ChatWebsiteId']=_0x195f1c['id'];if(_0x579052[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x31509d[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x31509d[_0xd81b('0x5d')],{'$or':_[_0xd81b('0x4d')](_0x31509d[_0xd81b('0x56')],function(_0x270d82){var _0x380951={};_0x380951[_0x270d82]={'$like':'%'+_0x579052[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x380951;})});}_0x31509d=_[_0xd81b('0x60')]({},_0x31509d,_0x579052[_0xd81b('0x66')]);return db[_0xd81b('0x7a')][_0xd81b('0x2e')]({'where':_0x31509d['where']})[_0xd81b('0x1c')](function(_0x47f90e){_0x97bd3e[_0xd81b('0x2e')]=_0x47f90e;if(_0x579052[_0xd81b('0x52')][_0xd81b('0x62')]){_0x31509d[_0xd81b('0x63')]=[{'all':!![]}];}return db[_0xd81b('0x7a')][_0xd81b('0x7c')](_0x31509d);})['then'](function(_0x3a41e6){_0x97bd3e[_0xd81b('0x7d')]=_0x3a41e6;return _0x97bd3e;});}})[_0xd81b('0x1c')](respondWithFilteredResult(_0x5c8ea0,_0x31509d))[_0xd81b('0x27')](handleError(_0x5c8ea0,null));};exports[_0xd81b('0x7e')]=function(_0x6e4c25,_0x2481e9){return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x6e4c25[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x2481e9,null))[_0xd81b('0x1c')](function(_0x5a02f7){if(_0x5a02f7){return _0x5a02f7[_0xd81b('0x7e')](_0x6e4c25[_0xd81b('0x52')][_0xd81b('0x7f')]);}})[_0xd81b('0x1c')](respondWithStatusCode(_0x2481e9,null))[_0xd81b('0x27')](handleError(_0x2481e9,null));};exports['addAnswer']=function(_0x421c2b,_0x1e61d8){if(_0x421c2b[_0xd81b('0x69')]['id']){delete _0x421c2b[_0xd81b('0x69')]['id'];}return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x421c2b['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x1e61d8,null))['then'](function(_0x4461f3){if(_0x4461f3){_0x421c2b[_0xd81b('0x69')][_0xd81b('0x80')]=_0x4461f3['id'];return db[_0xd81b('0x81')]['create'](_0x421c2b[_0xd81b('0x69')]);}})[_0xd81b('0x1c')](respondWithResult(_0x1e61d8,null))['catch'](handleError(_0x1e61d8,null));};exports[_0xd81b('0x82')]=function(_0x142d78,_0x2c1a0e){var _0x1c6291={'raw':![],'where':{}};var _0x2f9a9f={};var _0x4c8925={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd81b('0x83')]({'where':{'id':_0x142d78['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x2c1a0e,null))['then'](function(_0x509001){if(_0x509001){_0x2f9a9f[_0xd81b('0x46')]=_[_0xd81b('0x53')](db['CannedAnswer']['rawAttributes']);_0x2f9a9f[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0x142d78['query']);_0x2f9a9f[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x2f9a9f[_0xd81b('0x46')],_0x2f9a9f[_0xd81b('0x52')]);_0x1c6291['attributes']=_[_0xd81b('0x55')](_0x2f9a9f[_0xd81b('0x46')],qs[_0xd81b('0x57')](_0x142d78['query']['fields']));_0x1c6291[_0xd81b('0x56')]=_0x1c6291[_0xd81b('0x56')][_0xd81b('0x58')]?_0x1c6291[_0xd81b('0x56')]:_0x2f9a9f[_0xd81b('0x46')];if(!_0x142d78['query']['hasOwnProperty'](_0xd81b('0x5a'))){_0x1c6291[_0xd81b('0x2f')]=qs['limit'](_0x142d78['query'][_0xd81b('0x2f')]);_0x1c6291[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0x142d78[_0xd81b('0x52')][_0xd81b('0x2c')]);}_0x1c6291[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x142d78[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x1c6291[_0xd81b('0x5d')]=qs['filters'](_['pick'](_0x142d78[_0xd81b('0x52')],_0x2f9a9f[_0xd81b('0x54')]));_0x1c6291[_0xd81b('0x5d')][_0xd81b('0x80')]=_0x509001['id'];if(_0x142d78[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x1c6291[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x1c6291[_0xd81b('0x5d')],{'$or':_[_0xd81b('0x4d')](_0x1c6291[_0xd81b('0x56')],function(_0x32e484){var _0x30fb62={};_0x30fb62[_0x32e484]={'$like':'%'+_0x142d78[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x30fb62;})});}_0x1c6291=_['merge']({},_0x1c6291,_0x142d78[_0xd81b('0x66')]);return db[_0xd81b('0x81')][_0xd81b('0x2e')]({'where':_0x1c6291['where']})[_0xd81b('0x1c')](function(_0x3bd28c){_0x4c8925[_0xd81b('0x2e')]=_0x3bd28c;if(_0x142d78[_0xd81b('0x52')][_0xd81b('0x62')]){_0x1c6291['include']=[{'all':!![]}];}return db[_0xd81b('0x81')][_0xd81b('0x7c')](_0x1c6291);})[_0xd81b('0x1c')](function(_0x30fe56){_0x4c8925[_0xd81b('0x7d')]=_0x30fe56;return _0x4c8925;});}})[_0xd81b('0x1c')](respondWithFilteredResult(_0x2c1a0e,_0x1c6291))[_0xd81b('0x27')](handleError(_0x2c1a0e,null));};exports[_0xd81b('0x84')]=function(_0x1c3ea4,_0x282e83){return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x1c3ea4['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x282e83,null))[_0xd81b('0x1c')](function(_0x15d52d){if(_0x15d52d){return _0x15d52d['removeAnswers'](_0x1c3ea4[_0xd81b('0x52')][_0xd81b('0x7f')]);}})[_0xd81b('0x1c')](respondWithStatusCode(_0x282e83,null))[_0xd81b('0x27')](handleError(_0x282e83,null));};exports['addLogo']=function(_0x1e5f94,_0x4e037b){_0x1e5f94['body'][_0xd81b('0x85')]=_0x1e5f94[_0xd81b('0x86')][_0xd81b('0x87')];return db[_0xd81b('0x4e')]['find']({'where':{'id':_0x1e5f94['params']['id']}})['then'](handleEntityNotFound(_0x4e037b,null))[_0xd81b('0x1c')](saveUpdates(_0x1e5f94[_0xd81b('0x69')],null))[_0xd81b('0x1c')](respondWithResult(_0x4e037b,null))[_0xd81b('0x27')](handleError(_0x4e037b,null));};exports[_0xd81b('0x88')]=function(_0x36611b,_0x368fc6){_0x36611b[_0xd81b('0x69')][_0xd81b('0x89')]=_0x36611b[_0xd81b('0x86')][_0xd81b('0x87')];return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x36611b[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x368fc6,null))[_0xd81b('0x1c')](saveUpdates(_0x36611b[_0xd81b('0x69')],null))[_0xd81b('0x1c')](respondWithResult(_0x368fc6,null))[_0xd81b('0x27')](handleError(_0x368fc6,null));};exports[_0xd81b('0x8a')]=function(_0x4c6848,_0x1162c0){_0x4c6848[_0xd81b('0x69')][_0xd81b('0x8b')]=_0x4c6848[_0xd81b('0x86')][_0xd81b('0x87')];return db['ChatWebsite'][_0xd81b('0x67')]({'where':{'id':_0x4c6848[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x1162c0,null))[_0xd81b('0x1c')](saveUpdates(_0x4c6848[_0xd81b('0x69')],null))[_0xd81b('0x1c')](respondWithResult(_0x1162c0,null))[_0xd81b('0x27')](handleError(_0x1162c0,null));};exports[_0xd81b('0x8c')]=function(_0x11b49d,_0x22e808){_0x11b49d[_0xd81b('0x69')][_0xd81b('0x8d')]=_0x11b49d[_0xd81b('0x86')][_0xd81b('0x87')];return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x11b49d[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x22e808,null))[_0xd81b('0x1c')](saveUpdates(_0x11b49d['body'],null))[_0xd81b('0x1c')](respondWithResult(_0x22e808,null))[_0xd81b('0x27')](handleError(_0x22e808,null));};exports[_0xd81b('0x8e')]=function(_0x478b92,_0xf13081){var _0x3069d1=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/logos/default_logo.svg');var _0x2a6dcb={'where':{'id':_0x478b92[_0xd81b('0x64')]['id']},'attributes':['id',_0xd81b('0x85')],'raw':!![]};var _0xf2e1b5=![];return require(_0xd81b('0x91'))[_0xd81b('0x92')]()[_0xd81b('0x1c')](function(_0x55384e){if(_0x55384e){_0xf2e1b5=_0x55384e['custom'];}})[_0xd81b('0x1c')](function(){return db[_0xd81b('0x4e')][_0xd81b('0x67')](_0x2a6dcb);})['then'](handleEntityNotFound(_0xf13081,null))[_0xd81b('0x1c')](function(_0x5189b8){if(_0x5189b8){if(!_[_0xd81b('0x93')](_0x5189b8[_0xd81b('0x85')])){if(fs[_0xd81b('0x94')](path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x95'),_0x5189b8[_0xd81b('0x85')]))&&_0xf2e1b5){_0x3069d1=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/logos/',_0x5189b8[_0xd81b('0x85')]);}}return _0xf13081[_0xd81b('0x96')](_0x3069d1);}})[_0xd81b('0x27')](handleError(_0xf13081,null));};exports['getAvatar']=function(_0x4b2b45,_0x4d44d7){var _0x3c5ea6=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x97'));var _0x175d02={'where':{'id':_0x4b2b45[_0xd81b('0x64')]['id']},'attributes':['id',_0xd81b('0x89')],'raw':!![]};return db['ChatWebsite'][_0xd81b('0x67')](_0x175d02)[_0xd81b('0x1c')](handleEntityNotFound(_0x4d44d7,null))[_0xd81b('0x1c')](function(_0x361d5a){if(_0x361d5a){if(!_['isNil'](_0x361d5a[_0xd81b('0x89')])){if(fs['existsSync'](path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x98'),_0x361d5a['agentAvatar']))){_0x3c5ea6=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/avatars/',_0x361d5a[_0xd81b('0x89')]);}}return _0x4d44d7['download'](_0x3c5ea6);}})[_0xd81b('0x27')](handleError(_0x4d44d7,null));};exports[_0xd81b('0x99')]=function(_0x10449f,_0x539668){var _0x277379=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x9a'));var _0x1e2612={'where':{'id':_0x10449f[_0xd81b('0x64')]['id']},'attributes':['id','customerAvatar',_0xd81b('0x9b')],'raw':!![]};return db[_0xd81b('0x4e')][_0xd81b('0x67')](_0x1e2612)['then'](handleEntityNotFound(_0x539668,null))[_0xd81b('0x1c')](function(_0xc9bdfe){if(_0xc9bdfe){if(!_[_0xd81b('0x93')](_0xc9bdfe[_0xd81b('0x8b')])){if(fs[_0xd81b('0x94')](path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/avatars/',_0xc9bdfe['customerAvatar']))&&_0xc9bdfe['showCustomerAvatar']){_0x277379=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/avatars/',_0xc9bdfe[_0xd81b('0x8b')]);}}return _0x539668['download'](_0x277379);}})['catch'](handleError(_0x539668,null));};exports[_0xd81b('0x9c')]=function(_0x397d26,_0x335713){var _0x1b18ef=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x9d'));var _0x13e25f={'where':{'id':_0x397d26[_0xd81b('0x64')]['id']},'attributes':['id',_0xd81b('0x8d')],'raw':!![]};return db[_0xd81b('0x4e')][_0xd81b('0x67')](_0x13e25f)[_0xd81b('0x1c')](handleEntityNotFound(_0x335713,null))[_0xd81b('0x1c')](function(_0x4283bd){if(_0x4283bd){if(!_['isNil'](_0x4283bd[_0xd81b('0x8d')])){if(fs[_0xd81b('0x94')](path['join'](config[_0xd81b('0x90')],'server/files/images/avatars/',_0x4283bd[_0xd81b('0x8d')]))){_0x1b18ef=path['join'](config[_0xd81b('0x90')],_0xd81b('0x98'),_0x4283bd[_0xd81b('0x8d')]);}}return _0x335713[_0xd81b('0x96')](_0x1b18ef);}})[_0xd81b('0x27')](handleError(_0x335713,null));};function checkWebsiteInterval(_0x2164d4){var _0x7e3d22=_0x2164d4[_0xd81b('0x9e')];if(!_0x7e3d22){return Promise[_0xd81b('0x9f')](_0x2164d4);}var _0x1b0156=_0x2164d4[_0xd81b('0xa0')]||undefined;return _0x7e3d22[_0xd81b('0xa1')](_0x1b0156)['then'](function(_0x8cda4b){if(!_0x8cda4b){throw new APIOutOfIntervalError();}return _0x2164d4;});}exports[_0xd81b('0xa2')]=function(_0x22dd20,_0x2ea321){var _0x305014={'body':_0x22dd20[_0xd81b('0x69')],'channel':_0xd81b('0xa3')};var _0x10382d=[];var _0x282942=[];var _0x24a88b={};var _0x48e6ba=![];if(_0x22dd20[_0xd81b('0x69')]['id']){delete _0x22dd20[_0xd81b('0x69')]['id'];}if(_['isNil'](_0x22dd20[_0xd81b('0x69')]['from'])){throw new APIBadRequestError(_0xd81b('0xa4'));}if(_[_0xd81b('0x93')](_0x22dd20['body'][_0xd81b('0xa5')])){throw new APIBadRequestError(_0xd81b('0xa6'));}if(_[_0xd81b('0xa7')](_0x22dd20[_0xd81b('0x69')]['body'])){throw new APIBadRequestError(_0xd81b('0xa8'));}var _0x3a248d=_0x22dd20[_0xd81b('0x69')][_0xd81b('0x38')]&&_0x22dd20[_0xd81b('0x69')][_0xd81b('0x40')];return db['CmContact'][_0xd81b('0x78')]()[_0xd81b('0x1c')](function(_0x14a219){if(!_0x14a219){throw new Error('No\x20available\x20attributes');}_0x10382d=Object['keys'](_0x14a219)[_0xd81b('0x5f')](function(_0x322771){return![_0xd81b('0xa9'),'updatedAt'][_0xd81b('0xaa')](_0x322771);});_0x282942=Object[_0xd81b('0x53')](_0x14a219)[_0xd81b('0x5f')](function(_0x4719f3){return![_0xd81b('0xa9'),_0xd81b('0xab'),'CompanyId',_0xd81b('0xac')][_0xd81b('0xaa')](_0x4719f3);});if(!_['includes'](_0x282942,_0x22dd20[_0xd81b('0x69')][_0xd81b('0xa5')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x282942[_0xd81b('0x8f')](',\x20'));}_0x24a88b[_0x22dd20[_0xd81b('0x69')][_0xd81b('0xa5')]]=_0x22dd20[_0xd81b('0x69')][_0xd81b('0xad')];})[_0xd81b('0x1c')](function(){return db[_0xd81b('0x4e')]['find']({'where':{'id':_0x22dd20[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0xae')],'as':'List','include':[{'model':db[_0xd81b('0xaf')],'as':_0xd81b('0xb0'),'where':_0x24a88b,'limit':0x1,'order':[['updatedAt',_0xd81b('0xb1')]]}]},{'model':db[_0xd81b('0xb2')],'as':_0xd81b('0xb3')},{'model':db[_0xd81b('0x9e')],'as':_0xd81b('0x9e'),'include':[{'model':db['Interval'],'as':_0xd81b('0xb4'),'attributes':['id',_0xd81b('0xb5')],'raw':!![]}]}]});})[_0xd81b('0x1c')](function(_0x9658e){if(!_0x9658e){throw new APINotFoundError(util[_0xd81b('0x43')](_0xd81b('0xb6'),_0x22dd20[_0xd81b('0x64')]['id']));}if(_0x3a248d){return checkWebsiteInterval(_0x9658e);}return _0x9658e;})[_0xd81b('0x1c')](function(_0x44d405){_0x305014[_0xd81b('0xb7')]=_0x44d405;_0x305014[_0xd81b('0xb8')]=_['orderBy'](_0x44d405['Applications'],[_0xd81b('0xb9')],[_0xd81b('0xba')]);if(_0x305014[_0xd81b('0xb7')]['Applications']){delete _0x305014[_0xd81b('0xb7')][_0xd81b('0xb3')];}_0x305014[_0xd81b('0xbb')]=_0x44d405['List']||{'id':_0x44d405[_0xd81b('0xac')]};if(_0x305014[_0xd81b('0xbb')]&&_0x305014['list'][_0xd81b('0xb0')][_0xd81b('0x58')]){return _0x305014[_0xd81b('0xbb')][_0xd81b('0xb0')][0x0];}var _0x8026d7=_[_0xd81b('0x16')](_0x22dd20[_0xd81b('0x69')],{'firstName':_0x22dd20['body'][_0xd81b('0xad')],'ListId':_0x44d405[_0xd81b('0xac')]});_0x8026d7[_0x22dd20['body'][_0xd81b('0xa5')]]=_0x22dd20['body'][_0xd81b('0xad')];return db[_0xd81b('0xaf')][_0xd81b('0x68')](_0x8026d7,{'fields':_0x10382d,'raw':!![]});})[_0xd81b('0x1c')](function(_0x3a6e15){_0x305014[_0xd81b('0xbc')]=_0x3a6e15;var _0x87b315=createInteractionObject(_0x22dd20['params']['id'],_0x22dd20[_0xd81b('0x69')],_0x22dd20['headers'],_0x3a6e15);var _0x48073b={'ChatWebsiteId':_0x22dd20[_0xd81b('0x64')]['id']};if(_0x22dd20['body'][_0xd81b('0xbd')]){_0x48073b[_0xd81b('0xbd')]=_0x22dd20[_0xd81b('0x69')][_0xd81b('0xbd')];_0x48073b['closed']=![];return db['ChatInteraction'][_0xd81b('0x67')]({'where':_0x48073b})[_0xd81b('0x1c')](function(_0x50529b){var _0x2ec729=_0x22dd20[_0xd81b('0x69')][_0xd81b('0x38')]&&_0x22dd20['body'][_0xd81b('0x40')];if(_0x50529b){_0x48e6ba=!![];return _0x50529b;}else if(!_0x2ec729&&_0x50529b&&_0x50529b[_0xd81b('0xbe')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x87b315[_0xd81b('0xbd')]=_0x22dd20[_0xd81b('0x69')][_0xd81b('0xbd')];_0x87b315[_0xd81b('0xbf')]=_0x22dd20[_0xd81b('0x69')]['externalUrl'];return db['ChatInteraction'][_0xd81b('0x68')](_0x87b315);});}_0x48073b[_0xd81b('0xc0')]=_0x3a6e15['id'];if(_0x22dd20[_0xd81b('0x69')][_0xd81b('0xc1')]&&_0x22dd20['body'][_0xd81b('0xc1')]['id']){_0x48073b['id']=_0x22dd20['body'][_0xd81b('0xc1')]['id'];return db[_0xd81b('0xc2')]['find']({'where':_0x48073b})[_0xd81b('0x1c')](function(_0x264d72){var _0x1d5dac=_0x22dd20['body'][_0xd81b('0x38')]&&_0x22dd20[_0xd81b('0x69')][_0xd81b('0x40')];if(!_0x1d5dac&&_0x264d72&&_0x264d72['closed']){throw new APIConflictError(_0xd81b('0xc3'));}else if(_0x264d72){_0x48e6ba=!![];return _0x264d72;}else{return db[_0xd81b('0xc2')][_0xd81b('0x68')](_0x87b315);}});}return db[_0xd81b('0xc2')][_0xd81b('0x68')](_0x87b315);})['then'](function(_0x5c3dce){if(!_0x48e6ba){return _0x5c3dce;}var _0x105735={'from':(_0x305014[_0xd81b('0xbc')][_0xd81b('0x3d')]||'')+'\x20'+(_0x305014[_0xd81b('0xbc')]['lastName']||'')};if(_0x22dd20[_0xd81b('0x69')][_0xd81b('0xbd')]&&_0x22dd20[_0xd81b('0x69')]['messageId']&&_0x22dd20[_0xd81b('0x69')][_0xd81b('0xbd')]!=_0x22dd20[_0xd81b('0x69')]['messageId']){_0x105735['threadId']=_0x22dd20['body'][_0xd81b('0xc4')];}return _0x5c3dce['update'](_0x105735);})[_0xd81b('0x1c')](function(_0x3d7a57){_0x305014[_0xd81b('0xc1')]=_0x3d7a57['get']({'plain':!![]});_0x305014['interaction'][_0xd81b('0xc5')]=!_0x48e6ba;if(_0x305014['interaction'][_0xd81b('0xc5')]){if(_0x305014[_0xd81b('0xb7')][_0xd81b('0xc6')]){_0x305014[_0xd81b('0xb8')]['push']({'id':0x0,'priority':_0x305014[_0xd81b('0xb8')][_0xd81b('0x58')]+0x1,'app':_0xd81b('0xc7'),'appdata':'unmanaged','interval':_0xd81b('0xc8')});}}return db['ChatMessage'][_0xd81b('0x68')]({'body':_0x22dd20[_0xd81b('0x69')]['body'],'ChatWebsiteId':_0x22dd20[_0xd81b('0x64')]['id'],'ChatInteractionId':_0x3d7a57['id'],'direction':'in','ContactId':_0x305014[_0xd81b('0xbc')]['id'],'AttachmentId':_0x22dd20[_0xd81b('0x69')]['AttachmentId']});})['then'](function(_0x1c10da){_0x305014[_0xd81b('0x25')]=_0x1c10da;if(!_0x305014[_0xd81b('0xc1')][_0xd81b('0xc9')]){return;}return db[_0xd81b('0xca')][_0xd81b('0x67')]({'attributes':['id',_0xd81b('0x33')],'where':{'id':_0x305014['interaction']['UserId']}});})[_0xd81b('0x1c')](function(_0x10f27c){if(_0x10f27c){_0x305014[_0xd81b('0xb8')][_0xd81b('0xcb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x10f27c[_0xd81b('0x33')]+','+(_0x305014[_0xd81b('0xb7')][_0xd81b('0xcc')]||0xa),'interval':_0xd81b('0xc8')});_0x305014[_0xd81b('0xcd')]=!![];}if(!_0x305014['interaction']['queueId']){return;}return db[_0xd81b('0xce')][_0xd81b('0x67')]({'attributes':['id',_0xd81b('0x33')],'where':{'id':_0x305014[_0xd81b('0xc1')][_0xd81b('0xcf')]}});})['then'](function(_0x49e5dd){if(_0x49e5dd){_0x305014[_0xd81b('0xb8')]['unshift']({'id':0x0,'priority':0x1,'app':_0xd81b('0xd0'),'appdata':_0x49e5dd[_0xd81b('0x33')]+','+(_0x305014[_0xd81b('0xb7')][_0xd81b('0xd1')]||0x12c),'interval':_0xd81b('0xc8')});}return respondWithRpcPromise(_0xd81b('0xd2'),_0xd81b('0xd3'),_0x305014);})[_0xd81b('0x1c')](function(_0x538cc2){respondWithRpcPromise(_0xd81b('0xd4'),_0xd81b('0xd4'),{'event':_0xd81b('0xa2'),'message':_0x538cc2},client9002);return _0x538cc2;})[_0xd81b('0x1c')](respondWithResult(_0x2ea321,null))[_0xd81b('0x27')](APIHandleError(_0x2ea321));};exports[_0xd81b('0xd5')]=function(_0x2f4b2b,_0x59779e){var _0x1e184c,_0x5d6b18,_0x19eef8;var _0x520762=[];var _0x36650d={};var _0x1c5923=_0x2f4b2b['files']||[];var _0x16865b=[];var _0x522616;return db[_0xd81b('0xaf')][_0xd81b('0x78')]()['then'](function(_0x98f92e){if(!_0x98f92e){throw new db['Sequelize'][(_0xd81b('0xd6'))](_0xd81b('0xd7'));}_0x520762=_[_0xd81b('0xd8')](_[_0xd81b('0x53')](_0x98f92e),[_0xd81b('0xa9'),_0xd81b('0xab'),_0xd81b('0xd9'),_0xd81b('0xac')]);if(_0x2f4b2b[_0xd81b('0x69')]['id']){delete _0x2f4b2b[_0xd81b('0x69')]['id'];}if(_[_0xd81b('0x93')](_0x2f4b2b[_0xd81b('0x69')]['from'])){throw _0x59779e[_0xd81b('0x29')](0x1f4)['send'](new db[(_0xd81b('0xda'))][(_0xd81b('0xd6'))](_0xd81b('0xdb')));}if(_[_0xd81b('0x93')](_0x2f4b2b[_0xd81b('0x69')][_0xd81b('0x69')])||_0x2f4b2b[_0xd81b('0x69')]['body']===''){throw _0x59779e[_0xd81b('0x29')](0x1f4)['send'](new db[(_0xd81b('0xda'))]['ValidationError'](_0xd81b('0xdc')));}if(_['isNil'](_0x2f4b2b[_0xd81b('0x69')][_0xd81b('0xdd')])){throw _0x59779e[_0xd81b('0x29')](0x1f4)[_0xd81b('0x34')](new db['Sequelize'][(_0xd81b('0xd6'))](_0xd81b('0xde')+_0x520762));}if(!_['includes'](_0x520762,_0x2f4b2b['body']['mapKeyOffline'])){throw _0x59779e[_0xd81b('0x29')](0x1f4)[_0xd81b('0x34')](new db[(_0xd81b('0xda'))][(_0xd81b('0xd6'))](_0xd81b('0xdf')+_0x520762));}_0x36650d[_0x2f4b2b[_0xd81b('0x69')]['mapKeyOffline']]=_0x2f4b2b['body'][_0xd81b('0xad')];})['then'](function(){return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x2f4b2b[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0xae')],'as':_0xd81b('0xe0')},{'model':db[_0xd81b('0xe1')],'as':_0xd81b('0xe1')}]});})[_0xd81b('0x1c')](handleEntityNotFound(_0x59779e,null))[_0xd81b('0x1c')](function(_0x28cbe7){if(_0x28cbe7&&_0x28cbe7[_0xd81b('0xe0')]){_0x5d6b18=_0x28cbe7;var _0x30abaf=_[_0xd81b('0x16')](_0x2f4b2b[_0xd81b('0x69')],{'firstName':_0x2f4b2b['body'][_0xd81b('0xad')],'phone':_0x2f4b2b[_0xd81b('0x69')][_0xd81b('0xad')],'ListId':_0x28cbe7[_0xd81b('0xac')]});_0x30abaf[_0x2f4b2b[_0xd81b('0x69')]['mapKeyOffline']]=_0x2f4b2b[_0xd81b('0x69')]['from'];return db['CmContact'][_0xd81b('0xe2')]({'where':_0x36650d,'defaults':_0x30abaf});}})['spread'](function(_0x126aaa){if(_0x126aaa){_0x19eef8=_0x126aaa;var _0x3e8623=fs[_0xd81b('0xe3')](path['join'](config[_0xd81b('0x90')],_0xd81b('0xe4')),_0xd81b('0xe5'));var _0x576d9d=ejs[_0xd81b('0xe6')](_0x3e8623,{'body':_[_0xd81b('0xe7')](_0x2f4b2b[_0xd81b('0x69')][_0xd81b('0x69')]),'bodyTitle':_0x5d6b18[_0xd81b('0xe8')]});return db[_0xd81b('0xe9')]['create']({'body':_0x576d9d,'plainBody':htmlToText[_0xd81b('0xea')](_0x576d9d),'ContactId':_0x126aaa['id'],'ChatWebsiteId':_0x5d6b18['id']});}})[_0xd81b('0x1c')](function(_0x3b6ed5){_0x522616=_0x3b6ed5;if(_0x1c5923[_0xd81b('0x58')]){var _0x11b997=_0x1c5923[_0xd81b('0x4d')](function(_0x3ec25d){return{'name':_0x3ec25d[_0xd81b('0xeb')],'basename':_0x3ec25d[_0xd81b('0x87')],'type':_0x3ec25d['mimetype'],'ChatOfflineMessageId':_0x3b6ed5['id']};});_0x16865b=_0x11b997[_0xd81b('0x4d')](_0x10a82f=>{var _0x255f26={'filename':_0x10a82f[_0xd81b('0x33')],'path':path['join'](config[_0xd81b('0x90')],_0xd81b('0xec'),_0xd81b('0xed'),'attachments',_0xd81b('0xee'),_0x10a82f[_0xd81b('0xef')])};return _0x255f26;});if(!_0x5d6b18[_0xd81b('0xf0')]){return db[_0xd81b('0xf1')][_0xd81b('0xf2')](function(_0x4f1d2b){return db[_0xd81b('0xf3')][_0xd81b('0xf4')](_0x11b997,{'transaction':_0x4f1d2b});});}}})[_0xd81b('0x1c')](function(){if(_0x522616){_0x1e184c=_0x522616;return db['MailAccount'][_0xd81b('0x83')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xd81b('0xf5')],'as':_0xd81b('0xf5'),'raw':!![]}]}]});}})['then'](function(_0x2e4523){if(_0x2e4523&&_0x2e4523['Smtp']&&_0x5d6b18[_0xd81b('0xf6')]&&_0x5d6b18[_0xd81b('0xf7')]){var _0x3a10ac=_0x2e4523[_0xd81b('0xf8')]();return respondWithRpcPromise('SendMail',_0xd81b('0xf9'),{'account':_0x3a10ac,'message':{'from':util[_0xd81b('0x43')](_0xd81b('0xfa'),_0x2e4523[_0xd81b('0x33')],_0x2e4523[_0xd81b('0xfb')]||_0x2e4523[_0xd81b('0xfc')]['user']),'to':_0x5d6b18[_0xd81b('0xf7')],'subject':_0x5d6b18['offlineMessageSubject'],'html':_0x1e184c['body'],'attachments':_0x16865b}},client9003)[_0xd81b('0x1c')](function(){return _0x1e184c;})[_0xd81b('0x27')](function(_0xb2d684){logger['error'](_0xb2d684);});}})[_0xd81b('0x1c')](function(){if(_0x5d6b18&&_0x5d6b18[_0xd81b('0xf0')]&&_0x5d6b18['MailAccountId']){var _0x50fbfd=[];if(_0x1c5923[_0xd81b('0x58')]){_0x50fbfd=_0x1c5923[_0xd81b('0x4d')](function(_0x44e2a8){return{'name':_0x44e2a8[_0xd81b('0xeb')],'basename':_0x44e2a8[_0xd81b('0x87')],'type':_0x44e2a8[_0xd81b('0xfd')],'ChatOfflineMessageId':_0x522616['id']};});}var _0x462925;if(!_[_0xd81b('0x93')](_0x5d6b18[_0xd81b('0xfe')])){var _0x41d12a=_[_0xd81b('0x4d')](_0x2f4b2b[_0xd81b('0x69')],function(_0x2f3170){return _0x2f3170;});var _0xfc4221=_['toPairsIn'](_0x41d12a)[0x0];var _0x25939f=_[_0xd81b('0xff')](_0xfc4221,function(_0x5a7cb8){return _0x5a7cb8;});_0x462925=_0x25939f[0x1][_0x5d6b18[_0xd81b('0xfe')]];}var _0x250cd7={'from':_0x19eef8[_0xd81b('0xfb')],'firstName':_0x19eef8[_0xd81b('0x3d')],'lastName':_0x19eef8['lastName'],'mapKey':_0xd81b('0xfb'),'message':{'from':_0x19eef8[_0xd81b('0xfb')],'to':_0x5d6b18[_0xd81b('0xe1')][_0xd81b('0xfb')],'cc':'','subject':_[_0xd81b('0x93')](_0x462925)?_0x5d6b18[_0xd81b('0x100')]:_0x462925,'messageId':'','sentAt':new Date(),'attach':_0x50fbfd['length'],'attachments':_0x50fbfd,'originChannel':_0xd81b('0x101'),'ChatWebsiteId':_0x5d6b18['id'],'ChatOfflineMessageId':_0x1e184c['id'],'originTo':_0x5d6b18[_0xd81b('0xe1')][_0xd81b('0xfb')]},'body':_0x1e184c[_0xd81b('0x69')]};var _0x35320d={'account':{'id':_0x5d6b18[_0xd81b('0x102')]},'body':_0x250cd7,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xd81b('0x103'),_0x35320d,client9001)[_0xd81b('0x1c')](function(){return _0x1e184c;})[_0xd81b('0x27')](function(_0x3c329e){logger['error'](_0x3c329e);});}return;})[_0xd81b('0x1c')](function(){if(_0x1e184c){return _0x1e184c;}})[_0xd81b('0x1c')](respondWithResult(_0x59779e,null))[_0xd81b('0x27')](function(){for(var _0x468794 of _0x1c5923){var _0x1c3473=path['join'](config[_0xd81b('0x90')],'server',_0xd81b('0xed'),_0xd81b('0x104'),'offline-chat',_0x468794['filename']);fs_extra[_0xd81b('0x105')](_0x1c3473)['catch'](function(_0x5f1c6b){logger[_0xd81b('0x23')](_0xd81b('0x106'),_0x1c3473,_0x5f1c6b);});}});};exports[_0xd81b('0x107')]=function(_0x56195b,_0x584698){return db[_0xd81b('0xc2')][_0xd81b('0x67')]({'where':{'id':_0x56195b[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x584698,null))[_0xd81b('0x1c')](function(_0xae9cb8){if(_0xae9cb8){return _0xae9cb8['addInteraction'](_0x56195b['body'][_0xd81b('0x7f')],_[_0xd81b('0x108')](_0x56195b[_0xd81b('0x69')],['ids','id'])||{});}})[_0xd81b('0x1c')](respondWithResult(_0x584698,null))[_0xd81b('0x27')](handleError(_0x584698,null));};exports['getInteractions']=function(_0x22e159,_0x3d3ee1){var _0x31e7f7={'raw':![],'where':{}};var _0x4850d8={};var _0x51c975={'count':0x0,'rows':[]};return db[_0xd81b('0x4e')][_0xd81b('0x83')]({'where':{'id':_0x22e159[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x3d3ee1,null))[_0xd81b('0x1c')](function(_0x525220){if(_0x525220){_0x4850d8[_0xd81b('0x46')]=_[_0xd81b('0x53')](db['ChatInteraction'][_0xd81b('0x4f')]);_0x4850d8[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0x22e159['query']);_0x4850d8[_0xd81b('0x54')]=_['intersection'](_0x4850d8[_0xd81b('0x46')],_0x4850d8['query']);_0x31e7f7[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x4850d8[_0xd81b('0x46')],qs[_0xd81b('0x57')](_0x22e159[_0xd81b('0x52')][_0xd81b('0x57')]));_0x31e7f7['attributes']=_0x31e7f7['attributes'][_0xd81b('0x58')]?_0x31e7f7[_0xd81b('0x56')]:_0x4850d8[_0xd81b('0x46')];if(!_0x22e159[_0xd81b('0x52')][_0xd81b('0x59')](_0xd81b('0x5a'))){_0x31e7f7[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x22e159['query'][_0xd81b('0x2f')]);_0x31e7f7[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0x22e159[_0xd81b('0x52')]['offset']);}_0x31e7f7[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x22e159[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x31e7f7['where']=qs[_0xd81b('0x54')](_['pick'](_0x22e159['query'],_0x4850d8[_0xd81b('0x54')]));_0x31e7f7[_0xd81b('0x5d')][_0xd81b('0x80')]=_0x525220['id'];if(_0x22e159[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x31e7f7[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x31e7f7['where'],{'$or':_[_0xd81b('0x4d')](_0x31e7f7[_0xd81b('0x56')],function(_0x16ef58){var _0x3b4240={};_0x3b4240[_0x16ef58]={'$like':'%'+_0x22e159['query'][_0xd81b('0x5f')]+'%'};return _0x3b4240;})});}_0x31e7f7=_[_0xd81b('0x60')]({},_0x31e7f7,_0x22e159['options']);return db[_0xd81b('0xc2')]['count']({'where':_0x31e7f7[_0xd81b('0x5d')]})['then'](function(_0x54062e){_0x51c975[_0xd81b('0x2e')]=_0x54062e;if(_0x22e159[_0xd81b('0x52')][_0xd81b('0x62')]){_0x31e7f7[_0xd81b('0x63')]=[{'model':db['CmContact'],'as':_0xd81b('0x109'),'required':![]},{'model':db['User'],'as':_0xd81b('0x10a'),'attributes':[_0xd81b('0x33'),_0xd81b('0x10b'),_0xd81b('0x10c')],'required':![]},{'model':db[_0xd81b('0x10d')],'as':_0xd81b('0x10e'),'attributes':['id',_0xd81b('0x33'),_0xd81b('0x10f')],'where':_0x22e159[_0xd81b('0x52')]['tag']?{'id':_0x22e159[_0xd81b('0x52')][_0xd81b('0x110')]}:undefined,'required':_0x22e159[_0xd81b('0x52')][_0xd81b('0x110')]?!![]:![]}];}return db[_0xd81b('0xc2')][_0xd81b('0x7c')](_0x31e7f7);})[_0xd81b('0x1c')](function(_0x23139c){_0x51c975[_0xd81b('0x7d')]=_0x23139c;return _0x51c975;});}})[_0xd81b('0x1c')](respondWithFilteredResult(_0x3d3ee1,_0x31e7f7))['catch'](handleError(_0x3d3ee1,null));};exports[_0xd81b('0x111')]=function(_0x432b04,_0x2ff8f6){var _0x30a57a=0x0;var _0x25f776=0x0;var _0x1313da=![];var _0x115026;var _0x202316;return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x432b04[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0x9e')],'as':_0xd81b('0x9e'),'include':[{'model':db[_0xd81b('0x9e')],'as':_0xd81b('0xb4'),'attributes':['id',_0xd81b('0xb5')]}]}]})[_0xd81b('0x1c')](handleEntityNotFound(_0x2ff8f6,null))['then'](function(_0x16ccac){if(_0x16ccac){_0x115026=_0x16ccac;return _0x16ccac['getProactiveActions']({'raw':!![]});}})[_0xd81b('0x1c')](function(_0x1c3879){if(_0x115026){if(_0x1c3879){_0x202316=_0x1c3879;}}return require(_0xd81b('0x91'))[_0xd81b('0x92')]();})[_0xd81b('0x1c')](function(_0x4e6c6d){if(_0x4e6c6d){_0x25f776=_0x4e6c6d[_0xd81b('0x112')];_0x1313da=_0x4e6c6d[_0xd81b('0x113')];}})[_0xd81b('0x1c')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0xd81b('0x1c')](function(_0x366808){_0x30a57a=_0x366808;if(_0x25f776&&_0x366808>_0x25f776){return db['License'][_0xd81b('0x83')]({'where':{'id':0x1}})[_0xd81b('0x1c')](function(_0x2ac7d3){if(_0x2ac7d3){_0x2ac7d3[_0xd81b('0x114')](_0xd81b('0x115'));}});}})[_0xd81b('0x1c')](function(){var _0x203fbe=_0x115026[_0xd81b('0x9e')];var _0xf1f6f2=_0x115026[_0xd81b('0xa0')]||undefined;return _0x203fbe?_0x203fbe[_0xd81b('0xa1')](_0xf1f6f2):!![];})[_0xd81b('0x1c')](function(_0xe0b626){var _0x5a187a=fs[_0xd81b('0xe3')](path['join'](config[_0xd81b('0x90')],_0xd81b('0x116')),_0xd81b('0xe5'));var _0x4cb573=_0xd81b('0x117');var _0x53d707=![];var _0x480fab,_0x1685e6;if(_0x432b04[_0xd81b('0x118')]['referer']){_0x480fab=new URL(_0x432b04['headers'][_0xd81b('0x40')])[_0xd81b('0x119')];}else if(_0x432b04[_0xd81b('0x118')][_0xd81b('0x119')]){_0x480fab=new URL(_0x432b04[_0xd81b('0x118')]['origin'])[_0xd81b('0x119')];}else{_0x480fab=_0xd81b('0x11a');}_0x1685e6=typeof _0x115026[_0xd81b('0x6a')][_0xd81b('0x3c')](',')['find'](function(_0x549d83){return wildcardUtils[_0xd81b('0x11b')](_0x549d83,_0x480fab);})!==_0xd81b('0x2d');var _0x39eb20={'chatVersion':_0x4cb573,'chatWebsiteAddressOrigin':_0x1685e6?_0x480fab:_0x115026[_0xd81b('0x6a')],'remote':_0x115026[_0xd81b('0x11c')],'query':querystring[_0xd81b('0x22')](_['merge'](_0x115026[_0xd81b('0x70')]({'plain':!![]}),{'customerIp':_0x432b04[_0xd81b('0x118')]['x-forwarded-for']||_0x432b04[_0xd81b('0x118')][_0xd81b('0x11d')]||_0x432b04[_0xd81b('0x11e')][_0xd81b('0x11f')]||_0x432b04['ip'],'referer':_0x432b04['headers'][_0xd81b('0x40')],'openedInteractions':_0x30a57a,'maxInteractions':_0x25f776,'virtual':_0x1313da[_0xd81b('0x112')],'online':_0xe0b626,'custom':_0x1313da,'address':_0x1685e6?_0x480fab:null}))[_0xd81b('0x120')](/'/g,'\x5c\x27')};_0x2ff8f6[_0xd81b('0x34')](ejs[_0xd81b('0xe6')](Mustache[_0xd81b('0xe6')](_0x5a187a,_0x39eb20),{'proactiveActions':_0x202316,'alignment':_0x115026[_0xd81b('0x121')],'verticalAlignment':_0x115026[_0xd81b('0x122')],'div_color':_0x115026[_0xd81b('0x10f')],'labelText':_0x115026[_0xd81b('0x123')],'text_color':_0x115026[_0xd81b('0x124')],'text_button_color':_0x115026['textButtonColor'],'button_color':_0x115026[_0xd81b('0x125')],'background_color':_0x115026[_0xd81b('0x126')],'hideWhenOffline':_0x115026[_0xd81b('0x127')],'intervalId':_0x115026[_0xd81b('0x128')],'isDevelopment':_0x53d707,'chatVersion':_0x4cb573}));})[_0xd81b('0x27')](handleError(_0x2ff8f6,null));};exports[_0xd81b('0x129')]=function(_0x2eefbd,_0x2883fe){var _0x34cf85=_0x2eefbd[_0xd81b('0x64')]['id'];var _0x4eae4a=_0x2eefbd[_0xd81b('0x69')];var _0x388752=0xc8;var _0x580b1f=null;return db[_0xd81b('0xf1')][_0xd81b('0xf2')]({'isolationLevel':db[_0xd81b('0xf1')][_0xd81b('0x12a')]['ISOLATION_LEVELS'][_0xd81b('0x12b')]},function(_0x33d580){return db[_0xd81b('0x4e')][_0xd81b('0x83')]({'where':{'id':_0x34cf85},'transaction':_0x33d580})[_0xd81b('0x1c')](function(_0x386b39){if(_0x386b39){return db[_0xd81b('0xb2')][_0xd81b('0x31')]({'where':{'ChatWebsiteId':_0x34cf85},'transaction':_0x33d580})[_0xd81b('0x1c')](function(){var _0x3c839c=_[_0xd81b('0x4d')](_0x4eae4a,function(_0x9bbfea){_0x9bbfea[_0xd81b('0x80')]=_0x34cf85;return _0x9bbfea;});return db[_0xd81b('0xb2')][_0xd81b('0xf4')](_0x3c839c,{'transaction':_0x33d580});});}else{_0x388752=0x194;_0x580b1f=[];}});})['then'](function(){if(_0x388752!==0x194){return db[_0xd81b('0xb2')][_0xd81b('0x12c')]({'where':{'ChatWebsiteId':_0x34cf85},'order':_0xd81b('0xb9')})['then'](function(_0x5ae954){_0x580b1f=_0x5ae954;});}})[_0xd81b('0x27')](function(_0x5ab098){_0x388752=0x1f4;logger[_0xd81b('0x23')](_0x5ab098['stack']);if(_0x5ab098[_0xd81b('0x33')]){delete _0x5ab098[_0xd81b('0x33')];}_0x580b1f=_0x5ab098;})[_0xd81b('0x12d')](function(){if(_0x580b1f===null){_0x2883fe[_0xd81b('0x28')](_0x388752);}else{if(_0x388752===0x1f4){_0x2883fe['status'](_0x388752)['send'](_0x580b1f);}else{_0x2883fe[_0xd81b('0x29')](_0x388752)[_0xd81b('0x2b')](_0x580b1f);}}});};exports[_0xd81b('0x12e')]=function(_0x1e841d,_0x6121cf){var _0x15ce6c={};var _0x29e6d9={};var _0x57ef3b;var _0xf7cefc;return db['ChatWebsite']['findOne']({'where':{'id':_0x1e841d[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x6121cf,null))['then'](function(_0x28e08c){if(_0x28e08c){_0x57ef3b=_0x28e08c;_0x29e6d9[_0xd81b('0x46')]=_[_0xd81b('0x53')](db[_0xd81b('0xb2')][_0xd81b('0x4f')]);_0x29e6d9[_0xd81b('0x52')]=_['keys'](_0x1e841d['query']);_0x29e6d9[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x29e6d9['model'],_0x29e6d9['query']);_0x15ce6c[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x29e6d9['model'],qs[_0xd81b('0x57')](_0x1e841d[_0xd81b('0x52')]['fields']));_0x15ce6c[_0xd81b('0x56')]=_0x15ce6c[_0xd81b('0x56')][_0xd81b('0x58')]?_0x15ce6c['attributes']:_0x29e6d9[_0xd81b('0x46')];_0x15ce6c[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x1e841d[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x15ce6c['where']=qs[_0xd81b('0x54')](_[_0xd81b('0x5e')](_0x1e841d[_0xd81b('0x52')],_0x29e6d9[_0xd81b('0x54')]));if(_0x1e841d[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x15ce6c[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x15ce6c[_0xd81b('0x5d')],{'$or':_[_0xd81b('0x4d')](_0x15ce6c['attributes'],function(_0x407136){var _0x3b5455={};_0x3b5455[_0x407136]={'$like':'%'+_0x1e841d[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x3b5455;})});}_0x15ce6c=_[_0xd81b('0x60')]({},_0x15ce6c,_0x1e841d[_0xd81b('0x66')]);return _0x57ef3b[_0xd81b('0x12e')](_0x15ce6c);}})['then'](function(_0x5b1898){if(_0x5b1898){_0xf7cefc=_0x5b1898[_0xd81b('0x58')];if(!_0x1e841d[_0xd81b('0x52')][_0xd81b('0x59')]('nolimit')){_0x15ce6c[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x1e841d[_0xd81b('0x52')][_0xd81b('0x2f')]);_0x15ce6c[_0xd81b('0x2c')]=qs['offset'](_0x1e841d[_0xd81b('0x52')][_0xd81b('0x2c')]);}return _0x57ef3b[_0xd81b('0x12e')](_0x15ce6c);}})[_0xd81b('0x1c')](function(_0x89764a){if(_0x89764a){return _0x89764a?{'count':_0xf7cefc,'rows':_0x89764a}:null;}})[_0xd81b('0x1c')](respondWithResult(_0x6121cf,null))[_0xd81b('0x27')](handleError(_0x6121cf,null));};exports['addProactiveActions']=function(_0x5a8445,_0x47a903){return db['chatProactiveAction']['find']({'where':{'id':_0x5a8445[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x47a903,null))[_0xd81b('0x1c')](function(_0x4d4feb){if(_0x4d4feb){return _0x4d4feb[_0xd81b('0x12f')](_0x5a8445['body'][_0xd81b('0x7f')],_[_0xd81b('0x108')](_0x5a8445[_0xd81b('0x69')],['ids','id'])||{});}})[_0xd81b('0x1c')](respondWithResult(_0x47a903,null))[_0xd81b('0x27')](handleError(_0x47a903,null));};exports[_0xd81b('0x130')]=function(_0xd09d12,_0x251bf4){var _0x3682e4={};var _0x49f9d1={};var _0x5c97b9;var _0x1e4634;return db[_0xd81b('0x4e')][_0xd81b('0x83')]({'where':{'id':_0xd09d12[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x251bf4,null))[_0xd81b('0x1c')](function(_0x4e3323){if(_0x4e3323){_0x5c97b9=_0x4e3323;_0x49f9d1[_0xd81b('0x46')]=_[_0xd81b('0x53')](db[_0xd81b('0x131')][_0xd81b('0x4f')]);_0x49f9d1['query']=_['keys'](_0xd09d12[_0xd81b('0x52')]);_0x49f9d1[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x49f9d1[_0xd81b('0x46')],_0x49f9d1[_0xd81b('0x52')]);_0x3682e4[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x49f9d1['model'],qs[_0xd81b('0x57')](_0xd09d12['query']['fields']));_0x3682e4['attributes']=_0x3682e4[_0xd81b('0x56')][_0xd81b('0x58')]?_0x3682e4[_0xd81b('0x56')]:_0x49f9d1[_0xd81b('0x46')];_0x3682e4[_0xd81b('0x5b')]=qs['sort'](_0xd09d12[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x3682e4[_0xd81b('0x5d')]=qs[_0xd81b('0x54')](_['pick'](_0xd09d12['query'],_0x49f9d1[_0xd81b('0x54')]));if(_0xd09d12[_0xd81b('0x52')]['filter']){_0x3682e4[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x3682e4[_0xd81b('0x5d')],{'$or':_[_0xd81b('0x4d')](_0x3682e4[_0xd81b('0x56')],function(_0x111dd0){var _0x37301b={};_0x37301b[_0x111dd0]={'$like':'%'+_0xd09d12['query']['filter']+'%'};return _0x37301b;})});}_0x3682e4=_[_0xd81b('0x60')]({},_0x3682e4,_0xd09d12['options']);return _0x5c97b9[_0xd81b('0x130')](_0x3682e4);}})['then'](function(_0x222acd){if(_0x222acd){_0x1e4634=_0x222acd[_0xd81b('0x58')];if(!_0xd09d12[_0xd81b('0x52')][_0xd81b('0x59')](_0xd81b('0x5a'))){_0x3682e4[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0xd09d12[_0xd81b('0x52')]['limit']);_0x3682e4[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0xd09d12[_0xd81b('0x52')][_0xd81b('0x2c')]);}return _0x5c97b9[_0xd81b('0x130')](_0x3682e4);}})['then'](function(_0x3c96d4){if(_0x3c96d4){return _0x3c96d4?{'count':_0x1e4634,'rows':_0x3c96d4}:null;}})['then'](respondWithResult(_0x251bf4,null))[_0xd81b('0x27')](handleError(_0x251bf4,null));};exports[_0xd81b('0x132')]=function(_0x4387a7,_0x24fc43){var _0x498cc0=_0x4387a7[_0xd81b('0x52')][_0xd81b('0x133')]===_0xd81b('0x134')?_0xd81b('0x135'):_0xd81b('0x136');return db[_0xd81b('0x4e')]['find']({'attributes':['id',_0x498cc0],'where':{'id':_0x4387a7[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x24fc43,null))[_0xd81b('0x1c')](function(_0x597c54){if(_0x597c54){var _0x4e792e=_0x597c54[_0x498cc0];var _0x58e782=_0x4e792e&&_0x4e792e[_0xd81b('0x137')]?_0x4e792e['items']:[];_0x24fc43[_0xd81b('0x34')]({'fromKey':_[_0xd81b('0x93')](_0x4e792e['fromKey'])?undefined:_0x4e792e[_0xd81b('0x138')],'count':_0x58e782[_0xd81b('0x58')],'rows':_0x58e782});}})[_0xd81b('0x27')](handleError(_0x24fc43,null));};exports['getOfflineMessages']=function(_0x5f10b0,_0x19ff30){var _0x398e61={'raw':![],'where':{}};var _0xcb2433={};var _0x32573b={'count':0x0,'rows':[]};return db[_0xd81b('0x4e')]['findOne']({'where':{'id':_0x5f10b0['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x19ff30,null))[_0xd81b('0x1c')](function(_0x1eea94){if(_0x1eea94){_0xcb2433[_0xd81b('0x46')]=_[_0xd81b('0x53')](db[_0xd81b('0xe9')]['rawAttributes']);_0xcb2433['query']=_[_0xd81b('0x53')](_0x5f10b0[_0xd81b('0x52')]);_0xcb2433[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0xcb2433['model'],_0xcb2433[_0xd81b('0x52')]);_0x398e61['attributes']=_[_0xd81b('0x55')](_0xcb2433['model'],qs[_0xd81b('0x57')](_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x57')]));_0x398e61['attributes']=_0x398e61[_0xd81b('0x56')][_0xd81b('0x58')]?_0x398e61[_0xd81b('0x56')]:_0xcb2433[_0xd81b('0x46')];if(!_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x59')](_0xd81b('0x5a'))){_0x398e61[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x5f10b0['query'][_0xd81b('0x2f')]);_0x398e61[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x2c')]);}_0x398e61[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x398e61[_0xd81b('0x5d')]=qs['filters'](_[_0xd81b('0x5e')](_0x5f10b0[_0xd81b('0x52')],_0xcb2433[_0xd81b('0x54')]));_0x398e61[_0xd81b('0x5d')][_0xd81b('0x80')]=_0x1eea94['id'];if(_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x398e61[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x398e61['where'],{'$or':_['map'](_0x398e61[_0xd81b('0x56')],function(_0x56f4c8){var _0xa5dd60={};_0xa5dd60[_0x56f4c8]={'$like':'%'+_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0xa5dd60;})});}_0x398e61=_[_0xd81b('0x60')]({},_0x398e61,_0x5f10b0[_0xd81b('0x66')]);return db[_0xd81b('0xe9')][_0xd81b('0x2e')]({'where':_0x398e61[_0xd81b('0x5d')]})['then'](function(_0x443a17){_0x32573b[_0xd81b('0x2e')]=_0x443a17;if(_0x5f10b0['query'][_0xd81b('0x62')]){_0x398e61[_0xd81b('0x63')]=[{'all':!![]}];}else{_0x398e61['include']=[{'model':db['CmContact'],'as':_0xd81b('0x109'),'required':![]},{'model':db[_0xd81b('0xf3')],'as':_0xd81b('0x139'),'required':![]}];}return db[_0xd81b('0xe9')][_0xd81b('0x7c')](_0x398e61);})[_0xd81b('0x1c')](function(_0x57da47){_0x32573b[_0xd81b('0x7d')]=_0x57da47;return _0x32573b;});}})[_0xd81b('0x1c')](respondWithFilteredResult(_0x19ff30,_0x398e61))['catch'](handleError(_0x19ff30,null));};exports[_0xd81b('0x13a')]=function(_0x207681,_0x212f03){return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x207681[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x212f03,null))[_0xd81b('0x1c')](function(_0x3ea155){if(_0x3ea155){return _0x3ea155[_0xd81b('0x13a')](_0x207681['body'][_0xd81b('0x7f')],_[_0xd81b('0x108')](_0x207681[_0xd81b('0x69')],[_0xd81b('0x7f'),'id'])||{})[_0xd81b('0x13b')](function(_0x3b393b){for(var _0xd6d130=0x0;_0xd6d130<_0x207681['body'][_0xd81b('0x7f')][_0xd81b('0x58')];_0xd6d130+=0x1){socket[_0xd81b('0x13c')](_0xd81b('0x13d'),{'UserId':Number(_0x207681['body'][_0xd81b('0x7f')][_0xd6d130]),'ChatWebsiteId':Number(_0x207681[_0xd81b('0x64')]['id'])});}return _0x3b393b;});}})['then'](respondWithResult(_0x212f03,null))['catch'](handleError(_0x212f03,null));};exports[_0xd81b('0x13e')]=function(_0x44a9e1,_0x26d2c2){return db['ChatWebsite'][_0xd81b('0x67')]({'where':{'id':_0x44a9e1['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x26d2c2,null))[_0xd81b('0x1c')](function(_0x4c684a){if(_0x4c684a){return _0x4c684a[_0xd81b('0x13e')](_0x44a9e1['query'][_0xd81b('0x7f')])['then'](function(){if(_[_0xd81b('0x13f')](_0x44a9e1[_0xd81b('0x52')][_0xd81b('0x7f')])){for(var _0x56d986=0x0;_0x56d986<_0x44a9e1[_0xd81b('0x52')][_0xd81b('0x7f')][_0xd81b('0x58')];_0x56d986+=0x1){socket[_0xd81b('0x13c')](_0xd81b('0x140'),{'UserId':Number(_0x44a9e1[_0xd81b('0x52')][_0xd81b('0x7f')][_0x56d986]),'ChatWebsiteId':Number(_0x44a9e1['params']['id'])});}}else{socket[_0xd81b('0x13c')](_0xd81b('0x140'),{'UserId':Number(_0x44a9e1['query']['ids']),'ChatWebsiteId':Number(_0x44a9e1['params']['id'])});}});}})[_0xd81b('0x1c')](respondWithStatusCode(_0x26d2c2,null))[_0xd81b('0x27')](handleError(_0x26d2c2,null));};exports[_0xd81b('0x141')]=function(_0xb7102c,_0x2b1519){var _0x1c5a61={};var _0x4c1201={};var _0x1f76aa;var _0x36fa37;return db[_0xd81b('0x4e')][_0xd81b('0x83')]({'where':{'id':_0xb7102c[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x2b1519,null))[_0xd81b('0x1c')](function(_0x4fc360){if(_0x4fc360){_0x1f76aa=_0x4fc360;_0x4c1201[_0xd81b('0x46')]=_['keys'](db[_0xd81b('0xca')]['rawAttributes']);_0x4c1201[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0xb7102c[_0xd81b('0x52')]);_0x4c1201['filters']=_[_0xd81b('0x55')](_0x4c1201[_0xd81b('0x46')],_0x4c1201[_0xd81b('0x52')]);_0x1c5a61['attributes']=_[_0xd81b('0x55')](_0x4c1201['model'],qs[_0xd81b('0x57')](_0xb7102c['query'][_0xd81b('0x57')]));_0x1c5a61[_0xd81b('0x56')]=_0x1c5a61[_0xd81b('0x56')][_0xd81b('0x58')]?_0x1c5a61[_0xd81b('0x56')]:_0x4c1201[_0xd81b('0x46')];_0x1c5a61['order']=qs[_0xd81b('0x5c')](_0xb7102c[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x1c5a61[_0xd81b('0x5d')]=qs[_0xd81b('0x54')](_[_0xd81b('0x5e')](_0xb7102c[_0xd81b('0x52')],_0x4c1201[_0xd81b('0x54')]));if(_0xb7102c[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x1c5a61['where']=_[_0xd81b('0x60')](_0x1c5a61['where'],{'$or':_[_0xd81b('0x4d')](_0x1c5a61['attributes'],function(_0x45bf7e){var _0x29464b={};_0x29464b[_0x45bf7e]={'$like':'%'+_0xb7102c[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x29464b;})});}_0x1c5a61=_[_0xd81b('0x60')]({},_0x1c5a61,_0xb7102c[_0xd81b('0x66')]);return _0x1f76aa[_0xd81b('0x141')](_0x1c5a61);}})['then'](function(_0xec700e){if(_0xec700e){_0x36fa37=_0xec700e[_0xd81b('0x58')];if(!_0xb7102c[_0xd81b('0x52')][_0xd81b('0x59')]('nolimit')){_0x1c5a61[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0xb7102c[_0xd81b('0x52')][_0xd81b('0x2f')]);_0x1c5a61['offset']=qs['offset'](_0xb7102c[_0xd81b('0x52')][_0xd81b('0x2c')]);}return _0x1f76aa[_0xd81b('0x141')](_0x1c5a61);}})[_0xd81b('0x1c')](function(_0x450634){if(_0x450634){return _0x450634?{'count':_0x36fa37,'rows':_0x450634}:null;}})[_0xd81b('0x1c')](respondWithResult(_0x2b1519,null))[_0xd81b('0x27')](handleError(_0x2b1519,null));};
\ No newline at end of file
+var _0x44e8=['includeAll','include','rows','rawAttributes','length','find','body','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','testWildcardValidity','params','describe','ChatWebsiteId','getDispositions','findOne','Disposition','order','findAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','customerAvatar','addSystemAvatar','join','root','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','Interval','timezone','ifTime','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','ChatApplication','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','List','Contacts','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','interaction','firstName','messageId','autoclose','push','close','ChatMessage','UserId','User','*,*,*,*','forcedOwnership','queueId','ChatQueue','unshift','queue','Start','startRouting','EventManager','notify','Sequelize','difference','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','files','attachments','offline-chat','openNewInteraction','sequelize','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','getSnippet','interval','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.13.0','origin','testWebsiteWithWildcard','address','remote','x-forwarded-for','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','color','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','mustache','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIBadRequestError','APIOutOfIntervalError','handleError','APIConflictError','url','URL','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','client','http','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','update','ChatWebsites','destroy','end','stack','name','send','user-agent-parser','setUA','user-agent','getResult','customerIp','cf-connecting-ip','first','split','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','model','device','vendor','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','key','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options'];(function(_0x8cc7c,_0x591379){var _0x404b40=function(_0x3d1de1){while(--_0x3d1de1){_0x8cc7c['push'](_0x8cc7c['shift']());}};_0x404b40(++_0x591379);}(_0x44e8,0xd7));var _0x844e=function(_0x57ebbb,_0x4e6823){_0x57ebbb=_0x57ebbb-0x0;var _0x4f9f78=_0x44e8[_0x57ebbb];return _0x4f9f78;};'use strict';var Mustache=require(_0x844e('0x0'));var util=require('util');var path=require('path');var ejs=require(_0x844e('0x1'));var fs=require('fs');var fs_extra=require(_0x844e('0x2'));var _=require(_0x844e('0x3'));var querystring=require(_0x844e('0x4'));var htmlToText=require('html-to-text');var Redis=require(_0x844e('0x5'));var jayson=require(_0x844e('0x6'));var qs=require(_0x844e('0x7'));var logger=require(_0x844e('0x8'))('api');var config=require(_0x844e('0x9'));var APIBadRequestError=require(_0x844e('0xa'))[_0x844e('0xb')];var APINotFoundError=require(_0x844e('0xa'))['APINotFoundError'];var APIOutOfIntervalError=require(_0x844e('0xa'))[_0x844e('0xc')];var APIHandleError=require(_0x844e('0xa'))[_0x844e('0xd')];var APIConflictError=require(_0x844e('0xa'))[_0x844e('0xe')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require(_0x844e('0xf'))[_0x844e('0x10')];var db=require(_0x844e('0x11'))['db'];config[_0x844e('0x12')]=_[_0x844e('0x13')](config[_0x844e('0x12')],{'host':_0x844e('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x844e('0x12')]));require(_0x844e('0x15'))['register'](socket);var client=jayson[_0x844e('0x16')][_0x844e('0x17')]({'port':0x232c});var client9002=jayson['client'][_0x844e('0x17')]({'port':0x232a});var client9003=jayson[_0x844e('0x16')][_0x844e('0x17')]({'port':0x232b});var client9001=jayson['client'][_0x844e('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x465e49,_0x380eb4,_0x935134,_0x2588a3){return new Promise(function(_0x353be9,_0x2227c6){var _0x5506ef=_0x2588a3||client;return _0x5506ef['request'](_0x465e49,_0x935134)[_0x844e('0x18')](function(_0x56791b){logger[_0x844e('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x380eb4,_0x844e('0x1a'));logger['debug'](_0x844e('0x1b'),_0x380eb4,_0x844e('0x1a'),JSON[_0x844e('0x1c')](_0x56791b));if(_0x56791b[_0x844e('0x1d')]){if(_0x56791b[_0x844e('0x1d')][_0x844e('0x1e')]===0x1f4){logger[_0x844e('0x1d')](_0x844e('0x1f'),_0x380eb4,_0x56791b['error'][_0x844e('0x20')]);return _0x2227c6(_0x56791b['error']['message']);}logger[_0x844e('0x1d')](_0x844e('0x1f'),_0x380eb4,_0x56791b[_0x844e('0x1d')][_0x844e('0x20')]);return _0x353be9(_0x56791b['error'][_0x844e('0x20')]);}else{logger[_0x844e('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x380eb4,_0x844e('0x1a'));_0x353be9(_0x56791b[_0x844e('0x21')][_0x844e('0x20')]);}})[_0x844e('0x22')](function(_0x35236b){logger[_0x844e('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x380eb4,_0x35236b);_0x2227c6(_0x35236b);});});}function respondWithStatusCode(_0x399a81,_0xadf0d8){_0xadf0d8=_0xadf0d8||0xcc;return function(_0x11859a){if(_0x11859a){return _0x399a81[_0x844e('0x23')](_0xadf0d8);}return _0x399a81[_0x844e('0x24')](_0xadf0d8)['end']();};}function respondWithResult(_0x3725b2,_0x5080c1){_0x5080c1=_0x5080c1||0xc8;return function(_0x57b2ef){if(_0x57b2ef){return _0x3725b2[_0x844e('0x24')](_0x5080c1)[_0x844e('0x25')](_0x57b2ef);}};}function respondWithFilteredResult(_0x355456,_0x587613){return function(_0x489349){if(_0x489349){var _0x2d4acd=typeof _0x587613[_0x844e('0x26')]==='undefined'&&typeof _0x587613[_0x844e('0x27')]===_0x844e('0x28');var _0x2f1697=_0x489349[_0x844e('0x29')];var _0x454b68=_0x2d4acd?0x0:_0x587613[_0x844e('0x26')];var _0x30d0a2=_0x2d4acd?_0x489349[_0x844e('0x29')]:_0x587613[_0x844e('0x26')]+_0x587613[_0x844e('0x27')];var _0x550240;if(_0x30d0a2>=_0x2f1697){_0x30d0a2=_0x2f1697;_0x550240=0xc8;}else{_0x550240=0xce;}_0x355456[_0x844e('0x24')](_0x550240);return _0x355456[_0x844e('0x2a')](_0x844e('0x2b'),_0x454b68+'-'+_0x30d0a2+'/'+_0x2f1697)[_0x844e('0x25')](_0x489349);}return null;};}function saveUpdates(_0x43ae36){return function(_0x31754e){if(_0x31754e){return _0x31754e[_0x844e('0x2c')](_0x43ae36)['then'](function(_0x26d6f2){return _0x26d6f2;});}return null;};}function removeEntity(_0x34ea8b){return function(_0x294dea){if(_0x294dea){return _0x294dea['destroy']()[_0x844e('0x18')](function(){var _0x1592fb=_0x294dea['get']({'plain':!![]});var _0x1fdba9=_0x844e('0x2d');return db['UserProfileResource'][_0x844e('0x2e')]({'where':{'type':_0x1fdba9,'resourceId':_0x1592fb['id']}})[_0x844e('0x18')](function(){return _0x294dea;});})[_0x844e('0x18')](function(){_0x34ea8b[_0x844e('0x24')](0xcc)[_0x844e('0x2f')]();});}};}function handleEntityNotFound(_0x3aa8ba){return function(_0xd61d0c){if(!_0xd61d0c){_0x3aa8ba['sendStatus'](0x194);}return _0xd61d0c;};}function handleError(_0x31d896,_0x387723){_0x387723=_0x387723||0x1f4;return function(_0x29637e){logger[_0x844e('0x1d')](_0x29637e[_0x844e('0x30')]);if(_0x29637e[_0x844e('0x31')]){delete _0x29637e[_0x844e('0x31')];}_0x31d896[_0x844e('0x24')](_0x387723)[_0x844e('0x32')](_0x29637e);};}function createInteractionObject(_0x4155ad,_0x13614e,_0x5d9544,_0x5701d5){var _0x3ad6d5=require(_0x844e('0x33'));var _0xe3d034=new _0x3ad6d5();var _0xc1c669=_0xe3d034[_0x844e('0x34')](_0x5d9544[_0x844e('0x35')])[_0x844e('0x36')]();var _0x23032f=_0x13614e[_0x844e('0x37')];if(_0x5d9544['cf-connecting-ip']){_0x23032f=_0x5d9544[_0x844e('0x38')];}else if(_0x5d9544['x-forwarded-for']){_0x23032f=_[_0x844e('0x39')](_0x5d9544['x-forwarded-for'][_0x844e('0x3a')](','));}return{'ContactId':_0x5701d5['id'],'ChatWebsiteId':_0x4155ad,'from':(_0x5701d5['firstName']||'')+'\x20'+(_0x5701d5[_0x844e('0x3b')]||''),'customerIp':_0x23032f,'customerPort':_0x5d9544[_0x844e('0x3c')]?_0x5d9544[_0x844e('0x3c')]:null,'referer':_0x13614e[_0x844e('0x3d')],'browserName':_0xc1c669[_0x844e('0x3e')][_0x844e('0x31')]&&_0xc1c669[_0x844e('0x3e')][_0x844e('0x3f')]?util[_0x844e('0x40')](_0x844e('0x41'),_0xc1c669[_0x844e('0x3e')]['name'],_0xc1c669[_0x844e('0x3e')][_0x844e('0x3f')]):_0x844e('0x42'),'browserVersion':_0xc1c669['browser']['version']||_0x844e('0x42'),'osName':util[_0x844e('0x40')](_0x844e('0x41'),_0xc1c669['os']['name'],_0xc1c669['os']['version']),'osVersion':_0xc1c669['os']['version'],'deviceModel':_0xc1c669['device'][_0x844e('0x43')]&&_0xc1c669[_0x844e('0x44')][_0x844e('0x45')]?util[_0x844e('0x40')](_0x844e('0x46'),_0xc1c669['device'][_0x844e('0x43')],_0xc1c669['device']['vendor'],_0xc1c669[_0x844e('0x44')][_0x844e('0x47')]):null,'deviceVendor':_0xc1c669[_0x844e('0x44')][_0x844e('0x45')],'deviceType':_0xc1c669['device'][_0x844e('0x47')],'formData':JSON[_0x844e('0x1c')](_0x13614e)};}exports[_0x844e('0x48')]=function(_0x5ee193,_0x36ef59){var _0x1bcbda={'include':[{'model':db[_0x844e('0x49')],'as':_0x844e('0x4a')}]},_0x558f21={},_0x3c6502={'count':0x0,'rows':[]};var _0x443c7a=_[_0x844e('0x4b')](db[_0x844e('0x4c')]['rawAttributes'],function(_0x200932){return{'name':_0x200932[_0x844e('0x4d')],'type':_0x200932[_0x844e('0x47')][_0x844e('0x4e')]};});_0x558f21[_0x844e('0x43')]=_[_0x844e('0x4b')](_0x443c7a,_0x844e('0x31'));_0x558f21[_0x844e('0x4f')]=_[_0x844e('0x50')](_0x5ee193[_0x844e('0x4f')]);_0x558f21['filters']=_[_0x844e('0x51')](_0x558f21[_0x844e('0x43')],_0x558f21[_0x844e('0x4f')]);_0x1bcbda['attributes']=_[_0x844e('0x51')](_0x558f21[_0x844e('0x43')],qs[_0x844e('0x52')](_0x5ee193[_0x844e('0x4f')][_0x844e('0x52')]));_0x1bcbda[_0x844e('0x53')]=_0x1bcbda[_0x844e('0x53')]['length']?_0x1bcbda[_0x844e('0x53')]:_0x558f21[_0x844e('0x43')];if(!_0x5ee193[_0x844e('0x4f')][_0x844e('0x54')](_0x844e('0x55'))){_0x1bcbda[_0x844e('0x27')]=qs[_0x844e('0x27')](_0x5ee193[_0x844e('0x4f')][_0x844e('0x27')]);_0x1bcbda[_0x844e('0x26')]=qs[_0x844e('0x26')](_0x5ee193[_0x844e('0x4f')][_0x844e('0x26')]);}_0x1bcbda['order']=qs[_0x844e('0x56')](_0x5ee193[_0x844e('0x4f')][_0x844e('0x56')]);_0x1bcbda[_0x844e('0x57')]=qs[_0x844e('0x58')](_[_0x844e('0x59')](_0x5ee193['query'],_0x558f21[_0x844e('0x58')]),_0x443c7a);if(_0x5ee193[_0x844e('0x4f')]['filter']){_0x1bcbda[_0x844e('0x57')]=_[_0x844e('0x5a')](_0x1bcbda[_0x844e('0x57')],{'$or':_[_0x844e('0x4b')](_0x443c7a,function(_0x26eec5){if(_0x26eec5[_0x844e('0x47')]!==_0x844e('0x5b')){var _0x10e5ac={};_0x10e5ac[_0x26eec5[_0x844e('0x31')]]={'$like':'%'+_0x5ee193[_0x844e('0x4f')][_0x844e('0x5c')]+'%'};return _0x10e5ac;}})});}_0x1bcbda=_[_0x844e('0x5a')]({},_0x1bcbda,_0x5ee193[_0x844e('0x5d')]);var _0x3de2c0={'where':_0x1bcbda['where']};return db[_0x844e('0x4c')][_0x844e('0x29')](_0x3de2c0)['then'](function(_0x1aa783){_0x3c6502['count']=_0x1aa783;if(_0x5ee193[_0x844e('0x4f')][_0x844e('0x5e')]){_0x1bcbda[_0x844e('0x5f')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x1bcbda);})[_0x844e('0x18')](function(_0x4f7e9b){_0x3c6502[_0x844e('0x60')]=_0x4f7e9b;return _0x3c6502;})[_0x844e('0x18')](respondWithFilteredResult(_0x36ef59,_0x1bcbda))[_0x844e('0x22')](handleError(_0x36ef59,null));};exports['show']=function(_0x13ebe8,_0x3d66e4){var _0x4656ab={'raw':![],'where':{'id':_0x13ebe8['params']['id']},'include':[{'model':db[_0x844e('0x49')],'as':_0x844e('0x4a')}]},_0x192457={};_0x192457[_0x844e('0x43')]=_['keys'](db['ChatWebsite'][_0x844e('0x61')]);_0x192457[_0x844e('0x4f')]=_[_0x844e('0x50')](_0x13ebe8['query']);_0x192457['filters']=_[_0x844e('0x51')](_0x192457[_0x844e('0x43')],_0x192457[_0x844e('0x4f')]);_0x4656ab['attributes']=_[_0x844e('0x51')](_0x192457[_0x844e('0x43')],qs[_0x844e('0x52')](_0x13ebe8['query'][_0x844e('0x52')]));_0x4656ab[_0x844e('0x53')]=_0x4656ab[_0x844e('0x53')][_0x844e('0x62')]?_0x4656ab['attributes']:_0x192457[_0x844e('0x43')];if(_0x13ebe8[_0x844e('0x4f')][_0x844e('0x5e')]){_0x4656ab[_0x844e('0x5f')]=[{'all':!![]}];}_0x4656ab=_[_0x844e('0x5a')]({},_0x4656ab,_0x13ebe8[_0x844e('0x5d')]);return db[_0x844e('0x4c')][_0x844e('0x63')](_0x4656ab)['then'](handleEntityNotFound(_0x3d66e4,null))['then'](respondWithResult(_0x3d66e4,null))[_0x844e('0x22')](handleError(_0x3d66e4,null));};exports['create']=function(_0x252ff9,_0x3bde32){var _0x3753cd=null;_0x252ff9[_0x844e('0x64')]['address']['split'](',')['forEach'](_0x4e4ece=>{if(_0x4e4ece['trim']()!==''&&!wildcardUtils['testWildcardValidity'](_0x4e4ece[_0x844e('0x65')]())){_0x3753cd=new APIBadRequestError('\x22'+_0x4e4ece[_0x844e('0x65')]()+_0x844e('0x66'));}});if(_0x3753cd){return handleError(_0x3bde32,null)(_0x3753cd);}return db['ChatWebsite'][_0x844e('0x67')](_0x252ff9[_0x844e('0x64')],{})['then'](function(_0x19af4e){var _0x5ec1e9=_0x252ff9[_0x844e('0x68')][_0x844e('0x69')]({'plain':!![]});if(!_0x5ec1e9)throw new Error(_0x844e('0x6a'));if(_0x5ec1e9[_0x844e('0x6b')]==='user'){var _0x5554e2=_0x19af4e['get']({'plain':!![]});var _0x314586=_0x844e('0x2d');return db[_0x844e('0x6c')][_0x844e('0x63')]({'where':{'name':_0x314586,'userProfileId':_0x5ec1e9[_0x844e('0x6d')]},'raw':!![]})['then'](function(_0x566718){if(_0x566718&&_0x566718[_0x844e('0x6e')]===0x0){return db[_0x844e('0x6f')][_0x844e('0x67')]({'name':_0x5554e2[_0x844e('0x31')],'resourceId':_0x5554e2['id'],'type':_0x566718[_0x844e('0x31')],'sectionId':_0x566718['id']},{})[_0x844e('0x18')](function(){return _0x19af4e;});}else{return _0x19af4e;}})['catch'](function(_0x97d37c){logger[_0x844e('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x97d37c);throw _0x97d37c;});}return _0x19af4e;})[_0x844e('0x18')](respondWithResult(_0x3bde32,0xc9))[_0x844e('0x22')](handleError(_0x3bde32,null));};exports['update']=function(_0x5839e3,_0x240572){var _0x20cac2=null;_0x5839e3[_0x844e('0x64')]['address']['split'](',')['forEach'](_0x452073=>{if(_0x452073['trim']()!==''&&!wildcardUtils[_0x844e('0x70')](_0x452073[_0x844e('0x65')]())){_0x20cac2=new APIBadRequestError('\x22'+_0x452073[_0x844e('0x65')]()+_0x844e('0x66'));}});if(_0x20cac2){return handleError(_0x240572,null)(_0x20cac2);}if(_0x5839e3[_0x844e('0x64')]['id']){delete _0x5839e3[_0x844e('0x64')]['id'];}return db['ChatWebsite'][_0x844e('0x63')]({'where':{'id':_0x5839e3[_0x844e('0x71')]['id']},'include':[{'model':db['Pause'],'as':_0x844e('0x4a')}]})[_0x844e('0x18')](handleEntityNotFound(_0x240572,null))[_0x844e('0x18')](saveUpdates(_0x5839e3[_0x844e('0x64')],null))[_0x844e('0x18')](respondWithResult(_0x240572,null))['catch'](handleError(_0x240572,null));};exports['destroy']=function(_0x304e7b,_0x14b226){return db[_0x844e('0x4c')][_0x844e('0x63')]({'where':{'id':_0x304e7b[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x14b226,null))[_0x844e('0x18')](removeEntity(_0x14b226,null))['catch'](handleError(_0x14b226,null));};exports[_0x844e('0x72')]=function(_0x7c1b20,_0x484833){return db[_0x844e('0x4c')][_0x844e('0x72')]()[_0x844e('0x18')](respondWithResult(_0x484833,null))['catch'](handleError(_0x484833,null));};exports['addDisposition']=function(_0x2123e4,_0x277087){if(_0x2123e4['body']['id']){delete _0x2123e4[_0x844e('0x64')]['id'];}return db[_0x844e('0x4c')][_0x844e('0x63')]({'where':{'id':_0x2123e4[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x277087,null))[_0x844e('0x18')](function(_0x35d7f3){if(_0x35d7f3){_0x2123e4['body'][_0x844e('0x73')]=_0x35d7f3['id'];return db['Disposition'][_0x844e('0x67')](_0x2123e4['body']);}})[_0x844e('0x18')](respondWithResult(_0x277087,null))['catch'](handleError(_0x277087,null));};exports[_0x844e('0x74')]=function(_0x23c91b,_0x52b49a){var _0x37748e={'raw':![],'where':{}};var _0x3faf7d={};var _0xaae76d={'count':0x0,'rows':[]};return db[_0x844e('0x4c')][_0x844e('0x75')]({'where':{'id':_0x23c91b['params']['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x52b49a,null))[_0x844e('0x18')](function(_0x2a87e6){if(_0x2a87e6){_0x3faf7d[_0x844e('0x43')]=_[_0x844e('0x50')](db[_0x844e('0x76')][_0x844e('0x61')]);_0x3faf7d[_0x844e('0x4f')]=_[_0x844e('0x50')](_0x23c91b[_0x844e('0x4f')]);_0x3faf7d['filters']=_[_0x844e('0x51')](_0x3faf7d[_0x844e('0x43')],_0x3faf7d[_0x844e('0x4f')]);_0x37748e[_0x844e('0x53')]=_[_0x844e('0x51')](_0x3faf7d[_0x844e('0x43')],qs[_0x844e('0x52')](_0x23c91b[_0x844e('0x4f')][_0x844e('0x52')]));_0x37748e[_0x844e('0x53')]=_0x37748e[_0x844e('0x53')][_0x844e('0x62')]?_0x37748e[_0x844e('0x53')]:_0x3faf7d[_0x844e('0x43')];if(!_0x23c91b[_0x844e('0x4f')]['hasOwnProperty'](_0x844e('0x55'))){_0x37748e['limit']=qs[_0x844e('0x27')](_0x23c91b[_0x844e('0x4f')][_0x844e('0x27')]);_0x37748e[_0x844e('0x26')]=qs[_0x844e('0x26')](_0x23c91b['query'][_0x844e('0x26')]);}_0x37748e[_0x844e('0x77')]=qs[_0x844e('0x56')](_0x23c91b['query']['sort']);_0x37748e[_0x844e('0x57')]=qs[_0x844e('0x58')](_['pick'](_0x23c91b[_0x844e('0x4f')],_0x3faf7d[_0x844e('0x58')]));_0x37748e[_0x844e('0x57')][_0x844e('0x73')]=_0x2a87e6['id'];if(_0x23c91b[_0x844e('0x4f')][_0x844e('0x5c')]){_0x37748e[_0x844e('0x57')]=_[_0x844e('0x5a')](_0x37748e[_0x844e('0x57')],{'$or':_['map'](_0x37748e[_0x844e('0x53')],function(_0x47d5e9){var _0x3c8f7b={};_0x3c8f7b[_0x47d5e9]={'$like':'%'+_0x23c91b[_0x844e('0x4f')][_0x844e('0x5c')]+'%'};return _0x3c8f7b;})});}_0x37748e=_[_0x844e('0x5a')]({},_0x37748e,_0x23c91b[_0x844e('0x5d')]);return db['Disposition'][_0x844e('0x29')]({'where':_0x37748e[_0x844e('0x57')]})['then'](function(_0x1c1f04){_0xaae76d[_0x844e('0x29')]=_0x1c1f04;if(_0x23c91b[_0x844e('0x4f')][_0x844e('0x5e')]){_0x37748e[_0x844e('0x5f')]=[{'all':!![]}];}return db['Disposition'][_0x844e('0x78')](_0x37748e);})[_0x844e('0x18')](function(_0x510811){_0xaae76d['rows']=_0x510811;return _0xaae76d;});}})['then'](respondWithFilteredResult(_0x52b49a,_0x37748e))[_0x844e('0x22')](handleError(_0x52b49a,null));};exports[_0x844e('0x79')]=function(_0x569d9b,_0x24733b){return db[_0x844e('0x4c')][_0x844e('0x63')]({'where':{'id':_0x569d9b[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x24733b,null))['then'](function(_0x537ace){if(_0x537ace){return _0x537ace['removeDispositions'](_0x569d9b[_0x844e('0x4f')][_0x844e('0x7a')]);}})[_0x844e('0x18')](respondWithStatusCode(_0x24733b,null))[_0x844e('0x22')](handleError(_0x24733b,null));};exports['addAnswer']=function(_0x5d01e2,_0x475295){if(_0x5d01e2[_0x844e('0x64')]['id']){delete _0x5d01e2[_0x844e('0x64')]['id'];}return db[_0x844e('0x4c')][_0x844e('0x63')]({'where':{'id':_0x5d01e2['params']['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x475295,null))[_0x844e('0x18')](function(_0x5c807b){if(_0x5c807b){_0x5d01e2[_0x844e('0x64')]['ChatWebsiteId']=_0x5c807b['id'];return db[_0x844e('0x7b')][_0x844e('0x67')](_0x5d01e2[_0x844e('0x64')]);}})[_0x844e('0x18')](respondWithResult(_0x475295,null))[_0x844e('0x22')](handleError(_0x475295,null));};exports[_0x844e('0x7c')]=function(_0x2029fc,_0x7ca8d1){var _0x5abd61={'raw':![],'where':{}};var _0xad6ae6={};var _0x406886={'count':0x0,'rows':[]};return db[_0x844e('0x4c')][_0x844e('0x75')]({'where':{'id':_0x2029fc[_0x844e('0x71')]['id']}})['then'](handleEntityNotFound(_0x7ca8d1,null))[_0x844e('0x18')](function(_0x44d08f){if(_0x44d08f){_0xad6ae6[_0x844e('0x43')]=_[_0x844e('0x50')](db[_0x844e('0x7b')][_0x844e('0x61')]);_0xad6ae6[_0x844e('0x4f')]=_['keys'](_0x2029fc['query']);_0xad6ae6[_0x844e('0x58')]=_[_0x844e('0x51')](_0xad6ae6[_0x844e('0x43')],_0xad6ae6['query']);_0x5abd61[_0x844e('0x53')]=_[_0x844e('0x51')](_0xad6ae6[_0x844e('0x43')],qs[_0x844e('0x52')](_0x2029fc['query'][_0x844e('0x52')]));_0x5abd61[_0x844e('0x53')]=_0x5abd61[_0x844e('0x53')]['length']?_0x5abd61[_0x844e('0x53')]:_0xad6ae6[_0x844e('0x43')];if(!_0x2029fc['query'][_0x844e('0x54')](_0x844e('0x55'))){_0x5abd61[_0x844e('0x27')]=qs[_0x844e('0x27')](_0x2029fc[_0x844e('0x4f')][_0x844e('0x27')]);_0x5abd61['offset']=qs[_0x844e('0x26')](_0x2029fc[_0x844e('0x4f')][_0x844e('0x26')]);}_0x5abd61[_0x844e('0x77')]=qs[_0x844e('0x56')](_0x2029fc[_0x844e('0x4f')]['sort']);_0x5abd61[_0x844e('0x57')]=qs[_0x844e('0x58')](_[_0x844e('0x59')](_0x2029fc[_0x844e('0x4f')],_0xad6ae6[_0x844e('0x58')]));_0x5abd61[_0x844e('0x57')][_0x844e('0x73')]=_0x44d08f['id'];if(_0x2029fc['query']['filter']){_0x5abd61['where']=_[_0x844e('0x5a')](_0x5abd61[_0x844e('0x57')],{'$or':_[_0x844e('0x4b')](_0x5abd61[_0x844e('0x53')],function(_0x3205d8){var _0x1072f5={};_0x1072f5[_0x3205d8]={'$like':'%'+_0x2029fc[_0x844e('0x4f')][_0x844e('0x5c')]+'%'};return _0x1072f5;})});}_0x5abd61=_[_0x844e('0x5a')]({},_0x5abd61,_0x2029fc['options']);return db['CannedAnswer'][_0x844e('0x29')]({'where':_0x5abd61['where']})[_0x844e('0x18')](function(_0x4a8ce1){_0x406886[_0x844e('0x29')]=_0x4a8ce1;if(_0x2029fc[_0x844e('0x4f')][_0x844e('0x5e')]){_0x5abd61[_0x844e('0x5f')]=[{'all':!![]}];}return db[_0x844e('0x7b')][_0x844e('0x78')](_0x5abd61);})['then'](function(_0x4ae58a){_0x406886['rows']=_0x4ae58a;return _0x406886;});}})[_0x844e('0x18')](respondWithFilteredResult(_0x7ca8d1,_0x5abd61))[_0x844e('0x22')](handleError(_0x7ca8d1,null));};exports[_0x844e('0x7d')]=function(_0x3bd5a8,_0x50890f){return db['ChatWebsite']['find']({'where':{'id':_0x3bd5a8[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x50890f,null))[_0x844e('0x18')](function(_0x34776d){if(_0x34776d){return _0x34776d[_0x844e('0x7d')](_0x3bd5a8[_0x844e('0x4f')][_0x844e('0x7a')]);}})['then'](respondWithStatusCode(_0x50890f,null))[_0x844e('0x22')](handleError(_0x50890f,null));};exports[_0x844e('0x7e')]=function(_0x85d5d6,_0x4dacb6){_0x85d5d6[_0x844e('0x64')][_0x844e('0x7f')]=_0x85d5d6[_0x844e('0x80')]['filename'];return db['ChatWebsite'][_0x844e('0x63')]({'where':{'id':_0x85d5d6['params']['id']}})['then'](handleEntityNotFound(_0x4dacb6,null))[_0x844e('0x18')](saveUpdates(_0x85d5d6[_0x844e('0x64')],null))['then'](respondWithResult(_0x4dacb6,null))[_0x844e('0x22')](handleError(_0x4dacb6,null));};exports[_0x844e('0x81')]=function(_0x25f26e,_0x5055c5){_0x25f26e[_0x844e('0x64')][_0x844e('0x82')]=_0x25f26e[_0x844e('0x80')][_0x844e('0x83')];return db['ChatWebsite'][_0x844e('0x63')]({'where':{'id':_0x25f26e[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x5055c5,null))[_0x844e('0x18')](saveUpdates(_0x25f26e['body'],null))[_0x844e('0x18')](respondWithResult(_0x5055c5,null))[_0x844e('0x22')](handleError(_0x5055c5,null));};exports['addCustomerAvatar']=function(_0x53d2fd,_0x35f43b){_0x53d2fd[_0x844e('0x64')][_0x844e('0x84')]=_0x53d2fd['file'][_0x844e('0x83')];return db[_0x844e('0x4c')][_0x844e('0x63')]({'where':{'id':_0x53d2fd['params']['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x35f43b,null))[_0x844e('0x18')](saveUpdates(_0x53d2fd['body'],null))[_0x844e('0x18')](respondWithResult(_0x35f43b,null))[_0x844e('0x22')](handleError(_0x35f43b,null));};exports[_0x844e('0x85')]=function(_0x52af21,_0x3bb589){_0x52af21[_0x844e('0x64')]['systemAvatar']=_0x52af21[_0x844e('0x80')][_0x844e('0x83')];return db[_0x844e('0x4c')][_0x844e('0x63')]({'where':{'id':_0x52af21['params']['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x3bb589,null))['then'](saveUpdates(_0x52af21[_0x844e('0x64')],null))[_0x844e('0x18')](respondWithResult(_0x3bb589,null))[_0x844e('0x22')](handleError(_0x3bb589,null));};exports['getLogo']=function(_0x43a9a7,_0x4c0140){var _0x22cc4b=path[_0x844e('0x86')](config[_0x844e('0x87')],'server/files/images/logos/default_logo.svg');var _0x1f5b23={'where':{'id':_0x43a9a7[_0x844e('0x71')]['id']},'attributes':['id',_0x844e('0x7f')],'raw':!![]};var _0x17a815=![];return require(_0x844e('0x88'))[_0x844e('0x89')]()[_0x844e('0x18')](function(_0x8fc499){if(_0x8fc499){_0x17a815=_0x8fc499[_0x844e('0x8a')];}})[_0x844e('0x18')](function(){return db[_0x844e('0x4c')][_0x844e('0x63')](_0x1f5b23);})[_0x844e('0x18')](handleEntityNotFound(_0x4c0140,null))[_0x844e('0x18')](function(_0x1e89e4){if(_0x1e89e4){if(!_[_0x844e('0x8b')](_0x1e89e4['sitepic'])){if(fs[_0x844e('0x8c')](path[_0x844e('0x86')](config[_0x844e('0x87')],'server/files/images/logos/',_0x1e89e4['sitepic']))&&_0x17a815){_0x22cc4b=path[_0x844e('0x86')](config[_0x844e('0x87')],_0x844e('0x8d'),_0x1e89e4[_0x844e('0x7f')]);}}return _0x4c0140[_0x844e('0x8e')](_0x22cc4b);}})['catch'](handleError(_0x4c0140,null));};exports[_0x844e('0x8f')]=function(_0xcfe967,_0x3fa9f7){var _0x5a77ac=path['join'](config[_0x844e('0x87')],_0x844e('0x90'));var _0x4939a9={'where':{'id':_0xcfe967['params']['id']},'attributes':['id',_0x844e('0x82')],'raw':!![]};return db[_0x844e('0x4c')][_0x844e('0x63')](_0x4939a9)['then'](handleEntityNotFound(_0x3fa9f7,null))[_0x844e('0x18')](function(_0x2259fa){if(_0x2259fa){if(!_['isNil'](_0x2259fa['agentAvatar'])){if(fs['existsSync'](path['join'](config['root'],_0x844e('0x91'),_0x2259fa[_0x844e('0x82')]))){_0x5a77ac=path[_0x844e('0x86')](config[_0x844e('0x87')],'server/files/images/avatars/',_0x2259fa['agentAvatar']);}}return _0x3fa9f7[_0x844e('0x8e')](_0x5a77ac);}})['catch'](handleError(_0x3fa9f7,null));};exports[_0x844e('0x92')]=function(_0x324938,_0xa0fdd1){var _0x2f31c1=path['join'](config['root'],_0x844e('0x93'));var _0x4a1ffc={'where':{'id':_0x324938[_0x844e('0x71')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x844e('0x4c')][_0x844e('0x63')](_0x4a1ffc)['then'](handleEntityNotFound(_0xa0fdd1,null))[_0x844e('0x18')](function(_0x548b0b){if(_0x548b0b){if(!_[_0x844e('0x8b')](_0x548b0b[_0x844e('0x84')])){if(fs[_0x844e('0x8c')](path[_0x844e('0x86')](config['root'],_0x844e('0x91'),_0x548b0b[_0x844e('0x84')]))&&_0x548b0b[_0x844e('0x94')]){_0x2f31c1=path['join'](config['root'],_0x844e('0x91'),_0x548b0b[_0x844e('0x84')]);}}return _0xa0fdd1[_0x844e('0x8e')](_0x2f31c1);}})[_0x844e('0x22')](handleError(_0xa0fdd1,null));};exports[_0x844e('0x95')]=function(_0x2bf367,_0xf4a1e1){var _0x2af775=path[_0x844e('0x86')](config['root'],_0x844e('0x96'));var _0x5715ed={'where':{'id':_0x2bf367[_0x844e('0x71')]['id']},'attributes':['id',_0x844e('0x97')],'raw':!![]};return db['ChatWebsite'][_0x844e('0x63')](_0x5715ed)[_0x844e('0x18')](handleEntityNotFound(_0xf4a1e1,null))[_0x844e('0x18')](function(_0x2dc1db){if(_0x2dc1db){if(!_['isNil'](_0x2dc1db['systemAvatar'])){if(fs[_0x844e('0x8c')](path[_0x844e('0x86')](config['root'],_0x844e('0x91'),_0x2dc1db[_0x844e('0x97')]))){_0x2af775=path['join'](config[_0x844e('0x87')],_0x844e('0x91'),_0x2dc1db['systemAvatar']);}}return _0xf4a1e1['download'](_0x2af775);}})[_0x844e('0x22')](handleError(_0xf4a1e1,null));};function checkWebsiteInterval(_0x1ccd80){var _0x109d7b=_0x1ccd80[_0x844e('0x98')];if(!_0x109d7b){return Promise['resolve'](_0x1ccd80);}var _0x402e17=_0x1ccd80[_0x844e('0x99')]||undefined;return _0x109d7b[_0x844e('0x9a')](_0x402e17)[_0x844e('0x18')](function(_0xe930df){if(!_0xe930df){throw new APIOutOfIntervalError();}return _0x1ccd80;});}exports['notify']=function(_0x5a3db3,_0x4f00cb){var _0x2354a4={'body':_0x5a3db3[_0x844e('0x64')],'channel':'chat'};var _0x3ce7eb=[];var _0x149434=[];var _0x4f6862={};var _0x5117fd=![];if(_0x5a3db3[_0x844e('0x64')]['id']){delete _0x5a3db3[_0x844e('0x64')]['id'];}if(_[_0x844e('0x8b')](_0x5a3db3[_0x844e('0x64')][_0x844e('0x9b')])){throw new APIBadRequestError(_0x844e('0x9c'));}if(_['isNil'](_0x5a3db3[_0x844e('0x64')][_0x844e('0x9d')])){throw new APIBadRequestError(_0x844e('0x9e'));}if(_[_0x844e('0x9f')](_0x5a3db3[_0x844e('0x64')][_0x844e('0x64')])){throw new APIBadRequestError(_0x844e('0xa0'));}var _0x18ddb5=_0x5a3db3[_0x844e('0x64')][_0x844e('0x37')]&&_0x5a3db3[_0x844e('0x64')][_0x844e('0x3d')];return db[_0x844e('0xa1')][_0x844e('0x72')]()['then'](function(_0x1203c6){if(!_0x1203c6){throw new Error(_0x844e('0xa2'));}_0x3ce7eb=Object[_0x844e('0x50')](_0x1203c6)[_0x844e('0x5c')](function(_0x5692ff){return![_0x844e('0xa3'),_0x844e('0xa4')][_0x844e('0xa5')](_0x5692ff);});_0x149434=Object[_0x844e('0x50')](_0x1203c6)[_0x844e('0x5c')](function(_0x5d9730){return![_0x844e('0xa3'),'updatedAt',_0x844e('0xa6'),_0x844e('0xa7')][_0x844e('0xa5')](_0x5d9730);});if(!_[_0x844e('0xa5')](_0x149434,_0x5a3db3[_0x844e('0x64')][_0x844e('0x9d')])){throw new APIBadRequestError(_0x844e('0xa8')+_0x149434[_0x844e('0x86')](',\x20'));}_0x4f6862[_0x5a3db3[_0x844e('0x64')][_0x844e('0x9d')]]=_0x5a3db3['body'][_0x844e('0x9b')];})['then'](function(){return db['ChatWebsite'][_0x844e('0x63')]({'where':{'id':_0x5a3db3['params']['id']},'include':[{'model':db[_0x844e('0xa9')],'as':'List','include':[{'model':db[_0x844e('0xa1')],'as':'Contacts','where':_0x4f6862,'limit':0x1,'order':[[_0x844e('0xa4'),'DESC']]}]},{'model':db[_0x844e('0xaa')],'as':_0x844e('0xab')},{'model':db['Interval'],'as':_0x844e('0x98'),'include':[{'model':db[_0x844e('0x98')],'as':_0x844e('0xac'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x844e('0x18')](function(_0x30caf3){if(!_0x30caf3){throw new APINotFoundError(util[_0x844e('0x40')](_0x844e('0xad'),_0x5a3db3[_0x844e('0x71')]['id']));}if(_0x18ddb5){return checkWebsiteInterval(_0x30caf3);}return _0x30caf3;})['then'](function(_0x5b4355){_0x2354a4[_0x844e('0xae')]=_0x5b4355;_0x2354a4[_0x844e('0xaf')]=_[_0x844e('0xb0')](_0x5b4355[_0x844e('0xab')],[_0x844e('0xb1')],[_0x844e('0xb2')]);if(_0x2354a4[_0x844e('0xae')][_0x844e('0xab')]){delete _0x2354a4[_0x844e('0xae')][_0x844e('0xab')];}_0x2354a4[_0x844e('0xb3')]=_0x5b4355[_0x844e('0xb4')]||{'id':_0x5b4355[_0x844e('0xa7')]};if(_0x2354a4['list']&&_0x2354a4['list'][_0x844e('0xb5')]['length']){return _0x2354a4[_0x844e('0xb3')]['Contacts'][0x0];}var _0x1d29a2=_['defaults'](_0x5a3db3[_0x844e('0x64')],{'firstName':_0x5a3db3[_0x844e('0x64')][_0x844e('0x9b')],'ListId':_0x5b4355[_0x844e('0xa7')]});_0x1d29a2[_0x5a3db3['body'][_0x844e('0x9d')]]=_0x5a3db3[_0x844e('0x64')][_0x844e('0x9b')];return db[_0x844e('0xa1')][_0x844e('0x67')](_0x1d29a2,{'fields':_0x3ce7eb,'raw':!![]});})[_0x844e('0x18')](function(_0x19a451){_0x2354a4[_0x844e('0xb6')]=_0x19a451;var _0x35bf98=createInteractionObject(_0x5a3db3[_0x844e('0x71')]['id'],_0x5a3db3[_0x844e('0x64')],_0x5a3db3[_0x844e('0xb7')],_0x19a451);var _0x184654={'ChatWebsiteId':_0x5a3db3[_0x844e('0x71')]['id']};if(_0x5a3db3[_0x844e('0x64')]['threadId']){_0x184654[_0x844e('0xb8')]=_0x5a3db3[_0x844e('0x64')][_0x844e('0xb8')];_0x184654[_0x844e('0xb9')]=![];return db[_0x844e('0xba')][_0x844e('0x63')]({'where':_0x184654})[_0x844e('0x18')](function(_0x51fd3a){var _0x11933d=_0x5a3db3[_0x844e('0x64')][_0x844e('0x37')]&&_0x5a3db3['body'][_0x844e('0x3d')];if(_0x51fd3a){_0x5117fd=!![];return _0x51fd3a;}else if(!_0x11933d&&_0x51fd3a&&_0x51fd3a[_0x844e('0xb9')]){throw new APIConflictError(_0x844e('0xbb'));}_0x35bf98[_0x844e('0xb8')]=_0x5a3db3['body'][_0x844e('0xb8')];_0x35bf98[_0x844e('0xbc')]=_0x5a3db3[_0x844e('0x64')][_0x844e('0xbc')];return db['ChatInteraction'][_0x844e('0x67')](_0x35bf98);});}_0x184654['ContactId']=_0x19a451['id'];if(_0x5a3db3[_0x844e('0x64')][_0x844e('0xbd')]&&_0x5a3db3['body'][_0x844e('0xbd')]['id']){_0x184654['id']=_0x5a3db3[_0x844e('0x64')][_0x844e('0xbd')]['id'];return db['ChatInteraction'][_0x844e('0x63')]({'where':_0x184654})[_0x844e('0x18')](function(_0x51b0a8){var _0x11e415=_0x5a3db3[_0x844e('0x64')][_0x844e('0x37')]&&_0x5a3db3[_0x844e('0x64')][_0x844e('0x3d')];if(!_0x11e415&&_0x51b0a8&&_0x51b0a8[_0x844e('0xb9')]){throw new APIConflictError(_0x844e('0xbb'));}else if(_0x51b0a8){_0x5117fd=!![];return _0x51b0a8;}else{return db['ChatInteraction'][_0x844e('0x67')](_0x35bf98);}});}return db[_0x844e('0xba')][_0x844e('0x67')](_0x35bf98);})[_0x844e('0x18')](function(_0x3a04b6){if(!_0x5117fd){return _0x3a04b6;}var _0x18c156={'from':(_0x2354a4['contact'][_0x844e('0xbe')]||'')+'\x20'+(_0x2354a4[_0x844e('0xb6')][_0x844e('0x3b')]||'')};if(_0x5a3db3[_0x844e('0x64')][_0x844e('0xb8')]&&_0x5a3db3[_0x844e('0x64')]['messageId']&&_0x5a3db3['body']['threadId']!=_0x5a3db3[_0x844e('0x64')][_0x844e('0xbf')]){_0x18c156[_0x844e('0xb8')]=_0x5a3db3[_0x844e('0x64')][_0x844e('0xbf')];}return _0x3a04b6[_0x844e('0x2c')](_0x18c156);})[_0x844e('0x18')](function(_0x346f18){_0x2354a4[_0x844e('0xbd')]=_0x346f18[_0x844e('0x69')]({'plain':!![]});_0x2354a4[_0x844e('0xbd')]['created']=!_0x5117fd;if(_0x2354a4['interaction']['created']){if(_0x2354a4[_0x844e('0xae')][_0x844e('0xc0')]){_0x2354a4['applications'][_0x844e('0xc1')]({'id':0x0,'priority':_0x2354a4['applications'][_0x844e('0x62')]+0x1,'app':_0x844e('0xc2'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x844e('0xc3')][_0x844e('0x67')]({'body':_0x5a3db3[_0x844e('0x64')]['body'],'ChatWebsiteId':_0x5a3db3[_0x844e('0x71')]['id'],'ChatInteractionId':_0x346f18['id'],'direction':'in','ContactId':_0x2354a4[_0x844e('0xb6')]['id'],'AttachmentId':_0x5a3db3[_0x844e('0x64')]['AttachmentId']});})[_0x844e('0x18')](function(_0x38eeb7){_0x2354a4['message']=_0x38eeb7;if(!_0x2354a4['interaction'][_0x844e('0xc4')]){return;}return db[_0x844e('0xc5')]['find']({'attributes':['id',_0x844e('0x31')],'where':{'id':_0x2354a4[_0x844e('0xbd')]['UserId']}});})[_0x844e('0x18')](function(_0x4a66f9){if(_0x4a66f9){_0x2354a4['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4a66f9['name']+','+(_0x2354a4['account']['waitForTheAssignedAgent']||0xa),'interval':_0x844e('0xc6')});_0x2354a4[_0x844e('0xc7')]=!![];}if(!_0x2354a4[_0x844e('0xbd')][_0x844e('0xc8')]){return;}return db[_0x844e('0xc9')][_0x844e('0x63')]({'attributes':['id',_0x844e('0x31')],'where':{'id':_0x2354a4[_0x844e('0xbd')][_0x844e('0xc8')]}});})[_0x844e('0x18')](function(_0x1d7463){if(_0x1d7463){_0x2354a4['applications'][_0x844e('0xca')]({'id':0x0,'priority':0x1,'app':_0x844e('0xcb'),'appdata':_0x1d7463[_0x844e('0x31')]+','+(_0x2354a4['account']['waitForTheAssignedQueue']||0x12c),'interval':_0x844e('0xc6')});}return respondWithRpcPromise(_0x844e('0xcc'),_0x844e('0xcd'),_0x2354a4);})['then'](function(_0x539f14){respondWithRpcPromise(_0x844e('0xce'),_0x844e('0xce'),{'event':_0x844e('0xcf'),'message':_0x539f14},client9002);return _0x539f14;})[_0x844e('0x18')](respondWithResult(_0x4f00cb,null))[_0x844e('0x22')](APIHandleError(_0x4f00cb));};exports['offline']=function(_0x1775e8,_0x419a89){var _0x9bfa01,_0x134a28,_0x8a753b;var _0x40f5e4=[];var _0x39edd0={};var _0xee01a6=_0x1775e8['files']||[];var _0x374113=[];var _0x1dc407;return db[_0x844e('0xa1')][_0x844e('0x72')]()['then'](function(_0x680da6){if(!_0x680da6){throw new db[(_0x844e('0xd0'))]['ValidationError']('no\x20available\x20attributes');}_0x40f5e4=_[_0x844e('0xd1')](_[_0x844e('0x50')](_0x680da6),[_0x844e('0xa3'),_0x844e('0xa4'),_0x844e('0xa6'),_0x844e('0xa7')]);if(_0x1775e8[_0x844e('0x64')]['id']){delete _0x1775e8['body']['id'];}if(_[_0x844e('0x8b')](_0x1775e8[_0x844e('0x64')][_0x844e('0x9b')])){throw _0x419a89[_0x844e('0x24')](0x1f4)[_0x844e('0x32')](new db[(_0x844e('0xd0'))][(_0x844e('0xd2'))](_0x844e('0xd3')));}if(_[_0x844e('0x8b')](_0x1775e8['body'][_0x844e('0x64')])||_0x1775e8[_0x844e('0x64')][_0x844e('0x64')]===''){throw _0x419a89[_0x844e('0x24')](0x1f4)[_0x844e('0x32')](new db[(_0x844e('0xd0'))][(_0x844e('0xd2'))](_0x844e('0xd4')));}if(_[_0x844e('0x8b')](_0x1775e8['body']['mapKeyOffline'])){throw _0x419a89['status'](0x1f4)[_0x844e('0x32')](new db[(_0x844e('0xd0'))][(_0x844e('0xd2'))](_0x844e('0xd5')+_0x40f5e4));}if(!_['includes'](_0x40f5e4,_0x1775e8[_0x844e('0x64')][_0x844e('0xd6')])){throw _0x419a89[_0x844e('0x24')](0x1f4)[_0x844e('0x32')](new db['Sequelize'][(_0x844e('0xd2'))](_0x844e('0xd7')+_0x40f5e4));}_0x39edd0[_0x1775e8[_0x844e('0x64')][_0x844e('0xd6')]]=_0x1775e8[_0x844e('0x64')][_0x844e('0x9b')];})[_0x844e('0x18')](function(){return db[_0x844e('0x4c')][_0x844e('0x63')]({'where':{'id':_0x1775e8['params']['id']},'include':[{'model':db[_0x844e('0xa9')],'as':_0x844e('0xb4')},{'model':db[_0x844e('0xd8')],'as':_0x844e('0xd8')}]});})[_0x844e('0x18')](handleEntityNotFound(_0x419a89,null))[_0x844e('0x18')](function(_0x5a65b2){if(_0x5a65b2&&_0x5a65b2[_0x844e('0xb4')]){_0x134a28=_0x5a65b2;var _0x19c6fd=_[_0x844e('0x13')](_0x1775e8[_0x844e('0x64')],{'firstName':_0x1775e8[_0x844e('0x64')]['from'],'phone':_0x1775e8[_0x844e('0x64')][_0x844e('0x9b')],'ListId':_0x5a65b2[_0x844e('0xa7')]});_0x19c6fd[_0x1775e8[_0x844e('0x64')][_0x844e('0xd6')]]=_0x1775e8[_0x844e('0x64')]['from'];return db['CmContact']['findOrCreate']({'where':_0x39edd0,'defaults':_0x19c6fd});}})[_0x844e('0xd9')](function(_0x2e7e15){if(_0x2e7e15){_0x8a753b=_0x2e7e15;var _0x54fc71=fs[_0x844e('0xda')](path[_0x844e('0x86')](config[_0x844e('0x87')],'server/files/templates/chatOfflineMessage.ejs'),_0x844e('0xdb'));var _0x5f2970=ejs[_0x844e('0xdc')](_0x54fc71,{'body':_[_0x844e('0xdd')](_0x1775e8[_0x844e('0x64')]['body']),'bodyTitle':_0x134a28[_0x844e('0xde')]});return db[_0x844e('0xdf')]['create']({'body':_0x5f2970,'plainBody':htmlToText[_0x844e('0xe0')](_0x5f2970),'ContactId':_0x2e7e15['id'],'ChatWebsiteId':_0x134a28['id']});}})[_0x844e('0x18')](function(_0x582cf0){_0x1dc407=_0x582cf0;if(_0xee01a6[_0x844e('0x62')]){var _0x24c326=_0xee01a6['map'](function(_0x23b6ef){return{'name':_0x23b6ef[_0x844e('0xe1')],'basename':_0x23b6ef[_0x844e('0x83')],'type':_0x23b6ef[_0x844e('0xe2')],'ChatOfflineMessageId':_0x582cf0['id']};});_0x374113=_0x24c326[_0x844e('0x4b')](_0x1b9da7=>{var _0x283ec2={'filename':_0x1b9da7[_0x844e('0x31')],'path':path[_0x844e('0x86')](config[_0x844e('0x87')],_0x844e('0xe3'),_0x844e('0xe4'),_0x844e('0xe5'),_0x844e('0xe6'),_0x1b9da7['basename'])};return _0x283ec2;});if(!_0x134a28[_0x844e('0xe7')]){return db[_0x844e('0xe8')]['transaction'](function(_0x21b2e0){return db[_0x844e('0xe9')][_0x844e('0xea')](_0x24c326,{'transaction':_0x21b2e0});});}}})[_0x844e('0x18')](function(){if(_0x1dc407){_0x9bfa01=_0x1dc407;return db[_0x844e('0xd8')][_0x844e('0x75')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x844e('0xeb'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x844e('0xec'),'raw':!![]}]}]});}})[_0x844e('0x18')](function(_0x252760){if(_0x252760&&_0x252760[_0x844e('0xeb')]&&_0x134a28[_0x844e('0xed')]&&_0x134a28[_0x844e('0xee')]){var _0x28cdae=_0x252760['getSmtpOptions']();return respondWithRpcPromise(_0x844e('0xef'),'sendMail',{'account':_0x28cdae,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x252760[_0x844e('0x31')],_0x252760[_0x844e('0xf0')]||_0x252760[_0x844e('0xeb')]['user']),'to':_0x134a28[_0x844e('0xee')],'subject':_0x134a28[_0x844e('0xf1')],'html':_0x9bfa01[_0x844e('0x64')],'attachments':_0x374113}},client9003)[_0x844e('0x18')](function(){return _0x9bfa01;})[_0x844e('0x22')](function(_0x641902){logger[_0x844e('0x1d')](_0x641902);});}})['then'](function(){if(_0x134a28&&_0x134a28['openNewInteraction']&&_0x134a28[_0x844e('0xf2')]){var _0x5262d4=[];if(_0xee01a6[_0x844e('0x62')]){_0x5262d4=_0xee01a6[_0x844e('0x4b')](function(_0x4245e2){return{'name':_0x4245e2[_0x844e('0xe1')],'basename':_0x4245e2['filename'],'type':_0x4245e2[_0x844e('0xe2')],'ChatOfflineMessageId':_0x1dc407['id']};});}var _0x2204a1;if(!_[_0x844e('0x8b')](_0x134a28[_0x844e('0xf3')])){var _0x2b9a03=_[_0x844e('0x4b')](_0x1775e8['body'],function(_0x58d81c){return _0x58d81c;});var _0x21870b=_['toPairsIn'](_0x2b9a03)[0x0];var _0x112955=_['mapValues'](_0x21870b,function(_0x34873b){return _0x34873b;});_0x2204a1=_0x112955[0x1][_0x134a28[_0x844e('0xf3')]];}var _0x51cd1a={'from':_0x8a753b[_0x844e('0xf0')],'firstName':_0x8a753b[_0x844e('0xbe')],'lastName':_0x8a753b[_0x844e('0x3b')],'mapKey':_0x844e('0xf0'),'message':{'from':_0x8a753b[_0x844e('0xf0')],'to':_0x134a28[_0x844e('0xd8')]['email'],'cc':'','subject':_['isNil'](_0x2204a1)?_0x134a28['offlineMessageSubject']:_0x2204a1,'messageId':'','sentAt':new Date(),'attach':_0x5262d4['length'],'attachments':_0x5262d4,'originChannel':_0x844e('0xf4'),'ChatWebsiteId':_0x134a28['id'],'ChatOfflineMessageId':_0x9bfa01['id'],'originTo':_0x134a28[_0x844e('0xd8')][_0x844e('0xf0')]},'body':_0x9bfa01['body']};var _0x3606d4={'account':{'id':_0x134a28[_0x844e('0xf2')]},'body':_0x51cd1a,'log':_0x844e('0xf5')};return respondWithRpcPromise(_0x844e('0xf5'),'notifyMail',_0x3606d4,client9001)[_0x844e('0x18')](function(){return _0x9bfa01;})[_0x844e('0x22')](function(_0x5383ac){logger[_0x844e('0x1d')](_0x5383ac);});}return;})[_0x844e('0x18')](function(){if(_0x9bfa01){return _0x9bfa01;}})[_0x844e('0x18')](respondWithResult(_0x419a89,null))['catch'](function(){for(var _0x476be2 of _0xee01a6){var _0x14f9f5=path[_0x844e('0x86')](config['root'],_0x844e('0xe3'),'files',_0x844e('0xe5'),_0x844e('0xe6'),_0x476be2[_0x844e('0x83')]);fs_extra[_0x844e('0xf6')](_0x14f9f5)[_0x844e('0x22')](function(_0x31e571){logger[_0x844e('0x1d')](_0x844e('0xf7'),_0x14f9f5,_0x31e571);});}});};exports[_0x844e('0xf8')]=function(_0xf21b7c,_0x22c85e){return db[_0x844e('0xba')]['find']({'where':{'id':_0xf21b7c[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x22c85e,null))['then'](function(_0x1ff9b5){if(_0x1ff9b5){return _0x1ff9b5[_0x844e('0xf8')](_0xf21b7c[_0x844e('0x64')][_0x844e('0x7a')],_[_0x844e('0xf9')](_0xf21b7c[_0x844e('0x64')],[_0x844e('0x7a'),'id'])||{});}})[_0x844e('0x18')](respondWithResult(_0x22c85e,null))['catch'](handleError(_0x22c85e,null));};exports[_0x844e('0xfa')]=function(_0x55b540,_0x44157e){var _0x11cb2f={'raw':![],'where':{}};var _0x17518a={};var _0xe328bd={'count':0x0,'rows':[]};return db[_0x844e('0x4c')]['findOne']({'where':{'id':_0x55b540[_0x844e('0x71')]['id']}})['then'](handleEntityNotFound(_0x44157e,null))[_0x844e('0x18')](function(_0x1d51e1){if(_0x1d51e1){_0x17518a[_0x844e('0x43')]=_['keys'](db[_0x844e('0xba')][_0x844e('0x61')]);_0x17518a[_0x844e('0x4f')]=_[_0x844e('0x50')](_0x55b540[_0x844e('0x4f')]);_0x17518a['filters']=_['intersection'](_0x17518a[_0x844e('0x43')],_0x17518a[_0x844e('0x4f')]);_0x11cb2f[_0x844e('0x53')]=_[_0x844e('0x51')](_0x17518a[_0x844e('0x43')],qs[_0x844e('0x52')](_0x55b540[_0x844e('0x4f')][_0x844e('0x52')]));_0x11cb2f[_0x844e('0x53')]=_0x11cb2f['attributes'][_0x844e('0x62')]?_0x11cb2f['attributes']:_0x17518a[_0x844e('0x43')];if(!_0x55b540[_0x844e('0x4f')]['hasOwnProperty'](_0x844e('0x55'))){_0x11cb2f[_0x844e('0x27')]=qs[_0x844e('0x27')](_0x55b540[_0x844e('0x4f')][_0x844e('0x27')]);_0x11cb2f['offset']=qs[_0x844e('0x26')](_0x55b540['query'][_0x844e('0x26')]);}_0x11cb2f[_0x844e('0x77')]=qs['sort'](_0x55b540['query'][_0x844e('0x56')]);_0x11cb2f[_0x844e('0x57')]=qs[_0x844e('0x58')](_[_0x844e('0x59')](_0x55b540['query'],_0x17518a[_0x844e('0x58')]));_0x11cb2f[_0x844e('0x57')][_0x844e('0x73')]=_0x1d51e1['id'];if(_0x55b540[_0x844e('0x4f')][_0x844e('0x5c')]){_0x11cb2f['where']=_[_0x844e('0x5a')](_0x11cb2f[_0x844e('0x57')],{'$or':_[_0x844e('0x4b')](_0x11cb2f['attributes'],function(_0x2ea280){var _0x5f225d={};_0x5f225d[_0x2ea280]={'$like':'%'+_0x55b540[_0x844e('0x4f')][_0x844e('0x5c')]+'%'};return _0x5f225d;})});}_0x11cb2f=_[_0x844e('0x5a')]({},_0x11cb2f,_0x55b540[_0x844e('0x5d')]);return db['ChatInteraction'][_0x844e('0x29')]({'where':_0x11cb2f[_0x844e('0x57')]})[_0x844e('0x18')](function(_0x19edb8){_0xe328bd[_0x844e('0x29')]=_0x19edb8;if(_0x55b540[_0x844e('0x4f')]['includeAll']){_0x11cb2f[_0x844e('0x5f')]=[{'model':db['CmContact'],'as':_0x844e('0xfb'),'required':![]},{'model':db['User'],'as':_0x844e('0xfc'),'attributes':[_0x844e('0x31'),_0x844e('0xfd'),_0x844e('0xfe')],'required':![]},{'model':db[_0x844e('0xff')],'as':_0x844e('0x100'),'attributes':['id',_0x844e('0x31'),'color'],'where':_0x55b540[_0x844e('0x4f')]['tag']?{'id':_0x55b540[_0x844e('0x4f')]['tag']}:undefined,'required':_0x55b540[_0x844e('0x4f')][_0x844e('0x101')]?!![]:![]}];}return db[_0x844e('0xba')][_0x844e('0x78')](_0x11cb2f);})[_0x844e('0x18')](function(_0x4ccac6){_0xe328bd['rows']=_0x4ccac6;return _0xe328bd;});}})[_0x844e('0x18')](respondWithFilteredResult(_0x44157e,_0x11cb2f))['catch'](handleError(_0x44157e,null));};exports[_0x844e('0x102')]=function(_0x48d973,_0x1d6abb){var _0x454b5d=0x0;var _0x358b3e=0x0;var _0x53be53=![];var _0x2e48e3;var _0x4ec13f;return db[_0x844e('0x4c')][_0x844e('0x63')]({'where':{'id':_0x48d973[_0x844e('0x71')]['id']},'include':[{'model':db[_0x844e('0x98')],'as':_0x844e('0x98'),'include':[{'model':db[_0x844e('0x98')],'as':_0x844e('0xac'),'attributes':['id',_0x844e('0x103')]}]}]})[_0x844e('0x18')](handleEntityNotFound(_0x1d6abb,null))[_0x844e('0x18')](function(_0x418bd1){if(_0x418bd1){_0x2e48e3=_0x418bd1;return _0x418bd1['getProactiveActions']({'raw':!![]});}})[_0x844e('0x18')](function(_0x5132d8){if(_0x2e48e3){if(_0x5132d8){_0x4ec13f=_0x5132d8;}}return require(_0x844e('0x88'))['getLicense']();})[_0x844e('0x18')](function(_0x6fb171){if(_0x6fb171){_0x358b3e=_0x6fb171[_0x844e('0x104')];_0x53be53=_0x6fb171[_0x844e('0x8a')];}})[_0x844e('0x18')](function(){return db[_0x844e('0xba')][_0x844e('0x29')]({'where':{'closed':![]}});})['then'](function(_0x1f545e){_0x454b5d=_0x1f545e;if(_0x358b3e&&_0x1f545e>_0x358b3e){return db[_0x844e('0x105')][_0x844e('0x75')]({'where':{'id':0x1}})[_0x844e('0x18')](function(_0x1b75b8){if(_0x1b75b8){_0x1b75b8[_0x844e('0x106')](_0x844e('0x107'));}});}})[_0x844e('0x18')](function(){var _0x5222da=_0x2e48e3[_0x844e('0x98')];var _0x64f058=_0x2e48e3['timezone']||undefined;return _0x5222da?_0x5222da[_0x844e('0x9a')](_0x64f058):!![];})[_0x844e('0x18')](function(_0x3c8f88){var _0x103475=fs[_0x844e('0xda')](path['join'](config[_0x844e('0x87')],_0x844e('0x108')),_0x844e('0xdb'));var _0x1597ba=_0x844e('0x109');var _0x3a8782=![];var _0xb0d533,_0x5cb72d;if(_0x48d973[_0x844e('0xb7')][_0x844e('0x3d')]){_0xb0d533=new URL(_0x48d973['headers']['referer'])[_0x844e('0x10a')];}else if(_0x48d973['headers'][_0x844e('0x10a')]){_0xb0d533=new URL(_0x48d973['headers'][_0x844e('0x10a')])[_0x844e('0x10a')];}else{_0xb0d533='http://localhost:9000';}_0x5cb72d=typeof _0x2e48e3['address']['split'](',')[_0x844e('0x63')](function(_0x1df711){return wildcardUtils[_0x844e('0x10b')](_0x1df711,_0xb0d533);})!==_0x844e('0x28');var _0x1ea83d={'chatVersion':_0x1597ba,'chatWebsiteAddressOrigin':_0x5cb72d?_0xb0d533:_0x2e48e3[_0x844e('0x10c')],'remote':_0x2e48e3[_0x844e('0x10d')],'query':querystring[_0x844e('0x1c')](_[_0x844e('0x5a')](_0x2e48e3[_0x844e('0x69')]({'plain':!![]}),{'customerIp':_0x48d973['headers'][_0x844e('0x10e')]||_0x48d973[_0x844e('0xb7')][_0x844e('0x10f')]||_0x48d973[_0x844e('0x110')][_0x844e('0x111')]||_0x48d973['ip'],'referer':_0x48d973['headers'][_0x844e('0x3d')],'openedInteractions':_0x454b5d,'maxInteractions':_0x358b3e,'virtual':_0x53be53[_0x844e('0x104')],'online':_0x3c8f88,'custom':_0x53be53,'address':_0x5cb72d?_0xb0d533:null}))[_0x844e('0x112')](/'/g,'\x5c\x27')};_0x1d6abb[_0x844e('0x32')](ejs[_0x844e('0xdc')](Mustache[_0x844e('0xdc')](_0x103475,_0x1ea83d),{'proactiveActions':_0x4ec13f,'alignment':_0x2e48e3[_0x844e('0x113')],'verticalAlignment':_0x2e48e3[_0x844e('0x114')],'div_color':_0x2e48e3[_0x844e('0x115')],'labelText':_0x2e48e3['labelText'],'text_color':_0x2e48e3[_0x844e('0x116')],'text_button_color':_0x2e48e3[_0x844e('0x117')],'button_color':_0x2e48e3[_0x844e('0x118')],'background_color':_0x2e48e3[_0x844e('0x119')],'hideWhenOffline':_0x2e48e3[_0x844e('0x11a')],'intervalId':_0x2e48e3['IntervalId'],'isDevelopment':_0x3a8782,'chatVersion':_0x1597ba}));})['catch'](handleError(_0x1d6abb,null));};exports[_0x844e('0x11b')]=function(_0x430aa0,_0x322107){var _0x4c81e3=_0x430aa0[_0x844e('0x71')]['id'];var _0x3764ff=_0x430aa0['body'];var _0x1aeb99=0xc8;var _0x125934=null;return db[_0x844e('0xe8')][_0x844e('0x11c')]({'isolationLevel':db[_0x844e('0xe8')][_0x844e('0x11d')][_0x844e('0x11e')][_0x844e('0x11f')]},function(_0x399cbe){return db[_0x844e('0x4c')][_0x844e('0x75')]({'where':{'id':_0x4c81e3},'transaction':_0x399cbe})[_0x844e('0x18')](function(_0x379e7f){if(_0x379e7f){return db[_0x844e('0xaa')][_0x844e('0x2e')]({'where':{'ChatWebsiteId':_0x4c81e3},'transaction':_0x399cbe})['then'](function(){var _0x2bd40c=_[_0x844e('0x4b')](_0x3764ff,function(_0x3bb23a){_0x3bb23a[_0x844e('0x73')]=_0x4c81e3;return _0x3bb23a;});return db[_0x844e('0xaa')][_0x844e('0xea')](_0x2bd40c,{'transaction':_0x399cbe});});}else{_0x1aeb99=0x194;_0x125934=[];}});})[_0x844e('0x18')](function(){if(_0x1aeb99!==0x194){return db[_0x844e('0xaa')][_0x844e('0x120')]({'where':{'ChatWebsiteId':_0x4c81e3},'order':_0x844e('0xb1')})['then'](function(_0x43d971){_0x125934=_0x43d971;});}})[_0x844e('0x22')](function(_0x49f92a){_0x1aeb99=0x1f4;logger['error'](_0x49f92a[_0x844e('0x30')]);if(_0x49f92a[_0x844e('0x31')]){delete _0x49f92a['name'];}_0x125934=_0x49f92a;})[_0x844e('0x121')](function(){if(_0x125934===null){_0x322107[_0x844e('0x23')](_0x1aeb99);}else{if(_0x1aeb99===0x1f4){_0x322107[_0x844e('0x24')](_0x1aeb99)[_0x844e('0x32')](_0x125934);}else{_0x322107['status'](_0x1aeb99)[_0x844e('0x25')](_0x125934);}}});};exports[_0x844e('0x122')]=function(_0x365207,_0x5e5288){var _0xeae328={};var _0x1cda40={};var _0x3f5d8a;var _0x3d674e;return db[_0x844e('0x4c')][_0x844e('0x75')]({'where':{'id':_0x365207[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x5e5288,null))['then'](function(_0x5744ae){if(_0x5744ae){_0x3f5d8a=_0x5744ae;_0x1cda40[_0x844e('0x43')]=_[_0x844e('0x50')](db[_0x844e('0xaa')][_0x844e('0x61')]);_0x1cda40['query']=_[_0x844e('0x50')](_0x365207[_0x844e('0x4f')]);_0x1cda40[_0x844e('0x58')]=_[_0x844e('0x51')](_0x1cda40['model'],_0x1cda40[_0x844e('0x4f')]);_0xeae328[_0x844e('0x53')]=_['intersection'](_0x1cda40[_0x844e('0x43')],qs['fields'](_0x365207['query']['fields']));_0xeae328[_0x844e('0x53')]=_0xeae328['attributes'][_0x844e('0x62')]?_0xeae328[_0x844e('0x53')]:_0x1cda40[_0x844e('0x43')];_0xeae328[_0x844e('0x77')]=qs['sort'](_0x365207['query'][_0x844e('0x56')]);_0xeae328[_0x844e('0x57')]=qs[_0x844e('0x58')](_[_0x844e('0x59')](_0x365207[_0x844e('0x4f')],_0x1cda40['filters']));if(_0x365207[_0x844e('0x4f')][_0x844e('0x5c')]){_0xeae328[_0x844e('0x57')]=_[_0x844e('0x5a')](_0xeae328[_0x844e('0x57')],{'$or':_[_0x844e('0x4b')](_0xeae328[_0x844e('0x53')],function(_0x5d9434){var _0x424401={};_0x424401[_0x5d9434]={'$like':'%'+_0x365207[_0x844e('0x4f')][_0x844e('0x5c')]+'%'};return _0x424401;})});}_0xeae328=_[_0x844e('0x5a')]({},_0xeae328,_0x365207[_0x844e('0x5d')]);return _0x3f5d8a[_0x844e('0x122')](_0xeae328);}})[_0x844e('0x18')](function(_0x3e4e2d){if(_0x3e4e2d){_0x3d674e=_0x3e4e2d[_0x844e('0x62')];if(!_0x365207['query'][_0x844e('0x54')]('nolimit')){_0xeae328['limit']=qs[_0x844e('0x27')](_0x365207[_0x844e('0x4f')][_0x844e('0x27')]);_0xeae328[_0x844e('0x26')]=qs['offset'](_0x365207[_0x844e('0x4f')][_0x844e('0x26')]);}return _0x3f5d8a[_0x844e('0x122')](_0xeae328);}})['then'](function(_0x4f8c2f){if(_0x4f8c2f){return _0x4f8c2f?{'count':_0x3d674e,'rows':_0x4f8c2f}:null;}})['then'](respondWithResult(_0x5e5288,null))[_0x844e('0x22')](handleError(_0x5e5288,null));};exports[_0x844e('0x123')]=function(_0x276b5f,_0x150283){return db[_0x844e('0x124')]['find']({'where':{'id':_0x276b5f[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x150283,null))[_0x844e('0x18')](function(_0x215591){if(_0x215591){return _0x215591[_0x844e('0x123')](_0x276b5f[_0x844e('0x64')][_0x844e('0x7a')],_[_0x844e('0xf9')](_0x276b5f['body'],[_0x844e('0x7a'),'id'])||{});}})[_0x844e('0x18')](respondWithResult(_0x150283,null))[_0x844e('0x22')](handleError(_0x150283,null));};exports[_0x844e('0x125')]=function(_0x170007,_0x37ab57){var _0x4ab1c2={};var _0x395f9a={};var _0x1a8bc8;var _0x44a70d;return db[_0x844e('0x4c')][_0x844e('0x75')]({'where':{'id':_0x170007[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x37ab57,null))['then'](function(_0x34f187){if(_0x34f187){_0x1a8bc8=_0x34f187;_0x395f9a[_0x844e('0x43')]=_[_0x844e('0x50')](db[_0x844e('0x126')][_0x844e('0x61')]);_0x395f9a[_0x844e('0x4f')]=_[_0x844e('0x50')](_0x170007[_0x844e('0x4f')]);_0x395f9a[_0x844e('0x58')]=_[_0x844e('0x51')](_0x395f9a[_0x844e('0x43')],_0x395f9a[_0x844e('0x4f')]);_0x4ab1c2[_0x844e('0x53')]=_[_0x844e('0x51')](_0x395f9a[_0x844e('0x43')],qs['fields'](_0x170007[_0x844e('0x4f')][_0x844e('0x52')]));_0x4ab1c2[_0x844e('0x53')]=_0x4ab1c2[_0x844e('0x53')][_0x844e('0x62')]?_0x4ab1c2['attributes']:_0x395f9a['model'];_0x4ab1c2[_0x844e('0x77')]=qs[_0x844e('0x56')](_0x170007[_0x844e('0x4f')]['sort']);_0x4ab1c2[_0x844e('0x57')]=qs[_0x844e('0x58')](_['pick'](_0x170007[_0x844e('0x4f')],_0x395f9a[_0x844e('0x58')]));if(_0x170007[_0x844e('0x4f')][_0x844e('0x5c')]){_0x4ab1c2[_0x844e('0x57')]=_[_0x844e('0x5a')](_0x4ab1c2[_0x844e('0x57')],{'$or':_[_0x844e('0x4b')](_0x4ab1c2[_0x844e('0x53')],function(_0x404095){var _0x145b21={};_0x145b21[_0x404095]={'$like':'%'+_0x170007['query']['filter']+'%'};return _0x145b21;})});}_0x4ab1c2=_[_0x844e('0x5a')]({},_0x4ab1c2,_0x170007[_0x844e('0x5d')]);return _0x1a8bc8['getProactiveActions'](_0x4ab1c2);}})[_0x844e('0x18')](function(_0x417f5f){if(_0x417f5f){_0x44a70d=_0x417f5f[_0x844e('0x62')];if(!_0x170007['query'][_0x844e('0x54')]('nolimit')){_0x4ab1c2[_0x844e('0x27')]=qs[_0x844e('0x27')](_0x170007[_0x844e('0x4f')][_0x844e('0x27')]);_0x4ab1c2['offset']=qs[_0x844e('0x26')](_0x170007['query']['offset']);}return _0x1a8bc8[_0x844e('0x125')](_0x4ab1c2);}})[_0x844e('0x18')](function(_0x1d02fb){if(_0x1d02fb){return _0x1d02fb?{'count':_0x44a70d,'rows':_0x1d02fb}:null;}})[_0x844e('0x18')](respondWithResult(_0x37ab57,null))['catch'](handleError(_0x37ab57,null));};exports[_0x844e('0x127')]=function(_0x1bf2bb,_0x508207){var _0x426bb8=_0x1bf2bb[_0x844e('0x4f')]['online']==='false'?_0x844e('0x128'):_0x844e('0x129');return db[_0x844e('0x4c')][_0x844e('0x63')]({'attributes':['id',_0x426bb8],'where':{'id':_0x1bf2bb[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x508207,null))[_0x844e('0x18')](function(_0x582c0d){if(_0x582c0d){var _0x44a22b=_0x582c0d[_0x426bb8];var _0x55eec1=_0x44a22b&&_0x44a22b[_0x844e('0x12a')]?_0x44a22b['items']:[];_0x508207[_0x844e('0x32')]({'fromKey':_['isNil'](_0x44a22b[_0x844e('0x12b')])?undefined:_0x44a22b[_0x844e('0x12b')],'count':_0x55eec1['length'],'rows':_0x55eec1});}})[_0x844e('0x22')](handleError(_0x508207,null));};exports[_0x844e('0x12c')]=function(_0x737f9f,_0x2a5a1b){var _0x3d0557={'raw':![],'where':{}};var _0x2d4040={};var _0x165544={'count':0x0,'rows':[]};return db[_0x844e('0x4c')][_0x844e('0x75')]({'where':{'id':_0x737f9f[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x2a5a1b,null))[_0x844e('0x18')](function(_0xe324e0){if(_0xe324e0){_0x2d4040[_0x844e('0x43')]=_[_0x844e('0x50')](db[_0x844e('0xdf')][_0x844e('0x61')]);_0x2d4040['query']=_[_0x844e('0x50')](_0x737f9f[_0x844e('0x4f')]);_0x2d4040['filters']=_[_0x844e('0x51')](_0x2d4040[_0x844e('0x43')],_0x2d4040['query']);_0x3d0557['attributes']=_[_0x844e('0x51')](_0x2d4040[_0x844e('0x43')],qs[_0x844e('0x52')](_0x737f9f[_0x844e('0x4f')][_0x844e('0x52')]));_0x3d0557['attributes']=_0x3d0557[_0x844e('0x53')][_0x844e('0x62')]?_0x3d0557['attributes']:_0x2d4040[_0x844e('0x43')];if(!_0x737f9f[_0x844e('0x4f')][_0x844e('0x54')]('nolimit')){_0x3d0557[_0x844e('0x27')]=qs[_0x844e('0x27')](_0x737f9f[_0x844e('0x4f')][_0x844e('0x27')]);_0x3d0557[_0x844e('0x26')]=qs['offset'](_0x737f9f[_0x844e('0x4f')]['offset']);}_0x3d0557[_0x844e('0x77')]=qs[_0x844e('0x56')](_0x737f9f[_0x844e('0x4f')][_0x844e('0x56')]);_0x3d0557['where']=qs['filters'](_[_0x844e('0x59')](_0x737f9f['query'],_0x2d4040[_0x844e('0x58')]));_0x3d0557[_0x844e('0x57')][_0x844e('0x73')]=_0xe324e0['id'];if(_0x737f9f[_0x844e('0x4f')][_0x844e('0x5c')]){_0x3d0557[_0x844e('0x57')]=_['merge'](_0x3d0557[_0x844e('0x57')],{'$or':_[_0x844e('0x4b')](_0x3d0557[_0x844e('0x53')],function(_0x1d6167){var _0x376b4c={};_0x376b4c[_0x1d6167]={'$like':'%'+_0x737f9f['query'][_0x844e('0x5c')]+'%'};return _0x376b4c;})});}_0x3d0557=_[_0x844e('0x5a')]({},_0x3d0557,_0x737f9f[_0x844e('0x5d')]);return db[_0x844e('0xdf')]['count']({'where':_0x3d0557['where']})[_0x844e('0x18')](function(_0x3a47af){_0x165544[_0x844e('0x29')]=_0x3a47af;if(_0x737f9f['query']['includeAll']){_0x3d0557[_0x844e('0x5f')]=[{'all':!![]}];}else{_0x3d0557[_0x844e('0x5f')]=[{'model':db[_0x844e('0xa1')],'as':_0x844e('0xfb'),'required':![]},{'model':db[_0x844e('0xe9')],'as':_0x844e('0x12d'),'required':![]}];}return db[_0x844e('0xdf')]['findAll'](_0x3d0557);})[_0x844e('0x18')](function(_0x5cc157){_0x165544[_0x844e('0x60')]=_0x5cc157;return _0x165544;});}})[_0x844e('0x18')](respondWithFilteredResult(_0x2a5a1b,_0x3d0557))[_0x844e('0x22')](handleError(_0x2a5a1b,null));};exports[_0x844e('0x12e')]=function(_0x44ac12,_0x13b300){return db[_0x844e('0x4c')]['find']({'where':{'id':_0x44ac12[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x13b300,null))['then'](function(_0x2aed50){if(_0x2aed50){return _0x2aed50[_0x844e('0x12e')](_0x44ac12[_0x844e('0x64')][_0x844e('0x7a')],_[_0x844e('0xf9')](_0x44ac12[_0x844e('0x64')],[_0x844e('0x7a'),'id'])||{})[_0x844e('0xd9')](function(_0x381fb2){for(var _0x4ef040=0x0;_0x4ef040<_0x44ac12[_0x844e('0x64')][_0x844e('0x7a')]['length'];_0x4ef040+=0x1){socket['emit'](_0x844e('0x12f'),{'UserId':Number(_0x44ac12[_0x844e('0x64')]['ids'][_0x4ef040]),'ChatWebsiteId':Number(_0x44ac12['params']['id'])});}return _0x381fb2;});}})[_0x844e('0x18')](respondWithResult(_0x13b300,null))[_0x844e('0x22')](handleError(_0x13b300,null));};exports['removeAgents']=function(_0x1c01c9,_0xe72f44){return db['ChatWebsite']['find']({'where':{'id':_0x1c01c9['params']['id']}})['then'](handleEntityNotFound(_0xe72f44,null))['then'](function(_0x1f6512){if(_0x1f6512){return _0x1f6512[_0x844e('0x130')](_0x1c01c9[_0x844e('0x4f')]['ids'])[_0x844e('0x18')](function(){if(_[_0x844e('0x131')](_0x1c01c9[_0x844e('0x4f')]['ids'])){for(var _0x479b82=0x0;_0x479b82<_0x1c01c9[_0x844e('0x4f')][_0x844e('0x7a')][_0x844e('0x62')];_0x479b82+=0x1){socket[_0x844e('0x132')](_0x844e('0x133'),{'UserId':Number(_0x1c01c9[_0x844e('0x4f')][_0x844e('0x7a')][_0x479b82]),'ChatWebsiteId':Number(_0x1c01c9['params']['id'])});}}else{socket[_0x844e('0x132')](_0x844e('0x133'),{'UserId':Number(_0x1c01c9[_0x844e('0x4f')][_0x844e('0x7a')]),'ChatWebsiteId':Number(_0x1c01c9['params']['id'])});}});}})[_0x844e('0x18')](respondWithStatusCode(_0xe72f44,null))[_0x844e('0x22')](handleError(_0xe72f44,null));};exports[_0x844e('0x134')]=function(_0x1a60b0,_0x155a7a){var _0x3e2b88={};var _0x1415e6={};var _0x92f231;var _0x3601c0;return db[_0x844e('0x4c')][_0x844e('0x75')]({'where':{'id':_0x1a60b0[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x155a7a,null))['then'](function(_0x486ed0){if(_0x486ed0){_0x92f231=_0x486ed0;_0x1415e6[_0x844e('0x43')]=_[_0x844e('0x50')](db[_0x844e('0xc5')][_0x844e('0x61')]);_0x1415e6[_0x844e('0x4f')]=_[_0x844e('0x50')](_0x1a60b0[_0x844e('0x4f')]);_0x1415e6['filters']=_[_0x844e('0x51')](_0x1415e6['model'],_0x1415e6[_0x844e('0x4f')]);_0x3e2b88['attributes']=_[_0x844e('0x51')](_0x1415e6[_0x844e('0x43')],qs[_0x844e('0x52')](_0x1a60b0['query'][_0x844e('0x52')]));_0x3e2b88['attributes']=_0x3e2b88['attributes'][_0x844e('0x62')]?_0x3e2b88['attributes']:_0x1415e6[_0x844e('0x43')];_0x3e2b88[_0x844e('0x77')]=qs[_0x844e('0x56')](_0x1a60b0[_0x844e('0x4f')][_0x844e('0x56')]);_0x3e2b88[_0x844e('0x57')]=qs[_0x844e('0x58')](_[_0x844e('0x59')](_0x1a60b0[_0x844e('0x4f')],_0x1415e6[_0x844e('0x58')]));if(_0x1a60b0['query'][_0x844e('0x5c')]){_0x3e2b88[_0x844e('0x57')]=_[_0x844e('0x5a')](_0x3e2b88[_0x844e('0x57')],{'$or':_['map'](_0x3e2b88['attributes'],function(_0x4b406a){var _0x5c2675={};_0x5c2675[_0x4b406a]={'$like':'%'+_0x1a60b0[_0x844e('0x4f')][_0x844e('0x5c')]+'%'};return _0x5c2675;})});}_0x3e2b88=_[_0x844e('0x5a')]({},_0x3e2b88,_0x1a60b0[_0x844e('0x5d')]);return _0x92f231[_0x844e('0x134')](_0x3e2b88);}})['then'](function(_0x133d31){if(_0x133d31){_0x3601c0=_0x133d31[_0x844e('0x62')];if(!_0x1a60b0['query'][_0x844e('0x54')](_0x844e('0x55'))){_0x3e2b88['limit']=qs[_0x844e('0x27')](_0x1a60b0[_0x844e('0x4f')][_0x844e('0x27')]);_0x3e2b88['offset']=qs[_0x844e('0x26')](_0x1a60b0[_0x844e('0x4f')][_0x844e('0x26')]);}return _0x92f231[_0x844e('0x134')](_0x3e2b88);}})[_0x844e('0x18')](function(_0x23fec3){if(_0x23fec3){return _0x23fec3?{'count':_0x3601c0,'rows':_0x23fec3}:null;}})[_0x844e('0x18')](respondWithResult(_0x155a7a,null))[_0x844e('0x22')](handleError(_0x155a7a,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 69404f9..c3ba9c5 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 _0x4944=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x42d32d,_0xe5bac){var _0x2607b4=function(_0x2d8481){while(--_0x2d8481){_0x42d32d['push'](_0x42d32d['shift']());}};_0x2607b4(++_0xe5bac);}(_0x4944,0x6d));var _0x4494=function(_0x417d14,_0x59a971){_0x417d14=_0x417d14-0x0;var _0x5493cc=_0x4944[_0x417d14];return _0x5493cc;};'use strict';var EventEmitter=require(_0x4494('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x4494('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x4494('0x2')](0x0);var events={'afterCreate':_0x4494('0x3'),'afterUpdate':_0x4494('0x4'),'afterDestroy':_0x4494('0x5')};function emitEvent(_0x5074d9){return function(_0x187098,_0x5c7492,_0x370748){ChatWebsiteEvents[_0x4494('0x6')](_0x5074d9+':'+_0x187098['id'],_0x187098);ChatWebsiteEvents[_0x4494('0x6')](_0x5074d9,_0x187098);_0x370748(null);};}for(var e in events){if(events[_0x4494('0x7')](e)){var event=events[e];ChatWebsite[_0x4494('0x8')](e,emitEvent(event));}}module[_0x4494('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xc252=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update'];(function(_0x4eacbb,_0x1bc3d1){var _0x549393=function(_0x1ebfc0){while(--_0x1ebfc0){_0x4eacbb['push'](_0x4eacbb['shift']());}};_0x549393(++_0x1bc3d1);}(_0xc252,0x118));var _0x2c25=function(_0x42ef26,_0x21a04b){_0x42ef26=_0x42ef26-0x0;var _0x4f61c2=_0xc252[_0x42ef26];return _0x4f61c2;};'use strict';var EventEmitter=require(_0x2c25('0x0'));var ChatWebsite=require(_0x2c25('0x1'))['db'][_0x2c25('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x2c25('0x3')](0x0);var events={'afterCreate':_0x2c25('0x4'),'afterUpdate':_0x2c25('0x5'),'afterDestroy':_0x2c25('0x6')};function emitEvent(_0xd6718e){return function(_0x5815ad,_0x5e2a2a,_0x244f8c){ChatWebsiteEvents['emit'](_0xd6718e+':'+_0x5815ad['id'],_0x5815ad);ChatWebsiteEvents[_0x2c25('0x7')](_0xd6718e,_0x5815ad);_0x244f8c(null);};}for(var e in events){if(events[_0x2c25('0x8')](e)){var event=events[e];ChatWebsite[_0x2c25('0x9')](e,emitEvent(event));}}module[_0x2c25('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 436a58b..bb4cd64 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 _0xb3a0=['chat_websites','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x4bdf64,_0x3022b2){var _0x9a1a19=function(_0x4e551b){while(--_0x4e551b){_0x4bdf64['push'](_0x4bdf64['shift']());}};_0x9a1a19(++_0x3022b2);}(_0xb3a0,0x1e1));var _0x0b3a=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb3a0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0b3a('0x0'));var util=require(_0x0b3a('0x1'));var logger=require(_0x0b3a('0x2'))(_0x0b3a('0x3'));var moment=require(_0x0b3a('0x4'));var BPromise=require(_0x0b3a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b3a('0x6'));var rimraf=require('rimraf');var config=require(_0x0b3a('0x7'));var attributes=require(_0x0b3a('0x8'));module[_0x0b3a('0x9')]=function(_0x695955,_0x1592eb){return _0x695955[_0x0b3a('0xa')]('ChatWebsite',attributes,{'tableName':_0x0b3a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x459e=['lodash','util','api','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x459e,0x18c));var _0xe459=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x459e[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xe459('0x0'));var util=require(_0xe459('0x1'));var logger=require('../../config/logger')(_0xe459('0x2'));var moment=require(_0xe459('0x3'));var BPromise=require('bluebird');var rp=require(_0xe459('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe459('0x5'));var config=require(_0xe459('0x6'));var attributes=require(_0xe459('0x7'));module[_0xe459('0x8')]=function(_0x21bc20,_0x9a1631){return _0x21bc20[_0xe459('0x9')](_0xe459('0xa'),attributes,{'tableName':_0xe459('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 398001d..5480788 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 _0xd5b5=['rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x17c8cc,_0x5e5647){var _0x3db4eb=function(_0x2082db){while(--_0x2082db){_0x17c8cc['push'](_0x17c8cc['shift']());}};_0x3db4eb(++_0x5e5647);}(_0xd5b5,0xec));var _0x5d5b=function(_0x1c7d08,_0x46c032){_0x1c7d08=_0x1c7d08-0x0;var _0x2c6fa2=_0xd5b5[_0x1c7d08];return _0x2c6fa2;};'use strict';var _=require(_0x5d5b('0x0'));var util=require(_0x5d5b('0x1'));var moment=require(_0x5d5b('0x2'));var BPromise=require(_0x5d5b('0x3'));var rs=require(_0x5d5b('0x4'));var fs=require('fs');var Redis=require(_0x5d5b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5d5b('0x6'))(_0x5d5b('0x7'));var config=require(_0x5d5b('0x8'));var jayson=require(_0x5d5b('0x9'));var client=jayson[_0x5d5b('0xa')][_0x5d5b('0xb')]({'port':0x232a});config['redis']=_[_0x5d5b('0xc')](config[_0x5d5b('0xd')],{'host':_0x5d5b('0xe'),'port':0x18eb});var socket=require(_0x5d5b('0xf'))(new Redis(config[_0x5d5b('0xd')]));require(_0x5d5b('0x10'))[_0x5d5b('0x11')](socket);function respondWithRpcPromise(_0x93ca4a,_0x3b70ee,_0x2b149c){return new BPromise(function(_0x4af2c5,_0x578132){return client['request'](_0x93ca4a,_0x2b149c)['then'](function(_0x2aa97e){logger['info'](_0x5d5b('0x12'),_0x3b70ee,_0x5d5b('0x13'));logger[_0x5d5b('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3b70ee,'request\x20sent',JSON[_0x5d5b('0x15')](_0x2aa97e));if(_0x2aa97e[_0x5d5b('0x16')]){if(_0x2aa97e[_0x5d5b('0x16')][_0x5d5b('0x17')]===0x1f4){logger[_0x5d5b('0x16')](_0x5d5b('0x12'),_0x3b70ee,_0x2aa97e[_0x5d5b('0x16')][_0x5d5b('0x18')]);return _0x578132(_0x2aa97e[_0x5d5b('0x16')][_0x5d5b('0x18')]);}logger[_0x5d5b('0x16')](_0x5d5b('0x12'),_0x3b70ee,_0x2aa97e[_0x5d5b('0x16')]['message']);return _0x4af2c5(_0x2aa97e['error']['message']);}else{logger[_0x5d5b('0x19')](_0x5d5b('0x12'),_0x3b70ee,_0x5d5b('0x13'));_0x4af2c5(_0x2aa97e['result'][_0x5d5b('0x18')]);}})[_0x5d5b('0x1a')](function(_0x372a16){logger[_0x5d5b('0x16')](_0x5d5b('0x12'),_0x3b70ee,_0x372a16);_0x578132(_0x372a16);});});}
\ No newline at end of file
+var _0xe6a1=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x144b2b,_0x2a0b0f){var _0x599c5a=function(_0x1da07a){while(--_0x1da07a){_0x144b2b['push'](_0x144b2b['shift']());}};_0x599c5a(++_0x2a0b0f);}(_0xe6a1,0x153));var _0x1e6a=function(_0x16171c,_0x223d97){_0x16171c=_0x16171c-0x0;var _0x3d37c0=_0xe6a1[_0x16171c];return _0x3d37c0;};'use strict';var _=require(_0x1e6a('0x0'));var util=require(_0x1e6a('0x1'));var moment=require('moment');var BPromise=require(_0x1e6a('0x2'));var rs=require(_0x1e6a('0x3'));var fs=require('fs');var Redis=require(_0x1e6a('0x4'));var db=require(_0x1e6a('0x5'))['db'];var utils=require(_0x1e6a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1e6a('0x7'));var jayson=require(_0x1e6a('0x8'));var client=jayson[_0x1e6a('0x9')][_0x1e6a('0xa')]({'port':0x232a});config[_0x1e6a('0xb')]=_[_0x1e6a('0xc')](config[_0x1e6a('0xb')],{'host':_0x1e6a('0xd'),'port':0x18eb});var socket=require(_0x1e6a('0xe'))(new Redis(config[_0x1e6a('0xb')]));require(_0x1e6a('0xf'))['register'](socket);function respondWithRpcPromise(_0x3780d2,_0x486d3f,_0x31bb19){return new BPromise(function(_0x1084ec,_0x2bc7c7){return client['request'](_0x3780d2,_0x31bb19)[_0x1e6a('0x10')](function(_0x976310){logger[_0x1e6a('0x11')](_0x1e6a('0x12'),_0x486d3f,_0x1e6a('0x13'));logger[_0x1e6a('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x486d3f,_0x1e6a('0x13'),JSON[_0x1e6a('0x15')](_0x976310));if(_0x976310[_0x1e6a('0x16')]){if(_0x976310[_0x1e6a('0x16')][_0x1e6a('0x17')]===0x1f4){logger[_0x1e6a('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x486d3f,_0x976310[_0x1e6a('0x16')][_0x1e6a('0x18')]);return _0x2bc7c7(_0x976310[_0x1e6a('0x16')][_0x1e6a('0x18')]);}logger[_0x1e6a('0x16')](_0x1e6a('0x12'),_0x486d3f,_0x976310[_0x1e6a('0x16')][_0x1e6a('0x18')]);return _0x1084ec(_0x976310['error'][_0x1e6a('0x18')]);}else{logger['info'](_0x1e6a('0x12'),_0x486d3f,'request\x20sent');_0x1084ec(_0x976310[_0x1e6a('0x19')][_0x1e6a('0x18')]);}})['catch'](function(_0x42b96a){logger[_0x1e6a('0x16')](_0x1e6a('0x12'),_0x486d3f,_0x42b96a);_0x2bc7c7(_0x42b96a);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 8738969..eccf3ad 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 _0xef7b=['remove','update','emit','removeListener','register','save'];(function(_0x4ca42c,_0x42bc1e){var _0x119e6f=function(_0x1b6822){while(--_0x1b6822){_0x4ca42c['push'](_0x4ca42c['shift']());}};_0x119e6f(++_0x42bc1e);}(_0xef7b,0xd7));var _0xbef7=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0xef7b[_0x35b18a];return _0x4db1bd;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xbef7('0x0'),_0xbef7('0x1'),_0xbef7('0x2')];function createListener(_0x14aa04,_0x4ee82e){return function(_0x22fe3e){_0x4ee82e[_0xbef7('0x3')](_0x14aa04,_0x22fe3e);};}function removeListener(_0x40581f,_0x359cb6){return function(){ChatWebsiteEvents[_0xbef7('0x4')](_0x40581f,_0x359cb6);};}exports[_0xbef7('0x5')]=function(_0xed6ec7){for(var _0x50e382=0x0,_0x5c0b55=events['length'];_0x50e382<_0x5c0b55;_0x50e382++){var _0x52ad2b=events[_0x50e382];var _0x22a2b9=createListener('chatWebsite:'+_0x52ad2b,_0xed6ec7);ChatWebsiteEvents['on'](_0x52ad2b,_0x22a2b9);}};
\ No newline at end of file
+var _0x1c8c=['./chatWebsite.events','save','update','emit','removeListener','chatWebsite:'];(function(_0x46a509,_0x44fa7d){var _0x23832f=function(_0x45d7b3){while(--_0x45d7b3){_0x46a509['push'](_0x46a509['shift']());}};_0x23832f(++_0x44fa7d);}(_0x1c8c,0x180));var _0xc1c8=function(_0x2f1ab5,_0x2966be){_0x2f1ab5=_0x2f1ab5-0x0;var _0x5c7e72=_0x1c8c[_0x2f1ab5];return _0x5c7e72;};'use strict';var ChatWebsiteEvents=require(_0xc1c8('0x0'));var events=[_0xc1c8('0x1'),'remove',_0xc1c8('0x2')];function createListener(_0xcdd249,_0x2f84ce){return function(_0x4eb446){_0x2f84ce[_0xc1c8('0x3')](_0xcdd249,_0x4eb446);};}function removeListener(_0x2820b1,_0x3bdb13){return function(){ChatWebsiteEvents[_0xc1c8('0x4')](_0x2820b1,_0x3bdb13);};}exports['register']=function(_0xb8c6d3){for(var _0x7d174d=0x0,_0xb13b89=events['length'];_0x7d174d<_0xb13b89;_0x7d174d++){var _0x2ec599=events[_0x7d174d];var _0x4d21a9=createListener(_0xc1c8('0x5')+_0x2ec599,_0xb8c6d3);ChatWebsiteEvents['on'](_0x2ec599,_0x4d21a9);}};
\ 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 8797727..f8eb6c8 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 _0x9672=['trim','([\x5cw]+)','localhost','exports','../../../utils/misc','escapeRegExp','URL','replace','test'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0x9672,0xee));var _0x2967=function(_0x497652,_0x27a41b){_0x497652=_0x497652-0x0;var _0x171068=_0x9672[_0x497652];return _0x171068;};var escapeRegExp=require(_0x2967('0x0'))[_0x2967('0x1')];var URL=require('url')[_0x2967('0x2')];function testWildcardValidity(_0xcaaf25){var _0x1228b8=!![];try{new URL(_0xcaaf25[_0x2967('0x3')]('*','localhost'));}catch(_0x264152){_0x1228b8=![];}return _0x1228b8&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x2967('0x4')](_0xcaaf25);}function testWebsiteWithWildcard(_0x22257d,_0x51ddb1){var _0x4baad7;var _0x24424d=escapeRegExp(_0x22257d[_0x2967('0x5')]()[_0x2967('0x3')](/\/$/,''))[_0x2967('0x3')]('\x5c*',_0x2967('0x6'));try{new URL(_0x22257d[_0x2967('0x3')]('\x5c*',_0x2967('0x7')));_0x4baad7=new RegExp(_0x24424d)[_0x2967('0x4')](_0x51ddb1);}catch(_0x4aec0f){_0x4baad7=![];}return _0x4baad7;}module[_0x2967('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x110f=['../../../utils/misc','escapeRegExp','localhost','test','replace','([\x5cw]+)'];(function(_0x293978,_0x5868cb){var _0x45b1e5=function(_0x5b6cdf){while(--_0x5b6cdf){_0x293978['push'](_0x293978['shift']());}};_0x45b1e5(++_0x5868cb);}(_0x110f,0x1e6));var _0xf110=function(_0x129bd0,_0x1f026d){_0x129bd0=_0x129bd0-0x0;var _0x5d6fcb=_0x110f[_0x129bd0];return _0x5d6fcb;};var escapeRegExp=require(_0xf110('0x0'))[_0xf110('0x1')];var URL=require('url')['URL'];function testWildcardValidity(_0x51c98c){var _0x41dd25=!![];try{new URL(_0x51c98c['replace']('*',_0xf110('0x2')));}catch(_0x3f60d0){_0x41dd25=![];}return _0x41dd25&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xf110('0x3')](_0x51c98c);}function testWebsiteWithWildcard(_0x593f50,_0x2f4a0f){var _0x3147fd;var _0xc27675=escapeRegExp(_0x593f50['trim']()[_0xf110('0x4')](/\/$/,''))[_0xf110('0x4')]('\x5c*',_0xf110('0x5'));try{new URL(_0x593f50['replace']('\x5c*',_0xf110('0x2')));_0x3147fd=new RegExp(_0xc27675)[_0xf110('0x3')](_0x2f4a0f);}catch(_0x11c28f){_0x3147fd=![];}return _0x3147fd;}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 5e21108..5d1a50e 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 _0xad69=['isAuthenticated','index','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','diskStorage','/:id/avatar','file','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','addApplications','/:id/proactive_actions','update','delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get'];(function(_0x3d11be,_0x1b9a8c){var _0x4b657b=function(_0x4a96f2){while(--_0x4a96f2){_0x3d11be['push'](_0x3d11be['shift']());}};_0x4b657b(++_0x1b9a8c);}(_0xad69,0x184));var _0x9ad6=function(_0xf9414a,_0x5347ff){_0xf9414a=_0xf9414a-0x0;var _0x328e50=_0xad69[_0xf9414a];return _0x328e50;};'use strict';var multer=require(_0x9ad6('0x0'));var util=require(_0x9ad6('0x1'));var path=require(_0x9ad6('0x2'));var timeout=require(_0x9ad6('0x3'));var express=require('express');var router=express[_0x9ad6('0x4')]();var fs_extra=require(_0x9ad6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9ad6('0x6'));var controller=require('./chatWebsite.controller');router[_0x9ad6('0x7')]('/',auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x9')]);router[_0x9ad6('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x9ad6('0x7')](_0x9ad6('0xa'),auth[_0x9ad6('0x8')](),controller['show']);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x9ad6('0xb')]);router['get'](_0x9ad6('0xc'),auth[_0x9ad6('0x8')](),controller[_0x9ad6('0xd')]);router[_0x9ad6('0x7')](_0x9ad6('0xe'),controller[_0x9ad6('0xf')]);router[_0x9ad6('0x7')]('/:id/avatar',controller[_0x9ad6('0x10')]);router[_0x9ad6('0x7')](_0x9ad6('0x11'),controller[_0x9ad6('0x12')]);router[_0x9ad6('0x7')](_0x9ad6('0x13'),controller[_0x9ad6('0x14')]);router['get'](_0x9ad6('0x15'),auth[_0x9ad6('0x8')](),controller['getInteractions']);router['get']('/:id/snippet',controller[_0x9ad6('0x16')]);router[_0x9ad6('0x7')](_0x9ad6('0x17'),auth['isAuthenticated'](),controller[_0x9ad6('0x18')]);router[_0x9ad6('0x7')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x9ad6('0x19')]);router[_0x9ad6('0x7')]('/:id/fields',controller[_0x9ad6('0x1a')]);router['get']('/:id/offline_messages',auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x1b')]);router[_0x9ad6('0x7')](_0x9ad6('0x1c'),auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x1d')]);router[_0x9ad6('0x1e')]('/',auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x1f')]);router[_0x9ad6('0x1e')](_0x9ad6('0x20'),auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x21')]);router[_0x9ad6('0x1e')](_0x9ad6('0xc'),auth[_0x9ad6('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x36ef32,_0x2edcbc,_0x24e3ac){_0x24e3ac(null,path[_0x9ad6('0x22')](config[_0x9ad6('0x23')],_0x9ad6('0x24')));},'filename':function(_0x5db2f4,_0x5137a2,_0x5e9c65){_0x5e9c65(null,util[_0x9ad6('0x25')](_0x9ad6('0x26'),Date[_0x9ad6('0x27')](),_0x5137a2[_0x9ad6('0x28')]));}})});router[_0x9ad6('0x1e')](_0x9ad6('0xe'),upload[_0x9ad6('0x29')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x9ad6('0x2a')]({'destination':function(_0x18fb2c,_0x7d6df6,_0x4ccdf4){_0x4ccdf4(null,path[_0x9ad6('0x22')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x13a84,_0x11bed3,_0x2dc134){_0x2dc134(null,util['format'](_0x9ad6('0x26'),Date['now'](),_0x11bed3[_0x9ad6('0x28')]));}})});router['post'](_0x9ad6('0x2b'),upload['single'](_0x9ad6('0x2c')),controller[_0x9ad6('0x2d')]);var upload=multer({'storage':multer[_0x9ad6('0x2a')]({'destination':function(_0x44345a,_0x22671d,_0x5d4abd){_0x5d4abd(null,path[_0x9ad6('0x22')](config[_0x9ad6('0x23')],_0x9ad6('0x2e')));},'filename':function(_0x2a0dc5,_0x41704a,_0x218071){_0x218071(null,util[_0x9ad6('0x25')](_0x9ad6('0x26'),Date[_0x9ad6('0x27')](),_0x41704a[_0x9ad6('0x28')]));}})});router['post'](_0x9ad6('0x11'),upload[_0x9ad6('0x29')](_0x9ad6('0x2c')),controller[_0x9ad6('0x2f')]);var upload=multer({'storage':multer[_0x9ad6('0x2a')]({'destination':function(_0x1aa60b,_0x4ab015,_0x507b4a){_0x507b4a(null,path[_0x9ad6('0x22')](config[_0x9ad6('0x23')],_0x9ad6('0x2e')));},'filename':function(_0x209bb9,_0x33af08,_0x431eb4){_0x431eb4(null,util[_0x9ad6('0x25')](_0x9ad6('0x26'),Date[_0x9ad6('0x27')](),_0x33af08[_0x9ad6('0x28')]));}})});router[_0x9ad6('0x1e')](_0x9ad6('0x13'),upload[_0x9ad6('0x29')](_0x9ad6('0x2c')),controller[_0x9ad6('0x30')]);router[_0x9ad6('0x1e')](_0x9ad6('0x31'),controller[_0x9ad6('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0x9ad6('0x2a')]({'destination':function(_0x2af3cf,_0x3b77fa,_0x597661){const _0xf537ba=path[_0x9ad6('0x22')](config[_0x9ad6('0x23')],_0x9ad6('0x33'),'attachments',_0x9ad6('0x34'));fs_extra[_0x9ad6('0x35')](_0xf537ba,function(){_0x597661(null,_0xf537ba);});},'filename':function(_0x3acca5,_0x2917cd,_0x379f66){const _0x48b578=_0x2917cd[_0x9ad6('0x28')][_0x9ad6('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x42e6b3=path[_0x9ad6('0x37')](_0x48b578);const _0x55fb73=Date[_0x9ad6('0x27')]()+'-'+_0x48b578[_0x9ad6('0x36')](_0x42e6b3,'')+_0x42e6b3;_0x379f66(null,_0x55fb73);}})});router[_0x9ad6('0x1e')]('/:id/offline',offlineUploadMulter[_0x9ad6('0x38')](),controller[_0x9ad6('0x39')]);router['post'](_0x9ad6('0x15'),auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x3a')]);router['post'](_0x9ad6('0x17'),auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x3b')]);router['post'](_0x9ad6('0x3c'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x9ad6('0x1e')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x9ad6('0xa'),auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x3d')]);router[_0x9ad6('0x3e')](_0x9ad6('0xa'),auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x3f')]);router[_0x9ad6('0x3e')](_0x9ad6('0x20'),auth['isAuthenticated'](),controller[_0x9ad6('0x40')]);router['delete'](_0x9ad6('0xc'),auth[_0x9ad6('0x8')](),controller['removeAnswers']);router[_0x9ad6('0x3e')](_0x9ad6('0x1c'),auth[_0x9ad6('0x8')](),controller['removeAgents']);module[_0x9ad6('0x41')]=router;
\ No newline at end of file
+var _0x0e2b=['create','/:id/dispositions','addDisposition','post','addAnswer','diskStorage','join','root','format','originalname','single','file','addLogo','server/files/images/avatars/','%s-%s','addAvatar','now','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents'];(function(_0x665846,_0x5503d8){var _0x16c349=function(_0x2b34a9){while(--_0x2b34a9){_0x665846['push'](_0x665846['shift']());}};_0x16c349(++_0x5503d8);}(_0x0e2b,0xc4));var _0xb0e2=function(_0x201b69,_0x4a9b92){_0x201b69=_0x201b69-0x0;var _0x5a0c53=_0x0e2b[_0x201b69];return _0x5a0c53;};'use strict';var multer=require(_0xb0e2('0x0'));var util=require('util');var path=require(_0xb0e2('0x1'));var timeout=require(_0xb0e2('0x2'));var express=require(_0xb0e2('0x3'));var router=express[_0xb0e2('0x4')]();var fs_extra=require(_0xb0e2('0x5'));var auth=require(_0xb0e2('0x6'));var interaction=require(_0xb0e2('0x7'));var config=require('../../config/environment');var controller=require(_0xb0e2('0x8'));router[_0xb0e2('0x9')]('/',auth[_0xb0e2('0xa')](),controller[_0xb0e2('0xb')]);router['get'](_0xb0e2('0xc'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0xd')]);router[_0xb0e2('0x9')](_0xb0e2('0xe'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0xf')]);router[_0xb0e2('0x9')]('/:id/dispositions',auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x10')]);router[_0xb0e2('0x9')](_0xb0e2('0x11'),auth[_0xb0e2('0xa')](),controller['getAnswers']);router[_0xb0e2('0x9')](_0xb0e2('0x12'),controller[_0xb0e2('0x13')]);router[_0xb0e2('0x9')](_0xb0e2('0x14'),controller[_0xb0e2('0x15')]);router[_0xb0e2('0x9')](_0xb0e2('0x16'),controller[_0xb0e2('0x17')]);router[_0xb0e2('0x9')](_0xb0e2('0x18'),controller[_0xb0e2('0x19')]);router[_0xb0e2('0x9')](_0xb0e2('0x1a'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xb0e2('0x9')](_0xb0e2('0x1b'),controller[_0xb0e2('0x1c')]);router[_0xb0e2('0x9')]('/:id/applications',auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x1d')]);router[_0xb0e2('0x9')](_0xb0e2('0x1e'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x1f')]);router[_0xb0e2('0x9')](_0xb0e2('0x20'),controller[_0xb0e2('0x21')]);router['get'](_0xb0e2('0x22'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x23')]);router[_0xb0e2('0x9')](_0xb0e2('0x24'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x25')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb0e2('0x26')]);router['post'](_0xb0e2('0x27'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x28')]);router[_0xb0e2('0x29')](_0xb0e2('0x11'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x2a')]);var upload=multer({'storage':multer[_0xb0e2('0x2b')]({'destination':function(_0x38e4c5,_0x5a68c1,_0x1dc759){_0x1dc759(null,path[_0xb0e2('0x2c')](config[_0xb0e2('0x2d')],'server/files/images/logos/'));},'filename':function(_0x4b565c,_0x23b24f,_0x30c307){_0x30c307(null,util[_0xb0e2('0x2e')]('%s-%s',Date['now'](),_0x23b24f[_0xb0e2('0x2f')]));}})});router[_0xb0e2('0x29')](_0xb0e2('0x12'),upload[_0xb0e2('0x30')](_0xb0e2('0x31')),controller[_0xb0e2('0x32')]);var upload=multer({'storage':multer[_0xb0e2('0x2b')]({'destination':function(_0x4db140,_0x5a941a,_0x2bc536){_0x2bc536(null,path[_0xb0e2('0x2c')](config[_0xb0e2('0x2d')],_0xb0e2('0x33')));},'filename':function(_0x43ee2e,_0x3f415a,_0x93df85){_0x93df85(null,util[_0xb0e2('0x2e')](_0xb0e2('0x34'),Date['now'](),_0x3f415a['originalname']));}})});router[_0xb0e2('0x29')](_0xb0e2('0x14'),upload[_0xb0e2('0x30')](_0xb0e2('0x31')),controller[_0xb0e2('0x35')]);var upload=multer({'storage':multer[_0xb0e2('0x2b')]({'destination':function(_0x4d0ac1,_0x4a9699,_0x4b7b2c){_0x4b7b2c(null,path[_0xb0e2('0x2c')](config['root'],_0xb0e2('0x33')));},'filename':function(_0x8c1b31,_0x4469e4,_0x1db9d8){_0x1db9d8(null,util[_0xb0e2('0x2e')](_0xb0e2('0x34'),Date[_0xb0e2('0x36')](),_0x4469e4[_0xb0e2('0x2f')]));}})});router['post']('/:id/customer_avatar',upload[_0xb0e2('0x30')](_0xb0e2('0x31')),controller[_0xb0e2('0x37')]);var upload=multer({'storage':multer[_0xb0e2('0x2b')]({'destination':function(_0xe485e0,_0x175618,_0x4b1634){_0x4b1634(null,path[_0xb0e2('0x2c')](config[_0xb0e2('0x2d')],_0xb0e2('0x33')));},'filename':function(_0xf113d9,_0x3c1c66,_0x754298){_0x754298(null,util[_0xb0e2('0x2e')](_0xb0e2('0x34'),Date[_0xb0e2('0x36')](),_0x3c1c66[_0xb0e2('0x2f')]));}})});router['post'](_0xb0e2('0x18'),upload[_0xb0e2('0x30')](_0xb0e2('0x31')),controller[_0xb0e2('0x38')]);router['post'](_0xb0e2('0x39'),controller[_0xb0e2('0x3a')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x572e7e,_0x47a873,_0x2987d1){const _0x59f58c=path['join'](config['root'],_0xb0e2('0x3b'),_0xb0e2('0x3c'),_0xb0e2('0x3d'));fs_extra['ensureDir'](_0x59f58c,function(){_0x2987d1(null,_0x59f58c);});},'filename':function(_0x3ccd07,_0xd8b1d7,_0x269e47){const _0x1d4511=_0xd8b1d7['originalname'][_0xb0e2('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xdcb853=path[_0xb0e2('0x3f')](_0x1d4511);const _0x264111=Date['now']()+'-'+_0x1d4511[_0xb0e2('0x3e')](_0xdcb853,'')+_0xdcb853;_0x269e47(null,_0x264111);}})});router[_0xb0e2('0x29')](_0xb0e2('0x40'),offlineUploadMulter[_0xb0e2('0x41')](),controller[_0xb0e2('0x42')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0xb0e2('0x43')]);router[_0xb0e2('0x29')](_0xb0e2('0x44'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x45')]);router[_0xb0e2('0x29')](_0xb0e2('0x1e'),auth['isAuthenticated'](),controller[_0xb0e2('0x46')]);router[_0xb0e2('0x29')](_0xb0e2('0x24'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x47')]);router[_0xb0e2('0x48')](_0xb0e2('0xe'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x49')]);router[_0xb0e2('0x4a')](_0xb0e2('0xe'),auth['isAuthenticated'](),controller[_0xb0e2('0x4b')]);router[_0xb0e2('0x4a')](_0xb0e2('0x27'),auth['isAuthenticated'](),controller[_0xb0e2('0x4c')]);router[_0xb0e2('0x4a')](_0xb0e2('0x11'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x4d')]);router['delete'](_0xb0e2('0x24'),auth[_0xb0e2('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 4e1b399..a51f0c2 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 _0x8e60=['env','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','exports','express','../components/auth/service','../config/environment','Router'];(function(_0x1e097e,_0x23f56c){var _0x76d7d2=function(_0x52f510){while(--_0x52f510){_0x1e097e['push'](_0x1e097e['shift']());}};_0x76d7d2(++_0x23f56c);}(_0x8e60,0x15b));var _0x08e6=function(_0x71e493,_0x4308b7){_0x71e493=_0x71e493-0x0;var _0x3d40ab=_0x8e60[_0x71e493];return _0x3d40ab;};var beaverLogger=require('beaver-logger/server');var express=require(_0x08e6('0x0'));var auth=require(_0x08e6('0x1'));var config=require(_0x08e6('0x2'));var router=express[_0x08e6('0x3')]();var isProduction=config[_0x08e6('0x4')]==='production'||![];function clientSideLogs(_0x51cbc0,_0x382671,_0x57a747){var _0xe77a74=_0x51cbc0[_0x08e6('0x5')][_0x08e6('0x6')](_0x08e6('0x7'));if(!_0xe77a74){throw new Error(_0x08e6('0x8'));}return beaverLogger[_0x08e6('0x9')]({'uri':_0x08e6('0xa'),'logger':_0xe77a74,'enableCors':!isProduction})(_0x51cbc0,_0x382671,_0x57a747);}router['use'](auth[_0x08e6('0xb')](),clientSideLogs);module[_0x08e6('0xc')]=router;
\ No newline at end of file
+var _0x8a0a=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','beaver-logger/server','express','../components/auth/service','../config/environment','env','production','app','get'];(function(_0xee99a8,_0x1312c0){var _0x374681=function(_0x35a7c9){while(--_0x35a7c9){_0xee99a8['push'](_0xee99a8['shift']());}};_0x374681(++_0x1312c0);}(_0x8a0a,0xb3));var _0xa8a0=function(_0x27fca1,_0x40af1d){_0x27fca1=_0x27fca1-0x0;var _0x2f6dfa=_0x8a0a[_0x27fca1];return _0x2f6dfa;};var beaverLogger=require(_0xa8a0('0x0'));var express=require(_0xa8a0('0x1'));var auth=require(_0xa8a0('0x2'));var config=require(_0xa8a0('0x3'));var router=express['Router']();var isProduction=config[_0xa8a0('0x4')]===_0xa8a0('0x5')||![];function clientSideLogs(_0x12045b,_0x56a71f,_0x4e9f0e){var _0x4d3f67=_0x12045b[_0xa8a0('0x6')][_0xa8a0('0x7')]('client-side-logger');if(!_0x4d3f67){throw new Error(_0xa8a0('0x8'));}return beaverLogger[_0xa8a0('0x9')]({'uri':_0xa8a0('0xa'),'logger':_0x4d3f67,'enableCors':!isProduction})(_0x12045b,_0x56a71f,_0x4e9f0e);}router['use'](auth['isAuthenticated'](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index b90a52c..9e7ef79 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 _0xa635=['ENUM','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING'];(function(_0x5b2ade,_0x4c70ef){var _0x5f24dd=function(_0x57fce5){while(--_0x57fce5){_0x5b2ade['push'](_0x5b2ade['shift']());}};_0x5f24dd(++_0x4c70ef);}(_0xa635,0xcd));var _0x5a63=function(_0x214730,_0xbfcce4){_0x214730=_0x214730-0x0;var _0x82af15=_0xa635[_0x214730];return _0x82af15;};'use strict';var Sequelize=require(_0x5a63('0x0'));module[_0x5a63('0x1')]={'name':{'type':Sequelize[_0x5a63('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x5a63('0x3')]('AmazonAWS',_0x5a63('0x4'),_0x5a63('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x5a63('0x3')](_0x5a63('0x6'),_0x5a63('0x7'))},'data1':{'type':Sequelize[_0x5a63('0x2')],'comment':_0x5a63('0x8')},'data2':{'type':Sequelize['STRING'],'comment':_0x5a63('0x9')},'data3':{'type':Sequelize[_0x5a63('0x2')],'comment':_0x5a63('0xa')},'data4':{'type':Sequelize[_0x5a63('0x2')],'comment':_0x5a63('0xb')},'data5':{'type':Sequelize[_0x5a63('0xc')],'comment':_0x5a63('0xd')},'data6':{'type':Sequelize[_0x5a63('0xc')],'comment':_0x5a63('0xe')},'data7':{'type':Sequelize[_0x5a63('0xc')],'comment':_0x5a63('0xf')}};
\ No newline at end of file
+var _0xd1ba=['ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','Google','MicrosoftAzure'];(function(_0x4e204d,_0x7d3f57){var _0x206e69=function(_0x10056c){while(--_0x10056c){_0x4e204d['push'](_0x4e204d['shift']());}};_0x206e69(++_0x7d3f57);}(_0xd1ba,0x12f));var _0xad1b=function(_0x482c10,_0x16ea3c){_0x482c10=_0x482c10-0x0;var _0x313969=_0xd1ba[_0x482c10];return _0x313969;};'use strict';var Sequelize=require(_0xad1b('0x0'));module[_0xad1b('0x1')]={'name':{'type':Sequelize[_0xad1b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0xad1b('0x3'),_0xad1b('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xad1b('0x5')](_0xad1b('0x6'),_0xad1b('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0xad1b('0x8')},'data3':{'type':Sequelize[_0xad1b('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xad1b('0x2')],'comment':_0xad1b('0x9')},'data5':{'type':Sequelize[_0xad1b('0xa')],'comment':_0xad1b('0xb')},'data6':{'type':Sequelize[_0xad1b('0xa')],'comment':_0xad1b('0xc')},'data7':{'type':Sequelize[_0xad1b('0xa')],'comment':_0xad1b('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index fd5526a..e9cb126 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 _0xdc19=['code','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','ioredis','../../config/environment','api','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','padEnd','slice','map','CloudProvider','rawAttributes','fieldName','type','key','model','name','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','decryptString','data3','show','params','find','service','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','MicrosoftAzure','encryptString','create','catch','oauth2MicrosoftAuthorize','findOne','oauth2MicrosoftCallback','Invalid\x20state\x20parameter','state','base64','toString','parse','isValidIdToken','id_token','oauth2Claims','del'];(function(_0xe79efd,_0x20e812){var _0x104d81=function(_0x3745fe){while(--_0x3745fe){_0xe79efd['push'](_0xe79efd['shift']());}};_0x104d81(++_0x20e812);}(_0xdc19,0x66));var _0x9dc1=function(_0x1c3e07,_0x4d31a5){_0x1c3e07=_0x1c3e07-0x0;var _0x1defcb=_0xdc19[_0x1c3e07];return _0x1defcb;};'use strict';var _=require('lodash');var Redis=require(_0x9dc1('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0x9dc1('0x1'));var logger=require('../../config/logger')(_0x9dc1('0x2'));var db=require(_0x9dc1('0x3'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x9dc1('0x4')]=_[_0x9dc1('0x5')](config[_0x9dc1('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0x9dc1('0x6'))(new Redis(config['redis']));var redis=new Redis(config[_0x9dc1('0x4')]);function respondWithStatusCode(_0x513e44,_0x329be7){_0x329be7=_0x329be7||0xcc;return function(_0x2e305c){if(_0x2e305c){return _0x513e44[_0x9dc1('0x7')](_0x329be7);}return _0x513e44['status'](_0x329be7)[_0x9dc1('0x8')]();};}function respondWithResult(_0x783f46,_0x717af7){_0x717af7=_0x717af7||0xc8;return function(_0x4121a5){if(_0x4121a5){return _0x783f46[_0x9dc1('0x9')](_0x717af7)[_0x9dc1('0xa')](_0x4121a5);}};}function respondWithFilteredResult(_0x95435f,_0x4a996f){return function(_0x19fbe1){if(_0x19fbe1){var _0x68e996=typeof _0x4a996f[_0x9dc1('0xb')]===_0x9dc1('0xc')&&typeof _0x4a996f[_0x9dc1('0xd')]==='undefined';var _0x2813c4=_0x19fbe1[_0x9dc1('0xe')];var _0x138b56=_0x68e996?0x0:_0x4a996f[_0x9dc1('0xb')];var _0x1bce86=_0x68e996?_0x19fbe1[_0x9dc1('0xe')]:_0x4a996f[_0x9dc1('0xb')]+_0x4a996f[_0x9dc1('0xd')];var _0xaf5799;if(_0x1bce86>=_0x2813c4){_0x1bce86=_0x2813c4;_0xaf5799=0xc8;}else{_0xaf5799=0xce;}_0x95435f['status'](_0xaf5799);return _0x95435f['set'](_0x9dc1('0xf'),_0x138b56+'-'+_0x1bce86+'/'+_0x2813c4)[_0x9dc1('0xa')](_0x19fbe1);}return null;};}function saveUpdates(_0x254422){return function(_0x43548f){if(_0x43548f){return _0x43548f[_0x9dc1('0x10')](_0x254422)[_0x9dc1('0x11')](function(_0x5c5256){return _0x5c5256;});}return null;};}function removeEntity(_0x4c23e3){return function(_0x5bcc1c){if(_0x5bcc1c){return _0x5bcc1c[_0x9dc1('0x12')]()[_0x9dc1('0x11')](function(){_0x4c23e3['status'](0xcc)[_0x9dc1('0x8')]();});}};}function handleEntityNotFound(_0x1efcf3){return function(_0x4c1010){if(!_0x4c1010){_0x1efcf3['sendStatus'](0x194);}return _0x4c1010;};}function handleError(_0x454f6d,_0x3125b2){_0x3125b2=_0x3125b2||0x1f4;return function(_0x38d58c){logger[_0x9dc1('0x13')](_0x38d58c['stack']);if(_0x38d58c['name']){delete _0x38d58c['name'];}_0x454f6d[_0x9dc1('0x9')](_0x3125b2)['send'](_0x38d58c);};}function maskClientSecret(_0x12079a){return _[_0x9dc1('0x14')](_0x12079a[_0x9dc1('0x15')](0x0,0x3),0x14,'*');}exports['index']=function(_0x2698ae,_0x4f786b){var _0x381726={},_0x45dd23={},_0x5e8a9a={'count':0x0,'rows':[]};var _0x7846f9=_[_0x9dc1('0x16')](db[_0x9dc1('0x17')][_0x9dc1('0x18')],function(_0x4c84a1){return{'name':_0x4c84a1[_0x9dc1('0x19')],'type':_0x4c84a1[_0x9dc1('0x1a')][_0x9dc1('0x1b')]};});_0x45dd23[_0x9dc1('0x1c')]=_[_0x9dc1('0x16')](_0x7846f9,_0x9dc1('0x1d'));_0x45dd23['query']=_[_0x9dc1('0x1e')](_0x2698ae['query']);_0x45dd23[_0x9dc1('0x1f')]=_[_0x9dc1('0x20')](_0x45dd23['model'],_0x45dd23['query']);_0x381726[_0x9dc1('0x21')]=_['intersection'](_0x45dd23[_0x9dc1('0x1c')],qs[_0x9dc1('0x22')](_0x2698ae[_0x9dc1('0x23')][_0x9dc1('0x22')]));_0x381726[_0x9dc1('0x21')]=_0x381726[_0x9dc1('0x21')][_0x9dc1('0x24')]?_0x381726[_0x9dc1('0x21')]:_0x45dd23[_0x9dc1('0x1c')];if(!_0x2698ae[_0x9dc1('0x23')][_0x9dc1('0x25')]('nolimit')){_0x381726[_0x9dc1('0xd')]=qs[_0x9dc1('0xd')](_0x2698ae[_0x9dc1('0x23')]['limit']);_0x381726[_0x9dc1('0xb')]=qs['offset'](_0x2698ae[_0x9dc1('0x23')][_0x9dc1('0xb')]);}_0x381726['order']=qs[_0x9dc1('0x26')](_0x2698ae['query'][_0x9dc1('0x26')]);_0x381726[_0x9dc1('0x27')]=qs[_0x9dc1('0x1f')](_[_0x9dc1('0x28')](_0x2698ae['query'],_0x45dd23[_0x9dc1('0x1f')]),_0x7846f9);if(_0x2698ae[_0x9dc1('0x23')][_0x9dc1('0x29')]){_0x381726[_0x9dc1('0x27')]=_['merge'](_0x381726[_0x9dc1('0x27')],{'$or':_[_0x9dc1('0x16')](_0x7846f9,function(_0x542d49){if(_0x542d49[_0x9dc1('0x1a')]!==_0x9dc1('0x2a')){var _0x33034d={};_0x33034d[_0x542d49[_0x9dc1('0x1d')]]={'$like':'%'+_0x2698ae['query'][_0x9dc1('0x29')]+'%'};return _0x33034d;}})});}_0x381726=_[_0x9dc1('0x2b')]({},_0x381726,_0x2698ae[_0x9dc1('0x2c')]);var _0x4aa732={'where':_0x381726[_0x9dc1('0x27')]};return db[_0x9dc1('0x17')][_0x9dc1('0xe')](_0x4aa732)['then'](function(_0x4da673){_0x5e8a9a['count']=_0x4da673;if(_0x2698ae[_0x9dc1('0x23')][_0x9dc1('0x2d')]){_0x381726[_0x9dc1('0x2e')]=[{'all':!![]}];}return db['CloudProvider'][_0x9dc1('0x2f')](_0x381726);})[_0x9dc1('0x11')](function(_0x5e352e){_0x5e8a9a[_0x9dc1('0x30')]=_['map'](_0x5e352e,function(_0x53649a){if(_0x53649a['service']==='MicrosoftAzure'){var _0x4943ce=encryptor[_0x9dc1('0x31')](_0x53649a['data3']);_0x53649a[_0x9dc1('0x32')]=maskClientSecret(_0x4943ce);}return _0x53649a;});return _0x5e8a9a;})['then'](respondWithFilteredResult(_0x4f786b,_0x381726))['catch'](handleError(_0x4f786b,null));};exports[_0x9dc1('0x33')]=function(_0x57938f,_0x3fea27){var _0x37e230={'raw':!![],'where':{'id':_0x57938f[_0x9dc1('0x34')]['id']}},_0x207c4e={};_0x207c4e[_0x9dc1('0x1c')]=_[_0x9dc1('0x1e')](db[_0x9dc1('0x17')][_0x9dc1('0x18')]);_0x207c4e[_0x9dc1('0x23')]=_[_0x9dc1('0x1e')](_0x57938f[_0x9dc1('0x23')]);_0x207c4e[_0x9dc1('0x1f')]=_[_0x9dc1('0x20')](_0x207c4e[_0x9dc1('0x1c')],_0x207c4e[_0x9dc1('0x23')]);_0x37e230[_0x9dc1('0x21')]=_[_0x9dc1('0x20')](_0x207c4e[_0x9dc1('0x1c')],qs[_0x9dc1('0x22')](_0x57938f[_0x9dc1('0x23')][_0x9dc1('0x22')]));_0x37e230[_0x9dc1('0x21')]=_0x37e230[_0x9dc1('0x21')][_0x9dc1('0x24')]?_0x37e230[_0x9dc1('0x21')]:_0x207c4e[_0x9dc1('0x1c')];if(_0x57938f[_0x9dc1('0x23')]['includeAll']){_0x37e230[_0x9dc1('0x2e')]=[{'all':!![]}];}_0x37e230=_['merge']({},_0x37e230,_0x57938f[_0x9dc1('0x2c')]);return db[_0x9dc1('0x17')][_0x9dc1('0x35')](_0x37e230)[_0x9dc1('0x11')](handleEntityNotFound(_0x3fea27,null))[_0x9dc1('0x11')](function(_0x1ea11a){if(_0x1ea11a[_0x9dc1('0x36')]==='MicrosoftAzure'){var _0x587ced=encryptor[_0x9dc1('0x31')](_0x1ea11a[_0x9dc1('0x32')]);_0x1ea11a[_0x9dc1('0x32')]=maskClientSecret(_0x587ced);}return _0x1ea11a;})[_0x9dc1('0x11')](respondWithResult(_0x3fea27,null))['catch'](handleError(_0x3fea27,null));};exports['create']=function(_0x2794a9,_0x47143a){if(!_0x2794a9[_0x9dc1('0x37')]['name'])throw new Error(_0x9dc1('0x38'));if(!_0x2794a9[_0x9dc1('0x37')][_0x9dc1('0x36')])throw new Error(_0x9dc1('0x39'));var _0x2d7d3c=db[_0x9dc1('0x17')][_0x9dc1('0x18')]['service'][_0x9dc1('0x3a')];if(!_0x2d7d3c[_0x9dc1('0x3b')](_0x2794a9['body'][_0x9dc1('0x36')]))throw new Error(_0x9dc1('0x3c')+_0x2d7d3c[_0x9dc1('0x3d')](',\x20'));if(_0x2794a9[_0x9dc1('0x37')][_0x9dc1('0x36')]===_0x9dc1('0x3e')&&_0x2794a9['body'][_0x9dc1('0x32')]){_0x2794a9['body'][_0x9dc1('0x32')]=encryptor[_0x9dc1('0x3f')](_0x2794a9[_0x9dc1('0x37')][_0x9dc1('0x32')]);}return db[_0x9dc1('0x17')][_0x9dc1('0x40')](_0x2794a9[_0x9dc1('0x37')],{})[_0x9dc1('0x11')](respondWithResult(_0x47143a,0xc9))[_0x9dc1('0x41')](handleError(_0x47143a,null));};exports[_0x9dc1('0x10')]=function(_0x1431b6,_0x8cbfd9){if(_0x1431b6[_0x9dc1('0x37')]['id']){delete _0x1431b6[_0x9dc1('0x37')]['id'];}return db[_0x9dc1('0x17')][_0x9dc1('0x35')]({'where':{'id':_0x1431b6[_0x9dc1('0x34')]['id']}})['then'](handleEntityNotFound(_0x8cbfd9,null))[_0x9dc1('0x11')](function(_0x27bc02){if(_0x27bc02[_0x9dc1('0x36')]===_0x9dc1('0x3e')&&_0x1431b6['body'][_0x9dc1('0x32')]){_0x1431b6[_0x9dc1('0x37')][_0x9dc1('0x32')]=encryptor[_0x9dc1('0x3f')](_0x1431b6[_0x9dc1('0x37')][_0x9dc1('0x32')]);}return _0x27bc02;})[_0x9dc1('0x11')](saveUpdates(_0x1431b6[_0x9dc1('0x37')],null))[_0x9dc1('0x11')](respondWithResult(_0x8cbfd9,null))[_0x9dc1('0x41')](handleError(_0x8cbfd9,null));};exports[_0x9dc1('0x12')]=function(_0x4c6a79,_0x315959){return db[_0x9dc1('0x17')][_0x9dc1('0x35')]({'where':{'id':_0x4c6a79[_0x9dc1('0x34')]['id']}})['then'](handleEntityNotFound(_0x315959,null))['then'](removeEntity(_0x315959,null))[_0x9dc1('0x41')](handleError(_0x315959,null));};exports[_0x9dc1('0x42')]=function(_0x14ab53,_0x584ef){return db[_0x9dc1('0x17')][_0x9dc1('0x43')]({'where':{'id':_0x14ab53[_0x9dc1('0x34')]['id']},'raw':!![]})['then'](function(_0x3a4648){if(!_0x3a4648)return _0x584ef[_0x9dc1('0x7')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x3a4648,_0x14ab53['user']['id'])};})[_0x9dc1('0x11')](respondWithResult(_0x584ef,null))[_0x9dc1('0x41')](handleError(_0x584ef,null));};exports[_0x9dc1('0x44')]=function(_0x329b99,_0x2a33f0){var _0x1f7023=_0x329b99[_0x9dc1('0x37')];var _0x5e5f29;var _0x3215b2;if(_0x1f7023[_0x9dc1('0x13')])throw _0x1f7023;redis['get'](_0x1f7023['state'])['then'](function(_0x3b84db){if(!_0x3b84db)throw new Error(_0x9dc1('0x45'));_0x5e5f29=JSON['parse'](_0x3b84db);var _0x568455=Buffer['from'](_0x1f7023[_0x9dc1('0x46')],_0x9dc1('0x47'))[_0x9dc1('0x48')]('ascii');_0x3215b2=JSON[_0x9dc1('0x49')](_0x568455);if(!oauth[_0x9dc1('0x4a')](_0x1f7023[_0x9dc1('0x4b')],_0x5e5f29[_0x9dc1('0x4c')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x9dc1('0x4d')](_0x1f7023[_0x9dc1('0x46')]);return oauth['getOauth2MicrosoftAccessToken'](_0x1f7023[_0x9dc1('0x4e')],_0x5e5f29);})[_0x9dc1('0x11')](function(_0x2d7355){_0x5e5f29['data5']=_0x2d7355['access_token'];_0x5e5f29[_0x9dc1('0x4f')]=_0x2d7355[_0x9dc1('0x50')];return db[_0x9dc1('0x17')][_0x9dc1('0x10')]({'data5':_0x5e5f29[_0x9dc1('0x51')],'data6':_0x5e5f29[_0x9dc1('0x4f')]},{'where':{'id':_0x5e5f29['id']}});})[_0x9dc1('0x11')](function(){oauth[_0x9dc1('0x52')](_0x5e5f29);socket[_0x9dc1('0x53')](_0x9dc1('0x54'),{'id':_0x3215b2['id']});return;})[_0x9dc1('0x11')](respondWithStatusCode(_0x2a33f0,null))['catch'](function(_0x49eef4){if(_0x3215b2){socket['emit'](_0x9dc1('0x55'),{'id':_0x3215b2['id']});}if(!_0x5e5f29){logger[_0x9dc1('0x13')](_0x9dc1('0x56'),_0x49eef4);return _0x2a33f0[_0x9dc1('0x9')](0x1f4)[_0x9dc1('0x57')](_0x49eef4[_0x9dc1('0x58')]);}logger[_0x9dc1('0x13')](_0x9dc1('0x59'),_0x5e5f29['id'],JSON['stringify'](_0x49eef4));});};
\ No newline at end of file
+var _0x4d59=['offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','padEnd','slice','index','CloudProvider','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','intersection','includeAll','include','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','params','find','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','defaults','socket.io-emitter','redis','sendStatus','status','end','json'];(function(_0x244138,_0x54d0c6){var _0x58b2a4=function(_0x3ca521){while(--_0x3ca521){_0x244138['push'](_0x244138['shift']());}};_0x58b2a4(++_0x54d0c6);}(_0x4d59,0x115));var _0x94d5=function(_0x2f991f,_0x10ec62){_0x2f991f=_0x2f991f-0x0;var _0xa0a9cc=_0x4d59[_0x2f991f];return _0xa0a9cc;};'use strict';var _=require(_0x94d5('0x0'));var Redis=require(_0x94d5('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x94d5('0x2'));var config=require(_0x94d5('0x3'));var logger=require(_0x94d5('0x4'))(_0x94d5('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x94d5('0x6'));config['redis']=_[_0x94d5('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x94d5('0x8'))(new Redis(config[_0x94d5('0x9')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x4b2520,_0x3f7f84){_0x3f7f84=_0x3f7f84||0xcc;return function(_0x32a544){if(_0x32a544){return _0x4b2520[_0x94d5('0xa')](_0x3f7f84);}return _0x4b2520[_0x94d5('0xb')](_0x3f7f84)[_0x94d5('0xc')]();};}function respondWithResult(_0x2675c3,_0x3c1799){_0x3c1799=_0x3c1799||0xc8;return function(_0x467a54){if(_0x467a54){return _0x2675c3[_0x94d5('0xb')](_0x3c1799)[_0x94d5('0xd')](_0x467a54);}};}function respondWithFilteredResult(_0x585aae,_0x4eca64){return function(_0x3d974a){if(_0x3d974a){var _0x31a42d=typeof _0x4eca64[_0x94d5('0xe')]===_0x94d5('0xf')&&typeof _0x4eca64[_0x94d5('0x10')]===_0x94d5('0xf');var _0x445750=_0x3d974a[_0x94d5('0x11')];var _0x2f5389=_0x31a42d?0x0:_0x4eca64[_0x94d5('0xe')];var _0x277b9b=_0x31a42d?_0x3d974a[_0x94d5('0x11')]:_0x4eca64['offset']+_0x4eca64[_0x94d5('0x10')];var _0xf1a9bd;if(_0x277b9b>=_0x445750){_0x277b9b=_0x445750;_0xf1a9bd=0xc8;}else{_0xf1a9bd=0xce;}_0x585aae[_0x94d5('0xb')](_0xf1a9bd);return _0x585aae[_0x94d5('0x12')](_0x94d5('0x13'),_0x2f5389+'-'+_0x277b9b+'/'+_0x445750)[_0x94d5('0xd')](_0x3d974a);}return null;};}function saveUpdates(_0x538868){return function(_0x1313b0){if(_0x1313b0){return _0x1313b0[_0x94d5('0x14')](_0x538868)[_0x94d5('0x15')](function(_0x3e6b91){return _0x3e6b91;});}return null;};}function removeEntity(_0x402865){return function(_0x59f1a2){if(_0x59f1a2){return _0x59f1a2[_0x94d5('0x16')]()[_0x94d5('0x15')](function(){_0x402865['status'](0xcc)[_0x94d5('0xc')]();});}};}function handleEntityNotFound(_0x349c4d){return function(_0x16fe7b){if(!_0x16fe7b){_0x349c4d[_0x94d5('0xa')](0x194);}return _0x16fe7b;};}function handleError(_0x3be241,_0x422a06){_0x422a06=_0x422a06||0x1f4;return function(_0xec2397){logger[_0x94d5('0x17')](_0xec2397[_0x94d5('0x18')]);if(_0xec2397['name']){delete _0xec2397[_0x94d5('0x19')];}_0x3be241['status'](_0x422a06)['send'](_0xec2397);};}function maskClientSecret(_0x1cc869){return _[_0x94d5('0x1a')](_0x1cc869[_0x94d5('0x1b')](0x0,0x3),0x14,'*');}exports[_0x94d5('0x1c')]=function(_0x44f730,_0x1b6302){var _0x3443d5={},_0x15dc15={},_0x4586b9={'count':0x0,'rows':[]};var _0x19a1fd=_['map'](db[_0x94d5('0x1d')][_0x94d5('0x1e')],function(_0x5ee426){return{'name':_0x5ee426[_0x94d5('0x1f')],'type':_0x5ee426['type'][_0x94d5('0x20')]};});_0x15dc15[_0x94d5('0x21')]=_[_0x94d5('0x22')](_0x19a1fd,_0x94d5('0x19'));_0x15dc15['query']=_[_0x94d5('0x23')](_0x44f730[_0x94d5('0x24')]);_0x15dc15[_0x94d5('0x25')]=_['intersection'](_0x15dc15[_0x94d5('0x21')],_0x15dc15[_0x94d5('0x24')]);_0x3443d5[_0x94d5('0x26')]=_['intersection'](_0x15dc15[_0x94d5('0x21')],qs['fields'](_0x44f730[_0x94d5('0x24')][_0x94d5('0x27')]));_0x3443d5[_0x94d5('0x26')]=_0x3443d5['attributes'][_0x94d5('0x28')]?_0x3443d5[_0x94d5('0x26')]:_0x15dc15[_0x94d5('0x21')];if(!_0x44f730['query'][_0x94d5('0x29')](_0x94d5('0x2a'))){_0x3443d5[_0x94d5('0x10')]=qs[_0x94d5('0x10')](_0x44f730[_0x94d5('0x24')]['limit']);_0x3443d5['offset']=qs[_0x94d5('0xe')](_0x44f730['query'][_0x94d5('0xe')]);}_0x3443d5[_0x94d5('0x2b')]=qs[_0x94d5('0x2c')](_0x44f730[_0x94d5('0x24')][_0x94d5('0x2c')]);_0x3443d5[_0x94d5('0x2d')]=qs[_0x94d5('0x25')](_['pick'](_0x44f730['query'],_0x15dc15[_0x94d5('0x25')]),_0x19a1fd);if(_0x44f730[_0x94d5('0x24')][_0x94d5('0x2e')]){_0x3443d5[_0x94d5('0x2d')]=_[_0x94d5('0x2f')](_0x3443d5[_0x94d5('0x2d')],{'$or':_['map'](_0x19a1fd,function(_0x4098ee){if(_0x4098ee[_0x94d5('0x30')]!==_0x94d5('0x31')){var _0x22bbdd={};_0x22bbdd[_0x4098ee[_0x94d5('0x19')]]={'$like':'%'+_0x44f730[_0x94d5('0x24')]['filter']+'%'};return _0x22bbdd;}})});}_0x3443d5=_[_0x94d5('0x2f')]({},_0x3443d5,_0x44f730[_0x94d5('0x32')]);var _0x1f064d={'where':_0x3443d5[_0x94d5('0x2d')]};return db['CloudProvider'][_0x94d5('0x11')](_0x1f064d)[_0x94d5('0x15')](function(_0x24e029){_0x4586b9[_0x94d5('0x11')]=_0x24e029;if(_0x44f730[_0x94d5('0x24')]['includeAll']){_0x3443d5['include']=[{'all':!![]}];}return db[_0x94d5('0x1d')][_0x94d5('0x33')](_0x3443d5);})['then'](function(_0x5d8853){_0x4586b9[_0x94d5('0x34')]=_[_0x94d5('0x22')](_0x5d8853,function(_0x135ef4){if(_0x135ef4[_0x94d5('0x35')]===_0x94d5('0x36')){var _0x3f58f8=encryptor[_0x94d5('0x37')](_0x135ef4[_0x94d5('0x38')]);_0x135ef4[_0x94d5('0x38')]=maskClientSecret(_0x3f58f8);}return _0x135ef4;});return _0x4586b9;})[_0x94d5('0x15')](respondWithFilteredResult(_0x1b6302,_0x3443d5))[_0x94d5('0x39')](handleError(_0x1b6302,null));};exports[_0x94d5('0x3a')]=function(_0x3718e7,_0x38afe3){var _0x465f1d={'raw':!![],'where':{'id':_0x3718e7['params']['id']}},_0x2a7882={};_0x2a7882['model']=_[_0x94d5('0x23')](db[_0x94d5('0x1d')][_0x94d5('0x1e')]);_0x2a7882[_0x94d5('0x24')]=_['keys'](_0x3718e7[_0x94d5('0x24')]);_0x2a7882[_0x94d5('0x25')]=_[_0x94d5('0x3b')](_0x2a7882[_0x94d5('0x21')],_0x2a7882[_0x94d5('0x24')]);_0x465f1d[_0x94d5('0x26')]=_[_0x94d5('0x3b')](_0x2a7882[_0x94d5('0x21')],qs['fields'](_0x3718e7[_0x94d5('0x24')][_0x94d5('0x27')]));_0x465f1d[_0x94d5('0x26')]=_0x465f1d['attributes'][_0x94d5('0x28')]?_0x465f1d['attributes']:_0x2a7882[_0x94d5('0x21')];if(_0x3718e7[_0x94d5('0x24')][_0x94d5('0x3c')]){_0x465f1d[_0x94d5('0x3d')]=[{'all':!![]}];}_0x465f1d=_[_0x94d5('0x2f')]({},_0x465f1d,_0x3718e7[_0x94d5('0x32')]);return db[_0x94d5('0x1d')]['find'](_0x465f1d)['then'](handleEntityNotFound(_0x38afe3,null))['then'](function(_0x353d9f){if(_0x353d9f[_0x94d5('0x35')]===_0x94d5('0x36')){var _0x23f73e=encryptor[_0x94d5('0x37')](_0x353d9f[_0x94d5('0x38')]);_0x353d9f['data3']=maskClientSecret(_0x23f73e);}return _0x353d9f;})['then'](respondWithResult(_0x38afe3,null))['catch'](handleError(_0x38afe3,null));};exports[_0x94d5('0x3e')]=function(_0x594c1d,_0x53f1c8){if(!_0x594c1d[_0x94d5('0x3f')][_0x94d5('0x19')])throw new Error(_0x94d5('0x40'));if(!_0x594c1d['body'][_0x94d5('0x35')])throw new Error(_0x94d5('0x41'));var _0x2347fe=db[_0x94d5('0x1d')][_0x94d5('0x1e')][_0x94d5('0x35')]['values'];if(!_0x2347fe['includes'](_0x594c1d[_0x94d5('0x3f')][_0x94d5('0x35')]))throw new Error(_0x94d5('0x42')+_0x2347fe[_0x94d5('0x43')](',\x20'));if(_0x594c1d[_0x94d5('0x3f')][_0x94d5('0x35')]==='MicrosoftAzure'&&_0x594c1d['body'][_0x94d5('0x38')]){_0x594c1d[_0x94d5('0x3f')][_0x94d5('0x38')]=encryptor[_0x94d5('0x44')](_0x594c1d[_0x94d5('0x3f')][_0x94d5('0x38')]);}return db[_0x94d5('0x1d')][_0x94d5('0x3e')](_0x594c1d['body'],{})[_0x94d5('0x15')](respondWithResult(_0x53f1c8,0xc9))[_0x94d5('0x39')](handleError(_0x53f1c8,null));};exports[_0x94d5('0x14')]=function(_0x196461,_0x3b45fb){if(_0x196461[_0x94d5('0x3f')]['id']){delete _0x196461[_0x94d5('0x3f')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x196461[_0x94d5('0x45')]['id']}})[_0x94d5('0x15')](handleEntityNotFound(_0x3b45fb,null))[_0x94d5('0x15')](function(_0x2f0ab1){if(_0x2f0ab1[_0x94d5('0x35')]===_0x94d5('0x36')&&_0x196461[_0x94d5('0x3f')]['data3']){_0x196461[_0x94d5('0x3f')][_0x94d5('0x38')]=encryptor['encryptString'](_0x196461[_0x94d5('0x3f')][_0x94d5('0x38')]);}return _0x2f0ab1;})[_0x94d5('0x15')](saveUpdates(_0x196461[_0x94d5('0x3f')],null))[_0x94d5('0x15')](respondWithResult(_0x3b45fb,null))[_0x94d5('0x39')](handleError(_0x3b45fb,null));};exports[_0x94d5('0x16')]=function(_0x42d33d,_0x775711){return db[_0x94d5('0x1d')][_0x94d5('0x46')]({'where':{'id':_0x42d33d[_0x94d5('0x45')]['id']}})[_0x94d5('0x15')](handleEntityNotFound(_0x775711,null))[_0x94d5('0x15')](removeEntity(_0x775711,null))['catch'](handleError(_0x775711,null));};exports[_0x94d5('0x47')]=function(_0x3b2af3,_0xe2160e){return db[_0x94d5('0x1d')]['findOne']({'where':{'id':_0x3b2af3[_0x94d5('0x45')]['id']},'raw':!![]})[_0x94d5('0x15')](function(_0x11c13f){if(!_0x11c13f)return _0xe2160e['sendStatus'](0x194);return{'url':oauth[_0x94d5('0x48')](_0x11c13f,_0x3b2af3[_0x94d5('0x49')]['id'])};})[_0x94d5('0x15')](respondWithResult(_0xe2160e,null))[_0x94d5('0x39')](handleError(_0xe2160e,null));};exports['oauth2MicrosoftCallback']=function(_0x6f7d60,_0x17f8d0){var _0x5b76c2=_0x6f7d60[_0x94d5('0x3f')];var _0x42317f;var _0x5280b3;if(_0x5b76c2[_0x94d5('0x17')])throw _0x5b76c2;redis[_0x94d5('0x4a')](_0x5b76c2[_0x94d5('0x4b')])['then'](function(_0x120d37){if(!_0x120d37)throw new Error(_0x94d5('0x4c'));_0x42317f=JSON[_0x94d5('0x4d')](_0x120d37);var _0x5645d3=Buffer[_0x94d5('0x4e')](_0x5b76c2[_0x94d5('0x4b')],'base64')[_0x94d5('0x4f')](_0x94d5('0x50'));_0x5280b3=JSON[_0x94d5('0x4d')](_0x5645d3);if(!oauth[_0x94d5('0x51')](_0x5b76c2[_0x94d5('0x52')],_0x42317f[_0x94d5('0x53')]))throw new Error(_0x94d5('0x54'));redis['del'](_0x5b76c2[_0x94d5('0x4b')]);return oauth[_0x94d5('0x55')](_0x5b76c2[_0x94d5('0x56')],_0x42317f);})[_0x94d5('0x15')](function(_0x573ac7){_0x42317f[_0x94d5('0x57')]=_0x573ac7['access_token'];_0x42317f[_0x94d5('0x58')]=_0x573ac7[_0x94d5('0x59')];return db[_0x94d5('0x1d')][_0x94d5('0x14')]({'data5':_0x42317f[_0x94d5('0x57')],'data6':_0x42317f[_0x94d5('0x58')]},{'where':{'id':_0x42317f['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x42317f);socket[_0x94d5('0x5a')](_0x94d5('0x5b'),{'id':_0x5280b3['id']});return;})[_0x94d5('0x15')](respondWithStatusCode(_0x17f8d0,null))[_0x94d5('0x39')](function(_0x4478ea){if(_0x5280b3){socket['emit'](_0x94d5('0x5c'),{'id':_0x5280b3['id']});}if(!_0x42317f){logger[_0x94d5('0x17')](_0x94d5('0x5d'),_0x4478ea);return _0x17f8d0[_0x94d5('0xb')](0x1f4)[_0x94d5('0x5e')](_0x4478ea[_0x94d5('0x5f')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x42317f['id'],JSON[_0x94d5('0x60')](_0x4478ea));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 45cf1bd..6ab89df 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 _0x298f=['../../config/environment','exports','define','CloudProvider','cloud_providers','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2e0cd1,_0x381dc8){var _0x5766b9=function(_0x36ac6d){while(--_0x36ac6d){_0x2e0cd1['push'](_0x2e0cd1['shift']());}};_0x5766b9(++_0x381dc8);}(_0x298f,0x1e6));var _0xf298=function(_0xf9298e,_0x1f89ff){_0xf9298e=_0xf9298e-0x0;var _0xb34965=_0x298f[_0xf9298e];return _0xb34965;};'use strict';var _=require(_0xf298('0x0'));var util=require(_0xf298('0x1'));var logger=require('../../config/logger')(_0xf298('0x2'));var moment=require(_0xf298('0x3'));var BPromise=require(_0xf298('0x4'));var rp=require(_0xf298('0x5'));var fs=require('fs');var path=require(_0xf298('0x6'));var rimraf=require(_0xf298('0x7'));var config=require(_0xf298('0x8'));var attributes=require('./cloudProvider.attributes');module[_0xf298('0x9')]=function(_0xaf090d,_0x3bb402){return _0xaf090d[_0xf298('0xa')](_0xf298('0xb'),attributes,{'tableName':_0xf298('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7903=['request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','cloud_providers','lodash','util','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7903,0x13b));var _0x3790=function(_0x445002,_0x25bce8){_0x445002=_0x445002-0x0;var _0x4a256f=_0x7903[_0x445002];return _0x4a256f;};'use strict';var _=require(_0x3790('0x0'));var util=require(_0x3790('0x1'));var logger=require(_0x3790('0x2'))(_0x3790('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3790('0x4'));var fs=require('fs');var path=require(_0x3790('0x5'));var rimraf=require(_0x3790('0x6'));var config=require(_0x3790('0x7'));var attributes=require(_0x3790('0x8'));module[_0x3790('0x9')]=function(_0x45c5c4,_0x906b2a){return _0x45c5c4['define']('CloudProvider',attributes,{'tableName':_0x3790('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 d82105d..d6df790 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 _0x738b=['value','oauth2Claims','oauth2/','decode','payload','iss','aud','unix','exp','resolve','then','CloudProvider','data6','data1','decryptString','POST','replace','data5','access_token','refresh_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data3','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','type','Dynamics365','/.default','join','Outlook365','data7','{TENANT_ID}','data2','code','from','stringify','toString','base64','randomBytes','response_type','redirect_uri','data4','response_mode','state','nonce','prompt','login','map','key'];(function(_0x2278d4,_0x3ebf8e){var _0x25f2ee=function(_0x5a54a8){while(--_0x5a54a8){_0x2278d4['push'](_0x2278d4['shift']());}};_0x25f2ee(++_0x3ebf8e);}(_0x738b,0x192));var _0xb738=function(_0xacdaf2,_0x4ac4d5){_0xacdaf2=_0xacdaf2-0x0;var _0x6c4568=_0x738b[_0xacdaf2];return _0x6c4568;};'use strict';var _=require('lodash');var crypto=require(_0xb738('0x0'));var jwt=require(_0xb738('0x1'));var moment=require(_0xb738('0x2'));var Redis=require('ioredis');var rp=require(_0xb738('0x3'));var util=require(_0xb738('0x4'));var encryptor=require(_0xb738('0x5'));var config=require(_0xb738('0x6'));var logger=require('../../config/logger')(_0xb738('0x7'));var schedule=require(_0xb738('0x8'));var db=require('../../mysqldb')['db'];config[_0xb738('0x9')]=_['defaults'](config['redis'],{'host':_0xb738('0xa'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xb738('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xb738('0xc'),_0xb738('0xd'),_0xb738('0xe'),'offline_access',_0xb738('0xf'),'https://outlook.office.com/POP.AccessAsUser.All',_0xb738('0x10')],'Dynamics365':[_0xb738('0xc'),_0xb738('0x11')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5928de){var _0x4f13ef=_['map'](AZURE_AUTH_SCOPES[_0x5928de[_0xb738('0x12')]]);if(_0x5928de[_0xb738('0x12')]===_0xb738('0x13'))_0x4f13ef['push'](_0x5928de['data7']+_0xb738('0x14'));return _0x4f13ef[_0xb738('0x15')]('\x20');}function getAccessTokenScope(_0xc54b5e){if(_0xc54b5e['type']===_0xb738('0x16'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0xc54b5e['type']===_0xb738('0x13'))return _0xc54b5e[_0xb738('0x17')]+_0xb738('0x14');}function generateMicrosoftAuthorizationUrl(_0x2fbf41,_0x206067){var _0x2e9c19=MICROSOFT_AUTH_URL['replace'](_0xb738('0x18'),_0x2fbf41[_0xb738('0x19')]);var _0x2cc462=[_0xb738('0x1a'),'id_token'];var _0x2cc5fd=Buffer[_0xb738('0x1b')](JSON[_0xb738('0x1c')]({'id':_0x206067}))[_0xb738('0x1d')](_0xb738('0x1e'));var _0x22074d=crypto[_0xb738('0x1f')](0x10)['toString']('hex');var _0x21dea1=getAuthorizationScopes(_0x2fbf41);var _0x496623=[{'key':'client_id','value':_0x2fbf41['data1']},{'key':_0xb738('0x20'),'value':encodeURIComponent(_0x2cc462[_0xb738('0x15')]('\x20'))},{'key':_0xb738('0x21'),'value':_0x2fbf41[_0xb738('0x22')]},{'key':_0xb738('0x23'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x21dea1)},{'key':_0xb738('0x24'),'value':_0x2cc5fd},{'key':_0xb738('0x25'),'value':_0x22074d},{'key':_0xb738('0x26'),'value':_0xb738('0x27')}];var _0x2cf99d=_0x2e9c19+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb738('0x28')](_0x496623,function(_0x2a5f29){return _0x2a5f29[_0xb738('0x29')]+'='+_0x2a5f29[_0xb738('0x2a')];})[_0xb738('0x15')]('&');_0x2fbf41[_0xb738('0x2b')]={'issuer':_0x2e9c19['replace'](_0xb738('0x2c'),''),'audience':_0x2fbf41['data1'],'state':_0x2cc5fd,'nonce':_0x22074d};redis['set'](_0x2cc5fd,JSON[_0xb738('0x1c')](_0x2fbf41));return _0x2cf99d;}function isValidIdToken(_0x8829f9,_0x34cf78){try{var _0x5357f9=jwt[_0xb738('0x2d')](_0x8829f9,{'complete':!![]});var _0x18fb02=_0x5357f9[_0xb738('0x2e')];if(_0x18fb02[_0xb738('0x2f')]!==_0x34cf78['issuer'])return![];if(_0x18fb02[_0xb738('0x30')]!==_0x34cf78['audience'])return![];if(_0x18fb02[_0xb738('0x25')]!==_0x34cf78[_0xb738('0x25')])return![];if(moment()['isAfter'](moment[_0xb738('0x31')](_0x18fb02[_0xb738('0x32')])))return![];return!![];}catch(_0x4f8df4){throw _0x4f8df4;}}function refreshOauth2MicrosoftAccessToken(_0x2607ad){return Promise[_0xb738('0x33')]()[_0xb738('0x34')](function(){if(_0x2607ad['data3'])return _0x2607ad;return db[_0xb738('0x35')]['findOne']({'where':{'id':_0x2607ad['id']},'raw':!![]});})['then'](function(_0x9e4214){var _0x1434ea={'grant_type':'refresh_token','refresh_token':_0x9e4214[_0xb738('0x36')],'scope':getAccessTokenScope(_0x9e4214),'redirect_uri':_0x9e4214['data4'],'client_id':_0x9e4214[_0xb738('0x37')],'client_secret':encryptor[_0xb738('0x38')](_0x9e4214['data3'])};var _0xca50cd={'method':_0xb738('0x39'),'uri':MICROSOFT_AUTH_URL[_0xb738('0x3a')](_0xb738('0x18'),_0x9e4214['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1434ea,'json':!![]};return rp(_0xca50cd);})[_0xb738('0x34')](function(_0x481a85){_0x2607ad[_0xb738('0x3b')]=_0x481a85[_0xb738('0x3c')];_0x2607ad['data6']=_0x481a85[_0xb738('0x3d')];return db[_0xb738('0x35')][_0xb738('0x3e')]({'data5':_0x2607ad[_0xb738('0x3b')],'data6':_0x2607ad[_0xb738('0x36')]},{'where':{'id':_0x2607ad['id']}});})[_0xb738('0x34')](function(){return _0x2607ad;})[_0xb738('0x3f')](function(_0x39989e){logger[_0xb738('0x40')](_0xb738('0x41'),_0x2607ad['id'],_0x39989e);});}function getOauth2MicrosoftAccessToken(_0x5d0adb,_0x4f1f8f){var _0xf21d29={'grant_type':_0xb738('0x42'),'code':_0x5d0adb,'scope':getAccessTokenScope(_0x4f1f8f),'redirect_uri':_0x4f1f8f[_0xb738('0x22')],'client_id':_0x4f1f8f[_0xb738('0x37')],'client_secret':encryptor[_0xb738('0x38')](_0x4f1f8f[_0xb738('0x43')])};var _0x5eb069={'method':_0xb738('0x39'),'uri':MICROSOFT_AUTH_URL[_0xb738('0x3a')]('{TENANT_ID}',_0x4f1f8f['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xf21d29,'json':!![]};return rp(_0x5eb069);}function startRefreshInterval(_0xa9d2bd){var _0x56b1d5=schedule[_0xb738('0x44')];if(_0x56b1d5[_0xa9d2bd['id']])clearInterval(_0x56b1d5[_0xa9d2bd['id']]);_0x56b1d5[_0xa9d2bd['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xb738('0x45')](this,{'id':_0xa9d2bd['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xb738('0x44')]=_0x56b1d5;}function startAllRefreshIntervals(){return db[_0xb738('0x35')][_0xb738('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xb738('0x34')](function(_0x5f732f){var _0x5627f3=_0x5f732f[_0xb738('0x28')](function(_0x59b7ab){return refreshOauth2MicrosoftAccessToken(_0x59b7ab)[_0xb738('0x34')](function(_0x55d067){startRefreshInterval(_0x55d067);});});return Promise[_0xb738('0x47')](_0x5627f3);})['catch'](function(_0x3b994c){var _0x2485f9=_0x3b994c?util[_0xb738('0x48')](_0x3b994c,{'showHidden':![],'depth':null}):'';logger[_0xb738('0x40')](_0xb738('0x49'),_0x2485f9);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xf6f8=['https://outlook.office.com/SMTP.Send','openid','/authorize','/token','map','type','Dynamics365','push','data7','join','/.default','replace','{TENANT_ID}','data2','code','id_token','from','toString','base64','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','value','oauth2Claims','set','stringify','decode','payload','iss','aud','audience','isAfter','unix','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','access_token','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','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','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All'];(function(_0xa7242e,_0x22572b){var _0x55dbc4=function(_0x54d6f6){while(--_0x54d6f6){_0xa7242e['push'](_0xa7242e['shift']());}};_0x55dbc4(++_0x22572b);}(_0xf6f8,0xe6));var _0x8f6f=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0xf6f8[_0x49d41c];return _0xb64c5f;};'use strict';var _=require('lodash');var crypto=require(_0x8f6f('0x0'));var jwt=require(_0x8f6f('0x1'));var moment=require(_0x8f6f('0x2'));var Redis=require(_0x8f6f('0x3'));var rp=require(_0x8f6f('0x4'));var util=require(_0x8f6f('0x5'));var encryptor=require(_0x8f6f('0x6'));var config=require(_0x8f6f('0x7'));var logger=require('../../config/logger')(_0x8f6f('0x8'));var schedule=require(_0x8f6f('0x9'));var db=require(_0x8f6f('0xa'))['db'];config[_0x8f6f('0xb')]=_[_0x8f6f('0xc')](config[_0x8f6f('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x8f6f('0xb')]);var MICROSOFT_AUTH_URL=_0x8f6f('0xd');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x8f6f('0xe'),_0x8f6f('0xf'),_0x8f6f('0x10'),_0x8f6f('0x11'),_0x8f6f('0x12'),_0x8f6f('0x13')],'Dynamics365':[_0x8f6f('0x14'),_0x8f6f('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x8f6f('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0x8f6f('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x41e4e5){var _0xf0b71d=_[_0x8f6f('0x17')](AZURE_AUTH_SCOPES[_0x41e4e5[_0x8f6f('0x18')]]);if(_0x41e4e5['type']===_0x8f6f('0x19'))_0xf0b71d[_0x8f6f('0x1a')](_0x41e4e5[_0x8f6f('0x1b')]+'/.default');return _0xf0b71d[_0x8f6f('0x1c')]('\x20');}function getAccessTokenScope(_0x475f08){if(_0x475f08['type']==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x475f08[_0x8f6f('0x18')]===_0x8f6f('0x19'))return _0x475f08[_0x8f6f('0x1b')]+_0x8f6f('0x1d');}function generateMicrosoftAuthorizationUrl(_0x119f3e,_0x4ef92c){var _0x191af7=MICROSOFT_AUTH_URL[_0x8f6f('0x1e')](_0x8f6f('0x1f'),_0x119f3e[_0x8f6f('0x20')]);var _0xb1f8aa=[_0x8f6f('0x21'),_0x8f6f('0x22')];var _0x32ec7c=Buffer[_0x8f6f('0x23')](JSON['stringify']({'id':_0x4ef92c}))[_0x8f6f('0x24')](_0x8f6f('0x25'));var _0x5bd2e1=crypto['randomBytes'](0x10)['toString'](_0x8f6f('0x26'));var _0x7713c1=getAuthorizationScopes(_0x119f3e);var _0x3ab13f=[{'key':_0x8f6f('0x27'),'value':_0x119f3e[_0x8f6f('0x28')]},{'key':_0x8f6f('0x29'),'value':encodeURIComponent(_0xb1f8aa[_0x8f6f('0x1c')]('\x20'))},{'key':_0x8f6f('0x2a'),'value':_0x119f3e[_0x8f6f('0x2b')]},{'key':_0x8f6f('0x2c'),'value':_0x8f6f('0x2d')},{'key':_0x8f6f('0x2e'),'value':encodeURIComponent(_0x7713c1)},{'key':_0x8f6f('0x2f'),'value':_0x32ec7c},{'key':_0x8f6f('0x30'),'value':_0x5bd2e1},{'key':_0x8f6f('0x31'),'value':'login'}];var _0x2d3f17=_0x191af7+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x8f6f('0x17')](_0x3ab13f,function(_0x144072){return _0x144072['key']+'='+_0x144072[_0x8f6f('0x32')];})[_0x8f6f('0x1c')]('&');_0x119f3e[_0x8f6f('0x33')]={'issuer':_0x191af7[_0x8f6f('0x1e')]('oauth2/',''),'audience':_0x119f3e[_0x8f6f('0x28')],'state':_0x32ec7c,'nonce':_0x5bd2e1};redis[_0x8f6f('0x34')](_0x32ec7c,JSON[_0x8f6f('0x35')](_0x119f3e));return _0x2d3f17;}function isValidIdToken(_0x12468c,_0x3449cd){try{var _0x150803=jwt[_0x8f6f('0x36')](_0x12468c,{'complete':!![]});var _0x4de9b1=_0x150803[_0x8f6f('0x37')];if(_0x4de9b1[_0x8f6f('0x38')]!==_0x3449cd['issuer'])return![];if(_0x4de9b1[_0x8f6f('0x39')]!==_0x3449cd[_0x8f6f('0x3a')])return![];if(_0x4de9b1[_0x8f6f('0x30')]!==_0x3449cd[_0x8f6f('0x30')])return![];if(moment()[_0x8f6f('0x3b')](moment[_0x8f6f('0x3c')](_0x4de9b1['exp'])))return![];return!![];}catch(_0x50d835){throw _0x50d835;}}function refreshOauth2MicrosoftAccessToken(_0x5b3e51){return Promise[_0x8f6f('0x3d')]()[_0x8f6f('0x3e')](function(){if(_0x5b3e51[_0x8f6f('0x3f')])return _0x5b3e51;return db[_0x8f6f('0x40')][_0x8f6f('0x41')]({'where':{'id':_0x5b3e51['id']},'raw':!![]});})[_0x8f6f('0x3e')](function(_0x5f489a){var _0x1ef78c={'grant_type':_0x8f6f('0x42'),'refresh_token':_0x5f489a[_0x8f6f('0x43')],'scope':getAccessTokenScope(_0x5f489a),'redirect_uri':_0x5f489a[_0x8f6f('0x2b')],'client_id':_0x5f489a['data1'],'client_secret':encryptor[_0x8f6f('0x44')](_0x5f489a[_0x8f6f('0x3f')])};var _0x36ba6e={'method':_0x8f6f('0x45'),'uri':MICROSOFT_AUTH_URL[_0x8f6f('0x1e')](_0x8f6f('0x1f'),_0x5f489a[_0x8f6f('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1ef78c,'json':!![]};return rp(_0x36ba6e);})[_0x8f6f('0x3e')](function(_0x531eea){_0x5b3e51[_0x8f6f('0x46')]=_0x531eea[_0x8f6f('0x47')];_0x5b3e51[_0x8f6f('0x43')]=_0x531eea[_0x8f6f('0x42')];return db['CloudProvider'][_0x8f6f('0x48')]({'data5':_0x5b3e51[_0x8f6f('0x46')],'data6':_0x5b3e51[_0x8f6f('0x43')]},{'where':{'id':_0x5b3e51['id']}});})[_0x8f6f('0x3e')](function(){return _0x5b3e51;})['catch'](function(_0xfa09f1){logger['error'](_0x8f6f('0x49'),_0x5b3e51['id'],_0xfa09f1);});}function getOauth2MicrosoftAccessToken(_0x3d01f4,_0x4b2aaa){var _0x2a7a79={'grant_type':_0x8f6f('0x4a'),'code':_0x3d01f4,'scope':getAccessTokenScope(_0x4b2aaa),'redirect_uri':_0x4b2aaa[_0x8f6f('0x2b')],'client_id':_0x4b2aaa[_0x8f6f('0x28')],'client_secret':encryptor[_0x8f6f('0x44')](_0x4b2aaa[_0x8f6f('0x3f')])};var _0x49c3ef={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x8f6f('0x1e')](_0x8f6f('0x1f'),_0x4b2aaa[_0x8f6f('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2a7a79,'json':!![]};return rp(_0x49c3ef);}function startRefreshInterval(_0x6db01d){var _0x4b6de1=schedule[_0x8f6f('0x4b')];if(_0x4b6de1[_0x6db01d['id']])clearInterval(_0x4b6de1[_0x6db01d['id']]);_0x4b6de1[_0x6db01d['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8f6f('0x4c')](this,{'id':_0x6db01d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x4b6de1;}function startAllRefreshIntervals(){return db[_0x8f6f('0x40')][_0x8f6f('0x4d')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8f6f('0x3e')](function(_0x18e788){var _0x598053=_0x18e788['map'](function(_0x4bf3c4){return refreshOauth2MicrosoftAccessToken(_0x4bf3c4)[_0x8f6f('0x3e')](function(_0x3e5981){startRefreshInterval(_0x3e5981);});});return Promise[_0x8f6f('0x4e')](_0x598053);})['catch'](function(_0x1de5a2){var _0x36e40d=_0x1de5a2?util[_0x8f6f('0x4f')](_0x1de5a2,{'showHidden':![],'depth':null}):'';logger[_0x8f6f('0x50')](_0x8f6f('0x51'),_0x36e40d);});}module[_0x8f6f('0x52')]={'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 ca157bd..187348c 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 _0x3d45=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','then','info','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x1174a4,_0x53e376){var _0x26e5e0=function(_0x26acc2){while(--_0x26acc2){_0x1174a4['push'](_0x1174a4['shift']());}};_0x26e5e0(++_0x53e376);}(_0x3d45,0x1d2));var _0x53d4=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d45[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x53d4('0x0'));var util=require(_0x53d4('0x1'));var moment=require(_0x53d4('0x2'));var BPromise=require(_0x53d4('0x3'));var rs=require(_0x53d4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53d4('0x5'))['db'];var utils=require(_0x53d4('0x6'));var logger=require('../../config/logger')(_0x53d4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x235ee0,_0xbfffb2,_0x2c7029){return new BPromise(function(_0xdbf204,_0x39ff2a){return client['request'](_0x235ee0,_0x2c7029)[_0x53d4('0x8')](function(_0x20b209){logger[_0x53d4('0x9')]('CloudProvider,\x20%s,\x20%s',_0xbfffb2,_0x53d4('0xa'));logger['debug'](_0x53d4('0xb'),_0xbfffb2,_0x53d4('0xa'),JSON[_0x53d4('0xc')](_0x20b209));if(_0x20b209[_0x53d4('0xd')]){if(_0x20b209[_0x53d4('0xd')]['code']===0x1f4){logger[_0x53d4('0xd')](_0x53d4('0xe'),_0xbfffb2,_0x20b209[_0x53d4('0xd')]['message']);return _0x39ff2a(_0x20b209[_0x53d4('0xd')][_0x53d4('0xf')]);}logger['error'](_0x53d4('0xe'),_0xbfffb2,_0x20b209['error'][_0x53d4('0xf')]);return _0xdbf204(_0x20b209[_0x53d4('0xd')][_0x53d4('0xf')]);}else{logger['info'](_0x53d4('0xe'),_0xbfffb2,_0x53d4('0xa'));_0xdbf204(_0x20b209[_0x53d4('0x10')][_0x53d4('0xf')]);}})[_0x53d4('0x11')](function(_0x503259){logger[_0x53d4('0xd')](_0x53d4('0xe'),_0xbfffb2,_0x503259);_0x39ff2a(_0x503259);});});}
\ No newline at end of file
+var _0x01a6=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','CloudProvider,\x20%s,\x20%s','message'];(function(_0xa1a10,_0x336001){var _0x3274c1=function(_0x4beb40){while(--_0x4beb40){_0xa1a10['push'](_0xa1a10['shift']());}};_0x3274c1(++_0x336001);}(_0x01a6,0x162));var _0x601a=function(_0x1d5c3f,_0x2b5faa){_0x1d5c3f=_0x1d5c3f-0x0;var _0x2ebc3e=_0x01a6[_0x1d5c3f];return _0x2ebc3e;};'use strict';var _=require(_0x601a('0x0'));var util=require('util');var moment=require(_0x601a('0x1'));var BPromise=require(_0x601a('0x2'));var rs=require(_0x601a('0x3'));var fs=require('fs');var Redis=require(_0x601a('0x4'));var db=require(_0x601a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x601a('0x6'))('rpc');var config=require(_0x601a('0x7'));var jayson=require(_0x601a('0x8'));var client=jayson[_0x601a('0x9')][_0x601a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x272297,_0x5d94b5,_0x4ec3fe){return new BPromise(function(_0x208472,_0x1b6bf7){return client[_0x601a('0xb')](_0x272297,_0x4ec3fe)['then'](function(_0x6c5aab){logger[_0x601a('0xc')]('CloudProvider,\x20%s,\x20%s',_0x5d94b5,_0x601a('0xd'));logger[_0x601a('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5d94b5,_0x601a('0xd'),JSON[_0x601a('0xf')](_0x6c5aab));if(_0x6c5aab[_0x601a('0x10')]){if(_0x6c5aab[_0x601a('0x10')][_0x601a('0x11')]===0x1f4){logger[_0x601a('0x10')](_0x601a('0x12'),_0x5d94b5,_0x6c5aab[_0x601a('0x10')][_0x601a('0x13')]);return _0x1b6bf7(_0x6c5aab[_0x601a('0x10')][_0x601a('0x13')]);}logger['error'](_0x601a('0x12'),_0x5d94b5,_0x6c5aab[_0x601a('0x10')][_0x601a('0x13')]);return _0x208472(_0x6c5aab[_0x601a('0x10')][_0x601a('0x13')]);}else{logger[_0x601a('0xc')]('CloudProvider,\x20%s,\x20%s',_0x5d94b5,_0x601a('0xd'));_0x208472(_0x6c5aab[_0x601a('0x14')][_0x601a('0x13')]);}})[_0x601a('0x15')](function(_0x4e1ebf){logger[_0x601a('0x10')]('CloudProvider,\x20%s,\x20%s',_0x5d94b5,_0x4e1ebf);_0x1b6bf7(_0x4e1ebf);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index a73932d..114803d 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(_0x483102,_0x54e93d){var _0x5cc885=function(_0x54931c){while(--_0x54931c){_0x483102['push'](_0x483102['shift']());}};_0x5cc885(++_0x54e93d);}(_0x1261,0x144));var _0x1126=function(_0x35021f,_0x451349){_0x35021f=_0x35021f-0x0;var _0x1044e9=_0x1261[_0x35021f];return _0x1044e9;};'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 _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x4001ad,_0x1e22dd){var _0x4c7ec2=function(_0x24cb8a){while(--_0x24cb8a){_0x4001ad['push'](_0x4001ad['shift']());}};_0x4c7ec2(++_0x1e22dd);}(_0x1261,0x144));var _0x1126=function(_0x3d8240,_0x2663d4){_0x3d8240=_0x3d8240-0x0;var _0x3d0372=_0x1261[_0x3d8240];return _0x3d0372;};'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
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 8e0d596..78fe6c1 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 _0xb0ff=['STRING','exports'];(function(_0x408a76,_0x24dbb4){var _0x19f1bc=function(_0x58fa79){while(--_0x58fa79){_0x408a76['push'](_0x408a76['shift']());}};_0x19f1bc(++_0x24dbb4);}(_0xb0ff,0xb3));var _0xfb0f=function(_0x247cb3,_0x4e54f9){_0x247cb3=_0x247cb3-0x0;var _0x537741=_0xb0ff[_0x247cb3];return _0x537741;};'use strict';var Sequelize=require('sequelize');module[_0xfb0f('0x0')]={'name':{'type':Sequelize[_0xfb0f('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xfb0f('0x1')]},'companyId':{'type':Sequelize[_0xfb0f('0x1')]},'website':{'type':Sequelize[_0xfb0f('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xfb0f('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xfb0f('0x1')]},'postalCode':{'type':Sequelize[_0xfb0f('0x1')]},'city':{'type':Sequelize[_0xfb0f('0x1')]},'country':{'type':Sequelize[_0xfb0f('0x1')]},'email':{'type':Sequelize[_0xfb0f('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xfb0f('0x1')]},'sStreet':{'type':Sequelize[_0xfb0f('0x1')]},'sPostalCode':{'type':Sequelize[_0xfb0f('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xfb0f('0x1')]},'description':{'type':Sequelize[_0xfb0f('0x1')]}};
\ No newline at end of file
+var _0x3151=['sequelize','exports','STRING','name'];(function(_0x1c1683,_0x1e0d74){var _0xc2c5d2=function(_0x8443c7){while(--_0x8443c7){_0x1c1683['push'](_0x1c1683['shift']());}};_0xc2c5d2(++_0x1e0d74);}(_0x3151,0x1c0));var _0x1315=function(_0x22890a,_0x5d3a7a){_0x22890a=_0x22890a-0x0;var _0x3290ae=_0x3151[_0x22890a];return _0x3290ae;};'use strict';var Sequelize=require(_0x1315('0x0'));module[_0x1315('0x1')]={'name':{'type':Sequelize[_0x1315('0x2')],'unique':_0x1315('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1315('0x2')]},'companyId':{'type':Sequelize[_0x1315('0x2')]},'website':{'type':Sequelize[_0x1315('0x2')]},'phone':{'type':Sequelize[_0x1315('0x2')]},'fax':{'type':Sequelize[_0x1315('0x2')]},'type':{'type':Sequelize[_0x1315('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1315('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1315('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1315('0x2')]},'sStreet':{'type':Sequelize[_0x1315('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x1315('0x2')]},'sCountry':{'type':Sequelize[_0x1315('0x2')]},'description':{'type':Sequelize[_0x1315('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 97c6d6d..c1a5a03 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 _0xf500=['destroy','then','Companies','stack','name','send','index','CmCompany','describe','query','keys','filters','intersection','attributes','fields','length','model','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addContacts','CmContact','ids','getContacts','findOne','order','pick','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x5859d6,_0x197158){var _0x1ed613=function(_0xbd2c4a){while(--_0xbd2c4a){_0x5859d6['push'](_0x5859d6['shift']());}};_0x1ed613(++_0x197158);}(_0xf500,0x13d));var _0x0f50=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xf500[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0x0f50('0x0'));var rimraf=require(_0x0f50('0x1'));var zipdir=require(_0x0f50('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f50('0x3'));var moment=require(_0x0f50('0x4'));var BPromise=require(_0x0f50('0x5'));var Mustache=require(_0x0f50('0x6'));var util=require(_0x0f50('0x7'));var path=require('path');var sox=require(_0x0f50('0x8'));var csv=require(_0x0f50('0x9'));var ejs=require(_0x0f50('0xa'));var fs=require('fs');var fs_extra=require(_0x0f50('0xb'));var _=require(_0x0f50('0xc'));var squel=require(_0x0f50('0xd'));var crypto=require(_0x0f50('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0f50('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0f50('0x10'));var Papa=require(_0x0f50('0x11'));var Redis=require(_0x0f50('0x12'));var authService=require(_0x0f50('0x13'));var qs=require(_0x0f50('0x14'));var as=require(_0x0f50('0x15'));var hardwareService=require(_0x0f50('0x16'));var logger=require(_0x0f50('0x17'))(_0x0f50('0x18'));var utils=require(_0x0f50('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x0f50('0x1a'));var db=require(_0x0f50('0x1b'))['db'];function respondWithStatusCode(_0x175570,_0x8e50c1){_0x8e50c1=_0x8e50c1||0xcc;return function(_0x58a475){if(_0x58a475){return _0x175570[_0x0f50('0x1c')](_0x8e50c1);}return _0x175570['status'](_0x8e50c1)['end']();};}function respondWithResult(_0x2d8c41,_0x8b0086){_0x8b0086=_0x8b0086||0xc8;return function(_0x4af2e8){if(_0x4af2e8){return _0x2d8c41[_0x0f50('0x1d')](_0x8b0086)[_0x0f50('0x1e')](_0x4af2e8);}};}function respondWithFilteredResult(_0x8234c3,_0x14e86c){return function(_0x30cd88){if(_0x30cd88){var _0x3a9217=typeof _0x14e86c[_0x0f50('0x1f')]===_0x0f50('0x20')&&typeof _0x14e86c['limit']===_0x0f50('0x20');var _0x2ca9f8=_0x30cd88[_0x0f50('0x21')];var _0x2a6eee=_0x3a9217?0x0:_0x14e86c[_0x0f50('0x1f')];var _0x5dd404=_0x3a9217?_0x30cd88['count']:_0x14e86c[_0x0f50('0x1f')]+_0x14e86c[_0x0f50('0x22')];var _0x469cfd;if(_0x5dd404>=_0x2ca9f8){_0x5dd404=_0x2ca9f8;_0x469cfd=0xc8;}else{_0x469cfd=0xce;}_0x8234c3[_0x0f50('0x1d')](_0x469cfd);return _0x8234c3[_0x0f50('0x23')](_0x0f50('0x24'),_0x2a6eee+'-'+_0x5dd404+'/'+_0x2ca9f8)[_0x0f50('0x1e')](_0x30cd88);}return null;};}function patchUpdates(_0x3fb152){return function(_0x126623){try{jsonpatch[_0x0f50('0x25')](_0x126623,_0x3fb152,!![]);}catch(_0x22cdee){return BPromise[_0x0f50('0x26')](_0x22cdee);}return _0x126623['save']();};}function saveUpdates(_0x2d547a,_0x1a48bb){return function(_0x5c4a77){if(_0x5c4a77){return _0x5c4a77['update'](_0x2d547a)['then'](function(_0x5be168){return _0x5be168;});}return null;};}function removeEntity(_0x1816dc,_0x167f55){return function(_0x3ccec7){if(_0x3ccec7){return _0x3ccec7[_0x0f50('0x27')]()[_0x0f50('0x28')](function(){var _0x2efcb4=_0x3ccec7['get']({'plain':!![]});var _0x4f8938=_0x0f50('0x29');return db['UserProfileResource'][_0x0f50('0x27')]({'where':{'type':_0x4f8938,'resourceId':_0x2efcb4['id']}})[_0x0f50('0x28')](function(){return _0x3ccec7;});})[_0x0f50('0x28')](function(){_0x1816dc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54f79e,_0x4a077f){return function(_0x33908f){if(!_0x33908f){_0x54f79e['sendStatus'](0x194);}return _0x33908f;};}function handleError(_0xaebc4a,_0x1a58d8){_0x1a58d8=_0x1a58d8||0x1f4;return function(_0x4df84e){logger['error'](_0x4df84e[_0x0f50('0x2a')]);if(_0x4df84e[_0x0f50('0x2b')]){delete _0x4df84e[_0x0f50('0x2b')];}_0xaebc4a['status'](_0x1a58d8)[_0x0f50('0x2c')](_0x4df84e);};}exports[_0x0f50('0x2d')]=function(_0x822598,_0x557df6){var _0x5a6433={},_0x3376ba={},_0x595300={'count':0x0,'rows':[]};return db[_0x0f50('0x2e')][_0x0f50('0x2f')]()['then'](function(_0x4219a2){_0x3376ba['model']=_['keys'](_0x4219a2);_0x3376ba[_0x0f50('0x30')]=_[_0x0f50('0x31')](_0x822598[_0x0f50('0x30')]);_0x3376ba[_0x0f50('0x32')]=_[_0x0f50('0x33')](_0x3376ba['model'],_0x3376ba[_0x0f50('0x30')]);_0x5a6433[_0x0f50('0x34')]=_[_0x0f50('0x33')](_0x3376ba['model'],qs[_0x0f50('0x35')](_0x822598[_0x0f50('0x30')][_0x0f50('0x35')]));_0x5a6433[_0x0f50('0x34')]=_0x5a6433['attributes'][_0x0f50('0x36')]?_0x5a6433['attributes']:_0x3376ba[_0x0f50('0x37')];if(!_0x822598[_0x0f50('0x30')]['hasOwnProperty'](_0x0f50('0x38'))){_0x5a6433[_0x0f50('0x22')]=qs[_0x0f50('0x22')](_0x822598[_0x0f50('0x30')][_0x0f50('0x22')]);_0x5a6433['offset']=qs['offset'](_0x822598[_0x0f50('0x30')][_0x0f50('0x1f')]);}_0x5a6433['order']=qs['sort'](_0x822598[_0x0f50('0x30')][_0x0f50('0x39')]);_0x5a6433[_0x0f50('0x3a')]=qs['filters'](_['pick'](_0x822598['query'],_0x3376ba['filters']),_0x4219a2);if(_0x822598[_0x0f50('0x30')][_0x0f50('0x3b')]){_0x5a6433[_0x0f50('0x3a')]=_[_0x0f50('0x3c')](_0x5a6433[_0x0f50('0x3a')],{'$or':_['map'](_0x5a6433[_0x0f50('0x34')],function(_0x55b867){var _0x37940b={};_0x37940b[_0x55b867]={'$like':'%'+_0x822598[_0x0f50('0x30')][_0x0f50('0x3b')]+'%'};return _0x37940b;})});}_0x5a6433=_[_0x0f50('0x3c')]({},_0x5a6433,_0x822598[_0x0f50('0x3d')]);var _0x44c7c6={'where':_0x5a6433['where']};return db[_0x0f50('0x2e')][_0x0f50('0x21')](_0x44c7c6)[_0x0f50('0x28')](function(_0x3f1bf2){_0x595300[_0x0f50('0x21')]=_0x3f1bf2;if(_0x822598[_0x0f50('0x30')][_0x0f50('0x3e')]){_0x5a6433[_0x0f50('0x3f')]=[{'all':!![]}];}return db[_0x0f50('0x2e')][_0x0f50('0x40')](_0x5a6433);})['then'](function(_0x4f3c3b){_0x595300['rows']=_0x4f3c3b;return _0x595300;})['then'](respondWithFilteredResult(_0x557df6,_0x5a6433))[_0x0f50('0x41')](handleError(_0x557df6,null));})[_0x0f50('0x41')](handleError(_0x557df6,null));};exports['show']=function(_0x1d17a9,_0x355b05){var _0x1700a0={'raw':![],'where':{'id':_0x1d17a9[_0x0f50('0x42')]['id']}},_0x49240c={};_0x49240c[_0x0f50('0x37')]=_['keys'](db[_0x0f50('0x2e')][_0x0f50('0x43')]);_0x49240c[_0x0f50('0x30')]=_[_0x0f50('0x31')](_0x1d17a9[_0x0f50('0x30')]);_0x49240c[_0x0f50('0x32')]=_[_0x0f50('0x33')](_0x49240c[_0x0f50('0x37')],_0x49240c[_0x0f50('0x30')]);_0x1700a0[_0x0f50('0x34')]=_['intersection'](_0x49240c[_0x0f50('0x37')],qs[_0x0f50('0x35')](_0x1d17a9['query']['fields']));_0x1700a0[_0x0f50('0x34')]=_0x1700a0[_0x0f50('0x34')][_0x0f50('0x36')]?_0x1700a0[_0x0f50('0x34')]:_0x49240c['model'];if(_0x1d17a9[_0x0f50('0x30')][_0x0f50('0x3e')]){_0x1700a0[_0x0f50('0x3f')]=[{'all':!![]}];}_0x1700a0=_[_0x0f50('0x3c')]({},_0x1700a0,_0x1d17a9[_0x0f50('0x3d')]);return db['CmCompany'][_0x0f50('0x44')](_0x1700a0)['then'](handleEntityNotFound(_0x355b05,null))['then'](respondWithResult(_0x355b05,null))['catch'](handleError(_0x355b05,null));};exports['create']=function(_0x598094,_0x255154){return db[_0x0f50('0x2e')][_0x0f50('0x45')](_0x598094['body'],{})[_0x0f50('0x28')](function(_0x38e937){var _0x5b272d=_0x598094[_0x0f50('0x46')][_0x0f50('0x47')]({'plain':!![]});if(!_0x5b272d)throw new Error(_0x0f50('0x48'));if(_0x5b272d[_0x0f50('0x49')]===_0x0f50('0x46')){var _0x5a2954=_0x38e937[_0x0f50('0x47')]({'plain':!![]});var _0x215c4c='Companies';return db[_0x0f50('0x4a')][_0x0f50('0x44')]({'where':{'name':_0x215c4c,'userProfileId':_0x5b272d[_0x0f50('0x4b')]},'raw':!![]})[_0x0f50('0x28')](function(_0x58ec2d){if(_0x58ec2d&&_0x58ec2d[_0x0f50('0x4c')]===0x0){return db[_0x0f50('0x4d')]['create']({'name':_0x5a2954[_0x0f50('0x2b')],'resourceId':_0x5a2954['id'],'type':_0x58ec2d['name'],'sectionId':_0x58ec2d['id']},{})[_0x0f50('0x28')](function(){return _0x38e937;});}else{return _0x38e937;}})[_0x0f50('0x41')](function(_0x1bdeec){logger['error'](_0x0f50('0x4e'),_0x1bdeec);throw _0x1bdeec;});}return _0x38e937;})['then'](respondWithResult(_0x255154,0xc9))[_0x0f50('0x41')](handleError(_0x255154,null));};exports[_0x0f50('0x4f')]=function(_0x41c138,_0xc32bc7){if(_0x41c138[_0x0f50('0x50')]['id']){delete _0x41c138['body']['id'];}return db[_0x0f50('0x2e')][_0x0f50('0x44')]({'where':{'id':_0x41c138[_0x0f50('0x42')]['id']}})[_0x0f50('0x28')](handleEntityNotFound(_0xc32bc7,null))[_0x0f50('0x28')](saveUpdates(_0x41c138['body'],null))[_0x0f50('0x28')](respondWithResult(_0xc32bc7,null))[_0x0f50('0x41')](handleError(_0xc32bc7,null));};exports['destroy']=function(_0x698c44,_0x2b98bf){return db[_0x0f50('0x2e')]['find']({'where':{'id':_0x698c44[_0x0f50('0x42')]['id']}})['then'](handleEntityNotFound(_0x2b98bf,null))[_0x0f50('0x28')](removeEntity(_0x2b98bf,null))[_0x0f50('0x41')](handleError(_0x2b98bf,null));};exports[_0x0f50('0x2f')]=function(_0x3ce213,_0x1f3f77){return db[_0x0f50('0x2e')][_0x0f50('0x2f')]()[_0x0f50('0x28')](respondWithResult(_0x1f3f77,null))[_0x0f50('0x41')](handleError(_0x1f3f77,null));};exports[_0x0f50('0x51')]=function(_0x3a4d5b,_0x4eb5f4,_0x12df09){return db[_0x0f50('0x52')]['find']({'where':{'id':_0x3a4d5b[_0x0f50('0x42')]['id']}})[_0x0f50('0x28')](handleEntityNotFound(_0x4eb5f4,null))[_0x0f50('0x28')](function(_0x21b78d){if(_0x21b78d){return _0x21b78d[_0x0f50('0x51')](_0x3a4d5b[_0x0f50('0x50')][_0x0f50('0x53')],_['omit'](_0x3a4d5b[_0x0f50('0x50')],[_0x0f50('0x53'),'id'])||{});}})[_0x0f50('0x28')](respondWithResult(_0x4eb5f4,null))[_0x0f50('0x41')](handleError(_0x4eb5f4,null));};exports[_0x0f50('0x54')]=function(_0x5919db,_0x2cffb4,_0x321657){var _0x12f456={};var _0x4d7b3d={};var _0x391509;var _0x1b8c9c;return db['CmCompany'][_0x0f50('0x55')]({'where':{'id':_0x5919db[_0x0f50('0x42')]['id']}})[_0x0f50('0x28')](handleEntityNotFound(_0x2cffb4,null))[_0x0f50('0x28')](function(_0x4fd8a3){if(_0x4fd8a3){_0x391509=_0x4fd8a3;_0x4d7b3d['model']=_[_0x0f50('0x31')](db[_0x0f50('0x52')][_0x0f50('0x43')]);_0x4d7b3d['query']=_['keys'](_0x5919db[_0x0f50('0x30')]);_0x4d7b3d[_0x0f50('0x32')]=_[_0x0f50('0x33')](_0x4d7b3d[_0x0f50('0x37')],_0x4d7b3d[_0x0f50('0x30')]);_0x12f456[_0x0f50('0x34')]=_[_0x0f50('0x33')](_0x4d7b3d[_0x0f50('0x37')],qs[_0x0f50('0x35')](_0x5919db['query'][_0x0f50('0x35')]));_0x12f456[_0x0f50('0x34')]=_0x12f456['attributes'][_0x0f50('0x36')]?_0x12f456['attributes']:_0x4d7b3d['model'];_0x12f456[_0x0f50('0x56')]=qs[_0x0f50('0x39')](_0x5919db[_0x0f50('0x30')]['sort']);_0x12f456['where']=qs[_0x0f50('0x32')](_[_0x0f50('0x57')](_0x5919db[_0x0f50('0x30')],_0x4d7b3d[_0x0f50('0x32')]));if(_0x5919db[_0x0f50('0x30')][_0x0f50('0x3b')]){_0x12f456[_0x0f50('0x3a')]=_['merge'](_0x12f456[_0x0f50('0x3a')],{'$or':_['map'](_0x12f456[_0x0f50('0x34')],function(_0x77ef3d){var _0x530621={};_0x530621[_0x77ef3d]={'$like':'%'+_0x5919db[_0x0f50('0x30')][_0x0f50('0x3b')]+'%'};return _0x530621;})});}_0x12f456=_[_0x0f50('0x3c')]({},_0x12f456,_0x5919db[_0x0f50('0x3d')]);return _0x391509[_0x0f50('0x54')](_0x12f456);}})[_0x0f50('0x28')](function(_0xd0f206){if(_0xd0f206){_0x1b8c9c=_0xd0f206[_0x0f50('0x36')];if(!_0x5919db[_0x0f50('0x30')][_0x0f50('0x58')](_0x0f50('0x38'))){_0x12f456[_0x0f50('0x22')]=qs[_0x0f50('0x22')](_0x5919db[_0x0f50('0x30')][_0x0f50('0x22')]);_0x12f456[_0x0f50('0x1f')]=qs[_0x0f50('0x1f')](_0x5919db[_0x0f50('0x30')]['offset']);}return _0x391509[_0x0f50('0x54')](_0x12f456);}})[_0x0f50('0x28')](function(_0x5f2b30){if(_0x5f2b30){return _0x5f2b30?{'count':_0x1b8c9c,'rows':_0x5f2b30}:null;}})[_0x0f50('0x28')](respondWithResult(_0x2cffb4,null))[_0x0f50('0x41')](handleError(_0x2cffb4,null));};
\ No newline at end of file
+var _0xc67d=['offset','set','Content-Range','apply','reject','update','destroy','then','get','Companies','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','addContacts','CmContact','ids','omit','findOne','getContacts','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','limit','undefined','count'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xc67d,0x8a));var _0xdc67=function(_0x166fa7,_0x2dcd6d){_0x166fa7=_0x166fa7-0x0;var _0x4e7936=_0xc67d[_0x166fa7];return _0x4e7936;};'use strict';var emlformat=require(_0xdc67('0x0'));var rimraf=require(_0xdc67('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdc67('0x2'));var moment=require(_0xdc67('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdc67('0x4'));var util=require(_0xdc67('0x5'));var path=require(_0xdc67('0x6'));var sox=require(_0xdc67('0x7'));var csv=require('to-csv');var ejs=require(_0xdc67('0x8'));var fs=require('fs');var fs_extra=require(_0xdc67('0x9'));var _=require(_0xdc67('0xa'));var squel=require(_0xdc67('0xb'));var crypto=require(_0xdc67('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdc67('0xd'));var Papa=require(_0xdc67('0xe'));var Redis=require('ioredis');var authService=require(_0xdc67('0xf'));var qs=require(_0xdc67('0x10'));var as=require(_0xdc67('0x11'));var hardwareService=require(_0xdc67('0x12'));var logger=require(_0xdc67('0x13'))(_0xdc67('0x14'));var utils=require(_0xdc67('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdc67('0x16'));var db=require(_0xdc67('0x17'))['db'];function respondWithStatusCode(_0x2ed298,_0x5758b9){_0x5758b9=_0x5758b9||0xcc;return function(_0x18909b){if(_0x18909b){return _0x2ed298['sendStatus'](_0x5758b9);}return _0x2ed298['status'](_0x5758b9)[_0xdc67('0x18')]();};}function respondWithResult(_0x4d3a40,_0x529b09){_0x529b09=_0x529b09||0xc8;return function(_0x215412){if(_0x215412){return _0x4d3a40[_0xdc67('0x19')](_0x529b09)[_0xdc67('0x1a')](_0x215412);}};}function respondWithFilteredResult(_0x587581,_0x50e070){return function(_0x4a42fe){if(_0x4a42fe){var _0x17007f=typeof _0x50e070['offset']==='undefined'&&typeof _0x50e070[_0xdc67('0x1b')]===_0xdc67('0x1c');var _0x45896d=_0x4a42fe[_0xdc67('0x1d')];var _0x2e49cf=_0x17007f?0x0:_0x50e070[_0xdc67('0x1e')];var _0x5829fe=_0x17007f?_0x4a42fe[_0xdc67('0x1d')]:_0x50e070[_0xdc67('0x1e')]+_0x50e070['limit'];var _0x126905;if(_0x5829fe>=_0x45896d){_0x5829fe=_0x45896d;_0x126905=0xc8;}else{_0x126905=0xce;}_0x587581[_0xdc67('0x19')](_0x126905);return _0x587581[_0xdc67('0x1f')](_0xdc67('0x20'),_0x2e49cf+'-'+_0x5829fe+'/'+_0x45896d)['json'](_0x4a42fe);}return null;};}function patchUpdates(_0x278f40){return function(_0x1301a4){try{jsonpatch[_0xdc67('0x21')](_0x1301a4,_0x278f40,!![]);}catch(_0x10d632){return BPromise[_0xdc67('0x22')](_0x10d632);}return _0x1301a4['save']();};}function saveUpdates(_0x1f4265,_0xef164d){return function(_0x604358){if(_0x604358){return _0x604358[_0xdc67('0x23')](_0x1f4265)['then'](function(_0x1d60c4){return _0x1d60c4;});}return null;};}function removeEntity(_0x2e9841,_0x46cf15){return function(_0x1037e6){if(_0x1037e6){return _0x1037e6[_0xdc67('0x24')]()[_0xdc67('0x25')](function(){var _0x26432a=_0x1037e6[_0xdc67('0x26')]({'plain':!![]});var _0x3012cf=_0xdc67('0x27');return db['UserProfileResource'][_0xdc67('0x24')]({'where':{'type':_0x3012cf,'resourceId':_0x26432a['id']}})['then'](function(){return _0x1037e6;});})[_0xdc67('0x25')](function(){_0x2e9841[_0xdc67('0x19')](0xcc)[_0xdc67('0x18')]();});}};}function handleEntityNotFound(_0x15caab,_0x3b66d8){return function(_0x254509){if(!_0x254509){_0x15caab['sendStatus'](0x194);}return _0x254509;};}function handleError(_0x345635,_0x1441a4){_0x1441a4=_0x1441a4||0x1f4;return function(_0x2b306c){logger['error'](_0x2b306c[_0xdc67('0x28')]);if(_0x2b306c[_0xdc67('0x29')]){delete _0x2b306c['name'];}_0x345635[_0xdc67('0x19')](_0x1441a4)[_0xdc67('0x2a')](_0x2b306c);};}exports[_0xdc67('0x2b')]=function(_0x177d64,_0x4254c7){var _0x549631={},_0x4173d7={},_0x45ad92={'count':0x0,'rows':[]};return db[_0xdc67('0x2c')][_0xdc67('0x2d')]()[_0xdc67('0x25')](function(_0x5946a9){_0x4173d7[_0xdc67('0x2e')]=_[_0xdc67('0x2f')](_0x5946a9);_0x4173d7['query']=_[_0xdc67('0x2f')](_0x177d64[_0xdc67('0x30')]);_0x4173d7[_0xdc67('0x31')]=_[_0xdc67('0x32')](_0x4173d7[_0xdc67('0x2e')],_0x4173d7[_0xdc67('0x30')]);_0x549631[_0xdc67('0x33')]=_[_0xdc67('0x32')](_0x4173d7[_0xdc67('0x2e')],qs['fields'](_0x177d64[_0xdc67('0x30')][_0xdc67('0x34')]));_0x549631[_0xdc67('0x33')]=_0x549631[_0xdc67('0x33')]['length']?_0x549631[_0xdc67('0x33')]:_0x4173d7[_0xdc67('0x2e')];if(!_0x177d64[_0xdc67('0x30')][_0xdc67('0x35')](_0xdc67('0x36'))){_0x549631['limit']=qs[_0xdc67('0x1b')](_0x177d64['query'][_0xdc67('0x1b')]);_0x549631[_0xdc67('0x1e')]=qs['offset'](_0x177d64[_0xdc67('0x30')][_0xdc67('0x1e')]);}_0x549631[_0xdc67('0x37')]=qs['sort'](_0x177d64[_0xdc67('0x30')][_0xdc67('0x38')]);_0x549631['where']=qs[_0xdc67('0x31')](_[_0xdc67('0x39')](_0x177d64[_0xdc67('0x30')],_0x4173d7['filters']),_0x5946a9);if(_0x177d64[_0xdc67('0x30')][_0xdc67('0x3a')]){_0x549631[_0xdc67('0x3b')]=_[_0xdc67('0x3c')](_0x549631[_0xdc67('0x3b')],{'$or':_['map'](_0x549631['attributes'],function(_0x3f1b8d){var _0x1daf00={};_0x1daf00[_0x3f1b8d]={'$like':'%'+_0x177d64[_0xdc67('0x30')]['filter']+'%'};return _0x1daf00;})});}_0x549631=_[_0xdc67('0x3c')]({},_0x549631,_0x177d64['options']);var _0x3b00dd={'where':_0x549631[_0xdc67('0x3b')]};return db[_0xdc67('0x2c')][_0xdc67('0x1d')](_0x3b00dd)[_0xdc67('0x25')](function(_0x5829b7){_0x45ad92['count']=_0x5829b7;if(_0x177d64[_0xdc67('0x30')][_0xdc67('0x3d')]){_0x549631[_0xdc67('0x3e')]=[{'all':!![]}];}return db['CmCompany'][_0xdc67('0x3f')](_0x549631);})[_0xdc67('0x25')](function(_0x505f1d){_0x45ad92[_0xdc67('0x40')]=_0x505f1d;return _0x45ad92;})[_0xdc67('0x25')](respondWithFilteredResult(_0x4254c7,_0x549631))[_0xdc67('0x41')](handleError(_0x4254c7,null));})[_0xdc67('0x41')](handleError(_0x4254c7,null));};exports[_0xdc67('0x42')]=function(_0x5968d3,_0x4617ea){var _0x19aa8b={'raw':![],'where':{'id':_0x5968d3[_0xdc67('0x43')]['id']}},_0x455615={};_0x455615[_0xdc67('0x2e')]=_[_0xdc67('0x2f')](db[_0xdc67('0x2c')]['rawAttributes']);_0x455615[_0xdc67('0x30')]=_[_0xdc67('0x2f')](_0x5968d3['query']);_0x455615['filters']=_[_0xdc67('0x32')](_0x455615[_0xdc67('0x2e')],_0x455615[_0xdc67('0x30')]);_0x19aa8b[_0xdc67('0x33')]=_[_0xdc67('0x32')](_0x455615[_0xdc67('0x2e')],qs['fields'](_0x5968d3[_0xdc67('0x30')][_0xdc67('0x34')]));_0x19aa8b[_0xdc67('0x33')]=_0x19aa8b['attributes'][_0xdc67('0x44')]?_0x19aa8b[_0xdc67('0x33')]:_0x455615[_0xdc67('0x2e')];if(_0x5968d3[_0xdc67('0x30')]['includeAll']){_0x19aa8b['include']=[{'all':!![]}];}_0x19aa8b=_[_0xdc67('0x3c')]({},_0x19aa8b,_0x5968d3[_0xdc67('0x45')]);return db[_0xdc67('0x2c')][_0xdc67('0x46')](_0x19aa8b)[_0xdc67('0x25')](handleEntityNotFound(_0x4617ea,null))[_0xdc67('0x25')](respondWithResult(_0x4617ea,null))['catch'](handleError(_0x4617ea,null));};exports[_0xdc67('0x47')]=function(_0x44d104,_0x4f9a41){return db[_0xdc67('0x2c')]['create'](_0x44d104[_0xdc67('0x48')],{})[_0xdc67('0x25')](function(_0x37cf12){var _0x48e9bd=_0x44d104['user'][_0xdc67('0x26')]({'plain':!![]});if(!_0x48e9bd)throw new Error(_0xdc67('0x49'));if(_0x48e9bd[_0xdc67('0x4a')]==='user'){var _0x29cdd3=_0x37cf12[_0xdc67('0x26')]({'plain':!![]});var _0x30131c=_0xdc67('0x27');return db['UserProfileSection'][_0xdc67('0x46')]({'where':{'name':_0x30131c,'userProfileId':_0x48e9bd[_0xdc67('0x4b')]},'raw':!![]})[_0xdc67('0x25')](function(_0x2362b0){if(_0x2362b0&&_0x2362b0[_0xdc67('0x4c')]===0x0){return db[_0xdc67('0x4d')][_0xdc67('0x47')]({'name':_0x29cdd3[_0xdc67('0x29')],'resourceId':_0x29cdd3['id'],'type':_0x2362b0[_0xdc67('0x29')],'sectionId':_0x2362b0['id']},{})[_0xdc67('0x25')](function(){return _0x37cf12;});}else{return _0x37cf12;}})[_0xdc67('0x41')](function(_0x3b37cf){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b37cf);throw _0x3b37cf;});}return _0x37cf12;})[_0xdc67('0x25')](respondWithResult(_0x4f9a41,0xc9))[_0xdc67('0x41')](handleError(_0x4f9a41,null));};exports[_0xdc67('0x23')]=function(_0x1a5b56,_0x1eeac4){if(_0x1a5b56['body']['id']){delete _0x1a5b56['body']['id'];}return db['CmCompany'][_0xdc67('0x46')]({'where':{'id':_0x1a5b56[_0xdc67('0x43')]['id']}})[_0xdc67('0x25')](handleEntityNotFound(_0x1eeac4,null))['then'](saveUpdates(_0x1a5b56['body'],null))[_0xdc67('0x25')](respondWithResult(_0x1eeac4,null))[_0xdc67('0x41')](handleError(_0x1eeac4,null));};exports[_0xdc67('0x24')]=function(_0x368a13,_0x4fed80){return db[_0xdc67('0x2c')][_0xdc67('0x46')]({'where':{'id':_0x368a13['params']['id']}})[_0xdc67('0x25')](handleEntityNotFound(_0x4fed80,null))[_0xdc67('0x25')](removeEntity(_0x4fed80,null))[_0xdc67('0x41')](handleError(_0x4fed80,null));};exports['describe']=function(_0x1b1ca2,_0x3e41a6){return db[_0xdc67('0x2c')]['describe']()[_0xdc67('0x25')](respondWithResult(_0x3e41a6,null))[_0xdc67('0x41')](handleError(_0x3e41a6,null));};exports[_0xdc67('0x4e')]=function(_0x100fc9,_0x41eff4,_0x384863){return db[_0xdc67('0x4f')][_0xdc67('0x46')]({'where':{'id':_0x100fc9[_0xdc67('0x43')]['id']}})[_0xdc67('0x25')](handleEntityNotFound(_0x41eff4,null))['then'](function(_0x1007e3){if(_0x1007e3){return _0x1007e3[_0xdc67('0x4e')](_0x100fc9[_0xdc67('0x48')][_0xdc67('0x50')],_[_0xdc67('0x51')](_0x100fc9['body'],[_0xdc67('0x50'),'id'])||{});}})[_0xdc67('0x25')](respondWithResult(_0x41eff4,null))[_0xdc67('0x41')](handleError(_0x41eff4,null));};exports['getContacts']=function(_0x3dd744,_0x1f7cca,_0x23c046){var _0x551722={};var _0x56d078={};var _0x54f949;var _0x437066;return db[_0xdc67('0x2c')][_0xdc67('0x52')]({'where':{'id':_0x3dd744[_0xdc67('0x43')]['id']}})[_0xdc67('0x25')](handleEntityNotFound(_0x1f7cca,null))[_0xdc67('0x25')](function(_0x269866){if(_0x269866){_0x54f949=_0x269866;_0x56d078[_0xdc67('0x2e')]=_['keys'](db[_0xdc67('0x4f')]['rawAttributes']);_0x56d078[_0xdc67('0x30')]=_[_0xdc67('0x2f')](_0x3dd744['query']);_0x56d078[_0xdc67('0x31')]=_[_0xdc67('0x32')](_0x56d078[_0xdc67('0x2e')],_0x56d078[_0xdc67('0x30')]);_0x551722[_0xdc67('0x33')]=_['intersection'](_0x56d078[_0xdc67('0x2e')],qs[_0xdc67('0x34')](_0x3dd744[_0xdc67('0x30')][_0xdc67('0x34')]));_0x551722[_0xdc67('0x33')]=_0x551722['attributes'][_0xdc67('0x44')]?_0x551722[_0xdc67('0x33')]:_0x56d078[_0xdc67('0x2e')];_0x551722[_0xdc67('0x37')]=qs[_0xdc67('0x38')](_0x3dd744[_0xdc67('0x30')][_0xdc67('0x38')]);_0x551722[_0xdc67('0x3b')]=qs[_0xdc67('0x31')](_[_0xdc67('0x39')](_0x3dd744['query'],_0x56d078[_0xdc67('0x31')]));if(_0x3dd744[_0xdc67('0x30')][_0xdc67('0x3a')]){_0x551722[_0xdc67('0x3b')]=_[_0xdc67('0x3c')](_0x551722[_0xdc67('0x3b')],{'$or':_['map'](_0x551722[_0xdc67('0x33')],function(_0x4d0cfa){var _0xf29d79={};_0xf29d79[_0x4d0cfa]={'$like':'%'+_0x3dd744[_0xdc67('0x30')][_0xdc67('0x3a')]+'%'};return _0xf29d79;})});}_0x551722=_[_0xdc67('0x3c')]({},_0x551722,_0x3dd744['options']);return _0x54f949[_0xdc67('0x53')](_0x551722);}})[_0xdc67('0x25')](function(_0x1ff1ee){if(_0x1ff1ee){_0x437066=_0x1ff1ee[_0xdc67('0x44')];if(!_0x3dd744[_0xdc67('0x30')]['hasOwnProperty'](_0xdc67('0x36'))){_0x551722[_0xdc67('0x1b')]=qs['limit'](_0x3dd744[_0xdc67('0x30')][_0xdc67('0x1b')]);_0x551722['offset']=qs[_0xdc67('0x1e')](_0x3dd744[_0xdc67('0x30')][_0xdc67('0x1e')]);}return _0x54f949[_0xdc67('0x53')](_0x551722);}})[_0xdc67('0x25')](function(_0x569b12){if(_0x569b12){return _0x569b12?{'count':_0x437066,'rows':_0x569b12}:null;}})[_0xdc67('0x25')](respondWithResult(_0x1f7cca,null))['catch'](handleError(_0x1f7cca,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index f69c0a6..8ed9081 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 _0x169d=['api','request-promise','path','./cmCompany.attributes','define','cm_companies','lodash','util','../../config/logger'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x169d,0x153));var _0xd169=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x169d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd169('0x0'));var util=require(_0xd169('0x1'));var logger=require(_0xd169('0x2'))(_0xd169('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd169('0x4'));var fs=require('fs');var path=require(_0xd169('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd169('0x6'));module['exports']=function(_0x4893e1,_0x2ff32f){return _0x4893e1[_0xd169('0x7')]('CmCompany',attributes,{'tableName':_0xd169('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcd8b=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./cmCompany.attributes','exports','define','cm_companies'];(function(_0x56ceab,_0x3943c0){var _0x2d54af=function(_0x2b6bdb){while(--_0x2b6bdb){_0x56ceab['push'](_0x56ceab['shift']());}};_0x2d54af(++_0x3943c0);}(_0xcd8b,0x1c8));var _0xbcd8=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xcd8b[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xbcd8('0x0'));var util=require(_0xbcd8('0x1'));var logger=require(_0xbcd8('0x2'))(_0xbcd8('0x3'));var moment=require(_0xbcd8('0x4'));var BPromise=require('bluebird');var rp=require(_0xbcd8('0x5'));var fs=require('fs');var path=require(_0xbcd8('0x6'));var rimraf=require(_0xbcd8('0x7'));var config=require('../../config/environment');var attributes=require(_0xbcd8('0x8'));module[_0xbcd8('0x9')]=function(_0x5523e2,_0x57628f){return _0x5523e2[_0xbcd8('0xa')]('CmCompany',attributes,{'tableName':_0xbcd8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index f4c4b93..6bc5db1 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 _0x8a7c=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','then','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x8a7c,0x1b5));var _0xc8a7=function(_0x279a1a,_0x238309){_0x279a1a=_0x279a1a-0x0;var _0x185456=_0x8a7c[_0x279a1a];return _0x185456;};'use strict';var _=require('lodash');var util=require(_0xc8a7('0x0'));var moment=require(_0xc8a7('0x1'));var BPromise=require(_0xc8a7('0x2'));var rs=require(_0xc8a7('0x3'));var fs=require('fs');var Redis=require(_0xc8a7('0x4'));var db=require(_0xc8a7('0x5'))['db'];var utils=require(_0xc8a7('0x6'));var logger=require('../../config/logger')(_0xc8a7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc8a7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4eb3ef,_0x25bcf8,_0x4780a1){return new BPromise(function(_0x27bcf8,_0x1e6f2b){return client['request'](_0x4eb3ef,_0x4780a1)[_0xc8a7('0x9')](function(_0x4f426d){logger[_0xc8a7('0xa')](_0xc8a7('0xb'),_0x25bcf8,'request\x20sent');logger['debug'](_0xc8a7('0xc'),_0x25bcf8,_0xc8a7('0xd'),JSON[_0xc8a7('0xe')](_0x4f426d));if(_0x4f426d[_0xc8a7('0xf')]){if(_0x4f426d[_0xc8a7('0xf')][_0xc8a7('0x10')]===0x1f4){logger[_0xc8a7('0xf')]('CmCompany,\x20%s,\x20%s',_0x25bcf8,_0x4f426d['error'][_0xc8a7('0x11')]);return _0x1e6f2b(_0x4f426d[_0xc8a7('0xf')]['message']);}logger['error'](_0xc8a7('0xb'),_0x25bcf8,_0x4f426d['error'][_0xc8a7('0x11')]);return _0x27bcf8(_0x4f426d[_0xc8a7('0xf')]['message']);}else{logger[_0xc8a7('0xa')](_0xc8a7('0xb'),_0x25bcf8,_0xc8a7('0xd'));_0x27bcf8(_0x4f426d[_0xc8a7('0x12')][_0xc8a7('0x11')]);}})[_0xc8a7('0x13')](function(_0xe51850){logger[_0xc8a7('0xf')](_0xc8a7('0xb'),_0x25bcf8,_0xe51850);_0x1e6f2b(_0xe51850);});});}
\ No newline at end of file
+var _0xa678=['message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x222909,_0xff8168){var _0x39496c=function(_0x5cc3ee){while(--_0x5cc3ee){_0x222909['push'](_0x222909['shift']());}};_0x39496c(++_0xff8168);}(_0xa678,0x70));var _0x8a67=function(_0x5ccdd5,_0x29f34c){_0x5ccdd5=_0x5ccdd5-0x0;var _0x4eaeaf=_0xa678[_0x5ccdd5];return _0x4eaeaf;};'use strict';var _=require(_0x8a67('0x0'));var util=require(_0x8a67('0x1'));var moment=require(_0x8a67('0x2'));var BPromise=require(_0x8a67('0x3'));var rs=require(_0x8a67('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a67('0x5'))['db'];var utils=require(_0x8a67('0x6'));var logger=require(_0x8a67('0x7'))('rpc');var config=require(_0x8a67('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8a67('0x9')][_0x8a67('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a8f6e,_0x529509,_0x1d8c7b){return new BPromise(function(_0x48ac49,_0x2c2f7d){return client[_0x8a67('0xb')](_0x5a8f6e,_0x1d8c7b)['then'](function(_0x289fa1){logger[_0x8a67('0xc')](_0x8a67('0xd'),_0x529509,'request\x20sent');logger[_0x8a67('0xe')](_0x8a67('0xf'),_0x529509,_0x8a67('0x10'),JSON[_0x8a67('0x11')](_0x289fa1));if(_0x289fa1[_0x8a67('0x12')]){if(_0x289fa1[_0x8a67('0x12')][_0x8a67('0x13')]===0x1f4){logger['error'](_0x8a67('0xd'),_0x529509,_0x289fa1[_0x8a67('0x12')][_0x8a67('0x14')]);return _0x2c2f7d(_0x289fa1['error'][_0x8a67('0x14')]);}logger[_0x8a67('0x12')]('CmCompany,\x20%s,\x20%s',_0x529509,_0x289fa1[_0x8a67('0x12')]['message']);return _0x48ac49(_0x289fa1[_0x8a67('0x12')][_0x8a67('0x14')]);}else{logger[_0x8a67('0xc')](_0x8a67('0xd'),_0x529509,_0x8a67('0x10'));_0x48ac49(_0x289fa1['result']['message']);}})[_0x8a67('0x15')](function(_0x40fc2b){logger[_0x8a67('0x12')](_0x8a67('0xd'),_0x529509,_0x40fc2b);_0x2c2f7d(_0x40fc2b);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index c72a704..1ba243e 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 _0x1486=['index','/describe','describe','/:id','show','post','create','/:id/contacts','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated'];(function(_0x4f3484,_0x2a0968){var _0x612a71=function(_0x9099fd){while(--_0x9099fd){_0x4f3484['push'](_0x4f3484['shift']());}};_0x612a71(++_0x2a0968);}(_0x1486,0x160));var _0x6148=function(_0x28e757,_0x28d435){_0x28e757=_0x28e757-0x0;var _0x604fde=_0x1486[_0x28e757];return _0x604fde;};'use strict';var multer=require(_0x6148('0x0'));var util=require(_0x6148('0x1'));var path=require('path');var timeout=require(_0x6148('0x2'));var express=require(_0x6148('0x3'));var router=express['Router']();var fs_extra=require(_0x6148('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6148('0x5'));var controller=require('./cmCompany.controller');router[_0x6148('0x6')]('/',auth[_0x6148('0x7')](),controller[_0x6148('0x8')]);router[_0x6148('0x6')](_0x6148('0x9'),auth[_0x6148('0x7')](),controller[_0x6148('0xa')]);router[_0x6148('0x6')](_0x6148('0xb'),auth['isAuthenticated'](),controller[_0x6148('0xc')]);router[_0x6148('0x6')]('/:id/contacts',auth[_0x6148('0x7')](),controller['getContacts']);router[_0x6148('0xd')]('/',auth[_0x6148('0x7')](),controller[_0x6148('0xe')]);router['post'](_0x6148('0xf'),auth[_0x6148('0x7')](),controller['addContacts']);router['put'](_0x6148('0xb'),auth[_0x6148('0x7')](),controller[_0x6148('0x10')]);router[_0x6148('0x11')](_0x6148('0xb'),auth[_0x6148('0x7')](),controller[_0x6148('0x12')]);module[_0x6148('0x13')]=router;
\ No newline at end of file
+var _0x5f32=['describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5f32,0x12d));var _0x25f3=function(_0x401701,_0x149dce){_0x401701=_0x401701-0x0;var _0x3da178=_0x5f32[_0x401701];return _0x3da178;};'use strict';var multer=require('multer');var util=require(_0x25f3('0x0'));var path=require(_0x25f3('0x1'));var timeout=require(_0x25f3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x25f3('0x3'));var auth=require(_0x25f3('0x4'));var interaction=require(_0x25f3('0x5'));var config=require(_0x25f3('0x6'));var controller=require(_0x25f3('0x7'));router[_0x25f3('0x8')]('/',auth[_0x25f3('0x9')](),controller[_0x25f3('0xa')]);router[_0x25f3('0x8')]('/describe',auth[_0x25f3('0x9')](),controller[_0x25f3('0xb')]);router[_0x25f3('0x8')](_0x25f3('0xc'),auth[_0x25f3('0x9')](),controller[_0x25f3('0xd')]);router[_0x25f3('0x8')](_0x25f3('0xe'),auth['isAuthenticated'](),controller[_0x25f3('0xf')]);router[_0x25f3('0x10')]('/',auth[_0x25f3('0x9')](),controller[_0x25f3('0x11')]);router[_0x25f3('0x10')]('/:id/contacts',auth[_0x25f3('0x9')](),controller[_0x25f3('0x12')]);router[_0x25f3('0x13')](_0x25f3('0xc'),auth[_0x25f3('0x9')](),controller[_0x25f3('0x14')]);router[_0x25f3('0x15')](_0x25f3('0xc'),auth[_0x25f3('0x9')](),controller[_0x25f3('0x16')]);module[_0x25f3('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 0debdf6..7cf2fa4 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 _0x22a7=['sequelize','exports','STRING','TEXT','INTEGER','DATE','NOW'];(function(_0x1fdd8e,_0x29c639){var _0x5122ea=function(_0x4230da){while(--_0x4230da){_0x1fdd8e['push'](_0x1fdd8e['shift']());}};_0x5122ea(++_0x29c639);}(_0x22a7,0x16c));var _0x722a=function(_0x418473,_0x2f4ef1){_0x418473=_0x418473-0x0;var _0x3e85d4=_0x22a7[_0x418473];return _0x3e85d4;};'use strict';var _=require('lodash');var Sequelize=require(_0x722a('0x0'));module[_0x722a('0x1')]={'firstName':{'type':Sequelize[_0x722a('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x722a('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x722a('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x722a('0x2')]},'dateOfBirth':{'type':Sequelize[_0x722a('0x2')]},'description':{'type':Sequelize[_0x722a('0x3')]},'phone':{'type':Sequelize[_0x722a('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x722a('0x2')]},'email':{'type':Sequelize[_0x722a('0x2')]},'url':{'type':Sequelize[_0x722a('0x2')]},'facebook':{'type':Sequelize[_0x722a('0x2')]},'fb_data':{'type':Sequelize[_0x722a('0x2')]},'twitter':{'type':Sequelize[_0x722a('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x722a('0x2')]},'line':{'type':Sequelize[_0x722a('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x722a('0x2')]},'UserId':{'type':Sequelize[_0x722a('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x722a('0x2')]},'priority':{'type':Sequelize[_0x722a('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x722a('0x5')],'defaultValue':Sequelize[_0x722a('0x6')]},'dialTimezone':{'type':Sequelize[_0x722a('0x2')]},'utcOffset':{'type':Sequelize[_0x722a('0x4')]}};
\ No newline at end of file
+var _0x8de0=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x2ee20d,_0x354e70){var _0xade530=function(_0x1db7cc){while(--_0x1db7cc){_0x2ee20d['push'](_0x2ee20d['shift']());}};_0xade530(++_0x354e70);}(_0x8de0,0xcd));var _0x08de=function(_0x5603ac,_0x30ad93){_0x5603ac=_0x5603ac-0x0;var _0xe30eb8=_0x8de0[_0x5603ac];return _0xe30eb8;};'use strict';var _=require(_0x08de('0x0'));var Sequelize=require(_0x08de('0x1'));module[_0x08de('0x2')]={'firstName':{'type':Sequelize[_0x08de('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x08de('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x08de('0x3')]},'city':{'type':Sequelize[_0x08de('0x3')]},'country':{'type':Sequelize[_0x08de('0x3')]},'dateOfBirth':{'type':Sequelize[_0x08de('0x3')]},'description':{'type':Sequelize[_0x08de('0x4')]},'phone':{'type':Sequelize[_0x08de('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x08de('0x3')]},'email':{'type':Sequelize[_0x08de('0x3')]},'url':{'type':Sequelize[_0x08de('0x3')]},'facebook':{'type':Sequelize[_0x08de('0x3')]},'fb_data':{'type':Sequelize[_0x08de('0x3')]},'twitter':{'type':Sequelize[_0x08de('0x3')]},'skype':{'type':Sequelize[_0x08de('0x3')]},'teams':{'type':Sequelize[_0x08de('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x08de('0x3')]},'wechat':{'type':Sequelize[_0x08de('0x3')]},'telegram':{'type':Sequelize[_0x08de('0x3')]},'UserId':{'type':Sequelize[_0x08de('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x08de('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x08de('0x7')],'defaultValue':Sequelize[_0x08de('0x8')]},'dialTimezone':{'type':Sequelize[_0x08de('0x3')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 7038f5d..64a70ed 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 _0xe9ee=['moment','util','path','lodash','squel','papaparse','ioredis','../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','index','describe','findAll','query','user','catch','CmContact','find','params','tags','length','startsWith','displayName','CmCustomField','columnName','alias','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','ChatInteraction','ChatMessage','MailInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','create','isNil','dialTimezone','timezones','utcOffset','keys','additionalPhones','bulkCreate','each','duplicates','$or','push','where','findOrCreate','contact','all','Tag','color','Phones','ContactItemType','ItemType','sequelize','Phones.OrderBy','ListId','omit','map','format','cf_%d','pickBy','cf_','setFields','id\x20=\x20?','toParam','text','getTags','findOne','model','rawAttributes','intersection','attributes','fields','order','sort','filters','pick','filter','options','setTags','setAdditionalPhones','items','item_types','ItemTypeId','description','phone','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','literal','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','nolimit','ContactId','includeAll','include','rows','getHopperHistories','getHopperFinals','uploadCsv','No\x20ListId\x20specified','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','binding_keys','CompanyId','File\x20uploaded\x20correctly!','pid','send','createReadStream','parse','meta','import','User','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','fax','whatsapp','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','VoiceCallReport','findAndCountAll','startCase','Website','closed','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','deviceModel','osName','ratingMessage','ratingType','referer','subject','substatus','openchannel','externalUrl','threadId','Interaction','flatten','sortBy','reverse','value','slice'];(function(_0x261ae4,_0x3f10de){var _0x1790e0=function(_0x3ea9e4){while(--_0x3ea9e4){_0x261ae4['push'](_0x261ae4['shift']());}};_0x1790e0(++_0x3f10de);}(_0xe9ee,0x1f0));var _0xee9e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9ee[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xee9e('0x0'));var BPromise=require('bluebird');var util=require(_0xee9e('0x1'));var path=require(_0xee9e('0x2'));var fs=require('fs');var _=require(_0xee9e('0x3'));var squel=require(_0xee9e('0x4'));var Papa=require(_0xee9e('0x5'));var Redis=require(_0xee9e('0x6'));var contacts=require('../../components/contacts');var qs=require('../../components/parsers/qs');var logger=require(_0xee9e('0x7'))('api');var config=require(_0xee9e('0x8'));var shared=require(_0xee9e('0x9'));var db=require(_0xee9e('0xa'))['db'];config[_0xee9e('0xb')]=_[_0xee9e('0xc')](config[_0xee9e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xee9e('0xd'))(new Redis(config[_0xee9e('0xb')]));require(_0xee9e('0xe'))[_0xee9e('0xf')](socket);function respondWithResult(_0x503e9c,_0x5adebd){_0x5adebd=_0x5adebd||0xc8;return function(_0x2bb2e2){if(_0x2bb2e2){return _0x503e9c[_0xee9e('0x10')](_0x5adebd)[_0xee9e('0x11')](_0x2bb2e2);}};}function respondWithFilteredResult(_0x5aaf02,_0x559f94){return function(_0xd36ea0){if(_0xd36ea0){var _0x8ae8e0=typeof _0x559f94[_0xee9e('0x12')]===_0xee9e('0x13')&&typeof _0x559f94['limit']==='undefined';var _0x13b887=_0xd36ea0[_0xee9e('0x14')];var _0x572a3a=_0x8ae8e0?0x0:_0x559f94[_0xee9e('0x12')];var _0xee1eed=_0x8ae8e0?_0xd36ea0[_0xee9e('0x14')]:_0x559f94[_0xee9e('0x12')]+_0x559f94[_0xee9e('0x15')];var _0x269084;if(_0xee1eed>=_0x13b887){_0xee1eed=_0x13b887;_0x269084=0xc8;}else{_0x269084=0xce;}_0x5aaf02['status'](_0x269084);return _0x5aaf02[_0xee9e('0x16')](_0xee9e('0x17'),_0x572a3a+'-'+_0xee1eed+'/'+_0x13b887)[_0xee9e('0x11')](_0xd36ea0);}return null;};}function saveUpdates(_0x339cf8){return function(_0x1a4c8b){if(_0x1a4c8b){return _0x1a4c8b[_0xee9e('0x18')](_0x339cf8)[_0xee9e('0x19')](function(_0x123cf9){return _0x123cf9;});}return null;};}function removeEntity(_0x5508b5){return function(_0x59c96b){if(_0x59c96b){return _0x59c96b[_0xee9e('0x1a')]()[_0xee9e('0x19')](function(){_0x5508b5[_0xee9e('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e71f3){return function(_0x19aece){if(!_0x19aece){_0x2e71f3[_0xee9e('0x1b')](0x194);}return _0x19aece;};}function handleError(_0x2752cc,_0x40bbfa){_0x40bbfa=_0x40bbfa||0x1f4;return function(_0x4b43e2){logger[_0xee9e('0x1c')](_0x4b43e2[_0xee9e('0x1d')]);if(_0x4b43e2[_0xee9e('0x1e')]){delete _0x4b43e2['name'];}_0x2752cc[_0xee9e('0x10')](_0x40bbfa)['send'](_0x4b43e2);};}exports[_0xee9e('0x1f')]=function(_0x356a2c,_0x3613b){var _0x5f1366={};return contacts[_0xee9e('0x20')]()['then'](function(_0x3d7bed){_0x5f1366=qs['getOptions'](_0x3d7bed,_0x356a2c);return contacts[_0xee9e('0x21')](_0x356a2c[_0xee9e('0x22')],_0x356a2c[_0xee9e('0x23')],_0x5f1366,_0x3d7bed);})[_0xee9e('0x19')](respondWithFilteredResult(_0x3613b,_0x5f1366))[_0xee9e('0x24')](handleError(_0x3613b,null));};exports[_0xee9e('0x1a')]=function(_0x282ec5,_0x425162){return db[_0xee9e('0x25')][_0xee9e('0x26')]({'where':{'id':_0x282ec5[_0xee9e('0x27')]['id']}})[_0xee9e('0x19')](handleEntityNotFound(_0x425162,null))[_0xee9e('0x19')](removeEntity(_0x425162,null))['catch'](handleError(_0x425162,null));};exports[_0xee9e('0x20')]=function(_0x476049,_0x573878){return db[_0xee9e('0x25')]['describe']()['then'](function(_0x43f9c5){delete _0x43f9c5[_0xee9e('0x28')];for(var _0x342596=0x0;_0x342596
','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','generate','@xcally.com','name','substring','split','length','slice','join','Anonymous','pop','isEmpty','html','includes','\x20[Attachment:\x20','body','originTo','message','originCc','attachment','attachment-','%s-%s','now','root','server/files/attachments/'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0xf85e,0x16f));var _0xef85=function(_0x3f1c21,_0x6c4dd3){_0x3f1c21=_0x3f1c21-0x0;var _0x3ebc10=_0xf85e[_0x3f1c21];return _0x3ebc10;};'use strict';var _=require(_0xef85('0x0'));var moment=require(_0xef85('0x1'));var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require(_0xef85('0x2'));var tnef=require(_0xef85('0x3'));var logger=require(_0xef85('0x4'))(_0xef85('0x5'));var config=require(_0xef85('0x6'));function getAddress(_0x2bb8fd){var _0x2f1ecf=_[_0xef85('0x7')](_0x2bb8fd[_0xef85('0x8')]);return _0x2f1ecf&&_0x2f1ecf[_0xef85('0x9')]?_0x2f1ecf[_0xef85('0x9')]:'anonymous'+random[_0xef85('0xa')](0x6)+_0xef85('0xb');}function getFirstName(_0xcd8b4b){var _0x373fa8=_[_0xef85('0x7')](_0xcd8b4b[_0xef85('0x8')]);if(_0x373fa8&&_0x373fa8[_0xef85('0xc')]){if(_0x373fa8[_0xef85('0xc')]==_0x373fa8['address']){return _0x373fa8['name'][_0xef85('0xd')](0x0,_0x373fa8[_0xef85('0xc')]['indexOf']('@'));}var _0x47846c=_0x373fa8[_0xef85('0xc')][_0xef85('0xe')](/\s+/);return _0x47846c[_0xef85('0xf')]>0x1?_0x47846c[_0xef85('0x10')](0x0,-0x1)[_0xef85('0x11')]('\x20'):_0x373fa8[_0xef85('0xc')];}return _0xef85('0x12');}function getLastName(_0x154608){var _0x126a3a=_['head'](_0x154608[_0xef85('0x8')]);if(_0x126a3a&&_0x126a3a[_0xef85('0xc')]){var _0x30b119=_0x126a3a[_0xef85('0xc')][_0xef85('0xe')](/\s+/);return _0x30b119['length']>0x1?_0x30b119[_0xef85('0x13')]():'';}return'';}function getMails(_0x32f220,_0x5c7f69){var _0x20c30b='';for(var _0x42bd4e=0x0;_0x42bd4e<_0x5c7f69[_0xef85('0x8')]['length'];_0x42bd4e+=0x1){if(_0x5c7f69[_0xef85('0x8')][_0x42bd4e]['address']!==_0x32f220){if(!_[_0xef85('0x14')](_0x20c30b)){_0x20c30b+=',';}_0x20c30b+=_0x5c7f69['value'][_0x42bd4e][_0xef85('0xc')]||_0x5c7f69[_0xef85('0x8')][_0x42bd4e][_0xef85('0x9')]||'';_0x20c30b+='\x20<';_0x20c30b+=_0x5c7f69[_0xef85('0x8')][_0x42bd4e][_0xef85('0x9')]?_0x5c7f69[_0xef85('0x8')][_0x42bd4e][_0xef85('0x9')]:'anonymous'+random[_0xef85('0xa')](0x6)+_0xef85('0xb');_0x20c30b+='>';}}return _0x20c30b;}function parseEmail(_0x1050b8,_0x2a4654,_0x32990b){if(_0x2a4654['html']){var _0x571556=/