From: support
Date: Mon, 11 Jul 2022 15:58:12 +0000 (+0000)
Subject: Built motion from commit c020b446.|2.6.13
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22?a=commitdiff_plain;h=a6d19b8966af2127a8cc5df2ff44d66dfbf645e5;p=motion2.git
Built motion from commit c020b446.|2.6.13
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index c74a95d..44b43fa 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-11T15:35:31.789Z",
+ "time": "2022-07-11T15:48:38.324Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 91ae27b..c2e0b91 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-11T15:35:31.789Z",
+ "time": "2022-07-11T15:48:38.324Z",
"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 a453325..584201c 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 _0xf0c0=['action','STRING','contactManager','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)]','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','urlForward[body]','exports','getDataValue'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0xf0c0,0xee));var _0x0f0c=function(_0x444667,_0x5e25ae){_0x444667=_0x444667-0x0;var _0x4e321c=_0xf0c0[_0x444667];return _0x4e321c;};'use strict';var Sequelize=require('sequelize');module[_0x0f0c('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5abc7e){return this[_0x0f0c('0x1')](_0x0f0c('0x2'));}},'action':{'type':Sequelize[_0x0f0c('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x0f0c('0x4'),_0x0f0c('0x5'),_0x0f0c('0x6'),_0x0f0c('0x7'),_0x0f0c('0x8'),_0x0f0c('0x9'),_0x0f0c('0xa'),_0x0f0c('0xb')]],'msg':_0x0f0c('0xc')}},'comment':_0x0f0c('0xc')},'data1':{'type':Sequelize[_0x0f0c('0x3')](0x1000),'comment':_0x0f0c('0xd')},'data2':{'type':Sequelize[_0x0f0c('0x3')](0x1000),'comment':_0x0f0c('0xe')},'data3':{'type':Sequelize[_0x0f0c('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[_0x0f0c('0x3')](0x1000),'comments':_0x0f0c('0xf')},'data5':{'type':Sequelize[_0x0f0c('0x3')](0x1000),'comments':_0x0f0c('0x10')},'data6':{'type':Sequelize[_0x0f0c('0x3')],'comments':_0x0f0c('0x11')},'data7':{'type':Sequelize[_0x0f0c('0x12')],'comments':_0x0f0c('0x13')}};
\ No newline at end of file
+var _0x4e2e=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','jscripty','urlForward','browser','bot'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x4e2e,0x193));var _0xe4e2=function(_0x360e9d,_0x46da5f){_0x360e9d=_0x360e9d-0x0;var _0x5e712c=_0x4e2e[_0x360e9d];return _0x5e712c;};'use strict';var Sequelize=require(_0xe4e2('0x0'));module[_0xe4e2('0x1')]={'name':{'type':Sequelize[_0xe4e2('0x2')],'get':function(_0x3dfbbb){return this['getDataValue'](_0xe4e2('0x3'));}},'action':{'type':Sequelize[_0xe4e2('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xe4e2('0x5'),_0xe4e2('0x6'),'motionbar',_0xe4e2('0x7'),_0xe4e2('0x8'),_0xe4e2('0x9'),_0xe4e2('0xa'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xe4e2('0xb')},'data1':{'type':Sequelize[_0xe4e2('0x4')](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[_0xe4e2('0x4')](0x1000),'comment':_0xe4e2('0xc')},'data3':{'type':Sequelize[_0xe4e2('0x4')](0x1000),'comment':_0xe4e2('0xd')},'data4':{'type':Sequelize[_0xe4e2('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xe4e2('0x4')](0x1000),'comments':_0xe4e2('0xe')},'data6':{'type':Sequelize[_0xe4e2('0x4')],'comments':_0xe4e2('0xf')},'data7':{'type':Sequelize[_0xe4e2('0x10')],'comments':_0xe4e2('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 2795087..487384d 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 _0xaa72=['sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','json','offset','limit','undefined','count','status','set','reject','save','update','destroy','then','end','sendStatus','stack','name','send','body','find','catch','Action','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x4ff796,_0x2becbf){var _0x443675=function(_0x30c1e5){while(--_0x30c1e5){_0x4ff796['push'](_0x4ff796['shift']());}};_0x443675(++_0x2becbf);}(_0xaa72,0xfb));var _0x2aa7=function(_0xa4bc87,_0x51613c){_0xa4bc87=_0xa4bc87-0x0;var _0x4abdb3=_0xaa72[_0xa4bc87];return _0x4abdb3;};'use strict';var emlformat=require(_0x2aa7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2aa7('0x1'));var jsonpatch=require(_0x2aa7('0x2'));var rp=require(_0x2aa7('0x3'));var moment=require(_0x2aa7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2aa7('0x5'));var util=require(_0x2aa7('0x6'));var path=require('path');var sox=require(_0x2aa7('0x7'));var csv=require(_0x2aa7('0x8'));var ejs=require(_0x2aa7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2aa7('0xa'));var squel=require('squel');var crypto=require(_0x2aa7('0xb'));var jsforce=require(_0x2aa7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2aa7('0x8'));var querystring=require(_0x2aa7('0xd'));var Papa=require(_0x2aa7('0xe'));var Redis=require(_0x2aa7('0xf'));var authService=require(_0x2aa7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2aa7('0x11'));var hardwareService=require(_0x2aa7('0x12'));var logger=require(_0x2aa7('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x2aa7('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2aa7('0x15'))['db'];function respondWithStatusCode(_0x55b6ea,_0x29ceb8){_0x29ceb8=_0x29ceb8||0xcc;return function(_0x407303){if(_0x407303){return _0x55b6ea['sendStatus'](_0x29ceb8);}return _0x55b6ea['status'](_0x29ceb8)['end']();};}function respondWithResult(_0x33b983,_0x5c59d9){_0x5c59d9=_0x5c59d9||0xc8;return function(_0x41cd86){if(_0x41cd86){return _0x33b983['status'](_0x5c59d9)[_0x2aa7('0x16')](_0x41cd86);}};}function respondWithFilteredResult(_0xd6d063,_0x409fa6){return function(_0x48b074){if(_0x48b074){var _0x46ba76=typeof _0x409fa6[_0x2aa7('0x17')]==='undefined'&&typeof _0x409fa6[_0x2aa7('0x18')]===_0x2aa7('0x19');var _0x925211=_0x48b074[_0x2aa7('0x1a')];var _0x4cc172=_0x46ba76?0x0:_0x409fa6[_0x2aa7('0x17')];var _0x2ca136=_0x46ba76?_0x48b074[_0x2aa7('0x1a')]:_0x409fa6[_0x2aa7('0x17')]+_0x409fa6['limit'];var _0x2a3927;if(_0x2ca136>=_0x925211){_0x2ca136=_0x925211;_0x2a3927=0xc8;}else{_0x2a3927=0xce;}_0xd6d063[_0x2aa7('0x1b')](_0x2a3927);return _0xd6d063[_0x2aa7('0x1c')]('Content-Range',_0x4cc172+'-'+_0x2ca136+'/'+_0x925211)[_0x2aa7('0x16')](_0x48b074);}return null;};}function patchUpdates(_0xe3149a){return function(_0x35728e){try{jsonpatch['apply'](_0x35728e,_0xe3149a,!![]);}catch(_0x4aa47e){return BPromise[_0x2aa7('0x1d')](_0x4aa47e);}return _0x35728e[_0x2aa7('0x1e')]();};}function saveUpdates(_0xef1a58,_0xd9fd14){return function(_0xc8708b){if(_0xc8708b){return _0xc8708b[_0x2aa7('0x1f')](_0xef1a58)['then'](function(_0x25c4ec){return _0x25c4ec;});}return null;};}function removeEntity(_0x3a53,_0x568b38){return function(_0x7c9515){if(_0x7c9515){return _0x7c9515[_0x2aa7('0x20')]()[_0x2aa7('0x21')](function(){_0x3a53[_0x2aa7('0x1b')](0xcc)[_0x2aa7('0x22')]();});}};}function handleEntityNotFound(_0x5ba997,_0x410c7d){return function(_0x195a81){if(!_0x195a81){_0x5ba997[_0x2aa7('0x23')](0x194);}return _0x195a81;};}function handleError(_0x53042c,_0x2bc72b){_0x2bc72b=_0x2bc72b||0x1f4;return function(_0x3410a3){logger['error'](_0x3410a3[_0x2aa7('0x24')]);if(_0x3410a3[_0x2aa7('0x25')]){delete _0x3410a3[_0x2aa7('0x25')];}_0x53042c['status'](_0x2bc72b)[_0x2aa7('0x26')](_0x3410a3);};}exports['update']=function(_0x2d2ac6,_0x5c6a00){if(_0x2d2ac6[_0x2aa7('0x27')]['id']){delete _0x2d2ac6[_0x2aa7('0x27')]['id'];}return db['Action'][_0x2aa7('0x28')]({'where':{'id':_0x2d2ac6['params']['id']}})[_0x2aa7('0x21')](handleEntityNotFound(_0x5c6a00,null))['then'](saveUpdates(_0x2d2ac6[_0x2aa7('0x27')],null))[_0x2aa7('0x21')](respondWithResult(_0x5c6a00,null))[_0x2aa7('0x29')](handleError(_0x5c6a00,null));};exports[_0x2aa7('0x20')]=function(_0x3237b2,_0x4a858d){return db[_0x2aa7('0x2a')][_0x2aa7('0x28')]({'where':{'id':_0x3237b2['params']['id']}})[_0x2aa7('0x21')](handleEntityNotFound(_0x4a858d,null))[_0x2aa7('0x21')](removeEntity(_0x4a858d,null))[_0x2aa7('0x29')](handleError(_0x4a858d,null));};
\ No newline at end of file
+var _0xe2a3=['../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','name','send','body','find','params','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2411c8,_0x2420b0){var _0x52a5d6=function(_0x251f77){while(--_0x251f77){_0x2411c8['push'](_0x2411c8['shift']());}};_0x52a5d6(++_0x2420b0);}(_0xe2a3,0xcf));var _0x3e2a=function(_0x336d54,_0x4cb876){_0x336d54=_0x336d54-0x0;var _0x571a8d=_0xe2a3[_0x336d54];return _0x571a8d;};'use strict';var emlformat=require(_0x3e2a('0x0'));var rimraf=require(_0x3e2a('0x1'));var zipdir=require(_0x3e2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e2a('0x3'));var moment=require(_0x3e2a('0x4'));var BPromise=require(_0x3e2a('0x5'));var Mustache=require(_0x3e2a('0x6'));var util=require(_0x3e2a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3e2a('0x8'));var ejs=require(_0x3e2a('0x9'));var fs=require('fs');var fs_extra=require(_0x3e2a('0xa'));var _=require('lodash');var squel=require(_0x3e2a('0xb'));var crypto=require('crypto');var jsforce=require(_0x3e2a('0xc'));var deskjs=require(_0x3e2a('0xd'));var toCsv=require(_0x3e2a('0x8'));var querystring=require(_0x3e2a('0xe'));var Papa=require(_0x3e2a('0xf'));var Redis=require(_0x3e2a('0x10'));var authService=require(_0x3e2a('0x11'));var qs=require(_0x3e2a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e2a('0x13'));var logger=require('../../config/logger')(_0x3e2a('0x14'));var utils=require(_0x3e2a('0x15'));var config=require(_0x3e2a('0x16'));var licenseUtil=require(_0x3e2a('0x17'));var db=require(_0x3e2a('0x18'))['db'];function respondWithStatusCode(_0x3fdb2f,_0x6c53af){_0x6c53af=_0x6c53af||0xcc;return function(_0x2905ea){if(_0x2905ea){return _0x3fdb2f[_0x3e2a('0x19')](_0x6c53af);}return _0x3fdb2f[_0x3e2a('0x1a')](_0x6c53af)[_0x3e2a('0x1b')]();};}function respondWithResult(_0x951fd6,_0x467c6a){_0x467c6a=_0x467c6a||0xc8;return function(_0x2f08dd){if(_0x2f08dd){return _0x951fd6['status'](_0x467c6a)[_0x3e2a('0x1c')](_0x2f08dd);}};}function respondWithFilteredResult(_0x23529f,_0x3c6481){return function(_0x4d80f9){if(_0x4d80f9){var _0x32c457=typeof _0x3c6481['offset']==='undefined'&&typeof _0x3c6481[_0x3e2a('0x1d')]==='undefined';var _0x5bfbad=_0x4d80f9[_0x3e2a('0x1e')];var _0x5e1e39=_0x32c457?0x0:_0x3c6481[_0x3e2a('0x1f')];var _0x45a81c=_0x32c457?_0x4d80f9[_0x3e2a('0x1e')]:_0x3c6481[_0x3e2a('0x1f')]+_0x3c6481[_0x3e2a('0x1d')];var _0x11ea06;if(_0x45a81c>=_0x5bfbad){_0x45a81c=_0x5bfbad;_0x11ea06=0xc8;}else{_0x11ea06=0xce;}_0x23529f[_0x3e2a('0x1a')](_0x11ea06);return _0x23529f['set'](_0x3e2a('0x20'),_0x5e1e39+'-'+_0x45a81c+'/'+_0x5bfbad)[_0x3e2a('0x1c')](_0x4d80f9);}return null;};}function patchUpdates(_0x3e61ca){return function(_0x415184){try{jsonpatch[_0x3e2a('0x21')](_0x415184,_0x3e61ca,!![]);}catch(_0x1db91a){return BPromise['reject'](_0x1db91a);}return _0x415184[_0x3e2a('0x22')]();};}function saveUpdates(_0x5b1036,_0x5c8af2){return function(_0x37b3f8){if(_0x37b3f8){return _0x37b3f8[_0x3e2a('0x23')](_0x5b1036)[_0x3e2a('0x24')](function(_0x3d8307){return _0x3d8307;});}return null;};}function removeEntity(_0x75f86,_0x55a7a3){return function(_0x443df5){if(_0x443df5){return _0x443df5[_0x3e2a('0x25')]()[_0x3e2a('0x24')](function(){_0x75f86[_0x3e2a('0x1a')](0xcc)[_0x3e2a('0x1b')]();});}};}function handleEntityNotFound(_0x2115d8,_0x224ca5){return function(_0x178f3b){if(!_0x178f3b){_0x2115d8['sendStatus'](0x194);}return _0x178f3b;};}function handleError(_0x14dcd0,_0x37926d){_0x37926d=_0x37926d||0x1f4;return function(_0x4bb697){logger[_0x3e2a('0x26')](_0x4bb697['stack']);if(_0x4bb697[_0x3e2a('0x27')]){delete _0x4bb697['name'];}_0x14dcd0[_0x3e2a('0x1a')](_0x37926d)[_0x3e2a('0x28')](_0x4bb697);};}exports['update']=function(_0x72e1e4,_0x365ef6){if(_0x72e1e4[_0x3e2a('0x29')]['id']){delete _0x72e1e4[_0x3e2a('0x29')]['id'];}return db['Action'][_0x3e2a('0x2a')]({'where':{'id':_0x72e1e4[_0x3e2a('0x2b')]['id']}})[_0x3e2a('0x24')](handleEntityNotFound(_0x365ef6,null))[_0x3e2a('0x24')](saveUpdates(_0x72e1e4['body'],null))[_0x3e2a('0x24')](respondWithResult(_0x365ef6,null))[_0x3e2a('0x2c')](handleError(_0x365ef6,null));};exports[_0x3e2a('0x25')]=function(_0x541706,_0x304f23){return db['Action'][_0x3e2a('0x2a')]({'where':{'id':_0x541706[_0x3e2a('0x2b')]['id']}})[_0x3e2a('0x24')](handleEntityNotFound(_0x304f23,null))[_0x3e2a('0x24')](removeEntity(_0x304f23,null))[_0x3e2a('0x2c')](handleError(_0x304f23,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index fe2662e..b86e6c4 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 _0x0e90=['Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x43f85a,_0x138349){var _0x1d00ff=function(_0x54ca33){while(--_0x54ca33){_0x43f85a['push'](_0x43f85a['shift']());}};_0x1d00ff(++_0x138349);}(_0x0e90,0x176));var _0x00e9=function(_0xb74595,_0xbb6311){_0xb74595=_0xb74595-0x0;var _0x2c207d=_0x0e90[_0xb74595];return _0x2c207d;};'use strict';var _=require(_0x00e9('0x0'));var util=require(_0x00e9('0x1'));var logger=require(_0x00e9('0x2'))(_0x00e9('0x3'));var moment=require(_0x00e9('0x4'));var BPromise=require(_0x00e9('0x5'));var rp=require(_0x00e9('0x6'));var fs=require('fs');var path=require(_0x00e9('0x7'));var rimraf=require(_0x00e9('0x8'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0x00e9('0x9')]=function(_0x2d2847,_0xe4595f){return _0x2d2847['define'](_0x00e9('0xa'),attributes,{'tableName':_0x00e9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8188=['bluebird','rimraf','../../config/environment','./action.attributes','exports','tools_actions','lodash','moment'];(function(_0x53e93c,_0x178b88){var _0x5287e9=function(_0x3fb4a9){while(--_0x3fb4a9){_0x53e93c['push'](_0x53e93c['shift']());}};_0x5287e9(++_0x178b88);}(_0x8188,0x76));var _0x8818=function(_0x984bd4,_0x34cebf){_0x984bd4=_0x984bd4-0x0;var _0x511209=_0x8188[_0x984bd4];return _0x511209;};'use strict';var _=require(_0x8818('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8818('0x1'));var BPromise=require(_0x8818('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8818('0x3'));var config=require(_0x8818('0x4'));var attributes=require(_0x8818('0x5'));module[_0x8818('0x6')]=function(_0x1aa6fd,_0xee42fa){return _0x1aa6fd['define']('Action',attributes,{'tableName':_0x8818('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 55b97c8..a7aa60a 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 _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(_0x3b6dd0,_0x506087){var _0x3c9143=function(_0xf00c58){while(--_0xf00c58){_0x3b6dd0['push'](_0x3b6dd0['shift']());}};_0x3c9143(++_0x506087);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4b7b69,_0x3ab075){_0x4b7b69=_0x4b7b69-0x0;var _0x173b4c=_0x5fc3[_0x4b7b69];return _0x173b4c;};'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
+var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x4975,0x86));var _0x5497=function(_0x56f019,_0x1f6d1c){_0x56f019=_0x56f019-0x0;var _0x1f7360=_0x4975[_0x56f019];return _0x1f7360;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 0e21980..38c2b06 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 _0x93f1=['put','/:id','isAuthenticated','update','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0x47159c,_0x1c8216){var _0x454dbe=function(_0x2b54f7){while(--_0x2b54f7){_0x47159c['push'](_0x47159c['shift']());}};_0x454dbe(++_0x1c8216);}(_0x93f1,0x17e));var _0x193f=function(_0x103872,_0x110c3b){_0x103872=_0x103872-0x0;var _0x2ac4bb=_0x93f1[_0x103872];return _0x2ac4bb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x193f('0x0'));var express=require(_0x193f('0x1'));var router=express[_0x193f('0x2')]();var fs_extra=require(_0x193f('0x3'));var auth=require(_0x193f('0x4'));var interaction=require(_0x193f('0x5'));var config=require(_0x193f('0x6'));var controller=require(_0x193f('0x7'));router[_0x193f('0x8')](_0x193f('0x9'),auth[_0x193f('0xa')](),controller[_0x193f('0xb')]);router['delete'](_0x193f('0x9'),auth['isAuthenticated'](),controller[_0x193f('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0xeaff=['isAuthenticated','update','delete','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','put','/:id'];(function(_0x18aaee,_0x5a8edb){var _0x18610b=function(_0x33701b){while(--_0x33701b){_0x18aaee['push'](_0x18aaee['shift']());}};_0x18610b(++_0x5a8edb);}(_0xeaff,0x1bf));var _0xfeaf=function(_0xd4401f,_0x14b5aa){_0xd4401f=_0xd4401f-0x0;var _0x3ae46d=_0xeaff[_0xd4401f];return _0x3ae46d;};'use strict';var multer=require(_0xfeaf('0x0'));var util=require(_0xfeaf('0x1'));var path=require('path');var timeout=require(_0xfeaf('0x2'));var express=require(_0xfeaf('0x3'));var router=express[_0xfeaf('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfeaf('0x5'));var config=require(_0xfeaf('0x6'));var controller=require('./action.controller');router[_0xfeaf('0x7')](_0xfeaf('0x8'),auth[_0xfeaf('0x9')](),controller[_0xfeaf('0xa')]);router[_0xfeaf('0xb')](_0xfeaf('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index b20b52c..d044306 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1883=['exports','STRING','TEXT','sequelize'];(function(_0x4c4774,_0x38d7ea){var _0x3e181e=function(_0x1d39be){while(--_0x1d39be){_0x4c4774['push'](_0x4c4774['shift']());}};_0x3e181e(++_0x38d7ea);}(_0x1883,0xab));var _0x3188=function(_0x25af3a,_0x4b9989){_0x25af3a=_0x25af3a-0x0;var _0x1d012b=_0x1883[_0x25af3a];return _0x1d012b;};'use strict';var Sequelize=require(_0x3188('0x0'));module[_0x3188('0x1')]={'name':{'type':Sequelize[_0x3188('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3188('0x2')]},'parent':{'type':Sequelize[_0x3188('0x2')]},'table':{'type':Sequelize[_0x3188('0x2')]},'conditions':{'type':Sequelize[_0x3188('0x3')]},'joins':{'type':Sequelize[_0x3188('0x3')]}};
\ No newline at end of file
+var _0x207c=['STRING','TEXT','exports'];(function(_0x4e2510,_0x448f46){var _0x4aa6c0=function(_0x4a6483){while(--_0x4a6483){_0x4e2510['push'](_0x4e2510['shift']());}};_0x4aa6c0(++_0x448f46);}(_0x207c,0x1e8));var _0xc207=function(_0x4c5e74,_0x319d00){_0x4c5e74=_0x4c5e74-0x0;var _0x48b7f6=_0x207c[_0x4c5e74];return _0x48b7f6;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'name':{'type':Sequelize[_0xc207('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc207('0x1')]},'parent':{'type':Sequelize[_0xc207('0x1')]},'table':{'type':Sequelize[_0xc207('0x1')]},'conditions':{'type':Sequelize[_0xc207('0x2')]},'joins':{'type':Sequelize[_0xc207('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 0fb9a85..0fd3984 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 _0xbf06=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','value','ValidationErrorItem','AnalyticMetric','findAll','keyBy','from','table','MetricId','metric','field','function','replace','format','groupBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','join','COUNT(DISTINCT\x20%s)','AVG(%s)','operator','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','select','orderBy','parse','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','AnalyticExtractedReport','cdr','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','COUNT(*)','SELECT','QueryTypes','run','runReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','json','offset','undefined','count','limit','set','apply','save','update','then','get','CustomReports','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','params','intersection','find','create','body','user'];(function(_0x30319a,_0x2bd28c){var _0x5039a8=function(_0x15d91e){while(--_0x15d91e){_0x30319a['push'](_0x30319a['shift']());}};_0x5039a8(++_0x2bd28c);}(_0xbf06,0x101));var _0x6bf0=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xbf06[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6bf0('0x0'));var zipdir=require(_0x6bf0('0x1'));var jsonpatch=require(_0x6bf0('0x2'));var rp=require(_0x6bf0('0x3'));var moment=require(_0x6bf0('0x4'));var BPromise=require(_0x6bf0('0x5'));var Mustache=require(_0x6bf0('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6bf0('0x7'));var csv=require(_0x6bf0('0x8'));var ejs=require(_0x6bf0('0x9'));var fs=require('fs');var fs_extra=require(_0x6bf0('0xa'));var _=require('lodash');var squel=require(_0x6bf0('0xb'));var crypto=require(_0x6bf0('0xc'));var jsforce=require(_0x6bf0('0xd'));var deskjs=require(_0x6bf0('0xe'));var toCsv=require(_0x6bf0('0x8'));var querystring=require('querystring');var Papa=require(_0x6bf0('0xf'));var Redis=require(_0x6bf0('0x10'));var authService=require(_0x6bf0('0x11'));var qs=require(_0x6bf0('0x12'));var as=require(_0x6bf0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6bf0('0x14'));var utils=require(_0x6bf0('0x15'));var config=require(_0x6bf0('0x16'));var licenseUtil=require(_0x6bf0('0x17'));var db=require(_0x6bf0('0x18'))['db'];var dbH=require(_0x6bf0('0x18'))[_0x6bf0('0x19')];function respondWithStatusCode(_0xfdda14,_0x21c846){_0x21c846=_0x21c846||0xcc;return function(_0x5791d8){if(_0x5791d8){return _0xfdda14['sendStatus'](_0x21c846);}return _0xfdda14['status'](_0x21c846)['end']();};}function respondWithResult(_0x45560c,_0x65f659){_0x65f659=_0x65f659||0xc8;return function(_0x21511d){if(_0x21511d){return _0x45560c[_0x6bf0('0x1a')](_0x65f659)[_0x6bf0('0x1b')](_0x21511d);}};}function respondWithFilteredResult(_0x87ce78,_0x3d2781){return function(_0x56bc17){if(_0x56bc17){var _0xc5e763=typeof _0x3d2781[_0x6bf0('0x1c')]===_0x6bf0('0x1d')&&typeof _0x3d2781['limit']==='undefined';var _0x13c44c=_0x56bc17[_0x6bf0('0x1e')];var _0x22766b=_0xc5e763?0x0:_0x3d2781[_0x6bf0('0x1c')];var _0x1eb811=_0xc5e763?_0x56bc17[_0x6bf0('0x1e')]:_0x3d2781['offset']+_0x3d2781[_0x6bf0('0x1f')];var _0x1c4ed8;if(_0x1eb811>=_0x13c44c){_0x1eb811=_0x13c44c;_0x1c4ed8=0xc8;}else{_0x1c4ed8=0xce;}_0x87ce78['status'](_0x1c4ed8);return _0x87ce78[_0x6bf0('0x20')]('Content-Range',_0x22766b+'-'+_0x1eb811+'/'+_0x13c44c)[_0x6bf0('0x1b')](_0x56bc17);}return null;};}function patchUpdates(_0x2776e5){return function(_0x540ee9){try{jsonpatch[_0x6bf0('0x21')](_0x540ee9,_0x2776e5,!![]);}catch(_0x4767bd){return BPromise['reject'](_0x4767bd);}return _0x540ee9[_0x6bf0('0x22')]();};}function saveUpdates(_0x1c387b,_0x2254f2){return function(_0x59bf2f){if(_0x59bf2f){return _0x59bf2f[_0x6bf0('0x23')](_0x1c387b)[_0x6bf0('0x24')](function(_0xbab7f1){return _0xbab7f1;});}return null;};}function removeEntity(_0xe80796,_0x204bab){return function(_0x4eddba){if(_0x4eddba){return _0x4eddba['destroy']()['then'](function(){var _0x59b4be=_0x4eddba[_0x6bf0('0x25')]({'plain':!![]});var _0x19504e=_0x6bf0('0x26');return db[_0x6bf0('0x27')][_0x6bf0('0x28')]({'where':{'type':_0x19504e,'resourceId':_0x59b4be['id']}})[_0x6bf0('0x24')](function(){return _0x4eddba;});})['then'](function(){_0xe80796['status'](0xcc)[_0x6bf0('0x29')]();});}};}function handleEntityNotFound(_0x2434d8,_0x5cbb4e){return function(_0x220c3a){if(!_0x220c3a){_0x2434d8[_0x6bf0('0x2a')](0x194);}return _0x220c3a;};}function handleError(_0x159412,_0x21bba0){_0x21bba0=_0x21bba0||0x1f4;return function(_0x5195f8){logger[_0x6bf0('0x2b')](_0x5195f8[_0x6bf0('0x2c')]);if(_0x5195f8[_0x6bf0('0x2d')]){delete _0x5195f8[_0x6bf0('0x2d')];}_0x159412['status'](_0x21bba0)[_0x6bf0('0x2e')](_0x5195f8);};}exports['index']=function(_0x57cfdd,_0xc0f28b){var _0x291549={},_0x8aad7e={},_0x193aa4={'count':0x0,'rows':[]};var _0x6f55d2=_[_0x6bf0('0x2f')](db[_0x6bf0('0x30')][_0x6bf0('0x31')],function(_0x108541){return{'name':_0x108541[_0x6bf0('0x32')],'type':_0x108541[_0x6bf0('0x33')][_0x6bf0('0x34')]};});_0x8aad7e[_0x6bf0('0x35')]=_['map'](_0x6f55d2,_0x6bf0('0x2d'));_0x8aad7e[_0x6bf0('0x36')]=_[_0x6bf0('0x37')](_0x57cfdd[_0x6bf0('0x36')]);_0x8aad7e[_0x6bf0('0x38')]=_['intersection'](_0x8aad7e['model'],_0x8aad7e[_0x6bf0('0x36')]);_0x291549[_0x6bf0('0x39')]=_['intersection'](_0x8aad7e[_0x6bf0('0x35')],qs[_0x6bf0('0x3a')](_0x57cfdd['query'][_0x6bf0('0x3a')]));_0x291549[_0x6bf0('0x39')]=_0x291549['attributes'][_0x6bf0('0x3b')]?_0x291549['attributes']:_0x8aad7e['model'];if(!_0x57cfdd[_0x6bf0('0x36')][_0x6bf0('0x3c')](_0x6bf0('0x3d'))){_0x291549[_0x6bf0('0x1f')]=qs[_0x6bf0('0x1f')](_0x57cfdd[_0x6bf0('0x36')][_0x6bf0('0x1f')]);_0x291549[_0x6bf0('0x1c')]=qs[_0x6bf0('0x1c')](_0x57cfdd[_0x6bf0('0x36')]['offset']);}_0x291549[_0x6bf0('0x3e')]=qs['sort'](_0x57cfdd[_0x6bf0('0x36')][_0x6bf0('0x3f')]);_0x291549[_0x6bf0('0x40')]=qs['filters'](_[_0x6bf0('0x41')](_0x57cfdd[_0x6bf0('0x36')],_0x8aad7e['filters']),_0x6f55d2);if(_0x57cfdd[_0x6bf0('0x36')][_0x6bf0('0x42')]){_0x291549[_0x6bf0('0x40')]=_['merge'](_0x291549[_0x6bf0('0x40')],{'$or':_[_0x6bf0('0x2f')](_0x6f55d2,function(_0x22627b){if(_0x22627b[_0x6bf0('0x33')]!=='VIRTUAL'){var _0x1fa0e0={};_0x1fa0e0[_0x22627b[_0x6bf0('0x2d')]]={'$like':'%'+_0x57cfdd[_0x6bf0('0x36')][_0x6bf0('0x42')]+'%'};return _0x1fa0e0;}})});}_0x291549=_[_0x6bf0('0x43')]({},_0x291549,_0x57cfdd[_0x6bf0('0x44')]);var _0x245e52={'where':_0x291549[_0x6bf0('0x40')]};return db[_0x6bf0('0x30')][_0x6bf0('0x1e')](_0x245e52)[_0x6bf0('0x24')](function(_0x22e923){_0x193aa4['count']=_0x22e923;if(_0x57cfdd[_0x6bf0('0x36')][_0x6bf0('0x45')]){_0x291549[_0x6bf0('0x46')]=[{'all':!![]}];}return db[_0x6bf0('0x30')]['findAll'](_0x291549);})[_0x6bf0('0x24')](function(_0x3e9bab){_0x193aa4[_0x6bf0('0x47')]=_0x3e9bab;return _0x193aa4;})[_0x6bf0('0x24')](respondWithFilteredResult(_0xc0f28b,_0x291549))[_0x6bf0('0x48')](handleError(_0xc0f28b,null));};exports['show']=function(_0x6aaed5,_0x158723){var _0x1ea9eb={'raw':![],'where':{'id':_0x6aaed5[_0x6bf0('0x49')]['id']}},_0x259c88={};_0x259c88[_0x6bf0('0x35')]=_[_0x6bf0('0x37')](db[_0x6bf0('0x30')][_0x6bf0('0x31')]);_0x259c88[_0x6bf0('0x36')]=_[_0x6bf0('0x37')](_0x6aaed5[_0x6bf0('0x36')]);_0x259c88[_0x6bf0('0x38')]=_[_0x6bf0('0x4a')](_0x259c88[_0x6bf0('0x35')],_0x259c88[_0x6bf0('0x36')]);_0x1ea9eb[_0x6bf0('0x39')]=_[_0x6bf0('0x4a')](_0x259c88['model'],qs[_0x6bf0('0x3a')](_0x6aaed5[_0x6bf0('0x36')]['fields']));_0x1ea9eb[_0x6bf0('0x39')]=_0x1ea9eb[_0x6bf0('0x39')][_0x6bf0('0x3b')]?_0x1ea9eb['attributes']:_0x259c88[_0x6bf0('0x35')];if(_0x6aaed5[_0x6bf0('0x36')]['includeAll']){_0x1ea9eb[_0x6bf0('0x46')]=[{'all':!![]}];}_0x1ea9eb=_[_0x6bf0('0x43')]({},_0x1ea9eb,_0x6aaed5[_0x6bf0('0x44')]);return db[_0x6bf0('0x30')][_0x6bf0('0x4b')](_0x1ea9eb)[_0x6bf0('0x24')](handleEntityNotFound(_0x158723,null))['then'](respondWithResult(_0x158723,null))[_0x6bf0('0x48')](handleError(_0x158723,null));};exports[_0x6bf0('0x4c')]=function(_0x1e3925,_0x13963e){return db['AnalyticCustomReport'][_0x6bf0('0x4c')](_0x1e3925[_0x6bf0('0x4d')],{})[_0x6bf0('0x24')](function(_0x303157){var _0x1d390e=_0x1e3925[_0x6bf0('0x4e')]['get']({'plain':!![]});if(!_0x1d390e)throw new Error(_0x6bf0('0x4f'));if(_0x1d390e[_0x6bf0('0x50')]===_0x6bf0('0x4e')){var _0x28b4f3=_0x303157[_0x6bf0('0x25')]({'plain':!![]});var _0x3b4900=_0x6bf0('0x51');return db[_0x6bf0('0x52')][_0x6bf0('0x4b')]({'where':{'name':_0x3b4900,'userProfileId':_0x1d390e[_0x6bf0('0x53')]},'raw':!![]})[_0x6bf0('0x24')](function(_0x2894bd){if(_0x2894bd&&_0x2894bd[_0x6bf0('0x54')]===0x0){return db[_0x6bf0('0x27')][_0x6bf0('0x4c')]({'name':_0x28b4f3[_0x6bf0('0x2d')],'resourceId':_0x28b4f3['id'],'type':_0x6bf0('0x26'),'sectionId':_0x2894bd['id']},{})[_0x6bf0('0x24')](function(){return _0x303157;});}else{return _0x303157;}})[_0x6bf0('0x48')](function(_0x1ea07f){logger[_0x6bf0('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ea07f);throw _0x1ea07f;});}return _0x303157;})[_0x6bf0('0x24')](respondWithResult(_0x13963e,0xc9))[_0x6bf0('0x48')](handleError(_0x13963e,null));};exports[_0x6bf0('0x23')]=function(_0x400f3d,_0x3012a0){if(_0x400f3d['body']['id']){delete _0x400f3d[_0x6bf0('0x4d')]['id'];}return db[_0x6bf0('0x30')][_0x6bf0('0x4b')]({'where':{'id':_0x400f3d[_0x6bf0('0x49')]['id']}})[_0x6bf0('0x24')](handleEntityNotFound(_0x3012a0,null))[_0x6bf0('0x24')](saveUpdates(_0x400f3d['body'],null))['then'](respondWithResult(_0x3012a0,null))[_0x6bf0('0x48')](handleError(_0x3012a0,null));};exports[_0x6bf0('0x28')]=function(_0x29d083,_0x552469){return db[_0x6bf0('0x30')]['find']({'where':{'id':_0x29d083[_0x6bf0('0x49')]['id']}})[_0x6bf0('0x24')](handleEntityNotFound(_0x552469,null))[_0x6bf0('0x24')](removeEntity(_0x552469,null))[_0x6bf0('0x48')](handleError(_0x552469,null));};exports[_0x6bf0('0x55')]=function(_0x565d41,_0x19ad28){var _0x51c292=0xa;var _0x100b63=['join',_0x6bf0('0x56'),_0x6bf0('0x57'),_0x6bf0('0x58')];var _0x81d9af={'SUM':_0x6bf0('0x59'),'COUNT':_0x6bf0('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x6bf0('0x5b'),'MIN':_0x6bf0('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x6bf0('0x5d'),'GROUP_CONCAT ASC':_0x6bf0('0x5e'),'GROUP_CONCAT DESC':_0x6bf0('0x5f')};var _0x466be9={'SEC_TO_TIME':_0x6bf0('0x60'),'DATE':_0x6bf0('0x61'),'HOUR':_0x6bf0('0x62'),'ROUND':_0x6bf0('0x63'),'UNIX_TIMESTAMP':_0x6bf0('0x64')};var _0x395fb5=function(_0x19b351){return!_[_0x6bf0('0x65')]([_0x6bf0('0x66'),_0x6bf0('0x67'),_0x6bf0('0x68'),_0x6bf0('0x69')],_0x19b351);};var _0x1e4199=function(_0x537366){if(!_0x537366||!_0x537366[_0x6bf0('0x6a')][_0x6bf0('0x3b')]){return'';}for(var _0x28d046='(',_0x16189c=0x0;_0x16189c<_0x537366[_0x6bf0('0x6a')][_0x6bf0('0x3b')];_0x16189c+=0x1){_0x16189c>0x0&&(_0x28d046+='\x20'+_0x537366['operator']+'\x20');_0x28d046+=_0x537366[_0x6bf0('0x6a')][_0x16189c]['group']?_0x1e4199(_0x537366['rules'][_0x16189c][_0x6bf0('0x6b')]):_0x537366[_0x6bf0('0x6a')][_0x16189c]['field']+'\x20'+_0x537366['rules'][_0x16189c][_0x6bf0('0x6c')]+(_0x395fb5(_0x537366[_0x6bf0('0x6a')][_0x16189c][_0x6bf0('0x6c')])?'\x20'+_0x537366['rules'][_0x16189c][_0x6bf0('0x6d')]:'');}return _0x28d046+')';};var _0x5b5160={'where':{'id':_0x565d41[_0x6bf0('0x49')]['id']}},_0x1dbb09,_0xebf7cb,_0x360a42,_0x38e4f7,_0x3232b6;_0x5b5160=_[_0x6bf0('0x43')]({},_0x5b5160,_0x565d41['options']);return db[_0x6bf0('0x30')]['find'](_0x5b5160)[_0x6bf0('0x24')](function(_0x9245f2){if(_0x9245f2){_0x1dbb09=_0x9245f2;return _0x9245f2['getFields']();}return null;})[_0x6bf0('0x24')](function(_0x488940){if(_0x488940){if(!_0x488940[_0x6bf0('0x3b')]){throw new db['Sequelize'][(_0x6bf0('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xebf7cb=_0x488940;return db[_0x6bf0('0x6f')][_0x6bf0('0x70')]({'raw':!![]});}return null;})[_0x6bf0('0x24')](function(_0x3fd2d7){if(_0x3fd2d7){_0x360a42=_[_0x6bf0('0x71')](_0x3fd2d7,'id');var _0x5654ce;var _0x4148af=squel['select']();_0x4148af[_0x6bf0('0x72')](_0x1dbb09[_0x6bf0('0x73')]);for(var _0x1f5be8=0x0;_0x1f5be8<_0xebf7cb[_0x6bf0('0x3b')];_0x1f5be8+=0x1){_0x5654ce=_0xebf7cb[_0x1f5be8][_0x6bf0('0x74')]?_0x360a42[_0xebf7cb[_0x1f5be8][_0x6bf0('0x74')]][_0x6bf0('0x75')]:_0xebf7cb[_0x1f5be8][_0x6bf0('0x76')];_0x5654ce=_0xebf7cb[_0x1f5be8][_0x6bf0('0x77')]?_[_0x6bf0('0x78')](_0x81d9af[_0xebf7cb[_0x1f5be8][_0x6bf0('0x77')]],'%s',_0x5654ce):_0x5654ce;_0x5654ce=_0xebf7cb[_0x1f5be8]['format']?_[_0x6bf0('0x78')](_0x466be9[_0xebf7cb[_0x1f5be8][_0x6bf0('0x79')]],'%s',_0x5654ce):_0x5654ce;if(_0xebf7cb[_0x1f5be8][_0x6bf0('0x7a')]){_0x4148af[_0x6bf0('0x6b')](_0x5654ce);}_0xebf7cb[_0x1f5be8]['orderBy']&&_0x4148af['order'](_0x5654ce,_0xebf7cb[_0x1f5be8]['orderBy']===_0x6bf0('0x7b')?![]:!![]);_0x4148af[_0x6bf0('0x76')](_0x5654ce,_0xebf7cb[_0x1f5be8][_0x6bf0('0x7c')]||_0x5654ce);}if(_0x1dbb09[_0x6bf0('0x7d')]){_0x1dbb09[_0x6bf0('0x7d')]=JSON['parse'](_0x1dbb09[_0x6bf0('0x7d')]);for(var _0x250c3f=0x0;_0x250c3f<_0x1dbb09['joins'][_0x6bf0('0x3b')];_0x250c3f+=0x1){if(_0x1dbb09[_0x6bf0('0x7d')][_0x250c3f][_0x6bf0('0x33')]&&_['includes'](_0x100b63,_0x1dbb09['joins'][_0x250c3f][_0x6bf0('0x33')])&&_0x1dbb09[_0x6bf0('0x7d')][_0x250c3f][_0x6bf0('0x7e')]&&_0x1dbb09['joins'][_0x250c3f][_0x6bf0('0x7f')]&&_0x1dbb09[_0x6bf0('0x7d')][_0x250c3f]['foreignKey']){_0x4148af[_0x1dbb09[_0x6bf0('0x7d')][_0x250c3f][_0x6bf0('0x33')]](_0x1dbb09['joins'][_0x250c3f][_0x6bf0('0x7f')],null,util['format'](_0x6bf0('0x80'),_0x1dbb09[_0x6bf0('0x73')],_0x1dbb09['joins'][_0x250c3f][_0x6bf0('0x7e')],_0x1dbb09[_0x6bf0('0x7d')][_0x250c3f][_0x6bf0('0x7f')],_0x1dbb09[_0x6bf0('0x7d')][_0x250c3f][_0x6bf0('0x81')]));}}}if(_0x1dbb09['conditions']){_0x1dbb09['conditions']=JSON['parse'](_0x1dbb09[_0x6bf0('0x82')]);_0x4148af['where'](_0x1e4199(_0x1dbb09[_0x6bf0('0x82')][_0x6bf0('0x6b')]));}_0x3232b6=_0x4148af[_0x6bf0('0x83')]();_0x4148af[_0x6bf0('0x1f')](_0x51c292);_0x4148af[_0x6bf0('0x1c')](0x0);logger[_0x6bf0('0x84')](_0x6bf0('0x85'),_0x4148af[_0x6bf0('0x86')]());return dbH['sequelize'][_0x6bf0('0x36')](_0x4148af[_0x6bf0('0x86')](),{'type':dbH[_0x6bf0('0x87')]['QueryTypes']['SELECT']});}})['then'](respondWithResult(_0x19ad28,null))[_0x6bf0('0x48')](handleError(_0x19ad28,null));};function runReport(_0x2effb1,_0xc4b1a0,_0x4e6df5){var _0x1bdcba=_0xc4b1a0['name'];var _0xc332d=0xa;var _0x2950c3=[_0x6bf0('0x88'),_0x6bf0('0x56'),_0x6bf0('0x57'),_0x6bf0('0x58')];var _0x2245f1={'SUM':_0x6bf0('0x59'),'COUNT':_0x6bf0('0x5a'),'COUNT DISTINCT':_0x6bf0('0x89'),'MAX':_0x6bf0('0x5b'),'MIN':_0x6bf0('0x5c'),'AVG':_0x6bf0('0x8a'),'GROUP_CONCAT':_0x6bf0('0x5d'),'GROUP_CONCAT ASC':_0x6bf0('0x5e'),'GROUP_CONCAT DESC':_0x6bf0('0x5f')};var _0x5c412b={'SEC_TO_TIME':_0x6bf0('0x60'),'DATE':_0x6bf0('0x61'),'HOUR':_0x6bf0('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x6bf0('0x64')};var _0x1210c0=function(_0x1e9493){return!_[_0x6bf0('0x65')]([_0x6bf0('0x66'),_0x6bf0('0x67'),_0x6bf0('0x68'),_0x6bf0('0x69')],_0x1e9493);};var _0x2688dd=function(_0xdcb447){if(!_0xdcb447||!_0xdcb447['rules'][_0x6bf0('0x3b')]){return'';}for(var _0x426bde='(',_0x17241a=0x0;_0x17241a<_0xdcb447[_0x6bf0('0x6a')][_0x6bf0('0x3b')];_0x17241a+=0x1){_0x17241a>0x0&&(_0x426bde+='\x20'+_0xdcb447[_0x6bf0('0x8b')]+'\x20');_0x426bde+=_0xdcb447[_0x6bf0('0x6a')][_0x17241a][_0x6bf0('0x6b')]?_0x2688dd(_0xdcb447[_0x6bf0('0x6a')][_0x17241a]['group']):_0xdcb447['rules'][_0x17241a][_0x6bf0('0x76')]+'\x20'+_0xdcb447['rules'][_0x17241a][_0x6bf0('0x6c')]+(_0x1210c0(_0xdcb447['rules'][_0x17241a][_0x6bf0('0x6c')])?'\x20'+_0xdcb447['rules'][_0x17241a]['value']:'');}return _0x426bde+')';};var _0x1d8fe0={'where':{'id':_0x2effb1['id']}},_0x5d40c2,_0x5c4073,_0x1e7627,_0x156dad,_0x2cb73e;_0x1d8fe0=_[_0x6bf0('0x43')]({},_0x1d8fe0,_0x4e6df5);return db[_0x6bf0('0x30')][_0x6bf0('0x4b')](_0x1d8fe0)[_0x6bf0('0x24')](function(_0x46ea79){if(_0x46ea79){_0x5d40c2=_0x46ea79;return _0x46ea79[_0x6bf0('0x8c')]();}return null;})[_0x6bf0('0x24')](function(_0x1d13de){if(_0x1d13de){if(!_0x1d13de[_0x6bf0('0x3b')]){throw new db[(_0x6bf0('0x8d'))][(_0x6bf0('0x6e'))](_0x6bf0('0x8e'),0x193);}_0x5c4073=_0x1d13de;return db['AnalyticMetric'][_0x6bf0('0x70')]({'raw':!![]});}return null;})[_0x6bf0('0x24')](function(_0x44f3fc){if(_0x44f3fc){_0x1e7627=_['keyBy'](_0x44f3fc,'id');var _0x4d1e11;var _0x5a143c=squel[_0x6bf0('0x8f')]();_0x5a143c[_0x6bf0('0x72')](_0x5d40c2['table']);for(var _0x2e4736=0x0;_0x2e4736<_0x5c4073[_0x6bf0('0x3b')];_0x2e4736+=0x1){_0x4d1e11=_0x5c4073[_0x2e4736]['MetricId']?_0x1e7627[_0x5c4073[_0x2e4736][_0x6bf0('0x74')]][_0x6bf0('0x75')]:_0x5c4073[_0x2e4736][_0x6bf0('0x76')];_0x4d1e11=_0x5c4073[_0x2e4736]['function']?_[_0x6bf0('0x78')](_0x2245f1[_0x5c4073[_0x2e4736][_0x6bf0('0x77')]],'%s',_0x4d1e11):_0x4d1e11;_0x4d1e11=_0x5c4073[_0x2e4736][_0x6bf0('0x79')]?_[_0x6bf0('0x78')](_0x5c412b[_0x5c4073[_0x2e4736][_0x6bf0('0x79')]],'%s',_0x4d1e11):_0x4d1e11;if(_0x5c4073[_0x2e4736]['groupBy']){_0x5a143c[_0x6bf0('0x6b')](_0x4d1e11);}_0x5c4073[_0x2e4736][_0x6bf0('0x90')]&&_0x5a143c['order'](_0x4d1e11,_0x5c4073[_0x2e4736][_0x6bf0('0x90')]===_0x6bf0('0x7b')?![]:!![]);_0x5a143c[_0x6bf0('0x76')](_0x4d1e11,_0x5c4073[_0x2e4736][_0x6bf0('0x7c')]||_0x4d1e11);}if(_0x5d40c2[_0x6bf0('0x7d')]){_0x5d40c2['joins']=JSON[_0x6bf0('0x91')](_0x5d40c2[_0x6bf0('0x7d')]);for(var _0x126723=0x0;_0x126723<_0x5d40c2[_0x6bf0('0x7d')][_0x6bf0('0x3b')];_0x126723+=0x1){if(_0x5d40c2[_0x6bf0('0x7d')][_0x126723][_0x6bf0('0x33')]&&_[_0x6bf0('0x65')](_0x2950c3,_0x5d40c2[_0x6bf0('0x7d')][_0x126723][_0x6bf0('0x33')])&&_0x5d40c2['joins'][_0x126723][_0x6bf0('0x7e')]&&_0x5d40c2[_0x6bf0('0x7d')][_0x126723][_0x6bf0('0x7f')]&&_0x5d40c2[_0x6bf0('0x7d')][_0x126723][_0x6bf0('0x81')]){_0x5a143c[_0x5d40c2[_0x6bf0('0x7d')][_0x126723][_0x6bf0('0x33')]](_0x5d40c2['joins'][_0x126723][_0x6bf0('0x7f')],null,util[_0x6bf0('0x79')](_0x6bf0('0x80'),_0x5d40c2[_0x6bf0('0x73')],_0x5d40c2[_0x6bf0('0x7d')][_0x126723][_0x6bf0('0x7e')],_0x5d40c2[_0x6bf0('0x7d')][_0x126723]['foreignTable'],_0x5d40c2[_0x6bf0('0x7d')][_0x126723][_0x6bf0('0x81')]));}}}if(_0x5d40c2['conditions']){_0x5d40c2[_0x6bf0('0x82')]=JSON[_0x6bf0('0x91')](_0x5d40c2[_0x6bf0('0x82')]);_0x5a143c['where'](_0x2688dd(_0x5d40c2[_0x6bf0('0x82')][_0x6bf0('0x6b')]));}_0x2cb73e=_0x5a143c[_0x6bf0('0x83')]();_0x5a143c['limit'](_0xc332d);_0x5a143c[_0x6bf0('0x1c')](0x0);return;}})[_0x6bf0('0x24')](function(){if(_0xc4b1a0['output']===_0x6bf0('0x92')){return null;}var _0x2725cf=_[_0x6bf0('0x43')](_0xc4b1a0,{'name':_0xc4b1a0[_0x6bf0('0x93')]||_0xc4b1a0['name']||_0x5d40c2[_0x6bf0('0x2d')],'basename':_0x1bdcba,'savename':util[_0x6bf0('0x79')](_0x6bf0('0x94'),_0xc4b1a0[_0x6bf0('0x2d')]||_0x5d40c2[_0x6bf0('0x2d')],require(_0x6bf0('0x95'))[_0x6bf0('0x96')](0x4),_0xc4b1a0[_0x6bf0('0x97')]||_0x6bf0('0x98')),'reportId':_0x5d40c2['id'],'reportType':'custom'});return db[_0x6bf0('0x99')][_0x6bf0('0x4c')](_0x2725cf,{'raw':!![]});})[_0x6bf0('0x24')](function(_0x4ae5ec){if(_0x5d40c2[_0x6bf0('0x73')]===_0x6bf0('0x9a')){_0x2cb73e[_0x6bf0('0x40')](_0x5d40c2[_0x6bf0('0x73')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xc4b1a0['startDate'],_0xc4b1a0['endDate']);}else{_0x2cb73e[_0x6bf0('0x40')](_0x5d40c2['table']+_0x6bf0('0x9b'),_0xc4b1a0[_0x6bf0('0x9c')],_0xc4b1a0[_0x6bf0('0x9d')]);}if(_0x4ae5ec){logger['info'](_0x6bf0('0x9e'),_0x2cb73e[_0x6bf0('0x86')]());require(_0x6bf0('0x9f'))['fork'](path[_0x6bf0('0x88')](__dirname,_0x6bf0('0xa0'),_0x4ae5ec[_0x6bf0('0x97')]),[_0x4ae5ec['id'],_0x2cb73e[_0x6bf0('0x86')](),path[_0x6bf0('0x88')](__dirname,_0x6bf0('0xa1'),_0x4ae5ec[_0x6bf0('0xa2')]),_0x1bdcba]);return _0x4ae5ec;}else{var _0x247147=squel[_0x6bf0('0x8f')]();_0x247147['from']('('+_0x2cb73e['toString']()+')','countTable');_0x247147['field'](_0x6bf0('0xa3'),_0x6bf0('0x1e'));_0x2cb73e[_0x6bf0('0x1f')](_0xc4b1a0[_0x6bf0('0x1f')]||_0xc332d);_0x2cb73e[_0x6bf0('0x1c')](_0xc4b1a0['offset']||0x0);return dbH[_0x6bf0('0x87')][_0x6bf0('0x36')](_0x247147[_0x6bf0('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x6bf0('0xa4')]})[_0x6bf0('0x24')](function(_0x489b44){if(!_0x489b44[_0x6bf0('0x3b')]){_0x156dad=0x0;}else{_0x156dad=_0x489b44[0x0][_0x6bf0('0x1e')]||0x0;}return dbH[_0x6bf0('0x87')][_0x6bf0('0x36')](_0x2cb73e['toString'](),{'type':dbH[_0x6bf0('0x87')][_0x6bf0('0xa5')][_0x6bf0('0xa4')]});})['then'](function(_0x2b2716){return{'rows':_0x2b2716||[],'count':_0x156dad};});}});}exports[_0x6bf0('0xa6')]=function(_0x2178cf,_0x240b2){return runReport(_0x2178cf[_0x6bf0('0x49')],_0x2178cf['query'],_0x2178cf[_0x6bf0('0x44')])['then'](respondWithResult(_0x240b2,null))['catch'](handleError(_0x240b2,null));};exports[_0x6bf0('0xa7')]=runReport;exports[_0x6bf0('0x36')]=function(_0x399e7d,_0x1e3000){var _0x5b7d39=0xa;var _0x4186fb=[_0x6bf0('0x88'),'left_join','right_join',_0x6bf0('0x58')];var _0x4f9886={'SUM':_0x6bf0('0x59'),'COUNT':_0x6bf0('0x5a'),'COUNT DISTINCT':_0x6bf0('0x89'),'MAX':_0x6bf0('0x5b'),'MIN':_0x6bf0('0x5c'),'AVG':_0x6bf0('0x8a'),'GROUP_CONCAT':_0x6bf0('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4704db={'SEC_TO_TIME':_0x6bf0('0x60'),'DATE':_0x6bf0('0x61'),'HOUR':_0x6bf0('0x62'),'ROUND':_0x6bf0('0x63'),'UNIX_TIMESTAMP':_0x6bf0('0x64')};var _0x180fbc=function(_0x1fee38){return!_['includes']([_0x6bf0('0x66'),_0x6bf0('0x67'),'IS\x20EMPTY',_0x6bf0('0x69')],_0x1fee38);};var _0xc3fb2f=function(_0x314753){if(!_0x314753||!_0x314753[_0x6bf0('0x6a')][_0x6bf0('0x3b')]){return'';}for(var _0xfe5222='(',_0x1e0857=0x0;_0x1e0857<_0x314753['rules'][_0x6bf0('0x3b')];_0x1e0857+=0x1){_0x1e0857>0x0&&(_0xfe5222+='\x20'+_0x314753['operator']+'\x20');_0xfe5222+=_0x314753[_0x6bf0('0x6a')][_0x1e0857][_0x6bf0('0x6b')]?_0xc3fb2f(_0x314753['rules'][_0x1e0857][_0x6bf0('0x6b')]):_0x314753[_0x6bf0('0x6a')][_0x1e0857]['field']+'\x20'+_0x314753[_0x6bf0('0x6a')][_0x1e0857][_0x6bf0('0x6c')]+(_0x180fbc(_0x314753[_0x6bf0('0x6a')][_0x1e0857][_0x6bf0('0x6c')])?'\x20'+_0x314753['rules'][_0x1e0857]['value']:'');}return _0xfe5222+')';};var _0x234227={'where':{'id':_0x399e7d[_0x6bf0('0x49')]['id']}},_0x607b64,_0x39f766,_0x49bdfb,_0x1b392c,_0x5849c9;_0x234227=_[_0x6bf0('0x43')]({},_0x234227,_0x399e7d['options']);return db[_0x6bf0('0x30')][_0x6bf0('0x4b')](_0x234227)[_0x6bf0('0x24')](function(_0x405c18){if(_0x405c18){_0x607b64=_0x405c18;return _0x405c18[_0x6bf0('0x8c')]();}return null;})[_0x6bf0('0x24')](function(_0x56e7ef){if(_0x56e7ef){if(!_0x56e7ef[_0x6bf0('0x3b')]){throw new db[(_0x6bf0('0x8d'))]['ValidationErrorItem'](_0x6bf0('0x8e'),0x193);}_0x39f766=_0x56e7ef;return db[_0x6bf0('0x6f')][_0x6bf0('0x70')]({'raw':!![]});}return null;})['then'](function(_0x279a7f){if(_0x279a7f){_0x49bdfb=_[_0x6bf0('0x71')](_0x279a7f,'id');var _0x2d374d;var _0x557b99=squel[_0x6bf0('0x8f')]();_0x557b99['from'](_0x607b64[_0x6bf0('0x73')]);for(var _0x679790=0x0;_0x679790<_0x39f766['length'];_0x679790+=0x1){_0x2d374d=_0x39f766[_0x679790][_0x6bf0('0x74')]?_0x49bdfb[_0x39f766[_0x679790]['MetricId']][_0x6bf0('0x75')]:_0x39f766[_0x679790]['field'];_0x2d374d=_0x39f766[_0x679790]['function']?_[_0x6bf0('0x78')](_0x4f9886[_0x39f766[_0x679790]['function']],'%s',_0x2d374d):_0x2d374d;_0x2d374d=_0x39f766[_0x679790][_0x6bf0('0x79')]?_[_0x6bf0('0x78')](_0x4704db[_0x39f766[_0x679790][_0x6bf0('0x79')]],'%s',_0x2d374d):_0x2d374d;if(_0x39f766[_0x679790][_0x6bf0('0x7a')]){_0x557b99[_0x6bf0('0x6b')](_0x2d374d);}_0x39f766[_0x679790]['orderBy']&&_0x557b99[_0x6bf0('0x3e')](_0x2d374d,_0x39f766[_0x679790][_0x6bf0('0x90')]==='DESC'?![]:!![]);_0x557b99[_0x6bf0('0x76')](_0x2d374d,_0x39f766[_0x679790][_0x6bf0('0x7c')]||_0x2d374d);}if(_0x607b64[_0x6bf0('0x7d')]){_0x607b64['joins']=JSON['parse'](_0x607b64[_0x6bf0('0x7d')]);for(var _0x1fcc32=0x0;_0x1fcc32<_0x607b64[_0x6bf0('0x7d')]['length'];_0x1fcc32+=0x1){if(_0x607b64[_0x6bf0('0x7d')][_0x1fcc32][_0x6bf0('0x33')]&&_[_0x6bf0('0x65')](_0x4186fb,_0x607b64[_0x6bf0('0x7d')][_0x1fcc32][_0x6bf0('0x33')])&&_0x607b64[_0x6bf0('0x7d')][_0x1fcc32][_0x6bf0('0x7e')]&&_0x607b64[_0x6bf0('0x7d')][_0x1fcc32][_0x6bf0('0x7f')]&&_0x607b64[_0x6bf0('0x7d')][_0x1fcc32][_0x6bf0('0x81')]){_0x557b99[_0x607b64['joins'][_0x1fcc32]['type']](_0x607b64['joins'][_0x1fcc32][_0x6bf0('0x7f')],null,util[_0x6bf0('0x79')](_0x6bf0('0x80'),_0x607b64['table'],_0x607b64[_0x6bf0('0x7d')][_0x1fcc32][_0x6bf0('0x7e')],_0x607b64['joins'][_0x1fcc32]['foreignTable'],_0x607b64[_0x6bf0('0x7d')][_0x1fcc32][_0x6bf0('0x81')]));}}}if(_0x607b64[_0x6bf0('0x82')]){_0x607b64[_0x6bf0('0x82')]=JSON[_0x6bf0('0x91')](_0x607b64['conditions']);_0x557b99[_0x6bf0('0x40')](_0xc3fb2f(_0x607b64['conditions'][_0x6bf0('0x6b')]));}_0x5849c9=_0x557b99[_0x6bf0('0x83')]();_0x557b99[_0x6bf0('0x1f')](_0x5b7d39);_0x557b99[_0x6bf0('0x1c')](0x0);logger[_0x6bf0('0x84')](_0x6bf0('0x85'),_0x557b99[_0x6bf0('0x86')]());return dbH[_0x6bf0('0x87')]['query'](_0x557b99['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x6bf0('0xa4')]});}})[_0x6bf0('0x24')](function(){return{'sql':_0x5849c9[_0x6bf0('0x86')]()};})[_0x6bf0('0x24')](respondWithResult(_0x1e3000,null))['catch'](handleError(_0x1e3000,null));};
\ No newline at end of file
+var _0xaf31=['stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','merge','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','find','userProfileId','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','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)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','condition','value','getFields','AnalyticMetric','keyBy','select','table','MetricId','metric','field','function','format','replace','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','left_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','Sequelize','ValidationErrorItem','from','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','run','runReport','IS\x20NOT\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','count','Content-Range','save','update','then','destroy','get','UserProfileResource','error'];(function(_0x56a589,_0x641fc6){var _0x53c67c=function(_0x29bfe5){while(--_0x29bfe5){_0x56a589['push'](_0x56a589['shift']());}};_0x53c67c(++_0x641fc6);}(_0xaf31,0x1c1));var _0x1af3=function(_0x493f2e,_0x3491b4){_0x493f2e=_0x493f2e-0x0;var _0x4083ea=_0xaf31[_0x493f2e];return _0x4083ea;};'use strict';var emlformat=require(_0x1af3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1af3('0x1'));var jsonpatch=require(_0x1af3('0x2'));var rp=require(_0x1af3('0x3'));var moment=require(_0x1af3('0x4'));var BPromise=require(_0x1af3('0x5'));var Mustache=require(_0x1af3('0x6'));var util=require('util');var path=require(_0x1af3('0x7'));var sox=require(_0x1af3('0x8'));var csv=require(_0x1af3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1af3('0xa'));var _=require('lodash');var squel=require(_0x1af3('0xb'));var crypto=require(_0x1af3('0xc'));var jsforce=require(_0x1af3('0xd'));var deskjs=require(_0x1af3('0xe'));var toCsv=require(_0x1af3('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1af3('0xf'));var authService=require(_0x1af3('0x10'));var qs=require(_0x1af3('0x11'));var as=require(_0x1af3('0x12'));var hardwareService=require(_0x1af3('0x13'));var logger=require(_0x1af3('0x14'))(_0x1af3('0x15'));var utils=require(_0x1af3('0x16'));var config=require(_0x1af3('0x17'));var licenseUtil=require(_0x1af3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x1af3('0x19')];function respondWithStatusCode(_0x40273b,_0x1efa5a){_0x1efa5a=_0x1efa5a||0xcc;return function(_0x110b19){if(_0x110b19){return _0x40273b['sendStatus'](_0x1efa5a);}return _0x40273b[_0x1af3('0x1a')](_0x1efa5a)[_0x1af3('0x1b')]();};}function respondWithResult(_0x14b90c,_0x170888){_0x170888=_0x170888||0xc8;return function(_0x4f8c19){if(_0x4f8c19){return _0x14b90c[_0x1af3('0x1a')](_0x170888)[_0x1af3('0x1c')](_0x4f8c19);}};}function respondWithFilteredResult(_0x2e7563,_0x4584bd){return function(_0x3262c7){if(_0x3262c7){var _0x2e3d00=typeof _0x4584bd[_0x1af3('0x1d')]===_0x1af3('0x1e')&&typeof _0x4584bd['limit']===_0x1af3('0x1e');var _0x36f8e5=_0x3262c7[_0x1af3('0x1f')];var _0x21ec50=_0x2e3d00?0x0:_0x4584bd[_0x1af3('0x1d')];var _0x211f66=_0x2e3d00?_0x3262c7[_0x1af3('0x1f')]:_0x4584bd[_0x1af3('0x1d')]+_0x4584bd['limit'];var _0x341bf2;if(_0x211f66>=_0x36f8e5){_0x211f66=_0x36f8e5;_0x341bf2=0xc8;}else{_0x341bf2=0xce;}_0x2e7563['status'](_0x341bf2);return _0x2e7563['set'](_0x1af3('0x20'),_0x21ec50+'-'+_0x211f66+'/'+_0x36f8e5)[_0x1af3('0x1c')](_0x3262c7);}return null;};}function patchUpdates(_0x3c989f){return function(_0x1286f8){try{jsonpatch['apply'](_0x1286f8,_0x3c989f,!![]);}catch(_0x533085){return BPromise['reject'](_0x533085);}return _0x1286f8[_0x1af3('0x21')]();};}function saveUpdates(_0x4102f3,_0x4f9606){return function(_0x385223){if(_0x385223){return _0x385223[_0x1af3('0x22')](_0x4102f3)[_0x1af3('0x23')](function(_0x58d101){return _0x58d101;});}return null;};}function removeEntity(_0x4f14d8,_0x97c509){return function(_0x5aa499){if(_0x5aa499){return _0x5aa499[_0x1af3('0x24')]()['then'](function(){var _0x41b0ae=_0x5aa499[_0x1af3('0x25')]({'plain':!![]});var _0x38133c='CustomReports';return db[_0x1af3('0x26')]['destroy']({'where':{'type':_0x38133c,'resourceId':_0x41b0ae['id']}})[_0x1af3('0x23')](function(){return _0x5aa499;});})[_0x1af3('0x23')](function(){_0x4f14d8[_0x1af3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57115a,_0x1bed67){return function(_0x2fedb7){if(!_0x2fedb7){_0x57115a['sendStatus'](0x194);}return _0x2fedb7;};}function handleError(_0x5ddbeb,_0x13287d){_0x13287d=_0x13287d||0x1f4;return function(_0x5b32a3){logger[_0x1af3('0x27')](_0x5b32a3[_0x1af3('0x28')]);if(_0x5b32a3[_0x1af3('0x29')]){delete _0x5b32a3[_0x1af3('0x29')];}_0x5ddbeb[_0x1af3('0x1a')](_0x13287d)['send'](_0x5b32a3);};}exports[_0x1af3('0x2a')]=function(_0x462e88,_0x5aec1b){var _0x1133f6={},_0x4deeea={},_0x32ce31={'count':0x0,'rows':[]};var _0x4f3963=_[_0x1af3('0x2b')](db[_0x1af3('0x2c')][_0x1af3('0x2d')],function(_0x5b0a5c){return{'name':_0x5b0a5c[_0x1af3('0x2e')],'type':_0x5b0a5c[_0x1af3('0x2f')][_0x1af3('0x30')]};});_0x4deeea[_0x1af3('0x31')]=_[_0x1af3('0x2b')](_0x4f3963,_0x1af3('0x29'));_0x4deeea[_0x1af3('0x32')]=_[_0x1af3('0x33')](_0x462e88[_0x1af3('0x32')]);_0x4deeea[_0x1af3('0x34')]=_['intersection'](_0x4deeea[_0x1af3('0x31')],_0x4deeea[_0x1af3('0x32')]);_0x1133f6[_0x1af3('0x35')]=_[_0x1af3('0x36')](_0x4deeea[_0x1af3('0x31')],qs['fields'](_0x462e88[_0x1af3('0x32')][_0x1af3('0x37')]));_0x1133f6['attributes']=_0x1133f6[_0x1af3('0x35')]['length']?_0x1133f6[_0x1af3('0x35')]:_0x4deeea[_0x1af3('0x31')];if(!_0x462e88[_0x1af3('0x32')]['hasOwnProperty'](_0x1af3('0x38'))){_0x1133f6[_0x1af3('0x39')]=qs[_0x1af3('0x39')](_0x462e88[_0x1af3('0x32')][_0x1af3('0x39')]);_0x1133f6[_0x1af3('0x1d')]=qs[_0x1af3('0x1d')](_0x462e88[_0x1af3('0x32')][_0x1af3('0x1d')]);}_0x1133f6[_0x1af3('0x3a')]=qs[_0x1af3('0x3b')](_0x462e88['query'][_0x1af3('0x3b')]);_0x1133f6[_0x1af3('0x3c')]=qs[_0x1af3('0x34')](_[_0x1af3('0x3d')](_0x462e88[_0x1af3('0x32')],_0x4deeea['filters']),_0x4f3963);if(_0x462e88[_0x1af3('0x32')][_0x1af3('0x3e')]){_0x1133f6[_0x1af3('0x3c')]=_['merge'](_0x1133f6[_0x1af3('0x3c')],{'$or':_[_0x1af3('0x2b')](_0x4f3963,function(_0x4ed126){if(_0x4ed126[_0x1af3('0x2f')]!==_0x1af3('0x3f')){var _0x4981fa={};_0x4981fa[_0x4ed126[_0x1af3('0x29')]]={'$like':'%'+_0x462e88['query'][_0x1af3('0x3e')]+'%'};return _0x4981fa;}})});}_0x1133f6=_['merge']({},_0x1133f6,_0x462e88[_0x1af3('0x40')]);var _0xa3e4d8={'where':_0x1133f6[_0x1af3('0x3c')]};return db['AnalyticCustomReport']['count'](_0xa3e4d8)[_0x1af3('0x23')](function(_0x1a472f){_0x32ce31['count']=_0x1a472f;if(_0x462e88[_0x1af3('0x32')]['includeAll']){_0x1133f6[_0x1af3('0x41')]=[{'all':!![]}];}return db[_0x1af3('0x2c')][_0x1af3('0x42')](_0x1133f6);})[_0x1af3('0x23')](function(_0x193000){_0x32ce31[_0x1af3('0x43')]=_0x193000;return _0x32ce31;})[_0x1af3('0x23')](respondWithFilteredResult(_0x5aec1b,_0x1133f6))['catch'](handleError(_0x5aec1b,null));};exports[_0x1af3('0x44')]=function(_0x16a413,_0x30290b){var _0x31c169={'raw':![],'where':{'id':_0x16a413[_0x1af3('0x45')]['id']}},_0x1d698a={};_0x1d698a[_0x1af3('0x31')]=_['keys'](db['AnalyticCustomReport']['rawAttributes']);_0x1d698a[_0x1af3('0x32')]=_[_0x1af3('0x33')](_0x16a413[_0x1af3('0x32')]);_0x1d698a['filters']=_[_0x1af3('0x36')](_0x1d698a[_0x1af3('0x31')],_0x1d698a['query']);_0x31c169[_0x1af3('0x35')]=_[_0x1af3('0x36')](_0x1d698a[_0x1af3('0x31')],qs[_0x1af3('0x37')](_0x16a413[_0x1af3('0x32')][_0x1af3('0x37')]));_0x31c169['attributes']=_0x31c169[_0x1af3('0x35')][_0x1af3('0x46')]?_0x31c169[_0x1af3('0x35')]:_0x1d698a[_0x1af3('0x31')];if(_0x16a413[_0x1af3('0x32')][_0x1af3('0x47')]){_0x31c169[_0x1af3('0x41')]=[{'all':!![]}];}_0x31c169=_[_0x1af3('0x48')]({},_0x31c169,_0x16a413['options']);return db[_0x1af3('0x2c')]['find'](_0x31c169)[_0x1af3('0x23')](handleEntityNotFound(_0x30290b,null))[_0x1af3('0x23')](respondWithResult(_0x30290b,null))[_0x1af3('0x49')](handleError(_0x30290b,null));};exports['create']=function(_0x2b7453,_0x1a5900){return db[_0x1af3('0x2c')][_0x1af3('0x4a')](_0x2b7453['body'],{})[_0x1af3('0x23')](function(_0x69d0f5){var _0x1017a0=_0x2b7453[_0x1af3('0x4b')][_0x1af3('0x25')]({'plain':!![]});if(!_0x1017a0)throw new Error(_0x1af3('0x4c'));if(_0x1017a0['role']===_0x1af3('0x4b')){var _0x5c13e7=_0x69d0f5[_0x1af3('0x25')]({'plain':!![]});var _0x287469=_0x1af3('0x4d');return db['UserProfileSection'][_0x1af3('0x4e')]({'where':{'name':_0x287469,'userProfileId':_0x1017a0[_0x1af3('0x4f')]},'raw':!![]})[_0x1af3('0x23')](function(_0x5af47a){if(_0x5af47a&&_0x5af47a['autoAssociation']===0x0){return db[_0x1af3('0x26')][_0x1af3('0x4a')]({'name':_0x5c13e7[_0x1af3('0x29')],'resourceId':_0x5c13e7['id'],'type':_0x1af3('0x50'),'sectionId':_0x5af47a['id']},{})['then'](function(){return _0x69d0f5;});}else{return _0x69d0f5;}})['catch'](function(_0x2a1556){logger['error'](_0x1af3('0x51'),_0x2a1556);throw _0x2a1556;});}return _0x69d0f5;})[_0x1af3('0x23')](respondWithResult(_0x1a5900,0xc9))['catch'](handleError(_0x1a5900,null));};exports[_0x1af3('0x22')]=function(_0x27acfd,_0x3b8834){if(_0x27acfd[_0x1af3('0x52')]['id']){delete _0x27acfd[_0x1af3('0x52')]['id'];}return db[_0x1af3('0x2c')][_0x1af3('0x4e')]({'where':{'id':_0x27acfd[_0x1af3('0x45')]['id']}})[_0x1af3('0x23')](handleEntityNotFound(_0x3b8834,null))[_0x1af3('0x23')](saveUpdates(_0x27acfd[_0x1af3('0x52')],null))[_0x1af3('0x23')](respondWithResult(_0x3b8834,null))[_0x1af3('0x49')](handleError(_0x3b8834,null));};exports[_0x1af3('0x24')]=function(_0x529a3c,_0x63f9d2){return db['AnalyticCustomReport'][_0x1af3('0x4e')]({'where':{'id':_0x529a3c[_0x1af3('0x45')]['id']}})[_0x1af3('0x23')](handleEntityNotFound(_0x63f9d2,null))['then'](removeEntity(_0x63f9d2,null))[_0x1af3('0x49')](handleError(_0x63f9d2,null));};exports['preview']=function(_0x2eedb9,_0x2effe3){var _0x2c62fd=0xa;var _0x34371e=['join','left_join',_0x1af3('0x53'),_0x1af3('0x54')];var _0x21d539={'SUM':_0x1af3('0x55'),'COUNT':_0x1af3('0x56'),'COUNT DISTINCT':_0x1af3('0x57'),'MAX':_0x1af3('0x58'),'MIN':_0x1af3('0x59'),'AVG':_0x1af3('0x5a'),'GROUP_CONCAT':_0x1af3('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1d4fc0={'SEC_TO_TIME':_0x1af3('0x5c'),'DATE':_0x1af3('0x5d'),'HOUR':_0x1af3('0x5e'),'ROUND':_0x1af3('0x5f'),'UNIX_TIMESTAMP':_0x1af3('0x60')};var _0x3c00b6=function(_0x19ddb4){return!_[_0x1af3('0x61')]([_0x1af3('0x62'),_0x1af3('0x63'),_0x1af3('0x64'),'IS\x20NOT\x20EMPTY'],_0x19ddb4);};var _0x355f85=function(_0x1071fb){if(!_0x1071fb||!_0x1071fb[_0x1af3('0x65')][_0x1af3('0x46')]){return'';}for(var _0x190fc4='(',_0x5e0fb8=0x0;_0x5e0fb8<_0x1071fb[_0x1af3('0x65')][_0x1af3('0x46')];_0x5e0fb8+=0x1){_0x5e0fb8>0x0&&(_0x190fc4+='\x20'+_0x1071fb[_0x1af3('0x66')]+'\x20');_0x190fc4+=_0x1071fb[_0x1af3('0x65')][_0x5e0fb8][_0x1af3('0x67')]?_0x355f85(_0x1071fb[_0x1af3('0x65')][_0x5e0fb8][_0x1af3('0x67')]):_0x1071fb['rules'][_0x5e0fb8]['field']+'\x20'+_0x1071fb[_0x1af3('0x65')][_0x5e0fb8][_0x1af3('0x68')]+(_0x3c00b6(_0x1071fb[_0x1af3('0x65')][_0x5e0fb8]['condition'])?'\x20'+_0x1071fb[_0x1af3('0x65')][_0x5e0fb8][_0x1af3('0x69')]:'');}return _0x190fc4+')';};var _0x2349e5={'where':{'id':_0x2eedb9['params']['id']}},_0x5a3c74,_0x392086,_0x2aa459,_0x3ce971,_0x1161dc;_0x2349e5=_['merge']({},_0x2349e5,_0x2eedb9[_0x1af3('0x40')]);return db[_0x1af3('0x2c')]['find'](_0x2349e5)['then'](function(_0x55997a){if(_0x55997a){_0x5a3c74=_0x55997a;return _0x55997a[_0x1af3('0x6a')]();}return null;})[_0x1af3('0x23')](function(_0x10ab51){if(_0x10ab51){if(!_0x10ab51[_0x1af3('0x46')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x392086=_0x10ab51;return db[_0x1af3('0x6b')][_0x1af3('0x42')]({'raw':!![]});}return null;})[_0x1af3('0x23')](function(_0x5642f0){if(_0x5642f0){_0x2aa459=_[_0x1af3('0x6c')](_0x5642f0,'id');var _0x4d03ad;var _0x3b26c2=squel[_0x1af3('0x6d')]();_0x3b26c2['from'](_0x5a3c74[_0x1af3('0x6e')]);for(var _0x38f4a1=0x0;_0x38f4a1<_0x392086[_0x1af3('0x46')];_0x38f4a1+=0x1){_0x4d03ad=_0x392086[_0x38f4a1][_0x1af3('0x6f')]?_0x2aa459[_0x392086[_0x38f4a1][_0x1af3('0x6f')]][_0x1af3('0x70')]:_0x392086[_0x38f4a1][_0x1af3('0x71')];_0x4d03ad=_0x392086[_0x38f4a1][_0x1af3('0x72')]?_['replace'](_0x21d539[_0x392086[_0x38f4a1]['function']],'%s',_0x4d03ad):_0x4d03ad;_0x4d03ad=_0x392086[_0x38f4a1][_0x1af3('0x73')]?_[_0x1af3('0x74')](_0x1d4fc0[_0x392086[_0x38f4a1][_0x1af3('0x73')]],'%s',_0x4d03ad):_0x4d03ad;if(_0x392086[_0x38f4a1][_0x1af3('0x75')]){_0x3b26c2[_0x1af3('0x67')](_0x4d03ad);}_0x392086[_0x38f4a1][_0x1af3('0x76')]&&_0x3b26c2[_0x1af3('0x3a')](_0x4d03ad,_0x392086[_0x38f4a1]['orderBy']==='DESC'?![]:!![]);_0x3b26c2[_0x1af3('0x71')](_0x4d03ad,_0x392086[_0x38f4a1][_0x1af3('0x77')]||_0x4d03ad);}if(_0x5a3c74['joins']){_0x5a3c74[_0x1af3('0x78')]=JSON[_0x1af3('0x79')](_0x5a3c74[_0x1af3('0x78')]);for(var _0x345c31=0x0;_0x345c31<_0x5a3c74[_0x1af3('0x78')]['length'];_0x345c31+=0x1){if(_0x5a3c74[_0x1af3('0x78')][_0x345c31]['type']&&_[_0x1af3('0x61')](_0x34371e,_0x5a3c74['joins'][_0x345c31][_0x1af3('0x2f')])&&_0x5a3c74[_0x1af3('0x78')][_0x345c31][_0x1af3('0x7a')]&&_0x5a3c74['joins'][_0x345c31]['foreignTable']&&_0x5a3c74[_0x1af3('0x78')][_0x345c31]['foreignKey']){_0x3b26c2[_0x5a3c74[_0x1af3('0x78')][_0x345c31][_0x1af3('0x2f')]](_0x5a3c74[_0x1af3('0x78')][_0x345c31][_0x1af3('0x7b')],null,util[_0x1af3('0x73')](_0x1af3('0x7c'),_0x5a3c74[_0x1af3('0x6e')],_0x5a3c74[_0x1af3('0x78')][_0x345c31][_0x1af3('0x7a')],_0x5a3c74[_0x1af3('0x78')][_0x345c31][_0x1af3('0x7b')],_0x5a3c74[_0x1af3('0x78')][_0x345c31]['foreignKey']));}}}if(_0x5a3c74[_0x1af3('0x7d')]){_0x5a3c74['conditions']=JSON[_0x1af3('0x79')](_0x5a3c74[_0x1af3('0x7d')]);_0x3b26c2[_0x1af3('0x3c')](_0x355f85(_0x5a3c74['conditions'][_0x1af3('0x67')]));}_0x1161dc=_0x3b26c2[_0x1af3('0x7e')]();_0x3b26c2['limit'](_0x2c62fd);_0x3b26c2[_0x1af3('0x1d')](0x0);logger['debug'](_0x1af3('0x7f'),_0x3b26c2[_0x1af3('0x80')]());return dbH[_0x1af3('0x81')]['query'](_0x3b26c2[_0x1af3('0x80')](),{'type':dbH[_0x1af3('0x81')][_0x1af3('0x82')][_0x1af3('0x83')]});}})[_0x1af3('0x23')](respondWithResult(_0x2effe3,null))[_0x1af3('0x49')](handleError(_0x2effe3,null));};function runReport(_0x4d8d08,_0x29c85c,_0x4cf3ec){var _0x24a6c2=_0x29c85c[_0x1af3('0x29')];var _0x1e2b08=0xa;var _0x361b66=[_0x1af3('0x84'),_0x1af3('0x85'),_0x1af3('0x53'),'cross_join'];var _0xa08064={'SUM':_0x1af3('0x55'),'COUNT':_0x1af3('0x56'),'COUNT DISTINCT':_0x1af3('0x57'),'MAX':_0x1af3('0x58'),'MIN':_0x1af3('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1af3('0x86'),'GROUP_CONCAT DESC':_0x1af3('0x87')};var _0x5a12ec={'SEC_TO_TIME':_0x1af3('0x5c'),'DATE':_0x1af3('0x5d'),'HOUR':_0x1af3('0x5e'),'ROUND':_0x1af3('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x32fa01=function(_0x50348){return!_[_0x1af3('0x61')](['IS\x20NULL',_0x1af3('0x63'),_0x1af3('0x64'),'IS\x20NOT\x20EMPTY'],_0x50348);};var _0xfce05d=function(_0x1cfe80){if(!_0x1cfe80||!_0x1cfe80['rules'][_0x1af3('0x46')]){return'';}for(var _0x3e8f4b='(',_0x8e57f=0x0;_0x8e57f<_0x1cfe80['rules'][_0x1af3('0x46')];_0x8e57f+=0x1){_0x8e57f>0x0&&(_0x3e8f4b+='\x20'+_0x1cfe80[_0x1af3('0x66')]+'\x20');_0x3e8f4b+=_0x1cfe80[_0x1af3('0x65')][_0x8e57f][_0x1af3('0x67')]?_0xfce05d(_0x1cfe80[_0x1af3('0x65')][_0x8e57f]['group']):_0x1cfe80[_0x1af3('0x65')][_0x8e57f][_0x1af3('0x71')]+'\x20'+_0x1cfe80['rules'][_0x8e57f]['condition']+(_0x32fa01(_0x1cfe80[_0x1af3('0x65')][_0x8e57f]['condition'])?'\x20'+_0x1cfe80[_0x1af3('0x65')][_0x8e57f][_0x1af3('0x69')]:'');}return _0x3e8f4b+')';};var _0x33e018={'where':{'id':_0x4d8d08['id']}},_0x51336c,_0x48fd93,_0x299123,_0x4db220,_0x3feb3c;_0x33e018=_['merge']({},_0x33e018,_0x4cf3ec);return db[_0x1af3('0x2c')][_0x1af3('0x4e')](_0x33e018)[_0x1af3('0x23')](function(_0x399cf5){if(_0x399cf5){_0x51336c=_0x399cf5;return _0x399cf5[_0x1af3('0x6a')]();}return null;})[_0x1af3('0x23')](function(_0x2e7b3e){if(_0x2e7b3e){if(!_0x2e7b3e['length']){throw new db[(_0x1af3('0x88'))][(_0x1af3('0x89'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x48fd93=_0x2e7b3e;return db[_0x1af3('0x6b')][_0x1af3('0x42')]({'raw':!![]});}return null;})[_0x1af3('0x23')](function(_0x57bdaa){if(_0x57bdaa){_0x299123=_[_0x1af3('0x6c')](_0x57bdaa,'id');var _0x14b616;var _0x233fcc=squel[_0x1af3('0x6d')]();_0x233fcc[_0x1af3('0x8a')](_0x51336c[_0x1af3('0x6e')]);for(var _0x5e5e25=0x0;_0x5e5e25<_0x48fd93[_0x1af3('0x46')];_0x5e5e25+=0x1){_0x14b616=_0x48fd93[_0x5e5e25][_0x1af3('0x6f')]?_0x299123[_0x48fd93[_0x5e5e25]['MetricId']]['metric']:_0x48fd93[_0x5e5e25][_0x1af3('0x71')];_0x14b616=_0x48fd93[_0x5e5e25]['function']?_[_0x1af3('0x74')](_0xa08064[_0x48fd93[_0x5e5e25][_0x1af3('0x72')]],'%s',_0x14b616):_0x14b616;_0x14b616=_0x48fd93[_0x5e5e25][_0x1af3('0x73')]?_[_0x1af3('0x74')](_0x5a12ec[_0x48fd93[_0x5e5e25][_0x1af3('0x73')]],'%s',_0x14b616):_0x14b616;if(_0x48fd93[_0x5e5e25][_0x1af3('0x75')]){_0x233fcc['group'](_0x14b616);}_0x48fd93[_0x5e5e25][_0x1af3('0x76')]&&_0x233fcc[_0x1af3('0x3a')](_0x14b616,_0x48fd93[_0x5e5e25][_0x1af3('0x76')]==='DESC'?![]:!![]);_0x233fcc[_0x1af3('0x71')](_0x14b616,_0x48fd93[_0x5e5e25][_0x1af3('0x77')]||_0x14b616);}if(_0x51336c[_0x1af3('0x78')]){_0x51336c[_0x1af3('0x78')]=JSON['parse'](_0x51336c['joins']);for(var _0x5dab74=0x0;_0x5dab74<_0x51336c[_0x1af3('0x78')][_0x1af3('0x46')];_0x5dab74+=0x1){if(_0x51336c[_0x1af3('0x78')][_0x5dab74][_0x1af3('0x2f')]&&_['includes'](_0x361b66,_0x51336c[_0x1af3('0x78')][_0x5dab74][_0x1af3('0x2f')])&&_0x51336c[_0x1af3('0x78')][_0x5dab74][_0x1af3('0x7a')]&&_0x51336c['joins'][_0x5dab74][_0x1af3('0x7b')]&&_0x51336c[_0x1af3('0x78')][_0x5dab74][_0x1af3('0x8b')]){_0x233fcc[_0x51336c[_0x1af3('0x78')][_0x5dab74][_0x1af3('0x2f')]](_0x51336c[_0x1af3('0x78')][_0x5dab74]['foreignTable'],null,util[_0x1af3('0x73')](_0x1af3('0x7c'),_0x51336c['table'],_0x51336c['joins'][_0x5dab74]['parentKey'],_0x51336c[_0x1af3('0x78')][_0x5dab74][_0x1af3('0x7b')],_0x51336c[_0x1af3('0x78')][_0x5dab74][_0x1af3('0x8b')]));}}}if(_0x51336c['conditions']){_0x51336c[_0x1af3('0x7d')]=JSON[_0x1af3('0x79')](_0x51336c[_0x1af3('0x7d')]);_0x233fcc[_0x1af3('0x3c')](_0xfce05d(_0x51336c[_0x1af3('0x7d')][_0x1af3('0x67')]));}_0x3feb3c=_0x233fcc['clone']();_0x233fcc['limit'](_0x1e2b08);_0x233fcc[_0x1af3('0x1d')](0x0);return;}})[_0x1af3('0x23')](function(){if(_0x29c85c[_0x1af3('0x8c')]===_0x1af3('0x8d')){return null;}var _0x46997d=_[_0x1af3('0x48')](_0x29c85c,{'name':_0x29c85c[_0x1af3('0x8e')]||_0x29c85c[_0x1af3('0x29')]||_0x51336c[_0x1af3('0x29')],'basename':_0x24a6c2,'savename':util[_0x1af3('0x73')](_0x1af3('0x8f'),_0x29c85c[_0x1af3('0x29')]||_0x51336c[_0x1af3('0x29')],require(_0x1af3('0x90'))['generate'](0x4),_0x29c85c[_0x1af3('0x8c')]||_0x1af3('0x91')),'reportId':_0x51336c['id'],'reportType':'custom'});return db[_0x1af3('0x92')]['create'](_0x46997d,{'raw':!![]});})[_0x1af3('0x23')](function(_0x5abd6c){if(_0x51336c['table']===_0x1af3('0x93')){_0x3feb3c[_0x1af3('0x3c')](_0x51336c[_0x1af3('0x6e')]+_0x1af3('0x94'),_0x29c85c['startDate'],_0x29c85c['endDate']);}else{_0x3feb3c[_0x1af3('0x3c')](_0x51336c[_0x1af3('0x6e')]+_0x1af3('0x95'),_0x29c85c['startDate'],_0x29c85c[_0x1af3('0x96')]);}if(_0x5abd6c){logger['info'](_0x1af3('0x97'),_0x3feb3c[_0x1af3('0x80')]());require(_0x1af3('0x98'))[_0x1af3('0x99')](path['join'](__dirname,_0x1af3('0x9a'),_0x5abd6c['output']),[_0x5abd6c['id'],_0x3feb3c[_0x1af3('0x80')](),path[_0x1af3('0x84')](__dirname,'../../files/reports',_0x5abd6c[_0x1af3('0x9b')]),_0x24a6c2]);return _0x5abd6c;}else{var _0x2333d1=squel[_0x1af3('0x6d')]();_0x2333d1['from']('('+_0x3feb3c[_0x1af3('0x80')]()+')',_0x1af3('0x9c'));_0x2333d1['field'](_0x1af3('0x9d'),_0x1af3('0x1f'));_0x3feb3c[_0x1af3('0x39')](_0x29c85c[_0x1af3('0x39')]||_0x1e2b08);_0x3feb3c[_0x1af3('0x1d')](_0x29c85c[_0x1af3('0x1d')]||0x0);return dbH[_0x1af3('0x81')]['query'](_0x2333d1[_0x1af3('0x80')](),{'type':dbH[_0x1af3('0x81')][_0x1af3('0x82')][_0x1af3('0x83')]})[_0x1af3('0x23')](function(_0x3d1d85){if(!_0x3d1d85[_0x1af3('0x46')]){_0x4db220=0x0;}else{_0x4db220=_0x3d1d85[0x0][_0x1af3('0x1f')]||0x0;}return dbH[_0x1af3('0x81')][_0x1af3('0x32')](_0x3feb3c[_0x1af3('0x80')](),{'type':dbH[_0x1af3('0x81')][_0x1af3('0x82')]['SELECT']});})['then'](function(_0x466d1f){return{'rows':_0x466d1f||[],'count':_0x4db220};});}});}exports[_0x1af3('0x9e')]=function(_0x150b91,_0x51c27a){return runReport(_0x150b91['params'],_0x150b91['query'],_0x150b91[_0x1af3('0x40')])['then'](respondWithResult(_0x51c27a,null))['catch'](handleError(_0x51c27a,null));};exports[_0x1af3('0x9f')]=runReport;exports[_0x1af3('0x32')]=function(_0x5220d2,_0x24d994){var _0x2ff53e=0xa;var _0xe750b2=[_0x1af3('0x84'),_0x1af3('0x85'),_0x1af3('0x53'),_0x1af3('0x54')];var _0x54c395={'SUM':_0x1af3('0x55'),'COUNT':_0x1af3('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1af3('0x58'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x1af3('0x5b'),'GROUP_CONCAT ASC':_0x1af3('0x86'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x295066={'SEC_TO_TIME':_0x1af3('0x5c'),'DATE':_0x1af3('0x5d'),'HOUR':_0x1af3('0x5e'),'ROUND':_0x1af3('0x5f'),'UNIX_TIMESTAMP':_0x1af3('0x60')};var _0x34e185=function(_0x3c1f1f){return!_['includes']([_0x1af3('0x62'),_0x1af3('0x63'),'IS\x20EMPTY',_0x1af3('0xa0')],_0x3c1f1f);};var _0x52df67=function(_0x42be5c){if(!_0x42be5c||!_0x42be5c[_0x1af3('0x65')][_0x1af3('0x46')]){return'';}for(var _0x594eaa='(',_0xe8f3cf=0x0;_0xe8f3cf<_0x42be5c[_0x1af3('0x65')][_0x1af3('0x46')];_0xe8f3cf+=0x1){_0xe8f3cf>0x0&&(_0x594eaa+='\x20'+_0x42be5c['operator']+'\x20');_0x594eaa+=_0x42be5c['rules'][_0xe8f3cf]['group']?_0x52df67(_0x42be5c['rules'][_0xe8f3cf][_0x1af3('0x67')]):_0x42be5c[_0x1af3('0x65')][_0xe8f3cf]['field']+'\x20'+_0x42be5c['rules'][_0xe8f3cf]['condition']+(_0x34e185(_0x42be5c[_0x1af3('0x65')][_0xe8f3cf][_0x1af3('0x68')])?'\x20'+_0x42be5c['rules'][_0xe8f3cf][_0x1af3('0x69')]:'');}return _0x594eaa+')';};var _0x594ea3={'where':{'id':_0x5220d2['params']['id']}},_0x4269a7,_0x56b964,_0x5bd08e,_0x3338a1,_0x31d35e;_0x594ea3=_[_0x1af3('0x48')]({},_0x594ea3,_0x5220d2[_0x1af3('0x40')]);return db[_0x1af3('0x2c')][_0x1af3('0x4e')](_0x594ea3)['then'](function(_0x330a3a){if(_0x330a3a){_0x4269a7=_0x330a3a;return _0x330a3a[_0x1af3('0x6a')]();}return null;})[_0x1af3('0x23')](function(_0x4f25cc){if(_0x4f25cc){if(!_0x4f25cc['length']){throw new db[(_0x1af3('0x88'))][(_0x1af3('0x89'))](_0x1af3('0xa1'),0x193);}_0x56b964=_0x4f25cc;return db[_0x1af3('0x6b')][_0x1af3('0x42')]({'raw':!![]});}return null;})['then'](function(_0x89f2d9){if(_0x89f2d9){_0x5bd08e=_[_0x1af3('0x6c')](_0x89f2d9,'id');var _0x24793e;var _0x15debf=squel['select']();_0x15debf[_0x1af3('0x8a')](_0x4269a7[_0x1af3('0x6e')]);for(var _0x1ef6b1=0x0;_0x1ef6b1<_0x56b964[_0x1af3('0x46')];_0x1ef6b1+=0x1){_0x24793e=_0x56b964[_0x1ef6b1][_0x1af3('0x6f')]?_0x5bd08e[_0x56b964[_0x1ef6b1]['MetricId']][_0x1af3('0x70')]:_0x56b964[_0x1ef6b1][_0x1af3('0x71')];_0x24793e=_0x56b964[_0x1ef6b1]['function']?_[_0x1af3('0x74')](_0x54c395[_0x56b964[_0x1ef6b1]['function']],'%s',_0x24793e):_0x24793e;_0x24793e=_0x56b964[_0x1ef6b1][_0x1af3('0x73')]?_[_0x1af3('0x74')](_0x295066[_0x56b964[_0x1ef6b1][_0x1af3('0x73')]],'%s',_0x24793e):_0x24793e;if(_0x56b964[_0x1ef6b1][_0x1af3('0x75')]){_0x15debf[_0x1af3('0x67')](_0x24793e);}_0x56b964[_0x1ef6b1]['orderBy']&&_0x15debf[_0x1af3('0x3a')](_0x24793e,_0x56b964[_0x1ef6b1][_0x1af3('0x76')]==='DESC'?![]:!![]);_0x15debf[_0x1af3('0x71')](_0x24793e,_0x56b964[_0x1ef6b1]['alias']||_0x24793e);}if(_0x4269a7[_0x1af3('0x78')]){_0x4269a7['joins']=JSON['parse'](_0x4269a7[_0x1af3('0x78')]);for(var _0x2007be=0x0;_0x2007be<_0x4269a7[_0x1af3('0x78')][_0x1af3('0x46')];_0x2007be+=0x1){if(_0x4269a7[_0x1af3('0x78')][_0x2007be][_0x1af3('0x2f')]&&_[_0x1af3('0x61')](_0xe750b2,_0x4269a7[_0x1af3('0x78')][_0x2007be]['type'])&&_0x4269a7[_0x1af3('0x78')][_0x2007be][_0x1af3('0x7a')]&&_0x4269a7['joins'][_0x2007be][_0x1af3('0x7b')]&&_0x4269a7['joins'][_0x2007be][_0x1af3('0x8b')]){_0x15debf[_0x4269a7[_0x1af3('0x78')][_0x2007be][_0x1af3('0x2f')]](_0x4269a7[_0x1af3('0x78')][_0x2007be]['foreignTable'],null,util[_0x1af3('0x73')]('%s.%s\x20=\x20%s.%s',_0x4269a7['table'],_0x4269a7[_0x1af3('0x78')][_0x2007be][_0x1af3('0x7a')],_0x4269a7[_0x1af3('0x78')][_0x2007be][_0x1af3('0x7b')],_0x4269a7[_0x1af3('0x78')][_0x2007be][_0x1af3('0x8b')]));}}}if(_0x4269a7['conditions']){_0x4269a7[_0x1af3('0x7d')]=JSON[_0x1af3('0x79')](_0x4269a7[_0x1af3('0x7d')]);_0x15debf[_0x1af3('0x3c')](_0x52df67(_0x4269a7[_0x1af3('0x7d')][_0x1af3('0x67')]));}_0x31d35e=_0x15debf[_0x1af3('0x7e')]();_0x15debf['limit'](_0x2ff53e);_0x15debf[_0x1af3('0x1d')](0x0);logger[_0x1af3('0xa2')](_0x1af3('0x7f'),_0x15debf[_0x1af3('0x80')]());return dbH[_0x1af3('0x81')]['query'](_0x15debf[_0x1af3('0x80')](),{'type':dbH[_0x1af3('0x81')]['QueryTypes'][_0x1af3('0x83')]});}})[_0x1af3('0x23')](function(){return{'sql':_0x31d35e[_0x1af3('0x80')]()};})[_0x1af3('0x23')](respondWithResult(_0x24d994,null))[_0x1af3('0x49')](handleError(_0x24d994,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 5234f0f..3153eb7 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 _0x2955=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x4dbdda,_0x11f07c){var _0x1acbf1=function(_0x1a9fc8){while(--_0x1a9fc8){_0x4dbdda['push'](_0x4dbdda['shift']());}};_0x1acbf1(++_0x11f07c);}(_0x2955,0x1d2));var _0x5295=function(_0x58c58b,_0x591f9d){_0x58c58b=_0x58c58b-0x0;var _0x30b446=_0x2955[_0x58c58b];return _0x30b446;};'use strict';var _=require(_0x5295('0x0'));var util=require(_0x5295('0x1'));var logger=require(_0x5295('0x2'))(_0x5295('0x3'));var moment=require('moment');var BPromise=require(_0x5295('0x4'));var rp=require(_0x5295('0x5'));var fs=require('fs');var path=require(_0x5295('0x6'));var rimraf=require('rimraf');var config=require(_0x5295('0x7'));var attributes=require(_0x5295('0x8'));module[_0x5295('0x9')]=function(_0x4c61f9,_0x50b501){return _0x4c61f9[_0x5295('0xa')](_0x5295('0xb'),attributes,{'tableName':_0x5295('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x67fb=['api','moment','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','../../config/logger'];(function(_0xad98bd,_0x3d90b6){var _0x15a655=function(_0x1e1d9a){while(--_0x1e1d9a){_0xad98bd['push'](_0xad98bd['shift']());}};_0x15a655(++_0x3d90b6);}(_0x67fb,0x12b));var _0xb67f=function(_0x1e21c7,_0x23dbed){_0x1e21c7=_0x1e21c7-0x0;var _0x21e5c6=_0x67fb[_0x1e21c7];return _0x21e5c6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb67f('0x0'))(_0xb67f('0x1'));var moment=require(_0xb67f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb67f('0x3'));var rimraf=require(_0xb67f('0x4'));var config=require(_0xb67f('0x5'));var attributes=require(_0xb67f('0x6'));module['exports']=function(_0x466d1f,_0x4e7467){return _0x466d1f[_0xb67f('0x7')](_0xb67f('0x8'),attributes,{'tableName':_0xb67f('0x9'),'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 83eed8a..fec2b96 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 _0xec57=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4d21b3,_0x149d2b){var _0x73fc33=function(_0x18b755){while(--_0x18b755){_0x4d21b3['push'](_0x4d21b3['shift']());}};_0x73fc33(++_0x149d2b);}(_0xec57,0x161));var _0x7ec5=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xec57[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0x7ec5('0x0'));var util=require(_0x7ec5('0x1'));var moment=require(_0x7ec5('0x2'));var BPromise=require(_0x7ec5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ec5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7ec5('0x5'));var logger=require(_0x7ec5('0x6'))(_0x7ec5('0x7'));var config=require(_0x7ec5('0x8'));var jayson=require(_0x7ec5('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x571924,_0x2cefc9,_0x1a8573){return new BPromise(function(_0x39b040,_0x500a4c){return client[_0x7ec5('0xa')](_0x571924,_0x1a8573)[_0x7ec5('0xb')](function(_0x496056){logger[_0x7ec5('0xc')](_0x7ec5('0xd'),_0x2cefc9,_0x7ec5('0xe'));logger[_0x7ec5('0xf')](_0x7ec5('0x10'),_0x2cefc9,_0x7ec5('0xe'),JSON[_0x7ec5('0x11')](_0x496056));if(_0x496056[_0x7ec5('0x12')]){if(_0x496056[_0x7ec5('0x12')][_0x7ec5('0x13')]===0x1f4){logger[_0x7ec5('0x12')](_0x7ec5('0xd'),_0x2cefc9,_0x496056[_0x7ec5('0x12')][_0x7ec5('0x14')]);return _0x500a4c(_0x496056[_0x7ec5('0x12')][_0x7ec5('0x14')]);}logger['error'](_0x7ec5('0xd'),_0x2cefc9,_0x496056[_0x7ec5('0x12')][_0x7ec5('0x14')]);return _0x39b040(_0x496056['error'][_0x7ec5('0x14')]);}else{logger[_0x7ec5('0xc')](_0x7ec5('0xd'),_0x2cefc9,_0x7ec5('0xe'));_0x39b040(_0x496056[_0x7ec5('0x15')][_0x7ec5('0x14')]);}})[_0x7ec5('0x16')](function(_0x1e3a8f){logger[_0x7ec5('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2cefc9,_0x1e3a8f);_0x500a4c(_0x1e3a8f);});});}
\ No newline at end of file
+var _0x4229=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x103d9c,_0x17446a){var _0x16ded6=function(_0x35f63c){while(--_0x35f63c){_0x103d9c['push'](_0x103d9c['shift']());}};_0x16ded6(++_0x17446a);}(_0x4229,0x13c));var _0x9422=function(_0x436a7,_0x24c501){_0x436a7=_0x436a7-0x0;var _0x59e11e=_0x4229[_0x436a7];return _0x59e11e;};'use strict';var _=require(_0x9422('0x0'));var util=require('util');var moment=require(_0x9422('0x1'));var BPromise=require(_0x9422('0x2'));var rs=require(_0x9422('0x3'));var fs=require('fs');var Redis=require(_0x9422('0x4'));var db=require(_0x9422('0x5'))['db'];var utils=require(_0x9422('0x6'));var logger=require(_0x9422('0x7'))(_0x9422('0x8'));var config=require(_0x9422('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9422('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27d5cd,_0x296dee,_0x293278){return new BPromise(function(_0x4f9b76,_0x2d2db4){return client[_0x9422('0xb')](_0x27d5cd,_0x293278)[_0x9422('0xc')](function(_0x326414){logger[_0x9422('0xd')](_0x9422('0xe'),_0x296dee,_0x9422('0xf'));logger[_0x9422('0x10')](_0x9422('0x11'),_0x296dee,'request\x20sent',JSON[_0x9422('0x12')](_0x326414));if(_0x326414[_0x9422('0x13')]){if(_0x326414[_0x9422('0x13')][_0x9422('0x14')]===0x1f4){logger[_0x9422('0x13')](_0x9422('0xe'),_0x296dee,_0x326414[_0x9422('0x13')]['message']);return _0x2d2db4(_0x326414[_0x9422('0x13')]['message']);}logger[_0x9422('0x13')](_0x9422('0xe'),_0x296dee,_0x326414['error'][_0x9422('0x15')]);return _0x4f9b76(_0x326414['error'][_0x9422('0x15')]);}else{logger[_0x9422('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x296dee,'request\x20sent');_0x4f9b76(_0x326414['result'][_0x9422('0x15')]);}})[_0x9422('0x16')](function(_0x1f58f9){logger['error'](_0x9422('0xe'),_0x296dee,_0x1f58f9);_0x2d2db4(_0x1f58f9);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 2302647..3fa2464 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 _0x2e8a=['/:id/query','query','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','show','preview','get','/:id/run','run'];(function(_0x44fcda,_0x3efd79){var _0x2181c4=function(_0x52e48d){while(--_0x52e48d){_0x44fcda['push'](_0x44fcda['shift']());}};_0x2181c4(++_0x3efd79);}(_0x2e8a,0x1c3));var _0xa2e8=function(_0x1e1f17,_0x4bd574){_0x1e1f17=_0x1e1f17-0x0;var _0x465b52=_0x2e8a[_0x1e1f17];return _0x465b52;};'use strict';var multer=require(_0xa2e8('0x0'));var util=require(_0xa2e8('0x1'));var path=require(_0xa2e8('0x2'));var timeout=require(_0xa2e8('0x3'));var express=require(_0xa2e8('0x4'));var router=express[_0xa2e8('0x5')]();var fs_extra=require(_0xa2e8('0x6'));var auth=require(_0xa2e8('0x7'));var interaction=require(_0xa2e8('0x8'));var config=require(_0xa2e8('0x9'));var controller=require(_0xa2e8('0xa'));router['get']('/',auth[_0xa2e8('0xb')](),controller['index']);router['get']('/:id',auth[_0xa2e8('0xb')](),controller[_0xa2e8('0xc')]);router['get']('/:id/preview',auth[_0xa2e8('0xb')](),controller[_0xa2e8('0xd')]);router[_0xa2e8('0xe')](_0xa2e8('0xf'),auth[_0xa2e8('0xb')](),controller[_0xa2e8('0x10')]);router['get'](_0xa2e8('0x11'),auth[_0xa2e8('0xb')](),controller[_0xa2e8('0x12')]);router[_0xa2e8('0x13')]('/',auth[_0xa2e8('0xb')](),controller[_0xa2e8('0x14')]);router[_0xa2e8('0x15')](_0xa2e8('0x16'),auth[_0xa2e8('0xb')](),controller[_0xa2e8('0x17')]);router['delete'](_0xa2e8('0x16'),auth[_0xa2e8('0xb')](),controller[_0xa2e8('0x18')]);module[_0xa2e8('0x19')]=router;
\ No newline at end of file
+var _0x00e9=['./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00e9,0xf5));var _0x900e=function(_0x2121fc,_0x47c47b){_0x2121fc=_0x2121fc-0x0;var _0x1a37c6=_0x00e9[_0x2121fc];return _0x1a37c6;};'use strict';var multer=require(_0x900e('0x0'));var util=require(_0x900e('0x1'));var path=require('path');var timeout=require(_0x900e('0x2'));var express=require(_0x900e('0x3'));var router=express[_0x900e('0x4')]();var fs_extra=require(_0x900e('0x5'));var auth=require(_0x900e('0x6'));var interaction=require(_0x900e('0x7'));var config=require('../../config/environment');var controller=require(_0x900e('0x8'));router[_0x900e('0x9')]('/',auth[_0x900e('0xa')](),controller['index']);router[_0x900e('0x9')](_0x900e('0xb'),auth[_0x900e('0xa')](),controller[_0x900e('0xc')]);router[_0x900e('0x9')](_0x900e('0xd'),auth[_0x900e('0xa')](),controller[_0x900e('0xe')]);router[_0x900e('0x9')](_0x900e('0xf'),auth['isAuthenticated'](),controller[_0x900e('0x10')]);router[_0x900e('0x9')](_0x900e('0x11'),auth[_0x900e('0xa')](),controller[_0x900e('0x12')]);router[_0x900e('0x13')]('/',auth[_0x900e('0xa')](),controller['create']);router['put'](_0x900e('0xb'),auth[_0x900e('0xa')](),controller[_0x900e('0x14')]);router['delete'](_0x900e('0xb'),auth[_0x900e('0xa')](),controller[_0x900e('0x15')]);module[_0x900e('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 219e384..59f0032 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x33c5=['STRING','TEXT','exports'];(function(_0x5df10a,_0x3776c4){var _0x33c54e=function(_0x1155c3){while(--_0x1155c3){_0x5df10a['push'](_0x5df10a['shift']());}};_0x33c54e(++_0x3776c4);}(_0x33c5,0xe6));var _0x533c=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0x33c5[_0x9d1e6b];return _0x2b3070;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}};
\ No newline at end of file
+var _0x31f0=['sequelize','STRING','TEXT'];(function(_0x4e9c03,_0xd8dc1b){var _0x5486a5=function(_0x4f5578){while(--_0x4f5578){_0x4e9c03['push'](_0x4e9c03['shift']());}};_0x5486a5(++_0xd8dc1b);}(_0x31f0,0xb7));var _0x031f=function(_0xbc6afa,_0x22b8ae){_0xbc6afa=_0xbc6afa-0x0;var _0x100df9=_0x31f0[_0xbc6afa];return _0x100df9;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 5a54b45..8f640ac 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 _0x326f=['order','orderBy','DESC','joins','foreignTable','foreignKey','parentKey','conditions','Limited\x20Query:','toString','sequelize','SELECT','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','UNIX_TIMESTAMP(%s)','operator','AnalyticMetric','select','from','function','parse','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','join','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','SEC_TO_TIME(%s)','debug','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','apply','update','then','get','DefaultReports','UserProfileResource','destroy','end','error','name','send','index','map','AnalyticDefaultReport','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','left_join','right_join','cross_join','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','table','MetricId','metric','format','replace','groupBy'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x326f,0xd1));var _0xf326=function(_0x13f38c,_0x262c16){_0x13f38c=_0x13f38c-0x0;var _0x3826fb=_0x326f[_0x13f38c];return _0x3826fb;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf326('0x17'))[_0xf326('0x18')];function respondWithStatusCode(_0x4b3966,_0x342fe5){_0x342fe5=_0x342fe5||0xcc;return function(_0x472632){if(_0x472632){return _0x4b3966[_0xf326('0x19')](_0x342fe5);}return _0x4b3966[_0xf326('0x1a')](_0x342fe5)['end']();};}function respondWithResult(_0x45c1b6,_0x5204ee){_0x5204ee=_0x5204ee||0xc8;return function(_0x54bd1a){if(_0x54bd1a){return _0x45c1b6[_0xf326('0x1a')](_0x5204ee)[_0xf326('0x1b')](_0x54bd1a);}};}function respondWithFilteredResult(_0x1f2e5a,_0xa63d1a){return function(_0x292f4b){if(_0x292f4b){var _0x287a2a=typeof _0xa63d1a[_0xf326('0x1c')]===_0xf326('0x1d')&&typeof _0xa63d1a['limit']===_0xf326('0x1d');var _0x453100=_0x292f4b[_0xf326('0x1e')];var _0x31ffb9=_0x287a2a?0x0:_0xa63d1a[_0xf326('0x1c')];var _0x311af0=_0x287a2a?_0x292f4b['count']:_0xa63d1a['offset']+_0xa63d1a['limit'];var _0x16e605;if(_0x311af0>=_0x453100){_0x311af0=_0x453100;_0x16e605=0xc8;}else{_0x16e605=0xce;}_0x1f2e5a[_0xf326('0x1a')](_0x16e605);return _0x1f2e5a['set']('Content-Range',_0x31ffb9+'-'+_0x311af0+'/'+_0x453100)[_0xf326('0x1b')](_0x292f4b);}return null;};}function patchUpdates(_0x4dfa76){return function(_0x5b6d3c){try{jsonpatch[_0xf326('0x1f')](_0x5b6d3c,_0x4dfa76,!![]);}catch(_0x18ead3){return BPromise['reject'](_0x18ead3);}return _0x5b6d3c['save']();};}function saveUpdates(_0x19b8ba,_0xb1efcf){return function(_0x5f21a2){if(_0x5f21a2){return _0x5f21a2[_0xf326('0x20')](_0x19b8ba)[_0xf326('0x21')](function(_0x43c53e){return _0x43c53e;});}return null;};}function removeEntity(_0x295752,_0x17c157){return function(_0x2049ec){if(_0x2049ec){return _0x2049ec['destroy']()['then'](function(){var _0x4f31f6=_0x2049ec[_0xf326('0x22')]({'plain':!![]});var _0x1a2c4e=_0xf326('0x23');return db[_0xf326('0x24')][_0xf326('0x25')]({'where':{'type':_0x1a2c4e,'resourceId':_0x4f31f6['id']}})[_0xf326('0x21')](function(){return _0x2049ec;});})['then'](function(){_0x295752[_0xf326('0x1a')](0xcc)[_0xf326('0x26')]();});}};}function handleEntityNotFound(_0x212d5d,_0x581531){return function(_0x1617d2){if(!_0x1617d2){_0x212d5d['sendStatus'](0x194);}return _0x1617d2;};}function handleError(_0x4a9abf,_0x6a8e89){_0x6a8e89=_0x6a8e89||0x1f4;return function(_0x1ae23a){logger[_0xf326('0x27')](_0x1ae23a['stack']);if(_0x1ae23a[_0xf326('0x28')]){delete _0x1ae23a[_0xf326('0x28')];}_0x4a9abf['status'](_0x6a8e89)[_0xf326('0x29')](_0x1ae23a);};}exports[_0xf326('0x2a')]=function(_0xd77aba,_0x18d110){var _0xa80156={},_0x269be9={},_0x161143={'count':0x0,'rows':[]};var _0x39a1e2=_[_0xf326('0x2b')](db[_0xf326('0x2c')]['rawAttributes'],function(_0x1035ed){return{'name':_0x1035ed[_0xf326('0x2d')],'type':_0x1035ed[_0xf326('0x2e')]['key']};});_0x269be9[_0xf326('0x2f')]=_[_0xf326('0x2b')](_0x39a1e2,_0xf326('0x28'));_0x269be9['query']=_['keys'](_0xd77aba[_0xf326('0x30')]);_0x269be9[_0xf326('0x31')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],_0x269be9[_0xf326('0x30')]);_0xa80156[_0xf326('0x33')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],qs['fields'](_0xd77aba[_0xf326('0x30')][_0xf326('0x34')]));_0xa80156['attributes']=_0xa80156[_0xf326('0x33')]['length']?_0xa80156[_0xf326('0x33')]:_0x269be9['model'];if(!_0xd77aba['query'][_0xf326('0x35')]('nolimit')){_0xa80156[_0xf326('0x36')]=qs['limit'](_0xd77aba[_0xf326('0x30')][_0xf326('0x36')]);_0xa80156[_0xf326('0x1c')]=qs['offset'](_0xd77aba[_0xf326('0x30')][_0xf326('0x1c')]);}_0xa80156['order']=qs[_0xf326('0x37')](_0xd77aba[_0xf326('0x30')][_0xf326('0x37')]);_0xa80156[_0xf326('0x38')]=qs['filters'](_[_0xf326('0x39')](_0xd77aba[_0xf326('0x30')],_0x269be9[_0xf326('0x31')]),_0x39a1e2);if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3a')]){_0xa80156['where']=_[_0xf326('0x3b')](_0xa80156[_0xf326('0x38')],{'$or':_['map'](_0x39a1e2,function(_0x4dd361){if(_0x4dd361[_0xf326('0x2e')]!=='VIRTUAL'){var _0x55dfa8={};_0x55dfa8[_0x4dd361[_0xf326('0x28')]]={'$like':'%'+_0xd77aba['query'][_0xf326('0x3a')]+'%'};return _0x55dfa8;}})});}_0xa80156=_[_0xf326('0x3b')]({},_0xa80156,_0xd77aba[_0xf326('0x3c')]);var _0x39611e={'where':_0xa80156['where']};return db[_0xf326('0x2c')][_0xf326('0x1e')](_0x39611e)[_0xf326('0x21')](function(_0x365627){_0x161143[_0xf326('0x1e')]=_0x365627;if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3d')]){_0xa80156[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x2c')][_0xf326('0x3f')](_0xa80156);})[_0xf326('0x21')](function(_0x2bab13){_0x161143['rows']=_0x2bab13;return _0x161143;})[_0xf326('0x21')](respondWithFilteredResult(_0x18d110,_0xa80156))[_0xf326('0x40')](handleError(_0x18d110,null));};exports[_0xf326('0x41')]=function(_0x270288,_0x1dd262){var _0x1a2d0d={'raw':!![],'where':{'id':_0x270288[_0xf326('0x42')]['id']}},_0x4f4c51={};_0x4f4c51[_0xf326('0x2f')]=_['keys'](db[_0xf326('0x2c')][_0xf326('0x43')]);_0x4f4c51[_0xf326('0x30')]=_[_0xf326('0x44')](_0x270288[_0xf326('0x30')]);_0x4f4c51['filters']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],_0x4f4c51[_0xf326('0x30')]);_0x1a2d0d['attributes']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],qs[_0xf326('0x34')](_0x270288[_0xf326('0x30')]['fields']));_0x1a2d0d[_0xf326('0x33')]=_0x1a2d0d[_0xf326('0x33')][_0xf326('0x45')]?_0x1a2d0d[_0xf326('0x33')]:_0x4f4c51[_0xf326('0x2f')];if(_0x270288[_0xf326('0x30')][_0xf326('0x3d')]){_0x1a2d0d[_0xf326('0x3e')]=[{'all':!![]}];}_0x1a2d0d=_[_0xf326('0x3b')]({},_0x1a2d0d,_0x270288[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x1a2d0d)[_0xf326('0x21')](handleEntityNotFound(_0x1dd262,null))[_0xf326('0x21')](respondWithResult(_0x1dd262,null))[_0xf326('0x40')](handleError(_0x1dd262,null));};exports['create']=function(_0x199f8b,_0x1b0e03){return db[_0xf326('0x2c')][_0xf326('0x47')](_0x199f8b['body'],{})[_0xf326('0x21')](function(_0x2f5511){var _0xca88e=_0x199f8b[_0xf326('0x48')]['get']({'plain':!![]});if(!_0xca88e)throw new Error(_0xf326('0x49'));if(_0xca88e[_0xf326('0x4a')]===_0xf326('0x48')){var _0x451ac7=_0x2f5511[_0xf326('0x22')]({'plain':!![]});var _0x4970fb='Reports';return db[_0xf326('0x4b')][_0xf326('0x46')]({'where':{'name':_0x4970fb,'userProfileId':_0xca88e[_0xf326('0x4c')]},'raw':!![]})['then'](function(_0x102fba){if(_0x102fba&&_0x102fba[_0xf326('0x4d')]===0x0){return db[_0xf326('0x24')]['create']({'name':_0x451ac7['name'],'resourceId':_0x451ac7['id'],'type':_0xf326('0x23'),'sectionId':_0x102fba['id']},{})['then'](function(){return _0x2f5511;});}else{return _0x2f5511;}})[_0xf326('0x40')](function(_0x554277){logger[_0xf326('0x27')](_0xf326('0x4e'),_0x554277);throw _0x554277;});}return _0x2f5511;})[_0xf326('0x21')](respondWithResult(_0x1b0e03,0xc9))[_0xf326('0x40')](handleError(_0x1b0e03,null));};exports[_0xf326('0x20')]=function(_0x35d3c8,_0x7f7ece){if(_0x35d3c8['body']['id']){delete _0x35d3c8[_0xf326('0x4f')]['id'];}return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x35d3c8['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x7f7ece,null))[_0xf326('0x21')](saveUpdates(_0x35d3c8[_0xf326('0x4f')],null))[_0xf326('0x21')](respondWithResult(_0x7f7ece,null))[_0xf326('0x40')](handleError(_0x7f7ece,null));};exports['destroy']=function(_0x161fb3,_0x21eac7){return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x161fb3['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x21eac7,null))[_0xf326('0x21')](removeEntity(_0x21eac7,null))[_0xf326('0x40')](handleError(_0x21eac7,null));};exports[_0xf326('0x50')]=function(_0x4d3b9e,_0x5be2b1){var _0x18b46e=0xa;var _0x44d2ed=['join',_0xf326('0x51'),_0xf326('0x52'),_0xf326('0x53')];var _0x1258d1={'SUM':'SUM(%s)','COUNT':_0xf326('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':_0xf326('0x58')};var _0x4eef49={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':_0xf326('0x5a'),'ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2759d7=function(_0x487020){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x487020);};var _0x18dbfc=function(_0x23a9e8){if(!_0x23a9e8||!_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x33f9dd='(',_0x33ffb8=0x0;_0x33ffb8<_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')];_0x33ffb8+=0x1){_0x33ffb8>0x0&&(_0x33f9dd+='\x20'+_0x23a9e8['operator']+'\x20');_0x33f9dd+=_0x23a9e8[_0xf326('0x61')][_0x33ffb8]['group']?_0x18dbfc(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x62')]):_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x63')]+'\x20'+_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x64')]+(_0x2759d7(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x64')])?'\x20'+_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x65')]:'');}return _0x33f9dd+')';};var _0x51ff5e={'where':{'id':_0x4d3b9e[_0xf326('0x42')]['id']}},_0x4ec099,_0x1209ca,_0x32fe3a,_0x15a538,_0x21b3cc;_0x51ff5e=_['merge']({},_0x51ff5e,_0x4d3b9e[_0xf326('0x3c')]);return db[_0xf326('0x2c')]['find'](_0x51ff5e)['then'](function(_0x5b25ca){if(_0x5b25ca){_0x4ec099=_0x5b25ca;return _0x5b25ca[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4150fa){if(_0x4150fa){if(!_0x4150fa[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x1209ca=_0x4150fa;return db['AnalyticMetric'][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x3c3379){if(_0x3c3379){_0x32fe3a=_[_0xf326('0x6a')](_0x3c3379,'id');var _0x58de1e;var _0x3717fe=squel['select']();_0x3717fe['from'](_0x4ec099[_0xf326('0x6b')]);for(var _0x540fa0=0x0;_0x540fa0<_0x1209ca[_0xf326('0x45')];_0x540fa0+=0x1){_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6c')]?_0x32fe3a[_0x1209ca[_0x540fa0][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x1209ca[_0x540fa0][_0xf326('0x63')];_0x58de1e=_0x1209ca[_0x540fa0]['function']?_['replace'](_0x1258d1[_0x1209ca[_0x540fa0]['function']],'%s',_0x58de1e):_0x58de1e;_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x4eef49[_0x1209ca[_0x540fa0][_0xf326('0x6e')]],'%s',_0x58de1e):_0x58de1e;if(_0x1209ca[_0x540fa0][_0xf326('0x70')]){_0x3717fe[_0xf326('0x62')](_0x58de1e);}_0x1209ca[_0x540fa0]['orderBy']&&_0x3717fe[_0xf326('0x71')](_0x58de1e,_0x1209ca[_0x540fa0][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x3717fe['field'](_0x58de1e,_0x1209ca[_0x540fa0]['alias']||_0x58de1e);}if(_0x4ec099[_0xf326('0x74')]){_0x4ec099[_0xf326('0x74')]=JSON['parse'](_0x4ec099['joins']);for(var _0x2497fd=0x0;_0x2497fd<_0x4ec099['joins'][_0xf326('0x45')];_0x2497fd+=0x1){if(_0x4ec099['joins'][_0x2497fd]['type']&&_['includes'](_0x44d2ed,_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')])&&_0x4ec099[_0xf326('0x74')][_0x2497fd]['parentKey']&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')]&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x76')]){_0x3717fe[_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')]](_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],null,util[_0xf326('0x6e')]('%s.%s\x20=\x20%s.%s',_0x4ec099[_0xf326('0x6b')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x77')],_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x76')]));}}}if(_0x4ec099[_0xf326('0x78')]){_0x4ec099[_0xf326('0x78')]=JSON['parse'](_0x4ec099[_0xf326('0x78')]);_0x3717fe[_0xf326('0x38')](_0x18dbfc(_0x4ec099[_0xf326('0x78')][_0xf326('0x62')]));}_0x21b3cc=_0x3717fe['clone']();_0x3717fe[_0xf326('0x36')](_0x18b46e);_0x3717fe['offset'](0x0);logger['debug'](_0xf326('0x79'),_0x3717fe[_0xf326('0x7a')]());return dbH['sequelize']['query'](_0x3717fe['toString'](),{'type':dbH[_0xf326('0x7b')]['QueryTypes'][_0xf326('0x7c')]});}})[_0xf326('0x21')](respondWithResult(_0x5be2b1,null))[_0xf326('0x40')](handleError(_0x5be2b1,null));};function runReport(_0x2ec314,_0xf76a89,_0x25b56c){var _0x5d23f0=_0xf76a89[_0xf326('0x28')];var _0x323926=0xa;var _0x5f1724=['join',_0xf326('0x51'),'right_join',_0xf326('0x53')];var _0x147d51={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':_0xf326('0x7f'),'MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf326('0x58')};var _0x26bbb1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x14e8c0=function(_0x5814ad){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x5814ad);};var _0x1e50aa=function(_0x148779){if(!_0x148779||!_0x148779[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x38b696='(',_0x384b46=0x0;_0x384b46<_0x148779[_0xf326('0x61')][_0xf326('0x45')];_0x384b46+=0x1){_0x384b46>0x0&&(_0x38b696+='\x20'+_0x148779[_0xf326('0x82')]+'\x20');_0x38b696+=_0x148779[_0xf326('0x61')][_0x384b46]['group']?_0x1e50aa(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x62')]):_0x148779['rules'][_0x384b46][_0xf326('0x63')]+'\x20'+_0x148779[_0xf326('0x61')][_0x384b46]['condition']+(_0x14e8c0(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x64')])?'\x20'+_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x65')]:'');}return _0x38b696+')';};var _0x2ab607={'where':{'id':_0x2ec314['id']}},_0x35c228,_0x1bb7cc,_0x5794d0,_0x15d61e,_0x107c00;_0x2ab607=_[_0xf326('0x3b')]({},_0x2ab607,_0x25b56c);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x2ab607)[_0xf326('0x21')](function(_0x204002){if(_0x204002){_0x35c228=_0x204002;return _0x204002[_0xf326('0x66')]();}return null;})['then'](function(_0xa8e05b){if(_0xa8e05b){if(!_0xa8e05b[_0xf326('0x45')]){throw new db['Sequelize'][(_0xf326('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1bb7cc=_0xa8e05b;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x2a0f36){if(_0x2a0f36){_0x5794d0=_[_0xf326('0x6a')](_0x2a0f36,'id');var _0x3097cf;var _0xf66b70=squel[_0xf326('0x84')]();_0xf66b70[_0xf326('0x85')](_0x35c228[_0xf326('0x6b')]);for(var _0x3f073c=0x0;_0x3f073c<_0x1bb7cc[_0xf326('0x45')];_0x3f073c+=0x1){_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]?_0x5794d0[_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]]['metric']:_0x1bb7cc[_0x3f073c][_0xf326('0x63')];_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x147d51[_0x1bb7cc[_0x3f073c][_0xf326('0x86')]],'%s',_0x3097cf):_0x3097cf;_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]?_['replace'](_0x26bbb1[_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]],'%s',_0x3097cf):_0x3097cf;if(_0x1bb7cc[_0x3f073c][_0xf326('0x70')]){_0xf66b70[_0xf326('0x62')](_0x3097cf);}_0x1bb7cc[_0x3f073c][_0xf326('0x72')]&&_0xf66b70[_0xf326('0x71')](_0x3097cf,_0x1bb7cc[_0x3f073c]['orderBy']==='DESC'?![]:!![]);_0xf66b70[_0xf326('0x63')](_0x3097cf,_0x1bb7cc[_0x3f073c]['alias']||_0x3097cf);}if(_0x35c228[_0xf326('0x74')]){_0x35c228[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x35c228['joins']);for(var _0x54b023=0x0;_0x54b023<_0x35c228[_0xf326('0x74')][_0xf326('0x45')];_0x54b023+=0x1){if(_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]&&_[_0xf326('0x5c')](_0x5f1724,_0x35c228['joins'][_0x54b023][_0xf326('0x2e')])&&_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x77')]&&_0x35c228['joins'][_0x54b023]['foreignTable']&&_0x35c228['joins'][_0x54b023][_0xf326('0x76')]){_0xf66b70[_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]](_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x35c228['table'],_0x35c228['joins'][_0x54b023][_0xf326('0x77')],_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],_0x35c228['joins'][_0x54b023][_0xf326('0x76')]));}}}if(_0x35c228[_0xf326('0x78')]){_0x35c228[_0xf326('0x78')]=JSON['parse'](_0x35c228[_0xf326('0x78')]);_0xf66b70[_0xf326('0x38')](_0x1e50aa(_0x35c228[_0xf326('0x78')][_0xf326('0x62')]));}_0x107c00=_0xf66b70['clone']();_0xf66b70['limit'](_0x323926);_0xf66b70['offset'](0x0);return;}})[_0xf326('0x21')](function(){if(_0xf76a89[_0xf326('0x89')]===_0xf326('0x8a')){return null;}var _0x5f0b45=_[_0xf326('0x3b')](_0xf76a89,{'name':_0xf76a89[_0xf326('0x8b')]||_0xf76a89[_0xf326('0x28')]||_0x35c228['name'],'basename':_0x5d23f0,'savename':util[_0xf326('0x6e')](_0xf326('0x8c'),_0xf76a89[_0xf326('0x28')]||_0x35c228[_0xf326('0x28')],require('randomstring')[_0xf326('0x8d')](0x4),_0xf76a89['output']||_0xf326('0x8e')),'reportId':_0x35c228['id'],'reportType':_0xf326('0x8f')});return db[_0xf326('0x90')][_0xf326('0x47')](_0x5f0b45,{'raw':!![]});})['then'](function(_0x2e2f70){if(_0x35c228['table']===_0xf326('0x91')){_0x107c00[_0xf326('0x38')](_0x35c228[_0xf326('0x6b')]+_0xf326('0x92'),_0xf76a89[_0xf326('0x93')],_0xf76a89['endDate']);}else{_0x107c00['where'](_0x35c228[_0xf326('0x6b')]+_0xf326('0x94'),_0xf76a89[_0xf326('0x93')],_0xf76a89[_0xf326('0x95')]);}if(_0x2e2f70){logger['info'](_0xf326('0x96'),_0x107c00['toString']());require(_0xf326('0x97'))[_0xf326('0x98')](path[_0xf326('0x99')](__dirname,'../../components/export/',_0x2e2f70[_0xf326('0x89')]),[_0x2e2f70['id'],_0x107c00[_0xf326('0x7a')](),path[_0xf326('0x99')](__dirname,_0xf326('0x9a'),_0x2e2f70[_0xf326('0x9b')]),_0x5d23f0]);return _0x2e2f70;}else{var _0x4dc4bc=squel[_0xf326('0x84')]();_0x4dc4bc[_0xf326('0x85')]('('+_0x107c00['toString']()+')',_0xf326('0x9c'));_0x4dc4bc[_0xf326('0x63')](_0xf326('0x9d'),_0xf326('0x1e'));_0x107c00['limit'](_0xf76a89['limit']||_0x323926);_0x107c00[_0xf326('0x1c')](_0xf76a89[_0xf326('0x1c')]||0x0);return dbH['sequelize'][_0xf326('0x30')](_0x4dc4bc['toString'](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]})[_0xf326('0x21')](function(_0x37cd6f){if(!_0x37cd6f[_0xf326('0x45')]){_0x15d61e=0x0;}else{_0x15d61e=_0x37cd6f[0x0][_0xf326('0x1e')]||0x0;}return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x107c00[_0xf326('0x7a')](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]});})[_0xf326('0x21')](function(_0x1c7f81){return{'rows':_0x1c7f81||[],'count':_0x15d61e};});}});}exports['run']=function(_0x3e6a5d,_0x20020c){return runReport(_0x3e6a5d[_0xf326('0x42')],_0x3e6a5d[_0xf326('0x30')],_0x3e6a5d[_0xf326('0x3c')])['then'](respondWithResult(_0x20020c,null))[_0xf326('0x40')](handleError(_0x20020c,null));};exports['runReport']=runReport;exports[_0xf326('0x30')]=function(_0x14d255,_0xffd165){var _0x2bc501=0xa;var _0x4bd216=[_0xf326('0x99'),_0xf326('0x51'),_0xf326('0x52'),'cross_join'];var _0x23451e={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x310223={'SEC_TO_TIME':_0xf326('0x9f'),'DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x539d23=function(_0x171c53){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x171c53);};var _0x4c7fc0=function(_0x4ffde1){if(!_0x4ffde1||!_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x4307d9='(',_0x2fa05b=0x0;_0x2fa05b<_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')];_0x2fa05b+=0x1){_0x2fa05b>0x0&&(_0x4307d9+='\x20'+_0x4ffde1['operator']+'\x20');_0x4307d9+=_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]?_0x4c7fc0(_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]):_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x63')]+'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x64')]+(_0x539d23(_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['condition'])?'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['value']:'');}return _0x4307d9+')';};var _0x590dc0={'where':{'id':_0x14d255[_0xf326('0x42')]['id']}},_0x32fc6e,_0x549a1f,_0x1f37f9,_0x3e0918,_0x3398fd;_0x590dc0=_[_0xf326('0x3b')]({},_0x590dc0,_0x14d255[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x590dc0)[_0xf326('0x21')](function(_0x314442){if(_0x314442){_0x32fc6e=_0x314442;return _0x314442[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4c1fcd){if(_0x4c1fcd){if(!_0x4c1fcd[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x549a1f=_0x4c1fcd;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x5429a2){if(_0x5429a2){_0x1f37f9=_[_0xf326('0x6a')](_0x5429a2,'id');var _0x15f799;var _0x320ab3=squel[_0xf326('0x84')]();_0x320ab3[_0xf326('0x85')](_0x32fc6e[_0xf326('0x6b')]);for(var _0x2094bf=0x0;_0x2094bf<_0x549a1f['length'];_0x2094bf+=0x1){_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6c')]?_0x1f37f9[_0x549a1f[_0x2094bf][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x549a1f[_0x2094bf][_0xf326('0x63')];_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x23451e[_0x549a1f[_0x2094bf][_0xf326('0x86')]],'%s',_0x15f799):_0x15f799;_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x310223[_0x549a1f[_0x2094bf][_0xf326('0x6e')]],'%s',_0x15f799):_0x15f799;if(_0x549a1f[_0x2094bf][_0xf326('0x70')]){_0x320ab3[_0xf326('0x62')](_0x15f799);}_0x549a1f[_0x2094bf]['orderBy']&&_0x320ab3[_0xf326('0x71')](_0x15f799,_0x549a1f[_0x2094bf][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x320ab3['field'](_0x15f799,_0x549a1f[_0x2094bf]['alias']||_0x15f799);}if(_0x32fc6e[_0xf326('0x74')]){_0x32fc6e[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x32fc6e[_0xf326('0x74')]);for(var _0x5384a5=0x0;_0x5384a5<_0x32fc6e[_0xf326('0x74')][_0xf326('0x45')];_0x5384a5+=0x1){if(_0x32fc6e[_0xf326('0x74')][_0x5384a5]['type']&&_['includes'](_0x4bd216,_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')])&&_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x75')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x76')]){_0x320ab3[_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')]](_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x32fc6e[_0xf326('0x6b')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x76')]));}}}if(_0x32fc6e[_0xf326('0x78')]){_0x32fc6e[_0xf326('0x78')]=JSON['parse'](_0x32fc6e[_0xf326('0x78')]);_0x320ab3[_0xf326('0x38')](_0x4c7fc0(_0x32fc6e[_0xf326('0x78')]['group']));}_0x3398fd=_0x320ab3['clone']();_0x320ab3['limit'](_0x2bc501);_0x320ab3[_0xf326('0x1c')](0x0);logger[_0xf326('0xa0')](_0xf326('0x79'),_0x320ab3[_0xf326('0x7a')]());return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x320ab3['toString'](),{'type':dbH[_0xf326('0x7b')][_0xf326('0x9e')][_0xf326('0x7c')]});}})[_0xf326('0x21')](function(){return{'sql':_0x3398fd[_0xf326('0x7a')]()};})['then'](respondWithResult(_0xffd165,null))[_0xf326('0x40')](handleError(_0xffd165,null));};
\ No newline at end of file
+var _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x1a5ade,_0x4c6a75){var _0x246f99=function(_0x41f4c4){while(--_0x41f4c4){_0x1a5ade['push'](_0x1a5ade['shift']());}};_0x246f99(++_0x4c6a75);}(_0x4975,0x86));var _0x5497=function(_0x135ad2,_0x5eade6){_0x135ad2=_0x135ad2-0x0;var _0x1425b6=_0x4975[_0x135ad2];return _0x1425b6;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 9d8ef3c..32a6404 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 _0x36c9=['exports','define','analytics_default_reports','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x36c9,0xb7));var _0x936c=function(_0xc91ccd,_0x28f968){_0xc91ccd=_0xc91ccd-0x0;var _0x28c08e=_0x36c9[_0xc91ccd];return _0x28c08e;};'use strict';var _=require(_0x936c('0x0'));var util=require('util');var logger=require(_0x936c('0x1'))('api');var moment=require(_0x936c('0x2'));var BPromise=require(_0x936c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x936c('0x4'));var config=require(_0x936c('0x5'));var attributes=require(_0x936c('0x6'));module[_0x936c('0x7')]=function(_0x5a42eb,_0x18d903){return _0x5a42eb[_0x936c('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0x936c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x578d=['analytics_default_reports','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0x4d7eb,_0x2c3a08){var _0x257a88=function(_0xd0b0b4){while(--_0xd0b0b4){_0x4d7eb['push'](_0x4d7eb['shift']());}};_0x257a88(++_0x2c3a08);}(_0x578d,0xeb));var _0xd578=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x578d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd578('0x0'));var util=require(_0xd578('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd578('0x2'));var BPromise=require(_0xd578('0x3'));var rp=require(_0xd578('0x4'));var fs=require('fs');var path=require(_0xd578('0x5'));var rimraf=require(_0xd578('0x6'));var config=require(_0xd578('0x7'));var attributes=require(_0xd578('0x8'));module[_0xd578('0x9')]=function(_0x1cd1f4,_0x10dc45){return _0x1cd1f4[_0xd578('0xa')](_0xd578('0xb'),attributes,{'tableName':_0xd578('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 2eaeaba..72e87b5 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 _0x9e56=['stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x1a5e85,_0x1e423f){var _0x48506e=function(_0xbbc2a4){while(--_0xbbc2a4){_0x1a5e85['push'](_0x1a5e85['shift']());}};_0x48506e(++_0x1e423f);}(_0x9e56,0x157));var _0x69e5=function(_0x1e22d6,_0x25605f){_0x1e22d6=_0x1e22d6-0x0;var _0x397cc4=_0x9e56[_0x1e22d6];return _0x397cc4;};'use strict';var _=require(_0x69e5('0x0'));var util=require(_0x69e5('0x1'));var moment=require(_0x69e5('0x2'));var BPromise=require(_0x69e5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69e5('0x4'));var db=require(_0x69e5('0x5'))['db'];var utils=require(_0x69e5('0x6'));var logger=require(_0x69e5('0x7'))(_0x69e5('0x8'));var config=require(_0x69e5('0x9'));var jayson=require(_0x69e5('0xa'));var client=jayson['client'][_0x69e5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bc6c1,_0x591b17,_0x2a8245){return new BPromise(function(_0x567a19,_0x27bdbc){return client[_0x69e5('0xc')](_0x3bc6c1,_0x2a8245)[_0x69e5('0xd')](function(_0x3293b9){logger[_0x69e5('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x591b17,_0x69e5('0xf'));logger['debug'](_0x69e5('0x10'),_0x591b17,_0x69e5('0xf'),JSON[_0x69e5('0x11')](_0x3293b9));if(_0x3293b9[_0x69e5('0x12')]){if(_0x3293b9[_0x69e5('0x12')][_0x69e5('0x13')]===0x1f4){logger[_0x69e5('0x12')](_0x69e5('0x14'),_0x591b17,_0x3293b9[_0x69e5('0x12')]['message']);return _0x27bdbc(_0x3293b9['error'][_0x69e5('0x15')]);}logger[_0x69e5('0x12')](_0x69e5('0x14'),_0x591b17,_0x3293b9[_0x69e5('0x12')][_0x69e5('0x15')]);return _0x567a19(_0x3293b9[_0x69e5('0x12')]['message']);}else{logger[_0x69e5('0xe')](_0x69e5('0x14'),_0x591b17,'request\x20sent');_0x567a19(_0x3293b9[_0x69e5('0x16')]['message']);}})[_0x69e5('0x17')](function(_0xf1c2b0){logger[_0x69e5('0x12')](_0x69e5('0x14'),_0x591b17,_0xf1c2b0);_0x27bdbc(_0xf1c2b0);});});}
\ No newline at end of file
+var _0x1935=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x1935,0x169));var _0x5193=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x1935[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x5193('0x0'));var util=require('util');var moment=require(_0x5193('0x1'));var BPromise=require(_0x5193('0x2'));var rs=require(_0x5193('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5193('0x4'))['db'];var utils=require(_0x5193('0x5'));var logger=require(_0x5193('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5193('0x7'));var client=jayson[_0x5193('0x8')][_0x5193('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d2286,_0x35d411,_0x2df7e6){return new BPromise(function(_0x49babb,_0xe5586d){return client[_0x5193('0xa')](_0x3d2286,_0x2df7e6)[_0x5193('0xb')](function(_0x55911f){logger[_0x5193('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x35d411,_0x5193('0xd'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x35d411,_0x5193('0xd'),JSON[_0x5193('0xe')](_0x55911f));if(_0x55911f[_0x5193('0xf')]){if(_0x55911f[_0x5193('0xf')][_0x5193('0x10')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x35d411,_0x55911f['error']['message']);return _0xe5586d(_0x55911f[_0x5193('0xf')][_0x5193('0x11')]);}logger[_0x5193('0xf')](_0x5193('0x12'),_0x35d411,_0x55911f[_0x5193('0xf')]['message']);return _0x49babb(_0x55911f[_0x5193('0xf')][_0x5193('0x11')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x35d411,_0x5193('0xd'));_0x49babb(_0x55911f['result'][_0x5193('0x11')]);}})[_0x5193('0x13')](function(_0x58ddea){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x35d411,_0x58ddea);_0xe5586d(_0x58ddea);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index ad277c7..a48dc96 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 _0x2aab=['preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/preview'];(function(_0x168139,_0x427878){var _0x25695b=function(_0x360b83){while(--_0x360b83){_0x168139['push'](_0x168139['shift']());}};_0x25695b(++_0x427878);}(_0x2aab,0x151));var _0xb2aa=function(_0x39640c,_0x4ccc46){_0x39640c=_0x39640c-0x0;var _0x38af74=_0x2aab[_0x39640c];return _0x38af74;};'use strict';var multer=require(_0xb2aa('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb2aa('0x1'));var express=require(_0xb2aa('0x2'));var router=express[_0xb2aa('0x3')]();var fs_extra=require(_0xb2aa('0x4'));var auth=require(_0xb2aa('0x5'));var interaction=require(_0xb2aa('0x6'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xb2aa('0x7')]('/',auth[_0xb2aa('0x8')](),controller[_0xb2aa('0x9')]);router[_0xb2aa('0x7')](_0xb2aa('0xa'),auth[_0xb2aa('0x8')](),controller[_0xb2aa('0xb')]);router[_0xb2aa('0x7')](_0xb2aa('0xc'),auth[_0xb2aa('0x8')](),controller[_0xb2aa('0xd')]);router['get'](_0xb2aa('0xe'),auth[_0xb2aa('0x8')](),controller[_0xb2aa('0xf')]);router[_0xb2aa('0x7')](_0xb2aa('0x10'),auth[_0xb2aa('0x8')](),controller[_0xb2aa('0x11')]);router[_0xb2aa('0x12')]('/',auth[_0xb2aa('0x8')](),controller[_0xb2aa('0x13')]);router[_0xb2aa('0x14')](_0xb2aa('0xa'),auth[_0xb2aa('0x8')](),controller[_0xb2aa('0x15')]);router[_0xb2aa('0x16')](_0xb2aa('0xa'),auth['isAuthenticated'](),controller[_0xb2aa('0x17')]);module[_0xb2aa('0x18')]=router;
\ No newline at end of file
+var _0xa88c=['/:id/query','query','post','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','/:id','preview','/:id/run','run'];(function(_0x5452ce,_0x410be2){var _0x329f18=function(_0x598bc7){while(--_0x598bc7){_0x5452ce['push'](_0x5452ce['shift']());}};_0x329f18(++_0x410be2);}(_0xa88c,0xc3));var _0xca88=function(_0x1f2c2a,_0x5bda9d){_0x1f2c2a=_0x1f2c2a-0x0;var _0x4906de=_0xa88c[_0x1f2c2a];return _0x4906de;};'use strict';var multer=require(_0xca88('0x0'));var util=require(_0xca88('0x1'));var path=require(_0xca88('0x2'));var timeout=require(_0xca88('0x3'));var express=require('express');var router=express[_0xca88('0x4')]();var fs_extra=require(_0xca88('0x5'));var auth=require(_0xca88('0x6'));var interaction=require(_0xca88('0x7'));var config=require('../../config/environment');var controller=require(_0xca88('0x8'));router[_0xca88('0x9')]('/',auth[_0xca88('0xa')](),controller['index']);router[_0xca88('0x9')](_0xca88('0xb'),auth[_0xca88('0xa')](),controller['show']);router[_0xca88('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0xca88('0xc')]);router[_0xca88('0x9')](_0xca88('0xd'),auth[_0xca88('0xa')](),controller[_0xca88('0xe')]);router[_0xca88('0x9')](_0xca88('0xf'),auth[_0xca88('0xa')](),controller[_0xca88('0x10')]);router[_0xca88('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xca88('0x12')]);router['delete'](_0xca88('0xb'),auth[_0xca88('0xa')](),controller[_0xca88('0x13')]);module[_0xca88('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 51ebe7d..d70bcb7 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 _0xb8c5=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','moment'];(function(_0x8d752a,_0x3d2cac){var _0x24c475=function(_0x3765a5){while(--_0x3765a5){_0x8d752a['push'](_0x8d752a['shift']());}};_0x24c475(++_0x3d2cac);}(_0xb8c5,0x137));var _0x5b8c=function(_0x458a6e,_0xc6a2ec){_0x458a6e=_0x458a6e-0x0;var _0x3ad477=_0xb8c5[_0x458a6e];return _0x3ad477;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5b8c('0x0'));module[_0x5b8c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x5b8c('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x5b8c('0x3')](_0x5b8c('0x4'),_0x5b8c('0x5'),_0x5b8c('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x5b8c('0x7')]},'status':{'type':Sequelize[_0x5b8c('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x5b8c('0x8'),_0x5b8c('0x9')),'allowNull':![],'defaultValue':_0x5b8c('0x8')},'reportId':{'type':Sequelize[_0x5b8c('0xa')](0xb)[_0x5b8c('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3c2a=['moment','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x3c2a,0x9c));var _0xa3c2=function(_0x5b491a,_0x48a13d){_0x5b491a=_0x5b491a-0x0;var _0x23df8a=_0x3c2a[_0x5b491a];return _0x23df8a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa3c2('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3c2('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xa3c2('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0xa3c2('0x2')](_0xa3c2('0x3'),_0xa3c2('0x4'),_0xa3c2('0x5')),'allowNull':![],'defaultValue':_0xa3c2('0x3')},'savename':{'type':Sequelize[_0xa3c2('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xa3c2('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xa3c2('0x1')],'defaultValue':_0xa3c2('0x7')},'type':{'type':Sequelize[_0xa3c2('0x2')](_0xa3c2('0x8'),_0xa3c2('0x9')),'allowNull':![],'defaultValue':_0xa3c2('0x8')},'reportId':{'type':Sequelize[_0xa3c2('0xa')](0xb)[_0xa3c2('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index d991ea9..8cfa1e8 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 _0x5190=['sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','save','update','then','destroy','get','ExtractedReports','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','params','keys','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','savename','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','basename','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x4b1555,_0x3cf446){var _0x166d49=function(_0x3a3a8c){while(--_0x3a3a8c){_0x4b1555['push'](_0x4b1555['shift']());}};_0x166d49(++_0x3cf446);}(_0x5190,0xa8));var _0x0519=function(_0xf44d98,_0x12a472){_0xf44d98=_0xf44d98-0x0;var _0x5ebb04=_0x5190[_0xf44d98];return _0x5ebb04;};'use strict';var emlformat=require(_0x0519('0x0'));var rimraf=require(_0x0519('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0519('0x2'));var rp=require(_0x0519('0x3'));var moment=require('moment');var BPromise=require(_0x0519('0x4'));var Mustache=require(_0x0519('0x5'));var util=require(_0x0519('0x6'));var path=require('path');var sox=require(_0x0519('0x7'));var csv=require(_0x0519('0x8'));var ejs=require(_0x0519('0x9'));var fs=require('fs');var fs_extra=require(_0x0519('0xa'));var _=require(_0x0519('0xb'));var squel=require(_0x0519('0xc'));var crypto=require(_0x0519('0xd'));var jsforce=require(_0x0519('0xe'));var deskjs=require(_0x0519('0xf'));var toCsv=require(_0x0519('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0519('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0519('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0519('0x12'))(_0x0519('0x13'));var utils=require(_0x0519('0x14'));var config=require(_0x0519('0x15'));var licenseUtil=require(_0x0519('0x16'));var db=require(_0x0519('0x17'))['db'];function respondWithStatusCode(_0x2f2e37,_0x5dc6c9){_0x5dc6c9=_0x5dc6c9||0xcc;return function(_0x3f7440){if(_0x3f7440){return _0x2f2e37[_0x0519('0x18')](_0x5dc6c9);}return _0x2f2e37['status'](_0x5dc6c9)[_0x0519('0x19')]();};}function respondWithResult(_0x4c177b,_0x2211b9){_0x2211b9=_0x2211b9||0xc8;return function(_0x2754dc){if(_0x2754dc){return _0x4c177b['status'](_0x2211b9)[_0x0519('0x1a')](_0x2754dc);}};}function respondWithFilteredResult(_0x5b0414,_0x1de1b1){return function(_0x1fe5d0){if(_0x1fe5d0){var _0x313b5f=typeof _0x1de1b1[_0x0519('0x1b')]===_0x0519('0x1c')&&typeof _0x1de1b1[_0x0519('0x1d')]===_0x0519('0x1c');var _0x5b8e34=_0x1fe5d0[_0x0519('0x1e')];var _0x293eae=_0x313b5f?0x0:_0x1de1b1[_0x0519('0x1b')];var _0x4508f5=_0x313b5f?_0x1fe5d0[_0x0519('0x1e')]:_0x1de1b1[_0x0519('0x1b')]+_0x1de1b1[_0x0519('0x1d')];var _0x155000;if(_0x4508f5>=_0x5b8e34){_0x4508f5=_0x5b8e34;_0x155000=0xc8;}else{_0x155000=0xce;}_0x5b0414[_0x0519('0x1f')](_0x155000);return _0x5b0414['set'](_0x0519('0x20'),_0x293eae+'-'+_0x4508f5+'/'+_0x5b8e34)[_0x0519('0x1a')](_0x1fe5d0);}return null;};}function patchUpdates(_0x14cd4d){return function(_0x222ede){try{jsonpatch[_0x0519('0x21')](_0x222ede,_0x14cd4d,!![]);}catch(_0x4633b7){return BPromise['reject'](_0x4633b7);}return _0x222ede[_0x0519('0x22')]();};}function saveUpdates(_0x1e65a2,_0x1d3f15){return function(_0xf65ece){if(_0xf65ece){return _0xf65ece[_0x0519('0x23')](_0x1e65a2)[_0x0519('0x24')](function(_0x53f092){return _0x53f092;});}return null;};}function removeEntity(_0x4d253c,_0x27ff70){return function(_0x18199c){if(_0x18199c){return _0x18199c[_0x0519('0x25')]()[_0x0519('0x24')](function(){var _0xa3ec39=_0x18199c[_0x0519('0x26')]({'plain':!![]});var _0x2fbf1b=_0x0519('0x27');return db['UserProfileResource'][_0x0519('0x25')]({'where':{'type':_0x2fbf1b,'resourceId':_0xa3ec39['id']}})[_0x0519('0x24')](function(){return _0x18199c;});})[_0x0519('0x24')](function(){_0x4d253c[_0x0519('0x1f')](0xcc)[_0x0519('0x19')]();});}};}function handleEntityNotFound(_0x36dd1f,_0x21c793){return function(_0x7552b4){if(!_0x7552b4){_0x36dd1f[_0x0519('0x18')](0x194);}return _0x7552b4;};}function handleError(_0x1fe579,_0x48d422){_0x48d422=_0x48d422||0x1f4;return function(_0x1a499d){logger[_0x0519('0x28')](_0x1a499d[_0x0519('0x29')]);if(_0x1a499d[_0x0519('0x2a')]){delete _0x1a499d[_0x0519('0x2a')];}_0x1fe579[_0x0519('0x1f')](_0x48d422)[_0x0519('0x2b')](_0x1a499d);};}exports[_0x0519('0x2c')]=function(_0xe0fa58,_0x208eff){var _0x2d486f={},_0x2a15eb={},_0xd5e4a5={'count':0x0,'rows':[]};var _0x59667b=_[_0x0519('0x2d')](db[_0x0519('0x2e')][_0x0519('0x2f')],function(_0x53865a){return{'name':_0x53865a['fieldName'],'type':_0x53865a[_0x0519('0x30')][_0x0519('0x31')]};});_0x2a15eb[_0x0519('0x32')]=_['map'](_0x59667b,_0x0519('0x2a'));_0x2a15eb[_0x0519('0x33')]=_['keys'](_0xe0fa58['query']);_0x2a15eb[_0x0519('0x34')]=_[_0x0519('0x35')](_0x2a15eb[_0x0519('0x32')],_0x2a15eb[_0x0519('0x33')]);_0x2d486f[_0x0519('0x36')]=_[_0x0519('0x35')](_0x2a15eb[_0x0519('0x32')],qs['fields'](_0xe0fa58[_0x0519('0x33')][_0x0519('0x37')]));_0x2d486f['attributes']=_0x2d486f[_0x0519('0x36')][_0x0519('0x38')]?_0x2d486f[_0x0519('0x36')]:_0x2a15eb['model'];if(!_0xe0fa58[_0x0519('0x33')][_0x0519('0x39')](_0x0519('0x3a'))){_0x2d486f[_0x0519('0x1d')]=qs['limit'](_0xe0fa58[_0x0519('0x33')][_0x0519('0x1d')]);_0x2d486f[_0x0519('0x1b')]=qs[_0x0519('0x1b')](_0xe0fa58[_0x0519('0x33')]['offset']);}_0x2d486f[_0x0519('0x3b')]=qs[_0x0519('0x3c')](_0xe0fa58[_0x0519('0x33')][_0x0519('0x3c')]);_0x2d486f[_0x0519('0x3d')]=qs['filters'](_[_0x0519('0x3e')](_0xe0fa58[_0x0519('0x33')],_0x2a15eb[_0x0519('0x34')]),_0x59667b);if(_0xe0fa58[_0x0519('0x33')]['filter']){_0x2d486f[_0x0519('0x3d')]=_[_0x0519('0x3f')](_0x2d486f[_0x0519('0x3d')],{'$or':_['map'](_0x59667b,function(_0x13c40e){if(_0x13c40e[_0x0519('0x30')]!==_0x0519('0x40')){var _0x58adcd={};_0x58adcd[_0x13c40e[_0x0519('0x2a')]]={'$like':'%'+_0xe0fa58[_0x0519('0x33')][_0x0519('0x41')]+'%'};return _0x58adcd;}})});}_0x2d486f=_['merge']({},_0x2d486f,_0xe0fa58[_0x0519('0x42')]);var _0x31cadd={'where':_0x2d486f[_0x0519('0x3d')]};return db[_0x0519('0x2e')]['count'](_0x31cadd)['then'](function(_0x5a0912){_0xd5e4a5[_0x0519('0x1e')]=_0x5a0912;if(_0xe0fa58['query']['includeAll']){_0x2d486f[_0x0519('0x43')]=[{'all':!![]}];}return db[_0x0519('0x2e')][_0x0519('0x44')](_0x2d486f);})[_0x0519('0x24')](function(_0x2ad5ae){_0xd5e4a5[_0x0519('0x45')]=_0x2ad5ae;return _0xd5e4a5;})['then'](respondWithFilteredResult(_0x208eff,_0x2d486f))['catch'](handleError(_0x208eff,null));};exports['show']=function(_0x121909,_0x13c077){var _0x4dafab={'raw':!![],'where':{'id':_0x121909[_0x0519('0x46')]['id']}},_0x47fa59={};_0x47fa59['model']=_[_0x0519('0x47')](db['AnalyticExtractedReport']['rawAttributes']);_0x47fa59[_0x0519('0x33')]=_[_0x0519('0x47')](_0x121909[_0x0519('0x33')]);_0x47fa59['filters']=_[_0x0519('0x35')](_0x47fa59[_0x0519('0x32')],_0x47fa59[_0x0519('0x33')]);_0x4dafab['attributes']=_[_0x0519('0x35')](_0x47fa59[_0x0519('0x32')],qs['fields'](_0x121909[_0x0519('0x33')][_0x0519('0x37')]));_0x4dafab[_0x0519('0x36')]=_0x4dafab[_0x0519('0x36')][_0x0519('0x38')]?_0x4dafab[_0x0519('0x36')]:_0x47fa59[_0x0519('0x32')];if(_0x121909['query'][_0x0519('0x48')]){_0x4dafab[_0x0519('0x43')]=[{'all':!![]}];}_0x4dafab=_[_0x0519('0x3f')]({},_0x4dafab,_0x121909[_0x0519('0x42')]);return db['AnalyticExtractedReport'][_0x0519('0x49')](_0x4dafab)[_0x0519('0x24')](handleEntityNotFound(_0x13c077,null))['then'](respondWithResult(_0x13c077,null))[_0x0519('0x4a')](handleError(_0x13c077,null));};exports['create']=function(_0x4ad621,_0x33f376){return db[_0x0519('0x2e')][_0x0519('0x4b')](_0x4ad621['body'],{})[_0x0519('0x24')](function(_0x26bfb9){var _0x3384a2=_0x4ad621[_0x0519('0x4c')][_0x0519('0x26')]({'plain':!![]});if(!_0x3384a2)throw new Error(_0x0519('0x4d'));if(_0x3384a2[_0x0519('0x4e')]==='user'){var _0x5ae9f2=_0x26bfb9[_0x0519('0x26')]({'plain':!![]});var _0x57b37f=_0x0519('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x57b37f,'userProfileId':_0x3384a2[_0x0519('0x4f')]},'raw':!![]})[_0x0519('0x24')](function(_0x1b954b){if(_0x1b954b&&_0x1b954b['autoAssociation']===0x0){return db[_0x0519('0x50')][_0x0519('0x4b')]({'name':_0x5ae9f2[_0x0519('0x2a')],'resourceId':_0x5ae9f2['id'],'type':_0x1b954b[_0x0519('0x2a')],'sectionId':_0x1b954b['id']},{})['then'](function(){return _0x26bfb9;});}else{return _0x26bfb9;}})[_0x0519('0x4a')](function(_0x47c4e7){logger[_0x0519('0x28')](_0x0519('0x51'),_0x47c4e7);throw _0x47c4e7;});}return _0x26bfb9;})[_0x0519('0x24')](respondWithResult(_0x33f376,0xc9))['catch'](handleError(_0x33f376,null));};exports[_0x0519('0x23')]=function(_0x38b73d,_0x3e0645){if(_0x38b73d['body']['id']){delete _0x38b73d[_0x0519('0x52')]['id'];}return db[_0x0519('0x2e')][_0x0519('0x49')]({'where':{'id':_0x38b73d[_0x0519('0x46')]['id']}})[_0x0519('0x24')](handleEntityNotFound(_0x3e0645,null))['then'](saveUpdates(_0x38b73d[_0x0519('0x52')],null))[_0x0519('0x24')](respondWithResult(_0x3e0645,null))['catch'](handleError(_0x3e0645,null));};exports[_0x0519('0x25')]=function(_0x1dbb63,_0x23d1b0){return db[_0x0519('0x2e')]['find']({'where':{'id':_0x1dbb63[_0x0519('0x46')]['id']}})[_0x0519('0x24')](handleEntityNotFound(_0x23d1b0,null))['then'](removeEntity(_0x23d1b0,null))[_0x0519('0x4a')](handleError(_0x23d1b0,null));};exports['download']=function(_0x115cde,_0x1459c8,_0x1c4371){return db[_0x0519('0x2e')]['find']({'where':{'id':_0x115cde['params']['id']},'attributes':[_0x0519('0x2a'),'basename',_0x0519('0x53'),'output'],'raw':!![]})[_0x0519('0x24')](handleEntityNotFound(_0x1459c8,null))[_0x0519('0x24')](function(_0x33b66b){if(_0x33b66b){if(!fs[_0x0519('0x54')](path[_0x0519('0x55')](config[_0x0519('0x56')],_0x0519('0x57'),_0x33b66b['savename']))){throw new db[(_0x0519('0x58'))]['ValidationError'](_0x0519('0x59'));}if(_0x115cde[_0x0519('0x33')][_0x0519('0x5a')]){return _0x1459c8['sendStatus'](0xc8);}return _0x1459c8[_0x0519('0x5b')](path[_0x0519('0x55')](config[_0x0519('0x56')],_0x0519('0x57'),_0x33b66b[_0x0519('0x53')]),util[_0x0519('0x5c')](_0x0519('0x5d'),_0x33b66b[_0x0519('0x5e')]||_0x33b66b[_0x0519('0x2a')],_0x33b66b['output'][_0x0519('0x5f')]()));}})['catch'](handleError(_0x1459c8,null));};
\ No newline at end of file
+var _0xb1ba=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','json','apply','reject','save','update','then','ExtractedReports','UserProfileResource','destroy','end','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','params','download','basename','savename','output','join','root','server/files/reports','ValidationError','exists','sendStatus','format','%s.%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xb1ba,0x106));var _0xab1b=function(_0xa1bfdd,_0x1ef403){_0xa1bfdd=_0xa1bfdd-0x0;var _0x31eea3=_0xb1ba[_0xa1bfdd];return _0x31eea3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab1b('0x0'));var zipdir=require(_0xab1b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab1b('0x2'));var moment=require(_0xab1b('0x3'));var BPromise=require(_0xab1b('0x4'));var Mustache=require(_0xab1b('0x5'));var util=require(_0xab1b('0x6'));var path=require('path');var sox=require(_0xab1b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab1b('0x8'));var squel=require('squel');var crypto=require(_0xab1b('0x9'));var jsforce=require(_0xab1b('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xab1b('0xb'));var querystring=require(_0xab1b('0xc'));var Papa=require(_0xab1b('0xd'));var Redis=require(_0xab1b('0xe'));var authService=require(_0xab1b('0xf'));var qs=require(_0xab1b('0x10'));var as=require(_0xab1b('0x11'));var hardwareService=require(_0xab1b('0x12'));var logger=require(_0xab1b('0x13'))(_0xab1b('0x14'));var utils=require(_0xab1b('0x15'));var config=require(_0xab1b('0x16'));var licenseUtil=require(_0xab1b('0x17'));var db=require(_0xab1b('0x18'))['db'];function respondWithStatusCode(_0x1ec072,_0x55184e){_0x55184e=_0x55184e||0xcc;return function(_0x1eaf42){if(_0x1eaf42){return _0x1ec072['sendStatus'](_0x55184e);}return _0x1ec072[_0xab1b('0x19')](_0x55184e)['end']();};}function respondWithResult(_0x489752,_0x22fb31){_0x22fb31=_0x22fb31||0xc8;return function(_0x567086){if(_0x567086){return _0x489752['status'](_0x22fb31)['json'](_0x567086);}};}function respondWithFilteredResult(_0x2c5bea,_0x373ebb){return function(_0x3ed468){if(_0x3ed468){var _0xd3d03a=typeof _0x373ebb[_0xab1b('0x1a')]===_0xab1b('0x1b')&&typeof _0x373ebb['limit']===_0xab1b('0x1b');var _0x5b7d81=_0x3ed468[_0xab1b('0x1c')];var _0x5770d1=_0xd3d03a?0x0:_0x373ebb[_0xab1b('0x1a')];var _0x508109=_0xd3d03a?_0x3ed468[_0xab1b('0x1c')]:_0x373ebb[_0xab1b('0x1a')]+_0x373ebb[_0xab1b('0x1d')];var _0xb244f1;if(_0x508109>=_0x5b7d81){_0x508109=_0x5b7d81;_0xb244f1=0xc8;}else{_0xb244f1=0xce;}_0x2c5bea[_0xab1b('0x19')](_0xb244f1);return _0x2c5bea[_0xab1b('0x1e')]('Content-Range',_0x5770d1+'-'+_0x508109+'/'+_0x5b7d81)[_0xab1b('0x1f')](_0x3ed468);}return null;};}function patchUpdates(_0x53198a){return function(_0x1ba430){try{jsonpatch[_0xab1b('0x20')](_0x1ba430,_0x53198a,!![]);}catch(_0x1470ef){return BPromise[_0xab1b('0x21')](_0x1470ef);}return _0x1ba430[_0xab1b('0x22')]();};}function saveUpdates(_0x20a3b9,_0x5998ec){return function(_0x537643){if(_0x537643){return _0x537643[_0xab1b('0x23')](_0x20a3b9)[_0xab1b('0x24')](function(_0xa44f23){return _0xa44f23;});}return null;};}function removeEntity(_0x5dc089,_0x57a7c0){return function(_0x297360){if(_0x297360){return _0x297360['destroy']()[_0xab1b('0x24')](function(){var _0x2b8483=_0x297360['get']({'plain':!![]});var _0x20e890=_0xab1b('0x25');return db[_0xab1b('0x26')][_0xab1b('0x27')]({'where':{'type':_0x20e890,'resourceId':_0x2b8483['id']}})[_0xab1b('0x24')](function(){return _0x297360;});})[_0xab1b('0x24')](function(){_0x5dc089[_0xab1b('0x19')](0xcc)[_0xab1b('0x28')]();});}};}function handleEntityNotFound(_0x42c935,_0x38a48b){return function(_0x306889){if(!_0x306889){_0x42c935['sendStatus'](0x194);}return _0x306889;};}function handleError(_0x5ef9de,_0x18f709){_0x18f709=_0x18f709||0x1f4;return function(_0x58c7f3){logger[_0xab1b('0x29')](_0x58c7f3[_0xab1b('0x2a')]);if(_0x58c7f3[_0xab1b('0x2b')]){delete _0x58c7f3[_0xab1b('0x2b')];}_0x5ef9de['status'](_0x18f709)[_0xab1b('0x2c')](_0x58c7f3);};}exports['index']=function(_0x54b150,_0x3db762){var _0x1869f7={},_0x2abe75={},_0x2a981c={'count':0x0,'rows':[]};var _0x1baf6b=_[_0xab1b('0x2d')](db[_0xab1b('0x2e')][_0xab1b('0x2f')],function(_0xfb89b0){return{'name':_0xfb89b0[_0xab1b('0x30')],'type':_0xfb89b0[_0xab1b('0x31')][_0xab1b('0x32')]};});_0x2abe75[_0xab1b('0x33')]=_[_0xab1b('0x2d')](_0x1baf6b,'name');_0x2abe75[_0xab1b('0x34')]=_[_0xab1b('0x35')](_0x54b150[_0xab1b('0x34')]);_0x2abe75['filters']=_[_0xab1b('0x36')](_0x2abe75[_0xab1b('0x33')],_0x2abe75['query']);_0x1869f7['attributes']=_[_0xab1b('0x36')](_0x2abe75['model'],qs[_0xab1b('0x37')](_0x54b150[_0xab1b('0x34')][_0xab1b('0x37')]));_0x1869f7[_0xab1b('0x38')]=_0x1869f7['attributes'][_0xab1b('0x39')]?_0x1869f7[_0xab1b('0x38')]:_0x2abe75[_0xab1b('0x33')];if(!_0x54b150[_0xab1b('0x34')][_0xab1b('0x3a')]('nolimit')){_0x1869f7[_0xab1b('0x1d')]=qs[_0xab1b('0x1d')](_0x54b150['query'][_0xab1b('0x1d')]);_0x1869f7[_0xab1b('0x1a')]=qs[_0xab1b('0x1a')](_0x54b150[_0xab1b('0x34')]['offset']);}_0x1869f7[_0xab1b('0x3b')]=qs[_0xab1b('0x3c')](_0x54b150[_0xab1b('0x34')]['sort']);_0x1869f7['where']=qs[_0xab1b('0x3d')](_[_0xab1b('0x3e')](_0x54b150[_0xab1b('0x34')],_0x2abe75[_0xab1b('0x3d')]),_0x1baf6b);if(_0x54b150[_0xab1b('0x34')][_0xab1b('0x3f')]){_0x1869f7[_0xab1b('0x40')]=_[_0xab1b('0x41')](_0x1869f7[_0xab1b('0x40')],{'$or':_[_0xab1b('0x2d')](_0x1baf6b,function(_0x4cacae){if(_0x4cacae[_0xab1b('0x31')]!==_0xab1b('0x42')){var _0x2dc159={};_0x2dc159[_0x4cacae[_0xab1b('0x2b')]]={'$like':'%'+_0x54b150[_0xab1b('0x34')][_0xab1b('0x3f')]+'%'};return _0x2dc159;}})});}_0x1869f7=_[_0xab1b('0x41')]({},_0x1869f7,_0x54b150[_0xab1b('0x43')]);var _0x3b9fed={'where':_0x1869f7[_0xab1b('0x40')]};return db['AnalyticExtractedReport'][_0xab1b('0x1c')](_0x3b9fed)[_0xab1b('0x24')](function(_0x4cfeb0){_0x2a981c[_0xab1b('0x1c')]=_0x4cfeb0;if(_0x54b150['query'][_0xab1b('0x44')]){_0x1869f7[_0xab1b('0x45')]=[{'all':!![]}];}return db[_0xab1b('0x2e')][_0xab1b('0x46')](_0x1869f7);})['then'](function(_0x1698ed){_0x2a981c[_0xab1b('0x47')]=_0x1698ed;return _0x2a981c;})[_0xab1b('0x24')](respondWithFilteredResult(_0x3db762,_0x1869f7))[_0xab1b('0x48')](handleError(_0x3db762,null));};exports[_0xab1b('0x49')]=function(_0xb55d,_0x5285f7){var _0x3217b9={'raw':!![],'where':{'id':_0xb55d['params']['id']}},_0x1dd791={};_0x1dd791[_0xab1b('0x33')]=_[_0xab1b('0x35')](db['AnalyticExtractedReport'][_0xab1b('0x2f')]);_0x1dd791[_0xab1b('0x34')]=_[_0xab1b('0x35')](_0xb55d[_0xab1b('0x34')]);_0x1dd791[_0xab1b('0x3d')]=_['intersection'](_0x1dd791[_0xab1b('0x33')],_0x1dd791[_0xab1b('0x34')]);_0x3217b9[_0xab1b('0x38')]=_[_0xab1b('0x36')](_0x1dd791[_0xab1b('0x33')],qs[_0xab1b('0x37')](_0xb55d[_0xab1b('0x34')]['fields']));_0x3217b9[_0xab1b('0x38')]=_0x3217b9[_0xab1b('0x38')][_0xab1b('0x39')]?_0x3217b9[_0xab1b('0x38')]:_0x1dd791[_0xab1b('0x33')];if(_0xb55d[_0xab1b('0x34')][_0xab1b('0x44')]){_0x3217b9[_0xab1b('0x45')]=[{'all':!![]}];}_0x3217b9=_[_0xab1b('0x41')]({},_0x3217b9,_0xb55d[_0xab1b('0x43')]);return db[_0xab1b('0x2e')]['find'](_0x3217b9)[_0xab1b('0x24')](handleEntityNotFound(_0x5285f7,null))[_0xab1b('0x24')](respondWithResult(_0x5285f7,null))[_0xab1b('0x48')](handleError(_0x5285f7,null));};exports['create']=function(_0x22e401,_0x483fe9){return db[_0xab1b('0x2e')][_0xab1b('0x4a')](_0x22e401[_0xab1b('0x4b')],{})['then'](function(_0x251054){var _0x3af196=_0x22e401[_0xab1b('0x4c')][_0xab1b('0x4d')]({'plain':!![]});if(!_0x3af196)throw new Error(_0xab1b('0x4e'));if(_0x3af196['role']===_0xab1b('0x4c')){var _0x279fbf=_0x251054['get']({'plain':!![]});var _0x452d39=_0xab1b('0x25');return db['UserProfileSection'][_0xab1b('0x4f')]({'where':{'name':_0x452d39,'userProfileId':_0x3af196[_0xab1b('0x50')]},'raw':!![]})[_0xab1b('0x24')](function(_0x100af0){if(_0x100af0&&_0x100af0['autoAssociation']===0x0){return db[_0xab1b('0x26')][_0xab1b('0x4a')]({'name':_0x279fbf[_0xab1b('0x2b')],'resourceId':_0x279fbf['id'],'type':_0x100af0[_0xab1b('0x2b')],'sectionId':_0x100af0['id']},{})[_0xab1b('0x24')](function(){return _0x251054;});}else{return _0x251054;}})['catch'](function(_0x1ea04d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ea04d);throw _0x1ea04d;});}return _0x251054;})[_0xab1b('0x24')](respondWithResult(_0x483fe9,0xc9))[_0xab1b('0x48')](handleError(_0x483fe9,null));};exports['update']=function(_0x1a0773,_0x307d53){if(_0x1a0773[_0xab1b('0x4b')]['id']){delete _0x1a0773[_0xab1b('0x4b')]['id'];}return db[_0xab1b('0x2e')][_0xab1b('0x4f')]({'where':{'id':_0x1a0773[_0xab1b('0x51')]['id']}})[_0xab1b('0x24')](handleEntityNotFound(_0x307d53,null))[_0xab1b('0x24')](saveUpdates(_0x1a0773[_0xab1b('0x4b')],null))[_0xab1b('0x24')](respondWithResult(_0x307d53,null))[_0xab1b('0x48')](handleError(_0x307d53,null));};exports['destroy']=function(_0x541b69,_0x5f1431){return db['AnalyticExtractedReport'][_0xab1b('0x4f')]({'where':{'id':_0x541b69[_0xab1b('0x51')]['id']}})[_0xab1b('0x24')](handleEntityNotFound(_0x5f1431,null))[_0xab1b('0x24')](removeEntity(_0x5f1431,null))['catch'](handleError(_0x5f1431,null));};exports[_0xab1b('0x52')]=function(_0x3c2cd8,_0x2e8b3a,_0x3b2a58){return db[_0xab1b('0x2e')][_0xab1b('0x4f')]({'where':{'id':_0x3c2cd8[_0xab1b('0x51')]['id']},'attributes':[_0xab1b('0x2b'),_0xab1b('0x53'),_0xab1b('0x54'),_0xab1b('0x55')],'raw':!![]})[_0xab1b('0x24')](handleEntityNotFound(_0x2e8b3a,null))[_0xab1b('0x24')](function(_0x291b80){if(_0x291b80){if(!fs['existsSync'](path[_0xab1b('0x56')](config[_0xab1b('0x57')],_0xab1b('0x58'),_0x291b80['savename']))){throw new db['Sequelize'][(_0xab1b('0x59'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x3c2cd8[_0xab1b('0x34')][_0xab1b('0x5a')]){return _0x2e8b3a[_0xab1b('0x5b')](0xc8);}return _0x2e8b3a[_0xab1b('0x52')](path['join'](config['root'],_0xab1b('0x58'),_0x291b80[_0xab1b('0x54')]),util[_0xab1b('0x5c')](_0xab1b('0x5d'),_0x291b80[_0xab1b('0x53')]||_0x291b80[_0xab1b('0x2b')],_0x291b80[_0xab1b('0x55')]['toLowerCase']()));}})[_0xab1b('0x48')](handleError(_0x2e8b3a,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index cf771da..6efb315 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 _0x2a5e=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x2a5e,0xe7));var _0xe2a5=function(_0x321522,_0x15aa5a){_0x321522=_0x321522-0x0;var _0x41488d=_0x2a5e[_0x321522];return _0x41488d;};'use strict';var _=require(_0xe2a5('0x0'));var util=require(_0xe2a5('0x1'));var logger=require(_0xe2a5('0x2'))(_0xe2a5('0x3'));var moment=require(_0xe2a5('0x4'));var BPromise=require(_0xe2a5('0x5'));var rp=require(_0xe2a5('0x6'));var fs=require('fs');var path=require(_0xe2a5('0x7'));var rimraf=require(_0xe2a5('0x8'));var config=require(_0xe2a5('0x9'));var attributes=require(_0xe2a5('0xa'));module[_0xe2a5('0xb')]=function(_0x3c2611,_0x77d874){return _0x3c2611[_0xe2a5('0xc')](_0xe2a5('0xd'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1139=['../../config/logger','api','moment','request-promise','path','../../config/environment','define','AnalyticExtractedReport','lodash','util'];(function(_0x51b7c5,_0x218969){var _0x3355d7=function(_0x2cce68){while(--_0x2cce68){_0x51b7c5['push'](_0x51b7c5['shift']());}};_0x3355d7(++_0x218969);}(_0x1139,0x152));var _0x9113=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x1139[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x9113('0x0'));var util=require(_0x9113('0x1'));var logger=require(_0x9113('0x2'))(_0x9113('0x3'));var moment=require(_0x9113('0x4'));var BPromise=require('bluebird');var rp=require(_0x9113('0x5'));var fs=require('fs');var path=require(_0x9113('0x6'));var rimraf=require('rimraf');var config=require(_0x9113('0x7'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x337c89,_0x178470){return _0x337c89[_0x9113('0x8')](_0x9113('0x9'),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 8c48331..21d35f6 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 _0x15ac=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x8ec0a5,_0x2d3796){var _0x7765c1=function(_0x2ec888){while(--_0x2ec888){_0x8ec0a5['push'](_0x8ec0a5['shift']());}};_0x7765c1(++_0x2d3796);}(_0x15ac,0x68));var _0xc15a=function(_0x3dac9c,_0x4d1f97){_0x3dac9c=_0x3dac9c-0x0;var _0x51fdd0=_0x15ac[_0x3dac9c];return _0x51fdd0;};'use strict';var _=require(_0xc15a('0x0'));var util=require(_0xc15a('0x1'));var moment=require(_0xc15a('0x2'));var BPromise=require(_0xc15a('0x3'));var rs=require(_0xc15a('0x4'));var fs=require('fs');var Redis=require(_0xc15a('0x5'));var db=require(_0xc15a('0x6'))['db'];var utils=require(_0xc15a('0x7'));var logger=require(_0xc15a('0x8'))(_0xc15a('0x9'));var config=require(_0xc15a('0xa'));var jayson=require(_0xc15a('0xb'));var client=jayson[_0xc15a('0xc')][_0xc15a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2ecf28,_0x2ce9e7,_0x27e049){return new BPromise(function(_0x326275,_0x109af){return client[_0xc15a('0xe')](_0x2ecf28,_0x27e049)[_0xc15a('0xf')](function(_0x520b9c){logger['info'](_0xc15a('0x10'),_0x2ce9e7,_0xc15a('0x11'));logger[_0xc15a('0x12')](_0xc15a('0x13'),_0x2ce9e7,_0xc15a('0x11'),JSON[_0xc15a('0x14')](_0x520b9c));if(_0x520b9c[_0xc15a('0x15')]){if(_0x520b9c['error'][_0xc15a('0x16')]===0x1f4){logger[_0xc15a('0x15')](_0xc15a('0x10'),_0x2ce9e7,_0x520b9c[_0xc15a('0x15')][_0xc15a('0x17')]);return _0x109af(_0x520b9c[_0xc15a('0x15')][_0xc15a('0x17')]);}logger[_0xc15a('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2ce9e7,_0x520b9c[_0xc15a('0x15')]['message']);return _0x326275(_0x520b9c['error']['message']);}else{logger['info'](_0xc15a('0x10'),_0x2ce9e7,_0xc15a('0x11'));_0x326275(_0x520b9c[_0xc15a('0x18')]['message']);}})['catch'](function(_0x2d7d2c){logger[_0xc15a('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2ce9e7,_0x2d7d2c);_0x109af(_0x2d7d2c);});});}
\ No newline at end of file
+var _0x139b=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0x52099a,_0x5a540b){var _0x373c39=function(_0xdd3d6){while(--_0xdd3d6){_0x52099a['push'](_0x52099a['shift']());}};_0x373c39(++_0x5a540b);}(_0x139b,0x170));var _0xb139=function(_0xcac8d9,_0x1bce77){_0xcac8d9=_0xcac8d9-0x0;var _0x153371=_0x139b[_0xcac8d9];return _0x153371;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb139('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb139('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xb139('0x2'));var logger=require(_0xb139('0x3'))(_0xb139('0x4'));var config=require(_0xb139('0x5'));var jayson=require(_0xb139('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20d529,_0x171ac7,_0x5ef5e0){return new BPromise(function(_0x11e0cb,_0x327bce){return client[_0xb139('0x7')](_0x20d529,_0x5ef5e0)[_0xb139('0x8')](function(_0x62a6da){logger[_0xb139('0x9')](_0xb139('0xa'),_0x171ac7,_0xb139('0xb'));logger[_0xb139('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x171ac7,_0xb139('0xb'),JSON[_0xb139('0xd')](_0x62a6da));if(_0x62a6da['error']){if(_0x62a6da[_0xb139('0xe')]['code']===0x1f4){logger[_0xb139('0xe')](_0xb139('0xa'),_0x171ac7,_0x62a6da[_0xb139('0xe')][_0xb139('0xf')]);return _0x327bce(_0x62a6da[_0xb139('0xe')]['message']);}logger[_0xb139('0xe')](_0xb139('0xa'),_0x171ac7,_0x62a6da[_0xb139('0xe')][_0xb139('0xf')]);return _0x11e0cb(_0x62a6da[_0xb139('0xe')][_0xb139('0xf')]);}else{logger[_0xb139('0x9')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x171ac7,'request\x20sent');_0x11e0cb(_0x62a6da[_0xb139('0x10')][_0xb139('0xf')]);}})[_0xb139('0x11')](function(_0x1ad263){logger[_0xb139('0xe')](_0xb139('0xa'),_0x171ac7,_0x1ad263);_0x327bce(_0x1ad263);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 60781e5..f4ecd3d 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 _0x377f=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','index','get','show','/:id/download','isAuthenticated','download','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x105c32,_0x4ac0e5){var _0x2f8161=function(_0x1d1220){while(--_0x1d1220){_0x105c32['push'](_0x105c32['shift']());}};_0x2f8161(++_0x4ac0e5);}(_0x377f,0xb1));var _0xf377=function(_0x4be53d,_0x1f1c6e){_0x4be53d=_0x4be53d-0x0;var _0x1ae3dd=_0x377f[_0x4be53d];return _0x1ae3dd;};'use strict';var multer=require('multer');var util=require(_0xf377('0x0'));var path=require(_0xf377('0x1'));var timeout=require(_0xf377('0x2'));var express=require(_0xf377('0x3'));var router=express[_0xf377('0x4')]();var fs_extra=require(_0xf377('0x5'));var auth=require(_0xf377('0x6'));var interaction=require(_0xf377('0x7'));var config=require(_0xf377('0x8'));var controller=require(_0xf377('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf377('0xa')]);router[_0xf377('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xf377('0xc')]);router[_0xf377('0xb')](_0xf377('0xd'),auth[_0xf377('0xe')](),controller[_0xf377('0xf')]);router[_0xf377('0x10')]('/',auth[_0xf377('0xe')](),controller[_0xf377('0x11')]);router[_0xf377('0x12')](_0xf377('0x13'),auth['isAuthenticated'](),controller[_0xf377('0x14')]);router[_0xf377('0x15')](_0xf377('0x13'),auth[_0xf377('0xe')](),controller[_0xf377('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x8978=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id/download','download','post','put','/:id'];(function(_0x24ba0f,_0x3931e6){var _0x2073a6=function(_0x41d3f6){while(--_0x41d3f6){_0x24ba0f['push'](_0x24ba0f['shift']());}};_0x2073a6(++_0x3931e6);}(_0x8978,0x14d));var _0x8897=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8978[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x8897('0x0'));var util=require(_0x8897('0x1'));var path=require(_0x8897('0x2'));var timeout=require(_0x8897('0x3'));var express=require(_0x8897('0x4'));var router=express[_0x8897('0x5')]();var fs_extra=require(_0x8897('0x6'));var auth=require(_0x8897('0x7'));var interaction=require(_0x8897('0x8'));var config=require(_0x8897('0x9'));var controller=require(_0x8897('0xa'));router[_0x8897('0xb')]('/',auth[_0x8897('0xc')](),controller[_0x8897('0xd')]);router[_0x8897('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8897('0xb')](_0x8897('0xe'),auth['isAuthenticated'](),controller[_0x8897('0xf')]);router[_0x8897('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8897('0x11')](_0x8897('0x12'),auth[_0x8897('0xc')](),controller[_0x8897('0x13')]);router[_0x8897('0x14')]('/:id',auth[_0x8897('0xc')](),controller[_0x8897('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 39e90ae..7251e6f 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 _0x9fc3=['TEXT','STRING','BOOLEAN','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9fc3,0x1e3));var _0x39fc=function(_0x1f17cc,_0x52406f){_0x1f17cc=_0x1f17cc-0x0;var _0x220ef8=_0x9fc3[_0x1f17cc];return _0x220ef8;};'use strict';var Sequelize=require('sequelize');module[_0x39fc('0x0')]={'field':{'type':Sequelize[_0x39fc('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x39fc('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x39fc('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x39fc('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x6def=['BOOLEAN','exports','TEXT','STRING'];(function(_0x106bc0,_0x538f68){var _0x2aacab=function(_0x1f264d){while(--_0x1f264d){_0x106bc0['push'](_0x106bc0['shift']());}};_0x2aacab(++_0x538f68);}(_0x6def,0x7d));var _0xf6de=function(_0x4029e1,_0x45ecf6){_0x4029e1=_0x4029e1-0x0;var _0x5aa63b=_0x6def[_0x4029e1];return _0x5aa63b;};'use strict';var Sequelize=require('sequelize');module[_0xf6de('0x0')]={'field':{'type':Sequelize[_0xf6de('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xf6de('0x2')]},'groupBy':{'type':Sequelize[_0xf6de('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xf6de('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index d53e083..ffe79e5 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 _0xa6ec=['include','catch','show','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','destroy','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','offset','set','Content-Range','json','apply','save','update','then','end','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','options','count','includeAll'];(function(_0x439cea,_0x115a1c){var _0x55f8a9=function(_0x3ed1cd){while(--_0x3ed1cd){_0x439cea['push'](_0x439cea['shift']());}};_0x55f8a9(++_0x115a1c);}(_0xa6ec,0x154));var _0xca6e=function(_0x43636b,_0x4b27ff){_0x43636b=_0x43636b-0x0;var _0x1ae192=_0xa6ec[_0x43636b];return _0x1ae192;};'use strict';var emlformat=require(_0xca6e('0x0'));var rimraf=require(_0xca6e('0x1'));var zipdir=require(_0xca6e('0x2'));var jsonpatch=require(_0xca6e('0x3'));var rp=require(_0xca6e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xca6e('0x5'));var util=require(_0xca6e('0x6'));var path=require(_0xca6e('0x7'));var sox=require(_0xca6e('0x8'));var csv=require(_0xca6e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca6e('0xa'));var _=require(_0xca6e('0xb'));var squel=require(_0xca6e('0xc'));var crypto=require(_0xca6e('0xd'));var jsforce=require(_0xca6e('0xe'));var deskjs=require(_0xca6e('0xf'));var toCsv=require(_0xca6e('0x9'));var querystring=require('querystring');var Papa=require(_0xca6e('0x10'));var Redis=require(_0xca6e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xca6e('0x12'));var as=require(_0xca6e('0x13'));var hardwareService=require(_0xca6e('0x14'));var logger=require(_0xca6e('0x15'))(_0xca6e('0x16'));var utils=require(_0xca6e('0x17'));var config=require(_0xca6e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xca6e('0x19'))['db'];function respondWithStatusCode(_0x1304a7,_0xe87021){_0xe87021=_0xe87021||0xcc;return function(_0x8498fd){if(_0x8498fd){return _0x1304a7[_0xca6e('0x1a')](_0xe87021);}return _0x1304a7['status'](_0xe87021)['end']();};}function respondWithResult(_0x218c69,_0x146cd6){_0x146cd6=_0x146cd6||0xc8;return function(_0x28bde6){if(_0x28bde6){return _0x218c69[_0xca6e('0x1b')](_0x146cd6)['json'](_0x28bde6);}};}function respondWithFilteredResult(_0x1d2172,_0x129ee2){return function(_0x2849ec){if(_0x2849ec){var _0x329bdc=typeof _0x129ee2['offset']===_0xca6e('0x1c')&&typeof _0x129ee2[_0xca6e('0x1d')]==='undefined';var _0x31e341=_0x2849ec['count'];var _0x46f311=_0x329bdc?0x0:_0x129ee2[_0xca6e('0x1e')];var _0x444036=_0x329bdc?_0x2849ec['count']:_0x129ee2[_0xca6e('0x1e')]+_0x129ee2[_0xca6e('0x1d')];var _0x558f5d;if(_0x444036>=_0x31e341){_0x444036=_0x31e341;_0x558f5d=0xc8;}else{_0x558f5d=0xce;}_0x1d2172['status'](_0x558f5d);return _0x1d2172[_0xca6e('0x1f')](_0xca6e('0x20'),_0x46f311+'-'+_0x444036+'/'+_0x31e341)[_0xca6e('0x21')](_0x2849ec);}return null;};}function patchUpdates(_0xee6d0a){return function(_0x1e0526){try{jsonpatch[_0xca6e('0x22')](_0x1e0526,_0xee6d0a,!![]);}catch(_0x1396e5){return BPromise['reject'](_0x1396e5);}return _0x1e0526[_0xca6e('0x23')]();};}function saveUpdates(_0xbbe837,_0x72f532){return function(_0x8b5da2){if(_0x8b5da2){return _0x8b5da2[_0xca6e('0x24')](_0xbbe837)[_0xca6e('0x25')](function(_0x15b6c8){return _0x15b6c8;});}return null;};}function removeEntity(_0x82f4ca,_0x5558dc){return function(_0x26417a){if(_0x26417a){return _0x26417a['destroy']()[_0xca6e('0x25')](function(){_0x82f4ca[_0xca6e('0x1b')](0xcc)[_0xca6e('0x26')]();});}};}function handleEntityNotFound(_0x4cceab,_0x54186e){return function(_0x4993d7){if(!_0x4993d7){_0x4cceab[_0xca6e('0x1a')](0x194);}return _0x4993d7;};}function handleError(_0x3537b8,_0x2a15b0){_0x2a15b0=_0x2a15b0||0x1f4;return function(_0x2f1055){logger[_0xca6e('0x27')](_0x2f1055['stack']);if(_0x2f1055[_0xca6e('0x28')]){delete _0x2f1055['name'];}_0x3537b8['status'](_0x2a15b0)[_0xca6e('0x29')](_0x2f1055);};}exports[_0xca6e('0x2a')]=function(_0x457f3e,_0x445a34){var _0x38edc6={},_0x1a6c82={},_0x2e30fc={'count':0x0,'rows':[]};var _0x4938f6=_[_0xca6e('0x2b')](db[_0xca6e('0x2c')][_0xca6e('0x2d')],function(_0xd9d39f){return{'name':_0xd9d39f[_0xca6e('0x2e')],'type':_0xd9d39f['type'][_0xca6e('0x2f')]};});_0x1a6c82[_0xca6e('0x30')]=_[_0xca6e('0x2b')](_0x4938f6,_0xca6e('0x28'));_0x1a6c82['query']=_[_0xca6e('0x31')](_0x457f3e[_0xca6e('0x32')]);_0x1a6c82[_0xca6e('0x33')]=_[_0xca6e('0x34')](_0x1a6c82[_0xca6e('0x30')],_0x1a6c82[_0xca6e('0x32')]);_0x38edc6['attributes']=_[_0xca6e('0x34')](_0x1a6c82[_0xca6e('0x30')],qs[_0xca6e('0x35')](_0x457f3e['query'][_0xca6e('0x35')]));_0x38edc6['attributes']=_0x38edc6[_0xca6e('0x36')]['length']?_0x38edc6[_0xca6e('0x36')]:_0x1a6c82[_0xca6e('0x30')];if(!_0x457f3e['query'][_0xca6e('0x37')](_0xca6e('0x38'))){_0x38edc6[_0xca6e('0x1d')]=qs['limit'](_0x457f3e[_0xca6e('0x32')]['limit']);_0x38edc6['offset']=qs[_0xca6e('0x1e')](_0x457f3e[_0xca6e('0x32')]['offset']);}_0x38edc6['order']=qs[_0xca6e('0x39')](_0x457f3e['query'][_0xca6e('0x39')]);_0x38edc6['where']=qs[_0xca6e('0x33')](_['pick'](_0x457f3e['query'],_0x1a6c82[_0xca6e('0x33')]),_0x4938f6);if(_0x457f3e[_0xca6e('0x32')]['filter']){_0x38edc6[_0xca6e('0x3a')]=_[_0xca6e('0x3b')](_0x38edc6[_0xca6e('0x3a')],{'$or':_[_0xca6e('0x2b')](_0x4938f6,function(_0x27b6ac){if(_0x27b6ac[_0xca6e('0x3c')]!==_0xca6e('0x3d')){var _0x5dc61c={};_0x5dc61c[_0x27b6ac[_0xca6e('0x28')]]={'$like':'%'+_0x457f3e[_0xca6e('0x32')]['filter']+'%'};return _0x5dc61c;}})});}_0x38edc6=_[_0xca6e('0x3b')]({},_0x38edc6,_0x457f3e[_0xca6e('0x3e')]);var _0x291234={'where':_0x38edc6[_0xca6e('0x3a')]};return db[_0xca6e('0x2c')]['count'](_0x291234)['then'](function(_0x4879ca){_0x2e30fc[_0xca6e('0x3f')]=_0x4879ca;if(_0x457f3e[_0xca6e('0x32')][_0xca6e('0x40')]){_0x38edc6[_0xca6e('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x38edc6);})[_0xca6e('0x25')](function(_0x1d592a){_0x2e30fc['rows']=_0x1d592a;return _0x2e30fc;})[_0xca6e('0x25')](respondWithFilteredResult(_0x445a34,_0x38edc6))[_0xca6e('0x42')](handleError(_0x445a34,null));};exports[_0xca6e('0x43')]=function(_0x721d9d,_0x509fef){var _0x1c7e14={'raw':![],'where':{'id':_0x721d9d['params']['id']}},_0x399790={};_0x399790[_0xca6e('0x30')]=_[_0xca6e('0x31')](db['AnalyticFieldReport']['rawAttributes']);_0x399790[_0xca6e('0x32')]=_['keys'](_0x721d9d[_0xca6e('0x32')]);_0x399790[_0xca6e('0x33')]=_[_0xca6e('0x34')](_0x399790[_0xca6e('0x30')],_0x399790[_0xca6e('0x32')]);_0x1c7e14[_0xca6e('0x36')]=_[_0xca6e('0x34')](_0x399790['model'],qs[_0xca6e('0x35')](_0x721d9d[_0xca6e('0x32')][_0xca6e('0x35')]));_0x1c7e14[_0xca6e('0x36')]=_0x1c7e14[_0xca6e('0x36')]['length']?_0x1c7e14['attributes']:_0x399790[_0xca6e('0x30')];if(_0x721d9d[_0xca6e('0x32')][_0xca6e('0x40')]){_0x1c7e14[_0xca6e('0x41')]=[{'all':!![]}];}_0x1c7e14=_[_0xca6e('0x3b')]({},_0x1c7e14,_0x721d9d[_0xca6e('0x3e')]);return db[_0xca6e('0x2c')][_0xca6e('0x44')](_0x1c7e14)[_0xca6e('0x25')](handleEntityNotFound(_0x509fef,null))['then'](respondWithResult(_0x509fef,null))[_0xca6e('0x42')](handleError(_0x509fef,null));};exports['create']=function(_0x1d787f,_0x42a1c7){return db[_0xca6e('0x2c')][_0xca6e('0x45')](_0x1d787f[_0xca6e('0x46')],{})[_0xca6e('0x25')](respondWithResult(_0x42a1c7,0xc9))[_0xca6e('0x42')](handleError(_0x42a1c7,null));};exports[_0xca6e('0x47')]=function(_0x4c61df,_0x1b9564){return db['AnalyticFieldReport'][_0xca6e('0x47')](_0x4c61df[_0xca6e('0x46')],{'raw':![],'individualHooks':!![]})[_0xca6e('0x25')](respondWithResult(_0x1b9564,0xc9))[_0xca6e('0x42')](handleError(_0x1b9564,null));};exports[_0xca6e('0x24')]=function(_0x579663,_0x4e6f98){if(_0x579663['body']['id']){delete _0x579663[_0xca6e('0x46')]['id'];}return db[_0xca6e('0x2c')]['find']({'where':{'id':_0x579663['params']['id']}})[_0xca6e('0x25')](handleEntityNotFound(_0x4e6f98,null))[_0xca6e('0x25')](saveUpdates(_0x579663[_0xca6e('0x46')],null))[_0xca6e('0x25')](respondWithResult(_0x4e6f98,null))[_0xca6e('0x42')](handleError(_0x4e6f98,null));};exports['destroy']=function(_0xcc6f9d,_0x144089){return db[_0xca6e('0x2c')]['find']({'where':{'id':_0xcc6f9d[_0xca6e('0x48')]['id']}})[_0xca6e('0x25')](handleEntityNotFound(_0x144089,null))[_0xca6e('0x25')](removeEntity(_0x144089,null))[_0xca6e('0x42')](handleError(_0x144089,null));};exports[_0xca6e('0x49')]=function(_0x45e07f,_0x474bec){return db[_0xca6e('0x2c')]['destroy']({'where':{'id':_0x45e07f[_0xca6e('0x32')][_0xca6e('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xca6e('0x25')](respondWithResult(_0x474bec,0xcc))['catch'](handleError(_0x474bec,null));};exports[_0xca6e('0x4b')]=function(_0x44c5bd,_0x3f72d4,_0x4d7a63){return db[_0xca6e('0x4c')][_0xca6e('0x4d')]({'where':{'id':_0x44c5bd[_0xca6e('0x48')]['id']}})[_0xca6e('0x25')](handleEntityNotFound(_0x3f72d4,null))['then'](function(_0x250e15){if(_0x250e15){return db['sequelize'][_0xca6e('0x4e')](function(_0x54acf4){return db[_0xca6e('0x2c')][_0xca6e('0x4f')]({'where':{'CustomReportId':_0x44c5bd[_0xca6e('0x48')]['id']},'transaction':_0x54acf4})[_0xca6e('0x25')](function(_0x4d16cb){var _0x27d496=_['map'](_0x44c5bd['body'],function(_0x206dd2){delete _0x206dd2['id'];_0x206dd2[_0xca6e('0x50')]=_0x44c5bd['params']['id'];return _0x206dd2;});return db[_0xca6e('0x2c')]['bulkCreate'](_0x27d496,{'transaction':_0x54acf4});});})['then'](function(){return db[_0xca6e('0x2c')]['findAll']({'where':{'CustomReportId':_0x44c5bd[_0xca6e('0x48')]['id']}});});}})[_0xca6e('0x25')](respondWithResult(_0x3f72d4,null))[_0xca6e('0x42')](handleError(_0x3f72d4,null));};
\ No newline at end of file
+var _0x6a05=['include','findAll','catch','params','rawAttributes','options','find','create','bulkCreate','body','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','sendStatus','send','index','map','AnalyticFieldReport','fieldName','type','key','model','name','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6a05,0x191));var _0x56a0=function(_0x340da7,_0x13d6fc){_0x340da7=_0x340da7-0x0;var _0x43b466=_0x6a05[_0x340da7];return _0x43b466;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x56a0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x56a0('0x1'));var rp=require(_0x56a0('0x2'));var moment=require(_0x56a0('0x3'));var BPromise=require(_0x56a0('0x4'));var Mustache=require(_0x56a0('0x5'));var util=require('util');var path=require('path');var sox=require(_0x56a0('0x6'));var csv=require(_0x56a0('0x7'));var ejs=require(_0x56a0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x56a0('0x9'));var crypto=require(_0x56a0('0xa'));var jsforce=require(_0x56a0('0xb'));var deskjs=require(_0x56a0('0xc'));var toCsv=require(_0x56a0('0x7'));var querystring=require(_0x56a0('0xd'));var Papa=require(_0x56a0('0xe'));var Redis=require(_0x56a0('0xf'));var authService=require(_0x56a0('0x10'));var qs=require(_0x56a0('0x11'));var as=require(_0x56a0('0x12'));var hardwareService=require(_0x56a0('0x13'));var logger=require(_0x56a0('0x14'))('api');var utils=require(_0x56a0('0x15'));var config=require(_0x56a0('0x16'));var licenseUtil=require(_0x56a0('0x17'));var db=require(_0x56a0('0x18'))['db'];function respondWithStatusCode(_0x5eccd5,_0x436e91){_0x436e91=_0x436e91||0xcc;return function(_0xdf36b0){if(_0xdf36b0){return _0x5eccd5['sendStatus'](_0x436e91);}return _0x5eccd5['status'](_0x436e91)[_0x56a0('0x19')]();};}function respondWithResult(_0x518ef2,_0x35e7dd){_0x35e7dd=_0x35e7dd||0xc8;return function(_0x11d814){if(_0x11d814){return _0x518ef2[_0x56a0('0x1a')](_0x35e7dd)[_0x56a0('0x1b')](_0x11d814);}};}function respondWithFilteredResult(_0x5aec68,_0x3ea2b7){return function(_0x516ff4){if(_0x516ff4){var _0x5edd6b=typeof _0x3ea2b7[_0x56a0('0x1c')]===_0x56a0('0x1d')&&typeof _0x3ea2b7[_0x56a0('0x1e')]===_0x56a0('0x1d');var _0xfee832=_0x516ff4[_0x56a0('0x1f')];var _0x326a74=_0x5edd6b?0x0:_0x3ea2b7[_0x56a0('0x1c')];var _0x36b06f=_0x5edd6b?_0x516ff4[_0x56a0('0x1f')]:_0x3ea2b7[_0x56a0('0x1c')]+_0x3ea2b7['limit'];var _0x5691b9;if(_0x36b06f>=_0xfee832){_0x36b06f=_0xfee832;_0x5691b9=0xc8;}else{_0x5691b9=0xce;}_0x5aec68['status'](_0x5691b9);return _0x5aec68['set']('Content-Range',_0x326a74+'-'+_0x36b06f+'/'+_0xfee832)[_0x56a0('0x1b')](_0x516ff4);}return null;};}function patchUpdates(_0x56e452){return function(_0x181702){try{jsonpatch[_0x56a0('0x20')](_0x181702,_0x56e452,!![]);}catch(_0x203f12){return BPromise[_0x56a0('0x21')](_0x203f12);}return _0x181702[_0x56a0('0x22')]();};}function saveUpdates(_0x15defa,_0x5f3dac){return function(_0x4013c4){if(_0x4013c4){return _0x4013c4['update'](_0x15defa)[_0x56a0('0x23')](function(_0x5dca50){return _0x5dca50;});}return null;};}function removeEntity(_0x53ddc6,_0x5673ff){return function(_0x52df0f){if(_0x52df0f){return _0x52df0f[_0x56a0('0x24')]()[_0x56a0('0x23')](function(){_0x53ddc6[_0x56a0('0x1a')](0xcc)[_0x56a0('0x19')]();});}};}function handleEntityNotFound(_0x269464,_0x829957){return function(_0x55e959){if(!_0x55e959){_0x269464[_0x56a0('0x25')](0x194);}return _0x55e959;};}function handleError(_0x658c9f,_0x322747){_0x322747=_0x322747||0x1f4;return function(_0x2819df){logger['error'](_0x2819df['stack']);if(_0x2819df['name']){delete _0x2819df['name'];}_0x658c9f[_0x56a0('0x1a')](_0x322747)[_0x56a0('0x26')](_0x2819df);};}exports[_0x56a0('0x27')]=function(_0x53d782,_0x222734){var _0x405f7c={},_0x4f4477={},_0x5f4bc5={'count':0x0,'rows':[]};var _0x3208f9=_[_0x56a0('0x28')](db[_0x56a0('0x29')]['rawAttributes'],function(_0x3572d3){return{'name':_0x3572d3[_0x56a0('0x2a')],'type':_0x3572d3[_0x56a0('0x2b')][_0x56a0('0x2c')]};});_0x4f4477[_0x56a0('0x2d')]=_['map'](_0x3208f9,_0x56a0('0x2e'));_0x4f4477['query']=_[_0x56a0('0x2f')](_0x53d782[_0x56a0('0x30')]);_0x4f4477['filters']=_[_0x56a0('0x31')](_0x4f4477[_0x56a0('0x2d')],_0x4f4477[_0x56a0('0x30')]);_0x405f7c[_0x56a0('0x32')]=_['intersection'](_0x4f4477[_0x56a0('0x2d')],qs[_0x56a0('0x33')](_0x53d782['query'][_0x56a0('0x33')]));_0x405f7c[_0x56a0('0x32')]=_0x405f7c[_0x56a0('0x32')]['length']?_0x405f7c[_0x56a0('0x32')]:_0x4f4477[_0x56a0('0x2d')];if(!_0x53d782[_0x56a0('0x30')][_0x56a0('0x34')](_0x56a0('0x35'))){_0x405f7c[_0x56a0('0x1e')]=qs['limit'](_0x53d782[_0x56a0('0x30')][_0x56a0('0x1e')]);_0x405f7c['offset']=qs[_0x56a0('0x1c')](_0x53d782['query'][_0x56a0('0x1c')]);}_0x405f7c[_0x56a0('0x36')]=qs['sort'](_0x53d782[_0x56a0('0x30')][_0x56a0('0x37')]);_0x405f7c[_0x56a0('0x38')]=qs['filters'](_[_0x56a0('0x39')](_0x53d782[_0x56a0('0x30')],_0x4f4477['filters']),_0x3208f9);if(_0x53d782['query'][_0x56a0('0x3a')]){_0x405f7c['where']=_[_0x56a0('0x3b')](_0x405f7c['where'],{'$or':_['map'](_0x3208f9,function(_0x2e6f61){if(_0x2e6f61[_0x56a0('0x2b')]!=='VIRTUAL'){var _0x3bf902={};_0x3bf902[_0x2e6f61[_0x56a0('0x2e')]]={'$like':'%'+_0x53d782[_0x56a0('0x30')][_0x56a0('0x3a')]+'%'};return _0x3bf902;}})});}_0x405f7c=_['merge']({},_0x405f7c,_0x53d782['options']);var _0x2b7149={'where':_0x405f7c[_0x56a0('0x38')]};return db[_0x56a0('0x29')][_0x56a0('0x1f')](_0x2b7149)[_0x56a0('0x23')](function(_0x5cd0d1){_0x5f4bc5[_0x56a0('0x1f')]=_0x5cd0d1;if(_0x53d782[_0x56a0('0x30')][_0x56a0('0x3c')]){_0x405f7c[_0x56a0('0x3d')]=[{'all':!![]}];}return db[_0x56a0('0x29')][_0x56a0('0x3e')](_0x405f7c);})[_0x56a0('0x23')](function(_0x4194b0){_0x5f4bc5['rows']=_0x4194b0;return _0x5f4bc5;})[_0x56a0('0x23')](respondWithFilteredResult(_0x222734,_0x405f7c))[_0x56a0('0x3f')](handleError(_0x222734,null));};exports['show']=function(_0x45286d,_0x57e437){var _0x103ac7={'raw':![],'where':{'id':_0x45286d[_0x56a0('0x40')]['id']}},_0x3ce993={};_0x3ce993[_0x56a0('0x2d')]=_['keys'](db[_0x56a0('0x29')][_0x56a0('0x41')]);_0x3ce993[_0x56a0('0x30')]=_[_0x56a0('0x2f')](_0x45286d[_0x56a0('0x30')]);_0x3ce993['filters']=_[_0x56a0('0x31')](_0x3ce993[_0x56a0('0x2d')],_0x3ce993['query']);_0x103ac7[_0x56a0('0x32')]=_[_0x56a0('0x31')](_0x3ce993['model'],qs['fields'](_0x45286d[_0x56a0('0x30')][_0x56a0('0x33')]));_0x103ac7['attributes']=_0x103ac7['attributes']['length']?_0x103ac7[_0x56a0('0x32')]:_0x3ce993['model'];if(_0x45286d[_0x56a0('0x30')]['includeAll']){_0x103ac7[_0x56a0('0x3d')]=[{'all':!![]}];}_0x103ac7=_[_0x56a0('0x3b')]({},_0x103ac7,_0x45286d[_0x56a0('0x42')]);return db['AnalyticFieldReport'][_0x56a0('0x43')](_0x103ac7)[_0x56a0('0x23')](handleEntityNotFound(_0x57e437,null))[_0x56a0('0x23')](respondWithResult(_0x57e437,null))[_0x56a0('0x3f')](handleError(_0x57e437,null));};exports[_0x56a0('0x44')]=function(_0x5be807,_0x3ca749){return db[_0x56a0('0x29')][_0x56a0('0x44')](_0x5be807['body'],{})[_0x56a0('0x23')](respondWithResult(_0x3ca749,0xc9))['catch'](handleError(_0x3ca749,null));};exports[_0x56a0('0x45')]=function(_0x5c4c7e,_0x2aee47){return db[_0x56a0('0x29')][_0x56a0('0x45')](_0x5c4c7e[_0x56a0('0x46')],{'raw':![],'individualHooks':!![]})[_0x56a0('0x23')](respondWithResult(_0x2aee47,0xc9))[_0x56a0('0x3f')](handleError(_0x2aee47,null));};exports['update']=function(_0x5c02a8,_0xfdfb6d){if(_0x5c02a8[_0x56a0('0x46')]['id']){delete _0x5c02a8[_0x56a0('0x46')]['id'];}return db[_0x56a0('0x29')][_0x56a0('0x43')]({'where':{'id':_0x5c02a8['params']['id']}})['then'](handleEntityNotFound(_0xfdfb6d,null))[_0x56a0('0x23')](saveUpdates(_0x5c02a8[_0x56a0('0x46')],null))[_0x56a0('0x23')](respondWithResult(_0xfdfb6d,null))[_0x56a0('0x3f')](handleError(_0xfdfb6d,null));};exports[_0x56a0('0x24')]=function(_0x152e7d,_0x703acb){return db[_0x56a0('0x29')][_0x56a0('0x43')]({'where':{'id':_0x152e7d['params']['id']}})[_0x56a0('0x23')](handleEntityNotFound(_0x703acb,null))[_0x56a0('0x23')](removeEntity(_0x703acb,null))[_0x56a0('0x3f')](handleError(_0x703acb,null));};exports[_0x56a0('0x47')]=function(_0x3464d3,_0x370ddc){return db[_0x56a0('0x29')]['destroy']({'where':{'id':_0x3464d3[_0x56a0('0x30')][_0x56a0('0x48')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x370ddc,0xcc))['catch'](handleError(_0x370ddc,null));};exports['addFields']=function(_0x27c2e0,_0x49c282,_0x1a7f21){return db[_0x56a0('0x49')][_0x56a0('0x4a')]({'where':{'id':_0x27c2e0[_0x56a0('0x40')]['id']}})[_0x56a0('0x23')](handleEntityNotFound(_0x49c282,null))[_0x56a0('0x23')](function(_0x486e36){if(_0x486e36){return db[_0x56a0('0x4b')][_0x56a0('0x4c')](function(_0x51b999){return db[_0x56a0('0x29')][_0x56a0('0x24')]({'where':{'CustomReportId':_0x27c2e0[_0x56a0('0x40')]['id']},'transaction':_0x51b999})[_0x56a0('0x23')](function(_0x380437){var _0x450164=_[_0x56a0('0x28')](_0x27c2e0[_0x56a0('0x46')],function(_0x2c522c){delete _0x2c522c['id'];_0x2c522c['CustomReportId']=_0x27c2e0[_0x56a0('0x40')]['id'];return _0x2c522c;});return db[_0x56a0('0x29')]['bulkCreate'](_0x450164,{'transaction':_0x51b999});});})['then'](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x27c2e0[_0x56a0('0x40')]['id']}});});}})['then'](respondWithResult(_0x49c282,null))['catch'](handleError(_0x49c282,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 847b8ea..752b3dd 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 _0x6c02=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','request-promise','path','../../config/environment','./analyticFieldReport.attributes'];(function(_0x3bb193,_0xb9fe51){var _0x2be1b9=function(_0x1be0c1){while(--_0x1be0c1){_0x3bb193['push'](_0x3bb193['shift']());}};_0x2be1b9(++_0xb9fe51);}(_0x6c02,0xac));var _0x26c0=function(_0xaa7b9b,_0x30497b){_0xaa7b9b=_0xaa7b9b-0x0;var _0x164b66=_0x6c02[_0xaa7b9b];return _0x164b66;};'use strict';var _=require(_0x26c0('0x0'));var util=require(_0x26c0('0x1'));var logger=require('../../config/logger')(_0x26c0('0x2'));var moment=require(_0x26c0('0x3'));var BPromise=require('bluebird');var rp=require(_0x26c0('0x4'));var fs=require('fs');var path=require(_0x26c0('0x5'));var rimraf=require('rimraf');var config=require(_0x26c0('0x6'));var attributes=require(_0x26c0('0x7'));module[_0x26c0('0x8')]=function(_0x5e6215,_0xb2ab64){return _0x5e6215[_0x26c0('0x9')](_0x26c0('0xa'),attributes,{'tableName':_0x26c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6e3f=['lodash','util','api','rimraf','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields'];(function(_0x4311df,_0x48f408){var _0x541f11=function(_0x44add3){while(--_0x44add3){_0x4311df['push'](_0x4311df['shift']());}};_0x541f11(++_0x48f408);}(_0x6e3f,0x1c8));var _0xf6e3=function(_0x5828ee,_0x32b7b7){_0x5828ee=_0x5828ee-0x0;var _0x44d57c=_0x6e3f[_0x5828ee];return _0x44d57c;};'use strict';var _=require(_0xf6e3('0x0'));var util=require(_0xf6e3('0x1'));var logger=require('../../config/logger')(_0xf6e3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf6e3('0x3'));var config=require(_0xf6e3('0x4'));var attributes=require(_0xf6e3('0x5'));module['exports']=function(_0x224be7,_0x4944d7){return _0x224be7['define'](_0xf6e3('0x6'),attributes,{'tableName':_0xf6e3('0x7'),'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 e22489b..154976c 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 _0x2218=['request\x20sent','stringify','error','code','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s'];(function(_0x1216f6,_0x1294cb){var _0x9ca0e1=function(_0x3c378e){while(--_0x3c378e){_0x1216f6['push'](_0x1216f6['shift']());}};_0x9ca0e1(++_0x1294cb);}(_0x2218,0x135));var _0x8221=function(_0x19f9e6,_0x4f59a6){_0x19f9e6=_0x19f9e6-0x0;var _0x45c862=_0x2218[_0x19f9e6];return _0x45c862;};'use strict';var _=require(_0x8221('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8221('0x1'));var rs=require(_0x8221('0x2'));var fs=require('fs');var Redis=require(_0x8221('0x3'));var db=require(_0x8221('0x4'))['db'];var utils=require(_0x8221('0x5'));var logger=require('../../config/logger')(_0x8221('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d65c3,_0x53a1d6,_0x16fa64){return new BPromise(function(_0x785334,_0x5d87d6){return client['request'](_0x1d65c3,_0x16fa64)[_0x8221('0x7')](function(_0xe19449){logger[_0x8221('0x8')](_0x8221('0x9'),_0x53a1d6,'request\x20sent');logger['debug'](_0x8221('0xa'),_0x53a1d6,_0x8221('0xb'),JSON[_0x8221('0xc')](_0xe19449));if(_0xe19449[_0x8221('0xd')]){if(_0xe19449[_0x8221('0xd')][_0x8221('0xe')]===0x1f4){logger['error'](_0x8221('0x9'),_0x53a1d6,_0xe19449['error'][_0x8221('0xf')]);return _0x5d87d6(_0xe19449['error']['message']);}logger[_0x8221('0xd')](_0x8221('0x9'),_0x53a1d6,_0xe19449[_0x8221('0xd')][_0x8221('0xf')]);return _0x785334(_0xe19449[_0x8221('0xd')][_0x8221('0xf')]);}else{logger['info'](_0x8221('0x9'),_0x53a1d6,'request\x20sent');_0x785334(_0xe19449['result'][_0x8221('0xf')]);}})['catch'](function(_0x309e92){logger[_0x8221('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x53a1d6,_0x309e92);_0x5d87d6(_0x309e92);});});}
\ No newline at end of file
+var _0xde2d=['lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch'];(function(_0x55f2e3,_0x48f995){var _0x224637=function(_0x503fa0){while(--_0x503fa0){_0x55f2e3['push'](_0x55f2e3['shift']());}};_0x224637(++_0x48f995);}(_0xde2d,0xf0));var _0xdde2=function(_0x4ba102,_0x3dc213){_0x4ba102=_0x4ba102-0x0;var _0x1f35e7=_0xde2d[_0x4ba102];return _0x1f35e7;};'use strict';var _=require(_0xdde2('0x0'));var util=require(_0xdde2('0x1'));var moment=require('moment');var BPromise=require(_0xdde2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdde2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdde2('0x4'))(_0xdde2('0x5'));var config=require(_0xdde2('0x6'));var jayson=require(_0xdde2('0x7'));var client=jayson['client'][_0xdde2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44158b,_0x354575,_0xad0e37){return new BPromise(function(_0x1e1a7d,_0x324ec8){return client[_0xdde2('0x9')](_0x44158b,_0xad0e37)[_0xdde2('0xa')](function(_0x349f6c){logger[_0xdde2('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x354575,'request\x20sent');logger['debug'](_0xdde2('0xc'),_0x354575,_0xdde2('0xd'),JSON['stringify'](_0x349f6c));if(_0x349f6c[_0xdde2('0xe')]){if(_0x349f6c[_0xdde2('0xe')][_0xdde2('0xf')]===0x1f4){logger[_0xdde2('0xe')](_0xdde2('0x10'),_0x354575,_0x349f6c[_0xdde2('0xe')]['message']);return _0x324ec8(_0x349f6c[_0xdde2('0xe')][_0xdde2('0x11')]);}logger[_0xdde2('0xe')](_0xdde2('0x10'),_0x354575,_0x349f6c[_0xdde2('0xe')][_0xdde2('0x11')]);return _0x1e1a7d(_0x349f6c[_0xdde2('0xe')]['message']);}else{logger[_0xdde2('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x354575,_0xdde2('0xd'));_0x1e1a7d(_0x349f6c[_0xdde2('0x12')][_0xdde2('0x11')]);}})[_0xdde2('0x13')](function(_0x17384d){logger[_0xdde2('0xe')](_0xdde2('0x10'),_0x354575,_0x17384d);_0x324ec8(_0x17384d);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 02e36b2..d987c7b 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(_0x18494a,_0xffb015){var _0x4eaf8b=function(_0x31f90b){while(--_0x31f90b){_0x18494a['push'](_0x18494a['shift']());}};_0x4eaf8b(++_0xffb015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x5653dd,_0x35bc61){var _0x5c80c2=function(_0x7f652e){while(--_0x7f652e){_0x5653dd['push'](_0x5653dd['shift']());}};_0x5c80c2(++_0x35bc61);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 67050b7..76d908b 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 _0x7df3=['sequelize','exports','name','TEXT'];(function(_0xfd49b6,_0x595107){var _0x2a8440=function(_0x47b899){while(--_0x47b899){_0xfd49b6['push'](_0xfd49b6['shift']());}};_0x2a8440(++_0x595107);}(_0x7df3,0x1cc));var _0x37df=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x7df3[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0x37df('0x0'));module[_0x37df('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x37df('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x37df('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7229=['STRING','name','sequelize','exports'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0x7229,0x76));var _0x9722=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7229[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require(_0x9722('0x0'));module[_0x9722('0x1')]={'name':{'type':Sequelize[_0x9722('0x2')],'allowNull':![],'unique':_0x9722('0x3')},'table':{'type':Sequelize[_0x9722('0x2')]},'metric':{'type':Sequelize['TEXT']},'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 0ea1ca6..d445224 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 _0xa41a=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Metrics','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','send','map','AnalyticMetric','type','key','model','query','keys','intersection','fields'];(function(_0x2db0ef,_0x53c76b){var _0x1a32ac=function(_0x374575){while(--_0x374575){_0x2db0ef['push'](_0x2db0ef['shift']());}};_0x1a32ac(++_0x53c76b);}(_0xa41a,0x6b));var _0xaa41=function(_0x56e317,_0x439b49){_0x56e317=_0x56e317-0x0;var _0x2fc321=_0xa41a[_0x56e317];return _0x2fc321;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){var _0x5c3074=_0x21f596['get']({'plain':!![]});var _0x16aec5='Metrics';return db['UserProfileResource'][_0xaa41('0x24')]({'where':{'type':_0x16aec5,'resourceId':_0x5c3074['id']}})['then'](function(){return _0x21f596;});})['then'](function(){_0x43a85c[_0xaa41('0x1a')](0xcc)[_0xaa41('0x1b')]();});}};}function handleEntityNotFound(_0x392214,_0x632fd2){return function(_0x3f5272){if(!_0x3f5272){_0x392214[_0xaa41('0x19')](0x194);}return _0x3f5272;};}function handleError(_0x57ef96,_0x30a174){_0x30a174=_0x30a174||0x1f4;return function(_0x1f0275){logger[_0xaa41('0x26')](_0x1f0275[_0xaa41('0x27')]);if(_0x1f0275[_0xaa41('0x28')]){delete _0x1f0275[_0xaa41('0x28')];}_0x57ef96[_0xaa41('0x1a')](_0x30a174)[_0xaa41('0x29')](_0x1f0275);};}exports['index']=function(_0x377add,_0x48b48b){var _0x5dad80={},_0x714537={},_0x1176bd={'count':0x0,'rows':[]};var _0x534a85=_[_0xaa41('0x2a')](db[_0xaa41('0x2b')]['rawAttributes'],function(_0x5022fb){return{'name':_0x5022fb['fieldName'],'type':_0x5022fb[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x714537[_0xaa41('0x2e')]=_[_0xaa41('0x2a')](_0x534a85,'name');_0x714537[_0xaa41('0x2f')]=_[_0xaa41('0x30')](_0x377add[_0xaa41('0x2f')]);_0x714537['filters']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],_0x714537[_0xaa41('0x2f')]);_0x5dad80['attributes']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],qs['fields'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x5dad80[_0xaa41('0x33')]=_0x5dad80['attributes'][_0xaa41('0x34')]?_0x5dad80['attributes']:_0x714537[_0xaa41('0x2e')];if(!_0x377add[_0xaa41('0x2f')][_0xaa41('0x35')]('nolimit')){_0x5dad80['limit']=qs['limit'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x1e')]);_0x5dad80[_0xaa41('0x20')]=qs[_0xaa41('0x20')](_0x377add['query']['offset']);}_0x5dad80[_0xaa41('0x36')]=qs[_0xaa41('0x37')](_0x377add[_0xaa41('0x2f')][_0xaa41('0x37')]);_0x5dad80[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_[_0xaa41('0x3a')](_0x377add['query'],_0x714537[_0xaa41('0x39')]),_0x534a85);if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]){_0x5dad80[_0xaa41('0x38')]=_['merge'](_0x5dad80['where'],{'$or':_[_0xaa41('0x2a')](_0x534a85,function(_0x275fa3){if(_0x275fa3['type']!==_0xaa41('0x3c')){var _0x563687={};_0x563687[_0x275fa3[_0xaa41('0x28')]]={'$like':'%'+_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]+'%'};return _0x563687;}})});}_0x5dad80=_[_0xaa41('0x3d')]({},_0x5dad80,_0x377add[_0xaa41('0x3e')]);var _0x12ba1a={'where':_0x5dad80[_0xaa41('0x38')]};return db[_0xaa41('0x2b')]['count'](_0x12ba1a)[_0xaa41('0x25')](function(_0x2abf39){_0x1176bd[_0xaa41('0x1f')]=_0x2abf39;if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x5dad80[_0xaa41('0x40')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5dad80);})[_0xaa41('0x25')](function(_0x4f9086){_0x1176bd[_0xaa41('0x41')]=_0x4f9086;return _0x1176bd;})[_0xaa41('0x25')](respondWithFilteredResult(_0x48b48b,_0x5dad80))[_0xaa41('0x42')](handleError(_0x48b48b,null));};exports[_0xaa41('0x43')]=function(_0x2aac10,_0x10bf09){var _0x2db8d6={'raw':!![],'where':{'id':_0x2aac10[_0xaa41('0x44')]['id']}},_0x5ee74c={};_0x5ee74c['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0x5ee74c['query']=_['keys'](_0x2aac10[_0xaa41('0x2f')]);_0x5ee74c['filters']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],_0x5ee74c['query']);_0x2db8d6['attributes']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],qs[_0xaa41('0x32')](_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x2db8d6[_0xaa41('0x33')]=_0x2db8d6[_0xaa41('0x33')][_0xaa41('0x34')]?_0x2db8d6[_0xaa41('0x33')]:_0x5ee74c['model'];if(_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x2db8d6[_0xaa41('0x40')]=[{'all':!![]}];}_0x2db8d6=_[_0xaa41('0x3d')]({},_0x2db8d6,_0x2aac10[_0xaa41('0x3e')]);return db[_0xaa41('0x2b')]['find'](_0x2db8d6)[_0xaa41('0x25')](handleEntityNotFound(_0x10bf09,null))[_0xaa41('0x25')](respondWithResult(_0x10bf09,null))[_0xaa41('0x42')](handleError(_0x10bf09,null));};exports[_0xaa41('0x45')]=function(_0x57d1f6,_0x23bc61){return db['AnalyticMetric']['create'](_0x57d1f6[_0xaa41('0x46')],{})[_0xaa41('0x25')](function(_0x3e16ef){var _0x4ca114=_0x57d1f6[_0xaa41('0x47')][_0xaa41('0x48')]({'plain':!![]});if(!_0x4ca114)throw new Error(_0xaa41('0x49'));if(_0x4ca114['role']===_0xaa41('0x47')){var _0x3c4f24=_0x3e16ef[_0xaa41('0x48')]({'plain':!![]});var _0x1378f9=_0xaa41('0x4a');return db[_0xaa41('0x4b')][_0xaa41('0x4c')]({'where':{'name':_0x1378f9,'userProfileId':_0x4ca114[_0xaa41('0x4d')]},'raw':!![]})['then'](function(_0x9f0a81){if(_0x9f0a81&&_0x9f0a81['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x45')]({'name':_0x3c4f24[_0xaa41('0x28')],'resourceId':_0x3c4f24['id'],'type':_0x9f0a81[_0xaa41('0x28')],'sectionId':_0x9f0a81['id']},{})[_0xaa41('0x25')](function(){return _0x3e16ef;});}else{return _0x3e16ef;}})[_0xaa41('0x42')](function(_0x288db3){logger[_0xaa41('0x26')](_0xaa41('0x4e'),_0x288db3);throw _0x288db3;});}return _0x3e16ef;})['then'](respondWithResult(_0x23bc61,0xc9))[_0xaa41('0x42')](handleError(_0x23bc61,null));};exports[_0xaa41('0x23')]=function(_0x1d518f,_0x4f9e92){if(_0x1d518f[_0xaa41('0x46')]['id']){delete _0x1d518f[_0xaa41('0x46')]['id'];}return db['AnalyticMetric'][_0xaa41('0x4c')]({'where':{'id':_0x1d518f[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x4f9e92,null))['then'](saveUpdates(_0x1d518f[_0xaa41('0x46')],null))[_0xaa41('0x25')](respondWithResult(_0x4f9e92,null))['catch'](handleError(_0x4f9e92,null));};exports['destroy']=function(_0x3745ed,_0x3cd14f){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x3745ed[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x3cd14f,null))[_0xaa41('0x25')](removeEntity(_0x3cd14f,null))[_0xaa41('0x42')](handleError(_0x3cd14f,null));};
\ No newline at end of file
+var _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x3e4285,_0x83a4f0){var _0xce09e7=function(_0x2f13ee){while(--_0x2f13ee){_0x3e4285['push'](_0x3e4285['shift']());}};_0xce09e7(++_0x83a4f0);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3a1a37,_0x502c8c){_0x3a1a37=_0x3a1a37-0x0;var _0x29e31e=_0x9c5a[_0x3a1a37];return _0x29e31e;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index c13394f..694c89b 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 _0xea31=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','exports','define','analytics_metrics','lodash'];(function(_0x3c565e,_0x2b5578){var _0x40641b=function(_0x2d6b5b){while(--_0x2d6b5b){_0x3c565e['push'](_0x3c565e['shift']());}};_0x40641b(++_0x2b5578);}(_0xea31,0x6b));var _0x1ea3=function(_0x90d010,_0x217e9d){_0x90d010=_0x90d010-0x0;var _0x55ea69=_0xea31[_0x90d010];return _0x55ea69;};'use strict';var _=require(_0x1ea3('0x0'));var util=require('util');var logger=require(_0x1ea3('0x1'))(_0x1ea3('0x2'));var moment=require(_0x1ea3('0x3'));var BPromise=require(_0x1ea3('0x4'));var rp=require(_0x1ea3('0x5'));var fs=require('fs');var path=require(_0x1ea3('0x6'));var rimraf=require(_0x1ea3('0x7'));var config=require('../../config/environment');var attributes=require(_0x1ea3('0x8'));module[_0x1ea3('0x9')]=function(_0x6810da,_0x27c695){return _0x6810da[_0x1ea3('0xa')]('AnalyticMetric',attributes,{'tableName':_0x1ea3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f3f=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics'];(function(_0x4119ff,_0x2a24c4){var _0xb9058b=function(_0x30ea74){while(--_0x30ea74){_0x4119ff['push'](_0x4119ff['shift']());}};_0xb9058b(++_0x2a24c4);}(_0x7f3f,0x1c8));var _0xf7f3=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0x7f3f[_0xe45118];return _0x15e15d;};'use strict';var _=require(_0xf7f3('0x0'));var util=require(_0xf7f3('0x1'));var logger=require('../../config/logger')(_0xf7f3('0x2'));var moment=require(_0xf7f3('0x3'));var BPromise=require(_0xf7f3('0x4'));var rp=require(_0xf7f3('0x5'));var fs=require('fs');var path=require(_0xf7f3('0x6'));var rimraf=require('rimraf');var config=require(_0xf7f3('0x7'));var attributes=require(_0xf7f3('0x8'));module['exports']=function(_0x163eab,_0x2c1059){return _0x163eab[_0xf7f3('0x9')](_0xf7f3('0xa'),attributes,{'tableName':_0xf7f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 4585f14..bc6e5e8 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 _0x7e7c=['bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','info','catch','lodash','util','moment'];(function(_0x2568bb,_0x283d45){var _0x435f7c=function(_0x3ce797){while(--_0x3ce797){_0x2568bb['push'](_0x2568bb['shift']());}};_0x435f7c(++_0x283d45);}(_0x7e7c,0x179));var _0xc7e7=function(_0xa3fadc,_0xd1e16){_0xa3fadc=_0xa3fadc-0x0;var _0x23ecb8=_0x7e7c[_0xa3fadc];return _0x23ecb8;};'use strict';var _=require(_0xc7e7('0x0'));var util=require(_0xc7e7('0x1'));var moment=require(_0xc7e7('0x2'));var BPromise=require(_0xc7e7('0x3'));var rs=require(_0xc7e7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc7e7('0x5'))(_0xc7e7('0x6'));var config=require(_0xc7e7('0x7'));var jayson=require(_0xc7e7('0x8'));var client=jayson[_0xc7e7('0x9')][_0xc7e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ac9a3,_0x393f06,_0x40a834){return new BPromise(function(_0x3aacf2,_0x789d20){return client[_0xc7e7('0xb')](_0x2ac9a3,_0x40a834)['then'](function(_0x3f487b){logger['info'](_0xc7e7('0xc'),_0x393f06,_0xc7e7('0xd'));logger['debug'](_0xc7e7('0xe'),_0x393f06,_0xc7e7('0xd'),JSON['stringify'](_0x3f487b));if(_0x3f487b[_0xc7e7('0xf')]){if(_0x3f487b[_0xc7e7('0xf')]['code']===0x1f4){logger['error'](_0xc7e7('0xc'),_0x393f06,_0x3f487b[_0xc7e7('0xf')][_0xc7e7('0x10')]);return _0x789d20(_0x3f487b['error'][_0xc7e7('0x10')]);}logger[_0xc7e7('0xf')](_0xc7e7('0xc'),_0x393f06,_0x3f487b[_0xc7e7('0xf')]['message']);return _0x3aacf2(_0x3f487b[_0xc7e7('0xf')][_0xc7e7('0x10')]);}else{logger[_0xc7e7('0x11')](_0xc7e7('0xc'),_0x393f06,_0xc7e7('0xd'));_0x3aacf2(_0x3f487b['result']['message']);}})[_0xc7e7('0x12')](function(_0xf04e8e){logger[_0xc7e7('0xf')](_0xc7e7('0xc'),_0x393f06,_0xf04e8e);_0x789d20(_0xf04e8e);});});}
\ No newline at end of file
+var _0x6e25=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xd90f55,_0x48ac96){var _0x2bfc02=function(_0x2e752d){while(--_0x2e752d){_0xd90f55['push'](_0xd90f55['shift']());}};_0x2bfc02(++_0x48ac96);}(_0x6e25,0xb3));var _0x56e2=function(_0x1b8d87,_0x4168fb){_0x1b8d87=_0x1b8d87-0x0;var _0x182b74=_0x6e25[_0x1b8d87];return _0x182b74;};'use strict';var _=require(_0x56e2('0x0'));var util=require(_0x56e2('0x1'));var moment=require(_0x56e2('0x2'));var BPromise=require(_0x56e2('0x3'));var rs=require(_0x56e2('0x4'));var fs=require('fs');var Redis=require(_0x56e2('0x5'));var db=require(_0x56e2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x56e2('0x7'))(_0x56e2('0x8'));var config=require(_0x56e2('0x9'));var jayson=require(_0x56e2('0xa'));var client=jayson[_0x56e2('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bc353,_0x22c6ef,_0x216b4a){return new BPromise(function(_0x593446,_0x341f66){return client['request'](_0x3bc353,_0x216b4a)[_0x56e2('0xc')](function(_0x56c56e){logger[_0x56e2('0xd')](_0x56e2('0xe'),_0x22c6ef,_0x56e2('0xf'));logger[_0x56e2('0x10')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x22c6ef,_0x56e2('0xf'),JSON[_0x56e2('0x11')](_0x56c56e));if(_0x56c56e['error']){if(_0x56c56e[_0x56e2('0x12')][_0x56e2('0x13')]===0x1f4){logger[_0x56e2('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x22c6ef,_0x56c56e[_0x56e2('0x12')]['message']);return _0x341f66(_0x56c56e['error'][_0x56e2('0x14')]);}logger['error'](_0x56e2('0xe'),_0x22c6ef,_0x56c56e[_0x56e2('0x12')][_0x56e2('0x14')]);return _0x593446(_0x56c56e['error'][_0x56e2('0x14')]);}else{logger[_0x56e2('0xd')](_0x56e2('0xe'),_0x22c6ef,_0x56e2('0xf'));_0x593446(_0x56c56e[_0x56e2('0x15')]['message']);}})[_0x56e2('0x16')](function(_0x5968c2){logger[_0x56e2('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x22c6ef,_0x5968c2);_0x341f66(_0x5968c2);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 9b38526..c6dbeb0 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 _0x5577=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','Router'];(function(_0x573a6f,_0xd8ac92){var _0x513238=function(_0x108305){while(--_0x108305){_0x573a6f['push'](_0x573a6f['shift']());}};_0x513238(++_0xd8ac92);}(_0x5577,0x1b4));var _0x7557=function(_0x4a05a7,_0x1d4d0e){_0x4a05a7=_0x4a05a7-0x0;var _0x206c80=_0x5577[_0x4a05a7];return _0x206c80;};'use strict';var multer=require(_0x7557('0x0'));var util=require('util');var path=require(_0x7557('0x1'));var timeout=require(_0x7557('0x2'));var express=require('express');var router=express[_0x7557('0x3')]();var fs_extra=require(_0x7557('0x4'));var auth=require(_0x7557('0x5'));var interaction=require(_0x7557('0x6'));var config=require(_0x7557('0x7'));var controller=require(_0x7557('0x8'));router['get']('/',auth[_0x7557('0x9')](),controller[_0x7557('0xa')]);router[_0x7557('0xb')](_0x7557('0xc'),auth[_0x7557('0x9')](),controller[_0x7557('0xd')]);router[_0x7557('0xe')]('/',auth[_0x7557('0x9')](),controller[_0x7557('0xf')]);router[_0x7557('0x10')](_0x7557('0xc'),auth[_0x7557('0x9')](),controller[_0x7557('0x11')]);router[_0x7557('0x12')](_0x7557('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x7557('0x13')]=router;
\ No newline at end of file
+var _0xfd87=['put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','/:id','show','post'];(function(_0x5a5c11,_0x358f6b){var _0x5d6ba7=function(_0x272c72){while(--_0x272c72){_0x5a5c11['push'](_0x5a5c11['shift']());}};_0x5d6ba7(++_0x358f6b);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7fd8('0x0'));var util=require(_0x7fd8('0x1'));var path=require(_0x7fd8('0x2'));var timeout=require(_0x7fd8('0x3'));var express=require(_0x7fd8('0x4'));var router=express[_0x7fd8('0x5')]();var fs_extra=require(_0x7fd8('0x6'));var auth=require(_0x7fd8('0x7'));var interaction=require(_0x7fd8('0x8'));var config=require(_0x7fd8('0x9'));var controller=require(_0x7fd8('0xa'));router['get']('/',auth[_0x7fd8('0xb')](),controller[_0x7fd8('0xc')]);router['get'](_0x7fd8('0xd'),auth[_0x7fd8('0xb')](),controller[_0x7fd8('0xe')]);router[_0x7fd8('0xf')]('/',auth[_0x7fd8('0xb')](),controller['create']);router[_0x7fd8('0x10')](_0x7fd8('0xd'),auth[_0x7fd8('0xb')](),controller['update']);router['delete']('/:id',auth[_0x7fd8('0xb')](),controller['destroy']);module[_0x7fd8('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 13cc5f9..0339fe8 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 _0x675e=['TEXT','sequelize','exports'];(function(_0x336c0b,_0x173007){var _0x243e70=function(_0x1e63c6){while(--_0x1e63c6){_0x336c0b['push'](_0x336c0b['shift']());}};_0x243e70(++_0x173007);}(_0x675e,0xb5));var _0xe675=function(_0x5e1b91,_0x236f17){_0x5e1b91=_0x5e1b91-0x0;var _0x59b52f=_0x675e[_0x5e1b91];return _0x59b52f;};'use strict';var Sequelize=require(_0xe675('0x0'));module[_0xe675('0x1')]={'tree':{'type':Sequelize[_0xe675('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x693a=['TEXT','sequelize','exports'];(function(_0xeb6ce6,_0x242f59){var _0x59af38=function(_0x50ed56){while(--_0x50ed56){_0xeb6ce6['push'](_0xeb6ce6['shift']());}};_0x59af38(++_0x242f59);}(_0x693a,0x97));var _0xa693=function(_0x38a3d6,_0x52e305){_0x38a3d6=_0x38a3d6-0x0;var _0x3768d7=_0x693a[_0x38a3d6];return _0x3768d7;};'use strict';var Sequelize=require(_0xa693('0x0'));module[_0xa693('0x1')]={'tree':{'type':Sequelize[_0xa693('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 9d8c104..fe02711 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 _0x3258=['sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','then','destroy','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','fields','model','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','length','create','update','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x342993,_0x43f554){var _0x366ce=function(_0x2cbdc2){while(--_0x2cbdc2){_0x342993['push'](_0x342993['shift']());}};_0x366ce(++_0x43f554);}(_0x3258,0xc8));var _0x8325=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3258[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x8325('0x0'));var rimraf=require(_0x8325('0x1'));var zipdir=require(_0x8325('0x2'));var jsonpatch=require(_0x8325('0x3'));var rp=require(_0x8325('0x4'));var moment=require(_0x8325('0x5'));var BPromise=require(_0x8325('0x6'));var Mustache=require('mustache');var util=require(_0x8325('0x7'));var path=require(_0x8325('0x8'));var sox=require(_0x8325('0x9'));var csv=require('to-csv');var ejs=require(_0x8325('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8325('0xb'));var squel=require(_0x8325('0xc'));var crypto=require(_0x8325('0xd'));var jsforce=require(_0x8325('0xe'));var deskjs=require(_0x8325('0xf'));var toCsv=require(_0x8325('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8325('0x11'));var authService=require(_0x8325('0x12'));var qs=require(_0x8325('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8325('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x8325('0x15'));var config=require(_0x8325('0x16'));var licenseUtil=require(_0x8325('0x17'));var db=require(_0x8325('0x18'))['db'];function respondWithStatusCode(_0x35bb7d,_0x388d8e){_0x388d8e=_0x388d8e||0xcc;return function(_0x10d8ec){if(_0x10d8ec){return _0x35bb7d[_0x8325('0x19')](_0x388d8e);}return _0x35bb7d[_0x8325('0x1a')](_0x388d8e)[_0x8325('0x1b')]();};}function respondWithResult(_0x13ddfb,_0x2fa677){_0x2fa677=_0x2fa677||0xc8;return function(_0xecea69){if(_0xecea69){return _0x13ddfb[_0x8325('0x1a')](_0x2fa677)[_0x8325('0x1c')](_0xecea69);}};}function respondWithFilteredResult(_0x16445a,_0x1c2295){return function(_0x3f9c71){if(_0x3f9c71){var _0x451b01=typeof _0x1c2295['offset']==='undefined'&&typeof _0x1c2295[_0x8325('0x1d')]===_0x8325('0x1e');var _0x11c861=_0x3f9c71[_0x8325('0x1f')];var _0x3c9135=_0x451b01?0x0:_0x1c2295[_0x8325('0x20')];var _0x384678=_0x451b01?_0x3f9c71[_0x8325('0x1f')]:_0x1c2295[_0x8325('0x20')]+_0x1c2295[_0x8325('0x1d')];var _0x48700;if(_0x384678>=_0x11c861){_0x384678=_0x11c861;_0x48700=0xc8;}else{_0x48700=0xce;}_0x16445a[_0x8325('0x1a')](_0x48700);return _0x16445a[_0x8325('0x21')]('Content-Range',_0x3c9135+'-'+_0x384678+'/'+_0x11c861)[_0x8325('0x1c')](_0x3f9c71);}return null;};}function patchUpdates(_0x413330){return function(_0x4300d6){try{jsonpatch[_0x8325('0x22')](_0x4300d6,_0x413330,!![]);}catch(_0x58c804){return BPromise[_0x8325('0x23')](_0x58c804);}return _0x4300d6[_0x8325('0x24')]();};}function saveUpdates(_0x282ee2,_0x97a592){return function(_0x1bf516){if(_0x1bf516){return _0x1bf516['update'](_0x282ee2)[_0x8325('0x25')](function(_0x55df2b){return _0x55df2b;});}return null;};}function removeEntity(_0xab5d79,_0x34f7d5){return function(_0x3b56b3){if(_0x3b56b3){return _0x3b56b3[_0x8325('0x26')]()[_0x8325('0x25')](function(){_0xab5d79[_0x8325('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a1298,_0x1bcc7c){return function(_0x5be4d9){if(!_0x5be4d9){_0x4a1298['sendStatus'](0x194);}return _0x5be4d9;};}function handleError(_0x725a7c,_0x19cdd7){_0x19cdd7=_0x19cdd7||0x1f4;return function(_0x5bfd15){logger[_0x8325('0x27')](_0x5bfd15[_0x8325('0x28')]);if(_0x5bfd15[_0x8325('0x29')]){delete _0x5bfd15['name'];}_0x725a7c['status'](_0x19cdd7)['send'](_0x5bfd15);};}exports[_0x8325('0x2a')]=function(_0x281254,_0x40b5ed){var _0x2a7be4={},_0x1d40b9={},_0x3c64a9={'count':0x0,'rows':[]};var _0x8cab01=_[_0x8325('0x2b')](db[_0x8325('0x2c')][_0x8325('0x2d')],function(_0x1ff5c1){return{'name':_0x1ff5c1[_0x8325('0x2e')],'type':_0x1ff5c1[_0x8325('0x2f')][_0x8325('0x30')]};});_0x1d40b9['model']=_[_0x8325('0x2b')](_0x8cab01,_0x8325('0x29'));_0x1d40b9[_0x8325('0x31')]=_[_0x8325('0x32')](_0x281254[_0x8325('0x31')]);_0x1d40b9['filters']=_['intersection'](_0x1d40b9['model'],_0x1d40b9['query']);_0x2a7be4[_0x8325('0x33')]=_[_0x8325('0x34')](_0x1d40b9['model'],qs[_0x8325('0x35')](_0x281254['query'][_0x8325('0x35')]));_0x2a7be4[_0x8325('0x33')]=_0x2a7be4['attributes']['length']?_0x2a7be4[_0x8325('0x33')]:_0x1d40b9[_0x8325('0x36')];if(!_0x281254[_0x8325('0x31')][_0x8325('0x37')](_0x8325('0x38'))){_0x2a7be4[_0x8325('0x1d')]=qs[_0x8325('0x1d')](_0x281254['query'][_0x8325('0x1d')]);_0x2a7be4[_0x8325('0x20')]=qs[_0x8325('0x20')](_0x281254[_0x8325('0x31')][_0x8325('0x20')]);}_0x2a7be4[_0x8325('0x39')]=qs['sort'](_0x281254[_0x8325('0x31')][_0x8325('0x3a')]);_0x2a7be4[_0x8325('0x3b')]=qs[_0x8325('0x3c')](_['pick'](_0x281254[_0x8325('0x31')],_0x1d40b9['filters']),_0x8cab01);if(_0x281254[_0x8325('0x31')][_0x8325('0x3d')]){_0x2a7be4['where']=_['merge'](_0x2a7be4[_0x8325('0x3b')],{'$or':_[_0x8325('0x2b')](_0x8cab01,function(_0x564960){if(_0x564960['type']!==_0x8325('0x3e')){var _0x546826={};_0x546826[_0x564960[_0x8325('0x29')]]={'$like':'%'+_0x281254['query']['filter']+'%'};return _0x546826;}})});}_0x2a7be4=_[_0x8325('0x3f')]({},_0x2a7be4,_0x281254[_0x8325('0x40')]);var _0x2e3be2={'where':_0x2a7be4[_0x8325('0x3b')]};return db[_0x8325('0x2c')]['count'](_0x2e3be2)[_0x8325('0x25')](function(_0xb0c744){_0x3c64a9[_0x8325('0x1f')]=_0xb0c744;if(_0x281254[_0x8325('0x31')][_0x8325('0x41')]){_0x2a7be4[_0x8325('0x42')]=[{'all':!![]}];}return db[_0x8325('0x2c')][_0x8325('0x43')](_0x2a7be4);})[_0x8325('0x25')](function(_0x573df9){_0x3c64a9['rows']=_0x573df9;return _0x3c64a9;})[_0x8325('0x25')](respondWithFilteredResult(_0x40b5ed,_0x2a7be4))[_0x8325('0x44')](handleError(_0x40b5ed,null));};exports['show']=function(_0x3ecee5,_0xe84c39){var _0x294958={'raw':!![],'where':{'id':_0x3ecee5[_0x8325('0x45')]['id']}},_0x5931ff={};_0x5931ff[_0x8325('0x36')]=_[_0x8325('0x32')](db[_0x8325('0x2c')][_0x8325('0x2d')]);_0x5931ff[_0x8325('0x31')]=_[_0x8325('0x32')](_0x3ecee5['query']);_0x5931ff[_0x8325('0x3c')]=_[_0x8325('0x34')](_0x5931ff[_0x8325('0x36')],_0x5931ff['query']);_0x294958[_0x8325('0x33')]=_[_0x8325('0x34')](_0x5931ff[_0x8325('0x36')],qs[_0x8325('0x35')](_0x3ecee5[_0x8325('0x31')][_0x8325('0x35')]));_0x294958[_0x8325('0x33')]=_0x294958[_0x8325('0x33')][_0x8325('0x46')]?_0x294958[_0x8325('0x33')]:_0x5931ff[_0x8325('0x36')];if(_0x3ecee5[_0x8325('0x31')]['includeAll']){_0x294958['include']=[{'all':!![]}];}_0x294958=_[_0x8325('0x3f')]({},_0x294958,_0x3ecee5[_0x8325('0x40')]);return db[_0x8325('0x2c')]['find'](_0x294958)[_0x8325('0x25')](handleEntityNotFound(_0xe84c39,null))['then'](respondWithResult(_0xe84c39,null))[_0x8325('0x44')](handleError(_0xe84c39,null));};exports['create']=function(_0x2ac898,_0x43abaf){return db[_0x8325('0x2c')][_0x8325('0x47')](_0x2ac898['body'],{})[_0x8325('0x25')](respondWithResult(_0x43abaf,0xc9))[_0x8325('0x44')](handleError(_0x43abaf,null));};exports[_0x8325('0x48')]=function(_0x40fe24,_0x228b39){if(_0x40fe24[_0x8325('0x49')]['id']){delete _0x40fe24[_0x8325('0x49')]['id'];}return db['AnalyticTreeReport'][_0x8325('0x4a')]({'where':{'id':_0x40fe24['params']['id']}})['then'](handleEntityNotFound(_0x228b39,null))[_0x8325('0x25')](saveUpdates(_0x40fe24['body'],null))['then'](respondWithResult(_0x228b39,null))[_0x8325('0x44')](handleError(_0x228b39,null));};exports[_0x8325('0x26')]=function(_0x49b792,_0x3c7058){return db[_0x8325('0x2c')][_0x8325('0x4a')]({'where':{'id':_0x49b792[_0x8325('0x45')]['id']}})[_0x8325('0x25')](handleEntityNotFound(_0x3c7058,null))[_0x8325('0x25')](removeEntity(_0x3c7058,null))[_0x8325('0x44')](handleError(_0x3c7058,null));};
\ No newline at end of file
+var _0x7c6f=['../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','catch','show','keys','intersection','include','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x164ef5,_0xba6238){var _0x2d60c5=function(_0x34deca){while(--_0x34deca){_0x164ef5['push'](_0x164ef5['shift']());}};_0x2d60c5(++_0xba6238);}(_0x7c6f,0x1a4));var _0xf7c6=function(_0x20787c,_0x1a01ad){_0x20787c=_0x20787c-0x0;var _0x1361d9=_0x7c6f[_0x20787c];return _0x1361d9;};'use strict';var emlformat=require(_0xf7c6('0x0'));var rimraf=require(_0xf7c6('0x1'));var zipdir=require(_0xf7c6('0x2'));var jsonpatch=require(_0xf7c6('0x3'));var rp=require(_0xf7c6('0x4'));var moment=require('moment');var BPromise=require(_0xf7c6('0x5'));var Mustache=require(_0xf7c6('0x6'));var util=require(_0xf7c6('0x7'));var path=require(_0xf7c6('0x8'));var sox=require(_0xf7c6('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7c6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf7c6('0xb'));var jsforce=require(_0xf7c6('0xc'));var deskjs=require(_0xf7c6('0xd'));var toCsv=require(_0xf7c6('0xe'));var querystring=require(_0xf7c6('0xf'));var Papa=require('papaparse');var Redis=require(_0xf7c6('0x10'));var authService=require(_0xf7c6('0x11'));var qs=require(_0xf7c6('0x12'));var as=require(_0xf7c6('0x13'));var hardwareService=require(_0xf7c6('0x14'));var logger=require(_0xf7c6('0x15'))('api');var utils=require(_0xf7c6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf7c6('0x17'));var db=require(_0xf7c6('0x18'))['db'];function respondWithStatusCode(_0x24ce89,_0x37f89d){_0x37f89d=_0x37f89d||0xcc;return function(_0x50857a){if(_0x50857a){return _0x24ce89['sendStatus'](_0x37f89d);}return _0x24ce89[_0xf7c6('0x19')](_0x37f89d)[_0xf7c6('0x1a')]();};}function respondWithResult(_0x57fa85,_0x1a475a){_0x1a475a=_0x1a475a||0xc8;return function(_0x2b8322){if(_0x2b8322){return _0x57fa85[_0xf7c6('0x19')](_0x1a475a)[_0xf7c6('0x1b')](_0x2b8322);}};}function respondWithFilteredResult(_0x2d3153,_0x116e8b){return function(_0x4ff3c6){if(_0x4ff3c6){var _0x4295c0=typeof _0x116e8b['offset']===_0xf7c6('0x1c')&&typeof _0x116e8b[_0xf7c6('0x1d')]==='undefined';var _0x7463a=_0x4ff3c6[_0xf7c6('0x1e')];var _0x59e96b=_0x4295c0?0x0:_0x116e8b[_0xf7c6('0x1f')];var _0x77e783=_0x4295c0?_0x4ff3c6['count']:_0x116e8b[_0xf7c6('0x1f')]+_0x116e8b[_0xf7c6('0x1d')];var _0x564d0f;if(_0x77e783>=_0x7463a){_0x77e783=_0x7463a;_0x564d0f=0xc8;}else{_0x564d0f=0xce;}_0x2d3153[_0xf7c6('0x19')](_0x564d0f);return _0x2d3153[_0xf7c6('0x20')](_0xf7c6('0x21'),_0x59e96b+'-'+_0x77e783+'/'+_0x7463a)['json'](_0x4ff3c6);}return null;};}function patchUpdates(_0x5969d2){return function(_0x27eefd){try{jsonpatch[_0xf7c6('0x22')](_0x27eefd,_0x5969d2,!![]);}catch(_0x37be5e){return BPromise[_0xf7c6('0x23')](_0x37be5e);}return _0x27eefd[_0xf7c6('0x24')]();};}function saveUpdates(_0x1adaaa,_0x5f0b87){return function(_0x5254a5){if(_0x5254a5){return _0x5254a5['update'](_0x1adaaa)[_0xf7c6('0x25')](function(_0x24437b){return _0x24437b;});}return null;};}function removeEntity(_0x37e2a7,_0x3cb954){return function(_0x28e875){if(_0x28e875){return _0x28e875[_0xf7c6('0x26')]()['then'](function(){_0x37e2a7[_0xf7c6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519ffe,_0x334c7c){return function(_0x38aeff){if(!_0x38aeff){_0x519ffe[_0xf7c6('0x27')](0x194);}return _0x38aeff;};}function handleError(_0x11f494,_0x17b5eb){_0x17b5eb=_0x17b5eb||0x1f4;return function(_0x5a98bb){logger[_0xf7c6('0x28')](_0x5a98bb[_0xf7c6('0x29')]);if(_0x5a98bb[_0xf7c6('0x2a')]){delete _0x5a98bb[_0xf7c6('0x2a')];}_0x11f494[_0xf7c6('0x19')](_0x17b5eb)[_0xf7c6('0x2b')](_0x5a98bb);};}exports[_0xf7c6('0x2c')]=function(_0x18a089,_0x2b6968){var _0x40b402={},_0x43d44c={},_0x2671d3={'count':0x0,'rows':[]};var _0x502cc1=_[_0xf7c6('0x2d')](db[_0xf7c6('0x2e')][_0xf7c6('0x2f')],function(_0x546c2f){return{'name':_0x546c2f[_0xf7c6('0x30')],'type':_0x546c2f[_0xf7c6('0x31')][_0xf7c6('0x32')]};});_0x43d44c[_0xf7c6('0x33')]=_['map'](_0x502cc1,_0xf7c6('0x2a'));_0x43d44c[_0xf7c6('0x34')]=_['keys'](_0x18a089[_0xf7c6('0x34')]);_0x43d44c[_0xf7c6('0x35')]=_['intersection'](_0x43d44c[_0xf7c6('0x33')],_0x43d44c['query']);_0x40b402[_0xf7c6('0x36')]=_['intersection'](_0x43d44c[_0xf7c6('0x33')],qs['fields'](_0x18a089['query'][_0xf7c6('0x37')]));_0x40b402[_0xf7c6('0x36')]=_0x40b402['attributes'][_0xf7c6('0x38')]?_0x40b402['attributes']:_0x43d44c[_0xf7c6('0x33')];if(!_0x18a089[_0xf7c6('0x34')]['hasOwnProperty']('nolimit')){_0x40b402[_0xf7c6('0x1d')]=qs[_0xf7c6('0x1d')](_0x18a089[_0xf7c6('0x34')]['limit']);_0x40b402[_0xf7c6('0x1f')]=qs['offset'](_0x18a089['query'][_0xf7c6('0x1f')]);}_0x40b402['order']=qs[_0xf7c6('0x39')](_0x18a089[_0xf7c6('0x34')][_0xf7c6('0x39')]);_0x40b402['where']=qs[_0xf7c6('0x35')](_[_0xf7c6('0x3a')](_0x18a089[_0xf7c6('0x34')],_0x43d44c[_0xf7c6('0x35')]),_0x502cc1);if(_0x18a089[_0xf7c6('0x34')]['filter']){_0x40b402[_0xf7c6('0x3b')]=_[_0xf7c6('0x3c')](_0x40b402[_0xf7c6('0x3b')],{'$or':_['map'](_0x502cc1,function(_0x59b8bd){if(_0x59b8bd[_0xf7c6('0x31')]!==_0xf7c6('0x3d')){var _0x5ef951={};_0x5ef951[_0x59b8bd[_0xf7c6('0x2a')]]={'$like':'%'+_0x18a089[_0xf7c6('0x34')][_0xf7c6('0x3e')]+'%'};return _0x5ef951;}})});}_0x40b402=_['merge']({},_0x40b402,_0x18a089[_0xf7c6('0x3f')]);var _0x265fb6={'where':_0x40b402[_0xf7c6('0x3b')]};return db[_0xf7c6('0x2e')]['count'](_0x265fb6)[_0xf7c6('0x25')](function(_0x5c83a2){_0x2671d3[_0xf7c6('0x1e')]=_0x5c83a2;if(_0x18a089['query'][_0xf7c6('0x40')]){_0x40b402['include']=[{'all':!![]}];}return db[_0xf7c6('0x2e')]['findAll'](_0x40b402);})['then'](function(_0x128677){_0x2671d3['rows']=_0x128677;return _0x2671d3;})['then'](respondWithFilteredResult(_0x2b6968,_0x40b402))[_0xf7c6('0x41')](handleError(_0x2b6968,null));};exports[_0xf7c6('0x42')]=function(_0x4e2685,_0x384134){var _0x9706b4={'raw':!![],'where':{'id':_0x4e2685['params']['id']}},_0x33e4a4={};_0x33e4a4[_0xf7c6('0x33')]=_[_0xf7c6('0x43')](db['AnalyticTreeReport'][_0xf7c6('0x2f')]);_0x33e4a4[_0xf7c6('0x34')]=_[_0xf7c6('0x43')](_0x4e2685[_0xf7c6('0x34')]);_0x33e4a4[_0xf7c6('0x35')]=_[_0xf7c6('0x44')](_0x33e4a4['model'],_0x33e4a4[_0xf7c6('0x34')]);_0x9706b4[_0xf7c6('0x36')]=_[_0xf7c6('0x44')](_0x33e4a4[_0xf7c6('0x33')],qs[_0xf7c6('0x37')](_0x4e2685['query'][_0xf7c6('0x37')]));_0x9706b4['attributes']=_0x9706b4[_0xf7c6('0x36')]['length']?_0x9706b4[_0xf7c6('0x36')]:_0x33e4a4['model'];if(_0x4e2685[_0xf7c6('0x34')]['includeAll']){_0x9706b4[_0xf7c6('0x45')]=[{'all':!![]}];}_0x9706b4=_[_0xf7c6('0x3c')]({},_0x9706b4,_0x4e2685[_0xf7c6('0x3f')]);return db['AnalyticTreeReport']['find'](_0x9706b4)[_0xf7c6('0x25')](handleEntityNotFound(_0x384134,null))[_0xf7c6('0x25')](respondWithResult(_0x384134,null))[_0xf7c6('0x41')](handleError(_0x384134,null));};exports['create']=function(_0x1004e1,_0x114021){return db[_0xf7c6('0x2e')][_0xf7c6('0x46')](_0x1004e1[_0xf7c6('0x47')],{})[_0xf7c6('0x25')](respondWithResult(_0x114021,0xc9))[_0xf7c6('0x41')](handleError(_0x114021,null));};exports['update']=function(_0x5cdfdc,_0x68fffc){if(_0x5cdfdc[_0xf7c6('0x47')]['id']){delete _0x5cdfdc[_0xf7c6('0x47')]['id'];}return db['AnalyticTreeReport'][_0xf7c6('0x48')]({'where':{'id':_0x5cdfdc[_0xf7c6('0x49')]['id']}})[_0xf7c6('0x25')](handleEntityNotFound(_0x68fffc,null))[_0xf7c6('0x25')](saveUpdates(_0x5cdfdc['body'],null))[_0xf7c6('0x25')](respondWithResult(_0x68fffc,null))['catch'](handleError(_0x68fffc,null));};exports[_0xf7c6('0x26')]=function(_0x689911,_0x43f0dd){return db['AnalyticTreeReport']['find']({'where':{'id':_0x689911[_0xf7c6('0x49')]['id']}})[_0xf7c6('0x25')](handleEntityNotFound(_0x43f0dd,null))['then'](removeEntity(_0x43f0dd,null))[_0xf7c6('0x41')](handleError(_0x43f0dd,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index ac98085..30a7ff9 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 _0xe6d1=['request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','lodash','util','api','moment'];(function(_0x1e65cc,_0x55489e){var _0x2aa244=function(_0x507592){while(--_0x507592){_0x1e65cc['push'](_0x1e65cc['shift']());}};_0x2aa244(++_0x55489e);}(_0xe6d1,0xce));var _0x1e6d=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xe6d1[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0x1e6d('0x0'));var util=require(_0x1e6d('0x1'));var logger=require('../../config/logger')(_0x1e6d('0x2'));var moment=require(_0x1e6d('0x3'));var BPromise=require('bluebird');var rp=require(_0x1e6d('0x4'));var fs=require('fs');var path=require(_0x1e6d('0x5'));var rimraf=require(_0x1e6d('0x6'));var config=require(_0x1e6d('0x7'));var attributes=require(_0x1e6d('0x8'));module[_0x1e6d('0x9')]=function(_0x4bd7e9,_0xdb173){return _0x4bd7e9['define']('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x678c=['./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x678c,0x1dd));var _0xc678=function(_0x257195,_0x1a9de1){_0x257195=_0x257195-0x0;var _0x157cce=_0x678c[_0x257195];return _0x157cce;};'use strict';var _=require(_0xc678('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc678('0x1'));var moment=require('moment');var BPromise=require(_0xc678('0x2'));var rp=require(_0xc678('0x3'));var fs=require('fs');var path=require(_0xc678('0x4'));var rimraf=require(_0xc678('0x5'));var config=require(_0xc678('0x6'));var attributes=require(_0xc678('0x7'));module[_0xc678('0x8')]=function(_0x26eb44,_0x5bfce7){return _0x26eb44[_0xc678('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0xc678('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 3f5d6ae..9e44105 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x4a191f,_0xb95809){var _0x2eb3bf=function(_0x304bbc){while(--_0x304bbc){_0x4a191f['push'](_0x4a191f['shift']());}};_0x2eb3bf(++_0xb95809);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4508b9,_0x2d5d7c){_0x4508b9=_0x4508b9-0x0;var _0x3b664c=_0x5f2f[_0x4508b9];return _0x3b664c;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x58b35e,_0x17a8cd){var _0x86b2a0=function(_0x162126){while(--_0x162126){_0x58b35e['push'](_0x58b35e['shift']());}};_0x86b2a0(++_0x17a8cd);}(_0xadb5,0xad));var _0x5adb=function(_0x3faab3,_0xada0ac){_0x3faab3=_0x3faab3-0x0;var _0x1e7aae=_0xadb5[_0x3faab3];return _0x1e7aae;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 7202806..37ec11a 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 _0x7d0a=['delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x53ba51,_0x2f2321){var _0x2e776e=function(_0x16b5cf){while(--_0x16b5cf){_0x53ba51['push'](_0x53ba51['shift']());}};_0x2e776e(++_0x2f2321);}(_0x7d0a,0x178));var _0xa7d0=function(_0x3b9570,_0x4ead31){_0x3b9570=_0x3b9570-0x0;var _0x28acdd=_0x7d0a[_0x3b9570];return _0x28acdd;};'use strict';var multer=require(_0xa7d0('0x0'));var util=require(_0xa7d0('0x1'));var path=require(_0xa7d0('0x2'));var timeout=require(_0xa7d0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa7d0('0x4'));var auth=require(_0xa7d0('0x5'));var interaction=require(_0xa7d0('0x6'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0xa7d0('0x7')]('/',auth[_0xa7d0('0x8')](),controller[_0xa7d0('0x9')]);router[_0xa7d0('0x7')](_0xa7d0('0xa'),auth[_0xa7d0('0x8')](),controller[_0xa7d0('0xb')]);router[_0xa7d0('0xc')]('/',auth['isAuthenticated'](),controller[_0xa7d0('0xd')]);router['put'](_0xa7d0('0xa'),auth[_0xa7d0('0x8')](),controller[_0xa7d0('0xe')]);router[_0xa7d0('0xf')](_0xa7d0('0xa'),auth[_0xa7d0('0x8')](),controller['destroy']);module[_0xa7d0('0x10')]=router;
\ No newline at end of file
+var _0xabeb=['util','path','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','multer'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xabeb,0x1c1));var _0xbabe=function(_0x233d84,_0x3f63c9){_0x233d84=_0x233d84-0x0;var _0x33f28f=_0xabeb[_0x233d84];return _0x33f28f;};'use strict';var multer=require(_0xbabe('0x0'));var util=require(_0xbabe('0x1'));var path=require(_0xbabe('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbabe('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbabe('0x4'));var interaction=require(_0xbabe('0x5'));var config=require('../../config/environment');var controller=require(_0xbabe('0x6'));router[_0xbabe('0x7')]('/',auth['isAuthenticated'](),controller[_0xbabe('0x8')]);router[_0xbabe('0x7')]('/:id',auth[_0xbabe('0x9')](),controller[_0xbabe('0xa')]);router[_0xbabe('0xb')]('/',auth[_0xbabe('0x9')](),controller[_0xbabe('0xc')]);router[_0xbabe('0xd')](_0xbabe('0xe'),auth[_0xbabe('0x9')](),controller[_0xbabe('0xf')]);router['delete'](_0xbabe('0xe'),auth[_0xbabe('0x9')](),controller[_0xbabe('0x10')]);module[_0xbabe('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 30e2599..57749b6 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 _0xbd3b=['STRING','sequelize','exports'];(function(_0x20a1b0,_0x18fe84){var _0x321e14=function(_0x69fdf6){while(--_0x69fdf6){_0x20a1b0['push'](_0x20a1b0['shift']());}};_0x321e14(++_0x18fe84);}(_0xbd3b,0x1c3));var _0xbbd3=function(_0x594dc7,_0x269225){_0x594dc7=_0x594dc7-0x0;var _0x2e287d=_0xbd3b[_0x594dc7];return _0x2e287d;};'use strict';var Sequelize=require(_0xbbd3('0x0'));module[_0xbbd3('0x1')]={'name':{'type':Sequelize[_0xbbd3('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbbd3('0x2')]}};
\ No newline at end of file
+var _0xbbb8=['exports','STRING','sequelize'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xbbb8,0x7d));var _0x8bbb=function(_0x7febbd,_0x258106){_0x7febbd=_0x7febbd-0x0;var _0x4076e5=_0xbbb8[_0x7febbd];return _0x4076e5;};'use strict';var Sequelize=require(_0x8bbb('0x0'));module[_0x8bbb('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x8bbb('0x2')]},'type':{'type':Sequelize[_0x8bbb('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 51e5fec..bb946f7 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 _0x5ede=['filter','merge','type','VIRTUAL','options','include','findAll','rows','includeAll','find','catch','params','get','createdAt','updatedAt','body','omit','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','Attachment','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick'];(function(_0xcd479d,_0x10b519){var _0x42641b=function(_0x29d7ef){while(--_0x29d7ef){_0xcd479d['push'](_0xcd479d['shift']());}};_0x42641b(++_0x10b519);}(_0x5ede,0xd4));var _0xe5ed=function(_0x223b88,_0x294ff0){_0x223b88=_0x223b88-0x0;var _0x5b68c5=_0x5ede[_0x223b88];return _0x5b68c5;};'use strict';var emlformat=require(_0xe5ed('0x0'));var rimraf=require(_0xe5ed('0x1'));var zipdir=require(_0xe5ed('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5ed('0x3'));var moment=require(_0xe5ed('0x4'));var BPromise=require(_0xe5ed('0x5'));var Mustache=require(_0xe5ed('0x6'));var util=require(_0xe5ed('0x7'));var path=require(_0xe5ed('0x8'));var sox=require(_0xe5ed('0x9'));var csv=require(_0xe5ed('0xa'));var ejs=require(_0xe5ed('0xb'));var fs=require('fs');var fs_extra=require(_0xe5ed('0xc'));var _=require(_0xe5ed('0xd'));var squel=require(_0xe5ed('0xe'));var crypto=require(_0xe5ed('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe5ed('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe5ed('0x11'));var qs=require(_0xe5ed('0x12'));var as=require(_0xe5ed('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5ed('0x14'))(_0xe5ed('0x15'));var utils=require('../../config/utils');var config=require(_0xe5ed('0x16'));var licenseUtil=require(_0xe5ed('0x17'));var db=require(_0xe5ed('0x18'))['db'];function respondWithStatusCode(_0x284737,_0x3fc849){_0x3fc849=_0x3fc849||0xcc;return function(_0xaaff21){if(_0xaaff21){return _0x284737['sendStatus'](_0x3fc849);}return _0x284737[_0xe5ed('0x19')](_0x3fc849)['end']();};}function respondWithResult(_0x458a3d,_0x156cec){_0x156cec=_0x156cec||0xc8;return function(_0x5347b4){if(_0x5347b4){return _0x458a3d['status'](_0x156cec)[_0xe5ed('0x1a')](_0x5347b4);}};}function respondWithFilteredResult(_0x95a8bc,_0x1c0d44){return function(_0x3235de){if(_0x3235de){var _0x5c0a09=typeof _0x1c0d44[_0xe5ed('0x1b')]===_0xe5ed('0x1c')&&typeof _0x1c0d44[_0xe5ed('0x1d')]==='undefined';var _0x40167a=_0x3235de[_0xe5ed('0x1e')];var _0x553a6c=_0x5c0a09?0x0:_0x1c0d44[_0xe5ed('0x1b')];var _0xd1a8b2=_0x5c0a09?_0x3235de[_0xe5ed('0x1e')]:_0x1c0d44[_0xe5ed('0x1b')]+_0x1c0d44[_0xe5ed('0x1d')];var _0x1fc43a;if(_0xd1a8b2>=_0x40167a){_0xd1a8b2=_0x40167a;_0x1fc43a=0xc8;}else{_0x1fc43a=0xce;}_0x95a8bc['status'](_0x1fc43a);return _0x95a8bc['set'](_0xe5ed('0x1f'),_0x553a6c+'-'+_0xd1a8b2+'/'+_0x40167a)[_0xe5ed('0x1a')](_0x3235de);}return null;};}function patchUpdates(_0x1a24e3){return function(_0x27d255){try{jsonpatch[_0xe5ed('0x20')](_0x27d255,_0x1a24e3,!![]);}catch(_0x2582a4){return BPromise[_0xe5ed('0x21')](_0x2582a4);}return _0x27d255[_0xe5ed('0x22')]();};}function saveUpdates(_0x52a480,_0xb96e37){return function(_0x43bb37){if(_0x43bb37){return _0x43bb37[_0xe5ed('0x23')](_0x52a480)[_0xe5ed('0x24')](function(_0x4b210d){return _0x4b210d;});}return null;};}function removeEntity(_0x377ad4,_0x14ffc3){return function(_0x13d3ef){if(_0x13d3ef){return _0x13d3ef[_0xe5ed('0x25')]()[_0xe5ed('0x24')](function(){_0x377ad4[_0xe5ed('0x19')](0xcc)[_0xe5ed('0x26')]();});}};}function handleEntityNotFound(_0x30fb8b,_0x5d7852){return function(_0x327d0b){if(!_0x327d0b){_0x30fb8b[_0xe5ed('0x27')](0x194);}return _0x327d0b;};}function handleError(_0x242cbf,_0xd208a){_0xd208a=_0xd208a||0x1f4;return function(_0x2a1b72){logger[_0xe5ed('0x28')](_0x2a1b72[_0xe5ed('0x29')]);if(_0x2a1b72['name']){delete _0x2a1b72[_0xe5ed('0x2a')];}_0x242cbf[_0xe5ed('0x19')](_0xd208a)['send'](_0x2a1b72);};}exports[_0xe5ed('0x2b')]=function(_0x4a7884,_0x4ab178){var _0x277774={},_0x40c867={},_0x1ae2d1={'count':0x0,'rows':[]};var _0x4cd4b0=_['map'](db[_0xe5ed('0x2c')][_0xe5ed('0x2d')],function(_0x236d9e){return{'name':_0x236d9e[_0xe5ed('0x2e')],'type':_0x236d9e['type'][_0xe5ed('0x2f')]};});_0x40c867[_0xe5ed('0x30')]=_[_0xe5ed('0x31')](_0x4cd4b0,_0xe5ed('0x2a'));_0x40c867[_0xe5ed('0x32')]=_[_0xe5ed('0x33')](_0x4a7884[_0xe5ed('0x32')]);_0x40c867[_0xe5ed('0x34')]=_[_0xe5ed('0x35')](_0x40c867[_0xe5ed('0x30')],_0x40c867[_0xe5ed('0x32')]);_0x277774[_0xe5ed('0x36')]=_[_0xe5ed('0x35')](_0x40c867[_0xe5ed('0x30')],qs[_0xe5ed('0x37')](_0x4a7884[_0xe5ed('0x32')]['fields']));_0x277774[_0xe5ed('0x36')]=_0x277774[_0xe5ed('0x36')]['length']?_0x277774['attributes']:_0x40c867[_0xe5ed('0x30')];if(!_0x4a7884['query'][_0xe5ed('0x38')]('nolimit')){_0x277774['limit']=qs[_0xe5ed('0x1d')](_0x4a7884[_0xe5ed('0x32')][_0xe5ed('0x1d')]);_0x277774['offset']=qs[_0xe5ed('0x1b')](_0x4a7884[_0xe5ed('0x32')][_0xe5ed('0x1b')]);}_0x277774[_0xe5ed('0x39')]=qs[_0xe5ed('0x3a')](_0x4a7884[_0xe5ed('0x32')][_0xe5ed('0x3a')]);_0x277774[_0xe5ed('0x3b')]=qs[_0xe5ed('0x34')](_[_0xe5ed('0x3c')](_0x4a7884[_0xe5ed('0x32')],_0x40c867['filters']),_0x4cd4b0);if(_0x4a7884[_0xe5ed('0x32')][_0xe5ed('0x3d')]){_0x277774[_0xe5ed('0x3b')]=_[_0xe5ed('0x3e')](_0x277774[_0xe5ed('0x3b')],{'$or':_[_0xe5ed('0x31')](_0x4cd4b0,function(_0x3914c0){if(_0x3914c0[_0xe5ed('0x3f')]!==_0xe5ed('0x40')){var _0x3cedb5={};_0x3cedb5[_0x3914c0[_0xe5ed('0x2a')]]={'$like':'%'+_0x4a7884['query']['filter']+'%'};return _0x3cedb5;}})});}_0x277774=_[_0xe5ed('0x3e')]({},_0x277774,_0x4a7884[_0xe5ed('0x41')]);var _0x2a783a={'where':_0x277774[_0xe5ed('0x3b')]};return db[_0xe5ed('0x2c')]['count'](_0x2a783a)[_0xe5ed('0x24')](function(_0x4e73a6){_0x1ae2d1['count']=_0x4e73a6;if(_0x4a7884[_0xe5ed('0x32')]['includeAll']){_0x277774[_0xe5ed('0x42')]=[{'all':!![]}];}return db[_0xe5ed('0x2c')][_0xe5ed('0x43')](_0x277774);})[_0xe5ed('0x24')](function(_0x594d41){_0x1ae2d1[_0xe5ed('0x44')]=_0x594d41;return _0x1ae2d1;})[_0xe5ed('0x24')](respondWithFilteredResult(_0x4ab178,_0x277774))['catch'](handleError(_0x4ab178,null));};exports['show']=function(_0x5e39ea,_0x4be277){var _0x1fd454={'raw':!![],'where':{'id':_0x5e39ea['params']['id']}},_0x5c5ce6={};_0x5c5ce6[_0xe5ed('0x30')]=_[_0xe5ed('0x33')](db[_0xe5ed('0x2c')][_0xe5ed('0x2d')]);_0x5c5ce6[_0xe5ed('0x32')]=_[_0xe5ed('0x33')](_0x5e39ea['query']);_0x5c5ce6[_0xe5ed('0x34')]=_[_0xe5ed('0x35')](_0x5c5ce6[_0xe5ed('0x30')],_0x5c5ce6[_0xe5ed('0x32')]);_0x1fd454['attributes']=_[_0xe5ed('0x35')](_0x5c5ce6[_0xe5ed('0x30')],qs[_0xe5ed('0x37')](_0x5e39ea[_0xe5ed('0x32')][_0xe5ed('0x37')]));_0x1fd454[_0xe5ed('0x36')]=_0x1fd454['attributes']['length']?_0x1fd454['attributes']:_0x5c5ce6[_0xe5ed('0x30')];if(_0x5e39ea[_0xe5ed('0x32')][_0xe5ed('0x45')]){_0x1fd454['include']=[{'all':!![]}];}_0x1fd454=_[_0xe5ed('0x3e')]({},_0x1fd454,_0x5e39ea[_0xe5ed('0x41')]);return db[_0xe5ed('0x2c')][_0xe5ed('0x46')](_0x1fd454)[_0xe5ed('0x24')](handleEntityNotFound(_0x4be277,null))[_0xe5ed('0x24')](respondWithResult(_0x4be277,null))[_0xe5ed('0x47')](handleError(_0x4be277,null));};exports['clone']=function(_0x2b7b3c,_0x33a567){var _0x39abcb={'where':{'id':_0x2b7b3c[_0xe5ed('0x48')]['id']}},_0x18c25d={};_0x18c25d['model']=_['keys'](db[_0xe5ed('0x2c')][_0xe5ed('0x2d')]);_0x39abcb[_0xe5ed('0x36')]=_[_0xe5ed('0x35')](_0x18c25d[_0xe5ed('0x30')],qs[_0xe5ed('0x37')](_0x2b7b3c['query'][_0xe5ed('0x37')]));_0x39abcb[_0xe5ed('0x36')]=_0x39abcb[_0xe5ed('0x36')]['length']?_0x39abcb[_0xe5ed('0x36')]:_0x18c25d[_0xe5ed('0x30')];if(_0x2b7b3c['query'][_0xe5ed('0x45')]){_0x39abcb[_0xe5ed('0x42')]=[{'all':!![]}];}_0x39abcb=_[_0xe5ed('0x3e')]({},_0x39abcb,_0x2b7b3c['options']);return db[_0xe5ed('0x2c')]['find'](_0x39abcb)[_0xe5ed('0x24')](handleEntityNotFound(_0x33a567,null))[_0xe5ed('0x24')](function(_0x26c7d5){if(_0x26c7d5){var _0x1822ae=_0x26c7d5[_0xe5ed('0x49')]({'plain':!![]});_0x1822ae=qs['omit'](_0x1822ae,['id',_0xe5ed('0x4a'),_0xe5ed('0x4b')]);_0x2b7b3c[_0xe5ed('0x4c')]=_[_0xe5ed('0x4d')](_0x2b7b3c[_0xe5ed('0x4c')],['id','createdAt',_0xe5ed('0x4b')]);return db[_0xe5ed('0x2c')][_0xe5ed('0x4e')](_[_0xe5ed('0x3e')](_0x1822ae,_0x2b7b3c[_0xe5ed('0x4c')]),{'include':_0x2b7b3c[_0xe5ed('0x32')][_0xe5ed('0x45')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x33a567,0xc9))[_0xe5ed('0x47')](handleError(_0x33a567,null));};exports[_0xe5ed('0x23')]=function(_0x361628,_0x10e37a){if(_0x361628[_0xe5ed('0x4c')]['id']){delete _0x361628['body']['id'];}return db[_0xe5ed('0x2c')][_0xe5ed('0x46')]({'where':{'id':_0x361628['params']['id']}})[_0xe5ed('0x24')](handleEntityNotFound(_0x10e37a,null))[_0xe5ed('0x24')](saveUpdates(_0x361628[_0xe5ed('0x4c')],null))[_0xe5ed('0x24')](respondWithResult(_0x10e37a,null))['catch'](handleError(_0x10e37a,null));};exports[_0xe5ed('0x25')]=function(_0x38738f,_0x59448b){return db[_0xe5ed('0x2c')][_0xe5ed('0x46')]({'where':{'id':_0x38738f[_0xe5ed('0x48')]['id']}})[_0xe5ed('0x24')](handleEntityNotFound(_0x59448b,null))['then'](removeEntity(_0x59448b,null))[_0xe5ed('0x47')](handleError(_0x59448b,null));};exports[_0xe5ed('0x4e')]=function(_0x53851d,_0xf5d344,_0x1fd31f){_0x53851d[_0xe5ed('0x4c')]['name']=_0x53851d[_0xe5ed('0x4f')][_0xe5ed('0x50')];_0x53851d[_0xe5ed('0x4c')][_0xe5ed('0x51')]=_0x53851d['file'][_0xe5ed('0x52')];_0x53851d[_0xe5ed('0x4c')][_0xe5ed('0x3f')]=_0x53851d['file'][_0xe5ed('0x53')];return db[_0xe5ed('0x2c')]['create'](_0x53851d[_0xe5ed('0x4c')])[_0xe5ed('0x24')](respondWithResult(_0xf5d344,0xc9))[_0xe5ed('0x47')](handleError(_0xf5d344,null));};exports['download']=function(_0x4ff632,_0x39b86e,_0x32e5fb){return db[_0xe5ed('0x2c')][_0xe5ed('0x54')]({'where':{'id':_0x4ff632[_0xe5ed('0x48')]['id']},'raw':!![]})[_0xe5ed('0x24')](handleEntityNotFound(_0x39b86e,null))[_0xe5ed('0x24')](function(_0x5b878b){if(_0x5b878b){var _0x2abe49=_0x5b878b[_0xe5ed('0x55')]!==null;var _0x33db53=path[_0xe5ed('0x56')](config[_0xe5ed('0x57')],_0xe5ed('0x58'));if(_0x2abe49){_0x33db53=path[_0xe5ed('0x56')](_0x33db53,_0xe5ed('0x59'));}var _0x4d4fde=path['join'](_0x33db53,_0x5b878b[_0xe5ed('0x51')]);return _0x39b86e[_0xe5ed('0x5a')](_0x4d4fde);}})[_0xe5ed('0x47')](handleError(_0x39b86e,null));};
\ No newline at end of file
+var _0x8712=['order','sort','pick','filter','where','merge','options','findAll','rows','catch','show','params','includeAll','find','clone','include','get','omit','createdAt','updatedAt','body','create','update','name','basename','file','filename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','moment','bluebird','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/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','send','map','Attachment','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit'];(function(_0x3713db,_0x3d6359){var _0x39ed9e=function(_0x10e394){while(--_0x10e394){_0x3713db['push'](_0x3713db['shift']());}};_0x39ed9e(++_0x3d6359);}(_0x8712,0x133));var _0x2871=function(_0x34db59,_0x5119c0){_0x34db59=_0x34db59-0x0;var _0x2766b3=_0x8712[_0x34db59];return _0x2766b3;};'use strict';var emlformat=require(_0x2871('0x0'));var rimraf=require(_0x2871('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2871('0x2'));var rp=require('request-promise');var moment=require(_0x2871('0x3'));var BPromise=require(_0x2871('0x4'));var Mustache=require('mustache');var util=require(_0x2871('0x5'));var path=require(_0x2871('0x6'));var sox=require(_0x2871('0x7'));var csv=require(_0x2871('0x8'));var ejs=require(_0x2871('0x9'));var fs=require('fs');var fs_extra=require(_0x2871('0xa'));var _=require(_0x2871('0xb'));var squel=require(_0x2871('0xc'));var crypto=require(_0x2871('0xd'));var jsforce=require(_0x2871('0xe'));var deskjs=require(_0x2871('0xf'));var toCsv=require(_0x2871('0x8'));var querystring=require(_0x2871('0x10'));var Papa=require(_0x2871('0x11'));var Redis=require(_0x2871('0x12'));var authService=require(_0x2871('0x13'));var qs=require(_0x2871('0x14'));var as=require(_0x2871('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2871('0x16'))('api');var utils=require(_0x2871('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2871('0x18'));var db=require(_0x2871('0x19'))['db'];function respondWithStatusCode(_0x433423,_0x262dd0){_0x262dd0=_0x262dd0||0xcc;return function(_0x7926cb){if(_0x7926cb){return _0x433423[_0x2871('0x1a')](_0x262dd0);}return _0x433423[_0x2871('0x1b')](_0x262dd0)[_0x2871('0x1c')]();};}function respondWithResult(_0x5074d6,_0x6b8196){_0x6b8196=_0x6b8196||0xc8;return function(_0x3e1981){if(_0x3e1981){return _0x5074d6['status'](_0x6b8196)['json'](_0x3e1981);}};}function respondWithFilteredResult(_0x183086,_0x2e56e5){return function(_0x271bab){if(_0x271bab){var _0x452ff4=typeof _0x2e56e5[_0x2871('0x1d')]===_0x2871('0x1e')&&typeof _0x2e56e5[_0x2871('0x1f')]==='undefined';var _0x395949=_0x271bab[_0x2871('0x20')];var _0x48ca48=_0x452ff4?0x0:_0x2e56e5[_0x2871('0x1d')];var _0x28986b=_0x452ff4?_0x271bab['count']:_0x2e56e5[_0x2871('0x1d')]+_0x2e56e5['limit'];var _0x30f803;if(_0x28986b>=_0x395949){_0x28986b=_0x395949;_0x30f803=0xc8;}else{_0x30f803=0xce;}_0x183086[_0x2871('0x1b')](_0x30f803);return _0x183086[_0x2871('0x21')](_0x2871('0x22'),_0x48ca48+'-'+_0x28986b+'/'+_0x395949)['json'](_0x271bab);}return null;};}function patchUpdates(_0x336d85){return function(_0xe1001a){try{jsonpatch[_0x2871('0x23')](_0xe1001a,_0x336d85,!![]);}catch(_0x1bb22c){return BPromise['reject'](_0x1bb22c);}return _0xe1001a[_0x2871('0x24')]();};}function saveUpdates(_0x1eb337,_0x29f7fe){return function(_0x307d12){if(_0x307d12){return _0x307d12['update'](_0x1eb337)[_0x2871('0x25')](function(_0x13a5f3){return _0x13a5f3;});}return null;};}function removeEntity(_0x2f54cc,_0x419f17){return function(_0x2553af){if(_0x2553af){return _0x2553af[_0x2871('0x26')]()[_0x2871('0x25')](function(){_0x2f54cc['status'](0xcc)[_0x2871('0x1c')]();});}};}function handleEntityNotFound(_0x46965b,_0xf3e48d){return function(_0x579c4a){if(!_0x579c4a){_0x46965b[_0x2871('0x1a')](0x194);}return _0x579c4a;};}function handleError(_0x5d07bb,_0x1bcfc5){_0x1bcfc5=_0x1bcfc5||0x1f4;return function(_0x435864){logger[_0x2871('0x27')](_0x435864[_0x2871('0x28')]);if(_0x435864['name']){delete _0x435864['name'];}_0x5d07bb[_0x2871('0x1b')](_0x1bcfc5)[_0x2871('0x29')](_0x435864);};}exports['index']=function(_0x522a78,_0x510c3b){var _0x133a4a={},_0x58ec59={},_0x5dc62b={'count':0x0,'rows':[]};var _0x3893b5=_[_0x2871('0x2a')](db[_0x2871('0x2b')][_0x2871('0x2c')],function(_0x4004c4){return{'name':_0x4004c4[_0x2871('0x2d')],'type':_0x4004c4[_0x2871('0x2e')][_0x2871('0x2f')]};});_0x58ec59[_0x2871('0x30')]=_[_0x2871('0x2a')](_0x3893b5,'name');_0x58ec59['query']=_[_0x2871('0x31')](_0x522a78[_0x2871('0x32')]);_0x58ec59[_0x2871('0x33')]=_['intersection'](_0x58ec59[_0x2871('0x30')],_0x58ec59[_0x2871('0x32')]);_0x133a4a[_0x2871('0x34')]=_[_0x2871('0x35')](_0x58ec59[_0x2871('0x30')],qs[_0x2871('0x36')](_0x522a78['query'][_0x2871('0x36')]));_0x133a4a[_0x2871('0x34')]=_0x133a4a[_0x2871('0x34')][_0x2871('0x37')]?_0x133a4a[_0x2871('0x34')]:_0x58ec59[_0x2871('0x30')];if(!_0x522a78[_0x2871('0x32')]['hasOwnProperty'](_0x2871('0x38'))){_0x133a4a[_0x2871('0x1f')]=qs[_0x2871('0x1f')](_0x522a78[_0x2871('0x32')][_0x2871('0x1f')]);_0x133a4a['offset']=qs['offset'](_0x522a78[_0x2871('0x32')][_0x2871('0x1d')]);}_0x133a4a[_0x2871('0x39')]=qs[_0x2871('0x3a')](_0x522a78[_0x2871('0x32')]['sort']);_0x133a4a['where']=qs[_0x2871('0x33')](_[_0x2871('0x3b')](_0x522a78[_0x2871('0x32')],_0x58ec59[_0x2871('0x33')]),_0x3893b5);if(_0x522a78[_0x2871('0x32')][_0x2871('0x3c')]){_0x133a4a[_0x2871('0x3d')]=_[_0x2871('0x3e')](_0x133a4a[_0x2871('0x3d')],{'$or':_['map'](_0x3893b5,function(_0x4f69f1){if(_0x4f69f1[_0x2871('0x2e')]!=='VIRTUAL'){var _0xaf05bb={};_0xaf05bb[_0x4f69f1['name']]={'$like':'%'+_0x522a78[_0x2871('0x32')][_0x2871('0x3c')]+'%'};return _0xaf05bb;}})});}_0x133a4a=_[_0x2871('0x3e')]({},_0x133a4a,_0x522a78[_0x2871('0x3f')]);var _0x29db27={'where':_0x133a4a[_0x2871('0x3d')]};return db['Attachment'][_0x2871('0x20')](_0x29db27)['then'](function(_0x22c17d){_0x5dc62b[_0x2871('0x20')]=_0x22c17d;if(_0x522a78[_0x2871('0x32')]['includeAll']){_0x133a4a['include']=[{'all':!![]}];}return db[_0x2871('0x2b')][_0x2871('0x40')](_0x133a4a);})['then'](function(_0x253643){_0x5dc62b[_0x2871('0x41')]=_0x253643;return _0x5dc62b;})['then'](respondWithFilteredResult(_0x510c3b,_0x133a4a))[_0x2871('0x42')](handleError(_0x510c3b,null));};exports[_0x2871('0x43')]=function(_0x59b53d,_0x129f43){var _0x30d2d5={'raw':!![],'where':{'id':_0x59b53d[_0x2871('0x44')]['id']}},_0x13e0a4={};_0x13e0a4[_0x2871('0x30')]=_['keys'](db[_0x2871('0x2b')]['rawAttributes']);_0x13e0a4[_0x2871('0x32')]=_[_0x2871('0x31')](_0x59b53d[_0x2871('0x32')]);_0x13e0a4['filters']=_[_0x2871('0x35')](_0x13e0a4[_0x2871('0x30')],_0x13e0a4[_0x2871('0x32')]);_0x30d2d5[_0x2871('0x34')]=_['intersection'](_0x13e0a4[_0x2871('0x30')],qs[_0x2871('0x36')](_0x59b53d['query']['fields']));_0x30d2d5['attributes']=_0x30d2d5['attributes'][_0x2871('0x37')]?_0x30d2d5['attributes']:_0x13e0a4['model'];if(_0x59b53d[_0x2871('0x32')][_0x2871('0x45')]){_0x30d2d5['include']=[{'all':!![]}];}_0x30d2d5=_[_0x2871('0x3e')]({},_0x30d2d5,_0x59b53d['options']);return db[_0x2871('0x2b')][_0x2871('0x46')](_0x30d2d5)[_0x2871('0x25')](handleEntityNotFound(_0x129f43,null))['then'](respondWithResult(_0x129f43,null))[_0x2871('0x42')](handleError(_0x129f43,null));};exports[_0x2871('0x47')]=function(_0x17977a,_0x2a11f6){var _0x375e75={'where':{'id':_0x17977a[_0x2871('0x44')]['id']}},_0xd84600={};_0xd84600[_0x2871('0x30')]=_[_0x2871('0x31')](db['Attachment']['rawAttributes']);_0x375e75['attributes']=_[_0x2871('0x35')](_0xd84600[_0x2871('0x30')],qs[_0x2871('0x36')](_0x17977a['query'][_0x2871('0x36')]));_0x375e75[_0x2871('0x34')]=_0x375e75[_0x2871('0x34')][_0x2871('0x37')]?_0x375e75['attributes']:_0xd84600['model'];if(_0x17977a[_0x2871('0x32')][_0x2871('0x45')]){_0x375e75[_0x2871('0x48')]=[{'all':!![]}];}_0x375e75=_['merge']({},_0x375e75,_0x17977a[_0x2871('0x3f')]);return db[_0x2871('0x2b')][_0x2871('0x46')](_0x375e75)[_0x2871('0x25')](handleEntityNotFound(_0x2a11f6,null))[_0x2871('0x25')](function(_0x590992){if(_0x590992){var _0x1e8155=_0x590992[_0x2871('0x49')]({'plain':!![]});_0x1e8155=qs[_0x2871('0x4a')](_0x1e8155,['id',_0x2871('0x4b'),_0x2871('0x4c')]);_0x17977a[_0x2871('0x4d')]=_[_0x2871('0x4a')](_0x17977a[_0x2871('0x4d')],['id',_0x2871('0x4b'),'updatedAt']);return db[_0x2871('0x2b')][_0x2871('0x4e')](_[_0x2871('0x3e')](_0x1e8155,_0x17977a[_0x2871('0x4d')]),{'include':_0x17977a[_0x2871('0x32')][_0x2871('0x45')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x2a11f6,0xc9))['catch'](handleError(_0x2a11f6,null));};exports[_0x2871('0x4f')]=function(_0x2faec1,_0x3c9c6f){if(_0x2faec1[_0x2871('0x4d')]['id']){delete _0x2faec1[_0x2871('0x4d')]['id'];}return db[_0x2871('0x2b')][_0x2871('0x46')]({'where':{'id':_0x2faec1['params']['id']}})[_0x2871('0x25')](handleEntityNotFound(_0x3c9c6f,null))['then'](saveUpdates(_0x2faec1[_0x2871('0x4d')],null))[_0x2871('0x25')](respondWithResult(_0x3c9c6f,null))[_0x2871('0x42')](handleError(_0x3c9c6f,null));};exports['destroy']=function(_0x314da1,_0x25dfda){return db[_0x2871('0x2b')]['find']({'where':{'id':_0x314da1[_0x2871('0x44')]['id']}})[_0x2871('0x25')](handleEntityNotFound(_0x25dfda,null))[_0x2871('0x25')](removeEntity(_0x25dfda,null))[_0x2871('0x42')](handleError(_0x25dfda,null));};exports[_0x2871('0x4e')]=function(_0x426a6d,_0x138e35,_0x2971eb){_0x426a6d[_0x2871('0x4d')][_0x2871('0x50')]=_0x426a6d['file']['originalname'];_0x426a6d[_0x2871('0x4d')][_0x2871('0x51')]=_0x426a6d[_0x2871('0x52')][_0x2871('0x53')];_0x426a6d[_0x2871('0x4d')][_0x2871('0x2e')]=_0x426a6d[_0x2871('0x52')]['mimetype'];return db[_0x2871('0x2b')]['create'](_0x426a6d[_0x2871('0x4d')])[_0x2871('0x25')](respondWithResult(_0x138e35,0xc9))[_0x2871('0x42')](handleError(_0x138e35,null));};exports[_0x2871('0x54')]=function(_0x448de7,_0xe14300,_0x23a3eb){return db[_0x2871('0x2b')][_0x2871('0x55')]({'where':{'id':_0x448de7[_0x2871('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0xe14300,null))['then'](function(_0x578d7b){if(_0x578d7b){var _0x598115=_0x578d7b[_0x2871('0x56')]!==null;var _0x5ea758=path[_0x2871('0x57')](config[_0x2871('0x58')],_0x2871('0x59'));if(_0x598115){_0x5ea758=path[_0x2871('0x57')](_0x5ea758,_0x2871('0x5a'));}var _0x129b5a=path[_0x2871('0x57')](_0x5ea758,_0x578d7b['basename']);return _0xe14300['download'](_0x129b5a);}})['catch'](handleError(_0xe14300,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 52f505b..dfae427 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 _0xd7f6=['moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments'];(function(_0x32f93b,_0x413891){var _0x440841=function(_0x20ff1d){while(--_0x20ff1d){_0x32f93b['push'](_0x32f93b['shift']());}};_0x440841(++_0x413891);}(_0xd7f6,0x154));var _0x6d7f=function(_0x590b88,_0xaa6a0d){_0x590b88=_0x590b88-0x0;var _0x10a4c5=_0xd7f6[_0x590b88];return _0x10a4c5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6d7f('0x0'));var BPromise=require(_0x6d7f('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d7f('0x2'));var rimraf=require(_0x6d7f('0x3'));var config=require(_0x6d7f('0x4'));var attributes=require(_0x6d7f('0x5'));module[_0x6d7f('0x6')]=function(_0x118006,_0x1bbb7a){return _0x118006[_0x6d7f('0x7')](_0x6d7f('0x8'),attributes,{'tableName':_0x6d7f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x24a6=['../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','Attachment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x24a6,0x19e));var _0x624a=function(_0x4948bc,_0x466d19){_0x4948bc=_0x4948bc-0x0;var _0x342d1f=_0x24a6[_0x4948bc];return _0x342d1f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x624a('0x0'))(_0x624a('0x1'));var moment=require(_0x624a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x624a('0x3'));var rimraf=require(_0x624a('0x4'));var config=require(_0x624a('0x5'));var attributes=require('./attachment.attributes');module[_0x624a('0x6')]=function(_0xc7836e,_0x7dfe8f){return _0xc7836e[_0x624a('0x7')](_0x624a('0x8'),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 3f606d7..f50b9e7 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 _0x4d9e=['CreateAttachment','Attachment','create','body','options','raw','lodash','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','catch'];(function(_0x438e4c,_0x49f140){var _0x250901=function(_0x4dfad9){while(--_0x4dfad9){_0x438e4c['push'](_0x438e4c['shift']());}};_0x250901(++_0x49f140);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x218587,_0x370ace){_0x218587=_0x218587-0x0;var _0x5713f9=_0x4d9e[_0x218587];return _0x5713f9;};'use strict';var _=require(_0xe4d9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe4d9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4d9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe4d9('0x3'));var logger=require(_0xe4d9('0x4'))('rpc');var config=require(_0xe4d9('0x5'));var jayson=require(_0xe4d9('0x6'));var client=jayson[_0xe4d9('0x7')][_0xe4d9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x125dbc,_0x32222c,_0x54a63a){return new BPromise(function(_0x36316f,_0x1d3810){return client[_0xe4d9('0x9')](_0x125dbc,_0x54a63a)[_0xe4d9('0xa')](function(_0x3f8937){logger[_0xe4d9('0xb')]('Attachment,\x20%s,\x20%s',_0x32222c,_0xe4d9('0xc'));logger[_0xe4d9('0xd')](_0xe4d9('0xe'),_0x32222c,_0xe4d9('0xc'),JSON[_0xe4d9('0xf')](_0x3f8937));if(_0x3f8937[_0xe4d9('0x10')]){if(_0x3f8937[_0xe4d9('0x10')]['code']===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x32222c,_0x3f8937['error']['message']);return _0x1d3810(_0x3f8937['error']['message']);}logger['error'](_0xe4d9('0x11'),_0x32222c,_0x3f8937[_0xe4d9('0x10')][_0xe4d9('0x12')]);return _0x36316f(_0x3f8937['error'][_0xe4d9('0x12')]);}else{logger[_0xe4d9('0xb')](_0xe4d9('0x11'),_0x32222c,_0xe4d9('0xc'));_0x36316f(_0x3f8937['result'][_0xe4d9('0x12')]);}})[_0xe4d9('0x13')](function(_0x4687f8){logger['error']('Attachment,\x20%s,\x20%s',_0x32222c,_0x4687f8);_0x1d3810(_0x4687f8);});});}exports[_0xe4d9('0x14')]=function(_0x112315){var _0x5ab3d1=this;return new Promise(function(_0x2e1490,_0x4f8dba){return db[_0xe4d9('0x15')][_0xe4d9('0x16')](_0x112315[_0xe4d9('0x17')],{'raw':_0x112315[_0xe4d9('0x18')]?_0x112315['options'][_0xe4d9('0x19')]===undefined?!![]:![]:!![]})[_0xe4d9('0xa')](function(_0x151220){logger[_0xe4d9('0xb')](_0xe4d9('0x14'),_0x112315);logger[_0xe4d9('0xd')](_0xe4d9('0x14'),_0x112315,JSON[_0xe4d9('0xf')](_0x151220));_0x2e1490(_0x151220);})[_0xe4d9('0x13')](function(_0x4fed7f){logger[_0xe4d9('0x10')](_0xe4d9('0x14'),_0x4fed7f['message'],_0x112315);_0x4f8dba(_0x5ab3d1[_0xe4d9('0x10')](0x1f4,_0x4fed7f['message']));});});};
\ No newline at end of file
+var _0x79d8=['client','http','request','then','Attachment,\x20%s,\x20%s','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateAttachment','create','options','raw','info','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x3a8425,_0xc10467){var _0x5c5480=function(_0x1c3168){while(--_0x1c3168){_0x3a8425['push'](_0x3a8425['shift']());}};_0x5c5480(++_0xc10467);}(_0x79d8,0x67));var _0x879d=function(_0x189f47,_0x3fd794){_0x189f47=_0x189f47-0x0;var _0x415a3c=_0x79d8[_0x189f47];return _0x415a3c;};'use strict';var _=require(_0x879d('0x0'));var util=require(_0x879d('0x1'));var moment=require(_0x879d('0x2'));var BPromise=require(_0x879d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x879d('0x4'));var db=require(_0x879d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x879d('0x6'))(_0x879d('0x7'));var config=require(_0x879d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x879d('0x9')][_0x879d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x142181,_0xc70b64,_0x49c05d){return new BPromise(function(_0x257050,_0x154db7){return client[_0x879d('0xb')](_0x142181,_0x49c05d)[_0x879d('0xc')](function(_0x2d5fbc){logger['info'](_0x879d('0xd'),_0xc70b64,'request\x20sent');logger['debug'](_0x879d('0xe'),_0xc70b64,_0x879d('0xf'),JSON[_0x879d('0x10')](_0x2d5fbc));if(_0x2d5fbc['error']){if(_0x2d5fbc[_0x879d('0x11')][_0x879d('0x12')]===0x1f4){logger['error'](_0x879d('0xd'),_0xc70b64,_0x2d5fbc[_0x879d('0x11')]['message']);return _0x154db7(_0x2d5fbc[_0x879d('0x11')]['message']);}logger[_0x879d('0x11')](_0x879d('0xd'),_0xc70b64,_0x2d5fbc[_0x879d('0x11')][_0x879d('0x13')]);return _0x257050(_0x2d5fbc[_0x879d('0x11')][_0x879d('0x13')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0xc70b64,_0x879d('0xf'));_0x257050(_0x2d5fbc[_0x879d('0x14')]['message']);}})['catch'](function(_0x7478cd){logger[_0x879d('0x11')](_0x879d('0xd'),_0xc70b64,_0x7478cd);_0x154db7(_0x7478cd);});});}exports[_0x879d('0x15')]=function(_0x3a26e5){var _0x1a6252=this;return new Promise(function(_0x291c96,_0x50539d){return db['Attachment'][_0x879d('0x16')](_0x3a26e5['body'],{'raw':_0x3a26e5[_0x879d('0x17')]?_0x3a26e5['options'][_0x879d('0x18')]===undefined?!![]:![]:!![]})[_0x879d('0xc')](function(_0x31e5d5){logger[_0x879d('0x19')](_0x879d('0x15'),_0x3a26e5);logger[_0x879d('0x1a')](_0x879d('0x15'),_0x3a26e5,JSON['stringify'](_0x31e5d5));_0x291c96(_0x31e5d5);})[_0x879d('0x1b')](function(_0x460020){logger[_0x879d('0x11')](_0x879d('0x15'),_0x460020[_0x879d('0x13')],_0x3a26e5);_0x50539d(_0x1a6252[_0x879d('0x11')](0x1f4,_0x460020['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 6ccb4f5..521e74a 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 _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x42eeea,_0x1c45a1){var _0x1b7375=function(_0x4caeb4){while(--_0x4caeb4){_0x42eeea['push'](_0x42eeea['shift']());}};_0x1b7375(++_0x1c45a1);}(_0xadb5,0xad));var _0x5adb=function(_0x2e4e4c,_0x30286a){_0x2e4e4c=_0x2e4e4c-0x0;var _0x48ce6e=_0xadb5[_0x2e4e4c];return _0x48ce6e;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
+var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4a3ee3,_0x304512){_0x4a3ee3=_0x4a3ee3-0x0;var _0x56d16d=_0x0b0e[_0x4a3ee3];return _0x56d16d;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 2c2774b..463cba0 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 _0xc2ec=['blockDuration','minutes','getLicense','catch','status','send','message','ad-login','json','use','User','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/logger','api','activedirectory','undefined','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','blocked','online','disabled','blockedAt','add'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2ec,0x13f));var _0xcc2e=function(_0x2bfd67,_0x393812){_0x2bfd67=_0x2bfd67-0x0;var _0x46bf94=_0xc2ec[_0x2bfd67];return _0x46bf94;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xcc2e('0x0'))[_0xcc2e('0x1')];var moment=require(_0xcc2e('0x2'));var ActiveDirectory=require(_0xcc2e('0x3'));var BPromise=require(_0xcc2e('0x4'));var util=require(_0xcc2e('0x5'));var db=require(_0xcc2e('0x6'))['db'];var authService=require(_0xcc2e('0x7'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0xcc2e('0x8'))(_0xcc2e('0x9'));function isActiveDirectoryConfigured(_0x2c0646){var _0x5ef647=![];if(typeof _0x2c0646[_0xcc2e('0xa')]!==_0xcc2e('0xb')){_0x5ef647=_0x2c0646[_0xcc2e('0xa')]['baseDN']&&_0x2c0646[_0xcc2e('0xa')][_0xcc2e('0xc')]&&_0x2c0646[_0xcc2e('0xa')][_0xcc2e('0xd')];}return _0x5ef647;}function adAuthenticate(_0x4934ce,_0x4733aa,_0x2ad492){return new BPromise(function(_0x3da67b,_0x4b3993){try{var _0xd602af=new ActiveDirectory(_0x4934ce);_0xd602af[_0xcc2e('0xe')](_0x4733aa,_0x2ad492,function(_0x44df99,_0x3d8785){if(_0x44df99){logger['error'](_0xcc2e('0xf'),_0x4733aa,util[_0xcc2e('0x10')](_0x44df99,{'showHidden':![],'depth':null}));_0x4b3993(_0xcc2e('0x11'));}else if(!_0x3d8785){logger[_0xcc2e('0x12')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x4733aa);_0x4b3993(_0xcc2e('0x11'));}else{_0x3da67b(_0x3d8785);}});}catch(_0x5a3749){_0x4b3993(_0x5a3749);}});}function ActiveDirectoryAuthenticate(_0x5db635,_0x26ade1,_0x4d871c,_0x4a6894){var _0x30ffba,_0x34f9a8;if(!isActiveDirectoryConfigured(config)){logger[_0xcc2e('0x12')](_0xcc2e('0x13'),_0x26ade1);return _0x4a6894(null,![],{'message':_0xcc2e('0x11')});}return db[_0xcc2e('0x14')][_0xcc2e('0x15')]({'where':{'id':0x1},'attributes':[_0xcc2e('0x16'),'blockDuration'],'raw':!![]})[_0xcc2e('0x17')](function(_0xa9d123){_0x30ffba=_0xa9d123;if(!_0x30ffba[_0xcc2e('0x16')]){logger[_0xcc2e('0x12')](_0xcc2e('0x18'),_0x26ade1);throw new Error(_0xcc2e('0x11'));}return _0x5db635[_0xcc2e('0x15')]({'attributes':['id',_0xcc2e('0x19'),_0xcc2e('0x1a'),_0xcc2e('0x1b'),'role','disabled',_0xcc2e('0x1c'),'blockedAt',_0xcc2e('0x1d')],'where':{'name':_0x26ade1,'role':{'$or':['admin','user','agent']},'adSsoEnabled':!![]}});})['then'](function(_0x106ca5){if(!_0x106ca5||_0x106ca5&&_0x106ca5['name']!==_0x26ade1){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x34f9a8=_0x106ca5;var _0x508d53=_0x34f9a8[_0xcc2e('0x19')]+'@'+config[_0xcc2e('0xa')][_0xcc2e('0xd')];return adAuthenticate(config[_0xcc2e('0xa')],_0x508d53,_0x4d871c);})['then'](function(_0x2c2cfc){if(_0x34f9a8[_0xcc2e('0x1e')]){throw new Error(_0xcc2e('0x11'));}if(_0x30ffba['blockDuration']>0x0){if(_0x34f9a8[_0xcc2e('0x1c')]){if(moment(_0x34f9a8[_0xcc2e('0x1f')])[_0xcc2e('0x20')](_0x30ffba[_0xcc2e('0x21')],_0xcc2e('0x22'))>moment()){throw new Error(_0xcc2e('0x11'));}return utils['clearBlockUser'](_0x34f9a8,0x0,![],null)[_0xcc2e('0x17')](function(){return utils['getLicense'](_0x34f9a8);})[_0xcc2e('0x17')](function(){return _0x4a6894(null,_0x34f9a8);});}else{return utils['getLicense'](_0x34f9a8)[_0xcc2e('0x17')](function(){return _0x4a6894(null,_0x34f9a8);});}}else{return utils[_0xcc2e('0x23')](_0x34f9a8)[_0xcc2e('0x17')](function(){return _0x4a6894(null,_0x34f9a8);});}})[_0xcc2e('0x24')](function(_0x1f7357){return _0x4a6894(null,![],_0x1f7357);});}function handleError(_0x1e0a4a,_0x2cea84,_0x51adfe){return _0x1e0a4a[_0xcc2e('0x25')](_0x2cea84||0x1f4)[_0xcc2e('0x26')]({'message':_0x51adfe?_0x51adfe[_0xcc2e('0x27')]||_0x51adfe:''});}exports['login']=function(_0x49ec71,_0x458448,_0x4aeea3){passport[_0xcc2e('0xe')](_0xcc2e('0x28'),function(_0x44fe71,_0x13e47a,_0x590103){var _0x1be76a=_0x44fe71||_0x590103;if(_0x1be76a){return handleError(_0x458448,0x191,_0x1be76a);}if(!_0x13e47a){return handleError(_0x458448,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x5dcd51={'payload':{'id':_0x13e47a['id'],'role':_0x13e47a['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5dcd51)[_0xcc2e('0x17')](function(_0x1ca8a9){_0x458448[_0xcc2e('0x29')]({'id':_0x13e47a['id'],'token':_0x1ca8a9,'statusCall':'','isAlreadyLogged':_0x13e47a['online']});});}})(_0x49ec71,_0x458448,_0x4aeea3);};passport[_0xcc2e('0x2a')](_0xcc2e('0x28'),new LocalStrategy({'usernameField':_0xcc2e('0x19'),'passwordField':_0xcc2e('0x1a')},function(_0x58b63b,_0x4a099d,_0x5c3601){return ActiveDirectoryAuthenticate(db[_0xcc2e('0x2b')],_0x58b63b,_0x4a099d,_0x5c3601);}));
\ No newline at end of file
+var _0x811b=['signToken','json','use','User','passport','moment','activedirectory2','../../mysqldb','../../config/utils','../../config/environment','activedirectory','undefined','url','authenticate','error','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','online','admin','user','agent','then','blockDuration','blockedAt','add','minutes','getLicense','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.'];(function(_0x2c90c1,_0x446eda){var _0xcb55d4=function(_0x30e230){while(--_0x30e230){_0x2c90c1['push'](_0x2c90c1['shift']());}};_0xcb55d4(++_0x446eda);}(_0x811b,0xb0));var _0xb811=function(_0x422b48,_0xf131fb){_0x422b48=_0x422b48-0x0;var _0x4a6f67=_0x811b[_0x422b48];return _0x4a6f67;};'use strict';var passport=require(_0xb811('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0xb811('0x1'));var ActiveDirectory=require(_0xb811('0x2'));var BPromise=require('bluebird');var util=require('util');var db=require(_0xb811('0x3'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xb811('0x4'));var config=require(_0xb811('0x5'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x636de4){var _0x23f582=![];if(typeof _0x636de4[_0xb811('0x6')]!==_0xb811('0x7')){_0x23f582=_0x636de4[_0xb811('0x6')]['baseDN']&&_0x636de4[_0xb811('0x6')][_0xb811('0x8')]&&_0x636de4[_0xb811('0x6')]['domain'];}return _0x23f582;}function adAuthenticate(_0xe321fa,_0x3c1ed3,_0x564ee4){return new BPromise(function(_0x647d40,_0x4c7acb){try{var _0xd969d2=new ActiveDirectory(_0xe321fa);_0xd969d2[_0xb811('0x9')](_0x3c1ed3,_0x564ee4,function(_0x2a02d4,_0x4a0312){if(_0x2a02d4){logger[_0xb811('0xa')]('Error\x20authenticate\x20%s:\x20%s',_0x3c1ed3,util[_0xb811('0xb')](_0x2a02d4,{'showHidden':![],'depth':null}));_0x4c7acb('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x4a0312){logger[_0xb811('0xa')](_0xb811('0xc'),_0x3c1ed3);_0x4c7acb('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x647d40(_0x4a0312);}});}catch(_0x337310){_0x4c7acb(_0x337310);}});}function ActiveDirectoryAuthenticate(_0x4c1977,_0x5305fd,_0x1a0986,_0x463b45){var _0x47ac2a,_0x32ef1c;if(!isActiveDirectoryConfigured(config)){logger[_0xb811('0xa')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x5305fd);return _0x463b45(null,![],{'message':_0xb811('0xd')});}return db[_0xb811('0xe')][_0xb811('0xf')]({'where':{'id':0x1},'attributes':[_0xb811('0x10'),'blockDuration'],'raw':!![]})['then'](function(_0x3f4c8b){_0x47ac2a=_0x3f4c8b;if(!_0x47ac2a['adSsoEnabled']){logger['error'](_0xb811('0x11'),_0x5305fd);throw new Error(_0xb811('0xd'));}return _0x4c1977[_0xb811('0xf')]({'attributes':['id',_0xb811('0x12'),_0xb811('0x13'),_0xb811('0x14'),_0xb811('0x15'),_0xb811('0x16'),_0xb811('0x17'),'blockedAt',_0xb811('0x18')],'where':{'name':_0x5305fd,'role':{'$or':[_0xb811('0x19'),_0xb811('0x1a'),_0xb811('0x1b')]},'adSsoEnabled':!![]}});})[_0xb811('0x1c')](function(_0x58343a){if(!_0x58343a||_0x58343a&&_0x58343a['name']!==_0x5305fd){throw new Error(_0xb811('0xd'));}_0x32ef1c=_0x58343a;var _0x5c95f9=_0x32ef1c[_0xb811('0x12')]+'@'+config[_0xb811('0x6')]['domain'];return adAuthenticate(config['activedirectory'],_0x5c95f9,_0x1a0986);})[_0xb811('0x1c')](function(_0x30b929){if(_0x32ef1c[_0xb811('0x16')]){throw new Error(_0xb811('0xd'));}if(_0x47ac2a[_0xb811('0x1d')]>0x0){if(_0x32ef1c['blocked']){if(moment(_0x32ef1c[_0xb811('0x1e')])[_0xb811('0x1f')](_0x47ac2a[_0xb811('0x1d')],_0xb811('0x20'))>moment()){throw new Error(_0xb811('0xd'));}return utils['clearBlockUser'](_0x32ef1c,0x0,![],null)[_0xb811('0x1c')](function(){return utils[_0xb811('0x21')](_0x32ef1c);})[_0xb811('0x1c')](function(){return _0x463b45(null,_0x32ef1c);});}else{return utils[_0xb811('0x21')](_0x32ef1c)['then'](function(){return _0x463b45(null,_0x32ef1c);});}}else{return utils[_0xb811('0x21')](_0x32ef1c)[_0xb811('0x1c')](function(){return _0x463b45(null,_0x32ef1c);});}})['catch'](function(_0x525626){return _0x463b45(null,![],_0x525626);});}function handleError(_0x1821fd,_0x272197,_0x3d88ad){return _0x1821fd[_0xb811('0x22')](_0x272197||0x1f4)[_0xb811('0x23')]({'message':_0x3d88ad?_0x3d88ad[_0xb811('0x24')]||_0x3d88ad:''});}exports['login']=function(_0x5b3671,_0x2cbcdf,_0x2e3869){passport[_0xb811('0x9')](_0xb811('0x25'),function(_0x4c0d4f,_0xea576c,_0x5d568a){var _0x1c559a=_0x4c0d4f||_0x5d568a;if(_0x1c559a){return handleError(_0x2cbcdf,0x191,_0x1c559a);}if(!_0xea576c){return handleError(_0x2cbcdf,0x194,{'message':_0xb811('0x26')});}else{var _0x4e444f={'payload':{'id':_0xea576c['id'],'role':_0xea576c[_0xb811('0x15')]},'options':{'expiresIn':0x15180}};return authService[_0xb811('0x27')](_0x4e444f)[_0xb811('0x1c')](function(_0x656e13){_0x2cbcdf[_0xb811('0x28')]({'id':_0xea576c['id'],'token':_0x656e13,'statusCall':'','isAlreadyLogged':_0xea576c['online']});});}})(_0x5b3671,_0x2cbcdf,_0x2e3869);};passport[_0xb811('0x29')](_0xb811('0x25'),new LocalStrategy({'usernameField':'name','passwordField':_0xb811('0x13')},function(_0x319bfa,_0x335f78,_0x1accba){return ActiveDirectoryAuthenticate(db[_0xb811('0x2a')],_0x319bfa,_0x335f78,_0x1accba);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 8505ae2..dd5f374 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 _0x0956=['post','login','express','Router','./authActiveDirectory.controller'];(function(_0x401089,_0x469a19){var _0x128e7c=function(_0x286ffa){while(--_0x286ffa){_0x401089['push'](_0x401089['shift']());}};_0x128e7c(++_0x469a19);}(_0x0956,0x160));var _0x6095=function(_0x56d24b,_0x420a40){_0x56d24b=_0x56d24b-0x0;var _0x31d66a=_0x0956[_0x56d24b];return _0x31d66a;};'use strict';var express=require(_0x6095('0x0'));var router=express[_0x6095('0x1')]();var controller=require(_0x6095('0x2'));router[_0x6095('0x3')]('/',controller[_0x6095('0x4')]);module['exports']=router;
\ No newline at end of file
+var _0xe335=['login','exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x251556,_0x31fa66){var _0x3f3d0d=function(_0x4ab3d7){while(--_0x4ab3d7){_0x251556['push'](_0x251556['shift']());}};_0x3f3d0d(++_0x31fa66);}(_0xe335,0xda));var _0x5e33=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe335[_0x42cae2];return _0x5f256f;};'use strict';var express=require(_0x5e33('0x0'));var router=express[_0x5e33('0x1')]();var controller=require(_0x5e33('0x2'));router[_0x5e33('0x3')]('/',controller[_0x5e33('0x4')]);module[_0x5e33('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index a18ef61..a6202bb 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(_0x52b3c9,_0x2bf3ae){var _0x36423d=function(_0x129862){while(--_0x129862){_0x52b3c9['push'](_0x52b3c9['shift']());}};_0x36423d(++_0x2bf3ae);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+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(_0x53f587,_0x104532){var _0x16f2de=function(_0x205ab0){while(--_0x205ab0){_0x53f587['push'](_0x53f587['shift']());}};_0x16f2de(++_0x104532);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 03b3f1c..2e97ecf 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 _0xbe44=['callback','isMiddleware','setTokenCookie','exports','express','Router','./authGoogle.controller','../../components/auth/service','login','get'];(function(_0x28f8ef,_0x54040c){var _0x5343ca=function(_0xec294d){while(--_0xec294d){_0x28f8ef['push'](_0x28f8ef['shift']());}};_0x5343ca(++_0x54040c);}(_0xbe44,0x13a));var _0x4be4=function(_0x451980,_0x2ad060){_0x451980=_0x451980-0x0;var _0x3a66cf=_0xbe44[_0x451980];return _0x3a66cf;};'use strict';var express=require(_0x4be4('0x0'));var passport=require('passport');var router=express[_0x4be4('0x1')]();var controller=require(_0x4be4('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x4be4('0x3'));router['get']('/',controller[_0x4be4('0x4')]);router[_0x4be4('0x5')]('/callback',controller[_0x4be4('0x6')],authService[_0x4be4('0x7')],userController[_0x4be4('0x4')],authService[_0x4be4('0x8')]);module[_0x4be4('0x9')]=router;
\ No newline at end of file
+var _0xa925=['login','setTokenCookie','Router','../../components/auth/service','get','/callback','callback','isMiddleware'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0xa925,0x1b2));var _0x5a92=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xa925[_0x4c12ec];return _0x3ae42c;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0x5a92('0x0')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x5a92('0x1'));router[_0x5a92('0x2')]('/',controller['login']);router[_0x5a92('0x2')](_0x5a92('0x3'),controller[_0x5a92('0x4')],authService[_0x5a92('0x5')],userController[_0x5a92('0x6')],authService[_0x5a92('0x7')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 44bcba4..c7e443f 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 _0x0bae=['/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','password','enforcePasswordHistory','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','User','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','add','getLicense','catch','MailAccount','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','host'];(function(_0x5e2bec,_0x5bc60a){var _0x2ff298=function(_0x194022){while(--_0x194022){_0x5e2bec['push'](_0x5e2bec['shift']());}};_0x2ff298(++_0x5bc60a);}(_0x0bae,0xbb));var _0xe0ba=function(_0x187e0e,_0x2898a3){_0x187e0e=_0x187e0e-0x0;var _0x55321e=_0x0bae[_0x187e0e];return _0x55321e;};'use strict';var util=require(_0xe0ba('0x0'));var passport=require(_0xe0ba('0x1'));var LocalStrategy=require(_0xe0ba('0x2'))[_0xe0ba('0x3')];var jayson=require(_0xe0ba('0x4'));var _=require(_0xe0ba('0x5'));var rs=require(_0xe0ba('0x6'));var moment=require(_0xe0ba('0x7'));var db=require(_0xe0ba('0x8'))['db'];var authService=require(_0xe0ba('0x9'));var utils=require('../../config/utils');var client=jayson[_0xe0ba('0xa')][_0xe0ba('0xb')]({'port':0x232b});function localAuthenticate(_0x5ad2ee,_0x80e64e,_0x2ceff5,_0x4caf77){var _0x1aae49,_0x1c1744;return db[_0xe0ba('0xc')][_0xe0ba('0xd')]({'where':{'id':0x1},'attributes':[_0xe0ba('0xe'),_0xe0ba('0xf')],'raw':!![]})['then'](function(_0x35292d){_0x1aae49=_0x35292d;return _0x5ad2ee[_0xe0ba('0xd')]({'attributes':['id',_0xe0ba('0x10'),'password',_0xe0ba('0x11'),_0xe0ba('0x12'),_0xe0ba('0x13'),_0xe0ba('0x14'),_0xe0ba('0x15'),_0xe0ba('0x16')],'where':{'name':_0x80e64e,'role':{'$or':[_0xe0ba('0x17'),_0xe0ba('0x18'),_0xe0ba('0x19')]}}});})[_0xe0ba('0x1a')](function(_0x31a549){if(!_0x31a549||_0x31a549&&_0x31a549[_0xe0ba('0x10')]!==_0x80e64e){throw new Error(_0xe0ba('0x1b'));}else{_0x1c1744=_0x31a549;return _0x1c1744;}})[_0xe0ba('0x1a')](function(){_0x1c1744[_0xe0ba('0x1c')](_0x2ceff5,function(_0x1bb194,_0x1014cd){var _0x36e520=_0x1c1744[_0xe0ba('0x16')]+0x1;if(_0x1bb194){return _0x4caf77(_0x1bb194);}else if(!_0x1014cd){if(_0x1c1744[_0xe0ba('0x13')]){return _0x4caf77(null,![],{'message':_0xe0ba('0x1b')});}else if(_0x1aae49['allowedLoginAttempts']>0x0){if(_0x1c1744[_0xe0ba('0x14')]){if(_0x1aae49[_0xe0ba('0xf')]>0x0){if(moment(_0x1c1744[_0xe0ba('0x15')])['add'](_0x1aae49['blockDuration'],_0xe0ba('0x1d'))>moment()){return _0x4caf77(null,![],{'message':_0xe0ba('0x1b')});}else{return utils[_0xe0ba('0x1e')](_0x1c1744,_0x36e520,![],null)[_0xe0ba('0x1a')](function(){return _0x4caf77(null,![],{'message':_0xe0ba('0x1b')});});}}else{return _0x4caf77(null,![],{'message':_0xe0ba('0x1b')});}}else{if(_0x36e520>=_0x1aae49[_0xe0ba('0xe')]){return utils[_0xe0ba('0x1e')](_0x1c1744,0x0,!![],moment())[_0xe0ba('0x1a')](function(){return _0x4caf77(null,![],{'message':_0xe0ba('0x1b')});});}else{return utils[_0xe0ba('0x1e')](_0x1c1744,_0x36e520,![],null)[_0xe0ba('0x1a')](function(){return _0x4caf77(null,![],{'message':_0xe0ba('0x1b')});});}}}else{return _0x4caf77(null,![],{'message':_0xe0ba('0x1b')});}}else{if(_0x1c1744['disabled']){return _0x4caf77(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1aae49['allowedLoginAttempts']>0x0){if(_0x1c1744['blocked']){if(_0x1aae49['blockDuration']>0x0){if(moment(_0x1c1744[_0xe0ba('0x15')])[_0xe0ba('0x1f')](_0x1aae49[_0xe0ba('0xf')],_0xe0ba('0x1d'))>moment()){return _0x4caf77(null,![],{'message':_0xe0ba('0x1b')});}else{return utils[_0xe0ba('0x1e')](_0x1c1744,0x0,![],null)['then'](function(){return utils[_0xe0ba('0x20')](_0x1c1744);})[_0xe0ba('0x1a')](function(){return _0x4caf77(null,_0x1c1744);});}}else{return _0x4caf77(null,![],{'message':_0xe0ba('0x1b')});}}else{return utils[_0xe0ba('0x1e')](_0x1c1744,0x0,![],null)['then'](function(){return utils[_0xe0ba('0x20')](_0x1c1744);})[_0xe0ba('0x1a')](function(){return _0x4caf77(null,_0x1c1744);})[_0xe0ba('0x21')](function(_0xe95280){return _0x4caf77(null,![],_0xe95280);});}}else{if(_0x1c1744[_0xe0ba('0x14')]){return _0x4caf77(null,![],{'message':_0xe0ba('0x1b')});}else{return utils[_0xe0ba('0x20')](_0x1c1744)[_0xe0ba('0x1a')](function(){return _0x4caf77(null,_0x1c1744);});}}}});})[_0xe0ba('0x21')](function(_0x5d6062){return _0x4caf77(null,![],_0x5d6062);});}function sendServiceMail(_0x148217){return db[_0xe0ba('0x22')]['find']({'where':{'service':!![]},'attributes':['id',_0xe0ba('0x10'),_0xe0ba('0x23')],'include':[{'model':db[_0xe0ba('0x24')],'as':_0xe0ba('0x25'),'include':[{'model':db[_0xe0ba('0x26')],'as':_0xe0ba('0x26')}]}]})[_0xe0ba('0x1a')](function(_0x51642e){if(!_0x51642e){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x4e00ee=_0x51642e[_0xe0ba('0x27')]();var _0x4531f9={'account':_0x4e00ee,'message':_[_0xe0ba('0x28')]({'from':util[_0xe0ba('0x29')](_0xe0ba('0x2a'),_0x51642e[_0xe0ba('0x10')],_0x51642e[_0xe0ba('0x23')]||_0x51642e[_0xe0ba('0x25')][_0xe0ba('0x18')])},_0x148217)};return client[_0xe0ba('0x2b')](_0xe0ba('0x2c'),_0x4531f9);})[_0xe0ba('0x1a')](function(_0x168c81){if(_0x168c81['error']){throw new Error(util[_0xe0ba('0x29')](_0xe0ba('0x2d'),_0x168c81[_0xe0ba('0x2e')][_0xe0ba('0x2f')]||JSON[_0xe0ba('0x30')](_0x168c81[_0xe0ba('0x2e')])));}return!![];});}function handleError(_0x421c5e,_0x4ac7fd,_0x372606){return _0x421c5e[_0xe0ba('0x31')](_0x4ac7fd||0x1f4)[_0xe0ba('0x32')]({'message':_0x372606?_0x372606[_0xe0ba('0x2f')]||_0x372606:''});}exports[_0xe0ba('0x33')]=function(_0x3c9ac2,_0x254fa7,_0x3a2ebf){passport[_0xe0ba('0x1c')](_0xe0ba('0x34'),function(_0x548891,_0x13ba3c,_0x5bba47){var _0x3aa29d=_0x548891||_0x5bba47;if(_0x3aa29d){return handleError(_0x254fa7,0x191,_0x3aa29d);}if(!_0x13ba3c){return handleError(_0x254fa7,0x194,{'message':_0xe0ba('0x35')});}else{var _0x2bd2ba={'payload':{'id':_0x13ba3c['id'],'role':_0x13ba3c[_0xe0ba('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0xe0ba('0x36')](_0x2bd2ba)['then'](function(_0xddf6b3){_0x254fa7[_0xe0ba('0x37')]({'id':_0x13ba3c['id'],'token':_0xddf6b3,'statusCall':'','isAlreadyLogged':_0x13ba3c['online']});});}})(_0x3c9ac2,_0x254fa7,_0x3a2ebf);};exports[_0xe0ba('0x38')]=function(_0x1c4b60,_0x4a81d6){if(!_0x1c4b60[_0xe0ba('0x39')][_0xe0ba('0x23')]){return handleError(_0x4a81d6,0x1f4,{'message':_0xe0ba('0x3a')});}var _0x564225=rs[_0xe0ba('0x3b')]();_0x1c4b60[_0xe0ba('0x39')][_0xe0ba('0x23')]=_0x1c4b60[_0xe0ba('0x39')][_0xe0ba('0x23')]['trim']()[_0xe0ba('0x3c')]();var _0x1350c6;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xe0ba('0xe'),_0xe0ba('0xf')],'raw':!![]})[_0xe0ba('0x1a')](function(_0x22840f){_0x1350c6=_0x22840f;return db['User'][_0xe0ba('0x3d')]({'where':{'email':_0x1c4b60[_0xe0ba('0x39')][_0xe0ba('0x23')]}});})[_0xe0ba('0x1a')](function(_0x589197){if(!_0x589197){throw new Error(_0xe0ba('0x3e'));}if(_0x589197[_0xe0ba('0x13')]){throw new Error(_0xe0ba('0x3f'));}if(_0x589197[_0xe0ba('0x14')]){if(moment(_0x589197[_0xe0ba('0x15')])[_0xe0ba('0x1f')](_0x1350c6[_0xe0ba('0xf')],_0xe0ba('0x1d'))>moment()){throw new Error(_0xe0ba('0x40'));}else{_0x589197[_0xe0ba('0x14')]=![];_0x589197['blockedAt']=null;}}_0x589197[_0xe0ba('0x41')]=_0x564225;_0x589197['resetPasswordExpires']=Date[_0xe0ba('0x42')]()+0x36ee80;return _0x589197[_0xe0ba('0x43')]();})[_0xe0ba('0x1a')](function(){return sendServiceMail({'to':_0x1c4b60[_0xe0ba('0x39')][_0xe0ba('0x23')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xe0ba('0x44')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x1c4b60[_0xe0ba('0x45')][_0xe0ba('0x46')]+_0xe0ba('0x47')+_0x564225+'\x0a\x0a'+_0xe0ba('0x48')});})[_0xe0ba('0x1a')](function(){_0x4a81d6[_0xe0ba('0x31')](0xc8)[_0xe0ba('0x32')]({'message':_0xe0ba('0x49')});})[_0xe0ba('0x21')](function(_0x160a87){return handleError(_0x4a81d6,0x1f4,_0x160a87);});};exports[_0xe0ba('0x4a')]=function(_0x23a45d,_0xc1d53e){return db['User'][_0xe0ba('0x3d')]({'where':{'resetPasswordToken':_0x23a45d['params'][_0xe0ba('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xe0ba('0x42')]()}}})['then'](function(_0x524dac){if(!_0x524dac){throw new Error(_0xe0ba('0x4c'));}return db['Setting'][_0xe0ba('0xd')]({'attributes':['id',_0xe0ba('0x4d'),'enforcePasswordHistory',_0xe0ba('0x4e')]})['then'](function(_0x406c42){if(_0x406c42[_0xe0ba('0x4d')])authService[_0xe0ba('0x4f')](_0x23a45d[_0xe0ba('0x39')][_0xe0ba('0x50')]);if(!_0x406c42[_0xe0ba('0x51')]||!_0x524dac['previousPasswords'])return _0x524dac;authService[_0xe0ba('0x52')](_0x23a45d[_0xe0ba('0x39')]['password'],_0x524dac['previousPasswords'],_0x406c42[_0xe0ba('0x4e')]);return _0x524dac;})[_0xe0ba('0x1a')](function(){_0x524dac[_0xe0ba('0x50')]=_0x23a45d[_0xe0ba('0x39')]['password'];_0x524dac[_0xe0ba('0x41')]=null;_0x524dac[_0xe0ba('0x53')]=null;return _0x524dac[_0xe0ba('0x43')]();});})['then'](function(){_0xc1d53e[_0xe0ba('0x31')](0xc8)[_0xe0ba('0x32')]({'message':_0xe0ba('0x54')});})['catch'](function(_0x5abc75){return handleError(_0xc1d53e,0x1f4,_0x5abc75);});};passport['use'](_0xe0ba('0x34'),new LocalStrategy({'usernameField':_0xe0ba('0x10'),'passwordField':_0xe0ba('0x50')},function(_0x2a5c04,_0xd9ff3c,_0xa2c96b){return localAuthenticate(db[_0xe0ba('0x55')],_0x2a5c04,_0xd9ff3c,_0xa2c96b);}));
\ No newline at end of file
+var _0x36c2=['Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','salt','role','disabled','blocked','blockedAt','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','email','SendMail','error','message','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','token'];(function(_0x82d9be,_0x29c71a){var _0x772df7=function(_0x10abe2){while(--_0x10abe2){_0x82d9be['push'](_0x82d9be['shift']());}};_0x772df7(++_0x29c71a);}(_0x36c2,0xab));var _0x236c=function(_0xbc93da,_0x19b494){_0xbc93da=_0xbc93da-0x0;var _0x11b040=_0x36c2[_0xbc93da];return _0x11b040;};'use strict';var util=require(_0x236c('0x0'));var passport=require(_0x236c('0x1'));var LocalStrategy=require(_0x236c('0x2'))[_0x236c('0x3')];var jayson=require(_0x236c('0x4'));var _=require(_0x236c('0x5'));var rs=require(_0x236c('0x6'));var moment=require('moment');var db=require(_0x236c('0x7'))['db'];var authService=require(_0x236c('0x8'));var utils=require(_0x236c('0x9'));var client=jayson[_0x236c('0xa')][_0x236c('0xb')]({'port':0x232b});function localAuthenticate(_0x282685,_0x5e2f05,_0x30171f,_0x523776){var _0x5d78e4,_0xa9330;return db[_0x236c('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0x236c('0xd'),_0x236c('0xe')],'raw':!![]})[_0x236c('0xf')](function(_0x560dd9){_0x5d78e4=_0x560dd9;return _0x282685[_0x236c('0x10')]({'attributes':['id','name','password',_0x236c('0x11'),_0x236c('0x12'),_0x236c('0x13'),_0x236c('0x14'),_0x236c('0x15'),'loginAttempts'],'where':{'name':_0x5e2f05,'role':{'$or':[_0x236c('0x16'),_0x236c('0x17'),_0x236c('0x18')]}}});})[_0x236c('0xf')](function(_0x266246){if(!_0x266246||_0x266246&&_0x266246[_0x236c('0x19')]!==_0x5e2f05){throw new Error(_0x236c('0x1a'));}else{_0xa9330=_0x266246;return _0xa9330;}})[_0x236c('0xf')](function(){_0xa9330['authenticate'](_0x30171f,function(_0xb5a2ea,_0x15b3f0){var _0x39b762=_0xa9330['loginAttempts']+0x1;if(_0xb5a2ea){return _0x523776(_0xb5a2ea);}else if(!_0x15b3f0){if(_0xa9330[_0x236c('0x13')]){return _0x523776(null,![],{'message':_0x236c('0x1a')});}else if(_0x5d78e4[_0x236c('0xd')]>0x0){if(_0xa9330[_0x236c('0x14')]){if(_0x5d78e4[_0x236c('0xe')]>0x0){if(moment(_0xa9330[_0x236c('0x15')])['add'](_0x5d78e4[_0x236c('0xe')],_0x236c('0x1b'))>moment()){return _0x523776(null,![],{'message':_0x236c('0x1a')});}else{return utils[_0x236c('0x1c')](_0xa9330,_0x39b762,![],null)[_0x236c('0xf')](function(){return _0x523776(null,![],{'message':_0x236c('0x1a')});});}}else{return _0x523776(null,![],{'message':_0x236c('0x1a')});}}else{if(_0x39b762>=_0x5d78e4[_0x236c('0xd')]){return utils[_0x236c('0x1c')](_0xa9330,0x0,!![],moment())['then'](function(){return _0x523776(null,![],{'message':_0x236c('0x1a')});});}else{return utils[_0x236c('0x1c')](_0xa9330,_0x39b762,![],null)[_0x236c('0xf')](function(){return _0x523776(null,![],{'message':_0x236c('0x1a')});});}}}else{return _0x523776(null,![],{'message':_0x236c('0x1a')});}}else{if(_0xa9330[_0x236c('0x13')]){return _0x523776(null,![],{'message':_0x236c('0x1a')});}else if(_0x5d78e4[_0x236c('0xd')]>0x0){if(_0xa9330['blocked']){if(_0x5d78e4['blockDuration']>0x0){if(moment(_0xa9330[_0x236c('0x15')])[_0x236c('0x1d')](_0x5d78e4[_0x236c('0xe')],'minutes')>moment()){return _0x523776(null,![],{'message':_0x236c('0x1a')});}else{return utils[_0x236c('0x1c')](_0xa9330,0x0,![],null)[_0x236c('0xf')](function(){return utils['getLicense'](_0xa9330);})[_0x236c('0xf')](function(){return _0x523776(null,_0xa9330);});}}else{return _0x523776(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x236c('0x1c')](_0xa9330,0x0,![],null)[_0x236c('0xf')](function(){return utils[_0x236c('0x1e')](_0xa9330);})['then'](function(){return _0x523776(null,_0xa9330);})['catch'](function(_0x17dcf3){return _0x523776(null,![],_0x17dcf3);});}}else{if(_0xa9330[_0x236c('0x14')]){return _0x523776(null,![],{'message':_0x236c('0x1a')});}else{return utils[_0x236c('0x1e')](_0xa9330)[_0x236c('0xf')](function(){return _0x523776(null,_0xa9330);});}}}});})[_0x236c('0x1f')](function(_0x30fd40){return _0x523776(null,![],_0x30fd40);});}function sendServiceMail(_0x4982d7){return db[_0x236c('0x20')][_0x236c('0x21')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x236c('0x22')],'as':_0x236c('0x23'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})[_0x236c('0xf')](function(_0x4053f7){if(!_0x4053f7){throw new Error(_0x236c('0x24'));}var _0x5ee181=_0x4053f7[_0x236c('0x25')]();var _0xb1a6={'account':_0x5ee181,'message':_['merge']({'from':util[_0x236c('0x26')]('\x22%s\x22\x20<%s>',_0x4053f7['name'],_0x4053f7[_0x236c('0x27')]||_0x4053f7[_0x236c('0x23')][_0x236c('0x17')])},_0x4982d7)};return client['request'](_0x236c('0x28'),_0xb1a6);})[_0x236c('0xf')](function(_0x464a6f){if(_0x464a6f[_0x236c('0x29')]){throw new Error(util[_0x236c('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x464a6f[_0x236c('0x29')][_0x236c('0x2a')]||JSON['stringify'](_0x464a6f['error'])));}return!![];});}function handleError(_0x147956,_0x50608e,_0x6b3e85){return _0x147956['status'](_0x50608e||0x1f4)[_0x236c('0x2b')]({'message':_0x6b3e85?_0x6b3e85[_0x236c('0x2a')]||_0x6b3e85:''});}exports[_0x236c('0x2c')]=function(_0x24bd3a,_0x27bb8b,_0x28b7fb){passport[_0x236c('0x2d')](_0x236c('0x2e'),function(_0x33e4b4,_0x2e06a0,_0x48ef66){var _0x2b2010=_0x33e4b4||_0x48ef66;if(_0x2b2010){return handleError(_0x27bb8b,0x191,_0x2b2010);}if(!_0x2e06a0){return handleError(_0x27bb8b,0x194,{'message':_0x236c('0x2f')});}else{var _0x33f702={'payload':{'id':_0x2e06a0['id'],'role':_0x2e06a0['role']},'options':{'expiresIn':0x15180}};return authService[_0x236c('0x30')](_0x33f702)[_0x236c('0xf')](function(_0x34a0bd){_0x27bb8b[_0x236c('0x31')]({'id':_0x2e06a0['id'],'token':_0x34a0bd,'statusCall':'','isAlreadyLogged':_0x2e06a0[_0x236c('0x32')]});});}})(_0x24bd3a,_0x27bb8b,_0x28b7fb);};exports[_0x236c('0x33')]=function(_0x4ad93b,_0x5d7cc6){if(!_0x4ad93b[_0x236c('0x34')][_0x236c('0x27')]){return handleError(_0x5d7cc6,0x1f4,{'message':_0x236c('0x35')});}var _0x4dec7a=rs[_0x236c('0x36')]();_0x4ad93b['body'][_0x236c('0x27')]=_0x4ad93b[_0x236c('0x34')]['email']['trim']()['toLowerCase']();var _0x2953c6;return db[_0x236c('0xc')][_0x236c('0x10')]({'where':{'id':0x1},'attributes':[_0x236c('0xd'),_0x236c('0xe')],'raw':!![]})[_0x236c('0xf')](function(_0x389ee5){_0x2953c6=_0x389ee5;return db[_0x236c('0x37')]['find']({'where':{'email':_0x4ad93b['body'][_0x236c('0x27')]}});})[_0x236c('0xf')](function(_0x29fd24){if(!_0x29fd24){throw new Error(_0x236c('0x38'));}if(_0x29fd24['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x29fd24[_0x236c('0x14')]){if(moment(_0x29fd24['blockedAt'])[_0x236c('0x1d')](_0x2953c6[_0x236c('0xe')],_0x236c('0x1b'))>moment()){throw new Error(_0x236c('0x39'));}else{_0x29fd24[_0x236c('0x14')]=![];_0x29fd24[_0x236c('0x15')]=null;}}_0x29fd24[_0x236c('0x3a')]=_0x4dec7a;_0x29fd24[_0x236c('0x3b')]=Date['now']()+0x36ee80;return _0x29fd24[_0x236c('0x3c')]();})['then'](function(){return sendServiceMail({'to':_0x4ad93b[_0x236c('0x34')]['email'],'subject':_0x236c('0x3d'),'text':_0x236c('0x3e')+_0x236c('0x3f')+'https://'+_0x4ad93b[_0x236c('0x40')]['host']+_0x236c('0x41')+_0x4dec7a+'\x0a\x0a'+_0x236c('0x42')});})[_0x236c('0xf')](function(){_0x5d7cc6[_0x236c('0x43')](0xc8)['send']({'message':_0x236c('0x44')});})['catch'](function(_0x2d22a1){return handleError(_0x5d7cc6,0x1f4,_0x2d22a1);});};exports[_0x236c('0x45')]=function(_0xdd146c,_0x5a6287){return db[_0x236c('0x37')][_0x236c('0x21')]({'where':{'resetPasswordToken':_0xdd146c[_0x236c('0x46')][_0x236c('0x47')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x236c('0xf')](function(_0x7da9b5){if(!_0x7da9b5){throw new Error(_0x236c('0x48'));}return db[_0x236c('0xc')][_0x236c('0x10')]({'attributes':['id',_0x236c('0x49'),_0x236c('0x4a'),_0x236c('0x4b')]})['then'](function(_0x1ae42a){if(_0x1ae42a['securePassword'])authService[_0x236c('0x4c')](_0xdd146c[_0x236c('0x34')][_0x236c('0x4d')]);if(!_0x1ae42a[_0x236c('0x4a')]||!_0x7da9b5[_0x236c('0x4e')])return _0x7da9b5;authService[_0x236c('0x4f')](_0xdd146c[_0x236c('0x34')][_0x236c('0x4d')],_0x7da9b5['previousPasswords'],_0x1ae42a[_0x236c('0x4b')]);return _0x7da9b5;})[_0x236c('0xf')](function(){_0x7da9b5['password']=_0xdd146c[_0x236c('0x34')][_0x236c('0x4d')];_0x7da9b5['resetPasswordToken']=null;_0x7da9b5[_0x236c('0x3b')]=null;return _0x7da9b5[_0x236c('0x3c')]();});})[_0x236c('0xf')](function(){_0x5a6287[_0x236c('0x43')](0xc8)[_0x236c('0x2b')]({'message':_0x236c('0x50')});})[_0x236c('0x1f')](function(_0x43c9b0){return handleError(_0x5a6287,0x1f4,_0x43c9b0);});};passport['use']('local-login',new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x25e0d0,_0x1d5987,_0xcb3b0){return localAuthenticate(db[_0x236c('0x37')],_0x25e0d0,_0x1d5987,_0xcb3b0);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 05ba8a5..1a0b760 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 _0xcf06=['/reset/:token','reset','exports','express','Router','./authLocal.controller','post','login','/forgot'];(function(_0xf269ca,_0x34ea81){var _0x170620=function(_0x30032a){while(--_0x30032a){_0xf269ca['push'](_0xf269ca['shift']());}};_0x170620(++_0x34ea81);}(_0xcf06,0xff));var _0x6cf0=function(_0x2f742a,_0x32885d){_0x2f742a=_0x2f742a-0x0;var _0x4634fc=_0xcf06[_0x2f742a];return _0x4634fc;};'use strict';var express=require(_0x6cf0('0x0'));var router=express[_0x6cf0('0x1')]();var controller=require(_0x6cf0('0x2'));router[_0x6cf0('0x3')]('/',controller[_0x6cf0('0x4')]);router[_0x6cf0('0x3')](_0x6cf0('0x5'),controller['forgot']);router[_0x6cf0('0x3')](_0x6cf0('0x6'),controller[_0x6cf0('0x7')]);module[_0x6cf0('0x8')]=router;
\ No newline at end of file
+var _0x7ff5=['login','/forgot','forgot','/reset/:token','reset','exports','./authLocal.controller','post'];(function(_0xdf22f6,_0x437b4d){var _0x3eac5e=function(_0x503843){while(--_0x503843){_0xdf22f6['push'](_0xdf22f6['shift']());}};_0x3eac5e(++_0x437b4d);}(_0x7ff5,0xfe));var _0x57ff=function(_0xff17e7,_0x3e9f3b){_0xff17e7=_0xff17e7-0x0;var _0x47cc72=_0x7ff5[_0xff17e7];return _0x47cc72;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x57ff('0x0'));router[_0x57ff('0x1')]('/',controller[_0x57ff('0x2')]);router[_0x57ff('0x1')](_0x57ff('0x3'),controller[_0x57ff('0x4')]);router[_0x57ff('0x1')](_0x57ff('0x5'),controller[_0x57ff('0x6')]);module[_0x57ff('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 4855519..86c1541 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 _0x7ffe=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x492c73,_0x477d73){var _0x46c3a1=function(_0xfc560e){while(--_0xfc560e){_0x492c73['push'](_0x492c73['shift']());}};_0x46c3a1(++_0x477d73);}(_0x7ffe,0xe9));var _0xe7ff=function(_0x1b3c10,_0x13c894){_0x1b3c10=_0x1b3c10-0x0;var _0x57fe91=_0x7ffe[_0x1b3c10];return _0x57fe91;};'use strict';var Sequelize=require(_0xe7ff('0x0'));module[_0xe7ff('0x1')]={'name':{'type':Sequelize[_0xe7ff('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe7ff('0x2')]},'status':{'type':Sequelize[_0xe7ff('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe7ff('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x4903=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x24a0e8,_0xbacbe6){var _0x32d2e7=function(_0xd5847f){while(--_0xd5847f){_0x24a0e8['push'](_0x24a0e8['shift']());}};_0x32d2e7(++_0xbacbe6);}(_0x4903,0xe1));var _0x3490=function(_0x494047,_0x2d3c20){_0x494047=_0x494047-0x0;var _0x2c8729=_0x4903[_0x494047];return _0x2c8729;};'use strict';var Sequelize=require(_0x3490('0x0'));module[_0x3490('0x1')]={'name':{'type':Sequelize[_0x3490('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x3490('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x3490('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3490('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 102e64d..7ae435f 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 _0x39bd=['options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','find','addConditions','ids','omit','getConditions','findOne','Condition','order','hasOwnProperty','addActions','Action','getActions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','Automation','type','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge'];(function(_0x925e9b,_0x25310c){var _0x31c9ed=function(_0x1ac48e){while(--_0x1ac48e){_0x925e9b['push'](_0x925e9b['shift']());}};_0x31c9ed(++_0x25310c);}(_0x39bd,0x15c));var _0xd39b=function(_0x40f018,_0x310ad7){_0x40f018=_0x40f018-0x0;var _0x46c944=_0x39bd[_0x40f018];return _0x46c944;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd39b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd39b('0x1'));var rp=require(_0xd39b('0x2'));var moment=require(_0xd39b('0x3'));var BPromise=require(_0xd39b('0x4'));var Mustache=require(_0xd39b('0x5'));var util=require(_0xd39b('0x6'));var path=require('path');var sox=require(_0xd39b('0x7'));var csv=require('to-csv');var ejs=require(_0xd39b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd39b('0x9'));var squel=require(_0xd39b('0xa'));var crypto=require(_0xd39b('0xb'));var jsforce=require(_0xd39b('0xc'));var deskjs=require(_0xd39b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd39b('0xe'));var authService=require(_0xd39b('0xf'));var qs=require(_0xd39b('0x10'));var as=require(_0xd39b('0x11'));var hardwareService=require(_0xd39b('0x12'));var logger=require(_0xd39b('0x13'))(_0xd39b('0x14'));var utils=require('../../config/utils');var config=require(_0xd39b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd39b('0x16'))['db'];function respondWithStatusCode(_0x3baf94,_0x2c5a9e){_0x2c5a9e=_0x2c5a9e||0xcc;return function(_0x3debbf){if(_0x3debbf){return _0x3baf94['sendStatus'](_0x2c5a9e);}return _0x3baf94['status'](_0x2c5a9e)['end']();};}function respondWithResult(_0x395874,_0x5b235c){_0x5b235c=_0x5b235c||0xc8;return function(_0x19d56e){if(_0x19d56e){return _0x395874['status'](_0x5b235c)[_0xd39b('0x17')](_0x19d56e);}};}function respondWithFilteredResult(_0x2dc3b2,_0x400db5){return function(_0x538df6){if(_0x538df6){var _0xb45dfe=typeof _0x400db5[_0xd39b('0x18')]===_0xd39b('0x19')&&typeof _0x400db5[_0xd39b('0x1a')]===_0xd39b('0x19');var _0x3983c2=_0x538df6[_0xd39b('0x1b')];var _0x420e35=_0xb45dfe?0x0:_0x400db5[_0xd39b('0x18')];var _0xcfa248=_0xb45dfe?_0x538df6[_0xd39b('0x1b')]:_0x400db5[_0xd39b('0x18')]+_0x400db5[_0xd39b('0x1a')];var _0x553990;if(_0xcfa248>=_0x3983c2){_0xcfa248=_0x3983c2;_0x553990=0xc8;}else{_0x553990=0xce;}_0x2dc3b2[_0xd39b('0x1c')](_0x553990);return _0x2dc3b2[_0xd39b('0x1d')](_0xd39b('0x1e'),_0x420e35+'-'+_0xcfa248+'/'+_0x3983c2)[_0xd39b('0x17')](_0x538df6);}return null;};}function patchUpdates(_0xeacd04){return function(_0x222361){try{jsonpatch[_0xd39b('0x1f')](_0x222361,_0xeacd04,!![]);}catch(_0xdbd4d2){return BPromise[_0xd39b('0x20')](_0xdbd4d2);}return _0x222361[_0xd39b('0x21')]();};}function saveUpdates(_0x45cb87,_0x526566){return function(_0x5330d6){if(_0x5330d6){return _0x5330d6[_0xd39b('0x22')](_0x45cb87)[_0xd39b('0x23')](function(_0x54e5b6){return _0x54e5b6;});}return null;};}function removeEntity(_0x3740fc,_0x30863e){return function(_0x158439){if(_0x158439){return _0x158439[_0xd39b('0x24')]()[_0xd39b('0x23')](function(){_0x3740fc[_0xd39b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55b7c0,_0x5dd4de){return function(_0x1abc53){if(!_0x1abc53){_0x55b7c0['sendStatus'](0x194);}return _0x1abc53;};}function handleError(_0x248e3b,_0x550adb){_0x550adb=_0x550adb||0x1f4;return function(_0x1c7d5e){logger[_0xd39b('0x25')](_0x1c7d5e[_0xd39b('0x26')]);if(_0x1c7d5e[_0xd39b('0x27')]){delete _0x1c7d5e['name'];}_0x248e3b[_0xd39b('0x1c')](_0x550adb)['send'](_0x1c7d5e);};}exports[_0xd39b('0x28')]=function(_0x4df728,_0x17a78b){var _0x3e1732={},_0x1ad96b={},_0x53580a={'count':0x0,'rows':[]};var _0x104563=_[_0xd39b('0x29')](db[_0xd39b('0x2a')]['rawAttributes'],function(_0x3e6a75){return{'name':_0x3e6a75['fieldName'],'type':_0x3e6a75[_0xd39b('0x2b')]['key']};});_0x1ad96b[_0xd39b('0x2c')]=_['map'](_0x104563,'name');_0x1ad96b[_0xd39b('0x2d')]=_[_0xd39b('0x2e')](_0x4df728[_0xd39b('0x2d')]);_0x1ad96b[_0xd39b('0x2f')]=_[_0xd39b('0x30')](_0x1ad96b[_0xd39b('0x2c')],_0x1ad96b[_0xd39b('0x2d')]);_0x3e1732[_0xd39b('0x31')]=_[_0xd39b('0x30')](_0x1ad96b[_0xd39b('0x2c')],qs[_0xd39b('0x32')](_0x4df728[_0xd39b('0x2d')][_0xd39b('0x32')]));_0x3e1732[_0xd39b('0x31')]=_0x3e1732['attributes']['length']?_0x3e1732[_0xd39b('0x31')]:_0x1ad96b[_0xd39b('0x2c')];if(!_0x4df728['query']['hasOwnProperty'](_0xd39b('0x33'))){_0x3e1732[_0xd39b('0x1a')]=qs[_0xd39b('0x1a')](_0x4df728[_0xd39b('0x2d')]['limit']);_0x3e1732[_0xd39b('0x18')]=qs[_0xd39b('0x18')](_0x4df728['query'][_0xd39b('0x18')]);}_0x3e1732['order']=qs[_0xd39b('0x34')](_0x4df728[_0xd39b('0x2d')][_0xd39b('0x34')]);_0x3e1732[_0xd39b('0x35')]=qs[_0xd39b('0x2f')](_[_0xd39b('0x36')](_0x4df728[_0xd39b('0x2d')],_0x1ad96b['filters']),_0x104563);if(_0x4df728[_0xd39b('0x2d')][_0xd39b('0x37')]){_0x3e1732['where']=_[_0xd39b('0x38')](_0x3e1732[_0xd39b('0x35')],{'$or':_[_0xd39b('0x29')](_0x104563,function(_0x1bdc2a){if(_0x1bdc2a[_0xd39b('0x2b')]!=='VIRTUAL'){var _0x5cd1f1={};_0x5cd1f1[_0x1bdc2a[_0xd39b('0x27')]]={'$like':'%'+_0x4df728[_0xd39b('0x2d')][_0xd39b('0x37')]+'%'};return _0x5cd1f1;}})});}_0x3e1732=_[_0xd39b('0x38')]({},_0x3e1732,_0x4df728[_0xd39b('0x39')]);var _0xd277bc={'where':_0x3e1732[_0xd39b('0x35')]};return db[_0xd39b('0x2a')][_0xd39b('0x1b')](_0xd277bc)['then'](function(_0x2cff11){_0x53580a['count']=_0x2cff11;if(_0x4df728[_0xd39b('0x2d')][_0xd39b('0x3a')]){_0x3e1732[_0xd39b('0x3b')]=[{'all':!![]}];}return db[_0xd39b('0x2a')][_0xd39b('0x3c')](_0x3e1732);})[_0xd39b('0x23')](function(_0x5ce2b4){_0x53580a[_0xd39b('0x3d')]=_0x5ce2b4;return _0x53580a;})[_0xd39b('0x23')](respondWithFilteredResult(_0x17a78b,_0x3e1732))[_0xd39b('0x3e')](handleError(_0x17a78b,null));};exports[_0xd39b('0x3f')]=function(_0x8a3624,_0x49d169){var _0x17c766={'raw':![],'where':{'id':_0x8a3624[_0xd39b('0x40')]['id']}},_0x2dd2a9={};_0x2dd2a9['model']=_[_0xd39b('0x2e')](db[_0xd39b('0x2a')][_0xd39b('0x41')]);_0x2dd2a9[_0xd39b('0x2d')]=_[_0xd39b('0x2e')](_0x8a3624['query']);_0x2dd2a9['filters']=_[_0xd39b('0x30')](_0x2dd2a9['model'],_0x2dd2a9[_0xd39b('0x2d')]);_0x17c766[_0xd39b('0x31')]=_['intersection'](_0x2dd2a9[_0xd39b('0x2c')],qs[_0xd39b('0x32')](_0x8a3624[_0xd39b('0x2d')][_0xd39b('0x32')]));_0x17c766['attributes']=_0x17c766['attributes'][_0xd39b('0x42')]?_0x17c766[_0xd39b('0x31')]:_0x2dd2a9[_0xd39b('0x2c')];if(_0x8a3624[_0xd39b('0x2d')][_0xd39b('0x3a')]){_0x17c766['include']=[{'all':!![]}];}_0x17c766=_[_0xd39b('0x38')]({},_0x17c766,_0x8a3624[_0xd39b('0x39')]);return db[_0xd39b('0x2a')]['find'](_0x17c766)['then'](handleEntityNotFound(_0x49d169,null))[_0xd39b('0x23')](respondWithResult(_0x49d169,null))[_0xd39b('0x3e')](handleError(_0x49d169,null));};exports[_0xd39b('0x43')]=function(_0x4f3911,_0x4ffb6f){return db['Automation'][_0xd39b('0x43')](_0x4f3911[_0xd39b('0x44')],{})[_0xd39b('0x23')](respondWithResult(_0x4ffb6f,0xc9))[_0xd39b('0x3e')](handleError(_0x4ffb6f,null));};exports[_0xd39b('0x22')]=function(_0x128c76,_0x4b3c37){if(_0x128c76['body']['id']){delete _0x128c76[_0xd39b('0x44')]['id'];}return db[_0xd39b('0x2a')][_0xd39b('0x45')]({'where':{'id':_0x128c76[_0xd39b('0x40')]['id']}})[_0xd39b('0x23')](handleEntityNotFound(_0x4b3c37,null))['then'](saveUpdates(_0x128c76[_0xd39b('0x44')],null))['then'](respondWithResult(_0x4b3c37,null))['catch'](handleError(_0x4b3c37,null));};exports[_0xd39b('0x24')]=function(_0x3e6757,_0x34dbff){return db[_0xd39b('0x2a')]['find']({'where':{'id':_0x3e6757[_0xd39b('0x40')]['id']}})[_0xd39b('0x23')](handleEntityNotFound(_0x34dbff,null))[_0xd39b('0x23')](removeEntity(_0x34dbff,null))[_0xd39b('0x3e')](handleError(_0x34dbff,null));};exports[_0xd39b('0x46')]=function(_0x1d44d2,_0x4724a6,_0x32713b){return db['Condition']['find']({'where':{'id':_0x1d44d2[_0xd39b('0x40')]['id']}})[_0xd39b('0x23')](handleEntityNotFound(_0x4724a6,null))['then'](function(_0x56358d){if(_0x56358d){return _0x56358d[_0xd39b('0x46')](_0x1d44d2[_0xd39b('0x44')][_0xd39b('0x47')],_[_0xd39b('0x48')](_0x1d44d2[_0xd39b('0x44')],[_0xd39b('0x47'),'id'])||{});}})['then'](respondWithResult(_0x4724a6,null))[_0xd39b('0x3e')](handleError(_0x4724a6,null));};exports[_0xd39b('0x49')]=function(_0x36441c,_0x794f28,_0x340b07){var _0x587b98={};var _0x5d5c3a={};var _0x45c05a;var _0x180196;return db[_0xd39b('0x2a')][_0xd39b('0x4a')]({'where':{'id':_0x36441c['params']['id']}})[_0xd39b('0x23')](handleEntityNotFound(_0x794f28,null))[_0xd39b('0x23')](function(_0x1af837){if(_0x1af837){_0x45c05a=_0x1af837;_0x5d5c3a[_0xd39b('0x2c')]=_[_0xd39b('0x2e')](db[_0xd39b('0x4b')][_0xd39b('0x41')]);_0x5d5c3a[_0xd39b('0x2d')]=_[_0xd39b('0x2e')](_0x36441c[_0xd39b('0x2d')]);_0x5d5c3a['filters']=_[_0xd39b('0x30')](_0x5d5c3a[_0xd39b('0x2c')],_0x5d5c3a[_0xd39b('0x2d')]);_0x587b98[_0xd39b('0x31')]=_['intersection'](_0x5d5c3a[_0xd39b('0x2c')],qs['fields'](_0x36441c[_0xd39b('0x2d')]['fields']));_0x587b98[_0xd39b('0x31')]=_0x587b98[_0xd39b('0x31')][_0xd39b('0x42')]?_0x587b98[_0xd39b('0x31')]:_0x5d5c3a[_0xd39b('0x2c')];_0x587b98[_0xd39b('0x4c')]=qs[_0xd39b('0x34')](_0x36441c[_0xd39b('0x2d')][_0xd39b('0x34')]);_0x587b98['where']=qs[_0xd39b('0x2f')](_[_0xd39b('0x36')](_0x36441c[_0xd39b('0x2d')],_0x5d5c3a[_0xd39b('0x2f')]));if(_0x36441c[_0xd39b('0x2d')]['filter']){_0x587b98[_0xd39b('0x35')]=_[_0xd39b('0x38')](_0x587b98[_0xd39b('0x35')],{'$or':_[_0xd39b('0x29')](_0x587b98[_0xd39b('0x31')],function(_0x3c77fc){var _0x38cfa4={};_0x38cfa4[_0x3c77fc]={'$like':'%'+_0x36441c[_0xd39b('0x2d')][_0xd39b('0x37')]+'%'};return _0x38cfa4;})});}_0x587b98=_[_0xd39b('0x38')]({},_0x587b98,_0x36441c[_0xd39b('0x39')]);return _0x45c05a[_0xd39b('0x49')](_0x587b98);}})[_0xd39b('0x23')](function(_0x165141){if(_0x165141){_0x180196=_0x165141['length'];if(!_0x36441c[_0xd39b('0x2d')][_0xd39b('0x4d')](_0xd39b('0x33'))){_0x587b98['limit']=qs[_0xd39b('0x1a')](_0x36441c[_0xd39b('0x2d')][_0xd39b('0x1a')]);_0x587b98['offset']=qs[_0xd39b('0x18')](_0x36441c[_0xd39b('0x2d')]['offset']);}return _0x45c05a[_0xd39b('0x49')](_0x587b98);}})['then'](function(_0xfe716d){if(_0xfe716d){return _0xfe716d?{'count':_0x180196,'rows':_0xfe716d}:null;}})[_0xd39b('0x23')](respondWithResult(_0x794f28,null))['catch'](handleError(_0x794f28,null));};exports[_0xd39b('0x4e')]=function(_0x5e6cf8,_0x4c4f1d,_0x4e2424){return db[_0xd39b('0x4f')]['find']({'where':{'id':_0x5e6cf8[_0xd39b('0x40')]['id']}})['then'](handleEntityNotFound(_0x4c4f1d,null))[_0xd39b('0x23')](function(_0x29a277){if(_0x29a277){return _0x29a277[_0xd39b('0x4e')](_0x5e6cf8[_0xd39b('0x44')][_0xd39b('0x47')],_['omit'](_0x5e6cf8[_0xd39b('0x44')],['ids','id'])||{});}})[_0xd39b('0x23')](respondWithResult(_0x4c4f1d,null))['catch'](handleError(_0x4c4f1d,null));};exports['getActions']=function(_0x3daa64,_0x211da8,_0x1b608d){var _0x8301a4={};var _0x7696fb={};var _0x4ac8ad;var _0x21d5b8;return db['Automation'][_0xd39b('0x4a')]({'where':{'id':_0x3daa64['params']['id']}})['then'](handleEntityNotFound(_0x211da8,null))[_0xd39b('0x23')](function(_0x2708a1){if(_0x2708a1){_0x4ac8ad=_0x2708a1;_0x7696fb[_0xd39b('0x2c')]=_[_0xd39b('0x2e')](db['Action'][_0xd39b('0x41')]);_0x7696fb['query']=_[_0xd39b('0x2e')](_0x3daa64['query']);_0x7696fb[_0xd39b('0x2f')]=_[_0xd39b('0x30')](_0x7696fb[_0xd39b('0x2c')],_0x7696fb[_0xd39b('0x2d')]);_0x8301a4[_0xd39b('0x31')]=_[_0xd39b('0x30')](_0x7696fb[_0xd39b('0x2c')],qs[_0xd39b('0x32')](_0x3daa64['query'][_0xd39b('0x32')]));_0x8301a4[_0xd39b('0x31')]=_0x8301a4[_0xd39b('0x31')][_0xd39b('0x42')]?_0x8301a4[_0xd39b('0x31')]:_0x7696fb[_0xd39b('0x2c')];_0x8301a4[_0xd39b('0x4c')]=qs['sort'](_0x3daa64['query'][_0xd39b('0x34')]);_0x8301a4[_0xd39b('0x35')]=qs[_0xd39b('0x2f')](_[_0xd39b('0x36')](_0x3daa64[_0xd39b('0x2d')],_0x7696fb[_0xd39b('0x2f')]));if(_0x3daa64[_0xd39b('0x2d')][_0xd39b('0x37')]){_0x8301a4['where']=_[_0xd39b('0x38')](_0x8301a4[_0xd39b('0x35')],{'$or':_['map'](_0x8301a4[_0xd39b('0x31')],function(_0x26735a){var _0x85a18={};_0x85a18[_0x26735a]={'$like':'%'+_0x3daa64['query'][_0xd39b('0x37')]+'%'};return _0x85a18;})});}_0x8301a4=_[_0xd39b('0x38')]({},_0x8301a4,_0x3daa64[_0xd39b('0x39')]);return _0x4ac8ad['getActions'](_0x8301a4);}})[_0xd39b('0x23')](function(_0x88e593){if(_0x88e593){_0x21d5b8=_0x88e593[_0xd39b('0x42')];if(!_0x3daa64[_0xd39b('0x2d')]['hasOwnProperty'](_0xd39b('0x33'))){_0x8301a4[_0xd39b('0x1a')]=qs[_0xd39b('0x1a')](_0x3daa64['query'][_0xd39b('0x1a')]);_0x8301a4[_0xd39b('0x18')]=qs[_0xd39b('0x18')](_0x3daa64[_0xd39b('0x2d')][_0xd39b('0x18')]);}return _0x4ac8ad[_0xd39b('0x50')](_0x8301a4);}})['then'](function(_0x2289cf){if(_0x2289cf){return _0x2289cf?{'count':_0x21d5b8,'rows':_0x2289cf}:null;}})[_0xd39b('0x23')](respondWithResult(_0x211da8,null))[_0xd39b('0x3e')](handleError(_0x211da8,null));};
\ No newline at end of file
+var _0x1648=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','index','Automation','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions'];(function(_0x2d070f,_0x3699e0){var _0x3256b4=function(_0x39ef1b){while(--_0x39ef1b){_0x2d070f['push'](_0x2d070f['shift']());}};_0x3256b4(++_0x3699e0);}(_0x1648,0x1ae));var _0x8164=function(_0x5e0e89,_0x803da4){_0x5e0e89=_0x5e0e89-0x0;var _0x3507d1=_0x1648[_0x5e0e89];return _0x3507d1;};'use strict';var emlformat=require(_0x8164('0x0'));var rimraf=require(_0x8164('0x1'));var zipdir=require(_0x8164('0x2'));var jsonpatch=require(_0x8164('0x3'));var rp=require(_0x8164('0x4'));var moment=require(_0x8164('0x5'));var BPromise=require(_0x8164('0x6'));var Mustache=require(_0x8164('0x7'));var util=require(_0x8164('0x8'));var path=require(_0x8164('0x9'));var sox=require('sox');var csv=require(_0x8164('0xa'));var ejs=require(_0x8164('0xb'));var fs=require('fs');var fs_extra=require(_0x8164('0xc'));var _=require(_0x8164('0xd'));var squel=require('squel');var crypto=require(_0x8164('0xe'));var jsforce=require(_0x8164('0xf'));var deskjs=require(_0x8164('0x10'));var toCsv=require(_0x8164('0xa'));var querystring=require(_0x8164('0x11'));var Papa=require(_0x8164('0x12'));var Redis=require(_0x8164('0x13'));var authService=require(_0x8164('0x14'));var qs=require(_0x8164('0x15'));var as=require(_0x8164('0x16'));var hardwareService=require(_0x8164('0x17'));var logger=require('../../config/logger')(_0x8164('0x18'));var utils=require('../../config/utils');var config=require(_0x8164('0x19'));var licenseUtil=require(_0x8164('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dbc6e,_0x5be8bb){_0x5be8bb=_0x5be8bb||0xcc;return function(_0xf3995c){if(_0xf3995c){return _0x3dbc6e[_0x8164('0x1b')](_0x5be8bb);}return _0x3dbc6e['status'](_0x5be8bb)[_0x8164('0x1c')]();};}function respondWithResult(_0x5d0d9c,_0x4bfbfd){_0x4bfbfd=_0x4bfbfd||0xc8;return function(_0x2a9df6){if(_0x2a9df6){return _0x5d0d9c[_0x8164('0x1d')](_0x4bfbfd)[_0x8164('0x1e')](_0x2a9df6);}};}function respondWithFilteredResult(_0x4e88ab,_0x5088dd){return function(_0x34db53){if(_0x34db53){var _0x1bcc2e=typeof _0x5088dd[_0x8164('0x1f')]===_0x8164('0x20')&&typeof _0x5088dd[_0x8164('0x21')]===_0x8164('0x20');var _0x3921e8=_0x34db53[_0x8164('0x22')];var _0x8e6672=_0x1bcc2e?0x0:_0x5088dd[_0x8164('0x1f')];var _0x1962f8=_0x1bcc2e?_0x34db53[_0x8164('0x22')]:_0x5088dd[_0x8164('0x1f')]+_0x5088dd['limit'];var _0x4354cb;if(_0x1962f8>=_0x3921e8){_0x1962f8=_0x3921e8;_0x4354cb=0xc8;}else{_0x4354cb=0xce;}_0x4e88ab[_0x8164('0x1d')](_0x4354cb);return _0x4e88ab[_0x8164('0x23')](_0x8164('0x24'),_0x8e6672+'-'+_0x1962f8+'/'+_0x3921e8)[_0x8164('0x1e')](_0x34db53);}return null;};}function patchUpdates(_0x14fa70){return function(_0x2e13b7){try{jsonpatch[_0x8164('0x25')](_0x2e13b7,_0x14fa70,!![]);}catch(_0x2ee096){return BPromise[_0x8164('0x26')](_0x2ee096);}return _0x2e13b7['save']();};}function saveUpdates(_0x1bc432,_0x59f8ea){return function(_0x399e4b){if(_0x399e4b){return _0x399e4b['update'](_0x1bc432)[_0x8164('0x27')](function(_0x2d2243){return _0x2d2243;});}return null;};}function removeEntity(_0x5cad7f,_0x1ad7ab){return function(_0x18ee49){if(_0x18ee49){return _0x18ee49[_0x8164('0x28')]()[_0x8164('0x27')](function(){_0x5cad7f[_0x8164('0x1d')](0xcc)[_0x8164('0x1c')]();});}};}function handleEntityNotFound(_0x2a3a16,_0x15e935){return function(_0x4ab04c){if(!_0x4ab04c){_0x2a3a16[_0x8164('0x1b')](0x194);}return _0x4ab04c;};}function handleError(_0x4b3e2e,_0x4acbb8){_0x4acbb8=_0x4acbb8||0x1f4;return function(_0x5dccfc){logger[_0x8164('0x29')](_0x5dccfc[_0x8164('0x2a')]);if(_0x5dccfc['name']){delete _0x5dccfc[_0x8164('0x2b')];}_0x4b3e2e[_0x8164('0x1d')](_0x4acbb8)['send'](_0x5dccfc);};}exports[_0x8164('0x2c')]=function(_0x25b48e,_0x1673a3){var _0x4e48a4={},_0x34aa3d={},_0x2a0a85={'count':0x0,'rows':[]};var _0x6011f0=_['map'](db[_0x8164('0x2d')][_0x8164('0x2e')],function(_0x385f6d){return{'name':_0x385f6d[_0x8164('0x2f')],'type':_0x385f6d[_0x8164('0x30')][_0x8164('0x31')]};});_0x34aa3d[_0x8164('0x32')]=_[_0x8164('0x33')](_0x6011f0,_0x8164('0x2b'));_0x34aa3d[_0x8164('0x34')]=_[_0x8164('0x35')](_0x25b48e[_0x8164('0x34')]);_0x34aa3d['filters']=_['intersection'](_0x34aa3d[_0x8164('0x32')],_0x34aa3d[_0x8164('0x34')]);_0x4e48a4[_0x8164('0x36')]=_[_0x8164('0x37')](_0x34aa3d[_0x8164('0x32')],qs[_0x8164('0x38')](_0x25b48e[_0x8164('0x34')][_0x8164('0x38')]));_0x4e48a4[_0x8164('0x36')]=_0x4e48a4[_0x8164('0x36')][_0x8164('0x39')]?_0x4e48a4[_0x8164('0x36')]:_0x34aa3d[_0x8164('0x32')];if(!_0x25b48e[_0x8164('0x34')][_0x8164('0x3a')](_0x8164('0x3b'))){_0x4e48a4['limit']=qs[_0x8164('0x21')](_0x25b48e['query'][_0x8164('0x21')]);_0x4e48a4['offset']=qs[_0x8164('0x1f')](_0x25b48e['query'][_0x8164('0x1f')]);}_0x4e48a4[_0x8164('0x3c')]=qs[_0x8164('0x3d')](_0x25b48e['query'][_0x8164('0x3d')]);_0x4e48a4['where']=qs[_0x8164('0x3e')](_[_0x8164('0x3f')](_0x25b48e[_0x8164('0x34')],_0x34aa3d[_0x8164('0x3e')]),_0x6011f0);if(_0x25b48e[_0x8164('0x34')][_0x8164('0x40')]){_0x4e48a4[_0x8164('0x41')]=_[_0x8164('0x42')](_0x4e48a4[_0x8164('0x41')],{'$or':_[_0x8164('0x33')](_0x6011f0,function(_0x4f2c8b){if(_0x4f2c8b[_0x8164('0x30')]!==_0x8164('0x43')){var _0x1f7d64={};_0x1f7d64[_0x4f2c8b[_0x8164('0x2b')]]={'$like':'%'+_0x25b48e[_0x8164('0x34')]['filter']+'%'};return _0x1f7d64;}})});}_0x4e48a4=_[_0x8164('0x42')]({},_0x4e48a4,_0x25b48e['options']);var _0x4e5c88={'where':_0x4e48a4[_0x8164('0x41')]};return db[_0x8164('0x2d')]['count'](_0x4e5c88)[_0x8164('0x27')](function(_0x1bb6aa){_0x2a0a85[_0x8164('0x22')]=_0x1bb6aa;if(_0x25b48e[_0x8164('0x34')][_0x8164('0x44')]){_0x4e48a4[_0x8164('0x45')]=[{'all':!![]}];}return db[_0x8164('0x2d')][_0x8164('0x46')](_0x4e48a4);})['then'](function(_0xa67ccc){_0x2a0a85['rows']=_0xa67ccc;return _0x2a0a85;})[_0x8164('0x27')](respondWithFilteredResult(_0x1673a3,_0x4e48a4))[_0x8164('0x47')](handleError(_0x1673a3,null));};exports[_0x8164('0x48')]=function(_0x23f6e3,_0x165d93){var _0x131666={'raw':![],'where':{'id':_0x23f6e3[_0x8164('0x49')]['id']}},_0x2db101={};_0x2db101[_0x8164('0x32')]=_[_0x8164('0x35')](db[_0x8164('0x2d')]['rawAttributes']);_0x2db101[_0x8164('0x34')]=_[_0x8164('0x35')](_0x23f6e3[_0x8164('0x34')]);_0x2db101[_0x8164('0x3e')]=_['intersection'](_0x2db101[_0x8164('0x32')],_0x2db101[_0x8164('0x34')]);_0x131666[_0x8164('0x36')]=_[_0x8164('0x37')](_0x2db101[_0x8164('0x32')],qs[_0x8164('0x38')](_0x23f6e3[_0x8164('0x34')][_0x8164('0x38')]));_0x131666[_0x8164('0x36')]=_0x131666[_0x8164('0x36')][_0x8164('0x39')]?_0x131666[_0x8164('0x36')]:_0x2db101['model'];if(_0x23f6e3[_0x8164('0x34')][_0x8164('0x44')]){_0x131666[_0x8164('0x45')]=[{'all':!![]}];}_0x131666=_[_0x8164('0x42')]({},_0x131666,_0x23f6e3[_0x8164('0x4a')]);return db[_0x8164('0x2d')][_0x8164('0x4b')](_0x131666)[_0x8164('0x27')](handleEntityNotFound(_0x165d93,null))[_0x8164('0x27')](respondWithResult(_0x165d93,null))[_0x8164('0x47')](handleError(_0x165d93,null));};exports[_0x8164('0x4c')]=function(_0x2df690,_0x2f6e5d){return db[_0x8164('0x2d')][_0x8164('0x4c')](_0x2df690[_0x8164('0x4d')],{})[_0x8164('0x27')](respondWithResult(_0x2f6e5d,0xc9))[_0x8164('0x47')](handleError(_0x2f6e5d,null));};exports['update']=function(_0x1ab7b6,_0x2ebe55){if(_0x1ab7b6[_0x8164('0x4d')]['id']){delete _0x1ab7b6[_0x8164('0x4d')]['id'];}return db[_0x8164('0x2d')][_0x8164('0x4b')]({'where':{'id':_0x1ab7b6[_0x8164('0x49')]['id']}})['then'](handleEntityNotFound(_0x2ebe55,null))['then'](saveUpdates(_0x1ab7b6[_0x8164('0x4d')],null))[_0x8164('0x27')](respondWithResult(_0x2ebe55,null))[_0x8164('0x47')](handleError(_0x2ebe55,null));};exports['destroy']=function(_0xcd2994,_0x2e06e2){return db[_0x8164('0x2d')]['find']({'where':{'id':_0xcd2994['params']['id']}})['then'](handleEntityNotFound(_0x2e06e2,null))[_0x8164('0x27')](removeEntity(_0x2e06e2,null))['catch'](handleError(_0x2e06e2,null));};exports['addConditions']=function(_0x2ed678,_0x2cdc99,_0x358c4c){return db[_0x8164('0x4e')]['find']({'where':{'id':_0x2ed678[_0x8164('0x49')]['id']}})[_0x8164('0x27')](handleEntityNotFound(_0x2cdc99,null))[_0x8164('0x27')](function(_0x29b09f){if(_0x29b09f){return _0x29b09f['addConditions'](_0x2ed678[_0x8164('0x4d')][_0x8164('0x4f')],_[_0x8164('0x50')](_0x2ed678[_0x8164('0x4d')],[_0x8164('0x4f'),'id'])||{});}})[_0x8164('0x27')](respondWithResult(_0x2cdc99,null))[_0x8164('0x47')](handleError(_0x2cdc99,null));};exports[_0x8164('0x51')]=function(_0x126d37,_0x53a76f,_0x2b22ec){var _0x1281a9={};var _0x5b8c94={};var _0x279318;var _0x6ce563;return db[_0x8164('0x2d')][_0x8164('0x52')]({'where':{'id':_0x126d37['params']['id']}})[_0x8164('0x27')](handleEntityNotFound(_0x53a76f,null))['then'](function(_0x24d3ad){if(_0x24d3ad){_0x279318=_0x24d3ad;_0x5b8c94[_0x8164('0x32')]=_[_0x8164('0x35')](db['Condition'][_0x8164('0x2e')]);_0x5b8c94['query']=_[_0x8164('0x35')](_0x126d37[_0x8164('0x34')]);_0x5b8c94[_0x8164('0x3e')]=_['intersection'](_0x5b8c94[_0x8164('0x32')],_0x5b8c94[_0x8164('0x34')]);_0x1281a9['attributes']=_[_0x8164('0x37')](_0x5b8c94[_0x8164('0x32')],qs['fields'](_0x126d37['query'][_0x8164('0x38')]));_0x1281a9[_0x8164('0x36')]=_0x1281a9[_0x8164('0x36')][_0x8164('0x39')]?_0x1281a9['attributes']:_0x5b8c94[_0x8164('0x32')];_0x1281a9['order']=qs['sort'](_0x126d37['query'][_0x8164('0x3d')]);_0x1281a9[_0x8164('0x41')]=qs[_0x8164('0x3e')](_['pick'](_0x126d37[_0x8164('0x34')],_0x5b8c94[_0x8164('0x3e')]));if(_0x126d37[_0x8164('0x34')][_0x8164('0x40')]){_0x1281a9['where']=_[_0x8164('0x42')](_0x1281a9[_0x8164('0x41')],{'$or':_['map'](_0x1281a9[_0x8164('0x36')],function(_0x52cc2c){var _0x513622={};_0x513622[_0x52cc2c]={'$like':'%'+_0x126d37[_0x8164('0x34')][_0x8164('0x40')]+'%'};return _0x513622;})});}_0x1281a9=_[_0x8164('0x42')]({},_0x1281a9,_0x126d37[_0x8164('0x4a')]);return _0x279318[_0x8164('0x51')](_0x1281a9);}})['then'](function(_0x347b02){if(_0x347b02){_0x6ce563=_0x347b02[_0x8164('0x39')];if(!_0x126d37['query']['hasOwnProperty'](_0x8164('0x3b'))){_0x1281a9[_0x8164('0x21')]=qs['limit'](_0x126d37[_0x8164('0x34')][_0x8164('0x21')]);_0x1281a9['offset']=qs[_0x8164('0x1f')](_0x126d37[_0x8164('0x34')][_0x8164('0x1f')]);}return _0x279318['getConditions'](_0x1281a9);}})[_0x8164('0x27')](function(_0x554ac6){if(_0x554ac6){return _0x554ac6?{'count':_0x6ce563,'rows':_0x554ac6}:null;}})[_0x8164('0x27')](respondWithResult(_0x53a76f,null))['catch'](handleError(_0x53a76f,null));};exports[_0x8164('0x53')]=function(_0x23301c,_0x2ac4ca,_0x2c8c0d){return db[_0x8164('0x54')]['find']({'where':{'id':_0x23301c[_0x8164('0x49')]['id']}})[_0x8164('0x27')](handleEntityNotFound(_0x2ac4ca,null))['then'](function(_0x104f6a){if(_0x104f6a){return _0x104f6a[_0x8164('0x53')](_0x23301c[_0x8164('0x4d')][_0x8164('0x4f')],_[_0x8164('0x50')](_0x23301c[_0x8164('0x4d')],[_0x8164('0x4f'),'id'])||{});}})[_0x8164('0x27')](respondWithResult(_0x2ac4ca,null))[_0x8164('0x47')](handleError(_0x2ac4ca,null));};exports[_0x8164('0x55')]=function(_0x32dee8,_0x115630,_0x315c22){var _0x36dcef={};var _0x59ebdc={};var _0x34ce71;var _0x1671aa;return db['Automation'][_0x8164('0x52')]({'where':{'id':_0x32dee8[_0x8164('0x49')]['id']}})[_0x8164('0x27')](handleEntityNotFound(_0x115630,null))[_0x8164('0x27')](function(_0x561d42){if(_0x561d42){_0x34ce71=_0x561d42;_0x59ebdc['model']=_[_0x8164('0x35')](db[_0x8164('0x54')][_0x8164('0x2e')]);_0x59ebdc[_0x8164('0x34')]=_[_0x8164('0x35')](_0x32dee8['query']);_0x59ebdc[_0x8164('0x3e')]=_[_0x8164('0x37')](_0x59ebdc['model'],_0x59ebdc[_0x8164('0x34')]);_0x36dcef[_0x8164('0x36')]=_[_0x8164('0x37')](_0x59ebdc['model'],qs[_0x8164('0x38')](_0x32dee8[_0x8164('0x34')][_0x8164('0x38')]));_0x36dcef[_0x8164('0x36')]=_0x36dcef['attributes']['length']?_0x36dcef[_0x8164('0x36')]:_0x59ebdc['model'];_0x36dcef[_0x8164('0x3c')]=qs[_0x8164('0x3d')](_0x32dee8[_0x8164('0x34')][_0x8164('0x3d')]);_0x36dcef[_0x8164('0x41')]=qs[_0x8164('0x3e')](_[_0x8164('0x3f')](_0x32dee8[_0x8164('0x34')],_0x59ebdc[_0x8164('0x3e')]));if(_0x32dee8[_0x8164('0x34')]['filter']){_0x36dcef['where']=_[_0x8164('0x42')](_0x36dcef[_0x8164('0x41')],{'$or':_[_0x8164('0x33')](_0x36dcef[_0x8164('0x36')],function(_0x57ac3c){var _0x4aae87={};_0x4aae87[_0x57ac3c]={'$like':'%'+_0x32dee8[_0x8164('0x34')]['filter']+'%'};return _0x4aae87;})});}_0x36dcef=_[_0x8164('0x42')]({},_0x36dcef,_0x32dee8[_0x8164('0x4a')]);return _0x34ce71[_0x8164('0x55')](_0x36dcef);}})[_0x8164('0x27')](function(_0x40d25a){if(_0x40d25a){_0x1671aa=_0x40d25a[_0x8164('0x39')];if(!_0x32dee8[_0x8164('0x34')][_0x8164('0x3a')](_0x8164('0x3b'))){_0x36dcef[_0x8164('0x21')]=qs[_0x8164('0x21')](_0x32dee8[_0x8164('0x34')][_0x8164('0x21')]);_0x36dcef[_0x8164('0x1f')]=qs[_0x8164('0x1f')](_0x32dee8['query'][_0x8164('0x1f')]);}return _0x34ce71[_0x8164('0x55')](_0x36dcef);}})[_0x8164('0x27')](function(_0x1737bb){if(_0x1737bb){return _0x1737bb?{'count':_0x1671aa,'rows':_0x1737bb}:null;}})[_0x8164('0x27')](respondWithResult(_0x115630,null))[_0x8164('0x47')](handleError(_0x115630,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 8667221..b2a3739 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 _0xadcb=['./automation.attributes','exports','define','tools_automations','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5cc993,_0x498f74){var _0x5bfbd0=function(_0x35ae1f){while(--_0x35ae1f){_0x5cc993['push'](_0x5cc993['shift']());}};_0x5bfbd0(++_0x498f74);}(_0xadcb,0xb4));var _0xbadc=function(_0x50319c,_0x332402){_0x50319c=_0x50319c-0x0;var _0x20f96e=_0xadcb[_0x50319c];return _0x20f96e;};'use strict';var _=require('lodash');var util=require(_0xbadc('0x0'));var logger=require('../../config/logger')(_0xbadc('0x1'));var moment=require(_0xbadc('0x2'));var BPromise=require(_0xbadc('0x3'));var rp=require(_0xbadc('0x4'));var fs=require('fs');var path=require(_0xbadc('0x5'));var rimraf=require('rimraf');var config=require(_0xbadc('0x6'));var attributes=require(_0xbadc('0x7'));module[_0xbadc('0x8')]=function(_0x36f30f,_0x1b9ac5){return _0x36f30f[_0xbadc('0x9')]('Automation',attributes,{'tableName':_0xbadc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea38=['moment','bluebird','request-promise','path','./automation.attributes','define','Automation','lodash','util','../../config/logger'];(function(_0x442f02,_0x47d845){var _0xab6ef1=function(_0x4cad5c){while(--_0x4cad5c){_0x442f02['push'](_0x442f02['shift']());}};_0xab6ef1(++_0x47d845);}(_0xea38,0x1d3));var _0x8ea3=function(_0x3e85ac,_0x1db7ae){_0x3e85ac=_0x3e85ac-0x0;var _0x145c9f=_0xea38[_0x3e85ac];return _0x145c9f;};'use strict';var _=require(_0x8ea3('0x0'));var util=require(_0x8ea3('0x1'));var logger=require(_0x8ea3('0x2'))('api');var moment=require(_0x8ea3('0x3'));var BPromise=require(_0x8ea3('0x4'));var rp=require(_0x8ea3('0x5'));var fs=require('fs');var path=require(_0x8ea3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8ea3('0x7'));module['exports']=function(_0x4b35c1,_0x527556){return _0x4b35c1[_0x8ea3('0x8')](_0x8ea3('0x9'),attributes,{'tableName':'tools_automations','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 fbc74a0..740f012 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 _0x414f=['then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x414f,0x13f));var _0xf414=function(_0x3ea3ae,_0x29dd29){_0x3ea3ae=_0x3ea3ae-0x0;var _0x2aa587=_0x414f[_0x3ea3ae];return _0x2aa587;};'use strict';var _=require(_0xf414('0x0'));var util=require('util');var moment=require(_0xf414('0x1'));var BPromise=require(_0xf414('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf414('0x3'));var db=require(_0xf414('0x4'))['db'];var utils=require(_0xf414('0x5'));var logger=require(_0xf414('0x6'))(_0xf414('0x7'));var config=require(_0xf414('0x8'));var jayson=require(_0xf414('0x9'));var client=jayson['client'][_0xf414('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cdcdb,_0x34c4d0,_0x2306e5){return new BPromise(function(_0xad732,_0x5194e5){return client['request'](_0x4cdcdb,_0x2306e5)[_0xf414('0xb')](function(_0x2bbf01){logger[_0xf414('0xc')](_0xf414('0xd'),_0x34c4d0,_0xf414('0xe'));logger[_0xf414('0xf')](_0xf414('0x10'),_0x34c4d0,_0xf414('0xe'),JSON['stringify'](_0x2bbf01));if(_0x2bbf01['error']){if(_0x2bbf01[_0xf414('0x11')][_0xf414('0x12')]===0x1f4){logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x2bbf01[_0xf414('0x11')]['message']);return _0x5194e5(_0x2bbf01[_0xf414('0x11')][_0xf414('0x13')]);}logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x2bbf01[_0xf414('0x11')]['message']);return _0xad732(_0x2bbf01[_0xf414('0x11')][_0xf414('0x13')]);}else{logger[_0xf414('0xc')](_0xf414('0xd'),_0x34c4d0,_0xf414('0xe'));_0xad732(_0x2bbf01[_0xf414('0x14')][_0xf414('0x13')]);}})[_0xf414('0x15')](function(_0x483e29){logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x483e29);_0x5194e5(_0x483e29);});});}
\ No newline at end of file
+var _0x0b63=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x0b63,0xe7));var _0x30b6=function(_0x55e3e6,_0x27eb66){_0x55e3e6=_0x55e3e6-0x0;var _0x42e3d9=_0x0b63[_0x55e3e6];return _0x42e3d9;};'use strict';var _=require(_0x30b6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x30b6('0x1'));var rs=require(_0x30b6('0x2'));var fs=require('fs');var Redis=require(_0x30b6('0x3'));var db=require(_0x30b6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x30b6('0x5'))(_0x30b6('0x6'));var config=require(_0x30b6('0x7'));var jayson=require(_0x30b6('0x8'));var client=jayson[_0x30b6('0x9')][_0x30b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fb35e,_0x11a637,_0x520533){return new BPromise(function(_0x4488c6,_0x4eb0af){return client[_0x30b6('0xb')](_0x4fb35e,_0x520533)[_0x30b6('0xc')](function(_0x522a03){logger[_0x30b6('0xd')](_0x30b6('0xe'),_0x11a637,'request\x20sent');logger[_0x30b6('0xf')](_0x30b6('0x10'),_0x11a637,_0x30b6('0x11'),JSON[_0x30b6('0x12')](_0x522a03));if(_0x522a03[_0x30b6('0x13')]){if(_0x522a03[_0x30b6('0x13')]['code']===0x1f4){logger[_0x30b6('0x13')](_0x30b6('0xe'),_0x11a637,_0x522a03[_0x30b6('0x13')][_0x30b6('0x14')]);return _0x4eb0af(_0x522a03['error'][_0x30b6('0x14')]);}logger['error']('Automation,\x20%s,\x20%s',_0x11a637,_0x522a03[_0x30b6('0x13')][_0x30b6('0x14')]);return _0x4488c6(_0x522a03[_0x30b6('0x13')]['message']);}else{logger['info'](_0x30b6('0xe'),_0x11a637,_0x30b6('0x11'));_0x4488c6(_0x522a03['result'][_0x30b6('0x14')]);}})['catch'](function(_0xee580f){logger[_0x30b6('0x13')](_0x30b6('0xe'),_0x11a637,_0xee580f);_0x4eb0af(_0xee580f);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index aa038fa..af6ff09 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 _0xc903=['exports','multer','path','Router','../../components/auth/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions','post','create','addConditions','/:id/actions','addActions','put','update','delete'];(function(_0xd23074,_0x9576e3){var _0x2eeb0f=function(_0x205a0a){while(--_0x205a0a){_0xd23074['push'](_0xd23074['shift']());}};_0x2eeb0f(++_0x9576e3);}(_0xc903,0x177));var _0x3c90=function(_0x2bcb75,_0x5789a7){_0x2bcb75=_0x2bcb75-0x0;var _0x175345=_0xc903[_0x2bcb75];return _0x175345;};'use strict';var multer=require(_0x3c90('0x0'));var util=require('util');var path=require(_0x3c90('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3c90('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3c90('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3c90('0x4'));var controller=require(_0x3c90('0x5'));router['get']('/',auth[_0x3c90('0x6')](),controller[_0x3c90('0x7')]);router[_0x3c90('0x8')](_0x3c90('0x9'),auth[_0x3c90('0x6')](),controller[_0x3c90('0xa')]);router[_0x3c90('0x8')](_0x3c90('0xb'),auth[_0x3c90('0x6')](),controller[_0x3c90('0xc')]);router['get']('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router[_0x3c90('0xd')]('/',auth[_0x3c90('0x6')](),controller[_0x3c90('0xe')]);router[_0x3c90('0xd')]('/:id/conditions',auth[_0x3c90('0x6')](),controller[_0x3c90('0xf')]);router[_0x3c90('0xd')](_0x3c90('0x10'),auth[_0x3c90('0x6')](),controller[_0x3c90('0x11')]);router[_0x3c90('0x12')](_0x3c90('0x9'),auth['isAuthenticated'](),controller[_0x3c90('0x13')]);router[_0x3c90('0x14')](_0x3c90('0x9'),auth[_0x3c90('0x6')](),controller['destroy']);module[_0x3c90('0x15')]=router;
\ No newline at end of file
+var _0xc964=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','post','create','/:id/actions','update','destroy','exports'];(function(_0x2302a1,_0x4bc33d){var _0x413cae=function(_0x233632){while(--_0x233632){_0x2302a1['push'](_0x2302a1['shift']());}};_0x413cae(++_0x4bc33d);}(_0xc964,0x7e));var _0x4c96=function(_0x4d06ae,_0x45c1cc){_0x4d06ae=_0x4d06ae-0x0;var _0x274277=_0xc964[_0x4d06ae];return _0x274277;};'use strict';var multer=require(_0x4c96('0x0'));var util=require(_0x4c96('0x1'));var path=require('path');var timeout=require(_0x4c96('0x2'));var express=require(_0x4c96('0x3'));var router=express[_0x4c96('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4c96('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4c96('0x6'));var controller=require(_0x4c96('0x7'));router[_0x4c96('0x8')]('/',auth[_0x4c96('0x9')](),controller[_0x4c96('0xa')]);router[_0x4c96('0x8')](_0x4c96('0xb'),auth['isAuthenticated'](),controller[_0x4c96('0xc')]);router[_0x4c96('0x8')](_0x4c96('0xd'),auth['isAuthenticated'](),controller[_0x4c96('0xe')]);router[_0x4c96('0x8')]('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router[_0x4c96('0xf')]('/',auth[_0x4c96('0x9')](),controller[_0x4c96('0x10')]);router['post'](_0x4c96('0xd'),auth['isAuthenticated'](),controller['addConditions']);router[_0x4c96('0xf')](_0x4c96('0x11'),auth[_0x4c96('0x9')](),controller['addActions']);router['put'](_0x4c96('0xb'),auth[_0x4c96('0x9')](),controller[_0x4c96('0x12')]);router['delete'](_0x4c96('0xb'),auth[_0x4c96('0x9')](),controller[_0x4c96('0x13')]);module[_0x4c96('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index e5f0b44..3c5f429 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 _0xaffb=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xaffb,0xc3));var _0xbaff=function(_0x2bd88d,_0x2d5dc3){_0x2bd88d=_0x2bd88d-0x0;var _0x5516d4=_0xaffb[_0x2bd88d];return _0x5516d4;};'use strict';var Sequelize=require(_0xbaff('0x0'));module[_0xbaff('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xbaff('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xbaff('0x3')]('ivr'),'allowNull':![],'defaultValue':_0xbaff('0x4')},'description':{'type':Sequelize[_0xbaff('0x5')]},'active':{'type':Sequelize[_0xbaff('0x6')],'defaultValue':0x0,'comment':_0xbaff('0x7')},'limitCalls':{'type':Sequelize[_0xbaff('0x8')](0x4)[_0xbaff('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xbaff('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0xbaff('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xbaff('0x8')](0x3)[_0xbaff('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbaff('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0xbaff('0x8')](0x3)[_0xbaff('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbaff('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xbaff('0x8')](0x5)[_0xbaff('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbaff('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0xbaff('0x8')](0x3)[_0xbaff('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbaff('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0xbaff('0x8')](0x5)[_0xbaff('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbaff('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xbaff('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbaff('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0xbaff('0x8')](0x3)[_0xbaff('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xbaff('0x11')},'dialTimezone':{'type':Sequelize[_0xbaff('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xbaff('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0xbaff('0x3')](_0xbaff('0x13'),_0xbaff('0x14'),_0xbaff('0x15')),'defaultValue':_0xbaff('0x13')},'dialAMDActive':{'type':Sequelize[_0xbaff('0x6')],'defaultValue':0x0,'comment':_0xbaff('0x16')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xbaff('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xbaff('0x17')},'dialAMDGreeting':{'type':Sequelize[_0xbaff('0x8')](0x9)[_0xbaff('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xbaff('0x18')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xbaff('0x8')](0x9)[_0xbaff('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbaff('0x19')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbaff('0x8')](0x9)[_0xbaff('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbaff('0x1a')},'dialAMDMinWordLength':{'type':Sequelize[_0xbaff('0x8')](0x9)[_0xbaff('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xbaff('0x1b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xbaff('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xbaff('0x1c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xbaff('0x1d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xbaff('0x8')](0x5)[_0xbaff('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xbaff('0x1e')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xbaff('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbaff('0x1f')},'dialOrderByScheduledAt':{'type':Sequelize[_0xbaff('0x3')](_0xbaff('0x20'),_0xbaff('0x21')),'defaultValue':_0xbaff('0x20')},'dialPrefix':{'type':Sequelize[_0xbaff('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xbaff('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xbaff('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbaff('0x22')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xbaff('0x8')](0x3)[_0xbaff('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbaff('0x23')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xbaff('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbaff('0x24')},'dialDropMaxRetry':{'type':Sequelize[_0xbaff('0x8')](0x3)[_0xbaff('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbaff('0x25')},'dialDropRetryFrequency':{'type':Sequelize[_0xbaff('0x8')](0x5)[_0xbaff('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbaff('0x26')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbaff('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xbaff('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbaff('0x27')},'dialMachineMaxRetry':{'type':Sequelize[_0xbaff('0x8')](0x3)[_0xbaff('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbaff('0x28')},'dialMachineRetryFrequency':{'type':Sequelize[_0xbaff('0x8')](0x5)[_0xbaff('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbaff('0x29')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xbaff('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbaff('0x2a')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbaff('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbaff('0x2b')}};
\ No newline at end of file
+var _0x070f=['STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','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)','07:00-22:00,*,*,*','ENUM','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','ivr'];(function(_0x35d29a,_0x10dc25){var _0x17ef40=function(_0x24f55a){while(--_0x24f55a){_0x35d29a['push'](_0x35d29a['shift']());}};_0x17ef40(++_0x10dc25);}(_0x070f,0x15b));var _0xf070=function(_0x3f96b2,_0x458834){_0x3f96b2=_0x3f96b2-0x0;var _0x10fa16=_0x070f[_0x3f96b2];return _0x10fa16;};'use strict';var Sequelize=require(_0xf070('0x0'));module[_0xf070('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0xf070('0x2')},'description':{'type':Sequelize[_0xf070('0x3')]},'active':{'type':Sequelize[_0xf070('0x4')],'defaultValue':0x0,'comment':_0xf070('0x5')},'limitCalls':{'type':Sequelize[_0xf070('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf070('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf070('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf070('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0xf070('0x6')](0x3)[_0xf070('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf070('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf070('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf070('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf070('0x6')](0x5)[_0xf070('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf070('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xf070('0x6')](0x3)[_0xf070('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf070('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf070('0x6')](0x5)[_0xf070('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf070('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf070('0x6')](0x3)[_0xf070('0x8')],'defaultValue':0x3,'comment':_0xf070('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf070('0x6')](0x5)[_0xf070('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf070('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf070('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xf070('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf070('0x3')],'defaultValue':_0xf070('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xf070('0x11')](_0xf070('0x12'),'never','onlyIfOpen'),'defaultValue':_0xf070('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf070('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xf070('0x6')](0x9)[_0xf070('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf070('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xf070('0x6')](0x9)[_0xf070('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf070('0x6')](0x9)[_0xf070('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf070('0x6')](0x9)[_0xf070('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf070('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xf070('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf070('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf070('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf070('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf070('0x6')](0x9)[_0xf070('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf070('0x6')](0x5)[_0xf070('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf070('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf070('0x6')](0x9)[_0xf070('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf070('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf070('0x11')]('DESC',_0xf070('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf070('0x6')](0x3)[_0xf070('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xf070('0x6')](0x3)[_0xf070('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf070('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf070('0x6')](0x3)[_0xf070('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf070('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf070('0x1c')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf070('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf070('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0xf070('0x6')](0x5)[_0xf070('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf070('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf070('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf070('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf070('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0xf070('0x6')](0x3)[_0xf070('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xf070('0x6')](0x5)[_0xf070('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf070('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf070('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf070('0x6')](0x5)[_0xf070('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf070('0x22')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index ce537e5..1666297 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 _0x094c=['sequelize','all','removeBlackLists','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','UserProfileResource','destroy','end','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','update','getHoppers','findOne','CmHopper','sort','pick','filter','getHopperHistories','CmHopperHistory','CmHopperFinal','CampaignId','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','insert','cm_hopper','fromQuery','ContactId','ListId','field','phone','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','onlyIfOpen','into','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push'];(function(_0x2d2460,_0x33a7d5){var _0x4cf86a=function(_0x165a2f){while(--_0x165a2f){_0x2d2460['push'](_0x2d2460['shift']());}};_0x4cf86a(++_0x33a7d5);}(_0x094c,0x131));var _0xc094=function(_0x239b5e,_0x208a3f){_0x239b5e=_0x239b5e-0x0;var _0x577f3d=_0x094c[_0x239b5e];return _0x577f3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc094('0x0'));var zipdir=require(_0xc094('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc094('0x2'));var moment=require(_0xc094('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc094('0x4'));var util=require(_0xc094('0x5'));var path=require(_0xc094('0x6'));var sox=require(_0xc094('0x7'));var csv=require(_0xc094('0x8'));var ejs=require(_0xc094('0x9'));var fs=require('fs');var fs_extra=require(_0xc094('0xa'));var _=require('lodash');var squel=require(_0xc094('0xb'));var crypto=require('crypto');var jsforce=require(_0xc094('0xc'));var deskjs=require(_0xc094('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc094('0xe'));var Papa=require(_0xc094('0xf'));var Redis=require(_0xc094('0x10'));var authService=require(_0xc094('0x11'));var qs=require(_0xc094('0x12'));var as=require(_0xc094('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc094('0x14'))(_0xc094('0x15'));var utils=require(_0xc094('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc094('0x17'))['db'];function respondWithStatusCode(_0x453ed2,_0x384005){_0x384005=_0x384005||0xcc;return function(_0x458315){if(_0x458315){return _0x453ed2[_0xc094('0x18')](_0x384005);}return _0x453ed2[_0xc094('0x19')](_0x384005)['end']();};}function respondWithResult(_0x425f56,_0x5dee69){_0x5dee69=_0x5dee69||0xc8;return function(_0x3c47f6){if(_0x3c47f6){return _0x425f56[_0xc094('0x19')](_0x5dee69)[_0xc094('0x1a')](_0x3c47f6);}};}function respondWithFilteredResult(_0x43625e,_0x188418){return function(_0x147dc9){if(_0x147dc9){var _0x3b6fe2=typeof _0x188418[_0xc094('0x1b')]===_0xc094('0x1c')&&typeof _0x188418[_0xc094('0x1d')]==='undefined';var _0x5bde5d=_0x147dc9[_0xc094('0x1e')];var _0x384170=_0x3b6fe2?0x0:_0x188418[_0xc094('0x1b')];var _0x3290d4=_0x3b6fe2?_0x147dc9['count']:_0x188418[_0xc094('0x1b')]+_0x188418['limit'];var _0x3eec46;if(_0x3290d4>=_0x5bde5d){_0x3290d4=_0x5bde5d;_0x3eec46=0xc8;}else{_0x3eec46=0xce;}_0x43625e[_0xc094('0x19')](_0x3eec46);return _0x43625e[_0xc094('0x1f')](_0xc094('0x20'),_0x384170+'-'+_0x3290d4+'/'+_0x5bde5d)[_0xc094('0x1a')](_0x147dc9);}return null;};}function patchUpdates(_0x97dba8){return function(_0x5e2cc8){try{jsonpatch[_0xc094('0x21')](_0x5e2cc8,_0x97dba8,!![]);}catch(_0x54c1a9){return BPromise[_0xc094('0x22')](_0x54c1a9);}return _0x5e2cc8[_0xc094('0x23')]();};}function saveUpdates(_0x4d814d,_0x5bbc42){return function(_0x321bb3){if(_0x321bb3){return _0x321bb3['update'](_0x4d814d)[_0xc094('0x24')](function(_0x17f044){return _0x17f044;});}return null;};}function removeEntity(_0x249a32,_0x228b93){return function(_0x364ede){if(_0x364ede){return _0x364ede['destroy']()['then'](function(){var _0x59f5a6=_0x364ede['get']({'plain':!![]});var _0xa85298='IvrCampaigns';return db[_0xc094('0x25')][_0xc094('0x26')]({'where':{'type':_0xa85298,'resourceId':_0x59f5a6['id']}})[_0xc094('0x24')](function(){return _0x364ede;});})[_0xc094('0x24')](function(){_0x249a32[_0xc094('0x19')](0xcc)[_0xc094('0x27')]();});}};}function handleEntityNotFound(_0x1f9675,_0xaa6ff0){return function(_0x1000e6){if(!_0x1000e6){_0x1f9675[_0xc094('0x18')](0x194);}return _0x1000e6;};}function handleError(_0x5a92d8,_0x203f94){_0x203f94=_0x203f94||0x1f4;return function(_0x1936f3){logger['error'](_0x1936f3[_0xc094('0x28')]);if(_0x1936f3[_0xc094('0x29')]){delete _0x1936f3[_0xc094('0x29')];}_0x5a92d8[_0xc094('0x19')](_0x203f94)[_0xc094('0x2a')](_0x1936f3);};}exports[_0xc094('0x2b')]=function(_0x23790f,_0x27614c){var _0x5090e3={},_0xb267a4={},_0x56ef51={'count':0x0,'rows':[]};var _0x5bf460=_[_0xc094('0x2c')](db[_0xc094('0x2d')][_0xc094('0x2e')],function(_0x421b78){return{'name':_0x421b78[_0xc094('0x2f')],'type':_0x421b78[_0xc094('0x30')][_0xc094('0x31')]};});_0xb267a4['model']=_['map'](_0x5bf460,_0xc094('0x29'));_0xb267a4[_0xc094('0x32')]=_['keys'](_0x23790f['query']);_0xb267a4[_0xc094('0x33')]=_[_0xc094('0x34')](_0xb267a4['model'],_0xb267a4[_0xc094('0x32')]);_0x5090e3['attributes']=_[_0xc094('0x34')](_0xb267a4[_0xc094('0x35')],qs[_0xc094('0x36')](_0x23790f[_0xc094('0x32')][_0xc094('0x36')]));_0x5090e3['attributes']=_0x5090e3[_0xc094('0x37')][_0xc094('0x38')]?_0x5090e3['attributes']:_0xb267a4[_0xc094('0x35')];if(!_0x23790f[_0xc094('0x32')][_0xc094('0x39')](_0xc094('0x3a'))){_0x5090e3[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x23790f[_0xc094('0x32')]['limit']);_0x5090e3['offset']=qs[_0xc094('0x1b')](_0x23790f[_0xc094('0x32')][_0xc094('0x1b')]);}_0x5090e3[_0xc094('0x3b')]=qs['sort'](_0x23790f[_0xc094('0x32')]['sort']);_0x5090e3['where']=qs['filters'](_['pick'](_0x23790f[_0xc094('0x32')],_0xb267a4[_0xc094('0x33')]),_0x5bf460);if(_0x23790f['query']['filter']){_0x5090e3[_0xc094('0x3c')]=_[_0xc094('0x3d')](_0x5090e3[_0xc094('0x3c')],{'$or':_['map'](_0x5bf460,function(_0x484e63){if(_0x484e63[_0xc094('0x30')]!=='VIRTUAL'){var _0x2337c3={};_0x2337c3[_0x484e63[_0xc094('0x29')]]={'$like':'%'+_0x23790f[_0xc094('0x32')]['filter']+'%'};return _0x2337c3;}})});}_0x5090e3=_[_0xc094('0x3d')]({},_0x5090e3,_0x23790f[_0xc094('0x3e')]);var _0x299494={'where':_0x5090e3[_0xc094('0x3c')]};return db['Campaign'][_0xc094('0x1e')](_0x299494)[_0xc094('0x24')](function(_0x109a09){_0x56ef51[_0xc094('0x1e')]=_0x109a09;if(_0x23790f[_0xc094('0x32')][_0xc094('0x3f')]){_0x5090e3[_0xc094('0x40')]=[{'all':!![]}];}return db['Campaign'][_0xc094('0x41')](_0x5090e3);})['then'](function(_0x5082df){_0x56ef51[_0xc094('0x42')]=_0x5082df;return _0x56ef51;})['then'](respondWithFilteredResult(_0x27614c,_0x5090e3))[_0xc094('0x43')](handleError(_0x27614c,null));};exports[_0xc094('0x44')]=function(_0x43600e,_0x1c97e6){var _0x388e76={'raw':![],'where':{'id':_0x43600e['params']['id']}},_0x1bf5f1={};_0x1bf5f1[_0xc094('0x35')]=_[_0xc094('0x45')](db['Campaign'][_0xc094('0x2e')]);_0x1bf5f1['query']=_['keys'](_0x43600e[_0xc094('0x32')]);_0x1bf5f1[_0xc094('0x33')]=_[_0xc094('0x34')](_0x1bf5f1[_0xc094('0x35')],_0x1bf5f1['query']);_0x388e76[_0xc094('0x37')]=_[_0xc094('0x34')](_0x1bf5f1[_0xc094('0x35')],qs[_0xc094('0x36')](_0x43600e['query'][_0xc094('0x36')]));_0x388e76[_0xc094('0x37')]=_0x388e76[_0xc094('0x37')][_0xc094('0x38')]?_0x388e76[_0xc094('0x37')]:_0x1bf5f1[_0xc094('0x35')];if(_0x43600e['query']['includeAll']){_0x388e76[_0xc094('0x40')]=[{'all':!![]}];}_0x388e76=_['merge']({},_0x388e76,_0x43600e[_0xc094('0x3e')]);return db['Campaign'][_0xc094('0x46')](_0x388e76)['then'](handleEntityNotFound(_0x1c97e6,null))[_0xc094('0x24')](respondWithResult(_0x1c97e6,null))['catch'](handleError(_0x1c97e6,null));};exports[_0xc094('0x47')]=function(_0x56dc51,_0x46aa3b){return db[_0xc094('0x2d')][_0xc094('0x47')](_0x56dc51[_0xc094('0x48')],{})['then'](function(_0x43cab6){var _0x5f1f2a=_0x56dc51[_0xc094('0x49')][_0xc094('0x4a')]({'plain':!![]});if(!_0x5f1f2a)throw new Error(_0xc094('0x4b'));if(_0x5f1f2a[_0xc094('0x4c')]===_0xc094('0x49')){var _0xb7ba29=_0x43cab6[_0xc094('0x4a')]({'plain':!![]});var _0xac85c5=_0xc094('0x4d');return db[_0xc094('0x4e')]['find']({'where':{'name':_0xac85c5,'userProfileId':_0x5f1f2a[_0xc094('0x4f')]},'raw':!![]})['then'](function(_0x2ba0a9){if(_0x2ba0a9&&_0x2ba0a9[_0xc094('0x50')]===0x0){return db[_0xc094('0x25')]['create']({'name':_0xb7ba29[_0xc094('0x29')],'resourceId':_0xb7ba29['id'],'type':_0x2ba0a9[_0xc094('0x29')],'sectionId':_0x2ba0a9['id']},{})[_0xc094('0x24')](function(){return _0x43cab6;});}else{return _0x43cab6;}})[_0xc094('0x43')](function(_0x5b38ef){logger[_0xc094('0x51')](_0xc094('0x52'),_0x5b38ef);throw _0x5b38ef;});}return _0x43cab6;})['then'](respondWithResult(_0x46aa3b,0xc9))[_0xc094('0x43')](handleError(_0x46aa3b,null));};exports[_0xc094('0x53')]=function(_0x5ac606,_0x1a2db9){var _0x54fc6b={'where':{'id':_0x5ac606[_0xc094('0x54')]['id']}},_0x5e7a51={};_0x5e7a51[_0xc094('0x35')]=_[_0xc094('0x45')](db['Campaign'][_0xc094('0x2e')]);_0x54fc6b[_0xc094('0x37')]=_[_0xc094('0x34')](_0x5e7a51[_0xc094('0x35')],qs[_0xc094('0x36')](_0x5ac606[_0xc094('0x32')][_0xc094('0x36')]));_0x54fc6b[_0xc094('0x37')]=_0x54fc6b[_0xc094('0x37')][_0xc094('0x38')]?_0x54fc6b['attributes']:_0x5e7a51[_0xc094('0x35')];if(_0x5ac606[_0xc094('0x32')][_0xc094('0x3f')]){_0x54fc6b['include']=[{'all':!![]}];}_0x54fc6b=_[_0xc094('0x3d')]({},_0x54fc6b,_0x5ac606[_0xc094('0x3e')]);return db['Campaign'][_0xc094('0x46')](_0x54fc6b)[_0xc094('0x24')](handleEntityNotFound(_0x1a2db9,null))[_0xc094('0x24')](function(_0x5f2bba){if(_0x5f2bba){var _0x1a0b90=_0x5f2bba['get']({'plain':!![]});_0x1a0b90=qs[_0xc094('0x55')](_0x1a0b90,['id',_0xc094('0x56'),_0xc094('0x57')]);_0x5ac606[_0xc094('0x48')]=_[_0xc094('0x55')](_0x5ac606[_0xc094('0x48')],['id',_0xc094('0x56'),_0xc094('0x57')]);return db[_0xc094('0x2d')][_0xc094('0x47')](_[_0xc094('0x3d')](_0x1a0b90,_0x5ac606[_0xc094('0x48')]),{'include':_0x5ac606['query'][_0xc094('0x3f')]?[{'all':!![]}]:undefined})[_0xc094('0x24')](function(_0xc9d8){var _0x465b28=_0x5ac606[_0xc094('0x49')][_0xc094('0x4a')]({'plain':!![]});if(!_0x465b28)throw new Error(_0xc094('0x4b'));if(_0x465b28[_0xc094('0x4c')]===_0xc094('0x49')){var _0x419006=_0xc9d8[_0xc094('0x4a')]({'plain':!![]});var _0x22d1f3=_0xc094('0x4d');return db[_0xc094('0x4e')][_0xc094('0x46')]({'where':{'name':_0x22d1f3,'userProfileId':_0x465b28[_0xc094('0x4f')]},'raw':!![]})[_0xc094('0x24')](function(_0x401f4b){if(_0x401f4b&&_0x401f4b[_0xc094('0x50')]===0x0){return db[_0xc094('0x25')][_0xc094('0x47')]({'name':_0x419006[_0xc094('0x29')],'resourceId':_0x419006['id'],'type':_0x401f4b[_0xc094('0x29')],'sectionId':_0x401f4b['id']},{})[_0xc094('0x24')](function(){return _0xc9d8;});}else{return _0xc9d8;}})['catch'](function(_0x11c69d){logger[_0xc094('0x51')](_0xc094('0x52'),_0x11c69d);throw _0x11c69d;});}return _0xc9d8;});}})[_0xc094('0x24')](respondWithResult(_0x1a2db9,0xc9))[_0xc094('0x43')](handleError(_0x1a2db9,null));};exports[_0xc094('0x58')]=function(_0x2aae68,_0xbc704c){if(_0x2aae68[_0xc094('0x48')]['id']){delete _0x2aae68['body']['id'];}return db[_0xc094('0x2d')][_0xc094('0x46')]({'where':{'id':_0x2aae68[_0xc094('0x54')]['id']}})[_0xc094('0x24')](handleEntityNotFound(_0xbc704c,null))[_0xc094('0x24')](saveUpdates(_0x2aae68[_0xc094('0x48')],null))['then'](respondWithResult(_0xbc704c,null))[_0xc094('0x43')](handleError(_0xbc704c,null));};exports['destroy']=function(_0x3fbd46,_0x6df9b3){return db[_0xc094('0x2d')][_0xc094('0x46')]({'where':{'id':_0x3fbd46[_0xc094('0x54')]['id']}})['then'](handleEntityNotFound(_0x6df9b3,null))[_0xc094('0x24')](removeEntity(_0x6df9b3,null))[_0xc094('0x43')](handleError(_0x6df9b3,null));};exports[_0xc094('0x59')]=function(_0x2168ab,_0x443857,_0x42f14e){var _0x3b81d2={'raw':!![],'where':{}};var _0x5b56dd={};var _0x519713={'count':0x0,'rows':[]};return db[_0xc094('0x2d')][_0xc094('0x5a')]({'where':{'id':_0x2168ab['params']['id']}})['then'](handleEntityNotFound(_0x443857,null))[_0xc094('0x24')](function(_0x1575d0){if(_0x1575d0){_0x5b56dd[_0xc094('0x35')]=_['keys'](db[_0xc094('0x5b')][_0xc094('0x2e')]);_0x5b56dd[_0xc094('0x32')]=_[_0xc094('0x45')](_0x2168ab['query']);_0x5b56dd['filters']=_[_0xc094('0x34')](_0x5b56dd['model'],_0x5b56dd[_0xc094('0x32')]);_0x3b81d2['attributes']=_[_0xc094('0x34')](_0x5b56dd['model'],qs[_0xc094('0x36')](_0x2168ab[_0xc094('0x32')][_0xc094('0x36')]));_0x3b81d2[_0xc094('0x37')]=_0x3b81d2[_0xc094('0x37')][_0xc094('0x38')]?_0x3b81d2['attributes']:_0x5b56dd[_0xc094('0x35')];if(!_0x2168ab[_0xc094('0x32')][_0xc094('0x39')]('nolimit')){_0x3b81d2[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x2168ab['query'][_0xc094('0x1d')]);_0x3b81d2[_0xc094('0x1b')]=qs[_0xc094('0x1b')](_0x2168ab['query']['offset']);}_0x3b81d2['order']=qs[_0xc094('0x5c')](_0x2168ab['query'][_0xc094('0x5c')]);_0x3b81d2['where']=qs['filters'](_[_0xc094('0x5d')](_0x2168ab[_0xc094('0x32')],_0x5b56dd[_0xc094('0x33')]));_0x3b81d2['where']['CampaignId']=_0x1575d0['id'];if(_0x2168ab[_0xc094('0x32')][_0xc094('0x5e')]){_0x3b81d2[_0xc094('0x3c')]=_['merge'](_0x3b81d2[_0xc094('0x3c')],{'$or':_['map'](_0x3b81d2[_0xc094('0x37')],function(_0x5abe4a){var _0x20f456={};_0x20f456[_0x5abe4a]={'$like':'%'+_0x2168ab[_0xc094('0x32')][_0xc094('0x5e')]+'%'};return _0x20f456;})});}_0x3b81d2=_[_0xc094('0x3d')]({},_0x3b81d2,_0x2168ab['options']);return db[_0xc094('0x5b')][_0xc094('0x1e')]({'where':_0x3b81d2['where']})[_0xc094('0x24')](function(_0x53b4c0){_0x519713['count']=_0x53b4c0;if(_0x2168ab[_0xc094('0x32')][_0xc094('0x3f')]){_0x3b81d2[_0xc094('0x40')]=[{'all':!![]}];}return db[_0xc094('0x5b')]['findAll'](_0x3b81d2);})['then'](function(_0x6db787){_0x519713['rows']=_0x6db787;return _0x519713;});}})['then'](respondWithFilteredResult(_0x443857,_0x3b81d2))[_0xc094('0x43')](handleError(_0x443857,null));};exports[_0xc094('0x5f')]=function(_0x20d0a6,_0x93ed7e,_0x19a5a0){var _0xd61d85={'raw':!![],'where':{}};var _0x272d5f={};var _0x2905cf={'count':0x0,'rows':[]};return db[_0xc094('0x2d')][_0xc094('0x5a')]({'where':{'id':_0x20d0a6[_0xc094('0x54')]['id']}})['then'](handleEntityNotFound(_0x93ed7e,null))[_0xc094('0x24')](function(_0x11db0f){if(_0x11db0f){_0x272d5f[_0xc094('0x35')]=_[_0xc094('0x45')](db[_0xc094('0x60')]['rawAttributes']);_0x272d5f['query']=_['keys'](_0x20d0a6[_0xc094('0x32')]);_0x272d5f[_0xc094('0x33')]=_[_0xc094('0x34')](_0x272d5f[_0xc094('0x35')],_0x272d5f[_0xc094('0x32')]);_0xd61d85[_0xc094('0x37')]=_['intersection'](_0x272d5f[_0xc094('0x35')],qs[_0xc094('0x36')](_0x20d0a6[_0xc094('0x32')][_0xc094('0x36')]));_0xd61d85[_0xc094('0x37')]=_0xd61d85[_0xc094('0x37')][_0xc094('0x38')]?_0xd61d85[_0xc094('0x37')]:_0x272d5f['model'];if(!_0x20d0a6[_0xc094('0x32')][_0xc094('0x39')]('nolimit')){_0xd61d85[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x20d0a6[_0xc094('0x32')][_0xc094('0x1d')]);_0xd61d85[_0xc094('0x1b')]=qs[_0xc094('0x1b')](_0x20d0a6['query'][_0xc094('0x1b')]);}_0xd61d85[_0xc094('0x3b')]=qs[_0xc094('0x5c')](_0x20d0a6[_0xc094('0x32')][_0xc094('0x5c')]);_0xd61d85[_0xc094('0x3c')]=qs['filters'](_[_0xc094('0x5d')](_0x20d0a6['query'],_0x272d5f[_0xc094('0x33')]));_0xd61d85[_0xc094('0x3c')]['CampaignId']=_0x11db0f['id'];if(_0x20d0a6['query']['filter']){_0xd61d85[_0xc094('0x3c')]=_['merge'](_0xd61d85[_0xc094('0x3c')],{'$or':_['map'](_0xd61d85[_0xc094('0x37')],function(_0x19a16a){var _0x53e9b5={};_0x53e9b5[_0x19a16a]={'$like':'%'+_0x20d0a6[_0xc094('0x32')][_0xc094('0x5e')]+'%'};return _0x53e9b5;})});}_0xd61d85=_[_0xc094('0x3d')]({},_0xd61d85,_0x20d0a6['options']);return db[_0xc094('0x60')][_0xc094('0x1e')]({'where':_0xd61d85[_0xc094('0x3c')]})[_0xc094('0x24')](function(_0x550f2e){_0x2905cf[_0xc094('0x1e')]=_0x550f2e;if(_0x20d0a6['query'][_0xc094('0x3f')]){_0xd61d85[_0xc094('0x40')]=[{'all':!![]}];}return db[_0xc094('0x60')]['findAll'](_0xd61d85);})['then'](function(_0x1b5c26){_0x2905cf[_0xc094('0x42')]=_0x1b5c26;return _0x2905cf;});}})[_0xc094('0x24')](respondWithFilteredResult(_0x93ed7e,_0xd61d85))['catch'](handleError(_0x93ed7e,null));};exports['getHopperFinals']=function(_0x3b25c5,_0x37a5ff,_0x11d965){var _0x2fd2a9={'raw':!![],'where':{}};var _0x34e5da={};var _0x3b338a={'count':0x0,'rows':[]};return db[_0xc094('0x2d')][_0xc094('0x5a')]({'where':{'id':_0x3b25c5[_0xc094('0x54')]['id']}})[_0xc094('0x24')](handleEntityNotFound(_0x37a5ff,null))[_0xc094('0x24')](function(_0x359f51){if(_0x359f51){_0x34e5da[_0xc094('0x35')]=_[_0xc094('0x45')](db[_0xc094('0x61')]['rawAttributes']);_0x34e5da[_0xc094('0x32')]=_['keys'](_0x3b25c5[_0xc094('0x32')]);_0x34e5da[_0xc094('0x33')]=_[_0xc094('0x34')](_0x34e5da[_0xc094('0x35')],_0x34e5da[_0xc094('0x32')]);_0x2fd2a9[_0xc094('0x37')]=_['intersection'](_0x34e5da[_0xc094('0x35')],qs[_0xc094('0x36')](_0x3b25c5['query']['fields']));_0x2fd2a9[_0xc094('0x37')]=_0x2fd2a9[_0xc094('0x37')]['length']?_0x2fd2a9['attributes']:_0x34e5da[_0xc094('0x35')];if(!_0x3b25c5[_0xc094('0x32')][_0xc094('0x39')](_0xc094('0x3a'))){_0x2fd2a9['limit']=qs[_0xc094('0x1d')](_0x3b25c5['query'][_0xc094('0x1d')]);_0x2fd2a9[_0xc094('0x1b')]=qs[_0xc094('0x1b')](_0x3b25c5['query']['offset']);}_0x2fd2a9[_0xc094('0x3b')]=qs['sort'](_0x3b25c5[_0xc094('0x32')]['sort']);_0x2fd2a9[_0xc094('0x3c')]=qs[_0xc094('0x33')](_[_0xc094('0x5d')](_0x3b25c5[_0xc094('0x32')],_0x34e5da[_0xc094('0x33')]));_0x2fd2a9[_0xc094('0x3c')][_0xc094('0x62')]=_0x359f51['id'];if(_0x3b25c5[_0xc094('0x32')]['filter']){_0x2fd2a9[_0xc094('0x3c')]=_[_0xc094('0x3d')](_0x2fd2a9[_0xc094('0x3c')],{'$or':_[_0xc094('0x2c')](_0x2fd2a9[_0xc094('0x37')],function(_0x525b7b){var _0x1b4278={};_0x1b4278[_0x525b7b]={'$like':'%'+_0x3b25c5[_0xc094('0x32')][_0xc094('0x5e')]+'%'};return _0x1b4278;})});}_0x2fd2a9=_[_0xc094('0x3d')]({},_0x2fd2a9,_0x3b25c5[_0xc094('0x3e')]);return db[_0xc094('0x61')][_0xc094('0x1e')]({'where':_0x2fd2a9[_0xc094('0x3c')]})[_0xc094('0x24')](function(_0xf24a1e){_0x3b338a[_0xc094('0x1e')]=_0xf24a1e;if(_0x3b25c5['query'][_0xc094('0x3f')]){_0x2fd2a9[_0xc094('0x40')]=[{'all':!![]}];}return db[_0xc094('0x61')][_0xc094('0x41')](_0x2fd2a9);})[_0xc094('0x24')](function(_0x3efdc7){_0x3b338a['rows']=_0x3efdc7;return _0x3b338a;});}})['then'](respondWithFilteredResult(_0x37a5ff,_0x2fd2a9))[_0xc094('0x43')](handleError(_0x37a5ff,null));};exports[_0xc094('0x63')]=function(_0x16e7f3,_0x12d229,_0x5572f9){var _0x45a27e={'raw':!![],'where':{}};var _0x3f2c53={};var _0x1d7664={'count':0x0,'rows':[]};return db[_0xc094('0x2d')][_0xc094('0x5a')]({'where':{'id':_0x16e7f3['params']['id']}})[_0xc094('0x24')](handleEntityNotFound(_0x12d229,null))[_0xc094('0x24')](function(_0x13ec68){if(_0x13ec68){_0x3f2c53[_0xc094('0x35')]=_[_0xc094('0x45')](db[_0xc094('0x64')][_0xc094('0x2e')]);_0x3f2c53['query']=_['keys'](_0x16e7f3[_0xc094('0x32')]);_0x3f2c53['filters']=_['intersection'](_0x3f2c53[_0xc094('0x35')],_0x3f2c53[_0xc094('0x32')]);_0x45a27e[_0xc094('0x37')]=_[_0xc094('0x34')](_0x3f2c53[_0xc094('0x35')],qs[_0xc094('0x36')](_0x16e7f3['query'][_0xc094('0x36')]));_0x45a27e[_0xc094('0x37')]=_0x45a27e[_0xc094('0x37')][_0xc094('0x38')]?_0x45a27e['attributes']:_0x3f2c53[_0xc094('0x35')];if(!_0x16e7f3[_0xc094('0x32')][_0xc094('0x39')](_0xc094('0x3a'))){_0x45a27e['limit']=qs[_0xc094('0x1d')](_0x16e7f3[_0xc094('0x32')][_0xc094('0x1d')]);_0x45a27e[_0xc094('0x1b')]=qs[_0xc094('0x1b')](_0x16e7f3['query'][_0xc094('0x1b')]);}_0x45a27e[_0xc094('0x3b')]=qs[_0xc094('0x5c')](_0x16e7f3[_0xc094('0x32')][_0xc094('0x5c')]);_0x45a27e[_0xc094('0x3c')]=qs['filters'](_[_0xc094('0x5d')](_0x16e7f3[_0xc094('0x32')],_0x3f2c53['filters']));_0x45a27e['where'][_0xc094('0x62')]=_0x13ec68['id'];if(_0x16e7f3[_0xc094('0x32')][_0xc094('0x5e')]){_0x45a27e[_0xc094('0x3c')]=_[_0xc094('0x3d')](_0x45a27e[_0xc094('0x3c')],{'$or':_['map'](_0x45a27e[_0xc094('0x37')],function(_0x12cf77){var _0x1e2330={};_0x1e2330[_0x12cf77]={'$like':'%'+_0x16e7f3['query'][_0xc094('0x5e')]+'%'};return _0x1e2330;})});}_0x45a27e=_[_0xc094('0x3d')]({},_0x45a27e,_0x16e7f3['options']);return db[_0xc094('0x64')][_0xc094('0x1e')]({'where':_0x45a27e[_0xc094('0x3c')]})[_0xc094('0x24')](function(_0x678417){_0x1d7664['count']=_0x678417;if(_0x16e7f3['query'][_0xc094('0x3f')]){_0x45a27e[_0xc094('0x40')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x45a27e);})[_0xc094('0x24')](function(_0x4904bf){_0x1d7664[_0xc094('0x42')]=_0x4904bf;return _0x1d7664;});}})['then'](respondWithFilteredResult(_0x12d229,_0x45a27e))[_0xc094('0x43')](handleError(_0x12d229,null));};exports[_0xc094('0x65')]=function(_0x267510,_0x464f19,_0x311c0c){var _0x481250={};var _0x4e3366={};var _0x4b39fa;var _0x5bd2f4;return db[_0xc094('0x2d')][_0xc094('0x5a')]({'where':{'id':_0x267510[_0xc094('0x54')]['id']}})[_0xc094('0x24')](handleEntityNotFound(_0x464f19,null))[_0xc094('0x24')](function(_0x12517e){if(_0x12517e){_0x4b39fa=_0x12517e;_0x4e3366[_0xc094('0x35')]=_[_0xc094('0x45')](db[_0xc094('0x66')][_0xc094('0x2e')]);_0x4e3366[_0xc094('0x32')]=_[_0xc094('0x45')](_0x267510[_0xc094('0x32')]);_0x4e3366[_0xc094('0x33')]=_[_0xc094('0x34')](_0x4e3366[_0xc094('0x35')],_0x4e3366[_0xc094('0x32')]);_0x481250['attributes']=_[_0xc094('0x34')](_0x4e3366[_0xc094('0x35')],qs['fields'](_0x267510[_0xc094('0x32')][_0xc094('0x36')]));_0x481250[_0xc094('0x37')]=_0x481250[_0xc094('0x37')][_0xc094('0x38')]?_0x481250[_0xc094('0x37')]:_0x4e3366[_0xc094('0x35')];_0x481250[_0xc094('0x3b')]=qs[_0xc094('0x5c')](_0x267510[_0xc094('0x32')]['sort']);_0x481250[_0xc094('0x3c')]=qs[_0xc094('0x33')](_[_0xc094('0x5d')](_0x267510[_0xc094('0x32')],_0x4e3366[_0xc094('0x33')]));if(_0x267510['query'][_0xc094('0x5e')]){_0x481250['where']=_[_0xc094('0x3d')](_0x481250['where'],{'$or':_['map'](_0x481250['attributes'],function(_0xba61d7){var _0x1959f1={};_0x1959f1[_0xba61d7]={'$like':'%'+_0x267510['query']['filter']+'%'};return _0x1959f1;})});}_0x481250=_[_0xc094('0x3d')]({},_0x481250,_0x267510['options']);return _0x4b39fa[_0xc094('0x65')](_0x481250);}})[_0xc094('0x24')](function(_0x40a016){if(_0x40a016){_0x5bd2f4=_0x40a016[_0xc094('0x38')];if(!_0x267510[_0xc094('0x32')]['hasOwnProperty'](_0xc094('0x3a'))){_0x481250[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x267510[_0xc094('0x32')][_0xc094('0x1d')]);_0x481250['offset']=qs[_0xc094('0x1b')](_0x267510[_0xc094('0x32')][_0xc094('0x1b')]);}return _0x4b39fa['getLists'](_0x481250);}})[_0xc094('0x24')](function(_0x3071d6){if(_0x3071d6){return _0x3071d6?{'count':_0x5bd2f4,'rows':_0x3071d6}:null;}})['then'](respondWithResult(_0x464f19,null))[_0xc094('0x43')](handleError(_0x464f19,null));};exports[_0xc094('0x67')]=function(_0x4b99ec,_0x1f5279,_0x3458cd){var _0x5435bb,_0x5b84fb;var _0x25845d=[];var _0x571d4c=moment()[_0xc094('0x68')](_0xc094('0x69'));return db['Campaign'][_0xc094('0x46')]({'where':{'id':_0x4b99ec[_0xc094('0x54')]['id']}})[_0xc094('0x24')](handleEntityNotFound(_0x1f5279,null))[_0xc094('0x24')](function(_0x37369d){if(_0x37369d){_0x5b84fb=_0x37369d;return _0x37369d[_0xc094('0x67')](_0x4b99ec[_0xc094('0x48')][_0xc094('0x6a')],_['omit'](_0x4b99ec[_0xc094('0x48')],['ids','id'])||{});}return null;})['spread'](function(_0x55c5ea){var _0x5318c3;var _0x1630a5;_0x5435bb=_0x55c5ea||[];var _0x23271d=[];if(_0x55c5ea){for(var _0x2e1bb8=0x0;_0x2e1bb8<_0x55c5ea[_0xc094('0x38')];_0x2e1bb8+=0x1){var _0x53a87d=_0x55c5ea[_0x2e1bb8]['get']({'plain':!![]});_0x5b84fb[_0xc094('0x6b')]=_0x4b99ec[_0xc094('0x48')]['dialCheckDuplicateType']?_0x4b99ec['body'][_0xc094('0x6b')]:_0x5b84fb[_0xc094('0x6b')];switch(_0x5b84fb[_0xc094('0x6b')]){case'always':_0x5318c3=squel[_0xc094('0x6c')]()['into'](_0xc094('0x6d'))[_0xc094('0x6e')](['phone','scheduledAt',_0xc094('0x6f'),_0xc094('0x70'),_0xc094('0x62'),'createdAt','updatedAt'],squel['select']()[_0xc094('0x71')](_0xc094('0x72'),_0xc094('0x72'))[_0xc094('0x71')](_0xc094('0x73'),_0xc094('0x74'))[_0xc094('0x71')]('id',_0xc094('0x6f'))['field'](_0x53a87d['CmListId'][_0xc094('0x75')](),'ListId')['field'](_0x4b99ec[_0xc094('0x54')]['id']['toString'](),_0xc094('0x62'))[_0xc094('0x71')]('\x27'+_0x571d4c+'\x27',_0xc094('0x56'))[_0xc094('0x71')]('\x27'+_0x571d4c+'\x27',_0xc094('0x57'))[_0xc094('0x76')](_0xc094('0x77'))[_0xc094('0x3c')](_0xc094('0x78'))[_0xc094('0x3c')](_0xc094('0x79'),_0x53a87d[_0xc094('0x7a')][_0xc094('0x75')]())[_0xc094('0x3c')](_0xc094('0x7b'))[_0xc094('0x3c')](_0xc094('0x7c'),squel['select']()['field']('COALESCE(calleridnum,\x27\x27)')['from'](_0xc094('0x7d'))[_0xc094('0x3c')](_0xc094('0x7e'),_0x4b99ec[_0xc094('0x54')]['id'][_0xc094('0x75')]()))[_0xc094('0x3c')](_0xc094('0x7c'),squel[_0xc094('0x7f')]()[_0xc094('0x71')](_0xc094('0x80'))[_0xc094('0x76')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x4b99ec[_0xc094('0x54')]['id'][_0xc094('0x75')]())))['toString']();break;case _0xc094('0x81'):_0x5318c3=squel[_0xc094('0x6c')]()['into'](_0xc094('0x6d'))[_0xc094('0x6e')]([_0xc094('0x72'),'scheduledAt',_0xc094('0x6f'),_0xc094('0x70'),_0xc094('0x62'),_0xc094('0x56'),_0xc094('0x57')],squel[_0xc094('0x7f')]()[_0xc094('0x71')]('phone',_0xc094('0x72'))[_0xc094('0x71')](_0xc094('0x73'),_0xc094('0x74'))[_0xc094('0x71')]('id',_0xc094('0x6f'))[_0xc094('0x71')](_0x53a87d['CmListId'][_0xc094('0x75')](),_0xc094('0x70'))[_0xc094('0x71')](_0x4b99ec[_0xc094('0x54')]['id']['toString'](),'CampaignId')[_0xc094('0x71')]('\x27'+_0x571d4c+'\x27',_0xc094('0x56'))['field']('\x27'+_0x571d4c+'\x27',_0xc094('0x57'))['from'](_0xc094('0x77'))[_0xc094('0x3c')]('deletedAt\x20IS\x20NULL')[_0xc094('0x3c')]('ListId\x20=\x20?',_0x53a87d[_0xc094('0x7a')]['toString']())[_0xc094('0x3c')](_0xc094('0x7b'))[_0xc094('0x3c')](_0xc094('0x7c'),squel['select']()[_0xc094('0x71')](_0xc094('0x80'))[_0xc094('0x76')](_0xc094('0x6d'))[_0xc094('0x3c')](_0xc094('0x7e'),_0x4b99ec[_0xc094('0x54')]['id']['toString']())))[_0xc094('0x75')]();break;default:_0x5318c3=squel[_0xc094('0x6c')]()[_0xc094('0x82')](_0xc094('0x6d'))[_0xc094('0x6e')](['phone',_0xc094('0x74'),'ContactId',_0xc094('0x70'),'CampaignId','createdAt',_0xc094('0x57')],squel['select']()[_0xc094('0x71')](_0xc094('0x72'),'phone')[_0xc094('0x71')](_0xc094('0x73'),_0xc094('0x74'))[_0xc094('0x71')]('id','ContactId')[_0xc094('0x71')](_0x53a87d[_0xc094('0x7a')][_0xc094('0x75')](),_0xc094('0x70'))[_0xc094('0x71')](_0x4b99ec['params']['id'][_0xc094('0x75')](),'CampaignId')[_0xc094('0x71')]('\x27'+_0x571d4c+'\x27','createdAt')[_0xc094('0x71')]('\x27'+_0x571d4c+'\x27',_0xc094('0x57'))[_0xc094('0x76')](_0xc094('0x77'))[_0xc094('0x3c')](_0xc094('0x78'))[_0xc094('0x3c')](_0xc094('0x79'),_0x53a87d[_0xc094('0x7a')]['toString']())[_0xc094('0x3c')](_0xc094('0x7b')))['toString']();}_0x1630a5=squel['insert']()['into'](_0xc094('0x83'))[_0xc094('0x6e')]([_0xc094('0x84'),_0xc094('0x74'),_0xc094('0x72'),_0xc094('0x85'),_0xc094('0x56'),'updatedAt'],squel['select']()[_0xc094('0x71')](_0xc094('0x86'),'id')[_0xc094('0x71')](_0xc094('0x73'),_0xc094('0x74'))[_0xc094('0x71')](_0xc094('0x87'),_0xc094('0x72'))['field'](_0xc094('0x88'),'OrderBy')[_0xc094('0x71')]('\x27'+_0x571d4c+'\x27',_0xc094('0x56'))[_0xc094('0x71')]('\x27'+_0x571d4c+'\x27',_0xc094('0x57'))[_0xc094('0x76')](_0xc094('0x89'),'ci')[_0xc094('0x8a')]('cm_hopper','h',_0xc094('0x8b'))['where'](_0xc094('0x8c'),_0x53a87d[_0xc094('0x7a')]['toString']())['where'](_0xc094('0x8d'),_0x4b99ec[_0xc094('0x54')]['id']['toString']())[_0xc094('0x3c')](_0xc094('0x8e'),_0x571d4c))[_0xc094('0x75')]();_0x23271d['push'](db['sequelize'][_0xc094('0x32')](_0x5318c3));_0x25845d['push'](db['sequelize']['query'](_0x1630a5));}return BPromise['all'](_0x23271d);}})[_0xc094('0x24')](function(){return BPromise['all'](_0x25845d);})[_0xc094('0x24')](function(){return _0x5435bb;})[_0xc094('0x24')](respondWithResult(_0x1f5279,null))[_0xc094('0x43')](handleError(_0x1f5279,null));};exports[_0xc094('0x8f')]=function(_0x131b59,_0x168a34,_0x706eb0){return db['Campaign']['find']({'where':{'id':_0x131b59[_0xc094('0x54')]['id']}})[_0xc094('0x24')](handleEntityNotFound(_0x168a34,null))[_0xc094('0x24')](function(_0x713f1e){if(_0x713f1e){return _0x713f1e[_0xc094('0x8f')](_0x131b59[_0xc094('0x32')][_0xc094('0x6a')]);}})[_0xc094('0x24')](function(_0x1dfc84){if(_0x1dfc84){return db[_0xc094('0x5b')][_0xc094('0x26')]({'where':{'ListId':_0x131b59[_0xc094('0x32')][_0xc094('0x6a')],'CampaignId':_0x131b59['params']['id']}})['then'](function(){return _0x1dfc84;});}})[_0xc094('0x24')](respondWithStatusCode(_0x168a34,null))[_0xc094('0x43')](handleError(_0x168a34,null));};exports[_0xc094('0x90')]=function(_0x2425cf,_0x3b124c,_0x56f97e){var _0x4cd789={};var _0x210ea9={};var _0x2c4a3c;var _0x1da581;return db['Campaign']['findOne']({'where':{'id':_0x2425cf[_0xc094('0x54')]['id']}})[_0xc094('0x24')](handleEntityNotFound(_0x3b124c,null))[_0xc094('0x24')](function(_0x5186d8){if(_0x5186d8){_0x2c4a3c=_0x5186d8;_0x210ea9[_0xc094('0x35')]=_[_0xc094('0x45')](db['CmList']['rawAttributes']);_0x210ea9[_0xc094('0x32')]=_[_0xc094('0x45')](_0x2425cf[_0xc094('0x32')]);_0x210ea9[_0xc094('0x33')]=_[_0xc094('0x34')](_0x210ea9[_0xc094('0x35')],_0x210ea9[_0xc094('0x32')]);_0x4cd789[_0xc094('0x37')]=_['intersection'](_0x210ea9['model'],qs['fields'](_0x2425cf[_0xc094('0x32')][_0xc094('0x36')]));_0x4cd789[_0xc094('0x37')]=_0x4cd789['attributes'][_0xc094('0x38')]?_0x4cd789[_0xc094('0x37')]:_0x210ea9[_0xc094('0x35')];_0x4cd789[_0xc094('0x3b')]=qs[_0xc094('0x5c')](_0x2425cf['query'][_0xc094('0x5c')]);_0x4cd789[_0xc094('0x3c')]=qs[_0xc094('0x33')](_[_0xc094('0x5d')](_0x2425cf[_0xc094('0x32')],_0x210ea9[_0xc094('0x33')]));if(_0x2425cf[_0xc094('0x32')][_0xc094('0x5e')]){_0x4cd789[_0xc094('0x3c')]=_[_0xc094('0x3d')](_0x4cd789['where'],{'$or':_[_0xc094('0x2c')](_0x4cd789[_0xc094('0x37')],function(_0x572bf2){var _0x4d8326={};_0x4d8326[_0x572bf2]={'$like':'%'+_0x2425cf[_0xc094('0x32')][_0xc094('0x5e')]+'%'};return _0x4d8326;})});}_0x4cd789=_['merge']({},_0x4cd789,_0x2425cf[_0xc094('0x3e')]);return _0x2c4a3c[_0xc094('0x90')](_0x4cd789);}})[_0xc094('0x24')](function(_0x3b1af6){if(_0x3b1af6){_0x1da581=_0x3b1af6['length'];if(!_0x2425cf[_0xc094('0x32')]['hasOwnProperty'](_0xc094('0x3a'))){_0x4cd789[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x2425cf['query']['limit']);_0x4cd789[_0xc094('0x1b')]=qs[_0xc094('0x1b')](_0x2425cf[_0xc094('0x32')][_0xc094('0x1b')]);}return _0x2c4a3c[_0xc094('0x90')](_0x4cd789);}})[_0xc094('0x24')](function(_0x44fc96){if(_0x44fc96){return _0x44fc96?{'count':_0x1da581,'rows':_0x44fc96}:null;}})['then'](respondWithResult(_0x3b124c,null))[_0xc094('0x43')](handleError(_0x3b124c,null));};exports['addBlackLists']=function(_0x1fc9aa,_0x200e9a,_0x353689){var _0x1468d8,_0x24000e;var _0x5903f3=[];var _0x305879=moment()[_0xc094('0x68')](_0xc094('0x69'));return db[_0xc094('0x2d')][_0xc094('0x46')]({'where':{'id':_0x1fc9aa[_0xc094('0x54')]['id']}})[_0xc094('0x24')](handleEntityNotFound(_0x200e9a,null))[_0xc094('0x24')](function(_0x12fd87){if(_0x12fd87){_0x24000e=_0x12fd87;return _0x12fd87[_0xc094('0x91')](_0x1fc9aa[_0xc094('0x48')][_0xc094('0x6a')],_[_0xc094('0x55')](_0x1fc9aa[_0xc094('0x48')],[_0xc094('0x6a'),'id'])||{});}return null;})['spread'](function(_0x5049df){var _0x340254;var _0x325a68;_0x1468d8=_0x5049df||[];var _0x3e312e=[];if(_0x5049df){for(var _0x42bd38=0x0;_0x42bd38<_0x5049df['length'];_0x42bd38+=0x1){var _0x59006f=_0x5049df[_0x42bd38]['get']({'plain':!![]});_0x340254=squel['insert']()[_0xc094('0x82')](_0xc094('0x92'))[_0xc094('0x6e')]([_0xc094('0x72'),_0xc094('0x6f'),_0xc094('0x70'),_0xc094('0x62'),_0xc094('0x56'),_0xc094('0x57')],squel[_0xc094('0x7f')]()[_0xc094('0x71')](_0xc094('0x72'),'phone')[_0xc094('0x71')]('id','ContactId')['field'](_0x59006f['CmListId'][_0xc094('0x75')](),_0xc094('0x70'))[_0xc094('0x71')](_0x1fc9aa[_0xc094('0x54')]['id'][_0xc094('0x75')](),_0xc094('0x62'))[_0xc094('0x71')](_0xc094('0x73'),_0xc094('0x56'))[_0xc094('0x71')](_0xc094('0x73'),_0xc094('0x57'))[_0xc094('0x76')]('cm_contacts')[_0xc094('0x3c')](_0xc094('0x78'))['where'](_0xc094('0x79'),_0x59006f['CmListId'][_0xc094('0x75')]())[_0xc094('0x3c')](_0xc094('0x7b')))[_0xc094('0x75')]();_0x3e312e[_0xc094('0x93')](db[_0xc094('0x94')][_0xc094('0x32')](_0x340254));}return BPromise[_0xc094('0x95')](_0x3e312e);}})[_0xc094('0x24')](function(){return _0x1468d8;})['then'](respondWithResult(_0x200e9a,null))[_0xc094('0x43')](handleError(_0x200e9a,null));};exports[_0xc094('0x96')]=function(_0x3c3827,_0x43a2fb,_0x21165f){return db[_0xc094('0x2d')][_0xc094('0x46')]({'where':{'id':_0x3c3827[_0xc094('0x54')]['id']}})[_0xc094('0x24')](handleEntityNotFound(_0x43a2fb,null))[_0xc094('0x24')](function(_0x3d7fde){if(_0x3d7fde){return _0x3d7fde[_0xc094('0x96')](_0x3c3827['query'][_0xc094('0x6a')]);}})[_0xc094('0x24')](function(_0x3fa47f){if(_0x3fa47f){return db[_0xc094('0x64')][_0xc094('0x26')]({'where':{'ListId':_0x3c3827[_0xc094('0x32')]['ids'],'CampaignId':_0x3c3827['params']['id']}})[_0xc094('0x24')](function(){return _0x3fa47f;});}})[_0xc094('0x24')](respondWithStatusCode(_0x43a2fb,null))[_0xc094('0x43')](handleError(_0x43a2fb,null));};
\ No newline at end of file
+var _0x132f=['order','where','pick','filter','merge','includeAll','findAll','rows','catch','show','options','find','create','body','user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','params','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','sort','CampaignId','include','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','field','NOW()','scheduledAt','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','format','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','then','destroy','get','IvrCampaigns','error','stack','name','index','Campaign','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x132f,0x182));var _0xf132=function(_0x575b72,_0x1a7eb1){_0x575b72=_0x575b72-0x0;var _0x561c57=_0x132f[_0x575b72];return _0x561c57;};'use strict';var emlformat=require(_0xf132('0x0'));var rimraf=require(_0xf132('0x1'));var zipdir=require(_0xf132('0x2'));var jsonpatch=require(_0xf132('0x3'));var rp=require(_0xf132('0x4'));var moment=require(_0xf132('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf132('0x6'));var util=require(_0xf132('0x7'));var path=require(_0xf132('0x8'));var sox=require(_0xf132('0x9'));var csv=require(_0xf132('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf132('0xb'));var _=require(_0xf132('0xc'));var squel=require('squel');var crypto=require(_0xf132('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf132('0xe'));var toCsv=require(_0xf132('0xa'));var querystring=require(_0xf132('0xf'));var Papa=require(_0xf132('0x10'));var Redis=require(_0xf132('0x11'));var authService=require(_0xf132('0x12'));var qs=require(_0xf132('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf132('0x14'))(_0xf132('0x15'));var utils=require(_0xf132('0x16'));var config=require(_0xf132('0x17'));var licenseUtil=require(_0xf132('0x18'));var db=require(_0xf132('0x19'))['db'];function respondWithStatusCode(_0x37d148,_0x1c79e0){_0x1c79e0=_0x1c79e0||0xcc;return function(_0x3f0f56){if(_0x3f0f56){return _0x37d148[_0xf132('0x1a')](_0x1c79e0);}return _0x37d148[_0xf132('0x1b')](_0x1c79e0)[_0xf132('0x1c')]();};}function respondWithResult(_0x5b58f8,_0x79d371){_0x79d371=_0x79d371||0xc8;return function(_0x259b76){if(_0x259b76){return _0x5b58f8['status'](_0x79d371)[_0xf132('0x1d')](_0x259b76);}};}function respondWithFilteredResult(_0x4edb9c,_0x50ed67){return function(_0x206e0c){if(_0x206e0c){var _0x24c138=typeof _0x50ed67[_0xf132('0x1e')]==='undefined'&&typeof _0x50ed67['limit']===_0xf132('0x1f');var _0x2f3c15=_0x206e0c[_0xf132('0x20')];var _0x31db78=_0x24c138?0x0:_0x50ed67['offset'];var _0x1af2db=_0x24c138?_0x206e0c[_0xf132('0x20')]:_0x50ed67[_0xf132('0x1e')]+_0x50ed67[_0xf132('0x21')];var _0x4b4f5d;if(_0x1af2db>=_0x2f3c15){_0x1af2db=_0x2f3c15;_0x4b4f5d=0xc8;}else{_0x4b4f5d=0xce;}_0x4edb9c[_0xf132('0x1b')](_0x4b4f5d);return _0x4edb9c['set'](_0xf132('0x22'),_0x31db78+'-'+_0x1af2db+'/'+_0x2f3c15)[_0xf132('0x1d')](_0x206e0c);}return null;};}function patchUpdates(_0x53b78a){return function(_0x129820){try{jsonpatch['apply'](_0x129820,_0x53b78a,!![]);}catch(_0x5aae77){return BPromise['reject'](_0x5aae77);}return _0x129820['save']();};}function saveUpdates(_0xbb67a7,_0x202dca){return function(_0x2fb27d){if(_0x2fb27d){return _0x2fb27d[_0xf132('0x23')](_0xbb67a7)[_0xf132('0x24')](function(_0x3f7613){return _0x3f7613;});}return null;};}function removeEntity(_0x209c99,_0x5c9958){return function(_0x3db8a0){if(_0x3db8a0){return _0x3db8a0[_0xf132('0x25')]()[_0xf132('0x24')](function(){var _0x46d563=_0x3db8a0[_0xf132('0x26')]({'plain':!![]});var _0x271471=_0xf132('0x27');return db['UserProfileResource'][_0xf132('0x25')]({'where':{'type':_0x271471,'resourceId':_0x46d563['id']}})[_0xf132('0x24')](function(){return _0x3db8a0;});})['then'](function(){_0x209c99['status'](0xcc)[_0xf132('0x1c')]();});}};}function handleEntityNotFound(_0x1941d5,_0x3933bc){return function(_0x11aba6){if(!_0x11aba6){_0x1941d5[_0xf132('0x1a')](0x194);}return _0x11aba6;};}function handleError(_0x25eed0,_0x1a19b5){_0x1a19b5=_0x1a19b5||0x1f4;return function(_0x1c1756){logger[_0xf132('0x28')](_0x1c1756[_0xf132('0x29')]);if(_0x1c1756[_0xf132('0x2a')]){delete _0x1c1756[_0xf132('0x2a')];}_0x25eed0[_0xf132('0x1b')](_0x1a19b5)['send'](_0x1c1756);};}exports[_0xf132('0x2b')]=function(_0x519127,_0x4ff070){var _0x39639a={},_0x486e27={},_0x549bd0={'count':0x0,'rows':[]};var _0x23cd0d=_['map'](db[_0xf132('0x2c')][_0xf132('0x2d')],function(_0x2a02ca){return{'name':_0x2a02ca[_0xf132('0x2e')],'type':_0x2a02ca[_0xf132('0x2f')][_0xf132('0x30')]};});_0x486e27[_0xf132('0x31')]=_[_0xf132('0x32')](_0x23cd0d,_0xf132('0x2a'));_0x486e27[_0xf132('0x33')]=_[_0xf132('0x34')](_0x519127['query']);_0x486e27[_0xf132('0x35')]=_[_0xf132('0x36')](_0x486e27['model'],_0x486e27[_0xf132('0x33')]);_0x39639a[_0xf132('0x37')]=_['intersection'](_0x486e27['model'],qs[_0xf132('0x38')](_0x519127[_0xf132('0x33')][_0xf132('0x38')]));_0x39639a[_0xf132('0x37')]=_0x39639a[_0xf132('0x37')][_0xf132('0x39')]?_0x39639a[_0xf132('0x37')]:_0x486e27['model'];if(!_0x519127['query']['hasOwnProperty']('nolimit')){_0x39639a['limit']=qs[_0xf132('0x21')](_0x519127['query'][_0xf132('0x21')]);_0x39639a[_0xf132('0x1e')]=qs[_0xf132('0x1e')](_0x519127[_0xf132('0x33')][_0xf132('0x1e')]);}_0x39639a[_0xf132('0x3a')]=qs['sort'](_0x519127['query']['sort']);_0x39639a[_0xf132('0x3b')]=qs['filters'](_[_0xf132('0x3c')](_0x519127['query'],_0x486e27['filters']),_0x23cd0d);if(_0x519127[_0xf132('0x33')][_0xf132('0x3d')]){_0x39639a['where']=_[_0xf132('0x3e')](_0x39639a[_0xf132('0x3b')],{'$or':_[_0xf132('0x32')](_0x23cd0d,function(_0x46ad84){if(_0x46ad84['type']!=='VIRTUAL'){var _0x59f5d1={};_0x59f5d1[_0x46ad84[_0xf132('0x2a')]]={'$like':'%'+_0x519127[_0xf132('0x33')][_0xf132('0x3d')]+'%'};return _0x59f5d1;}})});}_0x39639a=_[_0xf132('0x3e')]({},_0x39639a,_0x519127['options']);var _0x4e9119={'where':_0x39639a['where']};return db[_0xf132('0x2c')][_0xf132('0x20')](_0x4e9119)[_0xf132('0x24')](function(_0x552c7e){_0x549bd0[_0xf132('0x20')]=_0x552c7e;if(_0x519127[_0xf132('0x33')][_0xf132('0x3f')]){_0x39639a['include']=[{'all':!![]}];}return db[_0xf132('0x2c')][_0xf132('0x40')](_0x39639a);})[_0xf132('0x24')](function(_0x4c597f){_0x549bd0[_0xf132('0x41')]=_0x4c597f;return _0x549bd0;})['then'](respondWithFilteredResult(_0x4ff070,_0x39639a))[_0xf132('0x42')](handleError(_0x4ff070,null));};exports[_0xf132('0x43')]=function(_0x2b7c30,_0x391aa0){var _0x41f410={'raw':![],'where':{'id':_0x2b7c30['params']['id']}},_0x522232={};_0x522232[_0xf132('0x31')]=_['keys'](db[_0xf132('0x2c')]['rawAttributes']);_0x522232[_0xf132('0x33')]=_['keys'](_0x2b7c30[_0xf132('0x33')]);_0x522232['filters']=_['intersection'](_0x522232[_0xf132('0x31')],_0x522232[_0xf132('0x33')]);_0x41f410[_0xf132('0x37')]=_[_0xf132('0x36')](_0x522232['model'],qs['fields'](_0x2b7c30[_0xf132('0x33')][_0xf132('0x38')]));_0x41f410[_0xf132('0x37')]=_0x41f410[_0xf132('0x37')][_0xf132('0x39')]?_0x41f410[_0xf132('0x37')]:_0x522232[_0xf132('0x31')];if(_0x2b7c30[_0xf132('0x33')][_0xf132('0x3f')]){_0x41f410['include']=[{'all':!![]}];}_0x41f410=_[_0xf132('0x3e')]({},_0x41f410,_0x2b7c30[_0xf132('0x44')]);return db[_0xf132('0x2c')][_0xf132('0x45')](_0x41f410)[_0xf132('0x24')](handleEntityNotFound(_0x391aa0,null))['then'](respondWithResult(_0x391aa0,null))[_0xf132('0x42')](handleError(_0x391aa0,null));};exports[_0xf132('0x46')]=function(_0x3f22e2,_0x12d024){return db['Campaign'][_0xf132('0x46')](_0x3f22e2[_0xf132('0x47')],{})[_0xf132('0x24')](function(_0xefdc64){var _0x4d40b9=_0x3f22e2[_0xf132('0x48')][_0xf132('0x26')]({'plain':!![]});if(!_0x4d40b9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d40b9[_0xf132('0x49')]===_0xf132('0x48')){var _0x425344=_0xefdc64[_0xf132('0x26')]({'plain':!![]});var _0x4e1548=_0xf132('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x4e1548,'userProfileId':_0x4d40b9[_0xf132('0x4a')]},'raw':!![]})['then'](function(_0x2bebd2){if(_0x2bebd2&&_0x2bebd2['autoAssociation']===0x0){return db[_0xf132('0x4b')][_0xf132('0x46')]({'name':_0x425344[_0xf132('0x2a')],'resourceId':_0x425344['id'],'type':_0x2bebd2[_0xf132('0x2a')],'sectionId':_0x2bebd2['id']},{})[_0xf132('0x24')](function(){return _0xefdc64;});}else{return _0xefdc64;}})[_0xf132('0x42')](function(_0x416907){logger[_0xf132('0x28')](_0xf132('0x4c'),_0x416907);throw _0x416907;});}return _0xefdc64;})[_0xf132('0x24')](respondWithResult(_0x12d024,0xc9))[_0xf132('0x42')](handleError(_0x12d024,null));};exports['clone']=function(_0x552ed6,_0x3ee21b){var _0x3ca606={'where':{'id':_0x552ed6['params']['id']}},_0x2eebae={};_0x2eebae['model']=_['keys'](db[_0xf132('0x2c')][_0xf132('0x2d')]);_0x3ca606[_0xf132('0x37')]=_['intersection'](_0x2eebae[_0xf132('0x31')],qs[_0xf132('0x38')](_0x552ed6['query'][_0xf132('0x38')]));_0x3ca606['attributes']=_0x3ca606[_0xf132('0x37')][_0xf132('0x39')]?_0x3ca606[_0xf132('0x37')]:_0x2eebae[_0xf132('0x31')];if(_0x552ed6['query'][_0xf132('0x3f')]){_0x3ca606['include']=[{'all':!![]}];}_0x3ca606=_['merge']({},_0x3ca606,_0x552ed6[_0xf132('0x44')]);return db['Campaign'][_0xf132('0x45')](_0x3ca606)[_0xf132('0x24')](handleEntityNotFound(_0x3ee21b,null))['then'](function(_0x46d2b2){if(_0x46d2b2){var _0x2f6001=_0x46d2b2[_0xf132('0x26')]({'plain':!![]});_0x2f6001=qs[_0xf132('0x4d')](_0x2f6001,['id',_0xf132('0x4e'),_0xf132('0x4f')]);_0x552ed6[_0xf132('0x47')]=_['omit'](_0x552ed6[_0xf132('0x47')],['id',_0xf132('0x4e'),'updatedAt']);return db[_0xf132('0x2c')][_0xf132('0x46')](_['merge'](_0x2f6001,_0x552ed6[_0xf132('0x47')]),{'include':_0x552ed6[_0xf132('0x33')][_0xf132('0x3f')]?[{'all':!![]}]:undefined})[_0xf132('0x24')](function(_0x1c1b99){var _0x18a5c0=_0x552ed6[_0xf132('0x48')][_0xf132('0x26')]({'plain':!![]});if(!_0x18a5c0)throw new Error(_0xf132('0x50'));if(_0x18a5c0[_0xf132('0x49')]===_0xf132('0x48')){var _0x5eafc7=_0x1c1b99[_0xf132('0x26')]({'plain':!![]});var _0x26f84c=_0xf132('0x27');return db[_0xf132('0x51')][_0xf132('0x45')]({'where':{'name':_0x26f84c,'userProfileId':_0x18a5c0[_0xf132('0x4a')]},'raw':!![]})[_0xf132('0x24')](function(_0x4b6299){if(_0x4b6299&&_0x4b6299[_0xf132('0x52')]===0x0){return db[_0xf132('0x4b')][_0xf132('0x46')]({'name':_0x5eafc7['name'],'resourceId':_0x5eafc7['id'],'type':_0x4b6299['name'],'sectionId':_0x4b6299['id']},{})[_0xf132('0x24')](function(){return _0x1c1b99;});}else{return _0x1c1b99;}})['catch'](function(_0x50e3c5){logger[_0xf132('0x28')](_0xf132('0x4c'),_0x50e3c5);throw _0x50e3c5;});}return _0x1c1b99;});}})[_0xf132('0x24')](respondWithResult(_0x3ee21b,0xc9))['catch'](handleError(_0x3ee21b,null));};exports[_0xf132('0x23')]=function(_0x3bb827,_0x1046d1){if(_0x3bb827[_0xf132('0x47')]['id']){delete _0x3bb827['body']['id'];}return db[_0xf132('0x2c')][_0xf132('0x45')]({'where':{'id':_0x3bb827[_0xf132('0x53')]['id']}})['then'](handleEntityNotFound(_0x1046d1,null))[_0xf132('0x24')](saveUpdates(_0x3bb827[_0xf132('0x47')],null))[_0xf132('0x24')](respondWithResult(_0x1046d1,null))['catch'](handleError(_0x1046d1,null));};exports[_0xf132('0x25')]=function(_0x49ead0,_0x591c73){return db['Campaign']['find']({'where':{'id':_0x49ead0[_0xf132('0x53')]['id']}})[_0xf132('0x24')](handleEntityNotFound(_0x591c73,null))[_0xf132('0x24')](removeEntity(_0x591c73,null))['catch'](handleError(_0x591c73,null));};exports[_0xf132('0x54')]=function(_0x4bf024,_0x23c3f0,_0x2e45e9){var _0x40100b={'raw':!![],'where':{}};var _0x4b063e={};var _0x2ebee4={'count':0x0,'rows':[]};return db[_0xf132('0x2c')][_0xf132('0x55')]({'where':{'id':_0x4bf024[_0xf132('0x53')]['id']}})[_0xf132('0x24')](handleEntityNotFound(_0x23c3f0,null))['then'](function(_0x28b27b){if(_0x28b27b){_0x4b063e[_0xf132('0x31')]=_[_0xf132('0x34')](db[_0xf132('0x56')]['rawAttributes']);_0x4b063e[_0xf132('0x33')]=_[_0xf132('0x34')](_0x4bf024[_0xf132('0x33')]);_0x4b063e[_0xf132('0x35')]=_[_0xf132('0x36')](_0x4b063e['model'],_0x4b063e[_0xf132('0x33')]);_0x40100b['attributes']=_['intersection'](_0x4b063e[_0xf132('0x31')],qs[_0xf132('0x38')](_0x4bf024['query']['fields']));_0x40100b['attributes']=_0x40100b[_0xf132('0x37')]['length']?_0x40100b[_0xf132('0x37')]:_0x4b063e[_0xf132('0x31')];if(!_0x4bf024[_0xf132('0x33')][_0xf132('0x57')](_0xf132('0x58'))){_0x40100b['limit']=qs[_0xf132('0x21')](_0x4bf024[_0xf132('0x33')][_0xf132('0x21')]);_0x40100b[_0xf132('0x1e')]=qs['offset'](_0x4bf024[_0xf132('0x33')]['offset']);}_0x40100b[_0xf132('0x3a')]=qs[_0xf132('0x59')](_0x4bf024['query'][_0xf132('0x59')]);_0x40100b[_0xf132('0x3b')]=qs[_0xf132('0x35')](_['pick'](_0x4bf024[_0xf132('0x33')],_0x4b063e[_0xf132('0x35')]));_0x40100b[_0xf132('0x3b')][_0xf132('0x5a')]=_0x28b27b['id'];if(_0x4bf024[_0xf132('0x33')][_0xf132('0x3d')]){_0x40100b[_0xf132('0x3b')]=_[_0xf132('0x3e')](_0x40100b[_0xf132('0x3b')],{'$or':_[_0xf132('0x32')](_0x40100b[_0xf132('0x37')],function(_0x547ab9){var _0x322710={};_0x322710[_0x547ab9]={'$like':'%'+_0x4bf024['query'][_0xf132('0x3d')]+'%'};return _0x322710;})});}_0x40100b=_[_0xf132('0x3e')]({},_0x40100b,_0x4bf024[_0xf132('0x44')]);return db['CmHopper']['count']({'where':_0x40100b['where']})[_0xf132('0x24')](function(_0xb6ca97){_0x2ebee4['count']=_0xb6ca97;if(_0x4bf024['query']['includeAll']){_0x40100b[_0xf132('0x5b')]=[{'all':!![]}];}return db['CmHopper'][_0xf132('0x40')](_0x40100b);})[_0xf132('0x24')](function(_0x2b654e){_0x2ebee4['rows']=_0x2b654e;return _0x2ebee4;});}})[_0xf132('0x24')](respondWithFilteredResult(_0x23c3f0,_0x40100b))[_0xf132('0x42')](handleError(_0x23c3f0,null));};exports['getHopperHistories']=function(_0x38db5f,_0x205f9c,_0x2b919c){var _0x1dc242={'raw':!![],'where':{}};var _0x54cf46={};var _0xe0defb={'count':0x0,'rows':[]};return db[_0xf132('0x2c')][_0xf132('0x55')]({'where':{'id':_0x38db5f[_0xf132('0x53')]['id']}})[_0xf132('0x24')](handleEntityNotFound(_0x205f9c,null))[_0xf132('0x24')](function(_0x3480f5){if(_0x3480f5){_0x54cf46[_0xf132('0x31')]=_[_0xf132('0x34')](db[_0xf132('0x5c')][_0xf132('0x2d')]);_0x54cf46['query']=_[_0xf132('0x34')](_0x38db5f[_0xf132('0x33')]);_0x54cf46[_0xf132('0x35')]=_['intersection'](_0x54cf46[_0xf132('0x31')],_0x54cf46[_0xf132('0x33')]);_0x1dc242[_0xf132('0x37')]=_[_0xf132('0x36')](_0x54cf46[_0xf132('0x31')],qs[_0xf132('0x38')](_0x38db5f['query'][_0xf132('0x38')]));_0x1dc242[_0xf132('0x37')]=_0x1dc242[_0xf132('0x37')][_0xf132('0x39')]?_0x1dc242[_0xf132('0x37')]:_0x54cf46[_0xf132('0x31')];if(!_0x38db5f[_0xf132('0x33')][_0xf132('0x57')](_0xf132('0x58'))){_0x1dc242['limit']=qs[_0xf132('0x21')](_0x38db5f['query']['limit']);_0x1dc242[_0xf132('0x1e')]=qs[_0xf132('0x1e')](_0x38db5f[_0xf132('0x33')][_0xf132('0x1e')]);}_0x1dc242[_0xf132('0x3a')]=qs[_0xf132('0x59')](_0x38db5f['query'][_0xf132('0x59')]);_0x1dc242[_0xf132('0x3b')]=qs['filters'](_['pick'](_0x38db5f['query'],_0x54cf46[_0xf132('0x35')]));_0x1dc242[_0xf132('0x3b')]['CampaignId']=_0x3480f5['id'];if(_0x38db5f[_0xf132('0x33')][_0xf132('0x3d')]){_0x1dc242[_0xf132('0x3b')]=_[_0xf132('0x3e')](_0x1dc242[_0xf132('0x3b')],{'$or':_[_0xf132('0x32')](_0x1dc242[_0xf132('0x37')],function(_0x5556d9){var _0x3acf98={};_0x3acf98[_0x5556d9]={'$like':'%'+_0x38db5f[_0xf132('0x33')]['filter']+'%'};return _0x3acf98;})});}_0x1dc242=_[_0xf132('0x3e')]({},_0x1dc242,_0x38db5f[_0xf132('0x44')]);return db[_0xf132('0x5c')]['count']({'where':_0x1dc242['where']})['then'](function(_0x515f3e){_0xe0defb[_0xf132('0x20')]=_0x515f3e;if(_0x38db5f[_0xf132('0x33')][_0xf132('0x3f')]){_0x1dc242[_0xf132('0x5b')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xf132('0x40')](_0x1dc242);})[_0xf132('0x24')](function(_0x46309e){_0xe0defb[_0xf132('0x41')]=_0x46309e;return _0xe0defb;});}})[_0xf132('0x24')](respondWithFilteredResult(_0x205f9c,_0x1dc242))['catch'](handleError(_0x205f9c,null));};exports[_0xf132('0x5d')]=function(_0xd53b83,_0x107373,_0x48758b){var _0x1636d4={'raw':!![],'where':{}};var _0x1a62e3={};var _0x3cfb49={'count':0x0,'rows':[]};return db[_0xf132('0x2c')][_0xf132('0x55')]({'where':{'id':_0xd53b83[_0xf132('0x53')]['id']}})[_0xf132('0x24')](handleEntityNotFound(_0x107373,null))[_0xf132('0x24')](function(_0x3f2d1e){if(_0x3f2d1e){_0x1a62e3[_0xf132('0x31')]=_[_0xf132('0x34')](db[_0xf132('0x5e')][_0xf132('0x2d')]);_0x1a62e3[_0xf132('0x33')]=_[_0xf132('0x34')](_0xd53b83[_0xf132('0x33')]);_0x1a62e3[_0xf132('0x35')]=_[_0xf132('0x36')](_0x1a62e3[_0xf132('0x31')],_0x1a62e3[_0xf132('0x33')]);_0x1636d4[_0xf132('0x37')]=_[_0xf132('0x36')](_0x1a62e3['model'],qs[_0xf132('0x38')](_0xd53b83[_0xf132('0x33')][_0xf132('0x38')]));_0x1636d4[_0xf132('0x37')]=_0x1636d4['attributes'][_0xf132('0x39')]?_0x1636d4[_0xf132('0x37')]:_0x1a62e3[_0xf132('0x31')];if(!_0xd53b83[_0xf132('0x33')][_0xf132('0x57')]('nolimit')){_0x1636d4[_0xf132('0x21')]=qs['limit'](_0xd53b83[_0xf132('0x33')][_0xf132('0x21')]);_0x1636d4[_0xf132('0x1e')]=qs[_0xf132('0x1e')](_0xd53b83[_0xf132('0x33')][_0xf132('0x1e')]);}_0x1636d4[_0xf132('0x3a')]=qs[_0xf132('0x59')](_0xd53b83['query'][_0xf132('0x59')]);_0x1636d4['where']=qs[_0xf132('0x35')](_[_0xf132('0x3c')](_0xd53b83[_0xf132('0x33')],_0x1a62e3[_0xf132('0x35')]));_0x1636d4['where'][_0xf132('0x5a')]=_0x3f2d1e['id'];if(_0xd53b83[_0xf132('0x33')]['filter']){_0x1636d4[_0xf132('0x3b')]=_['merge'](_0x1636d4[_0xf132('0x3b')],{'$or':_[_0xf132('0x32')](_0x1636d4[_0xf132('0x37')],function(_0x4847fd){var _0x1abefe={};_0x1abefe[_0x4847fd]={'$like':'%'+_0xd53b83[_0xf132('0x33')]['filter']+'%'};return _0x1abefe;})});}_0x1636d4=_[_0xf132('0x3e')]({},_0x1636d4,_0xd53b83[_0xf132('0x44')]);return db[_0xf132('0x5e')][_0xf132('0x20')]({'where':_0x1636d4['where']})[_0xf132('0x24')](function(_0x5a4085){_0x3cfb49[_0xf132('0x20')]=_0x5a4085;if(_0xd53b83[_0xf132('0x33')][_0xf132('0x3f')]){_0x1636d4['include']=[{'all':!![]}];}return db[_0xf132('0x5e')]['findAll'](_0x1636d4);})[_0xf132('0x24')](function(_0x32d74a){_0x3cfb49[_0xf132('0x41')]=_0x32d74a;return _0x3cfb49;});}})[_0xf132('0x24')](respondWithFilteredResult(_0x107373,_0x1636d4))[_0xf132('0x42')](handleError(_0x107373,null));};exports[_0xf132('0x5f')]=function(_0x5d3d14,_0x4b6f73,_0x438a02){var _0x108d81={'raw':!![],'where':{}};var _0x3e5a0f={};var _0x182a82={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x5d3d14[_0xf132('0x53')]['id']}})[_0xf132('0x24')](handleEntityNotFound(_0x4b6f73,null))[_0xf132('0x24')](function(_0x50dd36){if(_0x50dd36){_0x3e5a0f['model']=_[_0xf132('0x34')](db[_0xf132('0x60')][_0xf132('0x2d')]);_0x3e5a0f[_0xf132('0x33')]=_[_0xf132('0x34')](_0x5d3d14['query']);_0x3e5a0f[_0xf132('0x35')]=_[_0xf132('0x36')](_0x3e5a0f[_0xf132('0x31')],_0x3e5a0f[_0xf132('0x33')]);_0x108d81[_0xf132('0x37')]=_['intersection'](_0x3e5a0f[_0xf132('0x31')],qs['fields'](_0x5d3d14[_0xf132('0x33')]['fields']));_0x108d81['attributes']=_0x108d81[_0xf132('0x37')]['length']?_0x108d81[_0xf132('0x37')]:_0x3e5a0f[_0xf132('0x31')];if(!_0x5d3d14['query'][_0xf132('0x57')](_0xf132('0x58'))){_0x108d81[_0xf132('0x21')]=qs[_0xf132('0x21')](_0x5d3d14['query'][_0xf132('0x21')]);_0x108d81[_0xf132('0x1e')]=qs['offset'](_0x5d3d14[_0xf132('0x33')]['offset']);}_0x108d81[_0xf132('0x3a')]=qs['sort'](_0x5d3d14[_0xf132('0x33')]['sort']);_0x108d81[_0xf132('0x3b')]=qs['filters'](_[_0xf132('0x3c')](_0x5d3d14[_0xf132('0x33')],_0x3e5a0f['filters']));_0x108d81[_0xf132('0x3b')][_0xf132('0x5a')]=_0x50dd36['id'];if(_0x5d3d14[_0xf132('0x33')][_0xf132('0x3d')]){_0x108d81['where']=_[_0xf132('0x3e')](_0x108d81[_0xf132('0x3b')],{'$or':_[_0xf132('0x32')](_0x108d81['attributes'],function(_0x4e7e6a){var _0x4c9f17={};_0x4c9f17[_0x4e7e6a]={'$like':'%'+_0x5d3d14['query'][_0xf132('0x3d')]+'%'};return _0x4c9f17;})});}_0x108d81=_['merge']({},_0x108d81,_0x5d3d14[_0xf132('0x44')]);return db['CmHopperBlack']['count']({'where':_0x108d81[_0xf132('0x3b')]})[_0xf132('0x24')](function(_0x18f866){_0x182a82['count']=_0x18f866;if(_0x5d3d14[_0xf132('0x33')][_0xf132('0x3f')]){_0x108d81[_0xf132('0x5b')]=[{'all':!![]}];}return db[_0xf132('0x60')][_0xf132('0x40')](_0x108d81);})[_0xf132('0x24')](function(_0x3bbbf2){_0x182a82[_0xf132('0x41')]=_0x3bbbf2;return _0x182a82;});}})[_0xf132('0x24')](respondWithFilteredResult(_0x4b6f73,_0x108d81))['catch'](handleError(_0x4b6f73,null));};exports[_0xf132('0x61')]=function(_0xccc865,_0x9d7272,_0x589dac){var _0x2896f7={};var _0x34d6a7={};var _0xce0f50;var _0x396d77;return db[_0xf132('0x2c')]['findOne']({'where':{'id':_0xccc865[_0xf132('0x53')]['id']}})[_0xf132('0x24')](handleEntityNotFound(_0x9d7272,null))['then'](function(_0x38e57b){if(_0x38e57b){_0xce0f50=_0x38e57b;_0x34d6a7[_0xf132('0x31')]=_[_0xf132('0x34')](db[_0xf132('0x62')][_0xf132('0x2d')]);_0x34d6a7[_0xf132('0x33')]=_[_0xf132('0x34')](_0xccc865[_0xf132('0x33')]);_0x34d6a7[_0xf132('0x35')]=_[_0xf132('0x36')](_0x34d6a7[_0xf132('0x31')],_0x34d6a7['query']);_0x2896f7[_0xf132('0x37')]=_['intersection'](_0x34d6a7[_0xf132('0x31')],qs[_0xf132('0x38')](_0xccc865[_0xf132('0x33')][_0xf132('0x38')]));_0x2896f7[_0xf132('0x37')]=_0x2896f7[_0xf132('0x37')][_0xf132('0x39')]?_0x2896f7[_0xf132('0x37')]:_0x34d6a7[_0xf132('0x31')];_0x2896f7['order']=qs[_0xf132('0x59')](_0xccc865['query'][_0xf132('0x59')]);_0x2896f7[_0xf132('0x3b')]=qs[_0xf132('0x35')](_[_0xf132('0x3c')](_0xccc865[_0xf132('0x33')],_0x34d6a7[_0xf132('0x35')]));if(_0xccc865[_0xf132('0x33')][_0xf132('0x3d')]){_0x2896f7[_0xf132('0x3b')]=_[_0xf132('0x3e')](_0x2896f7[_0xf132('0x3b')],{'$or':_[_0xf132('0x32')](_0x2896f7['attributes'],function(_0x499f1d){var _0x28881a={};_0x28881a[_0x499f1d]={'$like':'%'+_0xccc865[_0xf132('0x33')][_0xf132('0x3d')]+'%'};return _0x28881a;})});}_0x2896f7=_[_0xf132('0x3e')]({},_0x2896f7,_0xccc865['options']);return _0xce0f50['getLists'](_0x2896f7);}})[_0xf132('0x24')](function(_0xfd50d7){if(_0xfd50d7){_0x396d77=_0xfd50d7['length'];if(!_0xccc865['query'][_0xf132('0x57')](_0xf132('0x58'))){_0x2896f7['limit']=qs[_0xf132('0x21')](_0xccc865[_0xf132('0x33')]['limit']);_0x2896f7[_0xf132('0x1e')]=qs[_0xf132('0x1e')](_0xccc865['query'][_0xf132('0x1e')]);}return _0xce0f50[_0xf132('0x61')](_0x2896f7);}})[_0xf132('0x24')](function(_0x4c9b37){if(_0x4c9b37){return _0x4c9b37?{'count':_0x396d77,'rows':_0x4c9b37}:null;}})['then'](respondWithResult(_0x9d7272,null))[_0xf132('0x42')](handleError(_0x9d7272,null));};exports[_0xf132('0x63')]=function(_0x55d7c3,_0x3d92f8,_0x3af005){var _0x367fa1,_0x468ca9;var _0x100d64=[];var _0x58e407=moment()['format'](_0xf132('0x64'));return db[_0xf132('0x2c')][_0xf132('0x45')]({'where':{'id':_0x55d7c3['params']['id']}})[_0xf132('0x24')](handleEntityNotFound(_0x3d92f8,null))['then'](function(_0x3a89f0){if(_0x3a89f0){_0x468ca9=_0x3a89f0;return _0x3a89f0['addLists'](_0x55d7c3[_0xf132('0x47')][_0xf132('0x65')],_[_0xf132('0x4d')](_0x55d7c3[_0xf132('0x47')],[_0xf132('0x65'),'id'])||{});}return null;})[_0xf132('0x66')](function(_0x386a73){var _0x22a6bf;var _0x13d646;_0x367fa1=_0x386a73||[];var _0x469981=[];if(_0x386a73){for(var _0x466fc3=0x0;_0x466fc3<_0x386a73[_0xf132('0x39')];_0x466fc3+=0x1){var _0x11937b=_0x386a73[_0x466fc3][_0xf132('0x26')]({'plain':!![]});_0x468ca9[_0xf132('0x67')]=_0x55d7c3['body'][_0xf132('0x67')]?_0x55d7c3[_0xf132('0x47')][_0xf132('0x67')]:_0x468ca9[_0xf132('0x67')];switch(_0x468ca9[_0xf132('0x67')]){case _0xf132('0x68'):_0x22a6bf=squel[_0xf132('0x69')]()[_0xf132('0x6a')](_0xf132('0x6b'))[_0xf132('0x6c')]([_0xf132('0x6d'),'scheduledAt',_0xf132('0x6e'),_0xf132('0x6f'),_0xf132('0x5a'),_0xf132('0x4e'),'updatedAt'],squel['select']()[_0xf132('0x70')](_0xf132('0x6d'),_0xf132('0x6d'))[_0xf132('0x70')](_0xf132('0x71'),_0xf132('0x72'))['field']('id',_0xf132('0x6e'))['field'](_0x11937b[_0xf132('0x73')]['toString'](),_0xf132('0x6f'))[_0xf132('0x70')](_0x55d7c3[_0xf132('0x53')]['id'][_0xf132('0x74')](),'CampaignId')[_0xf132('0x70')]('\x27'+_0x58e407+'\x27','createdAt')[_0xf132('0x70')]('\x27'+_0x58e407+'\x27','updatedAt')[_0xf132('0x75')]('cm_contacts')[_0xf132('0x3b')](_0xf132('0x76'))[_0xf132('0x3b')](_0xf132('0x77'),_0x11937b[_0xf132('0x73')][_0xf132('0x74')]())[_0xf132('0x3b')](_0xf132('0x78'))['where'](_0xf132('0x79'),squel[_0xf132('0x7a')]()[_0xf132('0x70')](_0xf132('0x7b'))[_0xf132('0x75')](_0xf132('0x7c'))['where'](_0xf132('0x7d'),_0x55d7c3['params']['id']['toString']()))[_0xf132('0x3b')](_0xf132('0x79'),squel[_0xf132('0x7a')]()['field'](_0xf132('0x7e'))[_0xf132('0x75')](_0xf132('0x6b'))[_0xf132('0x3b')](_0xf132('0x7d'),_0x55d7c3[_0xf132('0x53')]['id'][_0xf132('0x74')]())))[_0xf132('0x74')]();break;case _0xf132('0x7f'):_0x22a6bf=squel[_0xf132('0x69')]()[_0xf132('0x6a')](_0xf132('0x6b'))['fromQuery']([_0xf132('0x6d'),_0xf132('0x72'),'ContactId',_0xf132('0x6f'),'CampaignId','createdAt',_0xf132('0x4f')],squel[_0xf132('0x7a')]()['field']('phone',_0xf132('0x6d'))['field'](_0xf132('0x71'),_0xf132('0x72'))[_0xf132('0x70')]('id',_0xf132('0x6e'))[_0xf132('0x70')](_0x11937b['CmListId']['toString'](),'ListId')['field'](_0x55d7c3[_0xf132('0x53')]['id']['toString'](),_0xf132('0x5a'))[_0xf132('0x70')]('\x27'+_0x58e407+'\x27',_0xf132('0x4e'))['field']('\x27'+_0x58e407+'\x27',_0xf132('0x4f'))[_0xf132('0x75')]('cm_contacts')[_0xf132('0x3b')]('deletedAt\x20IS\x20NULL')['where'](_0xf132('0x77'),_0x11937b[_0xf132('0x73')][_0xf132('0x74')]())[_0xf132('0x3b')](_0xf132('0x78'))['where'](_0xf132('0x79'),squel[_0xf132('0x7a')]()['field'](_0xf132('0x7e'))[_0xf132('0x75')](_0xf132('0x6b'))['where'](_0xf132('0x7d'),_0x55d7c3[_0xf132('0x53')]['id']['toString']())))['toString']();break;default:_0x22a6bf=squel[_0xf132('0x69')]()[_0xf132('0x6a')](_0xf132('0x6b'))[_0xf132('0x6c')](['phone',_0xf132('0x72'),_0xf132('0x6e'),_0xf132('0x6f'),'CampaignId',_0xf132('0x4e'),'updatedAt'],squel[_0xf132('0x7a')]()[_0xf132('0x70')](_0xf132('0x6d'),_0xf132('0x6d'))[_0xf132('0x70')](_0xf132('0x71'),_0xf132('0x72'))[_0xf132('0x70')]('id',_0xf132('0x6e'))['field'](_0x11937b[_0xf132('0x73')][_0xf132('0x74')](),_0xf132('0x6f'))[_0xf132('0x70')](_0x55d7c3[_0xf132('0x53')]['id'][_0xf132('0x74')](),_0xf132('0x5a'))[_0xf132('0x70')]('\x27'+_0x58e407+'\x27','createdAt')[_0xf132('0x70')]('\x27'+_0x58e407+'\x27',_0xf132('0x4f'))[_0xf132('0x75')](_0xf132('0x80'))[_0xf132('0x3b')](_0xf132('0x76'))['where'](_0xf132('0x77'),_0x11937b[_0xf132('0x73')]['toString']())[_0xf132('0x3b')](_0xf132('0x78')))['toString']();}_0x13d646=squel[_0xf132('0x69')]()[_0xf132('0x6a')](_0xf132('0x81'))[_0xf132('0x6c')]([_0xf132('0x82'),_0xf132('0x72'),_0xf132('0x6d'),_0xf132('0x83'),_0xf132('0x4e'),_0xf132('0x4f')],squel['select']()[_0xf132('0x70')](_0xf132('0x84'),'id')[_0xf132('0x70')](_0xf132('0x71'),_0xf132('0x72'))[_0xf132('0x70')](_0xf132('0x85'),'phone')[_0xf132('0x70')](_0xf132('0x86'),_0xf132('0x83'))[_0xf132('0x70')]('\x27'+_0x58e407+'\x27','createdAt')[_0xf132('0x70')]('\x27'+_0x58e407+'\x27',_0xf132('0x4f'))[_0xf132('0x75')](_0xf132('0x87'),'ci')['join'](_0xf132('0x6b'),'h',_0xf132('0x88'))[_0xf132('0x3b')](_0xf132('0x89'),_0x11937b['CmListId'][_0xf132('0x74')]())[_0xf132('0x3b')](_0xf132('0x8a'),_0x55d7c3[_0xf132('0x53')]['id']['toString']())['where']('h.createdAt\x20=\x20?',_0x58e407))[_0xf132('0x74')]();_0x469981[_0xf132('0x8b')](db[_0xf132('0x8c')][_0xf132('0x33')](_0x22a6bf));_0x100d64[_0xf132('0x8b')](db[_0xf132('0x8c')]['query'](_0x13d646));}return BPromise[_0xf132('0x8d')](_0x469981);}})['then'](function(){return BPromise[_0xf132('0x8d')](_0x100d64);})[_0xf132('0x24')](function(){return _0x367fa1;})[_0xf132('0x24')](respondWithResult(_0x3d92f8,null))[_0xf132('0x42')](handleError(_0x3d92f8,null));};exports[_0xf132('0x8e')]=function(_0x26af49,_0x30891c,_0x552456){return db[_0xf132('0x2c')]['find']({'where':{'id':_0x26af49[_0xf132('0x53')]['id']}})[_0xf132('0x24')](handleEntityNotFound(_0x30891c,null))['then'](function(_0x54170e){if(_0x54170e){return _0x54170e[_0xf132('0x8e')](_0x26af49['query'][_0xf132('0x65')]);}})[_0xf132('0x24')](function(_0x3ef546){if(_0x3ef546){return db[_0xf132('0x56')][_0xf132('0x25')]({'where':{'ListId':_0x26af49['query'][_0xf132('0x65')],'CampaignId':_0x26af49[_0xf132('0x53')]['id']}})[_0xf132('0x24')](function(){return _0x3ef546;});}})[_0xf132('0x24')](respondWithStatusCode(_0x30891c,null))[_0xf132('0x42')](handleError(_0x30891c,null));};exports[_0xf132('0x8f')]=function(_0x6869e7,_0x13ec95,_0x2256b1){var _0x2524e8={};var _0x154035={};var _0x37fa16;var _0x57d7d8;return db[_0xf132('0x2c')][_0xf132('0x55')]({'where':{'id':_0x6869e7[_0xf132('0x53')]['id']}})[_0xf132('0x24')](handleEntityNotFound(_0x13ec95,null))['then'](function(_0x5e281d){if(_0x5e281d){_0x37fa16=_0x5e281d;_0x154035[_0xf132('0x31')]=_[_0xf132('0x34')](db[_0xf132('0x62')][_0xf132('0x2d')]);_0x154035[_0xf132('0x33')]=_[_0xf132('0x34')](_0x6869e7[_0xf132('0x33')]);_0x154035['filters']=_[_0xf132('0x36')](_0x154035[_0xf132('0x31')],_0x154035[_0xf132('0x33')]);_0x2524e8[_0xf132('0x37')]=_[_0xf132('0x36')](_0x154035[_0xf132('0x31')],qs[_0xf132('0x38')](_0x6869e7['query'][_0xf132('0x38')]));_0x2524e8[_0xf132('0x37')]=_0x2524e8[_0xf132('0x37')][_0xf132('0x39')]?_0x2524e8[_0xf132('0x37')]:_0x154035[_0xf132('0x31')];_0x2524e8[_0xf132('0x3a')]=qs[_0xf132('0x59')](_0x6869e7['query'][_0xf132('0x59')]);_0x2524e8[_0xf132('0x3b')]=qs['filters'](_['pick'](_0x6869e7[_0xf132('0x33')],_0x154035[_0xf132('0x35')]));if(_0x6869e7[_0xf132('0x33')][_0xf132('0x3d')]){_0x2524e8[_0xf132('0x3b')]=_[_0xf132('0x3e')](_0x2524e8[_0xf132('0x3b')],{'$or':_[_0xf132('0x32')](_0x2524e8[_0xf132('0x37')],function(_0xfa482b){var _0x2c55bc={};_0x2c55bc[_0xfa482b]={'$like':'%'+_0x6869e7[_0xf132('0x33')]['filter']+'%'};return _0x2c55bc;})});}_0x2524e8=_[_0xf132('0x3e')]({},_0x2524e8,_0x6869e7['options']);return _0x37fa16[_0xf132('0x8f')](_0x2524e8);}})[_0xf132('0x24')](function(_0x9a987a){if(_0x9a987a){_0x57d7d8=_0x9a987a[_0xf132('0x39')];if(!_0x6869e7['query'][_0xf132('0x57')](_0xf132('0x58'))){_0x2524e8['limit']=qs['limit'](_0x6869e7[_0xf132('0x33')][_0xf132('0x21')]);_0x2524e8[_0xf132('0x1e')]=qs[_0xf132('0x1e')](_0x6869e7[_0xf132('0x33')][_0xf132('0x1e')]);}return _0x37fa16[_0xf132('0x8f')](_0x2524e8);}})[_0xf132('0x24')](function(_0x253105){if(_0x253105){return _0x253105?{'count':_0x57d7d8,'rows':_0x253105}:null;}})['then'](respondWithResult(_0x13ec95,null))[_0xf132('0x42')](handleError(_0x13ec95,null));};exports['addBlackLists']=function(_0x5a5a95,_0x224337,_0x168d54){var _0x52ed20,_0xd47e29;var _0x541eff=[];var _0x19e7b7=moment()[_0xf132('0x90')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xf132('0x2c')][_0xf132('0x45')]({'where':{'id':_0x5a5a95[_0xf132('0x53')]['id']}})['then'](handleEntityNotFound(_0x224337,null))[_0xf132('0x24')](function(_0x412a54){if(_0x412a54){_0xd47e29=_0x412a54;return _0x412a54[_0xf132('0x91')](_0x5a5a95['body']['ids'],_[_0xf132('0x4d')](_0x5a5a95[_0xf132('0x47')],[_0xf132('0x65'),'id'])||{});}return null;})[_0xf132('0x66')](function(_0x58cd4e){var _0x4a9361;var _0x48a226;_0x52ed20=_0x58cd4e||[];var _0x348896=[];if(_0x58cd4e){for(var _0x324454=0x0;_0x324454<_0x58cd4e[_0xf132('0x39')];_0x324454+=0x1){var _0x1db7c8=_0x58cd4e[_0x324454]['get']({'plain':!![]});_0x4a9361=squel[_0xf132('0x69')]()[_0xf132('0x6a')](_0xf132('0x92'))[_0xf132('0x6c')](['phone',_0xf132('0x6e'),_0xf132('0x6f'),'CampaignId',_0xf132('0x4e'),_0xf132('0x4f')],squel[_0xf132('0x7a')]()['field'](_0xf132('0x6d'),'phone')[_0xf132('0x70')]('id',_0xf132('0x6e'))[_0xf132('0x70')](_0x1db7c8[_0xf132('0x73')][_0xf132('0x74')](),_0xf132('0x6f'))['field'](_0x5a5a95[_0xf132('0x53')]['id'][_0xf132('0x74')](),'CampaignId')[_0xf132('0x70')]('NOW()','createdAt')[_0xf132('0x70')](_0xf132('0x71'),_0xf132('0x4f'))[_0xf132('0x75')](_0xf132('0x80'))[_0xf132('0x3b')](_0xf132('0x76'))['where'](_0xf132('0x77'),_0x1db7c8[_0xf132('0x73')][_0xf132('0x74')]())[_0xf132('0x3b')](_0xf132('0x78')))[_0xf132('0x74')]();_0x348896['push'](db[_0xf132('0x8c')][_0xf132('0x33')](_0x4a9361));}return BPromise['all'](_0x348896);}})[_0xf132('0x24')](function(){return _0x52ed20;})[_0xf132('0x24')](respondWithResult(_0x224337,null))['catch'](handleError(_0x224337,null));};exports[_0xf132('0x93')]=function(_0x4e9343,_0x34193a,_0x2980b8){return db[_0xf132('0x2c')]['find']({'where':{'id':_0x4e9343['params']['id']}})[_0xf132('0x24')](handleEntityNotFound(_0x34193a,null))['then'](function(_0x54fca5){if(_0x54fca5){return _0x54fca5[_0xf132('0x93')](_0x4e9343[_0xf132('0x33')][_0xf132('0x65')]);}})[_0xf132('0x24')](function(_0x228c97){if(_0x228c97){return db[_0xf132('0x60')][_0xf132('0x25')]({'where':{'ListId':_0x4e9343[_0xf132('0x33')][_0xf132('0x65')],'CampaignId':_0x4e9343[_0xf132('0x53')]['id']}})['then'](function(){return _0x228c97;});}})['then'](respondWithStatusCode(_0x34193a,null))[_0xf132('0x42')](handleError(_0x34193a,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 193c5d2..6f550fa 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(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 ee8253b..f2221bc 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 _0x3cfb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','map','model','lodash','util'];(function(_0x2d3ab3,_0x47d90b){var _0x321f9e=function(_0x50a53d){while(--_0x50a53d){_0x2d3ab3['push'](_0x2d3ab3['shift']());}};_0x321f9e(++_0x47d90b);}(_0x3cfb,0x1b8));var _0xb3cf=function(_0x1edd49,_0x23999e){_0x1edd49=_0x1edd49-0x0;var _0x576608=_0x3cfb[_0x1edd49];return _0x576608;};'use strict';var _=require(_0xb3cf('0x0'));var util=require(_0xb3cf('0x1'));var moment=require(_0xb3cf('0x2'));var BPromise=require(_0xb3cf('0x3'));var rs=require(_0xb3cf('0x4'));var fs=require('fs');var Redis=require(_0xb3cf('0x5'));var db=require(_0xb3cf('0x6'))['db'];var utils=require(_0xb3cf('0x7'));var logger=require('../../config/logger')(_0xb3cf('0x8'));var config=require(_0xb3cf('0x9'));var jayson=require(_0xb3cf('0xa'));var client=jayson['client'][_0xb3cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b7131,_0x42ce15,_0x53be8c){return new BPromise(function(_0x19ed7d,_0x4e4cc8){return client['request'](_0x1b7131,_0x53be8c)[_0xb3cf('0xc')](function(_0x44a55d){logger[_0xb3cf('0xd')](_0xb3cf('0xe'),_0x42ce15,_0xb3cf('0xf'));logger[_0xb3cf('0x10')](_0xb3cf('0x11'),_0x42ce15,_0xb3cf('0xf'),JSON[_0xb3cf('0x12')](_0x44a55d));if(_0x44a55d[_0xb3cf('0x13')]){if(_0x44a55d[_0xb3cf('0x13')][_0xb3cf('0x14')]===0x1f4){logger[_0xb3cf('0x13')](_0xb3cf('0xe'),_0x42ce15,_0x44a55d[_0xb3cf('0x13')]['message']);return _0x4e4cc8(_0x44a55d['error'][_0xb3cf('0x15')]);}logger[_0xb3cf('0x13')]('Campaign,\x20%s,\x20%s',_0x42ce15,_0x44a55d[_0xb3cf('0x13')]['message']);return _0x19ed7d(_0x44a55d['error'][_0xb3cf('0x15')]);}else{logger[_0xb3cf('0xd')](_0xb3cf('0xe'),_0x42ce15,'request\x20sent');_0x19ed7d(_0x44a55d[_0xb3cf('0x16')][_0xb3cf('0x15')]);}})[_0xb3cf('0x17')](function(_0x442fd6){logger[_0xb3cf('0x13')](_0xb3cf('0xe'),_0x42ce15,_0x442fd6);_0x4e4cc8(_0x442fd6);});});}exports[_0xb3cf('0x18')]=function(_0x2d0018){var _0x1526c9=this;return new Promise(function(_0x222c1d,_0x4b0a82){return db[_0xb3cf('0x19')][_0xb3cf('0x1a')]({'raw':_0x2d0018[_0xb3cf('0x1b')]?_0x2d0018[_0xb3cf('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2d0018[_0xb3cf('0x1b')]?_0x2d0018[_0xb3cf('0x1b')][_0xb3cf('0x1c')]||null:null,'attributes':_0x2d0018[_0xb3cf('0x1b')]?_0x2d0018[_0xb3cf('0x1b')][_0xb3cf('0x1d')]||null:null,'limit':_0x2d0018[_0xb3cf('0x1b')]?_0x2d0018[_0xb3cf('0x1b')][_0xb3cf('0x1e')]||null:null,'include':_0x2d0018[_0xb3cf('0x1b')]?_0x2d0018['options'][_0xb3cf('0x1f')]?_[_0xb3cf('0x20')](_0x2d0018[_0xb3cf('0x1b')][_0xb3cf('0x1f')],function(_0x1fb3ea){return{'model':db[_0x1fb3ea[_0xb3cf('0x21')]],'as':_0x1fb3ea['as'],'attributes':_0x1fb3ea[_0xb3cf('0x1d')],'include':_0x1fb3ea[_0xb3cf('0x1f')]?_[_0xb3cf('0x20')](_0x1fb3ea[_0xb3cf('0x1f')],function(_0x5d939e){return{'model':db[_0x5d939e[_0xb3cf('0x21')]],'as':_0x5d939e['as'],'attributes':_0x5d939e[_0xb3cf('0x1d')],'include':_0x5d939e[_0xb3cf('0x1f')]?_['map'](_0x5d939e['include'],function(_0x15cf4d){return{'model':db[_0x15cf4d[_0xb3cf('0x21')]],'as':_0x15cf4d['as'],'attributes':_0x15cf4d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xfc0f5b){logger[_0xb3cf('0xd')]('GetCampaign',_0x2d0018);logger[_0xb3cf('0x10')](_0xb3cf('0x18'),_0x2d0018,JSON[_0xb3cf('0x12')](_0xfc0f5b));_0x222c1d(_0xfc0f5b);})[_0xb3cf('0x17')](function(_0x1b1460){logger[_0xb3cf('0x13')](_0xb3cf('0x18'),_0x1b1460[_0xb3cf('0x15')],_0x2d0018);_0x4b0a82(_0x1526c9[_0xb3cf('0x13')](0x1f4,_0x1b1460[_0xb3cf('0x15')]));});});};
\ No newline at end of file
+var _0x3a32=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','options','raw','where','attributes','include','map','model','then','stringify'];(function(_0x1d47ef,_0x113e36){var _0x1bdc06=function(_0x4588ae){while(--_0x4588ae){_0x1d47ef['push'](_0x1d47ef['shift']());}};_0x1bdc06(++_0x113e36);}(_0x3a32,0x9b));var _0x23a3=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x3a32[_0x31cb5f];return _0x586042;};'use strict';var _=require(_0x23a3('0x0'));var util=require(_0x23a3('0x1'));var moment=require(_0x23a3('0x2'));var BPromise=require(_0x23a3('0x3'));var rs=require(_0x23a3('0x4'));var fs=require('fs');var Redis=require(_0x23a3('0x5'));var db=require(_0x23a3('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x23a3('0x7'));var config=require(_0x23a3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x23a3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x103499,_0x256bcf,_0xd4e907){return new BPromise(function(_0x2562bc,_0x11d423){return client[_0x23a3('0xa')](_0x103499,_0xd4e907)['then'](function(_0x233b17){logger[_0x23a3('0xb')]('Campaign,\x20%s,\x20%s',_0x256bcf,'request\x20sent');logger[_0x23a3('0xc')](_0x23a3('0xd'),_0x256bcf,_0x23a3('0xe'),JSON['stringify'](_0x233b17));if(_0x233b17[_0x23a3('0xf')]){if(_0x233b17['error'][_0x23a3('0x10')]===0x1f4){logger[_0x23a3('0xf')](_0x23a3('0x11'),_0x256bcf,_0x233b17['error'][_0x23a3('0x12')]);return _0x11d423(_0x233b17[_0x23a3('0xf')][_0x23a3('0x12')]);}logger[_0x23a3('0xf')](_0x23a3('0x11'),_0x256bcf,_0x233b17['error'][_0x23a3('0x12')]);return _0x2562bc(_0x233b17[_0x23a3('0xf')]['message']);}else{logger[_0x23a3('0xb')](_0x23a3('0x11'),_0x256bcf,'request\x20sent');_0x2562bc(_0x233b17[_0x23a3('0x13')][_0x23a3('0x12')]);}})[_0x23a3('0x14')](function(_0x3e3cc1){logger[_0x23a3('0xf')](_0x23a3('0x11'),_0x256bcf,_0x3e3cc1);_0x11d423(_0x3e3cc1);});});}exports[_0x23a3('0x15')]=function(_0xc33cbd){var _0x53f4e8=this;return new Promise(function(_0x3961e9,_0x2303d2){return db['Campaign']['findAll']({'raw':_0xc33cbd[_0x23a3('0x16')]?_0xc33cbd[_0x23a3('0x16')][_0x23a3('0x17')]===undefined?!![]:![]:!![],'where':_0xc33cbd[_0x23a3('0x16')]?_0xc33cbd[_0x23a3('0x16')][_0x23a3('0x18')]||null:null,'attributes':_0xc33cbd[_0x23a3('0x16')]?_0xc33cbd[_0x23a3('0x16')][_0x23a3('0x19')]||null:null,'limit':_0xc33cbd[_0x23a3('0x16')]?_0xc33cbd[_0x23a3('0x16')]['limit']||null:null,'include':_0xc33cbd[_0x23a3('0x16')]?_0xc33cbd[_0x23a3('0x16')][_0x23a3('0x1a')]?_[_0x23a3('0x1b')](_0xc33cbd[_0x23a3('0x16')][_0x23a3('0x1a')],function(_0x509aa3){return{'model':db[_0x509aa3[_0x23a3('0x1c')]],'as':_0x509aa3['as'],'attributes':_0x509aa3['attributes'],'include':_0x509aa3[_0x23a3('0x1a')]?_['map'](_0x509aa3[_0x23a3('0x1a')],function(_0x525b5f){return{'model':db[_0x525b5f[_0x23a3('0x1c')]],'as':_0x525b5f['as'],'attributes':_0x525b5f['attributes'],'include':_0x525b5f[_0x23a3('0x1a')]?_[_0x23a3('0x1b')](_0x525b5f['include'],function(_0x333998){return{'model':db[_0x333998[_0x23a3('0x1c')]],'as':_0x333998['as'],'attributes':_0x333998[_0x23a3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x23a3('0x1d')](function(_0x2ace31){logger['info'](_0x23a3('0x15'),_0xc33cbd);logger[_0x23a3('0xc')](_0x23a3('0x15'),_0xc33cbd,JSON[_0x23a3('0x1e')](_0x2ace31));_0x3961e9(_0x2ace31);})[_0x23a3('0x14')](function(_0x35519f){logger[_0x23a3('0xf')](_0x23a3('0x15'),_0x35519f['message'],_0xc33cbd);_0x2303d2(_0x53f4e8[_0x23a3('0xf')](0x1f4,_0x35519f[_0x23a3('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 4430d1a..c56897c 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 _0xae13=['/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals'];(function(_0x2e2cd7,_0x9a3d16){var _0x397801=function(_0x1e15e0){while(--_0x1e15e0){_0x2e2cd7['push'](_0x2e2cd7['shift']());}};_0x397801(++_0x9a3d16);}(_0xae13,0x154));var _0x3ae1=function(_0x1bd51d,_0x46f25e){_0x1bd51d=_0x1bd51d-0x0;var _0x116b83=_0xae13[_0x1bd51d];return _0x116b83;};'use strict';var multer=require(_0x3ae1('0x0'));var util=require(_0x3ae1('0x1'));var path=require(_0x3ae1('0x2'));var timeout=require(_0x3ae1('0x3'));var express=require(_0x3ae1('0x4'));var router=express[_0x3ae1('0x5')]();var fs_extra=require(_0x3ae1('0x6'));var auth=require(_0x3ae1('0x7'));var interaction=require(_0x3ae1('0x8'));var config=require(_0x3ae1('0x9'));var controller=require(_0x3ae1('0xa'));router[_0x3ae1('0xb')]('/',auth[_0x3ae1('0xc')](),controller[_0x3ae1('0xd')]);router['get']('/:id',auth[_0x3ae1('0xc')](),controller[_0x3ae1('0xe')]);router[_0x3ae1('0xb')](_0x3ae1('0xf'),auth[_0x3ae1('0xc')](),controller[_0x3ae1('0x10')]);router[_0x3ae1('0xb')](_0x3ae1('0x11'),auth[_0x3ae1('0xc')](),controller[_0x3ae1('0x12')]);router[_0x3ae1('0xb')]('/:id/hopper_finals',auth[_0x3ae1('0xc')](),controller[_0x3ae1('0x13')]);router[_0x3ae1('0xb')](_0x3ae1('0x14'),auth[_0x3ae1('0xc')](),controller[_0x3ae1('0x15')]);router['get'](_0x3ae1('0x16'),auth[_0x3ae1('0xc')](),controller[_0x3ae1('0x17')]);router['get']('/:id/blacklists',auth[_0x3ae1('0xc')](),controller['getBlackLists']);router[_0x3ae1('0x18')]('/',auth[_0x3ae1('0xc')](),controller[_0x3ae1('0x19')]);router[_0x3ae1('0x18')](_0x3ae1('0x1a'),auth[_0x3ae1('0xc')](),controller[_0x3ae1('0x1b')]);router['post'](_0x3ae1('0x16'),auth['isAuthenticated'](),controller[_0x3ae1('0x1c')]);router[_0x3ae1('0x18')](_0x3ae1('0x1d'),auth[_0x3ae1('0xc')](),controller[_0x3ae1('0x1e')]);router['put'](_0x3ae1('0x1f'),auth[_0x3ae1('0xc')](),controller[_0x3ae1('0x20')]);router[_0x3ae1('0x21')](_0x3ae1('0x1f'),auth[_0x3ae1('0xc')](),controller[_0x3ae1('0x22')]);router[_0x3ae1('0x21')](_0x3ae1('0x16'),auth['isAuthenticated'](),controller['removeLists']);router[_0x3ae1('0x21')](_0x3ae1('0x1d'),auth[_0x3ae1('0xc')](),controller['removeBlackLists']);module[_0x3ae1('0x23')]=router;
\ No newline at end of file
+var _0xacb8=['removeLists','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','delete','/:id','destroy'];(function(_0x593f03,_0x4af84a){var _0x178299=function(_0x284500){while(--_0x284500){_0x593f03['push'](_0x593f03['shift']());}};_0x178299(++_0x4af84a);}(_0xacb8,0x119));var _0x8acb=function(_0x1855de,_0x15a076){_0x1855de=_0x1855de-0x0;var _0x16b75a=_0xacb8[_0x1855de];return _0x16b75a;};'use strict';var multer=require(_0x8acb('0x0'));var util=require('util');var path=require(_0x8acb('0x1'));var timeout=require(_0x8acb('0x2'));var express=require(_0x8acb('0x3'));var router=express['Router']();var fs_extra=require(_0x8acb('0x4'));var auth=require(_0x8acb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8acb('0x6'));var controller=require(_0x8acb('0x7'));router[_0x8acb('0x8')]('/',auth[_0x8acb('0x9')](),controller[_0x8acb('0xa')]);router[_0x8acb('0x8')]('/:id',auth[_0x8acb('0x9')](),controller[_0x8acb('0xb')]);router[_0x8acb('0x8')](_0x8acb('0xc'),auth[_0x8acb('0x9')](),controller[_0x8acb('0xd')]);router['get']('/:id/hopper_histories',auth[_0x8acb('0x9')](),controller[_0x8acb('0xe')]);router[_0x8acb('0x8')](_0x8acb('0xf'),auth['isAuthenticated'](),controller[_0x8acb('0x10')]);router[_0x8acb('0x8')]('/:id/hopper_black',auth[_0x8acb('0x9')](),controller[_0x8acb('0x11')]);router[_0x8acb('0x8')](_0x8acb('0x12'),auth[_0x8acb('0x9')](),controller['getLists']);router[_0x8acb('0x8')](_0x8acb('0x13'),auth[_0x8acb('0x9')](),controller[_0x8acb('0x14')]);router[_0x8acb('0x15')]('/',auth[_0x8acb('0x9')](),controller['create']);router[_0x8acb('0x15')](_0x8acb('0x16'),auth[_0x8acb('0x9')](),controller[_0x8acb('0x17')]);router[_0x8acb('0x15')](_0x8acb('0x12'),auth[_0x8acb('0x9')](),controller[_0x8acb('0x18')]);router[_0x8acb('0x15')]('/:id/blacklists',auth[_0x8acb('0x9')](),controller[_0x8acb('0x19')]);router['put']('/:id',auth[_0x8acb('0x9')](),controller['update']);router[_0x8acb('0x1a')](_0x8acb('0x1b'),auth['isAuthenticated'](),controller[_0x8acb('0x1c')]);router[_0x8acb('0x1a')](_0x8acb('0x12'),auth[_0x8acb('0x9')](),controller[_0x8acb('0x1d')]);router[_0x8acb('0x1a')](_0x8acb('0x13'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x8acb('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index ba82e9c..86e24d7 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 _0x8a9d=['exports','TEXT','STRING','VIRTUAL','getDataValue','key','sequelize'];(function(_0x487177,_0x1ddcd6){var _0x147202=function(_0xa5105){while(--_0xa5105){_0x487177['push'](_0x487177['shift']());}};_0x147202(++_0x1ddcd6);}(_0x8a9d,0x6f));var _0xd8a9=function(_0x21ed1f,_0xabbc54){_0x21ed1f=_0x21ed1f-0x0;var _0x2d8da9=_0x8a9d[_0x21ed1f];return _0x2d8da9;};'use strict';var Sequelize=require(_0xd8a9('0x0'));module[_0xd8a9('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xd8a9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd8a9('0x3')]},'name':{'type':Sequelize[_0xd8a9('0x4')],'get':function(){return this[_0xd8a9('0x5')](_0xd8a9('0x6'));}}};
\ No newline at end of file
+var _0x09d6=['STRING','TEXT','VIRTUAL','key','exports'];(function(_0x299db6,_0x2d8407){var _0x2b3510=function(_0x1be7e6){while(--_0x1be7e6){_0x299db6['push'](_0x299db6['shift']());}};_0x2b3510(++_0x2d8407);}(_0x09d6,0xe0));var _0x609d=function(_0x1bcbe3,_0x181f09){_0x1bcbe3=_0x1bcbe3-0x0;var _0x2f1853=_0x09d6[_0x1bcbe3];return _0x2f1853;};'use strict';var Sequelize=require('sequelize');module[_0x609d('0x0')]={'key':{'type':Sequelize[_0x609d('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x609d('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x609d('0x3')],'get':function(){return this['getDataValue'](_0x609d('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 3eb2dec..d923c7e 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 _0x7cad=['include','findAll','rows','catch','show','params','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','update','destroy','get','CannedAnswers','UserProfileResource','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','CannedAnswer','includeAll'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x7cad,0xd4));var _0xd7ca=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7cad[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd7ca('0x0'));var zipdir=require(_0xd7ca('0x1'));var jsonpatch=require(_0xd7ca('0x2'));var rp=require(_0xd7ca('0x3'));var moment=require(_0xd7ca('0x4'));var BPromise=require(_0xd7ca('0x5'));var Mustache=require(_0xd7ca('0x6'));var util=require(_0xd7ca('0x7'));var path=require(_0xd7ca('0x8'));var sox=require(_0xd7ca('0x9'));var csv=require('to-csv');var ejs=require(_0xd7ca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7ca('0xb'));var squel=require(_0xd7ca('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd7ca('0xd'));var toCsv=require(_0xd7ca('0xe'));var querystring=require(_0xd7ca('0xf'));var Papa=require(_0xd7ca('0x10'));var Redis=require(_0xd7ca('0x11'));var authService=require(_0xd7ca('0x12'));var qs=require(_0xd7ca('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd7ca('0x14'));var logger=require(_0xd7ca('0x15'))(_0xd7ca('0x16'));var utils=require(_0xd7ca('0x17'));var config=require(_0xd7ca('0x18'));var licenseUtil=require(_0xd7ca('0x19'));var db=require(_0xd7ca('0x1a'))['db'];function respondWithStatusCode(_0x15920d,_0x3b4d6a){_0x3b4d6a=_0x3b4d6a||0xcc;return function(_0x448761){if(_0x448761){return _0x15920d[_0xd7ca('0x1b')](_0x3b4d6a);}return _0x15920d[_0xd7ca('0x1c')](_0x3b4d6a)[_0xd7ca('0x1d')]();};}function respondWithResult(_0x359d6b,_0x226b85){_0x226b85=_0x226b85||0xc8;return function(_0x71ad50){if(_0x71ad50){return _0x359d6b['status'](_0x226b85)[_0xd7ca('0x1e')](_0x71ad50);}};}function respondWithFilteredResult(_0x48420f,_0x47ca99){return function(_0x277f0b){if(_0x277f0b){var _0x34709e=typeof _0x47ca99['offset']===_0xd7ca('0x1f')&&typeof _0x47ca99[_0xd7ca('0x20')]==='undefined';var _0x3977eb=_0x277f0b[_0xd7ca('0x21')];var _0x368fd8=_0x34709e?0x0:_0x47ca99[_0xd7ca('0x22')];var _0x4043c6=_0x34709e?_0x277f0b[_0xd7ca('0x21')]:_0x47ca99[_0xd7ca('0x22')]+_0x47ca99[_0xd7ca('0x20')];var _0x472935;if(_0x4043c6>=_0x3977eb){_0x4043c6=_0x3977eb;_0x472935=0xc8;}else{_0x472935=0xce;}_0x48420f[_0xd7ca('0x1c')](_0x472935);return _0x48420f['set'](_0xd7ca('0x23'),_0x368fd8+'-'+_0x4043c6+'/'+_0x3977eb)[_0xd7ca('0x1e')](_0x277f0b);}return null;};}function patchUpdates(_0x4f38ff){return function(_0x4dfb5c){try{jsonpatch[_0xd7ca('0x24')](_0x4dfb5c,_0x4f38ff,!![]);}catch(_0x3f8928){return BPromise['reject'](_0x3f8928);}return _0x4dfb5c['save']();};}function saveUpdates(_0x267f75,_0x4ab334){return function(_0x1e29ec){if(_0x1e29ec){return _0x1e29ec[_0xd7ca('0x25')](_0x267f75)['then'](function(_0x29efc0){return _0x29efc0;});}return null;};}function removeEntity(_0x49671b,_0xc6ec5){return function(_0x1042f6){if(_0x1042f6){return _0x1042f6[_0xd7ca('0x26')]()['then'](function(){var _0x109843=_0x1042f6[_0xd7ca('0x27')]({'plain':!![]});var _0x4d4802=_0xd7ca('0x28');return db[_0xd7ca('0x29')]['destroy']({'where':{'type':_0x4d4802,'resourceId':_0x109843['id']}})[_0xd7ca('0x2a')](function(){return _0x1042f6;});})[_0xd7ca('0x2a')](function(){_0x49671b[_0xd7ca('0x1c')](0xcc)[_0xd7ca('0x1d')]();});}};}function handleEntityNotFound(_0x4898a8,_0x30314f){return function(_0x3832f6){if(!_0x3832f6){_0x4898a8[_0xd7ca('0x1b')](0x194);}return _0x3832f6;};}function handleError(_0x26f2ff,_0x23ebe4){_0x23ebe4=_0x23ebe4||0x1f4;return function(_0x2f3441){logger[_0xd7ca('0x2b')](_0x2f3441[_0xd7ca('0x2c')]);if(_0x2f3441[_0xd7ca('0x2d')]){delete _0x2f3441[_0xd7ca('0x2d')];}_0x26f2ff[_0xd7ca('0x1c')](_0x23ebe4)[_0xd7ca('0x2e')](_0x2f3441);};}exports[_0xd7ca('0x2f')]=function(_0x2dc049,_0x2cb225){var _0x4256ef={},_0x54dd4a={},_0x520d3f={'count':0x0,'rows':[]};var _0x4d4480=_[_0xd7ca('0x30')](db['CannedAnswer'][_0xd7ca('0x31')],function(_0x56b961){return{'name':_0x56b961[_0xd7ca('0x32')],'type':_0x56b961[_0xd7ca('0x33')]['key']};});_0x54dd4a[_0xd7ca('0x34')]=_['map'](_0x4d4480,_0xd7ca('0x2d'));_0x54dd4a[_0xd7ca('0x35')]=_[_0xd7ca('0x36')](_0x2dc049[_0xd7ca('0x35')]);_0x54dd4a[_0xd7ca('0x37')]=_[_0xd7ca('0x38')](_0x54dd4a[_0xd7ca('0x34')],_0x54dd4a['query']);_0x4256ef[_0xd7ca('0x39')]=_[_0xd7ca('0x38')](_0x54dd4a[_0xd7ca('0x34')],qs[_0xd7ca('0x3a')](_0x2dc049[_0xd7ca('0x35')][_0xd7ca('0x3a')]));_0x4256ef[_0xd7ca('0x39')]=_0x4256ef[_0xd7ca('0x39')][_0xd7ca('0x3b')]?_0x4256ef[_0xd7ca('0x39')]:_0x54dd4a[_0xd7ca('0x34')];if(!_0x2dc049[_0xd7ca('0x35')][_0xd7ca('0x3c')](_0xd7ca('0x3d'))){_0x4256ef[_0xd7ca('0x20')]=qs[_0xd7ca('0x20')](_0x2dc049[_0xd7ca('0x35')][_0xd7ca('0x20')]);_0x4256ef['offset']=qs[_0xd7ca('0x22')](_0x2dc049[_0xd7ca('0x35')][_0xd7ca('0x22')]);}_0x4256ef[_0xd7ca('0x3e')]=qs[_0xd7ca('0x3f')](_0x2dc049['query'][_0xd7ca('0x3f')]);_0x4256ef[_0xd7ca('0x40')]=qs[_0xd7ca('0x37')](_['pick'](_0x2dc049['query'],_0x54dd4a[_0xd7ca('0x37')]),_0x4d4480);if(_0x2dc049['query']['filter']){_0x4256ef[_0xd7ca('0x40')]=_[_0xd7ca('0x41')](_0x4256ef['where'],{'$or':[{'key':{'$like':'%'+_0x2dc049[_0xd7ca('0x35')][_0xd7ca('0x42')]+'%'}},{'value':{'$like':'%'+_0x2dc049['query'][_0xd7ca('0x42')]+'%'}}]});}_0x4256ef=_['merge']({},_0x4256ef,_0x2dc049[_0xd7ca('0x43')]);var _0x1a0a00={'where':_0x4256ef[_0xd7ca('0x40')]};return db[_0xd7ca('0x44')][_0xd7ca('0x21')](_0x1a0a00)[_0xd7ca('0x2a')](function(_0x1db052){_0x520d3f[_0xd7ca('0x21')]=_0x1db052;if(_0x2dc049[_0xd7ca('0x35')][_0xd7ca('0x45')]){_0x4256ef[_0xd7ca('0x46')]=[{'all':!![]}];}return db[_0xd7ca('0x44')][_0xd7ca('0x47')](_0x4256ef);})[_0xd7ca('0x2a')](function(_0x2e5eda){_0x520d3f[_0xd7ca('0x48')]=_0x2e5eda;return _0x520d3f;})[_0xd7ca('0x2a')](respondWithFilteredResult(_0x2cb225,_0x4256ef))[_0xd7ca('0x49')](handleError(_0x2cb225,null));};exports[_0xd7ca('0x4a')]=function(_0x52f189,_0x19fab2){var _0x1d666c={'raw':!![],'where':{'id':_0x52f189[_0xd7ca('0x4b')]['id']}},_0x59c9c9={};_0x59c9c9[_0xd7ca('0x34')]=_[_0xd7ca('0x36')](db[_0xd7ca('0x44')]['rawAttributes']);_0x59c9c9[_0xd7ca('0x35')]=_[_0xd7ca('0x36')](_0x52f189[_0xd7ca('0x35')]);_0x59c9c9[_0xd7ca('0x37')]=_[_0xd7ca('0x38')](_0x59c9c9[_0xd7ca('0x34')],_0x59c9c9[_0xd7ca('0x35')]);_0x1d666c['attributes']=_[_0xd7ca('0x38')](_0x59c9c9[_0xd7ca('0x34')],qs[_0xd7ca('0x3a')](_0x52f189[_0xd7ca('0x35')]['fields']));_0x1d666c[_0xd7ca('0x39')]=_0x1d666c[_0xd7ca('0x39')][_0xd7ca('0x3b')]?_0x1d666c[_0xd7ca('0x39')]:_0x59c9c9[_0xd7ca('0x34')];if(_0x52f189[_0xd7ca('0x35')][_0xd7ca('0x45')]){_0x1d666c[_0xd7ca('0x46')]=[{'all':!![]}];}_0x1d666c=_['merge']({},_0x1d666c,_0x52f189[_0xd7ca('0x43')]);return db['CannedAnswer'][_0xd7ca('0x4c')](_0x1d666c)[_0xd7ca('0x2a')](handleEntityNotFound(_0x19fab2,null))['then'](respondWithResult(_0x19fab2,null))[_0xd7ca('0x49')](handleError(_0x19fab2,null));};exports[_0xd7ca('0x25')]=function(_0x41ed7c,_0x2511cf){if(_0x41ed7c['body']['id']){delete _0x41ed7c[_0xd7ca('0x4d')]['id'];}return db[_0xd7ca('0x44')][_0xd7ca('0x4c')]({'where':{'id':_0x41ed7c['params']['id']}})['then'](handleEntityNotFound(_0x2511cf,null))[_0xd7ca('0x2a')](saveUpdates(_0x41ed7c[_0xd7ca('0x4d')],null))[_0xd7ca('0x2a')](respondWithResult(_0x2511cf,null))[_0xd7ca('0x49')](handleError(_0x2511cf,null));};exports[_0xd7ca('0x26')]=function(_0x41a450,_0x3aa419){return db['CannedAnswer'][_0xd7ca('0x4c')]({'where':{'id':_0x41a450[_0xd7ca('0x4b')]['id']}})[_0xd7ca('0x2a')](handleEntityNotFound(_0x3aa419,null))['then'](removeEntity(_0x3aa419,null))[_0xd7ca('0x49')](handleError(_0x3aa419,null));};exports[_0xd7ca('0x4e')]=function(_0x361647,_0x3a1442){var _0x21ca56={'key':_0x361647[_0xd7ca('0x4d')][_0xd7ca('0x4f')]};if(_0x361647[_0xd7ca('0x4d')][_0xd7ca('0x50')]){_0x21ca56[_0xd7ca('0x50')]=_0x361647[_0xd7ca('0x4d')][_0xd7ca('0x50')];}else if(_0x361647[_0xd7ca('0x4d')][_0xd7ca('0x51')]){_0x21ca56[_0xd7ca('0x51')]=_0x361647[_0xd7ca('0x4d')]['SmsAccountId'];}else if(_0x361647[_0xd7ca('0x4d')][_0xd7ca('0x52')]){_0x21ca56['OpenchannelAccountId']=_0x361647['body'][_0xd7ca('0x52')];}else if(_0x361647['body'][_0xd7ca('0x53')]){_0x21ca56['ChatWebsiteId']=_0x361647[_0xd7ca('0x4d')][_0xd7ca('0x53')];}return db['CannedAnswer'][_0xd7ca('0x4c')]({'where':_0x21ca56})[_0xd7ca('0x2a')](function(_0x1466ea){if(_0x1466ea){throw new db[(_0xd7ca('0x54'))][(_0xd7ca('0x55'))](_0xd7ca('0x56'));}return db['CannedAnswer'][_0xd7ca('0x4e')](_0x361647[_0xd7ca('0x4d')]);})[_0xd7ca('0x2a')](function(_0x532995){var _0x122094=_0x361647[_0xd7ca('0x57')][_0xd7ca('0x27')]({'plain':!![]});if(!_0x122094)throw new Error(_0xd7ca('0x58'));if(_0x122094[_0xd7ca('0x59')]===_0xd7ca('0x57')){var _0x225df5=_0x532995[_0xd7ca('0x27')]({'plain':!![]});return db[_0xd7ca('0x5a')][_0xd7ca('0x4c')]({'where':{'name':_0xd7ca('0x28'),'userProfileId':_0x122094[_0xd7ca('0x5b')]},'raw':!![]})[_0xd7ca('0x2a')](function(_0x494855){if(_0x494855&&_0x494855[_0xd7ca('0x5c')]===0x0){return db[_0xd7ca('0x29')][_0xd7ca('0x4e')]({'name':_0x225df5[_0xd7ca('0x2d')],'resourceId':_0x225df5['id'],'type':_0x494855[_0xd7ca('0x2d')],'sectionId':_0x494855['id']},{})[_0xd7ca('0x2a')](function(){return _0x532995;});}else{return _0x532995;}})['catch'](function(_0x3aa263){logger[_0xd7ca('0x2b')](_0xd7ca('0x5d'),_0x3aa263);throw _0x3aa263;});}return _0x532995;})['then'](respondWithResult(_0x3a1442,0xc9))['catch'](handleError(_0x3a1442,null));};
\ No newline at end of file
+var _0x20ac=['key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','body','find','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','error','name','send','index','map','CannedAnswer','rawAttributes'];(function(_0x5aa0c2,_0x42a0ef){var _0x49dbca=function(_0x58f170){while(--_0x58f170){_0x5aa0c2['push'](_0x5aa0c2['shift']());}};_0x49dbca(++_0x42a0ef);}(_0x20ac,0xde));var _0xc20a=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x20ac[_0x381589];return _0x2a075d;};'use strict';var emlformat=require(_0xc20a('0x0'));var rimraf=require(_0xc20a('0x1'));var zipdir=require(_0xc20a('0x2'));var jsonpatch=require(_0xc20a('0x3'));var rp=require(_0xc20a('0x4'));var moment=require('moment');var BPromise=require(_0xc20a('0x5'));var Mustache=require(_0xc20a('0x6'));var util=require(_0xc20a('0x7'));var path=require(_0xc20a('0x8'));var sox=require(_0xc20a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc20a('0xa'));var _=require(_0xc20a('0xb'));var squel=require('squel');var crypto=require(_0xc20a('0xc'));var jsforce=require(_0xc20a('0xd'));var deskjs=require(_0xc20a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc20a('0xf'));var Papa=require('papaparse');var Redis=require(_0xc20a('0x10'));var authService=require(_0xc20a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc20a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc20a('0x13'))(_0xc20a('0x14'));var utils=require('../../config/utils');var config=require(_0xc20a('0x15'));var licenseUtil=require(_0xc20a('0x16'));var db=require(_0xc20a('0x17'))['db'];function respondWithStatusCode(_0x1d31ac,_0x9d6de1){_0x9d6de1=_0x9d6de1||0xcc;return function(_0x2ec8e5){if(_0x2ec8e5){return _0x1d31ac['sendStatus'](_0x9d6de1);}return _0x1d31ac[_0xc20a('0x18')](_0x9d6de1)[_0xc20a('0x19')]();};}function respondWithResult(_0x2dcbc5,_0x3894cd){_0x3894cd=_0x3894cd||0xc8;return function(_0x1fc75a){if(_0x1fc75a){return _0x2dcbc5[_0xc20a('0x18')](_0x3894cd)[_0xc20a('0x1a')](_0x1fc75a);}};}function respondWithFilteredResult(_0x11ecd7,_0x5b2cb2){return function(_0xeed689){if(_0xeed689){var _0x5ad28=typeof _0x5b2cb2[_0xc20a('0x1b')]===_0xc20a('0x1c')&&typeof _0x5b2cb2[_0xc20a('0x1d')]==='undefined';var _0x49afd8=_0xeed689[_0xc20a('0x1e')];var _0x393d8f=_0x5ad28?0x0:_0x5b2cb2[_0xc20a('0x1b')];var _0x44e49f=_0x5ad28?_0xeed689[_0xc20a('0x1e')]:_0x5b2cb2[_0xc20a('0x1b')]+_0x5b2cb2[_0xc20a('0x1d')];var _0x2959f;if(_0x44e49f>=_0x49afd8){_0x44e49f=_0x49afd8;_0x2959f=0xc8;}else{_0x2959f=0xce;}_0x11ecd7[_0xc20a('0x18')](_0x2959f);return _0x11ecd7['set'](_0xc20a('0x1f'),_0x393d8f+'-'+_0x44e49f+'/'+_0x49afd8)['json'](_0xeed689);}return null;};}function patchUpdates(_0x11ccb3){return function(_0x2d3dd2){try{jsonpatch[_0xc20a('0x20')](_0x2d3dd2,_0x11ccb3,!![]);}catch(_0x543158){return BPromise[_0xc20a('0x21')](_0x543158);}return _0x2d3dd2[_0xc20a('0x22')]();};}function saveUpdates(_0x1403d1,_0x29881b){return function(_0x110a8c){if(_0x110a8c){return _0x110a8c[_0xc20a('0x23')](_0x1403d1)['then'](function(_0x4ed2bc){return _0x4ed2bc;});}return null;};}function removeEntity(_0x51594e,_0x232bc7){return function(_0x59e925){if(_0x59e925){return _0x59e925[_0xc20a('0x24')]()[_0xc20a('0x25')](function(){var _0x2c2560=_0x59e925[_0xc20a('0x26')]({'plain':!![]});var _0x23934b=_0xc20a('0x27');return db[_0xc20a('0x28')][_0xc20a('0x24')]({'where':{'type':_0x23934b,'resourceId':_0x2c2560['id']}})[_0xc20a('0x25')](function(){return _0x59e925;});})[_0xc20a('0x25')](function(){_0x51594e[_0xc20a('0x18')](0xcc)[_0xc20a('0x19')]();});}};}function handleEntityNotFound(_0x42657c,_0x52be02){return function(_0x2c59dd){if(!_0x2c59dd){_0x42657c['sendStatus'](0x194);}return _0x2c59dd;};}function handleError(_0xf1acb0,_0x4a034a){_0x4a034a=_0x4a034a||0x1f4;return function(_0x4ab4e8){logger[_0xc20a('0x29')](_0x4ab4e8['stack']);if(_0x4ab4e8[_0xc20a('0x2a')]){delete _0x4ab4e8['name'];}_0xf1acb0[_0xc20a('0x18')](_0x4a034a)[_0xc20a('0x2b')](_0x4ab4e8);};}exports[_0xc20a('0x2c')]=function(_0x333346,_0x2d3c58){var _0x319671={},_0x4e86ed={},_0x275ff8={'count':0x0,'rows':[]};var _0x502248=_[_0xc20a('0x2d')](db[_0xc20a('0x2e')][_0xc20a('0x2f')],function(_0x3a1dd8){return{'name':_0x3a1dd8['fieldName'],'type':_0x3a1dd8['type'][_0xc20a('0x30')]};});_0x4e86ed['model']=_[_0xc20a('0x2d')](_0x502248,'name');_0x4e86ed[_0xc20a('0x31')]=_[_0xc20a('0x32')](_0x333346[_0xc20a('0x31')]);_0x4e86ed[_0xc20a('0x33')]=_[_0xc20a('0x34')](_0x4e86ed[_0xc20a('0x35')],_0x4e86ed[_0xc20a('0x31')]);_0x319671[_0xc20a('0x36')]=_[_0xc20a('0x34')](_0x4e86ed[_0xc20a('0x35')],qs['fields'](_0x333346[_0xc20a('0x31')][_0xc20a('0x37')]));_0x319671['attributes']=_0x319671[_0xc20a('0x36')][_0xc20a('0x38')]?_0x319671[_0xc20a('0x36')]:_0x4e86ed['model'];if(!_0x333346[_0xc20a('0x31')][_0xc20a('0x39')](_0xc20a('0x3a'))){_0x319671[_0xc20a('0x1d')]=qs['limit'](_0x333346[_0xc20a('0x31')][_0xc20a('0x1d')]);_0x319671[_0xc20a('0x1b')]=qs[_0xc20a('0x1b')](_0x333346[_0xc20a('0x31')][_0xc20a('0x1b')]);}_0x319671[_0xc20a('0x3b')]=qs['sort'](_0x333346[_0xc20a('0x31')][_0xc20a('0x3c')]);_0x319671[_0xc20a('0x3d')]=qs[_0xc20a('0x33')](_[_0xc20a('0x3e')](_0x333346[_0xc20a('0x31')],_0x4e86ed[_0xc20a('0x33')]),_0x502248);if(_0x333346['query']['filter']){_0x319671[_0xc20a('0x3d')]=_[_0xc20a('0x3f')](_0x319671[_0xc20a('0x3d')],{'$or':[{'key':{'$like':'%'+_0x333346['query'][_0xc20a('0x40')]+'%'}},{'value':{'$like':'%'+_0x333346['query']['filter']+'%'}}]});}_0x319671=_[_0xc20a('0x3f')]({},_0x319671,_0x333346[_0xc20a('0x41')]);var _0x4c9292={'where':_0x319671['where']};return db['CannedAnswer'][_0xc20a('0x1e')](_0x4c9292)['then'](function(_0x256474){_0x275ff8['count']=_0x256474;if(_0x333346[_0xc20a('0x31')][_0xc20a('0x42')]){_0x319671[_0xc20a('0x43')]=[{'all':!![]}];}return db[_0xc20a('0x2e')][_0xc20a('0x44')](_0x319671);})[_0xc20a('0x25')](function(_0x376fda){_0x275ff8[_0xc20a('0x45')]=_0x376fda;return _0x275ff8;})[_0xc20a('0x25')](respondWithFilteredResult(_0x2d3c58,_0x319671))[_0xc20a('0x46')](handleError(_0x2d3c58,null));};exports[_0xc20a('0x47')]=function(_0x56b0f8,_0x1ddd42){var _0x2bacdf={'raw':!![],'where':{'id':_0x56b0f8[_0xc20a('0x48')]['id']}},_0x176522={};_0x176522[_0xc20a('0x35')]=_[_0xc20a('0x32')](db[_0xc20a('0x2e')][_0xc20a('0x2f')]);_0x176522[_0xc20a('0x31')]=_[_0xc20a('0x32')](_0x56b0f8['query']);_0x176522[_0xc20a('0x33')]=_[_0xc20a('0x34')](_0x176522[_0xc20a('0x35')],_0x176522['query']);_0x2bacdf[_0xc20a('0x36')]=_[_0xc20a('0x34')](_0x176522[_0xc20a('0x35')],qs['fields'](_0x56b0f8[_0xc20a('0x31')]['fields']));_0x2bacdf['attributes']=_0x2bacdf[_0xc20a('0x36')][_0xc20a('0x38')]?_0x2bacdf[_0xc20a('0x36')]:_0x176522['model'];if(_0x56b0f8[_0xc20a('0x31')][_0xc20a('0x42')]){_0x2bacdf[_0xc20a('0x43')]=[{'all':!![]}];}_0x2bacdf=_[_0xc20a('0x3f')]({},_0x2bacdf,_0x56b0f8[_0xc20a('0x41')]);return db[_0xc20a('0x2e')]['find'](_0x2bacdf)[_0xc20a('0x25')](handleEntityNotFound(_0x1ddd42,null))[_0xc20a('0x25')](respondWithResult(_0x1ddd42,null))[_0xc20a('0x46')](handleError(_0x1ddd42,null));};exports[_0xc20a('0x23')]=function(_0x408021,_0x2d3388){if(_0x408021['body']['id']){delete _0x408021[_0xc20a('0x49')]['id'];}return db[_0xc20a('0x2e')][_0xc20a('0x4a')]({'where':{'id':_0x408021[_0xc20a('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d3388,null))['then'](saveUpdates(_0x408021[_0xc20a('0x49')],null))[_0xc20a('0x25')](respondWithResult(_0x2d3388,null))[_0xc20a('0x46')](handleError(_0x2d3388,null));};exports['destroy']=function(_0x1af7a3,_0x3ead6e){return db[_0xc20a('0x2e')][_0xc20a('0x4a')]({'where':{'id':_0x1af7a3['params']['id']}})[_0xc20a('0x25')](handleEntityNotFound(_0x3ead6e,null))[_0xc20a('0x25')](removeEntity(_0x3ead6e,null))[_0xc20a('0x46')](handleError(_0x3ead6e,null));};exports['create']=function(_0x2012ca,_0x254637){var _0x26455a={'key':_0x2012ca[_0xc20a('0x49')][_0xc20a('0x30')]};if(_0x2012ca[_0xc20a('0x49')][_0xc20a('0x4b')]){_0x26455a[_0xc20a('0x4b')]=_0x2012ca[_0xc20a('0x49')][_0xc20a('0x4b')];}else if(_0x2012ca[_0xc20a('0x49')][_0xc20a('0x4c')]){_0x26455a[_0xc20a('0x4c')]=_0x2012ca[_0xc20a('0x49')][_0xc20a('0x4c')];}else if(_0x2012ca[_0xc20a('0x49')][_0xc20a('0x4d')]){_0x26455a['OpenchannelAccountId']=_0x2012ca['body']['OpenchannelAccountId'];}else if(_0x2012ca[_0xc20a('0x49')][_0xc20a('0x4e')]){_0x26455a['ChatWebsiteId']=_0x2012ca[_0xc20a('0x49')][_0xc20a('0x4e')];}return db['CannedAnswer']['find']({'where':_0x26455a})[_0xc20a('0x25')](function(_0x3b333e){if(_0x3b333e){throw new db[(_0xc20a('0x4f'))][(_0xc20a('0x50'))](_0xc20a('0x51'));}return db[_0xc20a('0x2e')]['create'](_0x2012ca[_0xc20a('0x49')]);})[_0xc20a('0x25')](function(_0x317404){var _0x90fc21=_0x2012ca[_0xc20a('0x52')][_0xc20a('0x26')]({'plain':!![]});if(!_0x90fc21)throw new Error(_0xc20a('0x53'));if(_0x90fc21[_0xc20a('0x54')]==='user'){var _0x6e97b2=_0x317404[_0xc20a('0x26')]({'plain':!![]});return db[_0xc20a('0x55')][_0xc20a('0x4a')]({'where':{'name':_0xc20a('0x27'),'userProfileId':_0x90fc21[_0xc20a('0x56')]},'raw':!![]})[_0xc20a('0x25')](function(_0x264355){if(_0x264355&&_0x264355[_0xc20a('0x57')]===0x0){return db[_0xc20a('0x28')][_0xc20a('0x58')]({'name':_0x6e97b2[_0xc20a('0x2a')],'resourceId':_0x6e97b2['id'],'type':_0x264355['name'],'sectionId':_0x264355['id']},{})['then'](function(){return _0x317404;});}else{return _0x317404;}})[_0xc20a('0x46')](function(_0x2f16cd){logger[_0xc20a('0x29')](_0xc20a('0x59'),_0x2f16cd);throw _0x2f16cd;});}return _0x317404;})['then'](respondWithResult(_0x254637,0xc9))[_0xc20a('0x46')](handleError(_0x254637,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index e9aef57..b1a00da 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 _0x0ae6=['CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define'];(function(_0x3547b0,_0x3b99f9){var _0x5051c4=function(_0x48b1f0){while(--_0x48b1f0){_0x3547b0['push'](_0x3547b0['shift']());}};_0x5051c4(++_0x3b99f9);}(_0x0ae6,0xc7));var _0x60ae=function(_0x544c53,_0x2a5c11){_0x544c53=_0x544c53-0x0;var _0x231480=_0x0ae6[_0x544c53];return _0x231480;};'use strict';var _=require(_0x60ae('0x0'));var util=require(_0x60ae('0x1'));var logger=require('../../config/logger')(_0x60ae('0x2'));var moment=require(_0x60ae('0x3'));var BPromise=require(_0x60ae('0x4'));var rp=require(_0x60ae('0x5'));var fs=require('fs');var path=require(_0x60ae('0x6'));var rimraf=require(_0x60ae('0x7'));var config=require('../../config/environment');var attributes=require(_0x60ae('0x8'));module[_0x60ae('0x9')]=function(_0x571103,_0x57684a){return _0x571103[_0x60ae('0xa')](_0x60ae('0xb'),attributes,{'tableName':_0x60ae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x60ae('0xd')});};
\ No newline at end of file
+var _0x91a7=['utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers'];(function(_0x187579,_0x2577e4){var _0x4d427c=function(_0x92cfeb){while(--_0x92cfeb){_0x187579['push'](_0x187579['shift']());}};_0x4d427c(++_0x2577e4);}(_0x91a7,0xe7));var _0x791a=function(_0x2ced97,_0x45f6e1){_0x2ced97=_0x2ced97-0x0;var _0x2afc25=_0x91a7[_0x2ced97];return _0x2afc25;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var logger=require(_0x791a('0x1'))(_0x791a('0x2'));var moment=require('moment');var BPromise=require(_0x791a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x791a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x791a('0x5'));module[_0x791a('0x6')]=function(_0x49a9b7,_0x361f53){return _0x49a9b7['define'](_0x791a('0x7'),attributes,{'tableName':_0x791a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x791a('0x9')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 081a985..c25d908 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(_0x4b0b22,_0x66dfe5){var _0x4b2030=function(_0x327196){while(--_0x327196){_0x4b0b22['push'](_0x4b0b22['shift']());}};_0x4b2030(++_0x66dfe5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x4b0e7b,_0x16ec4c){var _0xaf61b9=function(_0x519bac){while(--_0x519bac){_0x4b0e7b['push'](_0x4b0e7b['shift']());}};_0xaf61b9(++_0x16ec4c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 73ced53..9e8e2eb 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 _0x789c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','put','delete','destroy','multer','util','path','express'];(function(_0x2b1593,_0x1381ae){var _0x177e84=function(_0x35be0f){while(--_0x35be0f){_0x2b1593['push'](_0x2b1593['shift']());}};_0x177e84(++_0x1381ae);}(_0x789c,0x8c));var _0xc789=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x789c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc789('0x0'));var util=require(_0xc789('0x1'));var path=require(_0xc789('0x2'));var timeout=require('connect-timeout');var express=require(_0xc789('0x3'));var router=express[_0xc789('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc789('0x5'));var interaction=require(_0xc789('0x6'));var config=require(_0xc789('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xc789('0x8')](),controller[_0xc789('0x9')]);router[_0xc789('0xa')](_0xc789('0xb'),auth[_0xc789('0x8')](),controller[_0xc789('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc789('0xd')](_0xc789('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xc789('0xe')]('/:id',auth[_0xc789('0x8')](),controller[_0xc789('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x2fda=['get','isAuthenticated','index','/:id','show','create','put','update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cannedAnswer.controller'];(function(_0x1b63a5,_0xe8250b){var _0x2ff8f8=function(_0x15ccb0){while(--_0x15ccb0){_0x1b63a5['push'](_0x1b63a5['shift']());}};_0x2ff8f8(++_0xe8250b);}(_0x2fda,0xc9));var _0xa2fd=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x2fda[_0x34bc30];return _0x5706de;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa2fd('0x0'));var timeout=require(_0xa2fd('0x1'));var express=require(_0xa2fd('0x2'));var router=express[_0xa2fd('0x3')]();var fs_extra=require(_0xa2fd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa2fd('0x5'));var config=require('../../config/environment');var controller=require(_0xa2fd('0x6'));router[_0xa2fd('0x7')]('/',auth[_0xa2fd('0x8')](),controller[_0xa2fd('0x9')]);router[_0xa2fd('0x7')](_0xa2fd('0xa'),auth['isAuthenticated'](),controller[_0xa2fd('0xb')]);router['post']('/',auth[_0xa2fd('0x8')](),controller[_0xa2fd('0xc')]);router[_0xa2fd('0xd')](_0xa2fd('0xa'),auth[_0xa2fd('0x8')](),controller[_0xa2fd('0xe')]);router['delete'](_0xa2fd('0xa'),auth[_0xa2fd('0x8')](),controller[_0xa2fd('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 46544d2..3e15007 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 _0xbe85=['STRING','INTEGER','sequelize','exports','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe85,0x19c));var _0x5be8=function(_0x1c1d62,_0x532987){_0x1c1d62=_0x1c1d62-0x0;var _0x153262=_0xbe85[_0x1c1d62];return _0x153262;};'use strict';var Sequelize=require(_0x5be8('0x0'));module[_0x5be8('0x1')]={'calldate':{'type':Sequelize[_0x5be8('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x5be8('0x3')]},'src':{'type':Sequelize[_0x5be8('0x3')]},'dst':{'type':Sequelize[_0x5be8('0x3')]},'dcontext':{'type':Sequelize[_0x5be8('0x3')]},'channel':{'type':Sequelize[_0x5be8('0x3')]},'dstchannel':{'type':Sequelize[_0x5be8('0x3')]},'lastapp':{'type':Sequelize[_0x5be8('0x3')]},'lastdata':{'type':Sequelize[_0x5be8('0x3')]},'duration':{'type':Sequelize[_0x5be8('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5be8('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5be8('0x3')]},'amaflags':{'type':Sequelize[_0x5be8('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5be8('0x3')]},'userfield':{'type':Sequelize[_0x5be8('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x5be8('0x3')]},'peeraccount':{'type':Sequelize[_0x5be8('0x3')]},'type':{'type':Sequelize[_0x5be8('0x3')]},'tag':{'type':Sequelize[_0x5be8('0x3')]}};
\ No newline at end of file
+var _0xc3b0=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x25b5e4,_0x581442){var _0x2c86c4=function(_0x40b249){while(--_0x40b249){_0x25b5e4['push'](_0x25b5e4['shift']());}};_0x2c86c4(++_0x581442);}(_0xc3b0,0x166));var _0x0c3b=function(_0x19049a,_0x58d980){_0x19049a=_0x19049a-0x0;var _0x4c146f=_0xc3b0[_0x19049a];return _0x4c146f;};'use strict';var Sequelize=require(_0x0c3b('0x0'));module[_0x0c3b('0x1')]={'calldate':{'type':Sequelize[_0x0c3b('0x2')],'allowNull':![],'defaultValue':_0x0c3b('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x0c3b('0x4')]},'dcontext':{'type':Sequelize[_0x0c3b('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x0c3b('0x4')]},'lastapp':{'type':Sequelize[_0x0c3b('0x4')]},'lastdata':{'type':Sequelize[_0x0c3b('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0c3b('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0c3b('0x4')]},'amaflags':{'type':Sequelize[_0x0c3b('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x0c3b('0x4')]},'sequence':{'type':Sequelize[_0x0c3b('0x4')]},'peeraccount':{'type':Sequelize[_0x0c3b('0x4')]},'type':{'type':Sequelize[_0x0c3b('0x4')]},'tag':{'type':Sequelize[_0x0c3b('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index a730612..ad90aaa 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 _0x1af3=['../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1a1840,_0x5a8706){var _0x372521=function(_0x561038){while(--_0x561038){_0x1a1840['push'](_0x1a1840['shift']());}};_0x372521(++_0x5a8706);}(_0x1af3,0x1ca));var _0x31af=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x1af3[_0x111e94];return _0x3de107;};'use strict';var emlformat=require(_0x31af('0x0'));var rimraf=require(_0x31af('0x1'));var zipdir=require(_0x31af('0x2'));var jsonpatch=require(_0x31af('0x3'));var rp=require(_0x31af('0x4'));var moment=require(_0x31af('0x5'));var BPromise=require(_0x31af('0x6'));var Mustache=require(_0x31af('0x7'));var util=require(_0x31af('0x8'));var path=require(_0x31af('0x9'));var sox=require('sox');var csv=require(_0x31af('0xa'));var ejs=require(_0x31af('0xb'));var fs=require('fs');var fs_extra=require(_0x31af('0xc'));var _=require(_0x31af('0xd'));var squel=require('squel');var crypto=require(_0x31af('0xe'));var jsforce=require(_0x31af('0xf'));var deskjs=require(_0x31af('0x10'));var toCsv=require('to-csv');var querystring=require(_0x31af('0x11'));var Papa=require(_0x31af('0x12'));var Redis=require(_0x31af('0x13'));var authService=require(_0x31af('0x14'));var qs=require(_0x31af('0x15'));var as=require(_0x31af('0x16'));var hardwareService=require(_0x31af('0x17'));var logger=require(_0x31af('0x18'))('api');var utils=require(_0x31af('0x19'));var config=require(_0x31af('0x1a'));var licenseUtil=require(_0x31af('0x1b'));var db=require(_0x31af('0x1c'))['db'];function respondWithStatusCode(_0x144406,_0x481f20){_0x481f20=_0x481f20||0xcc;return function(_0x358fb4){if(_0x358fb4){return _0x144406[_0x31af('0x1d')](_0x481f20);}return _0x144406['status'](_0x481f20)['end']();};}function respondWithResult(_0x2a4727,_0x46a494){_0x46a494=_0x46a494||0xc8;return function(_0x14c57e){if(_0x14c57e){return _0x2a4727[_0x31af('0x1e')](_0x46a494)[_0x31af('0x1f')](_0x14c57e);}};}function respondWithFilteredResult(_0x1d35fa,_0x369934){return function(_0x37c275){if(_0x37c275){var _0xd431e4=typeof _0x369934[_0x31af('0x20')]===_0x31af('0x21')&&typeof _0x369934['limit']===_0x31af('0x21');var _0xd33b3f=_0x37c275[_0x31af('0x22')];var _0x477ada=_0xd431e4?0x0:_0x369934[_0x31af('0x20')];var _0x30a112=_0xd431e4?_0x37c275[_0x31af('0x22')]:_0x369934[_0x31af('0x20')]+_0x369934[_0x31af('0x23')];var _0x550870;if(_0x30a112>=_0xd33b3f){_0x30a112=_0xd33b3f;_0x550870=0xc8;}else{_0x550870=0xce;}_0x1d35fa[_0x31af('0x1e')](_0x550870);return _0x1d35fa[_0x31af('0x24')](_0x31af('0x25'),_0x477ada+'-'+_0x30a112+'/'+_0xd33b3f)[_0x31af('0x1f')](_0x37c275);}return null;};}function patchUpdates(_0x414ad8){return function(_0x5d96ca){try{jsonpatch[_0x31af('0x26')](_0x5d96ca,_0x414ad8,!![]);}catch(_0x46b03e){return BPromise[_0x31af('0x27')](_0x46b03e);}return _0x5d96ca[_0x31af('0x28')]();};}function saveUpdates(_0x394d13,_0x14c3f9){return function(_0x1ddfba){if(_0x1ddfba){return _0x1ddfba[_0x31af('0x29')](_0x394d13)[_0x31af('0x2a')](function(_0x6634e3){return _0x6634e3;});}return null;};}function removeEntity(_0x40aa32,_0x1a67e3){return function(_0x3a98d3){if(_0x3a98d3){return _0x3a98d3[_0x31af('0x2b')]()[_0x31af('0x2a')](function(){_0x40aa32['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d3832,_0x20a50c){return function(_0x2b3bad){if(!_0x2b3bad){_0x5d3832['sendStatus'](0x194);}return _0x2b3bad;};}function handleError(_0x4c958,_0x8f9f60){_0x8f9f60=_0x8f9f60||0x1f4;return function(_0x49812a){logger[_0x31af('0x2c')](_0x49812a[_0x31af('0x2d')]);if(_0x49812a['name']){delete _0x49812a[_0x31af('0x2e')];}_0x4c958[_0x31af('0x1e')](_0x8f9f60)[_0x31af('0x2f')](_0x49812a);};}exports[_0x31af('0x30')]=function(_0x3326a7,_0x5a1f41){var _0xb1f5b1={},_0x3eb61f={},_0x1e6df8={'count':0x0,'rows':[]};var _0x1f4eae=_[_0x31af('0x31')](db[_0x31af('0x32')][_0x31af('0x33')],function(_0x231438){return{'name':_0x231438[_0x31af('0x34')],'type':_0x231438[_0x31af('0x35')][_0x31af('0x36')]};});_0x3eb61f[_0x31af('0x37')]=_['map'](_0x1f4eae,_0x31af('0x2e'));_0x3eb61f[_0x31af('0x38')]=_['keys'](_0x3326a7['query']);_0x3eb61f['filters']=_[_0x31af('0x39')](_0x3eb61f['model'],_0x3eb61f[_0x31af('0x38')]);_0xb1f5b1[_0x31af('0x3a')]=_[_0x31af('0x39')](_0x3eb61f[_0x31af('0x37')],qs[_0x31af('0x3b')](_0x3326a7[_0x31af('0x38')]['fields']));_0xb1f5b1[_0x31af('0x3a')]=_0xb1f5b1[_0x31af('0x3a')][_0x31af('0x3c')]?_0xb1f5b1[_0x31af('0x3a')]:_0x3eb61f[_0x31af('0x37')];if(!_0x3326a7[_0x31af('0x38')][_0x31af('0x3d')](_0x31af('0x3e'))){_0xb1f5b1['limit']=qs[_0x31af('0x23')](_0x3326a7['query'][_0x31af('0x23')]);_0xb1f5b1[_0x31af('0x20')]=qs[_0x31af('0x20')](_0x3326a7[_0x31af('0x38')][_0x31af('0x20')]);}_0xb1f5b1['order']=qs['sort'](_0x3326a7['query'][_0x31af('0x3f')]);_0xb1f5b1[_0x31af('0x40')]=qs[_0x31af('0x41')](_[_0x31af('0x42')](_0x3326a7[_0x31af('0x38')],_0x3eb61f[_0x31af('0x41')]),_0x1f4eae);if(_0x3326a7[_0x31af('0x38')][_0x31af('0x43')]){_0xb1f5b1['where']=_[_0x31af('0x44')](_0xb1f5b1[_0x31af('0x40')],{'$or':_[_0x31af('0x31')](_0x1f4eae,function(_0x2a5cde){if(_0x2a5cde[_0x31af('0x35')]!==_0x31af('0x45')){var _0x32d1b9={};_0x32d1b9[_0x2a5cde[_0x31af('0x2e')]]={'$like':'%'+_0x3326a7[_0x31af('0x38')]['filter']+'%'};return _0x32d1b9;}})});}_0xb1f5b1=_[_0x31af('0x44')]({},_0xb1f5b1,_0x3326a7['options']);var _0x447a01={'where':_0xb1f5b1['where']};return db['Cdr'][_0x31af('0x22')](_0x447a01)[_0x31af('0x2a')](function(_0x110f38){_0x1e6df8[_0x31af('0x22')]=_0x110f38;if(_0x3326a7[_0x31af('0x38')][_0x31af('0x46')]){_0xb1f5b1[_0x31af('0x47')]=[{'all':!![]}];}return db['Cdr'][_0x31af('0x48')](_0xb1f5b1);})[_0x31af('0x2a')](function(_0xb53565){_0x1e6df8['rows']=_0xb53565;return _0x1e6df8;})[_0x31af('0x2a')](respondWithFilteredResult(_0x5a1f41,_0xb1f5b1))[_0x31af('0x49')](handleError(_0x5a1f41,null));};exports[_0x31af('0x4a')]=function(_0x23942b,_0x34205a){var _0x57da2c={'raw':!![],'where':{'id':_0x23942b[_0x31af('0x4b')]['id']}},_0x12357c={};_0x12357c[_0x31af('0x37')]=_[_0x31af('0x4c')](db['Cdr'][_0x31af('0x33')]);_0x12357c[_0x31af('0x38')]=_['keys'](_0x23942b[_0x31af('0x38')]);_0x12357c[_0x31af('0x41')]=_[_0x31af('0x39')](_0x12357c[_0x31af('0x37')],_0x12357c[_0x31af('0x38')]);_0x57da2c[_0x31af('0x3a')]=_[_0x31af('0x39')](_0x12357c[_0x31af('0x37')],qs[_0x31af('0x3b')](_0x23942b[_0x31af('0x38')]['fields']));_0x57da2c['attributes']=_0x57da2c[_0x31af('0x3a')]['length']?_0x57da2c[_0x31af('0x3a')]:_0x12357c[_0x31af('0x37')];if(_0x23942b[_0x31af('0x38')]['includeAll']){_0x57da2c['include']=[{'all':!![]}];}_0x57da2c=_[_0x31af('0x44')]({},_0x57da2c,_0x23942b['options']);return db[_0x31af('0x32')][_0x31af('0x4d')](_0x57da2c)[_0x31af('0x2a')](handleEntityNotFound(_0x34205a,null))[_0x31af('0x2a')](respondWithResult(_0x34205a,null))['catch'](handleError(_0x34205a,null));};exports['create']=function(_0x407386,_0x3acff1){return db[_0x31af('0x32')][_0x31af('0x4e')](_0x407386['body'],{})[_0x31af('0x2a')](respondWithResult(_0x3acff1,0xc9))[_0x31af('0x49')](handleError(_0x3acff1,null));};exports[_0x31af('0x29')]=function(_0x4ad7a6,_0x5a1cbe){if(_0x4ad7a6[_0x31af('0x4f')]['id']){delete _0x4ad7a6[_0x31af('0x4f')]['id'];}return db[_0x31af('0x32')][_0x31af('0x4d')]({'where':{'id':_0x4ad7a6[_0x31af('0x4b')]['id']}})[_0x31af('0x2a')](handleEntityNotFound(_0x5a1cbe,null))[_0x31af('0x2a')](saveUpdates(_0x4ad7a6[_0x31af('0x4f')],null))[_0x31af('0x2a')](respondWithResult(_0x5a1cbe,null))[_0x31af('0x49')](handleError(_0x5a1cbe,null));};exports['destroy']=function(_0x441362,_0x29de7e){return db[_0x31af('0x32')][_0x31af('0x4d')]({'where':{'id':_0x441362[_0x31af('0x4b')]['id']}})[_0x31af('0x2a')](handleEntityNotFound(_0x29de7e,null))[_0x31af('0x2a')](removeEntity(_0x29de7e,null))[_0x31af('0x49')](handleError(_0x29de7e,null));};exports[_0x31af('0x50')]=function(_0x25369b,_0x3bfbae){return db[_0x31af('0x32')][_0x31af('0x50')]()[_0x31af('0x2a')](respondWithResult(_0x3bfbae,null))['catch'](handleError(_0x3bfbae,null));};
\ No newline at end of file
+var _0xf3cc=['then','destroy','end','stack','name','send','Cdr','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x2053aa,_0x3df40e){_0x2053aa=_0x2053aa-0x0;var _0x30f5bb=_0xf3cc[_0x2053aa];return _0x30f5bb;};'use strict';var emlformat=require(_0xcf3c('0x0'));var rimraf=require(_0xcf3c('0x1'));var zipdir=require(_0xcf3c('0x2'));var jsonpatch=require(_0xcf3c('0x3'));var rp=require('request-promise');var moment=require(_0xcf3c('0x4'));var BPromise=require(_0xcf3c('0x5'));var Mustache=require(_0xcf3c('0x6'));var util=require('util');var path=require(_0xcf3c('0x7'));var sox=require(_0xcf3c('0x8'));var csv=require('to-csv');var ejs=require(_0xcf3c('0x9'));var fs=require('fs');var fs_extra=require(_0xcf3c('0xa'));var _=require(_0xcf3c('0xb'));var squel=require(_0xcf3c('0xc'));var crypto=require(_0xcf3c('0xd'));var jsforce=require(_0xcf3c('0xe'));var deskjs=require(_0xcf3c('0xf'));var toCsv=require(_0xcf3c('0x10'));var querystring=require(_0xcf3c('0x11'));var Papa=require(_0xcf3c('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcf3c('0x13'));var as=require(_0xcf3c('0x14'));var hardwareService=require(_0xcf3c('0x15'));var logger=require(_0xcf3c('0x16'))(_0xcf3c('0x17'));var utils=require(_0xcf3c('0x18'));var config=require(_0xcf3c('0x19'));var licenseUtil=require(_0xcf3c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x245b88,_0x389b0f){_0x389b0f=_0x389b0f||0xcc;return function(_0x59a8dc){if(_0x59a8dc){return _0x245b88[_0xcf3c('0x1b')](_0x389b0f);}return _0x245b88['status'](_0x389b0f)['end']();};}function respondWithResult(_0x56261f,_0x3fd714){_0x3fd714=_0x3fd714||0xc8;return function(_0x598576){if(_0x598576){return _0x56261f[_0xcf3c('0x1c')](_0x3fd714)[_0xcf3c('0x1d')](_0x598576);}};}function respondWithFilteredResult(_0x4e35fc,_0x3e759f){return function(_0x540046){if(_0x540046){var _0x30d023=typeof _0x3e759f[_0xcf3c('0x1e')]===_0xcf3c('0x1f')&&typeof _0x3e759f['limit']===_0xcf3c('0x1f');var _0x190c8c=_0x540046[_0xcf3c('0x20')];var _0x3f6cef=_0x30d023?0x0:_0x3e759f['offset'];var _0x3789b6=_0x30d023?_0x540046[_0xcf3c('0x20')]:_0x3e759f[_0xcf3c('0x1e')]+_0x3e759f[_0xcf3c('0x21')];var _0x3d0e0a;if(_0x3789b6>=_0x190c8c){_0x3789b6=_0x190c8c;_0x3d0e0a=0xc8;}else{_0x3d0e0a=0xce;}_0x4e35fc[_0xcf3c('0x1c')](_0x3d0e0a);return _0x4e35fc[_0xcf3c('0x22')](_0xcf3c('0x23'),_0x3f6cef+'-'+_0x3789b6+'/'+_0x190c8c)[_0xcf3c('0x1d')](_0x540046);}return null;};}function patchUpdates(_0x8e7738){return function(_0x26a26e){try{jsonpatch[_0xcf3c('0x24')](_0x26a26e,_0x8e7738,!![]);}catch(_0x4e80d4){return BPromise[_0xcf3c('0x25')](_0x4e80d4);}return _0x26a26e['save']();};}function saveUpdates(_0x3c9153,_0x1228c1){return function(_0x5dddc1){if(_0x5dddc1){return _0x5dddc1[_0xcf3c('0x26')](_0x3c9153)[_0xcf3c('0x27')](function(_0x328336){return _0x328336;});}return null;};}function removeEntity(_0x1d7e79,_0x32bbd5){return function(_0x3f1771){if(_0x3f1771){return _0x3f1771[_0xcf3c('0x28')]()[_0xcf3c('0x27')](function(){_0x1d7e79['status'](0xcc)[_0xcf3c('0x29')]();});}};}function handleEntityNotFound(_0x4ce43c,_0x2281b6){return function(_0x15b55c){if(!_0x15b55c){_0x4ce43c[_0xcf3c('0x1b')](0x194);}return _0x15b55c;};}function handleError(_0x35e546,_0x181c90){_0x181c90=_0x181c90||0x1f4;return function(_0x43c912){logger['error'](_0x43c912[_0xcf3c('0x2a')]);if(_0x43c912['name']){delete _0x43c912[_0xcf3c('0x2b')];}_0x35e546[_0xcf3c('0x1c')](_0x181c90)[_0xcf3c('0x2c')](_0x43c912);};}exports['index']=function(_0x397996,_0x54174a){var _0x1d8223={},_0xe22e99={},_0x21a329={'count':0x0,'rows':[]};var _0x5bdae3=_['map'](db[_0xcf3c('0x2d')][_0xcf3c('0x2e')],function(_0x1f53ee){return{'name':_0x1f53ee[_0xcf3c('0x2f')],'type':_0x1f53ee['type'][_0xcf3c('0x30')]};});_0xe22e99[_0xcf3c('0x31')]=_[_0xcf3c('0x32')](_0x5bdae3,'name');_0xe22e99[_0xcf3c('0x33')]=_[_0xcf3c('0x34')](_0x397996[_0xcf3c('0x33')]);_0xe22e99['filters']=_[_0xcf3c('0x35')](_0xe22e99[_0xcf3c('0x31')],_0xe22e99[_0xcf3c('0x33')]);_0x1d8223[_0xcf3c('0x36')]=_[_0xcf3c('0x35')](_0xe22e99['model'],qs[_0xcf3c('0x37')](_0x397996['query'][_0xcf3c('0x37')]));_0x1d8223['attributes']=_0x1d8223[_0xcf3c('0x36')][_0xcf3c('0x38')]?_0x1d8223[_0xcf3c('0x36')]:_0xe22e99[_0xcf3c('0x31')];if(!_0x397996[_0xcf3c('0x33')][_0xcf3c('0x39')](_0xcf3c('0x3a'))){_0x1d8223[_0xcf3c('0x21')]=qs['limit'](_0x397996[_0xcf3c('0x33')][_0xcf3c('0x21')]);_0x1d8223[_0xcf3c('0x1e')]=qs[_0xcf3c('0x1e')](_0x397996[_0xcf3c('0x33')][_0xcf3c('0x1e')]);}_0x1d8223[_0xcf3c('0x3b')]=qs[_0xcf3c('0x3c')](_0x397996[_0xcf3c('0x33')][_0xcf3c('0x3c')]);_0x1d8223['where']=qs[_0xcf3c('0x3d')](_['pick'](_0x397996['query'],_0xe22e99['filters']),_0x5bdae3);if(_0x397996[_0xcf3c('0x33')][_0xcf3c('0x3e')]){_0x1d8223[_0xcf3c('0x3f')]=_[_0xcf3c('0x40')](_0x1d8223['where'],{'$or':_['map'](_0x5bdae3,function(_0x27e186){if(_0x27e186[_0xcf3c('0x41')]!==_0xcf3c('0x42')){var _0x9c753f={};_0x9c753f[_0x27e186[_0xcf3c('0x2b')]]={'$like':'%'+_0x397996[_0xcf3c('0x33')]['filter']+'%'};return _0x9c753f;}})});}_0x1d8223=_[_0xcf3c('0x40')]({},_0x1d8223,_0x397996[_0xcf3c('0x43')]);var _0x292c4d={'where':_0x1d8223['where']};return db[_0xcf3c('0x2d')]['count'](_0x292c4d)['then'](function(_0x43ba75){_0x21a329[_0xcf3c('0x20')]=_0x43ba75;if(_0x397996[_0xcf3c('0x33')][_0xcf3c('0x44')]){_0x1d8223[_0xcf3c('0x45')]=[{'all':!![]}];}return db[_0xcf3c('0x2d')][_0xcf3c('0x46')](_0x1d8223);})[_0xcf3c('0x27')](function(_0x245c77){_0x21a329['rows']=_0x245c77;return _0x21a329;})['then'](respondWithFilteredResult(_0x54174a,_0x1d8223))[_0xcf3c('0x47')](handleError(_0x54174a,null));};exports[_0xcf3c('0x48')]=function(_0x4f5b07,_0x3092e4){var _0x48e5f1={'raw':!![],'where':{'id':_0x4f5b07[_0xcf3c('0x49')]['id']}},_0x2831de={};_0x2831de[_0xcf3c('0x31')]=_[_0xcf3c('0x34')](db[_0xcf3c('0x2d')][_0xcf3c('0x2e')]);_0x2831de[_0xcf3c('0x33')]=_[_0xcf3c('0x34')](_0x4f5b07[_0xcf3c('0x33')]);_0x2831de[_0xcf3c('0x3d')]=_[_0xcf3c('0x35')](_0x2831de[_0xcf3c('0x31')],_0x2831de[_0xcf3c('0x33')]);_0x48e5f1[_0xcf3c('0x36')]=_[_0xcf3c('0x35')](_0x2831de[_0xcf3c('0x31')],qs[_0xcf3c('0x37')](_0x4f5b07[_0xcf3c('0x33')]['fields']));_0x48e5f1['attributes']=_0x48e5f1[_0xcf3c('0x36')]['length']?_0x48e5f1[_0xcf3c('0x36')]:_0x2831de[_0xcf3c('0x31')];if(_0x4f5b07[_0xcf3c('0x33')][_0xcf3c('0x44')]){_0x48e5f1[_0xcf3c('0x45')]=[{'all':!![]}];}_0x48e5f1=_['merge']({},_0x48e5f1,_0x4f5b07['options']);return db['Cdr'][_0xcf3c('0x4a')](_0x48e5f1)[_0xcf3c('0x27')](handleEntityNotFound(_0x3092e4,null))['then'](respondWithResult(_0x3092e4,null))[_0xcf3c('0x47')](handleError(_0x3092e4,null));};exports[_0xcf3c('0x4b')]=function(_0x1cfbc9,_0x2800d4){return db[_0xcf3c('0x2d')][_0xcf3c('0x4b')](_0x1cfbc9[_0xcf3c('0x4c')],{})[_0xcf3c('0x27')](respondWithResult(_0x2800d4,0xc9))[_0xcf3c('0x47')](handleError(_0x2800d4,null));};exports[_0xcf3c('0x26')]=function(_0x25d090,_0x2cfc0b){if(_0x25d090['body']['id']){delete _0x25d090[_0xcf3c('0x4c')]['id'];}return db[_0xcf3c('0x2d')][_0xcf3c('0x4a')]({'where':{'id':_0x25d090[_0xcf3c('0x49')]['id']}})['then'](handleEntityNotFound(_0x2cfc0b,null))[_0xcf3c('0x27')](saveUpdates(_0x25d090['body'],null))[_0xcf3c('0x27')](respondWithResult(_0x2cfc0b,null))['catch'](handleError(_0x2cfc0b,null));};exports['destroy']=function(_0x4bba35,_0x5e3abc){return db[_0xcf3c('0x2d')][_0xcf3c('0x4a')]({'where':{'id':_0x4bba35['params']['id']}})[_0xcf3c('0x27')](handleEntityNotFound(_0x5e3abc,null))[_0xcf3c('0x27')](removeEntity(_0x5e3abc,null))[_0xcf3c('0x47')](handleError(_0x5e3abc,null));};exports['describe']=function(_0x5b5e6a,_0x43f2e1){return db[_0xcf3c('0x2d')]['describe']()['then'](respondWithResult(_0x43f2e1,null))['catch'](handleError(_0x43f2e1,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 1893760..7a37167 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x311065,_0x23e18e){var _0x37239c=function(_0x25e121){while(--_0x25e121){_0x311065['push'](_0x311065['shift']());}};_0x37239c(++_0x23e18e);}(_0x7a54,0x106));var _0x47a5=function(_0x9f5f1b,_0xe997f3){_0x9f5f1b=_0x9f5f1b-0x0;var _0x1f4564=_0x7a54[_0x9f5f1b];return _0x1f4564;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x2c8756,_0x8642a){var _0x262014=function(_0x2604d1){while(--_0x2604d1){_0x2c8756['push'](_0x2c8756['shift']());}};_0x262014(++_0x8642a);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 66efbfe..1084c56 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 _0x8059=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x2aaf3a,_0x251232){var _0x56a096=function(_0x4f5e6e){while(--_0x4f5e6e){_0x2aaf3a['push'](_0x2aaf3a['shift']());}};_0x56a096(++_0x251232);}(_0x8059,0xec));var _0x9805=function(_0x493dda,_0x1528d3){_0x493dda=_0x493dda-0x0;var _0x31a5a6=_0x8059[_0x493dda];return _0x31a5a6;};'use strict';var _=require(_0x9805('0x0'));var util=require(_0x9805('0x1'));var moment=require('moment');var BPromise=require(_0x9805('0x2'));var rs=require(_0x9805('0x3'));var fs=require('fs');var Redis=require(_0x9805('0x4'));var db=require(_0x9805('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9805('0x6'))(_0x9805('0x7'));var config=require(_0x9805('0x8'));var jayson=require(_0x9805('0x9'));var client=jayson[_0x9805('0xa')][_0x9805('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52ffc4,_0x50a8a2,_0x66d938){return new BPromise(function(_0x256d7e,_0x4bf550){return client['request'](_0x52ffc4,_0x66d938)[_0x9805('0xc')](function(_0x1eed81){logger[_0x9805('0xd')](_0x9805('0xe'),_0x50a8a2,_0x9805('0xf'));logger['debug'](_0x9805('0x10'),_0x50a8a2,'request\x20sent',JSON[_0x9805('0x11')](_0x1eed81));if(_0x1eed81['error']){if(_0x1eed81[_0x9805('0x12')][_0x9805('0x13')]===0x1f4){logger[_0x9805('0x12')]('Cdr,\x20%s,\x20%s',_0x50a8a2,_0x1eed81[_0x9805('0x12')]['message']);return _0x4bf550(_0x1eed81[_0x9805('0x12')][_0x9805('0x14')]);}logger[_0x9805('0x12')](_0x9805('0xe'),_0x50a8a2,_0x1eed81[_0x9805('0x12')][_0x9805('0x14')]);return _0x256d7e(_0x1eed81[_0x9805('0x12')][_0x9805('0x14')]);}else{logger[_0x9805('0xd')](_0x9805('0xe'),_0x50a8a2,'request\x20sent');_0x256d7e(_0x1eed81[_0x9805('0x15')][_0x9805('0x14')]);}})[_0x9805('0x16')](function(_0x2f8212){logger[_0x9805('0x12')](_0x9805('0xe'),_0x50a8a2,_0x2f8212);_0x4bf550(_0x2f8212);});});}
\ No newline at end of file
+var _0xe553=['stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x297d6f,_0x12c8be){var _0x4e0852=function(_0x37780e){while(--_0x37780e){_0x297d6f['push'](_0x297d6f['shift']());}};_0x4e0852(++_0x12c8be);}(_0xe553,0x16b));var _0x3e55=function(_0x4126dc,_0x1430f8){_0x4126dc=_0x4126dc-0x0;var _0xef998b=_0xe553[_0x4126dc];return _0xef998b;};'use strict';var _=require(_0x3e55('0x0'));var util=require(_0x3e55('0x1'));var moment=require(_0x3e55('0x2'));var BPromise=require('bluebird');var rs=require(_0x3e55('0x3'));var fs=require('fs');var Redis=require(_0x3e55('0x4'));var db=require(_0x3e55('0x5'))['db'];var utils=require(_0x3e55('0x6'));var logger=require(_0x3e55('0x7'))(_0x3e55('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3e55('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19347f,_0x2a625b,_0x5e86e0){return new BPromise(function(_0x2d7439,_0x4c09c2){return client['request'](_0x19347f,_0x5e86e0)[_0x3e55('0xa')](function(_0x2c544a){logger[_0x3e55('0xb')](_0x3e55('0xc'),_0x2a625b,_0x3e55('0xd'));logger['debug'](_0x3e55('0xe'),_0x2a625b,_0x3e55('0xd'),JSON[_0x3e55('0xf')](_0x2c544a));if(_0x2c544a[_0x3e55('0x10')]){if(_0x2c544a[_0x3e55('0x10')][_0x3e55('0x11')]===0x1f4){logger[_0x3e55('0x10')](_0x3e55('0xc'),_0x2a625b,_0x2c544a[_0x3e55('0x10')][_0x3e55('0x12')]);return _0x4c09c2(_0x2c544a[_0x3e55('0x10')][_0x3e55('0x12')]);}logger[_0x3e55('0x10')](_0x3e55('0xc'),_0x2a625b,_0x2c544a['error']['message']);return _0x2d7439(_0x2c544a['error']['message']);}else{logger[_0x3e55('0xb')](_0x3e55('0xc'),_0x2a625b,_0x3e55('0xd'));_0x2d7439(_0x2c544a[_0x3e55('0x13')]['message']);}})[_0x3e55('0x14')](function(_0x494d6d){logger[_0x3e55('0x10')](_0x3e55('0xc'),_0x2a625b,_0x494d6d);_0x4c09c2(_0x494d6d);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 4e539c5..afbe32a 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(_0x3ee9b2,_0xa090bb){var _0x51ac3e=function(_0x8ba28d){while(--_0x8ba28d){_0x3ee9b2['push'](_0x3ee9b2['shift']());}};_0x51ac3e(++_0xa090bb);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0xcfeff4,_0x3f2e19){var _0xb2fadc=function(_0x4cd013){while(--_0x4cd013){_0xcfeff4['push'](_0xcfeff4['shift']());}};_0xb2fadc(++_0x3f2e19);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index a9dbe4a..de86ed5 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 _0xafdc=['exports','INTEGER','STRING','noop'];(function(_0x33e5a8,_0x3ca3ec){var _0x53faa4=function(_0x385ddb){while(--_0x385ddb){_0x33e5a8['push'](_0x33e5a8['shift']());}};_0x53faa4(++_0x3ca3ec);}(_0xafdc,0x88));var _0xcafd=function(_0x5b0308,_0x50b860){_0x5b0308=_0x5b0308-0x0;var _0x3f0b49=_0xafdc[_0x5b0308];return _0x3f0b49;};'use strict';var Sequelize=require('sequelize');module[_0xcafd('0x0')]={'priority':{'type':Sequelize[_0xcafd('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xcafd('0x2')],'allowNull':![],'defaultValue':_0xcafd('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xcafd('0x2')]},'interval':{'type':Sequelize[_0xcafd('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xaef2=['TEXT','sequelize','exports','STRING','noop'];(function(_0x2a1011,_0x389595){var _0x28dd3c=function(_0x1a73ae){while(--_0x1a73ae){_0x2a1011['push'](_0x2a1011['shift']());}};_0x28dd3c(++_0x389595);}(_0xaef2,0xc9));var _0x2aef=function(_0x5c3d5e,_0x44d78c){_0x5c3d5e=_0x5c3d5e-0x0;var _0x45cd25=_0xaef2[_0x5c3d5e];return _0x45cd25;};'use strict';var Sequelize=require(_0x2aef('0x0'));module[_0x2aef('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2aef('0x2')],'allowNull':![],'defaultValue':_0x2aef('0x3')},'appdata':{'type':Sequelize[_0x2aef('0x4')]()},'description':{'type':Sequelize[_0x2aef('0x2')]},'interval':{'type':Sequelize[_0x2aef('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 13e9fa5..5dfcaff 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 _0xd9dc=['send','params','model','keys','ChatApplication','rawAttributes','query','filters','attributes','fields','length','includeAll','include','merge','find','update','body','destroy','catch','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','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','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','end','sendStatus','error','stack','name'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0xd9dc,0x1be));var _0xcd9d=function(_0x566571,_0x3dc259){_0x566571=_0x566571-0x0;var _0x5b552b=_0xd9dc[_0x566571];return _0x5b552b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcd9d('0x0'));var zipdir=require(_0xcd9d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd9d('0x2'));var moment=require(_0xcd9d('0x3'));var BPromise=require(_0xcd9d('0x4'));var Mustache=require('mustache');var util=require(_0xcd9d('0x5'));var path=require(_0xcd9d('0x6'));var sox=require(_0xcd9d('0x7'));var csv=require(_0xcd9d('0x8'));var ejs=require(_0xcd9d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd9d('0xa'));var squel=require(_0xcd9d('0xb'));var crypto=require(_0xcd9d('0xc'));var jsforce=require(_0xcd9d('0xd'));var deskjs=require(_0xcd9d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcd9d('0xf'));var Papa=require(_0xcd9d('0x10'));var Redis=require(_0xcd9d('0x11'));var authService=require(_0xcd9d('0x12'));var qs=require(_0xcd9d('0x13'));var as=require(_0xcd9d('0x14'));var hardwareService=require(_0xcd9d('0x15'));var logger=require(_0xcd9d('0x16'))('api');var utils=require(_0xcd9d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xcd9d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ec955,_0x3ab0af){_0x3ab0af=_0x3ab0af||0xcc;return function(_0x2fa1d0){if(_0x2fa1d0){return _0x1ec955['sendStatus'](_0x3ab0af);}return _0x1ec955[_0xcd9d('0x19')](_0x3ab0af)['end']();};}function respondWithResult(_0x34bdc8,_0x957089){_0x957089=_0x957089||0xc8;return function(_0x31ddbb){if(_0x31ddbb){return _0x34bdc8['status'](_0x957089)[_0xcd9d('0x1a')](_0x31ddbb);}};}function respondWithFilteredResult(_0x64d51c,_0x50f14d){return function(_0x40d5aa){if(_0x40d5aa){var _0x5a7248=typeof _0x50f14d[_0xcd9d('0x1b')]==='undefined'&&typeof _0x50f14d[_0xcd9d('0x1c')]===_0xcd9d('0x1d');var _0x3a66af=_0x40d5aa[_0xcd9d('0x1e')];var _0x438169=_0x5a7248?0x0:_0x50f14d[_0xcd9d('0x1b')];var _0x24959b=_0x5a7248?_0x40d5aa[_0xcd9d('0x1e')]:_0x50f14d[_0xcd9d('0x1b')]+_0x50f14d[_0xcd9d('0x1c')];var _0x315cf7;if(_0x24959b>=_0x3a66af){_0x24959b=_0x3a66af;_0x315cf7=0xc8;}else{_0x315cf7=0xce;}_0x64d51c['status'](_0x315cf7);return _0x64d51c[_0xcd9d('0x1f')](_0xcd9d('0x20'),_0x438169+'-'+_0x24959b+'/'+_0x3a66af)[_0xcd9d('0x1a')](_0x40d5aa);}return null;};}function patchUpdates(_0x594bd8){return function(_0x2a5848){try{jsonpatch[_0xcd9d('0x21')](_0x2a5848,_0x594bd8,!![]);}catch(_0x376e3e){return BPromise[_0xcd9d('0x22')](_0x376e3e);}return _0x2a5848[_0xcd9d('0x23')]();};}function saveUpdates(_0x2891b6,_0x1e7d4d){return function(_0x12e585){if(_0x12e585){return _0x12e585['update'](_0x2891b6)['then'](function(_0x33d33a){return _0x33d33a;});}return null;};}function removeEntity(_0x222afe,_0x2560fd){return function(_0x474bb4){if(_0x474bb4){return _0x474bb4['destroy']()[_0xcd9d('0x24')](function(){_0x222afe[_0xcd9d('0x19')](0xcc)[_0xcd9d('0x25')]();});}};}function handleEntityNotFound(_0xf0f632,_0x32686a){return function(_0x5ed51f){if(!_0x5ed51f){_0xf0f632[_0xcd9d('0x26')](0x194);}return _0x5ed51f;};}function handleError(_0x1f8579,_0xf21e2){_0xf21e2=_0xf21e2||0x1f4;return function(_0x4ce785){logger[_0xcd9d('0x27')](_0x4ce785[_0xcd9d('0x28')]);if(_0x4ce785[_0xcd9d('0x29')]){delete _0x4ce785['name'];}_0x1f8579[_0xcd9d('0x19')](_0xf21e2)[_0xcd9d('0x2a')](_0x4ce785);};}exports['show']=function(_0x588db6,_0xf84e80){var _0x124da9={'raw':!![],'where':{'id':_0x588db6[_0xcd9d('0x2b')]['id']}},_0x5b1fd6={};_0x5b1fd6[_0xcd9d('0x2c')]=_[_0xcd9d('0x2d')](db[_0xcd9d('0x2e')][_0xcd9d('0x2f')]);_0x5b1fd6['query']=_[_0xcd9d('0x2d')](_0x588db6[_0xcd9d('0x30')]);_0x5b1fd6[_0xcd9d('0x31')]=_['intersection'](_0x5b1fd6[_0xcd9d('0x2c')],_0x5b1fd6[_0xcd9d('0x30')]);_0x124da9[_0xcd9d('0x32')]=_['intersection'](_0x5b1fd6[_0xcd9d('0x2c')],qs[_0xcd9d('0x33')](_0x588db6[_0xcd9d('0x30')][_0xcd9d('0x33')]));_0x124da9['attributes']=_0x124da9['attributes'][_0xcd9d('0x34')]?_0x124da9['attributes']:_0x5b1fd6['model'];if(_0x588db6[_0xcd9d('0x30')][_0xcd9d('0x35')]){_0x124da9[_0xcd9d('0x36')]=[{'all':!![]}];}_0x124da9=_[_0xcd9d('0x37')]({},_0x124da9,_0x588db6['options']);return db['ChatApplication'][_0xcd9d('0x38')](_0x124da9)[_0xcd9d('0x24')](handleEntityNotFound(_0xf84e80,null))[_0xcd9d('0x24')](respondWithResult(_0xf84e80,null))['catch'](handleError(_0xf84e80,null));};exports[_0xcd9d('0x39')]=function(_0x1bd2e8,_0x13553c){if(_0x1bd2e8[_0xcd9d('0x3a')]['id']){delete _0x1bd2e8[_0xcd9d('0x3a')]['id'];}return db[_0xcd9d('0x2e')][_0xcd9d('0x38')]({'where':{'id':_0x1bd2e8[_0xcd9d('0x2b')]['id']}})[_0xcd9d('0x24')](handleEntityNotFound(_0x13553c,null))[_0xcd9d('0x24')](saveUpdates(_0x1bd2e8[_0xcd9d('0x3a')],null))[_0xcd9d('0x24')](respondWithResult(_0x13553c,null))['catch'](handleError(_0x13553c,null));};exports[_0xcd9d('0x3b')]=function(_0x383c1d,_0x5630c7){return db['ChatApplication'][_0xcd9d('0x38')]({'where':{'id':_0x383c1d['params']['id']}})['then'](handleEntityNotFound(_0x5630c7,null))[_0xcd9d('0x24')](removeEntity(_0x5630c7,null))[_0xcd9d('0x3c')](handleError(_0x5630c7,null));};
\ No newline at end of file
+var _0x7ee1=['util','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','send','show','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','length','includeAll','include','options','find','catch','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1bf2a7,_0x305e30){var _0x229282=function(_0x459530){while(--_0x459530){_0x1bf2a7['push'](_0x1bf2a7['shift']());}};_0x229282(++_0x305e30);}(_0x7ee1,0xab));var _0x17ee=function(_0x456a41,_0x293538){_0x456a41=_0x456a41-0x0;var _0x3613cc=_0x7ee1[_0x456a41];return _0x3613cc;};'use strict';var emlformat=require(_0x17ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x17ee('0x1'));var jsonpatch=require(_0x17ee('0x2'));var rp=require(_0x17ee('0x3'));var moment=require(_0x17ee('0x4'));var BPromise=require(_0x17ee('0x5'));var Mustache=require('mustache');var util=require(_0x17ee('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x17ee('0x7'));var ejs=require(_0x17ee('0x8'));var fs=require('fs');var fs_extra=require(_0x17ee('0x9'));var _=require(_0x17ee('0xa'));var squel=require(_0x17ee('0xb'));var crypto=require('crypto');var jsforce=require(_0x17ee('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x17ee('0x7'));var querystring=require(_0x17ee('0xd'));var Papa=require('papaparse');var Redis=require(_0x17ee('0xe'));var authService=require(_0x17ee('0xf'));var qs=require(_0x17ee('0x10'));var as=require(_0x17ee('0x11'));var hardwareService=require(_0x17ee('0x12'));var logger=require(_0x17ee('0x13'))(_0x17ee('0x14'));var utils=require(_0x17ee('0x15'));var config=require(_0x17ee('0x16'));var licenseUtil=require(_0x17ee('0x17'));var db=require(_0x17ee('0x18'))['db'];function respondWithStatusCode(_0x372279,_0x5aa625){_0x5aa625=_0x5aa625||0xcc;return function(_0x2a0f19){if(_0x2a0f19){return _0x372279[_0x17ee('0x19')](_0x5aa625);}return _0x372279['status'](_0x5aa625)[_0x17ee('0x1a')]();};}function respondWithResult(_0x53a2c2,_0x2f452e){_0x2f452e=_0x2f452e||0xc8;return function(_0x27447d){if(_0x27447d){return _0x53a2c2[_0x17ee('0x1b')](_0x2f452e)[_0x17ee('0x1c')](_0x27447d);}};}function respondWithFilteredResult(_0x5eebbc,_0x3fa583){return function(_0x749078){if(_0x749078){var _0x1b09a3=typeof _0x3fa583['offset']===_0x17ee('0x1d')&&typeof _0x3fa583[_0x17ee('0x1e')]===_0x17ee('0x1d');var _0x384eaa=_0x749078[_0x17ee('0x1f')];var _0x3785ed=_0x1b09a3?0x0:_0x3fa583[_0x17ee('0x20')];var _0x5506a3=_0x1b09a3?_0x749078['count']:_0x3fa583[_0x17ee('0x20')]+_0x3fa583[_0x17ee('0x1e')];var _0x1f8fb;if(_0x5506a3>=_0x384eaa){_0x5506a3=_0x384eaa;_0x1f8fb=0xc8;}else{_0x1f8fb=0xce;}_0x5eebbc[_0x17ee('0x1b')](_0x1f8fb);return _0x5eebbc['set'](_0x17ee('0x21'),_0x3785ed+'-'+_0x5506a3+'/'+_0x384eaa)[_0x17ee('0x1c')](_0x749078);}return null;};}function patchUpdates(_0x25782c){return function(_0x3ace7f){try{jsonpatch['apply'](_0x3ace7f,_0x25782c,!![]);}catch(_0x2354a5){return BPromise[_0x17ee('0x22')](_0x2354a5);}return _0x3ace7f[_0x17ee('0x23')]();};}function saveUpdates(_0x54daae,_0x3672df){return function(_0x2d0297){if(_0x2d0297){return _0x2d0297[_0x17ee('0x24')](_0x54daae)[_0x17ee('0x25')](function(_0x3aee75){return _0x3aee75;});}return null;};}function removeEntity(_0x4804ea,_0x249a48){return function(_0xc01da5){if(_0xc01da5){return _0xc01da5[_0x17ee('0x26')]()[_0x17ee('0x25')](function(){_0x4804ea[_0x17ee('0x1b')](0xcc)[_0x17ee('0x1a')]();});}};}function handleEntityNotFound(_0x13e8ff,_0x51a282){return function(_0x4f24a8){if(!_0x4f24a8){_0x13e8ff[_0x17ee('0x19')](0x194);}return _0x4f24a8;};}function handleError(_0x1e24bf,_0x34040a){_0x34040a=_0x34040a||0x1f4;return function(_0x32b311){logger[_0x17ee('0x27')](_0x32b311[_0x17ee('0x28')]);if(_0x32b311['name']){delete _0x32b311['name'];}_0x1e24bf[_0x17ee('0x1b')](_0x34040a)[_0x17ee('0x29')](_0x32b311);};}exports[_0x17ee('0x2a')]=function(_0x5ea202,_0x393231){var _0x34b003={'raw':!![],'where':{'id':_0x5ea202['params']['id']}},_0x954455={};_0x954455[_0x17ee('0x2b')]=_[_0x17ee('0x2c')](db[_0x17ee('0x2d')][_0x17ee('0x2e')]);_0x954455['query']=_[_0x17ee('0x2c')](_0x5ea202[_0x17ee('0x2f')]);_0x954455[_0x17ee('0x30')]=_['intersection'](_0x954455[_0x17ee('0x2b')],_0x954455['query']);_0x34b003[_0x17ee('0x31')]=_[_0x17ee('0x32')](_0x954455[_0x17ee('0x2b')],qs['fields'](_0x5ea202[_0x17ee('0x2f')]['fields']));_0x34b003[_0x17ee('0x31')]=_0x34b003[_0x17ee('0x31')][_0x17ee('0x33')]?_0x34b003[_0x17ee('0x31')]:_0x954455['model'];if(_0x5ea202[_0x17ee('0x2f')][_0x17ee('0x34')]){_0x34b003[_0x17ee('0x35')]=[{'all':!![]}];}_0x34b003=_['merge']({},_0x34b003,_0x5ea202[_0x17ee('0x36')]);return db[_0x17ee('0x2d')][_0x17ee('0x37')](_0x34b003)['then'](handleEntityNotFound(_0x393231,null))[_0x17ee('0x25')](respondWithResult(_0x393231,null))[_0x17ee('0x38')](handleError(_0x393231,null));};exports[_0x17ee('0x24')]=function(_0x35602f,_0x1e3c2f){if(_0x35602f[_0x17ee('0x39')]['id']){delete _0x35602f[_0x17ee('0x39')]['id'];}return db[_0x17ee('0x2d')][_0x17ee('0x37')]({'where':{'id':_0x35602f[_0x17ee('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1e3c2f,null))[_0x17ee('0x25')](saveUpdates(_0x35602f[_0x17ee('0x39')],null))[_0x17ee('0x25')](respondWithResult(_0x1e3c2f,null))[_0x17ee('0x38')](handleError(_0x1e3c2f,null));};exports[_0x17ee('0x26')]=function(_0x754d3f,_0x2d6afc){return db[_0x17ee('0x2d')][_0x17ee('0x37')]({'where':{'id':_0x754d3f[_0x17ee('0x3a')]['id']}})[_0x17ee('0x25')](handleEntityNotFound(_0x2d6afc,null))['then'](removeEntity(_0x2d6afc,null))[_0x17ee('0x38')](handleError(_0x2d6afc,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 75a714d..1751119 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 _0xd4f4=['./chatApplication.attributes','exports','define','chat_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5aa0e3,_0x27a0d0){var _0x3483c1=function(_0x4a8a4c){while(--_0x4a8a4c){_0x5aa0e3['push'](_0x5aa0e3['shift']());}};_0x3483c1(++_0x27a0d0);}(_0xd4f4,0x6d));var _0x4d4f=function(_0x410763,_0xb60a9b){_0x410763=_0x410763-0x0;var _0x46f210=_0xd4f4[_0x410763];return _0x46f210;};'use strict';var _=require(_0x4d4f('0x0'));var util=require('util');var logger=require(_0x4d4f('0x1'))(_0x4d4f('0x2'));var moment=require(_0x4d4f('0x3'));var BPromise=require(_0x4d4f('0x4'));var rp=require(_0x4d4f('0x5'));var fs=require('fs');var path=require(_0x4d4f('0x6'));var rimraf=require('rimraf');var config=require(_0x4d4f('0x7'));var attributes=require(_0x4d4f('0x8'));module[_0x4d4f('0x9')]=function(_0x2dc2e7,_0x41efae){return _0x2dc2e7[_0x4d4f('0xa')]('ChatApplication',attributes,{'tableName':_0x4d4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4d4f('0xc')});};
\ No newline at end of file
+var _0x587e=['bluebird','request-promise','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','lodash','util','../../config/logger','api','moment'];(function(_0x1c5d60,_0x41c949){var _0x5e09be=function(_0x28b010){while(--_0x28b010){_0x1c5d60['push'](_0x1c5d60['shift']());}};_0x5e09be(++_0x41c949);}(_0x587e,0xa3));var _0xe587=function(_0x17ce2f,_0x4ca1f1){_0x17ce2f=_0x17ce2f-0x0;var _0x393d6f=_0x587e[_0x17ce2f];return _0x393d6f;};'use strict';var _=require(_0xe587('0x0'));var util=require(_0xe587('0x1'));var logger=require(_0xe587('0x2'))(_0xe587('0x3'));var moment=require(_0xe587('0x4'));var BPromise=require(_0xe587('0x5'));var rp=require(_0xe587('0x6'));var fs=require('fs');var path=require(_0xe587('0x7'));var rimraf=require('rimraf');var config=require(_0xe587('0x8'));var attributes=require(_0xe587('0x9'));module[_0xe587('0xa')]=function(_0x20e45d,_0x48abcf){return _0x20e45d[_0xe587('0xb')](_0xe587('0xc'),attributes,{'tableName':_0xe587('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 63970af..3eda93a 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 _0x344c=['../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc'];(function(_0x41c01f,_0x4f3e1c){var _0x32701d=function(_0x547f4b){while(--_0x547f4b){_0x41c01f['push'](_0x41c01f['shift']());}};_0x32701d(++_0x4f3e1c);}(_0x344c,0x117));var _0xc344=function(_0x259b20,_0x3c5446){_0x259b20=_0x259b20-0x0;var _0x324642=_0x344c[_0x259b20];return _0x324642;};'use strict';var _=require(_0xc344('0x0'));var util=require(_0xc344('0x1'));var moment=require(_0xc344('0x2'));var BPromise=require(_0xc344('0x3'));var rs=require(_0xc344('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc344('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc344('0x6'));var config=require(_0xc344('0x7'));var jayson=require(_0xc344('0x8'));var client=jayson[_0xc344('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42cf33,_0x34e8f3,_0x4a8b21){return new BPromise(function(_0x18dcac,_0x5697ae){return client[_0xc344('0xa')](_0x42cf33,_0x4a8b21)[_0xc344('0xb')](function(_0x1cb0e1){logger[_0xc344('0xc')](_0xc344('0xd'),_0x34e8f3,_0xc344('0xe'));logger[_0xc344('0xf')](_0xc344('0x10'),_0x34e8f3,_0xc344('0xe'),JSON['stringify'](_0x1cb0e1));if(_0x1cb0e1[_0xc344('0x11')]){if(_0x1cb0e1['error'][_0xc344('0x12')]===0x1f4){logger[_0xc344('0x11')](_0xc344('0xd'),_0x34e8f3,_0x1cb0e1[_0xc344('0x11')]['message']);return _0x5697ae(_0x1cb0e1['error'][_0xc344('0x13')]);}logger['error'](_0xc344('0xd'),_0x34e8f3,_0x1cb0e1[_0xc344('0x11')][_0xc344('0x13')]);return _0x18dcac(_0x1cb0e1[_0xc344('0x11')]['message']);}else{logger[_0xc344('0xc')](_0xc344('0xd'),_0x34e8f3,'request\x20sent');_0x18dcac(_0x1cb0e1[_0xc344('0x14')]['message']);}})[_0xc344('0x15')](function(_0xb5b3bd){logger[_0xc344('0x11')]('ChatApplication,\x20%s,\x20%s',_0x34e8f3,_0xb5b3bd);_0x5697ae(_0xb5b3bd);});});}
\ No newline at end of file
+var _0xb9e7=['request','then','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http'];(function(_0x6a13ee,_0x31dea8){var _0x5413be=function(_0x1ae2f8){while(--_0x1ae2f8){_0x6a13ee['push'](_0x6a13ee['shift']());}};_0x5413be(++_0x31dea8);}(_0xb9e7,0x1d9));var _0x7b9e=function(_0x1d94d1,_0x347bb8){_0x1d94d1=_0x1d94d1-0x0;var _0x23c397=_0xb9e7[_0x1d94d1];return _0x23c397;};'use strict';var _=require('lodash');var util=require(_0x7b9e('0x0'));var moment=require(_0x7b9e('0x1'));var BPromise=require(_0x7b9e('0x2'));var rs=require(_0x7b9e('0x3'));var fs=require('fs');var Redis=require(_0x7b9e('0x4'));var db=require(_0x7b9e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7b9e('0x6'));var jayson=require(_0x7b9e('0x7'));var client=jayson[_0x7b9e('0x8')][_0x7b9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x588f3f,_0x14a251,_0x29008f){return new BPromise(function(_0x243b6f,_0x2fc661){return client[_0x7b9e('0xa')](_0x588f3f,_0x29008f)[_0x7b9e('0xb')](function(_0x1e5ecd){logger['info'](_0x7b9e('0xc'),_0x14a251,'request\x20sent');logger[_0x7b9e('0xd')](_0x7b9e('0xe'),_0x14a251,'request\x20sent',JSON[_0x7b9e('0xf')](_0x1e5ecd));if(_0x1e5ecd[_0x7b9e('0x10')]){if(_0x1e5ecd['error']['code']===0x1f4){logger['error'](_0x7b9e('0xc'),_0x14a251,_0x1e5ecd[_0x7b9e('0x10')]['message']);return _0x2fc661(_0x1e5ecd[_0x7b9e('0x10')][_0x7b9e('0x11')]);}logger[_0x7b9e('0x10')](_0x7b9e('0xc'),_0x14a251,_0x1e5ecd[_0x7b9e('0x10')]['message']);return _0x243b6f(_0x1e5ecd[_0x7b9e('0x10')][_0x7b9e('0x11')]);}else{logger[_0x7b9e('0x12')](_0x7b9e('0xc'),_0x14a251,_0x7b9e('0x13'));_0x243b6f(_0x1e5ecd['result'][_0x7b9e('0x11')]);}})[_0x7b9e('0x14')](function(_0x38c9fe){logger[_0x7b9e('0x10')](_0x7b9e('0xc'),_0x14a251,_0x38c9fe);_0x2fc661(_0x38c9fe);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index fa58c4f..e0a25d1 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 _0xaa74=['../../components/auth/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','util','path','connect-timeout','Router'];(function(_0x487cad,_0x5ba159){var _0x484e8d=function(_0x3a83d1){while(--_0x3a83d1){_0x487cad['push'](_0x487cad['shift']());}};_0x484e8d(++_0x5ba159);}(_0xaa74,0xc0));var _0x4aa7=function(_0x3f0d11,_0x568808){_0x3f0d11=_0x3f0d11-0x0;var _0xdc0af7=_0xaa74[_0x3f0d11];return _0xdc0af7;};'use strict';var multer=require('multer');var util=require(_0x4aa7('0x0'));var path=require(_0x4aa7('0x1'));var timeout=require(_0x4aa7('0x2'));var express=require('express');var router=express[_0x4aa7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4aa7('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4aa7('0x5'));router[_0x4aa7('0x6')](_0x4aa7('0x7'),auth[_0x4aa7('0x8')](),controller[_0x4aa7('0x9')]);router[_0x4aa7('0xa')](_0x4aa7('0x7'),auth[_0x4aa7('0x8')](),controller[_0x4aa7('0xb')]);router[_0x4aa7('0xc')](_0x4aa7('0x7'),auth[_0x4aa7('0x8')](),controller[_0x4aa7('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x6dd6=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x6dd6,0x6e));var _0x66dd=function(_0x26253d,_0x5dfc80){_0x26253d=_0x26253d-0x0;var _0x318a82=_0x6dd6[_0x26253d];return _0x318a82;};'use strict';var multer=require(_0x66dd('0x0'));var util=require(_0x66dd('0x1'));var path=require(_0x66dd('0x2'));var timeout=require(_0x66dd('0x3'));var express=require(_0x66dd('0x4'));var router=express[_0x66dd('0x5')]();var fs_extra=require(_0x66dd('0x6'));var auth=require(_0x66dd('0x7'));var interaction=require(_0x66dd('0x8'));var config=require(_0x66dd('0x9'));var controller=require('./chatApplication.controller');router[_0x66dd('0xa')](_0x66dd('0xb'),auth[_0x66dd('0xc')](),controller[_0x66dd('0xd')]);router[_0x66dd('0xe')](_0x66dd('0xb'),auth[_0x66dd('0xc')](),controller[_0x66dd('0xf')]);router[_0x66dd('0x10')](_0x66dd('0xb'),auth[_0x66dd('0xc')](),controller[_0x66dd('0x11')]);module[_0x66dd('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 9eef057..c610479 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 _0x299a=['exports','STRING','sequelize'];(function(_0xa89062,_0x39415c){var _0x6604ed=function(_0x4ce55b){while(--_0x4ce55b){_0xa89062['push'](_0xa89062['shift']());}};_0x6604ed(++_0x39415c);}(_0x299a,0x161));var _0xa299=function(_0x4f9f72,_0x47cab2){_0x4f9f72=_0x4f9f72-0x0;var _0x2edb06=_0x299a[_0x4f9f72];return _0x2edb06;};'use strict';var Sequelize=require(_0xa299('0x0'));module[_0xa299('0x1')]={'name':{'type':Sequelize[_0xa299('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa299('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x4975=['STRING','BOOLEAN','sequelize'];(function(_0x7c7fa3,_0x1028ea){var _0x378ab7=function(_0x477d05){while(--_0x477d05){_0x7c7fa3['push'](_0x7c7fa3['shift']());}};_0x378ab7(++_0x1028ea);}(_0x4975,0x86));var _0x5497=function(_0x1d6f4d,_0x454598){_0x1d6f4d=_0x1d6f4d-0x0;var _0x38dfef=_0x4975[_0x1d6f4d];return _0x38dfef;};'use strict';var Sequelize=require(_0x5497('0x0'));module['exports']={'name':{'type':Sequelize[_0x5497('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5497('0x1')]},'write':{'type':Sequelize[_0x5497('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 348aa74..6807993 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 _0x47ed=['api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','User','removeMembers','addMessage','ChatGroupId','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x38eae1,_0x3e0429){var _0x6611b7=function(_0x4dbb2f){while(--_0x4dbb2f){_0x38eae1['push'](_0x38eae1['shift']());}};_0x6611b7(++_0x3e0429);}(_0x47ed,0xac));var _0xd47e=function(_0xd76974,_0x1526e2){_0xd76974=_0xd76974-0x0;var _0x3b4a03=_0x47ed[_0xd76974];return _0x3b4a03;};'use strict';var emlformat=require(_0xd47e('0x0'));var rimraf=require(_0xd47e('0x1'));var zipdir=require(_0xd47e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd47e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd47e('0x4'));var path=require(_0xd47e('0x5'));var sox=require(_0xd47e('0x6'));var csv=require(_0xd47e('0x7'));var ejs=require(_0xd47e('0x8'));var fs=require('fs');var fs_extra=require(_0xd47e('0x9'));var _=require(_0xd47e('0xa'));var squel=require(_0xd47e('0xb'));var crypto=require(_0xd47e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd47e('0xd'));var toCsv=require(_0xd47e('0x7'));var querystring=require(_0xd47e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd47e('0xf'));var qs=require(_0xd47e('0x10'));var as=require(_0xd47e('0x11'));var hardwareService=require(_0xd47e('0x12'));var logger=require(_0xd47e('0x13'))(_0xd47e('0x14'));var utils=require('../../config/utils');var config=require(_0xd47e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd47e('0x16'))['db'];config[_0xd47e('0x17')]=_[_0xd47e('0x18')](config['redis'],{'host':_0xd47e('0x19'),'port':0x18eb});var socket=require(_0xd47e('0x1a'))(new Redis(config['redis']));require('./chatGroup.socket')[_0xd47e('0x1b')](socket);function respondWithStatusCode(_0x5e036f,_0x3893c0){_0x3893c0=_0x3893c0||0xcc;return function(_0x54b4a0){if(_0x54b4a0){return _0x5e036f[_0xd47e('0x1c')](_0x3893c0);}return _0x5e036f[_0xd47e('0x1d')](_0x3893c0)['end']();};}function respondWithResult(_0x27818d,_0x2422f0){_0x2422f0=_0x2422f0||0xc8;return function(_0x1ef43f){if(_0x1ef43f){return _0x27818d[_0xd47e('0x1d')](_0x2422f0)[_0xd47e('0x1e')](_0x1ef43f);}};}function respondWithFilteredResult(_0x277789,_0x16a87d){return function(_0x20a462){if(_0x20a462){var _0x37fa28=typeof _0x16a87d[_0xd47e('0x1f')]==='undefined'&&typeof _0x16a87d[_0xd47e('0x20')]==='undefined';var _0x3c82af=_0x20a462[_0xd47e('0x21')];var _0x5c7d79=_0x37fa28?0x0:_0x16a87d['offset'];var _0x29c63e=_0x37fa28?_0x20a462['count']:_0x16a87d['offset']+_0x16a87d['limit'];var _0x4377de;if(_0x29c63e>=_0x3c82af){_0x29c63e=_0x3c82af;_0x4377de=0xc8;}else{_0x4377de=0xce;}_0x277789[_0xd47e('0x1d')](_0x4377de);return _0x277789[_0xd47e('0x22')](_0xd47e('0x23'),_0x5c7d79+'-'+_0x29c63e+'/'+_0x3c82af)['json'](_0x20a462);}return null;};}function patchUpdates(_0x359a11){return function(_0x5908a3){try{jsonpatch[_0xd47e('0x24')](_0x5908a3,_0x359a11,!![]);}catch(_0x55d20a){return BPromise[_0xd47e('0x25')](_0x55d20a);}return _0x5908a3['save']();};}function saveUpdates(_0x360c32,_0x1a83ee){return function(_0x4c33a5){if(_0x4c33a5){return _0x4c33a5[_0xd47e('0x26')](_0x360c32)[_0xd47e('0x27')](function(_0x15a104){return _0x15a104;});}return null;};}function removeEntity(_0x1241c8,_0x476687){return function(_0x352fd7){if(_0x352fd7){return _0x352fd7[_0xd47e('0x28')]()['then'](function(){_0x1241c8[_0xd47e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f0641,_0x1c7a82){return function(_0x18903b){if(!_0x18903b){_0x5f0641['sendStatus'](0x194);}return _0x18903b;};}function handleError(_0x4f25e4,_0x5507b6){_0x5507b6=_0x5507b6||0x1f4;return function(_0x3fd468){logger[_0xd47e('0x29')](_0x3fd468['stack']);if(_0x3fd468[_0xd47e('0x2a')]){delete _0x3fd468[_0xd47e('0x2a')];}_0x4f25e4[_0xd47e('0x1d')](_0x5507b6)[_0xd47e('0x2b')](_0x3fd468);};}exports[_0xd47e('0x2c')]=function(_0x49bbfe,_0x26afa6){var _0x32f69b={},_0x164a34={},_0x1fa475={'count':0x0,'rows':[]};var _0x14d83b=_[_0xd47e('0x2d')](db[_0xd47e('0x2e')][_0xd47e('0x2f')],function(_0x40d12f){return{'name':_0x40d12f[_0xd47e('0x30')],'type':_0x40d12f[_0xd47e('0x31')][_0xd47e('0x32')]};});_0x164a34[_0xd47e('0x33')]=_[_0xd47e('0x2d')](_0x14d83b,_0xd47e('0x2a'));_0x164a34['query']=_[_0xd47e('0x34')](_0x49bbfe['query']);_0x164a34[_0xd47e('0x35')]=_[_0xd47e('0x36')](_0x164a34[_0xd47e('0x33')],_0x164a34[_0xd47e('0x37')]);_0x32f69b[_0xd47e('0x38')]=_[_0xd47e('0x36')](_0x164a34[_0xd47e('0x33')],qs[_0xd47e('0x39')](_0x49bbfe['query']['fields']));_0x32f69b[_0xd47e('0x38')]=_0x32f69b[_0xd47e('0x38')][_0xd47e('0x3a')]?_0x32f69b[_0xd47e('0x38')]:_0x164a34[_0xd47e('0x33')];if(!_0x49bbfe[_0xd47e('0x37')][_0xd47e('0x3b')](_0xd47e('0x3c'))){_0x32f69b['limit']=qs[_0xd47e('0x20')](_0x49bbfe[_0xd47e('0x37')]['limit']);_0x32f69b[_0xd47e('0x1f')]=qs[_0xd47e('0x1f')](_0x49bbfe[_0xd47e('0x37')][_0xd47e('0x1f')]);}_0x32f69b[_0xd47e('0x3d')]=qs[_0xd47e('0x3e')](_0x49bbfe['query'][_0xd47e('0x3e')]);_0x32f69b['where']=qs[_0xd47e('0x35')](_[_0xd47e('0x3f')](_0x49bbfe[_0xd47e('0x37')],_0x164a34[_0xd47e('0x35')]),_0x14d83b);if(_0x49bbfe[_0xd47e('0x37')]['filter']){_0x32f69b[_0xd47e('0x40')]=_[_0xd47e('0x41')](_0x32f69b['where'],{'$or':_[_0xd47e('0x2d')](_0x14d83b,function(_0xee7294){if(_0xee7294[_0xd47e('0x31')]!=='VIRTUAL'){var _0x1fb8bf={};_0x1fb8bf[_0xee7294[_0xd47e('0x2a')]]={'$like':'%'+_0x49bbfe['query'][_0xd47e('0x42')]+'%'};return _0x1fb8bf;}})});}_0x32f69b=_[_0xd47e('0x41')]({},_0x32f69b,_0x49bbfe[_0xd47e('0x43')]);var _0x4ffabb={'where':_0x32f69b[_0xd47e('0x40')]};return db[_0xd47e('0x2e')][_0xd47e('0x21')](_0x4ffabb)[_0xd47e('0x27')](function(_0x67787d){_0x1fa475[_0xd47e('0x21')]=_0x67787d;if(_0x49bbfe['query'][_0xd47e('0x44')]){_0x32f69b['include']=[{'all':!![]}];}return db[_0xd47e('0x2e')][_0xd47e('0x45')](_0x32f69b);})['then'](function(_0x1e3b9a){_0x1fa475[_0xd47e('0x46')]=_0x1e3b9a;return _0x1fa475;})[_0xd47e('0x27')](respondWithFilteredResult(_0x26afa6,_0x32f69b))[_0xd47e('0x47')](handleError(_0x26afa6,null));};exports[_0xd47e('0x48')]=function(_0xefd94b,_0x2262fb){var _0x57c0c6={'raw':!![],'where':{'id':_0xefd94b[_0xd47e('0x49')]['id']}},_0x3d813d={};_0x3d813d[_0xd47e('0x33')]=_[_0xd47e('0x34')](db[_0xd47e('0x2e')][_0xd47e('0x2f')]);_0x3d813d['query']=_[_0xd47e('0x34')](_0xefd94b[_0xd47e('0x37')]);_0x3d813d[_0xd47e('0x35')]=_[_0xd47e('0x36')](_0x3d813d[_0xd47e('0x33')],_0x3d813d['query']);_0x57c0c6[_0xd47e('0x38')]=_[_0xd47e('0x36')](_0x3d813d[_0xd47e('0x33')],qs[_0xd47e('0x39')](_0xefd94b[_0xd47e('0x37')][_0xd47e('0x39')]));_0x57c0c6['attributes']=_0x57c0c6['attributes']['length']?_0x57c0c6[_0xd47e('0x38')]:_0x3d813d[_0xd47e('0x33')];if(_0xefd94b[_0xd47e('0x37')]['includeAll']){_0x57c0c6[_0xd47e('0x4a')]=[{'all':!![]}];}_0x57c0c6=_[_0xd47e('0x41')]({},_0x57c0c6,_0xefd94b[_0xd47e('0x43')]);return db[_0xd47e('0x2e')][_0xd47e('0x4b')](_0x57c0c6)['then'](handleEntityNotFound(_0x2262fb,null))['then'](respondWithResult(_0x2262fb,null))['catch'](handleError(_0x2262fb,null));};exports[_0xd47e('0x4c')]=function(_0x57ec34,_0x463cf7){return db[_0xd47e('0x2e')][_0xd47e('0x4c')](_0x57ec34[_0xd47e('0x4d')],{})[_0xd47e('0x27')](respondWithResult(_0x463cf7,0xc9))[_0xd47e('0x47')](handleError(_0x463cf7,null));};exports[_0xd47e('0x26')]=function(_0x482109,_0x521e08){if(_0x482109[_0xd47e('0x4d')]['id']){delete _0x482109['body']['id'];}return db[_0xd47e('0x2e')][_0xd47e('0x4b')]({'where':{'id':_0x482109[_0xd47e('0x49')]['id']}})[_0xd47e('0x27')](handleEntityNotFound(_0x521e08,null))[_0xd47e('0x27')](saveUpdates(_0x482109[_0xd47e('0x4d')],null))[_0xd47e('0x27')](respondWithResult(_0x521e08,null))[_0xd47e('0x47')](handleError(_0x521e08,null));};exports[_0xd47e('0x28')]=function(_0x2c157b,_0x37aa9b){return db[_0xd47e('0x2e')][_0xd47e('0x4b')]({'where':{'id':_0x2c157b['params']['id']}})[_0xd47e('0x27')](handleEntityNotFound(_0x37aa9b,null))[_0xd47e('0x27')](removeEntity(_0x37aa9b,null))['catch'](handleError(_0x37aa9b,null));};exports[_0xd47e('0x4e')]=function(_0xdd2c73,_0x3e3686){return db[_0xd47e('0x2e')]['describe']()[_0xd47e('0x27')](respondWithResult(_0x3e3686,null))[_0xd47e('0x47')](handleError(_0x3e3686,null));};exports[_0xd47e('0x4f')]=function(_0x5bb3b9,_0x4b57c6,_0x283483){return db[_0xd47e('0x50')][_0xd47e('0x21')]({'where':{'ChatGroupId':_0x5bb3b9[_0xd47e('0x49')]['id'],'ToId':_0x5bb3b9[_0xd47e('0x51')]['id'],'read':![]}})[_0xd47e('0x27')](function(_0x1d4038){return{'id':_[_0xd47e('0x52')](_0x5bb3b9['params']['id']),'count':_0x1d4038};})[_0xd47e('0x27')](respondWithResult(_0x4b57c6,null))['catch'](handleError(_0x4b57c6,null));};exports[_0xd47e('0x53')]=function(_0x31057a,_0x3f384e,_0x1fc7b1){return db[_0xd47e('0x2e')][_0xd47e('0x4b')]({'where':{'id':_0x31057a['params']['id']}})[_0xd47e('0x27')](handleEntityNotFound(_0x3f384e,null))[_0xd47e('0x27')](function(_0x2de51f){if(_0x2de51f){return _0x2de51f[_0xd47e('0x53')](_0x31057a[_0xd47e('0x4d')][_0xd47e('0x54')],_[_0xd47e('0x55')](_0x31057a['body'],['ids','id'])||{});}})[_0xd47e('0x27')](respondWithResult(_0x3f384e,null))[_0xd47e('0x47')](handleError(_0x3f384e,null));};exports[_0xd47e('0x56')]=function(_0x52ad75,_0x3785ef,_0x59dc50){var _0x280376={};var _0x42fb12={};var _0x2dfe2b;var _0x409b74;return db[_0xd47e('0x2e')]['findOne']({'where':{'id':_0x52ad75[_0xd47e('0x49')]['id']}})[_0xd47e('0x27')](handleEntityNotFound(_0x3785ef,null))['then'](function(_0x5a1a81){if(_0x5a1a81){_0x2dfe2b=_0x5a1a81;_0x42fb12[_0xd47e('0x33')]=_['keys'](db[_0xd47e('0x57')][_0xd47e('0x2f')]);_0x42fb12[_0xd47e('0x37')]=_[_0xd47e('0x34')](_0x52ad75[_0xd47e('0x37')]);_0x42fb12[_0xd47e('0x35')]=_[_0xd47e('0x36')](_0x42fb12['model'],_0x42fb12['query']);_0x280376[_0xd47e('0x38')]=_[_0xd47e('0x36')](_0x42fb12['model'],qs[_0xd47e('0x39')](_0x52ad75[_0xd47e('0x37')][_0xd47e('0x39')]));_0x280376[_0xd47e('0x38')]=_0x280376[_0xd47e('0x38')][_0xd47e('0x3a')]?_0x280376[_0xd47e('0x38')]:_0x42fb12[_0xd47e('0x33')];_0x280376[_0xd47e('0x3d')]=qs[_0xd47e('0x3e')](_0x52ad75[_0xd47e('0x37')][_0xd47e('0x3e')]);_0x280376[_0xd47e('0x40')]=qs[_0xd47e('0x35')](_[_0xd47e('0x3f')](_0x52ad75[_0xd47e('0x37')],_0x42fb12[_0xd47e('0x35')]));if(_0x52ad75['query'][_0xd47e('0x42')]){_0x280376[_0xd47e('0x40')]=_[_0xd47e('0x41')](_0x280376['where'],{'$or':_[_0xd47e('0x2d')](_0x280376['attributes'],function(_0x33f910){var _0x3c64cf={};_0x3c64cf[_0x33f910]={'$like':'%'+_0x52ad75[_0xd47e('0x37')][_0xd47e('0x42')]+'%'};return _0x3c64cf;})});}_0x280376=_[_0xd47e('0x41')]({},_0x280376,_0x52ad75[_0xd47e('0x43')]);return _0x2dfe2b[_0xd47e('0x56')](_0x280376);}})['then'](function(_0x43b802){if(_0x43b802){_0x409b74=_0x43b802[_0xd47e('0x3a')];if(!_0x52ad75[_0xd47e('0x37')][_0xd47e('0x3b')]('nolimit')){_0x280376[_0xd47e('0x20')]=qs[_0xd47e('0x20')](_0x52ad75[_0xd47e('0x37')][_0xd47e('0x20')]);_0x280376['offset']=qs[_0xd47e('0x1f')](_0x52ad75[_0xd47e('0x37')][_0xd47e('0x1f')]);}return _0x2dfe2b['getMembers'](_0x280376);}})[_0xd47e('0x27')](function(_0x40769e){if(_0x40769e){return _0x40769e?{'count':_0x409b74,'rows':_0x40769e}:null;}})[_0xd47e('0x27')](respondWithResult(_0x3785ef,null))[_0xd47e('0x47')](handleError(_0x3785ef,null));};exports[_0xd47e('0x58')]=function(_0x1cba31,_0x2ea866,_0x4f5f03){return db['ChatGroup']['find']({'where':{'id':_0x1cba31[_0xd47e('0x49')]['id']}})[_0xd47e('0x27')](handleEntityNotFound(_0x2ea866,null))[_0xd47e('0x27')](function(_0x184c73){if(_0x184c73){return _0x184c73['removeMembers'](_0x1cba31[_0xd47e('0x37')][_0xd47e('0x54')]);}})[_0xd47e('0x27')](respondWithStatusCode(_0x2ea866,null))[_0xd47e('0x47')](handleError(_0x2ea866,null));};exports[_0xd47e('0x59')]=function(_0x2ee2c9,_0x5680f4,_0x3565e9){if(_0x2ee2c9[_0xd47e('0x4d')]['id']){delete _0x2ee2c9[_0xd47e('0x4d')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x2ee2c9[_0xd47e('0x49')]['id']}})[_0xd47e('0x27')](handleEntityNotFound(_0x5680f4,null))['then'](function(_0x2db2ce){if(_0x2db2ce){_0x2ee2c9[_0xd47e('0x4d')][_0xd47e('0x5a')]=_0x2db2ce['id'];return db[_0xd47e('0x50')][_0xd47e('0x4c')](_0x2ee2c9[_0xd47e('0x4d')]);}})[_0xd47e('0x27')](respondWithResult(_0x5680f4,null))[_0xd47e('0x47')](handleError(_0x5680f4,null));};exports['getMessages']=function(_0x42b529,_0x5a507b,_0x1aa93d){var _0x196a5e={};var _0x3c0e1a={};var _0x1b83e4;var _0x1dfc69;return db[_0xd47e('0x2e')][_0xd47e('0x5b')]({'where':{'id':_0x42b529[_0xd47e('0x49')]['id']}})[_0xd47e('0x27')](handleEntityNotFound(_0x5a507b,null))[_0xd47e('0x27')](function(_0x6d05e7){if(_0x6d05e7){_0x1b83e4=_0x6d05e7;_0x3c0e1a[_0xd47e('0x33')]=_[_0xd47e('0x34')](db[_0xd47e('0x50')][_0xd47e('0x2f')]);_0x3c0e1a[_0xd47e('0x37')]=_[_0xd47e('0x34')](_0x42b529['query']);_0x3c0e1a[_0xd47e('0x35')]=_['intersection'](_0x3c0e1a[_0xd47e('0x33')],_0x3c0e1a['query']);_0x196a5e[_0xd47e('0x38')]=_[_0xd47e('0x36')](_0x3c0e1a[_0xd47e('0x33')],qs[_0xd47e('0x39')](_0x42b529[_0xd47e('0x37')][_0xd47e('0x39')]));_0x196a5e[_0xd47e('0x38')]=_0x196a5e[_0xd47e('0x38')]['length']?_0x196a5e[_0xd47e('0x38')]:_0x3c0e1a[_0xd47e('0x33')];_0x196a5e[_0xd47e('0x3d')]=qs[_0xd47e('0x3e')](_0x42b529['query'][_0xd47e('0x3e')]);_0x196a5e[_0xd47e('0x40')]=qs['filters'](_[_0xd47e('0x3f')](_0x42b529[_0xd47e('0x37')],_0x3c0e1a[_0xd47e('0x35')]));if(_0x42b529[_0xd47e('0x37')]['filter']){_0x196a5e[_0xd47e('0x40')]=_[_0xd47e('0x41')](_0x196a5e[_0xd47e('0x40')],{'$or':_[_0xd47e('0x2d')](_0x196a5e[_0xd47e('0x38')],function(_0x4b871e){var _0x43135a={};_0x43135a[_0x4b871e]={'$like':'%'+_0x42b529[_0xd47e('0x37')][_0xd47e('0x42')]+'%'};return _0x43135a;})});}if(_0x42b529[_0xd47e('0x37')]['$gte']){var _0x186d4d=_0x42b529['query'][_0xd47e('0x5c')][_0xd47e('0x5d')](',');var _0x3ee7ab={};_0x3ee7ab[_0x186d4d[0x0]]={'$gte':moment(_0x186d4d[0x1])['format'](_0xd47e('0x5e'))};_0x196a5e[_0xd47e('0x40')]=_[_0xd47e('0x41')](_0x196a5e['where'],_0x3ee7ab);}_0x196a5e=_['merge']({},_0x196a5e,_0x42b529['options']);return _0x1b83e4[_0xd47e('0x5f')](_0x196a5e);}})['then'](function(_0x4aa02c){if(_0x4aa02c){_0x1dfc69=_0x4aa02c['length'];if(!_0x42b529[_0xd47e('0x37')][_0xd47e('0x3b')](_0xd47e('0x3c'))){_0x196a5e[_0xd47e('0x20')]=qs[_0xd47e('0x20')](_0x42b529[_0xd47e('0x37')][_0xd47e('0x20')]);_0x196a5e['offset']=qs[_0xd47e('0x1f')](_0x42b529[_0xd47e('0x37')]['offset']);}return _0x1b83e4[_0xd47e('0x5f')](_0x196a5e);}})['then'](function(_0x376c5b){if(_0x376c5b){return _0x376c5b?{'count':_0x1dfc69,'rows':_0x376c5b}:null;}})[_0xd47e('0x27')](respondWithResult(_0x5a507b,null))[_0xd47e('0x47')](handleError(_0x5a507b,null));};
\ No newline at end of file
+var _0xc32f=['sendStatus','error','stack','name','index','map','rawAttributes','type','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','ChatGroup','include','findAll','rows','catch','show','params','includeAll','merge','find','create','body','update','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','findOne','User','order','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then'];(function(_0x389318,_0x13a53d){var _0x7919e3=function(_0x2985d1){while(--_0x2985d1){_0x389318['push'](_0x389318['shift']());}};_0x7919e3(++_0x13a53d);}(_0xc32f,0x15c));var _0xfc32=function(_0x47bf99,_0x19f81f){_0x47bf99=_0x47bf99-0x0;var _0x24e2c=_0xc32f[_0x47bf99];return _0x24e2c;};'use strict';var emlformat=require(_0xfc32('0x0'));var rimraf=require(_0xfc32('0x1'));var zipdir=require(_0xfc32('0x2'));var jsonpatch=require(_0xfc32('0x3'));var rp=require(_0xfc32('0x4'));var moment=require(_0xfc32('0x5'));var BPromise=require(_0xfc32('0x6'));var Mustache=require(_0xfc32('0x7'));var util=require('util');var path=require(_0xfc32('0x8'));var sox=require(_0xfc32('0x9'));var csv=require('to-csv');var ejs=require(_0xfc32('0xa'));var fs=require('fs');var fs_extra=require(_0xfc32('0xb'));var _=require('lodash');var squel=require(_0xfc32('0xc'));var crypto=require(_0xfc32('0xd'));var jsforce=require(_0xfc32('0xe'));var deskjs=require(_0xfc32('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfc32('0x10'));var Papa=require(_0xfc32('0x11'));var Redis=require(_0xfc32('0x12'));var authService=require(_0xfc32('0x13'));var qs=require(_0xfc32('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xfc32('0x15'));var config=require(_0xfc32('0x16'));var licenseUtil=require(_0xfc32('0x17'));var db=require(_0xfc32('0x18'))['db'];config[_0xfc32('0x19')]=_[_0xfc32('0x1a')](config[_0xfc32('0x19')],{'host':_0xfc32('0x1b'),'port':0x18eb});var socket=require(_0xfc32('0x1c'))(new Redis(config[_0xfc32('0x19')]));require(_0xfc32('0x1d'))[_0xfc32('0x1e')](socket);function respondWithStatusCode(_0x1e7a1f,_0x5097a4){_0x5097a4=_0x5097a4||0xcc;return function(_0x5a5b64){if(_0x5a5b64){return _0x1e7a1f['sendStatus'](_0x5097a4);}return _0x1e7a1f[_0xfc32('0x1f')](_0x5097a4)[_0xfc32('0x20')]();};}function respondWithResult(_0x472730,_0x15f95d){_0x15f95d=_0x15f95d||0xc8;return function(_0x653c28){if(_0x653c28){return _0x472730['status'](_0x15f95d)[_0xfc32('0x21')](_0x653c28);}};}function respondWithFilteredResult(_0xdb72b0,_0x24b6f8){return function(_0x590202){if(_0x590202){var _0x681e29=typeof _0x24b6f8[_0xfc32('0x22')]===_0xfc32('0x23')&&typeof _0x24b6f8['limit']===_0xfc32('0x23');var _0x2a637b=_0x590202[_0xfc32('0x24')];var _0x40b15e=_0x681e29?0x0:_0x24b6f8[_0xfc32('0x22')];var _0x2a0374=_0x681e29?_0x590202[_0xfc32('0x24')]:_0x24b6f8['offset']+_0x24b6f8[_0xfc32('0x25')];var _0x1763c0;if(_0x2a0374>=_0x2a637b){_0x2a0374=_0x2a637b;_0x1763c0=0xc8;}else{_0x1763c0=0xce;}_0xdb72b0[_0xfc32('0x1f')](_0x1763c0);return _0xdb72b0[_0xfc32('0x26')](_0xfc32('0x27'),_0x40b15e+'-'+_0x2a0374+'/'+_0x2a637b)[_0xfc32('0x21')](_0x590202);}return null;};}function patchUpdates(_0x2f7952){return function(_0x32aa67){try{jsonpatch[_0xfc32('0x28')](_0x32aa67,_0x2f7952,!![]);}catch(_0x230561){return BPromise[_0xfc32('0x29')](_0x230561);}return _0x32aa67[_0xfc32('0x2a')]();};}function saveUpdates(_0x240506,_0x3b3ed7){return function(_0x266085){if(_0x266085){return _0x266085['update'](_0x240506)[_0xfc32('0x2b')](function(_0x33b7f0){return _0x33b7f0;});}return null;};}function removeEntity(_0x2fd5c1,_0x476aff){return function(_0x4d9a3e){if(_0x4d9a3e){return _0x4d9a3e['destroy']()[_0xfc32('0x2b')](function(){_0x2fd5c1[_0xfc32('0x1f')](0xcc)[_0xfc32('0x20')]();});}};}function handleEntityNotFound(_0x343852,_0x342c73){return function(_0x1443a1){if(!_0x1443a1){_0x343852[_0xfc32('0x2c')](0x194);}return _0x1443a1;};}function handleError(_0x4043e7,_0x3b452a){_0x3b452a=_0x3b452a||0x1f4;return function(_0x203579){logger[_0xfc32('0x2d')](_0x203579[_0xfc32('0x2e')]);if(_0x203579[_0xfc32('0x2f')]){delete _0x203579['name'];}_0x4043e7['status'](_0x3b452a)['send'](_0x203579);};}exports[_0xfc32('0x30')]=function(_0x1bf3ac,_0xa31fd){var _0x5a1a0c={},_0x2e3a76={},_0x3caba6={'count':0x0,'rows':[]};var _0x37767d=_[_0xfc32('0x31')](db['ChatGroup'][_0xfc32('0x32')],function(_0x6ef6fe){return{'name':_0x6ef6fe['fieldName'],'type':_0x6ef6fe[_0xfc32('0x33')]['key']};});_0x2e3a76['model']=_[_0xfc32('0x31')](_0x37767d,_0xfc32('0x2f'));_0x2e3a76['query']=_[_0xfc32('0x34')](_0x1bf3ac[_0xfc32('0x35')]);_0x2e3a76[_0xfc32('0x36')]=_[_0xfc32('0x37')](_0x2e3a76[_0xfc32('0x38')],_0x2e3a76[_0xfc32('0x35')]);_0x5a1a0c['attributes']=_[_0xfc32('0x37')](_0x2e3a76[_0xfc32('0x38')],qs[_0xfc32('0x39')](_0x1bf3ac[_0xfc32('0x35')][_0xfc32('0x39')]));_0x5a1a0c[_0xfc32('0x3a')]=_0x5a1a0c[_0xfc32('0x3a')][_0xfc32('0x3b')]?_0x5a1a0c[_0xfc32('0x3a')]:_0x2e3a76['model'];if(!_0x1bf3ac['query'][_0xfc32('0x3c')](_0xfc32('0x3d'))){_0x5a1a0c[_0xfc32('0x25')]=qs[_0xfc32('0x25')](_0x1bf3ac[_0xfc32('0x35')][_0xfc32('0x25')]);_0x5a1a0c[_0xfc32('0x22')]=qs['offset'](_0x1bf3ac[_0xfc32('0x35')]['offset']);}_0x5a1a0c['order']=qs[_0xfc32('0x3e')](_0x1bf3ac[_0xfc32('0x35')][_0xfc32('0x3e')]);_0x5a1a0c[_0xfc32('0x3f')]=qs[_0xfc32('0x36')](_[_0xfc32('0x40')](_0x1bf3ac[_0xfc32('0x35')],_0x2e3a76[_0xfc32('0x36')]),_0x37767d);if(_0x1bf3ac[_0xfc32('0x35')][_0xfc32('0x41')]){_0x5a1a0c[_0xfc32('0x3f')]=_['merge'](_0x5a1a0c[_0xfc32('0x3f')],{'$or':_['map'](_0x37767d,function(_0x138803){if(_0x138803['type']!=='VIRTUAL'){var _0x3e6d25={};_0x3e6d25[_0x138803[_0xfc32('0x2f')]]={'$like':'%'+_0x1bf3ac[_0xfc32('0x35')]['filter']+'%'};return _0x3e6d25;}})});}_0x5a1a0c=_['merge']({},_0x5a1a0c,_0x1bf3ac[_0xfc32('0x42')]);var _0x1d48bb={'where':_0x5a1a0c['where']};return db[_0xfc32('0x43')]['count'](_0x1d48bb)[_0xfc32('0x2b')](function(_0x2cdeb4){_0x3caba6[_0xfc32('0x24')]=_0x2cdeb4;if(_0x1bf3ac['query']['includeAll']){_0x5a1a0c[_0xfc32('0x44')]=[{'all':!![]}];}return db[_0xfc32('0x43')][_0xfc32('0x45')](_0x5a1a0c);})['then'](function(_0x544b8f){_0x3caba6[_0xfc32('0x46')]=_0x544b8f;return _0x3caba6;})[_0xfc32('0x2b')](respondWithFilteredResult(_0xa31fd,_0x5a1a0c))[_0xfc32('0x47')](handleError(_0xa31fd,null));};exports[_0xfc32('0x48')]=function(_0x484d28,_0x31bbcb){var _0x23baca={'raw':!![],'where':{'id':_0x484d28[_0xfc32('0x49')]['id']}},_0x2116b5={};_0x2116b5[_0xfc32('0x38')]=_[_0xfc32('0x34')](db[_0xfc32('0x43')][_0xfc32('0x32')]);_0x2116b5[_0xfc32('0x35')]=_[_0xfc32('0x34')](_0x484d28['query']);_0x2116b5[_0xfc32('0x36')]=_['intersection'](_0x2116b5['model'],_0x2116b5[_0xfc32('0x35')]);_0x23baca['attributes']=_['intersection'](_0x2116b5['model'],qs[_0xfc32('0x39')](_0x484d28[_0xfc32('0x35')][_0xfc32('0x39')]));_0x23baca[_0xfc32('0x3a')]=_0x23baca[_0xfc32('0x3a')][_0xfc32('0x3b')]?_0x23baca[_0xfc32('0x3a')]:_0x2116b5[_0xfc32('0x38')];if(_0x484d28[_0xfc32('0x35')][_0xfc32('0x4a')]){_0x23baca[_0xfc32('0x44')]=[{'all':!![]}];}_0x23baca=_[_0xfc32('0x4b')]({},_0x23baca,_0x484d28['options']);return db['ChatGroup'][_0xfc32('0x4c')](_0x23baca)[_0xfc32('0x2b')](handleEntityNotFound(_0x31bbcb,null))['then'](respondWithResult(_0x31bbcb,null))[_0xfc32('0x47')](handleError(_0x31bbcb,null));};exports['create']=function(_0x454cf7,_0x34555e){return db[_0xfc32('0x43')][_0xfc32('0x4d')](_0x454cf7[_0xfc32('0x4e')],{})[_0xfc32('0x2b')](respondWithResult(_0x34555e,0xc9))[_0xfc32('0x47')](handleError(_0x34555e,null));};exports[_0xfc32('0x4f')]=function(_0x3d8764,_0x41890c){if(_0x3d8764['body']['id']){delete _0x3d8764[_0xfc32('0x4e')]['id'];}return db[_0xfc32('0x43')]['find']({'where':{'id':_0x3d8764[_0xfc32('0x49')]['id']}})[_0xfc32('0x2b')](handleEntityNotFound(_0x41890c,null))['then'](saveUpdates(_0x3d8764['body'],null))[_0xfc32('0x2b')](respondWithResult(_0x41890c,null))[_0xfc32('0x47')](handleError(_0x41890c,null));};exports[_0xfc32('0x50')]=function(_0x2fecdc,_0x2067be){return db[_0xfc32('0x43')][_0xfc32('0x4c')]({'where':{'id':_0x2fecdc[_0xfc32('0x49')]['id']}})[_0xfc32('0x2b')](handleEntityNotFound(_0x2067be,null))['then'](removeEntity(_0x2067be,null))[_0xfc32('0x47')](handleError(_0x2067be,null));};exports['describe']=function(_0x40eec5,_0x3ea19e){return db[_0xfc32('0x43')][_0xfc32('0x51')]()[_0xfc32('0x2b')](respondWithResult(_0x3ea19e,null))['catch'](handleError(_0x3ea19e,null));};exports[_0xfc32('0x52')]=function(_0x1cccb4,_0x366c11,_0x580ad1){return db[_0xfc32('0x53')][_0xfc32('0x24')]({'where':{'ChatGroupId':_0x1cccb4[_0xfc32('0x49')]['id'],'ToId':_0x1cccb4['user']['id'],'read':![]}})[_0xfc32('0x2b')](function(_0x595632){return{'id':_[_0xfc32('0x54')](_0x1cccb4[_0xfc32('0x49')]['id']),'count':_0x595632};})[_0xfc32('0x2b')](respondWithResult(_0x366c11,null))['catch'](handleError(_0x366c11,null));};exports[_0xfc32('0x55')]=function(_0x1c9373,_0x2d5904,_0x4abbfa){return db[_0xfc32('0x43')][_0xfc32('0x4c')]({'where':{'id':_0x1c9373[_0xfc32('0x49')]['id']}})[_0xfc32('0x2b')](handleEntityNotFound(_0x2d5904,null))[_0xfc32('0x2b')](function(_0x491251){if(_0x491251){return _0x491251[_0xfc32('0x55')](_0x1c9373['body'][_0xfc32('0x56')],_[_0xfc32('0x57')](_0x1c9373[_0xfc32('0x4e')],[_0xfc32('0x56'),'id'])||{});}})[_0xfc32('0x2b')](respondWithResult(_0x2d5904,null))[_0xfc32('0x47')](handleError(_0x2d5904,null));};exports['getMembers']=function(_0x26d197,_0x23185c,_0x33c176){var _0x574f68={};var _0x29e686={};var _0x67938c;var _0x3de520;return db[_0xfc32('0x43')][_0xfc32('0x58')]({'where':{'id':_0x26d197[_0xfc32('0x49')]['id']}})[_0xfc32('0x2b')](handleEntityNotFound(_0x23185c,null))[_0xfc32('0x2b')](function(_0x5e692b){if(_0x5e692b){_0x67938c=_0x5e692b;_0x29e686[_0xfc32('0x38')]=_[_0xfc32('0x34')](db[_0xfc32('0x59')]['rawAttributes']);_0x29e686['query']=_[_0xfc32('0x34')](_0x26d197['query']);_0x29e686[_0xfc32('0x36')]=_[_0xfc32('0x37')](_0x29e686[_0xfc32('0x38')],_0x29e686[_0xfc32('0x35')]);_0x574f68[_0xfc32('0x3a')]=_['intersection'](_0x29e686[_0xfc32('0x38')],qs[_0xfc32('0x39')](_0x26d197[_0xfc32('0x35')][_0xfc32('0x39')]));_0x574f68['attributes']=_0x574f68[_0xfc32('0x3a')][_0xfc32('0x3b')]?_0x574f68[_0xfc32('0x3a')]:_0x29e686[_0xfc32('0x38')];_0x574f68[_0xfc32('0x5a')]=qs[_0xfc32('0x3e')](_0x26d197[_0xfc32('0x35')]['sort']);_0x574f68['where']=qs[_0xfc32('0x36')](_['pick'](_0x26d197[_0xfc32('0x35')],_0x29e686['filters']));if(_0x26d197['query']['filter']){_0x574f68[_0xfc32('0x3f')]=_[_0xfc32('0x4b')](_0x574f68[_0xfc32('0x3f')],{'$or':_['map'](_0x574f68[_0xfc32('0x3a')],function(_0x1b8076){var _0x1edd8c={};_0x1edd8c[_0x1b8076]={'$like':'%'+_0x26d197[_0xfc32('0x35')][_0xfc32('0x41')]+'%'};return _0x1edd8c;})});}_0x574f68=_[_0xfc32('0x4b')]({},_0x574f68,_0x26d197['options']);return _0x67938c[_0xfc32('0x5b')](_0x574f68);}})['then'](function(_0x222d51){if(_0x222d51){_0x3de520=_0x222d51[_0xfc32('0x3b')];if(!_0x26d197[_0xfc32('0x35')][_0xfc32('0x3c')](_0xfc32('0x3d'))){_0x574f68[_0xfc32('0x25')]=qs['limit'](_0x26d197['query'][_0xfc32('0x25')]);_0x574f68['offset']=qs[_0xfc32('0x22')](_0x26d197['query']['offset']);}return _0x67938c['getMembers'](_0x574f68);}})['then'](function(_0x4dd1dc){if(_0x4dd1dc){return _0x4dd1dc?{'count':_0x3de520,'rows':_0x4dd1dc}:null;}})[_0xfc32('0x2b')](respondWithResult(_0x23185c,null))[_0xfc32('0x47')](handleError(_0x23185c,null));};exports[_0xfc32('0x5c')]=function(_0x4ce7a2,_0x3c60b5,_0x11aa92){return db[_0xfc32('0x43')][_0xfc32('0x4c')]({'where':{'id':_0x4ce7a2[_0xfc32('0x49')]['id']}})[_0xfc32('0x2b')](handleEntityNotFound(_0x3c60b5,null))['then'](function(_0x22259a){if(_0x22259a){return _0x22259a['removeMembers'](_0x4ce7a2[_0xfc32('0x35')][_0xfc32('0x56')]);}})[_0xfc32('0x2b')](respondWithStatusCode(_0x3c60b5,null))[_0xfc32('0x47')](handleError(_0x3c60b5,null));};exports[_0xfc32('0x5d')]=function(_0x1cccc7,_0x5598af,_0x47bae5){if(_0x1cccc7[_0xfc32('0x4e')]['id']){delete _0x1cccc7[_0xfc32('0x4e')]['id'];}return db[_0xfc32('0x43')][_0xfc32('0x4c')]({'where':{'id':_0x1cccc7[_0xfc32('0x49')]['id']}})[_0xfc32('0x2b')](handleEntityNotFound(_0x5598af,null))[_0xfc32('0x2b')](function(_0x200c58){if(_0x200c58){_0x1cccc7[_0xfc32('0x4e')][_0xfc32('0x5e')]=_0x200c58['id'];return db[_0xfc32('0x53')][_0xfc32('0x4d')](_0x1cccc7['body']);}})[_0xfc32('0x2b')](respondWithResult(_0x5598af,null))['catch'](handleError(_0x5598af,null));};exports[_0xfc32('0x5f')]=function(_0x45aed4,_0x332345,_0xeaa84e){var _0x4116b9={};var _0x503c8f={};var _0x8dc04b;var _0x2bea8e;return db['ChatGroup'][_0xfc32('0x58')]({'where':{'id':_0x45aed4[_0xfc32('0x49')]['id']}})[_0xfc32('0x2b')](handleEntityNotFound(_0x332345,null))['then'](function(_0xaf3d71){if(_0xaf3d71){_0x8dc04b=_0xaf3d71;_0x503c8f['model']=_['keys'](db[_0xfc32('0x53')][_0xfc32('0x32')]);_0x503c8f[_0xfc32('0x35')]=_['keys'](_0x45aed4[_0xfc32('0x35')]);_0x503c8f[_0xfc32('0x36')]=_[_0xfc32('0x37')](_0x503c8f[_0xfc32('0x38')],_0x503c8f[_0xfc32('0x35')]);_0x4116b9[_0xfc32('0x3a')]=_[_0xfc32('0x37')](_0x503c8f[_0xfc32('0x38')],qs['fields'](_0x45aed4[_0xfc32('0x35')][_0xfc32('0x39')]));_0x4116b9[_0xfc32('0x3a')]=_0x4116b9[_0xfc32('0x3a')][_0xfc32('0x3b')]?_0x4116b9[_0xfc32('0x3a')]:_0x503c8f[_0xfc32('0x38')];_0x4116b9[_0xfc32('0x5a')]=qs['sort'](_0x45aed4['query'][_0xfc32('0x3e')]);_0x4116b9[_0xfc32('0x3f')]=qs[_0xfc32('0x36')](_[_0xfc32('0x40')](_0x45aed4['query'],_0x503c8f[_0xfc32('0x36')]));if(_0x45aed4[_0xfc32('0x35')][_0xfc32('0x41')]){_0x4116b9[_0xfc32('0x3f')]=_[_0xfc32('0x4b')](_0x4116b9[_0xfc32('0x3f')],{'$or':_[_0xfc32('0x31')](_0x4116b9[_0xfc32('0x3a')],function(_0x236ceb){var _0x5549ee={};_0x5549ee[_0x236ceb]={'$like':'%'+_0x45aed4[_0xfc32('0x35')][_0xfc32('0x41')]+'%'};return _0x5549ee;})});}if(_0x45aed4[_0xfc32('0x35')][_0xfc32('0x60')]){var _0x48930b=_0x45aed4[_0xfc32('0x35')][_0xfc32('0x60')][_0xfc32('0x61')](',');var _0x4ae544={};_0x4ae544[_0x48930b[0x0]]={'$gte':moment(_0x48930b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4116b9[_0xfc32('0x3f')]=_[_0xfc32('0x4b')](_0x4116b9[_0xfc32('0x3f')],_0x4ae544);}_0x4116b9=_['merge']({},_0x4116b9,_0x45aed4[_0xfc32('0x42')]);return _0x8dc04b['getMessages'](_0x4116b9);}})['then'](function(_0x1c3814){if(_0x1c3814){_0x2bea8e=_0x1c3814[_0xfc32('0x3b')];if(!_0x45aed4[_0xfc32('0x35')][_0xfc32('0x3c')](_0xfc32('0x3d'))){_0x4116b9[_0xfc32('0x25')]=qs[_0xfc32('0x25')](_0x45aed4[_0xfc32('0x35')][_0xfc32('0x25')]);_0x4116b9[_0xfc32('0x22')]=qs[_0xfc32('0x22')](_0x45aed4[_0xfc32('0x35')][_0xfc32('0x22')]);}return _0x8dc04b[_0xfc32('0x5f')](_0x4116b9);}})[_0xfc32('0x2b')](function(_0xbabbc3){if(_0xbabbc3){return _0xbabbc3?{'count':_0x2bea8e,'rows':_0xbabbc3}:null;}})[_0xfc32('0x2b')](respondWithResult(_0x332345,null))[_0xfc32('0x47')](handleError(_0x332345,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 75d3cb5..90d5b95 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 _0x0adf=['ChatGroup','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x433275,_0x1937e1){var _0x2d5fcf=function(_0x11f393){while(--_0x11f393){_0x433275['push'](_0x433275['shift']());}};_0x2d5fcf(++_0x1937e1);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x1de5bf,_0x186874){_0x1de5bf=_0x1de5bf-0x0;var _0x208287=_0x0adf[_0x1de5bf];return _0x208287;};'use strict';var EventEmitter=require(_0xf0ad('0x0'));var ChatGroup=require(_0xf0ad('0x1'))['db'][_0xf0ad('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf0ad('0x3'),'afterUpdate':_0xf0ad('0x4'),'afterDestroy':_0xf0ad('0x5')};function emitEvent(_0x187aa4){return function(_0x27d666,_0x459e70,_0x719547){ChatGroupEvents['emit'](_0x187aa4+':'+_0x27d666['id'],_0x27d666);ChatGroupEvents[_0xf0ad('0x6')](_0x187aa4,_0x27d666);_0x719547(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xf0ad('0x7')](e,emitEvent(event));}}module[_0xf0ad('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x94ff=['remove','emit','hook','events','save','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x94ff,0xc3));var _0xf94f=function(_0x5ca300,_0x3dcd24){_0x5ca300=_0x5ca300-0x0;var _0x4a36fc=_0x94ff[_0x5ca300];return _0x4a36fc;};'use strict';var EventEmitter=require(_0xf94f('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf94f('0x1'),'afterUpdate':_0xf94f('0x2'),'afterDestroy':_0xf94f('0x3')};function emitEvent(_0x56e032){return function(_0xf166cb,_0x44677c,_0x48ce3b){ChatGroupEvents[_0xf94f('0x4')](_0x56e032+':'+_0xf166cb['id'],_0xf166cb);ChatGroupEvents[_0xf94f('0x4')](_0x56e032,_0xf166cb);_0x48ce3b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xf94f('0x5')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 1a35dfc..dcfa382 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 _0x4d9d=['lodash','util','request-promise','path','./chatGroup.attributes','exports','define','ChatGroup','chat_groups'];(function(_0x2ba59c,_0x182e51){var _0x190c42=function(_0x4ccc53){while(--_0x4ccc53){_0x2ba59c['push'](_0x2ba59c['shift']());}};_0x190c42(++_0x182e51);}(_0x4d9d,0x1cb));var _0xd4d9=function(_0x36aa05,_0x3117cc){_0x36aa05=_0x36aa05-0x0;var _0x293263=_0x4d9d[_0x36aa05];return _0x293263;};'use strict';var _=require(_0xd4d9('0x0'));var util=require(_0xd4d9('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd4d9('0x2'));var fs=require('fs');var path=require(_0xd4d9('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd4d9('0x4'));module[_0xd4d9('0x5')]=function(_0x1349f5,_0x1ca32d){return _0x1349f5[_0xd4d9('0x6')](_0xd4d9('0x7'),attributes,{'tableName':_0xd4d9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ff8=['moment','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api'];(function(_0x7ff21e,_0x36ea9b){var _0x571cd5=function(_0x43c3f3){while(--_0x43c3f3){_0x7ff21e['push'](_0x7ff21e['shift']());}};_0x571cd5(++_0x36ea9b);}(_0x9ff8,0x194));var _0x89ff=function(_0x206c7b,_0x742356){_0x206c7b=_0x206c7b-0x0;var _0xc49fec=_0x9ff8[_0x206c7b];return _0xc49fec;};'use strict';var _=require(_0x89ff('0x0'));var util=require(_0x89ff('0x1'));var logger=require(_0x89ff('0x2'))(_0x89ff('0x3'));var moment=require(_0x89ff('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x89ff('0x5'));var rimraf=require(_0x89ff('0x6'));var config=require(_0x89ff('0x7'));var attributes=require(_0x89ff('0x8'));module['exports']=function(_0x344497,_0x4470f5){return _0x344497[_0x89ff('0x9')](_0x89ff('0xa'),attributes,{'tableName':_0x89ff('0xb'),'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 8199381..539fd8b 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 _0x252f=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x252f,0x1e2));var _0xf252=function(_0x4b4517,_0x5dbf6a){_0x4b4517=_0x4b4517-0x0;var _0x48278b=_0x252f[_0x4b4517];return _0x48278b;};'use strict';var _=require(_0xf252('0x0'));var util=require('util');var moment=require(_0xf252('0x1'));var BPromise=require(_0xf252('0x2'));var rs=require(_0xf252('0x3'));var fs=require('fs');var Redis=require(_0xf252('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf252('0x5'));var logger=require(_0xf252('0x6'))(_0xf252('0x7'));var config=require(_0xf252('0x8'));var jayson=require(_0xf252('0x9'));var client=jayson[_0xf252('0xa')][_0xf252('0xb')]({'port':0x232a});config[_0xf252('0xc')]=_[_0xf252('0xd')](config[_0xf252('0xc')],{'host':_0xf252('0xe'),'port':0x18eb});var socket=require(_0xf252('0xf'))(new Redis(config['redis']));require(_0xf252('0x10'))['register'](socket);function respondWithRpcPromise(_0x4fa847,_0x1eab3b,_0x1486ab){return new BPromise(function(_0x4668ff,_0x6d04ce){return client[_0xf252('0x11')](_0x4fa847,_0x1486ab)[_0xf252('0x12')](function(_0xc9b64b){logger[_0xf252('0x13')](_0xf252('0x14'),_0x1eab3b,_0xf252('0x15'));logger[_0xf252('0x16')](_0xf252('0x17'),_0x1eab3b,_0xf252('0x15'),JSON[_0xf252('0x18')](_0xc9b64b));if(_0xc9b64b['error']){if(_0xc9b64b[_0xf252('0x19')][_0xf252('0x1a')]===0x1f4){logger[_0xf252('0x19')](_0xf252('0x14'),_0x1eab3b,_0xc9b64b[_0xf252('0x19')][_0xf252('0x1b')]);return _0x6d04ce(_0xc9b64b['error'][_0xf252('0x1b')]);}logger['error'](_0xf252('0x14'),_0x1eab3b,_0xc9b64b[_0xf252('0x19')][_0xf252('0x1b')]);return _0x4668ff(_0xc9b64b[_0xf252('0x19')][_0xf252('0x1b')]);}else{logger[_0xf252('0x13')]('ChatGroup,\x20%s,\x20%s',_0x1eab3b,_0xf252('0x15'));_0x4668ff(_0xc9b64b[_0xf252('0x1c')][_0xf252('0x1b')]);}})[_0xf252('0x1d')](function(_0x58cc9c){logger[_0xf252('0x19')]('ChatGroup,\x20%s,\x20%s',_0x1eab3b,_0x58cc9c);_0x6d04ce(_0x58cc9c);});});}
\ No newline at end of file
+var _0x70e9=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','util','moment'];(function(_0x2bfa86,_0x34bb3c){var _0xf15627=function(_0x3a930d){while(--_0x3a930d){_0x2bfa86['push'](_0x2bfa86['shift']());}};_0xf15627(++_0x34bb3c);}(_0x70e9,0x193));var _0x970e=function(_0x219ab9,_0x37e2c1){_0x219ab9=_0x219ab9-0x0;var _0x2191ae=_0x70e9[_0x219ab9];return _0x2191ae;};'use strict';var _=require('lodash');var util=require(_0x970e('0x0'));var moment=require(_0x970e('0x1'));var BPromise=require('bluebird');var rs=require(_0x970e('0x2'));var fs=require('fs');var Redis=require(_0x970e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x970e('0x4'));var logger=require('../../config/logger')(_0x970e('0x5'));var config=require(_0x970e('0x6'));var jayson=require(_0x970e('0x7'));var client=jayson[_0x970e('0x8')][_0x970e('0x9')]({'port':0x232a});config[_0x970e('0xa')]=_[_0x970e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x970e('0xc'))(new Redis(config[_0x970e('0xa')]));require('./chatGroup.socket')[_0x970e('0xd')](socket);function respondWithRpcPromise(_0x2140e5,_0x1d3fec,_0x4853e7){return new BPromise(function(_0x17256c,_0x285e82){return client[_0x970e('0xe')](_0x2140e5,_0x4853e7)[_0x970e('0xf')](function(_0x28a551){logger[_0x970e('0x10')]('ChatGroup,\x20%s,\x20%s',_0x1d3fec,_0x970e('0x11'));logger[_0x970e('0x12')](_0x970e('0x13'),_0x1d3fec,_0x970e('0x11'),JSON[_0x970e('0x14')](_0x28a551));if(_0x28a551[_0x970e('0x15')]){if(_0x28a551[_0x970e('0x15')][_0x970e('0x16')]===0x1f4){logger['error'](_0x970e('0x17'),_0x1d3fec,_0x28a551[_0x970e('0x15')]['message']);return _0x285e82(_0x28a551[_0x970e('0x15')][_0x970e('0x18')]);}logger[_0x970e('0x15')](_0x970e('0x17'),_0x1d3fec,_0x28a551['error'][_0x970e('0x18')]);return _0x17256c(_0x28a551[_0x970e('0x15')][_0x970e('0x18')]);}else{logger[_0x970e('0x10')]('ChatGroup,\x20%s,\x20%s',_0x1d3fec,'request\x20sent');_0x17256c(_0x28a551[_0x970e('0x19')][_0x970e('0x18')]);}})[_0x970e('0x1a')](function(_0x53c841){logger[_0x970e('0x15')](_0x970e('0x17'),_0x1d3fec,_0x53c841);_0x285e82(_0x53c841);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 7c77897..01cacc2 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 _0x586a=['./chatGroup.events','save','emit','removeListener','register','length'];(function(_0x55fb83,_0x1d3856){var _0x59a87a=function(_0x38bdd1){while(--_0x38bdd1){_0x55fb83['push'](_0x55fb83['shift']());}};_0x59a87a(++_0x1d3856);}(_0x586a,0x18c));var _0xa586=function(_0x266cca,_0x50b778){_0x266cca=_0x266cca-0x0;var _0x13afcd=_0x586a[_0x266cca];return _0x13afcd;};'use strict';var ChatGroupEvents=require(_0xa586('0x0'));var events=[_0xa586('0x1'),'remove','update'];function createListener(_0x2a7b2e,_0x1a2344){return function(_0x1a43d9){_0x1a2344[_0xa586('0x2')](_0x2a7b2e,_0x1a43d9);};}function removeListener(_0x2ee46b,_0x15558a){return function(){ChatGroupEvents[_0xa586('0x3')](_0x2ee46b,_0x15558a);};}exports[_0xa586('0x4')]=function(_0x32b1ce){for(var _0x460241=0x0,_0x43b7ab=events[_0xa586('0x5')];_0x460241<_0x43b7ab;_0x460241++){var _0x326d1e=events[_0x460241];var _0x599e7f=createListener('chatGroup:'+_0x326d1e,_0x32b1ce);ChatGroupEvents['on'](_0x326d1e,_0x599e7f);}};
\ No newline at end of file
+var _0xfde6=['update','emit','removeListener','register','chatGroup:'];(function(_0x2c4a85,_0x58a6a7){var _0x261607=function(_0xf2ad92){while(--_0xf2ad92){_0x2c4a85['push'](_0x2c4a85['shift']());}};_0x261607(++_0x58a6a7);}(_0xfde6,0x19f));var _0x6fde=function(_0x2e48c9,_0x4fd904){_0x2e48c9=_0x2e48c9-0x0;var _0x392a1c=_0xfde6[_0x2e48c9];return _0x392a1c;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save','remove',_0x6fde('0x0')];function createListener(_0x53969c,_0x4259c8){return function(_0x5baac8){_0x4259c8[_0x6fde('0x1')](_0x53969c,_0x5baac8);};}function removeListener(_0x3f1616,_0x1e9964){return function(){ChatGroupEvents[_0x6fde('0x2')](_0x3f1616,_0x1e9964);};}exports[_0x6fde('0x3')]=function(_0x432e33){for(var _0x141ad1=0x0,_0xaa87ce=events['length'];_0x141ad1<_0xaa87ce;_0x141ad1++){var _0x4b122e=events[_0x141ad1];var _0x3a3798=createListener(_0x6fde('0x4')+_0x4b122e,_0x432e33);ChatGroupEvents['on'](_0x4b122e,_0x3a3798);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 2adc184..cef69ed 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 _0x325c=['isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','create','addMembers','/:id/messages','update','delete','destroy','removeMembers','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get'];(function(_0x3d0757,_0x216f9f){var _0x3761f9=function(_0x4af33c){while(--_0x4af33c){_0x3d0757['push'](_0x3d0757['shift']());}};_0x3761f9(++_0x216f9f);}(_0x325c,0x9a));var _0xc325=function(_0x36ad30,_0x5d0352){_0x36ad30=_0x36ad30-0x0;var _0x3e83e4=_0x325c[_0x36ad30];return _0x3e83e4;};'use strict';var multer=require(_0xc325('0x0'));var util=require('util');var path=require(_0xc325('0x1'));var timeout=require('connect-timeout');var express=require(_0xc325('0x2'));var router=express['Router']();var fs_extra=require(_0xc325('0x3'));var auth=require(_0xc325('0x4'));var interaction=require(_0xc325('0x5'));var config=require('../../config/environment');var controller=require(_0xc325('0x6'));router[_0xc325('0x7')]('/',auth[_0xc325('0x8')](),controller['index']);router['get'](_0xc325('0x9'),auth[_0xc325('0x8')](),controller[_0xc325('0xa')]);router[_0xc325('0x7')](_0xc325('0xb'),auth[_0xc325('0x8')](),controller[_0xc325('0xc')]);router[_0xc325('0x7')](_0xc325('0xd'),auth[_0xc325('0x8')](),controller[_0xc325('0xe')]);router[_0xc325('0x7')](_0xc325('0xf'),auth[_0xc325('0x8')](),controller[_0xc325('0x10')]);router[_0xc325('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0xc325('0x11')]);router[_0xc325('0x12')]('/',auth[_0xc325('0x8')](),controller[_0xc325('0x13')]);router[_0xc325('0x12')]('/:id/members',auth[_0xc325('0x8')](),controller[_0xc325('0x14')]);router[_0xc325('0x12')](_0xc325('0x15'),auth[_0xc325('0x8')](),controller['addMessage']);router['put'](_0xc325('0xb'),auth[_0xc325('0x8')](),controller[_0xc325('0x16')]);router[_0xc325('0x17')](_0xc325('0xb'),auth[_0xc325('0x8')](),controller[_0xc325('0x18')]);router['delete'](_0xc325('0xf'),auth[_0xc325('0x8')](),controller[_0xc325('0x19')]);module[_0xc325('0x1a')]=router;
\ No newline at end of file
+var _0xfc0c=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','destroy','delete','removeMembers','exports','multer','path','../../components/auth/service'];(function(_0x5f1694,_0x35e555){var _0x184197=function(_0x1b1963){while(--_0x1b1963){_0x5f1694['push'](_0x5f1694['shift']());}};_0x184197(++_0x35e555);}(_0xfc0c,0x169));var _0xcfc0=function(_0x208296,_0x531f88){_0x208296=_0x208296-0x0;var _0x3d8dd1=_0xfc0c[_0x208296];return _0x3d8dd1;};'use strict';var multer=require(_0xcfc0('0x0'));var util=require('util');var path=require(_0xcfc0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcfc0('0x2'));var interaction=require(_0xcfc0('0x3'));var config=require(_0xcfc0('0x4'));var controller=require('./chatGroup.controller');router[_0xcfc0('0x5')]('/',auth['isAuthenticated'](),controller[_0xcfc0('0x6')]);router[_0xcfc0('0x5')](_0xcfc0('0x7'),auth[_0xcfc0('0x8')](),controller[_0xcfc0('0x9')]);router[_0xcfc0('0x5')](_0xcfc0('0xa'),auth[_0xcfc0('0x8')](),controller['show']);router[_0xcfc0('0x5')](_0xcfc0('0xb'),auth[_0xcfc0('0x8')](),controller['getUnread']);router[_0xcfc0('0x5')](_0xcfc0('0xc'),auth[_0xcfc0('0x8')](),controller[_0xcfc0('0xd')]);router['get'](_0xcfc0('0xe'),auth[_0xcfc0('0x8')](),controller[_0xcfc0('0xf')]);router[_0xcfc0('0x10')]('/',auth[_0xcfc0('0x8')](),controller[_0xcfc0('0x11')]);router['post'](_0xcfc0('0xc'),auth[_0xcfc0('0x8')](),controller[_0xcfc0('0x12')]);router['post'](_0xcfc0('0xe'),auth[_0xcfc0('0x8')](),controller[_0xcfc0('0x13')]);router[_0xcfc0('0x14')](_0xcfc0('0xa'),auth[_0xcfc0('0x8')](),controller[_0xcfc0('0x15')]);router['delete']('/:id',auth[_0xcfc0('0x8')](),controller[_0xcfc0('0x16')]);router[_0xcfc0('0x17')](_0xcfc0('0xc'),auth['isAuthenticated'](),controller[_0xcfc0('0x18')]);module[_0xcfc0('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 945235c..c4f1879 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 _0xc06d=['TEXT','DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN','INTEGER','star','thumb'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xc06d,0x15a));var _0xdc06=function(_0x34efb1,_0xd5094a){_0x34efb1=_0x34efb1-0x0;var _0x59a9bb=_0xc06d[_0x34efb1];return _0x59a9bb;};'use strict';var Sequelize=require(_0xdc06('0x0'));module[_0xdc06('0x1')]={'closed':{'type':Sequelize[_0xdc06('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xdc06('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xdc06('0x4'),_0xdc06('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xdc06('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xdc06('0x7')]},'disposition':{'type':Sequelize[_0xdc06('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xdc06('0x8')]},'browserName':{'type':Sequelize[_0xdc06('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xdc06('0x8')]},'osVersion':{'type':Sequelize[_0xdc06('0x8')]},'deviceModel':{'type':Sequelize[_0xdc06('0x8')]},'deviceVendor':{'type':Sequelize[_0xdc06('0x8')]},'deviceType':{'type':Sequelize[_0xdc06('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xdc06('0x6')]('long')},'read1stAt':{'type':Sequelize[_0xdc06('0x7')]},'lastMsgAt':{'type':Sequelize[_0xdc06('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xdc06('0x9')]('in',_0xdc06('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xdc06('0x8')]},'customerPort':{'type':Sequelize[_0xdc06('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xbfcc=['TEXT','long','out','BOOLEAN','sequelize','INTEGER','ENUM','star','thumb','DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbfcc[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0xcbfc('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xcbfc('0x1')]},'ratingType':{'type':Sequelize[_0xcbfc('0x2')](_0xcbfc('0x3'),_0xcbfc('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xcbfc('0x5')]},'disposition':{'type':Sequelize[_0xcbfc('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xcbfc('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xcbfc('0x6')]},'browserVersion':{'type':Sequelize[_0xcbfc('0x6')]},'osName':{'type':Sequelize[_0xcbfc('0x6')]},'osVersion':{'type':Sequelize[_0xcbfc('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xcbfc('0x6')]},'deviceType':{'type':Sequelize[_0xcbfc('0x6')]},'referer':{'type':Sequelize[_0xcbfc('0x7')]},'customerIp':{'type':Sequelize[_0xcbfc('0x6')]},'formData':{'type':Sequelize[_0xcbfc('0x7')](_0xcbfc('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xcbfc('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xcbfc('0x2')]('in',_0xcbfc('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xcbfc('0x6')]},'customerPort':{'type':Sequelize[_0xcbfc('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xcbfc('0xa')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 6622ced..b58c975 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 _0x7efd=['transcript-%d-%s.zip','push','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','disposition','browserName','osName','customerIp','customerPort','existsSync','createReadStream','createWriteStream','YYYY-MM-DD\x20HH:mm:ss','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','ejs','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','register','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','name','send','render','merge','body','agent','account','map','ChatInteraction','fieldName','type','key','getOptions','query','user','show','params','model','keys','filters','intersection','attributes','fields','includeAll','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','Sequelize','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','root','join','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','CmContact','ContactId','length','UserId','agentAlias','System','customer','%s%d','Visitor','website_alias','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','nolimit','order','sort','pick','ChatInteractionId','filter','where','$gte','split','findAll','rows','rawAttributes','includeAgent','addTags','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','toString','server','files','tmp','attachments'];(function(_0x7b08d0,_0x3a79bf){var _0x383a76=function(_0xb7e5be){while(--_0xb7e5be){_0x7b08d0['push'](_0x7b08d0['shift']());}};_0x383a76(++_0x3a79bf);}(_0x7efd,0x1c3));var _0xd7ef=function(_0x548ccb,_0x1fab15){_0x548ccb=_0x548ccb-0x0;var _0x2f7701=_0x7efd[_0x548ccb];return _0x2f7701;};'use strict';var rimraf=require(_0xd7ef('0x0'));var zipdir=require(_0xd7ef('0x1'));var rp=require('request-promise');var moment=require(_0xd7ef('0x2'));var BPromise=require(_0xd7ef('0x3'));var Mustache=require(_0xd7ef('0x4'));var util=require(_0xd7ef('0x5'));var path=require('path');var ejs=require(_0xd7ef('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xd7ef('0x7'));var qs=require(_0xd7ef('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0xd7ef('0x9'))('api');var config=require(_0xd7ef('0xa'));var db=require(_0xd7ef('0xb'))['db'];config['redis']=_['defaults'](config[_0xd7ef('0xc')],{'host':_0xd7ef('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd7ef('0xc')]));require('./chatInteraction.socket')[_0xd7ef('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd7ef('0xf')]['http']({'port':0x232b});var client9004=jayson[_0xd7ef('0xf')][_0xd7ef('0x10')]({'port':0x232c});function respondWithRpcPromise(_0x2cac8f,_0xe39a3c,_0x349060,_0x4d0b75){return new BPromise(function(_0x29573f,_0x43ce3f){var _0x430142=_0x4d0b75||client;return _0x430142[_0xd7ef('0x11')](_0x2cac8f,_0x349060)[_0xd7ef('0x12')](function(_0x30d6e3){logger[_0xd7ef('0x13')]('ChatInteraction,\x20%s,\x20%s',_0xe39a3c,_0xd7ef('0x14'));logger[_0xd7ef('0x15')](_0xd7ef('0x16'),_0xe39a3c,'request\x20sent',JSON[_0xd7ef('0x17')](_0x30d6e3));if(_0x30d6e3[_0xd7ef('0x18')]){if(_0x30d6e3[_0xd7ef('0x18')][_0xd7ef('0x19')]===0x1f4){logger[_0xd7ef('0x18')](_0xd7ef('0x1a'),_0xe39a3c,_0x30d6e3['error'][_0xd7ef('0x1b')]);return _0x43ce3f(_0x30d6e3[_0xd7ef('0x18')][_0xd7ef('0x1b')]);}logger['error'](_0xd7ef('0x1a'),_0xe39a3c,_0x30d6e3[_0xd7ef('0x18')][_0xd7ef('0x1b')]);return _0x29573f(_0x30d6e3['error']['message']);}else{logger['info'](_0xd7ef('0x1a'),_0xe39a3c,'request\x20sent');_0x29573f(_0x30d6e3[_0xd7ef('0x1c')][_0xd7ef('0x1b')]);}})[_0xd7ef('0x1d')](function(_0x1440f6){logger['error'](_0xd7ef('0x1a'),_0xe39a3c,_0x1440f6);_0x43ce3f(_0x1440f6);});});}function respondWithStatusCode(_0x159f24,_0x4b99cc){_0x4b99cc=_0x4b99cc||0xcc;return function(_0x5e8cb9){if(_0x5e8cb9){return _0x159f24[_0xd7ef('0x1e')](_0x4b99cc);}return _0x159f24[_0xd7ef('0x1f')](_0x4b99cc)[_0xd7ef('0x20')]();};}function respondWithResult(_0x5529b9,_0x52260a){_0x52260a=_0x52260a||0xc8;return function(_0x17c8f8){if(_0x17c8f8){return _0x5529b9[_0xd7ef('0x1f')](_0x52260a)[_0xd7ef('0x21')](_0x17c8f8);}};}function respondWithFilteredResult(_0x1056b5,_0x4a59ac){return function(_0x6f3ee8){if(_0x6f3ee8){var _0x1e5fea=typeof _0x4a59ac[_0xd7ef('0x22')]===_0xd7ef('0x23')&&typeof _0x4a59ac[_0xd7ef('0x24')]===_0xd7ef('0x23');var _0x2f7a2e=_0x6f3ee8[_0xd7ef('0x25')];var _0x3a3980=_0x1e5fea?0x0:_0x4a59ac[_0xd7ef('0x22')];var _0x44b4bf=_0x1e5fea?_0x6f3ee8[_0xd7ef('0x25')]:_0x4a59ac[_0xd7ef('0x22')]+_0x4a59ac[_0xd7ef('0x24')];var _0xff7c4a;if(_0x44b4bf>=_0x2f7a2e){_0x44b4bf=_0x2f7a2e;_0xff7c4a=0xc8;}else{_0xff7c4a=0xce;}_0x1056b5[_0xd7ef('0x1f')](_0xff7c4a);return _0x1056b5[_0xd7ef('0x26')](_0xd7ef('0x27'),_0x3a3980+'-'+_0x44b4bf+'/'+_0x2f7a2e)['json'](_0x6f3ee8);}return null;};}function saveUpdates(_0x403650){return function(_0x5c311d){if(_0x5c311d){return _0x5c311d[_0xd7ef('0x28')](_0x403650)['then'](function(_0xd206e7){return _0xd206e7;});}return null;};}function removeEntity(_0x2ad496){return function(_0x8283c9){if(_0x8283c9){return _0x8283c9[_0xd7ef('0x29')]()[_0xd7ef('0x12')](function(){_0x2ad496[_0xd7ef('0x1f')](0xcc)[_0xd7ef('0x20')]();});}};}function handleEntityNotFound(_0x5bd24e){return function(_0x39a04a){if(!_0x39a04a){_0x5bd24e['sendStatus'](0x194);}return _0x39a04a;};}function handleError(_0x26a612,_0x39c40e){_0x39c40e=_0x39c40e||0x1f4;return function(_0x5b7f42){logger['error'](_0x5b7f42['stack']);if(_0x5b7f42[_0xd7ef('0x2a')]){delete _0x5b7f42[_0xd7ef('0x2a')];}_0x26a612[_0xd7ef('0x1f')](_0x39c40e)[_0xd7ef('0x2b')](_0x5b7f42);};}function getMustacheRender(_0x52b14b,_0x87b1bc){return Mustache[_0xd7ef('0x2c')](_0x52b14b,_[_0xd7ef('0x2d')](_0x87b1bc[_0xd7ef('0x2e')],{'contact':_0x87b1bc['contact'],'message':_0x87b1bc[_0xd7ef('0x1b')],'agent':_0x87b1bc[_0xd7ef('0x2f')],'interaction':_0x87b1bc['interaction'],'account':_0x87b1bc[_0xd7ef('0x30')]}))||'';}exports['index']=function(_0x55fc3b,_0x3cc27d){var _0xca5d1c={};var _0x1e261e=_[_0xd7ef('0x31')](db[_0xd7ef('0x32')]['rawAttributes'],function(_0x41ddb0){return{'name':_0x41ddb0[_0xd7ef('0x33')],'type':_0x41ddb0[_0xd7ef('0x34')][_0xd7ef('0x35')]};});_0xca5d1c=qs[_0xd7ef('0x36')](_0x1e261e,_0x55fc3b);return interaction['findAll']('chat',_0x55fc3b[_0xd7ef('0x37')],_0x55fc3b[_0xd7ef('0x38')],_0xca5d1c,_0x1e261e)[_0xd7ef('0x12')](respondWithFilteredResult(_0x3cc27d,_0xca5d1c))['catch'](handleError(_0x3cc27d,null));};exports[_0xd7ef('0x39')]=function(_0x2002e6,_0x127438){var _0x11dfe0={'raw':![],'where':{'id':_0x2002e6[_0xd7ef('0x3a')]['id']}},_0x4222f7={};_0x4222f7[_0xd7ef('0x3b')]=_[_0xd7ef('0x3c')](db[_0xd7ef('0x32')]['rawAttributes']);_0x4222f7[_0xd7ef('0x37')]=_['keys'](_0x2002e6[_0xd7ef('0x37')]);_0x4222f7[_0xd7ef('0x3d')]=_[_0xd7ef('0x3e')](_0x4222f7[_0xd7ef('0x3b')],_0x4222f7['query']);_0x11dfe0[_0xd7ef('0x3f')]=_[_0xd7ef('0x3e')](_0x4222f7['model'],qs[_0xd7ef('0x40')](_0x2002e6[_0xd7ef('0x37')][_0xd7ef('0x40')]));_0x11dfe0[_0xd7ef('0x3f')]=_0x11dfe0['attributes']['length']?_0x11dfe0[_0xd7ef('0x3f')]:_0x4222f7[_0xd7ef('0x3b')];if(_0x2002e6['query'][_0xd7ef('0x41')]){_0x11dfe0[_0xd7ef('0x42')]=[{'all':!![]}];}_0x11dfe0=_[_0xd7ef('0x2d')]({},_0x11dfe0,_0x2002e6[_0xd7ef('0x43')]);return db[_0xd7ef('0x32')][_0xd7ef('0x44')](_0x11dfe0)[_0xd7ef('0x12')](handleEntityNotFound(_0x127438,null))['then'](respondWithResult(_0x127438,null))[_0xd7ef('0x1d')](handleError(_0x127438,null));};exports[_0xd7ef('0x45')]=function(_0x3f77ad,_0x308970){return db[_0xd7ef('0x32')][_0xd7ef('0x45')](_0x3f77ad['body'],{})[_0xd7ef('0x12')](respondWithResult(_0x308970,0xc9))[_0xd7ef('0x1d')](handleError(_0x308970,null));};exports[_0xd7ef('0x28')]=function(_0x3fdb87,_0x30464b){if(_0x3fdb87['body']['id']){delete _0x3fdb87[_0xd7ef('0x2e')]['id'];}return db[_0xd7ef('0x32')][_0xd7ef('0x44')]({'where':{'id':_0x3fdb87['params']['id']}})['then'](handleEntityNotFound(_0x30464b,null))[_0xd7ef('0x12')](saveUpdates(_0x3fdb87[_0xd7ef('0x2e')],null))[_0xd7ef('0x12')](respondWithResult(_0x30464b,null))[_0xd7ef('0x1d')](handleError(_0x30464b,null));};exports[_0xd7ef('0x29')]=function(_0x1c4abd,_0x371126){return db[_0xd7ef('0x32')][_0xd7ef('0x44')]({'where':{'id':_0x1c4abd['params']['id']}})[_0xd7ef('0x12')](handleEntityNotFound(_0x371126,null))[_0xd7ef('0x12')](removeEntity(_0x371126,null))['catch'](handleError(_0x371126,null));};exports[_0xd7ef('0x46')]=function(_0x4cd7d4,_0x5bbc29){return db['ChatInteraction'][_0xd7ef('0x46')]()[_0xd7ef('0x12')](respondWithResult(_0x5bbc29,null))[_0xd7ef('0x1d')](handleError(_0x5bbc29,null));};exports[_0xd7ef('0x47')]=function(_0x23f293,_0x1e58be){var _0x381cd6=_0x23f293[_0xd7ef('0x3a')]['id'];var _0x271593;var _0x283930;var _0x35445a;return db[_0xd7ef('0x32')][_0xd7ef('0x48')]({'where':{'id':_0x381cd6}})[_0xd7ef('0x12')](function(_0x469992){_0x271593=_0x469992;return db[_0xd7ef('0x49')][_0xd7ef('0x48')]({'where':{'id':_0x469992[_0xd7ef('0x4a')]},'attributes':['id',_0xd7ef('0x4b'),_0xd7ef('0x4c'),_0xd7ef('0x4d'),_0xd7ef('0x4e'),_0xd7ef('0x4f')],'raw':!![]});})[_0xd7ef('0x12')](function(_0x4f943e){if(_0x4f943e&&_0x4f943e['vidaooApiKey']&&_0x4f943e[_0xd7ef('0x4c')]){_0x283930=_0x4f943e;var _0x5d477d={'interaction':{'id':_0x381cd6},'agent':{'id':_0x23f293['user']['id'],'name':_0x23f293[_0xd7ef('0x38')][_0xd7ef('0x2a')],'fullname':_0x23f293[_0xd7ef('0x38')]['fullname'],'email':_0x23f293[_0xd7ef('0x38')][_0xd7ef('0x50')]},'contact':_0x23f293[_0xd7ef('0x2e')][_0xd7ef('0x51')],'account':_0x23f293[_0xd7ef('0x2e')][_0xd7ef('0x30')]};var _0x41aca9={'rejectUnauthorized':![],'method':_0xd7ef('0x52'),'url':_0xd7ef('0x53'),'headers':{'X-APIKEY':_0x4f943e['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x23f293[_0xd7ef('0x38')][_0xd7ef('0x50')]],'buttons':null,'topic':_0x283930[_0xd7ef('0x4d')],'note':_[_0xd7ef('0x54')](_0x283930[_0xd7ef('0x4e')])?null:getMustacheRender(_0x283930[_0xd7ef('0x4e')],_0x5d477d),'metadata':null},'redirect':_0xd7ef('0x55'),'json':!![]};try{if(!_[_0xd7ef('0x54')](_0x283930[_0xd7ef('0x4f')])){var _0x49a924=getMustacheRender(_0x283930[_0xd7ef('0x4f')],_0x5d477d);var _0x519085=JSON[_0xd7ef('0x56')](_0x49a924);_0x41aca9[_0xd7ef('0x2e')][_0xd7ef('0x57')]=_0x519085;}}catch(_0x6b2703){throw new db['Sequelize'][(_0xd7ef('0x58'))](_0xd7ef('0x59'));}return rp(_0x41aca9);}else{throw new db['Sequelize'][(_0xd7ef('0x58'))](_0xd7ef('0x5a'));}})['then'](function(_0x1eea36){_0x35445a=_0x1eea36;if(_0x35445a['id']){var _0xd5f728={'body':_0x35445a[_0xd7ef('0x5b')],'ChatWebsiteId':_0x283930['id'],'ChatInteractionId':_0x271593['id'],'direction':'out','UserId':_0x23f293[_0xd7ef('0x38')]['id']};return db['ChatMessage'][_0xd7ef('0x45')](_0xd5f728,{});}else{throw new db[(_0xd7ef('0x5c'))][(_0xd7ef('0x58'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xd7ef('0x12')](function(){return _0x271593[_0xd7ef('0x5d')]({'vidaooSessionId':_0x35445a['id']});})[_0xd7ef('0x12')](respondWithResult(_0x1e58be,null))[_0xd7ef('0x1d')](handleError(_0x1e58be,null));};exports[_0xd7ef('0x5e')]=function(_0x51b42a,_0x2fd036){if(_0x51b42a[_0xd7ef('0x2e')]['id']){delete _0x51b42a[_0xd7ef('0x2e')]['id'];}return db['ChatInteraction'][_0xd7ef('0x44')]({'where':{'id':_0x51b42a[_0xd7ef('0x3a')]['id']},'include':[{'model':db['CmContact'],'as':_0xd7ef('0x5f')}]})[_0xd7ef('0x12')](handleEntityNotFound(_0x2fd036,null))[_0xd7ef('0x12')](saveUpdates(_0x51b42a[_0xd7ef('0x2e')],null))[_0xd7ef('0x12')](respondWithResult(_0x2fd036,null))[_0xd7ef('0x1d')](handleError(_0x2fd036,null));};exports[_0xd7ef('0x60')]=function(_0x2ae7c9,_0x12bb35){if(_0x2ae7c9[_0xd7ef('0x2e')]['id']){delete _0x2ae7c9[_0xd7ef('0x2e')]['id'];}return db[_0xd7ef('0x32')][_0xd7ef('0x44')]({'where':{'id':_0x2ae7c9[_0xd7ef('0x3a')]['id']}})[_0xd7ef('0x12')](function(_0x5e16b0){if(!_0x5e16b0){logger[_0xd7ef('0x18')](_0xd7ef('0x61'),_0xd7ef('0x60'),0x194,_0xd7ef('0x62'));_0x12bb35[_0xd7ef('0x1e')](0x194);}else{if(_0x5e16b0['UserId']){throw new db['Sequelize'][(_0xd7ef('0x58'))]('Interaction\x20already\x20assigned');}}return _0x5e16b0;})['then'](function(_0x1c590f){if(_0x1c590f){return _0x1c590f[_0xd7ef('0x28')]({'closed':_0x2ae7c9[_0xd7ef('0x2e')]['closed'],'disposition':_0x2ae7c9['body']['disposition']})[_0xd7ef('0x12')](function(_0x190575){return _0x190575;});}})['then'](function(){return respondWithRpcPromise(_0xd7ef('0x63'),'abandon',_0x2ae7c9[_0xd7ef('0x2e')],client9004);})[_0xd7ef('0x12')](respondWithResult(_0x12bb35,null))[_0xd7ef('0x1d')](handleError(_0x12bb35,null));};exports[_0xd7ef('0x64')]=function(_0x4eeea3,_0x54715a){_0x4eeea3[_0xd7ef('0x2e')][_0xd7ef('0x2a')]=_0x4eeea3[_0xd7ef('0x65')][_0xd7ef('0x66')];_0x4eeea3['body'][_0xd7ef('0x67')]=_0x4eeea3[_0xd7ef('0x65')][_0xd7ef('0x68')];_0x4eeea3['body'][_0xd7ef('0x34')]=_0x4eeea3[_0xd7ef('0x65')]['mimetype'];return db[_0xd7ef('0x69')][_0xd7ef('0x45')](_0x4eeea3['body'])[_0xd7ef('0x12')](respondWithResult(_0x54715a,0xc9))['catch'](handleError(_0x54715a,null));};exports[_0xd7ef('0x6a')]=function(_0x74ddc1,_0x119b58){return db[_0xd7ef('0x32')][_0xd7ef('0x48')]({'where':{'id':_0x74ddc1[_0xd7ef('0x3a')]['id']},'raw':!![]})[_0xd7ef('0x12')](handleEntityNotFound(_0x119b58,null))[_0xd7ef('0x12')](function(_0xb8fc76){if(_0xb8fc76){if(_0xb8fc76[_0xd7ef('0x6b')]){return _0x119b58[_0xd7ef('0x1f')](0x193)['json']({'status':0x193,'message':_0xd7ef('0x6c')});}return db[_0xd7ef('0x69')]['findOne']({'where':{'id':_0x74ddc1[_0xd7ef('0x37')][_0xd7ef('0x6d')]},'raw':!![]})[_0xd7ef('0x12')](handleEntityNotFound(_0x119b58,null));}})[_0xd7ef('0x12')](function(_0x5e4488){if(_0x5e4488){var _0x4287f3=_0x5e4488[_0xd7ef('0x6e')]!==null;var _0x45425a=path['join'](config[_0xd7ef('0x6f')],'server/files/attachments/');if(_0x4287f3){_0x45425a=path[_0xd7ef('0x70')](_0x45425a,'offline-chat/');}var _0x396bc0=path[_0xd7ef('0x70')](_0x45425a,_0x5e4488[_0xd7ef('0x67')]);return _0x119b58[_0xd7ef('0x71')](_0x396bc0);}})['catch'](handleError(_0x119b58,null));};exports['close']=function(_0x46cdd4,_0x47f3cf){var _0x13d962=null;var _0x1940c3=null;var _0x440351=null;if(_0x46cdd4[_0xd7ef('0x2e')]['id']){delete _0x46cdd4['body']['id'];}if(_0x46cdd4[_0xd7ef('0x2e')][_0xd7ef('0x72')]){_0x440351=path[_0xd7ef('0x70')](config['root'],_0xd7ef('0x73'),util[_0xd7ef('0x74')](_0xd7ef('0x75'),Date[_0xd7ef('0x76')]()));_0x46cdd4[_0xd7ef('0x2e')][_0xd7ef('0x77')]=_0x440351;}return db[_0xd7ef('0x32')][_0xd7ef('0x44')]({'where':{'id':_0x46cdd4[_0xd7ef('0x3a')]['id']},'include':[{'model':db[_0xd7ef('0x78')],'as':_0xd7ef('0x79'),'include':[{'model':db[_0xd7ef('0x7a')],'as':_0xd7ef('0x7a')}]}]})[_0xd7ef('0x12')](handleEntityNotFound(_0x47f3cf,null))[_0xd7ef('0x12')](saveUpdates(_0x46cdd4[_0xd7ef('0x2e')],null))[_0xd7ef('0x12')](function(_0x262ab8){if(_0x262ab8){_0x13d962=_0x262ab8;return db[_0xd7ef('0x49')][_0xd7ef('0x44')]({'where':{'id':_0x13d962[_0xd7ef('0x4a')]}});}})[_0xd7ef('0x12')](function(_0x1bf5e3){if(_0x1bf5e3){_0x1940c3=_0x1bf5e3;return db[_0xd7ef('0x7b')][_0xd7ef('0x44')]({'where':{'id':_0x13d962[_0xd7ef('0x7c')]}});}})[_0xd7ef('0x12')](function(_0x1f8235){if(_0x1f8235){if(_0x440351){var _0x2e06ff=null;for(var _0x22c550=0x1;_0x22c550<_0x13d962[_0xd7ef('0x79')][_0xd7ef('0x7d')];++_0x22c550){_0x2e06ff=_0x13d962[_0xd7ef('0x79')][_0x22c550];var _0x19ee85=_0x2e06ff[_0xd7ef('0x7e')]?util['format']('%s%d',_0x1940c3[_0xd7ef('0x7f')],_0x2e06ff[_0xd7ef('0x7e')]):_0xd7ef('0x80');var _0x4786c8=_0x46cdd4[_0xd7ef('0x2e')][_0xd7ef('0x81')]||util[_0xd7ef('0x74')](_0xd7ef('0x82'),_0xd7ef('0x83'),_0x2e06ff['ContactId']);switch(_0x1940c3['agentIdentifier']){case _0xd7ef('0x84'):_0x19ee85=_0x2e06ff['UserId']?util[_0xd7ef('0x74')](_0xd7ef('0x82'),_0x1940c3[_0xd7ef('0x7f')],_0x2e06ff['UserId']):'System';break;case _0xd7ef('0x85'):_0x19ee85=_0x2e06ff['UserId']?_0x2e06ff[_0xd7ef('0x7a')][_0xd7ef('0x86')]||_0x2e06ff['User'][_0xd7ef('0x87')]:_0xd7ef('0x80');break;case _0xd7ef('0x88'):_0x19ee85=_0x2e06ff[_0xd7ef('0x7e')]?_0x2e06ff[_0xd7ef('0x7a')][_0xd7ef('0x87')]:'System';break;default:_0x19ee85=_0x2e06ff[_0xd7ef('0x7e')]?util[_0xd7ef('0x74')](_0xd7ef('0x82'),_0x1940c3[_0xd7ef('0x7f')],_0x2e06ff['UserId']):_0xd7ef('0x80');}var _0x30f993=util['format'](_0xd7ef('0x89'),moment(_0x2e06ff[_0xd7ef('0x8a')])['format'](_0xd7ef('0x8b')),_0x2e06ff[_0xd7ef('0x8c')]==='in'?_0x4786c8:_0x19ee85,_0x2e06ff['body']);if(!_0x2e06ff[_0xd7ef('0x8d')]){fs['appendFileSync'](_0x440351,_0x30f993);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xd7ef('0x8e')],'as':_0xd7ef('0x8f'),'raw':!![],'include':[{'model':db[_0xd7ef('0x90')],'as':_0xd7ef('0x90'),'raw':!![]}]}]});}}})[_0xd7ef('0x12')](function(_0x4d6078){if(!_0x4d6078||!_0x4d6078['Smtp']||!_0x46cdd4[_0xd7ef('0x2e')])return _0x13d962;var _0xd1b9d6=_0x4d6078[_0xd7ef('0x91')]();return respondWithRpcPromise('SendMail',_0xd7ef('0x92'),{'account':_0xd1b9d6,'message':{'from':util[_0xd7ef('0x74')](_0xd7ef('0x93'),_0x4d6078['name'],_0x4d6078['email']||_0x4d6078[_0xd7ef('0x8f')][_0xd7ef('0x38')]),'to':_0x46cdd4[_0xd7ef('0x2e')][_0xd7ef('0x72')],'subject':_0xd7ef('0x94'),'text':util['format'](_0xd7ef('0x95'),_0x46cdd4[_0xd7ef('0x2e')][_0xd7ef('0x72')]),'attachments':[{'path':_0x440351}]}})[_0xd7ef('0x12')](function(){return _0x13d962;})[_0xd7ef('0x1d')](function(_0x358ed7){logger[_0xd7ef('0x18')](_0x358ed7);});})['then'](respondWithStatusCode(_0x47f3cf,0xc8))[_0xd7ef('0x1d')](handleError(_0x47f3cf,null));};exports[_0xd7ef('0x96')]=function(_0x3d66b3,_0x1e49d7){return db[_0xd7ef('0x78')]['find']({'where':{'id':_0x3d66b3[_0xd7ef('0x3a')]['id']}})[_0xd7ef('0x12')](handleEntityNotFound(_0x1e49d7,null))[_0xd7ef('0x12')](function(_0x198f99){if(_0x198f99){return _0x198f99[_0xd7ef('0x96')](_0x3d66b3[_0xd7ef('0x2e')][_0xd7ef('0x97')],_[_0xd7ef('0x98')](_0x3d66b3['body'],['ids','id'])||{});}})[_0xd7ef('0x12')](respondWithResult(_0x1e49d7,null))[_0xd7ef('0x1d')](handleError(_0x1e49d7,null));};exports['getMessages']=function(_0x477796,_0x32c80b){var _0x260b23={'raw':![],'where':{}};var _0x207816={};var _0xe6f083={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xd7ef('0x48')]({'where':{'id':_0x477796[_0xd7ef('0x3a')]['id']}})[_0xd7ef('0x12')](handleEntityNotFound(_0x32c80b,null))[_0xd7ef('0x12')](function(_0x164625){if(_0x164625){_0x207816[_0xd7ef('0x3b')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x207816[_0xd7ef('0x37')]=_['keys'](_0x477796['query']);_0x207816['filters']=_['intersection'](_0x207816[_0xd7ef('0x3b')],_0x207816[_0xd7ef('0x37')]);_0x260b23[_0xd7ef('0x3f')]=_[_0xd7ef('0x3e')](_0x207816['model'],qs[_0xd7ef('0x40')](_0x477796[_0xd7ef('0x37')][_0xd7ef('0x40')]));_0x260b23[_0xd7ef('0x3f')]=_0x260b23[_0xd7ef('0x3f')][_0xd7ef('0x7d')]?_0x260b23[_0xd7ef('0x3f')]:_0x207816[_0xd7ef('0x3b')];if(!_0x477796[_0xd7ef('0x37')][_0xd7ef('0x99')](_0xd7ef('0x9a'))){_0x260b23[_0xd7ef('0x24')]=qs[_0xd7ef('0x24')](_0x477796[_0xd7ef('0x37')][_0xd7ef('0x24')]);_0x260b23[_0xd7ef('0x22')]=qs[_0xd7ef('0x22')](_0x477796['query'][_0xd7ef('0x22')]);}_0x260b23[_0xd7ef('0x9b')]=qs[_0xd7ef('0x9c')](_0x477796[_0xd7ef('0x37')][_0xd7ef('0x9c')]);_0x260b23['where']=qs[_0xd7ef('0x3d')](_[_0xd7ef('0x9d')](_0x477796['query'],_0x207816[_0xd7ef('0x3d')]));_0x260b23['where'][_0xd7ef('0x9e')]=_0x164625['id'];if(_0x477796[_0xd7ef('0x37')][_0xd7ef('0x9f')]){_0x260b23[_0xd7ef('0xa0')]=_[_0xd7ef('0x2d')](_0x260b23[_0xd7ef('0xa0')],{'$or':_[_0xd7ef('0x31')](_0x260b23[_0xd7ef('0x3f')],function(_0x1da8f6){var _0x45e28e={};_0x45e28e[_0x1da8f6]={'$like':'%'+_0x477796[_0xd7ef('0x37')]['filter']+'%'};return _0x45e28e;})});}if(_0x477796['query']['$gte']){var _0x1a997f=_0x477796[_0xd7ef('0x37')][_0xd7ef('0xa1')][_0xd7ef('0xa2')](',');var _0x5e7cb1={};_0x5e7cb1[_0x1a997f[0x0]]={'$gte':moment(_0x1a997f[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x260b23['where']=_[_0xd7ef('0x2d')](_0x260b23[_0xd7ef('0xa0')],_0x5e7cb1);}_0x260b23=_[_0xd7ef('0x2d')]({},_0x260b23,_0x477796[_0xd7ef('0x43')]);return db['ChatMessage'][_0xd7ef('0x25')]({'where':_0x260b23['where']})[_0xd7ef('0x12')](function(_0x28b863){_0xe6f083[_0xd7ef('0x25')]=_0x28b863;if(_0x477796[_0xd7ef('0x37')][_0xd7ef('0x41')]){_0x260b23[_0xd7ef('0x42')]=[{'all':!![]}];}return db[_0xd7ef('0x78')][_0xd7ef('0xa3')](_0x260b23);})['then'](function(_0x3d4be7){_0xe6f083[_0xd7ef('0xa4')]=_0x3d4be7;return _0xe6f083;});}})[_0xd7ef('0x12')](respondWithFilteredResult(_0x32c80b,_0x260b23))[_0xd7ef('0x1d')](handleError(_0x32c80b,null));};exports['getMyMessages']=function(_0x5a6e42,_0x3eef16){var _0xfa8a41={'where':{}},_0x3a89a9={},_0xef76b8={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xd7ef('0x48')]({'where':{'id':_0x5a6e42[_0xd7ef('0x3a')]['id']}})[_0xd7ef('0x12')](handleEntityNotFound(_0x3eef16,null))[_0xd7ef('0x12')](function(_0x24ccaa){if(_0x24ccaa){_0x3a89a9['model']=_[_0xd7ef('0x3c')](db['ChatMessage'][_0xd7ef('0xa5')]);_0x3a89a9[_0xd7ef('0x37')]=_['keys'](_0x5a6e42[_0xd7ef('0x37')]);_0x3a89a9[_0xd7ef('0x3d')]=_[_0xd7ef('0x3e')](_0x3a89a9[_0xd7ef('0x3b')],_0x3a89a9[_0xd7ef('0x37')]);_0xfa8a41[_0xd7ef('0x3f')]=_['intersection'](_0x3a89a9['model'],qs[_0xd7ef('0x40')](_0x5a6e42[_0xd7ef('0x37')][_0xd7ef('0x40')]));_0xfa8a41[_0xd7ef('0x3f')]=_0xfa8a41['attributes'][_0xd7ef('0x7d')]?_0xfa8a41[_0xd7ef('0x3f')]:_0x3a89a9['model'];if(!_0x5a6e42[_0xd7ef('0x37')]['hasOwnProperty'](_0xd7ef('0x9a'))){_0xfa8a41[_0xd7ef('0x24')]=qs['limit'](_0x5a6e42[_0xd7ef('0x37')][_0xd7ef('0x24')]);_0xfa8a41[_0xd7ef('0x22')]=qs[_0xd7ef('0x22')](_0x5a6e42[_0xd7ef('0x37')][_0xd7ef('0x22')]);}_0xfa8a41[_0xd7ef('0x9b')]=qs[_0xd7ef('0x9c')](_0x5a6e42['query'][_0xd7ef('0x9c')]);_0xfa8a41[_0xd7ef('0xa0')]=qs[_0xd7ef('0x3d')](_[_0xd7ef('0x9d')](_0x5a6e42[_0xd7ef('0x37')],_0x3a89a9['filters']));_0xfa8a41[_0xd7ef('0xa0')][_0xd7ef('0x9e')]=_0x24ccaa['id'];if(_0x5a6e42['query'][_0xd7ef('0x9f')]){_0xfa8a41[_0xd7ef('0xa0')]=_[_0xd7ef('0x2d')](_0xfa8a41[_0xd7ef('0xa0')],{'$or':_[_0xd7ef('0x31')](_0xfa8a41[_0xd7ef('0x3f')],function(_0x46762c){var _0x199c9d={};_0x199c9d[_0x46762c]={'$like':'%'+_0x5a6e42['query'][_0xd7ef('0x9f')]+'%'};return _0x199c9d;})});}_0xfa8a41[_0xd7ef('0xa0')]['secret']=![];if(_0x5a6e42[_0xd7ef('0x37')]['id']){_0xfa8a41[_0xd7ef('0xa0')]['id']={'$gt':_0x5a6e42[_0xd7ef('0x37')]['id']};}_0xfa8a41=_[_0xd7ef('0x2d')]({},_0xfa8a41,_0x5a6e42[_0xd7ef('0x43')]);return db['ChatMessage'][_0xd7ef('0x25')]({'where':_0xfa8a41[_0xd7ef('0xa0')]})[_0xd7ef('0x12')](function(_0xe44e0f){_0xef76b8[_0xd7ef('0x25')]=_0xe44e0f;_0xfa8a41[_0xd7ef('0x42')]=[];if(_0x5a6e42[_0xd7ef('0x37')][_0xd7ef('0xa6')]){_0xfa8a41[_0xd7ef('0x42')]['push']({'model':db[_0xd7ef('0x7a')],'as':_0xd7ef('0x7a'),'attributes':['id',_0xd7ef('0x87'),_0xd7ef('0x86')]});}if(_0x5a6e42[_0xd7ef('0x37')]['includeAll']){_0xfa8a41[_0xd7ef('0x42')]=[{'all':!![]}];}return db['ChatMessage'][_0xd7ef('0xa3')](_0xfa8a41);})[_0xd7ef('0x12')](function(_0x550c59){_0xef76b8[_0xd7ef('0xa4')]=_0x550c59;return _0xef76b8;});}})[_0xd7ef('0x12')](respondWithFilteredResult(_0x3eef16,_0xfa8a41))[_0xd7ef('0x1d')](handleError(_0x3eef16,null));};exports[_0xd7ef('0xa7')]=function(_0x42a32e,_0x386505){return db[_0xd7ef('0x32')][_0xd7ef('0x44')]({'where':{'id':_0x42a32e['params']['id']}})[_0xd7ef('0x12')](handleEntityNotFound(_0x386505,null))[_0xd7ef('0x12')](function(_0x97eb9b){if(_0x97eb9b){return _0x97eb9b[_0xd7ef('0xa8')](_0x42a32e[_0xd7ef('0x2e')][_0xd7ef('0x97')],_[_0xd7ef('0x98')](_0x42a32e['body'],[_0xd7ef('0x97'),'id'])||{})['spread'](function(){return db[_0xd7ef('0xa9')][_0xd7ef('0xa3')]({'attributes':['id',_0xd7ef('0x2a'),_0xd7ef('0xaa')],'where':{'id':_0x42a32e['body'][_0xd7ef('0x97')]}});})[_0xd7ef('0x12')](function(_0x3e8bd0){socket[_0xd7ef('0xab')](_0xd7ef('0xac'),{'id':Number(_0x42a32e[_0xd7ef('0x3a')]['id']),'tags':_0x3e8bd0||[]});return{'id':Number(_0x42a32e[_0xd7ef('0x3a')]['id']),'tags':_0x3e8bd0||[]};});}})[_0xd7ef('0x12')](respondWithResult(_0x386505,null))[_0xd7ef('0x1d')](handleError(_0x386505,null));};exports[_0xd7ef('0xad')]=function(_0xa65422,_0x1dffed){return db[_0xd7ef('0x32')][_0xd7ef('0x44')]({'where':{'id':_0xa65422[_0xd7ef('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1dffed,null))[_0xd7ef('0x12')](function(_0x55b704){if(_0x55b704){return _0x55b704[_0xd7ef('0xad')](_0xa65422['query'][_0xd7ef('0x97')]);}})[_0xd7ef('0x12')](respondWithStatusCode(_0x1dffed,null))[_0xd7ef('0x1d')](handleError(_0x1dffed,null));};exports[_0xd7ef('0x71')]=function(_0xe73fa2,_0x52f4ca){var _0xa124b0=moment()['unix']()[_0xd7ef('0xae')]();var _0x42f71c=path[_0xd7ef('0x70')](config[_0xd7ef('0x6f')],_0xd7ef('0xaf'),_0xd7ef('0xb0'),_0xd7ef('0xb1'));var _0x19527b=path[_0xd7ef('0x70')](config[_0xd7ef('0x6f')],'server',_0xd7ef('0xb0'),_0xd7ef('0xb2'));var _0x28c1e7=path[_0xd7ef('0x70')](_0x42f71c,_0xa124b0);var _0x53db13=util[_0xd7ef('0x74')](_0xd7ef('0xb3'),_0xe73fa2[_0xd7ef('0x3a')]['id'],_0xa124b0);var _0x563f60=path[_0xd7ef('0x70')](_0x42f71c,_0x53db13);var _0x17ef32=[];_0x17ef32[_0xd7ef('0xb4')]({'model':db[_0xd7ef('0x7a')],'as':_0xd7ef('0x7a'),'attributes':['id',_0xd7ef('0x87')],'raw':!![]});_0x17ef32['push']({'model':db[_0xd7ef('0x7b')],'as':_0xd7ef('0x5f'),'attributes':['id',_0xd7ef('0xb5'),_0xd7ef('0xb6')],'raw':!![]});if(_0xe73fa2['query'][_0xd7ef('0xb2')]){_0x17ef32[_0xd7ef('0xb4')]({'model':db[_0xd7ef('0x69')],'as':_0xd7ef('0x69'),'raw':!![]});}var _0x1d7699=[{'model':db['ChatMessage'],'as':_0xd7ef('0x79'),'attributes':['id',_0xd7ef('0x2e'),_0xd7ef('0x8a'),_0xd7ef('0x8c'),_0xd7ef('0x8d'),_0xd7ef('0xb7')],'include':_0x17ef32}];_0x1d7699[_0xd7ef('0xb4')]({'model':db[_0xd7ef('0x49')],'as':_0xd7ef('0xb8'),'attributes':['id',_0xd7ef('0x2a')]});_0x1d7699[_0xd7ef('0xb4')]({'model':db[_0xd7ef('0x7a')],'as':_0xd7ef('0xb9'),'attributes':['id',_0xd7ef('0x87')]});return db[_0xd7ef('0x32')]['find']({'where':{'id':_0xe73fa2[_0xd7ef('0x3a')]['id']},'include':_0x1d7699})[_0xd7ef('0x12')](handleEntityNotFound(_0x52f4ca,null))[_0xd7ef('0x12')](function(_0x566950){if(_0x566950){var _0x96b625=_0x566950[_0xd7ef('0xba')]({'plain':!![]});fs[_0xd7ef('0xbb')](_0x28c1e7);var _0x315484={'channel':_0xd7ef('0xbc'),'account':_0x96b625[_0xd7ef('0xb8')][_0xd7ef('0x2a')],'agent':_0x96b625[_0xd7ef('0xb9')]?_0x96b625[_0xd7ef('0xb9')][_0xd7ef('0x87')]:_0xd7ef('0xbd'),'createdAt':moment(_0x96b625[_0xd7ef('0x8a')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd7ef('0xae')](),'closedAt':_0x96b625[_0xd7ef('0x6b')]?moment(_0x96b625[_0xd7ef('0xbe')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x96b625[_0xd7ef('0xbf')],'chatInfo':{'browser':_0x96b625[_0xd7ef('0xc0')],'os':_0x96b625[_0xd7ef('0xc1')],'referer':_0x96b625['referer'],'customerIp':_0x96b625[_0xd7ef('0xc2')],'customerPort':_0x96b625[_0xd7ef('0xc3')]?_0x96b625[_0xd7ef('0xc3')]:_0xd7ef('0xbd')},'messages':_(_0x96b625[_0xd7ef('0x79')])['tail']()['filter']({'secret':![]})[_0xd7ef('0x31')](function(_0x4e29ff){if(_0x4e29ff['Attachment']){var _0x4e1708=path[_0xd7ef('0x70')](_0x19527b,_0x4e29ff['Attachment'][_0xd7ef('0x67')]);if(fs[_0xd7ef('0xc4')](_0x4e1708)){fs[_0xd7ef('0xc5')](_0x4e1708)['pipe'](fs[_0xd7ef('0xc6')](path['join'](_0x28c1e7,_0x4e29ff[_0xd7ef('0x69')]['basename'])));}}return{'date':moment(_0x4e29ff[_0xd7ef('0x8a')])[_0xd7ef('0x74')](_0xd7ef('0xc7'))[_0xd7ef('0xae')](),'sender':_0x4e29ff[_0xd7ef('0x8c')]==='out'?_0x4e29ff[_0xd7ef('0x7a')]?_0x4e29ff['User'][_0xd7ef('0x87')]:_0xd7ef('0x80'):_0x4e29ff[_0xd7ef('0x5f')]['firstName']+(_0x4e29ff[_0xd7ef('0x5f')][_0xd7ef('0xb6')]?'\x20'+_0x4e29ff[_0xd7ef('0x5f')][_0xd7ef('0xb6')]:''),'body':_0x4e29ff['Attachment']?_0x4e29ff['Attachment'][_0xd7ef('0x67')]:_0x4e29ff[_0xd7ef('0x2e')],'direction':_0x4e29ff['direction']===_0xd7ef('0xc8')?'A':'C','secret':_0x4e29ff['secret'],'read':_0x4e29ff[_0xd7ef('0xb7')],'attachment':_0x4e29ff[_0xd7ef('0x69')]};})[_0xd7ef('0xc9')]()};return ejs[_0xd7ef('0xca')](path[_0xd7ef('0x70')](config[_0xd7ef('0x6f')],_0xd7ef('0xaf'),_0xd7ef('0xcb'),_0xd7ef('0xcc')),{'interaction':_0x315484})[_0xd7ef('0x12')](function(_0x26b595){var _0x4a282e=path['join'](_0x28c1e7,_0xd7ef('0xcd')+_0x96b625['id']+'-'+_0xa124b0+_0xd7ef('0xce'));var _0x7b9a08={'path':_0x4a282e,'channel':_0xd7ef('0xbc'),'interactionId':_0x96b625['id']};return pdf[_0xd7ef('0xcf')](_0x26b595,_0x7b9a08);})[_0xd7ef('0x12')](function(){return new Promise(function(_0x463534,_0x139602){zipdir(_0x28c1e7,{'saveTo':_0x563f60},function(_0x3f0e3b,_0x4a1ebf){if(_0x3f0e3b)return _0x139602(_0x3f0e3b);return _0x463534(_0x4a1ebf);});})[_0xd7ef('0x12')](function(){return new BPromise(function(_0x24b20f,_0x1a2f7d){rimraf(_0x28c1e7,function(_0x2e75d6){if(_0x2e75d6)_0x1a2f7d(_0x2e75d6);return _0x24b20f();});});})[_0xd7ef('0x12')](function(){return _0x52f4ca['download'](_0x563f60,_0x53db13,function(_0x1a8c17){if(_0x1a8c17){logger['error'](_0xd7ef('0xd0'),_0x1a8c17);}else{fs[_0xd7ef('0xd1')](_0x563f60);}});});});}else{return _0x52f4ca['sendStatus'](0xc8);}})[_0xd7ef('0x1d')](handleError(_0x52f4ca,null));};
\ No newline at end of file
+var _0x28ff=['moment','bluebird','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','undefined','limit','count','offset','Content-Range','destroy','stack','name','render','contact','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','findAll','chat','query','user','params','model','keys','filters','attributes','intersection','fields','length','includeAll','merge','options','find','create','body','update','describe','findOne','ChatWebsite','vidaooEscalation','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','vidaooTopic','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','disposition','AbandonInteraction','file','basename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsiteId','UserId','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','agentAlias','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','include','rows','getMyMessages','includeAgent','push','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','createdAt','direction','Account','Owner','N.A.','toString','closed','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','lastName','read','value','renderFile','views','downloadInteraction.ejs','.pdf','Chat','err','rimraf','zip-dir'];(function(_0x3f129c,_0x576eaf){var _0x3f93b4=function(_0x5af028){while(--_0x5af028){_0x3f129c['push'](_0x3f129c['shift']());}};_0x3f93b4(++_0x576eaf);}(_0x28ff,0x19c));var _0xf28f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x28ff[_0x3bf83f];return _0x22c4a9;};'use strict';var rimraf=require(_0xf28f('0x0'));var zipdir=require(_0xf28f('0x1'));var rp=require('request-promise');var moment=require(_0xf28f('0x2'));var BPromise=require(_0xf28f('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf28f('0x4'));var ejs=require(_0xf28f('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xf28f('0x6'));var interaction=require(_0xf28f('0x7'));var qs=require(_0xf28f('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0xf28f('0x9'))('api');var config=require(_0xf28f('0xa'));var db=require(_0xf28f('0xb'))['db'];config[_0xf28f('0xc')]=_[_0xf28f('0xd')](config[_0xf28f('0xc')],{'host':_0xf28f('0xe'),'port':0x18eb});var socket=require(_0xf28f('0xf'))(new Redis(config[_0xf28f('0xc')]));require('./chatInteraction.socket')[_0xf28f('0x10')](socket);var jayson=require(_0xf28f('0x11'));var client=jayson['client'][_0xf28f('0x12')]({'port':0x232b});var client9004=jayson[_0xf28f('0x13')][_0xf28f('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x219e1e,_0x434627,_0x12149b,_0x505d48){return new BPromise(function(_0x4acbfc,_0x29210a){var _0xd2bbf9=_0x505d48||client;return _0xd2bbf9[_0xf28f('0x14')](_0x219e1e,_0x12149b)[_0xf28f('0x15')](function(_0xc8e81e){logger[_0xf28f('0x16')](_0xf28f('0x17'),_0x434627,_0xf28f('0x18'));logger[_0xf28f('0x19')](_0xf28f('0x1a'),_0x434627,_0xf28f('0x18'),JSON[_0xf28f('0x1b')](_0xc8e81e));if(_0xc8e81e[_0xf28f('0x1c')]){if(_0xc8e81e[_0xf28f('0x1c')][_0xf28f('0x1d')]===0x1f4){logger[_0xf28f('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x434627,_0xc8e81e[_0xf28f('0x1c')][_0xf28f('0x1e')]);return _0x29210a(_0xc8e81e[_0xf28f('0x1c')][_0xf28f('0x1e')]);}logger[_0xf28f('0x1c')](_0xf28f('0x17'),_0x434627,_0xc8e81e[_0xf28f('0x1c')][_0xf28f('0x1e')]);return _0x4acbfc(_0xc8e81e[_0xf28f('0x1c')][_0xf28f('0x1e')]);}else{logger[_0xf28f('0x16')](_0xf28f('0x17'),_0x434627,_0xf28f('0x18'));_0x4acbfc(_0xc8e81e[_0xf28f('0x1f')][_0xf28f('0x1e')]);}})[_0xf28f('0x20')](function(_0x42ba0e){logger[_0xf28f('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x434627,_0x42ba0e);_0x29210a(_0x42ba0e);});});}function respondWithStatusCode(_0x4ec373,_0x13333f){_0x13333f=_0x13333f||0xcc;return function(_0x1c141d){if(_0x1c141d){return _0x4ec373['sendStatus'](_0x13333f);}return _0x4ec373[_0xf28f('0x21')](_0x13333f)[_0xf28f('0x22')]();};}function respondWithResult(_0x5030bf,_0x5d1ada){_0x5d1ada=_0x5d1ada||0xc8;return function(_0x4fd57c){if(_0x4fd57c){return _0x5030bf[_0xf28f('0x21')](_0x5d1ada)[_0xf28f('0x23')](_0x4fd57c);}};}function respondWithFilteredResult(_0x2be8dc,_0x61ae83){return function(_0x502d6c){if(_0x502d6c){var _0x4ee2cd=typeof _0x61ae83['offset']===_0xf28f('0x24')&&typeof _0x61ae83[_0xf28f('0x25')]===_0xf28f('0x24');var _0x40c0aa=_0x502d6c[_0xf28f('0x26')];var _0xffcefa=_0x4ee2cd?0x0:_0x61ae83[_0xf28f('0x27')];var _0x543dfe=_0x4ee2cd?_0x502d6c[_0xf28f('0x26')]:_0x61ae83[_0xf28f('0x27')]+_0x61ae83[_0xf28f('0x25')];var _0x2519ab;if(_0x543dfe>=_0x40c0aa){_0x543dfe=_0x40c0aa;_0x2519ab=0xc8;}else{_0x2519ab=0xce;}_0x2be8dc[_0xf28f('0x21')](_0x2519ab);return _0x2be8dc['set'](_0xf28f('0x28'),_0xffcefa+'-'+_0x543dfe+'/'+_0x40c0aa)[_0xf28f('0x23')](_0x502d6c);}return null;};}function saveUpdates(_0x578ee1){return function(_0x4d561e){if(_0x4d561e){return _0x4d561e['update'](_0x578ee1)[_0xf28f('0x15')](function(_0xac21ff){return _0xac21ff;});}return null;};}function removeEntity(_0x4ba137){return function(_0xcff713){if(_0xcff713){return _0xcff713[_0xf28f('0x29')]()[_0xf28f('0x15')](function(){_0x4ba137[_0xf28f('0x21')](0xcc)[_0xf28f('0x22')]();});}};}function handleEntityNotFound(_0x295f7b){return function(_0x109891){if(!_0x109891){_0x295f7b['sendStatus'](0x194);}return _0x109891;};}function handleError(_0x1642c7,_0x32a961){_0x32a961=_0x32a961||0x1f4;return function(_0x20f932){logger[_0xf28f('0x1c')](_0x20f932[_0xf28f('0x2a')]);if(_0x20f932['name']){delete _0x20f932[_0xf28f('0x2b')];}_0x1642c7[_0xf28f('0x21')](_0x32a961)['send'](_0x20f932);};}function getMustacheRender(_0x3a2b77,_0x356bd2){return Mustache[_0xf28f('0x2c')](_0x3a2b77,_['merge'](_0x356bd2['body'],{'contact':_0x356bd2[_0xf28f('0x2d')],'message':_0x356bd2[_0xf28f('0x1e')],'agent':_0x356bd2['agent'],'interaction':_0x356bd2[_0xf28f('0x2e')],'account':_0x356bd2[_0xf28f('0x2f')]}))||'';}exports[_0xf28f('0x30')]=function(_0x25e51e,_0x961701){var _0xfc52a9={};var _0x50b221=_[_0xf28f('0x31')](db[_0xf28f('0x32')][_0xf28f('0x33')],function(_0x244f37){return{'name':_0x244f37[_0xf28f('0x34')],'type':_0x244f37[_0xf28f('0x35')][_0xf28f('0x36')]};});_0xfc52a9=qs['getOptions'](_0x50b221,_0x25e51e);return interaction[_0xf28f('0x37')](_0xf28f('0x38'),_0x25e51e[_0xf28f('0x39')],_0x25e51e[_0xf28f('0x3a')],_0xfc52a9,_0x50b221)['then'](respondWithFilteredResult(_0x961701,_0xfc52a9))[_0xf28f('0x20')](handleError(_0x961701,null));};exports['show']=function(_0x23c90d,_0x57c13f){var _0x48cb1e={'raw':![],'where':{'id':_0x23c90d[_0xf28f('0x3b')]['id']}},_0x12aa05={};_0x12aa05[_0xf28f('0x3c')]=_[_0xf28f('0x3d')](db[_0xf28f('0x32')][_0xf28f('0x33')]);_0x12aa05[_0xf28f('0x39')]=_[_0xf28f('0x3d')](_0x23c90d[_0xf28f('0x39')]);_0x12aa05[_0xf28f('0x3e')]=_['intersection'](_0x12aa05[_0xf28f('0x3c')],_0x12aa05[_0xf28f('0x39')]);_0x48cb1e[_0xf28f('0x3f')]=_[_0xf28f('0x40')](_0x12aa05[_0xf28f('0x3c')],qs['fields'](_0x23c90d[_0xf28f('0x39')][_0xf28f('0x41')]));_0x48cb1e['attributes']=_0x48cb1e[_0xf28f('0x3f')][_0xf28f('0x42')]?_0x48cb1e[_0xf28f('0x3f')]:_0x12aa05['model'];if(_0x23c90d[_0xf28f('0x39')][_0xf28f('0x43')]){_0x48cb1e['include']=[{'all':!![]}];}_0x48cb1e=_[_0xf28f('0x44')]({},_0x48cb1e,_0x23c90d[_0xf28f('0x45')]);return db[_0xf28f('0x32')][_0xf28f('0x46')](_0x48cb1e)[_0xf28f('0x15')](handleEntityNotFound(_0x57c13f,null))[_0xf28f('0x15')](respondWithResult(_0x57c13f,null))[_0xf28f('0x20')](handleError(_0x57c13f,null));};exports[_0xf28f('0x47')]=function(_0x349862,_0x13b7d2){return db[_0xf28f('0x32')][_0xf28f('0x47')](_0x349862[_0xf28f('0x48')],{})[_0xf28f('0x15')](respondWithResult(_0x13b7d2,0xc9))[_0xf28f('0x20')](handleError(_0x13b7d2,null));};exports[_0xf28f('0x49')]=function(_0x267877,_0x989567){if(_0x267877[_0xf28f('0x48')]['id']){delete _0x267877[_0xf28f('0x48')]['id'];}return db['ChatInteraction'][_0xf28f('0x46')]({'where':{'id':_0x267877['params']['id']}})[_0xf28f('0x15')](handleEntityNotFound(_0x989567,null))[_0xf28f('0x15')](saveUpdates(_0x267877[_0xf28f('0x48')],null))[_0xf28f('0x15')](respondWithResult(_0x989567,null))['catch'](handleError(_0x989567,null));};exports[_0xf28f('0x29')]=function(_0x3f666a,_0x3f0414){return db['ChatInteraction'][_0xf28f('0x46')]({'where':{'id':_0x3f666a[_0xf28f('0x3b')]['id']}})[_0xf28f('0x15')](handleEntityNotFound(_0x3f0414,null))[_0xf28f('0x15')](removeEntity(_0x3f0414,null))['catch'](handleError(_0x3f0414,null));};exports[_0xf28f('0x4a')]=function(_0x2a7359,_0x34cfba){return db[_0xf28f('0x32')][_0xf28f('0x4a')]()['then'](respondWithResult(_0x34cfba,null))[_0xf28f('0x20')](handleError(_0x34cfba,null));};exports['createVidaooSession']=function(_0x234e1f,_0x480c75){var _0xf2b71=_0x234e1f[_0xf28f('0x3b')]['id'];var _0x17bb31;var _0x821749;var _0x47d9d6;return db[_0xf28f('0x32')][_0xf28f('0x4b')]({'where':{'id':_0xf2b71}})[_0xf28f('0x15')](function(_0x11ff12){_0x17bb31=_0x11ff12;return db[_0xf28f('0x4c')][_0xf28f('0x4b')]({'where':{'id':_0x11ff12['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0xf28f('0x4d'),'vidaooTopic',_0xf28f('0x4e'),_0xf28f('0x4f')],'raw':!![]});})[_0xf28f('0x15')](function(_0xbf96de){if(_0xbf96de&&_0xbf96de[_0xf28f('0x50')]&&_0xbf96de['vidaooEscalation']){_0x821749=_0xbf96de;var _0x5aa773={'interaction':{'id':_0xf2b71},'agent':{'id':_0x234e1f['user']['id'],'name':_0x234e1f[_0xf28f('0x3a')][_0xf28f('0x2b')],'fullname':_0x234e1f[_0xf28f('0x3a')][_0xf28f('0x51')],'email':_0x234e1f[_0xf28f('0x3a')]['email']},'contact':_0x234e1f[_0xf28f('0x48')][_0xf28f('0x2d')],'account':_0x234e1f['body']['account']};var _0x5bc4dc={'rejectUnauthorized':![],'method':_0xf28f('0x52'),'url':_0xf28f('0x53'),'headers':{'X-APIKEY':_0xbf96de[_0xf28f('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x234e1f[_0xf28f('0x3a')][_0xf28f('0x54')]],'buttons':null,'topic':_0x821749[_0xf28f('0x55')],'note':_[_0xf28f('0x56')](_0x821749[_0xf28f('0x4e')])?null:getMustacheRender(_0x821749[_0xf28f('0x4e')],_0x5aa773),'metadata':null},'redirect':_0xf28f('0x57'),'json':!![]};try{if(!_[_0xf28f('0x56')](_0x821749['vidaooMetadata'])){var _0x19676f=getMustacheRender(_0x821749[_0xf28f('0x4f')],_0x5aa773);var _0x5bb257=JSON[_0xf28f('0x58')](_0x19676f);_0x5bc4dc['body'][_0xf28f('0x59')]=_0x5bb257;}}catch(_0xfcb353){throw new db[(_0xf28f('0x5a'))][(_0xf28f('0x5b'))](_0xf28f('0x5c'));}return rp(_0x5bc4dc);}else{throw new db[(_0xf28f('0x5a'))][(_0xf28f('0x5b'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xf28f('0x15')](function(_0xde2879){_0x47d9d6=_0xde2879;if(_0x47d9d6['id']){var _0x48fad6={'body':_0x47d9d6[_0xf28f('0x5d')],'ChatWebsiteId':_0x821749['id'],'ChatInteractionId':_0x17bb31['id'],'direction':_0xf28f('0x5e'),'UserId':_0x234e1f[_0xf28f('0x3a')]['id']};return db[_0xf28f('0x5f')][_0xf28f('0x47')](_0x48fad6,{});}else{throw new db[(_0xf28f('0x5a'))][(_0xf28f('0x5b'))](_0xf28f('0x60'));}})['then'](function(){return _0x17bb31[_0xf28f('0x61')]({'vidaooSessionId':_0x47d9d6['id']});})[_0xf28f('0x15')](respondWithResult(_0x480c75,null))[_0xf28f('0x20')](handleError(_0x480c75,null));};exports[_0xf28f('0x62')]=function(_0x3458f8,_0x2cb228){if(_0x3458f8[_0xf28f('0x48')]['id']){delete _0x3458f8[_0xf28f('0x48')]['id'];}return db[_0xf28f('0x32')][_0xf28f('0x46')]({'where':{'id':_0x3458f8[_0xf28f('0x3b')]['id']},'include':[{'model':db[_0xf28f('0x63')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x2cb228,null))[_0xf28f('0x15')](saveUpdates(_0x3458f8[_0xf28f('0x48')],null))[_0xf28f('0x15')](respondWithResult(_0x2cb228,null))[_0xf28f('0x20')](handleError(_0x2cb228,null));};exports[_0xf28f('0x64')]=function(_0x531ca4,_0x2af9e6){if(_0x531ca4[_0xf28f('0x48')]['id']){delete _0x531ca4[_0xf28f('0x48')]['id'];}return db[_0xf28f('0x32')][_0xf28f('0x46')]({'where':{'id':_0x531ca4[_0xf28f('0x3b')]['id']}})['then'](function(_0x14ed63){if(!_0x14ed63){logger[_0xf28f('0x1c')](_0xf28f('0x65'),_0xf28f('0x64'),0x194,_0xf28f('0x66'));_0x2af9e6[_0xf28f('0x67')](0x194);}else{if(_0x14ed63['UserId']){throw new db[(_0xf28f('0x5a'))][(_0xf28f('0x5b'))](_0xf28f('0x68'));}}return _0x14ed63;})[_0xf28f('0x15')](function(_0x31469d){if(_0x31469d){return _0x31469d['update']({'closed':_0x531ca4[_0xf28f('0x48')]['closed'],'disposition':_0x531ca4[_0xf28f('0x48')][_0xf28f('0x69')]})[_0xf28f('0x15')](function(_0x17e5b8){return _0x17e5b8;});}})[_0xf28f('0x15')](function(){return respondWithRpcPromise(_0xf28f('0x6a'),_0xf28f('0x64'),_0x531ca4[_0xf28f('0x48')],client9004);})[_0xf28f('0x15')](respondWithResult(_0x2af9e6,null))[_0xf28f('0x20')](handleError(_0x2af9e6,null));};exports['attachmentUpload']=function(_0x4409af,_0x33db99){_0x4409af[_0xf28f('0x48')][_0xf28f('0x2b')]=_0x4409af[_0xf28f('0x6b')]['originalname'];_0x4409af[_0xf28f('0x48')][_0xf28f('0x6c')]=_0x4409af[_0xf28f('0x6b')]['filename'];_0x4409af[_0xf28f('0x48')][_0xf28f('0x35')]=_0x4409af['file'][_0xf28f('0x6d')];return db[_0xf28f('0x6e')]['create'](_0x4409af[_0xf28f('0x48')])[_0xf28f('0x15')](respondWithResult(_0x33db99,0xc9))[_0xf28f('0x20')](handleError(_0x33db99,null));};exports['attachmentDownload']=function(_0xef041d,_0x5af1d3){return db[_0xf28f('0x32')][_0xf28f('0x4b')]({'where':{'id':_0xef041d[_0xf28f('0x3b')]['id']},'raw':!![]})[_0xf28f('0x15')](handleEntityNotFound(_0x5af1d3,null))['then'](function(_0x375f8f){if(_0x375f8f){if(_0x375f8f['closed']){return _0x5af1d3[_0xf28f('0x21')](0x193)[_0xf28f('0x23')]({'status':0x193,'message':_0xf28f('0x6f')});}return db[_0xf28f('0x6e')]['findOne']({'where':{'id':_0xef041d[_0xf28f('0x39')][_0xf28f('0x70')]},'raw':!![]})[_0xf28f('0x15')](handleEntityNotFound(_0x5af1d3,null));}})[_0xf28f('0x15')](function(_0x12c899){if(_0x12c899){var _0x23bd30=_0x12c899[_0xf28f('0x71')]!==null;var _0x355448=path[_0xf28f('0x72')](config[_0xf28f('0x73')],_0xf28f('0x74'));if(_0x23bd30){_0x355448=path['join'](_0x355448,'offline-chat/');}var _0x2299cf=path[_0xf28f('0x72')](_0x355448,_0x12c899[_0xf28f('0x6c')]);return _0x5af1d3[_0xf28f('0x75')](_0x2299cf);}})['catch'](handleError(_0x5af1d3,null));};exports[_0xf28f('0x76')]=function(_0x154ed7,_0x5652ce){var _0xd61065=null;var _0x598296=null;var _0x10b7e7=null;if(_0x154ed7['body']['id']){delete _0x154ed7[_0xf28f('0x48')]['id'];}if(_0x154ed7[_0xf28f('0x48')][_0xf28f('0x77')]){_0x10b7e7=path[_0xf28f('0x72')](config[_0xf28f('0x73')],_0xf28f('0x78'),util[_0xf28f('0x79')](_0xf28f('0x7a'),Date[_0xf28f('0x7b')]()));_0x154ed7[_0xf28f('0x48')][_0xf28f('0x7c')]=_0x10b7e7;}return db[_0xf28f('0x32')][_0xf28f('0x46')]({'where':{'id':_0x154ed7['params']['id']},'include':[{'model':db[_0xf28f('0x5f')],'as':_0xf28f('0x7d'),'include':[{'model':db[_0xf28f('0x7e')],'as':_0xf28f('0x7e')}]}]})[_0xf28f('0x15')](handleEntityNotFound(_0x5652ce,null))[_0xf28f('0x15')](saveUpdates(_0x154ed7['body'],null))[_0xf28f('0x15')](function(_0x331ef4){if(_0x331ef4){_0xd61065=_0x331ef4;return db['ChatWebsite'][_0xf28f('0x46')]({'where':{'id':_0xd61065[_0xf28f('0x7f')]}});}})[_0xf28f('0x15')](function(_0x3505f9){if(_0x3505f9){_0x598296=_0x3505f9;return db['CmContact'][_0xf28f('0x46')]({'where':{'id':_0xd61065['ContactId']}});}})[_0xf28f('0x15')](function(_0x34ca2a){if(_0x34ca2a){if(_0x10b7e7){var _0x5878f5=null;for(var _0x35a921=0x1;_0x35a921<_0xd61065[_0xf28f('0x7d')][_0xf28f('0x42')];++_0x35a921){_0x5878f5=_0xd61065[_0xf28f('0x7d')][_0x35a921];var _0xb0e64c=_0x5878f5[_0xf28f('0x80')]?util['format'](_0xf28f('0x81'),_0x598296['agentAlias'],_0x5878f5[_0xf28f('0x80')]):_0xf28f('0x82');var _0x2670f1=_0x154ed7[_0xf28f('0x48')][_0xf28f('0x83')]||util[_0xf28f('0x79')](_0xf28f('0x81'),_0xf28f('0x84'),_0x5878f5['ContactId']);switch(_0x598296[_0xf28f('0x85')]){case _0xf28f('0x86'):_0xb0e64c=_0x5878f5['UserId']?util[_0xf28f('0x79')](_0xf28f('0x81'),_0x598296['agentAlias'],_0x5878f5[_0xf28f('0x80')]):_0xf28f('0x82');break;case _0xf28f('0x87'):_0xb0e64c=_0x5878f5['UserId']?_0x5878f5[_0xf28f('0x7e')][_0xf28f('0x88')]||_0x5878f5[_0xf28f('0x7e')][_0xf28f('0x51')]:_0xf28f('0x82');break;case _0xf28f('0x89'):_0xb0e64c=_0x5878f5[_0xf28f('0x80')]?_0x5878f5[_0xf28f('0x7e')][_0xf28f('0x51')]:'System';break;default:_0xb0e64c=_0x5878f5[_0xf28f('0x80')]?util['format']('%s%d',_0x598296[_0xf28f('0x8a')],_0x5878f5[_0xf28f('0x80')]):_0xf28f('0x82');}var _0x3417f9=util[_0xf28f('0x79')]('[%s]\x20%s:\x20%s\x0a',moment(_0x5878f5['createdAt'])['format'](_0xf28f('0x8b')),_0x5878f5['direction']==='in'?_0x2670f1:_0xb0e64c,_0x5878f5['body']);if(!_0x5878f5[_0xf28f('0x8c')]){fs[_0xf28f('0x8d')](_0x10b7e7,_0x3417f9);}}return db[_0xf28f('0x8e')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf28f('0x8f'),'raw':!![],'include':[{'model':db[_0xf28f('0x90')],'as':_0xf28f('0x90'),'raw':!![]}]}]});}}})['then'](function(_0x2f6cef){if(!_0x2f6cef||!_0x2f6cef[_0xf28f('0x8f')]||!_0x154ed7[_0xf28f('0x48')])return _0xd61065;var _0x28fa5a=_0x2f6cef[_0xf28f('0x91')]();return respondWithRpcPromise('SendMail',_0xf28f('0x92'),{'account':_0x28fa5a,'message':{'from':util[_0xf28f('0x79')](_0xf28f('0x93'),_0x2f6cef['name'],_0x2f6cef[_0xf28f('0x54')]||_0x2f6cef['Smtp'][_0xf28f('0x3a')]),'to':_0x154ed7[_0xf28f('0x48')]['mailTranscript'],'subject':_0xf28f('0x94'),'text':util[_0xf28f('0x79')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x154ed7[_0xf28f('0x48')]['mailTranscript']),'attachments':[{'path':_0x10b7e7}]}})[_0xf28f('0x15')](function(){return _0xd61065;})['catch'](function(_0x271c68){logger[_0xf28f('0x1c')](_0x271c68);});})[_0xf28f('0x15')](respondWithStatusCode(_0x5652ce,0xc8))[_0xf28f('0x20')](handleError(_0x5652ce,null));};exports[_0xf28f('0x95')]=function(_0x354d26,_0x501f33){return db[_0xf28f('0x5f')][_0xf28f('0x46')]({'where':{'id':_0x354d26[_0xf28f('0x3b')]['id']}})[_0xf28f('0x15')](handleEntityNotFound(_0x501f33,null))[_0xf28f('0x15')](function(_0x2c7a21){if(_0x2c7a21){return _0x2c7a21[_0xf28f('0x95')](_0x354d26[_0xf28f('0x48')][_0xf28f('0x96')],_[_0xf28f('0x97')](_0x354d26[_0xf28f('0x48')],['ids','id'])||{});}})[_0xf28f('0x15')](respondWithResult(_0x501f33,null))[_0xf28f('0x20')](handleError(_0x501f33,null));};exports[_0xf28f('0x98')]=function(_0x74d590,_0x411dbe){var _0x3e86b3={'raw':![],'where':{}};var _0x3dc049={};var _0x3ecc96={'count':0x0,'rows':[]};return db[_0xf28f('0x32')][_0xf28f('0x4b')]({'where':{'id':_0x74d590['params']['id']}})[_0xf28f('0x15')](handleEntityNotFound(_0x411dbe,null))[_0xf28f('0x15')](function(_0x3ecf34){if(_0x3ecf34){_0x3dc049[_0xf28f('0x3c')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x3dc049[_0xf28f('0x39')]=_[_0xf28f('0x3d')](_0x74d590[_0xf28f('0x39')]);_0x3dc049[_0xf28f('0x3e')]=_[_0xf28f('0x40')](_0x3dc049[_0xf28f('0x3c')],_0x3dc049[_0xf28f('0x39')]);_0x3e86b3[_0xf28f('0x3f')]=_[_0xf28f('0x40')](_0x3dc049[_0xf28f('0x3c')],qs[_0xf28f('0x41')](_0x74d590[_0xf28f('0x39')][_0xf28f('0x41')]));_0x3e86b3[_0xf28f('0x3f')]=_0x3e86b3[_0xf28f('0x3f')][_0xf28f('0x42')]?_0x3e86b3['attributes']:_0x3dc049[_0xf28f('0x3c')];if(!_0x74d590[_0xf28f('0x39')][_0xf28f('0x99')](_0xf28f('0x9a'))){_0x3e86b3['limit']=qs[_0xf28f('0x25')](_0x74d590[_0xf28f('0x39')][_0xf28f('0x25')]);_0x3e86b3[_0xf28f('0x27')]=qs[_0xf28f('0x27')](_0x74d590[_0xf28f('0x39')][_0xf28f('0x27')]);}_0x3e86b3[_0xf28f('0x9b')]=qs[_0xf28f('0x9c')](_0x74d590[_0xf28f('0x39')][_0xf28f('0x9c')]);_0x3e86b3[_0xf28f('0x9d')]=qs['filters'](_[_0xf28f('0x9e')](_0x74d590[_0xf28f('0x39')],_0x3dc049['filters']));_0x3e86b3['where'][_0xf28f('0x9f')]=_0x3ecf34['id'];if(_0x74d590[_0xf28f('0x39')][_0xf28f('0xa0')]){_0x3e86b3[_0xf28f('0x9d')]=_[_0xf28f('0x44')](_0x3e86b3['where'],{'$or':_[_0xf28f('0x31')](_0x3e86b3[_0xf28f('0x3f')],function(_0x1bbc3e){var _0x12406d={};_0x12406d[_0x1bbc3e]={'$like':'%'+_0x74d590['query']['filter']+'%'};return _0x12406d;})});}if(_0x74d590[_0xf28f('0x39')][_0xf28f('0xa1')]){var _0xf91c98=_0x74d590[_0xf28f('0x39')][_0xf28f('0xa1')]['split'](',');var _0x2e900b={};_0x2e900b[_0xf91c98[0x0]]={'$gte':moment(_0xf91c98[0x1])['format'](_0xf28f('0xa2'))};_0x3e86b3[_0xf28f('0x9d')]=_[_0xf28f('0x44')](_0x3e86b3[_0xf28f('0x9d')],_0x2e900b);}_0x3e86b3=_['merge']({},_0x3e86b3,_0x74d590[_0xf28f('0x45')]);return db[_0xf28f('0x5f')][_0xf28f('0x26')]({'where':_0x3e86b3[_0xf28f('0x9d')]})[_0xf28f('0x15')](function(_0x4089e4){_0x3ecc96['count']=_0x4089e4;if(_0x74d590['query'][_0xf28f('0x43')]){_0x3e86b3[_0xf28f('0xa3')]=[{'all':!![]}];}return db['ChatMessage'][_0xf28f('0x37')](_0x3e86b3);})[_0xf28f('0x15')](function(_0x4b167a){_0x3ecc96[_0xf28f('0xa4')]=_0x4b167a;return _0x3ecc96;});}})[_0xf28f('0x15')](respondWithFilteredResult(_0x411dbe,_0x3e86b3))['catch'](handleError(_0x411dbe,null));};exports[_0xf28f('0xa5')]=function(_0x30a398,_0x1d6fc4){var _0x1d9ab2={'where':{}},_0x304bcc={},_0x1be847={'count':0x0,'rows':[]};return db[_0xf28f('0x32')]['findOne']({'where':{'id':_0x30a398[_0xf28f('0x3b')]['id']}})[_0xf28f('0x15')](handleEntityNotFound(_0x1d6fc4,null))['then'](function(_0x607639){if(_0x607639){_0x304bcc['model']=_[_0xf28f('0x3d')](db['ChatMessage'][_0xf28f('0x33')]);_0x304bcc['query']=_[_0xf28f('0x3d')](_0x30a398['query']);_0x304bcc['filters']=_[_0xf28f('0x40')](_0x304bcc[_0xf28f('0x3c')],_0x304bcc[_0xf28f('0x39')]);_0x1d9ab2[_0xf28f('0x3f')]=_['intersection'](_0x304bcc['model'],qs[_0xf28f('0x41')](_0x30a398[_0xf28f('0x39')]['fields']));_0x1d9ab2[_0xf28f('0x3f')]=_0x1d9ab2[_0xf28f('0x3f')]['length']?_0x1d9ab2[_0xf28f('0x3f')]:_0x304bcc[_0xf28f('0x3c')];if(!_0x30a398[_0xf28f('0x39')]['hasOwnProperty'](_0xf28f('0x9a'))){_0x1d9ab2[_0xf28f('0x25')]=qs[_0xf28f('0x25')](_0x30a398[_0xf28f('0x39')][_0xf28f('0x25')]);_0x1d9ab2[_0xf28f('0x27')]=qs[_0xf28f('0x27')](_0x30a398['query'][_0xf28f('0x27')]);}_0x1d9ab2[_0xf28f('0x9b')]=qs['sort'](_0x30a398[_0xf28f('0x39')]['sort']);_0x1d9ab2[_0xf28f('0x9d')]=qs[_0xf28f('0x3e')](_['pick'](_0x30a398[_0xf28f('0x39')],_0x304bcc[_0xf28f('0x3e')]));_0x1d9ab2[_0xf28f('0x9d')]['ChatInteractionId']=_0x607639['id'];if(_0x30a398[_0xf28f('0x39')][_0xf28f('0xa0')]){_0x1d9ab2[_0xf28f('0x9d')]=_[_0xf28f('0x44')](_0x1d9ab2[_0xf28f('0x9d')],{'$or':_['map'](_0x1d9ab2['attributes'],function(_0x34303e){var _0x2a97d4={};_0x2a97d4[_0x34303e]={'$like':'%'+_0x30a398['query']['filter']+'%'};return _0x2a97d4;})});}_0x1d9ab2[_0xf28f('0x9d')]['secret']=![];if(_0x30a398[_0xf28f('0x39')]['id']){_0x1d9ab2['where']['id']={'$gt':_0x30a398['query']['id']};}_0x1d9ab2=_['merge']({},_0x1d9ab2,_0x30a398[_0xf28f('0x45')]);return db[_0xf28f('0x5f')][_0xf28f('0x26')]({'where':_0x1d9ab2[_0xf28f('0x9d')]})[_0xf28f('0x15')](function(_0x395a85){_0x1be847[_0xf28f('0x26')]=_0x395a85;_0x1d9ab2[_0xf28f('0xa3')]=[];if(_0x30a398[_0xf28f('0x39')][_0xf28f('0xa6')]){_0x1d9ab2['include'][_0xf28f('0xa7')]({'model':db[_0xf28f('0x7e')],'as':_0xf28f('0x7e'),'attributes':['id',_0xf28f('0x51'),'alias']});}if(_0x30a398['query'][_0xf28f('0x43')]){_0x1d9ab2[_0xf28f('0xa3')]=[{'all':!![]}];}return db[_0xf28f('0x5f')][_0xf28f('0x37')](_0x1d9ab2);})[_0xf28f('0x15')](function(_0x37fa72){_0x1be847[_0xf28f('0xa4')]=_0x37fa72;return _0x1be847;});}})[_0xf28f('0x15')](respondWithFilteredResult(_0x1d6fc4,_0x1d9ab2))[_0xf28f('0x20')](handleError(_0x1d6fc4,null));};exports['addTags']=function(_0x2b5caa,_0xdf17eb){return db[_0xf28f('0x32')][_0xf28f('0x46')]({'where':{'id':_0x2b5caa[_0xf28f('0x3b')]['id']}})['then'](handleEntityNotFound(_0xdf17eb,null))[_0xf28f('0x15')](function(_0x13c8d1){if(_0x13c8d1){return _0x13c8d1[_0xf28f('0xa8')](_0x2b5caa[_0xf28f('0x48')][_0xf28f('0x96')],_[_0xf28f('0x97')](_0x2b5caa[_0xf28f('0x48')],[_0xf28f('0x96'),'id'])||{})[_0xf28f('0xa9')](function(){return db[_0xf28f('0xaa')]['findAll']({'attributes':['id','name',_0xf28f('0xab')],'where':{'id':_0x2b5caa[_0xf28f('0x48')][_0xf28f('0x96')]}});})[_0xf28f('0x15')](function(_0x49c5d9){socket[_0xf28f('0xac')](_0xf28f('0xad'),{'id':Number(_0x2b5caa['params']['id']),'tags':_0x49c5d9||[]});return{'id':Number(_0x2b5caa[_0xf28f('0x3b')]['id']),'tags':_0x49c5d9||[]};});}})['then'](respondWithResult(_0xdf17eb,null))[_0xf28f('0x20')](handleError(_0xdf17eb,null));};exports[_0xf28f('0xae')]=function(_0x16d409,_0x148b94){return db[_0xf28f('0x32')]['find']({'where':{'id':_0x16d409['params']['id']}})[_0xf28f('0x15')](handleEntityNotFound(_0x148b94,null))['then'](function(_0x287140){if(_0x287140){return _0x287140[_0xf28f('0xae')](_0x16d409[_0xf28f('0x39')]['ids']);}})[_0xf28f('0x15')](respondWithStatusCode(_0x148b94,null))[_0xf28f('0x20')](handleError(_0x148b94,null));};exports['download']=function(_0x34460c,_0x161b27){var _0x108c37=moment()['unix']()['toString']();var _0x807849=path[_0xf28f('0x72')](config[_0xf28f('0x73')],_0xf28f('0xaf'),_0xf28f('0xb0'),_0xf28f('0xb1'));var _0x3ef54e=path[_0xf28f('0x72')](config[_0xf28f('0x73')],_0xf28f('0xaf'),_0xf28f('0xb0'),_0xf28f('0xb2'));var _0x4a846a=path['join'](_0x807849,_0x108c37);var _0x2eafa1=util[_0xf28f('0x79')](_0xf28f('0xb3'),_0x34460c[_0xf28f('0x3b')]['id'],_0x108c37);var _0x296b75=path[_0xf28f('0x72')](_0x807849,_0x2eafa1);var _0x3b3cf7=[];_0x3b3cf7[_0xf28f('0xa7')]({'model':db[_0xf28f('0x7e')],'as':_0xf28f('0x7e'),'attributes':['id',_0xf28f('0x51')],'raw':!![]});_0x3b3cf7[_0xf28f('0xa7')]({'model':db[_0xf28f('0x63')],'as':_0xf28f('0xb4'),'attributes':['id',_0xf28f('0xb5'),'lastName'],'raw':!![]});if(_0x34460c[_0xf28f('0x39')][_0xf28f('0xb2')]){_0x3b3cf7[_0xf28f('0xa7')]({'model':db[_0xf28f('0x6e')],'as':_0xf28f('0x6e'),'raw':!![]});}var _0x22f4df=[{'model':db['ChatMessage'],'as':_0xf28f('0x7d'),'attributes':['id',_0xf28f('0x48'),_0xf28f('0xb6'),_0xf28f('0xb7'),_0xf28f('0x8c'),'read'],'include':_0x3b3cf7}];_0x22f4df['push']({'model':db[_0xf28f('0x4c')],'as':_0xf28f('0xb8'),'attributes':['id',_0xf28f('0x2b')]});_0x22f4df[_0xf28f('0xa7')]({'model':db[_0xf28f('0x7e')],'as':'Owner','attributes':['id',_0xf28f('0x51')]});return db[_0xf28f('0x32')][_0xf28f('0x46')]({'where':{'id':_0x34460c[_0xf28f('0x3b')]['id']},'include':_0x22f4df})[_0xf28f('0x15')](handleEntityNotFound(_0x161b27,null))['then'](function(_0x1b44a0){if(_0x1b44a0){var _0x7c1855=_0x1b44a0['get']({'plain':!![]});fs['mkdirSync'](_0x4a846a);var _0x55733d={'channel':'Chat','account':_0x7c1855[_0xf28f('0xb8')][_0xf28f('0x2b')],'agent':_0x7c1855[_0xf28f('0xb9')]?_0x7c1855['Owner'][_0xf28f('0x51')]:_0xf28f('0xba'),'createdAt':moment(_0x7c1855[_0xf28f('0xb6')])[_0xf28f('0x79')](_0xf28f('0xa2'))[_0xf28f('0xbb')](),'closedAt':_0x7c1855[_0xf28f('0xbc')]?moment(_0x7c1855[_0xf28f('0xbd')])[_0xf28f('0x79')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x7c1855['disposition'],'chatInfo':{'browser':_0x7c1855[_0xf28f('0xbe')],'os':_0x7c1855[_0xf28f('0xbf')],'referer':_0x7c1855['referer'],'customerIp':_0x7c1855[_0xf28f('0xc0')],'customerPort':_0x7c1855['customerPort']?_0x7c1855[_0xf28f('0xc1')]:'N.A.'},'messages':_(_0x7c1855['Messages'])[_0xf28f('0xc2')]()[_0xf28f('0xa0')]({'secret':![]})[_0xf28f('0x31')](function(_0x1a569e){if(_0x1a569e[_0xf28f('0x6e')]){var _0x583b57=path['join'](_0x3ef54e,_0x1a569e['Attachment'][_0xf28f('0x6c')]);if(fs[_0xf28f('0xc3')](_0x583b57)){fs['createReadStream'](_0x583b57)[_0xf28f('0xc4')](fs[_0xf28f('0xc5')](path[_0xf28f('0x72')](_0x4a846a,_0x1a569e[_0xf28f('0x6e')][_0xf28f('0x6c')])));}}return{'date':moment(_0x1a569e[_0xf28f('0xb6')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xf28f('0xbb')](),'sender':_0x1a569e[_0xf28f('0xb7')]===_0xf28f('0x5e')?_0x1a569e[_0xf28f('0x7e')]?_0x1a569e['User']['fullname']:'System':_0x1a569e[_0xf28f('0xb4')]['firstName']+(_0x1a569e['Contact'][_0xf28f('0xc6')]?'\x20'+_0x1a569e['Contact'][_0xf28f('0xc6')]:''),'body':_0x1a569e[_0xf28f('0x6e')]?_0x1a569e[_0xf28f('0x6e')][_0xf28f('0x6c')]:_0x1a569e['body'],'direction':_0x1a569e['direction']===_0xf28f('0x5e')?'A':'C','secret':_0x1a569e[_0xf28f('0x8c')],'read':_0x1a569e[_0xf28f('0xc7')],'attachment':_0x1a569e[_0xf28f('0x6e')]};})[_0xf28f('0xc8')]()};return ejs[_0xf28f('0xc9')](path[_0xf28f('0x72')](config[_0xf28f('0x73')],_0xf28f('0xaf'),_0xf28f('0xca'),_0xf28f('0xcb')),{'interaction':_0x55733d})['then'](function(_0x5db0be){var _0x5e726c=path[_0xf28f('0x72')](_0x4a846a,'transcript-'+_0x7c1855['id']+'-'+_0x108c37+_0xf28f('0xcc'));var _0x2a9986={'path':_0x5e726c,'channel':_0xf28f('0xcd'),'interactionId':_0x7c1855['id']};return pdf['createPdfFromHTML'](_0x5db0be,_0x2a9986);})[_0xf28f('0x15')](function(){return new Promise(function(_0x17d2e5,_0x1e0069){zipdir(_0x4a846a,{'saveTo':_0x296b75},function(_0x47a6dc,_0x149d3e){if(_0x47a6dc)return _0x1e0069(_0x47a6dc);return _0x17d2e5(_0x149d3e);});})['then'](function(){return new BPromise(function(_0x3abe7a,_0x59dcf5){rimraf(_0x4a846a,function(_0x137df3){if(_0x137df3)_0x59dcf5(_0x137df3);return _0x3abe7a();});});})[_0xf28f('0x15')](function(){return _0x161b27[_0xf28f('0x75')](_0x296b75,_0x2eafa1,function(_0x591dbe){if(_0x591dbe){logger[_0xf28f('0x1c')](_0xf28f('0xce'),_0x591dbe);}else{fs['unlinkSync'](_0x296b75);}});});});}else{return _0x161b27[_0xf28f('0x67')](0xc8);}})[_0xf28f('0x20')](handleError(_0x161b27,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 6efd787..1553fe8 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 _0x3e31=['ChatInteraction','ChatMessage','save','update','remove','getUsers','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb'];(function(_0x46306f,_0x5aef14){var _0x16a27f=function(_0x5526fd){while(--_0x5526fd){_0x46306f['push'](_0x46306f['shift']());}};_0x16a27f(++_0x5aef14);}(_0x3e31,0x6a));var _0x13e3=function(_0x574057,_0x21584c){_0x574057=_0x574057-0x0;var _0x2abba5=_0x3e31[_0x574057];return _0x2abba5;};'use strict';var EventEmitter=require(_0x13e3('0x0'));var ChatInteraction=require(_0x13e3('0x1'))['db'][_0x13e3('0x2')];var ChatMessage=require(_0x13e3('0x1'))['db'][_0x13e3('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x13e3('0x4'),'afterUpdate':_0x13e3('0x5'),'afterDestroy':_0x13e3('0x6')};function emitEvent(_0xf2c912){return function(_0x48b9a6,_0x1c7407,_0x4df08e){_0x48b9a6[_0x13e3('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x19d498){_0x48b9a6['setDataValue'](_0x13e3('0x8'),_0x19d498[_0x13e3('0x9')](function(_0x429b4f){return{'id':_0x429b4f['id']};}));return ChatMessage[_0x13e3('0xa')]({'where':{'ChatInteractionId':_0x48b9a6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2f11db){_0x48b9a6[_0x13e3('0xb')](_0x13e3('0xc'),_0x2f11db[_0x13e3('0xd')]);ChatInteractionEvents[_0x13e3('0xe')](_0xf2c912+':'+_0x48b9a6['id'],_0x48b9a6);ChatInteractionEvents[_0x13e3('0xe')](_0xf2c912,_0x48b9a6);_0x4df08e(null);})[_0x13e3('0xf')](_0x4df08e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x13e3('0x10')](e,emitEvent(event));}}module[_0x13e3('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xc932=['Users','map','unreadMessages','length','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','then','setDataValue'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xc932,0x18b));var _0x2c93=function(_0x1ed010,_0x734e0b){_0x1ed010=_0x1ed010-0x0;var _0x6e22bf=_0xc932[_0x1ed010];return _0x6e22bf;};'use strict';var EventEmitter=require(_0x2c93('0x0'));var ChatInteraction=require(_0x2c93('0x1'))['db'][_0x2c93('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x2c93('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2c93('0x4')](0x0);var events={'afterCreate':_0x2c93('0x5'),'afterUpdate':_0x2c93('0x6'),'afterDestroy':_0x2c93('0x7')};function emitEvent(_0x4a2f7d){return function(_0x545242,_0x188290,_0x591935){_0x545242['getUsers']({'attributes':['id'],'raw':!![]})[_0x2c93('0x8')](function(_0x32af51){_0x545242[_0x2c93('0x9')](_0x2c93('0xa'),_0x32af51[_0x2c93('0xb')](function(_0x2f1a60){return{'id':_0x2f1a60['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x545242['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2c93('0x8')](function(_0x362059){_0x545242[_0x2c93('0x9')](_0x2c93('0xc'),_0x362059[_0x2c93('0xd')]);ChatInteractionEvents['emit'](_0x4a2f7d+':'+_0x545242['id'],_0x545242);ChatInteractionEvents['emit'](_0x4a2f7d,_0x545242);_0x591935(null);})['catch'](_0x591935(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x2c93('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 716daf4..73e529e 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 _0xc7b2=['ChatInteraction','chat_interactions','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','define'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xc7b2,0x1c5));var _0x2c7b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7b2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2c7b('0x0'));var util=require(_0x2c7b('0x1'));var logger=require(_0x2c7b('0x2'))(_0x2c7b('0x3'));var moment=require(_0x2c7b('0x4'));var BPromise=require(_0x2c7b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c7b('0x6'));var rimraf=require(_0x2c7b('0x7'));var config=require(_0x2c7b('0x8'));var attributes=require(_0x2c7b('0x9'));module['exports']=function(_0x5cc414,_0x46aad1){return _0x5cc414[_0x2c7b('0xa')](_0x2c7b('0xb'),attributes,{'tableName':_0x2c7b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1d83e8,_0x1acaa1,_0x7792b0){if(_0x1d83e8['changed']('closed')){_0x1d83e8['closedAt']=moment()[_0x2c7b('0xd')](_0x2c7b('0xe'));}_0x7792b0(null,_0x1d83e8);}},'charset':'utf8mb4','collate':_0x2c7b('0xf')});};
\ No newline at end of file
+var _0x2f7c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','ChatInteraction','chat_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x2843ea,_0x30621e){var _0x11e537=function(_0x5eac5a){while(--_0x5eac5a){_0x2843ea['push'](_0x2843ea['shift']());}};_0x11e537(++_0x30621e);}(_0x2f7c,0x1c9));var _0xc2f7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2f7c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc2f7('0x0'));var util=require(_0xc2f7('0x1'));var logger=require('../../config/logger')(_0xc2f7('0x2'));var moment=require(_0xc2f7('0x3'));var BPromise=require(_0xc2f7('0x4'));var rp=require(_0xc2f7('0x5'));var fs=require('fs');var path=require(_0xc2f7('0x6'));var rimraf=require(_0xc2f7('0x7'));var config=require(_0xc2f7('0x8'));var attributes=require(_0xc2f7('0x9'));module['exports']=function(_0x320765,_0x4b8166){return _0x320765['define'](_0xc2f7('0xa'),attributes,{'tableName':_0xc2f7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2db062,_0x82015c,_0x207740){if(_0x2db062[_0xc2f7('0xc')]('closed')){_0x2db062['closedAt']=moment()[_0xc2f7('0xd')](_0xc2f7('0xe'));}_0x207740(null,_0x2db062);}},'charset':_0xc2f7('0xf'),'collate':_0xc2f7('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 4a7cb3b..da54c9f 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 _0x1978=['http','defaults','redis','localhost','socket.io-emitter','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','limit','AddTagsToChatInteraction','find','addTags','body','omit','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x51b661,_0x566ef8){var _0x5d1971=function(_0x5cc6b8){while(--_0x5cc6b8){_0x51b661['push'](_0x51b661['shift']());}};_0x5d1971(++_0x566ef8);}(_0x1978,0x1a3));var _0x8197=function(_0x303357,_0x221d68){_0x303357=_0x303357-0x0;var _0x343b09=_0x1978[_0x303357];return _0x343b09;};'use strict';var _=require('lodash');var util=require(_0x8197('0x0'));var moment=require(_0x8197('0x1'));var BPromise=require(_0x8197('0x2'));var rs=require(_0x8197('0x3'));var fs=require('fs');var Redis=require(_0x8197('0x4'));var db=require(_0x8197('0x5'))['db'];var utils=require(_0x8197('0x6'));var logger=require(_0x8197('0x7'))(_0x8197('0x8'));var config=require(_0x8197('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8197('0xa')][_0x8197('0xb')]({'port':0x232a});config['redis']=_[_0x8197('0xc')](config[_0x8197('0xd')],{'host':_0x8197('0xe'),'port':0x18eb});var socket=require(_0x8197('0xf'))(new Redis(config[_0x8197('0xd')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x25c02b,_0xb78e41,_0x33c7bf){return new BPromise(function(_0x5c126e,_0x13fbc3){return client[_0x8197('0x10')](_0x25c02b,_0x33c7bf)[_0x8197('0x11')](function(_0x150cf7){logger[_0x8197('0x12')](_0x8197('0x13'),_0xb78e41,'request\x20sent');logger[_0x8197('0x14')](_0x8197('0x15'),_0xb78e41,_0x8197('0x16'),JSON[_0x8197('0x17')](_0x150cf7));if(_0x150cf7[_0x8197('0x18')]){if(_0x150cf7[_0x8197('0x18')][_0x8197('0x19')]===0x1f4){logger[_0x8197('0x18')](_0x8197('0x13'),_0xb78e41,_0x150cf7[_0x8197('0x18')][_0x8197('0x1a')]);return _0x13fbc3(_0x150cf7['error'][_0x8197('0x1a')]);}logger[_0x8197('0x18')](_0x8197('0x13'),_0xb78e41,_0x150cf7[_0x8197('0x18')]['message']);return _0x5c126e(_0x150cf7[_0x8197('0x18')][_0x8197('0x1a')]);}else{logger['info'](_0x8197('0x13'),_0xb78e41,_0x8197('0x16'));_0x5c126e(_0x150cf7['result'][_0x8197('0x1a')]);}})[_0x8197('0x1b')](function(_0x5b6269){logger['error'](_0x8197('0x13'),_0xb78e41,_0x5b6269);_0x13fbc3(_0x5b6269);});});}exports[_0x8197('0x1c')]=function(_0x30afc1){var _0x228b4a=this;return new Promise(function(_0x42279a,_0x56097f){return db[_0x8197('0x1d')][_0x8197('0x1e')](_0x30afc1['body'],{'raw':_0x30afc1[_0x8197('0x1f')]?_0x30afc1[_0x8197('0x1f')][_0x8197('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30afc1[_0x8197('0x1f')]?_0x30afc1[_0x8197('0x1f')][_0x8197('0x21')]||null:null,'attributes':_0x30afc1['options']?_0x30afc1[_0x8197('0x1f')]['attributes']||null:null,'limit':_0x30afc1[_0x8197('0x1f')]?_0x30afc1['options'][_0x8197('0x22')]||null:null})['then'](function(_0x2def43){logger[_0x8197('0x12')](_0x8197('0x1c'),_0x30afc1);logger[_0x8197('0x14')](_0x8197('0x1c'),_0x30afc1,JSON[_0x8197('0x17')](_0x2def43));_0x42279a(_0x2def43);})['catch'](function(_0x5aaa33){logger['error'](_0x8197('0x1c'),_0x5aaa33['message'],_0x30afc1);_0x56097f(_0x228b4a[_0x8197('0x18')](0x1f4,_0x5aaa33[_0x8197('0x1a')]));});});};exports[_0x8197('0x23')]=function(_0x162ca4){return new Promise(function(_0x4e50c5,_0x2e3254){return db['ChatInteraction'][_0x8197('0x24')]({'where':_0x162ca4['options']?_0x162ca4['options'][_0x8197('0x21')]||null:null})['then'](function(_0x16a41f){if(_0x16a41f){return _0x16a41f[_0x8197('0x25')](_0x162ca4[_0x8197('0x26')]['ids'],_[_0x8197('0x27')](_0x162ca4[_0x8197('0x26')],[_0x8197('0x28'),'id'])||{});}})[_0x8197('0x29')](function(_0x52fd75){logger[_0x8197('0x12')](_0x8197('0x2a'),_0x162ca4);logger[_0x8197('0x14')]('AddTags',_0x162ca4,JSON['stringify'](_0x52fd75));_0x4e50c5(_0x52fd75);})['catch'](function(_0x5332f9){logger[_0x8197('0x18')]('AddTags',_0x5332f9[_0x8197('0x1a')],_0x162ca4);_0x2e3254(_this[_0x8197('0x18')](0x1f4,_0x5332f9[_0x8197('0x1a')]));});});};
\ No newline at end of file
+var _0x0af4=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','where','limit','then','AddTagsToChatInteraction','find','addTags','ids','omit','body','spread','AddTags','lodash','util','moment','bluebird'];(function(_0x2c9b2a,_0x5d5c58){var _0x47039c=function(_0x2f747d){while(--_0x2f747d){_0x2c9b2a['push'](_0x2c9b2a['shift']());}};_0x47039c(++_0x5d5c58);}(_0x0af4,0xd8));var _0x40af=function(_0x4b7ca2,_0x486d18){_0x4b7ca2=_0x4b7ca2-0x0;var _0x1a10ca=_0x0af4[_0x4b7ca2];return _0x1a10ca;};'use strict';var _=require(_0x40af('0x0'));var util=require(_0x40af('0x1'));var moment=require(_0x40af('0x2'));var BPromise=require(_0x40af('0x3'));var rs=require(_0x40af('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x40af('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x40af('0x6'))(_0x40af('0x7'));var config=require(_0x40af('0x8'));var jayson=require(_0x40af('0x9'));var client=jayson[_0x40af('0xa')][_0x40af('0xb')]({'port':0x232a});config[_0x40af('0xc')]=_[_0x40af('0xd')](config[_0x40af('0xc')],{'host':_0x40af('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x40af('0xf'))[_0x40af('0x10')](socket);function respondWithRpcPromise(_0x1fee39,_0x3ed74c,_0x17ca03){return new BPromise(function(_0x2169a0,_0x76518d){return client[_0x40af('0x11')](_0x1fee39,_0x17ca03)['then'](function(_0xd1da56){logger[_0x40af('0x12')](_0x40af('0x13'),_0x3ed74c,'request\x20sent');logger[_0x40af('0x14')](_0x40af('0x15'),_0x3ed74c,_0x40af('0x16'),JSON[_0x40af('0x17')](_0xd1da56));if(_0xd1da56['error']){if(_0xd1da56[_0x40af('0x18')][_0x40af('0x19')]===0x1f4){logger['error'](_0x40af('0x13'),_0x3ed74c,_0xd1da56['error'][_0x40af('0x1a')]);return _0x76518d(_0xd1da56[_0x40af('0x18')]['message']);}logger[_0x40af('0x18')](_0x40af('0x13'),_0x3ed74c,_0xd1da56[_0x40af('0x18')][_0x40af('0x1a')]);return _0x2169a0(_0xd1da56[_0x40af('0x18')][_0x40af('0x1a')]);}else{logger[_0x40af('0x12')](_0x40af('0x13'),_0x3ed74c,'request\x20sent');_0x2169a0(_0xd1da56[_0x40af('0x1b')][_0x40af('0x1a')]);}})[_0x40af('0x1c')](function(_0x2f59ca){logger[_0x40af('0x18')](_0x40af('0x13'),_0x3ed74c,_0x2f59ca);_0x76518d(_0x2f59ca);});});}exports[_0x40af('0x1d')]=function(_0x528f76){var _0x2c55db=this;return new Promise(function(_0x31093c,_0x32782e){return db[_0x40af('0x1e')][_0x40af('0x1f')](_0x528f76['body'],{'raw':_0x528f76[_0x40af('0x20')]?_0x528f76[_0x40af('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x528f76[_0x40af('0x20')]?_0x528f76[_0x40af('0x20')][_0x40af('0x21')]||null:null,'attributes':_0x528f76[_0x40af('0x20')]?_0x528f76[_0x40af('0x20')]['attributes']||null:null,'limit':_0x528f76[_0x40af('0x20')]?_0x528f76[_0x40af('0x20')][_0x40af('0x22')]||null:null})[_0x40af('0x23')](function(_0x5dce56){logger[_0x40af('0x12')](_0x40af('0x1d'),_0x528f76);logger[_0x40af('0x14')]('UpdateChatInteraction',_0x528f76,JSON[_0x40af('0x17')](_0x5dce56));_0x31093c(_0x5dce56);})[_0x40af('0x1c')](function(_0x4489bf){logger[_0x40af('0x18')](_0x40af('0x1d'),_0x4489bf['message'],_0x528f76);_0x32782e(_0x2c55db[_0x40af('0x18')](0x1f4,_0x4489bf[_0x40af('0x1a')]));});});};exports[_0x40af('0x24')]=function(_0x334d54){return new Promise(function(_0x1841e3,_0x32f5bd){return db['ChatInteraction'][_0x40af('0x25')]({'where':_0x334d54[_0x40af('0x20')]?_0x334d54[_0x40af('0x20')][_0x40af('0x21')]||null:null})[_0x40af('0x23')](function(_0xe2c85a){if(_0xe2c85a){return _0xe2c85a[_0x40af('0x26')](_0x334d54['body'][_0x40af('0x27')],_[_0x40af('0x28')](_0x334d54[_0x40af('0x29')],[_0x40af('0x27'),'id'])||{});}})[_0x40af('0x2a')](function(_0x2e9d15){logger[_0x40af('0x12')](_0x40af('0x2b'),_0x334d54);logger['debug'](_0x40af('0x2b'),_0x334d54,JSON[_0x40af('0x17')](_0x2e9d15));_0x1841e3(_0x2e9d15);})[_0x40af('0x1c')](function(_0x39ffca){logger[_0x40af('0x18')]('AddTags',_0x39ffca[_0x40af('0x1a')],_0x334d54);_0x32f5bd(_this['error'](0x1f4,_0x39ffca['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index c49f03c..841a46a 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 _0xe6ef=['removeListener','register','length','chatInteraction:','remove','update','emit'];(function(_0x51dd5d,_0x4a018c){var _0x457e3d=function(_0xce2260){while(--_0xce2260){_0x51dd5d['push'](_0x51dd5d['shift']());}};_0x457e3d(++_0x4a018c);}(_0xe6ef,0xba));var _0xfe6e=function(_0x34ffe5,_0x1450cd){_0x34ffe5=_0x34ffe5-0x0;var _0x52298d=_0xe6ef[_0x34ffe5];return _0x52298d;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0xfe6e('0x0'),_0xfe6e('0x1')];function createListener(_0x1e9b71,_0x551264){return function(_0x3b2fbf){_0x551264[_0xfe6e('0x2')](_0x1e9b71,_0x3b2fbf);};}function removeListener(_0x5c4e64,_0x433fb4){return function(){ChatInteractionEvents[_0xfe6e('0x3')](_0x5c4e64,_0x433fb4);};}exports[_0xfe6e('0x4')]=function(_0xf3673){for(var _0xe61a4a=0x0,_0x5ed355=events[_0xfe6e('0x5')];_0xe61a4a<_0x5ed355;_0xe61a4a++){var _0x3d0202=events[_0xe61a4a];var _0x3daf9c=createListener(_0xfe6e('0x6')+_0x3d0202,_0xf3673);ChatInteractionEvents['on'](_0x3d0202,_0x3daf9c);}};
\ No newline at end of file
+var _0x37a4=['remove','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x22d1bd,_0x387be8){var _0x1cb3a6=function(_0x5865a7){while(--_0x5865a7){_0x22d1bd['push'](_0x22d1bd['shift']());}};_0x1cb3a6(++_0x387be8);}(_0x37a4,0xcb));var _0x437a=function(_0x5b1dc7,_0x5ca18a){_0x5b1dc7=_0x5b1dc7-0x0;var _0x4c88c3=_0x37a4[_0x5b1dc7];return _0x4c88c3;};'use strict';var ChatInteractionEvents=require(_0x437a('0x0'));var events=['save',_0x437a('0x1'),'update'];function createListener(_0x421d01,_0x35f27e){return function(_0x1d6ff4){_0x35f27e['emit'](_0x421d01,_0x1d6ff4);};}function removeListener(_0x5f2883,_0xf52f1a){return function(){ChatInteractionEvents[_0x437a('0x2')](_0x5f2883,_0xf52f1a);};}exports[_0x437a('0x3')]=function(_0x1b637a){for(var _0x5f5067=0x0,_0x1c567f=events[_0x437a('0x4')];_0x5f5067<_0x1c567f;_0x5f5067++){var _0x5017ce=events[_0x5f5067];var _0x36270b=createListener(_0x437a('0x5')+_0x5017ce,_0x1b637a);ChatInteractionEvents['on'](_0x5017ce,_0x36270b);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 532ff1c..bfbd04e 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 _0x0a41=['customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','post','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','%s-%s','originalname','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','put','/:id','chat','/:id/custom_update'];(function(_0x38a235,_0x2c9c3e){var _0x13db0c=function(_0x30408c){while(--_0x30408c){_0x38a235['push'](_0x38a235['shift']());}};_0x13db0c(++_0x2c9c3e);}(_0x0a41,0x1e1));var _0x10a4=function(_0x7a1589,_0x58e8d2){_0x7a1589=_0x7a1589-0x0;var _0x570127=_0x0a41[_0x7a1589];return _0x570127;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x10a4('0x0')]();var fs_extra=require(_0x10a4('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x10a4('0x2'));var config=require(_0x10a4('0x3'));var controller=require(_0x10a4('0x4'));router[_0x10a4('0x5')]('/',auth[_0x10a4('0x6')](),controller[_0x10a4('0x7')]);router[_0x10a4('0x5')]('/describe',auth[_0x10a4('0x6')](),controller[_0x10a4('0x8')]);router[_0x10a4('0x5')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0x10a4('0x9')]);router[_0x10a4('0x5')](_0x10a4('0xa'),auth[_0x10a4('0xb')](),controller[_0x10a4('0xc')]);router['get'](_0x10a4('0xd'),auth[_0x10a4('0x6')](),controller[_0x10a4('0xe')]);router[_0x10a4('0x5')]('/:id/my_messages',auth[_0x10a4('0xb')](),controller[_0x10a4('0xf')]);router['get'](_0x10a4('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x10a4('0x11')]('/',auth[_0x10a4('0x6')](),controller['create']);router[_0x10a4('0x11')](_0x10a4('0x12'),auth[_0x10a4('0x6')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x10a4('0x13')]({'destination':function(_0x57c6ba,_0x4ff945,_0x17c2c0){_0x17c2c0(null,path[_0x10a4('0x14')](config[_0x10a4('0x15')],_0x10a4('0x16')));},'filename':function(_0x1a8266,_0x1d0f59,_0x1a4f22){_0x1a4f22(null,util['format'](_0x10a4('0x17'),Date['now'](),_0x1d0f59[_0x10a4('0x18')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x10a4('0x11')]('/:id/attachment_upload',upload['single'](_0x10a4('0x19')),controller[_0x10a4('0x1a')]);router[_0x10a4('0x11')](_0x10a4('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x10a4('0x1b')]);router['post'](_0x10a4('0x1c'),auth['isAuthenticated'](),interaction[_0x10a4('0x1d')]('chat',_0x10a4('0x1e')),controller['addTags']);router[_0x10a4('0x1f')](_0x10a4('0x20'),auth[_0x10a4('0x6')](),interaction[_0x10a4('0x1d')](_0x10a4('0x21'),'chatinteraction:update'),controller['update']);router[_0x10a4('0x1f')](_0x10a4('0x22'),controller[_0x10a4('0x23')]);router[_0x10a4('0x1f')](_0x10a4('0x24'),auth[_0x10a4('0xb')](),controller[_0x10a4('0x25')]);router[_0x10a4('0x1f')](_0x10a4('0x26'),controller['close']);router[_0x10a4('0x27')](_0x10a4('0x20'),auth['isAuthenticated'](),interaction[_0x10a4('0x1d')](_0x10a4('0x21'),_0x10a4('0x28')),controller[_0x10a4('0x29')]);router[_0x10a4('0x27')]('/:id/tags',auth[_0x10a4('0x6')](),controller[_0x10a4('0x2a')]);module['exports']=router;
\ No newline at end of file
+var _0x542b=['chatinteraction:addtags','addTags','put','update','/:id/custom_update','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','/:id/messages','/:id/tags','tracked','chat'];(function(_0x323ce0,_0x581cb1){var _0x167048=function(_0x54157f){while(--_0x54157f){_0x323ce0['push'](_0x323ce0['shift']());}};_0x167048(++_0x581cb1);}(_0x542b,0x1d6));var _0xb542=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x542b[_0x9c2427];return _0x51984f;};'use strict';var multer=require(_0xb542('0x0'));var util=require(_0xb542('0x1'));var path=require(_0xb542('0x2'));var timeout=require(_0xb542('0x3'));var express=require(_0xb542('0x4'));var router=express[_0xb542('0x5')]();var fs_extra=require(_0xb542('0x6'));var auth=require(_0xb542('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb542('0x8'));var controller=require(_0xb542('0x9'));router[_0xb542('0xa')]('/',auth[_0xb542('0xb')](),controller[_0xb542('0xc')]);router[_0xb542('0xa')]('/describe',auth[_0xb542('0xb')](),controller[_0xb542('0xd')]);router[_0xb542('0xa')](_0xb542('0xe'),auth[_0xb542('0xf')](),controller['show']);router['get'](_0xb542('0x10'),auth[_0xb542('0xf')](),controller[_0xb542('0x11')]);router['get']('/:id/messages',auth[_0xb542('0xb')](),controller[_0xb542('0x12')]);router[_0xb542('0xa')](_0xb542('0x13'),auth[_0xb542('0xf')](),controller[_0xb542('0x14')]);router[_0xb542('0xa')](_0xb542('0x15'),auth[_0xb542('0xb')](),controller[_0xb542('0x16')]);router['post']('/',auth[_0xb542('0xb')](),controller[_0xb542('0x17')]);router[_0xb542('0x18')](_0xb542('0x19'),auth['isAuthenticated'](),controller[_0xb542('0x1a')]);var upload=multer({'storage':multer[_0xb542('0x1b')]({'destination':function(_0x2fafd4,_0x50253f,_0x1db2b6){_0x1db2b6(null,path['join'](config[_0xb542('0x1c')],_0xb542('0x1d')));},'filename':function(_0x435816,_0x25533d,_0xcd0e57){_0xcd0e57(null,util[_0xb542('0x1e')](_0xb542('0x1f'),Date[_0xb542('0x20')](),_0x25533d[_0xb542('0x21')][_0xb542('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xb542('0x23'),upload['single']('file'),controller['attachmentUpload']);router[_0xb542('0x18')](_0xb542('0x24'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0xb542('0x18')](_0xb542('0x25'),auth['isAuthenticated'](),interaction[_0xb542('0x26')](_0xb542('0x27'),_0xb542('0x28')),controller[_0xb542('0x29')]);router[_0xb542('0x2a')](_0xb542('0xe'),auth[_0xb542('0xb')](),interaction[_0xb542('0x26')](_0xb542('0x27'),'chatinteraction:update'),controller[_0xb542('0x2b')]);router[_0xb542('0x2a')](_0xb542('0x2c'),controller['customUpdate']);router[_0xb542('0x2a')]('/:id/abandon',auth[_0xb542('0xf')](),controller[_0xb542('0x2d')]);router[_0xb542('0x2a')]('/:id/close',controller[_0xb542('0x2e')]);router[_0xb542('0x2f')](_0xb542('0xe'),auth['isAuthenticated'](),interaction[_0xb542('0x26')](_0xb542('0x27'),_0xb542('0x30')),controller[_0xb542('0x31')]);router[_0xb542('0x2f')](_0xb542('0x25'),auth[_0xb542('0xb')](),controller[_0xb542('0x32')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 0d629e1..c65021b 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 _0xc634=['exports','medium','BOOLEAN','sequelize'];(function(_0xd293ef,_0x4f7e6b){var _0x5e0e20=function(_0x2f1961){while(--_0x2f1961){_0xd293ef['push'](_0xd293ef['shift']());}};_0x5e0e20(++_0x4f7e6b);}(_0xc634,0x1b3));var _0x4c63=function(_0xbbcb36,_0x586383){_0xbbcb36=_0xbbcb36-0x0;var _0x4278ff=_0xc634[_0xbbcb36];return _0x4278ff;};'use strict';var Sequelize=require(_0x4c63('0x0'));module[_0x4c63('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4c63('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4c63('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xeb0a=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x2e977b,_0x15b5c3){var _0x5306f8=function(_0x58d724){while(--_0x58d724){_0x2e977b['push'](_0x2e977b['shift']());}};_0x5306f8(++_0x15b5c3);}(_0xeb0a,0x1c9));var _0xaeb0=function(_0x48cb1f,_0x5ca68d){_0x48cb1f=_0x48cb1f-0x0;var _0x172c4d=_0xeb0a[_0x48cb1f];return _0x172c4d;};'use strict';var Sequelize=require(_0xaeb0('0x0'));module[_0xaeb0('0x1')]={'body':{'type':Sequelize[_0xaeb0('0x2')](_0xaeb0('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xaeb0('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xaeb0('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index fcd14da..3f6f711 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 _0xac05=['show','find','create','body','params','describe','catch','get','lastMessageAt','createdAt','lastMessage','getUsers','User','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','filter','agent','push','messages','FromId','all','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','keys','filters','model','query','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows'];(function(_0x144ec5,_0x499f0e){var _0x212a7b=function(_0x10616d){while(--_0x10616d){_0x144ec5['push'](_0x144ec5['shift']());}};_0x212a7b(++_0x499f0e);}(_0xac05,0x1e2));var _0x5ac0=function(_0x32b710,_0x349865){_0x32b710=_0x32b710-0x0;var _0x48cc13=_0xac05[_0x32b710];return _0x48cc13;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5ac0('0x0'));var rp=require(_0x5ac0('0x1'));var moment=require(_0x5ac0('0x2'));var BPromise=require(_0x5ac0('0x3'));var Mustache=require('mustache');var util=require(_0x5ac0('0x4'));var path=require(_0x5ac0('0x5'));var sox=require(_0x5ac0('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ac0('0x7'));var _=require('lodash');var squel=require(_0x5ac0('0x8'));var crypto=require(_0x5ac0('0x9'));var jsforce=require(_0x5ac0('0xa'));var deskjs=require(_0x5ac0('0xb'));var toCsv=require(_0x5ac0('0xc'));var querystring=require(_0x5ac0('0xd'));var Papa=require(_0x5ac0('0xe'));var Redis=require(_0x5ac0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5ac0('0x10'));var as=require(_0x5ac0('0x11'));var hardwareService=require(_0x5ac0('0x12'));var logger=require(_0x5ac0('0x13'))(_0x5ac0('0x14'));var utils=require('../../config/utils');var config=require(_0x5ac0('0x15'));var licenseUtil=require(_0x5ac0('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5ac0('0x17')](config['redis'],{'host':_0x5ac0('0x18'),'port':0x18eb});var socket=require(_0x5ac0('0x19'))(new Redis(config[_0x5ac0('0x1a')]));require(_0x5ac0('0x1b'))['register'](socket);function respondWithStatusCode(_0x31c72f,_0x2d0c2b){_0x2d0c2b=_0x2d0c2b||0xcc;return function(_0x377f9c){if(_0x377f9c){return _0x31c72f['sendStatus'](_0x2d0c2b);}return _0x31c72f[_0x5ac0('0x1c')](_0x2d0c2b)[_0x5ac0('0x1d')]();};}function respondWithResult(_0x38ee6d,_0x4b5b76){_0x4b5b76=_0x4b5b76||0xc8;return function(_0x5d8719){if(_0x5d8719){return _0x38ee6d[_0x5ac0('0x1c')](_0x4b5b76)[_0x5ac0('0x1e')](_0x5d8719);}};}function respondWithFilteredResult(_0x32e6ab,_0x22983f){return function(_0x4e983e){if(_0x4e983e){var _0x2d48a3=typeof _0x22983f['offset']===_0x5ac0('0x1f')&&typeof _0x22983f['limit']===_0x5ac0('0x1f');var _0x1fbc25=_0x4e983e[_0x5ac0('0x20')];var _0x18fff6=_0x2d48a3?0x0:_0x22983f[_0x5ac0('0x21')];var _0x40ed27=_0x2d48a3?_0x4e983e[_0x5ac0('0x20')]:_0x22983f[_0x5ac0('0x21')]+_0x22983f['limit'];var _0x5161b5;if(_0x40ed27>=_0x1fbc25){_0x40ed27=_0x1fbc25;_0x5161b5=0xc8;}else{_0x5161b5=0xce;}_0x32e6ab['status'](_0x5161b5);return _0x32e6ab[_0x5ac0('0x22')](_0x5ac0('0x23'),_0x18fff6+'-'+_0x40ed27+'/'+_0x1fbc25)['json'](_0x4e983e);}return null;};}function patchUpdates(_0x5d46a6){return function(_0x2bae7d){try{jsonpatch[_0x5ac0('0x24')](_0x2bae7d,_0x5d46a6,!![]);}catch(_0x4b1989){return BPromise[_0x5ac0('0x25')](_0x4b1989);}return _0x2bae7d[_0x5ac0('0x26')]();};}function saveUpdates(_0x14d790,_0x4ef5e5){return function(_0x1065b6){if(_0x1065b6){return _0x1065b6[_0x5ac0('0x27')](_0x14d790)[_0x5ac0('0x28')](function(_0x4d9df2){return _0x4d9df2;});}return null;};}function removeEntity(_0x211090,_0x193933){return function(_0x3ca2df){if(_0x3ca2df){return _0x3ca2df[_0x5ac0('0x29')]()[_0x5ac0('0x28')](function(){_0x211090[_0x5ac0('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x284c65,_0x3c5fe1){return function(_0x42d0c5){if(!_0x42d0c5){_0x284c65[_0x5ac0('0x2a')](0x194);}return _0x42d0c5;};}function handleError(_0x3c395b,_0x3bcf08){_0x3bcf08=_0x3bcf08||0x1f4;return function(_0x5445db){logger[_0x5ac0('0x2b')](_0x5445db[_0x5ac0('0x2c')]);if(_0x5445db['name']){delete _0x5445db[_0x5ac0('0x2d')];}_0x3c395b[_0x5ac0('0x1c')](_0x3bcf08)[_0x5ac0('0x2e')](_0x5445db);};}exports[_0x5ac0('0x2f')]=function(_0x4ead97,_0x3d93ba){var _0x394f3e={},_0x387dc4={},_0x1809df={'count':0x0,'rows':[]};var _0x24ec5f=_[_0x5ac0('0x30')](db[_0x5ac0('0x31')][_0x5ac0('0x32')],function(_0x53ecda){return{'name':_0x53ecda['fieldName'],'type':_0x53ecda[_0x5ac0('0x33')][_0x5ac0('0x34')]};});_0x387dc4['model']=_[_0x5ac0('0x30')](_0x24ec5f,'name');_0x387dc4['query']=_[_0x5ac0('0x35')](_0x4ead97['query']);_0x387dc4[_0x5ac0('0x36')]=_['intersection'](_0x387dc4[_0x5ac0('0x37')],_0x387dc4[_0x5ac0('0x38')]);_0x394f3e['attributes']=_[_0x5ac0('0x39')](_0x387dc4['model'],qs['fields'](_0x4ead97[_0x5ac0('0x38')][_0x5ac0('0x3a')]));_0x394f3e[_0x5ac0('0x3b')]=_0x394f3e['attributes'][_0x5ac0('0x3c')]?_0x394f3e[_0x5ac0('0x3b')]:_0x387dc4[_0x5ac0('0x37')];if(!_0x4ead97[_0x5ac0('0x38')]['hasOwnProperty'](_0x5ac0('0x3d'))){_0x394f3e[_0x5ac0('0x3e')]=qs[_0x5ac0('0x3e')](_0x4ead97[_0x5ac0('0x38')][_0x5ac0('0x3e')]);_0x394f3e['offset']=qs[_0x5ac0('0x21')](_0x4ead97['query'][_0x5ac0('0x21')]);}_0x394f3e[_0x5ac0('0x3f')]=qs[_0x5ac0('0x40')](_0x4ead97[_0x5ac0('0x38')]['sort']);_0x394f3e[_0x5ac0('0x41')]=qs[_0x5ac0('0x36')](_[_0x5ac0('0x42')](_0x4ead97[_0x5ac0('0x38')],_0x387dc4[_0x5ac0('0x36')]),_0x24ec5f);if(_0x4ead97['query']['filter']){_0x394f3e[_0x5ac0('0x41')]=_[_0x5ac0('0x43')](_0x394f3e['where'],{'$or':_[_0x5ac0('0x30')](_0x24ec5f,function(_0x18ee14){if(_0x18ee14[_0x5ac0('0x33')]!=='VIRTUAL'){var _0x585a74={};_0x585a74[_0x18ee14[_0x5ac0('0x2d')]]={'$like':'%'+_0x4ead97[_0x5ac0('0x38')]['filter']+'%'};return _0x585a74;}})});}_0x394f3e=_[_0x5ac0('0x43')]({},_0x394f3e,_0x4ead97[_0x5ac0('0x44')]);var _0x234efc={'where':_0x394f3e[_0x5ac0('0x41')]};return db[_0x5ac0('0x31')][_0x5ac0('0x20')](_0x234efc)['then'](function(_0x497fe4){_0x1809df[_0x5ac0('0x20')]=_0x497fe4;if(_0x4ead97[_0x5ac0('0x38')][_0x5ac0('0x45')]){_0x394f3e[_0x5ac0('0x46')]=[{'all':!![]}];}return db[_0x5ac0('0x31')][_0x5ac0('0x47')](_0x394f3e);})[_0x5ac0('0x28')](function(_0x37c62a){_0x1809df[_0x5ac0('0x48')]=_0x37c62a;return _0x1809df;})[_0x5ac0('0x28')](respondWithFilteredResult(_0x3d93ba,_0x394f3e))['catch'](handleError(_0x3d93ba,null));};exports[_0x5ac0('0x49')]=function(_0x42e10c,_0x1c2ec0){var _0x39e644={'raw':!![],'where':{'id':_0x42e10c['params']['id']}},_0x1a09b9={};_0x1a09b9[_0x5ac0('0x37')]=_[_0x5ac0('0x35')](db['ChatInternalMessage']['rawAttributes']);_0x1a09b9[_0x5ac0('0x38')]=_['keys'](_0x42e10c['query']);_0x1a09b9[_0x5ac0('0x36')]=_[_0x5ac0('0x39')](_0x1a09b9[_0x5ac0('0x37')],_0x1a09b9[_0x5ac0('0x38')]);_0x39e644[_0x5ac0('0x3b')]=_[_0x5ac0('0x39')](_0x1a09b9[_0x5ac0('0x37')],qs['fields'](_0x42e10c[_0x5ac0('0x38')][_0x5ac0('0x3a')]));_0x39e644['attributes']=_0x39e644[_0x5ac0('0x3b')][_0x5ac0('0x3c')]?_0x39e644[_0x5ac0('0x3b')]:_0x1a09b9[_0x5ac0('0x37')];if(_0x42e10c[_0x5ac0('0x38')]['includeAll']){_0x39e644[_0x5ac0('0x46')]=[{'all':!![]}];}_0x39e644=_['merge']({},_0x39e644,_0x42e10c[_0x5ac0('0x44')]);return db[_0x5ac0('0x31')][_0x5ac0('0x4a')](_0x39e644)[_0x5ac0('0x28')](handleEntityNotFound(_0x1c2ec0,null))[_0x5ac0('0x28')](respondWithResult(_0x1c2ec0,null))['catch'](handleError(_0x1c2ec0,null));};exports[_0x5ac0('0x4b')]=function(_0x399ae6,_0x553c3e){return db[_0x5ac0('0x31')]['create'](_0x399ae6['body'],{})[_0x5ac0('0x28')](respondWithResult(_0x553c3e,0xc9))['catch'](handleError(_0x553c3e,null));};exports[_0x5ac0('0x27')]=function(_0x261b1d,_0x37357f){if(_0x261b1d['body']['id']){delete _0x261b1d['body']['id'];}return db[_0x5ac0('0x31')][_0x5ac0('0x4a')]({'where':{'id':_0x261b1d['params']['id']}})[_0x5ac0('0x28')](handleEntityNotFound(_0x37357f,null))[_0x5ac0('0x28')](saveUpdates(_0x261b1d[_0x5ac0('0x4c')],null))[_0x5ac0('0x28')](respondWithResult(_0x37357f,null))['catch'](handleError(_0x37357f,null));};exports[_0x5ac0('0x29')]=function(_0x4f9b3c,_0x3656bc){return db[_0x5ac0('0x31')]['find']({'where':{'id':_0x4f9b3c[_0x5ac0('0x4d')]['id']}})[_0x5ac0('0x28')](handleEntityNotFound(_0x3656bc,null))[_0x5ac0('0x28')](removeEntity(_0x3656bc,null))['catch'](handleError(_0x3656bc,null));};exports[_0x5ac0('0x4e')]=function(_0x3c5581,_0x4bbb4e){return db['ChatInternalMessage']['describe']()[_0x5ac0('0x28')](respondWithResult(_0x4bbb4e,null))[_0x5ac0('0x4f')](handleError(_0x4bbb4e,null));};function wrapUser(_0x1f5eaa){return function(_0xa7fd06){var _0x25a84f=_0x1f5eaa[_0x5ac0('0x50')]({'plain':!![]});_0x25a84f['messages']=[];if(_0xa7fd06){_0x25a84f[_0x5ac0('0x51')]=_0xa7fd06[_0x5ac0('0x52')];_0x25a84f[_0x5ac0('0x53')]=_0xa7fd06;}else{_0x25a84f[_0x5ac0('0x51')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x25a84f[_0x5ac0('0x53')]={};}return _0x25a84f;};}exports[_0x5ac0('0x54')]=function(_0x4599a2,_0x15110a,_0x4dc42e){var _0x33a1e8=[];return db[_0x5ac0('0x55')][_0x5ac0('0x47')]({'where':{'role':['agent','admin',_0x5ac0('0x56')]},'attributes':['id',_0x5ac0('0x57'),_0x5ac0('0x2d'),'role',_0x5ac0('0x58'),_0x5ac0('0x59'),_0x5ac0('0x5a'),_0x5ac0('0x5b'),_0x5ac0('0x5c'),_0x5ac0('0x5d')],'order':qs[_0x5ac0('0x40')](_0x5ac0('0x5e')),'include':[{'model':db[_0x5ac0('0x5f')],'as':_0x5ac0('0x60'),'attributes':['id',_0x5ac0('0x2d'),'type'],'through':{'attributes':[]}}]})[_0x5ac0('0x28')](function(_0x27c67d){if(_0x27c67d){var _0x2d648f=_0x4599a2[_0x5ac0('0x56')]['get']({'plain':!![]});if(!_0x2d648f)throw new Error(_0x5ac0('0x61'));if(_0x2d648f[_0x5ac0('0x62')]===_0x5ac0('0x56')){return db[_0x5ac0('0x63')]['find']({'where':{'name':_0x5ac0('0x64'),'userProfileId':_0x2d648f[_0x5ac0('0x65')]},'raw':!![]})[_0x5ac0('0x28')](function(_0x552e7b){if(_0x552e7b){if(_0x552e7b[_0x5ac0('0x66')]===0x0){return db[_0x5ac0('0x67')]['findAll']({'where':{'sectionId':_0x552e7b['id']},'raw':!![]})[_0x5ac0('0x28')](function(_0x322664){var _0xd678fc=[];if(_[_0x5ac0('0x68')](_0x322664)){_0xd678fc=_[_0x5ac0('0x69')](_0x27c67d,function(_0x4c1f36){if(_0x4c1f36[_0x5ac0('0x62')]!==_0x5ac0('0x6a')){return _0x4c1f36;}});return _0xd678fc;}else{for(var _0x2b3bbe=0x0;_0x2b3bbe<_0x27c67d[_0x5ac0('0x3c')];_0x2b3bbe++){var _0x5c5f97=_0x27c67d[_0x2b3bbe];if(_0x5c5f97[_0x5ac0('0x62')]===_0x5ac0('0x6a')){var _0x3b362f=_['find'](_0x322664,function(_0x59d2b3){return _0x59d2b3['resourceId']===_0x5c5f97['id'];});if(_0x3b362f)_0xd678fc[_0x5ac0('0x6b')](_0x5c5f97);}else{_0xd678fc['push'](_0x5c5f97);}}return _0xd678fc;}});}else{return _0x27c67d;}}else{var _0x236bfa=_[_0x5ac0('0x69')](_0x27c67d,function(_0x3e2257){if(_0x3e2257[_0x5ac0('0x62')]!==_0x5ac0('0x6a')){return _0x3e2257;}});return _0x236bfa;}});}else{return _0x27c67d;}}})[_0x5ac0('0x28')](function(_0x31b9da){var _0x29bbb6=[];if(_0x31b9da){_0x33a1e8=_0x31b9da;for(var _0x57c06c=0x0;_0x57c06c<_0x31b9da[_0x5ac0('0x3c')];_0x57c06c+=0x1){_0x33a1e8[_0x57c06c][_0x5ac0('0x6c')]=[];_0x29bbb6[_0x5ac0('0x6b')](db[_0x5ac0('0x31')]['find']({'where':{'FromId':[_0x4599a2['user']['id'],_0x31b9da[_0x57c06c]['id']],'ToId':[_0x4599a2[_0x5ac0('0x56')]['id'],_0x31b9da[_0x57c06c]['id']],'ChatGroupId':null},'attributes':['id',_0x5ac0('0x52'),_0x5ac0('0x6d'),'ToId','read','body'],'order':qs[_0x5ac0('0x40')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5ac0('0x28')](wrapUser(_0x31b9da[_0x57c06c])));}return BPromise[_0x5ac0('0x6e')](_0x29bbb6);}return[];})[_0x5ac0('0x28')](function(_0x45a6b6){return{'rows':_0x45a6b6,'count':_0x45a6b6[_0x5ac0('0x3c')]};})['then'](respondWithResult(_0x15110a,null))['catch'](handleError(_0x15110a,null));};
\ No newline at end of file
+var _0xf754=['destroy','end','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','get','createdAt','lastMessage','format','agent','user','fullname','role','userpic','internal','online','lastLoginAt','-online','VoiceQueue','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','isEmpty','resourceId','push','messages','FromId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','register','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then'];(function(_0x262ff6,_0x158799){var _0x4c9b82=function(_0x2d854d){while(--_0x2d854d){_0x262ff6['push'](_0x262ff6['shift']());}};_0x4c9b82(++_0x158799);}(_0xf754,0xaa));var _0x4f75=function(_0x85f713,_0x2c1959){_0x85f713=_0x85f713-0x0;var _0x1c4119=_0xf754[_0x85f713];return _0x1c4119;};'use strict';var emlformat=require(_0x4f75('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4f75('0x1'));var jsonpatch=require(_0x4f75('0x2'));var rp=require(_0x4f75('0x3'));var moment=require(_0x4f75('0x4'));var BPromise=require(_0x4f75('0x5'));var Mustache=require(_0x4f75('0x6'));var util=require(_0x4f75('0x7'));var path=require(_0x4f75('0x8'));var sox=require(_0x4f75('0x9'));var csv=require(_0x4f75('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4f75('0xb'));var _=require('lodash');var squel=require(_0x4f75('0xc'));var crypto=require(_0x4f75('0xd'));var jsforce=require(_0x4f75('0xe'));var deskjs=require(_0x4f75('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4f75('0x10'));var authService=require(_0x4f75('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4f75('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f75('0x13'))(_0x4f75('0x14'));var utils=require('../../config/utils');var config=require(_0x4f75('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f75('0x16'))['db'];config[_0x4f75('0x17')]=_[_0x4f75('0x18')](config[_0x4f75('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f75('0x17')]));require('./chatInternalMessage.socket')[_0x4f75('0x19')](socket);function respondWithStatusCode(_0x13d76f,_0x932aa6){_0x932aa6=_0x932aa6||0xcc;return function(_0x2b70ea){if(_0x2b70ea){return _0x13d76f[_0x4f75('0x1a')](_0x932aa6);}return _0x13d76f[_0x4f75('0x1b')](_0x932aa6)['end']();};}function respondWithResult(_0x549ebe,_0x8b0b1e){_0x8b0b1e=_0x8b0b1e||0xc8;return function(_0x373c02){if(_0x373c02){return _0x549ebe['status'](_0x8b0b1e)[_0x4f75('0x1c')](_0x373c02);}};}function respondWithFilteredResult(_0x3b8644,_0x12105c){return function(_0x3f9843){if(_0x3f9843){var _0x656555=typeof _0x12105c[_0x4f75('0x1d')]==='undefined'&&typeof _0x12105c[_0x4f75('0x1e')]===_0x4f75('0x1f');var _0x490229=_0x3f9843[_0x4f75('0x20')];var _0x2995e5=_0x656555?0x0:_0x12105c[_0x4f75('0x1d')];var _0x593457=_0x656555?_0x3f9843['count']:_0x12105c['offset']+_0x12105c['limit'];var _0x4af5d0;if(_0x593457>=_0x490229){_0x593457=_0x490229;_0x4af5d0=0xc8;}else{_0x4af5d0=0xce;}_0x3b8644[_0x4f75('0x1b')](_0x4af5d0);return _0x3b8644[_0x4f75('0x21')]('Content-Range',_0x2995e5+'-'+_0x593457+'/'+_0x490229)['json'](_0x3f9843);}return null;};}function patchUpdates(_0x556880){return function(_0x5d3657){try{jsonpatch['apply'](_0x5d3657,_0x556880,!![]);}catch(_0x1d2071){return BPromise[_0x4f75('0x22')](_0x1d2071);}return _0x5d3657[_0x4f75('0x23')]();};}function saveUpdates(_0xb238e9,_0x5ae2d7){return function(_0x892e84){if(_0x892e84){return _0x892e84[_0x4f75('0x24')](_0xb238e9)[_0x4f75('0x25')](function(_0x546b84){return _0x546b84;});}return null;};}function removeEntity(_0x490fc5,_0x4af819){return function(_0x5a696b){if(_0x5a696b){return _0x5a696b[_0x4f75('0x26')]()[_0x4f75('0x25')](function(){_0x490fc5[_0x4f75('0x1b')](0xcc)[_0x4f75('0x27')]();});}};}function handleEntityNotFound(_0x4acc8e,_0x3c0239){return function(_0x5e5a60){if(!_0x5e5a60){_0x4acc8e[_0x4f75('0x1a')](0x194);}return _0x5e5a60;};}function handleError(_0x4d8c28,_0x90c81c){_0x90c81c=_0x90c81c||0x1f4;return function(_0x2db2e6){logger[_0x4f75('0x28')](_0x2db2e6[_0x4f75('0x29')]);if(_0x2db2e6[_0x4f75('0x2a')]){delete _0x2db2e6[_0x4f75('0x2a')];}_0x4d8c28[_0x4f75('0x1b')](_0x90c81c)[_0x4f75('0x2b')](_0x2db2e6);};}exports[_0x4f75('0x2c')]=function(_0x51eb71,_0x2ff9e8){var _0x4780ae={},_0x1cca44={},_0x58498b={'count':0x0,'rows':[]};var _0x54ee50=_[_0x4f75('0x2d')](db['ChatInternalMessage']['rawAttributes'],function(_0x4baa82){return{'name':_0x4baa82[_0x4f75('0x2e')],'type':_0x4baa82[_0x4f75('0x2f')][_0x4f75('0x30')]};});_0x1cca44[_0x4f75('0x31')]=_[_0x4f75('0x2d')](_0x54ee50,_0x4f75('0x2a'));_0x1cca44['query']=_[_0x4f75('0x32')](_0x51eb71[_0x4f75('0x33')]);_0x1cca44[_0x4f75('0x34')]=_['intersection'](_0x1cca44[_0x4f75('0x31')],_0x1cca44['query']);_0x4780ae[_0x4f75('0x35')]=_[_0x4f75('0x36')](_0x1cca44['model'],qs['fields'](_0x51eb71['query'][_0x4f75('0x37')]));_0x4780ae[_0x4f75('0x35')]=_0x4780ae[_0x4f75('0x35')][_0x4f75('0x38')]?_0x4780ae[_0x4f75('0x35')]:_0x1cca44['model'];if(!_0x51eb71[_0x4f75('0x33')][_0x4f75('0x39')](_0x4f75('0x3a'))){_0x4780ae['limit']=qs[_0x4f75('0x1e')](_0x51eb71['query'][_0x4f75('0x1e')]);_0x4780ae[_0x4f75('0x1d')]=qs[_0x4f75('0x1d')](_0x51eb71[_0x4f75('0x33')][_0x4f75('0x1d')]);}_0x4780ae['order']=qs[_0x4f75('0x3b')](_0x51eb71[_0x4f75('0x33')]['sort']);_0x4780ae['where']=qs['filters'](_[_0x4f75('0x3c')](_0x51eb71['query'],_0x1cca44[_0x4f75('0x34')]),_0x54ee50);if(_0x51eb71[_0x4f75('0x33')][_0x4f75('0x3d')]){_0x4780ae[_0x4f75('0x3e')]=_['merge'](_0x4780ae['where'],{'$or':_[_0x4f75('0x2d')](_0x54ee50,function(_0x27b561){if(_0x27b561[_0x4f75('0x2f')]!=='VIRTUAL'){var _0x456366={};_0x456366[_0x27b561[_0x4f75('0x2a')]]={'$like':'%'+_0x51eb71['query']['filter']+'%'};return _0x456366;}})});}_0x4780ae=_[_0x4f75('0x3f')]({},_0x4780ae,_0x51eb71[_0x4f75('0x40')]);var _0x1cf37c={'where':_0x4780ae[_0x4f75('0x3e')]};return db[_0x4f75('0x41')]['count'](_0x1cf37c)[_0x4f75('0x25')](function(_0x1fe9c6){_0x58498b['count']=_0x1fe9c6;if(_0x51eb71[_0x4f75('0x33')][_0x4f75('0x42')]){_0x4780ae[_0x4f75('0x43')]=[{'all':!![]}];}return db[_0x4f75('0x41')][_0x4f75('0x44')](_0x4780ae);})[_0x4f75('0x25')](function(_0x24ae9a){_0x58498b[_0x4f75('0x45')]=_0x24ae9a;return _0x58498b;})[_0x4f75('0x25')](respondWithFilteredResult(_0x2ff9e8,_0x4780ae))[_0x4f75('0x46')](handleError(_0x2ff9e8,null));};exports[_0x4f75('0x47')]=function(_0x484c60,_0x16c88f){var _0x2cd5e1={'raw':!![],'where':{'id':_0x484c60[_0x4f75('0x48')]['id']}},_0x3391a2={};_0x3391a2['model']=_[_0x4f75('0x32')](db[_0x4f75('0x41')][_0x4f75('0x49')]);_0x3391a2[_0x4f75('0x33')]=_[_0x4f75('0x32')](_0x484c60['query']);_0x3391a2['filters']=_[_0x4f75('0x36')](_0x3391a2[_0x4f75('0x31')],_0x3391a2[_0x4f75('0x33')]);_0x2cd5e1[_0x4f75('0x35')]=_[_0x4f75('0x36')](_0x3391a2[_0x4f75('0x31')],qs[_0x4f75('0x37')](_0x484c60[_0x4f75('0x33')]['fields']));_0x2cd5e1['attributes']=_0x2cd5e1['attributes'][_0x4f75('0x38')]?_0x2cd5e1[_0x4f75('0x35')]:_0x3391a2['model'];if(_0x484c60['query'][_0x4f75('0x42')]){_0x2cd5e1[_0x4f75('0x43')]=[{'all':!![]}];}_0x2cd5e1=_[_0x4f75('0x3f')]({},_0x2cd5e1,_0x484c60['options']);return db[_0x4f75('0x41')]['find'](_0x2cd5e1)['then'](handleEntityNotFound(_0x16c88f,null))[_0x4f75('0x25')](respondWithResult(_0x16c88f,null))[_0x4f75('0x46')](handleError(_0x16c88f,null));};exports[_0x4f75('0x4a')]=function(_0x12987c,_0x1f1cf3){return db[_0x4f75('0x41')]['create'](_0x12987c[_0x4f75('0x4b')],{})['then'](respondWithResult(_0x1f1cf3,0xc9))[_0x4f75('0x46')](handleError(_0x1f1cf3,null));};exports[_0x4f75('0x24')]=function(_0x4e99db,_0x57f939){if(_0x4e99db['body']['id']){delete _0x4e99db[_0x4f75('0x4b')]['id'];}return db['ChatInternalMessage'][_0x4f75('0x4c')]({'where':{'id':_0x4e99db[_0x4f75('0x48')]['id']}})[_0x4f75('0x25')](handleEntityNotFound(_0x57f939,null))[_0x4f75('0x25')](saveUpdates(_0x4e99db['body'],null))[_0x4f75('0x25')](respondWithResult(_0x57f939,null))[_0x4f75('0x46')](handleError(_0x57f939,null));};exports['destroy']=function(_0x3deed3,_0x58423e){return db[_0x4f75('0x41')][_0x4f75('0x4c')]({'where':{'id':_0x3deed3['params']['id']}})['then'](handleEntityNotFound(_0x58423e,null))[_0x4f75('0x25')](removeEntity(_0x58423e,null))[_0x4f75('0x46')](handleError(_0x58423e,null));};exports[_0x4f75('0x4d')]=function(_0x60caaa,_0x578c76){return db[_0x4f75('0x41')][_0x4f75('0x4d')]()[_0x4f75('0x25')](respondWithResult(_0x578c76,null))[_0x4f75('0x46')](handleError(_0x578c76,null));};function wrapUser(_0x4517b1){return function(_0x93bafe){var _0x594a0a=_0x4517b1[_0x4f75('0x4e')]({'plain':!![]});_0x594a0a['messages']=[];if(_0x93bafe){_0x594a0a['lastMessageAt']=_0x93bafe[_0x4f75('0x4f')];_0x594a0a[_0x4f75('0x50')]=_0x93bafe;}else{_0x594a0a['lastMessageAt']=moment(0x0)[_0x4f75('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x594a0a[_0x4f75('0x50')]={};}return _0x594a0a;};}exports['getUsers']=function(_0x5b7947,_0x58bc2e,_0x8b13bf){var _0x17237f=[];return db['User'][_0x4f75('0x44')]({'where':{'role':[_0x4f75('0x52'),'admin',_0x4f75('0x53')]},'attributes':['id',_0x4f75('0x54'),'name',_0x4f75('0x55'),_0x4f75('0x56'),_0x4f75('0x57'),_0x4f75('0x58'),_0x4f75('0x59'),'allowmessenger','showWebBar'],'order':qs[_0x4f75('0x3b')](_0x4f75('0x5a')),'include':[{'model':db[_0x4f75('0x5b')],'as':_0x4f75('0x5c'),'attributes':['id',_0x4f75('0x2a'),_0x4f75('0x2f')],'through':{'attributes':[]}}]})['then'](function(_0x382caf){if(_0x382caf){var _0xf136a0=_0x5b7947[_0x4f75('0x53')][_0x4f75('0x4e')]({'plain':!![]});if(!_0xf136a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf136a0[_0x4f75('0x55')]===_0x4f75('0x53')){return db[_0x4f75('0x5d')]['find']({'where':{'name':'Agents','userProfileId':_0xf136a0[_0x4f75('0x5e')]},'raw':!![]})['then'](function(_0x1cf8d6){if(_0x1cf8d6){if(_0x1cf8d6[_0x4f75('0x5f')]===0x0){return db['UserProfileResource'][_0x4f75('0x44')]({'where':{'sectionId':_0x1cf8d6['id']},'raw':!![]})[_0x4f75('0x25')](function(_0xca0ee8){var _0x4a31ac=[];if(_[_0x4f75('0x60')](_0xca0ee8)){_0x4a31ac=_[_0x4f75('0x3d')](_0x382caf,function(_0x1f3d7e){if(_0x1f3d7e[_0x4f75('0x55')]!==_0x4f75('0x52')){return _0x1f3d7e;}});return _0x4a31ac;}else{for(var _0x1526dd=0x0;_0x1526dd<_0x382caf[_0x4f75('0x38')];_0x1526dd++){var _0x4655ee=_0x382caf[_0x1526dd];if(_0x4655ee[_0x4f75('0x55')]===_0x4f75('0x52')){var _0x4534f6=_[_0x4f75('0x4c')](_0xca0ee8,function(_0x175478){return _0x175478[_0x4f75('0x61')]===_0x4655ee['id'];});if(_0x4534f6)_0x4a31ac[_0x4f75('0x62')](_0x4655ee);}else{_0x4a31ac[_0x4f75('0x62')](_0x4655ee);}}return _0x4a31ac;}});}else{return _0x382caf;}}else{var _0x3f4a61=_[_0x4f75('0x3d')](_0x382caf,function(_0x206993){if(_0x206993[_0x4f75('0x55')]!==_0x4f75('0x52')){return _0x206993;}});return _0x3f4a61;}});}else{return _0x382caf;}}})[_0x4f75('0x25')](function(_0x3cea34){var _0x809d19=[];if(_0x3cea34){_0x17237f=_0x3cea34;for(var _0xb26bb=0x0;_0xb26bb<_0x3cea34[_0x4f75('0x38')];_0xb26bb+=0x1){_0x17237f[_0xb26bb][_0x4f75('0x63')]=[];_0x809d19[_0x4f75('0x62')](db[_0x4f75('0x41')][_0x4f75('0x4c')]({'where':{'FromId':[_0x5b7947[_0x4f75('0x53')]['id'],_0x3cea34[_0xb26bb]['id']],'ToId':[_0x5b7947['user']['id'],_0x3cea34[_0xb26bb]['id']],'ChatGroupId':null},'attributes':['id',_0x4f75('0x4f'),_0x4f75('0x64'),'ToId',_0x4f75('0x65'),_0x4f75('0x4b')],'order':qs[_0x4f75('0x3b')](_0x4f75('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4f75('0x25')](wrapUser(_0x3cea34[_0xb26bb])));}return BPromise[_0x4f75('0x67')](_0x809d19);}return[];})[_0x4f75('0x25')](function(_0x1b6e2f){return{'rows':_0x1b6e2f,'count':_0x1b6e2f['length']};})[_0x4f75('0x25')](respondWithResult(_0x58bc2e,null))[_0x4f75('0x46')](handleError(_0x58bc2e,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index b3b63a4..f27bff8 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 _0x2106=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x51cc60,_0x561066){var _0x422dcd=function(_0x10493f){while(--_0x10493f){_0x51cc60['push'](_0x51cc60['shift']());}};_0x422dcd(++_0x561066);}(_0x2106,0x133));var _0x6210=function(_0x5b7574,_0x197bc2){_0x5b7574=_0x5b7574-0x0;var _0x43d8e3=_0x2106[_0x5b7574];return _0x43d8e3;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x6210('0x0'))['db'][_0x6210('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6210('0x2')](0x0);var events={'afterCreate':_0x6210('0x3'),'afterUpdate':_0x6210('0x4'),'afterDestroy':_0x6210('0x5')};function emitEvent(_0x1aa75d){return function(_0x5b5c9a,_0x1c4ddd,_0x19ec5b){ChatInternalMessageEvents['emit'](_0x1aa75d+':'+_0x5b5c9a['id'],_0x5b5c9a);ChatInternalMessageEvents[_0x6210('0x6')](_0x1aa75d,_0x5b5c9a);_0x19ec5b(null);};}for(var e in events){if(events[_0x6210('0x7')](e)){var event=events[e];ChatInternalMessage[_0x6210('0x8')](e,emitEvent(event));}}module[_0x6210('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x1b47=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x3f9123,_0x1c8a82){var _0x5465c8=function(_0xf953bc){while(--_0xf953bc){_0x3f9123['push'](_0x3f9123['shift']());}};_0x5465c8(++_0x1c8a82);}(_0x1b47,0xfa));var _0x71b4=function(_0x332edd,_0x30528b){_0x332edd=_0x332edd-0x0;var _0x310417=_0x1b47[_0x332edd];return _0x310417;};'use strict';var EventEmitter=require(_0x71b4('0x0'));var ChatInternalMessage=require(_0x71b4('0x1'))['db'][_0x71b4('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x71b4('0x3')](0x0);var events={'afterCreate':_0x71b4('0x4'),'afterUpdate':_0x71b4('0x5'),'afterDestroy':_0x71b4('0x6')};function emitEvent(_0x3ae877){return function(_0x505209,_0x2d13f6,_0x38f012){ChatInternalMessageEvents[_0x71b4('0x7')](_0x3ae877+':'+_0x505209['id'],_0x505209);ChatInternalMessageEvents[_0x71b4('0x7')](_0x3ae877,_0x505209);_0x38f012(null);};}for(var e in events){if(events[_0x71b4('0x8')](e)){var event=events[e];ChatInternalMessage[_0x71b4('0x9')](e,emitEvent(event));}}module[_0x71b4('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 7833275..a62cf44 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 _0x51ba=['chat_internal_messages','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x51ba,0x79));var _0xa51b=function(_0x473786,_0x4351b0){_0x473786=_0x473786-0x0;var _0x36764=_0x51ba[_0x473786];return _0x36764;};'use strict';var _=require(_0xa51b('0x0'));var util=require(_0xa51b('0x1'));var logger=require(_0xa51b('0x2'))('api');var moment=require(_0xa51b('0x3'));var BPromise=require(_0xa51b('0x4'));var rp=require(_0xa51b('0x5'));var fs=require('fs');var path=require(_0xa51b('0x6'));var rimraf=require(_0xa51b('0x7'));var config=require(_0xa51b('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0xa51b('0x9')]=function(_0x215dda,_0x2d26fb){return _0x215dda[_0xa51b('0xa')]('ChatInternalMessage',attributes,{'tableName':_0xa51b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb2b6=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0xb2b6,0x1c3));var _0x6b2b=function(_0x2010f0,_0x3e5f1a){_0x2010f0=_0x2010f0-0x0;var _0x4dd943=_0xb2b6[_0x2010f0];return _0x4dd943;};'use strict';var _=require(_0x6b2b('0x0'));var util=require(_0x6b2b('0x1'));var logger=require(_0x6b2b('0x2'))(_0x6b2b('0x3'));var moment=require('moment');var BPromise=require(_0x6b2b('0x4'));var rp=require(_0x6b2b('0x5'));var fs=require('fs');var path=require(_0x6b2b('0x6'));var rimraf=require('rimraf');var config=require(_0x6b2b('0x7'));var attributes=require(_0x6b2b('0x8'));module[_0x6b2b('0x9')]=function(_0x227d3b,_0x24ff89){return _0x227d3b[_0x6b2b('0xa')](_0x6b2b('0xb'),attributes,{'tableName':_0x6b2b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b2b('0xd'),'collate':_0x6b2b('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 08cd0b4..4012f54 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 _0x3884=['./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','redis','defaults','localhost'];(function(_0x5e8298,_0x82bcb5){var _0x412466=function(_0x4958c4){while(--_0x4958c4){_0x5e8298['push'](_0x5e8298['shift']());}};_0x412466(++_0x82bcb5);}(_0x3884,0x139));var _0x4388=function(_0x27e811,_0x1fad22){_0x27e811=_0x27e811-0x0;var _0x1bfe61=_0x3884[_0x27e811];return _0x1bfe61;};'use strict';var _=require(_0x4388('0x0'));var util=require(_0x4388('0x1'));var moment=require(_0x4388('0x2'));var BPromise=require('bluebird');var rs=require(_0x4388('0x3'));var fs=require('fs');var Redis=require(_0x4388('0x4'));var db=require(_0x4388('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4388('0x6'));var config=require(_0x4388('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4388('0x8')]({'port':0x232a});config[_0x4388('0x9')]=_[_0x4388('0xa')](config['redis'],{'host':_0x4388('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4388('0x9')]));require(_0x4388('0xc'))[_0x4388('0xd')](socket);function respondWithRpcPromise(_0x2dc308,_0x1d38ba,_0x18a89a){return new BPromise(function(_0x257afd,_0x2c7864){return client[_0x4388('0xe')](_0x2dc308,_0x18a89a)[_0x4388('0xf')](function(_0x367cbe){logger[_0x4388('0x10')](_0x4388('0x11'),_0x1d38ba,_0x4388('0x12'));logger['debug'](_0x4388('0x13'),_0x1d38ba,'request\x20sent',JSON[_0x4388('0x14')](_0x367cbe));if(_0x367cbe['error']){if(_0x367cbe[_0x4388('0x15')][_0x4388('0x16')]===0x1f4){logger[_0x4388('0x15')](_0x4388('0x11'),_0x1d38ba,_0x367cbe[_0x4388('0x15')][_0x4388('0x17')]);return _0x2c7864(_0x367cbe[_0x4388('0x15')][_0x4388('0x17')]);}logger['error'](_0x4388('0x11'),_0x1d38ba,_0x367cbe[_0x4388('0x15')][_0x4388('0x17')]);return _0x257afd(_0x367cbe[_0x4388('0x15')][_0x4388('0x17')]);}else{logger[_0x4388('0x10')](_0x4388('0x11'),_0x1d38ba,_0x4388('0x12'));_0x257afd(_0x367cbe[_0x4388('0x18')][_0x4388('0x17')]);}})['catch'](function(_0x5420f4){logger[_0x4388('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x1d38ba,_0x5420f4);_0x2c7864(_0x5420f4);});});}
\ No newline at end of file
+var _0xa8f0=['stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8f0,0x123));var _0x0a8f=function(_0x20ae3b,_0x23a21c){_0x20ae3b=_0x20ae3b-0x0;var _0x391475=_0xa8f0[_0x20ae3b];return _0x391475;};'use strict';var _=require(_0x0a8f('0x0'));var util=require(_0x0a8f('0x1'));var moment=require(_0x0a8f('0x2'));var BPromise=require('bluebird');var rs=require(_0x0a8f('0x3'));var fs=require('fs');var Redis=require(_0x0a8f('0x4'));var db=require(_0x0a8f('0x5'))['db'];var utils=require(_0x0a8f('0x6'));var logger=require(_0x0a8f('0x7'))(_0x0a8f('0x8'));var config=require(_0x0a8f('0x9'));var jayson=require(_0x0a8f('0xa'));var client=jayson[_0x0a8f('0xb')]['http']({'port':0x232a});config[_0x0a8f('0xc')]=_['defaults'](config[_0x0a8f('0xc')],{'host':_0x0a8f('0xd'),'port':0x18eb});var socket=require(_0x0a8f('0xe'))(new Redis(config[_0x0a8f('0xc')]));require(_0x0a8f('0xf'))['register'](socket);function respondWithRpcPromise(_0x4a416d,_0x443d5b,_0x115e68){return new BPromise(function(_0x359377,_0x1921e1){return client[_0x0a8f('0x10')](_0x4a416d,_0x115e68)['then'](function(_0x273a40){logger[_0x0a8f('0x11')](_0x0a8f('0x12'),_0x443d5b,'request\x20sent');logger['debug'](_0x0a8f('0x13'),_0x443d5b,_0x0a8f('0x14'),JSON[_0x0a8f('0x15')](_0x273a40));if(_0x273a40[_0x0a8f('0x16')]){if(_0x273a40[_0x0a8f('0x16')][_0x0a8f('0x17')]===0x1f4){logger[_0x0a8f('0x16')](_0x0a8f('0x12'),_0x443d5b,_0x273a40[_0x0a8f('0x16')]['message']);return _0x1921e1(_0x273a40[_0x0a8f('0x16')][_0x0a8f('0x18')]);}logger[_0x0a8f('0x16')](_0x0a8f('0x12'),_0x443d5b,_0x273a40[_0x0a8f('0x16')][_0x0a8f('0x18')]);return _0x359377(_0x273a40[_0x0a8f('0x16')][_0x0a8f('0x18')]);}else{logger['info'](_0x0a8f('0x12'),_0x443d5b,_0x0a8f('0x14'));_0x359377(_0x273a40[_0x0a8f('0x19')][_0x0a8f('0x18')]);}})['catch'](function(_0x57b00e){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x443d5b,_0x57b00e);_0x1921e1(_0x57b00e);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 9842b0f..64aa19e 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 _0xe150=['./chatInternalMessage.events','save','remove','update','emit','register','length','chatInternalMessage:'];(function(_0x151052,_0x5a1970){var _0x5ee83e=function(_0x570415){while(--_0x570415){_0x151052['push'](_0x151052['shift']());}};_0x5ee83e(++_0x5a1970);}(_0xe150,0x110));var _0x0e15=function(_0x2b4261,_0x2ea04e){_0x2b4261=_0x2b4261-0x0;var _0x3b65ba=_0xe150[_0x2b4261];return _0x3b65ba;};'use strict';var ChatInternalMessageEvents=require(_0x0e15('0x0'));var events=[_0x0e15('0x1'),_0x0e15('0x2'),_0x0e15('0x3')];function createListener(_0x3992ff,_0x5a7213){return function(_0xe69b41){_0x5a7213[_0x0e15('0x4')](_0x3992ff,_0xe69b41);};}function removeListener(_0x8541cd,_0x137470){return function(){ChatInternalMessageEvents['removeListener'](_0x8541cd,_0x137470);};}exports[_0x0e15('0x5')]=function(_0x4be5e2){for(var _0x873f0f=0x0,_0x4fdbf9=events[_0x0e15('0x6')];_0x873f0f<_0x4fdbf9;_0x873f0f++){var _0x18d0dc=events[_0x873f0f];var _0x31892e=createListener(_0x0e15('0x7')+_0x18d0dc,_0x4be5e2);ChatInternalMessageEvents['on'](_0x18d0dc,_0x31892e);}};
\ No newline at end of file
+var _0xc67c=['./chatInternalMessage.events','remove','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xc67c,0xc0));var _0xcc67=function(_0x40fda4,_0x2e4574){_0x40fda4=_0x40fda4-0x0;var _0x5646b7=_0xc67c[_0x40fda4];return _0x5646b7;};'use strict';var ChatInternalMessageEvents=require(_0xcc67('0x0'));var events=['save',_0xcc67('0x1'),_0xcc67('0x2')];function createListener(_0x5b9f8a,_0x7ba146){return function(_0x3c31c0){_0x7ba146[_0xcc67('0x3')](_0x5b9f8a,_0x3c31c0);};}function removeListener(_0x18de18,_0x582155){return function(){ChatInternalMessageEvents[_0xcc67('0x4')](_0x18de18,_0x582155);};}exports[_0xcc67('0x5')]=function(_0x5e94ea){for(var _0x4892f4=0x0,_0xe5a4d9=events[_0xcc67('0x6')];_0x4892f4<_0xe5a4d9;_0x4892f4++){var _0x9265d=events[_0x4892f4];var _0x553c3d=createListener(_0xcc67('0x7')+_0x9265d,_0x5e94ea);ChatInternalMessageEvents['on'](_0x9265d,_0x553c3d);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 5ec2a64..d8dd95e 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 _0x8834=['delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','put','/:id'];(function(_0xc99cc8,_0x111197){var _0x2f1c2c=function(_0x565505){while(--_0x565505){_0xc99cc8['push'](_0xc99cc8['shift']());}};_0x2f1c2c(++_0x111197);}(_0x8834,0xf3));var _0x4883=function(_0x47e06d,_0x11e3df){_0x47e06d=_0x47e06d-0x0;var _0x1a8597=_0x8834[_0x47e06d];return _0x1a8597;};'use strict';var multer=require('multer');var util=require(_0x4883('0x0'));var path=require('path');var timeout=require(_0x4883('0x1'));var express=require(_0x4883('0x2'));var router=express[_0x4883('0x3')]();var fs_extra=require(_0x4883('0x4'));var auth=require(_0x4883('0x5'));var interaction=require(_0x4883('0x6'));var config=require(_0x4883('0x7'));var controller=require(_0x4883('0x8'));router[_0x4883('0x9')]('/',auth[_0x4883('0xa')](),controller[_0x4883('0xb')]);router[_0x4883('0x9')]('/describe',auth[_0x4883('0xa')](),controller[_0x4883('0xc')]);router[_0x4883('0x9')](_0x4883('0xd'),auth[_0x4883('0xa')](),controller[_0x4883('0xe')]);router['get']('/:id',auth[_0x4883('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4883('0xf')](_0x4883('0x10'),controller['update']);router[_0x4883('0x11')](_0x4883('0x10'),auth[_0x4883('0xa')](),controller[_0x4883('0x12')]);module[_0x4883('0x13')]=router;
\ No newline at end of file
+var _0xdb57=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/users','isAuthenticated','/:id','show','post','put','delete','destroy','exports','multer','util'];(function(_0x36bb8c,_0x25fae8){var _0x43b5d5=function(_0x41e6a0){while(--_0x41e6a0){_0x36bb8c['push'](_0x36bb8c['shift']());}};_0x43b5d5(++_0x25fae8);}(_0xdb57,0x11c));var _0x7db5=function(_0x385cb1,_0x1a9f21){_0x385cb1=_0x385cb1-0x0;var _0x556f91=_0xdb57[_0x385cb1];return _0x556f91;};'use strict';var multer=require(_0x7db5('0x0'));var util=require(_0x7db5('0x1'));var path=require(_0x7db5('0x2'));var timeout=require(_0x7db5('0x3'));var express=require(_0x7db5('0x4'));var router=express['Router']();var fs_extra=require(_0x7db5('0x5'));var auth=require(_0x7db5('0x6'));var interaction=require(_0x7db5('0x7'));var config=require(_0x7db5('0x8'));var controller=require('./chatInternalMessage.controller');router[_0x7db5('0x9')]('/',auth['isAuthenticated'](),controller[_0x7db5('0xa')]);router[_0x7db5('0x9')](_0x7db5('0xb'),auth['isAuthenticated'](),controller[_0x7db5('0xc')]);router[_0x7db5('0x9')](_0x7db5('0xd'),auth[_0x7db5('0xe')](),controller['getUsers']);router[_0x7db5('0x9')](_0x7db5('0xf'),auth[_0x7db5('0xe')](),controller[_0x7db5('0x10')]);router[_0x7db5('0x11')]('/',auth[_0x7db5('0xe')](),controller['create']);router[_0x7db5('0x12')]('/:id',controller['update']);router[_0x7db5('0x13')]('/:id',auth[_0x7db5('0xe')](),controller[_0x7db5('0x14')]);module[_0x7db5('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index e05bce4..61d6ac0 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 _0x97e7=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x97e7,0x1a1));var _0x797e=function(_0x5438d7,_0x1d660e){_0x5438d7=_0x5438d7-0x0;var _0x8c3af2=_0x97e7[_0x5438d7];return _0x8c3af2;};'use strict';var Sequelize=require(_0x797e('0x0'));module[_0x797e('0x1')]={'body':{'type':Sequelize[_0x797e('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x797e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x797e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x797e('0x4')]('in',_0x797e('0x5')),'defaultValue':_0x797e('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x797e('0x6')]},'providerName':{'type':Sequelize[_0x797e('0x7')]},'providerResponse':{'type':Sequelize[_0x797e('0x2')]}};
\ No newline at end of file
+var _0xa699=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x2e6315,_0x54cd2e){var _0x52a81f=function(_0x8d84d5){while(--_0x8d84d5){_0x2e6315['push'](_0x2e6315['shift']());}};_0x52a81f(++_0x54cd2e);}(_0xa699,0x6b));var _0x9a69=function(_0x57cb4f,_0x541f57){_0x57cb4f=_0x57cb4f-0x0;var _0x29bb45=_0xa699[_0x57cb4f];return _0x29bb45;};'use strict';var Sequelize=require(_0x9a69('0x0'));module[_0x9a69('0x1')]={'body':{'type':Sequelize[_0x9a69('0x2')](_0x9a69('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9a69('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9a69('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9a69('0x5')]('in',_0x9a69('0x6')),'defaultValue':_0x9a69('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9a69('0x7')]},'providerName':{'type':Sequelize[_0x9a69('0x8')]},'providerResponse':{'type':Sequelize[_0x9a69('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index b660f6d..841db40 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 _0xb173=['body','describe','../../config/logger','chat-interactions','accept','chat','readAt','format','UserId','user','agent','get','ChatInteraction','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','socket.io-emitter','client','request','then','info','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','rawAttributes','type','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','ChatMessage','includeAll','include','rows','params','keys','find','create'];(function(_0x5b36bd,_0x4dfb36){var _0x1614fe=function(_0x559b7c){while(--_0x559b7c){_0x5b36bd['push'](_0x5b36bd['shift']());}};_0x1614fe(++_0x4dfb36);}(_0xb173,0xa5));var _0x3b17=function(_0x2f9cbc,_0x42cf1b){_0x2f9cbc=_0x2f9cbc-0x0;var _0xd91e8=_0xb173[_0x2f9cbc];return _0xd91e8;};'use strict';var emlformat=require(_0x3b17('0x0'));var rimraf=require(_0x3b17('0x1'));var zipdir=require(_0x3b17('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b17('0x3'));var moment=require('moment');var BPromise=require(_0x3b17('0x4'));var Mustache=require(_0x3b17('0x5'));var util=require(_0x3b17('0x6'));var path=require(_0x3b17('0x7'));var sox=require(_0x3b17('0x8'));var csv=require(_0x3b17('0x9'));var ejs=require(_0x3b17('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b17('0xb'));var squel=require(_0x3b17('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3b17('0xd'));var toCsv=require(_0x3b17('0x9'));var querystring=require(_0x3b17('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3b17('0xf'));var hardwareService=require(_0x3b17('0x10'));var logger=require('../../config/logger')(_0x3b17('0x11'));var utils=require('../../config/utils');var config=require(_0x3b17('0x12'));var licenseUtil=require(_0x3b17('0x13'));var db=require('../../mysqldb')['db'];config[_0x3b17('0x14')]=_['defaults'](config[_0x3b17('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b17('0x15'))(new Redis(config[_0x3b17('0x14')]));require('./chatMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x3b17('0x16')]['http']({'port':0x232c});var client9002=jayson[_0x3b17('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2942ed,_0x1597e6,_0x2680bb,_0x19d433){return new BPromise(function(_0x526aab,_0x517f3b){var _0x493d57=_0x19d433||client;return _0x493d57[_0x3b17('0x17')](_0x2942ed,_0x2680bb)[_0x3b17('0x18')](function(_0x4d2465){logger[_0x3b17('0x19')]('ChatMessage,\x20%s,\x20%s',_0x1597e6,_0x3b17('0x1a'));logger[_0x3b17('0x1b')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1597e6,'request\x20sent',JSON[_0x3b17('0x1c')](_0x4d2465));if(_0x4d2465[_0x3b17('0x1d')]){if(_0x4d2465['error'][_0x3b17('0x1e')]===0x1f4){logger[_0x3b17('0x1d')](_0x3b17('0x1f'),_0x1597e6,_0x4d2465['error']['message']);return _0x517f3b(_0x4d2465[_0x3b17('0x1d')][_0x3b17('0x20')]);}logger[_0x3b17('0x1d')](_0x3b17('0x1f'),_0x1597e6,_0x4d2465[_0x3b17('0x1d')]['message']);return _0x526aab(_0x4d2465[_0x3b17('0x1d')]['message']);}else{logger[_0x3b17('0x19')]('ChatMessage,\x20%s,\x20%s',_0x1597e6,'request\x20sent');_0x526aab(_0x4d2465[_0x3b17('0x21')][_0x3b17('0x20')]);}})[_0x3b17('0x22')](function(_0x3b2c42){logger[_0x3b17('0x1d')](_0x3b17('0x1f'),_0x1597e6,_0x3b2c42);_0x517f3b(_0x3b2c42);});});}function respondWithStatusCode(_0x31f27e,_0x15982b){_0x15982b=_0x15982b||0xcc;return function(_0x30a4c6){if(_0x30a4c6){return _0x31f27e[_0x3b17('0x23')](_0x15982b);}return _0x31f27e['status'](_0x15982b)['end']();};}function respondWithResult(_0x4e144d,_0x3466cf){_0x3466cf=_0x3466cf||0xc8;return function(_0x5e90eb){if(_0x5e90eb){return _0x4e144d[_0x3b17('0x24')](_0x3466cf)[_0x3b17('0x25')](_0x5e90eb);}};}function respondWithFilteredResult(_0xfa911e,_0x2796f0){return function(_0x1d7a40){if(_0x1d7a40){var _0x1b34bf=typeof _0x2796f0[_0x3b17('0x26')]===_0x3b17('0x27')&&typeof _0x2796f0[_0x3b17('0x28')]==='undefined';var _0x459815=_0x1d7a40[_0x3b17('0x29')];var _0x4746e1=_0x1b34bf?0x0:_0x2796f0[_0x3b17('0x26')];var _0x556dc6=_0x1b34bf?_0x1d7a40['count']:_0x2796f0['offset']+_0x2796f0[_0x3b17('0x28')];var _0x58cb5c;if(_0x556dc6>=_0x459815){_0x556dc6=_0x459815;_0x58cb5c=0xc8;}else{_0x58cb5c=0xce;}_0xfa911e['status'](_0x58cb5c);return _0xfa911e['set'](_0x3b17('0x2a'),_0x4746e1+'-'+_0x556dc6+'/'+_0x459815)[_0x3b17('0x25')](_0x1d7a40);}return null;};}function patchUpdates(_0x326a6e){return function(_0x257be2){try{jsonpatch[_0x3b17('0x2b')](_0x257be2,_0x326a6e,!![]);}catch(_0x140534){return BPromise[_0x3b17('0x2c')](_0x140534);}return _0x257be2[_0x3b17('0x2d')]();};}function saveUpdates(_0x14cc47,_0x2239f1){return function(_0xe4399d){if(_0xe4399d){return _0xe4399d[_0x3b17('0x2e')](_0x14cc47)[_0x3b17('0x18')](function(_0x2b0472){return _0x2b0472;});}return null;};}function removeEntity(_0x32f7c2,_0x46062d){return function(_0x4a30b3){if(_0x4a30b3){return _0x4a30b3[_0x3b17('0x2f')]()[_0x3b17('0x18')](function(){_0x32f7c2['status'](0xcc)[_0x3b17('0x30')]();});}};}function handleEntityNotFound(_0x539af2,_0x48f476){return function(_0x2295df){if(!_0x2295df){_0x539af2[_0x3b17('0x23')](0x194);}return _0x2295df;};}function handleError(_0x3e22b8,_0x3fee87){_0x3fee87=_0x3fee87||0x1f4;return function(_0x4c4038){logger['error'](_0x4c4038[_0x3b17('0x31')]);if(_0x4c4038[_0x3b17('0x32')]){delete _0x4c4038[_0x3b17('0x32')];}_0x3e22b8[_0x3b17('0x24')](_0x3fee87)[_0x3b17('0x33')](_0x4c4038);};}exports[_0x3b17('0x34')]=function(_0x16aa42,_0x389a6f){var _0x617e6e={},_0xd85b43={},_0x263925={'count':0x0,'rows':[]};var _0x2bfd17=_['map'](db['ChatMessage'][_0x3b17('0x35')],function(_0x1ba21e){return{'name':_0x1ba21e['fieldName'],'type':_0x1ba21e[_0x3b17('0x36')][_0x3b17('0x37')]};});_0xd85b43['model']=_[_0x3b17('0x38')](_0x2bfd17,_0x3b17('0x32'));_0xd85b43['query']=_['keys'](_0x16aa42[_0x3b17('0x39')]);_0xd85b43['filters']=_[_0x3b17('0x3a')](_0xd85b43[_0x3b17('0x3b')],_0xd85b43[_0x3b17('0x39')]);_0x617e6e['attributes']=_[_0x3b17('0x3a')](_0xd85b43[_0x3b17('0x3b')],qs[_0x3b17('0x3c')](_0x16aa42['query'][_0x3b17('0x3c')]));_0x617e6e[_0x3b17('0x3d')]=_0x617e6e[_0x3b17('0x3d')][_0x3b17('0x3e')]?_0x617e6e[_0x3b17('0x3d')]:_0xd85b43[_0x3b17('0x3b')];if(!_0x16aa42['query'][_0x3b17('0x3f')](_0x3b17('0x40'))){_0x617e6e['limit']=qs['limit'](_0x16aa42[_0x3b17('0x39')][_0x3b17('0x28')]);_0x617e6e[_0x3b17('0x26')]=qs[_0x3b17('0x26')](_0x16aa42['query'][_0x3b17('0x26')]);}_0x617e6e[_0x3b17('0x41')]=qs[_0x3b17('0x42')](_0x16aa42['query']['sort']);_0x617e6e[_0x3b17('0x43')]=qs['filters'](_[_0x3b17('0x44')](_0x16aa42[_0x3b17('0x39')],_0xd85b43[_0x3b17('0x45')]),_0x2bfd17);if(_0x16aa42[_0x3b17('0x39')][_0x3b17('0x46')]){_0x617e6e[_0x3b17('0x43')]=_[_0x3b17('0x47')](_0x617e6e['where'],{'$or':_[_0x3b17('0x38')](_0x2bfd17,function(_0x517c29){if(_0x517c29[_0x3b17('0x36')]!=='VIRTUAL'){var _0x59b13c={};_0x59b13c[_0x517c29['name']]={'$like':'%'+_0x16aa42[_0x3b17('0x39')][_0x3b17('0x46')]+'%'};return _0x59b13c;}})});}_0x617e6e=_[_0x3b17('0x47')]({},_0x617e6e,_0x16aa42[_0x3b17('0x48')]);var _0x3dda84={'where':_0x617e6e['where']};return db[_0x3b17('0x49')]['count'](_0x3dda84)['then'](function(_0x289691){_0x263925['count']=_0x289691;if(_0x16aa42[_0x3b17('0x39')][_0x3b17('0x4a')]){_0x617e6e[_0x3b17('0x4b')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x617e6e);})[_0x3b17('0x18')](function(_0x578acd){_0x263925[_0x3b17('0x4c')]=_0x578acd;return _0x263925;})[_0x3b17('0x18')](respondWithFilteredResult(_0x389a6f,_0x617e6e))[_0x3b17('0x22')](handleError(_0x389a6f,null));};exports['show']=function(_0x4ae912,_0x2a8219){var _0xcdf36a={'raw':!![],'where':{'id':_0x4ae912[_0x3b17('0x4d')]['id']}},_0x24b489={};_0x24b489[_0x3b17('0x3b')]=_[_0x3b17('0x4e')](db[_0x3b17('0x49')][_0x3b17('0x35')]);_0x24b489['query']=_[_0x3b17('0x4e')](_0x4ae912[_0x3b17('0x39')]);_0x24b489[_0x3b17('0x45')]=_[_0x3b17('0x3a')](_0x24b489[_0x3b17('0x3b')],_0x24b489[_0x3b17('0x39')]);_0xcdf36a[_0x3b17('0x3d')]=_[_0x3b17('0x3a')](_0x24b489[_0x3b17('0x3b')],qs['fields'](_0x4ae912[_0x3b17('0x39')][_0x3b17('0x3c')]));_0xcdf36a[_0x3b17('0x3d')]=_0xcdf36a[_0x3b17('0x3d')]['length']?_0xcdf36a[_0x3b17('0x3d')]:_0x24b489['model'];if(_0x4ae912['query']['includeAll']){_0xcdf36a[_0x3b17('0x4b')]=[{'all':!![]}];}_0xcdf36a=_[_0x3b17('0x47')]({},_0xcdf36a,_0x4ae912[_0x3b17('0x48')]);return db[_0x3b17('0x49')][_0x3b17('0x4f')](_0xcdf36a)[_0x3b17('0x18')](handleEntityNotFound(_0x2a8219,null))[_0x3b17('0x18')](respondWithResult(_0x2a8219,null))['catch'](handleError(_0x2a8219,null));};exports[_0x3b17('0x50')]=function(_0x435358,_0x44389b){return db[_0x3b17('0x49')]['create'](_0x435358['body'],{})[_0x3b17('0x18')](respondWithResult(_0x44389b,0xc9))[_0x3b17('0x22')](handleError(_0x44389b,null));};exports[_0x3b17('0x2e')]=function(_0x3901bb,_0x2602b3){if(_0x3901bb[_0x3b17('0x51')]['id']){delete _0x3901bb[_0x3b17('0x51')]['id'];}return db[_0x3b17('0x49')]['find']({'where':{'id':_0x3901bb[_0x3b17('0x4d')]['id']}})[_0x3b17('0x18')](handleEntityNotFound(_0x2602b3,null))[_0x3b17('0x18')](saveUpdates(_0x3901bb[_0x3b17('0x51')],null))[_0x3b17('0x18')](respondWithResult(_0x2602b3,null))['catch'](handleError(_0x2602b3,null));};exports[_0x3b17('0x2f')]=function(_0x36a973,_0x243d86){return db['ChatMessage'][_0x3b17('0x4f')]({'where':{'id':_0x36a973['params']['id']}})[_0x3b17('0x18')](handleEntityNotFound(_0x243d86,null))[_0x3b17('0x18')](removeEntity(_0x243d86,null))[_0x3b17('0x22')](handleError(_0x243d86,null));};exports['describe']=function(_0x5e70eb,_0x5b699e){return db[_0x3b17('0x49')][_0x3b17('0x52')]()[_0x3b17('0x18')](respondWithResult(_0x5b699e,null))['catch'](handleError(_0x5b699e,null));};var interaction_log=require(_0x3b17('0x53'))(_0x3b17('0x54'));exports[_0x3b17('0x55')]=function(_0x99a662,_0x151cea,_0x30892f){var _0x1bcc1f={'agent':{},'channel':_0x3b17('0x56')};if(_0x99a662[_0x3b17('0x51')]['id']){delete _0x99a662[_0x3b17('0x51')]['id'];}_0x99a662['body']['read']=!![];_0x99a662['body'][_0x3b17('0x57')]=moment()[_0x3b17('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x99a662[_0x3b17('0x51')][_0x3b17('0x59')]=_0x99a662[_0x3b17('0x51')][_0x3b17('0x59')]||_0x99a662[_0x3b17('0x5a')]['id'];_0x1bcc1f[_0x3b17('0x5b')]['id']=_0x99a662['body'][_0x3b17('0x59')];return db[_0x3b17('0x49')][_0x3b17('0x4f')]({'where':{'id':_0x99a662[_0x3b17('0x4d')]['id'],'UserId':null}})[_0x3b17('0x18')](handleEntityNotFound(_0x151cea,null))['then'](saveUpdates(_0x99a662['body'],null))[_0x3b17('0x18')](function(_0x130105){if(_0x130105){_0x1bcc1f[_0x3b17('0x20')]=_0x130105[_0x3b17('0x5c')]({'plain':!![]});return db[_0x3b17('0x5d')]['find']({'where':{'id':_0x130105['ChatInteractionId']}});}return null;})[_0x3b17('0x18')](handleEntityNotFound(_0x151cea,null))[_0x3b17('0x18')](function(_0x32086a){if(_0x32086a){return _0x32086a[_0x3b17('0x2e')]({'UserId':_0x99a662[_0x3b17('0x51')]['UserId'],'read1stAt':_['isNil'](_0x32086a[_0x3b17('0x5e')])?moment()[_0x3b17('0x58')](_0x3b17('0x5f')):undefined});}return null;})[_0x3b17('0x18')](function(_0x33c154){if(_0x33c154){_0x1bcc1f[_0x3b17('0x60')]=_0x33c154[_0x3b17('0x5c')]({'plain':!![]});interaction_log[_0x3b17('0x19')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x99a662[_0x3b17('0x5a')]['id'],_0x99a662[_0x3b17('0x5a')][_0x3b17('0x32')],_0x99a662[_0x3b17('0x5a')][_0x3b17('0x61')],_0x1bcc1f[_0x3b17('0x60')]['id'],_0x99a662[_0x3b17('0x51')]?JSON[_0x3b17('0x1c')](_0x99a662[_0x3b17('0x51')]):'null');return respondWithRpcPromise(_0x3b17('0x62'),_0x3b17('0x63'),_0x1bcc1f);}return null;})['then'](function(_0x1579e2){var _0x49cb35=_0x3b17('0x64')+_0x1579e2[_0x3b17('0x20')]['ContactId'];return db['sequelize'][_0x3b17('0x39')](_0x49cb35,{'type':db[_0x3b17('0x65')][_0x3b17('0x66')][_0x3b17('0x67')],'raw':!![]})[_0x3b17('0x18')](function(_0x238f27){return _0x238f27;});})['then'](function(_0xe1e3c8){if(_0xe1e3c8){_0x1bcc1f[_0x3b17('0x20')][_0x3b17('0x68')]=_0xe1e3c8[0x0];if(!_0x99a662[_0x3b17('0x51')]['UserId'])return;return db[_0x3b17('0x69')][_0x3b17('0x4f')]({'where':{'id':_0x99a662['body'][_0x3b17('0x59')],'role':_0x3b17('0x5b')},'attributes':['id',_0x3b17('0x32'),_0x3b17('0x6a'),_0x3b17('0x6b'),_0x3b17('0x6c')],'raw':!![]});}return null;})[_0x3b17('0x18')](function(_0x375a3f){if(!_0x375a3f)return null;_0x1bcc1f[_0x3b17('0x20')][_0x3b17('0x5b')]=_0x375a3f;return _0x1bcc1f;})[_0x3b17('0x18')](function(_0x308aa7){if(_0x308aa7){if(_0x99a662[_0x3b17('0x51')][_0x3b17('0x6d')]){_0x1bcc1f[_0x3b17('0x20')][_0x3b17('0x6e')]=util[_0x3b17('0x58')](_0x3b17('0x6f'),_0x99a662[_0x3b17('0x5a')][_0x3b17('0x32')]);_0x1bcc1f[_0x3b17('0x20')][_0x3b17('0x70')]=_0x1bcc1f[_0x3b17('0x70')];_0x1bcc1f['message'][_0x3b17('0x71')]=_0x1bcc1f[_0x3b17('0x70')];_0x1bcc1f[_0x3b17('0x20')][_0x3b17('0x72')]='accept';return respondWithRpcPromise(_0x3b17('0x73'),_0x3b17('0x73'),{'event':'acceptmessage','message':_[_0x3b17('0x47')](_0x1bcc1f[_0x3b17('0x20')],JSON[_0x3b17('0x74')](_0x1bcc1f[_0x3b17('0x60')][_0x3b17('0x75')]))},client9002)['then'](function(){return _0x1bcc1f;});}return _0x1bcc1f;}return null;})[_0x3b17('0x18')](respondWithResult(_0x151cea,null))[_0x3b17('0x22')](handleError(_0x151cea,null));};var interaction_log=require(_0x3b17('0x53'))(_0x3b17('0x54'));exports[_0x3b17('0x2c')]=function(_0x1ff6f7,_0x4b2dac,_0x41239b){var _0x985908={'agent':{},'channel':_0x3b17('0x56')};if(_0x1ff6f7[_0x3b17('0x51')]['id']){delete _0x1ff6f7['body']['id'];}_0x1ff6f7['body'][_0x3b17('0x59')]=_0x1ff6f7[_0x3b17('0x51')]['UserId']||_0x1ff6f7[_0x3b17('0x5a')]['id'];_0x985908['agent']['id']=_0x1ff6f7[_0x3b17('0x51')]['UserId'];return db[_0x3b17('0x49')][_0x3b17('0x4f')]({'where':{'id':_0x1ff6f7[_0x3b17('0x4d')]['id'],'UserId':null}})[_0x3b17('0x18')](handleEntityNotFound(_0x4b2dac,null))[_0x3b17('0x18')](function(_0x56e139){if(_0x56e139){_0x985908[_0x3b17('0x20')]=_0x56e139[_0x3b17('0x5c')]({'plain':!![]});return db[_0x3b17('0x5d')]['find']({'where':{'id':_0x56e139['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4b2dac,null))[_0x3b17('0x18')](function(_0x265a6a){if(_0x265a6a){_0x985908['interaction']=_0x265a6a['get']({'plain':!![]});interaction_log[_0x3b17('0x19')](_0x3b17('0x76'),_0x1ff6f7[_0x3b17('0x5a')]['id'],_0x1ff6f7['user'][_0x3b17('0x32')],_0x1ff6f7[_0x3b17('0x5a')][_0x3b17('0x61')],_0x985908['interaction']['id'],_0x1ff6f7['body']?JSON['stringify'](_0x1ff6f7[_0x3b17('0x51')]):_0x3b17('0x77'));return respondWithRpcPromise(_0x3b17('0x78'),_0x3b17('0x79'),_0x985908);}return null;})[_0x3b17('0x18')](function(_0x1422dc){var _0x553922=_0x3b17('0x64')+_0x1422dc['message'][_0x3b17('0x7a')];return db['sequelize'][_0x3b17('0x39')](_0x553922,{'type':db[_0x3b17('0x65')][_0x3b17('0x66')][_0x3b17('0x67')],'raw':!![]})['then'](function(_0x967338){return _0x967338;});})['then'](function(_0x1f6a7c){if(_0x1f6a7c){_0x985908[_0x3b17('0x20')][_0x3b17('0x68')]=_0x1f6a7c[0x0];if(!_0x1ff6f7[_0x3b17('0x51')][_0x3b17('0x59')])return;return db['User'][_0x3b17('0x4f')]({'where':{'id':_0x1ff6f7[_0x3b17('0x51')]['UserId'],'role':_0x3b17('0x5b')},'attributes':['id',_0x3b17('0x32'),_0x3b17('0x6a'),_0x3b17('0x6b'),_0x3b17('0x6c')],'raw':!![]});}return null;})['then'](function(_0x5a1fd3){if(!_0x5a1fd3)return null;_0x985908[_0x3b17('0x20')][_0x3b17('0x5b')]=_0x5a1fd3;return _0x985908;})[_0x3b17('0x18')](function(_0x50a461){if(_0x50a461){_0x50a461['message'][_0x3b17('0x6e')]=util[_0x3b17('0x58')]('SIP/%s',_0x1ff6f7[_0x3b17('0x5a')][_0x3b17('0x32')]);_0x50a461[_0x3b17('0x20')][_0x3b17('0x70')]=_0x985908[_0x3b17('0x70')];_0x50a461[_0x3b17('0x20')][_0x3b17('0x71')]=_0x985908['channel'];_0x50a461[_0x3b17('0x20')][_0x3b17('0x72')]='reject';respondWithRpcPromise(_0x3b17('0x73'),_0x3b17('0x73'),{'event':'rejectmessage','message':_[_0x3b17('0x47')](_0x985908[_0x3b17('0x20')],JSON[_0x3b17('0x74')](_0x985908[_0x3b17('0x60')][_0x3b17('0x75')]))},client9002);return _0x985908;}return null;})[_0x3b17('0x18')](respondWithResult(_0x4b2dac,null))[_0x3b17('0x22')](handleError(_0x4b2dac,null));};
\ No newline at end of file
+var _0x000f=['event','EventManager','acceptmessage','parse','../../config/logger','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','User','fullname','internal','rejectmessage','formData','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','offset','undefined','limit','count','Content-Range','json','reject','save','then','status','name','index','map','rawAttributes','fieldName','type','key','keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','pick','filter','where','VIRTUAL','merge','options','ChatMessage','includeAll','include','findAll','show','params','create','update','body','destroy','describe','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','find','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','AcceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','agent','email','manual','interface','channel','motionChannel'];(function(_0x1c470d,_0x81d66b){var _0x12141b=function(_0x45bfd3){while(--_0x45bfd3){_0x1c470d['push'](_0x1c470d['shift']());}};_0x12141b(++_0x81d66b);}(_0x000f,0x96));var _0xf000=function(_0x44cc29,_0xa2faf8){_0x44cc29=_0x44cc29-0x0;var _0x596c86=_0x000f[_0x44cc29];return _0x596c86;};'use strict';var emlformat=require(_0xf000('0x0'));var rimraf=require(_0xf000('0x1'));var zipdir=require(_0xf000('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf000('0x3'));var moment=require(_0xf000('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf000('0x5'));var path=require(_0xf000('0x6'));var sox=require('sox');var csv=require(_0xf000('0x7'));var ejs=require(_0xf000('0x8'));var fs=require('fs');var fs_extra=require(_0xf000('0x9'));var _=require(_0xf000('0xa'));var squel=require(_0xf000('0xb'));var crypto=require(_0xf000('0xc'));var jsforce=require(_0xf000('0xd'));var deskjs=require(_0xf000('0xe'));var toCsv=require(_0xf000('0x7'));var querystring=require('querystring');var Papa=require(_0xf000('0xf'));var Redis=require(_0xf000('0x10'));var authService=require(_0xf000('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf000('0x12'));var hardwareService=require(_0xf000('0x13'));var logger=require('../../config/logger')(_0xf000('0x14'));var utils=require(_0xf000('0x15'));var config=require(_0xf000('0x16'));var licenseUtil=require(_0xf000('0x17'));var db=require(_0xf000('0x18'))['db'];config[_0xf000('0x19')]=_[_0xf000('0x1a')](config['redis'],{'host':_0xf000('0x1b'),'port':0x18eb});var socket=require(_0xf000('0x1c'))(new Redis(config[_0xf000('0x19')]));require(_0xf000('0x1d'))[_0xf000('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf000('0x1f')][_0xf000('0x20')]({'port':0x232c});var client9002=jayson[_0xf000('0x1f')][_0xf000('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2e7430,_0x58bcc5,_0x56e69a,_0x5ba1fb){return new BPromise(function(_0x2534c0,_0x5aa921){var _0x5a2282=_0x5ba1fb||client;return _0x5a2282['request'](_0x2e7430,_0x56e69a)['then'](function(_0x37085a){logger[_0xf000('0x21')](_0xf000('0x22'),_0x58bcc5,_0xf000('0x23'));logger[_0xf000('0x24')](_0xf000('0x25'),_0x58bcc5,_0xf000('0x23'),JSON['stringify'](_0x37085a));if(_0x37085a[_0xf000('0x26')]){if(_0x37085a['error'][_0xf000('0x27')]===0x1f4){logger[_0xf000('0x26')]('ChatMessage,\x20%s,\x20%s',_0x58bcc5,_0x37085a[_0xf000('0x26')][_0xf000('0x28')]);return _0x5aa921(_0x37085a[_0xf000('0x26')]['message']);}logger[_0xf000('0x26')](_0xf000('0x22'),_0x58bcc5,_0x37085a[_0xf000('0x26')]['message']);return _0x2534c0(_0x37085a[_0xf000('0x26')][_0xf000('0x28')]);}else{logger[_0xf000('0x21')]('ChatMessage,\x20%s,\x20%s',_0x58bcc5,_0xf000('0x23'));_0x2534c0(_0x37085a[_0xf000('0x29')][_0xf000('0x28')]);}})[_0xf000('0x2a')](function(_0x1bae7a){logger['error'](_0xf000('0x22'),_0x58bcc5,_0x1bae7a);_0x5aa921(_0x1bae7a);});});}function respondWithStatusCode(_0x122a3f,_0x1ab66c){_0x1ab66c=_0x1ab66c||0xcc;return function(_0x5bd22c){if(_0x5bd22c){return _0x122a3f[_0xf000('0x2b')](_0x1ab66c);}return _0x122a3f['status'](_0x1ab66c)[_0xf000('0x2c')]();};}function respondWithResult(_0x21a617,_0xbf9bd5){_0xbf9bd5=_0xbf9bd5||0xc8;return function(_0x2775aa){if(_0x2775aa){return _0x21a617['status'](_0xbf9bd5)['json'](_0x2775aa);}};}function respondWithFilteredResult(_0x494c8c,_0x4103e5){return function(_0x43203b){if(_0x43203b){var _0x128d65=typeof _0x4103e5[_0xf000('0x2d')]===_0xf000('0x2e')&&typeof _0x4103e5[_0xf000('0x2f')]===_0xf000('0x2e');var _0x29f6c1=_0x43203b[_0xf000('0x30')];var _0x3df14b=_0x128d65?0x0:_0x4103e5[_0xf000('0x2d')];var _0x8b8a81=_0x128d65?_0x43203b[_0xf000('0x30')]:_0x4103e5[_0xf000('0x2d')]+_0x4103e5['limit'];var _0x4404d3;if(_0x8b8a81>=_0x29f6c1){_0x8b8a81=_0x29f6c1;_0x4404d3=0xc8;}else{_0x4404d3=0xce;}_0x494c8c['status'](_0x4404d3);return _0x494c8c['set'](_0xf000('0x31'),_0x3df14b+'-'+_0x8b8a81+'/'+_0x29f6c1)[_0xf000('0x32')](_0x43203b);}return null;};}function patchUpdates(_0x53880e){return function(_0x29491e){try{jsonpatch['apply'](_0x29491e,_0x53880e,!![]);}catch(_0x241679){return BPromise[_0xf000('0x33')](_0x241679);}return _0x29491e[_0xf000('0x34')]();};}function saveUpdates(_0x1292f6,_0x210911){return function(_0x1268f6){if(_0x1268f6){return _0x1268f6['update'](_0x1292f6)['then'](function(_0xc087c8){return _0xc087c8;});}return null;};}function removeEntity(_0x33d850,_0x1e2cec){return function(_0x2e0846){if(_0x2e0846){return _0x2e0846['destroy']()[_0xf000('0x35')](function(){_0x33d850[_0xf000('0x36')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf30048,_0x321faa){return function(_0x3642c7){if(!_0x3642c7){_0xf30048[_0xf000('0x2b')](0x194);}return _0x3642c7;};}function handleError(_0x18e105,_0x2605dc){_0x2605dc=_0x2605dc||0x1f4;return function(_0xca0a79){logger[_0xf000('0x26')](_0xca0a79['stack']);if(_0xca0a79[_0xf000('0x37')]){delete _0xca0a79[_0xf000('0x37')];}_0x18e105[_0xf000('0x36')](_0x2605dc)['send'](_0xca0a79);};}exports[_0xf000('0x38')]=function(_0x4063c6,_0x4288b1){var _0x5d278b={},_0x5e9a15={},_0x7df097={'count':0x0,'rows':[]};var _0x4dfb2e=_[_0xf000('0x39')](db['ChatMessage'][_0xf000('0x3a')],function(_0x32dc52){return{'name':_0x32dc52[_0xf000('0x3b')],'type':_0x32dc52[_0xf000('0x3c')][_0xf000('0x3d')]};});_0x5e9a15['model']=_[_0xf000('0x39')](_0x4dfb2e,_0xf000('0x37'));_0x5e9a15['query']=_[_0xf000('0x3e')](_0x4063c6['query']);_0x5e9a15[_0xf000('0x3f')]=_['intersection'](_0x5e9a15[_0xf000('0x40')],_0x5e9a15[_0xf000('0x41')]);_0x5d278b[_0xf000('0x42')]=_[_0xf000('0x43')](_0x5e9a15[_0xf000('0x40')],qs[_0xf000('0x44')](_0x4063c6[_0xf000('0x41')][_0xf000('0x44')]));_0x5d278b[_0xf000('0x42')]=_0x5d278b['attributes'][_0xf000('0x45')]?_0x5d278b[_0xf000('0x42')]:_0x5e9a15[_0xf000('0x40')];if(!_0x4063c6[_0xf000('0x41')][_0xf000('0x46')](_0xf000('0x47'))){_0x5d278b[_0xf000('0x2f')]=qs[_0xf000('0x2f')](_0x4063c6[_0xf000('0x41')][_0xf000('0x2f')]);_0x5d278b[_0xf000('0x2d')]=qs['offset'](_0x4063c6['query'][_0xf000('0x2d')]);}_0x5d278b['order']=qs['sort'](_0x4063c6[_0xf000('0x41')]['sort']);_0x5d278b['where']=qs[_0xf000('0x3f')](_[_0xf000('0x48')](_0x4063c6['query'],_0x5e9a15[_0xf000('0x3f')]),_0x4dfb2e);if(_0x4063c6[_0xf000('0x41')][_0xf000('0x49')]){_0x5d278b[_0xf000('0x4a')]=_['merge'](_0x5d278b['where'],{'$or':_[_0xf000('0x39')](_0x4dfb2e,function(_0x5092bb){if(_0x5092bb['type']!==_0xf000('0x4b')){var _0x305061={};_0x305061[_0x5092bb['name']]={'$like':'%'+_0x4063c6[_0xf000('0x41')][_0xf000('0x49')]+'%'};return _0x305061;}})});}_0x5d278b=_[_0xf000('0x4c')]({},_0x5d278b,_0x4063c6[_0xf000('0x4d')]);var _0x3121e2={'where':_0x5d278b[_0xf000('0x4a')]};return db[_0xf000('0x4e')][_0xf000('0x30')](_0x3121e2)[_0xf000('0x35')](function(_0x514581){_0x7df097[_0xf000('0x30')]=_0x514581;if(_0x4063c6[_0xf000('0x41')][_0xf000('0x4f')]){_0x5d278b[_0xf000('0x50')]=[{'all':!![]}];}return db['ChatMessage'][_0xf000('0x51')](_0x5d278b);})[_0xf000('0x35')](function(_0x492787){_0x7df097['rows']=_0x492787;return _0x7df097;})['then'](respondWithFilteredResult(_0x4288b1,_0x5d278b))[_0xf000('0x2a')](handleError(_0x4288b1,null));};exports[_0xf000('0x52')]=function(_0x2d5e7b,_0x28c9d7){var _0x1b6ec8={'raw':!![],'where':{'id':_0x2d5e7b[_0xf000('0x53')]['id']}},_0x5207de={};_0x5207de[_0xf000('0x40')]=_['keys'](db['ChatMessage'][_0xf000('0x3a')]);_0x5207de[_0xf000('0x41')]=_[_0xf000('0x3e')](_0x2d5e7b[_0xf000('0x41')]);_0x5207de[_0xf000('0x3f')]=_[_0xf000('0x43')](_0x5207de['model'],_0x5207de[_0xf000('0x41')]);_0x1b6ec8['attributes']=_[_0xf000('0x43')](_0x5207de[_0xf000('0x40')],qs[_0xf000('0x44')](_0x2d5e7b['query'][_0xf000('0x44')]));_0x1b6ec8['attributes']=_0x1b6ec8[_0xf000('0x42')]['length']?_0x1b6ec8[_0xf000('0x42')]:_0x5207de[_0xf000('0x40')];if(_0x2d5e7b[_0xf000('0x41')][_0xf000('0x4f')]){_0x1b6ec8[_0xf000('0x50')]=[{'all':!![]}];}_0x1b6ec8=_[_0xf000('0x4c')]({},_0x1b6ec8,_0x2d5e7b[_0xf000('0x4d')]);return db[_0xf000('0x4e')]['find'](_0x1b6ec8)['then'](handleEntityNotFound(_0x28c9d7,null))['then'](respondWithResult(_0x28c9d7,null))[_0xf000('0x2a')](handleError(_0x28c9d7,null));};exports[_0xf000('0x54')]=function(_0x4bcfb3,_0x2f36ef){return db[_0xf000('0x4e')][_0xf000('0x54')](_0x4bcfb3['body'],{})[_0xf000('0x35')](respondWithResult(_0x2f36ef,0xc9))[_0xf000('0x2a')](handleError(_0x2f36ef,null));};exports[_0xf000('0x55')]=function(_0x509e87,_0x33f7fd){if(_0x509e87[_0xf000('0x56')]['id']){delete _0x509e87[_0xf000('0x56')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x509e87[_0xf000('0x53')]['id']}})[_0xf000('0x35')](handleEntityNotFound(_0x33f7fd,null))['then'](saveUpdates(_0x509e87[_0xf000('0x56')],null))['then'](respondWithResult(_0x33f7fd,null))['catch'](handleError(_0x33f7fd,null));};exports[_0xf000('0x57')]=function(_0x209279,_0x3ef390){return db[_0xf000('0x4e')]['find']({'where':{'id':_0x209279[_0xf000('0x53')]['id']}})[_0xf000('0x35')](handleEntityNotFound(_0x3ef390,null))[_0xf000('0x35')](removeEntity(_0x3ef390,null))['catch'](handleError(_0x3ef390,null));};exports[_0xf000('0x58')]=function(_0x1b55e4,_0x4a8fb9){return db[_0xf000('0x4e')][_0xf000('0x58')]()['then'](respondWithResult(_0x4a8fb9,null))[_0xf000('0x2a')](handleError(_0x4a8fb9,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xf000('0x59')]=function(_0x56fa3b,_0x3645ba,_0x3688a3){var _0x88197e={'agent':{},'channel':_0xf000('0x5a')};if(_0x56fa3b['body']['id']){delete _0x56fa3b[_0xf000('0x56')]['id'];}_0x56fa3b['body'][_0xf000('0x5b')]=!![];_0x56fa3b[_0xf000('0x56')]['readAt']=moment()[_0xf000('0x5c')](_0xf000('0x5d'));_0x56fa3b[_0xf000('0x56')][_0xf000('0x5e')]=_0x56fa3b[_0xf000('0x56')]['UserId']||_0x56fa3b['user']['id'];_0x88197e['agent']['id']=_0x56fa3b[_0xf000('0x56')][_0xf000('0x5e')];return db[_0xf000('0x4e')]['find']({'where':{'id':_0x56fa3b[_0xf000('0x53')]['id'],'UserId':null}})[_0xf000('0x35')](handleEntityNotFound(_0x3645ba,null))[_0xf000('0x35')](saveUpdates(_0x56fa3b[_0xf000('0x56')],null))[_0xf000('0x35')](function(_0x4a05ee){if(_0x4a05ee){_0x88197e['message']=_0x4a05ee[_0xf000('0x5f')]({'plain':!![]});return db[_0xf000('0x60')][_0xf000('0x61')]({'where':{'id':_0x4a05ee[_0xf000('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x3645ba,null))['then'](function(_0x5a8683){if(_0x5a8683){return _0x5a8683['update']({'UserId':_0x56fa3b[_0xf000('0x56')][_0xf000('0x5e')],'read1stAt':_[_0xf000('0x63')](_0x5a8683[_0xf000('0x64')])?moment()[_0xf000('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf000('0x35')](function(_0x2a3d29){if(_0x2a3d29){_0x88197e[_0xf000('0x65')]=_0x2a3d29[_0xf000('0x5f')]({'plain':!![]});interaction_log[_0xf000('0x21')](_0xf000('0x66'),_0x56fa3b[_0xf000('0x67')]['id'],_0x56fa3b[_0xf000('0x67')][_0xf000('0x37')],_0x56fa3b[_0xf000('0x67')][_0xf000('0x68')],_0x88197e[_0xf000('0x65')]['id'],_0x56fa3b[_0xf000('0x56')]?JSON[_0xf000('0x69')](_0x56fa3b[_0xf000('0x56')]):'null');return respondWithRpcPromise(_0xf000('0x6a'),'acceptMessage',_0x88197e);}return null;})[_0xf000('0x35')](function(_0x4eedc7){var _0x52780a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4eedc7['message'][_0xf000('0x6b')];return db[_0xf000('0x6c')][_0xf000('0x41')](_0x52780a,{'type':db['Sequelize'][_0xf000('0x6d')][_0xf000('0x6e')],'raw':!![]})[_0xf000('0x35')](function(_0x26fc5f){return _0x26fc5f;});})[_0xf000('0x35')](function(_0x4e553e){if(_0x4e553e){_0x88197e[_0xf000('0x28')][_0xf000('0x6f')]=_0x4e553e[0x0];if(!_0x56fa3b[_0xf000('0x56')][_0xf000('0x5e')])return;return db['User'][_0xf000('0x61')]({'where':{'id':_0x56fa3b[_0xf000('0x56')]['UserId'],'role':_0xf000('0x70')},'attributes':['id',_0xf000('0x37'),'fullname',_0xf000('0x71'),'internal'],'raw':!![]});}return null;})[_0xf000('0x35')](function(_0x5e92e8){if(!_0x5e92e8)return null;_0x88197e['message']['agent']=_0x5e92e8;return _0x88197e;})['then'](function(_0x10ad55){if(_0x10ad55){if(_0x56fa3b[_0xf000('0x56')][_0xf000('0x72')]){_0x88197e[_0xf000('0x28')][_0xf000('0x73')]=util[_0xf000('0x5c')]('SIP/%s',_0x56fa3b[_0xf000('0x67')]['name']);_0x88197e[_0xf000('0x28')][_0xf000('0x74')]=_0x88197e[_0xf000('0x74')];_0x88197e[_0xf000('0x28')][_0xf000('0x75')]=_0x88197e[_0xf000('0x74')];_0x88197e[_0xf000('0x28')][_0xf000('0x76')]=_0xf000('0x59');return respondWithRpcPromise(_0xf000('0x77'),_0xf000('0x77'),{'event':_0xf000('0x78'),'message':_[_0xf000('0x4c')](_0x88197e[_0xf000('0x28')],JSON[_0xf000('0x79')](_0x88197e[_0xf000('0x65')]['formData']))},client9002)[_0xf000('0x35')](function(){return _0x88197e;});}return _0x88197e;}return null;})[_0xf000('0x35')](respondWithResult(_0x3645ba,null))['catch'](handleError(_0x3645ba,null));};var interaction_log=require(_0xf000('0x7a'))(_0xf000('0x7b'));exports[_0xf000('0x33')]=function(_0x51094b,_0xfac72e,_0x2c220e){var _0x4cc7e1={'agent':{},'channel':_0xf000('0x5a')};if(_0x51094b['body']['id']){delete _0x51094b['body']['id'];}_0x51094b[_0xf000('0x56')][_0xf000('0x5e')]=_0x51094b[_0xf000('0x56')][_0xf000('0x5e')]||_0x51094b[_0xf000('0x67')]['id'];_0x4cc7e1['agent']['id']=_0x51094b[_0xf000('0x56')]['UserId'];return db[_0xf000('0x4e')][_0xf000('0x61')]({'where':{'id':_0x51094b[_0xf000('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xfac72e,null))[_0xf000('0x35')](function(_0x275812){if(_0x275812){_0x4cc7e1[_0xf000('0x28')]=_0x275812['get']({'plain':!![]});return db[_0xf000('0x60')][_0xf000('0x61')]({'where':{'id':_0x275812[_0xf000('0x62')]}});}return null;})[_0xf000('0x35')](handleEntityNotFound(_0xfac72e,null))[_0xf000('0x35')](function(_0x5b52a3){if(_0x5b52a3){_0x4cc7e1['interaction']=_0x5b52a3[_0xf000('0x5f')]({'plain':!![]});interaction_log[_0xf000('0x21')](_0xf000('0x7c'),_0x51094b['user']['id'],_0x51094b['user'][_0xf000('0x37')],_0x51094b[_0xf000('0x67')][_0xf000('0x68')],_0x4cc7e1['interaction']['id'],_0x51094b[_0xf000('0x56')]?JSON[_0xf000('0x69')](_0x51094b[_0xf000('0x56')]):_0xf000('0x7d'));return respondWithRpcPromise(_0xf000('0x7e'),'rejectMessage',_0x4cc7e1);}return null;})['then'](function(_0x7edb64){var _0x253d1d=_0xf000('0x7f')+_0x7edb64['message']['ContactId'];return db[_0xf000('0x6c')]['query'](_0x253d1d,{'type':db[_0xf000('0x80')][_0xf000('0x6d')][_0xf000('0x6e')],'raw':!![]})[_0xf000('0x35')](function(_0x4947bc){return _0x4947bc;});})[_0xf000('0x35')](function(_0x53b741){if(_0x53b741){_0x4cc7e1[_0xf000('0x28')][_0xf000('0x6f')]=_0x53b741[0x0];if(!_0x51094b['body'][_0xf000('0x5e')])return;return db[_0xf000('0x81')][_0xf000('0x61')]({'where':{'id':_0x51094b['body'][_0xf000('0x5e')],'role':_0xf000('0x70')},'attributes':['id',_0xf000('0x37'),_0xf000('0x82'),_0xf000('0x71'),_0xf000('0x83')],'raw':!![]});}return null;})['then'](function(_0x1abb1f){if(!_0x1abb1f)return null;_0x4cc7e1[_0xf000('0x28')][_0xf000('0x70')]=_0x1abb1f;return _0x4cc7e1;})[_0xf000('0x35')](function(_0x7dd6a5){if(_0x7dd6a5){_0x7dd6a5['message'][_0xf000('0x73')]=util[_0xf000('0x5c')]('SIP/%s',_0x51094b[_0xf000('0x67')][_0xf000('0x37')]);_0x7dd6a5[_0xf000('0x28')][_0xf000('0x74')]=_0x4cc7e1[_0xf000('0x74')];_0x7dd6a5['message'][_0xf000('0x75')]=_0x4cc7e1[_0xf000('0x74')];_0x7dd6a5[_0xf000('0x28')][_0xf000('0x76')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0xf000('0x84'),'message':_[_0xf000('0x4c')](_0x4cc7e1[_0xf000('0x28')],JSON['parse'](_0x4cc7e1['interaction'][_0xf000('0x85')]))},client9002);return _0x4cc7e1;}return null;})[_0xf000('0x35')](respondWithResult(_0xfac72e,null))[_0xf000('0x2a')](handleError(_0xfac72e,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 49c3375..4690d32 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 _0x628c=['save','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x257888,_0x1a7140){var _0x1e5534=function(_0x48a0f4){while(--_0x48a0f4){_0x257888['push'](_0x257888['shift']());}};_0x1e5534(++_0x1a7140);}(_0x628c,0x14d));var _0xc628=function(_0x54381d,_0x247b2c){_0x54381d=_0x54381d-0x0;var _0x5308a7=_0x628c[_0x54381d];return _0x5308a7;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xc628('0x0'))['db'][_0xc628('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc628('0x2')](0x0);var events={'afterCreate':_0xc628('0x3'),'afterUpdate':'update','afterDestroy':_0xc628('0x4')};function emitEvent(_0x272b92){return function(_0xa54671,_0x416f5b,_0x5e0c2b){ChatMessageEvents[_0xc628('0x5')](_0x272b92+':'+_0xa54671['id'],_0xa54671);ChatMessageEvents['emit'](_0x272b92,_0xa54671);_0x5e0c2b(null);};}for(var e in events){if(events[_0xc628('0x6')](e)){var event=events[e];ChatMessage[_0xc628('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x2f04=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3f8965,_0x3c80b9){var _0xcdf5c9=function(_0x57f205){while(--_0x57f205){_0x3f8965['push'](_0x3f8965['shift']());}};_0xcdf5c9(++_0x3c80b9);}(_0x2f04,0xae));var _0x42f0=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x2f04[_0x46698a];return _0x356db0;};'use strict';var EventEmitter=require(_0x42f0('0x0'));var ChatMessage=require(_0x42f0('0x1'))['db'][_0x42f0('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x42f0('0x3')](0x0);var events={'afterCreate':_0x42f0('0x4'),'afterUpdate':_0x42f0('0x5'),'afterDestroy':_0x42f0('0x6')};function emitEvent(_0x117fa4){return function(_0x1af40d,_0x3402f5,_0x26a453){ChatMessageEvents[_0x42f0('0x7')](_0x117fa4+':'+_0x1af40d['id'],_0x1af40d);ChatMessageEvents[_0x42f0('0x7')](_0x117fa4,_0x1af40d);_0x26a453(null);};}for(var e in events){if(events[_0x42f0('0x8')](e)){var event=events[e];ChatMessage[_0x42f0('0x9')](e,emitEvent(event));}}module[_0x42f0('0xa')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index ded8b0a..b2f0cee 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 _0xb93e=['api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','isNil','UserId','findOne','ChatInteractionId','update','createdAt','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0xc9bc0f,_0x12e2ac){var _0x4aacbc=function(_0x518b76){while(--_0x518b76){_0xc9bc0f['push'](_0xc9bc0f['shift']());}};_0x4aacbc(++_0x12e2ac);}(_0xb93e,0x10c));var _0xeb93=function(_0x208d4e,_0x42c222){_0x208d4e=_0x208d4e-0x0;var _0x598629=_0xb93e[_0x208d4e];return _0x598629;};'use strict';var _=require('lodash');var util=require(_0xeb93('0x0'));var logger=require(_0xeb93('0x1'))(_0xeb93('0x2'));var moment=require(_0xeb93('0x3'));var BPromise=require('bluebird');var rp=require(_0xeb93('0x4'));var fs=require('fs');var path=require(_0xeb93('0x5'));var rimraf=require(_0xeb93('0x6'));var config=require(_0xeb93('0x7'));var attributes=require(_0xeb93('0x8'));module[_0xeb93('0x9')]=function(_0xc6b01,_0x4fcea5){return _0xc6b01[_0xeb93('0xa')](_0xeb93('0xb'),attributes,{'tableName':_0xeb93('0xc'),'paranoid':![],'indexes':[{'name':_0xeb93('0xd'),'fields':[_0xeb93('0xe')],'type':_0xeb93('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29d651,_0x34e459,_0x11cab6){var _0x4cdd2e=_0xc6b01['models'];var _0x11b4f1=_0x29d651[_0xeb93('0x10')]({'plain':!![]});if(_0x11b4f1[_0xeb93('0x11')][_0xeb93('0x12')]()==='in'||_0x11b4f1[_0xeb93('0x11')][_0xeb93('0x12')]()==='out'&&!_0x11b4f1['secret']&&!_[_0xeb93('0x13')](_0x11b4f1[_0xeb93('0x14')])){_0x4cdd2e['ChatInteraction'][_0xeb93('0x15')]({'where':{'id':_0x11b4f1[_0xeb93('0x16')]}})['then'](function(_0xd41b58){if(_0xd41b58){_0xd41b58[_0xeb93('0x17')]({'lastMsgAt':_0x11b4f1[_0xeb93('0x18')],'lastMsgDirection':_0x11b4f1[_0xeb93('0x11')][_0xeb93('0x12')]()});}})['catch'](function(_0x99d2bd){console['error'](_0x99d2bd);});}_0x11cab6();}},'charset':_0xeb93('0x19'),'collate':_0xeb93('0x1a')});};
\ No newline at end of file
+var _0x88ca=['secret','isNil','UserId','ChatInteraction','findOne','then','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','body','FULLTEXT','get','direction','toLowerCase'];(function(_0x4cfe90,_0x3da8fb){var _0x13591e=function(_0x3f1281){while(--_0x3f1281){_0x4cfe90['push'](_0x4cfe90['shift']());}};_0x13591e(++_0x3da8fb);}(_0x88ca,0xa6));var _0xa88c=function(_0x12d812,_0x496bb7){_0x12d812=_0x12d812-0x0;var _0x3711ab=_0x88ca[_0x12d812];return _0x3711ab;};'use strict';var _=require(_0xa88c('0x0'));var util=require('util');var logger=require(_0xa88c('0x1'))(_0xa88c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa88c('0x3'));var fs=require('fs');var path=require(_0xa88c('0x4'));var rimraf=require(_0xa88c('0x5'));var config=require(_0xa88c('0x6'));var attributes=require(_0xa88c('0x7'));module[_0xa88c('0x8')]=function(_0x290278,_0x4f8693){return _0x290278['define'](_0xa88c('0x9'),attributes,{'tableName':_0xa88c('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xa88c('0xb')],'type':_0xa88c('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x39b104,_0x27c15a,_0x539138){var _0x449230=_0x290278['models'];var _0x3e63da=_0x39b104[_0xa88c('0xd')]({'plain':!![]});if(_0x3e63da[_0xa88c('0xe')][_0xa88c('0xf')]()==='in'||_0x3e63da[_0xa88c('0xe')][_0xa88c('0xf')]()==='out'&&!_0x3e63da[_0xa88c('0x10')]&&!_[_0xa88c('0x11')](_0x3e63da[_0xa88c('0x12')])){_0x449230[_0xa88c('0x13')][_0xa88c('0x14')]({'where':{'id':_0x3e63da['ChatInteractionId']}})[_0xa88c('0x15')](function(_0x555826){if(_0x555826){_0x555826[_0xa88c('0x16')]({'lastMsgAt':_0x3e63da['createdAt'],'lastMsgDirection':_0x3e63da['direction'][_0xa88c('0xf')]()});}})[_0xa88c('0x17')](function(_0x30ddb4){console['error'](_0x30ddb4);});}_0x539138();}},'charset':_0xa88c('0x18'),'collate':_0xa88c('0x19')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index b47c58e..767f655 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 _0xa51f=['http','redis','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateChatMessage','ChatMessage','body','options','raw','stringify','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0xa51f,0x1d9));var _0xfa51=function(_0x5b086e,_0x5eb6c0){_0x5b086e=_0x5b086e-0x0;var _0x3e2c2c=_0xa51f[_0x5b086e];return _0x3e2c2c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa51('0x0'));var BPromise=require('bluebird');var rs=require(_0xfa51('0x1'));var fs=require('fs');var Redis=require(_0xfa51('0x2'));var db=require(_0xfa51('0x3'))['db'];var utils=require(_0xfa51('0x4'));var logger=require('../../config/logger')(_0xfa51('0x5'));var config=require(_0xfa51('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa51('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfa51('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa51('0x9'))(new Redis(config[_0xfa51('0x8')]));require(_0xfa51('0xa'))[_0xfa51('0xb')](socket);function respondWithRpcPromise(_0x312b40,_0xa77167,_0x4265c0){return new BPromise(function(_0x1e88a6,_0x3efc9d){return client[_0xfa51('0xc')](_0x312b40,_0x4265c0)[_0xfa51('0xd')](function(_0xd2d8b0){logger[_0xfa51('0xe')](_0xfa51('0xf'),_0xa77167,_0xfa51('0x10'));logger[_0xfa51('0x11')](_0xfa51('0x12'),_0xa77167,_0xfa51('0x10'),JSON['stringify'](_0xd2d8b0));if(_0xd2d8b0[_0xfa51('0x13')]){if(_0xd2d8b0['error'][_0xfa51('0x14')]===0x1f4){logger[_0xfa51('0x13')](_0xfa51('0xf'),_0xa77167,_0xd2d8b0[_0xfa51('0x13')][_0xfa51('0x15')]);return _0x3efc9d(_0xd2d8b0[_0xfa51('0x13')][_0xfa51('0x15')]);}logger[_0xfa51('0x13')]('ChatMessage,\x20%s,\x20%s',_0xa77167,_0xd2d8b0[_0xfa51('0x13')][_0xfa51('0x15')]);return _0x1e88a6(_0xd2d8b0[_0xfa51('0x13')][_0xfa51('0x15')]);}else{logger[_0xfa51('0xe')]('ChatMessage,\x20%s,\x20%s',_0xa77167,_0xfa51('0x10'));_0x1e88a6(_0xd2d8b0[_0xfa51('0x16')]['message']);}})['catch'](function(_0x3cc802){logger[_0xfa51('0x13')]('ChatMessage,\x20%s,\x20%s',_0xa77167,_0x3cc802);_0x3efc9d(_0x3cc802);});});}exports[_0xfa51('0x17')]=function(_0x218cb1){var _0xeb1822=this;return new Promise(function(_0x12b063,_0x3cac04){return db[_0xfa51('0x18')]['create'](_0x218cb1[_0xfa51('0x19')],{'raw':_0x218cb1['options']?_0x218cb1[_0xfa51('0x1a')][_0xfa51('0x1b')]===undefined?!![]:![]:!![]})[_0xfa51('0xd')](function(_0x45a5ba){logger['info'](_0xfa51('0x17'),_0x218cb1);logger[_0xfa51('0x11')]('CreateChatMessage',_0x218cb1,JSON[_0xfa51('0x1c')](_0x45a5ba));_0x12b063(_0x45a5ba);})[_0xfa51('0x1d')](function(_0x437ec6){logger['error'](_0xfa51('0x17'),_0x437ec6[_0xfa51('0x15')],_0x218cb1);_0x3cac04(_0xeb1822['error'](0x1f4,_0x437ec6[_0xfa51('0x15')]));});});};
\ No newline at end of file
+var _0x17ea=['info','request\x20sent','result','catch','ChatMessage','create','options','raw','CreateChatMessage','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatMessage.socket','then','ChatMessage,\x20%s,\x20%s','debug','stringify','error','code','message'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x17ea,0x169));var _0xa17e=function(_0x4f2391,_0x31ae5d){_0x4f2391=_0x4f2391-0x0;var _0x273cbb=_0x17ea[_0x4f2391];return _0x273cbb;};'use strict';var _=require(_0xa17e('0x0'));var util=require(_0xa17e('0x1'));var moment=require('moment');var BPromise=require(_0xa17e('0x2'));var rs=require(_0xa17e('0x3'));var fs=require('fs');var Redis=require(_0xa17e('0x4'));var db=require(_0xa17e('0x5'))['db'];var utils=require(_0xa17e('0x6'));var logger=require(_0xa17e('0x7'))(_0xa17e('0x8'));var config=require(_0xa17e('0x9'));var jayson=require(_0xa17e('0xa'));var client=jayson[_0xa17e('0xb')]['http']({'port':0x232a});config[_0xa17e('0xc')]=_[_0xa17e('0xd')](config[_0xa17e('0xc')],{'host':_0xa17e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa17e('0xc')]));require(_0xa17e('0xf'))['register'](socket);function respondWithRpcPromise(_0xc54626,_0x2eba2e,_0x15664c){return new BPromise(function(_0x2ab747,_0x5b8dbb){return client['request'](_0xc54626,_0x15664c)[_0xa17e('0x10')](function(_0x236dc1){logger['info'](_0xa17e('0x11'),_0x2eba2e,'request\x20sent');logger[_0xa17e('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2eba2e,'request\x20sent',JSON[_0xa17e('0x13')](_0x236dc1));if(_0x236dc1[_0xa17e('0x14')]){if(_0x236dc1['error'][_0xa17e('0x15')]===0x1f4){logger[_0xa17e('0x14')](_0xa17e('0x11'),_0x2eba2e,_0x236dc1[_0xa17e('0x14')][_0xa17e('0x16')]);return _0x5b8dbb(_0x236dc1[_0xa17e('0x14')]['message']);}logger[_0xa17e('0x14')](_0xa17e('0x11'),_0x2eba2e,_0x236dc1[_0xa17e('0x14')][_0xa17e('0x16')]);return _0x2ab747(_0x236dc1['error']['message']);}else{logger[_0xa17e('0x17')](_0xa17e('0x11'),_0x2eba2e,_0xa17e('0x18'));_0x2ab747(_0x236dc1[_0xa17e('0x19')]['message']);}})[_0xa17e('0x1a')](function(_0x2cf412){logger[_0xa17e('0x14')](_0xa17e('0x11'),_0x2eba2e,_0x2cf412);_0x5b8dbb(_0x2cf412);});});}exports['CreateChatMessage']=function(_0x1b6e4c){var _0x27e4a8=this;return new Promise(function(_0x2adc51,_0x61b97e){return db[_0xa17e('0x1b')][_0xa17e('0x1c')](_0x1b6e4c['body'],{'raw':_0x1b6e4c[_0xa17e('0x1d')]?_0x1b6e4c[_0xa17e('0x1d')][_0xa17e('0x1e')]===undefined?!![]:![]:!![]})[_0xa17e('0x10')](function(_0x294510){logger[_0xa17e('0x17')](_0xa17e('0x1f'),_0x1b6e4c);logger[_0xa17e('0x12')]('CreateChatMessage',_0x1b6e4c,JSON['stringify'](_0x294510));_0x2adc51(_0x294510);})[_0xa17e('0x1a')](function(_0x2ed8fd){logger['error'](_0xa17e('0x1f'),_0x2ed8fd['message'],_0x1b6e4c);_0x61b97e(_0x27e4a8[_0xa17e('0x14')](0x1f4,_0x2ed8fd[_0xa17e('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 2816fbd..ed66531 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 _0x8ca9=['length','chatMessage:','./chatMessage.events','save','remove','update','register'];(function(_0x37e6dc,_0x5ba4b2){var _0x4138c5=function(_0x586804){while(--_0x586804){_0x37e6dc['push'](_0x37e6dc['shift']());}};_0x4138c5(++_0x5ba4b2);}(_0x8ca9,0x9c));var _0x98ca=function(_0x1bc507,_0x32b5fd){_0x1bc507=_0x1bc507-0x0;var _0x1c110a=_0x8ca9[_0x1bc507];return _0x1c110a;};'use strict';var ChatMessageEvents=require(_0x98ca('0x0'));var events=[_0x98ca('0x1'),_0x98ca('0x2'),_0x98ca('0x3')];function createListener(_0x3d9153,_0x22047f){return function(_0xe479d6){_0x22047f['emit'](_0x3d9153,_0xe479d6);};}function removeListener(_0x4c230f,_0x142793){return function(){ChatMessageEvents['removeListener'](_0x4c230f,_0x142793);};}exports[_0x98ca('0x4')]=function(_0x48415d){for(var _0x219619=0x0,_0xca4097=events[_0x98ca('0x5')];_0x219619<_0xca4097;_0x219619++){var _0x2852a0=events[_0x219619];var _0x323c95=createListener(_0x98ca('0x6')+_0x2852a0,_0x48415d);ChatMessageEvents['on'](_0x2852a0,_0x323c95);}};
\ No newline at end of file
+var _0x06f4=['register','chatMessage:','./chatMessage.events','save','update','emit','removeListener'];(function(_0x5118f8,_0x43ff98){var _0xb466ec=function(_0x1c6d97){while(--_0x1c6d97){_0x5118f8['push'](_0x5118f8['shift']());}};_0xb466ec(++_0x43ff98);}(_0x06f4,0x136));var _0x406f=function(_0x3b6880,_0x4fe877){_0x3b6880=_0x3b6880-0x0;var _0x1f598d=_0x06f4[_0x3b6880];return _0x1f598d;};'use strict';var ChatMessageEvents=require(_0x406f('0x0'));var events=[_0x406f('0x1'),'remove',_0x406f('0x2')];function createListener(_0x276a15,_0x58cd7d){return function(_0x5cab5e){_0x58cd7d[_0x406f('0x3')](_0x276a15,_0x5cab5e);};}function removeListener(_0x5ed32f,_0x32abfd){return function(){ChatMessageEvents[_0x406f('0x4')](_0x5ed32f,_0x32abfd);};}exports[_0x406f('0x5')]=function(_0x32b2bd){for(var _0x59821c=0x0,_0x1d2886=events['length'];_0x59821c<_0x1d2886;_0x59821c++){var _0x1afec4=events[_0x59821c];var _0x1c39ce=createListener(_0x406f('0x6')+_0x1afec4,_0x32b2bd);ChatMessageEvents['on'](_0x1afec4,_0x1c39ce);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index ff9660f..6b350d0 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 _0x33f3=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','/:id','show','post','chatmessage:create','update','put','/:id/accept','accept','/:id/reject','reject','delete','multer'];(function(_0x1c57d6,_0x4a7534){var _0x36d17d=function(_0x599805){while(--_0x599805){_0x1c57d6['push'](_0x1c57d6['shift']());}};_0x36d17d(++_0x4a7534);}(_0x33f3,0x1da));var _0x333f=function(_0x4127eb,_0x53b05f){_0x4127eb=_0x4127eb-0x0;var _0x76a6ea=_0x33f3[_0x4127eb];return _0x76a6ea;};'use strict';var multer=require(_0x333f('0x0'));var util=require(_0x333f('0x1'));var path=require(_0x333f('0x2'));var timeout=require(_0x333f('0x3'));var express=require(_0x333f('0x4'));var router=express[_0x333f('0x5')]();var fs_extra=require(_0x333f('0x6'));var auth=require(_0x333f('0x7'));var interaction=require(_0x333f('0x8'));var config=require(_0x333f('0x9'));var controller=require(_0x333f('0xa'));router[_0x333f('0xb')]('/',auth[_0x333f('0xc')](),controller['index']);router[_0x333f('0xb')](_0x333f('0xd'),auth[_0x333f('0xc')](),controller['describe']);router[_0x333f('0xb')](_0x333f('0xe'),auth[_0x333f('0xc')](),controller[_0x333f('0xf')]);router[_0x333f('0x10')]('/',auth['isAuthenticated'](),interaction['tracked']('chat',_0x333f('0x11')),controller['create']);router['put'](_0x333f('0xe'),controller[_0x333f('0x12')]);router[_0x333f('0x13')](_0x333f('0x14'),auth['isAuthenticated'](),controller[_0x333f('0x15')]);router[_0x333f('0x13')](_0x333f('0x16'),auth[_0x333f('0xc')](),controller[_0x333f('0x17')]);router[_0x333f('0x18')](_0x333f('0xe'),auth[_0x333f('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xb75e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x55c3f6,_0x1c6629){var _0x40099b=function(_0x22d967){while(--_0x22d967){_0x55c3f6['push'](_0x55c3f6['shift']());}};_0x40099b(++_0x1c6629);}(_0xb75e,0x162));var _0xeb75=function(_0x4ec472,_0x48de88){_0x4ec472=_0x4ec472-0x0;var _0x348c0d=_0xb75e[_0x4ec472];return _0x348c0d;};'use strict';var multer=require(_0xeb75('0x0'));var util=require(_0xeb75('0x1'));var path=require(_0xeb75('0x2'));var timeout=require(_0xeb75('0x3'));var express=require(_0xeb75('0x4'));var router=express[_0xeb75('0x5')]();var fs_extra=require(_0xeb75('0x6'));var auth=require(_0xeb75('0x7'));var interaction=require(_0xeb75('0x8'));var config=require(_0xeb75('0x9'));var controller=require(_0xeb75('0xa'));router[_0xeb75('0xb')]('/',auth[_0xeb75('0xc')](),controller['index']);router['get'](_0xeb75('0xd'),auth['isAuthenticated'](),controller[_0xeb75('0xe')]);router[_0xeb75('0xb')]('/:id',auth[_0xeb75('0xc')](),controller[_0xeb75('0xf')]);router[_0xeb75('0x10')]('/',auth[_0xeb75('0xc')](),interaction[_0xeb75('0x11')](_0xeb75('0x12'),_0xeb75('0x13')),controller[_0xeb75('0x14')]);router[_0xeb75('0x15')]('/:id',controller[_0xeb75('0x16')]);router[_0xeb75('0x15')](_0xeb75('0x17'),auth['isAuthenticated'](),controller['accept']);router['put'](_0xeb75('0x18'),auth[_0xeb75('0xc')](),controller[_0xeb75('0x19')]);router[_0xeb75('0x1a')](_0xeb75('0x1b'),auth[_0xeb75('0xc')](),controller[_0xeb75('0x1c')]);module[_0xeb75('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 1b46c82..d11a7c2 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 _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x93ef32,_0xeeec1){var _0x528b6c=function(_0x3dc977){while(--_0x3dc977){_0x93ef32['push'](_0x93ef32['shift']());}};_0x528b6c(++_0xeeec1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x575de5,_0x179f6a){_0x575de5=_0x575de5-0x0;var _0x1615db=_0x5f2f[_0x575de5];return _0x1615db;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f66=['medium','TEXT','exports'];(function(_0x1bfb2f,_0x1042c3){var _0x392184=function(_0x40b1c3){while(--_0x40b1c3){_0x1bfb2f['push'](_0x1bfb2f['shift']());}};_0x392184(++_0x1042c3);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index c00849c..dd8fb01 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5f0064,_0x53573a){var _0x41a295=function(_0x2672bc){while(--_0x2672bc){_0x5f0064['push'](_0x5f0064['shift']());}};_0x41a295(++_0x53573a);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2e2992,_0x1f19d8){var _0x2a0a6b=function(_0x2e97d6){while(--_0x2e97d6){_0x2e2992['push'](_0x2e2992['shift']());}};_0x2a0a6b(++_0x1f19d8);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index a668411..d347b59 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 _0x2e4a=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x3a4e51,_0x280273){var _0x5e7e1f=function(_0x2757d3){while(--_0x2757d3){_0x3a4e51['push'](_0x3a4e51['shift']());}};_0x5e7e1f(++_0x280273);}(_0x2e4a,0x12e));var _0xa2e4=function(_0xf9b156,_0x28be72){_0xf9b156=_0xf9b156-0x0;var _0x444e2e=_0x2e4a[_0xf9b156];return _0x444e2e;};'use strict';var EventEmitter=require(_0xa2e4('0x0'));var ChatOfflineMessage=require(_0xa2e4('0x1'))['db'][_0xa2e4('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xa2e4('0x3')](0x0);var events={'afterCreate':_0xa2e4('0x4'),'afterUpdate':_0xa2e4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x47f347){return function(_0x2a0e91,_0x1ad61f,_0x2f61c0){ChatOfflineMessageEvents['emit'](_0x47f347+':'+_0x2a0e91['id'],_0x2a0e91);ChatOfflineMessageEvents[_0xa2e4('0x6')](_0x47f347,_0x2a0e91);_0x2f61c0(null);};}for(var e in events){if(events[_0xa2e4('0x7')](e)){var event=events[e];ChatOfflineMessage[_0xa2e4('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x1d5f=['../../mysqldb','ChatOfflineMessage','save','remove','emit','exports'];(function(_0x4f240d,_0x13a89a){var _0x5b92cc=function(_0x33fb91){while(--_0x33fb91){_0x4f240d['push'](_0x4f240d['shift']());}};_0x5b92cc(++_0x13a89a);}(_0x1d5f,0x8a));var _0xf1d5=function(_0x46e523,_0xe6fccb){_0x46e523=_0x46e523-0x0;var _0x5da0ee=_0x1d5f[_0x46e523];return _0x5da0ee;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xf1d5('0x0'))['db'][_0xf1d5('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf1d5('0x2'),'afterUpdate':'update','afterDestroy':_0xf1d5('0x3')};function emitEvent(_0x2cbfcb){return function(_0x216d93,_0x84e726,_0x270ab9){ChatOfflineMessageEvents[_0xf1d5('0x4')](_0x2cbfcb+':'+_0x216d93['id'],_0x216d93);ChatOfflineMessageEvents[_0xf1d5('0x4')](_0x2cbfcb,_0x216d93);_0x270ab9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xf1d5('0x5')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 8e7b3f2..6b5d80d 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 _0x8b6d=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0x8b6d,0x135));var _0xd8b6=function(_0x1aa5d9,_0x90efec){_0x1aa5d9=_0x1aa5d9-0x0;var _0x207b5e=_0x8b6d[_0x1aa5d9];return _0x207b5e;};'use strict';var attributes=require(_0xd8b6('0x0'));module[_0xd8b6('0x1')]=function(_0x490bc6){return _0x490bc6[_0xd8b6('0x2')](_0xd8b6('0x3'),attributes,{'tableName':_0xd8b6('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd8b6('0x5'),'collate':_0xd8b6('0x6')});};
\ No newline at end of file
+var _0xd0bc=['ChatOfflineMessage','utf8mb4','exports'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xd0bc,0x16a));var _0xcd0b=function(_0x332998,_0x2d99c7){_0x332998=_0x332998-0x0;var _0x460be7=_0xd0bc[_0x332998];return _0x460be7;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xcd0b('0x0')]=function(_0x3a23c7){return _0x3a23c7['define'](_0xcd0b('0x1'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcd0b('0x2'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index a97bcca..fce7711 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 _0x61b8=['catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result'];(function(_0x3708d2,_0x3fe636){var _0x3fb0ee=function(_0x4af20e){while(--_0x4af20e){_0x3708d2['push'](_0x3708d2['shift']());}};_0x3fb0ee(++_0x3fe636);}(_0x61b8,0x169));var _0x861b=function(_0x12e24d,_0x59ce3d){_0x12e24d=_0x12e24d-0x0;var _0xabbeaf=_0x61b8[_0x12e24d];return _0xabbeaf;};'use strict';var _=require(_0x861b('0x0'));var util=require(_0x861b('0x1'));var moment=require(_0x861b('0x2'));var BPromise=require('bluebird');var rs=require(_0x861b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x861b('0x4'));var logger=require(_0x861b('0x5'))(_0x861b('0x6'));var config=require('../../config/environment');var jayson=require(_0x861b('0x7'));var client=jayson[_0x861b('0x8')][_0x861b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x143f58,_0x186952,_0xe2504a){return new BPromise(function(_0x436722,_0x41a4c5){return client[_0x861b('0xa')](_0x143f58,_0xe2504a)[_0x861b('0xb')](function(_0x45c39d){logger['info'](_0x861b('0xc'),_0x186952,_0x861b('0xd'));logger[_0x861b('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x186952,_0x861b('0xd'),JSON['stringify'](_0x45c39d));if(_0x45c39d[_0x861b('0xf')]){if(_0x45c39d[_0x861b('0xf')]['code']===0x1f4){logger[_0x861b('0xf')](_0x861b('0xc'),_0x186952,_0x45c39d[_0x861b('0xf')][_0x861b('0x10')]);return _0x41a4c5(_0x45c39d[_0x861b('0xf')][_0x861b('0x10')]);}logger[_0x861b('0xf')](_0x861b('0xc'),_0x186952,_0x45c39d[_0x861b('0xf')][_0x861b('0x10')]);return _0x436722(_0x45c39d[_0x861b('0xf')][_0x861b('0x10')]);}else{logger[_0x861b('0x11')](_0x861b('0xc'),_0x186952,_0x861b('0xd'));_0x436722(_0x45c39d[_0x861b('0x12')]['message']);}})[_0x861b('0x13')](function(_0x5a4542){logger['error'](_0x861b('0xc'),_0x186952,_0x5a4542);_0x41a4c5(_0x5a4542);});});}
\ No newline at end of file
+var _0xf794=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','request\x20sent','result','moment','bluebird','randomstring','../../mysqldb'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0xf794,0x150));var _0x4f79=function(_0x2b4ea6,_0x3fe9ba){_0x2b4ea6=_0x2b4ea6-0x0;var _0x553783=_0xf794[_0x2b4ea6];return _0x553783;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4f79('0x0'));var BPromise=require(_0x4f79('0x1'));var rs=require(_0x4f79('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f79('0x3'))['db'];var utils=require(_0x4f79('0x4'));var logger=require(_0x4f79('0x5'))(_0x4f79('0x6'));var config=require(_0x4f79('0x7'));var jayson=require(_0x4f79('0x8'));var client=jayson['client'][_0x4f79('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16bb36,_0x49d46e,_0x50a969){return new BPromise(function(_0x5ba9ea,_0x3000be){return client['request'](_0x16bb36,_0x50a969)[_0x4f79('0xa')](function(_0x3c11de){logger[_0x4f79('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x49d46e,'request\x20sent');logger[_0x4f79('0xc')](_0x4f79('0xd'),_0x49d46e,'request\x20sent',JSON[_0x4f79('0xe')](_0x3c11de));if(_0x3c11de['error']){if(_0x3c11de['error']['code']===0x1f4){logger[_0x4f79('0xf')](_0x4f79('0x10'),_0x49d46e,_0x3c11de[_0x4f79('0xf')][_0x4f79('0x11')]);return _0x3000be(_0x3c11de[_0x4f79('0xf')][_0x4f79('0x11')]);}logger[_0x4f79('0xf')](_0x4f79('0x10'),_0x49d46e,_0x3c11de['error'][_0x4f79('0x11')]);return _0x5ba9ea(_0x3c11de[_0x4f79('0xf')][_0x4f79('0x11')]);}else{logger[_0x4f79('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x49d46e,_0x4f79('0x12'));_0x5ba9ea(_0x3c11de[_0x4f79('0x13')]['message']);}})['catch'](function(_0x1d36d1){logger[_0x4f79('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x49d46e,_0x1d36d1);_0x3000be(_0x1d36d1);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index d83515e..e707a6f 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 _0x323d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x47d6b6,_0x3acf52){var _0x26855d=function(_0x3f237c){while(--_0x3f237c){_0x47d6b6['push'](_0x47d6b6['shift']());}};_0x26855d(++_0x3acf52);}(_0x323d,0x1b5));var _0xd323=function(_0x18e5c7,_0x392a80){_0x18e5c7=_0x18e5c7-0x0;var _0x55f2f0=_0x323d[_0x18e5c7];return _0x55f2f0;};'use strict';var multer=require(_0xd323('0x0'));var util=require(_0xd323('0x1'));var path=require(_0xd323('0x2'));var timeout=require(_0xd323('0x3'));var express=require(_0xd323('0x4'));var router=express[_0xd323('0x5')]();var fs_extra=require(_0xd323('0x6'));var auth=require(_0xd323('0x7'));var interaction=require(_0xd323('0x8'));var config=require(_0xd323('0x9'));var controller=require(_0xd323('0xa'));router['get']('/',auth[_0xd323('0xb')](),controller[_0xd323('0xc')]);router[_0xd323('0xd')]('/describe',auth[_0xd323('0xb')](),controller['describe']);router[_0xd323('0xd')](_0xd323('0xe'),auth[_0xd323('0xb')](),controller[_0xd323('0xf')]);router[_0xd323('0x10')]('/',auth['isAuthenticated'](),controller[_0xd323('0x11')]);router['put'](_0xd323('0xe'),auth[_0xd323('0xb')](),controller[_0xd323('0x12')]);router['delete'](_0xd323('0xe'),auth[_0xd323('0xb')](),controller[_0xd323('0x13')]);module[_0xd323('0x14')]=router;
\ No newline at end of file
+var _0x85c6=['destroy','util','path','connect-timeout','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','create','update','delete'];(function(_0xcb2975,_0x22dbee){var _0x2f1afc=function(_0x3710a){while(--_0x3710a){_0xcb2975['push'](_0xcb2975['shift']());}};_0x2f1afc(++_0x22dbee);}(_0x85c6,0x1d2));var _0x685c=function(_0x3555dc,_0x560e24){_0x3555dc=_0x3555dc-0x0;var _0x5a6699=_0x85c6[_0x3555dc];return _0x5a6699;};'use strict';var multer=require('multer');var util=require(_0x685c('0x0'));var path=require(_0x685c('0x1'));var timeout=require(_0x685c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x685c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x685c('0x4'));var controller=require(_0x685c('0x5'));router[_0x685c('0x6')]('/',auth[_0x685c('0x7')](),controller['index']);router[_0x685c('0x6')](_0x685c('0x8'),auth[_0x685c('0x7')](),controller[_0x685c('0x9')]);router['get'](_0x685c('0xa'),auth[_0x685c('0x7')](),controller['show']);router['post']('/',auth[_0x685c('0x7')](),controller[_0x685c('0xb')]);router['put'](_0x685c('0xa'),auth[_0x685c('0x7')](),controller[_0x685c('0xc')]);router[_0x685c('0xd')](_0x685c('0xa'),auth[_0x685c('0x7')](),controller[_0x685c('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index f3820ec..405082d 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 _0x92e8=['ENUM','timeout','mouseOver','INTEGER','STRING'];(function(_0x2c1b71,_0x53f47f){var _0x248df6=function(_0x22e858){while(--_0x22e858){_0x2c1b71['push'](_0x2c1b71['shift']());}};_0x248df6(++_0x53f47f);}(_0x92e8,0x144));var _0x892e=function(_0x55fb83,_0x1d3856){_0x55fb83=_0x55fb83-0x0;var _0x59a87a=_0x92e8[_0x55fb83];return _0x59a87a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x892e('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x892e('0x1')]('mouseOver',_0x892e('0x2')),'defaultValue':_0x892e('0x3')},'selector':{'type':Sequelize[_0x892e('0x0')]},'timeout':{'type':Sequelize[_0x892e('0x4')]}};
\ No newline at end of file
+var _0x79d9=['mouseOver','sequelize','exports','STRING','timeout'];(function(_0x40877f,_0x46b5b8){var _0x30b8bb=function(_0x2d3f9e){while(--_0x2d3f9e){_0x40877f['push'](_0x40877f['shift']());}};_0x30b8bb(++_0x46b5b8);}(_0x79d9,0x146));var _0x979d=function(_0x139e12,_0x59e8ef){_0x139e12=_0x139e12-0x0;var _0xe50df9=_0x79d9[_0x139e12];return _0xe50df9;};'use strict';var Sequelize=require(_0x979d('0x0'));module[_0x979d('0x1')]={'name':{'type':Sequelize[_0x979d('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x979d('0x3')),'defaultValue':_0x979d('0x4')},'selector':{'type':Sequelize['STRING']},'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 188b33b..7f3db7d 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 _0x8c79=['save','update','then','error','stack','name','send','show','params','model','keys','ChatProactiveAction','query','intersection','attributes','fields','options','create','body','find','catch','eml-format','request-promise','bluebird','mustache','path','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','count','offset','set','Content-Range','reject'];(function(_0x3a03be,_0x597b9a){var _0xd572b8=function(_0xdd1ff9){while(--_0xdd1ff9){_0x3a03be['push'](_0x3a03be['shift']());}};_0xd572b8(++_0x597b9a);}(_0x8c79,0xa8));var _0x98c7=function(_0x3dbbb7,_0x9f32b8){_0x3dbbb7=_0x3dbbb7-0x0;var _0x1cf503=_0x8c79[_0x3dbbb7];return _0x1cf503;};'use strict';var emlformat=require(_0x98c7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x98c7('0x1'));var moment=require('moment');var BPromise=require(_0x98c7('0x2'));var Mustache=require(_0x98c7('0x3'));var util=require('util');var path=require(_0x98c7('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x98c7('0x5'));var _=require('lodash');var squel=require(_0x98c7('0x6'));var crypto=require(_0x98c7('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x98c7('0x8'));var Papa=require(_0x98c7('0x9'));var Redis=require(_0x98c7('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x98c7('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98c7('0xc'));var logger=require(_0x98c7('0xd'))(_0x98c7('0xe'));var utils=require(_0x98c7('0xf'));var config=require(_0x98c7('0x10'));var licenseUtil=require(_0x98c7('0x11'));var db=require(_0x98c7('0x12'))['db'];function respondWithStatusCode(_0x414446,_0x300055){_0x300055=_0x300055||0xcc;return function(_0x22d1dd){if(_0x22d1dd){return _0x414446[_0x98c7('0x13')](_0x300055);}return _0x414446[_0x98c7('0x14')](_0x300055)[_0x98c7('0x15')]();};}function respondWithResult(_0x442fc3,_0x386fd3){_0x386fd3=_0x386fd3||0xc8;return function(_0x238e98){if(_0x238e98){return _0x442fc3['status'](_0x386fd3)['json'](_0x238e98);}};}function respondWithFilteredResult(_0x3b9ced,_0x2eef73){return function(_0xb4696a){if(_0xb4696a){var _0x23d344=typeof _0x2eef73['offset']==='undefined'&&typeof _0x2eef73[_0x98c7('0x16')]==='undefined';var _0x37543f=_0xb4696a[_0x98c7('0x17')];var _0x22b669=_0x23d344?0x0:_0x2eef73[_0x98c7('0x18')];var _0x5df15b=_0x23d344?_0xb4696a[_0x98c7('0x17')]:_0x2eef73[_0x98c7('0x18')]+_0x2eef73[_0x98c7('0x16')];var _0x2207ae;if(_0x5df15b>=_0x37543f){_0x5df15b=_0x37543f;_0x2207ae=0xc8;}else{_0x2207ae=0xce;}_0x3b9ced[_0x98c7('0x14')](_0x2207ae);return _0x3b9ced[_0x98c7('0x19')](_0x98c7('0x1a'),_0x22b669+'-'+_0x5df15b+'/'+_0x37543f)['json'](_0xb4696a);}return null;};}function patchUpdates(_0x3d2a3d){return function(_0xec028){try{jsonpatch['apply'](_0xec028,_0x3d2a3d,!![]);}catch(_0x28ea17){return BPromise[_0x98c7('0x1b')](_0x28ea17);}return _0xec028[_0x98c7('0x1c')]();};}function saveUpdates(_0x41de48,_0x206000){return function(_0x260660){if(_0x260660){return _0x260660[_0x98c7('0x1d')](_0x41de48)[_0x98c7('0x1e')](function(_0x20bd1b){return _0x20bd1b;});}return null;};}function removeEntity(_0x2f0f6e,_0x9ade8f){return function(_0x807ecd){if(_0x807ecd){return _0x807ecd['destroy']()[_0x98c7('0x1e')](function(){_0x2f0f6e[_0x98c7('0x14')](0xcc)[_0x98c7('0x15')]();});}};}function handleEntityNotFound(_0x9ee36e,_0x3a9110){return function(_0x232aa9){if(!_0x232aa9){_0x9ee36e['sendStatus'](0x194);}return _0x232aa9;};}function handleError(_0x25b033,_0x12c6ba){_0x12c6ba=_0x12c6ba||0x1f4;return function(_0x96f94a){logger[_0x98c7('0x1f')](_0x96f94a[_0x98c7('0x20')]);if(_0x96f94a[_0x98c7('0x21')]){delete _0x96f94a[_0x98c7('0x21')];}_0x25b033[_0x98c7('0x14')](_0x12c6ba)[_0x98c7('0x22')](_0x96f94a);};}exports[_0x98c7('0x23')]=function(_0x16952b,_0x39a298){var _0x1ebab4={'raw':!![],'where':{'id':_0x16952b[_0x98c7('0x24')]['id']}},_0x44ff50={};_0x44ff50[_0x98c7('0x25')]=_[_0x98c7('0x26')](db[_0x98c7('0x27')]['rawAttributes']);_0x44ff50[_0x98c7('0x28')]=_[_0x98c7('0x26')](_0x16952b[_0x98c7('0x28')]);_0x44ff50['filters']=_[_0x98c7('0x29')](_0x44ff50[_0x98c7('0x25')],_0x44ff50['query']);_0x1ebab4[_0x98c7('0x2a')]=_[_0x98c7('0x29')](_0x44ff50['model'],qs[_0x98c7('0x2b')](_0x16952b[_0x98c7('0x28')][_0x98c7('0x2b')]));_0x1ebab4[_0x98c7('0x2a')]=_0x1ebab4['attributes']['length']?_0x1ebab4[_0x98c7('0x2a')]:_0x44ff50[_0x98c7('0x25')];if(_0x16952b[_0x98c7('0x28')]['includeAll']){_0x1ebab4['include']=[{'all':!![]}];}_0x1ebab4=_['merge']({},_0x1ebab4,_0x16952b[_0x98c7('0x2c')]);return db['ChatProactiveAction']['find'](_0x1ebab4)[_0x98c7('0x1e')](handleEntityNotFound(_0x39a298,null))['then'](respondWithResult(_0x39a298,null))['catch'](handleError(_0x39a298,null));};exports[_0x98c7('0x2d')]=function(_0x5128b6,_0x570fc2){return db['ChatProactiveAction'][_0x98c7('0x2d')](_0x5128b6[_0x98c7('0x2e')],{})[_0x98c7('0x1e')](respondWithResult(_0x570fc2,0xc9))['catch'](handleError(_0x570fc2,null));};exports['update']=function(_0x2df4f9,_0x48e0f3){if(_0x2df4f9['body']['id']){delete _0x2df4f9[_0x98c7('0x2e')]['id'];}return db['ChatProactiveAction'][_0x98c7('0x2f')]({'where':{'id':_0x2df4f9[_0x98c7('0x24')]['id']}})['then'](handleEntityNotFound(_0x48e0f3,null))[_0x98c7('0x1e')](saveUpdates(_0x2df4f9[_0x98c7('0x2e')],null))['then'](respondWithResult(_0x48e0f3,null))[_0x98c7('0x30')](handleError(_0x48e0f3,null));};exports['destroy']=function(_0x532cea,_0x4ed71e){return db['ChatProactiveAction']['find']({'where':{'id':_0x532cea[_0x98c7('0x24')]['id']}})[_0x98c7('0x1e')](handleEntityNotFound(_0x4ed71e,null))[_0x98c7('0x1e')](removeEntity(_0x4ed71e,null))[_0x98c7('0x30')](handleError(_0x4ed71e,null));};
\ No newline at end of file
+var _0x1e19=['status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x108831,_0x5e4f70){var _0x4da77a=function(_0x139446){while(--_0x139446){_0x108831['push'](_0x108831['shift']());}};_0x4da77a(++_0x5e4f70);}(_0x1e19,0x1c9));var _0x91e1=function(_0x5ce14b,_0x204cab){_0x5ce14b=_0x5ce14b-0x0;var _0x29c5fc=_0x1e19[_0x5ce14b];return _0x29c5fc;};'use strict';var emlformat=require(_0x91e1('0x0'));var rimraf=require(_0x91e1('0x1'));var zipdir=require(_0x91e1('0x2'));var jsonpatch=require(_0x91e1('0x3'));var rp=require(_0x91e1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x91e1('0x5'));var sox=require(_0x91e1('0x6'));var csv=require(_0x91e1('0x7'));var ejs=require(_0x91e1('0x8'));var fs=require('fs');var fs_extra=require(_0x91e1('0x9'));var _=require('lodash');var squel=require(_0x91e1('0xa'));var crypto=require('crypto');var jsforce=require(_0x91e1('0xb'));var deskjs=require(_0x91e1('0xc'));var toCsv=require(_0x91e1('0x7'));var querystring=require(_0x91e1('0xd'));var Papa=require(_0x91e1('0xe'));var Redis=require('ioredis');var authService=require(_0x91e1('0xf'));var qs=require(_0x91e1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91e1('0x11'));var logger=require(_0x91e1('0x12'))(_0x91e1('0x13'));var utils=require(_0x91e1('0x14'));var config=require(_0x91e1('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40b3f6,_0x463abd){_0x463abd=_0x463abd||0xcc;return function(_0x36660b){if(_0x36660b){return _0x40b3f6[_0x91e1('0x16')](_0x463abd);}return _0x40b3f6[_0x91e1('0x17')](_0x463abd)[_0x91e1('0x18')]();};}function respondWithResult(_0x23da39,_0x3fb2e4){_0x3fb2e4=_0x3fb2e4||0xc8;return function(_0x511333){if(_0x511333){return _0x23da39[_0x91e1('0x17')](_0x3fb2e4)[_0x91e1('0x19')](_0x511333);}};}function respondWithFilteredResult(_0x278473,_0x1d0bca){return function(_0x3ed9e4){if(_0x3ed9e4){var _0x5bcf29=typeof _0x1d0bca['offset']===_0x91e1('0x1a')&&typeof _0x1d0bca['limit']===_0x91e1('0x1a');var _0x20fbde=_0x3ed9e4['count'];var _0x3b2b17=_0x5bcf29?0x0:_0x1d0bca[_0x91e1('0x1b')];var _0xdb98e5=_0x5bcf29?_0x3ed9e4['count']:_0x1d0bca['offset']+_0x1d0bca[_0x91e1('0x1c')];var _0x582ccf;if(_0xdb98e5>=_0x20fbde){_0xdb98e5=_0x20fbde;_0x582ccf=0xc8;}else{_0x582ccf=0xce;}_0x278473[_0x91e1('0x17')](_0x582ccf);return _0x278473[_0x91e1('0x1d')](_0x91e1('0x1e'),_0x3b2b17+'-'+_0xdb98e5+'/'+_0x20fbde)[_0x91e1('0x19')](_0x3ed9e4);}return null;};}function patchUpdates(_0xd2249f){return function(_0x1ee135){try{jsonpatch[_0x91e1('0x1f')](_0x1ee135,_0xd2249f,!![]);}catch(_0x1fc05e){return BPromise[_0x91e1('0x20')](_0x1fc05e);}return _0x1ee135[_0x91e1('0x21')]();};}function saveUpdates(_0x647dae,_0x4c80e6){return function(_0x218a5a){if(_0x218a5a){return _0x218a5a[_0x91e1('0x22')](_0x647dae)[_0x91e1('0x23')](function(_0x549b53){return _0x549b53;});}return null;};}function removeEntity(_0x477d6c,_0xccc5ad){return function(_0x3c7631){if(_0x3c7631){return _0x3c7631[_0x91e1('0x24')]()[_0x91e1('0x23')](function(){_0x477d6c[_0x91e1('0x17')](0xcc)[_0x91e1('0x18')]();});}};}function handleEntityNotFound(_0xe97618,_0xca52f1){return function(_0x1b5f7e){if(!_0x1b5f7e){_0xe97618[_0x91e1('0x16')](0x194);}return _0x1b5f7e;};}function handleError(_0xaacfcd,_0x3dbb13){_0x3dbb13=_0x3dbb13||0x1f4;return function(_0xf3bbb8){logger[_0x91e1('0x25')](_0xf3bbb8[_0x91e1('0x26')]);if(_0xf3bbb8[_0x91e1('0x27')]){delete _0xf3bbb8[_0x91e1('0x27')];}_0xaacfcd[_0x91e1('0x17')](_0x3dbb13)[_0x91e1('0x28')](_0xf3bbb8);};}exports['show']=function(_0x19f84d,_0xec7e07){var _0x5bae2b={'raw':!![],'where':{'id':_0x19f84d['params']['id']}},_0x3fab17={};_0x3fab17['model']=_[_0x91e1('0x29')](db[_0x91e1('0x2a')][_0x91e1('0x2b')]);_0x3fab17['query']=_[_0x91e1('0x29')](_0x19f84d[_0x91e1('0x2c')]);_0x3fab17[_0x91e1('0x2d')]=_[_0x91e1('0x2e')](_0x3fab17[_0x91e1('0x2f')],_0x3fab17[_0x91e1('0x2c')]);_0x5bae2b['attributes']=_['intersection'](_0x3fab17[_0x91e1('0x2f')],qs[_0x91e1('0x30')](_0x19f84d[_0x91e1('0x2c')][_0x91e1('0x30')]));_0x5bae2b[_0x91e1('0x31')]=_0x5bae2b['attributes'][_0x91e1('0x32')]?_0x5bae2b[_0x91e1('0x31')]:_0x3fab17[_0x91e1('0x2f')];if(_0x19f84d[_0x91e1('0x2c')][_0x91e1('0x33')]){_0x5bae2b[_0x91e1('0x34')]=[{'all':!![]}];}_0x5bae2b=_[_0x91e1('0x35')]({},_0x5bae2b,_0x19f84d[_0x91e1('0x36')]);return db[_0x91e1('0x2a')][_0x91e1('0x37')](_0x5bae2b)[_0x91e1('0x23')](handleEntityNotFound(_0xec7e07,null))['then'](respondWithResult(_0xec7e07,null))[_0x91e1('0x38')](handleError(_0xec7e07,null));};exports[_0x91e1('0x39')]=function(_0x38d556,_0x35fdcd){return db[_0x91e1('0x2a')]['create'](_0x38d556['body'],{})['then'](respondWithResult(_0x35fdcd,0xc9))[_0x91e1('0x38')](handleError(_0x35fdcd,null));};exports[_0x91e1('0x22')]=function(_0x605a81,_0x4eaa5c){if(_0x605a81['body']['id']){delete _0x605a81[_0x91e1('0x3a')]['id'];}return db[_0x91e1('0x2a')][_0x91e1('0x37')]({'where':{'id':_0x605a81[_0x91e1('0x3b')]['id']}})[_0x91e1('0x23')](handleEntityNotFound(_0x4eaa5c,null))[_0x91e1('0x23')](saveUpdates(_0x605a81[_0x91e1('0x3a')],null))[_0x91e1('0x23')](respondWithResult(_0x4eaa5c,null))[_0x91e1('0x38')](handleError(_0x4eaa5c,null));};exports['destroy']=function(_0x88bb37,_0x53adb9){return db[_0x91e1('0x2a')][_0x91e1('0x37')]({'where':{'id':_0x88bb37['params']['id']}})[_0x91e1('0x23')](handleEntityNotFound(_0x53adb9,null))[_0x91e1('0x23')](removeEntity(_0x53adb9,null))[_0x91e1('0x38')](handleError(_0x53adb9,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index b21b2d3..36532fd 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 _0x8cab=['api','moment','bluebird','request-promise','path','rimraf','exports','ChatProactiveAction','lodash','util','../../config/logger'];(function(_0x1c6476,_0x438e0e){var _0x9b7648=function(_0x2814a2){while(--_0x2814a2){_0x1c6476['push'](_0x1c6476['shift']());}};_0x9b7648(++_0x438e0e);}(_0x8cab,0x97));var _0xb8ca=function(_0x2360fd,_0x3b86e7){_0x2360fd=_0x2360fd-0x0;var _0x14858d=_0x8cab[_0x2360fd];return _0x14858d;};'use strict';var _=require(_0xb8ca('0x0'));var util=require(_0xb8ca('0x1'));var logger=require(_0xb8ca('0x2'))(_0xb8ca('0x3'));var moment=require(_0xb8ca('0x4'));var BPromise=require(_0xb8ca('0x5'));var rp=require(_0xb8ca('0x6'));var fs=require('fs');var path=require(_0xb8ca('0x7'));var rimraf=require(_0xb8ca('0x8'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0xb8ca('0x9')]=function(_0x35d7e5,_0x1855e8){return _0x35d7e5['define'](_0xb8ca('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb0a6=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','chat_proactive_actions'];(function(_0x84846d,_0x5112dd){var _0x5f5c49=function(_0x25990b){while(--_0x25990b){_0x84846d['push'](_0x84846d['shift']());}};_0x5f5c49(++_0x5112dd);}(_0xb0a6,0x14a));var _0x6b0a=function(_0x480575,_0x4247e1){_0x480575=_0x480575-0x0;var _0x3a4491=_0xb0a6[_0x480575];return _0x3a4491;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6b0a('0x0'))(_0x6b0a('0x1'));var moment=require(_0x6b0a('0x2'));var BPromise=require('bluebird');var rp=require(_0x6b0a('0x3'));var fs=require('fs');var path=require(_0x6b0a('0x4'));var rimraf=require(_0x6b0a('0x5'));var config=require(_0x6b0a('0x6'));var attributes=require(_0x6b0a('0x7'));module[_0x6b0a('0x8')]=function(_0x3c13e3,_0x316003){return _0x3c13e3['define']('ChatProactiveAction',attributes,{'tableName':_0x6b0a('0x9'),'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 0a9d0da..3a31288 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 _0xa8f7=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','ChatProactiveAction,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x55cdc5,_0x2b2297){var _0x29acd5=function(_0x405234){while(--_0x405234){_0x55cdc5['push'](_0x55cdc5['shift']());}};_0x29acd5(++_0x2b2297);}(_0xa8f7,0x74));var _0x7a8f=function(_0x1d56ca,_0x326427){_0x1d56ca=_0x1d56ca-0x0;var _0x41025d=_0xa8f7[_0x1d56ca];return _0x41025d;};'use strict';var _=require(_0x7a8f('0x0'));var util=require('util');var moment=require(_0x7a8f('0x1'));var BPromise=require(_0x7a8f('0x2'));var rs=require(_0x7a8f('0x3'));var fs=require('fs');var Redis=require(_0x7a8f('0x4'));var db=require(_0x7a8f('0x5'))['db'];var utils=require(_0x7a8f('0x6'));var logger=require(_0x7a8f('0x7'))('rpc');var config=require(_0x7a8f('0x8'));var jayson=require(_0x7a8f('0x9'));var client=jayson[_0x7a8f('0xa')][_0x7a8f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f4c33,_0x58a32e,_0x752bad){return new BPromise(function(_0x4adace,_0x26a8fb){return client[_0x7a8f('0xc')](_0x3f4c33,_0x752bad)[_0x7a8f('0xd')](function(_0x14d140){logger[_0x7a8f('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x58a32e,_0x7a8f('0xf'));logger['debug'](_0x7a8f('0x10'),_0x58a32e,'request\x20sent',JSON['stringify'](_0x14d140));if(_0x14d140[_0x7a8f('0x11')]){if(_0x14d140[_0x7a8f('0x11')][_0x7a8f('0x12')]===0x1f4){logger[_0x7a8f('0x11')](_0x7a8f('0x13'),_0x58a32e,_0x14d140[_0x7a8f('0x11')]['message']);return _0x26a8fb(_0x14d140[_0x7a8f('0x11')][_0x7a8f('0x14')]);}logger[_0x7a8f('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x58a32e,_0x14d140[_0x7a8f('0x11')][_0x7a8f('0x14')]);return _0x4adace(_0x14d140[_0x7a8f('0x11')][_0x7a8f('0x14')]);}else{logger[_0x7a8f('0xe')](_0x7a8f('0x13'),_0x58a32e,_0x7a8f('0xf'));_0x4adace(_0x14d140['result'][_0x7a8f('0x14')]);}})[_0x7a8f('0x15')](function(_0x234638){logger[_0x7a8f('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x58a32e,_0x234638);_0x26a8fb(_0x234638);});});}
\ No newline at end of file
+var _0x2285=['../../config/environment','jayson/promise','client','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x14d410,_0x558808){var _0x684d10=function(_0x5f06a6){while(--_0x5f06a6){_0x14d410['push'](_0x14d410['shift']());}};_0x684d10(++_0x558808);}(_0x2285,0x8d));var _0x5228=function(_0x4b4c3b,_0x5b6710){_0x4b4c3b=_0x4b4c3b-0x0;var _0x59ca3e=_0x2285[_0x4b4c3b];return _0x59ca3e;};'use strict';var _=require(_0x5228('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5228('0x1'));var rs=require(_0x5228('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5228('0x3'));var logger=require(_0x5228('0x4'))(_0x5228('0x5'));var config=require(_0x5228('0x6'));var jayson=require(_0x5228('0x7'));var client=jayson[_0x5228('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1eadc2,_0x5ad264,_0x2a0232){return new BPromise(function(_0xc039a,_0x360c31){return client[_0x5228('0x9')](_0x1eadc2,_0x2a0232)[_0x5228('0xa')](function(_0x185fbe){logger['info'](_0x5228('0xb'),_0x5ad264,_0x5228('0xc'));logger[_0x5228('0xd')](_0x5228('0xe'),_0x5ad264,_0x5228('0xc'),JSON['stringify'](_0x185fbe));if(_0x185fbe[_0x5228('0xf')]){if(_0x185fbe[_0x5228('0xf')][_0x5228('0x10')]===0x1f4){logger['error'](_0x5228('0xb'),_0x5ad264,_0x185fbe[_0x5228('0xf')][_0x5228('0x11')]);return _0x360c31(_0x185fbe[_0x5228('0xf')][_0x5228('0x11')]);}logger[_0x5228('0xf')](_0x5228('0xb'),_0x5ad264,_0x185fbe[_0x5228('0xf')]['message']);return _0xc039a(_0x185fbe[_0x5228('0xf')][_0x5228('0x11')]);}else{logger[_0x5228('0x12')](_0x5228('0xb'),_0x5ad264,_0x5228('0xc'));_0xc039a(_0x185fbe[_0x5228('0x13')][_0x5228('0x11')]);}})[_0x5228('0x14')](function(_0x4031d6){logger[_0x5228('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x5ad264,_0x4031d6);_0x360c31(_0x4031d6);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 8180045..743f030 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8958=['show','post','put','update','delete','destroy','exports','util','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated'];(function(_0x24e999,_0x1878c0){var _0x3e3b76=function(_0x101931){while(--_0x101931){_0x24e999['push'](_0x24e999['shift']());}};_0x3e3b76(++_0x1878c0);}(_0x8958,0x93));var _0x8895=function(_0x1b0bcc,_0x4af3f1){_0x1b0bcc=_0x1b0bcc-0x0;var _0x497cf9=_0x8958[_0x1b0bcc];return _0x497cf9;};'use strict';var multer=require('multer');var util=require(_0x8895('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8895('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var controller=require(_0x8895('0x4'));router['get'](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0x7')]);router[_0x8895('0x8')]('/',auth[_0x8895('0x6')](),controller['create']);router[_0x8895('0x9')](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0xa')]);router[_0x8895('0xb')](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0xc')]);module[_0x8895('0xd')]=router;
\ No newline at end of file
+var _0x038b=['isAuthenticated','/:id','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','show','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x038b,0x114));var _0xb038=function(_0x20d00b,_0x53be54){_0x20d00b=_0x20d00b-0x0;var _0x1ce187=_0x038b[_0x20d00b];return _0x1ce187;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb038('0x4'));var interaction=require(_0xb038('0x5'));var config=require('../../config/environment');var controller=require(_0xb038('0x6'));router[_0xb038('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xb038('0x8')]);router[_0xb038('0x9')]('/',auth[_0xb038('0xa')](),controller['create']);router['put'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['update']);router['delete'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['destroy']);module[_0xb038('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 7527eca..3aebeb0 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 _0xb4f5=['exports','STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x1a2ea4,_0x380f20){var _0x2b32fa=function(_0x1b5fd9){while(--_0x1b5fd9){_0x1a2ea4['push'](_0x1a2ea4['shift']());}};_0x2b32fa(++_0x380f20);}(_0xb4f5,0x12d));var _0x5b4f=function(_0x43709e,_0x2c3b45){_0x43709e=_0x43709e-0x0;var _0x452820=_0xb4f5[_0x43709e];return _0x452820;};'use strict';var Sequelize=require('sequelize');module[_0x5b4f('0x0')]={'name':{'type':Sequelize[_0x5b4f('0x1')],'unique':_0x5b4f('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5b4f('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5b4f('0x3')](_0x5b4f('0x4'),_0x5b4f('0x5'),_0x5b4f('0x6'))}};
\ No newline at end of file
+var _0x1914=['roundrobin','exports','STRING','name','ENUM','beepall'];(function(_0x366e3f,_0x33ecdf){var _0x1ab9c9=function(_0x2703a3){while(--_0x2703a3){_0x366e3f['push'](_0x366e3f['shift']());}};_0x1ab9c9(++_0x33ecdf);}(_0x1914,0x7f));var _0x4191=function(_0x2a8091,_0x48ed1a){_0x2a8091=_0x2a8091-0x0;var _0x2a59b6=_0x1914[_0x2a8091];return _0x2a59b6;};'use strict';var Sequelize=require('sequelize');module[_0x4191('0x0')]={'name':{'type':Sequelize[_0x4191('0x1')],'unique':_0x4191('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4191('0x3')]('rrmemory',_0x4191('0x4'),_0x4191('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 351e907..635097f 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 _0x0276=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','pick','ChatQueueId','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','User','Agents','online','interface','transaction','each','findOrCreate','forEach','emit','removeTeams','select','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','SELECT','every','includes','all','union','compact','value','ids','isEmpty','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','end','status','limit','undefined','count','offset','set','Content-Range','save','update','get','ChatQueues','UserProfileResource','sendStatus','stack','name','index','map','ChatQueue','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','user'];(function(_0x27ea47,_0x10ffbf){var _0x5a5499=function(_0x846889){while(--_0x846889){_0x27ea47['push'](_0x27ea47['shift']());}};_0x5a5499(++_0x10ffbf);}(_0x0276,0x15c));var _0x6027=function(_0x5e9e5f,_0x19aeeb){_0x5e9e5f=_0x5e9e5f-0x0;var _0x4944f5=_0x0276[_0x5e9e5f];return _0x4944f5;};'use strict';var emlformat=require(_0x6027('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6027('0x1'));var jsonpatch=require(_0x6027('0x2'));var rp=require(_0x6027('0x3'));var moment=require(_0x6027('0x4'));var BPromise=require(_0x6027('0x5'));var Mustache=require(_0x6027('0x6'));var util=require(_0x6027('0x7'));var path=require(_0x6027('0x8'));var sox=require('sox');var csv=require(_0x6027('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6027('0xa'));var _=require(_0x6027('0xb'));var squel=require(_0x6027('0xc'));var crypto=require(_0x6027('0xd'));var jsforce=require(_0x6027('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6027('0x9'));var querystring=require('querystring');var Papa=require(_0x6027('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6027('0x10'));var as=require(_0x6027('0x11'));var hardwareService=require(_0x6027('0x12'));var logger=require(_0x6027('0x13'))(_0x6027('0x14'));var utils=require('../../config/utils');var config=require(_0x6027('0x15'));var licenseUtil=require(_0x6027('0x16'));var db=require(_0x6027('0x17'))['db'];config[_0x6027('0x18')]=_[_0x6027('0x19')](config[_0x6027('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6027('0x1a'))(new Redis(config[_0x6027('0x18')]));require(_0x6027('0x1b'))[_0x6027('0x1c')](socket);var jayson=require(_0x6027('0x1d'));var client=jayson[_0x6027('0x1e')][_0x6027('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x195aae,_0xd819d1,_0x3615dd,_0x57d616){return new BPromise(function(_0x109efb,_0x153e1e){var _0xb1fb54=_0x57d616||client;return _0xb1fb54[_0x6027('0x20')](_0x195aae,_0x3615dd)[_0x6027('0x21')](function(_0x3768ca){logger['info'](_0x6027('0x22'),_0xd819d1,_0x6027('0x23'));logger[_0x6027('0x24')](_0x6027('0x25'),_0xd819d1,'request\x20sent',JSON['stringify'](_0x3768ca));if(_0x3768ca[_0x6027('0x26')]){if(_0x3768ca[_0x6027('0x26')][_0x6027('0x27')]===0x1f4){logger['error'](_0x6027('0x22'),_0xd819d1,_0x3768ca[_0x6027('0x26')][_0x6027('0x28')]);return _0x153e1e(_0x3768ca['error']['message']);}logger[_0x6027('0x26')](_0x6027('0x22'),_0xd819d1,_0x3768ca[_0x6027('0x26')][_0x6027('0x28')]);return _0x109efb(_0x3768ca[_0x6027('0x26')][_0x6027('0x28')]);}else{logger[_0x6027('0x29')]('ChatQueue,\x20%s,\x20%s',_0xd819d1,_0x6027('0x23'));_0x109efb(_0x3768ca['result'][_0x6027('0x28')]);}})[_0x6027('0x2a')](function(_0x3c6361){logger[_0x6027('0x26')](_0x6027('0x22'),_0xd819d1,_0x3c6361);_0x153e1e(_0x3c6361);});});}function respondWithStatusCode(_0x19c276,_0x507787){_0x507787=_0x507787||0xcc;return function(_0x4ea290){if(_0x4ea290){return _0x19c276['sendStatus'](_0x507787);}return _0x19c276['status'](_0x507787)[_0x6027('0x2b')]();};}function respondWithResult(_0x3e9365,_0x572860){_0x572860=_0x572860||0xc8;return function(_0x568f16){if(_0x568f16){return _0x3e9365[_0x6027('0x2c')](_0x572860)['json'](_0x568f16);}};}function respondWithFilteredResult(_0x308981,_0xae2e72){return function(_0x1c2600){if(_0x1c2600){var _0x180358=typeof _0xae2e72['offset']==='undefined'&&typeof _0xae2e72[_0x6027('0x2d')]===_0x6027('0x2e');var _0x504b9c=_0x1c2600[_0x6027('0x2f')];var _0x3a1a9e=_0x180358?0x0:_0xae2e72['offset'];var _0x4ed535=_0x180358?_0x1c2600[_0x6027('0x2f')]:_0xae2e72[_0x6027('0x30')]+_0xae2e72[_0x6027('0x2d')];var _0x19cf8c;if(_0x4ed535>=_0x504b9c){_0x4ed535=_0x504b9c;_0x19cf8c=0xc8;}else{_0x19cf8c=0xce;}_0x308981[_0x6027('0x2c')](_0x19cf8c);return _0x308981[_0x6027('0x31')](_0x6027('0x32'),_0x3a1a9e+'-'+_0x4ed535+'/'+_0x504b9c)['json'](_0x1c2600);}return null;};}function patchUpdates(_0x2545e3){return function(_0x11799e){try{jsonpatch['apply'](_0x11799e,_0x2545e3,!![]);}catch(_0x2d18c1){return BPromise['reject'](_0x2d18c1);}return _0x11799e[_0x6027('0x33')]();};}function saveUpdates(_0x380c46,_0x3a6ab0){return function(_0x7e82ce){if(_0x7e82ce){return _0x7e82ce[_0x6027('0x34')](_0x380c46)[_0x6027('0x21')](function(_0x37d415){return _0x37d415;});}return null;};}function removeEntity(_0x55c3ba,_0x489e69){return function(_0x1f201e){if(_0x1f201e){return _0x1f201e['destroy']()[_0x6027('0x21')](function(){var _0x1cc1d1=_0x1f201e[_0x6027('0x35')]({'plain':!![]});var _0x64faec=_0x6027('0x36');return db[_0x6027('0x37')]['destroy']({'where':{'type':_0x64faec,'resourceId':_0x1cc1d1['id']}})[_0x6027('0x21')](function(){return _0x1f201e;});})[_0x6027('0x21')](function(){_0x55c3ba[_0x6027('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x273d73,_0xafbcb0){return function(_0x262a40){if(!_0x262a40){_0x273d73[_0x6027('0x38')](0x194);}return _0x262a40;};}function handleError(_0x3a2a95,_0x285644){_0x285644=_0x285644||0x1f4;return function(_0x1c6136){logger[_0x6027('0x26')](_0x1c6136[_0x6027('0x39')]);if(_0x1c6136[_0x6027('0x3a')]){delete _0x1c6136['name'];}_0x3a2a95['status'](_0x285644)['send'](_0x1c6136);};}exports[_0x6027('0x3b')]=function(_0x417962,_0x25f1cd){var _0x36dd94={},_0x49d3f0={},_0x3eed43={'count':0x0,'rows':[]};var _0x7f249e=_[_0x6027('0x3c')](db[_0x6027('0x3d')]['rawAttributes'],function(_0x5b1c92){return{'name':_0x5b1c92[_0x6027('0x3e')],'type':_0x5b1c92[_0x6027('0x3f')]['key']};});_0x49d3f0[_0x6027('0x40')]=_[_0x6027('0x3c')](_0x7f249e,'name');_0x49d3f0['query']=_[_0x6027('0x41')](_0x417962[_0x6027('0x42')]);_0x49d3f0['filters']=_[_0x6027('0x43')](_0x49d3f0[_0x6027('0x40')],_0x49d3f0[_0x6027('0x42')]);_0x36dd94[_0x6027('0x44')]=_[_0x6027('0x43')](_0x49d3f0[_0x6027('0x40')],qs['fields'](_0x417962[_0x6027('0x42')][_0x6027('0x45')]));_0x36dd94[_0x6027('0x44')]=_0x36dd94[_0x6027('0x44')][_0x6027('0x46')]?_0x36dd94['attributes']:_0x49d3f0['model'];if(!_0x417962[_0x6027('0x42')][_0x6027('0x47')](_0x6027('0x48'))){_0x36dd94[_0x6027('0x2d')]=qs[_0x6027('0x2d')](_0x417962[_0x6027('0x42')][_0x6027('0x2d')]);_0x36dd94[_0x6027('0x30')]=qs['offset'](_0x417962['query'][_0x6027('0x30')]);}_0x36dd94['order']=qs[_0x6027('0x49')](_0x417962[_0x6027('0x42')][_0x6027('0x49')]);_0x36dd94[_0x6027('0x4a')]=qs[_0x6027('0x4b')](_['pick'](_0x417962[_0x6027('0x42')],_0x49d3f0[_0x6027('0x4b')]),_0x7f249e);if(_0x417962[_0x6027('0x42')][_0x6027('0x4c')]){_0x36dd94[_0x6027('0x4a')]=_[_0x6027('0x4d')](_0x36dd94[_0x6027('0x4a')],{'$or':_[_0x6027('0x3c')](_0x7f249e,function(_0xce233f){if(_0xce233f[_0x6027('0x3f')]!=='VIRTUAL'){var _0x253a3e={};_0x253a3e[_0xce233f['name']]={'$like':'%'+_0x417962[_0x6027('0x42')]['filter']+'%'};return _0x253a3e;}})});}_0x36dd94=_['merge']({},_0x36dd94,_0x417962[_0x6027('0x4e')]);var _0x371532={'where':_0x36dd94['where']};return db[_0x6027('0x3d')]['count'](_0x371532)[_0x6027('0x21')](function(_0x1d650c){_0x3eed43[_0x6027('0x2f')]=_0x1d650c;if(_0x417962[_0x6027('0x42')][_0x6027('0x4f')]){_0x36dd94[_0x6027('0x50')]=[{'all':!![]}];}return db[_0x6027('0x3d')][_0x6027('0x51')](_0x36dd94);})[_0x6027('0x21')](function(_0xdd9c5a){_0x3eed43[_0x6027('0x52')]=_0xdd9c5a;return _0x3eed43;})[_0x6027('0x21')](respondWithFilteredResult(_0x25f1cd,_0x36dd94))[_0x6027('0x2a')](handleError(_0x25f1cd,null));};exports[_0x6027('0x53')]=function(_0x20f6b9,_0x34f7db){var _0x271f1d={'raw':!![],'where':{'id':_0x20f6b9[_0x6027('0x54')]['id']}},_0x3c9566={};_0x3c9566[_0x6027('0x40')]=_[_0x6027('0x41')](db[_0x6027('0x3d')][_0x6027('0x55')]);_0x3c9566[_0x6027('0x42')]=_[_0x6027('0x41')](_0x20f6b9[_0x6027('0x42')]);_0x3c9566[_0x6027('0x4b')]=_[_0x6027('0x43')](_0x3c9566['model'],_0x3c9566['query']);_0x271f1d[_0x6027('0x44')]=_[_0x6027('0x43')](_0x3c9566[_0x6027('0x40')],qs[_0x6027('0x45')](_0x20f6b9[_0x6027('0x42')][_0x6027('0x45')]));_0x271f1d[_0x6027('0x44')]=_0x271f1d['attributes'][_0x6027('0x46')]?_0x271f1d[_0x6027('0x44')]:_0x3c9566['model'];if(_0x20f6b9[_0x6027('0x42')]['includeAll']){_0x271f1d[_0x6027('0x50')]=[{'all':!![]}];}_0x271f1d=_[_0x6027('0x4d')]({},_0x271f1d,_0x20f6b9[_0x6027('0x4e')]);return db[_0x6027('0x3d')][_0x6027('0x56')](_0x271f1d)[_0x6027('0x21')](handleEntityNotFound(_0x34f7db,null))['then'](respondWithResult(_0x34f7db,null))[_0x6027('0x2a')](handleError(_0x34f7db,null));};exports[_0x6027('0x57')]=function(_0x208c15,_0x470d4c){return db[_0x6027('0x3d')][_0x6027('0x57')](_0x208c15[_0x6027('0x58')],{})[_0x6027('0x21')](function(_0x29ff85){var _0x322902=_0x208c15[_0x6027('0x59')]['get']({'plain':!![]});if(!_0x322902)throw new Error(_0x6027('0x5a'));if(_0x322902['role']===_0x6027('0x59')){var _0xbbd22f=_0x29ff85[_0x6027('0x35')]({'plain':!![]});var _0x3a7f48=_0x6027('0x36');return db[_0x6027('0x5b')][_0x6027('0x56')]({'where':{'name':_0x3a7f48,'userProfileId':_0x322902['userProfileId']},'raw':!![]})[_0x6027('0x21')](function(_0x4e2748){if(_0x4e2748&&_0x4e2748[_0x6027('0x5c')]===0x0){return db[_0x6027('0x37')][_0x6027('0x57')]({'name':_0xbbd22f['name'],'resourceId':_0xbbd22f['id'],'type':_0x4e2748[_0x6027('0x3a')],'sectionId':_0x4e2748['id']},{})[_0x6027('0x21')](function(){return _0x29ff85;});}else{return _0x29ff85;}})[_0x6027('0x2a')](function(_0x465284){logger[_0x6027('0x26')](_0x6027('0x5d'),_0x465284);throw _0x465284;});}return _0x29ff85;})[_0x6027('0x21')](respondWithResult(_0x470d4c,0xc9))['catch'](handleError(_0x470d4c,null));};exports[_0x6027('0x34')]=function(_0x7ca6,_0x5b9ad2){if(_0x7ca6[_0x6027('0x58')]['id']){delete _0x7ca6['body']['id'];}return db[_0x6027('0x3d')][_0x6027('0x56')]({'where':{'id':_0x7ca6['params']['id']}})[_0x6027('0x21')](handleEntityNotFound(_0x5b9ad2,null))[_0x6027('0x21')](saveUpdates(_0x7ca6[_0x6027('0x58')],null))[_0x6027('0x21')](respondWithResult(_0x5b9ad2,null))[_0x6027('0x2a')](handleError(_0x5b9ad2,null));};exports['destroy']=function(_0x195565,_0x1a0d24){return db['ChatQueue'][_0x6027('0x56')]({'where':{'id':_0x195565[_0x6027('0x54')]['id']}})[_0x6027('0x21')](handleEntityNotFound(_0x1a0d24,null))[_0x6027('0x21')](removeEntity(_0x1a0d24,null))[_0x6027('0x2a')](handleError(_0x1a0d24,null));};exports[_0x6027('0x5e')]=function(_0x2ec45d,_0x31cd5d){return db[_0x6027('0x3d')][_0x6027('0x5e')]()['then'](respondWithResult(_0x31cd5d,null))[_0x6027('0x2a')](handleError(_0x31cd5d,null));};exports[_0x6027('0x5f')]=function(_0x213cde,_0x587319,_0x2193ac){var _0x2d87bf={'raw':!![],'where':{}},_0x331dc7={},_0x311581;return db['ChatQueue'][_0x6027('0x60')]({'where':{'id':_0x213cde[_0x6027('0x54')]['id']}})['then'](handleEntityNotFound(_0x587319,null))['then'](function(_0x10302e){if(_0x10302e){_0x311581=_0x10302e[_0x6027('0x35')]({'plain':!![]});_0x331dc7['model']=_[_0x6027('0x41')](db[_0x6027('0x61')][_0x6027('0x55')]);_0x331dc7[_0x6027('0x42')]=_[_0x6027('0x41')](_0x213cde[_0x6027('0x42')]);_0x331dc7[_0x6027('0x4b')]=_[_0x6027('0x43')](_0x331dc7[_0x6027('0x40')],_0x331dc7[_0x6027('0x42')]);_0x2d87bf[_0x6027('0x44')]=_[_0x6027('0x43')](_0x331dc7[_0x6027('0x40')],qs[_0x6027('0x45')](_0x213cde[_0x6027('0x42')][_0x6027('0x45')]));_0x2d87bf[_0x6027('0x44')]=_0x2d87bf['attributes'][_0x6027('0x46')]?_0x2d87bf[_0x6027('0x44')]:_0x331dc7['model'];if(!_0x213cde[_0x6027('0x42')][_0x6027('0x47')](_0x6027('0x48'))){_0x2d87bf[_0x6027('0x2d')]=qs['limit'](_0x213cde[_0x6027('0x42')]['limit']);_0x2d87bf[_0x6027('0x30')]=qs[_0x6027('0x30')](_0x213cde['query'][_0x6027('0x30')]);}_0x2d87bf[_0x6027('0x62')]=qs[_0x6027('0x49')](_0x213cde[_0x6027('0x42')][_0x6027('0x49')]);_0x2d87bf[_0x6027('0x4a')]=qs['filters'](_[_0x6027('0x63')](_0x213cde[_0x6027('0x42')],_0x331dc7[_0x6027('0x4b')]));_0x2d87bf[_0x6027('0x4a')][_0x6027('0x64')]=_0x10302e['id'];if(_0x213cde[_0x6027('0x42')][_0x6027('0x4c')]){_0x2d87bf[_0x6027('0x4a')]=_[_0x6027('0x4d')](_0x2d87bf[_0x6027('0x4a')],{'$or':_[_0x6027('0x3c')](_0x2d87bf[_0x6027('0x44')],function(_0x4a9b5d){var _0x4975bc={};_0x4975bc[_0x4a9b5d]={'$like':'%'+_0x213cde[_0x6027('0x42')][_0x6027('0x4c')]+'%'};return _0x4975bc;})});}_0x2d87bf=_['merge']({},_0x2d87bf,_0x213cde[_0x6027('0x4e')]);return db[_0x6027('0x61')][_0x6027('0x51')](_0x2d87bf);}})[_0x6027('0x21')](function(_0x75e7e6){if(_0x75e7e6){return db['User'][_0x6027('0x65')]({'where':{'id':_['map'](_0x75e7e6,_0x6027('0x66')),'role':_0x6027('0x67')},'attributes':['id',_0x6027('0x3a'),_0x6027('0x68'),_0x6027('0x69'),_0x6027('0x6a')]});}})[_0x6027('0x21')](function(_0x496ca2){if(_0x496ca2){return{'count':_0x496ca2[_0x6027('0x2f')],'rows':_['map'](_0x496ca2['rows'],function(_0x42df06){return{'membername':_0x42df06[_0x6027('0x3a')],'UserId':_0x42df06['id'],'queue_name':_0x311581[_0x6027('0x3a')],'ChatQueueId':_0x311581['id'],'interface':util['format'](_0x6027('0x6b'),_0x6027('0x6c'),_0x42df06[_0x6027('0x3a')]),'penalty':0x0,'paused':_0x42df06['chatPause'],'createdAt':_0x42df06['createdAt'],'updatedAt':_0x42df06[_0x6027('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6027('0x21')](respondWithFilteredResult(_0x587319,_0x2d87bf))[_0x6027('0x2a')](handleError(_0x587319,null));};exports[_0x6027('0x6d')]=function(_0x13b0d8,_0x1a54cf,_0x3f7d32){var _0x5b9521={};var _0xdd3ffc={};var _0x1d4c02;var _0x3968de;return db[_0x6027('0x3d')][_0x6027('0x60')]({'where':{'id':_0x13b0d8['params']['id']}})[_0x6027('0x21')](handleEntityNotFound(_0x1a54cf,null))[_0x6027('0x21')](function(_0x21ac16){if(_0x21ac16){_0x1d4c02=_0x21ac16;_0xdd3ffc[_0x6027('0x40')]=_[_0x6027('0x41')](db[_0x6027('0x6e')]['rawAttributes']);_0xdd3ffc[_0x6027('0x42')]=_[_0x6027('0x41')](_0x13b0d8['query']);_0xdd3ffc[_0x6027('0x4b')]=_[_0x6027('0x43')](_0xdd3ffc['model'],_0xdd3ffc['query']);_0x5b9521[_0x6027('0x44')]=_[_0x6027('0x43')](_0xdd3ffc[_0x6027('0x40')],qs[_0x6027('0x45')](_0x13b0d8[_0x6027('0x42')][_0x6027('0x45')]));_0x5b9521[_0x6027('0x44')]=_0x5b9521[_0x6027('0x44')][_0x6027('0x46')]?_0x5b9521['attributes']:_0xdd3ffc[_0x6027('0x40')];_0x5b9521[_0x6027('0x62')]=qs[_0x6027('0x49')](_0x13b0d8[_0x6027('0x42')][_0x6027('0x49')]);_0x5b9521[_0x6027('0x4a')]=qs[_0x6027('0x4b')](_['pick'](_0x13b0d8[_0x6027('0x42')],_0xdd3ffc[_0x6027('0x4b')]));if(_0x13b0d8[_0x6027('0x42')][_0x6027('0x4c')]){_0x5b9521[_0x6027('0x4a')]=_[_0x6027('0x4d')](_0x5b9521[_0x6027('0x4a')],{'$or':_[_0x6027('0x3c')](_0x5b9521[_0x6027('0x44')],function(_0x578e3d){var _0xd5cd16={};_0xd5cd16[_0x578e3d]={'$like':'%'+_0x13b0d8[_0x6027('0x42')]['filter']+'%'};return _0xd5cd16;})});}_0x5b9521=_[_0x6027('0x4d')]({},_0x5b9521,_0x13b0d8[_0x6027('0x4e')]);return _0x1d4c02[_0x6027('0x6d')](_0x5b9521);}})['then'](function(_0x4e5ca9){if(_0x4e5ca9){_0x3968de=_0x4e5ca9[_0x6027('0x46')];if(!_0x13b0d8[_0x6027('0x42')][_0x6027('0x47')](_0x6027('0x48'))){_0x5b9521[_0x6027('0x2d')]=qs[_0x6027('0x2d')](_0x13b0d8[_0x6027('0x42')][_0x6027('0x2d')]);_0x5b9521['offset']=qs[_0x6027('0x30')](_0x13b0d8[_0x6027('0x42')][_0x6027('0x30')]);}return _0x1d4c02['getTeams'](_0x5b9521);}})[_0x6027('0x21')](function(_0x1fb92a){if(_0x1fb92a){return _0x1fb92a?{'count':_0x3968de,'rows':_0x1fb92a}:null;}})[_0x6027('0x21')](respondWithResult(_0x1a54cf,null))[_0x6027('0x2a')](handleError(_0x1a54cf,null));};exports[_0x6027('0x6f')]=function(_0x4d0e78,_0x11e9c2,_0x137cbe){var _0x34fb4d=_0x4d0e78[_0x6027('0x58')]['ids'];return db[_0x6027('0x6e')][_0x6027('0x51')]({'where':{'id':_0x34fb4d},'attributes':['id'],'include':[{'model':db[_0x6027('0x70')],'as':_0x6027('0x71'),'attributes':['id',_0x6027('0x3a'),_0x6027('0x72'),'voicePause',_0x6027('0x73')],'raw':!![]}]})[_0x6027('0x21')](function(_0x296c00){if(_0x296c00){var _0x3cc1fc=_['flatMap'](_0x296c00,function(_0x3b4a80){var _0xbe4621=_0x3b4a80[_0x6027('0x35')]({'plain':!![]});return _0xbe4621[_0x6027('0x71')];});return db[_0x6027('0x3d')][_0x6027('0x56')]({'where':{'id':_0x4d0e78[_0x6027('0x54')]['id']}})[_0x6027('0x21')](function(_0x38decf){return db['sequelize'][_0x6027('0x74')](function(_0x19cc5b){return _0x38decf[_0x6027('0x6f')](_0x34fb4d,{'transaction':_0x19cc5b})[_0x6027('0x21')](function(){return BPromise[_0x6027('0x75')](_0x3cc1fc,function(_0x447421){return db['UserChatQueue'][_0x6027('0x76')]({'where':{'UserId':_0x447421['id'],'ChatQueueId':_0x4d0e78['params']['id']},'transaction':_0x19cc5b});});})[_0x6027('0x21')](function(){_0x3cc1fc[_0x6027('0x77')](function(_0xa91a72){socket[_0x6027('0x78')]('userChatQueue:save',{'UserId':_0xa91a72['id'],'ChatQueueId':_0x38decf['id']});});});});});}})[_0x6027('0x21')](respondWithStatusCode(_0x11e9c2,null))[_0x6027('0x2a')](handleError(_0x11e9c2,null));};exports[_0x6027('0x79')]=function(_0x345b2c,_0x50b4ee,_0x36af3c){return db[_0x6027('0x6e')][_0x6027('0x51')]({'where':{'id':_0x345b2c['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6027('0x71'),'attributes':['id'],'raw':!![]}]})[_0x6027('0x21')](handleEntityNotFound(_0x50b4ee,null))['then'](function(_0x1ed56f){var _0x1e03c9=_[_0x6027('0x3c')](_0x1ed56f,'id');var _0x3f20cd=[];var _0x5939f7=[];var _0x264c3d=squel[_0x6027('0x7a')]();_0x264c3d['field']('tq.TeamId')[_0x6027('0x7b')](_0x6027('0x7c'),'tq')[_0x6027('0x7d')]('user_has_teams','ut',_0x6027('0x7e'))[_0x6027('0x4a')]('ChatQueueId\x20=\x20?',_0x345b2c['params']['id']);for(var _0x2e13d0=0x0;_0x2e13d0<_0x1ed56f['length'];_0x2e13d0+=0x1){let _0x57000d=_0x1ed56f[_0x2e13d0];for(var _0x3b5781=0x0;_0x3b5781<_0x57000d['Agents'][_0x6027('0x46')];_0x3b5781+=0x1){let _0x217115=_0x57000d[_0x6027('0x71')][_0x3b5781];var _0x4bf6be=_0x264c3d['clone']();_0x4bf6be[_0x6027('0x4a')](_0x6027('0x7f'),_0x217115['id']);_0x5939f7[_0x6027('0x80')](db[_0x6027('0x81')][_0x6027('0x42')](_0x4bf6be['toString'](),{'type':db[_0x6027('0x81')]['QueryTypes'][_0x6027('0x82')]})[_0x6027('0x21')](function(_0x7ed5d){if(_0x7ed5d[_0x6027('0x46')]===0x1){return _0x217115['id'];}else{var _0x3bb9db=_[_0x6027('0x83')](_[_0x6027('0x3c')](_0x7ed5d,'TeamId'),function(_0x121c50){return _[_0x6027('0x84')](_0x1e03c9,_0x121c50);});if(_0x3bb9db){return _0x217115['id'];}}}));}}return BPromise[_0x6027('0x85')](_0x5939f7)[_0x6027('0x21')](function(_0x5b2237){_0x3f20cd=_(_0x3f20cd)[_0x6027('0x86')](_0x5b2237)[_0x6027('0x87')]()[_0x6027('0x88')]();return db['ChatQueue'][_0x6027('0x56')]({'where':{'id':_0x345b2c[_0x6027('0x54')]['id']}})['then'](function(_0x268866){return db['sequelize'][_0x6027('0x74')](function(_0x194298){return _0x268866[_0x6027('0x79')](_0x345b2c['query'][_0x6027('0x89')],{'transaction':_0x194298})[_0x6027('0x21')](function(){if(!_[_0x6027('0x8a')](_0x3f20cd)){return _0x268866['removeAgents'](_0x3f20cd,{'transaction':_0x194298});}})[_0x6027('0x21')](function(){_0x3f20cd[_0x6027('0x77')](function(_0x4b1b28){socket['emit'](_0x6027('0x8b'),{'UserId':_0x4b1b28,'ChatQueueId':_0x268866['id']});});});});});});})[_0x6027('0x21')](respondWithStatusCode(_0x50b4ee,null))['catch'](handleError(_0x50b4ee,null));};exports['addAgents']=function(_0x484fee,_0x5cd696,_0x46caa1){return db[_0x6027('0x3d')]['find']({'where':{'id':_0x484fee[_0x6027('0x54')]['id']}})[_0x6027('0x21')](handleEntityNotFound(_0x5cd696,null))[_0x6027('0x21')](function(_0x533d35){if(_0x533d35){return _0x533d35[_0x6027('0x8c')](_0x484fee[_0x6027('0x58')][_0x6027('0x89')],_[_0x6027('0x8d')](_0x484fee['body'],[_0x6027('0x89'),'id'])||{})[_0x6027('0x8e')](function(_0x4ef42d){for(var _0x2609fe=0x0;_0x2609fe<_0x484fee['body'][_0x6027('0x89')][_0x6027('0x46')];_0x2609fe+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x484fee[_0x6027('0x58')]['ids'][_0x2609fe]),'ChatQueueId':Number(_0x484fee[_0x6027('0x54')]['id'])});}return _0x4ef42d;});}})[_0x6027('0x21')](respondWithResult(_0x5cd696,null))[_0x6027('0x2a')](handleError(_0x5cd696,null));};exports[_0x6027('0x8f')]=function(_0x573259,_0xcb244a,_0x13e09b){return db[_0x6027('0x3d')][_0x6027('0x56')]({'where':{'id':_0x573259[_0x6027('0x54')]['id']}})[_0x6027('0x21')](handleEntityNotFound(_0xcb244a,null))[_0x6027('0x21')](function(_0xf715fd){if(_0xf715fd){return _0xf715fd[_0x6027('0x8f')](_0x573259[_0x6027('0x42')][_0x6027('0x89')])[_0x6027('0x21')](function(){if(_[_0x6027('0x90')](_0x573259[_0x6027('0x42')][_0x6027('0x89')])){for(var _0x54fc26=0x0;_0x54fc26<_0x573259[_0x6027('0x42')][_0x6027('0x89')]['length'];_0x54fc26+=0x1){socket['emit'](_0x6027('0x8b'),{'UserId':Number(_0x573259[_0x6027('0x42')][_0x6027('0x89')][_0x54fc26]),'ChatQueueId':Number(_0x573259[_0x6027('0x54')]['id'])});}}else{socket[_0x6027('0x78')](_0x6027('0x8b'),{'UserId':Number(_0x573259[_0x6027('0x42')][_0x6027('0x89')]),'ChatQueueId':Number(_0x573259[_0x6027('0x54')]['id'])});}});}})[_0x6027('0x21')](respondWithStatusCode(_0xcb244a,null))[_0x6027('0x2a')](handleError(_0xcb244a,null));};exports[_0x6027('0x91')]=function(_0x3e00ef,_0x3cc115,_0xcac987){var _0x44aab9={};var _0x39250e={};var _0x104d62;var _0x55266d;return db[_0x6027('0x3d')][_0x6027('0x60')]({'where':{'id':_0x3e00ef['params']['id']}})['then'](handleEntityNotFound(_0x3cc115,null))[_0x6027('0x21')](function(_0x271b80){if(_0x271b80){_0x104d62=_0x271b80;_0x39250e[_0x6027('0x40')]=_['keys'](db[_0x6027('0x70')]['rawAttributes']);_0x39250e[_0x6027('0x42')]=_[_0x6027('0x41')](_0x3e00ef[_0x6027('0x42')]);_0x39250e[_0x6027('0x4b')]=_[_0x6027('0x43')](_0x39250e[_0x6027('0x40')],_0x39250e['query']);_0x44aab9[_0x6027('0x44')]=_[_0x6027('0x43')](_0x39250e[_0x6027('0x40')],qs[_0x6027('0x45')](_0x3e00ef[_0x6027('0x42')][_0x6027('0x45')]));_0x44aab9['attributes']=_0x44aab9[_0x6027('0x44')][_0x6027('0x46')]?_0x44aab9[_0x6027('0x44')]:_0x39250e[_0x6027('0x40')];_0x44aab9[_0x6027('0x62')]=qs[_0x6027('0x49')](_0x3e00ef[_0x6027('0x42')]['sort']);_0x44aab9[_0x6027('0x4a')]=qs[_0x6027('0x4b')](_[_0x6027('0x63')](_0x3e00ef[_0x6027('0x42')],_0x39250e['filters']));if(_0x3e00ef['query'][_0x6027('0x4c')]){_0x44aab9[_0x6027('0x4a')]=_[_0x6027('0x4d')](_0x44aab9[_0x6027('0x4a')],{'$or':_[_0x6027('0x3c')](_0x44aab9[_0x6027('0x44')],function(_0x17d10){var _0x5e0c6b={};_0x5e0c6b[_0x17d10]={'$like':'%'+_0x3e00ef['query'][_0x6027('0x4c')]+'%'};return _0x5e0c6b;})});}_0x44aab9=_[_0x6027('0x4d')]({},_0x44aab9,_0x3e00ef[_0x6027('0x4e')]);return _0x104d62[_0x6027('0x91')](_0x44aab9);}})[_0x6027('0x21')](function(_0x1a6ec2){if(_0x1a6ec2){_0x55266d=_0x1a6ec2[_0x6027('0x46')];if(!_0x3e00ef[_0x6027('0x42')][_0x6027('0x47')](_0x6027('0x48'))){_0x44aab9[_0x6027('0x2d')]=qs[_0x6027('0x2d')](_0x3e00ef[_0x6027('0x42')]['limit']);_0x44aab9[_0x6027('0x30')]=qs['offset'](_0x3e00ef[_0x6027('0x42')][_0x6027('0x30')]);}return _0x104d62[_0x6027('0x91')](_0x44aab9);}})[_0x6027('0x21')](function(_0x5e42c8){if(_0x5e42c8){return _0x5e42c8?{'count':_0x55266d,'rows':_0x5e42c8}:null;}})[_0x6027('0x21')](respondWithResult(_0x3cc115,null))[_0x6027('0x2a')](handleError(_0x3cc115,null));};
\ No newline at end of file
+var _0x5d46=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','localhost','socket.io-emitter','redis','./chatQueue.socket','register','jayson/promise','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','reject','save','get','ChatQueues','UserProfileResource','destroy','stack','name','send','index','map','ChatQueue','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','online','voicePause','flatMap','Agents','sequelize','each','forEach','emit','userChatQueue:save','ids','select','field','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','SELECT','every','all','compact','value','transaction','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs'];(function(_0x170559,_0x1c42be){var _0x56b471=function(_0xffe802){while(--_0xffe802){_0x170559['push'](_0x170559['shift']());}};_0x56b471(++_0x1c42be);}(_0x5d46,0x10e));var _0x65d4=function(_0x13772b,_0x97743b){_0x13772b=_0x13772b-0x0;var _0x2b27e9=_0x5d46[_0x13772b];return _0x2b27e9;};'use strict';var emlformat=require(_0x65d4('0x0'));var rimraf=require(_0x65d4('0x1'));var zipdir=require(_0x65d4('0x2'));var jsonpatch=require(_0x65d4('0x3'));var rp=require(_0x65d4('0x4'));var moment=require(_0x65d4('0x5'));var BPromise=require(_0x65d4('0x6'));var Mustache=require(_0x65d4('0x7'));var util=require(_0x65d4('0x8'));var path=require(_0x65d4('0x9'));var sox=require('sox');var csv=require(_0x65d4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x65d4('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x65d4('0xc'));var jsforce=require(_0x65d4('0xd'));var deskjs=require(_0x65d4('0xe'));var toCsv=require(_0x65d4('0xa'));var querystring=require('querystring');var Papa=require(_0x65d4('0xf'));var Redis=require(_0x65d4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x65d4('0x11'));var as=require(_0x65d4('0x12'));var hardwareService=require(_0x65d4('0x13'));var logger=require(_0x65d4('0x14'))(_0x65d4('0x15'));var utils=require('../../config/utils');var config=require(_0x65d4('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x65d4('0x17')](config['redis'],{'host':_0x65d4('0x18'),'port':0x18eb});var socket=require(_0x65d4('0x19'))(new Redis(config[_0x65d4('0x1a')]));require(_0x65d4('0x1b'))[_0x65d4('0x1c')](socket);var jayson=require(_0x65d4('0x1d'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21f054,_0x5955b9,_0xa6ab99,_0x3e49d9){return new BPromise(function(_0x374b31,_0x22b75e){var _0x25f9e3=_0x3e49d9||client;return _0x25f9e3['request'](_0x21f054,_0xa6ab99)[_0x65d4('0x1e')](function(_0x56dfad){logger[_0x65d4('0x1f')](_0x65d4('0x20'),_0x5955b9,_0x65d4('0x21'));logger[_0x65d4('0x22')](_0x65d4('0x23'),_0x5955b9,_0x65d4('0x21'),JSON['stringify'](_0x56dfad));if(_0x56dfad['error']){if(_0x56dfad[_0x65d4('0x24')][_0x65d4('0x25')]===0x1f4){logger['error'](_0x65d4('0x20'),_0x5955b9,_0x56dfad[_0x65d4('0x24')][_0x65d4('0x26')]);return _0x22b75e(_0x56dfad[_0x65d4('0x24')][_0x65d4('0x26')]);}logger['error'](_0x65d4('0x20'),_0x5955b9,_0x56dfad['error'][_0x65d4('0x26')]);return _0x374b31(_0x56dfad[_0x65d4('0x24')][_0x65d4('0x26')]);}else{logger[_0x65d4('0x1f')](_0x65d4('0x20'),_0x5955b9,_0x65d4('0x21'));_0x374b31(_0x56dfad[_0x65d4('0x27')][_0x65d4('0x26')]);}})[_0x65d4('0x28')](function(_0x3d655e){logger['error'](_0x65d4('0x20'),_0x5955b9,_0x3d655e);_0x22b75e(_0x3d655e);});});}function respondWithStatusCode(_0x42b06f,_0x56c5f3){_0x56c5f3=_0x56c5f3||0xcc;return function(_0x42304b){if(_0x42304b){return _0x42b06f[_0x65d4('0x29')](_0x56c5f3);}return _0x42b06f[_0x65d4('0x2a')](_0x56c5f3)[_0x65d4('0x2b')]();};}function respondWithResult(_0x5311e0,_0x760dfe){_0x760dfe=_0x760dfe||0xc8;return function(_0x1a5bf6){if(_0x1a5bf6){return _0x5311e0[_0x65d4('0x2a')](_0x760dfe)[_0x65d4('0x2c')](_0x1a5bf6);}};}function respondWithFilteredResult(_0x2cf012,_0x116d9e){return function(_0x20555f){if(_0x20555f){var _0x42136b=typeof _0x116d9e['offset']===_0x65d4('0x2d')&&typeof _0x116d9e[_0x65d4('0x2e')]==='undefined';var _0x2df620=_0x20555f['count'];var _0x1a4228=_0x42136b?0x0:_0x116d9e['offset'];var _0x55e580=_0x42136b?_0x20555f[_0x65d4('0x2f')]:_0x116d9e[_0x65d4('0x30')]+_0x116d9e[_0x65d4('0x2e')];var _0x5a9cd9;if(_0x55e580>=_0x2df620){_0x55e580=_0x2df620;_0x5a9cd9=0xc8;}else{_0x5a9cd9=0xce;}_0x2cf012[_0x65d4('0x2a')](_0x5a9cd9);return _0x2cf012['set']('Content-Range',_0x1a4228+'-'+_0x55e580+'/'+_0x2df620)[_0x65d4('0x2c')](_0x20555f);}return null;};}function patchUpdates(_0x4a022f){return function(_0xe48039){try{jsonpatch['apply'](_0xe48039,_0x4a022f,!![]);}catch(_0x3efc3e){return BPromise[_0x65d4('0x31')](_0x3efc3e);}return _0xe48039[_0x65d4('0x32')]();};}function saveUpdates(_0x2c84b3,_0x33a495){return function(_0x3300e9){if(_0x3300e9){return _0x3300e9['update'](_0x2c84b3)[_0x65d4('0x1e')](function(_0x23de05){return _0x23de05;});}return null;};}function removeEntity(_0x59ecae,_0x228e76){return function(_0x183fd4){if(_0x183fd4){return _0x183fd4['destroy']()[_0x65d4('0x1e')](function(){var _0x1509e5=_0x183fd4[_0x65d4('0x33')]({'plain':!![]});var _0x3bd20c=_0x65d4('0x34');return db[_0x65d4('0x35')][_0x65d4('0x36')]({'where':{'type':_0x3bd20c,'resourceId':_0x1509e5['id']}})[_0x65d4('0x1e')](function(){return _0x183fd4;});})['then'](function(){_0x59ecae[_0x65d4('0x2a')](0xcc)[_0x65d4('0x2b')]();});}};}function handleEntityNotFound(_0x205306,_0x1dedbb){return function(_0x40ce4b){if(!_0x40ce4b){_0x205306[_0x65d4('0x29')](0x194);}return _0x40ce4b;};}function handleError(_0x5ef913,_0x1d068b){_0x1d068b=_0x1d068b||0x1f4;return function(_0x27b44b){logger[_0x65d4('0x24')](_0x27b44b[_0x65d4('0x37')]);if(_0x27b44b[_0x65d4('0x38')]){delete _0x27b44b[_0x65d4('0x38')];}_0x5ef913[_0x65d4('0x2a')](_0x1d068b)[_0x65d4('0x39')](_0x27b44b);};}exports[_0x65d4('0x3a')]=function(_0x407482,_0x45f60b){var _0x295634={},_0x5637bd={},_0x5cde4c={'count':0x0,'rows':[]};var _0x5969b7=_[_0x65d4('0x3b')](db[_0x65d4('0x3c')]['rawAttributes'],function(_0x195ed6){return{'name':_0x195ed6[_0x65d4('0x3d')],'type':_0x195ed6['type'][_0x65d4('0x3e')]};});_0x5637bd[_0x65d4('0x3f')]=_['map'](_0x5969b7,_0x65d4('0x38'));_0x5637bd[_0x65d4('0x40')]=_['keys'](_0x407482['query']);_0x5637bd[_0x65d4('0x41')]=_[_0x65d4('0x42')](_0x5637bd[_0x65d4('0x3f')],_0x5637bd['query']);_0x295634[_0x65d4('0x43')]=_[_0x65d4('0x42')](_0x5637bd['model'],qs[_0x65d4('0x44')](_0x407482[_0x65d4('0x40')][_0x65d4('0x44')]));_0x295634[_0x65d4('0x43')]=_0x295634['attributes'][_0x65d4('0x45')]?_0x295634[_0x65d4('0x43')]:_0x5637bd['model'];if(!_0x407482['query'][_0x65d4('0x46')](_0x65d4('0x47'))){_0x295634[_0x65d4('0x2e')]=qs[_0x65d4('0x2e')](_0x407482[_0x65d4('0x40')][_0x65d4('0x2e')]);_0x295634[_0x65d4('0x30')]=qs['offset'](_0x407482[_0x65d4('0x40')]['offset']);}_0x295634[_0x65d4('0x48')]=qs[_0x65d4('0x49')](_0x407482[_0x65d4('0x40')][_0x65d4('0x49')]);_0x295634[_0x65d4('0x4a')]=qs[_0x65d4('0x41')](_[_0x65d4('0x4b')](_0x407482[_0x65d4('0x40')],_0x5637bd[_0x65d4('0x41')]),_0x5969b7);if(_0x407482[_0x65d4('0x40')][_0x65d4('0x4c')]){_0x295634[_0x65d4('0x4a')]=_[_0x65d4('0x4d')](_0x295634[_0x65d4('0x4a')],{'$or':_['map'](_0x5969b7,function(_0x478557){if(_0x478557['type']!==_0x65d4('0x4e')){var _0x11e65d={};_0x11e65d[_0x478557[_0x65d4('0x38')]]={'$like':'%'+_0x407482['query'][_0x65d4('0x4c')]+'%'};return _0x11e65d;}})});}_0x295634=_['merge']({},_0x295634,_0x407482[_0x65d4('0x4f')]);var _0xd48438={'where':_0x295634[_0x65d4('0x4a')]};return db[_0x65d4('0x3c')][_0x65d4('0x2f')](_0xd48438)[_0x65d4('0x1e')](function(_0x46955c){_0x5cde4c[_0x65d4('0x2f')]=_0x46955c;if(_0x407482['query'][_0x65d4('0x50')]){_0x295634[_0x65d4('0x51')]=[{'all':!![]}];}return db['ChatQueue'][_0x65d4('0x52')](_0x295634);})[_0x65d4('0x1e')](function(_0xc57326){_0x5cde4c[_0x65d4('0x53')]=_0xc57326;return _0x5cde4c;})[_0x65d4('0x1e')](respondWithFilteredResult(_0x45f60b,_0x295634))[_0x65d4('0x28')](handleError(_0x45f60b,null));};exports['show']=function(_0x1b9f9a,_0x1aaeb4){var _0x50735e={'raw':!![],'where':{'id':_0x1b9f9a[_0x65d4('0x54')]['id']}},_0x2d0d78={};_0x2d0d78[_0x65d4('0x3f')]=_[_0x65d4('0x55')](db[_0x65d4('0x3c')][_0x65d4('0x56')]);_0x2d0d78[_0x65d4('0x40')]=_[_0x65d4('0x55')](_0x1b9f9a['query']);_0x2d0d78['filters']=_[_0x65d4('0x42')](_0x2d0d78[_0x65d4('0x3f')],_0x2d0d78[_0x65d4('0x40')]);_0x50735e['attributes']=_[_0x65d4('0x42')](_0x2d0d78['model'],qs[_0x65d4('0x44')](_0x1b9f9a[_0x65d4('0x40')]['fields']));_0x50735e['attributes']=_0x50735e[_0x65d4('0x43')]['length']?_0x50735e[_0x65d4('0x43')]:_0x2d0d78[_0x65d4('0x3f')];if(_0x1b9f9a[_0x65d4('0x40')][_0x65d4('0x50')]){_0x50735e['include']=[{'all':!![]}];}_0x50735e=_[_0x65d4('0x4d')]({},_0x50735e,_0x1b9f9a[_0x65d4('0x4f')]);return db[_0x65d4('0x3c')]['find'](_0x50735e)[_0x65d4('0x1e')](handleEntityNotFound(_0x1aaeb4,null))['then'](respondWithResult(_0x1aaeb4,null))['catch'](handleError(_0x1aaeb4,null));};exports['create']=function(_0x125a59,_0x16ab17){return db[_0x65d4('0x3c')][_0x65d4('0x57')](_0x125a59[_0x65d4('0x58')],{})[_0x65d4('0x1e')](function(_0x517067){var _0x3331f1=_0x125a59[_0x65d4('0x59')][_0x65d4('0x33')]({'plain':!![]});if(!_0x3331f1)throw new Error(_0x65d4('0x5a'));if(_0x3331f1[_0x65d4('0x5b')]==='user'){var _0x404c17=_0x517067[_0x65d4('0x33')]({'plain':!![]});var _0x257b19=_0x65d4('0x34');return db[_0x65d4('0x5c')][_0x65d4('0x5d')]({'where':{'name':_0x257b19,'userProfileId':_0x3331f1['userProfileId']},'raw':!![]})[_0x65d4('0x1e')](function(_0x402820){if(_0x402820&&_0x402820[_0x65d4('0x5e')]===0x0){return db[_0x65d4('0x35')][_0x65d4('0x57')]({'name':_0x404c17['name'],'resourceId':_0x404c17['id'],'type':_0x402820[_0x65d4('0x38')],'sectionId':_0x402820['id']},{})[_0x65d4('0x1e')](function(){return _0x517067;});}else{return _0x517067;}})[_0x65d4('0x28')](function(_0x4bac5e){logger[_0x65d4('0x24')](_0x65d4('0x5f'),_0x4bac5e);throw _0x4bac5e;});}return _0x517067;})[_0x65d4('0x1e')](respondWithResult(_0x16ab17,0xc9))[_0x65d4('0x28')](handleError(_0x16ab17,null));};exports[_0x65d4('0x60')]=function(_0x59b035,_0x2ae839){if(_0x59b035['body']['id']){delete _0x59b035[_0x65d4('0x58')]['id'];}return db[_0x65d4('0x3c')]['find']({'where':{'id':_0x59b035['params']['id']}})[_0x65d4('0x1e')](handleEntityNotFound(_0x2ae839,null))[_0x65d4('0x1e')](saveUpdates(_0x59b035[_0x65d4('0x58')],null))[_0x65d4('0x1e')](respondWithResult(_0x2ae839,null))[_0x65d4('0x28')](handleError(_0x2ae839,null));};exports[_0x65d4('0x36')]=function(_0x1f9fb7,_0x50c598){return db[_0x65d4('0x3c')][_0x65d4('0x5d')]({'where':{'id':_0x1f9fb7[_0x65d4('0x54')]['id']}})[_0x65d4('0x1e')](handleEntityNotFound(_0x50c598,null))[_0x65d4('0x1e')](removeEntity(_0x50c598,null))[_0x65d4('0x28')](handleError(_0x50c598,null));};exports['describe']=function(_0x5ad53c,_0x387c34){return db[_0x65d4('0x3c')][_0x65d4('0x61')]()['then'](respondWithResult(_0x387c34,null))[_0x65d4('0x28')](handleError(_0x387c34,null));};exports[_0x65d4('0x62')]=function(_0x5286ef,_0x54bdb3,_0x216058){var _0x34bda2={'raw':!![],'where':{}},_0x66a9ce={},_0x18f9f3;return db[_0x65d4('0x3c')][_0x65d4('0x63')]({'where':{'id':_0x5286ef[_0x65d4('0x54')]['id']}})[_0x65d4('0x1e')](handleEntityNotFound(_0x54bdb3,null))[_0x65d4('0x1e')](function(_0x42f355){if(_0x42f355){_0x18f9f3=_0x42f355[_0x65d4('0x33')]({'plain':!![]});_0x66a9ce[_0x65d4('0x3f')]=_[_0x65d4('0x55')](db[_0x65d4('0x64')]['rawAttributes']);_0x66a9ce[_0x65d4('0x40')]=_[_0x65d4('0x55')](_0x5286ef[_0x65d4('0x40')]);_0x66a9ce[_0x65d4('0x41')]=_[_0x65d4('0x42')](_0x66a9ce[_0x65d4('0x3f')],_0x66a9ce[_0x65d4('0x40')]);_0x34bda2['attributes']=_[_0x65d4('0x42')](_0x66a9ce[_0x65d4('0x3f')],qs[_0x65d4('0x44')](_0x5286ef[_0x65d4('0x40')][_0x65d4('0x44')]));_0x34bda2['attributes']=_0x34bda2[_0x65d4('0x43')]['length']?_0x34bda2[_0x65d4('0x43')]:_0x66a9ce[_0x65d4('0x3f')];if(!_0x5286ef[_0x65d4('0x40')][_0x65d4('0x46')]('nolimit')){_0x34bda2[_0x65d4('0x2e')]=qs[_0x65d4('0x2e')](_0x5286ef[_0x65d4('0x40')]['limit']);_0x34bda2[_0x65d4('0x30')]=qs[_0x65d4('0x30')](_0x5286ef[_0x65d4('0x40')][_0x65d4('0x30')]);}_0x34bda2['order']=qs[_0x65d4('0x49')](_0x5286ef[_0x65d4('0x40')][_0x65d4('0x49')]);_0x34bda2[_0x65d4('0x4a')]=qs[_0x65d4('0x41')](_['pick'](_0x5286ef[_0x65d4('0x40')],_0x66a9ce['filters']));_0x34bda2[_0x65d4('0x4a')][_0x65d4('0x65')]=_0x42f355['id'];if(_0x5286ef[_0x65d4('0x40')][_0x65d4('0x4c')]){_0x34bda2[_0x65d4('0x4a')]=_[_0x65d4('0x4d')](_0x34bda2[_0x65d4('0x4a')],{'$or':_[_0x65d4('0x3b')](_0x34bda2['attributes'],function(_0x191a4a){var _0x34ac65={};_0x34ac65[_0x191a4a]={'$like':'%'+_0x5286ef['query'][_0x65d4('0x4c')]+'%'};return _0x34ac65;})});}_0x34bda2=_[_0x65d4('0x4d')]({},_0x34bda2,_0x5286ef[_0x65d4('0x4f')]);return db[_0x65d4('0x64')][_0x65d4('0x52')](_0x34bda2);}})[_0x65d4('0x1e')](function(_0x3da9db){if(_0x3da9db){return db[_0x65d4('0x66')]['findAndCountAll']({'where':{'id':_[_0x65d4('0x3b')](_0x3da9db,'UserId'),'role':_0x65d4('0x67')},'attributes':['id',_0x65d4('0x38'),_0x65d4('0x68'),_0x65d4('0x69'),_0x65d4('0x6a')]});}})[_0x65d4('0x1e')](function(_0x1efa37){if(_0x1efa37){return{'count':_0x1efa37[_0x65d4('0x2f')],'rows':_['map'](_0x1efa37[_0x65d4('0x53')],function(_0x30a0d3){return{'membername':_0x30a0d3[_0x65d4('0x38')],'UserId':_0x30a0d3['id'],'queue_name':_0x18f9f3['name'],'ChatQueueId':_0x18f9f3['id'],'interface':util['format'](_0x65d4('0x6b'),_0x65d4('0x6c'),_0x30a0d3[_0x65d4('0x38')]),'penalty':0x0,'paused':_0x30a0d3[_0x65d4('0x68')],'createdAt':_0x30a0d3['createdAt'],'updatedAt':_0x30a0d3[_0x65d4('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x65d4('0x1e')](respondWithFilteredResult(_0x54bdb3,_0x34bda2))[_0x65d4('0x28')](handleError(_0x54bdb3,null));};exports[_0x65d4('0x6d')]=function(_0x2a4a5a,_0x463007,_0x4a6905){var _0x903999={};var _0x5c357d={};var _0x2dc710;var _0x4dfc23;return db[_0x65d4('0x3c')]['findOne']({'where':{'id':_0x2a4a5a[_0x65d4('0x54')]['id']}})[_0x65d4('0x1e')](handleEntityNotFound(_0x463007,null))[_0x65d4('0x1e')](function(_0x23ff96){if(_0x23ff96){_0x2dc710=_0x23ff96;_0x5c357d[_0x65d4('0x3f')]=_[_0x65d4('0x55')](db[_0x65d4('0x6e')]['rawAttributes']);_0x5c357d[_0x65d4('0x40')]=_[_0x65d4('0x55')](_0x2a4a5a[_0x65d4('0x40')]);_0x5c357d[_0x65d4('0x41')]=_[_0x65d4('0x42')](_0x5c357d['model'],_0x5c357d[_0x65d4('0x40')]);_0x903999[_0x65d4('0x43')]=_[_0x65d4('0x42')](_0x5c357d[_0x65d4('0x3f')],qs['fields'](_0x2a4a5a[_0x65d4('0x40')][_0x65d4('0x44')]));_0x903999['attributes']=_0x903999[_0x65d4('0x43')]['length']?_0x903999[_0x65d4('0x43')]:_0x5c357d[_0x65d4('0x3f')];_0x903999['order']=qs[_0x65d4('0x49')](_0x2a4a5a[_0x65d4('0x40')][_0x65d4('0x49')]);_0x903999['where']=qs[_0x65d4('0x41')](_[_0x65d4('0x4b')](_0x2a4a5a['query'],_0x5c357d[_0x65d4('0x41')]));if(_0x2a4a5a[_0x65d4('0x40')]['filter']){_0x903999['where']=_[_0x65d4('0x4d')](_0x903999[_0x65d4('0x4a')],{'$or':_[_0x65d4('0x3b')](_0x903999['attributes'],function(_0x45e9c1){var _0x3950af={};_0x3950af[_0x45e9c1]={'$like':'%'+_0x2a4a5a['query']['filter']+'%'};return _0x3950af;})});}_0x903999=_[_0x65d4('0x4d')]({},_0x903999,_0x2a4a5a[_0x65d4('0x4f')]);return _0x2dc710[_0x65d4('0x6d')](_0x903999);}})[_0x65d4('0x1e')](function(_0x2ab3b1){if(_0x2ab3b1){_0x4dfc23=_0x2ab3b1[_0x65d4('0x45')];if(!_0x2a4a5a[_0x65d4('0x40')][_0x65d4('0x46')](_0x65d4('0x47'))){_0x903999[_0x65d4('0x2e')]=qs[_0x65d4('0x2e')](_0x2a4a5a['query'][_0x65d4('0x2e')]);_0x903999[_0x65d4('0x30')]=qs[_0x65d4('0x30')](_0x2a4a5a[_0x65d4('0x40')][_0x65d4('0x30')]);}return _0x2dc710[_0x65d4('0x6d')](_0x903999);}})['then'](function(_0x326ae5){if(_0x326ae5){return _0x326ae5?{'count':_0x4dfc23,'rows':_0x326ae5}:null;}})[_0x65d4('0x1e')](respondWithResult(_0x463007,null))[_0x65d4('0x28')](handleError(_0x463007,null));};exports[_0x65d4('0x6f')]=function(_0xc766b8,_0xfac469,_0x1124d2){var _0x3e1eb0=_0xc766b8[_0x65d4('0x58')]['ids'];return db['Team'][_0x65d4('0x52')]({'where':{'id':_0x3e1eb0},'attributes':['id'],'include':[{'model':db[_0x65d4('0x66')],'as':'Agents','attributes':['id',_0x65d4('0x38'),_0x65d4('0x70'),_0x65d4('0x71'),'interface'],'raw':!![]}]})['then'](function(_0x3bd378){if(_0x3bd378){var _0x5eb46d=_[_0x65d4('0x72')](_0x3bd378,function(_0x2c109b){var _0x13c192=_0x2c109b[_0x65d4('0x33')]({'plain':!![]});return _0x13c192[_0x65d4('0x73')];});return db[_0x65d4('0x3c')][_0x65d4('0x5d')]({'where':{'id':_0xc766b8[_0x65d4('0x54')]['id']}})['then'](function(_0x26e2cc){return db[_0x65d4('0x74')]['transaction'](function(_0x1dc6da){return _0x26e2cc[_0x65d4('0x6f')](_0x3e1eb0,{'transaction':_0x1dc6da})[_0x65d4('0x1e')](function(){return BPromise[_0x65d4('0x75')](_0x5eb46d,function(_0x166cc8){return db[_0x65d4('0x64')]['findOrCreate']({'where':{'UserId':_0x166cc8['id'],'ChatQueueId':_0xc766b8['params']['id']},'transaction':_0x1dc6da});});})[_0x65d4('0x1e')](function(){_0x5eb46d[_0x65d4('0x76')](function(_0x4fc736){socket[_0x65d4('0x77')](_0x65d4('0x78'),{'UserId':_0x4fc736['id'],'ChatQueueId':_0x26e2cc['id']});});});});});}})[_0x65d4('0x1e')](respondWithStatusCode(_0xfac469,null))[_0x65d4('0x28')](handleError(_0xfac469,null));};exports['removeTeams']=function(_0x47272e,_0x1e1717,_0x306f50){return db[_0x65d4('0x6e')][_0x65d4('0x52')]({'where':{'id':_0x47272e[_0x65d4('0x40')][_0x65d4('0x79')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x65d4('0x73'),'attributes':['id'],'raw':!![]}]})[_0x65d4('0x1e')](handleEntityNotFound(_0x1e1717,null))['then'](function(_0x44ce96){var _0x22c638=_[_0x65d4('0x3b')](_0x44ce96,'id');var _0x198372=[];var _0x5b46cd=[];var _0x3af4a8=squel[_0x65d4('0x7a')]();_0x3af4a8[_0x65d4('0x7b')]('tq.TeamId')['from'](_0x65d4('0x7c'),'tq')[_0x65d4('0x7d')](_0x65d4('0x7e'),'ut',_0x65d4('0x7f'))[_0x65d4('0x4a')](_0x65d4('0x80'),_0x47272e['params']['id']);for(var _0x5cfb03=0x0;_0x5cfb03<_0x44ce96['length'];_0x5cfb03+=0x1){let _0x3fc123=_0x44ce96[_0x5cfb03];for(var _0x2fa2f7=0x0;_0x2fa2f7<_0x3fc123[_0x65d4('0x73')][_0x65d4('0x45')];_0x2fa2f7+=0x1){let _0x3e3058=_0x3fc123[_0x65d4('0x73')][_0x2fa2f7];var _0x49519e=_0x3af4a8['clone']();_0x49519e[_0x65d4('0x4a')]('ut.UserId\x20=\x20?',_0x3e3058['id']);_0x5b46cd['push'](db['sequelize'][_0x65d4('0x40')](_0x49519e['toString'](),{'type':db[_0x65d4('0x74')]['QueryTypes'][_0x65d4('0x81')]})[_0x65d4('0x1e')](function(_0x2ae90b){if(_0x2ae90b[_0x65d4('0x45')]===0x1){return _0x3e3058['id'];}else{var _0xb46848=_[_0x65d4('0x82')](_[_0x65d4('0x3b')](_0x2ae90b,'TeamId'),function(_0x2f6ada){return _['includes'](_0x22c638,_0x2f6ada);});if(_0xb46848){return _0x3e3058['id'];}}}));}}return BPromise[_0x65d4('0x83')](_0x5b46cd)[_0x65d4('0x1e')](function(_0x166941){_0x198372=_(_0x198372)['union'](_0x166941)[_0x65d4('0x84')]()[_0x65d4('0x85')]();return db[_0x65d4('0x3c')][_0x65d4('0x5d')]({'where':{'id':_0x47272e[_0x65d4('0x54')]['id']}})['then'](function(_0x52d20a){return db[_0x65d4('0x74')][_0x65d4('0x86')](function(_0x18bb69){return _0x52d20a[_0x65d4('0x87')](_0x47272e[_0x65d4('0x40')]['ids'],{'transaction':_0x18bb69})['then'](function(){if(!_[_0x65d4('0x88')](_0x198372)){return _0x52d20a[_0x65d4('0x89')](_0x198372,{'transaction':_0x18bb69});}})[_0x65d4('0x1e')](function(){_0x198372[_0x65d4('0x76')](function(_0x37e979){socket[_0x65d4('0x77')](_0x65d4('0x8a'),{'UserId':_0x37e979,'ChatQueueId':_0x52d20a['id']});});});});});});})['then'](respondWithStatusCode(_0x1e1717,null))['catch'](handleError(_0x1e1717,null));};exports[_0x65d4('0x8b')]=function(_0x59fbd6,_0x101c18,_0x155dc1){return db['ChatQueue'][_0x65d4('0x5d')]({'where':{'id':_0x59fbd6['params']['id']}})[_0x65d4('0x1e')](handleEntityNotFound(_0x101c18,null))[_0x65d4('0x1e')](function(_0x3231ef){if(_0x3231ef){return _0x3231ef[_0x65d4('0x8b')](_0x59fbd6[_0x65d4('0x58')]['ids'],_[_0x65d4('0x8c')](_0x59fbd6['body'],[_0x65d4('0x79'),'id'])||{})[_0x65d4('0x8d')](function(_0x2e0a33){for(var _0x10b0da=0x0;_0x10b0da<_0x59fbd6[_0x65d4('0x58')]['ids'][_0x65d4('0x45')];_0x10b0da+=0x1){socket[_0x65d4('0x77')](_0x65d4('0x78'),{'UserId':Number(_0x59fbd6[_0x65d4('0x58')][_0x65d4('0x79')][_0x10b0da]),'ChatQueueId':Number(_0x59fbd6['params']['id'])});}return _0x2e0a33;});}})['then'](respondWithResult(_0x101c18,null))[_0x65d4('0x28')](handleError(_0x101c18,null));};exports[_0x65d4('0x89')]=function(_0x529c6a,_0x4d8588,_0x2079ed){return db[_0x65d4('0x3c')][_0x65d4('0x5d')]({'where':{'id':_0x529c6a[_0x65d4('0x54')]['id']}})['then'](handleEntityNotFound(_0x4d8588,null))['then'](function(_0x56bda3){if(_0x56bda3){return _0x56bda3[_0x65d4('0x89')](_0x529c6a[_0x65d4('0x40')][_0x65d4('0x79')])[_0x65d4('0x1e')](function(){if(_[_0x65d4('0x8e')](_0x529c6a[_0x65d4('0x40')][_0x65d4('0x79')])){for(var _0x28767b=0x0;_0x28767b<_0x529c6a[_0x65d4('0x40')][_0x65d4('0x79')]['length'];_0x28767b+=0x1){socket[_0x65d4('0x77')]('userChatQueue:remove',{'UserId':Number(_0x529c6a[_0x65d4('0x40')][_0x65d4('0x79')][_0x28767b]),'ChatQueueId':Number(_0x529c6a['params']['id'])});}}else{socket[_0x65d4('0x77')](_0x65d4('0x8a'),{'UserId':Number(_0x529c6a[_0x65d4('0x40')]['ids']),'ChatQueueId':Number(_0x529c6a[_0x65d4('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x4d8588,null))[_0x65d4('0x28')](handleError(_0x4d8588,null));};exports[_0x65d4('0x8f')]=function(_0x344e34,_0x274db5,_0x25b4fe){var _0x4d3659={};var _0x2be871={};var _0x18f392;var _0x3e0374;return db['ChatQueue'][_0x65d4('0x63')]({'where':{'id':_0x344e34[_0x65d4('0x54')]['id']}})['then'](handleEntityNotFound(_0x274db5,null))[_0x65d4('0x1e')](function(_0x5c3a24){if(_0x5c3a24){_0x18f392=_0x5c3a24;_0x2be871[_0x65d4('0x3f')]=_[_0x65d4('0x55')](db[_0x65d4('0x66')][_0x65d4('0x56')]);_0x2be871['query']=_['keys'](_0x344e34[_0x65d4('0x40')]);_0x2be871[_0x65d4('0x41')]=_['intersection'](_0x2be871[_0x65d4('0x3f')],_0x2be871[_0x65d4('0x40')]);_0x4d3659[_0x65d4('0x43')]=_[_0x65d4('0x42')](_0x2be871['model'],qs[_0x65d4('0x44')](_0x344e34[_0x65d4('0x40')][_0x65d4('0x44')]));_0x4d3659[_0x65d4('0x43')]=_0x4d3659[_0x65d4('0x43')][_0x65d4('0x45')]?_0x4d3659[_0x65d4('0x43')]:_0x2be871[_0x65d4('0x3f')];_0x4d3659['order']=qs[_0x65d4('0x49')](_0x344e34[_0x65d4('0x40')][_0x65d4('0x49')]);_0x4d3659[_0x65d4('0x4a')]=qs['filters'](_[_0x65d4('0x4b')](_0x344e34[_0x65d4('0x40')],_0x2be871[_0x65d4('0x41')]));if(_0x344e34[_0x65d4('0x40')]['filter']){_0x4d3659[_0x65d4('0x4a')]=_[_0x65d4('0x4d')](_0x4d3659[_0x65d4('0x4a')],{'$or':_[_0x65d4('0x3b')](_0x4d3659[_0x65d4('0x43')],function(_0x365931){var _0x576746={};_0x576746[_0x365931]={'$like':'%'+_0x344e34[_0x65d4('0x40')][_0x65d4('0x4c')]+'%'};return _0x576746;})});}_0x4d3659=_[_0x65d4('0x4d')]({},_0x4d3659,_0x344e34[_0x65d4('0x4f')]);return _0x18f392[_0x65d4('0x8f')](_0x4d3659);}})['then'](function(_0x40a36e){if(_0x40a36e){_0x3e0374=_0x40a36e[_0x65d4('0x45')];if(!_0x344e34[_0x65d4('0x40')][_0x65d4('0x46')]('nolimit')){_0x4d3659['limit']=qs[_0x65d4('0x2e')](_0x344e34[_0x65d4('0x40')][_0x65d4('0x2e')]);_0x4d3659[_0x65d4('0x30')]=qs[_0x65d4('0x30')](_0x344e34[_0x65d4('0x40')][_0x65d4('0x30')]);}return _0x18f392[_0x65d4('0x8f')](_0x4d3659);}})[_0x65d4('0x1e')](function(_0x2fb26f){if(_0x2fb26f){return _0x2fb26f?{'count':_0x3e0374,'rows':_0x2fb26f}:null;}})[_0x65d4('0x1e')](respondWithResult(_0x274db5,null))[_0x65d4('0x28')](handleError(_0x274db5,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 5496ab3..d1b9d64 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 _0x81c2=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x38c699,_0x56fea7){var _0x3b1ded=function(_0x100851){while(--_0x100851){_0x38c699['push'](_0x38c699['shift']());}};_0x3b1ded(++_0x56fea7);}(_0x81c2,0xdf));var _0x281c=function(_0xb29bef,_0x45aff1){_0xb29bef=_0xb29bef-0x0;var _0x878163=_0x81c2[_0xb29bef];return _0x878163;};'use strict';var EventEmitter=require(_0x281c('0x0'));var ChatQueue=require(_0x281c('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x281c('0x2')](0x0);var events={'afterCreate':_0x281c('0x3'),'afterUpdate':_0x281c('0x4'),'afterDestroy':_0x281c('0x5')};function emitEvent(_0x51e91e){return function(_0x2b3286,_0x2d8a0f,_0x59a35b){ChatQueueEvents[_0x281c('0x6')](_0x51e91e+':'+_0x2b3286['id'],_0x2b3286);ChatQueueEvents[_0x281c('0x6')](_0x51e91e,_0x2b3286);_0x59a35b(null);};}for(var e in events){if(events[_0x281c('0x7')](e)){var event=events[e];ChatQueue[_0x281c('0x8')](e,emitEvent(event));}}module[_0x281c('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x06d0=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatQueue'];(function(_0x2ff88e,_0x1341bd){var _0x18fcc6=function(_0x188f26){while(--_0x188f26){_0x2ff88e['push'](_0x2ff88e['shift']());}};_0x18fcc6(++_0x1341bd);}(_0x06d0,0xa0));var _0x006d=function(_0xef3547,_0x1bdde2){_0xef3547=_0xef3547-0x0;var _0x4eb3e3=_0x06d0[_0xef3547];return _0x4eb3e3;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x006d('0x0'))['db'][_0x006d('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x006d('0x2')](0x0);var events={'afterCreate':_0x006d('0x3'),'afterUpdate':_0x006d('0x4'),'afterDestroy':_0x006d('0x5')};function emitEvent(_0x344e6f){return function(_0x2e9f71,_0x2f37dd,_0x5bdbff){ChatQueueEvents[_0x006d('0x6')](_0x344e6f+':'+_0x2e9f71['id'],_0x2e9f71);ChatQueueEvents['emit'](_0x344e6f,_0x2e9f71);_0x5bdbff(null);};}for(var e in events){if(events[_0x006d('0x7')](e)){var event=events[e];ChatQueue[_0x006d('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index c4aa9bc..a89d076 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 _0xd618=['exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment'];(function(_0x5b4c44,_0x2e495e){var _0x58485a=function(_0x13299b){while(--_0x13299b){_0x5b4c44['push'](_0x5b4c44['shift']());}};_0x58485a(++_0x2e495e);}(_0xd618,0x185));var _0x8d61=function(_0x579823,_0x2a792a){_0x579823=_0x579823-0x0;var _0xd6481f=_0xd618[_0x579823];return _0xd6481f;};'use strict';var _=require(_0x8d61('0x0'));var util=require(_0x8d61('0x1'));var logger=require(_0x8d61('0x2'))(_0x8d61('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8d61('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d61('0x5'));var config=require(_0x8d61('0x6'));var attributes=require('./chatQueue.attributes');module[_0x8d61('0x7')]=function(_0x4eabb5,_0x2a1f15){return _0x4eabb5[_0x8d61('0x8')](_0x8d61('0x9'),attributes,{'tableName':_0x8d61('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe4b9=['../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe4b9,0xea));var _0x9e4b=function(_0x415346,_0x440efe){_0x415346=_0x415346-0x0;var _0x28661c=_0xe4b9[_0x415346];return _0x28661c;};'use strict';var _=require(_0x9e4b('0x0'));var util=require('util');var logger=require(_0x9e4b('0x1'))(_0x9e4b('0x2'));var moment=require('moment');var BPromise=require(_0x9e4b('0x3'));var rp=require(_0x9e4b('0x4'));var fs=require('fs');var path=require(_0x9e4b('0x5'));var rimraf=require('rimraf');var config=require(_0x9e4b('0x6'));var attributes=require(_0x9e4b('0x7'));module[_0x9e4b('0x8')]=function(_0x22747a,_0x4fa73c){return _0x22747a[_0x9e4b('0x9')](_0x9e4b('0xa'),attributes,{'tableName':_0x9e4b('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 1a82006..d324d0e 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 _0xfae3=['ChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue'];(function(_0x5b013d,_0xc7691c){var _0x2b6eef=function(_0x3143ca){while(--_0x3143ca){_0x5b013d['push'](_0x5b013d['shift']());}};_0x2b6eef(++_0xc7691c);}(_0xfae3,0xa1));var _0x3fae=function(_0x5aa17c,_0x5892b1){_0x5aa17c=_0x5aa17c-0x0;var _0x1d886b=_0xfae3[_0x5aa17c];return _0x1d886b;};'use strict';var _=require(_0x3fae('0x0'));var util=require(_0x3fae('0x1'));var moment=require(_0x3fae('0x2'));var BPromise=require(_0x3fae('0x3'));var rs=require(_0x3fae('0x4'));var fs=require('fs');var Redis=require(_0x3fae('0x5'));var db=require(_0x3fae('0x6'))['db'];var utils=require(_0x3fae('0x7'));var logger=require(_0x3fae('0x8'))(_0x3fae('0x9'));var config=require(_0x3fae('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3fae('0xb')][_0x3fae('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x3fae('0xd')],{'host':_0x3fae('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3fae('0xd')]));require(_0x3fae('0xf'))[_0x3fae('0x10')](socket);function respondWithRpcPromise(_0x145e13,_0x464cd8,_0xb60514){return new BPromise(function(_0x337e87,_0x1d729b){return client[_0x3fae('0x11')](_0x145e13,_0xb60514)[_0x3fae('0x12')](function(_0x40cbc1){logger[_0x3fae('0x13')](_0x3fae('0x14'),_0x464cd8,'request\x20sent');logger[_0x3fae('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x464cd8,_0x3fae('0x16'),JSON[_0x3fae('0x17')](_0x40cbc1));if(_0x40cbc1[_0x3fae('0x18')]){if(_0x40cbc1[_0x3fae('0x18')][_0x3fae('0x19')]===0x1f4){logger[_0x3fae('0x18')](_0x3fae('0x14'),_0x464cd8,_0x40cbc1[_0x3fae('0x18')][_0x3fae('0x1a')]);return _0x1d729b(_0x40cbc1[_0x3fae('0x18')][_0x3fae('0x1a')]);}logger[_0x3fae('0x18')](_0x3fae('0x14'),_0x464cd8,_0x40cbc1[_0x3fae('0x18')][_0x3fae('0x1a')]);return _0x337e87(_0x40cbc1[_0x3fae('0x18')][_0x3fae('0x1a')]);}else{logger[_0x3fae('0x13')](_0x3fae('0x14'),_0x464cd8,_0x3fae('0x16'));_0x337e87(_0x40cbc1['result']['message']);}})[_0x3fae('0x1b')](function(_0x271151){logger[_0x3fae('0x18')]('ChatQueue,\x20%s,\x20%s',_0x464cd8,_0x271151);_0x1d729b(_0x271151);});});}exports[_0x3fae('0x1c')]=function(_0x89ed35){var _0x4072fa=this;return new Promise(function(_0x34b21a,_0x4d2bf8){return db['ChatQueue'][_0x3fae('0x1d')]({'raw':_0x89ed35[_0x3fae('0x1e')]?_0x89ed35[_0x3fae('0x1e')][_0x3fae('0x1f')]===undefined?!![]:![]:!![],'where':_0x89ed35[_0x3fae('0x1e')]?_0x89ed35[_0x3fae('0x1e')][_0x3fae('0x20')]||null:null,'attributes':_0x89ed35[_0x3fae('0x1e')]?_0x89ed35[_0x3fae('0x1e')][_0x3fae('0x21')]||null:null,'limit':_0x89ed35[_0x3fae('0x1e')]?_0x89ed35[_0x3fae('0x1e')][_0x3fae('0x22')]||null:null,'include':_0x89ed35[_0x3fae('0x1e')]?_0x89ed35['options'][_0x3fae('0x23')]?_[_0x3fae('0x24')](_0x89ed35[_0x3fae('0x1e')][_0x3fae('0x23')],function(_0xc68eb2){return{'model':db[_0xc68eb2[_0x3fae('0x25')]],'as':_0xc68eb2['as'],'attributes':_0xc68eb2[_0x3fae('0x21')],'include':_0xc68eb2[_0x3fae('0x23')]?_[_0x3fae('0x24')](_0xc68eb2['include'],function(_0x153250){return{'model':db[_0x153250['model']],'as':_0x153250['as'],'attributes':_0x153250[_0x3fae('0x21')],'include':_0x153250[_0x3fae('0x23')]?_['map'](_0x153250[_0x3fae('0x23')],function(_0x3692d4){return{'model':db[_0x3692d4['model']],'as':_0x3692d4['as'],'attributes':_0x3692d4[_0x3fae('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3fae('0x12')](function(_0xca9920){logger[_0x3fae('0x13')](_0x3fae('0x1c'),_0x89ed35);logger[_0x3fae('0x15')](_0x3fae('0x1c'),_0x89ed35,JSON[_0x3fae('0x17')](_0xca9920));_0x34b21a(_0xca9920);})[_0x3fae('0x1b')](function(_0x23691c){logger[_0x3fae('0x18')]('GetChatQueue',_0x23691c[_0x3fae('0x1a')],_0x89ed35);_0x4d2bf8(_0x4072fa[_0x3fae('0x18')](0x1f4,_0x23691c[_0x3fae('0x1a')]));});});};exports[_0x3fae('0x26')]=function(_0x5a1bf3){var _0x14eaa6=this;return new Promise(function(_0x4d7cdd,_0x4fcc2d){return db[_0x3fae('0x27')]['find']({'raw':_0x5a1bf3['options']?_0x5a1bf3['options'][_0x3fae('0x1f')]===undefined?!![]:![]:!![],'where':_0x5a1bf3['options']?_0x5a1bf3[_0x3fae('0x1e')][_0x3fae('0x20')]||null:null,'attributes':_0x5a1bf3[_0x3fae('0x1e')]?_0x5a1bf3[_0x3fae('0x1e')][_0x3fae('0x21')]||null:null,'include':_0x5a1bf3['options']?_0x5a1bf3[_0x3fae('0x1e')][_0x3fae('0x23')]?_[_0x3fae('0x24')](_0x5a1bf3[_0x3fae('0x1e')][_0x3fae('0x23')],function(_0x572e98){return{'model':db[_0x572e98[_0x3fae('0x25')]],'as':_0x572e98['as'],'attributes':_0x572e98[_0x3fae('0x21')],'include':_0x572e98[_0x3fae('0x23')]?_[_0x3fae('0x24')](_0x572e98[_0x3fae('0x23')],function(_0x4efbb6){return{'model':db[_0x4efbb6[_0x3fae('0x25')]],'as':_0x4efbb6['as'],'attributes':_0x4efbb6['attributes'],'include':_0x4efbb6[_0x3fae('0x23')]?_[_0x3fae('0x24')](_0x4efbb6[_0x3fae('0x23')],function(_0x5b9c7e){return{'model':db[_0x5b9c7e[_0x3fae('0x25')]],'as':_0x5b9c7e['as'],'attributes':_0x5b9c7e[_0x3fae('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3fae('0x12')](function(_0x5597eb){logger['info'](_0x3fae('0x26'),_0x5a1bf3);logger[_0x3fae('0x15')](_0x3fae('0x26'),_0x5a1bf3,JSON['stringify'](_0x5597eb));_0x4d7cdd(_0x5597eb);})[_0x3fae('0x1b')](function(_0x377967){logger[_0x3fae('0x18')](_0x3fae('0x26'),_0x377967['message'],_0x5a1bf3);_0x4fcc2d(_0x14eaa6[_0x3fae('0x18')](0x1f4,_0x377967[_0x3fae('0x1a')]));});});};
\ No newline at end of file
+var _0xa866=['then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','result','ChatQueue','findAll','options','where','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register'];(function(_0x4aeb18,_0x3406ca){var _0x1fa4f1=function(_0x27557a){while(--_0x27557a){_0x4aeb18['push'](_0x4aeb18['shift']());}};_0x1fa4f1(++_0x3406ca);}(_0xa866,0x6a));var _0x6a86=function(_0x314c18,_0x1cee4c){_0x314c18=_0x314c18-0x0;var _0x48399d=_0xa866[_0x314c18];return _0x48399d;};'use strict';var _=require(_0x6a86('0x0'));var util=require(_0x6a86('0x1'));var moment=require(_0x6a86('0x2'));var BPromise=require(_0x6a86('0x3'));var rs=require(_0x6a86('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a86('0x5'))['db'];var utils=require(_0x6a86('0x6'));var logger=require(_0x6a86('0x7'))('rpc');var config=require(_0x6a86('0x8'));var jayson=require(_0x6a86('0x9'));var client=jayson[_0x6a86('0xa')]['http']({'port':0x232a});config[_0x6a86('0xb')]=_[_0x6a86('0xc')](config[_0x6a86('0xb')],{'host':_0x6a86('0xd'),'port':0x18eb});var socket=require(_0x6a86('0xe'))(new Redis(config[_0x6a86('0xb')]));require(_0x6a86('0xf'))[_0x6a86('0x10')](socket);function respondWithRpcPromise(_0x21712d,_0x5355b7,_0x3435a8){return new BPromise(function(_0x1a4548,_0x100925){return client['request'](_0x21712d,_0x3435a8)[_0x6a86('0x11')](function(_0x1797e8){logger['info']('ChatQueue,\x20%s,\x20%s',_0x5355b7,_0x6a86('0x12'));logger[_0x6a86('0x13')](_0x6a86('0x14'),_0x5355b7,_0x6a86('0x12'),JSON[_0x6a86('0x15')](_0x1797e8));if(_0x1797e8[_0x6a86('0x16')]){if(_0x1797e8[_0x6a86('0x16')][_0x6a86('0x17')]===0x1f4){logger['error'](_0x6a86('0x18'),_0x5355b7,_0x1797e8[_0x6a86('0x16')]['message']);return _0x100925(_0x1797e8[_0x6a86('0x16')][_0x6a86('0x19')]);}logger[_0x6a86('0x16')](_0x6a86('0x18'),_0x5355b7,_0x1797e8[_0x6a86('0x16')][_0x6a86('0x19')]);return _0x1a4548(_0x1797e8['error'][_0x6a86('0x19')]);}else{logger[_0x6a86('0x1a')]('ChatQueue,\x20%s,\x20%s',_0x5355b7,'request\x20sent');_0x1a4548(_0x1797e8[_0x6a86('0x1b')]['message']);}})['catch'](function(_0x1fe0b5){logger[_0x6a86('0x16')](_0x6a86('0x18'),_0x5355b7,_0x1fe0b5);_0x100925(_0x1fe0b5);});});}exports['GetChatQueue']=function(_0x2bbcc8){var _0x22a573=this;return new Promise(function(_0x1db4ad,_0x262bf5){return db[_0x6a86('0x1c')][_0x6a86('0x1d')]({'raw':_0x2bbcc8['options']?_0x2bbcc8['options']['raw']===undefined?!![]:![]:!![],'where':_0x2bbcc8[_0x6a86('0x1e')]?_0x2bbcc8[_0x6a86('0x1e')][_0x6a86('0x1f')]||null:null,'attributes':_0x2bbcc8[_0x6a86('0x1e')]?_0x2bbcc8['options'][_0x6a86('0x20')]||null:null,'limit':_0x2bbcc8[_0x6a86('0x1e')]?_0x2bbcc8[_0x6a86('0x1e')][_0x6a86('0x21')]||null:null,'include':_0x2bbcc8[_0x6a86('0x1e')]?_0x2bbcc8[_0x6a86('0x1e')][_0x6a86('0x22')]?_[_0x6a86('0x23')](_0x2bbcc8[_0x6a86('0x1e')]['include'],function(_0x5190c9){return{'model':db[_0x5190c9[_0x6a86('0x24')]],'as':_0x5190c9['as'],'attributes':_0x5190c9['attributes'],'include':_0x5190c9[_0x6a86('0x22')]?_[_0x6a86('0x23')](_0x5190c9['include'],function(_0xbfe923){return{'model':db[_0xbfe923[_0x6a86('0x24')]],'as':_0xbfe923['as'],'attributes':_0xbfe923[_0x6a86('0x20')],'include':_0xbfe923['include']?_[_0x6a86('0x23')](_0xbfe923['include'],function(_0x5a77e6){return{'model':db[_0x5a77e6['model']],'as':_0x5a77e6['as'],'attributes':_0x5a77e6[_0x6a86('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6a86('0x11')](function(_0x14359b){logger['info'](_0x6a86('0x25'),_0x2bbcc8);logger[_0x6a86('0x13')](_0x6a86('0x25'),_0x2bbcc8,JSON[_0x6a86('0x15')](_0x14359b));_0x1db4ad(_0x14359b);})['catch'](function(_0x1f7853){logger['error'](_0x6a86('0x25'),_0x1f7853[_0x6a86('0x19')],_0x2bbcc8);_0x262bf5(_0x22a573[_0x6a86('0x16')](0x1f4,_0x1f7853[_0x6a86('0x19')]));});});};exports[_0x6a86('0x26')]=function(_0x5a2925){var _0x155054=this;return new Promise(function(_0x350524,_0x51b789){return db[_0x6a86('0x1c')][_0x6a86('0x27')]({'raw':_0x5a2925['options']?_0x5a2925[_0x6a86('0x1e')][_0x6a86('0x28')]===undefined?!![]:![]:!![],'where':_0x5a2925['options']?_0x5a2925['options'][_0x6a86('0x1f')]||null:null,'attributes':_0x5a2925[_0x6a86('0x1e')]?_0x5a2925['options']['attributes']||null:null,'include':_0x5a2925[_0x6a86('0x1e')]?_0x5a2925['options'][_0x6a86('0x22')]?_['map'](_0x5a2925[_0x6a86('0x1e')]['include'],function(_0x350ce7){return{'model':db[_0x350ce7['model']],'as':_0x350ce7['as'],'attributes':_0x350ce7[_0x6a86('0x20')],'include':_0x350ce7[_0x6a86('0x22')]?_[_0x6a86('0x23')](_0x350ce7[_0x6a86('0x22')],function(_0x4c11f0){return{'model':db[_0x4c11f0[_0x6a86('0x24')]],'as':_0x4c11f0['as'],'attributes':_0x4c11f0[_0x6a86('0x20')],'include':_0x4c11f0[_0x6a86('0x22')]?_['map'](_0x4c11f0[_0x6a86('0x22')],function(_0x17a496){return{'model':db[_0x17a496['model']],'as':_0x17a496['as'],'attributes':_0x17a496[_0x6a86('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6a86('0x11')](function(_0x556d61){logger[_0x6a86('0x1a')]('ShowChatQueue',_0x5a2925);logger['debug'](_0x6a86('0x26'),_0x5a2925,JSON['stringify'](_0x556d61));_0x350524(_0x556d61);})['catch'](function(_0x518742){logger[_0x6a86('0x16')](_0x6a86('0x26'),_0x518742['message'],_0x5a2925);_0x51b789(_0x155054['error'](0x1f4,_0x518742[_0x6a86('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index b24f062..ad3d031 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 _0x84ab=['update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove'];(function(_0x6801d4,_0x2836dc){var _0x4c829b=function(_0x306129){while(--_0x306129){_0x6801d4['push'](_0x6801d4['shift']());}};_0x4c829b(++_0x2836dc);}(_0x84ab,0x12f));var _0xb84a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x84ab[_0x20a584];return _0x4b41a8;};'use strict';var ChatQueueEvents=require(_0xb84a('0x0'));var events=[_0xb84a('0x1'),_0xb84a('0x2'),_0xb84a('0x3')];function createListener(_0x473c3,_0x512f13){return function(_0xc83587){_0x512f13[_0xb84a('0x4')](_0x473c3,_0xc83587);};}function removeListener(_0x47b8e3,_0x9d3a00){return function(){ChatQueueEvents[_0xb84a('0x5')](_0x47b8e3,_0x9d3a00);};}exports[_0xb84a('0x6')]=function(_0x5b9def){for(var _0x521a64=0x0,_0x4dc496=events[_0xb84a('0x7')];_0x521a64<_0x4dc496;_0x521a64++){var _0x4fac4d=events[_0x521a64];var _0x3e9086=createListener(_0xb84a('0x8')+_0x4fac4d,_0x5b9def);ChatQueueEvents['on'](_0x4fac4d,_0x3e9086);}};
\ No newline at end of file
+var _0xe14d=['update','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x4a5585,_0x574093){var _0x2cce37=function(_0x914d94){while(--_0x914d94){_0x4a5585['push'](_0x4a5585['shift']());}};_0x2cce37(++_0x574093);}(_0xe14d,0x1ee));var _0xde14=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xe14d[_0x5c351c];return _0x26f3b3;};'use strict';var ChatQueueEvents=require(_0xde14('0x0'));var events=[_0xde14('0x1'),_0xde14('0x2'),_0xde14('0x3')];function createListener(_0x48b392,_0x1c5b4){return function(_0x28965b){_0x1c5b4['emit'](_0x48b392,_0x28965b);};}function removeListener(_0x1c3e94,_0x13c24e){return function(){ChatQueueEvents[_0xde14('0x4')](_0x1c3e94,_0x13c24e);};}exports[_0xde14('0x5')]=function(_0x461af3){for(var _0xba1514=0x0,_0x4b1f6b=events['length'];_0xba1514<_0x4b1f6b;_0xba1514++){var _0x1bd49d=events[_0xba1514];var _0x115b7d=createListener(_0xde14('0x6')+_0x1bd49d,_0x461af3);ChatQueueEvents['on'](_0x1bd49d,_0x115b7d);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 119a3ea..1b24200 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1fcc64,_0x438525){var _0x3101a9=function(_0x56e2b1){while(--_0x56e2b1){_0x1fcc64['push'](_0x1fcc64['shift']());}};_0x3101a9(++_0x438525);}(_0x008c,0x188));var _0xc008=function(_0x474035,_0x41e639){_0x474035=_0x474035-0x0;var _0x1b58e0=_0x008c[_0x474035];return _0x1b58e0;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x325022,_0xa005cf){var _0x2f18c2=function(_0x48f5f5){while(--_0x48f5f5){_0x325022['push'](_0x325022['shift']());}};_0x2f18c2(++_0xa005cf);}(_0x008c,0x188));var _0xc008=function(_0x4090cd,_0x55a2f0){_0x4090cd=_0x4090cd-0x0;var _0x522fbe=_0x008c[_0x4090cd];return _0x522fbe;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 1c49755..916df01 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 _0x11a6=['STRING','DATE','moment','sequelize','exports'];(function(_0x5051ea,_0x795739){var _0x4d8457=function(_0x5a9b1d){while(--_0x5a9b1d){_0x5051ea['push'](_0x5051ea['shift']());}};_0x4d8457(++_0x795739);}(_0x11a6,0xfc));var _0x611a=function(_0x35853a,_0x27930e){_0x35853a=_0x35853a-0x0;var _0x4d7ca7=_0x11a6[_0x35853a];return _0x4d7ca7;};'use strict';var moment=require(_0x611a('0x0'));var Sequelize=require(_0x611a('0x1'));module[_0x611a('0x2')]={'uniqueid':{'type':Sequelize[_0x611a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x611a('0x3')]},'joinAt':{'type':Sequelize[_0x611a('0x4')]},'leaveAt':{'type':Sequelize[_0x611a('0x4')]},'acceptAt':{'type':Sequelize[_0x611a('0x4')]},'exitAt':{'type':Sequelize[_0x611a('0x4')]},'reason':{'type':Sequelize[_0x611a('0x3')]}};
\ No newline at end of file
+var _0xadf6=['moment','sequelize','exports','STRING','DATE'];(function(_0x553590,_0x14e49c){var _0x13651d=function(_0x5a3dc2){while(--_0x5a3dc2){_0x553590['push'](_0x553590['shift']());}};_0x13651d(++_0x14e49c);}(_0xadf6,0x78));var _0x6adf=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xadf6[_0x2ec461];return _0x28603d;};'use strict';var moment=require(_0x6adf('0x0'));var Sequelize=require(_0x6adf('0x1'));module[_0x6adf('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x6adf('0x3')]},'joinAt':{'type':Sequelize[_0x6adf('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x6adf('0x4')]},'exitAt':{'type':Sequelize[_0x6adf('0x4')]},'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 068cb14..3a1e751 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 _0x649f=['body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','name','send','index','map','rawAttributes','type','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueueReport','includeAll','include','findAll','rows','catch','params','intersection','find','create'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0x649f,0x93));var _0xf649=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x649f[_0xda464c];return _0x19e222;};'use strict';var emlformat=require(_0xf649('0x0'));var rimraf=require(_0xf649('0x1'));var zipdir=require(_0xf649('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf649('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf649('0x4'));var util=require(_0xf649('0x5'));var path=require(_0xf649('0x6'));var sox=require(_0xf649('0x7'));var csv=require(_0xf649('0x8'));var ejs=require(_0xf649('0x9'));var fs=require('fs');var fs_extra=require(_0xf649('0xa'));var _=require(_0xf649('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf649('0xc'));var deskjs=require(_0xf649('0xd'));var toCsv=require(_0xf649('0x8'));var querystring=require('querystring');var Papa=require(_0xf649('0xe'));var Redis=require(_0xf649('0xf'));var authService=require(_0xf649('0x10'));var qs=require(_0xf649('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf649('0x12'));var logger=require(_0xf649('0x13'))(_0xf649('0x14'));var utils=require(_0xf649('0x15'));var config=require(_0xf649('0x16'));var licenseUtil=require(_0xf649('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3afac6,_0x541e95){_0x541e95=_0x541e95||0xcc;return function(_0x5e6e7d){if(_0x5e6e7d){return _0x3afac6[_0xf649('0x18')](_0x541e95);}return _0x3afac6[_0xf649('0x19')](_0x541e95)[_0xf649('0x1a')]();};}function respondWithResult(_0xcf02d8,_0x180ade){_0x180ade=_0x180ade||0xc8;return function(_0x1c2fe8){if(_0x1c2fe8){return _0xcf02d8[_0xf649('0x19')](_0x180ade)[_0xf649('0x1b')](_0x1c2fe8);}};}function respondWithFilteredResult(_0x596fd9,_0x1980b3){return function(_0x1d6fe4){if(_0x1d6fe4){var _0x5aac14=typeof _0x1980b3[_0xf649('0x1c')]===_0xf649('0x1d')&&typeof _0x1980b3[_0xf649('0x1e')]==='undefined';var _0x5b536f=_0x1d6fe4[_0xf649('0x1f')];var _0x1e1740=_0x5aac14?0x0:_0x1980b3[_0xf649('0x1c')];var _0x4156fc=_0x5aac14?_0x1d6fe4[_0xf649('0x1f')]:_0x1980b3[_0xf649('0x1c')]+_0x1980b3[_0xf649('0x1e')];var _0x4c5899;if(_0x4156fc>=_0x5b536f){_0x4156fc=_0x5b536f;_0x4c5899=0xc8;}else{_0x4c5899=0xce;}_0x596fd9[_0xf649('0x19')](_0x4c5899);return _0x596fd9[_0xf649('0x20')](_0xf649('0x21'),_0x1e1740+'-'+_0x4156fc+'/'+_0x5b536f)[_0xf649('0x1b')](_0x1d6fe4);}return null;};}function patchUpdates(_0x294c22){return function(_0x80db46){try{jsonpatch[_0xf649('0x22')](_0x80db46,_0x294c22,!![]);}catch(_0x6cfc72){return BPromise[_0xf649('0x23')](_0x6cfc72);}return _0x80db46[_0xf649('0x24')]();};}function saveUpdates(_0x28e98e,_0x51be40){return function(_0x472598){if(_0x472598){return _0x472598['update'](_0x28e98e)[_0xf649('0x25')](function(_0x1e0d54){return _0x1e0d54;});}return null;};}function removeEntity(_0x3c9fb3,_0xd939e0){return function(_0x1d1df9){if(_0x1d1df9){return _0x1d1df9[_0xf649('0x26')]()[_0xf649('0x25')](function(){_0x3c9fb3[_0xf649('0x19')](0xcc)[_0xf649('0x1a')]();});}};}function handleEntityNotFound(_0x214d2a,_0x48a50d){return function(_0x1b0f03){if(!_0x1b0f03){_0x214d2a['sendStatus'](0x194);}return _0x1b0f03;};}function handleError(_0x555b58,_0x2ade00){_0x2ade00=_0x2ade00||0x1f4;return function(_0x32fa5f){logger['error'](_0x32fa5f['stack']);if(_0x32fa5f['name']){delete _0x32fa5f[_0xf649('0x27')];}_0x555b58[_0xf649('0x19')](_0x2ade00)[_0xf649('0x28')](_0x32fa5f);};}exports[_0xf649('0x29')]=function(_0x335bde,_0x42e8cd){var _0xef0b39={},_0x283147={},_0x4479ec={'count':0x0,'rows':[]};var _0x153b3e=_[_0xf649('0x2a')](db['ChatQueueReport'][_0xf649('0x2b')],function(_0x39c4da){return{'name':_0x39c4da['fieldName'],'type':_0x39c4da[_0xf649('0x2c')]['key']};});_0x283147['model']=_[_0xf649('0x2a')](_0x153b3e,_0xf649('0x27'));_0x283147[_0xf649('0x2d')]=_[_0xf649('0x2e')](_0x335bde[_0xf649('0x2d')]);_0x283147[_0xf649('0x2f')]=_['intersection'](_0x283147[_0xf649('0x30')],_0x283147[_0xf649('0x2d')]);_0xef0b39[_0xf649('0x31')]=_['intersection'](_0x283147['model'],qs[_0xf649('0x32')](_0x335bde[_0xf649('0x2d')][_0xf649('0x32')]));_0xef0b39[_0xf649('0x31')]=_0xef0b39['attributes'][_0xf649('0x33')]?_0xef0b39[_0xf649('0x31')]:_0x283147[_0xf649('0x30')];if(!_0x335bde[_0xf649('0x2d')][_0xf649('0x34')](_0xf649('0x35'))){_0xef0b39[_0xf649('0x1e')]=qs[_0xf649('0x1e')](_0x335bde[_0xf649('0x2d')][_0xf649('0x1e')]);_0xef0b39[_0xf649('0x1c')]=qs['offset'](_0x335bde[_0xf649('0x2d')]['offset']);}_0xef0b39[_0xf649('0x36')]=qs[_0xf649('0x37')](_0x335bde[_0xf649('0x2d')][_0xf649('0x37')]);_0xef0b39[_0xf649('0x38')]=qs[_0xf649('0x2f')](_[_0xf649('0x39')](_0x335bde[_0xf649('0x2d')],_0x283147['filters']),_0x153b3e);if(_0x335bde[_0xf649('0x2d')][_0xf649('0x3a')]){_0xef0b39['where']=_[_0xf649('0x3b')](_0xef0b39[_0xf649('0x38')],{'$or':_[_0xf649('0x2a')](_0x153b3e,function(_0x619450){if(_0x619450['type']!==_0xf649('0x3c')){var _0xdbe960={};_0xdbe960[_0x619450[_0xf649('0x27')]]={'$like':'%'+_0x335bde[_0xf649('0x2d')][_0xf649('0x3a')]+'%'};return _0xdbe960;}})});}_0xef0b39=_[_0xf649('0x3b')]({},_0xef0b39,_0x335bde[_0xf649('0x3d')]);var _0x33d168={'where':_0xef0b39[_0xf649('0x38')]};return db[_0xf649('0x3e')][_0xf649('0x1f')](_0x33d168)[_0xf649('0x25')](function(_0x578bfc){_0x4479ec['count']=_0x578bfc;if(_0x335bde[_0xf649('0x2d')][_0xf649('0x3f')]){_0xef0b39[_0xf649('0x40')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xf649('0x41')](_0xef0b39);})['then'](function(_0x2f2a0a){_0x4479ec[_0xf649('0x42')]=_0x2f2a0a;return _0x4479ec;})[_0xf649('0x25')](respondWithFilteredResult(_0x42e8cd,_0xef0b39))[_0xf649('0x43')](handleError(_0x42e8cd,null));};exports['show']=function(_0x5dd5ad,_0xdf8dd6){var _0x20ceaa={'raw':!![],'where':{'id':_0x5dd5ad[_0xf649('0x44')]['id']}},_0x6e094c={};_0x6e094c[_0xf649('0x30')]=_[_0xf649('0x2e')](db[_0xf649('0x3e')][_0xf649('0x2b')]);_0x6e094c[_0xf649('0x2d')]=_[_0xf649('0x2e')](_0x5dd5ad['query']);_0x6e094c[_0xf649('0x2f')]=_['intersection'](_0x6e094c[_0xf649('0x30')],_0x6e094c[_0xf649('0x2d')]);_0x20ceaa[_0xf649('0x31')]=_[_0xf649('0x45')](_0x6e094c[_0xf649('0x30')],qs[_0xf649('0x32')](_0x5dd5ad[_0xf649('0x2d')]['fields']));_0x20ceaa[_0xf649('0x31')]=_0x20ceaa[_0xf649('0x31')][_0xf649('0x33')]?_0x20ceaa[_0xf649('0x31')]:_0x6e094c[_0xf649('0x30')];if(_0x5dd5ad[_0xf649('0x2d')]['includeAll']){_0x20ceaa['include']=[{'all':!![]}];}_0x20ceaa=_['merge']({},_0x20ceaa,_0x5dd5ad[_0xf649('0x3d')]);return db[_0xf649('0x3e')][_0xf649('0x46')](_0x20ceaa)['then'](handleEntityNotFound(_0xdf8dd6,null))[_0xf649('0x25')](respondWithResult(_0xdf8dd6,null))[_0xf649('0x43')](handleError(_0xdf8dd6,null));};exports[_0xf649('0x47')]=function(_0x2e9164,_0x3305f3){return db[_0xf649('0x3e')][_0xf649('0x47')](_0x2e9164[_0xf649('0x48')],{})[_0xf649('0x25')](respondWithResult(_0x3305f3,0xc9))['catch'](handleError(_0x3305f3,null));};exports['update']=function(_0x1c6c23,_0x18c6c6){if(_0x1c6c23['body']['id']){delete _0x1c6c23['body']['id'];}return db[_0xf649('0x3e')]['find']({'where':{'id':_0x1c6c23[_0xf649('0x44')]['id']}})[_0xf649('0x25')](handleEntityNotFound(_0x18c6c6,null))[_0xf649('0x25')](saveUpdates(_0x1c6c23['body'],null))['then'](respondWithResult(_0x18c6c6,null))['catch'](handleError(_0x18c6c6,null));};exports['destroy']=function(_0x469f50,_0x165b5f){return db[_0xf649('0x3e')]['find']({'where':{'id':_0x469f50[_0xf649('0x44')]['id']}})['then'](handleEntityNotFound(_0x165b5f,null))[_0xf649('0x25')](removeEntity(_0x165b5f,null))['catch'](handleError(_0x165b5f,null));};exports['describe']=function(_0x1d1b68,_0x3bef52){return db[_0xf649('0x3e')]['describe']()[_0xf649('0x25')](respondWithResult(_0x3bef52,null))['catch'](handleError(_0x3bef52,null));};
\ No newline at end of file
+var _0xe626=['keys','rawAttributes','intersection','length','options','find','create','body','catch','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','type','model','map','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','ChatQueueReport','includeAll','include','findAll','rows','show'];(function(_0x50e691,_0x24048e){var _0x54e8a7=function(_0x4cef52){while(--_0x4cef52){_0x50e691['push'](_0x50e691['shift']());}};_0x54e8a7(++_0x24048e);}(_0xe626,0x9d));var _0x6e62=function(_0x403437,_0x2265a8){_0x403437=_0x403437-0x0;var _0x37e405=_0xe626[_0x403437];return _0x37e405;};'use strict';var emlformat=require(_0x6e62('0x0'));var rimraf=require(_0x6e62('0x1'));var zipdir=require(_0x6e62('0x2'));var jsonpatch=require(_0x6e62('0x3'));var rp=require('request-promise');var moment=require(_0x6e62('0x4'));var BPromise=require(_0x6e62('0x5'));var Mustache=require(_0x6e62('0x6'));var util=require(_0x6e62('0x7'));var path=require(_0x6e62('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e62('0x9'));var _=require(_0x6e62('0xa'));var squel=require('squel');var crypto=require(_0x6e62('0xb'));var jsforce=require(_0x6e62('0xc'));var deskjs=require(_0x6e62('0xd'));var toCsv=require(_0x6e62('0xe'));var querystring=require('querystring');var Papa=require(_0x6e62('0xf'));var Redis=require(_0x6e62('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6e62('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e62('0x12'));var logger=require('../../config/logger')(_0x6e62('0x13'));var utils=require('../../config/utils');var config=require(_0x6e62('0x14'));var licenseUtil=require(_0x6e62('0x15'));var db=require(_0x6e62('0x16'))['db'];function respondWithStatusCode(_0x43e3d4,_0x3c3af1){_0x3c3af1=_0x3c3af1||0xcc;return function(_0x1c266b){if(_0x1c266b){return _0x43e3d4[_0x6e62('0x17')](_0x3c3af1);}return _0x43e3d4['status'](_0x3c3af1)['end']();};}function respondWithResult(_0x44b131,_0x3b980d){_0x3b980d=_0x3b980d||0xc8;return function(_0x5328fe){if(_0x5328fe){return _0x44b131[_0x6e62('0x18')](_0x3b980d)[_0x6e62('0x19')](_0x5328fe);}};}function respondWithFilteredResult(_0x19a80d,_0x3f4e35){return function(_0x58d84e){if(_0x58d84e){var _0x416158=typeof _0x3f4e35[_0x6e62('0x1a')]===_0x6e62('0x1b')&&typeof _0x3f4e35[_0x6e62('0x1c')]===_0x6e62('0x1b');var _0x31b304=_0x58d84e[_0x6e62('0x1d')];var _0x45d7ee=_0x416158?0x0:_0x3f4e35[_0x6e62('0x1a')];var _0x15bce5=_0x416158?_0x58d84e['count']:_0x3f4e35[_0x6e62('0x1a')]+_0x3f4e35[_0x6e62('0x1c')];var _0x55ce3b;if(_0x15bce5>=_0x31b304){_0x15bce5=_0x31b304;_0x55ce3b=0xc8;}else{_0x55ce3b=0xce;}_0x19a80d[_0x6e62('0x18')](_0x55ce3b);return _0x19a80d['set'](_0x6e62('0x1e'),_0x45d7ee+'-'+_0x15bce5+'/'+_0x31b304)[_0x6e62('0x19')](_0x58d84e);}return null;};}function patchUpdates(_0x2e162e){return function(_0x270405){try{jsonpatch[_0x6e62('0x1f')](_0x270405,_0x2e162e,!![]);}catch(_0x77c5f9){return BPromise[_0x6e62('0x20')](_0x77c5f9);}return _0x270405[_0x6e62('0x21')]();};}function saveUpdates(_0x3f9067,_0x421d13){return function(_0x1954dc){if(_0x1954dc){return _0x1954dc['update'](_0x3f9067)[_0x6e62('0x22')](function(_0x52d5e7){return _0x52d5e7;});}return null;};}function removeEntity(_0x183469,_0x3dad96){return function(_0x345af8){if(_0x345af8){return _0x345af8[_0x6e62('0x23')]()[_0x6e62('0x22')](function(){_0x183469[_0x6e62('0x18')](0xcc)[_0x6e62('0x24')]();});}};}function handleEntityNotFound(_0x3a1683,_0x2e4fe1){return function(_0x448691){if(!_0x448691){_0x3a1683['sendStatus'](0x194);}return _0x448691;};}function handleError(_0x33f81c,_0x555793){_0x555793=_0x555793||0x1f4;return function(_0x2f9c68){logger[_0x6e62('0x25')](_0x2f9c68[_0x6e62('0x26')]);if(_0x2f9c68[_0x6e62('0x27')]){delete _0x2f9c68[_0x6e62('0x27')];}_0x33f81c[_0x6e62('0x18')](_0x555793)['send'](_0x2f9c68);};}exports[_0x6e62('0x28')]=function(_0x26c991,_0x14cd51){var _0x50ba00={},_0x58afab={},_0x191df5={'count':0x0,'rows':[]};var _0x50813d=_['map'](db['ChatQueueReport']['rawAttributes'],function(_0x17f634){return{'name':_0x17f634['fieldName'],'type':_0x17f634[_0x6e62('0x29')]['key']};});_0x58afab[_0x6e62('0x2a')]=_[_0x6e62('0x2b')](_0x50813d,_0x6e62('0x27'));_0x58afab['query']=_['keys'](_0x26c991[_0x6e62('0x2c')]);_0x58afab[_0x6e62('0x2d')]=_['intersection'](_0x58afab['model'],_0x58afab['query']);_0x50ba00[_0x6e62('0x2e')]=_['intersection'](_0x58afab[_0x6e62('0x2a')],qs[_0x6e62('0x2f')](_0x26c991[_0x6e62('0x2c')][_0x6e62('0x2f')]));_0x50ba00[_0x6e62('0x2e')]=_0x50ba00['attributes']['length']?_0x50ba00[_0x6e62('0x2e')]:_0x58afab[_0x6e62('0x2a')];if(!_0x26c991[_0x6e62('0x2c')][_0x6e62('0x30')](_0x6e62('0x31'))){_0x50ba00[_0x6e62('0x1c')]=qs[_0x6e62('0x1c')](_0x26c991[_0x6e62('0x2c')][_0x6e62('0x1c')]);_0x50ba00['offset']=qs[_0x6e62('0x1a')](_0x26c991[_0x6e62('0x2c')][_0x6e62('0x1a')]);}_0x50ba00['order']=qs[_0x6e62('0x32')](_0x26c991[_0x6e62('0x2c')]['sort']);_0x50ba00[_0x6e62('0x33')]=qs[_0x6e62('0x2d')](_[_0x6e62('0x34')](_0x26c991[_0x6e62('0x2c')],_0x58afab[_0x6e62('0x2d')]),_0x50813d);if(_0x26c991['query'][_0x6e62('0x35')]){_0x50ba00[_0x6e62('0x33')]=_[_0x6e62('0x36')](_0x50ba00[_0x6e62('0x33')],{'$or':_[_0x6e62('0x2b')](_0x50813d,function(_0x4900b0){if(_0x4900b0[_0x6e62('0x29')]!==_0x6e62('0x37')){var _0x234710={};_0x234710[_0x4900b0['name']]={'$like':'%'+_0x26c991[_0x6e62('0x2c')][_0x6e62('0x35')]+'%'};return _0x234710;}})});}_0x50ba00=_['merge']({},_0x50ba00,_0x26c991['options']);var _0x13728c={'where':_0x50ba00[_0x6e62('0x33')]};return db[_0x6e62('0x38')]['count'](_0x13728c)['then'](function(_0x1ef318){_0x191df5['count']=_0x1ef318;if(_0x26c991['query'][_0x6e62('0x39')]){_0x50ba00[_0x6e62('0x3a')]=[{'all':!![]}];}return db[_0x6e62('0x38')][_0x6e62('0x3b')](_0x50ba00);})[_0x6e62('0x22')](function(_0x58ac40){_0x191df5[_0x6e62('0x3c')]=_0x58ac40;return _0x191df5;})['then'](respondWithFilteredResult(_0x14cd51,_0x50ba00))['catch'](handleError(_0x14cd51,null));};exports[_0x6e62('0x3d')]=function(_0x469fa1,_0x940288){var _0x5352d3={'raw':!![],'where':{'id':_0x469fa1['params']['id']}},_0x1a7e7f={};_0x1a7e7f[_0x6e62('0x2a')]=_[_0x6e62('0x3e')](db[_0x6e62('0x38')][_0x6e62('0x3f')]);_0x1a7e7f[_0x6e62('0x2c')]=_[_0x6e62('0x3e')](_0x469fa1[_0x6e62('0x2c')]);_0x1a7e7f[_0x6e62('0x2d')]=_[_0x6e62('0x40')](_0x1a7e7f[_0x6e62('0x2a')],_0x1a7e7f['query']);_0x5352d3['attributes']=_['intersection'](_0x1a7e7f[_0x6e62('0x2a')],qs['fields'](_0x469fa1[_0x6e62('0x2c')][_0x6e62('0x2f')]));_0x5352d3['attributes']=_0x5352d3[_0x6e62('0x2e')][_0x6e62('0x41')]?_0x5352d3[_0x6e62('0x2e')]:_0x1a7e7f[_0x6e62('0x2a')];if(_0x469fa1[_0x6e62('0x2c')][_0x6e62('0x39')]){_0x5352d3[_0x6e62('0x3a')]=[{'all':!![]}];}_0x5352d3=_[_0x6e62('0x36')]({},_0x5352d3,_0x469fa1[_0x6e62('0x42')]);return db[_0x6e62('0x38')][_0x6e62('0x43')](_0x5352d3)[_0x6e62('0x22')](handleEntityNotFound(_0x940288,null))[_0x6e62('0x22')](respondWithResult(_0x940288,null))['catch'](handleError(_0x940288,null));};exports[_0x6e62('0x44')]=function(_0x158c75,_0x57c6d1){return db[_0x6e62('0x38')]['create'](_0x158c75[_0x6e62('0x45')],{})[_0x6e62('0x22')](respondWithResult(_0x57c6d1,0xc9))[_0x6e62('0x46')](handleError(_0x57c6d1,null));};exports['update']=function(_0x447fc2,_0x4745a3){if(_0x447fc2[_0x6e62('0x45')]['id']){delete _0x447fc2[_0x6e62('0x45')]['id'];}return db[_0x6e62('0x38')][_0x6e62('0x43')]({'where':{'id':_0x447fc2[_0x6e62('0x47')]['id']}})[_0x6e62('0x22')](handleEntityNotFound(_0x4745a3,null))[_0x6e62('0x22')](saveUpdates(_0x447fc2[_0x6e62('0x45')],null))[_0x6e62('0x22')](respondWithResult(_0x4745a3,null))['catch'](handleError(_0x4745a3,null));};exports['destroy']=function(_0x2d7732,_0xe6f92d){return db[_0x6e62('0x38')][_0x6e62('0x43')]({'where':{'id':_0x2d7732[_0x6e62('0x47')]['id']}})[_0x6e62('0x22')](handleEntityNotFound(_0xe6f92d,null))['then'](removeEntity(_0xe6f92d,null))[_0x6e62('0x46')](handleError(_0xe6f92d,null));};exports['describe']=function(_0x28bcb3,_0xead50c){return db[_0x6e62('0x38')][_0x6e62('0x48')]()[_0x6e62('0x22')](respondWithResult(_0xead50c,null))['catch'](handleError(_0xead50c,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 67e5136..f1f67d8 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(_0x4c16b9,_0x3d3f24){var _0x2d25f7=function(_0x4cea4b){while(--_0x4cea4b){_0x4c16b9['push'](_0x4c16b9['shift']());}};_0x2d25f7(++_0x3d3f24);}(_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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x3c2202,_0x5b6da3){var _0x1574bf=function(_0x200e67){while(--_0x200e67){_0x3c2202['push'](_0x3c2202['shift']());}};_0x1574bf(++_0x5b6da3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0xcb91[_0x3ce2c4];return _0x4047c1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 59de502..d2ed307 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 _0x680f=['raw','stringify','update','UpdateChatQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options'];(function(_0x4d2263,_0x3fbf0d){var _0x24aba0=function(_0x389a59){while(--_0x389a59){_0x4d2263['push'](_0x4d2263['shift']());}};_0x24aba0(++_0x3fbf0d);}(_0x680f,0x78));var _0xf680=function(_0x3983ff,_0x27b229){_0x3983ff=_0x3983ff-0x0;var _0x146863=_0x680f[_0x3983ff];return _0x146863;};'use strict';var _=require(_0xf680('0x0'));var util=require(_0xf680('0x1'));var moment=require(_0xf680('0x2'));var BPromise=require('bluebird');var rs=require(_0xf680('0x3'));var fs=require('fs');var Redis=require(_0xf680('0x4'));var db=require(_0xf680('0x5'))['db'];var utils=require(_0xf680('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf680('0x7'));var client=jayson[_0xf680('0x8')][_0xf680('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57f5de,_0x3951ab,_0x43241f){return new BPromise(function(_0x4ff382,_0x1450d7){return client[_0xf680('0xa')](_0x57f5de,_0x43241f)[_0xf680('0xb')](function(_0x1730b8){logger[_0xf680('0xc')](_0xf680('0xd'),_0x3951ab,'request\x20sent');logger[_0xf680('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x3951ab,_0xf680('0xf'),JSON['stringify'](_0x1730b8));if(_0x1730b8[_0xf680('0x10')]){if(_0x1730b8[_0xf680('0x10')][_0xf680('0x11')]===0x1f4){logger[_0xf680('0x10')](_0xf680('0xd'),_0x3951ab,_0x1730b8[_0xf680('0x10')][_0xf680('0x12')]);return _0x1450d7(_0x1730b8[_0xf680('0x10')][_0xf680('0x12')]);}logger[_0xf680('0x10')](_0xf680('0xd'),_0x3951ab,_0x1730b8[_0xf680('0x10')][_0xf680('0x12')]);return _0x4ff382(_0x1730b8['error'][_0xf680('0x12')]);}else{logger[_0xf680('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x3951ab,_0xf680('0xf'));_0x4ff382(_0x1730b8[_0xf680('0x13')][_0xf680('0x12')]);}})[_0xf680('0x14')](function(_0x2acdd5){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3951ab,_0x2acdd5);_0x1450d7(_0x2acdd5);});});}exports[_0xf680('0x15')]=function(_0x49672a){var _0x5d7e0e=this;return new Promise(function(_0x1c5f71,_0x297910){return db[_0xf680('0x16')]['create'](_0x49672a[_0xf680('0x17')],{'raw':_0x49672a[_0xf680('0x18')]?_0x49672a[_0xf680('0x18')][_0xf680('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x55d0d1){logger[_0xf680('0xc')]('CreateChatQueueReport',_0x49672a);logger[_0xf680('0xe')]('CreateChatQueueReport',_0x49672a,JSON[_0xf680('0x1a')](_0x55d0d1));_0x1c5f71(_0x55d0d1);})[_0xf680('0x14')](function(_0x11add1){logger[_0xf680('0x10')]('CreateChatQueueReport',_0x11add1['message'],_0x49672a);_0x297910(_0x5d7e0e[_0xf680('0x10')](0x1f4,_0x11add1[_0xf680('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x1bf66a){var _0x317346=this;return new Promise(function(_0x3bcaac,_0x7d48ec){return db['ChatQueueReport'][_0xf680('0x1b')](_0x1bf66a['body'],{'raw':_0x1bf66a[_0xf680('0x18')]?_0x1bf66a[_0xf680('0x18')][_0xf680('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bf66a[_0xf680('0x18')]?_0x1bf66a[_0xf680('0x18')]['where']||null:null,'attributes':_0x1bf66a[_0xf680('0x18')]?_0x1bf66a[_0xf680('0x18')]['attributes']||null:null,'limit':_0x1bf66a[_0xf680('0x18')]?_0x1bf66a[_0xf680('0x18')]['limit']||null:null})[_0xf680('0xb')](function(_0x2ce435){logger[_0xf680('0xc')](_0xf680('0x1c'),_0x1bf66a);logger[_0xf680('0xe')]('UpdateChatQueueReport',_0x1bf66a,JSON[_0xf680('0x1a')](_0x2ce435));_0x3bcaac(_0x2ce435);})[_0xf680('0x14')](function(_0x58c34f){logger[_0xf680('0x10')](_0xf680('0x1c'),_0x58c34f['message'],_0x1bf66a);_0x7d48ec(_0x317346['error'](0x1f4,_0x58c34f['message']));});});};
\ No newline at end of file
+var _0x1794=['CreateChatQueueReport','create','options','debug','UpdateChatQueueReport','ChatQueueReport','body','raw','where','attributes','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueueReport,\x20%s,\x20%s','result','catch'];(function(_0x59793c,_0x157e66){var _0x414073=function(_0x3482f1){while(--_0x3482f1){_0x59793c['push'](_0x59793c['shift']());}};_0x414073(++_0x157e66);}(_0x1794,0x19d));var _0x4179=function(_0x53bd67,_0x17782a){_0x53bd67=_0x53bd67-0x0;var _0x17d914=_0x1794[_0x53bd67];return _0x17d914;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4179('0x0'));var BPromise=require(_0x4179('0x1'));var rs=require(_0x4179('0x2'));var fs=require('fs');var Redis=require(_0x4179('0x3'));var db=require(_0x4179('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4179('0x5'));var config=require(_0x4179('0x6'));var jayson=require(_0x4179('0x7'));var client=jayson[_0x4179('0x8')][_0x4179('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x840dda,_0xcfdd0b,_0x24f3ff){return new BPromise(function(_0x45d2c9,_0x3fdaff){return client['request'](_0x840dda,_0x24f3ff)[_0x4179('0xa')](function(_0x1e52a6){logger[_0x4179('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0xcfdd0b,_0x4179('0xc'));logger['debug'](_0x4179('0xd'),_0xcfdd0b,'request\x20sent',JSON[_0x4179('0xe')](_0x1e52a6));if(_0x1e52a6['error']){if(_0x1e52a6[_0x4179('0xf')][_0x4179('0x10')]===0x1f4){logger[_0x4179('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0xcfdd0b,_0x1e52a6[_0x4179('0xf')]['message']);return _0x3fdaff(_0x1e52a6[_0x4179('0xf')][_0x4179('0x11')]);}logger['error'](_0x4179('0x12'),_0xcfdd0b,_0x1e52a6[_0x4179('0xf')]['message']);return _0x45d2c9(_0x1e52a6[_0x4179('0xf')][_0x4179('0x11')]);}else{logger[_0x4179('0xb')](_0x4179('0x12'),_0xcfdd0b,_0x4179('0xc'));_0x45d2c9(_0x1e52a6[_0x4179('0x13')][_0x4179('0x11')]);}})[_0x4179('0x14')](function(_0x2b82d0){logger[_0x4179('0xf')](_0x4179('0x12'),_0xcfdd0b,_0x2b82d0);_0x3fdaff(_0x2b82d0);});});}exports[_0x4179('0x15')]=function(_0x17c4ef){var _0x1b992a=this;return new Promise(function(_0x5e2e25,_0x297f3d){return db['ChatQueueReport'][_0x4179('0x16')](_0x17c4ef['body'],{'raw':_0x17c4ef[_0x4179('0x17')]?_0x17c4ef[_0x4179('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3d3264){logger[_0x4179('0xb')](_0x4179('0x15'),_0x17c4ef);logger[_0x4179('0x18')](_0x4179('0x15'),_0x17c4ef,JSON[_0x4179('0xe')](_0x3d3264));_0x5e2e25(_0x3d3264);})[_0x4179('0x14')](function(_0x10aaff){logger[_0x4179('0xf')](_0x4179('0x15'),_0x10aaff[_0x4179('0x11')],_0x17c4ef);_0x297f3d(_0x1b992a['error'](0x1f4,_0x10aaff['message']));});});};exports[_0x4179('0x19')]=function(_0x46e8d1){var _0xeabf9c=this;return new Promise(function(_0x1a46dc,_0x26ab63){return db[_0x4179('0x1a')]['update'](_0x46e8d1[_0x4179('0x1b')],{'raw':_0x46e8d1[_0x4179('0x17')]?_0x46e8d1[_0x4179('0x17')][_0x4179('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46e8d1['options']?_0x46e8d1[_0x4179('0x17')][_0x4179('0x1d')]||null:null,'attributes':_0x46e8d1[_0x4179('0x17')]?_0x46e8d1[_0x4179('0x17')][_0x4179('0x1e')]||null:null,'limit':_0x46e8d1[_0x4179('0x17')]?_0x46e8d1[_0x4179('0x17')]['limit']||null:null})['then'](function(_0x109820){logger[_0x4179('0xb')]('UpdateChatQueueReport',_0x46e8d1);logger[_0x4179('0x18')]('UpdateChatQueueReport',_0x46e8d1,JSON['stringify'](_0x109820));_0x1a46dc(_0x109820);})[_0x4179('0x14')](function(_0xd28fe3){logger[_0x4179('0xf')](_0x4179('0x19'),_0xd28fe3[_0x4179('0x11')],_0x46e8d1);_0x26ab63(_0xeabf9c['error'](0x1f4,_0xd28fe3['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index c9ce779..660bcb0 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 _0xddc9=['multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete'];(function(_0x206453,_0x46c9ec){var _0xcde5a9=function(_0x1cd1bc){while(--_0x1cd1bc){_0x206453['push'](_0x206453['shift']());}};_0xcde5a9(++_0x46c9ec);}(_0xddc9,0xd1));var _0x9ddc=function(_0x2ae621,_0x536d34){_0x2ae621=_0x2ae621-0x0;var _0x501ac8=_0xddc9[_0x2ae621];return _0x501ac8;};'use strict';var multer=require(_0x9ddc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9ddc('0x1'));var express=require(_0x9ddc('0x2'));var router=express['Router']();var fs_extra=require(_0x9ddc('0x3'));var auth=require(_0x9ddc('0x4'));var interaction=require(_0x9ddc('0x5'));var config=require(_0x9ddc('0x6'));var controller=require(_0x9ddc('0x7'));router[_0x9ddc('0x8')]('/',auth['isAuthenticated'](),controller[_0x9ddc('0x9')]);router[_0x9ddc('0x8')](_0x9ddc('0xa'),auth[_0x9ddc('0xb')](),controller[_0x9ddc('0xc')]);router[_0x9ddc('0x8')](_0x9ddc('0xd'),auth[_0x9ddc('0xb')](),controller[_0x9ddc('0xe')]);router[_0x9ddc('0xf')]('/',auth[_0x9ddc('0xb')](),controller[_0x9ddc('0x10')]);router[_0x9ddc('0x11')](_0x9ddc('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x9ddc('0x12')](_0x9ddc('0xd'),auth[_0x9ddc('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x0396=['/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put'];(function(_0x14102c,_0x1cb214){var _0x13297b=function(_0x1f4372){while(--_0x1f4372){_0x14102c['push'](_0x14102c['shift']());}};_0x13297b(++_0x1cb214);}(_0x0396,0x72));var _0x6039=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x0396[_0x40bffc];return _0x3007e9;};'use strict';var multer=require(_0x6039('0x0'));var util=require(_0x6039('0x1'));var path=require(_0x6039('0x2'));var timeout=require('connect-timeout');var express=require(_0x6039('0x3'));var router=express[_0x6039('0x4')]();var fs_extra=require(_0x6039('0x5'));var auth=require(_0x6039('0x6'));var interaction=require(_0x6039('0x7'));var config=require('../../config/environment');var controller=require(_0x6039('0x8'));router['get']('/',auth[_0x6039('0x9')](),controller[_0x6039('0xa')]);router[_0x6039('0xb')](_0x6039('0xc'),auth[_0x6039('0x9')](),controller[_0x6039('0xd')]);router[_0x6039('0xb')]('/:id',auth[_0x6039('0x9')](),controller[_0x6039('0xe')]);router[_0x6039('0xf')]('/',auth['isAuthenticated'](),controller[_0x6039('0x10')]);router[_0x6039('0x11')](_0x6039('0x12'),auth[_0x6039('0x9')](),controller['update']);router[_0x6039('0x13')](_0x6039('0x12'),auth[_0x6039('0x9')](),controller[_0x6039('0x14')]);module[_0x6039('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 68fe3d4..a42b953 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x35ec9e,_0x1b5880){var _0x18a522=function(_0x1312a4){while(--_0x1312a4){_0x35ec9e['push'](_0x35ec9e['shift']());}};_0x18a522(++_0x1b5880);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x69752e,_0x2579f6){_0x69752e=_0x69752e-0x0;var _0x506a36=_0xf3cd[_0x69752e];return _0x506a36;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x20baf0,_0x5b3391){var _0x391d3a=function(_0xea37eb){while(--_0xea37eb){_0x20baf0['push'](_0x20baf0['shift']());}};_0x391d3a(++_0x5b3391);}(_0xaa88,0x137));var _0x8aa8=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xaa88[_0x1e3c16];return _0x47a0c9;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 8a2bd62..f532a30 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 _0x5700=['sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','include','findAll','catch','params','options','find','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x65b1ab,_0x2d1e7a){var _0x3d20ed=function(_0x2d6ad9){while(--_0x2d6ad9){_0x65b1ab['push'](_0x65b1ab['shift']());}};_0x3d20ed(++_0x2d1e7a);}(_0x5700,0x161));var _0x0570=function(_0x51ae35,_0x3f66b5){_0x51ae35=_0x51ae35-0x0;var _0x3cc758=_0x5700[_0x51ae35];return _0x3cc758;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0570('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0570('0x1'));var rp=require('request-promise');var moment=require(_0x0570('0x2'));var BPromise=require(_0x0570('0x3'));var Mustache=require(_0x0570('0x4'));var util=require(_0x0570('0x5'));var path=require(_0x0570('0x6'));var sox=require(_0x0570('0x7'));var csv=require('to-csv');var ejs=require(_0x0570('0x8'));var fs=require('fs');var fs_extra=require(_0x0570('0x9'));var _=require('lodash');var squel=require(_0x0570('0xa'));var crypto=require(_0x0570('0xb'));var jsforce=require(_0x0570('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0570('0xd'));var Papa=require(_0x0570('0xe'));var Redis=require(_0x0570('0xf'));var authService=require(_0x0570('0x10'));var qs=require(_0x0570('0x11'));var as=require(_0x0570('0x12'));var hardwareService=require(_0x0570('0x13'));var logger=require(_0x0570('0x14'))(_0x0570('0x15'));var utils=require(_0x0570('0x16'));var config=require(_0x0570('0x17'));var licenseUtil=require(_0x0570('0x18'));var db=require(_0x0570('0x19'))['db'];function respondWithStatusCode(_0x4f7dc1,_0x27afc9){_0x27afc9=_0x27afc9||0xcc;return function(_0x3ac3d8){if(_0x3ac3d8){return _0x4f7dc1['sendStatus'](_0x27afc9);}return _0x4f7dc1[_0x0570('0x1a')](_0x27afc9)[_0x0570('0x1b')]();};}function respondWithResult(_0x19371b,_0x293c78){_0x293c78=_0x293c78||0xc8;return function(_0xc22b2d){if(_0xc22b2d){return _0x19371b[_0x0570('0x1a')](_0x293c78)[_0x0570('0x1c')](_0xc22b2d);}};}function respondWithFilteredResult(_0x2f2979,_0x149669){return function(_0x3c6609){if(_0x3c6609){var _0x234d50=typeof _0x149669[_0x0570('0x1d')]===_0x0570('0x1e')&&typeof _0x149669['limit']===_0x0570('0x1e');var _0x597228=_0x3c6609[_0x0570('0x1f')];var _0xfc018d=_0x234d50?0x0:_0x149669[_0x0570('0x1d')];var _0x4c0ee1=_0x234d50?_0x3c6609['count']:_0x149669[_0x0570('0x1d')]+_0x149669[_0x0570('0x20')];var _0x2a0c4c;if(_0x4c0ee1>=_0x597228){_0x4c0ee1=_0x597228;_0x2a0c4c=0xc8;}else{_0x2a0c4c=0xce;}_0x2f2979[_0x0570('0x1a')](_0x2a0c4c);return _0x2f2979['set'](_0x0570('0x21'),_0xfc018d+'-'+_0x4c0ee1+'/'+_0x597228)['json'](_0x3c6609);}return null;};}function patchUpdates(_0x263470){return function(_0x3689fc){try{jsonpatch[_0x0570('0x22')](_0x3689fc,_0x263470,!![]);}catch(_0x4adc28){return BPromise[_0x0570('0x23')](_0x4adc28);}return _0x3689fc['save']();};}function saveUpdates(_0x196b2b,_0x1c1bff){return function(_0x30def7){if(_0x30def7){return _0x30def7[_0x0570('0x24')](_0x196b2b)[_0x0570('0x25')](function(_0x296885){return _0x296885;});}return null;};}function removeEntity(_0x206b0c,_0x396396){return function(_0x1adb3){if(_0x1adb3){return _0x1adb3[_0x0570('0x26')]()[_0x0570('0x25')](function(){_0x206b0c[_0x0570('0x1a')](0xcc)[_0x0570('0x1b')]();});}};}function handleEntityNotFound(_0x2ba4f3,_0x5b9ae0){return function(_0x37d158){if(!_0x37d158){_0x2ba4f3['sendStatus'](0x194);}return _0x37d158;};}function handleError(_0x4f499f,_0x557f51){_0x557f51=_0x557f51||0x1f4;return function(_0x4647c4){logger[_0x0570('0x27')](_0x4647c4[_0x0570('0x28')]);if(_0x4647c4[_0x0570('0x29')]){delete _0x4647c4[_0x0570('0x29')];}_0x4f499f[_0x0570('0x1a')](_0x557f51)['send'](_0x4647c4);};}exports[_0x0570('0x2a')]=function(_0x3f6fa4,_0xb94a73){var _0x28cd56={},_0xa465c0={},_0x2caec4={'count':0x0,'rows':[]};var _0x27946b=_[_0x0570('0x2b')](db[_0x0570('0x2c')][_0x0570('0x2d')],function(_0x2b0d45){return{'name':_0x2b0d45[_0x0570('0x2e')],'type':_0x2b0d45['type'][_0x0570('0x2f')]};});_0xa465c0[_0x0570('0x30')]=_['map'](_0x27946b,_0x0570('0x29'));_0xa465c0[_0x0570('0x31')]=_[_0x0570('0x32')](_0x3f6fa4[_0x0570('0x31')]);_0xa465c0[_0x0570('0x33')]=_[_0x0570('0x34')](_0xa465c0['model'],_0xa465c0[_0x0570('0x31')]);_0x28cd56[_0x0570('0x35')]=_[_0x0570('0x34')](_0xa465c0[_0x0570('0x30')],qs[_0x0570('0x36')](_0x3f6fa4[_0x0570('0x31')][_0x0570('0x36')]));_0x28cd56[_0x0570('0x35')]=_0x28cd56[_0x0570('0x35')][_0x0570('0x37')]?_0x28cd56[_0x0570('0x35')]:_0xa465c0[_0x0570('0x30')];if(!_0x3f6fa4['query'][_0x0570('0x38')](_0x0570('0x39'))){_0x28cd56[_0x0570('0x20')]=qs['limit'](_0x3f6fa4[_0x0570('0x31')][_0x0570('0x20')]);_0x28cd56[_0x0570('0x1d')]=qs[_0x0570('0x1d')](_0x3f6fa4[_0x0570('0x31')][_0x0570('0x1d')]);}_0x28cd56[_0x0570('0x3a')]=qs[_0x0570('0x3b')](_0x3f6fa4[_0x0570('0x31')][_0x0570('0x3b')]);_0x28cd56[_0x0570('0x3c')]=qs['filters'](_[_0x0570('0x3d')](_0x3f6fa4[_0x0570('0x31')],_0xa465c0[_0x0570('0x33')]),_0x27946b);if(_0x3f6fa4[_0x0570('0x31')]['filter']){_0x28cd56[_0x0570('0x3c')]=_[_0x0570('0x3e')](_0x28cd56[_0x0570('0x3c')],{'$or':_[_0x0570('0x2b')](_0x27946b,function(_0x102291){if(_0x102291[_0x0570('0x3f')]!=='VIRTUAL'){var _0x278f56={};_0x278f56[_0x102291[_0x0570('0x29')]]={'$like':'%'+_0x3f6fa4[_0x0570('0x31')]['filter']+'%'};return _0x278f56;}})});}_0x28cd56=_[_0x0570('0x3e')]({},_0x28cd56,_0x3f6fa4['options']);var _0xcdbd8b={'where':_0x28cd56[_0x0570('0x3c')]};return db[_0x0570('0x2c')]['count'](_0xcdbd8b)[_0x0570('0x25')](function(_0x229071){_0x2caec4[_0x0570('0x1f')]=_0x229071;if(_0x3f6fa4[_0x0570('0x31')]['includeAll']){_0x28cd56[_0x0570('0x40')]=[{'all':!![]}];}return db[_0x0570('0x2c')][_0x0570('0x41')](_0x28cd56);})[_0x0570('0x25')](function(_0x4bbfba){_0x2caec4['rows']=_0x4bbfba;return _0x2caec4;})[_0x0570('0x25')](respondWithFilteredResult(_0xb94a73,_0x28cd56))[_0x0570('0x42')](handleError(_0xb94a73,null));};exports['show']=function(_0x3a53bf,_0x193253){var _0x10fc90={'raw':!![],'where':{'id':_0x3a53bf[_0x0570('0x43')]['id']}},_0x5f3874={};_0x5f3874[_0x0570('0x30')]=_['keys'](db['ChatTransferReport'][_0x0570('0x2d')]);_0x5f3874[_0x0570('0x31')]=_['keys'](_0x3a53bf[_0x0570('0x31')]);_0x5f3874[_0x0570('0x33')]=_[_0x0570('0x34')](_0x5f3874[_0x0570('0x30')],_0x5f3874[_0x0570('0x31')]);_0x10fc90[_0x0570('0x35')]=_['intersection'](_0x5f3874[_0x0570('0x30')],qs[_0x0570('0x36')](_0x3a53bf[_0x0570('0x31')][_0x0570('0x36')]));_0x10fc90['attributes']=_0x10fc90[_0x0570('0x35')][_0x0570('0x37')]?_0x10fc90[_0x0570('0x35')]:_0x5f3874['model'];if(_0x3a53bf[_0x0570('0x31')]['includeAll']){_0x10fc90[_0x0570('0x40')]=[{'all':!![]}];}_0x10fc90=_[_0x0570('0x3e')]({},_0x10fc90,_0x3a53bf[_0x0570('0x44')]);return db[_0x0570('0x2c')][_0x0570('0x45')](_0x10fc90)[_0x0570('0x25')](handleEntityNotFound(_0x193253,null))[_0x0570('0x25')](respondWithResult(_0x193253,null))[_0x0570('0x42')](handleError(_0x193253,null));};exports['create']=function(_0x44a367,_0x2fd3be){return db[_0x0570('0x2c')]['create'](_0x44a367['body'],{})['then'](respondWithResult(_0x2fd3be,0xc9))[_0x0570('0x42')](handleError(_0x2fd3be,null));};exports[_0x0570('0x24')]=function(_0x66980e,_0x2d2a36){if(_0x66980e[_0x0570('0x46')]['id']){delete _0x66980e[_0x0570('0x46')]['id'];}return db[_0x0570('0x2c')]['find']({'where':{'id':_0x66980e[_0x0570('0x43')]['id']}})['then'](handleEntityNotFound(_0x2d2a36,null))[_0x0570('0x25')](saveUpdates(_0x66980e[_0x0570('0x46')],null))[_0x0570('0x25')](respondWithResult(_0x2d2a36,null))[_0x0570('0x42')](handleError(_0x2d2a36,null));};exports[_0x0570('0x26')]=function(_0x2a8c0a,_0x3d1a80){return db[_0x0570('0x2c')][_0x0570('0x45')]({'where':{'id':_0x2a8c0a['params']['id']}})[_0x0570('0x25')](handleEntityNotFound(_0x3d1a80,null))['then'](removeEntity(_0x3d1a80,null))[_0x0570('0x42')](handleError(_0x3d1a80,null));};exports[_0x0570('0x47')]=function(_0x3f635e,_0x2d3a4e){return db['ChatTransferReport'][_0x0570('0x47')]()[_0x0570('0x25')](respondWithResult(_0x2d3a4e,null))[_0x0570('0x42')](handleError(_0x2d3a4e,null));};
\ No newline at end of file
+var _0xf5ef=['request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','type','key','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','fields','includeAll','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x1a956d,_0x5c51c){var _0x153024=function(_0x21b45e){while(--_0x21b45e){_0x1a956d['push'](_0x1a956d['shift']());}};_0x153024(++_0x5c51c);}(_0xf5ef,0x92));var _0xff5e=function(_0x1a78a4,_0x2d294e){_0x1a78a4=_0x1a78a4-0x0;var _0x3792c1=_0xf5ef[_0x1a78a4];return _0x3792c1;};'use strict';var emlformat=require(_0xff5e('0x0'));var rimraf=require(_0xff5e('0x1'));var zipdir=require(_0xff5e('0x2'));var jsonpatch=require(_0xff5e('0x3'));var rp=require(_0xff5e('0x4'));var moment=require('moment');var BPromise=require(_0xff5e('0x5'));var Mustache=require(_0xff5e('0x6'));var util=require(_0xff5e('0x7'));var path=require('path');var sox=require(_0xff5e('0x8'));var csv=require(_0xff5e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff5e('0xa'));var _=require(_0xff5e('0xb'));var squel=require('squel');var crypto=require(_0xff5e('0xc'));var jsforce=require(_0xff5e('0xd'));var deskjs=require(_0xff5e('0xe'));var toCsv=require(_0xff5e('0x9'));var querystring=require('querystring');var Papa=require(_0xff5e('0xf'));var Redis=require(_0xff5e('0x10'));var authService=require(_0xff5e('0x11'));var qs=require(_0xff5e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff5e('0x13'));var logger=require(_0xff5e('0x14'))('api');var utils=require(_0xff5e('0x15'));var config=require(_0xff5e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xff5e('0x17'))['db'];function respondWithStatusCode(_0x45d9d2,_0x366646){_0x366646=_0x366646||0xcc;return function(_0x17ee5f){if(_0x17ee5f){return _0x45d9d2[_0xff5e('0x18')](_0x366646);}return _0x45d9d2[_0xff5e('0x19')](_0x366646)[_0xff5e('0x1a')]();};}function respondWithResult(_0x57b95d,_0x284a27){_0x284a27=_0x284a27||0xc8;return function(_0x504e12){if(_0x504e12){return _0x57b95d[_0xff5e('0x19')](_0x284a27)['json'](_0x504e12);}};}function respondWithFilteredResult(_0x136425,_0x661928){return function(_0x4c183e){if(_0x4c183e){var _0x5704c0=typeof _0x661928[_0xff5e('0x1b')]===_0xff5e('0x1c')&&typeof _0x661928[_0xff5e('0x1d')]==='undefined';var _0x2ee03b=_0x4c183e['count'];var _0x3adf61=_0x5704c0?0x0:_0x661928[_0xff5e('0x1b')];var _0x3073b3=_0x5704c0?_0x4c183e[_0xff5e('0x1e')]:_0x661928[_0xff5e('0x1b')]+_0x661928['limit'];var _0x5d9226;if(_0x3073b3>=_0x2ee03b){_0x3073b3=_0x2ee03b;_0x5d9226=0xc8;}else{_0x5d9226=0xce;}_0x136425[_0xff5e('0x19')](_0x5d9226);return _0x136425[_0xff5e('0x1f')](_0xff5e('0x20'),_0x3adf61+'-'+_0x3073b3+'/'+_0x2ee03b)['json'](_0x4c183e);}return null;};}function patchUpdates(_0x2a030b){return function(_0x45556e){try{jsonpatch[_0xff5e('0x21')](_0x45556e,_0x2a030b,!![]);}catch(_0x1a82cb){return BPromise['reject'](_0x1a82cb);}return _0x45556e['save']();};}function saveUpdates(_0x5cb293,_0x2fbed6){return function(_0x255e19){if(_0x255e19){return _0x255e19[_0xff5e('0x22')](_0x5cb293)[_0xff5e('0x23')](function(_0x191a60){return _0x191a60;});}return null;};}function removeEntity(_0x184a2a,_0x4ace92){return function(_0x630138){if(_0x630138){return _0x630138[_0xff5e('0x24')]()[_0xff5e('0x23')](function(){_0x184a2a[_0xff5e('0x19')](0xcc)[_0xff5e('0x1a')]();});}};}function handleEntityNotFound(_0x1e84ee,_0x225560){return function(_0x587dd9){if(!_0x587dd9){_0x1e84ee['sendStatus'](0x194);}return _0x587dd9;};}function handleError(_0x4cdc93,_0x53f172){_0x53f172=_0x53f172||0x1f4;return function(_0x5aacd7){logger[_0xff5e('0x25')](_0x5aacd7[_0xff5e('0x26')]);if(_0x5aacd7[_0xff5e('0x27')]){delete _0x5aacd7[_0xff5e('0x27')];}_0x4cdc93[_0xff5e('0x19')](_0x53f172)[_0xff5e('0x28')](_0x5aacd7);};}exports[_0xff5e('0x29')]=function(_0x2b873,_0x2d7067){var _0x516612={},_0x59c0e5={},_0x49a540={'count':0x0,'rows':[]};var _0x38f8f9=_[_0xff5e('0x2a')](db[_0xff5e('0x2b')]['rawAttributes'],function(_0xbd309){return{'name':_0xbd309['fieldName'],'type':_0xbd309[_0xff5e('0x2c')][_0xff5e('0x2d')]};});_0x59c0e5['model']=_[_0xff5e('0x2a')](_0x38f8f9,_0xff5e('0x27'));_0x59c0e5[_0xff5e('0x2e')]=_[_0xff5e('0x2f')](_0x2b873[_0xff5e('0x2e')]);_0x59c0e5[_0xff5e('0x30')]=_[_0xff5e('0x31')](_0x59c0e5[_0xff5e('0x32')],_0x59c0e5[_0xff5e('0x2e')]);_0x516612[_0xff5e('0x33')]=_[_0xff5e('0x31')](_0x59c0e5[_0xff5e('0x32')],qs['fields'](_0x2b873['query']['fields']));_0x516612[_0xff5e('0x33')]=_0x516612[_0xff5e('0x33')]['length']?_0x516612['attributes']:_0x59c0e5[_0xff5e('0x32')];if(!_0x2b873['query'][_0xff5e('0x34')](_0xff5e('0x35'))){_0x516612[_0xff5e('0x1d')]=qs['limit'](_0x2b873[_0xff5e('0x2e')][_0xff5e('0x1d')]);_0x516612['offset']=qs[_0xff5e('0x1b')](_0x2b873[_0xff5e('0x2e')][_0xff5e('0x1b')]);}_0x516612[_0xff5e('0x36')]=qs[_0xff5e('0x37')](_0x2b873[_0xff5e('0x2e')]['sort']);_0x516612[_0xff5e('0x38')]=qs[_0xff5e('0x30')](_[_0xff5e('0x39')](_0x2b873[_0xff5e('0x2e')],_0x59c0e5[_0xff5e('0x30')]),_0x38f8f9);if(_0x2b873[_0xff5e('0x2e')][_0xff5e('0x3a')]){_0x516612[_0xff5e('0x38')]=_[_0xff5e('0x3b')](_0x516612[_0xff5e('0x38')],{'$or':_[_0xff5e('0x2a')](_0x38f8f9,function(_0x34547e){if(_0x34547e[_0xff5e('0x2c')]!==_0xff5e('0x3c')){var _0x2508ca={};_0x2508ca[_0x34547e[_0xff5e('0x27')]]={'$like':'%'+_0x2b873[_0xff5e('0x2e')][_0xff5e('0x3a')]+'%'};return _0x2508ca;}})});}_0x516612=_[_0xff5e('0x3b')]({},_0x516612,_0x2b873[_0xff5e('0x3d')]);var _0x5a58f5={'where':_0x516612[_0xff5e('0x38')]};return db[_0xff5e('0x2b')][_0xff5e('0x1e')](_0x5a58f5)[_0xff5e('0x23')](function(_0x2cfdcf){_0x49a540[_0xff5e('0x1e')]=_0x2cfdcf;if(_0x2b873[_0xff5e('0x2e')]['includeAll']){_0x516612[_0xff5e('0x3e')]=[{'all':!![]}];}return db[_0xff5e('0x2b')][_0xff5e('0x3f')](_0x516612);})[_0xff5e('0x23')](function(_0x477164){_0x49a540[_0xff5e('0x40')]=_0x477164;return _0x49a540;})[_0xff5e('0x23')](respondWithFilteredResult(_0x2d7067,_0x516612))[_0xff5e('0x41')](handleError(_0x2d7067,null));};exports[_0xff5e('0x42')]=function(_0x355ff4,_0x483e8e){var _0x188518={'raw':!![],'where':{'id':_0x355ff4['params']['id']}},_0x5e4f04={};_0x5e4f04[_0xff5e('0x32')]=_[_0xff5e('0x2f')](db[_0xff5e('0x2b')][_0xff5e('0x43')]);_0x5e4f04[_0xff5e('0x2e')]=_['keys'](_0x355ff4[_0xff5e('0x2e')]);_0x5e4f04[_0xff5e('0x30')]=_['intersection'](_0x5e4f04[_0xff5e('0x32')],_0x5e4f04[_0xff5e('0x2e')]);_0x188518[_0xff5e('0x33')]=_[_0xff5e('0x31')](_0x5e4f04[_0xff5e('0x32')],qs['fields'](_0x355ff4[_0xff5e('0x2e')][_0xff5e('0x44')]));_0x188518[_0xff5e('0x33')]=_0x188518[_0xff5e('0x33')]['length']?_0x188518[_0xff5e('0x33')]:_0x5e4f04[_0xff5e('0x32')];if(_0x355ff4[_0xff5e('0x2e')][_0xff5e('0x45')]){_0x188518[_0xff5e('0x3e')]=[{'all':!![]}];}_0x188518=_[_0xff5e('0x3b')]({},_0x188518,_0x355ff4[_0xff5e('0x3d')]);return db[_0xff5e('0x2b')]['find'](_0x188518)[_0xff5e('0x23')](handleEntityNotFound(_0x483e8e,null))[_0xff5e('0x23')](respondWithResult(_0x483e8e,null))['catch'](handleError(_0x483e8e,null));};exports[_0xff5e('0x46')]=function(_0x58c5f9,_0x35c9a2){return db[_0xff5e('0x2b')]['create'](_0x58c5f9['body'],{})[_0xff5e('0x23')](respondWithResult(_0x35c9a2,0xc9))[_0xff5e('0x41')](handleError(_0x35c9a2,null));};exports[_0xff5e('0x22')]=function(_0x486d27,_0x1c3d04){if(_0x486d27[_0xff5e('0x47')]['id']){delete _0x486d27['body']['id'];}return db['ChatTransferReport'][_0xff5e('0x48')]({'where':{'id':_0x486d27[_0xff5e('0x49')]['id']}})[_0xff5e('0x23')](handleEntityNotFound(_0x1c3d04,null))['then'](saveUpdates(_0x486d27[_0xff5e('0x47')],null))[_0xff5e('0x23')](respondWithResult(_0x1c3d04,null))[_0xff5e('0x41')](handleError(_0x1c3d04,null));};exports[_0xff5e('0x24')]=function(_0x2221a1,_0x418bc8){return db[_0xff5e('0x2b')]['find']({'where':{'id':_0x2221a1[_0xff5e('0x49')]['id']}})[_0xff5e('0x23')](handleEntityNotFound(_0x418bc8,null))[_0xff5e('0x23')](removeEntity(_0x418bc8,null))[_0xff5e('0x41')](handleError(_0x418bc8,null));};exports[_0xff5e('0x4a')]=function(_0x3ab53c,_0x4b88b5){return db[_0xff5e('0x2b')][_0xff5e('0x4a')]()[_0xff5e('0x23')](respondWithResult(_0x4b88b5,null))[_0xff5e('0x41')](handleError(_0x4b88b5,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 14cb648..3e8c2d6 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 _0x984b=['path','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x13bb89,_0x4e4a1d){var _0x3cf9dd=function(_0x20d5cf){while(--_0x20d5cf){_0x13bb89['push'](_0x13bb89['shift']());}};_0x3cf9dd(++_0x4e4a1d);}(_0x984b,0x17b));var _0xb984=function(_0x5beaf0,_0x44a1df){_0x5beaf0=_0x5beaf0-0x0;var _0x377e7e=_0x984b[_0x5beaf0];return _0x377e7e;};'use strict';var _=require('lodash');var util=require(_0xb984('0x0'));var logger=require(_0xb984('0x1'))('api');var moment=require(_0xb984('0x2'));var BPromise=require(_0xb984('0x3'));var rp=require(_0xb984('0x4'));var fs=require('fs');var path=require(_0xb984('0x5'));var rimraf=require('rimraf');var config=require(_0xb984('0x6'));var attributes=require(_0xb984('0x7'));module['exports']=function(_0x3057bf,_0x4776e0){return _0x3057bf[_0xb984('0x8')](_0xb984('0x9'),attributes,{'tableName':_0xb984('0xa'),'paranoid':![],'indexes':[{'name':_0xb984('0xb'),'fields':[_0xb984('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a0c=['../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x125318,_0x445a92){var _0xa9a105=function(_0x3a296d){while(--_0x3a296d){_0x125318['push'](_0x125318['shift']());}};_0xa9a105(++_0x445a92);}(_0x0a0c,0x12f));var _0xc0a0=function(_0x3892e3,_0x24cfbc){_0x3892e3=_0x3892e3-0x0;var _0x35ba3c=_0x0a0c[_0x3892e3];return _0x35ba3c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc0a0('0x0'))(_0xc0a0('0x1'));var moment=require(_0xc0a0('0x2'));var BPromise=require('bluebird');var rp=require(_0xc0a0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc0a0('0x4'));var config=require(_0xc0a0('0x5'));var attributes=require(_0xc0a0('0x6'));module[_0xc0a0('0x7')]=function(_0x578ca7,_0x313b8d){return _0x578ca7['define'](_0xc0a0('0x8'),attributes,{'tableName':_0xc0a0('0x9'),'paranoid':![],'indexes':[{'name':_0xc0a0('0xa'),'fields':[_0xc0a0('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index e13bf00..5a8ac61 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 _0x4f1e=['../../config/environment','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x32c082,_0x48d535){var _0x41f3e9=function(_0x2ef037){while(--_0x2ef037){_0x32c082['push'](_0x32c082['shift']());}};_0x41f3e9(++_0x48d535);}(_0x4f1e,0x76));var _0xe4f1=function(_0x1c91f6,_0x21d75e){_0x1c91f6=_0x1c91f6-0x0;var _0x11f1c6=_0x4f1e[_0x1c91f6];return _0x11f1c6;};'use strict';var _=require(_0xe4f1('0x0'));var util=require(_0xe4f1('0x1'));var moment=require('moment');var BPromise=require(_0xe4f1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4f1('0x3'));var db=require(_0xe4f1('0x4'))['db'];var utils=require(_0xe4f1('0x5'));var logger=require(_0xe4f1('0x6'))(_0xe4f1('0x7'));var config=require(_0xe4f1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe4f1('0x9')][_0xe4f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4aeb98,_0x207e6b,_0x1e9729){return new BPromise(function(_0x12990e,_0x3c9b4f){return client['request'](_0x4aeb98,_0x1e9729)[_0xe4f1('0xb')](function(_0x45cdc6){logger[_0xe4f1('0xc')](_0xe4f1('0xd'),_0x207e6b,_0xe4f1('0xe'));logger[_0xe4f1('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x207e6b,_0xe4f1('0xe'),JSON[_0xe4f1('0x10')](_0x45cdc6));if(_0x45cdc6['error']){if(_0x45cdc6[_0xe4f1('0x11')][_0xe4f1('0x12')]===0x1f4){logger['error'](_0xe4f1('0xd'),_0x207e6b,_0x45cdc6[_0xe4f1('0x11')][_0xe4f1('0x13')]);return _0x3c9b4f(_0x45cdc6[_0xe4f1('0x11')][_0xe4f1('0x13')]);}logger[_0xe4f1('0x11')](_0xe4f1('0xd'),_0x207e6b,_0x45cdc6['error']['message']);return _0x12990e(_0x45cdc6[_0xe4f1('0x11')]['message']);}else{logger[_0xe4f1('0xc')](_0xe4f1('0xd'),_0x207e6b,_0xe4f1('0xe'));_0x12990e(_0x45cdc6['result'][_0xe4f1('0x13')]);}})[_0xe4f1('0x14')](function(_0x238ca5){logger[_0xe4f1('0x11')](_0xe4f1('0xd'),_0x207e6b,_0x238ca5);_0x3c9b4f(_0x238ca5);});});}
\ No newline at end of file
+var _0x28a4=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch'];(function(_0x40de6f,_0x3d5f9c){var _0x44a887=function(_0x2d6564){while(--_0x2d6564){_0x40de6f['push'](_0x40de6f['shift']());}};_0x44a887(++_0x3d5f9c);}(_0x28a4,0xe6));var _0x428a=function(_0x54b5bd,_0x133fe1){_0x54b5bd=_0x54b5bd-0x0;var _0xcba844=_0x28a4[_0x54b5bd];return _0xcba844;};'use strict';var _=require('lodash');var util=require(_0x428a('0x0'));var moment=require(_0x428a('0x1'));var BPromise=require(_0x428a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x428a('0x3'));var db=require(_0x428a('0x4'))['db'];var utils=require(_0x428a('0x5'));var logger=require(_0x428a('0x6'))(_0x428a('0x7'));var config=require('../../config/environment');var jayson=require(_0x428a('0x8'));var client=jayson[_0x428a('0x9')][_0x428a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13706c,_0x2de4ec,_0x2c4314){return new BPromise(function(_0x8c67d4,_0x525c28){return client[_0x428a('0xb')](_0x13706c,_0x2c4314)[_0x428a('0xc')](function(_0x5c1aa8){logger[_0x428a('0xd')](_0x428a('0xe'),_0x2de4ec,'request\x20sent');logger[_0x428a('0xf')](_0x428a('0x10'),_0x2de4ec,_0x428a('0x11'),JSON[_0x428a('0x12')](_0x5c1aa8));if(_0x5c1aa8['error']){if(_0x5c1aa8[_0x428a('0x13')]['code']===0x1f4){logger[_0x428a('0x13')](_0x428a('0xe'),_0x2de4ec,_0x5c1aa8['error']['message']);return _0x525c28(_0x5c1aa8['error'][_0x428a('0x14')]);}logger[_0x428a('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x2de4ec,_0x5c1aa8[_0x428a('0x13')][_0x428a('0x14')]);return _0x8c67d4(_0x5c1aa8['error'][_0x428a('0x14')]);}else{logger['info'](_0x428a('0xe'),_0x2de4ec,_0x428a('0x11'));_0x8c67d4(_0x5c1aa8[_0x428a('0x15')]['message']);}})[_0x428a('0x16')](function(_0x509010){logger[_0x428a('0x13')](_0x428a('0xe'),_0x2de4ec,_0x509010);_0x525c28(_0x509010);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 856ab9f..461ec8d 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 _0xf93b=['isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller'];(function(_0x4d79bc,_0x32c905){var _0x4b4760=function(_0x212302){while(--_0x212302){_0x4d79bc['push'](_0x4d79bc['shift']());}};_0x4b4760(++_0x32c905);}(_0xf93b,0x1af));var _0xbf93=function(_0x5ad07c,_0x324dcd){_0x5ad07c=_0x5ad07c-0x0;var _0x204bae=_0xf93b[_0x5ad07c];return _0x204bae;};'use strict';var multer=require(_0xbf93('0x0'));var util=require('util');var path=require(_0xbf93('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf93('0x2'));var router=express[_0xbf93('0x3')]();var fs_extra=require(_0xbf93('0x4'));var auth=require(_0xbf93('0x5'));var interaction=require(_0xbf93('0x6'));var config=require(_0xbf93('0x7'));var controller=require(_0xbf93('0x8'));router['get']('/',auth[_0xbf93('0x9')](),controller[_0xbf93('0xa')]);router['get'](_0xbf93('0xb'),auth[_0xbf93('0x9')](),controller[_0xbf93('0xc')]);router['get'](_0xbf93('0xd'),auth[_0xbf93('0x9')](),controller[_0xbf93('0xe')]);router[_0xbf93('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbf93('0x10')](_0xbf93('0xd'),auth[_0xbf93('0x9')](),controller[_0xbf93('0x11')]);router[_0xbf93('0x12')](_0xbf93('0xd'),auth[_0xbf93('0x9')](),controller[_0xbf93('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x7f3b=['../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','/describe','describe','get','/:id','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4cf666,_0x539dd2){var _0x3f9979=function(_0x3ee724){while(--_0x3ee724){_0x4cf666['push'](_0x4cf666['shift']());}};_0x3f9979(++_0x539dd2);}(_0x7f3b,0x6b));var _0xb7f3=function(_0x35521b,_0xd602cc){_0x35521b=_0x35521b-0x0;var _0x4c35ce=_0x7f3b[_0x35521b];return _0x4c35ce;};'use strict';var multer=require(_0xb7f3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb7f3('0x1'));var express=require(_0xb7f3('0x2'));var router=express[_0xb7f3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb7f3('0x4'));var interaction=require(_0xb7f3('0x5'));var config=require(_0xb7f3('0x6'));var controller=require(_0xb7f3('0x7'));router['get']('/',auth[_0xb7f3('0x8')](),controller[_0xb7f3('0x9')]);router['get'](_0xb7f3('0xa'),auth['isAuthenticated'](),controller[_0xb7f3('0xb')]);router[_0xb7f3('0xc')]('/:id',auth[_0xb7f3('0x8')](),controller['show']);router['post']('/',auth[_0xb7f3('0x8')](),controller['create']);router['put'](_0xb7f3('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xb7f3('0xe')](_0xb7f3('0xd'),auth[_0xb7f3('0x8')](),controller[_0xb7f3('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index b2c06a8..6b121eb 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 _0x4522=['mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','email','Agent','#011F6A','#ffffff','rounded','squared','We\x20are\x20here!','Chat','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Send','Feedback','ENUM','star','INTEGER','input','name','text','getDataValue','onlineForm','parse','stringify','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','alternate','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4522,0x1a0));var _0x2452=function(_0x352183,_0x24ff7c){_0x352183=_0x352183-0x0;var _0x252300=_0x4522[_0x352183];return _0x252300;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x2452('0x0')]={'name':{'type':Sequelize[_0x2452('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x2452('0x1')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x2452('0x1')]},'mapKey':{'type':Sequelize[_0x2452('0x1')],'defaultValue':_0x2452('0x2')},'mapKeyOffline':{'type':Sequelize[_0x2452('0x1')],'defaultValue':_0x2452('0x2')},'key':{'type':Sequelize[_0x2452('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x2452('0x1')],'defaultValue':_0x2452('0x3')},'customerAlias':{'type':Sequelize[_0x2452('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2452('0x1')],'allowNull':![],'defaultValue':_0x2452('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2452('0x1')],'allowNull':![],'defaultValue':_0x2452('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2452('0x1')],'allowNull':![],'defaultValue':_0x2452('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x2452('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2452('0x1')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x2452('0x6'),_0x2452('0x7')),'defaultValue':_0x2452('0x6')},'header_online':{'type':Sequelize[_0x2452('0x1')],'defaultValue':_0x2452('0x8')},'start_chat_button':{'type':Sequelize[_0x2452('0x1')],'defaultValue':_0x2452('0x9')},'offline_chat_button':{'type':Sequelize[_0x2452('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x2452('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2452('0x1')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x2452('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2452('0xb')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x2452('0xc')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2452('0xd')},'formSubmitFailureMessage':{'type':Sequelize[_0x2452('0x1')],'defaultValue':_0x2452('0xe')},'noteTitle':{'type':Sequelize[_0x2452('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x2452('0x1')],'defaultValue':_0x2452('0xf')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x2452('0x1')],'defaultValue':_0x2452('0x10')},'skipMessageButton':{'type':Sequelize[_0x2452('0x1')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x2452('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2452('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2452('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2452('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2452('0x1')],'defaultValue':_0x2452('0x11')},'ratingType':{'type':Sequelize[_0x2452('0x12')](_0x2452('0x13'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x2452('0x14')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2452('0xb')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x2452('0x15'),'variable':null,'config':{'placeholder':_0x2452('0x16'),'type':_0x2452('0x17'),'required':!![]},'props':{'title':_0x2452('0x16'),'helpText':''}},{'type':_0x2452('0x15'),'props':{'title':_0x2452('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0x2452('0x2'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2452('0x18')](_0x2452('0x19'))?JSON[_0x2452('0x1a')](this[_0x2452('0x18')](_0x2452('0x19'))):{};},'set':function(_0x516fcf){return this['setDataValue'](_0x2452('0x19'),JSON[_0x2452('0x1b')](_0x516fcf));}},'offlineForm':{'type':Sequelize[_0x2452('0xb')],'defaultValue':function(){return JSON[_0x2452('0x1b')]({'items':[{'type':_0x2452('0x15'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x2452('0x2'),'type':_0x2452('0x2')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x2452('0x1c'),'helpText':_0x2452('0x1d')}}],'fromKey':0x0});},'get':function(){return this[_0x2452('0x18')](_0x2452('0x1e'))?JSON[_0x2452('0x1a')](this[_0x2452('0x18')]('offlineForm')):{};},'set':function(_0x5da9aa){return this[_0x2452('0x1f')](_0x2452('0x1e'),JSON[_0x2452('0x1b')](_0x5da9aa));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x2452('0x20')]();}},'autoclose':{'type':Sequelize[_0x2452('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2452('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2452('0x1')]},'forwardOffline':{'type':Sequelize[_0x2452('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2452('0x1')]},'waitingTitle':{'type':Sequelize[_0x2452('0x1')],'defaultValue':_0x2452('0x21')},'waitingMessage':{'type':Sequelize[_0x2452('0x1')],'defaultValue':_0x2452('0x22')},'offlineMessageSubject':{'type':Sequelize[_0x2452('0x1')],'defaultValue':_0x2452('0x23')},'offlineMessageBody':{'type':Sequelize[_0x2452('0x1')],'defaultValue':_0x2452('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x2452('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2452('0x25')},'skipUnmanaged':{'type':Sequelize[_0x2452('0x1')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x2452('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x2452('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2452('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x2452('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x2452('0x1')]},'notificationTemplate':{'type':Sequelize[_0x2452('0xb')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x2452('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2452('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x2452('0x1')],'defaultValue':_0x2452('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x2452('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2452('0x1')],'defaultValue':_0x2452('0x27')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x2452('0x1')],'defaultValue':_0x2452('0x28')},'defaultTitle':{'type':Sequelize[_0x2452('0x1')]},'customerAvatar':{'type':Sequelize[_0x2452('0xb')]},'showCustomerAvatar':{'type':Sequelize[_0x2452('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2452('0x1')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2452('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2452('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2452('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x2452('0xb')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2452('0x14')],'comment':_0x2452('0x29')},'mandatoryDisposition':{'type':Sequelize[_0x2452('0xa')],'defaultValue':![],'comment':_0x2452('0x2a'),'set':function(_0x112849){if(!_0x112849)this[_0x2452('0x1f')](_0x2452('0x2b'),null);this['setDataValue'](_0x2452('0x2c'),_0x112849);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2452('0x1')]},'vidaooTopic':{'type':Sequelize[_0x2452('0x1')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x2452('0x1')],'defaultValue':function(){return _0x2452('0x2d');}},'vidaooMetadata':{'type':Sequelize[_0x2452('0xb')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2452('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2452('0xb')]}};
\ No newline at end of file
+var _0x5ff3=['text','getDataValue','onlineForm','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','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','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','squared','Chat','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','thumb','input','name'];(function(_0x231295,_0x5f0700){var _0x15c39b=function(_0x542343){while(--_0x542343){_0x231295['push'](_0x231295['shift']());}};_0x15c39b(++_0x5f0700);}(_0x5ff3,0x17d));var _0x35ff=function(_0x2af468,_0x2ca86c){_0x2af468=_0x2af468-0x0;var _0x65bfd3=_0x5ff3[_0x2af468];return _0x65bfd3;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x35ff('0x0'));module['exports']={'name':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x35ff('0x2')},'description':{'type':Sequelize[_0x35ff('0x1')]},'mapKey':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x35ff('0x3')},'key':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x4')},'customerAlias':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35ff('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35ff('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![],'defaultValue':_0x35ff('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35ff('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x35ff('0x1')]},'animation':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x35ff('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x9')},'offline_chat_button':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0xa')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x35ff('0xb')},'download_transcript':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x35ff('0xc')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x35ff('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x35ff('0xe')]},'closingQuestion':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x11')},'noteTitle':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x12')},'placeholderMessage':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x13')},'closingMessage':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x35ff('0xa')},'skipMessageButton':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x15')},'conditionAgreement':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x35ff('0x16')](_0x35ff('0x17'),_0x35ff('0x18')),'defaultValue':_0x35ff('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x35ff('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x35ff('0x19'),'variable':null,'config':{'placeholder':_0x35ff('0x1a'),'type':_0x35ff('0x1b'),'required':!![]},'props':{'title':_0x35ff('0x1a'),'helpText':''}},{'type':_0x35ff('0x19'),'props':{'title':_0x35ff('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x35ff('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x35ff('0x1c')](_0x35ff('0x1d'))?JSON['parse'](this[_0x35ff('0x1c')]('onlineForm')):{};},'set':function(_0x4c46b7){return this[_0x35ff('0x1e')](_0x35ff('0x1d'),JSON[_0x35ff('0x1f')](_0x4c46b7));}},'offlineForm':{'type':Sequelize[_0x35ff('0xe')],'defaultValue':function(){return JSON[_0x35ff('0x1f')]({'items':[{'type':'input','props':{'title':_0x35ff('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x35ff('0x3'),'type':_0x35ff('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0x35ff('0x20')},'props':{'title':_0x35ff('0x20'),'helpText':_0x35ff('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x35ff('0x1c')](_0x35ff('0x22'))?JSON[_0x35ff('0x23')](this[_0x35ff('0x1c')](_0x35ff('0x22'))):{};},'set':function(_0x105e58){return this['setDataValue'](_0x35ff('0x22'),JSON['stringify'](_0x105e58));}},'token':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':function(){return rs[_0x35ff('0x24')]();}},'autoclose':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x35ff('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x35ff('0x1')]},'waitingTitle':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x35ff('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x27')},'skipUnmanaged':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x15')},'sendUnmanaged':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x35ff('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x35ff('0x1')]},'notificationTemplate':{'type':Sequelize[_0x35ff('0xe')],'defaultValue':function(){return _0x35ff('0x28');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x35ff('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x2b')},'messagesAlignment':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x2c')},'defaultTitle':{'type':Sequelize[_0x35ff('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x35ff('0xc')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x35ff('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x35ff('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x2d')},'systemAvatar':{'type':Sequelize[_0x35ff('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x35ff('0xc')],'comment':_0x35ff('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x550c09){if(!_0x550c09)this[_0x35ff('0x1e')](_0x35ff('0x2f'),null);this[_0x35ff('0x1e')](_0x35ff('0x30'),_0x550c09);}},'vidaooEscalation':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![],'defaultValue':_0x35ff('0x31')},'vidaooNote':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':function(){return _0x35ff('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x35ff('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x35ff('0x7')],'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 0fc30c4..6ff59bd 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 _0xc9b2=['push','close','unmanaged','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','send','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','MailAccountId','toPairsIn','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','User','fullname','internal','Tags','color','tag','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','getProactiveActions','../../config/license/util','virtual','License','chatLicenseExceeded','Intervals','all','some','URL','origin','3.1.0','remote','connection','remoteAddress','replace','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','false','onlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','update','destroy','get','ChatWebsites','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','body','user','role','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','order','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','addCustomerAvatar','filename','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','customerAvatar','getSystemAvatar','notify','user-agent','Sequelize','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','Applications','account','applications','list','orderBy','priority','asc','from','contact','customerIp','headers','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','autoclose'];(function(_0x21e294,_0x4f09ec){var _0x2b3d04=function(_0x40c1c4){while(--_0x40c1c4){_0x21e294['push'](_0x21e294['shift']());}};_0x2b3d04(++_0x4f09ec);}(_0xc9b2,0x1a1));var _0x2c9b=function(_0x515f04,_0x55c951){_0x515f04=_0x515f04-0x0;var _0xa11c90=_0xc9b2[_0x515f04];return _0xa11c90;};'use strict';var BPromise=require(_0x2c9b('0x0'));var Mustache=require(_0x2c9b('0x1'));var util=require(_0x2c9b('0x2'));var path=require(_0x2c9b('0x3'));var ejs=require(_0x2c9b('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c9b('0x5'));var querystring=require(_0x2c9b('0x6'));var Redis=require(_0x2c9b('0x7'));var qs=require(_0x2c9b('0x8'));var logger=require(_0x2c9b('0x9'))(_0x2c9b('0xa'));var config=require('../../config/environment');var url=require(_0x2c9b('0xb'));var db=require(_0x2c9b('0xc'))['db'];config[_0x2c9b('0xd')]=_[_0x2c9b('0xe')](config[_0x2c9b('0xd')],{'host':_0x2c9b('0xf'),'port':0x18eb});var socket=require(_0x2c9b('0x10'))(new Redis(config[_0x2c9b('0xd')]));require(_0x2c9b('0x11'))[_0x2c9b('0x12')](socket);var htmlToText=require(_0x2c9b('0x13'));var jayson=require(_0x2c9b('0x14'));var client=jayson[_0x2c9b('0x15')][_0x2c9b('0x16')]({'port':0x232c});var client9002=jayson['client'][_0x2c9b('0x16')]({'port':0x232a});var client9003=jayson[_0x2c9b('0x15')]['http']({'port':0x232b});var client9001=jayson[_0x2c9b('0x15')][_0x2c9b('0x16')]({'port':0x2329});function respondWithRpcPromise(_0x26c8d2,_0x33075e,_0x556dde,_0x270d3f){return new BPromise(function(_0xd9b4a7,_0x295e58){var _0x3b7410=_0x270d3f||client;return _0x3b7410['request'](_0x26c8d2,_0x556dde)[_0x2c9b('0x17')](function(_0x467026){logger[_0x2c9b('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x33075e,_0x2c9b('0x19'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x33075e,'request\x20sent',JSON[_0x2c9b('0x1a')](_0x467026));if(_0x467026['error']){if(_0x467026[_0x2c9b('0x1b')][_0x2c9b('0x1c')]===0x1f4){logger[_0x2c9b('0x1b')](_0x2c9b('0x1d'),_0x33075e,_0x467026['error'][_0x2c9b('0x1e')]);return _0x295e58(_0x467026[_0x2c9b('0x1b')][_0x2c9b('0x1e')]);}logger[_0x2c9b('0x1b')](_0x2c9b('0x1d'),_0x33075e,_0x467026[_0x2c9b('0x1b')][_0x2c9b('0x1e')]);return _0xd9b4a7(_0x467026[_0x2c9b('0x1b')][_0x2c9b('0x1e')]);}else{logger['info'](_0x2c9b('0x1d'),_0x33075e,_0x2c9b('0x19'));_0xd9b4a7(_0x467026[_0x2c9b('0x1f')][_0x2c9b('0x1e')]);}})['catch'](function(_0x1769d5){logger[_0x2c9b('0x1b')](_0x2c9b('0x1d'),_0x33075e,_0x1769d5);_0x295e58(_0x1769d5);});});}function respondWithStatusCode(_0x42cdbe,_0x27e310){_0x27e310=_0x27e310||0xcc;return function(_0x3f920c){if(_0x3f920c){return _0x42cdbe[_0x2c9b('0x20')](_0x27e310);}return _0x42cdbe['status'](_0x27e310)[_0x2c9b('0x21')]();};}function respondWithResult(_0x2bc187,_0x3cbb51){_0x3cbb51=_0x3cbb51||0xc8;return function(_0x30cfca){if(_0x30cfca){return _0x2bc187[_0x2c9b('0x22')](_0x3cbb51)['json'](_0x30cfca);}};}function respondWithFilteredResult(_0x4de579,_0x339f31){return function(_0x5509de){if(_0x5509de){var _0x1b45d4=typeof _0x339f31[_0x2c9b('0x23')]==='undefined'&&typeof _0x339f31[_0x2c9b('0x24')]===_0x2c9b('0x25');var _0x285919=_0x5509de[_0x2c9b('0x26')];var _0x1120cc=_0x1b45d4?0x0:_0x339f31[_0x2c9b('0x23')];var _0x2e9e07=_0x1b45d4?_0x5509de['count']:_0x339f31['offset']+_0x339f31[_0x2c9b('0x24')];var _0x2d3c9b;if(_0x2e9e07>=_0x285919){_0x2e9e07=_0x285919;_0x2d3c9b=0xc8;}else{_0x2d3c9b=0xce;}_0x4de579['status'](_0x2d3c9b);return _0x4de579[_0x2c9b('0x27')](_0x2c9b('0x28'),_0x1120cc+'-'+_0x2e9e07+'/'+_0x285919)[_0x2c9b('0x29')](_0x5509de);}return null;};}function saveUpdates(_0x2093b5){return function(_0x54a46d){if(_0x54a46d){return _0x54a46d[_0x2c9b('0x2a')](_0x2093b5)[_0x2c9b('0x17')](function(_0x13b597){return _0x13b597;});}return null;};}function removeEntity(_0x374155){return function(_0x15a1e3){if(_0x15a1e3){return _0x15a1e3[_0x2c9b('0x2b')]()[_0x2c9b('0x17')](function(){var _0xe1840f=_0x15a1e3[_0x2c9b('0x2c')]({'plain':!![]});var _0x2b8ad0=_0x2c9b('0x2d');return db['UserProfileResource']['destroy']({'where':{'type':_0x2b8ad0,'resourceId':_0xe1840f['id']}})['then'](function(){return _0x15a1e3;});})['then'](function(){_0x374155[_0x2c9b('0x22')](0xcc)[_0x2c9b('0x21')]();});}};}function handleEntityNotFound(_0x54025e){return function(_0x563d3f){if(!_0x563d3f){_0x54025e[_0x2c9b('0x20')](0x194);}return _0x563d3f;};}function handleError(_0x51514a,_0x335801){_0x335801=_0x335801||0x1f4;return function(_0x1d115a){logger[_0x2c9b('0x1b')](_0x1d115a[_0x2c9b('0x2e')]);if(_0x1d115a['name']){delete _0x1d115a[_0x2c9b('0x2f')];}_0x51514a[_0x2c9b('0x22')](_0x335801)['send'](_0x1d115a);};}exports[_0x2c9b('0x30')]=function(_0x4aba94,_0x183d72){var _0xc8fdb={'include':[{'model':db[_0x2c9b('0x31')],'as':_0x2c9b('0x32')}]},_0x36e548={},_0x457aa2={'count':0x0,'rows':[]};var _0x17b9ad=_[_0x2c9b('0x33')](db[_0x2c9b('0x34')][_0x2c9b('0x35')],function(_0xb3f4c8){return{'name':_0xb3f4c8['fieldName'],'type':_0xb3f4c8[_0x2c9b('0x36')]['key']};});_0x36e548[_0x2c9b('0x37')]=_['map'](_0x17b9ad,'name');_0x36e548['query']=_['keys'](_0x4aba94[_0x2c9b('0x38')]);_0x36e548[_0x2c9b('0x39')]=_[_0x2c9b('0x3a')](_0x36e548[_0x2c9b('0x37')],_0x36e548[_0x2c9b('0x38')]);_0xc8fdb[_0x2c9b('0x3b')]=_[_0x2c9b('0x3a')](_0x36e548[_0x2c9b('0x37')],qs['fields'](_0x4aba94[_0x2c9b('0x38')][_0x2c9b('0x3c')]));_0xc8fdb[_0x2c9b('0x3b')]=_0xc8fdb[_0x2c9b('0x3b')]['length']?_0xc8fdb[_0x2c9b('0x3b')]:_0x36e548['model'];if(!_0x4aba94[_0x2c9b('0x38')][_0x2c9b('0x3d')]('nolimit')){_0xc8fdb['limit']=qs[_0x2c9b('0x24')](_0x4aba94[_0x2c9b('0x38')][_0x2c9b('0x24')]);_0xc8fdb[_0x2c9b('0x23')]=qs[_0x2c9b('0x23')](_0x4aba94[_0x2c9b('0x38')][_0x2c9b('0x23')]);}_0xc8fdb['order']=qs[_0x2c9b('0x3e')](_0x4aba94[_0x2c9b('0x38')][_0x2c9b('0x3e')]);_0xc8fdb[_0x2c9b('0x3f')]=qs[_0x2c9b('0x39')](_[_0x2c9b('0x40')](_0x4aba94[_0x2c9b('0x38')],_0x36e548[_0x2c9b('0x39')]),_0x17b9ad);if(_0x4aba94['query'][_0x2c9b('0x41')]){_0xc8fdb[_0x2c9b('0x3f')]=_[_0x2c9b('0x42')](_0xc8fdb['where'],{'$or':_[_0x2c9b('0x33')](_0x17b9ad,function(_0x5b17a1){if(_0x5b17a1['type']!==_0x2c9b('0x43')){var _0x3e8981={};_0x3e8981[_0x5b17a1[_0x2c9b('0x2f')]]={'$like':'%'+_0x4aba94['query']['filter']+'%'};return _0x3e8981;}})});}_0xc8fdb=_['merge']({},_0xc8fdb,_0x4aba94[_0x2c9b('0x44')]);var _0x2e6278={'where':_0xc8fdb[_0x2c9b('0x3f')]};return db[_0x2c9b('0x34')][_0x2c9b('0x26')](_0x2e6278)[_0x2c9b('0x17')](function(_0x2a8c0f){_0x457aa2[_0x2c9b('0x26')]=_0x2a8c0f;if(_0x4aba94[_0x2c9b('0x38')][_0x2c9b('0x45')]){_0xc8fdb[_0x2c9b('0x46')]=[{'all':!![]}];}return db[_0x2c9b('0x34')][_0x2c9b('0x47')](_0xc8fdb);})[_0x2c9b('0x17')](function(_0x58f53f){_0x457aa2[_0x2c9b('0x48')]=_0x58f53f;return _0x457aa2;})[_0x2c9b('0x17')](respondWithFilteredResult(_0x183d72,_0xc8fdb))['catch'](handleError(_0x183d72,null));};exports[_0x2c9b('0x49')]=function(_0x59cb42,_0x50c5d7){var _0x1293e8={'raw':![],'where':{'id':_0x59cb42[_0x2c9b('0x4a')]['id']},'include':[{'model':db[_0x2c9b('0x31')],'as':_0x2c9b('0x32')}]},_0x52eb28={};_0x52eb28[_0x2c9b('0x37')]=_[_0x2c9b('0x4b')](db[_0x2c9b('0x34')]['rawAttributes']);_0x52eb28['query']=_[_0x2c9b('0x4b')](_0x59cb42['query']);_0x52eb28[_0x2c9b('0x39')]=_[_0x2c9b('0x3a')](_0x52eb28[_0x2c9b('0x37')],_0x52eb28[_0x2c9b('0x38')]);_0x1293e8[_0x2c9b('0x3b')]=_[_0x2c9b('0x3a')](_0x52eb28[_0x2c9b('0x37')],qs[_0x2c9b('0x3c')](_0x59cb42[_0x2c9b('0x38')][_0x2c9b('0x3c')]));_0x1293e8['attributes']=_0x1293e8[_0x2c9b('0x3b')][_0x2c9b('0x4c')]?_0x1293e8[_0x2c9b('0x3b')]:_0x52eb28[_0x2c9b('0x37')];if(_0x59cb42[_0x2c9b('0x38')][_0x2c9b('0x45')]){_0x1293e8[_0x2c9b('0x46')]=[{'all':!![]}];}_0x1293e8=_[_0x2c9b('0x42')]({},_0x1293e8,_0x59cb42['options']);return db['ChatWebsite'][_0x2c9b('0x4d')](_0x1293e8)[_0x2c9b('0x17')](handleEntityNotFound(_0x50c5d7,null))[_0x2c9b('0x17')](respondWithResult(_0x50c5d7,null))[_0x2c9b('0x4e')](handleError(_0x50c5d7,null));};exports['create']=function(_0x44affd,_0x5b8eb1){return db[_0x2c9b('0x34')]['create'](_0x44affd[_0x2c9b('0x4f')],{})['then'](function(_0x2cdd26){var _0x5c0a0e=_0x44affd[_0x2c9b('0x50')][_0x2c9b('0x2c')]({'plain':!![]});if(!_0x5c0a0e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c0a0e[_0x2c9b('0x51')]==='user'){var _0x1aca97=_0x2cdd26[_0x2c9b('0x2c')]({'plain':!![]});var _0x3be14e=_0x2c9b('0x2d');return db['UserProfileSection'][_0x2c9b('0x4d')]({'where':{'name':_0x3be14e,'userProfileId':_0x5c0a0e[_0x2c9b('0x52')]},'raw':!![]})[_0x2c9b('0x17')](function(_0x363afe){if(_0x363afe&&_0x363afe[_0x2c9b('0x53')]===0x0){return db[_0x2c9b('0x54')][_0x2c9b('0x55')]({'name':_0x1aca97[_0x2c9b('0x2f')],'resourceId':_0x1aca97['id'],'type':_0x363afe[_0x2c9b('0x2f')],'sectionId':_0x363afe['id']},{})[_0x2c9b('0x17')](function(){return _0x2cdd26;});}else{return _0x2cdd26;}})[_0x2c9b('0x4e')](function(_0xd2b191){logger['error'](_0x2c9b('0x56'),_0xd2b191);throw _0xd2b191;});}return _0x2cdd26;})[_0x2c9b('0x17')](respondWithResult(_0x5b8eb1,0xc9))[_0x2c9b('0x4e')](handleError(_0x5b8eb1,null));};exports[_0x2c9b('0x2a')]=function(_0x28f1b3,_0x30c961){if(_0x28f1b3[_0x2c9b('0x4f')]['id']){delete _0x28f1b3[_0x2c9b('0x4f')]['id'];}return db[_0x2c9b('0x34')][_0x2c9b('0x4d')]({'where':{'id':_0x28f1b3[_0x2c9b('0x4a')]['id']},'include':[{'model':db[_0x2c9b('0x31')],'as':_0x2c9b('0x32')}]})[_0x2c9b('0x17')](handleEntityNotFound(_0x30c961,null))['then'](saveUpdates(_0x28f1b3[_0x2c9b('0x4f')],null))[_0x2c9b('0x17')](respondWithResult(_0x30c961,null))[_0x2c9b('0x4e')](handleError(_0x30c961,null));};exports[_0x2c9b('0x2b')]=function(_0x4ec757,_0x582b1b){return db[_0x2c9b('0x34')][_0x2c9b('0x4d')]({'where':{'id':_0x4ec757[_0x2c9b('0x4a')]['id']}})[_0x2c9b('0x17')](handleEntityNotFound(_0x582b1b,null))[_0x2c9b('0x17')](removeEntity(_0x582b1b,null))[_0x2c9b('0x4e')](handleError(_0x582b1b,null));};exports[_0x2c9b('0x57')]=function(_0x44fc82,_0x31ce79){return db[_0x2c9b('0x34')][_0x2c9b('0x57')]()['then'](respondWithResult(_0x31ce79,null))['catch'](handleError(_0x31ce79,null));};exports[_0x2c9b('0x58')]=function(_0x3f3e7a,_0x27c8bd){if(_0x3f3e7a[_0x2c9b('0x4f')]['id']){delete _0x3f3e7a['body']['id'];}return db['ChatWebsite'][_0x2c9b('0x4d')]({'where':{'id':_0x3f3e7a[_0x2c9b('0x4a')]['id']}})[_0x2c9b('0x17')](handleEntityNotFound(_0x27c8bd,null))['then'](function(_0x545db0){if(_0x545db0){_0x3f3e7a[_0x2c9b('0x4f')]['ChatWebsiteId']=_0x545db0['id'];return db[_0x2c9b('0x59')][_0x2c9b('0x55')](_0x3f3e7a[_0x2c9b('0x4f')]);}})[_0x2c9b('0x17')](respondWithResult(_0x27c8bd,null))[_0x2c9b('0x4e')](handleError(_0x27c8bd,null));};exports[_0x2c9b('0x5a')]=function(_0x556cc6,_0x4389a3){var _0x2280c1={'raw':![],'where':{}};var _0x849266={};var _0x38eb74={'count':0x0,'rows':[]};return db[_0x2c9b('0x34')][_0x2c9b('0x5b')]({'where':{'id':_0x556cc6['params']['id']}})['then'](handleEntityNotFound(_0x4389a3,null))[_0x2c9b('0x17')](function(_0x10f9dc){if(_0x10f9dc){_0x849266[_0x2c9b('0x37')]=_[_0x2c9b('0x4b')](db[_0x2c9b('0x59')]['rawAttributes']);_0x849266[_0x2c9b('0x38')]=_['keys'](_0x556cc6['query']);_0x849266[_0x2c9b('0x39')]=_[_0x2c9b('0x3a')](_0x849266[_0x2c9b('0x37')],_0x849266['query']);_0x2280c1[_0x2c9b('0x3b')]=_[_0x2c9b('0x3a')](_0x849266[_0x2c9b('0x37')],qs[_0x2c9b('0x3c')](_0x556cc6[_0x2c9b('0x38')][_0x2c9b('0x3c')]));_0x2280c1[_0x2c9b('0x3b')]=_0x2280c1[_0x2c9b('0x3b')][_0x2c9b('0x4c')]?_0x2280c1[_0x2c9b('0x3b')]:_0x849266[_0x2c9b('0x37')];if(!_0x556cc6[_0x2c9b('0x38')][_0x2c9b('0x3d')](_0x2c9b('0x5c'))){_0x2280c1[_0x2c9b('0x24')]=qs[_0x2c9b('0x24')](_0x556cc6[_0x2c9b('0x38')][_0x2c9b('0x24')]);_0x2280c1[_0x2c9b('0x23')]=qs['offset'](_0x556cc6[_0x2c9b('0x38')][_0x2c9b('0x23')]);}_0x2280c1[_0x2c9b('0x5d')]=qs[_0x2c9b('0x3e')](_0x556cc6['query'][_0x2c9b('0x3e')]);_0x2280c1[_0x2c9b('0x3f')]=qs[_0x2c9b('0x39')](_[_0x2c9b('0x40')](_0x556cc6[_0x2c9b('0x38')],_0x849266[_0x2c9b('0x39')]));_0x2280c1[_0x2c9b('0x3f')][_0x2c9b('0x5e')]=_0x10f9dc['id'];if(_0x556cc6['query'][_0x2c9b('0x41')]){_0x2280c1[_0x2c9b('0x3f')]=_[_0x2c9b('0x42')](_0x2280c1[_0x2c9b('0x3f')],{'$or':_[_0x2c9b('0x33')](_0x2280c1[_0x2c9b('0x3b')],function(_0x5a0d54){var _0x5cbb80={};_0x5cbb80[_0x5a0d54]={'$like':'%'+_0x556cc6[_0x2c9b('0x38')]['filter']+'%'};return _0x5cbb80;})});}_0x2280c1=_[_0x2c9b('0x42')]({},_0x2280c1,_0x556cc6[_0x2c9b('0x44')]);return db['Disposition'][_0x2c9b('0x26')]({'where':_0x2280c1[_0x2c9b('0x3f')]})[_0x2c9b('0x17')](function(_0x5d7b4c){_0x38eb74['count']=_0x5d7b4c;if(_0x556cc6[_0x2c9b('0x38')]['includeAll']){_0x2280c1[_0x2c9b('0x46')]=[{'all':!![]}];}return db['Disposition'][_0x2c9b('0x47')](_0x2280c1);})['then'](function(_0x1e9183){_0x38eb74['rows']=_0x1e9183;return _0x38eb74;});}})[_0x2c9b('0x17')](respondWithFilteredResult(_0x4389a3,_0x2280c1))[_0x2c9b('0x4e')](handleError(_0x4389a3,null));};exports[_0x2c9b('0x5f')]=function(_0xafe615,_0x42d283){return db[_0x2c9b('0x34')][_0x2c9b('0x4d')]({'where':{'id':_0xafe615['params']['id']}})['then'](handleEntityNotFound(_0x42d283,null))[_0x2c9b('0x17')](function(_0x359b70){if(_0x359b70){return _0x359b70[_0x2c9b('0x5f')](_0xafe615['query'][_0x2c9b('0x60')]);}})[_0x2c9b('0x17')](respondWithStatusCode(_0x42d283,null))['catch'](handleError(_0x42d283,null));};exports[_0x2c9b('0x61')]=function(_0x3c6459,_0x18590b){if(_0x3c6459['body']['id']){delete _0x3c6459['body']['id'];}return db[_0x2c9b('0x34')]['find']({'where':{'id':_0x3c6459[_0x2c9b('0x4a')]['id']}})[_0x2c9b('0x17')](handleEntityNotFound(_0x18590b,null))[_0x2c9b('0x17')](function(_0x5c5c36){if(_0x5c5c36){_0x3c6459[_0x2c9b('0x4f')][_0x2c9b('0x5e')]=_0x5c5c36['id'];return db[_0x2c9b('0x62')][_0x2c9b('0x55')](_0x3c6459[_0x2c9b('0x4f')]);}})['then'](respondWithResult(_0x18590b,null))[_0x2c9b('0x4e')](handleError(_0x18590b,null));};exports[_0x2c9b('0x63')]=function(_0x214a6d,_0x5b1d4c){var _0x49be59={'raw':![],'where':{}};var _0x335a9c={};var _0x3c41a6={'count':0x0,'rows':[]};return db[_0x2c9b('0x34')][_0x2c9b('0x5b')]({'where':{'id':_0x214a6d[_0x2c9b('0x4a')]['id']}})[_0x2c9b('0x17')](handleEntityNotFound(_0x5b1d4c,null))[_0x2c9b('0x17')](function(_0x1677a1){if(_0x1677a1){_0x335a9c['model']=_[_0x2c9b('0x4b')](db[_0x2c9b('0x62')][_0x2c9b('0x35')]);_0x335a9c['query']=_[_0x2c9b('0x4b')](_0x214a6d['query']);_0x335a9c[_0x2c9b('0x39')]=_[_0x2c9b('0x3a')](_0x335a9c[_0x2c9b('0x37')],_0x335a9c[_0x2c9b('0x38')]);_0x49be59[_0x2c9b('0x3b')]=_[_0x2c9b('0x3a')](_0x335a9c['model'],qs[_0x2c9b('0x3c')](_0x214a6d['query'][_0x2c9b('0x3c')]));_0x49be59[_0x2c9b('0x3b')]=_0x49be59[_0x2c9b('0x3b')][_0x2c9b('0x4c')]?_0x49be59['attributes']:_0x335a9c['model'];if(!_0x214a6d[_0x2c9b('0x38')]['hasOwnProperty'](_0x2c9b('0x5c'))){_0x49be59['limit']=qs[_0x2c9b('0x24')](_0x214a6d[_0x2c9b('0x38')][_0x2c9b('0x24')]);_0x49be59['offset']=qs[_0x2c9b('0x23')](_0x214a6d[_0x2c9b('0x38')][_0x2c9b('0x23')]);}_0x49be59[_0x2c9b('0x5d')]=qs[_0x2c9b('0x3e')](_0x214a6d['query'][_0x2c9b('0x3e')]);_0x49be59[_0x2c9b('0x3f')]=qs[_0x2c9b('0x39')](_[_0x2c9b('0x40')](_0x214a6d[_0x2c9b('0x38')],_0x335a9c[_0x2c9b('0x39')]));_0x49be59['where'][_0x2c9b('0x5e')]=_0x1677a1['id'];if(_0x214a6d['query'][_0x2c9b('0x41')]){_0x49be59[_0x2c9b('0x3f')]=_[_0x2c9b('0x42')](_0x49be59[_0x2c9b('0x3f')],{'$or':_[_0x2c9b('0x33')](_0x49be59[_0x2c9b('0x3b')],function(_0x24a05f){var _0x288262={};_0x288262[_0x24a05f]={'$like':'%'+_0x214a6d[_0x2c9b('0x38')][_0x2c9b('0x41')]+'%'};return _0x288262;})});}_0x49be59=_['merge']({},_0x49be59,_0x214a6d[_0x2c9b('0x44')]);return db[_0x2c9b('0x62')][_0x2c9b('0x26')]({'where':_0x49be59[_0x2c9b('0x3f')]})[_0x2c9b('0x17')](function(_0x2f6441){_0x3c41a6['count']=_0x2f6441;if(_0x214a6d[_0x2c9b('0x38')][_0x2c9b('0x45')]){_0x49be59[_0x2c9b('0x46')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2c9b('0x47')](_0x49be59);})['then'](function(_0x23378c){_0x3c41a6[_0x2c9b('0x48')]=_0x23378c;return _0x3c41a6;});}})[_0x2c9b('0x17')](respondWithFilteredResult(_0x5b1d4c,_0x49be59))[_0x2c9b('0x4e')](handleError(_0x5b1d4c,null));};exports[_0x2c9b('0x64')]=function(_0x2c0f7a,_0x2e9dd3){return db[_0x2c9b('0x34')][_0x2c9b('0x4d')]({'where':{'id':_0x2c0f7a[_0x2c9b('0x4a')]['id']}})[_0x2c9b('0x17')](handleEntityNotFound(_0x2e9dd3,null))[_0x2c9b('0x17')](function(_0x5d7877){if(_0x5d7877){return _0x5d7877[_0x2c9b('0x64')](_0x2c0f7a[_0x2c9b('0x38')][_0x2c9b('0x60')]);}})[_0x2c9b('0x17')](respondWithStatusCode(_0x2e9dd3,null))['catch'](handleError(_0x2e9dd3,null));};exports[_0x2c9b('0x65')]=function(_0x581168,_0x426ae7){_0x581168[_0x2c9b('0x4f')][_0x2c9b('0x66')]=_0x581168[_0x2c9b('0x67')]['filename'];return db[_0x2c9b('0x34')][_0x2c9b('0x4d')]({'where':{'id':_0x581168[_0x2c9b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x426ae7,null))[_0x2c9b('0x17')](saveUpdates(_0x581168[_0x2c9b('0x4f')],null))[_0x2c9b('0x17')](respondWithResult(_0x426ae7,null))[_0x2c9b('0x4e')](handleError(_0x426ae7,null));};exports[_0x2c9b('0x68')]=function(_0x156ffe,_0x347b19){_0x156ffe['body'][_0x2c9b('0x69')]=_0x156ffe['file']['filename'];return db['ChatWebsite'][_0x2c9b('0x4d')]({'where':{'id':_0x156ffe[_0x2c9b('0x4a')]['id']}})[_0x2c9b('0x17')](handleEntityNotFound(_0x347b19,null))['then'](saveUpdates(_0x156ffe['body'],null))[_0x2c9b('0x17')](respondWithResult(_0x347b19,null))['catch'](handleError(_0x347b19,null));};exports[_0x2c9b('0x6a')]=function(_0x57af0f,_0x5cc592){_0x57af0f['body']['customerAvatar']=_0x57af0f[_0x2c9b('0x67')][_0x2c9b('0x6b')];return db[_0x2c9b('0x34')]['find']({'where':{'id':_0x57af0f['params']['id']}})['then'](handleEntityNotFound(_0x5cc592,null))[_0x2c9b('0x17')](saveUpdates(_0x57af0f[_0x2c9b('0x4f')],null))[_0x2c9b('0x17')](respondWithResult(_0x5cc592,null))['catch'](handleError(_0x5cc592,null));};exports[_0x2c9b('0x6c')]=function(_0x221bb8,_0x1169b5){_0x221bb8['body'][_0x2c9b('0x6d')]=_0x221bb8[_0x2c9b('0x67')][_0x2c9b('0x6b')];return db[_0x2c9b('0x34')]['find']({'where':{'id':_0x221bb8[_0x2c9b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1169b5,null))[_0x2c9b('0x17')](saveUpdates(_0x221bb8[_0x2c9b('0x4f')],null))['then'](respondWithResult(_0x1169b5,null))[_0x2c9b('0x4e')](handleError(_0x1169b5,null));};exports['getLogo']=function(_0x5a9a21,_0x296268){var _0x184675=path[_0x2c9b('0x6e')](config[_0x2c9b('0x6f')],_0x2c9b('0x70'));var _0x516ff6={'where':{'id':_0x5a9a21[_0x2c9b('0x4a')]['id']},'attributes':['id',_0x2c9b('0x66')],'raw':!![]};var _0x145b39=![];return require('../../config/license/util')[_0x2c9b('0x71')]()[_0x2c9b('0x17')](function(_0x6bbda5){if(_0x6bbda5){_0x145b39=_0x6bbda5[_0x2c9b('0x72')];}})[_0x2c9b('0x17')](function(){return db[_0x2c9b('0x34')][_0x2c9b('0x4d')](_0x516ff6);})['then'](handleEntityNotFound(_0x296268,null))[_0x2c9b('0x17')](function(_0x1c1d57){if(_0x1c1d57){if(!_[_0x2c9b('0x73')](_0x1c1d57[_0x2c9b('0x66')])){if(fs[_0x2c9b('0x74')](path[_0x2c9b('0x6e')](config['root'],_0x2c9b('0x75'),_0x1c1d57[_0x2c9b('0x66')]))&&_0x145b39){_0x184675=path[_0x2c9b('0x6e')](config[_0x2c9b('0x6f')],_0x2c9b('0x75'),_0x1c1d57[_0x2c9b('0x66')]);}}return _0x296268[_0x2c9b('0x76')](_0x184675);}})[_0x2c9b('0x4e')](handleError(_0x296268,null));};exports[_0x2c9b('0x77')]=function(_0x152d5a,_0x23dafa){var _0x5c281d=path['join'](config['root'],_0x2c9b('0x78'));var _0x3f4257={'where':{'id':_0x152d5a[_0x2c9b('0x4a')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0x2c9b('0x4d')](_0x3f4257)['then'](handleEntityNotFound(_0x23dafa,null))['then'](function(_0x405d8c){if(_0x405d8c){if(!_[_0x2c9b('0x73')](_0x405d8c[_0x2c9b('0x69')])){if(fs[_0x2c9b('0x74')](path[_0x2c9b('0x6e')](config[_0x2c9b('0x6f')],_0x2c9b('0x79'),_0x405d8c[_0x2c9b('0x69')]))){_0x5c281d=path['join'](config[_0x2c9b('0x6f')],_0x2c9b('0x79'),_0x405d8c[_0x2c9b('0x69')]);}}return _0x23dafa['download'](_0x5c281d);}})[_0x2c9b('0x4e')](handleError(_0x23dafa,null));};exports[_0x2c9b('0x7a')]=function(_0x2ff42b,_0x2a7816){var _0x3fc706=path[_0x2c9b('0x6e')](config[_0x2c9b('0x6f')],'server/files/images/avatars/customer_avatar.png');var _0x8df921={'where':{'id':_0x2ff42b[_0x2c9b('0x4a')]['id']},'attributes':['id','customerAvatar',_0x2c9b('0x7b')],'raw':!![]};return db[_0x2c9b('0x34')][_0x2c9b('0x4d')](_0x8df921)[_0x2c9b('0x17')](handleEntityNotFound(_0x2a7816,null))[_0x2c9b('0x17')](function(_0x185bd9){if(_0x185bd9){if(!_[_0x2c9b('0x73')](_0x185bd9[_0x2c9b('0x7c')])){if(fs[_0x2c9b('0x74')](path[_0x2c9b('0x6e')](config[_0x2c9b('0x6f')],_0x2c9b('0x79'),_0x185bd9[_0x2c9b('0x7c')]))&&_0x185bd9[_0x2c9b('0x7b')]){_0x3fc706=path[_0x2c9b('0x6e')](config[_0x2c9b('0x6f')],_0x2c9b('0x79'),_0x185bd9[_0x2c9b('0x7c')]);}}return _0x2a7816[_0x2c9b('0x76')](_0x3fc706);}})[_0x2c9b('0x4e')](handleError(_0x2a7816,null));};exports[_0x2c9b('0x7d')]=function(_0x533331,_0x485db1){var _0xf6fd20=path[_0x2c9b('0x6e')](config[_0x2c9b('0x6f')],'server/files/images/avatars/system_avatar.png');var _0x126b89={'where':{'id':_0x533331[_0x2c9b('0x4a')]['id']},'attributes':['id',_0x2c9b('0x6d')],'raw':!![]};return db['ChatWebsite'][_0x2c9b('0x4d')](_0x126b89)['then'](handleEntityNotFound(_0x485db1,null))[_0x2c9b('0x17')](function(_0x4bc96b){if(_0x4bc96b){if(!_[_0x2c9b('0x73')](_0x4bc96b['systemAvatar'])){if(fs['existsSync'](path['join'](config[_0x2c9b('0x6f')],_0x2c9b('0x79'),_0x4bc96b[_0x2c9b('0x6d')]))){_0xf6fd20=path['join'](config['root'],_0x2c9b('0x79'),_0x4bc96b[_0x2c9b('0x6d')]);}}return _0x485db1['download'](_0xf6fd20);}})[_0x2c9b('0x4e')](handleError(_0x485db1,null));};exports[_0x2c9b('0x7e')]=function(_0x3b748b,_0x2af288){var _0x2d1cbd=require('user-agent-parser');var _0x4c84a8=new _0x2d1cbd();var _0x30ec93=_0x4c84a8['setUA'](_0x3b748b['headers'][_0x2c9b('0x7f')])['getResult']();var _0x559a46={'body':_0x3b748b[_0x2c9b('0x4f')],'channel':'chat'};var _0xf1874a=[];var _0x402df0=[];var _0x3310c4={};var _0x251091=![];return db['CmContact'][_0x2c9b('0x57')]()[_0x2c9b('0x17')](function(_0xd33217){if(!_0xd33217){throw new db[(_0x2c9b('0x80'))]['ValidationError'](_0x2c9b('0x81'));}_0xf1874a=_[_0x2c9b('0x82')](_[_0x2c9b('0x4b')](_0xd33217),['createdAt','updatedAt']);_0x402df0=_[_0x2c9b('0x82')](_[_0x2c9b('0x4b')](_0xd33217),['createdAt',_0x2c9b('0x83'),_0x2c9b('0x84'),_0x2c9b('0x85')]);if(_0x3b748b['body']['id']){delete _0x3b748b['body']['id'];}if(_['isNil'](_0x3b748b[_0x2c9b('0x4f')]['from'])){throw new db['Sequelize'][(_0x2c9b('0x86'))]('from\x20is\x20mandatory');}if(_[_0x2c9b('0x73')](_0x3b748b[_0x2c9b('0x4f')][_0x2c9b('0x4f')])||_0x3b748b[_0x2c9b('0x4f')]['body']===''){throw new db[(_0x2c9b('0x80'))]['ValidationError'](_0x2c9b('0x87'));}if(_['isNil'](_0x3b748b['body'][_0x2c9b('0x88')])){throw new db[(_0x2c9b('0x80'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x402df0);}if(!_[_0x2c9b('0x89')](_0x402df0,_0x3b748b[_0x2c9b('0x4f')][_0x2c9b('0x88')])){throw new db[(_0x2c9b('0x80'))][(_0x2c9b('0x86'))](_0x2c9b('0x8a')+_0x402df0);}_0x3310c4[_0x3b748b[_0x2c9b('0x4f')][_0x2c9b('0x88')]]=_0x3b748b[_0x2c9b('0x4f')]['from'];})[_0x2c9b('0x17')](function(){return db[_0x2c9b('0x34')][_0x2c9b('0x4d')]({'where':{'id':_0x3b748b[_0x2c9b('0x4a')]['id']},'include':[{'model':db[_0x2c9b('0x8b')],'as':_0x2c9b('0x8c'),'include':[{'model':db[_0x2c9b('0x8d')],'as':_0x2c9b('0x8e'),'where':_0x3310c4,'limit':0x1,'order':[[_0x2c9b('0x83'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x2c9b('0x8f')}]});})[_0x2c9b('0x17')](handleEntityNotFound(_0x2af288,null))['then'](function(_0x469021){if(_0x469021&&_0x469021[_0x2c9b('0x8c')]){_0x559a46[_0x2c9b('0x90')]=_0x469021;_0x559a46[_0x2c9b('0x91')]=_0x469021[_0x2c9b('0x8f')];_0x559a46[_0x2c9b('0x92')]=_0x469021[_0x2c9b('0x8c')];_0x559a46[_0x2c9b('0x91')]=_[_0x2c9b('0x93')](_0x559a46[_0x2c9b('0x91')],[_0x2c9b('0x94')],[_0x2c9b('0x95')]);if(_0x559a46[_0x2c9b('0x90')][_0x2c9b('0x8f')]){delete _0x559a46[_0x2c9b('0x90')][_0x2c9b('0x8f')];}if(_0x559a46['account'][_0x2c9b('0x8c')]&&_0x559a46[_0x2c9b('0x90')][_0x2c9b('0x8c')][_0x2c9b('0x8e')]['length']){return _0x559a46[_0x2c9b('0x90')]['List'][_0x2c9b('0x8e')][0x0];}var _0x17a3ac=_[_0x2c9b('0xe')](_0x3b748b['body'],{'firstName':_0x3b748b[_0x2c9b('0x4f')]['from'],'ListId':_0x469021[_0x2c9b('0x85')]});_0x17a3ac[_0x3b748b[_0x2c9b('0x4f')][_0x2c9b('0x88')]]=_0x3b748b[_0x2c9b('0x4f')][_0x2c9b('0x96')];return db[_0x2c9b('0x8d')][_0x2c9b('0x55')](_0x17a3ac,{'fields':_0xf1874a,'raw':!![]});}})['then'](handleEntityNotFound(_0x2af288,null))[_0x2c9b('0x17')](function(_0x3b0f56){_0x559a46[_0x2c9b('0x97')]=_0x3b0f56;var _0x2eb587=_0x3b748b[_0x2c9b('0x4f')][_0x2c9b('0x98')];if(_0x3b748b[_0x2c9b('0x99')]['cf-connecting-ip']){_0x2eb587=_0x3b748b['headers']['cf-connecting-ip'];}else if(_0x3b748b[_0x2c9b('0x99')][_0x2c9b('0x9a')]){_0x2eb587=_[_0x2c9b('0x9b')](_0x3b748b[_0x2c9b('0x99')][_0x2c9b('0x9a')][_0x2c9b('0x9c')](','));}if(_0x3b0f56){var _0x437333={'ContactId':_0x3b0f56['id'],'ChatWebsiteId':_0x3b748b[_0x2c9b('0x4a')]['id'],'from':(_0x3b0f56[_0x2c9b('0x9d')]||'')+'\x20'+(_0x3b0f56[_0x2c9b('0x9e')]||''),'customerIp':_0x2eb587,'customerPort':_0x3b748b[_0x2c9b('0x99')][_0x2c9b('0x9f')]?_0x3b748b['headers'][_0x2c9b('0x9f')]:null,'referer':_0x3b748b[_0x2c9b('0x4f')][_0x2c9b('0xa0')],'browserName':_0x30ec93[_0x2c9b('0xa1')]['name']&&_0x30ec93['browser'][_0x2c9b('0xa2')]?util[_0x2c9b('0xa3')]('%s\x20%s',_0x30ec93[_0x2c9b('0xa1')][_0x2c9b('0x2f')],_0x30ec93[_0x2c9b('0xa1')]['version']):'unknown','browserVersion':_0x30ec93['browser'][_0x2c9b('0xa2')]||_0x2c9b('0xa4'),'osName':util[_0x2c9b('0xa3')](_0x2c9b('0xa5'),_0x30ec93['os'][_0x2c9b('0x2f')],_0x30ec93['os'][_0x2c9b('0xa2')]),'osVersion':_0x30ec93['os']['version'],'deviceModel':_0x30ec93[_0x2c9b('0xa6')]['model']&&_0x30ec93[_0x2c9b('0xa6')][_0x2c9b('0xa7')]?util['format']('%s\x20%s\x20%s',_0x30ec93[_0x2c9b('0xa6')][_0x2c9b('0x37')],_0x30ec93[_0x2c9b('0xa6')][_0x2c9b('0xa7')],_0x30ec93[_0x2c9b('0xa6')]['type']):null,'deviceVendor':_0x30ec93['device'][_0x2c9b('0xa7')],'deviceType':_0x30ec93[_0x2c9b('0xa6')][_0x2c9b('0x36')],'formData':JSON[_0x2c9b('0x1a')](_0x3b748b[_0x2c9b('0x4f')])};var _0x2b0f8f={'ChatWebsiteId':_0x3b748b[_0x2c9b('0x4a')]['id'],'closed':![]};if(_0x3b748b[_0x2c9b('0x4f')]['threadId']){_0x2b0f8f['threadId']=_0x3b748b[_0x2c9b('0x4f')][_0x2c9b('0xa8')];return db[_0x2c9b('0xa9')]['find']({'where':_0x2b0f8f})[_0x2c9b('0x17')](function(_0x105424){if(_0x105424){return[_0x105424,![]];}_0x437333['threadId']=_0x3b748b[_0x2c9b('0x4f')]['threadId'];_0x437333[_0x2c9b('0xaa')]=_0x3b748b[_0x2c9b('0x4f')][_0x2c9b('0xaa')];return db[_0x2c9b('0xa9')][_0x2c9b('0x55')](_0x437333)[_0x2c9b('0x17')](function(_0x120442){return[_0x120442,!![]];});});}_0x2b0f8f[_0x2c9b('0xab')]=_0x3b0f56['id'];if(_0x3b748b[_0x2c9b('0x4f')][_0x2c9b('0xac')]&&_0x3b748b[_0x2c9b('0x4f')][_0x2c9b('0xac')]['id']){_0x2b0f8f['id']=_0x3b748b['body']['interaction']['id'];return db[_0x2c9b('0xa9')][_0x2c9b('0x4d')]({'where':_0x2b0f8f})[_0x2c9b('0x17')](function(_0x302dc2){if(_0x302dc2){return[_0x302dc2,![]];}return db[_0x2c9b('0xa9')][_0x2c9b('0x55')](_0x437333)[_0x2c9b('0x17')](function(_0x4ad540){return[_0x4ad540,!![]];});});}return db[_0x2c9b('0xa9')][_0x2c9b('0x55')](_0x437333)['then'](function(_0x223e74){return[_0x223e74,!![]];});}})['spread'](function(_0x57998a,_0x4ac647){if(_0x57998a){_0x251091=_0x4ac647;if(!_0x4ac647){var _0x52e336={'from':(_0x559a46['contact']['firstName']||'')+'\x20'+(_0x559a46['contact'][_0x2c9b('0x9e')]||'')};if(_0x3b748b[_0x2c9b('0x4f')][_0x2c9b('0xa8')]&&_0x3b748b[_0x2c9b('0x4f')][_0x2c9b('0xad')]&&_0x3b748b[_0x2c9b('0x4f')][_0x2c9b('0xa8')]!=_0x3b748b[_0x2c9b('0x4f')]['messageId']){_0x52e336[_0x2c9b('0xa8')]=_0x3b748b[_0x2c9b('0x4f')][_0x2c9b('0xad')];}return _0x57998a[_0x2c9b('0x2a')](_0x52e336);}else{return _0x57998a;}}})[_0x2c9b('0x17')](function(_0x43c00e){_0x559a46['interaction']=_0x43c00e[_0x2c9b('0x2c')]({'plain':!![]});_0x559a46[_0x2c9b('0xac')]['created']=_0x251091;if(_0x559a46[_0x2c9b('0xac')]['created']){if(_0x559a46[_0x2c9b('0x90')][_0x2c9b('0xae')]){_0x559a46['applications'][_0x2c9b('0xaf')]({'id':0x0,'priority':_0x559a46[_0x2c9b('0x91')][_0x2c9b('0x4c')]+0x1,'app':_0x2c9b('0xb0'),'appdata':_0x2c9b('0xb1'),'interval':'*,*,*,*'});}}return db[_0x2c9b('0xb2')][_0x2c9b('0x55')]({'body':_0x3b748b[_0x2c9b('0x4f')]['body'],'ChatWebsiteId':_0x3b748b['params']['id'],'ChatInteractionId':_0x43c00e['id'],'direction':'in','ContactId':_0x559a46[_0x2c9b('0x97')]['id'],'AttachmentId':_0x3b748b[_0x2c9b('0x4f')][_0x2c9b('0xb3')]});})[_0x2c9b('0x17')](function(_0x219d50){_0x559a46[_0x2c9b('0x1e')]=_0x219d50;if(_0x559a46[_0x2c9b('0xac')][_0x2c9b('0xb4')]){return db['User'][_0x2c9b('0x4d')]({'attributes':['id',_0x2c9b('0x2f')],'where':{'id':_0x559a46[_0x2c9b('0xac')][_0x2c9b('0xb4')]}})[_0x2c9b('0x17')](function(_0x29750e){if(_0x29750e){_0x559a46[_0x2c9b('0x91')][_0x2c9b('0xb5')]({'id':0x0,'priority':0x0,'app':_0x2c9b('0xb6'),'appdata':_0x29750e[_0x2c9b('0x2f')]+','+(_0x559a46[_0x2c9b('0x90')][_0x2c9b('0xb7')]||0xa),'interval':_0x2c9b('0xb8')});_0x559a46[_0x2c9b('0xb9')]=!![];}return respondWithRpcPromise(_0x2c9b('0xba'),'startRouting',_0x559a46);});}return respondWithRpcPromise(_0x2c9b('0xba'),_0x2c9b('0xbb'),_0x559a46);})[_0x2c9b('0x17')](function(_0xc9f3de){respondWithRpcPromise(_0x2c9b('0xbc'),_0x2c9b('0xbc'),{'event':'notify','message':_0xc9f3de},client9002);return _0xc9f3de;})[_0x2c9b('0x17')](respondWithResult(_0x2af288,null))['catch'](handleError(_0x2af288,null));};exports[_0x2c9b('0xbd')]=function(_0x145fb1,_0x3c23cd){var _0x3a33c7,_0x4f1eba,_0x4952a3;var _0x47c4b8=[];var _0x26bdee={};var _0x478040=_0x145fb1['files']||[];var _0x5910ca=[];var _0x48d42f;return db['CmContact'][_0x2c9b('0x57')]()[_0x2c9b('0x17')](function(_0x535868){if(!_0x535868){throw new db[(_0x2c9b('0x80'))][(_0x2c9b('0x86'))](_0x2c9b('0x81'));}_0x47c4b8=_[_0x2c9b('0x82')](_[_0x2c9b('0x4b')](_0x535868),['createdAt','updatedAt','CompanyId',_0x2c9b('0x85')]);if(_0x145fb1['body']['id']){delete _0x145fb1[_0x2c9b('0x4f')]['id'];}if(_[_0x2c9b('0x73')](_0x145fb1['body'][_0x2c9b('0x96')])){throw _0x3c23cd['status'](0x1f4)[_0x2c9b('0xbe')](new db[(_0x2c9b('0x80'))]['ValidationError']('from\x20is\x20mandatory'));}if(_['isNil'](_0x145fb1['body'][_0x2c9b('0x4f')])||_0x145fb1[_0x2c9b('0x4f')][_0x2c9b('0x4f')]===''){throw _0x3c23cd['status'](0x1f4)['send'](new db[(_0x2c9b('0x80'))][(_0x2c9b('0x86'))](_0x2c9b('0x87')));}if(_[_0x2c9b('0x73')](_0x145fb1[_0x2c9b('0x4f')][_0x2c9b('0xbf')])){throw _0x3c23cd[_0x2c9b('0x22')](0x1f4)['send'](new db[(_0x2c9b('0x80'))][(_0x2c9b('0x86'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x47c4b8));}if(!_['includes'](_0x47c4b8,_0x145fb1['body'][_0x2c9b('0xbf')])){throw _0x3c23cd['status'](0x1f4)[_0x2c9b('0xbe')](new db[(_0x2c9b('0x80'))]['ValidationError'](_0x2c9b('0xc0')+_0x47c4b8));}_0x26bdee[_0x145fb1['body'][_0x2c9b('0xbf')]]=_0x145fb1['body'][_0x2c9b('0x96')];})['then'](function(){return db[_0x2c9b('0x34')][_0x2c9b('0x4d')]({'where':{'id':_0x145fb1[_0x2c9b('0x4a')]['id']},'include':[{'model':db['CmList'],'as':_0x2c9b('0x8c')},{'model':db['MailAccount'],'as':_0x2c9b('0xc1')}]});})[_0x2c9b('0x17')](handleEntityNotFound(_0x3c23cd,null))['then'](function(_0x4a2d6c){if(_0x4a2d6c&&_0x4a2d6c[_0x2c9b('0x8c')]){_0x4f1eba=_0x4a2d6c;var _0x278b56=_[_0x2c9b('0xe')](_0x145fb1[_0x2c9b('0x4f')],{'firstName':_0x145fb1[_0x2c9b('0x4f')]['from'],'phone':_0x145fb1[_0x2c9b('0x4f')]['from'],'ListId':_0x4a2d6c['ListId']});_0x278b56[_0x145fb1[_0x2c9b('0x4f')][_0x2c9b('0xbf')]]=_0x145fb1[_0x2c9b('0x4f')]['from'];return db[_0x2c9b('0x8d')][_0x2c9b('0xc2')]({'where':_0x26bdee,'defaults':_0x278b56});}})[_0x2c9b('0xc3')](function(_0x465d57){if(_0x465d57){_0x4952a3=_0x465d57;var _0x312b79=fs[_0x2c9b('0xc4')](path[_0x2c9b('0x6e')](config[_0x2c9b('0x6f')],'server/files/templates/chatOfflineMessage.ejs'),_0x2c9b('0xc5'));var _0x4d23aa=ejs[_0x2c9b('0xc6')](_0x312b79,{'body':_[_0x2c9b('0xc7')](_0x145fb1[_0x2c9b('0x4f')][_0x2c9b('0x4f')]),'bodyTitle':_0x4f1eba[_0x2c9b('0xc8')]});return db[_0x2c9b('0xc9')]['create']({'body':_0x4d23aa,'plainBody':htmlToText[_0x2c9b('0xca')](_0x4d23aa),'ContactId':_0x465d57['id'],'ChatWebsiteId':_0x4f1eba['id']});}})['then'](function(_0x309d39){_0x48d42f=_0x309d39;if(_0x478040[_0x2c9b('0x4c')]){var _0x581ff8=_0x478040[_0x2c9b('0x33')](function(_0x392faa){return{'name':_0x392faa[_0x2c9b('0xcb')],'basename':_0x392faa[_0x2c9b('0x6b')],'type':_0x392faa[_0x2c9b('0xcc')],'ChatOfflineMessageId':_0x309d39['id']};});_0x5910ca=_0x581ff8[_0x2c9b('0x33')](_0xdae8c4=>{var _0x32c529={'filename':_0xdae8c4['name'],'path':path[_0x2c9b('0x6e')](config['root'],'server',_0x2c9b('0xcd'),_0x2c9b('0xce'),_0x2c9b('0xcf'),_0xdae8c4[_0x2c9b('0xd0')])};return _0x32c529;});if(!_0x4f1eba[_0x2c9b('0xd1')]){return db[_0x2c9b('0xd2')][_0x2c9b('0xd3')](function(_0x4a6d83){return db[_0x2c9b('0xd4')][_0x2c9b('0xd5')](_0x581ff8,{'transaction':_0x4a6d83});});}}})['then'](function(){if(_0x48d42f){_0x3a33c7=_0x48d42f;return db[_0x2c9b('0xc1')][_0x2c9b('0x5b')]({'where':{'service':!![]},'include':[{'model':db[_0x2c9b('0xd6')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x2c9b('0xd7')],'as':_0x2c9b('0xd7'),'raw':!![]}]}]});}})[_0x2c9b('0x17')](function(_0x53c498){if(_0x53c498&&_0x53c498['Smtp']&&_0x4f1eba['forwardOffline']&&_0x4f1eba['forwardOfflineAddress']){var _0x2df3aa=_0x53c498['getSmtpOptions']();return respondWithRpcPromise(_0x2c9b('0xd8'),_0x2c9b('0xd9'),{'account':_0x2df3aa,'message':{'from':util[_0x2c9b('0xa3')](_0x2c9b('0xda'),_0x53c498[_0x2c9b('0x2f')],_0x53c498[_0x2c9b('0xdb')]||_0x53c498['Smtp']['user']),'to':_0x4f1eba[_0x2c9b('0xdc')],'subject':_0x4f1eba['offlineMessageSubject'],'html':_0x3a33c7[_0x2c9b('0x4f')],'attachments':_0x5910ca}},client9003)[_0x2c9b('0x17')](function(){return _0x3a33c7;})[_0x2c9b('0x4e')](function(_0x98a9e9){logger[_0x2c9b('0x1b')](_0x98a9e9);});}})[_0x2c9b('0x17')](function(){if(_0x4f1eba&&_0x4f1eba[_0x2c9b('0xd1')]&&_0x4f1eba[_0x2c9b('0xdd')]){var _0xd631ca=[];if(_0x478040[_0x2c9b('0x4c')]){_0xd631ca=_0x478040['map'](function(_0x49291e){return{'name':_0x49291e[_0x2c9b('0xcb')],'basename':_0x49291e['filename'],'type':_0x49291e['mimetype'],'ChatOfflineMessageId':_0x48d42f['id']};});}var _0x5e3d45;if(!_[_0x2c9b('0x73')](_0x4f1eba['subjectOffline'])){var _0x5b2f17=_[_0x2c9b('0x33')](_0x145fb1['body'],function(_0xafd9ca){return _0xafd9ca;});var _0x432bae=_[_0x2c9b('0xde')](_0x5b2f17)[0x0];var _0x59a414=_['mapValues'](_0x432bae,function(_0x25c5b4){return _0x25c5b4;});_0x5e3d45=_0x59a414[0x1][_0x4f1eba['subjectOffline']];}var _0x5c0b15={'from':_0x4952a3[_0x2c9b('0xdb')],'firstName':_0x4952a3['firstName'],'lastName':_0x4952a3[_0x2c9b('0x9e')],'mapKey':'email','message':{'from':_0x4952a3[_0x2c9b('0xdb')],'to':_0x4f1eba[_0x2c9b('0xc1')][_0x2c9b('0xdb')],'cc':'','subject':_[_0x2c9b('0x73')](_0x5e3d45)?_0x4f1eba[_0x2c9b('0xdf')]:_0x5e3d45,'messageId':'','sentAt':new Date(),'attach':_0xd631ca[_0x2c9b('0x4c')],'attachments':_0xd631ca,'originChannel':_0x2c9b('0xe0'),'ChatWebsiteId':_0x4f1eba['id'],'ChatOfflineMessageId':_0x3a33c7['id'],'originTo':_0x4f1eba[_0x2c9b('0xc1')][_0x2c9b('0xdb')]},'body':_0x3a33c7['body']};var _0x350542={'account':{'id':_0x4f1eba[_0x2c9b('0xdd')]},'body':_0x5c0b15,'log':_0x2c9b('0xe1')};return respondWithRpcPromise(_0x2c9b('0xe1'),_0x2c9b('0xe2'),_0x350542,client9001)[_0x2c9b('0x17')](function(){return _0x3a33c7;})[_0x2c9b('0x4e')](function(_0x152cc4){logger['error'](_0x152cc4);});}return;})[_0x2c9b('0x17')](function(){if(_0x3a33c7){return _0x3a33c7;}})['then'](respondWithResult(_0x3c23cd,null))[_0x2c9b('0x4e')](function(_0x217952){logger['error'](_0x2c9b('0x4e'),_0x217952);for(var _0x15ce32 of _0x478040){var _0x41214d=path['join'](config[_0x2c9b('0x6f')],_0x2c9b('0xe3'),_0x2c9b('0xcd'),_0x2c9b('0xce'),_0x2c9b('0xcf'),_0x15ce32[_0x2c9b('0x6b')]);fs_extra[_0x2c9b('0xe4')](_0x41214d)[_0x2c9b('0x4e')](function(_0x3994fa){logger[_0x2c9b('0x1b')](_0x2c9b('0xe5'),_0x41214d,_0x3994fa);});}});};exports[_0x2c9b('0xe6')]=function(_0x5e2132,_0x54b635){return db['ChatInteraction'][_0x2c9b('0x4d')]({'where':{'id':_0x5e2132[_0x2c9b('0x4a')]['id']}})[_0x2c9b('0x17')](handleEntityNotFound(_0x54b635,null))[_0x2c9b('0x17')](function(_0x3a5f0d){if(_0x3a5f0d){return _0x3a5f0d[_0x2c9b('0xe6')](_0x5e2132[_0x2c9b('0x4f')][_0x2c9b('0x60')],_['omit'](_0x5e2132[_0x2c9b('0x4f')],[_0x2c9b('0x60'),'id'])||{});}})[_0x2c9b('0x17')](respondWithResult(_0x54b635,null))[_0x2c9b('0x4e')](handleError(_0x54b635,null));};exports[_0x2c9b('0xe7')]=function(_0x44fe13,_0x1f2359){var _0x162a51={'raw':![],'where':{}};var _0x3b60d1={};var _0x553a20={'count':0x0,'rows':[]};return db[_0x2c9b('0x34')]['findOne']({'where':{'id':_0x44fe13['params']['id']}})[_0x2c9b('0x17')](handleEntityNotFound(_0x1f2359,null))['then'](function(_0x31abf6){if(_0x31abf6){_0x3b60d1[_0x2c9b('0x37')]=_[_0x2c9b('0x4b')](db[_0x2c9b('0xa9')][_0x2c9b('0x35')]);_0x3b60d1[_0x2c9b('0x38')]=_[_0x2c9b('0x4b')](_0x44fe13[_0x2c9b('0x38')]);_0x3b60d1['filters']=_[_0x2c9b('0x3a')](_0x3b60d1[_0x2c9b('0x37')],_0x3b60d1[_0x2c9b('0x38')]);_0x162a51[_0x2c9b('0x3b')]=_[_0x2c9b('0x3a')](_0x3b60d1['model'],qs[_0x2c9b('0x3c')](_0x44fe13[_0x2c9b('0x38')][_0x2c9b('0x3c')]));_0x162a51[_0x2c9b('0x3b')]=_0x162a51[_0x2c9b('0x3b')][_0x2c9b('0x4c')]?_0x162a51[_0x2c9b('0x3b')]:_0x3b60d1[_0x2c9b('0x37')];if(!_0x44fe13[_0x2c9b('0x38')][_0x2c9b('0x3d')](_0x2c9b('0x5c'))){_0x162a51['limit']=qs[_0x2c9b('0x24')](_0x44fe13[_0x2c9b('0x38')][_0x2c9b('0x24')]);_0x162a51['offset']=qs[_0x2c9b('0x23')](_0x44fe13['query'][_0x2c9b('0x23')]);}_0x162a51['order']=qs[_0x2c9b('0x3e')](_0x44fe13[_0x2c9b('0x38')]['sort']);_0x162a51[_0x2c9b('0x3f')]=qs[_0x2c9b('0x39')](_[_0x2c9b('0x40')](_0x44fe13[_0x2c9b('0x38')],_0x3b60d1[_0x2c9b('0x39')]));_0x162a51[_0x2c9b('0x3f')][_0x2c9b('0x5e')]=_0x31abf6['id'];if(_0x44fe13[_0x2c9b('0x38')]['filter']){_0x162a51[_0x2c9b('0x3f')]=_[_0x2c9b('0x42')](_0x162a51[_0x2c9b('0x3f')],{'$or':_[_0x2c9b('0x33')](_0x162a51['attributes'],function(_0x283e4b){var _0x5222d7={};_0x5222d7[_0x283e4b]={'$like':'%'+_0x44fe13[_0x2c9b('0x38')]['filter']+'%'};return _0x5222d7;})});}_0x162a51=_['merge']({},_0x162a51,_0x44fe13['options']);return db[_0x2c9b('0xa9')][_0x2c9b('0x26')]({'where':_0x162a51[_0x2c9b('0x3f')]})[_0x2c9b('0x17')](function(_0x309a48){_0x553a20[_0x2c9b('0x26')]=_0x309a48;if(_0x44fe13['query'][_0x2c9b('0x45')]){_0x162a51[_0x2c9b('0x46')]=[{'model':db[_0x2c9b('0x8d')],'as':'Contact','required':![]},{'model':db[_0x2c9b('0xe8')],'as':'Owner','attributes':[_0x2c9b('0x2f'),_0x2c9b('0xe9'),_0x2c9b('0xea')],'required':![]},{'model':db['Tag'],'as':_0x2c9b('0xeb'),'attributes':['id',_0x2c9b('0x2f'),_0x2c9b('0xec')],'where':_0x44fe13[_0x2c9b('0x38')][_0x2c9b('0xed')]?{'id':_0x44fe13[_0x2c9b('0x38')]['tag']}:undefined,'required':_0x44fe13[_0x2c9b('0x38')][_0x2c9b('0xed')]?!![]:![]}];}return db[_0x2c9b('0xa9')][_0x2c9b('0x47')](_0x162a51);})[_0x2c9b('0x17')](function(_0x3099bb){_0x553a20['rows']=_0x3099bb;return _0x553a20;});}})[_0x2c9b('0x17')](respondWithFilteredResult(_0x1f2359,_0x162a51))[_0x2c9b('0x4e')](handleError(_0x1f2359,null));};function iftimePromise(_0x4005b7,_0x5bd684){return respondWithRpcPromise('Command',_0x2c9b('0xee'),{'command':_0x5bd684['timezone']?util['format'](_0x2c9b('0xef'),_0x4005b7[_0x2c9b('0xf0')],_0x5bd684[_0x2c9b('0xf1')]):util[_0x2c9b('0xa3')](_0x2c9b('0xf2'),_0x4005b7[_0x2c9b('0xf0')])},client9002)[_0x2c9b('0x17')](function(_0x54f59e){var _0x1cf137=_0x54f59e&&_0x54f59e[_0x2c9b('0xf3')]('true')>=0x0?!![]:![];logger[_0x2c9b('0x18')](_0x2c9b('0xf4'),_0x5bd684['id'],_0x4005b7['id'],_0x4005b7[_0x2c9b('0xf0')],_0x1cf137?_0x2c9b('0xf5'):_0x2c9b('0xf6'),_0x5bd684[_0x2c9b('0xf1')]?_0x5bd684['timezone']:'No\x20timezone');return _0x1cf137;})[_0x2c9b('0x4e')](function(_0x36636c){logger['error'](_0x2c9b('0xf4'),_0x5bd684['id'],_0x4005b7['id'],_0x4005b7['interval'],util[_0x2c9b('0xf7')](_0x36636c,{'showHidden':![],'depth':null}),_0x5bd684['timezone']?_0x5bd684[_0x2c9b('0xf1')]:_0x2c9b('0xf8'));return![];});}exports[_0x2c9b('0xee')]=function(_0x1fd339,_0x260309){var _0x37fd55=0x0;var _0x44d19d=0x0;var _0x3cf149=![];var _0x3b5f7d;var _0x4227f2;return db['ChatWebsite'][_0x2c9b('0x4d')]({'where':{'id':_0x1fd339[_0x2c9b('0x4a')]['id']},'include':[{'model':db[_0x2c9b('0xf9')],'as':_0x2c9b('0xf9'),'include':[{'model':db[_0x2c9b('0xf9')],'as':'Intervals','attributes':['id',_0x2c9b('0xf0')],'raw':!![]}]}]})[_0x2c9b('0x17')](handleEntityNotFound(_0x260309,null))[_0x2c9b('0x17')](function(_0xe1b9ba){if(_0xe1b9ba){_0x3b5f7d=_0xe1b9ba;return _0xe1b9ba[_0x2c9b('0xfa')]({'raw':!![]});}})[_0x2c9b('0x17')](function(_0x3e2792){if(_0x3b5f7d){if(_0x3e2792){_0x4227f2=_0x3e2792;}}return require(_0x2c9b('0xfb'))[_0x2c9b('0x71')]();})[_0x2c9b('0x17')](function(_0x3e2330){if(_0x3e2330){_0x44d19d=_0x3e2330[_0x2c9b('0xfc')];_0x3cf149=_0x3e2330[_0x2c9b('0x72')];}})['then'](function(){return db[_0x2c9b('0xa9')][_0x2c9b('0x26')]({'where':{'closed':![]}});})[_0x2c9b('0x17')](function(_0x3ddf3b){_0x37fd55=_0x3ddf3b;if(_0x44d19d&&_0x3ddf3b>_0x44d19d){return db[_0x2c9b('0xfd')][_0x2c9b('0x5b')]({'where':{'id':0x1}})[_0x2c9b('0x17')](function(_0x1e1f6a){if(_0x1e1f6a){_0x1e1f6a['increment'](_0x2c9b('0xfe'));}});}})[_0x2c9b('0x17')](function(){if(_0x3b5f7d['Interval']&&_0x3b5f7d['Interval']['Intervals']){var _0x31c7ae=[];for(var _0x1468af=0x0;_0x1468af<_0x3b5f7d[_0x2c9b('0xf9')][_0x2c9b('0xff')][_0x2c9b('0x4c')];_0x1468af++){var _0x41c92e=_0x3b5f7d['Interval'][_0x2c9b('0xff')][_0x1468af]['get']({'plain':!![]});_0x31c7ae[_0x2c9b('0xaf')](iftimePromise(_0x41c92e,_0x3b5f7d));}return BPromise[_0x2c9b('0x100')](_0x31c7ae)[_0x2c9b('0x17')](function(_0x212363){return _[_0x2c9b('0x101')](_0x212363);});}else{return!![];}})[_0x2c9b('0x17')](function(_0x3f4530){var _0x2828ca=fs['readFileSync'](path[_0x2c9b('0x6e')](config['root'],'server/files/chat/iframe.ejs'),_0x2c9b('0xc5'));var _0x59a212=new url[(_0x2c9b('0x102'))](_0x3b5f7d['address'])[_0x2c9b('0x103')];var _0x50e3ba=_0x2c9b('0x104');var _0x28aaf5=![];var _0x3b4298={'chatVersion':_0x50e3ba,'chatWebsiteAddressOrigin':_0x59a212,'remote':_0x3b5f7d[_0x2c9b('0x105')],'query':querystring['stringify'](_['merge'](_0x3b5f7d['get']({'plain':!![]}),{'customerIp':_0x1fd339[_0x2c9b('0x99')]['x-forwarded-for']||_0x1fd339['headers']['x-real-ip']||_0x1fd339[_0x2c9b('0x106')][_0x2c9b('0x107')]||_0x1fd339['ip'],'referer':_0x1fd339[_0x2c9b('0x99')][_0x2c9b('0xa0')],'openedInteractions':_0x37fd55,'maxInteractions':_0x44d19d,'virtual':_0x3cf149['virtual'],'online':_0x3f4530,'custom':_0x3cf149}))[_0x2c9b('0x108')](/'/g,'\x5c\x27')};_0x260309[_0x2c9b('0xbe')](ejs[_0x2c9b('0xc6')](Mustache[_0x2c9b('0xc6')](_0x2828ca,_0x3b4298),{'proactiveActions':_0x4227f2,'alignment':_0x3b5f7d['alignment'],'verticalAlignment':_0x3b5f7d[_0x2c9b('0x109')],'div_color':_0x3b5f7d[_0x2c9b('0xec')],'labelText':_0x3b5f7d[_0x2c9b('0x10a')],'text_color':_0x3b5f7d[_0x2c9b('0x10b')],'text_button_color':_0x3b5f7d[_0x2c9b('0x10c')],'button_color':_0x3b5f7d[_0x2c9b('0x10d')],'background_color':_0x3b5f7d[_0x2c9b('0x10e')],'hideWhenOffline':_0x3b5f7d[_0x2c9b('0x10f')],'intervalId':_0x3b5f7d[_0x2c9b('0x110')],'isDevelopment':_0x28aaf5,'chatVersion':_0x50e3ba}));})[_0x2c9b('0x4e')](handleError(_0x260309,null));};exports['addApplications']=function(_0x5905a3,_0x2c8a23){var _0x34ba6d=_0x5905a3[_0x2c9b('0x4a')]['id'];var _0x390993=_0x5905a3[_0x2c9b('0x4f')];var _0x23c65a=0xc8;var _0x33fdd3=null;return db[_0x2c9b('0xd2')][_0x2c9b('0xd3')]({'isolationLevel':db[_0x2c9b('0xd2')]['Transaction'][_0x2c9b('0x111')][_0x2c9b('0x112')]},function(_0x53b6ad){return db[_0x2c9b('0x34')][_0x2c9b('0x5b')]({'where':{'id':_0x34ba6d},'transaction':_0x53b6ad})[_0x2c9b('0x17')](function(_0x169726){if(_0x169726){return db['ChatApplication'][_0x2c9b('0x2b')]({'where':{'ChatWebsiteId':_0x34ba6d},'transaction':_0x53b6ad})[_0x2c9b('0x17')](function(){var _0x48cf02=_[_0x2c9b('0x33')](_0x390993,function(_0x213295){_0x213295['ChatWebsiteId']=_0x34ba6d;return _0x213295;});return db[_0x2c9b('0x113')][_0x2c9b('0xd5')](_0x48cf02,{'transaction':_0x53b6ad});});}else{_0x23c65a=0x194;_0x33fdd3=[];}});})[_0x2c9b('0x17')](function(){if(_0x23c65a!==0x194){return db['ChatApplication'][_0x2c9b('0x114')]({'where':{'ChatWebsiteId':_0x34ba6d},'order':_0x2c9b('0x94')})[_0x2c9b('0x17')](function(_0xa0d914){_0x33fdd3=_0xa0d914;});}})[_0x2c9b('0x4e')](function(_0x457af1){_0x23c65a=0x1f4;logger['error'](_0x457af1[_0x2c9b('0x2e')]);if(_0x457af1[_0x2c9b('0x2f')]){delete _0x457af1[_0x2c9b('0x2f')];}_0x33fdd3=_0x457af1;})[_0x2c9b('0x115')](function(){if(_0x33fdd3===null){_0x2c8a23['sendStatus'](_0x23c65a);}else{if(_0x23c65a===0x1f4){_0x2c8a23[_0x2c9b('0x22')](_0x23c65a)['send'](_0x33fdd3);}else{_0x2c8a23[_0x2c9b('0x22')](_0x23c65a)[_0x2c9b('0x29')](_0x33fdd3);}}});};exports[_0x2c9b('0x116')]=function(_0x2d3a27,_0xaaab74){var _0x4fcac9={};var _0xd11988={};var _0x28bf6f;var _0xffa1f1;return db[_0x2c9b('0x34')][_0x2c9b('0x5b')]({'where':{'id':_0x2d3a27[_0x2c9b('0x4a')]['id']}})[_0x2c9b('0x17')](handleEntityNotFound(_0xaaab74,null))[_0x2c9b('0x17')](function(_0x4c9463){if(_0x4c9463){_0x28bf6f=_0x4c9463;_0xd11988[_0x2c9b('0x37')]=_[_0x2c9b('0x4b')](db['ChatApplication'][_0x2c9b('0x35')]);_0xd11988[_0x2c9b('0x38')]=_[_0x2c9b('0x4b')](_0x2d3a27['query']);_0xd11988['filters']=_['intersection'](_0xd11988['model'],_0xd11988[_0x2c9b('0x38')]);_0x4fcac9[_0x2c9b('0x3b')]=_[_0x2c9b('0x3a')](_0xd11988[_0x2c9b('0x37')],qs[_0x2c9b('0x3c')](_0x2d3a27[_0x2c9b('0x38')][_0x2c9b('0x3c')]));_0x4fcac9[_0x2c9b('0x3b')]=_0x4fcac9[_0x2c9b('0x3b')][_0x2c9b('0x4c')]?_0x4fcac9[_0x2c9b('0x3b')]:_0xd11988['model'];_0x4fcac9[_0x2c9b('0x5d')]=qs[_0x2c9b('0x3e')](_0x2d3a27[_0x2c9b('0x38')][_0x2c9b('0x3e')]);_0x4fcac9[_0x2c9b('0x3f')]=qs[_0x2c9b('0x39')](_[_0x2c9b('0x40')](_0x2d3a27[_0x2c9b('0x38')],_0xd11988[_0x2c9b('0x39')]));if(_0x2d3a27[_0x2c9b('0x38')][_0x2c9b('0x41')]){_0x4fcac9[_0x2c9b('0x3f')]=_[_0x2c9b('0x42')](_0x4fcac9['where'],{'$or':_[_0x2c9b('0x33')](_0x4fcac9[_0x2c9b('0x3b')],function(_0x181a7c){var _0x791888={};_0x791888[_0x181a7c]={'$like':'%'+_0x2d3a27['query'][_0x2c9b('0x41')]+'%'};return _0x791888;})});}_0x4fcac9=_[_0x2c9b('0x42')]({},_0x4fcac9,_0x2d3a27['options']);return _0x28bf6f[_0x2c9b('0x116')](_0x4fcac9);}})['then'](function(_0x4b2ab5){if(_0x4b2ab5){_0xffa1f1=_0x4b2ab5[_0x2c9b('0x4c')];if(!_0x2d3a27['query'][_0x2c9b('0x3d')]('nolimit')){_0x4fcac9[_0x2c9b('0x24')]=qs[_0x2c9b('0x24')](_0x2d3a27[_0x2c9b('0x38')][_0x2c9b('0x24')]);_0x4fcac9['offset']=qs['offset'](_0x2d3a27[_0x2c9b('0x38')][_0x2c9b('0x23')]);}return _0x28bf6f[_0x2c9b('0x116')](_0x4fcac9);}})[_0x2c9b('0x17')](function(_0x24a575){if(_0x24a575){return _0x24a575?{'count':_0xffa1f1,'rows':_0x24a575}:null;}})[_0x2c9b('0x17')](respondWithResult(_0xaaab74,null))[_0x2c9b('0x4e')](handleError(_0xaaab74,null));};exports[_0x2c9b('0x117')]=function(_0x423c29,_0x4621fc){return db[_0x2c9b('0x118')][_0x2c9b('0x4d')]({'where':{'id':_0x423c29[_0x2c9b('0x4a')]['id']}})[_0x2c9b('0x17')](handleEntityNotFound(_0x4621fc,null))[_0x2c9b('0x17')](function(_0x107b55){if(_0x107b55){return _0x107b55['addProactiveActions'](_0x423c29[_0x2c9b('0x4f')][_0x2c9b('0x60')],_[_0x2c9b('0x119')](_0x423c29[_0x2c9b('0x4f')],[_0x2c9b('0x60'),'id'])||{});}})[_0x2c9b('0x17')](respondWithResult(_0x4621fc,null))[_0x2c9b('0x4e')](handleError(_0x4621fc,null));};exports[_0x2c9b('0xfa')]=function(_0x5f43c2,_0x44cd3b){var _0x276673={};var _0x219213={};var _0x25080b;var _0x3b2dee;return db['ChatWebsite'][_0x2c9b('0x5b')]({'where':{'id':_0x5f43c2[_0x2c9b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x44cd3b,null))['then'](function(_0x1e2a2b){if(_0x1e2a2b){_0x25080b=_0x1e2a2b;_0x219213[_0x2c9b('0x37')]=_[_0x2c9b('0x4b')](db[_0x2c9b('0x11a')]['rawAttributes']);_0x219213[_0x2c9b('0x38')]=_[_0x2c9b('0x4b')](_0x5f43c2[_0x2c9b('0x38')]);_0x219213['filters']=_['intersection'](_0x219213[_0x2c9b('0x37')],_0x219213[_0x2c9b('0x38')]);_0x276673[_0x2c9b('0x3b')]=_[_0x2c9b('0x3a')](_0x219213[_0x2c9b('0x37')],qs['fields'](_0x5f43c2[_0x2c9b('0x38')]['fields']));_0x276673[_0x2c9b('0x3b')]=_0x276673['attributes']['length']?_0x276673['attributes']:_0x219213[_0x2c9b('0x37')];_0x276673[_0x2c9b('0x5d')]=qs['sort'](_0x5f43c2[_0x2c9b('0x38')][_0x2c9b('0x3e')]);_0x276673[_0x2c9b('0x3f')]=qs[_0x2c9b('0x39')](_['pick'](_0x5f43c2['query'],_0x219213[_0x2c9b('0x39')]));if(_0x5f43c2[_0x2c9b('0x38')]['filter']){_0x276673[_0x2c9b('0x3f')]=_[_0x2c9b('0x42')](_0x276673[_0x2c9b('0x3f')],{'$or':_[_0x2c9b('0x33')](_0x276673[_0x2c9b('0x3b')],function(_0x25de98){var _0x4256f8={};_0x4256f8[_0x25de98]={'$like':'%'+_0x5f43c2[_0x2c9b('0x38')]['filter']+'%'};return _0x4256f8;})});}_0x276673=_['merge']({},_0x276673,_0x5f43c2[_0x2c9b('0x44')]);return _0x25080b[_0x2c9b('0xfa')](_0x276673);}})['then'](function(_0x259490){if(_0x259490){_0x3b2dee=_0x259490[_0x2c9b('0x4c')];if(!_0x5f43c2['query'][_0x2c9b('0x3d')](_0x2c9b('0x5c'))){_0x276673[_0x2c9b('0x24')]=qs[_0x2c9b('0x24')](_0x5f43c2[_0x2c9b('0x38')][_0x2c9b('0x24')]);_0x276673[_0x2c9b('0x23')]=qs[_0x2c9b('0x23')](_0x5f43c2[_0x2c9b('0x38')][_0x2c9b('0x23')]);}return _0x25080b[_0x2c9b('0xfa')](_0x276673);}})[_0x2c9b('0x17')](function(_0x58e71a){if(_0x58e71a){return _0x58e71a?{'count':_0x3b2dee,'rows':_0x58e71a}:null;}})['then'](respondWithResult(_0x44cd3b,null))[_0x2c9b('0x4e')](handleError(_0x44cd3b,null));};exports[_0x2c9b('0x11b')]=function(_0x2f6353,_0x5ec0be){var _0x246273=_0x2f6353[_0x2c9b('0x38')]['online']===_0x2c9b('0x11c')?'offlineForm':_0x2c9b('0x11d');return db['ChatWebsite'][_0x2c9b('0x4d')]({'attributes':['id',_0x246273],'where':{'id':_0x2f6353[_0x2c9b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5ec0be,null))[_0x2c9b('0x17')](function(_0x36efb0){if(_0x36efb0){var _0x1813dd=_0x36efb0[_0x246273];var _0x4c07e9=_0x1813dd&&_0x1813dd[_0x2c9b('0x11e')]?_0x1813dd[_0x2c9b('0x11e')]:[];_0x5ec0be[_0x2c9b('0xbe')]({'fromKey':_['isNil'](_0x1813dd['fromKey'])?undefined:_0x1813dd[_0x2c9b('0x11f')],'count':_0x4c07e9[_0x2c9b('0x4c')],'rows':_0x4c07e9});}})[_0x2c9b('0x4e')](handleError(_0x5ec0be,null));};exports['getOfflineMessages']=function(_0x2784f0,_0x555f33){var _0x80ad5c={'raw':![],'where':{}};var _0x5a5dca={};var _0x83fa5={'count':0x0,'rows':[]};return db[_0x2c9b('0x34')]['findOne']({'where':{'id':_0x2784f0[_0x2c9b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x555f33,null))[_0x2c9b('0x17')](function(_0x172610){if(_0x172610){_0x5a5dca[_0x2c9b('0x37')]=_['keys'](db[_0x2c9b('0xc9')]['rawAttributes']);_0x5a5dca[_0x2c9b('0x38')]=_['keys'](_0x2784f0[_0x2c9b('0x38')]);_0x5a5dca[_0x2c9b('0x39')]=_[_0x2c9b('0x3a')](_0x5a5dca['model'],_0x5a5dca[_0x2c9b('0x38')]);_0x80ad5c[_0x2c9b('0x3b')]=_['intersection'](_0x5a5dca[_0x2c9b('0x37')],qs[_0x2c9b('0x3c')](_0x2784f0['query'][_0x2c9b('0x3c')]));_0x80ad5c[_0x2c9b('0x3b')]=_0x80ad5c[_0x2c9b('0x3b')][_0x2c9b('0x4c')]?_0x80ad5c[_0x2c9b('0x3b')]:_0x5a5dca['model'];if(!_0x2784f0['query'][_0x2c9b('0x3d')]('nolimit')){_0x80ad5c[_0x2c9b('0x24')]=qs[_0x2c9b('0x24')](_0x2784f0['query'][_0x2c9b('0x24')]);_0x80ad5c[_0x2c9b('0x23')]=qs[_0x2c9b('0x23')](_0x2784f0[_0x2c9b('0x38')][_0x2c9b('0x23')]);}_0x80ad5c[_0x2c9b('0x5d')]=qs[_0x2c9b('0x3e')](_0x2784f0[_0x2c9b('0x38')][_0x2c9b('0x3e')]);_0x80ad5c[_0x2c9b('0x3f')]=qs[_0x2c9b('0x39')](_[_0x2c9b('0x40')](_0x2784f0['query'],_0x5a5dca[_0x2c9b('0x39')]));_0x80ad5c[_0x2c9b('0x3f')][_0x2c9b('0x5e')]=_0x172610['id'];if(_0x2784f0[_0x2c9b('0x38')]['filter']){_0x80ad5c[_0x2c9b('0x3f')]=_[_0x2c9b('0x42')](_0x80ad5c[_0x2c9b('0x3f')],{'$or':_['map'](_0x80ad5c[_0x2c9b('0x3b')],function(_0x2127a6){var _0x275eca={};_0x275eca[_0x2127a6]={'$like':'%'+_0x2784f0[_0x2c9b('0x38')][_0x2c9b('0x41')]+'%'};return _0x275eca;})});}_0x80ad5c=_[_0x2c9b('0x42')]({},_0x80ad5c,_0x2784f0[_0x2c9b('0x44')]);return db['ChatOfflineMessage']['count']({'where':_0x80ad5c[_0x2c9b('0x3f')]})['then'](function(_0x562cbc){_0x83fa5['count']=_0x562cbc;if(_0x2784f0[_0x2c9b('0x38')][_0x2c9b('0x45')]){_0x80ad5c[_0x2c9b('0x46')]=[{'all':!![]}];}else{_0x80ad5c[_0x2c9b('0x46')]=[{'model':db[_0x2c9b('0x8d')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':_0x2c9b('0x120'),'required':![]}];}return db['ChatOfflineMessage'][_0x2c9b('0x47')](_0x80ad5c);})[_0x2c9b('0x17')](function(_0x4fb3e4){_0x83fa5[_0x2c9b('0x48')]=_0x4fb3e4;return _0x83fa5;});}})['then'](respondWithFilteredResult(_0x555f33,_0x80ad5c))['catch'](handleError(_0x555f33,null));};exports[_0x2c9b('0x121')]=function(_0x24bfce,_0x2c3dff){return db[_0x2c9b('0x34')][_0x2c9b('0x4d')]({'where':{'id':_0x24bfce[_0x2c9b('0x4a')]['id']}})[_0x2c9b('0x17')](handleEntityNotFound(_0x2c3dff,null))[_0x2c9b('0x17')](function(_0x295568){if(_0x295568){return _0x295568[_0x2c9b('0x121')](_0x24bfce[_0x2c9b('0x4f')][_0x2c9b('0x60')],_['omit'](_0x24bfce[_0x2c9b('0x4f')],[_0x2c9b('0x60'),'id'])||{})[_0x2c9b('0xc3')](function(_0x452adf){for(var _0x299724=0x0;_0x299724<_0x24bfce[_0x2c9b('0x4f')]['ids']['length'];_0x299724+=0x1){socket[_0x2c9b('0x122')](_0x2c9b('0x123'),{'UserId':Number(_0x24bfce['body'][_0x2c9b('0x60')][_0x299724]),'ChatWebsiteId':Number(_0x24bfce[_0x2c9b('0x4a')]['id'])});}return _0x452adf;});}})['then'](respondWithResult(_0x2c3dff,null))['catch'](handleError(_0x2c3dff,null));};exports['removeAgents']=function(_0x5a42e5,_0x37a9a4){return db[_0x2c9b('0x34')]['find']({'where':{'id':_0x5a42e5[_0x2c9b('0x4a')]['id']}})[_0x2c9b('0x17')](handleEntityNotFound(_0x37a9a4,null))['then'](function(_0x5a5b81){if(_0x5a5b81){return _0x5a5b81[_0x2c9b('0x124')](_0x5a42e5[_0x2c9b('0x38')][_0x2c9b('0x60')])[_0x2c9b('0x17')](function(){if(_[_0x2c9b('0x125')](_0x5a42e5[_0x2c9b('0x38')][_0x2c9b('0x60')])){for(var _0x37d854=0x0;_0x37d854<_0x5a42e5[_0x2c9b('0x38')][_0x2c9b('0x60')][_0x2c9b('0x4c')];_0x37d854+=0x1){socket[_0x2c9b('0x122')](_0x2c9b('0x126'),{'UserId':Number(_0x5a42e5[_0x2c9b('0x38')][_0x2c9b('0x60')][_0x37d854]),'ChatWebsiteId':Number(_0x5a42e5[_0x2c9b('0x4a')]['id'])});}}else{socket[_0x2c9b('0x122')](_0x2c9b('0x126'),{'UserId':Number(_0x5a42e5[_0x2c9b('0x38')][_0x2c9b('0x60')]),'ChatWebsiteId':Number(_0x5a42e5['params']['id'])});}});}})[_0x2c9b('0x17')](respondWithStatusCode(_0x37a9a4,null))[_0x2c9b('0x4e')](handleError(_0x37a9a4,null));};exports[_0x2c9b('0x127')]=function(_0x56c06f,_0x48a232){var _0x57e27e={};var _0x227f18={};var _0x36b8c3;var _0xdf811c;return db[_0x2c9b('0x34')]['findOne']({'where':{'id':_0x56c06f[_0x2c9b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x48a232,null))[_0x2c9b('0x17')](function(_0x580ac4){if(_0x580ac4){_0x36b8c3=_0x580ac4;_0x227f18['model']=_['keys'](db[_0x2c9b('0xe8')][_0x2c9b('0x35')]);_0x227f18['query']=_[_0x2c9b('0x4b')](_0x56c06f[_0x2c9b('0x38')]);_0x227f18[_0x2c9b('0x39')]=_[_0x2c9b('0x3a')](_0x227f18[_0x2c9b('0x37')],_0x227f18[_0x2c9b('0x38')]);_0x57e27e['attributes']=_[_0x2c9b('0x3a')](_0x227f18[_0x2c9b('0x37')],qs[_0x2c9b('0x3c')](_0x56c06f[_0x2c9b('0x38')]['fields']));_0x57e27e[_0x2c9b('0x3b')]=_0x57e27e['attributes'][_0x2c9b('0x4c')]?_0x57e27e[_0x2c9b('0x3b')]:_0x227f18[_0x2c9b('0x37')];_0x57e27e[_0x2c9b('0x5d')]=qs[_0x2c9b('0x3e')](_0x56c06f[_0x2c9b('0x38')][_0x2c9b('0x3e')]);_0x57e27e[_0x2c9b('0x3f')]=qs[_0x2c9b('0x39')](_[_0x2c9b('0x40')](_0x56c06f[_0x2c9b('0x38')],_0x227f18[_0x2c9b('0x39')]));if(_0x56c06f['query'][_0x2c9b('0x41')]){_0x57e27e[_0x2c9b('0x3f')]=_['merge'](_0x57e27e[_0x2c9b('0x3f')],{'$or':_['map'](_0x57e27e[_0x2c9b('0x3b')],function(_0x48fa20){var _0x2fcb9d={};_0x2fcb9d[_0x48fa20]={'$like':'%'+_0x56c06f[_0x2c9b('0x38')][_0x2c9b('0x41')]+'%'};return _0x2fcb9d;})});}_0x57e27e=_[_0x2c9b('0x42')]({},_0x57e27e,_0x56c06f[_0x2c9b('0x44')]);return _0x36b8c3['getAgents'](_0x57e27e);}})[_0x2c9b('0x17')](function(_0x376dde){if(_0x376dde){_0xdf811c=_0x376dde[_0x2c9b('0x4c')];if(!_0x56c06f[_0x2c9b('0x38')][_0x2c9b('0x3d')](_0x2c9b('0x5c'))){_0x57e27e['limit']=qs['limit'](_0x56c06f[_0x2c9b('0x38')][_0x2c9b('0x24')]);_0x57e27e['offset']=qs['offset'](_0x56c06f[_0x2c9b('0x38')][_0x2c9b('0x23')]);}return _0x36b8c3[_0x2c9b('0x127')](_0x57e27e);}})[_0x2c9b('0x17')](function(_0xb411cf){if(_0xb411cf){return _0xb411cf?{'count':_0xdf811c,'rows':_0xb411cf}:null;}})[_0x2c9b('0x17')](respondWithResult(_0x48a232,null))[_0x2c9b('0x4e')](handleError(_0x48a232,null));};
\ No newline at end of file
+var _0xb10b=['updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','ChatApplication','applications','Applications','list','orderBy','priority','asc','account','Contacts','contact','customerIp','headers','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','unknown','%s\x20%s','device','format','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','fromString','server','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','Command','iftime\x20%s,%s','timezone','iftime\x20%s','indexOf','true','interval','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','getSnippet','Interval','getProactiveActions','virtual','increment','chatLicenseExceeded','Intervals','some','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','x-real-ip','connection','replace','alignment','verticalAlignment','labelText','textColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','addAgents','omit','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','path','ejs','lodash','querystring','../../components/parsers/qs','api','../../config/environment','url','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','limit','undefined','offset','count','set','update','destroy','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','index','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','catch','show','params','mandatoryDispositionPause','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','findOne','rows','removeDispositions','addAnswer','getAnswers','CannedAnswer','findAll','removeAnswers','addLogo','sitepic','filename','agentAvatar','file','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt'];(function(_0xbdc98e,_0xd527b4){var _0x5cc9df=function(_0x3790f3){while(--_0x3790f3){_0xbdc98e['push'](_0xbdc98e['shift']());}};_0x5cc9df(++_0xd527b4);}(_0xb10b,0x1e3));var _0xbb10=function(_0xf351f3,_0x4a90f4){_0xf351f3=_0xf351f3-0x0;var _0x21d574=_0xb10b[_0xf351f3];return _0x21d574;};'use strict';var BPromise=require(_0xbb10('0x0'));var Mustache=require(_0xbb10('0x1'));var util=require('util');var path=require(_0xbb10('0x2'));var ejs=require(_0xbb10('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb10('0x4'));var querystring=require(_0xbb10('0x5'));var Redis=require('ioredis');var qs=require(_0xbb10('0x6'));var logger=require('../../config/logger')(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var url=require(_0xbb10('0x9'));var db=require(_0xbb10('0xa'))['db'];config[_0xbb10('0xb')]=_[_0xbb10('0xc')](config[_0xbb10('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config['redis']));require(_0xbb10('0xe'))['register'](socket);var htmlToText=require(_0xbb10('0xf'));var jayson=require(_0xbb10('0x10'));var client=jayson['client'][_0xbb10('0x11')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson['client'][_0xbb10('0x11')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x25956a,_0x525c78,_0x16bb04,_0x345e61){return new BPromise(function(_0x3fd70b,_0x332831){var _0x3c990b=_0x345e61||client;return _0x3c990b[_0xbb10('0x12')](_0x25956a,_0x16bb04)[_0xbb10('0x13')](function(_0xafe9c9){logger[_0xbb10('0x14')](_0xbb10('0x15'),_0x525c78,_0xbb10('0x16'));logger[_0xbb10('0x17')](_0xbb10('0x18'),_0x525c78,_0xbb10('0x16'),JSON[_0xbb10('0x19')](_0xafe9c9));if(_0xafe9c9[_0xbb10('0x1a')]){if(_0xafe9c9[_0xbb10('0x1a')][_0xbb10('0x1b')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x525c78,_0xafe9c9[_0xbb10('0x1a')]['message']);return _0x332831(_0xafe9c9[_0xbb10('0x1a')][_0xbb10('0x1c')]);}logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x525c78,_0xafe9c9[_0xbb10('0x1a')]['message']);return _0x3fd70b(_0xafe9c9[_0xbb10('0x1a')][_0xbb10('0x1c')]);}else{logger[_0xbb10('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x525c78,_0xbb10('0x16'));_0x3fd70b(_0xafe9c9[_0xbb10('0x1d')][_0xbb10('0x1c')]);}})['catch'](function(_0x1d1dcf){logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x525c78,_0x1d1dcf);_0x332831(_0x1d1dcf);});});}function respondWithStatusCode(_0x36eb92,_0x5b2979){_0x5b2979=_0x5b2979||0xcc;return function(_0x3ff12c){if(_0x3ff12c){return _0x36eb92['sendStatus'](_0x5b2979);}return _0x36eb92[_0xbb10('0x1e')](_0x5b2979)[_0xbb10('0x1f')]();};}function respondWithResult(_0x599e2b,_0x14bc3f){_0x14bc3f=_0x14bc3f||0xc8;return function(_0x170df9){if(_0x170df9){return _0x599e2b[_0xbb10('0x1e')](_0x14bc3f)[_0xbb10('0x20')](_0x170df9);}};}function respondWithFilteredResult(_0x5d3992,_0x52c3ea){return function(_0x10fdef){if(_0x10fdef){var _0x33f9e5=typeof _0x52c3ea['offset']==='undefined'&&typeof _0x52c3ea[_0xbb10('0x21')]===_0xbb10('0x22');var _0x2fdb77=_0x10fdef['count'];var _0x27523b=_0x33f9e5?0x0:_0x52c3ea[_0xbb10('0x23')];var _0x8c195a=_0x33f9e5?_0x10fdef[_0xbb10('0x24')]:_0x52c3ea[_0xbb10('0x23')]+_0x52c3ea[_0xbb10('0x21')];var _0x1c36ef;if(_0x8c195a>=_0x2fdb77){_0x8c195a=_0x2fdb77;_0x1c36ef=0xc8;}else{_0x1c36ef=0xce;}_0x5d3992['status'](_0x1c36ef);return _0x5d3992[_0xbb10('0x25')]('Content-Range',_0x27523b+'-'+_0x8c195a+'/'+_0x2fdb77)[_0xbb10('0x20')](_0x10fdef);}return null;};}function saveUpdates(_0x5dc075){return function(_0x1821c5){if(_0x1821c5){return _0x1821c5[_0xbb10('0x26')](_0x5dc075)[_0xbb10('0x13')](function(_0x16f1ee){return _0x16f1ee;});}return null;};}function removeEntity(_0x43e84f){return function(_0x45f1b2){if(_0x45f1b2){return _0x45f1b2[_0xbb10('0x27')]()[_0xbb10('0x13')](function(){var _0x477a34=_0x45f1b2[_0xbb10('0x28')]({'plain':!![]});var _0x33165a=_0xbb10('0x29');return db[_0xbb10('0x2a')][_0xbb10('0x27')]({'where':{'type':_0x33165a,'resourceId':_0x477a34['id']}})[_0xbb10('0x13')](function(){return _0x45f1b2;});})['then'](function(){_0x43e84f[_0xbb10('0x1e')](0xcc)[_0xbb10('0x1f')]();});}};}function handleEntityNotFound(_0x346119){return function(_0x256f05){if(!_0x256f05){_0x346119[_0xbb10('0x2b')](0x194);}return _0x256f05;};}function handleError(_0xa68070,_0x532075){_0x532075=_0x532075||0x1f4;return function(_0xb0a084){logger[_0xbb10('0x1a')](_0xb0a084[_0xbb10('0x2c')]);if(_0xb0a084['name']){delete _0xb0a084[_0xbb10('0x2d')];}_0xa68070['status'](_0x532075)['send'](_0xb0a084);};}exports[_0xbb10('0x2e')]=function(_0x135f93,_0x582cb2){var _0xfea6={'include':[{'model':db[_0xbb10('0x2f')],'as':'mandatoryDispositionPause'}]},_0x20dc10={},_0xe44e32={'count':0x0,'rows':[]};var _0x114abb=_[_0xbb10('0x30')](db[_0xbb10('0x31')][_0xbb10('0x32')],function(_0x53ff18){return{'name':_0x53ff18[_0xbb10('0x33')],'type':_0x53ff18[_0xbb10('0x34')][_0xbb10('0x35')]};});_0x20dc10[_0xbb10('0x36')]=_['map'](_0x114abb,'name');_0x20dc10['query']=_[_0xbb10('0x37')](_0x135f93[_0xbb10('0x38')]);_0x20dc10['filters']=_[_0xbb10('0x39')](_0x20dc10[_0xbb10('0x36')],_0x20dc10['query']);_0xfea6['attributes']=_[_0xbb10('0x39')](_0x20dc10[_0xbb10('0x36')],qs[_0xbb10('0x3a')](_0x135f93[_0xbb10('0x38')]['fields']));_0xfea6[_0xbb10('0x3b')]=_0xfea6[_0xbb10('0x3b')]['length']?_0xfea6[_0xbb10('0x3b')]:_0x20dc10[_0xbb10('0x36')];if(!_0x135f93[_0xbb10('0x38')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0xfea6[_0xbb10('0x21')]=qs[_0xbb10('0x21')](_0x135f93['query']['limit']);_0xfea6['offset']=qs[_0xbb10('0x23')](_0x135f93[_0xbb10('0x38')]['offset']);}_0xfea6[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x135f93[_0xbb10('0x38')][_0xbb10('0x3f')]);_0xfea6[_0xbb10('0x40')]=qs['filters'](_[_0xbb10('0x41')](_0x135f93[_0xbb10('0x38')],_0x20dc10[_0xbb10('0x42')]),_0x114abb);if(_0x135f93[_0xbb10('0x38')][_0xbb10('0x43')]){_0xfea6[_0xbb10('0x40')]=_[_0xbb10('0x44')](_0xfea6[_0xbb10('0x40')],{'$or':_[_0xbb10('0x30')](_0x114abb,function(_0xdb8a71){if(_0xdb8a71[_0xbb10('0x34')]!==_0xbb10('0x45')){var _0x1a3621={};_0x1a3621[_0xdb8a71[_0xbb10('0x2d')]]={'$like':'%'+_0x135f93[_0xbb10('0x38')]['filter']+'%'};return _0x1a3621;}})});}_0xfea6=_['merge']({},_0xfea6,_0x135f93[_0xbb10('0x46')]);var _0x402655={'where':_0xfea6[_0xbb10('0x40')]};return db[_0xbb10('0x31')][_0xbb10('0x24')](_0x402655)[_0xbb10('0x13')](function(_0x3ee48b){_0xe44e32['count']=_0x3ee48b;if(_0x135f93[_0xbb10('0x38')][_0xbb10('0x47')]){_0xfea6['include']=[{'all':!![]}];}return db[_0xbb10('0x31')]['findAll'](_0xfea6);})['then'](function(_0x57cfc0){_0xe44e32['rows']=_0x57cfc0;return _0xe44e32;})['then'](respondWithFilteredResult(_0x582cb2,_0xfea6))[_0xbb10('0x48')](handleError(_0x582cb2,null));};exports[_0xbb10('0x49')]=function(_0x2a09f0,_0x2efdc6){var _0x498aa6={'raw':![],'where':{'id':_0x2a09f0[_0xbb10('0x4a')]['id']},'include':[{'model':db['Pause'],'as':_0xbb10('0x4b')}]},_0x5cdd35={};_0x5cdd35[_0xbb10('0x36')]=_[_0xbb10('0x37')](db['ChatWebsite'][_0xbb10('0x32')]);_0x5cdd35[_0xbb10('0x38')]=_['keys'](_0x2a09f0['query']);_0x5cdd35[_0xbb10('0x42')]=_[_0xbb10('0x39')](_0x5cdd35[_0xbb10('0x36')],_0x5cdd35[_0xbb10('0x38')]);_0x498aa6['attributes']=_[_0xbb10('0x39')](_0x5cdd35[_0xbb10('0x36')],qs['fields'](_0x2a09f0[_0xbb10('0x38')][_0xbb10('0x3a')]));_0x498aa6[_0xbb10('0x3b')]=_0x498aa6[_0xbb10('0x3b')][_0xbb10('0x4c')]?_0x498aa6[_0xbb10('0x3b')]:_0x5cdd35['model'];if(_0x2a09f0[_0xbb10('0x38')][_0xbb10('0x47')]){_0x498aa6[_0xbb10('0x4d')]=[{'all':!![]}];}_0x498aa6=_[_0xbb10('0x44')]({},_0x498aa6,_0x2a09f0['options']);return db[_0xbb10('0x31')][_0xbb10('0x4e')](_0x498aa6)[_0xbb10('0x13')](handleEntityNotFound(_0x2efdc6,null))[_0xbb10('0x13')](respondWithResult(_0x2efdc6,null))[_0xbb10('0x48')](handleError(_0x2efdc6,null));};exports[_0xbb10('0x4f')]=function(_0x5f480e,_0x28d0cd){return db['ChatWebsite'][_0xbb10('0x4f')](_0x5f480e[_0xbb10('0x50')],{})[_0xbb10('0x13')](function(_0x198e40){var _0x3810c1=_0x5f480e[_0xbb10('0x51')][_0xbb10('0x28')]({'plain':!![]});if(!_0x3810c1)throw new Error(_0xbb10('0x52'));if(_0x3810c1[_0xbb10('0x53')]==='user'){var _0x2221bd=_0x198e40[_0xbb10('0x28')]({'plain':!![]});var _0x128eff=_0xbb10('0x29');return db[_0xbb10('0x54')][_0xbb10('0x4e')]({'where':{'name':_0x128eff,'userProfileId':_0x3810c1[_0xbb10('0x55')]},'raw':!![]})[_0xbb10('0x13')](function(_0x264459){if(_0x264459&&_0x264459[_0xbb10('0x56')]===0x0){return db[_0xbb10('0x2a')][_0xbb10('0x4f')]({'name':_0x2221bd[_0xbb10('0x2d')],'resourceId':_0x2221bd['id'],'type':_0x264459['name'],'sectionId':_0x264459['id']},{})[_0xbb10('0x13')](function(){return _0x198e40;});}else{return _0x198e40;}})[_0xbb10('0x48')](function(_0x5d0009){logger[_0xbb10('0x1a')](_0xbb10('0x57'),_0x5d0009);throw _0x5d0009;});}return _0x198e40;})[_0xbb10('0x13')](respondWithResult(_0x28d0cd,0xc9))[_0xbb10('0x48')](handleError(_0x28d0cd,null));};exports[_0xbb10('0x26')]=function(_0x295c72,_0x2b7700){if(_0x295c72[_0xbb10('0x50')]['id']){delete _0x295c72[_0xbb10('0x50')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x4e')]({'where':{'id':_0x295c72[_0xbb10('0x4a')]['id']},'include':[{'model':db[_0xbb10('0x2f')],'as':_0xbb10('0x4b')}]})[_0xbb10('0x13')](handleEntityNotFound(_0x2b7700,null))[_0xbb10('0x13')](saveUpdates(_0x295c72[_0xbb10('0x50')],null))[_0xbb10('0x13')](respondWithResult(_0x2b7700,null))[_0xbb10('0x48')](handleError(_0x2b7700,null));};exports[_0xbb10('0x27')]=function(_0x4732d5,_0x4b0c22){return db['ChatWebsite'][_0xbb10('0x4e')]({'where':{'id':_0x4732d5[_0xbb10('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4b0c22,null))[_0xbb10('0x13')](removeEntity(_0x4b0c22,null))['catch'](handleError(_0x4b0c22,null));};exports[_0xbb10('0x58')]=function(_0x3fb56d,_0x1b2ecb){return db[_0xbb10('0x31')][_0xbb10('0x58')]()[_0xbb10('0x13')](respondWithResult(_0x1b2ecb,null))[_0xbb10('0x48')](handleError(_0x1b2ecb,null));};exports[_0xbb10('0x59')]=function(_0x168c29,_0x366e5d){if(_0x168c29[_0xbb10('0x50')]['id']){delete _0x168c29['body']['id'];}return db['ChatWebsite'][_0xbb10('0x4e')]({'where':{'id':_0x168c29[_0xbb10('0x4a')]['id']}})['then'](handleEntityNotFound(_0x366e5d,null))[_0xbb10('0x13')](function(_0x2018fd){if(_0x2018fd){_0x168c29[_0xbb10('0x50')][_0xbb10('0x5a')]=_0x2018fd['id'];return db[_0xbb10('0x5b')][_0xbb10('0x4f')](_0x168c29[_0xbb10('0x50')]);}})[_0xbb10('0x13')](respondWithResult(_0x366e5d,null))['catch'](handleError(_0x366e5d,null));};exports['getDispositions']=function(_0x2d41d4,_0x160419){var _0x43a087={'raw':![],'where':{}};var _0x21e7b2={};var _0x1015d1={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x2d41d4['params']['id']}})[_0xbb10('0x13')](handleEntityNotFound(_0x160419,null))[_0xbb10('0x13')](function(_0x2d3b9e){if(_0x2d3b9e){_0x21e7b2[_0xbb10('0x36')]=_[_0xbb10('0x37')](db[_0xbb10('0x5b')][_0xbb10('0x32')]);_0x21e7b2['query']=_[_0xbb10('0x37')](_0x2d41d4[_0xbb10('0x38')]);_0x21e7b2['filters']=_[_0xbb10('0x39')](_0x21e7b2['model'],_0x21e7b2['query']);_0x43a087[_0xbb10('0x3b')]=_[_0xbb10('0x39')](_0x21e7b2[_0xbb10('0x36')],qs[_0xbb10('0x3a')](_0x2d41d4[_0xbb10('0x38')][_0xbb10('0x3a')]));_0x43a087[_0xbb10('0x3b')]=_0x43a087[_0xbb10('0x3b')][_0xbb10('0x4c')]?_0x43a087[_0xbb10('0x3b')]:_0x21e7b2[_0xbb10('0x36')];if(!_0x2d41d4[_0xbb10('0x38')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x43a087['limit']=qs[_0xbb10('0x21')](_0x2d41d4[_0xbb10('0x38')][_0xbb10('0x21')]);_0x43a087[_0xbb10('0x23')]=qs[_0xbb10('0x23')](_0x2d41d4['query'][_0xbb10('0x23')]);}_0x43a087['order']=qs[_0xbb10('0x3f')](_0x2d41d4[_0xbb10('0x38')][_0xbb10('0x3f')]);_0x43a087[_0xbb10('0x40')]=qs[_0xbb10('0x42')](_[_0xbb10('0x41')](_0x2d41d4[_0xbb10('0x38')],_0x21e7b2['filters']));_0x43a087['where'][_0xbb10('0x5a')]=_0x2d3b9e['id'];if(_0x2d41d4[_0xbb10('0x38')][_0xbb10('0x43')]){_0x43a087[_0xbb10('0x40')]=_[_0xbb10('0x44')](_0x43a087[_0xbb10('0x40')],{'$or':_['map'](_0x43a087[_0xbb10('0x3b')],function(_0x553871){var _0x19e477={};_0x19e477[_0x553871]={'$like':'%'+_0x2d41d4['query'][_0xbb10('0x43')]+'%'};return _0x19e477;})});}_0x43a087=_[_0xbb10('0x44')]({},_0x43a087,_0x2d41d4['options']);return db[_0xbb10('0x5b')][_0xbb10('0x24')]({'where':_0x43a087[_0xbb10('0x40')]})[_0xbb10('0x13')](function(_0xaa5fa9){_0x1015d1[_0xbb10('0x24')]=_0xaa5fa9;if(_0x2d41d4[_0xbb10('0x38')][_0xbb10('0x47')]){_0x43a087[_0xbb10('0x4d')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x43a087);})[_0xbb10('0x13')](function(_0x5beac6){_0x1015d1[_0xbb10('0x5d')]=_0x5beac6;return _0x1015d1;});}})['then'](respondWithFilteredResult(_0x160419,_0x43a087))[_0xbb10('0x48')](handleError(_0x160419,null));};exports[_0xbb10('0x5e')]=function(_0x4930fb,_0x1859a1){return db[_0xbb10('0x31')][_0xbb10('0x4e')]({'where':{'id':_0x4930fb[_0xbb10('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1859a1,null))[_0xbb10('0x13')](function(_0x47d5eb){if(_0x47d5eb){return _0x47d5eb[_0xbb10('0x5e')](_0x4930fb['query']['ids']);}})['then'](respondWithStatusCode(_0x1859a1,null))[_0xbb10('0x48')](handleError(_0x1859a1,null));};exports[_0xbb10('0x5f')]=function(_0x4dd04f,_0x34a74a){if(_0x4dd04f['body']['id']){delete _0x4dd04f[_0xbb10('0x50')]['id'];}return db['ChatWebsite'][_0xbb10('0x4e')]({'where':{'id':_0x4dd04f[_0xbb10('0x4a')]['id']}})[_0xbb10('0x13')](handleEntityNotFound(_0x34a74a,null))[_0xbb10('0x13')](function(_0x1f74b5){if(_0x1f74b5){_0x4dd04f[_0xbb10('0x50')][_0xbb10('0x5a')]=_0x1f74b5['id'];return db['CannedAnswer']['create'](_0x4dd04f[_0xbb10('0x50')]);}})['then'](respondWithResult(_0x34a74a,null))[_0xbb10('0x48')](handleError(_0x34a74a,null));};exports[_0xbb10('0x60')]=function(_0x1f07c2,_0x1902d1){var _0x28b02b={'raw':![],'where':{}};var _0x4de651={};var _0x53c3f4={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x1f07c2[_0xbb10('0x4a')]['id']}})[_0xbb10('0x13')](handleEntityNotFound(_0x1902d1,null))[_0xbb10('0x13')](function(_0x389731){if(_0x389731){_0x4de651[_0xbb10('0x36')]=_[_0xbb10('0x37')](db['CannedAnswer'][_0xbb10('0x32')]);_0x4de651[_0xbb10('0x38')]=_['keys'](_0x1f07c2['query']);_0x4de651['filters']=_[_0xbb10('0x39')](_0x4de651['model'],_0x4de651[_0xbb10('0x38')]);_0x28b02b[_0xbb10('0x3b')]=_[_0xbb10('0x39')](_0x4de651[_0xbb10('0x36')],qs[_0xbb10('0x3a')](_0x1f07c2[_0xbb10('0x38')]['fields']));_0x28b02b[_0xbb10('0x3b')]=_0x28b02b[_0xbb10('0x3b')]['length']?_0x28b02b['attributes']:_0x4de651[_0xbb10('0x36')];if(!_0x1f07c2[_0xbb10('0x38')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x28b02b['limit']=qs['limit'](_0x1f07c2[_0xbb10('0x38')][_0xbb10('0x21')]);_0x28b02b[_0xbb10('0x23')]=qs[_0xbb10('0x23')](_0x1f07c2['query'][_0xbb10('0x23')]);}_0x28b02b[_0xbb10('0x3e')]=qs['sort'](_0x1f07c2[_0xbb10('0x38')][_0xbb10('0x3f')]);_0x28b02b[_0xbb10('0x40')]=qs[_0xbb10('0x42')](_[_0xbb10('0x41')](_0x1f07c2[_0xbb10('0x38')],_0x4de651[_0xbb10('0x42')]));_0x28b02b[_0xbb10('0x40')]['ChatWebsiteId']=_0x389731['id'];if(_0x1f07c2[_0xbb10('0x38')][_0xbb10('0x43')]){_0x28b02b[_0xbb10('0x40')]=_['merge'](_0x28b02b['where'],{'$or':_['map'](_0x28b02b[_0xbb10('0x3b')],function(_0x41d1ee){var _0x4938e8={};_0x4938e8[_0x41d1ee]={'$like':'%'+_0x1f07c2['query']['filter']+'%'};return _0x4938e8;})});}_0x28b02b=_[_0xbb10('0x44')]({},_0x28b02b,_0x1f07c2['options']);return db[_0xbb10('0x61')][_0xbb10('0x24')]({'where':_0x28b02b[_0xbb10('0x40')]})[_0xbb10('0x13')](function(_0x3dc6c8){_0x53c3f4[_0xbb10('0x24')]=_0x3dc6c8;if(_0x1f07c2[_0xbb10('0x38')][_0xbb10('0x47')]){_0x28b02b[_0xbb10('0x4d')]=[{'all':!![]}];}return db[_0xbb10('0x61')][_0xbb10('0x62')](_0x28b02b);})['then'](function(_0x1e38fc){_0x53c3f4['rows']=_0x1e38fc;return _0x53c3f4;});}})[_0xbb10('0x13')](respondWithFilteredResult(_0x1902d1,_0x28b02b))['catch'](handleError(_0x1902d1,null));};exports[_0xbb10('0x63')]=function(_0x5abd53,_0x1631d9){return db[_0xbb10('0x31')][_0xbb10('0x4e')]({'where':{'id':_0x5abd53[_0xbb10('0x4a')]['id']}})[_0xbb10('0x13')](handleEntityNotFound(_0x1631d9,null))[_0xbb10('0x13')](function(_0x75f1fe){if(_0x75f1fe){return _0x75f1fe[_0xbb10('0x63')](_0x5abd53[_0xbb10('0x38')]['ids']);}})['then'](respondWithStatusCode(_0x1631d9,null))[_0xbb10('0x48')](handleError(_0x1631d9,null));};exports[_0xbb10('0x64')]=function(_0x58f7f6,_0x4a41dd){_0x58f7f6[_0xbb10('0x50')][_0xbb10('0x65')]=_0x58f7f6['file'][_0xbb10('0x66')];return db['ChatWebsite'][_0xbb10('0x4e')]({'where':{'id':_0x58f7f6['params']['id']}})[_0xbb10('0x13')](handleEntityNotFound(_0x4a41dd,null))[_0xbb10('0x13')](saveUpdates(_0x58f7f6[_0xbb10('0x50')],null))[_0xbb10('0x13')](respondWithResult(_0x4a41dd,null))[_0xbb10('0x48')](handleError(_0x4a41dd,null));};exports['addAvatar']=function(_0x37a39c,_0xe6e2e6){_0x37a39c[_0xbb10('0x50')][_0xbb10('0x67')]=_0x37a39c[_0xbb10('0x68')]['filename'];return db[_0xbb10('0x31')][_0xbb10('0x4e')]({'where':{'id':_0x37a39c[_0xbb10('0x4a')]['id']}})[_0xbb10('0x13')](handleEntityNotFound(_0xe6e2e6,null))['then'](saveUpdates(_0x37a39c[_0xbb10('0x50')],null))['then'](respondWithResult(_0xe6e2e6,null))[_0xbb10('0x48')](handleError(_0xe6e2e6,null));};exports['addCustomerAvatar']=function(_0x52327a,_0x24c133){_0x52327a[_0xbb10('0x50')][_0xbb10('0x69')]=_0x52327a[_0xbb10('0x68')]['filename'];return db['ChatWebsite'][_0xbb10('0x4e')]({'where':{'id':_0x52327a[_0xbb10('0x4a')]['id']}})[_0xbb10('0x13')](handleEntityNotFound(_0x24c133,null))[_0xbb10('0x13')](saveUpdates(_0x52327a[_0xbb10('0x50')],null))[_0xbb10('0x13')](respondWithResult(_0x24c133,null))[_0xbb10('0x48')](handleError(_0x24c133,null));};exports[_0xbb10('0x6a')]=function(_0x1668ed,_0x5c1ebc){_0x1668ed[_0xbb10('0x50')][_0xbb10('0x6b')]=_0x1668ed[_0xbb10('0x68')]['filename'];return db[_0xbb10('0x31')][_0xbb10('0x4e')]({'where':{'id':_0x1668ed[_0xbb10('0x4a')]['id']}})[_0xbb10('0x13')](handleEntityNotFound(_0x5c1ebc,null))[_0xbb10('0x13')](saveUpdates(_0x1668ed['body'],null))[_0xbb10('0x13')](respondWithResult(_0x5c1ebc,null))[_0xbb10('0x48')](handleError(_0x5c1ebc,null));};exports[_0xbb10('0x6c')]=function(_0x2c912a,_0x2e449d){var _0x3c0dc6=path[_0xbb10('0x6d')](config[_0xbb10('0x6e')],_0xbb10('0x6f'));var _0x5a793f={'where':{'id':_0x2c912a[_0xbb10('0x4a')]['id']},'attributes':['id',_0xbb10('0x65')],'raw':!![]};var _0x1841dd=![];return require(_0xbb10('0x70'))[_0xbb10('0x71')]()['then'](function(_0x3ff3bd){if(_0x3ff3bd){_0x1841dd=_0x3ff3bd[_0xbb10('0x72')];}})['then'](function(){return db[_0xbb10('0x31')][_0xbb10('0x4e')](_0x5a793f);})[_0xbb10('0x13')](handleEntityNotFound(_0x2e449d,null))[_0xbb10('0x13')](function(_0x366d18){if(_0x366d18){if(!_[_0xbb10('0x73')](_0x366d18['sitepic'])){if(fs[_0xbb10('0x74')](path[_0xbb10('0x6d')](config['root'],'server/files/images/logos/',_0x366d18[_0xbb10('0x65')]))&&_0x1841dd){_0x3c0dc6=path[_0xbb10('0x6d')](config[_0xbb10('0x6e')],_0xbb10('0x75'),_0x366d18[_0xbb10('0x65')]);}}return _0x2e449d['download'](_0x3c0dc6);}})[_0xbb10('0x48')](handleError(_0x2e449d,null));};exports[_0xbb10('0x76')]=function(_0x3a5cd7,_0x40b182){var _0x1ac919=path[_0xbb10('0x6d')](config[_0xbb10('0x6e')],_0xbb10('0x77'));var _0x53ba9a={'where':{'id':_0x3a5cd7['params']['id']},'attributes':['id',_0xbb10('0x67')],'raw':!![]};return db[_0xbb10('0x31')][_0xbb10('0x4e')](_0x53ba9a)[_0xbb10('0x13')](handleEntityNotFound(_0x40b182,null))[_0xbb10('0x13')](function(_0x412564){if(_0x412564){if(!_[_0xbb10('0x73')](_0x412564[_0xbb10('0x67')])){if(fs[_0xbb10('0x74')](path[_0xbb10('0x6d')](config['root'],_0xbb10('0x78'),_0x412564[_0xbb10('0x67')]))){_0x1ac919=path['join'](config[_0xbb10('0x6e')],'server/files/images/avatars/',_0x412564[_0xbb10('0x67')]);}}return _0x40b182[_0xbb10('0x79')](_0x1ac919);}})[_0xbb10('0x48')](handleError(_0x40b182,null));};exports['getCustomerAvatar']=function(_0x4cfc41,_0x4d4aa1){var _0x5d2f61=path[_0xbb10('0x6d')](config[_0xbb10('0x6e')],'server/files/images/avatars/customer_avatar.png');var _0x1699f3={'where':{'id':_0x4cfc41[_0xbb10('0x4a')]['id']},'attributes':['id',_0xbb10('0x69'),_0xbb10('0x7a')],'raw':!![]};return db[_0xbb10('0x31')][_0xbb10('0x4e')](_0x1699f3)['then'](handleEntityNotFound(_0x4d4aa1,null))[_0xbb10('0x13')](function(_0x21c272){if(_0x21c272){if(!_[_0xbb10('0x73')](_0x21c272['customerAvatar'])){if(fs['existsSync'](path[_0xbb10('0x6d')](config[_0xbb10('0x6e')],'server/files/images/avatars/',_0x21c272['customerAvatar']))&&_0x21c272[_0xbb10('0x7a')]){_0x5d2f61=path[_0xbb10('0x6d')](config['root'],_0xbb10('0x78'),_0x21c272[_0xbb10('0x69')]);}}return _0x4d4aa1['download'](_0x5d2f61);}})[_0xbb10('0x48')](handleError(_0x4d4aa1,null));};exports[_0xbb10('0x7b')]=function(_0x3177b9,_0x3041d7){var _0x25f2d9=path[_0xbb10('0x6d')](config['root'],_0xbb10('0x7c'));var _0x5b0676={'where':{'id':_0x3177b9[_0xbb10('0x4a')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xbb10('0x31')][_0xbb10('0x4e')](_0x5b0676)[_0xbb10('0x13')](handleEntityNotFound(_0x3041d7,null))['then'](function(_0x2975f3){if(_0x2975f3){if(!_[_0xbb10('0x73')](_0x2975f3[_0xbb10('0x6b')])){if(fs[_0xbb10('0x74')](path['join'](config[_0xbb10('0x6e')],_0xbb10('0x78'),_0x2975f3['systemAvatar']))){_0x25f2d9=path['join'](config[_0xbb10('0x6e')],'server/files/images/avatars/',_0x2975f3['systemAvatar']);}}return _0x3041d7[_0xbb10('0x79')](_0x25f2d9);}})[_0xbb10('0x48')](handleError(_0x3041d7,null));};exports[_0xbb10('0x7d')]=function(_0x23ec2f,_0x42b5e9){var _0x2c6fb2=require(_0xbb10('0x7e'));var _0x141c64=new _0x2c6fb2();var _0xc6dc51=_0x141c64[_0xbb10('0x7f')](_0x23ec2f['headers'][_0xbb10('0x80')])['getResult']();var _0x4349bf={'body':_0x23ec2f[_0xbb10('0x50')],'channel':_0xbb10('0x81')};var _0x1b7906=[];var _0x49b74e=[];var _0x128f45={};var _0x9e04dc=![];return db[_0xbb10('0x82')][_0xbb10('0x58')]()['then'](function(_0x140c72){if(!_0x140c72){throw new db[(_0xbb10('0x83'))][(_0xbb10('0x84'))](_0xbb10('0x85'));}_0x1b7906=_['difference'](_['keys'](_0x140c72),[_0xbb10('0x86'),_0xbb10('0x87')]);_0x49b74e=_[_0xbb10('0x88')](_[_0xbb10('0x37')](_0x140c72),[_0xbb10('0x86'),_0xbb10('0x87'),_0xbb10('0x89'),_0xbb10('0x8a')]);if(_0x23ec2f['body']['id']){delete _0x23ec2f[_0xbb10('0x50')]['id'];}if(_[_0xbb10('0x73')](_0x23ec2f['body'][_0xbb10('0x8b')])){throw new db['Sequelize'][(_0xbb10('0x84'))](_0xbb10('0x8c'));}if(_[_0xbb10('0x73')](_0x23ec2f['body'][_0xbb10('0x50')])||_0x23ec2f[_0xbb10('0x50')]['body']===''){throw new db[(_0xbb10('0x83'))]['ValidationError'](_0xbb10('0x8d'));}if(_[_0xbb10('0x73')](_0x23ec2f[_0xbb10('0x50')][_0xbb10('0x8e')])){throw new db[(_0xbb10('0x83'))][(_0xbb10('0x84'))](_0xbb10('0x8f')+_0x49b74e);}if(!_['includes'](_0x49b74e,_0x23ec2f['body'][_0xbb10('0x8e')])){throw new db[(_0xbb10('0x83'))][(_0xbb10('0x84'))](_0xbb10('0x90')+_0x49b74e);}_0x128f45[_0x23ec2f['body'][_0xbb10('0x8e')]]=_0x23ec2f[_0xbb10('0x50')][_0xbb10('0x8b')];})['then'](function(){return db[_0xbb10('0x31')][_0xbb10('0x4e')]({'where':{'id':_0x23ec2f[_0xbb10('0x4a')]['id']},'include':[{'model':db[_0xbb10('0x91')],'as':_0xbb10('0x92'),'include':[{'model':db[_0xbb10('0x82')],'as':'Contacts','where':_0x128f45,'limit':0x1,'order':[[_0xbb10('0x87'),_0xbb10('0x93')]]}]},{'model':db[_0xbb10('0x94')],'as':'Applications'}]});})[_0xbb10('0x13')](handleEntityNotFound(_0x42b5e9,null))['then'](function(_0x4bea6f){if(_0x4bea6f&&_0x4bea6f[_0xbb10('0x92')]){_0x4349bf['account']=_0x4bea6f;_0x4349bf[_0xbb10('0x95')]=_0x4bea6f[_0xbb10('0x96')];_0x4349bf[_0xbb10('0x97')]=_0x4bea6f[_0xbb10('0x92')];_0x4349bf[_0xbb10('0x95')]=_[_0xbb10('0x98')](_0x4349bf[_0xbb10('0x95')],[_0xbb10('0x99')],[_0xbb10('0x9a')]);if(_0x4349bf['account'][_0xbb10('0x96')]){delete _0x4349bf[_0xbb10('0x9b')][_0xbb10('0x96')];}if(_0x4349bf[_0xbb10('0x9b')]['List']&&_0x4349bf[_0xbb10('0x9b')][_0xbb10('0x92')][_0xbb10('0x9c')]['length']){return _0x4349bf['account']['List'][_0xbb10('0x9c')][0x0];}var _0xeb4255=_['defaults'](_0x23ec2f[_0xbb10('0x50')],{'firstName':_0x23ec2f[_0xbb10('0x50')][_0xbb10('0x8b')],'ListId':_0x4bea6f[_0xbb10('0x8a')]});_0xeb4255[_0x23ec2f[_0xbb10('0x50')]['mapKey']]=_0x23ec2f[_0xbb10('0x50')]['from'];return db[_0xbb10('0x82')][_0xbb10('0x4f')](_0xeb4255,{'fields':_0x1b7906,'raw':!![]});}})[_0xbb10('0x13')](handleEntityNotFound(_0x42b5e9,null))[_0xbb10('0x13')](function(_0x44974c){_0x4349bf[_0xbb10('0x9d')]=_0x44974c;var _0x9e86ba=_0x23ec2f[_0xbb10('0x50')][_0xbb10('0x9e')];if(_0x23ec2f[_0xbb10('0x9f')]['cf-connecting-ip']){_0x9e86ba=_0x23ec2f[_0xbb10('0x9f')][_0xbb10('0xa0')];}else if(_0x23ec2f[_0xbb10('0x9f')]['x-forwarded-for']){_0x9e86ba=_[_0xbb10('0xa1')](_0x23ec2f[_0xbb10('0x9f')][_0xbb10('0xa2')][_0xbb10('0xa3')](','));}if(_0x44974c){var _0x3ac951={'ContactId':_0x44974c['id'],'ChatWebsiteId':_0x23ec2f[_0xbb10('0x4a')]['id'],'from':(_0x44974c[_0xbb10('0xa4')]||'')+'\x20'+(_0x44974c[_0xbb10('0xa5')]||''),'customerIp':_0x9e86ba,'customerPort':_0x23ec2f[_0xbb10('0x9f')][_0xbb10('0xa6')]?_0x23ec2f['headers'][_0xbb10('0xa6')]:null,'referer':_0x23ec2f[_0xbb10('0x50')]['referer'],'browserName':_0xc6dc51[_0xbb10('0xa7')][_0xbb10('0x2d')]&&_0xc6dc51[_0xbb10('0xa7')][_0xbb10('0xa8')]?util['format']('%s\x20%s',_0xc6dc51[_0xbb10('0xa7')]['name'],_0xc6dc51[_0xbb10('0xa7')]['version']):_0xbb10('0xa9'),'browserVersion':_0xc6dc51[_0xbb10('0xa7')][_0xbb10('0xa8')]||_0xbb10('0xa9'),'osName':util['format'](_0xbb10('0xaa'),_0xc6dc51['os'][_0xbb10('0x2d')],_0xc6dc51['os'][_0xbb10('0xa8')]),'osVersion':_0xc6dc51['os'][_0xbb10('0xa8')],'deviceModel':_0xc6dc51[_0xbb10('0xab')][_0xbb10('0x36')]&&_0xc6dc51[_0xbb10('0xab')]['vendor']?util[_0xbb10('0xac')](_0xbb10('0xad'),_0xc6dc51[_0xbb10('0xab')]['model'],_0xc6dc51[_0xbb10('0xab')][_0xbb10('0xae')],_0xc6dc51[_0xbb10('0xab')][_0xbb10('0x34')]):null,'deviceVendor':_0xc6dc51[_0xbb10('0xab')]['vendor'],'deviceType':_0xc6dc51['device'][_0xbb10('0x34')],'formData':JSON[_0xbb10('0x19')](_0x23ec2f['body'])};var _0x301785={'ChatWebsiteId':_0x23ec2f[_0xbb10('0x4a')]['id'],'closed':![]};if(_0x23ec2f[_0xbb10('0x50')][_0xbb10('0xaf')]){_0x301785[_0xbb10('0xaf')]=_0x23ec2f[_0xbb10('0x50')][_0xbb10('0xaf')];return db[_0xbb10('0xb0')][_0xbb10('0x4e')]({'where':_0x301785})[_0xbb10('0x13')](function(_0x5166bf){if(_0x5166bf){return[_0x5166bf,![]];}_0x3ac951[_0xbb10('0xaf')]=_0x23ec2f['body']['threadId'];_0x3ac951[_0xbb10('0xb1')]=_0x23ec2f[_0xbb10('0x50')][_0xbb10('0xb1')];return db['ChatInteraction'][_0xbb10('0x4f')](_0x3ac951)[_0xbb10('0x13')](function(_0x3eb915){return[_0x3eb915,!![]];});});}_0x301785['ContactId']=_0x44974c['id'];if(_0x23ec2f[_0xbb10('0x50')][_0xbb10('0xb2')]&&_0x23ec2f['body'][_0xbb10('0xb2')]['id']){_0x301785['id']=_0x23ec2f[_0xbb10('0x50')][_0xbb10('0xb2')]['id'];return db[_0xbb10('0xb0')]['find']({'where':_0x301785})[_0xbb10('0x13')](function(_0x2e40b2){if(_0x2e40b2){return[_0x2e40b2,![]];}return db[_0xbb10('0xb0')][_0xbb10('0x4f')](_0x3ac951)[_0xbb10('0x13')](function(_0x262975){return[_0x262975,!![]];});});}return db[_0xbb10('0xb0')]['create'](_0x3ac951)['then'](function(_0x27a89e){return[_0x27a89e,!![]];});}})[_0xbb10('0xb3')](function(_0x5594ed,_0x351037){if(_0x5594ed){_0x9e04dc=_0x351037;if(!_0x351037){var _0x69efe2={'from':(_0x4349bf[_0xbb10('0x9d')][_0xbb10('0xa4')]||'')+'\x20'+(_0x4349bf[_0xbb10('0x9d')][_0xbb10('0xa5')]||'')};if(_0x23ec2f[_0xbb10('0x50')][_0xbb10('0xaf')]&&_0x23ec2f[_0xbb10('0x50')][_0xbb10('0xb4')]&&_0x23ec2f[_0xbb10('0x50')][_0xbb10('0xaf')]!=_0x23ec2f[_0xbb10('0x50')][_0xbb10('0xb4')]){_0x69efe2[_0xbb10('0xaf')]=_0x23ec2f[_0xbb10('0x50')][_0xbb10('0xb4')];}return _0x5594ed['update'](_0x69efe2);}else{return _0x5594ed;}}})[_0xbb10('0x13')](function(_0xf3269a){_0x4349bf[_0xbb10('0xb2')]=_0xf3269a[_0xbb10('0x28')]({'plain':!![]});_0x4349bf[_0xbb10('0xb2')][_0xbb10('0xb5')]=_0x9e04dc;if(_0x4349bf['interaction'][_0xbb10('0xb5')]){if(_0x4349bf[_0xbb10('0x9b')][_0xbb10('0xb6')]){_0x4349bf[_0xbb10('0x95')][_0xbb10('0xb7')]({'id':0x0,'priority':_0x4349bf[_0xbb10('0x95')]['length']+0x1,'app':'close','appdata':_0xbb10('0xb8'),'interval':'*,*,*,*'});}}return db[_0xbb10('0xb9')]['create']({'body':_0x23ec2f[_0xbb10('0x50')][_0xbb10('0x50')],'ChatWebsiteId':_0x23ec2f['params']['id'],'ChatInteractionId':_0xf3269a['id'],'direction':'in','ContactId':_0x4349bf['contact']['id'],'AttachmentId':_0x23ec2f['body'][_0xbb10('0xba')]});})['then'](function(_0x2b2102){_0x4349bf[_0xbb10('0x1c')]=_0x2b2102;if(_0x4349bf[_0xbb10('0xb2')][_0xbb10('0xbb')]){return db[_0xbb10('0xbc')]['find']({'attributes':['id',_0xbb10('0x2d')],'where':{'id':_0x4349bf[_0xbb10('0xb2')][_0xbb10('0xbb')]}})[_0xbb10('0x13')](function(_0x2ea1e0){if(_0x2ea1e0){_0x4349bf[_0xbb10('0x95')][_0xbb10('0xbd')]({'id':0x0,'priority':0x0,'app':_0xbb10('0xbe'),'appdata':_0x2ea1e0[_0xbb10('0x2d')]+','+(_0x4349bf[_0xbb10('0x9b')][_0xbb10('0xbf')]||0xa),'interval':_0xbb10('0xc0')});_0x4349bf[_0xbb10('0xc1')]=!![];}return respondWithRpcPromise(_0xbb10('0xc2'),_0xbb10('0xc3'),_0x4349bf);});}return respondWithRpcPromise(_0xbb10('0xc2'),_0xbb10('0xc3'),_0x4349bf);})[_0xbb10('0x13')](function(_0x19fa3f){respondWithRpcPromise(_0xbb10('0xc4'),_0xbb10('0xc4'),{'event':'notify','message':_0x19fa3f},client9002);return _0x19fa3f;})[_0xbb10('0x13')](respondWithResult(_0x42b5e9,null))[_0xbb10('0x48')](handleError(_0x42b5e9,null));};exports['offline']=function(_0x93ebc,_0x3f9bf8){var _0x26cf88,_0x2b8a95,_0x1ea0c0;var _0x143566=[];var _0x18e9d1={};var _0x450625=_0x93ebc[_0xbb10('0xc5')]||[];var _0xa12882=[];var _0x1810e9;return db[_0xbb10('0x82')][_0xbb10('0x58')]()[_0xbb10('0x13')](function(_0x72d43e){if(!_0x72d43e){throw new db[(_0xbb10('0x83'))][(_0xbb10('0x84'))]('no\x20available\x20attributes');}_0x143566=_['difference'](_[_0xbb10('0x37')](_0x72d43e),[_0xbb10('0x86'),'updatedAt',_0xbb10('0x89'),_0xbb10('0x8a')]);if(_0x93ebc['body']['id']){delete _0x93ebc[_0xbb10('0x50')]['id'];}if(_[_0xbb10('0x73')](_0x93ebc[_0xbb10('0x50')][_0xbb10('0x8b')])){throw _0x3f9bf8[_0xbb10('0x1e')](0x1f4)[_0xbb10('0xc6')](new db[(_0xbb10('0x83'))]['ValidationError']('from\x20is\x20mandatory'));}if(_['isNil'](_0x93ebc[_0xbb10('0x50')][_0xbb10('0x50')])||_0x93ebc[_0xbb10('0x50')][_0xbb10('0x50')]===''){throw _0x3f9bf8[_0xbb10('0x1e')](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0xbb10('0x8d')));}if(_[_0xbb10('0x73')](_0x93ebc[_0xbb10('0x50')][_0xbb10('0xc7')])){throw _0x3f9bf8[_0xbb10('0x1e')](0x1f4)[_0xbb10('0xc6')](new db[(_0xbb10('0x83'))][(_0xbb10('0x84'))](_0xbb10('0xc8')+_0x143566));}if(!_[_0xbb10('0xc9')](_0x143566,_0x93ebc['body'][_0xbb10('0xc7')])){throw _0x3f9bf8[_0xbb10('0x1e')](0x1f4)[_0xbb10('0xc6')](new db[(_0xbb10('0x83'))][(_0xbb10('0x84'))](_0xbb10('0xca')+_0x143566));}_0x18e9d1[_0x93ebc['body']['mapKeyOffline']]=_0x93ebc[_0xbb10('0x50')][_0xbb10('0x8b')];})[_0xbb10('0x13')](function(){return db[_0xbb10('0x31')][_0xbb10('0x4e')]({'where':{'id':_0x93ebc[_0xbb10('0x4a')]['id']},'include':[{'model':db[_0xbb10('0x91')],'as':_0xbb10('0x92')},{'model':db[_0xbb10('0xcb')],'as':'MailAccount'}]});})[_0xbb10('0x13')](handleEntityNotFound(_0x3f9bf8,null))[_0xbb10('0x13')](function(_0x4f3536){if(_0x4f3536&&_0x4f3536['List']){_0x2b8a95=_0x4f3536;var _0x5b8377=_[_0xbb10('0xc')](_0x93ebc[_0xbb10('0x50')],{'firstName':_0x93ebc[_0xbb10('0x50')][_0xbb10('0x8b')],'phone':_0x93ebc[_0xbb10('0x50')][_0xbb10('0x8b')],'ListId':_0x4f3536[_0xbb10('0x8a')]});_0x5b8377[_0x93ebc['body']['mapKeyOffline']]=_0x93ebc[_0xbb10('0x50')][_0xbb10('0x8b')];return db[_0xbb10('0x82')][_0xbb10('0xcc')]({'where':_0x18e9d1,'defaults':_0x5b8377});}})[_0xbb10('0xb3')](function(_0x3649d5){if(_0x3649d5){_0x1ea0c0=_0x3649d5;var _0x4060d9=fs[_0xbb10('0xcd')](path[_0xbb10('0x6d')](config[_0xbb10('0x6e')],_0xbb10('0xce')),_0xbb10('0xcf'));var _0x5590d9=ejs[_0xbb10('0xd0')](_0x4060d9,{'body':_[_0xbb10('0xd1')](_0x93ebc[_0xbb10('0x50')]['body']),'bodyTitle':_0x2b8a95[_0xbb10('0xd2')]});return db['ChatOfflineMessage'][_0xbb10('0x4f')]({'body':_0x5590d9,'plainBody':htmlToText[_0xbb10('0xd3')](_0x5590d9),'ContactId':_0x3649d5['id'],'ChatWebsiteId':_0x2b8a95['id']});}})[_0xbb10('0x13')](function(_0x1d5224){_0x1810e9=_0x1d5224;if(_0x450625[_0xbb10('0x4c')]){var _0x38f6a1=_0x450625['map'](function(_0x225850){return{'name':_0x225850['originalname'],'basename':_0x225850['filename'],'type':_0x225850['mimetype'],'ChatOfflineMessageId':_0x1d5224['id']};});_0xa12882=_0x38f6a1[_0xbb10('0x30')](_0x18000e=>{var _0x3ec5e1={'filename':_0x18000e['name'],'path':path[_0xbb10('0x6d')](config[_0xbb10('0x6e')],_0xbb10('0xd4'),_0xbb10('0xc5'),'attachments','offline-chat',_0x18000e['basename'])};return _0x3ec5e1;});if(!_0x2b8a95[_0xbb10('0xd5')]){return db[_0xbb10('0xd6')][_0xbb10('0xd7')](function(_0x560ea0){return db[_0xbb10('0xd8')][_0xbb10('0xd9')](_0x38f6a1,{'transaction':_0x560ea0});});}}})[_0xbb10('0x13')](function(){if(_0x1810e9){_0x26cf88=_0x1810e9;return db[_0xbb10('0xcb')][_0xbb10('0x5c')]({'where':{'service':!![]},'include':[{'model':db[_0xbb10('0xda')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xbb10('0xdb'),'raw':!![]}]}]});}})['then'](function(_0x4952f0){if(_0x4952f0&&_0x4952f0[_0xbb10('0xdc')]&&_0x2b8a95[_0xbb10('0xdd')]&&_0x2b8a95[_0xbb10('0xde')]){var _0x1aa881=_0x4952f0[_0xbb10('0xdf')]();return respondWithRpcPromise(_0xbb10('0xe0'),_0xbb10('0xe1'),{'account':_0x1aa881,'message':{'from':util[_0xbb10('0xac')]('\x22%s\x22\x20<%s>',_0x4952f0[_0xbb10('0x2d')],_0x4952f0[_0xbb10('0xe2')]||_0x4952f0[_0xbb10('0xdc')][_0xbb10('0x51')]),'to':_0x2b8a95[_0xbb10('0xde')],'subject':_0x2b8a95[_0xbb10('0xe3')],'html':_0x26cf88[_0xbb10('0x50')],'attachments':_0xa12882}},client9003)['then'](function(){return _0x26cf88;})[_0xbb10('0x48')](function(_0x55ca2a){logger[_0xbb10('0x1a')](_0x55ca2a);});}})['then'](function(){if(_0x2b8a95&&_0x2b8a95[_0xbb10('0xd5')]&&_0x2b8a95[_0xbb10('0xe4')]){var _0x507774=[];if(_0x450625[_0xbb10('0x4c')]){_0x507774=_0x450625[_0xbb10('0x30')](function(_0x2b57b2){return{'name':_0x2b57b2['originalname'],'basename':_0x2b57b2[_0xbb10('0x66')],'type':_0x2b57b2[_0xbb10('0xe5')],'ChatOfflineMessageId':_0x1810e9['id']};});}var _0x14100f;if(!_[_0xbb10('0x73')](_0x2b8a95[_0xbb10('0xe6')])){var _0x38f436=_[_0xbb10('0x30')](_0x93ebc['body'],function(_0x218a8a){return _0x218a8a;});var _0x54a40e=_[_0xbb10('0xe7')](_0x38f436)[0x0];var _0x19ed16=_[_0xbb10('0xe8')](_0x54a40e,function(_0x5d1624){return _0x5d1624;});_0x14100f=_0x19ed16[0x1][_0x2b8a95[_0xbb10('0xe6')]];}var _0x1b28c9={'from':_0x1ea0c0['email'],'firstName':_0x1ea0c0[_0xbb10('0xa4')],'lastName':_0x1ea0c0['lastName'],'mapKey':_0xbb10('0xe2'),'message':{'from':_0x1ea0c0[_0xbb10('0xe2')],'to':_0x2b8a95[_0xbb10('0xcb')][_0xbb10('0xe2')],'cc':'','subject':_[_0xbb10('0x73')](_0x14100f)?_0x2b8a95[_0xbb10('0xe3')]:_0x14100f,'messageId':'','sentAt':new Date(),'attach':_0x507774['length'],'attachments':_0x507774,'originChannel':_0xbb10('0xe9'),'ChatWebsiteId':_0x2b8a95['id'],'ChatOfflineMessageId':_0x26cf88['id'],'originTo':_0x2b8a95['MailAccount'][_0xbb10('0xe2')]},'body':_0x26cf88[_0xbb10('0x50')]};var _0x3faf29={'account':{'id':_0x2b8a95['MailAccountId']},'body':_0x1b28c9,'log':_0xbb10('0xea')};return respondWithRpcPromise(_0xbb10('0xea'),_0xbb10('0xeb'),_0x3faf29,client9001)[_0xbb10('0x13')](function(){return _0x26cf88;})[_0xbb10('0x48')](function(_0x47b1b){logger[_0xbb10('0x1a')](_0x47b1b);});}return;})['then'](function(){if(_0x26cf88){return _0x26cf88;}})[_0xbb10('0x13')](respondWithResult(_0x3f9bf8,null))[_0xbb10('0x48')](function(_0x471134){logger['error'](_0xbb10('0x48'),_0x471134);for(var _0x20bd66 of _0x450625){var _0x8e30c4=path[_0xbb10('0x6d')](config[_0xbb10('0x6e')],_0xbb10('0xd4'),_0xbb10('0xc5'),_0xbb10('0xec'),'offline-chat',_0x20bd66['filename']);fs_extra[_0xbb10('0xed')](_0x8e30c4)[_0xbb10('0x48')](function(_0x141399){logger[_0xbb10('0x1a')](_0xbb10('0xee'),_0x8e30c4,_0x141399);});}});};exports[_0xbb10('0xef')]=function(_0x5debe5,_0xa57f04){return db['ChatInteraction'][_0xbb10('0x4e')]({'where':{'id':_0x5debe5[_0xbb10('0x4a')]['id']}})[_0xbb10('0x13')](handleEntityNotFound(_0xa57f04,null))['then'](function(_0x390fff){if(_0x390fff){return _0x390fff[_0xbb10('0xef')](_0x5debe5['body'][_0xbb10('0xf0')],_['omit'](_0x5debe5['body'],[_0xbb10('0xf0'),'id'])||{});}})[_0xbb10('0x13')](respondWithResult(_0xa57f04,null))[_0xbb10('0x48')](handleError(_0xa57f04,null));};exports[_0xbb10('0xf1')]=function(_0xa355a8,_0x4f712d){var _0x444818={'raw':![],'where':{}};var _0x2a19f1={};var _0x5a9904={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0xa355a8[_0xbb10('0x4a')]['id']}})[_0xbb10('0x13')](handleEntityNotFound(_0x4f712d,null))[_0xbb10('0x13')](function(_0x302d36){if(_0x302d36){_0x2a19f1[_0xbb10('0x36')]=_['keys'](db[_0xbb10('0xb0')][_0xbb10('0x32')]);_0x2a19f1['query']=_['keys'](_0xa355a8[_0xbb10('0x38')]);_0x2a19f1['filters']=_['intersection'](_0x2a19f1[_0xbb10('0x36')],_0x2a19f1[_0xbb10('0x38')]);_0x444818[_0xbb10('0x3b')]=_['intersection'](_0x2a19f1[_0xbb10('0x36')],qs['fields'](_0xa355a8[_0xbb10('0x38')][_0xbb10('0x3a')]));_0x444818[_0xbb10('0x3b')]=_0x444818['attributes'][_0xbb10('0x4c')]?_0x444818[_0xbb10('0x3b')]:_0x2a19f1[_0xbb10('0x36')];if(!_0xa355a8[_0xbb10('0x38')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x444818['limit']=qs[_0xbb10('0x21')](_0xa355a8[_0xbb10('0x38')][_0xbb10('0x21')]);_0x444818[_0xbb10('0x23')]=qs[_0xbb10('0x23')](_0xa355a8[_0xbb10('0x38')][_0xbb10('0x23')]);}_0x444818[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0xa355a8[_0xbb10('0x38')]['sort']);_0x444818[_0xbb10('0x40')]=qs['filters'](_['pick'](_0xa355a8[_0xbb10('0x38')],_0x2a19f1[_0xbb10('0x42')]));_0x444818[_0xbb10('0x40')][_0xbb10('0x5a')]=_0x302d36['id'];if(_0xa355a8[_0xbb10('0x38')][_0xbb10('0x43')]){_0x444818[_0xbb10('0x40')]=_['merge'](_0x444818[_0xbb10('0x40')],{'$or':_[_0xbb10('0x30')](_0x444818[_0xbb10('0x3b')],function(_0x29a5c1){var _0x1f75d9={};_0x1f75d9[_0x29a5c1]={'$like':'%'+_0xa355a8[_0xbb10('0x38')][_0xbb10('0x43')]+'%'};return _0x1f75d9;})});}_0x444818=_[_0xbb10('0x44')]({},_0x444818,_0xa355a8['options']);return db['ChatInteraction'][_0xbb10('0x24')]({'where':_0x444818[_0xbb10('0x40')]})[_0xbb10('0x13')](function(_0x5f58a9){_0x5a9904['count']=_0x5f58a9;if(_0xa355a8[_0xbb10('0x38')]['includeAll']){_0x444818[_0xbb10('0x4d')]=[{'model':db[_0xbb10('0x82')],'as':_0xbb10('0xf2'),'required':![]},{'model':db[_0xbb10('0xbc')],'as':'Owner','attributes':[_0xbb10('0x2d'),_0xbb10('0xf3'),_0xbb10('0xf4')],'required':![]},{'model':db[_0xbb10('0xf5')],'as':_0xbb10('0xf6'),'attributes':['id','name',_0xbb10('0xf7')],'where':_0xa355a8[_0xbb10('0x38')][_0xbb10('0xf8')]?{'id':_0xa355a8[_0xbb10('0x38')][_0xbb10('0xf8')]}:undefined,'required':_0xa355a8['query'][_0xbb10('0xf8')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x444818);})[_0xbb10('0x13')](function(_0x8da0cb){_0x5a9904[_0xbb10('0x5d')]=_0x8da0cb;return _0x5a9904;});}})[_0xbb10('0x13')](respondWithFilteredResult(_0x4f712d,_0x444818))['catch'](handleError(_0x4f712d,null));};function iftimePromise(_0x302241,_0x123917){return respondWithRpcPromise(_0xbb10('0xf9'),'getSnippet',{'command':_0x123917['timezone']?util[_0xbb10('0xac')](_0xbb10('0xfa'),_0x302241['interval'],_0x123917[_0xbb10('0xfb')]):util[_0xbb10('0xac')](_0xbb10('0xfc'),_0x302241['interval'])},client9002)[_0xbb10('0x13')](function(_0x2421f1){var _0x293753=_0x2421f1&&_0x2421f1[_0xbb10('0xfd')](_0xbb10('0xfe'))>=0x0?!![]:![];logger[_0xbb10('0x14')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x123917['id'],_0x302241['id'],_0x302241[_0xbb10('0xff')],_0x293753?_0xbb10('0x100'):_0xbb10('0x101'),_0x123917[_0xbb10('0xfb')]?_0x123917[_0xbb10('0xfb')]:_0xbb10('0x102'));return _0x293753;})[_0xbb10('0x48')](function(_0x487603){logger[_0xbb10('0x1a')](_0xbb10('0x103'),_0x123917['id'],_0x302241['id'],_0x302241[_0xbb10('0xff')],util[_0xbb10('0x104')](_0x487603,{'showHidden':![],'depth':null}),_0x123917[_0xbb10('0xfb')]?_0x123917['timezone']:'No\x20timezone');return![];});}exports[_0xbb10('0x105')]=function(_0x36c964,_0x344015){var _0x322f28=0x0;var _0x2656c3=0x0;var _0x33ea36=![];var _0x168634;var _0x3e7421;return db['ChatWebsite'][_0xbb10('0x4e')]({'where':{'id':_0x36c964[_0xbb10('0x4a')]['id']},'include':[{'model':db['Interval'],'as':_0xbb10('0x106'),'include':[{'model':db[_0xbb10('0x106')],'as':'Intervals','attributes':['id',_0xbb10('0xff')],'raw':!![]}]}]})[_0xbb10('0x13')](handleEntityNotFound(_0x344015,null))[_0xbb10('0x13')](function(_0x516742){if(_0x516742){_0x168634=_0x516742;return _0x516742[_0xbb10('0x107')]({'raw':!![]});}})[_0xbb10('0x13')](function(_0xabbd6e){if(_0x168634){if(_0xabbd6e){_0x3e7421=_0xabbd6e;}}return require(_0xbb10('0x70'))['getLicense']();})[_0xbb10('0x13')](function(_0x2f1649){if(_0x2f1649){_0x2656c3=_0x2f1649[_0xbb10('0x108')];_0x33ea36=_0x2f1649['custom'];}})[_0xbb10('0x13')](function(){return db[_0xbb10('0xb0')][_0xbb10('0x24')]({'where':{'closed':![]}});})['then'](function(_0x15747b){_0x322f28=_0x15747b;if(_0x2656c3&&_0x15747b>_0x2656c3){return db['License'][_0xbb10('0x5c')]({'where':{'id':0x1}})[_0xbb10('0x13')](function(_0x1d38f9){if(_0x1d38f9){_0x1d38f9[_0xbb10('0x109')](_0xbb10('0x10a'));}});}})['then'](function(){if(_0x168634[_0xbb10('0x106')]&&_0x168634[_0xbb10('0x106')]['Intervals']){var _0x5f34e9=[];for(var _0x46dfff=0x0;_0x46dfff<_0x168634[_0xbb10('0x106')][_0xbb10('0x10b')][_0xbb10('0x4c')];_0x46dfff++){var _0x5c5fe9=_0x168634['Interval']['Intervals'][_0x46dfff]['get']({'plain':!![]});_0x5f34e9[_0xbb10('0xb7')](iftimePromise(_0x5c5fe9,_0x168634));}return BPromise['all'](_0x5f34e9)[_0xbb10('0x13')](function(_0x585e30){return _[_0xbb10('0x10c')](_0x585e30);});}else{return!![];}})[_0xbb10('0x13')](function(_0x544c2b){var _0x34f1ea=fs[_0xbb10('0xcd')](path[_0xbb10('0x6d')](config[_0xbb10('0x6e')],_0xbb10('0x10d')),_0xbb10('0xcf'));var _0x2f1435=new url[(_0xbb10('0x10e'))](_0x168634[_0xbb10('0x10f')])[_0xbb10('0x110')];var _0x5e0d44=_0xbb10('0x111');var _0x1a5137=![];var _0x3d29aa={'chatVersion':_0x5e0d44,'chatWebsiteAddressOrigin':_0x2f1435,'remote':_0x168634[_0xbb10('0x112')],'query':querystring['stringify'](_[_0xbb10('0x44')](_0x168634['get']({'plain':!![]}),{'customerIp':_0x36c964[_0xbb10('0x9f')][_0xbb10('0xa2')]||_0x36c964[_0xbb10('0x9f')][_0xbb10('0x113')]||_0x36c964[_0xbb10('0x114')]['remoteAddress']||_0x36c964['ip'],'referer':_0x36c964[_0xbb10('0x9f')]['referer'],'openedInteractions':_0x322f28,'maxInteractions':_0x2656c3,'virtual':_0x33ea36[_0xbb10('0x108')],'online':_0x544c2b,'custom':_0x33ea36}))[_0xbb10('0x115')](/'/g,'\x5c\x27')};_0x344015['send'](ejs[_0xbb10('0xd0')](Mustache['render'](_0x34f1ea,_0x3d29aa),{'proactiveActions':_0x3e7421,'alignment':_0x168634[_0xbb10('0x116')],'verticalAlignment':_0x168634[_0xbb10('0x117')],'div_color':_0x168634[_0xbb10('0xf7')],'labelText':_0x168634[_0xbb10('0x118')],'text_color':_0x168634[_0xbb10('0x119')],'text_button_color':_0x168634['textButtonColor'],'button_color':_0x168634['color_button'],'background_color':_0x168634[_0xbb10('0x11a')],'hideWhenOffline':_0x168634[_0xbb10('0x11b')],'intervalId':_0x168634[_0xbb10('0x11c')],'isDevelopment':_0x1a5137,'chatVersion':_0x5e0d44}));})[_0xbb10('0x48')](handleError(_0x344015,null));};exports[_0xbb10('0x11d')]=function(_0x3e31cb,_0x5ac15f){var _0x332e96=_0x3e31cb[_0xbb10('0x4a')]['id'];var _0x16746b=_0x3e31cb[_0xbb10('0x50')];var _0x410d4c=0xc8;var _0x213f83=null;return db[_0xbb10('0xd6')][_0xbb10('0xd7')]({'isolationLevel':db[_0xbb10('0xd6')][_0xbb10('0x11e')][_0xbb10('0x11f')][_0xbb10('0x120')]},function(_0x2ff2a6){return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x332e96},'transaction':_0x2ff2a6})[_0xbb10('0x13')](function(_0x360280){if(_0x360280){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x332e96},'transaction':_0x2ff2a6})[_0xbb10('0x13')](function(){var _0xbff1a9=_[_0xbb10('0x30')](_0x16746b,function(_0x4c53b1){_0x4c53b1['ChatWebsiteId']=_0x332e96;return _0x4c53b1;});return db[_0xbb10('0x94')][_0xbb10('0xd9')](_0xbff1a9,{'transaction':_0x2ff2a6});});}else{_0x410d4c=0x194;_0x213f83=[];}});})['then'](function(){if(_0x410d4c!==0x194){return db[_0xbb10('0x94')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x332e96},'order':'priority'})['then'](function(_0x24cd0d){_0x213f83=_0x24cd0d;});}})[_0xbb10('0x48')](function(_0x33ea9b){_0x410d4c=0x1f4;logger[_0xbb10('0x1a')](_0x33ea9b['stack']);if(_0x33ea9b[_0xbb10('0x2d')]){delete _0x33ea9b['name'];}_0x213f83=_0x33ea9b;})[_0xbb10('0x121')](function(){if(_0x213f83===null){_0x5ac15f[_0xbb10('0x2b')](_0x410d4c);}else{if(_0x410d4c===0x1f4){_0x5ac15f[_0xbb10('0x1e')](_0x410d4c)[_0xbb10('0xc6')](_0x213f83);}else{_0x5ac15f['status'](_0x410d4c)[_0xbb10('0x20')](_0x213f83);}}});};exports[_0xbb10('0x122')]=function(_0x3eada4,_0x429763){var _0x5f07fb={};var _0x42a51b={};var _0x3f5e5a;var _0x4747b4;return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x3eada4[_0xbb10('0x4a')]['id']}})['then'](handleEntityNotFound(_0x429763,null))[_0xbb10('0x13')](function(_0x2a4f97){if(_0x2a4f97){_0x3f5e5a=_0x2a4f97;_0x42a51b[_0xbb10('0x36')]=_[_0xbb10('0x37')](db['ChatApplication'][_0xbb10('0x32')]);_0x42a51b['query']=_[_0xbb10('0x37')](_0x3eada4[_0xbb10('0x38')]);_0x42a51b[_0xbb10('0x42')]=_[_0xbb10('0x39')](_0x42a51b[_0xbb10('0x36')],_0x42a51b[_0xbb10('0x38')]);_0x5f07fb[_0xbb10('0x3b')]=_[_0xbb10('0x39')](_0x42a51b[_0xbb10('0x36')],qs[_0xbb10('0x3a')](_0x3eada4[_0xbb10('0x38')][_0xbb10('0x3a')]));_0x5f07fb[_0xbb10('0x3b')]=_0x5f07fb[_0xbb10('0x3b')][_0xbb10('0x4c')]?_0x5f07fb[_0xbb10('0x3b')]:_0x42a51b[_0xbb10('0x36')];_0x5f07fb['order']=qs[_0xbb10('0x3f')](_0x3eada4['query']['sort']);_0x5f07fb[_0xbb10('0x40')]=qs['filters'](_[_0xbb10('0x41')](_0x3eada4[_0xbb10('0x38')],_0x42a51b[_0xbb10('0x42')]));if(_0x3eada4['query']['filter']){_0x5f07fb[_0xbb10('0x40')]=_[_0xbb10('0x44')](_0x5f07fb[_0xbb10('0x40')],{'$or':_['map'](_0x5f07fb[_0xbb10('0x3b')],function(_0x2ba26c){var _0xc1ff67={};_0xc1ff67[_0x2ba26c]={'$like':'%'+_0x3eada4[_0xbb10('0x38')][_0xbb10('0x43')]+'%'};return _0xc1ff67;})});}_0x5f07fb=_['merge']({},_0x5f07fb,_0x3eada4[_0xbb10('0x46')]);return _0x3f5e5a[_0xbb10('0x122')](_0x5f07fb);}})[_0xbb10('0x13')](function(_0x2d0f27){if(_0x2d0f27){_0x4747b4=_0x2d0f27[_0xbb10('0x4c')];if(!_0x3eada4[_0xbb10('0x38')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x5f07fb[_0xbb10('0x21')]=qs[_0xbb10('0x21')](_0x3eada4['query'][_0xbb10('0x21')]);_0x5f07fb['offset']=qs[_0xbb10('0x23')](_0x3eada4['query'][_0xbb10('0x23')]);}return _0x3f5e5a[_0xbb10('0x122')](_0x5f07fb);}})['then'](function(_0x25a091){if(_0x25a091){return _0x25a091?{'count':_0x4747b4,'rows':_0x25a091}:null;}})['then'](respondWithResult(_0x429763,null))[_0xbb10('0x48')](handleError(_0x429763,null));};exports[_0xbb10('0x123')]=function(_0xd0e41f,_0x4a043e){return db[_0xbb10('0x124')][_0xbb10('0x4e')]({'where':{'id':_0xd0e41f[_0xbb10('0x4a')]['id']}})[_0xbb10('0x13')](handleEntityNotFound(_0x4a043e,null))[_0xbb10('0x13')](function(_0x3bc103){if(_0x3bc103){return _0x3bc103['addProactiveActions'](_0xd0e41f[_0xbb10('0x50')][_0xbb10('0xf0')],_['omit'](_0xd0e41f[_0xbb10('0x50')],[_0xbb10('0xf0'),'id'])||{});}})[_0xbb10('0x13')](respondWithResult(_0x4a043e,null))[_0xbb10('0x48')](handleError(_0x4a043e,null));};exports[_0xbb10('0x107')]=function(_0x560362,_0x16c1e6){var _0x1dd4bb={};var _0x4d9123={};var _0x5a996b;var _0x3f7a8a;return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x560362[_0xbb10('0x4a')]['id']}})[_0xbb10('0x13')](handleEntityNotFound(_0x16c1e6,null))['then'](function(_0x5dfd5a){if(_0x5dfd5a){_0x5a996b=_0x5dfd5a;_0x4d9123[_0xbb10('0x36')]=_[_0xbb10('0x37')](db[_0xbb10('0x125')][_0xbb10('0x32')]);_0x4d9123[_0xbb10('0x38')]=_['keys'](_0x560362[_0xbb10('0x38')]);_0x4d9123[_0xbb10('0x42')]=_[_0xbb10('0x39')](_0x4d9123['model'],_0x4d9123[_0xbb10('0x38')]);_0x1dd4bb[_0xbb10('0x3b')]=_['intersection'](_0x4d9123[_0xbb10('0x36')],qs[_0xbb10('0x3a')](_0x560362[_0xbb10('0x38')]['fields']));_0x1dd4bb[_0xbb10('0x3b')]=_0x1dd4bb[_0xbb10('0x3b')]['length']?_0x1dd4bb[_0xbb10('0x3b')]:_0x4d9123[_0xbb10('0x36')];_0x1dd4bb[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x560362[_0xbb10('0x38')]['sort']);_0x1dd4bb['where']=qs[_0xbb10('0x42')](_['pick'](_0x560362[_0xbb10('0x38')],_0x4d9123['filters']));if(_0x560362['query'][_0xbb10('0x43')]){_0x1dd4bb[_0xbb10('0x40')]=_[_0xbb10('0x44')](_0x1dd4bb[_0xbb10('0x40')],{'$or':_['map'](_0x1dd4bb[_0xbb10('0x3b')],function(_0x1e708e){var _0x28bd81={};_0x28bd81[_0x1e708e]={'$like':'%'+_0x560362[_0xbb10('0x38')]['filter']+'%'};return _0x28bd81;})});}_0x1dd4bb=_[_0xbb10('0x44')]({},_0x1dd4bb,_0x560362[_0xbb10('0x46')]);return _0x5a996b[_0xbb10('0x107')](_0x1dd4bb);}})[_0xbb10('0x13')](function(_0x27ee46){if(_0x27ee46){_0x3f7a8a=_0x27ee46[_0xbb10('0x4c')];if(!_0x560362[_0xbb10('0x38')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x1dd4bb[_0xbb10('0x21')]=qs[_0xbb10('0x21')](_0x560362[_0xbb10('0x38')][_0xbb10('0x21')]);_0x1dd4bb[_0xbb10('0x23')]=qs['offset'](_0x560362[_0xbb10('0x38')]['offset']);}return _0x5a996b[_0xbb10('0x107')](_0x1dd4bb);}})[_0xbb10('0x13')](function(_0x4e1d66){if(_0x4e1d66){return _0x4e1d66?{'count':_0x3f7a8a,'rows':_0x4e1d66}:null;}})[_0xbb10('0x13')](respondWithResult(_0x16c1e6,null))[_0xbb10('0x48')](handleError(_0x16c1e6,null));};exports[_0xbb10('0x126')]=function(_0x5815ad,_0x3fbce1){var _0x156ff5=_0x5815ad[_0xbb10('0x38')][_0xbb10('0x127')]===_0xbb10('0x128')?_0xbb10('0x129'):_0xbb10('0x12a');return db[_0xbb10('0x31')][_0xbb10('0x4e')]({'attributes':['id',_0x156ff5],'where':{'id':_0x5815ad[_0xbb10('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3fbce1,null))[_0xbb10('0x13')](function(_0x49aa2a){if(_0x49aa2a){var _0x410b05=_0x49aa2a[_0x156ff5];var _0x2f3dcd=_0x410b05&&_0x410b05[_0xbb10('0x12b')]?_0x410b05['items']:[];_0x3fbce1[_0xbb10('0xc6')]({'fromKey':_[_0xbb10('0x73')](_0x410b05[_0xbb10('0x12c')])?undefined:_0x410b05[_0xbb10('0x12c')],'count':_0x2f3dcd['length'],'rows':_0x2f3dcd});}})['catch'](handleError(_0x3fbce1,null));};exports['getOfflineMessages']=function(_0x18cb11,_0x2c7daa){var _0x576dbd={'raw':![],'where':{}};var _0x386586={};var _0x26fd90={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x18cb11[_0xbb10('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2c7daa,null))[_0xbb10('0x13')](function(_0x550d95){if(_0x550d95){_0x386586[_0xbb10('0x36')]=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x386586['query']=_['keys'](_0x18cb11[_0xbb10('0x38')]);_0x386586[_0xbb10('0x42')]=_[_0xbb10('0x39')](_0x386586[_0xbb10('0x36')],_0x386586[_0xbb10('0x38')]);_0x576dbd[_0xbb10('0x3b')]=_[_0xbb10('0x39')](_0x386586[_0xbb10('0x36')],qs[_0xbb10('0x3a')](_0x18cb11[_0xbb10('0x38')][_0xbb10('0x3a')]));_0x576dbd[_0xbb10('0x3b')]=_0x576dbd[_0xbb10('0x3b')][_0xbb10('0x4c')]?_0x576dbd[_0xbb10('0x3b')]:_0x386586[_0xbb10('0x36')];if(!_0x18cb11[_0xbb10('0x38')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x576dbd[_0xbb10('0x21')]=qs[_0xbb10('0x21')](_0x18cb11[_0xbb10('0x38')][_0xbb10('0x21')]);_0x576dbd[_0xbb10('0x23')]=qs[_0xbb10('0x23')](_0x18cb11['query'][_0xbb10('0x23')]);}_0x576dbd[_0xbb10('0x3e')]=qs['sort'](_0x18cb11[_0xbb10('0x38')][_0xbb10('0x3f')]);_0x576dbd['where']=qs[_0xbb10('0x42')](_[_0xbb10('0x41')](_0x18cb11[_0xbb10('0x38')],_0x386586[_0xbb10('0x42')]));_0x576dbd[_0xbb10('0x40')][_0xbb10('0x5a')]=_0x550d95['id'];if(_0x18cb11['query'][_0xbb10('0x43')]){_0x576dbd[_0xbb10('0x40')]=_['merge'](_0x576dbd[_0xbb10('0x40')],{'$or':_[_0xbb10('0x30')](_0x576dbd['attributes'],function(_0x232c5b){var _0x3a80d6={};_0x3a80d6[_0x232c5b]={'$like':'%'+_0x18cb11[_0xbb10('0x38')][_0xbb10('0x43')]+'%'};return _0x3a80d6;})});}_0x576dbd=_[_0xbb10('0x44')]({},_0x576dbd,_0x18cb11[_0xbb10('0x46')]);return db['ChatOfflineMessage'][_0xbb10('0x24')]({'where':_0x576dbd[_0xbb10('0x40')]})['then'](function(_0x5d1f9b){_0x26fd90[_0xbb10('0x24')]=_0x5d1f9b;if(_0x18cb11[_0xbb10('0x38')][_0xbb10('0x47')]){_0x576dbd[_0xbb10('0x4d')]=[{'all':!![]}];}else{_0x576dbd[_0xbb10('0x4d')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xbb10('0xd8')],'as':'Attachments','required':![]}];}return db[_0xbb10('0x12d')][_0xbb10('0x62')](_0x576dbd);})[_0xbb10('0x13')](function(_0x5cee7a){_0x26fd90['rows']=_0x5cee7a;return _0x26fd90;});}})[_0xbb10('0x13')](respondWithFilteredResult(_0x2c7daa,_0x576dbd))['catch'](handleError(_0x2c7daa,null));};exports['addAgents']=function(_0x506a01,_0x2f5be0){return db['ChatWebsite'][_0xbb10('0x4e')]({'where':{'id':_0x506a01['params']['id']}})['then'](handleEntityNotFound(_0x2f5be0,null))[_0xbb10('0x13')](function(_0x5a47de){if(_0x5a47de){return _0x5a47de[_0xbb10('0x12e')](_0x506a01[_0xbb10('0x50')][_0xbb10('0xf0')],_[_0xbb10('0x12f')](_0x506a01[_0xbb10('0x50')],[_0xbb10('0xf0'),'id'])||{})['spread'](function(_0x1bb951){for(var _0x139092=0x0;_0x139092<_0x506a01[_0xbb10('0x50')][_0xbb10('0xf0')]['length'];_0x139092+=0x1){socket[_0xbb10('0x130')](_0xbb10('0x131'),{'UserId':Number(_0x506a01[_0xbb10('0x50')]['ids'][_0x139092]),'ChatWebsiteId':Number(_0x506a01[_0xbb10('0x4a')]['id'])});}return _0x1bb951;});}})['then'](respondWithResult(_0x2f5be0,null))[_0xbb10('0x48')](handleError(_0x2f5be0,null));};exports['removeAgents']=function(_0x17d7ab,_0x21f522){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x17d7ab[_0xbb10('0x4a')]['id']}})['then'](handleEntityNotFound(_0x21f522,null))['then'](function(_0x49e8e8){if(_0x49e8e8){return _0x49e8e8[_0xbb10('0x132')](_0x17d7ab['query'][_0xbb10('0xf0')])[_0xbb10('0x13')](function(){if(_['isArray'](_0x17d7ab[_0xbb10('0x38')][_0xbb10('0xf0')])){for(var _0x4b5bbb=0x0;_0x4b5bbb<_0x17d7ab[_0xbb10('0x38')]['ids'][_0xbb10('0x4c')];_0x4b5bbb+=0x1){socket[_0xbb10('0x130')](_0xbb10('0x133'),{'UserId':Number(_0x17d7ab[_0xbb10('0x38')][_0xbb10('0xf0')][_0x4b5bbb]),'ChatWebsiteId':Number(_0x17d7ab[_0xbb10('0x4a')]['id'])});}}else{socket[_0xbb10('0x130')](_0xbb10('0x133'),{'UserId':Number(_0x17d7ab[_0xbb10('0x38')][_0xbb10('0xf0')]),'ChatWebsiteId':Number(_0x17d7ab[_0xbb10('0x4a')]['id'])});}});}})[_0xbb10('0x13')](respondWithStatusCode(_0x21f522,null))['catch'](handleError(_0x21f522,null));};exports[_0xbb10('0x134')]=function(_0x3c0f20,_0x293de8){var _0x4b3380={};var _0x5b55a9={};var _0x13c015;var _0x18b961;return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x3c0f20[_0xbb10('0x4a')]['id']}})[_0xbb10('0x13')](handleEntityNotFound(_0x293de8,null))['then'](function(_0x344f24){if(_0x344f24){_0x13c015=_0x344f24;_0x5b55a9[_0xbb10('0x36')]=_[_0xbb10('0x37')](db[_0xbb10('0xbc')][_0xbb10('0x32')]);_0x5b55a9[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x3c0f20[_0xbb10('0x38')]);_0x5b55a9[_0xbb10('0x42')]=_[_0xbb10('0x39')](_0x5b55a9['model'],_0x5b55a9[_0xbb10('0x38')]);_0x4b3380[_0xbb10('0x3b')]=_[_0xbb10('0x39')](_0x5b55a9[_0xbb10('0x36')],qs['fields'](_0x3c0f20['query'][_0xbb10('0x3a')]));_0x4b3380[_0xbb10('0x3b')]=_0x4b3380['attributes'][_0xbb10('0x4c')]?_0x4b3380[_0xbb10('0x3b')]:_0x5b55a9[_0xbb10('0x36')];_0x4b3380[_0xbb10('0x3e')]=qs['sort'](_0x3c0f20['query']['sort']);_0x4b3380['where']=qs['filters'](_[_0xbb10('0x41')](_0x3c0f20[_0xbb10('0x38')],_0x5b55a9[_0xbb10('0x42')]));if(_0x3c0f20[_0xbb10('0x38')][_0xbb10('0x43')]){_0x4b3380['where']=_[_0xbb10('0x44')](_0x4b3380['where'],{'$or':_[_0xbb10('0x30')](_0x4b3380[_0xbb10('0x3b')],function(_0x9f9c55){var _0x28020b={};_0x28020b[_0x9f9c55]={'$like':'%'+_0x3c0f20['query'][_0xbb10('0x43')]+'%'};return _0x28020b;})});}_0x4b3380=_[_0xbb10('0x44')]({},_0x4b3380,_0x3c0f20[_0xbb10('0x46')]);return _0x13c015['getAgents'](_0x4b3380);}})[_0xbb10('0x13')](function(_0x3afc72){if(_0x3afc72){_0x18b961=_0x3afc72[_0xbb10('0x4c')];if(!_0x3c0f20['query'][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x4b3380[_0xbb10('0x21')]=qs[_0xbb10('0x21')](_0x3c0f20[_0xbb10('0x38')]['limit']);_0x4b3380[_0xbb10('0x23')]=qs['offset'](_0x3c0f20[_0xbb10('0x38')][_0xbb10('0x23')]);}return _0x13c015['getAgents'](_0x4b3380);}})[_0xbb10('0x13')](function(_0x30db4a){if(_0x30db4a){return _0x30db4a?{'count':_0x18b961,'rows':_0x30db4a}:null;}})[_0xbb10('0x13')](respondWithResult(_0x293de8,null))['catch'](handleError(_0x293de8,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 0f30b37..03ec793 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 _0xdefc=['exports','events','../../mysqldb','ChatWebsite','update','emit','hasOwnProperty'];(function(_0x28b440,_0x1b2b23){var _0x271fdd=function(_0x1cdbaf){while(--_0x1cdbaf){_0x28b440['push'](_0x28b440['shift']());}};_0x271fdd(++_0x1b2b23);}(_0xdefc,0x1b3));var _0xcdef=function(_0x2b3a98,_0x3796c6){_0x2b3a98=_0x2b3a98-0x0;var _0xdf53c0=_0xdefc[_0x2b3a98];return _0xdf53c0;};'use strict';var EventEmitter=require(_0xcdef('0x0'));var ChatWebsite=require(_0xcdef('0x1'))['db'][_0xcdef('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xcdef('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3b18d6){return function(_0x2418f0,_0xfc14aa,_0x4602bf){ChatWebsiteEvents[_0xcdef('0x4')](_0x3b18d6+':'+_0x2418f0['id'],_0x2418f0);ChatWebsiteEvents[_0xcdef('0x4')](_0x3b18d6,_0x2418f0);_0x4602bf(null);};}for(var e in events){if(events[_0xcdef('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xcdef('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xcf1c=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x2cd288,_0x239ae4){var _0x3434dc=function(_0xfdec59){while(--_0xfdec59){_0x2cd288['push'](_0x2cd288['shift']());}};_0x3434dc(++_0x239ae4);}(_0xcf1c,0x18d));var _0xccf1=function(_0x1c2051,_0x4cb6b9){_0x1c2051=_0x1c2051-0x0;var _0x2b58a0=_0xcf1c[_0x1c2051];return _0x2b58a0;};'use strict';var EventEmitter=require(_0xccf1('0x0'));var ChatWebsite=require(_0xccf1('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xccf1('0x2')](0x0);var events={'afterCreate':_0xccf1('0x3'),'afterUpdate':_0xccf1('0x4'),'afterDestroy':_0xccf1('0x5')};function emitEvent(_0x5670d0){return function(_0x5d3e85,_0x509c8d,_0x301b38){ChatWebsiteEvents['emit'](_0x5670d0+':'+_0x5d3e85['id'],_0x5d3e85);ChatWebsiteEvents[_0xccf1('0x6')](_0x5670d0,_0x5d3e85);_0x301b38(null);};}for(var e in events){if(events[_0xccf1('0x7')](e)){var event=events[e];ChatWebsite[_0xccf1('0x8')](e,emitEvent(event));}}module[_0xccf1('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 252a519..3c6d709 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 _0x6fac=['./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4009ae,_0x24e376){var _0x31275a=function(_0x59baf7){while(--_0x59baf7){_0x4009ae['push'](_0x4009ae['shift']());}};_0x31275a(++_0x24e376);}(_0x6fac,0x70));var _0xc6fa=function(_0x5eac86,_0x4562db){_0x5eac86=_0x5eac86-0x0;var _0x3430e4=_0x6fac[_0x5eac86];return _0x3430e4;};'use strict';var _=require(_0xc6fa('0x0'));var util=require(_0xc6fa('0x1'));var logger=require('../../config/logger')(_0xc6fa('0x2'));var moment=require(_0xc6fa('0x3'));var BPromise=require(_0xc6fa('0x4'));var rp=require(_0xc6fa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc6fa('0x6'));var config=require(_0xc6fa('0x7'));var attributes=require(_0xc6fa('0x8'));module['exports']=function(_0x2f73b8,_0x40b0f8){return _0x2f73b8[_0xc6fa('0x9')](_0xc6fa('0xa'),attributes,{'tableName':_0xc6fa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf68a=['rimraf','../../config/environment','exports','ChatWebsite','chat_websites','lodash','util','bluebird','request-promise','path'];(function(_0x4d830b,_0x27f78d){var _0x238c89=function(_0x3eead9){while(--_0x3eead9){_0x4d830b['push'](_0x4d830b['shift']());}};_0x238c89(++_0x27f78d);}(_0xf68a,0xeb));var _0xaf68=function(_0x582a09,_0x2d751d){_0x582a09=_0x582a09-0x0;var _0x54b6da=_0xf68a[_0x582a09];return _0x54b6da;};'use strict';var _=require(_0xaf68('0x0'));var util=require(_0xaf68('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xaf68('0x2'));var rp=require(_0xaf68('0x3'));var fs=require('fs');var path=require(_0xaf68('0x4'));var rimraf=require(_0xaf68('0x5'));var config=require(_0xaf68('0x6'));var attributes=require('./chatWebsite.attributes');module[_0xaf68('0x7')]=function(_0x449506,_0x2c20b3){return _0x449506['define'](_0xaf68('0x8'),attributes,{'tableName':_0xaf68('0x9'),'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 b252fe4..229a71c 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 _0x5d5f=['debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','catch','lodash','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','./chatWebsite.socket','request','then','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5d5f,0x1a6));var _0xf5d5=function(_0x4a4ba7,_0x1d2a01){_0x4a4ba7=_0x4a4ba7-0x0;var _0x113936=_0x5d5f[_0x4a4ba7];return _0x113936;};'use strict';var _=require(_0xf5d5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf5d5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf5d5('0x2'));var logger=require(_0xf5d5('0x3'))(_0xf5d5('0x4'));var config=require(_0xf5d5('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf5d5('0x6')][_0xf5d5('0x7')]({'port':0x232a});config['redis']=_[_0xf5d5('0x8')](config[_0xf5d5('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xf5d5('0xa'))(new Redis(config['redis']));require(_0xf5d5('0xb'))['register'](socket);function respondWithRpcPromise(_0x6fc091,_0x1011e1,_0xc5c3e9){return new BPromise(function(_0x359465,_0x235f4b){return client[_0xf5d5('0xc')](_0x6fc091,_0xc5c3e9)[_0xf5d5('0xd')](function(_0x5ef771){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1011e1,_0xf5d5('0xe'));logger[_0xf5d5('0xf')](_0xf5d5('0x10'),_0x1011e1,_0xf5d5('0xe'),JSON[_0xf5d5('0x11')](_0x5ef771));if(_0x5ef771[_0xf5d5('0x12')]){if(_0x5ef771[_0xf5d5('0x12')][_0xf5d5('0x13')]===0x1f4){logger[_0xf5d5('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x1011e1,_0x5ef771[_0xf5d5('0x12')][_0xf5d5('0x14')]);return _0x235f4b(_0x5ef771[_0xf5d5('0x12')][_0xf5d5('0x14')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1011e1,_0x5ef771[_0xf5d5('0x12')][_0xf5d5('0x14')]);return _0x359465(_0x5ef771[_0xf5d5('0x12')][_0xf5d5('0x14')]);}else{logger['info'](_0xf5d5('0x15'),_0x1011e1,_0xf5d5('0xe'));_0x359465(_0x5ef771['result'][_0xf5d5('0x14')]);}})[_0xf5d5('0x16')](function(_0x5d9868){logger[_0xf5d5('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x1011e1,_0x5d9868);_0x235f4b(_0x5d9868);});});}
\ No newline at end of file
+var _0x794a=['debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatWebsite.socket','register','request','ChatWebsite,\x20%s,\x20%s','request\x20sent'];(function(_0x15a634,_0x4feb86){var _0xf4f7a0=function(_0x31d9fe){while(--_0x31d9fe){_0x15a634['push'](_0x15a634['shift']());}};_0xf4f7a0(++_0x4feb86);}(_0x794a,0x13d));var _0xa794=function(_0x56d257,_0x36750a){_0x56d257=_0x56d257-0x0;var _0x27d1f8=_0x794a[_0x56d257];return _0x27d1f8;};'use strict';var _=require(_0xa794('0x0'));var util=require(_0xa794('0x1'));var moment=require(_0xa794('0x2'));var BPromise=require(_0xa794('0x3'));var rs=require(_0xa794('0x4'));var fs=require('fs');var Redis=require(_0xa794('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa794('0x6'));var logger=require(_0xa794('0x7'))('rpc');var config=require(_0xa794('0x8'));var jayson=require(_0xa794('0x9'));var client=jayson[_0xa794('0xa')][_0xa794('0xb')]({'port':0x232a});config[_0xa794('0xc')]=_['defaults'](config[_0xa794('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa794('0xd'))(new Redis(config[_0xa794('0xc')]));require(_0xa794('0xe'))[_0xa794('0xf')](socket);function respondWithRpcPromise(_0x2ef293,_0x282874,_0x52a3fd){return new BPromise(function(_0x5d5529,_0x2e4aa0){return client[_0xa794('0x10')](_0x2ef293,_0x52a3fd)['then'](function(_0xa93d98){logger['info'](_0xa794('0x11'),_0x282874,_0xa794('0x12'));logger[_0xa794('0x13')](_0xa794('0x14'),_0x282874,_0xa794('0x12'),JSON[_0xa794('0x15')](_0xa93d98));if(_0xa93d98[_0xa794('0x16')]){if(_0xa93d98[_0xa794('0x16')][_0xa794('0x17')]===0x1f4){logger[_0xa794('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x282874,_0xa93d98[_0xa794('0x16')][_0xa794('0x18')]);return _0x2e4aa0(_0xa93d98[_0xa794('0x16')][_0xa794('0x18')]);}logger[_0xa794('0x16')](_0xa794('0x11'),_0x282874,_0xa93d98[_0xa794('0x16')][_0xa794('0x18')]);return _0x5d5529(_0xa93d98[_0xa794('0x16')][_0xa794('0x18')]);}else{logger[_0xa794('0x19')](_0xa794('0x11'),_0x282874,_0xa794('0x12'));_0x5d5529(_0xa93d98[_0xa794('0x1a')][_0xa794('0x18')]);}})[_0xa794('0x1b')](function(_0x583cc0){logger[_0xa794('0x16')](_0xa794('0x11'),_0x282874,_0x583cc0);_0x2e4aa0(_0x583cc0);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index d0c7dd6..9593745 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 _0xea74=['chatWebsite:','emit','removeListener','length'];(function(_0x21c89c,_0x4e0713){var _0x19202a=function(_0x17aeb0){while(--_0x17aeb0){_0x21c89c['push'](_0x21c89c['shift']());}};_0x19202a(++_0x4e0713);}(_0xea74,0xb1));var _0x4ea7=function(_0x1b232b,_0xe42cc1){_0x1b232b=_0x1b232b-0x0;var _0x4ca805=_0xea74[_0x1b232b];return _0x4ca805;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save','remove','update'];function createListener(_0x1b6b7d,_0x39ad42){return function(_0x1ad6eb){_0x39ad42[_0x4ea7('0x0')](_0x1b6b7d,_0x1ad6eb);};}function removeListener(_0x54cd1e,_0x303fad){return function(){ChatWebsiteEvents[_0x4ea7('0x1')](_0x54cd1e,_0x303fad);};}exports['register']=function(_0x449eec){for(var _0x1c7df9=0x0,_0x8a3e09=events[_0x4ea7('0x2')];_0x1c7df9<_0x8a3e09;_0x1c7df9++){var _0x214560=events[_0x1c7df9];var _0x218a5d=createListener(_0x4ea7('0x3')+_0x214560,_0x449eec);ChatWebsiteEvents['on'](_0x214560,_0x218a5d);}};
\ No newline at end of file
+var _0xdd28=['register','./chatWebsite.events','remove','emit','removeListener'];(function(_0x46f4f5,_0x10b90a){var _0x340d66=function(_0xb21ccc){while(--_0xb21ccc){_0x46f4f5['push'](_0x46f4f5['shift']());}};_0x340d66(++_0x10b90a);}(_0xdd28,0x155));var _0x8dd2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd28[_0x3dd15e];return _0x231fd0;};'use strict';var ChatWebsiteEvents=require(_0x8dd2('0x0'));var events=['save',_0x8dd2('0x1'),'update'];function createListener(_0x19c342,_0xc31560){return function(_0x1bddac){_0xc31560[_0x8dd2('0x2')](_0x19c342,_0x1bddac);};}function removeListener(_0x36abf7,_0x3b7301){return function(){ChatWebsiteEvents[_0x8dd2('0x3')](_0x36abf7,_0x3b7301);};}exports[_0x8dd2('0x4')]=function(_0xdea42e){for(var _0x2d5529=0x0,_0x2e91f6=events['length'];_0x2d5529<_0x2e91f6;_0x2d5529++){var _0x20a1b2=events[_0x2d5529];var _0x179dcf=createListener('chatWebsite:'+_0x20a1b2,_0xdea42e);ChatWebsiteEvents['on'](_0x20a1b2,_0x179dcf);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 8353a6f..74762b7 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 _0x2118=['/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','/:id/fields','getFields','getOfflineMessages','/:id/users','create','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','server/files/images/avatars/','/:id/avatar','file','addAvatar','addCustomerAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/logo','getLogo','getAvatar','/:id/customer_avatar'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x2118,0x14e));var _0x8211=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x2118[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x8211('0x0'));var util=require('util');var path=require(_0x8211('0x1'));var timeout=require(_0x8211('0x2'));var express=require(_0x8211('0x3'));var router=express['Router']();var fs_extra=require(_0x8211('0x4'));var auth=require(_0x8211('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8211('0x6'));var controller=require(_0x8211('0x7'));router[_0x8211('0x8')]('/',auth['isAuthenticated'](),controller[_0x8211('0x9')]);router[_0x8211('0x8')](_0x8211('0xa'),auth[_0x8211('0xb')](),controller[_0x8211('0xc')]);router[_0x8211('0x8')](_0x8211('0xd'),auth['isAuthenticated'](),controller[_0x8211('0xe')]);router[_0x8211('0x8')](_0x8211('0xf'),auth['isAuthenticated'](),controller[_0x8211('0x10')]);router[_0x8211('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x8211('0x8')](_0x8211('0x11'),controller[_0x8211('0x12')]);router[_0x8211('0x8')]('/:id/avatar',controller[_0x8211('0x13')]);router[_0x8211('0x8')](_0x8211('0x14'),controller['getCustomerAvatar']);router[_0x8211('0x8')](_0x8211('0x15'),controller[_0x8211('0x16')]);router[_0x8211('0x8')]('/:id/interactions',auth[_0x8211('0xb')](),controller[_0x8211('0x17')]);router[_0x8211('0x8')](_0x8211('0x18'),controller[_0x8211('0x19')]);router[_0x8211('0x8')](_0x8211('0x1a'),auth['isAuthenticated'](),controller['getApplications']);router[_0x8211('0x8')](_0x8211('0x1b'),auth['isAuthenticated'](),controller['getProactiveActions']);router['get'](_0x8211('0x1c'),controller[_0x8211('0x1d')]);router[_0x8211('0x8')]('/:id/offline_messages',auth[_0x8211('0xb')](),controller[_0x8211('0x1e')]);router[_0x8211('0x8')](_0x8211('0x1f'),auth[_0x8211('0xb')](),controller['getAgents']);router['post']('/',auth[_0x8211('0xb')](),controller[_0x8211('0x20')]);router[_0x8211('0x21')](_0x8211('0xf'),auth[_0x8211('0xb')](),controller[_0x8211('0x22')]);router[_0x8211('0x21')]('/:id/canned_answers',auth[_0x8211('0xb')](),controller[_0x8211('0x23')]);var upload=multer({'storage':multer[_0x8211('0x24')]({'destination':function(_0x400a92,_0x54ad15,_0x3095c6){_0x3095c6(null,path[_0x8211('0x25')](config[_0x8211('0x26')],_0x8211('0x27')));},'filename':function(_0xf18273,_0x135bfe,_0x37f9f0){_0x37f9f0(null,util[_0x8211('0x28')](_0x8211('0x29'),Date[_0x8211('0x2a')](),_0x135bfe[_0x8211('0x2b')]));}})});router[_0x8211('0x21')](_0x8211('0x11'),upload[_0x8211('0x2c')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x8211('0x24')]({'destination':function(_0x4ba7a7,_0x2534ba,_0x4cf0a7){_0x4cf0a7(null,path[_0x8211('0x25')](config[_0x8211('0x26')],_0x8211('0x2d')));},'filename':function(_0x4277d9,_0x10ee2b,_0x4c3a9d){_0x4c3a9d(null,util[_0x8211('0x28')](_0x8211('0x29'),Date[_0x8211('0x2a')](),_0x10ee2b[_0x8211('0x2b')]));}})});router[_0x8211('0x21')](_0x8211('0x2e'),upload['single'](_0x8211('0x2f')),controller[_0x8211('0x30')]);var upload=multer({'storage':multer[_0x8211('0x24')]({'destination':function(_0x86eeca,_0x527948,_0x1077a1){_0x1077a1(null,path[_0x8211('0x25')](config[_0x8211('0x26')],_0x8211('0x2d')));},'filename':function(_0x5927df,_0x4712a7,_0x4814ce){_0x4814ce(null,util['format']('%s-%s',Date[_0x8211('0x2a')](),_0x4712a7[_0x8211('0x2b')]));}})});router[_0x8211('0x21')]('/:id/customer_avatar',upload[_0x8211('0x2c')](_0x8211('0x2f')),controller[_0x8211('0x31')]);var upload=multer({'storage':multer[_0x8211('0x24')]({'destination':function(_0x25355d,_0x77251e,_0x15c784){_0x15c784(null,path['join'](config[_0x8211('0x26')],_0x8211('0x2d')));},'filename':function(_0x1997ec,_0x2d6cef,_0x281111){_0x281111(null,util[_0x8211('0x28')](_0x8211('0x29'),Date[_0x8211('0x2a')](),_0x2d6cef[_0x8211('0x2b')]));}})});router[_0x8211('0x21')]('/:id/system_avatar',upload[_0x8211('0x2c')]('file'),controller['addSystemAvatar']);router['post'](_0x8211('0x32'),controller[_0x8211('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x8211('0x24')]({'destination':function(_0x1a2c77,_0x2e85f9,_0x4c5272){const _0x3d7aae=path[_0x8211('0x25')](config['root'],_0x8211('0x34'),'attachments',_0x8211('0x35'));fs_extra[_0x8211('0x36')](_0x3d7aae,function(){_0x4c5272(null,_0x3d7aae);});},'filename':function(_0x56fa74,_0x501456,_0x274e44){const _0x521597=_0x501456[_0x8211('0x2b')][_0x8211('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x316ae1=path[_0x8211('0x38')](_0x521597);const _0x317400=Date['now']()+'-'+_0x521597[_0x8211('0x37')](_0x316ae1,'')+_0x316ae1;_0x274e44(null,_0x317400);}})});router[_0x8211('0x21')](_0x8211('0x39'),offlineUploadMulter[_0x8211('0x3a')](),controller[_0x8211('0x3b')]);router[_0x8211('0x21')]('/:id/interactions',auth[_0x8211('0xb')](),controller[_0x8211('0x3c')]);router[_0x8211('0x21')](_0x8211('0x1a'),auth['isAuthenticated'](),controller[_0x8211('0x3d')]);router[_0x8211('0x21')](_0x8211('0x1b'),auth[_0x8211('0xb')](),controller[_0x8211('0x3e')]);router[_0x8211('0x21')]('/:id/users',auth[_0x8211('0xb')](),controller[_0x8211('0x3f')]);router[_0x8211('0x40')](_0x8211('0xd'),auth['isAuthenticated'](),controller[_0x8211('0x41')]);router[_0x8211('0x42')](_0x8211('0xd'),auth[_0x8211('0xb')](),controller[_0x8211('0x43')]);router[_0x8211('0x42')](_0x8211('0xf'),auth[_0x8211('0xb')](),controller[_0x8211('0x44')]);router['delete']('/:id/canned_answers',auth[_0x8211('0xb')](),controller[_0x8211('0x45')]);router[_0x8211('0x42')](_0x8211('0x1f'),auth['isAuthenticated'](),controller[_0x8211('0x46')]);module['exports']=router;
\ No newline at end of file
+var _0xec4f=['put','delete','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','util','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','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','create','/:id/dispositions','addDisposition','post','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','addLogo','server/files/images/avatars/','single','file','addAvatar','%s-%s','originalname','addCustomerAvatar','/:id/system_avatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','/:id/offline','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xec4f,0xee));var _0xfec4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec4f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfec4('0x0'));var util=require(_0xfec4('0x1'));var path=require(_0xfec4('0x2'));var timeout=require(_0xfec4('0x3'));var express=require(_0xfec4('0x4'));var router=express[_0xfec4('0x5')]();var fs_extra=require(_0xfec4('0x6'));var auth=require(_0xfec4('0x7'));var interaction=require(_0xfec4('0x8'));var config=require('../../config/environment');var controller=require(_0xfec4('0x9'));router[_0xfec4('0xa')]('/',auth[_0xfec4('0xb')](),controller[_0xfec4('0xc')]);router['get'](_0xfec4('0xd'),auth[_0xfec4('0xb')](),controller[_0xfec4('0xe')]);router[_0xfec4('0xa')](_0xfec4('0xf'),auth[_0xfec4('0xb')](),controller[_0xfec4('0x10')]);router[_0xfec4('0xa')]('/:id/dispositions',auth[_0xfec4('0xb')](),controller[_0xfec4('0x11')]);router[_0xfec4('0xa')](_0xfec4('0x12'),auth[_0xfec4('0xb')](),controller[_0xfec4('0x13')]);router[_0xfec4('0xa')](_0xfec4('0x14'),controller[_0xfec4('0x15')]);router[_0xfec4('0xa')](_0xfec4('0x16'),controller[_0xfec4('0x17')]);router['get'](_0xfec4('0x18'),controller[_0xfec4('0x19')]);router['get']('/:id/system_avatar',controller[_0xfec4('0x1a')]);router[_0xfec4('0xa')]('/:id/interactions',auth[_0xfec4('0xb')](),controller[_0xfec4('0x1b')]);router[_0xfec4('0xa')](_0xfec4('0x1c'),controller['getSnippet']);router[_0xfec4('0xa')](_0xfec4('0x1d'),auth[_0xfec4('0xb')](),controller[_0xfec4('0x1e')]);router[_0xfec4('0xa')](_0xfec4('0x1f'),auth[_0xfec4('0xb')](),controller['getProactiveActions']);router['get'](_0xfec4('0x20'),controller[_0xfec4('0x21')]);router[_0xfec4('0xa')](_0xfec4('0x22'),auth[_0xfec4('0xb')](),controller[_0xfec4('0x23')]);router[_0xfec4('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0xfec4('0x24')]);router['post']('/',auth[_0xfec4('0xb')](),controller[_0xfec4('0x25')]);router['post'](_0xfec4('0x26'),auth[_0xfec4('0xb')](),controller[_0xfec4('0x27')]);router[_0xfec4('0x28')]('/:id/canned_answers',auth[_0xfec4('0xb')](),controller[_0xfec4('0x29')]);var upload=multer({'storage':multer[_0xfec4('0x2a')]({'destination':function(_0x186bdd,_0x4bd3aa,_0x22c799){_0x22c799(null,path[_0xfec4('0x2b')](config[_0xfec4('0x2c')],_0xfec4('0x2d')));},'filename':function(_0x51eb84,_0x2cba3e,_0x3f2a0e){_0x3f2a0e(null,util[_0xfec4('0x2e')]('%s-%s',Date[_0xfec4('0x2f')](),_0x2cba3e['originalname']));}})});router[_0xfec4('0x28')](_0xfec4('0x14'),upload['single']('file'),controller[_0xfec4('0x30')]);var upload=multer({'storage':multer[_0xfec4('0x2a')]({'destination':function(_0x1bf555,_0x4eb51e,_0x50310e){_0x50310e(null,path['join'](config[_0xfec4('0x2c')],_0xfec4('0x31')));},'filename':function(_0x352f7c,_0x93555a,_0xdb64f5){_0xdb64f5(null,util[_0xfec4('0x2e')]('%s-%s',Date[_0xfec4('0x2f')](),_0x93555a['originalname']));}})});router[_0xfec4('0x28')]('/:id/avatar',upload[_0xfec4('0x32')](_0xfec4('0x33')),controller[_0xfec4('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x283ec2,_0x465bcd,_0x3bb357){_0x3bb357(null,path[_0xfec4('0x2b')](config[_0xfec4('0x2c')],_0xfec4('0x31')));},'filename':function(_0x56d448,_0x11d3e3,_0x40bccf){_0x40bccf(null,util[_0xfec4('0x2e')](_0xfec4('0x35'),Date[_0xfec4('0x2f')](),_0x11d3e3[_0xfec4('0x36')]));}})});router[_0xfec4('0x28')](_0xfec4('0x18'),upload[_0xfec4('0x32')](_0xfec4('0x33')),controller[_0xfec4('0x37')]);var upload=multer({'storage':multer[_0xfec4('0x2a')]({'destination':function(_0x3473d0,_0x20fc5a,_0x28f0d8){_0x28f0d8(null,path[_0xfec4('0x2b')](config[_0xfec4('0x2c')],_0xfec4('0x31')));},'filename':function(_0x31d9ee,_0x138389,_0x48e2d1){_0x48e2d1(null,util['format'](_0xfec4('0x35'),Date[_0xfec4('0x2f')](),_0x138389[_0xfec4('0x36')]));}})});router['post'](_0xfec4('0x38'),upload['single'](_0xfec4('0x33')),controller['addSystemAvatar']);router[_0xfec4('0x28')](_0xfec4('0x39'),controller[_0xfec4('0x3a')]);const offlineUploadMulter=multer({'storage':multer[_0xfec4('0x2a')]({'destination':function(_0x25ca9b,_0x3142fa,_0x37e99e){const _0x16acf8=path[_0xfec4('0x2b')](config[_0xfec4('0x2c')],'server/files',_0xfec4('0x3b'),_0xfec4('0x3c'));fs_extra[_0xfec4('0x3d')](_0x16acf8,function(){_0x37e99e(null,_0x16acf8);});},'filename':function(_0x1ef95c,_0x19685f,_0x464119){const _0x3b1309=_0x19685f[_0xfec4('0x36')][_0xfec4('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x227aad=path['extname'](_0x3b1309);const _0x16bfb1=Date[_0xfec4('0x2f')]()+'-'+_0x3b1309[_0xfec4('0x3e')](_0x227aad,'')+_0x227aad;_0x464119(null,_0x16bfb1);}})});router[_0xfec4('0x28')](_0xfec4('0x3f'),offlineUploadMulter['any'](),controller[_0xfec4('0x40')]);router[_0xfec4('0x28')](_0xfec4('0x41'),auth[_0xfec4('0xb')](),controller[_0xfec4('0x42')]);router[_0xfec4('0x28')]('/:id/applications',auth[_0xfec4('0xb')](),controller[_0xfec4('0x43')]);router[_0xfec4('0x28')](_0xfec4('0x1f'),auth['isAuthenticated'](),controller[_0xfec4('0x44')]);router[_0xfec4('0x28')]('/:id/users',auth[_0xfec4('0xb')](),controller[_0xfec4('0x45')]);router[_0xfec4('0x46')](_0xfec4('0xf'),auth[_0xfec4('0xb')](),controller['update']);router[_0xfec4('0x47')]('/:id',auth[_0xfec4('0xb')](),controller['destroy']);router['delete'](_0xfec4('0x26'),auth['isAuthenticated'](),controller[_0xfec4('0x48')]);router['delete'](_0xfec4('0x12'),auth['isAuthenticated'](),controller[_0xfec4('0x49')]);router[_0xfec4('0x47')](_0xfec4('0x4a'),auth[_0xfec4('0xb')](),controller[_0xfec4('0x4b')]);module[_0xfec4('0x4c')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index c621cef..e32c401 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 _0x7443=['get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','beaver-logger/server','Router','env','production'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7443,0xf4));var _0x3744=function(_0x1a8bde,_0x301f95){_0x1a8bde=_0x1a8bde-0x0;var _0x3df6df=_0x7443[_0x1a8bde];return _0x3df6df;};var beaverLogger=require(_0x3744('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x3744('0x1')]();var isProduction=config[_0x3744('0x2')]===_0x3744('0x3')||![];function clientSideLogs(_0x2701e6,_0x48f0e4,_0x4a38a3){var _0x26b92b=_0x2701e6['app'][_0x3744('0x4')](_0x3744('0x5'));if(!_0x26b92b){throw new Error(_0x3744('0x6'));}return beaverLogger[_0x3744('0x7')]({'uri':'/client-logs','logger':_0x26b92b,'enableCors':!isProduction})(_0x2701e6,_0x48f0e4,_0x4a38a3);}router['use'](auth['isAuthenticated'](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x2f41=['expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../config/environment','Router','production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x413aac,_0x5e2430){var _0x569b11=function(_0x52e060){while(--_0x52e060){_0x413aac['push'](_0x413aac['shift']());}};_0x569b11(++_0x5e2430);}(_0x2f41,0x94));var _0x12f4=function(_0x2181fc,_0x7283aa){_0x2181fc=_0x2181fc-0x0;var _0x315da1=_0x2f41[_0x2181fc];return _0x315da1;};var beaverLogger=require(_0x12f4('0x0'));var express=require(_0x12f4('0x1'));var auth=require('../components/auth/service');var config=require(_0x12f4('0x2'));var router=express[_0x12f4('0x3')]();var isProduction=config['env']===_0x12f4('0x4')||![];function clientSideLogs(_0x262aaa,_0x4728ce,_0x44733c){var _0x56a07e=_0x262aaa[_0x12f4('0x5')]['get'](_0x12f4('0x6'));if(!_0x56a07e){throw new Error(_0x12f4('0x7'));}return beaverLogger[_0x12f4('0x8')]({'uri':_0x12f4('0x9'),'logger':_0x56a07e,'enableCors':!isProduction})(_0x262aaa,_0x4728ce,_0x44733c);}router[_0x12f4('0xa')](auth[_0x12f4('0xb')](),clientSideLogs);module[_0x12f4('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 8f59d66..44ffe48 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 _0x5030=['sequelize','ENUM','Google','Outlook365','STRING','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x11f09c,_0x404556){var _0x57e24d=function(_0x358f57){while(--_0x358f57){_0x11f09c['push'](_0x11f09c['shift']());}};_0x57e24d(++_0x404556);}(_0x5030,0x19a));var _0x0503=function(_0x454ad3,_0x3d74d4){_0x454ad3=_0x454ad3-0x0;var _0x38accf=_0x5030[_0x454ad3];return _0x38accf;};'use strict';var Sequelize=require(_0x0503('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0503('0x1')]('AmazonAWS',_0x0503('0x2'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x0503('0x1')](_0x0503('0x3'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x0503('0x4')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x0503('0x4')],'comment':_0x0503('0x5')},'data4':{'type':Sequelize[_0x0503('0x4')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x0503('0x6')],'comment':_0x0503('0x7')},'data6':{'type':Sequelize[_0x0503('0x6')],'comment':_0x0503('0x8')},'data7':{'type':Sequelize['TEXT'],'comment':_0x0503('0x9')}};
\ No newline at end of file
+var _0xe900=['sequelize','exports','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x2eaf3f,_0x3eed77){var _0x1780b6=function(_0x1eaf89){while(--_0x1eaf89){_0x2eaf3f['push'](_0x2eaf3f['shift']());}};_0x1780b6(++_0x3eed77);}(_0xe900,0x159));var _0x0e90=function(_0x3173ab,_0x1edb1c){_0x3173ab=_0x3173ab-0x0;var _0xea1070=_0xe900[_0x3173ab];return _0xea1070;};'use strict';var Sequelize=require(_0x0e90('0x0'));module[_0x0e90('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0e90('0x2')](_0x0e90('0x3'),_0x0e90('0x4'),_0x0e90('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x0e90('0x2')](_0x0e90('0x6'),_0x0e90('0x7'))},'data1':{'type':Sequelize[_0x0e90('0x8')],'comment':_0x0e90('0x9')},'data2':{'type':Sequelize[_0x0e90('0x8')],'comment':_0x0e90('0xa')},'data3':{'type':Sequelize['STRING'],'comment':_0x0e90('0xb')},'data4':{'type':Sequelize[_0x0e90('0x8')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x0e90('0xc')],'comment':_0x0e90('0xd')},'data6':{'type':Sequelize['TEXT'],'comment':_0x0e90('0xe')},'data7':{'type':Sequelize[_0x0e90('0xc')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index a796664..7d5f8bd 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 _0xfc90=['map','CloudProvider','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','rawAttributes','include','find','create','body','Name\x20parameter\x20not\x20specified','service','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/encryptor','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','socket.io-emitter','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','error','stack','name','send','slice','index'];(function(_0x4a9beb,_0x159482){var _0x2d4c58=function(_0x28dabf){while(--_0x28dabf){_0x4a9beb['push'](_0x4a9beb['shift']());}};_0x2d4c58(++_0x159482);}(_0xfc90,0x1d8));var _0x0fc9=function(_0x27b2bb,_0xf59c0d){_0x27b2bb=_0x27b2bb-0x0;var _0x1b2fa9=_0xfc90[_0x27b2bb];return _0x1b2fa9;};'use strict';var _=require(_0x0fc9('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0x0fc9('0x1'));var config=require('../../config/environment');var logger=require(_0x0fc9('0x2'))(_0x0fc9('0x3'));var db=require(_0x0fc9('0x4'))['db'];var oauth=require(_0x0fc9('0x5'));config['redis']=_[_0x0fc9('0x6')](config[_0x0fc9('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fc9('0x8'))(new Redis(config[_0x0fc9('0x7')]));var redis=new Redis(config[_0x0fc9('0x7')]);function respondWithStatusCode(_0x322286,_0x5925b8){_0x5925b8=_0x5925b8||0xcc;return function(_0x49d75a){if(_0x49d75a){return _0x322286[_0x0fc9('0x9')](_0x5925b8);}return _0x322286[_0x0fc9('0xa')](_0x5925b8)[_0x0fc9('0xb')]();};}function respondWithResult(_0x5cf43f,_0x32c2cd){_0x32c2cd=_0x32c2cd||0xc8;return function(_0x112255){if(_0x112255){return _0x5cf43f[_0x0fc9('0xa')](_0x32c2cd)['json'](_0x112255);}};}function respondWithFilteredResult(_0x1d0198,_0x4f2dab){return function(_0x4e8719){if(_0x4e8719){var _0x28d50e=typeof _0x4f2dab[_0x0fc9('0xc')]===_0x0fc9('0xd')&&typeof _0x4f2dab['limit']===_0x0fc9('0xd');var _0x3bb516=_0x4e8719[_0x0fc9('0xe')];var _0x49ee1e=_0x28d50e?0x0:_0x4f2dab['offset'];var _0xcfa7f5=_0x28d50e?_0x4e8719['count']:_0x4f2dab[_0x0fc9('0xc')]+_0x4f2dab[_0x0fc9('0xf')];var _0x577ce6;if(_0xcfa7f5>=_0x3bb516){_0xcfa7f5=_0x3bb516;_0x577ce6=0xc8;}else{_0x577ce6=0xce;}_0x1d0198[_0x0fc9('0xa')](_0x577ce6);return _0x1d0198[_0x0fc9('0x10')](_0x0fc9('0x11'),_0x49ee1e+'-'+_0xcfa7f5+'/'+_0x3bb516)[_0x0fc9('0x12')](_0x4e8719);}return null;};}function saveUpdates(_0x293ebe){return function(_0x479801){if(_0x479801){return _0x479801[_0x0fc9('0x13')](_0x293ebe)[_0x0fc9('0x14')](function(_0x21eebc){return _0x21eebc;});}return null;};}function removeEntity(_0x17e701){return function(_0x608f7){if(_0x608f7){return _0x608f7[_0x0fc9('0x15')]()[_0x0fc9('0x14')](function(){_0x17e701['status'](0xcc)[_0x0fc9('0xb')]();});}};}function handleEntityNotFound(_0x2fce6c){return function(_0x356e86){if(!_0x356e86){_0x2fce6c[_0x0fc9('0x9')](0x194);}return _0x356e86;};}function handleError(_0x3e322d,_0x3128be){_0x3128be=_0x3128be||0x1f4;return function(_0x5d94d7){logger[_0x0fc9('0x16')](_0x5d94d7[_0x0fc9('0x17')]);if(_0x5d94d7[_0x0fc9('0x18')]){delete _0x5d94d7[_0x0fc9('0x18')];}_0x3e322d['status'](_0x3128be)[_0x0fc9('0x19')](_0x5d94d7);};}function maskClientSecret(_0x24181c){return _['padEnd'](_0x24181c[_0x0fc9('0x1a')](0x0,0x3),0x14,'*');}exports[_0x0fc9('0x1b')]=function(_0x194519,_0x4d61bd){var _0x3faee8={},_0x3ff6d9={},_0x3ecc8d={'count':0x0,'rows':[]};var _0x351a9e=_[_0x0fc9('0x1c')](db[_0x0fc9('0x1d')]['rawAttributes'],function(_0x4d565e){return{'name':_0x4d565e[_0x0fc9('0x1e')],'type':_0x4d565e[_0x0fc9('0x1f')][_0x0fc9('0x20')]};});_0x3ff6d9['model']=_[_0x0fc9('0x1c')](_0x351a9e,'name');_0x3ff6d9[_0x0fc9('0x21')]=_[_0x0fc9('0x22')](_0x194519[_0x0fc9('0x21')]);_0x3ff6d9[_0x0fc9('0x23')]=_[_0x0fc9('0x24')](_0x3ff6d9['model'],_0x3ff6d9[_0x0fc9('0x21')]);_0x3faee8[_0x0fc9('0x25')]=_[_0x0fc9('0x24')](_0x3ff6d9['model'],qs[_0x0fc9('0x26')](_0x194519['query'][_0x0fc9('0x26')]));_0x3faee8[_0x0fc9('0x25')]=_0x3faee8[_0x0fc9('0x25')][_0x0fc9('0x27')]?_0x3faee8[_0x0fc9('0x25')]:_0x3ff6d9[_0x0fc9('0x28')];if(!_0x194519['query'][_0x0fc9('0x29')]('nolimit')){_0x3faee8[_0x0fc9('0xf')]=qs[_0x0fc9('0xf')](_0x194519[_0x0fc9('0x21')][_0x0fc9('0xf')]);_0x3faee8[_0x0fc9('0xc')]=qs[_0x0fc9('0xc')](_0x194519[_0x0fc9('0x21')][_0x0fc9('0xc')]);}_0x3faee8[_0x0fc9('0x2a')]=qs[_0x0fc9('0x2b')](_0x194519[_0x0fc9('0x21')][_0x0fc9('0x2b')]);_0x3faee8[_0x0fc9('0x2c')]=qs['filters'](_[_0x0fc9('0x2d')](_0x194519[_0x0fc9('0x21')],_0x3ff6d9[_0x0fc9('0x23')]),_0x351a9e);if(_0x194519[_0x0fc9('0x21')][_0x0fc9('0x2e')]){_0x3faee8[_0x0fc9('0x2c')]=_[_0x0fc9('0x2f')](_0x3faee8['where'],{'$or':_[_0x0fc9('0x1c')](_0x351a9e,function(_0x7fb17c){if(_0x7fb17c[_0x0fc9('0x1f')]!=='VIRTUAL'){var _0xf91bd5={};_0xf91bd5[_0x7fb17c[_0x0fc9('0x18')]]={'$like':'%'+_0x194519[_0x0fc9('0x21')][_0x0fc9('0x2e')]+'%'};return _0xf91bd5;}})});}_0x3faee8=_[_0x0fc9('0x2f')]({},_0x3faee8,_0x194519[_0x0fc9('0x30')]);var _0x3d36db={'where':_0x3faee8[_0x0fc9('0x2c')]};return db[_0x0fc9('0x1d')]['count'](_0x3d36db)['then'](function(_0x2d9075){_0x3ecc8d['count']=_0x2d9075;if(_0x194519[_0x0fc9('0x21')][_0x0fc9('0x31')]){_0x3faee8['include']=[{'all':!![]}];}return db[_0x0fc9('0x1d')][_0x0fc9('0x32')](_0x3faee8);})['then'](function(_0x50c35b){_0x3ecc8d[_0x0fc9('0x33')]=_['map'](_0x50c35b,function(_0x121e5f){if(_0x121e5f['service']===_0x0fc9('0x34')){var _0x1be25d=encryptor[_0x0fc9('0x35')](_0x121e5f[_0x0fc9('0x36')]);_0x121e5f['data3']=maskClientSecret(_0x1be25d);}return _0x121e5f;});return _0x3ecc8d;})[_0x0fc9('0x14')](respondWithFilteredResult(_0x4d61bd,_0x3faee8))[_0x0fc9('0x37')](handleError(_0x4d61bd,null));};exports[_0x0fc9('0x38')]=function(_0x144702,_0x1db95a){var _0x4a87b4={'raw':!![],'where':{'id':_0x144702[_0x0fc9('0x39')]['id']}},_0x20d00c={};_0x20d00c[_0x0fc9('0x28')]=_[_0x0fc9('0x22')](db['CloudProvider'][_0x0fc9('0x3a')]);_0x20d00c[_0x0fc9('0x21')]=_[_0x0fc9('0x22')](_0x144702[_0x0fc9('0x21')]);_0x20d00c['filters']=_[_0x0fc9('0x24')](_0x20d00c[_0x0fc9('0x28')],_0x20d00c[_0x0fc9('0x21')]);_0x4a87b4[_0x0fc9('0x25')]=_[_0x0fc9('0x24')](_0x20d00c[_0x0fc9('0x28')],qs['fields'](_0x144702[_0x0fc9('0x21')][_0x0fc9('0x26')]));_0x4a87b4[_0x0fc9('0x25')]=_0x4a87b4[_0x0fc9('0x25')][_0x0fc9('0x27')]?_0x4a87b4[_0x0fc9('0x25')]:_0x20d00c[_0x0fc9('0x28')];if(_0x144702[_0x0fc9('0x21')][_0x0fc9('0x31')]){_0x4a87b4[_0x0fc9('0x3b')]=[{'all':!![]}];}_0x4a87b4=_['merge']({},_0x4a87b4,_0x144702[_0x0fc9('0x30')]);return db[_0x0fc9('0x1d')][_0x0fc9('0x3c')](_0x4a87b4)[_0x0fc9('0x14')](handleEntityNotFound(_0x1db95a,null))[_0x0fc9('0x14')](function(_0x69e2c9){if(_0x69e2c9['service']==='MicrosoftAzure'){var _0x5f0345=encryptor['decryptString'](_0x69e2c9[_0x0fc9('0x36')]);_0x69e2c9[_0x0fc9('0x36')]=maskClientSecret(_0x5f0345);}return _0x69e2c9;})[_0x0fc9('0x14')](respondWithResult(_0x1db95a,null))[_0x0fc9('0x37')](handleError(_0x1db95a,null));};exports[_0x0fc9('0x3d')]=function(_0x304a8d,_0x45caa1){if(!_0x304a8d[_0x0fc9('0x3e')][_0x0fc9('0x18')])throw new Error(_0x0fc9('0x3f'));if(!_0x304a8d[_0x0fc9('0x3e')][_0x0fc9('0x40')])throw new Error(_0x0fc9('0x41'));var _0x20efd9=db[_0x0fc9('0x1d')][_0x0fc9('0x3a')][_0x0fc9('0x40')][_0x0fc9('0x42')];if(!_0x20efd9[_0x0fc9('0x43')](_0x304a8d[_0x0fc9('0x3e')][_0x0fc9('0x40')]))throw new Error(_0x0fc9('0x44')+_0x20efd9[_0x0fc9('0x45')](',\x20'));if(_0x304a8d[_0x0fc9('0x3e')][_0x0fc9('0x40')]===_0x0fc9('0x34')&&_0x304a8d[_0x0fc9('0x3e')][_0x0fc9('0x36')]){_0x304a8d['body'][_0x0fc9('0x36')]=encryptor[_0x0fc9('0x46')](_0x304a8d[_0x0fc9('0x3e')][_0x0fc9('0x36')]);}return db['CloudProvider'][_0x0fc9('0x3d')](_0x304a8d[_0x0fc9('0x3e')],{})[_0x0fc9('0x14')](respondWithResult(_0x45caa1,0xc9))['catch'](handleError(_0x45caa1,null));};exports[_0x0fc9('0x13')]=function(_0x465d07,_0x56636b){if(_0x465d07[_0x0fc9('0x3e')]['id']){delete _0x465d07['body']['id'];}return db['CloudProvider'][_0x0fc9('0x3c')]({'where':{'id':_0x465d07[_0x0fc9('0x39')]['id']}})[_0x0fc9('0x14')](handleEntityNotFound(_0x56636b,null))['then'](function(_0x4b962a){if(_0x4b962a['service']===_0x0fc9('0x34')&&_0x465d07[_0x0fc9('0x3e')][_0x0fc9('0x36')]){_0x465d07['body'][_0x0fc9('0x36')]=encryptor[_0x0fc9('0x46')](_0x465d07[_0x0fc9('0x3e')][_0x0fc9('0x36')]);}return _0x4b962a;})[_0x0fc9('0x14')](saveUpdates(_0x465d07[_0x0fc9('0x3e')],null))['then'](respondWithResult(_0x56636b,null))[_0x0fc9('0x37')](handleError(_0x56636b,null));};exports[_0x0fc9('0x15')]=function(_0x7b7bb2,_0x1ca75f){return db['CloudProvider']['find']({'where':{'id':_0x7b7bb2['params']['id']}})[_0x0fc9('0x14')](handleEntityNotFound(_0x1ca75f,null))[_0x0fc9('0x14')](removeEntity(_0x1ca75f,null))['catch'](handleError(_0x1ca75f,null));};exports[_0x0fc9('0x47')]=function(_0xf19436,_0x4ee61c){return db[_0x0fc9('0x1d')]['findOne']({'where':{'id':_0xf19436[_0x0fc9('0x39')]['id']},'raw':!![]})[_0x0fc9('0x14')](function(_0x29cba8){if(!_0x29cba8)return _0x4ee61c[_0x0fc9('0x9')](0x194);return{'url':oauth[_0x0fc9('0x48')](_0x29cba8,_0xf19436[_0x0fc9('0x49')]['id'])};})[_0x0fc9('0x14')](respondWithResult(_0x4ee61c,null))[_0x0fc9('0x37')](handleError(_0x4ee61c,null));};exports[_0x0fc9('0x4a')]=function(_0x864115,_0x1dd766){var _0xa7c07f=_0x864115[_0x0fc9('0x3e')];var _0x58ff2f;var _0xb85e42;if(_0xa7c07f[_0x0fc9('0x16')])throw _0xa7c07f;redis[_0x0fc9('0x4b')](_0xa7c07f[_0x0fc9('0x4c')])[_0x0fc9('0x14')](function(_0x203076){if(!_0x203076)throw new Error(_0x0fc9('0x4d'));_0x58ff2f=JSON[_0x0fc9('0x4e')](_0x203076);var _0xb50e1a=Buffer[_0x0fc9('0x4f')](_0xa7c07f['state'],_0x0fc9('0x50'))[_0x0fc9('0x51')](_0x0fc9('0x52'));_0xb85e42=JSON[_0x0fc9('0x4e')](_0xb50e1a);if(!oauth['isValidIdToken'](_0xa7c07f[_0x0fc9('0x53')],_0x58ff2f['oauth2Claims']))throw new Error(_0x0fc9('0x54'));redis[_0x0fc9('0x55')](_0xa7c07f['state']);return oauth[_0x0fc9('0x56')](_0xa7c07f[_0x0fc9('0x57')],_0x58ff2f);})[_0x0fc9('0x14')](function(_0xd5a0fc){_0x58ff2f[_0x0fc9('0x58')]=_0xd5a0fc[_0x0fc9('0x59')];_0x58ff2f[_0x0fc9('0x5a')]=_0xd5a0fc[_0x0fc9('0x5b')];return db[_0x0fc9('0x1d')]['update']({'data5':_0x58ff2f[_0x0fc9('0x58')],'data6':_0x58ff2f[_0x0fc9('0x5a')]},{'where':{'id':_0x58ff2f['id']}});})['then'](function(){oauth[_0x0fc9('0x5c')](_0x58ff2f);socket[_0x0fc9('0x5d')](_0x0fc9('0x5e'),{'id':_0xb85e42['id']});return;})[_0x0fc9('0x14')](respondWithStatusCode(_0x1dd766,null))[_0x0fc9('0x37')](function(_0xa92089){if(_0xb85e42){socket[_0x0fc9('0x5d')](_0x0fc9('0x5f'),{'id':_0xb85e42['id']});}if(!_0x58ff2f){logger[_0x0fc9('0x16')](_0x0fc9('0x60'),_0xa92089);return _0x1dd766[_0x0fc9('0xa')](0x1f4)[_0x0fc9('0x19')](_0xa92089[_0x0fc9('0x61')]);}logger[_0x0fc9('0x16')](_0x0fc9('0x62'),_0x58ff2f['id'],JSON[_0x0fc9('0x63')](_0xa92089));});};
\ No newline at end of file
+var _0x3be3=['VIRTUAL','CloudProvider','includeAll','include','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','merge','options','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','rawAttributes','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','find','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','base64','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','status','undefined','limit','count','offset','set','json','destroy','then','end','error','stack','name','send','padEnd','slice','map','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter'];(function(_0x4bd17e,_0x216b6e){var _0x11d7cf=function(_0x2d028f){while(--_0x2d028f){_0x4bd17e['push'](_0x4bd17e['shift']());}};_0x11d7cf(++_0x216b6e);}(_0x3be3,0x1c5));var _0x33be=function(_0x48961c,_0x280e9d){_0x48961c=_0x48961c-0x0;var _0x1d895d=_0x3be3[_0x48961c];return _0x1d895d;};'use strict';var _=require('lodash');var Redis=require(_0x33be('0x0'));var qs=require(_0x33be('0x1'));var encryptor=require(_0x33be('0x2'));var config=require(_0x33be('0x3'));var logger=require(_0x33be('0x4'))(_0x33be('0x5'));var db=require(_0x33be('0x6'))['db'];var oauth=require(_0x33be('0x7'));config[_0x33be('0x8')]=_[_0x33be('0x9')](config[_0x33be('0x8')],{'host':_0x33be('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x5984d2,_0x224a61){_0x224a61=_0x224a61||0xcc;return function(_0x1c020d){if(_0x1c020d){return _0x5984d2[_0x33be('0xb')](_0x224a61);}return _0x5984d2[_0x33be('0xc')](_0x224a61)['end']();};}function respondWithResult(_0x381415,_0x55a879){_0x55a879=_0x55a879||0xc8;return function(_0x540ea6){if(_0x540ea6){return _0x381415[_0x33be('0xc')](_0x55a879)['json'](_0x540ea6);}};}function respondWithFilteredResult(_0x36a88f,_0x35aca2){return function(_0x2fd80a){if(_0x2fd80a){var _0x42c4e6=typeof _0x35aca2['offset']===_0x33be('0xd')&&typeof _0x35aca2[_0x33be('0xe')]===_0x33be('0xd');var _0x25f29a=_0x2fd80a[_0x33be('0xf')];var _0x2de994=_0x42c4e6?0x0:_0x35aca2[_0x33be('0x10')];var _0x404a20=_0x42c4e6?_0x2fd80a[_0x33be('0xf')]:_0x35aca2[_0x33be('0x10')]+_0x35aca2[_0x33be('0xe')];var _0x5437de;if(_0x404a20>=_0x25f29a){_0x404a20=_0x25f29a;_0x5437de=0xc8;}else{_0x5437de=0xce;}_0x36a88f['status'](_0x5437de);return _0x36a88f[_0x33be('0x11')]('Content-Range',_0x2de994+'-'+_0x404a20+'/'+_0x25f29a)[_0x33be('0x12')](_0x2fd80a);}return null;};}function saveUpdates(_0x35d174){return function(_0x433580){if(_0x433580){return _0x433580['update'](_0x35d174)['then'](function(_0x4babe5){return _0x4babe5;});}return null;};}function removeEntity(_0x259686){return function(_0x1e0593){if(_0x1e0593){return _0x1e0593[_0x33be('0x13')]()[_0x33be('0x14')](function(){_0x259686['status'](0xcc)[_0x33be('0x15')]();});}};}function handleEntityNotFound(_0xc26d07){return function(_0x1185e5){if(!_0x1185e5){_0xc26d07[_0x33be('0xb')](0x194);}return _0x1185e5;};}function handleError(_0x40388a,_0x52b030){_0x52b030=_0x52b030||0x1f4;return function(_0x495c45){logger[_0x33be('0x16')](_0x495c45[_0x33be('0x17')]);if(_0x495c45['name']){delete _0x495c45[_0x33be('0x18')];}_0x40388a[_0x33be('0xc')](_0x52b030)[_0x33be('0x19')](_0x495c45);};}function maskClientSecret(_0x2e7ed7){return _[_0x33be('0x1a')](_0x2e7ed7[_0x33be('0x1b')](0x0,0x3),0x14,'*');}exports['index']=function(_0xc6983b,_0x47cf77){var _0x329059={},_0xb8a106={},_0xdf1e92={'count':0x0,'rows':[]};var _0x30dc6f=_[_0x33be('0x1c')](db['CloudProvider']['rawAttributes'],function(_0xe4fd5f){return{'name':_0xe4fd5f[_0x33be('0x1d')],'type':_0xe4fd5f[_0x33be('0x1e')][_0x33be('0x1f')]};});_0xb8a106[_0x33be('0x20')]=_['map'](_0x30dc6f,_0x33be('0x18'));_0xb8a106[_0x33be('0x21')]=_[_0x33be('0x22')](_0xc6983b[_0x33be('0x21')]);_0xb8a106['filters']=_['intersection'](_0xb8a106[_0x33be('0x20')],_0xb8a106[_0x33be('0x21')]);_0x329059[_0x33be('0x23')]=_[_0x33be('0x24')](_0xb8a106[_0x33be('0x20')],qs[_0x33be('0x25')](_0xc6983b[_0x33be('0x21')][_0x33be('0x25')]));_0x329059[_0x33be('0x23')]=_0x329059[_0x33be('0x23')][_0x33be('0x26')]?_0x329059['attributes']:_0xb8a106[_0x33be('0x20')];if(!_0xc6983b[_0x33be('0x21')][_0x33be('0x27')](_0x33be('0x28'))){_0x329059[_0x33be('0xe')]=qs[_0x33be('0xe')](_0xc6983b['query']['limit']);_0x329059[_0x33be('0x10')]=qs['offset'](_0xc6983b['query'][_0x33be('0x10')]);}_0x329059[_0x33be('0x29')]=qs[_0x33be('0x2a')](_0xc6983b['query'][_0x33be('0x2a')]);_0x329059[_0x33be('0x2b')]=qs[_0x33be('0x2c')](_[_0x33be('0x2d')](_0xc6983b['query'],_0xb8a106[_0x33be('0x2c')]),_0x30dc6f);if(_0xc6983b[_0x33be('0x21')][_0x33be('0x2e')]){_0x329059[_0x33be('0x2b')]=_['merge'](_0x329059[_0x33be('0x2b')],{'$or':_[_0x33be('0x1c')](_0x30dc6f,function(_0x31d38f){if(_0x31d38f[_0x33be('0x1e')]!==_0x33be('0x2f')){var _0x4c4575={};_0x4c4575[_0x31d38f[_0x33be('0x18')]]={'$like':'%'+_0xc6983b[_0x33be('0x21')]['filter']+'%'};return _0x4c4575;}})});}_0x329059=_['merge']({},_0x329059,_0xc6983b['options']);var _0x43b4f4={'where':_0x329059[_0x33be('0x2b')]};return db[_0x33be('0x30')][_0x33be('0xf')](_0x43b4f4)[_0x33be('0x14')](function(_0x5b1112){_0xdf1e92[_0x33be('0xf')]=_0x5b1112;if(_0xc6983b[_0x33be('0x21')][_0x33be('0x31')]){_0x329059[_0x33be('0x32')]=[{'all':!![]}];}return db[_0x33be('0x30')]['findAll'](_0x329059);})[_0x33be('0x14')](function(_0x7da500){_0xdf1e92[_0x33be('0x33')]=_['map'](_0x7da500,function(_0x243dc4){if(_0x243dc4[_0x33be('0x34')]===_0x33be('0x35')){var _0x14374b=encryptor[_0x33be('0x36')](_0x243dc4[_0x33be('0x37')]);_0x243dc4[_0x33be('0x37')]=maskClientSecret(_0x14374b);}return _0x243dc4;});return _0xdf1e92;})[_0x33be('0x14')](respondWithFilteredResult(_0x47cf77,_0x329059))[_0x33be('0x38')](handleError(_0x47cf77,null));};exports[_0x33be('0x39')]=function(_0xb6cce8,_0x5e4b17){var _0x38cc05={'raw':!![],'where':{'id':_0xb6cce8[_0x33be('0x3a')]['id']}},_0xcb9f23={};_0xcb9f23[_0x33be('0x20')]=_[_0x33be('0x22')](db['CloudProvider']['rawAttributes']);_0xcb9f23[_0x33be('0x21')]=_[_0x33be('0x22')](_0xb6cce8['query']);_0xcb9f23[_0x33be('0x2c')]=_[_0x33be('0x24')](_0xcb9f23[_0x33be('0x20')],_0xcb9f23[_0x33be('0x21')]);_0x38cc05[_0x33be('0x23')]=_[_0x33be('0x24')](_0xcb9f23['model'],qs[_0x33be('0x25')](_0xb6cce8[_0x33be('0x21')][_0x33be('0x25')]));_0x38cc05[_0x33be('0x23')]=_0x38cc05[_0x33be('0x23')][_0x33be('0x26')]?_0x38cc05[_0x33be('0x23')]:_0xcb9f23['model'];if(_0xb6cce8[_0x33be('0x21')]['includeAll']){_0x38cc05[_0x33be('0x32')]=[{'all':!![]}];}_0x38cc05=_[_0x33be('0x3b')]({},_0x38cc05,_0xb6cce8[_0x33be('0x3c')]);return db[_0x33be('0x30')]['find'](_0x38cc05)[_0x33be('0x14')](handleEntityNotFound(_0x5e4b17,null))[_0x33be('0x14')](function(_0x3be4f3){if(_0x3be4f3[_0x33be('0x34')]===_0x33be('0x35')){var _0x25767a=encryptor['decryptString'](_0x3be4f3[_0x33be('0x37')]);_0x3be4f3['data3']=maskClientSecret(_0x25767a);}return _0x3be4f3;})[_0x33be('0x14')](respondWithResult(_0x5e4b17,null))[_0x33be('0x38')](handleError(_0x5e4b17,null));};exports[_0x33be('0x3d')]=function(_0x27a94a,_0x102713){if(!_0x27a94a['body'][_0x33be('0x18')])throw new Error(_0x33be('0x3e'));if(!_0x27a94a[_0x33be('0x3f')]['service'])throw new Error(_0x33be('0x40'));var _0x308aba=db[_0x33be('0x30')][_0x33be('0x41')][_0x33be('0x34')][_0x33be('0x42')];if(!_0x308aba[_0x33be('0x43')](_0x27a94a[_0x33be('0x3f')][_0x33be('0x34')]))throw new Error(_0x33be('0x44')+_0x308aba[_0x33be('0x45')](',\x20'));if(_0x27a94a[_0x33be('0x3f')][_0x33be('0x34')]===_0x33be('0x35')&&_0x27a94a[_0x33be('0x3f')][_0x33be('0x37')]){_0x27a94a[_0x33be('0x3f')][_0x33be('0x37')]=encryptor[_0x33be('0x46')](_0x27a94a[_0x33be('0x3f')]['data3']);}return db[_0x33be('0x30')][_0x33be('0x3d')](_0x27a94a[_0x33be('0x3f')],{})[_0x33be('0x14')](respondWithResult(_0x102713,0xc9))[_0x33be('0x38')](handleError(_0x102713,null));};exports[_0x33be('0x47')]=function(_0x291c5b,_0x4482ad){if(_0x291c5b[_0x33be('0x3f')]['id']){delete _0x291c5b[_0x33be('0x3f')]['id'];}return db[_0x33be('0x30')]['find']({'where':{'id':_0x291c5b[_0x33be('0x3a')]['id']}})[_0x33be('0x14')](handleEntityNotFound(_0x4482ad,null))[_0x33be('0x14')](function(_0x5e4294){if(_0x5e4294[_0x33be('0x34')]==='MicrosoftAzure'&&_0x291c5b[_0x33be('0x3f')][_0x33be('0x37')]){_0x291c5b[_0x33be('0x3f')][_0x33be('0x37')]=encryptor[_0x33be('0x46')](_0x291c5b['body']['data3']);}return _0x5e4294;})[_0x33be('0x14')](saveUpdates(_0x291c5b[_0x33be('0x3f')],null))['then'](respondWithResult(_0x4482ad,null))[_0x33be('0x38')](handleError(_0x4482ad,null));};exports[_0x33be('0x13')]=function(_0x40dfe9,_0x2255ee){return db[_0x33be('0x30')][_0x33be('0x48')]({'where':{'id':_0x40dfe9[_0x33be('0x3a')]['id']}})['then'](handleEntityNotFound(_0x2255ee,null))[_0x33be('0x14')](removeEntity(_0x2255ee,null))[_0x33be('0x38')](handleError(_0x2255ee,null));};exports['oauth2MicrosoftAuthorize']=function(_0x1d3ce1,_0x5cdbb0){return db[_0x33be('0x30')][_0x33be('0x49')]({'where':{'id':_0x1d3ce1[_0x33be('0x3a')]['id']},'raw':!![]})[_0x33be('0x14')](function(_0x26cf12){if(!_0x26cf12)return _0x5cdbb0[_0x33be('0xb')](0x194);return{'url':oauth[_0x33be('0x4a')](_0x26cf12,_0x1d3ce1[_0x33be('0x4b')]['id'])};})['then'](respondWithResult(_0x5cdbb0,null))[_0x33be('0x38')](handleError(_0x5cdbb0,null));};exports[_0x33be('0x4c')]=function(_0x35c1e5,_0x1aadfe){var _0x28c784=_0x35c1e5['body'];var _0x2110c6;var _0x5de65d;if(_0x28c784[_0x33be('0x16')])throw _0x28c784;redis[_0x33be('0x4d')](_0x28c784['state'])['then'](function(_0x1c7376){if(!_0x1c7376)throw new Error(_0x33be('0x4e'));_0x2110c6=JSON[_0x33be('0x4f')](_0x1c7376);var _0x5bb9f3=Buffer[_0x33be('0x50')](_0x28c784[_0x33be('0x51')],_0x33be('0x52'))['toString']('ascii');_0x5de65d=JSON[_0x33be('0x4f')](_0x5bb9f3);if(!oauth[_0x33be('0x53')](_0x28c784[_0x33be('0x54')],_0x2110c6[_0x33be('0x55')]))throw new Error(_0x33be('0x56'));redis[_0x33be('0x57')](_0x28c784[_0x33be('0x51')]);return oauth[_0x33be('0x58')](_0x28c784[_0x33be('0x59')],_0x2110c6);})['then'](function(_0x387d6e){_0x2110c6[_0x33be('0x5a')]=_0x387d6e[_0x33be('0x5b')];_0x2110c6[_0x33be('0x5c')]=_0x387d6e[_0x33be('0x5d')];return db['CloudProvider'][_0x33be('0x47')]({'data5':_0x2110c6[_0x33be('0x5a')],'data6':_0x2110c6[_0x33be('0x5c')]},{'where':{'id':_0x2110c6['id']}});})[_0x33be('0x14')](function(){oauth['startRefreshInterval'](_0x2110c6);socket['emit'](_0x33be('0x5e'),{'id':_0x5de65d['id']});return;})[_0x33be('0x14')](respondWithStatusCode(_0x1aadfe,null))['catch'](function(_0xf517ee){if(_0x5de65d){socket[_0x33be('0x5f')](_0x33be('0x60'),{'id':_0x5de65d['id']});}if(!_0x2110c6){logger[_0x33be('0x16')](_0x33be('0x61'),_0xf517ee);return _0x1aadfe[_0x33be('0xc')](0x1f4)[_0x33be('0x19')](_0xf517ee[_0x33be('0x62')]);}logger[_0x33be('0x16')](_0x33be('0x63'),_0x2110c6['id'],JSON['stringify'](_0xf517ee));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index ed1b10f..83dd229 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 _0xf9e6=['exports','define','cloud_providers','lodash','api','moment','request-promise','path','rimraf','./cloudProvider.attributes'];(function(_0x10e2c9,_0x489aab){var _0x426947=function(_0x123624){while(--_0x123624){_0x10e2c9['push'](_0x10e2c9['shift']());}};_0x426947(++_0x489aab);}(_0xf9e6,0x1a7));var _0x6f9e=function(_0xde70c7,_0x1dba2e){_0xde70c7=_0xde70c7-0x0;var _0x598ed6=_0xf9e6[_0xde70c7];return _0x598ed6;};'use strict';var _=require(_0x6f9e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6f9e('0x1'));var moment=require(_0x6f9e('0x2'));var BPromise=require('bluebird');var rp=require(_0x6f9e('0x3'));var fs=require('fs');var path=require(_0x6f9e('0x4'));var rimraf=require(_0x6f9e('0x5'));var config=require('../../config/environment');var attributes=require(_0x6f9e('0x6'));module[_0x6f9e('0x7')]=function(_0x4fda76,_0x2bbbfc){return _0x4fda76[_0x6f9e('0x8')]('CloudProvider',attributes,{'tableName':_0x6f9e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6c96=['path','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3ab353,_0x5d5283){var _0x1e2285=function(_0x55804f){while(--_0x55804f){_0x3ab353['push'](_0x3ab353['shift']());}};_0x1e2285(++_0x5d5283);}(_0x6c96,0x1db));var _0x66c9=function(_0x162f74,_0x5b5a29){_0x162f74=_0x162f74-0x0;var _0x1026da=_0x6c96[_0x162f74];return _0x1026da;};'use strict';var _=require(_0x66c9('0x0'));var util=require(_0x66c9('0x1'));var logger=require(_0x66c9('0x2'))(_0x66c9('0x3'));var moment=require('moment');var BPromise=require(_0x66c9('0x4'));var rp=require(_0x66c9('0x5'));var fs=require('fs');var path=require(_0x66c9('0x6'));var rimraf=require(_0x66c9('0x7'));var config=require(_0x66c9('0x8'));var attributes=require(_0x66c9('0x9'));module[_0x66c9('0xa')]=function(_0x4b7be6,_0x352b6a){return _0x4b7be6['define'](_0x66c9('0xb'),attributes,{'tableName':_0x66c9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 7e1bbd2..5774c7b 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 _0x601e=['response_mode','form_post','scope','state','prompt','login','key','value','oauth2Claims','oauth2/','decode','payload','iss','issuer','aud','nonce','isAfter','unix','exp','resolve','then','CloudProvider','findOne','data6','data4','data3','POST','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','bind','findAll','map','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/token','type','/.default','join','Dynamics365','data7','{TENANT_ID}','data2','code','from','toString','base64','hex','client_id','data1','response_type','redirect_uri'];(function(_0x22093a,_0xa7acf1){var _0x2f4989=function(_0x5bf12b){while(--_0x5bf12b){_0x22093a['push'](_0x22093a['shift']());}};_0x2f4989(++_0xa7acf1);}(_0x601e,0x1ef));var _0xe601=function(_0x43dc7e,_0x49a390){_0x43dc7e=_0x43dc7e-0x0;var _0x21e12d=_0x601e[_0x43dc7e];return _0x21e12d;};'use strict';var _=require(_0xe601('0x0'));var crypto=require(_0xe601('0x1'));var jwt=require(_0xe601('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0xe601('0x3'));var util=require(_0xe601('0x4'));var encryptor=require(_0xe601('0x5'));var config=require(_0xe601('0x6'));var logger=require(_0xe601('0x7'))(_0xe601('0x8'));var schedule=require(_0xe601('0x9'));var db=require(_0xe601('0xa'))['db'];config['redis']=_[_0xe601('0xb')](config[_0xe601('0xc')],{'host':_0xe601('0xd'),'port':0x18eb});var redis=new Redis(config[_0xe601('0xc')]);var MICROSOFT_AUTH_URL=_0xe601('0xe');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xe601('0xf'),'email',_0xe601('0x10'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xe601('0x11'),_0xe601('0x12')],'Dynamics365':[_0xe601('0x13'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xe601('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xfe134e){var _0x589f4a=_['map'](AZURE_AUTH_SCOPES[_0xfe134e[_0xe601('0x15')]]);if(_0xfe134e[_0xe601('0x15')]==='Dynamics365')_0x589f4a['push'](_0xfe134e['data7']+_0xe601('0x16'));return _0x589f4a[_0xe601('0x17')]('\x20');}function getAccessTokenScope(_0x24b9e5){if(_0x24b9e5[_0xe601('0x15')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x24b9e5[_0xe601('0x15')]===_0xe601('0x18'))return _0x24b9e5[_0xe601('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x4171b9,_0x4aacb8){var _0x5c44e0=MICROSOFT_AUTH_URL['replace'](_0xe601('0x1a'),_0x4171b9[_0xe601('0x1b')]);var _0x4e9f41=[_0xe601('0x1c'),'id_token'];var _0x44d76a=Buffer[_0xe601('0x1d')](JSON['stringify']({'id':_0x4aacb8}))[_0xe601('0x1e')](_0xe601('0x1f'));var _0x2db288=crypto['randomBytes'](0x10)[_0xe601('0x1e')](_0xe601('0x20'));var _0x4bc8be=getAuthorizationScopes(_0x4171b9);var _0x5c9a69=[{'key':_0xe601('0x21'),'value':_0x4171b9[_0xe601('0x22')]},{'key':_0xe601('0x23'),'value':encodeURIComponent(_0x4e9f41[_0xe601('0x17')]('\x20'))},{'key':_0xe601('0x24'),'value':_0x4171b9['data4']},{'key':_0xe601('0x25'),'value':_0xe601('0x26')},{'key':_0xe601('0x27'),'value':encodeURIComponent(_0x4bc8be)},{'key':_0xe601('0x28'),'value':_0x44d76a},{'key':'nonce','value':_0x2db288},{'key':_0xe601('0x29'),'value':_0xe601('0x2a')}];var _0x780f37=_0x5c44e0+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x5c9a69,function(_0x5c12cd){return _0x5c12cd[_0xe601('0x2b')]+'='+_0x5c12cd[_0xe601('0x2c')];})[_0xe601('0x17')]('&');_0x4171b9[_0xe601('0x2d')]={'issuer':_0x5c44e0['replace'](_0xe601('0x2e'),''),'audience':_0x4171b9[_0xe601('0x22')],'state':_0x44d76a,'nonce':_0x2db288};redis['set'](_0x44d76a,JSON['stringify'](_0x4171b9));return _0x780f37;}function isValidIdToken(_0x25f15d,_0xf9df78){try{var _0x26d4fc=jwt[_0xe601('0x2f')](_0x25f15d,{'complete':!![]});var _0xd37005=_0x26d4fc[_0xe601('0x30')];if(_0xd37005[_0xe601('0x31')]!==_0xf9df78[_0xe601('0x32')])return![];if(_0xd37005[_0xe601('0x33')]!==_0xf9df78['audience'])return![];if(_0xd37005[_0xe601('0x34')]!==_0xf9df78[_0xe601('0x34')])return![];if(moment()[_0xe601('0x35')](moment[_0xe601('0x36')](_0xd37005[_0xe601('0x37')])))return![];return!![];}catch(_0x3baa8f){throw _0x3baa8f;}}function refreshOauth2MicrosoftAccessToken(_0x143240){return Promise[_0xe601('0x38')]()[_0xe601('0x39')](function(){if(_0x143240['data3'])return _0x143240;return db[_0xe601('0x3a')][_0xe601('0x3b')]({'where':{'id':_0x143240['id']},'raw':!![]});})['then'](function(_0x925d9b){var _0x5c386d={'grant_type':'refresh_token','refresh_token':_0x925d9b[_0xe601('0x3c')],'scope':getAccessTokenScope(_0x925d9b),'redirect_uri':_0x925d9b[_0xe601('0x3d')],'client_id':_0x925d9b[_0xe601('0x22')],'client_secret':encryptor['decryptString'](_0x925d9b[_0xe601('0x3e')])};var _0x5dff16={'method':_0xe601('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xe601('0x1a'),_0x925d9b[_0xe601('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5c386d,'json':!![]};return rp(_0x5dff16);})[_0xe601('0x39')](function(_0x17cc35){_0x143240[_0xe601('0x40')]=_0x17cc35[_0xe601('0x41')];_0x143240[_0xe601('0x3c')]=_0x17cc35['refresh_token'];return db[_0xe601('0x3a')][_0xe601('0x42')]({'data5':_0x143240[_0xe601('0x40')],'data6':_0x143240['data6']},{'where':{'id':_0x143240['id']}});})[_0xe601('0x39')](function(){return _0x143240;})[_0xe601('0x43')](function(_0x20b922){logger[_0xe601('0x44')](_0xe601('0x45'),_0x143240['id'],_0x20b922);});}function getOauth2MicrosoftAccessToken(_0x1d47c8,_0x474de1){var _0x61aaa6={'grant_type':'authorization_code','code':_0x1d47c8,'scope':getAccessTokenScope(_0x474de1),'redirect_uri':_0x474de1[_0xe601('0x3d')],'client_id':_0x474de1[_0xe601('0x22')],'client_secret':encryptor['decryptString'](_0x474de1[_0xe601('0x3e')])};var _0x3386d2={'method':_0xe601('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xe601('0x1a'),_0x474de1[_0xe601('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x61aaa6,'json':!![]};return rp(_0x3386d2);}function startRefreshInterval(_0x567d46){var _0x1a23d9=schedule['intervals'];if(_0x1a23d9[_0x567d46['id']])clearInterval(_0x1a23d9[_0x567d46['id']]);_0x1a23d9[_0x567d46['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xe601('0x46')](this,{'id':_0x567d46['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x1a23d9;}function startAllRefreshIntervals(){return db[_0xe601('0x3a')][_0xe601('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xe601('0x39')](function(_0x50afd8){var _0x376aa2=_0x50afd8[_0xe601('0x48')](function(_0x33e6e7){return refreshOauth2MicrosoftAccessToken(_0x33e6e7)[_0xe601('0x39')](function(_0x5c700a){startRefreshInterval(_0x5c700a);});});return Promise[_0xe601('0x49')](_0x376aa2);})['catch'](function(_0x4b329c){var _0x46a600=_0x4b329c?util[_0xe601('0x4a')](_0x4b329c,{'showHidden':![],'depth':null}):'';logger[_0xe601('0x44')](_0xe601('0x4b'),_0x46a600);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xe9bf=['../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','/.default','Outlook365','data7','{TENANT_ID}','data2','from','stringify','toString','base64','randomBytes','client_id','response_type','join','redirect_uri','response_mode','form_post','key','oauth2Claims','replace','oauth2/','set','iss','issuer','aud','audience','nonce','unix','exp','resolve','then','data3','CloudProvider','refresh_token','data6','data4','data1','decryptString','POST','data5','access_token','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api'];(function(_0x3f57f1,_0x1b1a0f){var _0x20ed13=function(_0x204ff9){while(--_0x204ff9){_0x3f57f1['push'](_0x3f57f1['shift']());}};_0x20ed13(++_0x1b1a0f);}(_0xe9bf,0x1be));var _0xfe9b=function(_0x4faf96,_0x489a92){_0x4faf96=_0x4faf96-0x0;var _0x464bd6=_0xe9bf[_0x4faf96];return _0x464bd6;};'use strict';var _=require(_0xfe9b('0x0'));var crypto=require(_0xfe9b('0x1'));var jwt=require(_0xfe9b('0x2'));var moment=require('moment');var Redis=require(_0xfe9b('0x3'));var rp=require(_0xfe9b('0x4'));var util=require(_0xfe9b('0x5'));var encryptor=require(_0xfe9b('0x6'));var config=require(_0xfe9b('0x7'));var logger=require(_0xfe9b('0x8'))(_0xfe9b('0x9'));var schedule=require(_0xfe9b('0xa'));var db=require(_0xfe9b('0xb'))['db'];config[_0xfe9b('0xc')]=_[_0xfe9b('0xd')](config[_0xfe9b('0xc')],{'host':_0xfe9b('0xe'),'port':0x18eb});var redis=new Redis(config[_0xfe9b('0xc')]);var MICROSOFT_AUTH_URL=_0xfe9b('0xf');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xfe9b('0x10'),_0xfe9b('0x11'),_0xfe9b('0x12'),_0xfe9b('0x13'),_0xfe9b('0x14'),_0xfe9b('0x15')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xfe9b('0x16');var MICROSOFT_TOKEN_ENDPOINT=_0xfe9b('0x17');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x47a25f){var _0x574cea=_[_0xfe9b('0x18')](AZURE_AUTH_SCOPES[_0x47a25f[_0xfe9b('0x19')]]);if(_0x47a25f[_0xfe9b('0x19')]===_0xfe9b('0x1a'))_0x574cea[_0xfe9b('0x1b')](_0x47a25f['data7']+_0xfe9b('0x1c'));return _0x574cea['join']('\x20');}function getAccessTokenScope(_0x3a3531){if(_0x3a3531[_0xfe9b('0x19')]===_0xfe9b('0x1d'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x3a3531[_0xfe9b('0x19')]===_0xfe9b('0x1a'))return _0x3a3531[_0xfe9b('0x1e')]+_0xfe9b('0x1c');}function generateMicrosoftAuthorizationUrl(_0x4fcb3a,_0x279710){var _0x9723e3=MICROSOFT_AUTH_URL['replace'](_0xfe9b('0x1f'),_0x4fcb3a[_0xfe9b('0x20')]);var _0x129948=['code','id_token'];var _0x6b6e7e=Buffer[_0xfe9b('0x21')](JSON[_0xfe9b('0x22')]({'id':_0x279710}))[_0xfe9b('0x23')](_0xfe9b('0x24'));var _0x1e843b=crypto[_0xfe9b('0x25')](0x10)[_0xfe9b('0x23')]('hex');var _0x15941a=getAuthorizationScopes(_0x4fcb3a);var _0x470811=[{'key':_0xfe9b('0x26'),'value':_0x4fcb3a['data1']},{'key':_0xfe9b('0x27'),'value':encodeURIComponent(_0x129948[_0xfe9b('0x28')]('\x20'))},{'key':_0xfe9b('0x29'),'value':_0x4fcb3a['data4']},{'key':_0xfe9b('0x2a'),'value':_0xfe9b('0x2b')},{'key':'scope','value':encodeURIComponent(_0x15941a)},{'key':'state','value':_0x6b6e7e},{'key':'nonce','value':_0x1e843b},{'key':'prompt','value':'login'}];var _0x48d554=_0x9723e3+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x470811,function(_0x5423e9){return _0x5423e9[_0xfe9b('0x2c')]+'='+_0x5423e9['value'];})[_0xfe9b('0x28')]('&');_0x4fcb3a[_0xfe9b('0x2d')]={'issuer':_0x9723e3[_0xfe9b('0x2e')](_0xfe9b('0x2f'),''),'audience':_0x4fcb3a['data1'],'state':_0x6b6e7e,'nonce':_0x1e843b};redis[_0xfe9b('0x30')](_0x6b6e7e,JSON[_0xfe9b('0x22')](_0x4fcb3a));return _0x48d554;}function isValidIdToken(_0x2b1e96,_0x189e67){try{var _0x466fb1=jwt['decode'](_0x2b1e96,{'complete':!![]});var _0x3cd1d8=_0x466fb1['payload'];if(_0x3cd1d8[_0xfe9b('0x31')]!==_0x189e67[_0xfe9b('0x32')])return![];if(_0x3cd1d8[_0xfe9b('0x33')]!==_0x189e67[_0xfe9b('0x34')])return![];if(_0x3cd1d8['nonce']!==_0x189e67[_0xfe9b('0x35')])return![];if(moment()['isAfter'](moment[_0xfe9b('0x36')](_0x3cd1d8[_0xfe9b('0x37')])))return![];return!![];}catch(_0x50ffbe){throw _0x50ffbe;}}function refreshOauth2MicrosoftAccessToken(_0x3ff2bd){return Promise[_0xfe9b('0x38')]()[_0xfe9b('0x39')](function(){if(_0x3ff2bd[_0xfe9b('0x3a')])return _0x3ff2bd;return db[_0xfe9b('0x3b')]['findOne']({'where':{'id':_0x3ff2bd['id']},'raw':!![]});})[_0xfe9b('0x39')](function(_0x2c9de1){var _0x154eeb={'grant_type':_0xfe9b('0x3c'),'refresh_token':_0x2c9de1[_0xfe9b('0x3d')],'scope':getAccessTokenScope(_0x2c9de1),'redirect_uri':_0x2c9de1[_0xfe9b('0x3e')],'client_id':_0x2c9de1[_0xfe9b('0x3f')],'client_secret':encryptor[_0xfe9b('0x40')](_0x2c9de1[_0xfe9b('0x3a')])};var _0x4a7f6c={'method':_0xfe9b('0x41'),'uri':MICROSOFT_AUTH_URL['replace'](_0xfe9b('0x1f'),_0x2c9de1[_0xfe9b('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x154eeb,'json':!![]};return rp(_0x4a7f6c);})['then'](function(_0x2bfe2d){_0x3ff2bd[_0xfe9b('0x42')]=_0x2bfe2d[_0xfe9b('0x43')];_0x3ff2bd[_0xfe9b('0x3d')]=_0x2bfe2d[_0xfe9b('0x3c')];return db['CloudProvider'][_0xfe9b('0x44')]({'data5':_0x3ff2bd['data5'],'data6':_0x3ff2bd[_0xfe9b('0x3d')]},{'where':{'id':_0x3ff2bd['id']}});})[_0xfe9b('0x39')](function(){return _0x3ff2bd;})['catch'](function(_0xeffedd){logger[_0xfe9b('0x45')](_0xfe9b('0x46'),_0x3ff2bd['id'],_0xeffedd);});}function getOauth2MicrosoftAccessToken(_0x55cb06,_0x51ab06){var _0x366f72={'grant_type':'authorization_code','code':_0x55cb06,'scope':getAccessTokenScope(_0x51ab06),'redirect_uri':_0x51ab06[_0xfe9b('0x3e')],'client_id':_0x51ab06[_0xfe9b('0x3f')],'client_secret':encryptor[_0xfe9b('0x40')](_0x51ab06['data3'])};var _0x449ea8={'method':_0xfe9b('0x41'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x51ab06[_0xfe9b('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x366f72,'json':!![]};return rp(_0x449ea8);}function startRefreshInterval(_0x5193b9){var _0x51087a=schedule[_0xfe9b('0x47')];if(_0x51087a[_0x5193b9['id']])clearInterval(_0x51087a[_0x5193b9['id']]);_0x51087a[_0x5193b9['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xfe9b('0x48')](this,{'id':_0x5193b9['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xfe9b('0x47')]=_0x51087a;}function startAllRefreshIntervals(){return db[_0xfe9b('0x3b')][_0xfe9b('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xfe9b('0x39')](function(_0x2eacc6){var _0x1ec486=_0x2eacc6[_0xfe9b('0x18')](function(_0x524df2){return refreshOauth2MicrosoftAccessToken(_0x524df2)[_0xfe9b('0x39')](function(_0x2a963f){startRefreshInterval(_0x2a963f);});});return Promise['all'](_0x1ec486);})['catch'](function(_0x5df103){var _0x5de00b=_0x5df103?util['inspect'](_0x5df103,{'showHidden':![],'depth':null}):'';logger[_0xfe9b('0x45')](_0xfe9b('0x4a'),_0x5de00b);});}module[_0xfe9b('0x4b')]={'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 5eec945..4fb0952 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 _0x6d5e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x27ffef,_0x591e3b){var _0x3286bd=function(_0x432c04){while(--_0x432c04){_0x27ffef['push'](_0x27ffef['shift']());}};_0x3286bd(++_0x591e3b);}(_0x6d5e,0x103));var _0xe6d5=function(_0xaeaeda,_0x118c45){_0xaeaeda=_0xaeaeda-0x0;var _0x120269=_0x6d5e[_0xaeaeda];return _0x120269;};'use strict';var _=require(_0xe6d5('0x0'));var util=require(_0xe6d5('0x1'));var moment=require(_0xe6d5('0x2'));var BPromise=require(_0xe6d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe6d5('0x4'));var db=require(_0xe6d5('0x5'))['db'];var utils=require(_0xe6d5('0x6'));var logger=require(_0xe6d5('0x7'))(_0xe6d5('0x8'));var config=require(_0xe6d5('0x9'));var jayson=require(_0xe6d5('0xa'));var client=jayson['client'][_0xe6d5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c0f87,_0x162375,_0x5cf296){return new BPromise(function(_0x572986,_0x52913e){return client['request'](_0x4c0f87,_0x5cf296)[_0xe6d5('0xc')](function(_0x65a619){logger[_0xe6d5('0xd')](_0xe6d5('0xe'),_0x162375,'request\x20sent');logger[_0xe6d5('0xf')](_0xe6d5('0x10'),_0x162375,_0xe6d5('0x11'),JSON['stringify'](_0x65a619));if(_0x65a619['error']){if(_0x65a619[_0xe6d5('0x12')][_0xe6d5('0x13')]===0x1f4){logger[_0xe6d5('0x12')](_0xe6d5('0xe'),_0x162375,_0x65a619[_0xe6d5('0x12')][_0xe6d5('0x14')]);return _0x52913e(_0x65a619[_0xe6d5('0x12')]['message']);}logger[_0xe6d5('0x12')](_0xe6d5('0xe'),_0x162375,_0x65a619[_0xe6d5('0x12')][_0xe6d5('0x14')]);return _0x572986(_0x65a619[_0xe6d5('0x12')][_0xe6d5('0x14')]);}else{logger[_0xe6d5('0xd')](_0xe6d5('0xe'),_0x162375,_0xe6d5('0x11'));_0x572986(_0x65a619['result'][_0xe6d5('0x14')]);}})[_0xe6d5('0x15')](function(_0x268ced){logger['error'](_0xe6d5('0xe'),_0x162375,_0x268ced);_0x52913e(_0x268ced);});});}
\ No newline at end of file
+var _0xc0d7=['rpc','../../config/environment','jayson/promise','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1cb2c5,_0x2589dc){var _0x1e373c=function(_0x55121a){while(--_0x55121a){_0x1cb2c5['push'](_0x1cb2c5['shift']());}};_0x1e373c(++_0x2589dc);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x16f0f4,_0xbd368b){_0x16f0f4=_0x16f0f4-0x0;var _0x3c3e20=_0xc0d7[_0x16f0f4];return _0x3c3e20;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7c0d('0x0'));var rs=require(_0x7c0d('0x1'));var fs=require('fs');var Redis=require(_0x7c0d('0x2'));var db=require(_0x7c0d('0x3'))['db'];var utils=require(_0x7c0d('0x4'));var logger=require(_0x7c0d('0x5'))(_0x7c0d('0x6'));var config=require(_0x7c0d('0x7'));var jayson=require(_0x7c0d('0x8'));var client=jayson['client'][_0x7c0d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14f205,_0x22101d,_0x3ffcff){return new BPromise(function(_0x5e6d16,_0x35c579){return client[_0x7c0d('0xa')](_0x14f205,_0x3ffcff)[_0x7c0d('0xb')](function(_0xfd38a0){logger['info'](_0x7c0d('0xc'),_0x22101d,_0x7c0d('0xd'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x22101d,_0x7c0d('0xd'),JSON[_0x7c0d('0xe')](_0xfd38a0));if(_0xfd38a0['error']){if(_0xfd38a0[_0x7c0d('0xf')][_0x7c0d('0x10')]===0x1f4){logger[_0x7c0d('0xf')](_0x7c0d('0xc'),_0x22101d,_0xfd38a0[_0x7c0d('0xf')][_0x7c0d('0x11')]);return _0x35c579(_0xfd38a0['error'][_0x7c0d('0x11')]);}logger[_0x7c0d('0xf')](_0x7c0d('0xc'),_0x22101d,_0xfd38a0[_0x7c0d('0xf')][_0x7c0d('0x11')]);return _0x5e6d16(_0xfd38a0[_0x7c0d('0xf')][_0x7c0d('0x11')]);}else{logger[_0x7c0d('0x12')]('CloudProvider,\x20%s,\x20%s',_0x22101d,_0x7c0d('0xd'));_0x5e6d16(_0xfd38a0['result'][_0x7c0d('0x11')]);}})['catch'](function(_0x2a8f3f){logger[_0x7c0d('0xf')](_0x7c0d('0xc'),_0x22101d,_0x2a8f3f);_0x35c579(_0x2a8f3f);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index e2700c5..e7f94c8 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 _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x5e9c45,_0x2ea79d){var _0x4af9fb=function(_0x50c8b4){while(--_0x50c8b4){_0x5e9c45['push'](_0x5e9c45['shift']());}};_0x4af9fb(++_0x2ea79d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x506ccb,_0x177378){var _0x390ec9=function(_0x5c5c4a){while(--_0x5c5c4a){_0x506ccb['push'](_0x506ccb['shift']());}};_0x390ec9(++_0x177378);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 8e61b81..d78fa58 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 _0xf418=['STRING','sequelize'];(function(_0x193878,_0x5eeff5){var _0x2ff8a0=function(_0x4e56aa){while(--_0x4e56aa){_0x193878['push'](_0x193878['shift']());}};_0x2ff8a0(++_0x5eeff5);}(_0xf418,0x1e3));var _0x8f41=function(_0x1cf7d0,_0x44cfa2){_0x1cf7d0=_0x1cf7d0-0x0;var _0x119a2a=_0xf418[_0x1cf7d0];return _0x119a2a;};'use strict';var Sequelize=require(_0x8f41('0x0'));module['exports']={'name':{'type':Sequelize[_0x8f41('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8f41('0x1')]},'companyId':{'type':Sequelize[_0x8f41('0x1')]},'website':{'type':Sequelize[_0x8f41('0x1')]},'phone':{'type':Sequelize[_0x8f41('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8f41('0x1')]},'street':{'type':Sequelize[_0x8f41('0x1')]},'postalCode':{'type':Sequelize[_0x8f41('0x1')]},'city':{'type':Sequelize[_0x8f41('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8f41('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x8f41('0x1')]},'sStreet':{'type':Sequelize[_0x8f41('0x1')]},'sPostalCode':{'type':Sequelize[_0x8f41('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc2ce=['STRING','name','sequelize','exports'];(function(_0x282582,_0x2ae191){var _0x85bc4e=function(_0x26be2b){while(--_0x26be2b){_0x282582['push'](_0x282582['shift']());}};_0x85bc4e(++_0x2ae191);}(_0xc2ce,0x82));var _0xec2c=function(_0x599c94,_0x464f0e){_0x599c94=_0x599c94-0x0;var _0x34e215=_0xc2ce[_0x599c94];return _0x34e215;};'use strict';var Sequelize=require(_0xec2c('0x0'));module[_0xec2c('0x1')]={'name':{'type':Sequelize[_0xec2c('0x2')],'unique':_0xec2c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xec2c('0x2')]},'companyId':{'type':Sequelize[_0xec2c('0x2')]},'website':{'type':Sequelize[_0xec2c('0x2')]},'phone':{'type':Sequelize[_0xec2c('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xec2c('0x2')]},'street':{'type':Sequelize[_0xec2c('0x2')]},'postalCode':{'type':Sequelize[_0xec2c('0x2')]},'city':{'type':Sequelize[_0xec2c('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xec2c('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xec2c('0x2')]},'sStreet':{'type':Sequelize[_0xec2c('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xec2c('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xec2c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index fdea6e2..2471a13 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 _0x60df=['rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','omit','ids','getContacts','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','get','destroy','end','error','stack','name','describe','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','CmCompany','includeAll','include','findAll','catch','show','params'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x60df,0x1be));var _0xf60d=function(_0x530f0b,_0x1b595f){_0x530f0b=_0x530f0b-0x0;var _0xf259cc=_0x60df[_0x530f0b];return _0xf259cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf60d('0x0'));var zipdir=require(_0xf60d('0x1'));var jsonpatch=require(_0xf60d('0x2'));var rp=require('request-promise');var moment=require(_0xf60d('0x3'));var BPromise=require(_0xf60d('0x4'));var Mustache=require(_0xf60d('0x5'));var util=require(_0xf60d('0x6'));var path=require(_0xf60d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf60d('0x8'));var fs=require('fs');var fs_extra=require(_0xf60d('0x9'));var _=require(_0xf60d('0xa'));var squel=require(_0xf60d('0xb'));var crypto=require(_0xf60d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf60d('0xd'));var toCsv=require(_0xf60d('0xe'));var querystring=require(_0xf60d('0xf'));var Papa=require(_0xf60d('0x10'));var Redis=require(_0xf60d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf60d('0x12'));var as=require(_0xf60d('0x13'));var hardwareService=require(_0xf60d('0x14'));var logger=require(_0xf60d('0x15'))(_0xf60d('0x16'));var utils=require(_0xf60d('0x17'));var config=require(_0xf60d('0x18'));var licenseUtil=require(_0xf60d('0x19'));var db=require(_0xf60d('0x1a'))['db'];function respondWithStatusCode(_0x3d64bf,_0x124ea6){_0x124ea6=_0x124ea6||0xcc;return function(_0x21098a){if(_0x21098a){return _0x3d64bf[_0xf60d('0x1b')](_0x124ea6);}return _0x3d64bf[_0xf60d('0x1c')](_0x124ea6)['end']();};}function respondWithResult(_0x5bf3c8,_0xfa8e0a){_0xfa8e0a=_0xfa8e0a||0xc8;return function(_0x1f0678){if(_0x1f0678){return _0x5bf3c8[_0xf60d('0x1c')](_0xfa8e0a)[_0xf60d('0x1d')](_0x1f0678);}};}function respondWithFilteredResult(_0x8f3b0d,_0x44718a){return function(_0x1ce453){if(_0x1ce453){var _0x48395e=typeof _0x44718a[_0xf60d('0x1e')]===_0xf60d('0x1f')&&typeof _0x44718a[_0xf60d('0x20')]===_0xf60d('0x1f');var _0x4f8e9a=_0x1ce453[_0xf60d('0x21')];var _0x2391b0=_0x48395e?0x0:_0x44718a[_0xf60d('0x1e')];var _0x252d6b=_0x48395e?_0x1ce453[_0xf60d('0x21')]:_0x44718a[_0xf60d('0x1e')]+_0x44718a[_0xf60d('0x20')];var _0x40964e;if(_0x252d6b>=_0x4f8e9a){_0x252d6b=_0x4f8e9a;_0x40964e=0xc8;}else{_0x40964e=0xce;}_0x8f3b0d[_0xf60d('0x1c')](_0x40964e);return _0x8f3b0d[_0xf60d('0x22')](_0xf60d('0x23'),_0x2391b0+'-'+_0x252d6b+'/'+_0x4f8e9a)[_0xf60d('0x1d')](_0x1ce453);}return null;};}function patchUpdates(_0x2a510e){return function(_0x38b772){try{jsonpatch['apply'](_0x38b772,_0x2a510e,!![]);}catch(_0x36b158){return BPromise[_0xf60d('0x24')](_0x36b158);}return _0x38b772['save']();};}function saveUpdates(_0x530a59,_0xfb7987){return function(_0x39027b){if(_0x39027b){return _0x39027b[_0xf60d('0x25')](_0x530a59)[_0xf60d('0x26')](function(_0x32260c){return _0x32260c;});}return null;};}function removeEntity(_0x5368c1,_0x2c8a7a){return function(_0x2e424b){if(_0x2e424b){return _0x2e424b['destroy']()[_0xf60d('0x26')](function(){var _0x4d79ce=_0x2e424b[_0xf60d('0x27')]({'plain':!![]});var _0x58efcb='Companies';return db['UserProfileResource'][_0xf60d('0x28')]({'where':{'type':_0x58efcb,'resourceId':_0x4d79ce['id']}})[_0xf60d('0x26')](function(){return _0x2e424b;});})['then'](function(){_0x5368c1['status'](0xcc)[_0xf60d('0x29')]();});}};}function handleEntityNotFound(_0x4a409b,_0xac312a){return function(_0x4cbc0d){if(!_0x4cbc0d){_0x4a409b[_0xf60d('0x1b')](0x194);}return _0x4cbc0d;};}function handleError(_0x415f13,_0x419b07){_0x419b07=_0x419b07||0x1f4;return function(_0x1aeff5){logger[_0xf60d('0x2a')](_0x1aeff5[_0xf60d('0x2b')]);if(_0x1aeff5[_0xf60d('0x2c')]){delete _0x1aeff5['name'];}_0x415f13[_0xf60d('0x1c')](_0x419b07)['send'](_0x1aeff5);};}exports['index']=function(_0x1ff822,_0x5ec511){var _0x9ea7e2={},_0x2b7e7b={},_0x3d1b57={'count':0x0,'rows':[]};return db['CmCompany'][_0xf60d('0x2d')]()[_0xf60d('0x26')](function(_0xd0036f){_0x2b7e7b[_0xf60d('0x2e')]=_[_0xf60d('0x2f')](_0xd0036f);_0x2b7e7b[_0xf60d('0x30')]=_[_0xf60d('0x2f')](_0x1ff822[_0xf60d('0x30')]);_0x2b7e7b[_0xf60d('0x31')]=_['intersection'](_0x2b7e7b['model'],_0x2b7e7b[_0xf60d('0x30')]);_0x9ea7e2[_0xf60d('0x32')]=_[_0xf60d('0x33')](_0x2b7e7b['model'],qs[_0xf60d('0x34')](_0x1ff822['query']['fields']));_0x9ea7e2[_0xf60d('0x32')]=_0x9ea7e2[_0xf60d('0x32')][_0xf60d('0x35')]?_0x9ea7e2['attributes']:_0x2b7e7b['model'];if(!_0x1ff822[_0xf60d('0x30')][_0xf60d('0x36')](_0xf60d('0x37'))){_0x9ea7e2['limit']=qs[_0xf60d('0x20')](_0x1ff822[_0xf60d('0x30')][_0xf60d('0x20')]);_0x9ea7e2[_0xf60d('0x1e')]=qs[_0xf60d('0x1e')](_0x1ff822[_0xf60d('0x30')][_0xf60d('0x1e')]);}_0x9ea7e2[_0xf60d('0x38')]=qs[_0xf60d('0x39')](_0x1ff822[_0xf60d('0x30')][_0xf60d('0x39')]);_0x9ea7e2['where']=qs['filters'](_[_0xf60d('0x3a')](_0x1ff822[_0xf60d('0x30')],_0x2b7e7b[_0xf60d('0x31')]),_0xd0036f);if(_0x1ff822[_0xf60d('0x30')][_0xf60d('0x3b')]){_0x9ea7e2['where']=_[_0xf60d('0x3c')](_0x9ea7e2[_0xf60d('0x3d')],{'$or':_[_0xf60d('0x3e')](_0x9ea7e2[_0xf60d('0x32')],function(_0xd29b95){var _0x21b60c={};_0x21b60c[_0xd29b95]={'$like':'%'+_0x1ff822[_0xf60d('0x30')]['filter']+'%'};return _0x21b60c;})});}_0x9ea7e2=_[_0xf60d('0x3c')]({},_0x9ea7e2,_0x1ff822['options']);var _0x5497da={'where':_0x9ea7e2[_0xf60d('0x3d')]};return db[_0xf60d('0x3f')][_0xf60d('0x21')](_0x5497da)[_0xf60d('0x26')](function(_0x4e984e){_0x3d1b57[_0xf60d('0x21')]=_0x4e984e;if(_0x1ff822['query'][_0xf60d('0x40')]){_0x9ea7e2[_0xf60d('0x41')]=[{'all':!![]}];}return db[_0xf60d('0x3f')][_0xf60d('0x42')](_0x9ea7e2);})['then'](function(_0x3efdad){_0x3d1b57['rows']=_0x3efdad;return _0x3d1b57;})[_0xf60d('0x26')](respondWithFilteredResult(_0x5ec511,_0x9ea7e2))[_0xf60d('0x43')](handleError(_0x5ec511,null));})[_0xf60d('0x43')](handleError(_0x5ec511,null));};exports[_0xf60d('0x44')]=function(_0x25172f,_0x41684a){var _0x265e13={'raw':![],'where':{'id':_0x25172f[_0xf60d('0x45')]['id']}},_0x4afab2={};_0x4afab2[_0xf60d('0x2e')]=_[_0xf60d('0x2f')](db[_0xf60d('0x3f')][_0xf60d('0x46')]);_0x4afab2[_0xf60d('0x30')]=_['keys'](_0x25172f[_0xf60d('0x30')]);_0x4afab2[_0xf60d('0x31')]=_[_0xf60d('0x33')](_0x4afab2[_0xf60d('0x2e')],_0x4afab2[_0xf60d('0x30')]);_0x265e13[_0xf60d('0x32')]=_['intersection'](_0x4afab2['model'],qs[_0xf60d('0x34')](_0x25172f['query']['fields']));_0x265e13['attributes']=_0x265e13[_0xf60d('0x32')][_0xf60d('0x35')]?_0x265e13[_0xf60d('0x32')]:_0x4afab2[_0xf60d('0x2e')];if(_0x25172f[_0xf60d('0x30')][_0xf60d('0x40')]){_0x265e13[_0xf60d('0x41')]=[{'all':!![]}];}_0x265e13=_['merge']({},_0x265e13,_0x25172f[_0xf60d('0x47')]);return db['CmCompany'][_0xf60d('0x48')](_0x265e13)[_0xf60d('0x26')](handleEntityNotFound(_0x41684a,null))['then'](respondWithResult(_0x41684a,null))['catch'](handleError(_0x41684a,null));};exports[_0xf60d('0x49')]=function(_0x3fc99c,_0x5b7b1e){return db[_0xf60d('0x3f')]['create'](_0x3fc99c[_0xf60d('0x4a')],{})[_0xf60d('0x26')](function(_0x54733a){var _0x238d15=_0x3fc99c[_0xf60d('0x4b')][_0xf60d('0x27')]({'plain':!![]});if(!_0x238d15)throw new Error(_0xf60d('0x4c'));if(_0x238d15[_0xf60d('0x4d')]===_0xf60d('0x4b')){var _0x30847d=_0x54733a[_0xf60d('0x27')]({'plain':!![]});var _0x3c876d=_0xf60d('0x4e');return db[_0xf60d('0x4f')][_0xf60d('0x48')]({'where':{'name':_0x3c876d,'userProfileId':_0x238d15[_0xf60d('0x50')]},'raw':!![]})[_0xf60d('0x26')](function(_0x54bb2e){if(_0x54bb2e&&_0x54bb2e['autoAssociation']===0x0){return db['UserProfileResource'][_0xf60d('0x49')]({'name':_0x30847d[_0xf60d('0x2c')],'resourceId':_0x30847d['id'],'type':_0x54bb2e[_0xf60d('0x2c')],'sectionId':_0x54bb2e['id']},{})[_0xf60d('0x26')](function(){return _0x54733a;});}else{return _0x54733a;}})[_0xf60d('0x43')](function(_0xb495a){logger[_0xf60d('0x2a')](_0xf60d('0x51'),_0xb495a);throw _0xb495a;});}return _0x54733a;})['then'](respondWithResult(_0x5b7b1e,0xc9))[_0xf60d('0x43')](handleError(_0x5b7b1e,null));};exports[_0xf60d('0x25')]=function(_0x40b233,_0x5da4e1){if(_0x40b233[_0xf60d('0x4a')]['id']){delete _0x40b233['body']['id'];}return db['CmCompany']['find']({'where':{'id':_0x40b233[_0xf60d('0x45')]['id']}})[_0xf60d('0x26')](handleEntityNotFound(_0x5da4e1,null))[_0xf60d('0x26')](saveUpdates(_0x40b233[_0xf60d('0x4a')],null))[_0xf60d('0x26')](respondWithResult(_0x5da4e1,null))['catch'](handleError(_0x5da4e1,null));};exports[_0xf60d('0x28')]=function(_0x1e75a5,_0x2bce97){return db[_0xf60d('0x3f')][_0xf60d('0x48')]({'where':{'id':_0x1e75a5[_0xf60d('0x45')]['id']}})[_0xf60d('0x26')](handleEntityNotFound(_0x2bce97,null))[_0xf60d('0x26')](removeEntity(_0x2bce97,null))[_0xf60d('0x43')](handleError(_0x2bce97,null));};exports['describe']=function(_0x42780e,_0x391015){return db[_0xf60d('0x3f')]['describe']()[_0xf60d('0x26')](respondWithResult(_0x391015,null))['catch'](handleError(_0x391015,null));};exports[_0xf60d('0x52')]=function(_0x21f492,_0x55e118,_0xb466b3){return db['CmContact'][_0xf60d('0x48')]({'where':{'id':_0x21f492[_0xf60d('0x45')]['id']}})['then'](handleEntityNotFound(_0x55e118,null))['then'](function(_0x4b7493){if(_0x4b7493){return _0x4b7493[_0xf60d('0x52')](_0x21f492[_0xf60d('0x4a')]['ids'],_[_0xf60d('0x53')](_0x21f492['body'],[_0xf60d('0x54'),'id'])||{});}})['then'](respondWithResult(_0x55e118,null))['catch'](handleError(_0x55e118,null));};exports[_0xf60d('0x55')]=function(_0xbe920e,_0x2b7158,_0x501601){var _0x31f302={};var _0x5cf88d={};var _0x652036;var _0x195406;return db['CmCompany']['findOne']({'where':{'id':_0xbe920e['params']['id']}})[_0xf60d('0x26')](handleEntityNotFound(_0x2b7158,null))['then'](function(_0x203240){if(_0x203240){_0x652036=_0x203240;_0x5cf88d['model']=_[_0xf60d('0x2f')](db['CmContact'][_0xf60d('0x46')]);_0x5cf88d[_0xf60d('0x30')]=_[_0xf60d('0x2f')](_0xbe920e['query']);_0x5cf88d['filters']=_[_0xf60d('0x33')](_0x5cf88d['model'],_0x5cf88d[_0xf60d('0x30')]);_0x31f302[_0xf60d('0x32')]=_[_0xf60d('0x33')](_0x5cf88d[_0xf60d('0x2e')],qs[_0xf60d('0x34')](_0xbe920e['query'][_0xf60d('0x34')]));_0x31f302[_0xf60d('0x32')]=_0x31f302['attributes'][_0xf60d('0x35')]?_0x31f302[_0xf60d('0x32')]:_0x5cf88d['model'];_0x31f302[_0xf60d('0x38')]=qs[_0xf60d('0x39')](_0xbe920e[_0xf60d('0x30')][_0xf60d('0x39')]);_0x31f302[_0xf60d('0x3d')]=qs[_0xf60d('0x31')](_[_0xf60d('0x3a')](_0xbe920e[_0xf60d('0x30')],_0x5cf88d[_0xf60d('0x31')]));if(_0xbe920e[_0xf60d('0x30')][_0xf60d('0x3b')]){_0x31f302['where']=_[_0xf60d('0x3c')](_0x31f302[_0xf60d('0x3d')],{'$or':_[_0xf60d('0x3e')](_0x31f302[_0xf60d('0x32')],function(_0x2d5f10){var _0x42cee3={};_0x42cee3[_0x2d5f10]={'$like':'%'+_0xbe920e[_0xf60d('0x30')][_0xf60d('0x3b')]+'%'};return _0x42cee3;})});}_0x31f302=_[_0xf60d('0x3c')]({},_0x31f302,_0xbe920e[_0xf60d('0x47')]);return _0x652036['getContacts'](_0x31f302);}})[_0xf60d('0x26')](function(_0x35ef84){if(_0x35ef84){_0x195406=_0x35ef84[_0xf60d('0x35')];if(!_0xbe920e[_0xf60d('0x30')][_0xf60d('0x36')](_0xf60d('0x37'))){_0x31f302[_0xf60d('0x20')]=qs[_0xf60d('0x20')](_0xbe920e[_0xf60d('0x30')][_0xf60d('0x20')]);_0x31f302[_0xf60d('0x1e')]=qs['offset'](_0xbe920e['query'][_0xf60d('0x1e')]);}return _0x652036[_0xf60d('0x55')](_0x31f302);}})[_0xf60d('0x26')](function(_0x3eee4b){if(_0x3eee4b){return _0x3eee4b?{'count':_0x195406,'rows':_0x3eee4b}:null;}})[_0xf60d('0x26')](respondWithResult(_0x2b7158,null))[_0xf60d('0x43')](handleError(_0x2b7158,null));};
\ No newline at end of file
+var _0x1667=['catch','show','params','keys','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','omit','getContacts','map','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','CmCompany','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows'];(function(_0x4947f0,_0x138314){var _0x11ad58=function(_0x563cf1){while(--_0x563cf1){_0x4947f0['push'](_0x4947f0['shift']());}};_0x11ad58(++_0x138314);}(_0x1667,0x1c9));var _0x7166=function(_0x36d203,_0x3653f3){_0x36d203=_0x36d203-0x0;var _0x2f9e62=_0x1667[_0x36d203];return _0x2f9e62;};'use strict';var emlformat=require(_0x7166('0x0'));var rimraf=require(_0x7166('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7166('0x2'));var moment=require('moment');var BPromise=require(_0x7166('0x3'));var Mustache=require(_0x7166('0x4'));var util=require('util');var path=require(_0x7166('0x5'));var sox=require(_0x7166('0x6'));var csv=require('to-csv');var ejs=require(_0x7166('0x7'));var fs=require('fs');var fs_extra=require(_0x7166('0x8'));var _=require('lodash');var squel=require(_0x7166('0x9'));var crypto=require(_0x7166('0xa'));var jsforce=require(_0x7166('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7166('0xc'));var querystring=require(_0x7166('0xd'));var Papa=require(_0x7166('0xe'));var Redis=require('ioredis');var authService=require(_0x7166('0xf'));var qs=require(_0x7166('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7166('0x11'));var logger=require(_0x7166('0x12'))(_0x7166('0x13'));var utils=require('../../config/utils');var config=require(_0x7166('0x14'));var licenseUtil=require(_0x7166('0x15'));var db=require(_0x7166('0x16'))['db'];function respondWithStatusCode(_0x2363e2,_0x4a36a1){_0x4a36a1=_0x4a36a1||0xcc;return function(_0x502b3f){if(_0x502b3f){return _0x2363e2[_0x7166('0x17')](_0x4a36a1);}return _0x2363e2[_0x7166('0x18')](_0x4a36a1)[_0x7166('0x19')]();};}function respondWithResult(_0x4b4ed6,_0x2e3e12){_0x2e3e12=_0x2e3e12||0xc8;return function(_0x1e343a){if(_0x1e343a){return _0x4b4ed6[_0x7166('0x18')](_0x2e3e12)[_0x7166('0x1a')](_0x1e343a);}};}function respondWithFilteredResult(_0x5f4378,_0x5c767a){return function(_0x283f3d){if(_0x283f3d){var _0x5ef5be=typeof _0x5c767a[_0x7166('0x1b')]===_0x7166('0x1c')&&typeof _0x5c767a[_0x7166('0x1d')]==='undefined';var _0x1b648e=_0x283f3d['count'];var _0x5edcb5=_0x5ef5be?0x0:_0x5c767a['offset'];var _0x3ccb43=_0x5ef5be?_0x283f3d[_0x7166('0x1e')]:_0x5c767a[_0x7166('0x1b')]+_0x5c767a[_0x7166('0x1d')];var _0x2ae971;if(_0x3ccb43>=_0x1b648e){_0x3ccb43=_0x1b648e;_0x2ae971=0xc8;}else{_0x2ae971=0xce;}_0x5f4378[_0x7166('0x18')](_0x2ae971);return _0x5f4378[_0x7166('0x1f')](_0x7166('0x20'),_0x5edcb5+'-'+_0x3ccb43+'/'+_0x1b648e)[_0x7166('0x1a')](_0x283f3d);}return null;};}function patchUpdates(_0x2fa327){return function(_0x4a8280){try{jsonpatch[_0x7166('0x21')](_0x4a8280,_0x2fa327,!![]);}catch(_0x59e997){return BPromise['reject'](_0x59e997);}return _0x4a8280['save']();};}function saveUpdates(_0x177bc1,_0x509f02){return function(_0x35e677){if(_0x35e677){return _0x35e677[_0x7166('0x22')](_0x177bc1)[_0x7166('0x23')](function(_0x21a696){return _0x21a696;});}return null;};}function removeEntity(_0x997c0c,_0xdcca07){return function(_0x1e02fb){if(_0x1e02fb){return _0x1e02fb[_0x7166('0x24')]()[_0x7166('0x23')](function(){var _0x112e7e=_0x1e02fb[_0x7166('0x25')]({'plain':!![]});var _0x524981=_0x7166('0x26');return db[_0x7166('0x27')]['destroy']({'where':{'type':_0x524981,'resourceId':_0x112e7e['id']}})[_0x7166('0x23')](function(){return _0x1e02fb;});})[_0x7166('0x23')](function(){_0x997c0c[_0x7166('0x18')](0xcc)[_0x7166('0x19')]();});}};}function handleEntityNotFound(_0x582f67,_0x480159){return function(_0x1282d4){if(!_0x1282d4){_0x582f67[_0x7166('0x17')](0x194);}return _0x1282d4;};}function handleError(_0x40b93c,_0x41d32d){_0x41d32d=_0x41d32d||0x1f4;return function(_0x10da9d){logger[_0x7166('0x28')](_0x10da9d[_0x7166('0x29')]);if(_0x10da9d[_0x7166('0x2a')]){delete _0x10da9d[_0x7166('0x2a')];}_0x40b93c['status'](_0x41d32d)[_0x7166('0x2b')](_0x10da9d);};}exports['index']=function(_0x2eed80,_0x445ab4){var _0xc861ed={},_0x429376={},_0x4347d0={'count':0x0,'rows':[]};return db[_0x7166('0x2c')]['describe']()['then'](function(_0x2a569a){_0x429376['model']=_['keys'](_0x2a569a);_0x429376[_0x7166('0x2d')]=_['keys'](_0x2eed80[_0x7166('0x2d')]);_0x429376[_0x7166('0x2e')]=_[_0x7166('0x2f')](_0x429376[_0x7166('0x30')],_0x429376[_0x7166('0x2d')]);_0xc861ed[_0x7166('0x31')]=_['intersection'](_0x429376[_0x7166('0x30')],qs[_0x7166('0x32')](_0x2eed80['query'][_0x7166('0x32')]));_0xc861ed[_0x7166('0x31')]=_0xc861ed['attributes'][_0x7166('0x33')]?_0xc861ed[_0x7166('0x31')]:_0x429376[_0x7166('0x30')];if(!_0x2eed80[_0x7166('0x2d')][_0x7166('0x34')](_0x7166('0x35'))){_0xc861ed['limit']=qs['limit'](_0x2eed80[_0x7166('0x2d')][_0x7166('0x1d')]);_0xc861ed[_0x7166('0x1b')]=qs['offset'](_0x2eed80[_0x7166('0x2d')][_0x7166('0x1b')]);}_0xc861ed[_0x7166('0x36')]=qs[_0x7166('0x37')](_0x2eed80['query']['sort']);_0xc861ed['where']=qs[_0x7166('0x2e')](_[_0x7166('0x38')](_0x2eed80['query'],_0x429376[_0x7166('0x2e')]),_0x2a569a);if(_0x2eed80['query'][_0x7166('0x39')]){_0xc861ed[_0x7166('0x3a')]=_[_0x7166('0x3b')](_0xc861ed['where'],{'$or':_['map'](_0xc861ed['attributes'],function(_0xc7f79){var _0x30ac62={};_0x30ac62[_0xc7f79]={'$like':'%'+_0x2eed80[_0x7166('0x2d')][_0x7166('0x39')]+'%'};return _0x30ac62;})});}_0xc861ed=_['merge']({},_0xc861ed,_0x2eed80[_0x7166('0x3c')]);var _0x1fa9d9={'where':_0xc861ed[_0x7166('0x3a')]};return db[_0x7166('0x2c')][_0x7166('0x1e')](_0x1fa9d9)['then'](function(_0x53b774){_0x4347d0['count']=_0x53b774;if(_0x2eed80[_0x7166('0x2d')][_0x7166('0x3d')]){_0xc861ed[_0x7166('0x3e')]=[{'all':!![]}];}return db[_0x7166('0x2c')][_0x7166('0x3f')](_0xc861ed);})[_0x7166('0x23')](function(_0x5547cf){_0x4347d0[_0x7166('0x40')]=_0x5547cf;return _0x4347d0;})[_0x7166('0x23')](respondWithFilteredResult(_0x445ab4,_0xc861ed))[_0x7166('0x41')](handleError(_0x445ab4,null));})[_0x7166('0x41')](handleError(_0x445ab4,null));};exports[_0x7166('0x42')]=function(_0xb6a3fd,_0x41537b){var _0x56cd93={'raw':![],'where':{'id':_0xb6a3fd[_0x7166('0x43')]['id']}},_0xf49a7e={};_0xf49a7e[_0x7166('0x30')]=_[_0x7166('0x44')](db[_0x7166('0x2c')][_0x7166('0x45')]);_0xf49a7e[_0x7166('0x2d')]=_[_0x7166('0x44')](_0xb6a3fd[_0x7166('0x2d')]);_0xf49a7e['filters']=_[_0x7166('0x2f')](_0xf49a7e[_0x7166('0x30')],_0xf49a7e[_0x7166('0x2d')]);_0x56cd93[_0x7166('0x31')]=_[_0x7166('0x2f')](_0xf49a7e[_0x7166('0x30')],qs[_0x7166('0x32')](_0xb6a3fd[_0x7166('0x2d')][_0x7166('0x32')]));_0x56cd93['attributes']=_0x56cd93['attributes'][_0x7166('0x33')]?_0x56cd93['attributes']:_0xf49a7e[_0x7166('0x30')];if(_0xb6a3fd['query'][_0x7166('0x3d')]){_0x56cd93[_0x7166('0x3e')]=[{'all':!![]}];}_0x56cd93=_['merge']({},_0x56cd93,_0xb6a3fd[_0x7166('0x3c')]);return db['CmCompany']['find'](_0x56cd93)[_0x7166('0x23')](handleEntityNotFound(_0x41537b,null))['then'](respondWithResult(_0x41537b,null))[_0x7166('0x41')](handleError(_0x41537b,null));};exports['create']=function(_0x2484ce,_0x4eaecd){return db[_0x7166('0x2c')][_0x7166('0x46')](_0x2484ce[_0x7166('0x47')],{})['then'](function(_0x3fdf49){var _0x48ef57=_0x2484ce['user']['get']({'plain':!![]});if(!_0x48ef57)throw new Error(_0x7166('0x48'));if(_0x48ef57[_0x7166('0x49')]===_0x7166('0x4a')){var _0x404bf3=_0x3fdf49[_0x7166('0x25')]({'plain':!![]});var _0x558e59=_0x7166('0x26');return db[_0x7166('0x4b')][_0x7166('0x4c')]({'where':{'name':_0x558e59,'userProfileId':_0x48ef57[_0x7166('0x4d')]},'raw':!![]})[_0x7166('0x23')](function(_0x58b118){if(_0x58b118&&_0x58b118[_0x7166('0x4e')]===0x0){return db[_0x7166('0x27')][_0x7166('0x46')]({'name':_0x404bf3[_0x7166('0x2a')],'resourceId':_0x404bf3['id'],'type':_0x58b118[_0x7166('0x2a')],'sectionId':_0x58b118['id']},{})[_0x7166('0x23')](function(){return _0x3fdf49;});}else{return _0x3fdf49;}})['catch'](function(_0x3f5918){logger[_0x7166('0x28')](_0x7166('0x4f'),_0x3f5918);throw _0x3f5918;});}return _0x3fdf49;})[_0x7166('0x23')](respondWithResult(_0x4eaecd,0xc9))[_0x7166('0x41')](handleError(_0x4eaecd,null));};exports[_0x7166('0x22')]=function(_0x506ca0,_0x436d14){if(_0x506ca0['body']['id']){delete _0x506ca0['body']['id'];}return db[_0x7166('0x2c')][_0x7166('0x4c')]({'where':{'id':_0x506ca0[_0x7166('0x43')]['id']}})['then'](handleEntityNotFound(_0x436d14,null))['then'](saveUpdates(_0x506ca0['body'],null))[_0x7166('0x23')](respondWithResult(_0x436d14,null))[_0x7166('0x41')](handleError(_0x436d14,null));};exports[_0x7166('0x24')]=function(_0x1ac159,_0x27fe44){return db[_0x7166('0x2c')][_0x7166('0x4c')]({'where':{'id':_0x1ac159[_0x7166('0x43')]['id']}})[_0x7166('0x23')](handleEntityNotFound(_0x27fe44,null))[_0x7166('0x23')](removeEntity(_0x27fe44,null))['catch'](handleError(_0x27fe44,null));};exports['describe']=function(_0x5ba9eb,_0x29fb78){return db[_0x7166('0x2c')][_0x7166('0x50')]()[_0x7166('0x23')](respondWithResult(_0x29fb78,null))[_0x7166('0x41')](handleError(_0x29fb78,null));};exports[_0x7166('0x51')]=function(_0xc87254,_0x2348a7,_0x20d975){return db[_0x7166('0x52')][_0x7166('0x4c')]({'where':{'id':_0xc87254[_0x7166('0x43')]['id']}})['then'](handleEntityNotFound(_0x2348a7,null))[_0x7166('0x23')](function(_0x6beafe){if(_0x6beafe){return _0x6beafe[_0x7166('0x51')](_0xc87254[_0x7166('0x47')][_0x7166('0x53')],_[_0x7166('0x54')](_0xc87254['body'],[_0x7166('0x53'),'id'])||{});}})[_0x7166('0x23')](respondWithResult(_0x2348a7,null))[_0x7166('0x41')](handleError(_0x2348a7,null));};exports[_0x7166('0x55')]=function(_0x4c971a,_0x2ca3b9,_0x4d866c){var _0x56d3eb={};var _0x1ccef1={};var _0x116b43;var _0x4dd486;return db[_0x7166('0x2c')]['findOne']({'where':{'id':_0x4c971a[_0x7166('0x43')]['id']}})[_0x7166('0x23')](handleEntityNotFound(_0x2ca3b9,null))[_0x7166('0x23')](function(_0x2a2451){if(_0x2a2451){_0x116b43=_0x2a2451;_0x1ccef1[_0x7166('0x30')]=_[_0x7166('0x44')](db[_0x7166('0x52')][_0x7166('0x45')]);_0x1ccef1[_0x7166('0x2d')]=_['keys'](_0x4c971a['query']);_0x1ccef1[_0x7166('0x2e')]=_[_0x7166('0x2f')](_0x1ccef1[_0x7166('0x30')],_0x1ccef1[_0x7166('0x2d')]);_0x56d3eb[_0x7166('0x31')]=_['intersection'](_0x1ccef1['model'],qs[_0x7166('0x32')](_0x4c971a['query'][_0x7166('0x32')]));_0x56d3eb[_0x7166('0x31')]=_0x56d3eb[_0x7166('0x31')][_0x7166('0x33')]?_0x56d3eb[_0x7166('0x31')]:_0x1ccef1['model'];_0x56d3eb[_0x7166('0x36')]=qs[_0x7166('0x37')](_0x4c971a[_0x7166('0x2d')][_0x7166('0x37')]);_0x56d3eb[_0x7166('0x3a')]=qs['filters'](_[_0x7166('0x38')](_0x4c971a[_0x7166('0x2d')],_0x1ccef1[_0x7166('0x2e')]));if(_0x4c971a[_0x7166('0x2d')][_0x7166('0x39')]){_0x56d3eb[_0x7166('0x3a')]=_[_0x7166('0x3b')](_0x56d3eb[_0x7166('0x3a')],{'$or':_[_0x7166('0x56')](_0x56d3eb[_0x7166('0x31')],function(_0x16d0b3){var _0x4a669b={};_0x4a669b[_0x16d0b3]={'$like':'%'+_0x4c971a[_0x7166('0x2d')][_0x7166('0x39')]+'%'};return _0x4a669b;})});}_0x56d3eb=_[_0x7166('0x3b')]({},_0x56d3eb,_0x4c971a[_0x7166('0x3c')]);return _0x116b43['getContacts'](_0x56d3eb);}})[_0x7166('0x23')](function(_0x50ead0){if(_0x50ead0){_0x4dd486=_0x50ead0['length'];if(!_0x4c971a[_0x7166('0x2d')][_0x7166('0x34')](_0x7166('0x35'))){_0x56d3eb[_0x7166('0x1d')]=qs[_0x7166('0x1d')](_0x4c971a[_0x7166('0x2d')]['limit']);_0x56d3eb[_0x7166('0x1b')]=qs[_0x7166('0x1b')](_0x4c971a[_0x7166('0x2d')][_0x7166('0x1b')]);}return _0x116b43[_0x7166('0x55')](_0x56d3eb);}})[_0x7166('0x23')](function(_0x2477c8){if(_0x2477c8){return _0x2477c8?{'count':_0x4dd486,'rows':_0x2477c8}:null;}})[_0x7166('0x23')](respondWithResult(_0x2ca3b9,null))['catch'](handleError(_0x2ca3b9,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index ea4d060..12e30a0 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 _0x94ce=['api','moment','bluebird','path','rimraf','exports','define','CmCompany','lodash','util'];(function(_0x312629,_0x39a7bd){var _0x587888=function(_0x40e7a1){while(--_0x40e7a1){_0x312629['push'](_0x312629['shift']());}};_0x587888(++_0x39a7bd);}(_0x94ce,0x148));var _0xe94c=function(_0x52ed18,_0x17d3de){_0x52ed18=_0x52ed18-0x0;var _0x8be0b5=_0x94ce[_0x52ed18];return _0x8be0b5;};'use strict';var _=require(_0xe94c('0x0'));var util=require(_0xe94c('0x1'));var logger=require('../../config/logger')(_0xe94c('0x2'));var moment=require(_0xe94c('0x3'));var BPromise=require(_0xe94c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe94c('0x5'));var rimraf=require(_0xe94c('0x6'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0xe94c('0x7')]=function(_0x4b9ccd,_0x32be22){return _0x4b9ccd[_0xe94c('0x8')](_0xe94c('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x401c=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','CmCompany','cm_companies','lodash'];(function(_0x251e8c,_0x277c33){var _0x1e0c1d=function(_0x20b89c){while(--_0x20b89c){_0x251e8c['push'](_0x251e8c['shift']());}};_0x1e0c1d(++_0x277c33);}(_0x401c,0xd7));var _0xc401=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x401c[_0x4bb66f];return _0xf2772f;};'use strict';var _=require(_0xc401('0x0'));var util=require('util');var logger=require(_0xc401('0x1'))(_0xc401('0x2'));var moment=require(_0xc401('0x3'));var BPromise=require('bluebird');var rp=require(_0xc401('0x4'));var fs=require('fs');var path=require(_0xc401('0x5'));var rimraf=require(_0xc401('0x6'));var config=require(_0xc401('0x7'));var attributes=require('./cmCompany.attributes');module[_0xc401('0x8')]=function(_0x33520e,_0x1cd3c8){return _0x33520e[_0xc401('0x9')](_0xc401('0xa'),attributes,{'tableName':_0xc401('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 76b4f62..7cbe78b 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 _0xb079=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment'];(function(_0x131316,_0x7e6d94){var _0x466ada=function(_0x47cfad){while(--_0x47cfad){_0x131316['push'](_0x131316['shift']());}};_0x466ada(++_0x7e6d94);}(_0xb079,0xda));var _0x9b07=function(_0x441853,_0x4abb60){_0x441853=_0x441853-0x0;var _0x3780e5=_0xb079[_0x441853];return _0x3780e5;};'use strict';var _=require('lodash');var util=require(_0x9b07('0x0'));var moment=require(_0x9b07('0x1'));var BPromise=require('bluebird');var rs=require(_0x9b07('0x2'));var fs=require('fs');var Redis=require(_0x9b07('0x3'));var db=require(_0x9b07('0x4'))['db'];var utils=require(_0x9b07('0x5'));var logger=require(_0x9b07('0x6'))('rpc');var config=require(_0x9b07('0x7'));var jayson=require(_0x9b07('0x8'));var client=jayson[_0x9b07('0x9')][_0x9b07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x564d05,_0x254601,_0x13d5bc){return new BPromise(function(_0x44cdba,_0x55b269){return client[_0x9b07('0xb')](_0x564d05,_0x13d5bc)['then'](function(_0x5b29b8){logger[_0x9b07('0xc')](_0x9b07('0xd'),_0x254601,'request\x20sent');logger[_0x9b07('0xe')](_0x9b07('0xf'),_0x254601,_0x9b07('0x10'),JSON[_0x9b07('0x11')](_0x5b29b8));if(_0x5b29b8['error']){if(_0x5b29b8[_0x9b07('0x12')][_0x9b07('0x13')]===0x1f4){logger[_0x9b07('0x12')](_0x9b07('0xd'),_0x254601,_0x5b29b8['error'][_0x9b07('0x14')]);return _0x55b269(_0x5b29b8[_0x9b07('0x12')]['message']);}logger[_0x9b07('0x12')](_0x9b07('0xd'),_0x254601,_0x5b29b8[_0x9b07('0x12')]['message']);return _0x44cdba(_0x5b29b8[_0x9b07('0x12')]['message']);}else{logger[_0x9b07('0xc')](_0x9b07('0xd'),_0x254601,_0x9b07('0x10'));_0x44cdba(_0x5b29b8[_0x9b07('0x15')][_0x9b07('0x14')]);}})['catch'](function(_0x120d17){logger['error'](_0x9b07('0xd'),_0x254601,_0x120d17);_0x55b269(_0x120d17);});});}
\ No newline at end of file
+var _0xce42=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x114fb8,_0x135c70){var _0x1901c7=function(_0x31b3a3){while(--_0x31b3a3){_0x114fb8['push'](_0x114fb8['shift']());}};_0x1901c7(++_0x135c70);}(_0xce42,0xe9));var _0x2ce4=function(_0x38a54d,_0x132fde){_0x38a54d=_0x38a54d-0x0;var _0x2d1b0e=_0xce42[_0x38a54d];return _0x2d1b0e;};'use strict';var _=require(_0x2ce4('0x0'));var util=require(_0x2ce4('0x1'));var moment=require(_0x2ce4('0x2'));var BPromise=require(_0x2ce4('0x3'));var rs=require(_0x2ce4('0x4'));var fs=require('fs');var Redis=require(_0x2ce4('0x5'));var db=require(_0x2ce4('0x6'))['db'];var utils=require(_0x2ce4('0x7'));var logger=require(_0x2ce4('0x8'))(_0x2ce4('0x9'));var config=require(_0x2ce4('0xa'));var jayson=require(_0x2ce4('0xb'));var client=jayson[_0x2ce4('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c8b54,_0x559987,_0xa745e0){return new BPromise(function(_0x2a481e,_0x1c29b2){return client['request'](_0x3c8b54,_0xa745e0)[_0x2ce4('0xd')](function(_0x5db144){logger[_0x2ce4('0xe')](_0x2ce4('0xf'),_0x559987,_0x2ce4('0x10'));logger[_0x2ce4('0x11')](_0x2ce4('0x12'),_0x559987,_0x2ce4('0x10'),JSON['stringify'](_0x5db144));if(_0x5db144[_0x2ce4('0x13')]){if(_0x5db144['error'][_0x2ce4('0x14')]===0x1f4){logger[_0x2ce4('0x13')](_0x2ce4('0xf'),_0x559987,_0x5db144['error'][_0x2ce4('0x15')]);return _0x1c29b2(_0x5db144['error'][_0x2ce4('0x15')]);}logger[_0x2ce4('0x13')](_0x2ce4('0xf'),_0x559987,_0x5db144['error']['message']);return _0x2a481e(_0x5db144[_0x2ce4('0x13')][_0x2ce4('0x15')]);}else{logger[_0x2ce4('0xe')](_0x2ce4('0xf'),_0x559987,_0x2ce4('0x10'));_0x2a481e(_0x5db144[_0x2ce4('0x16')]['message']);}})[_0x2ce4('0x17')](function(_0x2958d3){logger[_0x2ce4('0x13')]('CmCompany,\x20%s,\x20%s',_0x559987,_0x2958d3);_0x1c29b2(_0x2958d3);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 3a39052..3f27de4 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 _0x0c61=['Router','../../components/auth/service','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','delete','exports','util','express'];(function(_0x48b267,_0x169fc4){var _0x55cc70=function(_0x3cc7f7){while(--_0x3cc7f7){_0x48b267['push'](_0x48b267['shift']());}};_0x55cc70(++_0x169fc4);}(_0x0c61,0x70));var _0x10c6=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0x0c61[_0x2c0be1];return _0x3d4bd2;};'use strict';var multer=require('multer');var util=require(_0x10c6('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x10c6('0x1'));var router=express[_0x10c6('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x10c6('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x10c6('0x4'));router[_0x10c6('0x5')]('/',auth[_0x10c6('0x6')](),controller[_0x10c6('0x7')]);router[_0x10c6('0x5')](_0x10c6('0x8'),auth['isAuthenticated'](),controller[_0x10c6('0x9')]);router[_0x10c6('0x5')](_0x10c6('0xa'),auth['isAuthenticated'](),controller[_0x10c6('0xb')]);router[_0x10c6('0x5')](_0x10c6('0xc'),auth[_0x10c6('0x6')](),controller[_0x10c6('0xd')]);router[_0x10c6('0xe')]('/',auth['isAuthenticated'](),controller[_0x10c6('0xf')]);router[_0x10c6('0xe')](_0x10c6('0xc'),auth[_0x10c6('0x6')](),controller[_0x10c6('0x10')]);router['put'](_0x10c6('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x10c6('0x11')]('/:id',auth[_0x10c6('0x6')](),controller['destroy']);module[_0x10c6('0x12')]=router;
\ No newline at end of file
+var _0x8209=['put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','addContacts'];(function(_0x24351f,_0x5dc93e){var _0x5493d7=function(_0x668614){while(--_0x668614){_0x24351f['push'](_0x24351f['shift']());}};_0x5493d7(++_0x5dc93e);}(_0x8209,0x183));var _0x9820=function(_0x54efce,_0x443cb7){_0x54efce=_0x54efce-0x0;var _0x556f1c=_0x8209[_0x54efce];return _0x556f1c;};'use strict';var multer=require(_0x9820('0x0'));var util=require(_0x9820('0x1'));var path=require(_0x9820('0x2'));var timeout=require(_0x9820('0x3'));var express=require(_0x9820('0x4'));var router=express[_0x9820('0x5')]();var fs_extra=require(_0x9820('0x6'));var auth=require(_0x9820('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9820('0x8'));var controller=require(_0x9820('0x9'));router[_0x9820('0xa')]('/',auth[_0x9820('0xb')](),controller[_0x9820('0xc')]);router[_0x9820('0xa')](_0x9820('0xd'),auth[_0x9820('0xb')](),controller[_0x9820('0xe')]);router[_0x9820('0xa')](_0x9820('0xf'),auth[_0x9820('0xb')](),controller[_0x9820('0x10')]);router[_0x9820('0xa')](_0x9820('0x11'),auth['isAuthenticated'](),controller[_0x9820('0x12')]);router[_0x9820('0x13')]('/',auth[_0x9820('0xb')](),controller['create']);router[_0x9820('0x13')]('/:id/contacts',auth[_0x9820('0xb')](),controller[_0x9820('0x14')]);router[_0x9820('0x15')](_0x9820('0xf'),auth[_0x9820('0xb')](),controller[_0x9820('0x16')]);router['delete']('/:id',auth[_0x9820('0xb')](),controller['destroy']);module[_0x9820('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 1017931..3c570f9 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 _0x234c=['UNSIGNED','DATE','NOW','lodash','sequelize','STRING','TEXT','INTEGER'];(function(_0xfe1add,_0x30fec7){var _0x8ed176=function(_0x47d151){while(--_0x47d151){_0xfe1add['push'](_0xfe1add['shift']());}};_0x8ed176(++_0x30fec7);}(_0x234c,0x9b));var _0xc234=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x234c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc234('0x0'));var Sequelize=require(_0xc234('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xc234('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc234('0x2')]},'street':{'type':Sequelize[_0xc234('0x2')]},'postalCode':{'type':Sequelize[_0xc234('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xc234('0x2')]},'dateOfBirth':{'type':Sequelize[_0xc234('0x2')]},'description':{'type':Sequelize[_0xc234('0x3')]},'phone':{'type':Sequelize[_0xc234('0x2')]},'mobile':{'type':Sequelize[_0xc234('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc234('0x2')]},'url':{'type':Sequelize[_0xc234('0x2')]},'facebook':{'type':Sequelize[_0xc234('0x2')]},'fb_data':{'type':Sequelize[_0xc234('0x2')]},'twitter':{'type':Sequelize[_0xc234('0x2')]},'skype':{'type':Sequelize[_0xc234('0x2')]},'teams':{'type':Sequelize[_0xc234('0x2')]},'viber':{'type':Sequelize[_0xc234('0x2')]},'line':{'type':Sequelize[_0xc234('0x2')]},'wechat':{'type':Sequelize[_0xc234('0x2')]},'telegram':{'type':Sequelize[_0xc234('0x2')]},'UserId':{'type':Sequelize[_0xc234('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc234('0x4')](0x2)[_0xc234('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc234('0x6')],'defaultValue':Sequelize[_0xc234('0x7')]},'dialTimezone':{'type':Sequelize[_0xc234('0x2')]},'utcOffset':{'type':Sequelize[_0xc234('0x4')]}};
\ No newline at end of file
+var _0x481d=['UNSIGNED','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x4ee408,_0x359050){var _0x477061=function(_0x5662fd){while(--_0x5662fd){_0x4ee408['push'](_0x4ee408['shift']());}};_0x477061(++_0x359050);}(_0x481d,0x1ba));var _0xd481=function(_0x53afa6,_0x59e786){_0x53afa6=_0x53afa6-0x0;var _0x51f86a=_0x481d[_0x53afa6];return _0x51f86a;};'use strict';var _=require(_0xd481('0x0'));var Sequelize=require(_0xd481('0x1'));module[_0xd481('0x2')]={'firstName':{'type':Sequelize[_0xd481('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xd481('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xd481('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xd481('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd481('0x4')]},'phone':{'type':Sequelize[_0xd481('0x3')]},'mobile':{'type':Sequelize[_0xd481('0x3')]},'fax':{'type':Sequelize[_0xd481('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xd481('0x3')]},'facebook':{'type':Sequelize[_0xd481('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xd481('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xd481('0x3')]},'viber':{'type':Sequelize[_0xd481('0x3')]},'line':{'type':Sequelize[_0xd481('0x3')]},'wechat':{'type':Sequelize[_0xd481('0x3')]},'telegram':{'type':Sequelize[_0xd481('0x3')]},'UserId':{'type':Sequelize[_0xd481('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xd481('0x3')]},'priority':{'type':Sequelize[_0xd481('0x5')](0x2)[_0xd481('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xd481('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'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 71cb741..07c1b85 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','moment','randomstring','path','util','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','pop'];(function(_0x48f4f9,_0x4ee907){var _0x3e4f66=function(_0x297506){while(--_0x297506){_0x48f4f9['push'](_0x48f4f9['shift']());}};_0x3e4f66(++_0x4ee907);}(_0x4255,0x7d));var _0x5425=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0x4255[_0xf73c09];return _0xa8923c;};'use strict';var _=require('lodash');var moment=require(_0x5425('0x0'));var random=require(_0x5425('0x1'));var fs=require('fs');var path=require(_0x5425('0x2'));var util=require(_0x5425('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')('email');var config=require('../../../config/environment');function getAddress(_0x2f4d2a){var _0x35087e=_[_0x5425('0x4')](_0x2f4d2a[_0x5425('0x5')]);return _0x35087e&&_0x35087e[_0x5425('0x6')]?_0x35087e['address']:_0x5425('0x7')+random[_0x5425('0x8')](0x6)+_0x5425('0x9');}function getFirstName(_0x1b0165){var _0x5c9d66=_[_0x5425('0x4')](_0x1b0165[_0x5425('0x5')]);if(_0x5c9d66&&_0x5c9d66[_0x5425('0xa')]){if(_0x5c9d66[_0x5425('0xa')]==_0x5c9d66[_0x5425('0x6')]){return _0x5c9d66[_0x5425('0xa')]['substring'](0x0,_0x5c9d66['name']['indexOf']('@'));}var _0x3e26dc=_0x5c9d66['name'][_0x5425('0xb')](/\s+/);return _0x3e26dc[_0x5425('0xc')]>0x1?_0x3e26dc[_0x5425('0xd')](0x0,-0x1)['join']('\x20'):_0x5c9d66['name'];}return'Anonymous';}function getLastName(_0x863b62){var _0x18c4c1=_[_0x5425('0x4')](_0x863b62[_0x5425('0x5')]);if(_0x18c4c1&&_0x18c4c1[_0x5425('0xa')]){var _0x3ced89=_0x18c4c1[_0x5425('0xa')][_0x5425('0xb')](/\s+/);return _0x3ced89[_0x5425('0xc')]>0x1?_0x3ced89[_0x5425('0xe')]():'';}return'';}function getMails(_0x1bef08,_0x5214d1){var _0x2496ca='';for(var _0x2e470d=0x0;_0x2e470d<_0x5214d1[_0x5425('0x5')][_0x5425('0xc')];_0x2e470d+=0x1){if(_0x5214d1[_0x5425('0x5')][_0x2e470d][_0x5425('0x6')]!==_0x1bef08){if(!_[_0x5425('0xf')](_0x2496ca)){_0x2496ca+=',';}_0x2496ca+=_0x5214d1[_0x5425('0x5')][_0x2e470d][_0x5425('0xa')]||_0x5214d1[_0x5425('0x5')][_0x2e470d][_0x5425('0x6')]||'';_0x2496ca+='\x20<';_0x2496ca+=_0x5214d1[_0x5425('0x5')][_0x2e470d][_0x5425('0x6')]?_0x5214d1[_0x5425('0x5')][_0x2e470d]['address']:_0x5425('0x7')+random[_0x5425('0x8')](0x6)+_0x5425('0x9');_0x2496ca+='>';}}return _0x2496ca;}function parseEmail(_0x2771f9,_0x112ceb,_0x2af137){if(_0x112ceb[_0x5425('0x10')]){var _0x3e56be=/