From: support
Date: Tue, 28 Mar 2023 09:26:35 +0000 (+0000)
Subject: Built motion from commit d6d69adf.|2.6.33
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22%7B%7Blicense.messaging?a=commitdiff_plain;h=87977a1b0bb9bbb7da1f5d284f3d898d8c44a308;p=motion2.git
Built motion from commit d6d69adf.|2.6.33
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index c956f69..87dbaf3 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-03-28T08:48:44.376Z",
+ "time": "2023-03-28T09:17:06.964Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 4fe93b5..ae8e355 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-03-28T08:48:44.376Z",
+ "time": "2023-03-28T09:17:06.964Z",
"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 f182ffa..9897251 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 _0x7ae5=['urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','urlForward','browser','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[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0x9b007,_0x416098){var _0x12f148=function(_0x3dfc0a){while(--_0x3dfc0a){_0x9b007['push'](_0x9b007['shift']());}};_0x12f148(++_0x416098);}(_0x7ae5,0x133));var _0x57ae=function(_0x329d59,_0xae2550){_0x329d59=_0x329d59-0x0;var _0x2ff3bb=_0x7ae5[_0x329d59];return _0x2ff3bb;};'use strict';var Sequelize=require(_0x57ae('0x0'));module[_0x57ae('0x1')]={'name':{'type':Sequelize[_0x57ae('0x2')],'get':function(_0xf2be0a){return this['getDataValue'](_0x57ae('0x3'));}},'action':{'type':Sequelize[_0x57ae('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x57ae('0x5'),_0x57ae('0x6'),'motionbar','jscripty',_0x57ae('0x7'),_0x57ae('0x8'),'bot',_0x57ae('0x9')]],'msg':_0x57ae('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x57ae('0x4')](0x1000),'comment':_0x57ae('0xb')},'data2':{'type':Sequelize[_0x57ae('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x57ae('0x4')](0x1000),'comment':_0x57ae('0xc')},'data4':{'type':Sequelize[_0x57ae('0x4')](0x1000),'comments':_0x57ae('0xd')},'data5':{'type':Sequelize[_0x57ae('0x4')](0x1000),'comments':_0x57ae('0xe')},'data6':{'type':Sequelize[_0x57ae('0x4')],'comments':_0x57ae('0xf')},'data7':{'type':Sequelize[_0x57ae('0x10')],'comments':_0x57ae('0x11')}};
\ No newline at end of file
+var _0x9b25=['contactManager','motionbar','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[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','STRING'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x9b25,0x175));var _0x59b2=function(_0xbfe8e9,_0x5a8b43){_0xbfe8e9=_0xbfe8e9-0x0;var _0x2a278f=_0x9b25[_0xbfe8e9];return _0x2a278f;};'use strict';var Sequelize=require(_0x59b2('0x0'));module[_0x59b2('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xed1df0){return this[_0x59b2('0x2')](_0x59b2('0x3'));}},'action':{'type':Sequelize[_0x59b2('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x59b2('0x5'),'integration',_0x59b2('0x6'),'jscripty','urlForward',_0x59b2('0x7'),_0x59b2('0x8'),_0x59b2('0x9')]],'msg':_0x59b2('0xa')}},'comment':_0x59b2('0xa')},'data1':{'type':Sequelize[_0x59b2('0x4')](0x1000),'comment':_0x59b2('0xb')},'data2':{'type':Sequelize[_0x59b2('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x59b2('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x59b2('0xd')},'data5':{'type':Sequelize[_0x59b2('0x4')](0x1000),'comments':_0x59b2('0xe')},'data6':{'type':Sequelize[_0x59b2('0x4')],'comments':_0x59b2('0xf')},'data7':{'type':Sequelize[_0x59b2('0x10')],'comments':_0x59b2('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 5f65063..e7451fb 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 _0xb34a=['limit','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x4bf96c,_0x4d24fd){var _0x281d09=function(_0x56538e){while(--_0x56538e){_0x4bf96c['push'](_0x4bf96c['shift']());}};_0x281d09(++_0x4d24fd);}(_0xb34a,0x1aa));var _0xab34=function(_0x56ea67,_0x255351){_0x56ea67=_0x56ea67-0x0;var _0x1958f7=_0xb34a[_0x56ea67];return _0x1958f7;};'use strict';var emlformat=require(_0xab34('0x0'));var rimraf=require(_0xab34('0x1'));var zipdir=require(_0xab34('0x2'));var jsonpatch=require(_0xab34('0x3'));var rp=require(_0xab34('0x4'));var moment=require(_0xab34('0x5'));var BPromise=require(_0xab34('0x6'));var Mustache=require(_0xab34('0x7'));var util=require(_0xab34('0x8'));var path=require(_0xab34('0x9'));var sox=require(_0xab34('0xa'));var csv=require(_0xab34('0xb'));var ejs=require(_0xab34('0xc'));var fs=require('fs');var fs_extra=require(_0xab34('0xd'));var _=require(_0xab34('0xe'));var squel=require('squel');var crypto=require(_0xab34('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xab34('0xb'));var querystring=require(_0xab34('0x10'));var Papa=require(_0xab34('0x11'));var Redis=require(_0xab34('0x12'));var authService=require(_0xab34('0x13'));var qs=require(_0xab34('0x14'));var as=require(_0xab34('0x15'));var hardwareService=require(_0xab34('0x16'));var logger=require(_0xab34('0x17'))(_0xab34('0x18'));var utils=require(_0xab34('0x19'));var config=require(_0xab34('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xab34('0x1b'))['db'];function respondWithStatusCode(_0x39e750,_0x14bc59){_0x14bc59=_0x14bc59||0xcc;return function(_0x2fb80e){if(_0x2fb80e){return _0x39e750[_0xab34('0x1c')](_0x14bc59);}return _0x39e750[_0xab34('0x1d')](_0x14bc59)[_0xab34('0x1e')]();};}function respondWithResult(_0x3aa0e3,_0x2a4017){_0x2a4017=_0x2a4017||0xc8;return function(_0x5dd407){if(_0x5dd407){return _0x3aa0e3[_0xab34('0x1d')](_0x2a4017)[_0xab34('0x1f')](_0x5dd407);}};}function respondWithFilteredResult(_0xe2168,_0x1ef9f1){return function(_0x2ec1ce){if(_0x2ec1ce){var _0x1ea169=typeof _0x1ef9f1['offset']===_0xab34('0x20')&&typeof _0x1ef9f1[_0xab34('0x21')]==='undefined';var _0x8804ca=_0x2ec1ce['count'];var _0x431e7d=_0x1ea169?0x0:_0x1ef9f1[_0xab34('0x22')];var _0x23def7=_0x1ea169?_0x2ec1ce['count']:_0x1ef9f1[_0xab34('0x22')]+_0x1ef9f1[_0xab34('0x21')];var _0x4d8661;if(_0x23def7>=_0x8804ca){_0x23def7=_0x8804ca;_0x4d8661=0xc8;}else{_0x4d8661=0xce;}_0xe2168[_0xab34('0x1d')](_0x4d8661);return _0xe2168['set'](_0xab34('0x23'),_0x431e7d+'-'+_0x23def7+'/'+_0x8804ca)[_0xab34('0x1f')](_0x2ec1ce);}return null;};}function patchUpdates(_0x60cbaf){return function(_0xc0eb35){try{jsonpatch[_0xab34('0x24')](_0xc0eb35,_0x60cbaf,!![]);}catch(_0x4305ad){return BPromise[_0xab34('0x25')](_0x4305ad);}return _0xc0eb35[_0xab34('0x26')]();};}function saveUpdates(_0x325853,_0x24b503){return function(_0xeb199c){if(_0xeb199c){return _0xeb199c[_0xab34('0x27')](_0x325853)[_0xab34('0x28')](function(_0x1f50b7){return _0x1f50b7;});}return null;};}function removeEntity(_0x2bfb1a,_0x26c82a){return function(_0x40ab27){if(_0x40ab27){return _0x40ab27[_0xab34('0x29')]()[_0xab34('0x28')](function(){_0x2bfb1a[_0xab34('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7a6f42,_0x4905fb){return function(_0x3c4f7c){if(!_0x3c4f7c){_0x7a6f42['sendStatus'](0x194);}return _0x3c4f7c;};}function handleError(_0x72ad3e,_0xc47c4b){_0xc47c4b=_0xc47c4b||0x1f4;return function(_0x369b12){logger[_0xab34('0x2a')](_0x369b12[_0xab34('0x2b')]);if(_0x369b12[_0xab34('0x2c')]){delete _0x369b12[_0xab34('0x2c')];}_0x72ad3e['status'](_0xc47c4b)[_0xab34('0x2d')](_0x369b12);};}exports['update']=function(_0xd6a0a,_0x25d27b){if(_0xd6a0a[_0xab34('0x2e')]['id']){delete _0xd6a0a[_0xab34('0x2e')]['id'];}return db[_0xab34('0x2f')][_0xab34('0x30')]({'where':{'id':_0xd6a0a[_0xab34('0x31')]['id']}})['then'](handleEntityNotFound(_0x25d27b,null))[_0xab34('0x28')](saveUpdates(_0xd6a0a[_0xab34('0x2e')],null))[_0xab34('0x28')](respondWithResult(_0x25d27b,null))['catch'](handleError(_0x25d27b,null));};exports[_0xab34('0x29')]=function(_0x44a5e8,_0x1c9b81){return db['Action']['find']({'where':{'id':_0x44a5e8[_0xab34('0x31')]['id']}})['then'](handleEntityNotFound(_0x1c9b81,null))['then'](removeEntity(_0x1c9b81,null))[_0xab34('0x32')](handleError(_0x1c9b81,null));};
\ No newline at end of file
+var _0x4130=['params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','body','Action','find','catch'];(function(_0x4f51c9,_0x7d55fa){var _0x5e1d6b=function(_0x36e5b0){while(--_0x36e5b0){_0x4f51c9['push'](_0x4f51c9['shift']());}};_0x5e1d6b(++_0x7d55fa);}(_0x4130,0x1a8));var _0x0413=function(_0x5a5939,_0x5af371){_0x5a5939=_0x5a5939-0x0;var _0x336804=_0x4130[_0x5a5939];return _0x336804;};'use strict';var emlformat=require(_0x0413('0x0'));var rimraf=require(_0x0413('0x1'));var zipdir=require(_0x0413('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0413('0x3'));var moment=require(_0x0413('0x4'));var BPromise=require(_0x0413('0x5'));var Mustache=require(_0x0413('0x6'));var util=require(_0x0413('0x7'));var path=require(_0x0413('0x8'));var sox=require('sox');var csv=require(_0x0413('0x9'));var ejs=require(_0x0413('0xa'));var fs=require('fs');var fs_extra=require(_0x0413('0xb'));var _=require('lodash');var squel=require(_0x0413('0xc'));var crypto=require(_0x0413('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0413('0x9'));var querystring=require(_0x0413('0xe'));var Papa=require(_0x0413('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0413('0x10'));var logger=require(_0x0413('0x11'))(_0x0413('0x12'));var utils=require(_0x0413('0x13'));var config=require(_0x0413('0x14'));var licenseUtil=require(_0x0413('0x15'));var db=require(_0x0413('0x16'))['db'];function respondWithStatusCode(_0x3a704c,_0xcb1e70){_0xcb1e70=_0xcb1e70||0xcc;return function(_0x1c966e){if(_0x1c966e){return _0x3a704c[_0x0413('0x17')](_0xcb1e70);}return _0x3a704c['status'](_0xcb1e70)['end']();};}function respondWithResult(_0xfd7e13,_0x380e93){_0x380e93=_0x380e93||0xc8;return function(_0x368635){if(_0x368635){return _0xfd7e13[_0x0413('0x18')](_0x380e93)[_0x0413('0x19')](_0x368635);}};}function respondWithFilteredResult(_0x501d42,_0x232e86){return function(_0x41c548){if(_0x41c548){var _0xc6200e=typeof _0x232e86['offset']==='undefined'&&typeof _0x232e86[_0x0413('0x1a')]===_0x0413('0x1b');var _0x3a87b0=_0x41c548['count'];var _0x115429=_0xc6200e?0x0:_0x232e86[_0x0413('0x1c')];var _0x48d42a=_0xc6200e?_0x41c548[_0x0413('0x1d')]:_0x232e86[_0x0413('0x1c')]+_0x232e86[_0x0413('0x1a')];var _0x1ad095;if(_0x48d42a>=_0x3a87b0){_0x48d42a=_0x3a87b0;_0x1ad095=0xc8;}else{_0x1ad095=0xce;}_0x501d42[_0x0413('0x18')](_0x1ad095);return _0x501d42[_0x0413('0x1e')](_0x0413('0x1f'),_0x115429+'-'+_0x48d42a+'/'+_0x3a87b0)[_0x0413('0x19')](_0x41c548);}return null;};}function patchUpdates(_0x33969b){return function(_0x11024f){try{jsonpatch[_0x0413('0x20')](_0x11024f,_0x33969b,!![]);}catch(_0x3ebcaa){return BPromise[_0x0413('0x21')](_0x3ebcaa);}return _0x11024f[_0x0413('0x22')]();};}function saveUpdates(_0x1559ce,_0x50a481){return function(_0x2b50b9){if(_0x2b50b9){return _0x2b50b9[_0x0413('0x23')](_0x1559ce)[_0x0413('0x24')](function(_0x32e31b){return _0x32e31b;});}return null;};}function removeEntity(_0xb3f479,_0x23297d){return function(_0x7643d4){if(_0x7643d4){return _0x7643d4[_0x0413('0x25')]()[_0x0413('0x24')](function(){_0xb3f479[_0x0413('0x18')](0xcc)[_0x0413('0x26')]();});}};}function handleEntityNotFound(_0x175feb,_0x84d03a){return function(_0x45c541){if(!_0x45c541){_0x175feb[_0x0413('0x17')](0x194);}return _0x45c541;};}function handleError(_0x268be9,_0xf9bd31){_0xf9bd31=_0xf9bd31||0x1f4;return function(_0x21d191){logger[_0x0413('0x27')](_0x21d191['stack']);if(_0x21d191[_0x0413('0x28')]){delete _0x21d191['name'];}_0x268be9[_0x0413('0x18')](_0xf9bd31)[_0x0413('0x29')](_0x21d191);};}exports[_0x0413('0x23')]=function(_0x535051,_0x1ef9f4){if(_0x535051['body']['id']){delete _0x535051[_0x0413('0x2a')]['id'];}return db[_0x0413('0x2b')][_0x0413('0x2c')]({'where':{'id':_0x535051['params']['id']}})['then'](handleEntityNotFound(_0x1ef9f4,null))['then'](saveUpdates(_0x535051[_0x0413('0x2a')],null))[_0x0413('0x24')](respondWithResult(_0x1ef9f4,null))[_0x0413('0x2d')](handleError(_0x1ef9f4,null));};exports[_0x0413('0x25')]=function(_0x2e876a,_0xc374ab){return db['Action']['find']({'where':{'id':_0x2e876a[_0x0413('0x2e')]['id']}})[_0x0413('0x24')](handleEntityNotFound(_0xc374ab,null))[_0x0413('0x24')](removeEntity(_0xc374ab,null))[_0x0413('0x2d')](handleError(_0xc374ab,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 118c215..9d9546c 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 _0xd34c=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','tools_actions','lodash'];(function(_0x5ad753,_0x21bc14){var _0x55b69=function(_0x459144){while(--_0x459144){_0x5ad753['push'](_0x5ad753['shift']());}};_0x55b69(++_0x21bc14);}(_0xd34c,0x185));var _0xcd34=function(_0x53a154,_0x21ff77){_0x53a154=_0x53a154-0x0;var _0x18c240=_0xd34c[_0x53a154];return _0x18c240;};'use strict';var _=require(_0xcd34('0x0'));var util=require(_0xcd34('0x1'));var logger=require(_0xcd34('0x2'))(_0xcd34('0x3'));var moment=require(_0xcd34('0x4'));var BPromise=require(_0xcd34('0x5'));var rp=require(_0xcd34('0x6'));var fs=require('fs');var path=require(_0xcd34('0x7'));var rimraf=require(_0xcd34('0x8'));var config=require(_0xcd34('0x9'));var attributes=require('./action.attributes');module[_0xcd34('0xa')]=function(_0x2852e4,_0x4df05f){return _0x2852e4[_0xcd34('0xb')]('Action',attributes,{'tableName':_0xcd34('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9605=['define','Action','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x3f3a34,_0x3456ef){var _0x27328b=function(_0x36cf83){while(--_0x36cf83){_0x3f3a34['push'](_0x3f3a34['shift']());}};_0x27328b(++_0x3456ef);}(_0x9605,0xde));var _0x5960=function(_0x18ff1f,_0x4cb2c0){_0x18ff1f=_0x18ff1f-0x0;var _0x3c67fa=_0x9605[_0x18ff1f];return _0x3c67fa;};'use strict';var _=require(_0x5960('0x0'));var util=require('util');var logger=require(_0x5960('0x1'))('api');var moment=require(_0x5960('0x2'));var BPromise=require(_0x5960('0x3'));var rp=require(_0x5960('0x4'));var fs=require('fs');var path=require(_0x5960('0x5'));var rimraf=require(_0x5960('0x6'));var config=require(_0x5960('0x7'));var attributes=require(_0x5960('0x8'));module['exports']=function(_0x57d502,_0x1e4248){return _0x57d502[_0x5960('0x9')](_0x5960('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 0e9e55c..93d27d0 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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0xab6372,_0x3daf3d){var _0x83504f=function(_0x121113){while(--_0x121113){_0xab6372['push'](_0xab6372['shift']());}};_0x83504f(++_0x3daf3d);}(_0xabce,0x103));var _0xeabc=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xabce[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
+var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x7217,0x19e));var _0x7721=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x7217[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 9778cfa..db2260a 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 _0x934e=['put','/:id','isAuthenticated','update','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./action.controller'];(function(_0x5245bc,_0x55e740){var _0x2acb9a=function(_0x4fd1e6){while(--_0x4fd1e6){_0x5245bc['push'](_0x5245bc['shift']());}};_0x2acb9a(++_0x55e740);}(_0x934e,0x165));var _0xe934=function(_0xb0c93e,_0x4988ee){_0xb0c93e=_0xb0c93e-0x0;var _0x30c74b=_0x934e[_0xb0c93e];return _0x30c74b;};'use strict';var multer=require(_0xe934('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe934('0x1'));var express=require(_0xe934('0x2'));var router=express['Router']();var fs_extra=require(_0xe934('0x3'));var auth=require(_0xe934('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe934('0x5'));var controller=require(_0xe934('0x6'));router[_0xe934('0x7')](_0xe934('0x8'),auth[_0xe934('0x9')](),controller[_0xe934('0xa')]);router['delete'](_0xe934('0x8'),auth[_0xe934('0x9')](),controller[_0xe934('0xb')]);module[_0xe934('0xc')]=router;
\ No newline at end of file
+var _0x8246=['exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./action.controller','put','isAuthenticated','delete','/:id','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8246,0x9d));var _0x6824=function(_0x32855c,_0x1733cb){_0x32855c=_0x32855c-0x0;var _0x783e1c=_0x8246[_0x32855c];return _0x783e1c;};'use strict';var multer=require(_0x6824('0x0'));var util=require(_0x6824('0x1'));var path=require('path');var timeout=require(_0x6824('0x2'));var express=require(_0x6824('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6824('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6824('0x5'));var controller=require(_0x6824('0x6'));router[_0x6824('0x7')]('/:id',auth[_0x6824('0x8')](),controller['update']);router[_0x6824('0x9')](_0x6824('0xa'),auth[_0x6824('0x8')](),controller[_0x6824('0xb')]);module[_0x6824('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 3c4d348..ae92a6a 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 _0xdbf5=['exports','STRING','TEXT'];(function(_0x54ebca,_0x5bc67e){var _0x5b432a=function(_0x441caa){while(--_0x441caa){_0x54ebca['push'](_0x54ebca['shift']());}};_0x5b432a(++_0x5bc67e);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2d6d3b,_0x2fac6e){_0x2d6d3b=_0x2d6d3b-0x0;var _0x398948=_0xdbf5[_0x2d6d3b];return _0x398948;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}};
\ No newline at end of file
+var _0xda19=['exports','STRING','TEXT'];(function(_0x4a1195,_0x253862){var _0x360fa1=function(_0x207882){while(--_0x207882){_0x4a1195['push'](_0x4a1195['shift']());}};_0x360fa1(++_0x253862);}(_0xda19,0xd5));var _0x9da1=function(_0x152240,_0x4da254){_0x152240=_0x152240-0x0;var _0x48da00=_0xda19[_0x152240];return _0x48da00;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index f7e9780..32046bd 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 _0x4034=['foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','cross_join','SUM(%s)','MIN(%s)','AVG(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','operator','MetricId','output','web','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','savename','COUNT(*)','run','runReport','GROUP_CONCAT(%s)','Sequelize','DESC','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','json','limit','undefined','count','Content-Range','reject','save','then','destroy','get','CustomReports','error','stack','name','send','index','map','AnalyticCustomReport','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','filter','where','VIRTUAL','merge','options','includeAll','catch','keys','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','metric','replace','function','format','groupBy','orderBy','alias','joins','parse','includes','parentKey'];(function(_0x1d994b,_0x400019){var _0x5af338=function(_0x549672){while(--_0x549672){_0x1d994b['push'](_0x1d994b['shift']());}};_0x5af338(++_0x400019);}(_0x4034,0x166));var _0x4403=function(_0x2b441f,_0x249bac){_0x2b441f=_0x2b441f-0x0;var _0x1cc771=_0x4034[_0x2b441f];return _0x1cc771;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4403('0x0'));var zipdir=require(_0x4403('0x1'));var jsonpatch=require(_0x4403('0x2'));var rp=require('request-promise');var moment=require(_0x4403('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4403('0x4'));var util=require(_0x4403('0x5'));var path=require('path');var sox=require(_0x4403('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4403('0x7'));var squel=require('squel');var crypto=require(_0x4403('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4403('0x9'));var Redis=require(_0x4403('0xa'));var authService=require(_0x4403('0xb'));var qs=require(_0x4403('0xc'));var as=require(_0x4403('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4403('0xe'))(_0x4403('0xf'));var utils=require(_0x4403('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4403('0x11'));var db=require(_0x4403('0x12'))['db'];var dbH=require(_0x4403('0x12'))[_0x4403('0x13')];function respondWithStatusCode(_0x1309d8,_0x48ee68){_0x48ee68=_0x48ee68||0xcc;return function(_0x192dc8){if(_0x192dc8){return _0x1309d8['sendStatus'](_0x48ee68);}return _0x1309d8[_0x4403('0x14')](_0x48ee68)[_0x4403('0x15')]();};}function respondWithResult(_0x4f7d51,_0x712752){_0x712752=_0x712752||0xc8;return function(_0x23148e){if(_0x23148e){return _0x4f7d51[_0x4403('0x14')](_0x712752)[_0x4403('0x16')](_0x23148e);}};}function respondWithFilteredResult(_0x339b67,_0xee64a6){return function(_0x1086fb){if(_0x1086fb){var _0x1a247b=typeof _0xee64a6['offset']==='undefined'&&typeof _0xee64a6[_0x4403('0x17')]===_0x4403('0x18');var _0x5ed2dc=_0x1086fb[_0x4403('0x19')];var _0x2be877=_0x1a247b?0x0:_0xee64a6['offset'];var _0x57bd36=_0x1a247b?_0x1086fb[_0x4403('0x19')]:_0xee64a6['offset']+_0xee64a6[_0x4403('0x17')];var _0x275d33;if(_0x57bd36>=_0x5ed2dc){_0x57bd36=_0x5ed2dc;_0x275d33=0xc8;}else{_0x275d33=0xce;}_0x339b67[_0x4403('0x14')](_0x275d33);return _0x339b67['set'](_0x4403('0x1a'),_0x2be877+'-'+_0x57bd36+'/'+_0x5ed2dc)[_0x4403('0x16')](_0x1086fb);}return null;};}function patchUpdates(_0x4d5fda){return function(_0x3d615b){try{jsonpatch['apply'](_0x3d615b,_0x4d5fda,!![]);}catch(_0x3f4b0b){return BPromise[_0x4403('0x1b')](_0x3f4b0b);}return _0x3d615b[_0x4403('0x1c')]();};}function saveUpdates(_0x11f975,_0x2f7809){return function(_0x22f964){if(_0x22f964){return _0x22f964['update'](_0x11f975)[_0x4403('0x1d')](function(_0x34a5e9){return _0x34a5e9;});}return null;};}function removeEntity(_0x2f8f91,_0x1c549a){return function(_0x132cf3){if(_0x132cf3){return _0x132cf3[_0x4403('0x1e')]()['then'](function(){var _0x5e4e60=_0x132cf3[_0x4403('0x1f')]({'plain':!![]});var _0x468db5=_0x4403('0x20');return db['UserProfileResource'][_0x4403('0x1e')]({'where':{'type':_0x468db5,'resourceId':_0x5e4e60['id']}})['then'](function(){return _0x132cf3;});})['then'](function(){_0x2f8f91['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ef7a6,_0x3d6c96){return function(_0x5998c6){if(!_0x5998c6){_0x4ef7a6['sendStatus'](0x194);}return _0x5998c6;};}function handleError(_0x4b2fe8,_0x24b8a5){_0x24b8a5=_0x24b8a5||0x1f4;return function(_0xf5a7f){logger[_0x4403('0x21')](_0xf5a7f[_0x4403('0x22')]);if(_0xf5a7f['name']){delete _0xf5a7f[_0x4403('0x23')];}_0x4b2fe8[_0x4403('0x14')](_0x24b8a5)[_0x4403('0x24')](_0xf5a7f);};}exports[_0x4403('0x25')]=function(_0x3edc56,_0x511eb6){var _0x4f7424={},_0x121a5c={},_0x104203={'count':0x0,'rows':[]};var _0x398ef0=_[_0x4403('0x26')](db[_0x4403('0x27')]['rawAttributes'],function(_0x5ec6a9){return{'name':_0x5ec6a9['fieldName'],'type':_0x5ec6a9[_0x4403('0x28')][_0x4403('0x29')]};});_0x121a5c[_0x4403('0x2a')]=_[_0x4403('0x26')](_0x398ef0,'name');_0x121a5c[_0x4403('0x2b')]=_['keys'](_0x3edc56[_0x4403('0x2b')]);_0x121a5c[_0x4403('0x2c')]=_[_0x4403('0x2d')](_0x121a5c[_0x4403('0x2a')],_0x121a5c[_0x4403('0x2b')]);_0x4f7424[_0x4403('0x2e')]=_['intersection'](_0x121a5c[_0x4403('0x2a')],qs[_0x4403('0x2f')](_0x3edc56[_0x4403('0x2b')][_0x4403('0x2f')]));_0x4f7424[_0x4403('0x2e')]=_0x4f7424['attributes'][_0x4403('0x30')]?_0x4f7424[_0x4403('0x2e')]:_0x121a5c[_0x4403('0x2a')];if(!_0x3edc56[_0x4403('0x2b')][_0x4403('0x31')](_0x4403('0x32'))){_0x4f7424[_0x4403('0x17')]=qs[_0x4403('0x17')](_0x3edc56['query'][_0x4403('0x17')]);_0x4f7424['offset']=qs[_0x4403('0x33')](_0x3edc56[_0x4403('0x2b')]['offset']);}_0x4f7424[_0x4403('0x34')]=qs[_0x4403('0x35')](_0x3edc56[_0x4403('0x2b')][_0x4403('0x35')]);_0x4f7424['where']=qs[_0x4403('0x2c')](_['pick'](_0x3edc56[_0x4403('0x2b')],_0x121a5c['filters']),_0x398ef0);if(_0x3edc56[_0x4403('0x2b')][_0x4403('0x36')]){_0x4f7424[_0x4403('0x37')]=_['merge'](_0x4f7424[_0x4403('0x37')],{'$or':_[_0x4403('0x26')](_0x398ef0,function(_0x2117b3){if(_0x2117b3[_0x4403('0x28')]!==_0x4403('0x38')){var _0x4d5b32={};_0x4d5b32[_0x2117b3[_0x4403('0x23')]]={'$like':'%'+_0x3edc56[_0x4403('0x2b')][_0x4403('0x36')]+'%'};return _0x4d5b32;}})});}_0x4f7424=_[_0x4403('0x39')]({},_0x4f7424,_0x3edc56[_0x4403('0x3a')]);var _0x51ce1b={'where':_0x4f7424[_0x4403('0x37')]};return db[_0x4403('0x27')][_0x4403('0x19')](_0x51ce1b)['then'](function(_0x574b28){_0x104203[_0x4403('0x19')]=_0x574b28;if(_0x3edc56[_0x4403('0x2b')][_0x4403('0x3b')]){_0x4f7424['include']=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x4f7424);})[_0x4403('0x1d')](function(_0x5d907d){_0x104203['rows']=_0x5d907d;return _0x104203;})[_0x4403('0x1d')](respondWithFilteredResult(_0x511eb6,_0x4f7424))[_0x4403('0x3c')](handleError(_0x511eb6,null));};exports['show']=function(_0x4d3b30,_0x17871c){var _0x9cecb5={'raw':![],'where':{'id':_0x4d3b30['params']['id']}},_0x245f4e={};_0x245f4e[_0x4403('0x2a')]=_[_0x4403('0x3d')](db[_0x4403('0x27')][_0x4403('0x3e')]);_0x245f4e[_0x4403('0x2b')]=_[_0x4403('0x3d')](_0x4d3b30['query']);_0x245f4e[_0x4403('0x2c')]=_['intersection'](_0x245f4e[_0x4403('0x2a')],_0x245f4e['query']);_0x9cecb5[_0x4403('0x2e')]=_[_0x4403('0x2d')](_0x245f4e[_0x4403('0x2a')],qs[_0x4403('0x2f')](_0x4d3b30[_0x4403('0x2b')][_0x4403('0x2f')]));_0x9cecb5['attributes']=_0x9cecb5[_0x4403('0x2e')][_0x4403('0x30')]?_0x9cecb5[_0x4403('0x2e')]:_0x245f4e[_0x4403('0x2a')];if(_0x4d3b30[_0x4403('0x2b')]['includeAll']){_0x9cecb5['include']=[{'all':!![]}];}_0x9cecb5=_['merge']({},_0x9cecb5,_0x4d3b30[_0x4403('0x3a')]);return db[_0x4403('0x27')]['find'](_0x9cecb5)[_0x4403('0x1d')](handleEntityNotFound(_0x17871c,null))[_0x4403('0x1d')](respondWithResult(_0x17871c,null))['catch'](handleError(_0x17871c,null));};exports[_0x4403('0x3f')]=function(_0x448845,_0x9cbcf7){return db['AnalyticCustomReport'][_0x4403('0x3f')](_0x448845[_0x4403('0x40')],{})[_0x4403('0x1d')](function(_0x244d3b){var _0x392972=_0x448845['user']['get']({'plain':!![]});if(!_0x392972)throw new Error(_0x4403('0x41'));if(_0x392972['role']===_0x4403('0x42')){var _0x2fa8a1=_0x244d3b[_0x4403('0x1f')]({'plain':!![]});var _0x102bc4=_0x4403('0x43');return db['UserProfileSection'][_0x4403('0x44')]({'where':{'name':_0x102bc4,'userProfileId':_0x392972['userProfileId']},'raw':!![]})[_0x4403('0x1d')](function(_0x1c0694){if(_0x1c0694&&_0x1c0694[_0x4403('0x45')]===0x0){return db[_0x4403('0x46')][_0x4403('0x3f')]({'name':_0x2fa8a1[_0x4403('0x23')],'resourceId':_0x2fa8a1['id'],'type':_0x4403('0x20'),'sectionId':_0x1c0694['id']},{})[_0x4403('0x1d')](function(){return _0x244d3b;});}else{return _0x244d3b;}})[_0x4403('0x3c')](function(_0x3138a3){logger[_0x4403('0x21')](_0x4403('0x47'),_0x3138a3);throw _0x3138a3;});}return _0x244d3b;})[_0x4403('0x1d')](respondWithResult(_0x9cbcf7,0xc9))['catch'](handleError(_0x9cbcf7,null));};exports[_0x4403('0x48')]=function(_0x1e28eb,_0x243619){if(_0x1e28eb[_0x4403('0x40')]['id']){delete _0x1e28eb[_0x4403('0x40')]['id'];}return db[_0x4403('0x27')][_0x4403('0x44')]({'where':{'id':_0x1e28eb['params']['id']}})[_0x4403('0x1d')](handleEntityNotFound(_0x243619,null))[_0x4403('0x1d')](saveUpdates(_0x1e28eb[_0x4403('0x40')],null))[_0x4403('0x1d')](respondWithResult(_0x243619,null))[_0x4403('0x3c')](handleError(_0x243619,null));};exports[_0x4403('0x1e')]=function(_0x181e47,_0x13f0bf){return db[_0x4403('0x27')]['find']({'where':{'id':_0x181e47[_0x4403('0x49')]['id']}})[_0x4403('0x1d')](handleEntityNotFound(_0x13f0bf,null))[_0x4403('0x1d')](removeEntity(_0x13f0bf,null))[_0x4403('0x3c')](handleError(_0x13f0bf,null));};exports[_0x4403('0x4a')]=function(_0x14453d,_0x38703c){var _0x47fa7b=0xa;var _0xc80a2c=['join',_0x4403('0x4b'),_0x4403('0x4c'),'cross_join'];var _0x907316={'SUM':'SUM(%s)','COUNT':_0x4403('0x4d'),'COUNT DISTINCT':_0x4403('0x4e'),'MAX':_0x4403('0x4f'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x4403('0x50'),'GROUP_CONCAT DESC':_0x4403('0x51')};var _0x597cf2={'SEC_TO_TIME':_0x4403('0x52'),'DATE':'DATE(%s)','HOUR':_0x4403('0x53'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1d3620=function(_0x253212){return!_['includes']([_0x4403('0x54'),_0x4403('0x55'),_0x4403('0x56'),_0x4403('0x57')],_0x253212);};var _0x4935a9=function(_0x83973b){if(!_0x83973b||!_0x83973b[_0x4403('0x58')]['length']){return'';}for(var _0x3343ab='(',_0xec83d6=0x0;_0xec83d6<_0x83973b['rules'][_0x4403('0x30')];_0xec83d6+=0x1){_0xec83d6>0x0&&(_0x3343ab+='\x20'+_0x83973b['operator']+'\x20');_0x3343ab+=_0x83973b[_0x4403('0x58')][_0xec83d6][_0x4403('0x59')]?_0x4935a9(_0x83973b['rules'][_0xec83d6][_0x4403('0x59')]):_0x83973b[_0x4403('0x58')][_0xec83d6][_0x4403('0x5a')]+'\x20'+_0x83973b[_0x4403('0x58')][_0xec83d6]['condition']+(_0x1d3620(_0x83973b[_0x4403('0x58')][_0xec83d6][_0x4403('0x5b')])?'\x20'+_0x83973b['rules'][_0xec83d6][_0x4403('0x5c')]:'');}return _0x3343ab+')';};var _0x5c9d7c={'where':{'id':_0x14453d[_0x4403('0x49')]['id']}},_0x19b872,_0x1d571f,_0x43305a,_0x38428d,_0x1ed127;_0x5c9d7c=_[_0x4403('0x39')]({},_0x5c9d7c,_0x14453d[_0x4403('0x3a')]);return db['AnalyticCustomReport'][_0x4403('0x44')](_0x5c9d7c)[_0x4403('0x1d')](function(_0x4b80f1){if(_0x4b80f1){_0x19b872=_0x4b80f1;return _0x4b80f1[_0x4403('0x5d')]();}return null;})[_0x4403('0x1d')](function(_0x205710){if(_0x205710){if(!_0x205710[_0x4403('0x30')]){throw new db['Sequelize'][(_0x4403('0x5e'))](_0x4403('0x5f'),0x193);}_0x1d571f=_0x205710;return db[_0x4403('0x60')][_0x4403('0x61')]({'raw':!![]});}return null;})['then'](function(_0x3bf115){if(_0x3bf115){_0x43305a=_[_0x4403('0x62')](_0x3bf115,'id');var _0x28f28f;var _0x58b3fc=squel[_0x4403('0x63')]();_0x58b3fc[_0x4403('0x64')](_0x19b872[_0x4403('0x65')]);for(var _0x47e14c=0x0;_0x47e14c<_0x1d571f[_0x4403('0x30')];_0x47e14c+=0x1){_0x28f28f=_0x1d571f[_0x47e14c]['MetricId']?_0x43305a[_0x1d571f[_0x47e14c]['MetricId']][_0x4403('0x66')]:_0x1d571f[_0x47e14c][_0x4403('0x5a')];_0x28f28f=_0x1d571f[_0x47e14c]['function']?_[_0x4403('0x67')](_0x907316[_0x1d571f[_0x47e14c][_0x4403('0x68')]],'%s',_0x28f28f):_0x28f28f;_0x28f28f=_0x1d571f[_0x47e14c][_0x4403('0x69')]?_[_0x4403('0x67')](_0x597cf2[_0x1d571f[_0x47e14c][_0x4403('0x69')]],'%s',_0x28f28f):_0x28f28f;if(_0x1d571f[_0x47e14c][_0x4403('0x6a')]){_0x58b3fc[_0x4403('0x59')](_0x28f28f);}_0x1d571f[_0x47e14c][_0x4403('0x6b')]&&_0x58b3fc['order'](_0x28f28f,_0x1d571f[_0x47e14c]['orderBy']==='DESC'?![]:!![]);_0x58b3fc[_0x4403('0x5a')](_0x28f28f,_0x1d571f[_0x47e14c][_0x4403('0x6c')]||_0x28f28f);}if(_0x19b872[_0x4403('0x6d')]){_0x19b872['joins']=JSON[_0x4403('0x6e')](_0x19b872[_0x4403('0x6d')]);for(var _0x58688f=0x0;_0x58688f<_0x19b872[_0x4403('0x6d')][_0x4403('0x30')];_0x58688f+=0x1){if(_0x19b872['joins'][_0x58688f][_0x4403('0x28')]&&_[_0x4403('0x6f')](_0xc80a2c,_0x19b872[_0x4403('0x6d')][_0x58688f]['type'])&&_0x19b872[_0x4403('0x6d')][_0x58688f][_0x4403('0x70')]&&_0x19b872[_0x4403('0x6d')][_0x58688f][_0x4403('0x71')]&&_0x19b872['joins'][_0x58688f][_0x4403('0x72')]){_0x58b3fc[_0x19b872[_0x4403('0x6d')][_0x58688f][_0x4403('0x28')]](_0x19b872['joins'][_0x58688f][_0x4403('0x71')],null,util[_0x4403('0x69')](_0x4403('0x73'),_0x19b872[_0x4403('0x65')],_0x19b872[_0x4403('0x6d')][_0x58688f][_0x4403('0x70')],_0x19b872[_0x4403('0x6d')][_0x58688f][_0x4403('0x71')],_0x19b872[_0x4403('0x6d')][_0x58688f][_0x4403('0x72')]));}}}if(_0x19b872[_0x4403('0x74')]){_0x19b872[_0x4403('0x74')]=JSON[_0x4403('0x6e')](_0x19b872[_0x4403('0x74')]);_0x58b3fc[_0x4403('0x37')](_0x4935a9(_0x19b872[_0x4403('0x74')][_0x4403('0x59')]));}_0x1ed127=_0x58b3fc[_0x4403('0x75')]();_0x58b3fc['limit'](_0x47fa7b);_0x58b3fc[_0x4403('0x33')](0x0);logger[_0x4403('0x76')](_0x4403('0x77'),_0x58b3fc['toString']());return dbH[_0x4403('0x78')][_0x4403('0x2b')](_0x58b3fc[_0x4403('0x79')](),{'type':dbH['sequelize'][_0x4403('0x7a')][_0x4403('0x7b')]});}})[_0x4403('0x1d')](respondWithResult(_0x38703c,null))[_0x4403('0x3c')](handleError(_0x38703c,null));};function runReport(_0x3a8bd7,_0x19101a,_0x1f2ba0){var _0x219810=_0x19101a['name'];var _0x401478=0xa;var _0x4abcf8=[_0x4403('0x7c'),'left_join','right_join',_0x4403('0x7d')];var _0x318132={'SUM':_0x4403('0x7e'),'COUNT':_0x4403('0x4d'),'COUNT DISTINCT':_0x4403('0x4e'),'MAX':_0x4403('0x4f'),'MIN':_0x4403('0x7f'),'AVG':_0x4403('0x80'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x4403('0x50'),'GROUP_CONCAT DESC':_0x4403('0x51')};var _0x25b6c5={'SEC_TO_TIME':_0x4403('0x52'),'DATE':_0x4403('0x81'),'HOUR':_0x4403('0x53'),'ROUND':_0x4403('0x82'),'UNIX_TIMESTAMP':_0x4403('0x83')};var _0x569501=function(_0x54226a){return!_[_0x4403('0x6f')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x4403('0x56'),_0x4403('0x57')],_0x54226a);};var _0x535a26=function(_0x37ce6b){if(!_0x37ce6b||!_0x37ce6b[_0x4403('0x58')][_0x4403('0x30')]){return'';}for(var _0x426ad8='(',_0x566e3a=0x0;_0x566e3a<_0x37ce6b['rules'][_0x4403('0x30')];_0x566e3a+=0x1){_0x566e3a>0x0&&(_0x426ad8+='\x20'+_0x37ce6b[_0x4403('0x84')]+'\x20');_0x426ad8+=_0x37ce6b[_0x4403('0x58')][_0x566e3a]['group']?_0x535a26(_0x37ce6b['rules'][_0x566e3a][_0x4403('0x59')]):_0x37ce6b[_0x4403('0x58')][_0x566e3a][_0x4403('0x5a')]+'\x20'+_0x37ce6b[_0x4403('0x58')][_0x566e3a][_0x4403('0x5b')]+(_0x569501(_0x37ce6b['rules'][_0x566e3a][_0x4403('0x5b')])?'\x20'+_0x37ce6b[_0x4403('0x58')][_0x566e3a]['value']:'');}return _0x426ad8+')';};var _0x194276={'where':{'id':_0x3a8bd7['id']}},_0x11165c,_0x15f8e0,_0x18cb29,_0x5ee8db,_0x4a430c;_0x194276=_[_0x4403('0x39')]({},_0x194276,_0x1f2ba0);return db['AnalyticCustomReport'][_0x4403('0x44')](_0x194276)[_0x4403('0x1d')](function(_0x2d345a){if(_0x2d345a){_0x11165c=_0x2d345a;return _0x2d345a[_0x4403('0x5d')]();}return null;})['then'](function(_0x11d125){if(_0x11d125){if(!_0x11d125[_0x4403('0x30')]){throw new db['Sequelize'][(_0x4403('0x5e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x15f8e0=_0x11d125;return db[_0x4403('0x60')][_0x4403('0x61')]({'raw':!![]});}return null;})['then'](function(_0x551e2d){if(_0x551e2d){_0x18cb29=_['keyBy'](_0x551e2d,'id');var _0x1da879;var _0x540211=squel[_0x4403('0x63')]();_0x540211[_0x4403('0x64')](_0x11165c[_0x4403('0x65')]);for(var _0x827bd9=0x0;_0x827bd9<_0x15f8e0[_0x4403('0x30')];_0x827bd9+=0x1){_0x1da879=_0x15f8e0[_0x827bd9][_0x4403('0x85')]?_0x18cb29[_0x15f8e0[_0x827bd9]['MetricId']][_0x4403('0x66')]:_0x15f8e0[_0x827bd9]['field'];_0x1da879=_0x15f8e0[_0x827bd9][_0x4403('0x68')]?_[_0x4403('0x67')](_0x318132[_0x15f8e0[_0x827bd9][_0x4403('0x68')]],'%s',_0x1da879):_0x1da879;_0x1da879=_0x15f8e0[_0x827bd9][_0x4403('0x69')]?_[_0x4403('0x67')](_0x25b6c5[_0x15f8e0[_0x827bd9][_0x4403('0x69')]],'%s',_0x1da879):_0x1da879;if(_0x15f8e0[_0x827bd9]['groupBy']){_0x540211[_0x4403('0x59')](_0x1da879);}_0x15f8e0[_0x827bd9][_0x4403('0x6b')]&&_0x540211[_0x4403('0x34')](_0x1da879,_0x15f8e0[_0x827bd9]['orderBy']==='DESC'?![]:!![]);_0x540211[_0x4403('0x5a')](_0x1da879,_0x15f8e0[_0x827bd9][_0x4403('0x6c')]||_0x1da879);}if(_0x11165c[_0x4403('0x6d')]){_0x11165c[_0x4403('0x6d')]=JSON[_0x4403('0x6e')](_0x11165c[_0x4403('0x6d')]);for(var _0x2255cb=0x0;_0x2255cb<_0x11165c['joins'][_0x4403('0x30')];_0x2255cb+=0x1){if(_0x11165c['joins'][_0x2255cb][_0x4403('0x28')]&&_[_0x4403('0x6f')](_0x4abcf8,_0x11165c['joins'][_0x2255cb][_0x4403('0x28')])&&_0x11165c[_0x4403('0x6d')][_0x2255cb]['parentKey']&&_0x11165c['joins'][_0x2255cb]['foreignTable']&&_0x11165c[_0x4403('0x6d')][_0x2255cb]['foreignKey']){_0x540211[_0x11165c[_0x4403('0x6d')][_0x2255cb][_0x4403('0x28')]](_0x11165c[_0x4403('0x6d')][_0x2255cb][_0x4403('0x71')],null,util[_0x4403('0x69')]('%s.%s\x20=\x20%s.%s',_0x11165c[_0x4403('0x65')],_0x11165c[_0x4403('0x6d')][_0x2255cb][_0x4403('0x70')],_0x11165c[_0x4403('0x6d')][_0x2255cb]['foreignTable'],_0x11165c[_0x4403('0x6d')][_0x2255cb]['foreignKey']));}}}if(_0x11165c[_0x4403('0x74')]){_0x11165c['conditions']=JSON['parse'](_0x11165c[_0x4403('0x74')]);_0x540211[_0x4403('0x37')](_0x535a26(_0x11165c['conditions'][_0x4403('0x59')]));}_0x4a430c=_0x540211[_0x4403('0x75')]();_0x540211['limit'](_0x401478);_0x540211['offset'](0x0);return;}})[_0x4403('0x1d')](function(){if(_0x19101a[_0x4403('0x86')]===_0x4403('0x87')){return null;}var _0x3cc0ac=_['merge'](_0x19101a,{'name':_0x19101a['fullPath']||_0x19101a[_0x4403('0x23')]||_0x11165c[_0x4403('0x23')],'basename':_0x219810,'savename':util[_0x4403('0x69')]('%s-%s.%s',_0x19101a[_0x4403('0x23')]||_0x11165c['name'],require(_0x4403('0x88'))[_0x4403('0x89')](0x4),_0x19101a[_0x4403('0x86')]||_0x4403('0x8a')),'reportId':_0x11165c['id'],'reportType':_0x4403('0x8b')});return db[_0x4403('0x8c')][_0x4403('0x3f')](_0x3cc0ac,{'raw':!![]});})[_0x4403('0x1d')](function(_0x52e0ad){if(_0x11165c['table']===_0x4403('0x8d')){_0x4a430c[_0x4403('0x37')](_0x11165c[_0x4403('0x65')]+_0x4403('0x8e'),_0x19101a[_0x4403('0x8f')],_0x19101a[_0x4403('0x90')]);}else{_0x4a430c['where'](_0x11165c[_0x4403('0x65')]+_0x4403('0x91'),_0x19101a[_0x4403('0x8f')],_0x19101a[_0x4403('0x90')]);}if(_0x52e0ad){logger[_0x4403('0x92')](_0x4403('0x93'),_0x4a430c[_0x4403('0x79')]());require(_0x4403('0x94'))['fork'](path['join'](__dirname,_0x4403('0x95'),_0x52e0ad['output']),[_0x52e0ad['id'],_0x4a430c[_0x4403('0x79')](),path[_0x4403('0x7c')](__dirname,'../../files/reports',_0x52e0ad[_0x4403('0x96')]),_0x219810]);return _0x52e0ad;}else{var _0x397b09=squel[_0x4403('0x63')]();_0x397b09[_0x4403('0x64')]('('+_0x4a430c[_0x4403('0x79')]()+')','countTable');_0x397b09['field'](_0x4403('0x97'),_0x4403('0x19'));_0x4a430c[_0x4403('0x17')](_0x19101a[_0x4403('0x17')]||_0x401478);_0x4a430c[_0x4403('0x33')](_0x19101a[_0x4403('0x33')]||0x0);return dbH[_0x4403('0x78')]['query'](_0x397b09['toString'](),{'type':dbH[_0x4403('0x78')][_0x4403('0x7a')][_0x4403('0x7b')]})[_0x4403('0x1d')](function(_0x514d93){if(!_0x514d93[_0x4403('0x30')]){_0x5ee8db=0x0;}else{_0x5ee8db=_0x514d93[0x0][_0x4403('0x19')]||0x0;}return dbH[_0x4403('0x78')][_0x4403('0x2b')](_0x4a430c[_0x4403('0x79')](),{'type':dbH[_0x4403('0x78')][_0x4403('0x7a')][_0x4403('0x7b')]});})[_0x4403('0x1d')](function(_0x121bd6){return{'rows':_0x121bd6||[],'count':_0x5ee8db};});}});}exports[_0x4403('0x98')]=function(_0x5e04e2,_0x3d3383){return runReport(_0x5e04e2[_0x4403('0x49')],_0x5e04e2['query'],_0x5e04e2[_0x4403('0x3a')])[_0x4403('0x1d')](respondWithResult(_0x3d3383,null))[_0x4403('0x3c')](handleError(_0x3d3383,null));};exports[_0x4403('0x99')]=runReport;exports[_0x4403('0x2b')]=function(_0x128e11,_0x4877e1){var _0x15f58b=0xa;var _0x4750c1=[_0x4403('0x7c'),_0x4403('0x4b'),_0x4403('0x4c'),'cross_join'];var _0x2d2ac3={'SUM':_0x4403('0x7e'),'COUNT':_0x4403('0x4d'),'COUNT DISTINCT':_0x4403('0x4e'),'MAX':_0x4403('0x4f'),'MIN':_0x4403('0x7f'),'AVG':_0x4403('0x80'),'GROUP_CONCAT':_0x4403('0x9a'),'GROUP_CONCAT ASC':_0x4403('0x50'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1ba103={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4403('0x81'),'HOUR':_0x4403('0x53'),'ROUND':_0x4403('0x82'),'UNIX_TIMESTAMP':_0x4403('0x83')};var _0x1dcb23=function(_0x25409b){return!_['includes']([_0x4403('0x54'),_0x4403('0x55'),'IS\x20EMPTY',_0x4403('0x57')],_0x25409b);};var _0x3ee747=function(_0x5be49c){if(!_0x5be49c||!_0x5be49c['rules'][_0x4403('0x30')]){return'';}for(var _0x5ee784='(',_0x313bc6=0x0;_0x313bc6<_0x5be49c['rules'][_0x4403('0x30')];_0x313bc6+=0x1){_0x313bc6>0x0&&(_0x5ee784+='\x20'+_0x5be49c[_0x4403('0x84')]+'\x20');_0x5ee784+=_0x5be49c['rules'][_0x313bc6][_0x4403('0x59')]?_0x3ee747(_0x5be49c[_0x4403('0x58')][_0x313bc6][_0x4403('0x59')]):_0x5be49c['rules'][_0x313bc6][_0x4403('0x5a')]+'\x20'+_0x5be49c[_0x4403('0x58')][_0x313bc6][_0x4403('0x5b')]+(_0x1dcb23(_0x5be49c[_0x4403('0x58')][_0x313bc6]['condition'])?'\x20'+_0x5be49c['rules'][_0x313bc6][_0x4403('0x5c')]:'');}return _0x5ee784+')';};var _0x50fa45={'where':{'id':_0x128e11[_0x4403('0x49')]['id']}},_0x16d70f,_0x1e690b,_0x1d41b0,_0x17a322,_0x1054af;_0x50fa45=_[_0x4403('0x39')]({},_0x50fa45,_0x128e11[_0x4403('0x3a')]);return db['AnalyticCustomReport']['find'](_0x50fa45)['then'](function(_0x1458e2){if(_0x1458e2){_0x16d70f=_0x1458e2;return _0x1458e2['getFields']();}return null;})[_0x4403('0x1d')](function(_0x2c4734){if(_0x2c4734){if(!_0x2c4734[_0x4403('0x30')]){throw new db[(_0x4403('0x9b'))]['ValidationErrorItem'](_0x4403('0x5f'),0x193);}_0x1e690b=_0x2c4734;return db[_0x4403('0x60')][_0x4403('0x61')]({'raw':!![]});}return null;})[_0x4403('0x1d')](function(_0x3523cd){if(_0x3523cd){_0x1d41b0=_['keyBy'](_0x3523cd,'id');var _0x15ca76;var _0x355ad7=squel[_0x4403('0x63')]();_0x355ad7[_0x4403('0x64')](_0x16d70f[_0x4403('0x65')]);for(var _0x4fe8a5=0x0;_0x4fe8a5<_0x1e690b[_0x4403('0x30')];_0x4fe8a5+=0x1){_0x15ca76=_0x1e690b[_0x4fe8a5][_0x4403('0x85')]?_0x1d41b0[_0x1e690b[_0x4fe8a5][_0x4403('0x85')]][_0x4403('0x66')]:_0x1e690b[_0x4fe8a5]['field'];_0x15ca76=_0x1e690b[_0x4fe8a5]['function']?_[_0x4403('0x67')](_0x2d2ac3[_0x1e690b[_0x4fe8a5][_0x4403('0x68')]],'%s',_0x15ca76):_0x15ca76;_0x15ca76=_0x1e690b[_0x4fe8a5][_0x4403('0x69')]?_[_0x4403('0x67')](_0x1ba103[_0x1e690b[_0x4fe8a5]['format']],'%s',_0x15ca76):_0x15ca76;if(_0x1e690b[_0x4fe8a5][_0x4403('0x6a')]){_0x355ad7[_0x4403('0x59')](_0x15ca76);}_0x1e690b[_0x4fe8a5][_0x4403('0x6b')]&&_0x355ad7[_0x4403('0x34')](_0x15ca76,_0x1e690b[_0x4fe8a5][_0x4403('0x6b')]===_0x4403('0x9c')?![]:!![]);_0x355ad7[_0x4403('0x5a')](_0x15ca76,_0x1e690b[_0x4fe8a5]['alias']||_0x15ca76);}if(_0x16d70f[_0x4403('0x6d')]){_0x16d70f[_0x4403('0x6d')]=JSON[_0x4403('0x6e')](_0x16d70f[_0x4403('0x6d')]);for(var _0x3c2c93=0x0;_0x3c2c93<_0x16d70f[_0x4403('0x6d')][_0x4403('0x30')];_0x3c2c93+=0x1){if(_0x16d70f['joins'][_0x3c2c93]['type']&&_[_0x4403('0x6f')](_0x4750c1,_0x16d70f['joins'][_0x3c2c93][_0x4403('0x28')])&&_0x16d70f[_0x4403('0x6d')][_0x3c2c93][_0x4403('0x70')]&&_0x16d70f[_0x4403('0x6d')][_0x3c2c93][_0x4403('0x71')]&&_0x16d70f[_0x4403('0x6d')][_0x3c2c93][_0x4403('0x72')]){_0x355ad7[_0x16d70f[_0x4403('0x6d')][_0x3c2c93][_0x4403('0x28')]](_0x16d70f['joins'][_0x3c2c93][_0x4403('0x71')],null,util[_0x4403('0x69')]('%s.%s\x20=\x20%s.%s',_0x16d70f[_0x4403('0x65')],_0x16d70f[_0x4403('0x6d')][_0x3c2c93]['parentKey'],_0x16d70f['joins'][_0x3c2c93][_0x4403('0x71')],_0x16d70f[_0x4403('0x6d')][_0x3c2c93]['foreignKey']));}}}if(_0x16d70f[_0x4403('0x74')]){_0x16d70f[_0x4403('0x74')]=JSON[_0x4403('0x6e')](_0x16d70f[_0x4403('0x74')]);_0x355ad7['where'](_0x3ee747(_0x16d70f[_0x4403('0x74')]['group']));}_0x1054af=_0x355ad7['clone']();_0x355ad7[_0x4403('0x17')](_0x15f58b);_0x355ad7[_0x4403('0x33')](0x0);logger[_0x4403('0x76')](_0x4403('0x77'),_0x355ad7[_0x4403('0x79')]());return dbH['sequelize'][_0x4403('0x2b')](_0x355ad7[_0x4403('0x79')](),{'type':dbH['sequelize'][_0x4403('0x7a')][_0x4403('0x7b')]});}})[_0x4403('0x1d')](function(){return{'sql':_0x1054af[_0x4403('0x79')]()};})['then'](respondWithResult(_0x4877e1,null))[_0x4403('0x3c')](handleError(_0x4877e1,null));};
\ No newline at end of file
+var _0x0c74=['value','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','fork','../../components/export/','countTable','COUNT(*)','run','runReport','MAX(%s)','AVG(%s)','UNIX_TIMESTAMP(%s)','debug','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%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)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','IS\x20EMPTY'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0x0c74,0xc1));var _0x40c7=function(_0x1c60bd,_0x207c9b){_0x1c60bd=_0x1c60bd-0x0;var _0xc46ef9=_0x0c74[_0x1c60bd];return _0xc46ef9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x40c7('0x0'));var zipdir=require(_0x40c7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x40c7('0x2'));var moment=require(_0x40c7('0x3'));var BPromise=require(_0x40c7('0x4'));var Mustache=require(_0x40c7('0x5'));var util=require('util');var path=require(_0x40c7('0x6'));var sox=require('sox');var csv=require(_0x40c7('0x7'));var ejs=require(_0x40c7('0x8'));var fs=require('fs');var fs_extra=require(_0x40c7('0x9'));var _=require('lodash');var squel=require(_0x40c7('0xa'));var crypto=require(_0x40c7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x40c7('0xc'));var toCsv=require(_0x40c7('0x7'));var querystring=require(_0x40c7('0xd'));var Papa=require(_0x40c7('0xe'));var Redis=require(_0x40c7('0xf'));var authService=require(_0x40c7('0x10'));var qs=require(_0x40c7('0x11'));var as=require(_0x40c7('0x12'));var hardwareService=require(_0x40c7('0x13'));var logger=require(_0x40c7('0x14'))(_0x40c7('0x15'));var utils=require(_0x40c7('0x16'));var config=require(_0x40c7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x40c7('0x18'))['db'];var dbH=require('../../mysqldb')[_0x40c7('0x19')];function respondWithStatusCode(_0x164c1,_0x3c86e8){_0x3c86e8=_0x3c86e8||0xcc;return function(_0x302ea4){if(_0x302ea4){return _0x164c1['sendStatus'](_0x3c86e8);}return _0x164c1[_0x40c7('0x1a')](_0x3c86e8)[_0x40c7('0x1b')]();};}function respondWithResult(_0x2bde2a,_0x32e6ca){_0x32e6ca=_0x32e6ca||0xc8;return function(_0x16a10f){if(_0x16a10f){return _0x2bde2a[_0x40c7('0x1a')](_0x32e6ca)['json'](_0x16a10f);}};}function respondWithFilteredResult(_0x586a75,_0x326b01){return function(_0x151697){if(_0x151697){var _0x54a863=typeof _0x326b01['offset']===_0x40c7('0x1c')&&typeof _0x326b01[_0x40c7('0x1d')]===_0x40c7('0x1c');var _0x2cd6f9=_0x151697['count'];var _0x41decf=_0x54a863?0x0:_0x326b01[_0x40c7('0x1e')];var _0x35eaee=_0x54a863?_0x151697[_0x40c7('0x1f')]:_0x326b01['offset']+_0x326b01['limit'];var _0x2b8df4;if(_0x35eaee>=_0x2cd6f9){_0x35eaee=_0x2cd6f9;_0x2b8df4=0xc8;}else{_0x2b8df4=0xce;}_0x586a75[_0x40c7('0x1a')](_0x2b8df4);return _0x586a75[_0x40c7('0x20')](_0x40c7('0x21'),_0x41decf+'-'+_0x35eaee+'/'+_0x2cd6f9)[_0x40c7('0x22')](_0x151697);}return null;};}function patchUpdates(_0x53decd){return function(_0x39b8cc){try{jsonpatch[_0x40c7('0x23')](_0x39b8cc,_0x53decd,!![]);}catch(_0x2eddf9){return BPromise[_0x40c7('0x24')](_0x2eddf9);}return _0x39b8cc[_0x40c7('0x25')]();};}function saveUpdates(_0x1b658b,_0xb8e270){return function(_0x2be352){if(_0x2be352){return _0x2be352[_0x40c7('0x26')](_0x1b658b)['then'](function(_0x1c8bfa){return _0x1c8bfa;});}return null;};}function removeEntity(_0x3b1ec2,_0x46ec11){return function(_0x28ba63){if(_0x28ba63){return _0x28ba63[_0x40c7('0x27')]()[_0x40c7('0x28')](function(){var _0xe0b88c=_0x28ba63[_0x40c7('0x29')]({'plain':!![]});var _0x26377c=_0x40c7('0x2a');return db[_0x40c7('0x2b')]['destroy']({'where':{'type':_0x26377c,'resourceId':_0xe0b88c['id']}})[_0x40c7('0x28')](function(){return _0x28ba63;});})[_0x40c7('0x28')](function(){_0x3b1ec2['status'](0xcc)[_0x40c7('0x1b')]();});}};}function handleEntityNotFound(_0x53cfe2,_0xb02519){return function(_0x52789a){if(!_0x52789a){_0x53cfe2['sendStatus'](0x194);}return _0x52789a;};}function handleError(_0x5e3306,_0x8e8964){_0x8e8964=_0x8e8964||0x1f4;return function(_0x2ef31f){logger[_0x40c7('0x2c')](_0x2ef31f[_0x40c7('0x2d')]);if(_0x2ef31f['name']){delete _0x2ef31f[_0x40c7('0x2e')];}_0x5e3306['status'](_0x8e8964)[_0x40c7('0x2f')](_0x2ef31f);};}exports['index']=function(_0x48ddcb,_0x56337f){var _0x3d179f={},_0x4cee00={},_0x2d588f={'count':0x0,'rows':[]};var _0x27cd86=_[_0x40c7('0x30')](db[_0x40c7('0x31')][_0x40c7('0x32')],function(_0x31906a){return{'name':_0x31906a[_0x40c7('0x33')],'type':_0x31906a[_0x40c7('0x34')][_0x40c7('0x35')]};});_0x4cee00[_0x40c7('0x36')]=_[_0x40c7('0x30')](_0x27cd86,_0x40c7('0x2e'));_0x4cee00['query']=_[_0x40c7('0x37')](_0x48ddcb[_0x40c7('0x38')]);_0x4cee00[_0x40c7('0x39')]=_[_0x40c7('0x3a')](_0x4cee00[_0x40c7('0x36')],_0x4cee00[_0x40c7('0x38')]);_0x3d179f[_0x40c7('0x3b')]=_[_0x40c7('0x3a')](_0x4cee00[_0x40c7('0x36')],qs[_0x40c7('0x3c')](_0x48ddcb[_0x40c7('0x38')]['fields']));_0x3d179f['attributes']=_0x3d179f['attributes'][_0x40c7('0x3d')]?_0x3d179f[_0x40c7('0x3b')]:_0x4cee00['model'];if(!_0x48ddcb[_0x40c7('0x38')][_0x40c7('0x3e')](_0x40c7('0x3f'))){_0x3d179f[_0x40c7('0x1d')]=qs[_0x40c7('0x1d')](_0x48ddcb[_0x40c7('0x38')][_0x40c7('0x1d')]);_0x3d179f[_0x40c7('0x1e')]=qs[_0x40c7('0x1e')](_0x48ddcb['query'][_0x40c7('0x1e')]);}_0x3d179f[_0x40c7('0x40')]=qs[_0x40c7('0x41')](_0x48ddcb[_0x40c7('0x38')][_0x40c7('0x41')]);_0x3d179f[_0x40c7('0x42')]=qs[_0x40c7('0x39')](_[_0x40c7('0x43')](_0x48ddcb['query'],_0x4cee00['filters']),_0x27cd86);if(_0x48ddcb[_0x40c7('0x38')][_0x40c7('0x44')]){_0x3d179f[_0x40c7('0x42')]=_[_0x40c7('0x45')](_0x3d179f[_0x40c7('0x42')],{'$or':_['map'](_0x27cd86,function(_0x4145f5){if(_0x4145f5['type']!==_0x40c7('0x46')){var _0x6c855c={};_0x6c855c[_0x4145f5[_0x40c7('0x2e')]]={'$like':'%'+_0x48ddcb['query']['filter']+'%'};return _0x6c855c;}})});}_0x3d179f=_[_0x40c7('0x45')]({},_0x3d179f,_0x48ddcb[_0x40c7('0x47')]);var _0x1e078f={'where':_0x3d179f[_0x40c7('0x42')]};return db[_0x40c7('0x31')][_0x40c7('0x1f')](_0x1e078f)[_0x40c7('0x28')](function(_0x26c16d){_0x2d588f[_0x40c7('0x1f')]=_0x26c16d;if(_0x48ddcb[_0x40c7('0x38')][_0x40c7('0x48')]){_0x3d179f[_0x40c7('0x49')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x40c7('0x4a')](_0x3d179f);})[_0x40c7('0x28')](function(_0x4bf927){_0x2d588f[_0x40c7('0x4b')]=_0x4bf927;return _0x2d588f;})[_0x40c7('0x28')](respondWithFilteredResult(_0x56337f,_0x3d179f))[_0x40c7('0x4c')](handleError(_0x56337f,null));};exports[_0x40c7('0x4d')]=function(_0x28e2b2,_0x4d2cb9){var _0x1dbcc4={'raw':![],'where':{'id':_0x28e2b2[_0x40c7('0x4e')]['id']}},_0x3f266b={};_0x3f266b[_0x40c7('0x36')]=_['keys'](db[_0x40c7('0x31')]['rawAttributes']);_0x3f266b[_0x40c7('0x38')]=_['keys'](_0x28e2b2['query']);_0x3f266b['filters']=_[_0x40c7('0x3a')](_0x3f266b[_0x40c7('0x36')],_0x3f266b[_0x40c7('0x38')]);_0x1dbcc4[_0x40c7('0x3b')]=_['intersection'](_0x3f266b[_0x40c7('0x36')],qs['fields'](_0x28e2b2['query'][_0x40c7('0x3c')]));_0x1dbcc4[_0x40c7('0x3b')]=_0x1dbcc4[_0x40c7('0x3b')][_0x40c7('0x3d')]?_0x1dbcc4[_0x40c7('0x3b')]:_0x3f266b['model'];if(_0x28e2b2[_0x40c7('0x38')][_0x40c7('0x48')]){_0x1dbcc4['include']=[{'all':!![]}];}_0x1dbcc4=_[_0x40c7('0x45')]({},_0x1dbcc4,_0x28e2b2[_0x40c7('0x47')]);return db['AnalyticCustomReport'][_0x40c7('0x4f')](_0x1dbcc4)[_0x40c7('0x28')](handleEntityNotFound(_0x4d2cb9,null))['then'](respondWithResult(_0x4d2cb9,null))[_0x40c7('0x4c')](handleError(_0x4d2cb9,null));};exports['create']=function(_0x28fc4d,_0x3315c3){return db['AnalyticCustomReport']['create'](_0x28fc4d['body'],{})['then'](function(_0x5ad102){var _0x5735dc=_0x28fc4d[_0x40c7('0x50')]['get']({'plain':!![]});if(!_0x5735dc)throw new Error(_0x40c7('0x51'));if(_0x5735dc[_0x40c7('0x52')]===_0x40c7('0x50')){var _0x5e3433=_0x5ad102['get']({'plain':!![]});var _0x574803=_0x40c7('0x53');return db['UserProfileSection'][_0x40c7('0x4f')]({'where':{'name':_0x574803,'userProfileId':_0x5735dc[_0x40c7('0x54')]},'raw':!![]})[_0x40c7('0x28')](function(_0x8b1776){if(_0x8b1776&&_0x8b1776[_0x40c7('0x55')]===0x0){return db[_0x40c7('0x2b')][_0x40c7('0x56')]({'name':_0x5e3433[_0x40c7('0x2e')],'resourceId':_0x5e3433['id'],'type':_0x40c7('0x2a'),'sectionId':_0x8b1776['id']},{})['then'](function(){return _0x5ad102;});}else{return _0x5ad102;}})[_0x40c7('0x4c')](function(_0x1d911b){logger[_0x40c7('0x2c')](_0x40c7('0x57'),_0x1d911b);throw _0x1d911b;});}return _0x5ad102;})[_0x40c7('0x28')](respondWithResult(_0x3315c3,0xc9))['catch'](handleError(_0x3315c3,null));};exports[_0x40c7('0x26')]=function(_0x4c4d28,_0x507d76){if(_0x4c4d28[_0x40c7('0x58')]['id']){delete _0x4c4d28[_0x40c7('0x58')]['id'];}return db[_0x40c7('0x31')][_0x40c7('0x4f')]({'where':{'id':_0x4c4d28[_0x40c7('0x4e')]['id']}})[_0x40c7('0x28')](handleEntityNotFound(_0x507d76,null))[_0x40c7('0x28')](saveUpdates(_0x4c4d28['body'],null))[_0x40c7('0x28')](respondWithResult(_0x507d76,null))[_0x40c7('0x4c')](handleError(_0x507d76,null));};exports[_0x40c7('0x27')]=function(_0x28eb9b,_0x58c99d){return db['AnalyticCustomReport'][_0x40c7('0x4f')]({'where':{'id':_0x28eb9b['params']['id']}})[_0x40c7('0x28')](handleEntityNotFound(_0x58c99d,null))[_0x40c7('0x28')](removeEntity(_0x58c99d,null))[_0x40c7('0x4c')](handleError(_0x58c99d,null));};exports[_0x40c7('0x59')]=function(_0x15e596,_0x54f952){var _0x50d744=0xa;var _0xd82fba=[_0x40c7('0x5a'),_0x40c7('0x5b'),_0x40c7('0x5c'),_0x40c7('0x5d')];var _0x37c826={'SUM':_0x40c7('0x5e'),'COUNT':_0x40c7('0x5f'),'COUNT DISTINCT':_0x40c7('0x60'),'MAX':'MAX(%s)','MIN':_0x40c7('0x61'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x40c7('0x62'),'GROUP_CONCAT DESC':_0x40c7('0x63')};var _0x58ebb0={'SEC_TO_TIME':_0x40c7('0x64'),'DATE':_0x40c7('0x65'),'HOUR':_0x40c7('0x66'),'ROUND':_0x40c7('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1e93d2=function(_0xb1cfb8){return!_[_0x40c7('0x68')]([_0x40c7('0x69'),_0x40c7('0x6a'),'IS\x20EMPTY',_0x40c7('0x6b')],_0xb1cfb8);};var _0xe41013=function(_0xc379b3){if(!_0xc379b3||!_0xc379b3[_0x40c7('0x6c')]['length']){return'';}for(var _0x27677d='(',_0x4289bb=0x0;_0x4289bb<_0xc379b3[_0x40c7('0x6c')][_0x40c7('0x3d')];_0x4289bb+=0x1){_0x4289bb>0x0&&(_0x27677d+='\x20'+_0xc379b3[_0x40c7('0x6d')]+'\x20');_0x27677d+=_0xc379b3[_0x40c7('0x6c')][_0x4289bb][_0x40c7('0x6e')]?_0xe41013(_0xc379b3['rules'][_0x4289bb][_0x40c7('0x6e')]):_0xc379b3[_0x40c7('0x6c')][_0x4289bb][_0x40c7('0x6f')]+'\x20'+_0xc379b3[_0x40c7('0x6c')][_0x4289bb][_0x40c7('0x70')]+(_0x1e93d2(_0xc379b3[_0x40c7('0x6c')][_0x4289bb]['condition'])?'\x20'+_0xc379b3['rules'][_0x4289bb]['value']:'');}return _0x27677d+')';};var _0x53b854={'where':{'id':_0x15e596[_0x40c7('0x4e')]['id']}},_0x457cb0,_0x2c76da,_0x147506,_0x1557ef,_0x3dc9be;_0x53b854=_[_0x40c7('0x45')]({},_0x53b854,_0x15e596[_0x40c7('0x47')]);return db[_0x40c7('0x31')][_0x40c7('0x4f')](_0x53b854)['then'](function(_0x4745c7){if(_0x4745c7){_0x457cb0=_0x4745c7;return _0x4745c7[_0x40c7('0x71')]();}return null;})[_0x40c7('0x28')](function(_0x26951f){if(_0x26951f){if(!_0x26951f[_0x40c7('0x3d')]){throw new db[(_0x40c7('0x72'))][(_0x40c7('0x73'))](_0x40c7('0x74'),0x193);}_0x2c76da=_0x26951f;return db[_0x40c7('0x75')][_0x40c7('0x4a')]({'raw':!![]});}return null;})['then'](function(_0x553fb9){if(_0x553fb9){_0x147506=_[_0x40c7('0x76')](_0x553fb9,'id');var _0x2054aa;var _0x13ee44=squel[_0x40c7('0x77')]();_0x13ee44[_0x40c7('0x78')](_0x457cb0[_0x40c7('0x79')]);for(var _0x353b11=0x0;_0x353b11<_0x2c76da['length'];_0x353b11+=0x1){_0x2054aa=_0x2c76da[_0x353b11][_0x40c7('0x7a')]?_0x147506[_0x2c76da[_0x353b11][_0x40c7('0x7a')]][_0x40c7('0x7b')]:_0x2c76da[_0x353b11][_0x40c7('0x6f')];_0x2054aa=_0x2c76da[_0x353b11][_0x40c7('0x7c')]?_[_0x40c7('0x7d')](_0x37c826[_0x2c76da[_0x353b11]['function']],'%s',_0x2054aa):_0x2054aa;_0x2054aa=_0x2c76da[_0x353b11][_0x40c7('0x7e')]?_[_0x40c7('0x7d')](_0x58ebb0[_0x2c76da[_0x353b11][_0x40c7('0x7e')]],'%s',_0x2054aa):_0x2054aa;if(_0x2c76da[_0x353b11][_0x40c7('0x7f')]){_0x13ee44[_0x40c7('0x6e')](_0x2054aa);}_0x2c76da[_0x353b11][_0x40c7('0x80')]&&_0x13ee44[_0x40c7('0x40')](_0x2054aa,_0x2c76da[_0x353b11][_0x40c7('0x80')]===_0x40c7('0x81')?![]:!![]);_0x13ee44['field'](_0x2054aa,_0x2c76da[_0x353b11][_0x40c7('0x82')]||_0x2054aa);}if(_0x457cb0['joins']){_0x457cb0[_0x40c7('0x83')]=JSON['parse'](_0x457cb0[_0x40c7('0x83')]);for(var _0xd6184c=0x0;_0xd6184c<_0x457cb0['joins'][_0x40c7('0x3d')];_0xd6184c+=0x1){if(_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x34')]&&_[_0x40c7('0x68')](_0xd82fba,_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x34')])&&_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x84')]&&_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x85')]&&_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x86')]){_0x13ee44[_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x34')]](_0x457cb0['joins'][_0xd6184c]['foreignTable'],null,util[_0x40c7('0x7e')](_0x40c7('0x87'),_0x457cb0[_0x40c7('0x79')],_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x84')],_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x85')],_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x86')]));}}}if(_0x457cb0[_0x40c7('0x88')]){_0x457cb0[_0x40c7('0x88')]=JSON[_0x40c7('0x89')](_0x457cb0[_0x40c7('0x88')]);_0x13ee44['where'](_0xe41013(_0x457cb0[_0x40c7('0x88')][_0x40c7('0x6e')]));}_0x3dc9be=_0x13ee44['clone']();_0x13ee44[_0x40c7('0x1d')](_0x50d744);_0x13ee44['offset'](0x0);logger['debug'](_0x40c7('0x8a'),_0x13ee44[_0x40c7('0x8b')]());return dbH[_0x40c7('0x8c')][_0x40c7('0x38')](_0x13ee44[_0x40c7('0x8b')](),{'type':dbH[_0x40c7('0x8c')][_0x40c7('0x8d')][_0x40c7('0x8e')]});}})[_0x40c7('0x28')](respondWithResult(_0x54f952,null))[_0x40c7('0x4c')](handleError(_0x54f952,null));};function runReport(_0x46068d,_0x1bc791,_0x183f17){var _0xcc758e=_0x1bc791[_0x40c7('0x2e')];var _0x3b6310=0xa;var _0x5b1931=['join',_0x40c7('0x5b'),_0x40c7('0x5c'),_0x40c7('0x5d')];var _0x2d43e2={'SUM':_0x40c7('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x40c7('0x60'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x40c7('0x8f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x40c7('0x63')};var _0x550d87={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x40c7('0x65'),'HOUR':_0x40c7('0x66'),'ROUND':_0x40c7('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1e9=function(_0x41f304){return!_[_0x40c7('0x68')]([_0x40c7('0x69'),'IS\x20NOT\x20NULL',_0x40c7('0x90'),'IS\x20NOT\x20EMPTY'],_0x41f304);};var _0x205753=function(_0x39c482){if(!_0x39c482||!_0x39c482['rules']['length']){return'';}for(var _0x1bd470='(',_0x2a1cdb=0x0;_0x2a1cdb<_0x39c482['rules']['length'];_0x2a1cdb+=0x1){_0x2a1cdb>0x0&&(_0x1bd470+='\x20'+_0x39c482['operator']+'\x20');_0x1bd470+=_0x39c482[_0x40c7('0x6c')][_0x2a1cdb][_0x40c7('0x6e')]?_0x205753(_0x39c482[_0x40c7('0x6c')][_0x2a1cdb][_0x40c7('0x6e')]):_0x39c482[_0x40c7('0x6c')][_0x2a1cdb]['field']+'\x20'+_0x39c482[_0x40c7('0x6c')][_0x2a1cdb]['condition']+(_0x34c1e9(_0x39c482[_0x40c7('0x6c')][_0x2a1cdb][_0x40c7('0x70')])?'\x20'+_0x39c482['rules'][_0x2a1cdb][_0x40c7('0x91')]:'');}return _0x1bd470+')';};var _0x2ae098={'where':{'id':_0x46068d['id']}},_0x3a179c,_0x1a33a2,_0x25ebfe,_0x433f0a,_0x3a2bc6;_0x2ae098=_[_0x40c7('0x45')]({},_0x2ae098,_0x183f17);return db['AnalyticCustomReport'][_0x40c7('0x4f')](_0x2ae098)[_0x40c7('0x28')](function(_0x5c60f1){if(_0x5c60f1){_0x3a179c=_0x5c60f1;return _0x5c60f1[_0x40c7('0x71')]();}return null;})['then'](function(_0x3d4b47){if(_0x3d4b47){if(!_0x3d4b47[_0x40c7('0x3d')]){throw new db['Sequelize'][(_0x40c7('0x73'))](_0x40c7('0x74'),0x193);}_0x1a33a2=_0x3d4b47;return db['AnalyticMetric'][_0x40c7('0x4a')]({'raw':!![]});}return null;})['then'](function(_0x207518){if(_0x207518){_0x25ebfe=_[_0x40c7('0x76')](_0x207518,'id');var _0x52c54c;var _0x3b989e=squel[_0x40c7('0x77')]();_0x3b989e[_0x40c7('0x78')](_0x3a179c[_0x40c7('0x79')]);for(var _0x348025=0x0;_0x348025<_0x1a33a2[_0x40c7('0x3d')];_0x348025+=0x1){_0x52c54c=_0x1a33a2[_0x348025][_0x40c7('0x7a')]?_0x25ebfe[_0x1a33a2[_0x348025][_0x40c7('0x7a')]][_0x40c7('0x7b')]:_0x1a33a2[_0x348025][_0x40c7('0x6f')];_0x52c54c=_0x1a33a2[_0x348025][_0x40c7('0x7c')]?_[_0x40c7('0x7d')](_0x2d43e2[_0x1a33a2[_0x348025]['function']],'%s',_0x52c54c):_0x52c54c;_0x52c54c=_0x1a33a2[_0x348025][_0x40c7('0x7e')]?_[_0x40c7('0x7d')](_0x550d87[_0x1a33a2[_0x348025][_0x40c7('0x7e')]],'%s',_0x52c54c):_0x52c54c;if(_0x1a33a2[_0x348025][_0x40c7('0x7f')]){_0x3b989e[_0x40c7('0x6e')](_0x52c54c);}_0x1a33a2[_0x348025]['orderBy']&&_0x3b989e[_0x40c7('0x40')](_0x52c54c,_0x1a33a2[_0x348025][_0x40c7('0x80')]===_0x40c7('0x81')?![]:!![]);_0x3b989e['field'](_0x52c54c,_0x1a33a2[_0x348025][_0x40c7('0x82')]||_0x52c54c);}if(_0x3a179c[_0x40c7('0x83')]){_0x3a179c[_0x40c7('0x83')]=JSON['parse'](_0x3a179c[_0x40c7('0x83')]);for(var _0x3c3e99=0x0;_0x3c3e99<_0x3a179c[_0x40c7('0x83')][_0x40c7('0x3d')];_0x3c3e99+=0x1){if(_0x3a179c[_0x40c7('0x83')][_0x3c3e99][_0x40c7('0x34')]&&_['includes'](_0x5b1931,_0x3a179c['joins'][_0x3c3e99][_0x40c7('0x34')])&&_0x3a179c[_0x40c7('0x83')][_0x3c3e99][_0x40c7('0x84')]&&_0x3a179c[_0x40c7('0x83')][_0x3c3e99][_0x40c7('0x85')]&&_0x3a179c['joins'][_0x3c3e99]['foreignKey']){_0x3b989e[_0x3a179c[_0x40c7('0x83')][_0x3c3e99]['type']](_0x3a179c[_0x40c7('0x83')][_0x3c3e99][_0x40c7('0x85')],null,util[_0x40c7('0x7e')](_0x40c7('0x87'),_0x3a179c[_0x40c7('0x79')],_0x3a179c['joins'][_0x3c3e99][_0x40c7('0x84')],_0x3a179c[_0x40c7('0x83')][_0x3c3e99][_0x40c7('0x85')],_0x3a179c[_0x40c7('0x83')][_0x3c3e99][_0x40c7('0x86')]));}}}if(_0x3a179c[_0x40c7('0x88')]){_0x3a179c[_0x40c7('0x88')]=JSON[_0x40c7('0x89')](_0x3a179c[_0x40c7('0x88')]);_0x3b989e[_0x40c7('0x42')](_0x205753(_0x3a179c[_0x40c7('0x88')][_0x40c7('0x6e')]));}_0x3a2bc6=_0x3b989e[_0x40c7('0x92')]();_0x3b989e[_0x40c7('0x1d')](_0x3b6310);_0x3b989e[_0x40c7('0x1e')](0x0);return;}})[_0x40c7('0x28')](function(){if(_0x1bc791[_0x40c7('0x93')]===_0x40c7('0x94')){return null;}var _0x14c8b9=_['merge'](_0x1bc791,{'name':_0x1bc791[_0x40c7('0x95')]||_0x1bc791[_0x40c7('0x2e')]||_0x3a179c[_0x40c7('0x2e')],'basename':_0xcc758e,'savename':util['format'](_0x40c7('0x96'),_0x1bc791[_0x40c7('0x2e')]||_0x3a179c[_0x40c7('0x2e')],require(_0x40c7('0x97'))[_0x40c7('0x98')](0x4),_0x1bc791[_0x40c7('0x93')]||_0x40c7('0x99')),'reportId':_0x3a179c['id'],'reportType':_0x40c7('0x9a')});return db[_0x40c7('0x9b')][_0x40c7('0x56')](_0x14c8b9,{'raw':!![]});})[_0x40c7('0x28')](function(_0x15afec){if(_0x3a179c[_0x40c7('0x79')]==='cdr'){_0x3a2bc6['where'](_0x3a179c[_0x40c7('0x79')]+_0x40c7('0x9c'),_0x1bc791['startDate'],_0x1bc791[_0x40c7('0x9d')]);}else{_0x3a2bc6[_0x40c7('0x42')](_0x3a179c['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1bc791[_0x40c7('0x9e')],_0x1bc791['endDate']);}if(_0x15afec){logger['info']('Run\x20Query:',_0x3a2bc6[_0x40c7('0x8b')]());require('child_process')[_0x40c7('0x9f')](path[_0x40c7('0x5a')](__dirname,_0x40c7('0xa0'),_0x15afec['output']),[_0x15afec['id'],_0x3a2bc6[_0x40c7('0x8b')](),path['join'](__dirname,'../../files/reports',_0x15afec['savename']),_0xcc758e]);return _0x15afec;}else{var _0x392ce9=squel[_0x40c7('0x77')]();_0x392ce9['from']('('+_0x3a2bc6[_0x40c7('0x8b')]()+')',_0x40c7('0xa1'));_0x392ce9['field'](_0x40c7('0xa2'),_0x40c7('0x1f'));_0x3a2bc6[_0x40c7('0x1d')](_0x1bc791[_0x40c7('0x1d')]||_0x3b6310);_0x3a2bc6[_0x40c7('0x1e')](_0x1bc791[_0x40c7('0x1e')]||0x0);return dbH[_0x40c7('0x8c')][_0x40c7('0x38')](_0x392ce9[_0x40c7('0x8b')](),{'type':dbH['sequelize'][_0x40c7('0x8d')][_0x40c7('0x8e')]})[_0x40c7('0x28')](function(_0x18795d){if(!_0x18795d[_0x40c7('0x3d')]){_0x433f0a=0x0;}else{_0x433f0a=_0x18795d[0x0][_0x40c7('0x1f')]||0x0;}return dbH[_0x40c7('0x8c')][_0x40c7('0x38')](_0x3a2bc6[_0x40c7('0x8b')](),{'type':dbH['sequelize'][_0x40c7('0x8d')][_0x40c7('0x8e')]});})[_0x40c7('0x28')](function(_0x2a2ae8){return{'rows':_0x2a2ae8||[],'count':_0x433f0a};});}});}exports[_0x40c7('0xa3')]=function(_0x389e64,_0x399349){return runReport(_0x389e64[_0x40c7('0x4e')],_0x389e64[_0x40c7('0x38')],_0x389e64[_0x40c7('0x47')])[_0x40c7('0x28')](respondWithResult(_0x399349,null))[_0x40c7('0x4c')](handleError(_0x399349,null));};exports[_0x40c7('0xa4')]=runReport;exports[_0x40c7('0x38')]=function(_0x4d8c1f,_0x138f19){var _0x1c49e2=0xa;var _0x503267=[_0x40c7('0x5a'),_0x40c7('0x5b'),_0x40c7('0x5c'),_0x40c7('0x5d')];var _0x39fcc0={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x40c7('0x60'),'MAX':_0x40c7('0xa5'),'MIN':_0x40c7('0x61'),'AVG':_0x40c7('0xa6'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x40c7('0x62'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x12db73={'SEC_TO_TIME':_0x40c7('0x64'),'DATE':_0x40c7('0x65'),'HOUR':_0x40c7('0x66'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x40c7('0xa7')};var _0x255ddb=function(_0x18c899){return!_[_0x40c7('0x68')]([_0x40c7('0x69'),_0x40c7('0x6a'),_0x40c7('0x90'),'IS\x20NOT\x20EMPTY'],_0x18c899);};var _0x2b936c=function(_0x138ed3){if(!_0x138ed3||!_0x138ed3[_0x40c7('0x6c')][_0x40c7('0x3d')]){return'';}for(var _0x51ee73='(',_0x16572e=0x0;_0x16572e<_0x138ed3[_0x40c7('0x6c')]['length'];_0x16572e+=0x1){_0x16572e>0x0&&(_0x51ee73+='\x20'+_0x138ed3[_0x40c7('0x6d')]+'\x20');_0x51ee73+=_0x138ed3[_0x40c7('0x6c')][_0x16572e][_0x40c7('0x6e')]?_0x2b936c(_0x138ed3[_0x40c7('0x6c')][_0x16572e][_0x40c7('0x6e')]):_0x138ed3[_0x40c7('0x6c')][_0x16572e][_0x40c7('0x6f')]+'\x20'+_0x138ed3[_0x40c7('0x6c')][_0x16572e][_0x40c7('0x70')]+(_0x255ddb(_0x138ed3[_0x40c7('0x6c')][_0x16572e][_0x40c7('0x70')])?'\x20'+_0x138ed3[_0x40c7('0x6c')][_0x16572e][_0x40c7('0x91')]:'');}return _0x51ee73+')';};var _0x16e1fc={'where':{'id':_0x4d8c1f['params']['id']}},_0x5034ad,_0x4cdf28,_0x55e111,_0x4567fc,_0xeb3b6;_0x16e1fc=_[_0x40c7('0x45')]({},_0x16e1fc,_0x4d8c1f[_0x40c7('0x47')]);return db[_0x40c7('0x31')][_0x40c7('0x4f')](_0x16e1fc)[_0x40c7('0x28')](function(_0x3d4a6b){if(_0x3d4a6b){_0x5034ad=_0x3d4a6b;return _0x3d4a6b['getFields']();}return null;})[_0x40c7('0x28')](function(_0x3b6c1b){if(_0x3b6c1b){if(!_0x3b6c1b[_0x40c7('0x3d')]){throw new db['Sequelize'][(_0x40c7('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cdf28=_0x3b6c1b;return db['AnalyticMetric'][_0x40c7('0x4a')]({'raw':!![]});}return null;})[_0x40c7('0x28')](function(_0x557f06){if(_0x557f06){_0x55e111=_['keyBy'](_0x557f06,'id');var _0x1319ae;var _0x2e1407=squel[_0x40c7('0x77')]();_0x2e1407[_0x40c7('0x78')](_0x5034ad[_0x40c7('0x79')]);for(var _0x50c065=0x0;_0x50c065<_0x4cdf28[_0x40c7('0x3d')];_0x50c065+=0x1){_0x1319ae=_0x4cdf28[_0x50c065][_0x40c7('0x7a')]?_0x55e111[_0x4cdf28[_0x50c065][_0x40c7('0x7a')]][_0x40c7('0x7b')]:_0x4cdf28[_0x50c065][_0x40c7('0x6f')];_0x1319ae=_0x4cdf28[_0x50c065][_0x40c7('0x7c')]?_[_0x40c7('0x7d')](_0x39fcc0[_0x4cdf28[_0x50c065]['function']],'%s',_0x1319ae):_0x1319ae;_0x1319ae=_0x4cdf28[_0x50c065][_0x40c7('0x7e')]?_['replace'](_0x12db73[_0x4cdf28[_0x50c065]['format']],'%s',_0x1319ae):_0x1319ae;if(_0x4cdf28[_0x50c065][_0x40c7('0x7f')]){_0x2e1407[_0x40c7('0x6e')](_0x1319ae);}_0x4cdf28[_0x50c065][_0x40c7('0x80')]&&_0x2e1407[_0x40c7('0x40')](_0x1319ae,_0x4cdf28[_0x50c065][_0x40c7('0x80')]===_0x40c7('0x81')?![]:!![]);_0x2e1407[_0x40c7('0x6f')](_0x1319ae,_0x4cdf28[_0x50c065][_0x40c7('0x82')]||_0x1319ae);}if(_0x5034ad[_0x40c7('0x83')]){_0x5034ad[_0x40c7('0x83')]=JSON['parse'](_0x5034ad[_0x40c7('0x83')]);for(var _0x31c259=0x0;_0x31c259<_0x5034ad[_0x40c7('0x83')][_0x40c7('0x3d')];_0x31c259+=0x1){if(_0x5034ad[_0x40c7('0x83')][_0x31c259][_0x40c7('0x34')]&&_['includes'](_0x503267,_0x5034ad[_0x40c7('0x83')][_0x31c259][_0x40c7('0x34')])&&_0x5034ad['joins'][_0x31c259][_0x40c7('0x84')]&&_0x5034ad['joins'][_0x31c259][_0x40c7('0x85')]&&_0x5034ad['joins'][_0x31c259][_0x40c7('0x86')]){_0x2e1407[_0x5034ad['joins'][_0x31c259][_0x40c7('0x34')]](_0x5034ad[_0x40c7('0x83')][_0x31c259][_0x40c7('0x85')],null,util[_0x40c7('0x7e')]('%s.%s\x20=\x20%s.%s',_0x5034ad[_0x40c7('0x79')],_0x5034ad['joins'][_0x31c259][_0x40c7('0x84')],_0x5034ad[_0x40c7('0x83')][_0x31c259]['foreignTable'],_0x5034ad[_0x40c7('0x83')][_0x31c259][_0x40c7('0x86')]));}}}if(_0x5034ad[_0x40c7('0x88')]){_0x5034ad[_0x40c7('0x88')]=JSON['parse'](_0x5034ad[_0x40c7('0x88')]);_0x2e1407['where'](_0x2b936c(_0x5034ad['conditions'][_0x40c7('0x6e')]));}_0xeb3b6=_0x2e1407['clone']();_0x2e1407['limit'](_0x1c49e2);_0x2e1407[_0x40c7('0x1e')](0x0);logger[_0x40c7('0xa8')]('Limited\x20Query:',_0x2e1407[_0x40c7('0x8b')]());return dbH[_0x40c7('0x8c')]['query'](_0x2e1407[_0x40c7('0x8b')](),{'type':dbH[_0x40c7('0x8c')][_0x40c7('0x8d')][_0x40c7('0x8e')]});}})[_0x40c7('0x28')](function(){return{'sql':_0xeb3b6[_0x40c7('0x8b')]()};})[_0x40c7('0x28')](respondWithResult(_0x138f19,null))['catch'](handleError(_0x138f19,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 95feeb1..edf7764 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 _0xa4ef=['bluebird','request-promise','exports','define','AnalyticCustomReport','lodash','util','api'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xa4ef,0x9d));var _0xfa4e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa4ef[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xfa4e('0x0'));var util=require(_0xfa4e('0x1'));var logger=require('../../config/logger')(_0xfa4e('0x2'));var moment=require('moment');var BPromise=require(_0xfa4e('0x3'));var rp=require(_0xfa4e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0xfa4e('0x5')]=function(_0x8481c2,_0x406fd6){return _0x8481c2[_0xfa4e('0x6')](_0xfa4e('0x7'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e11=['path','../../config/environment','./analyticCustomReport.attributes','analytics_custom_reports','../../config/logger','moment'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x0e11,0xac));var _0x10e1=function(_0x2c14dc,_0xccf442){_0x2c14dc=_0x2c14dc-0x0;var _0x1f18e5=_0x0e11[_0x2c14dc];return _0x1f18e5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x10e1('0x0'))('api');var moment=require(_0x10e1('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x10e1('0x2'));var rimraf=require('rimraf');var config=require(_0x10e1('0x3'));var attributes=require(_0x10e1('0x4'));module['exports']=function(_0x3dfd3e,_0x45a19c){return _0x3dfd3e['define']('AnalyticCustomReport',attributes,{'tableName':_0x10e1('0x5'),'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 faca118..b81d571 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 _0x661f=['../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','lodash','util','moment','randomstring','ioredis'];(function(_0x113775,_0x496335){var _0x110077=function(_0x34271e){while(--_0x34271e){_0x113775['push'](_0x113775['shift']());}};_0x110077(++_0x496335);}(_0x661f,0x73));var _0xf661=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x661f[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0xf661('0x0'));var util=require(_0xf661('0x1'));var moment=require(_0xf661('0x2'));var BPromise=require('bluebird');var rs=require(_0xf661('0x3'));var fs=require('fs');var Redis=require(_0xf661('0x4'));var db=require(_0xf661('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf661('0x6'))('rpc');var config=require(_0xf661('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf661('0x8')][_0xf661('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x593f7d,_0x400889,_0x346187){return new BPromise(function(_0xf2c128,_0x54cfec){return client[_0xf661('0xa')](_0x593f7d,_0x346187)[_0xf661('0xb')](function(_0xa866e1){logger[_0xf661('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x400889,_0xf661('0xd'));logger['debug'](_0xf661('0xe'),_0x400889,_0xf661('0xd'),JSON[_0xf661('0xf')](_0xa866e1));if(_0xa866e1[_0xf661('0x10')]){if(_0xa866e1[_0xf661('0x10')][_0xf661('0x11')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x400889,_0xa866e1[_0xf661('0x10')]['message']);return _0x54cfec(_0xa866e1[_0xf661('0x10')][_0xf661('0x12')]);}logger[_0xf661('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x400889,_0xa866e1['error'][_0xf661('0x12')]);return _0xf2c128(_0xa866e1[_0xf661('0x10')][_0xf661('0x12')]);}else{logger[_0xf661('0xc')](_0xf661('0x13'),_0x400889,'request\x20sent');_0xf2c128(_0xa866e1['result'][_0xf661('0x12')]);}})['catch'](function(_0x32b5a2){logger[_0xf661('0x10')](_0xf661('0x13'),_0x400889,_0x32b5a2);_0x54cfec(_0x32b5a2);});});}
\ No newline at end of file
+var _0xc762=['jayson/promise','client','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x23f132,_0x5d919e){var _0x2b10bf=function(_0x396c0d){while(--_0x396c0d){_0x23f132['push'](_0x23f132['shift']());}};_0x2b10bf(++_0x5d919e);}(_0xc762,0x19d));var _0x2c76=function(_0x126f47,_0x2199e9){_0x126f47=_0x126f47-0x0;var _0x49508a=_0xc762[_0x126f47];return _0x49508a;};'use strict';var _=require(_0x2c76('0x0'));var util=require(_0x2c76('0x1'));var moment=require('moment');var BPromise=require(_0x2c76('0x2'));var rs=require(_0x2c76('0x3'));var fs=require('fs');var Redis=require(_0x2c76('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c76('0x5'));var logger=require('../../config/logger')(_0x2c76('0x6'));var config=require('../../config/environment');var jayson=require(_0x2c76('0x7'));var client=jayson[_0x2c76('0x8')][_0x2c76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x539f86,_0x214c57,_0x474187){return new BPromise(function(_0x3acafe,_0x321529){return client['request'](_0x539f86,_0x474187)[_0x2c76('0xa')](function(_0x5578d9){logger['info'](_0x2c76('0xb'),_0x214c57,_0x2c76('0xc'));logger[_0x2c76('0xd')](_0x2c76('0xe'),_0x214c57,'request\x20sent',JSON['stringify'](_0x5578d9));if(_0x5578d9['error']){if(_0x5578d9['error']['code']===0x1f4){logger[_0x2c76('0xf')](_0x2c76('0xb'),_0x214c57,_0x5578d9[_0x2c76('0xf')][_0x2c76('0x10')]);return _0x321529(_0x5578d9['error']['message']);}logger['error'](_0x2c76('0xb'),_0x214c57,_0x5578d9[_0x2c76('0xf')][_0x2c76('0x10')]);return _0x3acafe(_0x5578d9['error'][_0x2c76('0x10')]);}else{logger[_0x2c76('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x214c57,_0x2c76('0xc'));_0x3acafe(_0x5578d9[_0x2c76('0x12')][_0x2c76('0x10')]);}})[_0x2c76('0x13')](function(_0x2ca778){logger['error'](_0x2c76('0xb'),_0x214c57,_0x2ca778);_0x321529(_0x2ca778);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index ddebd5c..d180093 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 _0x4e6d=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','/:id','delete','exports','util'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x4e6d,0x92));var _0xd4e6=function(_0x363842,_0x369636){_0x363842=_0x363842-0x0;var _0x257bc2=_0x4e6d[_0x363842];return _0x257bc2;};'use strict';var multer=require('multer');var util=require(_0xd4e6('0x0'));var path=require(_0xd4e6('0x1'));var timeout=require('connect-timeout');var express=require(_0xd4e6('0x2'));var router=express[_0xd4e6('0x3')]();var fs_extra=require(_0xd4e6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd4e6('0x5'));var config=require(_0xd4e6('0x6'));var controller=require('./analyticCustomReport.controller');router[_0xd4e6('0x7')]('/',auth[_0xd4e6('0x8')](),controller['index']);router['get']('/:id',auth[_0xd4e6('0x8')](),controller[_0xd4e6('0x9')]);router[_0xd4e6('0x7')](_0xd4e6('0xa'),auth[_0xd4e6('0x8')](),controller[_0xd4e6('0xb')]);router['get'](_0xd4e6('0xc'),auth[_0xd4e6('0x8')](),controller['run']);router['get'](_0xd4e6('0xd'),auth[_0xd4e6('0x8')](),controller[_0xd4e6('0xe')]);router[_0xd4e6('0xf')]('/',auth[_0xd4e6('0x8')](),controller[_0xd4e6('0x10')]);router[_0xd4e6('0x11')](_0xd4e6('0x12'),auth[_0xd4e6('0x8')](),controller['update']);router[_0xd4e6('0x13')](_0xd4e6('0x12'),auth[_0xd4e6('0x8')](),controller['destroy']);module[_0xd4e6('0x14')]=router;
\ No newline at end of file
+var _0x050b=['/:id/query','query','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run'];(function(_0x35d753,_0x49b3d8){var _0x206b94=function(_0x7ddf74){while(--_0x7ddf74){_0x35d753['push'](_0x35d753['shift']());}};_0x206b94(++_0x49b3d8);}(_0x050b,0xc6));var _0xb050=function(_0x522d54,_0x30e08f){_0x522d54=_0x522d54-0x0;var _0x28eec0=_0x050b[_0x522d54];return _0x28eec0;};'use strict';var multer=require(_0xb050('0x0'));var util=require('util');var path=require(_0xb050('0x1'));var timeout=require(_0xb050('0x2'));var express=require(_0xb050('0x3'));var router=express[_0xb050('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb050('0x5'));var interaction=require(_0xb050('0x6'));var config=require(_0xb050('0x7'));var controller=require(_0xb050('0x8'));router['get']('/',auth[_0xb050('0x9')](),controller[_0xb050('0xa')]);router[_0xb050('0xb')](_0xb050('0xc'),auth['isAuthenticated'](),controller[_0xb050('0xd')]);router[_0xb050('0xb')](_0xb050('0xe'),auth[_0xb050('0x9')](),controller[_0xb050('0xf')]);router[_0xb050('0xb')](_0xb050('0x10'),auth[_0xb050('0x9')](),controller[_0xb050('0x11')]);router['get'](_0xb050('0x12'),auth[_0xb050('0x9')](),controller[_0xb050('0x13')]);router[_0xb050('0x14')]('/',auth[_0xb050('0x9')](),controller[_0xb050('0x15')]);router[_0xb050('0x16')]('/:id',auth[_0xb050('0x9')](),controller[_0xb050('0x17')]);router[_0xb050('0x18')](_0xb050('0xc'),auth[_0xb050('0x9')](),controller[_0xb050('0x19')]);module[_0xb050('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 417a8d5..8be04e1 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 _0x7217=['sequelize','STRING','TEXT'];(function(_0x5ddd23,_0x38b636){var _0x15ebce=function(_0x3a0170){while(--_0x3a0170){_0x5ddd23['push'](_0x5ddd23['shift']());}};_0x15ebce(++_0x38b636);}(_0x7217,0x19e));var _0x7721=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7217[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xc4aa=['STRING','sequelize','exports'];(function(_0x3840fe,_0x4c9105){var _0xfbc02=function(_0x4796c1){while(--_0x4796c1){_0x3840fe['push'](_0x3840fe['shift']());}};_0xfbc02(++_0x4c9105);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 2369cc6..dd5ecf3 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 _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x4c5822,_0x4e552f){var _0x46b2ba=function(_0x20bce8){while(--_0x20bce8){_0x4c5822['push'](_0x4c5822['shift']());}};_0x46b2ba(++_0x4e552f);}(_0x2675,0x75));var _0x5267=function(_0x476f40,_0x3ab80e){_0x476f40=_0x476f40-0x0;var _0x263172=_0x2675[_0x476f40];return _0x263172;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));};
\ No newline at end of file
+var _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x347ea8,_0x2ac098){var _0x2e83f4=function(_0x430d5f){while(--_0x430d5f){_0x347ea8['push'](_0x347ea8['shift']());}};_0x2e83f4(++_0x2ac098);}(_0xda19,0xd5));var _0x9da1=function(_0x2df852,_0x1bba56){_0x2df852=_0x2df852-0x0;var _0x539ff8=_0xda19[_0x2df852];return _0x539ff8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index bc6e601..b60eb38 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 _0x73b3=['../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','moment','bluebird','path','rimraf'];(function(_0x53c26d,_0x4ad64e){var _0x5727d6=function(_0x3be8c5){while(--_0x3be8c5){_0x53c26d['push'](_0x53c26d['shift']());}};_0x5727d6(++_0x4ad64e);}(_0x73b3,0xa0));var _0x373b=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x73b3[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0x373b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x373b('0x1'));var BPromise=require(_0x373b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x373b('0x3'));var rimraf=require(_0x373b('0x4'));var config=require(_0x373b('0x5'));var attributes=require(_0x373b('0x6'));module[_0x373b('0x7')]=function(_0x3d5d06,_0x47fee7){return _0x3d5d06[_0x373b('0x8')](_0x373b('0x9'),attributes,{'tableName':_0x373b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7fe0=['request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','bluebird'];(function(_0x38b02e,_0x5177cf){var _0x5cd622=function(_0x251d79){while(--_0x251d79){_0x38b02e['push'](_0x38b02e['shift']());}};_0x5cd622(++_0x5177cf);}(_0x7fe0,0xb1));var _0x07fe=function(_0x3bb12e,_0x5ebafa){_0x3bb12e=_0x3bb12e-0x0;var _0x536b9a=_0x7fe0[_0x3bb12e];return _0x536b9a;};'use strict';var _=require(_0x07fe('0x0'));var util=require(_0x07fe('0x1'));var logger=require('../../config/logger')(_0x07fe('0x2'));var moment=require(_0x07fe('0x3'));var BPromise=require(_0x07fe('0x4'));var rp=require(_0x07fe('0x5'));var fs=require('fs');var path=require(_0x07fe('0x6'));var rimraf=require(_0x07fe('0x7'));var config=require(_0x07fe('0x8'));var attributes=require(_0x07fe('0x9'));module[_0x07fe('0xa')]=function(_0x450ac1,_0x154a0a){return _0x450ac1[_0x07fe('0xb')](_0x07fe('0xc'),attributes,{'tableName':_0x07fe('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index b02476d..d8bc02b 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 _0x5b18=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x40dabf,_0x1b7cd9){var _0x14544f=function(_0x248e26){while(--_0x248e26){_0x40dabf['push'](_0x40dabf['shift']());}};_0x14544f(++_0x1b7cd9);}(_0x5b18,0xb2));var _0x85b1=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0x5b18[_0x5756f8];return _0x3bb749;};'use strict';var _=require(_0x85b1('0x0'));var util=require('util');var moment=require(_0x85b1('0x1'));var BPromise=require(_0x85b1('0x2'));var rs=require(_0x85b1('0x3'));var fs=require('fs');var Redis=require(_0x85b1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x85b1('0x5'))(_0x85b1('0x6'));var config=require(_0x85b1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x85b1('0x8')][_0x85b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x595800,_0x394d14,_0x5470a1){return new BPromise(function(_0x293847,_0x33d21d){return client['request'](_0x595800,_0x5470a1)[_0x85b1('0xa')](function(_0x3eed96){logger[_0x85b1('0xb')](_0x85b1('0xc'),_0x394d14,'request\x20sent');logger[_0x85b1('0xd')](_0x85b1('0xe'),_0x394d14,_0x85b1('0xf'),JSON[_0x85b1('0x10')](_0x3eed96));if(_0x3eed96[_0x85b1('0x11')]){if(_0x3eed96[_0x85b1('0x11')][_0x85b1('0x12')]===0x1f4){logger[_0x85b1('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x394d14,_0x3eed96[_0x85b1('0x11')]['message']);return _0x33d21d(_0x3eed96[_0x85b1('0x11')]['message']);}logger[_0x85b1('0x11')](_0x85b1('0xc'),_0x394d14,_0x3eed96[_0x85b1('0x11')][_0x85b1('0x13')]);return _0x293847(_0x3eed96['error'][_0x85b1('0x13')]);}else{logger[_0x85b1('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x394d14,'request\x20sent');_0x293847(_0x3eed96[_0x85b1('0x14')][_0x85b1('0x13')]);}})[_0x85b1('0x15')](function(_0x12688c){logger[_0x85b1('0x11')](_0x85b1('0xc'),_0x394d14,_0x12688c);_0x33d21d(_0x12688c);});});}
\ No newline at end of file
+var _0xadd6=['info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x4c1a15,_0x36abe4){var _0x195acb=function(_0x1104ee){while(--_0x1104ee){_0x4c1a15['push'](_0x4c1a15['shift']());}};_0x195acb(++_0x36abe4);}(_0xadd6,0x75));var _0x6add=function(_0x35e290,_0x1156b1){_0x35e290=_0x35e290-0x0;var _0x19dd62=_0xadd6[_0x35e290];return _0x19dd62;};'use strict';var _=require(_0x6add('0x0'));var util=require('util');var moment=require(_0x6add('0x1'));var BPromise=require('bluebird');var rs=require(_0x6add('0x2'));var fs=require('fs');var Redis=require(_0x6add('0x3'));var db=require(_0x6add('0x4'))['db'];var utils=require(_0x6add('0x5'));var logger=require('../../config/logger')(_0x6add('0x6'));var config=require(_0x6add('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6add('0x8')][_0x6add('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14570d,_0x465e11,_0x5ac775){return new BPromise(function(_0x4ec15f,_0x35b981){return client['request'](_0x14570d,_0x5ac775)['then'](function(_0x5df483){logger['info'](_0x6add('0xa'),_0x465e11,'request\x20sent');logger[_0x6add('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x465e11,_0x6add('0xc'),JSON['stringify'](_0x5df483));if(_0x5df483[_0x6add('0xd')]){if(_0x5df483[_0x6add('0xd')][_0x6add('0xe')]===0x1f4){logger[_0x6add('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x465e11,_0x5df483[_0x6add('0xd')][_0x6add('0xf')]);return _0x35b981(_0x5df483[_0x6add('0xd')][_0x6add('0xf')]);}logger[_0x6add('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x465e11,_0x5df483['error'][_0x6add('0xf')]);return _0x4ec15f(_0x5df483['error'][_0x6add('0xf')]);}else{logger[_0x6add('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x465e11,_0x6add('0xc'));_0x4ec15f(_0x5df483[_0x6add('0x11')][_0x6add('0xf')]);}})[_0x6add('0x12')](function(_0x196974){logger[_0x6add('0xd')](_0x6add('0xa'),_0x465e11,_0x196974);_0x35b981(_0x196974);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index fae4bf8..a9fc632 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 _0x2b1b=['preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./analyticDefaultReport.controller','get','/:id','isAuthenticated','/:id/preview'];(function(_0x201042,_0x50bd0a){var _0x17f363=function(_0x4d7519){while(--_0x4d7519){_0x201042['push'](_0x201042['shift']());}};_0x17f363(++_0x50bd0a);}(_0x2b1b,0x11f));var _0xb2b1=function(_0x1803c9,_0x4c7457){_0x1803c9=_0x1803c9-0x0;var _0x3b9840=_0x2b1b[_0x1803c9];return _0x3b9840;};'use strict';var multer=require(_0xb2b1('0x0'));var util=require(_0xb2b1('0x1'));var path=require(_0xb2b1('0x2'));var timeout=require('connect-timeout');var express=require(_0xb2b1('0x3'));var router=express[_0xb2b1('0x4')]();var fs_extra=require(_0xb2b1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb2b1('0x6'));var controller=require(_0xb2b1('0x7'));router[_0xb2b1('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb2b1('0x8')](_0xb2b1('0x9'),auth[_0xb2b1('0xa')](),controller['show']);router['get'](_0xb2b1('0xb'),auth[_0xb2b1('0xa')](),controller[_0xb2b1('0xc')]);router[_0xb2b1('0x8')](_0xb2b1('0xd'),auth[_0xb2b1('0xa')](),controller[_0xb2b1('0xe')]);router[_0xb2b1('0x8')](_0xb2b1('0xf'),auth['isAuthenticated'](),controller[_0xb2b1('0x10')]);router['post']('/',auth[_0xb2b1('0xa')](),controller[_0xb2b1('0x11')]);router[_0xb2b1('0x12')](_0xb2b1('0x9'),auth[_0xb2b1('0xa')](),controller[_0xb2b1('0x13')]);router[_0xb2b1('0x14')](_0xb2b1('0x9'),auth[_0xb2b1('0xa')](),controller[_0xb2b1('0x15')]);module[_0xb2b1('0x16')]=router;
\ No newline at end of file
+var _0x3600=['/:id/run','run','/:id/query','query','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show'];(function(_0x851fe,_0x25657a){var _0x2778ac=function(_0x3f94a7){while(--_0x3f94a7){_0x851fe['push'](_0x851fe['shift']());}};_0x2778ac(++_0x25657a);}(_0x3600,0x142));var _0x0360=function(_0x5b3906,_0x44dd0b){_0x5b3906=_0x5b3906-0x0;var _0x1c5844=_0x3600[_0x5b3906];return _0x1c5844;};'use strict';var multer=require(_0x0360('0x0'));var util=require(_0x0360('0x1'));var path=require(_0x0360('0x2'));var timeout=require(_0x0360('0x3'));var express=require(_0x0360('0x4'));var router=express[_0x0360('0x5')]();var fs_extra=require(_0x0360('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0360('0x7'));var config=require(_0x0360('0x8'));var controller=require(_0x0360('0x9'));router[_0x0360('0xa')]('/',auth[_0x0360('0xb')](),controller['index']);router[_0x0360('0xa')](_0x0360('0xc'),auth[_0x0360('0xb')](),controller[_0x0360('0xd')]);router[_0x0360('0xa')]('/:id/preview',auth[_0x0360('0xb')](),controller['preview']);router[_0x0360('0xa')](_0x0360('0xe'),auth[_0x0360('0xb')](),controller[_0x0360('0xf')]);router['get'](_0x0360('0x10'),auth[_0x0360('0xb')](),controller[_0x0360('0x11')]);router[_0x0360('0x12')]('/',auth[_0x0360('0xb')](),controller[_0x0360('0x13')]);router['put']('/:id',auth[_0x0360('0xb')](),controller[_0x0360('0x14')]);router[_0x0360('0x15')](_0x0360('0xc'),auth[_0x0360('0xb')](),controller[_0x0360('0x16')]);module[_0x0360('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 795afd0..7d65b0b 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 _0x727a=['manual','scheduled','INTEGER','moment','STRING','ENUM','csv','pdf','xlsx','DATE','Loading'];(function(_0x3b53d7,_0x2f2095){var _0x513d11=function(_0x369829){while(--_0x369829){_0x3b53d7['push'](_0x3b53d7['shift']());}};_0x513d11(++_0x2f2095);}(_0x727a,0x1e7));var _0xa727=function(_0x1860ee,_0x23372a){_0x1860ee=_0x1860ee-0x0;var _0x4d798d=_0x727a[_0x1860ee];return _0x4d798d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa727('0x0'));module['exports']={'name':{'type':Sequelize[_0xa727('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xa727('0x2')](_0xa727('0x3'),_0xa727('0x4'),_0xa727('0x5')),'allowNull':![],'defaultValue':_0xa727('0x3')},'savename':{'type':Sequelize[_0xa727('0x1')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xa727('0x6')]},'status':{'type':Sequelize[_0xa727('0x1')],'defaultValue':_0xa727('0x7')},'type':{'type':Sequelize[_0xa727('0x2')](_0xa727('0x8'),_0xa727('0x9')),'allowNull':![],'defaultValue':_0xa727('0x8')},'reportId':{'type':Sequelize[_0xa727('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xa727('0x1')]}};
\ No newline at end of file
+var _0x1a03=['exports','STRING','csv','pdf','xlsx','DATE','ENUM','manual','UNSIGNED','moment'];(function(_0x5965c7,_0x1ab31d){var _0x111855=function(_0x2b7ced){while(--_0x2b7ced){_0x5965c7['push'](_0x5965c7['shift']());}};_0x111855(++_0x1ab31d);}(_0x1a03,0x149));var _0x31a0=function(_0x403f5f,_0x283f67){_0x403f5f=_0x403f5f-0x0;var _0x15b1cd=_0x1a03[_0x403f5f];return _0x15b1cd;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x31a0('0x0'));module[_0x31a0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x31a0('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x31a0('0x3'),_0x31a0('0x4'),_0x31a0('0x5')),'allowNull':![],'defaultValue':_0x31a0('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x31a0('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x31a0('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x31a0('0x7')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x31a0('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x31a0('0x9')]},'reportType':{'type':Sequelize[_0x31a0('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 7c9fca9..7f358d0 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 _0xd021=['index','map','AnalyticExtractedReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','join','root','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','error','name','send'];(function(_0x5babb8,_0x453b94){var _0x4a2829=function(_0x40c8ff){while(--_0x40c8ff){_0x5babb8['push'](_0x5babb8['shift']());}};_0x4a2829(++_0x453b94);}(_0xd021,0x1ae));var _0x1d02=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd021[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x1d02('0x0'));var rimraf=require(_0x1d02('0x1'));var zipdir=require(_0x1d02('0x2'));var jsonpatch=require(_0x1d02('0x3'));var rp=require('request-promise');var moment=require(_0x1d02('0x4'));var BPromise=require(_0x1d02('0x5'));var Mustache=require(_0x1d02('0x6'));var util=require(_0x1d02('0x7'));var path=require(_0x1d02('0x8'));var sox=require(_0x1d02('0x9'));var csv=require(_0x1d02('0xa'));var ejs=require(_0x1d02('0xb'));var fs=require('fs');var fs_extra=require(_0x1d02('0xc'));var _=require('lodash');var squel=require(_0x1d02('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1d02('0xa'));var querystring=require(_0x1d02('0xe'));var Papa=require(_0x1d02('0xf'));var Redis=require(_0x1d02('0x10'));var authService=require(_0x1d02('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1d02('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d02('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1d02('0x14'));var licenseUtil=require(_0x1d02('0x15'));var db=require(_0x1d02('0x16'))['db'];function respondWithStatusCode(_0x51c275,_0x15e5eb){_0x15e5eb=_0x15e5eb||0xcc;return function(_0x147f82){if(_0x147f82){return _0x51c275[_0x1d02('0x17')](_0x15e5eb);}return _0x51c275[_0x1d02('0x18')](_0x15e5eb)[_0x1d02('0x19')]();};}function respondWithResult(_0x5b99b1,_0x580758){_0x580758=_0x580758||0xc8;return function(_0x2ad6b8){if(_0x2ad6b8){return _0x5b99b1[_0x1d02('0x18')](_0x580758)[_0x1d02('0x1a')](_0x2ad6b8);}};}function respondWithFilteredResult(_0x429523,_0x1a110c){return function(_0x35108b){if(_0x35108b){var _0x2aa24c=typeof _0x1a110c[_0x1d02('0x1b')]===_0x1d02('0x1c')&&typeof _0x1a110c['limit']===_0x1d02('0x1c');var _0x3374d9=_0x35108b['count'];var _0x465633=_0x2aa24c?0x0:_0x1a110c[_0x1d02('0x1b')];var _0x531f05=_0x2aa24c?_0x35108b[_0x1d02('0x1d')]:_0x1a110c[_0x1d02('0x1b')]+_0x1a110c[_0x1d02('0x1e')];var _0x1359a8;if(_0x531f05>=_0x3374d9){_0x531f05=_0x3374d9;_0x1359a8=0xc8;}else{_0x1359a8=0xce;}_0x429523[_0x1d02('0x18')](_0x1359a8);return _0x429523[_0x1d02('0x1f')](_0x1d02('0x20'),_0x465633+'-'+_0x531f05+'/'+_0x3374d9)[_0x1d02('0x1a')](_0x35108b);}return null;};}function patchUpdates(_0x5c13b2){return function(_0x1b39f9){try{jsonpatch[_0x1d02('0x21')](_0x1b39f9,_0x5c13b2,!![]);}catch(_0x3cd07e){return BPromise[_0x1d02('0x22')](_0x3cd07e);}return _0x1b39f9[_0x1d02('0x23')]();};}function saveUpdates(_0x5e4f9e,_0x40a629){return function(_0x34532e){if(_0x34532e){return _0x34532e[_0x1d02('0x24')](_0x5e4f9e)[_0x1d02('0x25')](function(_0x5017b2){return _0x5017b2;});}return null;};}function removeEntity(_0x24f517,_0x3dbc99){return function(_0x2f2a0b){if(_0x2f2a0b){return _0x2f2a0b['destroy']()[_0x1d02('0x25')](function(){var _0x186d6c=_0x2f2a0b[_0x1d02('0x26')]({'plain':!![]});var _0x2cd7e8=_0x1d02('0x27');return db[_0x1d02('0x28')][_0x1d02('0x29')]({'where':{'type':_0x2cd7e8,'resourceId':_0x186d6c['id']}})[_0x1d02('0x25')](function(){return _0x2f2a0b;});})['then'](function(){_0x24f517[_0x1d02('0x18')](0xcc)[_0x1d02('0x19')]();});}};}function handleEntityNotFound(_0x20a89e,_0x468567){return function(_0x102739){if(!_0x102739){_0x20a89e[_0x1d02('0x17')](0x194);}return _0x102739;};}function handleError(_0x4804c4,_0x2cf7fd){_0x2cf7fd=_0x2cf7fd||0x1f4;return function(_0x46a352){logger[_0x1d02('0x2a')](_0x46a352['stack']);if(_0x46a352[_0x1d02('0x2b')]){delete _0x46a352[_0x1d02('0x2b')];}_0x4804c4[_0x1d02('0x18')](_0x2cf7fd)[_0x1d02('0x2c')](_0x46a352);};}exports[_0x1d02('0x2d')]=function(_0x220699,_0x4b1b7b){var _0x3caab8={},_0x19f14e={},_0x63c9cd={'count':0x0,'rows':[]};var _0x376bfc=_[_0x1d02('0x2e')](db[_0x1d02('0x2f')]['rawAttributes'],function(_0x3b2624){return{'name':_0x3b2624[_0x1d02('0x30')],'type':_0x3b2624[_0x1d02('0x31')][_0x1d02('0x32')]};});_0x19f14e['model']=_['map'](_0x376bfc,_0x1d02('0x2b'));_0x19f14e[_0x1d02('0x33')]=_[_0x1d02('0x34')](_0x220699[_0x1d02('0x33')]);_0x19f14e[_0x1d02('0x35')]=_[_0x1d02('0x36')](_0x19f14e[_0x1d02('0x37')],_0x19f14e['query']);_0x3caab8['attributes']=_[_0x1d02('0x36')](_0x19f14e['model'],qs[_0x1d02('0x38')](_0x220699[_0x1d02('0x33')][_0x1d02('0x38')]));_0x3caab8[_0x1d02('0x39')]=_0x3caab8[_0x1d02('0x39')][_0x1d02('0x3a')]?_0x3caab8['attributes']:_0x19f14e['model'];if(!_0x220699['query'][_0x1d02('0x3b')]('nolimit')){_0x3caab8[_0x1d02('0x1e')]=qs[_0x1d02('0x1e')](_0x220699[_0x1d02('0x33')]['limit']);_0x3caab8[_0x1d02('0x1b')]=qs[_0x1d02('0x1b')](_0x220699[_0x1d02('0x33')][_0x1d02('0x1b')]);}_0x3caab8[_0x1d02('0x3c')]=qs[_0x1d02('0x3d')](_0x220699[_0x1d02('0x33')]['sort']);_0x3caab8['where']=qs['filters'](_[_0x1d02('0x3e')](_0x220699['query'],_0x19f14e[_0x1d02('0x35')]),_0x376bfc);if(_0x220699['query']['filter']){_0x3caab8[_0x1d02('0x3f')]=_['merge'](_0x3caab8[_0x1d02('0x3f')],{'$or':_[_0x1d02('0x2e')](_0x376bfc,function(_0x55692d){if(_0x55692d['type']!==_0x1d02('0x40')){var _0x76a023={};_0x76a023[_0x55692d[_0x1d02('0x2b')]]={'$like':'%'+_0x220699[_0x1d02('0x33')][_0x1d02('0x41')]+'%'};return _0x76a023;}})});}_0x3caab8=_[_0x1d02('0x42')]({},_0x3caab8,_0x220699[_0x1d02('0x43')]);var _0x28c646={'where':_0x3caab8[_0x1d02('0x3f')]};return db[_0x1d02('0x2f')][_0x1d02('0x1d')](_0x28c646)[_0x1d02('0x25')](function(_0x546a84){_0x63c9cd[_0x1d02('0x1d')]=_0x546a84;if(_0x220699['query'][_0x1d02('0x44')]){_0x3caab8[_0x1d02('0x45')]=[{'all':!![]}];}return db[_0x1d02('0x2f')]['findAll'](_0x3caab8);})[_0x1d02('0x25')](function(_0x58cd5d){_0x63c9cd['rows']=_0x58cd5d;return _0x63c9cd;})[_0x1d02('0x25')](respondWithFilteredResult(_0x4b1b7b,_0x3caab8))[_0x1d02('0x46')](handleError(_0x4b1b7b,null));};exports[_0x1d02('0x47')]=function(_0x4cb2d9,_0x49756e){var _0x56c94={'raw':!![],'where':{'id':_0x4cb2d9[_0x1d02('0x48')]['id']}},_0x5027ce={};_0x5027ce[_0x1d02('0x37')]=_[_0x1d02('0x34')](db[_0x1d02('0x2f')]['rawAttributes']);_0x5027ce[_0x1d02('0x33')]=_[_0x1d02('0x34')](_0x4cb2d9[_0x1d02('0x33')]);_0x5027ce[_0x1d02('0x35')]=_[_0x1d02('0x36')](_0x5027ce[_0x1d02('0x37')],_0x5027ce[_0x1d02('0x33')]);_0x56c94[_0x1d02('0x39')]=_[_0x1d02('0x36')](_0x5027ce['model'],qs[_0x1d02('0x38')](_0x4cb2d9[_0x1d02('0x33')][_0x1d02('0x38')]));_0x56c94[_0x1d02('0x39')]=_0x56c94[_0x1d02('0x39')][_0x1d02('0x3a')]?_0x56c94['attributes']:_0x5027ce['model'];if(_0x4cb2d9['query']['includeAll']){_0x56c94[_0x1d02('0x45')]=[{'all':!![]}];}_0x56c94=_['merge']({},_0x56c94,_0x4cb2d9[_0x1d02('0x43')]);return db['AnalyticExtractedReport'][_0x1d02('0x49')](_0x56c94)[_0x1d02('0x25')](handleEntityNotFound(_0x49756e,null))[_0x1d02('0x25')](respondWithResult(_0x49756e,null))[_0x1d02('0x46')](handleError(_0x49756e,null));};exports[_0x1d02('0x4a')]=function(_0x1f859e,_0x27980f){return db[_0x1d02('0x2f')][_0x1d02('0x4a')](_0x1f859e[_0x1d02('0x4b')],{})['then'](function(_0x2dfef9){var _0xdf9384=_0x1f859e[_0x1d02('0x4c')][_0x1d02('0x26')]({'plain':!![]});if(!_0xdf9384)throw new Error(_0x1d02('0x4d'));if(_0xdf9384[_0x1d02('0x4e')]===_0x1d02('0x4c')){var _0x3e992a=_0x2dfef9['get']({'plain':!![]});var _0x339b10=_0x1d02('0x27');return db['UserProfileSection'][_0x1d02('0x49')]({'where':{'name':_0x339b10,'userProfileId':_0xdf9384[_0x1d02('0x4f')]},'raw':!![]})[_0x1d02('0x25')](function(_0x50cbfc){if(_0x50cbfc&&_0x50cbfc[_0x1d02('0x50')]===0x0){return db[_0x1d02('0x28')]['create']({'name':_0x3e992a['name'],'resourceId':_0x3e992a['id'],'type':_0x50cbfc[_0x1d02('0x2b')],'sectionId':_0x50cbfc['id']},{})[_0x1d02('0x25')](function(){return _0x2dfef9;});}else{return _0x2dfef9;}})[_0x1d02('0x46')](function(_0x82b379){logger[_0x1d02('0x2a')](_0x1d02('0x51'),_0x82b379);throw _0x82b379;});}return _0x2dfef9;})[_0x1d02('0x25')](respondWithResult(_0x27980f,0xc9))[_0x1d02('0x46')](handleError(_0x27980f,null));};exports[_0x1d02('0x24')]=function(_0x5f4ed2,_0x591244){if(_0x5f4ed2[_0x1d02('0x4b')]['id']){delete _0x5f4ed2[_0x1d02('0x4b')]['id'];}return db['AnalyticExtractedReport'][_0x1d02('0x49')]({'where':{'id':_0x5f4ed2[_0x1d02('0x48')]['id']}})[_0x1d02('0x25')](handleEntityNotFound(_0x591244,null))[_0x1d02('0x25')](saveUpdates(_0x5f4ed2[_0x1d02('0x4b')],null))['then'](respondWithResult(_0x591244,null))[_0x1d02('0x46')](handleError(_0x591244,null));};exports[_0x1d02('0x29')]=function(_0x53a226,_0x37243c){return db['AnalyticExtractedReport'][_0x1d02('0x49')]({'where':{'id':_0x53a226[_0x1d02('0x48')]['id']}})[_0x1d02('0x25')](handleEntityNotFound(_0x37243c,null))[_0x1d02('0x25')](removeEntity(_0x37243c,null))['catch'](handleError(_0x37243c,null));};exports['download']=function(_0x4bf798,_0x2cf86c,_0x562a26){return db[_0x1d02('0x2f')]['find']({'where':{'id':_0x4bf798[_0x1d02('0x48')]['id']},'attributes':['name',_0x1d02('0x52'),_0x1d02('0x53'),_0x1d02('0x54')],'raw':!![]})[_0x1d02('0x25')](handleEntityNotFound(_0x2cf86c,null))[_0x1d02('0x25')](function(_0x230d73){if(_0x230d73){if(!fs[_0x1d02('0x55')](path[_0x1d02('0x56')](config[_0x1d02('0x57')],'server/files/reports',_0x230d73['savename']))){throw new db[(_0x1d02('0x58'))]['ValidationError'](_0x1d02('0x59'));}if(_0x4bf798[_0x1d02('0x33')][_0x1d02('0x5a')]){return _0x2cf86c['sendStatus'](0xc8);}return _0x2cf86c[_0x1d02('0x5b')](path[_0x1d02('0x56')](config[_0x1d02('0x57')],'server/files/reports',_0x230d73['savename']),util[_0x1d02('0x5c')](_0x1d02('0x5d'),_0x230d73['basename']||_0x230d73['name'],_0x230d73['output'][_0x1d02('0x5e')]()));}})[_0x1d02('0x46')](handleError(_0x2cf86c,null));};
\ No newline at end of file
+var _0x606c=['eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','ExtractedReports','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','order','sort','where','filters','filter','merge','options','include','findAll','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','download','output','existsSync','join','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','format','%s.%s','basename','toLowerCase'];(function(_0x5233d4,_0x323ed8){var _0x1b7f4f=function(_0x1b41b4){while(--_0x1b41b4){_0x5233d4['push'](_0x5233d4['shift']());}};_0x1b7f4f(++_0x323ed8);}(_0x606c,0x16c));var _0xc606=function(_0x12b83d,_0x4bcec7){_0x12b83d=_0x12b83d-0x0;var _0x1fd39d=_0x606c[_0x12b83d];return _0x1fd39d;};'use strict';var emlformat=require(_0xc606('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc606('0x1'));var jsonpatch=require(_0xc606('0x2'));var rp=require(_0xc606('0x3'));var moment=require(_0xc606('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc606('0x5'));var util=require('util');var path=require(_0xc606('0x6'));var sox=require(_0xc606('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc606('0x8'));var squel=require('squel');var crypto=require(_0xc606('0x9'));var jsforce=require(_0xc606('0xa'));var deskjs=require(_0xc606('0xb'));var toCsv=require(_0xc606('0xc'));var querystring=require('querystring');var Papa=require(_0xc606('0xd'));var Redis=require(_0xc606('0xe'));var authService=require(_0xc606('0xf'));var qs=require(_0xc606('0x10'));var as=require(_0xc606('0x11'));var hardwareService=require(_0xc606('0x12'));var logger=require('../../config/logger')(_0xc606('0x13'));var utils=require(_0xc606('0x14'));var config=require(_0xc606('0x15'));var licenseUtil=require(_0xc606('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1305e1,_0x9f6164){_0x9f6164=_0x9f6164||0xcc;return function(_0x338e43){if(_0x338e43){return _0x1305e1[_0xc606('0x17')](_0x9f6164);}return _0x1305e1[_0xc606('0x18')](_0x9f6164)[_0xc606('0x19')]();};}function respondWithResult(_0x4e7cf3,_0x35249d){_0x35249d=_0x35249d||0xc8;return function(_0x228e0a){if(_0x228e0a){return _0x4e7cf3[_0xc606('0x18')](_0x35249d)[_0xc606('0x1a')](_0x228e0a);}};}function respondWithFilteredResult(_0x20c4ec,_0x502420){return function(_0x1da617){if(_0x1da617){var _0x51d26c=typeof _0x502420[_0xc606('0x1b')]==='undefined'&&typeof _0x502420[_0xc606('0x1c')]===_0xc606('0x1d');var _0x3c53d3=_0x1da617[_0xc606('0x1e')];var _0xbaed22=_0x51d26c?0x0:_0x502420[_0xc606('0x1b')];var _0x3d04e1=_0x51d26c?_0x1da617[_0xc606('0x1e')]:_0x502420[_0xc606('0x1b')]+_0x502420[_0xc606('0x1c')];var _0x2ed9dd;if(_0x3d04e1>=_0x3c53d3){_0x3d04e1=_0x3c53d3;_0x2ed9dd=0xc8;}else{_0x2ed9dd=0xce;}_0x20c4ec[_0xc606('0x18')](_0x2ed9dd);return _0x20c4ec[_0xc606('0x1f')]('Content-Range',_0xbaed22+'-'+_0x3d04e1+'/'+_0x3c53d3)['json'](_0x1da617);}return null;};}function patchUpdates(_0x424b1e){return function(_0x58216c){try{jsonpatch[_0xc606('0x20')](_0x58216c,_0x424b1e,!![]);}catch(_0x461a9b){return BPromise[_0xc606('0x21')](_0x461a9b);}return _0x58216c[_0xc606('0x22')]();};}function saveUpdates(_0x5192d6,_0x4c6575){return function(_0x13b8c0){if(_0x13b8c0){return _0x13b8c0[_0xc606('0x23')](_0x5192d6)['then'](function(_0x34320b){return _0x34320b;});}return null;};}function removeEntity(_0x4da495,_0x54c1b9){return function(_0x35ec90){if(_0x35ec90){return _0x35ec90['destroy']()[_0xc606('0x24')](function(){var _0x3fdfcd=_0x35ec90['get']({'plain':!![]});var _0x2e434a=_0xc606('0x25');return db[_0xc606('0x26')]['destroy']({'where':{'type':_0x2e434a,'resourceId':_0x3fdfcd['id']}})['then'](function(){return _0x35ec90;});})['then'](function(){_0x4da495['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fd144,_0x13e5a6){return function(_0x3563f6){if(!_0x3563f6){_0x3fd144[_0xc606('0x17')](0x194);}return _0x3563f6;};}function handleError(_0x5131da,_0x4aacd6){_0x4aacd6=_0x4aacd6||0x1f4;return function(_0x2df772){logger[_0xc606('0x27')](_0x2df772['stack']);if(_0x2df772[_0xc606('0x28')]){delete _0x2df772[_0xc606('0x28')];}_0x5131da[_0xc606('0x18')](_0x4aacd6)[_0xc606('0x29')](_0x2df772);};}exports[_0xc606('0x2a')]=function(_0x5558c8,_0x22bb47){var _0x5413f6={},_0x3829ee={},_0x2e1c9a={'count':0x0,'rows':[]};var _0x57ccae=_[_0xc606('0x2b')](db[_0xc606('0x2c')][_0xc606('0x2d')],function(_0x39c5a1){return{'name':_0x39c5a1[_0xc606('0x2e')],'type':_0x39c5a1[_0xc606('0x2f')]['key']};});_0x3829ee[_0xc606('0x30')]=_[_0xc606('0x2b')](_0x57ccae,_0xc606('0x28'));_0x3829ee[_0xc606('0x31')]=_[_0xc606('0x32')](_0x5558c8[_0xc606('0x31')]);_0x3829ee['filters']=_[_0xc606('0x33')](_0x3829ee[_0xc606('0x30')],_0x3829ee['query']);_0x5413f6[_0xc606('0x34')]=_['intersection'](_0x3829ee[_0xc606('0x30')],qs[_0xc606('0x35')](_0x5558c8[_0xc606('0x31')]['fields']));_0x5413f6[_0xc606('0x34')]=_0x5413f6['attributes']['length']?_0x5413f6[_0xc606('0x34')]:_0x3829ee[_0xc606('0x30')];if(!_0x5558c8[_0xc606('0x31')]['hasOwnProperty']('nolimit')){_0x5413f6[_0xc606('0x1c')]=qs[_0xc606('0x1c')](_0x5558c8['query'][_0xc606('0x1c')]);_0x5413f6['offset']=qs['offset'](_0x5558c8[_0xc606('0x31')][_0xc606('0x1b')]);}_0x5413f6[_0xc606('0x36')]=qs['sort'](_0x5558c8['query'][_0xc606('0x37')]);_0x5413f6[_0xc606('0x38')]=qs[_0xc606('0x39')](_['pick'](_0x5558c8[_0xc606('0x31')],_0x3829ee[_0xc606('0x39')]),_0x57ccae);if(_0x5558c8[_0xc606('0x31')][_0xc606('0x3a')]){_0x5413f6[_0xc606('0x38')]=_[_0xc606('0x3b')](_0x5413f6[_0xc606('0x38')],{'$or':_[_0xc606('0x2b')](_0x57ccae,function(_0x3c1963){if(_0x3c1963[_0xc606('0x2f')]!=='VIRTUAL'){var _0x6c5930={};_0x6c5930[_0x3c1963[_0xc606('0x28')]]={'$like':'%'+_0x5558c8[_0xc606('0x31')][_0xc606('0x3a')]+'%'};return _0x6c5930;}})});}_0x5413f6=_[_0xc606('0x3b')]({},_0x5413f6,_0x5558c8[_0xc606('0x3c')]);var _0x56fd1b={'where':_0x5413f6[_0xc606('0x38')]};return db[_0xc606('0x2c')][_0xc606('0x1e')](_0x56fd1b)['then'](function(_0x45b98d){_0x2e1c9a['count']=_0x45b98d;if(_0x5558c8[_0xc606('0x31')]['includeAll']){_0x5413f6[_0xc606('0x3d')]=[{'all':!![]}];}return db[_0xc606('0x2c')][_0xc606('0x3e')](_0x5413f6);})['then'](function(_0x1d78d6){_0x2e1c9a['rows']=_0x1d78d6;return _0x2e1c9a;})[_0xc606('0x24')](respondWithFilteredResult(_0x22bb47,_0x5413f6))['catch'](handleError(_0x22bb47,null));};exports['show']=function(_0x3c93c7,_0x4ec9b6){var _0x25d2fe={'raw':!![],'where':{'id':_0x3c93c7['params']['id']}},_0x15acbd={};_0x15acbd[_0xc606('0x30')]=_['keys'](db[_0xc606('0x2c')]['rawAttributes']);_0x15acbd['query']=_[_0xc606('0x32')](_0x3c93c7['query']);_0x15acbd[_0xc606('0x39')]=_[_0xc606('0x33')](_0x15acbd['model'],_0x15acbd[_0xc606('0x31')]);_0x25d2fe[_0xc606('0x34')]=_[_0xc606('0x33')](_0x15acbd['model'],qs[_0xc606('0x35')](_0x3c93c7[_0xc606('0x31')][_0xc606('0x35')]));_0x25d2fe['attributes']=_0x25d2fe[_0xc606('0x34')][_0xc606('0x3f')]?_0x25d2fe['attributes']:_0x15acbd[_0xc606('0x30')];if(_0x3c93c7['query'][_0xc606('0x40')]){_0x25d2fe[_0xc606('0x3d')]=[{'all':!![]}];}_0x25d2fe=_[_0xc606('0x3b')]({},_0x25d2fe,_0x3c93c7[_0xc606('0x3c')]);return db[_0xc606('0x2c')][_0xc606('0x41')](_0x25d2fe)[_0xc606('0x24')](handleEntityNotFound(_0x4ec9b6,null))[_0xc606('0x24')](respondWithResult(_0x4ec9b6,null))[_0xc606('0x42')](handleError(_0x4ec9b6,null));};exports[_0xc606('0x43')]=function(_0x4ef4cf,_0x479669){return db[_0xc606('0x2c')][_0xc606('0x43')](_0x4ef4cf[_0xc606('0x44')],{})[_0xc606('0x24')](function(_0x353e46){var _0x2b6793=_0x4ef4cf[_0xc606('0x45')]['get']({'plain':!![]});if(!_0x2b6793)throw new Error(_0xc606('0x46'));if(_0x2b6793[_0xc606('0x47')]===_0xc606('0x45')){var _0x131ceb=_0x353e46[_0xc606('0x48')]({'plain':!![]});var _0x58e081=_0xc606('0x25');return db[_0xc606('0x49')]['find']({'where':{'name':_0x58e081,'userProfileId':_0x2b6793[_0xc606('0x4a')]},'raw':!![]})[_0xc606('0x24')](function(_0x89704){if(_0x89704&&_0x89704['autoAssociation']===0x0){return db[_0xc606('0x26')][_0xc606('0x43')]({'name':_0x131ceb[_0xc606('0x28')],'resourceId':_0x131ceb['id'],'type':_0x89704['name'],'sectionId':_0x89704['id']},{})[_0xc606('0x24')](function(){return _0x353e46;});}else{return _0x353e46;}})[_0xc606('0x42')](function(_0x1d6f3c){logger['error'](_0xc606('0x4b'),_0x1d6f3c);throw _0x1d6f3c;});}return _0x353e46;})[_0xc606('0x24')](respondWithResult(_0x479669,0xc9))[_0xc606('0x42')](handleError(_0x479669,null));};exports[_0xc606('0x23')]=function(_0x1a9a97,_0x1549b8){if(_0x1a9a97[_0xc606('0x44')]['id']){delete _0x1a9a97[_0xc606('0x44')]['id'];}return db['AnalyticExtractedReport'][_0xc606('0x41')]({'where':{'id':_0x1a9a97[_0xc606('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1549b8,null))[_0xc606('0x24')](saveUpdates(_0x1a9a97[_0xc606('0x44')],null))[_0xc606('0x24')](respondWithResult(_0x1549b8,null))['catch'](handleError(_0x1549b8,null));};exports[_0xc606('0x4d')]=function(_0x17fba7,_0xe0b8cf){return db[_0xc606('0x2c')][_0xc606('0x41')]({'where':{'id':_0x17fba7['params']['id']}})[_0xc606('0x24')](handleEntityNotFound(_0xe0b8cf,null))['then'](removeEntity(_0xe0b8cf,null))['catch'](handleError(_0xe0b8cf,null));};exports[_0xc606('0x4e')]=function(_0x5a3146,_0xdac000,_0x344420){return db[_0xc606('0x2c')][_0xc606('0x41')]({'where':{'id':_0x5a3146[_0xc606('0x4c')]['id']},'attributes':[_0xc606('0x28'),'basename','savename',_0xc606('0x4f')],'raw':!![]})[_0xc606('0x24')](handleEntityNotFound(_0xdac000,null))[_0xc606('0x24')](function(_0x353583){if(_0x353583){if(!fs[_0xc606('0x50')](path[_0xc606('0x51')](config[_0xc606('0x52')],_0xc606('0x53'),_0x353583[_0xc606('0x54')]))){throw new db['Sequelize'][(_0xc606('0x55'))](_0xc606('0x56'));}if(_0x5a3146['query']['exists']){return _0xdac000[_0xc606('0x17')](0xc8);}return _0xdac000['download'](path['join'](config['root'],_0xc606('0x53'),_0x353583[_0xc606('0x54')]),util[_0xc606('0x57')](_0xc606('0x58'),_0x353583[_0xc606('0x59')]||_0x353583[_0xc606('0x28')],_0x353583['output'][_0xc606('0x5a')]()));}})[_0xc606('0x42')](handleError(_0xdac000,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 63bb1bd..146311c 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 _0xb774=['lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x6106d8,_0x67937c){var _0x8a8fe8=function(_0x77027d){while(--_0x77027d){_0x6106d8['push'](_0x6106d8['shift']());}};_0x8a8fe8(++_0x67937c);}(_0xb774,0x18c));var _0x4b77=function(_0x48f0a5,_0x157aca){_0x48f0a5=_0x48f0a5-0x0;var _0x469cf9=_0xb774[_0x48f0a5];return _0x469cf9;};'use strict';var _=require(_0x4b77('0x0'));var util=require('util');var logger=require(_0x4b77('0x1'))(_0x4b77('0x2'));var moment=require('moment');var BPromise=require(_0x4b77('0x3'));var rp=require(_0x4b77('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b77('0x5'));var config=require(_0x4b77('0x6'));var attributes=require(_0x4b77('0x7'));module[_0x4b77('0x8')]=function(_0x4880ae,_0x12ae85){return _0x4880ae[_0x4b77('0x9')](_0x4b77('0xa'),attributes,{'tableName':_0x4b77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6567=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x1e2072,_0x145d84){var _0x1a72ce=function(_0xd30383){while(--_0xd30383){_0x1e2072['push'](_0x1e2072['shift']());}};_0x1a72ce(++_0x145d84);}(_0x6567,0x168));var _0x7656=function(_0xfacbc8,_0x3cf35b){_0xfacbc8=_0xfacbc8-0x0;var _0x512376=_0x6567[_0xfacbc8];return _0x512376;};'use strict';var _=require(_0x7656('0x0'));var util=require(_0x7656('0x1'));var logger=require(_0x7656('0x2'))(_0x7656('0x3'));var moment=require(_0x7656('0x4'));var BPromise=require(_0x7656('0x5'));var rp=require(_0x7656('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7656('0x7'));var config=require(_0x7656('0x8'));var attributes=require(_0x7656('0x9'));module['exports']=function(_0x3b9092,_0x19e3d3){return _0x3b9092[_0x7656('0xa')](_0x7656('0xb'),attributes,{'tableName':_0x7656('0xc'),'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 833f202..d09f2a0 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 _0xd237=['client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4d11a2,_0xc058dc){var _0x3f64bb=function(_0x3ce929){while(--_0x3ce929){_0x4d11a2['push'](_0x4d11a2['shift']());}};_0x3f64bb(++_0xc058dc);}(_0xd237,0x14f));var _0x7d23=function(_0x2853ab,_0x8acdcb){_0x2853ab=_0x2853ab-0x0;var _0x335454=_0xd237[_0x2853ab];return _0x335454;};'use strict';var _=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var moment=require(_0x7d23('0x2'));var BPromise=require(_0x7d23('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d23('0x4'));var db=require(_0x7d23('0x5'))['db'];var utils=require(_0x7d23('0x6'));var logger=require(_0x7d23('0x7'))(_0x7d23('0x8'));var config=require(_0x7d23('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d23('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ca126,_0x48358f,_0xc43371){return new BPromise(function(_0x42c334,_0x6ce28d){return client[_0x7d23('0xb')](_0x5ca126,_0xc43371)[_0x7d23('0xc')](function(_0x23f1d6){logger[_0x7d23('0xd')](_0x7d23('0xe'),_0x48358f,'request\x20sent');logger[_0x7d23('0xf')](_0x7d23('0x10'),_0x48358f,_0x7d23('0x11'),JSON['stringify'](_0x23f1d6));if(_0x23f1d6[_0x7d23('0x12')]){if(_0x23f1d6['error'][_0x7d23('0x13')]===0x1f4){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x6ce28d(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x42c334(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}else{logger['info'](_0x7d23('0xe'),_0x48358f,'request\x20sent');_0x42c334(_0x23f1d6[_0x7d23('0x15')]['message']);}})[_0x7d23('0x16')](function(_0x46a35b){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x46a35b);_0x6ce28d(_0x46a35b);});});}
\ No newline at end of file
+var _0xcc98=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xcc98,0xb2));var _0x8cc9=function(_0x382492,_0x2b8cde){_0x382492=_0x382492-0x0;var _0xbaaf9d=_0xcc98[_0x382492];return _0xbaaf9d;};'use strict';var _=require(_0x8cc9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8cc9('0x1'));var rs=require(_0x8cc9('0x2'));var fs=require('fs');var Redis=require(_0x8cc9('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8cc9('0x4'))(_0x8cc9('0x5'));var config=require(_0x8cc9('0x6'));var jayson=require(_0x8cc9('0x7'));var client=jayson[_0x8cc9('0x8')][_0x8cc9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cd59d,_0x365276,_0x189baa){return new BPromise(function(_0x13b48c,_0x167350){return client['request'](_0x3cd59d,_0x189baa)[_0x8cc9('0xa')](function(_0xeabd12){logger[_0x8cc9('0xb')](_0x8cc9('0xc'),_0x365276,_0x8cc9('0xd'));logger['debug'](_0x8cc9('0xe'),_0x365276,_0x8cc9('0xd'),JSON[_0x8cc9('0xf')](_0xeabd12));if(_0xeabd12[_0x8cc9('0x10')]){if(_0xeabd12[_0x8cc9('0x10')][_0x8cc9('0x11')]===0x1f4){logger[_0x8cc9('0x10')](_0x8cc9('0xc'),_0x365276,_0xeabd12[_0x8cc9('0x10')][_0x8cc9('0x12')]);return _0x167350(_0xeabd12['error'][_0x8cc9('0x12')]);}logger[_0x8cc9('0x10')](_0x8cc9('0xc'),_0x365276,_0xeabd12[_0x8cc9('0x10')][_0x8cc9('0x12')]);return _0x13b48c(_0xeabd12['error']['message']);}else{logger[_0x8cc9('0xb')](_0x8cc9('0xc'),_0x365276,_0x8cc9('0xd'));_0x13b48c(_0xeabd12[_0x8cc9('0x13')][_0x8cc9('0x12')]);}})[_0x8cc9('0x14')](function(_0x2ad65f){logger[_0x8cc9('0x10')](_0x8cc9('0xc'),_0x365276,_0x2ad65f);_0x167350(_0x2ad65f);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 6934905..a5fc1a4 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 _0x85c8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','index','get','/:id','isAuthenticated','show','/:id/download','download','delete','destroy','multer','path','express','Router','fs-extra'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x85c8,0x13f));var _0x885c=function(_0x35c2d1,_0xc18ad8){_0x35c2d1=_0x35c2d1-0x0;var _0x3e1104=_0x85c8[_0x35c2d1];return _0x3e1104;};'use strict';var multer=require(_0x885c('0x0'));var util=require('util');var path=require(_0x885c('0x1'));var timeout=require('connect-timeout');var express=require(_0x885c('0x2'));var router=express[_0x885c('0x3')]();var fs_extra=require(_0x885c('0x4'));var auth=require(_0x885c('0x5'));var interaction=require(_0x885c('0x6'));var config=require(_0x885c('0x7'));var controller=require(_0x885c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x885c('0x9')]);router[_0x885c('0xa')](_0x885c('0xb'),auth[_0x885c('0xc')](),controller[_0x885c('0xd')]);router[_0x885c('0xa')](_0x885c('0xe'),auth['isAuthenticated'](),controller[_0x885c('0xf')]);router['post']('/',auth[_0x885c('0xc')](),controller['create']);router['put'](_0x885c('0xb'),auth[_0x885c('0xc')](),controller['update']);router[_0x885c('0x10')]('/:id',auth[_0x885c('0xc')](),controller[_0x885c('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xade5=['../../config/environment','get','index','/:id','show','/:id/download','isAuthenticated','download','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x7ad6cb,_0xffee6c){var _0x22a0ba=function(_0x47f291){while(--_0x47f291){_0x7ad6cb['push'](_0x7ad6cb['shift']());}};_0x22a0ba(++_0xffee6c);}(_0xade5,0x172));var _0x5ade=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xade5[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x5ade('0x0'));var util=require(_0x5ade('0x1'));var path=require(_0x5ade('0x2'));var timeout=require(_0x5ade('0x3'));var express=require(_0x5ade('0x4'));var router=express[_0x5ade('0x5')]();var fs_extra=require(_0x5ade('0x6'));var auth=require(_0x5ade('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5ade('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0x5ade('0x9')]('/',auth['isAuthenticated'](),controller[_0x5ade('0xa')]);router['get'](_0x5ade('0xb'),auth['isAuthenticated'](),controller[_0x5ade('0xc')]);router['get'](_0x5ade('0xd'),auth[_0x5ade('0xe')](),controller[_0x5ade('0xf')]);router[_0x5ade('0x10')]('/',auth[_0x5ade('0xe')](),controller[_0x5ade('0x11')]);router['put'](_0x5ade('0xb'),auth['isAuthenticated'](),controller[_0x5ade('0x12')]);router[_0x5ade('0x13')](_0x5ade('0xb'),auth[_0x5ade('0xe')](),controller['destroy']);module[_0x5ade('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 15073aa..8f5b37a 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 _0xb916=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x4562bb,_0x5a8f8d){var _0x110188=function(_0x48aa24){while(--_0x48aa24){_0x4562bb['push'](_0x4562bb['shift']());}};_0x110188(++_0x5a8f8d);}(_0xb916,0x131));var _0x6b91=function(_0x46884f,_0x2b5c5a){_0x46884f=_0x46884f-0x0;var _0x78c6c0=_0xb916[_0x46884f];return _0x78c6c0;};'use strict';var Sequelize=require(_0x6b91('0x0'));module[_0x6b91('0x1')]={'field':{'type':Sequelize[_0x6b91('0x2')]},'alias':{'type':Sequelize[_0x6b91('0x3')]},'function':{'type':Sequelize[_0x6b91('0x3')]},'format':{'type':Sequelize[_0x6b91('0x3')]},'groupBy':{'type':Sequelize[_0x6b91('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6b91('0x3')]},'custom':{'type':Sequelize[_0x6b91('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2fd8=['sequelize','TEXT','STRING'];(function(_0x41a127,_0x546a15){var _0x526801=function(_0x3a936d){while(--_0x3a936d){_0x41a127['push'](_0x41a127['shift']());}};_0x526801(++_0x546a15);}(_0x2fd8,0xc3));var _0x82fd=function(_0x412cf9,_0x1a4932){_0x412cf9=_0x412cf9-0x0;var _0x9d24e4=_0x2fd8[_0x412cf9];return _0x9d24e4;};'use strict';var Sequelize=require(_0x82fd('0x0'));module['exports']={'field':{'type':Sequelize[_0x82fd('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x82fd('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x82fd('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 16c9e18..3a22be6 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 _0x47a9=['rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','status','send','index','map','AnalyticFieldReport','fieldName','type','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','bulkCreate','update','find','destroy','ids','addFields','findOne','eml-format'];(function(_0x18a794,_0x335c63){var _0x4fadaa=function(_0x49b618){while(--_0x49b618){_0x18a794['push'](_0x18a794['shift']());}};_0x4fadaa(++_0x335c63);}(_0x47a9,0x9b));var _0x947a=function(_0x4dcaaf,_0x39bf5f){_0x4dcaaf=_0x4dcaaf-0x0;var _0x5c6fa2=_0x47a9[_0x4dcaaf];return _0x5c6fa2;};'use strict';var emlformat=require(_0x947a('0x0'));var rimraf=require(_0x947a('0x1'));var zipdir=require(_0x947a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x947a('0x3'));var moment=require(_0x947a('0x4'));var BPromise=require(_0x947a('0x5'));var Mustache=require('mustache');var util=require(_0x947a('0x6'));var path=require(_0x947a('0x7'));var sox=require(_0x947a('0x8'));var csv=require(_0x947a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x947a('0xa'));var _=require(_0x947a('0xb'));var squel=require(_0x947a('0xc'));var crypto=require('crypto');var jsforce=require(_0x947a('0xd'));var deskjs=require(_0x947a('0xe'));var toCsv=require(_0x947a('0x9'));var querystring=require(_0x947a('0xf'));var Papa=require(_0x947a('0x10'));var Redis=require('ioredis');var authService=require(_0x947a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x947a('0x12'));var logger=require(_0x947a('0x13'))(_0x947a('0x14'));var utils=require(_0x947a('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e0134,_0x29a24a){_0x29a24a=_0x29a24a||0xcc;return function(_0x18c83e){if(_0x18c83e){return _0x3e0134[_0x947a('0x16')](_0x29a24a);}return _0x3e0134['status'](_0x29a24a)[_0x947a('0x17')]();};}function respondWithResult(_0x14c11a,_0x5d5a2b){_0x5d5a2b=_0x5d5a2b||0xc8;return function(_0x238742){if(_0x238742){return _0x14c11a['status'](_0x5d5a2b)[_0x947a('0x18')](_0x238742);}};}function respondWithFilteredResult(_0x3b3207,_0x368161){return function(_0x4516fa){if(_0x4516fa){var _0x12bb41=typeof _0x368161[_0x947a('0x19')]===_0x947a('0x1a')&&typeof _0x368161['limit']===_0x947a('0x1a');var _0x2ad5f2=_0x4516fa[_0x947a('0x1b')];var _0x512298=_0x12bb41?0x0:_0x368161[_0x947a('0x19')];var _0x110906=_0x12bb41?_0x4516fa[_0x947a('0x1b')]:_0x368161[_0x947a('0x19')]+_0x368161[_0x947a('0x1c')];var _0x3c4086;if(_0x110906>=_0x2ad5f2){_0x110906=_0x2ad5f2;_0x3c4086=0xc8;}else{_0x3c4086=0xce;}_0x3b3207['status'](_0x3c4086);return _0x3b3207[_0x947a('0x1d')](_0x947a('0x1e'),_0x512298+'-'+_0x110906+'/'+_0x2ad5f2)[_0x947a('0x18')](_0x4516fa);}return null;};}function patchUpdates(_0x3ba1a2){return function(_0x57e6e2){try{jsonpatch[_0x947a('0x1f')](_0x57e6e2,_0x3ba1a2,!![]);}catch(_0x45834c){return BPromise[_0x947a('0x20')](_0x45834c);}return _0x57e6e2[_0x947a('0x21')]();};}function saveUpdates(_0x518764,_0x214f5c){return function(_0x5e056d){if(_0x5e056d){return _0x5e056d['update'](_0x518764)['then'](function(_0x5dbde2){return _0x5dbde2;});}return null;};}function removeEntity(_0x1d9ebb,_0x397501){return function(_0x4741c1){if(_0x4741c1){return _0x4741c1['destroy']()[_0x947a('0x22')](function(){_0x1d9ebb['status'](0xcc)[_0x947a('0x17')]();});}};}function handleEntityNotFound(_0x20d021,_0x5274f2){return function(_0x519a15){if(!_0x519a15){_0x20d021[_0x947a('0x16')](0x194);}return _0x519a15;};}function handleError(_0x36060d,_0x17336b){_0x17336b=_0x17336b||0x1f4;return function(_0x212bc5){logger[_0x947a('0x23')](_0x212bc5[_0x947a('0x24')]);if(_0x212bc5[_0x947a('0x25')]){delete _0x212bc5[_0x947a('0x25')];}_0x36060d[_0x947a('0x26')](_0x17336b)[_0x947a('0x27')](_0x212bc5);};}exports[_0x947a('0x28')]=function(_0x143e00,_0x544312){var _0x3163c7={},_0x59ce3b={},_0x25305d={'count':0x0,'rows':[]};var _0x1633fe=_[_0x947a('0x29')](db[_0x947a('0x2a')]['rawAttributes'],function(_0x54bb38){return{'name':_0x54bb38[_0x947a('0x2b')],'type':_0x54bb38[_0x947a('0x2c')]['key']};});_0x59ce3b['model']=_['map'](_0x1633fe,_0x947a('0x25'));_0x59ce3b[_0x947a('0x2d')]=_[_0x947a('0x2e')](_0x143e00[_0x947a('0x2d')]);_0x59ce3b[_0x947a('0x2f')]=_[_0x947a('0x30')](_0x59ce3b[_0x947a('0x31')],_0x59ce3b[_0x947a('0x2d')]);_0x3163c7['attributes']=_['intersection'](_0x59ce3b[_0x947a('0x31')],qs[_0x947a('0x32')](_0x143e00[_0x947a('0x2d')]['fields']));_0x3163c7[_0x947a('0x33')]=_0x3163c7[_0x947a('0x33')]['length']?_0x3163c7[_0x947a('0x33')]:_0x59ce3b['model'];if(!_0x143e00['query'][_0x947a('0x34')]('nolimit')){_0x3163c7[_0x947a('0x1c')]=qs[_0x947a('0x1c')](_0x143e00['query'][_0x947a('0x1c')]);_0x3163c7[_0x947a('0x19')]=qs[_0x947a('0x19')](_0x143e00[_0x947a('0x2d')][_0x947a('0x19')]);}_0x3163c7[_0x947a('0x35')]=qs[_0x947a('0x36')](_0x143e00[_0x947a('0x2d')][_0x947a('0x36')]);_0x3163c7[_0x947a('0x37')]=qs['filters'](_[_0x947a('0x38')](_0x143e00['query'],_0x59ce3b[_0x947a('0x2f')]),_0x1633fe);if(_0x143e00[_0x947a('0x2d')][_0x947a('0x39')]){_0x3163c7[_0x947a('0x37')]=_['merge'](_0x3163c7[_0x947a('0x37')],{'$or':_[_0x947a('0x29')](_0x1633fe,function(_0xb8311d){if(_0xb8311d[_0x947a('0x2c')]!==_0x947a('0x3a')){var _0x52f150={};_0x52f150[_0xb8311d[_0x947a('0x25')]]={'$like':'%'+_0x143e00[_0x947a('0x2d')][_0x947a('0x39')]+'%'};return _0x52f150;}})});}_0x3163c7=_[_0x947a('0x3b')]({},_0x3163c7,_0x143e00['options']);var _0x54b91c={'where':_0x3163c7['where']};return db[_0x947a('0x2a')]['count'](_0x54b91c)['then'](function(_0x148df9){_0x25305d[_0x947a('0x1b')]=_0x148df9;if(_0x143e00[_0x947a('0x2d')][_0x947a('0x3c')]){_0x3163c7[_0x947a('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x947a('0x3e')](_0x3163c7);})[_0x947a('0x22')](function(_0x5b5e26){_0x25305d[_0x947a('0x3f')]=_0x5b5e26;return _0x25305d;})['then'](respondWithFilteredResult(_0x544312,_0x3163c7))[_0x947a('0x40')](handleError(_0x544312,null));};exports[_0x947a('0x41')]=function(_0x1e82cc,_0x419d41){var _0x1d8a57={'raw':![],'where':{'id':_0x1e82cc[_0x947a('0x42')]['id']}},_0x1bf8cb={};_0x1bf8cb[_0x947a('0x31')]=_[_0x947a('0x2e')](db[_0x947a('0x2a')]['rawAttributes']);_0x1bf8cb[_0x947a('0x2d')]=_['keys'](_0x1e82cc[_0x947a('0x2d')]);_0x1bf8cb[_0x947a('0x2f')]=_['intersection'](_0x1bf8cb[_0x947a('0x31')],_0x1bf8cb[_0x947a('0x2d')]);_0x1d8a57[_0x947a('0x33')]=_[_0x947a('0x30')](_0x1bf8cb['model'],qs[_0x947a('0x32')](_0x1e82cc[_0x947a('0x2d')][_0x947a('0x32')]));_0x1d8a57[_0x947a('0x33')]=_0x1d8a57[_0x947a('0x33')][_0x947a('0x43')]?_0x1d8a57[_0x947a('0x33')]:_0x1bf8cb['model'];if(_0x1e82cc[_0x947a('0x2d')][_0x947a('0x3c')]){_0x1d8a57[_0x947a('0x3d')]=[{'all':!![]}];}_0x1d8a57=_[_0x947a('0x3b')]({},_0x1d8a57,_0x1e82cc[_0x947a('0x44')]);return db[_0x947a('0x2a')]['find'](_0x1d8a57)[_0x947a('0x22')](handleEntityNotFound(_0x419d41,null))[_0x947a('0x22')](respondWithResult(_0x419d41,null))[_0x947a('0x40')](handleError(_0x419d41,null));};exports[_0x947a('0x45')]=function(_0x39c745,_0x3a7551){return db[_0x947a('0x2a')][_0x947a('0x45')](_0x39c745[_0x947a('0x46')],{})[_0x947a('0x22')](respondWithResult(_0x3a7551,0xc9))[_0x947a('0x40')](handleError(_0x3a7551,null));};exports[_0x947a('0x47')]=function(_0x3054c7,_0x5adf05){return db[_0x947a('0x2a')]['bulkCreate'](_0x3054c7[_0x947a('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5adf05,0xc9))[_0x947a('0x40')](handleError(_0x5adf05,null));};exports[_0x947a('0x48')]=function(_0x3f6377,_0x5150eb){if(_0x3f6377[_0x947a('0x46')]['id']){delete _0x3f6377[_0x947a('0x46')]['id'];}return db[_0x947a('0x2a')][_0x947a('0x49')]({'where':{'id':_0x3f6377['params']['id']}})[_0x947a('0x22')](handleEntityNotFound(_0x5150eb,null))[_0x947a('0x22')](saveUpdates(_0x3f6377[_0x947a('0x46')],null))['then'](respondWithResult(_0x5150eb,null))[_0x947a('0x40')](handleError(_0x5150eb,null));};exports[_0x947a('0x4a')]=function(_0x270b9f,_0x4cd0ed){return db[_0x947a('0x2a')][_0x947a('0x49')]({'where':{'id':_0x270b9f[_0x947a('0x42')]['id']}})['then'](handleEntityNotFound(_0x4cd0ed,null))[_0x947a('0x22')](removeEntity(_0x4cd0ed,null))[_0x947a('0x40')](handleError(_0x4cd0ed,null));};exports['bulkDestroy']=function(_0x368d71,_0x248f5b){return db[_0x947a('0x2a')][_0x947a('0x4a')]({'where':{'id':_0x368d71[_0x947a('0x2d')][_0x947a('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x947a('0x22')](respondWithResult(_0x248f5b,0xcc))[_0x947a('0x40')](handleError(_0x248f5b,null));};exports[_0x947a('0x4c')]=function(_0x4f4dfa,_0x4faadd,_0x2883ba){return db['AnalyticCustomReport'][_0x947a('0x4d')]({'where':{'id':_0x4f4dfa['params']['id']}})[_0x947a('0x22')](handleEntityNotFound(_0x4faadd,null))['then'](function(_0x2a3ce7){if(_0x2a3ce7){return db['sequelize']['transaction'](function(_0x5d65a5){return db[_0x947a('0x2a')]['destroy']({'where':{'CustomReportId':_0x4f4dfa[_0x947a('0x42')]['id']},'transaction':_0x5d65a5})['then'](function(_0x5436ac){var _0xc8cbfc=_['map'](_0x4f4dfa[_0x947a('0x46')],function(_0x31579e){delete _0x31579e['id'];_0x31579e['CustomReportId']=_0x4f4dfa[_0x947a('0x42')]['id'];return _0x31579e;});return db[_0x947a('0x2a')][_0x947a('0x47')](_0xc8cbfc,{'transaction':_0x5d65a5});});})['then'](function(){return db[_0x947a('0x2a')]['findAll']({'where':{'CustomReportId':_0x4f4dfa[_0x947a('0x42')]['id']}});});}})[_0x947a('0x22')](respondWithResult(_0x4faadd,null))['catch'](handleError(_0x4faadd,null));};
\ No newline at end of file
+var _0x91cd=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','AnalyticFieldReport','then','includeAll','include','findAll','catch','show','length','options','find','create','body','bulkCreate','params','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x48f94e,_0x62515d){var _0x25be89=function(_0x37bdd4){while(--_0x37bdd4){_0x48f94e['push'](_0x48f94e['shift']());}};_0x25be89(++_0x62515d);}(_0x91cd,0x12d));var _0xd91c=function(_0x4dbba7,_0x34d6d1){_0x4dbba7=_0x4dbba7-0x0;var _0x43ef83=_0x91cd[_0x4dbba7];return _0x43ef83;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd91c('0x0'));var zipdir=require(_0xd91c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd91c('0x2'));var moment=require(_0xd91c('0x3'));var BPromise=require(_0xd91c('0x4'));var Mustache=require('mustache');var util=require(_0xd91c('0x5'));var path=require('path');var sox=require(_0xd91c('0x6'));var csv=require(_0xd91c('0x7'));var ejs=require(_0xd91c('0x8'));var fs=require('fs');var fs_extra=require(_0xd91c('0x9'));var _=require(_0xd91c('0xa'));var squel=require(_0xd91c('0xb'));var crypto=require(_0xd91c('0xc'));var jsforce=require(_0xd91c('0xd'));var deskjs=require(_0xd91c('0xe'));var toCsv=require(_0xd91c('0x7'));var querystring=require('querystring');var Papa=require(_0xd91c('0xf'));var Redis=require(_0xd91c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd91c('0x11'));var as=require(_0xd91c('0x12'));var hardwareService=require(_0xd91c('0x13'));var logger=require(_0xd91c('0x14'))(_0xd91c('0x15'));var utils=require('../../config/utils');var config=require(_0xd91c('0x16'));var licenseUtil=require(_0xd91c('0x17'));var db=require(_0xd91c('0x18'))['db'];function respondWithStatusCode(_0xa62588,_0x1a8263){_0x1a8263=_0x1a8263||0xcc;return function(_0x47fc56){if(_0x47fc56){return _0xa62588[_0xd91c('0x19')](_0x1a8263);}return _0xa62588[_0xd91c('0x1a')](_0x1a8263)[_0xd91c('0x1b')]();};}function respondWithResult(_0x5a9a34,_0x321d51){_0x321d51=_0x321d51||0xc8;return function(_0x43a300){if(_0x43a300){return _0x5a9a34[_0xd91c('0x1a')](_0x321d51)[_0xd91c('0x1c')](_0x43a300);}};}function respondWithFilteredResult(_0x445732,_0x43f01a){return function(_0x1f749a){if(_0x1f749a){var _0xf83191=typeof _0x43f01a[_0xd91c('0x1d')]===_0xd91c('0x1e')&&typeof _0x43f01a[_0xd91c('0x1f')]===_0xd91c('0x1e');var _0x2494c6=_0x1f749a[_0xd91c('0x20')];var _0x56fef=_0xf83191?0x0:_0x43f01a[_0xd91c('0x1d')];var _0x53ca16=_0xf83191?_0x1f749a[_0xd91c('0x20')]:_0x43f01a[_0xd91c('0x1d')]+_0x43f01a[_0xd91c('0x1f')];var _0x2c3317;if(_0x53ca16>=_0x2494c6){_0x53ca16=_0x2494c6;_0x2c3317=0xc8;}else{_0x2c3317=0xce;}_0x445732['status'](_0x2c3317);return _0x445732[_0xd91c('0x21')](_0xd91c('0x22'),_0x56fef+'-'+_0x53ca16+'/'+_0x2494c6)['json'](_0x1f749a);}return null;};}function patchUpdates(_0x13e6f0){return function(_0x43a577){try{jsonpatch[_0xd91c('0x23')](_0x43a577,_0x13e6f0,!![]);}catch(_0x5b48f1){return BPromise[_0xd91c('0x24')](_0x5b48f1);}return _0x43a577[_0xd91c('0x25')]();};}function saveUpdates(_0x38895a,_0x53a6bc){return function(_0x22b0d4){if(_0x22b0d4){return _0x22b0d4[_0xd91c('0x26')](_0x38895a)['then'](function(_0x149399){return _0x149399;});}return null;};}function removeEntity(_0x3f976d,_0x3fc434){return function(_0x42b4e3){if(_0x42b4e3){return _0x42b4e3['destroy']()['then'](function(){_0x3f976d['status'](0xcc)[_0xd91c('0x1b')]();});}};}function handleEntityNotFound(_0x105097,_0x32c93e){return function(_0x3a16c4){if(!_0x3a16c4){_0x105097[_0xd91c('0x19')](0x194);}return _0x3a16c4;};}function handleError(_0x39ffc2,_0x20e06e){_0x20e06e=_0x20e06e||0x1f4;return function(_0x3a430d){logger[_0xd91c('0x27')](_0x3a430d[_0xd91c('0x28')]);if(_0x3a430d[_0xd91c('0x29')]){delete _0x3a430d['name'];}_0x39ffc2[_0xd91c('0x1a')](_0x20e06e)[_0xd91c('0x2a')](_0x3a430d);};}exports[_0xd91c('0x2b')]=function(_0x40091c,_0x1606cd){var _0x47d829={},_0x1492b7={},_0x4c3284={'count':0x0,'rows':[]};var _0x523582=_['map'](db['AnalyticFieldReport'][_0xd91c('0x2c')],function(_0x100fda){return{'name':_0x100fda['fieldName'],'type':_0x100fda[_0xd91c('0x2d')][_0xd91c('0x2e')]};});_0x1492b7[_0xd91c('0x2f')]=_[_0xd91c('0x30')](_0x523582,'name');_0x1492b7['query']=_[_0xd91c('0x31')](_0x40091c[_0xd91c('0x32')]);_0x1492b7[_0xd91c('0x33')]=_[_0xd91c('0x34')](_0x1492b7[_0xd91c('0x2f')],_0x1492b7[_0xd91c('0x32')]);_0x47d829[_0xd91c('0x35')]=_['intersection'](_0x1492b7['model'],qs[_0xd91c('0x36')](_0x40091c['query'][_0xd91c('0x36')]));_0x47d829[_0xd91c('0x35')]=_0x47d829[_0xd91c('0x35')]['length']?_0x47d829[_0xd91c('0x35')]:_0x1492b7['model'];if(!_0x40091c[_0xd91c('0x32')][_0xd91c('0x37')]('nolimit')){_0x47d829[_0xd91c('0x1f')]=qs[_0xd91c('0x1f')](_0x40091c[_0xd91c('0x32')][_0xd91c('0x1f')]);_0x47d829[_0xd91c('0x1d')]=qs[_0xd91c('0x1d')](_0x40091c[_0xd91c('0x32')][_0xd91c('0x1d')]);}_0x47d829['order']=qs[_0xd91c('0x38')](_0x40091c[_0xd91c('0x32')]['sort']);_0x47d829[_0xd91c('0x39')]=qs[_0xd91c('0x33')](_[_0xd91c('0x3a')](_0x40091c[_0xd91c('0x32')],_0x1492b7[_0xd91c('0x33')]),_0x523582);if(_0x40091c[_0xd91c('0x32')]['filter']){_0x47d829[_0xd91c('0x39')]=_[_0xd91c('0x3b')](_0x47d829[_0xd91c('0x39')],{'$or':_['map'](_0x523582,function(_0x286f1c){if(_0x286f1c['type']!=='VIRTUAL'){var _0x3188b6={};_0x3188b6[_0x286f1c[_0xd91c('0x29')]]={'$like':'%'+_0x40091c['query']['filter']+'%'};return _0x3188b6;}})});}_0x47d829=_['merge']({},_0x47d829,_0x40091c['options']);var _0x15659f={'where':_0x47d829[_0xd91c('0x39')]};return db[_0xd91c('0x3c')]['count'](_0x15659f)[_0xd91c('0x3d')](function(_0x5f01a3){_0x4c3284[_0xd91c('0x20')]=_0x5f01a3;if(_0x40091c[_0xd91c('0x32')][_0xd91c('0x3e')]){_0x47d829[_0xd91c('0x3f')]=[{'all':!![]}];}return db[_0xd91c('0x3c')][_0xd91c('0x40')](_0x47d829);})[_0xd91c('0x3d')](function(_0x1ce662){_0x4c3284['rows']=_0x1ce662;return _0x4c3284;})['then'](respondWithFilteredResult(_0x1606cd,_0x47d829))[_0xd91c('0x41')](handleError(_0x1606cd,null));};exports[_0xd91c('0x42')]=function(_0x1af82c,_0x452811){var _0x5862fb={'raw':![],'where':{'id':_0x1af82c['params']['id']}},_0x4730d8={};_0x4730d8[_0xd91c('0x2f')]=_[_0xd91c('0x31')](db[_0xd91c('0x3c')][_0xd91c('0x2c')]);_0x4730d8[_0xd91c('0x32')]=_['keys'](_0x1af82c['query']);_0x4730d8[_0xd91c('0x33')]=_['intersection'](_0x4730d8[_0xd91c('0x2f')],_0x4730d8[_0xd91c('0x32')]);_0x5862fb['attributes']=_[_0xd91c('0x34')](_0x4730d8[_0xd91c('0x2f')],qs[_0xd91c('0x36')](_0x1af82c[_0xd91c('0x32')][_0xd91c('0x36')]));_0x5862fb[_0xd91c('0x35')]=_0x5862fb[_0xd91c('0x35')][_0xd91c('0x43')]?_0x5862fb[_0xd91c('0x35')]:_0x4730d8[_0xd91c('0x2f')];if(_0x1af82c[_0xd91c('0x32')][_0xd91c('0x3e')]){_0x5862fb[_0xd91c('0x3f')]=[{'all':!![]}];}_0x5862fb=_['merge']({},_0x5862fb,_0x1af82c[_0xd91c('0x44')]);return db['AnalyticFieldReport'][_0xd91c('0x45')](_0x5862fb)['then'](handleEntityNotFound(_0x452811,null))[_0xd91c('0x3d')](respondWithResult(_0x452811,null))['catch'](handleError(_0x452811,null));};exports[_0xd91c('0x46')]=function(_0x2194cf,_0x56ae1){return db[_0xd91c('0x3c')][_0xd91c('0x46')](_0x2194cf[_0xd91c('0x47')],{})[_0xd91c('0x3d')](respondWithResult(_0x56ae1,0xc9))[_0xd91c('0x41')](handleError(_0x56ae1,null));};exports[_0xd91c('0x48')]=function(_0x1dedaf,_0x2f7baa){return db[_0xd91c('0x3c')][_0xd91c('0x48')](_0x1dedaf[_0xd91c('0x47')],{'raw':![],'individualHooks':!![]})[_0xd91c('0x3d')](respondWithResult(_0x2f7baa,0xc9))['catch'](handleError(_0x2f7baa,null));};exports['update']=function(_0x4871db,_0x51daab){if(_0x4871db['body']['id']){delete _0x4871db[_0xd91c('0x47')]['id'];}return db[_0xd91c('0x3c')][_0xd91c('0x45')]({'where':{'id':_0x4871db[_0xd91c('0x49')]['id']}})[_0xd91c('0x3d')](handleEntityNotFound(_0x51daab,null))[_0xd91c('0x3d')](saveUpdates(_0x4871db[_0xd91c('0x47')],null))['then'](respondWithResult(_0x51daab,null))[_0xd91c('0x41')](handleError(_0x51daab,null));};exports[_0xd91c('0x4a')]=function(_0x21c1d9,_0x2ef4a4){return db['AnalyticFieldReport']['find']({'where':{'id':_0x21c1d9[_0xd91c('0x49')]['id']}})[_0xd91c('0x3d')](handleEntityNotFound(_0x2ef4a4,null))[_0xd91c('0x3d')](removeEntity(_0x2ef4a4,null))['catch'](handleError(_0x2ef4a4,null));};exports[_0xd91c('0x4b')]=function(_0x10a734,_0x302211){return db[_0xd91c('0x3c')][_0xd91c('0x4a')]({'where':{'id':_0x10a734[_0xd91c('0x32')][_0xd91c('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xd91c('0x3d')](respondWithResult(_0x302211,0xcc))['catch'](handleError(_0x302211,null));};exports[_0xd91c('0x4d')]=function(_0x20b0ed,_0x2a60ed,_0x24518b){return db[_0xd91c('0x4e')]['findOne']({'where':{'id':_0x20b0ed[_0xd91c('0x49')]['id']}})[_0xd91c('0x3d')](handleEntityNotFound(_0x2a60ed,null))[_0xd91c('0x3d')](function(_0x1c5af2){if(_0x1c5af2){return db[_0xd91c('0x4f')][_0xd91c('0x50')](function(_0x1ca515){return db[_0xd91c('0x3c')][_0xd91c('0x4a')]({'where':{'CustomReportId':_0x20b0ed[_0xd91c('0x49')]['id']},'transaction':_0x1ca515})[_0xd91c('0x3d')](function(_0x1db69a){var _0x55a5f6=_[_0xd91c('0x30')](_0x20b0ed[_0xd91c('0x47')],function(_0x476591){delete _0x476591['id'];_0x476591[_0xd91c('0x51')]=_0x20b0ed[_0xd91c('0x49')]['id'];return _0x476591;});return db[_0xd91c('0x3c')][_0xd91c('0x48')](_0x55a5f6,{'transaction':_0x1ca515});});})[_0xd91c('0x3d')](function(){return db['AnalyticFieldReport'][_0xd91c('0x40')]({'where':{'CustomReportId':_0x20b0ed[_0xd91c('0x49')]['id']}});});}})[_0xd91c('0x3d')](respondWithResult(_0x2a60ed,null))[_0xd91c('0x41')](handleError(_0x2a60ed,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 8d659c7..a509dbe 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 _0x8041=['bluebird','rimraf','../../config/environment','./analyticFieldReport.attributes','define','analytics_report_fields','../../config/logger','api'];(function(_0x25d2fb,_0x18a774){var _0x1ded53=function(_0x4c0715){while(--_0x4c0715){_0x25d2fb['push'](_0x25d2fb['shift']());}};_0x1ded53(++_0x18a774);}(_0x8041,0x17e));var _0x1804=function(_0xf99553,_0x52f679){_0xf99553=_0xf99553-0x0;var _0x10a965=_0x8041[_0xf99553];return _0x10a965;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1804('0x0'))(_0x1804('0x1'));var moment=require('moment');var BPromise=require(_0x1804('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1804('0x3'));var config=require(_0x1804('0x4'));var attributes=require(_0x1804('0x5'));module['exports']=function(_0x8bb39a,_0x26c319){return _0x8bb39a[_0x1804('0x6')]('AnalyticFieldReport',attributes,{'tableName':_0x1804('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd204=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','bluebird','rimraf','./analyticFieldReport.attributes'];(function(_0x26996f,_0x295984){var _0x3ab19c=function(_0x2a86d2){while(--_0x2a86d2){_0x26996f['push'](_0x26996f['shift']());}};_0x3ab19c(++_0x295984);}(_0xd204,0x1ea));var _0x4d20=function(_0x1854ef,_0x4fe295){_0x1854ef=_0x1854ef-0x0;var _0x4cbe36=_0xd204[_0x1854ef];return _0x4cbe36;};'use strict';var _=require(_0x4d20('0x0'));var util=require(_0x4d20('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4d20('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4d20('0x3'));var config=require('../../config/environment');var attributes=require(_0x4d20('0x4'));module[_0x4d20('0x5')]=function(_0x3379bb,_0x265a10){return _0x3379bb[_0x4d20('0x6')](_0x4d20('0x7'),attributes,{'tableName':_0x4d20('0x8'),'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 e645883..4e487a6 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 _0x23fa=['error','code','message','request\x20sent','catch','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s'];(function(_0x2beb43,_0x1188d6){var _0x540848=function(_0x126b57){while(--_0x126b57){_0x2beb43['push'](_0x2beb43['shift']());}};_0x540848(++_0x1188d6);}(_0x23fa,0x9e));var _0xa23f=function(_0xc2f834,_0x5e49d8){_0xc2f834=_0xc2f834-0x0;var _0x34668f=_0x23fa[_0xc2f834];return _0x34668f;};'use strict';var _=require(_0xa23f('0x0'));var util=require('util');var moment=require(_0xa23f('0x1'));var BPromise=require(_0xa23f('0x2'));var rs=require(_0xa23f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa23f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa23f('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5712d8,_0x13ca67,_0x23213d){return new BPromise(function(_0x5b9355,_0x3bac43){return client[_0xa23f('0x6')](_0x5712d8,_0x23213d)[_0xa23f('0x7')](function(_0x2c18d3){logger[_0xa23f('0x8')](_0xa23f('0x9'),_0x13ca67,'request\x20sent');logger[_0xa23f('0xa')](_0xa23f('0xb'),_0x13ca67,'request\x20sent',JSON['stringify'](_0x2c18d3));if(_0x2c18d3[_0xa23f('0xc')]){if(_0x2c18d3[_0xa23f('0xc')][_0xa23f('0xd')]===0x1f4){logger[_0xa23f('0xc')](_0xa23f('0x9'),_0x13ca67,_0x2c18d3[_0xa23f('0xc')][_0xa23f('0xe')]);return _0x3bac43(_0x2c18d3[_0xa23f('0xc')][_0xa23f('0xe')]);}logger[_0xa23f('0xc')](_0xa23f('0x9'),_0x13ca67,_0x2c18d3[_0xa23f('0xc')]['message']);return _0x5b9355(_0x2c18d3['error'][_0xa23f('0xe')]);}else{logger[_0xa23f('0x8')]('AnalyticFieldReport,\x20%s,\x20%s',_0x13ca67,_0xa23f('0xf'));_0x5b9355(_0x2c18d3['result'][_0xa23f('0xe')]);}})[_0xa23f('0x10')](function(_0x22cd15){logger[_0xa23f('0xc')](_0xa23f('0x9'),_0x13ca67,_0x22cd15);_0x3bac43(_0x22cd15);});});}
\ No newline at end of file
+var _0x35f0=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x35f0,0x80));var _0x035f=function(_0x27183b,_0x4f8348){_0x27183b=_0x27183b-0x0;var _0x5a5f9f=_0x35f0[_0x27183b];return _0x5a5f9f;};'use strict';var _=require(_0x035f('0x0'));var util=require('util');var moment=require(_0x035f('0x1'));var BPromise=require(_0x035f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x035f('0x3'));var db=require(_0x035f('0x4'))['db'];var utils=require(_0x035f('0x5'));var logger=require(_0x035f('0x6'))(_0x035f('0x7'));var config=require('../../config/environment');var jayson=require(_0x035f('0x8'));var client=jayson[_0x035f('0x9')][_0x035f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3320f4,_0x793abe,_0x5b1ec4){return new BPromise(function(_0x4f0890,_0x449b99){return client['request'](_0x3320f4,_0x5b1ec4)['then'](function(_0x4d8e47){logger[_0x035f('0xb')](_0x035f('0xc'),_0x793abe,_0x035f('0xd'));logger[_0x035f('0xe')](_0x035f('0xf'),_0x793abe,'request\x20sent',JSON[_0x035f('0x10')](_0x4d8e47));if(_0x4d8e47['error']){if(_0x4d8e47[_0x035f('0x11')][_0x035f('0x12')]===0x1f4){logger[_0x035f('0x11')](_0x035f('0xc'),_0x793abe,_0x4d8e47['error'][_0x035f('0x13')]);return _0x449b99(_0x4d8e47[_0x035f('0x11')][_0x035f('0x13')]);}logger[_0x035f('0x11')](_0x035f('0xc'),_0x793abe,_0x4d8e47[_0x035f('0x11')][_0x035f('0x13')]);return _0x4f0890(_0x4d8e47[_0x035f('0x11')][_0x035f('0x13')]);}else{logger['info'](_0x035f('0xc'),_0x793abe,'request\x20sent');_0x4f0890(_0x4d8e47[_0x035f('0x14')][_0x035f('0x13')]);}})[_0x035f('0x15')](function(_0x78ede1){logger[_0x035f('0x11')](_0x035f('0xc'),_0x793abe,_0x78ede1);_0x449b99(_0x78ede1);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 1efb529..1791f4d 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(_0xfb0ebf,_0x2efd36){var _0x44639e=function(_0x5839ee){while(--_0x5839ee){_0xfb0ebf['push'](_0xfb0ebf['shift']());}};_0x44639e(++_0x2efd36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x2b3a60,_0x146ec1){var _0xd21365=function(_0x59ad5a){while(--_0x59ad5a){_0x2b3a60['push'](_0x2b3a60['shift']());}};_0xd21365(++_0x146ec1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 f14c453..c7fdc8e 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 _0xb458=['name','TEXT','sequelize','exports','STRING'];(function(_0x18f396,_0x174d17){var _0x3ba532=function(_0x2bc92f){while(--_0x2bc92f){_0x18f396['push'](_0x18f396['shift']());}};_0x3ba532(++_0x174d17);}(_0xb458,0xca));var _0x8b45=function(_0x5275e1,_0x11eae6){_0x5275e1=_0x5275e1-0x0;var _0x334a15=_0xb458[_0x5275e1];return _0x334a15;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'name':{'type':Sequelize[_0x8b45('0x2')],'allowNull':![],'unique':_0x8b45('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x8b45('0x4')]},'description':{'type':Sequelize[_0x8b45('0x2')]}};
\ No newline at end of file
+var _0xa74f=['STRING','TEXT'];(function(_0x3d1f60,_0x166b36){var _0x4f68ec=function(_0xd8d6f0){while(--_0xd8d6f0){_0x3d1f60['push'](_0x3d1f60['shift']());}};_0x4f68ec(++_0x166b36);}(_0xa74f,0x9a));var _0xfa74=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0xa74f[_0x424357];return _0x29c68e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfa74('0x0')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xfa74('0x1')]},'description':{'type':Sequelize[_0xfa74('0x0')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index d08480d..080d1a3 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 _0xd6d6=['includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','AnalyticMetric','rows','show'];(function(_0x400423,_0x192af9){var _0x337e55=function(_0x397bd2){while(--_0x397bd2){_0x400423['push'](_0x400423['shift']());}};_0x337e55(++_0x192af9);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x44ad88,_0xc510c7){_0x44ad88=_0x44ad88-0x0;var _0x1d42ec=_0xd6d6[_0x44ad88];return _0x1d42ec;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){var _0x99f7d6=_0x583b10[_0x6d6d('0x29')]({'plain':!![]});var _0xf0df7f=_0x6d6d('0x2a');return db['UserProfileResource'][_0x6d6d('0x28')]({'where':{'type':_0xf0df7f,'resourceId':_0x99f7d6['id']}})[_0x6d6d('0x27')](function(){return _0x583b10;});})[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0x408f98,_0x3641fc){return function(_0x4a57a1){if(!_0x4a57a1){_0x408f98[_0x6d6d('0x19')](0x194);}return _0x4a57a1;};}function handleError(_0x9595d8,_0x51bd68){_0x51bd68=_0x51bd68||0x1f4;return function(_0x553645){logger[_0x6d6d('0x2b')](_0x553645[_0x6d6d('0x2c')]);if(_0x553645[_0x6d6d('0x2d')]){delete _0x553645['name'];}_0x9595d8[_0x6d6d('0x1a')](_0x51bd68)[_0x6d6d('0x2e')](_0x553645);};}exports[_0x6d6d('0x2f')]=function(_0x1c8340,_0x64d1f7){var _0x428c17={},_0xdda3f2={},_0x359cfd={'count':0x0,'rows':[]};var _0x6c4741=_[_0x6d6d('0x30')](db['AnalyticMetric'][_0x6d6d('0x31')],function(_0x4f1fc5){return{'name':_0x4f1fc5[_0x6d6d('0x32')],'type':_0x4f1fc5[_0x6d6d('0x33')][_0x6d6d('0x34')]};});_0xdda3f2[_0x6d6d('0x35')]=_['map'](_0x6c4741,_0x6d6d('0x2d'));_0xdda3f2['query']=_[_0x6d6d('0x36')](_0x1c8340[_0x6d6d('0x37')]);_0xdda3f2['filters']=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],_0xdda3f2[_0x6d6d('0x37')]);_0x428c17[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x428c17[_0x6d6d('0x39')]=_0x428c17[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x428c17[_0x6d6d('0x39')]:_0xdda3f2[_0x6d6d('0x35')];if(!_0x1c8340['query'][_0x6d6d('0x3c')](_0x6d6d('0x3d'))){_0x428c17[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x1c8340['query']['limit']);_0x428c17[_0x6d6d('0x1f')]=qs[_0x6d6d('0x1f')](_0x1c8340[_0x6d6d('0x37')]['offset']);}_0x428c17[_0x6d6d('0x3e')]=qs[_0x6d6d('0x3f')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3f')]);_0x428c17['where']=qs['filters'](_['pick'](_0x1c8340[_0x6d6d('0x37')],_0xdda3f2[_0x6d6d('0x40')]),_0x6c4741);if(_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]){_0x428c17['where']=_[_0x6d6d('0x42')](_0x428c17[_0x6d6d('0x43')],{'$or':_[_0x6d6d('0x30')](_0x6c4741,function(_0x3c6d23){if(_0x3c6d23[_0x6d6d('0x33')]!==_0x6d6d('0x44')){var _0x4b457d={};_0x4b457d[_0x3c6d23[_0x6d6d('0x2d')]]={'$like':'%'+_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]+'%'};return _0x4b457d;}})});}_0x428c17=_[_0x6d6d('0x42')]({},_0x428c17,_0x1c8340[_0x6d6d('0x45')]);var _0x3e27b7={'where':_0x428c17[_0x6d6d('0x43')]};return db['AnalyticMetric'][_0x6d6d('0x20')](_0x3e27b7)[_0x6d6d('0x27')](function(_0x16e177){_0x359cfd[_0x6d6d('0x20')]=_0x16e177;if(_0x1c8340[_0x6d6d('0x37')]['includeAll']){_0x428c17[_0x6d6d('0x46')]=[{'all':!![]}];}return db[_0x6d6d('0x47')]['findAll'](_0x428c17);})[_0x6d6d('0x27')](function(_0x50dc17){_0x359cfd[_0x6d6d('0x48')]=_0x50dc17;return _0x359cfd;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x64d1f7,_0x428c17))['catch'](handleError(_0x64d1f7,null));};exports[_0x6d6d('0x49')]=function(_0x3324ec,_0x252cbe){var _0x4041f3={'raw':!![],'where':{'id':_0x3324ec['params']['id']}},_0xf7ea0d={};_0xf7ea0d['model']=_[_0x6d6d('0x36')](db['AnalyticMetric']['rawAttributes']);_0xf7ea0d[_0x6d6d('0x37')]=_[_0x6d6d('0x36')](_0x3324ec[_0x6d6d('0x37')]);_0xf7ea0d['filters']=_[_0x6d6d('0x38')](_0xf7ea0d['model'],_0xf7ea0d[_0x6d6d('0x37')]);_0x4041f3[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xf7ea0d[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x4041f3['attributes']=_0x4041f3[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x4041f3[_0x6d6d('0x39')]:_0xf7ea0d[_0x6d6d('0x35')];if(_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x4a')]){_0x4041f3[_0x6d6d('0x46')]=[{'all':!![]}];}_0x4041f3=_[_0x6d6d('0x42')]({},_0x4041f3,_0x3324ec[_0x6d6d('0x45')]);return db['AnalyticMetric']['find'](_0x4041f3)[_0x6d6d('0x27')](handleEntityNotFound(_0x252cbe,null))[_0x6d6d('0x27')](respondWithResult(_0x252cbe,null))[_0x6d6d('0x4b')](handleError(_0x252cbe,null));};exports[_0x6d6d('0x4c')]=function(_0xe2a20e,_0x492834){return db[_0x6d6d('0x47')][_0x6d6d('0x4c')](_0xe2a20e[_0x6d6d('0x4d')],{})[_0x6d6d('0x27')](function(_0x2ee917){var _0x23c2db=_0xe2a20e[_0x6d6d('0x4e')][_0x6d6d('0x29')]({'plain':!![]});if(!_0x23c2db)throw new Error(_0x6d6d('0x4f'));if(_0x23c2db[_0x6d6d('0x50')]===_0x6d6d('0x4e')){var _0x175e26=_0x2ee917['get']({'plain':!![]});var _0x190786=_0x6d6d('0x2a');return db[_0x6d6d('0x51')][_0x6d6d('0x52')]({'where':{'name':_0x190786,'userProfileId':_0x23c2db[_0x6d6d('0x53')]},'raw':!![]})['then'](function(_0x38c307){if(_0x38c307&&_0x38c307[_0x6d6d('0x54')]===0x0){return db[_0x6d6d('0x55')]['create']({'name':_0x175e26['name'],'resourceId':_0x175e26['id'],'type':_0x38c307[_0x6d6d('0x2d')],'sectionId':_0x38c307['id']},{})['then'](function(){return _0x2ee917;});}else{return _0x2ee917;}})[_0x6d6d('0x4b')](function(_0x995fe2){logger[_0x6d6d('0x2b')](_0x6d6d('0x56'),_0x995fe2);throw _0x995fe2;});}return _0x2ee917;})[_0x6d6d('0x27')](respondWithResult(_0x492834,0xc9))[_0x6d6d('0x4b')](handleError(_0x492834,null));};exports[_0x6d6d('0x26')]=function(_0x26c23a,_0x1a8f33){if(_0x26c23a[_0x6d6d('0x4d')]['id']){delete _0x26c23a['body']['id'];}return db[_0x6d6d('0x47')][_0x6d6d('0x52')]({'where':{'id':_0x26c23a[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x1a8f33,null))[_0x6d6d('0x27')](saveUpdates(_0x26c23a[_0x6d6d('0x4d')],null))[_0x6d6d('0x27')](respondWithResult(_0x1a8f33,null))['catch'](handleError(_0x1a8f33,null));};exports['destroy']=function(_0x3ad9b0,_0x122865){return db['AnalyticMetric'][_0x6d6d('0x52')]({'where':{'id':_0x3ad9b0[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x122865,null))[_0x6d6d('0x27')](removeEntity(_0x122865,null))[_0x6d6d('0x4b')](handleError(_0x122865,null));};
\ No newline at end of file
+var _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x17259a,_0x44b48f){var _0x1ed9cd=function(_0x1f216a){while(--_0x1f216a){_0x17259a['push'](_0x17259a['shift']());}};_0x1ed9cd(++_0x44b48f);}(_0xdc97,0x13b));var _0x7dc9=function(_0x129b3a,_0x32828f){_0x129b3a=_0x129b3a-0x0;var _0x52ee3c=_0xdc97[_0x129b3a];return _0x52ee3c;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index ae25dc6..07013cb 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 _0x71ad=['api','bluebird','request-promise','rimraf','exports','define','AnalyticMetric','analytics_metrics','lodash','util'];(function(_0x118b6e,_0x48b5fc){var _0x33be58=function(_0x56567e){while(--_0x56567e){_0x118b6e['push'](_0x118b6e['shift']());}};_0x33be58(++_0x48b5fc);}(_0x71ad,0xee));var _0xd71a=function(_0x4e95b2,_0x113282){_0x4e95b2=_0x4e95b2-0x0;var _0x8f4beb=_0x71ad[_0x4e95b2];return _0x8f4beb;};'use strict';var _=require(_0xd71a('0x0'));var util=require(_0xd71a('0x1'));var logger=require('../../config/logger')(_0xd71a('0x2'));var moment=require('moment');var BPromise=require(_0xd71a('0x3'));var rp=require(_0xd71a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd71a('0x5'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0xd71a('0x6')]=function(_0x5ec697,_0x1e0701){return _0x5ec697[_0xd71a('0x7')](_0xd71a('0x8'),attributes,{'tableName':_0xd71a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6869=['rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util','../../config/logger','moment','path'];(function(_0x4f310a,_0x2a5f79){var _0x3c7876=function(_0x4fcb41){while(--_0x4fcb41){_0x4f310a['push'](_0x4f310a['shift']());}};_0x3c7876(++_0x2a5f79);}(_0x6869,0xe2));var _0x9686=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x6869[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x9686('0x0'));var util=require(_0x9686('0x1'));var logger=require(_0x9686('0x2'))('api');var moment=require(_0x9686('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9686('0x4'));var rimraf=require(_0x9686('0x5'));var config=require(_0x9686('0x6'));var attributes=require(_0x9686('0x7'));module[_0x9686('0x8')]=function(_0x4a0657,_0x35591e){return _0x4a0657[_0x9686('0x9')](_0x9686('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 0d4ad5c..eab39ad 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 _0x62c1=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error'];(function(_0x5c2a5d,_0x2caf3e){var _0x14e902=function(_0x17a915){while(--_0x17a915){_0x5c2a5d['push'](_0x5c2a5d['shift']());}};_0x14e902(++_0x2caf3e);}(_0x62c1,0x190));var _0x162c=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x62c1[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x162c('0x0'));var util=require(_0x162c('0x1'));var moment=require(_0x162c('0x2'));var BPromise=require(_0x162c('0x3'));var rs=require(_0x162c('0x4'));var fs=require('fs');var Redis=require(_0x162c('0x5'));var db=require(_0x162c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x162c('0x7'));var jayson=require(_0x162c('0x8'));var client=jayson[_0x162c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x238800,_0x48016f,_0x19e1ae){return new BPromise(function(_0x17dfe3,_0x33f3b6){return client[_0x162c('0xa')](_0x238800,_0x19e1ae)[_0x162c('0xb')](function(_0x3fbcd1){logger[_0x162c('0xc')](_0x162c('0xd'),_0x48016f,_0x162c('0xe'));logger[_0x162c('0xf')](_0x162c('0x10'),_0x48016f,_0x162c('0xe'),JSON['stringify'](_0x3fbcd1));if(_0x3fbcd1[_0x162c('0x11')]){if(_0x3fbcd1[_0x162c('0x11')][_0x162c('0x12')]===0x1f4){logger[_0x162c('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x48016f,_0x3fbcd1[_0x162c('0x11')][_0x162c('0x13')]);return _0x33f3b6(_0x3fbcd1[_0x162c('0x11')][_0x162c('0x13')]);}logger[_0x162c('0x11')](_0x162c('0xd'),_0x48016f,_0x3fbcd1[_0x162c('0x11')]['message']);return _0x17dfe3(_0x3fbcd1['error'][_0x162c('0x13')]);}else{logger[_0x162c('0xc')](_0x162c('0xd'),_0x48016f,_0x162c('0xe'));_0x17dfe3(_0x3fbcd1[_0x162c('0x14')][_0x162c('0x13')]);}})[_0x162c('0x15')](function(_0x268312){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x48016f,_0x268312);_0x33f3b6(_0x268312);});});}
\ No newline at end of file
+var _0x9c50=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment'];(function(_0x12b207,_0x3d4861){var _0x217e94=function(_0x4873f1){while(--_0x4873f1){_0x12b207['push'](_0x12b207['shift']());}};_0x217e94(++_0x3d4861);}(_0x9c50,0x67));var _0x09c5=function(_0x4156eb,_0x17ec35){_0x4156eb=_0x4156eb-0x0;var _0x4e6c64=_0x9c50[_0x4156eb];return _0x4e6c64;};'use strict';var _=require('lodash');var util=require(_0x09c5('0x0'));var moment=require(_0x09c5('0x1'));var BPromise=require(_0x09c5('0x2'));var rs=require(_0x09c5('0x3'));var fs=require('fs');var Redis=require(_0x09c5('0x4'));var db=require(_0x09c5('0x5'))['db'];var utils=require(_0x09c5('0x6'));var logger=require(_0x09c5('0x7'))(_0x09c5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x09c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e211e,_0x4d1f00,_0x264bbb){return new BPromise(function(_0x18f886,_0x3286b7){return client[_0x09c5('0xa')](_0x1e211e,_0x264bbb)['then'](function(_0x4fdf97){logger[_0x09c5('0xb')](_0x09c5('0xc'),_0x4d1f00,_0x09c5('0xd'));logger[_0x09c5('0xe')](_0x09c5('0xf'),_0x4d1f00,_0x09c5('0xd'),JSON['stringify'](_0x4fdf97));if(_0x4fdf97[_0x09c5('0x10')]){if(_0x4fdf97[_0x09c5('0x10')][_0x09c5('0x11')]===0x1f4){logger[_0x09c5('0x10')](_0x09c5('0xc'),_0x4d1f00,_0x4fdf97[_0x09c5('0x10')][_0x09c5('0x12')]);return _0x3286b7(_0x4fdf97[_0x09c5('0x10')][_0x09c5('0x12')]);}logger[_0x09c5('0x10')](_0x09c5('0xc'),_0x4d1f00,_0x4fdf97['error'][_0x09c5('0x12')]);return _0x18f886(_0x4fdf97['error']['message']);}else{logger['info'](_0x09c5('0xc'),_0x4d1f00,_0x09c5('0xd'));_0x18f886(_0x4fdf97[_0x09c5('0x13')][_0x09c5('0x12')]);}})[_0x09c5('0x14')](function(_0x1fa006){logger['error'](_0x09c5('0xc'),_0x4d1f00,_0x1fa006);_0x3286b7(_0x1fa006);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index cb596a6..4620235 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 _0x2e8a=['update','delete','/:id','exports','util','path','express','Router','../../components/auth/service','isAuthenticated','index','get','show','post','put'];(function(_0x4364f6,_0x1d165b){var _0x5a37ab=function(_0x9feb8c){while(--_0x9feb8c){_0x4364f6['push'](_0x4364f6['shift']());}};_0x5a37ab(++_0x1d165b);}(_0x2e8a,0xc7));var _0xa2e8=function(_0x8f7d2b,_0x1bebaf){_0x8f7d2b=_0x8f7d2b-0x0;var _0x13c298=_0x2e8a[_0x8f7d2b];return _0x13c298;};'use strict';var multer=require('multer');var util=require(_0xa2e8('0x0'));var path=require(_0xa2e8('0x1'));var timeout=require('connect-timeout');var express=require(_0xa2e8('0x2'));var router=express[_0xa2e8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa2e8('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xa2e8('0x5')](),controller[_0xa2e8('0x6')]);router[_0xa2e8('0x7')]('/:id',auth[_0xa2e8('0x5')](),controller[_0xa2e8('0x8')]);router[_0xa2e8('0x9')]('/',auth[_0xa2e8('0x5')](),controller['create']);router[_0xa2e8('0xa')]('/:id',auth[_0xa2e8('0x5')](),controller[_0xa2e8('0xb')]);router[_0xa2e8('0xc')](_0xa2e8('0xd'),auth[_0xa2e8('0x5')](),controller['destroy']);module[_0xa2e8('0xe')]=router;
\ No newline at end of file
+var _0x5395=['index','/:id','post','create','put','destroy','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated'];(function(_0x7457fe,_0x564a5e){var _0x57a6e4=function(_0x566577){while(--_0x566577){_0x7457fe['push'](_0x7457fe['shift']());}};_0x57a6e4(++_0x564a5e);}(_0x5395,0x150));var _0x5539=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5395[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x5539('0x0'));var util=require('util');var path=require(_0x5539('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5539('0x2')]();var fs_extra=require(_0x5539('0x3'));var auth=require(_0x5539('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5539('0x5'));var controller=require(_0x5539('0x6'));router[_0x5539('0x7')]('/',auth[_0x5539('0x8')](),controller[_0x5539('0x9')]);router[_0x5539('0x7')](_0x5539('0xa'),auth[_0x5539('0x8')](),controller['show']);router[_0x5539('0xb')]('/',auth[_0x5539('0x8')](),controller[_0x5539('0xc')]);router[_0x5539('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x5539('0xa'),auth['isAuthenticated'](),controller[_0x5539('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index b999686..866825c 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 _0x944b=['exports','sequelize'];(function(_0x3825a8,_0x2ce1a2){var _0xabc9bc=function(_0x101073){while(--_0x101073){_0x3825a8['push'](_0x3825a8['shift']());}};_0xabc9bc(++_0x2ce1a2);}(_0x944b,0xc3));var _0xb944=function(_0x1c2d8b,_0x5d091b){_0x1c2d8b=_0x1c2d8b-0x0;var _0xb90fca=_0x944b[_0x1c2d8b];return _0xb90fca;};'use strict';var Sequelize=require(_0xb944('0x0'));module[_0xb944('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xa690=['sequelize','TEXT'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa690,0xc4));var _0x0a69=function(_0x3c858f,_0x235201){_0x3c858f=_0x3c858f-0x0;var _0x198090=_0xa690[_0x3c858f];return _0x198090;};'use strict';var Sequelize=require(_0x0a69('0x0'));module['exports']={'tree':{'type':Sequelize[_0x0a69('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index aefd773..cc54aad 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 _0x433c=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','options','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields'];(function(_0x401128,_0x285722){var _0x2890e8=function(_0xb9b465){while(--_0xb9b465){_0x401128['push'](_0x401128['shift']());}};_0x2890e8(++_0x285722);}(_0x433c,0x1cf));var _0xc433=function(_0x213ed5,_0x26712a){_0x213ed5=_0x213ed5-0x0;var _0x191514=_0x433c[_0x213ed5];return _0x191514;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc433('0x0'));var zipdir=require(_0xc433('0x1'));var jsonpatch=require(_0xc433('0x2'));var rp=require('request-promise');var moment=require(_0xc433('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc433('0x4'));var util=require(_0xc433('0x5'));var path=require('path');var sox=require(_0xc433('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc433('0x7'));var _=require('lodash');var squel=require(_0xc433('0x8'));var crypto=require(_0xc433('0x9'));var jsforce=require(_0xc433('0xa'));var deskjs=require(_0xc433('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc433('0xc'));var Redis=require(_0xc433('0xd'));var authService=require(_0xc433('0xe'));var qs=require(_0xc433('0xf'));var as=require(_0xc433('0x10'));var hardwareService=require(_0xc433('0x11'));var logger=require(_0xc433('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xc433('0x13'));var licenseUtil=require(_0xc433('0x14'));var db=require(_0xc433('0x15'))['db'];function respondWithStatusCode(_0x43b490,_0x2b9383){_0x2b9383=_0x2b9383||0xcc;return function(_0x39e487){if(_0x39e487){return _0x43b490[_0xc433('0x16')](_0x2b9383);}return _0x43b490[_0xc433('0x17')](_0x2b9383)[_0xc433('0x18')]();};}function respondWithResult(_0x15ca54,_0x214cea){_0x214cea=_0x214cea||0xc8;return function(_0x2f9b6c){if(_0x2f9b6c){return _0x15ca54['status'](_0x214cea)[_0xc433('0x19')](_0x2f9b6c);}};}function respondWithFilteredResult(_0x34a77e,_0x335e40){return function(_0x7b70a7){if(_0x7b70a7){var _0x233c5f=typeof _0x335e40['offset']===_0xc433('0x1a')&&typeof _0x335e40['limit']===_0xc433('0x1a');var _0x42af0f=_0x7b70a7[_0xc433('0x1b')];var _0x244176=_0x233c5f?0x0:_0x335e40[_0xc433('0x1c')];var _0x18f85d=_0x233c5f?_0x7b70a7[_0xc433('0x1b')]:_0x335e40[_0xc433('0x1c')]+_0x335e40[_0xc433('0x1d')];var _0x13cca6;if(_0x18f85d>=_0x42af0f){_0x18f85d=_0x42af0f;_0x13cca6=0xc8;}else{_0x13cca6=0xce;}_0x34a77e['status'](_0x13cca6);return _0x34a77e[_0xc433('0x1e')](_0xc433('0x1f'),_0x244176+'-'+_0x18f85d+'/'+_0x42af0f)[_0xc433('0x19')](_0x7b70a7);}return null;};}function patchUpdates(_0x76ccd0){return function(_0x5e18ad){try{jsonpatch[_0xc433('0x20')](_0x5e18ad,_0x76ccd0,!![]);}catch(_0x30cb56){return BPromise[_0xc433('0x21')](_0x30cb56);}return _0x5e18ad[_0xc433('0x22')]();};}function saveUpdates(_0x4ee802,_0xe5b524){return function(_0x280706){if(_0x280706){return _0x280706[_0xc433('0x23')](_0x4ee802)['then'](function(_0x32d2c7){return _0x32d2c7;});}return null;};}function removeEntity(_0x47d852,_0x443b32){return function(_0x31a974){if(_0x31a974){return _0x31a974[_0xc433('0x24')]()[_0xc433('0x25')](function(){_0x47d852[_0xc433('0x17')](0xcc)[_0xc433('0x18')]();});}};}function handleEntityNotFound(_0x4fc646,_0x7e67bd){return function(_0x388a12){if(!_0x388a12){_0x4fc646[_0xc433('0x16')](0x194);}return _0x388a12;};}function handleError(_0x307157,_0x368241){_0x368241=_0x368241||0x1f4;return function(_0x51fc36){logger[_0xc433('0x26')](_0x51fc36['stack']);if(_0x51fc36[_0xc433('0x27')]){delete _0x51fc36['name'];}_0x307157['status'](_0x368241)[_0xc433('0x28')](_0x51fc36);};}exports[_0xc433('0x29')]=function(_0x400fa7,_0x4d3826){var _0x6d7ed={},_0x53f9d9={},_0x52aca0={'count':0x0,'rows':[]};var _0x24c960=_['map'](db[_0xc433('0x2a')][_0xc433('0x2b')],function(_0x119efd){return{'name':_0x119efd[_0xc433('0x2c')],'type':_0x119efd[_0xc433('0x2d')][_0xc433('0x2e')]};});_0x53f9d9[_0xc433('0x2f')]=_[_0xc433('0x30')](_0x24c960,'name');_0x53f9d9['query']=_[_0xc433('0x31')](_0x400fa7[_0xc433('0x32')]);_0x53f9d9[_0xc433('0x33')]=_[_0xc433('0x34')](_0x53f9d9[_0xc433('0x2f')],_0x53f9d9['query']);_0x6d7ed[_0xc433('0x35')]=_[_0xc433('0x34')](_0x53f9d9[_0xc433('0x2f')],qs[_0xc433('0x36')](_0x400fa7[_0xc433('0x32')][_0xc433('0x36')]));_0x6d7ed[_0xc433('0x35')]=_0x6d7ed['attributes']['length']?_0x6d7ed[_0xc433('0x35')]:_0x53f9d9[_0xc433('0x2f')];if(!_0x400fa7[_0xc433('0x32')][_0xc433('0x37')](_0xc433('0x38'))){_0x6d7ed['limit']=qs[_0xc433('0x1d')](_0x400fa7['query']['limit']);_0x6d7ed[_0xc433('0x1c')]=qs['offset'](_0x400fa7[_0xc433('0x32')]['offset']);}_0x6d7ed[_0xc433('0x39')]=qs[_0xc433('0x3a')](_0x400fa7[_0xc433('0x32')][_0xc433('0x3a')]);_0x6d7ed[_0xc433('0x3b')]=qs[_0xc433('0x33')](_[_0xc433('0x3c')](_0x400fa7[_0xc433('0x32')],_0x53f9d9['filters']),_0x24c960);if(_0x400fa7[_0xc433('0x32')][_0xc433('0x3d')]){_0x6d7ed[_0xc433('0x3b')]=_[_0xc433('0x3e')](_0x6d7ed[_0xc433('0x3b')],{'$or':_[_0xc433('0x30')](_0x24c960,function(_0x2d8ef9){if(_0x2d8ef9['type']!==_0xc433('0x3f')){var _0x532665={};_0x532665[_0x2d8ef9[_0xc433('0x27')]]={'$like':'%'+_0x400fa7[_0xc433('0x32')][_0xc433('0x3d')]+'%'};return _0x532665;}})});}_0x6d7ed=_[_0xc433('0x3e')]({},_0x6d7ed,_0x400fa7['options']);var _0x2e2d31={'where':_0x6d7ed[_0xc433('0x3b')]};return db[_0xc433('0x2a')][_0xc433('0x1b')](_0x2e2d31)[_0xc433('0x25')](function(_0x298d3a){_0x52aca0[_0xc433('0x1b')]=_0x298d3a;if(_0x400fa7[_0xc433('0x32')][_0xc433('0x40')]){_0x6d7ed[_0xc433('0x41')]=[{'all':!![]}];}return db[_0xc433('0x2a')][_0xc433('0x42')](_0x6d7ed);})[_0xc433('0x25')](function(_0x22c4c6){_0x52aca0[_0xc433('0x43')]=_0x22c4c6;return _0x52aca0;})[_0xc433('0x25')](respondWithFilteredResult(_0x4d3826,_0x6d7ed))['catch'](handleError(_0x4d3826,null));};exports['show']=function(_0x188301,_0x115429){var _0x341b48={'raw':!![],'where':{'id':_0x188301[_0xc433('0x44')]['id']}},_0x20264c={};_0x20264c['model']=_['keys'](db['AnalyticTreeReport'][_0xc433('0x2b')]);_0x20264c[_0xc433('0x32')]=_[_0xc433('0x31')](_0x188301[_0xc433('0x32')]);_0x20264c[_0xc433('0x33')]=_[_0xc433('0x34')](_0x20264c[_0xc433('0x2f')],_0x20264c['query']);_0x341b48[_0xc433('0x35')]=_[_0xc433('0x34')](_0x20264c[_0xc433('0x2f')],qs[_0xc433('0x36')](_0x188301['query'][_0xc433('0x36')]));_0x341b48['attributes']=_0x341b48[_0xc433('0x35')]['length']?_0x341b48[_0xc433('0x35')]:_0x20264c[_0xc433('0x2f')];if(_0x188301[_0xc433('0x32')]['includeAll']){_0x341b48['include']=[{'all':!![]}];}_0x341b48=_[_0xc433('0x3e')]({},_0x341b48,_0x188301[_0xc433('0x45')]);return db[_0xc433('0x2a')][_0xc433('0x46')](_0x341b48)[_0xc433('0x25')](handleEntityNotFound(_0x115429,null))['then'](respondWithResult(_0x115429,null))[_0xc433('0x47')](handleError(_0x115429,null));};exports[_0xc433('0x48')]=function(_0x4aec44,_0x477df9){return db[_0xc433('0x2a')]['create'](_0x4aec44[_0xc433('0x49')],{})[_0xc433('0x25')](respondWithResult(_0x477df9,0xc9))[_0xc433('0x47')](handleError(_0x477df9,null));};exports[_0xc433('0x23')]=function(_0x108e7d,_0x1335ed){if(_0x108e7d[_0xc433('0x49')]['id']){delete _0x108e7d[_0xc433('0x49')]['id'];}return db['AnalyticTreeReport'][_0xc433('0x46')]({'where':{'id':_0x108e7d[_0xc433('0x44')]['id']}})[_0xc433('0x25')](handleEntityNotFound(_0x1335ed,null))['then'](saveUpdates(_0x108e7d['body'],null))[_0xc433('0x25')](respondWithResult(_0x1335ed,null))[_0xc433('0x47')](handleError(_0x1335ed,null));};exports[_0xc433('0x24')]=function(_0x1cefb2,_0x468173){return db[_0xc433('0x2a')][_0xc433('0x46')]({'where':{'id':_0x1cefb2['params']['id']}})['then'](handleEntityNotFound(_0x468173,null))[_0xc433('0x25')](removeEntity(_0x468173,null))[_0xc433('0x47')](handleError(_0x468173,null));};
\ No newline at end of file
+var _0xa6dc=['params','length','options','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','show'];(function(_0x4f5eb1,_0x3ababf){var _0x14bcb1=function(_0x105091){while(--_0x105091){_0x4f5eb1['push'](_0x4f5eb1['shift']());}};_0x14bcb1(++_0x3ababf);}(_0xa6dc,0x11e));var _0xca6d=function(_0x371bd7,_0x27a8c7){_0x371bd7=_0x371bd7-0x0;var _0x54b744=_0xa6dc[_0x371bd7];return _0x54b744;};'use strict';var emlformat=require(_0xca6d('0x0'));var rimraf=require(_0xca6d('0x1'));var zipdir=require(_0xca6d('0x2'));var jsonpatch=require(_0xca6d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xca6d('0x4'));var path=require(_0xca6d('0x5'));var sox=require(_0xca6d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca6d('0x7'));var _=require(_0xca6d('0x8'));var squel=require('squel');var crypto=require(_0xca6d('0x9'));var jsforce=require(_0xca6d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xca6d('0xb'));var querystring=require(_0xca6d('0xc'));var Papa=require(_0xca6d('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xca6d('0xe'));var as=require(_0xca6d('0xf'));var hardwareService=require(_0xca6d('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xca6d('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xca6d('0x12'));var db=require(_0xca6d('0x13'))['db'];function respondWithStatusCode(_0x314b98,_0x2224ca){_0x2224ca=_0x2224ca||0xcc;return function(_0x41c433){if(_0x41c433){return _0x314b98[_0xca6d('0x14')](_0x2224ca);}return _0x314b98['status'](_0x2224ca)[_0xca6d('0x15')]();};}function respondWithResult(_0x3b2063,_0x2f9bf5){_0x2f9bf5=_0x2f9bf5||0xc8;return function(_0x298df0){if(_0x298df0){return _0x3b2063[_0xca6d('0x16')](_0x2f9bf5)[_0xca6d('0x17')](_0x298df0);}};}function respondWithFilteredResult(_0x533f72,_0x5464ab){return function(_0x3baab7){if(_0x3baab7){var _0x16f54a=typeof _0x5464ab[_0xca6d('0x18')]==='undefined'&&typeof _0x5464ab[_0xca6d('0x19')]===_0xca6d('0x1a');var _0x172de0=_0x3baab7['count'];var _0x540422=_0x16f54a?0x0:_0x5464ab[_0xca6d('0x18')];var _0x35b91f=_0x16f54a?_0x3baab7[_0xca6d('0x1b')]:_0x5464ab[_0xca6d('0x18')]+_0x5464ab[_0xca6d('0x19')];var _0x1e9aeb;if(_0x35b91f>=_0x172de0){_0x35b91f=_0x172de0;_0x1e9aeb=0xc8;}else{_0x1e9aeb=0xce;}_0x533f72[_0xca6d('0x16')](_0x1e9aeb);return _0x533f72['set'](_0xca6d('0x1c'),_0x540422+'-'+_0x35b91f+'/'+_0x172de0)[_0xca6d('0x17')](_0x3baab7);}return null;};}function patchUpdates(_0x1b0f7e){return function(_0x32cf01){try{jsonpatch[_0xca6d('0x1d')](_0x32cf01,_0x1b0f7e,!![]);}catch(_0x1f7c08){return BPromise[_0xca6d('0x1e')](_0x1f7c08);}return _0x32cf01[_0xca6d('0x1f')]();};}function saveUpdates(_0x485280,_0x1ecabc){return function(_0x5bdf90){if(_0x5bdf90){return _0x5bdf90[_0xca6d('0x20')](_0x485280)[_0xca6d('0x21')](function(_0x2e0577){return _0x2e0577;});}return null;};}function removeEntity(_0x15c980,_0xb199de){return function(_0x163f31){if(_0x163f31){return _0x163f31['destroy']()[_0xca6d('0x21')](function(){_0x15c980[_0xca6d('0x16')](0xcc)[_0xca6d('0x15')]();});}};}function handleEntityNotFound(_0x499aa7,_0x5acb38){return function(_0x4d1be7){if(!_0x4d1be7){_0x499aa7[_0xca6d('0x14')](0x194);}return _0x4d1be7;};}function handleError(_0x1b6f66,_0x3b91b0){_0x3b91b0=_0x3b91b0||0x1f4;return function(_0x4cda46){logger[_0xca6d('0x22')](_0x4cda46[_0xca6d('0x23')]);if(_0x4cda46[_0xca6d('0x24')]){delete _0x4cda46['name'];}_0x1b6f66[_0xca6d('0x16')](_0x3b91b0)[_0xca6d('0x25')](_0x4cda46);};}exports[_0xca6d('0x26')]=function(_0x506689,_0x225c9d){var _0x24265c={},_0x1a3f09={},_0x3ef101={'count':0x0,'rows':[]};var _0x5d0391=_[_0xca6d('0x27')](db[_0xca6d('0x28')][_0xca6d('0x29')],function(_0x3fef4f){return{'name':_0x3fef4f[_0xca6d('0x2a')],'type':_0x3fef4f['type'][_0xca6d('0x2b')]};});_0x1a3f09[_0xca6d('0x2c')]=_[_0xca6d('0x27')](_0x5d0391,'name');_0x1a3f09[_0xca6d('0x2d')]=_[_0xca6d('0x2e')](_0x506689['query']);_0x1a3f09[_0xca6d('0x2f')]=_[_0xca6d('0x30')](_0x1a3f09[_0xca6d('0x2c')],_0x1a3f09['query']);_0x24265c[_0xca6d('0x31')]=_[_0xca6d('0x30')](_0x1a3f09[_0xca6d('0x2c')],qs[_0xca6d('0x32')](_0x506689[_0xca6d('0x2d')][_0xca6d('0x32')]));_0x24265c[_0xca6d('0x31')]=_0x24265c[_0xca6d('0x31')]['length']?_0x24265c['attributes']:_0x1a3f09[_0xca6d('0x2c')];if(!_0x506689['query'][_0xca6d('0x33')]('nolimit')){_0x24265c['limit']=qs[_0xca6d('0x19')](_0x506689['query'][_0xca6d('0x19')]);_0x24265c[_0xca6d('0x18')]=qs['offset'](_0x506689[_0xca6d('0x2d')][_0xca6d('0x18')]);}_0x24265c[_0xca6d('0x34')]=qs['sort'](_0x506689[_0xca6d('0x2d')][_0xca6d('0x35')]);_0x24265c[_0xca6d('0x36')]=qs[_0xca6d('0x2f')](_[_0xca6d('0x37')](_0x506689[_0xca6d('0x2d')],_0x1a3f09[_0xca6d('0x2f')]),_0x5d0391);if(_0x506689['query']['filter']){_0x24265c['where']=_[_0xca6d('0x38')](_0x24265c[_0xca6d('0x36')],{'$or':_[_0xca6d('0x27')](_0x5d0391,function(_0x4b447b){if(_0x4b447b[_0xca6d('0x39')]!==_0xca6d('0x3a')){var _0x54208b={};_0x54208b[_0x4b447b[_0xca6d('0x24')]]={'$like':'%'+_0x506689[_0xca6d('0x2d')][_0xca6d('0x3b')]+'%'};return _0x54208b;}})});}_0x24265c=_[_0xca6d('0x38')]({},_0x24265c,_0x506689['options']);var _0x22e335={'where':_0x24265c[_0xca6d('0x36')]};return db[_0xca6d('0x28')]['count'](_0x22e335)['then'](function(_0x12ab55){_0x3ef101['count']=_0x12ab55;if(_0x506689[_0xca6d('0x2d')][_0xca6d('0x3c')]){_0x24265c[_0xca6d('0x3d')]=[{'all':!![]}];}return db[_0xca6d('0x28')][_0xca6d('0x3e')](_0x24265c);})['then'](function(_0x50028a){_0x3ef101['rows']=_0x50028a;return _0x3ef101;})[_0xca6d('0x21')](respondWithFilteredResult(_0x225c9d,_0x24265c))['catch'](handleError(_0x225c9d,null));};exports[_0xca6d('0x3f')]=function(_0x1c888c,_0x23eb75){var _0x5eddf3={'raw':!![],'where':{'id':_0x1c888c[_0xca6d('0x40')]['id']}},_0x192f24={};_0x192f24['model']=_[_0xca6d('0x2e')](db[_0xca6d('0x28')][_0xca6d('0x29')]);_0x192f24[_0xca6d('0x2d')]=_[_0xca6d('0x2e')](_0x1c888c[_0xca6d('0x2d')]);_0x192f24[_0xca6d('0x2f')]=_[_0xca6d('0x30')](_0x192f24[_0xca6d('0x2c')],_0x192f24['query']);_0x5eddf3[_0xca6d('0x31')]=_['intersection'](_0x192f24[_0xca6d('0x2c')],qs[_0xca6d('0x32')](_0x1c888c['query'][_0xca6d('0x32')]));_0x5eddf3[_0xca6d('0x31')]=_0x5eddf3['attributes'][_0xca6d('0x41')]?_0x5eddf3[_0xca6d('0x31')]:_0x192f24[_0xca6d('0x2c')];if(_0x1c888c[_0xca6d('0x2d')][_0xca6d('0x3c')]){_0x5eddf3['include']=[{'all':!![]}];}_0x5eddf3=_['merge']({},_0x5eddf3,_0x1c888c[_0xca6d('0x42')]);return db[_0xca6d('0x28')][_0xca6d('0x43')](_0x5eddf3)['then'](handleEntityNotFound(_0x23eb75,null))[_0xca6d('0x21')](respondWithResult(_0x23eb75,null))['catch'](handleError(_0x23eb75,null));};exports['create']=function(_0x4eba59,_0x41e0d9){return db[_0xca6d('0x28')]['create'](_0x4eba59[_0xca6d('0x44')],{})['then'](respondWithResult(_0x41e0d9,0xc9))['catch'](handleError(_0x41e0d9,null));};exports[_0xca6d('0x20')]=function(_0x2df1eb,_0x34cf4b){if(_0x2df1eb[_0xca6d('0x44')]['id']){delete _0x2df1eb[_0xca6d('0x44')]['id'];}return db[_0xca6d('0x28')]['find']({'where':{'id':_0x2df1eb[_0xca6d('0x40')]['id']}})['then'](handleEntityNotFound(_0x34cf4b,null))[_0xca6d('0x21')](saveUpdates(_0x2df1eb[_0xca6d('0x44')],null))[_0xca6d('0x21')](respondWithResult(_0x34cf4b,null))[_0xca6d('0x45')](handleError(_0x34cf4b,null));};exports['destroy']=function(_0x4656a5,_0xc4658){return db['AnalyticTreeReport'][_0xca6d('0x43')]({'where':{'id':_0x4656a5[_0xca6d('0x40')]['id']}})[_0xca6d('0x21')](handleEntityNotFound(_0xc4658,null))[_0xca6d('0x21')](removeEntity(_0xc4658,null))[_0xca6d('0x45')](handleError(_0xc4658,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 30ad489..59601ba 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 _0xec9d=['../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x194f13,_0x39e6b3){var _0x31efc4=function(_0x29b124){while(--_0x29b124){_0x194f13['push'](_0x194f13['shift']());}};_0x31efc4(++_0x39e6b3);}(_0xec9d,0x155));var _0xdec9=function(_0x14e6de,_0x293358){_0x14e6de=_0x14e6de-0x0;var _0xc157fc=_0xec9d[_0x14e6de];return _0xc157fc;};'use strict';var _=require(_0xdec9('0x0'));var util=require(_0xdec9('0x1'));var logger=require(_0xdec9('0x2'))(_0xdec9('0x3'));var moment=require(_0xdec9('0x4'));var BPromise=require(_0xdec9('0x5'));var rp=require(_0xdec9('0x6'));var fs=require('fs');var path=require(_0xdec9('0x7'));var rimraf=require(_0xdec9('0x8'));var config=require(_0xdec9('0x9'));var attributes=require(_0xdec9('0xa'));module[_0xdec9('0xb')]=function(_0x168578,_0xf0577e){return _0x168578['define'](_0xdec9('0xc'),attributes,{'tableName':_0xdec9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb586=['define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x42cca6,_0x5b96e0){var _0x1c4d12=function(_0xf0f7ba){while(--_0xf0f7ba){_0x42cca6['push'](_0x42cca6['shift']());}};_0x1c4d12(++_0x5b96e0);}(_0xb586,0x8a));var _0x6b58=function(_0x5bf420,_0x2d068d){_0x5bf420=_0x5bf420-0x0;var _0x1c5255=_0xb586[_0x5bf420];return _0x1c5255;};'use strict';var _=require(_0x6b58('0x0'));var util=require(_0x6b58('0x1'));var logger=require(_0x6b58('0x2'))(_0x6b58('0x3'));var moment=require(_0x6b58('0x4'));var BPromise=require(_0x6b58('0x5'));var rp=require(_0x6b58('0x6'));var fs=require('fs');var path=require(_0x6b58('0x7'));var rimraf=require(_0x6b58('0x8'));var config=require(_0x6b58('0x9'));var attributes=require(_0x6b58('0xa'));module[_0x6b58('0xb')]=function(_0x5adeec,_0x2f2a0b){return _0x5adeec[_0x6b58('0xc')](_0x6b58('0xd'),attributes,{'tableName':_0x6b58('0xe'),'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 3d5f967..ec9d8b5 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x535cd9,_0x331c5d){var _0x21dde4=function(_0x4132f7){while(--_0x4132f7){_0x535cd9['push'](_0x535cd9['shift']());}};_0x21dde4(++_0x331c5d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xc4aa[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x22b47c,_0x5568b5){var _0x29d752=function(_0x443a64){while(--_0x443a64){_0x22b47c['push'](_0x22b47c['shift']());}};_0x29d752(++_0x5568b5);}(_0xdb28,0x106));var _0x8db2=function(_0x4be889,_0x191f81){_0x4be889=_0x4be889-0x0;var _0x3d7067=_0xdb28[_0x4be889];return _0x3d7067;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index e35044c..09ee15a 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 _0xa1f1=['Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','path','connect-timeout','express'];(function(_0x4733d3,_0x454290){var _0x1b9a44=function(_0x1a93bb){while(--_0x1a93bb){_0x4733d3['push'](_0x4733d3['shift']());}};_0x1b9a44(++_0x454290);}(_0xa1f1,0x18b));var _0x1a1f=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0xa1f1[_0x19159a];return _0xa677f4;};'use strict';var multer=require(_0x1a1f('0x0'));var util=require('util');var path=require(_0x1a1f('0x1'));var timeout=require(_0x1a1f('0x2'));var express=require(_0x1a1f('0x3'));var router=express[_0x1a1f('0x4')]();var fs_extra=require(_0x1a1f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1a1f('0x6'));var config=require(_0x1a1f('0x7'));var controller=require(_0x1a1f('0x8'));router[_0x1a1f('0x9')]('/',auth[_0x1a1f('0xa')](),controller[_0x1a1f('0xb')]);router[_0x1a1f('0x9')](_0x1a1f('0xc'),auth[_0x1a1f('0xa')](),controller[_0x1a1f('0xd')]);router[_0x1a1f('0xe')]('/',auth[_0x1a1f('0xa')](),controller[_0x1a1f('0xf')]);router[_0x1a1f('0x10')](_0x1a1f('0xc'),auth[_0x1a1f('0xa')](),controller[_0x1a1f('0x11')]);router[_0x1a1f('0x12')]('/:id',auth[_0x1a1f('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xba99=['update','delete','/:id','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x57a51c,_0x55bcea){var _0x573a22=function(_0x17e475){while(--_0x17e475){_0x57a51c['push'](_0x57a51c['shift']());}};_0x573a22(++_0x55bcea);}(_0xba99,0x1cf));var _0x9ba9=function(_0x23a477,_0x36bd86){_0x23a477=_0x23a477-0x0;var _0x1a6fb2=_0xba99[_0x23a477];return _0x1a6fb2;};'use strict';var multer=require(_0x9ba9('0x0'));var util=require('util');var path=require(_0x9ba9('0x1'));var timeout=require(_0x9ba9('0x2'));var express=require(_0x9ba9('0x3'));var router=express[_0x9ba9('0x4')]();var fs_extra=require(_0x9ba9('0x5'));var auth=require(_0x9ba9('0x6'));var interaction=require(_0x9ba9('0x7'));var config=require(_0x9ba9('0x8'));var controller=require(_0x9ba9('0x9'));router[_0x9ba9('0xa')]('/',auth[_0x9ba9('0xb')](),controller[_0x9ba9('0xc')]);router[_0x9ba9('0xa')]('/:id',auth[_0x9ba9('0xb')](),controller[_0x9ba9('0xd')]);router[_0x9ba9('0xe')]('/',auth[_0x9ba9('0xb')](),controller[_0x9ba9('0xf')]);router[_0x9ba9('0x10')]('/:id',auth[_0x9ba9('0xb')](),controller[_0x9ba9('0x11')]);router[_0x9ba9('0x12')](_0x9ba9('0x13'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 126aa7d..b696283 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 _0x14ee=['STRING','sequelize'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x14ee,0x115));var _0xe14e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14ee[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe14e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xe14e('0x1')]},'type':{'type':Sequelize[_0xe14e('0x1')]}};
\ No newline at end of file
+var _0x86dd=['exports','STRING'];(function(_0x168900,_0x3a06f2){var _0x3f3845=function(_0x33164b){while(--_0x33164b){_0x168900['push'](_0x168900['shift']());}};_0x3f3845(++_0x3a06f2);}(_0x86dd,0x1ee));var _0xd86d=function(_0x11a0b1,_0x12a2f9){_0x11a0b1=_0x11a0b1-0x0;var _0x5ac291=_0x86dd[_0x11a0b1];return _0x5ac291;};'use strict';var Sequelize=require('sequelize');module[_0xd86d('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xd86d('0x1')]},'type':{'type':Sequelize[_0xd86d('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 585f6e7..a0ae660 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 _0xd8da=['ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','Attachment','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','clone','length','find','get','omit','createdAt','updatedAt','body','create','file','basename','filename','mimetype','download','root','server/files/attachments/','offline-chat/','join','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x24b8f7,_0x583957){var _0x7776c0=function(_0x12478e){while(--_0x12478e){_0x24b8f7['push'](_0x24b8f7['shift']());}};_0x7776c0(++_0x583957);}(_0xd8da,0xac));var _0xad8d=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xd8da[_0xd1d19a];return _0x52a79d;};'use strict';var emlformat=require(_0xad8d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xad8d('0x1'));var jsonpatch=require(_0xad8d('0x2'));var rp=require(_0xad8d('0x3'));var moment=require(_0xad8d('0x4'));var BPromise=require(_0xad8d('0x5'));var Mustache=require(_0xad8d('0x6'));var util=require(_0xad8d('0x7'));var path=require(_0xad8d('0x8'));var sox=require('sox');var csv=require(_0xad8d('0x9'));var ejs=require(_0xad8d('0xa'));var fs=require('fs');var fs_extra=require(_0xad8d('0xb'));var _=require('lodash');var squel=require(_0xad8d('0xc'));var crypto=require(_0xad8d('0xd'));var jsforce=require(_0xad8d('0xe'));var deskjs=require(_0xad8d('0xf'));var toCsv=require('to-csv');var querystring=require(_0xad8d('0x10'));var Papa=require(_0xad8d('0x11'));var Redis=require(_0xad8d('0x12'));var authService=require(_0xad8d('0x13'));var qs=require(_0xad8d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xad8d('0x15'));var logger=require(_0xad8d('0x16'))(_0xad8d('0x17'));var utils=require(_0xad8d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xad8d('0x19'));var db=require(_0xad8d('0x1a'))['db'];function respondWithStatusCode(_0x3f1248,_0x5cd1d1){_0x5cd1d1=_0x5cd1d1||0xcc;return function(_0x445a76){if(_0x445a76){return _0x3f1248[_0xad8d('0x1b')](_0x5cd1d1);}return _0x3f1248['status'](_0x5cd1d1)[_0xad8d('0x1c')]();};}function respondWithResult(_0x2dcfa8,_0xe8854){_0xe8854=_0xe8854||0xc8;return function(_0x1d1a2d){if(_0x1d1a2d){return _0x2dcfa8[_0xad8d('0x1d')](_0xe8854)[_0xad8d('0x1e')](_0x1d1a2d);}};}function respondWithFilteredResult(_0x177201,_0x32f4c2){return function(_0x39a88f){if(_0x39a88f){var _0x88c62e=typeof _0x32f4c2[_0xad8d('0x1f')]===_0xad8d('0x20')&&typeof _0x32f4c2[_0xad8d('0x21')]===_0xad8d('0x20');var _0x3581fa=_0x39a88f[_0xad8d('0x22')];var _0x34ea56=_0x88c62e?0x0:_0x32f4c2[_0xad8d('0x1f')];var _0x326c77=_0x88c62e?_0x39a88f[_0xad8d('0x22')]:_0x32f4c2[_0xad8d('0x1f')]+_0x32f4c2[_0xad8d('0x21')];var _0x2e52e8;if(_0x326c77>=_0x3581fa){_0x326c77=_0x3581fa;_0x2e52e8=0xc8;}else{_0x2e52e8=0xce;}_0x177201[_0xad8d('0x1d')](_0x2e52e8);return _0x177201[_0xad8d('0x23')](_0xad8d('0x24'),_0x34ea56+'-'+_0x326c77+'/'+_0x3581fa)[_0xad8d('0x1e')](_0x39a88f);}return null;};}function patchUpdates(_0x2af45d){return function(_0x440a70){try{jsonpatch[_0xad8d('0x25')](_0x440a70,_0x2af45d,!![]);}catch(_0x3a4b3c){return BPromise[_0xad8d('0x26')](_0x3a4b3c);}return _0x440a70[_0xad8d('0x27')]();};}function saveUpdates(_0x2dd141,_0x4ca29c){return function(_0x1bbffe){if(_0x1bbffe){return _0x1bbffe['update'](_0x2dd141)[_0xad8d('0x28')](function(_0xb8ef70){return _0xb8ef70;});}return null;};}function removeEntity(_0x30a635,_0x545a93){return function(_0x54679d){if(_0x54679d){return _0x54679d[_0xad8d('0x29')]()['then'](function(){_0x30a635[_0xad8d('0x1d')](0xcc)[_0xad8d('0x1c')]();});}};}function handleEntityNotFound(_0x5cd9e6,_0x1a8d77){return function(_0x5a6bdc){if(!_0x5a6bdc){_0x5cd9e6[_0xad8d('0x1b')](0x194);}return _0x5a6bdc;};}function handleError(_0x214456,_0x5445dd){_0x5445dd=_0x5445dd||0x1f4;return function(_0x2db65d){logger[_0xad8d('0x2a')](_0x2db65d['stack']);if(_0x2db65d[_0xad8d('0x2b')]){delete _0x2db65d[_0xad8d('0x2b')];}_0x214456[_0xad8d('0x1d')](_0x5445dd)[_0xad8d('0x2c')](_0x2db65d);};}exports[_0xad8d('0x2d')]=function(_0x481f69,_0x53ebf2){var _0x5ea3e9={},_0x2af1d8={},_0x52ac3e={'count':0x0,'rows':[]};var _0x343c87=_[_0xad8d('0x2e')](db[_0xad8d('0x2f')][_0xad8d('0x30')],function(_0x44e871){return{'name':_0x44e871['fieldName'],'type':_0x44e871['type']['key']};});_0x2af1d8[_0xad8d('0x31')]=_['map'](_0x343c87,_0xad8d('0x2b'));_0x2af1d8['query']=_[_0xad8d('0x32')](_0x481f69[_0xad8d('0x33')]);_0x2af1d8[_0xad8d('0x34')]=_[_0xad8d('0x35')](_0x2af1d8[_0xad8d('0x31')],_0x2af1d8[_0xad8d('0x33')]);_0x5ea3e9[_0xad8d('0x36')]=_[_0xad8d('0x35')](_0x2af1d8['model'],qs[_0xad8d('0x37')](_0x481f69[_0xad8d('0x33')][_0xad8d('0x37')]));_0x5ea3e9[_0xad8d('0x36')]=_0x5ea3e9[_0xad8d('0x36')]['length']?_0x5ea3e9[_0xad8d('0x36')]:_0x2af1d8[_0xad8d('0x31')];if(!_0x481f69[_0xad8d('0x33')][_0xad8d('0x38')](_0xad8d('0x39'))){_0x5ea3e9[_0xad8d('0x21')]=qs['limit'](_0x481f69['query'][_0xad8d('0x21')]);_0x5ea3e9[_0xad8d('0x1f')]=qs[_0xad8d('0x1f')](_0x481f69[_0xad8d('0x33')][_0xad8d('0x1f')]);}_0x5ea3e9[_0xad8d('0x3a')]=qs[_0xad8d('0x3b')](_0x481f69[_0xad8d('0x33')][_0xad8d('0x3b')]);_0x5ea3e9[_0xad8d('0x3c')]=qs['filters'](_[_0xad8d('0x3d')](_0x481f69[_0xad8d('0x33')],_0x2af1d8[_0xad8d('0x34')]),_0x343c87);if(_0x481f69[_0xad8d('0x33')][_0xad8d('0x3e')]){_0x5ea3e9[_0xad8d('0x3c')]=_[_0xad8d('0x3f')](_0x5ea3e9[_0xad8d('0x3c')],{'$or':_[_0xad8d('0x2e')](_0x343c87,function(_0x35f2c6){if(_0x35f2c6[_0xad8d('0x40')]!=='VIRTUAL'){var _0x36b6c3={};_0x36b6c3[_0x35f2c6[_0xad8d('0x2b')]]={'$like':'%'+_0x481f69[_0xad8d('0x33')][_0xad8d('0x3e')]+'%'};return _0x36b6c3;}})});}_0x5ea3e9=_[_0xad8d('0x3f')]({},_0x5ea3e9,_0x481f69[_0xad8d('0x41')]);var _0x43d0ee={'where':_0x5ea3e9[_0xad8d('0x3c')]};return db[_0xad8d('0x2f')][_0xad8d('0x22')](_0x43d0ee)['then'](function(_0x46c79c){_0x52ac3e[_0xad8d('0x22')]=_0x46c79c;if(_0x481f69[_0xad8d('0x33')][_0xad8d('0x42')]){_0x5ea3e9[_0xad8d('0x43')]=[{'all':!![]}];}return db['Attachment'][_0xad8d('0x44')](_0x5ea3e9);})[_0xad8d('0x28')](function(_0xa8016c){_0x52ac3e[_0xad8d('0x45')]=_0xa8016c;return _0x52ac3e;})[_0xad8d('0x28')](respondWithFilteredResult(_0x53ebf2,_0x5ea3e9))[_0xad8d('0x46')](handleError(_0x53ebf2,null));};exports[_0xad8d('0x47')]=function(_0x1f805f,_0x40e7a2){var _0x41a33c={'raw':!![],'where':{'id':_0x1f805f[_0xad8d('0x48')]['id']}},_0x4d69f3={};_0x4d69f3[_0xad8d('0x31')]=_[_0xad8d('0x32')](db[_0xad8d('0x2f')]['rawAttributes']);_0x4d69f3['query']=_['keys'](_0x1f805f[_0xad8d('0x33')]);_0x4d69f3[_0xad8d('0x34')]=_[_0xad8d('0x35')](_0x4d69f3[_0xad8d('0x31')],_0x4d69f3[_0xad8d('0x33')]);_0x41a33c[_0xad8d('0x36')]=_['intersection'](_0x4d69f3['model'],qs[_0xad8d('0x37')](_0x1f805f[_0xad8d('0x33')][_0xad8d('0x37')]));_0x41a33c['attributes']=_0x41a33c['attributes']['length']?_0x41a33c[_0xad8d('0x36')]:_0x4d69f3[_0xad8d('0x31')];if(_0x1f805f[_0xad8d('0x33')][_0xad8d('0x42')]){_0x41a33c['include']=[{'all':!![]}];}_0x41a33c=_['merge']({},_0x41a33c,_0x1f805f[_0xad8d('0x41')]);return db[_0xad8d('0x2f')]['find'](_0x41a33c)[_0xad8d('0x28')](handleEntityNotFound(_0x40e7a2,null))[_0xad8d('0x28')](respondWithResult(_0x40e7a2,null))[_0xad8d('0x46')](handleError(_0x40e7a2,null));};exports[_0xad8d('0x49')]=function(_0x3d1280,_0x478d10){var _0x3f54f8={'where':{'id':_0x3d1280[_0xad8d('0x48')]['id']}},_0xf07e4b={};_0xf07e4b[_0xad8d('0x31')]=_[_0xad8d('0x32')](db[_0xad8d('0x2f')]['rawAttributes']);_0x3f54f8[_0xad8d('0x36')]=_[_0xad8d('0x35')](_0xf07e4b[_0xad8d('0x31')],qs[_0xad8d('0x37')](_0x3d1280[_0xad8d('0x33')]['fields']));_0x3f54f8[_0xad8d('0x36')]=_0x3f54f8['attributes'][_0xad8d('0x4a')]?_0x3f54f8[_0xad8d('0x36')]:_0xf07e4b['model'];if(_0x3d1280[_0xad8d('0x33')]['includeAll']){_0x3f54f8[_0xad8d('0x43')]=[{'all':!![]}];}_0x3f54f8=_[_0xad8d('0x3f')]({},_0x3f54f8,_0x3d1280[_0xad8d('0x41')]);return db[_0xad8d('0x2f')][_0xad8d('0x4b')](_0x3f54f8)[_0xad8d('0x28')](handleEntityNotFound(_0x478d10,null))['then'](function(_0xbcdf6b){if(_0xbcdf6b){var _0x1c07fe=_0xbcdf6b[_0xad8d('0x4c')]({'plain':!![]});_0x1c07fe=qs[_0xad8d('0x4d')](_0x1c07fe,['id',_0xad8d('0x4e'),_0xad8d('0x4f')]);_0x3d1280[_0xad8d('0x50')]=_['omit'](_0x3d1280[_0xad8d('0x50')],['id',_0xad8d('0x4e'),_0xad8d('0x4f')]);return db[_0xad8d('0x2f')][_0xad8d('0x51')](_[_0xad8d('0x3f')](_0x1c07fe,_0x3d1280['body']),{'include':_0x3d1280[_0xad8d('0x33')][_0xad8d('0x42')]?[{'all':!![]}]:undefined});}})[_0xad8d('0x28')](respondWithResult(_0x478d10,0xc9))[_0xad8d('0x46')](handleError(_0x478d10,null));};exports['update']=function(_0x3919ea,_0x511f6d){if(_0x3919ea[_0xad8d('0x50')]['id']){delete _0x3919ea[_0xad8d('0x50')]['id'];}return db['Attachment'][_0xad8d('0x4b')]({'where':{'id':_0x3919ea[_0xad8d('0x48')]['id']}})['then'](handleEntityNotFound(_0x511f6d,null))['then'](saveUpdates(_0x3919ea[_0xad8d('0x50')],null))['then'](respondWithResult(_0x511f6d,null))[_0xad8d('0x46')](handleError(_0x511f6d,null));};exports[_0xad8d('0x29')]=function(_0x1b6d17,_0x40548f){return db['Attachment'][_0xad8d('0x4b')]({'where':{'id':_0x1b6d17[_0xad8d('0x48')]['id']}})[_0xad8d('0x28')](handleEntityNotFound(_0x40548f,null))[_0xad8d('0x28')](removeEntity(_0x40548f,null))['catch'](handleError(_0x40548f,null));};exports[_0xad8d('0x51')]=function(_0x541aa5,_0x3e9a73,_0x59c428){_0x541aa5[_0xad8d('0x50')]['name']=_0x541aa5[_0xad8d('0x52')]['originalname'];_0x541aa5[_0xad8d('0x50')][_0xad8d('0x53')]=_0x541aa5[_0xad8d('0x52')][_0xad8d('0x54')];_0x541aa5[_0xad8d('0x50')][_0xad8d('0x40')]=_0x541aa5['file'][_0xad8d('0x55')];return db['Attachment'][_0xad8d('0x51')](_0x541aa5[_0xad8d('0x50')])[_0xad8d('0x28')](respondWithResult(_0x3e9a73,0xc9))[_0xad8d('0x46')](handleError(_0x3e9a73,null));};exports[_0xad8d('0x56')]=function(_0x2d2877,_0x5c5918,_0x4ac956){return db[_0xad8d('0x2f')]['findOne']({'where':{'id':_0x2d2877[_0xad8d('0x48')]['id']},'raw':!![]})[_0xad8d('0x28')](handleEntityNotFound(_0x5c5918,null))[_0xad8d('0x28')](function(_0x351297){if(_0x351297){var _0x516389=_0x351297['ChatOfflineMessageId']!==null;var _0xc817e0=path['join'](config[_0xad8d('0x57')],_0xad8d('0x58'));if(_0x516389){_0xc817e0=path['join'](_0xc817e0,_0xad8d('0x59'));}var _0x6e777b=path[_0xad8d('0x5a')](_0xc817e0,_0x351297[_0xad8d('0x53')]);return _0x5c5918['download'](_0x6e777b);}})[_0xad8d('0x46')](handleError(_0x5c5918,null));};
\ No newline at end of file
+var _0x2f54=['end','json','offset','undefined','limit','count','set','apply','save','then','destroy','stack','send','index','rawAttributes','fieldName','type','key','model','map','name','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','Attachment','findAll','catch','show','params','keys','length','includeAll','include','merge','options','find','clone','get','omit','updatedAt','body','createdAt','create','update','file','originalname','basename','filename','mimetype','findOne','root','server/files/attachments/','join','download','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x2f54,0x197));var _0x42f5=function(_0x5ee748,_0x552a2b){_0x5ee748=_0x5ee748-0x0;var _0x36da37=_0x2f54[_0x5ee748];return _0x36da37;};'use strict';var emlformat=require(_0x42f5('0x0'));var rimraf=require(_0x42f5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x42f5('0x2'));var moment=require('moment');var BPromise=require(_0x42f5('0x3'));var Mustache=require(_0x42f5('0x4'));var util=require(_0x42f5('0x5'));var path=require(_0x42f5('0x6'));var sox=require(_0x42f5('0x7'));var csv=require(_0x42f5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x42f5('0x9'));var squel=require(_0x42f5('0xa'));var crypto=require(_0x42f5('0xb'));var jsforce=require(_0x42f5('0xc'));var deskjs=require(_0x42f5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x42f5('0xe'));var Papa=require(_0x42f5('0xf'));var Redis=require(_0x42f5('0x10'));var authService=require(_0x42f5('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x42f5('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x42f5('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x42f5('0x14'))['db'];function respondWithStatusCode(_0x1ffb2c,_0x18158b){_0x18158b=_0x18158b||0xcc;return function(_0x2fda62){if(_0x2fda62){return _0x1ffb2c[_0x42f5('0x15')](_0x18158b);}return _0x1ffb2c[_0x42f5('0x16')](_0x18158b)[_0x42f5('0x17')]();};}function respondWithResult(_0x4f9d0e,_0x5b0fac){_0x5b0fac=_0x5b0fac||0xc8;return function(_0x2a3976){if(_0x2a3976){return _0x4f9d0e[_0x42f5('0x16')](_0x5b0fac)[_0x42f5('0x18')](_0x2a3976);}};}function respondWithFilteredResult(_0x12e4c5,_0x53f794){return function(_0x20a442){if(_0x20a442){var _0x3b7d36=typeof _0x53f794[_0x42f5('0x19')]===_0x42f5('0x1a')&&typeof _0x53f794[_0x42f5('0x1b')]===_0x42f5('0x1a');var _0x38a237=_0x20a442[_0x42f5('0x1c')];var _0x30d2c7=_0x3b7d36?0x0:_0x53f794[_0x42f5('0x19')];var _0xef75f8=_0x3b7d36?_0x20a442[_0x42f5('0x1c')]:_0x53f794[_0x42f5('0x19')]+_0x53f794[_0x42f5('0x1b')];var _0x1b8c12;if(_0xef75f8>=_0x38a237){_0xef75f8=_0x38a237;_0x1b8c12=0xc8;}else{_0x1b8c12=0xce;}_0x12e4c5[_0x42f5('0x16')](_0x1b8c12);return _0x12e4c5[_0x42f5('0x1d')]('Content-Range',_0x30d2c7+'-'+_0xef75f8+'/'+_0x38a237)['json'](_0x20a442);}return null;};}function patchUpdates(_0x245701){return function(_0xede24e){try{jsonpatch[_0x42f5('0x1e')](_0xede24e,_0x245701,!![]);}catch(_0x445130){return BPromise['reject'](_0x445130);}return _0xede24e[_0x42f5('0x1f')]();};}function saveUpdates(_0x433c00,_0x497363){return function(_0x42f6e4){if(_0x42f6e4){return _0x42f6e4['update'](_0x433c00)[_0x42f5('0x20')](function(_0x1f3ece){return _0x1f3ece;});}return null;};}function removeEntity(_0x4e275d,_0x38ff24){return function(_0x5ac26b){if(_0x5ac26b){return _0x5ac26b[_0x42f5('0x21')]()[_0x42f5('0x20')](function(){_0x4e275d[_0x42f5('0x16')](0xcc)[_0x42f5('0x17')]();});}};}function handleEntityNotFound(_0x50d577,_0x1b9387){return function(_0xf5d7e0){if(!_0xf5d7e0){_0x50d577[_0x42f5('0x15')](0x194);}return _0xf5d7e0;};}function handleError(_0x1cd2f0,_0x32ef05){_0x32ef05=_0x32ef05||0x1f4;return function(_0x4e43b0){logger['error'](_0x4e43b0[_0x42f5('0x22')]);if(_0x4e43b0['name']){delete _0x4e43b0['name'];}_0x1cd2f0[_0x42f5('0x16')](_0x32ef05)[_0x42f5('0x23')](_0x4e43b0);};}exports[_0x42f5('0x24')]=function(_0x45b504,_0x2c4d50){var _0x220d51={},_0x2920b1={},_0x5a7c2a={'count':0x0,'rows':[]};var _0x35c57c=_['map'](db['Attachment'][_0x42f5('0x25')],function(_0xc7d89){return{'name':_0xc7d89[_0x42f5('0x26')],'type':_0xc7d89[_0x42f5('0x27')][_0x42f5('0x28')]};});_0x2920b1[_0x42f5('0x29')]=_[_0x42f5('0x2a')](_0x35c57c,_0x42f5('0x2b'));_0x2920b1['query']=_['keys'](_0x45b504[_0x42f5('0x2c')]);_0x2920b1['filters']=_['intersection'](_0x2920b1['model'],_0x2920b1[_0x42f5('0x2c')]);_0x220d51[_0x42f5('0x2d')]=_[_0x42f5('0x2e')](_0x2920b1['model'],qs[_0x42f5('0x2f')](_0x45b504[_0x42f5('0x2c')][_0x42f5('0x2f')]));_0x220d51[_0x42f5('0x2d')]=_0x220d51['attributes']['length']?_0x220d51[_0x42f5('0x2d')]:_0x2920b1['model'];if(!_0x45b504[_0x42f5('0x2c')][_0x42f5('0x30')](_0x42f5('0x31'))){_0x220d51[_0x42f5('0x1b')]=qs[_0x42f5('0x1b')](_0x45b504['query']['limit']);_0x220d51['offset']=qs['offset'](_0x45b504['query']['offset']);}_0x220d51[_0x42f5('0x32')]=qs[_0x42f5('0x33')](_0x45b504[_0x42f5('0x2c')][_0x42f5('0x33')]);_0x220d51[_0x42f5('0x34')]=qs[_0x42f5('0x35')](_['pick'](_0x45b504[_0x42f5('0x2c')],_0x2920b1[_0x42f5('0x35')]),_0x35c57c);if(_0x45b504[_0x42f5('0x2c')][_0x42f5('0x36')]){_0x220d51[_0x42f5('0x34')]=_['merge'](_0x220d51['where'],{'$or':_[_0x42f5('0x2a')](_0x35c57c,function(_0xbcd444){if(_0xbcd444['type']!==_0x42f5('0x37')){var _0x3335a1={};_0x3335a1[_0xbcd444[_0x42f5('0x2b')]]={'$like':'%'+_0x45b504[_0x42f5('0x2c')][_0x42f5('0x36')]+'%'};return _0x3335a1;}})});}_0x220d51=_['merge']({},_0x220d51,_0x45b504['options']);var _0x22fff2={'where':_0x220d51[_0x42f5('0x34')]};return db[_0x42f5('0x38')][_0x42f5('0x1c')](_0x22fff2)[_0x42f5('0x20')](function(_0x42218e){_0x5a7c2a[_0x42f5('0x1c')]=_0x42218e;if(_0x45b504[_0x42f5('0x2c')]['includeAll']){_0x220d51['include']=[{'all':!![]}];}return db['Attachment'][_0x42f5('0x39')](_0x220d51);})[_0x42f5('0x20')](function(_0x2c9bb3){_0x5a7c2a['rows']=_0x2c9bb3;return _0x5a7c2a;})[_0x42f5('0x20')](respondWithFilteredResult(_0x2c4d50,_0x220d51))[_0x42f5('0x3a')](handleError(_0x2c4d50,null));};exports[_0x42f5('0x3b')]=function(_0x4d9ddb,_0x4a9c2d){var _0x4e7381={'raw':!![],'where':{'id':_0x4d9ddb[_0x42f5('0x3c')]['id']}},_0xba5293={};_0xba5293[_0x42f5('0x29')]=_['keys'](db[_0x42f5('0x38')][_0x42f5('0x25')]);_0xba5293[_0x42f5('0x2c')]=_[_0x42f5('0x3d')](_0x4d9ddb[_0x42f5('0x2c')]);_0xba5293[_0x42f5('0x35')]=_['intersection'](_0xba5293[_0x42f5('0x29')],_0xba5293[_0x42f5('0x2c')]);_0x4e7381[_0x42f5('0x2d')]=_[_0x42f5('0x2e')](_0xba5293[_0x42f5('0x29')],qs[_0x42f5('0x2f')](_0x4d9ddb[_0x42f5('0x2c')][_0x42f5('0x2f')]));_0x4e7381['attributes']=_0x4e7381[_0x42f5('0x2d')][_0x42f5('0x3e')]?_0x4e7381[_0x42f5('0x2d')]:_0xba5293[_0x42f5('0x29')];if(_0x4d9ddb[_0x42f5('0x2c')][_0x42f5('0x3f')]){_0x4e7381[_0x42f5('0x40')]=[{'all':!![]}];}_0x4e7381=_[_0x42f5('0x41')]({},_0x4e7381,_0x4d9ddb[_0x42f5('0x42')]);return db[_0x42f5('0x38')][_0x42f5('0x43')](_0x4e7381)['then'](handleEntityNotFound(_0x4a9c2d,null))[_0x42f5('0x20')](respondWithResult(_0x4a9c2d,null))[_0x42f5('0x3a')](handleError(_0x4a9c2d,null));};exports[_0x42f5('0x44')]=function(_0x48625f,_0x18c8b4){var _0x1370ee={'where':{'id':_0x48625f[_0x42f5('0x3c')]['id']}},_0x36b62b={};_0x36b62b[_0x42f5('0x29')]=_['keys'](db[_0x42f5('0x38')]['rawAttributes']);_0x1370ee['attributes']=_[_0x42f5('0x2e')](_0x36b62b[_0x42f5('0x29')],qs[_0x42f5('0x2f')](_0x48625f[_0x42f5('0x2c')][_0x42f5('0x2f')]));_0x1370ee[_0x42f5('0x2d')]=_0x1370ee[_0x42f5('0x2d')][_0x42f5('0x3e')]?_0x1370ee[_0x42f5('0x2d')]:_0x36b62b[_0x42f5('0x29')];if(_0x48625f[_0x42f5('0x2c')][_0x42f5('0x3f')]){_0x1370ee['include']=[{'all':!![]}];}_0x1370ee=_[_0x42f5('0x41')]({},_0x1370ee,_0x48625f[_0x42f5('0x42')]);return db[_0x42f5('0x38')][_0x42f5('0x43')](_0x1370ee)[_0x42f5('0x20')](handleEntityNotFound(_0x18c8b4,null))['then'](function(_0x4c56d1){if(_0x4c56d1){var _0x2c8977=_0x4c56d1[_0x42f5('0x45')]({'plain':!![]});_0x2c8977=qs[_0x42f5('0x46')](_0x2c8977,['id','createdAt',_0x42f5('0x47')]);_0x48625f[_0x42f5('0x48')]=_[_0x42f5('0x46')](_0x48625f[_0x42f5('0x48')],['id',_0x42f5('0x49'),'updatedAt']);return db['Attachment'][_0x42f5('0x4a')](_[_0x42f5('0x41')](_0x2c8977,_0x48625f[_0x42f5('0x48')]),{'include':_0x48625f[_0x42f5('0x2c')][_0x42f5('0x3f')]?[{'all':!![]}]:undefined});}})[_0x42f5('0x20')](respondWithResult(_0x18c8b4,0xc9))[_0x42f5('0x3a')](handleError(_0x18c8b4,null));};exports[_0x42f5('0x4b')]=function(_0x42cb32,_0x44960d){if(_0x42cb32[_0x42f5('0x48')]['id']){delete _0x42cb32['body']['id'];}return db[_0x42f5('0x38')]['find']({'where':{'id':_0x42cb32[_0x42f5('0x3c')]['id']}})[_0x42f5('0x20')](handleEntityNotFound(_0x44960d,null))[_0x42f5('0x20')](saveUpdates(_0x42cb32['body'],null))[_0x42f5('0x20')](respondWithResult(_0x44960d,null))[_0x42f5('0x3a')](handleError(_0x44960d,null));};exports[_0x42f5('0x21')]=function(_0x3402aa,_0x3184c3){return db[_0x42f5('0x38')][_0x42f5('0x43')]({'where':{'id':_0x3402aa[_0x42f5('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3184c3,null))[_0x42f5('0x20')](removeEntity(_0x3184c3,null))['catch'](handleError(_0x3184c3,null));};exports['create']=function(_0x40f64a,_0x151573,_0x16d94e){_0x40f64a[_0x42f5('0x48')]['name']=_0x40f64a[_0x42f5('0x4c')][_0x42f5('0x4d')];_0x40f64a[_0x42f5('0x48')][_0x42f5('0x4e')]=_0x40f64a[_0x42f5('0x4c')][_0x42f5('0x4f')];_0x40f64a[_0x42f5('0x48')][_0x42f5('0x27')]=_0x40f64a[_0x42f5('0x4c')][_0x42f5('0x50')];return db[_0x42f5('0x38')][_0x42f5('0x4a')](_0x40f64a[_0x42f5('0x48')])[_0x42f5('0x20')](respondWithResult(_0x151573,0xc9))[_0x42f5('0x3a')](handleError(_0x151573,null));};exports['download']=function(_0x1c2ba5,_0x1ab3a5,_0x197ed6){return db['Attachment'][_0x42f5('0x51')]({'where':{'id':_0x1c2ba5[_0x42f5('0x3c')]['id']},'raw':!![]})[_0x42f5('0x20')](handleEntityNotFound(_0x1ab3a5,null))[_0x42f5('0x20')](function(_0x520f16){if(_0x520f16){var _0x381217=_0x520f16['ChatOfflineMessageId']!==null;var _0x533295=path['join'](config[_0x42f5('0x52')],_0x42f5('0x53'));if(_0x381217){_0x533295=path[_0x42f5('0x54')](_0x533295,'offline-chat/');}var _0x1a7731=path[_0x42f5('0x54')](_0x533295,_0x520f16[_0x42f5('0x4e')]);return _0x1ab3a5[_0x42f5('0x55')](_0x1a7731);}})[_0x42f5('0x3a')](handleError(_0x1ab3a5,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 4108a51..95bf8c7 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 _0x9bdc=['request-promise','./attachment.attributes','exports','define','attachments','lodash','util','../../config/logger','api','bluebird'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x9bdc,0x9b));var _0xc9bd=function(_0x582974,_0xb6918c){_0x582974=_0x582974-0x0;var _0x5a1914=_0x9bdc[_0x582974];return _0x5a1914;};'use strict';var _=require(_0xc9bd('0x0'));var util=require(_0xc9bd('0x1'));var logger=require(_0xc9bd('0x2'))(_0xc9bd('0x3'));var moment=require('moment');var BPromise=require(_0xc9bd('0x4'));var rp=require(_0xc9bd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc9bd('0x6'));module[_0xc9bd('0x7')]=function(_0x2d0335,_0x570a3d){return _0x2d0335[_0xc9bd('0x8')]('Attachment',attributes,{'tableName':_0xc9bd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb64=['util','moment','bluebird','request-promise','../../config/environment','./attachment.attributes','define','Attachment','lodash'];(function(_0x52f1a7,_0x4da82f){var _0x227c86=function(_0x1e8686){while(--_0x1e8686){_0x52f1a7['push'](_0x52f1a7['shift']());}};_0x227c86(++_0x4da82f);}(_0xbb64,0x1dc));var _0x4bb6=function(_0x27bc7b,_0xb3a76d){_0x27bc7b=_0x27bc7b-0x0;var _0x348d71=_0xbb64[_0x27bc7b];return _0x348d71;};'use strict';var _=require(_0x4bb6('0x0'));var util=require(_0x4bb6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4bb6('0x2'));var BPromise=require(_0x4bb6('0x3'));var rp=require(_0x4bb6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4bb6('0x5'));var attributes=require(_0x4bb6('0x6'));module['exports']=function(_0x59ac41,_0x5d59f1){return _0x59ac41[_0x4bb6('0x7')](_0x4bb6('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 5b40065..7564502 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 _0x8aa7=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','stringify','util','moment','bluebird','randomstring'];(function(_0x3c90df,_0x249ce5){var _0x15c7a6=function(_0x33c960){while(--_0x33c960){_0x3c90df['push'](_0x3c90df['shift']());}};_0x15c7a6(++_0x249ce5);}(_0x8aa7,0xb6));var _0x78aa=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x8aa7[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var util=require(_0x78aa('0x0'));var moment=require(_0x78aa('0x1'));var BPromise=require(_0x78aa('0x2'));var rs=require(_0x78aa('0x3'));var fs=require('fs');var Redis=require(_0x78aa('0x4'));var db=require(_0x78aa('0x5'))['db'];var utils=require(_0x78aa('0x6'));var logger=require('../../config/logger')(_0x78aa('0x7'));var config=require(_0x78aa('0x8'));var jayson=require(_0x78aa('0x9'));var client=jayson[_0x78aa('0xa')][_0x78aa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x369ee7,_0x462a9a,_0xa79008){return new BPromise(function(_0x2368ac,_0x460488){return client[_0x78aa('0xc')](_0x369ee7,_0xa79008)[_0x78aa('0xd')](function(_0x45d377){logger[_0x78aa('0xe')](_0x78aa('0xf'),_0x462a9a,_0x78aa('0x10'));logger[_0x78aa('0x11')](_0x78aa('0x12'),_0x462a9a,_0x78aa('0x10'),JSON['stringify'](_0x45d377));if(_0x45d377['error']){if(_0x45d377[_0x78aa('0x13')][_0x78aa('0x14')]===0x1f4){logger['error'](_0x78aa('0xf'),_0x462a9a,_0x45d377[_0x78aa('0x13')][_0x78aa('0x15')]);return _0x460488(_0x45d377[_0x78aa('0x13')][_0x78aa('0x15')]);}logger['error'](_0x78aa('0xf'),_0x462a9a,_0x45d377[_0x78aa('0x13')][_0x78aa('0x15')]);return _0x2368ac(_0x45d377[_0x78aa('0x13')][_0x78aa('0x15')]);}else{logger['info'](_0x78aa('0xf'),_0x462a9a,_0x78aa('0x10'));_0x2368ac(_0x45d377[_0x78aa('0x16')][_0x78aa('0x15')]);}})[_0x78aa('0x17')](function(_0x2897f8){logger['error']('Attachment,\x20%s,\x20%s',_0x462a9a,_0x2897f8);_0x460488(_0x2897f8);});});}exports[_0x78aa('0x18')]=function(_0x345e4d){var _0xc316d9=this;return new Promise(function(_0x4207b0,_0x9879bf){return db[_0x78aa('0x19')][_0x78aa('0x1a')](_0x345e4d[_0x78aa('0x1b')],{'raw':_0x345e4d[_0x78aa('0x1c')]?_0x345e4d[_0x78aa('0x1c')][_0x78aa('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x18c60d){logger[_0x78aa('0xe')]('CreateAttachment',_0x345e4d);logger[_0x78aa('0x11')](_0x78aa('0x18'),_0x345e4d,JSON[_0x78aa('0x1e')](_0x18c60d));_0x4207b0(_0x18c60d);})['catch'](function(_0x5a9dbf){logger[_0x78aa('0x13')](_0x78aa('0x18'),_0x5a9dbf['message'],_0x345e4d);_0x9879bf(_0xc316d9[_0x78aa('0x13')](0x1f4,_0x5a9dbf[_0x78aa('0x15')]));});});};
\ No newline at end of file
+var _0xe13e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateAttachment','Attachment','body','options','raw','moment','bluebird'];(function(_0x580ff5,_0xd4a51a){var _0x2ea54f=function(_0xa7771c){while(--_0xa7771c){_0x580ff5['push'](_0x580ff5['shift']());}};_0x2ea54f(++_0xd4a51a);}(_0xe13e,0xde));var _0xee13=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe13e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xee13('0x0'));var BPromise=require(_0xee13('0x1'));var rs=require(_0xee13('0x2'));var fs=require('fs');var Redis=require(_0xee13('0x3'));var db=require(_0xee13('0x4'))['db'];var utils=require(_0xee13('0x5'));var logger=require(_0xee13('0x6'))(_0xee13('0x7'));var config=require(_0xee13('0x8'));var jayson=require(_0xee13('0x9'));var client=jayson[_0xee13('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8f606d,_0x3ae6e2,_0xfdb836){return new BPromise(function(_0x64ee02,_0x4810bd){return client[_0xee13('0xb')](_0x8f606d,_0xfdb836)[_0xee13('0xc')](function(_0x1cc55b){logger[_0xee13('0xd')](_0xee13('0xe'),_0x3ae6e2,'request\x20sent');logger[_0xee13('0xf')](_0xee13('0x10'),_0x3ae6e2,'request\x20sent',JSON[_0xee13('0x11')](_0x1cc55b));if(_0x1cc55b['error']){if(_0x1cc55b['error']['code']===0x1f4){logger[_0xee13('0x12')]('Attachment,\x20%s,\x20%s',_0x3ae6e2,_0x1cc55b[_0xee13('0x12')][_0xee13('0x13')]);return _0x4810bd(_0x1cc55b[_0xee13('0x12')][_0xee13('0x13')]);}logger[_0xee13('0x12')](_0xee13('0xe'),_0x3ae6e2,_0x1cc55b[_0xee13('0x12')]['message']);return _0x64ee02(_0x1cc55b[_0xee13('0x12')][_0xee13('0x13')]);}else{logger[_0xee13('0xd')]('Attachment,\x20%s,\x20%s',_0x3ae6e2,_0xee13('0x14'));_0x64ee02(_0x1cc55b[_0xee13('0x15')]['message']);}})[_0xee13('0x16')](function(_0xcd1482){logger[_0xee13('0x12')](_0xee13('0xe'),_0x3ae6e2,_0xcd1482);_0x4810bd(_0xcd1482);});});}exports[_0xee13('0x17')]=function(_0x3a5819){var _0xd353d0=this;return new Promise(function(_0x33bd9c,_0x3806b0){return db[_0xee13('0x18')]['create'](_0x3a5819[_0xee13('0x19')],{'raw':_0x3a5819[_0xee13('0x1a')]?_0x3a5819['options'][_0xee13('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x17e664){logger['info'](_0xee13('0x17'),_0x3a5819);logger[_0xee13('0xf')]('CreateAttachment',_0x3a5819,JSON[_0xee13('0x11')](_0x17e664));_0x33bd9c(_0x17e664);})[_0xee13('0x16')](function(_0x3f9dfd){logger[_0xee13('0x12')](_0xee13('0x17'),_0x3f9dfd['message'],_0x3a5819);_0x3806b0(_0xd353d0[_0xee13('0x12')](0x1f4,_0x3f9dfd[_0xee13('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 66790de..cbc5888 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x605a77,_0x38ccfe){var _0x225ce7=function(_0x36672e){while(--_0x36672e){_0x605a77['push'](_0x605a77['shift']());}};_0x225ce7(++_0x38ccfe);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4fb32f,_0x39f177){_0x4fb32f=_0x4fb32f-0x0;var _0x2fd978=_0x5f2f[_0x4fb32f];return _0x2fd978;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x12aba8,_0x40a036){_0x12aba8=_0x12aba8-0x0;var _0x2aac66=_0x0b0e[_0x12aba8];return _0x2aac66;};'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 cd779a2..7c268ad 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 _0xffbd=['api','undefined','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','adSsoEnabled','blockDuration','name','password','salt','role','blocked','online','admin','user','then','disabled','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../config/environment','../../config/logger'];(function(_0x21badd,_0x4362cb){var _0x5850aa=function(_0x146d41){while(--_0x146d41){_0x21badd['push'](_0x21badd['shift']());}};_0x5850aa(++_0x4362cb);}(_0xffbd,0x170));var _0xdffb=function(_0x2e4a0f,_0x3a9bb6){_0x2e4a0f=_0x2e4a0f-0x0;var _0x25a3cd=_0xffbd[_0x2e4a0f];return _0x25a3cd;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xdffb('0x0'))[_0xdffb('0x1')];var moment=require(_0xdffb('0x2'));var ActiveDirectory=require(_0xdffb('0x3'));var BPromise=require('bluebird');var util=require(_0xdffb('0x4'));var db=require(_0xdffb('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require(_0xdffb('0x6'));var logger=require(_0xdffb('0x7'))(_0xdffb('0x8'));function isActiveDirectoryConfigured(_0x305f3e){var _0x3b6dd4=![];if(typeof _0x305f3e['activedirectory']!==_0xdffb('0x9')){_0x3b6dd4=_0x305f3e[_0xdffb('0xa')][_0xdffb('0xb')]&&_0x305f3e[_0xdffb('0xa')][_0xdffb('0xc')]&&_0x305f3e[_0xdffb('0xa')][_0xdffb('0xd')];}return _0x3b6dd4;}function adAuthenticate(_0x3d1d98,_0x577331,_0x4bded3){return new BPromise(function(_0x56b869,_0x496ea8){try{var _0x4f09bc=new ActiveDirectory(_0x3d1d98);_0x4f09bc[_0xdffb('0xe')](_0x577331,_0x4bded3,function(_0x31b05f,_0x57e843){if(_0x31b05f){logger[_0xdffb('0xf')](_0xdffb('0x10'),_0x577331,util[_0xdffb('0x11')](_0x31b05f,{'showHidden':![],'depth':null}));_0x496ea8(_0xdffb('0x12'));}else if(!_0x57e843){logger[_0xdffb('0xf')](_0xdffb('0x13'),_0x577331);_0x496ea8('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x56b869(_0x57e843);}});}catch(_0x744a61){_0x496ea8(_0x744a61);}});}function ActiveDirectoryAuthenticate(_0x1d9c12,_0x479900,_0x8456cb,_0x2e2d64){var _0x278b5e,_0x84bc0a;if(!isActiveDirectoryConfigured(config)){logger[_0xdffb('0xf')](_0xdffb('0x14'),_0x479900);return _0x2e2d64(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xdffb('0x15'),_0xdffb('0x16')],'raw':!![]})['then'](function(_0x3c1b56){_0x278b5e=_0x3c1b56;if(!_0x278b5e[_0xdffb('0x15')]){logger[_0xdffb('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x479900);throw new Error(_0xdffb('0x12'));}return _0x1d9c12['findOne']({'attributes':['id',_0xdffb('0x17'),_0xdffb('0x18'),_0xdffb('0x19'),_0xdffb('0x1a'),'disabled',_0xdffb('0x1b'),'blockedAt',_0xdffb('0x1c')],'where':{'name':_0x479900,'role':{'$or':[_0xdffb('0x1d'),_0xdffb('0x1e'),'agent']},'adSsoEnabled':!![]}});})[_0xdffb('0x1f')](function(_0x368bb7){if(!_0x368bb7||_0x368bb7&&_0x368bb7[_0xdffb('0x17')]!==_0x479900){throw new Error(_0xdffb('0x12'));}_0x84bc0a=_0x368bb7;var _0x480c9c=_0x84bc0a[_0xdffb('0x17')]+'@'+config[_0xdffb('0xa')][_0xdffb('0xd')];return adAuthenticate(config[_0xdffb('0xa')],_0x480c9c,_0x8456cb);})[_0xdffb('0x1f')](function(_0x3517fe){if(_0x84bc0a[_0xdffb('0x20')]){throw new Error(_0xdffb('0x12'));}if(_0x278b5e[_0xdffb('0x16')]>0x0){if(_0x84bc0a[_0xdffb('0x1b')]){if(moment(_0x84bc0a[_0xdffb('0x21')])[_0xdffb('0x22')](_0x278b5e[_0xdffb('0x16')],_0xdffb('0x23'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xdffb('0x24')](_0x84bc0a,0x0,![],null)[_0xdffb('0x1f')](function(){return utils[_0xdffb('0x25')](_0x84bc0a);})[_0xdffb('0x1f')](function(){return _0x2e2d64(null,_0x84bc0a);});}else{return utils['getLicense'](_0x84bc0a)[_0xdffb('0x1f')](function(){return _0x2e2d64(null,_0x84bc0a);});}}else{return utils['getLicense'](_0x84bc0a)['then'](function(){return _0x2e2d64(null,_0x84bc0a);});}})[_0xdffb('0x26')](function(_0x46742b){return _0x2e2d64(null,![],_0x46742b);});}function handleError(_0x56f35c,_0x493bbe,_0x3c1166){return _0x56f35c[_0xdffb('0x27')](_0x493bbe||0x1f4)[_0xdffb('0x28')]({'message':_0x3c1166?_0x3c1166[_0xdffb('0x29')]||_0x3c1166:''});}exports['login']=function(_0x3636e6,_0x5b92ec,_0x5946dd){passport[_0xdffb('0xe')](_0xdffb('0x2a'),function(_0x5649fa,_0x1a0226,_0x57a0cb){var _0x5558cc=_0x5649fa||_0x57a0cb;if(_0x5558cc){return handleError(_0x5b92ec,0x191,_0x5558cc);}if(!_0x1a0226){return handleError(_0x5b92ec,0x194,{'message':_0xdffb('0x2b')});}else{var _0x10ad55={'payload':{'id':_0x1a0226['id'],'role':_0x1a0226[_0xdffb('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0xdffb('0x2c')](_0x10ad55)['then'](function(_0x2d598e){_0x5b92ec[_0xdffb('0x2d')]({'id':_0x1a0226['id'],'token':_0x2d598e,'statusCall':'','isAlreadyLogged':_0x1a0226[_0xdffb('0x1c')]});});}})(_0x3636e6,_0x5b92ec,_0x5946dd);};passport[_0xdffb('0x2e')](_0xdffb('0x2a'),new LocalStrategy({'usernameField':_0xdffb('0x17'),'passwordField':_0xdffb('0x18')},function(_0x238d25,_0x166a3b,_0x107288){return ActiveDirectoryAuthenticate(db['User'],_0x238d25,_0x166a3b,_0x107288);}));
\ No newline at end of file
+var _0x8d5d=['adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','role','disabled','blockedAt','online','admin','user','agent','blocked','add','minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','name','User','passport','passport-local','Strategy','moment','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','api','undefined','activedirectory','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then'];(function(_0x5f4b36,_0x18cb34){var _0x4765ec=function(_0x2a6c85){while(--_0x2a6c85){_0x5f4b36['push'](_0x5f4b36['shift']());}};_0x4765ec(++_0x18cb34);}(_0x8d5d,0x10e));var _0xd8d5=function(_0x5bb3f0,_0x263eea){_0x5bb3f0=_0x5bb3f0-0x0;var _0x4a3015=_0x8d5d[_0x5bb3f0];return _0x4a3015;};'use strict';var passport=require(_0xd8d5('0x0'));var LocalStrategy=require(_0xd8d5('0x1'))[_0xd8d5('0x2')];var moment=require(_0xd8d5('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xd8d5('0x4'));var util=require(_0xd8d5('0x5'));var db=require(_0xd8d5('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xd8d5('0x7'));var config=require(_0xd8d5('0x8'));var logger=require('../../config/logger')(_0xd8d5('0x9'));function isActiveDirectoryConfigured(_0x144466){var _0x56d620=![];if(typeof _0x144466['activedirectory']!==_0xd8d5('0xa')){_0x56d620=_0x144466[_0xd8d5('0xb')]['baseDN']&&_0x144466[_0xd8d5('0xb')][_0xd8d5('0xc')]&&_0x144466[_0xd8d5('0xb')]['domain'];}return _0x56d620;}function adAuthenticate(_0x3aab7f,_0x4f6f51,_0x7e3601){return new BPromise(function(_0x3423ba,_0x5ad02c){try{var _0x2c5efa=new ActiveDirectory(_0x3aab7f);_0x2c5efa[_0xd8d5('0xd')](_0x4f6f51,_0x7e3601,function(_0x45a0f4,_0x31ebe6){if(_0x45a0f4){logger[_0xd8d5('0xe')](_0xd8d5('0xf'),_0x4f6f51,util[_0xd8d5('0x10')](_0x45a0f4,{'showHidden':![],'depth':null}));_0x5ad02c(_0xd8d5('0x11'));}else if(!_0x31ebe6){logger[_0xd8d5('0xe')](_0xd8d5('0x12'),_0x4f6f51);_0x5ad02c(_0xd8d5('0x11'));}else{_0x3423ba(_0x31ebe6);}});}catch(_0x4bca58){_0x5ad02c(_0x4bca58);}});}function ActiveDirectoryAuthenticate(_0x507dd3,_0x5b0b8a,_0x37ae00,_0x327417){var _0x2e5c3f,_0x115852;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xd8d5('0x13'),_0x5b0b8a);return _0x327417(null,![],{'message':_0xd8d5('0x11')});}return db[_0xd8d5('0x14')][_0xd8d5('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xd8d5('0x16')],'raw':!![]})[_0xd8d5('0x17')](function(_0x4d28ae){_0x2e5c3f=_0x4d28ae;if(!_0x2e5c3f[_0xd8d5('0x18')]){logger[_0xd8d5('0xe')](_0xd8d5('0x19'),_0x5b0b8a);throw new Error(_0xd8d5('0x11'));}return _0x507dd3[_0xd8d5('0x15')]({'attributes':['id','name',_0xd8d5('0x1a'),'salt',_0xd8d5('0x1b'),_0xd8d5('0x1c'),'blocked',_0xd8d5('0x1d'),_0xd8d5('0x1e')],'where':{'name':_0x5b0b8a,'role':{'$or':[_0xd8d5('0x1f'),_0xd8d5('0x20'),_0xd8d5('0x21')]},'adSsoEnabled':!![]}});})[_0xd8d5('0x17')](function(_0xdf5921){if(!_0xdf5921||_0xdf5921&&_0xdf5921['name']!==_0x5b0b8a){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x115852=_0xdf5921;var _0x4c8d98=_0x115852['name']+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0xd8d5('0xb')],_0x4c8d98,_0x37ae00);})[_0xd8d5('0x17')](function(_0x12c113){if(_0x115852['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x2e5c3f[_0xd8d5('0x16')]>0x0){if(_0x115852[_0xd8d5('0x22')]){if(moment(_0x115852[_0xd8d5('0x1d')])[_0xd8d5('0x23')](_0x2e5c3f['blockDuration'],_0xd8d5('0x24'))>moment()){throw new Error(_0xd8d5('0x11'));}return utils[_0xd8d5('0x25')](_0x115852,0x0,![],null)[_0xd8d5('0x17')](function(){return utils[_0xd8d5('0x26')](_0x115852);})[_0xd8d5('0x17')](function(){return _0x327417(null,_0x115852);});}else{return utils['getLicense'](_0x115852)['then'](function(){return _0x327417(null,_0x115852);});}}else{return utils[_0xd8d5('0x26')](_0x115852)['then'](function(){return _0x327417(null,_0x115852);});}})[_0xd8d5('0x27')](function(_0x51e77b){return _0x327417(null,![],_0x51e77b);});}function handleError(_0x444f5b,_0x4238c3,_0x54d56b){return _0x444f5b[_0xd8d5('0x28')](_0x4238c3||0x1f4)['send']({'message':_0x54d56b?_0x54d56b[_0xd8d5('0x29')]||_0x54d56b:''});}exports[_0xd8d5('0x2a')]=function(_0x5a5335,_0x2daee2,_0x379737){passport[_0xd8d5('0xd')](_0xd8d5('0x2b'),function(_0x2c24e3,_0x5ad95e,_0x1326ad){var _0x29a93b=_0x2c24e3||_0x1326ad;if(_0x29a93b){return handleError(_0x2daee2,0x191,_0x29a93b);}if(!_0x5ad95e){return handleError(_0x2daee2,0x194,{'message':_0xd8d5('0x2c')});}else{var _0x4481d6={'payload':{'id':_0x5ad95e['id'],'role':_0x5ad95e[_0xd8d5('0x1b')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4481d6)[_0xd8d5('0x17')](function(_0x100270){_0x2daee2[_0xd8d5('0x2d')]({'id':_0x5ad95e['id'],'token':_0x100270,'statusCall':'','isAlreadyLogged':_0x5ad95e[_0xd8d5('0x1e')]});});}})(_0x5a5335,_0x2daee2,_0x379737);};passport[_0xd8d5('0x2e')]('ad-login',new LocalStrategy({'usernameField':_0xd8d5('0x2f'),'passwordField':_0xd8d5('0x1a')},function(_0x2c2c50,_0x56a25f,_0x13f18a){return ActiveDirectoryAuthenticate(db[_0xd8d5('0x30')],_0x2c2c50,_0x56a25f,_0x13f18a);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index a33e79d..0790430 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 _0x7e66=['Router','exports','express'];(function(_0x1150d0,_0x24f90e){var _0x48a927=function(_0x502654){while(--_0x502654){_0x1150d0['push'](_0x1150d0['shift']());}};_0x48a927(++_0x24f90e);}(_0x7e66,0xe9));var _0x67e6=function(_0x5dc6b6,_0x4771c5){_0x5dc6b6=_0x5dc6b6-0x0;var _0x4eb7e8=_0x7e66[_0x5dc6b6];return _0x4eb7e8;};'use strict';var express=require(_0x67e6('0x0'));var router=express[_0x67e6('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller['login']);module[_0x67e6('0x2')]=router;
\ No newline at end of file
+var _0x7cf7=['Router','./authActiveDirectory.controller','post','login','express'];(function(_0x13a201,_0x54bc68){var _0x1c2040=function(_0xaeca05){while(--_0xaeca05){_0x13a201['push'](_0x13a201['shift']());}};_0x1c2040(++_0x54bc68);}(_0x7cf7,0x1b2));var _0x77cf=function(_0x21ed11,_0x4ff1f7){_0x21ed11=_0x21ed11-0x0;var _0x126e3=_0x7cf7[_0x21ed11];return _0x126e3;};'use strict';var express=require(_0x77cf('0x0'));var router=express[_0x77cf('0x1')]();var controller=require(_0x77cf('0x2'));router[_0x77cf('0x3')]('/',controller[_0x77cf('0x4')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 22c3509..f6b181c 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(_0x1780fb,_0xf933a4){var _0x2d1059=function(_0xfc88a0){while(--_0xfc88a0){_0x1780fb['push'](_0x1780fb['shift']());}};_0x2d1059(++_0xf933a4);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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(_0x52d837,_0x385684){var _0x46890e=function(_0x3045d7){while(--_0x3045d7){_0x52d837['push'](_0x52d837['shift']());}};_0x46890e(++_0x385684);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 4b4cd7e..f1aec19 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 _0x45c9=['passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','isMiddleware','setTokenCookie','exports'];(function(_0x1ecf17,_0x2724d4){var _0x485a9e=function(_0x18773e){while(--_0x18773e){_0x1ecf17['push'](_0x1ecf17['shift']());}};_0x485a9e(++_0x2724d4);}(_0x45c9,0x96));var _0x945c=function(_0x93ab9b,_0x3e80ef){_0x93ab9b=_0x93ab9b-0x0;var _0x4e6b76=_0x45c9[_0x93ab9b];return _0x4e6b76;};'use strict';var express=require('express');var passport=require(_0x945c('0x0'));var router=express['Router']();var controller=require(_0x945c('0x1'));var userController=require(_0x945c('0x2'));var authService=require(_0x945c('0x3'));router[_0x945c('0x4')]('/',controller[_0x945c('0x5')]);router['get'](_0x945c('0x6'),controller['callback'],authService[_0x945c('0x7')],userController[_0x945c('0x5')],authService[_0x945c('0x8')]);module[_0x945c('0x9')]=router;
\ No newline at end of file
+var _0x26b7=['Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport'];(function(_0x343e89,_0x9ca261){var _0x1c3623=function(_0x25410f){while(--_0x25410f){_0x343e89['push'](_0x343e89['shift']());}};_0x1c3623(++_0x9ca261);}(_0x26b7,0x16a));var _0x726b=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x26b7[_0x465a0c];return _0x1e202e;};'use strict';var express=require(_0x726b('0x0'));var passport=require(_0x726b('0x1'));var router=express[_0x726b('0x2')]();var controller=require(_0x726b('0x3'));var userController=require(_0x726b('0x4'));var authService=require(_0x726b('0x5'));router[_0x726b('0x6')]('/',controller[_0x726b('0x7')]);router[_0x726b('0x6')](_0x726b('0x8'),controller[_0x726b('0x9')],authService[_0x726b('0xa')],userController['login'],authService[_0x726b('0xb')]);module[_0x726b('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 70089d3..0641f07 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 _0x83bb=['message','send','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','email','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','use','local-login','util','passport','passport-local','Strategy','lodash','randomstring','../../mysqldb','client','http','Setting','findOne','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blockDuration','add','clearBlockUser','minutes','getLicense','catch','find','MailServerOut','CloudProvider','getSmtpOptions','format','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!'];(function(_0x3e8741,_0x40b2ad){var _0x8b0d66=function(_0x2c25ff){while(--_0x2c25ff){_0x3e8741['push'](_0x3e8741['shift']());}};_0x8b0d66(++_0x40b2ad);}(_0x83bb,0x1b7));var _0xb83b=function(_0xb05ed,_0x38964c){_0xb05ed=_0xb05ed-0x0;var _0x4ce84f=_0x83bb[_0xb05ed];return _0x4ce84f;};'use strict';var util=require(_0xb83b('0x0'));var passport=require(_0xb83b('0x1'));var LocalStrategy=require(_0xb83b('0x2'))[_0xb83b('0x3')];var jayson=require('jayson/promise');var _=require(_0xb83b('0x4'));var rs=require(_0xb83b('0x5'));var moment=require('moment');var db=require(_0xb83b('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0xb83b('0x7')][_0xb83b('0x8')]({'port':0x232b});function localAuthenticate(_0x292adb,_0x5c6dc9,_0x272d74,_0x1bb235){var _0x3ad566,_0x28049f;return db[_0xb83b('0x9')][_0xb83b('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xb83b('0xb')](function(_0x48ec89){_0x3ad566=_0x48ec89;return _0x292adb['findOne']({'attributes':['id',_0xb83b('0xc'),_0xb83b('0xd'),_0xb83b('0xe'),_0xb83b('0xf'),_0xb83b('0x10'),_0xb83b('0x11'),_0xb83b('0x12'),_0xb83b('0x13')],'where':{'name':_0x5c6dc9,'role':{'$or':[_0xb83b('0x14'),_0xb83b('0x15'),_0xb83b('0x16')]}}});})[_0xb83b('0xb')](function(_0x1d0912){if(!_0x1d0912||_0x1d0912&&_0x1d0912[_0xb83b('0xc')]!==_0x5c6dc9){throw new Error(_0xb83b('0x17'));}else{_0x28049f=_0x1d0912;return _0x28049f;}})[_0xb83b('0xb')](function(){_0x28049f['authenticate'](_0x272d74,function(_0x510f88,_0x6147ff){var _0x4704a4=_0x28049f[_0xb83b('0x13')]+0x1;if(_0x510f88){return _0x1bb235(_0x510f88);}else if(!_0x6147ff){if(_0x28049f[_0xb83b('0x10')]){return _0x1bb235(null,![],{'message':_0xb83b('0x17')});}else if(_0x3ad566[_0xb83b('0x18')]>0x0){if(_0x28049f[_0xb83b('0x11')]){if(_0x3ad566[_0xb83b('0x19')]>0x0){if(moment(_0x28049f[_0xb83b('0x12')])[_0xb83b('0x1a')](_0x3ad566[_0xb83b('0x19')],'minutes')>moment()){return _0x1bb235(null,![],{'message':_0xb83b('0x17')});}else{return utils[_0xb83b('0x1b')](_0x28049f,_0x4704a4,![],null)[_0xb83b('0xb')](function(){return _0x1bb235(null,![],{'message':_0xb83b('0x17')});});}}else{return _0x1bb235(null,![],{'message':_0xb83b('0x17')});}}else{if(_0x4704a4>=_0x3ad566[_0xb83b('0x18')]){return utils[_0xb83b('0x1b')](_0x28049f,0x0,!![],moment())[_0xb83b('0xb')](function(){return _0x1bb235(null,![],{'message':_0xb83b('0x17')});});}else{return utils[_0xb83b('0x1b')](_0x28049f,_0x4704a4,![],null)[_0xb83b('0xb')](function(){return _0x1bb235(null,![],{'message':_0xb83b('0x17')});});}}}else{return _0x1bb235(null,![],{'message':_0xb83b('0x17')});}}else{if(_0x28049f[_0xb83b('0x10')]){return _0x1bb235(null,![],{'message':_0xb83b('0x17')});}else if(_0x3ad566[_0xb83b('0x18')]>0x0){if(_0x28049f['blocked']){if(_0x3ad566[_0xb83b('0x19')]>0x0){if(moment(_0x28049f[_0xb83b('0x12')])['add'](_0x3ad566[_0xb83b('0x19')],_0xb83b('0x1c'))>moment()){return _0x1bb235(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xb83b('0x1b')](_0x28049f,0x0,![],null)[_0xb83b('0xb')](function(){return utils['getLicense'](_0x28049f);})[_0xb83b('0xb')](function(){return _0x1bb235(null,_0x28049f);});}}else{return _0x1bb235(null,![],{'message':_0xb83b('0x17')});}}else{return utils[_0xb83b('0x1b')](_0x28049f,0x0,![],null)['then'](function(){return utils[_0xb83b('0x1d')](_0x28049f);})[_0xb83b('0xb')](function(){return _0x1bb235(null,_0x28049f);})[_0xb83b('0x1e')](function(_0x2b508b){return _0x1bb235(null,![],_0x2b508b);});}}else{if(_0x28049f[_0xb83b('0x11')]){return _0x1bb235(null,![],{'message':_0xb83b('0x17')});}else{return utils[_0xb83b('0x1d')](_0x28049f)[_0xb83b('0xb')](function(){return _0x1bb235(null,_0x28049f);});}}}});})[_0xb83b('0x1e')](function(_0x491b47){return _0x1bb235(null,![],_0x491b47);});}function sendServiceMail(_0x595d32){return db['MailAccount'][_0xb83b('0x1f')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0xb83b('0x20')],'as':'Smtp','include':[{'model':db[_0xb83b('0x21')],'as':_0xb83b('0x21')}]}]})[_0xb83b('0xb')](function(_0x5805e3){if(!_0x5805e3){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0xf67228=_0x5805e3[_0xb83b('0x22')]();var _0x3c393a={'account':_0xf67228,'message':_['merge']({'from':util[_0xb83b('0x23')]('\x22%s\x22\x20<%s>',_0x5805e3[_0xb83b('0xc')],_0x5805e3['email']||_0x5805e3[_0xb83b('0x24')]['user'])},_0x595d32)};return client[_0xb83b('0x25')](_0xb83b('0x26'),_0x3c393a);})[_0xb83b('0xb')](function(_0x13939d){if(_0x13939d[_0xb83b('0x27')]){throw new Error(util[_0xb83b('0x23')](_0xb83b('0x28'),_0x13939d['error'][_0xb83b('0x29')]||JSON['stringify'](_0x13939d[_0xb83b('0x27')])));}return!![];});}function handleError(_0x5cffc4,_0xdc32fe,_0x992ef6){return _0x5cffc4['status'](_0xdc32fe||0x1f4)[_0xb83b('0x2a')]({'message':_0x992ef6?_0x992ef6['message']||_0x992ef6:''});}exports[_0xb83b('0x2b')]=function(_0x3a568a,_0x41b7bd,_0x46f6df){passport[_0xb83b('0x2c')]('local-login',function(_0x5831cc,_0x167ec2,_0x1b7aac){var _0x2ffd48=_0x5831cc||_0x1b7aac;if(_0x2ffd48){return handleError(_0x41b7bd,0x191,_0x2ffd48);}if(!_0x167ec2){return handleError(_0x41b7bd,0x194,{'message':_0xb83b('0x2d')});}else{var _0x1adb0b={'payload':{'id':_0x167ec2['id'],'role':_0x167ec2['role']},'options':{'expiresIn':0x15180}};return authService[_0xb83b('0x2e')](_0x1adb0b)[_0xb83b('0xb')](function(_0x3a6c3b){_0x41b7bd['json']({'id':_0x167ec2['id'],'token':_0x3a6c3b,'statusCall':'','isAlreadyLogged':_0x167ec2[_0xb83b('0x2f')]});});}})(_0x3a568a,_0x41b7bd,_0x46f6df);};exports[_0xb83b('0x30')]=function(_0x248d39,_0x555546){if(!_0x248d39[_0xb83b('0x31')]['email']){return handleError(_0x555546,0x1f4,{'message':_0xb83b('0x32')});}var _0x42552a=rs['generate']();_0x248d39[_0xb83b('0x31')]['email']=_0x248d39['body'][_0xb83b('0x33')][_0xb83b('0x34')]()[_0xb83b('0x35')]();var _0x307e63;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xb83b('0x18'),_0xb83b('0x19')],'raw':!![]})['then'](function(_0x5c0ac9){_0x307e63=_0x5c0ac9;return db[_0xb83b('0x36')]['find']({'where':{'email':_0x248d39['body'][_0xb83b('0x33')]}});})['then'](function(_0x5c0e6d){if(!_0x5c0e6d){throw new Error(_0xb83b('0x37'));}if(_0x5c0e6d['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x5c0e6d['blocked']){if(moment(_0x5c0e6d['blockedAt'])['add'](_0x307e63['blockDuration'],_0xb83b('0x1c'))>moment()){throw new Error(_0xb83b('0x38'));}else{_0x5c0e6d[_0xb83b('0x11')]=![];_0x5c0e6d[_0xb83b('0x12')]=null;}}_0x5c0e6d['resetPasswordToken']=_0x42552a;_0x5c0e6d['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x5c0e6d[_0xb83b('0x39')]();})[_0xb83b('0xb')](function(){return sendServiceMail({'to':_0x248d39[_0xb83b('0x31')][_0xb83b('0x33')],'subject':_0xb83b('0x3a'),'text':_0xb83b('0x3b')+_0xb83b('0x3c')+_0xb83b('0x3d')+_0x248d39[_0xb83b('0x3e')][_0xb83b('0x3f')]+_0xb83b('0x40')+_0x42552a+'\x0a\x0a'+_0xb83b('0x41')});})['then'](function(){_0x555546[_0xb83b('0x42')](0xc8)['send']({'message':_0xb83b('0x43')});})[_0xb83b('0x1e')](function(_0x4a3be9){return handleError(_0x555546,0x1f4,_0x4a3be9);});};exports[_0xb83b('0x44')]=function(_0x16ba19,_0x58ead1){return db['User'][_0xb83b('0x1f')]({'where':{'resetPasswordToken':_0x16ba19['params']['token'],'resetPasswordExpires':{'$gt':Date[_0xb83b('0x45')]()}}})[_0xb83b('0xb')](function(_0x207e95){if(!_0x207e95){throw new Error(_0xb83b('0x46'));}return db[_0xb83b('0x9')][_0xb83b('0xa')]({'attributes':['id',_0xb83b('0x47'),_0xb83b('0x48'),_0xb83b('0x49')]})[_0xb83b('0xb')](function(_0x128326){if(_0x128326['securePassword'])authService[_0xb83b('0x4a')](_0x16ba19[_0xb83b('0x31')][_0xb83b('0xd')]);if(!_0x128326[_0xb83b('0x48')]||!_0x207e95[_0xb83b('0x4b')])return _0x207e95;authService[_0xb83b('0x4c')](_0x16ba19['body'][_0xb83b('0xd')],_0x207e95[_0xb83b('0x4b')],_0x128326['passwordHistoryLimit']);return _0x207e95;})[_0xb83b('0xb')](function(){_0x207e95[_0xb83b('0xd')]=_0x16ba19[_0xb83b('0x31')][_0xb83b('0xd')];_0x207e95[_0xb83b('0x4d')]=null;_0x207e95['resetPasswordExpires']=null;return _0x207e95[_0xb83b('0x39')]();});})[_0xb83b('0xb')](function(){_0x58ead1[_0xb83b('0x42')](0xc8)[_0xb83b('0x2a')]({'message':'Password\x20reset!'});})[_0xb83b('0x1e')](function(_0x387635){return handleError(_0x58ead1,0x1f4,_0x387635);});};passport[_0xb83b('0x4e')](_0xb83b('0x4f'),new LocalStrategy({'usernameField':_0xb83b('0xc'),'passwordField':_0xb83b('0xd')},function(_0x2a8ee1,_0x2230dc,_0x8ae610){return localAuthenticate(db['User'],_0x2a8ee1,_0x2230dc,_0x8ae610);}));
\ No newline at end of file
+var _0xa7ba=['token','now','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','allowedLoginAttempts','blockDuration','name','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','request','SendMail','message','stringify','error','status','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','findOne','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset'];(function(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0xa7ba,0x1aa));var _0xaa7b=function(_0x3a683a,_0x353ce3){_0x3a683a=_0x3a683a-0x0;var _0x8e4b97=_0xa7ba[_0x3a683a];return _0x8e4b97;};'use strict';var util=require(_0xaa7b('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xaa7b('0x1')];var jayson=require(_0xaa7b('0x2'));var _=require(_0xaa7b('0x3'));var rs=require(_0xaa7b('0x4'));var moment=require(_0xaa7b('0x5'));var db=require(_0xaa7b('0x6'))['db'];var authService=require(_0xaa7b('0x7'));var utils=require('../../config/utils');var client=jayson[_0xaa7b('0x8')][_0xaa7b('0x9')]({'port':0x232b});function localAuthenticate(_0x2bca95,_0x3bfd84,_0x45e5fa,_0x592e92){var _0x54274e,_0x4b6b99;return db[_0xaa7b('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xaa7b('0xb'),_0xaa7b('0xc')],'raw':!![]})['then'](function(_0x1c8dc0){_0x54274e=_0x1c8dc0;return _0x2bca95['findOne']({'attributes':['id',_0xaa7b('0xd'),'password','salt',_0xaa7b('0xe'),_0xaa7b('0xf'),_0xaa7b('0x10'),_0xaa7b('0x11'),_0xaa7b('0x12')],'where':{'name':_0x3bfd84,'role':{'$or':[_0xaa7b('0x13'),_0xaa7b('0x14'),_0xaa7b('0x15')]}}});})[_0xaa7b('0x16')](function(_0x5300cf){if(!_0x5300cf||_0x5300cf&&_0x5300cf[_0xaa7b('0xd')]!==_0x3bfd84){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x4b6b99=_0x5300cf;return _0x4b6b99;}})[_0xaa7b('0x16')](function(){_0x4b6b99[_0xaa7b('0x17')](_0x45e5fa,function(_0x384bbf,_0xc35dfa){var _0x1e59c2=_0x4b6b99[_0xaa7b('0x12')]+0x1;if(_0x384bbf){return _0x592e92(_0x384bbf);}else if(!_0xc35dfa){if(_0x4b6b99['disabled']){return _0x592e92(null,![],{'message':_0xaa7b('0x18')});}else if(_0x54274e[_0xaa7b('0xb')]>0x0){if(_0x4b6b99[_0xaa7b('0x10')]){if(_0x54274e[_0xaa7b('0xc')]>0x0){if(moment(_0x4b6b99[_0xaa7b('0x11')])['add'](_0x54274e[_0xaa7b('0xc')],_0xaa7b('0x19'))>moment()){return _0x592e92(null,![],{'message':_0xaa7b('0x18')});}else{return utils['clearBlockUser'](_0x4b6b99,_0x1e59c2,![],null)[_0xaa7b('0x16')](function(){return _0x592e92(null,![],{'message':_0xaa7b('0x18')});});}}else{return _0x592e92(null,![],{'message':_0xaa7b('0x18')});}}else{if(_0x1e59c2>=_0x54274e['allowedLoginAttempts']){return utils[_0xaa7b('0x1a')](_0x4b6b99,0x0,!![],moment())[_0xaa7b('0x16')](function(){return _0x592e92(null,![],{'message':_0xaa7b('0x18')});});}else{return utils[_0xaa7b('0x1a')](_0x4b6b99,_0x1e59c2,![],null)[_0xaa7b('0x16')](function(){return _0x592e92(null,![],{'message':_0xaa7b('0x18')});});}}}else{return _0x592e92(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x4b6b99[_0xaa7b('0xf')]){return _0x592e92(null,![],{'message':_0xaa7b('0x18')});}else if(_0x54274e['allowedLoginAttempts']>0x0){if(_0x4b6b99[_0xaa7b('0x10')]){if(_0x54274e[_0xaa7b('0xc')]>0x0){if(moment(_0x4b6b99[_0xaa7b('0x11')])[_0xaa7b('0x1b')](_0x54274e[_0xaa7b('0xc')],_0xaa7b('0x19'))>moment()){return _0x592e92(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xaa7b('0x1a')](_0x4b6b99,0x0,![],null)[_0xaa7b('0x16')](function(){return utils['getLicense'](_0x4b6b99);})[_0xaa7b('0x16')](function(){return _0x592e92(null,_0x4b6b99);});}}else{return _0x592e92(null,![],{'message':_0xaa7b('0x18')});}}else{return utils[_0xaa7b('0x1a')](_0x4b6b99,0x0,![],null)['then'](function(){return utils[_0xaa7b('0x1c')](_0x4b6b99);})['then'](function(){return _0x592e92(null,_0x4b6b99);})[_0xaa7b('0x1d')](function(_0x3865d7){return _0x592e92(null,![],_0x3865d7);});}}else{if(_0x4b6b99[_0xaa7b('0x10')]){return _0x592e92(null,![],{'message':_0xaa7b('0x18')});}else{return utils[_0xaa7b('0x1c')](_0x4b6b99)['then'](function(){return _0x592e92(null,_0x4b6b99);});}}}});})[_0xaa7b('0x1d')](function(_0x439cb0){return _0x592e92(null,![],_0x439cb0);});}function sendServiceMail(_0x5efae7){return db[_0xaa7b('0x1e')][_0xaa7b('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0xaa7b('0x20')],'include':[{'model':db['MailServerOut'],'as':_0xaa7b('0x21'),'include':[{'model':db[_0xaa7b('0x22')],'as':'CloudProvider'}]}]})['then'](function(_0x38b9d3){if(!_0x38b9d3){throw new Error(_0xaa7b('0x23'));}var _0x452917=_0x38b9d3['getSmtpOptions']();var _0x5195e2={'account':_0x452917,'message':_[_0xaa7b('0x24')]({'from':util[_0xaa7b('0x25')](_0xaa7b('0x26'),_0x38b9d3['name'],_0x38b9d3[_0xaa7b('0x20')]||_0x38b9d3[_0xaa7b('0x21')]['user'])},_0x5efae7)};return client[_0xaa7b('0x27')](_0xaa7b('0x28'),_0x5195e2);})['then'](function(_0x4f4c80){if(_0x4f4c80['error']){throw new Error(util[_0xaa7b('0x25')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4f4c80['error'][_0xaa7b('0x29')]||JSON[_0xaa7b('0x2a')](_0x4f4c80[_0xaa7b('0x2b')])));}return!![];});}function handleError(_0x354e4f,_0x148fce,_0x30b0d5){return _0x354e4f[_0xaa7b('0x2c')](_0x148fce||0x1f4)[_0xaa7b('0x2d')]({'message':_0x30b0d5?_0x30b0d5['message']||_0x30b0d5:''});}exports['login']=function(_0xe2550e,_0x3a8ee1,_0x918ba){passport[_0xaa7b('0x17')](_0xaa7b('0x2e'),function(_0x52f5f0,_0x3f70a0,_0xe28a50){var _0x3ce630=_0x52f5f0||_0xe28a50;if(_0x3ce630){return handleError(_0x3a8ee1,0x191,_0x3ce630);}if(!_0x3f70a0){return handleError(_0x3a8ee1,0x194,{'message':_0xaa7b('0x2f')});}else{var _0x4c8f1a={'payload':{'id':_0x3f70a0['id'],'role':_0x3f70a0[_0xaa7b('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0xaa7b('0x30')](_0x4c8f1a)[_0xaa7b('0x16')](function(_0x375bac){_0x3a8ee1[_0xaa7b('0x31')]({'id':_0x3f70a0['id'],'token':_0x375bac,'statusCall':'','isAlreadyLogged':_0x3f70a0[_0xaa7b('0x32')]});});}})(_0xe2550e,_0x3a8ee1,_0x918ba);};exports[_0xaa7b('0x33')]=function(_0x154000,_0x116372){if(!_0x154000[_0xaa7b('0x34')][_0xaa7b('0x20')]){return handleError(_0x116372,0x1f4,{'message':_0xaa7b('0x35')});}var _0x347e62=rs[_0xaa7b('0x36')]();_0x154000[_0xaa7b('0x34')][_0xaa7b('0x20')]=_0x154000['body'][_0xaa7b('0x20')][_0xaa7b('0x37')]()[_0xaa7b('0x38')]();var _0x1ac325;return db[_0xaa7b('0xa')][_0xaa7b('0x39')]({'where':{'id':0x1},'attributes':[_0xaa7b('0xb'),_0xaa7b('0xc')],'raw':!![]})[_0xaa7b('0x16')](function(_0x19f591){_0x1ac325=_0x19f591;return db[_0xaa7b('0x3a')][_0xaa7b('0x1f')]({'where':{'email':_0x154000[_0xaa7b('0x34')][_0xaa7b('0x20')]}});})[_0xaa7b('0x16')](function(_0x2d7a45){if(!_0x2d7a45){throw new Error(_0xaa7b('0x3b'));}if(_0x2d7a45[_0xaa7b('0xf')]){throw new Error(_0xaa7b('0x3c'));}if(_0x2d7a45['blocked']){if(moment(_0x2d7a45[_0xaa7b('0x11')])[_0xaa7b('0x1b')](_0x1ac325[_0xaa7b('0xc')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x2d7a45[_0xaa7b('0x10')]=![];_0x2d7a45[_0xaa7b('0x11')]=null;}}_0x2d7a45[_0xaa7b('0x3d')]=_0x347e62;_0x2d7a45[_0xaa7b('0x3e')]=Date['now']()+0x36ee80;return _0x2d7a45[_0xaa7b('0x3f')]();})[_0xaa7b('0x16')](function(){return sendServiceMail({'to':_0x154000[_0xaa7b('0x34')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xaa7b('0x40')+_0xaa7b('0x41')+_0xaa7b('0x42')+_0x154000['headers'][_0xaa7b('0x43')]+_0xaa7b('0x44')+_0x347e62+'\x0a\x0a'+_0xaa7b('0x45')});})[_0xaa7b('0x16')](function(){_0x116372[_0xaa7b('0x2c')](0xc8)[_0xaa7b('0x2d')]({'message':_0xaa7b('0x46')});})[_0xaa7b('0x1d')](function(_0x41cd22){return handleError(_0x116372,0x1f4,_0x41cd22);});};exports[_0xaa7b('0x47')]=function(_0x22bd7b,_0x1e3927){return db[_0xaa7b('0x3a')]['find']({'where':{'resetPasswordToken':_0x22bd7b['params'][_0xaa7b('0x48')],'resetPasswordExpires':{'$gt':Date[_0xaa7b('0x49')]()}}})[_0xaa7b('0x16')](function(_0x46d39c){if(!_0x46d39c){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xaa7b('0xa')]['findOne']({'attributes':['id',_0xaa7b('0x4a'),_0xaa7b('0x4b'),_0xaa7b('0x4c')]})['then'](function(_0x12a215){if(_0x12a215[_0xaa7b('0x4a')])authService[_0xaa7b('0x4d')](_0x22bd7b[_0xaa7b('0x34')][_0xaa7b('0x4e')]);if(!_0x12a215[_0xaa7b('0x4b')]||!_0x46d39c[_0xaa7b('0x4f')])return _0x46d39c;authService[_0xaa7b('0x50')](_0x22bd7b[_0xaa7b('0x34')][_0xaa7b('0x4e')],_0x46d39c['previousPasswords'],_0x12a215[_0xaa7b('0x4c')]);return _0x46d39c;})[_0xaa7b('0x16')](function(){_0x46d39c[_0xaa7b('0x4e')]=_0x22bd7b[_0xaa7b('0x34')][_0xaa7b('0x4e')];_0x46d39c[_0xaa7b('0x3d')]=null;_0x46d39c[_0xaa7b('0x3e')]=null;return _0x46d39c['save']();});})[_0xaa7b('0x16')](function(){_0x1e3927[_0xaa7b('0x2c')](0xc8)[_0xaa7b('0x2d')]({'message':_0xaa7b('0x51')});})[_0xaa7b('0x1d')](function(_0x50dc81){return handleError(_0x1e3927,0x1f4,_0x50dc81);});};passport[_0xaa7b('0x52')](_0xaa7b('0x2e'),new LocalStrategy({'usernameField':_0xaa7b('0xd'),'passwordField':'password'},function(_0x369ed1,_0x2e702e,_0x9478cb){return localAuthenticate(db['User'],_0x369ed1,_0x2e702e,_0x9478cb);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 9185a9e..436bb8f 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 _0x602b=['/reset/:token','reset','exports','Router','post','/forgot','forgot'];(function(_0x5a27fe,_0x43993b){var _0x121c88=function(_0x2aff1f){while(--_0x2aff1f){_0x5a27fe['push'](_0x5a27fe['shift']());}};_0x121c88(++_0x43993b);}(_0x602b,0x14c));var _0xb602=function(_0x4d3770,_0x1adea9){_0x4d3770=_0x4d3770-0x0;var _0x443579=_0x602b[_0x4d3770];return _0x443579;};'use strict';var express=require('express');var router=express[_0xb602('0x0')]();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router[_0xb602('0x1')](_0xb602('0x2'),controller[_0xb602('0x3')]);router[_0xb602('0x1')](_0xb602('0x4'),controller[_0xb602('0x5')]);module[_0xb602('0x6')]=router;
\ No newline at end of file
+var _0xe48a=['Router','./authLocal.controller','post','login','/forgot','/reset/:token','reset'];(function(_0x323d87,_0x4ef3f9){var _0x5e8f74=function(_0x185735){while(--_0x185735){_0x323d87['push'](_0x323d87['shift']());}};_0x5e8f74(++_0x4ef3f9);}(_0xe48a,0x1e3));var _0xae48=function(_0xf43cb,_0x465374){_0xf43cb=_0xf43cb-0x0;var _0x14e869=_0xe48a[_0xf43cb];return _0x14e869;};'use strict';var express=require('express');var router=express[_0xae48('0x0')]();var controller=require(_0xae48('0x1'));router[_0xae48('0x2')]('/',controller[_0xae48('0x3')]);router[_0xae48('0x2')](_0xae48('0x4'),controller['forgot']);router['post'](_0xae48('0x5'),controller[_0xae48('0x6')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 551eda0..39d2a12 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 _0x3223=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x3e7b39,_0x2c2110){var _0x4ad001=function(_0x3fd134){while(--_0x3fd134){_0x3e7b39['push'](_0x3e7b39['shift']());}};_0x4ad001(++_0x2c2110);}(_0x3223,0xbd));var _0x3322=function(_0x3106eb,_0x165c89){_0x3106eb=_0x3106eb-0x0;var _0x16369e=_0x3223[_0x3106eb];return _0x16369e;};'use strict';var Sequelize=require(_0x3322('0x0'));module[_0x3322('0x1')]={'name':{'type':Sequelize[_0x3322('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3322('0x2')]},'status':{'type':Sequelize[_0x3322('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3322('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xee69=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x2aa997,_0x35e10a){var _0x279a25=function(_0x45d656){while(--_0x45d656){_0x2aa997['push'](_0x2aa997['shift']());}};_0x279a25(++_0x35e10a);}(_0xee69,0x92));var _0x9ee6=function(_0x1327c6,_0x5ccd76){_0x1327c6=_0x1327c6-0x0;var _0x2cadd2=_0xee69[_0x1327c6];return _0x2cadd2;};'use strict';var Sequelize=require(_0x9ee6('0x0'));module[_0x9ee6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x9ee6('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x9ee6('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9ee6('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 a06b2a0..529f4bc 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 _0x9ada=['path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','index','map','Automation','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','destroy','addConditions','Condition','ids','omit','getConditions','order','addActions','getActions','findOne','Action','pick','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util'];(function(_0xde78f8,_0x19713c){var _0x1c2ec9=function(_0x33d448){while(--_0x33d448){_0xde78f8['push'](_0xde78f8['shift']());}};_0x1c2ec9(++_0x19713c);}(_0x9ada,0xa9));var _0xa9ad=function(_0x1667c2,_0x50a7c4){_0x1667c2=_0x1667c2-0x0;var _0x142d18=_0x9ada[_0x1667c2];return _0x142d18;};'use strict';var emlformat=require(_0xa9ad('0x0'));var rimraf=require(_0xa9ad('0x1'));var zipdir=require(_0xa9ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa9ad('0x3'));var moment=require(_0xa9ad('0x4'));var BPromise=require(_0xa9ad('0x5'));var Mustache=require('mustache');var util=require(_0xa9ad('0x6'));var path=require(_0xa9ad('0x7'));var sox=require(_0xa9ad('0x8'));var csv=require(_0xa9ad('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9ad('0xa'));var _=require(_0xa9ad('0xb'));var squel=require(_0xa9ad('0xc'));var crypto=require(_0xa9ad('0xd'));var jsforce=require(_0xa9ad('0xe'));var deskjs=require(_0xa9ad('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa9ad('0x10'));var Papa=require(_0xa9ad('0x11'));var Redis=require(_0xa9ad('0x12'));var authService=require(_0xa9ad('0x13'));var qs=require(_0xa9ad('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa9ad('0x15'));var logger=require(_0xa9ad('0x16'))(_0xa9ad('0x17'));var utils=require(_0xa9ad('0x18'));var config=require(_0xa9ad('0x19'));var licenseUtil=require(_0xa9ad('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x152292,_0x544055){_0x544055=_0x544055||0xcc;return function(_0x173698){if(_0x173698){return _0x152292[_0xa9ad('0x1b')](_0x544055);}return _0x152292[_0xa9ad('0x1c')](_0x544055)[_0xa9ad('0x1d')]();};}function respondWithResult(_0x445171,_0x3284f2){_0x3284f2=_0x3284f2||0xc8;return function(_0x319306){if(_0x319306){return _0x445171[_0xa9ad('0x1c')](_0x3284f2)[_0xa9ad('0x1e')](_0x319306);}};}function respondWithFilteredResult(_0x4e0bb1,_0x48c87f){return function(_0x2e22d1){if(_0x2e22d1){var _0x2428f7=typeof _0x48c87f[_0xa9ad('0x1f')]===_0xa9ad('0x20')&&typeof _0x48c87f[_0xa9ad('0x21')]===_0xa9ad('0x20');var _0x3fa6ec=_0x2e22d1[_0xa9ad('0x22')];var _0x3421dc=_0x2428f7?0x0:_0x48c87f['offset'];var _0x403df3=_0x2428f7?_0x2e22d1[_0xa9ad('0x22')]:_0x48c87f['offset']+_0x48c87f[_0xa9ad('0x21')];var _0x5bf1f7;if(_0x403df3>=_0x3fa6ec){_0x403df3=_0x3fa6ec;_0x5bf1f7=0xc8;}else{_0x5bf1f7=0xce;}_0x4e0bb1[_0xa9ad('0x1c')](_0x5bf1f7);return _0x4e0bb1[_0xa9ad('0x23')](_0xa9ad('0x24'),_0x3421dc+'-'+_0x403df3+'/'+_0x3fa6ec)['json'](_0x2e22d1);}return null;};}function patchUpdates(_0x3c7b06){return function(_0x5d1d63){try{jsonpatch['apply'](_0x5d1d63,_0x3c7b06,!![]);}catch(_0x94bd78){return BPromise[_0xa9ad('0x25')](_0x94bd78);}return _0x5d1d63[_0xa9ad('0x26')]();};}function saveUpdates(_0x39f7e9,_0x1997f2){return function(_0x576d6a){if(_0x576d6a){return _0x576d6a[_0xa9ad('0x27')](_0x39f7e9)['then'](function(_0x214a71){return _0x214a71;});}return null;};}function removeEntity(_0x48c41b,_0xc4536f){return function(_0x4a2ab2){if(_0x4a2ab2){return _0x4a2ab2['destroy']()[_0xa9ad('0x28')](function(){_0x48c41b[_0xa9ad('0x1c')](0xcc)[_0xa9ad('0x1d')]();});}};}function handleEntityNotFound(_0x56a374,_0x566004){return function(_0x19daec){if(!_0x19daec){_0x56a374['sendStatus'](0x194);}return _0x19daec;};}function handleError(_0x12b95e,_0x418705){_0x418705=_0x418705||0x1f4;return function(_0x512bd0){logger[_0xa9ad('0x29')](_0x512bd0[_0xa9ad('0x2a')]);if(_0x512bd0[_0xa9ad('0x2b')]){delete _0x512bd0[_0xa9ad('0x2b')];}_0x12b95e[_0xa9ad('0x1c')](_0x418705)['send'](_0x512bd0);};}exports[_0xa9ad('0x2c')]=function(_0x54ef05,_0x514a21){var _0x28dcd2={},_0x4d0118={},_0x3fa31b={'count':0x0,'rows':[]};var _0x6ec464=_[_0xa9ad('0x2d')](db[_0xa9ad('0x2e')]['rawAttributes'],function(_0x22f870){return{'name':_0x22f870['fieldName'],'type':_0x22f870['type'][_0xa9ad('0x2f')]};});_0x4d0118[_0xa9ad('0x30')]=_[_0xa9ad('0x2d')](_0x6ec464,_0xa9ad('0x2b'));_0x4d0118[_0xa9ad('0x31')]=_[_0xa9ad('0x32')](_0x54ef05['query']);_0x4d0118['filters']=_[_0xa9ad('0x33')](_0x4d0118['model'],_0x4d0118[_0xa9ad('0x31')]);_0x28dcd2[_0xa9ad('0x34')]=_[_0xa9ad('0x33')](_0x4d0118[_0xa9ad('0x30')],qs[_0xa9ad('0x35')](_0x54ef05[_0xa9ad('0x31')][_0xa9ad('0x35')]));_0x28dcd2[_0xa9ad('0x34')]=_0x28dcd2['attributes'][_0xa9ad('0x36')]?_0x28dcd2[_0xa9ad('0x34')]:_0x4d0118[_0xa9ad('0x30')];if(!_0x54ef05[_0xa9ad('0x31')][_0xa9ad('0x37')]('nolimit')){_0x28dcd2[_0xa9ad('0x21')]=qs[_0xa9ad('0x21')](_0x54ef05['query'][_0xa9ad('0x21')]);_0x28dcd2[_0xa9ad('0x1f')]=qs[_0xa9ad('0x1f')](_0x54ef05['query'][_0xa9ad('0x1f')]);}_0x28dcd2['order']=qs['sort'](_0x54ef05[_0xa9ad('0x31')][_0xa9ad('0x38')]);_0x28dcd2[_0xa9ad('0x39')]=qs[_0xa9ad('0x3a')](_['pick'](_0x54ef05['query'],_0x4d0118[_0xa9ad('0x3a')]),_0x6ec464);if(_0x54ef05['query'][_0xa9ad('0x3b')]){_0x28dcd2['where']=_[_0xa9ad('0x3c')](_0x28dcd2['where'],{'$or':_[_0xa9ad('0x2d')](_0x6ec464,function(_0x1e68a0){if(_0x1e68a0[_0xa9ad('0x3d')]!==_0xa9ad('0x3e')){var _0x5f3818={};_0x5f3818[_0x1e68a0[_0xa9ad('0x2b')]]={'$like':'%'+_0x54ef05[_0xa9ad('0x31')][_0xa9ad('0x3b')]+'%'};return _0x5f3818;}})});}_0x28dcd2=_[_0xa9ad('0x3c')]({},_0x28dcd2,_0x54ef05[_0xa9ad('0x3f')]);var _0x1155c3={'where':_0x28dcd2['where']};return db[_0xa9ad('0x2e')]['count'](_0x1155c3)[_0xa9ad('0x28')](function(_0x2c6d17){_0x3fa31b['count']=_0x2c6d17;if(_0x54ef05[_0xa9ad('0x31')][_0xa9ad('0x40')]){_0x28dcd2['include']=[{'all':!![]}];}return db['Automation'][_0xa9ad('0x41')](_0x28dcd2);})[_0xa9ad('0x28')](function(_0x7c372d){_0x3fa31b[_0xa9ad('0x42')]=_0x7c372d;return _0x3fa31b;})['then'](respondWithFilteredResult(_0x514a21,_0x28dcd2))[_0xa9ad('0x43')](handleError(_0x514a21,null));};exports[_0xa9ad('0x44')]=function(_0x145ad2,_0x425069){var _0x4924fc={'raw':![],'where':{'id':_0x145ad2[_0xa9ad('0x45')]['id']}},_0x71f21d={};_0x71f21d['model']=_['keys'](db[_0xa9ad('0x2e')][_0xa9ad('0x46')]);_0x71f21d[_0xa9ad('0x31')]=_[_0xa9ad('0x32')](_0x145ad2[_0xa9ad('0x31')]);_0x71f21d[_0xa9ad('0x3a')]=_[_0xa9ad('0x33')](_0x71f21d[_0xa9ad('0x30')],_0x71f21d[_0xa9ad('0x31')]);_0x4924fc[_0xa9ad('0x34')]=_[_0xa9ad('0x33')](_0x71f21d[_0xa9ad('0x30')],qs['fields'](_0x145ad2[_0xa9ad('0x31')][_0xa9ad('0x35')]));_0x4924fc['attributes']=_0x4924fc['attributes'][_0xa9ad('0x36')]?_0x4924fc[_0xa9ad('0x34')]:_0x71f21d[_0xa9ad('0x30')];if(_0x145ad2[_0xa9ad('0x31')][_0xa9ad('0x40')]){_0x4924fc[_0xa9ad('0x47')]=[{'all':!![]}];}_0x4924fc=_[_0xa9ad('0x3c')]({},_0x4924fc,_0x145ad2[_0xa9ad('0x3f')]);return db[_0xa9ad('0x2e')][_0xa9ad('0x48')](_0x4924fc)[_0xa9ad('0x28')](handleEntityNotFound(_0x425069,null))[_0xa9ad('0x28')](respondWithResult(_0x425069,null))[_0xa9ad('0x43')](handleError(_0x425069,null));};exports[_0xa9ad('0x49')]=function(_0x82059d,_0x15d5d1){return db[_0xa9ad('0x2e')][_0xa9ad('0x49')](_0x82059d[_0xa9ad('0x4a')],{})['then'](respondWithResult(_0x15d5d1,0xc9))[_0xa9ad('0x43')](handleError(_0x15d5d1,null));};exports[_0xa9ad('0x27')]=function(_0x3d9de6,_0x56f0bd){if(_0x3d9de6[_0xa9ad('0x4a')]['id']){delete _0x3d9de6[_0xa9ad('0x4a')]['id'];}return db[_0xa9ad('0x2e')][_0xa9ad('0x48')]({'where':{'id':_0x3d9de6[_0xa9ad('0x45')]['id']}})['then'](handleEntityNotFound(_0x56f0bd,null))[_0xa9ad('0x28')](saveUpdates(_0x3d9de6[_0xa9ad('0x4a')],null))[_0xa9ad('0x28')](respondWithResult(_0x56f0bd,null))['catch'](handleError(_0x56f0bd,null));};exports[_0xa9ad('0x4b')]=function(_0x4f4059,_0x422104){return db[_0xa9ad('0x2e')]['find']({'where':{'id':_0x4f4059['params']['id']}})[_0xa9ad('0x28')](handleEntityNotFound(_0x422104,null))[_0xa9ad('0x28')](removeEntity(_0x422104,null))[_0xa9ad('0x43')](handleError(_0x422104,null));};exports[_0xa9ad('0x4c')]=function(_0x193b85,_0x2c1862,_0x3ba4f5){return db[_0xa9ad('0x4d')][_0xa9ad('0x48')]({'where':{'id':_0x193b85[_0xa9ad('0x45')]['id']}})[_0xa9ad('0x28')](handleEntityNotFound(_0x2c1862,null))['then'](function(_0x5f0815){if(_0x5f0815){return _0x5f0815[_0xa9ad('0x4c')](_0x193b85[_0xa9ad('0x4a')][_0xa9ad('0x4e')],_[_0xa9ad('0x4f')](_0x193b85[_0xa9ad('0x4a')],['ids','id'])||{});}})[_0xa9ad('0x28')](respondWithResult(_0x2c1862,null))['catch'](handleError(_0x2c1862,null));};exports[_0xa9ad('0x50')]=function(_0x48b7f5,_0x5ddb6d,_0x159bbf){var _0x321401={};var _0x358ea7={};var _0x10ab7c;var _0x401ccd;return db[_0xa9ad('0x2e')]['findOne']({'where':{'id':_0x48b7f5['params']['id']}})['then'](handleEntityNotFound(_0x5ddb6d,null))[_0xa9ad('0x28')](function(_0x84e05){if(_0x84e05){_0x10ab7c=_0x84e05;_0x358ea7[_0xa9ad('0x30')]=_[_0xa9ad('0x32')](db[_0xa9ad('0x4d')][_0xa9ad('0x46')]);_0x358ea7['query']=_[_0xa9ad('0x32')](_0x48b7f5['query']);_0x358ea7[_0xa9ad('0x3a')]=_['intersection'](_0x358ea7[_0xa9ad('0x30')],_0x358ea7[_0xa9ad('0x31')]);_0x321401[_0xa9ad('0x34')]=_[_0xa9ad('0x33')](_0x358ea7[_0xa9ad('0x30')],qs[_0xa9ad('0x35')](_0x48b7f5[_0xa9ad('0x31')][_0xa9ad('0x35')]));_0x321401[_0xa9ad('0x34')]=_0x321401[_0xa9ad('0x34')][_0xa9ad('0x36')]?_0x321401[_0xa9ad('0x34')]:_0x358ea7['model'];_0x321401[_0xa9ad('0x51')]=qs[_0xa9ad('0x38')](_0x48b7f5[_0xa9ad('0x31')][_0xa9ad('0x38')]);_0x321401[_0xa9ad('0x39')]=qs[_0xa9ad('0x3a')](_['pick'](_0x48b7f5[_0xa9ad('0x31')],_0x358ea7[_0xa9ad('0x3a')]));if(_0x48b7f5['query'][_0xa9ad('0x3b')]){_0x321401[_0xa9ad('0x39')]=_['merge'](_0x321401['where'],{'$or':_['map'](_0x321401[_0xa9ad('0x34')],function(_0x687bce){var _0x110c68={};_0x110c68[_0x687bce]={'$like':'%'+_0x48b7f5[_0xa9ad('0x31')][_0xa9ad('0x3b')]+'%'};return _0x110c68;})});}_0x321401=_[_0xa9ad('0x3c')]({},_0x321401,_0x48b7f5['options']);return _0x10ab7c[_0xa9ad('0x50')](_0x321401);}})[_0xa9ad('0x28')](function(_0x435a73){if(_0x435a73){_0x401ccd=_0x435a73['length'];if(!_0x48b7f5['query'][_0xa9ad('0x37')]('nolimit')){_0x321401['limit']=qs[_0xa9ad('0x21')](_0x48b7f5[_0xa9ad('0x31')]['limit']);_0x321401[_0xa9ad('0x1f')]=qs['offset'](_0x48b7f5[_0xa9ad('0x31')][_0xa9ad('0x1f')]);}return _0x10ab7c[_0xa9ad('0x50')](_0x321401);}})[_0xa9ad('0x28')](function(_0x30bb5a){if(_0x30bb5a){return _0x30bb5a?{'count':_0x401ccd,'rows':_0x30bb5a}:null;}})['then'](respondWithResult(_0x5ddb6d,null))[_0xa9ad('0x43')](handleError(_0x5ddb6d,null));};exports[_0xa9ad('0x52')]=function(_0x1aea29,_0x5a7b9e,_0x1e95fc){return db['Action'][_0xa9ad('0x48')]({'where':{'id':_0x1aea29[_0xa9ad('0x45')]['id']}})[_0xa9ad('0x28')](handleEntityNotFound(_0x5a7b9e,null))[_0xa9ad('0x28')](function(_0x1b572e){if(_0x1b572e){return _0x1b572e[_0xa9ad('0x52')](_0x1aea29['body'][_0xa9ad('0x4e')],_[_0xa9ad('0x4f')](_0x1aea29['body'],[_0xa9ad('0x4e'),'id'])||{});}})[_0xa9ad('0x28')](respondWithResult(_0x5a7b9e,null))['catch'](handleError(_0x5a7b9e,null));};exports[_0xa9ad('0x53')]=function(_0x51babc,_0x4e651b,_0x1c7767){var _0x53bf8a={};var _0x5625f0={};var _0x5164a7;var _0x1df631;return db[_0xa9ad('0x2e')][_0xa9ad('0x54')]({'where':{'id':_0x51babc[_0xa9ad('0x45')]['id']}})[_0xa9ad('0x28')](handleEntityNotFound(_0x4e651b,null))['then'](function(_0x4a72cd){if(_0x4a72cd){_0x5164a7=_0x4a72cd;_0x5625f0['model']=_[_0xa9ad('0x32')](db[_0xa9ad('0x55')][_0xa9ad('0x46')]);_0x5625f0[_0xa9ad('0x31')]=_[_0xa9ad('0x32')](_0x51babc[_0xa9ad('0x31')]);_0x5625f0[_0xa9ad('0x3a')]=_[_0xa9ad('0x33')](_0x5625f0[_0xa9ad('0x30')],_0x5625f0[_0xa9ad('0x31')]);_0x53bf8a[_0xa9ad('0x34')]=_[_0xa9ad('0x33')](_0x5625f0[_0xa9ad('0x30')],qs['fields'](_0x51babc[_0xa9ad('0x31')]['fields']));_0x53bf8a[_0xa9ad('0x34')]=_0x53bf8a[_0xa9ad('0x34')]['length']?_0x53bf8a[_0xa9ad('0x34')]:_0x5625f0[_0xa9ad('0x30')];_0x53bf8a[_0xa9ad('0x51')]=qs[_0xa9ad('0x38')](_0x51babc['query'][_0xa9ad('0x38')]);_0x53bf8a['where']=qs[_0xa9ad('0x3a')](_[_0xa9ad('0x56')](_0x51babc[_0xa9ad('0x31')],_0x5625f0[_0xa9ad('0x3a')]));if(_0x51babc['query'][_0xa9ad('0x3b')]){_0x53bf8a['where']=_[_0xa9ad('0x3c')](_0x53bf8a[_0xa9ad('0x39')],{'$or':_[_0xa9ad('0x2d')](_0x53bf8a[_0xa9ad('0x34')],function(_0x826f62){var _0x51d21b={};_0x51d21b[_0x826f62]={'$like':'%'+_0x51babc['query'][_0xa9ad('0x3b')]+'%'};return _0x51d21b;})});}_0x53bf8a=_[_0xa9ad('0x3c')]({},_0x53bf8a,_0x51babc[_0xa9ad('0x3f')]);return _0x5164a7['getActions'](_0x53bf8a);}})[_0xa9ad('0x28')](function(_0x13c60c){if(_0x13c60c){_0x1df631=_0x13c60c['length'];if(!_0x51babc[_0xa9ad('0x31')]['hasOwnProperty'](_0xa9ad('0x57'))){_0x53bf8a[_0xa9ad('0x21')]=qs['limit'](_0x51babc[_0xa9ad('0x31')][_0xa9ad('0x21')]);_0x53bf8a[_0xa9ad('0x1f')]=qs[_0xa9ad('0x1f')](_0x51babc[_0xa9ad('0x31')]['offset']);}return _0x5164a7[_0xa9ad('0x53')](_0x53bf8a);}})['then'](function(_0xd4d300){if(_0xd4d300){return _0xd4d300?{'count':_0x1df631,'rows':_0xd4d300}:null;}})[_0xa9ad('0x28')](respondWithResult(_0x4e651b,null))[_0xa9ad('0x43')](handleError(_0x4e651b,null));};
\ No newline at end of file
+var _0xbd66=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','update','Condition','addConditions','ids','getConditions','findOne','rawAttributes','order','addActions','Action','omit','getActions','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','stack','name','send','map','Automation','fieldName','type'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xbd66,0x177));var _0x6bd6=function(_0x55e12b,_0x3bbb99){_0x55e12b=_0x55e12b-0x0;var _0x507b79=_0xbd66[_0x55e12b];return _0x507b79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6bd6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6bd6('0x1'));var moment=require(_0x6bd6('0x2'));var BPromise=require(_0x6bd6('0x3'));var Mustache=require(_0x6bd6('0x4'));var util=require('util');var path=require(_0x6bd6('0x5'));var sox=require(_0x6bd6('0x6'));var csv=require('to-csv');var ejs=require(_0x6bd6('0x7'));var fs=require('fs');var fs_extra=require(_0x6bd6('0x8'));var _=require(_0x6bd6('0x9'));var squel=require(_0x6bd6('0xa'));var crypto=require(_0x6bd6('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6bd6('0xc'));var querystring=require('querystring');var Papa=require(_0x6bd6('0xd'));var Redis=require(_0x6bd6('0xe'));var authService=require(_0x6bd6('0xf'));var qs=require(_0x6bd6('0x10'));var as=require(_0x6bd6('0x11'));var hardwareService=require(_0x6bd6('0x12'));var logger=require(_0x6bd6('0x13'))(_0x6bd6('0x14'));var utils=require(_0x6bd6('0x15'));var config=require(_0x6bd6('0x16'));var licenseUtil=require(_0x6bd6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bccfd,_0x305a90){_0x305a90=_0x305a90||0xcc;return function(_0x1272db){if(_0x1272db){return _0x1bccfd[_0x6bd6('0x18')](_0x305a90);}return _0x1bccfd['status'](_0x305a90)[_0x6bd6('0x19')]();};}function respondWithResult(_0x1f7973,_0x4157ab){_0x4157ab=_0x4157ab||0xc8;return function(_0x3befd3){if(_0x3befd3){return _0x1f7973[_0x6bd6('0x1a')](_0x4157ab)[_0x6bd6('0x1b')](_0x3befd3);}};}function respondWithFilteredResult(_0x3a4b3c,_0x3cfd0f){return function(_0xd1cd14){if(_0xd1cd14){var _0x5a877b=typeof _0x3cfd0f[_0x6bd6('0x1c')]===_0x6bd6('0x1d')&&typeof _0x3cfd0f[_0x6bd6('0x1e')]===_0x6bd6('0x1d');var _0x328cbd=_0xd1cd14[_0x6bd6('0x1f')];var _0x2adb33=_0x5a877b?0x0:_0x3cfd0f[_0x6bd6('0x1c')];var _0x31173b=_0x5a877b?_0xd1cd14['count']:_0x3cfd0f[_0x6bd6('0x1c')]+_0x3cfd0f['limit'];var _0xa31c8f;if(_0x31173b>=_0x328cbd){_0x31173b=_0x328cbd;_0xa31c8f=0xc8;}else{_0xa31c8f=0xce;}_0x3a4b3c['status'](_0xa31c8f);return _0x3a4b3c[_0x6bd6('0x20')](_0x6bd6('0x21'),_0x2adb33+'-'+_0x31173b+'/'+_0x328cbd)['json'](_0xd1cd14);}return null;};}function patchUpdates(_0xbacccf){return function(_0x67243d){try{jsonpatch[_0x6bd6('0x22')](_0x67243d,_0xbacccf,!![]);}catch(_0x47ad83){return BPromise['reject'](_0x47ad83);}return _0x67243d['save']();};}function saveUpdates(_0x8e9b11,_0x16683d){return function(_0x294c09){if(_0x294c09){return _0x294c09['update'](_0x8e9b11)[_0x6bd6('0x23')](function(_0x2eb33e){return _0x2eb33e;});}return null;};}function removeEntity(_0x236fa4,_0x12392e){return function(_0x1dc809){if(_0x1dc809){return _0x1dc809[_0x6bd6('0x24')]()['then'](function(){_0x236fa4['status'](0xcc)[_0x6bd6('0x19')]();});}};}function handleEntityNotFound(_0x3f43d4,_0x4c5d25){return function(_0xcceb51){if(!_0xcceb51){_0x3f43d4[_0x6bd6('0x18')](0x194);}return _0xcceb51;};}function handleError(_0x195c26,_0x2971aa){_0x2971aa=_0x2971aa||0x1f4;return function(_0x34721f){logger[_0x6bd6('0x25')](_0x34721f[_0x6bd6('0x26')]);if(_0x34721f[_0x6bd6('0x27')]){delete _0x34721f[_0x6bd6('0x27')];}_0x195c26['status'](_0x2971aa)[_0x6bd6('0x28')](_0x34721f);};}exports['index']=function(_0x366f12,_0x52a656){var _0x23aa16={},_0x437447={},_0xd657f7={'count':0x0,'rows':[]};var _0x28a608=_[_0x6bd6('0x29')](db[_0x6bd6('0x2a')]['rawAttributes'],function(_0x5c8346){return{'name':_0x5c8346[_0x6bd6('0x2b')],'type':_0x5c8346[_0x6bd6('0x2c')][_0x6bd6('0x2d')]};});_0x437447[_0x6bd6('0x2e')]=_[_0x6bd6('0x29')](_0x28a608,_0x6bd6('0x27'));_0x437447[_0x6bd6('0x2f')]=_[_0x6bd6('0x30')](_0x366f12[_0x6bd6('0x2f')]);_0x437447[_0x6bd6('0x31')]=_[_0x6bd6('0x32')](_0x437447[_0x6bd6('0x2e')],_0x437447[_0x6bd6('0x2f')]);_0x23aa16[_0x6bd6('0x33')]=_['intersection'](_0x437447[_0x6bd6('0x2e')],qs['fields'](_0x366f12[_0x6bd6('0x2f')][_0x6bd6('0x34')]));_0x23aa16[_0x6bd6('0x33')]=_0x23aa16['attributes'][_0x6bd6('0x35')]?_0x23aa16['attributes']:_0x437447[_0x6bd6('0x2e')];if(!_0x366f12[_0x6bd6('0x2f')][_0x6bd6('0x36')](_0x6bd6('0x37'))){_0x23aa16[_0x6bd6('0x1e')]=qs[_0x6bd6('0x1e')](_0x366f12[_0x6bd6('0x2f')]['limit']);_0x23aa16[_0x6bd6('0x1c')]=qs[_0x6bd6('0x1c')](_0x366f12[_0x6bd6('0x2f')][_0x6bd6('0x1c')]);}_0x23aa16['order']=qs['sort'](_0x366f12[_0x6bd6('0x2f')][_0x6bd6('0x38')]);_0x23aa16[_0x6bd6('0x39')]=qs['filters'](_[_0x6bd6('0x3a')](_0x366f12[_0x6bd6('0x2f')],_0x437447[_0x6bd6('0x31')]),_0x28a608);if(_0x366f12[_0x6bd6('0x2f')][_0x6bd6('0x3b')]){_0x23aa16[_0x6bd6('0x39')]=_[_0x6bd6('0x3c')](_0x23aa16[_0x6bd6('0x39')],{'$or':_['map'](_0x28a608,function(_0x355946){if(_0x355946[_0x6bd6('0x2c')]!=='VIRTUAL'){var _0x91849e={};_0x91849e[_0x355946[_0x6bd6('0x27')]]={'$like':'%'+_0x366f12[_0x6bd6('0x2f')][_0x6bd6('0x3b')]+'%'};return _0x91849e;}})});}_0x23aa16=_[_0x6bd6('0x3c')]({},_0x23aa16,_0x366f12[_0x6bd6('0x3d')]);var _0x56ab41={'where':_0x23aa16[_0x6bd6('0x39')]};return db[_0x6bd6('0x2a')][_0x6bd6('0x1f')](_0x56ab41)[_0x6bd6('0x23')](function(_0x1bf5ba){_0xd657f7[_0x6bd6('0x1f')]=_0x1bf5ba;if(_0x366f12[_0x6bd6('0x2f')]['includeAll']){_0x23aa16[_0x6bd6('0x3e')]=[{'all':!![]}];}return db[_0x6bd6('0x2a')][_0x6bd6('0x3f')](_0x23aa16);})['then'](function(_0x2b3ac8){_0xd657f7[_0x6bd6('0x40')]=_0x2b3ac8;return _0xd657f7;})[_0x6bd6('0x23')](respondWithFilteredResult(_0x52a656,_0x23aa16))['catch'](handleError(_0x52a656,null));};exports[_0x6bd6('0x41')]=function(_0x98f6f0,_0x1b67ea){var _0x67ccaa={'raw':![],'where':{'id':_0x98f6f0[_0x6bd6('0x42')]['id']}},_0xb118fb={};_0xb118fb[_0x6bd6('0x2e')]=_['keys'](db[_0x6bd6('0x2a')]['rawAttributes']);_0xb118fb['query']=_[_0x6bd6('0x30')](_0x98f6f0[_0x6bd6('0x2f')]);_0xb118fb[_0x6bd6('0x31')]=_[_0x6bd6('0x32')](_0xb118fb['model'],_0xb118fb['query']);_0x67ccaa[_0x6bd6('0x33')]=_[_0x6bd6('0x32')](_0xb118fb[_0x6bd6('0x2e')],qs[_0x6bd6('0x34')](_0x98f6f0[_0x6bd6('0x2f')]['fields']));_0x67ccaa[_0x6bd6('0x33')]=_0x67ccaa[_0x6bd6('0x33')]['length']?_0x67ccaa[_0x6bd6('0x33')]:_0xb118fb['model'];if(_0x98f6f0[_0x6bd6('0x2f')][_0x6bd6('0x43')]){_0x67ccaa[_0x6bd6('0x3e')]=[{'all':!![]}];}_0x67ccaa=_[_0x6bd6('0x3c')]({},_0x67ccaa,_0x98f6f0['options']);return db[_0x6bd6('0x2a')][_0x6bd6('0x44')](_0x67ccaa)[_0x6bd6('0x23')](handleEntityNotFound(_0x1b67ea,null))[_0x6bd6('0x23')](respondWithResult(_0x1b67ea,null))[_0x6bd6('0x45')](handleError(_0x1b67ea,null));};exports['create']=function(_0x36f23b,_0x8cbe){return db[_0x6bd6('0x2a')][_0x6bd6('0x46')](_0x36f23b[_0x6bd6('0x47')],{})[_0x6bd6('0x23')](respondWithResult(_0x8cbe,0xc9))['catch'](handleError(_0x8cbe,null));};exports[_0x6bd6('0x48')]=function(_0x36226b,_0x4aee5e){if(_0x36226b[_0x6bd6('0x47')]['id']){delete _0x36226b[_0x6bd6('0x47')]['id'];}return db[_0x6bd6('0x2a')][_0x6bd6('0x44')]({'where':{'id':_0x36226b['params']['id']}})['then'](handleEntityNotFound(_0x4aee5e,null))['then'](saveUpdates(_0x36226b[_0x6bd6('0x47')],null))[_0x6bd6('0x23')](respondWithResult(_0x4aee5e,null))['catch'](handleError(_0x4aee5e,null));};exports[_0x6bd6('0x24')]=function(_0x114aad,_0x521042){return db['Automation']['find']({'where':{'id':_0x114aad[_0x6bd6('0x42')]['id']}})[_0x6bd6('0x23')](handleEntityNotFound(_0x521042,null))[_0x6bd6('0x23')](removeEntity(_0x521042,null))[_0x6bd6('0x45')](handleError(_0x521042,null));};exports['addConditions']=function(_0x16d0f8,_0x5e8fb6,_0x36d4c6){return db[_0x6bd6('0x49')][_0x6bd6('0x44')]({'where':{'id':_0x16d0f8[_0x6bd6('0x42')]['id']}})[_0x6bd6('0x23')](handleEntityNotFound(_0x5e8fb6,null))['then'](function(_0x495aba){if(_0x495aba){return _0x495aba[_0x6bd6('0x4a')](_0x16d0f8['body'][_0x6bd6('0x4b')],_['omit'](_0x16d0f8[_0x6bd6('0x47')],[_0x6bd6('0x4b'),'id'])||{});}})[_0x6bd6('0x23')](respondWithResult(_0x5e8fb6,null))[_0x6bd6('0x45')](handleError(_0x5e8fb6,null));};exports[_0x6bd6('0x4c')]=function(_0x4fd146,_0xe540a1,_0x5335a4){var _0x18db85={};var _0x21ddbc={};var _0x2dbbb1;var _0x2af209;return db['Automation'][_0x6bd6('0x4d')]({'where':{'id':_0x4fd146['params']['id']}})[_0x6bd6('0x23')](handleEntityNotFound(_0xe540a1,null))[_0x6bd6('0x23')](function(_0x400aa6){if(_0x400aa6){_0x2dbbb1=_0x400aa6;_0x21ddbc[_0x6bd6('0x2e')]=_[_0x6bd6('0x30')](db['Condition'][_0x6bd6('0x4e')]);_0x21ddbc[_0x6bd6('0x2f')]=_[_0x6bd6('0x30')](_0x4fd146[_0x6bd6('0x2f')]);_0x21ddbc['filters']=_[_0x6bd6('0x32')](_0x21ddbc[_0x6bd6('0x2e')],_0x21ddbc[_0x6bd6('0x2f')]);_0x18db85[_0x6bd6('0x33')]=_[_0x6bd6('0x32')](_0x21ddbc[_0x6bd6('0x2e')],qs[_0x6bd6('0x34')](_0x4fd146[_0x6bd6('0x2f')][_0x6bd6('0x34')]));_0x18db85['attributes']=_0x18db85[_0x6bd6('0x33')][_0x6bd6('0x35')]?_0x18db85[_0x6bd6('0x33')]:_0x21ddbc[_0x6bd6('0x2e')];_0x18db85[_0x6bd6('0x4f')]=qs[_0x6bd6('0x38')](_0x4fd146[_0x6bd6('0x2f')][_0x6bd6('0x38')]);_0x18db85['where']=qs[_0x6bd6('0x31')](_[_0x6bd6('0x3a')](_0x4fd146[_0x6bd6('0x2f')],_0x21ddbc[_0x6bd6('0x31')]));if(_0x4fd146['query'][_0x6bd6('0x3b')]){_0x18db85[_0x6bd6('0x39')]=_[_0x6bd6('0x3c')](_0x18db85['where'],{'$or':_[_0x6bd6('0x29')](_0x18db85[_0x6bd6('0x33')],function(_0x53f2a6){var _0x39b60b={};_0x39b60b[_0x53f2a6]={'$like':'%'+_0x4fd146[_0x6bd6('0x2f')][_0x6bd6('0x3b')]+'%'};return _0x39b60b;})});}_0x18db85=_[_0x6bd6('0x3c')]({},_0x18db85,_0x4fd146[_0x6bd6('0x3d')]);return _0x2dbbb1[_0x6bd6('0x4c')](_0x18db85);}})['then'](function(_0x3a82d0){if(_0x3a82d0){_0x2af209=_0x3a82d0[_0x6bd6('0x35')];if(!_0x4fd146[_0x6bd6('0x2f')][_0x6bd6('0x36')](_0x6bd6('0x37'))){_0x18db85['limit']=qs[_0x6bd6('0x1e')](_0x4fd146[_0x6bd6('0x2f')][_0x6bd6('0x1e')]);_0x18db85[_0x6bd6('0x1c')]=qs[_0x6bd6('0x1c')](_0x4fd146[_0x6bd6('0x2f')][_0x6bd6('0x1c')]);}return _0x2dbbb1['getConditions'](_0x18db85);}})['then'](function(_0x2002af){if(_0x2002af){return _0x2002af?{'count':_0x2af209,'rows':_0x2002af}:null;}})[_0x6bd6('0x23')](respondWithResult(_0xe540a1,null))[_0x6bd6('0x45')](handleError(_0xe540a1,null));};exports[_0x6bd6('0x50')]=function(_0x2602ee,_0x15503b,_0x30b2c2){return db[_0x6bd6('0x51')][_0x6bd6('0x44')]({'where':{'id':_0x2602ee[_0x6bd6('0x42')]['id']}})[_0x6bd6('0x23')](handleEntityNotFound(_0x15503b,null))[_0x6bd6('0x23')](function(_0x201c92){if(_0x201c92){return _0x201c92['addActions'](_0x2602ee[_0x6bd6('0x47')][_0x6bd6('0x4b')],_[_0x6bd6('0x52')](_0x2602ee[_0x6bd6('0x47')],[_0x6bd6('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x15503b,null))[_0x6bd6('0x45')](handleError(_0x15503b,null));};exports[_0x6bd6('0x53')]=function(_0x10ae88,_0xeb87ed,_0x571467){var _0x38cb96={};var _0x3bb52d={};var _0x1a2d93;var _0x252f13;return db[_0x6bd6('0x2a')]['findOne']({'where':{'id':_0x10ae88[_0x6bd6('0x42')]['id']}})[_0x6bd6('0x23')](handleEntityNotFound(_0xeb87ed,null))[_0x6bd6('0x23')](function(_0x3706da){if(_0x3706da){_0x1a2d93=_0x3706da;_0x3bb52d[_0x6bd6('0x2e')]=_[_0x6bd6('0x30')](db[_0x6bd6('0x51')][_0x6bd6('0x4e')]);_0x3bb52d[_0x6bd6('0x2f')]=_[_0x6bd6('0x30')](_0x10ae88['query']);_0x3bb52d[_0x6bd6('0x31')]=_[_0x6bd6('0x32')](_0x3bb52d[_0x6bd6('0x2e')],_0x3bb52d[_0x6bd6('0x2f')]);_0x38cb96[_0x6bd6('0x33')]=_[_0x6bd6('0x32')](_0x3bb52d['model'],qs[_0x6bd6('0x34')](_0x10ae88['query'][_0x6bd6('0x34')]));_0x38cb96['attributes']=_0x38cb96[_0x6bd6('0x33')][_0x6bd6('0x35')]?_0x38cb96['attributes']:_0x3bb52d['model'];_0x38cb96['order']=qs[_0x6bd6('0x38')](_0x10ae88[_0x6bd6('0x2f')][_0x6bd6('0x38')]);_0x38cb96[_0x6bd6('0x39')]=qs[_0x6bd6('0x31')](_[_0x6bd6('0x3a')](_0x10ae88[_0x6bd6('0x2f')],_0x3bb52d['filters']));if(_0x10ae88['query']['filter']){_0x38cb96[_0x6bd6('0x39')]=_['merge'](_0x38cb96['where'],{'$or':_[_0x6bd6('0x29')](_0x38cb96[_0x6bd6('0x33')],function(_0x43c648){var _0x519671={};_0x519671[_0x43c648]={'$like':'%'+_0x10ae88[_0x6bd6('0x2f')][_0x6bd6('0x3b')]+'%'};return _0x519671;})});}_0x38cb96=_[_0x6bd6('0x3c')]({},_0x38cb96,_0x10ae88[_0x6bd6('0x3d')]);return _0x1a2d93['getActions'](_0x38cb96);}})[_0x6bd6('0x23')](function(_0x441f04){if(_0x441f04){_0x252f13=_0x441f04[_0x6bd6('0x35')];if(!_0x10ae88[_0x6bd6('0x2f')][_0x6bd6('0x36')](_0x6bd6('0x37'))){_0x38cb96[_0x6bd6('0x1e')]=qs['limit'](_0x10ae88['query'][_0x6bd6('0x1e')]);_0x38cb96['offset']=qs[_0x6bd6('0x1c')](_0x10ae88[_0x6bd6('0x2f')][_0x6bd6('0x1c')]);}return _0x1a2d93[_0x6bd6('0x53')](_0x38cb96);}})[_0x6bd6('0x23')](function(_0x2f7303){if(_0x2f7303){return _0x2f7303?{'count':_0x252f13,'rows':_0x2f7303}:null;}})[_0x6bd6('0x23')](respondWithResult(_0xeb87ed,null))[_0x6bd6('0x45')](handleError(_0xeb87ed,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index f617eb0..4ee136b 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 _0x2aa9=['rimraf','../../config/environment','./automation.attributes','exports','define','tools_automations','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x1778e1,_0x3e1727){var _0x2bc4c6=function(_0x359c65){while(--_0x359c65){_0x1778e1['push'](_0x1778e1['shift']());}};_0x2bc4c6(++_0x3e1727);}(_0x2aa9,0x117));var _0x92aa=function(_0x525596,_0x64e4a8){_0x525596=_0x525596-0x0;var _0x5c6fb1=_0x2aa9[_0x525596];return _0x5c6fb1;};'use strict';var _=require(_0x92aa('0x0'));var util=require(_0x92aa('0x1'));var logger=require('../../config/logger')(_0x92aa('0x2'));var moment=require(_0x92aa('0x3'));var BPromise=require(_0x92aa('0x4'));var rp=require(_0x92aa('0x5'));var fs=require('fs');var path=require(_0x92aa('0x6'));var rimraf=require(_0x92aa('0x7'));var config=require(_0x92aa('0x8'));var attributes=require(_0x92aa('0x9'));module[_0x92aa('0xa')]=function(_0x1bb2e3,_0x3103c6){return _0x1bb2e3[_0x92aa('0xb')]('Automation',attributes,{'tableName':_0x92aa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4686=['rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','../../config/logger','api','bluebird','path'];(function(_0x2c924f,_0x46d106){var _0x483508=function(_0x528609){while(--_0x528609){_0x2c924f['push'](_0x2c924f['shift']());}};_0x483508(++_0x46d106);}(_0x4686,0x171));var _0x6468=function(_0x49d58d,_0x4e0f67){_0x49d58d=_0x49d58d-0x0;var _0x350063=_0x4686[_0x49d58d];return _0x350063;};'use strict';var _=require(_0x6468('0x0'));var util=require('util');var logger=require(_0x6468('0x1'))(_0x6468('0x2'));var moment=require('moment');var BPromise=require(_0x6468('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6468('0x4'));var rimraf=require(_0x6468('0x5'));var config=require('../../config/environment');var attributes=require(_0x6468('0x6'));module[_0x6468('0x7')]=function(_0x48bc9d,_0x50a7c3){return _0x48bc9d[_0x6468('0x8')](_0x6468('0x9'),attributes,{'tableName':_0x6468('0xa'),'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 a91575c..07f4093 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 _0x09df=['rpc','../../config/environment','request','then','info','request\x20sent','debug','error','code','Automation,\x20%s,\x20%s','message','lodash','util','bluebird','../../mysqldb'];(function(_0x558b60,_0x55ac48){var _0x2dcea6=function(_0x185eb0){while(--_0x185eb0){_0x558b60['push'](_0x558b60['shift']());}};_0x2dcea6(++_0x55ac48);}(_0x09df,0x164));var _0xf09d=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x09df[_0x4ed4d2];return _0x15ae2e;};'use strict';var _=require(_0xf09d('0x0'));var util=require(_0xf09d('0x1'));var moment=require('moment');var BPromise=require(_0xf09d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf09d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf09d('0x4'));var config=require(_0xf09d('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x284a42,_0x48b82f,_0x28c91c){return new BPromise(function(_0x2555c7,_0x2f1810){return client[_0xf09d('0x6')](_0x284a42,_0x28c91c)[_0xf09d('0x7')](function(_0x2a59a8){logger[_0xf09d('0x8')]('Automation,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'));logger[_0xf09d('0xa')]('Automation,\x20%s,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'),JSON['stringify'](_0x2a59a8));if(_0x2a59a8[_0xf09d('0xb')]){if(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xc')]===0x1f4){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2f1810(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);}logger['error'](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2555c7(_0x2a59a8['error']['message']);}else{logger[_0xf09d('0x8')](_0xf09d('0xd'),_0x48b82f,_0xf09d('0x9'));_0x2555c7(_0x2a59a8['result'][_0xf09d('0xe')]);}})['catch'](function(_0x3614f7){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x3614f7);_0x2f1810(_0x3614f7);});});}
\ No newline at end of file
+var _0x20d6=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Automation,\x20%s,\x20%s'];(function(_0x456551,_0x4c9050){var _0x1af692=function(_0x2dabdd){while(--_0x2dabdd){_0x456551['push'](_0x456551['shift']());}};_0x1af692(++_0x4c9050);}(_0x20d6,0x1b8));var _0x620d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x20d6[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x620d('0x0'));var util=require(_0x620d('0x1'));var moment=require(_0x620d('0x2'));var BPromise=require(_0x620d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x620d('0x4'));var db=require(_0x620d('0x5'))['db'];var utils=require(_0x620d('0x6'));var logger=require(_0x620d('0x7'))(_0x620d('0x8'));var config=require(_0x620d('0x9'));var jayson=require(_0x620d('0xa'));var client=jayson[_0x620d('0xb')][_0x620d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3aa4f3,_0x260d43,_0x52657f){return new BPromise(function(_0x3d93af,_0x478aeb){return client['request'](_0x3aa4f3,_0x52657f)[_0x620d('0xd')](function(_0x473790){logger[_0x620d('0xe')](_0x620d('0xf'),_0x260d43,_0x620d('0x10'));logger[_0x620d('0x11')]('Automation,\x20%s,\x20%s,\x20%s',_0x260d43,_0x620d('0x10'),JSON[_0x620d('0x12')](_0x473790));if(_0x473790['error']){if(_0x473790[_0x620d('0x13')][_0x620d('0x14')]===0x1f4){logger[_0x620d('0x13')](_0x620d('0xf'),_0x260d43,_0x473790[_0x620d('0x13')][_0x620d('0x15')]);return _0x478aeb(_0x473790[_0x620d('0x13')][_0x620d('0x15')]);}logger['error'](_0x620d('0xf'),_0x260d43,_0x473790[_0x620d('0x13')][_0x620d('0x15')]);return _0x3d93af(_0x473790[_0x620d('0x13')][_0x620d('0x15')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x260d43,'request\x20sent');_0x3d93af(_0x473790[_0x620d('0x16')]['message']);}})[_0x620d('0x17')](function(_0x20a91e){logger[_0x620d('0x13')](_0x620d('0xf'),_0x260d43,_0x20a91e);_0x478aeb(_0x20a91e);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index b4a3965..891d10e 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 _0x5697=['express','./automation.controller','get','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','put','update','delete','exports','multer','path','connect-timeout'];(function(_0x47d91e,_0x3e5da9){var _0x1be66b=function(_0x3fd2ca){while(--_0x3fd2ca){_0x47d91e['push'](_0x47d91e['shift']());}};_0x1be66b(++_0x3e5da9);}(_0x5697,0x1b5));var _0x7569=function(_0x56b886,_0x1ff474){_0x56b886=_0x56b886-0x0;var _0x164baf=_0x5697[_0x56b886];return _0x164baf;};'use strict';var multer=require(_0x7569('0x0'));var util=require('util');var path=require(_0x7569('0x1'));var timeout=require(_0x7569('0x2'));var express=require(_0x7569('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7569('0x4'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7569('0x5')](_0x7569('0x6'),auth[_0x7569('0x7')](),controller[_0x7569('0x8')]);router[_0x7569('0x5')](_0x7569('0x9'),auth['isAuthenticated'](),controller[_0x7569('0xa')]);router['get'](_0x7569('0xb'),auth[_0x7569('0x7')](),controller[_0x7569('0xc')]);router[_0x7569('0xd')]('/',auth[_0x7569('0x7')](),controller[_0x7569('0xe')]);router[_0x7569('0xd')](_0x7569('0x9'),auth[_0x7569('0x7')](),controller['addConditions']);router[_0x7569('0xd')](_0x7569('0xb'),auth[_0x7569('0x7')](),controller[_0x7569('0xf')]);router[_0x7569('0x10')](_0x7569('0x6'),auth['isAuthenticated'](),controller[_0x7569('0x11')]);router[_0x7569('0x12')](_0x7569('0x6'),auth[_0x7569('0x7')](),controller['destroy']);module[_0x7569('0x13')]=router;
\ No newline at end of file
+var _0x710b=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','getConditions','getActions','post','create','addConditions','/:id/actions','put','update','destroy','multer'];(function(_0x5ee3d4,_0x40da86){var _0x7f69d=function(_0x969be8){while(--_0x969be8){_0x5ee3d4['push'](_0x5ee3d4['shift']());}};_0x7f69d(++_0x40da86);}(_0x710b,0x110));var _0xb710=function(_0x469d01,_0x18c899){_0x469d01=_0x469d01-0x0;var _0x5078d3=_0x710b[_0x469d01];return _0x5078d3;};'use strict';var multer=require(_0xb710('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb710('0x1'));var express=require(_0xb710('0x2'));var router=express[_0xb710('0x3')]();var fs_extra=require(_0xb710('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb710('0x5'));var config=require(_0xb710('0x6'));var controller=require(_0xb710('0x7'));router[_0xb710('0x8')]('/',auth[_0xb710('0x9')](),controller['index']);router[_0xb710('0x8')](_0xb710('0xa'),auth['isAuthenticated'](),controller[_0xb710('0xb')]);router[_0xb710('0x8')]('/:id/conditions',auth[_0xb710('0x9')](),controller[_0xb710('0xc')]);router['get']('/:id/actions',auth[_0xb710('0x9')](),controller[_0xb710('0xd')]);router[_0xb710('0xe')]('/',auth['isAuthenticated'](),controller[_0xb710('0xf')]);router[_0xb710('0xe')]('/:id/conditions',auth[_0xb710('0x9')](),controller[_0xb710('0x10')]);router[_0xb710('0xe')](_0xb710('0x11'),auth[_0xb710('0x9')](),controller['addActions']);router[_0xb710('0x12')](_0xb710('0xa'),auth[_0xb710('0x9')](),controller[_0xb710('0x13')]);router['delete'](_0xb710('0xa'),auth[_0xb710('0x9')](),controller[_0xb710('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index e5e760a..6f9b33e 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 _0xbb29=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','STRING','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x1eac2e,_0x6bce0c){var _0x11dd63=function(_0x24a38f){while(--_0x24a38f){_0x1eac2e['push'](_0x1eac2e['shift']());}};_0x11dd63(++_0x6bce0c);}(_0xbb29,0x6d));var _0x9bb2=function(_0x249ede,_0x13d74a){_0x249ede=_0x249ede-0x0;var _0xa4c823=_0xbb29[_0x249ede];return _0xa4c823;};'use strict';var Sequelize=require(_0x9bb2('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x9bb2('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x9bb2('0x2')](_0x9bb2('0x3')),'allowNull':![],'defaultValue':_0x9bb2('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x9bb2('0x4')],'defaultValue':0x0,'comment':_0x9bb2('0x5')},'limitCalls':{'type':Sequelize[_0x9bb2('0x6')](0x4)[_0x9bb2('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x9bb2('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9bb2('0x9')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9bb2('0x9')]},'dialOriginateTimeout':{'type':Sequelize[_0x9bb2('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x9bb2('0x6')](0x3)[_0x9bb2('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9bb2('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9bb2('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9bb2('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x9bb2('0x6')](0x3)[_0x9bb2('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9bb2('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9bb2('0x6')](0x5)[_0x9bb2('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9bb2('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9bb2('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9bb2('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9bb2('0x6')](0x3)[_0x9bb2('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x9bb2('0x9')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9bb2('0x9')],'defaultValue':_0x9bb2('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x9bb2('0x2')](_0x9bb2('0xf'),_0x9bb2('0x10'),_0x9bb2('0x11')),'defaultValue':_0x9bb2('0xf')},'dialAMDActive':{'type':Sequelize[_0x9bb2('0x4')],'defaultValue':0x0,'comment':_0x9bb2('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x9bb2('0x6')](0x9)[_0x9bb2('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9bb2('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x9bb2('0x6')](0x9)[_0x9bb2('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9bb2('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9bb2('0x6')](0x9)[_0x9bb2('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9bb2('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x9bb2('0x6')](0x9)[_0x9bb2('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9bb2('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9bb2('0x6')](0x9)[_0x9bb2('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9bb2('0x6')](0x9)[_0x9bb2('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9bb2('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9bb2('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9bb2('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x9bb2('0x2')](_0x9bb2('0x19'),'ASC'),'defaultValue':_0x9bb2('0x19')},'dialPrefix':{'type':Sequelize[_0x9bb2('0x9')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9bb2('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9bb2('0x1a')},'dialCutDigit':{'type':Sequelize[_0x9bb2('0x6')](0x3)[_0x9bb2('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9bb2('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9bb2('0x6')](0x3)[_0x9bb2('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9bb2('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9bb2('0x6')](0x5)[_0x9bb2('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9bb2('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x9bb2('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9bb2('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x9bb2('0x6')](0x5)[_0x9bb2('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9bb2('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9bb2('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9bb2('0x6')](0x5)[_0x9bb2('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9bb2('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9bb2('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9bb2('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9bb2('0x6')](0x5)[_0x9bb2('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9bb2('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9bb2('0x6')](0x3)[_0x9bb2('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9bb2('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9bb2('0x23')}};
\ No newline at end of file
+var _0x4240=['#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','UNSIGNED','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\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','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x4240,0x10c));var _0x0424=function(_0x112ed0,_0x737772){_0x112ed0=_0x112ed0-0x0;var _0x197bc7=_0x4240[_0x112ed0];return _0x197bc7;};'use strict';var Sequelize=require('sequelize');module[_0x0424('0x0')]={'name':{'type':Sequelize[_0x0424('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0424('0x2')](_0x0424('0x3')),'allowNull':![],'defaultValue':_0x0424('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0424('0x4')},'limitCalls':{'type':Sequelize[_0x0424('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0424('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0424('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0424('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x0424('0x5')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0424('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0424('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0424('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0424('0x5')](0x5)[_0x0424('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0424('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x0424('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0424('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0424('0x5')](0x5)[_0x0424('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0424('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0424('0x5')](0x3)[_0x0424('0x9')],'defaultValue':0x3,'comment':_0x0424('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0424('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0424('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0424('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0424('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0424('0x1')],'defaultValue':_0x0424('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x0424('0x2')](_0x0424('0x11'),_0x0424('0x12'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x0424('0x13')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0424('0x5')](0x9)[_0x0424('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0424('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x0424('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0424('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0424('0x5')](0x9)[_0x0424('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0424('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0424('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0424('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0424('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0424('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0424('0x5')](0x9)[_0x0424('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0424('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0424('0x5')](0x5)[_0x0424('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0424('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0424('0x5')](0x9)[_0x0424('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0424('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0424('0x2')](_0x0424('0x1c'),_0x0424('0x1d')),'defaultValue':_0x0424('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0424('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0424('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0424('0x5')](0x3)[_0x0424('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0424('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0424('0x5')](0x5)[_0x0424('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0424('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0424('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0424('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x0424('0x5')](0x5)[_0x0424('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0424('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0424('0x5')](0x3)[_0x0424('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0424('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0424('0x5')](0x5)[_0x0424('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0424('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x0424('0x5')](0x3)[_0x0424('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0424('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0424('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0424('0x5')](0x3)[_0x0424('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0424('0x5')](0x5)[_0x0424('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0424('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 5200464..0c2a092 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 _0x1eba=['COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','into','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=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','UserProfileSection','getHoppers','findOne','CmHopper','nolimit','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','select','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final'];(function(_0x24fdf4,_0x171979){var _0xf45e83=function(_0x1c9d98){while(--_0x1c9d98){_0x24fdf4['push'](_0x24fdf4['shift']());}};_0xf45e83(++_0x171979);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x1526e1,_0x5ed5a5){_0x1526e1=_0x1526e1-0x0;var _0x249a1e=_0x1eba[_0x1526e1];return _0x249a1e;};'use strict';var emlformat=require(_0xa1eb('0x0'));var rimraf=require(_0xa1eb('0x1'));var zipdir=require(_0xa1eb('0x2'));var jsonpatch=require(_0xa1eb('0x3'));var rp=require(_0xa1eb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa1eb('0x5'));var util=require(_0xa1eb('0x6'));var path=require(_0xa1eb('0x7'));var sox=require(_0xa1eb('0x8'));var csv=require(_0xa1eb('0x9'));var ejs=require(_0xa1eb('0xa'));var fs=require('fs');var fs_extra=require(_0xa1eb('0xb'));var _=require(_0xa1eb('0xc'));var squel=require(_0xa1eb('0xd'));var crypto=require(_0xa1eb('0xe'));var jsforce=require(_0xa1eb('0xf'));var deskjs=require(_0xa1eb('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa1eb('0x11'));var Papa=require('papaparse');var Redis=require(_0xa1eb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa1eb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1eb('0x14'));var logger=require('../../config/logger')(_0xa1eb('0x15'));var utils=require(_0xa1eb('0x16'));var config=require(_0xa1eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa1eb('0x18'))['db'];function respondWithStatusCode(_0x39b4a3,_0x5df92d){_0x5df92d=_0x5df92d||0xcc;return function(_0x16a623){if(_0x16a623){return _0x39b4a3['sendStatus'](_0x5df92d);}return _0x39b4a3['status'](_0x5df92d)[_0xa1eb('0x19')]();};}function respondWithResult(_0x4c7983,_0x25d058){_0x25d058=_0x25d058||0xc8;return function(_0x2178e2){if(_0x2178e2){return _0x4c7983[_0xa1eb('0x1a')](_0x25d058)[_0xa1eb('0x1b')](_0x2178e2);}};}function respondWithFilteredResult(_0x3cd675,_0x44f37d){return function(_0x1c858c){if(_0x1c858c){var _0x45d6dd=typeof _0x44f37d[_0xa1eb('0x1c')]==='undefined'&&typeof _0x44f37d[_0xa1eb('0x1d')]==='undefined';var _0x1401ef=_0x1c858c[_0xa1eb('0x1e')];var _0x33c4e3=_0x45d6dd?0x0:_0x44f37d[_0xa1eb('0x1c')];var _0x49bfaa=_0x45d6dd?_0x1c858c[_0xa1eb('0x1e')]:_0x44f37d[_0xa1eb('0x1c')]+_0x44f37d[_0xa1eb('0x1d')];var _0xcf45c1;if(_0x49bfaa>=_0x1401ef){_0x49bfaa=_0x1401ef;_0xcf45c1=0xc8;}else{_0xcf45c1=0xce;}_0x3cd675[_0xa1eb('0x1a')](_0xcf45c1);return _0x3cd675[_0xa1eb('0x1f')](_0xa1eb('0x20'),_0x33c4e3+'-'+_0x49bfaa+'/'+_0x1401ef)[_0xa1eb('0x1b')](_0x1c858c);}return null;};}function patchUpdates(_0x4fc14a){return function(_0x137e2c){try{jsonpatch['apply'](_0x137e2c,_0x4fc14a,!![]);}catch(_0x2258d1){return BPromise[_0xa1eb('0x21')](_0x2258d1);}return _0x137e2c[_0xa1eb('0x22')]();};}function saveUpdates(_0x250f99,_0x5e7a34){return function(_0x539634){if(_0x539634){return _0x539634[_0xa1eb('0x23')](_0x250f99)[_0xa1eb('0x24')](function(_0x5b0903){return _0x5b0903;});}return null;};}function removeEntity(_0x437b2a,_0x250728){return function(_0x258d3a){if(_0x258d3a){return _0x258d3a[_0xa1eb('0x25')]()[_0xa1eb('0x24')](function(){var _0x1c59e1=_0x258d3a[_0xa1eb('0x26')]({'plain':!![]});var _0x364b1c=_0xa1eb('0x27');return db[_0xa1eb('0x28')][_0xa1eb('0x25')]({'where':{'type':_0x364b1c,'resourceId':_0x1c59e1['id']}})[_0xa1eb('0x24')](function(){return _0x258d3a;});})['then'](function(){_0x437b2a[_0xa1eb('0x1a')](0xcc)[_0xa1eb('0x19')]();});}};}function handleEntityNotFound(_0x491f37,_0x2680c0){return function(_0x4e2aa7){if(!_0x4e2aa7){_0x491f37[_0xa1eb('0x29')](0x194);}return _0x4e2aa7;};}function handleError(_0x2d31d1,_0x53a890){_0x53a890=_0x53a890||0x1f4;return function(_0x45ff0d){logger[_0xa1eb('0x2a')](_0x45ff0d[_0xa1eb('0x2b')]);if(_0x45ff0d['name']){delete _0x45ff0d[_0xa1eb('0x2c')];}_0x2d31d1[_0xa1eb('0x1a')](_0x53a890)['send'](_0x45ff0d);};}exports[_0xa1eb('0x2d')]=function(_0xb27bf9,_0x401510){var _0x2e281a={},_0x5a6544={},_0x52f9c7={'count':0x0,'rows':[]};var _0x9d49d8=_[_0xa1eb('0x2e')](db[_0xa1eb('0x2f')][_0xa1eb('0x30')],function(_0x383e26){return{'name':_0x383e26[_0xa1eb('0x31')],'type':_0x383e26[_0xa1eb('0x32')][_0xa1eb('0x33')]};});_0x5a6544[_0xa1eb('0x34')]=_[_0xa1eb('0x2e')](_0x9d49d8,_0xa1eb('0x2c'));_0x5a6544['query']=_['keys'](_0xb27bf9[_0xa1eb('0x35')]);_0x5a6544[_0xa1eb('0x36')]=_[_0xa1eb('0x37')](_0x5a6544[_0xa1eb('0x34')],_0x5a6544[_0xa1eb('0x35')]);_0x2e281a['attributes']=_['intersection'](_0x5a6544[_0xa1eb('0x34')],qs[_0xa1eb('0x38')](_0xb27bf9['query']['fields']));_0x2e281a[_0xa1eb('0x39')]=_0x2e281a['attributes'][_0xa1eb('0x3a')]?_0x2e281a['attributes']:_0x5a6544[_0xa1eb('0x34')];if(!_0xb27bf9[_0xa1eb('0x35')][_0xa1eb('0x3b')]('nolimit')){_0x2e281a[_0xa1eb('0x1d')]=qs[_0xa1eb('0x1d')](_0xb27bf9[_0xa1eb('0x35')]['limit']);_0x2e281a[_0xa1eb('0x1c')]=qs[_0xa1eb('0x1c')](_0xb27bf9[_0xa1eb('0x35')][_0xa1eb('0x1c')]);}_0x2e281a[_0xa1eb('0x3c')]=qs['sort'](_0xb27bf9[_0xa1eb('0x35')][_0xa1eb('0x3d')]);_0x2e281a[_0xa1eb('0x3e')]=qs[_0xa1eb('0x36')](_[_0xa1eb('0x3f')](_0xb27bf9[_0xa1eb('0x35')],_0x5a6544[_0xa1eb('0x36')]),_0x9d49d8);if(_0xb27bf9[_0xa1eb('0x35')]['filter']){_0x2e281a[_0xa1eb('0x3e')]=_[_0xa1eb('0x40')](_0x2e281a[_0xa1eb('0x3e')],{'$or':_[_0xa1eb('0x2e')](_0x9d49d8,function(_0x1c390c){if(_0x1c390c['type']!==_0xa1eb('0x41')){var _0x3d28dc={};_0x3d28dc[_0x1c390c[_0xa1eb('0x2c')]]={'$like':'%'+_0xb27bf9['query'][_0xa1eb('0x42')]+'%'};return _0x3d28dc;}})});}_0x2e281a=_[_0xa1eb('0x40')]({},_0x2e281a,_0xb27bf9[_0xa1eb('0x43')]);var _0x13ced7={'where':_0x2e281a[_0xa1eb('0x3e')]};return db[_0xa1eb('0x2f')][_0xa1eb('0x1e')](_0x13ced7)['then'](function(_0x3c8713){_0x52f9c7[_0xa1eb('0x1e')]=_0x3c8713;if(_0xb27bf9['query'][_0xa1eb('0x44')]){_0x2e281a['include']=[{'all':!![]}];}return db[_0xa1eb('0x2f')][_0xa1eb('0x45')](_0x2e281a);})[_0xa1eb('0x24')](function(_0x361675){_0x52f9c7[_0xa1eb('0x46')]=_0x361675;return _0x52f9c7;})[_0xa1eb('0x24')](respondWithFilteredResult(_0x401510,_0x2e281a))[_0xa1eb('0x47')](handleError(_0x401510,null));};exports[_0xa1eb('0x48')]=function(_0x9c297d,_0x44a2de){var _0xd5b217={'raw':![],'where':{'id':_0x9c297d[_0xa1eb('0x49')]['id']}},_0x3c4690={};_0x3c4690[_0xa1eb('0x34')]=_[_0xa1eb('0x4a')](db[_0xa1eb('0x2f')]['rawAttributes']);_0x3c4690[_0xa1eb('0x35')]=_['keys'](_0x9c297d[_0xa1eb('0x35')]);_0x3c4690[_0xa1eb('0x36')]=_['intersection'](_0x3c4690['model'],_0x3c4690[_0xa1eb('0x35')]);_0xd5b217[_0xa1eb('0x39')]=_[_0xa1eb('0x37')](_0x3c4690['model'],qs[_0xa1eb('0x38')](_0x9c297d[_0xa1eb('0x35')][_0xa1eb('0x38')]));_0xd5b217[_0xa1eb('0x39')]=_0xd5b217[_0xa1eb('0x39')][_0xa1eb('0x3a')]?_0xd5b217[_0xa1eb('0x39')]:_0x3c4690[_0xa1eb('0x34')];if(_0x9c297d[_0xa1eb('0x35')][_0xa1eb('0x44')]){_0xd5b217[_0xa1eb('0x4b')]=[{'all':!![]}];}_0xd5b217=_[_0xa1eb('0x40')]({},_0xd5b217,_0x9c297d[_0xa1eb('0x43')]);return db[_0xa1eb('0x2f')]['find'](_0xd5b217)[_0xa1eb('0x24')](handleEntityNotFound(_0x44a2de,null))[_0xa1eb('0x24')](respondWithResult(_0x44a2de,null))[_0xa1eb('0x47')](handleError(_0x44a2de,null));};exports[_0xa1eb('0x4c')]=function(_0x2b0cbf,_0x12dfd4){return db[_0xa1eb('0x2f')]['create'](_0x2b0cbf[_0xa1eb('0x4d')],{})[_0xa1eb('0x24')](function(_0x27021a){var _0x10a6da=_0x2b0cbf[_0xa1eb('0x4e')][_0xa1eb('0x26')]({'plain':!![]});if(!_0x10a6da)throw new Error(_0xa1eb('0x4f'));if(_0x10a6da[_0xa1eb('0x50')]===_0xa1eb('0x4e')){var _0x4f7c05=_0x27021a[_0xa1eb('0x26')]({'plain':!![]});var _0x5c3db1=_0xa1eb('0x27');return db['UserProfileSection'][_0xa1eb('0x51')]({'where':{'name':_0x5c3db1,'userProfileId':_0x10a6da[_0xa1eb('0x52')]},'raw':!![]})[_0xa1eb('0x24')](function(_0x5cc25e){if(_0x5cc25e&&_0x5cc25e[_0xa1eb('0x53')]===0x0){return db[_0xa1eb('0x28')]['create']({'name':_0x4f7c05[_0xa1eb('0x2c')],'resourceId':_0x4f7c05['id'],'type':_0x5cc25e[_0xa1eb('0x2c')],'sectionId':_0x5cc25e['id']},{})[_0xa1eb('0x24')](function(){return _0x27021a;});}else{return _0x27021a;}})[_0xa1eb('0x47')](function(_0x11cc84){logger[_0xa1eb('0x2a')](_0xa1eb('0x54'),_0x11cc84);throw _0x11cc84;});}return _0x27021a;})[_0xa1eb('0x24')](respondWithResult(_0x12dfd4,0xc9))[_0xa1eb('0x47')](handleError(_0x12dfd4,null));};exports[_0xa1eb('0x55')]=function(_0x42519b,_0x4391be){var _0x159a19={'where':{'id':_0x42519b[_0xa1eb('0x49')]['id']}},_0x260c4a={};_0x260c4a[_0xa1eb('0x34')]=_[_0xa1eb('0x4a')](db['Campaign'][_0xa1eb('0x30')]);_0x159a19[_0xa1eb('0x39')]=_[_0xa1eb('0x37')](_0x260c4a[_0xa1eb('0x34')],qs[_0xa1eb('0x38')](_0x42519b[_0xa1eb('0x35')]['fields']));_0x159a19[_0xa1eb('0x39')]=_0x159a19[_0xa1eb('0x39')][_0xa1eb('0x3a')]?_0x159a19[_0xa1eb('0x39')]:_0x260c4a[_0xa1eb('0x34')];if(_0x42519b[_0xa1eb('0x35')][_0xa1eb('0x44')]){_0x159a19['include']=[{'all':!![]}];}_0x159a19=_[_0xa1eb('0x40')]({},_0x159a19,_0x42519b[_0xa1eb('0x43')]);return db[_0xa1eb('0x2f')][_0xa1eb('0x51')](_0x159a19)['then'](handleEntityNotFound(_0x4391be,null))['then'](function(_0x58ca4e){if(_0x58ca4e){var _0x5673fa=_0x58ca4e[_0xa1eb('0x26')]({'plain':!![]});_0x5673fa=qs[_0xa1eb('0x56')](_0x5673fa,['id','createdAt',_0xa1eb('0x57')]);_0x42519b[_0xa1eb('0x4d')]=_[_0xa1eb('0x56')](_0x42519b[_0xa1eb('0x4d')],['id','createdAt','updatedAt']);return db[_0xa1eb('0x2f')][_0xa1eb('0x4c')](_[_0xa1eb('0x40')](_0x5673fa,_0x42519b[_0xa1eb('0x4d')]),{'include':_0x42519b[_0xa1eb('0x35')][_0xa1eb('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x532dfa){var _0x43f223=_0x42519b['user'][_0xa1eb('0x26')]({'plain':!![]});if(!_0x43f223)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x43f223[_0xa1eb('0x50')]===_0xa1eb('0x4e')){var _0x59aee1=_0x532dfa[_0xa1eb('0x26')]({'plain':!![]});var _0xf48372='IvrCampaigns';return db[_0xa1eb('0x58')][_0xa1eb('0x51')]({'where':{'name':_0xf48372,'userProfileId':_0x43f223[_0xa1eb('0x52')]},'raw':!![]})['then'](function(_0x9799d3){if(_0x9799d3&&_0x9799d3[_0xa1eb('0x53')]===0x0){return db['UserProfileResource'][_0xa1eb('0x4c')]({'name':_0x59aee1[_0xa1eb('0x2c')],'resourceId':_0x59aee1['id'],'type':_0x9799d3[_0xa1eb('0x2c')],'sectionId':_0x9799d3['id']},{})['then'](function(){return _0x532dfa;});}else{return _0x532dfa;}})[_0xa1eb('0x47')](function(_0x5aa916){logger[_0xa1eb('0x2a')](_0xa1eb('0x54'),_0x5aa916);throw _0x5aa916;});}return _0x532dfa;});}})[_0xa1eb('0x24')](respondWithResult(_0x4391be,0xc9))[_0xa1eb('0x47')](handleError(_0x4391be,null));};exports[_0xa1eb('0x23')]=function(_0x48f49d,_0x2aba03){if(_0x48f49d[_0xa1eb('0x4d')]['id']){delete _0x48f49d[_0xa1eb('0x4d')]['id'];}return db['Campaign'][_0xa1eb('0x51')]({'where':{'id':_0x48f49d['params']['id']}})['then'](handleEntityNotFound(_0x2aba03,null))['then'](saveUpdates(_0x48f49d['body'],null))[_0xa1eb('0x24')](respondWithResult(_0x2aba03,null))[_0xa1eb('0x47')](handleError(_0x2aba03,null));};exports[_0xa1eb('0x25')]=function(_0x4039de,_0x149de3){return db[_0xa1eb('0x2f')][_0xa1eb('0x51')]({'where':{'id':_0x4039de[_0xa1eb('0x49')]['id']}})[_0xa1eb('0x24')](handleEntityNotFound(_0x149de3,null))[_0xa1eb('0x24')](removeEntity(_0x149de3,null))['catch'](handleError(_0x149de3,null));};exports[_0xa1eb('0x59')]=function(_0x1d1c91,_0x46207c,_0x1f9418){var _0x1a9afe={'raw':!![],'where':{}};var _0x4593f6={};var _0x4bf3c9={'count':0x0,'rows':[]};return db[_0xa1eb('0x2f')][_0xa1eb('0x5a')]({'where':{'id':_0x1d1c91[_0xa1eb('0x49')]['id']}})['then'](handleEntityNotFound(_0x46207c,null))[_0xa1eb('0x24')](function(_0x11a74e){if(_0x11a74e){_0x4593f6[_0xa1eb('0x34')]=_[_0xa1eb('0x4a')](db[_0xa1eb('0x5b')]['rawAttributes']);_0x4593f6[_0xa1eb('0x35')]=_['keys'](_0x1d1c91[_0xa1eb('0x35')]);_0x4593f6['filters']=_[_0xa1eb('0x37')](_0x4593f6[_0xa1eb('0x34')],_0x4593f6[_0xa1eb('0x35')]);_0x1a9afe[_0xa1eb('0x39')]=_['intersection'](_0x4593f6[_0xa1eb('0x34')],qs[_0xa1eb('0x38')](_0x1d1c91[_0xa1eb('0x35')][_0xa1eb('0x38')]));_0x1a9afe['attributes']=_0x1a9afe[_0xa1eb('0x39')][_0xa1eb('0x3a')]?_0x1a9afe[_0xa1eb('0x39')]:_0x4593f6[_0xa1eb('0x34')];if(!_0x1d1c91[_0xa1eb('0x35')][_0xa1eb('0x3b')](_0xa1eb('0x5c'))){_0x1a9afe[_0xa1eb('0x1d')]=qs[_0xa1eb('0x1d')](_0x1d1c91['query']['limit']);_0x1a9afe['offset']=qs[_0xa1eb('0x1c')](_0x1d1c91['query'][_0xa1eb('0x1c')]);}_0x1a9afe[_0xa1eb('0x3c')]=qs['sort'](_0x1d1c91['query'][_0xa1eb('0x3d')]);_0x1a9afe[_0xa1eb('0x3e')]=qs[_0xa1eb('0x36')](_[_0xa1eb('0x3f')](_0x1d1c91[_0xa1eb('0x35')],_0x4593f6['filters']));_0x1a9afe['where'][_0xa1eb('0x5d')]=_0x11a74e['id'];if(_0x1d1c91[_0xa1eb('0x35')][_0xa1eb('0x42')]){_0x1a9afe[_0xa1eb('0x3e')]=_['merge'](_0x1a9afe[_0xa1eb('0x3e')],{'$or':_[_0xa1eb('0x2e')](_0x1a9afe[_0xa1eb('0x39')],function(_0x4050d6){var _0x3863ce={};_0x3863ce[_0x4050d6]={'$like':'%'+_0x1d1c91[_0xa1eb('0x35')][_0xa1eb('0x42')]+'%'};return _0x3863ce;})});}_0x1a9afe=_[_0xa1eb('0x40')]({},_0x1a9afe,_0x1d1c91[_0xa1eb('0x43')]);return db[_0xa1eb('0x5b')][_0xa1eb('0x1e')]({'where':_0x1a9afe['where']})[_0xa1eb('0x24')](function(_0x3c027a){_0x4bf3c9[_0xa1eb('0x1e')]=_0x3c027a;if(_0x1d1c91[_0xa1eb('0x35')][_0xa1eb('0x44')]){_0x1a9afe[_0xa1eb('0x4b')]=[{'all':!![]}];}return db['CmHopper'][_0xa1eb('0x45')](_0x1a9afe);})[_0xa1eb('0x24')](function(_0x2ff1fb){_0x4bf3c9[_0xa1eb('0x46')]=_0x2ff1fb;return _0x4bf3c9;});}})['then'](respondWithFilteredResult(_0x46207c,_0x1a9afe))['catch'](handleError(_0x46207c,null));};exports[_0xa1eb('0x5e')]=function(_0x5e0cd5,_0x2bd903,_0x2ca83a){var _0x518261={'raw':!![],'where':{}};var _0x2f9822={};var _0x1b01f9={'count':0x0,'rows':[]};return db['Campaign'][_0xa1eb('0x5a')]({'where':{'id':_0x5e0cd5[_0xa1eb('0x49')]['id']}})[_0xa1eb('0x24')](handleEntityNotFound(_0x2bd903,null))[_0xa1eb('0x24')](function(_0x3d9034){if(_0x3d9034){_0x2f9822[_0xa1eb('0x34')]=_[_0xa1eb('0x4a')](db[_0xa1eb('0x5f')][_0xa1eb('0x30')]);_0x2f9822[_0xa1eb('0x35')]=_[_0xa1eb('0x4a')](_0x5e0cd5['query']);_0x2f9822[_0xa1eb('0x36')]=_[_0xa1eb('0x37')](_0x2f9822[_0xa1eb('0x34')],_0x2f9822[_0xa1eb('0x35')]);_0x518261['attributes']=_[_0xa1eb('0x37')](_0x2f9822[_0xa1eb('0x34')],qs[_0xa1eb('0x38')](_0x5e0cd5['query'][_0xa1eb('0x38')]));_0x518261[_0xa1eb('0x39')]=_0x518261[_0xa1eb('0x39')]['length']?_0x518261[_0xa1eb('0x39')]:_0x2f9822['model'];if(!_0x5e0cd5[_0xa1eb('0x35')][_0xa1eb('0x3b')](_0xa1eb('0x5c'))){_0x518261[_0xa1eb('0x1d')]=qs[_0xa1eb('0x1d')](_0x5e0cd5[_0xa1eb('0x35')][_0xa1eb('0x1d')]);_0x518261[_0xa1eb('0x1c')]=qs['offset'](_0x5e0cd5[_0xa1eb('0x35')][_0xa1eb('0x1c')]);}_0x518261[_0xa1eb('0x3c')]=qs[_0xa1eb('0x3d')](_0x5e0cd5[_0xa1eb('0x35')]['sort']);_0x518261[_0xa1eb('0x3e')]=qs[_0xa1eb('0x36')](_['pick'](_0x5e0cd5[_0xa1eb('0x35')],_0x2f9822['filters']));_0x518261['where'][_0xa1eb('0x5d')]=_0x3d9034['id'];if(_0x5e0cd5[_0xa1eb('0x35')]['filter']){_0x518261[_0xa1eb('0x3e')]=_[_0xa1eb('0x40')](_0x518261['where'],{'$or':_[_0xa1eb('0x2e')](_0x518261[_0xa1eb('0x39')],function(_0x4d2598){var _0x4d75a8={};_0x4d75a8[_0x4d2598]={'$like':'%'+_0x5e0cd5[_0xa1eb('0x35')]['filter']+'%'};return _0x4d75a8;})});}_0x518261=_[_0xa1eb('0x40')]({},_0x518261,_0x5e0cd5[_0xa1eb('0x43')]);return db[_0xa1eb('0x5f')][_0xa1eb('0x1e')]({'where':_0x518261[_0xa1eb('0x3e')]})[_0xa1eb('0x24')](function(_0x4d589f){_0x1b01f9[_0xa1eb('0x1e')]=_0x4d589f;if(_0x5e0cd5['query'][_0xa1eb('0x44')]){_0x518261[_0xa1eb('0x4b')]=[{'all':!![]}];}return db[_0xa1eb('0x5f')][_0xa1eb('0x45')](_0x518261);})[_0xa1eb('0x24')](function(_0x2e85dd){_0x1b01f9[_0xa1eb('0x46')]=_0x2e85dd;return _0x1b01f9;});}})['then'](respondWithFilteredResult(_0x2bd903,_0x518261))[_0xa1eb('0x47')](handleError(_0x2bd903,null));};exports['getHopperFinals']=function(_0x5594b5,_0x44d29c,_0xd72914){var _0x456ddb={'raw':!![],'where':{}};var _0x559d58={};var _0x14eff1={'count':0x0,'rows':[]};return db[_0xa1eb('0x2f')]['findOne']({'where':{'id':_0x5594b5[_0xa1eb('0x49')]['id']}})['then'](handleEntityNotFound(_0x44d29c,null))[_0xa1eb('0x24')](function(_0x52863d){if(_0x52863d){_0x559d58[_0xa1eb('0x34')]=_[_0xa1eb('0x4a')](db['CmHopperFinal']['rawAttributes']);_0x559d58[_0xa1eb('0x35')]=_[_0xa1eb('0x4a')](_0x5594b5[_0xa1eb('0x35')]);_0x559d58[_0xa1eb('0x36')]=_[_0xa1eb('0x37')](_0x559d58[_0xa1eb('0x34')],_0x559d58[_0xa1eb('0x35')]);_0x456ddb[_0xa1eb('0x39')]=_[_0xa1eb('0x37')](_0x559d58[_0xa1eb('0x34')],qs[_0xa1eb('0x38')](_0x5594b5[_0xa1eb('0x35')][_0xa1eb('0x38')]));_0x456ddb[_0xa1eb('0x39')]=_0x456ddb[_0xa1eb('0x39')]['length']?_0x456ddb[_0xa1eb('0x39')]:_0x559d58[_0xa1eb('0x34')];if(!_0x5594b5['query'][_0xa1eb('0x3b')]('nolimit')){_0x456ddb[_0xa1eb('0x1d')]=qs[_0xa1eb('0x1d')](_0x5594b5[_0xa1eb('0x35')]['limit']);_0x456ddb[_0xa1eb('0x1c')]=qs[_0xa1eb('0x1c')](_0x5594b5[_0xa1eb('0x35')][_0xa1eb('0x1c')]);}_0x456ddb['order']=qs[_0xa1eb('0x3d')](_0x5594b5['query'][_0xa1eb('0x3d')]);_0x456ddb[_0xa1eb('0x3e')]=qs[_0xa1eb('0x36')](_[_0xa1eb('0x3f')](_0x5594b5[_0xa1eb('0x35')],_0x559d58[_0xa1eb('0x36')]));_0x456ddb[_0xa1eb('0x3e')][_0xa1eb('0x5d')]=_0x52863d['id'];if(_0x5594b5['query'][_0xa1eb('0x42')]){_0x456ddb[_0xa1eb('0x3e')]=_[_0xa1eb('0x40')](_0x456ddb[_0xa1eb('0x3e')],{'$or':_[_0xa1eb('0x2e')](_0x456ddb[_0xa1eb('0x39')],function(_0x215d28){var _0x8d8091={};_0x8d8091[_0x215d28]={'$like':'%'+_0x5594b5[_0xa1eb('0x35')][_0xa1eb('0x42')]+'%'};return _0x8d8091;})});}_0x456ddb=_[_0xa1eb('0x40')]({},_0x456ddb,_0x5594b5[_0xa1eb('0x43')]);return db[_0xa1eb('0x60')][_0xa1eb('0x1e')]({'where':_0x456ddb['where']})[_0xa1eb('0x24')](function(_0x1bb3ae){_0x14eff1['count']=_0x1bb3ae;if(_0x5594b5['query'][_0xa1eb('0x44')]){_0x456ddb[_0xa1eb('0x4b')]=[{'all':!![]}];}return db[_0xa1eb('0x60')][_0xa1eb('0x45')](_0x456ddb);})['then'](function(_0x402acb){_0x14eff1['rows']=_0x402acb;return _0x14eff1;});}})[_0xa1eb('0x24')](respondWithFilteredResult(_0x44d29c,_0x456ddb))[_0xa1eb('0x47')](handleError(_0x44d29c,null));};exports[_0xa1eb('0x61')]=function(_0xdb596f,_0x33a90e,_0x36b2df){var _0x33d180={'raw':!![],'where':{}};var _0x47e820={};var _0x4df201={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xdb596f[_0xa1eb('0x49')]['id']}})['then'](handleEntityNotFound(_0x33a90e,null))[_0xa1eb('0x24')](function(_0x2c97f8){if(_0x2c97f8){_0x47e820[_0xa1eb('0x34')]=_[_0xa1eb('0x4a')](db[_0xa1eb('0x62')][_0xa1eb('0x30')]);_0x47e820[_0xa1eb('0x35')]=_[_0xa1eb('0x4a')](_0xdb596f[_0xa1eb('0x35')]);_0x47e820[_0xa1eb('0x36')]=_[_0xa1eb('0x37')](_0x47e820[_0xa1eb('0x34')],_0x47e820[_0xa1eb('0x35')]);_0x33d180[_0xa1eb('0x39')]=_[_0xa1eb('0x37')](_0x47e820['model'],qs[_0xa1eb('0x38')](_0xdb596f['query'][_0xa1eb('0x38')]));_0x33d180[_0xa1eb('0x39')]=_0x33d180['attributes']['length']?_0x33d180[_0xa1eb('0x39')]:_0x47e820[_0xa1eb('0x34')];if(!_0xdb596f[_0xa1eb('0x35')][_0xa1eb('0x3b')](_0xa1eb('0x5c'))){_0x33d180[_0xa1eb('0x1d')]=qs['limit'](_0xdb596f[_0xa1eb('0x35')][_0xa1eb('0x1d')]);_0x33d180[_0xa1eb('0x1c')]=qs[_0xa1eb('0x1c')](_0xdb596f[_0xa1eb('0x35')][_0xa1eb('0x1c')]);}_0x33d180[_0xa1eb('0x3c')]=qs['sort'](_0xdb596f[_0xa1eb('0x35')][_0xa1eb('0x3d')]);_0x33d180['where']=qs['filters'](_[_0xa1eb('0x3f')](_0xdb596f['query'],_0x47e820['filters']));_0x33d180[_0xa1eb('0x3e')]['CampaignId']=_0x2c97f8['id'];if(_0xdb596f[_0xa1eb('0x35')][_0xa1eb('0x42')]){_0x33d180['where']=_[_0xa1eb('0x40')](_0x33d180[_0xa1eb('0x3e')],{'$or':_[_0xa1eb('0x2e')](_0x33d180[_0xa1eb('0x39')],function(_0x4f535b){var _0x21b450={};_0x21b450[_0x4f535b]={'$like':'%'+_0xdb596f[_0xa1eb('0x35')][_0xa1eb('0x42')]+'%'};return _0x21b450;})});}_0x33d180=_[_0xa1eb('0x40')]({},_0x33d180,_0xdb596f[_0xa1eb('0x43')]);return db['CmHopperBlack']['count']({'where':_0x33d180['where']})[_0xa1eb('0x24')](function(_0x2ce42f){_0x4df201[_0xa1eb('0x1e')]=_0x2ce42f;if(_0xdb596f[_0xa1eb('0x35')][_0xa1eb('0x44')]){_0x33d180[_0xa1eb('0x4b')]=[{'all':!![]}];}return db[_0xa1eb('0x62')][_0xa1eb('0x45')](_0x33d180);})[_0xa1eb('0x24')](function(_0x34e1ae){_0x4df201[_0xa1eb('0x46')]=_0x34e1ae;return _0x4df201;});}})[_0xa1eb('0x24')](respondWithFilteredResult(_0x33a90e,_0x33d180))[_0xa1eb('0x47')](handleError(_0x33a90e,null));};exports[_0xa1eb('0x63')]=function(_0x16622a,_0x644b33,_0x460abc){var _0x5d78fe={};var _0x33e541={};var _0x14c4c3;var _0x5988ef;return db[_0xa1eb('0x2f')][_0xa1eb('0x5a')]({'where':{'id':_0x16622a[_0xa1eb('0x49')]['id']}})[_0xa1eb('0x24')](handleEntityNotFound(_0x644b33,null))[_0xa1eb('0x24')](function(_0x4d15c6){if(_0x4d15c6){_0x14c4c3=_0x4d15c6;_0x33e541['model']=_[_0xa1eb('0x4a')](db['CmList'][_0xa1eb('0x30')]);_0x33e541[_0xa1eb('0x35')]=_['keys'](_0x16622a['query']);_0x33e541['filters']=_[_0xa1eb('0x37')](_0x33e541['model'],_0x33e541[_0xa1eb('0x35')]);_0x5d78fe[_0xa1eb('0x39')]=_[_0xa1eb('0x37')](_0x33e541[_0xa1eb('0x34')],qs[_0xa1eb('0x38')](_0x16622a[_0xa1eb('0x35')][_0xa1eb('0x38')]));_0x5d78fe['attributes']=_0x5d78fe[_0xa1eb('0x39')][_0xa1eb('0x3a')]?_0x5d78fe[_0xa1eb('0x39')]:_0x33e541['model'];_0x5d78fe['order']=qs[_0xa1eb('0x3d')](_0x16622a[_0xa1eb('0x35')][_0xa1eb('0x3d')]);_0x5d78fe[_0xa1eb('0x3e')]=qs[_0xa1eb('0x36')](_['pick'](_0x16622a[_0xa1eb('0x35')],_0x33e541['filters']));if(_0x16622a[_0xa1eb('0x35')][_0xa1eb('0x42')]){_0x5d78fe[_0xa1eb('0x3e')]=_[_0xa1eb('0x40')](_0x5d78fe['where'],{'$or':_[_0xa1eb('0x2e')](_0x5d78fe[_0xa1eb('0x39')],function(_0x35e0f5){var _0x45f906={};_0x45f906[_0x35e0f5]={'$like':'%'+_0x16622a[_0xa1eb('0x35')]['filter']+'%'};return _0x45f906;})});}_0x5d78fe=_[_0xa1eb('0x40')]({},_0x5d78fe,_0x16622a[_0xa1eb('0x43')]);return _0x14c4c3[_0xa1eb('0x63')](_0x5d78fe);}})['then'](function(_0x13cf02){if(_0x13cf02){_0x5988ef=_0x13cf02[_0xa1eb('0x3a')];if(!_0x16622a['query'][_0xa1eb('0x3b')](_0xa1eb('0x5c'))){_0x5d78fe[_0xa1eb('0x1d')]=qs[_0xa1eb('0x1d')](_0x16622a[_0xa1eb('0x35')][_0xa1eb('0x1d')]);_0x5d78fe[_0xa1eb('0x1c')]=qs[_0xa1eb('0x1c')](_0x16622a[_0xa1eb('0x35')]['offset']);}return _0x14c4c3[_0xa1eb('0x63')](_0x5d78fe);}})[_0xa1eb('0x24')](function(_0x188f2f){if(_0x188f2f){return _0x188f2f?{'count':_0x5988ef,'rows':_0x188f2f}:null;}})[_0xa1eb('0x24')](respondWithResult(_0x644b33,null))[_0xa1eb('0x47')](handleError(_0x644b33,null));};exports[_0xa1eb('0x64')]=function(_0x1c08f3,_0x57b29c,_0x450f96){var _0x5c8665,_0x509bdd;var _0x9b8e68=[];var _0x107c29=moment()[_0xa1eb('0x65')](_0xa1eb('0x66'));return db['Campaign']['find']({'where':{'id':_0x1c08f3[_0xa1eb('0x49')]['id']}})[_0xa1eb('0x24')](handleEntityNotFound(_0x57b29c,null))[_0xa1eb('0x24')](function(_0x238508){if(_0x238508){_0x509bdd=_0x238508;return _0x238508[_0xa1eb('0x64')](_0x1c08f3[_0xa1eb('0x4d')][_0xa1eb('0x67')],_['omit'](_0x1c08f3[_0xa1eb('0x4d')],['ids','id'])||{});}return null;})[_0xa1eb('0x68')](function(_0x53b5bc){var _0x7a2630;var _0x262ff1;_0x5c8665=_0x53b5bc||[];var _0x1c9a2b=[];if(_0x53b5bc){for(var _0x1a63a1=0x0;_0x1a63a1<_0x53b5bc[_0xa1eb('0x3a')];_0x1a63a1+=0x1){var _0x23f7d5=_0x53b5bc[_0x1a63a1][_0xa1eb('0x26')]({'plain':!![]});_0x509bdd[_0xa1eb('0x69')]=_0x1c08f3[_0xa1eb('0x4d')][_0xa1eb('0x69')]?_0x1c08f3[_0xa1eb('0x4d')]['dialCheckDuplicateType']:_0x509bdd[_0xa1eb('0x69')];switch(_0x509bdd[_0xa1eb('0x69')]){case _0xa1eb('0x6a'):_0x7a2630=squel[_0xa1eb('0x6b')]()['into'](_0xa1eb('0x6c'))[_0xa1eb('0x6d')]([_0xa1eb('0x6e'),_0xa1eb('0x6f'),_0xa1eb('0x70'),_0xa1eb('0x71'),'CampaignId',_0xa1eb('0x72'),_0xa1eb('0x57')],squel[_0xa1eb('0x73')]()[_0xa1eb('0x74')]('phone',_0xa1eb('0x6e'))[_0xa1eb('0x74')](_0xa1eb('0x75'),'scheduledAt')['field']('id',_0xa1eb('0x70'))[_0xa1eb('0x74')](_0x23f7d5[_0xa1eb('0x76')][_0xa1eb('0x77')](),_0xa1eb('0x71'))[_0xa1eb('0x74')](_0x1c08f3[_0xa1eb('0x49')]['id'][_0xa1eb('0x77')](),_0xa1eb('0x5d'))[_0xa1eb('0x74')]('\x27'+_0x107c29+'\x27','createdAt')[_0xa1eb('0x74')]('\x27'+_0x107c29+'\x27',_0xa1eb('0x57'))[_0xa1eb('0x78')]('cm_contacts')[_0xa1eb('0x3e')](_0xa1eb('0x79'))[_0xa1eb('0x3e')](_0xa1eb('0x7a'),_0x23f7d5[_0xa1eb('0x76')][_0xa1eb('0x77')]())[_0xa1eb('0x3e')](_0xa1eb('0x7b'))[_0xa1eb('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa1eb('0x73')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0xa1eb('0x78')](_0xa1eb('0x7c'))[_0xa1eb('0x3e')]('CampaignId\x20=\x20?',_0x1c08f3['params']['id'][_0xa1eb('0x77')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xa1eb('0x74')](_0xa1eb('0x7d'))['from'](_0xa1eb('0x6c'))['where'](_0xa1eb('0x7e'),_0x1c08f3[_0xa1eb('0x49')]['id']['toString']())))[_0xa1eb('0x77')]();break;case'onlyIfOpen':_0x7a2630=squel[_0xa1eb('0x6b')]()[_0xa1eb('0x7f')](_0xa1eb('0x6c'))[_0xa1eb('0x6d')](['phone',_0xa1eb('0x6f'),_0xa1eb('0x70'),_0xa1eb('0x71'),'CampaignId',_0xa1eb('0x72'),_0xa1eb('0x57')],squel['select']()['field']('phone',_0xa1eb('0x6e'))[_0xa1eb('0x74')]('NOW()',_0xa1eb('0x6f'))[_0xa1eb('0x74')]('id',_0xa1eb('0x70'))['field'](_0x23f7d5[_0xa1eb('0x76')][_0xa1eb('0x77')](),'ListId')[_0xa1eb('0x74')](_0x1c08f3[_0xa1eb('0x49')]['id'][_0xa1eb('0x77')](),_0xa1eb('0x5d'))[_0xa1eb('0x74')]('\x27'+_0x107c29+'\x27',_0xa1eb('0x72'))[_0xa1eb('0x74')]('\x27'+_0x107c29+'\x27',_0xa1eb('0x57'))[_0xa1eb('0x78')](_0xa1eb('0x80'))[_0xa1eb('0x3e')](_0xa1eb('0x79'))[_0xa1eb('0x3e')](_0xa1eb('0x7a'),_0x23f7d5[_0xa1eb('0x76')]['toString']())[_0xa1eb('0x3e')](_0xa1eb('0x7b'))[_0xa1eb('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa1eb('0x73')]()[_0xa1eb('0x74')]('COALESCE(phone,\x27\x27)')[_0xa1eb('0x78')](_0xa1eb('0x6c'))[_0xa1eb('0x3e')](_0xa1eb('0x7e'),_0x1c08f3[_0xa1eb('0x49')]['id'][_0xa1eb('0x77')]())))[_0xa1eb('0x77')]();break;default:_0x7a2630=squel[_0xa1eb('0x6b')]()[_0xa1eb('0x7f')](_0xa1eb('0x6c'))['fromQuery'](['phone',_0xa1eb('0x6f'),_0xa1eb('0x70'),_0xa1eb('0x71'),'CampaignId',_0xa1eb('0x72'),_0xa1eb('0x57')],squel[_0xa1eb('0x73')]()[_0xa1eb('0x74')](_0xa1eb('0x6e'),_0xa1eb('0x6e'))[_0xa1eb('0x74')](_0xa1eb('0x75'),_0xa1eb('0x6f'))[_0xa1eb('0x74')]('id','ContactId')['field'](_0x23f7d5['CmListId'][_0xa1eb('0x77')](),_0xa1eb('0x71'))[_0xa1eb('0x74')](_0x1c08f3[_0xa1eb('0x49')]['id'][_0xa1eb('0x77')](),_0xa1eb('0x5d'))[_0xa1eb('0x74')]('\x27'+_0x107c29+'\x27',_0xa1eb('0x72'))[_0xa1eb('0x74')]('\x27'+_0x107c29+'\x27',_0xa1eb('0x57'))[_0xa1eb('0x78')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xa1eb('0x3e')](_0xa1eb('0x7a'),_0x23f7d5[_0xa1eb('0x76')]['toString']())[_0xa1eb('0x3e')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x262ff1=squel[_0xa1eb('0x6b')]()[_0xa1eb('0x7f')](_0xa1eb('0x81'))[_0xa1eb('0x6d')]([_0xa1eb('0x82'),_0xa1eb('0x6f'),_0xa1eb('0x6e'),_0xa1eb('0x83'),_0xa1eb('0x72'),_0xa1eb('0x57')],squel['select']()['field'](_0xa1eb('0x84'),'id')[_0xa1eb('0x74')](_0xa1eb('0x75'),'scheduledAt')[_0xa1eb('0x74')](_0xa1eb('0x85'),_0xa1eb('0x6e'))[_0xa1eb('0x74')](_0xa1eb('0x86'),_0xa1eb('0x83'))[_0xa1eb('0x74')]('\x27'+_0x107c29+'\x27','createdAt')[_0xa1eb('0x74')]('\x27'+_0x107c29+'\x27',_0xa1eb('0x57'))[_0xa1eb('0x78')](_0xa1eb('0x87'),'ci')['join'](_0xa1eb('0x6c'),'h',_0xa1eb('0x88'))[_0xa1eb('0x3e')](_0xa1eb('0x89'),_0x23f7d5['CmListId'][_0xa1eb('0x77')]())['where'](_0xa1eb('0x8a'),_0x1c08f3[_0xa1eb('0x49')]['id']['toString']())['where'](_0xa1eb('0x8b'),_0x107c29))['toString']();_0x1c9a2b[_0xa1eb('0x8c')](db[_0xa1eb('0x8d')][_0xa1eb('0x35')](_0x7a2630));_0x9b8e68['push'](db[_0xa1eb('0x8d')][_0xa1eb('0x35')](_0x262ff1));}return BPromise['all'](_0x1c9a2b);}})['then'](function(){return BPromise[_0xa1eb('0x8e')](_0x9b8e68);})[_0xa1eb('0x24')](function(){return _0x5c8665;})['then'](respondWithResult(_0x57b29c,null))[_0xa1eb('0x47')](handleError(_0x57b29c,null));};exports[_0xa1eb('0x8f')]=function(_0x32ddbb,_0x14f9e1,_0x479ea4){return db[_0xa1eb('0x2f')]['find']({'where':{'id':_0x32ddbb[_0xa1eb('0x49')]['id']}})['then'](handleEntityNotFound(_0x14f9e1,null))[_0xa1eb('0x24')](function(_0x3307ca){if(_0x3307ca){return _0x3307ca[_0xa1eb('0x8f')](_0x32ddbb[_0xa1eb('0x35')][_0xa1eb('0x67')]);}})[_0xa1eb('0x24')](function(_0x1ac7ac){if(_0x1ac7ac){return db[_0xa1eb('0x5b')][_0xa1eb('0x25')]({'where':{'ListId':_0x32ddbb[_0xa1eb('0x35')][_0xa1eb('0x67')],'CampaignId':_0x32ddbb['params']['id']}})[_0xa1eb('0x24')](function(){return _0x1ac7ac;});}})[_0xa1eb('0x24')](respondWithStatusCode(_0x14f9e1,null))[_0xa1eb('0x47')](handleError(_0x14f9e1,null));};exports['getBlackLists']=function(_0x1675ae,_0x11661b,_0x3cde48){var _0x34241b={};var _0x5980e8={};var _0x2147f9;var _0x70f16b;return db[_0xa1eb('0x2f')][_0xa1eb('0x5a')]({'where':{'id':_0x1675ae[_0xa1eb('0x49')]['id']}})[_0xa1eb('0x24')](handleEntityNotFound(_0x11661b,null))['then'](function(_0x50c7fb){if(_0x50c7fb){_0x2147f9=_0x50c7fb;_0x5980e8[_0xa1eb('0x34')]=_[_0xa1eb('0x4a')](db[_0xa1eb('0x90')][_0xa1eb('0x30')]);_0x5980e8[_0xa1eb('0x35')]=_['keys'](_0x1675ae[_0xa1eb('0x35')]);_0x5980e8['filters']=_[_0xa1eb('0x37')](_0x5980e8[_0xa1eb('0x34')],_0x5980e8[_0xa1eb('0x35')]);_0x34241b[_0xa1eb('0x39')]=_['intersection'](_0x5980e8[_0xa1eb('0x34')],qs[_0xa1eb('0x38')](_0x1675ae[_0xa1eb('0x35')]['fields']));_0x34241b['attributes']=_0x34241b['attributes'][_0xa1eb('0x3a')]?_0x34241b[_0xa1eb('0x39')]:_0x5980e8['model'];_0x34241b[_0xa1eb('0x3c')]=qs['sort'](_0x1675ae[_0xa1eb('0x35')][_0xa1eb('0x3d')]);_0x34241b[_0xa1eb('0x3e')]=qs[_0xa1eb('0x36')](_[_0xa1eb('0x3f')](_0x1675ae['query'],_0x5980e8[_0xa1eb('0x36')]));if(_0x1675ae[_0xa1eb('0x35')][_0xa1eb('0x42')]){_0x34241b[_0xa1eb('0x3e')]=_[_0xa1eb('0x40')](_0x34241b[_0xa1eb('0x3e')],{'$or':_[_0xa1eb('0x2e')](_0x34241b[_0xa1eb('0x39')],function(_0x3d58f8){var _0x50fa4f={};_0x50fa4f[_0x3d58f8]={'$like':'%'+_0x1675ae[_0xa1eb('0x35')][_0xa1eb('0x42')]+'%'};return _0x50fa4f;})});}_0x34241b=_['merge']({},_0x34241b,_0x1675ae[_0xa1eb('0x43')]);return _0x2147f9[_0xa1eb('0x91')](_0x34241b);}})[_0xa1eb('0x24')](function(_0x584478){if(_0x584478){_0x70f16b=_0x584478[_0xa1eb('0x3a')];if(!_0x1675ae['query'][_0xa1eb('0x3b')](_0xa1eb('0x5c'))){_0x34241b[_0xa1eb('0x1d')]=qs[_0xa1eb('0x1d')](_0x1675ae[_0xa1eb('0x35')][_0xa1eb('0x1d')]);_0x34241b[_0xa1eb('0x1c')]=qs[_0xa1eb('0x1c')](_0x1675ae[_0xa1eb('0x35')][_0xa1eb('0x1c')]);}return _0x2147f9[_0xa1eb('0x91')](_0x34241b);}})[_0xa1eb('0x24')](function(_0x1e2b6c){if(_0x1e2b6c){return _0x1e2b6c?{'count':_0x70f16b,'rows':_0x1e2b6c}:null;}})[_0xa1eb('0x24')](respondWithResult(_0x11661b,null))[_0xa1eb('0x47')](handleError(_0x11661b,null));};exports[_0xa1eb('0x92')]=function(_0x5a1166,_0x2d0eb3,_0x474ec1){var _0x2f0cb5,_0x4167c2;var _0x57eb4c=[];var _0x560705=moment()[_0xa1eb('0x65')](_0xa1eb('0x66'));return db[_0xa1eb('0x2f')][_0xa1eb('0x51')]({'where':{'id':_0x5a1166[_0xa1eb('0x49')]['id']}})[_0xa1eb('0x24')](handleEntityNotFound(_0x2d0eb3,null))[_0xa1eb('0x24')](function(_0xcb765f){if(_0xcb765f){_0x4167c2=_0xcb765f;return _0xcb765f[_0xa1eb('0x92')](_0x5a1166[_0xa1eb('0x4d')][_0xa1eb('0x67')],_[_0xa1eb('0x56')](_0x5a1166['body'],['ids','id'])||{});}return null;})[_0xa1eb('0x68')](function(_0x5739ed){var _0xe7518a;var _0xaadb24;_0x2f0cb5=_0x5739ed||[];var _0x3161c0=[];if(_0x5739ed){for(var _0x3220c7=0x0;_0x3220c7<_0x5739ed[_0xa1eb('0x3a')];_0x3220c7+=0x1){var _0x37d951=_0x5739ed[_0x3220c7]['get']({'plain':!![]});_0xe7518a=squel[_0xa1eb('0x6b')]()[_0xa1eb('0x7f')](_0xa1eb('0x93'))['fromQuery']([_0xa1eb('0x6e'),_0xa1eb('0x70'),_0xa1eb('0x71'),_0xa1eb('0x5d'),_0xa1eb('0x72'),_0xa1eb('0x57')],squel[_0xa1eb('0x73')]()[_0xa1eb('0x74')]('phone',_0xa1eb('0x6e'))[_0xa1eb('0x74')]('id',_0xa1eb('0x70'))['field'](_0x37d951[_0xa1eb('0x76')][_0xa1eb('0x77')](),'ListId')[_0xa1eb('0x74')](_0x5a1166[_0xa1eb('0x49')]['id'][_0xa1eb('0x77')](),_0xa1eb('0x5d'))['field'](_0xa1eb('0x75'),'createdAt')['field'](_0xa1eb('0x75'),_0xa1eb('0x57'))[_0xa1eb('0x78')](_0xa1eb('0x80'))[_0xa1eb('0x3e')](_0xa1eb('0x79'))['where']('ListId\x20=\x20?',_0x37d951[_0xa1eb('0x76')][_0xa1eb('0x77')]())[_0xa1eb('0x3e')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x3161c0['push'](db[_0xa1eb('0x8d')][_0xa1eb('0x35')](_0xe7518a));}return BPromise[_0xa1eb('0x8e')](_0x3161c0);}})[_0xa1eb('0x24')](function(){return _0x2f0cb5;})[_0xa1eb('0x24')](respondWithResult(_0x2d0eb3,null))[_0xa1eb('0x47')](handleError(_0x2d0eb3,null));};exports[_0xa1eb('0x94')]=function(_0x1c8d24,_0x48b2a9,_0x6e4fa1){return db[_0xa1eb('0x2f')]['find']({'where':{'id':_0x1c8d24['params']['id']}})['then'](handleEntityNotFound(_0x48b2a9,null))['then'](function(_0x93d325){if(_0x93d325){return _0x93d325[_0xa1eb('0x94')](_0x1c8d24[_0xa1eb('0x35')][_0xa1eb('0x67')]);}})['then'](function(_0x11455c){if(_0x11455c){return db[_0xa1eb('0x62')][_0xa1eb('0x25')]({'where':{'ListId':_0x1c8d24[_0xa1eb('0x35')][_0xa1eb('0x67')],'CampaignId':_0x1c8d24[_0xa1eb('0x49')]['id']}})[_0xa1eb('0x24')](function(){return _0x11455c;});}})[_0xa1eb('0x24')](respondWithStatusCode(_0x48b2a9,null))[_0xa1eb('0x47')](handleError(_0x48b2a9,null));};
\ No newline at end of file
+var _0x486e=['cm_contacts','toString','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','ListId\x20=\x20?','cm_hopper_additional_phones','OrderBy','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','then','destroy','IvrCampaigns','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','where','VIRTUAL','merge','options','Campaign','includeAll','findAll','rows','catch','show','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','params','getHoppers','findOne','hasOwnProperty','CampaignId','filter','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','from'];(function(_0xf855a1,_0x420a35){var _0x9ed54c=function(_0x15d8dd){while(--_0x15d8dd){_0xf855a1['push'](_0xf855a1['shift']());}};_0x9ed54c(++_0x420a35);}(_0x486e,0xb2));var _0xe486=function(_0x252cf9,_0x5221f9){_0x252cf9=_0x252cf9-0x0;var _0x1eb966=_0x486e[_0x252cf9];return _0x1eb966;};'use strict';var emlformat=require(_0xe486('0x0'));var rimraf=require(_0xe486('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe486('0x2'));var rp=require(_0xe486('0x3'));var moment=require(_0xe486('0x4'));var BPromise=require(_0xe486('0x5'));var Mustache=require(_0xe486('0x6'));var util=require(_0xe486('0x7'));var path=require(_0xe486('0x8'));var sox=require(_0xe486('0x9'));var csv=require(_0xe486('0xa'));var ejs=require(_0xe486('0xb'));var fs=require('fs');var fs_extra=require(_0xe486('0xc'));var _=require('lodash');var squel=require(_0xe486('0xd'));var crypto=require(_0xe486('0xe'));var jsforce=require(_0xe486('0xf'));var deskjs=require(_0xe486('0x10'));var toCsv=require(_0xe486('0xa'));var querystring=require(_0xe486('0x11'));var Papa=require(_0xe486('0x12'));var Redis=require(_0xe486('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe486('0x14'));var hardwareService=require(_0xe486('0x15'));var logger=require(_0xe486('0x16'))(_0xe486('0x17'));var utils=require(_0xe486('0x18'));var config=require(_0xe486('0x19'));var licenseUtil=require(_0xe486('0x1a'));var db=require(_0xe486('0x1b'))['db'];function respondWithStatusCode(_0x372057,_0x530344){_0x530344=_0x530344||0xcc;return function(_0x5a1aad){if(_0x5a1aad){return _0x372057[_0xe486('0x1c')](_0x530344);}return _0x372057[_0xe486('0x1d')](_0x530344)[_0xe486('0x1e')]();};}function respondWithResult(_0x564a6f,_0x5ddb65){_0x5ddb65=_0x5ddb65||0xc8;return function(_0x339746){if(_0x339746){return _0x564a6f['status'](_0x5ddb65)[_0xe486('0x1f')](_0x339746);}};}function respondWithFilteredResult(_0x3da621,_0x4a0259){return function(_0x355002){if(_0x355002){var _0x5016f0=typeof _0x4a0259['offset']===_0xe486('0x20')&&typeof _0x4a0259[_0xe486('0x21')]==='undefined';var _0x3d983b=_0x355002['count'];var _0x25e946=_0x5016f0?0x0:_0x4a0259[_0xe486('0x22')];var _0x5d209a=_0x5016f0?_0x355002[_0xe486('0x23')]:_0x4a0259[_0xe486('0x22')]+_0x4a0259['limit'];var _0xf0697f;if(_0x5d209a>=_0x3d983b){_0x5d209a=_0x3d983b;_0xf0697f=0xc8;}else{_0xf0697f=0xce;}_0x3da621[_0xe486('0x1d')](_0xf0697f);return _0x3da621[_0xe486('0x24')]('Content-Range',_0x25e946+'-'+_0x5d209a+'/'+_0x3d983b)[_0xe486('0x1f')](_0x355002);}return null;};}function patchUpdates(_0x301344){return function(_0x2c34e3){try{jsonpatch[_0xe486('0x25')](_0x2c34e3,_0x301344,!![]);}catch(_0x4650bf){return BPromise[_0xe486('0x26')](_0x4650bf);}return _0x2c34e3[_0xe486('0x27')]();};}function saveUpdates(_0xdc43f0,_0x5b61cc){return function(_0x22efff){if(_0x22efff){return _0x22efff['update'](_0xdc43f0)[_0xe486('0x28')](function(_0x50ae4c){return _0x50ae4c;});}return null;};}function removeEntity(_0x3020e7,_0x47a811){return function(_0x39113f){if(_0x39113f){return _0x39113f[_0xe486('0x29')]()[_0xe486('0x28')](function(){var _0x9f77fc=_0x39113f['get']({'plain':!![]});var _0x2e7182=_0xe486('0x2a');return db[_0xe486('0x2b')][_0xe486('0x29')]({'where':{'type':_0x2e7182,'resourceId':_0x9f77fc['id']}})[_0xe486('0x28')](function(){return _0x39113f;});})[_0xe486('0x28')](function(){_0x3020e7['status'](0xcc)[_0xe486('0x1e')]();});}};}function handleEntityNotFound(_0x2b08d0,_0x502b4c){return function(_0x87ece6){if(!_0x87ece6){_0x2b08d0['sendStatus'](0x194);}return _0x87ece6;};}function handleError(_0x48ab9f,_0x4ecdac){_0x4ecdac=_0x4ecdac||0x1f4;return function(_0x361b51){logger[_0xe486('0x2c')](_0x361b51[_0xe486('0x2d')]);if(_0x361b51['name']){delete _0x361b51[_0xe486('0x2e')];}_0x48ab9f['status'](_0x4ecdac)['send'](_0x361b51);};}exports[_0xe486('0x2f')]=function(_0x1c6d22,_0x22a1c9){var _0x2fc3a7={},_0x39f3f9={},_0x70e1bb={'count':0x0,'rows':[]};var _0x39b179=_['map'](db['Campaign'][_0xe486('0x30')],function(_0x5f3b54){return{'name':_0x5f3b54[_0xe486('0x31')],'type':_0x5f3b54[_0xe486('0x32')][_0xe486('0x33')]};});_0x39f3f9[_0xe486('0x34')]=_[_0xe486('0x35')](_0x39b179,'name');_0x39f3f9[_0xe486('0x36')]=_[_0xe486('0x37')](_0x1c6d22[_0xe486('0x36')]);_0x39f3f9[_0xe486('0x38')]=_['intersection'](_0x39f3f9[_0xe486('0x34')],_0x39f3f9[_0xe486('0x36')]);_0x2fc3a7[_0xe486('0x39')]=_['intersection'](_0x39f3f9[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x1c6d22[_0xe486('0x36')][_0xe486('0x3a')]));_0x2fc3a7['attributes']=_0x2fc3a7[_0xe486('0x39')][_0xe486('0x3b')]?_0x2fc3a7[_0xe486('0x39')]:_0x39f3f9[_0xe486('0x34')];if(!_0x1c6d22['query']['hasOwnProperty'](_0xe486('0x3c'))){_0x2fc3a7[_0xe486('0x21')]=qs[_0xe486('0x21')](_0x1c6d22[_0xe486('0x36')]['limit']);_0x2fc3a7[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x1c6d22[_0xe486('0x36')]['offset']);}_0x2fc3a7[_0xe486('0x3d')]=qs[_0xe486('0x3e')](_0x1c6d22[_0xe486('0x36')][_0xe486('0x3e')]);_0x2fc3a7['where']=qs['filters'](_[_0xe486('0x3f')](_0x1c6d22[_0xe486('0x36')],_0x39f3f9[_0xe486('0x38')]),_0x39b179);if(_0x1c6d22[_0xe486('0x36')]['filter']){_0x2fc3a7[_0xe486('0x40')]=_['merge'](_0x2fc3a7[_0xe486('0x40')],{'$or':_[_0xe486('0x35')](_0x39b179,function(_0xecdc73){if(_0xecdc73[_0xe486('0x32')]!==_0xe486('0x41')){var _0x178fcc={};_0x178fcc[_0xecdc73['name']]={'$like':'%'+_0x1c6d22[_0xe486('0x36')]['filter']+'%'};return _0x178fcc;}})});}_0x2fc3a7=_[_0xe486('0x42')]({},_0x2fc3a7,_0x1c6d22[_0xe486('0x43')]);var _0x1ba5e3={'where':_0x2fc3a7['where']};return db[_0xe486('0x44')]['count'](_0x1ba5e3)[_0xe486('0x28')](function(_0x22c5d2){_0x70e1bb[_0xe486('0x23')]=_0x22c5d2;if(_0x1c6d22['query'][_0xe486('0x45')]){_0x2fc3a7['include']=[{'all':!![]}];}return db[_0xe486('0x44')][_0xe486('0x46')](_0x2fc3a7);})['then'](function(_0x312a3a){_0x70e1bb[_0xe486('0x47')]=_0x312a3a;return _0x70e1bb;})[_0xe486('0x28')](respondWithFilteredResult(_0x22a1c9,_0x2fc3a7))[_0xe486('0x48')](handleError(_0x22a1c9,null));};exports[_0xe486('0x49')]=function(_0x9d6953,_0x5c4c9c){var _0x20b6b5={'raw':![],'where':{'id':_0x9d6953['params']['id']}},_0x45c705={};_0x45c705[_0xe486('0x34')]=_['keys'](db[_0xe486('0x44')][_0xe486('0x30')]);_0x45c705['query']=_[_0xe486('0x37')](_0x9d6953[_0xe486('0x36')]);_0x45c705[_0xe486('0x38')]=_['intersection'](_0x45c705[_0xe486('0x34')],_0x45c705[_0xe486('0x36')]);_0x20b6b5[_0xe486('0x39')]=_[_0xe486('0x4a')](_0x45c705['model'],qs[_0xe486('0x3a')](_0x9d6953[_0xe486('0x36')][_0xe486('0x3a')]));_0x20b6b5[_0xe486('0x39')]=_0x20b6b5[_0xe486('0x39')][_0xe486('0x3b')]?_0x20b6b5[_0xe486('0x39')]:_0x45c705['model'];if(_0x9d6953[_0xe486('0x36')][_0xe486('0x45')]){_0x20b6b5['include']=[{'all':!![]}];}_0x20b6b5=_[_0xe486('0x42')]({},_0x20b6b5,_0x9d6953[_0xe486('0x43')]);return db['Campaign'][_0xe486('0x4b')](_0x20b6b5)[_0xe486('0x28')](handleEntityNotFound(_0x5c4c9c,null))[_0xe486('0x28')](respondWithResult(_0x5c4c9c,null))[_0xe486('0x48')](handleError(_0x5c4c9c,null));};exports[_0xe486('0x4c')]=function(_0x10b115,_0x43f2da){return db['Campaign'][_0xe486('0x4c')](_0x10b115[_0xe486('0x4d')],{})['then'](function(_0x3bc7dd){var _0x26e8c5=_0x10b115[_0xe486('0x4e')][_0xe486('0x4f')]({'plain':!![]});if(!_0x26e8c5)throw new Error(_0xe486('0x50'));if(_0x26e8c5[_0xe486('0x51')]==='user'){var _0x1c8ad5=_0x3bc7dd[_0xe486('0x4f')]({'plain':!![]});var _0x4e781c=_0xe486('0x2a');return db[_0xe486('0x52')][_0xe486('0x4b')]({'where':{'name':_0x4e781c,'userProfileId':_0x26e8c5[_0xe486('0x53')]},'raw':!![]})[_0xe486('0x28')](function(_0x319585){if(_0x319585&&_0x319585[_0xe486('0x54')]===0x0){return db[_0xe486('0x2b')][_0xe486('0x4c')]({'name':_0x1c8ad5[_0xe486('0x2e')],'resourceId':_0x1c8ad5['id'],'type':_0x319585['name'],'sectionId':_0x319585['id']},{})[_0xe486('0x28')](function(){return _0x3bc7dd;});}else{return _0x3bc7dd;}})[_0xe486('0x48')](function(_0x3c9cf2){logger[_0xe486('0x2c')](_0xe486('0x55'),_0x3c9cf2);throw _0x3c9cf2;});}return _0x3bc7dd;})[_0xe486('0x28')](respondWithResult(_0x43f2da,0xc9))['catch'](handleError(_0x43f2da,null));};exports[_0xe486('0x56')]=function(_0x1592d5,_0x4df7c6){var _0x31e57a={'where':{'id':_0x1592d5['params']['id']}},_0x4de708={};_0x4de708[_0xe486('0x34')]=_[_0xe486('0x37')](db[_0xe486('0x44')]['rawAttributes']);_0x31e57a[_0xe486('0x39')]=_['intersection'](_0x4de708[_0xe486('0x34')],qs['fields'](_0x1592d5[_0xe486('0x36')]['fields']));_0x31e57a['attributes']=_0x31e57a['attributes'][_0xe486('0x3b')]?_0x31e57a[_0xe486('0x39')]:_0x4de708[_0xe486('0x34')];if(_0x1592d5[_0xe486('0x36')][_0xe486('0x45')]){_0x31e57a[_0xe486('0x57')]=[{'all':!![]}];}_0x31e57a=_['merge']({},_0x31e57a,_0x1592d5['options']);return db[_0xe486('0x44')]['find'](_0x31e57a)[_0xe486('0x28')](handleEntityNotFound(_0x4df7c6,null))[_0xe486('0x28')](function(_0x1b96f1){if(_0x1b96f1){var _0x50732c=_0x1b96f1['get']({'plain':!![]});_0x50732c=qs[_0xe486('0x58')](_0x50732c,['id',_0xe486('0x59'),_0xe486('0x5a')]);_0x1592d5[_0xe486('0x4d')]=_[_0xe486('0x58')](_0x1592d5[_0xe486('0x4d')],['id',_0xe486('0x59'),_0xe486('0x5a')]);return db[_0xe486('0x44')]['create'](_['merge'](_0x50732c,_0x1592d5[_0xe486('0x4d')]),{'include':_0x1592d5[_0xe486('0x36')][_0xe486('0x45')]?[{'all':!![]}]:undefined})[_0xe486('0x28')](function(_0x358bce){var _0x2ec277=_0x1592d5['user']['get']({'plain':!![]});if(!_0x2ec277)throw new Error(_0xe486('0x50'));if(_0x2ec277[_0xe486('0x51')]===_0xe486('0x4e')){var _0x148bad=_0x358bce[_0xe486('0x4f')]({'plain':!![]});var _0x33f2f6='IvrCampaigns';return db[_0xe486('0x52')][_0xe486('0x4b')]({'where':{'name':_0x33f2f6,'userProfileId':_0x2ec277[_0xe486('0x53')]},'raw':!![]})[_0xe486('0x28')](function(_0x512d18){if(_0x512d18&&_0x512d18[_0xe486('0x54')]===0x0){return db[_0xe486('0x2b')]['create']({'name':_0x148bad[_0xe486('0x2e')],'resourceId':_0x148bad['id'],'type':_0x512d18[_0xe486('0x2e')],'sectionId':_0x512d18['id']},{})[_0xe486('0x28')](function(){return _0x358bce;});}else{return _0x358bce;}})[_0xe486('0x48')](function(_0x4feeb5){logger[_0xe486('0x2c')](_0xe486('0x55'),_0x4feeb5);throw _0x4feeb5;});}return _0x358bce;});}})[_0xe486('0x28')](respondWithResult(_0x4df7c6,0xc9))[_0xe486('0x48')](handleError(_0x4df7c6,null));};exports['update']=function(_0x39a093,_0x290dc1){if(_0x39a093[_0xe486('0x4d')]['id']){delete _0x39a093[_0xe486('0x4d')]['id'];}return db[_0xe486('0x44')][_0xe486('0x4b')]({'where':{'id':_0x39a093[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x290dc1,null))['then'](saveUpdates(_0x39a093[_0xe486('0x4d')],null))[_0xe486('0x28')](respondWithResult(_0x290dc1,null))[_0xe486('0x48')](handleError(_0x290dc1,null));};exports[_0xe486('0x29')]=function(_0x8f0b78,_0x276742){return db['Campaign']['find']({'where':{'id':_0x8f0b78[_0xe486('0x5b')]['id']}})['then'](handleEntityNotFound(_0x276742,null))[_0xe486('0x28')](removeEntity(_0x276742,null))[_0xe486('0x48')](handleError(_0x276742,null));};exports[_0xe486('0x5c')]=function(_0x1dfdc0,_0x2bec02,_0x22b50d){var _0x696632={'raw':!![],'where':{}};var _0x183700={};var _0x12863d={'count':0x0,'rows':[]};return db[_0xe486('0x44')][_0xe486('0x5d')]({'where':{'id':_0x1dfdc0[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x2bec02,null))[_0xe486('0x28')](function(_0x333a1f){if(_0x333a1f){_0x183700['model']=_['keys'](db['CmHopper'][_0xe486('0x30')]);_0x183700[_0xe486('0x36')]=_['keys'](_0x1dfdc0[_0xe486('0x36')]);_0x183700[_0xe486('0x38')]=_['intersection'](_0x183700['model'],_0x183700[_0xe486('0x36')]);_0x696632[_0xe486('0x39')]=_['intersection'](_0x183700['model'],qs[_0xe486('0x3a')](_0x1dfdc0[_0xe486('0x36')][_0xe486('0x3a')]));_0x696632[_0xe486('0x39')]=_0x696632['attributes'][_0xe486('0x3b')]?_0x696632[_0xe486('0x39')]:_0x183700[_0xe486('0x34')];if(!_0x1dfdc0[_0xe486('0x36')][_0xe486('0x5e')]('nolimit')){_0x696632[_0xe486('0x21')]=qs[_0xe486('0x21')](_0x1dfdc0[_0xe486('0x36')]['limit']);_0x696632[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x1dfdc0['query'][_0xe486('0x22')]);}_0x696632[_0xe486('0x3d')]=qs['sort'](_0x1dfdc0['query'][_0xe486('0x3e')]);_0x696632[_0xe486('0x40')]=qs[_0xe486('0x38')](_[_0xe486('0x3f')](_0x1dfdc0[_0xe486('0x36')],_0x183700[_0xe486('0x38')]));_0x696632[_0xe486('0x40')][_0xe486('0x5f')]=_0x333a1f['id'];if(_0x1dfdc0['query'][_0xe486('0x60')]){_0x696632['where']=_[_0xe486('0x42')](_0x696632['where'],{'$or':_[_0xe486('0x35')](_0x696632[_0xe486('0x39')],function(_0x193204){var _0x403cb1={};_0x403cb1[_0x193204]={'$like':'%'+_0x1dfdc0[_0xe486('0x36')]['filter']+'%'};return _0x403cb1;})});}_0x696632=_[_0xe486('0x42')]({},_0x696632,_0x1dfdc0[_0xe486('0x43')]);return db[_0xe486('0x61')][_0xe486('0x23')]({'where':_0x696632['where']})[_0xe486('0x28')](function(_0x43a082){_0x12863d['count']=_0x43a082;if(_0x1dfdc0['query']['includeAll']){_0x696632[_0xe486('0x57')]=[{'all':!![]}];}return db['CmHopper'][_0xe486('0x46')](_0x696632);})[_0xe486('0x28')](function(_0x17f9c9){_0x12863d['rows']=_0x17f9c9;return _0x12863d;});}})[_0xe486('0x28')](respondWithFilteredResult(_0x2bec02,_0x696632))[_0xe486('0x48')](handleError(_0x2bec02,null));};exports[_0xe486('0x62')]=function(_0x1c092d,_0x4ea43e,_0x341960){var _0x2f28f5={'raw':!![],'where':{}};var _0x351154={};var _0x394eca={'count':0x0,'rows':[]};return db[_0xe486('0x44')][_0xe486('0x5d')]({'where':{'id':_0x1c092d[_0xe486('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4ea43e,null))[_0xe486('0x28')](function(_0x3603d2){if(_0x3603d2){_0x351154[_0xe486('0x34')]=_[_0xe486('0x37')](db[_0xe486('0x63')]['rawAttributes']);_0x351154['query']=_[_0xe486('0x37')](_0x1c092d[_0xe486('0x36')]);_0x351154[_0xe486('0x38')]=_[_0xe486('0x4a')](_0x351154[_0xe486('0x34')],_0x351154[_0xe486('0x36')]);_0x2f28f5[_0xe486('0x39')]=_['intersection'](_0x351154[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x1c092d[_0xe486('0x36')]['fields']));_0x2f28f5[_0xe486('0x39')]=_0x2f28f5[_0xe486('0x39')][_0xe486('0x3b')]?_0x2f28f5[_0xe486('0x39')]:_0x351154[_0xe486('0x34')];if(!_0x1c092d[_0xe486('0x36')][_0xe486('0x5e')](_0xe486('0x3c'))){_0x2f28f5[_0xe486('0x21')]=qs[_0xe486('0x21')](_0x1c092d[_0xe486('0x36')][_0xe486('0x21')]);_0x2f28f5[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x1c092d[_0xe486('0x36')]['offset']);}_0x2f28f5[_0xe486('0x3d')]=qs[_0xe486('0x3e')](_0x1c092d[_0xe486('0x36')][_0xe486('0x3e')]);_0x2f28f5[_0xe486('0x40')]=qs[_0xe486('0x38')](_[_0xe486('0x3f')](_0x1c092d[_0xe486('0x36')],_0x351154[_0xe486('0x38')]));_0x2f28f5[_0xe486('0x40')][_0xe486('0x5f')]=_0x3603d2['id'];if(_0x1c092d[_0xe486('0x36')][_0xe486('0x60')]){_0x2f28f5[_0xe486('0x40')]=_[_0xe486('0x42')](_0x2f28f5[_0xe486('0x40')],{'$or':_[_0xe486('0x35')](_0x2f28f5['attributes'],function(_0x4d0144){var _0x540206={};_0x540206[_0x4d0144]={'$like':'%'+_0x1c092d[_0xe486('0x36')][_0xe486('0x60')]+'%'};return _0x540206;})});}_0x2f28f5=_['merge']({},_0x2f28f5,_0x1c092d[_0xe486('0x43')]);return db[_0xe486('0x63')]['count']({'where':_0x2f28f5[_0xe486('0x40')]})[_0xe486('0x28')](function(_0x2b16ed){_0x394eca[_0xe486('0x23')]=_0x2b16ed;if(_0x1c092d[_0xe486('0x36')][_0xe486('0x45')]){_0x2f28f5[_0xe486('0x57')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xe486('0x46')](_0x2f28f5);})[_0xe486('0x28')](function(_0x10678b){_0x394eca['rows']=_0x10678b;return _0x394eca;});}})[_0xe486('0x28')](respondWithFilteredResult(_0x4ea43e,_0x2f28f5))[_0xe486('0x48')](handleError(_0x4ea43e,null));};exports[_0xe486('0x64')]=function(_0x3e2a12,_0x5b6052,_0x14bd14){var _0x63f070={'raw':!![],'where':{}};var _0xd82fd4={};var _0x13b8ec={'count':0x0,'rows':[]};return db[_0xe486('0x44')][_0xe486('0x5d')]({'where':{'id':_0x3e2a12[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x5b6052,null))[_0xe486('0x28')](function(_0x3e15e1){if(_0x3e15e1){_0xd82fd4[_0xe486('0x34')]=_[_0xe486('0x37')](db['CmHopperFinal'][_0xe486('0x30')]);_0xd82fd4[_0xe486('0x36')]=_[_0xe486('0x37')](_0x3e2a12['query']);_0xd82fd4[_0xe486('0x38')]=_[_0xe486('0x4a')](_0xd82fd4['model'],_0xd82fd4[_0xe486('0x36')]);_0x63f070[_0xe486('0x39')]=_[_0xe486('0x4a')](_0xd82fd4[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x3e2a12[_0xe486('0x36')]['fields']));_0x63f070[_0xe486('0x39')]=_0x63f070['attributes'][_0xe486('0x3b')]?_0x63f070[_0xe486('0x39')]:_0xd82fd4[_0xe486('0x34')];if(!_0x3e2a12['query'][_0xe486('0x5e')](_0xe486('0x3c'))){_0x63f070[_0xe486('0x21')]=qs[_0xe486('0x21')](_0x3e2a12[_0xe486('0x36')][_0xe486('0x21')]);_0x63f070[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x3e2a12[_0xe486('0x36')][_0xe486('0x22')]);}_0x63f070[_0xe486('0x3d')]=qs[_0xe486('0x3e')](_0x3e2a12[_0xe486('0x36')][_0xe486('0x3e')]);_0x63f070[_0xe486('0x40')]=qs[_0xe486('0x38')](_[_0xe486('0x3f')](_0x3e2a12[_0xe486('0x36')],_0xd82fd4['filters']));_0x63f070[_0xe486('0x40')][_0xe486('0x5f')]=_0x3e15e1['id'];if(_0x3e2a12['query'][_0xe486('0x60')]){_0x63f070[_0xe486('0x40')]=_[_0xe486('0x42')](_0x63f070['where'],{'$or':_[_0xe486('0x35')](_0x63f070['attributes'],function(_0x37c8c8){var _0x4537e3={};_0x4537e3[_0x37c8c8]={'$like':'%'+_0x3e2a12['query'][_0xe486('0x60')]+'%'};return _0x4537e3;})});}_0x63f070=_[_0xe486('0x42')]({},_0x63f070,_0x3e2a12['options']);return db[_0xe486('0x65')][_0xe486('0x23')]({'where':_0x63f070['where']})[_0xe486('0x28')](function(_0x20e28c){_0x13b8ec['count']=_0x20e28c;if(_0x3e2a12[_0xe486('0x36')][_0xe486('0x45')]){_0x63f070[_0xe486('0x57')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xe486('0x46')](_0x63f070);})[_0xe486('0x28')](function(_0x216ea8){_0x13b8ec['rows']=_0x216ea8;return _0x13b8ec;});}})[_0xe486('0x28')](respondWithFilteredResult(_0x5b6052,_0x63f070))[_0xe486('0x48')](handleError(_0x5b6052,null));};exports[_0xe486('0x66')]=function(_0x31f489,_0x1ef654,_0x2c583f){var _0x4ebc75={'raw':!![],'where':{}};var _0x1b0f9d={};var _0x57fe91={'count':0x0,'rows':[]};return db[_0xe486('0x44')]['findOne']({'where':{'id':_0x31f489['params']['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x1ef654,null))['then'](function(_0x44b4af){if(_0x44b4af){_0x1b0f9d[_0xe486('0x34')]=_[_0xe486('0x37')](db[_0xe486('0x67')][_0xe486('0x30')]);_0x1b0f9d[_0xe486('0x36')]=_[_0xe486('0x37')](_0x31f489[_0xe486('0x36')]);_0x1b0f9d[_0xe486('0x38')]=_['intersection'](_0x1b0f9d[_0xe486('0x34')],_0x1b0f9d['query']);_0x4ebc75[_0xe486('0x39')]=_[_0xe486('0x4a')](_0x1b0f9d[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x31f489[_0xe486('0x36')][_0xe486('0x3a')]));_0x4ebc75[_0xe486('0x39')]=_0x4ebc75['attributes'][_0xe486('0x3b')]?_0x4ebc75[_0xe486('0x39')]:_0x1b0f9d[_0xe486('0x34')];if(!_0x31f489[_0xe486('0x36')]['hasOwnProperty'](_0xe486('0x3c'))){_0x4ebc75[_0xe486('0x21')]=qs['limit'](_0x31f489[_0xe486('0x36')][_0xe486('0x21')]);_0x4ebc75[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x31f489['query']['offset']);}_0x4ebc75[_0xe486('0x3d')]=qs[_0xe486('0x3e')](_0x31f489[_0xe486('0x36')]['sort']);_0x4ebc75['where']=qs['filters'](_[_0xe486('0x3f')](_0x31f489['query'],_0x1b0f9d[_0xe486('0x38')]));_0x4ebc75[_0xe486('0x40')][_0xe486('0x5f')]=_0x44b4af['id'];if(_0x31f489[_0xe486('0x36')][_0xe486('0x60')]){_0x4ebc75[_0xe486('0x40')]=_[_0xe486('0x42')](_0x4ebc75[_0xe486('0x40')],{'$or':_[_0xe486('0x35')](_0x4ebc75['attributes'],function(_0x521de9){var _0x15ac77={};_0x15ac77[_0x521de9]={'$like':'%'+_0x31f489[_0xe486('0x36')][_0xe486('0x60')]+'%'};return _0x15ac77;})});}_0x4ebc75=_[_0xe486('0x42')]({},_0x4ebc75,_0x31f489[_0xe486('0x43')]);return db[_0xe486('0x67')][_0xe486('0x23')]({'where':_0x4ebc75[_0xe486('0x40')]})['then'](function(_0x379e25){_0x57fe91[_0xe486('0x23')]=_0x379e25;if(_0x31f489['query'][_0xe486('0x45')]){_0x4ebc75[_0xe486('0x57')]=[{'all':!![]}];}return db[_0xe486('0x67')][_0xe486('0x46')](_0x4ebc75);})['then'](function(_0x512151){_0x57fe91[_0xe486('0x47')]=_0x512151;return _0x57fe91;});}})[_0xe486('0x28')](respondWithFilteredResult(_0x1ef654,_0x4ebc75))[_0xe486('0x48')](handleError(_0x1ef654,null));};exports[_0xe486('0x68')]=function(_0x27dbdd,_0x3775c8,_0x5d1e03){var _0x5dbec8={};var _0x884f99={};var _0x1d0271;var _0x178857;return db[_0xe486('0x44')][_0xe486('0x5d')]({'where':{'id':_0x27dbdd['params']['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x3775c8,null))[_0xe486('0x28')](function(_0x4867f9){if(_0x4867f9){_0x1d0271=_0x4867f9;_0x884f99[_0xe486('0x34')]=_[_0xe486('0x37')](db[_0xe486('0x69')][_0xe486('0x30')]);_0x884f99[_0xe486('0x36')]=_[_0xe486('0x37')](_0x27dbdd[_0xe486('0x36')]);_0x884f99[_0xe486('0x38')]=_[_0xe486('0x4a')](_0x884f99[_0xe486('0x34')],_0x884f99[_0xe486('0x36')]);_0x5dbec8[_0xe486('0x39')]=_[_0xe486('0x4a')](_0x884f99[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x27dbdd[_0xe486('0x36')][_0xe486('0x3a')]));_0x5dbec8['attributes']=_0x5dbec8[_0xe486('0x39')][_0xe486('0x3b')]?_0x5dbec8['attributes']:_0x884f99[_0xe486('0x34')];_0x5dbec8[_0xe486('0x3d')]=qs['sort'](_0x27dbdd[_0xe486('0x36')][_0xe486('0x3e')]);_0x5dbec8['where']=qs['filters'](_[_0xe486('0x3f')](_0x27dbdd[_0xe486('0x36')],_0x884f99[_0xe486('0x38')]));if(_0x27dbdd[_0xe486('0x36')][_0xe486('0x60')]){_0x5dbec8[_0xe486('0x40')]=_['merge'](_0x5dbec8[_0xe486('0x40')],{'$or':_[_0xe486('0x35')](_0x5dbec8[_0xe486('0x39')],function(_0x2d57a7){var _0x46fd1b={};_0x46fd1b[_0x2d57a7]={'$like':'%'+_0x27dbdd['query']['filter']+'%'};return _0x46fd1b;})});}_0x5dbec8=_[_0xe486('0x42')]({},_0x5dbec8,_0x27dbdd[_0xe486('0x43')]);return _0x1d0271['getLists'](_0x5dbec8);}})[_0xe486('0x28')](function(_0xaa4f8){if(_0xaa4f8){_0x178857=_0xaa4f8[_0xe486('0x3b')];if(!_0x27dbdd[_0xe486('0x36')]['hasOwnProperty'](_0xe486('0x3c'))){_0x5dbec8[_0xe486('0x21')]=qs[_0xe486('0x21')](_0x27dbdd[_0xe486('0x36')][_0xe486('0x21')]);_0x5dbec8[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x27dbdd[_0xe486('0x36')][_0xe486('0x22')]);}return _0x1d0271[_0xe486('0x68')](_0x5dbec8);}})[_0xe486('0x28')](function(_0x364af4){if(_0x364af4){return _0x364af4?{'count':_0x178857,'rows':_0x364af4}:null;}})[_0xe486('0x28')](respondWithResult(_0x3775c8,null))[_0xe486('0x48')](handleError(_0x3775c8,null));};exports['addLists']=function(_0x506598,_0x5a2dd0,_0x37fc31){var _0x2f25ed,_0x414e50;var _0x4e2250=[];var _0x491543=moment()[_0xe486('0x6a')](_0xe486('0x6b'));return db[_0xe486('0x44')][_0xe486('0x4b')]({'where':{'id':_0x506598[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x5a2dd0,null))[_0xe486('0x28')](function(_0xf214d8){if(_0xf214d8){_0x414e50=_0xf214d8;return _0xf214d8['addLists'](_0x506598['body'][_0xe486('0x6c')],_[_0xe486('0x58')](_0x506598[_0xe486('0x4d')],[_0xe486('0x6c'),'id'])||{});}return null;})['spread'](function(_0x1289e5){var _0x439f75;var _0x7bf3ff;_0x2f25ed=_0x1289e5||[];var _0x369b45=[];if(_0x1289e5){for(var _0x14d9ed=0x0;_0x14d9ed<_0x1289e5[_0xe486('0x3b')];_0x14d9ed+=0x1){var _0x1f953d=_0x1289e5[_0x14d9ed][_0xe486('0x4f')]({'plain':!![]});_0x414e50['dialCheckDuplicateType']=_0x506598[_0xe486('0x4d')]['dialCheckDuplicateType']?_0x506598[_0xe486('0x4d')]['dialCheckDuplicateType']:_0x414e50[_0xe486('0x6d')];switch(_0x414e50['dialCheckDuplicateType']){case _0xe486('0x6e'):_0x439f75=squel[_0xe486('0x6f')]()['into'](_0xe486('0x70'))[_0xe486('0x71')]([_0xe486('0x72'),_0xe486('0x73'),_0xe486('0x74'),_0xe486('0x75'),_0xe486('0x5f'),_0xe486('0x59'),'updatedAt'],squel['select']()[_0xe486('0x76')](_0xe486('0x72'),_0xe486('0x72'))[_0xe486('0x76')](_0xe486('0x77'),_0xe486('0x73'))[_0xe486('0x76')]('id',_0xe486('0x74'))['field'](_0x1f953d[_0xe486('0x78')]['toString'](),_0xe486('0x75'))[_0xe486('0x76')](_0x506598[_0xe486('0x5b')]['id']['toString'](),'CampaignId')['field']('\x27'+_0x491543+'\x27',_0xe486('0x59'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27',_0xe486('0x5a'))[_0xe486('0x79')](_0xe486('0x7a'))[_0xe486('0x40')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x1f953d[_0xe486('0x78')][_0xe486('0x7b')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xe486('0x40')](_0xe486('0x7c'),squel[_0xe486('0x7d')]()[_0xe486('0x76')](_0xe486('0x7e'))[_0xe486('0x79')](_0xe486('0x7f'))[_0xe486('0x40')](_0xe486('0x80'),_0x506598[_0xe486('0x5b')]['id'][_0xe486('0x7b')]()))[_0xe486('0x40')](_0xe486('0x7c'),squel[_0xe486('0x7d')]()[_0xe486('0x76')](_0xe486('0x81'))[_0xe486('0x79')](_0xe486('0x70'))[_0xe486('0x40')](_0xe486('0x80'),_0x506598[_0xe486('0x5b')]['id']['toString']())))[_0xe486('0x7b')]();break;case _0xe486('0x82'):_0x439f75=squel['insert']()[_0xe486('0x83')](_0xe486('0x70'))[_0xe486('0x71')]([_0xe486('0x72'),'scheduledAt','ContactId','ListId','CampaignId',_0xe486('0x59'),_0xe486('0x5a')],squel[_0xe486('0x7d')]()[_0xe486('0x76')](_0xe486('0x72'),_0xe486('0x72'))[_0xe486('0x76')]('NOW()',_0xe486('0x73'))[_0xe486('0x76')]('id',_0xe486('0x74'))[_0xe486('0x76')](_0x1f953d[_0xe486('0x78')]['toString'](),_0xe486('0x75'))['field'](_0x506598['params']['id'][_0xe486('0x7b')](),_0xe486('0x5f'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27',_0xe486('0x59'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27',_0xe486('0x5a'))[_0xe486('0x79')](_0xe486('0x7a'))[_0xe486('0x40')](_0xe486('0x84'))[_0xe486('0x40')]('ListId\x20=\x20?',_0x1f953d[_0xe486('0x78')][_0xe486('0x7b')]())['where'](_0xe486('0x85'))['where'](_0xe486('0x7c'),squel[_0xe486('0x7d')]()[_0xe486('0x76')]('COALESCE(phone,\x27\x27)')[_0xe486('0x79')](_0xe486('0x70'))['where'](_0xe486('0x80'),_0x506598[_0xe486('0x5b')]['id'][_0xe486('0x7b')]())))[_0xe486('0x7b')]();break;default:_0x439f75=squel[_0xe486('0x6f')]()[_0xe486('0x83')]('cm_hopper')[_0xe486('0x71')](['phone',_0xe486('0x73'),_0xe486('0x74'),'ListId',_0xe486('0x5f'),_0xe486('0x59'),_0xe486('0x5a')],squel[_0xe486('0x7d')]()[_0xe486('0x76')](_0xe486('0x72'),'phone')[_0xe486('0x76')](_0xe486('0x77'),_0xe486('0x73'))['field']('id',_0xe486('0x74'))[_0xe486('0x76')](_0x1f953d[_0xe486('0x78')]['toString'](),_0xe486('0x75'))[_0xe486('0x76')](_0x506598[_0xe486('0x5b')]['id'][_0xe486('0x7b')](),_0xe486('0x5f'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27',_0xe486('0x59'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27',_0xe486('0x5a'))[_0xe486('0x79')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xe486('0x40')](_0xe486('0x86'),_0x1f953d[_0xe486('0x78')][_0xe486('0x7b')]())[_0xe486('0x40')](_0xe486('0x85')))[_0xe486('0x7b')]();}_0x7bf3ff=squel[_0xe486('0x6f')]()[_0xe486('0x83')](_0xe486('0x87'))[_0xe486('0x71')](['cmHopperId',_0xe486('0x73'),_0xe486('0x72'),_0xe486('0x88'),_0xe486('0x59'),_0xe486('0x5a')],squel['select']()[_0xe486('0x76')]('h.id','id')[_0xe486('0x76')]('NOW()','scheduledAt')[_0xe486('0x76')]('ci.item',_0xe486('0x72'))[_0xe486('0x76')](_0xe486('0x89'),_0xe486('0x88'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27','createdAt')[_0xe486('0x76')]('\x27'+_0x491543+'\x27','updatedAt')[_0xe486('0x79')]('cm_contact_has_items','ci')[_0xe486('0x8a')]('cm_hopper','h',_0xe486('0x8b'))[_0xe486('0x40')]('h.ListId\x20=\x20?',_0x1f953d[_0xe486('0x78')]['toString']())[_0xe486('0x40')](_0xe486('0x8c'),_0x506598[_0xe486('0x5b')]['id'][_0xe486('0x7b')]())['where'](_0xe486('0x8d'),_0x491543))['toString']();_0x369b45[_0xe486('0x8e')](db[_0xe486('0x8f')][_0xe486('0x36')](_0x439f75));_0x4e2250[_0xe486('0x8e')](db[_0xe486('0x8f')][_0xe486('0x36')](_0x7bf3ff));}return BPromise[_0xe486('0x90')](_0x369b45);}})[_0xe486('0x28')](function(){return BPromise[_0xe486('0x90')](_0x4e2250);})[_0xe486('0x28')](function(){return _0x2f25ed;})[_0xe486('0x28')](respondWithResult(_0x5a2dd0,null))[_0xe486('0x48')](handleError(_0x5a2dd0,null));};exports[_0xe486('0x91')]=function(_0x319924,_0x11fc68,_0x36f91f){return db[_0xe486('0x44')][_0xe486('0x4b')]({'where':{'id':_0x319924['params']['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x11fc68,null))[_0xe486('0x28')](function(_0x382cdd){if(_0x382cdd){return _0x382cdd[_0xe486('0x91')](_0x319924[_0xe486('0x36')][_0xe486('0x6c')]);}})['then'](function(_0x4c032d){if(_0x4c032d){return db[_0xe486('0x61')]['destroy']({'where':{'ListId':_0x319924[_0xe486('0x36')][_0xe486('0x6c')],'CampaignId':_0x319924['params']['id']}})['then'](function(){return _0x4c032d;});}})[_0xe486('0x28')](respondWithStatusCode(_0x11fc68,null))['catch'](handleError(_0x11fc68,null));};exports[_0xe486('0x92')]=function(_0x40e0f3,_0x53b45d,_0x1a804d){var _0x23c08a={};var _0x42379b={};var _0xeb13bf;var _0x4314a8;return db[_0xe486('0x44')][_0xe486('0x5d')]({'where':{'id':_0x40e0f3[_0xe486('0x5b')]['id']}})['then'](handleEntityNotFound(_0x53b45d,null))['then'](function(_0x660778){if(_0x660778){_0xeb13bf=_0x660778;_0x42379b['model']=_[_0xe486('0x37')](db[_0xe486('0x69')]['rawAttributes']);_0x42379b[_0xe486('0x36')]=_[_0xe486('0x37')](_0x40e0f3['query']);_0x42379b[_0xe486('0x38')]=_[_0xe486('0x4a')](_0x42379b[_0xe486('0x34')],_0x42379b[_0xe486('0x36')]);_0x23c08a[_0xe486('0x39')]=_[_0xe486('0x4a')](_0x42379b[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x40e0f3[_0xe486('0x36')][_0xe486('0x3a')]));_0x23c08a[_0xe486('0x39')]=_0x23c08a['attributes']['length']?_0x23c08a[_0xe486('0x39')]:_0x42379b[_0xe486('0x34')];_0x23c08a[_0xe486('0x3d')]=qs[_0xe486('0x3e')](_0x40e0f3[_0xe486('0x36')][_0xe486('0x3e')]);_0x23c08a[_0xe486('0x40')]=qs[_0xe486('0x38')](_['pick'](_0x40e0f3[_0xe486('0x36')],_0x42379b[_0xe486('0x38')]));if(_0x40e0f3[_0xe486('0x36')][_0xe486('0x60')]){_0x23c08a[_0xe486('0x40')]=_[_0xe486('0x42')](_0x23c08a[_0xe486('0x40')],{'$or':_[_0xe486('0x35')](_0x23c08a[_0xe486('0x39')],function(_0x2e8d19){var _0x8bc29c={};_0x8bc29c[_0x2e8d19]={'$like':'%'+_0x40e0f3[_0xe486('0x36')]['filter']+'%'};return _0x8bc29c;})});}_0x23c08a=_[_0xe486('0x42')]({},_0x23c08a,_0x40e0f3['options']);return _0xeb13bf['getBlackLists'](_0x23c08a);}})[_0xe486('0x28')](function(_0x2ca599){if(_0x2ca599){_0x4314a8=_0x2ca599['length'];if(!_0x40e0f3[_0xe486('0x36')][_0xe486('0x5e')](_0xe486('0x3c'))){_0x23c08a[_0xe486('0x21')]=qs['limit'](_0x40e0f3[_0xe486('0x36')]['limit']);_0x23c08a[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x40e0f3[_0xe486('0x36')][_0xe486('0x22')]);}return _0xeb13bf['getBlackLists'](_0x23c08a);}})[_0xe486('0x28')](function(_0x2b863d){if(_0x2b863d){return _0x2b863d?{'count':_0x4314a8,'rows':_0x2b863d}:null;}})[_0xe486('0x28')](respondWithResult(_0x53b45d,null))[_0xe486('0x48')](handleError(_0x53b45d,null));};exports['addBlackLists']=function(_0x501d3f,_0x9c7f9b,_0x1fe136){var _0x248db2,_0xba5703;var _0x250045=[];var _0x4f874d=moment()[_0xe486('0x6a')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xe486('0x44')][_0xe486('0x4b')]({'where':{'id':_0x501d3f[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x9c7f9b,null))['then'](function(_0x73e5c5){if(_0x73e5c5){_0xba5703=_0x73e5c5;return _0x73e5c5['addBlackLists'](_0x501d3f[_0xe486('0x4d')]['ids'],_[_0xe486('0x58')](_0x501d3f[_0xe486('0x4d')],[_0xe486('0x6c'),'id'])||{});}return null;})[_0xe486('0x93')](function(_0x4dddb2){var _0x2fbc7c;var _0x2bfd7c;_0x248db2=_0x4dddb2||[];var _0x2ec0d7=[];if(_0x4dddb2){for(var _0x10b6b9=0x0;_0x10b6b9<_0x4dddb2[_0xe486('0x3b')];_0x10b6b9+=0x1){var _0x3d2c9c=_0x4dddb2[_0x10b6b9]['get']({'plain':!![]});_0x2fbc7c=squel['insert']()[_0xe486('0x83')](_0xe486('0x94'))[_0xe486('0x71')]([_0xe486('0x72'),_0xe486('0x74'),_0xe486('0x75'),_0xe486('0x5f'),_0xe486('0x59'),_0xe486('0x5a')],squel[_0xe486('0x7d')]()[_0xe486('0x76')](_0xe486('0x72'),_0xe486('0x72'))['field']('id','ContactId')[_0xe486('0x76')](_0x3d2c9c[_0xe486('0x78')][_0xe486('0x7b')](),'ListId')['field'](_0x501d3f['params']['id']['toString'](),_0xe486('0x5f'))['field'](_0xe486('0x77'),'createdAt')[_0xe486('0x76')](_0xe486('0x77'),_0xe486('0x5a'))[_0xe486('0x79')](_0xe486('0x7a'))['where'](_0xe486('0x84'))[_0xe486('0x40')]('ListId\x20=\x20?',_0x3d2c9c[_0xe486('0x78')][_0xe486('0x7b')]())[_0xe486('0x40')](_0xe486('0x85')))[_0xe486('0x7b')]();_0x2ec0d7[_0xe486('0x8e')](db[_0xe486('0x8f')][_0xe486('0x36')](_0x2fbc7c));}return BPromise[_0xe486('0x90')](_0x2ec0d7);}})[_0xe486('0x28')](function(){return _0x248db2;})[_0xe486('0x28')](respondWithResult(_0x9c7f9b,null))['catch'](handleError(_0x9c7f9b,null));};exports[_0xe486('0x95')]=function(_0x5b6077,_0x4e28c6,_0x32d8ba){return db['Campaign']['find']({'where':{'id':_0x5b6077[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x4e28c6,null))[_0xe486('0x28')](function(_0xc7e200){if(_0xc7e200){return _0xc7e200[_0xe486('0x95')](_0x5b6077[_0xe486('0x36')][_0xe486('0x6c')]);}})[_0xe486('0x28')](function(_0x2a9cb9){if(_0x2a9cb9){return db[_0xe486('0x67')]['destroy']({'where':{'ListId':_0x5b6077[_0xe486('0x36')]['ids'],'CampaignId':_0x5b6077[_0xe486('0x5b')]['id']}})['then'](function(){return _0x2a9cb9;});}})[_0xe486('0x28')](respondWithStatusCode(_0x4e28c6,null))[_0xe486('0x48')](handleError(_0x4e28c6,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index f022b86..3995c6d 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4cc79a,_0xf85adc){var _0x176af9=function(_0x44ebcb){while(--_0x44ebcb){_0x4cc79a['push'](_0x4cc79a['shift']());}};_0x176af9(++_0xf85adc);}(_0x7a54,0x106));var _0x47a5=function(_0x3f32f8,_0x55bcb2){_0x3f32f8=_0x3f32f8-0x0;var _0x5cb275=_0x7a54[_0x3f32f8];return _0x5cb275;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 8ea7fbb..16117d2 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 _0x6822=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','Campaign,\x20%s,\x20%s','message','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','include','map','model','then','debug','stringify'];(function(_0x1686c9,_0x57aca1){var _0x5961dd=function(_0xddb41d){while(--_0xddb41d){_0x1686c9['push'](_0x1686c9['shift']());}};_0x5961dd(++_0x57aca1);}(_0x6822,0x18c));var _0x2682=function(_0xc61f1a,_0x1fff20){_0xc61f1a=_0xc61f1a-0x0;var _0x5f5de=_0x6822[_0xc61f1a];return _0x5f5de;};'use strict';var _=require('lodash');var util=require(_0x2682('0x0'));var moment=require(_0x2682('0x1'));var BPromise=require(_0x2682('0x2'));var rs=require(_0x2682('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2682('0x4'))['db'];var utils=require(_0x2682('0x5'));var logger=require(_0x2682('0x6'))(_0x2682('0x7'));var config=require(_0x2682('0x8'));var jayson=require(_0x2682('0x9'));var client=jayson[_0x2682('0xa')][_0x2682('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35f55b,_0x3f706c,_0x4242c5){return new BPromise(function(_0x1a1307,_0x303fe4){return client[_0x2682('0xc')](_0x35f55b,_0x4242c5)['then'](function(_0x3e72bc){logger[_0x2682('0xd')]('Campaign,\x20%s,\x20%s',_0x3f706c,'request\x20sent');logger['debug'](_0x2682('0xe'),_0x3f706c,_0x2682('0xf'),JSON['stringify'](_0x3e72bc));if(_0x3e72bc[_0x2682('0x10')]){if(_0x3e72bc[_0x2682('0x10')]['code']===0x1f4){logger[_0x2682('0x10')](_0x2682('0x11'),_0x3f706c,_0x3e72bc[_0x2682('0x10')][_0x2682('0x12')]);return _0x303fe4(_0x3e72bc[_0x2682('0x10')][_0x2682('0x12')]);}logger[_0x2682('0x10')](_0x2682('0x11'),_0x3f706c,_0x3e72bc[_0x2682('0x10')][_0x2682('0x12')]);return _0x1a1307(_0x3e72bc[_0x2682('0x10')][_0x2682('0x12')]);}else{logger[_0x2682('0xd')](_0x2682('0x11'),_0x3f706c,_0x2682('0xf'));_0x1a1307(_0x3e72bc['result']['message']);}})[_0x2682('0x13')](function(_0x2b1ed2){logger[_0x2682('0x10')]('Campaign,\x20%s,\x20%s',_0x3f706c,_0x2b1ed2);_0x303fe4(_0x2b1ed2);});});}exports[_0x2682('0x14')]=function(_0x494946){var _0x498424=this;return new Promise(function(_0x19391e,_0x3d2b43){return db[_0x2682('0x15')][_0x2682('0x16')]({'raw':_0x494946[_0x2682('0x17')]?_0x494946['options'][_0x2682('0x18')]===undefined?!![]:![]:!![],'where':_0x494946['options']?_0x494946[_0x2682('0x17')][_0x2682('0x19')]||null:null,'attributes':_0x494946[_0x2682('0x17')]?_0x494946[_0x2682('0x17')][_0x2682('0x1a')]||null:null,'limit':_0x494946[_0x2682('0x17')]?_0x494946[_0x2682('0x17')]['limit']||null:null,'include':_0x494946['options']?_0x494946['options'][_0x2682('0x1b')]?_[_0x2682('0x1c')](_0x494946['options'][_0x2682('0x1b')],function(_0x35aa4c){return{'model':db[_0x35aa4c[_0x2682('0x1d')]],'as':_0x35aa4c['as'],'attributes':_0x35aa4c[_0x2682('0x1a')],'include':_0x35aa4c['include']?_[_0x2682('0x1c')](_0x35aa4c[_0x2682('0x1b')],function(_0x361791){return{'model':db[_0x361791[_0x2682('0x1d')]],'as':_0x361791['as'],'attributes':_0x361791[_0x2682('0x1a')],'include':_0x361791[_0x2682('0x1b')]?_['map'](_0x361791['include'],function(_0x48eee6){return{'model':db[_0x48eee6['model']],'as':_0x48eee6['as'],'attributes':_0x48eee6[_0x2682('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2682('0x1e')](function(_0x3eff92){logger[_0x2682('0xd')](_0x2682('0x14'),_0x494946);logger[_0x2682('0x1f')](_0x2682('0x14'),_0x494946,JSON[_0x2682('0x20')](_0x3eff92));_0x19391e(_0x3eff92);})['catch'](function(_0x9384b5){logger[_0x2682('0x10')]('GetCampaign',_0x9384b5[_0x2682('0x12')],_0x494946);_0x3d2b43(_0x498424[_0x2682('0x10')](0x1f4,_0x9384b5[_0x2682('0x12')]));});});};
\ No newline at end of file
+var _0xf675=['../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1c77e7,_0x520524){var _0x45b345=function(_0x4e9a95){while(--_0x4e9a95){_0x1c77e7['push'](_0x1c77e7['shift']());}};_0x45b345(++_0x520524);}(_0xf675,0x199));var _0x5f67=function(_0x297eea,_0x5060be){_0x297eea=_0x297eea-0x0;var _0x1c42d2=_0xf675[_0x297eea];return _0x1c42d2;};'use strict';var _=require(_0x5f67('0x0'));var util=require(_0x5f67('0x1'));var moment=require(_0x5f67('0x2'));var BPromise=require('bluebird');var rs=require(_0x5f67('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5f67('0x4'))['db'];var utils=require(_0x5f67('0x5'));var logger=require(_0x5f67('0x6'))('rpc');var config=require(_0x5f67('0x7'));var jayson=require(_0x5f67('0x8'));var client=jayson[_0x5f67('0x9')][_0x5f67('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b67eb,_0xc71a7,_0x121d19){return new BPromise(function(_0x55efcd,_0x5749f5){return client[_0x5f67('0xb')](_0x5b67eb,_0x121d19)[_0x5f67('0xc')](function(_0x530ef1){logger['info'](_0x5f67('0xd'),_0xc71a7,_0x5f67('0xe'));logger[_0x5f67('0xf')]('Campaign,\x20%s,\x20%s,\x20%s',_0xc71a7,'request\x20sent',JSON['stringify'](_0x530ef1));if(_0x530ef1[_0x5f67('0x10')]){if(_0x530ef1[_0x5f67('0x10')]['code']===0x1f4){logger[_0x5f67('0x10')]('Campaign,\x20%s,\x20%s',_0xc71a7,_0x530ef1[_0x5f67('0x10')]['message']);return _0x5749f5(_0x530ef1[_0x5f67('0x10')][_0x5f67('0x11')]);}logger[_0x5f67('0x10')]('Campaign,\x20%s,\x20%s',_0xc71a7,_0x530ef1[_0x5f67('0x10')]['message']);return _0x55efcd(_0x530ef1[_0x5f67('0x10')]['message']);}else{logger[_0x5f67('0x12')]('Campaign,\x20%s,\x20%s',_0xc71a7,_0x5f67('0xe'));_0x55efcd(_0x530ef1[_0x5f67('0x13')][_0x5f67('0x11')]);}})[_0x5f67('0x14')](function(_0x444ee5){logger[_0x5f67('0x10')](_0x5f67('0xd'),_0xc71a7,_0x444ee5);_0x5749f5(_0x444ee5);});});}exports[_0x5f67('0x15')]=function(_0xc539c6){var _0x8f3bd6=this;return new Promise(function(_0x5275d6,_0x5bc956){return db[_0x5f67('0x16')][_0x5f67('0x17')]({'raw':_0xc539c6['options']?_0xc539c6[_0x5f67('0x18')][_0x5f67('0x19')]===undefined?!![]:![]:!![],'where':_0xc539c6[_0x5f67('0x18')]?_0xc539c6[_0x5f67('0x18')][_0x5f67('0x1a')]||null:null,'attributes':_0xc539c6[_0x5f67('0x18')]?_0xc539c6[_0x5f67('0x18')][_0x5f67('0x1b')]||null:null,'limit':_0xc539c6[_0x5f67('0x18')]?_0xc539c6[_0x5f67('0x18')][_0x5f67('0x1c')]||null:null,'include':_0xc539c6[_0x5f67('0x18')]?_0xc539c6['options'][_0x5f67('0x1d')]?_[_0x5f67('0x1e')](_0xc539c6[_0x5f67('0x18')]['include'],function(_0x537b39){return{'model':db[_0x537b39[_0x5f67('0x1f')]],'as':_0x537b39['as'],'attributes':_0x537b39[_0x5f67('0x1b')],'include':_0x537b39['include']?_[_0x5f67('0x1e')](_0x537b39[_0x5f67('0x1d')],function(_0x241d17){return{'model':db[_0x241d17[_0x5f67('0x1f')]],'as':_0x241d17['as'],'attributes':_0x241d17['attributes'],'include':_0x241d17[_0x5f67('0x1d')]?_['map'](_0x241d17[_0x5f67('0x1d')],function(_0x167601){return{'model':db[_0x167601['model']],'as':_0x167601['as'],'attributes':_0x167601[_0x5f67('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5f67('0xc')](function(_0x57f373){logger['info'](_0x5f67('0x15'),_0xc539c6);logger[_0x5f67('0xf')](_0x5f67('0x15'),_0xc539c6,JSON['stringify'](_0x57f373));_0x5275d6(_0x57f373);})[_0x5f67('0x14')](function(_0xd36b79){logger['error'](_0x5f67('0x15'),_0xd36b79[_0x5f67('0x11')],_0xc539c6);_0x5bc956(_0x8f3bd6['error'](0x1f4,_0xd36b79[_0x5f67('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 8477520..480a36a 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 _0x1352=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','put','/:id','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util'];(function(_0x34ce9c,_0x101034){var _0x4a82fa=function(_0x5a033f){while(--_0x5a033f){_0x34ce9c['push'](_0x34ce9c['shift']());}};_0x4a82fa(++_0x101034);}(_0x1352,0x17a));var _0x2135=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x1352[_0x173d7e];return _0x2220d6;};'use strict';var multer=require(_0x2135('0x0'));var util=require(_0x2135('0x1'));var path=require(_0x2135('0x2'));var timeout=require(_0x2135('0x3'));var express=require(_0x2135('0x4'));var router=express[_0x2135('0x5')]();var fs_extra=require(_0x2135('0x6'));var auth=require(_0x2135('0x7'));var interaction=require(_0x2135('0x8'));var config=require(_0x2135('0x9'));var controller=require(_0x2135('0xa'));router[_0x2135('0xb')]('/',auth[_0x2135('0xc')](),controller[_0x2135('0xd')]);router[_0x2135('0xb')]('/:id',auth[_0x2135('0xc')](),controller[_0x2135('0xe')]);router['get'](_0x2135('0xf'),auth[_0x2135('0xc')](),controller['getHoppers']);router[_0x2135('0xb')](_0x2135('0x10'),auth[_0x2135('0xc')](),controller[_0x2135('0x11')]);router[_0x2135('0xb')](_0x2135('0x12'),auth[_0x2135('0xc')](),controller[_0x2135('0x13')]);router[_0x2135('0xb')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x2135('0x14')]);router[_0x2135('0xb')](_0x2135('0x15'),auth[_0x2135('0xc')](),controller['getLists']);router[_0x2135('0xb')]('/:id/blacklists',auth[_0x2135('0xc')](),controller[_0x2135('0x16')]);router[_0x2135('0x17')]('/',auth[_0x2135('0xc')](),controller[_0x2135('0x18')]);router[_0x2135('0x17')](_0x2135('0x19'),auth[_0x2135('0xc')](),controller[_0x2135('0x1a')]);router[_0x2135('0x17')]('/:id/lists',auth['isAuthenticated'](),controller[_0x2135('0x1b')]);router[_0x2135('0x17')](_0x2135('0x1c'),auth['isAuthenticated'](),controller[_0x2135('0x1d')]);router[_0x2135('0x1e')](_0x2135('0x1f'),auth[_0x2135('0xc')](),controller[_0x2135('0x20')]);router[_0x2135('0x21')]('/:id',auth[_0x2135('0xc')](),controller[_0x2135('0x22')]);router[_0x2135('0x21')](_0x2135('0x15'),auth[_0x2135('0xc')](),controller[_0x2135('0x23')]);router[_0x2135('0x21')](_0x2135('0x1c'),auth[_0x2135('0xc')](),controller[_0x2135('0x24')]);module[_0x2135('0x25')]=router;
\ No newline at end of file
+var _0xca04=['path','Router','fs-extra','../../config/environment','./campaign.controller','index','/:id','show','get','/:id/hoppers','isAuthenticated','getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer'];(function(_0x12c4fe,_0x3f2d61){var _0x56b681=function(_0x3f3605){while(--_0x3f3605){_0x12c4fe['push'](_0x12c4fe['shift']());}};_0x56b681(++_0x3f2d61);}(_0xca04,0xa4));var _0x4ca0=function(_0x109e60,_0x1634ac){_0x109e60=_0x109e60-0x0;var _0x4b239d=_0xca04[_0x109e60];return _0x4b239d;};'use strict';var multer=require(_0x4ca0('0x0'));var util=require('util');var path=require(_0x4ca0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4ca0('0x2')]();var fs_extra=require(_0x4ca0('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ca0('0x4'));var controller=require(_0x4ca0('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x4ca0('0x6')]);router['get'](_0x4ca0('0x7'),auth['isAuthenticated'](),controller[_0x4ca0('0x8')]);router[_0x4ca0('0x9')](_0x4ca0('0xa'),auth[_0x4ca0('0xb')](),controller[_0x4ca0('0xc')]);router[_0x4ca0('0x9')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x4ca0('0xd')]);router[_0x4ca0('0x9')](_0x4ca0('0xe'),auth[_0x4ca0('0xb')](),controller['getHopperFinals']);router[_0x4ca0('0x9')](_0x4ca0('0xf'),auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x10')]);router[_0x4ca0('0x9')](_0x4ca0('0x11'),auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x12')]);router[_0x4ca0('0x9')](_0x4ca0('0x13'),auth[_0x4ca0('0xb')](),controller['getBlackLists']);router['post']('/',auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x14')]);router[_0x4ca0('0x15')](_0x4ca0('0x16'),auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x17')]);router[_0x4ca0('0x15')]('/:id/lists',auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x18')]);router['post'](_0x4ca0('0x13'),auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x19')]);router[_0x4ca0('0x1a')](_0x4ca0('0x7'),auth['isAuthenticated'](),controller[_0x4ca0('0x1b')]);router[_0x4ca0('0x1c')]('/:id',auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x1d')]);router[_0x4ca0('0x1c')](_0x4ca0('0x11'),auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x1e')]);router[_0x4ca0('0x1c')](_0x4ca0('0x13'),auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x1f')]);module[_0x4ca0('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index d7e76e3..056eac9 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 _0x17be=['VIRTUAL','key','sequelize','exports','STRING','TEXT','medium'];(function(_0x14b60e,_0x5bcdad){var _0xb7c345=function(_0x3fb27d){while(--_0x3fb27d){_0x14b60e['push'](_0x14b60e['shift']());}};_0xb7c345(++_0x5bcdad);}(_0x17be,0x136));var _0xe17b=function(_0x3902fd,_0x5ab635){_0x3902fd=_0x3902fd-0x0;var _0x1e0990=_0x17be[_0x3902fd];return _0x1e0990;};'use strict';var Sequelize=require(_0xe17b('0x0'));module[_0xe17b('0x1')]={'key':{'type':Sequelize[_0xe17b('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xe17b('0x3')],'length':_0xe17b('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xe17b('0x2')]},'name':{'type':Sequelize[_0xe17b('0x5')],'get':function(){return this['getDataValue'](_0xe17b('0x6'));}}};
\ No newline at end of file
+var _0xafa9=['medium','VIRTUAL','sequelize','exports','TEXT'];(function(_0x4c5fff,_0x50d286){var _0x2bd2da=function(_0x57f1ba){while(--_0x57f1ba){_0x4c5fff['push'](_0x4c5fff['shift']());}};_0x2bd2da(++_0x50d286);}(_0xafa9,0x15b));var _0x9afa=function(_0x5bb1e9,_0x15f025){_0x5bb1e9=_0x5bb1e9-0x0;var _0x262c24=_0xafa9[_0x5bb1e9];return _0x262c24;};'use strict';var Sequelize=require(_0x9afa('0x0'));module[_0x9afa('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x9afa('0x2')],'length':_0x9afa('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x9afa('0x4')],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 8ba665f..a5013d8 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 _0x6533=['hasOwnProperty','order','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','catch','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','send','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length'];(function(_0x283973,_0x2eecfd){var _0x1d927f=function(_0x5d501e){while(--_0x5d501e){_0x283973['push'](_0x283973['shift']());}};_0x1d927f(++_0x2eecfd);}(_0x6533,0x127));var _0x3653=function(_0x40e681,_0x39999a){_0x40e681=_0x40e681-0x0;var _0x8528d2=_0x6533[_0x40e681];return _0x8528d2;};'use strict';var emlformat=require(_0x3653('0x0'));var rimraf=require(_0x3653('0x1'));var zipdir=require(_0x3653('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3653('0x3'));var moment=require('moment');var BPromise=require(_0x3653('0x4'));var Mustache=require(_0x3653('0x5'));var util=require('util');var path=require(_0x3653('0x6'));var sox=require(_0x3653('0x7'));var csv=require(_0x3653('0x8'));var ejs=require(_0x3653('0x9'));var fs=require('fs');var fs_extra=require(_0x3653('0xa'));var _=require(_0x3653('0xb'));var squel=require(_0x3653('0xc'));var crypto=require(_0x3653('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3653('0xe'));var toCsv=require(_0x3653('0x8'));var querystring=require(_0x3653('0xf'));var Papa=require(_0x3653('0x10'));var Redis=require(_0x3653('0x11'));var authService=require(_0x3653('0x12'));var qs=require(_0x3653('0x13'));var as=require(_0x3653('0x14'));var hardwareService=require(_0x3653('0x15'));var logger=require(_0x3653('0x16'))(_0x3653('0x17'));var utils=require('../../config/utils');var config=require(_0x3653('0x18'));var licenseUtil=require(_0x3653('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42452f,_0x7896a4){_0x7896a4=_0x7896a4||0xcc;return function(_0x7bfff6){if(_0x7bfff6){return _0x42452f[_0x3653('0x1a')](_0x7896a4);}return _0x42452f[_0x3653('0x1b')](_0x7896a4)[_0x3653('0x1c')]();};}function respondWithResult(_0x56e99b,_0x53147b){_0x53147b=_0x53147b||0xc8;return function(_0x287170){if(_0x287170){return _0x56e99b[_0x3653('0x1b')](_0x53147b)[_0x3653('0x1d')](_0x287170);}};}function respondWithFilteredResult(_0x390892,_0x2cda51){return function(_0x4b936e){if(_0x4b936e){var _0x2f0a86=typeof _0x2cda51[_0x3653('0x1e')]===_0x3653('0x1f')&&typeof _0x2cda51[_0x3653('0x20')]==='undefined';var _0x2201c7=_0x4b936e[_0x3653('0x21')];var _0x109884=_0x2f0a86?0x0:_0x2cda51['offset'];var _0x2d835d=_0x2f0a86?_0x4b936e[_0x3653('0x21')]:_0x2cda51[_0x3653('0x1e')]+_0x2cda51[_0x3653('0x20')];var _0x17e2b4;if(_0x2d835d>=_0x2201c7){_0x2d835d=_0x2201c7;_0x17e2b4=0xc8;}else{_0x17e2b4=0xce;}_0x390892[_0x3653('0x1b')](_0x17e2b4);return _0x390892['set']('Content-Range',_0x109884+'-'+_0x2d835d+'/'+_0x2201c7)['json'](_0x4b936e);}return null;};}function patchUpdates(_0x597efc){return function(_0x335a39){try{jsonpatch['apply'](_0x335a39,_0x597efc,!![]);}catch(_0x22f592){return BPromise[_0x3653('0x22')](_0x22f592);}return _0x335a39[_0x3653('0x23')]();};}function saveUpdates(_0xe1c5c2,_0x39dca9){return function(_0x25219c){if(_0x25219c){return _0x25219c[_0x3653('0x24')](_0xe1c5c2)[_0x3653('0x25')](function(_0x4f1386){return _0x4f1386;});}return null;};}function removeEntity(_0x4e5a3b,_0x62a475){return function(_0x111f94){if(_0x111f94){return _0x111f94[_0x3653('0x26')]()['then'](function(){var _0x2999a0=_0x111f94[_0x3653('0x27')]({'plain':!![]});var _0x14e683=_0x3653('0x28');return db[_0x3653('0x29')][_0x3653('0x26')]({'where':{'type':_0x14e683,'resourceId':_0x2999a0['id']}})[_0x3653('0x25')](function(){return _0x111f94;});})[_0x3653('0x25')](function(){_0x4e5a3b[_0x3653('0x1b')](0xcc)[_0x3653('0x1c')]();});}};}function handleEntityNotFound(_0x232974,_0x2d79f7){return function(_0x4aa435){if(!_0x4aa435){_0x232974['sendStatus'](0x194);}return _0x4aa435;};}function handleError(_0x135a4b,_0x24f90d){_0x24f90d=_0x24f90d||0x1f4;return function(_0x3de48b){logger[_0x3653('0x2a')](_0x3de48b['stack']);if(_0x3de48b['name']){delete _0x3de48b['name'];}_0x135a4b[_0x3653('0x1b')](_0x24f90d)[_0x3653('0x2b')](_0x3de48b);};}exports['index']=function(_0x539f62,_0x55e516){var _0x167b5c={},_0x169f1f={},_0x516771={'count':0x0,'rows':[]};var _0xb14bac=_['map'](db['CannedAnswer'][_0x3653('0x2c')],function(_0x4dad81){return{'name':_0x4dad81['fieldName'],'type':_0x4dad81[_0x3653('0x2d')][_0x3653('0x2e')]};});_0x169f1f[_0x3653('0x2f')]=_[_0x3653('0x30')](_0xb14bac,_0x3653('0x31'));_0x169f1f[_0x3653('0x32')]=_[_0x3653('0x33')](_0x539f62['query']);_0x169f1f[_0x3653('0x34')]=_[_0x3653('0x35')](_0x169f1f['model'],_0x169f1f[_0x3653('0x32')]);_0x167b5c[_0x3653('0x36')]=_[_0x3653('0x35')](_0x169f1f[_0x3653('0x2f')],qs['fields'](_0x539f62[_0x3653('0x32')][_0x3653('0x37')]));_0x167b5c[_0x3653('0x36')]=_0x167b5c[_0x3653('0x36')][_0x3653('0x38')]?_0x167b5c['attributes']:_0x169f1f[_0x3653('0x2f')];if(!_0x539f62[_0x3653('0x32')][_0x3653('0x39')]('nolimit')){_0x167b5c['limit']=qs[_0x3653('0x20')](_0x539f62[_0x3653('0x32')]['limit']);_0x167b5c[_0x3653('0x1e')]=qs[_0x3653('0x1e')](_0x539f62['query']['offset']);}_0x167b5c[_0x3653('0x3a')]=qs[_0x3653('0x3b')](_0x539f62[_0x3653('0x32')][_0x3653('0x3b')]);_0x167b5c[_0x3653('0x3c')]=qs[_0x3653('0x34')](_[_0x3653('0x3d')](_0x539f62['query'],_0x169f1f[_0x3653('0x34')]),_0xb14bac);if(_0x539f62[_0x3653('0x32')][_0x3653('0x3e')]){_0x167b5c[_0x3653('0x3c')]=_[_0x3653('0x3f')](_0x167b5c['where'],{'$or':[{'key':{'$like':'%'+_0x539f62[_0x3653('0x32')][_0x3653('0x3e')]+'%'}},{'value':{'$like':'%'+_0x539f62[_0x3653('0x32')][_0x3653('0x3e')]+'%'}}]});}_0x167b5c=_[_0x3653('0x3f')]({},_0x167b5c,_0x539f62[_0x3653('0x40')]);var _0x38dd77={'where':_0x167b5c[_0x3653('0x3c')]};return db[_0x3653('0x41')][_0x3653('0x21')](_0x38dd77)['then'](function(_0x3dbdd0){_0x516771[_0x3653('0x21')]=_0x3dbdd0;if(_0x539f62['query'][_0x3653('0x42')]){_0x167b5c[_0x3653('0x43')]=[{'all':!![]}];}return db[_0x3653('0x41')][_0x3653('0x44')](_0x167b5c);})[_0x3653('0x25')](function(_0x58ef01){_0x516771[_0x3653('0x45')]=_0x58ef01;return _0x516771;})[_0x3653('0x25')](respondWithFilteredResult(_0x55e516,_0x167b5c))[_0x3653('0x46')](handleError(_0x55e516,null));};exports['show']=function(_0x28da23,_0x4b2ee5){var _0x432e4c={'raw':!![],'where':{'id':_0x28da23[_0x3653('0x47')]['id']}},_0x57f8d4={};_0x57f8d4[_0x3653('0x2f')]=_[_0x3653('0x33')](db[_0x3653('0x41')][_0x3653('0x2c')]);_0x57f8d4[_0x3653('0x32')]=_[_0x3653('0x33')](_0x28da23[_0x3653('0x32')]);_0x57f8d4[_0x3653('0x34')]=_[_0x3653('0x35')](_0x57f8d4[_0x3653('0x2f')],_0x57f8d4[_0x3653('0x32')]);_0x432e4c[_0x3653('0x36')]=_[_0x3653('0x35')](_0x57f8d4[_0x3653('0x2f')],qs[_0x3653('0x37')](_0x28da23[_0x3653('0x32')]['fields']));_0x432e4c[_0x3653('0x36')]=_0x432e4c['attributes']['length']?_0x432e4c['attributes']:_0x57f8d4[_0x3653('0x2f')];if(_0x28da23[_0x3653('0x32')]['includeAll']){_0x432e4c[_0x3653('0x43')]=[{'all':!![]}];}_0x432e4c=_['merge']({},_0x432e4c,_0x28da23['options']);return db['CannedAnswer'][_0x3653('0x48')](_0x432e4c)['then'](handleEntityNotFound(_0x4b2ee5,null))[_0x3653('0x25')](respondWithResult(_0x4b2ee5,null))['catch'](handleError(_0x4b2ee5,null));};exports[_0x3653('0x24')]=function(_0x3f917f,_0x1b8790){if(_0x3f917f['body']['id']){delete _0x3f917f[_0x3653('0x49')]['id'];}return db[_0x3653('0x41')]['find']({'where':{'id':_0x3f917f[_0x3653('0x47')]['id']}})[_0x3653('0x25')](handleEntityNotFound(_0x1b8790,null))[_0x3653('0x25')](saveUpdates(_0x3f917f[_0x3653('0x49')],null))['then'](respondWithResult(_0x1b8790,null))['catch'](handleError(_0x1b8790,null));};exports[_0x3653('0x26')]=function(_0xd82c24,_0x1c7657){return db['CannedAnswer'][_0x3653('0x48')]({'where':{'id':_0xd82c24['params']['id']}})[_0x3653('0x25')](handleEntityNotFound(_0x1c7657,null))['then'](removeEntity(_0x1c7657,null))[_0x3653('0x46')](handleError(_0x1c7657,null));};exports[_0x3653('0x4a')]=function(_0x589d8e,_0xb605bf){var _0x282711={'key':_0x589d8e[_0x3653('0x49')][_0x3653('0x2e')]};if(_0x589d8e[_0x3653('0x49')]['MailAccountId']){_0x282711[_0x3653('0x4b')]=_0x589d8e['body'][_0x3653('0x4b')];}else if(_0x589d8e[_0x3653('0x49')][_0x3653('0x4c')]){_0x282711[_0x3653('0x4c')]=_0x589d8e[_0x3653('0x49')][_0x3653('0x4c')];}else if(_0x589d8e[_0x3653('0x49')][_0x3653('0x4d')]){_0x282711['OpenchannelAccountId']=_0x589d8e[_0x3653('0x49')]['OpenchannelAccountId'];}else if(_0x589d8e[_0x3653('0x49')][_0x3653('0x4e')]){_0x282711[_0x3653('0x4e')]=_0x589d8e[_0x3653('0x49')][_0x3653('0x4e')];}return db['CannedAnswer'][_0x3653('0x48')]({'where':_0x282711})[_0x3653('0x25')](function(_0xb39d03){if(_0xb39d03){throw new db[(_0x3653('0x4f'))][(_0x3653('0x50'))](_0x3653('0x51'));}return db[_0x3653('0x41')][_0x3653('0x4a')](_0x589d8e['body']);})[_0x3653('0x25')](function(_0x3b6163){var _0x1fbd65=_0x589d8e[_0x3653('0x52')][_0x3653('0x27')]({'plain':!![]});if(!_0x1fbd65)throw new Error(_0x3653('0x53'));if(_0x1fbd65[_0x3653('0x54')]===_0x3653('0x52')){var _0x20151e=_0x3b6163[_0x3653('0x27')]({'plain':!![]});return db[_0x3653('0x55')][_0x3653('0x48')]({'where':{'name':_0x3653('0x28'),'userProfileId':_0x1fbd65['userProfileId']},'raw':!![]})[_0x3653('0x25')](function(_0x317d17){if(_0x317d17&&_0x317d17[_0x3653('0x56')]===0x0){return db[_0x3653('0x29')][_0x3653('0x4a')]({'name':_0x20151e[_0x3653('0x31')],'resourceId':_0x20151e['id'],'type':_0x317d17[_0x3653('0x31')],'sectionId':_0x317d17['id']},{})[_0x3653('0x25')](function(){return _0x3b6163;});}else{return _0x3b6163;}})[_0x3653('0x46')](function(_0x1d2493){logger[_0x3653('0x2a')](_0x3653('0x57'),_0x1d2493);throw _0x1d2493;});}return _0x3b6163;})[_0x3653('0x25')](respondWithResult(_0xb605bf,0xc9))['catch'](handleError(_0xb605bf,null));};
\ No newline at end of file
+var _0x8de5=['fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','sort','where','filter','merge','options','findAll','catch','show','params','length','includeAll','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','find','Sequelize','ValidationError','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','stack','name','send','index','map','CannedAnswer','rawAttributes'];(function(_0x5c78d9,_0x2736c7){var _0x69ae1f=function(_0x4b31ac){while(--_0x4b31ac){_0x5c78d9['push'](_0x5c78d9['shift']());}};_0x69ae1f(++_0x2736c7);}(_0x8de5,0x1e1));var _0x58de=function(_0x31c115,_0x571962){_0x31c115=_0x31c115-0x0;var _0x3b7834=_0x8de5[_0x31c115];return _0x3b7834;};'use strict';var emlformat=require(_0x58de('0x0'));var rimraf=require(_0x58de('0x1'));var zipdir=require(_0x58de('0x2'));var jsonpatch=require(_0x58de('0x3'));var rp=require(_0x58de('0x4'));var moment=require(_0x58de('0x5'));var BPromise=require(_0x58de('0x6'));var Mustache=require(_0x58de('0x7'));var util=require(_0x58de('0x8'));var path=require(_0x58de('0x9'));var sox=require(_0x58de('0xa'));var csv=require('to-csv');var ejs=require(_0x58de('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x58de('0xc'));var squel=require(_0x58de('0xd'));var crypto=require(_0x58de('0xe'));var jsforce=require(_0x58de('0xf'));var deskjs=require(_0x58de('0x10'));var toCsv=require(_0x58de('0x11'));var querystring=require(_0x58de('0x12'));var Papa=require('papaparse');var Redis=require(_0x58de('0x13'));var authService=require(_0x58de('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x58de('0x15'));var hardwareService=require(_0x58de('0x16'));var logger=require(_0x58de('0x17'))(_0x58de('0x18'));var utils=require('../../config/utils');var config=require(_0x58de('0x19'));var licenseUtil=require(_0x58de('0x1a'));var db=require(_0x58de('0x1b'))['db'];function respondWithStatusCode(_0x31804c,_0x3b4b86){_0x3b4b86=_0x3b4b86||0xcc;return function(_0x92b35){if(_0x92b35){return _0x31804c[_0x58de('0x1c')](_0x3b4b86);}return _0x31804c[_0x58de('0x1d')](_0x3b4b86)[_0x58de('0x1e')]();};}function respondWithResult(_0x3b5ace,_0x567a80){_0x567a80=_0x567a80||0xc8;return function(_0x41f465){if(_0x41f465){return _0x3b5ace['status'](_0x567a80)[_0x58de('0x1f')](_0x41f465);}};}function respondWithFilteredResult(_0x22d1c3,_0x6f72a3){return function(_0x13cdb9){if(_0x13cdb9){var _0x720a38=typeof _0x6f72a3[_0x58de('0x20')]===_0x58de('0x21')&&typeof _0x6f72a3[_0x58de('0x22')]===_0x58de('0x21');var _0x55364e=_0x13cdb9[_0x58de('0x23')];var _0x53eb78=_0x720a38?0x0:_0x6f72a3[_0x58de('0x20')];var _0x819ad=_0x720a38?_0x13cdb9[_0x58de('0x23')]:_0x6f72a3[_0x58de('0x20')]+_0x6f72a3[_0x58de('0x22')];var _0x41ce69;if(_0x819ad>=_0x55364e){_0x819ad=_0x55364e;_0x41ce69=0xc8;}else{_0x41ce69=0xce;}_0x22d1c3['status'](_0x41ce69);return _0x22d1c3[_0x58de('0x24')](_0x58de('0x25'),_0x53eb78+'-'+_0x819ad+'/'+_0x55364e)['json'](_0x13cdb9);}return null;};}function patchUpdates(_0x48b823){return function(_0x3046f1){try{jsonpatch[_0x58de('0x26')](_0x3046f1,_0x48b823,!![]);}catch(_0x15c64c){return BPromise[_0x58de('0x27')](_0x15c64c);}return _0x3046f1[_0x58de('0x28')]();};}function saveUpdates(_0x286a76,_0x4e71be){return function(_0x5097c4){if(_0x5097c4){return _0x5097c4[_0x58de('0x29')](_0x286a76)[_0x58de('0x2a')](function(_0x4ca3a7){return _0x4ca3a7;});}return null;};}function removeEntity(_0x3ef53f,_0x5d3b44){return function(_0x3b8068){if(_0x3b8068){return _0x3b8068[_0x58de('0x2b')]()['then'](function(){var _0x61b6a7=_0x3b8068['get']({'plain':!![]});var _0x2b7c00=_0x58de('0x2c');return db[_0x58de('0x2d')][_0x58de('0x2b')]({'where':{'type':_0x2b7c00,'resourceId':_0x61b6a7['id']}})[_0x58de('0x2a')](function(){return _0x3b8068;});})[_0x58de('0x2a')](function(){_0x3ef53f[_0x58de('0x1d')](0xcc)[_0x58de('0x1e')]();});}};}function handleEntityNotFound(_0x314416,_0x3dadfc){return function(_0x117969){if(!_0x117969){_0x314416[_0x58de('0x1c')](0x194);}return _0x117969;};}function handleError(_0x2aa607,_0x2e79e0){_0x2e79e0=_0x2e79e0||0x1f4;return function(_0x1ad98a){logger['error'](_0x1ad98a[_0x58de('0x2e')]);if(_0x1ad98a[_0x58de('0x2f')]){delete _0x1ad98a[_0x58de('0x2f')];}_0x2aa607[_0x58de('0x1d')](_0x2e79e0)[_0x58de('0x30')](_0x1ad98a);};}exports[_0x58de('0x31')]=function(_0x534b9c,_0x2a7baa){var _0x2933fb={},_0x5774dd={},_0x14e7c3={'count':0x0,'rows':[]};var _0x4ca5a2=_[_0x58de('0x32')](db[_0x58de('0x33')][_0x58de('0x34')],function(_0x295081){return{'name':_0x295081[_0x58de('0x35')],'type':_0x295081[_0x58de('0x36')][_0x58de('0x37')]};});_0x5774dd[_0x58de('0x38')]=_[_0x58de('0x32')](_0x4ca5a2,_0x58de('0x2f'));_0x5774dd[_0x58de('0x39')]=_[_0x58de('0x3a')](_0x534b9c[_0x58de('0x39')]);_0x5774dd[_0x58de('0x3b')]=_[_0x58de('0x3c')](_0x5774dd[_0x58de('0x38')],_0x5774dd[_0x58de('0x39')]);_0x2933fb['attributes']=_['intersection'](_0x5774dd[_0x58de('0x38')],qs[_0x58de('0x3d')](_0x534b9c[_0x58de('0x39')][_0x58de('0x3d')]));_0x2933fb[_0x58de('0x3e')]=_0x2933fb['attributes']['length']?_0x2933fb[_0x58de('0x3e')]:_0x5774dd[_0x58de('0x38')];if(!_0x534b9c['query']['hasOwnProperty']('nolimit')){_0x2933fb[_0x58de('0x22')]=qs[_0x58de('0x22')](_0x534b9c[_0x58de('0x39')][_0x58de('0x22')]);_0x2933fb[_0x58de('0x20')]=qs[_0x58de('0x20')](_0x534b9c[_0x58de('0x39')][_0x58de('0x20')]);}_0x2933fb['order']=qs['sort'](_0x534b9c[_0x58de('0x39')][_0x58de('0x3f')]);_0x2933fb[_0x58de('0x40')]=qs['filters'](_['pick'](_0x534b9c['query'],_0x5774dd[_0x58de('0x3b')]),_0x4ca5a2);if(_0x534b9c['query'][_0x58de('0x41')]){_0x2933fb[_0x58de('0x40')]=_[_0x58de('0x42')](_0x2933fb[_0x58de('0x40')],{'$or':[{'key':{'$like':'%'+_0x534b9c[_0x58de('0x39')][_0x58de('0x41')]+'%'}},{'value':{'$like':'%'+_0x534b9c[_0x58de('0x39')]['filter']+'%'}}]});}_0x2933fb=_['merge']({},_0x2933fb,_0x534b9c[_0x58de('0x43')]);var _0x5814bd={'where':_0x2933fb[_0x58de('0x40')]};return db['CannedAnswer']['count'](_0x5814bd)['then'](function(_0x51fce6){_0x14e7c3[_0x58de('0x23')]=_0x51fce6;if(_0x534b9c['query']['includeAll']){_0x2933fb['include']=[{'all':!![]}];}return db[_0x58de('0x33')][_0x58de('0x44')](_0x2933fb);})[_0x58de('0x2a')](function(_0x30eb4b){_0x14e7c3['rows']=_0x30eb4b;return _0x14e7c3;})[_0x58de('0x2a')](respondWithFilteredResult(_0x2a7baa,_0x2933fb))[_0x58de('0x45')](handleError(_0x2a7baa,null));};exports[_0x58de('0x46')]=function(_0x3a6726,_0x3db979){var _0x2e842b={'raw':!![],'where':{'id':_0x3a6726[_0x58de('0x47')]['id']}},_0x51dad2={};_0x51dad2['model']=_[_0x58de('0x3a')](db['CannedAnswer'][_0x58de('0x34')]);_0x51dad2['query']=_[_0x58de('0x3a')](_0x3a6726['query']);_0x51dad2['filters']=_[_0x58de('0x3c')](_0x51dad2['model'],_0x51dad2[_0x58de('0x39')]);_0x2e842b['attributes']=_[_0x58de('0x3c')](_0x51dad2[_0x58de('0x38')],qs[_0x58de('0x3d')](_0x3a6726[_0x58de('0x39')][_0x58de('0x3d')]));_0x2e842b['attributes']=_0x2e842b[_0x58de('0x3e')][_0x58de('0x48')]?_0x2e842b[_0x58de('0x3e')]:_0x51dad2[_0x58de('0x38')];if(_0x3a6726['query'][_0x58de('0x49')]){_0x2e842b['include']=[{'all':!![]}];}_0x2e842b=_['merge']({},_0x2e842b,_0x3a6726[_0x58de('0x43')]);return db[_0x58de('0x33')]['find'](_0x2e842b)['then'](handleEntityNotFound(_0x3db979,null))[_0x58de('0x2a')](respondWithResult(_0x3db979,null))[_0x58de('0x45')](handleError(_0x3db979,null));};exports[_0x58de('0x29')]=function(_0x4806dc,_0x265248){if(_0x4806dc[_0x58de('0x4a')]['id']){delete _0x4806dc[_0x58de('0x4a')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x4806dc[_0x58de('0x47')]['id']}})[_0x58de('0x2a')](handleEntityNotFound(_0x265248,null))[_0x58de('0x2a')](saveUpdates(_0x4806dc[_0x58de('0x4a')],null))[_0x58de('0x2a')](respondWithResult(_0x265248,null))['catch'](handleError(_0x265248,null));};exports[_0x58de('0x2b')]=function(_0x254323,_0x4eed10){return db[_0x58de('0x33')]['find']({'where':{'id':_0x254323[_0x58de('0x47')]['id']}})[_0x58de('0x2a')](handleEntityNotFound(_0x4eed10,null))[_0x58de('0x2a')](removeEntity(_0x4eed10,null))[_0x58de('0x45')](handleError(_0x4eed10,null));};exports[_0x58de('0x4b')]=function(_0x244611,_0x5a6b62){var _0xf7b558={'key':_0x244611[_0x58de('0x4a')][_0x58de('0x37')]};if(_0x244611[_0x58de('0x4a')][_0x58de('0x4c')]){_0xf7b558[_0x58de('0x4c')]=_0x244611[_0x58de('0x4a')]['MailAccountId'];}else if(_0x244611[_0x58de('0x4a')]['SmsAccountId']){_0xf7b558[_0x58de('0x4d')]=_0x244611[_0x58de('0x4a')][_0x58de('0x4d')];}else if(_0x244611[_0x58de('0x4a')][_0x58de('0x4e')]){_0xf7b558['OpenchannelAccountId']=_0x244611[_0x58de('0x4a')]['OpenchannelAccountId'];}else if(_0x244611['body'][_0x58de('0x4f')]){_0xf7b558['ChatWebsiteId']=_0x244611[_0x58de('0x4a')][_0x58de('0x4f')];}return db[_0x58de('0x33')][_0x58de('0x50')]({'where':_0xf7b558})[_0x58de('0x2a')](function(_0x1f1c0e){if(_0x1f1c0e){throw new db[(_0x58de('0x51'))][(_0x58de('0x52'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x58de('0x33')][_0x58de('0x4b')](_0x244611[_0x58de('0x4a')]);})[_0x58de('0x2a')](function(_0x305f38){var _0x15f28a=_0x244611[_0x58de('0x53')][_0x58de('0x54')]({'plain':!![]});if(!_0x15f28a)throw new Error(_0x58de('0x55'));if(_0x15f28a[_0x58de('0x56')]===_0x58de('0x53')){var _0x309551=_0x305f38[_0x58de('0x54')]({'plain':!![]});return db[_0x58de('0x57')][_0x58de('0x50')]({'where':{'name':_0x58de('0x2c'),'userProfileId':_0x15f28a[_0x58de('0x58')]},'raw':!![]})['then'](function(_0x5eab15){if(_0x5eab15&&_0x5eab15['autoAssociation']===0x0){return db[_0x58de('0x2d')]['create']({'name':_0x309551[_0x58de('0x2f')],'resourceId':_0x309551['id'],'type':_0x5eab15['name'],'sectionId':_0x5eab15['id']},{})[_0x58de('0x2a')](function(){return _0x305f38;});}else{return _0x305f38;}})[_0x58de('0x45')](function(_0xf2f903){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf2f903);throw _0xf2f903;});}return _0x305f38;})[_0x58de('0x2a')](respondWithResult(_0x5a6b62,0xc9))[_0x58de('0x45')](handleError(_0x5a6b62,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 0ade65b..a709f16 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 _0xe171=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','utf8mb4'];(function(_0x5680f9,_0x4e96a8){var _0x1dd746=function(_0x284ce4){while(--_0x284ce4){_0x5680f9['push'](_0x5680f9['shift']());}};_0x1dd746(++_0x4e96a8);}(_0xe171,0xeb));var _0x1e17=function(_0x570d20,_0x185c1a){_0x570d20=_0x570d20-0x0;var _0x5872a8=_0xe171[_0x570d20];return _0x5872a8;};'use strict';var _=require(_0x1e17('0x0'));var util=require('util');var logger=require(_0x1e17('0x1'))(_0x1e17('0x2'));var moment=require(_0x1e17('0x3'));var BPromise=require('bluebird');var rp=require(_0x1e17('0x4'));var fs=require('fs');var path=require(_0x1e17('0x5'));var rimraf=require(_0x1e17('0x6'));var config=require(_0x1e17('0x7'));var attributes=require(_0x1e17('0x8'));module['exports']=function(_0x364dae,_0x5b14ad){return _0x364dae[_0x1e17('0x9')](_0x1e17('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1e17('0xb'),'collate':_0x1e17('0xc')});};
\ No newline at end of file
+var _0xcb8e=['request-promise','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','lodash','../../config/logger','api','moment','bluebird'];(function(_0x291717,_0x54b354){var _0x5d1e50=function(_0x4309ac){while(--_0x4309ac){_0x291717['push'](_0x291717['shift']());}};_0x5d1e50(++_0x54b354);}(_0xcb8e,0x1f3));var _0xecb8=function(_0x511ef8,_0x485338){_0x511ef8=_0x511ef8-0x0;var _0x1bbc3f=_0xcb8e[_0x511ef8];return _0x1bbc3f;};'use strict';var _=require(_0xecb8('0x0'));var util=require('util');var logger=require(_0xecb8('0x1'))(_0xecb8('0x2'));var moment=require(_0xecb8('0x3'));var BPromise=require(_0xecb8('0x4'));var rp=require(_0xecb8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xecb8('0x6'));var config=require(_0xecb8('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0xecb8('0x8')]=function(_0x2e1101,_0x3a2100){return _0x2e1101[_0xecb8('0x9')](_0xecb8('0xa'),attributes,{'tableName':_0xecb8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 80927c4..ddb254c 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(_0xefd8a0,_0x286b7b){var _0x4c4897=function(_0x7793ac){while(--_0x7793ac){_0xefd8a0['push'](_0xefd8a0['shift']());}};_0x4c4897(++_0x286b7b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x44b714,_0x46e6e8){var _0x66fd8b=function(_0x11056c){while(--_0x11056c){_0x44b714['push'](_0x44b714['shift']());}};_0x66fd8b(++_0x46e6e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 7d7dfc6..63b765e 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 _0x3599=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','index','isAuthenticated','create','/:id','update','delete','destroy'];(function(_0x57b3df,_0x445081){var _0x206656=function(_0x16aeb3){while(--_0x16aeb3){_0x57b3df['push'](_0x57b3df['shift']());}};_0x206656(++_0x445081);}(_0x3599,0x170));var _0x9359=function(_0x58b0c9,_0x372df0){_0x58b0c9=_0x58b0c9-0x0;var _0x227a49=_0x3599[_0x58b0c9];return _0x227a49;};'use strict';var multer=require(_0x9359('0x0'));var util=require('util');var path=require(_0x9359('0x1'));var timeout=require(_0x9359('0x2'));var express=require(_0x9359('0x3'));var router=express[_0x9359('0x4')]();var fs_extra=require(_0x9359('0x5'));var auth=require(_0x9359('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9359('0x7'));var controller=require(_0x9359('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9359('0x9')]);router['get']('/:id',auth[_0x9359('0xa')](),controller['show']);router['post']('/',auth[_0x9359('0xa')](),controller[_0x9359('0xb')]);router['put'](_0x9359('0xc'),auth[_0x9359('0xa')](),controller[_0x9359('0xd')]);router[_0x9359('0xe')](_0x9359('0xc'),auth[_0x9359('0xa')](),controller[_0x9359('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xf655=['isAuthenticated','index','get','show','post','put','delete','/:id','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller'];(function(_0x2bdf17,_0x6d8f38){var _0xdde346=function(_0x2dfbe3){while(--_0x2dfbe3){_0x2bdf17['push'](_0x2bdf17['shift']());}};_0xdde346(++_0x6d8f38);}(_0xf655,0x199));var _0x5f65=function(_0x5239e2,_0x5e0d5b){_0x5239e2=_0x5239e2-0x0;var _0x1f6a59=_0xf655[_0x5239e2];return _0x1f6a59;};'use strict';var multer=require(_0x5f65('0x0'));var util=require(_0x5f65('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5f65('0x2')]();var fs_extra=require(_0x5f65('0x3'));var auth=require(_0x5f65('0x4'));var interaction=require(_0x5f65('0x5'));var config=require('../../config/environment');var controller=require(_0x5f65('0x6'));router['get']('/',auth[_0x5f65('0x7')](),controller[_0x5f65('0x8')]);router[_0x5f65('0x9')]('/:id',auth[_0x5f65('0x7')](),controller[_0x5f65('0xa')]);router[_0x5f65('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5f65('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5f65('0xd')](_0x5f65('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x5f65('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index be3b147..886342f 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 _0x402f=['DATE','STRING','INTEGER','sequelize'];(function(_0x20e43f,_0x3a9a95){var _0xa76f8=function(_0x225db6){while(--_0x225db6){_0x20e43f['push'](_0x20e43f['shift']());}};_0xa76f8(++_0x3a9a95);}(_0x402f,0x6f));var _0xf402=function(_0x308c2e,_0x21ba44){_0x308c2e=_0x308c2e-0x0;var _0x2ef55d=_0x402f[_0x308c2e];return _0x2ef55d;};'use strict';var Sequelize=require(_0xf402('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xf402('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xf402('0x2')]},'dst':{'type':Sequelize[_0xf402('0x2')]},'dcontext':{'type':Sequelize[_0xf402('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xf402('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf402('0x2')]},'duration':{'type':Sequelize[_0xf402('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf402('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf402('0x2')]},'amaflags':{'type':Sequelize[_0xf402('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf402('0x2')]},'linkedid':{'type':Sequelize[_0xf402('0x2')]},'sequence':{'type':Sequelize[_0xf402('0x2')]},'peeraccount':{'type':Sequelize[_0xf402('0x2')]},'type':{'type':Sequelize[_0xf402('0x2')]},'tag':{'type':Sequelize[_0xf402('0x2')]}};
\ No newline at end of file
+var _0xee5b=['sequelize','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x59513e,_0x15eec4){var _0x469a1b=function(_0x3a4dc7){while(--_0x3a4dc7){_0x59513e['push'](_0x59513e['shift']());}};_0x469a1b(++_0x15eec4);}(_0xee5b,0x1f4));var _0xbee5=function(_0x34ea19,_0x4a8ffe){_0x34ea19=_0x34ea19-0x0;var _0x31e059=_0xee5b[_0x34ea19];return _0x31e059;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xbee5('0x1')],'allowNull':![],'defaultValue':_0xbee5('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xbee5('0x3')]},'dst':{'type':Sequelize[_0xbee5('0x3')]},'dcontext':{'type':Sequelize[_0xbee5('0x3')]},'channel':{'type':Sequelize[_0xbee5('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xbee5('0x3')]},'duration':{'type':Sequelize[_0xbee5('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xbee5('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbee5('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xbee5('0x3')]},'peeraccount':{'type':Sequelize[_0xbee5('0x3')]},'type':{'type':Sequelize[_0xbee5('0x3')]},'tag':{'type':Sequelize[_0xbee5('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 7cb340f..9395ba1 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 _0x6b8f=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','apply','reject','save','update','destroy','then','end','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','filters','intersection','model'];(function(_0x2df413,_0x5303ae){var _0x1f5133=function(_0xb2347c){while(--_0xb2347c){_0x2df413['push'](_0x2df413['shift']());}};_0x1f5133(++_0x5303ae);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x302da8,_0x32ad49){_0x302da8=_0x302da8-0x0;var _0x456c5d=_0x6b8f[_0x302da8];return _0x456c5d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6b8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6b8('0x2'));var Mustache=require(_0xf6b8('0x3'));var util=require('util');var path=require(_0xf6b8('0x4'));var sox=require(_0xf6b8('0x5'));var csv=require(_0xf6b8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6b8('0x7'));var _=require(_0xf6b8('0x8'));var squel=require(_0xf6b8('0x9'));var crypto=require(_0xf6b8('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6b8('0x6'));var querystring=require('querystring');var Papa=require(_0xf6b8('0xb'));var Redis=require(_0xf6b8('0xc'));var authService=require(_0xf6b8('0xd'));var qs=require(_0xf6b8('0xe'));var as=require(_0xf6b8('0xf'));var hardwareService=require(_0xf6b8('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf6b8('0x11'));var licenseUtil=require(_0xf6b8('0x12'));var db=require(_0xf6b8('0x13'))['db'];function respondWithStatusCode(_0x1d96b9,_0x5a6118){_0x5a6118=_0x5a6118||0xcc;return function(_0x4e5235){if(_0x4e5235){return _0x1d96b9[_0xf6b8('0x14')](_0x5a6118);}return _0x1d96b9[_0xf6b8('0x15')](_0x5a6118)['end']();};}function respondWithResult(_0xfcecc9,_0x2db10c){_0x2db10c=_0x2db10c||0xc8;return function(_0x454d8a){if(_0x454d8a){return _0xfcecc9['status'](_0x2db10c)[_0xf6b8('0x16')](_0x454d8a);}};}function respondWithFilteredResult(_0x53d744,_0x410345){return function(_0x1ee041){if(_0x1ee041){var _0x2e1748=typeof _0x410345[_0xf6b8('0x17')]===_0xf6b8('0x18')&&typeof _0x410345['limit']==='undefined';var _0x3bb9ae=_0x1ee041['count'];var _0x3cf63c=_0x2e1748?0x0:_0x410345[_0xf6b8('0x17')];var _0x4a93a8=_0x2e1748?_0x1ee041['count']:_0x410345[_0xf6b8('0x17')]+_0x410345[_0xf6b8('0x19')];var _0x3081db;if(_0x4a93a8>=_0x3bb9ae){_0x4a93a8=_0x3bb9ae;_0x3081db=0xc8;}else{_0x3081db=0xce;}_0x53d744[_0xf6b8('0x15')](_0x3081db);return _0x53d744['set']('Content-Range',_0x3cf63c+'-'+_0x4a93a8+'/'+_0x3bb9ae)['json'](_0x1ee041);}return null;};}function patchUpdates(_0x3298a4){return function(_0x2a8195){try{jsonpatch[_0xf6b8('0x1a')](_0x2a8195,_0x3298a4,!![]);}catch(_0x56b48a){return BPromise[_0xf6b8('0x1b')](_0x56b48a);}return _0x2a8195[_0xf6b8('0x1c')]();};}function saveUpdates(_0x3d2c57,_0x9c660c){return function(_0x5dd616){if(_0x5dd616){return _0x5dd616[_0xf6b8('0x1d')](_0x3d2c57)['then'](function(_0x22c52d){return _0x22c52d;});}return null;};}function removeEntity(_0x2b5bd3,_0x13a451){return function(_0x4127c9){if(_0x4127c9){return _0x4127c9[_0xf6b8('0x1e')]()[_0xf6b8('0x1f')](function(){_0x2b5bd3['status'](0xcc)[_0xf6b8('0x20')]();});}};}function handleEntityNotFound(_0x1ebfea,_0x4815f7){return function(_0x205d6c){if(!_0x205d6c){_0x1ebfea[_0xf6b8('0x14')](0x194);}return _0x205d6c;};}function handleError(_0x324057,_0xd5ebb5){_0xd5ebb5=_0xd5ebb5||0x1f4;return function(_0x3365b8){logger['error'](_0x3365b8['stack']);if(_0x3365b8[_0xf6b8('0x21')]){delete _0x3365b8[_0xf6b8('0x21')];}_0x324057['status'](_0xd5ebb5)[_0xf6b8('0x22')](_0x3365b8);};}exports[_0xf6b8('0x23')]=function(_0x888319,_0x5a7f55){var _0x458935={},_0xc958f4={},_0x511896={'count':0x0,'rows':[]};var _0x309f04=_[_0xf6b8('0x24')](db[_0xf6b8('0x25')][_0xf6b8('0x26')],function(_0x51ffcf){return{'name':_0x51ffcf[_0xf6b8('0x27')],'type':_0x51ffcf[_0xf6b8('0x28')][_0xf6b8('0x29')]};});_0xc958f4['model']=_[_0xf6b8('0x24')](_0x309f04,_0xf6b8('0x21'));_0xc958f4[_0xf6b8('0x2a')]=_['keys'](_0x888319[_0xf6b8('0x2a')]);_0xc958f4[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],_0xc958f4['query']);_0x458935[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],qs['fields'](_0x888319['query'][_0xf6b8('0x2f')]));_0x458935[_0xf6b8('0x2e')]=_0x458935[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x458935[_0xf6b8('0x2e')]:_0xc958f4[_0xf6b8('0x2d')];if(!_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x31')](_0xf6b8('0x32'))){_0x458935[_0xf6b8('0x19')]=qs[_0xf6b8('0x19')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x19')]);_0x458935[_0xf6b8('0x17')]=qs[_0xf6b8('0x17')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x17')]);}_0x458935[_0xf6b8('0x33')]=qs['sort'](_0x888319['query'][_0xf6b8('0x34')]);_0x458935[_0xf6b8('0x35')]=qs[_0xf6b8('0x2b')](_[_0xf6b8('0x36')](_0x888319[_0xf6b8('0x2a')],_0xc958f4[_0xf6b8('0x2b')]),_0x309f04);if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]){_0x458935[_0xf6b8('0x35')]=_[_0xf6b8('0x38')](_0x458935[_0xf6b8('0x35')],{'$or':_[_0xf6b8('0x24')](_0x309f04,function(_0x4a8c49){if(_0x4a8c49[_0xf6b8('0x28')]!==_0xf6b8('0x39')){var _0x5d26ad={};_0x5d26ad[_0x4a8c49[_0xf6b8('0x21')]]={'$like':'%'+_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]+'%'};return _0x5d26ad;}})});}_0x458935=_[_0xf6b8('0x38')]({},_0x458935,_0x888319[_0xf6b8('0x3a')]);var _0x87a4ee={'where':_0x458935[_0xf6b8('0x35')]};return db[_0xf6b8('0x25')][_0xf6b8('0x3b')](_0x87a4ee)[_0xf6b8('0x1f')](function(_0x15a63b){_0x511896[_0xf6b8('0x3b')]=_0x15a63b;if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x3c')]){_0x458935['include']=[{'all':!![]}];}return db['Cdr']['findAll'](_0x458935);})[_0xf6b8('0x1f')](function(_0x2c68f5){_0x511896[_0xf6b8('0x3d')]=_0x2c68f5;return _0x511896;})[_0xf6b8('0x1f')](respondWithFilteredResult(_0x5a7f55,_0x458935))[_0xf6b8('0x3e')](handleError(_0x5a7f55,null));};exports[_0xf6b8('0x3f')]=function(_0x1390dc,_0x48f4cb){var _0x1f5e72={'raw':!![],'where':{'id':_0x1390dc[_0xf6b8('0x40')]['id']}},_0x5086d9={};_0x5086d9[_0xf6b8('0x2d')]=_[_0xf6b8('0x41')](db[_0xf6b8('0x25')][_0xf6b8('0x26')]);_0x5086d9['query']=_[_0xf6b8('0x41')](_0x1390dc[_0xf6b8('0x2a')]);_0x5086d9[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],_0x5086d9['query']);_0x1f5e72[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],qs['fields'](_0x1390dc['query'][_0xf6b8('0x2f')]));_0x1f5e72[_0xf6b8('0x2e')]=_0x1f5e72[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x1f5e72['attributes']:_0x5086d9['model'];if(_0x1390dc['query'][_0xf6b8('0x3c')]){_0x1f5e72['include']=[{'all':!![]}];}_0x1f5e72=_[_0xf6b8('0x38')]({},_0x1f5e72,_0x1390dc[_0xf6b8('0x3a')]);return db[_0xf6b8('0x25')][_0xf6b8('0x42')](_0x1f5e72)[_0xf6b8('0x1f')](handleEntityNotFound(_0x48f4cb,null))[_0xf6b8('0x1f')](respondWithResult(_0x48f4cb,null))[_0xf6b8('0x3e')](handleError(_0x48f4cb,null));};exports[_0xf6b8('0x43')]=function(_0x394a34,_0x597511){return db[_0xf6b8('0x25')]['create'](_0x394a34[_0xf6b8('0x44')],{})[_0xf6b8('0x1f')](respondWithResult(_0x597511,0xc9))[_0xf6b8('0x3e')](handleError(_0x597511,null));};exports[_0xf6b8('0x1d')]=function(_0x1abf17,_0x291845){if(_0x1abf17[_0xf6b8('0x44')]['id']){delete _0x1abf17['body']['id'];}return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x1abf17[_0xf6b8('0x40')]['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x291845,null))['then'](saveUpdates(_0x1abf17[_0xf6b8('0x44')],null))[_0xf6b8('0x1f')](respondWithResult(_0x291845,null))['catch'](handleError(_0x291845,null));};exports[_0xf6b8('0x1e')]=function(_0x143164,_0x392582){return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x143164['params']['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x392582,null))[_0xf6b8('0x1f')](removeEntity(_0x392582,null))['catch'](handleError(_0x392582,null));};exports['describe']=function(_0x55c392,_0x22c1eb){return db[_0xf6b8('0x25')][_0xf6b8('0x45')]()[_0xf6b8('0x1f')](respondWithResult(_0x22c1eb,null))['catch'](handleError(_0x22c1eb,null));};
\ No newline at end of file
+var _0xb138=['filters','pick','VIRTUAL','merge','includeAll','include','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where'];(function(_0x2ec0b7,_0x1931c){var _0x44b5a7=function(_0x5285de){while(--_0x5285de){_0x2ec0b7['push'](_0x2ec0b7['shift']());}};_0x44b5a7(++_0x1931c);}(_0xb138,0x1dd));var _0x8b13=function(_0x39ff9c,_0x35d13a){_0x39ff9c=_0x39ff9c-0x0;var _0x4ff2d2=_0xb138[_0x39ff9c];return _0x4ff2d2;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['map'](_0x35fdca,_0x8b13('0x2b'));_0x2bb51d[_0x8b13('0x35')]=_[_0x8b13('0x36')](_0x3475d8[_0x8b13('0x35')]);_0x2bb51d['filters']=_['intersection'](_0x2bb51d[_0x8b13('0x34')],_0x2bb51d['query']);_0x114b01['attributes']=_[_0x8b13('0x37')](_0x2bb51d['model'],qs[_0x8b13('0x38')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x38')]));_0x114b01[_0x8b13('0x39')]=_0x114b01[_0x8b13('0x39')][_0x8b13('0x3a')]?_0x114b01[_0x8b13('0x39')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8[_0x8b13('0x35')][_0x8b13('0x3b')]('nolimit')){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3c')](_0x3475d8['query'][_0x8b13('0x3c')]);_0x114b01[_0x8b13('0x3d')]=qs[_0x8b13('0x3e')](_[_0x8b13('0x3f')](_0x3475d8[_0x8b13('0x35')],_0x2bb51d[_0x8b13('0x3e')]),_0x35fdca);if(_0x3475d8['query']['filter']){_0x114b01[_0x8b13('0x3d')]=_['merge'](_0x114b01[_0x8b13('0x3d')],{'$or':_['map'](_0x35fdca,function(_0x590a23){if(_0x590a23[_0x8b13('0x32')]!==_0x8b13('0x40')){var _0x2bc877={};_0x2bc877[_0x590a23[_0x8b13('0x2b')]]={'$like':'%'+_0x3475d8['query']['filter']+'%'};return _0x2bc877;}})});}_0x114b01=_[_0x8b13('0x41')]({},_0x114b01,_0x3475d8['options']);var _0x6ba2f3={'where':_0x114b01[_0x8b13('0x3d')]};return db['Cdr'][_0x8b13('0x20')](_0x6ba2f3)[_0x8b13('0x26')](function(_0x35c1d6){_0x5ab161[_0x8b13('0x20')]=_0x35c1d6;if(_0x3475d8[_0x8b13('0x35')][_0x8b13('0x42')]){_0x114b01[_0x8b13('0x43')]=[{'all':!![]}];}return db['Cdr']['findAll'](_0x114b01);})['then'](function(_0x3eb3c5){_0x5ab161[_0x8b13('0x44')]=_0x3eb3c5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x45')](handleError(_0x1511bf,null));};exports[_0x8b13('0x46')]=function(_0x271507,_0x492f7d){var _0x4342db={'raw':!![],'where':{'id':_0x271507[_0x8b13('0x47')]['id']}},_0x50e535={};_0x50e535['model']=_[_0x8b13('0x36')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x50e535[_0x8b13('0x35')]=_[_0x8b13('0x36')](_0x271507[_0x8b13('0x35')]);_0x50e535[_0x8b13('0x3e')]=_['intersection'](_0x50e535['model'],_0x50e535['query']);_0x4342db[_0x8b13('0x39')]=_[_0x8b13('0x37')](_0x50e535[_0x8b13('0x34')],qs[_0x8b13('0x38')](_0x271507['query']['fields']));_0x4342db[_0x8b13('0x39')]=_0x4342db['attributes'][_0x8b13('0x3a')]?_0x4342db[_0x8b13('0x39')]:_0x50e535[_0x8b13('0x34')];if(_0x271507[_0x8b13('0x35')][_0x8b13('0x42')]){_0x4342db['include']=[{'all':!![]}];}_0x4342db=_[_0x8b13('0x41')]({},_0x4342db,_0x271507[_0x8b13('0x48')]);return db[_0x8b13('0x2f')][_0x8b13('0x49')](_0x4342db)[_0x8b13('0x26')](handleEntityNotFound(_0x492f7d,null))[_0x8b13('0x26')](respondWithResult(_0x492f7d,null))[_0x8b13('0x45')](handleError(_0x492f7d,null));};exports[_0x8b13('0x4a')]=function(_0x3e192b,_0x518298){return db[_0x8b13('0x2f')]['create'](_0x3e192b[_0x8b13('0x4b')],{})[_0x8b13('0x26')](respondWithResult(_0x518298,0xc9))[_0x8b13('0x45')](handleError(_0x518298,null));};exports['update']=function(_0x148efb,_0x35f612){if(_0x148efb[_0x8b13('0x4b')]['id']){delete _0x148efb[_0x8b13('0x4b')]['id'];}return db[_0x8b13('0x2f')][_0x8b13('0x49')]({'where':{'id':_0x148efb[_0x8b13('0x47')]['id']}})['then'](handleEntityNotFound(_0x35f612,null))[_0x8b13('0x26')](saveUpdates(_0x148efb['body'],null))[_0x8b13('0x26')](respondWithResult(_0x35f612,null))[_0x8b13('0x45')](handleError(_0x35f612,null));};exports[_0x8b13('0x27')]=function(_0x435867,_0x2be640){return db[_0x8b13('0x2f')][_0x8b13('0x49')]({'where':{'id':_0x435867[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x2be640,null))[_0x8b13('0x26')](removeEntity(_0x2be640,null))[_0x8b13('0x45')](handleError(_0x2be640,null));};exports[_0x8b13('0x4c')]=function(_0xd55f3b,_0x2bdfae){return db[_0x8b13('0x2f')][_0x8b13('0x4c')]()[_0x8b13('0x26')](respondWithResult(_0x2bdfae,null))['catch'](handleError(_0x2bdfae,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index bcbf1fd..e5f94ef 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x480361,_0x24e86d){var _0x347d09=function(_0x5ff02d){while(--_0x5ff02d){_0x480361['push'](_0x480361['shift']());}};_0x347d09(++_0x24e86d);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3d5cd9,_0x16db35){var _0x116080=function(_0x4c80fc){while(--_0x4c80fc){_0x3d5cd9['push'](_0x3d5cd9['shift']());}};_0x116080(++_0x16db35);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 2b1ead3..0affbb7 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 _0x1f6d=['http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x1f6d,0x19a));var _0xd1f6=function(_0x18860c,_0x4af1bb){_0x18860c=_0x18860c-0x0;var _0x51f126=_0x1f6d[_0x18860c];return _0x51f126;};'use strict';var _=require(_0xd1f6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd1f6('0x1'));var rs=require(_0xd1f6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1f6('0x3'))['db'];var utils=require(_0xd1f6('0x4'));var logger=require('../../config/logger')(_0xd1f6('0x5'));var config=require(_0xd1f6('0x6'));var jayson=require(_0xd1f6('0x7'));var client=jayson['client'][_0xd1f6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17030b,_0x5116be,_0x1bca2f){return new BPromise(function(_0x508c05,_0x4cf19b){return client[_0xd1f6('0x9')](_0x17030b,_0x1bca2f)[_0xd1f6('0xa')](function(_0x26916b){logger['info'](_0xd1f6('0xb'),_0x5116be,_0xd1f6('0xc'));logger[_0xd1f6('0xd')]('Cdr,\x20%s,\x20%s,\x20%s',_0x5116be,_0xd1f6('0xc'),JSON[_0xd1f6('0xe')](_0x26916b));if(_0x26916b[_0xd1f6('0xf')]){if(_0x26916b[_0xd1f6('0xf')][_0xd1f6('0x10')]===0x1f4){logger[_0xd1f6('0xf')](_0xd1f6('0xb'),_0x5116be,_0x26916b['error'][_0xd1f6('0x11')]);return _0x4cf19b(_0x26916b[_0xd1f6('0xf')][_0xd1f6('0x11')]);}logger[_0xd1f6('0xf')](_0xd1f6('0xb'),_0x5116be,_0x26916b[_0xd1f6('0xf')][_0xd1f6('0x11')]);return _0x508c05(_0x26916b[_0xd1f6('0xf')][_0xd1f6('0x11')]);}else{logger['info'](_0xd1f6('0xb'),_0x5116be,_0xd1f6('0xc'));_0x508c05(_0x26916b['result'][_0xd1f6('0x11')]);}})[_0xd1f6('0x12')](function(_0x19c060){logger[_0xd1f6('0xf')](_0xd1f6('0xb'),_0x5116be,_0x19c060);_0x4cf19b(_0x19c060);});});}
\ No newline at end of file
+var _0x5b4c=['bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','lodash','util','moment'];(function(_0x52967f,_0x5a463d){var _0x5e671f=function(_0x2b3dbb){while(--_0x2b3dbb){_0x52967f['push'](_0x52967f['shift']());}};_0x5e671f(++_0x5a463d);}(_0x5b4c,0xb1));var _0xc5b4=function(_0x14e704,_0x2ae9f4){_0x14e704=_0x14e704-0x0;var _0x2ff43b=_0x5b4c[_0x14e704];return _0x2ff43b;};'use strict';var _=require(_0xc5b4('0x0'));var util=require(_0xc5b4('0x1'));var moment=require(_0xc5b4('0x2'));var BPromise=require(_0xc5b4('0x3'));var rs=require(_0xc5b4('0x4'));var fs=require('fs');var Redis=require(_0xc5b4('0x5'));var db=require(_0xc5b4('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc5b4('0x7'));var config=require('../../config/environment');var jayson=require(_0xc5b4('0x8'));var client=jayson[_0xc5b4('0x9')][_0xc5b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x522f38,_0x148217,_0x3633c1){return new BPromise(function(_0xa5acc,_0x598210){return client['request'](_0x522f38,_0x3633c1)[_0xc5b4('0xb')](function(_0x93c855){logger[_0xc5b4('0xc')](_0xc5b4('0xd'),_0x148217,'request\x20sent');logger[_0xc5b4('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x148217,_0xc5b4('0xf'),JSON['stringify'](_0x93c855));if(_0x93c855[_0xc5b4('0x10')]){if(_0x93c855['error'][_0xc5b4('0x11')]===0x1f4){logger['error'](_0xc5b4('0xd'),_0x148217,_0x93c855[_0xc5b4('0x10')][_0xc5b4('0x12')]);return _0x598210(_0x93c855[_0xc5b4('0x10')]['message']);}logger[_0xc5b4('0x10')](_0xc5b4('0xd'),_0x148217,_0x93c855[_0xc5b4('0x10')][_0xc5b4('0x12')]);return _0xa5acc(_0x93c855[_0xc5b4('0x10')][_0xc5b4('0x12')]);}else{logger['info'](_0xc5b4('0xd'),_0x148217,'request\x20sent');_0xa5acc(_0x93c855['result'][_0xc5b4('0x12')]);}})[_0xc5b4('0x13')](function(_0x47dddd){logger[_0xc5b4('0x10')](_0xc5b4('0xd'),_0x148217,_0x47dddd);_0x598210(_0x47dddd);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 350f858..7d2518e 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _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(_0x1e8972,_0x12b85d){var _0x353f33=function(_0x16f1da){while(--_0x16f1da){_0x1e8972['push'](_0x1e8972['shift']());}};_0x353f33(++_0x12b85d);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 822361e..5f1a7c3 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 _0xfb7f=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xfb7f,0x1a6));var _0xffb7=function(_0x2405a8,_0x453e33){_0x2405a8=_0x2405a8-0x0;var _0x2b31a3=_0xfb7f[_0x2405a8];return _0x2b31a3;};'use strict';var Sequelize=require(_0xffb7('0x0'));module[_0xffb7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xffb7('0x2')],'allowNull':![],'defaultValue':_0xffb7('0x3')},'appdata':{'type':Sequelize[_0xffb7('0x4')]()},'description':{'type':Sequelize[_0xffb7('0x2')]},'interval':{'type':Sequelize[_0xffb7('0x2')],'defaultValue':_0xffb7('0x5')}};
\ No newline at end of file
+var _0x439c=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x439c,0xbb));var _0xc439=function(_0x7f31fe,_0x28e264){_0x7f31fe=_0x7f31fe-0x0;var _0x1bbdff=_0x439c[_0x7f31fe];return _0x1bbdff;};'use strict';var Sequelize=require(_0xc439('0x0'));module[_0xc439('0x1')]={'priority':{'type':Sequelize[_0xc439('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc439('0x3')],'allowNull':![],'defaultValue':_0xc439('0x4')},'appdata':{'type':Sequelize[_0xc439('0x5')]()},'description':{'type':Sequelize[_0xc439('0x3')]},'interval':{'type':Sequelize[_0xc439('0x3')],'defaultValue':_0xc439('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 13a12d9..1443739 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 _0xaf1d=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','include','merge','find','catch','body','ChatApplication','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf1d,0x9f));var _0xdaf1=function(_0x53bdff,_0x377d10){_0x53bdff=_0x53bdff-0x0;var _0x43fdbf=_0xaf1d[_0x53bdff];return _0x43fdbf;};'use strict';var emlformat=require(_0xdaf1('0x0'));var rimraf=require(_0xdaf1('0x1'));var zipdir=require(_0xdaf1('0x2'));var jsonpatch=require(_0xdaf1('0x3'));var rp=require('request-promise');var moment=require(_0xdaf1('0x4'));var BPromise=require(_0xdaf1('0x5'));var Mustache=require('mustache');var util=require(_0xdaf1('0x6'));var path=require(_0xdaf1('0x7'));var sox=require(_0xdaf1('0x8'));var csv=require(_0xdaf1('0x9'));var ejs=require(_0xdaf1('0xa'));var fs=require('fs');var fs_extra=require(_0xdaf1('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdaf1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdaf1('0xd'));var Papa=require(_0xdaf1('0xe'));var Redis=require(_0xdaf1('0xf'));var authService=require(_0xdaf1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdaf1('0x11'));var hardwareService=require(_0xdaf1('0x12'));var logger=require(_0xdaf1('0x13'))(_0xdaf1('0x14'));var utils=require(_0xdaf1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdaf1('0x16'));var db=require(_0xdaf1('0x17'))['db'];function respondWithStatusCode(_0x260c4b,_0x112c60){_0x112c60=_0x112c60||0xcc;return function(_0x3543e1){if(_0x3543e1){return _0x260c4b[_0xdaf1('0x18')](_0x112c60);}return _0x260c4b[_0xdaf1('0x19')](_0x112c60)[_0xdaf1('0x1a')]();};}function respondWithResult(_0x9a5ec6,_0x7393af){_0x7393af=_0x7393af||0xc8;return function(_0x2add26){if(_0x2add26){return _0x9a5ec6[_0xdaf1('0x19')](_0x7393af)[_0xdaf1('0x1b')](_0x2add26);}};}function respondWithFilteredResult(_0x4ed852,_0x506590){return function(_0x2e98d4){if(_0x2e98d4){var _0x562534=typeof _0x506590[_0xdaf1('0x1c')]==='undefined'&&typeof _0x506590[_0xdaf1('0x1d')]===_0xdaf1('0x1e');var _0xc1141c=_0x2e98d4['count'];var _0x1dd985=_0x562534?0x0:_0x506590['offset'];var _0x4896c1=_0x562534?_0x2e98d4[_0xdaf1('0x1f')]:_0x506590[_0xdaf1('0x1c')]+_0x506590[_0xdaf1('0x1d')];var _0x36792f;if(_0x4896c1>=_0xc1141c){_0x4896c1=_0xc1141c;_0x36792f=0xc8;}else{_0x36792f=0xce;}_0x4ed852['status'](_0x36792f);return _0x4ed852['set'](_0xdaf1('0x20'),_0x1dd985+'-'+_0x4896c1+'/'+_0xc1141c)[_0xdaf1('0x1b')](_0x2e98d4);}return null;};}function patchUpdates(_0x37b377){return function(_0x5030e5){try{jsonpatch[_0xdaf1('0x21')](_0x5030e5,_0x37b377,!![]);}catch(_0x2e776d){return BPromise[_0xdaf1('0x22')](_0x2e776d);}return _0x5030e5[_0xdaf1('0x23')]();};}function saveUpdates(_0x77d6c6,_0x110e33){return function(_0x446c5b){if(_0x446c5b){return _0x446c5b[_0xdaf1('0x24')](_0x77d6c6)[_0xdaf1('0x25')](function(_0x28916c){return _0x28916c;});}return null;};}function removeEntity(_0x56b426,_0x1f97e4){return function(_0x41b020){if(_0x41b020){return _0x41b020[_0xdaf1('0x26')]()['then'](function(){_0x56b426['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x556bd8,_0x2e6bf4){return function(_0x10c286){if(!_0x10c286){_0x556bd8['sendStatus'](0x194);}return _0x10c286;};}function handleError(_0x997245,_0x3c2166){_0x3c2166=_0x3c2166||0x1f4;return function(_0x3125d7){logger['error'](_0x3125d7[_0xdaf1('0x27')]);if(_0x3125d7[_0xdaf1('0x28')]){delete _0x3125d7['name'];}_0x997245[_0xdaf1('0x19')](_0x3c2166)[_0xdaf1('0x29')](_0x3125d7);};}exports[_0xdaf1('0x2a')]=function(_0x3892ae,_0x6731f6){var _0x16f6e0={'raw':!![],'where':{'id':_0x3892ae[_0xdaf1('0x2b')]['id']}},_0x520500={};_0x520500[_0xdaf1('0x2c')]=_['keys'](db['ChatApplication'][_0xdaf1('0x2d')]);_0x520500[_0xdaf1('0x2e')]=_[_0xdaf1('0x2f')](_0x3892ae['query']);_0x520500[_0xdaf1('0x30')]=_[_0xdaf1('0x31')](_0x520500[_0xdaf1('0x2c')],_0x520500[_0xdaf1('0x2e')]);_0x16f6e0[_0xdaf1('0x32')]=_['intersection'](_0x520500[_0xdaf1('0x2c')],qs[_0xdaf1('0x33')](_0x3892ae[_0xdaf1('0x2e')]['fields']));_0x16f6e0['attributes']=_0x16f6e0[_0xdaf1('0x32')]['length']?_0x16f6e0[_0xdaf1('0x32')]:_0x520500[_0xdaf1('0x2c')];if(_0x3892ae[_0xdaf1('0x2e')]['includeAll']){_0x16f6e0[_0xdaf1('0x34')]=[{'all':!![]}];}_0x16f6e0=_[_0xdaf1('0x35')]({},_0x16f6e0,_0x3892ae['options']);return db['ChatApplication'][_0xdaf1('0x36')](_0x16f6e0)[_0xdaf1('0x25')](handleEntityNotFound(_0x6731f6,null))['then'](respondWithResult(_0x6731f6,null))[_0xdaf1('0x37')](handleError(_0x6731f6,null));};exports[_0xdaf1('0x24')]=function(_0x318565,_0x57b9ca){if(_0x318565[_0xdaf1('0x38')]['id']){delete _0x318565[_0xdaf1('0x38')]['id'];}return db[_0xdaf1('0x39')][_0xdaf1('0x36')]({'where':{'id':_0x318565['params']['id']}})[_0xdaf1('0x25')](handleEntityNotFound(_0x57b9ca,null))[_0xdaf1('0x25')](saveUpdates(_0x318565[_0xdaf1('0x38')],null))[_0xdaf1('0x25')](respondWithResult(_0x57b9ca,null))[_0xdaf1('0x37')](handleError(_0x57b9ca,null));};exports['destroy']=function(_0x219551,_0x20dee8){return db[_0xdaf1('0x39')]['find']({'where':{'id':_0x219551[_0xdaf1('0x2b')]['id']}})['then'](handleEntityNotFound(_0x20dee8,null))[_0xdaf1('0x25')](removeEntity(_0x20dee8,null))[_0xdaf1('0x37')](handleError(_0x20dee8,null));};
\ No newline at end of file
+var _0x6a24=['error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x26addd,_0x255a1e){var _0x13a6b2=function(_0xb4d373){while(--_0xb4d373){_0x26addd['push'](_0x26addd['shift']());}};_0x13a6b2(++_0x255a1e);}(_0x6a24,0xd1));var _0x46a2=function(_0xe4fe77,_0xd8330e){_0xe4fe77=_0xe4fe77-0x0;var _0xeb8cd6=_0x6a24[_0xe4fe77];return _0xeb8cd6;};'use strict';var emlformat=require(_0x46a2('0x0'));var rimraf=require(_0x46a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46a2('0x2'));var rp=require(_0x46a2('0x3'));var moment=require(_0x46a2('0x4'));var BPromise=require(_0x46a2('0x5'));var Mustache=require(_0x46a2('0x6'));var util=require('util');var path=require(_0x46a2('0x7'));var sox=require(_0x46a2('0x8'));var csv=require('to-csv');var ejs=require(_0x46a2('0x9'));var fs=require('fs');var fs_extra=require(_0x46a2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x46a2('0xb'));var jsforce=require(_0x46a2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x46a2('0xd'));var querystring=require('querystring');var Papa=require(_0x46a2('0xe'));var Redis=require('ioredis');var authService=require(_0x46a2('0xf'));var qs=require(_0x46a2('0x10'));var as=require(_0x46a2('0x11'));var hardwareService=require(_0x46a2('0x12'));var logger=require(_0x46a2('0x13'))(_0x46a2('0x14'));var utils=require(_0x46a2('0x15'));var config=require(_0x46a2('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x403282,_0x18e584){_0x18e584=_0x18e584||0xcc;return function(_0x5c5d10){if(_0x5c5d10){return _0x403282[_0x46a2('0x17')](_0x18e584);}return _0x403282[_0x46a2('0x18')](_0x18e584)[_0x46a2('0x19')]();};}function respondWithResult(_0x18a038,_0xddc328){_0xddc328=_0xddc328||0xc8;return function(_0x2fd383){if(_0x2fd383){return _0x18a038[_0x46a2('0x18')](_0xddc328)[_0x46a2('0x1a')](_0x2fd383);}};}function respondWithFilteredResult(_0x577591,_0x4a7e7a){return function(_0x3c81e8){if(_0x3c81e8){var _0x2deb20=typeof _0x4a7e7a['offset']===_0x46a2('0x1b')&&typeof _0x4a7e7a[_0x46a2('0x1c')]==='undefined';var _0xa2eb96=_0x3c81e8[_0x46a2('0x1d')];var _0x577f18=_0x2deb20?0x0:_0x4a7e7a[_0x46a2('0x1e')];var _0x24f75f=_0x2deb20?_0x3c81e8['count']:_0x4a7e7a[_0x46a2('0x1e')]+_0x4a7e7a[_0x46a2('0x1c')];var _0x5144c7;if(_0x24f75f>=_0xa2eb96){_0x24f75f=_0xa2eb96;_0x5144c7=0xc8;}else{_0x5144c7=0xce;}_0x577591[_0x46a2('0x18')](_0x5144c7);return _0x577591[_0x46a2('0x1f')](_0x46a2('0x20'),_0x577f18+'-'+_0x24f75f+'/'+_0xa2eb96)[_0x46a2('0x1a')](_0x3c81e8);}return null;};}function patchUpdates(_0x202294){return function(_0x2d65c2){try{jsonpatch[_0x46a2('0x21')](_0x2d65c2,_0x202294,!![]);}catch(_0x473cfb){return BPromise[_0x46a2('0x22')](_0x473cfb);}return _0x2d65c2[_0x46a2('0x23')]();};}function saveUpdates(_0x5c7586,_0xa37d90){return function(_0x504b9e){if(_0x504b9e){return _0x504b9e[_0x46a2('0x24')](_0x5c7586)[_0x46a2('0x25')](function(_0x511ff6){return _0x511ff6;});}return null;};}function removeEntity(_0x43dc69,_0x15e5bb){return function(_0x233c4e){if(_0x233c4e){return _0x233c4e[_0x46a2('0x26')]()['then'](function(){_0x43dc69[_0x46a2('0x18')](0xcc)[_0x46a2('0x19')]();});}};}function handleEntityNotFound(_0x1e48f5,_0x297158){return function(_0x74bb6a){if(!_0x74bb6a){_0x1e48f5[_0x46a2('0x17')](0x194);}return _0x74bb6a;};}function handleError(_0x3e9554,_0xfa9e13){_0xfa9e13=_0xfa9e13||0x1f4;return function(_0x218f1c){logger[_0x46a2('0x27')](_0x218f1c[_0x46a2('0x28')]);if(_0x218f1c['name']){delete _0x218f1c[_0x46a2('0x29')];}_0x3e9554[_0x46a2('0x18')](_0xfa9e13)[_0x46a2('0x2a')](_0x218f1c);};}exports[_0x46a2('0x2b')]=function(_0x435155,_0x33f42a){var _0x577fd2={'raw':!![],'where':{'id':_0x435155[_0x46a2('0x2c')]['id']}},_0x185647={};_0x185647[_0x46a2('0x2d')]=_[_0x46a2('0x2e')](db[_0x46a2('0x2f')][_0x46a2('0x30')]);_0x185647[_0x46a2('0x31')]=_['keys'](_0x435155[_0x46a2('0x31')]);_0x185647[_0x46a2('0x32')]=_[_0x46a2('0x33')](_0x185647[_0x46a2('0x2d')],_0x185647[_0x46a2('0x31')]);_0x577fd2[_0x46a2('0x34')]=_[_0x46a2('0x33')](_0x185647[_0x46a2('0x2d')],qs[_0x46a2('0x35')](_0x435155['query'][_0x46a2('0x35')]));_0x577fd2[_0x46a2('0x34')]=_0x577fd2[_0x46a2('0x34')][_0x46a2('0x36')]?_0x577fd2[_0x46a2('0x34')]:_0x185647['model'];if(_0x435155['query'][_0x46a2('0x37')]){_0x577fd2[_0x46a2('0x38')]=[{'all':!![]}];}_0x577fd2=_[_0x46a2('0x39')]({},_0x577fd2,_0x435155[_0x46a2('0x3a')]);return db[_0x46a2('0x2f')][_0x46a2('0x3b')](_0x577fd2)['then'](handleEntityNotFound(_0x33f42a,null))['then'](respondWithResult(_0x33f42a,null))[_0x46a2('0x3c')](handleError(_0x33f42a,null));};exports['update']=function(_0x462374,_0x3fe076){if(_0x462374[_0x46a2('0x3d')]['id']){delete _0x462374[_0x46a2('0x3d')]['id'];}return db['ChatApplication'][_0x46a2('0x3b')]({'where':{'id':_0x462374[_0x46a2('0x2c')]['id']}})[_0x46a2('0x25')](handleEntityNotFound(_0x3fe076,null))[_0x46a2('0x25')](saveUpdates(_0x462374['body'],null))[_0x46a2('0x25')](respondWithResult(_0x3fe076,null))[_0x46a2('0x3c')](handleError(_0x3fe076,null));};exports[_0x46a2('0x26')]=function(_0x1cff82,_0x4fa161){return db[_0x46a2('0x2f')]['find']({'where':{'id':_0x1cff82[_0x46a2('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4fa161,null))[_0x46a2('0x25')](removeEntity(_0x4fa161,null))[_0x46a2('0x3c')](handleError(_0x4fa161,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 394dcec..ce5fa92 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 _0x6db1=['ChatApplication','chat_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x10a3b5,_0x195ca5){var _0x4c1604=function(_0x3e073c){while(--_0x3e073c){_0x10a3b5['push'](_0x10a3b5['shift']());}};_0x4c1604(++_0x195ca5);}(_0x6db1,0x13e));var _0x16db=function(_0x38d83c,_0x589bd0){_0x38d83c=_0x38d83c-0x0;var _0x38c3bb=_0x6db1[_0x38d83c];return _0x38c3bb;};'use strict';var _=require(_0x16db('0x0'));var util=require(_0x16db('0x1'));var logger=require(_0x16db('0x2'))(_0x16db('0x3'));var moment=require(_0x16db('0x4'));var BPromise=require(_0x16db('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x16db('0x6'));var rimraf=require(_0x16db('0x7'));var config=require(_0x16db('0x8'));var attributes=require(_0x16db('0x9'));module[_0x16db('0xa')]=function(_0x1cf88f,_0x38b8af){return _0x1cf88f[_0x16db('0xb')](_0x16db('0xc'),attributes,{'tableName':_0x16db('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x16db('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x67c7=['bluebird','request-promise','path','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x32290e,_0x1a0749){var _0x12762f=function(_0x2b1d2b){while(--_0x2b1d2b){_0x32290e['push'](_0x32290e['shift']());}};_0x12762f(++_0x1a0749);}(_0x67c7,0x172));var _0x767c=function(_0xa599e2,_0x3046be){_0xa599e2=_0xa599e2-0x0;var _0x122f49=_0x67c7[_0xa599e2];return _0x122f49;};'use strict';var _=require(_0x767c('0x0'));var util=require(_0x767c('0x1'));var logger=require(_0x767c('0x2'))(_0x767c('0x3'));var moment=require(_0x767c('0x4'));var BPromise=require(_0x767c('0x5'));var rp=require(_0x767c('0x6'));var fs=require('fs');var path=require(_0x767c('0x7'));var rimraf=require('rimraf');var config=require(_0x767c('0x8'));var attributes=require(_0x767c('0x9'));module['exports']=function(_0x116f27,_0xf3bf74){return _0x116f27[_0x767c('0xa')](_0x767c('0xb'),attributes,{'tableName':_0x767c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x767c('0xd'),'collate':_0x767c('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index dd597ec..b011bab 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 _0x65a4=['jayson/promise','client','http','request','then','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','ChatApplication,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xacc326,_0x56bc9f){var _0x37143f=function(_0x12526a){while(--_0x12526a){_0xacc326['push'](_0xacc326['shift']());}};_0x37143f(++_0x56bc9f);}(_0x65a4,0xf4));var _0x465a=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x65a4[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x465a('0x0'));var util=require('util');var moment=require(_0x465a('0x1'));var BPromise=require(_0x465a('0x2'));var rs=require(_0x465a('0x3'));var fs=require('fs');var Redis=require(_0x465a('0x4'));var db=require(_0x465a('0x5'))['db'];var utils=require(_0x465a('0x6'));var logger=require('../../config/logger')(_0x465a('0x7'));var config=require('../../config/environment');var jayson=require(_0x465a('0x8'));var client=jayson[_0x465a('0x9')][_0x465a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31cf34,_0x343dc6,_0x3706ff){return new BPromise(function(_0xfcfeaa,_0x48ce11){return client[_0x465a('0xb')](_0x31cf34,_0x3706ff)[_0x465a('0xc')](function(_0x1c9eb5){logger['info']('ChatApplication,\x20%s,\x20%s',_0x343dc6,_0x465a('0xd'));logger['debug'](_0x465a('0xe'),_0x343dc6,_0x465a('0xd'),JSON['stringify'](_0x1c9eb5));if(_0x1c9eb5[_0x465a('0xf')]){if(_0x1c9eb5[_0x465a('0xf')]['code']===0x1f4){logger[_0x465a('0xf')](_0x465a('0x10'),_0x343dc6,_0x1c9eb5[_0x465a('0xf')][_0x465a('0x11')]);return _0x48ce11(_0x1c9eb5[_0x465a('0xf')][_0x465a('0x11')]);}logger[_0x465a('0xf')](_0x465a('0x10'),_0x343dc6,_0x1c9eb5[_0x465a('0xf')][_0x465a('0x11')]);return _0xfcfeaa(_0x1c9eb5[_0x465a('0xf')][_0x465a('0x11')]);}else{logger[_0x465a('0x12')](_0x465a('0x10'),_0x343dc6,_0x465a('0xd'));_0xfcfeaa(_0x1c9eb5[_0x465a('0x13')]['message']);}})[_0x465a('0x14')](function(_0x3d80b4){logger[_0x465a('0xf')](_0x465a('0x10'),_0x343dc6,_0x3d80b4);_0x48ce11(_0x3d80b4);});});}
\ No newline at end of file
+var _0xb599=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x249935,_0x2c405d){var _0x305bb0=function(_0x4fe26f){while(--_0x4fe26f){_0x249935['push'](_0x249935['shift']());}};_0x305bb0(++_0x2c405d);}(_0xb599,0x6e));var _0x9b59=function(_0x2d1817,_0x10589e){_0x2d1817=_0x2d1817-0x0;var _0x130746=_0xb599[_0x2d1817];return _0x130746;};'use strict';var _=require('lodash');var util=require(_0x9b59('0x0'));var moment=require(_0x9b59('0x1'));var BPromise=require(_0x9b59('0x2'));var rs=require(_0x9b59('0x3'));var fs=require('fs');var Redis=require(_0x9b59('0x4'));var db=require(_0x9b59('0x5'))['db'];var utils=require(_0x9b59('0x6'));var logger=require(_0x9b59('0x7'))(_0x9b59('0x8'));var config=require(_0x9b59('0x9'));var jayson=require(_0x9b59('0xa'));var client=jayson[_0x9b59('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xef7f55,_0x170f99,_0x2b5c11){return new BPromise(function(_0x140b37,_0x499f73){return client['request'](_0xef7f55,_0x2b5c11)[_0x9b59('0xc')](function(_0xf5cd5f){logger[_0x9b59('0xd')](_0x9b59('0xe'),_0x170f99,_0x9b59('0xf'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x170f99,'request\x20sent',JSON[_0x9b59('0x10')](_0xf5cd5f));if(_0xf5cd5f[_0x9b59('0x11')]){if(_0xf5cd5f[_0x9b59('0x11')][_0x9b59('0x12')]===0x1f4){logger[_0x9b59('0x11')](_0x9b59('0xe'),_0x170f99,_0xf5cd5f[_0x9b59('0x11')][_0x9b59('0x13')]);return _0x499f73(_0xf5cd5f['error'][_0x9b59('0x13')]);}logger[_0x9b59('0x11')](_0x9b59('0xe'),_0x170f99,_0xf5cd5f[_0x9b59('0x11')]['message']);return _0x140b37(_0xf5cd5f['error']['message']);}else{logger[_0x9b59('0xd')](_0x9b59('0xe'),_0x170f99,_0x9b59('0xf'));_0x140b37(_0xf5cd5f[_0x9b59('0x14')][_0x9b59('0x13')]);}})[_0x9b59('0x15')](function(_0x31700a){logger['error'](_0x9b59('0xe'),_0x170f99,_0x31700a);_0x499f73(_0x31700a);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 1818210..ff8209f 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 _0x8514=['destroy','exports','multer','util','path','express','Router','../../config/environment','./chatApplication.controller','get','isAuthenticated','put','/:id','delete'];(function(_0x196c4e,_0xb8263e){var _0x1fabb6=function(_0x35ba45){while(--_0x35ba45){_0x196c4e['push'](_0x196c4e['shift']());}};_0x1fabb6(++_0xb8263e);}(_0x8514,0x1a6));var _0x4851=function(_0x48afc5,_0x16647a){_0x48afc5=_0x48afc5-0x0;var _0x14a9b1=_0x8514[_0x48afc5];return _0x14a9b1;};'use strict';var multer=require(_0x4851('0x0'));var util=require(_0x4851('0x1'));var path=require(_0x4851('0x2'));var timeout=require('connect-timeout');var express=require(_0x4851('0x3'));var router=express[_0x4851('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4851('0x5'));var controller=require(_0x4851('0x6'));router[_0x4851('0x7')]('/:id',auth[_0x4851('0x8')](),controller['show']);router[_0x4851('0x9')](_0x4851('0xa'),auth[_0x4851('0x8')](),controller['update']);router[_0x4851('0xb')]('/:id',auth[_0x4851('0x8')](),controller[_0x4851('0xc')]);module[_0x4851('0xd')]=router;
\ No newline at end of file
+var _0x95f7=['../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5825be,_0x1c8318){var _0x5b7559=function(_0x115086){while(--_0x115086){_0x5825be['push'](_0x5825be['shift']());}};_0x5b7559(++_0x1c8318);}(_0x95f7,0x1a2));var _0x795f=function(_0x7e1895,_0x11758a){_0x7e1895=_0x7e1895-0x0;var _0x5b5320=_0x95f7[_0x7e1895];return _0x5b5320;};'use strict';var multer=require(_0x795f('0x0'));var util=require(_0x795f('0x1'));var path=require(_0x795f('0x2'));var timeout=require(_0x795f('0x3'));var express=require(_0x795f('0x4'));var router=express[_0x795f('0x5')]();var fs_extra=require(_0x795f('0x6'));var auth=require(_0x795f('0x7'));var interaction=require(_0x795f('0x8'));var config=require('../../config/environment');var controller=require(_0x795f('0x9'));router[_0x795f('0xa')](_0x795f('0xb'),auth[_0x795f('0xc')](),controller[_0x795f('0xd')]);router['put'](_0x795f('0xb'),auth[_0x795f('0xc')](),controller[_0x795f('0xe')]);router[_0x795f('0xf')](_0x795f('0xb'),auth[_0x795f('0xc')](),controller[_0x795f('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index f3ee131..b5c9881 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 _0xfaee=['BOOLEAN','sequelize','exports','STRING'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xfaee,0x15d));var _0xefae=function(_0x53cc66,_0x5162fc){_0x53cc66=_0x53cc66-0x0;var _0x6effae=_0xfaee[_0x53cc66];return _0x6effae;};'use strict';var Sequelize=require(_0xefae('0x0'));module[_0xefae('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xefae('0x2')]},'write':{'type':Sequelize[_0xefae('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x0018=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4e3c21,_0x286f50){var _0x50250d=function(_0x401f37){while(--_0x401f37){_0x4e3c21['push'](_0x4e3c21['shift']());}};_0x50250d(++_0x286f50);}(_0x0018,0x1aa));var _0x8001=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0018[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x8001('0x0'));module[_0x8001('0x1')]={'name':{'type':Sequelize[_0x8001('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8001('0x2')]},'write':{'type':Sequelize[_0x8001('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 31a94b6..ecde9af 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 _0x53ec=['catch','body','params','describe','ChatInternalMessage','user','addMembers','ids','omit','findOne','User','rawAttributes','order','options','getMembers','nolimit','removeMembers','addMessage','ChatGroupId','create','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','ChatGroup','fieldName','type','key','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','sort','filters','pick','filter','where','VIRTUAL','merge','includeAll','include','rows','show','find'];(function(_0x1b6546,_0x4d8b88){var _0x365e23=function(_0x480707){while(--_0x480707){_0x1b6546['push'](_0x1b6546['shift']());}};_0x365e23(++_0x4d8b88);}(_0x53ec,0x147));var _0xc53e=function(_0x2577d9,_0x8f2f28){_0x2577d9=_0x2577d9-0x0;var _0x36fe58=_0x53ec[_0x2577d9];return _0x36fe58;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc53e('0x2'));var rp=require(_0xc53e('0x3'));var moment=require('moment');var BPromise=require(_0xc53e('0x4'));var Mustache=require(_0xc53e('0x5'));var util=require(_0xc53e('0x6'));var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require(_0xc53e('0x9'));var ejs=require(_0xc53e('0xa'));var fs=require('fs');var fs_extra=require(_0xc53e('0xb'));var _=require(_0xc53e('0xc'));var squel=require(_0xc53e('0xd'));var crypto=require(_0xc53e('0xe'));var jsforce=require(_0xc53e('0xf'));var deskjs=require(_0xc53e('0x10'));var toCsv=require(_0xc53e('0x9'));var querystring=require(_0xc53e('0x11'));var Papa=require(_0xc53e('0x12'));var Redis=require(_0xc53e('0x13'));var authService=require(_0xc53e('0x14'));var qs=require(_0xc53e('0x15'));var as=require(_0xc53e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc53e('0x17'))(_0xc53e('0x18'));var utils=require(_0xc53e('0x19'));var config=require(_0xc53e('0x1a'));var licenseUtil=require(_0xc53e('0x1b'));var db=require(_0xc53e('0x1c'))['db'];config[_0xc53e('0x1d')]=_['defaults'](config[_0xc53e('0x1d')],{'host':_0xc53e('0x1e'),'port':0x18eb});var socket=require(_0xc53e('0x1f'))(new Redis(config['redis']));require(_0xc53e('0x20'))[_0xc53e('0x21')](socket);function respondWithStatusCode(_0x3003c9,_0x200bec){_0x200bec=_0x200bec||0xcc;return function(_0x10a1f7){if(_0x10a1f7){return _0x3003c9[_0xc53e('0x22')](_0x200bec);}return _0x3003c9[_0xc53e('0x23')](_0x200bec)[_0xc53e('0x24')]();};}function respondWithResult(_0x212f1a,_0xf0ec5e){_0xf0ec5e=_0xf0ec5e||0xc8;return function(_0x3a46b9){if(_0x3a46b9){return _0x212f1a[_0xc53e('0x23')](_0xf0ec5e)[_0xc53e('0x25')](_0x3a46b9);}};}function respondWithFilteredResult(_0x31c675,_0x424f5f){return function(_0x376c7f){if(_0x376c7f){var _0x391876=typeof _0x424f5f[_0xc53e('0x26')]===_0xc53e('0x27')&&typeof _0x424f5f[_0xc53e('0x28')]===_0xc53e('0x27');var _0x3e3904=_0x376c7f[_0xc53e('0x29')];var _0x45ac06=_0x391876?0x0:_0x424f5f[_0xc53e('0x26')];var _0x4ec45a=_0x391876?_0x376c7f['count']:_0x424f5f[_0xc53e('0x26')]+_0x424f5f['limit'];var _0x4d3e7a;if(_0x4ec45a>=_0x3e3904){_0x4ec45a=_0x3e3904;_0x4d3e7a=0xc8;}else{_0x4d3e7a=0xce;}_0x31c675['status'](_0x4d3e7a);return _0x31c675[_0xc53e('0x2a')](_0xc53e('0x2b'),_0x45ac06+'-'+_0x4ec45a+'/'+_0x3e3904)[_0xc53e('0x25')](_0x376c7f);}return null;};}function patchUpdates(_0xcbe7a6){return function(_0x241415){try{jsonpatch[_0xc53e('0x2c')](_0x241415,_0xcbe7a6,!![]);}catch(_0x144878){return BPromise[_0xc53e('0x2d')](_0x144878);}return _0x241415['save']();};}function saveUpdates(_0x499a87,_0x5714d6){return function(_0x5716a9){if(_0x5716a9){return _0x5716a9[_0xc53e('0x2e')](_0x499a87)[_0xc53e('0x2f')](function(_0x174d69){return _0x174d69;});}return null;};}function removeEntity(_0x8fa090,_0x269369){return function(_0x389bee){if(_0x389bee){return _0x389bee[_0xc53e('0x30')]()[_0xc53e('0x2f')](function(){_0x8fa090[_0xc53e('0x23')](0xcc)[_0xc53e('0x24')]();});}};}function handleEntityNotFound(_0xa1906a,_0x3a0f25){return function(_0x2c4d3e){if(!_0x2c4d3e){_0xa1906a[_0xc53e('0x22')](0x194);}return _0x2c4d3e;};}function handleError(_0xcbc1c2,_0x3768a5){_0x3768a5=_0x3768a5||0x1f4;return function(_0x58c9e9){logger[_0xc53e('0x31')](_0x58c9e9['stack']);if(_0x58c9e9[_0xc53e('0x32')]){delete _0x58c9e9[_0xc53e('0x32')];}_0xcbc1c2[_0xc53e('0x23')](_0x3768a5)[_0xc53e('0x33')](_0x58c9e9);};}exports['index']=function(_0x4ad03a,_0x2a9408){var _0xc2e202={},_0x53c3d0={},_0x5cf0aa={'count':0x0,'rows':[]};var _0x526c73=_['map'](db[_0xc53e('0x34')]['rawAttributes'],function(_0x17add7){return{'name':_0x17add7[_0xc53e('0x35')],'type':_0x17add7[_0xc53e('0x36')][_0xc53e('0x37')]};});_0x53c3d0['model']=_[_0xc53e('0x38')](_0x526c73,_0xc53e('0x32'));_0x53c3d0[_0xc53e('0x39')]=_[_0xc53e('0x3a')](_0x4ad03a[_0xc53e('0x39')]);_0x53c3d0['filters']=_['intersection'](_0x53c3d0[_0xc53e('0x3b')],_0x53c3d0[_0xc53e('0x39')]);_0xc2e202[_0xc53e('0x3c')]=_[_0xc53e('0x3d')](_0x53c3d0[_0xc53e('0x3b')],qs[_0xc53e('0x3e')](_0x4ad03a['query'][_0xc53e('0x3e')]));_0xc2e202['attributes']=_0xc2e202[_0xc53e('0x3c')][_0xc53e('0x3f')]?_0xc2e202[_0xc53e('0x3c')]:_0x53c3d0['model'];if(!_0x4ad03a['query'][_0xc53e('0x40')]('nolimit')){_0xc2e202[_0xc53e('0x28')]=qs[_0xc53e('0x28')](_0x4ad03a['query'][_0xc53e('0x28')]);_0xc2e202[_0xc53e('0x26')]=qs[_0xc53e('0x26')](_0x4ad03a[_0xc53e('0x39')][_0xc53e('0x26')]);}_0xc2e202['order']=qs[_0xc53e('0x41')](_0x4ad03a[_0xc53e('0x39')]['sort']);_0xc2e202['where']=qs[_0xc53e('0x42')](_[_0xc53e('0x43')](_0x4ad03a[_0xc53e('0x39')],_0x53c3d0['filters']),_0x526c73);if(_0x4ad03a[_0xc53e('0x39')][_0xc53e('0x44')]){_0xc2e202[_0xc53e('0x45')]=_['merge'](_0xc2e202['where'],{'$or':_[_0xc53e('0x38')](_0x526c73,function(_0x2c0f36){if(_0x2c0f36['type']!==_0xc53e('0x46')){var _0x19fae9={};_0x19fae9[_0x2c0f36[_0xc53e('0x32')]]={'$like':'%'+_0x4ad03a[_0xc53e('0x39')]['filter']+'%'};return _0x19fae9;}})});}_0xc2e202=_[_0xc53e('0x47')]({},_0xc2e202,_0x4ad03a['options']);var _0x341fec={'where':_0xc2e202[_0xc53e('0x45')]};return db[_0xc53e('0x34')][_0xc53e('0x29')](_0x341fec)[_0xc53e('0x2f')](function(_0x513d7d){_0x5cf0aa[_0xc53e('0x29')]=_0x513d7d;if(_0x4ad03a[_0xc53e('0x39')][_0xc53e('0x48')]){_0xc2e202[_0xc53e('0x49')]=[{'all':!![]}];}return db[_0xc53e('0x34')]['findAll'](_0xc2e202);})[_0xc53e('0x2f')](function(_0x3154a6){_0x5cf0aa[_0xc53e('0x4a')]=_0x3154a6;return _0x5cf0aa;})[_0xc53e('0x2f')](respondWithFilteredResult(_0x2a9408,_0xc2e202))['catch'](handleError(_0x2a9408,null));};exports[_0xc53e('0x4b')]=function(_0x332a76,_0xa167f9){var _0x1b3cc4={'raw':!![],'where':{'id':_0x332a76['params']['id']}},_0x59333e={};_0x59333e[_0xc53e('0x3b')]=_['keys'](db[_0xc53e('0x34')]['rawAttributes']);_0x59333e[_0xc53e('0x39')]=_['keys'](_0x332a76['query']);_0x59333e[_0xc53e('0x42')]=_[_0xc53e('0x3d')](_0x59333e[_0xc53e('0x3b')],_0x59333e[_0xc53e('0x39')]);_0x1b3cc4['attributes']=_[_0xc53e('0x3d')](_0x59333e['model'],qs[_0xc53e('0x3e')](_0x332a76['query'][_0xc53e('0x3e')]));_0x1b3cc4[_0xc53e('0x3c')]=_0x1b3cc4[_0xc53e('0x3c')][_0xc53e('0x3f')]?_0x1b3cc4[_0xc53e('0x3c')]:_0x59333e[_0xc53e('0x3b')];if(_0x332a76['query']['includeAll']){_0x1b3cc4[_0xc53e('0x49')]=[{'all':!![]}];}_0x1b3cc4=_[_0xc53e('0x47')]({},_0x1b3cc4,_0x332a76['options']);return db[_0xc53e('0x34')][_0xc53e('0x4c')](_0x1b3cc4)[_0xc53e('0x2f')](handleEntityNotFound(_0xa167f9,null))[_0xc53e('0x2f')](respondWithResult(_0xa167f9,null))[_0xc53e('0x4d')](handleError(_0xa167f9,null));};exports['create']=function(_0x4fb84a,_0x3ce123){return db[_0xc53e('0x34')]['create'](_0x4fb84a[_0xc53e('0x4e')],{})[_0xc53e('0x2f')](respondWithResult(_0x3ce123,0xc9))[_0xc53e('0x4d')](handleError(_0x3ce123,null));};exports[_0xc53e('0x2e')]=function(_0xdcb289,_0x86b286){if(_0xdcb289['body']['id']){delete _0xdcb289[_0xc53e('0x4e')]['id'];}return db[_0xc53e('0x34')][_0xc53e('0x4c')]({'where':{'id':_0xdcb289[_0xc53e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x86b286,null))['then'](saveUpdates(_0xdcb289[_0xc53e('0x4e')],null))[_0xc53e('0x2f')](respondWithResult(_0x86b286,null))[_0xc53e('0x4d')](handleError(_0x86b286,null));};exports['destroy']=function(_0x37951c,_0x43f827){return db[_0xc53e('0x34')]['find']({'where':{'id':_0x37951c['params']['id']}})[_0xc53e('0x2f')](handleEntityNotFound(_0x43f827,null))[_0xc53e('0x2f')](removeEntity(_0x43f827,null))[_0xc53e('0x4d')](handleError(_0x43f827,null));};exports[_0xc53e('0x50')]=function(_0x1892f6,_0x36c7d5){return db['ChatGroup'][_0xc53e('0x50')]()[_0xc53e('0x2f')](respondWithResult(_0x36c7d5,null))['catch'](handleError(_0x36c7d5,null));};exports['getUnread']=function(_0x2bcc0c,_0x28c826,_0x2b8e80){return db[_0xc53e('0x51')][_0xc53e('0x29')]({'where':{'ChatGroupId':_0x2bcc0c[_0xc53e('0x4f')]['id'],'ToId':_0x2bcc0c[_0xc53e('0x52')]['id'],'read':![]}})['then'](function(_0x71a06a){return{'id':_['toInteger'](_0x2bcc0c[_0xc53e('0x4f')]['id']),'count':_0x71a06a};})['then'](respondWithResult(_0x28c826,null))[_0xc53e('0x4d')](handleError(_0x28c826,null));};exports[_0xc53e('0x53')]=function(_0x27f297,_0x2b5a89,_0x4a9692){return db[_0xc53e('0x34')]['find']({'where':{'id':_0x27f297[_0xc53e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2b5a89,null))[_0xc53e('0x2f')](function(_0x2cc666){if(_0x2cc666){return _0x2cc666['addMembers'](_0x27f297[_0xc53e('0x4e')][_0xc53e('0x54')],_[_0xc53e('0x55')](_0x27f297[_0xc53e('0x4e')],['ids','id'])||{});}})[_0xc53e('0x2f')](respondWithResult(_0x2b5a89,null))['catch'](handleError(_0x2b5a89,null));};exports['getMembers']=function(_0x3a34a3,_0x5107bd,_0x45479c){var _0x4c42d5={};var _0xb4c23e={};var _0x465ea7;var _0x21f726;return db[_0xc53e('0x34')][_0xc53e('0x56')]({'where':{'id':_0x3a34a3[_0xc53e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5107bd,null))[_0xc53e('0x2f')](function(_0x15725a){if(_0x15725a){_0x465ea7=_0x15725a;_0xb4c23e[_0xc53e('0x3b')]=_[_0xc53e('0x3a')](db[_0xc53e('0x57')][_0xc53e('0x58')]);_0xb4c23e[_0xc53e('0x39')]=_['keys'](_0x3a34a3['query']);_0xb4c23e['filters']=_[_0xc53e('0x3d')](_0xb4c23e[_0xc53e('0x3b')],_0xb4c23e[_0xc53e('0x39')]);_0x4c42d5[_0xc53e('0x3c')]=_[_0xc53e('0x3d')](_0xb4c23e['model'],qs[_0xc53e('0x3e')](_0x3a34a3[_0xc53e('0x39')][_0xc53e('0x3e')]));_0x4c42d5[_0xc53e('0x3c')]=_0x4c42d5[_0xc53e('0x3c')]['length']?_0x4c42d5['attributes']:_0xb4c23e[_0xc53e('0x3b')];_0x4c42d5[_0xc53e('0x59')]=qs['sort'](_0x3a34a3['query'][_0xc53e('0x41')]);_0x4c42d5[_0xc53e('0x45')]=qs['filters'](_[_0xc53e('0x43')](_0x3a34a3[_0xc53e('0x39')],_0xb4c23e[_0xc53e('0x42')]));if(_0x3a34a3[_0xc53e('0x39')]['filter']){_0x4c42d5['where']=_[_0xc53e('0x47')](_0x4c42d5[_0xc53e('0x45')],{'$or':_[_0xc53e('0x38')](_0x4c42d5['attributes'],function(_0x25fb94){var _0x297f12={};_0x297f12[_0x25fb94]={'$like':'%'+_0x3a34a3[_0xc53e('0x39')][_0xc53e('0x44')]+'%'};return _0x297f12;})});}_0x4c42d5=_[_0xc53e('0x47')]({},_0x4c42d5,_0x3a34a3[_0xc53e('0x5a')]);return _0x465ea7[_0xc53e('0x5b')](_0x4c42d5);}})[_0xc53e('0x2f')](function(_0x19169a){if(_0x19169a){_0x21f726=_0x19169a[_0xc53e('0x3f')];if(!_0x3a34a3['query'][_0xc53e('0x40')](_0xc53e('0x5c'))){_0x4c42d5[_0xc53e('0x28')]=qs['limit'](_0x3a34a3[_0xc53e('0x39')]['limit']);_0x4c42d5[_0xc53e('0x26')]=qs[_0xc53e('0x26')](_0x3a34a3[_0xc53e('0x39')][_0xc53e('0x26')]);}return _0x465ea7[_0xc53e('0x5b')](_0x4c42d5);}})[_0xc53e('0x2f')](function(_0x285705){if(_0x285705){return _0x285705?{'count':_0x21f726,'rows':_0x285705}:null;}})[_0xc53e('0x2f')](respondWithResult(_0x5107bd,null))[_0xc53e('0x4d')](handleError(_0x5107bd,null));};exports[_0xc53e('0x5d')]=function(_0xee7c16,_0x4bf468,_0x1a000f){return db[_0xc53e('0x34')][_0xc53e('0x4c')]({'where':{'id':_0xee7c16[_0xc53e('0x4f')]['id']}})[_0xc53e('0x2f')](handleEntityNotFound(_0x4bf468,null))[_0xc53e('0x2f')](function(_0x3e9599){if(_0x3e9599){return _0x3e9599[_0xc53e('0x5d')](_0xee7c16[_0xc53e('0x39')][_0xc53e('0x54')]);}})[_0xc53e('0x2f')](respondWithStatusCode(_0x4bf468,null))[_0xc53e('0x4d')](handleError(_0x4bf468,null));};exports[_0xc53e('0x5e')]=function(_0x6d3960,_0x33e708,_0x4d224f){if(_0x6d3960[_0xc53e('0x4e')]['id']){delete _0x6d3960[_0xc53e('0x4e')]['id'];}return db[_0xc53e('0x34')]['find']({'where':{'id':_0x6d3960[_0xc53e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x33e708,null))[_0xc53e('0x2f')](function(_0x4f72f8){if(_0x4f72f8){_0x6d3960[_0xc53e('0x4e')][_0xc53e('0x5f')]=_0x4f72f8['id'];return db[_0xc53e('0x51')][_0xc53e('0x60')](_0x6d3960[_0xc53e('0x4e')]);}})['then'](respondWithResult(_0x33e708,null))[_0xc53e('0x4d')](handleError(_0x33e708,null));};exports[_0xc53e('0x61')]=function(_0x3f38e1,_0x15a33c,_0x5941c0){var _0x32a9e9={};var _0x7edffd={};var _0x5c5db8;var _0x290017;return db[_0xc53e('0x34')][_0xc53e('0x56')]({'where':{'id':_0x3f38e1[_0xc53e('0x4f')]['id']}})[_0xc53e('0x2f')](handleEntityNotFound(_0x15a33c,null))[_0xc53e('0x2f')](function(_0x281d20){if(_0x281d20){_0x5c5db8=_0x281d20;_0x7edffd[_0xc53e('0x3b')]=_[_0xc53e('0x3a')](db[_0xc53e('0x51')][_0xc53e('0x58')]);_0x7edffd[_0xc53e('0x39')]=_[_0xc53e('0x3a')](_0x3f38e1[_0xc53e('0x39')]);_0x7edffd[_0xc53e('0x42')]=_[_0xc53e('0x3d')](_0x7edffd['model'],_0x7edffd[_0xc53e('0x39')]);_0x32a9e9['attributes']=_[_0xc53e('0x3d')](_0x7edffd['model'],qs[_0xc53e('0x3e')](_0x3f38e1[_0xc53e('0x39')][_0xc53e('0x3e')]));_0x32a9e9[_0xc53e('0x3c')]=_0x32a9e9[_0xc53e('0x3c')][_0xc53e('0x3f')]?_0x32a9e9['attributes']:_0x7edffd[_0xc53e('0x3b')];_0x32a9e9[_0xc53e('0x59')]=qs[_0xc53e('0x41')](_0x3f38e1['query'][_0xc53e('0x41')]);_0x32a9e9['where']=qs['filters'](_['pick'](_0x3f38e1['query'],_0x7edffd[_0xc53e('0x42')]));if(_0x3f38e1['query'][_0xc53e('0x44')]){_0x32a9e9[_0xc53e('0x45')]=_[_0xc53e('0x47')](_0x32a9e9[_0xc53e('0x45')],{'$or':_[_0xc53e('0x38')](_0x32a9e9[_0xc53e('0x3c')],function(_0x3028de){var _0x4e4743={};_0x4e4743[_0x3028de]={'$like':'%'+_0x3f38e1['query'][_0xc53e('0x44')]+'%'};return _0x4e4743;})});}if(_0x3f38e1[_0xc53e('0x39')][_0xc53e('0x62')]){var _0x5166ac=_0x3f38e1[_0xc53e('0x39')][_0xc53e('0x62')]['split'](',');var _0x242782={};_0x242782[_0x5166ac[0x0]]={'$gte':moment(_0x5166ac[0x1])[_0xc53e('0x63')](_0xc53e('0x64'))};_0x32a9e9[_0xc53e('0x45')]=_['merge'](_0x32a9e9[_0xc53e('0x45')],_0x242782);}_0x32a9e9=_[_0xc53e('0x47')]({},_0x32a9e9,_0x3f38e1[_0xc53e('0x5a')]);return _0x5c5db8[_0xc53e('0x61')](_0x32a9e9);}})[_0xc53e('0x2f')](function(_0x465623){if(_0x465623){_0x290017=_0x465623[_0xc53e('0x3f')];if(!_0x3f38e1['query'][_0xc53e('0x40')](_0xc53e('0x5c'))){_0x32a9e9['limit']=qs[_0xc53e('0x28')](_0x3f38e1['query'][_0xc53e('0x28')]);_0x32a9e9[_0xc53e('0x26')]=qs[_0xc53e('0x26')](_0x3f38e1[_0xc53e('0x39')][_0xc53e('0x26')]);}return _0x5c5db8[_0xc53e('0x61')](_0x32a9e9);}})['then'](function(_0x103920){if(_0x103920){return _0x103920?{'count':_0x290017,'rows':_0x103920}:null;}})['then'](respondWithResult(_0x15a33c,null))[_0xc53e('0x4d')](handleError(_0x15a33c,null));};
\ No newline at end of file
+var _0x1a2e=['addMembers','omit','getMembers','findOne','User','pick','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','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','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','ChatGroup','findAll','rows','show','rawAttributes','find','create','catch','body','params','destroy','getUnread','ChatInternalMessage','user','toInteger'];(function(_0x4634ac,_0x540b17){var _0x34baf5=function(_0x4c7a22){while(--_0x4c7a22){_0x4634ac['push'](_0x4634ac['shift']());}};_0x34baf5(++_0x540b17);}(_0x1a2e,0x19e));var _0xe1a2=function(_0x22f373,_0xfe4768){_0x22f373=_0x22f373-0x0;var _0x1da590=_0x1a2e[_0x22f373];return _0x1da590;};'use strict';var emlformat=require(_0xe1a2('0x0'));var rimraf=require(_0xe1a2('0x1'));var zipdir=require(_0xe1a2('0x2'));var jsonpatch=require(_0xe1a2('0x3'));var rp=require(_0xe1a2('0x4'));var moment=require(_0xe1a2('0x5'));var BPromise=require(_0xe1a2('0x6'));var Mustache=require(_0xe1a2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe1a2('0x8'));var csv=require(_0xe1a2('0x9'));var ejs=require(_0xe1a2('0xa'));var fs=require('fs');var fs_extra=require(_0xe1a2('0xb'));var _=require(_0xe1a2('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe1a2('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe1a2('0xe'));var Papa=require('papaparse');var Redis=require(_0xe1a2('0xf'));var authService=require(_0xe1a2('0x10'));var qs=require(_0xe1a2('0x11'));var as=require(_0xe1a2('0x12'));var hardwareService=require(_0xe1a2('0x13'));var logger=require(_0xe1a2('0x14'))(_0xe1a2('0x15'));var utils=require(_0xe1a2('0x16'));var config=require(_0xe1a2('0x17'));var licenseUtil=require(_0xe1a2('0x18'));var db=require('../../mysqldb')['db'];config[_0xe1a2('0x19')]=_[_0xe1a2('0x1a')](config[_0xe1a2('0x19')],{'host':_0xe1a2('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe1a2('0x19')]));require(_0xe1a2('0x1c'))[_0xe1a2('0x1d')](socket);function respondWithStatusCode(_0x5ac147,_0x4cf4d1){_0x4cf4d1=_0x4cf4d1||0xcc;return function(_0x499cd9){if(_0x499cd9){return _0x5ac147[_0xe1a2('0x1e')](_0x4cf4d1);}return _0x5ac147[_0xe1a2('0x1f')](_0x4cf4d1)[_0xe1a2('0x20')]();};}function respondWithResult(_0x19f642,_0x33a5cf){_0x33a5cf=_0x33a5cf||0xc8;return function(_0xd1cc51){if(_0xd1cc51){return _0x19f642[_0xe1a2('0x1f')](_0x33a5cf)['json'](_0xd1cc51);}};}function respondWithFilteredResult(_0x4fb369,_0xbf5ff4){return function(_0x340853){if(_0x340853){var _0x21d42b=typeof _0xbf5ff4[_0xe1a2('0x21')]===_0xe1a2('0x22')&&typeof _0xbf5ff4[_0xe1a2('0x23')]===_0xe1a2('0x22');var _0x20ea68=_0x340853['count'];var _0x2c7f23=_0x21d42b?0x0:_0xbf5ff4[_0xe1a2('0x21')];var _0x496027=_0x21d42b?_0x340853[_0xe1a2('0x24')]:_0xbf5ff4[_0xe1a2('0x21')]+_0xbf5ff4[_0xe1a2('0x23')];var _0x34ae71;if(_0x496027>=_0x20ea68){_0x496027=_0x20ea68;_0x34ae71=0xc8;}else{_0x34ae71=0xce;}_0x4fb369['status'](_0x34ae71);return _0x4fb369[_0xe1a2('0x25')]('Content-Range',_0x2c7f23+'-'+_0x496027+'/'+_0x20ea68)[_0xe1a2('0x26')](_0x340853);}return null;};}function patchUpdates(_0x54e300){return function(_0xb20dcc){try{jsonpatch[_0xe1a2('0x27')](_0xb20dcc,_0x54e300,!![]);}catch(_0x1c679b){return BPromise[_0xe1a2('0x28')](_0x1c679b);}return _0xb20dcc[_0xe1a2('0x29')]();};}function saveUpdates(_0x5e7ee6,_0x53addc){return function(_0x560fa1){if(_0x560fa1){return _0x560fa1[_0xe1a2('0x2a')](_0x5e7ee6)[_0xe1a2('0x2b')](function(_0x23431b){return _0x23431b;});}return null;};}function removeEntity(_0x130f21,_0x17a2f6){return function(_0x1d7608){if(_0x1d7608){return _0x1d7608['destroy']()['then'](function(){_0x130f21[_0xe1a2('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53fdb6,_0x2034ed){return function(_0x5922b7){if(!_0x5922b7){_0x53fdb6[_0xe1a2('0x1e')](0x194);}return _0x5922b7;};}function handleError(_0x13f410,_0x146a25){_0x146a25=_0x146a25||0x1f4;return function(_0xb14844){logger[_0xe1a2('0x2c')](_0xb14844[_0xe1a2('0x2d')]);if(_0xb14844[_0xe1a2('0x2e')]){delete _0xb14844[_0xe1a2('0x2e')];}_0x13f410[_0xe1a2('0x1f')](_0x146a25)[_0xe1a2('0x2f')](_0xb14844);};}exports[_0xe1a2('0x30')]=function(_0x47b86a,_0x2b0385){var _0x5601ff={},_0x393cbb={},_0x30998d={'count':0x0,'rows':[]};var _0x18403e=_[_0xe1a2('0x31')](db['ChatGroup']['rawAttributes'],function(_0x1d7b03){return{'name':_0x1d7b03[_0xe1a2('0x32')],'type':_0x1d7b03[_0xe1a2('0x33')][_0xe1a2('0x34')]};});_0x393cbb['model']=_[_0xe1a2('0x31')](_0x18403e,_0xe1a2('0x2e'));_0x393cbb[_0xe1a2('0x35')]=_[_0xe1a2('0x36')](_0x47b86a['query']);_0x393cbb[_0xe1a2('0x37')]=_['intersection'](_0x393cbb[_0xe1a2('0x38')],_0x393cbb[_0xe1a2('0x35')]);_0x5601ff[_0xe1a2('0x39')]=_[_0xe1a2('0x3a')](_0x393cbb[_0xe1a2('0x38')],qs[_0xe1a2('0x3b')](_0x47b86a[_0xe1a2('0x35')][_0xe1a2('0x3b')]));_0x5601ff[_0xe1a2('0x39')]=_0x5601ff[_0xe1a2('0x39')][_0xe1a2('0x3c')]?_0x5601ff[_0xe1a2('0x39')]:_0x393cbb[_0xe1a2('0x38')];if(!_0x47b86a[_0xe1a2('0x35')][_0xe1a2('0x3d')](_0xe1a2('0x3e'))){_0x5601ff[_0xe1a2('0x23')]=qs[_0xe1a2('0x23')](_0x47b86a[_0xe1a2('0x35')]['limit']);_0x5601ff['offset']=qs[_0xe1a2('0x21')](_0x47b86a[_0xe1a2('0x35')][_0xe1a2('0x21')]);}_0x5601ff[_0xe1a2('0x3f')]=qs[_0xe1a2('0x40')](_0x47b86a[_0xe1a2('0x35')][_0xe1a2('0x40')]);_0x5601ff['where']=qs[_0xe1a2('0x37')](_['pick'](_0x47b86a[_0xe1a2('0x35')],_0x393cbb[_0xe1a2('0x37')]),_0x18403e);if(_0x47b86a[_0xe1a2('0x35')][_0xe1a2('0x41')]){_0x5601ff[_0xe1a2('0x42')]=_[_0xe1a2('0x43')](_0x5601ff[_0xe1a2('0x42')],{'$or':_[_0xe1a2('0x31')](_0x18403e,function(_0x2b0f0f){if(_0x2b0f0f[_0xe1a2('0x33')]!=='VIRTUAL'){var _0x1e8db7={};_0x1e8db7[_0x2b0f0f[_0xe1a2('0x2e')]]={'$like':'%'+_0x47b86a[_0xe1a2('0x35')]['filter']+'%'};return _0x1e8db7;}})});}_0x5601ff=_[_0xe1a2('0x43')]({},_0x5601ff,_0x47b86a[_0xe1a2('0x44')]);var _0x41a156={'where':_0x5601ff[_0xe1a2('0x42')]};return db['ChatGroup'][_0xe1a2('0x24')](_0x41a156)[_0xe1a2('0x2b')](function(_0x302f){_0x30998d[_0xe1a2('0x24')]=_0x302f;if(_0x47b86a[_0xe1a2('0x35')][_0xe1a2('0x45')]){_0x5601ff[_0xe1a2('0x46')]=[{'all':!![]}];}return db[_0xe1a2('0x47')][_0xe1a2('0x48')](_0x5601ff);})[_0xe1a2('0x2b')](function(_0x8ed0da){_0x30998d[_0xe1a2('0x49')]=_0x8ed0da;return _0x30998d;})[_0xe1a2('0x2b')](respondWithFilteredResult(_0x2b0385,_0x5601ff))['catch'](handleError(_0x2b0385,null));};exports[_0xe1a2('0x4a')]=function(_0x292ee1,_0x5abfa5){var _0x31dd26={'raw':!![],'where':{'id':_0x292ee1['params']['id']}},_0x2dc026={};_0x2dc026[_0xe1a2('0x38')]=_[_0xe1a2('0x36')](db[_0xe1a2('0x47')][_0xe1a2('0x4b')]);_0x2dc026[_0xe1a2('0x35')]=_[_0xe1a2('0x36')](_0x292ee1[_0xe1a2('0x35')]);_0x2dc026[_0xe1a2('0x37')]=_[_0xe1a2('0x3a')](_0x2dc026['model'],_0x2dc026[_0xe1a2('0x35')]);_0x31dd26[_0xe1a2('0x39')]=_['intersection'](_0x2dc026[_0xe1a2('0x38')],qs[_0xe1a2('0x3b')](_0x292ee1['query'][_0xe1a2('0x3b')]));_0x31dd26[_0xe1a2('0x39')]=_0x31dd26['attributes']['length']?_0x31dd26['attributes']:_0x2dc026[_0xe1a2('0x38')];if(_0x292ee1[_0xe1a2('0x35')][_0xe1a2('0x45')]){_0x31dd26[_0xe1a2('0x46')]=[{'all':!![]}];}_0x31dd26=_[_0xe1a2('0x43')]({},_0x31dd26,_0x292ee1['options']);return db[_0xe1a2('0x47')][_0xe1a2('0x4c')](_0x31dd26)[_0xe1a2('0x2b')](handleEntityNotFound(_0x5abfa5,null))['then'](respondWithResult(_0x5abfa5,null))['catch'](handleError(_0x5abfa5,null));};exports[_0xe1a2('0x4d')]=function(_0x203df2,_0x50c3ed){return db[_0xe1a2('0x47')][_0xe1a2('0x4d')](_0x203df2['body'],{})[_0xe1a2('0x2b')](respondWithResult(_0x50c3ed,0xc9))[_0xe1a2('0x4e')](handleError(_0x50c3ed,null));};exports[_0xe1a2('0x2a')]=function(_0x494690,_0x4eb9ef){if(_0x494690[_0xe1a2('0x4f')]['id']){delete _0x494690['body']['id'];}return db[_0xe1a2('0x47')]['find']({'where':{'id':_0x494690[_0xe1a2('0x50')]['id']}})[_0xe1a2('0x2b')](handleEntityNotFound(_0x4eb9ef,null))[_0xe1a2('0x2b')](saveUpdates(_0x494690[_0xe1a2('0x4f')],null))[_0xe1a2('0x2b')](respondWithResult(_0x4eb9ef,null))['catch'](handleError(_0x4eb9ef,null));};exports[_0xe1a2('0x51')]=function(_0x33e501,_0x1cb45a){return db[_0xe1a2('0x47')][_0xe1a2('0x4c')]({'where':{'id':_0x33e501[_0xe1a2('0x50')]['id']}})[_0xe1a2('0x2b')](handleEntityNotFound(_0x1cb45a,null))[_0xe1a2('0x2b')](removeEntity(_0x1cb45a,null))[_0xe1a2('0x4e')](handleError(_0x1cb45a,null));};exports['describe']=function(_0x1ed659,_0x3f953e){return db[_0xe1a2('0x47')]['describe']()[_0xe1a2('0x2b')](respondWithResult(_0x3f953e,null))[_0xe1a2('0x4e')](handleError(_0x3f953e,null));};exports[_0xe1a2('0x52')]=function(_0x5cfe72,_0x1264e9,_0x3e61a9){return db[_0xe1a2('0x53')][_0xe1a2('0x24')]({'where':{'ChatGroupId':_0x5cfe72[_0xe1a2('0x50')]['id'],'ToId':_0x5cfe72[_0xe1a2('0x54')]['id'],'read':![]}})[_0xe1a2('0x2b')](function(_0x18246b){return{'id':_[_0xe1a2('0x55')](_0x5cfe72[_0xe1a2('0x50')]['id']),'count':_0x18246b};})[_0xe1a2('0x2b')](respondWithResult(_0x1264e9,null))['catch'](handleError(_0x1264e9,null));};exports[_0xe1a2('0x56')]=function(_0x4768d5,_0x50459e,_0x19ede3){return db['ChatGroup'][_0xe1a2('0x4c')]({'where':{'id':_0x4768d5[_0xe1a2('0x50')]['id']}})[_0xe1a2('0x2b')](handleEntityNotFound(_0x50459e,null))[_0xe1a2('0x2b')](function(_0x2076e0){if(_0x2076e0){return _0x2076e0['addMembers'](_0x4768d5['body']['ids'],_[_0xe1a2('0x57')](_0x4768d5[_0xe1a2('0x4f')],['ids','id'])||{});}})['then'](respondWithResult(_0x50459e,null))[_0xe1a2('0x4e')](handleError(_0x50459e,null));};exports[_0xe1a2('0x58')]=function(_0x4dcd17,_0x36a808,_0xcebe3){var _0x3a1e07={};var _0x4df061={};var _0xa4612d;var _0x5949ba;return db[_0xe1a2('0x47')][_0xe1a2('0x59')]({'where':{'id':_0x4dcd17[_0xe1a2('0x50')]['id']}})[_0xe1a2('0x2b')](handleEntityNotFound(_0x36a808,null))[_0xe1a2('0x2b')](function(_0x270b83){if(_0x270b83){_0xa4612d=_0x270b83;_0x4df061[_0xe1a2('0x38')]=_[_0xe1a2('0x36')](db[_0xe1a2('0x5a')][_0xe1a2('0x4b')]);_0x4df061[_0xe1a2('0x35')]=_[_0xe1a2('0x36')](_0x4dcd17[_0xe1a2('0x35')]);_0x4df061[_0xe1a2('0x37')]=_['intersection'](_0x4df061['model'],_0x4df061[_0xe1a2('0x35')]);_0x3a1e07[_0xe1a2('0x39')]=_['intersection'](_0x4df061['model'],qs['fields'](_0x4dcd17['query'][_0xe1a2('0x3b')]));_0x3a1e07['attributes']=_0x3a1e07[_0xe1a2('0x39')][_0xe1a2('0x3c')]?_0x3a1e07[_0xe1a2('0x39')]:_0x4df061[_0xe1a2('0x38')];_0x3a1e07[_0xe1a2('0x3f')]=qs[_0xe1a2('0x40')](_0x4dcd17['query'][_0xe1a2('0x40')]);_0x3a1e07[_0xe1a2('0x42')]=qs[_0xe1a2('0x37')](_[_0xe1a2('0x5b')](_0x4dcd17[_0xe1a2('0x35')],_0x4df061[_0xe1a2('0x37')]));if(_0x4dcd17[_0xe1a2('0x35')][_0xe1a2('0x41')]){_0x3a1e07[_0xe1a2('0x42')]=_[_0xe1a2('0x43')](_0x3a1e07[_0xe1a2('0x42')],{'$or':_[_0xe1a2('0x31')](_0x3a1e07[_0xe1a2('0x39')],function(_0x1ff9ff){var _0x5c1505={};_0x5c1505[_0x1ff9ff]={'$like':'%'+_0x4dcd17[_0xe1a2('0x35')][_0xe1a2('0x41')]+'%'};return _0x5c1505;})});}_0x3a1e07=_[_0xe1a2('0x43')]({},_0x3a1e07,_0x4dcd17['options']);return _0xa4612d['getMembers'](_0x3a1e07);}})[_0xe1a2('0x2b')](function(_0x336ac7){if(_0x336ac7){_0x5949ba=_0x336ac7['length'];if(!_0x4dcd17[_0xe1a2('0x35')][_0xe1a2('0x3d')](_0xe1a2('0x3e'))){_0x3a1e07['limit']=qs[_0xe1a2('0x23')](_0x4dcd17[_0xe1a2('0x35')][_0xe1a2('0x23')]);_0x3a1e07[_0xe1a2('0x21')]=qs[_0xe1a2('0x21')](_0x4dcd17[_0xe1a2('0x35')][_0xe1a2('0x21')]);}return _0xa4612d[_0xe1a2('0x58')](_0x3a1e07);}})[_0xe1a2('0x2b')](function(_0x3c95d9){if(_0x3c95d9){return _0x3c95d9?{'count':_0x5949ba,'rows':_0x3c95d9}:null;}})[_0xe1a2('0x2b')](respondWithResult(_0x36a808,null))[_0xe1a2('0x4e')](handleError(_0x36a808,null));};exports[_0xe1a2('0x5c')]=function(_0x55e162,_0xdbdfbd,_0x342350){return db[_0xe1a2('0x47')][_0xe1a2('0x4c')]({'where':{'id':_0x55e162[_0xe1a2('0x50')]['id']}})[_0xe1a2('0x2b')](handleEntityNotFound(_0xdbdfbd,null))[_0xe1a2('0x2b')](function(_0xd0fcf1){if(_0xd0fcf1){return _0xd0fcf1[_0xe1a2('0x5c')](_0x55e162[_0xe1a2('0x35')]['ids']);}})[_0xe1a2('0x2b')](respondWithStatusCode(_0xdbdfbd,null))[_0xe1a2('0x4e')](handleError(_0xdbdfbd,null));};exports[_0xe1a2('0x5d')]=function(_0x1cdc4d,_0x22282a,_0x4a0ff6){if(_0x1cdc4d[_0xe1a2('0x4f')]['id']){delete _0x1cdc4d[_0xe1a2('0x4f')]['id'];}return db[_0xe1a2('0x47')]['find']({'where':{'id':_0x1cdc4d[_0xe1a2('0x50')]['id']}})[_0xe1a2('0x2b')](handleEntityNotFound(_0x22282a,null))['then'](function(_0x3cadf3){if(_0x3cadf3){_0x1cdc4d['body'][_0xe1a2('0x5e')]=_0x3cadf3['id'];return db[_0xe1a2('0x53')]['create'](_0x1cdc4d[_0xe1a2('0x4f')]);}})[_0xe1a2('0x2b')](respondWithResult(_0x22282a,null))[_0xe1a2('0x4e')](handleError(_0x22282a,null));};exports[_0xe1a2('0x5f')]=function(_0x240be3,_0x5d1021,_0x53107f){var _0x4b00b7={};var _0xc98fbe={};var _0x57d502;var _0x2246ac;return db[_0xe1a2('0x47')]['findOne']({'where':{'id':_0x240be3[_0xe1a2('0x50')]['id']}})['then'](handleEntityNotFound(_0x5d1021,null))[_0xe1a2('0x2b')](function(_0xabf1d3){if(_0xabf1d3){_0x57d502=_0xabf1d3;_0xc98fbe[_0xe1a2('0x38')]=_[_0xe1a2('0x36')](db[_0xe1a2('0x53')][_0xe1a2('0x4b')]);_0xc98fbe[_0xe1a2('0x35')]=_[_0xe1a2('0x36')](_0x240be3[_0xe1a2('0x35')]);_0xc98fbe[_0xe1a2('0x37')]=_['intersection'](_0xc98fbe['model'],_0xc98fbe[_0xe1a2('0x35')]);_0x4b00b7[_0xe1a2('0x39')]=_['intersection'](_0xc98fbe[_0xe1a2('0x38')],qs[_0xe1a2('0x3b')](_0x240be3[_0xe1a2('0x35')][_0xe1a2('0x3b')]));_0x4b00b7[_0xe1a2('0x39')]=_0x4b00b7['attributes']['length']?_0x4b00b7['attributes']:_0xc98fbe[_0xe1a2('0x38')];_0x4b00b7[_0xe1a2('0x3f')]=qs[_0xe1a2('0x40')](_0x240be3['query'][_0xe1a2('0x40')]);_0x4b00b7[_0xe1a2('0x42')]=qs[_0xe1a2('0x37')](_[_0xe1a2('0x5b')](_0x240be3['query'],_0xc98fbe[_0xe1a2('0x37')]));if(_0x240be3[_0xe1a2('0x35')][_0xe1a2('0x41')]){_0x4b00b7[_0xe1a2('0x42')]=_[_0xe1a2('0x43')](_0x4b00b7[_0xe1a2('0x42')],{'$or':_[_0xe1a2('0x31')](_0x4b00b7[_0xe1a2('0x39')],function(_0x5c2824){var _0x28d504={};_0x28d504[_0x5c2824]={'$like':'%'+_0x240be3[_0xe1a2('0x35')][_0xe1a2('0x41')]+'%'};return _0x28d504;})});}if(_0x240be3['query']['$gte']){var _0x3d0da1=_0x240be3[_0xe1a2('0x35')][_0xe1a2('0x60')][_0xe1a2('0x61')](',');var _0x26c8fa={};_0x26c8fa[_0x3d0da1[0x0]]={'$gte':moment(_0x3d0da1[0x1])[_0xe1a2('0x62')](_0xe1a2('0x63'))};_0x4b00b7[_0xe1a2('0x42')]=_[_0xe1a2('0x43')](_0x4b00b7['where'],_0x26c8fa);}_0x4b00b7=_['merge']({},_0x4b00b7,_0x240be3[_0xe1a2('0x44')]);return _0x57d502[_0xe1a2('0x5f')](_0x4b00b7);}})[_0xe1a2('0x2b')](function(_0x2609e9){if(_0x2609e9){_0x2246ac=_0x2609e9[_0xe1a2('0x3c')];if(!_0x240be3[_0xe1a2('0x35')][_0xe1a2('0x3d')](_0xe1a2('0x3e'))){_0x4b00b7['limit']=qs[_0xe1a2('0x23')](_0x240be3[_0xe1a2('0x35')][_0xe1a2('0x23')]);_0x4b00b7[_0xe1a2('0x21')]=qs[_0xe1a2('0x21')](_0x240be3['query'][_0xe1a2('0x21')]);}return _0x57d502[_0xe1a2('0x5f')](_0x4b00b7);}})[_0xe1a2('0x2b')](function(_0x276797){if(_0x276797){return _0x276797?{'count':_0x2246ac,'rows':_0x276797}:null;}})[_0xe1a2('0x2b')](respondWithResult(_0x5d1021,null))[_0xe1a2('0x4e')](handleError(_0x5d1021,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 8bd557c..bed7fc6 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 _0x9632=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x57f993,_0x32a645){var _0x2703d6=function(_0x563777){while(--_0x563777){_0x57f993['push'](_0x57f993['shift']());}};_0x2703d6(++_0x32a645);}(_0x9632,0x109));var _0x2963=function(_0x456e6c,_0x505c52){_0x456e6c=_0x456e6c-0x0;var _0x373dcc=_0x9632[_0x456e6c];return _0x373dcc;};'use strict';var EventEmitter=require(_0x2963('0x0'));var ChatGroup=require(_0x2963('0x1'))['db'][_0x2963('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2963('0x3')](0x0);var events={'afterCreate':_0x2963('0x4'),'afterUpdate':_0x2963('0x5'),'afterDestroy':_0x2963('0x6')};function emitEvent(_0x5f5833){return function(_0x4aa47c,_0x7e629f,_0x263ab9){ChatGroupEvents[_0x2963('0x7')](_0x5f5833+':'+_0x4aa47c['id'],_0x4aa47c);ChatGroupEvents[_0x2963('0x7')](_0x5f5833,_0x4aa47c);_0x263ab9(null);};}for(var e in events){if(events[_0x2963('0x8')](e)){var event=events[e];ChatGroup[_0x2963('0x9')](e,emitEvent(event));}}module[_0x2963('0xa')]=ChatGroupEvents;
\ No newline at end of file
+var _0xb5bf=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','save','remove','emit'];(function(_0x444c84,_0x4f2b54){var _0x5c1fc5=function(_0x45636b){while(--_0x45636b){_0x444c84['push'](_0x444c84['shift']());}};_0x5c1fc5(++_0x4f2b54);}(_0xb5bf,0x1d7));var _0xfb5b=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xb5bf[_0x9c2427];return _0x51984f;};'use strict';var EventEmitter=require(_0xfb5b('0x0'));var ChatGroup=require(_0xfb5b('0x1'))['db'][_0xfb5b('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfb5b('0x3'),'afterUpdate':'update','afterDestroy':_0xfb5b('0x4')};function emitEvent(_0x315c48){return function(_0x2e8dd6,_0x72f94d,_0x23dfaf){ChatGroupEvents[_0xfb5b('0x5')](_0x315c48+':'+_0x2e8dd6['id'],_0x2e8dd6);ChatGroupEvents['emit'](_0x315c48,_0x2e8dd6);_0x23dfaf(null);};}for(var e in events){if(events[_0xfb5b('0x6')](e)){var event=events[e];ChatGroup[_0xfb5b('0x7')](e,emitEvent(event));}}module[_0xfb5b('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 2c0158a..13de016 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 _0x9d2b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','util'];(function(_0x550e29,_0x4047f){var _0x3515b6=function(_0x303fe2){while(--_0x303fe2){_0x550e29['push'](_0x550e29['shift']());}};_0x3515b6(++_0x4047f);}(_0x9d2b,0x15c));var _0xb9d2=function(_0x4b7e4d,_0x82d2ab){_0x4b7e4d=_0x4b7e4d-0x0;var _0x38d6af=_0x9d2b[_0x4b7e4d];return _0x38d6af;};'use strict';var _=require(_0xb9d2('0x0'));var util=require(_0xb9d2('0x1'));var logger=require(_0xb9d2('0x2'))(_0xb9d2('0x3'));var moment=require(_0xb9d2('0x4'));var BPromise=require(_0xb9d2('0x5'));var rp=require(_0xb9d2('0x6'));var fs=require('fs');var path=require(_0xb9d2('0x7'));var rimraf=require(_0xb9d2('0x8'));var config=require(_0xb9d2('0x9'));var attributes=require(_0xb9d2('0xa'));module['exports']=function(_0xe5a8cf,_0x2cca48){return _0xe5a8cf[_0xb9d2('0xb')](_0xb9d2('0xc'),attributes,{'tableName':_0xb9d2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8b76=['./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b76,0x1c0));var _0x68b7=function(_0x398306,_0x560fd1){_0x398306=_0x398306-0x0;var _0x42644b=_0x8b76[_0x398306];return _0x42644b;};'use strict';var _=require(_0x68b7('0x0'));var util=require('util');var logger=require(_0x68b7('0x1'))(_0x68b7('0x2'));var moment=require(_0x68b7('0x3'));var BPromise=require(_0x68b7('0x4'));var rp=require(_0x68b7('0x5'));var fs=require('fs');var path=require(_0x68b7('0x6'));var rimraf=require('rimraf');var config=require(_0x68b7('0x7'));var attributes=require(_0x68b7('0x8'));module['exports']=function(_0x421c31,_0x175961){return _0x421c31[_0x68b7('0x9')](_0x68b7('0xa'),attributes,{'tableName':_0x68b7('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 4e553c0..fc33b4c 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 _0x1a8f=['then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x1a8f,0x87));var _0xf1a8=function(_0x481ff7,_0x2b6ebb){_0x481ff7=_0x481ff7-0x0;var _0x1c1573=_0x1a8f[_0x481ff7];return _0x1c1573;};'use strict';var _=require(_0xf1a8('0x0'));var util=require('util');var moment=require(_0xf1a8('0x1'));var BPromise=require(_0xf1a8('0x2'));var rs=require(_0xf1a8('0x3'));var fs=require('fs');var Redis=require(_0xf1a8('0x4'));var db=require(_0xf1a8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf1a8('0x6'));var client=jayson[_0xf1a8('0x7')][_0xf1a8('0x8')]({'port':0x232a});config['redis']=_[_0xf1a8('0x9')](config['redis'],{'host':_0xf1a8('0xa'),'port':0x18eb});var socket=require(_0xf1a8('0xb'))(new Redis(config[_0xf1a8('0xc')]));require('./chatGroup.socket')[_0xf1a8('0xd')](socket);function respondWithRpcPromise(_0x5012c6,_0x6915e2,_0x4d567f){return new BPromise(function(_0x1f2595,_0x3ff385){return client[_0xf1a8('0xe')](_0x5012c6,_0x4d567f)[_0xf1a8('0xf')](function(_0x49e1e1){logger[_0xf1a8('0x10')]('ChatGroup,\x20%s,\x20%s',_0x6915e2,_0xf1a8('0x11'));logger['debug'](_0xf1a8('0x12'),_0x6915e2,_0xf1a8('0x11'),JSON[_0xf1a8('0x13')](_0x49e1e1));if(_0x49e1e1[_0xf1a8('0x14')]){if(_0x49e1e1[_0xf1a8('0x14')][_0xf1a8('0x15')]===0x1f4){logger[_0xf1a8('0x14')](_0xf1a8('0x16'),_0x6915e2,_0x49e1e1[_0xf1a8('0x14')]['message']);return _0x3ff385(_0x49e1e1[_0xf1a8('0x14')][_0xf1a8('0x17')]);}logger[_0xf1a8('0x14')](_0xf1a8('0x16'),_0x6915e2,_0x49e1e1[_0xf1a8('0x14')][_0xf1a8('0x17')]);return _0x1f2595(_0x49e1e1[_0xf1a8('0x14')][_0xf1a8('0x17')]);}else{logger[_0xf1a8('0x10')](_0xf1a8('0x16'),_0x6915e2,_0xf1a8('0x11'));_0x1f2595(_0x49e1e1[_0xf1a8('0x18')][_0xf1a8('0x17')]);}})['catch'](function(_0x159d9d){logger[_0xf1a8('0x14')](_0xf1a8('0x16'),_0x6915e2,_0x159d9d);_0x3ff385(_0x159d9d);});});}
\ No newline at end of file
+var _0xaf3e=['util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','catch','lodash'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xaf3e,0xcf));var _0xeaf3=function(_0x4defd6,_0x37bbd3){_0x4defd6=_0x4defd6-0x0;var _0x4c9276=_0xaf3e[_0x4defd6];return _0x4c9276;};'use strict';var _=require(_0xeaf3('0x0'));var util=require(_0xeaf3('0x1'));var moment=require('moment');var BPromise=require(_0xeaf3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeaf3('0x3'));var db=require(_0xeaf3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xeaf3('0x5'))(_0xeaf3('0x6'));var config=require(_0xeaf3('0x7'));var jayson=require(_0xeaf3('0x8'));var client=jayson[_0xeaf3('0x9')]['http']({'port':0x232a});config[_0xeaf3('0xa')]=_[_0xeaf3('0xb')](config[_0xeaf3('0xa')],{'host':_0xeaf3('0xc'),'port':0x18eb});var socket=require(_0xeaf3('0xd'))(new Redis(config[_0xeaf3('0xa')]));require('./chatGroup.socket')[_0xeaf3('0xe')](socket);function respondWithRpcPromise(_0x48bcf7,_0x5eb9d,_0x37a947){return new BPromise(function(_0xc0a479,_0x5c21aa){return client[_0xeaf3('0xf')](_0x48bcf7,_0x37a947)[_0xeaf3('0x10')](function(_0x596ea8){logger[_0xeaf3('0x11')]('ChatGroup,\x20%s,\x20%s',_0x5eb9d,_0xeaf3('0x12'));logger[_0xeaf3('0x13')](_0xeaf3('0x14'),_0x5eb9d,_0xeaf3('0x12'),JSON['stringify'](_0x596ea8));if(_0x596ea8[_0xeaf3('0x15')]){if(_0x596ea8[_0xeaf3('0x15')][_0xeaf3('0x16')]===0x1f4){logger[_0xeaf3('0x15')]('ChatGroup,\x20%s,\x20%s',_0x5eb9d,_0x596ea8[_0xeaf3('0x15')]['message']);return _0x5c21aa(_0x596ea8[_0xeaf3('0x15')]['message']);}logger['error'](_0xeaf3('0x17'),_0x5eb9d,_0x596ea8[_0xeaf3('0x15')][_0xeaf3('0x18')]);return _0xc0a479(_0x596ea8[_0xeaf3('0x15')][_0xeaf3('0x18')]);}else{logger[_0xeaf3('0x11')]('ChatGroup,\x20%s,\x20%s',_0x5eb9d,_0xeaf3('0x12'));_0xc0a479(_0x596ea8['result'][_0xeaf3('0x18')]);}})[_0xeaf3('0x19')](function(_0x48e609){logger[_0xeaf3('0x15')](_0xeaf3('0x17'),_0x5eb9d,_0x48e609);_0x5c21aa(_0x48e609);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 04c737f..1e3a5e7 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 _0x40ba=['length','chatGroup:','./chatGroup.events','save','remove','update','emit','removeListener','register'];(function(_0x56a3bb,_0x4af1a2){var _0xe712b8=function(_0x1bd238){while(--_0x1bd238){_0x56a3bb['push'](_0x56a3bb['shift']());}};_0xe712b8(++_0x4af1a2);}(_0x40ba,0xad));var _0xa40b=function(_0x4fdc46,_0x2a3759){_0x4fdc46=_0x4fdc46-0x0;var _0x2c178a=_0x40ba[_0x4fdc46];return _0x2c178a;};'use strict';var ChatGroupEvents=require(_0xa40b('0x0'));var events=[_0xa40b('0x1'),_0xa40b('0x2'),_0xa40b('0x3')];function createListener(_0x237741,_0x24c05b){return function(_0x3c0ea2){_0x24c05b[_0xa40b('0x4')](_0x237741,_0x3c0ea2);};}function removeListener(_0x33a3e7,_0x107f5b){return function(){ChatGroupEvents[_0xa40b('0x5')](_0x33a3e7,_0x107f5b);};}exports[_0xa40b('0x6')]=function(_0x3d777a){for(var _0x24cfc2=0x0,_0x5a6eee=events[_0xa40b('0x7')];_0x24cfc2<_0x5a6eee;_0x24cfc2++){var _0x161276=events[_0x24cfc2];var _0x510cc9=createListener(_0xa40b('0x8')+_0x161276,_0x3d777a);ChatGroupEvents['on'](_0x161276,_0x510cc9);}};
\ No newline at end of file
+var _0xbb20=['register','chatGroup:','save','remove','update','removeListener'];(function(_0x129f0e,_0x47b168){var _0x365540=function(_0x4a9cb0){while(--_0x4a9cb0){_0x129f0e['push'](_0x129f0e['shift']());}};_0x365540(++_0x47b168);}(_0xbb20,0x152));var _0x0bb2=function(_0x4b03a7,_0x49698b){_0x4b03a7=_0x4b03a7-0x0;var _0x644e66=_0xbb20[_0x4b03a7];return _0x644e66;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x0bb2('0x0'),_0x0bb2('0x1'),_0x0bb2('0x2')];function createListener(_0x148fde,_0x5ba338){return function(_0x3e0362){_0x5ba338['emit'](_0x148fde,_0x3e0362);};}function removeListener(_0x3b86f3,_0x5de495){return function(){ChatGroupEvents[_0x0bb2('0x3')](_0x3b86f3,_0x5de495);};}exports[_0x0bb2('0x4')]=function(_0x963831){for(var _0x4a3cac=0x0,_0xebdd98=events['length'];_0x4a3cac<_0xebdd98;_0x4a3cac++){var _0x4b4fcc=events[_0x4a3cac];var _0x5470ac=createListener(_0x0bb2('0x5')+_0x4b4fcc,_0x963831);ChatGroupEvents['on'](_0x4b4fcc,_0x5470ac);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 1e30228..7ded9c8 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 _0x7ccd=['exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','getUnread','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','/:id','update','delete','removeMembers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ccd,0x139));var _0xd7cc=function(_0x2dc81b,_0x2063ae){_0x2dc81b=_0x2dc81b-0x0;var _0x3a2946=_0x7ccd[_0x2dc81b];return _0x3a2946;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd7cc('0x0'));var timeout=require(_0xd7cc('0x1'));var express=require(_0xd7cc('0x2'));var router=express[_0xd7cc('0x3')]();var fs_extra=require(_0xd7cc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd7cc('0x5'));var config=require(_0xd7cc('0x6'));var controller=require(_0xd7cc('0x7'));router[_0xd7cc('0x8')]('/',auth['isAuthenticated'](),controller[_0xd7cc('0x9')]);router[_0xd7cc('0x8')](_0xd7cc('0xa'),auth[_0xd7cc('0xb')](),controller[_0xd7cc('0xc')]);router[_0xd7cc('0x8')]('/:id',auth[_0xd7cc('0xb')](),controller['show']);router[_0xd7cc('0x8')]('/:id/unread',auth[_0xd7cc('0xb')](),controller[_0xd7cc('0xd')]);router[_0xd7cc('0x8')]('/:id/members',auth[_0xd7cc('0xb')](),controller[_0xd7cc('0xe')]);router['get'](_0xd7cc('0xf'),auth[_0xd7cc('0xb')](),controller[_0xd7cc('0x10')]);router[_0xd7cc('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd7cc('0x11')]('/:id/members',auth['isAuthenticated'](),controller[_0xd7cc('0x12')]);router[_0xd7cc('0x11')]('/:id/messages',auth['isAuthenticated'](),controller[_0xd7cc('0x13')]);router[_0xd7cc('0x14')](_0xd7cc('0x15'),auth[_0xd7cc('0xb')](),controller[_0xd7cc('0x16')]);router[_0xd7cc('0x17')](_0xd7cc('0x15'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/members',auth[_0xd7cc('0xb')](),controller[_0xd7cc('0x18')]);module[_0xd7cc('0x19')]=router;
\ No newline at end of file
+var _0xd27d=['show','/:id/unread','/:id/members','getMembers','/:id/messages','post','addMessage','update','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x50357c,_0x1cca99){var _0x18338e=function(_0x447e73){while(--_0x447e73){_0x50357c['push'](_0x50357c['shift']());}};_0x18338e(++_0x1cca99);}(_0xd27d,0x144));var _0xdd27=function(_0xd344ef,_0x132b5f){_0xd344ef=_0xd344ef-0x0;var _0x50a171=_0xd27d[_0xd344ef];return _0x50a171;};'use strict';var multer=require('multer');var util=require(_0xdd27('0x0'));var path=require(_0xdd27('0x1'));var timeout=require(_0xdd27('0x2'));var express=require(_0xdd27('0x3'));var router=express['Router']();var fs_extra=require(_0xdd27('0x4'));var auth=require(_0xdd27('0x5'));var interaction=require(_0xdd27('0x6'));var config=require('../../config/environment');var controller=require(_0xdd27('0x7'));router[_0xdd27('0x8')]('/',auth[_0xdd27('0x9')](),controller[_0xdd27('0xa')]);router[_0xdd27('0x8')](_0xdd27('0xb'),auth[_0xdd27('0x9')](),controller[_0xdd27('0xc')]);router[_0xdd27('0x8')](_0xdd27('0xd'),auth['isAuthenticated'](),controller[_0xdd27('0xe')]);router[_0xdd27('0x8')](_0xdd27('0xf'),auth[_0xdd27('0x9')](),controller['getUnread']);router[_0xdd27('0x8')](_0xdd27('0x10'),auth['isAuthenticated'](),controller[_0xdd27('0x11')]);router[_0xdd27('0x8')](_0xdd27('0x12'),auth[_0xdd27('0x9')](),controller['getMessages']);router[_0xdd27('0x13')]('/',auth[_0xdd27('0x9')](),controller['create']);router[_0xdd27('0x13')]('/:id/members',auth[_0xdd27('0x9')](),controller['addMembers']);router[_0xdd27('0x13')](_0xdd27('0x12'),auth[_0xdd27('0x9')](),controller[_0xdd27('0x14')]);router['put']('/:id',auth[_0xdd27('0x9')](),controller[_0xdd27('0x15')]);router[_0xdd27('0x16')](_0xdd27('0xd'),auth[_0xdd27('0x9')](),controller[_0xdd27('0x17')]);router['delete'](_0xdd27('0x10'),auth[_0xdd27('0x9')](),controller[_0xdd27('0x18')]);module[_0xdd27('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 d4bf4be..28b9404 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 _0x83d8=['STRING','DATE','out','exports','BOOLEAN','INTEGER','ENUM','star','TEXT'];(function(_0x232cb8,_0x390d88){var _0x319ea0=function(_0x3395aa){while(--_0x3395aa){_0x232cb8['push'](_0x232cb8['shift']());}};_0x319ea0(++_0x390d88);}(_0x83d8,0xdb));var _0x883d=function(_0x1bb727,_0xfaa60e){_0x1bb727=_0x1bb727-0x0;var _0x2001d5=_0x83d8[_0x1bb727];return _0x2001d5;};'use strict';var Sequelize=require('sequelize');module[_0x883d('0x0')]={'closed':{'type':Sequelize[_0x883d('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x883d('0x2')]},'ratingType':{'type':Sequelize[_0x883d('0x3')](_0x883d('0x4'),'thumb'),'defaultValue':_0x883d('0x4')},'ratingMessage':{'type':Sequelize[_0x883d('0x5')]},'pathTranscript':{'type':Sequelize[_0x883d('0x5')]},'mailTranscript':{'type':Sequelize[_0x883d('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x883d('0x7')]},'disposition':{'type':Sequelize[_0x883d('0x6')]},'secondDisposition':{'type':Sequelize[_0x883d('0x6')]},'thirdDisposition':{'type':Sequelize[_0x883d('0x6')]},'note':{'type':Sequelize[_0x883d('0x6')]},'browserName':{'type':Sequelize[_0x883d('0x6')]},'browserVersion':{'type':Sequelize[_0x883d('0x6')]},'osName':{'type':Sequelize[_0x883d('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x883d('0x6')]},'deviceVendor':{'type':Sequelize[_0x883d('0x6')]},'deviceType':{'type':Sequelize[_0x883d('0x6')]},'referer':{'type':Sequelize[_0x883d('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x883d('0x5')]('long')},'read1stAt':{'type':Sequelize[_0x883d('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x883d('0x3')]('in',_0x883d('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x883d('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x883d('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x883d('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x883d('0x2')]}};
\ No newline at end of file
+var _0x8870=['sequelize','exports','INTEGER','ENUM','thumb','star','TEXT','STRING','DATE','long','BOOLEAN'];(function(_0x4acfd2,_0x5b9374){var _0x12afbe=function(_0x5bc178){while(--_0x5bc178){_0x4acfd2['push'](_0x4acfd2['shift']());}};_0x12afbe(++_0x5b9374);}(_0x8870,0xfd));var _0x0887=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x8870[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require(_0x0887('0x0'));module[_0x0887('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x0887('0x2')]},'ratingType':{'type':Sequelize[_0x0887('0x3')]('star',_0x0887('0x4')),'defaultValue':_0x0887('0x5')},'ratingMessage':{'type':Sequelize[_0x0887('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x0887('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x0887('0x8')]},'disposition':{'type':Sequelize[_0x0887('0x7')]},'secondDisposition':{'type':Sequelize[_0x0887('0x7')]},'thirdDisposition':{'type':Sequelize[_0x0887('0x7')]},'note':{'type':Sequelize[_0x0887('0x7')]},'browserName':{'type':Sequelize[_0x0887('0x7')]},'browserVersion':{'type':Sequelize[_0x0887('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x0887('0x7')]},'deviceModel':{'type':Sequelize[_0x0887('0x7')]},'deviceVendor':{'type':Sequelize[_0x0887('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x0887('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x0887('0x9'))},'read1stAt':{'type':Sequelize[_0x0887('0x8')]},'lastMsgAt':{'type':Sequelize[_0x0887('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x0887('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x0887('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x0887('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x0887('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x0887('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index d732194..126b873 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 _0x1e57=['merge','body','contact','agent','interaction','account','index','rawAttributes','fieldName','type','key','query','user','show','params','model','ChatInteraction','keys','filters','intersection','attributes','fields','length','includeAll','include','options','find','create','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','attachmentUpload','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','ChatMessage','User','ContactId','Messages','%s%d','agentAlias','customer','Visitor','website_alias','System','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','CloudProvider','Smtp','SendMail','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','getMessages','nolimit','order','sort','where','pick','filter','split','count','findAll','rows','getMyMessages','hasOwnProperty','ChatInteractionId','map','includeAgent','push','addTags','setTags','omit','spread','emit','chatInteractionTags:save','unix','toString','files','tmp','server','attachments','lastName','direction','read','Account','get','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','firstName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','err','unlinkSync','rimraf','request-promise','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','set','update','destroy','stack','name','send','render'];(function(_0x5de70d,_0x10a712){var _0x353b67=function(_0x3c10fd){while(--_0x3c10fd){_0x5de70d['push'](_0x5de70d['shift']());}};_0x353b67(++_0x10a712);}(_0x1e57,0x176));var _0x71e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e57[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0x71e5('0x0'));var zipdir=require('zip-dir');var rp=require(_0x71e5('0x1'));var moment=require('moment');var BPromise=require(_0x71e5('0x2'));var Mustache=require(_0x71e5('0x3'));var util=require(_0x71e5('0x4'));var path=require(_0x71e5('0x5'));var ejs=require(_0x71e5('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x71e5('0x7'));var interaction=require(_0x71e5('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0x71e5('0x9'));var logger=require(_0x71e5('0xa'))(_0x71e5('0xb'));var config=require(_0x71e5('0xc'));var db=require(_0x71e5('0xd'))['db'];config['redis']=_[_0x71e5('0xe')](config['redis'],{'host':_0x71e5('0xf'),'port':0x18eb});var socket=require(_0x71e5('0x10'))(new Redis(config[_0x71e5('0x11')]));require(_0x71e5('0x12'))[_0x71e5('0x13')](socket);var jayson=require(_0x71e5('0x14'));var client=jayson[_0x71e5('0x15')][_0x71e5('0x16')]({'port':0x232b});var client9004=jayson[_0x71e5('0x15')][_0x71e5('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x270996,_0x2aba45,_0x2cd72f,_0x9f8a17){return new BPromise(function(_0x112224,_0x44428b){var _0xe1c02d=_0x9f8a17||client;return _0xe1c02d[_0x71e5('0x17')](_0x270996,_0x2cd72f)[_0x71e5('0x18')](function(_0x497b8a){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x2aba45,_0x71e5('0x19'));logger[_0x71e5('0x1a')](_0x71e5('0x1b'),_0x2aba45,_0x71e5('0x19'),JSON[_0x71e5('0x1c')](_0x497b8a));if(_0x497b8a[_0x71e5('0x1d')]){if(_0x497b8a[_0x71e5('0x1d')][_0x71e5('0x1e')]===0x1f4){logger[_0x71e5('0x1d')](_0x71e5('0x1f'),_0x2aba45,_0x497b8a['error'][_0x71e5('0x20')]);return _0x44428b(_0x497b8a[_0x71e5('0x1d')]['message']);}logger['error'](_0x71e5('0x1f'),_0x2aba45,_0x497b8a[_0x71e5('0x1d')][_0x71e5('0x20')]);return _0x112224(_0x497b8a[_0x71e5('0x1d')][_0x71e5('0x20')]);}else{logger[_0x71e5('0x21')](_0x71e5('0x1f'),_0x2aba45,'request\x20sent');_0x112224(_0x497b8a[_0x71e5('0x22')][_0x71e5('0x20')]);}})[_0x71e5('0x23')](function(_0x3bb7ed){logger[_0x71e5('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x2aba45,_0x3bb7ed);_0x44428b(_0x3bb7ed);});});}function respondWithStatusCode(_0x5933f4,_0x1c93af){_0x1c93af=_0x1c93af||0xcc;return function(_0x14354f){if(_0x14354f){return _0x5933f4[_0x71e5('0x24')](_0x1c93af);}return _0x5933f4['status'](_0x1c93af)[_0x71e5('0x25')]();};}function respondWithResult(_0x530055,_0x191b6a){_0x191b6a=_0x191b6a||0xc8;return function(_0x2e0f46){if(_0x2e0f46){return _0x530055[_0x71e5('0x26')](_0x191b6a)[_0x71e5('0x27')](_0x2e0f46);}};}function respondWithFilteredResult(_0x48adfb,_0x5e79d8){return function(_0x26e390){if(_0x26e390){var _0x2dbe5b=typeof _0x5e79d8[_0x71e5('0x28')]===_0x71e5('0x29')&&typeof _0x5e79d8[_0x71e5('0x2a')]===_0x71e5('0x29');var _0x1e4a78=_0x26e390['count'];var _0x546b9e=_0x2dbe5b?0x0:_0x5e79d8[_0x71e5('0x28')];var _0x228c71=_0x2dbe5b?_0x26e390['count']:_0x5e79d8[_0x71e5('0x28')]+_0x5e79d8[_0x71e5('0x2a')];var _0x277661;if(_0x228c71>=_0x1e4a78){_0x228c71=_0x1e4a78;_0x277661=0xc8;}else{_0x277661=0xce;}_0x48adfb['status'](_0x277661);return _0x48adfb[_0x71e5('0x2b')]('Content-Range',_0x546b9e+'-'+_0x228c71+'/'+_0x1e4a78)[_0x71e5('0x27')](_0x26e390);}return null;};}function saveUpdates(_0x19e505){return function(_0x5cac91){if(_0x5cac91){return _0x5cac91[_0x71e5('0x2c')](_0x19e505)[_0x71e5('0x18')](function(_0x2f0606){return _0x2f0606;});}return null;};}function removeEntity(_0xb599e3){return function(_0x4c57b5){if(_0x4c57b5){return _0x4c57b5[_0x71e5('0x2d')]()[_0x71e5('0x18')](function(){_0xb599e3['status'](0xcc)[_0x71e5('0x25')]();});}};}function handleEntityNotFound(_0x4e97b0){return function(_0x4fa967){if(!_0x4fa967){_0x4e97b0['sendStatus'](0x194);}return _0x4fa967;};}function handleError(_0x5172ff,_0x25c5f5){_0x25c5f5=_0x25c5f5||0x1f4;return function(_0x4c41c7){logger[_0x71e5('0x1d')](_0x4c41c7[_0x71e5('0x2e')]);if(_0x4c41c7[_0x71e5('0x2f')]){delete _0x4c41c7[_0x71e5('0x2f')];}_0x5172ff[_0x71e5('0x26')](_0x25c5f5)[_0x71e5('0x30')](_0x4c41c7);};}function getMustacheRender(_0x536539,_0x18886e){return Mustache[_0x71e5('0x31')](_0x536539,_[_0x71e5('0x32')](_0x18886e[_0x71e5('0x33')],{'contact':_0x18886e[_0x71e5('0x34')],'message':_0x18886e[_0x71e5('0x20')],'agent':_0x18886e[_0x71e5('0x35')],'interaction':_0x18886e[_0x71e5('0x36')],'account':_0x18886e[_0x71e5('0x37')]}))||'';}exports[_0x71e5('0x38')]=function(_0x19cac3,_0x3f842a){var _0x57778b={};var _0x2a65ee=_['map'](db['ChatInteraction'][_0x71e5('0x39')],function(_0xced590){return{'name':_0xced590[_0x71e5('0x3a')],'type':_0xced590[_0x71e5('0x3b')][_0x71e5('0x3c')]};});_0x57778b=qs['getOptions'](_0x2a65ee,_0x19cac3);return interaction['findAll']('chat',_0x19cac3[_0x71e5('0x3d')],_0x19cac3[_0x71e5('0x3e')],_0x57778b,_0x2a65ee)['then'](respondWithFilteredResult(_0x3f842a,_0x57778b))['catch'](handleError(_0x3f842a,null));};exports[_0x71e5('0x3f')]=function(_0x16d766,_0x2c7d6a){var _0xbe7065={'raw':![],'where':{'id':_0x16d766[_0x71e5('0x40')]['id']}},_0xf6aa2={};_0xf6aa2[_0x71e5('0x41')]=_['keys'](db[_0x71e5('0x42')][_0x71e5('0x39')]);_0xf6aa2[_0x71e5('0x3d')]=_[_0x71e5('0x43')](_0x16d766[_0x71e5('0x3d')]);_0xf6aa2[_0x71e5('0x44')]=_[_0x71e5('0x45')](_0xf6aa2['model'],_0xf6aa2[_0x71e5('0x3d')]);_0xbe7065[_0x71e5('0x46')]=_[_0x71e5('0x45')](_0xf6aa2[_0x71e5('0x41')],qs[_0x71e5('0x47')](_0x16d766[_0x71e5('0x3d')][_0x71e5('0x47')]));_0xbe7065[_0x71e5('0x46')]=_0xbe7065[_0x71e5('0x46')][_0x71e5('0x48')]?_0xbe7065['attributes']:_0xf6aa2[_0x71e5('0x41')];if(_0x16d766['query'][_0x71e5('0x49')]){_0xbe7065[_0x71e5('0x4a')]=[{'all':!![]}];}_0xbe7065=_[_0x71e5('0x32')]({},_0xbe7065,_0x16d766[_0x71e5('0x4b')]);return db[_0x71e5('0x42')][_0x71e5('0x4c')](_0xbe7065)[_0x71e5('0x18')](handleEntityNotFound(_0x2c7d6a,null))[_0x71e5('0x18')](respondWithResult(_0x2c7d6a,null))[_0x71e5('0x23')](handleError(_0x2c7d6a,null));};exports[_0x71e5('0x4d')]=function(_0xe2e8af,_0x5e90ab){return db[_0x71e5('0x42')][_0x71e5('0x4d')](_0xe2e8af[_0x71e5('0x33')],{})[_0x71e5('0x18')](respondWithResult(_0x5e90ab,0xc9))[_0x71e5('0x23')](handleError(_0x5e90ab,null));};exports[_0x71e5('0x2c')]=function(_0x5591af,_0xfb96c6){if(_0x5591af['body']['id']){delete _0x5591af['body']['id'];}return db[_0x71e5('0x42')][_0x71e5('0x4c')]({'where':{'id':_0x5591af[_0x71e5('0x40')]['id']}})[_0x71e5('0x18')](handleEntityNotFound(_0xfb96c6,null))[_0x71e5('0x18')](saveUpdates(_0x5591af['body'],null))[_0x71e5('0x18')](respondWithResult(_0xfb96c6,null))[_0x71e5('0x23')](handleError(_0xfb96c6,null));};exports[_0x71e5('0x2d')]=function(_0x83071d,_0x3fe793){return db['ChatInteraction']['find']({'where':{'id':_0x83071d[_0x71e5('0x40')]['id']}})[_0x71e5('0x18')](handleEntityNotFound(_0x3fe793,null))[_0x71e5('0x18')](removeEntity(_0x3fe793,null))[_0x71e5('0x23')](handleError(_0x3fe793,null));};exports['describe']=function(_0x1890ea,_0x2f3db6){return db[_0x71e5('0x42')][_0x71e5('0x4e')]()['then'](respondWithResult(_0x2f3db6,null))[_0x71e5('0x23')](handleError(_0x2f3db6,null));};exports[_0x71e5('0x4f')]=function(_0x15176b,_0x4b9252){var _0x1aedc6=_0x15176b['params']['id'];var _0x4ee2e2;var _0x5ce4a9;var _0x45c5ef;return db[_0x71e5('0x42')]['findOne']({'where':{'id':_0x1aedc6}})[_0x71e5('0x18')](function(_0x4f33d9){_0x4ee2e2=_0x4f33d9;return db[_0x71e5('0x50')][_0x71e5('0x51')]({'where':{'id':_0x4f33d9[_0x71e5('0x52')]},'attributes':['id',_0x71e5('0x53'),_0x71e5('0x54'),_0x71e5('0x55'),_0x71e5('0x56'),_0x71e5('0x57')],'raw':!![]});})[_0x71e5('0x18')](function(_0xb0c6da){if(_0xb0c6da&&_0xb0c6da['vidaooApiKey']&&_0xb0c6da[_0x71e5('0x54')]){_0x5ce4a9=_0xb0c6da;var _0x43a50b={'interaction':{'id':_0x1aedc6},'agent':{'id':_0x15176b[_0x71e5('0x3e')]['id'],'name':_0x15176b[_0x71e5('0x3e')][_0x71e5('0x2f')],'fullname':_0x15176b[_0x71e5('0x3e')][_0x71e5('0x58')],'email':_0x15176b[_0x71e5('0x3e')][_0x71e5('0x59')]},'contact':_0x15176b[_0x71e5('0x33')][_0x71e5('0x34')],'account':_0x15176b['body'][_0x71e5('0x37')]};var _0x23d852={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0xb0c6da[_0x71e5('0x53')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x15176b[_0x71e5('0x3e')][_0x71e5('0x59')]],'buttons':null,'topic':_0x5ce4a9[_0x71e5('0x55')],'note':_[_0x71e5('0x5a')](_0x5ce4a9[_0x71e5('0x56')])?null:getMustacheRender(_0x5ce4a9['vidaooNote'],_0x43a50b),'metadata':null},'redirect':_0x71e5('0x5b'),'json':!![]};try{if(!_['isNull'](_0x5ce4a9[_0x71e5('0x57')])){var _0x2b4d72=getMustacheRender(_0x5ce4a9[_0x71e5('0x57')],_0x43a50b);var _0x10d835=JSON[_0x71e5('0x5c')](_0x2b4d72);_0x23d852[_0x71e5('0x33')][_0x71e5('0x5d')]=_0x10d835;}}catch(_0x44fbd7){throw new db[(_0x71e5('0x5e'))][(_0x71e5('0x5f'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x23d852);}else{throw new db[(_0x71e5('0x5e'))][(_0x71e5('0x5f'))](_0x71e5('0x60'));}})[_0x71e5('0x18')](function(_0x549b2c){_0x45c5ef=_0x549b2c;if(_0x45c5ef['id']){var _0x6c6af5={'body':_0x45c5ef['join_url'],'ChatWebsiteId':_0x5ce4a9['id'],'ChatInteractionId':_0x4ee2e2['id'],'direction':_0x71e5('0x61'),'UserId':_0x15176b['user']['id']};return db['ChatMessage'][_0x71e5('0x4d')](_0x6c6af5,{});}else{throw new db[(_0x71e5('0x5e'))][(_0x71e5('0x5f'))](_0x71e5('0x62'));}})[_0x71e5('0x18')](function(){return _0x4ee2e2['updateAttributes']({'vidaooSessionId':_0x45c5ef['id']});})[_0x71e5('0x18')](respondWithResult(_0x4b9252,null))[_0x71e5('0x23')](handleError(_0x4b9252,null));};exports[_0x71e5('0x63')]=function(_0x224957,_0x153705){if(_0x224957[_0x71e5('0x33')]['id']){delete _0x224957[_0x71e5('0x33')]['id'];}return db[_0x71e5('0x42')][_0x71e5('0x4c')]({'where':{'id':_0x224957[_0x71e5('0x40')]['id']},'include':[{'model':db[_0x71e5('0x64')],'as':_0x71e5('0x65')}]})[_0x71e5('0x18')](handleEntityNotFound(_0x153705,null))['then'](saveUpdates(_0x224957[_0x71e5('0x33')],null))['then'](respondWithResult(_0x153705,null))[_0x71e5('0x23')](handleError(_0x153705,null));};exports['abandon']=function(_0x2cc560,_0x59e009){if(_0x2cc560['body']['id']){delete _0x2cc560[_0x71e5('0x33')]['id'];}return db[_0x71e5('0x42')][_0x71e5('0x4c')]({'where':{'id':_0x2cc560[_0x71e5('0x40')]['id']}})['then'](function(_0x4f37b0){if(!_0x4f37b0){logger[_0x71e5('0x1d')](_0x71e5('0x66'),_0x71e5('0x67'),0x194,_0x71e5('0x68'));_0x59e009[_0x71e5('0x24')](0x194);}else{if(_0x4f37b0[_0x71e5('0x69')]){throw new db[(_0x71e5('0x5e'))][(_0x71e5('0x5f'))]('Interaction\x20already\x20assigned');}}return _0x4f37b0;})['then'](function(_0x33d1ac){if(_0x33d1ac){return _0x33d1ac['update']({'closed':_0x2cc560['body'][_0x71e5('0x6a')],'disposition':_0x2cc560['body'][_0x71e5('0x6b')]})[_0x71e5('0x18')](function(_0x4dc408){return _0x4dc408;});}})[_0x71e5('0x18')](function(){return respondWithRpcPromise(_0x71e5('0x6c'),_0x71e5('0x67'),_0x2cc560[_0x71e5('0x33')],client9004);})[_0x71e5('0x18')](respondWithResult(_0x59e009,null))[_0x71e5('0x23')](handleError(_0x59e009,null));};exports[_0x71e5('0x6d')]=function(_0x4e8b14,_0x2fa04b){_0x4e8b14[_0x71e5('0x33')]['name']=_0x4e8b14['file']['originalname'];_0x4e8b14[_0x71e5('0x33')]['basename']=_0x4e8b14[_0x71e5('0x6e')][_0x71e5('0x6f')];_0x4e8b14[_0x71e5('0x33')][_0x71e5('0x3b')]=_0x4e8b14['file'][_0x71e5('0x70')];return db[_0x71e5('0x71')][_0x71e5('0x4d')](_0x4e8b14['body'])['then'](respondWithResult(_0x2fa04b,0xc9))['catch'](handleError(_0x2fa04b,null));};exports[_0x71e5('0x72')]=function(_0x32dca8,_0x96715e){return db[_0x71e5('0x42')][_0x71e5('0x51')]({'where':{'id':_0x32dca8['params']['id']},'raw':!![]})[_0x71e5('0x18')](handleEntityNotFound(_0x96715e,null))[_0x71e5('0x18')](function(_0xaf2a6b){if(_0xaf2a6b){if(_0xaf2a6b[_0x71e5('0x6a')]){return _0x96715e['status'](0x193)['json']({'status':0x193,'message':_0x71e5('0x73')});}return db[_0x71e5('0x71')][_0x71e5('0x51')]({'where':{'id':_0x32dca8[_0x71e5('0x3d')][_0x71e5('0x74')]},'raw':!![]})[_0x71e5('0x18')](handleEntityNotFound(_0x96715e,null));}})[_0x71e5('0x18')](function(_0x3b5954){if(_0x3b5954){var _0x4c7911=_0x3b5954[_0x71e5('0x75')]!==null;var _0x24de54=path['join'](config[_0x71e5('0x76')],_0x71e5('0x77'));if(_0x4c7911){_0x24de54=path[_0x71e5('0x78')](_0x24de54,_0x71e5('0x79'));}var _0x25f15d=path[_0x71e5('0x78')](_0x24de54,_0x3b5954[_0x71e5('0x7a')]);return _0x96715e[_0x71e5('0x7b')](_0x25f15d);}})[_0x71e5('0x23')](handleError(_0x96715e,null));};exports[_0x71e5('0x7c')]=function(_0x1a59a2,_0x19d322){var _0x11f0fe=null;var _0x363353=null;var _0x2eff54=null;if(_0x1a59a2[_0x71e5('0x33')]['id']){delete _0x1a59a2['body']['id'];}if(_0x1a59a2[_0x71e5('0x33')][_0x71e5('0x7d')]){_0x2eff54=path['join'](config[_0x71e5('0x76')],_0x71e5('0x7e'),util[_0x71e5('0x7f')]('transcript-%s.txt',Date[_0x71e5('0x80')]()));_0x1a59a2[_0x71e5('0x33')][_0x71e5('0x81')]=_0x2eff54;}return db[_0x71e5('0x42')][_0x71e5('0x4c')]({'where':{'id':_0x1a59a2[_0x71e5('0x40')]['id']},'include':[{'model':db[_0x71e5('0x82')],'as':'Messages','include':[{'model':db[_0x71e5('0x83')],'as':_0x71e5('0x83')}]}]})[_0x71e5('0x18')](handleEntityNotFound(_0x19d322,null))['then'](saveUpdates(_0x1a59a2[_0x71e5('0x33')],null))[_0x71e5('0x18')](function(_0x38529d){if(_0x38529d){_0x11f0fe=_0x38529d;return db[_0x71e5('0x50')][_0x71e5('0x4c')]({'where':{'id':_0x11f0fe[_0x71e5('0x52')]}});}})[_0x71e5('0x18')](function(_0x412d2b){if(_0x412d2b){_0x363353=_0x412d2b;return db[_0x71e5('0x64')]['find']({'where':{'id':_0x11f0fe[_0x71e5('0x84')]}});}})[_0x71e5('0x18')](function(_0x18a97c){if(_0x18a97c){if(_0x2eff54){var _0xaf3434=null;for(var _0x34b3f4=0x1;_0x34b3f4<_0x11f0fe['Messages'][_0x71e5('0x48')];++_0x34b3f4){_0xaf3434=_0x11f0fe[_0x71e5('0x85')][_0x34b3f4];var _0x28e099=_0xaf3434[_0x71e5('0x69')]?util['format'](_0x71e5('0x86'),_0x363353[_0x71e5('0x87')],_0xaf3434[_0x71e5('0x69')]):'System';var _0x57dfa4=_0x1a59a2['body'][_0x71e5('0x88')]||util[_0x71e5('0x7f')]('%s%d',_0x71e5('0x89'),_0xaf3434[_0x71e5('0x84')]);switch(_0x363353['agentIdentifier']){case _0x71e5('0x8a'):_0x28e099=_0xaf3434[_0x71e5('0x69')]?util[_0x71e5('0x7f')]('%s%d',_0x363353[_0x71e5('0x87')],_0xaf3434[_0x71e5('0x69')]):_0x71e5('0x8b');break;case'agent_alias':_0x28e099=_0xaf3434[_0x71e5('0x69')]?_0xaf3434['User'][_0x71e5('0x8c')]||_0xaf3434[_0x71e5('0x83')]['fullname']:_0x71e5('0x8b');break;case _0x71e5('0x8d'):_0x28e099=_0xaf3434[_0x71e5('0x69')]?_0xaf3434[_0x71e5('0x83')][_0x71e5('0x58')]:_0x71e5('0x8b');break;default:_0x28e099=_0xaf3434[_0x71e5('0x69')]?util[_0x71e5('0x7f')](_0x71e5('0x86'),_0x363353['agentAlias'],_0xaf3434[_0x71e5('0x69')]):'System';}var _0x26a9cc=util[_0x71e5('0x7f')]('[%s]\x20%s:\x20%s\x0a',moment(_0xaf3434[_0x71e5('0x8e')])[_0x71e5('0x7f')](_0x71e5('0x8f')),_0xaf3434['direction']==='in'?_0x57dfa4:_0x28e099,_0xaf3434[_0x71e5('0x33')]);if(!_0xaf3434[_0x71e5('0x90')]){fs[_0x71e5('0x91')](_0x2eff54,_0x26a9cc);}}return db['MailAccount'][_0x71e5('0x51')]({'where':{'service':!![]},'include':[{'model':db[_0x71e5('0x92')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x71e5('0x93')],'as':_0x71e5('0x93'),'raw':!![]}]}]});}}})[_0x71e5('0x18')](function(_0x6eea2){if(!_0x6eea2||!_0x6eea2[_0x71e5('0x94')]||!_0x1a59a2['body'])return _0x11f0fe;var _0x362fb2=_0x6eea2['getSmtpOptions']();return respondWithRpcPromise(_0x71e5('0x95'),_0x71e5('0x96'),{'account':_0x362fb2,'message':{'from':util[_0x71e5('0x7f')](_0x71e5('0x97'),_0x6eea2['name'],_0x6eea2[_0x71e5('0x59')]||_0x6eea2[_0x71e5('0x94')][_0x71e5('0x3e')]),'to':_0x1a59a2['body']['mailTranscript'],'subject':_0x71e5('0x98'),'text':util[_0x71e5('0x7f')](_0x71e5('0x99'),_0x1a59a2['body'][_0x71e5('0x7d')]),'attachments':[{'path':_0x2eff54}]}})[_0x71e5('0x18')](function(){return _0x11f0fe;})[_0x71e5('0x23')](function(_0x5f0622){logger['error'](_0x5f0622);});})[_0x71e5('0x18')](respondWithStatusCode(_0x19d322,0xc8))[_0x71e5('0x23')](handleError(_0x19d322,null));};exports[_0x71e5('0x9a')]=function(_0x3dabf0,_0x5cfa0d){return db[_0x71e5('0x82')]['find']({'where':{'id':_0x3dabf0['params']['id']}})[_0x71e5('0x18')](handleEntityNotFound(_0x5cfa0d,null))[_0x71e5('0x18')](function(_0x2567cc){if(_0x2567cc){return _0x2567cc['addMessage'](_0x3dabf0[_0x71e5('0x33')][_0x71e5('0x9b')],_['omit'](_0x3dabf0[_0x71e5('0x33')],['ids','id'])||{});}})['then'](respondWithResult(_0x5cfa0d,null))['catch'](handleError(_0x5cfa0d,null));};exports[_0x71e5('0x9c')]=function(_0x5b6893,_0x333bff){var _0x1ca46c={'raw':![],'where':{}};var _0x4867d0={};var _0x2c9f65={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x71e5('0x51')]({'where':{'id':_0x5b6893['params']['id']}})[_0x71e5('0x18')](handleEntityNotFound(_0x333bff,null))[_0x71e5('0x18')](function(_0x2368b8){if(_0x2368b8){_0x4867d0[_0x71e5('0x41')]=_['keys'](db[_0x71e5('0x82')][_0x71e5('0x39')]);_0x4867d0['query']=_[_0x71e5('0x43')](_0x5b6893[_0x71e5('0x3d')]);_0x4867d0[_0x71e5('0x44')]=_[_0x71e5('0x45')](_0x4867d0['model'],_0x4867d0[_0x71e5('0x3d')]);_0x1ca46c[_0x71e5('0x46')]=_[_0x71e5('0x45')](_0x4867d0[_0x71e5('0x41')],qs[_0x71e5('0x47')](_0x5b6893[_0x71e5('0x3d')][_0x71e5('0x47')]));_0x1ca46c[_0x71e5('0x46')]=_0x1ca46c[_0x71e5('0x46')][_0x71e5('0x48')]?_0x1ca46c[_0x71e5('0x46')]:_0x4867d0[_0x71e5('0x41')];if(!_0x5b6893[_0x71e5('0x3d')]['hasOwnProperty'](_0x71e5('0x9d'))){_0x1ca46c[_0x71e5('0x2a')]=qs['limit'](_0x5b6893[_0x71e5('0x3d')][_0x71e5('0x2a')]);_0x1ca46c['offset']=qs['offset'](_0x5b6893[_0x71e5('0x3d')][_0x71e5('0x28')]);}_0x1ca46c[_0x71e5('0x9e')]=qs[_0x71e5('0x9f')](_0x5b6893[_0x71e5('0x3d')]['sort']);_0x1ca46c[_0x71e5('0xa0')]=qs[_0x71e5('0x44')](_[_0x71e5('0xa1')](_0x5b6893[_0x71e5('0x3d')],_0x4867d0[_0x71e5('0x44')]));_0x1ca46c['where']['ChatInteractionId']=_0x2368b8['id'];if(_0x5b6893[_0x71e5('0x3d')]['filter']){_0x1ca46c[_0x71e5('0xa0')]=_[_0x71e5('0x32')](_0x1ca46c[_0x71e5('0xa0')],{'$or':_['map'](_0x1ca46c[_0x71e5('0x46')],function(_0xb6ae1b){var _0x3057b6={};_0x3057b6[_0xb6ae1b]={'$like':'%'+_0x5b6893[_0x71e5('0x3d')][_0x71e5('0xa2')]+'%'};return _0x3057b6;})});}if(_0x5b6893['query']['$gte']){var _0x2cd393=_0x5b6893['query']['$gte'][_0x71e5('0xa3')](',');var _0x18554b={};_0x18554b[_0x2cd393[0x0]]={'$gte':moment(_0x2cd393[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1ca46c[_0x71e5('0xa0')]=_[_0x71e5('0x32')](_0x1ca46c[_0x71e5('0xa0')],_0x18554b);}_0x1ca46c=_[_0x71e5('0x32')]({},_0x1ca46c,_0x5b6893['options']);return db[_0x71e5('0x82')][_0x71e5('0xa4')]({'where':_0x1ca46c[_0x71e5('0xa0')]})[_0x71e5('0x18')](function(_0x409854){_0x2c9f65[_0x71e5('0xa4')]=_0x409854;if(_0x5b6893[_0x71e5('0x3d')][_0x71e5('0x49')]){_0x1ca46c['include']=[{'all':!![]}];}return db[_0x71e5('0x82')][_0x71e5('0xa5')](_0x1ca46c);})[_0x71e5('0x18')](function(_0x98c6c2){_0x2c9f65[_0x71e5('0xa6')]=_0x98c6c2;return _0x2c9f65;});}})[_0x71e5('0x18')](respondWithFilteredResult(_0x333bff,_0x1ca46c))[_0x71e5('0x23')](handleError(_0x333bff,null));};exports[_0x71e5('0xa7')]=function(_0x224e2f,_0x5465b0){var _0x37a26a={'where':{}},_0x5f2ff9={},_0x39a0dc={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x224e2f[_0x71e5('0x40')]['id']}})[_0x71e5('0x18')](handleEntityNotFound(_0x5465b0,null))['then'](function(_0x3b1ec2){if(_0x3b1ec2){_0x5f2ff9[_0x71e5('0x41')]=_['keys'](db[_0x71e5('0x82')][_0x71e5('0x39')]);_0x5f2ff9['query']=_[_0x71e5('0x43')](_0x224e2f['query']);_0x5f2ff9[_0x71e5('0x44')]=_[_0x71e5('0x45')](_0x5f2ff9[_0x71e5('0x41')],_0x5f2ff9[_0x71e5('0x3d')]);_0x37a26a[_0x71e5('0x46')]=_[_0x71e5('0x45')](_0x5f2ff9[_0x71e5('0x41')],qs[_0x71e5('0x47')](_0x224e2f['query'][_0x71e5('0x47')]));_0x37a26a[_0x71e5('0x46')]=_0x37a26a['attributes'][_0x71e5('0x48')]?_0x37a26a['attributes']:_0x5f2ff9[_0x71e5('0x41')];if(!_0x224e2f['query'][_0x71e5('0xa8')]('nolimit')){_0x37a26a['limit']=qs['limit'](_0x224e2f['query'][_0x71e5('0x2a')]);_0x37a26a[_0x71e5('0x28')]=qs[_0x71e5('0x28')](_0x224e2f[_0x71e5('0x3d')][_0x71e5('0x28')]);}_0x37a26a[_0x71e5('0x9e')]=qs[_0x71e5('0x9f')](_0x224e2f[_0x71e5('0x3d')][_0x71e5('0x9f')]);_0x37a26a['where']=qs['filters'](_['pick'](_0x224e2f[_0x71e5('0x3d')],_0x5f2ff9[_0x71e5('0x44')]));_0x37a26a[_0x71e5('0xa0')][_0x71e5('0xa9')]=_0x3b1ec2['id'];if(_0x224e2f[_0x71e5('0x3d')][_0x71e5('0xa2')]){_0x37a26a['where']=_[_0x71e5('0x32')](_0x37a26a[_0x71e5('0xa0')],{'$or':_[_0x71e5('0xaa')](_0x37a26a['attributes'],function(_0x419383){var _0x37b5b4={};_0x37b5b4[_0x419383]={'$like':'%'+_0x224e2f[_0x71e5('0x3d')]['filter']+'%'};return _0x37b5b4;})});}_0x37a26a[_0x71e5('0xa0')][_0x71e5('0x90')]=![];if(_0x224e2f[_0x71e5('0x3d')]['id']){_0x37a26a[_0x71e5('0xa0')]['id']={'$gt':_0x224e2f['query']['id']};}_0x37a26a=_[_0x71e5('0x32')]({},_0x37a26a,_0x224e2f[_0x71e5('0x4b')]);return db[_0x71e5('0x82')]['count']({'where':_0x37a26a['where']})[_0x71e5('0x18')](function(_0x382afb){_0x39a0dc['count']=_0x382afb;_0x37a26a[_0x71e5('0x4a')]=[];if(_0x224e2f[_0x71e5('0x3d')][_0x71e5('0xab')]){_0x37a26a[_0x71e5('0x4a')][_0x71e5('0xac')]({'model':db[_0x71e5('0x83')],'as':_0x71e5('0x83'),'attributes':['id',_0x71e5('0x58'),_0x71e5('0x8c')]});}if(_0x224e2f[_0x71e5('0x3d')]['includeAll']){_0x37a26a['include']=[{'all':!![]}];}return db['ChatMessage'][_0x71e5('0xa5')](_0x37a26a);})[_0x71e5('0x18')](function(_0x37241e){_0x39a0dc['rows']=_0x37241e;return _0x39a0dc;});}})[_0x71e5('0x18')](respondWithFilteredResult(_0x5465b0,_0x37a26a))['catch'](handleError(_0x5465b0,null));};exports[_0x71e5('0xad')]=function(_0x327ea5,_0x423db6){return db[_0x71e5('0x42')][_0x71e5('0x4c')]({'where':{'id':_0x327ea5[_0x71e5('0x40')]['id']}})[_0x71e5('0x18')](handleEntityNotFound(_0x423db6,null))['then'](function(_0x880549){if(_0x880549){return _0x880549[_0x71e5('0xae')](_0x327ea5[_0x71e5('0x33')][_0x71e5('0x9b')],_[_0x71e5('0xaf')](_0x327ea5[_0x71e5('0x33')],[_0x71e5('0x9b'),'id'])||{})[_0x71e5('0xb0')](function(){return db['Tag']['findAll']({'attributes':['id',_0x71e5('0x2f'),'color'],'where':{'id':_0x327ea5[_0x71e5('0x33')]['ids']}});})['then'](function(_0x231df3){socket[_0x71e5('0xb1')](_0x71e5('0xb2'),{'id':Number(_0x327ea5[_0x71e5('0x40')]['id']),'tags':_0x231df3||[]});return{'id':Number(_0x327ea5[_0x71e5('0x40')]['id']),'tags':_0x231df3||[]};});}})[_0x71e5('0x18')](respondWithResult(_0x423db6,null))[_0x71e5('0x23')](handleError(_0x423db6,null));};exports['removeTags']=function(_0x32d996,_0x3dedf6){return db[_0x71e5('0x42')][_0x71e5('0x4c')]({'where':{'id':_0x32d996['params']['id']}})['then'](handleEntityNotFound(_0x3dedf6,null))[_0x71e5('0x18')](function(_0x3691b6){if(_0x3691b6){return _0x3691b6['removeTags'](_0x32d996[_0x71e5('0x3d')][_0x71e5('0x9b')]);}})[_0x71e5('0x18')](respondWithStatusCode(_0x3dedf6,null))[_0x71e5('0x23')](handleError(_0x3dedf6,null));};exports[_0x71e5('0x7b')]=function(_0x1cfc06,_0x2d2aef){var _0x59114c=moment()[_0x71e5('0xb3')]()[_0x71e5('0xb4')]();var _0x3f7829=path['join'](config[_0x71e5('0x76')],'server',_0x71e5('0xb5'),_0x71e5('0xb6'));var _0x418a90=path[_0x71e5('0x78')](config['root'],_0x71e5('0xb7'),_0x71e5('0xb5'),_0x71e5('0xb8'));var _0x2e1514=path[_0x71e5('0x78')](_0x3f7829,_0x59114c);var _0x309b42=util[_0x71e5('0x7f')]('transcript-%d-%s.zip',_0x1cfc06[_0x71e5('0x40')]['id'],_0x59114c);var _0x22def5=path['join'](_0x3f7829,_0x309b42);var _0x4cde8d=[];_0x4cde8d[_0x71e5('0xac')]({'model':db['User'],'as':_0x71e5('0x83'),'attributes':['id',_0x71e5('0x58')],'raw':!![]});_0x4cde8d[_0x71e5('0xac')]({'model':db[_0x71e5('0x64')],'as':_0x71e5('0x65'),'attributes':['id','firstName',_0x71e5('0xb9')],'raw':!![]});if(_0x1cfc06[_0x71e5('0x3d')][_0x71e5('0xb8')]){_0x4cde8d[_0x71e5('0xac')]({'model':db['Attachment'],'as':_0x71e5('0x71'),'raw':!![]});}var _0x4a7edc=[{'model':db['ChatMessage'],'as':_0x71e5('0x85'),'attributes':['id',_0x71e5('0x33'),_0x71e5('0x8e'),_0x71e5('0xba'),_0x71e5('0x90'),_0x71e5('0xbb')],'include':_0x4cde8d}];_0x4a7edc[_0x71e5('0xac')]({'model':db[_0x71e5('0x50')],'as':_0x71e5('0xbc'),'attributes':['id',_0x71e5('0x2f')]});_0x4a7edc['push']({'model':db[_0x71e5('0x83')],'as':'Owner','attributes':['id',_0x71e5('0x58')]});return db[_0x71e5('0x42')][_0x71e5('0x4c')]({'where':{'id':_0x1cfc06['params']['id']},'include':_0x4a7edc})[_0x71e5('0x18')](handleEntityNotFound(_0x2d2aef,null))[_0x71e5('0x18')](function(_0x35b069){if(_0x35b069){var _0x4d4c27=_0x35b069[_0x71e5('0xbd')]({'plain':!![]});fs['mkdirSync'](_0x2e1514);var _0x86e45e={'channel':'Chat','account':_0x4d4c27[_0x71e5('0xbc')]['name'],'agent':_0x4d4c27[_0x71e5('0xbe')]?_0x4d4c27[_0x71e5('0xbe')][_0x71e5('0x58')]:_0x71e5('0xbf'),'createdAt':moment(_0x4d4c27[_0x71e5('0x8e')])[_0x71e5('0x7f')](_0x71e5('0xc0'))[_0x71e5('0xb4')](),'closedAt':_0x4d4c27[_0x71e5('0x6a')]?moment(_0x4d4c27[_0x71e5('0xc1')])[_0x71e5('0x7f')](_0x71e5('0xc0'))[_0x71e5('0xb4')]():'','disposition':_0x4d4c27[_0x71e5('0x6b')],'chatInfo':{'browser':_0x4d4c27['browserName'],'os':_0x4d4c27['osName'],'referer':_0x4d4c27[_0x71e5('0xc2')],'customerIp':_0x4d4c27[_0x71e5('0xc3')],'customerPort':_0x4d4c27[_0x71e5('0xc4')]?_0x4d4c27[_0x71e5('0xc4')]:_0x71e5('0xbf')},'messages':_(_0x4d4c27[_0x71e5('0x85')])[_0x71e5('0xc5')]()[_0x71e5('0xa2')]({'secret':![]})['map'](function(_0x565e16){if(_0x565e16[_0x71e5('0x71')]){var _0x2b0554=path[_0x71e5('0x78')](_0x418a90,_0x565e16[_0x71e5('0x71')]['basename']);if(fs[_0x71e5('0xc6')](_0x2b0554)){fs[_0x71e5('0xc7')](_0x2b0554)[_0x71e5('0xc8')](fs[_0x71e5('0xc9')](path[_0x71e5('0x78')](_0x2e1514,_0x565e16[_0x71e5('0x71')][_0x71e5('0x7a')])));}}return{'date':moment(_0x565e16[_0x71e5('0x8e')])['format'](_0x71e5('0xc0'))['toString'](),'sender':_0x565e16[_0x71e5('0xba')]==='out'?_0x565e16['User']?_0x565e16[_0x71e5('0x83')][_0x71e5('0x58')]:'System':_0x565e16[_0x71e5('0x65')][_0x71e5('0xca')]+(_0x565e16[_0x71e5('0x65')][_0x71e5('0xb9')]?'\x20'+_0x565e16[_0x71e5('0x65')][_0x71e5('0xb9')]:''),'body':_0x565e16[_0x71e5('0x71')]?_0x565e16['Attachment'][_0x71e5('0x7a')]:_0x565e16['body'],'direction':_0x565e16[_0x71e5('0xba')]===_0x71e5('0x61')?'A':'C','secret':_0x565e16[_0x71e5('0x90')],'read':_0x565e16['read'],'attachment':_0x565e16[_0x71e5('0x71')]};})[_0x71e5('0xcb')]()};return ejs[_0x71e5('0xcc')](path[_0x71e5('0x78')](config[_0x71e5('0x76')],_0x71e5('0xb7'),_0x71e5('0xcd'),_0x71e5('0xce')),{'interaction':_0x86e45e})['then'](function(_0x4242a4){var _0x2840c8=path[_0x71e5('0x78')](_0x2e1514,_0x71e5('0xcf')+_0x4d4c27['id']+'-'+_0x59114c+_0x71e5('0xd0'));var _0x33b1aa={'path':_0x2840c8,'channel':_0x71e5('0xd1'),'interactionId':_0x4d4c27['id']};return pdf['createPdfFromHTML'](_0x4242a4,_0x33b1aa);})['then'](function(){return new Promise(function(_0xdece94,_0x350663){zipdir(_0x2e1514,{'saveTo':_0x22def5},function(_0x561dc9,_0xc59af6){if(_0x561dc9)return _0x350663(_0x561dc9);return _0xdece94(_0xc59af6);});})[_0x71e5('0x18')](function(){return new BPromise(function(_0x1384af,_0x53b25f){rimraf(_0x2e1514,function(_0xe85a5c){if(_0xe85a5c)_0x53b25f(_0xe85a5c);return _0x1384af();});});})['then'](function(){return _0x2d2aef[_0x71e5('0x7b')](_0x22def5,_0x309b42,function(_0x3c583a){if(_0x3c583a){logger[_0x71e5('0x1d')](_0x71e5('0xd2'),_0x3c583a);}else{fs[_0x71e5('0xd3')](_0x22def5);}});});});}else{return _0x2d2aef[_0x71e5('0x24')](0xc8);}})[_0x71e5('0x23')](handleError(_0x2d2aef,null));};
\ No newline at end of file
+var _0x5595=['browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','firstName','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','mustache','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','http','client','request','then','info','request\x20sent','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','destroy','stack','name','send','render','merge','contact','interaction','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','user','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','options','find','create','body','update','describe','createVidaooSession','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','email','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Attachment','findOne','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','ContactId','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','MailServerOut','CloudProvider','SendMail','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','ChatMessage','ids','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','rows','getMyMessages','secret','push','addTags','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','lastName','read','Account','get','mkdirSync','Chat','Owner','closedAt','toString'];(function(_0x2d5a9d,_0x499b8c){var _0x40fd1f=function(_0x3ec2ef){while(--_0x3ec2ef){_0x2d5a9d['push'](_0x2d5a9d['shift']());}};_0x40fd1f(++_0x499b8c);}(_0x5595,0xe4));var _0x5559=function(_0x5c8020,_0x1f3a3a){_0x5c8020=_0x5c8020-0x0;var _0x4c835a=_0x5595[_0x5c8020];return _0x4c835a;};'use strict';var rimraf=require(_0x5559('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5559('0x1'));var util=require('util');var path=require('path');var ejs=require(_0x5559('0x2'));var fs=require('fs');var _=require(_0x5559('0x3'));var Redis=require(_0x5559('0x4'));var interaction=require(_0x5559('0x5'));var qs=require(_0x5559('0x6'));var pdf=require(_0x5559('0x7'));var logger=require(_0x5559('0x8'))(_0x5559('0x9'));var config=require('../../config/environment');var db=require(_0x5559('0xa'))['db'];config[_0x5559('0xb')]=_[_0x5559('0xc')](config[_0x5559('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5559('0xd'))(new Redis(config[_0x5559('0xb')]));require(_0x5559('0xe'))[_0x5559('0xf')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x5559('0x10')]({'port':0x232b});var client9004=jayson[_0x5559('0x11')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2208e4,_0x289a04,_0x284fd7,_0x3f9c73){return new BPromise(function(_0x35e478,_0x548f14){var _0x314ae2=_0x3f9c73||client;return _0x314ae2[_0x5559('0x12')](_0x2208e4,_0x284fd7)[_0x5559('0x13')](function(_0x4276ce){logger[_0x5559('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x289a04,_0x5559('0x15'));logger['debug'](_0x5559('0x16'),_0x289a04,_0x5559('0x15'),JSON[_0x5559('0x17')](_0x4276ce));if(_0x4276ce[_0x5559('0x18')]){if(_0x4276ce[_0x5559('0x18')][_0x5559('0x19')]===0x1f4){logger['error'](_0x5559('0x1a'),_0x289a04,_0x4276ce[_0x5559('0x18')][_0x5559('0x1b')]);return _0x548f14(_0x4276ce['error'][_0x5559('0x1b')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x289a04,_0x4276ce['error'][_0x5559('0x1b')]);return _0x35e478(_0x4276ce[_0x5559('0x18')][_0x5559('0x1b')]);}else{logger[_0x5559('0x14')](_0x5559('0x1a'),_0x289a04,_0x5559('0x15'));_0x35e478(_0x4276ce[_0x5559('0x1c')][_0x5559('0x1b')]);}})[_0x5559('0x1d')](function(_0x3d1075){logger[_0x5559('0x18')](_0x5559('0x1a'),_0x289a04,_0x3d1075);_0x548f14(_0x3d1075);});});}function respondWithStatusCode(_0x389147,_0x4a942a){_0x4a942a=_0x4a942a||0xcc;return function(_0x30d2aa){if(_0x30d2aa){return _0x389147[_0x5559('0x1e')](_0x4a942a);}return _0x389147[_0x5559('0x1f')](_0x4a942a)[_0x5559('0x20')]();};}function respondWithResult(_0x2aa819,_0x1bed36){_0x1bed36=_0x1bed36||0xc8;return function(_0x1426e7){if(_0x1426e7){return _0x2aa819[_0x5559('0x1f')](_0x1bed36)[_0x5559('0x21')](_0x1426e7);}};}function respondWithFilteredResult(_0x21412e,_0x4bf08b){return function(_0x58e391){if(_0x58e391){var _0x4cb2ad=typeof _0x4bf08b[_0x5559('0x22')]===_0x5559('0x23')&&typeof _0x4bf08b[_0x5559('0x24')]===_0x5559('0x23');var _0x146861=_0x58e391[_0x5559('0x25')];var _0x3798e0=_0x4cb2ad?0x0:_0x4bf08b[_0x5559('0x22')];var _0x5e9392=_0x4cb2ad?_0x58e391[_0x5559('0x25')]:_0x4bf08b[_0x5559('0x22')]+_0x4bf08b[_0x5559('0x24')];var _0x25ca5e;if(_0x5e9392>=_0x146861){_0x5e9392=_0x146861;_0x25ca5e=0xc8;}else{_0x25ca5e=0xce;}_0x21412e[_0x5559('0x1f')](_0x25ca5e);return _0x21412e[_0x5559('0x26')](_0x5559('0x27'),_0x3798e0+'-'+_0x5e9392+'/'+_0x146861)['json'](_0x58e391);}return null;};}function saveUpdates(_0x32f113){return function(_0x4e732c){if(_0x4e732c){return _0x4e732c['update'](_0x32f113)['then'](function(_0x2bcc72){return _0x2bcc72;});}return null;};}function removeEntity(_0x3e6a8c){return function(_0x2a9567){if(_0x2a9567){return _0x2a9567[_0x5559('0x28')]()[_0x5559('0x13')](function(){_0x3e6a8c[_0x5559('0x1f')](0xcc)[_0x5559('0x20')]();});}};}function handleEntityNotFound(_0x4fa5f5){return function(_0x4b3631){if(!_0x4b3631){_0x4fa5f5[_0x5559('0x1e')](0x194);}return _0x4b3631;};}function handleError(_0x2ca821,_0x1fcf7a){_0x1fcf7a=_0x1fcf7a||0x1f4;return function(_0x425419){logger[_0x5559('0x18')](_0x425419[_0x5559('0x29')]);if(_0x425419[_0x5559('0x2a')]){delete _0x425419[_0x5559('0x2a')];}_0x2ca821['status'](_0x1fcf7a)[_0x5559('0x2b')](_0x425419);};}function getMustacheRender(_0x22b96d,_0x2b9301){return Mustache[_0x5559('0x2c')](_0x22b96d,_[_0x5559('0x2d')](_0x2b9301['body'],{'contact':_0x2b9301[_0x5559('0x2e')],'message':_0x2b9301[_0x5559('0x1b')],'agent':_0x2b9301['agent'],'interaction':_0x2b9301[_0x5559('0x2f')],'account':_0x2b9301['account']}))||'';}exports[_0x5559('0x30')]=function(_0x4e27a7,_0x3d25df){var _0x3d2f59={};var _0x1cc3ad=_[_0x5559('0x31')](db[_0x5559('0x32')][_0x5559('0x33')],function(_0x9c7a49){return{'name':_0x9c7a49[_0x5559('0x34')],'type':_0x9c7a49[_0x5559('0x35')][_0x5559('0x36')]};});_0x3d2f59=qs[_0x5559('0x37')](_0x1cc3ad,_0x4e27a7);return interaction[_0x5559('0x38')](_0x5559('0x39'),_0x4e27a7['query'],_0x4e27a7[_0x5559('0x3a')],_0x3d2f59,_0x1cc3ad)['then'](respondWithFilteredResult(_0x3d25df,_0x3d2f59))[_0x5559('0x1d')](handleError(_0x3d25df,null));};exports[_0x5559('0x3b')]=function(_0x5bfe2e,_0x5a7846){var _0x3301e8={'raw':![],'where':{'id':_0x5bfe2e[_0x5559('0x3c')]['id']}},_0x42a221={};_0x42a221[_0x5559('0x3d')]=_[_0x5559('0x3e')](db[_0x5559('0x32')][_0x5559('0x33')]);_0x42a221[_0x5559('0x3f')]=_[_0x5559('0x3e')](_0x5bfe2e['query']);_0x42a221[_0x5559('0x40')]=_[_0x5559('0x41')](_0x42a221[_0x5559('0x3d')],_0x42a221[_0x5559('0x3f')]);_0x3301e8[_0x5559('0x42')]=_['intersection'](_0x42a221['model'],qs[_0x5559('0x43')](_0x5bfe2e[_0x5559('0x3f')]['fields']));_0x3301e8[_0x5559('0x42')]=_0x3301e8[_0x5559('0x42')][_0x5559('0x44')]?_0x3301e8[_0x5559('0x42')]:_0x42a221[_0x5559('0x3d')];if(_0x5bfe2e['query'][_0x5559('0x45')]){_0x3301e8['include']=[{'all':!![]}];}_0x3301e8=_[_0x5559('0x2d')]({},_0x3301e8,_0x5bfe2e[_0x5559('0x46')]);return db[_0x5559('0x32')][_0x5559('0x47')](_0x3301e8)[_0x5559('0x13')](handleEntityNotFound(_0x5a7846,null))['then'](respondWithResult(_0x5a7846,null))['catch'](handleError(_0x5a7846,null));};exports[_0x5559('0x48')]=function(_0x417e3d,_0x280e8a){return db[_0x5559('0x32')]['create'](_0x417e3d[_0x5559('0x49')],{})['then'](respondWithResult(_0x280e8a,0xc9))[_0x5559('0x1d')](handleError(_0x280e8a,null));};exports[_0x5559('0x4a')]=function(_0x2d917a,_0x2c9d0){if(_0x2d917a[_0x5559('0x49')]['id']){delete _0x2d917a[_0x5559('0x49')]['id'];}return db[_0x5559('0x32')][_0x5559('0x47')]({'where':{'id':_0x2d917a[_0x5559('0x3c')]['id']}})[_0x5559('0x13')](handleEntityNotFound(_0x2c9d0,null))[_0x5559('0x13')](saveUpdates(_0x2d917a['body'],null))['then'](respondWithResult(_0x2c9d0,null))[_0x5559('0x1d')](handleError(_0x2c9d0,null));};exports[_0x5559('0x28')]=function(_0x1ed677,_0xb7b56b){return db[_0x5559('0x32')][_0x5559('0x47')]({'where':{'id':_0x1ed677[_0x5559('0x3c')]['id']}})['then'](handleEntityNotFound(_0xb7b56b,null))[_0x5559('0x13')](removeEntity(_0xb7b56b,null))[_0x5559('0x1d')](handleError(_0xb7b56b,null));};exports[_0x5559('0x4b')]=function(_0xf0d8f9,_0x184ba1){return db[_0x5559('0x32')][_0x5559('0x4b')]()[_0x5559('0x13')](respondWithResult(_0x184ba1,null))[_0x5559('0x1d')](handleError(_0x184ba1,null));};exports[_0x5559('0x4c')]=function(_0x216bb6,_0x2d7aeb){var _0x469bc3=_0x216bb6[_0x5559('0x3c')]['id'];var _0x6e8db0;var _0x4d08e6;var _0x5c9bfe;return db[_0x5559('0x32')]['findOne']({'where':{'id':_0x469bc3}})['then'](function(_0x1d1b17){_0x6e8db0=_0x1d1b17;return db[_0x5559('0x4d')]['findOne']({'where':{'id':_0x1d1b17[_0x5559('0x4e')]},'attributes':['id','vidaooApiKey',_0x5559('0x4f'),_0x5559('0x50'),_0x5559('0x51'),_0x5559('0x52')],'raw':!![]});})['then'](function(_0x2b5207){if(_0x2b5207&&_0x2b5207['vidaooApiKey']&&_0x2b5207[_0x5559('0x4f')]){_0x4d08e6=_0x2b5207;var _0x5de5e3={'interaction':{'id':_0x469bc3},'agent':{'id':_0x216bb6[_0x5559('0x3a')]['id'],'name':_0x216bb6[_0x5559('0x3a')][_0x5559('0x2a')],'fullname':_0x216bb6[_0x5559('0x3a')]['fullname'],'email':_0x216bb6['user']['email']},'contact':_0x216bb6[_0x5559('0x49')]['contact'],'account':_0x216bb6['body'][_0x5559('0x53')]};var _0x138302={'rejectUnauthorized':![],'method':_0x5559('0x54'),'url':_0x5559('0x55'),'headers':{'X-APIKEY':_0x2b5207[_0x5559('0x56')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x216bb6[_0x5559('0x3a')][_0x5559('0x57')]],'buttons':null,'topic':_0x4d08e6[_0x5559('0x50')],'note':_[_0x5559('0x58')](_0x4d08e6[_0x5559('0x51')])?null:getMustacheRender(_0x4d08e6[_0x5559('0x51')],_0x5de5e3),'metadata':null},'redirect':_0x5559('0x59'),'json':!![]};try{if(!_[_0x5559('0x58')](_0x4d08e6[_0x5559('0x52')])){var _0x2d8f88=getMustacheRender(_0x4d08e6[_0x5559('0x52')],_0x5de5e3);var _0x2143f6=JSON[_0x5559('0x5a')](_0x2d8f88);_0x138302[_0x5559('0x49')][_0x5559('0x5b')]=_0x2143f6;}}catch(_0x361080){throw new db[(_0x5559('0x5c'))][(_0x5559('0x5d'))](_0x5559('0x5e'));}return rp(_0x138302);}else{throw new db['Sequelize'][(_0x5559('0x5d'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x5559('0x13')](function(_0x4b7995){_0x5c9bfe=_0x4b7995;if(_0x5c9bfe['id']){var _0x1c0b96={'body':_0x5c9bfe['join_url'],'ChatWebsiteId':_0x4d08e6['id'],'ChatInteractionId':_0x6e8db0['id'],'direction':_0x5559('0x5f'),'UserId':_0x216bb6[_0x5559('0x3a')]['id']};return db['ChatMessage']['create'](_0x1c0b96,{});}else{throw new db[(_0x5559('0x5c'))][(_0x5559('0x5d'))](_0x5559('0x60'));}})[_0x5559('0x13')](function(){return _0x6e8db0[_0x5559('0x61')]({'vidaooSessionId':_0x5c9bfe['id']});})[_0x5559('0x13')](respondWithResult(_0x2d7aeb,null))[_0x5559('0x1d')](handleError(_0x2d7aeb,null));};exports[_0x5559('0x62')]=function(_0x2a603b,_0x2057b7){if(_0x2a603b['body']['id']){delete _0x2a603b[_0x5559('0x49')]['id'];}return db[_0x5559('0x32')][_0x5559('0x47')]({'where':{'id':_0x2a603b[_0x5559('0x3c')]['id']},'include':[{'model':db[_0x5559('0x63')],'as':_0x5559('0x64')}]})[_0x5559('0x13')](handleEntityNotFound(_0x2057b7,null))[_0x5559('0x13')](saveUpdates(_0x2a603b[_0x5559('0x49')],null))[_0x5559('0x13')](respondWithResult(_0x2057b7,null))[_0x5559('0x1d')](handleError(_0x2057b7,null));};exports[_0x5559('0x65')]=function(_0x3d2f11,_0x2d29f7){if(_0x3d2f11[_0x5559('0x49')]['id']){delete _0x3d2f11[_0x5559('0x49')]['id'];}return db[_0x5559('0x32')][_0x5559('0x47')]({'where':{'id':_0x3d2f11[_0x5559('0x3c')]['id']}})[_0x5559('0x13')](function(_0x142134){if(!_0x142134){logger[_0x5559('0x18')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0x5559('0x66'));_0x2d29f7[_0x5559('0x1e')](0x194);}else{if(_0x142134[_0x5559('0x67')]){throw new db[(_0x5559('0x5c'))][(_0x5559('0x5d'))](_0x5559('0x68'));}}return _0x142134;})[_0x5559('0x13')](function(_0x2675cf){if(_0x2675cf){return _0x2675cf[_0x5559('0x4a')]({'closed':_0x3d2f11[_0x5559('0x49')][_0x5559('0x69')],'disposition':_0x3d2f11[_0x5559('0x49')][_0x5559('0x6a')]})[_0x5559('0x13')](function(_0x18c649){return _0x18c649;});}})[_0x5559('0x13')](function(){return respondWithRpcPromise(_0x5559('0x6b'),'abandon',_0x3d2f11[_0x5559('0x49')],client9004);})[_0x5559('0x13')](respondWithResult(_0x2d29f7,null))[_0x5559('0x1d')](handleError(_0x2d29f7,null));};exports[_0x5559('0x6c')]=function(_0x18717d,_0x3665ce){_0x18717d[_0x5559('0x49')][_0x5559('0x2a')]=_0x18717d[_0x5559('0x6d')]['originalname'];_0x18717d[_0x5559('0x49')][_0x5559('0x6e')]=_0x18717d[_0x5559('0x6d')][_0x5559('0x6f')];_0x18717d[_0x5559('0x49')][_0x5559('0x35')]=_0x18717d[_0x5559('0x6d')][_0x5559('0x70')];return db[_0x5559('0x71')]['create'](_0x18717d[_0x5559('0x49')])[_0x5559('0x13')](respondWithResult(_0x3665ce,0xc9))[_0x5559('0x1d')](handleError(_0x3665ce,null));};exports['attachmentDownload']=function(_0x4164a5,_0x38e299){return db['ChatInteraction'][_0x5559('0x72')]({'where':{'id':_0x4164a5['params']['id']},'raw':!![]})[_0x5559('0x13')](handleEntityNotFound(_0x38e299,null))[_0x5559('0x13')](function(_0x5663fa){if(_0x5663fa){if(_0x5663fa[_0x5559('0x69')]){return _0x38e299[_0x5559('0x1f')](0x193)[_0x5559('0x21')]({'status':0x193,'message':_0x5559('0x73')});}return db[_0x5559('0x71')][_0x5559('0x72')]({'where':{'id':_0x4164a5['query']['attachId']},'raw':!![]})[_0x5559('0x13')](handleEntityNotFound(_0x38e299,null));}})[_0x5559('0x13')](function(_0x56f4b7){if(_0x56f4b7){var _0x1cd61d=_0x56f4b7[_0x5559('0x74')]!==null;var _0x240a97=path[_0x5559('0x75')](config[_0x5559('0x76')],_0x5559('0x77'));if(_0x1cd61d){_0x240a97=path[_0x5559('0x75')](_0x240a97,_0x5559('0x78'));}var _0x220fb9=path['join'](_0x240a97,_0x56f4b7[_0x5559('0x6e')]);return _0x38e299[_0x5559('0x79')](_0x220fb9);}})[_0x5559('0x1d')](handleError(_0x38e299,null));};exports[_0x5559('0x7a')]=function(_0x225576,_0x55d912){var _0x26a487=null;var _0x4ce132=null;var _0x563ec1=null;if(_0x225576[_0x5559('0x49')]['id']){delete _0x225576[_0x5559('0x49')]['id'];}if(_0x225576[_0x5559('0x49')]['mailTranscript']){_0x563ec1=path[_0x5559('0x75')](config[_0x5559('0x76')],_0x5559('0x7b'),util[_0x5559('0x7c')](_0x5559('0x7d'),Date[_0x5559('0x7e')]()));_0x225576['body']['pathTranscript']=_0x563ec1;}return db['ChatInteraction'][_0x5559('0x47')]({'where':{'id':_0x225576[_0x5559('0x3c')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x5559('0x7f'),'include':[{'model':db[_0x5559('0x80')],'as':_0x5559('0x80')}]}]})[_0x5559('0x13')](handleEntityNotFound(_0x55d912,null))[_0x5559('0x13')](saveUpdates(_0x225576[_0x5559('0x49')],null))[_0x5559('0x13')](function(_0x31f4e3){if(_0x31f4e3){_0x26a487=_0x31f4e3;return db['ChatWebsite'][_0x5559('0x47')]({'where':{'id':_0x26a487[_0x5559('0x4e')]}});}})[_0x5559('0x13')](function(_0x167280){if(_0x167280){_0x4ce132=_0x167280;return db[_0x5559('0x63')][_0x5559('0x47')]({'where':{'id':_0x26a487[_0x5559('0x81')]}});}})[_0x5559('0x13')](function(_0x3718cd){if(_0x3718cd){if(_0x563ec1){var _0x2b2452=null;for(var _0x1dab61=0x1;_0x1dab61<_0x26a487[_0x5559('0x7f')]['length'];++_0x1dab61){_0x2b2452=_0x26a487[_0x5559('0x7f')][_0x1dab61];var _0x42b29c=_0x2b2452[_0x5559('0x67')]?util[_0x5559('0x7c')](_0x5559('0x82'),_0x4ce132[_0x5559('0x83')],_0x2b2452[_0x5559('0x67')]):_0x5559('0x84');var _0xed2e2c=_0x225576[_0x5559('0x49')]['customer']||util[_0x5559('0x7c')](_0x5559('0x82'),_0x5559('0x85'),_0x2b2452[_0x5559('0x81')]);switch(_0x4ce132[_0x5559('0x86')]){case _0x5559('0x87'):_0x42b29c=_0x2b2452['UserId']?util[_0x5559('0x7c')]('%s%d',_0x4ce132[_0x5559('0x83')],_0x2b2452[_0x5559('0x67')]):_0x5559('0x84');break;case _0x5559('0x88'):_0x42b29c=_0x2b2452[_0x5559('0x67')]?_0x2b2452[_0x5559('0x80')][_0x5559('0x89')]||_0x2b2452['User'][_0x5559('0x8a')]:'System';break;case'agent_fullname':_0x42b29c=_0x2b2452[_0x5559('0x67')]?_0x2b2452['User'][_0x5559('0x8a')]:'System';break;default:_0x42b29c=_0x2b2452[_0x5559('0x67')]?util[_0x5559('0x7c')](_0x5559('0x82'),_0x4ce132[_0x5559('0x83')],_0x2b2452[_0x5559('0x67')]):_0x5559('0x84');}var _0x4909d6=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x2b2452[_0x5559('0x8b')])[_0x5559('0x7c')](_0x5559('0x8c')),_0x2b2452[_0x5559('0x8d')]==='in'?_0xed2e2c:_0x42b29c,_0x2b2452['body']);if(!_0x2b2452['secret']){fs['appendFileSync'](_0x563ec1,_0x4909d6);}}return db[_0x5559('0x8e')][_0x5559('0x72')]({'where':{'service':!![]},'include':[{'model':db[_0x5559('0x8f')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x5559('0x90')],'as':_0x5559('0x90'),'raw':!![]}]}]});}}})[_0x5559('0x13')](function(_0x5c59f7){if(!_0x5c59f7||!_0x5c59f7['Smtp']||!_0x225576[_0x5559('0x49')])return _0x26a487;var _0x655f0b=_0x5c59f7['getSmtpOptions']();return respondWithRpcPromise(_0x5559('0x91'),_0x5559('0x92'),{'account':_0x655f0b,'message':{'from':util[_0x5559('0x7c')](_0x5559('0x93'),_0x5c59f7[_0x5559('0x2a')],_0x5c59f7[_0x5559('0x57')]||_0x5c59f7['Smtp'][_0x5559('0x3a')]),'to':_0x225576[_0x5559('0x49')]['mailTranscript'],'subject':_0x5559('0x94'),'text':util['format'](_0x5559('0x95'),_0x225576[_0x5559('0x49')]['mailTranscript']),'attachments':[{'path':_0x563ec1}]}})[_0x5559('0x13')](function(){return _0x26a487;})['catch'](function(_0x2aa9e3){logger['error'](_0x2aa9e3);});})['then'](respondWithStatusCode(_0x55d912,0xc8))[_0x5559('0x1d')](handleError(_0x55d912,null));};exports[_0x5559('0x96')]=function(_0x5c6c38,_0x3aee72){return db[_0x5559('0x97')][_0x5559('0x47')]({'where':{'id':_0x5c6c38[_0x5559('0x3c')]['id']}})[_0x5559('0x13')](handleEntityNotFound(_0x3aee72,null))[_0x5559('0x13')](function(_0x335125){if(_0x335125){return _0x335125[_0x5559('0x96')](_0x5c6c38[_0x5559('0x49')][_0x5559('0x98')],_['omit'](_0x5c6c38[_0x5559('0x49')],['ids','id'])||{});}})[_0x5559('0x13')](respondWithResult(_0x3aee72,null))['catch'](handleError(_0x3aee72,null));};exports[_0x5559('0x99')]=function(_0xeff41b,_0x18cd36){var _0x470c36={'raw':![],'where':{}};var _0x5a28c7={};var _0x1e23e0={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5559('0x72')]({'where':{'id':_0xeff41b[_0x5559('0x3c')]['id']}})[_0x5559('0x13')](handleEntityNotFound(_0x18cd36,null))[_0x5559('0x13')](function(_0x5250b5){if(_0x5250b5){_0x5a28c7[_0x5559('0x3d')]=_[_0x5559('0x3e')](db[_0x5559('0x97')][_0x5559('0x33')]);_0x5a28c7[_0x5559('0x3f')]=_[_0x5559('0x3e')](_0xeff41b['query']);_0x5a28c7[_0x5559('0x40')]=_['intersection'](_0x5a28c7['model'],_0x5a28c7[_0x5559('0x3f')]);_0x470c36[_0x5559('0x42')]=_[_0x5559('0x41')](_0x5a28c7[_0x5559('0x3d')],qs[_0x5559('0x43')](_0xeff41b[_0x5559('0x3f')][_0x5559('0x43')]));_0x470c36[_0x5559('0x42')]=_0x470c36['attributes'][_0x5559('0x44')]?_0x470c36[_0x5559('0x42')]:_0x5a28c7['model'];if(!_0xeff41b[_0x5559('0x3f')][_0x5559('0x9a')](_0x5559('0x9b'))){_0x470c36[_0x5559('0x24')]=qs[_0x5559('0x24')](_0xeff41b['query']['limit']);_0x470c36[_0x5559('0x22')]=qs[_0x5559('0x22')](_0xeff41b[_0x5559('0x3f')][_0x5559('0x22')]);}_0x470c36[_0x5559('0x9c')]=qs[_0x5559('0x9d')](_0xeff41b[_0x5559('0x3f')]['sort']);_0x470c36[_0x5559('0x9e')]=qs[_0x5559('0x40')](_[_0x5559('0x9f')](_0xeff41b[_0x5559('0x3f')],_0x5a28c7[_0x5559('0x40')]));_0x470c36[_0x5559('0x9e')][_0x5559('0xa0')]=_0x5250b5['id'];if(_0xeff41b[_0x5559('0x3f')][_0x5559('0xa1')]){_0x470c36['where']=_[_0x5559('0x2d')](_0x470c36[_0x5559('0x9e')],{'$or':_[_0x5559('0x31')](_0x470c36[_0x5559('0x42')],function(_0x203407){var _0x2933f2={};_0x2933f2[_0x203407]={'$like':'%'+_0xeff41b[_0x5559('0x3f')]['filter']+'%'};return _0x2933f2;})});}if(_0xeff41b['query'][_0x5559('0xa2')]){var _0x296887=_0xeff41b['query']['$gte'][_0x5559('0xa3')](',');var _0xecd74a={};_0xecd74a[_0x296887[0x0]]={'$gte':moment(_0x296887[0x1])[_0x5559('0x7c')](_0x5559('0xa4'))};_0x470c36[_0x5559('0x9e')]=_[_0x5559('0x2d')](_0x470c36['where'],_0xecd74a);}_0x470c36=_[_0x5559('0x2d')]({},_0x470c36,_0xeff41b[_0x5559('0x46')]);return db['ChatMessage']['count']({'where':_0x470c36[_0x5559('0x9e')]})[_0x5559('0x13')](function(_0x39d217){_0x1e23e0['count']=_0x39d217;if(_0xeff41b['query'][_0x5559('0x45')]){_0x470c36[_0x5559('0xa5')]=[{'all':!![]}];}return db[_0x5559('0x97')][_0x5559('0x38')](_0x470c36);})['then'](function(_0x20f926){_0x1e23e0[_0x5559('0xa6')]=_0x20f926;return _0x1e23e0;});}})[_0x5559('0x13')](respondWithFilteredResult(_0x18cd36,_0x470c36))[_0x5559('0x1d')](handleError(_0x18cd36,null));};exports[_0x5559('0xa7')]=function(_0x376f19,_0x1144c4){var _0x330dfc={'where':{}},_0x5398ab={},_0x1a04ee={'count':0x0,'rows':[]};return db[_0x5559('0x32')][_0x5559('0x72')]({'where':{'id':_0x376f19[_0x5559('0x3c')]['id']}})[_0x5559('0x13')](handleEntityNotFound(_0x1144c4,null))[_0x5559('0x13')](function(_0x5ccb79){if(_0x5ccb79){_0x5398ab['model']=_[_0x5559('0x3e')](db['ChatMessage'][_0x5559('0x33')]);_0x5398ab[_0x5559('0x3f')]=_[_0x5559('0x3e')](_0x376f19[_0x5559('0x3f')]);_0x5398ab[_0x5559('0x40')]=_[_0x5559('0x41')](_0x5398ab['model'],_0x5398ab[_0x5559('0x3f')]);_0x330dfc['attributes']=_[_0x5559('0x41')](_0x5398ab[_0x5559('0x3d')],qs[_0x5559('0x43')](_0x376f19['query'][_0x5559('0x43')]));_0x330dfc[_0x5559('0x42')]=_0x330dfc[_0x5559('0x42')]['length']?_0x330dfc[_0x5559('0x42')]:_0x5398ab['model'];if(!_0x376f19[_0x5559('0x3f')][_0x5559('0x9a')]('nolimit')){_0x330dfc[_0x5559('0x24')]=qs['limit'](_0x376f19[_0x5559('0x3f')][_0x5559('0x24')]);_0x330dfc[_0x5559('0x22')]=qs[_0x5559('0x22')](_0x376f19[_0x5559('0x3f')]['offset']);}_0x330dfc[_0x5559('0x9c')]=qs[_0x5559('0x9d')](_0x376f19['query']['sort']);_0x330dfc[_0x5559('0x9e')]=qs[_0x5559('0x40')](_['pick'](_0x376f19['query'],_0x5398ab[_0x5559('0x40')]));_0x330dfc['where'][_0x5559('0xa0')]=_0x5ccb79['id'];if(_0x376f19[_0x5559('0x3f')]['filter']){_0x330dfc[_0x5559('0x9e')]=_[_0x5559('0x2d')](_0x330dfc[_0x5559('0x9e')],{'$or':_['map'](_0x330dfc[_0x5559('0x42')],function(_0x4c7869){var _0x53e0ef={};_0x53e0ef[_0x4c7869]={'$like':'%'+_0x376f19[_0x5559('0x3f')]['filter']+'%'};return _0x53e0ef;})});}_0x330dfc[_0x5559('0x9e')][_0x5559('0xa8')]=![];if(_0x376f19[_0x5559('0x3f')]['id']){_0x330dfc[_0x5559('0x9e')]['id']={'$gt':_0x376f19[_0x5559('0x3f')]['id']};}_0x330dfc=_[_0x5559('0x2d')]({},_0x330dfc,_0x376f19['options']);return db[_0x5559('0x97')][_0x5559('0x25')]({'where':_0x330dfc[_0x5559('0x9e')]})['then'](function(_0x7fb6e1){_0x1a04ee[_0x5559('0x25')]=_0x7fb6e1;_0x330dfc['include']=[];if(_0x376f19['query']['includeAgent']){_0x330dfc['include'][_0x5559('0xa9')]({'model':db[_0x5559('0x80')],'as':_0x5559('0x80'),'attributes':['id',_0x5559('0x8a'),'alias']});}if(_0x376f19[_0x5559('0x3f')][_0x5559('0x45')]){_0x330dfc[_0x5559('0xa5')]=[{'all':!![]}];}return db[_0x5559('0x97')][_0x5559('0x38')](_0x330dfc);})[_0x5559('0x13')](function(_0x5376f5){_0x1a04ee[_0x5559('0xa6')]=_0x5376f5;return _0x1a04ee;});}})[_0x5559('0x13')](respondWithFilteredResult(_0x1144c4,_0x330dfc))[_0x5559('0x1d')](handleError(_0x1144c4,null));};exports[_0x5559('0xaa')]=function(_0x1f5fe2,_0x38f282){return db[_0x5559('0x32')][_0x5559('0x47')]({'where':{'id':_0x1f5fe2[_0x5559('0x3c')]['id']}})['then'](handleEntityNotFound(_0x38f282,null))[_0x5559('0x13')](function(_0x482d26){if(_0x482d26){return _0x482d26[_0x5559('0xab')](_0x1f5fe2[_0x5559('0x49')]['ids'],_['omit'](_0x1f5fe2['body'],[_0x5559('0x98'),'id'])||{})['spread'](function(){return db[_0x5559('0xac')][_0x5559('0x38')]({'attributes':['id',_0x5559('0x2a'),_0x5559('0xad')],'where':{'id':_0x1f5fe2[_0x5559('0x49')][_0x5559('0x98')]}});})[_0x5559('0x13')](function(_0x56a7fb){socket[_0x5559('0xae')](_0x5559('0xaf'),{'id':Number(_0x1f5fe2[_0x5559('0x3c')]['id']),'tags':_0x56a7fb||[]});return{'id':Number(_0x1f5fe2['params']['id']),'tags':_0x56a7fb||[]};});}})[_0x5559('0x13')](respondWithResult(_0x38f282,null))[_0x5559('0x1d')](handleError(_0x38f282,null));};exports[_0x5559('0xb0')]=function(_0x3b80eb,_0x476305){return db['ChatInteraction'][_0x5559('0x47')]({'where':{'id':_0x3b80eb[_0x5559('0x3c')]['id']}})[_0x5559('0x13')](handleEntityNotFound(_0x476305,null))[_0x5559('0x13')](function(_0x3c4e32){if(_0x3c4e32){return _0x3c4e32[_0x5559('0xb0')](_0x3b80eb[_0x5559('0x3f')][_0x5559('0x98')]);}})['then'](respondWithStatusCode(_0x476305,null))['catch'](handleError(_0x476305,null));};exports[_0x5559('0x79')]=function(_0x4c1e72,_0x22223d){var _0x52850a=moment()[_0x5559('0xb1')]()['toString']();var _0x2285ef=path[_0x5559('0x75')](config[_0x5559('0x76')],_0x5559('0xb2'),'files',_0x5559('0xb3'));var _0x2c3458=path[_0x5559('0x75')](config[_0x5559('0x76')],_0x5559('0xb2'),_0x5559('0xb4'),_0x5559('0xb5'));var _0x87671b=path['join'](_0x2285ef,_0x52850a);var _0x137db3=util[_0x5559('0x7c')](_0x5559('0xb6'),_0x4c1e72['params']['id'],_0x52850a);var _0x3ad6d8=path[_0x5559('0x75')](_0x2285ef,_0x137db3);var _0x26ca43=[];_0x26ca43[_0x5559('0xa9')]({'model':db[_0x5559('0x80')],'as':_0x5559('0x80'),'attributes':['id',_0x5559('0x8a')],'raw':!![]});_0x26ca43[_0x5559('0xa9')]({'model':db[_0x5559('0x63')],'as':'Contact','attributes':['id','firstName',_0x5559('0xb7')],'raw':!![]});if(_0x4c1e72[_0x5559('0x3f')][_0x5559('0xb5')]){_0x26ca43['push']({'model':db[_0x5559('0x71')],'as':_0x5559('0x71'),'raw':!![]});}var _0x11871e=[{'model':db[_0x5559('0x97')],'as':'Messages','attributes':['id',_0x5559('0x49'),_0x5559('0x8b'),_0x5559('0x8d'),'secret',_0x5559('0xb8')],'include':_0x26ca43}];_0x11871e[_0x5559('0xa9')]({'model':db['ChatWebsite'],'as':_0x5559('0xb9'),'attributes':['id',_0x5559('0x2a')]});_0x11871e[_0x5559('0xa9')]({'model':db[_0x5559('0x80')],'as':'Owner','attributes':['id',_0x5559('0x8a')]});return db[_0x5559('0x32')][_0x5559('0x47')]({'where':{'id':_0x4c1e72[_0x5559('0x3c')]['id']},'include':_0x11871e})['then'](handleEntityNotFound(_0x22223d,null))[_0x5559('0x13')](function(_0x38d71f){if(_0x38d71f){var _0x2bc3ca=_0x38d71f[_0x5559('0xba')]({'plain':!![]});fs[_0x5559('0xbb')](_0x87671b);var _0x2f57cd={'channel':_0x5559('0xbc'),'account':_0x2bc3ca[_0x5559('0xb9')]['name'],'agent':_0x2bc3ca['Owner']?_0x2bc3ca[_0x5559('0xbd')][_0x5559('0x8a')]:'N.A.','createdAt':moment(_0x2bc3ca[_0x5559('0x8b')])[_0x5559('0x7c')](_0x5559('0xa4'))['toString'](),'closedAt':_0x2bc3ca[_0x5559('0x69')]?moment(_0x2bc3ca[_0x5559('0xbe')])[_0x5559('0x7c')](_0x5559('0xa4'))[_0x5559('0xbf')]():'','disposition':_0x2bc3ca[_0x5559('0x6a')],'chatInfo':{'browser':_0x2bc3ca[_0x5559('0xc0')],'os':_0x2bc3ca[_0x5559('0xc1')],'referer':_0x2bc3ca[_0x5559('0xc2')],'customerIp':_0x2bc3ca[_0x5559('0xc3')],'customerPort':_0x2bc3ca[_0x5559('0xc4')]?_0x2bc3ca[_0x5559('0xc4')]:_0x5559('0xc5')},'messages':_(_0x2bc3ca['Messages'])[_0x5559('0xc6')]()[_0x5559('0xa1')]({'secret':![]})['map'](function(_0x47cf76){if(_0x47cf76[_0x5559('0x71')]){var _0x4a2b7c=path['join'](_0x2c3458,_0x47cf76['Attachment'][_0x5559('0x6e')]);if(fs[_0x5559('0xc7')](_0x4a2b7c)){fs[_0x5559('0xc8')](_0x4a2b7c)['pipe'](fs['createWriteStream'](path[_0x5559('0x75')](_0x87671b,_0x47cf76[_0x5559('0x71')][_0x5559('0x6e')])));}}return{'date':moment(_0x47cf76[_0x5559('0x8b')])[_0x5559('0x7c')](_0x5559('0xa4'))[_0x5559('0xbf')](),'sender':_0x47cf76[_0x5559('0x8d')]===_0x5559('0x5f')?_0x47cf76[_0x5559('0x80')]?_0x47cf76[_0x5559('0x80')][_0x5559('0x8a')]:_0x5559('0x84'):_0x47cf76['Contact'][_0x5559('0xc9')]+(_0x47cf76['Contact']['lastName']?'\x20'+_0x47cf76[_0x5559('0x64')][_0x5559('0xb7')]:''),'body':_0x47cf76[_0x5559('0x71')]?_0x47cf76[_0x5559('0x71')][_0x5559('0x6e')]:_0x47cf76[_0x5559('0x49')],'direction':_0x47cf76[_0x5559('0x8d')]===_0x5559('0x5f')?'A':'C','secret':_0x47cf76[_0x5559('0xa8')],'read':_0x47cf76[_0x5559('0xb8')],'attachment':_0x47cf76[_0x5559('0x71')]};})[_0x5559('0xca')]()};return ejs['renderFile'](path[_0x5559('0x75')](config[_0x5559('0x76')],_0x5559('0xb2'),_0x5559('0xcb'),_0x5559('0xcc')),{'interaction':_0x2f57cd})['then'](function(_0x4e87d0){var _0x62bc7a=path[_0x5559('0x75')](_0x87671b,_0x5559('0xcd')+_0x2bc3ca['id']+'-'+_0x52850a+_0x5559('0xce'));var _0x2749d0={'path':_0x62bc7a,'channel':_0x5559('0xbc'),'interactionId':_0x2bc3ca['id']};return pdf[_0x5559('0xcf')](_0x4e87d0,_0x2749d0);})[_0x5559('0x13')](function(){return new Promise(function(_0x27dae7,_0x548a9f){zipdir(_0x87671b,{'saveTo':_0x3ad6d8},function(_0x214e80,_0x35ea2c){if(_0x214e80)return _0x548a9f(_0x214e80);return _0x27dae7(_0x35ea2c);});})['then'](function(){return new BPromise(function(_0x141bce,_0x3c417f){rimraf(_0x87671b,function(_0x503bf6){if(_0x503bf6)_0x3c417f(_0x503bf6);return _0x141bce();});});})[_0x5559('0x13')](function(){return _0x22223d[_0x5559('0x79')](_0x3ad6d8,_0x137db3,function(_0x432c95){if(_0x432c95){logger[_0x5559('0x18')](_0x5559('0xd0'),_0x432c95);}else{fs[_0x5559('0xd1')](_0x3ad6d8);}});});});}else{return _0x22223d['sendStatus'](0xc8);}})[_0x5559('0x1d')](handleError(_0x22223d,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index e4d8fed..f5ae0eb 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 _0x7538=['emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x31ab90,_0x145a96){var _0x2d6123=function(_0x2bf73f){while(--_0x2bf73f){_0x31ab90['push'](_0x31ab90['shift']());}};_0x2d6123(++_0x145a96);}(_0x7538,0x103));var _0x8753=function(_0x3bdb09,_0x2f1fb7){_0x3bdb09=_0x3bdb09-0x0;var _0x5f3ec7=_0x7538[_0x3bdb09];return _0x5f3ec7;};'use strict';var EventEmitter=require(_0x8753('0x0'));var ChatInteraction=require(_0x8753('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x8753('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8753('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8753('0x4'),'afterDestroy':_0x8753('0x5')};function emitEvent(_0x2e3fbb){return function(_0x326f55,_0x13465d,_0x36981e){_0x326f55[_0x8753('0x6')]({'attributes':['id'],'raw':!![]})[_0x8753('0x7')](function(_0x28533e){_0x326f55[_0x8753('0x8')](_0x8753('0x9'),_0x28533e[_0x8753('0xa')](function(_0x54eefe){return{'id':_0x54eefe['id']};}));return ChatMessage[_0x8753('0xb')]({'where':{'ChatInteractionId':_0x326f55['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x13d7bc){_0x326f55[_0x8753('0x8')](_0x8753('0xc'),_0x13d7bc['length']);ChatInteractionEvents[_0x8753('0xd')](_0x2e3fbb+':'+_0x326f55['id'],_0x326f55);ChatInteractionEvents[_0x8753('0xd')](_0x2e3fbb,_0x326f55);_0x36981e(null);})[_0x8753('0xe')](_0x36981e(null));};}for(var e in events){if(events[_0x8753('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x8753('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x3562=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x21be1a,_0x598997){var _0x2f2ab5=function(_0x3be34b){while(--_0x3be34b){_0x21be1a['push'](_0x21be1a['shift']());}};_0x2f2ab5(++_0x598997);}(_0x3562,0x19b));var _0x2356=function(_0x59df9c,_0x5668b9){_0x59df9c=_0x59df9c-0x0;var _0x248b8a=_0x3562[_0x59df9c];return _0x248b8a;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x2356('0x0'))['db'][_0x2356('0x1')];var ChatMessage=require(_0x2356('0x0'))['db'][_0x2356('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2356('0x3')](0x0);var events={'afterCreate':_0x2356('0x4'),'afterUpdate':_0x2356('0x5'),'afterDestroy':_0x2356('0x6')};function emitEvent(_0x3b7fcd){return function(_0x43e75a,_0x1bbf6a,_0x57a4b2){_0x43e75a[_0x2356('0x7')]({'attributes':['id'],'raw':!![]})[_0x2356('0x8')](function(_0x4e5da1){_0x43e75a[_0x2356('0x9')](_0x2356('0xa'),_0x4e5da1[_0x2356('0xb')](function(_0x371e38){return{'id':_0x371e38['id']};}));return ChatMessage[_0x2356('0xc')]({'where':{'ChatInteractionId':_0x43e75a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x8ad3cc){_0x43e75a[_0x2356('0x9')](_0x2356('0xd'),_0x8ad3cc[_0x2356('0xe')]);ChatInteractionEvents[_0x2356('0xf')](_0x3b7fcd+':'+_0x43e75a['id'],_0x43e75a);ChatInteractionEvents[_0x2356('0xf')](_0x3b7fcd,_0x43e75a);_0x57a4b2(null);})[_0x2356('0x10')](_0x57a4b2(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x2356('0x11')](e,emitEvent(event));}}module[_0x2356('0x12')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 9e14121..4836f62 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 _0x533e=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closedAt'];(function(_0x56ab8f,_0x320fea){var _0x25442a=function(_0x34e64f){while(--_0x34e64f){_0x56ab8f['push'](_0x56ab8f['shift']());}};_0x25442a(++_0x320fea);}(_0x533e,0x134));var _0xe533=function(_0x443468,_0x5c8c24){_0x443468=_0x443468-0x0;var _0xb723f=_0x533e[_0x443468];return _0xb723f;};'use strict';var _=require(_0xe533('0x0'));var util=require(_0xe533('0x1'));var logger=require(_0xe533('0x2'))(_0xe533('0x3'));var moment=require(_0xe533('0x4'));var BPromise=require(_0xe533('0x5'));var rp=require(_0xe533('0x6'));var fs=require('fs');var path=require(_0xe533('0x7'));var rimraf=require('rimraf');var config=require(_0xe533('0x8'));var attributes=require(_0xe533('0x9'));module[_0xe533('0xa')]=function(_0x4a33d5,_0x53b4bc){return _0x4a33d5[_0xe533('0xb')](_0xe533('0xc'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2721a6,_0x49f3c5,_0xe6bdd5){if(_0x2721a6[_0xe533('0xd')]('closed')){_0x2721a6[_0xe533('0xe')]=moment()[_0xe533('0xf')](_0xe533('0x10'));}_0xe6bdd5(null,_0x2721a6);}},'charset':_0xe533('0x11'),'collate':_0xe533('0x12')});};
\ No newline at end of file
+var _0x78b2=['exports','ChatInteraction','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes'];(function(_0x450689,_0x3b857c){var _0x46ffb0=function(_0x5d3679){while(--_0x5d3679){_0x450689['push'](_0x450689['shift']());}};_0x46ffb0(++_0x3b857c);}(_0x78b2,0x1b9));var _0x278b=function(_0x15dd6b,_0x156756){_0x15dd6b=_0x15dd6b-0x0;var _0x531461=_0x78b2[_0x15dd6b];return _0x531461;};'use strict';var _=require(_0x278b('0x0'));var util=require(_0x278b('0x1'));var logger=require(_0x278b('0x2'))('api');var moment=require(_0x278b('0x3'));var BPromise=require(_0x278b('0x4'));var rp=require(_0x278b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x278b('0x6'));var config=require(_0x278b('0x7'));var attributes=require(_0x278b('0x8'));module[_0x278b('0x9')]=function(_0x18a402,_0x4090cc){return _0x18a402['define'](_0x278b('0xa'),attributes,{'tableName':_0x278b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a06e6,_0x5b1ede,_0x26132d){if(_0x5a06e6['changed'](_0x278b('0xc'))){_0x5a06e6['closedAt']=moment()[_0x278b('0xd')](_0x278b('0xe'));}_0x26132d(null,_0x5a06e6);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index dd3bf06..7bd582e 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 _0xe758=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','AddTagsToChatInteraction','find','addTags','omit','stringify','AddTags','util'];(function(_0x47bc5e,_0x6fc500){var _0x323a59=function(_0x32df89){while(--_0x32df89){_0x47bc5e['push'](_0x47bc5e['shift']());}};_0x323a59(++_0x6fc500);}(_0xe758,0x11e));var _0x8e75=function(_0x1c043c,_0x3e5802){_0x1c043c=_0x1c043c-0x0;var _0x37929d=_0xe758[_0x1c043c];return _0x37929d;};'use strict';var _=require('lodash');var util=require(_0x8e75('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8e75('0x1'));var fs=require('fs');var Redis=require(_0x8e75('0x2'));var db=require(_0x8e75('0x3'))['db'];var utils=require(_0x8e75('0x4'));var logger=require(_0x8e75('0x5'))(_0x8e75('0x6'));var config=require(_0x8e75('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8e75('0x8')][_0x8e75('0x9')]({'port':0x232a});config[_0x8e75('0xa')]=_[_0x8e75('0xb')](config[_0x8e75('0xa')],{'host':_0x8e75('0xc'),'port':0x18eb});var socket=require(_0x8e75('0xd'))(new Redis(config[_0x8e75('0xa')]));require(_0x8e75('0xe'))[_0x8e75('0xf')](socket);function respondWithRpcPromise(_0x2cf30b,_0x2c2ff2,_0x45e116){return new BPromise(function(_0x37baa0,_0x1e1a80){return client[_0x8e75('0x10')](_0x2cf30b,_0x45e116)[_0x8e75('0x11')](function(_0x7f2119){logger[_0x8e75('0x12')](_0x8e75('0x13'),_0x2c2ff2,_0x8e75('0x14'));logger[_0x8e75('0x15')](_0x8e75('0x16'),_0x2c2ff2,_0x8e75('0x14'),JSON['stringify'](_0x7f2119));if(_0x7f2119[_0x8e75('0x17')]){if(_0x7f2119['error'][_0x8e75('0x18')]===0x1f4){logger[_0x8e75('0x17')](_0x8e75('0x13'),_0x2c2ff2,_0x7f2119[_0x8e75('0x17')]['message']);return _0x1e1a80(_0x7f2119[_0x8e75('0x17')][_0x8e75('0x19')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2c2ff2,_0x7f2119['error']['message']);return _0x37baa0(_0x7f2119[_0x8e75('0x17')]['message']);}else{logger[_0x8e75('0x12')](_0x8e75('0x13'),_0x2c2ff2,'request\x20sent');_0x37baa0(_0x7f2119['result'][_0x8e75('0x19')]);}})[_0x8e75('0x1a')](function(_0x4ba0e3){logger[_0x8e75('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x2c2ff2,_0x4ba0e3);_0x1e1a80(_0x4ba0e3);});});}exports[_0x8e75('0x1b')]=function(_0x9601dc){var _0x291e89=this;return new Promise(function(_0x2648bf,_0x3cd161){return db[_0x8e75('0x1c')][_0x8e75('0x1d')](_0x9601dc[_0x8e75('0x1e')],{'raw':_0x9601dc[_0x8e75('0x1f')]?_0x9601dc[_0x8e75('0x1f')][_0x8e75('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9601dc[_0x8e75('0x1f')]?_0x9601dc[_0x8e75('0x1f')][_0x8e75('0x21')]||null:null,'attributes':_0x9601dc[_0x8e75('0x1f')]?_0x9601dc[_0x8e75('0x1f')]['attributes']||null:null,'limit':_0x9601dc['options']?_0x9601dc[_0x8e75('0x1f')][_0x8e75('0x22')]||null:null})['then'](function(_0x57e4b4){logger[_0x8e75('0x12')](_0x8e75('0x1b'),_0x9601dc);logger['debug']('UpdateChatInteraction',_0x9601dc,JSON['stringify'](_0x57e4b4));_0x2648bf(_0x57e4b4);})[_0x8e75('0x1a')](function(_0x1370c2){logger[_0x8e75('0x17')]('UpdateChatInteraction',_0x1370c2[_0x8e75('0x19')],_0x9601dc);_0x3cd161(_0x291e89['error'](0x1f4,_0x1370c2['message']));});});};exports[_0x8e75('0x23')]=function(_0x4fdb1e){return new Promise(function(_0x44d24b,_0x50b8d){return db[_0x8e75('0x1c')][_0x8e75('0x24')]({'where':_0x4fdb1e['options']?_0x4fdb1e[_0x8e75('0x1f')]['where']||null:null})[_0x8e75('0x11')](function(_0x225fa0){if(_0x225fa0){return _0x225fa0[_0x8e75('0x25')](_0x4fdb1e[_0x8e75('0x1e')]['ids'],_[_0x8e75('0x26')](_0x4fdb1e[_0x8e75('0x1e')],['ids','id'])||{});}})['spread'](function(_0x201bbf){logger[_0x8e75('0x12')]('AddTags',_0x4fdb1e);logger[_0x8e75('0x15')]('AddTags',_0x4fdb1e,JSON[_0x8e75('0x27')](_0x201bbf));_0x44d24b(_0x201bbf);})[_0x8e75('0x1a')](function(_0x51d61d){logger[_0x8e75('0x17')](_0x8e75('0x28'),_0x51d61d[_0x8e75('0x19')],_0x4fdb1e);_0x50b8d(_this[_0x8e75('0x17')](0x1f4,_0x51d61d['message']));});});};
\ No newline at end of file
+var _0x70bd=['options','raw','where','limit','debug','stringify','AddTagsToChatInteraction','ChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','ChatInteraction,\x20%s,\x20%s','catch','UpdateChatInteraction','body'];(function(_0x35f342,_0x1f91e5){var _0x4e6b42=function(_0x54194d){while(--_0x54194d){_0x35f342['push'](_0x35f342['shift']());}};_0x4e6b42(++_0x1f91e5);}(_0x70bd,0x191));var _0xd70b=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x70bd[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xd70b('0x0'));var util=require(_0xd70b('0x1'));var moment=require(_0xd70b('0x2'));var BPromise=require('bluebird');var rs=require(_0xd70b('0x3'));var fs=require('fs');var Redis=require(_0xd70b('0x4'));var db=require(_0xd70b('0x5'))['db'];var utils=require(_0xd70b('0x6'));var logger=require('../../config/logger')(_0xd70b('0x7'));var config=require(_0xd70b('0x8'));var jayson=require(_0xd70b('0x9'));var client=jayson[_0xd70b('0xa')][_0xd70b('0xb')]({'port':0x232a});config[_0xd70b('0xc')]=_['defaults'](config[_0xd70b('0xc')],{'host':_0xd70b('0xd'),'port':0x18eb});var socket=require(_0xd70b('0xe'))(new Redis(config[_0xd70b('0xc')]));require(_0xd70b('0xf'))[_0xd70b('0x10')](socket);function respondWithRpcPromise(_0x447e4a,_0x3b4ade,_0x5517bd){return new BPromise(function(_0x816cce,_0x3de935){return client[_0xd70b('0x11')](_0x447e4a,_0x5517bd)[_0xd70b('0x12')](function(_0x3c90ba){logger[_0xd70b('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x3b4ade,_0xd70b('0x14'));logger['debug'](_0xd70b('0x15'),_0x3b4ade,_0xd70b('0x14'),JSON['stringify'](_0x3c90ba));if(_0x3c90ba[_0xd70b('0x16')]){if(_0x3c90ba['error'][_0xd70b('0x17')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3b4ade,_0x3c90ba['error'][_0xd70b('0x18')]);return _0x3de935(_0x3c90ba[_0xd70b('0x16')][_0xd70b('0x18')]);}logger[_0xd70b('0x16')](_0xd70b('0x19'),_0x3b4ade,_0x3c90ba[_0xd70b('0x16')][_0xd70b('0x18')]);return _0x816cce(_0x3c90ba[_0xd70b('0x16')]['message']);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x3b4ade,_0xd70b('0x14'));_0x816cce(_0x3c90ba['result'][_0xd70b('0x18')]);}})[_0xd70b('0x1a')](function(_0x1c73ad){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3b4ade,_0x1c73ad);_0x3de935(_0x1c73ad);});});}exports[_0xd70b('0x1b')]=function(_0x507f47){var _0x67ea74=this;return new Promise(function(_0x5f5f38,_0x31b971){return db['ChatInteraction']['update'](_0x507f47[_0xd70b('0x1c')],{'raw':_0x507f47[_0xd70b('0x1d')]?_0x507f47[_0xd70b('0x1d')][_0xd70b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x507f47[_0xd70b('0x1d')]?_0x507f47[_0xd70b('0x1d')][_0xd70b('0x1f')]||null:null,'attributes':_0x507f47[_0xd70b('0x1d')]?_0x507f47['options']['attributes']||null:null,'limit':_0x507f47['options']?_0x507f47[_0xd70b('0x1d')][_0xd70b('0x20')]||null:null})[_0xd70b('0x12')](function(_0xe04978){logger[_0xd70b('0x13')](_0xd70b('0x1b'),_0x507f47);logger[_0xd70b('0x21')](_0xd70b('0x1b'),_0x507f47,JSON[_0xd70b('0x22')](_0xe04978));_0x5f5f38(_0xe04978);})[_0xd70b('0x1a')](function(_0x42dea6){logger[_0xd70b('0x16')](_0xd70b('0x1b'),_0x42dea6['message'],_0x507f47);_0x31b971(_0x67ea74['error'](0x1f4,_0x42dea6['message']));});});};exports[_0xd70b('0x23')]=function(_0x327012){return new Promise(function(_0x1ffb00,_0xfd4503){return db[_0xd70b('0x24')][_0xd70b('0x25')]({'where':_0x327012[_0xd70b('0x1d')]?_0x327012[_0xd70b('0x1d')][_0xd70b('0x1f')]||null:null})[_0xd70b('0x12')](function(_0x3ed0ef){if(_0x3ed0ef){return _0x3ed0ef[_0xd70b('0x26')](_0x327012[_0xd70b('0x1c')][_0xd70b('0x27')],_[_0xd70b('0x28')](_0x327012[_0xd70b('0x1c')],[_0xd70b('0x27'),'id'])||{});}})[_0xd70b('0x29')](function(_0x2890e2){logger[_0xd70b('0x13')](_0xd70b('0x2a'),_0x327012);logger['debug'](_0xd70b('0x2a'),_0x327012,JSON[_0xd70b('0x22')](_0x2890e2));_0x1ffb00(_0x2890e2);})[_0xd70b('0x1a')](function(_0xb2d753){logger[_0xd70b('0x16')]('AddTags',_0xb2d753[_0xd70b('0x18')],_0x327012);_0xfd4503(_this['error'](0x1f4,_0xb2d753['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index b5ad79b..99d1228 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 _0xec61=['register','length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0xec61,0x66));var _0x1ec6=function(_0x42a78b,_0x36d6b1){_0x42a78b=_0x42a78b-0x0;var _0x2270f6=_0xec61[_0x42a78b];return _0x2270f6;};'use strict';var ChatInteractionEvents=require(_0x1ec6('0x0'));var events=[_0x1ec6('0x1'),_0x1ec6('0x2'),_0x1ec6('0x3')];function createListener(_0xe3ddbf,_0x2e0014){return function(_0x1814a2){_0x2e0014[_0x1ec6('0x4')](_0xe3ddbf,_0x1814a2);};}function removeListener(_0xc6eb03,_0x3bc11a){return function(){ChatInteractionEvents[_0x1ec6('0x5')](_0xc6eb03,_0x3bc11a);};}exports[_0x1ec6('0x6')]=function(_0xd27618){for(var _0x3b470f=0x0,_0x8d7732=events[_0x1ec6('0x7')];_0x3b470f<_0x8d7732;_0x3b470f++){var _0x24043f=events[_0x3b470f];var _0x48457f=createListener(_0x1ec6('0x8')+_0x24043f,_0xd27618);ChatInteractionEvents['on'](_0x24043f,_0x48457f);}};
\ No newline at end of file
+var _0xe784=['length','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0xcec18a,_0x663b4f){var _0x52d111=function(_0x23a999){while(--_0x23a999){_0xcec18a['push'](_0xcec18a['shift']());}};_0x52d111(++_0x663b4f);}(_0xe784,0x1b9));var _0x4e78=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xe784[_0x1e4360];return _0x31e6b4;};'use strict';var ChatInteractionEvents=require(_0x4e78('0x0'));var events=[_0x4e78('0x1'),_0x4e78('0x2'),_0x4e78('0x3')];function createListener(_0x44558a,_0x4d424b){return function(_0x3f2ad7){_0x4d424b[_0x4e78('0x4')](_0x44558a,_0x3f2ad7);};}function removeListener(_0x9e71c7,_0x2faac3){return function(){ChatInteractionEvents[_0x4e78('0x5')](_0x9e71c7,_0x2faac3);};}exports[_0x4e78('0x6')]=function(_0x5901b2){for(var _0x312472=0x0,_0x5dcadd=events[_0x4e78('0x7')];_0x312472<_0x5dcadd;_0x312472++){var _0xda6372=events[_0x312472];var _0x4aec57=createListener('chatInteraction:'+_0xda6372,_0x5901b2);ChatInteractionEvents['on'](_0xda6372,_0x4aec57);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index dd0f9d1..d4b7812 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 _0xf939=['../../config/environment','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','single','file','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','/:id','chatinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf939,0x164));var _0x9f93=function(_0x511284,_0x37603d){_0x511284=_0x511284-0x0;var _0x5126cc=_0xf939[_0x511284];return _0x5126cc;};'use strict';var multer=require(_0x9f93('0x0'));var util=require(_0x9f93('0x1'));var path=require('path');var timeout=require(_0x9f93('0x2'));var express=require(_0x9f93('0x3'));var router=express[_0x9f93('0x4')]();var fs_extra=require(_0x9f93('0x5'));var auth=require(_0x9f93('0x6'));var interaction=require(_0x9f93('0x7'));var config=require(_0x9f93('0x8'));var controller=require('./chatInteraction.controller');router[_0x9f93('0x9')]('/',auth[_0x9f93('0xa')](),controller[_0x9f93('0xb')]);router[_0x9f93('0x9')](_0x9f93('0xc'),auth['isAuthenticated'](),controller[_0x9f93('0xd')]);router['get']('/:id',auth[_0x9f93('0xe')](),controller[_0x9f93('0xf')]);router[_0x9f93('0x9')](_0x9f93('0x10'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0x9f93('0x9')](_0x9f93('0x11'),auth[_0x9f93('0xa')](),controller[_0x9f93('0x12')]);router['get'](_0x9f93('0x13'),auth[_0x9f93('0xe')](),controller[_0x9f93('0x14')]);router[_0x9f93('0x9')](_0x9f93('0x15'),auth[_0x9f93('0xa')](),controller['download']);router['post']('/',auth[_0x9f93('0xa')](),controller['create']);router[_0x9f93('0x16')](_0x9f93('0x17'),auth[_0x9f93('0xa')](),controller[_0x9f93('0x18')]);var upload=multer({'storage':multer[_0x9f93('0x19')]({'destination':function(_0x4acd13,_0x506db6,_0x3e6fa1){_0x3e6fa1(null,path[_0x9f93('0x1a')](config[_0x9f93('0x1b')],_0x9f93('0x1c')));},'filename':function(_0x3e1858,_0x1a5cdf,_0x5c8b70){_0x5c8b70(null,util[_0x9f93('0x1d')]('%s-%s',Date[_0x9f93('0x1e')](),_0x1a5cdf[_0x9f93('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x9f93('0x20')](_0x9f93('0x21')),controller['attachmentUpload']);router[_0x9f93('0x16')](_0x9f93('0x11'),auth[_0x9f93('0xe')](),controller['addMessage']);router[_0x9f93('0x16')]('/:id/tags',auth[_0x9f93('0xa')](),interaction[_0x9f93('0x22')](_0x9f93('0x23'),_0x9f93('0x24')),controller[_0x9f93('0x25')]);router[_0x9f93('0x26')]('/:id',auth[_0x9f93('0xa')](),interaction[_0x9f93('0x22')](_0x9f93('0x23'),_0x9f93('0x27')),controller[_0x9f93('0x28')]);router[_0x9f93('0x26')](_0x9f93('0x29'),controller[_0x9f93('0x2a')]);router['put']('/:id/abandon',auth[_0x9f93('0xe')](),controller[_0x9f93('0x2b')]);router[_0x9f93('0x26')](_0x9f93('0x2c'),controller[_0x9f93('0x2d')]);router[_0x9f93('0x2e')](_0x9f93('0x2f'),auth[_0x9f93('0xa')](),interaction[_0x9f93('0x22')](_0x9f93('0x23'),_0x9f93('0x30')),controller[_0x9f93('0x31')]);router[_0x9f93('0x2e')]('/:id/tags',auth[_0x9f93('0xa')](),controller[_0x9f93('0x32')]);module[_0x9f93('0x33')]=router;
\ No newline at end of file
+var _0x9aca=['single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','/:id/custom_update','abandon','close','chatinteraction:destroy','destroy','delete','removeTags','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','root','%s-%s','originalname','replace','/:id/attachment_upload'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9aca,0x118));var _0xa9ac=function(_0x475ac5,_0x30737c){_0x475ac5=_0x475ac5-0x0;var _0x1e5e19=_0x9aca[_0x475ac5];return _0x1e5e19;};'use strict';var multer=require('multer');var util=require(_0xa9ac('0x0'));var path=require('path');var timeout=require(_0xa9ac('0x1'));var express=require('express');var router=express[_0xa9ac('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa9ac('0x3'));var interaction=require(_0xa9ac('0x4'));var config=require('../../config/environment');var controller=require(_0xa9ac('0x5'));router['get']('/',auth[_0xa9ac('0x6')](),controller[_0xa9ac('0x7')]);router['get'](_0xa9ac('0x8'),auth['isAuthenticated'](),controller[_0xa9ac('0x9')]);router[_0xa9ac('0xa')](_0xa9ac('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xa9ac('0xc')]);router[_0xa9ac('0xa')](_0xa9ac('0xd'),auth[_0xa9ac('0xe')](),controller[_0xa9ac('0xf')]);router[_0xa9ac('0xa')](_0xa9ac('0x10'),auth['isAuthenticated'](),controller[_0xa9ac('0x11')]);router[_0xa9ac('0xa')](_0xa9ac('0x12'),auth[_0xa9ac('0xe')](),controller[_0xa9ac('0x13')]);router[_0xa9ac('0xa')](_0xa9ac('0x14'),auth[_0xa9ac('0x6')](),controller[_0xa9ac('0x15')]);router['post']('/',auth[_0xa9ac('0x6')](),controller[_0xa9ac('0x16')]);router[_0xa9ac('0x17')](_0xa9ac('0x18'),auth[_0xa9ac('0x6')](),controller[_0xa9ac('0x19')]);var upload=multer({'storage':multer[_0xa9ac('0x1a')]({'destination':function(_0x5aa2b2,_0x380e34,_0x431efa){_0x431efa(null,path['join'](config[_0xa9ac('0x1b')],'server/files/attachments/'));},'filename':function(_0x193d94,_0x1e2263,_0xd45629){_0xd45629(null,util['format'](_0xa9ac('0x1c'),Date['now'](),_0x1e2263[_0xa9ac('0x1d')][_0xa9ac('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xa9ac('0x1f'),upload[_0xa9ac('0x20')](_0xa9ac('0x21')),controller[_0xa9ac('0x22')]);router['post']('/:id/messages',auth[_0xa9ac('0xe')](),controller[_0xa9ac('0x23')]);router['post'](_0xa9ac('0x24'),auth[_0xa9ac('0x6')](),interaction['tracked'](_0xa9ac('0x25'),_0xa9ac('0x26')),controller[_0xa9ac('0x27')]);router[_0xa9ac('0x28')]('/:id',auth['isAuthenticated'](),interaction[_0xa9ac('0x29')](_0xa9ac('0x25'),_0xa9ac('0x2a')),controller[_0xa9ac('0x2b')]);router[_0xa9ac('0x28')](_0xa9ac('0x2c'),controller['customUpdate']);router[_0xa9ac('0x28')]('/:id/abandon',auth[_0xa9ac('0xe')](),controller[_0xa9ac('0x2d')]);router[_0xa9ac('0x28')]('/:id/close',controller[_0xa9ac('0x2e')]);router['delete']('/:id',auth[_0xa9ac('0x6')](),interaction[_0xa9ac('0x29')](_0xa9ac('0x25'),_0xa9ac('0x2f')),controller[_0xa9ac('0x30')]);router[_0xa9ac('0x31')](_0xa9ac('0x24'),auth[_0xa9ac('0x6')](),controller[_0xa9ac('0x32')]);module[_0xa9ac('0x33')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index b56ad2c..703700a 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 _0x34b6=['medium','BOOLEAN','INTEGER','sequelize','TEXT'];(function(_0x4b9ac1,_0x597aba){var _0x5e116e=function(_0xa5e0d0){while(--_0xa5e0d0){_0x4b9ac1['push'](_0x4b9ac1['shift']());}};_0x5e116e(++_0x597aba);}(_0x34b6,0xda));var _0x634b=function(_0x179e41,_0x3f91fb){_0x179e41=_0x179e41-0x0;var _0x3ba133=_0x34b6[_0x179e41];return _0x3ba133;};'use strict';var Sequelize=require(_0x634b('0x0'));module['exports']={'body':{'type':Sequelize[_0x634b('0x1')](_0x634b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x634b('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x634b('0x4')]}};
\ No newline at end of file
+var _0xd01f=['exports','TEXT','medium','sequelize'];(function(_0x56bd4c,_0x3cd91d){var _0x462287=function(_0x3f982c){while(--_0x3f982c){_0x56bd4c['push'](_0x56bd4c['shift']());}};_0x462287(++_0x3cd91d);}(_0xd01f,0x1cf));var _0xfd01=function(_0x1cb45d,_0x46aa83){_0x1cb45d=_0x1cb45d-0x0;var _0x3ea23c=_0xd01f[_0x1cb45d];return _0x3ea23c;};'use strict';var Sequelize=require(_0xfd01('0x0'));module[_0xfd01('0x1')]={'body':{'type':Sequelize[_0xfd01('0x2')](_0xfd01('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 54cb7c9..9a84261 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 _0xa8cd=['apply','reject','save','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','ChatInternalMessage','includeAll','include','findAll','rows','show','params','keys','options','catch','body','update','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','read','-createdAt','all','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x5b062e,_0x18210e){var _0x1ab2b3=function(_0x290cf5){while(--_0x290cf5){_0x5b062e['push'](_0x5b062e['shift']());}};_0x1ab2b3(++_0x18210e);}(_0xa8cd,0x19c));var _0xda8c=function(_0x2a8860,_0x2da926){_0x2a8860=_0x2a8860-0x0;var _0x2f47a4=_0xa8cd[_0x2a8860];return _0x2f47a4;};'use strict';var emlformat=require(_0xda8c('0x0'));var rimraf=require(_0xda8c('0x1'));var zipdir=require(_0xda8c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xda8c('0x3'));var BPromise=require(_0xda8c('0x4'));var Mustache=require('mustache');var util=require(_0xda8c('0x5'));var path=require(_0xda8c('0x6'));var sox=require(_0xda8c('0x7'));var csv=require(_0xda8c('0x8'));var ejs=require(_0xda8c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda8c('0xa'));var squel=require(_0xda8c('0xb'));var crypto=require(_0xda8c('0xc'));var jsforce=require(_0xda8c('0xd'));var deskjs=require(_0xda8c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xda8c('0xf'));var Papa=require(_0xda8c('0x10'));var Redis=require(_0xda8c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xda8c('0x12'));var as=require(_0xda8c('0x13'));var hardwareService=require(_0xda8c('0x14'));var logger=require(_0xda8c('0x15'))('api');var utils=require(_0xda8c('0x16'));var config=require(_0xda8c('0x17'));var licenseUtil=require(_0xda8c('0x18'));var db=require(_0xda8c('0x19'))['db'];config[_0xda8c('0x1a')]=_['defaults'](config['redis'],{'host':_0xda8c('0x1b'),'port':0x18eb});var socket=require(_0xda8c('0x1c'))(new Redis(config[_0xda8c('0x1a')]));require('./chatInternalMessage.socket')[_0xda8c('0x1d')](socket);function respondWithStatusCode(_0x4c1a85,_0x27bc8f){_0x27bc8f=_0x27bc8f||0xcc;return function(_0x34accc){if(_0x34accc){return _0x4c1a85[_0xda8c('0x1e')](_0x27bc8f);}return _0x4c1a85[_0xda8c('0x1f')](_0x27bc8f)[_0xda8c('0x20')]();};}function respondWithResult(_0x3834a1,_0x51d651){_0x51d651=_0x51d651||0xc8;return function(_0x4392be){if(_0x4392be){return _0x3834a1[_0xda8c('0x1f')](_0x51d651)[_0xda8c('0x21')](_0x4392be);}};}function respondWithFilteredResult(_0x1700a7,_0x48ecac){return function(_0x5565a3){if(_0x5565a3){var _0x222f7c=typeof _0x48ecac[_0xda8c('0x22')]===_0xda8c('0x23')&&typeof _0x48ecac[_0xda8c('0x24')]===_0xda8c('0x23');var _0x1302f3=_0x5565a3[_0xda8c('0x25')];var _0x3e1c41=_0x222f7c?0x0:_0x48ecac[_0xda8c('0x22')];var _0xa46fa7=_0x222f7c?_0x5565a3[_0xda8c('0x25')]:_0x48ecac['offset']+_0x48ecac[_0xda8c('0x24')];var _0xa2b57a;if(_0xa46fa7>=_0x1302f3){_0xa46fa7=_0x1302f3;_0xa2b57a=0xc8;}else{_0xa2b57a=0xce;}_0x1700a7[_0xda8c('0x1f')](_0xa2b57a);return _0x1700a7[_0xda8c('0x26')](_0xda8c('0x27'),_0x3e1c41+'-'+_0xa46fa7+'/'+_0x1302f3)[_0xda8c('0x21')](_0x5565a3);}return null;};}function patchUpdates(_0x565486){return function(_0x39c3c2){try{jsonpatch[_0xda8c('0x28')](_0x39c3c2,_0x565486,!![]);}catch(_0x52c95e){return BPromise[_0xda8c('0x29')](_0x52c95e);}return _0x39c3c2[_0xda8c('0x2a')]();};}function saveUpdates(_0x31328d,_0x34807a){return function(_0x589054){if(_0x589054){return _0x589054['update'](_0x31328d)['then'](function(_0x55b257){return _0x55b257;});}return null;};}function removeEntity(_0x1addd7,_0x27f7d2){return function(_0x49a266){if(_0x49a266){return _0x49a266[_0xda8c('0x2b')]()[_0xda8c('0x2c')](function(){_0x1addd7['status'](0xcc)[_0xda8c('0x20')]();});}};}function handleEntityNotFound(_0x261df3,_0x56cf7c){return function(_0x898970){if(!_0x898970){_0x261df3[_0xda8c('0x1e')](0x194);}return _0x898970;};}function handleError(_0x411aff,_0x30916b){_0x30916b=_0x30916b||0x1f4;return function(_0x103fd3){logger[_0xda8c('0x2d')](_0x103fd3[_0xda8c('0x2e')]);if(_0x103fd3[_0xda8c('0x2f')]){delete _0x103fd3[_0xda8c('0x2f')];}_0x411aff[_0xda8c('0x1f')](_0x30916b)[_0xda8c('0x30')](_0x103fd3);};}exports['index']=function(_0x5f5b7b,_0x2c0a18){var _0x28c737={},_0x434870={},_0x73a538={'count':0x0,'rows':[]};var _0x19ca01=_[_0xda8c('0x31')](db['ChatInternalMessage'][_0xda8c('0x32')],function(_0x56e80c){return{'name':_0x56e80c[_0xda8c('0x33')],'type':_0x56e80c[_0xda8c('0x34')][_0xda8c('0x35')]};});_0x434870[_0xda8c('0x36')]=_['map'](_0x19ca01,'name');_0x434870[_0xda8c('0x37')]=_['keys'](_0x5f5b7b[_0xda8c('0x37')]);_0x434870[_0xda8c('0x38')]=_[_0xda8c('0x39')](_0x434870[_0xda8c('0x36')],_0x434870[_0xda8c('0x37')]);_0x28c737[_0xda8c('0x3a')]=_[_0xda8c('0x39')](_0x434870[_0xda8c('0x36')],qs[_0xda8c('0x3b')](_0x5f5b7b['query'][_0xda8c('0x3b')]));_0x28c737[_0xda8c('0x3a')]=_0x28c737[_0xda8c('0x3a')][_0xda8c('0x3c')]?_0x28c737[_0xda8c('0x3a')]:_0x434870[_0xda8c('0x36')];if(!_0x5f5b7b[_0xda8c('0x37')][_0xda8c('0x3d')](_0xda8c('0x3e'))){_0x28c737[_0xda8c('0x24')]=qs[_0xda8c('0x24')](_0x5f5b7b[_0xda8c('0x37')]['limit']);_0x28c737[_0xda8c('0x22')]=qs[_0xda8c('0x22')](_0x5f5b7b[_0xda8c('0x37')]['offset']);}_0x28c737[_0xda8c('0x3f')]=qs[_0xda8c('0x40')](_0x5f5b7b[_0xda8c('0x37')][_0xda8c('0x40')]);_0x28c737[_0xda8c('0x41')]=qs[_0xda8c('0x38')](_['pick'](_0x5f5b7b[_0xda8c('0x37')],_0x434870['filters']),_0x19ca01);if(_0x5f5b7b[_0xda8c('0x37')][_0xda8c('0x42')]){_0x28c737['where']=_[_0xda8c('0x43')](_0x28c737[_0xda8c('0x41')],{'$or':_[_0xda8c('0x31')](_0x19ca01,function(_0x5db995){if(_0x5db995['type']!=='VIRTUAL'){var _0xdf37a6={};_0xdf37a6[_0x5db995[_0xda8c('0x2f')]]={'$like':'%'+_0x5f5b7b[_0xda8c('0x37')][_0xda8c('0x42')]+'%'};return _0xdf37a6;}})});}_0x28c737=_['merge']({},_0x28c737,_0x5f5b7b['options']);var _0x2d50f6={'where':_0x28c737[_0xda8c('0x41')]};return db[_0xda8c('0x44')][_0xda8c('0x25')](_0x2d50f6)[_0xda8c('0x2c')](function(_0x3ad2f7){_0x73a538[_0xda8c('0x25')]=_0x3ad2f7;if(_0x5f5b7b[_0xda8c('0x37')][_0xda8c('0x45')]){_0x28c737[_0xda8c('0x46')]=[{'all':!![]}];}return db[_0xda8c('0x44')][_0xda8c('0x47')](_0x28c737);})[_0xda8c('0x2c')](function(_0x334cdc){_0x73a538[_0xda8c('0x48')]=_0x334cdc;return _0x73a538;})['then'](respondWithFilteredResult(_0x2c0a18,_0x28c737))['catch'](handleError(_0x2c0a18,null));};exports[_0xda8c('0x49')]=function(_0x2829d9,_0x8a4f2a){var _0x4c8f45={'raw':!![],'where':{'id':_0x2829d9[_0xda8c('0x4a')]['id']}},_0xea6f65={};_0xea6f65[_0xda8c('0x36')]=_[_0xda8c('0x4b')](db[_0xda8c('0x44')][_0xda8c('0x32')]);_0xea6f65[_0xda8c('0x37')]=_[_0xda8c('0x4b')](_0x2829d9['query']);_0xea6f65[_0xda8c('0x38')]=_[_0xda8c('0x39')](_0xea6f65[_0xda8c('0x36')],_0xea6f65['query']);_0x4c8f45[_0xda8c('0x3a')]=_[_0xda8c('0x39')](_0xea6f65['model'],qs['fields'](_0x2829d9[_0xda8c('0x37')][_0xda8c('0x3b')]));_0x4c8f45[_0xda8c('0x3a')]=_0x4c8f45[_0xda8c('0x3a')]['length']?_0x4c8f45[_0xda8c('0x3a')]:_0xea6f65[_0xda8c('0x36')];if(_0x2829d9['query'][_0xda8c('0x45')]){_0x4c8f45[_0xda8c('0x46')]=[{'all':!![]}];}_0x4c8f45=_['merge']({},_0x4c8f45,_0x2829d9[_0xda8c('0x4c')]);return db[_0xda8c('0x44')]['find'](_0x4c8f45)[_0xda8c('0x2c')](handleEntityNotFound(_0x8a4f2a,null))[_0xda8c('0x2c')](respondWithResult(_0x8a4f2a,null))[_0xda8c('0x4d')](handleError(_0x8a4f2a,null));};exports['create']=function(_0x3bda0c,_0x2e6edd){return db[_0xda8c('0x44')]['create'](_0x3bda0c[_0xda8c('0x4e')],{})[_0xda8c('0x2c')](respondWithResult(_0x2e6edd,0xc9))[_0xda8c('0x4d')](handleError(_0x2e6edd,null));};exports[_0xda8c('0x4f')]=function(_0x126c95,_0x1778dc){if(_0x126c95['body']['id']){delete _0x126c95[_0xda8c('0x4e')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x126c95[_0xda8c('0x4a')]['id']}})[_0xda8c('0x2c')](handleEntityNotFound(_0x1778dc,null))[_0xda8c('0x2c')](saveUpdates(_0x126c95[_0xda8c('0x4e')],null))['then'](respondWithResult(_0x1778dc,null))[_0xda8c('0x4d')](handleError(_0x1778dc,null));};exports[_0xda8c('0x2b')]=function(_0x10de26,_0x36cb3a){return db[_0xda8c('0x44')][_0xda8c('0x50')]({'where':{'id':_0x10de26['params']['id']}})[_0xda8c('0x2c')](handleEntityNotFound(_0x36cb3a,null))[_0xda8c('0x2c')](removeEntity(_0x36cb3a,null))[_0xda8c('0x4d')](handleError(_0x36cb3a,null));};exports[_0xda8c('0x51')]=function(_0x567c47,_0x15555c){return db[_0xda8c('0x44')][_0xda8c('0x51')]()[_0xda8c('0x2c')](respondWithResult(_0x15555c,null))[_0xda8c('0x4d')](handleError(_0x15555c,null));};function wrapUser(_0x3c9834){return function(_0x182b38){var _0x57076c=_0x3c9834[_0xda8c('0x52')]({'plain':!![]});_0x57076c[_0xda8c('0x53')]=[];if(_0x182b38){_0x57076c[_0xda8c('0x54')]=_0x182b38[_0xda8c('0x55')];_0x57076c[_0xda8c('0x56')]=_0x182b38;}else{_0x57076c[_0xda8c('0x54')]=moment(0x0)['format'](_0xda8c('0x57'));_0x57076c['lastMessage']={};}return _0x57076c;};}exports[_0xda8c('0x58')]=function(_0x4511cf,_0x3197b3,_0x26d822){var _0x546a9d=[];return db[_0xda8c('0x59')]['findAll']({'where':{'role':[_0xda8c('0x5a'),_0xda8c('0x5b'),_0xda8c('0x5c')]},'attributes':['id',_0xda8c('0x5d'),_0xda8c('0x2f'),_0xda8c('0x5e'),_0xda8c('0x5f'),'internal',_0xda8c('0x60'),_0xda8c('0x61'),_0xda8c('0x62'),_0xda8c('0x63')],'order':qs[_0xda8c('0x40')]('-online'),'include':[{'model':db[_0xda8c('0x64')],'as':'VoiceQueues','attributes':['id',_0xda8c('0x2f'),_0xda8c('0x34')],'through':{'attributes':[]}}]})[_0xda8c('0x2c')](function(_0x5def58){if(_0x5def58){var _0x45e6af=_0x4511cf[_0xda8c('0x5c')][_0xda8c('0x52')]({'plain':!![]});if(!_0x45e6af)throw new Error(_0xda8c('0x65'));if(_0x45e6af[_0xda8c('0x5e')]===_0xda8c('0x5c')){return db[_0xda8c('0x66')]['find']({'where':{'name':_0xda8c('0x67'),'userProfileId':_0x45e6af[_0xda8c('0x68')]},'raw':!![]})[_0xda8c('0x2c')](function(_0x29cb36){if(_0x29cb36){if(_0x29cb36[_0xda8c('0x69')]===0x0){return db[_0xda8c('0x6a')]['findAll']({'where':{'sectionId':_0x29cb36['id']},'raw':!![]})['then'](function(_0x8b9283){var _0x45d42d=[];if(_[_0xda8c('0x6b')](_0x8b9283)){_0x45d42d=_[_0xda8c('0x42')](_0x5def58,function(_0x2f9847){if(_0x2f9847['role']!==_0xda8c('0x5a')){return _0x2f9847;}});return _0x45d42d;}else{for(var _0x55eb5b=0x0;_0x55eb5b<_0x5def58[_0xda8c('0x3c')];_0x55eb5b++){var _0x234ba2=_0x5def58[_0x55eb5b];if(_0x234ba2['role']===_0xda8c('0x5a')){var _0x1e4a2a=_['find'](_0x8b9283,function(_0xfcb99c){return _0xfcb99c['resourceId']===_0x234ba2['id'];});if(_0x1e4a2a)_0x45d42d[_0xda8c('0x6c')](_0x234ba2);}else{_0x45d42d[_0xda8c('0x6c')](_0x234ba2);}}return _0x45d42d;}});}else{return _0x5def58;}}else{var _0x192a8=_[_0xda8c('0x42')](_0x5def58,function(_0x301f4e){if(_0x301f4e[_0xda8c('0x5e')]!==_0xda8c('0x5a')){return _0x301f4e;}});return _0x192a8;}});}else{return _0x5def58;}}})[_0xda8c('0x2c')](function(_0x3c84fa){var _0x7ec189=[];if(_0x3c84fa){_0x546a9d=_0x3c84fa;for(var _0x4222f0=0x0;_0x4222f0<_0x3c84fa['length'];_0x4222f0+=0x1){_0x546a9d[_0x4222f0][_0xda8c('0x53')]=[];_0x7ec189[_0xda8c('0x6c')](db[_0xda8c('0x44')][_0xda8c('0x50')]({'where':{'FromId':[_0x4511cf['user']['id'],_0x3c84fa[_0x4222f0]['id']],'ToId':[_0x4511cf[_0xda8c('0x5c')]['id'],_0x3c84fa[_0x4222f0]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xda8c('0x6d'),'ToId',_0xda8c('0x6e'),_0xda8c('0x4e')],'order':qs[_0xda8c('0x40')](_0xda8c('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xda8c('0x2c')](wrapUser(_0x3c84fa[_0x4222f0])));}return BPromise[_0xda8c('0x70')](_0x7ec189);}return[];})[_0xda8c('0x2c')](function(_0x2cb7a2){return{'rows':_0x2cb7a2,'count':_0x2cb7a2[_0xda8c('0x3c')]};})['then'](respondWithResult(_0x3197b3,null))[_0xda8c('0x4d')](handleError(_0x3197b3,null));};
\ No newline at end of file
+var _0xbc68=['User','agent','admin','user','userpic','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','read','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','ChatInternalMessage','count','findAll','rows','catch','show','params','include','create','body','find','describe','get','messages','lastMessage','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2a4813,_0x1c9e07){var _0x75858e=function(_0x1a48d9){while(--_0x1a48d9){_0x2a4813['push'](_0x2a4813['shift']());}};_0x75858e(++_0x1c9e07);}(_0xbc68,0x155));var _0x8bc6=function(_0x4d3016,_0x3351a0){_0x4d3016=_0x4d3016-0x0;var _0x20057c=_0xbc68[_0x4d3016];return _0x20057c;};'use strict';var emlformat=require(_0x8bc6('0x0'));var rimraf=require(_0x8bc6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8bc6('0x2'));var moment=require('moment');var BPromise=require(_0x8bc6('0x3'));var Mustache=require(_0x8bc6('0x4'));var util=require(_0x8bc6('0x5'));var path=require(_0x8bc6('0x6'));var sox=require(_0x8bc6('0x7'));var csv=require(_0x8bc6('0x8'));var ejs=require(_0x8bc6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bc6('0xa'));var squel=require(_0x8bc6('0xb'));var crypto=require(_0x8bc6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8bc6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8bc6('0xe'));var Papa=require(_0x8bc6('0xf'));var Redis=require(_0x8bc6('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8bc6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8bc6('0x12'))(_0x8bc6('0x13'));var utils=require(_0x8bc6('0x14'));var config=require(_0x8bc6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8bc6('0x16'))['db'];config[_0x8bc6('0x17')]=_[_0x8bc6('0x18')](config['redis'],{'host':_0x8bc6('0x19'),'port':0x18eb});var socket=require(_0x8bc6('0x1a'))(new Redis(config[_0x8bc6('0x17')]));require(_0x8bc6('0x1b'))[_0x8bc6('0x1c')](socket);function respondWithStatusCode(_0x559a88,_0x2786e0){_0x2786e0=_0x2786e0||0xcc;return function(_0x3e8366){if(_0x3e8366){return _0x559a88['sendStatus'](_0x2786e0);}return _0x559a88[_0x8bc6('0x1d')](_0x2786e0)['end']();};}function respondWithResult(_0x28cb2a,_0x3ef1ed){_0x3ef1ed=_0x3ef1ed||0xc8;return function(_0x14816c){if(_0x14816c){return _0x28cb2a[_0x8bc6('0x1d')](_0x3ef1ed)['json'](_0x14816c);}};}function respondWithFilteredResult(_0x17c09f,_0x108043){return function(_0x3a5c8e){if(_0x3a5c8e){var _0x41dae0=typeof _0x108043[_0x8bc6('0x1e')]===_0x8bc6('0x1f')&&typeof _0x108043[_0x8bc6('0x20')]===_0x8bc6('0x1f');var _0x2d7805=_0x3a5c8e['count'];var _0x90bf59=_0x41dae0?0x0:_0x108043[_0x8bc6('0x1e')];var _0x5bbc8e=_0x41dae0?_0x3a5c8e['count']:_0x108043[_0x8bc6('0x1e')]+_0x108043[_0x8bc6('0x20')];var _0x7fbb55;if(_0x5bbc8e>=_0x2d7805){_0x5bbc8e=_0x2d7805;_0x7fbb55=0xc8;}else{_0x7fbb55=0xce;}_0x17c09f[_0x8bc6('0x1d')](_0x7fbb55);return _0x17c09f[_0x8bc6('0x21')](_0x8bc6('0x22'),_0x90bf59+'-'+_0x5bbc8e+'/'+_0x2d7805)['json'](_0x3a5c8e);}return null;};}function patchUpdates(_0xdfd7cf){return function(_0x3cf819){try{jsonpatch[_0x8bc6('0x23')](_0x3cf819,_0xdfd7cf,!![]);}catch(_0x351606){return BPromise['reject'](_0x351606);}return _0x3cf819[_0x8bc6('0x24')]();};}function saveUpdates(_0xa90f66,_0xa04593){return function(_0x121d02){if(_0x121d02){return _0x121d02[_0x8bc6('0x25')](_0xa90f66)[_0x8bc6('0x26')](function(_0x185716){return _0x185716;});}return null;};}function removeEntity(_0x4bdde9,_0x4d1e7d){return function(_0x25d326){if(_0x25d326){return _0x25d326[_0x8bc6('0x27')]()[_0x8bc6('0x26')](function(){_0x4bdde9[_0x8bc6('0x1d')](0xcc)[_0x8bc6('0x28')]();});}};}function handleEntityNotFound(_0x541ad9,_0x4bdd87){return function(_0x24330d){if(!_0x24330d){_0x541ad9[_0x8bc6('0x29')](0x194);}return _0x24330d;};}function handleError(_0x478ea6,_0x523784){_0x523784=_0x523784||0x1f4;return function(_0x109844){logger[_0x8bc6('0x2a')](_0x109844[_0x8bc6('0x2b')]);if(_0x109844[_0x8bc6('0x2c')]){delete _0x109844[_0x8bc6('0x2c')];}_0x478ea6['status'](_0x523784)[_0x8bc6('0x2d')](_0x109844);};}exports[_0x8bc6('0x2e')]=function(_0x76c48d,_0x1a6853){var _0x186768={},_0x4fbcce={},_0x46810c={'count':0x0,'rows':[]};var _0x156871=_[_0x8bc6('0x2f')](db['ChatInternalMessage'][_0x8bc6('0x30')],function(_0x32719a){return{'name':_0x32719a[_0x8bc6('0x31')],'type':_0x32719a[_0x8bc6('0x32')]['key']};});_0x4fbcce[_0x8bc6('0x33')]=_['map'](_0x156871,_0x8bc6('0x2c'));_0x4fbcce['query']=_[_0x8bc6('0x34')](_0x76c48d[_0x8bc6('0x35')]);_0x4fbcce['filters']=_['intersection'](_0x4fbcce['model'],_0x4fbcce[_0x8bc6('0x35')]);_0x186768[_0x8bc6('0x36')]=_[_0x8bc6('0x37')](_0x4fbcce[_0x8bc6('0x33')],qs[_0x8bc6('0x38')](_0x76c48d[_0x8bc6('0x35')][_0x8bc6('0x38')]));_0x186768['attributes']=_0x186768[_0x8bc6('0x36')][_0x8bc6('0x39')]?_0x186768[_0x8bc6('0x36')]:_0x4fbcce['model'];if(!_0x76c48d[_0x8bc6('0x35')]['hasOwnProperty']('nolimit')){_0x186768[_0x8bc6('0x20')]=qs['limit'](_0x76c48d['query'][_0x8bc6('0x20')]);_0x186768['offset']=qs['offset'](_0x76c48d['query'][_0x8bc6('0x1e')]);}_0x186768[_0x8bc6('0x3a')]=qs[_0x8bc6('0x3b')](_0x76c48d[_0x8bc6('0x35')]['sort']);_0x186768[_0x8bc6('0x3c')]=qs[_0x8bc6('0x3d')](_[_0x8bc6('0x3e')](_0x76c48d['query'],_0x4fbcce[_0x8bc6('0x3d')]),_0x156871);if(_0x76c48d[_0x8bc6('0x35')][_0x8bc6('0x3f')]){_0x186768[_0x8bc6('0x3c')]=_['merge'](_0x186768[_0x8bc6('0x3c')],{'$or':_[_0x8bc6('0x2f')](_0x156871,function(_0x22ed3a){if(_0x22ed3a[_0x8bc6('0x32')]!==_0x8bc6('0x40')){var _0x4ac7b7={};_0x4ac7b7[_0x22ed3a[_0x8bc6('0x2c')]]={'$like':'%'+_0x76c48d[_0x8bc6('0x35')]['filter']+'%'};return _0x4ac7b7;}})});}_0x186768=_[_0x8bc6('0x41')]({},_0x186768,_0x76c48d[_0x8bc6('0x42')]);var _0x52c915={'where':_0x186768['where']};return db[_0x8bc6('0x43')]['count'](_0x52c915)['then'](function(_0x110b6f){_0x46810c[_0x8bc6('0x44')]=_0x110b6f;if(_0x76c48d[_0x8bc6('0x35')]['includeAll']){_0x186768['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x8bc6('0x45')](_0x186768);})[_0x8bc6('0x26')](function(_0xc3b6e){_0x46810c[_0x8bc6('0x46')]=_0xc3b6e;return _0x46810c;})[_0x8bc6('0x26')](respondWithFilteredResult(_0x1a6853,_0x186768))[_0x8bc6('0x47')](handleError(_0x1a6853,null));};exports[_0x8bc6('0x48')]=function(_0xa3a962,_0x257370){var _0x222a66={'raw':!![],'where':{'id':_0xa3a962[_0x8bc6('0x49')]['id']}},_0x134ef3={};_0x134ef3[_0x8bc6('0x33')]=_[_0x8bc6('0x34')](db[_0x8bc6('0x43')][_0x8bc6('0x30')]);_0x134ef3[_0x8bc6('0x35')]=_[_0x8bc6('0x34')](_0xa3a962[_0x8bc6('0x35')]);_0x134ef3[_0x8bc6('0x3d')]=_[_0x8bc6('0x37')](_0x134ef3['model'],_0x134ef3[_0x8bc6('0x35')]);_0x222a66['attributes']=_['intersection'](_0x134ef3[_0x8bc6('0x33')],qs['fields'](_0xa3a962[_0x8bc6('0x35')][_0x8bc6('0x38')]));_0x222a66[_0x8bc6('0x36')]=_0x222a66['attributes']['length']?_0x222a66['attributes']:_0x134ef3[_0x8bc6('0x33')];if(_0xa3a962['query']['includeAll']){_0x222a66[_0x8bc6('0x4a')]=[{'all':!![]}];}_0x222a66=_[_0x8bc6('0x41')]({},_0x222a66,_0xa3a962[_0x8bc6('0x42')]);return db[_0x8bc6('0x43')]['find'](_0x222a66)[_0x8bc6('0x26')](handleEntityNotFound(_0x257370,null))['then'](respondWithResult(_0x257370,null))['catch'](handleError(_0x257370,null));};exports[_0x8bc6('0x4b')]=function(_0x5114ea,_0x58e778){return db[_0x8bc6('0x43')][_0x8bc6('0x4b')](_0x5114ea[_0x8bc6('0x4c')],{})[_0x8bc6('0x26')](respondWithResult(_0x58e778,0xc9))['catch'](handleError(_0x58e778,null));};exports[_0x8bc6('0x25')]=function(_0x372501,_0x10389e){if(_0x372501['body']['id']){delete _0x372501['body']['id'];}return db[_0x8bc6('0x43')][_0x8bc6('0x4d')]({'where':{'id':_0x372501[_0x8bc6('0x49')]['id']}})[_0x8bc6('0x26')](handleEntityNotFound(_0x10389e,null))['then'](saveUpdates(_0x372501[_0x8bc6('0x4c')],null))[_0x8bc6('0x26')](respondWithResult(_0x10389e,null))['catch'](handleError(_0x10389e,null));};exports[_0x8bc6('0x27')]=function(_0x1f12bb,_0x5447cd){return db[_0x8bc6('0x43')][_0x8bc6('0x4d')]({'where':{'id':_0x1f12bb[_0x8bc6('0x49')]['id']}})[_0x8bc6('0x26')](handleEntityNotFound(_0x5447cd,null))[_0x8bc6('0x26')](removeEntity(_0x5447cd,null))['catch'](handleError(_0x5447cd,null));};exports[_0x8bc6('0x4e')]=function(_0x1c3429,_0x43dc59){return db[_0x8bc6('0x43')][_0x8bc6('0x4e')]()[_0x8bc6('0x26')](respondWithResult(_0x43dc59,null))['catch'](handleError(_0x43dc59,null));};function wrapUser(_0x184eff){return function(_0x140721){var _0xb6d743=_0x184eff[_0x8bc6('0x4f')]({'plain':!![]});_0xb6d743[_0x8bc6('0x50')]=[];if(_0x140721){_0xb6d743['lastMessageAt']=_0x140721['createdAt'];_0xb6d743[_0x8bc6('0x51')]=_0x140721;}else{_0xb6d743['lastMessageAt']=moment(0x0)['format'](_0x8bc6('0x52'));_0xb6d743['lastMessage']={};}return _0xb6d743;};}exports['getUsers']=function(_0x1f2952,_0xf3e194,_0x4c5f4f){var _0xc06c98=[];return db[_0x8bc6('0x53')]['findAll']({'where':{'role':[_0x8bc6('0x54'),_0x8bc6('0x55'),_0x8bc6('0x56')]},'attributes':['id','fullname',_0x8bc6('0x2c'),'role',_0x8bc6('0x57'),'internal','online',_0x8bc6('0x58'),_0x8bc6('0x59'),_0x8bc6('0x5a')],'order':qs[_0x8bc6('0x3b')](_0x8bc6('0x5b')),'include':[{'model':db[_0x8bc6('0x5c')],'as':_0x8bc6('0x5d'),'attributes':['id',_0x8bc6('0x2c'),_0x8bc6('0x32')],'through':{'attributes':[]}}]})[_0x8bc6('0x26')](function(_0x423bed){if(_0x423bed){var _0x29cc64=_0x1f2952[_0x8bc6('0x56')]['get']({'plain':!![]});if(!_0x29cc64)throw new Error(_0x8bc6('0x5e'));if(_0x29cc64[_0x8bc6('0x5f')]===_0x8bc6('0x56')){return db[_0x8bc6('0x60')]['find']({'where':{'name':_0x8bc6('0x61'),'userProfileId':_0x29cc64['userProfileId']},'raw':!![]})[_0x8bc6('0x26')](function(_0x2484e9){if(_0x2484e9){if(_0x2484e9[_0x8bc6('0x62')]===0x0){return db[_0x8bc6('0x63')][_0x8bc6('0x45')]({'where':{'sectionId':_0x2484e9['id']},'raw':!![]})[_0x8bc6('0x26')](function(_0x337cfd){var _0x8b57a1=[];if(_[_0x8bc6('0x64')](_0x337cfd)){_0x8b57a1=_[_0x8bc6('0x3f')](_0x423bed,function(_0x5ed501){if(_0x5ed501[_0x8bc6('0x5f')]!==_0x8bc6('0x54')){return _0x5ed501;}});return _0x8b57a1;}else{for(var _0x2b2de5=0x0;_0x2b2de5<_0x423bed[_0x8bc6('0x39')];_0x2b2de5++){var _0x16f762=_0x423bed[_0x2b2de5];if(_0x16f762['role']===_0x8bc6('0x54')){var _0x1a54f0=_[_0x8bc6('0x4d')](_0x337cfd,function(_0x14868e){return _0x14868e[_0x8bc6('0x65')]===_0x16f762['id'];});if(_0x1a54f0)_0x8b57a1['push'](_0x16f762);}else{_0x8b57a1[_0x8bc6('0x66')](_0x16f762);}}return _0x8b57a1;}});}else{return _0x423bed;}}else{var _0x32caef=_[_0x8bc6('0x3f')](_0x423bed,function(_0x2f6a23){if(_0x2f6a23[_0x8bc6('0x5f')]!==_0x8bc6('0x54')){return _0x2f6a23;}});return _0x32caef;}});}else{return _0x423bed;}}})[_0x8bc6('0x26')](function(_0x5d18f1){var _0x35168c=[];if(_0x5d18f1){_0xc06c98=_0x5d18f1;for(var _0x2681c3=0x0;_0x2681c3<_0x5d18f1[_0x8bc6('0x39')];_0x2681c3+=0x1){_0xc06c98[_0x2681c3][_0x8bc6('0x50')]=[];_0x35168c[_0x8bc6('0x66')](db[_0x8bc6('0x43')][_0x8bc6('0x4d')]({'where':{'FromId':[_0x1f2952['user']['id'],_0x5d18f1[_0x2681c3]['id']],'ToId':[_0x1f2952['user']['id'],_0x5d18f1[_0x2681c3]['id']],'ChatGroupId':null},'attributes':['id',_0x8bc6('0x67'),_0x8bc6('0x68'),'ToId',_0x8bc6('0x69'),_0x8bc6('0x4c')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5d18f1[_0x2681c3])));}return BPromise['all'](_0x35168c);}return[];})[_0x8bc6('0x26')](function(_0x4eff6){return{'rows':_0x4eff6,'count':_0x4eff6[_0x8bc6('0x39')]};})[_0x8bc6('0x26')](respondWithResult(_0xf3e194,null))['catch'](handleError(_0xf3e194,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 7268708..f251414 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 _0x0b7f=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x38f6aa,_0x32503d){var _0xaa2345=function(_0x446e06){while(--_0x446e06){_0x38f6aa['push'](_0x38f6aa['shift']());}};_0xaa2345(++_0x32503d);}(_0x0b7f,0x115));var _0xf0b7=function(_0x787d44,_0x36fea9){_0x787d44=_0x787d44-0x0;var _0x1c1430=_0x0b7f[_0x787d44];return _0x1c1430;};'use strict';var EventEmitter=require(_0xf0b7('0x0'));var ChatInternalMessage=require(_0xf0b7('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf0b7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf0b7('0x3'),'afterDestroy':_0xf0b7('0x4')};function emitEvent(_0x20e3e8){return function(_0x4cd257,_0x5c4ce8,_0x28d608){ChatInternalMessageEvents[_0xf0b7('0x5')](_0x20e3e8+':'+_0x4cd257['id'],_0x4cd257);ChatInternalMessageEvents[_0xf0b7('0x5')](_0x20e3e8,_0x4cd257);_0x28d608(null);};}for(var e in events){if(events[_0xf0b7('0x6')](e)){var event=events[e];ChatInternalMessage[_0xf0b7('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xf5ff=['setMaxListeners','save','emit','exports','events','ChatInternalMessage'];(function(_0x8bb2ba,_0x1d2097){var _0x2464c5=function(_0x1baee4){while(--_0x1baee4){_0x8bb2ba['push'](_0x8bb2ba['shift']());}};_0x2464c5(++_0x1d2097);}(_0xf5ff,0xbe));var _0xff5f=function(_0xc60eb5,_0x59eea4){_0xc60eb5=_0xc60eb5-0x0;var _0x3c5554=_0xf5ff[_0xc60eb5];return _0x3c5554;};'use strict';var EventEmitter=require(_0xff5f('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xff5f('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xff5f('0x2')](0x0);var events={'afterCreate':_0xff5f('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x592538){return function(_0x7f44f2,_0x1cc84f,_0x4606a2){ChatInternalMessageEvents[_0xff5f('0x4')](_0x592538+':'+_0x7f44f2['id'],_0x7f44f2);ChatInternalMessageEvents[_0xff5f('0x4')](_0x592538,_0x7f44f2);_0x4606a2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xff5f('0x5')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index d9f9e28..de6e50f 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 _0x38e4=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x38e4,0xa9));var _0x438e=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x38e4[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x438e('0x0'));var util=require(_0x438e('0x1'));var logger=require(_0x438e('0x2'))(_0x438e('0x3'));var moment=require(_0x438e('0x4'));var BPromise=require(_0x438e('0x5'));var rp=require(_0x438e('0x6'));var fs=require('fs');var path=require(_0x438e('0x7'));var rimraf=require(_0x438e('0x8'));var config=require(_0x438e('0x9'));var attributes=require(_0x438e('0xa'));module[_0x438e('0xb')]=function(_0xa30574,_0x38df29){return _0xa30574[_0x438e('0xc')]('ChatInternalMessage',attributes,{'tableName':_0x438e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x438e('0xe'),'collate':_0x438e('0xf')});};
\ No newline at end of file
+var _0x58be=['rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x58be,0x158));var _0xe58b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x58be[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xe58b('0x0'));var util=require(_0xe58b('0x1'));var logger=require('../../config/logger')(_0xe58b('0x2'));var moment=require(_0xe58b('0x3'));var BPromise=require('bluebird');var rp=require(_0xe58b('0x4'));var fs=require('fs');var path=require(_0xe58b('0x5'));var rimraf=require(_0xe58b('0x6'));var config=require(_0xe58b('0x7'));var attributes=require(_0xe58b('0x8'));module['exports']=function(_0x1f1237,_0x4cdbe9){return _0x1f1237[_0xe58b('0x9')](_0xe58b('0xa'),attributes,{'tableName':_0xe58b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe58b('0xc'),'collate':_0xe58b('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 422f4a8..9ac1786 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 _0x2908=['redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','then','info','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatInternalMessage,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client'];(function(_0x337972,_0x1f1182){var _0x4b3f58=function(_0x254827){while(--_0x254827){_0x337972['push'](_0x337972['shift']());}};_0x4b3f58(++_0x1f1182);}(_0x2908,0x1ef));var _0x8290=function(_0x36310d,_0x5e3999){_0x36310d=_0x36310d-0x0;var _0x3d622d=_0x2908[_0x36310d];return _0x3d622d;};'use strict';var _=require(_0x8290('0x0'));var util=require(_0x8290('0x1'));var moment=require(_0x8290('0x2'));var BPromise=require(_0x8290('0x3'));var rs=require(_0x8290('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8290('0x5'));var logger=require('../../config/logger')(_0x8290('0x6'));var config=require(_0x8290('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8290('0x8')]['http']({'port':0x232a});config[_0x8290('0x9')]=_[_0x8290('0xa')](config['redis'],{'host':_0x8290('0xb'),'port':0x18eb});var socket=require(_0x8290('0xc'))(new Redis(config[_0x8290('0x9')]));require(_0x8290('0xd'))['register'](socket);function respondWithRpcPromise(_0x21fca1,_0x46e0c9,_0x2b0c6a){return new BPromise(function(_0x46fb6b,_0x226edc){return client['request'](_0x21fca1,_0x2b0c6a)[_0x8290('0xe')](function(_0x3037b8){logger[_0x8290('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x46e0c9,'request\x20sent');logger['debug'](_0x8290('0x10'),_0x46e0c9,_0x8290('0x11'),JSON[_0x8290('0x12')](_0x3037b8));if(_0x3037b8[_0x8290('0x13')]){if(_0x3037b8[_0x8290('0x13')][_0x8290('0x14')]===0x1f4){logger[_0x8290('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x46e0c9,_0x3037b8[_0x8290('0x13')][_0x8290('0x15')]);return _0x226edc(_0x3037b8[_0x8290('0x13')][_0x8290('0x15')]);}logger['error'](_0x8290('0x16'),_0x46e0c9,_0x3037b8[_0x8290('0x13')][_0x8290('0x15')]);return _0x46fb6b(_0x3037b8['error'][_0x8290('0x15')]);}else{logger[_0x8290('0xf')](_0x8290('0x16'),_0x46e0c9,_0x8290('0x11'));_0x46fb6b(_0x3037b8[_0x8290('0x17')][_0x8290('0x15')]);}})['catch'](function(_0x4caf0c){logger[_0x8290('0x13')](_0x8290('0x16'),_0x46e0c9,_0x4caf0c);_0x226edc(_0x4caf0c);});});}
\ No newline at end of file
+var _0x0b31=['then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request'];(function(_0x4ed32d,_0x327695){var _0xf624df=function(_0x29518c){while(--_0x29518c){_0x4ed32d['push'](_0x4ed32d['shift']());}};_0xf624df(++_0x327695);}(_0x0b31,0x1a2));var _0x10b3=function(_0x59f15c,_0x24bf17){_0x59f15c=_0x59f15c-0x0;var _0xfb1050=_0x0b31[_0x59f15c];return _0xfb1050;};'use strict';var _=require(_0x10b3('0x0'));var util=require(_0x10b3('0x1'));var moment=require(_0x10b3('0x2'));var BPromise=require('bluebird');var rs=require(_0x10b3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x10b3('0x4'));var logger=require(_0x10b3('0x5'))(_0x10b3('0x6'));var config=require(_0x10b3('0x7'));var jayson=require(_0x10b3('0x8'));var client=jayson[_0x10b3('0x9')][_0x10b3('0xa')]({'port':0x232a});config[_0x10b3('0xb')]=_[_0x10b3('0xc')](config['redis'],{'host':_0x10b3('0xd'),'port':0x18eb});var socket=require(_0x10b3('0xe'))(new Redis(config[_0x10b3('0xb')]));require(_0x10b3('0xf'))['register'](socket);function respondWithRpcPromise(_0x1fd8a6,_0x38c841,_0x5dc288){return new BPromise(function(_0x133c70,_0x43aaf2){return client[_0x10b3('0x10')](_0x1fd8a6,_0x5dc288)[_0x10b3('0x11')](function(_0x3341e4){logger['info'](_0x10b3('0x12'),_0x38c841,_0x10b3('0x13'));logger[_0x10b3('0x14')](_0x10b3('0x15'),_0x38c841,'request\x20sent',JSON[_0x10b3('0x16')](_0x3341e4));if(_0x3341e4[_0x10b3('0x17')]){if(_0x3341e4[_0x10b3('0x17')][_0x10b3('0x18')]===0x1f4){logger[_0x10b3('0x17')](_0x10b3('0x12'),_0x38c841,_0x3341e4[_0x10b3('0x17')][_0x10b3('0x19')]);return _0x43aaf2(_0x3341e4['error']['message']);}logger['error'](_0x10b3('0x12'),_0x38c841,_0x3341e4['error'][_0x10b3('0x19')]);return _0x133c70(_0x3341e4[_0x10b3('0x17')]['message']);}else{logger[_0x10b3('0x1a')](_0x10b3('0x12'),_0x38c841,'request\x20sent');_0x133c70(_0x3341e4[_0x10b3('0x1b')][_0x10b3('0x19')]);}})[_0x10b3('0x1c')](function(_0x19e3fe){logger['error'](_0x10b3('0x12'),_0x38c841,_0x19e3fe);_0x43aaf2(_0x19e3fe);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 11b6f89..0d4bfdc 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 _0x24fc=['save','remove','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x6a6b3,_0x4c48ee){var _0x13e9c9=function(_0x240d62){while(--_0x240d62){_0x6a6b3['push'](_0x6a6b3['shift']());}};_0x13e9c9(++_0x4c48ee);}(_0x24fc,0xb7));var _0xc24f=function(_0x42b9e5,_0x32d2f9){_0x42b9e5=_0x42b9e5-0x0;var _0x2f76e2=_0x24fc[_0x42b9e5];return _0x2f76e2;};'use strict';var ChatInternalMessageEvents=require(_0xc24f('0x0'));var events=[_0xc24f('0x1'),_0xc24f('0x2'),'update'];function createListener(_0x3f1e58,_0x5b1f98){return function(_0x14ed8d){_0x5b1f98[_0xc24f('0x3')](_0x3f1e58,_0x14ed8d);};}function removeListener(_0x51dd06,_0x525ab7){return function(){ChatInternalMessageEvents[_0xc24f('0x4')](_0x51dd06,_0x525ab7);};}exports[_0xc24f('0x5')]=function(_0x31738f){for(var _0x33d669=0x0,_0x59eb17=events[_0xc24f('0x6')];_0x33d669<_0x59eb17;_0x33d669++){var _0x4b0291=events[_0x33d669];var _0x623e8f=createListener(_0xc24f('0x7')+_0x4b0291,_0x31738f);ChatInternalMessageEvents['on'](_0x4b0291,_0x623e8f);}};
\ No newline at end of file
+var _0xfc00=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update'];(function(_0x237a26,_0x4d9a41){var _0x2b12c9=function(_0x4103f5){while(--_0x4103f5){_0x237a26['push'](_0x237a26['shift']());}};_0x2b12c9(++_0x4d9a41);}(_0xfc00,0x1d5));var _0x0fc0=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0xfc00[_0x3826ad];return _0x17b900;};'use strict';var ChatInternalMessageEvents=require(_0x0fc0('0x0'));var events=['save',_0x0fc0('0x1'),_0x0fc0('0x2')];function createListener(_0xcc99d7,_0xa5cc2){return function(_0x5e49dd){_0xa5cc2[_0x0fc0('0x3')](_0xcc99d7,_0x5e49dd);};}function removeListener(_0x9b95e5,_0x3832bb){return function(){ChatInternalMessageEvents[_0x0fc0('0x4')](_0x9b95e5,_0x3832bb);};}exports[_0x0fc0('0x5')]=function(_0x582b65){for(var _0x4b540a=0x0,_0x43e07f=events[_0x0fc0('0x6')];_0x4b540a<_0x43e07f;_0x4b540a++){var _0x42942d=events[_0x4b540a];var _0xe0939d=createListener(_0x0fc0('0x7')+_0x42942d,_0x582b65);ChatInternalMessageEvents['on'](_0x42942d,_0xe0939d);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 17a3edc..ef909c8 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 _0x9bb1=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','describe','/users','getUsers','/:id','show','post','create','update','delete'];(function(_0x122424,_0x518a79){var _0x2a1679=function(_0x4ddd83){while(--_0x4ddd83){_0x122424['push'](_0x122424['shift']());}};_0x2a1679(++_0x518a79);}(_0x9bb1,0x152));var _0x19bb=function(_0x2bd9cd,_0x2887d5){_0x2bd9cd=_0x2bd9cd-0x0;var _0x23453b=_0x9bb1[_0x2bd9cd];return _0x23453b;};'use strict';var multer=require(_0x19bb('0x0'));var util=require(_0x19bb('0x1'));var path=require(_0x19bb('0x2'));var timeout=require(_0x19bb('0x3'));var express=require(_0x19bb('0x4'));var router=express[_0x19bb('0x5')]();var fs_extra=require(_0x19bb('0x6'));var auth=require(_0x19bb('0x7'));var interaction=require(_0x19bb('0x8'));var config=require(_0x19bb('0x9'));var controller=require(_0x19bb('0xa'));router[_0x19bb('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x19bb('0xc')](),controller[_0x19bb('0xd')]);router[_0x19bb('0xb')](_0x19bb('0xe'),auth[_0x19bb('0xc')](),controller[_0x19bb('0xf')]);router[_0x19bb('0xb')](_0x19bb('0x10'),auth[_0x19bb('0xc')](),controller[_0x19bb('0x11')]);router[_0x19bb('0x12')]('/',auth[_0x19bb('0xc')](),controller[_0x19bb('0x13')]);router['put'](_0x19bb('0x10'),controller[_0x19bb('0x14')]);router[_0x19bb('0x15')](_0x19bb('0x10'),auth[_0x19bb('0xc')](),controller[_0x19bb('0x16')]);module[_0x19bb('0x17')]=router;
\ No newline at end of file
+var _0xfe8d=['/:id','show','post','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers'];(function(_0x2bd7ef,_0x279212){var _0x42e78a=function(_0x1369d4){while(--_0x1369d4){_0x2bd7ef['push'](_0x2bd7ef['shift']());}};_0x42e78a(++_0x279212);}(_0xfe8d,0x15b));var _0xdfe8=function(_0x3f98a7,_0x2230ae){_0x3f98a7=_0x3f98a7-0x0;var _0x190227=_0xfe8d[_0x3f98a7];return _0x190227;};'use strict';var multer=require(_0xdfe8('0x0'));var util=require(_0xdfe8('0x1'));var path=require('path');var timeout=require(_0xdfe8('0x2'));var express=require(_0xdfe8('0x3'));var router=express[_0xdfe8('0x4')]();var fs_extra=require(_0xdfe8('0x5'));var auth=require(_0xdfe8('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdfe8('0x7'));router[_0xdfe8('0x8')]('/',auth[_0xdfe8('0x9')](),controller['index']);router['get'](_0xdfe8('0xa'),auth[_0xdfe8('0x9')](),controller[_0xdfe8('0xb')]);router[_0xdfe8('0x8')](_0xdfe8('0xc'),auth[_0xdfe8('0x9')](),controller[_0xdfe8('0xd')]);router[_0xdfe8('0x8')](_0xdfe8('0xe'),auth[_0xdfe8('0x9')](),controller[_0xdfe8('0xf')]);router[_0xdfe8('0x10')]('/',auth[_0xdfe8('0x9')](),controller['create']);router['put'](_0xdfe8('0xe'),controller['update']);router[_0xdfe8('0x11')](_0xdfe8('0xe'),auth[_0xdfe8('0x9')](),controller['destroy']);module[_0xdfe8('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index d2f26d5..89096bb 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 _0x7633=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x5da535,_0x9c65ae){var _0x54c87e=function(_0x876261){while(--_0x876261){_0x5da535['push'](_0x5da535['shift']());}};_0x54c87e(++_0x9c65ae);}(_0x7633,0x1c4));var _0x3763=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x7633[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0x3763('0x0'));module[_0x3763('0x1')]={'body':{'type':Sequelize[_0x3763('0x2')](_0x3763('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3763('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3763('0x5')]('in',_0x3763('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x3763('0x7')]},'providerName':{'type':Sequelize[_0x3763('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x6f59=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x4a74e,_0x51c3e2){var _0x527e45=function(_0x204fd6){while(--_0x204fd6){_0x4a74e['push'](_0x4a74e['shift']());}};_0x527e45(++_0x51c3e2);}(_0x6f59,0x1be));var _0x96f5=function(_0x575d29,_0x45a14c){_0x575d29=_0x575d29-0x0;var _0x236d7b=_0x6f59[_0x575d29];return _0x236d7b;};'use strict';var Sequelize=require(_0x96f5('0x0'));module[_0x96f5('0x1')]={'body':{'type':Sequelize[_0x96f5('0x2')](_0x96f5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x96f5('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x96f5('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x96f5('0x5')]('in',_0x96f5('0x6')),'defaultValue':_0x96f5('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x96f5('0x7')]},'providerName':{'type':Sequelize[_0x96f5('0x8')]},'providerResponse':{'type':Sequelize[_0x96f5('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 44efc57..961ae93 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 _0xeae9=['accept','chat','acceptMessage','reject','UserId','user','agent','get','ChatInteraction','ChatInteractionId','role','interaction','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','util','lodash','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','chat-interactions','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','status','json','offset','undefined','limit','count','set','update','then','destroy','end','sendStatus','name','send','index','rawAttributes','type','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','VIRTUAL','options','where','ChatMessage','includeAll','include','findAll','rows','show','params','fields','find','create','body','describe'];(function(_0x370254,_0x4acf36){var _0xa00514=function(_0xc8da84){while(--_0xc8da84){_0x370254['push'](_0x370254['shift']());}};_0xa00514(++_0x4acf36);}(_0xeae9,0x8b));var _0x9eae=function(_0x95c465,_0x1f7f82){_0x95c465=_0x95c465-0x0;var _0x386c2d=_0xeae9[_0x95c465];return _0x386c2d;};'use strict';var util=require(_0x9eae('0x0'));var _=require(_0x9eae('0x1'));var Redis=require('ioredis');var interactionService=require(_0x9eae('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x9eae('0x3'))(_0x9eae('0x4'));var config=require(_0x9eae('0x5'));var db=require(_0x9eae('0x6'))['db'];config[_0x9eae('0x7')]=_[_0x9eae('0x8')](config[_0x9eae('0x7')],{'host':_0x9eae('0x9'),'port':0x18eb});var socket=require(_0x9eae('0xa'))(new Redis(config[_0x9eae('0x7')]));require(_0x9eae('0xb'))[_0x9eae('0xc')](socket);var jayson=require(_0x9eae('0xd'));var client=jayson[_0x9eae('0xe')][_0x9eae('0xf')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var interaction_log=require(_0x9eae('0x3'))(_0x9eae('0x10'));function respondWithRpcPromise(_0x274dd2,_0x5dde5a,_0x673249,_0x23e67c){return new Promise(function(_0x22fbd5,_0x219c10){var _0x390fc6=_0x23e67c||client;return _0x390fc6[_0x9eae('0x11')](_0x274dd2,_0x673249)['then'](function(_0x5f1392){logger[_0x9eae('0x12')](_0x9eae('0x13'),_0x5dde5a,_0x9eae('0x14'));logger[_0x9eae('0x15')](_0x9eae('0x16'),_0x5dde5a,'request\x20sent',JSON[_0x9eae('0x17')](_0x5f1392));if(_0x5f1392['error']){if(_0x5f1392['error'][_0x9eae('0x18')]===0x1f4){logger[_0x9eae('0x19')]('ChatMessage,\x20%s,\x20%s',_0x5dde5a,_0x5f1392[_0x9eae('0x19')][_0x9eae('0x1a')]);return _0x219c10(_0x5f1392[_0x9eae('0x19')]['message']);}logger['error'](_0x9eae('0x13'),_0x5dde5a,_0x5f1392[_0x9eae('0x19')]['message']);return _0x22fbd5(_0x5f1392[_0x9eae('0x19')]['message']);}else{logger['info'](_0x9eae('0x13'),_0x5dde5a,_0x9eae('0x14'));_0x22fbd5(_0x5f1392[_0x9eae('0x1b')][_0x9eae('0x1a')]);}})[_0x9eae('0x1c')](function(_0x5005e9){logger[_0x9eae('0x19')](_0x9eae('0x13'),_0x5dde5a,_0x5005e9);_0x219c10(_0x5005e9);});});}function respondWithResult(_0x281cdc,_0x372378){_0x372378=_0x372378||0xc8;return function(_0x1e959e){if(_0x1e959e){return _0x281cdc[_0x9eae('0x1d')](_0x372378)[_0x9eae('0x1e')](_0x1e959e);}};}function respondWithFilteredResult(_0x2ee489,_0x42a002){return function(_0x16c921){if(_0x16c921){var _0x3ce277=typeof _0x42a002[_0x9eae('0x1f')]===_0x9eae('0x20')&&typeof _0x42a002[_0x9eae('0x21')]==='undefined';var _0x13ee00=_0x16c921[_0x9eae('0x22')];var _0x4cf256=_0x3ce277?0x0:_0x42a002[_0x9eae('0x1f')];var _0x408223=_0x3ce277?_0x16c921['count']:_0x42a002[_0x9eae('0x1f')]+_0x42a002[_0x9eae('0x21')];var _0x257068;if(_0x408223>=_0x13ee00){_0x408223=_0x13ee00;_0x257068=0xc8;}else{_0x257068=0xce;}_0x2ee489[_0x9eae('0x1d')](_0x257068);return _0x2ee489[_0x9eae('0x23')]('Content-Range',_0x4cf256+'-'+_0x408223+'/'+_0x13ee00)[_0x9eae('0x1e')](_0x16c921);}return null;};}function saveUpdates(_0x5122ae){return function(_0x57f2ca){if(_0x57f2ca){return _0x57f2ca[_0x9eae('0x24')](_0x5122ae)[_0x9eae('0x25')](function(_0x2eea02){return _0x2eea02;});}return null;};}function removeEntity(_0x5b333e){return function(_0x15afd1){if(_0x15afd1){return _0x15afd1[_0x9eae('0x26')]()[_0x9eae('0x25')](function(){_0x5b333e[_0x9eae('0x1d')](0xcc)[_0x9eae('0x27')]();});}};}function handleEntityNotFound(_0x5c942d){return function(_0x3803a2){if(!_0x3803a2){_0x5c942d[_0x9eae('0x28')](0x194);}return _0x3803a2;};}function handleError(_0x2f6eda,_0x5f073b){_0x5f073b=_0x5f073b||0x1f4;return function(_0x5c0932){logger[_0x9eae('0x19')](_0x5c0932['stack']);if(_0x5c0932[_0x9eae('0x29')]){delete _0x5c0932[_0x9eae('0x29')];}_0x2f6eda[_0x9eae('0x1d')](_0x5f073b)[_0x9eae('0x2a')](_0x5c0932);};}exports[_0x9eae('0x2b')]=function(_0x1349b3,_0x514e1d){var _0x30dd56={},_0x261ff8={},_0x1d9450={'count':0x0,'rows':[]};var _0x5a4937=_['map'](db['ChatMessage'][_0x9eae('0x2c')],function(_0x3146f1){return{'name':_0x3146f1['fieldName'],'type':_0x3146f1[_0x9eae('0x2d')]['key']};});_0x261ff8[_0x9eae('0x2e')]=_[_0x9eae('0x2f')](_0x5a4937,_0x9eae('0x29'));_0x261ff8['query']=_[_0x9eae('0x30')](_0x1349b3[_0x9eae('0x31')]);_0x261ff8[_0x9eae('0x32')]=_[_0x9eae('0x33')](_0x261ff8[_0x9eae('0x2e')],_0x261ff8[_0x9eae('0x31')]);_0x30dd56[_0x9eae('0x34')]=_['intersection'](_0x261ff8[_0x9eae('0x2e')],qs['fields'](_0x1349b3['query']['fields']));_0x30dd56[_0x9eae('0x34')]=_0x30dd56[_0x9eae('0x34')][_0x9eae('0x35')]?_0x30dd56[_0x9eae('0x34')]:_0x261ff8[_0x9eae('0x2e')];if(!_0x1349b3[_0x9eae('0x31')][_0x9eae('0x36')](_0x9eae('0x37'))){_0x30dd56['limit']=qs['limit'](_0x1349b3[_0x9eae('0x31')][_0x9eae('0x21')]);_0x30dd56[_0x9eae('0x1f')]=qs[_0x9eae('0x1f')](_0x1349b3[_0x9eae('0x31')][_0x9eae('0x1f')]);}_0x30dd56['order']=qs['sort'](_0x1349b3[_0x9eae('0x31')][_0x9eae('0x38')]);_0x30dd56['where']=qs[_0x9eae('0x32')](_[_0x9eae('0x39')](_0x1349b3['query'],_0x261ff8[_0x9eae('0x32')]),_0x5a4937);if(_0x1349b3[_0x9eae('0x31')][_0x9eae('0x3a')]){_0x30dd56['where']=_[_0x9eae('0x3b')](_0x30dd56['where'],{'$or':_[_0x9eae('0x2f')](_0x5a4937,function(_0x31273c){if(_0x31273c['type']!==_0x9eae('0x3c')){var _0x338dd0={};_0x338dd0[_0x31273c[_0x9eae('0x29')]]={'$like':'%'+_0x1349b3['query']['filter']+'%'};return _0x338dd0;}})});}_0x30dd56=_[_0x9eae('0x3b')]({},_0x30dd56,_0x1349b3[_0x9eae('0x3d')]);var _0x507451={'where':_0x30dd56[_0x9eae('0x3e')]};return db[_0x9eae('0x3f')][_0x9eae('0x22')](_0x507451)[_0x9eae('0x25')](function(_0xccaaca){_0x1d9450[_0x9eae('0x22')]=_0xccaaca;if(_0x1349b3['query'][_0x9eae('0x40')]){_0x30dd56[_0x9eae('0x41')]=[{'all':!![]}];}return db[_0x9eae('0x3f')][_0x9eae('0x42')](_0x30dd56);})[_0x9eae('0x25')](function(_0x342545){_0x1d9450[_0x9eae('0x43')]=_0x342545;return _0x1d9450;})[_0x9eae('0x25')](respondWithFilteredResult(_0x514e1d,_0x30dd56))[_0x9eae('0x1c')](handleError(_0x514e1d,null));};exports[_0x9eae('0x44')]=function(_0xca54fa,_0x46a2cb){var _0xedd896={'raw':!![],'where':{'id':_0xca54fa[_0x9eae('0x45')]['id']}},_0x346cc6={};_0x346cc6[_0x9eae('0x2e')]=_[_0x9eae('0x30')](db[_0x9eae('0x3f')][_0x9eae('0x2c')]);_0x346cc6[_0x9eae('0x31')]=_[_0x9eae('0x30')](_0xca54fa[_0x9eae('0x31')]);_0x346cc6[_0x9eae('0x32')]=_['intersection'](_0x346cc6['model'],_0x346cc6[_0x9eae('0x31')]);_0xedd896[_0x9eae('0x34')]=_[_0x9eae('0x33')](_0x346cc6[_0x9eae('0x2e')],qs[_0x9eae('0x46')](_0xca54fa[_0x9eae('0x31')][_0x9eae('0x46')]));_0xedd896[_0x9eae('0x34')]=_0xedd896[_0x9eae('0x34')]['length']?_0xedd896[_0x9eae('0x34')]:_0x346cc6[_0x9eae('0x2e')];if(_0xca54fa[_0x9eae('0x31')][_0x9eae('0x40')]){_0xedd896[_0x9eae('0x41')]=[{'all':!![]}];}_0xedd896=_[_0x9eae('0x3b')]({},_0xedd896,_0xca54fa[_0x9eae('0x3d')]);return db['ChatMessage'][_0x9eae('0x47')](_0xedd896)[_0x9eae('0x25')](handleEntityNotFound(_0x46a2cb,null))['then'](respondWithResult(_0x46a2cb,null))[_0x9eae('0x1c')](handleError(_0x46a2cb,null));};exports['create']=function(_0x1d2237,_0x1f1ba0){return db[_0x9eae('0x3f')][_0x9eae('0x48')](_0x1d2237[_0x9eae('0x49')],{})[_0x9eae('0x25')](respondWithResult(_0x1f1ba0,0xc9))[_0x9eae('0x1c')](handleError(_0x1f1ba0,null));};exports[_0x9eae('0x24')]=function(_0x2ea0c4,_0x3f585f){if(_0x2ea0c4[_0x9eae('0x49')]['id']){delete _0x2ea0c4[_0x9eae('0x49')]['id'];}return db[_0x9eae('0x3f')][_0x9eae('0x47')]({'where':{'id':_0x2ea0c4[_0x9eae('0x45')]['id']}})[_0x9eae('0x25')](handleEntityNotFound(_0x3f585f,null))['then'](saveUpdates(_0x2ea0c4[_0x9eae('0x49')],null))[_0x9eae('0x25')](respondWithResult(_0x3f585f,null))[_0x9eae('0x1c')](handleError(_0x3f585f,null));};exports[_0x9eae('0x26')]=function(_0x17d9e4,_0x42c8ce){return db['ChatMessage'][_0x9eae('0x47')]({'where':{'id':_0x17d9e4['params']['id']}})[_0x9eae('0x25')](handleEntityNotFound(_0x42c8ce,null))[_0x9eae('0x25')](removeEntity(_0x42c8ce,null))[_0x9eae('0x1c')](handleError(_0x42c8ce,null));};exports[_0x9eae('0x4a')]=function(_0x3656b2,_0x4f6f5e){return db['ChatMessage'][_0x9eae('0x4a')]()[_0x9eae('0x25')](respondWithResult(_0x4f6f5e,null))[_0x9eae('0x1c')](handleError(_0x4f6f5e,null));};exports[_0x9eae('0x4b')]=function(_0x4bd2cf,_0xec3b8f){var _0x2ad351=_0x9eae('0x4c');return interactionService[_0x9eae('0x4d')](_0x4bd2cf,_0x2ad351)['then'](respondWithResult(_0xec3b8f,null))['catch'](handleError(_0xec3b8f,null));};exports[_0x9eae('0x4e')]=function(_0x14850d,_0x26916f){var _0x2fabb9={'agent':{},'channel':_0x9eae('0x4c')};if(_0x14850d[_0x9eae('0x49')]['id']){delete _0x14850d[_0x9eae('0x49')]['id'];}_0x14850d[_0x9eae('0x49')][_0x9eae('0x4f')]=_0x14850d[_0x9eae('0x49')]['UserId']||_0x14850d[_0x9eae('0x50')]['id'];_0x2fabb9[_0x9eae('0x51')]['id']=_0x14850d[_0x9eae('0x49')][_0x9eae('0x4f')];return db[_0x9eae('0x3f')]['find']({'where':{'id':_0x14850d[_0x9eae('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x26916f,null))[_0x9eae('0x25')](function(_0x4ca826){if(_0x4ca826){_0x2fabb9[_0x9eae('0x1a')]=_0x4ca826[_0x9eae('0x52')]({'plain':!![]});return db[_0x9eae('0x53')][_0x9eae('0x47')]({'where':{'id':_0x4ca826[_0x9eae('0x54')]}});}return null;})[_0x9eae('0x25')](handleEntityNotFound(_0x26916f,null))[_0x9eae('0x25')](function(_0x5d0cdd){if(_0x5d0cdd){_0x2fabb9['interaction']=_0x5d0cdd[_0x9eae('0x52')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x14850d['user']['id'],_0x14850d[_0x9eae('0x50')]['name'],_0x14850d[_0x9eae('0x50')][_0x9eae('0x55')],_0x2fabb9[_0x9eae('0x56')]['id'],_0x14850d[_0x9eae('0x49')]?JSON[_0x9eae('0x17')](_0x14850d['body']):'null');return respondWithRpcPromise(_0x9eae('0x57'),_0x9eae('0x58'),_0x2fabb9);}return null;})[_0x9eae('0x25')](function(_0x1fe1c9){var _0xeff7f9=_0x9eae('0x59')+_0x1fe1c9[_0x9eae('0x1a')][_0x9eae('0x5a')];return db[_0x9eae('0x5b')][_0x9eae('0x31')](_0xeff7f9,{'type':db['Sequelize'][_0x9eae('0x5c')][_0x9eae('0x5d')],'raw':!![]})[_0x9eae('0x25')](function(_0x59b89e){return _0x59b89e;});})[_0x9eae('0x25')](function(_0x1a89e5){if(_0x1a89e5){_0x2fabb9[_0x9eae('0x1a')][_0x9eae('0x5e')]=_0x1a89e5[0x0];if(!_0x14850d['body'][_0x9eae('0x4f')])return;return db[_0x9eae('0x5f')][_0x9eae('0x47')]({'where':{'id':_0x14850d['body']['UserId'],'role':_0x9eae('0x51')},'attributes':['id','name',_0x9eae('0x60'),_0x9eae('0x61'),_0x9eae('0x62')],'raw':!![]});}return null;})['then'](function(_0x40cca8){if(!_0x40cca8)return null;_0x2fabb9[_0x9eae('0x1a')]['agent']=_0x40cca8;return _0x2fabb9;})[_0x9eae('0x25')](function(_0x5428dd){if(_0x5428dd){_0x5428dd[_0x9eae('0x1a')][_0x9eae('0x63')]=util['format'](_0x9eae('0x64'),_0x14850d[_0x9eae('0x50')][_0x9eae('0x29')]);_0x5428dd[_0x9eae('0x1a')][_0x9eae('0x65')]=_0x2fabb9[_0x9eae('0x65')];_0x5428dd['message'][_0x9eae('0x66')]=_0x2fabb9[_0x9eae('0x65')];_0x5428dd['message'][_0x9eae('0x67')]=_0x9eae('0x4e');respondWithRpcPromise(_0x9eae('0x68'),'EventManager',{'event':'rejectmessage','message':_[_0x9eae('0x3b')](_0x2fabb9[_0x9eae('0x1a')],JSON[_0x9eae('0x69')](_0x2fabb9[_0x9eae('0x56')][_0x9eae('0x6a')]))},client9002);return _0x2fabb9;}return null;})[_0x9eae('0x25')](respondWithResult(_0x26916f,null))[_0x9eae('0x1c')](handleError(_0x26916f,null));};
\ No newline at end of file
+var _0xfe9f=['UserId','user','get','ChatInteraction','ChatInteractionId','interaction','role','null','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','agent','fullname','internal','interface','format','channel','motionChannel','formData','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','destroy','end','sendStatus','name','send','index','map','ChatMessage','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','create','body','update','describe','accept','acceptMessage','reject'];(function(_0x2e2a99,_0x38d7dd){var _0x38a24f=function(_0x1ae082){while(--_0x1ae082){_0x2e2a99['push'](_0x2e2a99['shift']());}};_0x38a24f(++_0x38d7dd);}(_0xfe9f,0x1a6));var _0xffe9=function(_0x2756f9,_0x5519f5){_0x2756f9=_0x2756f9-0x0;var _0x2dad62=_0xfe9f[_0x2756f9];return _0x2dad62;};'use strict';var util=require('util');var _=require(_0xffe9('0x0'));var Redis=require(_0xffe9('0x1'));var interactionService=require(_0xffe9('0x2'));var qs=require(_0xffe9('0x3'));var logger=require(_0xffe9('0x4'))(_0xffe9('0x5'));var config=require(_0xffe9('0x6'));var db=require('../../mysqldb')['db'];config[_0xffe9('0x7')]=_[_0xffe9('0x8')](config[_0xffe9('0x7')],{'host':_0xffe9('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xffe9('0x7')]));require(_0xffe9('0xa'))[_0xffe9('0xb')](socket);var jayson=require(_0xffe9('0xc'));var client=jayson[_0xffe9('0xd')][_0xffe9('0xe')]({'port':0x232c});var client9002=jayson['client'][_0xffe9('0xe')]({'port':0x232a});var interaction_log=require('../../config/logger')('chat-interactions');function respondWithRpcPromise(_0x2fa821,_0x903c2e,_0x28c656,_0x19dce3){return new Promise(function(_0x5463bf,_0x52ed56){var _0xcad036=_0x19dce3||client;return _0xcad036[_0xffe9('0xf')](_0x2fa821,_0x28c656)[_0xffe9('0x10')](function(_0x1e18ef){logger[_0xffe9('0x11')](_0xffe9('0x12'),_0x903c2e,'request\x20sent');logger[_0xffe9('0x13')](_0xffe9('0x14'),_0x903c2e,'request\x20sent',JSON[_0xffe9('0x15')](_0x1e18ef));if(_0x1e18ef[_0xffe9('0x16')]){if(_0x1e18ef[_0xffe9('0x16')][_0xffe9('0x17')]===0x1f4){logger['error'](_0xffe9('0x12'),_0x903c2e,_0x1e18ef[_0xffe9('0x16')][_0xffe9('0x18')]);return _0x52ed56(_0x1e18ef['error']['message']);}logger[_0xffe9('0x16')]('ChatMessage,\x20%s,\x20%s',_0x903c2e,_0x1e18ef[_0xffe9('0x16')][_0xffe9('0x18')]);return _0x5463bf(_0x1e18ef[_0xffe9('0x16')][_0xffe9('0x18')]);}else{logger[_0xffe9('0x11')]('ChatMessage,\x20%s,\x20%s',_0x903c2e,_0xffe9('0x19'));_0x5463bf(_0x1e18ef[_0xffe9('0x1a')]['message']);}})[_0xffe9('0x1b')](function(_0x5e19cd){logger[_0xffe9('0x16')](_0xffe9('0x12'),_0x903c2e,_0x5e19cd);_0x52ed56(_0x5e19cd);});});}function respondWithResult(_0x4fbad9,_0x3a0c2d){_0x3a0c2d=_0x3a0c2d||0xc8;return function(_0x3433d6){if(_0x3433d6){return _0x4fbad9[_0xffe9('0x1c')](_0x3a0c2d)[_0xffe9('0x1d')](_0x3433d6);}};}function respondWithFilteredResult(_0x46dacc,_0x14bb0a){return function(_0x4d7b76){if(_0x4d7b76){var _0x308f96=typeof _0x14bb0a[_0xffe9('0x1e')]===_0xffe9('0x1f')&&typeof _0x14bb0a[_0xffe9('0x20')]==='undefined';var _0x35d086=_0x4d7b76[_0xffe9('0x21')];var _0x2d5004=_0x308f96?0x0:_0x14bb0a[_0xffe9('0x1e')];var _0x407f45=_0x308f96?_0x4d7b76[_0xffe9('0x21')]:_0x14bb0a[_0xffe9('0x1e')]+_0x14bb0a[_0xffe9('0x20')];var _0x480c06;if(_0x407f45>=_0x35d086){_0x407f45=_0x35d086;_0x480c06=0xc8;}else{_0x480c06=0xce;}_0x46dacc[_0xffe9('0x1c')](_0x480c06);return _0x46dacc[_0xffe9('0x22')](_0xffe9('0x23'),_0x2d5004+'-'+_0x407f45+'/'+_0x35d086)[_0xffe9('0x1d')](_0x4d7b76);}return null;};}function saveUpdates(_0x193077){return function(_0x2bd8e2){if(_0x2bd8e2){return _0x2bd8e2['update'](_0x193077)[_0xffe9('0x10')](function(_0x53f53b){return _0x53f53b;});}return null;};}function removeEntity(_0x133d8c){return function(_0x11ce63){if(_0x11ce63){return _0x11ce63[_0xffe9('0x24')]()[_0xffe9('0x10')](function(){_0x133d8c[_0xffe9('0x1c')](0xcc)[_0xffe9('0x25')]();});}};}function handleEntityNotFound(_0x5c3d76){return function(_0x384a54){if(!_0x384a54){_0x5c3d76[_0xffe9('0x26')](0x194);}return _0x384a54;};}function handleError(_0x5b482e,_0x2e28e6){_0x2e28e6=_0x2e28e6||0x1f4;return function(_0x58c39b){logger[_0xffe9('0x16')](_0x58c39b['stack']);if(_0x58c39b[_0xffe9('0x27')]){delete _0x58c39b[_0xffe9('0x27')];}_0x5b482e[_0xffe9('0x1c')](_0x2e28e6)[_0xffe9('0x28')](_0x58c39b);};}exports[_0xffe9('0x29')]=function(_0xea2802,_0x1e0397){var _0x329c27={},_0xe7b9f1={},_0x3a56fa={'count':0x0,'rows':[]};var _0x320afa=_[_0xffe9('0x2a')](db[_0xffe9('0x2b')]['rawAttributes'],function(_0x5616c4){return{'name':_0x5616c4[_0xffe9('0x2c')],'type':_0x5616c4[_0xffe9('0x2d')][_0xffe9('0x2e')]};});_0xe7b9f1[_0xffe9('0x2f')]=_['map'](_0x320afa,_0xffe9('0x27'));_0xe7b9f1['query']=_[_0xffe9('0x30')](_0xea2802[_0xffe9('0x31')]);_0xe7b9f1[_0xffe9('0x32')]=_[_0xffe9('0x33')](_0xe7b9f1[_0xffe9('0x2f')],_0xe7b9f1[_0xffe9('0x31')]);_0x329c27[_0xffe9('0x34')]=_['intersection'](_0xe7b9f1[_0xffe9('0x2f')],qs[_0xffe9('0x35')](_0xea2802[_0xffe9('0x31')]['fields']));_0x329c27[_0xffe9('0x34')]=_0x329c27[_0xffe9('0x34')][_0xffe9('0x36')]?_0x329c27[_0xffe9('0x34')]:_0xe7b9f1['model'];if(!_0xea2802[_0xffe9('0x31')][_0xffe9('0x37')]('nolimit')){_0x329c27['limit']=qs[_0xffe9('0x20')](_0xea2802['query'][_0xffe9('0x20')]);_0x329c27[_0xffe9('0x1e')]=qs[_0xffe9('0x1e')](_0xea2802[_0xffe9('0x31')][_0xffe9('0x1e')]);}_0x329c27[_0xffe9('0x38')]=qs[_0xffe9('0x39')](_0xea2802[_0xffe9('0x31')][_0xffe9('0x39')]);_0x329c27[_0xffe9('0x3a')]=qs[_0xffe9('0x32')](_[_0xffe9('0x3b')](_0xea2802[_0xffe9('0x31')],_0xe7b9f1[_0xffe9('0x32')]),_0x320afa);if(_0xea2802[_0xffe9('0x31')][_0xffe9('0x3c')]){_0x329c27[_0xffe9('0x3a')]=_['merge'](_0x329c27[_0xffe9('0x3a')],{'$or':_[_0xffe9('0x2a')](_0x320afa,function(_0x402aca){if(_0x402aca['type']!==_0xffe9('0x3d')){var _0x22412f={};_0x22412f[_0x402aca[_0xffe9('0x27')]]={'$like':'%'+_0xea2802['query']['filter']+'%'};return _0x22412f;}})});}_0x329c27=_['merge']({},_0x329c27,_0xea2802['options']);var _0x5af17c={'where':_0x329c27['where']};return db[_0xffe9('0x2b')][_0xffe9('0x21')](_0x5af17c)[_0xffe9('0x10')](function(_0x2c9374){_0x3a56fa['count']=_0x2c9374;if(_0xea2802[_0xffe9('0x31')][_0xffe9('0x3e')]){_0x329c27[_0xffe9('0x3f')]=[{'all':!![]}];}return db[_0xffe9('0x2b')][_0xffe9('0x40')](_0x329c27);})[_0xffe9('0x10')](function(_0x1d8c6e){_0x3a56fa[_0xffe9('0x41')]=_0x1d8c6e;return _0x3a56fa;})[_0xffe9('0x10')](respondWithFilteredResult(_0x1e0397,_0x329c27))[_0xffe9('0x1b')](handleError(_0x1e0397,null));};exports[_0xffe9('0x42')]=function(_0x379194,_0x2629e0){var _0x5d2c0f={'raw':!![],'where':{'id':_0x379194[_0xffe9('0x43')]['id']}},_0x45041a={};_0x45041a[_0xffe9('0x2f')]=_[_0xffe9('0x30')](db[_0xffe9('0x2b')][_0xffe9('0x44')]);_0x45041a[_0xffe9('0x31')]=_['keys'](_0x379194[_0xffe9('0x31')]);_0x45041a['filters']=_[_0xffe9('0x33')](_0x45041a[_0xffe9('0x2f')],_0x45041a[_0xffe9('0x31')]);_0x5d2c0f[_0xffe9('0x34')]=_['intersection'](_0x45041a[_0xffe9('0x2f')],qs['fields'](_0x379194['query'][_0xffe9('0x35')]));_0x5d2c0f['attributes']=_0x5d2c0f['attributes']['length']?_0x5d2c0f[_0xffe9('0x34')]:_0x45041a[_0xffe9('0x2f')];if(_0x379194[_0xffe9('0x31')][_0xffe9('0x3e')]){_0x5d2c0f[_0xffe9('0x3f')]=[{'all':!![]}];}_0x5d2c0f=_['merge']({},_0x5d2c0f,_0x379194[_0xffe9('0x45')]);return db[_0xffe9('0x2b')][_0xffe9('0x46')](_0x5d2c0f)[_0xffe9('0x10')](handleEntityNotFound(_0x2629e0,null))[_0xffe9('0x10')](respondWithResult(_0x2629e0,null))[_0xffe9('0x1b')](handleError(_0x2629e0,null));};exports[_0xffe9('0x47')]=function(_0x3fbf1f,_0x420099){return db[_0xffe9('0x2b')][_0xffe9('0x47')](_0x3fbf1f[_0xffe9('0x48')],{})[_0xffe9('0x10')](respondWithResult(_0x420099,0xc9))[_0xffe9('0x1b')](handleError(_0x420099,null));};exports[_0xffe9('0x49')]=function(_0x4a3303,_0x410f99){if(_0x4a3303[_0xffe9('0x48')]['id']){delete _0x4a3303[_0xffe9('0x48')]['id'];}return db[_0xffe9('0x2b')][_0xffe9('0x46')]({'where':{'id':_0x4a3303[_0xffe9('0x43')]['id']}})[_0xffe9('0x10')](handleEntityNotFound(_0x410f99,null))[_0xffe9('0x10')](saveUpdates(_0x4a3303[_0xffe9('0x48')],null))[_0xffe9('0x10')](respondWithResult(_0x410f99,null))['catch'](handleError(_0x410f99,null));};exports[_0xffe9('0x24')]=function(_0x20548a,_0xe1e51f){return db['ChatMessage']['find']({'where':{'id':_0x20548a[_0xffe9('0x43')]['id']}})['then'](handleEntityNotFound(_0xe1e51f,null))['then'](removeEntity(_0xe1e51f,null))['catch'](handleError(_0xe1e51f,null));};exports[_0xffe9('0x4a')]=function(_0x2a15ad,_0x49eecb){return db['ChatMessage']['describe']()[_0xffe9('0x10')](respondWithResult(_0x49eecb,null))[_0xffe9('0x1b')](handleError(_0x49eecb,null));};exports[_0xffe9('0x4b')]=function(_0x4ad57c,_0x534448){var _0x223926='chat';return interactionService[_0xffe9('0x4c')](_0x4ad57c,_0x223926)['then'](respondWithResult(_0x534448,null))['catch'](handleError(_0x534448,null));};exports[_0xffe9('0x4d')]=function(_0x58167e,_0x1a92ef){var _0x1cb4cb={'agent':{},'channel':'chat'};if(_0x58167e['body']['id']){delete _0x58167e[_0xffe9('0x48')]['id'];}_0x58167e[_0xffe9('0x48')][_0xffe9('0x4e')]=_0x58167e['body']['UserId']||_0x58167e[_0xffe9('0x4f')]['id'];_0x1cb4cb['agent']['id']=_0x58167e[_0xffe9('0x48')][_0xffe9('0x4e')];return db[_0xffe9('0x2b')][_0xffe9('0x46')]({'where':{'id':_0x58167e[_0xffe9('0x43')]['id'],'UserId':null}})[_0xffe9('0x10')](handleEntityNotFound(_0x1a92ef,null))[_0xffe9('0x10')](function(_0x3aae2c){if(_0x3aae2c){_0x1cb4cb[_0xffe9('0x18')]=_0x3aae2c[_0xffe9('0x50')]({'plain':!![]});return db[_0xffe9('0x51')]['find']({'where':{'id':_0x3aae2c[_0xffe9('0x52')]}});}return null;})[_0xffe9('0x10')](handleEntityNotFound(_0x1a92ef,null))['then'](function(_0x3c6a6b){if(_0x3c6a6b){_0x1cb4cb[_0xffe9('0x53')]=_0x3c6a6b['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x58167e[_0xffe9('0x4f')]['id'],_0x58167e[_0xffe9('0x4f')][_0xffe9('0x27')],_0x58167e[_0xffe9('0x4f')][_0xffe9('0x54')],_0x1cb4cb[_0xffe9('0x53')]['id'],_0x58167e[_0xffe9('0x48')]?JSON[_0xffe9('0x15')](_0x58167e[_0xffe9('0x48')]):_0xffe9('0x55'));return respondWithRpcPromise(_0xffe9('0x56'),'rejectMessage',_0x1cb4cb);}return null;})[_0xffe9('0x10')](function(_0x4ab3f7){var _0x19afc8=_0xffe9('0x57')+_0x4ab3f7['message'][_0xffe9('0x58')];return db['sequelize']['query'](_0x19afc8,{'type':db[_0xffe9('0x59')][_0xffe9('0x5a')]['SELECT'],'raw':!![]})[_0xffe9('0x10')](function(_0x346888){return _0x346888;});})['then'](function(_0x312ef7){if(_0x312ef7){_0x1cb4cb['message'][_0xffe9('0x5b')]=_0x312ef7[0x0];if(!_0x58167e[_0xffe9('0x48')]['UserId'])return;return db['User'][_0xffe9('0x46')]({'where':{'id':_0x58167e[_0xffe9('0x48')][_0xffe9('0x4e')],'role':_0xffe9('0x5c')},'attributes':['id',_0xffe9('0x27'),_0xffe9('0x5d'),'email',_0xffe9('0x5e')],'raw':!![]});}return null;})['then'](function(_0x3b609b){if(!_0x3b609b)return null;_0x1cb4cb[_0xffe9('0x18')][_0xffe9('0x5c')]=_0x3b609b;return _0x1cb4cb;})[_0xffe9('0x10')](function(_0x1501db){if(_0x1501db){_0x1501db[_0xffe9('0x18')][_0xffe9('0x5f')]=util[_0xffe9('0x60')]('SIP/%s',_0x58167e[_0xffe9('0x4f')][_0xffe9('0x27')]);_0x1501db[_0xffe9('0x18')][_0xffe9('0x61')]=_0x1cb4cb[_0xffe9('0x61')];_0x1501db[_0xffe9('0x18')][_0xffe9('0x62')]=_0x1cb4cb['channel'];_0x1501db[_0xffe9('0x18')]['event']=_0xffe9('0x4d');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_['merge'](_0x1cb4cb[_0xffe9('0x18')],JSON['parse'](_0x1cb4cb[_0xffe9('0x53')][_0xffe9('0x63')]))},client9002);return _0x1cb4cb;}return null;})[_0xffe9('0x10')](respondWithResult(_0x1a92ef,null))['catch'](handleError(_0x1a92ef,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 12632ed..a671353 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 _0x10f0=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x1c4409,_0x3b2e8f){var _0x356d8f=function(_0xae43bf){while(--_0xae43bf){_0x1c4409['push'](_0x1c4409['shift']());}};_0x356d8f(++_0x3b2e8f);}(_0x10f0,0x1ad));var _0x010f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x10f0[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x010f('0x0'));var ChatMessage=require(_0x010f('0x1'))['db'][_0x010f('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x010f('0x3')](0x0);var events={'afterCreate':_0x010f('0x4'),'afterUpdate':_0x010f('0x5'),'afterDestroy':_0x010f('0x6')};function emitEvent(_0x593446){return function(_0x17b65d,_0x297fe3,_0x172316){ChatMessageEvents[_0x010f('0x7')](_0x593446+':'+_0x17b65d['id'],_0x17b65d);ChatMessageEvents[_0x010f('0x7')](_0x593446,_0x17b65d);_0x172316(null);};}for(var e in events){if(events[_0x010f('0x8')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x010f('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0xaf6f=['emit','hasOwnProperty','exports','ChatMessage','save','update'];(function(_0xfbe06e,_0x2fb7ab){var _0x24e5b6=function(_0x48569f){while(--_0x48569f){_0xfbe06e['push'](_0xfbe06e['shift']());}};_0x24e5b6(++_0x2fb7ab);}(_0xaf6f,0x12f));var _0xfaf6=function(_0x3fe9a5,_0x5d6fb7){_0x3fe9a5=_0x3fe9a5-0x0;var _0x61444e=_0xaf6f[_0x3fe9a5];return _0x61444e;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0xfaf6('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfaf6('0x1'),'afterUpdate':_0xfaf6('0x2'),'afterDestroy':'remove'};function emitEvent(_0x177ddb){return function(_0x3f6a74,_0x5be592,_0x278f8b){ChatMessageEvents[_0xfaf6('0x3')](_0x177ddb+':'+_0x3f6a74['id'],_0x3f6a74);ChatMessageEvents[_0xfaf6('0x3')](_0x177ddb,_0x3f6a74);_0x278f8b(null);};}for(var e in events){if(events[_0xfaf6('0x4')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xfaf6('0x5')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 655ac27..d6c5055 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 _0xa2cf=['rimraf','./chatMessage.attributes','exports','define','chat_messages','FULLTEXT','models','get','direction','isNil','findOne','ChatInteractionId','update','createdAt','toLowerCase','catch','error','utf8mb4','lodash','util','api','moment','bluebird','request-promise'];(function(_0x20645f,_0x5688f0){var _0xf0485b=function(_0x4220af){while(--_0x4220af){_0x20645f['push'](_0x20645f['shift']());}};_0xf0485b(++_0x5688f0);}(_0xa2cf,0x162));var _0xfa2c=function(_0x107c87,_0x366dfe){_0x107c87=_0x107c87-0x0;var _0x13795f=_0xa2cf[_0x107c87];return _0x13795f;};'use strict';var _=require(_0xfa2c('0x0'));var util=require(_0xfa2c('0x1'));var logger=require('../../config/logger')(_0xfa2c('0x2'));var moment=require(_0xfa2c('0x3'));var BPromise=require(_0xfa2c('0x4'));var rp=require(_0xfa2c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa2c('0x6'));var config=require('../../config/environment');var attributes=require(_0xfa2c('0x7'));module[_0xfa2c('0x8')]=function(_0x47b668,_0x490734){return _0x47b668[_0xfa2c('0x9')]('ChatMessage',attributes,{'tableName':_0xfa2c('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xfa2c('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x45bab3,_0x32e7e7,_0x9a0c8e){var _0x43cdde=_0x47b668[_0xfa2c('0xc')];var _0x3ccdc9=_0x45bab3[_0xfa2c('0xd')]({'plain':!![]});if(_0x3ccdc9[_0xfa2c('0xe')]['toLowerCase']()==='in'||_0x3ccdc9[_0xfa2c('0xe')]['toLowerCase']()==='out'&&!_0x3ccdc9['secret']&&!_[_0xfa2c('0xf')](_0x3ccdc9['UserId'])){_0x43cdde['ChatInteraction'][_0xfa2c('0x10')]({'where':{'id':_0x3ccdc9[_0xfa2c('0x11')]}})['then'](function(_0x2d544f){if(_0x2d544f){_0x2d544f[_0xfa2c('0x12')]({'lastMsgAt':_0x3ccdc9[_0xfa2c('0x13')],'lastMsgDirection':_0x3ccdc9[_0xfa2c('0xe')][_0xfa2c('0x14')]()});}})[_0xfa2c('0x15')](function(_0x3b09ef){console[_0xfa2c('0x16')](_0x3b09ef);});}_0x9a0c8e();}},'charset':_0xfa2c('0x17'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x73d8=['direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch','error','lodash','util','api','bluebird','request-promise','path','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get'];(function(_0x1e7701,_0x13fd0f){var _0x3ab707=function(_0x3c5242){while(--_0x3c5242){_0x1e7701['push'](_0x1e7701['shift']());}};_0x3ab707(++_0x13fd0f);}(_0x73d8,0x109));var _0x873d=function(_0x2f5ff2,_0x5b7e4b){_0x2f5ff2=_0x2f5ff2-0x0;var _0x1d9564=_0x73d8[_0x2f5ff2];return _0x1d9564;};'use strict';var _=require(_0x873d('0x0'));var util=require(_0x873d('0x1'));var logger=require('../../config/logger')(_0x873d('0x2'));var moment=require('moment');var BPromise=require(_0x873d('0x3'));var rp=require(_0x873d('0x4'));var fs=require('fs');var path=require(_0x873d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x873d('0x6'));module[_0x873d('0x7')]=function(_0x460222,_0x14e988){return _0x460222[_0x873d('0x8')](_0x873d('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x873d('0xa'),'fields':[_0x873d('0xb')],'type':_0x873d('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38d40f,_0x208068,_0x321257){var _0xb25f=_0x460222[_0x873d('0xd')];var _0x252092=_0x38d40f[_0x873d('0xe')]({'plain':!![]});if(_0x252092[_0x873d('0xf')][_0x873d('0x10')]()==='in'||_0x252092['direction'][_0x873d('0x10')]()===_0x873d('0x11')&&!_0x252092[_0x873d('0x12')]&&!_[_0x873d('0x13')](_0x252092[_0x873d('0x14')])){_0xb25f[_0x873d('0x15')][_0x873d('0x16')]({'where':{'id':_0x252092['ChatInteractionId']}})[_0x873d('0x17')](function(_0x57c11b){if(_0x57c11b){_0x57c11b[_0x873d('0x18')]({'lastMsgAt':_0x252092[_0x873d('0x19')],'lastMsgDirection':_0x252092[_0x873d('0xf')][_0x873d('0x10')]()});}})[_0x873d('0x1a')](function(_0x2ceb11){console[_0x873d('0x1b')](_0x2ceb11);});}_0x321257();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 2261238..d26cd06 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 _0x7d6f=['raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','./chatMessage.socket','register','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ChatMessage','create','body','options'];(function(_0x5389e4,_0x4d98b2){var _0x521efc=function(_0x285e3f){while(--_0x285e3f){_0x5389e4['push'](_0x5389e4['shift']());}};_0x521efc(++_0x4d98b2);}(_0x7d6f,0x194));var _0xf7d6=function(_0x3ce0ae,_0x2f0041){_0x3ce0ae=_0x3ce0ae-0x0;var _0x150999=_0x7d6f[_0x3ce0ae];return _0x150999;};'use strict';var _=require(_0xf7d6('0x0'));var util=require(_0xf7d6('0x1'));var moment=require(_0xf7d6('0x2'));var BPromise=require(_0xf7d6('0x3'));var rs=require(_0xf7d6('0x4'));var fs=require('fs');var Redis=require(_0xf7d6('0x5'));var db=require(_0xf7d6('0x6'))['db'];var utils=require(_0xf7d6('0x7'));var logger=require(_0xf7d6('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf7d6('0x9'));var client=jayson['client'][_0xf7d6('0xa')]({'port':0x232a});config[_0xf7d6('0xb')]=_[_0xf7d6('0xc')](config['redis'],{'host':_0xf7d6('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf7d6('0xb')]));require(_0xf7d6('0xe'))[_0xf7d6('0xf')](socket);function respondWithRpcPromise(_0x4e1fa8,_0x2c2981,_0x2c9da9){return new BPromise(function(_0x159897,_0x1ab4c1){return client['request'](_0x4e1fa8,_0x2c9da9)['then'](function(_0x4d91f7){logger[_0xf7d6('0x10')](_0xf7d6('0x11'),_0x2c2981,_0xf7d6('0x12'));logger[_0xf7d6('0x13')](_0xf7d6('0x14'),_0x2c2981,_0xf7d6('0x12'),JSON[_0xf7d6('0x15')](_0x4d91f7));if(_0x4d91f7[_0xf7d6('0x16')]){if(_0x4d91f7[_0xf7d6('0x16')][_0xf7d6('0x17')]===0x1f4){logger[_0xf7d6('0x16')](_0xf7d6('0x11'),_0x2c2981,_0x4d91f7[_0xf7d6('0x16')][_0xf7d6('0x18')]);return _0x1ab4c1(_0x4d91f7[_0xf7d6('0x16')]['message']);}logger[_0xf7d6('0x16')](_0xf7d6('0x11'),_0x2c2981,_0x4d91f7['error'][_0xf7d6('0x18')]);return _0x159897(_0x4d91f7['error'][_0xf7d6('0x18')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x2c2981,_0xf7d6('0x12'));_0x159897(_0x4d91f7['result'][_0xf7d6('0x18')]);}})[_0xf7d6('0x19')](function(_0x1f8478){logger[_0xf7d6('0x16')](_0xf7d6('0x11'),_0x2c2981,_0x1f8478);_0x1ab4c1(_0x1f8478);});});}exports['CreateChatMessage']=function(_0x25d25){var _0x394468=this;return new Promise(function(_0x5228a0,_0x24ef09){return db[_0xf7d6('0x1a')][_0xf7d6('0x1b')](_0x25d25[_0xf7d6('0x1c')],{'raw':_0x25d25[_0xf7d6('0x1d')]?_0x25d25['options'][_0xf7d6('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x54ce16){logger[_0xf7d6('0x10')]('CreateChatMessage',_0x25d25);logger['debug']('CreateChatMessage',_0x25d25,JSON[_0xf7d6('0x15')](_0x54ce16));_0x5228a0(_0x54ce16);})[_0xf7d6('0x19')](function(_0x14552a){logger[_0xf7d6('0x16')]('CreateChatMessage',_0x14552a['message'],_0x25d25);_0x24ef09(_0x394468[_0xf7d6('0x16')](0x1f4,_0x14552a['message']));});});};
\ No newline at end of file
+var _0xcf3b=['result','catch','ChatMessage','create','options','raw','CreateChatMessage','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcf3b,0x7f));var _0xbcf3=function(_0x93b175,_0x448d4c){_0x93b175=_0x93b175-0x0;var _0x5f2532=_0xcf3b[_0x93b175];return _0x5f2532;};'use strict';var _=require('lodash');var util=require(_0xbcf3('0x0'));var moment=require(_0xbcf3('0x1'));var BPromise=require(_0xbcf3('0x2'));var rs=require(_0xbcf3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbcf3('0x4'))['db'];var utils=require(_0xbcf3('0x5'));var logger=require(_0xbcf3('0x6'))(_0xbcf3('0x7'));var config=require(_0xbcf3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbcf3('0x9')]['http']({'port':0x232a});config['redis']=_[_0xbcf3('0xa')](config[_0xbcf3('0xb')],{'host':_0xbcf3('0xc'),'port':0x18eb});var socket=require(_0xbcf3('0xd'))(new Redis(config[_0xbcf3('0xb')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x5181bf,_0x33a0df,_0x4a4660){return new BPromise(function(_0x27de0f,_0x2a5526){return client['request'](_0x5181bf,_0x4a4660)[_0xbcf3('0xe')](function(_0x561fe7){logger[_0xbcf3('0xf')](_0xbcf3('0x10'),_0x33a0df,_0xbcf3('0x11'));logger[_0xbcf3('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x33a0df,'request\x20sent',JSON[_0xbcf3('0x13')](_0x561fe7));if(_0x561fe7['error']){if(_0x561fe7[_0xbcf3('0x14')][_0xbcf3('0x15')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x33a0df,_0x561fe7[_0xbcf3('0x14')][_0xbcf3('0x16')]);return _0x2a5526(_0x561fe7['error'][_0xbcf3('0x16')]);}logger[_0xbcf3('0x14')](_0xbcf3('0x10'),_0x33a0df,_0x561fe7[_0xbcf3('0x14')][_0xbcf3('0x16')]);return _0x27de0f(_0x561fe7[_0xbcf3('0x14')]['message']);}else{logger[_0xbcf3('0xf')]('ChatMessage,\x20%s,\x20%s',_0x33a0df,_0xbcf3('0x11'));_0x27de0f(_0x561fe7[_0xbcf3('0x17')][_0xbcf3('0x16')]);}})[_0xbcf3('0x18')](function(_0x355f0d){logger[_0xbcf3('0x14')](_0xbcf3('0x10'),_0x33a0df,_0x355f0d);_0x2a5526(_0x355f0d);});});}exports['CreateChatMessage']=function(_0x55f3f4){var _0x5093b3=this;return new Promise(function(_0xf5b359,_0x428e6e){return db[_0xbcf3('0x19')][_0xbcf3('0x1a')](_0x55f3f4['body'],{'raw':_0x55f3f4['options']?_0x55f3f4[_0xbcf3('0x1b')][_0xbcf3('0x1c')]===undefined?!![]:![]:!![]})[_0xbcf3('0xe')](function(_0x22c0c2){logger['info']('CreateChatMessage',_0x55f3f4);logger[_0xbcf3('0x12')]('CreateChatMessage',_0x55f3f4,JSON[_0xbcf3('0x13')](_0x22c0c2));_0xf5b359(_0x22c0c2);})['catch'](function(_0x49dcb9){logger[_0xbcf3('0x14')](_0xbcf3('0x1d'),_0x49dcb9['message'],_0x55f3f4);_0x428e6e(_0x5093b3[_0xbcf3('0x14')](0x1f4,_0x49dcb9[_0xbcf3('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 5242fa7..6bc4db1 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 _0x7923=['register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x79c6de,_0x10de94){var _0x321a56=function(_0x2e313e){while(--_0x2e313e){_0x79c6de['push'](_0x79c6de['shift']());}};_0x321a56(++_0x10de94);}(_0x7923,0x8f));var _0x3792=function(_0x4716b0,_0x167fe7){_0x4716b0=_0x4716b0-0x0;var _0x3d59c1=_0x7923[_0x4716b0];return _0x3d59c1;};'use strict';var ChatMessageEvents=require(_0x3792('0x0'));var events=[_0x3792('0x1'),_0x3792('0x2'),_0x3792('0x3')];function createListener(_0xfd3952,_0xf88b72){return function(_0x3bdefe){_0xf88b72['emit'](_0xfd3952,_0x3bdefe);};}function removeListener(_0x21134d,_0x51d334){return function(){ChatMessageEvents['removeListener'](_0x21134d,_0x51d334);};}exports[_0x3792('0x4')]=function(_0x4f98c6){for(var _0x326cc2=0x0,_0x18b993=events[_0x3792('0x5')];_0x326cc2<_0x18b993;_0x326cc2++){var _0x5b55f8=events[_0x326cc2];var _0x5b453a=createListener(_0x3792('0x6')+_0x5b55f8,_0x4f98c6);ChatMessageEvents['on'](_0x5b55f8,_0x5b453a);}};
\ No newline at end of file
+var _0x88d5=['remove','update','emit','removeListener','register','chatMessage:','./chatMessage.events','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x88d5,0x76));var _0x588d=function(_0x35ad07,_0x4b6cc4){_0x35ad07=_0x35ad07-0x0;var _0x5346ee=_0x88d5[_0x35ad07];return _0x5346ee;};'use strict';var ChatMessageEvents=require(_0x588d('0x0'));var events=[_0x588d('0x1'),_0x588d('0x2'),_0x588d('0x3')];function createListener(_0x315178,_0x5372b1){return function(_0xe46c98){_0x5372b1[_0x588d('0x4')](_0x315178,_0xe46c98);};}function removeListener(_0x504b52,_0x474e79){return function(){ChatMessageEvents[_0x588d('0x5')](_0x504b52,_0x474e79);};}exports[_0x588d('0x6')]=function(_0x1b193f){for(var _0xecfb11=0x0,_0x413748=events['length'];_0xecfb11<_0x413748;_0xecfb11++){var _0x57699a=events[_0xecfb11];var _0x41ddf3=createListener(_0x588d('0x7')+_0x57699a,_0x1b193f);ChatMessageEvents['on'](_0x57699a,_0x41ddf3);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index bf85d9c..e7f3884 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 _0x8309=['put','/:id/accept','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatMessage.controller','index','get','/describe','isAuthenticated','show','post','tracked','chatmessage:create','create','/:id','update'];(function(_0x1a51a1,_0x56d77b){var _0x127d55=function(_0x4f6800){while(--_0x4f6800){_0x1a51a1['push'](_0x1a51a1['shift']());}};_0x127d55(++_0x56d77b);}(_0x8309,0x17c));var _0x9830=function(_0x2c1ab8,_0x21ced6){_0x2c1ab8=_0x2c1ab8-0x0;var _0x535c24=_0x8309[_0x2c1ab8];return _0x535c24;};'use strict';var multer=require(_0x9830('0x0'));var util=require(_0x9830('0x1'));var path=require(_0x9830('0x2'));var timeout=require(_0x9830('0x3'));var express=require(_0x9830('0x4'));var router=express[_0x9830('0x5')]();var fs_extra=require(_0x9830('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9830('0x7'));var controller=require(_0x9830('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9830('0x9')]);router[_0x9830('0xa')](_0x9830('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x9830('0xa')]('/:id',auth[_0x9830('0xc')](),controller[_0x9830('0xd')]);router[_0x9830('0xe')]('/',auth[_0x9830('0xc')](),interaction[_0x9830('0xf')]('chat',_0x9830('0x10')),controller[_0x9830('0x11')]);router['put'](_0x9830('0x12'),controller[_0x9830('0x13')]);router[_0x9830('0x14')](_0x9830('0x15'),auth[_0x9830('0xc')](),controller['accept']);router[_0x9830('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0x9830('0x16')]);router['delete'](_0x9830('0x12'),auth[_0x9830('0xc')](),controller[_0x9830('0x17')]);module[_0x9830('0x18')]=router;
\ No newline at end of file
+var _0xa86d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','tracked','chatmessage:create','create','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path'];(function(_0x48f590,_0x4cd55b){var _0x1afde4=function(_0x2b19c3){while(--_0x2b19c3){_0x48f590['push'](_0x48f590['shift']());}};_0x1afde4(++_0x4cd55b);}(_0xa86d,0x8a));var _0xda86=function(_0x1d46de,_0x3dd47f){_0x1d46de=_0x1d46de-0x0;var _0x4516e5=_0xa86d[_0x1d46de];return _0x4516e5;};'use strict';var multer=require(_0xda86('0x0'));var util=require('util');var path=require(_0xda86('0x1'));var timeout=require(_0xda86('0x2'));var express=require(_0xda86('0x3'));var router=express[_0xda86('0x4')]();var fs_extra=require(_0xda86('0x5'));var auth=require(_0xda86('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xda86('0x7'));var controller=require(_0xda86('0x8'));router[_0xda86('0x9')]('/',auth[_0xda86('0xa')](),controller[_0xda86('0xb')]);router[_0xda86('0x9')](_0xda86('0xc'),auth[_0xda86('0xa')](),controller[_0xda86('0xd')]);router[_0xda86('0x9')]('/:id',auth[_0xda86('0xa')](),controller[_0xda86('0xe')]);router[_0xda86('0xf')]('/',auth[_0xda86('0xa')](),interaction[_0xda86('0x10')]('chat',_0xda86('0x11')),controller[_0xda86('0x12')]);router[_0xda86('0x13')](_0xda86('0x14'),controller['update']);router['put'](_0xda86('0x15'),auth['isAuthenticated'](),controller[_0xda86('0x16')]);router[_0xda86('0x13')](_0xda86('0x17'),auth['isAuthenticated'](),controller[_0xda86('0x18')]);router[_0xda86('0x19')](_0xda86('0x14'),auth[_0xda86('0xa')](),controller[_0xda86('0x1a')]);module[_0xda86('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 6240840..eb4bb86 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['medium','sequelize','TEXT'];(function(_0x1dfe92,_0x4960a4){var _0x15d6b0=function(_0x1675f1){while(--_0x1675f1){_0x1dfe92['push'](_0x1dfe92['shift']());}};_0x15d6b0(++_0x4960a4);}(_0xb10b,0x12a));var _0xbb10=function(_0x4e1926,_0x2415d6){_0x4e1926=_0x4e1926-0x0;var _0x85fa41=_0xb10b[_0x4e1926];return _0x85fa41;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0xadb5=['medium','TEXT','exports'];(function(_0x149e88,_0x264145){var _0x26a5a6=function(_0x489294){while(--_0x489294){_0x149e88['push'](_0x149e88['shift']());}};_0x26a5a6(++_0x264145);}(_0xadb5,0xad));var _0x5adb=function(_0x4f158e,_0x3910bd){_0x4f158e=_0x4f158e-0x0;var _0x52ad37=_0xadb5[_0x4f158e];return _0x52ad37;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('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 e87e9c1..24dee62 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x7a54,0x106));var _0x47a5=function(_0x4abcef,_0xbcf2d7){_0x4abcef=_0x4abcef-0x0;var _0x3e4ebc=_0x7a54[_0x4abcef];return _0x3e4ebc;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x7a54,0x106));var _0x47a5=function(_0x48dfab,_0x539679){_0x48dfab=_0x48dfab-0x0;var _0x2fa30f=_0x7a54[_0x48dfab];return _0x2fa30f;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 489426e..38ef9b3 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 _0xc7dd=['exports','events','../../mysqldb','setMaxListeners','remove','hasOwnProperty'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xc7dd,0x15d));var _0xdc7d=function(_0x311aad,_0x54d658){_0x311aad=_0x311aad-0x0;var _0x1779bd=_0xc7dd[_0x311aad];return _0x1779bd;};'use strict';var EventEmitter=require(_0xdc7d('0x0'));var ChatOfflineMessage=require(_0xdc7d('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xdc7d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xdc7d('0x3')};function emitEvent(_0x2b0318){return function(_0x4bc843,_0x24f3e7,_0x84a50){ChatOfflineMessageEvents['emit'](_0x2b0318+':'+_0x4bc843['id'],_0x4bc843);ChatOfflineMessageEvents['emit'](_0x2b0318,_0x4bc843);_0x84a50(null);};}for(var e in events){if(events[_0xdc7d('0x4')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xdc7d('0x5')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x9dbe=['save','update','remove','emit','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x1244c6,_0x4770d0){var _0x1e0a72=function(_0x61ba95){while(--_0x61ba95){_0x1244c6['push'](_0x1244c6['shift']());}};_0x1e0a72(++_0x4770d0);}(_0x9dbe,0x174));var _0xe9db=function(_0x465089,_0x823030){_0x465089=_0x465089-0x0;var _0x3c47ba=_0x9dbe[_0x465089];return _0x3c47ba;};'use strict';var EventEmitter=require(_0xe9db('0x0'));var ChatOfflineMessage=require(_0xe9db('0x1'))['db'][_0xe9db('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xe9db('0x3')](0x0);var events={'afterCreate':_0xe9db('0x4'),'afterUpdate':_0xe9db('0x5'),'afterDestroy':_0xe9db('0x6')};function emitEvent(_0x383073){return function(_0x1ff6a5,_0x117f8f,_0x383196){ChatOfflineMessageEvents[_0xe9db('0x7')](_0x383073+':'+_0x1ff6a5['id'],_0x1ff6a5);ChatOfflineMessageEvents[_0xe9db('0x7')](_0x383073,_0x1ff6a5);_0x383196(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index dda2d63..48df32a 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 _0xd47d=['ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x1a6519,_0x395572){var _0x300b42=function(_0x24b243){while(--_0x24b243){_0x1a6519['push'](_0x1a6519['shift']());}};_0x300b42(++_0x395572);}(_0xd47d,0x1c5));var _0xdd47=function(_0x2307fa,_0x266e5e){_0x2307fa=_0x2307fa-0x0;var _0x496486=_0xd47d[_0x2307fa];return _0x496486;};'use strict';var attributes=require(_0xdd47('0x0'));module[_0xdd47('0x1')]=function(_0x341c88){return _0x341c88['define'](_0xdd47('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdd47('0x3'),'collate':_0xdd47('0x4')});};
\ No newline at end of file
+var _0x8406=['chat_offline_messages','./chatOfflineMessage.attributes','exports','define'];(function(_0x19c14f,_0x262416){var _0x4bdba3=function(_0x3f18f4){while(--_0x3f18f4){_0x19c14f['push'](_0x19c14f['shift']());}};_0x4bdba3(++_0x262416);}(_0x8406,0x18d));var _0x6840=function(_0x1870ed,_0x44b070){_0x1870ed=_0x1870ed-0x0;var _0x495d32=_0x8406[_0x1870ed];return _0x495d32;};'use strict';var attributes=require(_0x6840('0x0'));module[_0x6840('0x1')]=function(_0x3c3022){return _0x3c3022[_0x6840('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x6840('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 87615cf..dc68984 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 _0xdfe7=['../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x56ee15,_0x1effd1){var _0x94991f=function(_0x5018fa){while(--_0x5018fa){_0x56ee15['push'](_0x56ee15['shift']());}};_0x94991f(++_0x1effd1);}(_0xdfe7,0xc8));var _0x7dfe=function(_0x2ec81f,_0x34004c){_0x2ec81f=_0x2ec81f-0x0;var _0x1039ce=_0xdfe7[_0x2ec81f];return _0x1039ce;};'use strict';var _=require('lodash');var util=require(_0x7dfe('0x0'));var moment=require(_0x7dfe('0x1'));var BPromise=require('bluebird');var rs=require(_0x7dfe('0x2'));var fs=require('fs');var Redis=require(_0x7dfe('0x3'));var db=require(_0x7dfe('0x4'))['db'];var utils=require(_0x7dfe('0x5'));var logger=require('../../config/logger')(_0x7dfe('0x6'));var config=require(_0x7dfe('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7dfe('0x8')][_0x7dfe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23d0c1,_0x2163fc,_0x56d67e){return new BPromise(function(_0x3fc0a0,_0x37705a){return client[_0x7dfe('0xa')](_0x23d0c1,_0x56d67e)[_0x7dfe('0xb')](function(_0x52040d){logger[_0x7dfe('0xc')](_0x7dfe('0xd'),_0x2163fc,_0x7dfe('0xe'));logger[_0x7dfe('0xf')](_0x7dfe('0x10'),_0x2163fc,'request\x20sent',JSON[_0x7dfe('0x11')](_0x52040d));if(_0x52040d[_0x7dfe('0x12')]){if(_0x52040d[_0x7dfe('0x12')][_0x7dfe('0x13')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x2163fc,_0x52040d[_0x7dfe('0x12')]['message']);return _0x37705a(_0x52040d['error'][_0x7dfe('0x14')]);}logger['error'](_0x7dfe('0xd'),_0x2163fc,_0x52040d[_0x7dfe('0x12')][_0x7dfe('0x14')]);return _0x3fc0a0(_0x52040d['error'][_0x7dfe('0x14')]);}else{logger[_0x7dfe('0xc')](_0x7dfe('0xd'),_0x2163fc,_0x7dfe('0xe'));_0x3fc0a0(_0x52040d[_0x7dfe('0x15')][_0x7dfe('0x14')]);}})[_0x7dfe('0x16')](function(_0x225fef){logger[_0x7dfe('0x12')](_0x7dfe('0xd'),_0x2163fc,_0x225fef);_0x37705a(_0x225fef);});});}
\ No newline at end of file
+var _0xcbd2=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x50f157,_0x280833){var _0x7e0178=function(_0x14eaf1){while(--_0x14eaf1){_0x50f157['push'](_0x50f157['shift']());}};_0x7e0178(++_0x280833);}(_0xcbd2,0xb9));var _0x2cbd=function(_0x45c48f,_0x4aa891){_0x45c48f=_0x45c48f-0x0;var _0xaf5037=_0xcbd2[_0x45c48f];return _0xaf5037;};'use strict';var _=require(_0x2cbd('0x0'));var util=require(_0x2cbd('0x1'));var moment=require(_0x2cbd('0x2'));var BPromise=require(_0x2cbd('0x3'));var rs=require(_0x2cbd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2cbd('0x5'))['db'];var utils=require(_0x2cbd('0x6'));var logger=require(_0x2cbd('0x7'))(_0x2cbd('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2cbd('0x9')][_0x2cbd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2233f3,_0x27aa9f,_0x39dc17){return new BPromise(function(_0x4b35b0,_0x1dac7c){return client[_0x2cbd('0xb')](_0x2233f3,_0x39dc17)[_0x2cbd('0xc')](function(_0x2cfd1e){logger[_0x2cbd('0xd')](_0x2cbd('0xe'),_0x27aa9f,_0x2cbd('0xf'));logger[_0x2cbd('0x10')](_0x2cbd('0x11'),_0x27aa9f,_0x2cbd('0xf'),JSON['stringify'](_0x2cfd1e));if(_0x2cfd1e[_0x2cbd('0x12')]){if(_0x2cfd1e[_0x2cbd('0x12')][_0x2cbd('0x13')]===0x1f4){logger[_0x2cbd('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x27aa9f,_0x2cfd1e[_0x2cbd('0x12')][_0x2cbd('0x14')]);return _0x1dac7c(_0x2cfd1e[_0x2cbd('0x12')][_0x2cbd('0x14')]);}logger[_0x2cbd('0x12')](_0x2cbd('0xe'),_0x27aa9f,_0x2cfd1e['error']['message']);return _0x4b35b0(_0x2cfd1e['error']['message']);}else{logger[_0x2cbd('0xd')](_0x2cbd('0xe'),_0x27aa9f,_0x2cbd('0xf'));_0x4b35b0(_0x2cfd1e[_0x2cbd('0x15')]['message']);}})[_0x2cbd('0x16')](function(_0x5df532){logger[_0x2cbd('0x12')](_0x2cbd('0xe'),_0x27aa9f,_0x5df532);_0x1dac7c(_0x5df532);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 3da28ff..1cd2573 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 _0xb2a1=['put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','post'];(function(_0x13c147,_0x2f9e09){var _0x494688=function(_0x47941a){while(--_0x47941a){_0x13c147['push'](_0x13c147['shift']());}};_0x494688(++_0x2f9e09);}(_0xb2a1,0x121));var _0x1b2a=function(_0x301fa3,_0x438b73){_0x301fa3=_0x301fa3-0x0;var _0x28a9d6=_0xb2a1[_0x301fa3];return _0x28a9d6;};'use strict';var multer=require('multer');var util=require(_0x1b2a('0x0'));var path=require(_0x1b2a('0x1'));var timeout=require(_0x1b2a('0x2'));var express=require(_0x1b2a('0x3'));var router=express[_0x1b2a('0x4')]();var fs_extra=require(_0x1b2a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1b2a('0x6'));var config=require(_0x1b2a('0x7'));var controller=require(_0x1b2a('0x8'));router[_0x1b2a('0x9')]('/',auth[_0x1b2a('0xa')](),controller[_0x1b2a('0xb')]);router[_0x1b2a('0x9')]('/describe',auth[_0x1b2a('0xa')](),controller[_0x1b2a('0xc')]);router[_0x1b2a('0x9')](_0x1b2a('0xd'),auth[_0x1b2a('0xa')](),controller['show']);router[_0x1b2a('0xe')]('/',auth[_0x1b2a('0xa')](),controller['create']);router[_0x1b2a('0xf')](_0x1b2a('0xd'),auth[_0x1b2a('0xa')](),controller['update']);router[_0x1b2a('0x10')](_0x1b2a('0xd'),auth[_0x1b2a('0xa')](),controller[_0x1b2a('0x11')]);module[_0x1b2a('0x12')]=router;
\ No newline at end of file
+var _0x8728=['../../components/auth/service','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','express','Router','fs-extra'];(function(_0x58ff61,_0x3f18cc){var _0x7eaddc=function(_0x40eb3c){while(--_0x40eb3c){_0x58ff61['push'](_0x58ff61['shift']());}};_0x7eaddc(++_0x3f18cc);}(_0x8728,0x12d));var _0x8872=function(_0x55b06f,_0xedbba2){_0x55b06f=_0x55b06f-0x0;var _0x5b2bcb=_0x8728[_0x55b06f];return _0x5b2bcb;};'use strict';var multer=require(_0x8872('0x0'));var util=require(_0x8872('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8872('0x2'));var router=express[_0x8872('0x3')]();var fs_extra=require(_0x8872('0x4'));var auth=require(_0x8872('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x8872('0x6')]('/',auth[_0x8872('0x7')](),controller['index']);router[_0x8872('0x6')](_0x8872('0x8'),auth['isAuthenticated'](),controller[_0x8872('0x9')]);router[_0x8872('0x6')]('/:id',auth[_0x8872('0x7')](),controller[_0x8872('0xa')]);router[_0x8872('0xb')]('/',auth[_0x8872('0x7')](),controller[_0x8872('0xc')]);router[_0x8872('0xd')](_0x8872('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x8872('0xf')](_0x8872('0xe'),auth[_0x8872('0x7')](),controller[_0x8872('0x10')]);module[_0x8872('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 0ea4f98..406aad2 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 _0xfad6=['sequelize','exports','timeout','mouseOver','STRING','INTEGER'];(function(_0x3501fc,_0x9cd204){var _0x4a0a3e=function(_0x14bf41){while(--_0x14bf41){_0x3501fc['push'](_0x3501fc['shift']());}};_0x4a0a3e(++_0x9cd204);}(_0xfad6,0xe4));var _0x6fad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfad6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6fad('0x0'));module[_0x6fad('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x6fad('0x2')),'defaultValue':_0x6fad('0x3')},'selector':{'type':Sequelize[_0x6fad('0x4')]},'timeout':{'type':Sequelize[_0x6fad('0x5')]}};
\ No newline at end of file
+var _0x3f90=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x182282,_0x4ba450){var _0x1362ab=function(_0x2b8f8d){while(--_0x2b8f8d){_0x182282['push'](_0x182282['shift']());}};_0x1362ab(++_0x4ba450);}(_0x3f90,0xd1));var _0x03f9=function(_0x543749,_0xcb3921){_0x543749=_0x543749-0x0;var _0x558041=_0x3f90[_0x543749];return _0x558041;};'use strict';var Sequelize=require(_0x03f9('0x0'));module[_0x03f9('0x1')]={'name':{'type':Sequelize[_0x03f9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x03f9('0x3')](_0x03f9('0x4'),_0x03f9('0x5')),'defaultValue':_0x03f9('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x03f9('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index d35c9c8..0d28cd9 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 _0x6726=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','sendStatus','error','name','params','keys','rawAttributes','query','filters','model','intersection','fields','attributes','length','include','options','ChatProactiveAction','find','catch','body','rimraf','zip-dir','request-promise','moment','mustache'];(function(_0x21ee8a,_0x1a705c){var _0x5125f4=function(_0x45cef0){while(--_0x45cef0){_0x21ee8a['push'](_0x21ee8a['shift']());}};_0x5125f4(++_0x1a705c);}(_0x6726,0xdb));var _0x6672=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0x6726[_0x5a1a51];return _0x47edd7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6672('0x0'));var zipdir=require(_0x6672('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6672('0x2'));var moment=require(_0x6672('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6672('0x4'));var util=require('util');var path=require(_0x6672('0x5'));var sox=require(_0x6672('0x6'));var csv=require(_0x6672('0x7'));var ejs=require(_0x6672('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6672('0x9'));var squel=require(_0x6672('0xa'));var crypto=require(_0x6672('0xb'));var jsforce=require(_0x6672('0xc'));var deskjs=require(_0x6672('0xd'));var toCsv=require(_0x6672('0x7'));var querystring=require(_0x6672('0xe'));var Papa=require(_0x6672('0xf'));var Redis=require(_0x6672('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6672('0x11'));var as=require(_0x6672('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6672('0x13'))(_0x6672('0x14'));var utils=require(_0x6672('0x15'));var config=require(_0x6672('0x16'));var licenseUtil=require(_0x6672('0x17'));var db=require(_0x6672('0x18'))['db'];function respondWithStatusCode(_0x182b77,_0x2dbf18){_0x2dbf18=_0x2dbf18||0xcc;return function(_0x2ec0bd){if(_0x2ec0bd){return _0x182b77['sendStatus'](_0x2dbf18);}return _0x182b77[_0x6672('0x19')](_0x2dbf18)[_0x6672('0x1a')]();};}function respondWithResult(_0x3e45de,_0x40f310){_0x40f310=_0x40f310||0xc8;return function(_0x1e3eb0){if(_0x1e3eb0){return _0x3e45de[_0x6672('0x19')](_0x40f310)[_0x6672('0x1b')](_0x1e3eb0);}};}function respondWithFilteredResult(_0x514097,_0xbf2cce){return function(_0x3261c9){if(_0x3261c9){var _0x46b6cb=typeof _0xbf2cce[_0x6672('0x1c')]===_0x6672('0x1d')&&typeof _0xbf2cce[_0x6672('0x1e')]===_0x6672('0x1d');var _0x184a79=_0x3261c9['count'];var _0x1a6d2a=_0x46b6cb?0x0:_0xbf2cce[_0x6672('0x1c')];var _0x344300=_0x46b6cb?_0x3261c9[_0x6672('0x1f')]:_0xbf2cce['offset']+_0xbf2cce[_0x6672('0x1e')];var _0x52b617;if(_0x344300>=_0x184a79){_0x344300=_0x184a79;_0x52b617=0xc8;}else{_0x52b617=0xce;}_0x514097[_0x6672('0x19')](_0x52b617);return _0x514097['set'](_0x6672('0x20'),_0x1a6d2a+'-'+_0x344300+'/'+_0x184a79)[_0x6672('0x1b')](_0x3261c9);}return null;};}function patchUpdates(_0x50e8c2){return function(_0x636fed){try{jsonpatch[_0x6672('0x21')](_0x636fed,_0x50e8c2,!![]);}catch(_0x3c23d5){return BPromise['reject'](_0x3c23d5);}return _0x636fed['save']();};}function saveUpdates(_0x1b221c,_0x12fa16){return function(_0x255212){if(_0x255212){return _0x255212[_0x6672('0x22')](_0x1b221c)[_0x6672('0x23')](function(_0xd2d057){return _0xd2d057;});}return null;};}function removeEntity(_0x35e285,_0x124bb5){return function(_0x1252de){if(_0x1252de){return _0x1252de[_0x6672('0x24')]()[_0x6672('0x23')](function(){_0x35e285[_0x6672('0x19')](0xcc)[_0x6672('0x1a')]();});}};}function handleEntityNotFound(_0x1c2886,_0x387614){return function(_0x37e76e){if(!_0x37e76e){_0x1c2886[_0x6672('0x25')](0x194);}return _0x37e76e;};}function handleError(_0x19d58c,_0x1f4c29){_0x1f4c29=_0x1f4c29||0x1f4;return function(_0x4ed516){logger[_0x6672('0x26')](_0x4ed516['stack']);if(_0x4ed516[_0x6672('0x27')]){delete _0x4ed516['name'];}_0x19d58c[_0x6672('0x19')](_0x1f4c29)['send'](_0x4ed516);};}exports['show']=function(_0x4fcd14,_0x302306){var _0x39da71={'raw':!![],'where':{'id':_0x4fcd14[_0x6672('0x28')]['id']}},_0x2a3e42={};_0x2a3e42['model']=_[_0x6672('0x29')](db['ChatProactiveAction'][_0x6672('0x2a')]);_0x2a3e42[_0x6672('0x2b')]=_[_0x6672('0x29')](_0x4fcd14['query']);_0x2a3e42[_0x6672('0x2c')]=_['intersection'](_0x2a3e42[_0x6672('0x2d')],_0x2a3e42['query']);_0x39da71['attributes']=_[_0x6672('0x2e')](_0x2a3e42[_0x6672('0x2d')],qs[_0x6672('0x2f')](_0x4fcd14[_0x6672('0x2b')][_0x6672('0x2f')]));_0x39da71[_0x6672('0x30')]=_0x39da71[_0x6672('0x30')][_0x6672('0x31')]?_0x39da71[_0x6672('0x30')]:_0x2a3e42[_0x6672('0x2d')];if(_0x4fcd14[_0x6672('0x2b')]['includeAll']){_0x39da71[_0x6672('0x32')]=[{'all':!![]}];}_0x39da71=_['merge']({},_0x39da71,_0x4fcd14[_0x6672('0x33')]);return db[_0x6672('0x34')][_0x6672('0x35')](_0x39da71)['then'](handleEntityNotFound(_0x302306,null))[_0x6672('0x23')](respondWithResult(_0x302306,null))[_0x6672('0x36')](handleError(_0x302306,null));};exports['create']=function(_0x4c5849,_0x4fbe1a){return db['ChatProactiveAction']['create'](_0x4c5849['body'],{})['then'](respondWithResult(_0x4fbe1a,0xc9))[_0x6672('0x36')](handleError(_0x4fbe1a,null));};exports[_0x6672('0x22')]=function(_0x21571e,_0x3da7b8){if(_0x21571e[_0x6672('0x37')]['id']){delete _0x21571e['body']['id'];}return db[_0x6672('0x34')][_0x6672('0x35')]({'where':{'id':_0x21571e['params']['id']}})[_0x6672('0x23')](handleEntityNotFound(_0x3da7b8,null))['then'](saveUpdates(_0x21571e[_0x6672('0x37')],null))['then'](respondWithResult(_0x3da7b8,null))['catch'](handleError(_0x3da7b8,null));};exports[_0x6672('0x24')]=function(_0x2856be,_0x53a382){return db[_0x6672('0x34')]['find']({'where':{'id':_0x2856be[_0x6672('0x28')]['id']}})[_0x6672('0x23')](handleEntityNotFound(_0x53a382,null))[_0x6672('0x23')](removeEntity(_0x53a382,null))['catch'](handleError(_0x53a382,null));};
\ No newline at end of file
+var _0xafdd=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','params','model','query','keys','intersection','attributes','fields','includeAll','include','merge','ChatProactiveAction','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x2fc673,_0x522af0){var _0x21d6e2=function(_0x38356e){while(--_0x38356e){_0x2fc673['push'](_0x2fc673['shift']());}};_0x21d6e2(++_0x522af0);}(_0xafdd,0x19a));var _0xdafd=function(_0x1ffa41,_0xc3996b){_0x1ffa41=_0x1ffa41-0x0;var _0x1f3a1a=_0xafdd[_0x1ffa41];return _0x1f3a1a;};'use strict';var emlformat=require(_0xdafd('0x0'));var rimraf=require(_0xdafd('0x1'));var zipdir=require(_0xdafd('0x2'));var jsonpatch=require(_0xdafd('0x3'));var rp=require(_0xdafd('0x4'));var moment=require(_0xdafd('0x5'));var BPromise=require(_0xdafd('0x6'));var Mustache=require(_0xdafd('0x7'));var util=require('util');var path=require(_0xdafd('0x8'));var sox=require(_0xdafd('0x9'));var csv=require(_0xdafd('0xa'));var ejs=require(_0xdafd('0xb'));var fs=require('fs');var fs_extra=require(_0xdafd('0xc'));var _=require(_0xdafd('0xd'));var squel=require(_0xdafd('0xe'));var crypto=require('crypto');var jsforce=require(_0xdafd('0xf'));var deskjs=require(_0xdafd('0x10'));var toCsv=require(_0xdafd('0xa'));var querystring=require('querystring');var Papa=require(_0xdafd('0x11'));var Redis=require(_0xdafd('0x12'));var authService=require(_0xdafd('0x13'));var qs=require(_0xdafd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdafd('0x15'));var logger=require(_0xdafd('0x16'))(_0xdafd('0x17'));var utils=require(_0xdafd('0x18'));var config=require(_0xdafd('0x19'));var licenseUtil=require(_0xdafd('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x166176,_0x594f47){_0x594f47=_0x594f47||0xcc;return function(_0x553508){if(_0x553508){return _0x166176[_0xdafd('0x1b')](_0x594f47);}return _0x166176[_0xdafd('0x1c')](_0x594f47)['end']();};}function respondWithResult(_0x43a716,_0x490382){_0x490382=_0x490382||0xc8;return function(_0x4b09da){if(_0x4b09da){return _0x43a716[_0xdafd('0x1c')](_0x490382)[_0xdafd('0x1d')](_0x4b09da);}};}function respondWithFilteredResult(_0x583b1d,_0x267bfc){return function(_0x186379){if(_0x186379){var _0x496515=typeof _0x267bfc[_0xdafd('0x1e')]===_0xdafd('0x1f')&&typeof _0x267bfc[_0xdafd('0x20')]==='undefined';var _0xb382ca=_0x186379[_0xdafd('0x21')];var _0x4fc3a4=_0x496515?0x0:_0x267bfc['offset'];var _0x2569b2=_0x496515?_0x186379['count']:_0x267bfc[_0xdafd('0x1e')]+_0x267bfc[_0xdafd('0x20')];var _0x1e64d3;if(_0x2569b2>=_0xb382ca){_0x2569b2=_0xb382ca;_0x1e64d3=0xc8;}else{_0x1e64d3=0xce;}_0x583b1d[_0xdafd('0x1c')](_0x1e64d3);return _0x583b1d[_0xdafd('0x22')](_0xdafd('0x23'),_0x4fc3a4+'-'+_0x2569b2+'/'+_0xb382ca)[_0xdafd('0x1d')](_0x186379);}return null;};}function patchUpdates(_0x42e0f9){return function(_0x8480a8){try{jsonpatch[_0xdafd('0x24')](_0x8480a8,_0x42e0f9,!![]);}catch(_0xee767e){return BPromise[_0xdafd('0x25')](_0xee767e);}return _0x8480a8[_0xdafd('0x26')]();};}function saveUpdates(_0xf4a521,_0x491d96){return function(_0x230495){if(_0x230495){return _0x230495['update'](_0xf4a521)[_0xdafd('0x27')](function(_0x5e96cc){return _0x5e96cc;});}return null;};}function removeEntity(_0x439bbf,_0x35ef78){return function(_0x7f10f6){if(_0x7f10f6){return _0x7f10f6[_0xdafd('0x28')]()[_0xdafd('0x27')](function(){_0x439bbf[_0xdafd('0x1c')](0xcc)[_0xdafd('0x29')]();});}};}function handleEntityNotFound(_0x30cba9,_0x3846dd){return function(_0x5cd11d){if(!_0x5cd11d){_0x30cba9[_0xdafd('0x1b')](0x194);}return _0x5cd11d;};}function handleError(_0x2ab575,_0x18554c){_0x18554c=_0x18554c||0x1f4;return function(_0x1feb5b){logger[_0xdafd('0x2a')](_0x1feb5b[_0xdafd('0x2b')]);if(_0x1feb5b[_0xdafd('0x2c')]){delete _0x1feb5b[_0xdafd('0x2c')];}_0x2ab575[_0xdafd('0x1c')](_0x18554c)[_0xdafd('0x2d')](_0x1feb5b);};}exports['show']=function(_0x243182,_0x14626b){var _0x13ab81={'raw':!![],'where':{'id':_0x243182[_0xdafd('0x2e')]['id']}},_0x249743={};_0x249743[_0xdafd('0x2f')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x249743[_0xdafd('0x30')]=_[_0xdafd('0x31')](_0x243182['query']);_0x249743['filters']=_[_0xdafd('0x32')](_0x249743[_0xdafd('0x2f')],_0x249743[_0xdafd('0x30')]);_0x13ab81[_0xdafd('0x33')]=_[_0xdafd('0x32')](_0x249743[_0xdafd('0x2f')],qs[_0xdafd('0x34')](_0x243182['query'][_0xdafd('0x34')]));_0x13ab81[_0xdafd('0x33')]=_0x13ab81[_0xdafd('0x33')]['length']?_0x13ab81[_0xdafd('0x33')]:_0x249743[_0xdafd('0x2f')];if(_0x243182['query'][_0xdafd('0x35')]){_0x13ab81[_0xdafd('0x36')]=[{'all':!![]}];}_0x13ab81=_[_0xdafd('0x37')]({},_0x13ab81,_0x243182['options']);return db[_0xdafd('0x38')][_0xdafd('0x39')](_0x13ab81)[_0xdafd('0x27')](handleEntityNotFound(_0x14626b,null))[_0xdafd('0x27')](respondWithResult(_0x14626b,null))[_0xdafd('0x3a')](handleError(_0x14626b,null));};exports[_0xdafd('0x3b')]=function(_0x3bda9b,_0x5dc9f2){return db[_0xdafd('0x38')][_0xdafd('0x3b')](_0x3bda9b[_0xdafd('0x3c')],{})[_0xdafd('0x27')](respondWithResult(_0x5dc9f2,0xc9))[_0xdafd('0x3a')](handleError(_0x5dc9f2,null));};exports['update']=function(_0x386cf6,_0x21d724){if(_0x386cf6['body']['id']){delete _0x386cf6[_0xdafd('0x3c')]['id'];}return db[_0xdafd('0x38')][_0xdafd('0x39')]({'where':{'id':_0x386cf6[_0xdafd('0x2e')]['id']}})[_0xdafd('0x27')](handleEntityNotFound(_0x21d724,null))[_0xdafd('0x27')](saveUpdates(_0x386cf6[_0xdafd('0x3c')],null))[_0xdafd('0x27')](respondWithResult(_0x21d724,null))[_0xdafd('0x3a')](handleError(_0x21d724,null));};exports[_0xdafd('0x28')]=function(_0x787d7c,_0x245163){return db[_0xdafd('0x38')][_0xdafd('0x39')]({'where':{'id':_0x787d7c[_0xdafd('0x2e')]['id']}})[_0xdafd('0x27')](handleEntityNotFound(_0x245163,null))[_0xdafd('0x27')](removeEntity(_0x245163,null))[_0xdafd('0x3a')](handleError(_0x245163,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 0924258..008ccd7 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 _0x49c9=['bluebird','request-promise','path','./chatProactiveAction.attributes','exports','ChatProactiveAction','lodash','util','../../config/logger','api','moment'];(function(_0x5f04e5,_0x4cebe8){var _0x1703ab=function(_0x4d6d30){while(--_0x4d6d30){_0x5f04e5['push'](_0x5f04e5['shift']());}};_0x1703ab(++_0x4cebe8);}(_0x49c9,0x1be));var _0x949c=function(_0x236d94,_0x2ca004){_0x236d94=_0x236d94-0x0;var _0x51506f=_0x49c9[_0x236d94];return _0x51506f;};'use strict';var _=require(_0x949c('0x0'));var util=require(_0x949c('0x1'));var logger=require(_0x949c('0x2'))(_0x949c('0x3'));var moment=require(_0x949c('0x4'));var BPromise=require(_0x949c('0x5'));var rp=require(_0x949c('0x6'));var fs=require('fs');var path=require(_0x949c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x949c('0x8'));module[_0x949c('0x9')]=function(_0x3e7e41,_0x53ff8a){return _0x3e7e41['define'](_0x949c('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdf81=['bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x433919,_0x4b106a){var _0x192c9f=function(_0x153f4a){while(--_0x153f4a){_0x433919['push'](_0x433919['shift']());}};_0x192c9f(++_0x4b106a);}(_0xdf81,0xcc));var _0x1df8=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xdf81[_0x4b73a2];return _0x383c66;};'use strict';var _=require(_0x1df8('0x0'));var util=require(_0x1df8('0x1'));var logger=require(_0x1df8('0x2'))(_0x1df8('0x3'));var moment=require('moment');var BPromise=require(_0x1df8('0x4'));var rp=require(_0x1df8('0x5'));var fs=require('fs');var path=require(_0x1df8('0x6'));var rimraf=require(_0x1df8('0x7'));var config=require('../../config/environment');var attributes=require(_0x1df8('0x8'));module[_0x1df8('0x9')]=function(_0x23971d,_0xc7a571){return _0x23971d[_0x1df8('0xa')](_0x1df8('0xb'),attributes,{'tableName':_0x1df8('0xc'),'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 5f6de20..f994b15 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 _0x5ecd=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5ecd,0x18a));var _0xd5ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5ecd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd5ec('0x0'));var util=require(_0xd5ec('0x1'));var moment=require(_0xd5ec('0x2'));var BPromise=require(_0xd5ec('0x3'));var rs=require(_0xd5ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd5ec('0x5'))['db'];var utils=require(_0xd5ec('0x6'));var logger=require(_0xd5ec('0x7'))(_0xd5ec('0x8'));var config=require(_0xd5ec('0x9'));var jayson=require(_0xd5ec('0xa'));var client=jayson[_0xd5ec('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x157d1b,_0x28c324,_0x3b666a){return new BPromise(function(_0xedd40d,_0x213bb2){return client[_0xd5ec('0xc')](_0x157d1b,_0x3b666a)[_0xd5ec('0xd')](function(_0x6591a3){logger[_0xd5ec('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x28c324,_0xd5ec('0xf'));logger[_0xd5ec('0x10')](_0xd5ec('0x11'),_0x28c324,_0xd5ec('0xf'),JSON[_0xd5ec('0x12')](_0x6591a3));if(_0x6591a3[_0xd5ec('0x13')]){if(_0x6591a3['error'][_0xd5ec('0x14')]===0x1f4){logger[_0xd5ec('0x13')](_0xd5ec('0x15'),_0x28c324,_0x6591a3['error'][_0xd5ec('0x16')]);return _0x213bb2(_0x6591a3['error'][_0xd5ec('0x16')]);}logger[_0xd5ec('0x13')](_0xd5ec('0x15'),_0x28c324,_0x6591a3[_0xd5ec('0x13')][_0xd5ec('0x16')]);return _0xedd40d(_0x6591a3[_0xd5ec('0x13')][_0xd5ec('0x16')]);}else{logger[_0xd5ec('0xe')](_0xd5ec('0x15'),_0x28c324,_0xd5ec('0xf'));_0xedd40d(_0x6591a3[_0xd5ec('0x17')][_0xd5ec('0x16')]);}})[_0xd5ec('0x18')](function(_0x1bef54){logger[_0xd5ec('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x28c324,_0x1bef54);_0x213bb2(_0x1bef54);});});}
\ No newline at end of file
+var _0xa818=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0xa818,0x64));var _0x8a81=function(_0x3daa8c,_0x388a87){_0x3daa8c=_0x3daa8c-0x0;var _0x2b1bd7=_0xa818[_0x3daa8c];return _0x2b1bd7;};'use strict';var _=require('lodash');var util=require(_0x8a81('0x0'));var moment=require(_0x8a81('0x1'));var BPromise=require(_0x8a81('0x2'));var rs=require(_0x8a81('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a81('0x4'))['db'];var utils=require(_0x8a81('0x5'));var logger=require(_0x8a81('0x6'))(_0x8a81('0x7'));var config=require(_0x8a81('0x8'));var jayson=require(_0x8a81('0x9'));var client=jayson['client'][_0x8a81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a0cd9,_0x15025d,_0x35eb10){return new BPromise(function(_0x1a364a,_0x5e65d5){return client[_0x8a81('0xb')](_0x2a0cd9,_0x35eb10)[_0x8a81('0xc')](function(_0x55be3a){logger[_0x8a81('0xd')](_0x8a81('0xe'),_0x15025d,_0x8a81('0xf'));logger[_0x8a81('0x10')](_0x8a81('0x11'),_0x15025d,_0x8a81('0xf'),JSON[_0x8a81('0x12')](_0x55be3a));if(_0x55be3a[_0x8a81('0x13')]){if(_0x55be3a[_0x8a81('0x13')]['code']===0x1f4){logger['error'](_0x8a81('0xe'),_0x15025d,_0x55be3a[_0x8a81('0x13')][_0x8a81('0x14')]);return _0x5e65d5(_0x55be3a[_0x8a81('0x13')][_0x8a81('0x14')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x15025d,_0x55be3a[_0x8a81('0x13')][_0x8a81('0x14')]);return _0x1a364a(_0x55be3a[_0x8a81('0x13')]['message']);}else{logger[_0x8a81('0xd')](_0x8a81('0xe'),_0x15025d,_0x8a81('0xf'));_0x1a364a(_0x55be3a[_0x8a81('0x15')]['message']);}})[_0x8a81('0x16')](function(_0x269f5c){logger[_0x8a81('0x13')](_0x8a81('0xe'),_0x15025d,_0x269f5c);_0x5e65d5(_0x269f5c);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index c1c50d7..ac5a1de 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 _0x4819=['post','isAuthenticated','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x36067f,_0xba548e){var _0x44f0b3=function(_0x1954af){while(--_0x1954af){_0x36067f['push'](_0x36067f['shift']());}};_0x44f0b3(++_0xba548e);}(_0x4819,0xcd));var _0x9481=function(_0x1a547e,_0x5917d3){_0x1a547e=_0x1a547e-0x0;var _0x5ebdaf=_0x4819[_0x1a547e];return _0x5ebdaf;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get'](_0x9481('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9481('0xb')]('/',auth[_0x9481('0xc')](),controller[_0x9481('0xd')]);router[_0x9481('0xe')](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['delete'](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0x10')]);module[_0x9481('0x11')]=router;
\ No newline at end of file
+var _0x7fbe=['show','post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x1ead47,_0x47766a){var _0x8cbbbc=function(_0x2a20fb){while(--_0x2a20fb){_0x1ead47['push'](_0x1ead47['shift']());}};_0x8cbbbc(++_0x47766a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x35c718,_0x33a696){_0x35c718=_0x35c718-0x0;var _0x5c3099=_0x7fbe[_0x35c718];return _0x5c3099;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0xc')]);router[_0xe7fb('0xd')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0xe')]);router[_0xe7fb('0xf')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller['update']);router['delete'](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0x10')]);module[_0xe7fb('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 9df13ae..4538dd9 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 _0x0537=['INTEGER','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0x443308,_0x1bdf81){var _0x4cc59c=function(_0x35a992){while(--_0x35a992){_0x443308['push'](_0x443308['shift']());}};_0x4cc59c(++_0x1bdf81);}(_0x0537,0x1d1));var _0x7053=function(_0x5538b3,_0x402023){_0x5538b3=_0x5538b3-0x0;var _0x43ddfe=_0x0537[_0x5538b3];return _0x43ddfe;};'use strict';var Sequelize=require(_0x7053('0x0'));module[_0x7053('0x1')]={'name':{'type':Sequelize[_0x7053('0x2')],'unique':_0x7053('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7053('0x2')]},'timeout':{'type':Sequelize[_0x7053('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7053('0x5'),_0x7053('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0xfe38=['exports','STRING','name','ENUM','rrmemory','sequelize'];(function(_0x5d0430,_0x15cc32){var _0x4d964c=function(_0x392cbf){while(--_0x392cbf){_0x5d0430['push'](_0x5d0430['shift']());}};_0x4d964c(++_0x15cc32);}(_0xfe38,0x18b));var _0x8fe3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfe38[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x8fe3('0x0'));module[_0x8fe3('0x1')]={'name':{'type':Sequelize[_0x8fe3('0x2')],'unique':_0x8fe3('0x3'),'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[_0x8fe3('0x4')](_0x8fe3('0x5'),'beepall','roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index a3d9b06..14ef097 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 _0x8541=['every','TeamId','includes','all','union','value','transaction','ids','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','end','status','json','offset','undefined','limit','set','Content-Range','update','then','destroy','get','ChatQueues','sendStatus','error','stack','name','ChatQueue','rawAttributes','fieldName','getOptions','count','include','query','findAll','catch','show','params','keys','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','getMembers','findOne','UserChatQueue','filters','hasOwnProperty','nolimit','order','sort','where','filter','User','findAndCountAll','map','chatPause','createdAt','rows','format','SIP','getTeams','Team','pick','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','clone','push','toString','SELECT'];(function(_0x5b5b2f,_0x59f174){var _0x274e33=function(_0x2a2342){while(--_0x2a2342){_0x5b5b2f['push'](_0x5b5b2f['shift']());}};_0x274e33(++_0x59f174);}(_0x8541,0xfd));var _0x1854=function(_0x1c7117,_0x1c3af2){_0x1c7117=_0x1c7117-0x0;var _0x5d3c3c=_0x8541[_0x1c7117];return _0x5d3c3c;};'use strict';var BPromise=require(_0x1854('0x0'));var util=require(_0x1854('0x1'));var _=require(_0x1854('0x2'));var squel=require(_0x1854('0x3'));var Redis=require(_0x1854('0x4'));var qs=require(_0x1854('0x5'));var logger=require(_0x1854('0x6'))(_0x1854('0x7'));var config=require('../../config/environment');var db=require(_0x1854('0x8'))['db'];config[_0x1854('0x9')]=_[_0x1854('0xa')](config[_0x1854('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x1854('0xb'))(new Redis(config[_0x1854('0x9')]));require(_0x1854('0xc'))['register'](socket);function respondWithStatusCode(_0x52d767,_0x16c963){_0x16c963=_0x16c963||0xcc;return function(_0xf4cff6){if(_0xf4cff6){return _0x52d767['sendStatus'](_0x16c963);}return _0x52d767['status'](_0x16c963)[_0x1854('0xd')]();};}function respondWithResult(_0x407443,_0x1bc02b){_0x1bc02b=_0x1bc02b||0xc8;return function(_0x54f658){if(_0x54f658){return _0x407443[_0x1854('0xe')](_0x1bc02b)[_0x1854('0xf')](_0x54f658);}};}function respondWithFilteredResult(_0x1ed32f,_0x2a0cf9){return function(_0x24cfdc){if(_0x24cfdc){var _0x35b770=typeof _0x2a0cf9[_0x1854('0x10')]===_0x1854('0x11')&&typeof _0x2a0cf9[_0x1854('0x12')]==='undefined';var _0x17c8ec=_0x24cfdc['count'];var _0x1ae8ed=_0x35b770?0x0:_0x2a0cf9[_0x1854('0x10')];var _0x503b1e=_0x35b770?_0x24cfdc['count']:_0x2a0cf9[_0x1854('0x10')]+_0x2a0cf9[_0x1854('0x12')];var _0x47a3ff;if(_0x503b1e>=_0x17c8ec){_0x503b1e=_0x17c8ec;_0x47a3ff=0xc8;}else{_0x47a3ff=0xce;}_0x1ed32f[_0x1854('0xe')](_0x47a3ff);return _0x1ed32f[_0x1854('0x13')](_0x1854('0x14'),_0x1ae8ed+'-'+_0x503b1e+'/'+_0x17c8ec)[_0x1854('0xf')](_0x24cfdc);}return null;};}function saveUpdates(_0x1cc594){return function(_0x1b1f9a){if(_0x1b1f9a){return _0x1b1f9a[_0x1854('0x15')](_0x1cc594)[_0x1854('0x16')](function(_0x3abf5d){return _0x3abf5d;});}return null;};}function removeEntity(_0xf5f0b5){return function(_0x5ea653){if(_0x5ea653){return _0x5ea653[_0x1854('0x17')]()[_0x1854('0x16')](function(){var _0xb4bd91=_0x5ea653[_0x1854('0x18')]({'plain':!![]});var _0x4cd4c6=_0x1854('0x19');return db['UserProfileResource'][_0x1854('0x17')]({'where':{'type':_0x4cd4c6,'resourceId':_0xb4bd91['id']}})['then'](function(){return _0x5ea653;});})[_0x1854('0x16')](function(){_0xf5f0b5['status'](0xcc)[_0x1854('0xd')]();});}};}function handleEntityNotFound(_0x1b9ada){return function(_0x1217be){if(!_0x1217be){_0x1b9ada[_0x1854('0x1a')](0x194);}return _0x1217be;};}function handleError(_0x4f8f03,_0x292900){_0x292900=_0x292900||0x1f4;return function(_0x5c6853){logger[_0x1854('0x1b')](_0x5c6853[_0x1854('0x1c')]);if(_0x5c6853[_0x1854('0x1d')]){delete _0x5c6853['name'];}_0x4f8f03['status'](_0x292900)['send'](_0x5c6853);};}exports['index']=function(_0x376db6,_0x6b9f83){var _0x29cdbe={};var _0x397a2c={'count':0x0,'rows':[]};var _0xafc05d=_['map'](db[_0x1854('0x1e')][_0x1854('0x1f')],function(_0x8c7b68){return{'name':_0x8c7b68[_0x1854('0x20')],'type':_0x8c7b68['type']['key']};});_0x29cdbe=qs[_0x1854('0x21')](_0xafc05d,_0x376db6);var _0x23b75c={'where':_0x29cdbe['where']};return db[_0x1854('0x1e')][_0x1854('0x22')](_0x23b75c)['then'](function(_0x208c85){_0x397a2c[_0x1854('0x22')]=_0x208c85;_0x29cdbe[_0x1854('0x23')]=qs['include'](_0x376db6[_0x1854('0x24')]);return db[_0x1854('0x1e')][_0x1854('0x25')](_0x29cdbe);})[_0x1854('0x16')](function(_0x149980){_0x397a2c['rows']=_0x149980;return _0x397a2c;})[_0x1854('0x16')](respondWithFilteredResult(_0x6b9f83,_0x29cdbe))[_0x1854('0x26')](handleError(_0x6b9f83,null));};exports[_0x1854('0x27')]=function(_0x424a95,_0xf9933f){var _0x49f013={'raw':!![],'where':{'id':_0x424a95[_0x1854('0x28')]['id']}},_0x5481c9={};_0x5481c9['model']=_[_0x1854('0x29')](db['ChatQueue'][_0x1854('0x1f')]);_0x5481c9[_0x1854('0x24')]=_[_0x1854('0x29')](_0x424a95[_0x1854('0x24')]);_0x5481c9['filters']=_[_0x1854('0x2a')](_0x5481c9[_0x1854('0x2b')],_0x5481c9[_0x1854('0x24')]);_0x49f013[_0x1854('0x2c')]=_[_0x1854('0x2a')](_0x5481c9[_0x1854('0x2b')],qs['fields'](_0x424a95[_0x1854('0x24')][_0x1854('0x2d')]));_0x49f013['attributes']=_0x49f013[_0x1854('0x2c')][_0x1854('0x2e')]?_0x49f013[_0x1854('0x2c')]:_0x5481c9[_0x1854('0x2b')];if(_0x424a95[_0x1854('0x24')][_0x1854('0x2f')]){_0x49f013[_0x1854('0x23')]=[{'all':!![]}];}_0x49f013=_[_0x1854('0x30')]({},_0x49f013,_0x424a95[_0x1854('0x31')]);return db[_0x1854('0x1e')][_0x1854('0x32')](_0x49f013)[_0x1854('0x16')](handleEntityNotFound(_0xf9933f,null))[_0x1854('0x16')](respondWithResult(_0xf9933f,null))[_0x1854('0x26')](handleError(_0xf9933f,null));};exports[_0x1854('0x33')]=function(_0x5e2ace,_0x28c966){return db[_0x1854('0x1e')][_0x1854('0x33')](_0x5e2ace[_0x1854('0x34')],{})['then'](function(_0x45a5fb){var _0x1cb58b=_0x5e2ace['user'][_0x1854('0x18')]({'plain':!![]});if(!_0x1cb58b)throw new Error(_0x1854('0x35'));if(_0x1cb58b['role']===_0x1854('0x36')){var _0x3b3b22=_0x45a5fb['get']({'plain':!![]});var _0x2de7d7=_0x1854('0x19');return db[_0x1854('0x37')]['find']({'where':{'name':_0x2de7d7,'userProfileId':_0x1cb58b[_0x1854('0x38')]},'raw':!![]})[_0x1854('0x16')](function(_0xc828e1){if(_0xc828e1&&_0xc828e1[_0x1854('0x39')]===0x0){return db[_0x1854('0x3a')]['create']({'name':_0x3b3b22[_0x1854('0x1d')],'resourceId':_0x3b3b22['id'],'type':_0xc828e1[_0x1854('0x1d')],'sectionId':_0xc828e1['id']},{})[_0x1854('0x16')](function(){return _0x45a5fb;});}else{return _0x45a5fb;}})[_0x1854('0x26')](function(_0x41b783){logger[_0x1854('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41b783);throw _0x41b783;});}return _0x45a5fb;})['then'](respondWithResult(_0x28c966,0xc9))[_0x1854('0x26')](handleError(_0x28c966,null));};exports[_0x1854('0x15')]=function(_0x19b435,_0x4b6f49){if(_0x19b435['body']['id']){delete _0x19b435[_0x1854('0x34')]['id'];}return db[_0x1854('0x1e')][_0x1854('0x32')]({'where':{'id':_0x19b435[_0x1854('0x28')]['id']}})[_0x1854('0x16')](handleEntityNotFound(_0x4b6f49,null))[_0x1854('0x16')](saveUpdates(_0x19b435[_0x1854('0x34')],null))[_0x1854('0x16')](respondWithResult(_0x4b6f49,null))['catch'](handleError(_0x4b6f49,null));};exports[_0x1854('0x17')]=function(_0x17dfb8,_0x198c62){return db[_0x1854('0x1e')][_0x1854('0x32')]({'where':{'id':_0x17dfb8[_0x1854('0x28')]['id']}})[_0x1854('0x16')](handleEntityNotFound(_0x198c62,null))[_0x1854('0x16')](removeEntity(_0x198c62,null))[_0x1854('0x26')](handleError(_0x198c62,null));};exports[_0x1854('0x3b')]=function(_0xfc8eee,_0x356e25){return db[_0x1854('0x1e')][_0x1854('0x3b')]()[_0x1854('0x16')](respondWithResult(_0x356e25,null))[_0x1854('0x26')](handleError(_0x356e25,null));};exports[_0x1854('0x3c')]=function(_0x4b8b2f,_0x324617){var _0x28f680={'raw':!![],'where':{}},_0x30c8d0={},_0x59dba7;return db[_0x1854('0x1e')][_0x1854('0x3d')]({'where':{'id':_0x4b8b2f['params']['id']}})[_0x1854('0x16')](handleEntityNotFound(_0x324617,null))[_0x1854('0x16')](function(_0xb72c65){if(_0xb72c65){_0x59dba7=_0xb72c65[_0x1854('0x18')]({'plain':!![]});_0x30c8d0['model']=_['keys'](db[_0x1854('0x3e')]['rawAttributes']);_0x30c8d0['query']=_[_0x1854('0x29')](_0x4b8b2f[_0x1854('0x24')]);_0x30c8d0[_0x1854('0x3f')]=_[_0x1854('0x2a')](_0x30c8d0[_0x1854('0x2b')],_0x30c8d0[_0x1854('0x24')]);_0x28f680[_0x1854('0x2c')]=_[_0x1854('0x2a')](_0x30c8d0[_0x1854('0x2b')],qs[_0x1854('0x2d')](_0x4b8b2f[_0x1854('0x24')]['fields']));_0x28f680['attributes']=_0x28f680[_0x1854('0x2c')][_0x1854('0x2e')]?_0x28f680[_0x1854('0x2c')]:_0x30c8d0[_0x1854('0x2b')];if(!_0x4b8b2f[_0x1854('0x24')][_0x1854('0x40')](_0x1854('0x41'))){_0x28f680[_0x1854('0x12')]=qs[_0x1854('0x12')](_0x4b8b2f[_0x1854('0x24')][_0x1854('0x12')]);_0x28f680[_0x1854('0x10')]=qs['offset'](_0x4b8b2f[_0x1854('0x24')][_0x1854('0x10')]);}_0x28f680[_0x1854('0x42')]=qs[_0x1854('0x43')](_0x4b8b2f[_0x1854('0x24')]['sort']);_0x28f680[_0x1854('0x44')]=qs['filters'](_['pick'](_0x4b8b2f[_0x1854('0x24')],_0x30c8d0['filters']));_0x28f680[_0x1854('0x44')]['ChatQueueId']=_0xb72c65['id'];if(_0x4b8b2f['query'][_0x1854('0x45')]){_0x28f680[_0x1854('0x44')]=_[_0x1854('0x30')](_0x28f680['where'],{'$or':_['map'](_0x28f680[_0x1854('0x2c')],function(_0x5c33b1){var _0x4af719={};_0x4af719[_0x5c33b1]={'$like':'%'+_0x4b8b2f['query']['filter']+'%'};return _0x4af719;})});}_0x28f680=_[_0x1854('0x30')]({},_0x28f680,_0x4b8b2f[_0x1854('0x31')]);return db[_0x1854('0x3e')]['findAll'](_0x28f680);}})['then'](function(_0x7e1602){if(_0x7e1602){return db[_0x1854('0x46')][_0x1854('0x47')]({'where':{'id':_[_0x1854('0x48')](_0x7e1602,'UserId'),'role':'agent'},'attributes':['id',_0x1854('0x1d'),_0x1854('0x49'),'updatedAt',_0x1854('0x4a')]});}})[_0x1854('0x16')](function(_0x124784){if(_0x124784){return{'count':_0x124784[_0x1854('0x22')],'rows':_[_0x1854('0x48')](_0x124784[_0x1854('0x4b')],function(_0xdbdecd){return{'membername':_0xdbdecd[_0x1854('0x1d')],'UserId':_0xdbdecd['id'],'queue_name':_0x59dba7[_0x1854('0x1d')],'ChatQueueId':_0x59dba7['id'],'interface':util[_0x1854('0x4c')]('%s/%s',_0x1854('0x4d'),_0xdbdecd[_0x1854('0x1d')]),'penalty':0x0,'paused':_0xdbdecd['chatPause'],'createdAt':_0xdbdecd['createdAt'],'updatedAt':_0xdbdecd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x1854('0x16')](respondWithFilteredResult(_0x324617,_0x28f680))['catch'](handleError(_0x324617,null));};exports[_0x1854('0x4e')]=function(_0x1cf437,_0x1f0473){var _0x1e3c71={};var _0x183c44={};var _0x3e0cdd;var _0x111440;return db['ChatQueue'][_0x1854('0x3d')]({'where':{'id':_0x1cf437[_0x1854('0x28')]['id']}})['then'](handleEntityNotFound(_0x1f0473,null))[_0x1854('0x16')](function(_0x5b147e){if(_0x5b147e){_0x3e0cdd=_0x5b147e;_0x183c44[_0x1854('0x2b')]=_[_0x1854('0x29')](db[_0x1854('0x4f')][_0x1854('0x1f')]);_0x183c44['query']=_[_0x1854('0x29')](_0x1cf437[_0x1854('0x24')]);_0x183c44[_0x1854('0x3f')]=_['intersection'](_0x183c44[_0x1854('0x2b')],_0x183c44[_0x1854('0x24')]);_0x1e3c71[_0x1854('0x2c')]=_[_0x1854('0x2a')](_0x183c44['model'],qs['fields'](_0x1cf437[_0x1854('0x24')][_0x1854('0x2d')]));_0x1e3c71[_0x1854('0x2c')]=_0x1e3c71['attributes']['length']?_0x1e3c71[_0x1854('0x2c')]:_0x183c44['model'];_0x1e3c71['order']=qs[_0x1854('0x43')](_0x1cf437[_0x1854('0x24')]['sort']);_0x1e3c71['where']=qs[_0x1854('0x3f')](_[_0x1854('0x50')](_0x1cf437[_0x1854('0x24')],_0x183c44[_0x1854('0x3f')]));if(_0x1cf437[_0x1854('0x24')][_0x1854('0x45')]){_0x1e3c71[_0x1854('0x44')]=_[_0x1854('0x30')](_0x1e3c71[_0x1854('0x44')],{'$or':_[_0x1854('0x48')](_0x1e3c71[_0x1854('0x2c')],function(_0x3276ed){var _0x11f559={};_0x11f559[_0x3276ed]={'$like':'%'+_0x1cf437[_0x1854('0x24')][_0x1854('0x45')]+'%'};return _0x11f559;})});}_0x1e3c71=_[_0x1854('0x30')]({},_0x1e3c71,_0x1cf437[_0x1854('0x31')]);return _0x3e0cdd['getTeams'](_0x1e3c71);}})[_0x1854('0x16')](function(_0x3dd654){if(_0x3dd654){_0x111440=_0x3dd654[_0x1854('0x2e')];if(!_0x1cf437['query']['hasOwnProperty'](_0x1854('0x41'))){_0x1e3c71['limit']=qs[_0x1854('0x12')](_0x1cf437[_0x1854('0x24')][_0x1854('0x12')]);_0x1e3c71[_0x1854('0x10')]=qs[_0x1854('0x10')](_0x1cf437['query'][_0x1854('0x10')]);}return _0x3e0cdd[_0x1854('0x4e')](_0x1e3c71);}})['then'](function(_0x2c874e){if(_0x2c874e){return _0x2c874e?{'count':_0x111440,'rows':_0x2c874e}:null;}})[_0x1854('0x16')](respondWithResult(_0x1f0473,null))[_0x1854('0x26')](handleError(_0x1f0473,null));};exports[_0x1854('0x51')]=function(_0x17ec30,_0x333136){var _0x524923=_0x17ec30[_0x1854('0x34')]['ids'];return db[_0x1854('0x4f')][_0x1854('0x25')]({'where':{'id':_0x524923},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1854('0x52'),'attributes':['id',_0x1854('0x1d'),_0x1854('0x53'),_0x1854('0x54'),_0x1854('0x55')],'raw':!![]}]})[_0x1854('0x16')](function(_0x358b86){if(_0x358b86){var _0x4ae7f5=_[_0x1854('0x56')](_0x358b86,function(_0xda9fea){var _0xa1ae1a=_0xda9fea[_0x1854('0x18')]({'plain':!![]});return _0xa1ae1a[_0x1854('0x52')];});return db[_0x1854('0x1e')][_0x1854('0x32')]({'where':{'id':_0x17ec30[_0x1854('0x28')]['id']}})[_0x1854('0x16')](function(_0x535bd9){return db[_0x1854('0x57')]['transaction'](function(_0x1f4c17){return _0x535bd9[_0x1854('0x51')](_0x524923,{'transaction':_0x1f4c17})[_0x1854('0x16')](function(){return BPromise[_0x1854('0x58')](_0x4ae7f5,function(_0x14e30b){return db[_0x1854('0x3e')][_0x1854('0x59')]({'where':{'UserId':_0x14e30b['id'],'ChatQueueId':_0x17ec30[_0x1854('0x28')]['id']},'transaction':_0x1f4c17});});})[_0x1854('0x16')](function(){_0x4ae7f5[_0x1854('0x5a')](function(_0x2edb1a){socket[_0x1854('0x5b')](_0x1854('0x5c'),{'UserId':_0x2edb1a['id'],'ChatQueueId':_0x535bd9['id']});});});});});}})[_0x1854('0x16')](respondWithStatusCode(_0x333136,null))[_0x1854('0x26')](handleError(_0x333136,null));};exports[_0x1854('0x5d')]=function(_0x1c4485,_0x30b6d2){return db[_0x1854('0x4f')][_0x1854('0x25')]({'where':{'id':_0x1c4485[_0x1854('0x24')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1854('0x46')],'as':_0x1854('0x52'),'attributes':['id'],'raw':!![]}]})[_0x1854('0x16')](handleEntityNotFound(_0x30b6d2,null))[_0x1854('0x16')](function(_0x510df3){var _0x145332=_['map'](_0x510df3,'id');var _0x399ccf=[];var _0x3a4c26=[];var _0x78508a=squel[_0x1854('0x5e')]();_0x78508a['field'](_0x1854('0x5f'))[_0x1854('0x60')](_0x1854('0x61'),'tq')['join'](_0x1854('0x62'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x1854('0x63'),_0x1c4485[_0x1854('0x28')]['id']);for(var _0x14a4ef=0x0;_0x14a4ef<_0x510df3[_0x1854('0x2e')];_0x14a4ef+=0x1){let _0x841532=_0x510df3[_0x14a4ef];for(var _0x139de6=0x0;_0x139de6<_0x841532[_0x1854('0x52')][_0x1854('0x2e')];_0x139de6+=0x1){let _0x233420=_0x841532[_0x1854('0x52')][_0x139de6];var _0xe1ed60=_0x78508a[_0x1854('0x64')]();_0xe1ed60[_0x1854('0x44')]('ut.UserId\x20=\x20?',_0x233420['id']);_0x3a4c26[_0x1854('0x65')](db[_0x1854('0x57')][_0x1854('0x24')](_0xe1ed60[_0x1854('0x66')](),{'type':db[_0x1854('0x57')]['QueryTypes'][_0x1854('0x67')]})['then'](function(_0x3711d0){if(_0x3711d0['length']===0x1){return _0x233420['id'];}else{var _0x178927=_[_0x1854('0x68')](_['map'](_0x3711d0,_0x1854('0x69')),function(_0x395e50){return _[_0x1854('0x6a')](_0x145332,_0x395e50);});if(_0x178927){return _0x233420['id'];}}}));}}return BPromise[_0x1854('0x6b')](_0x3a4c26)[_0x1854('0x16')](function(_0x265264){_0x399ccf=_(_0x399ccf)[_0x1854('0x6c')](_0x265264)['compact']()[_0x1854('0x6d')]();return db['ChatQueue'][_0x1854('0x32')]({'where':{'id':_0x1c4485[_0x1854('0x28')]['id']}})[_0x1854('0x16')](function(_0x3ab765){return db[_0x1854('0x57')][_0x1854('0x6e')](function(_0x2147cd){return _0x3ab765[_0x1854('0x5d')](_0x1c4485[_0x1854('0x24')][_0x1854('0x6f')],{'transaction':_0x2147cd})[_0x1854('0x16')](function(){if(!_[_0x1854('0x70')](_0x399ccf)){return _0x3ab765[_0x1854('0x71')](_0x399ccf,{'transaction':_0x2147cd});}})['then'](function(){_0x399ccf[_0x1854('0x5a')](function(_0x5eb1f5){socket[_0x1854('0x5b')](_0x1854('0x72'),{'UserId':_0x5eb1f5,'ChatQueueId':_0x3ab765['id']});});});});});});})[_0x1854('0x16')](respondWithStatusCode(_0x30b6d2,null))[_0x1854('0x26')](handleError(_0x30b6d2,null));};exports[_0x1854('0x73')]=function(_0x31c472,_0x5bc0f5){return db['ChatQueue'][_0x1854('0x32')]({'where':{'id':_0x31c472[_0x1854('0x28')]['id']}})[_0x1854('0x16')](handleEntityNotFound(_0x5bc0f5,null))['then'](function(_0x38366a){if(_0x38366a){return _0x38366a['addAgents'](_0x31c472[_0x1854('0x34')]['ids'],_[_0x1854('0x74')](_0x31c472[_0x1854('0x34')],[_0x1854('0x6f'),'id'])||{})['spread'](function(_0x5ada4a){for(var _0x59ccaa=0x0;_0x59ccaa<_0x31c472[_0x1854('0x34')][_0x1854('0x6f')][_0x1854('0x2e')];_0x59ccaa+=0x1){socket[_0x1854('0x5b')](_0x1854('0x5c'),{'UserId':Number(_0x31c472[_0x1854('0x34')][_0x1854('0x6f')][_0x59ccaa]),'ChatQueueId':Number(_0x31c472[_0x1854('0x28')]['id'])});}return _0x5ada4a;});}})[_0x1854('0x16')](respondWithResult(_0x5bc0f5,null))[_0x1854('0x26')](handleError(_0x5bc0f5,null));};exports['removeAgents']=function(_0x263e74,_0x378e1e){return db[_0x1854('0x1e')][_0x1854('0x32')]({'where':{'id':_0x263e74[_0x1854('0x28')]['id']}})[_0x1854('0x16')](handleEntityNotFound(_0x378e1e,null))[_0x1854('0x16')](function(_0x5aa113){if(_0x5aa113){return _0x5aa113[_0x1854('0x71')](_0x263e74[_0x1854('0x24')][_0x1854('0x6f')])[_0x1854('0x16')](function(){if(_[_0x1854('0x75')](_0x263e74[_0x1854('0x24')][_0x1854('0x6f')])){for(var _0x1c3ea0=0x0;_0x1c3ea0<_0x263e74[_0x1854('0x24')]['ids'][_0x1854('0x2e')];_0x1c3ea0+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x263e74[_0x1854('0x24')][_0x1854('0x6f')][_0x1c3ea0]),'ChatQueueId':Number(_0x263e74[_0x1854('0x28')]['id'])});}}else{socket[_0x1854('0x5b')](_0x1854('0x72'),{'UserId':Number(_0x263e74[_0x1854('0x24')][_0x1854('0x6f')]),'ChatQueueId':Number(_0x263e74[_0x1854('0x28')]['id'])});}});}})[_0x1854('0x16')](respondWithStatusCode(_0x378e1e,null))['catch'](handleError(_0x378e1e,null));};exports['getAgents']=function(_0x45d2ec,_0x36e2ec){var _0x287bb3={};var _0xad9589={};var _0x525017;var _0x23a6be;return db[_0x1854('0x1e')]['findOne']({'where':{'id':_0x45d2ec['params']['id']}})[_0x1854('0x16')](handleEntityNotFound(_0x36e2ec,null))[_0x1854('0x16')](function(_0x4960bc){if(_0x4960bc){_0x525017=_0x4960bc;_0xad9589[_0x1854('0x2b')]=_[_0x1854('0x29')](db['User'][_0x1854('0x1f')]);_0xad9589[_0x1854('0x24')]=_[_0x1854('0x29')](_0x45d2ec[_0x1854('0x24')]);_0xad9589[_0x1854('0x3f')]=_[_0x1854('0x2a')](_0xad9589[_0x1854('0x2b')],_0xad9589[_0x1854('0x24')]);_0x287bb3[_0x1854('0x2c')]=_[_0x1854('0x2a')](_0xad9589[_0x1854('0x2b')],qs[_0x1854('0x2d')](_0x45d2ec[_0x1854('0x24')][_0x1854('0x2d')]));_0x287bb3[_0x1854('0x2c')]=_0x287bb3[_0x1854('0x2c')][_0x1854('0x2e')]?_0x287bb3['attributes']:_0xad9589[_0x1854('0x2b')];_0x287bb3[_0x1854('0x42')]=qs[_0x1854('0x43')](_0x45d2ec[_0x1854('0x24')][_0x1854('0x43')]);_0x287bb3['where']=qs['filters'](_['pick'](_0x45d2ec['query'],_0xad9589['filters']));if(_0x45d2ec[_0x1854('0x24')][_0x1854('0x45')]){_0x287bb3[_0x1854('0x44')]=_['merge'](_0x287bb3[_0x1854('0x44')],{'$or':_[_0x1854('0x48')](_0x287bb3[_0x1854('0x2c')],function(_0x560f73){var _0x6eb3b8={};_0x6eb3b8[_0x560f73]={'$like':'%'+_0x45d2ec[_0x1854('0x24')][_0x1854('0x45')]+'%'};return _0x6eb3b8;})});}_0x287bb3=_[_0x1854('0x30')]({},_0x287bb3,_0x45d2ec[_0x1854('0x31')]);return _0x525017[_0x1854('0x76')](_0x287bb3);}})[_0x1854('0x16')](function(_0x2a32a7){if(_0x2a32a7){_0x23a6be=_0x2a32a7['length'];if(!_0x45d2ec[_0x1854('0x24')][_0x1854('0x40')](_0x1854('0x41'))){_0x287bb3[_0x1854('0x12')]=qs['limit'](_0x45d2ec[_0x1854('0x24')][_0x1854('0x12')]);_0x287bb3['offset']=qs['offset'](_0x45d2ec['query']['offset']);}return _0x525017[_0x1854('0x76')](_0x287bb3);}})[_0x1854('0x16')](function(_0x5963e8){if(_0x5963e8){return _0x5963e8?{'count':_0x23a6be,'rows':_0x5963e8}:null;}})['then'](respondWithResult(_0x36e2ec,null))[_0x1854('0x26')](handleError(_0x36e2ec,null));};
\ No newline at end of file
+var _0x2f4a=['../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','ChatQueue','include','query','findAll','rows','catch','show','params','model','intersection','attributes','fields','length','includeAll','options','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','keys','filters','hasOwnProperty','nolimit','order','sort','ChatQueueId','filter','merge','UserChatQueue','User','findAndCountAll','agent','chatPause','updatedAt','format','SIP','createdAt','getTeams','findOne','pick','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','toString','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','userChatQueue:save','isArray','getAgents','util','lodash','squel'];(function(_0xa0cb20,_0x1c18ef){var _0x2cc906=function(_0x4db98b){while(--_0x4db98b){_0xa0cb20['push'](_0xa0cb20['shift']());}};_0x2cc906(++_0x1c18ef);}(_0x2f4a,0x75));var _0xa2f4=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x2f4a[_0x513aa5];return _0x1a1a7c;};'use strict';var BPromise=require('bluebird');var util=require(_0xa2f4('0x0'));var _=require(_0xa2f4('0x1'));var squel=require(_0xa2f4('0x2'));var Redis=require('ioredis');var qs=require(_0xa2f4('0x3'));var logger=require(_0xa2f4('0x4'))(_0xa2f4('0x5'));var config=require(_0xa2f4('0x6'));var db=require(_0xa2f4('0x7'))['db'];config[_0xa2f4('0x8')]=_[_0xa2f4('0x9')](config['redis'],{'host':_0xa2f4('0xa'),'port':0x18eb});var socket=require(_0xa2f4('0xb'))(new Redis(config[_0xa2f4('0x8')]));require('./chatQueue.socket')[_0xa2f4('0xc')](socket);function respondWithStatusCode(_0x3d76cb,_0x210083){_0x210083=_0x210083||0xcc;return function(_0x596cb1){if(_0x596cb1){return _0x3d76cb[_0xa2f4('0xd')](_0x210083);}return _0x3d76cb[_0xa2f4('0xe')](_0x210083)[_0xa2f4('0xf')]();};}function respondWithResult(_0x58f4fd,_0x277fc0){_0x277fc0=_0x277fc0||0xc8;return function(_0x210e3a){if(_0x210e3a){return _0x58f4fd[_0xa2f4('0xe')](_0x277fc0)[_0xa2f4('0x10')](_0x210e3a);}};}function respondWithFilteredResult(_0x386050,_0x39b47a){return function(_0x55e812){if(_0x55e812){var _0x15b2b9=typeof _0x39b47a['offset']==='undefined'&&typeof _0x39b47a[_0xa2f4('0x11')]===_0xa2f4('0x12');var _0x12c0ca=_0x55e812[_0xa2f4('0x13')];var _0x9e8adc=_0x15b2b9?0x0:_0x39b47a[_0xa2f4('0x14')];var _0x2eaa36=_0x15b2b9?_0x55e812['count']:_0x39b47a[_0xa2f4('0x14')]+_0x39b47a[_0xa2f4('0x11')];var _0x11b64c;if(_0x2eaa36>=_0x12c0ca){_0x2eaa36=_0x12c0ca;_0x11b64c=0xc8;}else{_0x11b64c=0xce;}_0x386050['status'](_0x11b64c);return _0x386050['set'](_0xa2f4('0x15'),_0x9e8adc+'-'+_0x2eaa36+'/'+_0x12c0ca)[_0xa2f4('0x10')](_0x55e812);}return null;};}function saveUpdates(_0x13ee36){return function(_0xc305ed){if(_0xc305ed){return _0xc305ed[_0xa2f4('0x16')](_0x13ee36)[_0xa2f4('0x17')](function(_0x36bd06){return _0x36bd06;});}return null;};}function removeEntity(_0x1892fc){return function(_0x35cba5){if(_0x35cba5){return _0x35cba5[_0xa2f4('0x18')]()[_0xa2f4('0x17')](function(){var _0x554f6b=_0x35cba5[_0xa2f4('0x19')]({'plain':!![]});var _0x1d1ee2=_0xa2f4('0x1a');return db[_0xa2f4('0x1b')][_0xa2f4('0x18')]({'where':{'type':_0x1d1ee2,'resourceId':_0x554f6b['id']}})[_0xa2f4('0x17')](function(){return _0x35cba5;});})[_0xa2f4('0x17')](function(){_0x1892fc['status'](0xcc)[_0xa2f4('0xf')]();});}};}function handleEntityNotFound(_0x937460){return function(_0x435f71){if(!_0x435f71){_0x937460['sendStatus'](0x194);}return _0x435f71;};}function handleError(_0x44e0f4,_0x362b76){_0x362b76=_0x362b76||0x1f4;return function(_0x4ce83f){logger[_0xa2f4('0x1c')](_0x4ce83f['stack']);if(_0x4ce83f[_0xa2f4('0x1d')]){delete _0x4ce83f[_0xa2f4('0x1d')];}_0x44e0f4[_0xa2f4('0xe')](_0x362b76)[_0xa2f4('0x1e')](_0x4ce83f);};}exports[_0xa2f4('0x1f')]=function(_0x535add,_0x8d7e33){var _0x583258={};var _0x2293b7={'count':0x0,'rows':[]};var _0x56f4b2=_[_0xa2f4('0x20')](db['ChatQueue'][_0xa2f4('0x21')],function(_0x262c45){return{'name':_0x262c45[_0xa2f4('0x22')],'type':_0x262c45[_0xa2f4('0x23')][_0xa2f4('0x24')]};});_0x583258=qs[_0xa2f4('0x25')](_0x56f4b2,_0x535add);var _0x5da497={'where':_0x583258[_0xa2f4('0x26')]};return db[_0xa2f4('0x27')][_0xa2f4('0x13')](_0x5da497)[_0xa2f4('0x17')](function(_0x204fcd){_0x2293b7['count']=_0x204fcd;_0x583258['include']=qs[_0xa2f4('0x28')](_0x535add[_0xa2f4('0x29')]);return db[_0xa2f4('0x27')][_0xa2f4('0x2a')](_0x583258);})[_0xa2f4('0x17')](function(_0x27a4e8){_0x2293b7[_0xa2f4('0x2b')]=_0x27a4e8;return _0x2293b7;})['then'](respondWithFilteredResult(_0x8d7e33,_0x583258))[_0xa2f4('0x2c')](handleError(_0x8d7e33,null));};exports[_0xa2f4('0x2d')]=function(_0x148e03,_0xcdbed7){var _0x414f8a={'raw':!![],'where':{'id':_0x148e03[_0xa2f4('0x2e')]['id']}},_0x3c7b5e={};_0x3c7b5e[_0xa2f4('0x2f')]=_['keys'](db[_0xa2f4('0x27')]['rawAttributes']);_0x3c7b5e[_0xa2f4('0x29')]=_['keys'](_0x148e03['query']);_0x3c7b5e['filters']=_[_0xa2f4('0x30')](_0x3c7b5e[_0xa2f4('0x2f')],_0x3c7b5e['query']);_0x414f8a[_0xa2f4('0x31')]=_[_0xa2f4('0x30')](_0x3c7b5e[_0xa2f4('0x2f')],qs['fields'](_0x148e03[_0xa2f4('0x29')][_0xa2f4('0x32')]));_0x414f8a[_0xa2f4('0x31')]=_0x414f8a[_0xa2f4('0x31')][_0xa2f4('0x33')]?_0x414f8a[_0xa2f4('0x31')]:_0x3c7b5e[_0xa2f4('0x2f')];if(_0x148e03['query'][_0xa2f4('0x34')]){_0x414f8a[_0xa2f4('0x28')]=[{'all':!![]}];}_0x414f8a=_['merge']({},_0x414f8a,_0x148e03[_0xa2f4('0x35')]);return db[_0xa2f4('0x27')][_0xa2f4('0x36')](_0x414f8a)[_0xa2f4('0x17')](handleEntityNotFound(_0xcdbed7,null))['then'](respondWithResult(_0xcdbed7,null))[_0xa2f4('0x2c')](handleError(_0xcdbed7,null));};exports[_0xa2f4('0x37')]=function(_0x5025e1,_0x5d00e4){return db['ChatQueue']['create'](_0x5025e1[_0xa2f4('0x38')],{})['then'](function(_0xcd8457){var _0x4f6170=_0x5025e1[_0xa2f4('0x39')][_0xa2f4('0x19')]({'plain':!![]});if(!_0x4f6170)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f6170[_0xa2f4('0x3a')]===_0xa2f4('0x39')){var _0x2b838c=_0xcd8457['get']({'plain':!![]});var _0x57e76b='ChatQueues';return db['UserProfileSection'][_0xa2f4('0x36')]({'where':{'name':_0x57e76b,'userProfileId':_0x4f6170[_0xa2f4('0x3b')]},'raw':!![]})[_0xa2f4('0x17')](function(_0x27f4d9){if(_0x27f4d9&&_0x27f4d9[_0xa2f4('0x3c')]===0x0){return db[_0xa2f4('0x1b')]['create']({'name':_0x2b838c['name'],'resourceId':_0x2b838c['id'],'type':_0x27f4d9['name'],'sectionId':_0x27f4d9['id']},{})['then'](function(){return _0xcd8457;});}else{return _0xcd8457;}})['catch'](function(_0x16b52f){logger['error'](_0xa2f4('0x3d'),_0x16b52f);throw _0x16b52f;});}return _0xcd8457;})[_0xa2f4('0x17')](respondWithResult(_0x5d00e4,0xc9))[_0xa2f4('0x2c')](handleError(_0x5d00e4,null));};exports[_0xa2f4('0x16')]=function(_0x203044,_0x519ac0){if(_0x203044['body']['id']){delete _0x203044[_0xa2f4('0x38')]['id'];}return db[_0xa2f4('0x27')]['find']({'where':{'id':_0x203044['params']['id']}})[_0xa2f4('0x17')](handleEntityNotFound(_0x519ac0,null))['then'](saveUpdates(_0x203044[_0xa2f4('0x38')],null))[_0xa2f4('0x17')](respondWithResult(_0x519ac0,null))[_0xa2f4('0x2c')](handleError(_0x519ac0,null));};exports['destroy']=function(_0xdcb383,_0x7b6fd5){return db[_0xa2f4('0x27')]['find']({'where':{'id':_0xdcb383[_0xa2f4('0x2e')]['id']}})[_0xa2f4('0x17')](handleEntityNotFound(_0x7b6fd5,null))['then'](removeEntity(_0x7b6fd5,null))[_0xa2f4('0x2c')](handleError(_0x7b6fd5,null));};exports['describe']=function(_0x140c86,_0x414575){return db[_0xa2f4('0x27')][_0xa2f4('0x3e')]()['then'](respondWithResult(_0x414575,null))[_0xa2f4('0x2c')](handleError(_0x414575,null));};exports[_0xa2f4('0x3f')]=function(_0xafcd9b,_0x31aa38){var _0x1267f7={'raw':!![],'where':{}},_0x23cae8={},_0xd77187;return db[_0xa2f4('0x27')]['findOne']({'where':{'id':_0xafcd9b['params']['id']}})['then'](handleEntityNotFound(_0x31aa38,null))[_0xa2f4('0x17')](function(_0x2fb8f1){if(_0x2fb8f1){_0xd77187=_0x2fb8f1[_0xa2f4('0x19')]({'plain':!![]});_0x23cae8['model']=_[_0xa2f4('0x40')](db['UserChatQueue'][_0xa2f4('0x21')]);_0x23cae8[_0xa2f4('0x29')]=_['keys'](_0xafcd9b['query']);_0x23cae8[_0xa2f4('0x41')]=_[_0xa2f4('0x30')](_0x23cae8[_0xa2f4('0x2f')],_0x23cae8[_0xa2f4('0x29')]);_0x1267f7[_0xa2f4('0x31')]=_['intersection'](_0x23cae8[_0xa2f4('0x2f')],qs[_0xa2f4('0x32')](_0xafcd9b['query'][_0xa2f4('0x32')]));_0x1267f7['attributes']=_0x1267f7['attributes'][_0xa2f4('0x33')]?_0x1267f7[_0xa2f4('0x31')]:_0x23cae8[_0xa2f4('0x2f')];if(!_0xafcd9b[_0xa2f4('0x29')][_0xa2f4('0x42')](_0xa2f4('0x43'))){_0x1267f7[_0xa2f4('0x11')]=qs['limit'](_0xafcd9b[_0xa2f4('0x29')][_0xa2f4('0x11')]);_0x1267f7[_0xa2f4('0x14')]=qs[_0xa2f4('0x14')](_0xafcd9b[_0xa2f4('0x29')][_0xa2f4('0x14')]);}_0x1267f7[_0xa2f4('0x44')]=qs[_0xa2f4('0x45')](_0xafcd9b['query'][_0xa2f4('0x45')]);_0x1267f7['where']=qs[_0xa2f4('0x41')](_['pick'](_0xafcd9b['query'],_0x23cae8[_0xa2f4('0x41')]));_0x1267f7[_0xa2f4('0x26')][_0xa2f4('0x46')]=_0x2fb8f1['id'];if(_0xafcd9b[_0xa2f4('0x29')][_0xa2f4('0x47')]){_0x1267f7[_0xa2f4('0x26')]=_[_0xa2f4('0x48')](_0x1267f7[_0xa2f4('0x26')],{'$or':_[_0xa2f4('0x20')](_0x1267f7['attributes'],function(_0x54286b){var _0x1a04e1={};_0x1a04e1[_0x54286b]={'$like':'%'+_0xafcd9b[_0xa2f4('0x29')]['filter']+'%'};return _0x1a04e1;})});}_0x1267f7=_[_0xa2f4('0x48')]({},_0x1267f7,_0xafcd9b['options']);return db[_0xa2f4('0x49')][_0xa2f4('0x2a')](_0x1267f7);}})[_0xa2f4('0x17')](function(_0x5095fe){if(_0x5095fe){return db[_0xa2f4('0x4a')][_0xa2f4('0x4b')]({'where':{'id':_['map'](_0x5095fe,'UserId'),'role':_0xa2f4('0x4c')},'attributes':['id',_0xa2f4('0x1d'),_0xa2f4('0x4d'),_0xa2f4('0x4e'),'createdAt']});}})[_0xa2f4('0x17')](function(_0x2f8255){if(_0x2f8255){return{'count':_0x2f8255[_0xa2f4('0x13')],'rows':_[_0xa2f4('0x20')](_0x2f8255[_0xa2f4('0x2b')],function(_0x599044){return{'membername':_0x599044[_0xa2f4('0x1d')],'UserId':_0x599044['id'],'queue_name':_0xd77187['name'],'ChatQueueId':_0xd77187['id'],'interface':util[_0xa2f4('0x4f')]('%s/%s',_0xa2f4('0x50'),_0x599044[_0xa2f4('0x1d')]),'penalty':0x0,'paused':_0x599044['chatPause'],'createdAt':_0x599044[_0xa2f4('0x51')],'updatedAt':_0x599044[_0xa2f4('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x31aa38,_0x1267f7))[_0xa2f4('0x2c')](handleError(_0x31aa38,null));};exports[_0xa2f4('0x52')]=function(_0x5aa3e0,_0x145ec0){var _0x297fa8={};var _0x27b71a={};var _0x19cdb5;var _0x4e97f0;return db[_0xa2f4('0x27')][_0xa2f4('0x53')]({'where':{'id':_0x5aa3e0[_0xa2f4('0x2e')]['id']}})['then'](handleEntityNotFound(_0x145ec0,null))[_0xa2f4('0x17')](function(_0x144fb4){if(_0x144fb4){_0x19cdb5=_0x144fb4;_0x27b71a['model']=_['keys'](db['Team'][_0xa2f4('0x21')]);_0x27b71a[_0xa2f4('0x29')]=_['keys'](_0x5aa3e0[_0xa2f4('0x29')]);_0x27b71a[_0xa2f4('0x41')]=_[_0xa2f4('0x30')](_0x27b71a[_0xa2f4('0x2f')],_0x27b71a[_0xa2f4('0x29')]);_0x297fa8[_0xa2f4('0x31')]=_[_0xa2f4('0x30')](_0x27b71a[_0xa2f4('0x2f')],qs[_0xa2f4('0x32')](_0x5aa3e0['query']['fields']));_0x297fa8[_0xa2f4('0x31')]=_0x297fa8[_0xa2f4('0x31')][_0xa2f4('0x33')]?_0x297fa8[_0xa2f4('0x31')]:_0x27b71a[_0xa2f4('0x2f')];_0x297fa8[_0xa2f4('0x44')]=qs[_0xa2f4('0x45')](_0x5aa3e0['query'][_0xa2f4('0x45')]);_0x297fa8['where']=qs['filters'](_[_0xa2f4('0x54')](_0x5aa3e0[_0xa2f4('0x29')],_0x27b71a['filters']));if(_0x5aa3e0[_0xa2f4('0x29')][_0xa2f4('0x47')]){_0x297fa8['where']=_[_0xa2f4('0x48')](_0x297fa8['where'],{'$or':_['map'](_0x297fa8[_0xa2f4('0x31')],function(_0x4dc930){var _0x4dcce2={};_0x4dcce2[_0x4dc930]={'$like':'%'+_0x5aa3e0[_0xa2f4('0x29')][_0xa2f4('0x47')]+'%'};return _0x4dcce2;})});}_0x297fa8=_[_0xa2f4('0x48')]({},_0x297fa8,_0x5aa3e0[_0xa2f4('0x35')]);return _0x19cdb5[_0xa2f4('0x52')](_0x297fa8);}})[_0xa2f4('0x17')](function(_0x5b23ec){if(_0x5b23ec){_0x4e97f0=_0x5b23ec[_0xa2f4('0x33')];if(!_0x5aa3e0[_0xa2f4('0x29')][_0xa2f4('0x42')](_0xa2f4('0x43'))){_0x297fa8[_0xa2f4('0x11')]=qs['limit'](_0x5aa3e0[_0xa2f4('0x29')][_0xa2f4('0x11')]);_0x297fa8[_0xa2f4('0x14')]=qs[_0xa2f4('0x14')](_0x5aa3e0['query']['offset']);}return _0x19cdb5[_0xa2f4('0x52')](_0x297fa8);}})['then'](function(_0x523d62){if(_0x523d62){return _0x523d62?{'count':_0x4e97f0,'rows':_0x523d62}:null;}})['then'](respondWithResult(_0x145ec0,null))[_0xa2f4('0x2c')](handleError(_0x145ec0,null));};exports[_0xa2f4('0x55')]=function(_0x208a5b,_0x1c37c0){var _0x306e75=_0x208a5b['body'][_0xa2f4('0x56')];return db[_0xa2f4('0x57')][_0xa2f4('0x2a')]({'where':{'id':_0x306e75},'attributes':['id'],'include':[{'model':db[_0xa2f4('0x4a')],'as':_0xa2f4('0x58'),'attributes':['id',_0xa2f4('0x1d'),'online',_0xa2f4('0x59'),_0xa2f4('0x5a')],'raw':!![]}]})[_0xa2f4('0x17')](function(_0x5ee101){if(_0x5ee101){var _0x4222fb=_[_0xa2f4('0x5b')](_0x5ee101,function(_0x229aee){var _0x5b9999=_0x229aee[_0xa2f4('0x19')]({'plain':!![]});return _0x5b9999[_0xa2f4('0x58')];});return db['ChatQueue'][_0xa2f4('0x36')]({'where':{'id':_0x208a5b[_0xa2f4('0x2e')]['id']}})[_0xa2f4('0x17')](function(_0x57cb53){return db[_0xa2f4('0x5c')]['transaction'](function(_0x2b5106){return _0x57cb53[_0xa2f4('0x55')](_0x306e75,{'transaction':_0x2b5106})['then'](function(){return BPromise['each'](_0x4222fb,function(_0x1c4ac7){return db['UserChatQueue'][_0xa2f4('0x5d')]({'where':{'UserId':_0x1c4ac7['id'],'ChatQueueId':_0x208a5b[_0xa2f4('0x2e')]['id']},'transaction':_0x2b5106});});})[_0xa2f4('0x17')](function(){_0x4222fb[_0xa2f4('0x5e')](function(_0x58d784){socket[_0xa2f4('0x5f')]('userChatQueue:save',{'UserId':_0x58d784['id'],'ChatQueueId':_0x57cb53['id']});});});});});}})[_0xa2f4('0x17')](respondWithStatusCode(_0x1c37c0,null))[_0xa2f4('0x2c')](handleError(_0x1c37c0,null));};exports[_0xa2f4('0x60')]=function(_0x57494d,_0x2f913c){return db[_0xa2f4('0x57')][_0xa2f4('0x2a')]({'where':{'id':_0x57494d['query'][_0xa2f4('0x56')]},'attributes':['id'],'include':[{'model':db[_0xa2f4('0x4a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa2f4('0x17')](handleEntityNotFound(_0x2f913c,null))[_0xa2f4('0x17')](function(_0x26f5ec){var _0x1c6d5f=_[_0xa2f4('0x20')](_0x26f5ec,'id');var _0x47181e=[];var _0x210f99=[];var _0x193f11=squel['select']();_0x193f11[_0xa2f4('0x61')](_0xa2f4('0x62'))[_0xa2f4('0x63')](_0xa2f4('0x64'),'tq')['join'](_0xa2f4('0x65'),'ut',_0xa2f4('0x66'))[_0xa2f4('0x26')]('ChatQueueId\x20=\x20?',_0x57494d[_0xa2f4('0x2e')]['id']);for(var _0x539d28=0x0;_0x539d28<_0x26f5ec[_0xa2f4('0x33')];_0x539d28+=0x1){let _0x266b29=_0x26f5ec[_0x539d28];for(var _0x221db3=0x0;_0x221db3<_0x266b29['Agents'][_0xa2f4('0x33')];_0x221db3+=0x1){let _0x1772a1=_0x266b29['Agents'][_0x221db3];var _0x30e899=_0x193f11['clone']();_0x30e899[_0xa2f4('0x26')]('ut.UserId\x20=\x20?',_0x1772a1['id']);_0x210f99[_0xa2f4('0x67')](db['sequelize'][_0xa2f4('0x29')](_0x30e899[_0xa2f4('0x68')](),{'type':db[_0xa2f4('0x5c')]['QueryTypes'][_0xa2f4('0x69')]})[_0xa2f4('0x17')](function(_0x450ae5){if(_0x450ae5[_0xa2f4('0x33')]===0x1){return _0x1772a1['id'];}else{var _0x17b26f=_[_0xa2f4('0x6a')](_['map'](_0x450ae5,'TeamId'),function(_0x3ad792){return _[_0xa2f4('0x6b')](_0x1c6d5f,_0x3ad792);});if(_0x17b26f){return _0x1772a1['id'];}}}));}}return BPromise[_0xa2f4('0x6c')](_0x210f99)[_0xa2f4('0x17')](function(_0x5d0b69){_0x47181e=_(_0x47181e)[_0xa2f4('0x6d')](_0x5d0b69)[_0xa2f4('0x6e')]()[_0xa2f4('0x6f')]();return db['ChatQueue']['find']({'where':{'id':_0x57494d['params']['id']}})[_0xa2f4('0x17')](function(_0x40ef2b){return db[_0xa2f4('0x5c')]['transaction'](function(_0x41aec5){return _0x40ef2b[_0xa2f4('0x60')](_0x57494d[_0xa2f4('0x29')][_0xa2f4('0x56')],{'transaction':_0x41aec5})['then'](function(){if(!_[_0xa2f4('0x70')](_0x47181e)){return _0x40ef2b[_0xa2f4('0x71')](_0x47181e,{'transaction':_0x41aec5});}})[_0xa2f4('0x17')](function(){_0x47181e['forEach'](function(_0x3cb1e2){socket[_0xa2f4('0x5f')](_0xa2f4('0x72'),{'UserId':_0x3cb1e2,'ChatQueueId':_0x40ef2b['id']});});});});});});})[_0xa2f4('0x17')](respondWithStatusCode(_0x2f913c,null))['catch'](handleError(_0x2f913c,null));};exports[_0xa2f4('0x73')]=function(_0x5c42c6,_0x3ffa7a){return db['ChatQueue']['find']({'where':{'id':_0x5c42c6['params']['id']}})[_0xa2f4('0x17')](handleEntityNotFound(_0x3ffa7a,null))['then'](function(_0x259f14){if(_0x259f14){return _0x259f14['addAgents'](_0x5c42c6[_0xa2f4('0x38')][_0xa2f4('0x56')],_[_0xa2f4('0x74')](_0x5c42c6[_0xa2f4('0x38')],['ids','id'])||{})['spread'](function(_0x1727fe){for(var _0x417142=0x0;_0x417142<_0x5c42c6[_0xa2f4('0x38')]['ids'][_0xa2f4('0x33')];_0x417142+=0x1){socket[_0xa2f4('0x5f')](_0xa2f4('0x75'),{'UserId':Number(_0x5c42c6[_0xa2f4('0x38')][_0xa2f4('0x56')][_0x417142]),'ChatQueueId':Number(_0x5c42c6['params']['id'])});}return _0x1727fe;});}})[_0xa2f4('0x17')](respondWithResult(_0x3ffa7a,null))[_0xa2f4('0x2c')](handleError(_0x3ffa7a,null));};exports['removeAgents']=function(_0x273660,_0x5b9223){return db[_0xa2f4('0x27')][_0xa2f4('0x36')]({'where':{'id':_0x273660[_0xa2f4('0x2e')]['id']}})[_0xa2f4('0x17')](handleEntityNotFound(_0x5b9223,null))[_0xa2f4('0x17')](function(_0x1e83e0){if(_0x1e83e0){return _0x1e83e0['removeAgents'](_0x273660[_0xa2f4('0x29')][_0xa2f4('0x56')])[_0xa2f4('0x17')](function(){if(_[_0xa2f4('0x76')](_0x273660[_0xa2f4('0x29')]['ids'])){for(var _0x20ba23=0x0;_0x20ba23<_0x273660[_0xa2f4('0x29')][_0xa2f4('0x56')][_0xa2f4('0x33')];_0x20ba23+=0x1){socket[_0xa2f4('0x5f')](_0xa2f4('0x72'),{'UserId':Number(_0x273660['query'][_0xa2f4('0x56')][_0x20ba23]),'ChatQueueId':Number(_0x273660[_0xa2f4('0x2e')]['id'])});}}else{socket[_0xa2f4('0x5f')](_0xa2f4('0x72'),{'UserId':Number(_0x273660[_0xa2f4('0x29')]['ids']),'ChatQueueId':Number(_0x273660[_0xa2f4('0x2e')]['id'])});}});}})[_0xa2f4('0x17')](respondWithStatusCode(_0x5b9223,null))['catch'](handleError(_0x5b9223,null));};exports[_0xa2f4('0x77')]=function(_0x2b2971,_0x5ec331){var _0x871d2b={};var _0x1829b6={};var _0x76f82d;var _0x560d73;return db['ChatQueue'][_0xa2f4('0x53')]({'where':{'id':_0x2b2971['params']['id']}})[_0xa2f4('0x17')](handleEntityNotFound(_0x5ec331,null))['then'](function(_0x845768){if(_0x845768){_0x76f82d=_0x845768;_0x1829b6['model']=_[_0xa2f4('0x40')](db[_0xa2f4('0x4a')][_0xa2f4('0x21')]);_0x1829b6[_0xa2f4('0x29')]=_['keys'](_0x2b2971[_0xa2f4('0x29')]);_0x1829b6[_0xa2f4('0x41')]=_[_0xa2f4('0x30')](_0x1829b6['model'],_0x1829b6[_0xa2f4('0x29')]);_0x871d2b[_0xa2f4('0x31')]=_[_0xa2f4('0x30')](_0x1829b6['model'],qs[_0xa2f4('0x32')](_0x2b2971['query'][_0xa2f4('0x32')]));_0x871d2b['attributes']=_0x871d2b[_0xa2f4('0x31')]['length']?_0x871d2b['attributes']:_0x1829b6[_0xa2f4('0x2f')];_0x871d2b['order']=qs['sort'](_0x2b2971['query'][_0xa2f4('0x45')]);_0x871d2b[_0xa2f4('0x26')]=qs['filters'](_[_0xa2f4('0x54')](_0x2b2971[_0xa2f4('0x29')],_0x1829b6[_0xa2f4('0x41')]));if(_0x2b2971[_0xa2f4('0x29')][_0xa2f4('0x47')]){_0x871d2b[_0xa2f4('0x26')]=_['merge'](_0x871d2b[_0xa2f4('0x26')],{'$or':_[_0xa2f4('0x20')](_0x871d2b[_0xa2f4('0x31')],function(_0x4eb1c6){var _0x2b598d={};_0x2b598d[_0x4eb1c6]={'$like':'%'+_0x2b2971[_0xa2f4('0x29')][_0xa2f4('0x47')]+'%'};return _0x2b598d;})});}_0x871d2b=_[_0xa2f4('0x48')]({},_0x871d2b,_0x2b2971[_0xa2f4('0x35')]);return _0x76f82d['getAgents'](_0x871d2b);}})['then'](function(_0x528e8a){if(_0x528e8a){_0x560d73=_0x528e8a['length'];if(!_0x2b2971[_0xa2f4('0x29')][_0xa2f4('0x42')](_0xa2f4('0x43'))){_0x871d2b[_0xa2f4('0x11')]=qs[_0xa2f4('0x11')](_0x2b2971[_0xa2f4('0x29')]['limit']);_0x871d2b[_0xa2f4('0x14')]=qs['offset'](_0x2b2971[_0xa2f4('0x29')]['offset']);}return _0x76f82d['getAgents'](_0x871d2b);}})['then'](function(_0x353945){if(_0x353945){return _0x353945?{'count':_0x560d73,'rows':_0x353945}:null;}})[_0xa2f4('0x17')](respondWithResult(_0x5ec331,null))[_0xa2f4('0x2c')](handleError(_0x5ec331,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 215c031..6c9c2bd 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 _0xd056=['hook','exports','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5ac257,_0x5b60ad){var _0x4e0118=function(_0x31a28e){while(--_0x31a28e){_0x5ac257['push'](_0x5ac257['shift']());}};_0x4e0118(++_0x5b60ad);}(_0xd056,0x142));var _0x6d05=function(_0x138a70,_0x50cb30){_0x138a70=_0x138a70-0x0;var _0x505885=_0xd056[_0x138a70];return _0x505885;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x6d05('0x0'))['db'][_0x6d05('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x6d05('0x2')](0x0);var events={'afterCreate':_0x6d05('0x3'),'afterUpdate':_0x6d05('0x4'),'afterDestroy':_0x6d05('0x5')};function emitEvent(_0x463830){return function(_0x55a338,_0x439ee9,_0x1367e9){ChatQueueEvents[_0x6d05('0x6')](_0x463830+':'+_0x55a338['id'],_0x55a338);ChatQueueEvents[_0x6d05('0x6')](_0x463830,_0x55a338);_0x1367e9(null);};}for(var e in events){if(events[_0x6d05('0x7')](e)){var event=events[e];ChatQueue[_0x6d05('0x8')](e,emitEvent(event));}}module[_0x6d05('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x9959=['hasOwnProperty','hook','events','ChatQueue','save','remove','emit'];(function(_0x49d744,_0x56323a){var _0xeef931=function(_0x30c8bc){while(--_0x30c8bc){_0x49d744['push'](_0x49d744['shift']());}};_0xeef931(++_0x56323a);}(_0x9959,0x1c2));var _0x9995=function(_0x423aa2,_0x2f3be3){_0x423aa2=_0x423aa2-0x0;var _0x4953fa=_0x9959[_0x423aa2];return _0x4953fa;};'use strict';var EventEmitter=require(_0x9995('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x9995('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9995('0x2'),'afterUpdate':'update','afterDestroy':_0x9995('0x3')};function emitEvent(_0x34fadd){return function(_0x4aeb64,_0x20e0f7,_0x486730){ChatQueueEvents[_0x9995('0x4')](_0x34fadd+':'+_0x4aeb64['id'],_0x4aeb64);ChatQueueEvents[_0x9995('0x4')](_0x34fadd,_0x4aeb64);_0x486730(null);};}for(var e in events){if(events[_0x9995('0x5')](e)){var event=events[e];ChatQueue[_0x9995('0x6')](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 d5fadc9..ff9362a 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 _0xa733=['bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa733,0x9a));var _0x3a73=function(_0x2b2375,_0x31530b){_0x2b2375=_0x2b2375-0x0;var _0x258f3a=_0xa733[_0x2b2375];return _0x258f3a;};'use strict';var _=require('lodash');var util=require(_0x3a73('0x0'));var logger=require(_0x3a73('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3a73('0x2'));var rp=require(_0x3a73('0x3'));var fs=require('fs');var path=require(_0x3a73('0x4'));var rimraf=require(_0x3a73('0x5'));var config=require(_0x3a73('0x6'));var attributes=require(_0x3a73('0x7'));module[_0x3a73('0x8')]=function(_0x223cdc,_0x113dbe){return _0x223cdc[_0x3a73('0x9')](_0x3a73('0xa'),attributes,{'tableName':_0x3a73('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3a21=['path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x24c7f7,_0x2bb77a){var _0x25604f=function(_0x418d16){while(--_0x418d16){_0x24c7f7['push'](_0x24c7f7['shift']());}};_0x25604f(++_0x2bb77a);}(_0x3a21,0x112));var _0x13a2=function(_0x2dd514,_0x4dc961){_0x2dd514=_0x2dd514-0x0;var _0x185a5f=_0x3a21[_0x2dd514];return _0x185a5f;};'use strict';var _=require(_0x13a2('0x0'));var util=require('util');var logger=require(_0x13a2('0x1'))(_0x13a2('0x2'));var moment=require(_0x13a2('0x3'));var BPromise=require(_0x13a2('0x4'));var rp=require(_0x13a2('0x5'));var fs=require('fs');var path=require(_0x13a2('0x6'));var rimraf=require(_0x13a2('0x7'));var config=require(_0x13a2('0x8'));var attributes=require(_0x13a2('0x9'));module[_0x13a2('0xa')]=function(_0x4a5d9a,_0x2d4def){return _0x4a5d9a[_0x13a2('0xb')](_0x13a2('0xc'),attributes,{'tableName':_0x13a2('0xd'),'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 b51a14c..23b07c5 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 _0xb875=['localhost','socket.io-emitter','./chatQueue.socket','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','map','include','model','catch','ShowChatQueue','lodash','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x48766b,_0x3fe640){var _0x1e5b04=function(_0x52205e){while(--_0x52205e){_0x48766b['push'](_0x48766b['shift']());}};_0x1e5b04(++_0x3fe640);}(_0xb875,0x167));var _0x5b87=function(_0x3a7cae,_0xfa58d){_0x3a7cae=_0x3a7cae-0x0;var _0x3a0869=_0xb875[_0x3a7cae];return _0x3a0869;};'use strict';var _=require(_0x5b87('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b87('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b87('0x2'))['db'];var utils=require(_0x5b87('0x3'));var logger=require('../../config/logger')(_0x5b87('0x4'));var config=require(_0x5b87('0x5'));var jayson=require(_0x5b87('0x6'));var client=jayson[_0x5b87('0x7')][_0x5b87('0x8')]({'port':0x232a});config[_0x5b87('0x9')]=_[_0x5b87('0xa')](config[_0x5b87('0x9')],{'host':_0x5b87('0xb'),'port':0x18eb});var socket=require(_0x5b87('0xc'))(new Redis(config['redis']));require(_0x5b87('0xd'))['register'](socket);function respondWithRpcPromise(_0x32d5fc,_0x394cd2,_0x131314){return new BPromise(function(_0x22af59,_0x508c10){return client['request'](_0x32d5fc,_0x131314)[_0x5b87('0xe')](function(_0x42af88){logger['info'](_0x5b87('0xf'),_0x394cd2,_0x5b87('0x10'));logger[_0x5b87('0x11')](_0x5b87('0x12'),_0x394cd2,_0x5b87('0x10'),JSON[_0x5b87('0x13')](_0x42af88));if(_0x42af88[_0x5b87('0x14')]){if(_0x42af88[_0x5b87('0x14')][_0x5b87('0x15')]===0x1f4){logger['error'](_0x5b87('0xf'),_0x394cd2,_0x42af88['error'][_0x5b87('0x16')]);return _0x508c10(_0x42af88[_0x5b87('0x14')]['message']);}logger['error'](_0x5b87('0xf'),_0x394cd2,_0x42af88['error'][_0x5b87('0x16')]);return _0x22af59(_0x42af88[_0x5b87('0x14')][_0x5b87('0x16')]);}else{logger[_0x5b87('0x17')](_0x5b87('0xf'),_0x394cd2,_0x5b87('0x10'));_0x22af59(_0x42af88[_0x5b87('0x18')]['message']);}})['catch'](function(_0x4d9b3b){logger['error'](_0x5b87('0xf'),_0x394cd2,_0x4d9b3b);_0x508c10(_0x4d9b3b);});});}exports[_0x5b87('0x19')]=function(_0x382157){var _0x1b46cc=this;return new Promise(function(_0x17c6be,_0x5491ec){return db[_0x5b87('0x1a')]['findAll']({'raw':_0x382157['options']?_0x382157[_0x5b87('0x1b')][_0x5b87('0x1c')]===undefined?!![]:![]:!![],'where':_0x382157['options']?_0x382157[_0x5b87('0x1b')][_0x5b87('0x1d')]||null:null,'attributes':_0x382157[_0x5b87('0x1b')]?_0x382157[_0x5b87('0x1b')][_0x5b87('0x1e')]||null:null,'limit':_0x382157[_0x5b87('0x1b')]?_0x382157[_0x5b87('0x1b')][_0x5b87('0x1f')]||null:null,'include':_0x382157[_0x5b87('0x1b')]?_0x382157[_0x5b87('0x1b')]['include']?_[_0x5b87('0x20')](_0x382157[_0x5b87('0x1b')][_0x5b87('0x21')],function(_0x19d2d4){return{'model':db[_0x19d2d4[_0x5b87('0x22')]],'as':_0x19d2d4['as'],'attributes':_0x19d2d4[_0x5b87('0x1e')],'include':_0x19d2d4[_0x5b87('0x21')]?_[_0x5b87('0x20')](_0x19d2d4[_0x5b87('0x21')],function(_0x1b01f1){return{'model':db[_0x1b01f1[_0x5b87('0x22')]],'as':_0x1b01f1['as'],'attributes':_0x1b01f1['attributes'],'include':_0x1b01f1['include']?_[_0x5b87('0x20')](_0x1b01f1['include'],function(_0x706a59){return{'model':db[_0x706a59[_0x5b87('0x22')]],'as':_0x706a59['as'],'attributes':_0x706a59['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43c0a0){logger[_0x5b87('0x17')](_0x5b87('0x19'),_0x382157);logger[_0x5b87('0x11')](_0x5b87('0x19'),_0x382157,JSON['stringify'](_0x43c0a0));_0x17c6be(_0x43c0a0);})[_0x5b87('0x23')](function(_0x3d41ad){logger['error'](_0x5b87('0x19'),_0x3d41ad['message'],_0x382157);_0x5491ec(_0x1b46cc[_0x5b87('0x14')](0x1f4,_0x3d41ad[_0x5b87('0x16')]));});});};exports[_0x5b87('0x24')]=function(_0x4f1ea5){var _0x22d559=this;return new Promise(function(_0x17e3e3,_0x218752){return db[_0x5b87('0x1a')]['find']({'raw':_0x4f1ea5['options']?_0x4f1ea5['options'][_0x5b87('0x1c')]===undefined?!![]:![]:!![],'where':_0x4f1ea5['options']?_0x4f1ea5[_0x5b87('0x1b')]['where']||null:null,'attributes':_0x4f1ea5[_0x5b87('0x1b')]?_0x4f1ea5[_0x5b87('0x1b')]['attributes']||null:null,'include':_0x4f1ea5[_0x5b87('0x1b')]?_0x4f1ea5[_0x5b87('0x1b')][_0x5b87('0x21')]?_[_0x5b87('0x20')](_0x4f1ea5['options'][_0x5b87('0x21')],function(_0xfb83bf){return{'model':db[_0xfb83bf[_0x5b87('0x22')]],'as':_0xfb83bf['as'],'attributes':_0xfb83bf[_0x5b87('0x1e')],'include':_0xfb83bf[_0x5b87('0x21')]?_[_0x5b87('0x20')](_0xfb83bf[_0x5b87('0x21')],function(_0x3afa0d){return{'model':db[_0x3afa0d[_0x5b87('0x22')]],'as':_0x3afa0d['as'],'attributes':_0x3afa0d[_0x5b87('0x1e')],'include':_0x3afa0d[_0x5b87('0x21')]?_['map'](_0x3afa0d[_0x5b87('0x21')],function(_0x50acf8){return{'model':db[_0x50acf8[_0x5b87('0x22')]],'as':_0x50acf8['as'],'attributes':_0x50acf8[_0x5b87('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5b87('0xe')](function(_0x4e03fd){logger[_0x5b87('0x17')](_0x5b87('0x24'),_0x4f1ea5);logger[_0x5b87('0x11')](_0x5b87('0x24'),_0x4f1ea5,JSON[_0x5b87('0x13')](_0x4e03fd));_0x17e3e3(_0x4e03fd);})[_0x5b87('0x23')](function(_0x50e944){logger[_0x5b87('0x14')](_0x5b87('0x24'),_0x50e944['message'],_0x4f1ea5);_0x218752(_0x22d559[_0x5b87('0x14')](0x1f4,_0x50e944[_0x5b87('0x16')]));});});};
\ No newline at end of file
+var _0xc1bd=['options','raw','where','limit','map','include','model','attributes','ShowChatQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetChatQueue','ChatQueue','findAll'];(function(_0x3e3f62,_0x2d53bb){var _0x1debd7=function(_0x5cc1d8){while(--_0x5cc1d8){_0x3e3f62['push'](_0x3e3f62['shift']());}};_0x1debd7(++_0x2d53bb);}(_0xc1bd,0xd2));var _0xdc1b=function(_0x24f387,_0x13d380){_0x24f387=_0x24f387-0x0;var _0x160b4c=_0xc1bd[_0x24f387];return _0x160b4c;};'use strict';var _=require('lodash');var util=require(_0xdc1b('0x0'));var moment=require(_0xdc1b('0x1'));var BPromise=require(_0xdc1b('0x2'));var rs=require(_0xdc1b('0x3'));var fs=require('fs');var Redis=require(_0xdc1b('0x4'));var db=require(_0xdc1b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc1b('0x6'))(_0xdc1b('0x7'));var config=require('../../config/environment');var jayson=require(_0xdc1b('0x8'));var client=jayson[_0xdc1b('0x9')][_0xdc1b('0xa')]({'port':0x232a});config['redis']=_[_0xdc1b('0xb')](config[_0xdc1b('0xc')],{'host':_0xdc1b('0xd'),'port':0x18eb});var socket=require(_0xdc1b('0xe'))(new Redis(config[_0xdc1b('0xc')]));require('./chatQueue.socket')[_0xdc1b('0xf')](socket);function respondWithRpcPromise(_0x371699,_0xfdd9e9,_0x3ff980){return new BPromise(function(_0x52d17c,_0x112d8b){return client['request'](_0x371699,_0x3ff980)[_0xdc1b('0x10')](function(_0x3ab1c2){logger[_0xdc1b('0x11')](_0xdc1b('0x12'),_0xfdd9e9,'request\x20sent');logger[_0xdc1b('0x13')](_0xdc1b('0x14'),_0xfdd9e9,_0xdc1b('0x15'),JSON[_0xdc1b('0x16')](_0x3ab1c2));if(_0x3ab1c2[_0xdc1b('0x17')]){if(_0x3ab1c2[_0xdc1b('0x17')]['code']===0x1f4){logger[_0xdc1b('0x17')](_0xdc1b('0x12'),_0xfdd9e9,_0x3ab1c2['error']['message']);return _0x112d8b(_0x3ab1c2[_0xdc1b('0x17')][_0xdc1b('0x18')]);}logger['error'](_0xdc1b('0x12'),_0xfdd9e9,_0x3ab1c2[_0xdc1b('0x17')][_0xdc1b('0x18')]);return _0x52d17c(_0x3ab1c2[_0xdc1b('0x17')][_0xdc1b('0x18')]);}else{logger[_0xdc1b('0x11')]('ChatQueue,\x20%s,\x20%s',_0xfdd9e9,_0xdc1b('0x15'));_0x52d17c(_0x3ab1c2[_0xdc1b('0x19')][_0xdc1b('0x18')]);}})[_0xdc1b('0x1a')](function(_0x54598c){logger[_0xdc1b('0x17')](_0xdc1b('0x12'),_0xfdd9e9,_0x54598c);_0x112d8b(_0x54598c);});});}exports[_0xdc1b('0x1b')]=function(_0x5a6c91){var _0x4d8d41=this;return new Promise(function(_0x5ad463,_0x4d71e2){return db[_0xdc1b('0x1c')][_0xdc1b('0x1d')]({'raw':_0x5a6c91[_0xdc1b('0x1e')]?_0x5a6c91['options'][_0xdc1b('0x1f')]===undefined?!![]:![]:!![],'where':_0x5a6c91[_0xdc1b('0x1e')]?_0x5a6c91['options'][_0xdc1b('0x20')]||null:null,'attributes':_0x5a6c91['options']?_0x5a6c91['options']['attributes']||null:null,'limit':_0x5a6c91[_0xdc1b('0x1e')]?_0x5a6c91[_0xdc1b('0x1e')][_0xdc1b('0x21')]||null:null,'include':_0x5a6c91[_0xdc1b('0x1e')]?_0x5a6c91[_0xdc1b('0x1e')]['include']?_[_0xdc1b('0x22')](_0x5a6c91[_0xdc1b('0x1e')][_0xdc1b('0x23')],function(_0x36ab40){return{'model':db[_0x36ab40[_0xdc1b('0x24')]],'as':_0x36ab40['as'],'attributes':_0x36ab40[_0xdc1b('0x25')],'include':_0x36ab40[_0xdc1b('0x23')]?_[_0xdc1b('0x22')](_0x36ab40['include'],function(_0x48728d){return{'model':db[_0x48728d[_0xdc1b('0x24')]],'as':_0x48728d['as'],'attributes':_0x48728d[_0xdc1b('0x25')],'include':_0x48728d[_0xdc1b('0x23')]?_[_0xdc1b('0x22')](_0x48728d[_0xdc1b('0x23')],function(_0x3163c2){return{'model':db[_0x3163c2[_0xdc1b('0x24')]],'as':_0x3163c2['as'],'attributes':_0x3163c2[_0xdc1b('0x25')]};}):[]};}):[]};}):[]:[]})[_0xdc1b('0x10')](function(_0x2e976f){logger[_0xdc1b('0x11')](_0xdc1b('0x1b'),_0x5a6c91);logger[_0xdc1b('0x13')](_0xdc1b('0x1b'),_0x5a6c91,JSON[_0xdc1b('0x16')](_0x2e976f));_0x5ad463(_0x2e976f);})[_0xdc1b('0x1a')](function(_0x4532d6){logger[_0xdc1b('0x17')]('GetChatQueue',_0x4532d6[_0xdc1b('0x18')],_0x5a6c91);_0x4d71e2(_0x4d8d41[_0xdc1b('0x17')](0x1f4,_0x4532d6[_0xdc1b('0x18')]));});});};exports[_0xdc1b('0x26')]=function(_0x21a498){var _0x22290f=this;return new Promise(function(_0x2efc3d,_0x2f6bb3){return db[_0xdc1b('0x1c')][_0xdc1b('0x27')]({'raw':_0x21a498[_0xdc1b('0x1e')]?_0x21a498[_0xdc1b('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x21a498[_0xdc1b('0x1e')]?_0x21a498[_0xdc1b('0x1e')]['where']||null:null,'attributes':_0x21a498[_0xdc1b('0x1e')]?_0x21a498[_0xdc1b('0x1e')][_0xdc1b('0x25')]||null:null,'include':_0x21a498[_0xdc1b('0x1e')]?_0x21a498['options']['include']?_[_0xdc1b('0x22')](_0x21a498[_0xdc1b('0x1e')][_0xdc1b('0x23')],function(_0x1a71af){return{'model':db[_0x1a71af['model']],'as':_0x1a71af['as'],'attributes':_0x1a71af[_0xdc1b('0x25')],'include':_0x1a71af[_0xdc1b('0x23')]?_[_0xdc1b('0x22')](_0x1a71af['include'],function(_0x10692d){return{'model':db[_0x10692d[_0xdc1b('0x24')]],'as':_0x10692d['as'],'attributes':_0x10692d[_0xdc1b('0x25')],'include':_0x10692d[_0xdc1b('0x23')]?_['map'](_0x10692d[_0xdc1b('0x23')],function(_0xe4ea08){return{'model':db[_0xe4ea08['model']],'as':_0xe4ea08['as'],'attributes':_0xe4ea08['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x575dd6){logger[_0xdc1b('0x11')]('ShowChatQueue',_0x21a498);logger[_0xdc1b('0x13')]('ShowChatQueue',_0x21a498,JSON[_0xdc1b('0x16')](_0x575dd6));_0x2efc3d(_0x575dd6);})['catch'](function(_0x29be93){logger[_0xdc1b('0x17')]('ShowChatQueue',_0x29be93[_0xdc1b('0x18')],_0x21a498);_0x2f6bb3(_0x22290f[_0xdc1b('0x17')](0x1f4,_0x29be93[_0xdc1b('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index ffd097f..a6b0729 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 _0x008c=['./chatQueue.events','save','remove','update','emit','removeListener','register','chatQueue:'];(function(_0xa6b5b9,_0x1e4e0a){var _0x2ea6d7=function(_0x52eba9){while(--_0x52eba9){_0xa6b5b9['push'](_0xa6b5b9['shift']());}};_0x2ea6d7(++_0x1e4e0a);}(_0x008c,0x188));var _0xc008=function(_0x404eff,_0x4ef653){_0x404eff=_0x404eff-0x0;var _0x46cc25=_0x008c[_0x404eff];return _0x46cc25;};'use strict';var ChatQueueEvents=require(_0xc008('0x0'));var events=[_0xc008('0x1'),_0xc008('0x2'),_0xc008('0x3')];function createListener(_0x1d119a,_0x544fdf){return function(_0x3641af){_0x544fdf[_0xc008('0x4')](_0x1d119a,_0x3641af);};}function removeListener(_0x10b33c,_0x163bd9){return function(){ChatQueueEvents[_0xc008('0x5')](_0x10b33c,_0x163bd9);};}exports[_0xc008('0x6')]=function(_0x13aa7){for(var _0x39bb5e=0x0,_0x9c8cb2=events['length'];_0x39bb5e<_0x9c8cb2;_0x39bb5e++){var _0x428fa9=events[_0x39bb5e];var _0x5aa09b=createListener(_0xc008('0x7')+_0x428fa9,_0x13aa7);ChatQueueEvents['on'](_0x428fa9,_0x5aa09b);}};
\ No newline at end of file
+var _0x7a2c=['chatQueue:','./chatQueue.events','remove','update','emit','register'];(function(_0x1c1e8c,_0x51a59b){var _0x23a5df=function(_0x25bb87){while(--_0x25bb87){_0x1c1e8c['push'](_0x1c1e8c['shift']());}};_0x23a5df(++_0x51a59b);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x12ddfb,_0x5e7808){_0x12ddfb=_0x12ddfb-0x0;var _0x712d01=_0x7a2c[_0x12ddfb];return _0x712d01;};'use strict';var ChatQueueEvents=require(_0xc7a2('0x0'));var events=['save',_0xc7a2('0x1'),_0xc7a2('0x2')];function createListener(_0x409ec5,_0x26fb61){return function(_0x44d702){_0x26fb61[_0xc7a2('0x3')](_0x409ec5,_0x44d702);};}function removeListener(_0x3f2b0d,_0x34cd60){return function(){ChatQueueEvents['removeListener'](_0x3f2b0d,_0x34cd60);};}exports[_0xc7a2('0x4')]=function(_0x1ddbae){for(var _0x5f334e=0x0,_0x481430=events['length'];_0x5f334e<_0x481430;_0x5f334e++){var _0x1dd150=events[_0x5f334e];var _0x3de428=createListener(_0xc7a2('0x5')+_0x1dd150,_0x1ddbae);ChatQueueEvents['on'](_0x1dd150,_0x3de428);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 8ad25ef..7c09fe2 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x1ee91b,_0x2156d8){var _0x32ce3a=function(_0x520630){while(--_0x520630){_0x1ee91b['push'](_0x1ee91b['shift']());}};_0x32ce3a(++_0x2156d8);}(_0xe14b,0x93));var _0xbe14=function(_0x396531,_0x245582){_0x396531=_0x396531-0x0;var _0x1ef51a=_0xe14b[_0x396531];return _0x1ef51a;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x52d8b9,_0xe54454){var _0x126b5b=function(_0x43d8c8){while(--_0x43d8c8){_0x52d8b9['push'](_0x52d8b9['shift']());}};_0x126b5b(++_0xe54454);}(_0x814b,0x1a2));var _0xb814=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x814b[_0x50aa2e];return _0x5e07f0;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index e6cb31c..a4d6e8d 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 _0xd939=['moment','sequelize','STRING','DATE'];(function(_0x3be2d0,_0x3fd9b4){var _0xfc5ccf=function(_0x35f134){while(--_0x35f134){_0x3be2d0['push'](_0x3be2d0['shift']());}};_0xfc5ccf(++_0x3fd9b4);}(_0xd939,0x1b4));var _0x9d93=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0xd939[_0x178856];return _0x3c7fe7;};'use strict';var moment=require(_0x9d93('0x0'));var Sequelize=require(_0x9d93('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9d93('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9d93('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9d93('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5612=['moment','sequelize','exports','STRING','DATE'];(function(_0x53e82b,_0x1c3157){var _0x482bec=function(_0x2ded11){while(--_0x2ded11){_0x53e82b['push'](_0x53e82b['shift']());}};_0x482bec(++_0x1c3157);}(_0x5612,0x19a));var _0x2561=function(_0x976d1a,_0x1d45b3){_0x976d1a=_0x976d1a-0x0;var _0x4dc6b2=_0x5612[_0x976d1a];return _0x4dc6b2;};'use strict';var moment=require(_0x2561('0x0'));var Sequelize=require(_0x2561('0x1'));module[_0x2561('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x2561('0x3')]},'joinAt':{'type':Sequelize[_0x2561('0x4')]},'leaveAt':{'type':Sequelize[_0x2561('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2561('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 d3400eb..5e84b03 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 _0x4cfd=['destroy','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','end','sendStatus','stack','send','map','ChatQueueReport','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','show','rawAttributes','find','catch','create','body'];(function(_0x350796,_0x1bf21f){var _0x126f19=function(_0x4d7591){while(--_0x4d7591){_0x350796['push'](_0x350796['shift']());}};_0x126f19(++_0x1bf21f);}(_0x4cfd,0x170));var _0xd4cf=function(_0x2e913b,_0x4b7071){_0x2e913b=_0x2e913b-0x0;var _0x173899=_0x4cfd[_0x2e913b];return _0x173899;};'use strict';var emlformat=require(_0xd4cf('0x0'));var rimraf=require(_0xd4cf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4cf('0x2'));var rp=require(_0xd4cf('0x3'));var moment=require(_0xd4cf('0x4'));var BPromise=require(_0xd4cf('0x5'));var Mustache=require(_0xd4cf('0x6'));var util=require(_0xd4cf('0x7'));var path=require('path');var sox=require(_0xd4cf('0x8'));var csv=require(_0xd4cf('0x9'));var ejs=require(_0xd4cf('0xa'));var fs=require('fs');var fs_extra=require(_0xd4cf('0xb'));var _=require(_0xd4cf('0xc'));var squel=require(_0xd4cf('0xd'));var crypto=require('crypto');var jsforce=require(_0xd4cf('0xe'));var deskjs=require(_0xd4cf('0xf'));var toCsv=require(_0xd4cf('0x9'));var querystring=require(_0xd4cf('0x10'));var Papa=require(_0xd4cf('0x11'));var Redis=require(_0xd4cf('0x12'));var authService=require(_0xd4cf('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd4cf('0x14'));var hardwareService=require(_0xd4cf('0x15'));var logger=require(_0xd4cf('0x16'))(_0xd4cf('0x17'));var utils=require(_0xd4cf('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd4cf('0x19'))['db'];function respondWithStatusCode(_0x294c99,_0x544065){_0x544065=_0x544065||0xcc;return function(_0x3ff2db){if(_0x3ff2db){return _0x294c99['sendStatus'](_0x544065);}return _0x294c99[_0xd4cf('0x1a')](_0x544065)['end']();};}function respondWithResult(_0x330630,_0xa597cd){_0xa597cd=_0xa597cd||0xc8;return function(_0x51c61e){if(_0x51c61e){return _0x330630[_0xd4cf('0x1a')](_0xa597cd)[_0xd4cf('0x1b')](_0x51c61e);}};}function respondWithFilteredResult(_0x2f8607,_0x13c0a1){return function(_0x44abd7){if(_0x44abd7){var _0x2ff69e=typeof _0x13c0a1['offset']===_0xd4cf('0x1c')&&typeof _0x13c0a1[_0xd4cf('0x1d')]===_0xd4cf('0x1c');var _0x11b06a=_0x44abd7[_0xd4cf('0x1e')];var _0x3e749d=_0x2ff69e?0x0:_0x13c0a1[_0xd4cf('0x1f')];var _0x1df3e0=_0x2ff69e?_0x44abd7[_0xd4cf('0x1e')]:_0x13c0a1[_0xd4cf('0x1f')]+_0x13c0a1[_0xd4cf('0x1d')];var _0x540e2b;if(_0x1df3e0>=_0x11b06a){_0x1df3e0=_0x11b06a;_0x540e2b=0xc8;}else{_0x540e2b=0xce;}_0x2f8607[_0xd4cf('0x1a')](_0x540e2b);return _0x2f8607[_0xd4cf('0x20')](_0xd4cf('0x21'),_0x3e749d+'-'+_0x1df3e0+'/'+_0x11b06a)[_0xd4cf('0x1b')](_0x44abd7);}return null;};}function patchUpdates(_0x1caa70){return function(_0x2bef15){try{jsonpatch[_0xd4cf('0x22')](_0x2bef15,_0x1caa70,!![]);}catch(_0x5338dc){return BPromise[_0xd4cf('0x23')](_0x5338dc);}return _0x2bef15['save']();};}function saveUpdates(_0x4ec111,_0x10f6a7){return function(_0x3dbe6d){if(_0x3dbe6d){return _0x3dbe6d[_0xd4cf('0x24')](_0x4ec111)[_0xd4cf('0x25')](function(_0x2fe806){return _0x2fe806;});}return null;};}function removeEntity(_0x40c251,_0x54aaab){return function(_0x14c159){if(_0x14c159){return _0x14c159['destroy']()[_0xd4cf('0x25')](function(){_0x40c251[_0xd4cf('0x1a')](0xcc)[_0xd4cf('0x26')]();});}};}function handleEntityNotFound(_0x4c1896,_0x5266aa){return function(_0x52c21b){if(!_0x52c21b){_0x4c1896[_0xd4cf('0x27')](0x194);}return _0x52c21b;};}function handleError(_0x413317,_0x4fd6ea){_0x4fd6ea=_0x4fd6ea||0x1f4;return function(_0x59c215){logger['error'](_0x59c215[_0xd4cf('0x28')]);if(_0x59c215['name']){delete _0x59c215['name'];}_0x413317['status'](_0x4fd6ea)[_0xd4cf('0x29')](_0x59c215);};}exports['index']=function(_0xd08f38,_0xa9ae56){var _0x2459f4={},_0x3b507f={},_0x45943d={'count':0x0,'rows':[]};var _0x2183c1=_[_0xd4cf('0x2a')](db[_0xd4cf('0x2b')]['rawAttributes'],function(_0x1c6ae5){return{'name':_0x1c6ae5[_0xd4cf('0x2c')],'type':_0x1c6ae5[_0xd4cf('0x2d')]['key']};});_0x3b507f['model']=_[_0xd4cf('0x2a')](_0x2183c1,_0xd4cf('0x2e'));_0x3b507f[_0xd4cf('0x2f')]=_[_0xd4cf('0x30')](_0xd08f38[_0xd4cf('0x2f')]);_0x3b507f[_0xd4cf('0x31')]=_[_0xd4cf('0x32')](_0x3b507f[_0xd4cf('0x33')],_0x3b507f['query']);_0x2459f4[_0xd4cf('0x34')]=_[_0xd4cf('0x32')](_0x3b507f[_0xd4cf('0x33')],qs[_0xd4cf('0x35')](_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x35')]));_0x2459f4[_0xd4cf('0x34')]=_0x2459f4[_0xd4cf('0x34')][_0xd4cf('0x36')]?_0x2459f4[_0xd4cf('0x34')]:_0x3b507f[_0xd4cf('0x33')];if(!_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x37')]('nolimit')){_0x2459f4['limit']=qs[_0xd4cf('0x1d')](_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x1d')]);_0x2459f4[_0xd4cf('0x1f')]=qs[_0xd4cf('0x1f')](_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x1f')]);}_0x2459f4[_0xd4cf('0x38')]=qs['sort'](_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x39')]);_0x2459f4[_0xd4cf('0x3a')]=qs['filters'](_['pick'](_0xd08f38[_0xd4cf('0x2f')],_0x3b507f[_0xd4cf('0x31')]),_0x2183c1);if(_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x3b')]){_0x2459f4['where']=_[_0xd4cf('0x3c')](_0x2459f4[_0xd4cf('0x3a')],{'$or':_[_0xd4cf('0x2a')](_0x2183c1,function(_0x222669){if(_0x222669['type']!=='VIRTUAL'){var _0x4aeaa8={};_0x4aeaa8[_0x222669[_0xd4cf('0x2e')]]={'$like':'%'+_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x3b')]+'%'};return _0x4aeaa8;}})});}_0x2459f4=_[_0xd4cf('0x3c')]({},_0x2459f4,_0xd08f38[_0xd4cf('0x3d')]);var _0x17a8ee={'where':_0x2459f4[_0xd4cf('0x3a')]};return db[_0xd4cf('0x2b')]['count'](_0x17a8ee)['then'](function(_0x52fa6b){_0x45943d[_0xd4cf('0x1e')]=_0x52fa6b;if(_0xd08f38['query'][_0xd4cf('0x3e')]){_0x2459f4[_0xd4cf('0x3f')]=[{'all':!![]}];}return db[_0xd4cf('0x2b')]['findAll'](_0x2459f4);})[_0xd4cf('0x25')](function(_0x1ee4e2){_0x45943d['rows']=_0x1ee4e2;return _0x45943d;})[_0xd4cf('0x25')](respondWithFilteredResult(_0xa9ae56,_0x2459f4))['catch'](handleError(_0xa9ae56,null));};exports[_0xd4cf('0x40')]=function(_0x4b6da5,_0x4541db){var _0x476b2d={'raw':!![],'where':{'id':_0x4b6da5['params']['id']}},_0x4b874e={};_0x4b874e['model']=_[_0xd4cf('0x30')](db[_0xd4cf('0x2b')][_0xd4cf('0x41')]);_0x4b874e[_0xd4cf('0x2f')]=_[_0xd4cf('0x30')](_0x4b6da5[_0xd4cf('0x2f')]);_0x4b874e['filters']=_[_0xd4cf('0x32')](_0x4b874e[_0xd4cf('0x33')],_0x4b874e[_0xd4cf('0x2f')]);_0x476b2d[_0xd4cf('0x34')]=_['intersection'](_0x4b874e[_0xd4cf('0x33')],qs['fields'](_0x4b6da5[_0xd4cf('0x2f')][_0xd4cf('0x35')]));_0x476b2d['attributes']=_0x476b2d['attributes'][_0xd4cf('0x36')]?_0x476b2d[_0xd4cf('0x34')]:_0x4b874e['model'];if(_0x4b6da5[_0xd4cf('0x2f')][_0xd4cf('0x3e')]){_0x476b2d[_0xd4cf('0x3f')]=[{'all':!![]}];}_0x476b2d=_[_0xd4cf('0x3c')]({},_0x476b2d,_0x4b6da5[_0xd4cf('0x3d')]);return db['ChatQueueReport'][_0xd4cf('0x42')](_0x476b2d)[_0xd4cf('0x25')](handleEntityNotFound(_0x4541db,null))[_0xd4cf('0x25')](respondWithResult(_0x4541db,null))[_0xd4cf('0x43')](handleError(_0x4541db,null));};exports[_0xd4cf('0x44')]=function(_0x1a547a,_0x55504f){return db[_0xd4cf('0x2b')][_0xd4cf('0x44')](_0x1a547a[_0xd4cf('0x45')],{})[_0xd4cf('0x25')](respondWithResult(_0x55504f,0xc9))[_0xd4cf('0x43')](handleError(_0x55504f,null));};exports[_0xd4cf('0x24')]=function(_0x14af9f,_0x532c7b){if(_0x14af9f[_0xd4cf('0x45')]['id']){delete _0x14af9f[_0xd4cf('0x45')]['id'];}return db[_0xd4cf('0x2b')][_0xd4cf('0x42')]({'where':{'id':_0x14af9f['params']['id']}})[_0xd4cf('0x25')](handleEntityNotFound(_0x532c7b,null))[_0xd4cf('0x25')](saveUpdates(_0x14af9f[_0xd4cf('0x45')],null))[_0xd4cf('0x25')](respondWithResult(_0x532c7b,null))[_0xd4cf('0x43')](handleError(_0x532c7b,null));};exports[_0xd4cf('0x46')]=function(_0xe69dbf,_0x4fd5e0){return db['ChatQueueReport']['find']({'where':{'id':_0xe69dbf[_0xd4cf('0x47')]['id']}})[_0xd4cf('0x25')](handleEntityNotFound(_0x4fd5e0,null))[_0xd4cf('0x25')](removeEntity(_0x4fd5e0,null))[_0xd4cf('0x43')](handleError(_0x4fd5e0,null));};exports[_0xd4cf('0x48')]=function(_0x4934a0,_0x54bb75){return db[_0xd4cf('0x2b')]['describe']()[_0xd4cf('0x25')](respondWithResult(_0x54bb75,null))[_0xd4cf('0x43')](handleError(_0x54bb75,null));};
\ No newline at end of file
+var _0xdbb9=['map','ChatQueueReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy','stack','name','index'];(function(_0x372215,_0x4700f1){var _0x5ebeba=function(_0x28e54b){while(--_0x28e54b){_0x372215['push'](_0x372215['shift']());}};_0x5ebeba(++_0x4700f1);}(_0xdbb9,0xf9));var _0x9dbb=function(_0x416152,_0x2e5f33){_0x416152=_0x416152-0x0;var _0x10586d=_0xdbb9[_0x416152];return _0x10586d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9dbb('0x0'));var zipdir=require(_0x9dbb('0x1'));var jsonpatch=require(_0x9dbb('0x2'));var rp=require(_0x9dbb('0x3'));var moment=require('moment');var BPromise=require(_0x9dbb('0x4'));var Mustache=require(_0x9dbb('0x5'));var util=require(_0x9dbb('0x6'));var path=require(_0x9dbb('0x7'));var sox=require(_0x9dbb('0x8'));var csv=require(_0x9dbb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9dbb('0xa'));var crypto=require(_0x9dbb('0xb'));var jsforce=require(_0x9dbb('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9dbb('0xd'));var Papa=require(_0x9dbb('0xe'));var Redis=require(_0x9dbb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9dbb('0x10'));var as=require(_0x9dbb('0x11'));var hardwareService=require(_0x9dbb('0x12'));var logger=require(_0x9dbb('0x13'))('api');var utils=require(_0x9dbb('0x14'));var config=require(_0x9dbb('0x15'));var licenseUtil=require(_0x9dbb('0x16'));var db=require(_0x9dbb('0x17'))['db'];function respondWithStatusCode(_0x3fe0bd,_0x4468e8){_0x4468e8=_0x4468e8||0xcc;return function(_0x382cc6){if(_0x382cc6){return _0x3fe0bd[_0x9dbb('0x18')](_0x4468e8);}return _0x3fe0bd[_0x9dbb('0x19')](_0x4468e8)[_0x9dbb('0x1a')]();};}function respondWithResult(_0x293028,_0x2c36d3){_0x2c36d3=_0x2c36d3||0xc8;return function(_0x24b20b){if(_0x24b20b){return _0x293028[_0x9dbb('0x19')](_0x2c36d3)[_0x9dbb('0x1b')](_0x24b20b);}};}function respondWithFilteredResult(_0x464df5,_0x528110){return function(_0x1366b2){if(_0x1366b2){var _0x30add1=typeof _0x528110[_0x9dbb('0x1c')]===_0x9dbb('0x1d')&&typeof _0x528110[_0x9dbb('0x1e')]==='undefined';var _0x382d61=_0x1366b2[_0x9dbb('0x1f')];var _0x2383cf=_0x30add1?0x0:_0x528110[_0x9dbb('0x1c')];var _0x45c6f5=_0x30add1?_0x1366b2['count']:_0x528110[_0x9dbb('0x1c')]+_0x528110['limit'];var _0x3de435;if(_0x45c6f5>=_0x382d61){_0x45c6f5=_0x382d61;_0x3de435=0xc8;}else{_0x3de435=0xce;}_0x464df5['status'](_0x3de435);return _0x464df5[_0x9dbb('0x20')]('Content-Range',_0x2383cf+'-'+_0x45c6f5+'/'+_0x382d61)[_0x9dbb('0x1b')](_0x1366b2);}return null;};}function patchUpdates(_0x192eb5){return function(_0x188c75){try{jsonpatch['apply'](_0x188c75,_0x192eb5,!![]);}catch(_0x50e5e3){return BPromise['reject'](_0x50e5e3);}return _0x188c75[_0x9dbb('0x21')]();};}function saveUpdates(_0x35c136,_0x48bb65){return function(_0x4a07ef){if(_0x4a07ef){return _0x4a07ef['update'](_0x35c136)[_0x9dbb('0x22')](function(_0x245d12){return _0x245d12;});}return null;};}function removeEntity(_0x10c06a,_0x55e2ef){return function(_0x1f30ec){if(_0x1f30ec){return _0x1f30ec[_0x9dbb('0x23')]()[_0x9dbb('0x22')](function(){_0x10c06a[_0x9dbb('0x19')](0xcc)[_0x9dbb('0x1a')]();});}};}function handleEntityNotFound(_0x3e51ca,_0x668f7b){return function(_0x187486){if(!_0x187486){_0x3e51ca[_0x9dbb('0x18')](0x194);}return _0x187486;};}function handleError(_0x127742,_0x25614a){_0x25614a=_0x25614a||0x1f4;return function(_0x27a6f6){logger['error'](_0x27a6f6[_0x9dbb('0x24')]);if(_0x27a6f6['name']){delete _0x27a6f6[_0x9dbb('0x25')];}_0x127742[_0x9dbb('0x19')](_0x25614a)['send'](_0x27a6f6);};}exports[_0x9dbb('0x26')]=function(_0x4ebd57,_0x4b5ce1){var _0x589f63={},_0x25555c={},_0x3578b3={'count':0x0,'rows':[]};var _0x491324=_[_0x9dbb('0x27')](db[_0x9dbb('0x28')]['rawAttributes'],function(_0x71692a){return{'name':_0x71692a[_0x9dbb('0x29')],'type':_0x71692a[_0x9dbb('0x2a')]['key']};});_0x25555c[_0x9dbb('0x2b')]=_['map'](_0x491324,_0x9dbb('0x25'));_0x25555c[_0x9dbb('0x2c')]=_[_0x9dbb('0x2d')](_0x4ebd57[_0x9dbb('0x2c')]);_0x25555c[_0x9dbb('0x2e')]=_[_0x9dbb('0x2f')](_0x25555c[_0x9dbb('0x2b')],_0x25555c[_0x9dbb('0x2c')]);_0x589f63[_0x9dbb('0x30')]=_[_0x9dbb('0x2f')](_0x25555c[_0x9dbb('0x2b')],qs['fields'](_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x31')]));_0x589f63[_0x9dbb('0x30')]=_0x589f63[_0x9dbb('0x30')][_0x9dbb('0x32')]?_0x589f63[_0x9dbb('0x30')]:_0x25555c[_0x9dbb('0x2b')];if(!_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x33')](_0x9dbb('0x34'))){_0x589f63[_0x9dbb('0x1e')]=qs[_0x9dbb('0x1e')](_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x1e')]);_0x589f63[_0x9dbb('0x1c')]=qs[_0x9dbb('0x1c')](_0x4ebd57[_0x9dbb('0x2c')]['offset']);}_0x589f63[_0x9dbb('0x35')]=qs[_0x9dbb('0x36')](_0x4ebd57[_0x9dbb('0x2c')]['sort']);_0x589f63[_0x9dbb('0x37')]=qs[_0x9dbb('0x2e')](_[_0x9dbb('0x38')](_0x4ebd57[_0x9dbb('0x2c')],_0x25555c[_0x9dbb('0x2e')]),_0x491324);if(_0x4ebd57[_0x9dbb('0x2c')]['filter']){_0x589f63[_0x9dbb('0x37')]=_['merge'](_0x589f63[_0x9dbb('0x37')],{'$or':_[_0x9dbb('0x27')](_0x491324,function(_0xa3bc3){if(_0xa3bc3[_0x9dbb('0x2a')]!=='VIRTUAL'){var _0x1a5eeb={};_0x1a5eeb[_0xa3bc3['name']]={'$like':'%'+_0x4ebd57[_0x9dbb('0x2c')]['filter']+'%'};return _0x1a5eeb;}})});}_0x589f63=_[_0x9dbb('0x39')]({},_0x589f63,_0x4ebd57[_0x9dbb('0x3a')]);var _0x34524e={'where':_0x589f63[_0x9dbb('0x37')]};return db[_0x9dbb('0x28')]['count'](_0x34524e)[_0x9dbb('0x22')](function(_0x59eea1){_0x3578b3[_0x9dbb('0x1f')]=_0x59eea1;if(_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x3b')]){_0x589f63[_0x9dbb('0x3c')]=[{'all':!![]}];}return db[_0x9dbb('0x28')][_0x9dbb('0x3d')](_0x589f63);})[_0x9dbb('0x22')](function(_0x49e63f){_0x3578b3[_0x9dbb('0x3e')]=_0x49e63f;return _0x3578b3;})['then'](respondWithFilteredResult(_0x4b5ce1,_0x589f63))[_0x9dbb('0x3f')](handleError(_0x4b5ce1,null));};exports[_0x9dbb('0x40')]=function(_0x34c114,_0x104ec5){var _0x490833={'raw':!![],'where':{'id':_0x34c114['params']['id']}},_0x2f99ed={};_0x2f99ed[_0x9dbb('0x2b')]=_['keys'](db[_0x9dbb('0x28')][_0x9dbb('0x41')]);_0x2f99ed['query']=_['keys'](_0x34c114[_0x9dbb('0x2c')]);_0x2f99ed[_0x9dbb('0x2e')]=_[_0x9dbb('0x2f')](_0x2f99ed[_0x9dbb('0x2b')],_0x2f99ed[_0x9dbb('0x2c')]);_0x490833[_0x9dbb('0x30')]=_[_0x9dbb('0x2f')](_0x2f99ed[_0x9dbb('0x2b')],qs[_0x9dbb('0x31')](_0x34c114['query'][_0x9dbb('0x31')]));_0x490833['attributes']=_0x490833[_0x9dbb('0x30')][_0x9dbb('0x32')]?_0x490833[_0x9dbb('0x30')]:_0x2f99ed[_0x9dbb('0x2b')];if(_0x34c114['query'][_0x9dbb('0x3b')]){_0x490833['include']=[{'all':!![]}];}_0x490833=_['merge']({},_0x490833,_0x34c114[_0x9dbb('0x3a')]);return db[_0x9dbb('0x28')][_0x9dbb('0x42')](_0x490833)[_0x9dbb('0x22')](handleEntityNotFound(_0x104ec5,null))[_0x9dbb('0x22')](respondWithResult(_0x104ec5,null))[_0x9dbb('0x3f')](handleError(_0x104ec5,null));};exports['create']=function(_0x202235,_0x56d319){return db[_0x9dbb('0x28')][_0x9dbb('0x43')](_0x202235[_0x9dbb('0x44')],{})[_0x9dbb('0x22')](respondWithResult(_0x56d319,0xc9))[_0x9dbb('0x3f')](handleError(_0x56d319,null));};exports[_0x9dbb('0x45')]=function(_0x34304a,_0x31c532){if(_0x34304a['body']['id']){delete _0x34304a[_0x9dbb('0x44')]['id'];}return db['ChatQueueReport'][_0x9dbb('0x42')]({'where':{'id':_0x34304a[_0x9dbb('0x46')]['id']}})['then'](handleEntityNotFound(_0x31c532,null))[_0x9dbb('0x22')](saveUpdates(_0x34304a['body'],null))['then'](respondWithResult(_0x31c532,null))['catch'](handleError(_0x31c532,null));};exports[_0x9dbb('0x23')]=function(_0x3c19bb,_0x5c398b){return db[_0x9dbb('0x28')]['find']({'where':{'id':_0x3c19bb[_0x9dbb('0x46')]['id']}})[_0x9dbb('0x22')](handleEntityNotFound(_0x5c398b,null))[_0x9dbb('0x22')](removeEntity(_0x5c398b,null))[_0x9dbb('0x3f')](handleError(_0x5c398b,null));};exports[_0x9dbb('0x47')]=function(_0x6a6f55,_0x56ac9a){return db['ChatQueueReport'][_0x9dbb('0x47')]()[_0x9dbb('0x22')](respondWithResult(_0x56ac9a,null))['catch'](handleError(_0x56ac9a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index e4029fc..555deda 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x3f7e78,_0x208acb){var _0x41c9a8=function(_0x1e3de7){while(--_0x1e3de7){_0x3f7e78['push'](_0x3f7e78['shift']());}};_0x41c9a8(++_0x208acb);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x5c2dfc,_0x17f2f7){var _0x3827b1=function(_0xc6524f){while(--_0xc6524f){_0x5c2dfc['push'](_0x5c2dfc['shift']());}};_0x3827b1(++_0x17f2f7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb7e7[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index d02acb7..7ea2217 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 _0x1661=['code','error','message','result','catch','ChatQueueReport','body','raw','then','CreateChatQueueReport','UpdateChatQueueReport','options','where','attributes','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x551b09,_0x1f9903){var _0x82db98=function(_0x10d796){while(--_0x10d796){_0x551b09['push'](_0x551b09['shift']());}};_0x82db98(++_0x1f9903);}(_0x1661,0x6b));var _0x1166=function(_0x174f72,_0x1862ce){_0x174f72=_0x174f72-0x0;var _0x5ba695=_0x1661[_0x174f72];return _0x5ba695;};'use strict';var _=require(_0x1166('0x0'));var util=require(_0x1166('0x1'));var moment=require(_0x1166('0x2'));var BPromise=require(_0x1166('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1166('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1166('0x5'))(_0x1166('0x6'));var config=require(_0x1166('0x7'));var jayson=require(_0x1166('0x8'));var client=jayson[_0x1166('0x9')][_0x1166('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5117f5,_0x1e9630,_0x448388){return new BPromise(function(_0x20cd95,_0x59fa31){return client[_0x1166('0xb')](_0x5117f5,_0x448388)['then'](function(_0xbc89d7){logger[_0x1166('0xc')](_0x1166('0xd'),_0x1e9630,_0x1166('0xe'));logger[_0x1166('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x1e9630,_0x1166('0xe'),JSON[_0x1166('0x10')](_0xbc89d7));if(_0xbc89d7['error']){if(_0xbc89d7['error'][_0x1166('0x11')]===0x1f4){logger[_0x1166('0x12')](_0x1166('0xd'),_0x1e9630,_0xbc89d7[_0x1166('0x12')][_0x1166('0x13')]);return _0x59fa31(_0xbc89d7[_0x1166('0x12')][_0x1166('0x13')]);}logger[_0x1166('0x12')](_0x1166('0xd'),_0x1e9630,_0xbc89d7[_0x1166('0x12')][_0x1166('0x13')]);return _0x20cd95(_0xbc89d7[_0x1166('0x12')][_0x1166('0x13')]);}else{logger[_0x1166('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x1e9630,'request\x20sent');_0x20cd95(_0xbc89d7[_0x1166('0x14')]['message']);}})[_0x1166('0x15')](function(_0x49a770){logger[_0x1166('0x12')](_0x1166('0xd'),_0x1e9630,_0x49a770);_0x59fa31(_0x49a770);});});}exports['CreateChatQueueReport']=function(_0x4878ac){var _0x46ddcc=this;return new Promise(function(_0x51a977,_0xe316bc){return db[_0x1166('0x16')]['create'](_0x4878ac[_0x1166('0x17')],{'raw':_0x4878ac['options']?_0x4878ac['options'][_0x1166('0x18')]===undefined?!![]:![]:!![]})[_0x1166('0x19')](function(_0x23337f){logger[_0x1166('0xc')](_0x1166('0x1a'),_0x4878ac);logger['debug'](_0x1166('0x1a'),_0x4878ac,JSON['stringify'](_0x23337f));_0x51a977(_0x23337f);})['catch'](function(_0x28b59e){logger[_0x1166('0x12')]('CreateChatQueueReport',_0x28b59e[_0x1166('0x13')],_0x4878ac);_0xe316bc(_0x46ddcc[_0x1166('0x12')](0x1f4,_0x28b59e[_0x1166('0x13')]));});});};exports[_0x1166('0x1b')]=function(_0x12fa8a){var _0x18e8e4=this;return new Promise(function(_0x7da14,_0x143577){return db[_0x1166('0x16')]['update'](_0x12fa8a[_0x1166('0x17')],{'raw':_0x12fa8a[_0x1166('0x1c')]?_0x12fa8a[_0x1166('0x1c')][_0x1166('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12fa8a['options']?_0x12fa8a[_0x1166('0x1c')][_0x1166('0x1d')]||null:null,'attributes':_0x12fa8a[_0x1166('0x1c')]?_0x12fa8a[_0x1166('0x1c')][_0x1166('0x1e')]||null:null,'limit':_0x12fa8a[_0x1166('0x1c')]?_0x12fa8a[_0x1166('0x1c')]['limit']||null:null})[_0x1166('0x19')](function(_0x4abb5e){logger['info']('UpdateChatQueueReport',_0x12fa8a);logger[_0x1166('0xf')](_0x1166('0x1b'),_0x12fa8a,JSON[_0x1166('0x10')](_0x4abb5e));_0x7da14(_0x4abb5e);})[_0x1166('0x15')](function(_0x3df5d3){logger[_0x1166('0x12')](_0x1166('0x1b'),_0x3df5d3[_0x1166('0x13')],_0x12fa8a);_0x143577(_0x18e8e4[_0x1166('0x12')](0x1f4,_0x3df5d3[_0x1166('0x13')]));});});};
\ No newline at end of file
+var _0xa68a=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','catch','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xa68a,0x1ad));var _0xaa68=function(_0x567dcd,_0x2f6e5d){_0x567dcd=_0x567dcd-0x0;var _0x38879d=_0xa68a[_0x567dcd];return _0x38879d;};'use strict';var _=require(_0xaa68('0x0'));var util=require(_0xaa68('0x1'));var moment=require(_0xaa68('0x2'));var BPromise=require(_0xaa68('0x3'));var rs=require(_0xaa68('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa68('0x5'))['db'];var utils=require(_0xaa68('0x6'));var logger=require(_0xaa68('0x7'))(_0xaa68('0x8'));var config=require(_0xaa68('0x9'));var jayson=require(_0xaa68('0xa'));var client=jayson[_0xaa68('0xb')][_0xaa68('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x259b21,_0x5c2479,_0x3813a8){return new BPromise(function(_0x9f10f5,_0x20edd4){return client['request'](_0x259b21,_0x3813a8)[_0xaa68('0xd')](function(_0x20ceee){logger[_0xaa68('0xe')](_0xaa68('0xf'),_0x5c2479,_0xaa68('0x10'));logger['debug'](_0xaa68('0x11'),_0x5c2479,_0xaa68('0x10'),JSON[_0xaa68('0x12')](_0x20ceee));if(_0x20ceee[_0xaa68('0x13')]){if(_0x20ceee[_0xaa68('0x13')][_0xaa68('0x14')]===0x1f4){logger['error'](_0xaa68('0xf'),_0x5c2479,_0x20ceee[_0xaa68('0x13')][_0xaa68('0x15')]);return _0x20edd4(_0x20ceee[_0xaa68('0x13')][_0xaa68('0x15')]);}logger[_0xaa68('0x13')](_0xaa68('0xf'),_0x5c2479,_0x20ceee['error'][_0xaa68('0x15')]);return _0x9f10f5(_0x20ceee['error'][_0xaa68('0x15')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x5c2479,_0xaa68('0x10'));_0x9f10f5(_0x20ceee[_0xaa68('0x16')]['message']);}})['catch'](function(_0x3a1f81){logger[_0xaa68('0x13')](_0xaa68('0xf'),_0x5c2479,_0x3a1f81);_0x20edd4(_0x3a1f81);});});}exports[_0xaa68('0x17')]=function(_0xd79686){var _0x30c143=this;return new Promise(function(_0x2e45ad,_0x4af7e4){return db[_0xaa68('0x18')][_0xaa68('0x19')](_0xd79686[_0xaa68('0x1a')],{'raw':_0xd79686[_0xaa68('0x1b')]?_0xd79686[_0xaa68('0x1b')][_0xaa68('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1d748f){logger['info'](_0xaa68('0x17'),_0xd79686);logger[_0xaa68('0x1d')](_0xaa68('0x17'),_0xd79686,JSON[_0xaa68('0x12')](_0x1d748f));_0x2e45ad(_0x1d748f);})[_0xaa68('0x1e')](function(_0x43fb4){logger[_0xaa68('0x13')]('CreateChatQueueReport',_0x43fb4[_0xaa68('0x15')],_0xd79686);_0x4af7e4(_0x30c143[_0xaa68('0x13')](0x1f4,_0x43fb4[_0xaa68('0x15')]));});});};exports[_0xaa68('0x1f')]=function(_0x2d6d4c){var _0x583e00=this;return new Promise(function(_0x23298e,_0x5a50dd){return db['ChatQueueReport'][_0xaa68('0x20')](_0x2d6d4c[_0xaa68('0x1a')],{'raw':_0x2d6d4c[_0xaa68('0x1b')]?_0x2d6d4c[_0xaa68('0x1b')][_0xaa68('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d6d4c[_0xaa68('0x1b')]?_0x2d6d4c[_0xaa68('0x1b')][_0xaa68('0x21')]||null:null,'attributes':_0x2d6d4c['options']?_0x2d6d4c[_0xaa68('0x1b')][_0xaa68('0x22')]||null:null,'limit':_0x2d6d4c[_0xaa68('0x1b')]?_0x2d6d4c['options'][_0xaa68('0x23')]||null:null})[_0xaa68('0xd')](function(_0xddea5d){logger['info'](_0xaa68('0x1f'),_0x2d6d4c);logger[_0xaa68('0x1d')](_0xaa68('0x1f'),_0x2d6d4c,JSON[_0xaa68('0x12')](_0xddea5d));_0x23298e(_0xddea5d);})[_0xaa68('0x1e')](function(_0x5f0066){logger[_0xaa68('0x13')](_0xaa68('0x1f'),_0x5f0066[_0xaa68('0x15')],_0x2d6d4c);_0x5a50dd(_0x583e00[_0xaa68('0x13')](0x1f4,_0x5f0066[_0xaa68('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 950f133..e6174dd 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 _0x920a=['express','Router','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','util','path'];(function(_0xc3eadb,_0x3e52d){var _0x4ea0d7=function(_0x287701){while(--_0x287701){_0xc3eadb['push'](_0xc3eadb['shift']());}};_0x4ea0d7(++_0x3e52d);}(_0x920a,0x196));var _0xa920=function(_0x556f2b,_0x4dec29){_0x556f2b=_0x556f2b-0x0;var _0x41363c=_0x920a[_0x556f2b];return _0x41363c;};'use strict';var multer=require('multer');var util=require(_0xa920('0x0'));var path=require(_0xa920('0x1'));var timeout=require('connect-timeout');var express=require(_0xa920('0x2'));var router=express[_0xa920('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa920('0x4'));var interaction=require(_0xa920('0x5'));var config=require('../../config/environment');var controller=require(_0xa920('0x6'));router[_0xa920('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa920('0x7')](_0xa920('0x8'),auth[_0xa920('0x9')](),controller[_0xa920('0xa')]);router['get'](_0xa920('0xb'),auth[_0xa920('0x9')](),controller[_0xa920('0xc')]);router[_0xa920('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa920('0xe')]('/:id',auth[_0xa920('0x9')](),controller[_0xa920('0xf')]);router[_0xa920('0x10')](_0xa920('0xb'),auth[_0xa920('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x4a83=['destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x4a83,0xd3));var _0x34a8=function(_0x360296,_0xcd6f97){_0x360296=_0x360296-0x0;var _0x20b06d=_0x4a83[_0x360296];return _0x20b06d;};'use strict';var multer=require(_0x34a8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x34a8('0x1'));var express=require(_0x34a8('0x2'));var router=express[_0x34a8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x34a8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x34a8('0x5'));var controller=require('./chatQueueReport.controller');router[_0x34a8('0x6')]('/',auth[_0x34a8('0x7')](),controller[_0x34a8('0x8')]);router[_0x34a8('0x6')](_0x34a8('0x9'),auth[_0x34a8('0x7')](),controller[_0x34a8('0xa')]);router[_0x34a8('0x6')](_0x34a8('0xb'),auth[_0x34a8('0x7')](),controller['show']);router[_0x34a8('0xc')]('/',auth[_0x34a8('0x7')](),controller[_0x34a8('0xd')]);router[_0x34a8('0xe')](_0x34a8('0xb'),auth[_0x34a8('0x7')](),controller[_0x34a8('0xf')]);router[_0x34a8('0x10')]('/:id',auth[_0x34a8('0x7')](),controller[_0x34a8('0x11')]);module[_0x34a8('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 016ec25..0d5cd1f 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x322a71,_0x45ff25){var _0x4e8a01=function(_0x150695){while(--_0x150695){_0x322a71['push'](_0x322a71['shift']());}};_0x4e8a01(++_0x45ff25);}(_0xaa88,0x137));var _0x8aa8=function(_0x4aac5a,_0x15b04c){_0x4aac5a=_0x4aac5a-0x0;var _0x42e7bc=_0xaa88[_0x4aac5a];return _0x42e7bc;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
+var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x1ecae9,_0x3d5fb9){var _0x5518e1=function(_0x1fcef5){while(--_0x1fcef5){_0x1ecae9['push'](_0x1ecae9['shift']());}};_0x5518e1(++_0x3d5fb9);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index cb23bda..4f2120d 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 _0xfbd1=['count','set','Content-Range','apply','then','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','create','update','body','destroy','find','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x2e3f5c,_0xb30165){var _0x265cb6=function(_0x59b41c){while(--_0x59b41c){_0x2e3f5c['push'](_0x2e3f5c['shift']());}};_0x265cb6(++_0xb30165);}(_0xfbd1,0x1ef));var _0x1fbd=function(_0x3113b1,_0x42646c){_0x3113b1=_0x3113b1-0x0;var _0x4d45a8=_0xfbd1[_0x3113b1];return _0x4d45a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1fbd('0x0'));var jsonpatch=require(_0x1fbd('0x1'));var rp=require(_0x1fbd('0x2'));var moment=require(_0x1fbd('0x3'));var BPromise=require(_0x1fbd('0x4'));var Mustache=require(_0x1fbd('0x5'));var util=require(_0x1fbd('0x6'));var path=require(_0x1fbd('0x7'));var sox=require(_0x1fbd('0x8'));var csv=require(_0x1fbd('0x9'));var ejs=require(_0x1fbd('0xa'));var fs=require('fs');var fs_extra=require(_0x1fbd('0xb'));var _=require(_0x1fbd('0xc'));var squel=require(_0x1fbd('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1fbd('0x9'));var querystring=require(_0x1fbd('0xe'));var Papa=require('papaparse');var Redis=require(_0x1fbd('0xf'));var authService=require(_0x1fbd('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1fbd('0x11'));var hardwareService=require(_0x1fbd('0x12'));var logger=require('../../config/logger')(_0x1fbd('0x13'));var utils=require(_0x1fbd('0x14'));var config=require(_0x1fbd('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1fbd('0x16'))['db'];function respondWithStatusCode(_0x2e5cb0,_0x2f9dcf){_0x2f9dcf=_0x2f9dcf||0xcc;return function(_0xa39474){if(_0xa39474){return _0x2e5cb0[_0x1fbd('0x17')](_0x2f9dcf);}return _0x2e5cb0[_0x1fbd('0x18')](_0x2f9dcf)[_0x1fbd('0x19')]();};}function respondWithResult(_0xfd90e3,_0x2eaae7){_0x2eaae7=_0x2eaae7||0xc8;return function(_0x2710c2){if(_0x2710c2){return _0xfd90e3['status'](_0x2eaae7)[_0x1fbd('0x1a')](_0x2710c2);}};}function respondWithFilteredResult(_0x239325,_0x3e99a2){return function(_0x5df031){if(_0x5df031){var _0x3a5fd=typeof _0x3e99a2[_0x1fbd('0x1b')]===_0x1fbd('0x1c')&&typeof _0x3e99a2[_0x1fbd('0x1d')]===_0x1fbd('0x1c');var _0x4cbc40=_0x5df031[_0x1fbd('0x1e')];var _0x1a3101=_0x3a5fd?0x0:_0x3e99a2[_0x1fbd('0x1b')];var _0x37c4ec=_0x3a5fd?_0x5df031['count']:_0x3e99a2[_0x1fbd('0x1b')]+_0x3e99a2[_0x1fbd('0x1d')];var _0x37ff40;if(_0x37c4ec>=_0x4cbc40){_0x37c4ec=_0x4cbc40;_0x37ff40=0xc8;}else{_0x37ff40=0xce;}_0x239325[_0x1fbd('0x18')](_0x37ff40);return _0x239325[_0x1fbd('0x1f')](_0x1fbd('0x20'),_0x1a3101+'-'+_0x37c4ec+'/'+_0x4cbc40)[_0x1fbd('0x1a')](_0x5df031);}return null;};}function patchUpdates(_0x1faf7c){return function(_0x410ea2){try{jsonpatch[_0x1fbd('0x21')](_0x410ea2,_0x1faf7c,!![]);}catch(_0x155369){return BPromise['reject'](_0x155369);}return _0x410ea2['save']();};}function saveUpdates(_0x31b645,_0x538874){return function(_0x361974){if(_0x361974){return _0x361974['update'](_0x31b645)[_0x1fbd('0x22')](function(_0x3da8c1){return _0x3da8c1;});}return null;};}function removeEntity(_0x276868,_0x1ad8cf){return function(_0x4856eb){if(_0x4856eb){return _0x4856eb['destroy']()[_0x1fbd('0x22')](function(){_0x276868['status'](0xcc)[_0x1fbd('0x19')]();});}};}function handleEntityNotFound(_0x38714e,_0x3d2c73){return function(_0x16dbb2){if(!_0x16dbb2){_0x38714e['sendStatus'](0x194);}return _0x16dbb2;};}function handleError(_0x54573c,_0x2355f5){_0x2355f5=_0x2355f5||0x1f4;return function(_0x191687){logger['error'](_0x191687[_0x1fbd('0x23')]);if(_0x191687['name']){delete _0x191687[_0x1fbd('0x24')];}_0x54573c[_0x1fbd('0x18')](_0x2355f5)['send'](_0x191687);};}exports[_0x1fbd('0x25')]=function(_0x51fa1d,_0x48ee7b){var _0x2d3456={},_0x1a5f69={},_0x46f7a5={'count':0x0,'rows':[]};var _0x48c229=_[_0x1fbd('0x26')](db[_0x1fbd('0x27')][_0x1fbd('0x28')],function(_0x4f4b97){return{'name':_0x4f4b97[_0x1fbd('0x29')],'type':_0x4f4b97[_0x1fbd('0x2a')][_0x1fbd('0x2b')]};});_0x1a5f69[_0x1fbd('0x2c')]=_[_0x1fbd('0x26')](_0x48c229,_0x1fbd('0x24'));_0x1a5f69[_0x1fbd('0x2d')]=_[_0x1fbd('0x2e')](_0x51fa1d[_0x1fbd('0x2d')]);_0x1a5f69[_0x1fbd('0x2f')]=_[_0x1fbd('0x30')](_0x1a5f69['model'],_0x1a5f69[_0x1fbd('0x2d')]);_0x2d3456[_0x1fbd('0x31')]=_[_0x1fbd('0x30')](_0x1a5f69['model'],qs[_0x1fbd('0x32')](_0x51fa1d['query'][_0x1fbd('0x32')]));_0x2d3456['attributes']=_0x2d3456['attributes'][_0x1fbd('0x33')]?_0x2d3456[_0x1fbd('0x31')]:_0x1a5f69[_0x1fbd('0x2c')];if(!_0x51fa1d[_0x1fbd('0x2d')][_0x1fbd('0x34')](_0x1fbd('0x35'))){_0x2d3456[_0x1fbd('0x1d')]=qs[_0x1fbd('0x1d')](_0x51fa1d[_0x1fbd('0x2d')]['limit']);_0x2d3456[_0x1fbd('0x1b')]=qs['offset'](_0x51fa1d[_0x1fbd('0x2d')][_0x1fbd('0x1b')]);}_0x2d3456[_0x1fbd('0x36')]=qs[_0x1fbd('0x37')](_0x51fa1d[_0x1fbd('0x2d')][_0x1fbd('0x37')]);_0x2d3456['where']=qs[_0x1fbd('0x2f')](_[_0x1fbd('0x38')](_0x51fa1d[_0x1fbd('0x2d')],_0x1a5f69[_0x1fbd('0x2f')]),_0x48c229);if(_0x51fa1d[_0x1fbd('0x2d')][_0x1fbd('0x39')]){_0x2d3456[_0x1fbd('0x3a')]=_['merge'](_0x2d3456[_0x1fbd('0x3a')],{'$or':_[_0x1fbd('0x26')](_0x48c229,function(_0x50d6f9){if(_0x50d6f9[_0x1fbd('0x2a')]!==_0x1fbd('0x3b')){var _0x2204d6={};_0x2204d6[_0x50d6f9[_0x1fbd('0x24')]]={'$like':'%'+_0x51fa1d[_0x1fbd('0x2d')][_0x1fbd('0x39')]+'%'};return _0x2204d6;}})});}_0x2d3456=_[_0x1fbd('0x3c')]({},_0x2d3456,_0x51fa1d[_0x1fbd('0x3d')]);var _0x3a2188={'where':_0x2d3456[_0x1fbd('0x3a')]};return db[_0x1fbd('0x27')]['count'](_0x3a2188)[_0x1fbd('0x22')](function(_0x4684ea){_0x46f7a5[_0x1fbd('0x1e')]=_0x4684ea;if(_0x51fa1d[_0x1fbd('0x2d')][_0x1fbd('0x3e')]){_0x2d3456['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x1fbd('0x3f')](_0x2d3456);})['then'](function(_0x39cd96){_0x46f7a5[_0x1fbd('0x40')]=_0x39cd96;return _0x46f7a5;})[_0x1fbd('0x22')](respondWithFilteredResult(_0x48ee7b,_0x2d3456))[_0x1fbd('0x41')](handleError(_0x48ee7b,null));};exports[_0x1fbd('0x42')]=function(_0x3e9eca,_0x2745cd){var _0x126cef={'raw':!![],'where':{'id':_0x3e9eca[_0x1fbd('0x43')]['id']}},_0x54575e={};_0x54575e['model']=_['keys'](db[_0x1fbd('0x27')][_0x1fbd('0x28')]);_0x54575e[_0x1fbd('0x2d')]=_[_0x1fbd('0x2e')](_0x3e9eca[_0x1fbd('0x2d')]);_0x54575e[_0x1fbd('0x2f')]=_['intersection'](_0x54575e[_0x1fbd('0x2c')],_0x54575e['query']);_0x126cef[_0x1fbd('0x31')]=_[_0x1fbd('0x30')](_0x54575e['model'],qs[_0x1fbd('0x32')](_0x3e9eca[_0x1fbd('0x2d')][_0x1fbd('0x32')]));_0x126cef['attributes']=_0x126cef[_0x1fbd('0x31')]['length']?_0x126cef[_0x1fbd('0x31')]:_0x54575e[_0x1fbd('0x2c')];if(_0x3e9eca[_0x1fbd('0x2d')]['includeAll']){_0x126cef[_0x1fbd('0x44')]=[{'all':!![]}];}_0x126cef=_[_0x1fbd('0x3c')]({},_0x126cef,_0x3e9eca[_0x1fbd('0x3d')]);return db[_0x1fbd('0x27')]['find'](_0x126cef)[_0x1fbd('0x22')](handleEntityNotFound(_0x2745cd,null))[_0x1fbd('0x22')](respondWithResult(_0x2745cd,null))[_0x1fbd('0x41')](handleError(_0x2745cd,null));};exports[_0x1fbd('0x45')]=function(_0x546034,_0x5cf16b){return db[_0x1fbd('0x27')]['create'](_0x546034['body'],{})[_0x1fbd('0x22')](respondWithResult(_0x5cf16b,0xc9))[_0x1fbd('0x41')](handleError(_0x5cf16b,null));};exports[_0x1fbd('0x46')]=function(_0xa0434d,_0x4e5eca){if(_0xa0434d['body']['id']){delete _0xa0434d[_0x1fbd('0x47')]['id'];}return db[_0x1fbd('0x27')]['find']({'where':{'id':_0xa0434d[_0x1fbd('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e5eca,null))[_0x1fbd('0x22')](saveUpdates(_0xa0434d[_0x1fbd('0x47')],null))['then'](respondWithResult(_0x4e5eca,null))[_0x1fbd('0x41')](handleError(_0x4e5eca,null));};exports[_0x1fbd('0x48')]=function(_0x53b79e,_0x2bb49f){return db['ChatTransferReport'][_0x1fbd('0x49')]({'where':{'id':_0x53b79e[_0x1fbd('0x43')]['id']}})[_0x1fbd('0x22')](handleEntityNotFound(_0x2bb49f,null))[_0x1fbd('0x22')](removeEntity(_0x2bb49f,null))[_0x1fbd('0x41')](handleError(_0x2bb49f,null));};exports[_0x1fbd('0x4a')]=function(_0x164661,_0x115503){return db[_0x1fbd('0x27')][_0x1fbd('0x4a')]()[_0x1fbd('0x22')](respondWithResult(_0x115503,null))['catch'](handleError(_0x115503,null));};
\ No newline at end of file
+var _0x3785=['fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','name','send','ChatTransferReport','rawAttributes'];(function(_0x51bc84,_0x519320){var _0x3a953e=function(_0x568464){while(--_0x568464){_0x51bc84['push'](_0x51bc84['shift']());}};_0x3a953e(++_0x519320);}(_0x3785,0x68));var _0x5378=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x3785[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require(_0x5378('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5378('0x1'));var rp=require(_0x5378('0x2'));var moment=require(_0x5378('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5378('0x4'));var path=require(_0x5378('0x5'));var sox=require('sox');var csv=require(_0x5378('0x6'));var ejs=require(_0x5378('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5378('0x8'));var squel=require(_0x5378('0x9'));var crypto=require(_0x5378('0xa'));var jsforce=require(_0x5378('0xb'));var deskjs=require(_0x5378('0xc'));var toCsv=require(_0x5378('0x6'));var querystring=require(_0x5378('0xd'));var Papa=require('papaparse');var Redis=require(_0x5378('0xe'));var authService=require(_0x5378('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5378('0x10'));var hardwareService=require(_0x5378('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x5378('0x12'));var config=require(_0x5378('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5378('0x14'))['db'];function respondWithStatusCode(_0x2f75e2,_0x313698){_0x313698=_0x313698||0xcc;return function(_0x552947){if(_0x552947){return _0x2f75e2[_0x5378('0x15')](_0x313698);}return _0x2f75e2[_0x5378('0x16')](_0x313698)[_0x5378('0x17')]();};}function respondWithResult(_0x232546,_0xdc60be){_0xdc60be=_0xdc60be||0xc8;return function(_0x276572){if(_0x276572){return _0x232546[_0x5378('0x16')](_0xdc60be)['json'](_0x276572);}};}function respondWithFilteredResult(_0x1fe46e,_0x49bceb){return function(_0x36a055){if(_0x36a055){var _0x4357a9=typeof _0x49bceb[_0x5378('0x18')]===_0x5378('0x19')&&typeof _0x49bceb['limit']===_0x5378('0x19');var _0x2f6719=_0x36a055[_0x5378('0x1a')];var _0x20acfd=_0x4357a9?0x0:_0x49bceb[_0x5378('0x18')];var _0x4bf39d=_0x4357a9?_0x36a055[_0x5378('0x1a')]:_0x49bceb['offset']+_0x49bceb[_0x5378('0x1b')];var _0x59b105;if(_0x4bf39d>=_0x2f6719){_0x4bf39d=_0x2f6719;_0x59b105=0xc8;}else{_0x59b105=0xce;}_0x1fe46e['status'](_0x59b105);return _0x1fe46e[_0x5378('0x1c')](_0x5378('0x1d'),_0x20acfd+'-'+_0x4bf39d+'/'+_0x2f6719)['json'](_0x36a055);}return null;};}function patchUpdates(_0xd0ce08){return function(_0x5b776a){try{jsonpatch[_0x5378('0x1e')](_0x5b776a,_0xd0ce08,!![]);}catch(_0x485a42){return BPromise[_0x5378('0x1f')](_0x485a42);}return _0x5b776a[_0x5378('0x20')]();};}function saveUpdates(_0x3dde7b,_0x4e22a9){return function(_0x425bbb){if(_0x425bbb){return _0x425bbb[_0x5378('0x21')](_0x3dde7b)['then'](function(_0x1c847d){return _0x1c847d;});}return null;};}function removeEntity(_0x120a64,_0x1eaa87){return function(_0x4682b0){if(_0x4682b0){return _0x4682b0[_0x5378('0x22')]()[_0x5378('0x23')](function(){_0x120a64[_0x5378('0x16')](0xcc)[_0x5378('0x17')]();});}};}function handleEntityNotFound(_0x46de2a,_0x576bc4){return function(_0x559c22){if(!_0x559c22){_0x46de2a[_0x5378('0x15')](0x194);}return _0x559c22;};}function handleError(_0x32df3e,_0x12b3f7){_0x12b3f7=_0x12b3f7||0x1f4;return function(_0xc34567){logger['error'](_0xc34567['stack']);if(_0xc34567[_0x5378('0x24')]){delete _0xc34567[_0x5378('0x24')];}_0x32df3e[_0x5378('0x16')](_0x12b3f7)[_0x5378('0x25')](_0xc34567);};}exports['index']=function(_0x53f98d,_0x3aa678){var _0x2df665={},_0x4b2b0d={},_0x585603={'count':0x0,'rows':[]};var _0x13529c=_['map'](db[_0x5378('0x26')][_0x5378('0x27')],function(_0x2dc627){return{'name':_0x2dc627[_0x5378('0x28')],'type':_0x2dc627[_0x5378('0x29')][_0x5378('0x2a')]};});_0x4b2b0d[_0x5378('0x2b')]=_[_0x5378('0x2c')](_0x13529c,_0x5378('0x24'));_0x4b2b0d[_0x5378('0x2d')]=_[_0x5378('0x2e')](_0x53f98d[_0x5378('0x2d')]);_0x4b2b0d[_0x5378('0x2f')]=_[_0x5378('0x30')](_0x4b2b0d[_0x5378('0x2b')],_0x4b2b0d[_0x5378('0x2d')]);_0x2df665['attributes']=_[_0x5378('0x30')](_0x4b2b0d['model'],qs['fields'](_0x53f98d[_0x5378('0x2d')][_0x5378('0x31')]));_0x2df665[_0x5378('0x32')]=_0x2df665[_0x5378('0x32')][_0x5378('0x33')]?_0x2df665['attributes']:_0x4b2b0d[_0x5378('0x2b')];if(!_0x53f98d['query'][_0x5378('0x34')](_0x5378('0x35'))){_0x2df665[_0x5378('0x1b')]=qs[_0x5378('0x1b')](_0x53f98d[_0x5378('0x2d')]['limit']);_0x2df665[_0x5378('0x18')]=qs[_0x5378('0x18')](_0x53f98d[_0x5378('0x2d')][_0x5378('0x18')]);}_0x2df665['order']=qs[_0x5378('0x36')](_0x53f98d[_0x5378('0x2d')][_0x5378('0x36')]);_0x2df665[_0x5378('0x37')]=qs[_0x5378('0x2f')](_[_0x5378('0x38')](_0x53f98d[_0x5378('0x2d')],_0x4b2b0d[_0x5378('0x2f')]),_0x13529c);if(_0x53f98d[_0x5378('0x2d')][_0x5378('0x39')]){_0x2df665[_0x5378('0x37')]=_['merge'](_0x2df665[_0x5378('0x37')],{'$or':_[_0x5378('0x2c')](_0x13529c,function(_0x231682){if(_0x231682['type']!==_0x5378('0x3a')){var _0x1b62bd={};_0x1b62bd[_0x231682[_0x5378('0x24')]]={'$like':'%'+_0x53f98d[_0x5378('0x2d')]['filter']+'%'};return _0x1b62bd;}})});}_0x2df665=_['merge']({},_0x2df665,_0x53f98d[_0x5378('0x3b')]);var _0x168e3e={'where':_0x2df665['where']};return db[_0x5378('0x26')][_0x5378('0x1a')](_0x168e3e)[_0x5378('0x23')](function(_0x1d1446){_0x585603['count']=_0x1d1446;if(_0x53f98d[_0x5378('0x2d')][_0x5378('0x3c')]){_0x2df665[_0x5378('0x3d')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x5378('0x3e')](_0x2df665);})[_0x5378('0x23')](function(_0x3207bc){_0x585603[_0x5378('0x3f')]=_0x3207bc;return _0x585603;})[_0x5378('0x23')](respondWithFilteredResult(_0x3aa678,_0x2df665))[_0x5378('0x40')](handleError(_0x3aa678,null));};exports[_0x5378('0x41')]=function(_0x302c3c,_0x53e2c0){var _0x15d210={'raw':!![],'where':{'id':_0x302c3c[_0x5378('0x42')]['id']}},_0x2faae6={};_0x2faae6[_0x5378('0x2b')]=_[_0x5378('0x2e')](db['ChatTransferReport']['rawAttributes']);_0x2faae6[_0x5378('0x2d')]=_['keys'](_0x302c3c[_0x5378('0x2d')]);_0x2faae6['filters']=_[_0x5378('0x30')](_0x2faae6[_0x5378('0x2b')],_0x2faae6[_0x5378('0x2d')]);_0x15d210[_0x5378('0x32')]=_[_0x5378('0x30')](_0x2faae6[_0x5378('0x2b')],qs[_0x5378('0x31')](_0x302c3c['query'][_0x5378('0x31')]));_0x15d210[_0x5378('0x32')]=_0x15d210['attributes'][_0x5378('0x33')]?_0x15d210[_0x5378('0x32')]:_0x2faae6[_0x5378('0x2b')];if(_0x302c3c['query']['includeAll']){_0x15d210['include']=[{'all':!![]}];}_0x15d210=_[_0x5378('0x43')]({},_0x15d210,_0x302c3c[_0x5378('0x3b')]);return db['ChatTransferReport'][_0x5378('0x44')](_0x15d210)['then'](handleEntityNotFound(_0x53e2c0,null))[_0x5378('0x23')](respondWithResult(_0x53e2c0,null))[_0x5378('0x40')](handleError(_0x53e2c0,null));};exports[_0x5378('0x45')]=function(_0x41b9f4,_0x135090){return db[_0x5378('0x26')]['create'](_0x41b9f4[_0x5378('0x46')],{})[_0x5378('0x23')](respondWithResult(_0x135090,0xc9))[_0x5378('0x40')](handleError(_0x135090,null));};exports[_0x5378('0x21')]=function(_0x47fe14,_0x343c08){if(_0x47fe14[_0x5378('0x46')]['id']){delete _0x47fe14[_0x5378('0x46')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x47fe14[_0x5378('0x42')]['id']}})[_0x5378('0x23')](handleEntityNotFound(_0x343c08,null))[_0x5378('0x23')](saveUpdates(_0x47fe14[_0x5378('0x46')],null))[_0x5378('0x23')](respondWithResult(_0x343c08,null))[_0x5378('0x40')](handleError(_0x343c08,null));};exports['destroy']=function(_0x247fe3,_0x1f26a6){return db['ChatTransferReport'][_0x5378('0x44')]({'where':{'id':_0x247fe3[_0x5378('0x42')]['id']}})[_0x5378('0x23')](handleEntityNotFound(_0x1f26a6,null))['then'](removeEntity(_0x1f26a6,null))['catch'](handleError(_0x1f26a6,null));};exports[_0x5378('0x47')]=function(_0x3a7961,_0x50aa0c){return db['ChatTransferReport'][_0x5378('0x47')]()[_0x5378('0x23')](respondWithResult(_0x50aa0c,null))[_0x5378('0x40')](handleError(_0x50aa0c,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index cefd166..0842a63 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 _0xab09=['moment','bluebird','path','rimraf','../../config/environment','exports','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x39bf66,_0x35c96c){var _0x431030=function(_0x4328ac){while(--_0x4328ac){_0x39bf66['push'](_0x39bf66['shift']());}};_0x431030(++_0x35c96c);}(_0xab09,0x1c3));var _0x9ab0=function(_0x32ad69,_0x518f0c){_0x32ad69=_0x32ad69-0x0;var _0x1062ef=_0xab09[_0x32ad69];return _0x1062ef;};'use strict';var _=require(_0x9ab0('0x0'));var util=require(_0x9ab0('0x1'));var logger=require(_0x9ab0('0x2'))(_0x9ab0('0x3'));var moment=require(_0x9ab0('0x4'));var BPromise=require(_0x9ab0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ab0('0x6'));var rimraf=require(_0x9ab0('0x7'));var config=require(_0x9ab0('0x8'));var attributes=require('./chatTransferReport.attributes');module[_0x9ab0('0x9')]=function(_0x2a2689,_0x662e2a){return _0x2a2689[_0x9ab0('0xa')]('ChatTransferReport',attributes,{'tableName':_0x9ab0('0xb'),'paranoid':![],'indexes':[{'name':_0x9ab0('0xc'),'fields':[_0x9ab0('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x96d0=['../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0x96d0,0xcd));var _0x096d=function(_0x26fdc8,_0x2f70c1){_0x26fdc8=_0x26fdc8-0x0;var _0x574ebd=_0x96d0[_0x26fdc8];return _0x574ebd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x096d('0x0'))(_0x096d('0x1'));var moment=require(_0x096d('0x2'));var BPromise=require(_0x096d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x096d('0x4'));var attributes=require(_0x096d('0x5'));module[_0x096d('0x6')]=function(_0x338b4e,_0x430794){return _0x338b4e[_0x096d('0x7')](_0x096d('0x8'),attributes,{'tableName':_0x096d('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x096d('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 822c702..3f6a4ad 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 _0xd5c4=['error','ChatTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd5c4,0x124));var _0x4d5c=function(_0x55abfc,_0x1918d9){_0x55abfc=_0x55abfc-0x0;var _0x1086bc=_0xd5c4[_0x55abfc];return _0x1086bc;};'use strict';var _=require(_0x4d5c('0x0'));var util=require(_0x4d5c('0x1'));var moment=require(_0x4d5c('0x2'));var BPromise=require(_0x4d5c('0x3'));var rs=require(_0x4d5c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4d5c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d5c('0x6'))('rpc');var config=require(_0x4d5c('0x7'));var jayson=require(_0x4d5c('0x8'));var client=jayson[_0x4d5c('0x9')][_0x4d5c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e850d,_0x25e3ba,_0x129141){return new BPromise(function(_0x240c3c,_0x9d59f3){return client[_0x4d5c('0xb')](_0x5e850d,_0x129141)[_0x4d5c('0xc')](function(_0x2825dc){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x25e3ba,_0x4d5c('0xd'));logger[_0x4d5c('0xe')](_0x4d5c('0xf'),_0x25e3ba,_0x4d5c('0xd'),JSON['stringify'](_0x2825dc));if(_0x2825dc['error']){if(_0x2825dc[_0x4d5c('0x10')]['code']===0x1f4){logger[_0x4d5c('0x10')](_0x4d5c('0x11'),_0x25e3ba,_0x2825dc[_0x4d5c('0x10')][_0x4d5c('0x12')]);return _0x9d59f3(_0x2825dc['error']['message']);}logger[_0x4d5c('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x25e3ba,_0x2825dc[_0x4d5c('0x10')][_0x4d5c('0x12')]);return _0x240c3c(_0x2825dc[_0x4d5c('0x10')][_0x4d5c('0x12')]);}else{logger[_0x4d5c('0x13')](_0x4d5c('0x11'),_0x25e3ba,_0x4d5c('0xd'));_0x240c3c(_0x2825dc[_0x4d5c('0x14')][_0x4d5c('0x12')]);}})[_0x4d5c('0x15')](function(_0x4099b2){logger[_0x4d5c('0x10')](_0x4d5c('0x11'),_0x25e3ba,_0x4099b2);_0x9d59f3(_0x4099b2);});});}
\ No newline at end of file
+var _0xe23a=['util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','catch','lodash'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe23a,0xaf));var _0xae23=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0xe23a[_0x2c0dc0];return _0x4c0990;};'use strict';var _=require(_0xae23('0x0'));var util=require(_0xae23('0x1'));var moment=require(_0xae23('0x2'));var BPromise=require(_0xae23('0x3'));var rs=require(_0xae23('0x4'));var fs=require('fs');var Redis=require(_0xae23('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xae23('0x6'));var config=require(_0xae23('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xae23('0x8')][_0xae23('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e41d,_0x4c3794,_0x5b3b72){return new BPromise(function(_0xb6640c,_0x3e2bb1){return client[_0xae23('0xa')](_0x23e41d,_0x5b3b72)[_0xae23('0xb')](function(_0x2134be){logger[_0xae23('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x4c3794,_0xae23('0xd'));logger[_0xae23('0xe')](_0xae23('0xf'),_0x4c3794,_0xae23('0xd'),JSON[_0xae23('0x10')](_0x2134be));if(_0x2134be[_0xae23('0x11')]){if(_0x2134be['error'][_0xae23('0x12')]===0x1f4){logger[_0xae23('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x4c3794,_0x2134be[_0xae23('0x11')][_0xae23('0x13')]);return _0x3e2bb1(_0x2134be[_0xae23('0x11')]['message']);}logger[_0xae23('0x11')](_0xae23('0x14'),_0x4c3794,_0x2134be['error'][_0xae23('0x13')]);return _0xb6640c(_0x2134be[_0xae23('0x11')][_0xae23('0x13')]);}else{logger[_0xae23('0xc')](_0xae23('0x14'),_0x4c3794,'request\x20sent');_0xb6640c(_0x2134be['result']['message']);}})[_0xae23('0x15')](function(_0x38f8e1){logger[_0xae23('0x11')](_0xae23('0x14'),_0x4c3794,_0x38f8e1);_0x3e2bb1(_0x38f8e1);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index b35edc4..f07bf1f 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 _0xf123=['destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf123,0x123));var _0x3f12=function(_0x189d3c,_0x5efebf){_0x189d3c=_0x189d3c-0x0;var _0x485959=_0xf123[_0x189d3c];return _0x485959;};'use strict';var multer=require(_0x3f12('0x0'));var util=require(_0x3f12('0x1'));var path=require('path');var timeout=require(_0x3f12('0x2'));var express=require('express');var router=express[_0x3f12('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3f12('0x4'));var interaction=require(_0x3f12('0x5'));var config=require('../../config/environment');var controller=require(_0x3f12('0x6'));router[_0x3f12('0x7')]('/',auth[_0x3f12('0x8')](),controller[_0x3f12('0x9')]);router[_0x3f12('0x7')](_0x3f12('0xa'),auth[_0x3f12('0x8')](),controller[_0x3f12('0xb')]);router[_0x3f12('0x7')](_0x3f12('0xc'),auth[_0x3f12('0x8')](),controller[_0x3f12('0xd')]);router['post']('/',auth[_0x3f12('0x8')](),controller[_0x3f12('0xe')]);router['put'](_0x3f12('0xc'),auth[_0x3f12('0x8')](),controller['update']);router['delete'](_0x3f12('0xc'),auth[_0x3f12('0x8')](),controller[_0x3f12('0xf')]);module[_0x3f12('0x10')]=router;
\ No newline at end of file
+var _0xa99c=['/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','post'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xa99c,0x15a));var _0xca99=function(_0x368f76,_0x136ee8){_0x368f76=_0x368f76-0x0;var _0x86935e=_0xa99c[_0x368f76];return _0x86935e;};'use strict';var multer=require(_0xca99('0x0'));var util=require(_0xca99('0x1'));var path=require('path');var timeout=require(_0xca99('0x2'));var express=require(_0xca99('0x3'));var router=express[_0xca99('0x4')]();var fs_extra=require(_0xca99('0x5'));var auth=require(_0xca99('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xca99('0x7'));var controller=require(_0xca99('0x8'));router[_0xca99('0x9')]('/',auth['isAuthenticated'](),controller[_0xca99('0xa')]);router[_0xca99('0x9')](_0xca99('0xb'),auth[_0xca99('0xc')](),controller[_0xca99('0xd')]);router[_0xca99('0x9')]('/:id',auth[_0xca99('0xc')](),controller['show']);router[_0xca99('0xe')]('/',auth[_0xca99('0xc')](),controller['create']);router['put'](_0xca99('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xca99('0x10')](_0xca99('0xf'),auth[_0xca99('0xc')](),controller[_0xca99('0x11')]);module[_0xca99('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index b03ed86..f80dad1 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 _0x59a2=['textarea','Comments','offlineForm','setDataValue','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:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','thumb','star','stringify','input','text','name','getDataValue','parse','onlineForm'];(function(_0x4f8912,_0x209a3d){var _0xe17e9d=function(_0x486ba7){while(--_0x486ba7){_0x4f8912['push'](_0x4f8912['shift']());}};_0xe17e9d(++_0x209a3d);}(_0x59a2,0x1ee));var _0x259a=function(_0x25efb8,_0x2ebd12){_0x25efb8=_0x25efb8-0x0;var _0x44de2a=_0x59a2[_0x25efb8];return _0x44de2a;};'use strict';var Sequelize=require(_0x259a('0x0'));var rs=require(_0x259a('0x1'));module[_0x259a('0x2')]={'name':{'type':Sequelize[_0x259a('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x259a('0x4')},'description':{'type':Sequelize[_0x259a('0x3')]},'mapKey':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x5')},'mapKeyOffline':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x5')},'key':{'type':Sequelize[_0x259a('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x6')},'customerAlias':{'type':Sequelize[_0x259a('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x259a('0x3')],'allowNull':![],'defaultValue':_0x259a('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x259a('0x3')],'allowNull':![],'defaultValue':_0x259a('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x259a('0x3')],'allowNull':![],'defaultValue':_0x259a('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x259a('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x259a('0x3')]},'animation':{'type':Sequelize[_0x259a('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x259a('0xb')]('rounded',_0x259a('0xc')),'defaultValue':_0x259a('0xd')},'header_online':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0xe')},'start_chat_button':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0xf')},'offline_chat_button':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x10')},'header_offline':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x11')},'download_transcript':{'type':Sequelize[_0x259a('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x12')},'defaultWhiteLabel':{'type':Sequelize[_0x259a('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x259a('0x13')]},'closingQuestion':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x14')},'formSubmitSuccessMessage':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x15')},'formSubmitFailureMessage':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x16')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x259a('0x17')},'placeholderMessage':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x18')},'closingMessage':{'type':Sequelize[_0x259a('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x10')},'skipMessageButton':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x19')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x259a('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x259a('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x259a('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x1a')},'ratingType':{'type':Sequelize[_0x259a('0xb')]('star',_0x259a('0x1b')),'defaultValue':_0x259a('0x1c')},'ratingStarsNumber':{'type':Sequelize[_0x259a('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x259a('0x13')],'defaultValue':function(){return JSON[_0x259a('0x1d')]({'items':[{'type':_0x259a('0x1e'),'variable':null,'config':{'placeholder':'name','type':_0x259a('0x1f'),'required':!![]},'props':{'title':_0x259a('0x20'),'helpText':''}},{'type':_0x259a('0x1e'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x259a('0x5'),'type':_0x259a('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x259a('0x21')]('onlineForm')?JSON[_0x259a('0x22')](this[_0x259a('0x21')](_0x259a('0x23'))):{};},'set':function(_0x4cd9bb){return this['setDataValue']('onlineForm',JSON[_0x259a('0x1d')](_0x4cd9bb));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x259a('0x1d')]({'items':[{'type':'input','props':{'title':_0x259a('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x259a('0x5'),'type':'email'},'variable':null},{'type':_0x259a('0x24'),'config':{'placeholder':_0x259a('0x25')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x259a('0x21')](_0x259a('0x26'))?JSON[_0x259a('0x22')](this[_0x259a('0x21')]('offlineForm')):{};},'set':function(_0x4d87e0){return this[_0x259a('0x27')](_0x259a('0x26'),JSON[_0x259a('0x1d')](_0x4d87e0));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x259a('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x259a('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x259a('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x259a('0x3')]},'waitingTitle':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x28')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x259a('0x29')},'offlineMessageSubject':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x2a')},'offlineMessageBody':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x2b')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x19')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x259a('0x10')},'enableCustomerAttachment':{'type':Sequelize[_0x259a('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x259a('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x259a('0x13')]},'showAgentAvatar':{'type':Sequelize[_0x259a('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x259a('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x259a('0x2c');}},'notificationSound':{'type':Sequelize[_0x259a('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x259a('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x259a('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x259a('0x2e')},'verticalAlignment':{'type':Sequelize[_0x259a('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x259a('0x2f')},'messagesAlignment':{'type':Sequelize[_0x259a('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x259a('0x13')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x259a('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x259a('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x259a('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x259a('0x3')],'defaultValue':_0x259a('0x30')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x259a('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x259a('0xa')],'defaultValue':![],'comment':_0x259a('0x31'),'set':function(_0xe4766d){if(!_0xe4766d)this[_0x259a('0x27')](_0x259a('0x32'),null);this['setDataValue'](_0x259a('0x33'),_0xe4766d);}},'vidaooEscalation':{'type':Sequelize[_0x259a('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x259a('0x3')]},'vidaooTopic':{'type':Sequelize[_0x259a('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x259a('0x3')],'defaultValue':function(){return _0x259a('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x259a('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x5617=['Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','TEXT','stringify','input','name','onlineForm','setDataValue','Comments','getDataValue','offlineForm','parse','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.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','rounded','squared','We\x20are\x20here!'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5617,0x13d));var _0x7561=function(_0xa3400,_0x3a980a){_0xa3400=_0xa3400-0x0;var _0x33dba2=_0x5617[_0xa3400];return _0x33dba2;};'use strict';var Sequelize=require(_0x7561('0x0'));var rs=require(_0x7561('0x1'));module[_0x7561('0x2')]={'name':{'type':Sequelize[_0x7561('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x7561('0x3')],'allowNull':![],'unique':_0x7561('0x4')},'description':{'type':Sequelize[_0x7561('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0x5')},'mapKeyOffline':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x7561('0x3')],'allowNull':![],'defaultValue':_0x7561('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x7561('0x3')],'allowNull':![],'defaultValue':_0x7561('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x7561('0x3')],'allowNull':![],'defaultValue':_0x7561('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x7561('0x3')],'allowNull':![],'defaultValue':_0x7561('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x7561('0x3')]},'animation':{'type':Sequelize[_0x7561('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x7561('0xa'),_0x7561('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0xc')},'start_chat_button':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0xe')},'header_offline':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0xf')},'download_transcript':{'type':Sequelize[_0x7561('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x7561('0x10')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x7561('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x7561('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x13')},'noteTitle':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x14')},'placeholderMessage':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0x16')},'closingMessageButton':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0xe')},'skipMessageButton':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x17')},'conditionAgreement':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x18')},'ratingType':{'type':Sequelize[_0x7561('0x19')](_0x7561('0x1a'),_0x7561('0x1b')),'defaultValue':_0x7561('0x1a')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x7561('0x1c')],'defaultValue':function(){return JSON[_0x7561('0x1d')]({'items':[{'type':_0x7561('0x1e'),'variable':null,'config':{'placeholder':_0x7561('0x1f'),'type':'text','required':!![]},'props':{'title':_0x7561('0x1f'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x7561('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x7561('0x20'))?JSON['parse'](this['getDataValue'](_0x7561('0x20'))):{};},'set':function(_0x2b7061){return this[_0x7561('0x21')](_0x7561('0x20'),JSON[_0x7561('0x1d')](_0x2b7061));}},'offlineForm':{'type':Sequelize[_0x7561('0x1c')],'defaultValue':function(){return JSON[_0x7561('0x1d')]({'items':[{'type':_0x7561('0x1e'),'props':{'title':_0x7561('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x7561('0x5'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x7561('0x22'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x7561('0x23')](_0x7561('0x24'))?JSON[_0x7561('0x25')](this['getDataValue'](_0x7561('0x24'))):{};},'set':function(_0x476ff3){return this[_0x7561('0x21')](_0x7561('0x24'),JSON['stringify'](_0x476ff3));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x7561('0x26')]();}},'autoclose':{'type':Sequelize[_0x7561('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x7561('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0x27')},'waitingMessage':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x28')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0x29')},'offlineMessageBody':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0x7561('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0x2b')},'skipUnmanaged':{'type':Sequelize[_0x7561('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x7561('0x1c')]},'showAgentAvatar':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x7561('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7561('0x1c')],'defaultValue':function(){return _0x7561('0x2c');}},'notificationSound':{'type':Sequelize[_0x7561('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x7561('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x7561('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0x2d')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0x2e')},'messagesAlignment':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x2f')},'defaultTitle':{'type':Sequelize[_0x7561('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7561('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7561('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7561('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x7561('0x1c')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x7561('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![],'comment':_0x7561('0x32'),'set':function(_0x4d30ba){if(!_0x4d30ba)this[_0x7561('0x21')](_0x7561('0x33'),null);this[_0x7561('0x21')](_0x7561('0x34'),_0x4d30ba);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x7561('0x3')]},'vidaooTopic':{'type':Sequelize[_0x7561('0x3')],'allowNull':![],'defaultValue':_0x7561('0x35')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x7561('0x36');}},'vidaooMetadata':{'type':Sequelize[_0x7561('0x1c')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x7561('0x1c')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 74e9ff2..c0516ec 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 _0x5c12=['sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','sendMail','email','user','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','hasOwnProperty','Contact','fullname','internal','Tag','Tags','tag','getSnippet','interval','getProactiveActions','getLicense','virtual','increment','chatLicenseExceeded','ifTime','server/files/chat/iframe.ejs','3.13.0','origin','http://localhost:9000','address','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','alignment','color','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','ChatApplication','finally','getApplications','chatProactiveAction','getFields','online','false','items','fromKey','ChatOfflineMessage','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','getAgents','util','path','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','api','../../config/environment','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','client','http','request','info','request\x20sent','debug','error','code','message','ChatWebsite,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','then','destroy','get','ChatWebsites','stack','name','send','user-agent-parser','setUA','user-agent','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','unknown','model','device','vendor','type','stringify','index','mandatoryDispositionPause','map','ChatWebsite','fieldName','key','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','create','body','forEach','trim','testWildcardValidity','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','find','Pause','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','order','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','customerAvatar','existsSync','getSystemAvatar','Interval','resolve','timezone','notify','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','Body\x20is\x20mandatory','customerIp','CmContact','No\x20available\x20attributes','createdAt','includes','updatedAt','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','DESC','Intervals','format','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','applications','orderBy','priority','asc','account','Applications','list','headers','threadId','ChatInteraction','closed','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','contact','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','difference','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','server','attachments','offline-chat','basename','openNewInteraction'];(function(_0x11df3e,_0x21249e){var _0x5139c4=function(_0x5d8f55){while(--_0x5d8f55){_0x11df3e['push'](_0x11df3e['shift']());}};_0x5139c4(++_0x21249e);}(_0x5c12,0x188));var _0x25c1=function(_0x2a7b50,_0x545d55){_0x2a7b50=_0x2a7b50-0x0;var _0x4224c9=_0x5c12[_0x2a7b50];return _0x4224c9;};'use strict';var Mustache=require('mustache');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25c1('0x2'));var _=require(_0x25c1('0x3'));var querystring=require(_0x25c1('0x4'));var htmlToText=require(_0x25c1('0x5'));var Redis=require(_0x25c1('0x6'));var jayson=require(_0x25c1('0x7'));var qs=require(_0x25c1('0x8'));var logger=require('../../config/logger')(_0x25c1('0x9'));var config=require(_0x25c1('0xa'));var APIBadRequestError=require(_0x25c1('0xb'))['APIBadRequestError'];var APINotFoundError=require('../../errors/api')[_0x25c1('0xc')];var APIOutOfIntervalError=require(_0x25c1('0xb'))[_0x25c1('0xd')];var APIHandleError=require(_0x25c1('0xb'))[_0x25c1('0xe')];var APIConflictError=require('../../errors/api')[_0x25c1('0xf')];var wildcardUtils=require(_0x25c1('0x10'));var URL=require(_0x25c1('0x11'))[_0x25c1('0x12')];var db=require(_0x25c1('0x13'))['db'];config['redis']=_[_0x25c1('0x14')](config[_0x25c1('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x25c1('0x16'))(new Redis(config[_0x25c1('0x15')]));require(_0x25c1('0x17'))[_0x25c1('0x18')](socket);var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0x25c1('0x19')][_0x25c1('0x1a')]({'port':0x232b});var client9001=jayson[_0x25c1('0x19')][_0x25c1('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0x17a032,_0x4ea926,_0x4638f0,_0x55b62d){return new Promise(function(_0x5d631e,_0x5b852a){var _0x284712=_0x55b62d||client;return _0x284712[_0x25c1('0x1b')](_0x17a032,_0x4638f0)['then'](function(_0x4c55e7){logger[_0x25c1('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x4ea926,_0x25c1('0x1d'));logger[_0x25c1('0x1e')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4ea926,'request\x20sent',JSON['stringify'](_0x4c55e7));if(_0x4c55e7[_0x25c1('0x1f')]){if(_0x4c55e7[_0x25c1('0x1f')][_0x25c1('0x20')]===0x1f4){logger[_0x25c1('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x4ea926,_0x4c55e7[_0x25c1('0x1f')][_0x25c1('0x21')]);return _0x5b852a(_0x4c55e7[_0x25c1('0x1f')][_0x25c1('0x21')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4ea926,_0x4c55e7[_0x25c1('0x1f')][_0x25c1('0x21')]);return _0x5d631e(_0x4c55e7[_0x25c1('0x1f')][_0x25c1('0x21')]);}else{logger[_0x25c1('0x1c')](_0x25c1('0x22'),_0x4ea926,_0x25c1('0x1d'));_0x5d631e(_0x4c55e7[_0x25c1('0x23')][_0x25c1('0x21')]);}})[_0x25c1('0x24')](function(_0x2f78dd){logger[_0x25c1('0x1f')](_0x25c1('0x22'),_0x4ea926,_0x2f78dd);_0x5b852a(_0x2f78dd);});});}function respondWithStatusCode(_0x4915cc,_0x2dadae){_0x2dadae=_0x2dadae||0xcc;return function(_0x20dbb9){if(_0x20dbb9){return _0x4915cc[_0x25c1('0x25')](_0x2dadae);}return _0x4915cc[_0x25c1('0x26')](_0x2dadae)[_0x25c1('0x27')]();};}function respondWithResult(_0x326a5f,_0x5ad776){_0x5ad776=_0x5ad776||0xc8;return function(_0x17c924){if(_0x17c924){return _0x326a5f[_0x25c1('0x26')](_0x5ad776)[_0x25c1('0x28')](_0x17c924);}};}function respondWithFilteredResult(_0x38c1d5,_0x11c0ae){return function(_0x193a68){if(_0x193a68){var _0x5c56ab=typeof _0x11c0ae[_0x25c1('0x29')]==='undefined'&&typeof _0x11c0ae[_0x25c1('0x2a')]===_0x25c1('0x2b');var _0x2c42b9=_0x193a68[_0x25c1('0x2c')];var _0x2e80b5=_0x5c56ab?0x0:_0x11c0ae[_0x25c1('0x29')];var _0x1fd4e3=_0x5c56ab?_0x193a68[_0x25c1('0x2c')]:_0x11c0ae[_0x25c1('0x29')]+_0x11c0ae['limit'];var _0xa46f98;if(_0x1fd4e3>=_0x2c42b9){_0x1fd4e3=_0x2c42b9;_0xa46f98=0xc8;}else{_0xa46f98=0xce;}_0x38c1d5['status'](_0xa46f98);return _0x38c1d5['set'](_0x25c1('0x2d'),_0x2e80b5+'-'+_0x1fd4e3+'/'+_0x2c42b9)[_0x25c1('0x28')](_0x193a68);}return null;};}function saveUpdates(_0x4ef790){return function(_0x173f3e){if(_0x173f3e){return _0x173f3e['update'](_0x4ef790)[_0x25c1('0x2e')](function(_0x4834b3){return _0x4834b3;});}return null;};}function removeEntity(_0x1084b8){return function(_0x7f1e7a){if(_0x7f1e7a){return _0x7f1e7a[_0x25c1('0x2f')]()[_0x25c1('0x2e')](function(){var _0x1d4afc=_0x7f1e7a[_0x25c1('0x30')]({'plain':!![]});var _0x461d23=_0x25c1('0x31');return db['UserProfileResource'][_0x25c1('0x2f')]({'where':{'type':_0x461d23,'resourceId':_0x1d4afc['id']}})['then'](function(){return _0x7f1e7a;});})[_0x25c1('0x2e')](function(){_0x1084b8['status'](0xcc)[_0x25c1('0x27')]();});}};}function handleEntityNotFound(_0x1917e6){return function(_0x18f10c){if(!_0x18f10c){_0x1917e6[_0x25c1('0x25')](0x194);}return _0x18f10c;};}function handleError(_0x390083,_0x92184a){_0x92184a=_0x92184a||0x1f4;return function(_0x35e632){logger[_0x25c1('0x1f')](_0x35e632[_0x25c1('0x32')]);if(_0x35e632[_0x25c1('0x33')]){delete _0x35e632[_0x25c1('0x33')];}_0x390083[_0x25c1('0x26')](_0x92184a)[_0x25c1('0x34')](_0x35e632);};}function createInteractionObject(_0x1b6e92,_0x266f3b,_0x14288b,_0x349aef){var _0x30b1d7=require(_0x25c1('0x35'));var _0x357385=new _0x30b1d7();var _0x5c6d45=_0x357385[_0x25c1('0x36')](_0x14288b[_0x25c1('0x37')])['getResult']();var _0x32ab98=_0x266f3b['customerIp'];if(_0x14288b[_0x25c1('0x38')]){_0x32ab98=_0x14288b['cf-connecting-ip'];}else if(_0x14288b[_0x25c1('0x39')]){_0x32ab98=_[_0x25c1('0x3a')](_0x14288b[_0x25c1('0x39')][_0x25c1('0x3b')](','));}return{'ContactId':_0x349aef['id'],'ChatWebsiteId':_0x1b6e92,'from':(_0x349aef[_0x25c1('0x3c')]||'')+'\x20'+(_0x349aef['lastName']||''),'customerIp':_0x32ab98,'customerPort':_0x14288b[_0x25c1('0x3d')]?_0x14288b['x-real-port']:null,'referer':_0x266f3b[_0x25c1('0x3e')],'browserName':_0x5c6d45[_0x25c1('0x3f')][_0x25c1('0x33')]&&_0x5c6d45[_0x25c1('0x3f')]['version']?util['format']('%s\x20%s',_0x5c6d45[_0x25c1('0x3f')][_0x25c1('0x33')],_0x5c6d45['browser'][_0x25c1('0x40')]):'unknown','browserVersion':_0x5c6d45[_0x25c1('0x3f')][_0x25c1('0x40')]||_0x25c1('0x41'),'osName':util['format']('%s\x20%s',_0x5c6d45['os']['name'],_0x5c6d45['os'][_0x25c1('0x40')]),'osVersion':_0x5c6d45['os'][_0x25c1('0x40')],'deviceModel':_0x5c6d45['device'][_0x25c1('0x42')]&&_0x5c6d45[_0x25c1('0x43')][_0x25c1('0x44')]?util['format']('%s\x20%s\x20%s',_0x5c6d45['device']['model'],_0x5c6d45[_0x25c1('0x43')][_0x25c1('0x44')],_0x5c6d45['device'][_0x25c1('0x45')]):null,'deviceVendor':_0x5c6d45[_0x25c1('0x43')][_0x25c1('0x44')],'deviceType':_0x5c6d45[_0x25c1('0x43')][_0x25c1('0x45')],'formData':JSON[_0x25c1('0x46')](_0x266f3b)};}exports[_0x25c1('0x47')]=function(_0x552174,_0x545934){var _0x28fc89={'include':[{'model':db['Pause'],'as':_0x25c1('0x48')}]},_0x43d96a={},_0x389547={'count':0x0,'rows':[]};var _0x1c95e5=_[_0x25c1('0x49')](db[_0x25c1('0x4a')]['rawAttributes'],function(_0xb87cf1){return{'name':_0xb87cf1[_0x25c1('0x4b')],'type':_0xb87cf1[_0x25c1('0x45')][_0x25c1('0x4c')]};});_0x43d96a['model']=_['map'](_0x1c95e5,_0x25c1('0x33'));_0x43d96a[_0x25c1('0x4d')]=_[_0x25c1('0x4e')](_0x552174[_0x25c1('0x4d')]);_0x43d96a['filters']=_[_0x25c1('0x4f')](_0x43d96a[_0x25c1('0x42')],_0x43d96a['query']);_0x28fc89[_0x25c1('0x50')]=_[_0x25c1('0x4f')](_0x43d96a[_0x25c1('0x42')],qs[_0x25c1('0x51')](_0x552174['query']['fields']));_0x28fc89[_0x25c1('0x50')]=_0x28fc89[_0x25c1('0x50')][_0x25c1('0x52')]?_0x28fc89['attributes']:_0x43d96a[_0x25c1('0x42')];if(!_0x552174[_0x25c1('0x4d')]['hasOwnProperty'](_0x25c1('0x53'))){_0x28fc89[_0x25c1('0x2a')]=qs[_0x25c1('0x2a')](_0x552174[_0x25c1('0x4d')][_0x25c1('0x2a')]);_0x28fc89[_0x25c1('0x29')]=qs[_0x25c1('0x29')](_0x552174['query']['offset']);}_0x28fc89['order']=qs[_0x25c1('0x54')](_0x552174['query'][_0x25c1('0x54')]);_0x28fc89[_0x25c1('0x55')]=qs[_0x25c1('0x56')](_[_0x25c1('0x57')](_0x552174[_0x25c1('0x4d')],_0x43d96a[_0x25c1('0x56')]),_0x1c95e5);if(_0x552174['query'][_0x25c1('0x58')]){_0x28fc89[_0x25c1('0x55')]=_[_0x25c1('0x59')](_0x28fc89[_0x25c1('0x55')],{'$or':_[_0x25c1('0x49')](_0x1c95e5,function(_0xed718b){if(_0xed718b['type']!==_0x25c1('0x5a')){var _0x2e741f={};_0x2e741f[_0xed718b[_0x25c1('0x33')]]={'$like':'%'+_0x552174[_0x25c1('0x4d')][_0x25c1('0x58')]+'%'};return _0x2e741f;}})});}_0x28fc89=_['merge']({},_0x28fc89,_0x552174[_0x25c1('0x5b')]);var _0x3df219={'where':_0x28fc89['where']};return db[_0x25c1('0x4a')][_0x25c1('0x2c')](_0x3df219)[_0x25c1('0x2e')](function(_0x24c71a){_0x389547[_0x25c1('0x2c')]=_0x24c71a;if(_0x552174[_0x25c1('0x4d')]['includeAll']){_0x28fc89[_0x25c1('0x5c')]=[{'all':!![]}];}return db[_0x25c1('0x4a')][_0x25c1('0x5d')](_0x28fc89);})[_0x25c1('0x2e')](function(_0x286800){_0x389547[_0x25c1('0x5e')]=_0x286800;return _0x389547;})[_0x25c1('0x2e')](respondWithFilteredResult(_0x545934,_0x28fc89))[_0x25c1('0x24')](handleError(_0x545934,null));};exports[_0x25c1('0x5f')]=function(_0x455607,_0x270d67){var _0x2d9e6b={'raw':![],'where':{'id':_0x455607[_0x25c1('0x60')]['id']},'include':[{'model':db['Pause'],'as':_0x25c1('0x48')}]},_0x3ff0fa={};_0x3ff0fa[_0x25c1('0x42')]=_[_0x25c1('0x4e')](db[_0x25c1('0x4a')][_0x25c1('0x61')]);_0x3ff0fa[_0x25c1('0x4d')]=_[_0x25c1('0x4e')](_0x455607['query']);_0x3ff0fa[_0x25c1('0x56')]=_['intersection'](_0x3ff0fa[_0x25c1('0x42')],_0x3ff0fa[_0x25c1('0x4d')]);_0x2d9e6b[_0x25c1('0x50')]=_[_0x25c1('0x4f')](_0x3ff0fa[_0x25c1('0x42')],qs[_0x25c1('0x51')](_0x455607[_0x25c1('0x4d')][_0x25c1('0x51')]));_0x2d9e6b['attributes']=_0x2d9e6b[_0x25c1('0x50')][_0x25c1('0x52')]?_0x2d9e6b[_0x25c1('0x50')]:_0x3ff0fa[_0x25c1('0x42')];if(_0x455607[_0x25c1('0x4d')][_0x25c1('0x62')]){_0x2d9e6b[_0x25c1('0x5c')]=[{'all':!![]}];}_0x2d9e6b=_['merge']({},_0x2d9e6b,_0x455607[_0x25c1('0x5b')]);return db['ChatWebsite']['find'](_0x2d9e6b)['then'](handleEntityNotFound(_0x270d67,null))[_0x25c1('0x2e')](respondWithResult(_0x270d67,null))[_0x25c1('0x24')](handleError(_0x270d67,null));};exports[_0x25c1('0x63')]=function(_0x15cd6d,_0x45724c){var _0x58c743=null;_0x15cd6d[_0x25c1('0x64')]['address'][_0x25c1('0x3b')](',')[_0x25c1('0x65')](_0x2029ac=>{if(_0x2029ac[_0x25c1('0x66')]()!==''&&!wildcardUtils[_0x25c1('0x67')](_0x2029ac[_0x25c1('0x66')]())){_0x58c743=new APIBadRequestError('\x22'+_0x2029ac[_0x25c1('0x66')]()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x58c743){return handleError(_0x45724c,null)(_0x58c743);}return db[_0x25c1('0x4a')][_0x25c1('0x63')](_0x15cd6d[_0x25c1('0x64')],{})[_0x25c1('0x2e')](function(_0x242149){var _0x425f3e=_0x15cd6d['user'][_0x25c1('0x30')]({'plain':!![]});if(!_0x425f3e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x425f3e[_0x25c1('0x68')]==='user'){var _0x588b5f=_0x242149[_0x25c1('0x30')]({'plain':!![]});var _0x58fd37='ChatWebsites';return db['UserProfileSection']['find']({'where':{'name':_0x58fd37,'userProfileId':_0x425f3e[_0x25c1('0x69')]},'raw':!![]})['then'](function(_0x11aafa){if(_0x11aafa&&_0x11aafa[_0x25c1('0x6a')]===0x0){return db[_0x25c1('0x6b')][_0x25c1('0x63')]({'name':_0x588b5f['name'],'resourceId':_0x588b5f['id'],'type':_0x11aafa['name'],'sectionId':_0x11aafa['id']},{})[_0x25c1('0x2e')](function(){return _0x242149;});}else{return _0x242149;}})[_0x25c1('0x24')](function(_0x5df07e){logger[_0x25c1('0x1f')](_0x25c1('0x6c'),_0x5df07e);throw _0x5df07e;});}return _0x242149;})[_0x25c1('0x2e')](respondWithResult(_0x45724c,0xc9))['catch'](handleError(_0x45724c,null));};exports[_0x25c1('0x6d')]=function(_0x48ecff,_0x21df62){var _0x1b501d=null;_0x48ecff[_0x25c1('0x64')]['address'][_0x25c1('0x3b')](',')[_0x25c1('0x65')](_0x2a3aad=>{if(_0x2a3aad['trim']()!==''&&!wildcardUtils[_0x25c1('0x67')](_0x2a3aad[_0x25c1('0x66')]())){_0x1b501d=new APIBadRequestError('\x22'+_0x2a3aad[_0x25c1('0x66')]()+_0x25c1('0x6e'));}});if(_0x1b501d){return handleError(_0x21df62,null)(_0x1b501d);}if(_0x48ecff[_0x25c1('0x64')]['id']){delete _0x48ecff[_0x25c1('0x64')]['id'];}return db[_0x25c1('0x4a')][_0x25c1('0x6f')]({'where':{'id':_0x48ecff[_0x25c1('0x60')]['id']},'include':[{'model':db[_0x25c1('0x70')],'as':_0x25c1('0x48')}]})[_0x25c1('0x2e')](handleEntityNotFound(_0x21df62,null))[_0x25c1('0x2e')](saveUpdates(_0x48ecff[_0x25c1('0x64')],null))['then'](respondWithResult(_0x21df62,null))[_0x25c1('0x24')](handleError(_0x21df62,null));};exports[_0x25c1('0x2f')]=function(_0x138376,_0x35792c){return db[_0x25c1('0x4a')][_0x25c1('0x6f')]({'where':{'id':_0x138376[_0x25c1('0x60')]['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x35792c,null))[_0x25c1('0x2e')](removeEntity(_0x35792c,null))[_0x25c1('0x24')](handleError(_0x35792c,null));};exports[_0x25c1('0x71')]=function(_0x5bd027,_0x1a1a02){return db['ChatWebsite'][_0x25c1('0x71')]()[_0x25c1('0x2e')](respondWithResult(_0x1a1a02,null))['catch'](handleError(_0x1a1a02,null));};exports[_0x25c1('0x72')]=function(_0x13755b,_0x833e8f){if(_0x13755b['body']['id']){delete _0x13755b[_0x25c1('0x64')]['id'];}return db[_0x25c1('0x4a')]['find']({'where':{'id':_0x13755b[_0x25c1('0x60')]['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x833e8f,null))[_0x25c1('0x2e')](function(_0x50ce85){if(_0x50ce85){_0x13755b[_0x25c1('0x64')][_0x25c1('0x73')]=_0x50ce85['id'];return db[_0x25c1('0x74')][_0x25c1('0x63')](_0x13755b['body']);}})[_0x25c1('0x2e')](respondWithResult(_0x833e8f,null))['catch'](handleError(_0x833e8f,null));};exports[_0x25c1('0x75')]=function(_0x35153c,_0x48e3bc){var _0x41e5c5={'raw':![],'where':{}};var _0x5f55c1={};var _0x3e14e6={'count':0x0,'rows':[]};return db[_0x25c1('0x4a')][_0x25c1('0x76')]({'where':{'id':_0x35153c[_0x25c1('0x60')]['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x48e3bc,null))[_0x25c1('0x2e')](function(_0xed1dc5){if(_0xed1dc5){_0x5f55c1['model']=_['keys'](db[_0x25c1('0x74')][_0x25c1('0x61')]);_0x5f55c1['query']=_[_0x25c1('0x4e')](_0x35153c[_0x25c1('0x4d')]);_0x5f55c1[_0x25c1('0x56')]=_['intersection'](_0x5f55c1['model'],_0x5f55c1[_0x25c1('0x4d')]);_0x41e5c5['attributes']=_[_0x25c1('0x4f')](_0x5f55c1[_0x25c1('0x42')],qs[_0x25c1('0x51')](_0x35153c[_0x25c1('0x4d')]['fields']));_0x41e5c5['attributes']=_0x41e5c5[_0x25c1('0x50')]['length']?_0x41e5c5[_0x25c1('0x50')]:_0x5f55c1[_0x25c1('0x42')];if(!_0x35153c[_0x25c1('0x4d')]['hasOwnProperty'](_0x25c1('0x53'))){_0x41e5c5[_0x25c1('0x2a')]=qs[_0x25c1('0x2a')](_0x35153c[_0x25c1('0x4d')][_0x25c1('0x2a')]);_0x41e5c5[_0x25c1('0x29')]=qs[_0x25c1('0x29')](_0x35153c[_0x25c1('0x4d')][_0x25c1('0x29')]);}_0x41e5c5[_0x25c1('0x77')]=qs[_0x25c1('0x54')](_0x35153c['query'][_0x25c1('0x54')]);_0x41e5c5['where']=qs[_0x25c1('0x56')](_[_0x25c1('0x57')](_0x35153c[_0x25c1('0x4d')],_0x5f55c1[_0x25c1('0x56')]));_0x41e5c5[_0x25c1('0x55')][_0x25c1('0x73')]=_0xed1dc5['id'];if(_0x35153c[_0x25c1('0x4d')]['filter']){_0x41e5c5['where']=_[_0x25c1('0x59')](_0x41e5c5['where'],{'$or':_['map'](_0x41e5c5[_0x25c1('0x50')],function(_0x20c41d){var _0x21f642={};_0x21f642[_0x20c41d]={'$like':'%'+_0x35153c[_0x25c1('0x4d')][_0x25c1('0x58')]+'%'};return _0x21f642;})});}_0x41e5c5=_[_0x25c1('0x59')]({},_0x41e5c5,_0x35153c['options']);return db[_0x25c1('0x74')][_0x25c1('0x2c')]({'where':_0x41e5c5[_0x25c1('0x55')]})[_0x25c1('0x2e')](function(_0x4a3b87){_0x3e14e6[_0x25c1('0x2c')]=_0x4a3b87;if(_0x35153c[_0x25c1('0x4d')][_0x25c1('0x62')]){_0x41e5c5[_0x25c1('0x5c')]=[{'all':!![]}];}return db['Disposition'][_0x25c1('0x5d')](_0x41e5c5);})[_0x25c1('0x2e')](function(_0x27bdf6){_0x3e14e6[_0x25c1('0x5e')]=_0x27bdf6;return _0x3e14e6;});}})[_0x25c1('0x2e')](respondWithFilteredResult(_0x48e3bc,_0x41e5c5))['catch'](handleError(_0x48e3bc,null));};exports[_0x25c1('0x78')]=function(_0x4a79a0,_0x174af3){return db['ChatWebsite'][_0x25c1('0x6f')]({'where':{'id':_0x4a79a0[_0x25c1('0x60')]['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x174af3,null))['then'](function(_0x3e1429){if(_0x3e1429){return _0x3e1429['removeDispositions'](_0x4a79a0[_0x25c1('0x4d')]['ids']);}})[_0x25c1('0x2e')](respondWithStatusCode(_0x174af3,null))[_0x25c1('0x24')](handleError(_0x174af3,null));};exports[_0x25c1('0x79')]=function(_0x137725,_0x40b950){if(_0x137725[_0x25c1('0x64')]['id']){delete _0x137725['body']['id'];}return db[_0x25c1('0x4a')][_0x25c1('0x6f')]({'where':{'id':_0x137725[_0x25c1('0x60')]['id']}})['then'](handleEntityNotFound(_0x40b950,null))['then'](function(_0xfa8a4c){if(_0xfa8a4c){_0x137725[_0x25c1('0x64')][_0x25c1('0x73')]=_0xfa8a4c['id'];return db[_0x25c1('0x7a')][_0x25c1('0x63')](_0x137725[_0x25c1('0x64')]);}})[_0x25c1('0x2e')](respondWithResult(_0x40b950,null))['catch'](handleError(_0x40b950,null));};exports['getAnswers']=function(_0x5aabfa,_0x513f6a){var _0x14c05a={'raw':![],'where':{}};var _0xc68a7f={};var _0x158120={'count':0x0,'rows':[]};return db[_0x25c1('0x4a')][_0x25c1('0x76')]({'where':{'id':_0x5aabfa[_0x25c1('0x60')]['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x513f6a,null))[_0x25c1('0x2e')](function(_0x23463e){if(_0x23463e){_0xc68a7f[_0x25c1('0x42')]=_[_0x25c1('0x4e')](db[_0x25c1('0x7a')][_0x25c1('0x61')]);_0xc68a7f[_0x25c1('0x4d')]=_[_0x25c1('0x4e')](_0x5aabfa['query']);_0xc68a7f[_0x25c1('0x56')]=_[_0x25c1('0x4f')](_0xc68a7f['model'],_0xc68a7f[_0x25c1('0x4d')]);_0x14c05a[_0x25c1('0x50')]=_['intersection'](_0xc68a7f['model'],qs['fields'](_0x5aabfa['query'][_0x25c1('0x51')]));_0x14c05a[_0x25c1('0x50')]=_0x14c05a[_0x25c1('0x50')]['length']?_0x14c05a[_0x25c1('0x50')]:_0xc68a7f[_0x25c1('0x42')];if(!_0x5aabfa[_0x25c1('0x4d')]['hasOwnProperty'](_0x25c1('0x53'))){_0x14c05a[_0x25c1('0x2a')]=qs['limit'](_0x5aabfa[_0x25c1('0x4d')][_0x25c1('0x2a')]);_0x14c05a[_0x25c1('0x29')]=qs[_0x25c1('0x29')](_0x5aabfa[_0x25c1('0x4d')]['offset']);}_0x14c05a[_0x25c1('0x77')]=qs[_0x25c1('0x54')](_0x5aabfa['query'][_0x25c1('0x54')]);_0x14c05a[_0x25c1('0x55')]=qs[_0x25c1('0x56')](_[_0x25c1('0x57')](_0x5aabfa[_0x25c1('0x4d')],_0xc68a7f[_0x25c1('0x56')]));_0x14c05a[_0x25c1('0x55')][_0x25c1('0x73')]=_0x23463e['id'];if(_0x5aabfa[_0x25c1('0x4d')]['filter']){_0x14c05a[_0x25c1('0x55')]=_[_0x25c1('0x59')](_0x14c05a[_0x25c1('0x55')],{'$or':_[_0x25c1('0x49')](_0x14c05a['attributes'],function(_0x2dcbb8){var _0x36c50a={};_0x36c50a[_0x2dcbb8]={'$like':'%'+_0x5aabfa[_0x25c1('0x4d')][_0x25c1('0x58')]+'%'};return _0x36c50a;})});}_0x14c05a=_[_0x25c1('0x59')]({},_0x14c05a,_0x5aabfa[_0x25c1('0x5b')]);return db[_0x25c1('0x7a')][_0x25c1('0x2c')]({'where':_0x14c05a['where']})[_0x25c1('0x2e')](function(_0x4c4207){_0x158120[_0x25c1('0x2c')]=_0x4c4207;if(_0x5aabfa[_0x25c1('0x4d')][_0x25c1('0x62')]){_0x14c05a[_0x25c1('0x5c')]=[{'all':!![]}];}return db[_0x25c1('0x7a')][_0x25c1('0x5d')](_0x14c05a);})['then'](function(_0x307a83){_0x158120[_0x25c1('0x5e')]=_0x307a83;return _0x158120;});}})['then'](respondWithFilteredResult(_0x513f6a,_0x14c05a))[_0x25c1('0x24')](handleError(_0x513f6a,null));};exports[_0x25c1('0x7b')]=function(_0x33e71d,_0x1925a4){return db[_0x25c1('0x4a')][_0x25c1('0x6f')]({'where':{'id':_0x33e71d[_0x25c1('0x60')]['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x1925a4,null))[_0x25c1('0x2e')](function(_0x438486){if(_0x438486){return _0x438486[_0x25c1('0x7b')](_0x33e71d['query'][_0x25c1('0x7c')]);}})[_0x25c1('0x2e')](respondWithStatusCode(_0x1925a4,null))['catch'](handleError(_0x1925a4,null));};exports[_0x25c1('0x7d')]=function(_0x629ba6,_0x21de80){_0x629ba6[_0x25c1('0x64')][_0x25c1('0x7e')]=_0x629ba6[_0x25c1('0x7f')][_0x25c1('0x80')];return db[_0x25c1('0x4a')][_0x25c1('0x6f')]({'where':{'id':_0x629ba6[_0x25c1('0x60')]['id']}})['then'](handleEntityNotFound(_0x21de80,null))[_0x25c1('0x2e')](saveUpdates(_0x629ba6['body'],null))[_0x25c1('0x2e')](respondWithResult(_0x21de80,null))[_0x25c1('0x24')](handleError(_0x21de80,null));};exports[_0x25c1('0x81')]=function(_0x3bf69f,_0x47897e){_0x3bf69f[_0x25c1('0x64')][_0x25c1('0x82')]=_0x3bf69f[_0x25c1('0x7f')][_0x25c1('0x80')];return db['ChatWebsite']['find']({'where':{'id':_0x3bf69f['params']['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x47897e,null))[_0x25c1('0x2e')](saveUpdates(_0x3bf69f[_0x25c1('0x64')],null))[_0x25c1('0x2e')](respondWithResult(_0x47897e,null))[_0x25c1('0x24')](handleError(_0x47897e,null));};exports[_0x25c1('0x83')]=function(_0x360415,_0x4af1db){_0x360415[_0x25c1('0x64')]['customerAvatar']=_0x360415['file'][_0x25c1('0x80')];return db[_0x25c1('0x4a')][_0x25c1('0x6f')]({'where':{'id':_0x360415[_0x25c1('0x60')]['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x4af1db,null))[_0x25c1('0x2e')](saveUpdates(_0x360415[_0x25c1('0x64')],null))[_0x25c1('0x2e')](respondWithResult(_0x4af1db,null))[_0x25c1('0x24')](handleError(_0x4af1db,null));};exports[_0x25c1('0x84')]=function(_0x53259d,_0x58a64a){_0x53259d[_0x25c1('0x64')][_0x25c1('0x85')]=_0x53259d['file'][_0x25c1('0x80')];return db[_0x25c1('0x4a')]['find']({'where':{'id':_0x53259d[_0x25c1('0x60')]['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x58a64a,null))[_0x25c1('0x2e')](saveUpdates(_0x53259d[_0x25c1('0x64')],null))[_0x25c1('0x2e')](respondWithResult(_0x58a64a,null))[_0x25c1('0x24')](handleError(_0x58a64a,null));};exports[_0x25c1('0x86')]=function(_0xc165a,_0x475aa2){var _0x349d97=path['join'](config[_0x25c1('0x87')],_0x25c1('0x88'));var _0x30bd45={'where':{'id':_0xc165a['params']['id']},'attributes':['id',_0x25c1('0x7e')],'raw':!![]};var _0x158a0f=![];return require(_0x25c1('0x89'))['getLicense']()[_0x25c1('0x2e')](function(_0x1894a6){if(_0x1894a6){_0x158a0f=_0x1894a6[_0x25c1('0x8a')];}})[_0x25c1('0x2e')](function(){return db[_0x25c1('0x4a')][_0x25c1('0x6f')](_0x30bd45);})['then'](handleEntityNotFound(_0x475aa2,null))[_0x25c1('0x2e')](function(_0x10e4ca){if(_0x10e4ca){if(!_[_0x25c1('0x8b')](_0x10e4ca[_0x25c1('0x7e')])){if(fs['existsSync'](path[_0x25c1('0x8c')](config[_0x25c1('0x87')],_0x25c1('0x8d'),_0x10e4ca[_0x25c1('0x7e')]))&&_0x158a0f){_0x349d97=path[_0x25c1('0x8c')](config[_0x25c1('0x87')],_0x25c1('0x8d'),_0x10e4ca[_0x25c1('0x7e')]);}}return _0x475aa2[_0x25c1('0x8e')](_0x349d97);}})[_0x25c1('0x24')](handleError(_0x475aa2,null));};exports['getAvatar']=function(_0x10abc4,_0x2ecac3){var _0x2fa46e=path[_0x25c1('0x8c')](config[_0x25c1('0x87')],_0x25c1('0x8f'));var _0x5f1c08={'where':{'id':_0x10abc4['params']['id']},'attributes':['id',_0x25c1('0x82')],'raw':!![]};return db[_0x25c1('0x4a')][_0x25c1('0x6f')](_0x5f1c08)[_0x25c1('0x2e')](handleEntityNotFound(_0x2ecac3,null))[_0x25c1('0x2e')](function(_0x2ed32a){if(_0x2ed32a){if(!_['isNil'](_0x2ed32a['agentAvatar'])){if(fs['existsSync'](path[_0x25c1('0x8c')](config[_0x25c1('0x87')],_0x25c1('0x90'),_0x2ed32a['agentAvatar']))){_0x2fa46e=path[_0x25c1('0x8c')](config[_0x25c1('0x87')],_0x25c1('0x90'),_0x2ed32a[_0x25c1('0x82')]);}}return _0x2ecac3[_0x25c1('0x8e')](_0x2fa46e);}})[_0x25c1('0x24')](handleError(_0x2ecac3,null));};exports[_0x25c1('0x91')]=function(_0x34c639,_0x412bb7){var _0x110385=path[_0x25c1('0x8c')](config[_0x25c1('0x87')],'server/files/images/avatars/customer_avatar.png');var _0x1f934f={'where':{'id':_0x34c639[_0x25c1('0x60')]['id']},'attributes':['id','customerAvatar',_0x25c1('0x92')],'raw':!![]};return db[_0x25c1('0x4a')][_0x25c1('0x6f')](_0x1f934f)[_0x25c1('0x2e')](handleEntityNotFound(_0x412bb7,null))[_0x25c1('0x2e')](function(_0x51dffd){if(_0x51dffd){if(!_[_0x25c1('0x8b')](_0x51dffd[_0x25c1('0x93')])){if(fs[_0x25c1('0x94')](path[_0x25c1('0x8c')](config['root'],_0x25c1('0x90'),_0x51dffd['customerAvatar']))&&_0x51dffd[_0x25c1('0x92')]){_0x110385=path[_0x25c1('0x8c')](config[_0x25c1('0x87')],'server/files/images/avatars/',_0x51dffd[_0x25c1('0x93')]);}}return _0x412bb7[_0x25c1('0x8e')](_0x110385);}})[_0x25c1('0x24')](handleError(_0x412bb7,null));};exports[_0x25c1('0x95')]=function(_0x385ffe,_0x230f47){var _0x2e18b5=path[_0x25c1('0x8c')](config[_0x25c1('0x87')],'server/files/images/avatars/system_avatar.png');var _0xbbce83={'where':{'id':_0x385ffe[_0x25c1('0x60')]['id']},'attributes':['id',_0x25c1('0x85')],'raw':!![]};return db[_0x25c1('0x4a')][_0x25c1('0x6f')](_0xbbce83)['then'](handleEntityNotFound(_0x230f47,null))[_0x25c1('0x2e')](function(_0xc402d1){if(_0xc402d1){if(!_[_0x25c1('0x8b')](_0xc402d1['systemAvatar'])){if(fs[_0x25c1('0x94')](path[_0x25c1('0x8c')](config[_0x25c1('0x87')],'server/files/images/avatars/',_0xc402d1['systemAvatar']))){_0x2e18b5=path['join'](config[_0x25c1('0x87')],_0x25c1('0x90'),_0xc402d1[_0x25c1('0x85')]);}}return _0x230f47[_0x25c1('0x8e')](_0x2e18b5);}})[_0x25c1('0x24')](handleError(_0x230f47,null));};function checkWebsiteInterval(_0x13d48c){var _0x468312=_0x13d48c[_0x25c1('0x96')];if(!_0x468312){return Promise[_0x25c1('0x97')](_0x13d48c);}var _0x4a436d=_0x13d48c[_0x25c1('0x98')]||undefined;return _0x468312['ifTime'](_0x4a436d)['then'](function(_0x355e71){if(!_0x355e71){throw new APIOutOfIntervalError();}return _0x13d48c;});}exports[_0x25c1('0x99')]=function(_0x17d6dd,_0x762495){var _0x3a5e79={'body':_0x17d6dd['body'],'channel':_0x25c1('0x9a')};var _0x5ae7d3=[];var _0x3a9e3b=[];var _0x287f68={};var _0x1055b7=![];if(_0x17d6dd[_0x25c1('0x64')]['id']){delete _0x17d6dd['body']['id'];}if(_['isNil'](_0x17d6dd[_0x25c1('0x64')][_0x25c1('0x9b')])){throw new APIBadRequestError(_0x25c1('0x9c'));}if(_['isNil'](_0x17d6dd['body'][_0x25c1('0x9d')])){throw new APIBadRequestError(_0x25c1('0x9e'));}if(_['isEmpty'](_0x17d6dd[_0x25c1('0x64')][_0x25c1('0x64')])){throw new APIBadRequestError(_0x25c1('0x9f'));}var _0x33f8ee=_0x17d6dd[_0x25c1('0x64')][_0x25c1('0xa0')]&&_0x17d6dd[_0x25c1('0x64')][_0x25c1('0x3e')];return db[_0x25c1('0xa1')][_0x25c1('0x71')]()[_0x25c1('0x2e')](function(_0x3675c2){if(!_0x3675c2){throw new Error(_0x25c1('0xa2'));}_0x5ae7d3=Object[_0x25c1('0x4e')](_0x3675c2)['filter'](function(_0x38e111){return![_0x25c1('0xa3'),'updatedAt'][_0x25c1('0xa4')](_0x38e111);});_0x3a9e3b=Object['keys'](_0x3675c2)[_0x25c1('0x58')](function(_0x4370b2){return!['createdAt',_0x25c1('0xa5'),_0x25c1('0xa6'),_0x25c1('0xa7')][_0x25c1('0xa4')](_0x4370b2);});if(!_[_0x25c1('0xa4')](_0x3a9e3b,_0x17d6dd['body'][_0x25c1('0x9d')])){throw new APIBadRequestError(_0x25c1('0xa8')+_0x3a9e3b[_0x25c1('0x8c')](',\x20'));}_0x287f68[_0x17d6dd[_0x25c1('0x64')]['mapKey']]=_0x17d6dd[_0x25c1('0x64')][_0x25c1('0x9b')];})[_0x25c1('0x2e')](function(){return db['ChatWebsite'][_0x25c1('0x6f')]({'where':{'id':_0x17d6dd[_0x25c1('0x60')]['id']},'include':[{'model':db[_0x25c1('0xa9')],'as':_0x25c1('0xaa'),'include':[{'model':db[_0x25c1('0xa1')],'as':_0x25c1('0xab'),'where':_0x287f68,'limit':0x1,'order':[[_0x25c1('0xa5'),_0x25c1('0xac')]]}]},{'model':db['ChatApplication'],'as':'Applications'},{'model':db['Interval'],'as':_0x25c1('0x96'),'include':[{'model':db[_0x25c1('0x96')],'as':_0x25c1('0xad'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x25c1('0x2e')](function(_0x9069a2){if(!_0x9069a2){throw new APINotFoundError(util[_0x25c1('0xae')](_0x25c1('0xaf'),_0x17d6dd[_0x25c1('0x60')]['id']));}if(_0x33f8ee){return checkWebsiteInterval(_0x9069a2);}return _0x9069a2;})[_0x25c1('0x2e')](function(_0x764652){_0x3a5e79['account']=_0x764652;_0x3a5e79[_0x25c1('0xb0')]=_[_0x25c1('0xb1')](_0x764652['Applications'],[_0x25c1('0xb2')],[_0x25c1('0xb3')]);if(_0x3a5e79[_0x25c1('0xb4')][_0x25c1('0xb5')]){delete _0x3a5e79[_0x25c1('0xb4')][_0x25c1('0xb5')];}_0x3a5e79[_0x25c1('0xb6')]=_0x764652[_0x25c1('0xaa')]||{'id':_0x764652[_0x25c1('0xa7')]};if(_0x3a5e79[_0x25c1('0xb6')]&&_0x3a5e79[_0x25c1('0xb6')][_0x25c1('0xab')][_0x25c1('0x52')]){return _0x3a5e79[_0x25c1('0xb6')][_0x25c1('0xab')][0x0];}var _0x5d8f18=_['defaults'](_0x17d6dd[_0x25c1('0x64')],{'firstName':_0x17d6dd[_0x25c1('0x64')]['from'],'ListId':_0x764652[_0x25c1('0xa7')]});_0x5d8f18[_0x17d6dd[_0x25c1('0x64')][_0x25c1('0x9d')]]=_0x17d6dd['body'][_0x25c1('0x9b')];return db[_0x25c1('0xa1')][_0x25c1('0x63')](_0x5d8f18,{'fields':_0x5ae7d3,'raw':!![]});})[_0x25c1('0x2e')](function(_0x1a0354){_0x3a5e79['contact']=_0x1a0354;var _0x2e6dfd=createInteractionObject(_0x17d6dd[_0x25c1('0x60')]['id'],_0x17d6dd[_0x25c1('0x64')],_0x17d6dd[_0x25c1('0xb7')],_0x1a0354);var _0x4fa88e={'ChatWebsiteId':_0x17d6dd['params']['id']};if(_0x17d6dd['body']['threadId']){_0x4fa88e[_0x25c1('0xb8')]=_0x17d6dd['body'][_0x25c1('0xb8')];_0x4fa88e['closed']=![];return db[_0x25c1('0xb9')][_0x25c1('0x6f')]({'where':_0x4fa88e})[_0x25c1('0x2e')](function(_0x12a17f){var _0x2c2395=_0x17d6dd[_0x25c1('0x64')][_0x25c1('0xa0')]&&_0x17d6dd['body']['referer'];if(_0x12a17f){_0x1055b7=!![];return _0x12a17f;}else if(!_0x2c2395&&_0x12a17f&&_0x12a17f[_0x25c1('0xba')]){throw new APIConflictError(_0x25c1('0xbb'));}_0x2e6dfd[_0x25c1('0xb8')]=_0x17d6dd[_0x25c1('0x64')][_0x25c1('0xb8')];_0x2e6dfd['externalUrl']=_0x17d6dd['body'][_0x25c1('0xbc')];return db[_0x25c1('0xb9')][_0x25c1('0x63')](_0x2e6dfd);});}_0x4fa88e[_0x25c1('0xbd')]=_0x1a0354['id'];if(_0x17d6dd[_0x25c1('0x64')][_0x25c1('0xbe')]&&_0x17d6dd[_0x25c1('0x64')][_0x25c1('0xbe')]['id']){_0x4fa88e['id']=_0x17d6dd[_0x25c1('0x64')][_0x25c1('0xbe')]['id'];return db[_0x25c1('0xb9')][_0x25c1('0x6f')]({'where':_0x4fa88e})['then'](function(_0x396ed5){var _0x30e70a=_0x17d6dd['body'][_0x25c1('0xa0')]&&_0x17d6dd[_0x25c1('0x64')][_0x25c1('0x3e')];if(!_0x30e70a&&_0x396ed5&&_0x396ed5[_0x25c1('0xba')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x396ed5){_0x1055b7=!![];return _0x396ed5;}else{return db[_0x25c1('0xb9')]['create'](_0x2e6dfd);}});}return db['ChatInteraction'][_0x25c1('0x63')](_0x2e6dfd);})[_0x25c1('0x2e')](function(_0x567ea4){if(!_0x1055b7){return _0x567ea4;}var _0x569b69={'from':(_0x3a5e79[_0x25c1('0xbf')][_0x25c1('0x3c')]||'')+'\x20'+(_0x3a5e79[_0x25c1('0xbf')][_0x25c1('0xc0')]||'')};if(_0x17d6dd[_0x25c1('0x64')]['threadId']&&_0x17d6dd[_0x25c1('0x64')][_0x25c1('0xc1')]&&_0x17d6dd['body']['threadId']!=_0x17d6dd[_0x25c1('0x64')][_0x25c1('0xc1')]){_0x569b69[_0x25c1('0xb8')]=_0x17d6dd[_0x25c1('0x64')][_0x25c1('0xc1')];}return _0x567ea4[_0x25c1('0x6d')](_0x569b69);})[_0x25c1('0x2e')](function(_0x573382){_0x3a5e79[_0x25c1('0xbe')]=_0x573382[_0x25c1('0x30')]({'plain':!![]});_0x3a5e79[_0x25c1('0xbe')][_0x25c1('0xc2')]=!_0x1055b7;if(_0x3a5e79[_0x25c1('0xbe')][_0x25c1('0xc2')]){if(_0x3a5e79[_0x25c1('0xb4')][_0x25c1('0xc3')]){_0x3a5e79[_0x25c1('0xb0')][_0x25c1('0xc4')]({'id':0x0,'priority':_0x3a5e79[_0x25c1('0xb0')][_0x25c1('0x52')]+0x1,'app':_0x25c1('0xc5'),'appdata':_0x25c1('0xc6'),'interval':_0x25c1('0xc7')});}}return db[_0x25c1('0xc8')][_0x25c1('0x63')]({'body':_0x17d6dd[_0x25c1('0x64')]['body'],'ChatWebsiteId':_0x17d6dd[_0x25c1('0x60')]['id'],'ChatInteractionId':_0x573382['id'],'direction':'in','ContactId':_0x3a5e79['contact']['id'],'AttachmentId':_0x17d6dd[_0x25c1('0x64')]['AttachmentId']});})['then'](function(_0x56d4ca){_0x3a5e79['message']=_0x56d4ca;if(!_0x3a5e79[_0x25c1('0xbe')][_0x25c1('0xc9')]){return;}return db[_0x25c1('0xca')]['find']({'attributes':['id','name'],'where':{'id':_0x3a5e79[_0x25c1('0xbe')][_0x25c1('0xc9')]}});})['then'](function(_0x29d6f7){if(_0x29d6f7){_0x3a5e79[_0x25c1('0xb0')][_0x25c1('0xcb')]({'id':0x0,'priority':0x0,'app':_0x25c1('0xcc'),'appdata':_0x29d6f7[_0x25c1('0x33')]+','+(_0x3a5e79[_0x25c1('0xb4')][_0x25c1('0xcd')]||0xa),'interval':_0x25c1('0xc7')});_0x3a5e79['forcedOwnership']=!![];}if(!_0x3a5e79[_0x25c1('0xbe')][_0x25c1('0xce')]){return;}return db['ChatQueue']['find']({'attributes':['id','name'],'where':{'id':_0x3a5e79[_0x25c1('0xbe')][_0x25c1('0xce')]}});})[_0x25c1('0x2e')](function(_0x1d8202){if(_0x1d8202){_0x3a5e79[_0x25c1('0xb0')]['unshift']({'id':0x0,'priority':0x1,'app':_0x25c1('0xcf'),'appdata':_0x1d8202[_0x25c1('0x33')]+','+(_0x3a5e79['account'][_0x25c1('0xd0')]||0x12c),'interval':_0x25c1('0xc7')});}return respondWithRpcPromise(_0x25c1('0xd1'),_0x25c1('0xd2'),_0x3a5e79);})[_0x25c1('0x2e')](function(_0x4bf7b2){respondWithRpcPromise(_0x25c1('0xd3'),_0x25c1('0xd3'),{'event':_0x25c1('0x99'),'message':_0x4bf7b2},client9002);return _0x4bf7b2;})[_0x25c1('0x2e')](respondWithResult(_0x762495,null))[_0x25c1('0x24')](APIHandleError(_0x762495));};exports[_0x25c1('0xd4')]=function(_0x10a363,_0x271769){var _0x4642e2,_0x56ed52,_0x116fc4;var _0x485b8e=[];var _0x2b5af0={};var _0x4f0eca=_0x10a363[_0x25c1('0xd5')]||[];var _0x3a5a6e=[];var _0xcb437e;return db[_0x25c1('0xa1')][_0x25c1('0x71')]()[_0x25c1('0x2e')](function(_0x255cc4){if(!_0x255cc4){throw new db['Sequelize']['ValidationError'](_0x25c1('0xd6'));}_0x485b8e=_[_0x25c1('0xd7')](_[_0x25c1('0x4e')](_0x255cc4),['createdAt',_0x25c1('0xa5'),_0x25c1('0xa6'),'ListId']);if(_0x10a363[_0x25c1('0x64')]['id']){delete _0x10a363[_0x25c1('0x64')]['id'];}if(_[_0x25c1('0x8b')](_0x10a363[_0x25c1('0x64')][_0x25c1('0x9b')])){throw _0x271769[_0x25c1('0x26')](0x1f4)['send'](new db[(_0x25c1('0xd8'))][(_0x25c1('0xd9'))](_0x25c1('0xda')));}if(_[_0x25c1('0x8b')](_0x10a363[_0x25c1('0x64')][_0x25c1('0x64')])||_0x10a363[_0x25c1('0x64')][_0x25c1('0x64')]===''){throw _0x271769[_0x25c1('0x26')](0x1f4)[_0x25c1('0x34')](new db[(_0x25c1('0xd8'))][(_0x25c1('0xd9'))](_0x25c1('0xdb')));}if(_[_0x25c1('0x8b')](_0x10a363[_0x25c1('0x64')][_0x25c1('0xdc')])){throw _0x271769[_0x25c1('0x26')](0x1f4)[_0x25c1('0x34')](new db[(_0x25c1('0xd8'))][(_0x25c1('0xd9'))](_0x25c1('0xdd')+_0x485b8e));}if(!_[_0x25c1('0xa4')](_0x485b8e,_0x10a363['body'][_0x25c1('0xdc')])){throw _0x271769['status'](0x1f4)['send'](new db[(_0x25c1('0xd8'))][(_0x25c1('0xd9'))](_0x25c1('0xde')+_0x485b8e));}_0x2b5af0[_0x10a363[_0x25c1('0x64')]['mapKeyOffline']]=_0x10a363[_0x25c1('0x64')][_0x25c1('0x9b')];})[_0x25c1('0x2e')](function(){return db[_0x25c1('0x4a')][_0x25c1('0x6f')]({'where':{'id':_0x10a363[_0x25c1('0x60')]['id']},'include':[{'model':db[_0x25c1('0xa9')],'as':_0x25c1('0xaa')},{'model':db[_0x25c1('0xdf')],'as':_0x25c1('0xdf')}]});})[_0x25c1('0x2e')](handleEntityNotFound(_0x271769,null))[_0x25c1('0x2e')](function(_0x2df80b){if(_0x2df80b&&_0x2df80b[_0x25c1('0xaa')]){_0x56ed52=_0x2df80b;var _0x4bda5a=_['defaults'](_0x10a363['body'],{'firstName':_0x10a363[_0x25c1('0x64')][_0x25c1('0x9b')],'phone':_0x10a363['body'][_0x25c1('0x9b')],'ListId':_0x2df80b[_0x25c1('0xa7')]});_0x4bda5a[_0x10a363[_0x25c1('0x64')][_0x25c1('0xdc')]]=_0x10a363[_0x25c1('0x64')]['from'];return db[_0x25c1('0xa1')][_0x25c1('0xe0')]({'where':_0x2b5af0,'defaults':_0x4bda5a});}})[_0x25c1('0xe1')](function(_0x3e1cda){if(_0x3e1cda){_0x116fc4=_0x3e1cda;var _0x4c5ccd=fs[_0x25c1('0xe2')](path[_0x25c1('0x8c')](config[_0x25c1('0x87')],_0x25c1('0xe3')),_0x25c1('0xe4'));var _0x2b4f5c=ejs[_0x25c1('0xe5')](_0x4c5ccd,{'body':_[_0x25c1('0xe6')](_0x10a363[_0x25c1('0x64')][_0x25c1('0x64')]),'bodyTitle':_0x56ed52[_0x25c1('0xe7')]});return db['ChatOfflineMessage'][_0x25c1('0x63')]({'body':_0x2b4f5c,'plainBody':htmlToText['fromString'](_0x2b4f5c),'ContactId':_0x3e1cda['id'],'ChatWebsiteId':_0x56ed52['id']});}})[_0x25c1('0x2e')](function(_0x1895c0){_0xcb437e=_0x1895c0;if(_0x4f0eca[_0x25c1('0x52')]){var _0x31fc7f=_0x4f0eca[_0x25c1('0x49')](function(_0x490a5a){return{'name':_0x490a5a[_0x25c1('0xe8')],'basename':_0x490a5a[_0x25c1('0x80')],'type':_0x490a5a['mimetype'],'ChatOfflineMessageId':_0x1895c0['id']};});_0x3a5a6e=_0x31fc7f[_0x25c1('0x49')](_0x794186=>{var _0x369eae={'filename':_0x794186[_0x25c1('0x33')],'path':path[_0x25c1('0x8c')](config[_0x25c1('0x87')],_0x25c1('0xe9'),_0x25c1('0xd5'),_0x25c1('0xea'),_0x25c1('0xeb'),_0x794186[_0x25c1('0xec')])};return _0x369eae;});if(!_0x56ed52[_0x25c1('0xed')]){return db[_0x25c1('0xee')][_0x25c1('0xef')](function(_0x4c09c0){return db[_0x25c1('0xf0')][_0x25c1('0xf1')](_0x31fc7f,{'transaction':_0x4c09c0});});}}})['then'](function(){if(_0xcb437e){_0x4642e2=_0xcb437e;return db[_0x25c1('0xdf')][_0x25c1('0x76')]({'where':{'service':!![]},'include':[{'model':db[_0x25c1('0xf2')],'as':_0x25c1('0xf3'),'raw':!![],'include':[{'model':db[_0x25c1('0xf4')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x25c1('0x2e')](function(_0x50a1a4){if(_0x50a1a4&&_0x50a1a4['Smtp']&&_0x56ed52[_0x25c1('0xf5')]&&_0x56ed52['forwardOfflineAddress']){var _0xba0af6=_0x50a1a4[_0x25c1('0xf6')]();return respondWithRpcPromise('SendMail',_0x25c1('0xf7'),{'account':_0xba0af6,'message':{'from':util[_0x25c1('0xae')]('\x22%s\x22\x20<%s>',_0x50a1a4[_0x25c1('0x33')],_0x50a1a4[_0x25c1('0xf8')]||_0x50a1a4[_0x25c1('0xf3')][_0x25c1('0xf9')]),'to':_0x56ed52['forwardOfflineAddress'],'subject':_0x56ed52[_0x25c1('0xfa')],'html':_0x4642e2[_0x25c1('0x64')],'attachments':_0x3a5a6e}},client9003)[_0x25c1('0x2e')](function(){return _0x4642e2;})[_0x25c1('0x24')](function(_0x1477c8){logger[_0x25c1('0x1f')](_0x1477c8);});}})[_0x25c1('0x2e')](function(){if(_0x56ed52&&_0x56ed52[_0x25c1('0xed')]&&_0x56ed52['MailAccountId']){var _0x5184d1=[];if(_0x4f0eca[_0x25c1('0x52')]){_0x5184d1=_0x4f0eca[_0x25c1('0x49')](function(_0x2fc71c){return{'name':_0x2fc71c[_0x25c1('0xe8')],'basename':_0x2fc71c[_0x25c1('0x80')],'type':_0x2fc71c[_0x25c1('0xfb')],'ChatOfflineMessageId':_0xcb437e['id']};});}var _0x27835b;if(!_[_0x25c1('0x8b')](_0x56ed52[_0x25c1('0xfc')])){var _0x12cc47=_['map'](_0x10a363['body'],function(_0x2b87d2){return _0x2b87d2;});var _0x507407=_[_0x25c1('0xfd')](_0x12cc47)[0x0];var _0x46f4a3=_[_0x25c1('0xfe')](_0x507407,function(_0x52a22e){return _0x52a22e;});_0x27835b=_0x46f4a3[0x1][_0x56ed52[_0x25c1('0xfc')]];}var _0x35b5c8={'from':_0x116fc4['email'],'firstName':_0x116fc4[_0x25c1('0x3c')],'lastName':_0x116fc4['lastName'],'mapKey':_0x25c1('0xf8'),'message':{'from':_0x116fc4[_0x25c1('0xf8')],'to':_0x56ed52[_0x25c1('0xdf')][_0x25c1('0xf8')],'cc':'','subject':_[_0x25c1('0x8b')](_0x27835b)?_0x56ed52[_0x25c1('0xfa')]:_0x27835b,'messageId':'','sentAt':new Date(),'attach':_0x5184d1['length'],'attachments':_0x5184d1,'originChannel':_0x25c1('0xff'),'ChatWebsiteId':_0x56ed52['id'],'ChatOfflineMessageId':_0x4642e2['id'],'originTo':_0x56ed52[_0x25c1('0xdf')]['email']},'body':_0x4642e2[_0x25c1('0x64')]};var _0x291897={'account':{'id':_0x56ed52['MailAccountId']},'body':_0x35b5c8,'log':_0x25c1('0x100')};return respondWithRpcPromise('NotifyMailAccount',_0x25c1('0x101'),_0x291897,client9001)[_0x25c1('0x2e')](function(){return _0x4642e2;})[_0x25c1('0x24')](function(_0xaa68f5){logger['error'](_0xaa68f5);});}return;})['then'](function(){if(_0x4642e2){return _0x4642e2;}})['then'](respondWithResult(_0x271769,null))['catch'](function(){for(var _0x1f978d of _0x4f0eca){var _0x3a5243=path[_0x25c1('0x8c')](config[_0x25c1('0x87')],'server',_0x25c1('0xd5'),_0x25c1('0xea'),_0x25c1('0xeb'),_0x1f978d[_0x25c1('0x80')]);fs_extra[_0x25c1('0x102')](_0x3a5243)[_0x25c1('0x24')](function(_0x7b4c19){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x3a5243,_0x7b4c19);});}});};exports['addInteraction']=function(_0x4b8da9,_0x39b8f9){return db['ChatInteraction'][_0x25c1('0x6f')]({'where':{'id':_0x4b8da9[_0x25c1('0x60')]['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x39b8f9,null))['then'](function(_0x2b0a1e){if(_0x2b0a1e){return _0x2b0a1e[_0x25c1('0x103')](_0x4b8da9['body'][_0x25c1('0x7c')],_[_0x25c1('0x104')](_0x4b8da9['body'],[_0x25c1('0x7c'),'id'])||{});}})['then'](respondWithResult(_0x39b8f9,null))[_0x25c1('0x24')](handleError(_0x39b8f9,null));};exports[_0x25c1('0x105')]=function(_0x343078,_0x50dc41){var _0x35b676={'raw':![],'where':{}};var _0x49fbe9={};var _0x33d84b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x25c1('0x76')]({'where':{'id':_0x343078[_0x25c1('0x60')]['id']}})['then'](handleEntityNotFound(_0x50dc41,null))[_0x25c1('0x2e')](function(_0x44041f){if(_0x44041f){_0x49fbe9[_0x25c1('0x42')]=_[_0x25c1('0x4e')](db[_0x25c1('0xb9')][_0x25c1('0x61')]);_0x49fbe9[_0x25c1('0x4d')]=_['keys'](_0x343078[_0x25c1('0x4d')]);_0x49fbe9[_0x25c1('0x56')]=_[_0x25c1('0x4f')](_0x49fbe9[_0x25c1('0x42')],_0x49fbe9[_0x25c1('0x4d')]);_0x35b676['attributes']=_[_0x25c1('0x4f')](_0x49fbe9['model'],qs[_0x25c1('0x51')](_0x343078[_0x25c1('0x4d')][_0x25c1('0x51')]));_0x35b676[_0x25c1('0x50')]=_0x35b676[_0x25c1('0x50')][_0x25c1('0x52')]?_0x35b676['attributes']:_0x49fbe9[_0x25c1('0x42')];if(!_0x343078[_0x25c1('0x4d')][_0x25c1('0x106')](_0x25c1('0x53'))){_0x35b676[_0x25c1('0x2a')]=qs[_0x25c1('0x2a')](_0x343078[_0x25c1('0x4d')]['limit']);_0x35b676[_0x25c1('0x29')]=qs['offset'](_0x343078[_0x25c1('0x4d')][_0x25c1('0x29')]);}_0x35b676['order']=qs[_0x25c1('0x54')](_0x343078[_0x25c1('0x4d')]['sort']);_0x35b676[_0x25c1('0x55')]=qs[_0x25c1('0x56')](_['pick'](_0x343078[_0x25c1('0x4d')],_0x49fbe9[_0x25c1('0x56')]));_0x35b676['where'][_0x25c1('0x73')]=_0x44041f['id'];if(_0x343078[_0x25c1('0x4d')][_0x25c1('0x58')]){_0x35b676[_0x25c1('0x55')]=_[_0x25c1('0x59')](_0x35b676[_0x25c1('0x55')],{'$or':_[_0x25c1('0x49')](_0x35b676[_0x25c1('0x50')],function(_0x1547ac){var _0x15fc82={};_0x15fc82[_0x1547ac]={'$like':'%'+_0x343078[_0x25c1('0x4d')][_0x25c1('0x58')]+'%'};return _0x15fc82;})});}_0x35b676=_[_0x25c1('0x59')]({},_0x35b676,_0x343078[_0x25c1('0x5b')]);return db[_0x25c1('0xb9')]['count']({'where':_0x35b676[_0x25c1('0x55')]})[_0x25c1('0x2e')](function(_0x4ad924){_0x33d84b['count']=_0x4ad924;if(_0x343078['query'][_0x25c1('0x62')]){_0x35b676['include']=[{'model':db['CmContact'],'as':_0x25c1('0x107'),'required':![]},{'model':db[_0x25c1('0xca')],'as':'Owner','attributes':[_0x25c1('0x33'),_0x25c1('0x108'),_0x25c1('0x109')],'required':![]},{'model':db[_0x25c1('0x10a')],'as':_0x25c1('0x10b'),'attributes':['id',_0x25c1('0x33'),'color'],'where':_0x343078[_0x25c1('0x4d')][_0x25c1('0x10c')]?{'id':_0x343078[_0x25c1('0x4d')][_0x25c1('0x10c')]}:undefined,'required':_0x343078[_0x25c1('0x4d')][_0x25c1('0x10c')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x35b676);})['then'](function(_0x49f80c){_0x33d84b[_0x25c1('0x5e')]=_0x49f80c;return _0x33d84b;});}})['then'](respondWithFilteredResult(_0x50dc41,_0x35b676))['catch'](handleError(_0x50dc41,null));};exports[_0x25c1('0x10d')]=function(_0x2bb12a,_0x3c3585){var _0x4e7aa3=0x0;var _0x3c38ec=0x0;var _0x105c50=![];var _0x1ac4d3;var _0x21739f;return db[_0x25c1('0x4a')][_0x25c1('0x6f')]({'where':{'id':_0x2bb12a[_0x25c1('0x60')]['id']},'include':[{'model':db[_0x25c1('0x96')],'as':_0x25c1('0x96'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x25c1('0x10e')]}]}]})[_0x25c1('0x2e')](handleEntityNotFound(_0x3c3585,null))[_0x25c1('0x2e')](function(_0x552128){if(_0x552128){_0x1ac4d3=_0x552128;return _0x552128[_0x25c1('0x10f')]({'raw':!![]});}})[_0x25c1('0x2e')](function(_0x529e3d){if(_0x1ac4d3){if(_0x529e3d){_0x21739f=_0x529e3d;}}return require(_0x25c1('0x89'))[_0x25c1('0x110')]();})[_0x25c1('0x2e')](function(_0x3670f1){if(_0x3670f1){_0x3c38ec=_0x3670f1[_0x25c1('0x111')];_0x105c50=_0x3670f1[_0x25c1('0x8a')];}})[_0x25c1('0x2e')](function(){return db['ChatInteraction'][_0x25c1('0x2c')]({'where':{'closed':![]}});})[_0x25c1('0x2e')](function(_0x475d48){_0x4e7aa3=_0x475d48;if(_0x3c38ec&&_0x475d48>_0x3c38ec){return db['License'][_0x25c1('0x76')]({'where':{'id':0x1}})[_0x25c1('0x2e')](function(_0x1d1789){if(_0x1d1789){_0x1d1789[_0x25c1('0x112')](_0x25c1('0x113'));}});}})[_0x25c1('0x2e')](function(){var _0xbf3d09=_0x1ac4d3[_0x25c1('0x96')];var _0x45e89a=_0x1ac4d3[_0x25c1('0x98')]||undefined;return _0xbf3d09?_0xbf3d09[_0x25c1('0x114')](_0x45e89a):!![];})[_0x25c1('0x2e')](function(_0x2b7be1){var _0x38b295=fs[_0x25c1('0xe2')](path[_0x25c1('0x8c')](config[_0x25c1('0x87')],_0x25c1('0x115')),_0x25c1('0xe4'));var _0x347946=_0x25c1('0x116');var _0x3d3a22=![];var _0xdd2b64,_0x425131;if(_0x2bb12a[_0x25c1('0xb7')][_0x25c1('0x3e')]){_0xdd2b64=new URL(_0x2bb12a['headers']['referer'])[_0x25c1('0x117')];}else if(_0x2bb12a[_0x25c1('0xb7')][_0x25c1('0x117')]){_0xdd2b64=new URL(_0x2bb12a[_0x25c1('0xb7')]['origin'])[_0x25c1('0x117')];}else{_0xdd2b64=_0x25c1('0x118');}_0x425131=typeof _0x1ac4d3[_0x25c1('0x119')][_0x25c1('0x3b')](',')[_0x25c1('0x6f')](function(_0x4d3e9b){return wildcardUtils[_0x25c1('0x11a')](_0x4d3e9b,_0xdd2b64);})!=='undefined';var _0x137f7b={'chatVersion':_0x347946,'chatWebsiteAddressOrigin':_0x425131?_0xdd2b64:_0x1ac4d3[_0x25c1('0x119')],'remote':_0x1ac4d3[_0x25c1('0x11b')],'query':querystring[_0x25c1('0x46')](_[_0x25c1('0x59')](_0x1ac4d3[_0x25c1('0x30')]({'plain':!![]}),{'customerIp':_0x2bb12a[_0x25c1('0xb7')][_0x25c1('0x39')]||_0x2bb12a[_0x25c1('0xb7')][_0x25c1('0x11c')]||_0x2bb12a[_0x25c1('0x11d')][_0x25c1('0x11e')]||_0x2bb12a['ip'],'referer':_0x2bb12a[_0x25c1('0xb7')][_0x25c1('0x3e')],'openedInteractions':_0x4e7aa3,'maxInteractions':_0x3c38ec,'virtual':_0x105c50[_0x25c1('0x111')],'online':_0x2b7be1,'custom':_0x105c50,'address':_0x425131?_0xdd2b64:null}))['replace'](/'/g,'\x5c\x27')};_0x3c3585['send'](ejs[_0x25c1('0xe5')](Mustache[_0x25c1('0xe5')](_0x38b295,_0x137f7b),{'proactiveActions':_0x21739f,'alignment':_0x1ac4d3[_0x25c1('0x11f')],'verticalAlignment':_0x1ac4d3['verticalAlignment'],'div_color':_0x1ac4d3[_0x25c1('0x120')],'labelText':_0x1ac4d3[_0x25c1('0x121')],'text_color':_0x1ac4d3[_0x25c1('0x122')],'text_button_color':_0x1ac4d3[_0x25c1('0x123')],'button_color':_0x1ac4d3[_0x25c1('0x124')],'background_color':_0x1ac4d3['backgroundColor'],'hideWhenOffline':_0x1ac4d3[_0x25c1('0x125')],'intervalId':_0x1ac4d3[_0x25c1('0x126')],'isDevelopment':_0x3d3a22,'chatVersion':_0x347946}));})[_0x25c1('0x24')](handleError(_0x3c3585,null));};exports[_0x25c1('0x127')]=function(_0x24c0e1,_0x3cb379){var _0x1b9df7=_0x24c0e1[_0x25c1('0x60')]['id'];var _0x2e788d=_0x24c0e1['body'];var _0x19371f=0xc8;var _0x60c433=null;return db[_0x25c1('0xee')][_0x25c1('0xef')]({'isolationLevel':db['sequelize'][_0x25c1('0x128')][_0x25c1('0x129')]['READ_COMMITTED']},function(_0x3f8ccf){return db[_0x25c1('0x4a')][_0x25c1('0x76')]({'where':{'id':_0x1b9df7},'transaction':_0x3f8ccf})[_0x25c1('0x2e')](function(_0x1b9807){if(_0x1b9807){return db[_0x25c1('0x12a')][_0x25c1('0x2f')]({'where':{'ChatWebsiteId':_0x1b9df7},'transaction':_0x3f8ccf})[_0x25c1('0x2e')](function(){var _0x3011a3=_['map'](_0x2e788d,function(_0x3cee4c){_0x3cee4c[_0x25c1('0x73')]=_0x1b9df7;return _0x3cee4c;});return db[_0x25c1('0x12a')][_0x25c1('0xf1')](_0x3011a3,{'transaction':_0x3f8ccf});});}else{_0x19371f=0x194;_0x60c433=[];}});})[_0x25c1('0x2e')](function(){if(_0x19371f!==0x194){return db[_0x25c1('0x12a')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x1b9df7},'order':'priority'})[_0x25c1('0x2e')](function(_0x5158c6){_0x60c433=_0x5158c6;});}})[_0x25c1('0x24')](function(_0xfecf83){_0x19371f=0x1f4;logger['error'](_0xfecf83['stack']);if(_0xfecf83[_0x25c1('0x33')]){delete _0xfecf83['name'];}_0x60c433=_0xfecf83;})[_0x25c1('0x12b')](function(){if(_0x60c433===null){_0x3cb379[_0x25c1('0x25')](_0x19371f);}else{if(_0x19371f===0x1f4){_0x3cb379['status'](_0x19371f)[_0x25c1('0x34')](_0x60c433);}else{_0x3cb379[_0x25c1('0x26')](_0x19371f)[_0x25c1('0x28')](_0x60c433);}}});};exports[_0x25c1('0x12c')]=function(_0x12e92f,_0x5c619c){var _0x1bb98d={};var _0x3beb87={};var _0x159849;var _0x336d03;return db['ChatWebsite'][_0x25c1('0x76')]({'where':{'id':_0x12e92f[_0x25c1('0x60')]['id']}})['then'](handleEntityNotFound(_0x5c619c,null))['then'](function(_0x3e97d4){if(_0x3e97d4){_0x159849=_0x3e97d4;_0x3beb87[_0x25c1('0x42')]=_['keys'](db[_0x25c1('0x12a')][_0x25c1('0x61')]);_0x3beb87[_0x25c1('0x4d')]=_['keys'](_0x12e92f[_0x25c1('0x4d')]);_0x3beb87[_0x25c1('0x56')]=_[_0x25c1('0x4f')](_0x3beb87[_0x25c1('0x42')],_0x3beb87['query']);_0x1bb98d[_0x25c1('0x50')]=_[_0x25c1('0x4f')](_0x3beb87['model'],qs[_0x25c1('0x51')](_0x12e92f[_0x25c1('0x4d')][_0x25c1('0x51')]));_0x1bb98d[_0x25c1('0x50')]=_0x1bb98d[_0x25c1('0x50')][_0x25c1('0x52')]?_0x1bb98d[_0x25c1('0x50')]:_0x3beb87['model'];_0x1bb98d['order']=qs[_0x25c1('0x54')](_0x12e92f[_0x25c1('0x4d')][_0x25c1('0x54')]);_0x1bb98d[_0x25c1('0x55')]=qs[_0x25c1('0x56')](_[_0x25c1('0x57')](_0x12e92f[_0x25c1('0x4d')],_0x3beb87[_0x25c1('0x56')]));if(_0x12e92f[_0x25c1('0x4d')][_0x25c1('0x58')]){_0x1bb98d[_0x25c1('0x55')]=_[_0x25c1('0x59')](_0x1bb98d[_0x25c1('0x55')],{'$or':_['map'](_0x1bb98d[_0x25c1('0x50')],function(_0xd47cf6){var _0x1bc04a={};_0x1bc04a[_0xd47cf6]={'$like':'%'+_0x12e92f[_0x25c1('0x4d')][_0x25c1('0x58')]+'%'};return _0x1bc04a;})});}_0x1bb98d=_['merge']({},_0x1bb98d,_0x12e92f[_0x25c1('0x5b')]);return _0x159849['getApplications'](_0x1bb98d);}})[_0x25c1('0x2e')](function(_0x48b0da){if(_0x48b0da){_0x336d03=_0x48b0da[_0x25c1('0x52')];if(!_0x12e92f['query'][_0x25c1('0x106')]('nolimit')){_0x1bb98d[_0x25c1('0x2a')]=qs['limit'](_0x12e92f[_0x25c1('0x4d')]['limit']);_0x1bb98d[_0x25c1('0x29')]=qs[_0x25c1('0x29')](_0x12e92f[_0x25c1('0x4d')][_0x25c1('0x29')]);}return _0x159849[_0x25c1('0x12c')](_0x1bb98d);}})[_0x25c1('0x2e')](function(_0x7d40d){if(_0x7d40d){return _0x7d40d?{'count':_0x336d03,'rows':_0x7d40d}:null;}})[_0x25c1('0x2e')](respondWithResult(_0x5c619c,null))[_0x25c1('0x24')](handleError(_0x5c619c,null));};exports['addProactiveActions']=function(_0x4c051b,_0x438d00){return db[_0x25c1('0x12d')][_0x25c1('0x6f')]({'where':{'id':_0x4c051b[_0x25c1('0x60')]['id']}})['then'](handleEntityNotFound(_0x438d00,null))[_0x25c1('0x2e')](function(_0x7cca8a){if(_0x7cca8a){return _0x7cca8a['addProactiveActions'](_0x4c051b[_0x25c1('0x64')][_0x25c1('0x7c')],_[_0x25c1('0x104')](_0x4c051b[_0x25c1('0x64')],[_0x25c1('0x7c'),'id'])||{});}})[_0x25c1('0x2e')](respondWithResult(_0x438d00,null))[_0x25c1('0x24')](handleError(_0x438d00,null));};exports[_0x25c1('0x10f')]=function(_0x1bfd85,_0x4f5b1d){var _0x25a834={};var _0x2bd187={};var _0x449871;var _0x508a31;return db[_0x25c1('0x4a')][_0x25c1('0x76')]({'where':{'id':_0x1bfd85['params']['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x4f5b1d,null))[_0x25c1('0x2e')](function(_0x2ea33b){if(_0x2ea33b){_0x449871=_0x2ea33b;_0x2bd187[_0x25c1('0x42')]=_['keys'](db['ChatProactiveAction'][_0x25c1('0x61')]);_0x2bd187[_0x25c1('0x4d')]=_[_0x25c1('0x4e')](_0x1bfd85[_0x25c1('0x4d')]);_0x2bd187[_0x25c1('0x56')]=_[_0x25c1('0x4f')](_0x2bd187[_0x25c1('0x42')],_0x2bd187[_0x25c1('0x4d')]);_0x25a834['attributes']=_['intersection'](_0x2bd187[_0x25c1('0x42')],qs['fields'](_0x1bfd85[_0x25c1('0x4d')][_0x25c1('0x51')]));_0x25a834['attributes']=_0x25a834[_0x25c1('0x50')][_0x25c1('0x52')]?_0x25a834[_0x25c1('0x50')]:_0x2bd187['model'];_0x25a834['order']=qs[_0x25c1('0x54')](_0x1bfd85[_0x25c1('0x4d')][_0x25c1('0x54')]);_0x25a834['where']=qs[_0x25c1('0x56')](_[_0x25c1('0x57')](_0x1bfd85[_0x25c1('0x4d')],_0x2bd187[_0x25c1('0x56')]));if(_0x1bfd85['query'][_0x25c1('0x58')]){_0x25a834['where']=_['merge'](_0x25a834[_0x25c1('0x55')],{'$or':_['map'](_0x25a834[_0x25c1('0x50')],function(_0x3d68d2){var _0x48e005={};_0x48e005[_0x3d68d2]={'$like':'%'+_0x1bfd85[_0x25c1('0x4d')]['filter']+'%'};return _0x48e005;})});}_0x25a834=_[_0x25c1('0x59')]({},_0x25a834,_0x1bfd85[_0x25c1('0x5b')]);return _0x449871['getProactiveActions'](_0x25a834);}})[_0x25c1('0x2e')](function(_0x4bd350){if(_0x4bd350){_0x508a31=_0x4bd350[_0x25c1('0x52')];if(!_0x1bfd85[_0x25c1('0x4d')][_0x25c1('0x106')](_0x25c1('0x53'))){_0x25a834['limit']=qs[_0x25c1('0x2a')](_0x1bfd85['query'][_0x25c1('0x2a')]);_0x25a834[_0x25c1('0x29')]=qs[_0x25c1('0x29')](_0x1bfd85[_0x25c1('0x4d')]['offset']);}return _0x449871['getProactiveActions'](_0x25a834);}})[_0x25c1('0x2e')](function(_0x675a30){if(_0x675a30){return _0x675a30?{'count':_0x508a31,'rows':_0x675a30}:null;}})[_0x25c1('0x2e')](respondWithResult(_0x4f5b1d,null))['catch'](handleError(_0x4f5b1d,null));};exports[_0x25c1('0x12e')]=function(_0x3c70f2,_0x12a251){var _0x25cca3=_0x3c70f2[_0x25c1('0x4d')][_0x25c1('0x12f')]===_0x25c1('0x130')?'offlineForm':'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x25cca3],'where':{'id':_0x3c70f2[_0x25c1('0x60')]['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x12a251,null))[_0x25c1('0x2e')](function(_0x326c5f){if(_0x326c5f){var _0xd4a070=_0x326c5f[_0x25cca3];var _0xc71cbe=_0xd4a070&&_0xd4a070[_0x25c1('0x131')]?_0xd4a070[_0x25c1('0x131')]:[];_0x12a251['send']({'fromKey':_['isNil'](_0xd4a070[_0x25c1('0x132')])?undefined:_0xd4a070[_0x25c1('0x132')],'count':_0xc71cbe[_0x25c1('0x52')],'rows':_0xc71cbe});}})[_0x25c1('0x24')](handleError(_0x12a251,null));};exports['getOfflineMessages']=function(_0x1fcb09,_0x639cf5){var _0x2f2258={'raw':![],'where':{}};var _0x4ac0d0={};var _0x4b029f={'count':0x0,'rows':[]};return db[_0x25c1('0x4a')][_0x25c1('0x76')]({'where':{'id':_0x1fcb09[_0x25c1('0x60')]['id']}})['then'](handleEntityNotFound(_0x639cf5,null))[_0x25c1('0x2e')](function(_0x45d76e){if(_0x45d76e){_0x4ac0d0[_0x25c1('0x42')]=_[_0x25c1('0x4e')](db[_0x25c1('0x133')][_0x25c1('0x61')]);_0x4ac0d0['query']=_[_0x25c1('0x4e')](_0x1fcb09[_0x25c1('0x4d')]);_0x4ac0d0[_0x25c1('0x56')]=_[_0x25c1('0x4f')](_0x4ac0d0['model'],_0x4ac0d0[_0x25c1('0x4d')]);_0x2f2258[_0x25c1('0x50')]=_[_0x25c1('0x4f')](_0x4ac0d0[_0x25c1('0x42')],qs[_0x25c1('0x51')](_0x1fcb09['query'][_0x25c1('0x51')]));_0x2f2258['attributes']=_0x2f2258[_0x25c1('0x50')][_0x25c1('0x52')]?_0x2f2258[_0x25c1('0x50')]:_0x4ac0d0[_0x25c1('0x42')];if(!_0x1fcb09[_0x25c1('0x4d')]['hasOwnProperty'](_0x25c1('0x53'))){_0x2f2258[_0x25c1('0x2a')]=qs[_0x25c1('0x2a')](_0x1fcb09[_0x25c1('0x4d')][_0x25c1('0x2a')]);_0x2f2258[_0x25c1('0x29')]=qs[_0x25c1('0x29')](_0x1fcb09['query'][_0x25c1('0x29')]);}_0x2f2258[_0x25c1('0x77')]=qs[_0x25c1('0x54')](_0x1fcb09[_0x25c1('0x4d')][_0x25c1('0x54')]);_0x2f2258[_0x25c1('0x55')]=qs[_0x25c1('0x56')](_[_0x25c1('0x57')](_0x1fcb09[_0x25c1('0x4d')],_0x4ac0d0[_0x25c1('0x56')]));_0x2f2258[_0x25c1('0x55')][_0x25c1('0x73')]=_0x45d76e['id'];if(_0x1fcb09['query'][_0x25c1('0x58')]){_0x2f2258[_0x25c1('0x55')]=_[_0x25c1('0x59')](_0x2f2258[_0x25c1('0x55')],{'$or':_[_0x25c1('0x49')](_0x2f2258[_0x25c1('0x50')],function(_0x1eda47){var _0x4a4c39={};_0x4a4c39[_0x1eda47]={'$like':'%'+_0x1fcb09[_0x25c1('0x4d')][_0x25c1('0x58')]+'%'};return _0x4a4c39;})});}_0x2f2258=_[_0x25c1('0x59')]({},_0x2f2258,_0x1fcb09[_0x25c1('0x5b')]);return db['ChatOfflineMessage'][_0x25c1('0x2c')]({'where':_0x2f2258[_0x25c1('0x55')]})[_0x25c1('0x2e')](function(_0x458089){_0x4b029f[_0x25c1('0x2c')]=_0x458089;if(_0x1fcb09[_0x25c1('0x4d')][_0x25c1('0x62')]){_0x2f2258['include']=[{'all':!![]}];}else{_0x2f2258[_0x25c1('0x5c')]=[{'model':db[_0x25c1('0xa1')],'as':_0x25c1('0x107'),'required':![]},{'model':db[_0x25c1('0xf0')],'as':_0x25c1('0x134'),'required':![]}];}return db[_0x25c1('0x133')][_0x25c1('0x5d')](_0x2f2258);})[_0x25c1('0x2e')](function(_0x226f36){_0x4b029f[_0x25c1('0x5e')]=_0x226f36;return _0x4b029f;});}})[_0x25c1('0x2e')](respondWithFilteredResult(_0x639cf5,_0x2f2258))[_0x25c1('0x24')](handleError(_0x639cf5,null));};exports[_0x25c1('0x135')]=function(_0x172f7b,_0x395c16){return db['ChatWebsite']['find']({'where':{'id':_0x172f7b[_0x25c1('0x60')]['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x395c16,null))['then'](function(_0x476493){if(_0x476493){return _0x476493[_0x25c1('0x135')](_0x172f7b[_0x25c1('0x64')][_0x25c1('0x7c')],_[_0x25c1('0x104')](_0x172f7b[_0x25c1('0x64')],[_0x25c1('0x7c'),'id'])||{})[_0x25c1('0xe1')](function(_0x29cff){for(var _0x497d81=0x0;_0x497d81<_0x172f7b[_0x25c1('0x64')][_0x25c1('0x7c')]['length'];_0x497d81+=0x1){socket['emit'](_0x25c1('0x136'),{'UserId':Number(_0x172f7b[_0x25c1('0x64')]['ids'][_0x497d81]),'ChatWebsiteId':Number(_0x172f7b[_0x25c1('0x60')]['id'])});}return _0x29cff;});}})[_0x25c1('0x2e')](respondWithResult(_0x395c16,null))[_0x25c1('0x24')](handleError(_0x395c16,null));};exports[_0x25c1('0x137')]=function(_0x2f0ba0,_0x2f585b){return db[_0x25c1('0x4a')][_0x25c1('0x6f')]({'where':{'id':_0x2f0ba0[_0x25c1('0x60')]['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x2f585b,null))['then'](function(_0x290d71){if(_0x290d71){return _0x290d71[_0x25c1('0x137')](_0x2f0ba0[_0x25c1('0x4d')]['ids'])[_0x25c1('0x2e')](function(){if(_[_0x25c1('0x138')](_0x2f0ba0[_0x25c1('0x4d')][_0x25c1('0x7c')])){for(var _0x5eec9e=0x0;_0x5eec9e<_0x2f0ba0[_0x25c1('0x4d')]['ids'][_0x25c1('0x52')];_0x5eec9e+=0x1){socket[_0x25c1('0x139')]('userChatWebsite:remove',{'UserId':Number(_0x2f0ba0[_0x25c1('0x4d')][_0x25c1('0x7c')][_0x5eec9e]),'ChatWebsiteId':Number(_0x2f0ba0['params']['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x2f0ba0[_0x25c1('0x4d')]['ids']),'ChatWebsiteId':Number(_0x2f0ba0[_0x25c1('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x2f585b,null))[_0x25c1('0x24')](handleError(_0x2f585b,null));};exports[_0x25c1('0x13a')]=function(_0x4c02da,_0x26ed1f){var _0x201581={};var _0x34fdf5={};var _0x2cdcb5;var _0x1f0cf6;return db[_0x25c1('0x4a')][_0x25c1('0x76')]({'where':{'id':_0x4c02da[_0x25c1('0x60')]['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x26ed1f,null))['then'](function(_0x370cb2){if(_0x370cb2){_0x2cdcb5=_0x370cb2;_0x34fdf5['model']=_['keys'](db['User']['rawAttributes']);_0x34fdf5[_0x25c1('0x4d')]=_[_0x25c1('0x4e')](_0x4c02da[_0x25c1('0x4d')]);_0x34fdf5[_0x25c1('0x56')]=_[_0x25c1('0x4f')](_0x34fdf5[_0x25c1('0x42')],_0x34fdf5[_0x25c1('0x4d')]);_0x201581['attributes']=_[_0x25c1('0x4f')](_0x34fdf5[_0x25c1('0x42')],qs[_0x25c1('0x51')](_0x4c02da[_0x25c1('0x4d')]['fields']));_0x201581[_0x25c1('0x50')]=_0x201581[_0x25c1('0x50')][_0x25c1('0x52')]?_0x201581[_0x25c1('0x50')]:_0x34fdf5[_0x25c1('0x42')];_0x201581['order']=qs['sort'](_0x4c02da[_0x25c1('0x4d')][_0x25c1('0x54')]);_0x201581['where']=qs[_0x25c1('0x56')](_[_0x25c1('0x57')](_0x4c02da[_0x25c1('0x4d')],_0x34fdf5[_0x25c1('0x56')]));if(_0x4c02da[_0x25c1('0x4d')]['filter']){_0x201581[_0x25c1('0x55')]=_[_0x25c1('0x59')](_0x201581['where'],{'$or':_[_0x25c1('0x49')](_0x201581[_0x25c1('0x50')],function(_0x198673){var _0x5c288e={};_0x5c288e[_0x198673]={'$like':'%'+_0x4c02da['query'][_0x25c1('0x58')]+'%'};return _0x5c288e;})});}_0x201581=_[_0x25c1('0x59')]({},_0x201581,_0x4c02da[_0x25c1('0x5b')]);return _0x2cdcb5[_0x25c1('0x13a')](_0x201581);}})[_0x25c1('0x2e')](function(_0xba65bb){if(_0xba65bb){_0x1f0cf6=_0xba65bb['length'];if(!_0x4c02da['query'][_0x25c1('0x106')](_0x25c1('0x53'))){_0x201581[_0x25c1('0x2a')]=qs[_0x25c1('0x2a')](_0x4c02da[_0x25c1('0x4d')]['limit']);_0x201581[_0x25c1('0x29')]=qs['offset'](_0x4c02da[_0x25c1('0x4d')][_0x25c1('0x29')]);}return _0x2cdcb5[_0x25c1('0x13a')](_0x201581);}})[_0x25c1('0x2e')](function(_0x32f3cb){if(_0x32f3cb){return _0x32f3cb?{'count':_0x1f0cf6,'rows':_0x32f3cb}:null;}})['then'](respondWithResult(_0x26ed1f,null))['catch'](handleError(_0x26ed1f,null));};
\ No newline at end of file
+var _0x4c4e=['color_button','backgroundColor','hideWhenOffline','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','omit','getProactiveActions','ChatProactiveAction','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','removeAgents','isArray','emit','getAgents','mustache','path','ejs','fs-extra','querystring','html-to-text','ioredis','../../components/parsers/qs','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','status','undefined','limit','count','offset','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','end','sendStatus','stack','name','send','user-agent-parser','setUA','user-agent','getResult','cf-connecting-ip','first','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','model','%s\x20%s\x20%s','vendor','type','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','intersection','body','split','forEach','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','testWildcardValidity','Pause','describe','addDisposition','Disposition','getDispositions','findOne','ChatWebsiteId','rows','removeDispositions','ids','addAnswer','CannedAnswer','nolimit','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','sitepic','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','resolve','ifTime','notify','chat','from','From\x20is\x20mandatory','isEmpty','customerIp','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','Interval','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','mapKey','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','ValidationError','no\x20available\x20attributes','difference','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','Tag','Tags','color','tag','findAll','getSnippet','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','origin','http://localhost:9000','address','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textButtonColor'];(function(_0x5201dc,_0x1824ac){var _0x1e3a33=function(_0xca6856){while(--_0xca6856){_0x5201dc['push'](_0x5201dc['shift']());}};_0x1e3a33(++_0x1824ac);}(_0x4c4e,0x152));var _0xe4c4=function(_0x4182ad,_0x80b112){_0x4182ad=_0x4182ad-0x0;var _0x3809d6=_0x4c4e[_0x4182ad];return _0x3809d6;};'use strict';var Mustache=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var ejs=require(_0xe4c4('0x2'));var fs=require('fs');var fs_extra=require(_0xe4c4('0x3'));var _=require('lodash');var querystring=require(_0xe4c4('0x4'));var htmlToText=require(_0xe4c4('0x5'));var Redis=require(_0xe4c4('0x6'));var jayson=require('jayson/promise');var qs=require(_0xe4c4('0x7'));var logger=require('../../config/logger')(_0xe4c4('0x8'));var config=require(_0xe4c4('0x9'));var APIBadRequestError=require(_0xe4c4('0xa'))[_0xe4c4('0xb')];var APINotFoundError=require(_0xe4c4('0xa'))[_0xe4c4('0xc')];var APIOutOfIntervalError=require(_0xe4c4('0xa'))[_0xe4c4('0xd')];var APIHandleError=require('../../errors/api')['handleError'];var APIConflictError=require(_0xe4c4('0xa'))[_0xe4c4('0xe')];var wildcardUtils=require(_0xe4c4('0xf'));var URL=require(_0xe4c4('0x10'))[_0xe4c4('0x11')];var db=require(_0xe4c4('0x12'))['db'];config['redis']=_[_0xe4c4('0x13')](config[_0xe4c4('0x14')],{'host':_0xe4c4('0x15'),'port':0x18eb});var socket=require(_0xe4c4('0x16'))(new Redis(config['redis']));require(_0xe4c4('0x17'))[_0xe4c4('0x18')](socket);var client=jayson['client'][_0xe4c4('0x19')]({'port':0x232c});var client9002=jayson[_0xe4c4('0x1a')]['http']({'port':0x232a});var client9003=jayson[_0xe4c4('0x1a')][_0xe4c4('0x19')]({'port':0x232b});var client9001=jayson['client'][_0xe4c4('0x19')]({'port':0x2329});function respondWithRpcPromise(_0x465c9b,_0x26ea05,_0x40a36e,_0x19e59b){return new Promise(function(_0x882be2,_0x1f637e){var _0x1038cb=_0x19e59b||client;return _0x1038cb[_0xe4c4('0x1b')](_0x465c9b,_0x40a36e)[_0xe4c4('0x1c')](function(_0x23b7e6){logger[_0xe4c4('0x1d')](_0xe4c4('0x1e'),_0x26ea05,_0xe4c4('0x1f'));logger[_0xe4c4('0x20')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x26ea05,_0xe4c4('0x1f'),JSON[_0xe4c4('0x21')](_0x23b7e6));if(_0x23b7e6[_0xe4c4('0x22')]){if(_0x23b7e6[_0xe4c4('0x22')]['code']===0x1f4){logger[_0xe4c4('0x22')](_0xe4c4('0x1e'),_0x26ea05,_0x23b7e6[_0xe4c4('0x22')][_0xe4c4('0x23')]);return _0x1f637e(_0x23b7e6[_0xe4c4('0x22')][_0xe4c4('0x23')]);}logger[_0xe4c4('0x22')](_0xe4c4('0x1e'),_0x26ea05,_0x23b7e6[_0xe4c4('0x22')][_0xe4c4('0x23')]);return _0x882be2(_0x23b7e6[_0xe4c4('0x22')][_0xe4c4('0x23')]);}else{logger[_0xe4c4('0x1d')](_0xe4c4('0x1e'),_0x26ea05,_0xe4c4('0x1f'));_0x882be2(_0x23b7e6['result']['message']);}})[_0xe4c4('0x24')](function(_0x4dc8cc){logger[_0xe4c4('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x26ea05,_0x4dc8cc);_0x1f637e(_0x4dc8cc);});});}function respondWithStatusCode(_0x3adfcb,_0x5efc4c){_0x5efc4c=_0x5efc4c||0xcc;return function(_0x34d667){if(_0x34d667){return _0x3adfcb['sendStatus'](_0x5efc4c);}return _0x3adfcb[_0xe4c4('0x25')](_0x5efc4c)['end']();};}function respondWithResult(_0x5a2adb,_0x4cea1f){_0x4cea1f=_0x4cea1f||0xc8;return function(_0x5d66ab){if(_0x5d66ab){return _0x5a2adb[_0xe4c4('0x25')](_0x4cea1f)['json'](_0x5d66ab);}};}function respondWithFilteredResult(_0x5b5ea5,_0xe2c1b4){return function(_0x11deab){if(_0x11deab){var _0x4bb911=typeof _0xe2c1b4['offset']===_0xe4c4('0x26')&&typeof _0xe2c1b4[_0xe4c4('0x27')]==='undefined';var _0x158432=_0x11deab[_0xe4c4('0x28')];var _0x3f60fc=_0x4bb911?0x0:_0xe2c1b4['offset'];var _0x5d49fd=_0x4bb911?_0x11deab[_0xe4c4('0x28')]:_0xe2c1b4[_0xe4c4('0x29')]+_0xe2c1b4[_0xe4c4('0x27')];var _0x237dd6;if(_0x5d49fd>=_0x158432){_0x5d49fd=_0x158432;_0x237dd6=0xc8;}else{_0x237dd6=0xce;}_0x5b5ea5['status'](_0x237dd6);return _0x5b5ea5['set'](_0xe4c4('0x2a'),_0x3f60fc+'-'+_0x5d49fd+'/'+_0x158432)[_0xe4c4('0x2b')](_0x11deab);}return null;};}function saveUpdates(_0x5d0ba5){return function(_0x3e18e1){if(_0x3e18e1){return _0x3e18e1[_0xe4c4('0x2c')](_0x5d0ba5)[_0xe4c4('0x1c')](function(_0x59b5d1){return _0x59b5d1;});}return null;};}function removeEntity(_0x137f40){return function(_0x5976bc){if(_0x5976bc){return _0x5976bc[_0xe4c4('0x2d')]()[_0xe4c4('0x1c')](function(){var _0x3bb6cf=_0x5976bc[_0xe4c4('0x2e')]({'plain':!![]});var _0x2bd5c1=_0xe4c4('0x2f');return db[_0xe4c4('0x30')][_0xe4c4('0x2d')]({'where':{'type':_0x2bd5c1,'resourceId':_0x3bb6cf['id']}})[_0xe4c4('0x1c')](function(){return _0x5976bc;});})[_0xe4c4('0x1c')](function(){_0x137f40[_0xe4c4('0x25')](0xcc)[_0xe4c4('0x31')]();});}};}function handleEntityNotFound(_0x5cc2a8){return function(_0x21fce3){if(!_0x21fce3){_0x5cc2a8[_0xe4c4('0x32')](0x194);}return _0x21fce3;};}function handleError(_0x3d598a,_0x518018){_0x518018=_0x518018||0x1f4;return function(_0xac6cb4){logger[_0xe4c4('0x22')](_0xac6cb4[_0xe4c4('0x33')]);if(_0xac6cb4['name']){delete _0xac6cb4[_0xe4c4('0x34')];}_0x3d598a[_0xe4c4('0x25')](_0x518018)[_0xe4c4('0x35')](_0xac6cb4);};}function createInteractionObject(_0x1de955,_0x413ec9,_0x10f243,_0x2f8a21){var _0x44f4eb=require(_0xe4c4('0x36'));var _0x8b5bf3=new _0x44f4eb();var _0x5bb519=_0x8b5bf3[_0xe4c4('0x37')](_0x10f243[_0xe4c4('0x38')])[_0xe4c4('0x39')]();var _0x3c16a5=_0x413ec9['customerIp'];if(_0x10f243[_0xe4c4('0x3a')]){_0x3c16a5=_0x10f243[_0xe4c4('0x3a')];}else if(_0x10f243['x-forwarded-for']){_0x3c16a5=_[_0xe4c4('0x3b')](_0x10f243[_0xe4c4('0x3c')]['split'](','));}return{'ContactId':_0x2f8a21['id'],'ChatWebsiteId':_0x1de955,'from':(_0x2f8a21[_0xe4c4('0x3d')]||'')+'\x20'+(_0x2f8a21[_0xe4c4('0x3e')]||''),'customerIp':_0x3c16a5,'customerPort':_0x10f243[_0xe4c4('0x3f')]?_0x10f243[_0xe4c4('0x3f')]:null,'referer':_0x413ec9[_0xe4c4('0x40')],'browserName':_0x5bb519[_0xe4c4('0x41')][_0xe4c4('0x34')]&&_0x5bb519[_0xe4c4('0x41')][_0xe4c4('0x42')]?util[_0xe4c4('0x43')](_0xe4c4('0x44'),_0x5bb519[_0xe4c4('0x41')]['name'],_0x5bb519[_0xe4c4('0x41')][_0xe4c4('0x42')]):_0xe4c4('0x45'),'browserVersion':_0x5bb519[_0xe4c4('0x41')][_0xe4c4('0x42')]||_0xe4c4('0x45'),'osName':util['format'](_0xe4c4('0x44'),_0x5bb519['os']['name'],_0x5bb519['os'][_0xe4c4('0x42')]),'osVersion':_0x5bb519['os'][_0xe4c4('0x42')],'deviceModel':_0x5bb519[_0xe4c4('0x46')][_0xe4c4('0x47')]&&_0x5bb519[_0xe4c4('0x46')]['vendor']?util['format'](_0xe4c4('0x48'),_0x5bb519[_0xe4c4('0x46')][_0xe4c4('0x47')],_0x5bb519['device'][_0xe4c4('0x49')],_0x5bb519[_0xe4c4('0x46')][_0xe4c4('0x4a')]):null,'deviceVendor':_0x5bb519[_0xe4c4('0x46')]['vendor'],'deviceType':_0x5bb519[_0xe4c4('0x46')][_0xe4c4('0x4a')],'formData':JSON[_0xe4c4('0x21')](_0x413ec9)};}exports[_0xe4c4('0x4b')]=function(_0x6bf1ee,_0x1e459e){var _0x1eda5e={'include':[{'model':db['Pause'],'as':_0xe4c4('0x4c')}]},_0x176712={},_0x3ee4db={'count':0x0,'rows':[]};var _0x5d9b27=_[_0xe4c4('0x4d')](db[_0xe4c4('0x4e')][_0xe4c4('0x4f')],function(_0x15e595){return{'name':_0x15e595[_0xe4c4('0x50')],'type':_0x15e595[_0xe4c4('0x4a')][_0xe4c4('0x51')]};});_0x176712[_0xe4c4('0x47')]=_[_0xe4c4('0x4d')](_0x5d9b27,_0xe4c4('0x34'));_0x176712[_0xe4c4('0x52')]=_[_0xe4c4('0x53')](_0x6bf1ee[_0xe4c4('0x52')]);_0x176712[_0xe4c4('0x54')]=_['intersection'](_0x176712['model'],_0x176712[_0xe4c4('0x52')]);_0x1eda5e[_0xe4c4('0x55')]=_['intersection'](_0x176712[_0xe4c4('0x47')],qs[_0xe4c4('0x56')](_0x6bf1ee[_0xe4c4('0x52')][_0xe4c4('0x56')]));_0x1eda5e[_0xe4c4('0x55')]=_0x1eda5e['attributes'][_0xe4c4('0x57')]?_0x1eda5e[_0xe4c4('0x55')]:_0x176712['model'];if(!_0x6bf1ee[_0xe4c4('0x52')][_0xe4c4('0x58')]('nolimit')){_0x1eda5e[_0xe4c4('0x27')]=qs['limit'](_0x6bf1ee[_0xe4c4('0x52')][_0xe4c4('0x27')]);_0x1eda5e[_0xe4c4('0x29')]=qs[_0xe4c4('0x29')](_0x6bf1ee[_0xe4c4('0x52')]['offset']);}_0x1eda5e[_0xe4c4('0x59')]=qs[_0xe4c4('0x5a')](_0x6bf1ee[_0xe4c4('0x52')][_0xe4c4('0x5a')]);_0x1eda5e[_0xe4c4('0x5b')]=qs[_0xe4c4('0x54')](_[_0xe4c4('0x5c')](_0x6bf1ee[_0xe4c4('0x52')],_0x176712[_0xe4c4('0x54')]),_0x5d9b27);if(_0x6bf1ee[_0xe4c4('0x52')][_0xe4c4('0x5d')]){_0x1eda5e[_0xe4c4('0x5b')]=_[_0xe4c4('0x5e')](_0x1eda5e[_0xe4c4('0x5b')],{'$or':_[_0xe4c4('0x4d')](_0x5d9b27,function(_0x338cf5){if(_0x338cf5['type']!==_0xe4c4('0x5f')){var _0x4a2ae9={};_0x4a2ae9[_0x338cf5[_0xe4c4('0x34')]]={'$like':'%'+_0x6bf1ee['query'][_0xe4c4('0x5d')]+'%'};return _0x4a2ae9;}})});}_0x1eda5e=_[_0xe4c4('0x5e')]({},_0x1eda5e,_0x6bf1ee[_0xe4c4('0x60')]);var _0x512ca9={'where':_0x1eda5e[_0xe4c4('0x5b')]};return db['ChatWebsite'][_0xe4c4('0x28')](_0x512ca9)[_0xe4c4('0x1c')](function(_0x1cef48){_0x3ee4db['count']=_0x1cef48;if(_0x6bf1ee['query'][_0xe4c4('0x61')]){_0x1eda5e[_0xe4c4('0x62')]=[{'all':!![]}];}return db[_0xe4c4('0x4e')]['findAll'](_0x1eda5e);})[_0xe4c4('0x1c')](function(_0x5c45f8){_0x3ee4db['rows']=_0x5c45f8;return _0x3ee4db;})['then'](respondWithFilteredResult(_0x1e459e,_0x1eda5e))['catch'](handleError(_0x1e459e,null));};exports[_0xe4c4('0x63')]=function(_0x3a06da,_0x1d89ff){var _0x2ea066={'raw':![],'where':{'id':_0x3a06da[_0xe4c4('0x64')]['id']},'include':[{'model':db['Pause'],'as':_0xe4c4('0x4c')}]},_0x4456e8={};_0x4456e8[_0xe4c4('0x47')]=_[_0xe4c4('0x53')](db[_0xe4c4('0x4e')][_0xe4c4('0x4f')]);_0x4456e8[_0xe4c4('0x52')]=_['keys'](_0x3a06da['query']);_0x4456e8[_0xe4c4('0x54')]=_[_0xe4c4('0x65')](_0x4456e8[_0xe4c4('0x47')],_0x4456e8[_0xe4c4('0x52')]);_0x2ea066[_0xe4c4('0x55')]=_[_0xe4c4('0x65')](_0x4456e8[_0xe4c4('0x47')],qs[_0xe4c4('0x56')](_0x3a06da[_0xe4c4('0x52')]['fields']));_0x2ea066['attributes']=_0x2ea066[_0xe4c4('0x55')]['length']?_0x2ea066[_0xe4c4('0x55')]:_0x4456e8[_0xe4c4('0x47')];if(_0x3a06da[_0xe4c4('0x52')]['includeAll']){_0x2ea066[_0xe4c4('0x62')]=[{'all':!![]}];}_0x2ea066=_['merge']({},_0x2ea066,_0x3a06da[_0xe4c4('0x60')]);return db['ChatWebsite']['find'](_0x2ea066)[_0xe4c4('0x1c')](handleEntityNotFound(_0x1d89ff,null))[_0xe4c4('0x1c')](respondWithResult(_0x1d89ff,null))[_0xe4c4('0x24')](handleError(_0x1d89ff,null));};exports['create']=function(_0x57e38e,_0x4879f9){var _0x1f91f4=null;_0x57e38e[_0xe4c4('0x66')]['address'][_0xe4c4('0x67')](',')[_0xe4c4('0x68')](_0x11115a=>{if(_0x11115a['trim']()!==''&&!wildcardUtils['testWildcardValidity'](_0x11115a[_0xe4c4('0x69')]())){_0x1f91f4=new APIBadRequestError('\x22'+_0x11115a[_0xe4c4('0x69')]()+_0xe4c4('0x6a'));}});if(_0x1f91f4){return handleError(_0x4879f9,null)(_0x1f91f4);}return db[_0xe4c4('0x4e')][_0xe4c4('0x6b')](_0x57e38e[_0xe4c4('0x66')],{})['then'](function(_0x38dd83){var _0x1bddd5=_0x57e38e[_0xe4c4('0x6c')]['get']({'plain':!![]});if(!_0x1bddd5)throw new Error(_0xe4c4('0x6d'));if(_0x1bddd5[_0xe4c4('0x6e')]===_0xe4c4('0x6c')){var _0x57998c=_0x38dd83['get']({'plain':!![]});var _0x2043a8='ChatWebsites';return db['UserProfileSection'][_0xe4c4('0x6f')]({'where':{'name':_0x2043a8,'userProfileId':_0x1bddd5[_0xe4c4('0x70')]},'raw':!![]})[_0xe4c4('0x1c')](function(_0x49d80b){if(_0x49d80b&&_0x49d80b[_0xe4c4('0x71')]===0x0){return db[_0xe4c4('0x30')][_0xe4c4('0x6b')]({'name':_0x57998c[_0xe4c4('0x34')],'resourceId':_0x57998c['id'],'type':_0x49d80b['name'],'sectionId':_0x49d80b['id']},{})[_0xe4c4('0x1c')](function(){return _0x38dd83;});}else{return _0x38dd83;}})[_0xe4c4('0x24')](function(_0x4bb16e){logger['error'](_0xe4c4('0x72'),_0x4bb16e);throw _0x4bb16e;});}return _0x38dd83;})[_0xe4c4('0x1c')](respondWithResult(_0x4879f9,0xc9))[_0xe4c4('0x24')](handleError(_0x4879f9,null));};exports[_0xe4c4('0x2c')]=function(_0x54c386,_0x369ecc){var _0x25e84f=null;_0x54c386[_0xe4c4('0x66')]['address']['split'](',')[_0xe4c4('0x68')](_0x2be1d8=>{if(_0x2be1d8[_0xe4c4('0x69')]()!==''&&!wildcardUtils[_0xe4c4('0x73')](_0x2be1d8['trim']())){_0x25e84f=new APIBadRequestError('\x22'+_0x2be1d8['trim']()+_0xe4c4('0x6a'));}});if(_0x25e84f){return handleError(_0x369ecc,null)(_0x25e84f);}if(_0x54c386[_0xe4c4('0x66')]['id']){delete _0x54c386[_0xe4c4('0x66')]['id'];}return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')]({'where':{'id':_0x54c386['params']['id']},'include':[{'model':db[_0xe4c4('0x74')],'as':'mandatoryDispositionPause'}]})[_0xe4c4('0x1c')](handleEntityNotFound(_0x369ecc,null))[_0xe4c4('0x1c')](saveUpdates(_0x54c386['body'],null))['then'](respondWithResult(_0x369ecc,null))[_0xe4c4('0x24')](handleError(_0x369ecc,null));};exports[_0xe4c4('0x2d')]=function(_0x250bb8,_0x1f880f){return db[_0xe4c4('0x4e')]['find']({'where':{'id':_0x250bb8['params']['id']}})['then'](handleEntityNotFound(_0x1f880f,null))[_0xe4c4('0x1c')](removeEntity(_0x1f880f,null))[_0xe4c4('0x24')](handleError(_0x1f880f,null));};exports['describe']=function(_0x203f11,_0x11faa3){return db[_0xe4c4('0x4e')][_0xe4c4('0x75')]()['then'](respondWithResult(_0x11faa3,null))['catch'](handleError(_0x11faa3,null));};exports[_0xe4c4('0x76')]=function(_0x32f019,_0x5ad3f5){if(_0x32f019[_0xe4c4('0x66')]['id']){delete _0x32f019[_0xe4c4('0x66')]['id'];}return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')]({'where':{'id':_0x32f019['params']['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x5ad3f5,null))[_0xe4c4('0x1c')](function(_0x4e848c){if(_0x4e848c){_0x32f019[_0xe4c4('0x66')]['ChatWebsiteId']=_0x4e848c['id'];return db[_0xe4c4('0x77')][_0xe4c4('0x6b')](_0x32f019[_0xe4c4('0x66')]);}})[_0xe4c4('0x1c')](respondWithResult(_0x5ad3f5,null))['catch'](handleError(_0x5ad3f5,null));};exports[_0xe4c4('0x78')]=function(_0x209fa2,_0x4f3263){var _0x48e089={'raw':![],'where':{}};var _0x1cbf25={};var _0x3547d5={'count':0x0,'rows':[]};return db[_0xe4c4('0x4e')][_0xe4c4('0x79')]({'where':{'id':_0x209fa2[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x4f3263,null))[_0xe4c4('0x1c')](function(_0xa3f3b7){if(_0xa3f3b7){_0x1cbf25['model']=_['keys'](db[_0xe4c4('0x77')][_0xe4c4('0x4f')]);_0x1cbf25[_0xe4c4('0x52')]=_[_0xe4c4('0x53')](_0x209fa2[_0xe4c4('0x52')]);_0x1cbf25['filters']=_[_0xe4c4('0x65')](_0x1cbf25[_0xe4c4('0x47')],_0x1cbf25[_0xe4c4('0x52')]);_0x48e089[_0xe4c4('0x55')]=_[_0xe4c4('0x65')](_0x1cbf25[_0xe4c4('0x47')],qs[_0xe4c4('0x56')](_0x209fa2[_0xe4c4('0x52')][_0xe4c4('0x56')]));_0x48e089[_0xe4c4('0x55')]=_0x48e089[_0xe4c4('0x55')][_0xe4c4('0x57')]?_0x48e089[_0xe4c4('0x55')]:_0x1cbf25[_0xe4c4('0x47')];if(!_0x209fa2[_0xe4c4('0x52')][_0xe4c4('0x58')]('nolimit')){_0x48e089['limit']=qs[_0xe4c4('0x27')](_0x209fa2['query'][_0xe4c4('0x27')]);_0x48e089[_0xe4c4('0x29')]=qs[_0xe4c4('0x29')](_0x209fa2[_0xe4c4('0x52')][_0xe4c4('0x29')]);}_0x48e089[_0xe4c4('0x59')]=qs[_0xe4c4('0x5a')](_0x209fa2[_0xe4c4('0x52')][_0xe4c4('0x5a')]);_0x48e089[_0xe4c4('0x5b')]=qs[_0xe4c4('0x54')](_[_0xe4c4('0x5c')](_0x209fa2[_0xe4c4('0x52')],_0x1cbf25['filters']));_0x48e089[_0xe4c4('0x5b')][_0xe4c4('0x7a')]=_0xa3f3b7['id'];if(_0x209fa2[_0xe4c4('0x52')][_0xe4c4('0x5d')]){_0x48e089[_0xe4c4('0x5b')]=_['merge'](_0x48e089[_0xe4c4('0x5b')],{'$or':_[_0xe4c4('0x4d')](_0x48e089['attributes'],function(_0x143ed6){var _0x32d704={};_0x32d704[_0x143ed6]={'$like':'%'+_0x209fa2['query']['filter']+'%'};return _0x32d704;})});}_0x48e089=_['merge']({},_0x48e089,_0x209fa2[_0xe4c4('0x60')]);return db['Disposition'][_0xe4c4('0x28')]({'where':_0x48e089[_0xe4c4('0x5b')]})[_0xe4c4('0x1c')](function(_0x5dc059){_0x3547d5[_0xe4c4('0x28')]=_0x5dc059;if(_0x209fa2[_0xe4c4('0x52')][_0xe4c4('0x61')]){_0x48e089['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x48e089);})[_0xe4c4('0x1c')](function(_0x1cf5d1){_0x3547d5[_0xe4c4('0x7b')]=_0x1cf5d1;return _0x3547d5;});}})['then'](respondWithFilteredResult(_0x4f3263,_0x48e089))[_0xe4c4('0x24')](handleError(_0x4f3263,null));};exports[_0xe4c4('0x7c')]=function(_0x3abfbc,_0x16d2af){return db[_0xe4c4('0x4e')]['find']({'where':{'id':_0x3abfbc[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x16d2af,null))[_0xe4c4('0x1c')](function(_0x54a2ef){if(_0x54a2ef){return _0x54a2ef[_0xe4c4('0x7c')](_0x3abfbc[_0xe4c4('0x52')][_0xe4c4('0x7d')]);}})['then'](respondWithStatusCode(_0x16d2af,null))[_0xe4c4('0x24')](handleError(_0x16d2af,null));};exports[_0xe4c4('0x7e')]=function(_0x47d67d,_0x36c0e5){if(_0x47d67d[_0xe4c4('0x66')]['id']){delete _0x47d67d[_0xe4c4('0x66')]['id'];}return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')]({'where':{'id':_0x47d67d[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x36c0e5,null))['then'](function(_0x54abc3){if(_0x54abc3){_0x47d67d[_0xe4c4('0x66')][_0xe4c4('0x7a')]=_0x54abc3['id'];return db[_0xe4c4('0x7f')][_0xe4c4('0x6b')](_0x47d67d[_0xe4c4('0x66')]);}})['then'](respondWithResult(_0x36c0e5,null))[_0xe4c4('0x24')](handleError(_0x36c0e5,null));};exports['getAnswers']=function(_0x133576,_0x44a173){var _0x3cfed6={'raw':![],'where':{}};var _0x582c12={};var _0x562aeb={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe4c4('0x79')]({'where':{'id':_0x133576[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x44a173,null))[_0xe4c4('0x1c')](function(_0x551d45){if(_0x551d45){_0x582c12[_0xe4c4('0x47')]=_[_0xe4c4('0x53')](db[_0xe4c4('0x7f')][_0xe4c4('0x4f')]);_0x582c12['query']=_[_0xe4c4('0x53')](_0x133576[_0xe4c4('0x52')]);_0x582c12['filters']=_['intersection'](_0x582c12['model'],_0x582c12[_0xe4c4('0x52')]);_0x3cfed6[_0xe4c4('0x55')]=_[_0xe4c4('0x65')](_0x582c12[_0xe4c4('0x47')],qs[_0xe4c4('0x56')](_0x133576[_0xe4c4('0x52')][_0xe4c4('0x56')]));_0x3cfed6[_0xe4c4('0x55')]=_0x3cfed6[_0xe4c4('0x55')][_0xe4c4('0x57')]?_0x3cfed6['attributes']:_0x582c12['model'];if(!_0x133576[_0xe4c4('0x52')][_0xe4c4('0x58')](_0xe4c4('0x80'))){_0x3cfed6['limit']=qs[_0xe4c4('0x27')](_0x133576[_0xe4c4('0x52')]['limit']);_0x3cfed6[_0xe4c4('0x29')]=qs['offset'](_0x133576[_0xe4c4('0x52')]['offset']);}_0x3cfed6[_0xe4c4('0x59')]=qs[_0xe4c4('0x5a')](_0x133576[_0xe4c4('0x52')][_0xe4c4('0x5a')]);_0x3cfed6[_0xe4c4('0x5b')]=qs['filters'](_['pick'](_0x133576[_0xe4c4('0x52')],_0x582c12['filters']));_0x3cfed6[_0xe4c4('0x5b')][_0xe4c4('0x7a')]=_0x551d45['id'];if(_0x133576[_0xe4c4('0x52')]['filter']){_0x3cfed6[_0xe4c4('0x5b')]=_['merge'](_0x3cfed6[_0xe4c4('0x5b')],{'$or':_['map'](_0x3cfed6['attributes'],function(_0x2fb74b){var _0x38aac8={};_0x38aac8[_0x2fb74b]={'$like':'%'+_0x133576[_0xe4c4('0x52')]['filter']+'%'};return _0x38aac8;})});}_0x3cfed6=_[_0xe4c4('0x5e')]({},_0x3cfed6,_0x133576[_0xe4c4('0x60')]);return db[_0xe4c4('0x7f')][_0xe4c4('0x28')]({'where':_0x3cfed6['where']})[_0xe4c4('0x1c')](function(_0x323dda){_0x562aeb[_0xe4c4('0x28')]=_0x323dda;if(_0x133576[_0xe4c4('0x52')]['includeAll']){_0x3cfed6['include']=[{'all':!![]}];}return db[_0xe4c4('0x7f')]['findAll'](_0x3cfed6);})[_0xe4c4('0x1c')](function(_0x4bde1c){_0x562aeb[_0xe4c4('0x7b')]=_0x4bde1c;return _0x562aeb;});}})[_0xe4c4('0x1c')](respondWithFilteredResult(_0x44a173,_0x3cfed6))['catch'](handleError(_0x44a173,null));};exports[_0xe4c4('0x81')]=function(_0x203bbf,_0x2072f2){return db[_0xe4c4('0x4e')]['find']({'where':{'id':_0x203bbf[_0xe4c4('0x64')]['id']}})['then'](handleEntityNotFound(_0x2072f2,null))['then'](function(_0x520297){if(_0x520297){return _0x520297['removeAnswers'](_0x203bbf[_0xe4c4('0x52')][_0xe4c4('0x7d')]);}})['then'](respondWithStatusCode(_0x2072f2,null))[_0xe4c4('0x24')](handleError(_0x2072f2,null));};exports[_0xe4c4('0x82')]=function(_0x2b7ebd,_0x311dda){_0x2b7ebd['body']['sitepic']=_0x2b7ebd[_0xe4c4('0x83')][_0xe4c4('0x84')];return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')]({'where':{'id':_0x2b7ebd['params']['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x311dda,null))[_0xe4c4('0x1c')](saveUpdates(_0x2b7ebd[_0xe4c4('0x66')],null))['then'](respondWithResult(_0x311dda,null))[_0xe4c4('0x24')](handleError(_0x311dda,null));};exports[_0xe4c4('0x85')]=function(_0x435e7e,_0x34c5c9){_0x435e7e[_0xe4c4('0x66')][_0xe4c4('0x86')]=_0x435e7e[_0xe4c4('0x83')][_0xe4c4('0x84')];return db['ChatWebsite'][_0xe4c4('0x6f')]({'where':{'id':_0x435e7e[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x34c5c9,null))['then'](saveUpdates(_0x435e7e[_0xe4c4('0x66')],null))[_0xe4c4('0x1c')](respondWithResult(_0x34c5c9,null))['catch'](handleError(_0x34c5c9,null));};exports[_0xe4c4('0x87')]=function(_0x49535a,_0x5cf0b3){_0x49535a[_0xe4c4('0x66')][_0xe4c4('0x88')]=_0x49535a[_0xe4c4('0x83')]['filename'];return db[_0xe4c4('0x4e')]['find']({'where':{'id':_0x49535a[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x5cf0b3,null))[_0xe4c4('0x1c')](saveUpdates(_0x49535a[_0xe4c4('0x66')],null))[_0xe4c4('0x1c')](respondWithResult(_0x5cf0b3,null))[_0xe4c4('0x24')](handleError(_0x5cf0b3,null));};exports['addSystemAvatar']=function(_0x34baa7,_0x38226e){_0x34baa7[_0xe4c4('0x66')][_0xe4c4('0x89')]=_0x34baa7[_0xe4c4('0x83')][_0xe4c4('0x84')];return db['ChatWebsite'][_0xe4c4('0x6f')]({'where':{'id':_0x34baa7[_0xe4c4('0x64')]['id']}})['then'](handleEntityNotFound(_0x38226e,null))[_0xe4c4('0x1c')](saveUpdates(_0x34baa7[_0xe4c4('0x66')],null))['then'](respondWithResult(_0x38226e,null))[_0xe4c4('0x24')](handleError(_0x38226e,null));};exports[_0xe4c4('0x8a')]=function(_0x4ff9b8,_0x6d730e){var _0x2e0157=path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],'server/files/images/logos/default_logo.svg');var _0x270ad7={'where':{'id':_0x4ff9b8[_0xe4c4('0x64')]['id']},'attributes':['id',_0xe4c4('0x8d')],'raw':!![]};var _0x2d8891=![];return require(_0xe4c4('0x8e'))[_0xe4c4('0x8f')]()[_0xe4c4('0x1c')](function(_0x452db2){if(_0x452db2){_0x2d8891=_0x452db2[_0xe4c4('0x90')];}})['then'](function(){return db['ChatWebsite']['find'](_0x270ad7);})[_0xe4c4('0x1c')](handleEntityNotFound(_0x6d730e,null))[_0xe4c4('0x1c')](function(_0x1fba21){if(_0x1fba21){if(!_['isNil'](_0x1fba21[_0xe4c4('0x8d')])){if(fs[_0xe4c4('0x91')](path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],_0xe4c4('0x92'),_0x1fba21[_0xe4c4('0x8d')]))&&_0x2d8891){_0x2e0157=path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],_0xe4c4('0x92'),_0x1fba21['sitepic']);}}return _0x6d730e[_0xe4c4('0x93')](_0x2e0157);}})[_0xe4c4('0x24')](handleError(_0x6d730e,null));};exports[_0xe4c4('0x94')]=function(_0x408dab,_0x26d412){var _0x249246=path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],_0xe4c4('0x95'));var _0x3a5fde={'where':{'id':_0x408dab[_0xe4c4('0x64')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')](_0x3a5fde)['then'](handleEntityNotFound(_0x26d412,null))[_0xe4c4('0x1c')](function(_0x11e8bb){if(_0x11e8bb){if(!_[_0xe4c4('0x96')](_0x11e8bb[_0xe4c4('0x86')])){if(fs[_0xe4c4('0x91')](path['join'](config['root'],_0xe4c4('0x97'),_0x11e8bb[_0xe4c4('0x86')]))){_0x249246=path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],_0xe4c4('0x97'),_0x11e8bb['agentAvatar']);}}return _0x26d412['download'](_0x249246);}})[_0xe4c4('0x24')](handleError(_0x26d412,null));};exports[_0xe4c4('0x98')]=function(_0x1a8895,_0x1ab570){var _0x2d1d44=path[_0xe4c4('0x8b')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x5c2d8e={'where':{'id':_0x1a8895[_0xe4c4('0x64')]['id']},'attributes':['id','customerAvatar',_0xe4c4('0x99')],'raw':!![]};return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')](_0x5c2d8e)[_0xe4c4('0x1c')](handleEntityNotFound(_0x1ab570,null))[_0xe4c4('0x1c')](function(_0x3c703b){if(_0x3c703b){if(!_['isNil'](_0x3c703b['customerAvatar'])){if(fs[_0xe4c4('0x91')](path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],'server/files/images/avatars/',_0x3c703b[_0xe4c4('0x88')]))&&_0x3c703b[_0xe4c4('0x99')]){_0x2d1d44=path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],'server/files/images/avatars/',_0x3c703b[_0xe4c4('0x88')]);}}return _0x1ab570[_0xe4c4('0x93')](_0x2d1d44);}})[_0xe4c4('0x24')](handleError(_0x1ab570,null));};exports['getSystemAvatar']=function(_0xc40381,_0x4e3287){var _0x2d7441=path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],_0xe4c4('0x9a'));var _0x16b4aa={'where':{'id':_0xc40381[_0xe4c4('0x64')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')](_0x16b4aa)[_0xe4c4('0x1c')](handleEntityNotFound(_0x4e3287,null))[_0xe4c4('0x1c')](function(_0x5c6509){if(_0x5c6509){if(!_[_0xe4c4('0x96')](_0x5c6509['systemAvatar'])){if(fs['existsSync'](path[_0xe4c4('0x8b')](config['root'],'server/files/images/avatars/',_0x5c6509[_0xe4c4('0x89')]))){_0x2d7441=path[_0xe4c4('0x8b')](config['root'],_0xe4c4('0x97'),_0x5c6509[_0xe4c4('0x89')]);}}return _0x4e3287[_0xe4c4('0x93')](_0x2d7441);}})[_0xe4c4('0x24')](handleError(_0x4e3287,null));};function checkWebsiteInterval(_0x530b01){var _0x45a14f=_0x530b01['Interval'];if(!_0x45a14f){return Promise[_0xe4c4('0x9b')](_0x530b01);}var _0x503a34=_0x530b01['timezone']||undefined;return _0x45a14f[_0xe4c4('0x9c')](_0x503a34)['then'](function(_0x4a45bf){if(!_0x4a45bf){throw new APIOutOfIntervalError();}return _0x530b01;});}exports[_0xe4c4('0x9d')]=function(_0x451f30,_0x1f7c17){var _0xcc2474={'body':_0x451f30[_0xe4c4('0x66')],'channel':_0xe4c4('0x9e')};var _0x27e90b=[];var _0x5a1e7e=[];var _0x4833f7={};var _0x230de7=![];if(_0x451f30['body']['id']){delete _0x451f30[_0xe4c4('0x66')]['id'];}if(_[_0xe4c4('0x96')](_0x451f30[_0xe4c4('0x66')][_0xe4c4('0x9f')])){throw new APIBadRequestError(_0xe4c4('0xa0'));}if(_[_0xe4c4('0x96')](_0x451f30[_0xe4c4('0x66')]['mapKey'])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0xe4c4('0xa1')](_0x451f30['body']['body'])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x48bdf0=_0x451f30['body'][_0xe4c4('0xa2')]&&_0x451f30[_0xe4c4('0x66')][_0xe4c4('0x40')];return db[_0xe4c4('0xa3')][_0xe4c4('0x75')]()[_0xe4c4('0x1c')](function(_0xfee08a){if(!_0xfee08a){throw new Error(_0xe4c4('0xa4'));}_0x27e90b=Object['keys'](_0xfee08a)['filter'](function(_0x44ef17){return![_0xe4c4('0xa5'),_0xe4c4('0xa6')][_0xe4c4('0xa7')](_0x44ef17);});_0x5a1e7e=Object[_0xe4c4('0x53')](_0xfee08a)[_0xe4c4('0x5d')](function(_0x3ffe55){return![_0xe4c4('0xa5'),_0xe4c4('0xa6'),_0xe4c4('0xa8'),_0xe4c4('0xa9')][_0xe4c4('0xa7')](_0x3ffe55);});if(!_['includes'](_0x5a1e7e,_0x451f30['body']['mapKey'])){throw new APIBadRequestError(_0xe4c4('0xaa')+_0x5a1e7e[_0xe4c4('0x8b')](',\x20'));}_0x4833f7[_0x451f30[_0xe4c4('0x66')]['mapKey']]=_0x451f30['body'][_0xe4c4('0x9f')];})[_0xe4c4('0x1c')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x451f30[_0xe4c4('0x64')]['id']},'include':[{'model':db[_0xe4c4('0xab')],'as':_0xe4c4('0xac'),'include':[{'model':db[_0xe4c4('0xa3')],'as':_0xe4c4('0xad'),'where':_0x4833f7,'limit':0x1,'order':[['updatedAt',_0xe4c4('0xae')]]}]},{'model':db[_0xe4c4('0xaf')],'as':_0xe4c4('0xb0')},{'model':db[_0xe4c4('0xb1')],'as':_0xe4c4('0xb1'),'include':[{'model':db['Interval'],'as':_0xe4c4('0xb2'),'attributes':['id',_0xe4c4('0xb3')],'raw':!![]}]}]});})[_0xe4c4('0x1c')](function(_0x39992d){if(!_0x39992d){throw new APINotFoundError(util[_0xe4c4('0x43')](_0xe4c4('0xb4'),_0x451f30[_0xe4c4('0x64')]['id']));}if(_0x48bdf0){return checkWebsiteInterval(_0x39992d);}return _0x39992d;})[_0xe4c4('0x1c')](function(_0x4956f5){_0xcc2474[_0xe4c4('0xb5')]=_0x4956f5;_0xcc2474[_0xe4c4('0xb6')]=_[_0xe4c4('0xb7')](_0x4956f5[_0xe4c4('0xb0')],[_0xe4c4('0xb8')],[_0xe4c4('0xb9')]);if(_0xcc2474[_0xe4c4('0xb5')][_0xe4c4('0xb0')]){delete _0xcc2474[_0xe4c4('0xb5')][_0xe4c4('0xb0')];}_0xcc2474['list']=_0x4956f5[_0xe4c4('0xac')]||{'id':_0x4956f5[_0xe4c4('0xa9')]};if(_0xcc2474['list']&&_0xcc2474['list'][_0xe4c4('0xad')][_0xe4c4('0x57')]){return _0xcc2474['list']['Contacts'][0x0];}var _0xd99041=_[_0xe4c4('0x13')](_0x451f30['body'],{'firstName':_0x451f30[_0xe4c4('0x66')][_0xe4c4('0x9f')],'ListId':_0x4956f5[_0xe4c4('0xa9')]});_0xd99041[_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xba')]]=_0x451f30[_0xe4c4('0x66')][_0xe4c4('0x9f')];return db[_0xe4c4('0xa3')][_0xe4c4('0x6b')](_0xd99041,{'fields':_0x27e90b,'raw':!![]});})['then'](function(_0x2b660c){_0xcc2474[_0xe4c4('0xbb')]=_0x2b660c;var _0x57bfe4=createInteractionObject(_0x451f30[_0xe4c4('0x64')]['id'],_0x451f30[_0xe4c4('0x66')],_0x451f30[_0xe4c4('0xbc')],_0x2b660c);var _0x1e0825={'ChatWebsiteId':_0x451f30[_0xe4c4('0x64')]['id']};if(_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xbd')]){_0x1e0825[_0xe4c4('0xbd')]=_0x451f30['body']['threadId'];_0x1e0825[_0xe4c4('0xbe')]=![];return db[_0xe4c4('0xbf')]['find']({'where':_0x1e0825})['then'](function(_0x203918){var _0x2409a1=_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xa2')]&&_0x451f30[_0xe4c4('0x66')]['referer'];if(_0x203918){_0x230de7=!![];return _0x203918;}else if(!_0x2409a1&&_0x203918&&_0x203918[_0xe4c4('0xbe')]){throw new APIConflictError(_0xe4c4('0xc0'));}_0x57bfe4['threadId']=_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xbd')];_0x57bfe4['externalUrl']=_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xc1')];return db[_0xe4c4('0xbf')]['create'](_0x57bfe4);});}_0x1e0825[_0xe4c4('0xc2')]=_0x2b660c['id'];if(_0x451f30['body'][_0xe4c4('0xc3')]&&_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xc3')]['id']){_0x1e0825['id']=_0x451f30['body'][_0xe4c4('0xc3')]['id'];return db[_0xe4c4('0xbf')][_0xe4c4('0x6f')]({'where':_0x1e0825})[_0xe4c4('0x1c')](function(_0x18b728){var _0x4066a0=_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xa2')]&&_0x451f30[_0xe4c4('0x66')][_0xe4c4('0x40')];if(!_0x4066a0&&_0x18b728&&_0x18b728['closed']){throw new APIConflictError(_0xe4c4('0xc0'));}else if(_0x18b728){_0x230de7=!![];return _0x18b728;}else{return db[_0xe4c4('0xbf')][_0xe4c4('0x6b')](_0x57bfe4);}});}return db[_0xe4c4('0xbf')][_0xe4c4('0x6b')](_0x57bfe4);})[_0xe4c4('0x1c')](function(_0x3414f3){if(!_0x230de7){return _0x3414f3;}var _0x1966f6={'from':(_0xcc2474[_0xe4c4('0xbb')]['firstName']||'')+'\x20'+(_0xcc2474[_0xe4c4('0xbb')][_0xe4c4('0x3e')]||'')};if(_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xbd')]&&_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xc4')]&&_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xbd')]!=_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xc4')]){_0x1966f6[_0xe4c4('0xbd')]=_0x451f30[_0xe4c4('0x66')]['messageId'];}return _0x3414f3['update'](_0x1966f6);})['then'](function(_0x3e1c4a){_0xcc2474[_0xe4c4('0xc3')]=_0x3e1c4a['get']({'plain':!![]});_0xcc2474['interaction']['created']=!_0x230de7;if(_0xcc2474[_0xe4c4('0xc3')]['created']){if(_0xcc2474[_0xe4c4('0xb5')][_0xe4c4('0xc5')]){_0xcc2474[_0xe4c4('0xb6')][_0xe4c4('0xc6')]({'id':0x0,'priority':_0xcc2474[_0xe4c4('0xb6')][_0xe4c4('0x57')]+0x1,'app':_0xe4c4('0xc7'),'appdata':_0xe4c4('0xc8'),'interval':_0xe4c4('0xc9')});}}return db[_0xe4c4('0xca')][_0xe4c4('0x6b')]({'body':_0x451f30[_0xe4c4('0x66')][_0xe4c4('0x66')],'ChatWebsiteId':_0x451f30[_0xe4c4('0x64')]['id'],'ChatInteractionId':_0x3e1c4a['id'],'direction':'in','ContactId':_0xcc2474[_0xe4c4('0xbb')]['id'],'AttachmentId':_0x451f30[_0xe4c4('0x66')]['AttachmentId']});})[_0xe4c4('0x1c')](function(_0x12333a){_0xcc2474['message']=_0x12333a;if(!_0xcc2474[_0xe4c4('0xc3')][_0xe4c4('0xcb')]){return;}return db[_0xe4c4('0xcc')][_0xe4c4('0x6f')]({'attributes':['id',_0xe4c4('0x34')],'where':{'id':_0xcc2474[_0xe4c4('0xc3')][_0xe4c4('0xcb')]}});})[_0xe4c4('0x1c')](function(_0x5ea042){if(_0x5ea042){_0xcc2474['applications'][_0xe4c4('0xcd')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5ea042['name']+','+(_0xcc2474[_0xe4c4('0xb5')][_0xe4c4('0xce')]||0xa),'interval':_0xe4c4('0xc9')});_0xcc2474[_0xe4c4('0xcf')]=!![];}if(!_0xcc2474[_0xe4c4('0xc3')]['queueId']){return;}return db['ChatQueue'][_0xe4c4('0x6f')]({'attributes':['id',_0xe4c4('0x34')],'where':{'id':_0xcc2474[_0xe4c4('0xc3')][_0xe4c4('0xd0')]}});})[_0xe4c4('0x1c')](function(_0x211371){if(_0x211371){_0xcc2474['applications'][_0xe4c4('0xcd')]({'id':0x0,'priority':0x1,'app':_0xe4c4('0xd1'),'appdata':_0x211371[_0xe4c4('0x34')]+','+(_0xcc2474[_0xe4c4('0xb5')][_0xe4c4('0xd2')]||0x12c),'interval':_0xe4c4('0xc9')});}return respondWithRpcPromise(_0xe4c4('0xd3'),_0xe4c4('0xd4'),_0xcc2474);})[_0xe4c4('0x1c')](function(_0xe396a6){respondWithRpcPromise(_0xe4c4('0xd5'),_0xe4c4('0xd5'),{'event':_0xe4c4('0x9d'),'message':_0xe396a6},client9002);return _0xe396a6;})[_0xe4c4('0x1c')](respondWithResult(_0x1f7c17,null))[_0xe4c4('0x24')](APIHandleError(_0x1f7c17));};exports[_0xe4c4('0xd6')]=function(_0x2aa16e,_0x3f6e8d){var _0x51cd04,_0x23e102,_0x18973e;var _0x3651ec=[];var _0x50371={};var _0x20de1b=_0x2aa16e[_0xe4c4('0xd7')]||[];var _0x5a34fe=[];var _0x29ac6c;return db[_0xe4c4('0xa3')][_0xe4c4('0x75')]()['then'](function(_0x4b1e34){if(!_0x4b1e34){throw new db['Sequelize'][(_0xe4c4('0xd8'))](_0xe4c4('0xd9'));}_0x3651ec=_[_0xe4c4('0xda')](_[_0xe4c4('0x53')](_0x4b1e34),[_0xe4c4('0xa5'),'updatedAt','CompanyId',_0xe4c4('0xa9')]);if(_0x2aa16e[_0xe4c4('0x66')]['id']){delete _0x2aa16e[_0xe4c4('0x66')]['id'];}if(_['isNil'](_0x2aa16e[_0xe4c4('0x66')][_0xe4c4('0x9f')])){throw _0x3f6e8d[_0xe4c4('0x25')](0x1f4)['send'](new db[(_0xe4c4('0xdb'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xe4c4('0x96')](_0x2aa16e['body'][_0xe4c4('0x66')])||_0x2aa16e[_0xe4c4('0x66')][_0xe4c4('0x66')]===''){throw _0x3f6e8d['status'](0x1f4)[_0xe4c4('0x35')](new db[(_0xe4c4('0xdb'))][(_0xe4c4('0xd8'))](_0xe4c4('0xdc')));}if(_[_0xe4c4('0x96')](_0x2aa16e[_0xe4c4('0x66')][_0xe4c4('0xdd')])){throw _0x3f6e8d[_0xe4c4('0x25')](0x1f4)[_0xe4c4('0x35')](new db[(_0xe4c4('0xdb'))][(_0xe4c4('0xd8'))](_0xe4c4('0xde')+_0x3651ec));}if(!_['includes'](_0x3651ec,_0x2aa16e[_0xe4c4('0x66')][_0xe4c4('0xdd')])){throw _0x3f6e8d[_0xe4c4('0x25')](0x1f4)[_0xe4c4('0x35')](new db[(_0xe4c4('0xdb'))]['ValidationError'](_0xe4c4('0xdf')+_0x3651ec));}_0x50371[_0x2aa16e[_0xe4c4('0x66')][_0xe4c4('0xdd')]]=_0x2aa16e['body'][_0xe4c4('0x9f')];})[_0xe4c4('0x1c')](function(){return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')]({'where':{'id':_0x2aa16e[_0xe4c4('0x64')]['id']},'include':[{'model':db[_0xe4c4('0xab')],'as':_0xe4c4('0xac')},{'model':db[_0xe4c4('0xe0')],'as':_0xe4c4('0xe0')}]});})['then'](handleEntityNotFound(_0x3f6e8d,null))[_0xe4c4('0x1c')](function(_0x21cc1a){if(_0x21cc1a&&_0x21cc1a[_0xe4c4('0xac')]){_0x23e102=_0x21cc1a;var _0x41c0dc=_[_0xe4c4('0x13')](_0x2aa16e[_0xe4c4('0x66')],{'firstName':_0x2aa16e['body'][_0xe4c4('0x9f')],'phone':_0x2aa16e[_0xe4c4('0x66')][_0xe4c4('0x9f')],'ListId':_0x21cc1a['ListId']});_0x41c0dc[_0x2aa16e[_0xe4c4('0x66')][_0xe4c4('0xdd')]]=_0x2aa16e[_0xe4c4('0x66')]['from'];return db['CmContact'][_0xe4c4('0xe1')]({'where':_0x50371,'defaults':_0x41c0dc});}})[_0xe4c4('0xe2')](function(_0x3e4571){if(_0x3e4571){_0x18973e=_0x3e4571;var _0x5ea70c=fs[_0xe4c4('0xe3')](path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],'server/files/templates/chatOfflineMessage.ejs'),_0xe4c4('0xe4'));var _0x23d5d5=ejs[_0xe4c4('0xe5')](_0x5ea70c,{'body':_[_0xe4c4('0xe6')](_0x2aa16e[_0xe4c4('0x66')][_0xe4c4('0x66')]),'bodyTitle':_0x23e102['offlineMessageBody']});return db[_0xe4c4('0xe7')][_0xe4c4('0x6b')]({'body':_0x23d5d5,'plainBody':htmlToText[_0xe4c4('0xe8')](_0x23d5d5),'ContactId':_0x3e4571['id'],'ChatWebsiteId':_0x23e102['id']});}})[_0xe4c4('0x1c')](function(_0x134833){_0x29ac6c=_0x134833;if(_0x20de1b[_0xe4c4('0x57')]){var _0x1dd21c=_0x20de1b[_0xe4c4('0x4d')](function(_0x3d8da1){return{'name':_0x3d8da1[_0xe4c4('0xe9')],'basename':_0x3d8da1['filename'],'type':_0x3d8da1[_0xe4c4('0xea')],'ChatOfflineMessageId':_0x134833['id']};});_0x5a34fe=_0x1dd21c['map'](_0x1ac10e=>{var _0x50cb2b={'filename':_0x1ac10e[_0xe4c4('0x34')],'path':path['join'](config['root'],_0xe4c4('0xeb'),_0xe4c4('0xd7'),_0xe4c4('0xec'),_0xe4c4('0xed'),_0x1ac10e[_0xe4c4('0xee')])};return _0x50cb2b;});if(!_0x23e102[_0xe4c4('0xef')]){return db[_0xe4c4('0xf0')][_0xe4c4('0xf1')](function(_0x5ed12d){return db[_0xe4c4('0xf2')][_0xe4c4('0xf3')](_0x1dd21c,{'transaction':_0x5ed12d});});}}})[_0xe4c4('0x1c')](function(){if(_0x29ac6c){_0x51cd04=_0x29ac6c;return db[_0xe4c4('0xe0')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xe4c4('0xf4')],'as':_0xe4c4('0xf5'),'raw':!![],'include':[{'model':db[_0xe4c4('0xf6')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xe4c4('0x1c')](function(_0x2a7374){if(_0x2a7374&&_0x2a7374['Smtp']&&_0x23e102[_0xe4c4('0xf7')]&&_0x23e102['forwardOfflineAddress']){var _0x2ebef7=_0x2a7374[_0xe4c4('0xf8')]();return respondWithRpcPromise('SendMail',_0xe4c4('0xf9'),{'account':_0x2ebef7,'message':{'from':util[_0xe4c4('0x43')](_0xe4c4('0xfa'),_0x2a7374[_0xe4c4('0x34')],_0x2a7374[_0xe4c4('0xfb')]||_0x2a7374[_0xe4c4('0xf5')][_0xe4c4('0x6c')]),'to':_0x23e102[_0xe4c4('0xfc')],'subject':_0x23e102[_0xe4c4('0xfd')],'html':_0x51cd04[_0xe4c4('0x66')],'attachments':_0x5a34fe}},client9003)[_0xe4c4('0x1c')](function(){return _0x51cd04;})[_0xe4c4('0x24')](function(_0x307198){logger[_0xe4c4('0x22')](_0x307198);});}})[_0xe4c4('0x1c')](function(){if(_0x23e102&&_0x23e102[_0xe4c4('0xef')]&&_0x23e102['MailAccountId']){var _0x555318=[];if(_0x20de1b[_0xe4c4('0x57')]){_0x555318=_0x20de1b[_0xe4c4('0x4d')](function(_0x4d7fea){return{'name':_0x4d7fea[_0xe4c4('0xe9')],'basename':_0x4d7fea['filename'],'type':_0x4d7fea[_0xe4c4('0xea')],'ChatOfflineMessageId':_0x29ac6c['id']};});}var _0x4f78a6;if(!_[_0xe4c4('0x96')](_0x23e102[_0xe4c4('0xfe')])){var _0x290c62=_[_0xe4c4('0x4d')](_0x2aa16e[_0xe4c4('0x66')],function(_0x1e88dc){return _0x1e88dc;});var _0x1caed0=_[_0xe4c4('0xff')](_0x290c62)[0x0];var _0x6fd02e=_[_0xe4c4('0x100')](_0x1caed0,function(_0x55cfe3){return _0x55cfe3;});_0x4f78a6=_0x6fd02e[0x1][_0x23e102[_0xe4c4('0xfe')]];}var _0x550c69={'from':_0x18973e[_0xe4c4('0xfb')],'firstName':_0x18973e[_0xe4c4('0x3d')],'lastName':_0x18973e[_0xe4c4('0x3e')],'mapKey':_0xe4c4('0xfb'),'message':{'from':_0x18973e[_0xe4c4('0xfb')],'to':_0x23e102[_0xe4c4('0xe0')][_0xe4c4('0xfb')],'cc':'','subject':_[_0xe4c4('0x96')](_0x4f78a6)?_0x23e102[_0xe4c4('0xfd')]:_0x4f78a6,'messageId':'','sentAt':new Date(),'attach':_0x555318[_0xe4c4('0x57')],'attachments':_0x555318,'originChannel':'Chat','ChatWebsiteId':_0x23e102['id'],'ChatOfflineMessageId':_0x51cd04['id'],'originTo':_0x23e102['MailAccount']['email']},'body':_0x51cd04[_0xe4c4('0x66')]};var _0x2391a1={'account':{'id':_0x23e102['MailAccountId']},'body':_0x550c69,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xe4c4('0x101'),_0x2391a1,client9001)[_0xe4c4('0x1c')](function(){return _0x51cd04;})[_0xe4c4('0x24')](function(_0xda9160){logger[_0xe4c4('0x22')](_0xda9160);});}return;})[_0xe4c4('0x1c')](function(){if(_0x51cd04){return _0x51cd04;}})['then'](respondWithResult(_0x3f6e8d,null))[_0xe4c4('0x24')](function(){for(var _0x54b014 of _0x20de1b){var _0x340fd7=path[_0xe4c4('0x8b')](config['root'],_0xe4c4('0xeb'),_0xe4c4('0xd7'),_0xe4c4('0xec'),_0xe4c4('0xed'),_0x54b014[_0xe4c4('0x84')]);fs_extra[_0xe4c4('0x102')](_0x340fd7)[_0xe4c4('0x24')](function(_0x32cbd2){logger[_0xe4c4('0x22')](_0xe4c4('0x103'),_0x340fd7,_0x32cbd2);});}});};exports['addInteraction']=function(_0x536ff2,_0x2f71b7){return db['ChatInteraction']['find']({'where':{'id':_0x536ff2[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x2f71b7,null))[_0xe4c4('0x1c')](function(_0x3fcff1){if(_0x3fcff1){return _0x3fcff1[_0xe4c4('0x104')](_0x536ff2[_0xe4c4('0x66')][_0xe4c4('0x7d')],_['omit'](_0x536ff2[_0xe4c4('0x66')],[_0xe4c4('0x7d'),'id'])||{});}})['then'](respondWithResult(_0x2f71b7,null))[_0xe4c4('0x24')](handleError(_0x2f71b7,null));};exports[_0xe4c4('0x105')]=function(_0xf5aec6,_0x510361){var _0x16c203={'raw':![],'where':{}};var _0x289144={};var _0x112034={'count':0x0,'rows':[]};return db[_0xe4c4('0x4e')][_0xe4c4('0x79')]({'where':{'id':_0xf5aec6['params']['id']}})['then'](handleEntityNotFound(_0x510361,null))[_0xe4c4('0x1c')](function(_0x51b9a1){if(_0x51b9a1){_0x289144[_0xe4c4('0x47')]=_[_0xe4c4('0x53')](db[_0xe4c4('0xbf')]['rawAttributes']);_0x289144['query']=_[_0xe4c4('0x53')](_0xf5aec6[_0xe4c4('0x52')]);_0x289144['filters']=_[_0xe4c4('0x65')](_0x289144[_0xe4c4('0x47')],_0x289144[_0xe4c4('0x52')]);_0x16c203[_0xe4c4('0x55')]=_[_0xe4c4('0x65')](_0x289144[_0xe4c4('0x47')],qs[_0xe4c4('0x56')](_0xf5aec6[_0xe4c4('0x52')][_0xe4c4('0x56')]));_0x16c203[_0xe4c4('0x55')]=_0x16c203[_0xe4c4('0x55')]['length']?_0x16c203[_0xe4c4('0x55')]:_0x289144[_0xe4c4('0x47')];if(!_0xf5aec6['query']['hasOwnProperty'](_0xe4c4('0x80'))){_0x16c203['limit']=qs[_0xe4c4('0x27')](_0xf5aec6[_0xe4c4('0x52')]['limit']);_0x16c203[_0xe4c4('0x29')]=qs[_0xe4c4('0x29')](_0xf5aec6[_0xe4c4('0x52')][_0xe4c4('0x29')]);}_0x16c203['order']=qs[_0xe4c4('0x5a')](_0xf5aec6[_0xe4c4('0x52')][_0xe4c4('0x5a')]);_0x16c203[_0xe4c4('0x5b')]=qs[_0xe4c4('0x54')](_[_0xe4c4('0x5c')](_0xf5aec6['query'],_0x289144['filters']));_0x16c203['where'][_0xe4c4('0x7a')]=_0x51b9a1['id'];if(_0xf5aec6[_0xe4c4('0x52')][_0xe4c4('0x5d')]){_0x16c203['where']=_['merge'](_0x16c203['where'],{'$or':_[_0xe4c4('0x4d')](_0x16c203[_0xe4c4('0x55')],function(_0x33bf97){var _0x36eb7b={};_0x36eb7b[_0x33bf97]={'$like':'%'+_0xf5aec6[_0xe4c4('0x52')]['filter']+'%'};return _0x36eb7b;})});}_0x16c203=_[_0xe4c4('0x5e')]({},_0x16c203,_0xf5aec6[_0xe4c4('0x60')]);return db[_0xe4c4('0xbf')][_0xe4c4('0x28')]({'where':_0x16c203[_0xe4c4('0x5b')]})[_0xe4c4('0x1c')](function(_0x28fbe4){_0x112034[_0xe4c4('0x28')]=_0x28fbe4;if(_0xf5aec6[_0xe4c4('0x52')][_0xe4c4('0x61')]){_0x16c203[_0xe4c4('0x62')]=[{'model':db['CmContact'],'as':_0xe4c4('0x106'),'required':![]},{'model':db[_0xe4c4('0xcc')],'as':_0xe4c4('0x107'),'attributes':[_0xe4c4('0x34'),'fullname','internal'],'required':![]},{'model':db[_0xe4c4('0x108')],'as':_0xe4c4('0x109'),'attributes':['id','name',_0xe4c4('0x10a')],'where':_0xf5aec6['query']['tag']?{'id':_0xf5aec6[_0xe4c4('0x52')]['tag']}:undefined,'required':_0xf5aec6[_0xe4c4('0x52')][_0xe4c4('0x10b')]?!![]:![]}];}return db[_0xe4c4('0xbf')][_0xe4c4('0x10c')](_0x16c203);})['then'](function(_0x159193){_0x112034[_0xe4c4('0x7b')]=_0x159193;return _0x112034;});}})[_0xe4c4('0x1c')](respondWithFilteredResult(_0x510361,_0x16c203))[_0xe4c4('0x24')](handleError(_0x510361,null));};exports[_0xe4c4('0x10d')]=function(_0x4c5d8b,_0x152415){var _0x448614=0x0;var _0x2a117c=0x0;var _0x12a8bb=![];var _0x56c6e5;var _0x23e05d;return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')]({'where':{'id':_0x4c5d8b[_0xe4c4('0x64')]['id']},'include':[{'model':db['Interval'],'as':_0xe4c4('0xb1'),'include':[{'model':db[_0xe4c4('0xb1')],'as':'Intervals','attributes':['id','interval']}]}]})['then'](handleEntityNotFound(_0x152415,null))[_0xe4c4('0x1c')](function(_0x2d4e9d){if(_0x2d4e9d){_0x56c6e5=_0x2d4e9d;return _0x2d4e9d['getProactiveActions']({'raw':!![]});}})[_0xe4c4('0x1c')](function(_0x20f141){if(_0x56c6e5){if(_0x20f141){_0x23e05d=_0x20f141;}}return require(_0xe4c4('0x8e'))['getLicense']();})[_0xe4c4('0x1c')](function(_0x11822e){if(_0x11822e){_0x2a117c=_0x11822e[_0xe4c4('0x10e')];_0x12a8bb=_0x11822e['custom'];}})[_0xe4c4('0x1c')](function(){return db[_0xe4c4('0xbf')][_0xe4c4('0x28')]({'where':{'closed':![]}});})[_0xe4c4('0x1c')](function(_0x3dfbde){_0x448614=_0x3dfbde;if(_0x2a117c&&_0x3dfbde>_0x2a117c){return db[_0xe4c4('0x10f')]['findOne']({'where':{'id':0x1}})[_0xe4c4('0x1c')](function(_0x337c98){if(_0x337c98){_0x337c98[_0xe4c4('0x110')](_0xe4c4('0x111'));}});}})[_0xe4c4('0x1c')](function(){var _0x2f0bba=_0x56c6e5['Interval'];var _0xbbf169=_0x56c6e5['timezone']||undefined;return _0x2f0bba?_0x2f0bba[_0xe4c4('0x9c')](_0xbbf169):!![];})[_0xe4c4('0x1c')](function(_0x24123b){var _0x20525b=fs[_0xe4c4('0xe3')](path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],_0xe4c4('0x112')),_0xe4c4('0xe4'));var _0x317e9c='3.13.0';var _0x49a26c=![];var _0x356750,_0xa27893;if(_0x4c5d8b[_0xe4c4('0xbc')][_0xe4c4('0x40')]){_0x356750=new URL(_0x4c5d8b[_0xe4c4('0xbc')][_0xe4c4('0x40')])['origin'];}else if(_0x4c5d8b[_0xe4c4('0xbc')][_0xe4c4('0x113')]){_0x356750=new URL(_0x4c5d8b[_0xe4c4('0xbc')][_0xe4c4('0x113')])[_0xe4c4('0x113')];}else{_0x356750=_0xe4c4('0x114');}_0xa27893=typeof _0x56c6e5[_0xe4c4('0x115')][_0xe4c4('0x67')](',')['find'](function(_0x425371){return wildcardUtils[_0xe4c4('0x116')](_0x425371,_0x356750);})!==_0xe4c4('0x26');var _0x24a913={'chatVersion':_0x317e9c,'chatWebsiteAddressOrigin':_0xa27893?_0x356750:_0x56c6e5[_0xe4c4('0x115')],'remote':_0x56c6e5[_0xe4c4('0x117')],'query':querystring[_0xe4c4('0x21')](_[_0xe4c4('0x5e')](_0x56c6e5[_0xe4c4('0x2e')]({'plain':!![]}),{'customerIp':_0x4c5d8b[_0xe4c4('0xbc')]['x-forwarded-for']||_0x4c5d8b['headers'][_0xe4c4('0x118')]||_0x4c5d8b[_0xe4c4('0x119')][_0xe4c4('0x11a')]||_0x4c5d8b['ip'],'referer':_0x4c5d8b[_0xe4c4('0xbc')]['referer'],'openedInteractions':_0x448614,'maxInteractions':_0x2a117c,'virtual':_0x12a8bb[_0xe4c4('0x10e')],'online':_0x24123b,'custom':_0x12a8bb,'address':_0xa27893?_0x356750:null}))[_0xe4c4('0x11b')](/'/g,'\x5c\x27')};_0x152415['send'](ejs[_0xe4c4('0xe5')](Mustache['render'](_0x20525b,_0x24a913),{'proactiveActions':_0x23e05d,'alignment':_0x56c6e5[_0xe4c4('0x11c')],'verticalAlignment':_0x56c6e5[_0xe4c4('0x11d')],'div_color':_0x56c6e5[_0xe4c4('0x10a')],'labelText':_0x56c6e5[_0xe4c4('0x11e')],'text_color':_0x56c6e5['textColor'],'text_button_color':_0x56c6e5[_0xe4c4('0x11f')],'button_color':_0x56c6e5[_0xe4c4('0x120')],'background_color':_0x56c6e5[_0xe4c4('0x121')],'hideWhenOffline':_0x56c6e5[_0xe4c4('0x122')],'intervalId':_0x56c6e5['IntervalId'],'isDevelopment':_0x49a26c,'chatVersion':_0x317e9c}));})['catch'](handleError(_0x152415,null));};exports['addApplications']=function(_0x126005,_0xb96ce3){var _0x2ea9db=_0x126005[_0xe4c4('0x64')]['id'];var _0x5e7645=_0x126005[_0xe4c4('0x66')];var _0x4cbd84=0xc8;var _0x5b643f=null;return db[_0xe4c4('0xf0')][_0xe4c4('0xf1')]({'isolationLevel':db['sequelize'][_0xe4c4('0x123')][_0xe4c4('0x124')][_0xe4c4('0x125')]},function(_0x1d38b5){return db[_0xe4c4('0x4e')][_0xe4c4('0x79')]({'where':{'id':_0x2ea9db},'transaction':_0x1d38b5})[_0xe4c4('0x1c')](function(_0x208072){if(_0x208072){return db['ChatApplication'][_0xe4c4('0x2d')]({'where':{'ChatWebsiteId':_0x2ea9db},'transaction':_0x1d38b5})[_0xe4c4('0x1c')](function(){var _0x4755ae=_[_0xe4c4('0x4d')](_0x5e7645,function(_0xe41510){_0xe41510['ChatWebsiteId']=_0x2ea9db;return _0xe41510;});return db[_0xe4c4('0xaf')][_0xe4c4('0xf3')](_0x4755ae,{'transaction':_0x1d38b5});});}else{_0x4cbd84=0x194;_0x5b643f=[];}});})[_0xe4c4('0x1c')](function(){if(_0x4cbd84!==0x194){return db[_0xe4c4('0xaf')][_0xe4c4('0x126')]({'where':{'ChatWebsiteId':_0x2ea9db},'order':_0xe4c4('0xb8')})[_0xe4c4('0x1c')](function(_0x5eb819){_0x5b643f=_0x5eb819;});}})['catch'](function(_0x20fda7){_0x4cbd84=0x1f4;logger[_0xe4c4('0x22')](_0x20fda7[_0xe4c4('0x33')]);if(_0x20fda7[_0xe4c4('0x34')]){delete _0x20fda7[_0xe4c4('0x34')];}_0x5b643f=_0x20fda7;})[_0xe4c4('0x127')](function(){if(_0x5b643f===null){_0xb96ce3[_0xe4c4('0x32')](_0x4cbd84);}else{if(_0x4cbd84===0x1f4){_0xb96ce3[_0xe4c4('0x25')](_0x4cbd84)[_0xe4c4('0x35')](_0x5b643f);}else{_0xb96ce3[_0xe4c4('0x25')](_0x4cbd84)[_0xe4c4('0x2b')](_0x5b643f);}}});};exports[_0xe4c4('0x128')]=function(_0xa09e1a,_0x38b6e8){var _0x12b809={};var _0x3aff06={};var _0x4cf50f;var _0x494ed6;return db['ChatWebsite']['findOne']({'where':{'id':_0xa09e1a['params']['id']}})['then'](handleEntityNotFound(_0x38b6e8,null))[_0xe4c4('0x1c')](function(_0x2bda6e){if(_0x2bda6e){_0x4cf50f=_0x2bda6e;_0x3aff06[_0xe4c4('0x47')]=_['keys'](db[_0xe4c4('0xaf')][_0xe4c4('0x4f')]);_0x3aff06[_0xe4c4('0x52')]=_[_0xe4c4('0x53')](_0xa09e1a[_0xe4c4('0x52')]);_0x3aff06['filters']=_[_0xe4c4('0x65')](_0x3aff06[_0xe4c4('0x47')],_0x3aff06['query']);_0x12b809[_0xe4c4('0x55')]=_['intersection'](_0x3aff06['model'],qs[_0xe4c4('0x56')](_0xa09e1a[_0xe4c4('0x52')][_0xe4c4('0x56')]));_0x12b809['attributes']=_0x12b809['attributes'][_0xe4c4('0x57')]?_0x12b809['attributes']:_0x3aff06['model'];_0x12b809['order']=qs[_0xe4c4('0x5a')](_0xa09e1a['query']['sort']);_0x12b809[_0xe4c4('0x5b')]=qs[_0xe4c4('0x54')](_[_0xe4c4('0x5c')](_0xa09e1a[_0xe4c4('0x52')],_0x3aff06[_0xe4c4('0x54')]));if(_0xa09e1a['query'][_0xe4c4('0x5d')]){_0x12b809[_0xe4c4('0x5b')]=_[_0xe4c4('0x5e')](_0x12b809[_0xe4c4('0x5b')],{'$or':_[_0xe4c4('0x4d')](_0x12b809['attributes'],function(_0xd23315){var _0x31a65a={};_0x31a65a[_0xd23315]={'$like':'%'+_0xa09e1a[_0xe4c4('0x52')]['filter']+'%'};return _0x31a65a;})});}_0x12b809=_['merge']({},_0x12b809,_0xa09e1a[_0xe4c4('0x60')]);return _0x4cf50f[_0xe4c4('0x128')](_0x12b809);}})[_0xe4c4('0x1c')](function(_0x2f2a4b){if(_0x2f2a4b){_0x494ed6=_0x2f2a4b[_0xe4c4('0x57')];if(!_0xa09e1a['query'][_0xe4c4('0x58')](_0xe4c4('0x80'))){_0x12b809[_0xe4c4('0x27')]=qs['limit'](_0xa09e1a[_0xe4c4('0x52')][_0xe4c4('0x27')]);_0x12b809[_0xe4c4('0x29')]=qs[_0xe4c4('0x29')](_0xa09e1a['query'][_0xe4c4('0x29')]);}return _0x4cf50f[_0xe4c4('0x128')](_0x12b809);}})[_0xe4c4('0x1c')](function(_0xe5c907){if(_0xe5c907){return _0xe5c907?{'count':_0x494ed6,'rows':_0xe5c907}:null;}})[_0xe4c4('0x1c')](respondWithResult(_0x38b6e8,null))[_0xe4c4('0x24')](handleError(_0x38b6e8,null));};exports[_0xe4c4('0x129')]=function(_0x2cb743,_0x532964){return db[_0xe4c4('0x12a')][_0xe4c4('0x6f')]({'where':{'id':_0x2cb743['params']['id']}})['then'](handleEntityNotFound(_0x532964,null))['then'](function(_0x32a888){if(_0x32a888){return _0x32a888['addProactiveActions'](_0x2cb743[_0xe4c4('0x66')][_0xe4c4('0x7d')],_[_0xe4c4('0x12b')](_0x2cb743[_0xe4c4('0x66')],[_0xe4c4('0x7d'),'id'])||{});}})[_0xe4c4('0x1c')](respondWithResult(_0x532964,null))[_0xe4c4('0x24')](handleError(_0x532964,null));};exports[_0xe4c4('0x12c')]=function(_0x5ea4a1,_0x398b00){var _0x1227c={};var _0x3169dd={};var _0x2ec4b0;var _0x20a4a6;return db['ChatWebsite'][_0xe4c4('0x79')]({'where':{'id':_0x5ea4a1[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x398b00,null))[_0xe4c4('0x1c')](function(_0x5af309){if(_0x5af309){_0x2ec4b0=_0x5af309;_0x3169dd[_0xe4c4('0x47')]=_[_0xe4c4('0x53')](db[_0xe4c4('0x12d')]['rawAttributes']);_0x3169dd['query']=_[_0xe4c4('0x53')](_0x5ea4a1[_0xe4c4('0x52')]);_0x3169dd[_0xe4c4('0x54')]=_[_0xe4c4('0x65')](_0x3169dd[_0xe4c4('0x47')],_0x3169dd[_0xe4c4('0x52')]);_0x1227c[_0xe4c4('0x55')]=_[_0xe4c4('0x65')](_0x3169dd[_0xe4c4('0x47')],qs['fields'](_0x5ea4a1[_0xe4c4('0x52')]['fields']));_0x1227c[_0xe4c4('0x55')]=_0x1227c[_0xe4c4('0x55')][_0xe4c4('0x57')]?_0x1227c['attributes']:_0x3169dd[_0xe4c4('0x47')];_0x1227c['order']=qs['sort'](_0x5ea4a1['query'][_0xe4c4('0x5a')]);_0x1227c['where']=qs[_0xe4c4('0x54')](_[_0xe4c4('0x5c')](_0x5ea4a1[_0xe4c4('0x52')],_0x3169dd['filters']));if(_0x5ea4a1['query']['filter']){_0x1227c[_0xe4c4('0x5b')]=_['merge'](_0x1227c[_0xe4c4('0x5b')],{'$or':_[_0xe4c4('0x4d')](_0x1227c[_0xe4c4('0x55')],function(_0x318271){var _0x393e92={};_0x393e92[_0x318271]={'$like':'%'+_0x5ea4a1[_0xe4c4('0x52')]['filter']+'%'};return _0x393e92;})});}_0x1227c=_['merge']({},_0x1227c,_0x5ea4a1['options']);return _0x2ec4b0['getProactiveActions'](_0x1227c);}})[_0xe4c4('0x1c')](function(_0x157422){if(_0x157422){_0x20a4a6=_0x157422[_0xe4c4('0x57')];if(!_0x5ea4a1['query'][_0xe4c4('0x58')](_0xe4c4('0x80'))){_0x1227c[_0xe4c4('0x27')]=qs[_0xe4c4('0x27')](_0x5ea4a1[_0xe4c4('0x52')]['limit']);_0x1227c[_0xe4c4('0x29')]=qs['offset'](_0x5ea4a1[_0xe4c4('0x52')][_0xe4c4('0x29')]);}return _0x2ec4b0[_0xe4c4('0x12c')](_0x1227c);}})[_0xe4c4('0x1c')](function(_0x19985e){if(_0x19985e){return _0x19985e?{'count':_0x20a4a6,'rows':_0x19985e}:null;}})[_0xe4c4('0x1c')](respondWithResult(_0x398b00,null))[_0xe4c4('0x24')](handleError(_0x398b00,null));};exports['getFields']=function(_0x163d02,_0x214f2c){var _0x409b67=_0x163d02[_0xe4c4('0x52')]['online']===_0xe4c4('0x12e')?'offlineForm':_0xe4c4('0x12f');return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')]({'attributes':['id',_0x409b67],'where':{'id':_0x163d02['params']['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x214f2c,null))['then'](function(_0x57c62a){if(_0x57c62a){var _0x5369cf=_0x57c62a[_0x409b67];var _0x37e72d=_0x5369cf&&_0x5369cf[_0xe4c4('0x130')]?_0x5369cf[_0xe4c4('0x130')]:[];_0x214f2c[_0xe4c4('0x35')]({'fromKey':_[_0xe4c4('0x96')](_0x5369cf[_0xe4c4('0x131')])?undefined:_0x5369cf[_0xe4c4('0x131')],'count':_0x37e72d[_0xe4c4('0x57')],'rows':_0x37e72d});}})[_0xe4c4('0x24')](handleError(_0x214f2c,null));};exports[_0xe4c4('0x132')]=function(_0x481af5,_0x6536c0){var _0x41b65a={'raw':![],'where':{}};var _0x3082={};var _0x10aaa={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe4c4('0x79')]({'where':{'id':_0x481af5[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x6536c0,null))[_0xe4c4('0x1c')](function(_0x4cfffa){if(_0x4cfffa){_0x3082[_0xe4c4('0x47')]=_['keys'](db['ChatOfflineMessage'][_0xe4c4('0x4f')]);_0x3082[_0xe4c4('0x52')]=_['keys'](_0x481af5[_0xe4c4('0x52')]);_0x3082[_0xe4c4('0x54')]=_[_0xe4c4('0x65')](_0x3082[_0xe4c4('0x47')],_0x3082[_0xe4c4('0x52')]);_0x41b65a[_0xe4c4('0x55')]=_[_0xe4c4('0x65')](_0x3082[_0xe4c4('0x47')],qs[_0xe4c4('0x56')](_0x481af5['query']['fields']));_0x41b65a['attributes']=_0x41b65a[_0xe4c4('0x55')][_0xe4c4('0x57')]?_0x41b65a[_0xe4c4('0x55')]:_0x3082[_0xe4c4('0x47')];if(!_0x481af5['query'][_0xe4c4('0x58')](_0xe4c4('0x80'))){_0x41b65a['limit']=qs[_0xe4c4('0x27')](_0x481af5[_0xe4c4('0x52')][_0xe4c4('0x27')]);_0x41b65a['offset']=qs[_0xe4c4('0x29')](_0x481af5[_0xe4c4('0x52')][_0xe4c4('0x29')]);}_0x41b65a[_0xe4c4('0x59')]=qs['sort'](_0x481af5[_0xe4c4('0x52')][_0xe4c4('0x5a')]);_0x41b65a[_0xe4c4('0x5b')]=qs[_0xe4c4('0x54')](_[_0xe4c4('0x5c')](_0x481af5[_0xe4c4('0x52')],_0x3082[_0xe4c4('0x54')]));_0x41b65a[_0xe4c4('0x5b')][_0xe4c4('0x7a')]=_0x4cfffa['id'];if(_0x481af5[_0xe4c4('0x52')][_0xe4c4('0x5d')]){_0x41b65a[_0xe4c4('0x5b')]=_['merge'](_0x41b65a[_0xe4c4('0x5b')],{'$or':_[_0xe4c4('0x4d')](_0x41b65a[_0xe4c4('0x55')],function(_0x41f839){var _0x4d79b2={};_0x4d79b2[_0x41f839]={'$like':'%'+_0x481af5[_0xe4c4('0x52')][_0xe4c4('0x5d')]+'%'};return _0x4d79b2;})});}_0x41b65a=_[_0xe4c4('0x5e')]({},_0x41b65a,_0x481af5[_0xe4c4('0x60')]);return db[_0xe4c4('0xe7')][_0xe4c4('0x28')]({'where':_0x41b65a[_0xe4c4('0x5b')]})[_0xe4c4('0x1c')](function(_0x153150){_0x10aaa[_0xe4c4('0x28')]=_0x153150;if(_0x481af5[_0xe4c4('0x52')][_0xe4c4('0x61')]){_0x41b65a[_0xe4c4('0x62')]=[{'all':!![]}];}else{_0x41b65a['include']=[{'model':db[_0xe4c4('0xa3')],'as':_0xe4c4('0x106'),'required':![]},{'model':db[_0xe4c4('0xf2')],'as':_0xe4c4('0x133'),'required':![]}];}return db[_0xe4c4('0xe7')][_0xe4c4('0x10c')](_0x41b65a);})[_0xe4c4('0x1c')](function(_0x35e938){_0x10aaa[_0xe4c4('0x7b')]=_0x35e938;return _0x10aaa;});}})[_0xe4c4('0x1c')](respondWithFilteredResult(_0x6536c0,_0x41b65a))[_0xe4c4('0x24')](handleError(_0x6536c0,null));};exports['addAgents']=function(_0x256ef6,_0x392ae0){return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')]({'where':{'id':_0x256ef6['params']['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x392ae0,null))[_0xe4c4('0x1c')](function(_0x34167a){if(_0x34167a){return _0x34167a[_0xe4c4('0x134')](_0x256ef6[_0xe4c4('0x66')]['ids'],_['omit'](_0x256ef6['body'],[_0xe4c4('0x7d'),'id'])||{})[_0xe4c4('0xe2')](function(_0x1be484){for(var _0x307beb=0x0;_0x307beb<_0x256ef6['body'][_0xe4c4('0x7d')]['length'];_0x307beb+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x256ef6['body'][_0xe4c4('0x7d')][_0x307beb]),'ChatWebsiteId':Number(_0x256ef6[_0xe4c4('0x64')]['id'])});}return _0x1be484;});}})[_0xe4c4('0x1c')](respondWithResult(_0x392ae0,null))[_0xe4c4('0x24')](handleError(_0x392ae0,null));};exports[_0xe4c4('0x135')]=function(_0x443ddb,_0x701cee){return db['ChatWebsite'][_0xe4c4('0x6f')]({'where':{'id':_0x443ddb[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x701cee,null))[_0xe4c4('0x1c')](function(_0x592bdc){if(_0x592bdc){return _0x592bdc[_0xe4c4('0x135')](_0x443ddb[_0xe4c4('0x52')][_0xe4c4('0x7d')])['then'](function(){if(_[_0xe4c4('0x136')](_0x443ddb[_0xe4c4('0x52')][_0xe4c4('0x7d')])){for(var _0x2d0d03=0x0;_0x2d0d03<_0x443ddb['query']['ids'][_0xe4c4('0x57')];_0x2d0d03+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x443ddb['query']['ids'][_0x2d0d03]),'ChatWebsiteId':Number(_0x443ddb[_0xe4c4('0x64')]['id'])});}}else{socket[_0xe4c4('0x137')]('userChatWebsite:remove',{'UserId':Number(_0x443ddb[_0xe4c4('0x52')][_0xe4c4('0x7d')]),'ChatWebsiteId':Number(_0x443ddb['params']['id'])});}});}})[_0xe4c4('0x1c')](respondWithStatusCode(_0x701cee,null))[_0xe4c4('0x24')](handleError(_0x701cee,null));};exports[_0xe4c4('0x138')]=function(_0x7a58c6,_0x530584){var _0x2e66c1={};var _0x36660e={};var _0x560404;var _0x49af45;return db[_0xe4c4('0x4e')][_0xe4c4('0x79')]({'where':{'id':_0x7a58c6[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x530584,null))[_0xe4c4('0x1c')](function(_0x4fdbb3){if(_0x4fdbb3){_0x560404=_0x4fdbb3;_0x36660e[_0xe4c4('0x47')]=_[_0xe4c4('0x53')](db[_0xe4c4('0xcc')][_0xe4c4('0x4f')]);_0x36660e[_0xe4c4('0x52')]=_[_0xe4c4('0x53')](_0x7a58c6[_0xe4c4('0x52')]);_0x36660e['filters']=_['intersection'](_0x36660e[_0xe4c4('0x47')],_0x36660e[_0xe4c4('0x52')]);_0x2e66c1[_0xe4c4('0x55')]=_[_0xe4c4('0x65')](_0x36660e['model'],qs[_0xe4c4('0x56')](_0x7a58c6[_0xe4c4('0x52')][_0xe4c4('0x56')]));_0x2e66c1['attributes']=_0x2e66c1['attributes']['length']?_0x2e66c1[_0xe4c4('0x55')]:_0x36660e[_0xe4c4('0x47')];_0x2e66c1[_0xe4c4('0x59')]=qs[_0xe4c4('0x5a')](_0x7a58c6[_0xe4c4('0x52')][_0xe4c4('0x5a')]);_0x2e66c1[_0xe4c4('0x5b')]=qs[_0xe4c4('0x54')](_[_0xe4c4('0x5c')](_0x7a58c6['query'],_0x36660e[_0xe4c4('0x54')]));if(_0x7a58c6[_0xe4c4('0x52')][_0xe4c4('0x5d')]){_0x2e66c1[_0xe4c4('0x5b')]=_['merge'](_0x2e66c1['where'],{'$or':_['map'](_0x2e66c1[_0xe4c4('0x55')],function(_0x30c149){var _0x1ab071={};_0x1ab071[_0x30c149]={'$like':'%'+_0x7a58c6[_0xe4c4('0x52')][_0xe4c4('0x5d')]+'%'};return _0x1ab071;})});}_0x2e66c1=_[_0xe4c4('0x5e')]({},_0x2e66c1,_0x7a58c6['options']);return _0x560404[_0xe4c4('0x138')](_0x2e66c1);}})['then'](function(_0x5e01f9){if(_0x5e01f9){_0x49af45=_0x5e01f9[_0xe4c4('0x57')];if(!_0x7a58c6[_0xe4c4('0x52')][_0xe4c4('0x58')]('nolimit')){_0x2e66c1[_0xe4c4('0x27')]=qs[_0xe4c4('0x27')](_0x7a58c6[_0xe4c4('0x52')][_0xe4c4('0x27')]);_0x2e66c1[_0xe4c4('0x29')]=qs[_0xe4c4('0x29')](_0x7a58c6['query'][_0xe4c4('0x29')]);}return _0x560404[_0xe4c4('0x138')](_0x2e66c1);}})[_0xe4c4('0x1c')](function(_0x405627){if(_0x405627){return _0x405627?{'count':_0x49af45,'rows':_0x405627}:null;}})['then'](respondWithResult(_0x530584,null))['catch'](handleError(_0x530584,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 6553e18..1d3930f 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 _0x207c=['hook','exports','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0x207c,0x1e8));var _0xc207=function(_0x3fbb91,_0x5ec106){_0x3fbb91=_0x3fbb91-0x0;var _0x3eb213=_0x207c[_0x3fbb91];return _0x3eb213;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xc207('0x0'))['db'][_0xc207('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xc207('0x2')](0x0);var events={'afterCreate':_0xc207('0x3'),'afterUpdate':_0xc207('0x4'),'afterDestroy':_0xc207('0x5')};function emitEvent(_0x1dd107){return function(_0x4b9daa,_0x38ff02,_0x59bc89){ChatWebsiteEvents['emit'](_0x1dd107+':'+_0x4b9daa['id'],_0x4b9daa);ChatWebsiteEvents['emit'](_0x1dd107,_0x4b9daa);_0x59bc89(null);};}for(var e in events){if(events[_0xc207('0x6')](e)){var event=events[e];ChatWebsite[_0xc207('0x7')](e,emitEvent(event));}}module[_0xc207('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x861c=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x56d9b5,_0x1db06e){var _0x24829b=function(_0x19e839){while(--_0x19e839){_0x56d9b5['push'](_0x56d9b5['shift']());}};_0x24829b(++_0x1db06e);}(_0x861c,0xdb));var _0xc861=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x861c[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0xc861('0x0'));var ChatWebsite=require(_0xc861('0x1'))['db'][_0xc861('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xc861('0x3')](0x0);var events={'afterCreate':_0xc861('0x4'),'afterUpdate':_0xc861('0x5'),'afterDestroy':_0xc861('0x6')};function emitEvent(_0x683b83){return function(_0x28ed01,_0xc70070,_0x2690f9){ChatWebsiteEvents[_0xc861('0x7')](_0x683b83+':'+_0x28ed01['id'],_0x28ed01);ChatWebsiteEvents['emit'](_0x683b83,_0x28ed01);_0x2690f9(null);};}for(var e in events){if(events[_0xc861('0x8')](e)){var event=events[e];ChatWebsite[_0xc861('0x9')](e,emitEvent(event));}}module[_0xc861('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index e297a02..550b93c 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 _0xaa82=['chat_websites','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xaa82,0x1e1));var _0x2aa8=function(_0x59afc0,_0x5d46b9){_0x59afc0=_0x59afc0-0x0;var _0x2d4e1a=_0xaa82[_0x59afc0];return _0x2d4e1a;};'use strict';var _=require(_0x2aa8('0x0'));var util=require('util');var logger=require(_0x2aa8('0x1'))(_0x2aa8('0x2'));var moment=require(_0x2aa8('0x3'));var BPromise=require('bluebird');var rp=require(_0x2aa8('0x4'));var fs=require('fs');var path=require(_0x2aa8('0x5'));var rimraf=require(_0x2aa8('0x6'));var config=require(_0x2aa8('0x7'));var attributes=require(_0x2aa8('0x8'));module[_0x2aa8('0x9')]=function(_0xbb176d,_0x32ba0e){return _0xbb176d[_0x2aa8('0xa')]('ChatWebsite',attributes,{'tableName':_0x2aa8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x895b=['exports','define','ChatWebsite','chat_websites','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x47bcbc,_0x4edd2a){var _0x29421a=function(_0x20e70f){while(--_0x20e70f){_0x47bcbc['push'](_0x47bcbc['shift']());}};_0x29421a(++_0x4edd2a);}(_0x895b,0x138));var _0xb895=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x895b[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xb895('0x0'));var util=require(_0xb895('0x1'));var logger=require('../../config/logger')(_0xb895('0x2'));var moment=require(_0xb895('0x3'));var BPromise=require('bluebird');var rp=require(_0xb895('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb895('0x5'));var config=require(_0xb895('0x6'));var attributes=require('./chatWebsite.attributes');module[_0xb895('0x7')]=function(_0x2af6d8,_0x1f18bd){return _0x2af6d8[_0xb895('0x8')](_0xb895('0x9'),attributes,{'tableName':_0xb895('0xa'),'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 ab25ae3..83c9b4a 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 _0x02a7=['jayson/promise','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','lodash','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x1ab60d,_0x4a4260){var _0x3c52b8=function(_0x3d1e7b){while(--_0x3d1e7b){_0x1ab60d['push'](_0x1ab60d['shift']());}};_0x3c52b8(++_0x4a4260);}(_0x02a7,0x16a));var _0x702a=function(_0x4b85de,_0x137569){_0x4b85de=_0x4b85de-0x0;var _0x1df244=_0x02a7[_0x4b85de];return _0x1df244;};'use strict';var _=require(_0x702a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x702a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x702a('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x702a('0x3'))(_0x702a('0x4'));var config=require(_0x702a('0x5'));var jayson=require(_0x702a('0x6'));var client=jayson['client'][_0x702a('0x7')]({'port':0x232a});config[_0x702a('0x8')]=_[_0x702a('0x9')](config[_0x702a('0x8')],{'host':_0x702a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x702a('0x8')]));require(_0x702a('0xb'))[_0x702a('0xc')](socket);function respondWithRpcPromise(_0x2feb13,_0x1015ba,_0x508601){return new BPromise(function(_0x241c4b,_0x2fa187){return client[_0x702a('0xd')](_0x2feb13,_0x508601)[_0x702a('0xe')](function(_0xb29ae4){logger['info'](_0x702a('0xf'),_0x1015ba,_0x702a('0x10'));logger[_0x702a('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1015ba,_0x702a('0x10'),JSON['stringify'](_0xb29ae4));if(_0xb29ae4[_0x702a('0x12')]){if(_0xb29ae4[_0x702a('0x12')]['code']===0x1f4){logger[_0x702a('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x1015ba,_0xb29ae4[_0x702a('0x12')]['message']);return _0x2fa187(_0xb29ae4[_0x702a('0x12')][_0x702a('0x13')]);}logger[_0x702a('0x12')](_0x702a('0xf'),_0x1015ba,_0xb29ae4['error'][_0x702a('0x13')]);return _0x241c4b(_0xb29ae4['error'][_0x702a('0x13')]);}else{logger[_0x702a('0x14')](_0x702a('0xf'),_0x1015ba,_0x702a('0x10'));_0x241c4b(_0xb29ae4[_0x702a('0x15')][_0x702a('0x13')]);}})[_0x702a('0x16')](function(_0x4235c9){logger['error'](_0x702a('0xf'),_0x1015ba,_0x4235c9);_0x2fa187(_0x4235c9);});});}
\ No newline at end of file
+var _0x9f4e=['request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s'];(function(_0x2c5505,_0x2a7c7a){var _0x331581=function(_0xeb7147){while(--_0xeb7147){_0x2c5505['push'](_0x2c5505['shift']());}};_0x331581(++_0x2a7c7a);}(_0x9f4e,0x1d1));var _0xe9f4=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x9f4e[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0xe9f4('0x0'));var util=require(_0xe9f4('0x1'));var moment=require(_0xe9f4('0x2'));var BPromise=require(_0xe9f4('0x3'));var rs=require(_0xe9f4('0x4'));var fs=require('fs');var Redis=require(_0xe9f4('0x5'));var db=require(_0xe9f4('0x6'))['db'];var utils=require(_0xe9f4('0x7'));var logger=require(_0xe9f4('0x8'))('rpc');var config=require(_0xe9f4('0x9'));var jayson=require(_0xe9f4('0xa'));var client=jayson[_0xe9f4('0xb')]['http']({'port':0x232a});config[_0xe9f4('0xc')]=_[_0xe9f4('0xd')](config[_0xe9f4('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe9f4('0xe'))(new Redis(config[_0xe9f4('0xc')]));require(_0xe9f4('0xf'))[_0xe9f4('0x10')](socket);function respondWithRpcPromise(_0x402d8d,_0x322378,_0x16fb3f){return new BPromise(function(_0xf9140e,_0x28e29c){return client[_0xe9f4('0x11')](_0x402d8d,_0x16fb3f)[_0xe9f4('0x12')](function(_0xe8939f){logger[_0xe9f4('0x13')](_0xe9f4('0x14'),_0x322378,_0xe9f4('0x15'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x322378,'request\x20sent',JSON[_0xe9f4('0x16')](_0xe8939f));if(_0xe8939f[_0xe9f4('0x17')]){if(_0xe8939f[_0xe9f4('0x17')][_0xe9f4('0x18')]===0x1f4){logger[_0xe9f4('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x322378,_0xe8939f[_0xe9f4('0x17')]['message']);return _0x28e29c(_0xe8939f['error'][_0xe9f4('0x19')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x322378,_0xe8939f[_0xe9f4('0x17')]['message']);return _0xf9140e(_0xe8939f[_0xe9f4('0x17')]['message']);}else{logger[_0xe9f4('0x13')](_0xe9f4('0x14'),_0x322378,_0xe9f4('0x15'));_0xf9140e(_0xe8939f[_0xe9f4('0x1a')][_0xe9f4('0x19')]);}})['catch'](function(_0x1e3bb2){logger[_0xe9f4('0x17')](_0xe9f4('0x14'),_0x322378,_0x1e3bb2);_0x28e29c(_0x1e3bb2);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index cccf068..3808d92 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 _0xb320=['emit','removeListener','register','length','./chatWebsite.events','save','remove','update'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb320,0x1ac));var _0x0b32=function(_0x56a871,_0x18b7fe){_0x56a871=_0x56a871-0x0;var _0x124954=_0xb320[_0x56a871];return _0x124954;};'use strict';var ChatWebsiteEvents=require(_0x0b32('0x0'));var events=[_0x0b32('0x1'),_0x0b32('0x2'),_0x0b32('0x3')];function createListener(_0x41bcb6,_0x216b4f){return function(_0x3e6582){_0x216b4f[_0x0b32('0x4')](_0x41bcb6,_0x3e6582);};}function removeListener(_0x4338d9,_0x44c23b){return function(){ChatWebsiteEvents[_0x0b32('0x5')](_0x4338d9,_0x44c23b);};}exports[_0x0b32('0x6')]=function(_0x58842c){for(var _0x2c589f=0x0,_0x57b62e=events[_0x0b32('0x7')];_0x2c589f<_0x57b62e;_0x2c589f++){var _0x4636c6=events[_0x2c589f];var _0x396340=createListener('chatWebsite:'+_0x4636c6,_0x58842c);ChatWebsiteEvents['on'](_0x4636c6,_0x396340);}};
\ No newline at end of file
+var _0x4777=['./chatWebsite.events','remove','update','emit','removeListener','register','length'];(function(_0x4023e2,_0xd2597d){var _0x347129=function(_0x4db2fc){while(--_0x4db2fc){_0x4023e2['push'](_0x4023e2['shift']());}};_0x347129(++_0xd2597d);}(_0x4777,0x15e));var _0x7477=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0x4777[_0x31a576];return _0x30b1d3;};'use strict';var ChatWebsiteEvents=require(_0x7477('0x0'));var events=['save',_0x7477('0x1'),_0x7477('0x2')];function createListener(_0x75a8bb,_0x496a2d){return function(_0x543437){_0x496a2d[_0x7477('0x3')](_0x75a8bb,_0x543437);};}function removeListener(_0x53ac44,_0x5f1aa2){return function(){ChatWebsiteEvents[_0x7477('0x4')](_0x53ac44,_0x5f1aa2);};}exports[_0x7477('0x5')]=function(_0xec1a4e){for(var _0x1667e1=0x0,_0x2c979d=events[_0x7477('0x6')];_0x1667e1<_0x2c979d;_0x1667e1++){var _0x258e5b=events[_0x1667e1];var _0x5afc82=createListener('chatWebsite:'+_0x258e5b,_0xec1a4e);ChatWebsiteEvents['on'](_0x258e5b,_0x5afc82);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index 657bde9..fcdef75 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb422=['([\x5cw]+)','URL','replace','trim'];(function(_0x46567b,_0x3445e9){var _0x496280=function(_0xedacf2){while(--_0xedacf2){_0x46567b['push'](_0x46567b['shift']());}};_0x496280(++_0x3445e9);}(_0xb422,0x85));var _0x2b42=function(_0x1b1604,_0x368535){_0x1b1604=_0x1b1604-0x0;var _0x57918d=_0xb422[_0x1b1604];return _0x57918d;};var escapeRegExp=require('../../../utils/misc')['escapeRegExp'];var URL=require('url')[_0x2b42('0x0')];function testWildcardValidity(_0x5df79b){var _0x51ff45=!![];try{new URL(_0x5df79b[_0x2b42('0x1')]('*','localhost'));}catch(_0x14330f){_0x51ff45=![];}return _0x51ff45&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0x5df79b);}function testWebsiteWithWildcard(_0x1b469f,_0x5d0f67){var _0x406d93;var _0x1a0fbe=escapeRegExp(_0x1b469f[_0x2b42('0x2')]()['replace'](/\/$/,''))[_0x2b42('0x1')]('\x5c*',_0x2b42('0x3'));try{new URL(_0x1b469f[_0x2b42('0x1')]('\x5c*','localhost'));_0x406d93=new RegExp(_0x1a0fbe)['test'](_0x5d0f67);}catch(_0x4174e8){_0x406d93=![];}return _0x406d93;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x524e=['replace','localhost','test','trim','([\x5cw]+)','exports','url','URL'];(function(_0xcf4ad9,_0x3a0633){var _0x17e368=function(_0x3a6448){while(--_0x3a6448){_0xcf4ad9['push'](_0xcf4ad9['shift']());}};_0x17e368(++_0x3a0633);}(_0x524e,0x15e));var _0xe524=function(_0x4d874e,_0x453c11){_0x4d874e=_0x4d874e-0x0;var _0x280e26=_0x524e[_0x4d874e];return _0x280e26;};var escapeRegExp=require('../../../utils/misc')['escapeRegExp'];var URL=require(_0xe524('0x0'))[_0xe524('0x1')];function testWildcardValidity(_0xc5f6b5){var _0x29e619=!![];try{new URL(_0xc5f6b5[_0xe524('0x2')]('*',_0xe524('0x3')));}catch(_0xabd694){_0x29e619=![];}return _0x29e619&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xe524('0x4')](_0xc5f6b5);}function testWebsiteWithWildcard(_0x10d37a,_0x110cff){var _0x4f75d6;var _0xaaeaa9=escapeRegExp(_0x10d37a[_0xe524('0x5')]()[_0xe524('0x2')](/\/$/,''))['replace']('\x5c*',_0xe524('0x6'));try{new URL(_0x10d37a[_0xe524('0x2')]('\x5c*',_0xe524('0x3')));_0x4f75d6=new RegExp(_0xaaeaa9)[_0xe524('0x4')](_0x110cff);}catch(_0x991924){_0x4f75d6=![];}return _0x4f75d6;}module[_0xe524('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 2ea176b..01142f0 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 _0x0fde=['/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','diskStorage','join','root','format','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','file','addSystemAvatar','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','/:id/applications','addProactiveActions','addAgents','put','update','delete','/:id','removeDispositions','/:id/canned_answers','removeAgents','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','/describe','describe','getDispositions','getAnswers','getLogo','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages'];(function(_0x8ce506,_0x517f30){var _0x23c8e5=function(_0x1d048e){while(--_0x1d048e){_0x8ce506['push'](_0x8ce506['shift']());}};_0x23c8e5(++_0x517f30);}(_0x0fde,0x64));var _0xe0fd=function(_0x16ac66,_0x5d6dc3){_0x16ac66=_0x16ac66-0x0;var _0x32e972=_0x0fde[_0x16ac66];return _0x32e972;};'use strict';var multer=require(_0xe0fd('0x0'));var util=require(_0xe0fd('0x1'));var path=require(_0xe0fd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe0fd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe0fd('0x4'));var interaction=require(_0xe0fd('0x5'));var config=require('../../config/environment');var controller=require(_0xe0fd('0x6'));router[_0xe0fd('0x7')]('/',auth[_0xe0fd('0x8')](),controller['index']);router['get'](_0xe0fd('0x9'),auth[_0xe0fd('0x8')](),controller[_0xe0fd('0xa')]);router[_0xe0fd('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/dispositions',auth[_0xe0fd('0x8')](),controller[_0xe0fd('0xb')]);router[_0xe0fd('0x7')]('/:id/canned_answers',auth[_0xe0fd('0x8')](),controller[_0xe0fd('0xc')]);router[_0xe0fd('0x7')]('/:id/logo',controller[_0xe0fd('0xd')]);router[_0xe0fd('0x7')]('/:id/avatar',controller[_0xe0fd('0xe')]);router['get']('/:id/customer_avatar',controller[_0xe0fd('0xf')]);router[_0xe0fd('0x7')](_0xe0fd('0x10'),controller[_0xe0fd('0x11')]);router[_0xe0fd('0x7')](_0xe0fd('0x12'),auth[_0xe0fd('0x8')](),controller['getInteractions']);router[_0xe0fd('0x7')](_0xe0fd('0x13'),controller[_0xe0fd('0x14')]);router[_0xe0fd('0x7')]('/:id/applications',auth[_0xe0fd('0x8')](),controller[_0xe0fd('0x15')]);router[_0xe0fd('0x7')](_0xe0fd('0x16'),auth[_0xe0fd('0x8')](),controller[_0xe0fd('0x17')]);router[_0xe0fd('0x7')]('/:id/fields',controller[_0xe0fd('0x18')]);router[_0xe0fd('0x7')]('/:id/offline_messages',auth[_0xe0fd('0x8')](),controller[_0xe0fd('0x19')]);router[_0xe0fd('0x7')](_0xe0fd('0x1a'),auth[_0xe0fd('0x8')](),controller[_0xe0fd('0x1b')]);router[_0xe0fd('0x1c')]('/',auth[_0xe0fd('0x8')](),controller[_0xe0fd('0x1d')]);router['post'](_0xe0fd('0x1e'),auth[_0xe0fd('0x8')](),controller[_0xe0fd('0x1f')]);router[_0xe0fd('0x1c')]('/:id/canned_answers',auth[_0xe0fd('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xe0fd('0x20')]({'destination':function(_0x4dad24,_0x359974,_0x344d1c){_0x344d1c(null,path[_0xe0fd('0x21')](config[_0xe0fd('0x22')],'server/files/images/logos/'));},'filename':function(_0x3e3580,_0x2acfec,_0x560bd6){_0x560bd6(null,util[_0xe0fd('0x23')](_0xe0fd('0x24'),Date[_0xe0fd('0x25')](),_0x2acfec[_0xe0fd('0x26')]));}})});router[_0xe0fd('0x1c')]('/:id/logo',upload[_0xe0fd('0x27')]('file'),controller[_0xe0fd('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x136d7a,_0x1d3bb0,_0x17baec){_0x17baec(null,path[_0xe0fd('0x21')](config[_0xe0fd('0x22')],_0xe0fd('0x29')));},'filename':function(_0xc70ed3,_0x4e28be,_0x508102){_0x508102(null,util[_0xe0fd('0x23')]('%s-%s',Date['now'](),_0x4e28be[_0xe0fd('0x26')]));}})});router['post']('/:id/avatar',upload[_0xe0fd('0x27')](_0xe0fd('0x2a')),controller['addAvatar']);var upload=multer({'storage':multer[_0xe0fd('0x20')]({'destination':function(_0x11ed49,_0x3449aa,_0x5e8326){_0x5e8326(null,path[_0xe0fd('0x21')](config['root'],_0xe0fd('0x29')));},'filename':function(_0x109067,_0x711661,_0x45b4cb){_0x45b4cb(null,util[_0xe0fd('0x23')]('%s-%s',Date[_0xe0fd('0x25')](),_0x711661['originalname']));}})});router[_0xe0fd('0x1c')]('/:id/customer_avatar',upload[_0xe0fd('0x27')](_0xe0fd('0x2a')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xe0fd('0x20')]({'destination':function(_0x576f18,_0x1b054f,_0x4b80d8){_0x4b80d8(null,path['join'](config['root'],_0xe0fd('0x29')));},'filename':function(_0x18e2a3,_0x4f1434,_0xa62c0a){_0xa62c0a(null,util[_0xe0fd('0x23')](_0xe0fd('0x24'),Date[_0xe0fd('0x25')](),_0x4f1434[_0xe0fd('0x26')]));}})});router[_0xe0fd('0x1c')](_0xe0fd('0x10'),upload[_0xe0fd('0x27')](_0xe0fd('0x2a')),controller[_0xe0fd('0x2b')]);router['post']('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xe0fd('0x20')]({'destination':function(_0x3e578b,_0x3d399e,_0x29aab5){const _0x302883=path['join'](config[_0xe0fd('0x22')],'server/files',_0xe0fd('0x2c'),_0xe0fd('0x2d'));fs_extra[_0xe0fd('0x2e')](_0x302883,function(){_0x29aab5(null,_0x302883);});},'filename':function(_0x1ca3c7,_0x34ee7c,_0x11d341){const _0x46f69b=_0x34ee7c[_0xe0fd('0x26')][_0xe0fd('0x2f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x76388a=path[_0xe0fd('0x30')](_0x46f69b);const _0x31a400=Date['now']()+'-'+_0x46f69b[_0xe0fd('0x2f')](_0x76388a,'')+_0x76388a;_0x11d341(null,_0x31a400);}})});router['post'](_0xe0fd('0x31'),offlineUploadMulter[_0xe0fd('0x32')](),controller[_0xe0fd('0x33')]);router['post'](_0xe0fd('0x12'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xe0fd('0x1c')](_0xe0fd('0x34'),auth[_0xe0fd('0x8')](),controller['addApplications']);router['post'](_0xe0fd('0x16'),auth['isAuthenticated'](),controller[_0xe0fd('0x35')]);router[_0xe0fd('0x1c')]('/:id/users',auth[_0xe0fd('0x8')](),controller[_0xe0fd('0x36')]);router[_0xe0fd('0x37')]('/:id',auth[_0xe0fd('0x8')](),controller[_0xe0fd('0x38')]);router[_0xe0fd('0x39')](_0xe0fd('0x3a'),auth[_0xe0fd('0x8')](),controller['destroy']);router[_0xe0fd('0x39')](_0xe0fd('0x1e'),auth[_0xe0fd('0x8')](),controller[_0xe0fd('0x3b')]);router[_0xe0fd('0x39')](_0xe0fd('0x3c'),auth[_0xe0fd('0x8')](),controller['removeAnswers']);router[_0xe0fd('0x39')](_0xe0fd('0x1a'),auth[_0xe0fd('0x8')](),controller[_0xe0fd('0x3d')]);module[_0xe0fd('0x3e')]=router;
\ No newline at end of file
+var _0xdeec=['format','%s-%s','originalname','single','diskStorage','root','server/files/images/avatars/','now','file','addCustomerAvatar','/:id/system_avatar','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','/:id/proactive_actions','addAgents','put','/:id','update','delete','destroy','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','isAuthenticated','get','describe','show','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','getInteractions','/:id/snippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','join'];(function(_0x1b5a05,_0x2c80de){var _0x347931=function(_0xd39454){while(--_0xd39454){_0x1b5a05['push'](_0x1b5a05['shift']());}};_0x347931(++_0x2c80de);}(_0xdeec,0xf0));var _0xcdee=function(_0x1d3ff1,_0x56d009){_0x1d3ff1=_0x1d3ff1-0x0;var _0x5a0a4a=_0xdeec[_0x1d3ff1];return _0x5a0a4a;};'use strict';var multer=require('multer');var util=require(_0xcdee('0x0'));var path=require(_0xcdee('0x1'));var timeout=require(_0xcdee('0x2'));var express=require(_0xcdee('0x3'));var router=express[_0xcdee('0x4')]();var fs_extra=require(_0xcdee('0x5'));var auth=require(_0xcdee('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcdee('0x7'));var controller=require(_0xcdee('0x8'));router['get']('/',auth[_0xcdee('0x9')](),controller['index']);router[_0xcdee('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xcdee('0xb')]);router[_0xcdee('0xa')]('/:id',auth[_0xcdee('0x9')](),controller[_0xcdee('0xc')]);router[_0xcdee('0xa')](_0xcdee('0xd'),auth[_0xcdee('0x9')](),controller['getDispositions']);router[_0xcdee('0xa')](_0xcdee('0xe'),auth[_0xcdee('0x9')](),controller['getAnswers']);router[_0xcdee('0xa')](_0xcdee('0xf'),controller[_0xcdee('0x10')]);router[_0xcdee('0xa')](_0xcdee('0x11'),controller[_0xcdee('0x12')]);router[_0xcdee('0xa')](_0xcdee('0x13'),controller[_0xcdee('0x14')]);router[_0xcdee('0xa')]('/:id/system_avatar',controller[_0xcdee('0x15')]);router[_0xcdee('0xa')]('/:id/interactions',auth[_0xcdee('0x9')](),controller[_0xcdee('0x16')]);router['get'](_0xcdee('0x17'),controller['getSnippet']);router[_0xcdee('0xa')](_0xcdee('0x18'),auth[_0xcdee('0x9')](),controller[_0xcdee('0x19')]);router['get']('/:id/proactive_actions',auth[_0xcdee('0x9')](),controller[_0xcdee('0x1a')]);router[_0xcdee('0xa')]('/:id/fields',controller[_0xcdee('0x1b')]);router[_0xcdee('0xa')](_0xcdee('0x1c'),auth[_0xcdee('0x9')](),controller[_0xcdee('0x1d')]);router[_0xcdee('0xa')](_0xcdee('0x1e'),auth['isAuthenticated'](),controller[_0xcdee('0x1f')]);router['post']('/',auth[_0xcdee('0x9')](),controller[_0xcdee('0x20')]);router[_0xcdee('0x21')](_0xcdee('0xd'),auth[_0xcdee('0x9')](),controller[_0xcdee('0x22')]);router[_0xcdee('0x21')](_0xcdee('0xe'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f97b6,_0x3383e9,_0x398d96){_0x398d96(null,path[_0xcdee('0x23')](config['root'],'server/files/images/logos/'));},'filename':function(_0xaaceb0,_0x2d82fd,_0x4c5b82){_0x4c5b82(null,util[_0xcdee('0x24')](_0xcdee('0x25'),Date['now'](),_0x2d82fd[_0xcdee('0x26')]));}})});router['post']('/:id/logo',upload[_0xcdee('0x27')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xcdee('0x28')]({'destination':function(_0x2f28ab,_0x1d0440,_0x3e4b19){_0x3e4b19(null,path[_0xcdee('0x23')](config[_0xcdee('0x29')],_0xcdee('0x2a')));},'filename':function(_0x5e3d13,_0x2af17d,_0x4a8f85){_0x4a8f85(null,util[_0xcdee('0x24')](_0xcdee('0x25'),Date[_0xcdee('0x2b')](),_0x2af17d['originalname']));}})});router[_0xcdee('0x21')](_0xcdee('0x11'),upload[_0xcdee('0x27')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0xcdee('0x28')]({'destination':function(_0x40d96a,_0x142995,_0x40e42f){_0x40e42f(null,path[_0xcdee('0x23')](config[_0xcdee('0x29')],'server/files/images/avatars/'));},'filename':function(_0x2f07e8,_0x198f6f,_0x3d08b6){_0x3d08b6(null,util['format'](_0xcdee('0x25'),Date[_0xcdee('0x2b')](),_0x198f6f[_0xcdee('0x26')]));}})});router[_0xcdee('0x21')](_0xcdee('0x13'),upload[_0xcdee('0x27')](_0xcdee('0x2c')),controller[_0xcdee('0x2d')]);var upload=multer({'storage':multer[_0xcdee('0x28')]({'destination':function(_0x5379a2,_0x176c38,_0x4a1ad4){_0x4a1ad4(null,path['join'](config[_0xcdee('0x29')],_0xcdee('0x2a')));},'filename':function(_0x5182ee,_0x9d7e2a,_0x297adc){_0x297adc(null,util['format'](_0xcdee('0x25'),Date[_0xcdee('0x2b')](),_0x9d7e2a[_0xcdee('0x26')]));}})});router[_0xcdee('0x21')](_0xcdee('0x2e'),upload[_0xcdee('0x27')](_0xcdee('0x2c')),controller['addSystemAvatar']);router[_0xcdee('0x21')]('/:id/notify',controller[_0xcdee('0x2f')]);const offlineUploadMulter=multer({'storage':multer[_0xcdee('0x28')]({'destination':function(_0x305b88,_0x23016d,_0x468da8){const _0x2846fe=path[_0xcdee('0x23')](config[_0xcdee('0x29')],_0xcdee('0x30'),_0xcdee('0x31'),_0xcdee('0x32'));fs_extra[_0xcdee('0x33')](_0x2846fe,function(){_0x468da8(null,_0x2846fe);});},'filename':function(_0x20dac5,_0x52b7e8,_0x3013fc){const _0x38a095=_0x52b7e8[_0xcdee('0x26')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4afa52=path[_0xcdee('0x34')](_0x38a095);const _0x3dd7a3=Date[_0xcdee('0x2b')]()+'-'+_0x38a095[_0xcdee('0x35')](_0x4afa52,'')+_0x4afa52;_0x3013fc(null,_0x3dd7a3);}})});router[_0xcdee('0x21')](_0xcdee('0x36'),offlineUploadMulter[_0xcdee('0x37')](),controller[_0xcdee('0x38')]);router['post'](_0xcdee('0x39'),auth[_0xcdee('0x9')](),controller[_0xcdee('0x3a')]);router[_0xcdee('0x21')](_0xcdee('0x18'),auth[_0xcdee('0x9')](),controller[_0xcdee('0x3b')]);router['post'](_0xcdee('0x3c'),auth[_0xcdee('0x9')](),controller['addProactiveActions']);router[_0xcdee('0x21')](_0xcdee('0x1e'),auth[_0xcdee('0x9')](),controller[_0xcdee('0x3d')]);router[_0xcdee('0x3e')](_0xcdee('0x3f'),auth[_0xcdee('0x9')](),controller[_0xcdee('0x40')]);router[_0xcdee('0x41')](_0xcdee('0x3f'),auth[_0xcdee('0x9')](),controller[_0xcdee('0x42')]);router[_0xcdee('0x41')](_0xcdee('0xd'),auth[_0xcdee('0x9')](),controller['removeDispositions']);router[_0xcdee('0x41')]('/:id/canned_answers',auth[_0xcdee('0x9')](),controller[_0xcdee('0x43')]);router[_0xcdee('0x41')](_0xcdee('0x1e'),auth[_0xcdee('0x9')](),controller['removeAgents']);module[_0xcdee('0x44')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index b01c233..85dd059 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 _0x1481=['production','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env'];(function(_0x321781,_0x585793){var _0x1eacdc=function(_0x4f1695){while(--_0x4f1695){_0x321781['push'](_0x321781['shift']());}};_0x1eacdc(++_0x585793);}(_0x1481,0x6a));var _0x1148=function(_0x128c49,_0x4e77c6){_0x128c49=_0x128c49-0x0;var _0x5b9d42=_0x1481[_0x128c49];return _0x5b9d42;};var beaverLogger=require(_0x1148('0x0'));var express=require(_0x1148('0x1'));var auth=require(_0x1148('0x2'));var config=require(_0x1148('0x3'));var router=express[_0x1148('0x4')]();var isProduction=config[_0x1148('0x5')]===_0x1148('0x6')||![];function clientSideLogs(_0x319261,_0x428414,_0x4f6500){var _0x217ca5=_0x319261[_0x1148('0x7')][_0x1148('0x8')]('client-side-logger');if(!_0x217ca5){throw new Error(_0x1148('0x9'));}return beaverLogger[_0x1148('0xa')]({'uri':_0x1148('0xb'),'logger':_0x217ca5,'enableCors':!isProduction})(_0x319261,_0x428414,_0x4f6500);}router[_0x1148('0xc')](auth[_0x1148('0xd')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x8300=['app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','../components/auth/service','../config/environment','Router','env'];(function(_0x42515e,_0x8a595c){var _0x76ed34=function(_0x14aba4){while(--_0x14aba4){_0x42515e['push'](_0x42515e['shift']());}};_0x76ed34(++_0x8a595c);}(_0x8300,0x74));var _0x0830=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8300[_0x4a9fb1];return _0x348672;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0x0830('0x0'));var config=require(_0x0830('0x1'));var router=express[_0x0830('0x2')]();var isProduction=config[_0x0830('0x3')]==='production'||![];function clientSideLogs(_0x2e69c1,_0x6d48f7,_0x1728c1){var _0x44b231=_0x2e69c1[_0x0830('0x4')]['get'](_0x0830('0x5'));if(!_0x44b231){throw new Error(_0x0830('0x6'));}return beaverLogger[_0x0830('0x7')]({'uri':'/client-logs','logger':_0x44b231,'enableCors':!isProduction})(_0x2e69c1,_0x6d48f7,_0x1728c1);}router[_0x0830('0x8')](auth[_0x0830('0x9')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 4dfe73e..692fa54 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 _0x190a=['AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM'];(function(_0x7ed9e9,_0x35fb5d){var _0x383437=function(_0x496ea0){while(--_0x496ea0){_0x7ed9e9['push'](_0x7ed9e9['shift']());}};_0x383437(++_0x35fb5d);}(_0x190a,0x174));var _0xa190=function(_0x377fd1,_0x252296){_0x377fd1=_0x377fd1-0x0;var _0x4457dd=_0x190a[_0x377fd1];return _0x4457dd;};'use strict';var Sequelize=require('sequelize');module[_0xa190('0x0')]={'name':{'type':Sequelize[_0xa190('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa190('0x2')](_0xa190('0x3'),_0xa190('0x4'),_0xa190('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xa190('0x2')](_0xa190('0x6'),_0xa190('0x7'))},'data1':{'type':Sequelize[_0xa190('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xa190('0x1')],'comment':_0xa190('0x8')},'data3':{'type':Sequelize[_0xa190('0x1')],'comment':_0xa190('0x9')},'data4':{'type':Sequelize[_0xa190('0x1')],'comment':_0xa190('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':_0xa190('0xb')},'data6':{'type':Sequelize[_0xa190('0xc')],'comment':_0xa190('0xd')},'data7':{'type':Sequelize['TEXT'],'comment':_0xa190('0xe')}};
\ No newline at end of file
+var _0x512b=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','ENUM','AmazonAWS','Outlook365'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x512b,0xeb));var _0xb512=function(_0x3a8a4b,_0x4828ce){_0x3a8a4b=_0x3a8a4b-0x0;var _0x66f046=_0x512b[_0x3a8a4b];return _0x66f046;};'use strict';var Sequelize=require(_0xb512('0x0'));module['exports']={'name':{'type':Sequelize[_0xb512('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb512('0x2')](_0xb512('0x3'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xb512('0x4'),_0xb512('0x5'))},'data1':{'type':Sequelize[_0xb512('0x1')],'comment':_0xb512('0x6')},'data2':{'type':Sequelize[_0xb512('0x1')],'comment':_0xb512('0x7')},'data3':{'type':Sequelize[_0xb512('0x1')],'comment':_0xb512('0x8')},'data4':{'type':Sequelize[_0xb512('0x1')],'comment':_0xb512('0x9')},'data5':{'type':Sequelize[_0xb512('0xa')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xb512('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0xb512('0xb')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 1a6895e..2cb026d 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 _0xc24f=['index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','merge','VIRTUAL','options','CloudProvider','includeAll','findAll','service','MicrosoftAzure','data3','catch','show','params','keys','include','find','decryptString','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','oauth2MicrosoftAuthorize','findOne','get','state','Invalid\x20state\x20parameter','parse','from','base64','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','api','../../mysqldb','./cloudProvider.oauth','redis','socket.io-emitter','sendStatus','end','status','json','offset','undefined','limit','count','set','update','then','error','stack','name','send','padEnd','slice'];(function(_0x3e29df,_0x42fdf8){var _0x3e3ba9=function(_0x47ccb0){while(--_0x47ccb0){_0x3e29df['push'](_0x3e29df['shift']());}};_0x3e3ba9(++_0x42fdf8);}(_0xc24f,0x95));var _0xfc24=function(_0x90a029,_0x51e6b1){_0x90a029=_0x90a029-0x0;var _0xe30212=_0xc24f[_0x90a029];return _0xe30212;};'use strict';var _=require('lodash');var Redis=require(_0xfc24('0x0'));var qs=require(_0xfc24('0x1'));var encryptor=require(_0xfc24('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xfc24('0x3'));var db=require(_0xfc24('0x4'))['db'];var oauth=require(_0xfc24('0x5'));config[_0xfc24('0x6')]=_['defaults'](config[_0xfc24('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc24('0x7'))(new Redis(config['redis']));var redis=new Redis(config[_0xfc24('0x6')]);function respondWithStatusCode(_0x48e475,_0x38c35f){_0x38c35f=_0x38c35f||0xcc;return function(_0x40a4ad){if(_0x40a4ad){return _0x48e475[_0xfc24('0x8')](_0x38c35f);}return _0x48e475['status'](_0x38c35f)[_0xfc24('0x9')]();};}function respondWithResult(_0x190df5,_0x3ab18c){_0x3ab18c=_0x3ab18c||0xc8;return function(_0x35ab8d){if(_0x35ab8d){return _0x190df5[_0xfc24('0xa')](_0x3ab18c)[_0xfc24('0xb')](_0x35ab8d);}};}function respondWithFilteredResult(_0xc8685,_0x562744){return function(_0xa24470){if(_0xa24470){var _0x262c65=typeof _0x562744[_0xfc24('0xc')]===_0xfc24('0xd')&&typeof _0x562744[_0xfc24('0xe')]===_0xfc24('0xd');var _0x55b8e3=_0xa24470['count'];var _0x532990=_0x262c65?0x0:_0x562744[_0xfc24('0xc')];var _0x25bf3b=_0x262c65?_0xa24470[_0xfc24('0xf')]:_0x562744['offset']+_0x562744['limit'];var _0x407448;if(_0x25bf3b>=_0x55b8e3){_0x25bf3b=_0x55b8e3;_0x407448=0xc8;}else{_0x407448=0xce;}_0xc8685[_0xfc24('0xa')](_0x407448);return _0xc8685[_0xfc24('0x10')]('Content-Range',_0x532990+'-'+_0x25bf3b+'/'+_0x55b8e3)[_0xfc24('0xb')](_0xa24470);}return null;};}function saveUpdates(_0x1e181f){return function(_0x4dc69d){if(_0x4dc69d){return _0x4dc69d[_0xfc24('0x11')](_0x1e181f)[_0xfc24('0x12')](function(_0x4209d7){return _0x4209d7;});}return null;};}function removeEntity(_0xdc7e7c){return function(_0x58d6f5){if(_0x58d6f5){return _0x58d6f5['destroy']()[_0xfc24('0x12')](function(){_0xdc7e7c[_0xfc24('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bed2c){return function(_0x16f434){if(!_0x16f434){_0x5bed2c[_0xfc24('0x8')](0x194);}return _0x16f434;};}function handleError(_0x592ab3,_0x7f54bf){_0x7f54bf=_0x7f54bf||0x1f4;return function(_0x3ec3f7){logger[_0xfc24('0x13')](_0x3ec3f7[_0xfc24('0x14')]);if(_0x3ec3f7[_0xfc24('0x15')]){delete _0x3ec3f7['name'];}_0x592ab3[_0xfc24('0xa')](_0x7f54bf)[_0xfc24('0x16')](_0x3ec3f7);};}function maskClientSecret(_0xb890d9){return _[_0xfc24('0x17')](_0xb890d9[_0xfc24('0x18')](0x0,0x3),0x14,'*');}exports[_0xfc24('0x19')]=function(_0x5ab4a0,_0x1a1f8c){var _0xb2983e={},_0x385132={},_0x169778={'count':0x0,'rows':[]};var _0x4a8c95=_[_0xfc24('0x1a')](db['CloudProvider'][_0xfc24('0x1b')],function(_0x7dc29f){return{'name':_0x7dc29f[_0xfc24('0x1c')],'type':_0x7dc29f[_0xfc24('0x1d')][_0xfc24('0x1e')]};});_0x385132[_0xfc24('0x1f')]=_[_0xfc24('0x1a')](_0x4a8c95,_0xfc24('0x15'));_0x385132['query']=_['keys'](_0x5ab4a0[_0xfc24('0x20')]);_0x385132['filters']=_[_0xfc24('0x21')](_0x385132[_0xfc24('0x1f')],_0x385132[_0xfc24('0x20')]);_0xb2983e['attributes']=_[_0xfc24('0x21')](_0x385132[_0xfc24('0x1f')],qs['fields'](_0x5ab4a0[_0xfc24('0x20')][_0xfc24('0x22')]));_0xb2983e[_0xfc24('0x23')]=_0xb2983e['attributes'][_0xfc24('0x24')]?_0xb2983e[_0xfc24('0x23')]:_0x385132[_0xfc24('0x1f')];if(!_0x5ab4a0[_0xfc24('0x20')]['hasOwnProperty'](_0xfc24('0x25'))){_0xb2983e[_0xfc24('0xe')]=qs[_0xfc24('0xe')](_0x5ab4a0[_0xfc24('0x20')]['limit']);_0xb2983e['offset']=qs['offset'](_0x5ab4a0[_0xfc24('0x20')]['offset']);}_0xb2983e[_0xfc24('0x26')]=qs['sort'](_0x5ab4a0[_0xfc24('0x20')][_0xfc24('0x27')]);_0xb2983e[_0xfc24('0x28')]=qs['filters'](_['pick'](_0x5ab4a0[_0xfc24('0x20')],_0x385132[_0xfc24('0x29')]),_0x4a8c95);if(_0x5ab4a0[_0xfc24('0x20')]['filter']){_0xb2983e[_0xfc24('0x28')]=_[_0xfc24('0x2a')](_0xb2983e['where'],{'$or':_[_0xfc24('0x1a')](_0x4a8c95,function(_0x2f2268){if(_0x2f2268[_0xfc24('0x1d')]!==_0xfc24('0x2b')){var _0x5605cc={};_0x5605cc[_0x2f2268[_0xfc24('0x15')]]={'$like':'%'+_0x5ab4a0[_0xfc24('0x20')]['filter']+'%'};return _0x5605cc;}})});}_0xb2983e=_[_0xfc24('0x2a')]({},_0xb2983e,_0x5ab4a0[_0xfc24('0x2c')]);var _0x50e938={'where':_0xb2983e[_0xfc24('0x28')]};return db[_0xfc24('0x2d')][_0xfc24('0xf')](_0x50e938)[_0xfc24('0x12')](function(_0xafed1d){_0x169778[_0xfc24('0xf')]=_0xafed1d;if(_0x5ab4a0[_0xfc24('0x20')][_0xfc24('0x2e')]){_0xb2983e['include']=[{'all':!![]}];}return db[_0xfc24('0x2d')][_0xfc24('0x2f')](_0xb2983e);})[_0xfc24('0x12')](function(_0x9e6ed9){_0x169778['rows']=_[_0xfc24('0x1a')](_0x9e6ed9,function(_0xe6a284){if(_0xe6a284[_0xfc24('0x30')]===_0xfc24('0x31')){var _0x517e67=encryptor['decryptString'](_0xe6a284['data3']);_0xe6a284[_0xfc24('0x32')]=maskClientSecret(_0x517e67);}return _0xe6a284;});return _0x169778;})[_0xfc24('0x12')](respondWithFilteredResult(_0x1a1f8c,_0xb2983e))[_0xfc24('0x33')](handleError(_0x1a1f8c,null));};exports[_0xfc24('0x34')]=function(_0xb628b5,_0x196c36){var _0x156676={'raw':!![],'where':{'id':_0xb628b5[_0xfc24('0x35')]['id']}},_0x25eb62={};_0x25eb62[_0xfc24('0x1f')]=_[_0xfc24('0x36')](db['CloudProvider'][_0xfc24('0x1b')]);_0x25eb62[_0xfc24('0x20')]=_[_0xfc24('0x36')](_0xb628b5[_0xfc24('0x20')]);_0x25eb62[_0xfc24('0x29')]=_[_0xfc24('0x21')](_0x25eb62[_0xfc24('0x1f')],_0x25eb62[_0xfc24('0x20')]);_0x156676[_0xfc24('0x23')]=_[_0xfc24('0x21')](_0x25eb62[_0xfc24('0x1f')],qs[_0xfc24('0x22')](_0xb628b5['query'][_0xfc24('0x22')]));_0x156676['attributes']=_0x156676['attributes']['length']?_0x156676['attributes']:_0x25eb62['model'];if(_0xb628b5['query'][_0xfc24('0x2e')]){_0x156676[_0xfc24('0x37')]=[{'all':!![]}];}_0x156676=_[_0xfc24('0x2a')]({},_0x156676,_0xb628b5['options']);return db[_0xfc24('0x2d')][_0xfc24('0x38')](_0x156676)[_0xfc24('0x12')](handleEntityNotFound(_0x196c36,null))[_0xfc24('0x12')](function(_0x33dd38){if(_0x33dd38[_0xfc24('0x30')]===_0xfc24('0x31')){var _0x3828d1=encryptor[_0xfc24('0x39')](_0x33dd38[_0xfc24('0x32')]);_0x33dd38[_0xfc24('0x32')]=maskClientSecret(_0x3828d1);}return _0x33dd38;})[_0xfc24('0x12')](respondWithResult(_0x196c36,null))[_0xfc24('0x33')](handleError(_0x196c36,null));};exports[_0xfc24('0x3a')]=function(_0x557732,_0x40d5ab){if(!_0x557732['body'][_0xfc24('0x15')])throw new Error(_0xfc24('0x3b'));if(!_0x557732[_0xfc24('0x3c')][_0xfc24('0x30')])throw new Error(_0xfc24('0x3d'));var _0x2fa800=db[_0xfc24('0x2d')][_0xfc24('0x1b')]['service']['values'];if(!_0x2fa800[_0xfc24('0x3e')](_0x557732['body'][_0xfc24('0x30')]))throw new Error(_0xfc24('0x3f')+_0x2fa800[_0xfc24('0x40')](',\x20'));if(_0x557732['body'][_0xfc24('0x30')]===_0xfc24('0x31')&&_0x557732[_0xfc24('0x3c')][_0xfc24('0x32')]){_0x557732[_0xfc24('0x3c')][_0xfc24('0x32')]=encryptor['encryptString'](_0x557732[_0xfc24('0x3c')][_0xfc24('0x32')]);}return db[_0xfc24('0x2d')]['create'](_0x557732[_0xfc24('0x3c')],{})[_0xfc24('0x12')](respondWithResult(_0x40d5ab,0xc9))[_0xfc24('0x33')](handleError(_0x40d5ab,null));};exports['update']=function(_0x21e16,_0x3200fc){if(_0x21e16[_0xfc24('0x3c')]['id']){delete _0x21e16[_0xfc24('0x3c')]['id'];}return db[_0xfc24('0x2d')][_0xfc24('0x38')]({'where':{'id':_0x21e16[_0xfc24('0x35')]['id']}})['then'](handleEntityNotFound(_0x3200fc,null))[_0xfc24('0x12')](function(_0x4b73a1){if(_0x4b73a1[_0xfc24('0x30')]===_0xfc24('0x31')&&_0x21e16[_0xfc24('0x3c')][_0xfc24('0x32')]){_0x21e16[_0xfc24('0x3c')]['data3']=encryptor['encryptString'](_0x21e16['body'][_0xfc24('0x32')]);}return _0x4b73a1;})[_0xfc24('0x12')](saveUpdates(_0x21e16[_0xfc24('0x3c')],null))['then'](respondWithResult(_0x3200fc,null))['catch'](handleError(_0x3200fc,null));};exports['destroy']=function(_0x5a8679,_0x494f36){return db[_0xfc24('0x2d')][_0xfc24('0x38')]({'where':{'id':_0x5a8679[_0xfc24('0x35')]['id']}})[_0xfc24('0x12')](handleEntityNotFound(_0x494f36,null))[_0xfc24('0x12')](removeEntity(_0x494f36,null))[_0xfc24('0x33')](handleError(_0x494f36,null));};exports[_0xfc24('0x41')]=function(_0x3389bd,_0x5e6892){return db['CloudProvider'][_0xfc24('0x42')]({'where':{'id':_0x3389bd['params']['id']},'raw':!![]})[_0xfc24('0x12')](function(_0x241202){if(!_0x241202)return _0x5e6892[_0xfc24('0x8')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x241202,_0x3389bd['user']['id'])};})[_0xfc24('0x12')](respondWithResult(_0x5e6892,null))[_0xfc24('0x33')](handleError(_0x5e6892,null));};exports['oauth2MicrosoftCallback']=function(_0x39070c,_0x15cbd3){var _0x45f2d6=_0x39070c[_0xfc24('0x3c')];var _0x35df6b;var _0x910cb;if(_0x45f2d6[_0xfc24('0x13')])throw _0x45f2d6;redis[_0xfc24('0x43')](_0x45f2d6[_0xfc24('0x44')])['then'](function(_0xc57dbf){if(!_0xc57dbf)throw new Error(_0xfc24('0x45'));_0x35df6b=JSON[_0xfc24('0x46')](_0xc57dbf);var _0x33d46c=Buffer[_0xfc24('0x47')](_0x45f2d6[_0xfc24('0x44')],_0xfc24('0x48'))['toString']('ascii');_0x910cb=JSON[_0xfc24('0x46')](_0x33d46c);if(!oauth[_0xfc24('0x49')](_0x45f2d6[_0xfc24('0x4a')],_0x35df6b[_0xfc24('0x4b')]))throw new Error(_0xfc24('0x4c'));redis[_0xfc24('0x4d')](_0x45f2d6[_0xfc24('0x44')]);return oauth[_0xfc24('0x4e')](_0x45f2d6[_0xfc24('0x4f')],_0x35df6b);})['then'](function(_0x74ece6){_0x35df6b['data5']=_0x74ece6[_0xfc24('0x50')];_0x35df6b['data6']=_0x74ece6['refresh_token'];return db[_0xfc24('0x2d')][_0xfc24('0x11')]({'data5':_0x35df6b['data5'],'data6':_0x35df6b[_0xfc24('0x51')]},{'where':{'id':_0x35df6b['id']}});})[_0xfc24('0x12')](function(){oauth['startRefreshInterval'](_0x35df6b);socket[_0xfc24('0x52')](_0xfc24('0x53'),{'id':_0x910cb['id']});return;})['then'](respondWithStatusCode(_0x15cbd3,null))[_0xfc24('0x33')](function(_0x4203a8){if(_0x910cb){socket[_0xfc24('0x52')](_0xfc24('0x54'),{'id':_0x910cb['id']});}if(!_0x35df6b){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x4203a8);return _0x15cbd3[_0xfc24('0xa')](0x1f4)[_0xfc24('0x16')](_0x4203a8[_0xfc24('0x55')]);}logger[_0xfc24('0x13')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x35df6b['id'],JSON[_0xfc24('0x56')](_0x4203a8));});};
\ No newline at end of file
+var _0x8621=['Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','offset','undefined','limit','count','Content-Range','json','update','destroy','then','status','end','stack','name','slice','map','CloudProvider','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','options','includeAll','rows','service','MicrosoftAzure','data3','catch','show','params','decryptString','Name\x20parameter\x20not\x20specified','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','find','findOne','user','oauth2MicrosoftCallback','error','state','Invalid\x20state\x20parameter','parse','from','base64','isValidIdToken','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:error'];(function(_0x2c3739,_0x19b190){var _0x23196d=function(_0x26d937){while(--_0x26d937){_0x2c3739['push'](_0x2c3739['shift']());}};_0x23196d(++_0x19b190);}(_0x8621,0x1c2));var _0x1862=function(_0x4588d8,_0xbdb8d2){_0x4588d8=_0x4588d8-0x0;var _0x2c33dc=_0x8621[_0x4588d8];return _0x2c33dc;};'use strict';var _=require(_0x1862('0x0'));var Redis=require(_0x1862('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x1862('0x2'));var config=require(_0x1862('0x3'));var logger=require(_0x1862('0x4'))('api');var db=require(_0x1862('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x1862('0x6')]=_[_0x1862('0x7')](config[_0x1862('0x6')],{'host':_0x1862('0x8'),'port':0x18eb});var socket=require(_0x1862('0x9'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x27d068,_0x1f1cf6){_0x1f1cf6=_0x1f1cf6||0xcc;return function(_0x2da952){if(_0x2da952){return _0x27d068[_0x1862('0xa')](_0x1f1cf6);}return _0x27d068['status'](_0x1f1cf6)['end']();};}function respondWithResult(_0x182610,_0x275600){_0x275600=_0x275600||0xc8;return function(_0x563f5b){if(_0x563f5b){return _0x182610['status'](_0x275600)['json'](_0x563f5b);}};}function respondWithFilteredResult(_0x594e0f,_0x21beab){return function(_0x4ee74a){if(_0x4ee74a){var _0x2c2669=typeof _0x21beab[_0x1862('0xb')]===_0x1862('0xc')&&typeof _0x21beab[_0x1862('0xd')]===_0x1862('0xc');var _0x578f91=_0x4ee74a[_0x1862('0xe')];var _0x2e30e0=_0x2c2669?0x0:_0x21beab['offset'];var _0x363406=_0x2c2669?_0x4ee74a[_0x1862('0xe')]:_0x21beab[_0x1862('0xb')]+_0x21beab[_0x1862('0xd')];var _0x1250cc;if(_0x363406>=_0x578f91){_0x363406=_0x578f91;_0x1250cc=0xc8;}else{_0x1250cc=0xce;}_0x594e0f['status'](_0x1250cc);return _0x594e0f['set'](_0x1862('0xf'),_0x2e30e0+'-'+_0x363406+'/'+_0x578f91)[_0x1862('0x10')](_0x4ee74a);}return null;};}function saveUpdates(_0x4d6783){return function(_0x2c88d8){if(_0x2c88d8){return _0x2c88d8[_0x1862('0x11')](_0x4d6783)['then'](function(_0x1d7eb4){return _0x1d7eb4;});}return null;};}function removeEntity(_0x169112){return function(_0x432402){if(_0x432402){return _0x432402[_0x1862('0x12')]()[_0x1862('0x13')](function(){_0x169112[_0x1862('0x14')](0xcc)[_0x1862('0x15')]();});}};}function handleEntityNotFound(_0x29d629){return function(_0x1f1a7f){if(!_0x1f1a7f){_0x29d629[_0x1862('0xa')](0x194);}return _0x1f1a7f;};}function handleError(_0x4813ff,_0x3ab015){_0x3ab015=_0x3ab015||0x1f4;return function(_0x1a3098){logger['error'](_0x1a3098[_0x1862('0x16')]);if(_0x1a3098[_0x1862('0x17')]){delete _0x1a3098[_0x1862('0x17')];}_0x4813ff['status'](_0x3ab015)['send'](_0x1a3098);};}function maskClientSecret(_0x4d9d7a){return _['padEnd'](_0x4d9d7a[_0x1862('0x18')](0x0,0x3),0x14,'*');}exports['index']=function(_0x6b7fe8,_0x166949){var _0x4ba207={},_0x364d3f={},_0x5505be={'count':0x0,'rows':[]};var _0x10c478=_[_0x1862('0x19')](db[_0x1862('0x1a')][_0x1862('0x1b')],function(_0x2a8841){return{'name':_0x2a8841['fieldName'],'type':_0x2a8841[_0x1862('0x1c')][_0x1862('0x1d')]};});_0x364d3f[_0x1862('0x1e')]=_[_0x1862('0x19')](_0x10c478,_0x1862('0x17'));_0x364d3f['query']=_[_0x1862('0x1f')](_0x6b7fe8[_0x1862('0x20')]);_0x364d3f[_0x1862('0x21')]=_[_0x1862('0x22')](_0x364d3f['model'],_0x364d3f[_0x1862('0x20')]);_0x4ba207[_0x1862('0x23')]=_[_0x1862('0x22')](_0x364d3f[_0x1862('0x1e')],qs['fields'](_0x6b7fe8[_0x1862('0x20')][_0x1862('0x24')]));_0x4ba207['attributes']=_0x4ba207[_0x1862('0x23')][_0x1862('0x25')]?_0x4ba207[_0x1862('0x23')]:_0x364d3f[_0x1862('0x1e')];if(!_0x6b7fe8[_0x1862('0x20')]['hasOwnProperty'](_0x1862('0x26'))){_0x4ba207[_0x1862('0xd')]=qs[_0x1862('0xd')](_0x6b7fe8[_0x1862('0x20')][_0x1862('0xd')]);_0x4ba207[_0x1862('0xb')]=qs[_0x1862('0xb')](_0x6b7fe8['query'][_0x1862('0xb')]);}_0x4ba207[_0x1862('0x27')]=qs[_0x1862('0x28')](_0x6b7fe8[_0x1862('0x20')][_0x1862('0x28')]);_0x4ba207['where']=qs[_0x1862('0x21')](_[_0x1862('0x29')](_0x6b7fe8[_0x1862('0x20')],_0x364d3f[_0x1862('0x21')]),_0x10c478);if(_0x6b7fe8[_0x1862('0x20')][_0x1862('0x2a')]){_0x4ba207['where']=_['merge'](_0x4ba207[_0x1862('0x2b')],{'$or':_[_0x1862('0x19')](_0x10c478,function(_0x1873b0){if(_0x1873b0['type']!=='VIRTUAL'){var _0x5c9e3d={};_0x5c9e3d[_0x1873b0[_0x1862('0x17')]]={'$like':'%'+_0x6b7fe8['query']['filter']+'%'};return _0x5c9e3d;}})});}_0x4ba207=_['merge']({},_0x4ba207,_0x6b7fe8[_0x1862('0x2c')]);var _0x4fa1ba={'where':_0x4ba207['where']};return db[_0x1862('0x1a')][_0x1862('0xe')](_0x4fa1ba)[_0x1862('0x13')](function(_0x31a9e8){_0x5505be[_0x1862('0xe')]=_0x31a9e8;if(_0x6b7fe8[_0x1862('0x20')][_0x1862('0x2d')]){_0x4ba207['include']=[{'all':!![]}];}return db[_0x1862('0x1a')]['findAll'](_0x4ba207);})[_0x1862('0x13')](function(_0x42b402){_0x5505be[_0x1862('0x2e')]=_[_0x1862('0x19')](_0x42b402,function(_0xd8d37e){if(_0xd8d37e[_0x1862('0x2f')]===_0x1862('0x30')){var _0x4141fa=encryptor['decryptString'](_0xd8d37e[_0x1862('0x31')]);_0xd8d37e['data3']=maskClientSecret(_0x4141fa);}return _0xd8d37e;});return _0x5505be;})[_0x1862('0x13')](respondWithFilteredResult(_0x166949,_0x4ba207))[_0x1862('0x32')](handleError(_0x166949,null));};exports[_0x1862('0x33')]=function(_0x4520fd,_0x20e8ee){var _0x215feb={'raw':!![],'where':{'id':_0x4520fd[_0x1862('0x34')]['id']}},_0x2f79e3={};_0x2f79e3['model']=_['keys'](db[_0x1862('0x1a')]['rawAttributes']);_0x2f79e3['query']=_['keys'](_0x4520fd['query']);_0x2f79e3['filters']=_[_0x1862('0x22')](_0x2f79e3['model'],_0x2f79e3[_0x1862('0x20')]);_0x215feb[_0x1862('0x23')]=_[_0x1862('0x22')](_0x2f79e3[_0x1862('0x1e')],qs[_0x1862('0x24')](_0x4520fd[_0x1862('0x20')][_0x1862('0x24')]));_0x215feb[_0x1862('0x23')]=_0x215feb['attributes'][_0x1862('0x25')]?_0x215feb['attributes']:_0x2f79e3['model'];if(_0x4520fd[_0x1862('0x20')][_0x1862('0x2d')]){_0x215feb['include']=[{'all':!![]}];}_0x215feb=_['merge']({},_0x215feb,_0x4520fd[_0x1862('0x2c')]);return db[_0x1862('0x1a')]['find'](_0x215feb)['then'](handleEntityNotFound(_0x20e8ee,null))[_0x1862('0x13')](function(_0x364203){if(_0x364203['service']===_0x1862('0x30')){var _0x201845=encryptor[_0x1862('0x35')](_0x364203[_0x1862('0x31')]);_0x364203[_0x1862('0x31')]=maskClientSecret(_0x201845);}return _0x364203;})[_0x1862('0x13')](respondWithResult(_0x20e8ee,null))[_0x1862('0x32')](handleError(_0x20e8ee,null));};exports['create']=function(_0x5ceb5a,_0x27862f){if(!_0x5ceb5a['body']['name'])throw new Error(_0x1862('0x36'));if(!_0x5ceb5a[_0x1862('0x37')][_0x1862('0x2f')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x273650=db[_0x1862('0x1a')][_0x1862('0x1b')][_0x1862('0x2f')][_0x1862('0x38')];if(!_0x273650[_0x1862('0x39')](_0x5ceb5a['body'][_0x1862('0x2f')]))throw new Error(_0x1862('0x3a')+_0x273650[_0x1862('0x3b')](',\x20'));if(_0x5ceb5a[_0x1862('0x37')][_0x1862('0x2f')]==='MicrosoftAzure'&&_0x5ceb5a['body']['data3']){_0x5ceb5a['body'][_0x1862('0x31')]=encryptor[_0x1862('0x3c')](_0x5ceb5a[_0x1862('0x37')]['data3']);}return db[_0x1862('0x1a')][_0x1862('0x3d')](_0x5ceb5a[_0x1862('0x37')],{})[_0x1862('0x13')](respondWithResult(_0x27862f,0xc9))[_0x1862('0x32')](handleError(_0x27862f,null));};exports[_0x1862('0x11')]=function(_0x19328a,_0x2cca58){if(_0x19328a[_0x1862('0x37')]['id']){delete _0x19328a[_0x1862('0x37')]['id'];}return db[_0x1862('0x1a')][_0x1862('0x3e')]({'where':{'id':_0x19328a[_0x1862('0x34')]['id']}})[_0x1862('0x13')](handleEntityNotFound(_0x2cca58,null))[_0x1862('0x13')](function(_0xdeede){if(_0xdeede[_0x1862('0x2f')]===_0x1862('0x30')&&_0x19328a[_0x1862('0x37')]['data3']){_0x19328a['body'][_0x1862('0x31')]=encryptor[_0x1862('0x3c')](_0x19328a[_0x1862('0x37')][_0x1862('0x31')]);}return _0xdeede;})['then'](saveUpdates(_0x19328a['body'],null))[_0x1862('0x13')](respondWithResult(_0x2cca58,null))['catch'](handleError(_0x2cca58,null));};exports['destroy']=function(_0x2d87f1,_0x4c9eab){return db['CloudProvider'][_0x1862('0x3e')]({'where':{'id':_0x2d87f1[_0x1862('0x34')]['id']}})[_0x1862('0x13')](handleEntityNotFound(_0x4c9eab,null))[_0x1862('0x13')](removeEntity(_0x4c9eab,null))[_0x1862('0x32')](handleError(_0x4c9eab,null));};exports['oauth2MicrosoftAuthorize']=function(_0x39c051,_0x5b8d85){return db['CloudProvider'][_0x1862('0x3f')]({'where':{'id':_0x39c051[_0x1862('0x34')]['id']},'raw':!![]})['then'](function(_0x16c2c8){if(!_0x16c2c8)return _0x5b8d85[_0x1862('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x16c2c8,_0x39c051[_0x1862('0x40')]['id'])};})['then'](respondWithResult(_0x5b8d85,null))['catch'](handleError(_0x5b8d85,null));};exports[_0x1862('0x41')]=function(_0x346046,_0x55e15b){var _0x22c33c=_0x346046[_0x1862('0x37')];var _0x1792f1;var _0x1605b4;if(_0x22c33c[_0x1862('0x42')])throw _0x22c33c;redis['get'](_0x22c33c[_0x1862('0x43')])[_0x1862('0x13')](function(_0x2c1dbb){if(!_0x2c1dbb)throw new Error(_0x1862('0x44'));_0x1792f1=JSON[_0x1862('0x45')](_0x2c1dbb);var _0x4bc1e6=Buffer[_0x1862('0x46')](_0x22c33c[_0x1862('0x43')],_0x1862('0x47'))['toString']('ascii');_0x1605b4=JSON[_0x1862('0x45')](_0x4bc1e6);if(!oauth[_0x1862('0x48')](_0x22c33c['id_token'],_0x1792f1['oauth2Claims']))throw new Error(_0x1862('0x49'));redis[_0x1862('0x4a')](_0x22c33c[_0x1862('0x43')]);return oauth[_0x1862('0x4b')](_0x22c33c[_0x1862('0x4c')],_0x1792f1);})[_0x1862('0x13')](function(_0x53061d){_0x1792f1['data5']=_0x53061d[_0x1862('0x4d')];_0x1792f1[_0x1862('0x4e')]=_0x53061d[_0x1862('0x4f')];return db['CloudProvider'][_0x1862('0x11')]({'data5':_0x1792f1[_0x1862('0x50')],'data6':_0x1792f1['data6']},{'where':{'id':_0x1792f1['id']}});})[_0x1862('0x13')](function(){oauth[_0x1862('0x51')](_0x1792f1);socket[_0x1862('0x52')]('microsoftAuthorization:success',{'id':_0x1605b4['id']});return;})[_0x1862('0x13')](respondWithStatusCode(_0x55e15b,null))[_0x1862('0x32')](function(_0x52e56b){if(_0x1605b4){socket[_0x1862('0x52')](_0x1862('0x53'),{'id':_0x1605b4['id']});}if(!_0x1792f1){logger[_0x1862('0x42')](_0x1862('0x54'),_0x52e56b);return _0x55e15b[_0x1862('0x14')](0x1f4)[_0x1862('0x55')](_0x52e56b[_0x1862('0x56')]);}logger['error'](_0x1862('0x57'),_0x1792f1['id'],JSON[_0x1862('0x58')](_0x52e56b));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 2691209..5012dc6 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 _0x0137=['../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4de9df,_0x1d5c49){var _0x58b88b=function(_0xc08be7){while(--_0xc08be7){_0x4de9df['push'](_0x4de9df['shift']());}};_0x58b88b(++_0x1d5c49);}(_0x0137,0xc5));var _0x7013=function(_0x485539,_0x5491b7){_0x485539=_0x485539-0x0;var _0x2d3d75=_0x0137[_0x485539];return _0x2d3d75;};'use strict';var _=require(_0x7013('0x0'));var util=require('util');var logger=require(_0x7013('0x1'))(_0x7013('0x2'));var moment=require(_0x7013('0x3'));var BPromise=require('bluebird');var rp=require(_0x7013('0x4'));var fs=require('fs');var path=require(_0x7013('0x5'));var rimraf=require(_0x7013('0x6'));var config=require(_0x7013('0x7'));var attributes=require(_0x7013('0x8'));module[_0x7013('0x9')]=function(_0x9e752c,_0x560bd1){return _0x9e752c[_0x7013('0xa')](_0x7013('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c31=['../../config/logger','moment','bluebird','request-promise','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','lodash','util'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0x2c31,0x132));var _0x12c3=function(_0x4caeda,_0x427222){_0x4caeda=_0x4caeda-0x0;var _0x2ce18b=_0x2c31[_0x4caeda];return _0x2ce18b;};'use strict';var _=require(_0x12c3('0x0'));var util=require(_0x12c3('0x1'));var logger=require(_0x12c3('0x2'))('api');var moment=require(_0x12c3('0x3'));var BPromise=require(_0x12c3('0x4'));var rp=require(_0x12c3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x12c3('0x6'));var config=require('../../config/environment');var attributes=require(_0x12c3('0x7'));module[_0x12c3('0x8')]=function(_0x2a7b5c,_0x367d4f){return _0x2a7b5c[_0x12c3('0x9')](_0x12c3('0xa'),attributes,{'tableName':'cloud_providers','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 9aa3edc..e08dcec 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 _0x7e1b=['email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','id_token','stringify','toString','randomBytes','client_id','data1','redirect_uri','data4','form_post','scope','state','nonce','prompt','login','map','key','value','oauth2Claims','oauth2/','set','decode','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','api','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile'];(function(_0x532d2d,_0x5d33ce){var _0x1da8d1=function(_0x1bd1c7){while(--_0x1bd1c7){_0x532d2d['push'](_0x532d2d['shift']());}};_0x1da8d1(++_0x5d33ce);}(_0x7e1b,0x1d9));var _0xb7e1=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x7e1b[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xb7e1('0x0'));var crypto=require(_0xb7e1('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0xb7e1('0x2'));var Redis=require(_0xb7e1('0x3'));var rp=require(_0xb7e1('0x4'));var util=require('util');var encryptor=require(_0xb7e1('0x5'));var config=require(_0xb7e1('0x6'));var logger=require('../../config/logger')(_0xb7e1('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0xb7e1('0x8')]=_['defaults'](config[_0xb7e1('0x8')],{'host':_0xb7e1('0x9'),'port':0x18eb});var redis=new Redis(config[_0xb7e1('0x8')]);var MICROSOFT_AUTH_URL=_0xb7e1('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0xb7e1('0xb'),_0xb7e1('0xc'),_0xb7e1('0xd'),'offline_access',_0xb7e1('0xe'),_0xb7e1('0xf'),_0xb7e1('0x10')],'Dynamics365':[_0xb7e1('0xb'),_0xb7e1('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xb7e1('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xb7e1('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x430516){var _0x4af17e=_['map'](AZURE_AUTH_SCOPES[_0x430516[_0xb7e1('0x14')]]);if(_0x430516[_0xb7e1('0x14')]===_0xb7e1('0x15'))_0x4af17e[_0xb7e1('0x16')](_0x430516[_0xb7e1('0x17')]+_0xb7e1('0x18'));return _0x4af17e[_0xb7e1('0x19')]('\x20');}function getAccessTokenScope(_0x51dac5){if(_0x51dac5['type']===_0xb7e1('0x1a'))return _0xb7e1('0xe');if(_0x51dac5[_0xb7e1('0x14')]===_0xb7e1('0x15'))return _0x51dac5[_0xb7e1('0x17')]+_0xb7e1('0x18');}function generateMicrosoftAuthorizationUrl(_0x44ccce,_0x2c0c15){var _0x49742c=MICROSOFT_AUTH_URL[_0xb7e1('0x1b')](_0xb7e1('0x1c'),_0x44ccce[_0xb7e1('0x1d')]);var _0x162eca=[_0xb7e1('0x1e'),_0xb7e1('0x1f')];var _0x190b0e=Buffer['from'](JSON[_0xb7e1('0x20')]({'id':_0x2c0c15}))[_0xb7e1('0x21')]('base64');var _0x269990=crypto[_0xb7e1('0x22')](0x10)[_0xb7e1('0x21')]('hex');var _0x1d3124=getAuthorizationScopes(_0x44ccce);var _0x14e250=[{'key':_0xb7e1('0x23'),'value':_0x44ccce[_0xb7e1('0x24')]},{'key':'response_type','value':encodeURIComponent(_0x162eca[_0xb7e1('0x19')]('\x20'))},{'key':_0xb7e1('0x25'),'value':_0x44ccce[_0xb7e1('0x26')]},{'key':'response_mode','value':_0xb7e1('0x27')},{'key':_0xb7e1('0x28'),'value':encodeURIComponent(_0x1d3124)},{'key':_0xb7e1('0x29'),'value':_0x190b0e},{'key':_0xb7e1('0x2a'),'value':_0x269990},{'key':_0xb7e1('0x2b'),'value':_0xb7e1('0x2c')}];var _0x1b267b=_0x49742c+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb7e1('0x2d')](_0x14e250,function(_0x377360){return _0x377360[_0xb7e1('0x2e')]+'='+_0x377360[_0xb7e1('0x2f')];})['join']('&');_0x44ccce[_0xb7e1('0x30')]={'issuer':_0x49742c[_0xb7e1('0x1b')](_0xb7e1('0x31'),''),'audience':_0x44ccce[_0xb7e1('0x24')],'state':_0x190b0e,'nonce':_0x269990};redis[_0xb7e1('0x32')](_0x190b0e,JSON[_0xb7e1('0x20')](_0x44ccce));return _0x1b267b;}function isValidIdToken(_0x330b9c,_0x1c405e){try{var _0x546008=jwt[_0xb7e1('0x33')](_0x330b9c,{'complete':!![]});var _0x3411d8=_0x546008['payload'];if(_0x3411d8[_0xb7e1('0x34')]!==_0x1c405e[_0xb7e1('0x35')])return![];if(_0x3411d8[_0xb7e1('0x36')]!==_0x1c405e[_0xb7e1('0x37')])return![];if(_0x3411d8[_0xb7e1('0x2a')]!==_0x1c405e[_0xb7e1('0x2a')])return![];if(moment()[_0xb7e1('0x38')](moment[_0xb7e1('0x39')](_0x3411d8[_0xb7e1('0x3a')])))return![];return!![];}catch(_0x586166){throw _0x586166;}}function refreshOauth2MicrosoftAccessToken(_0x380647){return Promise[_0xb7e1('0x3b')]()[_0xb7e1('0x3c')](function(){if(_0x380647[_0xb7e1('0x3d')])return _0x380647;return db[_0xb7e1('0x3e')][_0xb7e1('0x3f')]({'where':{'id':_0x380647['id']},'raw':!![]});})[_0xb7e1('0x3c')](function(_0x407fb4){var _0x42d868={'grant_type':_0xb7e1('0x40'),'refresh_token':_0x407fb4[_0xb7e1('0x41')],'scope':getAccessTokenScope(_0x407fb4),'redirect_uri':_0x407fb4[_0xb7e1('0x26')],'client_id':_0x407fb4[_0xb7e1('0x24')],'client_secret':encryptor[_0xb7e1('0x42')](_0x407fb4[_0xb7e1('0x3d')])};var _0x464cb2={'method':_0xb7e1('0x43'),'uri':MICROSOFT_AUTH_URL[_0xb7e1('0x1b')]('{TENANT_ID}',_0x407fb4['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x42d868,'json':!![]};return rp(_0x464cb2);})[_0xb7e1('0x3c')](function(_0x1ad22e){_0x380647[_0xb7e1('0x44')]=_0x1ad22e[_0xb7e1('0x45')];_0x380647[_0xb7e1('0x41')]=_0x1ad22e[_0xb7e1('0x40')];return db[_0xb7e1('0x3e')][_0xb7e1('0x46')]({'data5':_0x380647[_0xb7e1('0x44')],'data6':_0x380647['data6']},{'where':{'id':_0x380647['id']}});})[_0xb7e1('0x3c')](function(){return _0x380647;})[_0xb7e1('0x47')](function(_0xe21849){logger[_0xb7e1('0x48')](_0xb7e1('0x49'),_0x380647['id'],_0xe21849);});}function getOauth2MicrosoftAccessToken(_0x2535c2,_0x2740b1){var _0x371b62={'grant_type':_0xb7e1('0x4a'),'code':_0x2535c2,'scope':getAccessTokenScope(_0x2740b1),'redirect_uri':_0x2740b1[_0xb7e1('0x26')],'client_id':_0x2740b1[_0xb7e1('0x24')],'client_secret':encryptor['decryptString'](_0x2740b1[_0xb7e1('0x3d')])};var _0x4b0a05={'method':_0xb7e1('0x43'),'uri':MICROSOFT_AUTH_URL['replace'](_0xb7e1('0x1c'),_0x2740b1['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x371b62,'json':!![]};return rp(_0x4b0a05);}function startRefreshInterval(_0x5917cb){var _0x5b877c=schedule[_0xb7e1('0x4b')];if(_0x5b877c[_0x5917cb['id']])clearInterval(_0x5b877c[_0x5917cb['id']]);_0x5b877c[_0x5917cb['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x5917cb['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x5b877c;}function startAllRefreshIntervals(){return db[_0xb7e1('0x3e')][_0xb7e1('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x34f9bf){var _0x5c850f=_0x34f9bf['map'](function(_0x504a22){return refreshOauth2MicrosoftAccessToken(_0x504a22)[_0xb7e1('0x3c')](function(_0x5b3e1d){startRefreshInterval(_0x5b3e1d);});});return Promise[_0xb7e1('0x4d')](_0x5c850f);})[_0xb7e1('0x47')](function(_0x55e763){var _0x575250=_0x55e763?util[_0xb7e1('0x4e')](_0x55e763,{'showHidden':![],'depth':null}):'';logger[_0xb7e1('0x48')](_0xb7e1('0x4f'),_0x575250);});}module[_0xb7e1('0x50')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x12c0=['https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','data7','Outlook365','Dynamics365','replace','data2','id_token','from','stringify','toString','base64','data1','response_type','join','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','set','aud','audience','isAfter','unix','exp','resolve','data3','findOne','then','refresh_token','decryptString','{TENANT_ID}','data5','access_token','update','data6','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','POST','intervals','bind','CloudProvider','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','request-promise','../../config/environment','../../config/logger','api','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access'];(function(_0x136532,_0x5a6219){var _0x1c8a04=function(_0x3c07ae){while(--_0x3c07ae){_0x136532['push'](_0x136532['shift']());}};_0x1c8a04(++_0x5a6219);}(_0x12c0,0x172));var _0x012c=function(_0x578d9e,_0x17f9fb){_0x578d9e=_0x578d9e-0x0;var _0x717f26=_0x12c0[_0x578d9e];return _0x717f26;};'use strict';var _=require(_0x012c('0x0'));var crypto=require(_0x012c('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x012c('0x2'));var Redis=require('ioredis');var rp=require(_0x012c('0x3'));var util=require('util');var encryptor=require('../../components/encryptor');var config=require(_0x012c('0x4'));var logger=require(_0x012c('0x5'))(_0x012c('0x6'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0x012c('0x7')]=_[_0x012c('0x8')](config[_0x012c('0x7')],{'host':_0x012c('0x9'),'port':0x18eb});var redis=new Redis(config[_0x012c('0x7')]);var MICROSOFT_AUTH_URL=_0x012c('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0x012c('0xb'),_0x012c('0xc'),_0x012c('0xd'),_0x012c('0xe'),_0x012c('0xf'),_0x012c('0x10'),_0x012c('0x11')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x012c('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x012c('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1fc134){var _0x133b76=_[_0x012c('0x14')](AZURE_AUTH_SCOPES[_0x1fc134[_0x012c('0x15')]]);if(_0x1fc134[_0x012c('0x15')]==='Dynamics365')_0x133b76[_0x012c('0x16')](_0x1fc134[_0x012c('0x17')]+'/.default');return _0x133b76['join']('\x20');}function getAccessTokenScope(_0x56ecf2){if(_0x56ecf2[_0x012c('0x15')]===_0x012c('0x18'))return _0x012c('0xf');if(_0x56ecf2[_0x012c('0x15')]===_0x012c('0x19'))return _0x56ecf2[_0x012c('0x17')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x52ed29,_0x1048e4){var _0x97584a=MICROSOFT_AUTH_URL[_0x012c('0x1a')]('{TENANT_ID}',_0x52ed29[_0x012c('0x1b')]);var _0x3f2a1e=['code',_0x012c('0x1c')];var _0xf6f329=Buffer[_0x012c('0x1d')](JSON[_0x012c('0x1e')]({'id':_0x1048e4}))[_0x012c('0x1f')](_0x012c('0x20'));var _0x393fcf=crypto['randomBytes'](0x10)[_0x012c('0x1f')]('hex');var _0x3f87a5=getAuthorizationScopes(_0x52ed29);var _0x2d3f9b=[{'key':'client_id','value':_0x52ed29[_0x012c('0x21')]},{'key':_0x012c('0x22'),'value':encodeURIComponent(_0x3f2a1e[_0x012c('0x23')]('\x20'))},{'key':_0x012c('0x24'),'value':_0x52ed29[_0x012c('0x25')]},{'key':_0x012c('0x26'),'value':_0x012c('0x27')},{'key':'scope','value':encodeURIComponent(_0x3f87a5)},{'key':_0x012c('0x28'),'value':_0xf6f329},{'key':_0x012c('0x29'),'value':_0x393fcf},{'key':_0x012c('0x2a'),'value':_0x012c('0x2b')}];var _0x1e8620=_0x97584a+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x2d3f9b,function(_0x300f2f){return _0x300f2f[_0x012c('0x2c')]+'='+_0x300f2f[_0x012c('0x2d')];})[_0x012c('0x23')]('&');_0x52ed29[_0x012c('0x2e')]={'issuer':_0x97584a[_0x012c('0x1a')](_0x012c('0x2f'),''),'audience':_0x52ed29['data1'],'state':_0xf6f329,'nonce':_0x393fcf};redis[_0x012c('0x30')](_0xf6f329,JSON[_0x012c('0x1e')](_0x52ed29));return _0x1e8620;}function isValidIdToken(_0x313eae,_0xcc0661){try{var _0x44d241=jwt['decode'](_0x313eae,{'complete':!![]});var _0x36dcde=_0x44d241['payload'];if(_0x36dcde['iss']!==_0xcc0661['issuer'])return![];if(_0x36dcde[_0x012c('0x31')]!==_0xcc0661[_0x012c('0x32')])return![];if(_0x36dcde[_0x012c('0x29')]!==_0xcc0661[_0x012c('0x29')])return![];if(moment()[_0x012c('0x33')](moment[_0x012c('0x34')](_0x36dcde[_0x012c('0x35')])))return![];return!![];}catch(_0x48fce8){throw _0x48fce8;}}function refreshOauth2MicrosoftAccessToken(_0x385b71){return Promise[_0x012c('0x36')]()['then'](function(){if(_0x385b71[_0x012c('0x37')])return _0x385b71;return db['CloudProvider'][_0x012c('0x38')]({'where':{'id':_0x385b71['id']},'raw':!![]});})[_0x012c('0x39')](function(_0x34b221){var _0x15e998={'grant_type':_0x012c('0x3a'),'refresh_token':_0x34b221['data6'],'scope':getAccessTokenScope(_0x34b221),'redirect_uri':_0x34b221['data4'],'client_id':_0x34b221[_0x012c('0x21')],'client_secret':encryptor[_0x012c('0x3b')](_0x34b221['data3'])};var _0x4da511={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x012c('0x3c'),_0x34b221[_0x012c('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x15e998,'json':!![]};return rp(_0x4da511);})[_0x012c('0x39')](function(_0xeda1c6){_0x385b71[_0x012c('0x3d')]=_0xeda1c6[_0x012c('0x3e')];_0x385b71['data6']=_0xeda1c6[_0x012c('0x3a')];return db['CloudProvider'][_0x012c('0x3f')]({'data5':_0x385b71[_0x012c('0x3d')],'data6':_0x385b71[_0x012c('0x40')]},{'where':{'id':_0x385b71['id']}});})[_0x012c('0x39')](function(){return _0x385b71;})[_0x012c('0x41')](function(_0x15a84c){logger[_0x012c('0x42')](_0x012c('0x43'),_0x385b71['id'],_0x15a84c);});}function getOauth2MicrosoftAccessToken(_0x572d6f,_0x3616c5){var _0x4136ea={'grant_type':'authorization_code','code':_0x572d6f,'scope':getAccessTokenScope(_0x3616c5),'redirect_uri':_0x3616c5['data4'],'client_id':_0x3616c5[_0x012c('0x21')],'client_secret':encryptor[_0x012c('0x3b')](_0x3616c5[_0x012c('0x37')])};var _0x4a3489={'method':_0x012c('0x44'),'uri':MICROSOFT_AUTH_URL[_0x012c('0x1a')](_0x012c('0x3c'),_0x3616c5['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4136ea,'json':!![]};return rp(_0x4a3489);}function startRefreshInterval(_0x1a140f){var _0x4f7101=schedule[_0x012c('0x45')];if(_0x4f7101[_0x1a140f['id']])clearInterval(_0x4f7101[_0x1a140f['id']]);_0x4f7101[_0x1a140f['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x012c('0x46')](this,{'id':_0x1a140f['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x012c('0x45')]=_0x4f7101;}function startAllRefreshIntervals(){return db[_0x012c('0x47')][_0x012c('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x012c('0x39')](function(_0x402007){var _0x168871=_0x402007[_0x012c('0x14')](function(_0x42f3b0){return refreshOauth2MicrosoftAccessToken(_0x42f3b0)[_0x012c('0x39')](function(_0x58bf2b){startRefreshInterval(_0x58bf2b);});});return Promise[_0x012c('0x49')](_0x168871);})[_0x012c('0x41')](function(_0x18cb06){var _0x56c7ee=_0x18cb06?util[_0x012c('0x4a')](_0x18cb06,{'showHidden':![],'depth':null}):'';logger[_0x012c('0x42')](_0x012c('0x4b'),_0x56c7ee);});}module[_0x012c('0x4c')]={'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 202f7a4..b5cdb0b 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 _0xa701=['rpc','../../config/environment','jayson/promise','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','ioredis','../../config/logger'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa701,0xd4));var _0x1a70=function(_0x4c4560,_0x56a797){_0x4c4560=_0x4c4560-0x0;var _0x313b56=_0xa701[_0x4c4560];return _0x313b56;};'use strict';var _=require('lodash');var util=require(_0x1a70('0x0'));var moment=require(_0x1a70('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a70('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1a70('0x3'))(_0x1a70('0x4'));var config=require(_0x1a70('0x5'));var jayson=require(_0x1a70('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c700b,_0x191a56,_0x1e5432){return new BPromise(function(_0x85bfd0,_0x1dd89b){return client[_0x1a70('0x7')](_0x1c700b,_0x1e5432)[_0x1a70('0x8')](function(_0x55b5e2){logger[_0x1a70('0x9')](_0x1a70('0xa'),_0x191a56,_0x1a70('0xb'));logger[_0x1a70('0xc')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x191a56,_0x1a70('0xb'),JSON[_0x1a70('0xd')](_0x55b5e2));if(_0x55b5e2[_0x1a70('0xe')]){if(_0x55b5e2['error']['code']===0x1f4){logger[_0x1a70('0xe')]('CloudProvider,\x20%s,\x20%s',_0x191a56,_0x55b5e2[_0x1a70('0xe')]['message']);return _0x1dd89b(_0x55b5e2[_0x1a70('0xe')]['message']);}logger[_0x1a70('0xe')]('CloudProvider,\x20%s,\x20%s',_0x191a56,_0x55b5e2[_0x1a70('0xe')][_0x1a70('0xf')]);return _0x85bfd0(_0x55b5e2[_0x1a70('0xe')][_0x1a70('0xf')]);}else{logger[_0x1a70('0x9')]('CloudProvider,\x20%s,\x20%s',_0x191a56,'request\x20sent');_0x85bfd0(_0x55b5e2[_0x1a70('0x10')]['message']);}})[_0x1a70('0x11')](function(_0x3d8745){logger['error'](_0x1a70('0xa'),_0x191a56,_0x3d8745);_0x1dd89b(_0x3d8745);});});}
\ No newline at end of file
+var _0xa809=['error','message','info','result','catch','util','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x224ad4,_0x4db500){var _0x22a5d9=function(_0x233515){while(--_0x233515){_0x224ad4['push'](_0x224ad4['shift']());}};_0x22a5d9(++_0x4db500);}(_0xa809,0x1f3));var _0x9a80=function(_0x1d070d,_0x44b1dc){_0x1d070d=_0x1d070d-0x0;var _0x150d9f=_0xa809[_0x1d070d];return _0x150d9f;};'use strict';var _=require('lodash');var util=require(_0x9a80('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9a80('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9a80('0x2'))(_0x9a80('0x3'));var config=require(_0x9a80('0x4'));var jayson=require(_0x9a80('0x5'));var client=jayson['client'][_0x9a80('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x504ba8,_0x17b704,_0x286ac5){return new BPromise(function(_0x4ea507,_0x1ef67a){return client[_0x9a80('0x7')](_0x504ba8,_0x286ac5)[_0x9a80('0x8')](function(_0x269ee2){logger['info'](_0x9a80('0x9'),_0x17b704,_0x9a80('0xa'));logger[_0x9a80('0xb')](_0x9a80('0xc'),_0x17b704,_0x9a80('0xa'),JSON[_0x9a80('0xd')](_0x269ee2));if(_0x269ee2[_0x9a80('0xe')]){if(_0x269ee2[_0x9a80('0xe')]['code']===0x1f4){logger[_0x9a80('0xe')](_0x9a80('0x9'),_0x17b704,_0x269ee2[_0x9a80('0xe')][_0x9a80('0xf')]);return _0x1ef67a(_0x269ee2[_0x9a80('0xe')][_0x9a80('0xf')]);}logger[_0x9a80('0xe')](_0x9a80('0x9'),_0x17b704,_0x269ee2['error'][_0x9a80('0xf')]);return _0x4ea507(_0x269ee2['error'][_0x9a80('0xf')]);}else{logger[_0x9a80('0x10')](_0x9a80('0x9'),_0x17b704,'request\x20sent');_0x4ea507(_0x269ee2[_0x9a80('0x11')][_0x9a80('0xf')]);}})[_0x9a80('0x12')](function(_0x12ecee){logger[_0x9a80('0xe')]('CloudProvider,\x20%s,\x20%s',_0x17b704,_0x12ecee);_0x1ef67a(_0x12ecee);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 250e28e..bcb5a44 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x7a54,0x106));var _0x47a5=function(_0x3e97dc,_0x1149f5){_0x3e97dc=_0x3e97dc-0x0;var _0xa601db=_0x7a54[_0x3e97dc];return _0xa601db;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
+var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x56c70f,_0x4e4493){var _0x3812ed=function(_0x25460f){while(--_0x25460f){_0x56c70f['push'](_0x56c70f['shift']());}};_0x3812ed(++_0x4e4493);}(_0x1261,0x144));var _0x1126=function(_0x2dd976,_0x1b5dc4){_0x2dd976=_0x2dd976-0x0;var _0x2265fd=_0x1261[_0x2dd976];return _0x2265fd;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index d185cdf..c5304f1 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 _0x673e=['exports','name','STRING'];(function(_0x1d83e7,_0x36adda){var _0x3cd567=function(_0x2b6cfe){while(--_0x2b6cfe){_0x1d83e7['push'](_0x1d83e7['shift']());}};_0x3cd567(++_0x36adda);}(_0x673e,0x1c8));var _0xe673=function(_0x16c084,_0x9cd758){_0x16c084=_0x16c084-0x0;var _0x435b66=_0x673e[_0x16c084];return _0x435b66;};'use strict';var Sequelize=require('sequelize');module[_0xe673('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xe673('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe673('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xe673('0x2')]},'phone':{'type':Sequelize[_0xe673('0x2')]},'fax':{'type':Sequelize[_0xe673('0x2')]},'type':{'type':Sequelize[_0xe673('0x2')]},'street':{'type':Sequelize[_0xe673('0x2')]},'postalCode':{'type':Sequelize[_0xe673('0x2')]},'city':{'type':Sequelize[_0xe673('0x2')]},'country':{'type':Sequelize[_0xe673('0x2')]},'email':{'type':Sequelize[_0xe673('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe673('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xe673('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xe673('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x605c=['exports','STRING','name','sequelize'];(function(_0x3f0fa8,_0x5173be){var _0x51a920=function(_0x52f0f6){while(--_0x52f0f6){_0x3f0fa8['push'](_0x3f0fa8['shift']());}};_0x51a920(++_0x5173be);}(_0x605c,0x1db));var _0xc605=function(_0x1e0c05,_0x2f76dc){_0x1e0c05=_0x1e0c05-0x0;var _0x423b89=_0x605c[_0x1e0c05];return _0x423b89;};'use strict';var Sequelize=require(_0xc605('0x0'));module[_0xc605('0x1')]={'name':{'type':Sequelize[_0xc605('0x2')],'unique':_0xc605('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc605('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xc605('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc605('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xc605('0x2')]},'postalCode':{'type':Sequelize[_0xc605('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xc605('0x2')]},'email':{'type':Sequelize[_0xc605('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xc605('0x2')]},'sCity':{'type':Sequelize[_0xc605('0x2')]},'sCountry':{'type':Sequelize[_0xc605('0x2')]},'description':{'type':Sequelize[_0xc605('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 7363628..bfd6c1d 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 _0xae34=['CmContact','ids','omit','getContacts','rawAttributes','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','Companies','destroy','error','name','send','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','includeAll','include','CmCompany','findAll','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addContacts'];(function(_0x1109e8,_0xc364e7){var _0x1a217f=function(_0x3f2563){while(--_0x3f2563){_0x1109e8['push'](_0x1109e8['shift']());}};_0x1a217f(++_0xc364e7);}(_0xae34,0x104));var _0x4ae3=function(_0x2688cf,_0x5dfc42){_0x2688cf=_0x2688cf-0x0;var _0x441144=_0xae34[_0x2688cf];return _0x441144;};'use strict';var emlformat=require(_0x4ae3('0x0'));var rimraf=require(_0x4ae3('0x1'));var zipdir=require(_0x4ae3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ae3('0x3'));var moment=require(_0x4ae3('0x4'));var BPromise=require(_0x4ae3('0x5'));var Mustache=require(_0x4ae3('0x6'));var util=require(_0x4ae3('0x7'));var path=require(_0x4ae3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4ae3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ae3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4ae3('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4ae3('0xc'));var Redis=require(_0x4ae3('0xd'));var authService=require(_0x4ae3('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4ae3('0xf'));var hardwareService=require(_0x4ae3('0x10'));var logger=require('../../config/logger')(_0x4ae3('0x11'));var utils=require(_0x4ae3('0x12'));var config=require(_0x4ae3('0x13'));var licenseUtil=require(_0x4ae3('0x14'));var db=require(_0x4ae3('0x15'))['db'];function respondWithStatusCode(_0x34429e,_0x24183b){_0x24183b=_0x24183b||0xcc;return function(_0x4bc4be){if(_0x4bc4be){return _0x34429e[_0x4ae3('0x16')](_0x24183b);}return _0x34429e['status'](_0x24183b)[_0x4ae3('0x17')]();};}function respondWithResult(_0xf348d4,_0x132dce){_0x132dce=_0x132dce||0xc8;return function(_0x28e9fd){if(_0x28e9fd){return _0xf348d4[_0x4ae3('0x18')](_0x132dce)[_0x4ae3('0x19')](_0x28e9fd);}};}function respondWithFilteredResult(_0x120e2b,_0x478836){return function(_0x413394){if(_0x413394){var _0x512138=typeof _0x478836[_0x4ae3('0x1a')]==='undefined'&&typeof _0x478836[_0x4ae3('0x1b')]===_0x4ae3('0x1c');var _0x311b6a=_0x413394[_0x4ae3('0x1d')];var _0x1e5d70=_0x512138?0x0:_0x478836['offset'];var _0x2eb6dc=_0x512138?_0x413394['count']:_0x478836[_0x4ae3('0x1a')]+_0x478836[_0x4ae3('0x1b')];var _0x593c3f;if(_0x2eb6dc>=_0x311b6a){_0x2eb6dc=_0x311b6a;_0x593c3f=0xc8;}else{_0x593c3f=0xce;}_0x120e2b[_0x4ae3('0x18')](_0x593c3f);return _0x120e2b[_0x4ae3('0x1e')](_0x4ae3('0x1f'),_0x1e5d70+'-'+_0x2eb6dc+'/'+_0x311b6a)[_0x4ae3('0x19')](_0x413394);}return null;};}function patchUpdates(_0xdb8179){return function(_0x5bdbb3){try{jsonpatch[_0x4ae3('0x20')](_0x5bdbb3,_0xdb8179,!![]);}catch(_0xe3e3de){return BPromise['reject'](_0xe3e3de);}return _0x5bdbb3['save']();};}function saveUpdates(_0x55c4e1,_0x30a55f){return function(_0x410a82){if(_0x410a82){return _0x410a82[_0x4ae3('0x21')](_0x55c4e1)['then'](function(_0x349302){return _0x349302;});}return null;};}function removeEntity(_0x32e0a1,_0x367c2e){return function(_0x2a39a8){if(_0x2a39a8){return _0x2a39a8['destroy']()[_0x4ae3('0x22')](function(){var _0x3b6afc=_0x2a39a8['get']({'plain':!![]});var _0x1662a8=_0x4ae3('0x23');return db['UserProfileResource'][_0x4ae3('0x24')]({'where':{'type':_0x1662a8,'resourceId':_0x3b6afc['id']}})[_0x4ae3('0x22')](function(){return _0x2a39a8;});})[_0x4ae3('0x22')](function(){_0x32e0a1[_0x4ae3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f1f06,_0x5331eb){return function(_0x202b9a){if(!_0x202b9a){_0x4f1f06[_0x4ae3('0x16')](0x194);}return _0x202b9a;};}function handleError(_0x5c5a18,_0x3b0bb5){_0x3b0bb5=_0x3b0bb5||0x1f4;return function(_0x46c835){logger[_0x4ae3('0x25')](_0x46c835['stack']);if(_0x46c835[_0x4ae3('0x26')]){delete _0x46c835[_0x4ae3('0x26')];}_0x5c5a18[_0x4ae3('0x18')](_0x3b0bb5)[_0x4ae3('0x27')](_0x46c835);};}exports[_0x4ae3('0x28')]=function(_0x3e6b3f,_0x4c5e47){var _0x23ba17={},_0x5cf6a6={},_0x998fbf={'count':0x0,'rows':[]};return db['CmCompany']['describe']()['then'](function(_0x6f9421){_0x5cf6a6[_0x4ae3('0x29')]=_[_0x4ae3('0x2a')](_0x6f9421);_0x5cf6a6[_0x4ae3('0x2b')]=_['keys'](_0x3e6b3f[_0x4ae3('0x2b')]);_0x5cf6a6[_0x4ae3('0x2c')]=_[_0x4ae3('0x2d')](_0x5cf6a6[_0x4ae3('0x29')],_0x5cf6a6['query']);_0x23ba17[_0x4ae3('0x2e')]=_[_0x4ae3('0x2d')](_0x5cf6a6[_0x4ae3('0x29')],qs[_0x4ae3('0x2f')](_0x3e6b3f[_0x4ae3('0x2b')][_0x4ae3('0x2f')]));_0x23ba17[_0x4ae3('0x2e')]=_0x23ba17[_0x4ae3('0x2e')][_0x4ae3('0x30')]?_0x23ba17[_0x4ae3('0x2e')]:_0x5cf6a6[_0x4ae3('0x29')];if(!_0x3e6b3f[_0x4ae3('0x2b')][_0x4ae3('0x31')](_0x4ae3('0x32'))){_0x23ba17[_0x4ae3('0x1b')]=qs['limit'](_0x3e6b3f[_0x4ae3('0x2b')][_0x4ae3('0x1b')]);_0x23ba17[_0x4ae3('0x1a')]=qs[_0x4ae3('0x1a')](_0x3e6b3f[_0x4ae3('0x2b')][_0x4ae3('0x1a')]);}_0x23ba17[_0x4ae3('0x33')]=qs['sort'](_0x3e6b3f[_0x4ae3('0x2b')][_0x4ae3('0x34')]);_0x23ba17[_0x4ae3('0x35')]=qs[_0x4ae3('0x2c')](_[_0x4ae3('0x36')](_0x3e6b3f[_0x4ae3('0x2b')],_0x5cf6a6[_0x4ae3('0x2c')]),_0x6f9421);if(_0x3e6b3f[_0x4ae3('0x2b')][_0x4ae3('0x37')]){_0x23ba17[_0x4ae3('0x35')]=_[_0x4ae3('0x38')](_0x23ba17[_0x4ae3('0x35')],{'$or':_[_0x4ae3('0x39')](_0x23ba17['attributes'],function(_0x39c82f){var _0x4ac8ca={};_0x4ac8ca[_0x39c82f]={'$like':'%'+_0x3e6b3f[_0x4ae3('0x2b')][_0x4ae3('0x37')]+'%'};return _0x4ac8ca;})});}_0x23ba17=_[_0x4ae3('0x38')]({},_0x23ba17,_0x3e6b3f['options']);var _0x2a9657={'where':_0x23ba17[_0x4ae3('0x35')]};return db['CmCompany'][_0x4ae3('0x1d')](_0x2a9657)[_0x4ae3('0x22')](function(_0x2e65b8){_0x998fbf[_0x4ae3('0x1d')]=_0x2e65b8;if(_0x3e6b3f[_0x4ae3('0x2b')][_0x4ae3('0x3a')]){_0x23ba17[_0x4ae3('0x3b')]=[{'all':!![]}];}return db[_0x4ae3('0x3c')][_0x4ae3('0x3d')](_0x23ba17);})[_0x4ae3('0x22')](function(_0x373f19){_0x998fbf['rows']=_0x373f19;return _0x998fbf;})[_0x4ae3('0x22')](respondWithFilteredResult(_0x4c5e47,_0x23ba17))[_0x4ae3('0x3e')](handleError(_0x4c5e47,null));})[_0x4ae3('0x3e')](handleError(_0x4c5e47,null));};exports[_0x4ae3('0x3f')]=function(_0x4446f7,_0x2851db){var _0x15dc50={'raw':![],'where':{'id':_0x4446f7[_0x4ae3('0x40')]['id']}},_0x5b6553={};_0x5b6553[_0x4ae3('0x29')]=_[_0x4ae3('0x2a')](db['CmCompany']['rawAttributes']);_0x5b6553[_0x4ae3('0x2b')]=_[_0x4ae3('0x2a')](_0x4446f7[_0x4ae3('0x2b')]);_0x5b6553[_0x4ae3('0x2c')]=_[_0x4ae3('0x2d')](_0x5b6553[_0x4ae3('0x29')],_0x5b6553[_0x4ae3('0x2b')]);_0x15dc50['attributes']=_[_0x4ae3('0x2d')](_0x5b6553[_0x4ae3('0x29')],qs['fields'](_0x4446f7[_0x4ae3('0x2b')][_0x4ae3('0x2f')]));_0x15dc50[_0x4ae3('0x2e')]=_0x15dc50[_0x4ae3('0x2e')][_0x4ae3('0x30')]?_0x15dc50[_0x4ae3('0x2e')]:_0x5b6553['model'];if(_0x4446f7[_0x4ae3('0x2b')][_0x4ae3('0x3a')]){_0x15dc50[_0x4ae3('0x3b')]=[{'all':!![]}];}_0x15dc50=_[_0x4ae3('0x38')]({},_0x15dc50,_0x4446f7[_0x4ae3('0x41')]);return db[_0x4ae3('0x3c')][_0x4ae3('0x42')](_0x15dc50)[_0x4ae3('0x22')](handleEntityNotFound(_0x2851db,null))['then'](respondWithResult(_0x2851db,null))[_0x4ae3('0x3e')](handleError(_0x2851db,null));};exports['create']=function(_0x1e8c4a,_0x36e44b){return db[_0x4ae3('0x3c')][_0x4ae3('0x43')](_0x1e8c4a['body'],{})[_0x4ae3('0x22')](function(_0x20b01b){var _0x224f69=_0x1e8c4a[_0x4ae3('0x44')]['get']({'plain':!![]});if(!_0x224f69)throw new Error(_0x4ae3('0x45'));if(_0x224f69[_0x4ae3('0x46')]===_0x4ae3('0x44')){var _0x19259e=_0x20b01b[_0x4ae3('0x47')]({'plain':!![]});var _0x5f3914='Companies';return db[_0x4ae3('0x48')][_0x4ae3('0x42')]({'where':{'name':_0x5f3914,'userProfileId':_0x224f69[_0x4ae3('0x49')]},'raw':!![]})[_0x4ae3('0x22')](function(_0x291b16){if(_0x291b16&&_0x291b16[_0x4ae3('0x4a')]===0x0){return db[_0x4ae3('0x4b')][_0x4ae3('0x43')]({'name':_0x19259e['name'],'resourceId':_0x19259e['id'],'type':_0x291b16[_0x4ae3('0x26')],'sectionId':_0x291b16['id']},{})[_0x4ae3('0x22')](function(){return _0x20b01b;});}else{return _0x20b01b;}})[_0x4ae3('0x3e')](function(_0x44f7c1){logger[_0x4ae3('0x25')](_0x4ae3('0x4c'),_0x44f7c1);throw _0x44f7c1;});}return _0x20b01b;})[_0x4ae3('0x22')](respondWithResult(_0x36e44b,0xc9))[_0x4ae3('0x3e')](handleError(_0x36e44b,null));};exports['update']=function(_0x2aab4a,_0x2ed188){if(_0x2aab4a[_0x4ae3('0x4d')]['id']){delete _0x2aab4a['body']['id'];}return db[_0x4ae3('0x3c')][_0x4ae3('0x42')]({'where':{'id':_0x2aab4a[_0x4ae3('0x40')]['id']}})[_0x4ae3('0x22')](handleEntityNotFound(_0x2ed188,null))[_0x4ae3('0x22')](saveUpdates(_0x2aab4a[_0x4ae3('0x4d')],null))[_0x4ae3('0x22')](respondWithResult(_0x2ed188,null))['catch'](handleError(_0x2ed188,null));};exports['destroy']=function(_0x23ff58,_0x3a26e3){return db[_0x4ae3('0x3c')][_0x4ae3('0x42')]({'where':{'id':_0x23ff58[_0x4ae3('0x40')]['id']}})[_0x4ae3('0x22')](handleEntityNotFound(_0x3a26e3,null))[_0x4ae3('0x22')](removeEntity(_0x3a26e3,null))['catch'](handleError(_0x3a26e3,null));};exports[_0x4ae3('0x4e')]=function(_0x598c4e,_0x4a39a5){return db['CmCompany'][_0x4ae3('0x4e')]()[_0x4ae3('0x22')](respondWithResult(_0x4a39a5,null))[_0x4ae3('0x3e')](handleError(_0x4a39a5,null));};exports[_0x4ae3('0x4f')]=function(_0x483a91,_0x31e9b5,_0x54669b){return db[_0x4ae3('0x50')][_0x4ae3('0x42')]({'where':{'id':_0x483a91[_0x4ae3('0x40')]['id']}})['then'](handleEntityNotFound(_0x31e9b5,null))[_0x4ae3('0x22')](function(_0x2139e7){if(_0x2139e7){return _0x2139e7[_0x4ae3('0x4f')](_0x483a91[_0x4ae3('0x4d')][_0x4ae3('0x51')],_[_0x4ae3('0x52')](_0x483a91['body'],[_0x4ae3('0x51'),'id'])||{});}})[_0x4ae3('0x22')](respondWithResult(_0x31e9b5,null))[_0x4ae3('0x3e')](handleError(_0x31e9b5,null));};exports[_0x4ae3('0x53')]=function(_0x3e9714,_0x503e21,_0x40c903){var _0x4f0fdc={};var _0x356c14={};var _0x47f9e8;var _0x19d700;return db[_0x4ae3('0x3c')]['findOne']({'where':{'id':_0x3e9714[_0x4ae3('0x40')]['id']}})[_0x4ae3('0x22')](handleEntityNotFound(_0x503e21,null))['then'](function(_0x1748bd){if(_0x1748bd){_0x47f9e8=_0x1748bd;_0x356c14[_0x4ae3('0x29')]=_[_0x4ae3('0x2a')](db[_0x4ae3('0x50')][_0x4ae3('0x54')]);_0x356c14[_0x4ae3('0x2b')]=_[_0x4ae3('0x2a')](_0x3e9714[_0x4ae3('0x2b')]);_0x356c14[_0x4ae3('0x2c')]=_[_0x4ae3('0x2d')](_0x356c14[_0x4ae3('0x29')],_0x356c14[_0x4ae3('0x2b')]);_0x4f0fdc['attributes']=_[_0x4ae3('0x2d')](_0x356c14['model'],qs[_0x4ae3('0x2f')](_0x3e9714[_0x4ae3('0x2b')][_0x4ae3('0x2f')]));_0x4f0fdc[_0x4ae3('0x2e')]=_0x4f0fdc[_0x4ae3('0x2e')]['length']?_0x4f0fdc[_0x4ae3('0x2e')]:_0x356c14[_0x4ae3('0x29')];_0x4f0fdc[_0x4ae3('0x33')]=qs[_0x4ae3('0x34')](_0x3e9714[_0x4ae3('0x2b')][_0x4ae3('0x34')]);_0x4f0fdc[_0x4ae3('0x35')]=qs[_0x4ae3('0x2c')](_[_0x4ae3('0x36')](_0x3e9714['query'],_0x356c14['filters']));if(_0x3e9714['query'][_0x4ae3('0x37')]){_0x4f0fdc[_0x4ae3('0x35')]=_[_0x4ae3('0x38')](_0x4f0fdc[_0x4ae3('0x35')],{'$or':_[_0x4ae3('0x39')](_0x4f0fdc[_0x4ae3('0x2e')],function(_0x2cb2a3){var _0x524d00={};_0x524d00[_0x2cb2a3]={'$like':'%'+_0x3e9714[_0x4ae3('0x2b')][_0x4ae3('0x37')]+'%'};return _0x524d00;})});}_0x4f0fdc=_[_0x4ae3('0x38')]({},_0x4f0fdc,_0x3e9714[_0x4ae3('0x41')]);return _0x47f9e8[_0x4ae3('0x53')](_0x4f0fdc);}})[_0x4ae3('0x22')](function(_0x432645){if(_0x432645){_0x19d700=_0x432645['length'];if(!_0x3e9714[_0x4ae3('0x2b')]['hasOwnProperty'](_0x4ae3('0x32'))){_0x4f0fdc[_0x4ae3('0x1b')]=qs[_0x4ae3('0x1b')](_0x3e9714['query'][_0x4ae3('0x1b')]);_0x4f0fdc[_0x4ae3('0x1a')]=qs[_0x4ae3('0x1a')](_0x3e9714[_0x4ae3('0x2b')][_0x4ae3('0x1a')]);}return _0x47f9e8[_0x4ae3('0x53')](_0x4f0fdc);}})['then'](function(_0x2fee01){if(_0x2fee01){return _0x2fee01?{'count':_0x19d700,'rows':_0x2fee01}:null;}})[_0x4ae3('0x22')](respondWithResult(_0x503e21,null))[_0x4ae3('0x3e')](handleError(_0x503e21,null));};
\ No newline at end of file
+var _0xfe44=['limit','count','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','describe','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','offset','sort','pick','merge','where','options','include','CmCompany','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','user','role','Companies','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','order','filter','map','getContacts','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined'];(function(_0x134832,_0x4ec0f2){var _0x603c62=function(_0x4ae9f1){while(--_0x4ae9f1){_0x134832['push'](_0x134832['shift']());}};_0x603c62(++_0x4ec0f2);}(_0xfe44,0xf0));var _0x4fe4=function(_0x2f263c,_0x19cf6d){_0x2f263c=_0x2f263c-0x0;var _0x203e23=_0xfe44[_0x2f263c];return _0x203e23;};'use strict';var emlformat=require(_0x4fe4('0x0'));var rimraf=require(_0x4fe4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4fe4('0x2'));var rp=require(_0x4fe4('0x3'));var moment=require(_0x4fe4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4fe4('0x5'));var util=require(_0x4fe4('0x6'));var path=require(_0x4fe4('0x7'));var sox=require(_0x4fe4('0x8'));var csv=require('to-csv');var ejs=require(_0x4fe4('0x9'));var fs=require('fs');var fs_extra=require(_0x4fe4('0xa'));var _=require(_0x4fe4('0xb'));var squel=require(_0x4fe4('0xc'));var crypto=require('crypto');var jsforce=require(_0x4fe4('0xd'));var deskjs=require(_0x4fe4('0xe'));var toCsv=require(_0x4fe4('0xf'));var querystring=require(_0x4fe4('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4fe4('0x11'));var qs=require(_0x4fe4('0x12'));var as=require(_0x4fe4('0x13'));var hardwareService=require(_0x4fe4('0x14'));var logger=require(_0x4fe4('0x15'))('api');var utils=require(_0x4fe4('0x16'));var config=require(_0x4fe4('0x17'));var licenseUtil=require(_0x4fe4('0x18'));var db=require(_0x4fe4('0x19'))['db'];function respondWithStatusCode(_0x2316e9,_0x739028){_0x739028=_0x739028||0xcc;return function(_0x50fe0f){if(_0x50fe0f){return _0x2316e9['sendStatus'](_0x739028);}return _0x2316e9[_0x4fe4('0x1a')](_0x739028)[_0x4fe4('0x1b')]();};}function respondWithResult(_0x3b6689,_0x1981be){_0x1981be=_0x1981be||0xc8;return function(_0x2598ac){if(_0x2598ac){return _0x3b6689[_0x4fe4('0x1a')](_0x1981be)[_0x4fe4('0x1c')](_0x2598ac);}};}function respondWithFilteredResult(_0x512cec,_0x317ff8){return function(_0x38b701){if(_0x38b701){var _0x322f50=typeof _0x317ff8['offset']===_0x4fe4('0x1d')&&typeof _0x317ff8[_0x4fe4('0x1e')]===_0x4fe4('0x1d');var _0x511c53=_0x38b701[_0x4fe4('0x1f')];var _0x345a1e=_0x322f50?0x0:_0x317ff8['offset'];var _0x18efb6=_0x322f50?_0x38b701['count']:_0x317ff8['offset']+_0x317ff8['limit'];var _0x5b9edf;if(_0x18efb6>=_0x511c53){_0x18efb6=_0x511c53;_0x5b9edf=0xc8;}else{_0x5b9edf=0xce;}_0x512cec[_0x4fe4('0x1a')](_0x5b9edf);return _0x512cec[_0x4fe4('0x20')](_0x4fe4('0x21'),_0x345a1e+'-'+_0x18efb6+'/'+_0x511c53)[_0x4fe4('0x1c')](_0x38b701);}return null;};}function patchUpdates(_0x52dc78){return function(_0x1bd1fd){try{jsonpatch[_0x4fe4('0x22')](_0x1bd1fd,_0x52dc78,!![]);}catch(_0x4b69e6){return BPromise['reject'](_0x4b69e6);}return _0x1bd1fd[_0x4fe4('0x23')]();};}function saveUpdates(_0x247a19,_0x17f100){return function(_0xd7b20d){if(_0xd7b20d){return _0xd7b20d[_0x4fe4('0x24')](_0x247a19)[_0x4fe4('0x25')](function(_0x4666ce){return _0x4666ce;});}return null;};}function removeEntity(_0x2db868,_0x9b3f82){return function(_0x256fcd){if(_0x256fcd){return _0x256fcd['destroy']()['then'](function(){var _0x2fc31f=_0x256fcd[_0x4fe4('0x26')]({'plain':!![]});var _0x352656='Companies';return db[_0x4fe4('0x27')][_0x4fe4('0x28')]({'where':{'type':_0x352656,'resourceId':_0x2fc31f['id']}})[_0x4fe4('0x25')](function(){return _0x256fcd;});})[_0x4fe4('0x25')](function(){_0x2db868['status'](0xcc)[_0x4fe4('0x1b')]();});}};}function handleEntityNotFound(_0x552f00,_0xd65cb0){return function(_0x3b34c2){if(!_0x3b34c2){_0x552f00[_0x4fe4('0x29')](0x194);}return _0x3b34c2;};}function handleError(_0x1880f6,_0xa52cc6){_0xa52cc6=_0xa52cc6||0x1f4;return function(_0x315e9c){logger[_0x4fe4('0x2a')](_0x315e9c[_0x4fe4('0x2b')]);if(_0x315e9c[_0x4fe4('0x2c')]){delete _0x315e9c['name'];}_0x1880f6[_0x4fe4('0x1a')](_0xa52cc6)[_0x4fe4('0x2d')](_0x315e9c);};}exports[_0x4fe4('0x2e')]=function(_0x4f95d1,_0x5cf1ab){var _0x40247d={},_0x2a30ce={},_0x519fc8={'count':0x0,'rows':[]};return db['CmCompany'][_0x4fe4('0x2f')]()[_0x4fe4('0x25')](function(_0x50c0d8){_0x2a30ce[_0x4fe4('0x30')]=_[_0x4fe4('0x31')](_0x50c0d8);_0x2a30ce[_0x4fe4('0x32')]=_[_0x4fe4('0x31')](_0x4f95d1[_0x4fe4('0x32')]);_0x2a30ce[_0x4fe4('0x33')]=_['intersection'](_0x2a30ce[_0x4fe4('0x30')],_0x2a30ce[_0x4fe4('0x32')]);_0x40247d[_0x4fe4('0x34')]=_[_0x4fe4('0x35')](_0x2a30ce['model'],qs[_0x4fe4('0x36')](_0x4f95d1[_0x4fe4('0x32')][_0x4fe4('0x36')]));_0x40247d[_0x4fe4('0x34')]=_0x40247d[_0x4fe4('0x34')]['length']?_0x40247d[_0x4fe4('0x34')]:_0x2a30ce[_0x4fe4('0x30')];if(!_0x4f95d1[_0x4fe4('0x32')][_0x4fe4('0x37')](_0x4fe4('0x38'))){_0x40247d['limit']=qs[_0x4fe4('0x1e')](_0x4f95d1[_0x4fe4('0x32')][_0x4fe4('0x1e')]);_0x40247d[_0x4fe4('0x39')]=qs['offset'](_0x4f95d1[_0x4fe4('0x32')]['offset']);}_0x40247d['order']=qs[_0x4fe4('0x3a')](_0x4f95d1[_0x4fe4('0x32')]['sort']);_0x40247d['where']=qs[_0x4fe4('0x33')](_[_0x4fe4('0x3b')](_0x4f95d1[_0x4fe4('0x32')],_0x2a30ce[_0x4fe4('0x33')]),_0x50c0d8);if(_0x4f95d1['query']['filter']){_0x40247d['where']=_[_0x4fe4('0x3c')](_0x40247d[_0x4fe4('0x3d')],{'$or':_['map'](_0x40247d[_0x4fe4('0x34')],function(_0x3c080d){var _0x2fe4c6={};_0x2fe4c6[_0x3c080d]={'$like':'%'+_0x4f95d1[_0x4fe4('0x32')]['filter']+'%'};return _0x2fe4c6;})});}_0x40247d=_[_0x4fe4('0x3c')]({},_0x40247d,_0x4f95d1[_0x4fe4('0x3e')]);var _0x5120da={'where':_0x40247d[_0x4fe4('0x3d')]};return db['CmCompany'][_0x4fe4('0x1f')](_0x5120da)['then'](function(_0x2ff17b){_0x519fc8[_0x4fe4('0x1f')]=_0x2ff17b;if(_0x4f95d1[_0x4fe4('0x32')]['includeAll']){_0x40247d[_0x4fe4('0x3f')]=[{'all':!![]}];}return db[_0x4fe4('0x40')][_0x4fe4('0x41')](_0x40247d);})[_0x4fe4('0x25')](function(_0x3ad85e){_0x519fc8[_0x4fe4('0x42')]=_0x3ad85e;return _0x519fc8;})[_0x4fe4('0x25')](respondWithFilteredResult(_0x5cf1ab,_0x40247d))[_0x4fe4('0x43')](handleError(_0x5cf1ab,null));})[_0x4fe4('0x43')](handleError(_0x5cf1ab,null));};exports[_0x4fe4('0x44')]=function(_0x39a04b,_0x346127){var _0x5ab324={'raw':![],'where':{'id':_0x39a04b[_0x4fe4('0x45')]['id']}},_0x1e9b0d={};_0x1e9b0d[_0x4fe4('0x30')]=_['keys'](db[_0x4fe4('0x40')][_0x4fe4('0x46')]);_0x1e9b0d[_0x4fe4('0x32')]=_[_0x4fe4('0x31')](_0x39a04b[_0x4fe4('0x32')]);_0x1e9b0d[_0x4fe4('0x33')]=_[_0x4fe4('0x35')](_0x1e9b0d[_0x4fe4('0x30')],_0x1e9b0d['query']);_0x5ab324['attributes']=_[_0x4fe4('0x35')](_0x1e9b0d[_0x4fe4('0x30')],qs[_0x4fe4('0x36')](_0x39a04b[_0x4fe4('0x32')]['fields']));_0x5ab324[_0x4fe4('0x34')]=_0x5ab324[_0x4fe4('0x34')][_0x4fe4('0x47')]?_0x5ab324['attributes']:_0x1e9b0d[_0x4fe4('0x30')];if(_0x39a04b[_0x4fe4('0x32')][_0x4fe4('0x48')]){_0x5ab324[_0x4fe4('0x3f')]=[{'all':!![]}];}_0x5ab324=_[_0x4fe4('0x3c')]({},_0x5ab324,_0x39a04b[_0x4fe4('0x3e')]);return db[_0x4fe4('0x40')][_0x4fe4('0x49')](_0x5ab324)[_0x4fe4('0x25')](handleEntityNotFound(_0x346127,null))['then'](respondWithResult(_0x346127,null))[_0x4fe4('0x43')](handleError(_0x346127,null));};exports[_0x4fe4('0x4a')]=function(_0x56783c,_0x35b6cd){return db[_0x4fe4('0x40')][_0x4fe4('0x4a')](_0x56783c[_0x4fe4('0x4b')],{})[_0x4fe4('0x25')](function(_0x545202){var _0x57ad3e=_0x56783c[_0x4fe4('0x4c')][_0x4fe4('0x26')]({'plain':!![]});if(!_0x57ad3e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57ad3e[_0x4fe4('0x4d')]===_0x4fe4('0x4c')){var _0x1441c7=_0x545202[_0x4fe4('0x26')]({'plain':!![]});var _0x4c6c86=_0x4fe4('0x4e');return db[_0x4fe4('0x4f')][_0x4fe4('0x49')]({'where':{'name':_0x4c6c86,'userProfileId':_0x57ad3e[_0x4fe4('0x50')]},'raw':!![]})[_0x4fe4('0x25')](function(_0x5124c1){if(_0x5124c1&&_0x5124c1['autoAssociation']===0x0){return db[_0x4fe4('0x27')]['create']({'name':_0x1441c7['name'],'resourceId':_0x1441c7['id'],'type':_0x5124c1[_0x4fe4('0x2c')],'sectionId':_0x5124c1['id']},{})[_0x4fe4('0x25')](function(){return _0x545202;});}else{return _0x545202;}})[_0x4fe4('0x43')](function(_0x4c5385){logger[_0x4fe4('0x2a')](_0x4fe4('0x51'),_0x4c5385);throw _0x4c5385;});}return _0x545202;})[_0x4fe4('0x25')](respondWithResult(_0x35b6cd,0xc9))['catch'](handleError(_0x35b6cd,null));};exports[_0x4fe4('0x24')]=function(_0xe968f9,_0x11b20e){if(_0xe968f9[_0x4fe4('0x4b')]['id']){delete _0xe968f9[_0x4fe4('0x4b')]['id'];}return db[_0x4fe4('0x40')][_0x4fe4('0x49')]({'where':{'id':_0xe968f9[_0x4fe4('0x45')]['id']}})['then'](handleEntityNotFound(_0x11b20e,null))['then'](saveUpdates(_0xe968f9['body'],null))[_0x4fe4('0x25')](respondWithResult(_0x11b20e,null))[_0x4fe4('0x43')](handleError(_0x11b20e,null));};exports[_0x4fe4('0x28')]=function(_0x42ad1e,_0x4ef8cb){return db[_0x4fe4('0x40')]['find']({'where':{'id':_0x42ad1e[_0x4fe4('0x45')]['id']}})[_0x4fe4('0x25')](handleEntityNotFound(_0x4ef8cb,null))[_0x4fe4('0x25')](removeEntity(_0x4ef8cb,null))[_0x4fe4('0x43')](handleError(_0x4ef8cb,null));};exports[_0x4fe4('0x2f')]=function(_0x1a4472,_0x523871){return db[_0x4fe4('0x40')][_0x4fe4('0x2f')]()[_0x4fe4('0x25')](respondWithResult(_0x523871,null))[_0x4fe4('0x43')](handleError(_0x523871,null));};exports[_0x4fe4('0x52')]=function(_0x7d21cf,_0x37111e,_0x36e091){return db[_0x4fe4('0x53')][_0x4fe4('0x49')]({'where':{'id':_0x7d21cf[_0x4fe4('0x45')]['id']}})[_0x4fe4('0x25')](handleEntityNotFound(_0x37111e,null))[_0x4fe4('0x25')](function(_0x1fc911){if(_0x1fc911){return _0x1fc911[_0x4fe4('0x52')](_0x7d21cf[_0x4fe4('0x4b')][_0x4fe4('0x54')],_[_0x4fe4('0x55')](_0x7d21cf[_0x4fe4('0x4b')],[_0x4fe4('0x54'),'id'])||{});}})['then'](respondWithResult(_0x37111e,null))[_0x4fe4('0x43')](handleError(_0x37111e,null));};exports['getContacts']=function(_0x24cfe3,_0x41ebe1,_0x1a5895){var _0x28ab1c={};var _0x25a2d0={};var _0x4b42a4;var _0x36eef8;return db[_0x4fe4('0x40')]['findOne']({'where':{'id':_0x24cfe3[_0x4fe4('0x45')]['id']}})[_0x4fe4('0x25')](handleEntityNotFound(_0x41ebe1,null))['then'](function(_0x2cbba1){if(_0x2cbba1){_0x4b42a4=_0x2cbba1;_0x25a2d0[_0x4fe4('0x30')]=_['keys'](db[_0x4fe4('0x53')][_0x4fe4('0x46')]);_0x25a2d0[_0x4fe4('0x32')]=_['keys'](_0x24cfe3[_0x4fe4('0x32')]);_0x25a2d0[_0x4fe4('0x33')]=_[_0x4fe4('0x35')](_0x25a2d0[_0x4fe4('0x30')],_0x25a2d0[_0x4fe4('0x32')]);_0x28ab1c[_0x4fe4('0x34')]=_[_0x4fe4('0x35')](_0x25a2d0[_0x4fe4('0x30')],qs[_0x4fe4('0x36')](_0x24cfe3[_0x4fe4('0x32')][_0x4fe4('0x36')]));_0x28ab1c['attributes']=_0x28ab1c[_0x4fe4('0x34')][_0x4fe4('0x47')]?_0x28ab1c[_0x4fe4('0x34')]:_0x25a2d0['model'];_0x28ab1c[_0x4fe4('0x56')]=qs[_0x4fe4('0x3a')](_0x24cfe3[_0x4fe4('0x32')][_0x4fe4('0x3a')]);_0x28ab1c['where']=qs[_0x4fe4('0x33')](_[_0x4fe4('0x3b')](_0x24cfe3['query'],_0x25a2d0[_0x4fe4('0x33')]));if(_0x24cfe3[_0x4fe4('0x32')][_0x4fe4('0x57')]){_0x28ab1c['where']=_['merge'](_0x28ab1c[_0x4fe4('0x3d')],{'$or':_[_0x4fe4('0x58')](_0x28ab1c['attributes'],function(_0x45c47b){var _0x20e538={};_0x20e538[_0x45c47b]={'$like':'%'+_0x24cfe3[_0x4fe4('0x32')][_0x4fe4('0x57')]+'%'};return _0x20e538;})});}_0x28ab1c=_['merge']({},_0x28ab1c,_0x24cfe3[_0x4fe4('0x3e')]);return _0x4b42a4[_0x4fe4('0x59')](_0x28ab1c);}})['then'](function(_0x10ceb3){if(_0x10ceb3){_0x36eef8=_0x10ceb3[_0x4fe4('0x47')];if(!_0x24cfe3[_0x4fe4('0x32')][_0x4fe4('0x37')](_0x4fe4('0x38'))){_0x28ab1c[_0x4fe4('0x1e')]=qs['limit'](_0x24cfe3[_0x4fe4('0x32')][_0x4fe4('0x1e')]);_0x28ab1c[_0x4fe4('0x39')]=qs[_0x4fe4('0x39')](_0x24cfe3['query'][_0x4fe4('0x39')]);}return _0x4b42a4[_0x4fe4('0x59')](_0x28ab1c);}})[_0x4fe4('0x25')](function(_0x4590d5){if(_0x4590d5){return _0x4590d5?{'count':_0x36eef8,'rows':_0x4590d5}:null;}})[_0x4fe4('0x25')](respondWithResult(_0x41ebe1,null))[_0x4fe4('0x43')](handleError(_0x41ebe1,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 6f1e610..de3596a 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 _0xf355=['api','moment','bluebird','request-promise','path','rimraf','./cmCompany.attributes','define','CmCompany','lodash'];(function(_0x1eafae,_0x581257){var _0x37cc60=function(_0x4b4aad){while(--_0x4b4aad){_0x1eafae['push'](_0x1eafae['shift']());}};_0x37cc60(++_0x581257);}(_0xf355,0x17b));var _0x5f35=function(_0x2411ea,_0x4e2188){_0x2411ea=_0x2411ea-0x0;var _0x4b9644=_0xf355[_0x2411ea];return _0x4b9644;};'use strict';var _=require(_0x5f35('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5f35('0x1'));var moment=require(_0x5f35('0x2'));var BPromise=require(_0x5f35('0x3'));var rp=require(_0x5f35('0x4'));var fs=require('fs');var path=require(_0x5f35('0x5'));var rimraf=require(_0x5f35('0x6'));var config=require('../../config/environment');var attributes=require(_0x5f35('0x7'));module['exports']=function(_0x2363c0,_0xbee771){return _0x2363c0[_0x5f35('0x8')](_0x5f35('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1591=['exports','define','cm_companies','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x238b73,_0x5df76f){var _0x5966d9=function(_0x57802d){while(--_0x57802d){_0x238b73['push'](_0x238b73['shift']());}};_0x5966d9(++_0x5df76f);}(_0x1591,0x162));var _0x1159=function(_0x3958fe,_0x3c6605){_0x3958fe=_0x3958fe-0x0;var _0x1f27d6=_0x1591[_0x3958fe];return _0x1f27d6;};'use strict';var _=require(_0x1159('0x0'));var util=require(_0x1159('0x1'));var logger=require(_0x1159('0x2'))(_0x1159('0x3'));var moment=require('moment');var BPromise=require(_0x1159('0x4'));var rp=require(_0x1159('0x5'));var fs=require('fs');var path=require(_0x1159('0x6'));var rimraf=require(_0x1159('0x7'));var config=require(_0x1159('0x8'));var attributes=require(_0x1159('0x9'));module[_0x1159('0xa')]=function(_0x217a06,_0x3e672a){return _0x217a06[_0x1159('0xb')]('CmCompany',attributes,{'tableName':_0x1159('0xc'),'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 4c89e00..4571a3d 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 _0xe90e=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x4f1050,_0xaceeab){var _0x1cc2cf=function(_0x325cef){while(--_0x325cef){_0x4f1050['push'](_0x4f1050['shift']());}};_0x1cc2cf(++_0xaceeab);}(_0xe90e,0x1c0));var _0xee90=function(_0x1d619,_0x51f2b5){_0x1d619=_0x1d619-0x0;var _0x330693=_0xe90e[_0x1d619];return _0x330693;};'use strict';var _=require(_0xee90('0x0'));var util=require('util');var moment=require(_0xee90('0x1'));var BPromise=require(_0xee90('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee90('0x3'));var db=require(_0xee90('0x4'))['db'];var utils=require(_0xee90('0x5'));var logger=require(_0xee90('0x6'))(_0xee90('0x7'));var config=require('../../config/environment');var jayson=require(_0xee90('0x8'));var client=jayson[_0xee90('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xab031d,_0x58350d,_0x25d765){return new BPromise(function(_0x56e6d1,_0x30ceb0){return client[_0xee90('0xa')](_0xab031d,_0x25d765)[_0xee90('0xb')](function(_0x1b98af){logger[_0xee90('0xc')](_0xee90('0xd'),_0x58350d,_0xee90('0xe'));logger[_0xee90('0xf')](_0xee90('0x10'),_0x58350d,_0xee90('0xe'),JSON['stringify'](_0x1b98af));if(_0x1b98af[_0xee90('0x11')]){if(_0x1b98af[_0xee90('0x11')]['code']===0x1f4){logger['error'](_0xee90('0xd'),_0x58350d,_0x1b98af[_0xee90('0x11')]['message']);return _0x30ceb0(_0x1b98af[_0xee90('0x11')][_0xee90('0x12')]);}logger[_0xee90('0x11')](_0xee90('0xd'),_0x58350d,_0x1b98af['error'][_0xee90('0x12')]);return _0x56e6d1(_0x1b98af[_0xee90('0x11')][_0xee90('0x12')]);}else{logger[_0xee90('0xc')](_0xee90('0xd'),_0x58350d,_0xee90('0xe'));_0x56e6d1(_0x1b98af['result'][_0xee90('0x12')]);}})[_0xee90('0x13')](function(_0x4e423f){logger[_0xee90('0x11')](_0xee90('0xd'),_0x58350d,_0x4e423f);_0x30ceb0(_0x4e423f);});});}
\ No newline at end of file
+var _0xc8bd=['CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x21e8a3,_0x1e2514){var _0x1c14da=function(_0xfda92f){while(--_0xfda92f){_0x21e8a3['push'](_0x21e8a3['shift']());}};_0x1c14da(++_0x1e2514);}(_0xc8bd,0xa8));var _0xdc8b=function(_0x386247,_0x5dcfa9){_0x386247=_0x386247-0x0;var _0x3abf65=_0xc8bd[_0x386247];return _0x3abf65;};'use strict';var _=require('lodash');var util=require(_0xdc8b('0x0'));var moment=require('moment');var BPromise=require(_0xdc8b('0x1'));var rs=require(_0xdc8b('0x2'));var fs=require('fs');var Redis=require(_0xdc8b('0x3'));var db=require(_0xdc8b('0x4'))['db'];var utils=require(_0xdc8b('0x5'));var logger=require('../../config/logger')(_0xdc8b('0x6'));var config=require(_0xdc8b('0x7'));var jayson=require(_0xdc8b('0x8'));var client=jayson[_0xdc8b('0x9')][_0xdc8b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x274666,_0x3d10c9,_0x260369){return new BPromise(function(_0xc4d2e2,_0x43be17){return client[_0xdc8b('0xb')](_0x274666,_0x260369)[_0xdc8b('0xc')](function(_0x4426e0){logger['info'](_0xdc8b('0xd'),_0x3d10c9,_0xdc8b('0xe'));logger[_0xdc8b('0xf')](_0xdc8b('0x10'),_0x3d10c9,_0xdc8b('0xe'),JSON[_0xdc8b('0x11')](_0x4426e0));if(_0x4426e0[_0xdc8b('0x12')]){if(_0x4426e0[_0xdc8b('0x12')][_0xdc8b('0x13')]===0x1f4){logger[_0xdc8b('0x12')]('CmCompany,\x20%s,\x20%s',_0x3d10c9,_0x4426e0[_0xdc8b('0x12')][_0xdc8b('0x14')]);return _0x43be17(_0x4426e0['error']['message']);}logger[_0xdc8b('0x12')](_0xdc8b('0xd'),_0x3d10c9,_0x4426e0[_0xdc8b('0x12')][_0xdc8b('0x14')]);return _0xc4d2e2(_0x4426e0[_0xdc8b('0x12')]['message']);}else{logger[_0xdc8b('0x15')](_0xdc8b('0xd'),_0x3d10c9,'request\x20sent');_0xc4d2e2(_0x4426e0['result'][_0xdc8b('0x14')]);}})[_0xdc8b('0x16')](function(_0x3e1563){logger[_0xdc8b('0x12')](_0xdc8b('0xd'),_0x3d10c9,_0x3e1563);_0x43be17(_0x3e1563);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index fe6d0b5..3e169c9 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 _0x8a0b=['/:id','show','/:id/contacts','getContacts','create','post','put','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','get','isAuthenticated'];(function(_0x85a7e,_0x2b6e2c){var _0x2e9266=function(_0x1d3bb7){while(--_0x1d3bb7){_0x85a7e['push'](_0x85a7e['shift']());}};_0x2e9266(++_0x2b6e2c);}(_0x8a0b,0x9c));var _0xb8a0=function(_0xf7f04c,_0x15c148){_0xf7f04c=_0xf7f04c-0x0;var _0x7094ba=_0x8a0b[_0xf7f04c];return _0x7094ba;};'use strict';var multer=require('multer');var util=require(_0xb8a0('0x0'));var path=require(_0xb8a0('0x1'));var timeout=require('connect-timeout');var express=require(_0xb8a0('0x2'));var router=express[_0xb8a0('0x3')]();var fs_extra=require(_0xb8a0('0x4'));var auth=require(_0xb8a0('0x5'));var interaction=require(_0xb8a0('0x6'));var config=require(_0xb8a0('0x7'));var controller=require(_0xb8a0('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb8a0('0x9')]);router[_0xb8a0('0xa')]('/describe',auth[_0xb8a0('0xb')](),controller['describe']);router[_0xb8a0('0xa')](_0xb8a0('0xc'),auth[_0xb8a0('0xb')](),controller[_0xb8a0('0xd')]);router[_0xb8a0('0xa')](_0xb8a0('0xe'),auth[_0xb8a0('0xb')](),controller[_0xb8a0('0xf')]);router['post']('/',auth[_0xb8a0('0xb')](),controller[_0xb8a0('0x10')]);router[_0xb8a0('0x11')]('/:id/contacts',auth[_0xb8a0('0xb')](),controller['addContacts']);router[_0xb8a0('0x12')]('/:id',auth[_0xb8a0('0xb')](),controller['update']);router[_0xb8a0('0x13')](_0xb8a0('0xc'),auth[_0xb8a0('0xb')](),controller['destroy']);module[_0xb8a0('0x14')]=router;
\ No newline at end of file
+var _0xfd6d=['../../components/auth/service','../../components/interaction/service','./cmCompany.controller','index','/describe','isAuthenticated','get','/:id','show','getContacts','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1a209f,_0x1b35e6){var _0x376b56=function(_0x5ed729){while(--_0x5ed729){_0x1a209f['push'](_0x1a209f['shift']());}};_0x376b56(++_0x1b35e6);}(_0xfd6d,0xb9));var _0xdfd6=function(_0x295729,_0xce308){_0x295729=_0x295729-0x0;var _0x4da443=_0xfd6d[_0x295729];return _0x4da443;};'use strict';var multer=require(_0xdfd6('0x0'));var util=require(_0xdfd6('0x1'));var path=require(_0xdfd6('0x2'));var timeout=require(_0xdfd6('0x3'));var express=require(_0xdfd6('0x4'));var router=express[_0xdfd6('0x5')]();var fs_extra=require(_0xdfd6('0x6'));var auth=require(_0xdfd6('0x7'));var interaction=require(_0xdfd6('0x8'));var config=require('../../config/environment');var controller=require(_0xdfd6('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xdfd6('0xa')]);router['get'](_0xdfd6('0xb'),auth[_0xdfd6('0xc')](),controller['describe']);router[_0xdfd6('0xd')](_0xdfd6('0xe'),auth[_0xdfd6('0xc')](),controller[_0xdfd6('0xf')]);router[_0xdfd6('0xd')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xdfd6('0x10')]);router[_0xdfd6('0x11')]('/',auth['isAuthenticated'](),controller[_0xdfd6('0x12')]);router[_0xdfd6('0x11')]('/:id/contacts',auth[_0xdfd6('0xc')](),controller['addContacts']);router[_0xdfd6('0x13')](_0xdfd6('0xe'),auth[_0xdfd6('0xc')](),controller[_0xdfd6('0x14')]);router[_0xdfd6('0x15')]('/:id',auth[_0xdfd6('0xc')](),controller[_0xdfd6('0x16')]);module[_0xdfd6('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 2ad30a7..aed5633 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 _0xcb81=['UNSIGNED','NOW','lodash','STRING','INTEGER'];(function(_0x46bc6e,_0x1b2c3b){var _0xef4298=function(_0x4526bb){while(--_0x4526bb){_0x46bc6e['push'](_0x46bc6e['shift']());}};_0xef4298(++_0x1b2c3b);}(_0xcb81,0xfc));var _0x1cb8=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0xcb81[_0x1e03a6];return _0x295b64;};'use strict';var _=require(_0x1cb8('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x1cb8('0x1')]},'dateOfBirth':{'type':Sequelize[_0x1cb8('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x1cb8('0x1')]},'fax':{'type':Sequelize[_0x1cb8('0x1')]},'email':{'type':Sequelize[_0x1cb8('0x1')]},'url':{'type':Sequelize[_0x1cb8('0x1')]},'facebook':{'type':Sequelize[_0x1cb8('0x1')]},'fb_data':{'type':Sequelize[_0x1cb8('0x1')]},'twitter':{'type':Sequelize[_0x1cb8('0x1')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x1cb8('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x1cb8('0x1')]},'wechat':{'type':Sequelize[_0x1cb8('0x1')]},'telegram':{'type':Sequelize[_0x1cb8('0x1')]},'UserId':{'type':Sequelize[_0x1cb8('0x2')]},'AdditionalPhones':{'type':Sequelize[_0x1cb8('0x1')]},'priority':{'type':Sequelize[_0x1cb8('0x2')](0x2)[_0x1cb8('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x1cb8('0x4')]},'dialTimezone':{'type':Sequelize[_0x1cb8('0x1')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xba1e=['lodash','sequelize','exports','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x5d07e1,_0x418799){var _0x21617f=function(_0x3e8068){while(--_0x3e8068){_0x5d07e1['push'](_0x5d07e1['shift']());}};_0x21617f(++_0x418799);}(_0xba1e,0x12d));var _0xeba1=function(_0x5d1b11,_0x48c8c6){_0x5d1b11=_0x5d1b11-0x0;var _0x1ad2b5=_0xba1e[_0x5d1b11];return _0x1ad2b5;};'use strict';var _=require(_0xeba1('0x0'));var Sequelize=require(_0xeba1('0x1'));module[_0xeba1('0x2')]={'firstName':{'type':Sequelize[_0xeba1('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xeba1('0x3')]},'street':{'type':Sequelize[_0xeba1('0x3')]},'postalCode':{'type':Sequelize[_0xeba1('0x3')]},'city':{'type':Sequelize[_0xeba1('0x3')]},'country':{'type':Sequelize[_0xeba1('0x3')]},'dateOfBirth':{'type':Sequelize[_0xeba1('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xeba1('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xeba1('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xeba1('0x3')]},'fb_data':{'type':Sequelize[_0xeba1('0x3')]},'twitter':{'type':Sequelize[_0xeba1('0x3')]},'skype':{'type':Sequelize[_0xeba1('0x3')]},'teams':{'type':Sequelize[_0xeba1('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xeba1('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xeba1('0x3')]},'priority':{'type':Sequelize[_0xeba1('0x4')](0x2)[_0xeba1('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xeba1('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xeba1('0x3')]},'utcOffset':{'type':Sequelize[_0xeba1('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index caa00d1..75ebd89 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 _0x5f98=['status','json','undefined','limit','count','offset','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','index','describe','findAll','query','user','catch','tags','keys','cf_','columnName','analytics','CmCustomField','displayName','alias','custom','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','body','CmContact','from','length','get','mergeWith','isArray','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','create','join','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','push','ListId','findOrCreate','all','show','find','color','tag','CmContactHasItem','Phones','params','ContactItemType','ItemType','sequelize','Phones.OrderBy','$and','omit','map','format','cf_%d','isNil','isEmpty','table','cm_contacts','setFields','text','values','phone','getTags','findOne','model','filters','intersection','fields','attributes','sort','pick','filter','merge','nolimit','setTags','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','PHONE','literal','CmHopperId','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rawAttributes','order','ContactId','options','includeAll','include','rows','getHopperHistories','CmHopperHistory','getHopperFinals','getJscriptySessions','uploadCsv','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','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','path','meta','import','User','agent','No\x20ListId\x20specified','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','getJourney','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','includes','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','type','source','destination','callerid','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','DESC','findAndCountAll','fullname','startCase','closed','closedAt','secondDisposition','thirdDisposition','key','Tag','Tags','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','mail','subject','substatus','Interaction','Owner','flatten','sortBy','reverse','moment','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5f98,0x1de));var _0x85f9=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x5f98[_0x243b2f];return _0xcb3c2d;};'use strict';var moment=require(_0x85f9('0x0'));var BPromise=require('bluebird');var util=require(_0x85f9('0x1'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x85f9('0x2'));var Papa=require('papaparse');var Redis=require(_0x85f9('0x3'));var contacts=require('../../components/contacts');var qs=require(_0x85f9('0x4'));var logger=require(_0x85f9('0x5'))(_0x85f9('0x6'));var config=require(_0x85f9('0x7'));var shared=require(_0x85f9('0x8'));var db=require(_0x85f9('0x9'))['db'];config[_0x85f9('0xa')]=_[_0x85f9('0xb')](config[_0x85f9('0xa')],{'host':_0x85f9('0xc'),'port':0x18eb});var socket=require(_0x85f9('0xd'))(new Redis(config[_0x85f9('0xa')]));require(_0x85f9('0xe'))[_0x85f9('0xf')](socket);function respondWithResult(_0x11ca1d,_0x547827){_0x547827=_0x547827||0xc8;return function(_0x210451){if(_0x210451){return _0x11ca1d[_0x85f9('0x10')](_0x547827)[_0x85f9('0x11')](_0x210451);}};}function respondWithFilteredResult(_0x497fcb,_0x3b3dc5){return function(_0x442d4f){if(_0x442d4f){var _0x4f52f2=typeof _0x3b3dc5['offset']===_0x85f9('0x12')&&typeof _0x3b3dc5[_0x85f9('0x13')]===_0x85f9('0x12');var _0x3aee2f=_0x442d4f[_0x85f9('0x14')];var _0x3b9113=_0x4f52f2?0x0:_0x3b3dc5[_0x85f9('0x15')];var _0x3d474c=_0x4f52f2?_0x442d4f[_0x85f9('0x14')]:_0x3b3dc5[_0x85f9('0x15')]+_0x3b3dc5[_0x85f9('0x13')];var _0x3fb579;if(_0x3d474c>=_0x3aee2f){_0x3d474c=_0x3aee2f;_0x3fb579=0xc8;}else{_0x3fb579=0xce;}_0x497fcb['status'](_0x3fb579);return _0x497fcb['set'](_0x85f9('0x16'),_0x3b9113+'-'+_0x3d474c+'/'+_0x3aee2f)[_0x85f9('0x11')](_0x442d4f);}return null;};}function saveUpdates(_0x332eaf){return function(_0x3f6601){if(_0x3f6601){return _0x3f6601[_0x85f9('0x17')](_0x332eaf)[_0x85f9('0x18')](function(_0x389145){return _0x389145;});}return null;};}function removeEntity(_0x23a5e5){return function(_0x7990cb){if(_0x7990cb){return _0x7990cb[_0x85f9('0x19')]()['then'](function(){_0x23a5e5[_0x85f9('0x10')](0xcc)[_0x85f9('0x1a')]();});}};}function handleEntityNotFound(_0x3ef23e){return function(_0x4dfc91){if(!_0x4dfc91){_0x3ef23e[_0x85f9('0x1b')](0x194);}return _0x4dfc91;};}function handleError(_0x1f6752,_0x5b3ced){_0x5b3ced=_0x5b3ced||0x1f4;return function(_0x3f6cfd){logger[_0x85f9('0x1c')](_0x3f6cfd[_0x85f9('0x1d')]);if(_0x3f6cfd[_0x85f9('0x1e')]){delete _0x3f6cfd[_0x85f9('0x1e')];}_0x1f6752[_0x85f9('0x10')](_0x5b3ced)['send'](_0x3f6cfd);};}exports[_0x85f9('0x1f')]=function(_0x1fd340,_0x23c266){var _0x3b71c8={};return contacts[_0x85f9('0x20')]()[_0x85f9('0x18')](function(_0xa5c08){_0x3b71c8=qs['getOptions'](_0xa5c08,_0x1fd340);return contacts[_0x85f9('0x21')](_0x1fd340[_0x85f9('0x22')],_0x1fd340[_0x85f9('0x23')],_0x3b71c8,_0xa5c08);})[_0x85f9('0x18')](respondWithFilteredResult(_0x23c266,_0x3b71c8))[_0x85f9('0x24')](handleError(_0x23c266,null));};exports[_0x85f9('0x19')]=function(_0x5220cc,_0x402efb){return db['CmContact']['find']({'where':{'id':_0x5220cc['params']['id']}})[_0x85f9('0x18')](handleEntityNotFound(_0x402efb,null))[_0x85f9('0x18')](removeEntity(_0x402efb,null))[_0x85f9('0x24')](handleError(_0x402efb,null));};exports[_0x85f9('0x20')]=function(_0xfbad82,_0x11dc61){return db['CmContact'][_0x85f9('0x20')]()['then'](function(_0x120bea){delete _0x120bea[_0x85f9('0x25')];for(var _0x25bd5f=0x0;_0x25bd5f
','Attachments','generateXOAuth2Token','user=','utf-8','toString','base64','lodash','moment','randomstring','../../../config/logger','email','../../../config/environment','head','value'];(function(_0x31ba34,_0x485bc1){var _0x35799b=function(_0x5c66cd){while(--_0x5c66cd){_0x31ba34['push'](_0x31ba34['shift']());}};_0x35799b(++_0x485bc1);}(_0xbcff,0x160));var _0xfbcf=function(_0x1f19c3,_0x441fc4){_0x1f19c3=_0x1f19c3-0x0;var _0x1465f5=_0xbcff[_0x1f19c3];return _0x1465f5;};'use strict';var _=require(_0xfbcf('0x0'));var moment=require(_0xfbcf('0x1'));var random=require(_0xfbcf('0x2'));var fs=require('fs');var path=require('path');var util=require('util');var tnef=require('node-tnef');var logger=require(_0xfbcf('0x3'))(_0xfbcf('0x4'));var config=require(_0xfbcf('0x5'));function getAddress(_0x290194){var _0x119c0b=_[_0xfbcf('0x6')](_0x290194[_0xfbcf('0x7')]);return _0x119c0b&&_0x119c0b[_0xfbcf('0x8')]?_0x119c0b[_0xfbcf('0x8')]:_0xfbcf('0x9')+random[_0xfbcf('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x44a805){var _0x45f334=_[_0xfbcf('0x6')](_0x44a805[_0xfbcf('0x7')]);if(_0x45f334&&_0x45f334[_0xfbcf('0xb')]){if(_0x45f334['name']==_0x45f334[_0xfbcf('0x8')]){return _0x45f334[_0xfbcf('0xb')][_0xfbcf('0xc')](0x0,_0x45f334[_0xfbcf('0xb')]['indexOf']('@'));}var _0x402660=_0x45f334[_0xfbcf('0xb')][_0xfbcf('0xd')](/\s+/);return _0x402660[_0xfbcf('0xe')]>0x1?_0x402660[_0xfbcf('0xf')](0x0,-0x1)[_0xfbcf('0x10')]('\x20'):_0x45f334['name'];}return _0xfbcf('0x11');}function getLastName(_0x1d7770){var _0x62e67c=_[_0xfbcf('0x6')](_0x1d7770[_0xfbcf('0x7')]);if(_0x62e67c&&_0x62e67c[_0xfbcf('0xb')]){var _0x5e8f90=_0x62e67c[_0xfbcf('0xb')][_0xfbcf('0xd')](/\s+/);return _0x5e8f90['length']>0x1?_0x5e8f90[_0xfbcf('0x12')]():'';}return'';}function getMails(_0x21c196,_0xd5976f){var _0x1c40b8='';for(var _0x2ba993=0x0;_0x2ba993<_0xd5976f[_0xfbcf('0x7')]['length'];_0x2ba993+=0x1){if(_0xd5976f['value'][_0x2ba993][_0xfbcf('0x8')]!==_0x21c196){if(!_[_0xfbcf('0x13')](_0x1c40b8)){_0x1c40b8+=',';}_0x1c40b8+=_0xd5976f[_0xfbcf('0x7')][_0x2ba993][_0xfbcf('0xb')]||_0xd5976f[_0xfbcf('0x7')][_0x2ba993][_0xfbcf('0x8')]||'';_0x1c40b8+='\x20<';_0x1c40b8+=_0xd5976f[_0xfbcf('0x7')][_0x2ba993][_0xfbcf('0x8')]?_0xd5976f[_0xfbcf('0x7')][_0x2ba993][_0xfbcf('0x8')]:_0xfbcf('0x9')+random[_0xfbcf('0xa')](0x6)+_0xfbcf('0x14');_0x1c40b8+='>';}}return _0x1c40b8;}function parseEmail(_0x310372,_0x128a8d,_0x5ba3ed){if(_0x128a8d[_0xfbcf('0x15')]){var _0x2e9c93=/