From: support
Date: Wed, 16 Nov 2022 15:48:23 +0000 (+0000)
Subject: Built motion from commit 3fa07c60.|2.6.21
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png//%22%27?a=commitdiff_plain;h=45efea997f886fe28297e28f77a78681a2fa1864;p=motion2.git
Built motion from commit 3fa07c60.|2.6.21
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 6c80094..e4790b4 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -1,6 +1,6 @@
define({
"name": "xCALLY Motion API",
- "version": "2.6.22",
+ "version": "2.6.21",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-11-16T11:08:45.001Z",
+ "time": "2022-11-16T15:39:57.667Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 985ba28..cea28d5 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -1,6 +1,6 @@
{
"name": "xCALLY Motion API",
- "version": "2.6.22",
+ "version": "2.6.21",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-11-16T11:08:45.001Z",
+ "time": "2022-11-16T15:39:57.667Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index e40c91e..efe6876 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.22",
+ "version": "2.6.21",
"dependencies": {
"@babel/code-frame": {
"version": "7.18.6",
diff --git a/package.json b/package.json
index 2279703..69f22db 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.22",
+ "version": "2.6.21",
"description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.",
"main": "server/app.js",
"engines": {
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 4687a33..2a6671f 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 _0x9af2=['integration','urlForward','bot','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)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','sequelize','exports','VIRTUAL','getDataValue','action','STRING'];(function(_0x40fd66,_0x14e0f2){var _0x53e0c1=function(_0x10d1f4){while(--_0x10d1f4){_0x40fd66['push'](_0x40fd66['shift']());}};_0x53e0c1(++_0x14e0f2);}(_0x9af2,0x1c2));var _0x29af=function(_0x4b928b,_0x495842){_0x4b928b=_0x4b928b-0x0;var _0x207219=_0x9af2[_0x4b928b];return _0x207219;};'use strict';var Sequelize=require(_0x29af('0x0'));module[_0x29af('0x1')]={'name':{'type':Sequelize[_0x29af('0x2')],'get':function(_0x31f6fd){return this[_0x29af('0x3')](_0x29af('0x4'));}},'action':{'type':Sequelize[_0x29af('0x5')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x29af('0x6'),'motionbar','jscripty',_0x29af('0x7'),'browser',_0x29af('0x8'),'script']],'msg':_0x29af('0x9')}},'comment':_0x29af('0x9')},'data1':{'type':Sequelize[_0x29af('0x5')](0x1000),'comment':_0x29af('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x29af('0x5')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x29af('0x5')](0x1000),'comments':_0x29af('0xb')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x29af('0x5')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x4044=['contactManager','integration','motionbar','jscripty','urlForward','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','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[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING'];(function(_0x1a9708,_0x12a6a8){var _0x2d46aa=function(_0x2c846b){while(--_0x2c846b){_0x1a9708['push'](_0x1a9708['shift']());}};_0x2d46aa(++_0x12a6a8);}(_0x4044,0xcb));var _0x4404=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4044[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x4404('0x0'));module[_0x4404('0x1')]={'name':{'type':Sequelize[_0x4404('0x2')],'get':function(_0xb95ec4){return this[_0x4404('0x3')](_0x4404('0x4'));}},'action':{'type':Sequelize[_0x4404('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x4404('0x6'),_0x4404('0x7'),_0x4404('0x8'),_0x4404('0x9'),_0x4404('0xa'),'browser','bot',_0x4404('0xb')]],'msg':_0x4404('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x4404('0x5')](0x1000),'comment':_0x4404('0xd')},'data2':{'type':Sequelize[_0x4404('0x5')](0x1000),'comment':_0x4404('0xe')},'data3':{'type':Sequelize[_0x4404('0x5')](0x1000),'comment':_0x4404('0xf')},'data4':{'type':Sequelize[_0x4404('0x5')](0x1000),'comments':_0x4404('0x10')},'data5':{'type':Sequelize[_0x4404('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x4404('0x5')],'comments':_0x4404('0x11')},'data7':{'type':Sequelize[_0x4404('0x12')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 58e6dcb..f942d82 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 _0x63da=['Action','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','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','sendStatus','status','end','json','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','send','body','find','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x63da,0xba));var _0xa63d=function(_0x8b885,_0x31740b){_0x8b885=_0x8b885-0x0;var _0x122eb8=_0x63da[_0x8b885];return _0x122eb8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa63d('0x0'));var zipdir=require(_0xa63d('0x1'));var jsonpatch=require(_0xa63d('0x2'));var rp=require('request-promise');var moment=require(_0xa63d('0x3'));var BPromise=require(_0xa63d('0x4'));var Mustache=require('mustache');var util=require(_0xa63d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xa63d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa63d('0x7'));var squel=require(_0xa63d('0x8'));var crypto=require(_0xa63d('0x9'));var jsforce=require(_0xa63d('0xa'));var deskjs=require(_0xa63d('0xb'));var toCsv=require(_0xa63d('0x6'));var querystring=require(_0xa63d('0xc'));var Papa=require(_0xa63d('0xd'));var Redis=require(_0xa63d('0xe'));var authService=require(_0xa63d('0xf'));var qs=require(_0xa63d('0x10'));var as=require(_0xa63d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa63d('0x12'))(_0xa63d('0x13'));var utils=require(_0xa63d('0x14'));var config=require(_0xa63d('0x15'));var licenseUtil=require(_0xa63d('0x16'));var db=require(_0xa63d('0x17'))['db'];function respondWithStatusCode(_0x2a407a,_0x50309b){_0x50309b=_0x50309b||0xcc;return function(_0x5d02ae){if(_0x5d02ae){return _0x2a407a[_0xa63d('0x18')](_0x50309b);}return _0x2a407a[_0xa63d('0x19')](_0x50309b)[_0xa63d('0x1a')]();};}function respondWithResult(_0x698848,_0xa2f5d){_0xa2f5d=_0xa2f5d||0xc8;return function(_0x2289aa){if(_0x2289aa){return _0x698848[_0xa63d('0x19')](_0xa2f5d)[_0xa63d('0x1b')](_0x2289aa);}};}function respondWithFilteredResult(_0x38f8e4,_0x50fa44){return function(_0x3ac1fb){if(_0x3ac1fb){var _0xf24ce9=typeof _0x50fa44['offset']===_0xa63d('0x1c')&&typeof _0x50fa44[_0xa63d('0x1d')]===_0xa63d('0x1c');var _0x225c92=_0x3ac1fb[_0xa63d('0x1e')];var _0x2a40d0=_0xf24ce9?0x0:_0x50fa44['offset'];var _0x44f5a6=_0xf24ce9?_0x3ac1fb[_0xa63d('0x1e')]:_0x50fa44['offset']+_0x50fa44[_0xa63d('0x1d')];var _0x57dbc8;if(_0x44f5a6>=_0x225c92){_0x44f5a6=_0x225c92;_0x57dbc8=0xc8;}else{_0x57dbc8=0xce;}_0x38f8e4[_0xa63d('0x19')](_0x57dbc8);return _0x38f8e4[_0xa63d('0x1f')]('Content-Range',_0x2a40d0+'-'+_0x44f5a6+'/'+_0x225c92)[_0xa63d('0x1b')](_0x3ac1fb);}return null;};}function patchUpdates(_0x38c50b){return function(_0x383c66){try{jsonpatch['apply'](_0x383c66,_0x38c50b,!![]);}catch(_0x1e76dd){return BPromise[_0xa63d('0x20')](_0x1e76dd);}return _0x383c66[_0xa63d('0x21')]();};}function saveUpdates(_0x523c3d,_0x4781fa){return function(_0x2cc7ec){if(_0x2cc7ec){return _0x2cc7ec[_0xa63d('0x22')](_0x523c3d)[_0xa63d('0x23')](function(_0x39a977){return _0x39a977;});}return null;};}function removeEntity(_0x2f6809,_0x69f9e7){return function(_0x386ca8){if(_0x386ca8){return _0x386ca8[_0xa63d('0x24')]()[_0xa63d('0x23')](function(){_0x2f6809[_0xa63d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7ebc2f,_0x3f62d9){return function(_0x141906){if(!_0x141906){_0x7ebc2f['sendStatus'](0x194);}return _0x141906;};}function handleError(_0x3ca914,_0x28e092){_0x28e092=_0x28e092||0x1f4;return function(_0xdb4255){logger[_0xa63d('0x25')](_0xdb4255[_0xa63d('0x26')]);if(_0xdb4255[_0xa63d('0x27')]){delete _0xdb4255[_0xa63d('0x27')];}_0x3ca914[_0xa63d('0x19')](_0x28e092)[_0xa63d('0x28')](_0xdb4255);};}exports['update']=function(_0x5b22d9,_0x33cb2c){if(_0x5b22d9[_0xa63d('0x29')]['id']){delete _0x5b22d9[_0xa63d('0x29')]['id'];}return db['Action'][_0xa63d('0x2a')]({'where':{'id':_0x5b22d9['params']['id']}})[_0xa63d('0x23')](handleEntityNotFound(_0x33cb2c,null))[_0xa63d('0x23')](saveUpdates(_0x5b22d9[_0xa63d('0x29')],null))[_0xa63d('0x23')](respondWithResult(_0x33cb2c,null))[_0xa63d('0x2b')](handleError(_0x33cb2c,null));};exports[_0xa63d('0x24')]=function(_0x108e92,_0x1b4cbb){return db[_0xa63d('0x2c')][_0xa63d('0x2a')]({'where':{'id':_0x108e92[_0xa63d('0x2d')]['id']}})[_0xa63d('0x23')](handleEntityNotFound(_0x1b4cbb,null))[_0xa63d('0x23')](removeEntity(_0x1b4cbb,null))[_0xa63d('0x2b')](handleError(_0x1b4cbb,null));};
\ No newline at end of file
+var _0x4103=['update','destroy','error','stack','name','body','Action','find','params','then','catch','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save'];(function(_0x3e36b8,_0x1ff2f0){var _0x594fd2=function(_0x370e11){while(--_0x370e11){_0x3e36b8['push'](_0x3e36b8['shift']());}};_0x594fd2(++_0x1ff2f0);}(_0x4103,0xd3));var _0x3410=function(_0x2a90f4,_0x3d46e7){_0x2a90f4=_0x2a90f4-0x0;var _0x4da9bc=_0x4103[_0x2a90f4];return _0x4da9bc;};'use strict';var emlformat=require(_0x3410('0x0'));var rimraf=require(_0x3410('0x1'));var zipdir=require(_0x3410('0x2'));var jsonpatch=require(_0x3410('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3410('0x4'));var Mustache=require('mustache');var util=require(_0x3410('0x5'));var path=require(_0x3410('0x6'));var sox=require(_0x3410('0x7'));var csv=require(_0x3410('0x8'));var ejs=require(_0x3410('0x9'));var fs=require('fs');var fs_extra=require(_0x3410('0xa'));var _=require(_0x3410('0xb'));var squel=require(_0x3410('0xc'));var crypto=require(_0x3410('0xd'));var jsforce=require(_0x3410('0xe'));var deskjs=require(_0x3410('0xf'));var toCsv=require(_0x3410('0x8'));var querystring=require(_0x3410('0x10'));var Papa=require(_0x3410('0x11'));var Redis=require(_0x3410('0x12'));var authService=require(_0x3410('0x13'));var qs=require(_0x3410('0x14'));var as=require(_0x3410('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3410('0x16'))(_0x3410('0x17'));var utils=require(_0x3410('0x18'));var config=require(_0x3410('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3410('0x1a'))['db'];function respondWithStatusCode(_0x4a820d,_0x38e4df){_0x38e4df=_0x38e4df||0xcc;return function(_0x5e2dfa){if(_0x5e2dfa){return _0x4a820d[_0x3410('0x1b')](_0x38e4df);}return _0x4a820d[_0x3410('0x1c')](_0x38e4df)[_0x3410('0x1d')]();};}function respondWithResult(_0x7da02b,_0x37db61){_0x37db61=_0x37db61||0xc8;return function(_0x162423){if(_0x162423){return _0x7da02b[_0x3410('0x1c')](_0x37db61)['json'](_0x162423);}};}function respondWithFilteredResult(_0x2e5582,_0x511c02){return function(_0x27794d){if(_0x27794d){var _0x1536c4=typeof _0x511c02[_0x3410('0x1e')]===_0x3410('0x1f')&&typeof _0x511c02['limit']===_0x3410('0x1f');var _0x3af1e6=_0x27794d[_0x3410('0x20')];var _0x2c2ce9=_0x1536c4?0x0:_0x511c02[_0x3410('0x1e')];var _0x48bfa9=_0x1536c4?_0x27794d['count']:_0x511c02['offset']+_0x511c02[_0x3410('0x21')];var _0x7f9dfc;if(_0x48bfa9>=_0x3af1e6){_0x48bfa9=_0x3af1e6;_0x7f9dfc=0xc8;}else{_0x7f9dfc=0xce;}_0x2e5582['status'](_0x7f9dfc);return _0x2e5582[_0x3410('0x22')](_0x3410('0x23'),_0x2c2ce9+'-'+_0x48bfa9+'/'+_0x3af1e6)[_0x3410('0x24')](_0x27794d);}return null;};}function patchUpdates(_0x8edcc9){return function(_0x139eb1){try{jsonpatch['apply'](_0x139eb1,_0x8edcc9,!![]);}catch(_0x9985a2){return BPromise[_0x3410('0x25')](_0x9985a2);}return _0x139eb1[_0x3410('0x26')]();};}function saveUpdates(_0x1d9664,_0x3d02ac){return function(_0x2744fc){if(_0x2744fc){return _0x2744fc[_0x3410('0x27')](_0x1d9664)['then'](function(_0x170132){return _0x170132;});}return null;};}function removeEntity(_0x35d14d,_0x297c57){return function(_0x577651){if(_0x577651){return _0x577651[_0x3410('0x28')]()['then'](function(){_0x35d14d[_0x3410('0x1c')](0xcc)[_0x3410('0x1d')]();});}};}function handleEntityNotFound(_0x5168e8,_0x1849f3){return function(_0x4c69b9){if(!_0x4c69b9){_0x5168e8[_0x3410('0x1b')](0x194);}return _0x4c69b9;};}function handleError(_0x3cbf7e,_0x1d18c3){_0x1d18c3=_0x1d18c3||0x1f4;return function(_0x32e00a){logger[_0x3410('0x29')](_0x32e00a[_0x3410('0x2a')]);if(_0x32e00a[_0x3410('0x2b')]){delete _0x32e00a[_0x3410('0x2b')];}_0x3cbf7e[_0x3410('0x1c')](_0x1d18c3)['send'](_0x32e00a);};}exports[_0x3410('0x27')]=function(_0x584b7d,_0x48a2f0){if(_0x584b7d['body']['id']){delete _0x584b7d[_0x3410('0x2c')]['id'];}return db[_0x3410('0x2d')][_0x3410('0x2e')]({'where':{'id':_0x584b7d[_0x3410('0x2f')]['id']}})[_0x3410('0x30')](handleEntityNotFound(_0x48a2f0,null))['then'](saveUpdates(_0x584b7d[_0x3410('0x2c')],null))[_0x3410('0x30')](respondWithResult(_0x48a2f0,null))[_0x3410('0x31')](handleError(_0x48a2f0,null));};exports[_0x3410('0x28')]=function(_0x3e30c0,_0x2be857){return db[_0x3410('0x2d')]['find']({'where':{'id':_0x3e30c0['params']['id']}})[_0x3410('0x30')](handleEntityNotFound(_0x2be857,null))[_0x3410('0x30')](removeEntity(_0x2be857,null))[_0x3410('0x31')](handleError(_0x2be857,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 4b8ac6d..df33f28 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 _0xb368=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Action','lodash','util','../../config/logger','api'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0xb368,0x68));var _0x8b36=function(_0xa1ffb0,_0x501e4a){_0xa1ffb0=_0xa1ffb0-0x0;var _0x3372e7=_0xb368[_0xa1ffb0];return _0x3372e7;};'use strict';var _=require(_0x8b36('0x0'));var util=require(_0x8b36('0x1'));var logger=require(_0x8b36('0x2'))(_0x8b36('0x3'));var moment=require(_0x8b36('0x4'));var BPromise=require(_0x8b36('0x5'));var rp=require(_0x8b36('0x6'));var fs=require('fs');var path=require(_0x8b36('0x7'));var rimraf=require(_0x8b36('0x8'));var config=require(_0x8b36('0x9'));var attributes=require('./action.attributes');module[_0x8b36('0xa')]=function(_0x2ce0fc,_0x48a8a4){return _0x2ce0fc['define'](_0x8b36('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa013=['util','api','moment','bluebird','request-promise','path','./action.attributes','exports','Action','tools_actions'];(function(_0x22a8c4,_0x51c09a){var _0x104c6d=function(_0x4d4d3d){while(--_0x4d4d3d){_0x22a8c4['push'](_0x22a8c4['shift']());}};_0x104c6d(++_0x51c09a);}(_0xa013,0x1ea));var _0x3a01=function(_0x547add,_0x387042){_0x547add=_0x547add-0x0;var _0x2ed1f3=_0xa013[_0x547add];return _0x2ed1f3;};'use strict';var _=require('lodash');var util=require(_0x3a01('0x0'));var logger=require('../../config/logger')(_0x3a01('0x1'));var moment=require(_0x3a01('0x2'));var BPromise=require(_0x3a01('0x3'));var rp=require(_0x3a01('0x4'));var fs=require('fs');var path=require(_0x3a01('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3a01('0x6'));module[_0x3a01('0x7')]=function(_0x27ee4f,_0x3b5fef){return _0x27ee4f['define'](_0x3a01('0x8'),attributes,{'tableName':_0x3a01('0x9'),'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 fe4e0e8..66799dd 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x12b253,_0x2153bc){var _0xd04dac=function(_0x20b8a8){while(--_0x20b8a8){_0x12b253['push'](_0x12b253['shift']());}};_0xd04dac(++_0x2153bc);}(_0x326f,0xd1));var _0xf326=function(_0x16cb6c,_0x5fb2cc){_0x16cb6c=_0x16cb6c-0x0;var _0x1f8a57=_0x326f[_0x16cb6c];return _0x1f8a57;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
+var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x53ec,0x192));var _0xc53e=function(_0x3657d9,_0x3de284){_0x3657d9=_0x3657d9-0x0;var _0x4e5b18=_0x53ec[_0x3657d9];return _0x4e5b18;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 7356027..34e1789 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 _0xedc5=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','isAuthenticated','update','delete','/:id','destroy','multer','util','express','Router'];(function(_0x3035a5,_0x6a1b0b){var _0x396e01=function(_0x505f0d){while(--_0x505f0d){_0x3035a5['push'](_0x3035a5['shift']());}};_0x396e01(++_0x6a1b0b);}(_0xedc5,0x1dd));var _0x5edc=function(_0xcdf809,_0x2881f0){_0xcdf809=_0xcdf809-0x0;var _0x4d4d70=_0xedc5[_0xcdf809];return _0x4d4d70;};'use strict';var multer=require(_0x5edc('0x0'));var util=require(_0x5edc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5edc('0x2'));var router=express[_0x5edc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5edc('0x4'));var interaction=require(_0x5edc('0x5'));var config=require(_0x5edc('0x6'));var controller=require(_0x5edc('0x7'));router['put']('/:id',auth[_0x5edc('0x8')](),controller[_0x5edc('0x9')]);router[_0x5edc('0xa')](_0x5edc('0xb'),auth[_0x5edc('0x8')](),controller[_0x5edc('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0xa1b0=['destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./action.controller','put','update','delete','isAuthenticated'];(function(_0x199b91,_0x3f6f72){var _0x4cffea=function(_0x352d7e){while(--_0x352d7e){_0x199b91['push'](_0x199b91['shift']());}};_0x4cffea(++_0x3f6f72);}(_0xa1b0,0x169));var _0x0a1b=function(_0x2edb72,_0x2264e2){_0x2edb72=_0x2edb72-0x0;var _0x79fb87=_0xa1b0[_0x2edb72];return _0x79fb87;};'use strict';var multer=require(_0x0a1b('0x0'));var util=require('util');var path=require(_0x0a1b('0x1'));var timeout=require(_0x0a1b('0x2'));var express=require(_0x0a1b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0a1b('0x4'));var interaction=require(_0x0a1b('0x5'));var config=require('../../config/environment');var controller=require(_0x0a1b('0x6'));router[_0x0a1b('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x0a1b('0x8')]);router[_0x0a1b('0x9')]('/:id',auth[_0x0a1b('0xa')](),controller[_0x0a1b('0xb')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 2c2ce2d..7c48e4e 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 _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x195c91,_0x26f6ba){var _0x30e2e0=function(_0x1b3017){while(--_0x1b3017){_0x195c91['push'](_0x195c91['shift']());}};_0x30e2e0(++_0x26f6ba);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
+var _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x134cb7,_0x4ed24e){var _0x5d81e2=function(_0x788943){while(--_0x788943){_0x134cb7['push'](_0x134cb7['shift']());}};_0x5d81e2(++_0x4ed24e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x5fc3[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 03efcb7..9f2cca0 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 _0x8946=['dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_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\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\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','replace','format','groupBy','orderBy','order','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','debug','sequelize','toString','QueryTypes','SELECT','UNIX_TIMESTAMP(%s)','operator','value','Sequelize','ValidationErrorItem','function','clone','output','web','%s-%s.%s','randomstring','generate','csv','custom','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','savename','run','right_join','AnalyticMetric','Limited\x20Query:','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x62f666,_0x2279b7){var _0x4827d8=function(_0x406a73){while(--_0x406a73){_0x62f666['push'](_0x62f666['shift']());}};_0x4827d8(++_0x2279b7);}(_0x8946,0x130));var _0x6894=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x8946[_0x2faddb];return _0x273c05;};'use strict';var emlformat=require(_0x6894('0x0'));var rimraf=require(_0x6894('0x1'));var zipdir=require(_0x6894('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6894('0x3'));var moment=require(_0x6894('0x4'));var BPromise=require(_0x6894('0x5'));var Mustache=require(_0x6894('0x6'));var util=require(_0x6894('0x7'));var path=require(_0x6894('0x8'));var sox=require(_0x6894('0x9'));var csv=require(_0x6894('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6894('0xa'));var querystring=require('querystring');var Papa=require(_0x6894('0xb'));var Redis=require(_0x6894('0xc'));var authService=require(_0x6894('0xd'));var qs=require(_0x6894('0xe'));var as=require(_0x6894('0xf'));var hardwareService=require(_0x6894('0x10'));var logger=require(_0x6894('0x11'))(_0x6894('0x12'));var utils=require(_0x6894('0x13'));var config=require(_0x6894('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6894('0x15'))['db'];var dbH=require(_0x6894('0x15'))[_0x6894('0x16')];function respondWithStatusCode(_0x486d81,_0x47eaff){_0x47eaff=_0x47eaff||0xcc;return function(_0x22b531){if(_0x22b531){return _0x486d81[_0x6894('0x17')](_0x47eaff);}return _0x486d81[_0x6894('0x18')](_0x47eaff)[_0x6894('0x19')]();};}function respondWithResult(_0x5be040,_0x1391a3){_0x1391a3=_0x1391a3||0xc8;return function(_0x1d78a9){if(_0x1d78a9){return _0x5be040[_0x6894('0x18')](_0x1391a3)[_0x6894('0x1a')](_0x1d78a9);}};}function respondWithFilteredResult(_0x3aec8f,_0x45b9b7){return function(_0xf8f5ee){if(_0xf8f5ee){var _0x482475=typeof _0x45b9b7[_0x6894('0x1b')]==='undefined'&&typeof _0x45b9b7[_0x6894('0x1c')]===_0x6894('0x1d');var _0x53e9f2=_0xf8f5ee['count'];var _0x1960e6=_0x482475?0x0:_0x45b9b7[_0x6894('0x1b')];var _0x3b1ecf=_0x482475?_0xf8f5ee[_0x6894('0x1e')]:_0x45b9b7[_0x6894('0x1b')]+_0x45b9b7[_0x6894('0x1c')];var _0x242448;if(_0x3b1ecf>=_0x53e9f2){_0x3b1ecf=_0x53e9f2;_0x242448=0xc8;}else{_0x242448=0xce;}_0x3aec8f[_0x6894('0x18')](_0x242448);return _0x3aec8f[_0x6894('0x1f')]('Content-Range',_0x1960e6+'-'+_0x3b1ecf+'/'+_0x53e9f2)[_0x6894('0x1a')](_0xf8f5ee);}return null;};}function patchUpdates(_0x167af9){return function(_0x6be790){try{jsonpatch[_0x6894('0x20')](_0x6be790,_0x167af9,!![]);}catch(_0x199b3f){return BPromise[_0x6894('0x21')](_0x199b3f);}return _0x6be790[_0x6894('0x22')]();};}function saveUpdates(_0x19fd58,_0x258597){return function(_0x4e79ed){if(_0x4e79ed){return _0x4e79ed[_0x6894('0x23')](_0x19fd58)[_0x6894('0x24')](function(_0x4fb52e){return _0x4fb52e;});}return null;};}function removeEntity(_0x1efa03,_0x29179c){return function(_0x38b746){if(_0x38b746){return _0x38b746[_0x6894('0x25')]()[_0x6894('0x24')](function(){var _0x57aa38=_0x38b746[_0x6894('0x26')]({'plain':!![]});var _0x241d46=_0x6894('0x27');return db[_0x6894('0x28')]['destroy']({'where':{'type':_0x241d46,'resourceId':_0x57aa38['id']}})['then'](function(){return _0x38b746;});})[_0x6894('0x24')](function(){_0x1efa03[_0x6894('0x18')](0xcc)[_0x6894('0x19')]();});}};}function handleEntityNotFound(_0x284dc5,_0x3e7acc){return function(_0x48cec2){if(!_0x48cec2){_0x284dc5[_0x6894('0x17')](0x194);}return _0x48cec2;};}function handleError(_0x46141e,_0x3b7716){_0x3b7716=_0x3b7716||0x1f4;return function(_0x4f56cd){logger[_0x6894('0x29')](_0x4f56cd[_0x6894('0x2a')]);if(_0x4f56cd[_0x6894('0x2b')]){delete _0x4f56cd[_0x6894('0x2b')];}_0x46141e[_0x6894('0x18')](_0x3b7716)[_0x6894('0x2c')](_0x4f56cd);};}exports[_0x6894('0x2d')]=function(_0x24c4ed,_0x504a7a){var _0x2ff7b7={},_0x1c8ef9={},_0x2e933d={'count':0x0,'rows':[]};var _0x479bda=_['map'](db['AnalyticCustomReport'][_0x6894('0x2e')],function(_0x26daba){return{'name':_0x26daba[_0x6894('0x2f')],'type':_0x26daba['type'][_0x6894('0x30')]};});_0x1c8ef9[_0x6894('0x31')]=_['map'](_0x479bda,_0x6894('0x2b'));_0x1c8ef9[_0x6894('0x32')]=_['keys'](_0x24c4ed[_0x6894('0x32')]);_0x1c8ef9[_0x6894('0x33')]=_[_0x6894('0x34')](_0x1c8ef9[_0x6894('0x31')],_0x1c8ef9[_0x6894('0x32')]);_0x2ff7b7[_0x6894('0x35')]=_[_0x6894('0x34')](_0x1c8ef9[_0x6894('0x31')],qs['fields'](_0x24c4ed[_0x6894('0x32')][_0x6894('0x36')]));_0x2ff7b7[_0x6894('0x35')]=_0x2ff7b7[_0x6894('0x35')][_0x6894('0x37')]?_0x2ff7b7['attributes']:_0x1c8ef9['model'];if(!_0x24c4ed['query'][_0x6894('0x38')](_0x6894('0x39'))){_0x2ff7b7[_0x6894('0x1c')]=qs['limit'](_0x24c4ed[_0x6894('0x32')][_0x6894('0x1c')]);_0x2ff7b7[_0x6894('0x1b')]=qs['offset'](_0x24c4ed[_0x6894('0x32')][_0x6894('0x1b')]);}_0x2ff7b7['order']=qs['sort'](_0x24c4ed[_0x6894('0x32')][_0x6894('0x3a')]);_0x2ff7b7[_0x6894('0x3b')]=qs[_0x6894('0x33')](_[_0x6894('0x3c')](_0x24c4ed[_0x6894('0x32')],_0x1c8ef9[_0x6894('0x33')]),_0x479bda);if(_0x24c4ed[_0x6894('0x32')][_0x6894('0x3d')]){_0x2ff7b7['where']=_[_0x6894('0x3e')](_0x2ff7b7[_0x6894('0x3b')],{'$or':_['map'](_0x479bda,function(_0x16a68c){if(_0x16a68c[_0x6894('0x3f')]!=='VIRTUAL'){var _0x54b5d2={};_0x54b5d2[_0x16a68c[_0x6894('0x2b')]]={'$like':'%'+_0x24c4ed['query'][_0x6894('0x3d')]+'%'};return _0x54b5d2;}})});}_0x2ff7b7=_['merge']({},_0x2ff7b7,_0x24c4ed[_0x6894('0x40')]);var _0x20a9de={'where':_0x2ff7b7[_0x6894('0x3b')]};return db[_0x6894('0x41')][_0x6894('0x1e')](_0x20a9de)[_0x6894('0x24')](function(_0x57e99c){_0x2e933d[_0x6894('0x1e')]=_0x57e99c;if(_0x24c4ed[_0x6894('0x32')][_0x6894('0x42')]){_0x2ff7b7[_0x6894('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x6894('0x44')](_0x2ff7b7);})[_0x6894('0x24')](function(_0x45fda8){_0x2e933d[_0x6894('0x45')]=_0x45fda8;return _0x2e933d;})['then'](respondWithFilteredResult(_0x504a7a,_0x2ff7b7))[_0x6894('0x46')](handleError(_0x504a7a,null));};exports[_0x6894('0x47')]=function(_0x1b5102,_0x5ccf96){var _0x2e13d7={'raw':![],'where':{'id':_0x1b5102[_0x6894('0x48')]['id']}},_0x5a795a={};_0x5a795a[_0x6894('0x31')]=_[_0x6894('0x49')](db[_0x6894('0x41')]['rawAttributes']);_0x5a795a['query']=_['keys'](_0x1b5102[_0x6894('0x32')]);_0x5a795a['filters']=_['intersection'](_0x5a795a['model'],_0x5a795a[_0x6894('0x32')]);_0x2e13d7[_0x6894('0x35')]=_['intersection'](_0x5a795a['model'],qs[_0x6894('0x36')](_0x1b5102[_0x6894('0x32')][_0x6894('0x36')]));_0x2e13d7['attributes']=_0x2e13d7[_0x6894('0x35')][_0x6894('0x37')]?_0x2e13d7['attributes']:_0x5a795a['model'];if(_0x1b5102[_0x6894('0x32')]['includeAll']){_0x2e13d7[_0x6894('0x43')]=[{'all':!![]}];}_0x2e13d7=_[_0x6894('0x3e')]({},_0x2e13d7,_0x1b5102[_0x6894('0x40')]);return db['AnalyticCustomReport'][_0x6894('0x4a')](_0x2e13d7)[_0x6894('0x24')](handleEntityNotFound(_0x5ccf96,null))['then'](respondWithResult(_0x5ccf96,null))[_0x6894('0x46')](handleError(_0x5ccf96,null));};exports[_0x6894('0x4b')]=function(_0x3f010f,_0x5cb7d3){return db['AnalyticCustomReport'][_0x6894('0x4b')](_0x3f010f[_0x6894('0x4c')],{})[_0x6894('0x24')](function(_0xbb2f08){var _0x154f7f=_0x3f010f['user'][_0x6894('0x26')]({'plain':!![]});if(!_0x154f7f)throw new Error(_0x6894('0x4d'));if(_0x154f7f[_0x6894('0x4e')]==='user'){var _0x1c486e=_0xbb2f08[_0x6894('0x26')]({'plain':!![]});var _0x8abbee=_0x6894('0x4f');return db[_0x6894('0x50')]['find']({'where':{'name':_0x8abbee,'userProfileId':_0x154f7f[_0x6894('0x51')]},'raw':!![]})[_0x6894('0x24')](function(_0x584823){if(_0x584823&&_0x584823[_0x6894('0x52')]===0x0){return db[_0x6894('0x28')][_0x6894('0x4b')]({'name':_0x1c486e[_0x6894('0x2b')],'resourceId':_0x1c486e['id'],'type':_0x6894('0x27'),'sectionId':_0x584823['id']},{})[_0x6894('0x24')](function(){return _0xbb2f08;});}else{return _0xbb2f08;}})[_0x6894('0x46')](function(_0x355218){logger[_0x6894('0x29')](_0x6894('0x53'),_0x355218);throw _0x355218;});}return _0xbb2f08;})['then'](respondWithResult(_0x5cb7d3,0xc9))['catch'](handleError(_0x5cb7d3,null));};exports[_0x6894('0x23')]=function(_0x5c9e4c,_0x2bcc0f){if(_0x5c9e4c['body']['id']){delete _0x5c9e4c[_0x6894('0x4c')]['id'];}return db[_0x6894('0x41')]['find']({'where':{'id':_0x5c9e4c[_0x6894('0x48')]['id']}})[_0x6894('0x24')](handleEntityNotFound(_0x2bcc0f,null))['then'](saveUpdates(_0x5c9e4c[_0x6894('0x4c')],null))[_0x6894('0x24')](respondWithResult(_0x2bcc0f,null))[_0x6894('0x46')](handleError(_0x2bcc0f,null));};exports[_0x6894('0x25')]=function(_0x33e8d6,_0x39a2e5){return db['AnalyticCustomReport'][_0x6894('0x4a')]({'where':{'id':_0x33e8d6['params']['id']}})['then'](handleEntityNotFound(_0x39a2e5,null))['then'](removeEntity(_0x39a2e5,null))[_0x6894('0x46')](handleError(_0x39a2e5,null));};exports[_0x6894('0x54')]=function(_0x2e8c46,_0x207989){var _0x4f87e8=0xa;var _0x409f51=[_0x6894('0x55'),_0x6894('0x56'),'right_join',_0x6894('0x57')];var _0x1c2d9c={'SUM':_0x6894('0x58'),'COUNT':_0x6894('0x59'),'COUNT DISTINCT':_0x6894('0x5a'),'MAX':_0x6894('0x5b'),'MIN':_0x6894('0x5c'),'AVG':_0x6894('0x5d'),'GROUP_CONCAT':_0x6894('0x5e'),'GROUP_CONCAT ASC':_0x6894('0x5f'),'GROUP_CONCAT DESC':_0x6894('0x60')};var _0x493c8a={'SEC_TO_TIME':_0x6894('0x61'),'DATE':_0x6894('0x62'),'HOUR':_0x6894('0x63'),'ROUND':_0x6894('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x32127b=function(_0x4e67fe){return!_[_0x6894('0x65')]([_0x6894('0x66'),_0x6894('0x67'),_0x6894('0x68'),_0x6894('0x69')],_0x4e67fe);};var _0x16aaee=function(_0x1c604c){if(!_0x1c604c||!_0x1c604c[_0x6894('0x6a')][_0x6894('0x37')]){return'';}for(var _0x5c4df6='(',_0x177c61=0x0;_0x177c61<_0x1c604c['rules'][_0x6894('0x37')];_0x177c61+=0x1){_0x177c61>0x0&&(_0x5c4df6+='\x20'+_0x1c604c['operator']+'\x20');_0x5c4df6+=_0x1c604c[_0x6894('0x6a')][_0x177c61][_0x6894('0x6b')]?_0x16aaee(_0x1c604c[_0x6894('0x6a')][_0x177c61][_0x6894('0x6b')]):_0x1c604c['rules'][_0x177c61][_0x6894('0x6c')]+'\x20'+_0x1c604c[_0x6894('0x6a')][_0x177c61]['condition']+(_0x32127b(_0x1c604c[_0x6894('0x6a')][_0x177c61][_0x6894('0x6d')])?'\x20'+_0x1c604c[_0x6894('0x6a')][_0x177c61]['value']:'');}return _0x5c4df6+')';};var _0x1ba7b9={'where':{'id':_0x2e8c46['params']['id']}},_0x3a9795,_0x2be92a,_0x408f8f,_0x5f32ea,_0x31ed10;_0x1ba7b9=_['merge']({},_0x1ba7b9,_0x2e8c46[_0x6894('0x40')]);return db[_0x6894('0x41')][_0x6894('0x4a')](_0x1ba7b9)[_0x6894('0x24')](function(_0x4683a5){if(_0x4683a5){_0x3a9795=_0x4683a5;return _0x4683a5[_0x6894('0x6e')]();}return null;})[_0x6894('0x24')](function(_0x12b1b5){if(_0x12b1b5){if(!_0x12b1b5[_0x6894('0x37')]){throw new db['Sequelize']['ValidationErrorItem'](_0x6894('0x6f'),0x193);}_0x2be92a=_0x12b1b5;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x6894('0x24')](function(_0x9cadb9){if(_0x9cadb9){_0x408f8f=_[_0x6894('0x70')](_0x9cadb9,'id');var _0x51c7e6;var _0x4c6385=squel[_0x6894('0x71')]();_0x4c6385[_0x6894('0x72')](_0x3a9795[_0x6894('0x73')]);for(var _0x2c978f=0x0;_0x2c978f<_0x2be92a[_0x6894('0x37')];_0x2c978f+=0x1){_0x51c7e6=_0x2be92a[_0x2c978f][_0x6894('0x74')]?_0x408f8f[_0x2be92a[_0x2c978f][_0x6894('0x74')]][_0x6894('0x75')]:_0x2be92a[_0x2c978f][_0x6894('0x6c')];_0x51c7e6=_0x2be92a[_0x2c978f]['function']?_[_0x6894('0x76')](_0x1c2d9c[_0x2be92a[_0x2c978f]['function']],'%s',_0x51c7e6):_0x51c7e6;_0x51c7e6=_0x2be92a[_0x2c978f][_0x6894('0x77')]?_['replace'](_0x493c8a[_0x2be92a[_0x2c978f][_0x6894('0x77')]],'%s',_0x51c7e6):_0x51c7e6;if(_0x2be92a[_0x2c978f][_0x6894('0x78')]){_0x4c6385[_0x6894('0x6b')](_0x51c7e6);}_0x2be92a[_0x2c978f][_0x6894('0x79')]&&_0x4c6385[_0x6894('0x7a')](_0x51c7e6,_0x2be92a[_0x2c978f][_0x6894('0x79')]===_0x6894('0x7b')?![]:!![]);_0x4c6385[_0x6894('0x6c')](_0x51c7e6,_0x2be92a[_0x2c978f][_0x6894('0x7c')]||_0x51c7e6);}if(_0x3a9795[_0x6894('0x7d')]){_0x3a9795[_0x6894('0x7d')]=JSON[_0x6894('0x7e')](_0x3a9795[_0x6894('0x7d')]);for(var _0xcb7ac0=0x0;_0xcb7ac0<_0x3a9795[_0x6894('0x7d')]['length'];_0xcb7ac0+=0x1){if(_0x3a9795[_0x6894('0x7d')][_0xcb7ac0]['type']&&_[_0x6894('0x65')](_0x409f51,_0x3a9795['joins'][_0xcb7ac0][_0x6894('0x3f')])&&_0x3a9795[_0x6894('0x7d')][_0xcb7ac0]['parentKey']&&_0x3a9795['joins'][_0xcb7ac0][_0x6894('0x7f')]&&_0x3a9795[_0x6894('0x7d')][_0xcb7ac0][_0x6894('0x80')]){_0x4c6385[_0x3a9795[_0x6894('0x7d')][_0xcb7ac0]['type']](_0x3a9795[_0x6894('0x7d')][_0xcb7ac0][_0x6894('0x7f')],null,util['format'](_0x6894('0x81'),_0x3a9795[_0x6894('0x73')],_0x3a9795['joins'][_0xcb7ac0][_0x6894('0x82')],_0x3a9795[_0x6894('0x7d')][_0xcb7ac0][_0x6894('0x7f')],_0x3a9795[_0x6894('0x7d')][_0xcb7ac0][_0x6894('0x80')]));}}}if(_0x3a9795[_0x6894('0x83')]){_0x3a9795[_0x6894('0x83')]=JSON[_0x6894('0x7e')](_0x3a9795[_0x6894('0x83')]);_0x4c6385[_0x6894('0x3b')](_0x16aaee(_0x3a9795[_0x6894('0x83')][_0x6894('0x6b')]));}_0x31ed10=_0x4c6385['clone']();_0x4c6385['limit'](_0x4f87e8);_0x4c6385['offset'](0x0);logger[_0x6894('0x84')]('Limited\x20Query:',_0x4c6385['toString']());return dbH[_0x6894('0x85')]['query'](_0x4c6385[_0x6894('0x86')](),{'type':dbH[_0x6894('0x85')][_0x6894('0x87')][_0x6894('0x88')]});}})['then'](respondWithResult(_0x207989,null))[_0x6894('0x46')](handleError(_0x207989,null));};function runReport(_0x2f6da5,_0xef6f4c,_0x3ef4ca){var _0x218c26=_0xef6f4c[_0x6894('0x2b')];var _0xe62227=0xa;var _0x4cff1d=[_0x6894('0x55'),_0x6894('0x56'),'right_join',_0x6894('0x57')];var _0x1a4e9c={'SUM':_0x6894('0x58'),'COUNT':_0x6894('0x59'),'COUNT DISTINCT':_0x6894('0x5a'),'MAX':_0x6894('0x5b'),'MIN':'MIN(%s)','AVG':_0x6894('0x5d'),'GROUP_CONCAT':_0x6894('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x6894('0x60')};var _0x2dad52={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x6894('0x62'),'HOUR':_0x6894('0x63'),'ROUND':_0x6894('0x64'),'UNIX_TIMESTAMP':_0x6894('0x89')};var _0x1ad75b=function(_0x29ddc0){return!_[_0x6894('0x65')]([_0x6894('0x66'),_0x6894('0x67'),_0x6894('0x68'),_0x6894('0x69')],_0x29ddc0);};var _0x23be9d=function(_0x1a4abd){if(!_0x1a4abd||!_0x1a4abd[_0x6894('0x6a')]['length']){return'';}for(var _0x463f20='(',_0xc97bf7=0x0;_0xc97bf7<_0x1a4abd['rules'][_0x6894('0x37')];_0xc97bf7+=0x1){_0xc97bf7>0x0&&(_0x463f20+='\x20'+_0x1a4abd[_0x6894('0x8a')]+'\x20');_0x463f20+=_0x1a4abd[_0x6894('0x6a')][_0xc97bf7][_0x6894('0x6b')]?_0x23be9d(_0x1a4abd['rules'][_0xc97bf7][_0x6894('0x6b')]):_0x1a4abd[_0x6894('0x6a')][_0xc97bf7]['field']+'\x20'+_0x1a4abd[_0x6894('0x6a')][_0xc97bf7][_0x6894('0x6d')]+(_0x1ad75b(_0x1a4abd['rules'][_0xc97bf7][_0x6894('0x6d')])?'\x20'+_0x1a4abd[_0x6894('0x6a')][_0xc97bf7][_0x6894('0x8b')]:'');}return _0x463f20+')';};var _0x106845={'where':{'id':_0x2f6da5['id']}},_0x50fd06,_0x2771a7,_0x26e980,_0x7f45d0,_0x57d661;_0x106845=_[_0x6894('0x3e')]({},_0x106845,_0x3ef4ca);return db[_0x6894('0x41')]['find'](_0x106845)[_0x6894('0x24')](function(_0x4a39f6){if(_0x4a39f6){_0x50fd06=_0x4a39f6;return _0x4a39f6['getFields']();}return null;})['then'](function(_0x263658){if(_0x263658){if(!_0x263658[_0x6894('0x37')]){throw new db[(_0x6894('0x8c'))][(_0x6894('0x8d'))](_0x6894('0x6f'),0x193);}_0x2771a7=_0x263658;return db['AnalyticMetric'][_0x6894('0x44')]({'raw':!![]});}return null;})['then'](function(_0x3696cb){if(_0x3696cb){_0x26e980=_[_0x6894('0x70')](_0x3696cb,'id');var _0x192c15;var _0x402458=squel['select']();_0x402458[_0x6894('0x72')](_0x50fd06['table']);for(var _0x19e62a=0x0;_0x19e62a<_0x2771a7[_0x6894('0x37')];_0x19e62a+=0x1){_0x192c15=_0x2771a7[_0x19e62a][_0x6894('0x74')]?_0x26e980[_0x2771a7[_0x19e62a][_0x6894('0x74')]][_0x6894('0x75')]:_0x2771a7[_0x19e62a][_0x6894('0x6c')];_0x192c15=_0x2771a7[_0x19e62a][_0x6894('0x8e')]?_[_0x6894('0x76')](_0x1a4e9c[_0x2771a7[_0x19e62a][_0x6894('0x8e')]],'%s',_0x192c15):_0x192c15;_0x192c15=_0x2771a7[_0x19e62a]['format']?_[_0x6894('0x76')](_0x2dad52[_0x2771a7[_0x19e62a][_0x6894('0x77')]],'%s',_0x192c15):_0x192c15;if(_0x2771a7[_0x19e62a][_0x6894('0x78')]){_0x402458['group'](_0x192c15);}_0x2771a7[_0x19e62a][_0x6894('0x79')]&&_0x402458[_0x6894('0x7a')](_0x192c15,_0x2771a7[_0x19e62a]['orderBy']===_0x6894('0x7b')?![]:!![]);_0x402458[_0x6894('0x6c')](_0x192c15,_0x2771a7[_0x19e62a][_0x6894('0x7c')]||_0x192c15);}if(_0x50fd06[_0x6894('0x7d')]){_0x50fd06['joins']=JSON[_0x6894('0x7e')](_0x50fd06[_0x6894('0x7d')]);for(var _0x47cefc=0x0;_0x47cefc<_0x50fd06['joins']['length'];_0x47cefc+=0x1){if(_0x50fd06['joins'][_0x47cefc][_0x6894('0x3f')]&&_['includes'](_0x4cff1d,_0x50fd06[_0x6894('0x7d')][_0x47cefc][_0x6894('0x3f')])&&_0x50fd06[_0x6894('0x7d')][_0x47cefc][_0x6894('0x82')]&&_0x50fd06[_0x6894('0x7d')][_0x47cefc]['foreignTable']&&_0x50fd06['joins'][_0x47cefc][_0x6894('0x80')]){_0x402458[_0x50fd06[_0x6894('0x7d')][_0x47cefc][_0x6894('0x3f')]](_0x50fd06['joins'][_0x47cefc][_0x6894('0x7f')],null,util[_0x6894('0x77')](_0x6894('0x81'),_0x50fd06[_0x6894('0x73')],_0x50fd06[_0x6894('0x7d')][_0x47cefc][_0x6894('0x82')],_0x50fd06['joins'][_0x47cefc][_0x6894('0x7f')],_0x50fd06[_0x6894('0x7d')][_0x47cefc][_0x6894('0x80')]));}}}if(_0x50fd06['conditions']){_0x50fd06[_0x6894('0x83')]=JSON[_0x6894('0x7e')](_0x50fd06[_0x6894('0x83')]);_0x402458['where'](_0x23be9d(_0x50fd06[_0x6894('0x83')][_0x6894('0x6b')]));}_0x57d661=_0x402458[_0x6894('0x8f')]();_0x402458[_0x6894('0x1c')](_0xe62227);_0x402458[_0x6894('0x1b')](0x0);return;}})[_0x6894('0x24')](function(){if(_0xef6f4c[_0x6894('0x90')]===_0x6894('0x91')){return null;}var _0x40c506=_[_0x6894('0x3e')](_0xef6f4c,{'name':_0xef6f4c['fullPath']||_0xef6f4c['name']||_0x50fd06[_0x6894('0x2b')],'basename':_0x218c26,'savename':util[_0x6894('0x77')](_0x6894('0x92'),_0xef6f4c[_0x6894('0x2b')]||_0x50fd06[_0x6894('0x2b')],require(_0x6894('0x93'))[_0x6894('0x94')](0x4),_0xef6f4c['output']||_0x6894('0x95')),'reportId':_0x50fd06['id'],'reportType':_0x6894('0x96')});return db['AnalyticExtractedReport'][_0x6894('0x4b')](_0x40c506,{'raw':!![]});})[_0x6894('0x24')](function(_0x458498){if(_0x50fd06[_0x6894('0x73')]===_0x6894('0x97')){_0x57d661[_0x6894('0x3b')](_0x50fd06[_0x6894('0x73')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xef6f4c['startDate'],_0xef6f4c[_0x6894('0x98')]);}else{_0x57d661['where'](_0x50fd06[_0x6894('0x73')]+_0x6894('0x99'),_0xef6f4c[_0x6894('0x9a')],_0xef6f4c[_0x6894('0x98')]);}if(_0x458498){logger['info'](_0x6894('0x9b'),_0x57d661['toString']());require(_0x6894('0x9c'))[_0x6894('0x9d')](path[_0x6894('0x55')](__dirname,'../../components/export/',_0x458498[_0x6894('0x90')]),[_0x458498['id'],_0x57d661[_0x6894('0x86')](),path[_0x6894('0x55')](__dirname,'../../files/reports',_0x458498[_0x6894('0x9e')]),_0x218c26]);return _0x458498;}else{var _0x7c49db=squel[_0x6894('0x71')]();_0x7c49db[_0x6894('0x72')]('('+_0x57d661[_0x6894('0x86')]()+')','countTable');_0x7c49db['field']('COUNT(*)',_0x6894('0x1e'));_0x57d661[_0x6894('0x1c')](_0xef6f4c[_0x6894('0x1c')]||_0xe62227);_0x57d661[_0x6894('0x1b')](_0xef6f4c['offset']||0x0);return dbH[_0x6894('0x85')][_0x6894('0x32')](_0x7c49db[_0x6894('0x86')](),{'type':dbH['sequelize'][_0x6894('0x87')][_0x6894('0x88')]})[_0x6894('0x24')](function(_0x5f03f0){if(!_0x5f03f0[_0x6894('0x37')]){_0x7f45d0=0x0;}else{_0x7f45d0=_0x5f03f0[0x0][_0x6894('0x1e')]||0x0;}return dbH[_0x6894('0x85')][_0x6894('0x32')](_0x57d661[_0x6894('0x86')](),{'type':dbH['sequelize'][_0x6894('0x87')][_0x6894('0x88')]});})[_0x6894('0x24')](function(_0x41a083){return{'rows':_0x41a083||[],'count':_0x7f45d0};});}});}exports[_0x6894('0x9f')]=function(_0x32de82,_0x372643){return runReport(_0x32de82['params'],_0x32de82['query'],_0x32de82['options'])['then'](respondWithResult(_0x372643,null))['catch'](handleError(_0x372643,null));};exports['runReport']=runReport;exports['query']=function(_0xd41f27,_0x3eec29){var _0x318919=0xa;var _0x15bcbf=[_0x6894('0x55'),_0x6894('0x56'),_0x6894('0xa0'),_0x6894('0x57')];var _0x33adfb={'SUM':_0x6894('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6894('0x5a'),'MAX':_0x6894('0x5b'),'MIN':_0x6894('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x6894('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x6894('0x60')};var _0xc6c15f={'SEC_TO_TIME':_0x6894('0x61'),'DATE':_0x6894('0x62'),'HOUR':_0x6894('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x24e7e5=function(_0x45ce41){return!_[_0x6894('0x65')]([_0x6894('0x66'),_0x6894('0x67'),'IS\x20EMPTY',_0x6894('0x69')],_0x45ce41);};var _0x182665=function(_0x4a8a81){if(!_0x4a8a81||!_0x4a8a81[_0x6894('0x6a')][_0x6894('0x37')]){return'';}for(var _0x1d44bc='(',_0x5066d2=0x0;_0x5066d2<_0x4a8a81['rules'][_0x6894('0x37')];_0x5066d2+=0x1){_0x5066d2>0x0&&(_0x1d44bc+='\x20'+_0x4a8a81[_0x6894('0x8a')]+'\x20');_0x1d44bc+=_0x4a8a81['rules'][_0x5066d2][_0x6894('0x6b')]?_0x182665(_0x4a8a81[_0x6894('0x6a')][_0x5066d2][_0x6894('0x6b')]):_0x4a8a81[_0x6894('0x6a')][_0x5066d2][_0x6894('0x6c')]+'\x20'+_0x4a8a81[_0x6894('0x6a')][_0x5066d2][_0x6894('0x6d')]+(_0x24e7e5(_0x4a8a81[_0x6894('0x6a')][_0x5066d2]['condition'])?'\x20'+_0x4a8a81['rules'][_0x5066d2][_0x6894('0x8b')]:'');}return _0x1d44bc+')';};var _0x24ce0a={'where':{'id':_0xd41f27[_0x6894('0x48')]['id']}},_0x240d8a,_0x4be470,_0x41d383,_0x422db9,_0x5b5cc5;_0x24ce0a=_[_0x6894('0x3e')]({},_0x24ce0a,_0xd41f27[_0x6894('0x40')]);return db[_0x6894('0x41')][_0x6894('0x4a')](_0x24ce0a)['then'](function(_0x412678){if(_0x412678){_0x240d8a=_0x412678;return _0x412678[_0x6894('0x6e')]();}return null;})[_0x6894('0x24')](function(_0x450af8){if(_0x450af8){if(!_0x450af8[_0x6894('0x37')]){throw new db[(_0x6894('0x8c'))]['ValidationErrorItem'](_0x6894('0x6f'),0x193);}_0x4be470=_0x450af8;return db[_0x6894('0xa1')][_0x6894('0x44')]({'raw':!![]});}return null;})[_0x6894('0x24')](function(_0x4c4f08){if(_0x4c4f08){_0x41d383=_[_0x6894('0x70')](_0x4c4f08,'id');var _0x1c9bb5;var _0x55104e=squel[_0x6894('0x71')]();_0x55104e['from'](_0x240d8a['table']);for(var _0x1e4ecd=0x0;_0x1e4ecd<_0x4be470[_0x6894('0x37')];_0x1e4ecd+=0x1){_0x1c9bb5=_0x4be470[_0x1e4ecd]['MetricId']?_0x41d383[_0x4be470[_0x1e4ecd][_0x6894('0x74')]][_0x6894('0x75')]:_0x4be470[_0x1e4ecd]['field'];_0x1c9bb5=_0x4be470[_0x1e4ecd][_0x6894('0x8e')]?_['replace'](_0x33adfb[_0x4be470[_0x1e4ecd][_0x6894('0x8e')]],'%s',_0x1c9bb5):_0x1c9bb5;_0x1c9bb5=_0x4be470[_0x1e4ecd][_0x6894('0x77')]?_['replace'](_0xc6c15f[_0x4be470[_0x1e4ecd][_0x6894('0x77')]],'%s',_0x1c9bb5):_0x1c9bb5;if(_0x4be470[_0x1e4ecd]['groupBy']){_0x55104e[_0x6894('0x6b')](_0x1c9bb5);}_0x4be470[_0x1e4ecd][_0x6894('0x79')]&&_0x55104e['order'](_0x1c9bb5,_0x4be470[_0x1e4ecd][_0x6894('0x79')]==='DESC'?![]:!![]);_0x55104e[_0x6894('0x6c')](_0x1c9bb5,_0x4be470[_0x1e4ecd][_0x6894('0x7c')]||_0x1c9bb5);}if(_0x240d8a['joins']){_0x240d8a['joins']=JSON[_0x6894('0x7e')](_0x240d8a[_0x6894('0x7d')]);for(var _0x24ce49=0x0;_0x24ce49<_0x240d8a[_0x6894('0x7d')][_0x6894('0x37')];_0x24ce49+=0x1){if(_0x240d8a['joins'][_0x24ce49][_0x6894('0x3f')]&&_['includes'](_0x15bcbf,_0x240d8a[_0x6894('0x7d')][_0x24ce49]['type'])&&_0x240d8a[_0x6894('0x7d')][_0x24ce49][_0x6894('0x82')]&&_0x240d8a['joins'][_0x24ce49][_0x6894('0x7f')]&&_0x240d8a[_0x6894('0x7d')][_0x24ce49][_0x6894('0x80')]){_0x55104e[_0x240d8a['joins'][_0x24ce49]['type']](_0x240d8a[_0x6894('0x7d')][_0x24ce49]['foreignTable'],null,util[_0x6894('0x77')](_0x6894('0x81'),_0x240d8a[_0x6894('0x73')],_0x240d8a[_0x6894('0x7d')][_0x24ce49][_0x6894('0x82')],_0x240d8a[_0x6894('0x7d')][_0x24ce49][_0x6894('0x7f')],_0x240d8a[_0x6894('0x7d')][_0x24ce49][_0x6894('0x80')]));}}}if(_0x240d8a[_0x6894('0x83')]){_0x240d8a[_0x6894('0x83')]=JSON[_0x6894('0x7e')](_0x240d8a[_0x6894('0x83')]);_0x55104e['where'](_0x182665(_0x240d8a[_0x6894('0x83')][_0x6894('0x6b')]));}_0x5b5cc5=_0x55104e['clone']();_0x55104e['limit'](_0x318919);_0x55104e[_0x6894('0x1b')](0x0);logger[_0x6894('0x84')](_0x6894('0xa2'),_0x55104e[_0x6894('0x86')]());return dbH[_0x6894('0x85')][_0x6894('0x32')](_0x55104e[_0x6894('0x86')](),{'type':dbH['sequelize'][_0x6894('0x87')][_0x6894('0x88')]});}})[_0x6894('0x24')](function(){return{'sql':_0x5b5cc5[_0x6894('0x86')]()};})[_0x6894('0x24')](respondWithResult(_0x3eec29,null))[_0x6894('0x46')](handleError(_0x3eec29,null));};
\ No newline at end of file
+var _0x4159=['metric','function','replace','format','orderBy','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','operator','getFields','groupBy','output','web','fullPath','%s-%s.%s','generate','csv','custom','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','child_process','fork','../../components/export/','../../files/reports','COUNT(*)','run','runReport','MIN(%s)','findAll','DESC','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','error','name','index','rawAttributes','fieldName','type','key','map','keys','query','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','AnalyticCustomReport','include','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_join','SUM(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0x4159,0x17d));var _0x9415=function(_0x305d7e,_0x377df9){_0x305d7e=_0x305d7e-0x0;var _0x9403d3=_0x4159[_0x305d7e];return _0x9403d3;};'use strict';var emlformat=require(_0x9415('0x0'));var rimraf=require(_0x9415('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9415('0x2'));var rp=require(_0x9415('0x3'));var moment=require(_0x9415('0x4'));var BPromise=require(_0x9415('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9415('0x6'));var sox=require(_0x9415('0x7'));var csv=require(_0x9415('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9415('0x9'));var squel=require(_0x9415('0xa'));var crypto=require(_0x9415('0xb'));var jsforce=require(_0x9415('0xc'));var deskjs=require(_0x9415('0xd'));var toCsv=require(_0x9415('0x8'));var querystring=require('querystring');var Papa=require(_0x9415('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9415('0xf'));var as=require(_0x9415('0x10'));var hardwareService=require(_0x9415('0x11'));var logger=require(_0x9415('0x12'))('api');var utils=require(_0x9415('0x13'));var config=require(_0x9415('0x14'));var licenseUtil=require(_0x9415('0x15'));var db=require(_0x9415('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9415('0x17')];function respondWithStatusCode(_0x29e5af,_0x57c3d1){_0x57c3d1=_0x57c3d1||0xcc;return function(_0x185a20){if(_0x185a20){return _0x29e5af[_0x9415('0x18')](_0x57c3d1);}return _0x29e5af[_0x9415('0x19')](_0x57c3d1)['end']();};}function respondWithResult(_0x245a46,_0x2f1b97){_0x2f1b97=_0x2f1b97||0xc8;return function(_0x3656b2){if(_0x3656b2){return _0x245a46['status'](_0x2f1b97)[_0x9415('0x1a')](_0x3656b2);}};}function respondWithFilteredResult(_0x4d6035,_0x5b049a){return function(_0x4bf3f5){if(_0x4bf3f5){var _0x5b9fb8=typeof _0x5b049a[_0x9415('0x1b')]===_0x9415('0x1c')&&typeof _0x5b049a[_0x9415('0x1d')]===_0x9415('0x1c');var _0x12183e=_0x4bf3f5[_0x9415('0x1e')];var _0x554427=_0x5b9fb8?0x0:_0x5b049a[_0x9415('0x1b')];var _0x5350ea=_0x5b9fb8?_0x4bf3f5['count']:_0x5b049a['offset']+_0x5b049a[_0x9415('0x1d')];var _0x3c82d2;if(_0x5350ea>=_0x12183e){_0x5350ea=_0x12183e;_0x3c82d2=0xc8;}else{_0x3c82d2=0xce;}_0x4d6035[_0x9415('0x19')](_0x3c82d2);return _0x4d6035[_0x9415('0x1f')](_0x9415('0x20'),_0x554427+'-'+_0x5350ea+'/'+_0x12183e)[_0x9415('0x1a')](_0x4bf3f5);}return null;};}function patchUpdates(_0x4c9277){return function(_0x12941e){try{jsonpatch[_0x9415('0x21')](_0x12941e,_0x4c9277,!![]);}catch(_0x23bbf1){return BPromise[_0x9415('0x22')](_0x23bbf1);}return _0x12941e[_0x9415('0x23')]();};}function saveUpdates(_0x1d98fd,_0x656499){return function(_0x128ecd){if(_0x128ecd){return _0x128ecd[_0x9415('0x24')](_0x1d98fd)[_0x9415('0x25')](function(_0xdb7b45){return _0xdb7b45;});}return null;};}function removeEntity(_0xc31ff2,_0x43d52a){return function(_0x398ff4){if(_0x398ff4){return _0x398ff4[_0x9415('0x26')]()[_0x9415('0x25')](function(){var _0x4c18c8=_0x398ff4['get']({'plain':!![]});var _0x1115ba=_0x9415('0x27');return db['UserProfileResource'][_0x9415('0x26')]({'where':{'type':_0x1115ba,'resourceId':_0x4c18c8['id']}})[_0x9415('0x25')](function(){return _0x398ff4;});})[_0x9415('0x25')](function(){_0xc31ff2[_0x9415('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11f064,_0x1b09d8){return function(_0x166feb){if(!_0x166feb){_0x11f064[_0x9415('0x18')](0x194);}return _0x166feb;};}function handleError(_0x356467,_0x9b7e2f){_0x9b7e2f=_0x9b7e2f||0x1f4;return function(_0x3a2be5){logger[_0x9415('0x28')](_0x3a2be5['stack']);if(_0x3a2be5[_0x9415('0x29')]){delete _0x3a2be5[_0x9415('0x29')];}_0x356467[_0x9415('0x19')](_0x9b7e2f)['send'](_0x3a2be5);};}exports[_0x9415('0x2a')]=function(_0xcd2544,_0x570982){var _0x54d20b={},_0x4ff991={},_0x16641c={'count':0x0,'rows':[]};var _0x52712c=_['map'](db['AnalyticCustomReport'][_0x9415('0x2b')],function(_0x3922c9){return{'name':_0x3922c9[_0x9415('0x2c')],'type':_0x3922c9[_0x9415('0x2d')][_0x9415('0x2e')]};});_0x4ff991['model']=_[_0x9415('0x2f')](_0x52712c,_0x9415('0x29'));_0x4ff991['query']=_[_0x9415('0x30')](_0xcd2544[_0x9415('0x31')]);_0x4ff991['filters']=_[_0x9415('0x32')](_0x4ff991[_0x9415('0x33')],_0x4ff991[_0x9415('0x31')]);_0x54d20b['attributes']=_[_0x9415('0x32')](_0x4ff991['model'],qs[_0x9415('0x34')](_0xcd2544[_0x9415('0x31')][_0x9415('0x34')]));_0x54d20b[_0x9415('0x35')]=_0x54d20b['attributes'][_0x9415('0x36')]?_0x54d20b[_0x9415('0x35')]:_0x4ff991[_0x9415('0x33')];if(!_0xcd2544['query']['hasOwnProperty'](_0x9415('0x37'))){_0x54d20b[_0x9415('0x1d')]=qs[_0x9415('0x1d')](_0xcd2544['query']['limit']);_0x54d20b[_0x9415('0x1b')]=qs['offset'](_0xcd2544[_0x9415('0x31')][_0x9415('0x1b')]);}_0x54d20b[_0x9415('0x38')]=qs[_0x9415('0x39')](_0xcd2544[_0x9415('0x31')][_0x9415('0x39')]);_0x54d20b['where']=qs['filters'](_[_0x9415('0x3a')](_0xcd2544[_0x9415('0x31')],_0x4ff991[_0x9415('0x3b')]),_0x52712c);if(_0xcd2544[_0x9415('0x31')][_0x9415('0x3c')]){_0x54d20b[_0x9415('0x3d')]=_[_0x9415('0x3e')](_0x54d20b['where'],{'$or':_[_0x9415('0x2f')](_0x52712c,function(_0x36e95d){if(_0x36e95d['type']!==_0x9415('0x3f')){var _0x4303f4={};_0x4303f4[_0x36e95d[_0x9415('0x29')]]={'$like':'%'+_0xcd2544[_0x9415('0x31')]['filter']+'%'};return _0x4303f4;}})});}_0x54d20b=_[_0x9415('0x3e')]({},_0x54d20b,_0xcd2544[_0x9415('0x40')]);var _0x5dfd9d={'where':_0x54d20b['where']};return db[_0x9415('0x41')][_0x9415('0x1e')](_0x5dfd9d)[_0x9415('0x25')](function(_0x27fdae){_0x16641c['count']=_0x27fdae;if(_0xcd2544[_0x9415('0x31')]['includeAll']){_0x54d20b[_0x9415('0x42')]=[{'all':!![]}];}return db[_0x9415('0x41')]['findAll'](_0x54d20b);})['then'](function(_0x3c2e0f){_0x16641c[_0x9415('0x43')]=_0x3c2e0f;return _0x16641c;})['then'](respondWithFilteredResult(_0x570982,_0x54d20b))[_0x9415('0x44')](handleError(_0x570982,null));};exports[_0x9415('0x45')]=function(_0xa11859,_0x41c6ed){var _0x3a03df={'raw':![],'where':{'id':_0xa11859[_0x9415('0x46')]['id']}},_0x3760cf={};_0x3760cf[_0x9415('0x33')]=_['keys'](db[_0x9415('0x41')][_0x9415('0x2b')]);_0x3760cf[_0x9415('0x31')]=_[_0x9415('0x30')](_0xa11859['query']);_0x3760cf['filters']=_[_0x9415('0x32')](_0x3760cf[_0x9415('0x33')],_0x3760cf[_0x9415('0x31')]);_0x3a03df['attributes']=_[_0x9415('0x32')](_0x3760cf[_0x9415('0x33')],qs['fields'](_0xa11859[_0x9415('0x31')][_0x9415('0x34')]));_0x3a03df[_0x9415('0x35')]=_0x3a03df[_0x9415('0x35')][_0x9415('0x36')]?_0x3a03df[_0x9415('0x35')]:_0x3760cf[_0x9415('0x33')];if(_0xa11859[_0x9415('0x31')]['includeAll']){_0x3a03df[_0x9415('0x42')]=[{'all':!![]}];}_0x3a03df=_[_0x9415('0x3e')]({},_0x3a03df,_0xa11859[_0x9415('0x40')]);return db[_0x9415('0x41')][_0x9415('0x47')](_0x3a03df)[_0x9415('0x25')](handleEntityNotFound(_0x41c6ed,null))[_0x9415('0x25')](respondWithResult(_0x41c6ed,null))['catch'](handleError(_0x41c6ed,null));};exports[_0x9415('0x48')]=function(_0xdabc6f,_0x53e3c7){return db[_0x9415('0x41')][_0x9415('0x48')](_0xdabc6f[_0x9415('0x49')],{})['then'](function(_0x441752){var _0x4ffb9c=_0xdabc6f[_0x9415('0x4a')][_0x9415('0x4b')]({'plain':!![]});if(!_0x4ffb9c)throw new Error(_0x9415('0x4c'));if(_0x4ffb9c[_0x9415('0x4d')]==='user'){var _0x216595=_0x441752[_0x9415('0x4b')]({'plain':!![]});var _0x525f3c='Reports';return db[_0x9415('0x4e')][_0x9415('0x47')]({'where':{'name':_0x525f3c,'userProfileId':_0x4ffb9c[_0x9415('0x4f')]},'raw':!![]})[_0x9415('0x25')](function(_0x56fcb7){if(_0x56fcb7&&_0x56fcb7[_0x9415('0x50')]===0x0){return db[_0x9415('0x51')][_0x9415('0x48')]({'name':_0x216595[_0x9415('0x29')],'resourceId':_0x216595['id'],'type':_0x9415('0x27'),'sectionId':_0x56fcb7['id']},{})['then'](function(){return _0x441752;});}else{return _0x441752;}})[_0x9415('0x44')](function(_0x5c01a2){logger[_0x9415('0x28')](_0x9415('0x52'),_0x5c01a2);throw _0x5c01a2;});}return _0x441752;})['then'](respondWithResult(_0x53e3c7,0xc9))[_0x9415('0x44')](handleError(_0x53e3c7,null));};exports[_0x9415('0x24')]=function(_0x4c35c3,_0x3cfe46){if(_0x4c35c3[_0x9415('0x49')]['id']){delete _0x4c35c3[_0x9415('0x49')]['id'];}return db[_0x9415('0x41')][_0x9415('0x47')]({'where':{'id':_0x4c35c3[_0x9415('0x46')]['id']}})[_0x9415('0x25')](handleEntityNotFound(_0x3cfe46,null))['then'](saveUpdates(_0x4c35c3[_0x9415('0x49')],null))['then'](respondWithResult(_0x3cfe46,null))[_0x9415('0x44')](handleError(_0x3cfe46,null));};exports[_0x9415('0x26')]=function(_0x1d5e86,_0x3a4325){return db['AnalyticCustomReport'][_0x9415('0x47')]({'where':{'id':_0x1d5e86['params']['id']}})[_0x9415('0x25')](handleEntityNotFound(_0x3a4325,null))[_0x9415('0x25')](removeEntity(_0x3a4325,null))[_0x9415('0x44')](handleError(_0x3a4325,null));};exports[_0x9415('0x53')]=function(_0x43602f,_0x1f6042){var _0x461794=0xa;var _0xcefce1=[_0x9415('0x54'),'left_join',_0x9415('0x55'),_0x9415('0x56')];var _0x57a877={'SUM':_0x9415('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9415('0x58'),'MIN':'MIN(%s)','AVG':_0x9415('0x59'),'GROUP_CONCAT':_0x9415('0x5a'),'GROUP_CONCAT ASC':_0x9415('0x5b'),'GROUP_CONCAT DESC':_0x9415('0x5c')};var _0x648f24={'SEC_TO_TIME':_0x9415('0x5d'),'DATE':_0x9415('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x9415('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5c6ba8=function(_0x2c76cf){return!_['includes']([_0x9415('0x60'),_0x9415('0x61'),_0x9415('0x62'),_0x9415('0x63')],_0x2c76cf);};var _0x465b04=function(_0x5e11e6){if(!_0x5e11e6||!_0x5e11e6[_0x9415('0x64')][_0x9415('0x36')]){return'';}for(var _0x590f86='(',_0x4aef44=0x0;_0x4aef44<_0x5e11e6[_0x9415('0x64')][_0x9415('0x36')];_0x4aef44+=0x1){_0x4aef44>0x0&&(_0x590f86+='\x20'+_0x5e11e6['operator']+'\x20');_0x590f86+=_0x5e11e6[_0x9415('0x64')][_0x4aef44][_0x9415('0x65')]?_0x465b04(_0x5e11e6[_0x9415('0x64')][_0x4aef44]['group']):_0x5e11e6[_0x9415('0x64')][_0x4aef44][_0x9415('0x66')]+'\x20'+_0x5e11e6[_0x9415('0x64')][_0x4aef44][_0x9415('0x67')]+(_0x5c6ba8(_0x5e11e6[_0x9415('0x64')][_0x4aef44]['condition'])?'\x20'+_0x5e11e6[_0x9415('0x64')][_0x4aef44][_0x9415('0x68')]:'');}return _0x590f86+')';};var _0x15e6d1={'where':{'id':_0x43602f[_0x9415('0x46')]['id']}},_0x3234fb,_0x1231e6,_0x142116,_0x28e075,_0x4743c3;_0x15e6d1=_['merge']({},_0x15e6d1,_0x43602f[_0x9415('0x40')]);return db[_0x9415('0x41')]['find'](_0x15e6d1)[_0x9415('0x25')](function(_0x49c7d4){if(_0x49c7d4){_0x3234fb=_0x49c7d4;return _0x49c7d4['getFields']();}return null;})[_0x9415('0x25')](function(_0x2f2577){if(_0x2f2577){if(!_0x2f2577[_0x9415('0x36')]){throw new db[(_0x9415('0x69'))][(_0x9415('0x6a'))](_0x9415('0x6b'),0x193);}_0x1231e6=_0x2f2577;return db[_0x9415('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x23e7bd){if(_0x23e7bd){_0x142116=_[_0x9415('0x6d')](_0x23e7bd,'id');var _0x585b04;var _0x5173e1=squel[_0x9415('0x6e')]();_0x5173e1[_0x9415('0x6f')](_0x3234fb[_0x9415('0x70')]);for(var _0x31b0cf=0x0;_0x31b0cf<_0x1231e6[_0x9415('0x36')];_0x31b0cf+=0x1){_0x585b04=_0x1231e6[_0x31b0cf]['MetricId']?_0x142116[_0x1231e6[_0x31b0cf][_0x9415('0x71')]][_0x9415('0x72')]:_0x1231e6[_0x31b0cf][_0x9415('0x66')];_0x585b04=_0x1231e6[_0x31b0cf][_0x9415('0x73')]?_[_0x9415('0x74')](_0x57a877[_0x1231e6[_0x31b0cf][_0x9415('0x73')]],'%s',_0x585b04):_0x585b04;_0x585b04=_0x1231e6[_0x31b0cf][_0x9415('0x75')]?_[_0x9415('0x74')](_0x648f24[_0x1231e6[_0x31b0cf][_0x9415('0x75')]],'%s',_0x585b04):_0x585b04;if(_0x1231e6[_0x31b0cf]['groupBy']){_0x5173e1['group'](_0x585b04);}_0x1231e6[_0x31b0cf][_0x9415('0x76')]&&_0x5173e1[_0x9415('0x38')](_0x585b04,_0x1231e6[_0x31b0cf][_0x9415('0x76')]==='DESC'?![]:!![]);_0x5173e1[_0x9415('0x66')](_0x585b04,_0x1231e6[_0x31b0cf][_0x9415('0x77')]||_0x585b04);}if(_0x3234fb[_0x9415('0x78')]){_0x3234fb[_0x9415('0x78')]=JSON[_0x9415('0x79')](_0x3234fb[_0x9415('0x78')]);for(var _0x144a24=0x0;_0x144a24<_0x3234fb[_0x9415('0x78')]['length'];_0x144a24+=0x1){if(_0x3234fb[_0x9415('0x78')][_0x144a24]['type']&&_['includes'](_0xcefce1,_0x3234fb[_0x9415('0x78')][_0x144a24][_0x9415('0x2d')])&&_0x3234fb[_0x9415('0x78')][_0x144a24][_0x9415('0x7a')]&&_0x3234fb[_0x9415('0x78')][_0x144a24]['foreignTable']&&_0x3234fb['joins'][_0x144a24][_0x9415('0x7b')]){_0x5173e1[_0x3234fb['joins'][_0x144a24][_0x9415('0x2d')]](_0x3234fb[_0x9415('0x78')][_0x144a24][_0x9415('0x7c')],null,util[_0x9415('0x75')](_0x9415('0x7d'),_0x3234fb[_0x9415('0x70')],_0x3234fb[_0x9415('0x78')][_0x144a24][_0x9415('0x7a')],_0x3234fb[_0x9415('0x78')][_0x144a24][_0x9415('0x7c')],_0x3234fb[_0x9415('0x78')][_0x144a24]['foreignKey']));}}}if(_0x3234fb[_0x9415('0x7e')]){_0x3234fb['conditions']=JSON[_0x9415('0x79')](_0x3234fb[_0x9415('0x7e')]);_0x5173e1[_0x9415('0x3d')](_0x465b04(_0x3234fb['conditions'][_0x9415('0x65')]));}_0x4743c3=_0x5173e1[_0x9415('0x7f')]();_0x5173e1['limit'](_0x461794);_0x5173e1[_0x9415('0x1b')](0x0);logger[_0x9415('0x80')]('Limited\x20Query:',_0x5173e1[_0x9415('0x81')]());return dbH[_0x9415('0x82')][_0x9415('0x31')](_0x5173e1[_0x9415('0x81')](),{'type':dbH['sequelize'][_0x9415('0x83')][_0x9415('0x84')]});}})[_0x9415('0x25')](respondWithResult(_0x1f6042,null))['catch'](handleError(_0x1f6042,null));};function runReport(_0x8a2383,_0x13e2ed,_0x1b228e){var _0x280181=_0x13e2ed[_0x9415('0x29')];var _0xd16b87=0xa;var _0x4fea59=[_0x9415('0x54'),_0x9415('0x85'),_0x9415('0x55'),'cross_join'];var _0x58c13d={'SUM':_0x9415('0x57'),'COUNT':_0x9415('0x86'),'COUNT DISTINCT':_0x9415('0x87'),'MAX':_0x9415('0x58'),'MIN':'MIN(%s)','AVG':_0x9415('0x59'),'GROUP_CONCAT':_0x9415('0x5a'),'GROUP_CONCAT ASC':_0x9415('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xce6fb0={'SEC_TO_TIME':_0x9415('0x5d'),'DATE':_0x9415('0x5e'),'HOUR':_0x9415('0x88'),'ROUND':_0x9415('0x5f'),'UNIX_TIMESTAMP':_0x9415('0x89')};var _0x3eec3b=function(_0x297861){return!_[_0x9415('0x8a')]([_0x9415('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x297861);};var _0x419eee=function(_0x10a38d){if(!_0x10a38d||!_0x10a38d[_0x9415('0x64')][_0x9415('0x36')]){return'';}for(var _0x32b709='(',_0x4562a9=0x0;_0x4562a9<_0x10a38d[_0x9415('0x64')][_0x9415('0x36')];_0x4562a9+=0x1){_0x4562a9>0x0&&(_0x32b709+='\x20'+_0x10a38d[_0x9415('0x8b')]+'\x20');_0x32b709+=_0x10a38d[_0x9415('0x64')][_0x4562a9]['group']?_0x419eee(_0x10a38d[_0x9415('0x64')][_0x4562a9][_0x9415('0x65')]):_0x10a38d[_0x9415('0x64')][_0x4562a9]['field']+'\x20'+_0x10a38d[_0x9415('0x64')][_0x4562a9]['condition']+(_0x3eec3b(_0x10a38d['rules'][_0x4562a9][_0x9415('0x67')])?'\x20'+_0x10a38d['rules'][_0x4562a9][_0x9415('0x68')]:'');}return _0x32b709+')';};var _0x4c37f8={'where':{'id':_0x8a2383['id']}},_0x2f2638,_0x4487b5,_0x4245f8,_0x552f21,_0x5be4f0;_0x4c37f8=_[_0x9415('0x3e')]({},_0x4c37f8,_0x1b228e);return db['AnalyticCustomReport'][_0x9415('0x47')](_0x4c37f8)[_0x9415('0x25')](function(_0x28acc3){if(_0x28acc3){_0x2f2638=_0x28acc3;return _0x28acc3[_0x9415('0x8c')]();}return null;})['then'](function(_0x3ef552){if(_0x3ef552){if(!_0x3ef552[_0x9415('0x36')]){throw new db[(_0x9415('0x69'))][(_0x9415('0x6a'))](_0x9415('0x6b'),0x193);}_0x4487b5=_0x3ef552;return db[_0x9415('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x9415('0x25')](function(_0x3934a0){if(_0x3934a0){_0x4245f8=_[_0x9415('0x6d')](_0x3934a0,'id');var _0x50cb1a;var _0x23d6ee=squel[_0x9415('0x6e')]();_0x23d6ee[_0x9415('0x6f')](_0x2f2638[_0x9415('0x70')]);for(var _0x41b494=0x0;_0x41b494<_0x4487b5['length'];_0x41b494+=0x1){_0x50cb1a=_0x4487b5[_0x41b494][_0x9415('0x71')]?_0x4245f8[_0x4487b5[_0x41b494][_0x9415('0x71')]][_0x9415('0x72')]:_0x4487b5[_0x41b494][_0x9415('0x66')];_0x50cb1a=_0x4487b5[_0x41b494][_0x9415('0x73')]?_[_0x9415('0x74')](_0x58c13d[_0x4487b5[_0x41b494]['function']],'%s',_0x50cb1a):_0x50cb1a;_0x50cb1a=_0x4487b5[_0x41b494][_0x9415('0x75')]?_[_0x9415('0x74')](_0xce6fb0[_0x4487b5[_0x41b494][_0x9415('0x75')]],'%s',_0x50cb1a):_0x50cb1a;if(_0x4487b5[_0x41b494][_0x9415('0x8d')]){_0x23d6ee[_0x9415('0x65')](_0x50cb1a);}_0x4487b5[_0x41b494][_0x9415('0x76')]&&_0x23d6ee[_0x9415('0x38')](_0x50cb1a,_0x4487b5[_0x41b494]['orderBy']==='DESC'?![]:!![]);_0x23d6ee[_0x9415('0x66')](_0x50cb1a,_0x4487b5[_0x41b494][_0x9415('0x77')]||_0x50cb1a);}if(_0x2f2638[_0x9415('0x78')]){_0x2f2638[_0x9415('0x78')]=JSON[_0x9415('0x79')](_0x2f2638[_0x9415('0x78')]);for(var _0x571ae2=0x0;_0x571ae2<_0x2f2638['joins'][_0x9415('0x36')];_0x571ae2+=0x1){if(_0x2f2638[_0x9415('0x78')][_0x571ae2][_0x9415('0x2d')]&&_[_0x9415('0x8a')](_0x4fea59,_0x2f2638['joins'][_0x571ae2]['type'])&&_0x2f2638[_0x9415('0x78')][_0x571ae2][_0x9415('0x7a')]&&_0x2f2638[_0x9415('0x78')][_0x571ae2][_0x9415('0x7c')]&&_0x2f2638[_0x9415('0x78')][_0x571ae2][_0x9415('0x7b')]){_0x23d6ee[_0x2f2638['joins'][_0x571ae2][_0x9415('0x2d')]](_0x2f2638['joins'][_0x571ae2][_0x9415('0x7c')],null,util[_0x9415('0x75')](_0x9415('0x7d'),_0x2f2638[_0x9415('0x70')],_0x2f2638['joins'][_0x571ae2]['parentKey'],_0x2f2638[_0x9415('0x78')][_0x571ae2]['foreignTable'],_0x2f2638[_0x9415('0x78')][_0x571ae2][_0x9415('0x7b')]));}}}if(_0x2f2638[_0x9415('0x7e')]){_0x2f2638[_0x9415('0x7e')]=JSON[_0x9415('0x79')](_0x2f2638[_0x9415('0x7e')]);_0x23d6ee[_0x9415('0x3d')](_0x419eee(_0x2f2638[_0x9415('0x7e')][_0x9415('0x65')]));}_0x5be4f0=_0x23d6ee['clone']();_0x23d6ee[_0x9415('0x1d')](_0xd16b87);_0x23d6ee['offset'](0x0);return;}})[_0x9415('0x25')](function(){if(_0x13e2ed[_0x9415('0x8e')]===_0x9415('0x8f')){return null;}var _0x5c6651=_[_0x9415('0x3e')](_0x13e2ed,{'name':_0x13e2ed[_0x9415('0x90')]||_0x13e2ed[_0x9415('0x29')]||_0x2f2638[_0x9415('0x29')],'basename':_0x280181,'savename':util[_0x9415('0x75')](_0x9415('0x91'),_0x13e2ed[_0x9415('0x29')]||_0x2f2638[_0x9415('0x29')],require('randomstring')[_0x9415('0x92')](0x4),_0x13e2ed[_0x9415('0x8e')]||_0x9415('0x93')),'reportId':_0x2f2638['id'],'reportType':_0x9415('0x94')});return db['AnalyticExtractedReport'][_0x9415('0x48')](_0x5c6651,{'raw':!![]});})['then'](function(_0x4ef66c){if(_0x2f2638['table']==='cdr'){_0x5be4f0[_0x9415('0x3d')](_0x2f2638[_0x9415('0x70')]+_0x9415('0x95'),_0x13e2ed['startDate'],_0x13e2ed[_0x9415('0x96')]);}else{_0x5be4f0['where'](_0x2f2638[_0x9415('0x70')]+_0x9415('0x97'),_0x13e2ed[_0x9415('0x98')],_0x13e2ed[_0x9415('0x96')]);}if(_0x4ef66c){logger[_0x9415('0x99')]('Run\x20Query:',_0x5be4f0[_0x9415('0x81')]());require(_0x9415('0x9a'))[_0x9415('0x9b')](path[_0x9415('0x54')](__dirname,_0x9415('0x9c'),_0x4ef66c[_0x9415('0x8e')]),[_0x4ef66c['id'],_0x5be4f0[_0x9415('0x81')](),path[_0x9415('0x54')](__dirname,_0x9415('0x9d'),_0x4ef66c['savename']),_0x280181]);return _0x4ef66c;}else{var _0x4cdf14=squel['select']();_0x4cdf14[_0x9415('0x6f')]('('+_0x5be4f0[_0x9415('0x81')]()+')','countTable');_0x4cdf14[_0x9415('0x66')](_0x9415('0x9e'),_0x9415('0x1e'));_0x5be4f0[_0x9415('0x1d')](_0x13e2ed['limit']||_0xd16b87);_0x5be4f0[_0x9415('0x1b')](_0x13e2ed['offset']||0x0);return dbH[_0x9415('0x82')][_0x9415('0x31')](_0x4cdf14['toString'](),{'type':dbH[_0x9415('0x82')][_0x9415('0x83')][_0x9415('0x84')]})[_0x9415('0x25')](function(_0x3583d9){if(!_0x3583d9[_0x9415('0x36')]){_0x552f21=0x0;}else{_0x552f21=_0x3583d9[0x0]['count']||0x0;}return dbH[_0x9415('0x82')][_0x9415('0x31')](_0x5be4f0[_0x9415('0x81')](),{'type':dbH[_0x9415('0x82')]['QueryTypes'][_0x9415('0x84')]});})['then'](function(_0x1b3679){return{'rows':_0x1b3679||[],'count':_0x552f21};});}});}exports[_0x9415('0x9f')]=function(_0xe0e521,_0x29f581){return runReport(_0xe0e521[_0x9415('0x46')],_0xe0e521[_0x9415('0x31')],_0xe0e521['options'])[_0x9415('0x25')](respondWithResult(_0x29f581,null))['catch'](handleError(_0x29f581,null));};exports[_0x9415('0xa0')]=runReport;exports[_0x9415('0x31')]=function(_0x4299bb,_0x1eaab0){var _0x13fed2=0xa;var _0x90a04=[_0x9415('0x54'),_0x9415('0x85'),_0x9415('0x55'),_0x9415('0x56')];var _0x112b24={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9415('0x87'),'MAX':_0x9415('0x58'),'MIN':_0x9415('0xa1'),'AVG':_0x9415('0x59'),'GROUP_CONCAT':_0x9415('0x5a'),'GROUP_CONCAT ASC':_0x9415('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x27e3ab={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9415('0x5e'),'HOUR':_0x9415('0x88'),'ROUND':_0x9415('0x5f'),'UNIX_TIMESTAMP':_0x9415('0x89')};var _0x408eeb=function(_0x3aeab2){return!_[_0x9415('0x8a')]([_0x9415('0x60'),_0x9415('0x61'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x3aeab2);};var _0x5b9df7=function(_0x478e1e){if(!_0x478e1e||!_0x478e1e[_0x9415('0x64')]['length']){return'';}for(var _0x579f87='(',_0x53128c=0x0;_0x53128c<_0x478e1e[_0x9415('0x64')][_0x9415('0x36')];_0x53128c+=0x1){_0x53128c>0x0&&(_0x579f87+='\x20'+_0x478e1e[_0x9415('0x8b')]+'\x20');_0x579f87+=_0x478e1e[_0x9415('0x64')][_0x53128c]['group']?_0x5b9df7(_0x478e1e[_0x9415('0x64')][_0x53128c][_0x9415('0x65')]):_0x478e1e[_0x9415('0x64')][_0x53128c][_0x9415('0x66')]+'\x20'+_0x478e1e[_0x9415('0x64')][_0x53128c][_0x9415('0x67')]+(_0x408eeb(_0x478e1e[_0x9415('0x64')][_0x53128c]['condition'])?'\x20'+_0x478e1e[_0x9415('0x64')][_0x53128c][_0x9415('0x68')]:'');}return _0x579f87+')';};var _0x2c5fae={'where':{'id':_0x4299bb[_0x9415('0x46')]['id']}},_0x1034f7,_0x41972b,_0x3513c7,_0x5e1af9,_0x506998;_0x2c5fae=_['merge']({},_0x2c5fae,_0x4299bb[_0x9415('0x40')]);return db['AnalyticCustomReport'][_0x9415('0x47')](_0x2c5fae)[_0x9415('0x25')](function(_0x2151a5){if(_0x2151a5){_0x1034f7=_0x2151a5;return _0x2151a5[_0x9415('0x8c')]();}return null;})['then'](function(_0x2f3258){if(_0x2f3258){if(!_0x2f3258[_0x9415('0x36')]){throw new db[(_0x9415('0x69'))][(_0x9415('0x6a'))](_0x9415('0x6b'),0x193);}_0x41972b=_0x2f3258;return db['AnalyticMetric'][_0x9415('0xa2')]({'raw':!![]});}return null;})[_0x9415('0x25')](function(_0x34b294){if(_0x34b294){_0x3513c7=_[_0x9415('0x6d')](_0x34b294,'id');var _0x2e656d;var _0x1d501d=squel[_0x9415('0x6e')]();_0x1d501d[_0x9415('0x6f')](_0x1034f7[_0x9415('0x70')]);for(var _0x59e4b7=0x0;_0x59e4b7<_0x41972b[_0x9415('0x36')];_0x59e4b7+=0x1){_0x2e656d=_0x41972b[_0x59e4b7][_0x9415('0x71')]?_0x3513c7[_0x41972b[_0x59e4b7][_0x9415('0x71')]]['metric']:_0x41972b[_0x59e4b7][_0x9415('0x66')];_0x2e656d=_0x41972b[_0x59e4b7][_0x9415('0x73')]?_[_0x9415('0x74')](_0x112b24[_0x41972b[_0x59e4b7]['function']],'%s',_0x2e656d):_0x2e656d;_0x2e656d=_0x41972b[_0x59e4b7]['format']?_['replace'](_0x27e3ab[_0x41972b[_0x59e4b7][_0x9415('0x75')]],'%s',_0x2e656d):_0x2e656d;if(_0x41972b[_0x59e4b7][_0x9415('0x8d')]){_0x1d501d[_0x9415('0x65')](_0x2e656d);}_0x41972b[_0x59e4b7]['orderBy']&&_0x1d501d[_0x9415('0x38')](_0x2e656d,_0x41972b[_0x59e4b7]['orderBy']===_0x9415('0xa3')?![]:!![]);_0x1d501d['field'](_0x2e656d,_0x41972b[_0x59e4b7]['alias']||_0x2e656d);}if(_0x1034f7['joins']){_0x1034f7[_0x9415('0x78')]=JSON[_0x9415('0x79')](_0x1034f7[_0x9415('0x78')]);for(var _0x1dfda9=0x0;_0x1dfda9<_0x1034f7[_0x9415('0x78')][_0x9415('0x36')];_0x1dfda9+=0x1){if(_0x1034f7[_0x9415('0x78')][_0x1dfda9][_0x9415('0x2d')]&&_['includes'](_0x90a04,_0x1034f7['joins'][_0x1dfda9][_0x9415('0x2d')])&&_0x1034f7[_0x9415('0x78')][_0x1dfda9]['parentKey']&&_0x1034f7[_0x9415('0x78')][_0x1dfda9][_0x9415('0x7c')]&&_0x1034f7[_0x9415('0x78')][_0x1dfda9][_0x9415('0x7b')]){_0x1d501d[_0x1034f7[_0x9415('0x78')][_0x1dfda9]['type']](_0x1034f7[_0x9415('0x78')][_0x1dfda9][_0x9415('0x7c')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1034f7[_0x9415('0x70')],_0x1034f7['joins'][_0x1dfda9][_0x9415('0x7a')],_0x1034f7[_0x9415('0x78')][_0x1dfda9]['foreignTable'],_0x1034f7['joins'][_0x1dfda9][_0x9415('0x7b')]));}}}if(_0x1034f7[_0x9415('0x7e')]){_0x1034f7[_0x9415('0x7e')]=JSON[_0x9415('0x79')](_0x1034f7[_0x9415('0x7e')]);_0x1d501d[_0x9415('0x3d')](_0x5b9df7(_0x1034f7['conditions'][_0x9415('0x65')]));}_0x506998=_0x1d501d['clone']();_0x1d501d[_0x9415('0x1d')](_0x13fed2);_0x1d501d[_0x9415('0x1b')](0x0);logger[_0x9415('0x80')](_0x9415('0xa4'),_0x1d501d['toString']());return dbH[_0x9415('0x82')][_0x9415('0x31')](_0x1d501d[_0x9415('0x81')](),{'type':dbH[_0x9415('0x82')][_0x9415('0x83')][_0x9415('0x84')]});}})['then'](function(){return{'sql':_0x506998[_0x9415('0x81')]()};})[_0x9415('0x25')](respondWithResult(_0x1eaab0,null))[_0x9415('0x44')](handleError(_0x1eaab0,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 7af897b..2d6512c 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 _0xbb4f=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2a7b8f,_0x2a4c6a){var _0x467b8=function(_0x3c0cbc){while(--_0x3c0cbc){_0x2a7b8f['push'](_0x2a7b8f['shift']());}};_0x467b8(++_0x2a4c6a);}(_0xbb4f,0x10b));var _0xfbb4=function(_0x4e8210,_0x26f275){_0x4e8210=_0x4e8210-0x0;var _0x3edabc=_0xbb4f[_0x4e8210];return _0x3edabc;};'use strict';var _=require(_0xfbb4('0x0'));var util=require('util');var logger=require(_0xfbb4('0x1'))(_0xfbb4('0x2'));var moment=require(_0xfbb4('0x3'));var BPromise=require(_0xfbb4('0x4'));var rp=require(_0xfbb4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbb4('0x6'));var config=require(_0xfbb4('0x7'));var attributes=require(_0xfbb4('0x8'));module[_0xfbb4('0x9')]=function(_0x1a8604,_0x44cc45){return _0x1a8604[_0xfbb4('0xa')](_0xfbb4('0xb'),attributes,{'tableName':_0xfbb4('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x96a6=['AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96a6,0x128));var _0x696a=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x96a6[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x696a('0x0'));var util=require(_0x696a('0x1'));var logger=require(_0x696a('0x2'))(_0x696a('0x3'));var moment=require(_0x696a('0x4'));var BPromise=require(_0x696a('0x5'));var rp=require(_0x696a('0x6'));var fs=require('fs');var path=require(_0x696a('0x7'));var rimraf=require(_0x696a('0x8'));var config=require(_0x696a('0x9'));var attributes=require(_0x696a('0xa'));module[_0x696a('0xb')]=function(_0x469cc9,_0x309129){return _0x469cc9['define'](_0x696a('0xc'),attributes,{'tableName':_0x696a('0xd'),'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 5937918..9ece6f5 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 _0x2fd9=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0x2fd9,0x114));var _0x92fd=function(_0x2bfd90,_0x102539){_0x2bfd90=_0x2bfd90-0x0;var _0x33e709=_0x2fd9[_0x2bfd90];return _0x33e709;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x92fd('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92fd('0x1'));var db=require(_0x92fd('0x2'))['db'];var utils=require(_0x92fd('0x3'));var logger=require(_0x92fd('0x4'))(_0x92fd('0x5'));var config=require(_0x92fd('0x6'));var jayson=require(_0x92fd('0x7'));var client=jayson[_0x92fd('0x8')][_0x92fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50533a,_0x52f35a,_0x2e4657){return new BPromise(function(_0x1c8271,_0x4a4b87){return client[_0x92fd('0xa')](_0x50533a,_0x2e4657)[_0x92fd('0xb')](function(_0x562957){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x52f35a,_0x92fd('0xc'));logger[_0x92fd('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x52f35a,_0x92fd('0xc'),JSON[_0x92fd('0xe')](_0x562957));if(_0x562957['error']){if(_0x562957[_0x92fd('0xf')][_0x92fd('0x10')]===0x1f4){logger[_0x92fd('0xf')](_0x92fd('0x11'),_0x52f35a,_0x562957[_0x92fd('0xf')][_0x92fd('0x12')]);return _0x4a4b87(_0x562957[_0x92fd('0xf')][_0x92fd('0x12')]);}logger[_0x92fd('0xf')](_0x92fd('0x11'),_0x52f35a,_0x562957[_0x92fd('0xf')]['message']);return _0x1c8271(_0x562957[_0x92fd('0xf')][_0x92fd('0x12')]);}else{logger['info'](_0x92fd('0x11'),_0x52f35a,'request\x20sent');_0x1c8271(_0x562957[_0x92fd('0x13')][_0x92fd('0x12')]);}})['catch'](function(_0x3fa5b9){logger[_0x92fd('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x52f35a,_0x3fa5b9);_0x4a4b87(_0x3fa5b9);});});}
\ No newline at end of file
+var _0xfd0c=['request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0xce2d7e,_0x56dac4){var _0x3143d9=function(_0x52633b){while(--_0x52633b){_0xce2d7e['push'](_0xce2d7e['shift']());}};_0x3143d9(++_0x56dac4);}(_0xfd0c,0x179));var _0xcfd0=function(_0x46ef1d,_0x24926){_0x46ef1d=_0x46ef1d-0x0;var _0x49ce69=_0xfd0c[_0x46ef1d];return _0x49ce69;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcfd0('0x0'));var BPromise=require(_0xcfd0('0x1'));var rs=require(_0xcfd0('0x2'));var fs=require('fs');var Redis=require(_0xcfd0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcfd0('0x4'));var logger=require(_0xcfd0('0x5'))(_0xcfd0('0x6'));var config=require(_0xcfd0('0x7'));var jayson=require(_0xcfd0('0x8'));var client=jayson[_0xcfd0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b16b1,_0xe0c6d7,_0xaed066){return new BPromise(function(_0x2113e7,_0x4cf61c){return client[_0xcfd0('0xa')](_0x2b16b1,_0xaed066)[_0xcfd0('0xb')](function(_0x3d3d25){logger[_0xcfd0('0xc')](_0xcfd0('0xd'),_0xe0c6d7,_0xcfd0('0xe'));logger[_0xcfd0('0xf')](_0xcfd0('0x10'),_0xe0c6d7,_0xcfd0('0xe'),JSON[_0xcfd0('0x11')](_0x3d3d25));if(_0x3d3d25[_0xcfd0('0x12')]){if(_0x3d3d25[_0xcfd0('0x12')][_0xcfd0('0x13')]===0x1f4){logger[_0xcfd0('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0xe0c6d7,_0x3d3d25['error']['message']);return _0x4cf61c(_0x3d3d25['error']['message']);}logger[_0xcfd0('0x12')](_0xcfd0('0xd'),_0xe0c6d7,_0x3d3d25[_0xcfd0('0x12')][_0xcfd0('0x14')]);return _0x2113e7(_0x3d3d25[_0xcfd0('0x12')][_0xcfd0('0x14')]);}else{logger[_0xcfd0('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0xe0c6d7,_0xcfd0('0xe'));_0x2113e7(_0x3d3d25[_0xcfd0('0x15')]['message']);}})[_0xcfd0('0x16')](function(_0x3cc2c3){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xe0c6d7,_0x3cc2c3);_0x4cf61c(_0x3cc2c3);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 11bed6c..7cf70c4 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 _0x8297=['show','get','/:id/preview','preview','/:id/run','run','/:id/query','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','/:id'];(function(_0x4bca31,_0x394def){var _0x49816d=function(_0xfe82d5){while(--_0xfe82d5){_0x4bca31['push'](_0x4bca31['shift']());}};_0x49816d(++_0x394def);}(_0x8297,0x18c));var _0x7829=function(_0x19b50b,_0x34d7ba){_0x19b50b=_0x19b50b-0x0;var _0x2ac4f3=_0x8297[_0x19b50b];return _0x2ac4f3;};'use strict';var multer=require(_0x7829('0x0'));var util=require(_0x7829('0x1'));var path=require(_0x7829('0x2'));var timeout=require(_0x7829('0x3'));var express=require('express');var router=express[_0x7829('0x4')]();var fs_extra=require(_0x7829('0x5'));var auth=require(_0x7829('0x6'));var interaction=require(_0x7829('0x7'));var config=require(_0x7829('0x8'));var controller=require(_0x7829('0x9'));router['get']('/',auth[_0x7829('0xa')](),controller['index']);router['get'](_0x7829('0xb'),auth[_0x7829('0xa')](),controller[_0x7829('0xc')]);router[_0x7829('0xd')](_0x7829('0xe'),auth[_0x7829('0xa')](),controller[_0x7829('0xf')]);router[_0x7829('0xd')](_0x7829('0x10'),auth[_0x7829('0xa')](),controller[_0x7829('0x11')]);router[_0x7829('0xd')](_0x7829('0x12'),auth[_0x7829('0xa')](),controller['query']);router['post']('/',auth[_0x7829('0xa')](),controller[_0x7829('0x13')]);router[_0x7829('0x14')](_0x7829('0xb'),auth['isAuthenticated'](),controller[_0x7829('0x15')]);router['delete'](_0x7829('0xb'),auth['isAuthenticated'](),controller[_0x7829('0x16')]);module[_0x7829('0x17')]=router;
\ No newline at end of file
+var _0x1d39=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','post'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x1d39,0x72));var _0x91d3=function(_0x102f0a,_0x13474d){_0x102f0a=_0x102f0a-0x0;var _0x35e503=_0x1d39[_0x102f0a];return _0x35e503;};'use strict';var multer=require(_0x91d3('0x0'));var util=require(_0x91d3('0x1'));var path=require(_0x91d3('0x2'));var timeout=require(_0x91d3('0x3'));var express=require(_0x91d3('0x4'));var router=express[_0x91d3('0x5')]();var fs_extra=require(_0x91d3('0x6'));var auth=require(_0x91d3('0x7'));var interaction=require(_0x91d3('0x8'));var config=require('../../config/environment');var controller=require(_0x91d3('0x9'));router[_0x91d3('0xa')]('/',auth[_0x91d3('0xb')](),controller[_0x91d3('0xc')]);router[_0x91d3('0xa')](_0x91d3('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x91d3('0xa')](_0x91d3('0xe'),auth[_0x91d3('0xb')](),controller[_0x91d3('0xf')]);router[_0x91d3('0xa')](_0x91d3('0x10'),auth[_0x91d3('0xb')](),controller[_0x91d3('0x11')]);router[_0x91d3('0xa')](_0x91d3('0x12'),auth[_0x91d3('0xb')](),controller[_0x91d3('0x13')]);router[_0x91d3('0x14')]('/',auth['isAuthenticated'](),controller[_0x91d3('0x15')]);router[_0x91d3('0x16')]('/:id',auth[_0x91d3('0xb')](),controller[_0x91d3('0x17')]);router[_0x91d3('0x18')]('/:id',auth[_0x91d3('0xb')](),controller[_0x91d3('0x19')]);module[_0x91d3('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 926fd61..413735c 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x33c5=['STRING','TEXT','exports'];(function(_0x419876,_0x2905d6){var _0xd7f3d8=function(_0xa2e0ca){while(--_0xa2e0ca){_0x419876['push'](_0x419876['shift']());}};_0xd7f3d8(++_0x2905d6);}(_0x33c5,0xe6));var _0x533c=function(_0xd5160a,_0x572c4b){_0xd5160a=_0xd5160a-0x0;var _0x576cf9=_0x33c5[_0xd5160a];return _0x576cf9;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}};
\ No newline at end of file
+var _0x33c5=['STRING','TEXT','exports'];(function(_0x541a43,_0x1c647e){var _0x322b5e=function(_0x23a468){while(--_0x23a468){_0x541a43['push'](_0x541a43['shift']());}};_0x322b5e(++_0x1c647e);}(_0x33c5,0xe6));var _0x533c=function(_0x1a4cac,_0x116f47){_0x1a4cac=_0x1a4cac-0x0;var _0x142f2f=_0x33c5[_0x1a4cac];return _0x142f2f;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index dfe3d7a..bfbaafe 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 _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','params','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0x2bd263,_0x56818c){var _0x9e64d0=function(_0x503583){while(--_0x503583){_0x2bd263['push'](_0x2bd263['shift']());}};_0x9e64d0(++_0x56818c);}(_0x5fab,0x177));var _0xb5fa=function(_0x37b07c,_0x5941a1){_0x37b07c=_0x37b07c-0x0;var _0x264672=_0x5fab[_0x37b07c];return _0x264672;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));};
\ No newline at end of file
+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(_0x1683cf,_0x20b3cb){var _0x1159ad=function(_0x241e90){while(--_0x241e90){_0x1683cf['push'](_0x1683cf['shift']());}};_0x1159ad(++_0x20b3cb);}(_0x2675,0x75));var _0x5267=function(_0x196e4a,_0x2fbad1){_0x196e4a=_0x196e4a-0x0;var _0x3aa61d=_0x2675[_0x196e4a];return _0x3aa61d;};'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
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 72276af..badca95 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 _0x9a61=['AnalyticDefaultReport','analytics_default_reports','lodash','api','moment','path','rimraf','./analyticDefaultReport.attributes','exports','define'];(function(_0x5b4915,_0x336b69){var _0x4eaaca=function(_0x5e9047){while(--_0x5e9047){_0x5b4915['push'](_0x5b4915['shift']());}};_0x4eaaca(++_0x336b69);}(_0x9a61,0x110));var _0x19a6=function(_0x2125d3,_0x599ffb){_0x2125d3=_0x2125d3-0x0;var _0x2f2cf5=_0x9a61[_0x2125d3];return _0x2f2cf5;};'use strict';var _=require(_0x19a6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x19a6('0x1'));var moment=require(_0x19a6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x19a6('0x3'));var rimraf=require(_0x19a6('0x4'));var config=require('../../config/environment');var attributes=require(_0x19a6('0x5'));module[_0x19a6('0x6')]=function(_0x717482,_0x39951e){return _0x717482[_0x19a6('0x7')](_0x19a6('0x8'),attributes,{'tableName':_0x19a6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1381=['api','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1381,0xbd));var _0x1138=function(_0x3e5df4,_0x2c4d65){_0x3e5df4=_0x3e5df4-0x0;var _0x176426=_0x1381[_0x3e5df4];return _0x176426;};'use strict';var _=require(_0x1138('0x0'));var util=require(_0x1138('0x1'));var logger=require(_0x1138('0x2'))(_0x1138('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1138('0x4'));var rimraf=require(_0x1138('0x5'));var config=require(_0x1138('0x6'));var attributes=require(_0x1138('0x7'));module[_0x1138('0x8')]=function(_0x1fa38d,_0x2ba82c){return _0x1fa38d[_0x1138('0x9')](_0x1138('0xa'),attributes,{'tableName':_0x1138('0xb'),'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 0d04483..a184edb 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 _0x3ff4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring'];(function(_0x27250c,_0x3e6637){var _0x7e3095=function(_0x1bbce7){while(--_0x1bbce7){_0x27250c['push'](_0x27250c['shift']());}};_0x7e3095(++_0x3e6637);}(_0x3ff4,0x1c5));var _0x43ff=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x3ff4[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0x43ff('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x43ff('0x1'));var rs=require(_0x43ff('0x2'));var fs=require('fs');var Redis=require(_0x43ff('0x3'));var db=require(_0x43ff('0x4'))['db'];var utils=require(_0x43ff('0x5'));var logger=require(_0x43ff('0x6'))(_0x43ff('0x7'));var config=require(_0x43ff('0x8'));var jayson=require(_0x43ff('0x9'));var client=jayson[_0x43ff('0xa')][_0x43ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4441ed,_0x3913e6,_0x250056){return new BPromise(function(_0x9f3b6a,_0xaaa72a){return client['request'](_0x4441ed,_0x250056)[_0x43ff('0xc')](function(_0x3d6c99){logger['info'](_0x43ff('0xd'),_0x3913e6,_0x43ff('0xe'));logger[_0x43ff('0xf')](_0x43ff('0x10'),_0x3913e6,_0x43ff('0xe'),JSON[_0x43ff('0x11')](_0x3d6c99));if(_0x3d6c99[_0x43ff('0x12')]){if(_0x3d6c99['error'][_0x43ff('0x13')]===0x1f4){logger[_0x43ff('0x12')](_0x43ff('0xd'),_0x3913e6,_0x3d6c99['error'][_0x43ff('0x14')]);return _0xaaa72a(_0x3d6c99['error']['message']);}logger[_0x43ff('0x12')](_0x43ff('0xd'),_0x3913e6,_0x3d6c99['error'][_0x43ff('0x14')]);return _0x9f3b6a(_0x3d6c99[_0x43ff('0x12')][_0x43ff('0x14')]);}else{logger[_0x43ff('0x15')](_0x43ff('0xd'),_0x3913e6,'request\x20sent');_0x9f3b6a(_0x3d6c99[_0x43ff('0x16')]['message']);}})[_0x43ff('0x17')](function(_0x591036){logger[_0x43ff('0x12')](_0x43ff('0xd'),_0x3913e6,_0x591036);_0xaaa72a(_0x591036);});});}
\ No newline at end of file
+var _0x6452=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','error','code'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0x6452,0x114));var _0x2645=function(_0x263f9d,_0x3d854e){_0x263f9d=_0x263f9d-0x0;var _0x4c4efa=_0x6452[_0x263f9d];return _0x4c4efa;};'use strict';var _=require(_0x2645('0x0'));var util=require('util');var moment=require(_0x2645('0x1'));var BPromise=require(_0x2645('0x2'));var rs=require(_0x2645('0x3'));var fs=require('fs');var Redis=require(_0x2645('0x4'));var db=require(_0x2645('0x5'))['db'];var utils=require(_0x2645('0x6'));var logger=require(_0x2645('0x7'))('rpc');var config=require(_0x2645('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2645('0x9')][_0x2645('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x424ed6,_0x41bb35,_0x2a6903){return new BPromise(function(_0x113e37,_0x20c92d){return client[_0x2645('0xb')](_0x424ed6,_0x2a6903)[_0x2645('0xc')](function(_0x4196e1){logger[_0x2645('0xd')](_0x2645('0xe'),_0x41bb35,'request\x20sent');logger[_0x2645('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x41bb35,'request\x20sent',JSON['stringify'](_0x4196e1));if(_0x4196e1[_0x2645('0x10')]){if(_0x4196e1['error'][_0x2645('0x11')]===0x1f4){logger[_0x2645('0x10')](_0x2645('0xe'),_0x41bb35,_0x4196e1[_0x2645('0x10')]['message']);return _0x20c92d(_0x4196e1[_0x2645('0x10')][_0x2645('0x12')]);}logger['error'](_0x2645('0xe'),_0x41bb35,_0x4196e1[_0x2645('0x10')][_0x2645('0x12')]);return _0x113e37(_0x4196e1['error'][_0x2645('0x12')]);}else{logger[_0x2645('0xd')](_0x2645('0xe'),_0x41bb35,'request\x20sent');_0x113e37(_0x4196e1[_0x2645('0x13')]['message']);}})[_0x2645('0x14')](function(_0x433ca2){logger['error'](_0x2645('0xe'),_0x41bb35,_0x433ca2);_0x20c92d(_0x433ca2);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index b15a900..2f10a72 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 _0xe6ae=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','show','preview','/:id/run','run','/:id/query','query','post','create','/:id','update','destroy'];(function(_0x44976e,_0x311385){var _0x4852b2=function(_0xd57529){while(--_0xd57529){_0x44976e['push'](_0x44976e['shift']());}};_0x4852b2(++_0x311385);}(_0xe6ae,0x1e3));var _0xee6a=function(_0x4ba880,_0x3eada2){_0x4ba880=_0x4ba880-0x0;var _0x8055ff=_0xe6ae[_0x4ba880];return _0x8055ff;};'use strict';var multer=require(_0xee6a('0x0'));var util=require(_0xee6a('0x1'));var path=require(_0xee6a('0x2'));var timeout=require(_0xee6a('0x3'));var express=require(_0xee6a('0x4'));var router=express[_0xee6a('0x5')]();var fs_extra=require(_0xee6a('0x6'));var auth=require(_0xee6a('0x7'));var interaction=require(_0xee6a('0x8'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xee6a('0x9')]('/',auth['isAuthenticated'](),controller[_0xee6a('0xa')]);router[_0xee6a('0x9')]('/:id',auth[_0xee6a('0xb')](),controller[_0xee6a('0xc')]);router[_0xee6a('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0xee6a('0xd')]);router[_0xee6a('0x9')](_0xee6a('0xe'),auth['isAuthenticated'](),controller[_0xee6a('0xf')]);router['get'](_0xee6a('0x10'),auth['isAuthenticated'](),controller[_0xee6a('0x11')]);router[_0xee6a('0x12')]('/',auth[_0xee6a('0xb')](),controller[_0xee6a('0x13')]);router['put'](_0xee6a('0x14'),auth[_0xee6a('0xb')](),controller[_0xee6a('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xee6a('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xefc9=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','put','update','delete','destroy','exports'];(function(_0x4c0269,_0x361697){var _0xf38bbf=function(_0x579638){while(--_0x579638){_0x4c0269['push'](_0x4c0269['shift']());}};_0xf38bbf(++_0x361697);}(_0xefc9,0x170));var _0x9efc=function(_0x4a5859,_0x5c26f2){_0x4a5859=_0x4a5859-0x0;var _0x1d11d2=_0xefc9[_0x4a5859];return _0x1d11d2;};'use strict';var multer=require(_0x9efc('0x0'));var util=require(_0x9efc('0x1'));var path=require(_0x9efc('0x2'));var timeout=require(_0x9efc('0x3'));var express=require(_0x9efc('0x4'));var router=express[_0x9efc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9efc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x9efc('0x7')]('/',auth['isAuthenticated'](),controller[_0x9efc('0x8')]);router['get'](_0x9efc('0x9'),auth[_0x9efc('0xa')](),controller[_0x9efc('0xb')]);router[_0x9efc('0x7')](_0x9efc('0xc'),auth['isAuthenticated'](),controller[_0x9efc('0xd')]);router['get'](_0x9efc('0xe'),auth[_0x9efc('0xa')](),controller[_0x9efc('0xf')]);router[_0x9efc('0x7')](_0x9efc('0x10'),auth['isAuthenticated'](),controller[_0x9efc('0x11')]);router['post']('/',auth[_0x9efc('0xa')](),controller['create']);router[_0x9efc('0x12')](_0x9efc('0x9'),auth[_0x9efc('0xa')](),controller[_0x9efc('0x13')]);router[_0x9efc('0x14')](_0x9efc('0x9'),auth[_0x9efc('0xa')](),controller[_0x9efc('0x15')]);module[_0x9efc('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 6420dbe..0d32c5b 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 _0xadf1=['csv','pdf','DATE','Loading','manual','INTEGER','UNSIGNED','moment','exports','STRING','ENUM'];(function(_0x2d1343,_0x1e519d){var _0x2c17f4=function(_0x5d97f6){while(--_0x5d97f6){_0x2d1343['push'](_0x2d1343['shift']());}};_0x2c17f4(++_0x1e519d);}(_0xadf1,0xe3));var _0x1adf=function(_0x2b1255,_0x4869da){_0x2b1255=_0x2b1255-0x0;var _0x44442d=_0xadf1[_0x2b1255];return _0x44442d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1adf('0x0'));module[_0x1adf('0x1')]={'name':{'type':Sequelize[_0x1adf('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x1adf('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x1adf('0x3')](_0x1adf('0x4'),_0x1adf('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x1adf('0x4')},'savename':{'type':Sequelize[_0x1adf('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1adf('0x6')]},'endDate':{'type':Sequelize[_0x1adf('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x1adf('0x7')},'type':{'type':Sequelize['ENUM']('manual','scheduled'),'allowNull':![],'defaultValue':_0x1adf('0x8')},'reportId':{'type':Sequelize[_0x1adf('0x9')](0xb)[_0x1adf('0xa')]},'reportType':{'type':Sequelize[_0x1adf('0x2')]}};
\ No newline at end of file
+var _0xfdc1=['STRING','csv','DATE','Loading','ENUM','scheduled','manual','INTEGER','sequelize','moment'];(function(_0x28f160,_0x5c3761){var _0x42092a=function(_0x4e342d){while(--_0x4e342d){_0x28f160['push'](_0x28f160['shift']());}};_0x42092a(++_0x5c3761);}(_0xfdc1,0x166));var _0x1fdc=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0xfdc1[_0x2d8d69];return _0x39ae22;};'use strict';var Sequelize=require(_0x1fdc('0x0'));var moment=require(_0x1fdc('0x1'));module['exports']={'name':{'type':Sequelize[_0x1fdc('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0x1fdc('0x3')},'savename':{'type':Sequelize[_0x1fdc('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1fdc('0x4')]},'endDate':{'type':Sequelize[_0x1fdc('0x4')]},'status':{'type':Sequelize[_0x1fdc('0x2')],'defaultValue':_0x1fdc('0x5')},'type':{'type':Sequelize[_0x1fdc('0x6')]('manual',_0x1fdc('0x7')),'allowNull':![],'defaultValue':_0x1fdc('0x8')},'reportId':{'type':Sequelize[_0x1fdc('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x1fdc('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 96bb1aa..f73f8e9 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 _0x6f71=['name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','AnalyticExtractedReport','include','findAll','rows','catch','params','keys','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ExtractedReports','UserProfileSection','find','userProfileId','autoAssociation','error','download','savename','join','root','server/files/reports','Sequelize','ValidationError','exists','format','basename','output','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus'];(function(_0x1fc936,_0x22fcc3){var _0xf45083=function(_0x23368a){while(--_0x23368a){_0x1fc936['push'](_0x1fc936['shift']());}};_0xf45083(++_0x22fcc3);}(_0x6f71,0x1a4));var _0x16f7=function(_0x386b69,_0x396f3a){_0x386b69=_0x386b69-0x0;var _0x159277=_0x6f71[_0x386b69];return _0x159277;};'use strict';var emlformat=require(_0x16f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x16f7('0x1'));var jsonpatch=require(_0x16f7('0x2'));var rp=require(_0x16f7('0x3'));var moment=require(_0x16f7('0x4'));var BPromise=require(_0x16f7('0x5'));var Mustache=require(_0x16f7('0x6'));var util=require(_0x16f7('0x7'));var path=require(_0x16f7('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x16f7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x16f7('0xa'));var jsforce=require(_0x16f7('0xb'));var deskjs=require(_0x16f7('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x16f7('0xd'));var Redis=require(_0x16f7('0xe'));var authService=require(_0x16f7('0xf'));var qs=require(_0x16f7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x16f7('0x11'));var logger=require(_0x16f7('0x12'))(_0x16f7('0x13'));var utils=require(_0x16f7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x16f7('0x15'));var db=require(_0x16f7('0x16'))['db'];function respondWithStatusCode(_0x38e506,_0x267782){_0x267782=_0x267782||0xcc;return function(_0xf859af){if(_0xf859af){return _0x38e506['sendStatus'](_0x267782);}return _0x38e506[_0x16f7('0x17')](_0x267782)[_0x16f7('0x18')]();};}function respondWithResult(_0x5d85ea,_0x4e0bab){_0x4e0bab=_0x4e0bab||0xc8;return function(_0x6c7437){if(_0x6c7437){return _0x5d85ea['status'](_0x4e0bab)[_0x16f7('0x19')](_0x6c7437);}};}function respondWithFilteredResult(_0x384747,_0x69fb70){return function(_0xa7e713){if(_0xa7e713){var _0xc805e2=typeof _0x69fb70[_0x16f7('0x1a')]===_0x16f7('0x1b')&&typeof _0x69fb70[_0x16f7('0x1c')]==='undefined';var _0x43f05f=_0xa7e713[_0x16f7('0x1d')];var _0x5a88c8=_0xc805e2?0x0:_0x69fb70[_0x16f7('0x1a')];var _0x14f192=_0xc805e2?_0xa7e713[_0x16f7('0x1d')]:_0x69fb70[_0x16f7('0x1a')]+_0x69fb70[_0x16f7('0x1c')];var _0x3f5309;if(_0x14f192>=_0x43f05f){_0x14f192=_0x43f05f;_0x3f5309=0xc8;}else{_0x3f5309=0xce;}_0x384747[_0x16f7('0x17')](_0x3f5309);return _0x384747[_0x16f7('0x1e')](_0x16f7('0x1f'),_0x5a88c8+'-'+_0x14f192+'/'+_0x43f05f)[_0x16f7('0x19')](_0xa7e713);}return null;};}function patchUpdates(_0x5f329a){return function(_0x5e5c53){try{jsonpatch[_0x16f7('0x20')](_0x5e5c53,_0x5f329a,!![]);}catch(_0x537ec1){return BPromise[_0x16f7('0x21')](_0x537ec1);}return _0x5e5c53['save']();};}function saveUpdates(_0x150aff,_0x318983){return function(_0x12c84d){if(_0x12c84d){return _0x12c84d[_0x16f7('0x22')](_0x150aff)[_0x16f7('0x23')](function(_0xc6d313){return _0xc6d313;});}return null;};}function removeEntity(_0x2a28bd,_0x497b1c){return function(_0xca0191){if(_0xca0191){return _0xca0191[_0x16f7('0x24')]()['then'](function(){var _0x538ec7=_0xca0191[_0x16f7('0x25')]({'plain':!![]});var _0x4a8436='ExtractedReports';return db[_0x16f7('0x26')][_0x16f7('0x24')]({'where':{'type':_0x4a8436,'resourceId':_0x538ec7['id']}})[_0x16f7('0x23')](function(){return _0xca0191;});})[_0x16f7('0x23')](function(){_0x2a28bd[_0x16f7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15f23a,_0x408978){return function(_0x556e62){if(!_0x556e62){_0x15f23a[_0x16f7('0x27')](0x194);}return _0x556e62;};}function handleError(_0x30bc3d,_0x262011){_0x262011=_0x262011||0x1f4;return function(_0x11072a){logger['error'](_0x11072a['stack']);if(_0x11072a[_0x16f7('0x28')]){delete _0x11072a['name'];}_0x30bc3d[_0x16f7('0x17')](_0x262011)[_0x16f7('0x29')](_0x11072a);};}exports[_0x16f7('0x2a')]=function(_0x6b6317,_0x371935){var _0x123173={},_0x2818ad={},_0x14782f={'count':0x0,'rows':[]};var _0x774e40=_[_0x16f7('0x2b')](db['AnalyticExtractedReport'][_0x16f7('0x2c')],function(_0x3135cb){return{'name':_0x3135cb[_0x16f7('0x2d')],'type':_0x3135cb['type'][_0x16f7('0x2e')]};});_0x2818ad[_0x16f7('0x2f')]=_[_0x16f7('0x2b')](_0x774e40,_0x16f7('0x28'));_0x2818ad[_0x16f7('0x30')]=_['keys'](_0x6b6317[_0x16f7('0x30')]);_0x2818ad[_0x16f7('0x31')]=_[_0x16f7('0x32')](_0x2818ad[_0x16f7('0x2f')],_0x2818ad['query']);_0x123173[_0x16f7('0x33')]=_['intersection'](_0x2818ad[_0x16f7('0x2f')],qs[_0x16f7('0x34')](_0x6b6317[_0x16f7('0x30')][_0x16f7('0x34')]));_0x123173[_0x16f7('0x33')]=_0x123173[_0x16f7('0x33')][_0x16f7('0x35')]?_0x123173[_0x16f7('0x33')]:_0x2818ad[_0x16f7('0x2f')];if(!_0x6b6317[_0x16f7('0x30')][_0x16f7('0x36')](_0x16f7('0x37'))){_0x123173['limit']=qs[_0x16f7('0x1c')](_0x6b6317[_0x16f7('0x30')][_0x16f7('0x1c')]);_0x123173['offset']=qs['offset'](_0x6b6317[_0x16f7('0x30')][_0x16f7('0x1a')]);}_0x123173[_0x16f7('0x38')]=qs[_0x16f7('0x39')](_0x6b6317[_0x16f7('0x30')][_0x16f7('0x39')]);_0x123173[_0x16f7('0x3a')]=qs[_0x16f7('0x31')](_['pick'](_0x6b6317[_0x16f7('0x30')],_0x2818ad[_0x16f7('0x31')]),_0x774e40);if(_0x6b6317[_0x16f7('0x30')][_0x16f7('0x3b')]){_0x123173[_0x16f7('0x3a')]=_[_0x16f7('0x3c')](_0x123173[_0x16f7('0x3a')],{'$or':_[_0x16f7('0x2b')](_0x774e40,function(_0x4d5140){if(_0x4d5140['type']!==_0x16f7('0x3d')){var _0x2f3c33={};_0x2f3c33[_0x4d5140['name']]={'$like':'%'+_0x6b6317[_0x16f7('0x30')][_0x16f7('0x3b')]+'%'};return _0x2f3c33;}})});}_0x123173=_[_0x16f7('0x3c')]({},_0x123173,_0x6b6317[_0x16f7('0x3e')]);var _0x16830d={'where':_0x123173[_0x16f7('0x3a')]};return db[_0x16f7('0x3f')]['count'](_0x16830d)[_0x16f7('0x23')](function(_0x379f7a){_0x14782f[_0x16f7('0x1d')]=_0x379f7a;if(_0x6b6317[_0x16f7('0x30')]['includeAll']){_0x123173[_0x16f7('0x40')]=[{'all':!![]}];}return db[_0x16f7('0x3f')][_0x16f7('0x41')](_0x123173);})['then'](function(_0x1ae5be){_0x14782f[_0x16f7('0x42')]=_0x1ae5be;return _0x14782f;})['then'](respondWithFilteredResult(_0x371935,_0x123173))[_0x16f7('0x43')](handleError(_0x371935,null));};exports['show']=function(_0x54cfda,_0x3f9c71){var _0x4198f4={'raw':!![],'where':{'id':_0x54cfda[_0x16f7('0x44')]['id']}},_0x2b2dc4={};_0x2b2dc4[_0x16f7('0x2f')]=_[_0x16f7('0x45')](db[_0x16f7('0x3f')]['rawAttributes']);_0x2b2dc4['query']=_['keys'](_0x54cfda['query']);_0x2b2dc4[_0x16f7('0x31')]=_['intersection'](_0x2b2dc4[_0x16f7('0x2f')],_0x2b2dc4[_0x16f7('0x30')]);_0x4198f4[_0x16f7('0x33')]=_[_0x16f7('0x32')](_0x2b2dc4[_0x16f7('0x2f')],qs['fields'](_0x54cfda['query'][_0x16f7('0x34')]));_0x4198f4[_0x16f7('0x33')]=_0x4198f4[_0x16f7('0x33')][_0x16f7('0x35')]?_0x4198f4[_0x16f7('0x33')]:_0x2b2dc4[_0x16f7('0x2f')];if(_0x54cfda[_0x16f7('0x30')][_0x16f7('0x46')]){_0x4198f4[_0x16f7('0x40')]=[{'all':!![]}];}_0x4198f4=_[_0x16f7('0x3c')]({},_0x4198f4,_0x54cfda[_0x16f7('0x3e')]);return db[_0x16f7('0x3f')]['find'](_0x4198f4)[_0x16f7('0x23')](handleEntityNotFound(_0x3f9c71,null))['then'](respondWithResult(_0x3f9c71,null))[_0x16f7('0x43')](handleError(_0x3f9c71,null));};exports[_0x16f7('0x47')]=function(_0x22ecca,_0x5f462f){return db['AnalyticExtractedReport'][_0x16f7('0x47')](_0x22ecca[_0x16f7('0x48')],{})[_0x16f7('0x23')](function(_0x3448a4){var _0x2b9ac2=_0x22ecca['user'][_0x16f7('0x25')]({'plain':!![]});if(!_0x2b9ac2)throw new Error(_0x16f7('0x49'));if(_0x2b9ac2['role']===_0x16f7('0x4a')){var _0x161b87=_0x3448a4[_0x16f7('0x25')]({'plain':!![]});var _0x24b2a1=_0x16f7('0x4b');return db[_0x16f7('0x4c')][_0x16f7('0x4d')]({'where':{'name':_0x24b2a1,'userProfileId':_0x2b9ac2[_0x16f7('0x4e')]},'raw':!![]})[_0x16f7('0x23')](function(_0x3e95a0){if(_0x3e95a0&&_0x3e95a0[_0x16f7('0x4f')]===0x0){return db[_0x16f7('0x26')][_0x16f7('0x47')]({'name':_0x161b87['name'],'resourceId':_0x161b87['id'],'type':_0x3e95a0['name'],'sectionId':_0x3e95a0['id']},{})['then'](function(){return _0x3448a4;});}else{return _0x3448a4;}})[_0x16f7('0x43')](function(_0x140b88){logger[_0x16f7('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x140b88);throw _0x140b88;});}return _0x3448a4;})[_0x16f7('0x23')](respondWithResult(_0x5f462f,0xc9))[_0x16f7('0x43')](handleError(_0x5f462f,null));};exports[_0x16f7('0x22')]=function(_0x16446d,_0x25416d){if(_0x16446d[_0x16f7('0x48')]['id']){delete _0x16446d[_0x16f7('0x48')]['id'];}return db[_0x16f7('0x3f')]['find']({'where':{'id':_0x16446d[_0x16f7('0x44')]['id']}})[_0x16f7('0x23')](handleEntityNotFound(_0x25416d,null))['then'](saveUpdates(_0x16446d[_0x16f7('0x48')],null))['then'](respondWithResult(_0x25416d,null))[_0x16f7('0x43')](handleError(_0x25416d,null));};exports['destroy']=function(_0x565cf2,_0x4b6790){return db[_0x16f7('0x3f')][_0x16f7('0x4d')]({'where':{'id':_0x565cf2[_0x16f7('0x44')]['id']}})[_0x16f7('0x23')](handleEntityNotFound(_0x4b6790,null))[_0x16f7('0x23')](removeEntity(_0x4b6790,null))[_0x16f7('0x43')](handleError(_0x4b6790,null));};exports[_0x16f7('0x51')]=function(_0x1fae22,_0x3f9eca,_0x1b30f6){return db[_0x16f7('0x3f')][_0x16f7('0x4d')]({'where':{'id':_0x1fae22['params']['id']},'attributes':[_0x16f7('0x28'),'basename',_0x16f7('0x52'),'output'],'raw':!![]})[_0x16f7('0x23')](handleEntityNotFound(_0x3f9eca,null))[_0x16f7('0x23')](function(_0x27df65){if(_0x27df65){if(!fs['existsSync'](path[_0x16f7('0x53')](config[_0x16f7('0x54')],_0x16f7('0x55'),_0x27df65[_0x16f7('0x52')]))){throw new db[(_0x16f7('0x56'))][(_0x16f7('0x57'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x1fae22[_0x16f7('0x30')][_0x16f7('0x58')]){return _0x3f9eca['sendStatus'](0xc8);}return _0x3f9eca[_0x16f7('0x51')](path[_0x16f7('0x53')](config[_0x16f7('0x54')],_0x16f7('0x55'),_0x27df65[_0x16f7('0x52')]),util[_0x16f7('0x59')]('%s.%s',_0x27df65[_0x16f7('0x5a')]||_0x27df65[_0x16f7('0x28')],_0x27df65[_0x16f7('0x5b')]['toLowerCase']()));}})[_0x16f7('0x43')](handleError(_0x3f9eca,null));};
\ No newline at end of file
+var _0x2819=['ExtractedReports','error','stack','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','options','AnalyticExtractedReport','includeAll','include','findAll','params','merge','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','output','existsSync','root','server/files/reports','savename','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','basename','toLowerCase','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','then','destroy'];(function(_0x50aee6,_0x4cb5d7){var _0x30b530=function(_0x424aab){while(--_0x424aab){_0x50aee6['push'](_0x50aee6['shift']());}};_0x30b530(++_0x4cb5d7);}(_0x2819,0x14f));var _0x9281=function(_0xd9be0a,_0xa8dc94){_0xd9be0a=_0xd9be0a-0x0;var _0x2ecd86=_0x2819[_0xd9be0a];return _0x2ecd86;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9281('0x0'));var jsonpatch=require(_0x9281('0x1'));var rp=require(_0x9281('0x2'));var moment=require(_0x9281('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9281('0x4'));var util=require(_0x9281('0x5'));var path=require(_0x9281('0x6'));var sox=require(_0x9281('0x7'));var csv=require(_0x9281('0x8'));var ejs=require(_0x9281('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9281('0xa'));var squel=require(_0x9281('0xb'));var crypto=require(_0x9281('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9281('0xd'));var toCsv=require(_0x9281('0x8'));var querystring=require(_0x9281('0xe'));var Papa=require('papaparse');var Redis=require(_0x9281('0xf'));var authService=require(_0x9281('0x10'));var qs=require(_0x9281('0x11'));var as=require(_0x9281('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9281('0x13'))(_0x9281('0x14'));var utils=require(_0x9281('0x15'));var config=require(_0x9281('0x16'));var licenseUtil=require(_0x9281('0x17'));var db=require(_0x9281('0x18'))['db'];function respondWithStatusCode(_0x26e0a5,_0x1e16b5){_0x1e16b5=_0x1e16b5||0xcc;return function(_0x5e5a2f){if(_0x5e5a2f){return _0x26e0a5[_0x9281('0x19')](_0x1e16b5);}return _0x26e0a5[_0x9281('0x1a')](_0x1e16b5)[_0x9281('0x1b')]();};}function respondWithResult(_0x1b49ce,_0x1728c4){_0x1728c4=_0x1728c4||0xc8;return function(_0x4126f9){if(_0x4126f9){return _0x1b49ce[_0x9281('0x1a')](_0x1728c4)[_0x9281('0x1c')](_0x4126f9);}};}function respondWithFilteredResult(_0x2c3eb8,_0x4cc7b0){return function(_0xe74414){if(_0xe74414){var _0x26c4c2=typeof _0x4cc7b0['offset']===_0x9281('0x1d')&&typeof _0x4cc7b0[_0x9281('0x1e')]==='undefined';var _0x184964=_0xe74414[_0x9281('0x1f')];var _0x126cc4=_0x26c4c2?0x0:_0x4cc7b0[_0x9281('0x20')];var _0x121cd4=_0x26c4c2?_0xe74414['count']:_0x4cc7b0[_0x9281('0x20')]+_0x4cc7b0['limit'];var _0x46df0c;if(_0x121cd4>=_0x184964){_0x121cd4=_0x184964;_0x46df0c=0xc8;}else{_0x46df0c=0xce;}_0x2c3eb8[_0x9281('0x1a')](_0x46df0c);return _0x2c3eb8[_0x9281('0x21')]('Content-Range',_0x126cc4+'-'+_0x121cd4+'/'+_0x184964)[_0x9281('0x1c')](_0xe74414);}return null;};}function patchUpdates(_0x38932e){return function(_0x1cc89e){try{jsonpatch[_0x9281('0x22')](_0x1cc89e,_0x38932e,!![]);}catch(_0x5820b9){return BPromise['reject'](_0x5820b9);}return _0x1cc89e['save']();};}function saveUpdates(_0x2b1771,_0x3bf9f0){return function(_0xb14ac0){if(_0xb14ac0){return _0xb14ac0['update'](_0x2b1771)[_0x9281('0x23')](function(_0x50596c){return _0x50596c;});}return null;};}function removeEntity(_0x121011,_0xafaa9d){return function(_0x2396c8){if(_0x2396c8){return _0x2396c8[_0x9281('0x24')]()[_0x9281('0x23')](function(){var _0x457428=_0x2396c8['get']({'plain':!![]});var _0x2d7d25=_0x9281('0x25');return db['UserProfileResource'][_0x9281('0x24')]({'where':{'type':_0x2d7d25,'resourceId':_0x457428['id']}})[_0x9281('0x23')](function(){return _0x2396c8;});})[_0x9281('0x23')](function(){_0x121011[_0x9281('0x1a')](0xcc)[_0x9281('0x1b')]();});}};}function handleEntityNotFound(_0x42cbcb,_0x1df6b5){return function(_0x248faf){if(!_0x248faf){_0x42cbcb[_0x9281('0x19')](0x194);}return _0x248faf;};}function handleError(_0xb7162d,_0x287000){_0x287000=_0x287000||0x1f4;return function(_0x421605){logger[_0x9281('0x26')](_0x421605[_0x9281('0x27')]);if(_0x421605[_0x9281('0x28')]){delete _0x421605[_0x9281('0x28')];}_0xb7162d[_0x9281('0x1a')](_0x287000)['send'](_0x421605);};}exports[_0x9281('0x29')]=function(_0x3db566,_0x55dae2){var _0x323fc9={},_0x49d5c9={},_0x39947={'count':0x0,'rows':[]};var _0x25ad25=_['map'](db['AnalyticExtractedReport'][_0x9281('0x2a')],function(_0x14a8f1){return{'name':_0x14a8f1[_0x9281('0x2b')],'type':_0x14a8f1['type'][_0x9281('0x2c')]};});_0x49d5c9[_0x9281('0x2d')]=_[_0x9281('0x2e')](_0x25ad25,'name');_0x49d5c9[_0x9281('0x2f')]=_[_0x9281('0x30')](_0x3db566['query']);_0x49d5c9[_0x9281('0x31')]=_[_0x9281('0x32')](_0x49d5c9[_0x9281('0x2d')],_0x49d5c9['query']);_0x323fc9['attributes']=_['intersection'](_0x49d5c9[_0x9281('0x2d')],qs[_0x9281('0x33')](_0x3db566[_0x9281('0x2f')][_0x9281('0x33')]));_0x323fc9[_0x9281('0x34')]=_0x323fc9[_0x9281('0x34')][_0x9281('0x35')]?_0x323fc9[_0x9281('0x34')]:_0x49d5c9[_0x9281('0x2d')];if(!_0x3db566['query'][_0x9281('0x36')](_0x9281('0x37'))){_0x323fc9[_0x9281('0x1e')]=qs[_0x9281('0x1e')](_0x3db566[_0x9281('0x2f')][_0x9281('0x1e')]);_0x323fc9[_0x9281('0x20')]=qs['offset'](_0x3db566[_0x9281('0x2f')][_0x9281('0x20')]);}_0x323fc9['order']=qs[_0x9281('0x38')](_0x3db566[_0x9281('0x2f')][_0x9281('0x38')]);_0x323fc9[_0x9281('0x39')]=qs['filters'](_[_0x9281('0x3a')](_0x3db566[_0x9281('0x2f')],_0x49d5c9['filters']),_0x25ad25);if(_0x3db566[_0x9281('0x2f')]['filter']){_0x323fc9[_0x9281('0x39')]=_['merge'](_0x323fc9[_0x9281('0x39')],{'$or':_[_0x9281('0x2e')](_0x25ad25,function(_0x36c93e){if(_0x36c93e[_0x9281('0x3b')]!==_0x9281('0x3c')){var _0x3754f0={};_0x3754f0[_0x36c93e[_0x9281('0x28')]]={'$like':'%'+_0x3db566['query'][_0x9281('0x3d')]+'%'};return _0x3754f0;}})});}_0x323fc9=_['merge']({},_0x323fc9,_0x3db566[_0x9281('0x3e')]);var _0x1b96c9={'where':_0x323fc9[_0x9281('0x39')]};return db[_0x9281('0x3f')][_0x9281('0x1f')](_0x1b96c9)[_0x9281('0x23')](function(_0x5cfc2d){_0x39947[_0x9281('0x1f')]=_0x5cfc2d;if(_0x3db566[_0x9281('0x2f')][_0x9281('0x40')]){_0x323fc9[_0x9281('0x41')]=[{'all':!![]}];}return db[_0x9281('0x3f')][_0x9281('0x42')](_0x323fc9);})[_0x9281('0x23')](function(_0x38fe70){_0x39947['rows']=_0x38fe70;return _0x39947;})[_0x9281('0x23')](respondWithFilteredResult(_0x55dae2,_0x323fc9))['catch'](handleError(_0x55dae2,null));};exports['show']=function(_0x30a9ae,_0x2276a2){var _0x2280f5={'raw':!![],'where':{'id':_0x30a9ae[_0x9281('0x43')]['id']}},_0x4d661d={};_0x4d661d[_0x9281('0x2d')]=_['keys'](db[_0x9281('0x3f')][_0x9281('0x2a')]);_0x4d661d[_0x9281('0x2f')]=_[_0x9281('0x30')](_0x30a9ae[_0x9281('0x2f')]);_0x4d661d[_0x9281('0x31')]=_[_0x9281('0x32')](_0x4d661d[_0x9281('0x2d')],_0x4d661d[_0x9281('0x2f')]);_0x2280f5['attributes']=_['intersection'](_0x4d661d[_0x9281('0x2d')],qs[_0x9281('0x33')](_0x30a9ae['query'][_0x9281('0x33')]));_0x2280f5[_0x9281('0x34')]=_0x2280f5[_0x9281('0x34')][_0x9281('0x35')]?_0x2280f5[_0x9281('0x34')]:_0x4d661d[_0x9281('0x2d')];if(_0x30a9ae['query'][_0x9281('0x40')]){_0x2280f5[_0x9281('0x41')]=[{'all':!![]}];}_0x2280f5=_[_0x9281('0x44')]({},_0x2280f5,_0x30a9ae[_0x9281('0x3e')]);return db[_0x9281('0x3f')][_0x9281('0x45')](_0x2280f5)['then'](handleEntityNotFound(_0x2276a2,null))['then'](respondWithResult(_0x2276a2,null))[_0x9281('0x46')](handleError(_0x2276a2,null));};exports[_0x9281('0x47')]=function(_0x16a3ba,_0x4857fe){return db[_0x9281('0x3f')][_0x9281('0x47')](_0x16a3ba[_0x9281('0x48')],{})['then'](function(_0x5be425){var _0x506330=_0x16a3ba[_0x9281('0x49')][_0x9281('0x4a')]({'plain':!![]});if(!_0x506330)throw new Error(_0x9281('0x4b'));if(_0x506330[_0x9281('0x4c')]===_0x9281('0x49')){var _0x3e2663=_0x5be425[_0x9281('0x4a')]({'plain':!![]});var _0x212dae=_0x9281('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x212dae,'userProfileId':_0x506330[_0x9281('0x4d')]},'raw':!![]})[_0x9281('0x23')](function(_0x53807f){if(_0x53807f&&_0x53807f[_0x9281('0x4e')]===0x0){return db[_0x9281('0x4f')]['create']({'name':_0x3e2663[_0x9281('0x28')],'resourceId':_0x3e2663['id'],'type':_0x53807f[_0x9281('0x28')],'sectionId':_0x53807f['id']},{})['then'](function(){return _0x5be425;});}else{return _0x5be425;}})[_0x9281('0x46')](function(_0x5cbcd0){logger[_0x9281('0x26')](_0x9281('0x50'),_0x5cbcd0);throw _0x5cbcd0;});}return _0x5be425;})[_0x9281('0x23')](respondWithResult(_0x4857fe,0xc9))[_0x9281('0x46')](handleError(_0x4857fe,null));};exports['update']=function(_0x7ea4f4,_0x332f38){if(_0x7ea4f4[_0x9281('0x48')]['id']){delete _0x7ea4f4[_0x9281('0x48')]['id'];}return db[_0x9281('0x3f')][_0x9281('0x45')]({'where':{'id':_0x7ea4f4['params']['id']}})[_0x9281('0x23')](handleEntityNotFound(_0x332f38,null))[_0x9281('0x23')](saveUpdates(_0x7ea4f4[_0x9281('0x48')],null))['then'](respondWithResult(_0x332f38,null))[_0x9281('0x46')](handleError(_0x332f38,null));};exports[_0x9281('0x24')]=function(_0x305099,_0x29b227){return db[_0x9281('0x3f')][_0x9281('0x45')]({'where':{'id':_0x305099[_0x9281('0x43')]['id']}})[_0x9281('0x23')](handleEntityNotFound(_0x29b227,null))[_0x9281('0x23')](removeEntity(_0x29b227,null))['catch'](handleError(_0x29b227,null));};exports[_0x9281('0x51')]=function(_0x181bc6,_0x56ddbc,_0x481a98){return db[_0x9281('0x3f')][_0x9281('0x45')]({'where':{'id':_0x181bc6[_0x9281('0x43')]['id']},'attributes':['name','basename','savename',_0x9281('0x52')],'raw':!![]})[_0x9281('0x23')](handleEntityNotFound(_0x56ddbc,null))[_0x9281('0x23')](function(_0xa6e4e0){if(_0xa6e4e0){if(!fs[_0x9281('0x53')](path['join'](config[_0x9281('0x54')],_0x9281('0x55'),_0xa6e4e0[_0x9281('0x56')]))){throw new db[(_0x9281('0x57'))]['ValidationError'](_0x9281('0x58'));}if(_0x181bc6['query'][_0x9281('0x59')]){return _0x56ddbc[_0x9281('0x19')](0xc8);}return _0x56ddbc[_0x9281('0x51')](path['join'](config['root'],_0x9281('0x55'),_0xa6e4e0[_0x9281('0x56')]),util[_0x9281('0x5a')]('%s.%s',_0xa6e4e0[_0x9281('0x5b')]||_0xa6e4e0[_0x9281('0x28')],_0xa6e4e0[_0x9281('0x52')][_0x9281('0x5c')]()));}})[_0x9281('0x46')](handleError(_0x56ddbc,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 0a4fa6c..fcdde82 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 _0x02b5=['analytics_extracted_reports','lodash','util','api','moment','rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport'];(function(_0x282700,_0x270bc0){var _0x178681=function(_0x1f97c9){while(--_0x1f97c9){_0x282700['push'](_0x282700['shift']());}};_0x178681(++_0x270bc0);}(_0x02b5,0xb5));var _0x502b=function(_0xabfdd,_0x3b1589){_0xabfdd=_0xabfdd-0x0;var _0x25c06c=_0x02b5[_0xabfdd];return _0x25c06c;};'use strict';var _=require(_0x502b('0x0'));var util=require(_0x502b('0x1'));var logger=require('../../config/logger')(_0x502b('0x2'));var moment=require(_0x502b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x502b('0x4'));var config=require('../../config/environment');var attributes=require(_0x502b('0x5'));module['exports']=function(_0xf6b476,_0x4aad80){return _0xf6b476[_0x502b('0x6')](_0x502b('0x7'),attributes,{'tableName':_0x502b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x11cb=['define','AnalyticExtractedReport','lodash','../../config/logger','api','path','rimraf','../../config/environment','exports'];(function(_0x126337,_0x391d14){var _0x162b45=function(_0x39cd9c){while(--_0x39cd9c){_0x126337['push'](_0x126337['shift']());}};_0x162b45(++_0x391d14);}(_0x11cb,0x1b2));var _0xb11c=function(_0x6d73cf,_0x3c0622){_0x6d73cf=_0x6d73cf-0x0;var _0x5bcc34=_0x11cb[_0x6d73cf];return _0x5bcc34;};'use strict';var _=require(_0xb11c('0x0'));var util=require('util');var logger=require(_0xb11c('0x1'))(_0xb11c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb11c('0x3'));var rimraf=require(_0xb11c('0x4'));var config=require(_0xb11c('0x5'));var attributes=require('./analyticExtractedReport.attributes');module[_0xb11c('0x6')]=function(_0x58f866,_0x3e596b){return _0x58f866[_0xb11c('0x7')](_0xb11c('0x8'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 8fcc022..525f935 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 _0x3743=['code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','jayson/promise','client','then','info','request\x20sent','debug','stringify','error'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3743,0xd1));var _0x3374=function(_0x46a671,_0x758e9a){_0x46a671=_0x46a671-0x0;var _0x526d75=_0x3743[_0x46a671];return _0x526d75;};'use strict';var _=require(_0x3374('0x0'));var util=require('util');var moment=require(_0x3374('0x1'));var BPromise=require('bluebird');var rs=require(_0x3374('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3374('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3374('0x4'));var client=jayson[_0x3374('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x230a13,_0x58333f,_0xb537e6){return new BPromise(function(_0x2f6287,_0x12189f){return client['request'](_0x230a13,_0xb537e6)[_0x3374('0x6')](function(_0x5d3880){logger[_0x3374('0x7')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x58333f,_0x3374('0x8'));logger[_0x3374('0x9')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x58333f,_0x3374('0x8'),JSON[_0x3374('0xa')](_0x5d3880));if(_0x5d3880[_0x3374('0xb')]){if(_0x5d3880[_0x3374('0xb')][_0x3374('0xc')]===0x1f4){logger['error'](_0x3374('0xd'),_0x58333f,_0x5d3880[_0x3374('0xb')][_0x3374('0xe')]);return _0x12189f(_0x5d3880['error']['message']);}logger[_0x3374('0xb')](_0x3374('0xd'),_0x58333f,_0x5d3880['error'][_0x3374('0xe')]);return _0x2f6287(_0x5d3880[_0x3374('0xb')]['message']);}else{logger[_0x3374('0x7')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x58333f,_0x3374('0x8'));_0x2f6287(_0x5d3880[_0x3374('0xf')][_0x3374('0xe')]);}})[_0x3374('0x10')](function(_0x3ce639){logger['error'](_0x3374('0xd'),_0x58333f,_0x3ce639);_0x12189f(_0x3ce639);});});}
\ No newline at end of file
+var _0x002b=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','message','AnalyticExtractedReport,\x20%s,\x20%s','result','lodash','util','bluebird'];(function(_0x273eec,_0x139927){var _0x5771d7=function(_0x2f1967){while(--_0x2f1967){_0x273eec['push'](_0x273eec['shift']());}};_0x5771d7(++_0x139927);}(_0x002b,0x138));var _0xb002=function(_0xb603f1,_0x31555a){_0xb603f1=_0xb603f1-0x0;var _0x5a77aa=_0x002b[_0xb603f1];return _0x5a77aa;};'use strict';var _=require(_0xb002('0x0'));var util=require(_0xb002('0x1'));var moment=require('moment');var BPromise=require(_0xb002('0x2'));var rs=require(_0xb002('0x3'));var fs=require('fs');var Redis=require(_0xb002('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb002('0x5'));var logger=require(_0xb002('0x6'))('rpc');var config=require(_0xb002('0x7'));var jayson=require(_0xb002('0x8'));var client=jayson[_0xb002('0x9')][_0xb002('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x270026,_0x10453e,_0x290479){return new BPromise(function(_0x559803,_0x483a5c){return client[_0xb002('0xb')](_0x270026,_0x290479)[_0xb002('0xc')](function(_0x5ae886){logger[_0xb002('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x10453e,_0xb002('0xe'));logger[_0xb002('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x10453e,'request\x20sent',JSON[_0xb002('0x10')](_0x5ae886));if(_0x5ae886[_0xb002('0x11')]){if(_0x5ae886[_0xb002('0x11')]['code']===0x1f4){logger[_0xb002('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x10453e,_0x5ae886[_0xb002('0x11')][_0xb002('0x12')]);return _0x483a5c(_0x5ae886[_0xb002('0x11')][_0xb002('0x12')]);}logger['error'](_0xb002('0x13'),_0x10453e,_0x5ae886[_0xb002('0x11')][_0xb002('0x12')]);return _0x559803(_0x5ae886[_0xb002('0x11')][_0xb002('0x12')]);}else{logger['info'](_0xb002('0x13'),_0x10453e,_0xb002('0xe'));_0x559803(_0x5ae886[_0xb002('0x14')]['message']);}})['catch'](function(_0x597b0a){logger[_0xb002('0x11')](_0xb002('0x13'),_0x10453e,_0x597b0a);_0x483a5c(_0x597b0a);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index ca83bd1..26c6ef4 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 _0x55dc=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','exports'];(function(_0x56fbaa,_0x3bc5a6){var _0x49fbc1=function(_0x19b08b){while(--_0x19b08b){_0x56fbaa['push'](_0x56fbaa['shift']());}};_0x49fbc1(++_0x3bc5a6);}(_0x55dc,0x10e));var _0xc55d=function(_0xdaa031,_0x1b6b9d){_0xdaa031=_0xdaa031-0x0;var _0x17b754=_0x55dc[_0xdaa031];return _0x17b754;};'use strict';var multer=require('multer');var util=require(_0xc55d('0x0'));var path=require(_0xc55d('0x1'));var timeout=require(_0xc55d('0x2'));var express=require(_0xc55d('0x3'));var router=express['Router']();var fs_extra=require(_0xc55d('0x4'));var auth=require(_0xc55d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc55d('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0xc55d('0x7')]('/',auth[_0xc55d('0x8')](),controller[_0xc55d('0x9')]);router[_0xc55d('0x7')](_0xc55d('0xa'),auth[_0xc55d('0x8')](),controller['show']);router[_0xc55d('0x7')](_0xc55d('0xb'),auth['isAuthenticated'](),controller[_0xc55d('0xc')]);router[_0xc55d('0xd')]('/',auth['isAuthenticated'](),controller[_0xc55d('0xe')]);router[_0xc55d('0xf')](_0xc55d('0xa'),auth['isAuthenticated'](),controller[_0xc55d('0x10')]);router['delete'](_0xc55d('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xc55d('0x11')]=router;
\ No newline at end of file
+var _0x8f5d=['show','/:id/download','post','put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id'];(function(_0x16337a,_0x4789a1){var _0x422365=function(_0x34f039){while(--_0x34f039){_0x16337a['push'](_0x16337a['shift']());}};_0x422365(++_0x4789a1);}(_0x8f5d,0xa9));var _0xd8f5=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x8f5d[_0x1203f];return _0x365f0a;};'use strict';var multer=require('multer');var util=require(_0xd8f5('0x0'));var path=require(_0xd8f5('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8f5('0x2'));var router=express[_0xd8f5('0x3')]();var fs_extra=require(_0xd8f5('0x4'));var auth=require(_0xd8f5('0x5'));var interaction=require(_0xd8f5('0x6'));var config=require(_0xd8f5('0x7'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xd8f5('0x8')](),controller['index']);router[_0xd8f5('0x9')](_0xd8f5('0xa'),auth[_0xd8f5('0x8')](),controller[_0xd8f5('0xb')]);router[_0xd8f5('0x9')](_0xd8f5('0xc'),auth[_0xd8f5('0x8')](),controller['download']);router[_0xd8f5('0xd')]('/',auth[_0xd8f5('0x8')](),controller['create']);router[_0xd8f5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xd8f5('0xf')]);router['delete'](_0xd8f5('0xa'),auth[_0xd8f5('0x8')](),controller[_0xd8f5('0x10')]);module[_0xd8f5('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index dd4e090..90b1ef6 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 _0x78ed=['sequelize','exports','STRING','BOOLEAN'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x78ed,0xec));var _0xd78e=function(_0x21f75e,_0x3ccd22){_0x21f75e=_0x21f75e-0x0;var _0x5f2c0f=_0x78ed[_0x21f75e];return _0x5f2c0f;};'use strict';var Sequelize=require(_0xd78e('0x0'));module[_0xd78e('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xd78e('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xd78e('0x2')]},'groupBy':{'type':Sequelize[_0xd78e('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xe767=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0xe767,0x11a));var _0x7e76=function(_0x248031,_0xb67576){_0x248031=_0x248031-0x0;var _0x5d144d=_0xe767[_0x248031];return _0x5d144d;};'use strict';var Sequelize=require(_0x7e76('0x0'));module['exports']={'field':{'type':Sequelize[_0x7e76('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x7e76('0x2')]},'format':{'type':Sequelize[_0x7e76('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x7e76('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 5f0beb1..6295cc3 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 _0x613e=['body','params','bulkDestroy','ids','addFields','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','AnalyticFieldReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','keys','include','find','create','bulkCreate'];(function(_0x391eb4,_0x5a855a){var _0x40079c=function(_0x125d66){while(--_0x125d66){_0x391eb4['push'](_0x391eb4['shift']());}};_0x40079c(++_0x5a855a);}(_0x613e,0xa7));var _0xe613=function(_0x15b552,_0x27f26b){_0x15b552=_0x15b552-0x0;var _0x3a9523=_0x613e[_0x15b552];return _0x3a9523;};'use strict';var emlformat=require(_0xe613('0x0'));var rimraf=require(_0xe613('0x1'));var zipdir=require(_0xe613('0x2'));var jsonpatch=require(_0xe613('0x3'));var rp=require(_0xe613('0x4'));var moment=require(_0xe613('0x5'));var BPromise=require(_0xe613('0x6'));var Mustache=require('mustache');var util=require(_0xe613('0x7'));var path=require(_0xe613('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe613('0x9'));var _=require(_0xe613('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe613('0xb'));var deskjs=require(_0xe613('0xc'));var toCsv=require(_0xe613('0xd'));var querystring=require(_0xe613('0xe'));var Papa=require(_0xe613('0xf'));var Redis=require(_0xe613('0x10'));var authService=require(_0xe613('0x11'));var qs=require(_0xe613('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe613('0x13'));var logger=require(_0xe613('0x14'))('api');var utils=require(_0xe613('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe613('0x16'))['db'];function respondWithStatusCode(_0x1c5188,_0x5b7af0){_0x5b7af0=_0x5b7af0||0xcc;return function(_0x477225){if(_0x477225){return _0x1c5188['sendStatus'](_0x5b7af0);}return _0x1c5188[_0xe613('0x17')](_0x5b7af0)[_0xe613('0x18')]();};}function respondWithResult(_0x373f28,_0x395502){_0x395502=_0x395502||0xc8;return function(_0x5c8f29){if(_0x5c8f29){return _0x373f28[_0xe613('0x17')](_0x395502)['json'](_0x5c8f29);}};}function respondWithFilteredResult(_0x100fc1,_0x4e024d){return function(_0x511cf8){if(_0x511cf8){var _0xc4ff83=typeof _0x4e024d['offset']===_0xe613('0x19')&&typeof _0x4e024d[_0xe613('0x1a')]==='undefined';var _0x5d7608=_0x511cf8[_0xe613('0x1b')];var _0x4dd212=_0xc4ff83?0x0:_0x4e024d[_0xe613('0x1c')];var _0x767989=_0xc4ff83?_0x511cf8['count']:_0x4e024d[_0xe613('0x1c')]+_0x4e024d[_0xe613('0x1a')];var _0x27842e;if(_0x767989>=_0x5d7608){_0x767989=_0x5d7608;_0x27842e=0xc8;}else{_0x27842e=0xce;}_0x100fc1['status'](_0x27842e);return _0x100fc1['set'](_0xe613('0x1d'),_0x4dd212+'-'+_0x767989+'/'+_0x5d7608)[_0xe613('0x1e')](_0x511cf8);}return null;};}function patchUpdates(_0x1ae539){return function(_0x283128){try{jsonpatch[_0xe613('0x1f')](_0x283128,_0x1ae539,!![]);}catch(_0x1fc67c){return BPromise[_0xe613('0x20')](_0x1fc67c);}return _0x283128[_0xe613('0x21')]();};}function saveUpdates(_0x744e7e,_0x56d677){return function(_0x46fe1d){if(_0x46fe1d){return _0x46fe1d[_0xe613('0x22')](_0x744e7e)[_0xe613('0x23')](function(_0x18ae16){return _0x18ae16;});}return null;};}function removeEntity(_0x56bc4d,_0x39b30e){return function(_0x3d7b1b){if(_0x3d7b1b){return _0x3d7b1b[_0xe613('0x24')]()[_0xe613('0x23')](function(){_0x56bc4d[_0xe613('0x17')](0xcc)[_0xe613('0x18')]();});}};}function handleEntityNotFound(_0x8735b1,_0x5da3d6){return function(_0x3fbc62){if(!_0x3fbc62){_0x8735b1[_0xe613('0x25')](0x194);}return _0x3fbc62;};}function handleError(_0x1af053,_0x2be5ca){_0x2be5ca=_0x2be5ca||0x1f4;return function(_0x1404fb){logger[_0xe613('0x26')](_0x1404fb[_0xe613('0x27')]);if(_0x1404fb[_0xe613('0x28')]){delete _0x1404fb[_0xe613('0x28')];}_0x1af053[_0xe613('0x17')](_0x2be5ca)['send'](_0x1404fb);};}exports['index']=function(_0x1edc4a,_0x410372){var _0x2798af={},_0x41b0eb={},_0x5a7281={'count':0x0,'rows':[]};var _0x19ad60=_['map'](db[_0xe613('0x29')][_0xe613('0x2a')],function(_0x3ffaf5){return{'name':_0x3ffaf5[_0xe613('0x2b')],'type':_0x3ffaf5[_0xe613('0x2c')]['key']};});_0x41b0eb[_0xe613('0x2d')]=_[_0xe613('0x2e')](_0x19ad60,_0xe613('0x28'));_0x41b0eb['query']=_['keys'](_0x1edc4a[_0xe613('0x2f')]);_0x41b0eb[_0xe613('0x30')]=_[_0xe613('0x31')](_0x41b0eb[_0xe613('0x2d')],_0x41b0eb['query']);_0x2798af[_0xe613('0x32')]=_['intersection'](_0x41b0eb[_0xe613('0x2d')],qs[_0xe613('0x33')](_0x1edc4a[_0xe613('0x2f')]['fields']));_0x2798af['attributes']=_0x2798af[_0xe613('0x32')][_0xe613('0x34')]?_0x2798af['attributes']:_0x41b0eb[_0xe613('0x2d')];if(!_0x1edc4a['query'][_0xe613('0x35')](_0xe613('0x36'))){_0x2798af[_0xe613('0x1a')]=qs[_0xe613('0x1a')](_0x1edc4a[_0xe613('0x2f')][_0xe613('0x1a')]);_0x2798af[_0xe613('0x1c')]=qs[_0xe613('0x1c')](_0x1edc4a['query'][_0xe613('0x1c')]);}_0x2798af[_0xe613('0x37')]=qs[_0xe613('0x38')](_0x1edc4a['query']['sort']);_0x2798af['where']=qs[_0xe613('0x30')](_[_0xe613('0x39')](_0x1edc4a[_0xe613('0x2f')],_0x41b0eb[_0xe613('0x30')]),_0x19ad60);if(_0x1edc4a[_0xe613('0x2f')]['filter']){_0x2798af[_0xe613('0x3a')]=_['merge'](_0x2798af[_0xe613('0x3a')],{'$or':_[_0xe613('0x2e')](_0x19ad60,function(_0x1e4a2b){if(_0x1e4a2b[_0xe613('0x2c')]!==_0xe613('0x3b')){var _0x14cb53={};_0x14cb53[_0x1e4a2b[_0xe613('0x28')]]={'$like':'%'+_0x1edc4a[_0xe613('0x2f')][_0xe613('0x3c')]+'%'};return _0x14cb53;}})});}_0x2798af=_[_0xe613('0x3d')]({},_0x2798af,_0x1edc4a[_0xe613('0x3e')]);var _0x1151f5={'where':_0x2798af[_0xe613('0x3a')]};return db[_0xe613('0x29')][_0xe613('0x1b')](_0x1151f5)[_0xe613('0x23')](function(_0x3c844){_0x5a7281['count']=_0x3c844;if(_0x1edc4a[_0xe613('0x2f')][_0xe613('0x3f')]){_0x2798af['include']=[{'all':!![]}];}return db[_0xe613('0x29')][_0xe613('0x40')](_0x2798af);})[_0xe613('0x23')](function(_0xa0634){_0x5a7281[_0xe613('0x41')]=_0xa0634;return _0x5a7281;})[_0xe613('0x23')](respondWithFilteredResult(_0x410372,_0x2798af))[_0xe613('0x42')](handleError(_0x410372,null));};exports[_0xe613('0x43')]=function(_0x5c2e56,_0x5542c4){var _0x5eda54={'raw':![],'where':{'id':_0x5c2e56['params']['id']}},_0x2266e8={};_0x2266e8[_0xe613('0x2d')]=_['keys'](db[_0xe613('0x29')][_0xe613('0x2a')]);_0x2266e8['query']=_[_0xe613('0x44')](_0x5c2e56[_0xe613('0x2f')]);_0x2266e8[_0xe613('0x30')]=_[_0xe613('0x31')](_0x2266e8[_0xe613('0x2d')],_0x2266e8['query']);_0x5eda54[_0xe613('0x32')]=_[_0xe613('0x31')](_0x2266e8[_0xe613('0x2d')],qs['fields'](_0x5c2e56[_0xe613('0x2f')][_0xe613('0x33')]));_0x5eda54[_0xe613('0x32')]=_0x5eda54['attributes']['length']?_0x5eda54['attributes']:_0x2266e8[_0xe613('0x2d')];if(_0x5c2e56['query'][_0xe613('0x3f')]){_0x5eda54[_0xe613('0x45')]=[{'all':!![]}];}_0x5eda54=_[_0xe613('0x3d')]({},_0x5eda54,_0x5c2e56[_0xe613('0x3e')]);return db['AnalyticFieldReport'][_0xe613('0x46')](_0x5eda54)[_0xe613('0x23')](handleEntityNotFound(_0x5542c4,null))[_0xe613('0x23')](respondWithResult(_0x5542c4,null))[_0xe613('0x42')](handleError(_0x5542c4,null));};exports[_0xe613('0x47')]=function(_0xd12708,_0x3affb1){return db[_0xe613('0x29')]['create'](_0xd12708['body'],{})[_0xe613('0x23')](respondWithResult(_0x3affb1,0xc9))['catch'](handleError(_0x3affb1,null));};exports[_0xe613('0x48')]=function(_0x5f4415,_0x53e86f){return db[_0xe613('0x29')][_0xe613('0x48')](_0x5f4415[_0xe613('0x49')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x53e86f,0xc9))[_0xe613('0x42')](handleError(_0x53e86f,null));};exports['update']=function(_0x17ae16,_0x37839d){if(_0x17ae16[_0xe613('0x49')]['id']){delete _0x17ae16[_0xe613('0x49')]['id'];}return db[_0xe613('0x29')][_0xe613('0x46')]({'where':{'id':_0x17ae16['params']['id']}})[_0xe613('0x23')](handleEntityNotFound(_0x37839d,null))['then'](saveUpdates(_0x17ae16[_0xe613('0x49')],null))[_0xe613('0x23')](respondWithResult(_0x37839d,null))[_0xe613('0x42')](handleError(_0x37839d,null));};exports[_0xe613('0x24')]=function(_0x283bb2,_0x424ca6){return db['AnalyticFieldReport'][_0xe613('0x46')]({'where':{'id':_0x283bb2[_0xe613('0x4a')]['id']}})[_0xe613('0x23')](handleEntityNotFound(_0x424ca6,null))[_0xe613('0x23')](removeEntity(_0x424ca6,null))[_0xe613('0x42')](handleError(_0x424ca6,null));};exports[_0xe613('0x4b')]=function(_0x2f9e75,_0x27d62e){return db[_0xe613('0x29')][_0xe613('0x24')]({'where':{'id':_0x2f9e75[_0xe613('0x2f')][_0xe613('0x4c')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x27d62e,0xcc))[_0xe613('0x42')](handleError(_0x27d62e,null));};exports[_0xe613('0x4d')]=function(_0x923701,_0x2f9436,_0x261a3e){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x923701['params']['id']}})['then'](handleEntityNotFound(_0x2f9436,null))[_0xe613('0x23')](function(_0x4e9618){if(_0x4e9618){return db['sequelize'][_0xe613('0x4e')](function(_0x323864){return db[_0xe613('0x29')][_0xe613('0x24')]({'where':{'CustomReportId':_0x923701[_0xe613('0x4a')]['id']},'transaction':_0x323864})[_0xe613('0x23')](function(_0x2c0a0a){var _0x4d5ee1=_[_0xe613('0x2e')](_0x923701[_0xe613('0x49')],function(_0x4c29cb){delete _0x4c29cb['id'];_0x4c29cb[_0xe613('0x4f')]=_0x923701[_0xe613('0x4a')]['id'];return _0x4c29cb;});return db['AnalyticFieldReport']['bulkCreate'](_0x4d5ee1,{'transaction':_0x323864});});})[_0xe613('0x23')](function(){return db[_0xe613('0x29')][_0xe613('0x40')]({'where':{'CustomReportId':_0x923701['params']['id']}});});}})[_0xe613('0x23')](respondWithResult(_0x2f9436,null))['catch'](handleError(_0x2f9436,null));};
\ No newline at end of file
+var _0x78eb=['params','find','create','body','bulkCreate','ids','addFields','findOne','transaction','CustomReportId','findAll','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','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','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticFieldReport','catch'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x78eb,0x153));var _0xb78e=function(_0x2ba31b,_0x44b207){_0x2ba31b=_0x2ba31b-0x0;var _0x23d222=_0x78eb[_0x2ba31b];return _0x23d222;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb78e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb78e('0x1'));var moment=require(_0xb78e('0x2'));var BPromise=require(_0xb78e('0x3'));var Mustache=require(_0xb78e('0x4'));var util=require(_0xb78e('0x5'));var path=require(_0xb78e('0x6'));var sox=require('sox');var csv=require(_0xb78e('0x7'));var ejs=require(_0xb78e('0x8'));var fs=require('fs');var fs_extra=require(_0xb78e('0x9'));var _=require(_0xb78e('0xa'));var squel=require(_0xb78e('0xb'));var crypto=require(_0xb78e('0xc'));var jsforce=require(_0xb78e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb78e('0x7'));var querystring=require(_0xb78e('0xe'));var Papa=require(_0xb78e('0xf'));var Redis=require(_0xb78e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb78e('0x11'));var as=require(_0xb78e('0x12'));var hardwareService=require(_0xb78e('0x13'));var logger=require(_0xb78e('0x14'))('api');var utils=require(_0xb78e('0x15'));var config=require(_0xb78e('0x16'));var licenseUtil=require(_0xb78e('0x17'));var db=require(_0xb78e('0x18'))['db'];function respondWithStatusCode(_0x53ed2e,_0x5a625c){_0x5a625c=_0x5a625c||0xcc;return function(_0x5648a7){if(_0x5648a7){return _0x53ed2e['sendStatus'](_0x5a625c);}return _0x53ed2e[_0xb78e('0x19')](_0x5a625c)[_0xb78e('0x1a')]();};}function respondWithResult(_0x3cbf2a,_0x16c8da){_0x16c8da=_0x16c8da||0xc8;return function(_0x2cf88c){if(_0x2cf88c){return _0x3cbf2a['status'](_0x16c8da)['json'](_0x2cf88c);}};}function respondWithFilteredResult(_0x12549c,_0x315ac2){return function(_0xc178f8){if(_0xc178f8){var _0x3a9f87=typeof _0x315ac2[_0xb78e('0x1b')]===_0xb78e('0x1c')&&typeof _0x315ac2[_0xb78e('0x1d')]===_0xb78e('0x1c');var _0x5316d3=_0xc178f8['count'];var _0x3bd8e9=_0x3a9f87?0x0:_0x315ac2[_0xb78e('0x1b')];var _0x3ceca8=_0x3a9f87?_0xc178f8[_0xb78e('0x1e')]:_0x315ac2[_0xb78e('0x1b')]+_0x315ac2[_0xb78e('0x1d')];var _0x4a1a43;if(_0x3ceca8>=_0x5316d3){_0x3ceca8=_0x5316d3;_0x4a1a43=0xc8;}else{_0x4a1a43=0xce;}_0x12549c[_0xb78e('0x19')](_0x4a1a43);return _0x12549c[_0xb78e('0x1f')](_0xb78e('0x20'),_0x3bd8e9+'-'+_0x3ceca8+'/'+_0x5316d3)['json'](_0xc178f8);}return null;};}function patchUpdates(_0xa9bd30){return function(_0x49b8f7){try{jsonpatch[_0xb78e('0x21')](_0x49b8f7,_0xa9bd30,!![]);}catch(_0x1a3071){return BPromise[_0xb78e('0x22')](_0x1a3071);}return _0x49b8f7['save']();};}function saveUpdates(_0x1cab74,_0xe76b1){return function(_0x1bc524){if(_0x1bc524){return _0x1bc524[_0xb78e('0x23')](_0x1cab74)[_0xb78e('0x24')](function(_0x28a96e){return _0x28a96e;});}return null;};}function removeEntity(_0x141028,_0x1701ad){return function(_0x11792f){if(_0x11792f){return _0x11792f[_0xb78e('0x25')]()['then'](function(){_0x141028[_0xb78e('0x19')](0xcc)[_0xb78e('0x1a')]();});}};}function handleEntityNotFound(_0x123185,_0xb45429){return function(_0x5349c8){if(!_0x5349c8){_0x123185[_0xb78e('0x26')](0x194);}return _0x5349c8;};}function handleError(_0x19a797,_0x3aa958){_0x3aa958=_0x3aa958||0x1f4;return function(_0x135f89){logger[_0xb78e('0x27')](_0x135f89[_0xb78e('0x28')]);if(_0x135f89[_0xb78e('0x29')]){delete _0x135f89['name'];}_0x19a797[_0xb78e('0x19')](_0x3aa958)[_0xb78e('0x2a')](_0x135f89);};}exports[_0xb78e('0x2b')]=function(_0x2d5a95,_0x195363){var _0x95f9e9={},_0x1f4459={},_0x3efdac={'count':0x0,'rows':[]};var _0x16bc21=_[_0xb78e('0x2c')](db['AnalyticFieldReport'][_0xb78e('0x2d')],function(_0x42995c){return{'name':_0x42995c[_0xb78e('0x2e')],'type':_0x42995c[_0xb78e('0x2f')][_0xb78e('0x30')]};});_0x1f4459[_0xb78e('0x31')]=_[_0xb78e('0x2c')](_0x16bc21,'name');_0x1f4459[_0xb78e('0x32')]=_[_0xb78e('0x33')](_0x2d5a95[_0xb78e('0x32')]);_0x1f4459[_0xb78e('0x34')]=_[_0xb78e('0x35')](_0x1f4459[_0xb78e('0x31')],_0x1f4459[_0xb78e('0x32')]);_0x95f9e9['attributes']=_['intersection'](_0x1f4459[_0xb78e('0x31')],qs[_0xb78e('0x36')](_0x2d5a95['query'][_0xb78e('0x36')]));_0x95f9e9[_0xb78e('0x37')]=_0x95f9e9[_0xb78e('0x37')][_0xb78e('0x38')]?_0x95f9e9['attributes']:_0x1f4459[_0xb78e('0x31')];if(!_0x2d5a95['query'][_0xb78e('0x39')](_0xb78e('0x3a'))){_0x95f9e9['limit']=qs[_0xb78e('0x1d')](_0x2d5a95[_0xb78e('0x32')]['limit']);_0x95f9e9[_0xb78e('0x1b')]=qs['offset'](_0x2d5a95[_0xb78e('0x32')][_0xb78e('0x1b')]);}_0x95f9e9[_0xb78e('0x3b')]=qs[_0xb78e('0x3c')](_0x2d5a95[_0xb78e('0x32')][_0xb78e('0x3c')]);_0x95f9e9[_0xb78e('0x3d')]=qs[_0xb78e('0x34')](_[_0xb78e('0x3e')](_0x2d5a95[_0xb78e('0x32')],_0x1f4459[_0xb78e('0x34')]),_0x16bc21);if(_0x2d5a95[_0xb78e('0x32')][_0xb78e('0x3f')]){_0x95f9e9['where']=_[_0xb78e('0x40')](_0x95f9e9[_0xb78e('0x3d')],{'$or':_['map'](_0x16bc21,function(_0x709d7a){if(_0x709d7a['type']!==_0xb78e('0x41')){var _0x5b235b={};_0x5b235b[_0x709d7a[_0xb78e('0x29')]]={'$like':'%'+_0x2d5a95[_0xb78e('0x32')][_0xb78e('0x3f')]+'%'};return _0x5b235b;}})});}_0x95f9e9=_[_0xb78e('0x40')]({},_0x95f9e9,_0x2d5a95[_0xb78e('0x42')]);var _0x318b0a={'where':_0x95f9e9[_0xb78e('0x3d')]};return db['AnalyticFieldReport'][_0xb78e('0x1e')](_0x318b0a)['then'](function(_0x520b68){_0x3efdac['count']=_0x520b68;if(_0x2d5a95[_0xb78e('0x32')][_0xb78e('0x43')]){_0x95f9e9[_0xb78e('0x44')]=[{'all':!![]}];}return db[_0xb78e('0x45')]['findAll'](_0x95f9e9);})[_0xb78e('0x24')](function(_0x117776){_0x3efdac['rows']=_0x117776;return _0x3efdac;})[_0xb78e('0x24')](respondWithFilteredResult(_0x195363,_0x95f9e9))[_0xb78e('0x46')](handleError(_0x195363,null));};exports['show']=function(_0x57ea46,_0x22e1ce){var _0x40ef14={'raw':![],'where':{'id':_0x57ea46[_0xb78e('0x47')]['id']}},_0x5ce10c={};_0x5ce10c[_0xb78e('0x31')]=_[_0xb78e('0x33')](db[_0xb78e('0x45')][_0xb78e('0x2d')]);_0x5ce10c['query']=_[_0xb78e('0x33')](_0x57ea46[_0xb78e('0x32')]);_0x5ce10c[_0xb78e('0x34')]=_[_0xb78e('0x35')](_0x5ce10c[_0xb78e('0x31')],_0x5ce10c[_0xb78e('0x32')]);_0x40ef14[_0xb78e('0x37')]=_['intersection'](_0x5ce10c['model'],qs['fields'](_0x57ea46[_0xb78e('0x32')][_0xb78e('0x36')]));_0x40ef14[_0xb78e('0x37')]=_0x40ef14['attributes'][_0xb78e('0x38')]?_0x40ef14[_0xb78e('0x37')]:_0x5ce10c[_0xb78e('0x31')];if(_0x57ea46[_0xb78e('0x32')][_0xb78e('0x43')]){_0x40ef14[_0xb78e('0x44')]=[{'all':!![]}];}_0x40ef14=_['merge']({},_0x40ef14,_0x57ea46[_0xb78e('0x42')]);return db[_0xb78e('0x45')][_0xb78e('0x48')](_0x40ef14)[_0xb78e('0x24')](handleEntityNotFound(_0x22e1ce,null))[_0xb78e('0x24')](respondWithResult(_0x22e1ce,null))[_0xb78e('0x46')](handleError(_0x22e1ce,null));};exports[_0xb78e('0x49')]=function(_0x5a3f6b,_0x2f758d){return db[_0xb78e('0x45')][_0xb78e('0x49')](_0x5a3f6b[_0xb78e('0x4a')],{})[_0xb78e('0x24')](respondWithResult(_0x2f758d,0xc9))[_0xb78e('0x46')](handleError(_0x2f758d,null));};exports[_0xb78e('0x4b')]=function(_0x3a859f,_0x180dab){return db['AnalyticFieldReport']['bulkCreate'](_0x3a859f['body'],{'raw':![],'individualHooks':!![]})[_0xb78e('0x24')](respondWithResult(_0x180dab,0xc9))[_0xb78e('0x46')](handleError(_0x180dab,null));};exports[_0xb78e('0x23')]=function(_0x4ca402,_0x14cdf5){if(_0x4ca402[_0xb78e('0x4a')]['id']){delete _0x4ca402[_0xb78e('0x4a')]['id'];}return db[_0xb78e('0x45')][_0xb78e('0x48')]({'where':{'id':_0x4ca402['params']['id']}})[_0xb78e('0x24')](handleEntityNotFound(_0x14cdf5,null))['then'](saveUpdates(_0x4ca402[_0xb78e('0x4a')],null))[_0xb78e('0x24')](respondWithResult(_0x14cdf5,null))[_0xb78e('0x46')](handleError(_0x14cdf5,null));};exports[_0xb78e('0x25')]=function(_0x545070,_0x3d9888){return db[_0xb78e('0x45')][_0xb78e('0x48')]({'where':{'id':_0x545070[_0xb78e('0x47')]['id']}})[_0xb78e('0x24')](handleEntityNotFound(_0x3d9888,null))['then'](removeEntity(_0x3d9888,null))[_0xb78e('0x46')](handleError(_0x3d9888,null));};exports['bulkDestroy']=function(_0x374742,_0x4e8e5f){return db[_0xb78e('0x45')][_0xb78e('0x25')]({'where':{'id':_0x374742[_0xb78e('0x32')][_0xb78e('0x4c')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4e8e5f,0xcc))[_0xb78e('0x46')](handleError(_0x4e8e5f,null));};exports[_0xb78e('0x4d')]=function(_0x288259,_0x471977,_0x501236){return db['AnalyticCustomReport'][_0xb78e('0x4e')]({'where':{'id':_0x288259[_0xb78e('0x47')]['id']}})[_0xb78e('0x24')](handleEntityNotFound(_0x471977,null))['then'](function(_0x16ea11){if(_0x16ea11){return db['sequelize'][_0xb78e('0x4f')](function(_0x40fe2d){return db[_0xb78e('0x45')][_0xb78e('0x25')]({'where':{'CustomReportId':_0x288259[_0xb78e('0x47')]['id']},'transaction':_0x40fe2d})[_0xb78e('0x24')](function(_0x39c51f){var _0x5d2ca9=_[_0xb78e('0x2c')](_0x288259[_0xb78e('0x4a')],function(_0x417203){delete _0x417203['id'];_0x417203[_0xb78e('0x50')]=_0x288259[_0xb78e('0x47')]['id'];return _0x417203;});return db[_0xb78e('0x45')][_0xb78e('0x4b')](_0x5d2ca9,{'transaction':_0x40fe2d});});})['then'](function(){return db[_0xb78e('0x45')][_0xb78e('0x51')]({'where':{'CustomReportId':_0x288259[_0xb78e('0x47')]['id']}});});}})[_0xb78e('0x24')](respondWithResult(_0x471977,null))['catch'](handleError(_0x471977,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 551a45c..bf63d57 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 _0xd83d=['api','bluebird','request-promise','path','./analyticFieldReport.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xd83d,0x7f));var _0xdd83=function(_0x4b0a6d,_0x3d4e91){_0x4b0a6d=_0x4b0a6d-0x0;var _0x2a60e2=_0xd83d[_0x4b0a6d];return _0x2a60e2;};'use strict';var _=require(_0xdd83('0x0'));var util=require(_0xdd83('0x1'));var logger=require(_0xdd83('0x2'))(_0xdd83('0x3'));var moment=require('moment');var BPromise=require(_0xdd83('0x4'));var rp=require(_0xdd83('0x5'));var fs=require('fs');var path=require(_0xdd83('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdd83('0x7'));module[_0xdd83('0x8')]=function(_0x945361,_0x14b77e){return _0x945361[_0xdd83('0x9')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeb9a=['bluebird','path','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger'];(function(_0x27e0c0,_0x35ae92){var _0xebc02b=function(_0x5a207c){while(--_0x5a207c){_0x27e0c0['push'](_0x27e0c0['shift']());}};_0xebc02b(++_0x35ae92);}(_0xeb9a,0x7e));var _0xaeb9=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xeb9a[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0xaeb9('0x0'));var util=require('util');var logger=require(_0xaeb9('0x1'))('api');var moment=require('moment');var BPromise=require(_0xaeb9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaeb9('0x3'));var rimraf=require('rimraf');var config=require(_0xaeb9('0x4'));var attributes=require(_0xaeb9('0x5'));module['exports']=function(_0x2fb9d7,_0x43ae9d){return _0x2fb9d7['define'](_0xaeb9('0x6'),attributes,{'tableName':_0xaeb9('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index ab38537..72316f2 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 _0x864f=['../../config/environment','client','http','then','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info','request\x20sent','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x864f,0x174));var _0xf864=function(_0x72dd8,_0x27ea2c){_0x72dd8=_0x72dd8-0x0;var _0x486f5c=_0x864f[_0x72dd8];return _0x486f5c;};'use strict';var _=require(_0xf864('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf864('0x1'));var rs=require(_0xf864('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf864('0x3'))['db'];var utils=require(_0xf864('0x4'));var logger=require(_0xf864('0x5'))('rpc');var config=require(_0xf864('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf864('0x7')][_0xf864('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x72cfcc,_0x1a356e,_0x4001af){return new BPromise(function(_0x3e69ca,_0x13da42){return client['request'](_0x72cfcc,_0x4001af)[_0xf864('0x9')](function(_0x477c80){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x1a356e,'request\x20sent');logger[_0xf864('0xa')](_0xf864('0xb'),_0x1a356e,'request\x20sent',JSON[_0xf864('0xc')](_0x477c80));if(_0x477c80[_0xf864('0xd')]){if(_0x477c80[_0xf864('0xd')][_0xf864('0xe')]===0x1f4){logger[_0xf864('0xd')](_0xf864('0xf'),_0x1a356e,_0x477c80['error'][_0xf864('0x10')]);return _0x13da42(_0x477c80[_0xf864('0xd')][_0xf864('0x10')]);}logger['error'](_0xf864('0xf'),_0x1a356e,_0x477c80[_0xf864('0xd')][_0xf864('0x10')]);return _0x3e69ca(_0x477c80['error'][_0xf864('0x10')]);}else{logger[_0xf864('0x11')](_0xf864('0xf'),_0x1a356e,_0xf864('0x12'));_0x3e69ca(_0x477c80[_0xf864('0x13')][_0xf864('0x10')]);}})[_0xf864('0x14')](function(_0x3abc96){logger[_0xf864('0xd')](_0xf864('0xf'),_0x1a356e,_0x3abc96);_0x13da42(_0x3abc96);});});}
\ No newline at end of file
+var _0x4255=['request','then','request\x20sent','debug','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2bb9b3,_0x1d2c25){var _0x601b6=function(_0x4f8d09){while(--_0x4f8d09){_0x2bb9b3['push'](_0x2bb9b3['shift']());}};_0x601b6(++_0x1d2c25);}(_0x4255,0x1a8));var _0x5425=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0x4255[_0x318840];return _0x223da4;};'use strict';var _=require(_0x5425('0x0'));var util=require(_0x5425('0x1'));var moment=require(_0x5425('0x2'));var BPromise=require(_0x5425('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5425('0x4'));var db=require(_0x5425('0x5'))['db'];var utils=require(_0x5425('0x6'));var logger=require(_0x5425('0x7'))(_0x5425('0x8'));var config=require(_0x5425('0x9'));var jayson=require(_0x5425('0xa'));var client=jayson[_0x5425('0xb')][_0x5425('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x257ac6,_0xf048d2,_0x4101f6){return new BPromise(function(_0x28a486,_0x1dd752){return client[_0x5425('0xd')](_0x257ac6,_0x4101f6)[_0x5425('0xe')](function(_0x5c7291){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0xf048d2,_0x5425('0xf'));logger[_0x5425('0x10')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0xf048d2,_0x5425('0xf'),JSON[_0x5425('0x11')](_0x5c7291));if(_0x5c7291[_0x5425('0x12')]){if(_0x5c7291[_0x5425('0x12')]['code']===0x1f4){logger[_0x5425('0x12')](_0x5425('0x13'),_0xf048d2,_0x5c7291['error'][_0x5425('0x14')]);return _0x1dd752(_0x5c7291[_0x5425('0x12')][_0x5425('0x14')]);}logger[_0x5425('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0xf048d2,_0x5c7291[_0x5425('0x12')]['message']);return _0x28a486(_0x5c7291[_0x5425('0x12')][_0x5425('0x14')]);}else{logger[_0x5425('0x15')]('AnalyticFieldReport,\x20%s,\x20%s',_0xf048d2,_0x5425('0xf'));_0x28a486(_0x5c7291[_0x5425('0x16')][_0x5425('0x14')]);}})['catch'](function(_0x37c791){logger[_0x5425('0x12')](_0x5425('0x13'),_0xf048d2,_0x37c791);_0x1dd752(_0x37c791);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 91488bd..fc32696 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(_0x2d3487,_0xa20979){var _0x27041d=function(_0x7133a7){while(--_0x7133a7){_0x2d3487['push'](_0x2d3487['shift']());}};_0x27041d(++_0xa20979);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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(_0x1c9f10,_0x168c27){var _0x5f1900=function(_0x123ac7){while(--_0x123ac7){_0x1c9f10['push'](_0x1c9f10['shift']());}};_0x5f1900(++_0x168c27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 8f054ce..e0d72aa 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 _0xffe1=['exports','name','TEXT','sequelize'];(function(_0x51ab33,_0x71a8a8){var _0x5e1298=function(_0x1bd8cf){while(--_0x1bd8cf){_0x51ab33['push'](_0x51ab33['shift']());}};_0x5e1298(++_0x71a8a8);}(_0xffe1,0x187));var _0x1ffe=function(_0x2050d9,_0xf739fe){_0x2050d9=_0x2050d9-0x0;var _0x3d368a=_0xffe1[_0x2050d9];return _0x3d368a;};'use strict';var Sequelize=require(_0x1ffe('0x0'));module[_0x1ffe('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1ffe('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x1ffe('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8482=['name','TEXT','exports','STRING'];(function(_0x297d2a,_0x2e6e66){var _0x5f411d=function(_0x54d6e8){while(--_0x54d6e8){_0x297d2a['push'](_0x297d2a['shift']());}};_0x5f411d(++_0x2e6e66);}(_0x8482,0x14e));var _0x2848=function(_0x1390ed,_0xee1253){_0x1390ed=_0x1390ed-0x0;var _0x26f4f8=_0x8482[_0x1390ed];return _0x26f4f8;};'use strict';var Sequelize=require('sequelize');module[_0x2848('0x0')]={'name':{'type':Sequelize[_0x2848('0x1')],'allowNull':![],'unique':_0x2848('0x2')},'table':{'type':Sequelize[_0x2848('0x1')]},'metric':{'type':Sequelize[_0x2848('0x3')]},'description':{'type':Sequelize[_0x2848('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index cddaf9e..2a15aaf 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 _0xdbf5=['../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','AnalyticMetric','includeAll','include','findAll','rows','catch','show','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0xcc0a4d,_0xf9b91){var _0x510611=function(_0x3c0166){while(--_0x3c0166){_0xcc0a4d['push'](_0xcc0a4d['shift']());}};_0x510611(++_0xf9b91);}(_0xdbf5,0x18c));var _0x5dbf=function(_0xf0517d,_0x250d56){_0xf0517d=_0xf0517d-0x0;var _0x518dbf=_0xdbf5[_0xf0517d];return _0x518dbf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){var _0x226b93=_0x2d3e1b[_0x5dbf('0x22')]({'plain':!![]});var _0x20ab1b=_0x5dbf('0x23');return db[_0x5dbf('0x24')][_0x5dbf('0x21')]({'where':{'type':_0x20ab1b,'resourceId':_0x226b93['id']}})[_0x5dbf('0x20')](function(){return _0x2d3e1b;});})[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x25')]();});}};}function handleEntityNotFound(_0x17f135,_0x466985){return function(_0x3f8341){if(!_0x3f8341){_0x17f135[_0x5dbf('0x16')](0x194);}return _0x3f8341;};}function handleError(_0x22ec42,_0x6a9757){_0x6a9757=_0x6a9757||0x1f4;return function(_0x471027){logger[_0x5dbf('0x26')](_0x471027['stack']);if(_0x471027[_0x5dbf('0x27')]){delete _0x471027[_0x5dbf('0x27')];}_0x22ec42[_0x5dbf('0x17')](_0x6a9757)[_0x5dbf('0x28')](_0x471027);};}exports[_0x5dbf('0x29')]=function(_0x6a276d,_0x2a65c5){var _0x31d57a={},_0x406ce6={},_0x273b63={'count':0x0,'rows':[]};var _0x294dd7=_['map'](db['AnalyticMetric'][_0x5dbf('0x2a')],function(_0x19015a){return{'name':_0x19015a[_0x5dbf('0x2b')],'type':_0x19015a[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x406ce6['model']=_['map'](_0x294dd7,_0x5dbf('0x27'));_0x406ce6[_0x5dbf('0x2e')]=_['keys'](_0x6a276d[_0x5dbf('0x2e')]);_0x406ce6[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],_0x406ce6[_0x5dbf('0x2e')]);_0x31d57a['attributes']=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x32')]));_0x31d57a['attributes']=_0x31d57a[_0x5dbf('0x33')][_0x5dbf('0x34')]?_0x31d57a[_0x5dbf('0x33')]:_0x406ce6[_0x5dbf('0x31')];if(!_0x6a276d['query'][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x31d57a[_0x5dbf('0x37')]=qs[_0x5dbf('0x37')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x37')]);_0x31d57a[_0x5dbf('0x19')]=qs[_0x5dbf('0x19')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x19')]);}_0x31d57a[_0x5dbf('0x38')]=qs['sort'](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x39')]);_0x31d57a[_0x5dbf('0x3a')]=qs['filters'](_[_0x5dbf('0x3b')](_0x6a276d[_0x5dbf('0x2e')],_0x406ce6[_0x5dbf('0x2f')]),_0x294dd7);if(_0x6a276d['query'][_0x5dbf('0x3c')]){_0x31d57a[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x31d57a['where'],{'$or':_[_0x5dbf('0x3e')](_0x294dd7,function(_0x29a62d){if(_0x29a62d[_0x5dbf('0x2c')]!==_0x5dbf('0x3f')){var _0x10537d={};_0x10537d[_0x29a62d[_0x5dbf('0x27')]]={'$like':'%'+_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x3c')]+'%'};return _0x10537d;}})});}_0x31d57a=_['merge']({},_0x31d57a,_0x6a276d['options']);var _0x57ee72={'where':_0x31d57a['where']};return db[_0x5dbf('0x40')][_0x5dbf('0x1b')](_0x57ee72)['then'](function(_0x3ef0eb){_0x273b63[_0x5dbf('0x1b')]=_0x3ef0eb;if(_0x6a276d['query'][_0x5dbf('0x41')]){_0x31d57a[_0x5dbf('0x42')]=[{'all':!![]}];}return db[_0x5dbf('0x40')][_0x5dbf('0x43')](_0x31d57a);})[_0x5dbf('0x20')](function(_0x7c390d){_0x273b63[_0x5dbf('0x44')]=_0x7c390d;return _0x273b63;})[_0x5dbf('0x20')](respondWithFilteredResult(_0x2a65c5,_0x31d57a))[_0x5dbf('0x45')](handleError(_0x2a65c5,null));};exports[_0x5dbf('0x46')]=function(_0x50ac70,_0x78aef3){var _0x22f958={'raw':!![],'where':{'id':_0x50ac70['params']['id']}},_0xec1d28={};_0xec1d28[_0x5dbf('0x31')]=_[_0x5dbf('0x47')](db[_0x5dbf('0x40')][_0x5dbf('0x2a')]);_0xec1d28['query']=_[_0x5dbf('0x47')](_0x50ac70['query']);_0xec1d28[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0xec1d28[_0x5dbf('0x31')],_0xec1d28[_0x5dbf('0x2e')]);_0x22f958['attributes']=_['intersection'](_0xec1d28[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x50ac70[_0x5dbf('0x2e')]['fields']));_0x22f958[_0x5dbf('0x33')]=_0x22f958['attributes']['length']?_0x22f958['attributes']:_0xec1d28['model'];if(_0x50ac70[_0x5dbf('0x2e')][_0x5dbf('0x41')]){_0x22f958['include']=[{'all':!![]}];}_0x22f958=_[_0x5dbf('0x3d')]({},_0x22f958,_0x50ac70[_0x5dbf('0x48')]);return db['AnalyticMetric'][_0x5dbf('0x49')](_0x22f958)[_0x5dbf('0x20')](handleEntityNotFound(_0x78aef3,null))['then'](respondWithResult(_0x78aef3,null))[_0x5dbf('0x45')](handleError(_0x78aef3,null));};exports['create']=function(_0x5ab862,_0x337897){return db[_0x5dbf('0x40')][_0x5dbf('0x4a')](_0x5ab862['body'],{})['then'](function(_0x442a43){var _0x3e8612=_0x5ab862[_0x5dbf('0x4b')][_0x5dbf('0x22')]({'plain':!![]});if(!_0x3e8612)throw new Error(_0x5dbf('0x4c'));if(_0x3e8612[_0x5dbf('0x4d')]===_0x5dbf('0x4b')){var _0x319906=_0x442a43['get']({'plain':!![]});var _0x3f38a0=_0x5dbf('0x23');return db[_0x5dbf('0x4e')][_0x5dbf('0x49')]({'where':{'name':_0x3f38a0,'userProfileId':_0x3e8612[_0x5dbf('0x4f')]},'raw':!![]})[_0x5dbf('0x20')](function(_0x328dc5){if(_0x328dc5&&_0x328dc5['autoAssociation']===0x0){return db[_0x5dbf('0x24')]['create']({'name':_0x319906[_0x5dbf('0x27')],'resourceId':_0x319906['id'],'type':_0x328dc5[_0x5dbf('0x27')],'sectionId':_0x328dc5['id']},{})[_0x5dbf('0x20')](function(){return _0x442a43;});}else{return _0x442a43;}})[_0x5dbf('0x45')](function(_0x78ab84){logger[_0x5dbf('0x26')](_0x5dbf('0x50'),_0x78ab84);throw _0x78ab84;});}return _0x442a43;})['then'](respondWithResult(_0x337897,0xc9))['catch'](handleError(_0x337897,null));};exports['update']=function(_0x1e1876,_0xfdacc7){if(_0x1e1876[_0x5dbf('0x51')]['id']){delete _0x1e1876['body']['id'];}return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x1e1876[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0xfdacc7,null))['then'](saveUpdates(_0x1e1876[_0x5dbf('0x51')],null))['then'](respondWithResult(_0xfdacc7,null))[_0x5dbf('0x45')](handleError(_0xfdacc7,null));};exports[_0x5dbf('0x21')]=function(_0x2145ea,_0x5da14b){return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x2145ea[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x5da14b,null))[_0x5dbf('0x20')](removeEntity(_0x5da14b,null))['catch'](handleError(_0x5da14b,null));};
\ No newline at end of file
+var _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0x31d0c1,_0x58ce88){var _0x549610=function(_0x2d4240){while(--_0x2d4240){_0x31d0c1['push'](_0x31d0c1['shift']());}};_0x549610(++_0x58ce88);}(_0x6aa7,0x178));var _0x76aa=function(_0x36af89,_0x5c0018){_0x36af89=_0x36af89-0x0;var _0x118b16=_0x6aa7[_0x36af89];return _0x118b16;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index f79ef63..b0c1cd3 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 _0xc1fc=['exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x3d32df,_0x284b12){var _0xed3f9b=function(_0x3ddf87){while(--_0x3ddf87){_0x3d32df['push'](_0x3d32df['shift']());}};_0xed3f9b(++_0x284b12);}(_0xc1fc,0x93));var _0xcc1f=function(_0x76d683,_0xabab61){_0x76d683=_0x76d683-0x0;var _0x4b9df8=_0xc1fc[_0x76d683];return _0x4b9df8;};'use strict';var _=require('lodash');var util=require(_0xcc1f('0x0'));var logger=require(_0xcc1f('0x1'))('api');var moment=require(_0xcc1f('0x2'));var BPromise=require(_0xcc1f('0x3'));var rp=require(_0xcc1f('0x4'));var fs=require('fs');var path=require(_0xcc1f('0x5'));var rimraf=require(_0xcc1f('0x6'));var config=require(_0xcc1f('0x7'));var attributes=require(_0xcc1f('0x8'));module[_0xcc1f('0x9')]=function(_0x493a97,_0x5f448b){return _0x493a97[_0xcc1f('0xa')](_0xcc1f('0xb'),attributes,{'tableName':_0xcc1f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9485=['request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util','../../config/logger','api','bluebird'];(function(_0x519459,_0x327088){var _0x303f78=function(_0x49ba17){while(--_0x49ba17){_0x519459['push'](_0x519459['shift']());}};_0x303f78(++_0x327088);}(_0x9485,0x8b));var _0x5948=function(_0x476d80,_0x29e526){_0x476d80=_0x476d80-0x0;var _0x3d183d=_0x9485[_0x476d80];return _0x3d183d;};'use strict';var _=require(_0x5948('0x0'));var util=require(_0x5948('0x1'));var logger=require(_0x5948('0x2'))(_0x5948('0x3'));var moment=require('moment');var BPromise=require(_0x5948('0x4'));var rp=require(_0x5948('0x5'));var fs=require('fs');var path=require(_0x5948('0x6'));var rimraf=require('rimraf');var config=require(_0x5948('0x7'));var attributes=require(_0x5948('0x8'));module[_0x5948('0x9')]=function(_0x4312a8,_0x19ccdd){return _0x4312a8[_0x5948('0xa')]('AnalyticMetric',attributes,{'tableName':_0x5948('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 427d14a..d7140d4 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 _0x25f0=['http','request','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x2f8ed8,_0x37599b){var _0x5be602=function(_0x189b5f){while(--_0x189b5f){_0x2f8ed8['push'](_0x2f8ed8['shift']());}};_0x5be602(++_0x37599b);}(_0x25f0,0xc7));var _0x025f=function(_0x1b75d0,_0x514923){_0x1b75d0=_0x1b75d0-0x0;var _0x12f0c8=_0x25f0[_0x1b75d0];return _0x12f0c8;};'use strict';var _=require('lodash');var util=require(_0x025f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x025f('0x1'));var fs=require('fs');var Redis=require(_0x025f('0x2'));var db=require(_0x025f('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x025f('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x025f('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x5f5a6f,_0x3acf3c,_0x3c4496){return new BPromise(function(_0x31ad36,_0x33fcfb){return client[_0x025f('0x6')](_0x5f5a6f,_0x3c4496)['then'](function(_0x5534d3){logger[_0x025f('0x7')](_0x025f('0x8'),_0x3acf3c,'request\x20sent');logger[_0x025f('0x9')](_0x025f('0xa'),_0x3acf3c,_0x025f('0xb'),JSON[_0x025f('0xc')](_0x5534d3));if(_0x5534d3[_0x025f('0xd')]){if(_0x5534d3[_0x025f('0xd')]['code']===0x1f4){logger['error'](_0x025f('0x8'),_0x3acf3c,_0x5534d3[_0x025f('0xd')][_0x025f('0xe')]);return _0x33fcfb(_0x5534d3[_0x025f('0xd')]['message']);}logger[_0x025f('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x3acf3c,_0x5534d3[_0x025f('0xd')][_0x025f('0xe')]);return _0x31ad36(_0x5534d3[_0x025f('0xd')][_0x025f('0xe')]);}else{logger[_0x025f('0x7')](_0x025f('0x8'),_0x3acf3c,'request\x20sent');_0x31ad36(_0x5534d3[_0x025f('0xf')][_0x025f('0xe')]);}})[_0x025f('0x10')](function(_0xa1ed27){logger[_0x025f('0xd')](_0x025f('0x8'),_0x3acf3c,_0xa1ed27);_0x33fcfb(_0xa1ed27);});});}
\ No newline at end of file
+var _0x9327=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x388b47,_0x5cdac5){var _0x4859df=function(_0x466a16){while(--_0x466a16){_0x388b47['push'](_0x388b47['shift']());}};_0x4859df(++_0x5cdac5);}(_0x9327,0x1be));var _0x7932=function(_0x18ce11,_0x24c013){_0x18ce11=_0x18ce11-0x0;var _0x3ecc18=_0x9327[_0x18ce11];return _0x3ecc18;};'use strict';var _=require(_0x7932('0x0'));var util=require(_0x7932('0x1'));var moment=require(_0x7932('0x2'));var BPromise=require(_0x7932('0x3'));var rs=require(_0x7932('0x4'));var fs=require('fs');var Redis=require(_0x7932('0x5'));var db=require(_0x7932('0x6'))['db'];var utils=require(_0x7932('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x7932('0x8'));var jayson=require(_0x7932('0x9'));var client=jayson[_0x7932('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29f683,_0x528003,_0x2158a7){return new BPromise(function(_0x4d4fd5,_0x58c986){return client[_0x7932('0xb')](_0x29f683,_0x2158a7)[_0x7932('0xc')](function(_0x365de0){logger[_0x7932('0xd')](_0x7932('0xe'),_0x528003,_0x7932('0xf'));logger[_0x7932('0x10')](_0x7932('0x11'),_0x528003,_0x7932('0xf'),JSON[_0x7932('0x12')](_0x365de0));if(_0x365de0[_0x7932('0x13')]){if(_0x365de0[_0x7932('0x13')]['code']===0x1f4){logger[_0x7932('0x13')](_0x7932('0xe'),_0x528003,_0x365de0[_0x7932('0x13')]['message']);return _0x58c986(_0x365de0[_0x7932('0x13')][_0x7932('0x14')]);}logger[_0x7932('0x13')](_0x7932('0xe'),_0x528003,_0x365de0['error'][_0x7932('0x14')]);return _0x4d4fd5(_0x365de0[_0x7932('0x13')][_0x7932('0x14')]);}else{logger[_0x7932('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x528003,_0x7932('0xf'));_0x4d4fd5(_0x365de0[_0x7932('0x15')][_0x7932('0x14')]);}})[_0x7932('0x16')](function(_0x112890){logger[_0x7932('0x13')](_0x7932('0xe'),_0x528003,_0x112890);_0x58c986(_0x112890);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 07ced1a..0115527 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 _0x3663=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy'];(function(_0x292423,_0x1759b7){var _0x2801cb=function(_0x23c821){while(--_0x23c821){_0x292423['push'](_0x292423['shift']());}};_0x2801cb(++_0x1759b7);}(_0x3663,0x1cf));var _0x3366=function(_0x58f911,_0x28ecb4){_0x58f911=_0x58f911-0x0;var _0x12b4ee=_0x3663[_0x58f911];return _0x12b4ee;};'use strict';var multer=require(_0x3366('0x0'));var util=require(_0x3366('0x1'));var path=require(_0x3366('0x2'));var timeout=require('connect-timeout');var express=require(_0x3366('0x3'));var router=express[_0x3366('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3366('0x5'));var interaction=require(_0x3366('0x6'));var config=require(_0x3366('0x7'));var controller=require(_0x3366('0x8'));router[_0x3366('0x9')]('/',auth['isAuthenticated'](),controller[_0x3366('0xa')]);router[_0x3366('0x9')]('/:id',auth[_0x3366('0xb')](),controller[_0x3366('0xc')]);router[_0x3366('0xd')]('/',auth['isAuthenticated'](),controller[_0x3366('0xe')]);router[_0x3366('0xf')](_0x3366('0x10'),auth['isAuthenticated'](),controller[_0x3366('0x11')]);router[_0x3366('0x12')](_0x3366('0x10'),auth[_0x3366('0xb')](),controller[_0x3366('0x13')]);module[_0x3366('0x14')]=router;
\ No newline at end of file
+var _0x1ffe=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x5cfa2b,_0x5b9ee9){var _0x3bf9d2=function(_0x49f969){while(--_0x49f969){_0x5cfa2b['push'](_0x5cfa2b['shift']());}};_0x3bf9d2(++_0x5b9ee9);}(_0x1ffe,0xa5));var _0xe1ff=function(_0x40f881,_0x341766){_0x40f881=_0x40f881-0x0;var _0x1fc947=_0x1ffe[_0x40f881];return _0x1fc947;};'use strict';var multer=require(_0xe1ff('0x0'));var util=require(_0xe1ff('0x1'));var path=require(_0xe1ff('0x2'));var timeout=require(_0xe1ff('0x3'));var express=require(_0xe1ff('0x4'));var router=express[_0xe1ff('0x5')]();var fs_extra=require(_0xe1ff('0x6'));var auth=require(_0xe1ff('0x7'));var interaction=require(_0xe1ff('0x8'));var config=require(_0xe1ff('0x9'));var controller=require(_0xe1ff('0xa'));router[_0xe1ff('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe1ff('0xb')](_0xe1ff('0xc'),auth[_0xe1ff('0xd')](),controller[_0xe1ff('0xe')]);router[_0xe1ff('0xf')]('/',auth[_0xe1ff('0xd')](),controller[_0xe1ff('0x10')]);router[_0xe1ff('0x11')](_0xe1ff('0xc'),auth[_0xe1ff('0xd')](),controller[_0xe1ff('0x12')]);router['delete'](_0xe1ff('0xc'),auth[_0xe1ff('0xd')](),controller[_0xe1ff('0x13')]);module[_0xe1ff('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 57ee5ff..2064b67 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 _0x477d=['exports','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x477d,0x146));var _0xd477=function(_0x3169cd,_0x448d94){_0x3169cd=_0x3169cd-0x0;var _0xd24ac=_0x477d[_0x3169cd];return _0xd24ac;};'use strict';var Sequelize=require(_0xd477('0x0'));module[_0xd477('0x1')]={'tree':{'type':Sequelize[_0xd477('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x5197=['sequelize','exports','TEXT'];(function(_0x3afc52,_0x3d4196){var _0x4d0792=function(_0x412066){while(--_0x412066){_0x3afc52['push'](_0x3afc52['shift']());}};_0x4d0792(++_0x3d4196);}(_0x5197,0x19b));var _0x7519=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x5197[_0x363ef8];return _0x148822;};'use strict';var Sequelize=require(_0x7519('0x0'));module[_0x7519('0x1')]={'tree':{'type':Sequelize[_0x7519('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index f044216..6c422ae 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 _0x83f9=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto'];(function(_0xfce77c,_0x523d35){var _0x13345a=function(_0x53adcf){while(--_0x53adcf){_0xfce77c['push'](_0xfce77c['shift']());}};_0x13345a(++_0x523d35);}(_0x83f9,0x1c7));var _0x983f=function(_0x2430a6,_0x3303e9){_0x2430a6=_0x2430a6-0x0;var _0x4de8b3=_0x83f9[_0x2430a6];return _0x4de8b3;};'use strict';var emlformat=require(_0x983f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x983f('0x1'));var jsonpatch=require(_0x983f('0x2'));var rp=require(_0x983f('0x3'));var moment=require(_0x983f('0x4'));var BPromise=require(_0x983f('0x5'));var Mustache=require(_0x983f('0x6'));var util=require(_0x983f('0x7'));var path=require(_0x983f('0x8'));var sox=require('sox');var csv=require(_0x983f('0x9'));var ejs=require(_0x983f('0xa'));var fs=require('fs');var fs_extra=require(_0x983f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x983f('0xc'));var jsforce=require(_0x983f('0xd'));var deskjs=require(_0x983f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x983f('0xf'));var Papa=require(_0x983f('0x10'));var Redis=require(_0x983f('0x11'));var authService=require(_0x983f('0x12'));var qs=require(_0x983f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x983f('0x14'));var logger=require(_0x983f('0x15'))('api');var utils=require(_0x983f('0x16'));var config=require(_0x983f('0x17'));var licenseUtil=require(_0x983f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b1f90,_0x348d7b){_0x348d7b=_0x348d7b||0xcc;return function(_0x11c986){if(_0x11c986){return _0x1b1f90[_0x983f('0x19')](_0x348d7b);}return _0x1b1f90[_0x983f('0x1a')](_0x348d7b)['end']();};}function respondWithResult(_0xa6e84a,_0x4406e5){_0x4406e5=_0x4406e5||0xc8;return function(_0x45fd6e){if(_0x45fd6e){return _0xa6e84a[_0x983f('0x1a')](_0x4406e5)[_0x983f('0x1b')](_0x45fd6e);}};}function respondWithFilteredResult(_0x3a50dc,_0x270821){return function(_0x1104e3){if(_0x1104e3){var _0x5a691a=typeof _0x270821[_0x983f('0x1c')]===_0x983f('0x1d')&&typeof _0x270821[_0x983f('0x1e')]===_0x983f('0x1d');var _0x413aed=_0x1104e3['count'];var _0x2d1b6b=_0x5a691a?0x0:_0x270821[_0x983f('0x1c')];var _0x4f0dcb=_0x5a691a?_0x1104e3[_0x983f('0x1f')]:_0x270821['offset']+_0x270821[_0x983f('0x1e')];var _0x41c41c;if(_0x4f0dcb>=_0x413aed){_0x4f0dcb=_0x413aed;_0x41c41c=0xc8;}else{_0x41c41c=0xce;}_0x3a50dc['status'](_0x41c41c);return _0x3a50dc[_0x983f('0x20')](_0x983f('0x21'),_0x2d1b6b+'-'+_0x4f0dcb+'/'+_0x413aed)[_0x983f('0x1b')](_0x1104e3);}return null;};}function patchUpdates(_0xcf9da9){return function(_0x18ef76){try{jsonpatch[_0x983f('0x22')](_0x18ef76,_0xcf9da9,!![]);}catch(_0xed423c){return BPromise[_0x983f('0x23')](_0xed423c);}return _0x18ef76[_0x983f('0x24')]();};}function saveUpdates(_0x4d763e,_0x526cbb){return function(_0x44c419){if(_0x44c419){return _0x44c419[_0x983f('0x25')](_0x4d763e)['then'](function(_0x4c91b3){return _0x4c91b3;});}return null;};}function removeEntity(_0x4bd279,_0x35f45f){return function(_0x380a86){if(_0x380a86){return _0x380a86[_0x983f('0x26')]()[_0x983f('0x27')](function(){_0x4bd279[_0x983f('0x1a')](0xcc)[_0x983f('0x28')]();});}};}function handleEntityNotFound(_0x43cfe3,_0x5217d2){return function(_0x23efea){if(!_0x23efea){_0x43cfe3[_0x983f('0x19')](0x194);}return _0x23efea;};}function handleError(_0x43c964,_0x495f73){_0x495f73=_0x495f73||0x1f4;return function(_0x262dab){logger[_0x983f('0x29')](_0x262dab[_0x983f('0x2a')]);if(_0x262dab[_0x983f('0x2b')]){delete _0x262dab[_0x983f('0x2b')];}_0x43c964[_0x983f('0x1a')](_0x495f73)[_0x983f('0x2c')](_0x262dab);};}exports[_0x983f('0x2d')]=function(_0x4ccb95,_0x404960){var _0x4b8004={},_0x18acdb={},_0x444161={'count':0x0,'rows':[]};var _0x1215ea=_[_0x983f('0x2e')](db[_0x983f('0x2f')][_0x983f('0x30')],function(_0x578078){return{'name':_0x578078[_0x983f('0x31')],'type':_0x578078[_0x983f('0x32')]['key']};});_0x18acdb[_0x983f('0x33')]=_['map'](_0x1215ea,_0x983f('0x2b'));_0x18acdb['query']=_[_0x983f('0x34')](_0x4ccb95['query']);_0x18acdb[_0x983f('0x35')]=_[_0x983f('0x36')](_0x18acdb[_0x983f('0x33')],_0x18acdb[_0x983f('0x37')]);_0x4b8004[_0x983f('0x38')]=_[_0x983f('0x36')](_0x18acdb[_0x983f('0x33')],qs[_0x983f('0x39')](_0x4ccb95[_0x983f('0x37')][_0x983f('0x39')]));_0x4b8004[_0x983f('0x38')]=_0x4b8004[_0x983f('0x38')][_0x983f('0x3a')]?_0x4b8004[_0x983f('0x38')]:_0x18acdb[_0x983f('0x33')];if(!_0x4ccb95[_0x983f('0x37')][_0x983f('0x3b')](_0x983f('0x3c'))){_0x4b8004[_0x983f('0x1e')]=qs[_0x983f('0x1e')](_0x4ccb95['query'][_0x983f('0x1e')]);_0x4b8004[_0x983f('0x1c')]=qs['offset'](_0x4ccb95['query'][_0x983f('0x1c')]);}_0x4b8004[_0x983f('0x3d')]=qs[_0x983f('0x3e')](_0x4ccb95[_0x983f('0x37')][_0x983f('0x3e')]);_0x4b8004[_0x983f('0x3f')]=qs[_0x983f('0x35')](_[_0x983f('0x40')](_0x4ccb95[_0x983f('0x37')],_0x18acdb[_0x983f('0x35')]),_0x1215ea);if(_0x4ccb95[_0x983f('0x37')][_0x983f('0x41')]){_0x4b8004[_0x983f('0x3f')]=_[_0x983f('0x42')](_0x4b8004[_0x983f('0x3f')],{'$or':_[_0x983f('0x2e')](_0x1215ea,function(_0x435918){if(_0x435918[_0x983f('0x32')]!==_0x983f('0x43')){var _0xef2b6e={};_0xef2b6e[_0x435918[_0x983f('0x2b')]]={'$like':'%'+_0x4ccb95[_0x983f('0x37')]['filter']+'%'};return _0xef2b6e;}})});}_0x4b8004=_[_0x983f('0x42')]({},_0x4b8004,_0x4ccb95[_0x983f('0x44')]);var _0x5624ed={'where':_0x4b8004[_0x983f('0x3f')]};return db['AnalyticTreeReport']['count'](_0x5624ed)['then'](function(_0x3a2ccb){_0x444161['count']=_0x3a2ccb;if(_0x4ccb95['query'][_0x983f('0x45')]){_0x4b8004[_0x983f('0x46')]=[{'all':!![]}];}return db[_0x983f('0x2f')]['findAll'](_0x4b8004);})['then'](function(_0x165bd7){_0x444161[_0x983f('0x47')]=_0x165bd7;return _0x444161;})['then'](respondWithFilteredResult(_0x404960,_0x4b8004))[_0x983f('0x48')](handleError(_0x404960,null));};exports[_0x983f('0x49')]=function(_0x14859e,_0x5585b9){var _0x2fe8db={'raw':!![],'where':{'id':_0x14859e[_0x983f('0x4a')]['id']}},_0x461e23={};_0x461e23[_0x983f('0x33')]=_[_0x983f('0x34')](db[_0x983f('0x2f')][_0x983f('0x30')]);_0x461e23['query']=_[_0x983f('0x34')](_0x14859e[_0x983f('0x37')]);_0x461e23[_0x983f('0x35')]=_[_0x983f('0x36')](_0x461e23[_0x983f('0x33')],_0x461e23[_0x983f('0x37')]);_0x2fe8db[_0x983f('0x38')]=_[_0x983f('0x36')](_0x461e23[_0x983f('0x33')],qs[_0x983f('0x39')](_0x14859e[_0x983f('0x37')]['fields']));_0x2fe8db['attributes']=_0x2fe8db[_0x983f('0x38')][_0x983f('0x3a')]?_0x2fe8db['attributes']:_0x461e23[_0x983f('0x33')];if(_0x14859e[_0x983f('0x37')]['includeAll']){_0x2fe8db[_0x983f('0x46')]=[{'all':!![]}];}_0x2fe8db=_[_0x983f('0x42')]({},_0x2fe8db,_0x14859e[_0x983f('0x44')]);return db[_0x983f('0x2f')][_0x983f('0x4b')](_0x2fe8db)[_0x983f('0x27')](handleEntityNotFound(_0x5585b9,null))[_0x983f('0x27')](respondWithResult(_0x5585b9,null))['catch'](handleError(_0x5585b9,null));};exports[_0x983f('0x4c')]=function(_0x5f11ab,_0x4012b9){return db[_0x983f('0x2f')][_0x983f('0x4c')](_0x5f11ab[_0x983f('0x4d')],{})[_0x983f('0x27')](respondWithResult(_0x4012b9,0xc9))[_0x983f('0x48')](handleError(_0x4012b9,null));};exports[_0x983f('0x25')]=function(_0x359c7a,_0x5ac2a5){if(_0x359c7a[_0x983f('0x4d')]['id']){delete _0x359c7a[_0x983f('0x4d')]['id'];}return db[_0x983f('0x2f')][_0x983f('0x4b')]({'where':{'id':_0x359c7a['params']['id']}})['then'](handleEntityNotFound(_0x5ac2a5,null))[_0x983f('0x27')](saveUpdates(_0x359c7a['body'],null))[_0x983f('0x27')](respondWithResult(_0x5ac2a5,null))[_0x983f('0x48')](handleError(_0x5ac2a5,null));};exports[_0x983f('0x26')]=function(_0x4614c4,_0x47ffcc){return db['AnalyticTreeReport'][_0x983f('0x4b')]({'where':{'id':_0x4614c4[_0x983f('0x4a')]['id']}})[_0x983f('0x27')](handleEntityNotFound(_0x47ffcc,null))[_0x983f('0x27')](removeEntity(_0x47ffcc,null))[_0x983f('0x48')](handleError(_0x47ffcc,null));};
\ No newline at end of file
+var _0xa5a5=['filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','then','destroy','error','name','send','map','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick'];(function(_0x2fa32b,_0x181a36){var _0x25f18c=function(_0x4ec865){while(--_0x4ec865){_0x2fa32b['push'](_0x2fa32b['shift']());}};_0x25f18c(++_0x181a36);}(_0xa5a5,0xe5));var _0x5a5a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xa5a5[_0x4ff09b];return _0x3f5c2e;};'use strict';var emlformat=require(_0x5a5a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a5a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5a5a('0x2'));var BPromise=require(_0x5a5a('0x3'));var Mustache=require(_0x5a5a('0x4'));var util=require(_0x5a5a('0x5'));var path=require(_0x5a5a('0x6'));var sox=require(_0x5a5a('0x7'));var csv=require(_0x5a5a('0x8'));var ejs=require(_0x5a5a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a5a('0xa'));var squel=require(_0x5a5a('0xb'));var crypto=require(_0x5a5a('0xc'));var jsforce=require(_0x5a5a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5a5a('0xe'));var Papa=require('papaparse');var Redis=require(_0x5a5a('0xf'));var authService=require(_0x5a5a('0x10'));var qs=require(_0x5a5a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5a5a('0x12'))(_0x5a5a('0x13'));var utils=require('../../config/utils');var config=require(_0x5a5a('0x14'));var licenseUtil=require(_0x5a5a('0x15'));var db=require(_0x5a5a('0x16'))['db'];function respondWithStatusCode(_0xc043a6,_0x1744e5){_0x1744e5=_0x1744e5||0xcc;return function(_0x19fbf4){if(_0x19fbf4){return _0xc043a6[_0x5a5a('0x17')](_0x1744e5);}return _0xc043a6[_0x5a5a('0x18')](_0x1744e5)[_0x5a5a('0x19')]();};}function respondWithResult(_0x592a26,_0x47ace5){_0x47ace5=_0x47ace5||0xc8;return function(_0x562b7f){if(_0x562b7f){return _0x592a26[_0x5a5a('0x18')](_0x47ace5)['json'](_0x562b7f);}};}function respondWithFilteredResult(_0x3d05ff,_0x166d1e){return function(_0xe84150){if(_0xe84150){var _0x44feb3=typeof _0x166d1e[_0x5a5a('0x1a')]==='undefined'&&typeof _0x166d1e[_0x5a5a('0x1b')]===_0x5a5a('0x1c');var _0x10ee18=_0xe84150[_0x5a5a('0x1d')];var _0x1b496=_0x44feb3?0x0:_0x166d1e[_0x5a5a('0x1a')];var _0x23fd1c=_0x44feb3?_0xe84150['count']:_0x166d1e[_0x5a5a('0x1a')]+_0x166d1e[_0x5a5a('0x1b')];var _0x223d4d;if(_0x23fd1c>=_0x10ee18){_0x23fd1c=_0x10ee18;_0x223d4d=0xc8;}else{_0x223d4d=0xce;}_0x3d05ff[_0x5a5a('0x18')](_0x223d4d);return _0x3d05ff[_0x5a5a('0x1e')](_0x5a5a('0x1f'),_0x1b496+'-'+_0x23fd1c+'/'+_0x10ee18)[_0x5a5a('0x20')](_0xe84150);}return null;};}function patchUpdates(_0x1ac5c4){return function(_0x4389f2){try{jsonpatch[_0x5a5a('0x21')](_0x4389f2,_0x1ac5c4,!![]);}catch(_0x330972){return BPromise['reject'](_0x330972);}return _0x4389f2[_0x5a5a('0x22')]();};}function saveUpdates(_0x199f1a,_0x38355b){return function(_0x3e06c5){if(_0x3e06c5){return _0x3e06c5['update'](_0x199f1a)[_0x5a5a('0x23')](function(_0x33a86c){return _0x33a86c;});}return null;};}function removeEntity(_0x21192c,_0x30da98){return function(_0x195a0c){if(_0x195a0c){return _0x195a0c[_0x5a5a('0x24')]()['then'](function(){_0x21192c['status'](0xcc)[_0x5a5a('0x19')]();});}};}function handleEntityNotFound(_0x4cd27f,_0x284478){return function(_0xab1d9e){if(!_0xab1d9e){_0x4cd27f['sendStatus'](0x194);}return _0xab1d9e;};}function handleError(_0x1a0a5b,_0x1ac391){_0x1ac391=_0x1ac391||0x1f4;return function(_0x5a538f){logger[_0x5a5a('0x25')](_0x5a538f['stack']);if(_0x5a538f[_0x5a5a('0x26')]){delete _0x5a538f[_0x5a5a('0x26')];}_0x1a0a5b['status'](_0x1ac391)[_0x5a5a('0x27')](_0x5a538f);};}exports['index']=function(_0x3326d2,_0x59d653){var _0x45f27a={},_0x3c4ea1={},_0xecabdf={'count':0x0,'rows':[]};var _0x4598a8=_[_0x5a5a('0x28')](db['AnalyticTreeReport'][_0x5a5a('0x29')],function(_0x4174fb){return{'name':_0x4174fb['fieldName'],'type':_0x4174fb['type']['key']};});_0x3c4ea1[_0x5a5a('0x2a')]=_['map'](_0x4598a8,'name');_0x3c4ea1[_0x5a5a('0x2b')]=_[_0x5a5a('0x2c')](_0x3326d2[_0x5a5a('0x2b')]);_0x3c4ea1[_0x5a5a('0x2d')]=_[_0x5a5a('0x2e')](_0x3c4ea1[_0x5a5a('0x2a')],_0x3c4ea1[_0x5a5a('0x2b')]);_0x45f27a['attributes']=_['intersection'](_0x3c4ea1[_0x5a5a('0x2a')],qs[_0x5a5a('0x2f')](_0x3326d2[_0x5a5a('0x2b')][_0x5a5a('0x2f')]));_0x45f27a['attributes']=_0x45f27a[_0x5a5a('0x30')][_0x5a5a('0x31')]?_0x45f27a['attributes']:_0x3c4ea1[_0x5a5a('0x2a')];if(!_0x3326d2[_0x5a5a('0x2b')]['hasOwnProperty'](_0x5a5a('0x32'))){_0x45f27a[_0x5a5a('0x1b')]=qs[_0x5a5a('0x1b')](_0x3326d2[_0x5a5a('0x2b')][_0x5a5a('0x1b')]);_0x45f27a[_0x5a5a('0x1a')]=qs[_0x5a5a('0x1a')](_0x3326d2[_0x5a5a('0x2b')][_0x5a5a('0x1a')]);}_0x45f27a[_0x5a5a('0x33')]=qs[_0x5a5a('0x34')](_0x3326d2[_0x5a5a('0x2b')]['sort']);_0x45f27a[_0x5a5a('0x35')]=qs[_0x5a5a('0x2d')](_[_0x5a5a('0x36')](_0x3326d2['query'],_0x3c4ea1[_0x5a5a('0x2d')]),_0x4598a8);if(_0x3326d2['query'][_0x5a5a('0x37')]){_0x45f27a[_0x5a5a('0x35')]=_[_0x5a5a('0x38')](_0x45f27a['where'],{'$or':_[_0x5a5a('0x28')](_0x4598a8,function(_0x2bb704){if(_0x2bb704['type']!==_0x5a5a('0x39')){var _0x5bc3fe={};_0x5bc3fe[_0x2bb704['name']]={'$like':'%'+_0x3326d2[_0x5a5a('0x2b')][_0x5a5a('0x37')]+'%'};return _0x5bc3fe;}})});}_0x45f27a=_[_0x5a5a('0x38')]({},_0x45f27a,_0x3326d2[_0x5a5a('0x3a')]);var _0x41044b={'where':_0x45f27a[_0x5a5a('0x35')]};return db[_0x5a5a('0x3b')]['count'](_0x41044b)[_0x5a5a('0x23')](function(_0x1aaa49){_0xecabdf[_0x5a5a('0x1d')]=_0x1aaa49;if(_0x3326d2[_0x5a5a('0x2b')][_0x5a5a('0x3c')]){_0x45f27a[_0x5a5a('0x3d')]=[{'all':!![]}];}return db[_0x5a5a('0x3b')][_0x5a5a('0x3e')](_0x45f27a);})[_0x5a5a('0x23')](function(_0x5d44e5){_0xecabdf[_0x5a5a('0x3f')]=_0x5d44e5;return _0xecabdf;})['then'](respondWithFilteredResult(_0x59d653,_0x45f27a))[_0x5a5a('0x40')](handleError(_0x59d653,null));};exports[_0x5a5a('0x41')]=function(_0x401aa4,_0x4941fb){var _0x4b206b={'raw':!![],'where':{'id':_0x401aa4[_0x5a5a('0x42')]['id']}},_0x1fd4fa={};_0x1fd4fa[_0x5a5a('0x2a')]=_[_0x5a5a('0x2c')](db[_0x5a5a('0x3b')][_0x5a5a('0x29')]);_0x1fd4fa[_0x5a5a('0x2b')]=_['keys'](_0x401aa4[_0x5a5a('0x2b')]);_0x1fd4fa[_0x5a5a('0x2d')]=_[_0x5a5a('0x2e')](_0x1fd4fa[_0x5a5a('0x2a')],_0x1fd4fa[_0x5a5a('0x2b')]);_0x4b206b[_0x5a5a('0x30')]=_[_0x5a5a('0x2e')](_0x1fd4fa[_0x5a5a('0x2a')],qs[_0x5a5a('0x2f')](_0x401aa4[_0x5a5a('0x2b')]['fields']));_0x4b206b[_0x5a5a('0x30')]=_0x4b206b[_0x5a5a('0x30')][_0x5a5a('0x31')]?_0x4b206b[_0x5a5a('0x30')]:_0x1fd4fa[_0x5a5a('0x2a')];if(_0x401aa4['query'][_0x5a5a('0x3c')]){_0x4b206b[_0x5a5a('0x3d')]=[{'all':!![]}];}_0x4b206b=_[_0x5a5a('0x38')]({},_0x4b206b,_0x401aa4[_0x5a5a('0x3a')]);return db['AnalyticTreeReport'][_0x5a5a('0x43')](_0x4b206b)[_0x5a5a('0x23')](handleEntityNotFound(_0x4941fb,null))[_0x5a5a('0x23')](respondWithResult(_0x4941fb,null))[_0x5a5a('0x40')](handleError(_0x4941fb,null));};exports[_0x5a5a('0x44')]=function(_0x22dde0,_0x4a917f){return db[_0x5a5a('0x3b')][_0x5a5a('0x44')](_0x22dde0['body'],{})[_0x5a5a('0x23')](respondWithResult(_0x4a917f,0xc9))['catch'](handleError(_0x4a917f,null));};exports[_0x5a5a('0x45')]=function(_0x2ac22c,_0x158ea1){if(_0x2ac22c[_0x5a5a('0x46')]['id']){delete _0x2ac22c['body']['id'];}return db[_0x5a5a('0x3b')][_0x5a5a('0x43')]({'where':{'id':_0x2ac22c[_0x5a5a('0x42')]['id']}})[_0x5a5a('0x23')](handleEntityNotFound(_0x158ea1,null))[_0x5a5a('0x23')](saveUpdates(_0x2ac22c['body'],null))['then'](respondWithResult(_0x158ea1,null))[_0x5a5a('0x40')](handleError(_0x158ea1,null));};exports[_0x5a5a('0x24')]=function(_0xe9f27e,_0x4c9d77){return db[_0x5a5a('0x3b')][_0x5a5a('0x43')]({'where':{'id':_0xe9f27e[_0x5a5a('0x42')]['id']}})[_0x5a5a('0x23')](handleEntityNotFound(_0x4c9d77,null))['then'](removeEntity(_0x4c9d77,null))[_0x5a5a('0x40')](handleError(_0x4c9d77,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 376fe6a..3bda9f0 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 _0x06d2=['api','moment','request-promise','path','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees'];(function(_0x58462a,_0x1ce850){var _0x2931ef=function(_0x4a3185){while(--_0x4a3185){_0x58462a['push'](_0x58462a['shift']());}};_0x2931ef(++_0x1ce850);}(_0x06d2,0xb4));var _0x206d=function(_0x289673,_0x57183a){_0x289673=_0x289673-0x0;var _0x21274e=_0x06d2[_0x289673];return _0x21274e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x206d('0x0'));var moment=require(_0x206d('0x1'));var BPromise=require('bluebird');var rp=require(_0x206d('0x2'));var fs=require('fs');var path=require(_0x206d('0x3'));var rimraf=require('rimraf');var config=require(_0x206d('0x4'));var attributes=require(_0x206d('0x5'));module[_0x206d('0x6')]=function(_0x20288e,_0x48e658){return _0x20288e[_0x206d('0x7')]('AnalyticTreeReport',attributes,{'tableName':_0x206d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc85a=['exports','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','request-promise','../../config/environment','./analyticTreeReport.attributes'];(function(_0x1e9993,_0x517a0d){var _0x1cb53b=function(_0xf1f206){while(--_0xf1f206){_0x1e9993['push'](_0x1e9993['shift']());}};_0x1cb53b(++_0x517a0d);}(_0xc85a,0xc2));var _0xac85=function(_0x41c3e5,_0x2cb474){_0x41c3e5=_0x41c3e5-0x0;var _0x58f28a=_0xc85a[_0x41c3e5];return _0x58f28a;};'use strict';var _=require(_0xac85('0x0'));var util=require('util');var logger=require(_0xac85('0x1'))(_0xac85('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xac85('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac85('0x4'));var attributes=require(_0xac85('0x5'));module[_0xac85('0x6')]=function(_0x262bd2,_0xd98ee0){return _0x262bd2[_0xac85('0x7')](_0xac85('0x8'),attributes,{'tableName':_0xac85('0x9'),'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 ce80f73..eb0af92 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x4b4290,_0x1726d9){var _0xbde1e0=function(_0x29ef39){while(--_0x29ef39){_0x4b4290['push'](_0x4b4290['shift']());}};_0xbde1e0(++_0x1726d9);}(_0x1261,0x144));var _0x1126=function(_0x42d1f8,_0x22e529){_0x42d1f8=_0x42d1f8-0x0;var _0x40d234=_0x1261[_0x42d1f8];return _0x40d234;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x4dd16d,_0x5e4f7b){_0x4dd16d=_0x4dd16d-0x0;var _0x1a1312=_0x7a54[_0x4dd16d];return _0x1a1312;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index edb493d..d4bad67 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 _0x1e41=['index','/:id','post','create','put','delete','destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2c8a0a,_0x5456a5){var _0x48a7d9=function(_0x2f360b){while(--_0x2f360b){_0x2c8a0a['push'](_0x2c8a0a['shift']());}};_0x48a7d9(++_0x5456a5);}(_0x1e41,0x151));var _0x11e4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1e41[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x11e4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x11e4('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x11e4('0x2'));var auth=require(_0x11e4('0x3'));var interaction=require(_0x11e4('0x4'));var config=require(_0x11e4('0x5'));var controller=require('./analyticTreeReport.controller');router[_0x11e4('0x6')]('/',auth[_0x11e4('0x7')](),controller[_0x11e4('0x8')]);router[_0x11e4('0x6')](_0x11e4('0x9'),auth[_0x11e4('0x7')](),controller['show']);router[_0x11e4('0xa')]('/',auth[_0x11e4('0x7')](),controller[_0x11e4('0xb')]);router[_0x11e4('0xc')](_0x11e4('0x9'),auth[_0x11e4('0x7')](),controller['update']);router[_0x11e4('0xd')](_0x11e4('0x9'),auth[_0x11e4('0x7')](),controller[_0x11e4('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xf656=['post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x2d8e75,_0x2b0757){var _0x52c809=function(_0x36a2d1){while(--_0x36a2d1){_0x2d8e75['push'](_0x2d8e75['shift']());}};_0x52c809(++_0x2b0757);}(_0xf656,0x15b));var _0x6f65=function(_0x427ff0,_0x435d5a){_0x427ff0=_0x427ff0-0x0;var _0x5e9c09=_0xf656[_0x427ff0];return _0x5e9c09;};'use strict';var multer=require(_0x6f65('0x0'));var util=require(_0x6f65('0x1'));var path=require(_0x6f65('0x2'));var timeout=require('connect-timeout');var express=require(_0x6f65('0x3'));var router=express[_0x6f65('0x4')]();var fs_extra=require(_0x6f65('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6f65('0x6'));var config=require(_0x6f65('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x6f65('0x8')]('/',auth[_0x6f65('0x9')](),controller[_0x6f65('0xa')]);router[_0x6f65('0x8')](_0x6f65('0xb'),auth[_0x6f65('0x9')](),controller[_0x6f65('0xc')]);router[_0x6f65('0xd')]('/',auth[_0x6f65('0x9')](),controller[_0x6f65('0xe')]);router[_0x6f65('0xf')](_0x6f65('0xb'),auth[_0x6f65('0x9')](),controller[_0x6f65('0x10')]);router[_0x6f65('0x11')]('/:id',auth[_0x6f65('0x9')](),controller[_0x6f65('0x12')]);module[_0x6f65('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 729eed7..75cda10 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 _0x818f=['sequelize','exports','STRING'];(function(_0x134ac5,_0x302c22){var _0x54893c=function(_0x30dc06){while(--_0x30dc06){_0x134ac5['push'](_0x134ac5['shift']());}};_0x54893c(++_0x302c22);}(_0x818f,0x1da));var _0xf818=function(_0x38a4a7,_0x40fb67){_0x38a4a7=_0x38a4a7-0x0;var _0x31e4a3=_0x818f[_0x38a4a7];return _0x31e4a3;};'use strict';var Sequelize=require(_0xf818('0x0'));module[_0xf818('0x1')]={'name':{'type':Sequelize[_0xf818('0x2')]},'basename':{'type':Sequelize[_0xf818('0x2')]},'type':{'type':Sequelize[_0xf818('0x2')]}};
\ No newline at end of file
+var _0x8664=['sequelize','exports','STRING'];(function(_0x13a864,_0x25535e){var _0x536fa7=function(_0x336d8b){while(--_0x336d8b){_0x13a864['push'](_0x13a864['shift']());}};_0x536fa7(++_0x25535e);}(_0x8664,0x11a));var _0x4866=function(_0x9b0cac,_0x11caf8){_0x9b0cac=_0x9b0cac-0x0;var _0x1475a8=_0x8664[_0x9b0cac];return _0x1475a8;};'use strict';var Sequelize=require(_0x4866('0x0'));module[_0x4866('0x1')]={'name':{'type':Sequelize[_0x4866('0x2')]},'basename':{'type':Sequelize[_0x4866('0x2')]},'type':{'type':Sequelize[_0x4866('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index c5def51..1f6ff6a 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 _0x7069=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','name','index','map','rawAttributes','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','filter','Attachment','includeAll','include','findAll','rows','show','params','length','options','find','catch','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','server/files/attachments/','offline-chat/','join','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x2279ad,_0x467d8d){var _0x5b51d9=function(_0x26e830){while(--_0x26e830){_0x2279ad['push'](_0x2279ad['shift']());}};_0x5b51d9(++_0x467d8d);}(_0x7069,0x9b));var _0x9706=function(_0x1d074e,_0x1a4cd3){_0x1d074e=_0x1d074e-0x0;var _0x2ff036=_0x7069[_0x1d074e];return _0x2ff036;};'use strict';var emlformat=require(_0x9706('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9706('0x1'));var jsonpatch=require(_0x9706('0x2'));var rp=require(_0x9706('0x3'));var moment=require(_0x9706('0x4'));var BPromise=require(_0x9706('0x5'));var Mustache=require(_0x9706('0x6'));var util=require('util');var path=require(_0x9706('0x7'));var sox=require(_0x9706('0x8'));var csv=require(_0x9706('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9706('0xa'));var _=require(_0x9706('0xb'));var squel=require(_0x9706('0xc'));var crypto=require(_0x9706('0xd'));var jsforce=require(_0x9706('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9706('0x9'));var querystring=require(_0x9706('0xf'));var Papa=require(_0x9706('0x10'));var Redis=require(_0x9706('0x11'));var authService=require(_0x9706('0x12'));var qs=require(_0x9706('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9706('0x14'));var logger=require('../../config/logger')(_0x9706('0x15'));var utils=require(_0x9706('0x16'));var config=require(_0x9706('0x17'));var licenseUtil=require(_0x9706('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x373aa1,_0x2e652f){_0x2e652f=_0x2e652f||0xcc;return function(_0x14be07){if(_0x14be07){return _0x373aa1[_0x9706('0x19')](_0x2e652f);}return _0x373aa1[_0x9706('0x1a')](_0x2e652f)[_0x9706('0x1b')]();};}function respondWithResult(_0x5a63d1,_0x3bcb88){_0x3bcb88=_0x3bcb88||0xc8;return function(_0x3ed864){if(_0x3ed864){return _0x5a63d1[_0x9706('0x1a')](_0x3bcb88)[_0x9706('0x1c')](_0x3ed864);}};}function respondWithFilteredResult(_0xa5d4a3,_0x1e8110){return function(_0x13e0ba){if(_0x13e0ba){var _0x4152a9=typeof _0x1e8110['offset']===_0x9706('0x1d')&&typeof _0x1e8110[_0x9706('0x1e')]==='undefined';var _0x162a69=_0x13e0ba[_0x9706('0x1f')];var _0x462e2a=_0x4152a9?0x0:_0x1e8110[_0x9706('0x20')];var _0x3b252e=_0x4152a9?_0x13e0ba[_0x9706('0x1f')]:_0x1e8110['offset']+_0x1e8110[_0x9706('0x1e')];var _0x32ec98;if(_0x3b252e>=_0x162a69){_0x3b252e=_0x162a69;_0x32ec98=0xc8;}else{_0x32ec98=0xce;}_0xa5d4a3[_0x9706('0x1a')](_0x32ec98);return _0xa5d4a3['set'](_0x9706('0x21'),_0x462e2a+'-'+_0x3b252e+'/'+_0x162a69)['json'](_0x13e0ba);}return null;};}function patchUpdates(_0x488090){return function(_0x69271a){try{jsonpatch[_0x9706('0x22')](_0x69271a,_0x488090,!![]);}catch(_0x3ff053){return BPromise['reject'](_0x3ff053);}return _0x69271a[_0x9706('0x23')]();};}function saveUpdates(_0x31ef84,_0x191dbf){return function(_0x1839f8){if(_0x1839f8){return _0x1839f8[_0x9706('0x24')](_0x31ef84)[_0x9706('0x25')](function(_0x26be91){return _0x26be91;});}return null;};}function removeEntity(_0x34e111,_0x14a14a){return function(_0x3167be){if(_0x3167be){return _0x3167be[_0x9706('0x26')]()[_0x9706('0x25')](function(){_0x34e111['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2123c4,_0x1679c6){return function(_0x57b211){if(!_0x57b211){_0x2123c4[_0x9706('0x19')](0x194);}return _0x57b211;};}function handleError(_0x28b3e0,_0x8670f5){_0x8670f5=_0x8670f5||0x1f4;return function(_0x2f0c8a){logger[_0x9706('0x27')](_0x2f0c8a['stack']);if(_0x2f0c8a[_0x9706('0x28')]){delete _0x2f0c8a[_0x9706('0x28')];}_0x28b3e0[_0x9706('0x1a')](_0x8670f5)['send'](_0x2f0c8a);};}exports[_0x9706('0x29')]=function(_0x19dbe7,_0x6b7717){var _0x3ffaf2={},_0x57fe64={},_0x1f220e={'count':0x0,'rows':[]};var _0xd2f1f6=_[_0x9706('0x2a')](db['Attachment'][_0x9706('0x2b')],function(_0x3325b9){return{'name':_0x3325b9['fieldName'],'type':_0x3325b9['type'][_0x9706('0x2c')]};});_0x57fe64['model']=_[_0x9706('0x2a')](_0xd2f1f6,'name');_0x57fe64[_0x9706('0x2d')]=_[_0x9706('0x2e')](_0x19dbe7[_0x9706('0x2d')]);_0x57fe64['filters']=_[_0x9706('0x2f')](_0x57fe64[_0x9706('0x30')],_0x57fe64[_0x9706('0x2d')]);_0x3ffaf2[_0x9706('0x31')]=_[_0x9706('0x2f')](_0x57fe64['model'],qs[_0x9706('0x32')](_0x19dbe7['query']['fields']));_0x3ffaf2[_0x9706('0x31')]=_0x3ffaf2[_0x9706('0x31')]['length']?_0x3ffaf2['attributes']:_0x57fe64['model'];if(!_0x19dbe7[_0x9706('0x2d')][_0x9706('0x33')](_0x9706('0x34'))){_0x3ffaf2[_0x9706('0x1e')]=qs['limit'](_0x19dbe7['query'][_0x9706('0x1e')]);_0x3ffaf2['offset']=qs[_0x9706('0x20')](_0x19dbe7[_0x9706('0x2d')][_0x9706('0x20')]);}_0x3ffaf2[_0x9706('0x35')]=qs[_0x9706('0x36')](_0x19dbe7['query'][_0x9706('0x36')]);_0x3ffaf2[_0x9706('0x37')]=qs[_0x9706('0x38')](_[_0x9706('0x39')](_0x19dbe7[_0x9706('0x2d')],_0x57fe64[_0x9706('0x38')]),_0xd2f1f6);if(_0x19dbe7[_0x9706('0x2d')]['filter']){_0x3ffaf2[_0x9706('0x37')]=_[_0x9706('0x3a')](_0x3ffaf2[_0x9706('0x37')],{'$or':_[_0x9706('0x2a')](_0xd2f1f6,function(_0x21892e){if(_0x21892e[_0x9706('0x3b')]!=='VIRTUAL'){var _0x309675={};_0x309675[_0x21892e[_0x9706('0x28')]]={'$like':'%'+_0x19dbe7[_0x9706('0x2d')][_0x9706('0x3c')]+'%'};return _0x309675;}})});}_0x3ffaf2=_[_0x9706('0x3a')]({},_0x3ffaf2,_0x19dbe7['options']);var _0x149289={'where':_0x3ffaf2[_0x9706('0x37')]};return db[_0x9706('0x3d')][_0x9706('0x1f')](_0x149289)[_0x9706('0x25')](function(_0x4ac47e){_0x1f220e[_0x9706('0x1f')]=_0x4ac47e;if(_0x19dbe7[_0x9706('0x2d')][_0x9706('0x3e')]){_0x3ffaf2[_0x9706('0x3f')]=[{'all':!![]}];}return db['Attachment'][_0x9706('0x40')](_0x3ffaf2);})[_0x9706('0x25')](function(_0x504dc7){_0x1f220e[_0x9706('0x41')]=_0x504dc7;return _0x1f220e;})['then'](respondWithFilteredResult(_0x6b7717,_0x3ffaf2))['catch'](handleError(_0x6b7717,null));};exports[_0x9706('0x42')]=function(_0x1c66ab,_0x56406c){var _0x1274d6={'raw':!![],'where':{'id':_0x1c66ab[_0x9706('0x43')]['id']}},_0x3d9d5e={};_0x3d9d5e[_0x9706('0x30')]=_[_0x9706('0x2e')](db['Attachment']['rawAttributes']);_0x3d9d5e[_0x9706('0x2d')]=_[_0x9706('0x2e')](_0x1c66ab['query']);_0x3d9d5e[_0x9706('0x38')]=_[_0x9706('0x2f')](_0x3d9d5e[_0x9706('0x30')],_0x3d9d5e[_0x9706('0x2d')]);_0x1274d6[_0x9706('0x31')]=_['intersection'](_0x3d9d5e['model'],qs[_0x9706('0x32')](_0x1c66ab[_0x9706('0x2d')]['fields']));_0x1274d6[_0x9706('0x31')]=_0x1274d6[_0x9706('0x31')][_0x9706('0x44')]?_0x1274d6['attributes']:_0x3d9d5e[_0x9706('0x30')];if(_0x1c66ab['query']['includeAll']){_0x1274d6[_0x9706('0x3f')]=[{'all':!![]}];}_0x1274d6=_['merge']({},_0x1274d6,_0x1c66ab[_0x9706('0x45')]);return db['Attachment'][_0x9706('0x46')](_0x1274d6)['then'](handleEntityNotFound(_0x56406c,null))[_0x9706('0x25')](respondWithResult(_0x56406c,null))[_0x9706('0x47')](handleError(_0x56406c,null));};exports['clone']=function(_0x336d3b,_0x36c265){var _0x5b6488={'where':{'id':_0x336d3b[_0x9706('0x43')]['id']}},_0xc489a5={};_0xc489a5[_0x9706('0x30')]=_[_0x9706('0x2e')](db[_0x9706('0x3d')][_0x9706('0x2b')]);_0x5b6488[_0x9706('0x31')]=_['intersection'](_0xc489a5['model'],qs['fields'](_0x336d3b['query'][_0x9706('0x32')]));_0x5b6488['attributes']=_0x5b6488[_0x9706('0x31')][_0x9706('0x44')]?_0x5b6488[_0x9706('0x31')]:_0xc489a5[_0x9706('0x30')];if(_0x336d3b[_0x9706('0x2d')][_0x9706('0x3e')]){_0x5b6488[_0x9706('0x3f')]=[{'all':!![]}];}_0x5b6488=_['merge']({},_0x5b6488,_0x336d3b['options']);return db[_0x9706('0x3d')][_0x9706('0x46')](_0x5b6488)[_0x9706('0x25')](handleEntityNotFound(_0x36c265,null))[_0x9706('0x25')](function(_0x32c4d9){if(_0x32c4d9){var _0x42dccb=_0x32c4d9[_0x9706('0x48')]({'plain':!![]});_0x42dccb=qs[_0x9706('0x49')](_0x42dccb,['id',_0x9706('0x4a'),_0x9706('0x4b')]);_0x336d3b['body']=_['omit'](_0x336d3b[_0x9706('0x4c')],['id',_0x9706('0x4a'),'updatedAt']);return db['Attachment'][_0x9706('0x4d')](_[_0x9706('0x3a')](_0x42dccb,_0x336d3b[_0x9706('0x4c')]),{'include':_0x336d3b[_0x9706('0x2d')][_0x9706('0x3e')]?[{'all':!![]}]:undefined});}})[_0x9706('0x25')](respondWithResult(_0x36c265,0xc9))[_0x9706('0x47')](handleError(_0x36c265,null));};exports[_0x9706('0x24')]=function(_0x246435,_0x53c879){if(_0x246435[_0x9706('0x4c')]['id']){delete _0x246435[_0x9706('0x4c')]['id'];}return db[_0x9706('0x3d')][_0x9706('0x46')]({'where':{'id':_0x246435[_0x9706('0x43')]['id']}})[_0x9706('0x25')](handleEntityNotFound(_0x53c879,null))['then'](saveUpdates(_0x246435['body'],null))[_0x9706('0x25')](respondWithResult(_0x53c879,null))[_0x9706('0x47')](handleError(_0x53c879,null));};exports[_0x9706('0x26')]=function(_0x557428,_0x2fd10d){return db['Attachment'][_0x9706('0x46')]({'where':{'id':_0x557428[_0x9706('0x43')]['id']}})['then'](handleEntityNotFound(_0x2fd10d,null))[_0x9706('0x25')](removeEntity(_0x2fd10d,null))['catch'](handleError(_0x2fd10d,null));};exports[_0x9706('0x4d')]=function(_0x29b613,_0x5c5657,_0x1b8000){_0x29b613['body'][_0x9706('0x28')]=_0x29b613[_0x9706('0x4e')][_0x9706('0x4f')];_0x29b613['body'][_0x9706('0x50')]=_0x29b613[_0x9706('0x4e')][_0x9706('0x51')];_0x29b613[_0x9706('0x4c')]['type']=_0x29b613[_0x9706('0x4e')][_0x9706('0x52')];return db[_0x9706('0x3d')][_0x9706('0x4d')](_0x29b613[_0x9706('0x4c')])[_0x9706('0x25')](respondWithResult(_0x5c5657,0xc9))[_0x9706('0x47')](handleError(_0x5c5657,null));};exports['download']=function(_0x302924,_0x1d4255,_0x4713c3){return db['Attachment'][_0x9706('0x53')]({'where':{'id':_0x302924[_0x9706('0x43')]['id']},'raw':!![]})[_0x9706('0x25')](handleEntityNotFound(_0x1d4255,null))[_0x9706('0x25')](function(_0x2d2528){if(_0x2d2528){var _0x49b6cf=_0x2d2528[_0x9706('0x54')]!==null;var _0x2afc50=path['join'](config['root'],_0x9706('0x55'));if(_0x49b6cf){_0x2afc50=path['join'](_0x2afc50,_0x9706('0x56'));}var _0xbfc5f1=path[_0x9706('0x57')](_0x2afc50,_0x2d2528[_0x9706('0x50')]);return _0x1d4255['download'](_0xbfc5f1);}})['catch'](handleError(_0x1d4255,null));};
\ No newline at end of file
+var _0xf8cf=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','error','stack','name','index','map','Attachment','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','keys','length','options','catch','clone','params','find','get','updatedAt','body','createdAt','create','update','file','filename','findOne','ChatOfflineMessageId','join','offline-chat/','basename','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring'];(function(_0x2ce39f,_0x38b640){var _0x4c5756=function(_0x14e29a){while(--_0x14e29a){_0x2ce39f['push'](_0x2ce39f['shift']());}};_0x4c5756(++_0x38b640);}(_0xf8cf,0x199));var _0xff8c=function(_0x3258d7,_0x24c14a){_0x3258d7=_0x3258d7-0x0;var _0x507314=_0xf8cf[_0x3258d7];return _0x507314;};'use strict';var emlformat=require(_0xff8c('0x0'));var rimraf=require(_0xff8c('0x1'));var zipdir=require(_0xff8c('0x2'));var jsonpatch=require(_0xff8c('0x3'));var rp=require(_0xff8c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xff8c('0x5'));var util=require(_0xff8c('0x6'));var path=require(_0xff8c('0x7'));var sox=require(_0xff8c('0x8'));var csv=require(_0xff8c('0x9'));var ejs=require(_0xff8c('0xa'));var fs=require('fs');var fs_extra=require(_0xff8c('0xb'));var _=require(_0xff8c('0xc'));var squel=require(_0xff8c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xff8c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xff8c('0xf'));var Papa=require(_0xff8c('0x10'));var Redis=require('ioredis');var authService=require(_0xff8c('0x11'));var qs=require(_0xff8c('0x12'));var as=require(_0xff8c('0x13'));var hardwareService=require(_0xff8c('0x14'));var logger=require('../../config/logger')(_0xff8c('0x15'));var utils=require(_0xff8c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xff8c('0x17'));var db=require(_0xff8c('0x18'))['db'];function respondWithStatusCode(_0x3769df,_0x22858a){_0x22858a=_0x22858a||0xcc;return function(_0xb47805){if(_0xb47805){return _0x3769df[_0xff8c('0x19')](_0x22858a);}return _0x3769df[_0xff8c('0x1a')](_0x22858a)[_0xff8c('0x1b')]();};}function respondWithResult(_0x46b750,_0x34fa04){_0x34fa04=_0x34fa04||0xc8;return function(_0x49cfaf){if(_0x49cfaf){return _0x46b750[_0xff8c('0x1a')](_0x34fa04)[_0xff8c('0x1c')](_0x49cfaf);}};}function respondWithFilteredResult(_0x18f490,_0x2a4503){return function(_0x46d420){if(_0x46d420){var _0x458e5b=typeof _0x2a4503[_0xff8c('0x1d')]===_0xff8c('0x1e')&&typeof _0x2a4503[_0xff8c('0x1f')]===_0xff8c('0x1e');var _0x2890ad=_0x46d420[_0xff8c('0x20')];var _0xd8461d=_0x458e5b?0x0:_0x2a4503[_0xff8c('0x1d')];var _0x268058=_0x458e5b?_0x46d420[_0xff8c('0x20')]:_0x2a4503[_0xff8c('0x1d')]+_0x2a4503[_0xff8c('0x1f')];var _0xf9b94d;if(_0x268058>=_0x2890ad){_0x268058=_0x2890ad;_0xf9b94d=0xc8;}else{_0xf9b94d=0xce;}_0x18f490['status'](_0xf9b94d);return _0x18f490['set']('Content-Range',_0xd8461d+'-'+_0x268058+'/'+_0x2890ad)['json'](_0x46d420);}return null;};}function patchUpdates(_0x293083){return function(_0x5dcb24){try{jsonpatch[_0xff8c('0x21')](_0x5dcb24,_0x293083,!![]);}catch(_0x20bce2){return BPromise[_0xff8c('0x22')](_0x20bce2);}return _0x5dcb24[_0xff8c('0x23')]();};}function saveUpdates(_0x405429,_0x40711c){return function(_0x19b1db){if(_0x19b1db){return _0x19b1db['update'](_0x405429)[_0xff8c('0x24')](function(_0x4c6368){return _0x4c6368;});}return null;};}function removeEntity(_0x414e0c,_0x59802f){return function(_0x1702b0){if(_0x1702b0){return _0x1702b0['destroy']()[_0xff8c('0x24')](function(){_0x414e0c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x299139,_0x2e659d){return function(_0x1a2bf7){if(!_0x1a2bf7){_0x299139[_0xff8c('0x19')](0x194);}return _0x1a2bf7;};}function handleError(_0x35f494,_0x157271){_0x157271=_0x157271||0x1f4;return function(_0x1541d3){logger[_0xff8c('0x25')](_0x1541d3[_0xff8c('0x26')]);if(_0x1541d3[_0xff8c('0x27')]){delete _0x1541d3[_0xff8c('0x27')];}_0x35f494[_0xff8c('0x1a')](_0x157271)['send'](_0x1541d3);};}exports[_0xff8c('0x28')]=function(_0x1bdaf8,_0x2df16a){var _0x587235={},_0xebbc0f={},_0x1a5f12={'count':0x0,'rows':[]};var _0xf499c5=_[_0xff8c('0x29')](db[_0xff8c('0x2a')][_0xff8c('0x2b')],function(_0xe39923){return{'name':_0xe39923['fieldName'],'type':_0xe39923[_0xff8c('0x2c')][_0xff8c('0x2d')]};});_0xebbc0f[_0xff8c('0x2e')]=_[_0xff8c('0x29')](_0xf499c5,_0xff8c('0x27'));_0xebbc0f[_0xff8c('0x2f')]=_['keys'](_0x1bdaf8['query']);_0xebbc0f[_0xff8c('0x30')]=_[_0xff8c('0x31')](_0xebbc0f[_0xff8c('0x2e')],_0xebbc0f[_0xff8c('0x2f')]);_0x587235[_0xff8c('0x32')]=_[_0xff8c('0x31')](_0xebbc0f[_0xff8c('0x2e')],qs[_0xff8c('0x33')](_0x1bdaf8['query'][_0xff8c('0x33')]));_0x587235[_0xff8c('0x32')]=_0x587235['attributes']['length']?_0x587235[_0xff8c('0x32')]:_0xebbc0f[_0xff8c('0x2e')];if(!_0x1bdaf8[_0xff8c('0x2f')][_0xff8c('0x34')](_0xff8c('0x35'))){_0x587235[_0xff8c('0x1f')]=qs[_0xff8c('0x1f')](_0x1bdaf8[_0xff8c('0x2f')]['limit']);_0x587235[_0xff8c('0x1d')]=qs['offset'](_0x1bdaf8[_0xff8c('0x2f')][_0xff8c('0x1d')]);}_0x587235[_0xff8c('0x36')]=qs['sort'](_0x1bdaf8['query']['sort']);_0x587235[_0xff8c('0x37')]=qs['filters'](_[_0xff8c('0x38')](_0x1bdaf8[_0xff8c('0x2f')],_0xebbc0f[_0xff8c('0x30')]),_0xf499c5);if(_0x1bdaf8[_0xff8c('0x2f')][_0xff8c('0x39')]){_0x587235['where']=_[_0xff8c('0x3a')](_0x587235[_0xff8c('0x37')],{'$or':_[_0xff8c('0x29')](_0xf499c5,function(_0x3990c9){if(_0x3990c9['type']!==_0xff8c('0x3b')){var _0x2c41fe={};_0x2c41fe[_0x3990c9[_0xff8c('0x27')]]={'$like':'%'+_0x1bdaf8[_0xff8c('0x2f')][_0xff8c('0x39')]+'%'};return _0x2c41fe;}})});}_0x587235=_[_0xff8c('0x3a')]({},_0x587235,_0x1bdaf8['options']);var _0xe73e8={'where':_0x587235[_0xff8c('0x37')]};return db[_0xff8c('0x2a')]['count'](_0xe73e8)[_0xff8c('0x24')](function(_0xf4c18e){_0x1a5f12[_0xff8c('0x20')]=_0xf4c18e;if(_0x1bdaf8[_0xff8c('0x2f')][_0xff8c('0x3c')]){_0x587235[_0xff8c('0x3d')]=[{'all':!![]}];}return db[_0xff8c('0x2a')][_0xff8c('0x3e')](_0x587235);})[_0xff8c('0x24')](function(_0x2a1eb3){_0x1a5f12['rows']=_0x2a1eb3;return _0x1a5f12;})[_0xff8c('0x24')](respondWithFilteredResult(_0x2df16a,_0x587235))['catch'](handleError(_0x2df16a,null));};exports[_0xff8c('0x3f')]=function(_0x3fc815,_0x1dc626){var _0x20f4ef={'raw':!![],'where':{'id':_0x3fc815['params']['id']}},_0x15a152={};_0x15a152[_0xff8c('0x2e')]=_[_0xff8c('0x40')](db['Attachment']['rawAttributes']);_0x15a152[_0xff8c('0x2f')]=_[_0xff8c('0x40')](_0x3fc815[_0xff8c('0x2f')]);_0x15a152[_0xff8c('0x30')]=_[_0xff8c('0x31')](_0x15a152[_0xff8c('0x2e')],_0x15a152[_0xff8c('0x2f')]);_0x20f4ef[_0xff8c('0x32')]=_['intersection'](_0x15a152['model'],qs['fields'](_0x3fc815['query'][_0xff8c('0x33')]));_0x20f4ef[_0xff8c('0x32')]=_0x20f4ef[_0xff8c('0x32')][_0xff8c('0x41')]?_0x20f4ef[_0xff8c('0x32')]:_0x15a152['model'];if(_0x3fc815[_0xff8c('0x2f')]['includeAll']){_0x20f4ef[_0xff8c('0x3d')]=[{'all':!![]}];}_0x20f4ef=_['merge']({},_0x20f4ef,_0x3fc815[_0xff8c('0x42')]);return db[_0xff8c('0x2a')]['find'](_0x20f4ef)[_0xff8c('0x24')](handleEntityNotFound(_0x1dc626,null))[_0xff8c('0x24')](respondWithResult(_0x1dc626,null))[_0xff8c('0x43')](handleError(_0x1dc626,null));};exports[_0xff8c('0x44')]=function(_0x25a664,_0x123e8a){var _0x3fb54b={'where':{'id':_0x25a664[_0xff8c('0x45')]['id']}},_0x506e83={};_0x506e83[_0xff8c('0x2e')]=_[_0xff8c('0x40')](db[_0xff8c('0x2a')][_0xff8c('0x2b')]);_0x3fb54b[_0xff8c('0x32')]=_[_0xff8c('0x31')](_0x506e83[_0xff8c('0x2e')],qs[_0xff8c('0x33')](_0x25a664['query'][_0xff8c('0x33')]));_0x3fb54b[_0xff8c('0x32')]=_0x3fb54b['attributes'][_0xff8c('0x41')]?_0x3fb54b['attributes']:_0x506e83[_0xff8c('0x2e')];if(_0x25a664[_0xff8c('0x2f')][_0xff8c('0x3c')]){_0x3fb54b[_0xff8c('0x3d')]=[{'all':!![]}];}_0x3fb54b=_[_0xff8c('0x3a')]({},_0x3fb54b,_0x25a664[_0xff8c('0x42')]);return db[_0xff8c('0x2a')][_0xff8c('0x46')](_0x3fb54b)['then'](handleEntityNotFound(_0x123e8a,null))[_0xff8c('0x24')](function(_0x1005bb){if(_0x1005bb){var _0x5e3e8f=_0x1005bb[_0xff8c('0x47')]({'plain':!![]});_0x5e3e8f=qs['omit'](_0x5e3e8f,['id','createdAt',_0xff8c('0x48')]);_0x25a664[_0xff8c('0x49')]=_['omit'](_0x25a664[_0xff8c('0x49')],['id',_0xff8c('0x4a'),'updatedAt']);return db[_0xff8c('0x2a')][_0xff8c('0x4b')](_[_0xff8c('0x3a')](_0x5e3e8f,_0x25a664[_0xff8c('0x49')]),{'include':_0x25a664['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0xff8c('0x24')](respondWithResult(_0x123e8a,0xc9))[_0xff8c('0x43')](handleError(_0x123e8a,null));};exports[_0xff8c('0x4c')]=function(_0x1dabd3,_0xb03957){if(_0x1dabd3[_0xff8c('0x49')]['id']){delete _0x1dabd3[_0xff8c('0x49')]['id'];}return db['Attachment'][_0xff8c('0x46')]({'where':{'id':_0x1dabd3['params']['id']}})[_0xff8c('0x24')](handleEntityNotFound(_0xb03957,null))[_0xff8c('0x24')](saveUpdates(_0x1dabd3[_0xff8c('0x49')],null))[_0xff8c('0x24')](respondWithResult(_0xb03957,null))[_0xff8c('0x43')](handleError(_0xb03957,null));};exports['destroy']=function(_0x193ec9,_0x684edc){return db[_0xff8c('0x2a')][_0xff8c('0x46')]({'where':{'id':_0x193ec9[_0xff8c('0x45')]['id']}})['then'](handleEntityNotFound(_0x684edc,null))[_0xff8c('0x24')](removeEntity(_0x684edc,null))[_0xff8c('0x43')](handleError(_0x684edc,null));};exports['create']=function(_0x2be596,_0x562d24,_0x558dd8){_0x2be596[_0xff8c('0x49')][_0xff8c('0x27')]=_0x2be596[_0xff8c('0x4d')]['originalname'];_0x2be596[_0xff8c('0x49')]['basename']=_0x2be596[_0xff8c('0x4d')][_0xff8c('0x4e')];_0x2be596['body'][_0xff8c('0x2c')]=_0x2be596['file']['mimetype'];return db[_0xff8c('0x2a')][_0xff8c('0x4b')](_0x2be596[_0xff8c('0x49')])['then'](respondWithResult(_0x562d24,0xc9))[_0xff8c('0x43')](handleError(_0x562d24,null));};exports['download']=function(_0x275f32,_0x28eb05,_0x52191a){return db[_0xff8c('0x2a')][_0xff8c('0x4f')]({'where':{'id':_0x275f32[_0xff8c('0x45')]['id']},'raw':!![]})[_0xff8c('0x24')](handleEntityNotFound(_0x28eb05,null))[_0xff8c('0x24')](function(_0x1069d9){if(_0x1069d9){var _0x5270d8=_0x1069d9[_0xff8c('0x50')]!==null;var _0x2e6d4c=path[_0xff8c('0x51')](config['root'],'server/files/attachments/');if(_0x5270d8){_0x2e6d4c=path[_0xff8c('0x51')](_0x2e6d4c,_0xff8c('0x52'));}var _0x149559=path['join'](_0x2e6d4c,_0x1069d9[_0xff8c('0x53')]);return _0x28eb05[_0xff8c('0x54')](_0x149559);}})[_0xff8c('0x43')](handleError(_0x28eb05,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 8925214..8e137fa 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 _0x7c46=['../../config/environment','./attachment.attributes','Attachment','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x149145,_0x352f93){var _0x9db71b=function(_0x5df39f){while(--_0x5df39f){_0x149145['push'](_0x149145['shift']());}};_0x9db71b(++_0x352f93);}(_0x7c46,0x100));var _0x67c4=function(_0x31c70c,_0x145807){_0x31c70c=_0x31c70c-0x0;var _0x3fc86b=_0x7c46[_0x31c70c];return _0x3fc86b;};'use strict';var _=require(_0x67c4('0x0'));var util=require(_0x67c4('0x1'));var logger=require('../../config/logger')(_0x67c4('0x2'));var moment=require(_0x67c4('0x3'));var BPromise=require(_0x67c4('0x4'));var rp=require(_0x67c4('0x5'));var fs=require('fs');var path=require(_0x67c4('0x6'));var rimraf=require(_0x67c4('0x7'));var config=require(_0x67c4('0x8'));var attributes=require(_0x67c4('0x9'));module['exports']=function(_0x2647e4,_0x3500f9){return _0x2647e4['define'](_0x67c4('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6933=['define','Attachment','attachments','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./attachment.attributes','exports'];(function(_0x49a942,_0x25068f){var _0x2835de=function(_0x2c349c){while(--_0x2c349c){_0x49a942['push'](_0x49a942['shift']());}};_0x2835de(++_0x25068f);}(_0x6933,0xc6));var _0x3693=function(_0x35268e,_0x4acfd1){_0x35268e=_0x35268e-0x0;var _0x28ba11=_0x6933[_0x35268e];return _0x28ba11;};'use strict';var _=require(_0x3693('0x0'));var util=require(_0x3693('0x1'));var logger=require(_0x3693('0x2'))(_0x3693('0x3'));var moment=require(_0x3693('0x4'));var BPromise=require('bluebird');var rp=require(_0x3693('0x5'));var fs=require('fs');var path=require(_0x3693('0x6'));var rimraf=require('rimraf');var config=require(_0x3693('0x7'));var attributes=require(_0x3693('0x8'));module[_0x3693('0x9')]=function(_0x32a877,_0x125d1d){return _0x32a877[_0x3693('0xa')](_0x3693('0xb'),attributes,{'tableName':_0x3693('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 6b67f00..ceecafd 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 _0xd49c=['body','options','raw','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateAttachment','create'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xd49c,0x1d8));var _0xcd49=function(_0x1766b6,_0x8052b0){_0x1766b6=_0x1766b6-0x0;var _0x11dc3d=_0xd49c[_0x1766b6];return _0x11dc3d;};'use strict';var _=require('lodash');var util=require(_0xcd49('0x0'));var moment=require('moment');var BPromise=require(_0xcd49('0x1'));var rs=require(_0xcd49('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd49('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd49('0x4'))('rpc');var config=require(_0xcd49('0x5'));var jayson=require(_0xcd49('0x6'));var client=jayson[_0xcd49('0x7')][_0xcd49('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x704584,_0x22f64b,_0x321013){return new BPromise(function(_0x17f26f,_0x3742e1){return client[_0xcd49('0x9')](_0x704584,_0x321013)[_0xcd49('0xa')](function(_0x4b7316){logger[_0xcd49('0xb')](_0xcd49('0xc'),_0x22f64b,_0xcd49('0xd'));logger[_0xcd49('0xe')](_0xcd49('0xf'),_0x22f64b,_0xcd49('0xd'),JSON[_0xcd49('0x10')](_0x4b7316));if(_0x4b7316[_0xcd49('0x11')]){if(_0x4b7316[_0xcd49('0x11')][_0xcd49('0x12')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x22f64b,_0x4b7316[_0xcd49('0x11')][_0xcd49('0x13')]);return _0x3742e1(_0x4b7316[_0xcd49('0x11')]['message']);}logger[_0xcd49('0x11')](_0xcd49('0xc'),_0x22f64b,_0x4b7316['error'][_0xcd49('0x13')]);return _0x17f26f(_0x4b7316[_0xcd49('0x11')][_0xcd49('0x13')]);}else{logger[_0xcd49('0xb')](_0xcd49('0xc'),_0x22f64b,_0xcd49('0xd'));_0x17f26f(_0x4b7316['result']['message']);}})['catch'](function(_0x4dabea){logger[_0xcd49('0x11')](_0xcd49('0xc'),_0x22f64b,_0x4dabea);_0x3742e1(_0x4dabea);});});}exports[_0xcd49('0x14')]=function(_0x484900){var _0x3074a4=this;return new Promise(function(_0x5f2ecb,_0x9c7262){return db['Attachment'][_0xcd49('0x15')](_0x484900[_0xcd49('0x16')],{'raw':_0x484900[_0xcd49('0x17')]?_0x484900[_0xcd49('0x17')][_0xcd49('0x18')]===undefined?!![]:![]:!![]})[_0xcd49('0xa')](function(_0x1c40a6){logger[_0xcd49('0xb')](_0xcd49('0x14'),_0x484900);logger['debug'](_0xcd49('0x14'),_0x484900,JSON[_0xcd49('0x10')](_0x1c40a6));_0x5f2ecb(_0x1c40a6);})[_0xcd49('0x19')](function(_0x5829d1){logger['error']('CreateAttachment',_0x5829d1[_0xcd49('0x13')],_0x484900);_0x9c7262(_0x3074a4[_0xcd49('0x11')](0x1f4,_0x5829d1['message']));});});};
\ No newline at end of file
+var _0x00bb=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','Attachment','body','options','then','CreateAttachment','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','Attachment,\x20%s,\x20%s'];(function(_0x35863f,_0x4f3a04){var _0x35a567=function(_0x192d22){while(--_0x192d22){_0x35863f['push'](_0x35863f['shift']());}};_0x35a567(++_0x4f3a04);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x00bb[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});}exports['CreateAttachment']=function(_0x2a7231){var _0x599347=this;return new Promise(function(_0x415f91,_0x5aa9a0){return db[_0xb00b('0x12')]['create'](_0x2a7231[_0xb00b('0x13')],{'raw':_0x2a7231[_0xb00b('0x14')]?_0x2a7231['options']['raw']===undefined?!![]:![]:!![]})[_0xb00b('0x15')](function(_0x4a334b){logger[_0xb00b('0x9')](_0xb00b('0x16'),_0x2a7231);logger[_0xb00b('0xc')](_0xb00b('0x16'),_0x2a7231,JSON['stringify'](_0x4a334b));_0x415f91(_0x4a334b);})[_0xb00b('0x11')](function(_0x4df284){logger[_0xb00b('0xf')](_0xb00b('0x16'),_0x4df284['message'],_0x2a7231);_0x5aa9a0(_0x599347[_0xb00b('0xf')](0x1f4,_0x4df284[_0xb00b('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index eb45a93..58fdc48 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x7d0afd,_0x220310){var _0x112426=function(_0x2e85cb){while(--_0x2e85cb){_0x7d0afd['push'](_0x7d0afd['shift']());}};_0x112426(++_0x220310);}(_0xadb5,0xad));var _0x5adb=function(_0x1d81cd,_0x854c20){_0x1d81cd=_0x1d81cd-0x0;var _0xab87b5=_0xadb5[_0x1d81cd];return _0xab87b5;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x48f637,_0x196f2){var _0x2aa226=function(_0x3367f4){while(--_0x3367f4){_0x48f637['push'](_0x48f637['shift']());}};_0x2aa226(++_0x196f2);}(_0xadb5,0xad));var _0x5adb=function(_0x4fd451,_0xcc0801){_0x4fd451=_0x4fd451-0x0;var _0x160342=_0xadb5[_0x4fd451];return _0x160342;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 9d6ee7b..19fd19e 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 _0x7649=['inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','admin','user','agent','disabled','blockedAt','add','minutes','getLicense','catch','status','send','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','use','User','passport','passport-local','Strategy','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s'];(function(_0x5d2840,_0x3233e3){var _0x5f3555=function(_0x5550d0){while(--_0x5550d0){_0x5d2840['push'](_0x5d2840['shift']());}};_0x5f3555(++_0x3233e3);}(_0x7649,0x11f));var _0x9764=function(_0x274989,_0x34a495){_0x274989=_0x274989-0x0;var _0x334ac5=_0x7649[_0x274989];return _0x334ac5;};'use strict';var passport=require(_0x9764('0x0'));var LocalStrategy=require(_0x9764('0x1'))[_0x9764('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x9764('0x3'));var BPromise=require('bluebird');var util=require(_0x9764('0x4'));var db=require(_0x9764('0x5'))['db'];var authService=require(_0x9764('0x6'));var utils=require(_0x9764('0x7'));var config=require(_0x9764('0x8'));var logger=require(_0x9764('0x9'))(_0x9764('0xa'));function isActiveDirectoryConfigured(_0x41e071){var _0x4a1e07=![];if(typeof _0x41e071[_0x9764('0xb')]!==_0x9764('0xc')){_0x4a1e07=_0x41e071[_0x9764('0xb')][_0x9764('0xd')]&&_0x41e071[_0x9764('0xb')][_0x9764('0xe')]&&_0x41e071[_0x9764('0xb')][_0x9764('0xf')];}return _0x4a1e07;}function adAuthenticate(_0x3addca,_0x1b957c,_0x221d33){return new BPromise(function(_0xafef82,_0x343186){try{var _0x1a858f=new ActiveDirectory(_0x3addca);_0x1a858f[_0x9764('0x10')](_0x1b957c,_0x221d33,function(_0x208675,_0x5e7c01){if(_0x208675){logger[_0x9764('0x11')](_0x9764('0x12'),_0x1b957c,util[_0x9764('0x13')](_0x208675,{'showHidden':![],'depth':null}));_0x343186(_0x9764('0x14'));}else if(!_0x5e7c01){logger[_0x9764('0x11')](_0x9764('0x15'),_0x1b957c);_0x343186('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xafef82(_0x5e7c01);}});}catch(_0x4f0ab9){_0x343186(_0x4f0ab9);}});}function ActiveDirectoryAuthenticate(_0x7a19d7,_0x110ff1,_0x5abb2d,_0x301c37){var _0x276fa8,_0x258705;if(!isActiveDirectoryConfigured(config)){logger[_0x9764('0x11')](_0x9764('0x16'),_0x110ff1);return _0x301c37(null,![],{'message':_0x9764('0x14')});}return db[_0x9764('0x17')][_0x9764('0x18')]({'where':{'id':0x1},'attributes':[_0x9764('0x19'),_0x9764('0x1a')],'raw':!![]})[_0x9764('0x1b')](function(_0x46bbd8){_0x276fa8=_0x46bbd8;if(!_0x276fa8['adSsoEnabled']){logger[_0x9764('0x11')](_0x9764('0x1c'),_0x110ff1);throw new Error(_0x9764('0x14'));}return _0x7a19d7[_0x9764('0x18')]({'attributes':['id',_0x9764('0x1d'),_0x9764('0x1e'),_0x9764('0x1f'),_0x9764('0x20'),'disabled',_0x9764('0x21'),'blockedAt','online'],'where':{'name':_0x110ff1,'role':{'$or':[_0x9764('0x22'),_0x9764('0x23'),_0x9764('0x24')]},'adSsoEnabled':!![]}});})['then'](function(_0x155d35){if(!_0x155d35||_0x155d35&&_0x155d35['name']!==_0x110ff1){throw new Error(_0x9764('0x14'));}_0x258705=_0x155d35;var _0x33a3c2=_0x258705[_0x9764('0x1d')]+'@'+config[_0x9764('0xb')]['domain'];return adAuthenticate(config[_0x9764('0xb')],_0x33a3c2,_0x5abb2d);})[_0x9764('0x1b')](function(_0x3223b3){if(_0x258705[_0x9764('0x25')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x276fa8[_0x9764('0x1a')]>0x0){if(_0x258705[_0x9764('0x21')]){if(moment(_0x258705[_0x9764('0x26')])[_0x9764('0x27')](_0x276fa8[_0x9764('0x1a')],_0x9764('0x28'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x258705,0x0,![],null)[_0x9764('0x1b')](function(){return utils['getLicense'](_0x258705);})[_0x9764('0x1b')](function(){return _0x301c37(null,_0x258705);});}else{return utils[_0x9764('0x29')](_0x258705)['then'](function(){return _0x301c37(null,_0x258705);});}}else{return utils['getLicense'](_0x258705)[_0x9764('0x1b')](function(){return _0x301c37(null,_0x258705);});}})[_0x9764('0x2a')](function(_0x695359){return _0x301c37(null,![],_0x695359);});}function handleError(_0x363afb,_0x4ead44,_0x5ef3cd){return _0x363afb[_0x9764('0x2b')](_0x4ead44||0x1f4)[_0x9764('0x2c')]({'message':_0x5ef3cd?_0x5ef3cd[_0x9764('0x2d')]||_0x5ef3cd:''});}exports['login']=function(_0x100baf,_0x252e3b,_0x5ba766){passport['authenticate']('ad-login',function(_0x427050,_0x5956d3,_0x3b5596){var _0x48fb7a=_0x427050||_0x3b5596;if(_0x48fb7a){return handleError(_0x252e3b,0x191,_0x48fb7a);}if(!_0x5956d3){return handleError(_0x252e3b,0x194,{'message':_0x9764('0x2e')});}else{var _0x562611={'payload':{'id':_0x5956d3['id'],'role':_0x5956d3[_0x9764('0x20')]},'options':{'expiresIn':0x15180}};return authService[_0x9764('0x2f')](_0x562611)[_0x9764('0x1b')](function(_0x175da3){_0x252e3b['json']({'id':_0x5956d3['id'],'token':_0x175da3,'statusCall':'','isAlreadyLogged':_0x5956d3[_0x9764('0x30')]});});}})(_0x100baf,_0x252e3b,_0x5ba766);};passport[_0x9764('0x31')]('ad-login',new LocalStrategy({'usernameField':_0x9764('0x1d'),'passwordField':_0x9764('0x1e')},function(_0x304d23,_0x54a9f3,_0x34ec33){return ActiveDirectoryAuthenticate(db[_0x9764('0x32')],_0x304d23,_0x54a9f3,_0x34ec33);}));
\ No newline at end of file
+var _0x787c=['../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','baseDN','url','domain','authenticate','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','password','salt','role','disabled','blocked','blockedAt','online','admin','user','then','name','add','minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','signToken','json','use','User','passport','passport-local','moment','activedirectory2','bluebird','../../mysqldb'];(function(_0x1e8cb5,_0x2ecea0){var _0x969afb=function(_0x25b36c){while(--_0x25b36c){_0x1e8cb5['push'](_0x1e8cb5['shift']());}};_0x969afb(++_0x2ecea0);}(_0x787c,0xbe));var _0xc787=function(_0x106c55,_0x3bef8a){_0x106c55=_0x106c55-0x0;var _0x18cc48=_0x787c[_0x106c55];return _0x18cc48;};'use strict';var passport=require(_0xc787('0x0'));var LocalStrategy=require(_0xc787('0x1'))['Strategy'];var moment=require(_0xc787('0x2'));var ActiveDirectory=require(_0xc787('0x3'));var BPromise=require(_0xc787('0x4'));var util=require('util');var db=require(_0xc787('0x5'))['db'];var authService=require(_0xc787('0x6'));var utils=require(_0xc787('0x7'));var config=require(_0xc787('0x8'));var logger=require(_0xc787('0x9'))(_0xc787('0xa'));function isActiveDirectoryConfigured(_0x1865b9){var _0x5a3048=![];if(typeof _0x1865b9['activedirectory']!=='undefined'){_0x5a3048=_0x1865b9[_0xc787('0xb')][_0xc787('0xc')]&&_0x1865b9['activedirectory'][_0xc787('0xd')]&&_0x1865b9[_0xc787('0xb')][_0xc787('0xe')];}return _0x5a3048;}function adAuthenticate(_0x1771b9,_0xe75816,_0x1b5280){return new BPromise(function(_0x3e520d,_0xab38b3){try{var _0x38cd1e=new ActiveDirectory(_0x1771b9);_0x38cd1e[_0xc787('0xf')](_0xe75816,_0x1b5280,function(_0xd9baca,_0x4afaf3){if(_0xd9baca){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0xe75816,util[_0xc787('0x10')](_0xd9baca,{'showHidden':![],'depth':null}));_0xab38b3(_0xc787('0x11'));}else if(!_0x4afaf3){logger[_0xc787('0x12')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0xe75816);_0xab38b3(_0xc787('0x11'));}else{_0x3e520d(_0x4afaf3);}});}catch(_0xc23137){_0xab38b3(_0xc23137);}});}function ActiveDirectoryAuthenticate(_0x99b033,_0x499d8b,_0x2e3fbf,_0x1ffef0){var _0x4aea25,_0x3327b9;if(!isActiveDirectoryConfigured(config)){logger[_0xc787('0x12')](_0xc787('0x13'),_0x499d8b);return _0x1ffef0(null,![],{'message':_0xc787('0x11')});}return db[_0xc787('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0xc787('0x15'),_0xc787('0x16')],'raw':!![]})['then'](function(_0x367929){_0x4aea25=_0x367929;if(!_0x4aea25[_0xc787('0x15')]){logger[_0xc787('0x12')](_0xc787('0x17'),_0x499d8b);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x99b033[_0xc787('0x18')]({'attributes':['id','name',_0xc787('0x19'),_0xc787('0x1a'),_0xc787('0x1b'),_0xc787('0x1c'),_0xc787('0x1d'),_0xc787('0x1e'),_0xc787('0x1f')],'where':{'name':_0x499d8b,'role':{'$or':[_0xc787('0x20'),_0xc787('0x21'),'agent']},'adSsoEnabled':!![]}});})[_0xc787('0x22')](function(_0x32dffc){if(!_0x32dffc||_0x32dffc&&_0x32dffc[_0xc787('0x23')]!==_0x499d8b){throw new Error(_0xc787('0x11'));}_0x3327b9=_0x32dffc;var _0x321dbf=_0x3327b9[_0xc787('0x23')]+'@'+config[_0xc787('0xb')][_0xc787('0xe')];return adAuthenticate(config[_0xc787('0xb')],_0x321dbf,_0x2e3fbf);})[_0xc787('0x22')](function(_0x58f0f8){if(_0x3327b9[_0xc787('0x1c')]){throw new Error(_0xc787('0x11'));}if(_0x4aea25[_0xc787('0x16')]>0x0){if(_0x3327b9[_0xc787('0x1d')]){if(moment(_0x3327b9[_0xc787('0x1e')])[_0xc787('0x24')](_0x4aea25[_0xc787('0x16')],_0xc787('0x25'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xc787('0x26')](_0x3327b9,0x0,![],null)[_0xc787('0x22')](function(){return utils[_0xc787('0x27')](_0x3327b9);})['then'](function(){return _0x1ffef0(null,_0x3327b9);});}else{return utils['getLicense'](_0x3327b9)[_0xc787('0x22')](function(){return _0x1ffef0(null,_0x3327b9);});}}else{return utils['getLicense'](_0x3327b9)['then'](function(){return _0x1ffef0(null,_0x3327b9);});}})[_0xc787('0x28')](function(_0x575887){return _0x1ffef0(null,![],_0x575887);});}function handleError(_0xd60968,_0x5dbc6e,_0x2e8f10){return _0xd60968[_0xc787('0x29')](_0x5dbc6e||0x1f4)['send']({'message':_0x2e8f10?_0x2e8f10[_0xc787('0x2a')]||_0x2e8f10:''});}exports[_0xc787('0x2b')]=function(_0x3a5240,_0xabb96b,_0x41a450){passport[_0xc787('0xf')](_0xc787('0x2c'),function(_0xdb7944,_0x46c7f9,_0x471e57){var _0x42157e=_0xdb7944||_0x471e57;if(_0x42157e){return handleError(_0xabb96b,0x191,_0x42157e);}if(!_0x46c7f9){return handleError(_0xabb96b,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x248a62={'payload':{'id':_0x46c7f9['id'],'role':_0x46c7f9['role']},'options':{'expiresIn':0x15180}};return authService[_0xc787('0x2d')](_0x248a62)['then'](function(_0x16bee6){_0xabb96b[_0xc787('0x2e')]({'id':_0x46c7f9['id'],'token':_0x16bee6,'statusCall':'','isAlreadyLogged':_0x46c7f9['online']});});}})(_0x3a5240,_0xabb96b,_0x41a450);};passport[_0xc787('0x2f')](_0xc787('0x2c'),new LocalStrategy({'usernameField':_0xc787('0x23'),'passwordField':'password'},function(_0x292c8a,_0x261b5e,_0x207aa3){return ActiveDirectoryAuthenticate(db[_0xc787('0x30')],_0x292c8a,_0x261b5e,_0x207aa3);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 11c60ec..894842e 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 _0x9c45=['post','login','Router','./authActiveDirectory.controller'];(function(_0x2b1a98,_0x4c9c43){var _0x457556=function(_0x4e2c1c){while(--_0x4e2c1c){_0x2b1a98['push'](_0x2b1a98['shift']());}};_0x457556(++_0x4c9c43);}(_0x9c45,0x12a));var _0x59c4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9c45[_0x14add3];return _0x4a174f;};'use strict';var express=require('express');var router=express[_0x59c4('0x0')]();var controller=require(_0x59c4('0x1'));router[_0x59c4('0x2')]('/',controller[_0x59c4('0x3')]);module['exports']=router;
\ No newline at end of file
+var _0x5d07=['express','post','login','exports'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0x5d07,0xa0));var _0x75d0=function(_0x33c619,_0x4f7c37){_0x33c619=_0x33c619-0x0;var _0xde7647=_0x5d07[_0x33c619];return _0xde7647;};'use strict';var express=require(_0x75d0('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router[_0x75d0('0x1')]('/',controller[_0x75d0('0x2')]);module[_0x75d0('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index ead9bb6..98531cd 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(_0x24fb83,_0x18caba){var _0x445a66=function(_0x3e4a23){while(--_0x3e4a23){_0x24fb83['push'](_0x24fb83['shift']());}};_0x445a66(++_0x18caba);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x7a54,0x106));var _0x47a5=function(_0x2e89fb,_0x3d3db6){_0x2e89fb=_0x2e89fb-0x0;var _0x1d07dc=_0x7a54[_0x2e89fb];return _0x1d07dc;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 037c734..9c4c39f 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 _0xf5be=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','isMiddleware','setTokenCookie','express'];(function(_0x48475b,_0x4d3077){var _0x3b241a=function(_0x5c4a49){while(--_0x5c4a49){_0x48475b['push'](_0x48475b['shift']());}};_0x3b241a(++_0x4d3077);}(_0xf5be,0x107));var _0xef5b=function(_0x20e255,_0x1cf24a){_0x20e255=_0x20e255-0x0;var _0x4c9db6=_0xf5be[_0x20e255];return _0x4c9db6;};'use strict';var express=require(_0xef5b('0x0'));var passport=require(_0xef5b('0x1'));var router=express[_0xef5b('0x2')]();var controller=require(_0xef5b('0x3'));var userController=require(_0xef5b('0x4'));var authService=require(_0xef5b('0x5'));router['get']('/',controller[_0xef5b('0x6')]);router[_0xef5b('0x7')](_0xef5b('0x8'),controller[_0xef5b('0x9')],authService[_0xef5b('0xa')],userController[_0xef5b('0x6')],authService[_0xef5b('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0xe0ad=['login','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware'];(function(_0x220865,_0x5726be){var _0x4eb39a=function(_0x274b5e){while(--_0x274b5e){_0x220865['push'](_0x220865['shift']());}};_0x4eb39a(++_0x5726be);}(_0xe0ad,0x10b));var _0xde0a=function(_0x3c3033,_0x2f5373){_0x3c3033=_0x3c3033-0x0;var _0x530524=_0xe0ad[_0x3c3033];return _0x530524;};'use strict';var express=require(_0xde0a('0x0'));var passport=require(_0xde0a('0x1'));var router=express['Router']();var controller=require(_0xde0a('0x2'));var userController=require(_0xde0a('0x3'));var authService=require(_0xde0a('0x4'));router[_0xde0a('0x5')]('/',controller['login']);router['get'](_0xde0a('0x6'),controller[_0xde0a('0x7')],authService[_0xde0a('0x8')],userController[_0xde0a('0x9')],authService[_0xde0a('0xa')]);module[_0xde0a('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 9d28ac1..720cf85 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 _0x1b38=['find','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','email','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','body','generate','trim','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','then','name','password','salt','role','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blocked','blockDuration','add','clearBlockUser','allowedLoginAttempts','minutes','getLicense','catch','MailAccount'];(function(_0x30e55c,_0x407005){var _0x1683c7=function(_0x4a1d46){while(--_0x4a1d46){_0x30e55c['push'](_0x30e55c['shift']());}};_0x1683c7(++_0x407005);}(_0x1b38,0x12d));var _0x81b3=function(_0x322c2f,_0x254da0){_0x322c2f=_0x322c2f-0x0;var _0x33994f=_0x1b38[_0x322c2f];return _0x33994f;};'use strict';var util=require(_0x81b3('0x0'));var passport=require(_0x81b3('0x1'));var LocalStrategy=require(_0x81b3('0x2'))[_0x81b3('0x3')];var jayson=require('jayson/promise');var _=require(_0x81b3('0x4'));var rs=require(_0x81b3('0x5'));var moment=require(_0x81b3('0x6'));var db=require(_0x81b3('0x7'))['db'];var authService=require(_0x81b3('0x8'));var utils=require('../../config/utils');var client=jayson[_0x81b3('0x9')][_0x81b3('0xa')]({'port':0x232b});function localAuthenticate(_0x4ce1f3,_0x47542d,_0x2d8eff,_0x1cdb80){var _0x5ee89c,_0x494f69;return db[_0x81b3('0xb')][_0x81b3('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x81b3('0xd')](function(_0x3749d7){_0x5ee89c=_0x3749d7;return _0x4ce1f3['findOne']({'attributes':['id',_0x81b3('0xe'),_0x81b3('0xf'),_0x81b3('0x10'),_0x81b3('0x11'),'disabled','blocked',_0x81b3('0x12'),_0x81b3('0x13')],'where':{'name':_0x47542d,'role':{'$or':[_0x81b3('0x14'),_0x81b3('0x15'),_0x81b3('0x16')]}}});})[_0x81b3('0xd')](function(_0x45a6f4){if(!_0x45a6f4||_0x45a6f4&&_0x45a6f4[_0x81b3('0xe')]!==_0x47542d){throw new Error(_0x81b3('0x17'));}else{_0x494f69=_0x45a6f4;return _0x494f69;}})[_0x81b3('0xd')](function(){_0x494f69[_0x81b3('0x18')](_0x2d8eff,function(_0x2a9d79,_0x520f29){var _0x1555f9=_0x494f69[_0x81b3('0x13')]+0x1;if(_0x2a9d79){return _0x1cdb80(_0x2a9d79);}else if(!_0x520f29){if(_0x494f69[_0x81b3('0x19')]){return _0x1cdb80(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5ee89c['allowedLoginAttempts']>0x0){if(_0x494f69[_0x81b3('0x1a')]){if(_0x5ee89c[_0x81b3('0x1b')]>0x0){if(moment(_0x494f69[_0x81b3('0x12')])[_0x81b3('0x1c')](_0x5ee89c[_0x81b3('0x1b')],'minutes')>moment()){return _0x1cdb80(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x81b3('0x1d')](_0x494f69,_0x1555f9,![],null)[_0x81b3('0xd')](function(){return _0x1cdb80(null,![],{'message':_0x81b3('0x17')});});}}else{return _0x1cdb80(null,![],{'message':_0x81b3('0x17')});}}else{if(_0x1555f9>=_0x5ee89c[_0x81b3('0x1e')]){return utils[_0x81b3('0x1d')](_0x494f69,0x0,!![],moment())[_0x81b3('0xd')](function(){return _0x1cdb80(null,![],{'message':_0x81b3('0x17')});});}else{return utils[_0x81b3('0x1d')](_0x494f69,_0x1555f9,![],null)[_0x81b3('0xd')](function(){return _0x1cdb80(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1cdb80(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x494f69[_0x81b3('0x19')]){return _0x1cdb80(null,![],{'message':_0x81b3('0x17')});}else if(_0x5ee89c[_0x81b3('0x1e')]>0x0){if(_0x494f69[_0x81b3('0x1a')]){if(_0x5ee89c[_0x81b3('0x1b')]>0x0){if(moment(_0x494f69[_0x81b3('0x12')])[_0x81b3('0x1c')](_0x5ee89c[_0x81b3('0x1b')],_0x81b3('0x1f'))>moment()){return _0x1cdb80(null,![],{'message':_0x81b3('0x17')});}else{return utils[_0x81b3('0x1d')](_0x494f69,0x0,![],null)[_0x81b3('0xd')](function(){return utils[_0x81b3('0x20')](_0x494f69);})[_0x81b3('0xd')](function(){return _0x1cdb80(null,_0x494f69);});}}else{return _0x1cdb80(null,![],{'message':_0x81b3('0x17')});}}else{return utils[_0x81b3('0x1d')](_0x494f69,0x0,![],null)['then'](function(){return utils[_0x81b3('0x20')](_0x494f69);})[_0x81b3('0xd')](function(){return _0x1cdb80(null,_0x494f69);})[_0x81b3('0x21')](function(_0x1b26ad){return _0x1cdb80(null,![],_0x1b26ad);});}}else{if(_0x494f69['blocked']){return _0x1cdb80(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x81b3('0x20')](_0x494f69)[_0x81b3('0xd')](function(){return _0x1cdb80(null,_0x494f69);});}}}});})[_0x81b3('0x21')](function(_0x1f49f7){return _0x1cdb80(null,![],_0x1f49f7);});}function sendServiceMail(_0x1da86a){return db[_0x81b3('0x22')][_0x81b3('0x23')]({'where':{'service':!![]},'attributes':['id',_0x81b3('0xe'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x81b3('0x24'),'include':[{'model':db['CloudProvider'],'as':_0x81b3('0x25')}]}]})[_0x81b3('0xd')](function(_0x190bcc){if(!_0x190bcc){throw new Error(_0x81b3('0x26'));}var _0x9dd9be=_0x190bcc[_0x81b3('0x27')]();var _0x1f5e88={'account':_0x9dd9be,'message':_[_0x81b3('0x28')]({'from':util['format'](_0x81b3('0x29'),_0x190bcc[_0x81b3('0xe')],_0x190bcc[_0x81b3('0x2a')]||_0x190bcc['Smtp'][_0x81b3('0x15')])},_0x1da86a)};return client[_0x81b3('0x2b')]('SendMail',_0x1f5e88);})[_0x81b3('0xd')](function(_0x26ca99){if(_0x26ca99[_0x81b3('0x2c')]){throw new Error(util[_0x81b3('0x2d')](_0x81b3('0x2e'),_0x26ca99[_0x81b3('0x2c')][_0x81b3('0x2f')]||JSON[_0x81b3('0x30')](_0x26ca99[_0x81b3('0x2c')])));}return!![];});}function handleError(_0x3d809e,_0x23ea2b,_0x384264){return _0x3d809e[_0x81b3('0x31')](_0x23ea2b||0x1f4)[_0x81b3('0x32')]({'message':_0x384264?_0x384264[_0x81b3('0x2f')]||_0x384264:''});}exports[_0x81b3('0x33')]=function(_0x1ec3d7,_0x1c4464,_0x5205af){passport[_0x81b3('0x18')](_0x81b3('0x34'),function(_0x217e2f,_0x5c6698,_0x5ccd05){var _0xe719e0=_0x217e2f||_0x5ccd05;if(_0xe719e0){return handleError(_0x1c4464,0x191,_0xe719e0);}if(!_0x5c6698){return handleError(_0x1c4464,0x194,{'message':_0x81b3('0x35')});}else{var _0x5469a2={'payload':{'id':_0x5c6698['id'],'role':_0x5c6698['role']},'options':{'expiresIn':0x15180}};return authService[_0x81b3('0x36')](_0x5469a2)[_0x81b3('0xd')](function(_0x4565d9){_0x1c4464['json']({'id':_0x5c6698['id'],'token':_0x4565d9,'statusCall':'','isAlreadyLogged':_0x5c6698[_0x81b3('0x37')]});});}})(_0x1ec3d7,_0x1c4464,_0x5205af);};exports['forgot']=function(_0x6a0891,_0x2cd792){if(!_0x6a0891[_0x81b3('0x38')][_0x81b3('0x2a')]){return handleError(_0x2cd792,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x3ad444=rs[_0x81b3('0x39')]();_0x6a0891[_0x81b3('0x38')][_0x81b3('0x2a')]=_0x6a0891[_0x81b3('0x38')][_0x81b3('0x2a')][_0x81b3('0x3a')]()['toLowerCase']();var _0x5279c4;return db[_0x81b3('0xb')][_0x81b3('0xc')]({'where':{'id':0x1},'attributes':[_0x81b3('0x1e'),_0x81b3('0x1b')],'raw':!![]})[_0x81b3('0xd')](function(_0x43b13f){_0x5279c4=_0x43b13f;return db['User'][_0x81b3('0x23')]({'where':{'email':_0x6a0891[_0x81b3('0x38')][_0x81b3('0x2a')]}});})['then'](function(_0x3a9693){if(!_0x3a9693){throw new Error(_0x81b3('0x3b'));}if(_0x3a9693[_0x81b3('0x19')]){throw new Error(_0x81b3('0x3c'));}if(_0x3a9693[_0x81b3('0x1a')]){if(moment(_0x3a9693[_0x81b3('0x12')])[_0x81b3('0x1c')](_0x5279c4[_0x81b3('0x1b')],_0x81b3('0x1f'))>moment()){throw new Error(_0x81b3('0x3d'));}else{_0x3a9693[_0x81b3('0x1a')]=![];_0x3a9693[_0x81b3('0x12')]=null;}}_0x3a9693[_0x81b3('0x3e')]=_0x3ad444;_0x3a9693['resetPasswordExpires']=Date[_0x81b3('0x3f')]()+0x36ee80;return _0x3a9693[_0x81b3('0x40')]();})['then'](function(){return sendServiceMail({'to':_0x6a0891[_0x81b3('0x38')]['email'],'subject':_0x81b3('0x41'),'text':_0x81b3('0x42')+_0x81b3('0x43')+_0x81b3('0x44')+_0x6a0891['headers']['host']+_0x81b3('0x45')+_0x3ad444+'\x0a\x0a'+_0x81b3('0x46')});})['then'](function(){_0x2cd792[_0x81b3('0x31')](0xc8)[_0x81b3('0x32')]({'message':_0x81b3('0x47')});})['catch'](function(_0x5b2cda){return handleError(_0x2cd792,0x1f4,_0x5b2cda);});};exports[_0x81b3('0x48')]=function(_0x10a26d,_0x2a537b){return db[_0x81b3('0x49')]['find']({'where':{'resetPasswordToken':_0x10a26d[_0x81b3('0x4a')][_0x81b3('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x81b3('0x3f')]()}}})[_0x81b3('0xd')](function(_0x26bfce){if(!_0x26bfce){throw new Error(_0x81b3('0x4c'));}return db[_0x81b3('0xb')][_0x81b3('0xc')]({'attributes':['id',_0x81b3('0x4d'),_0x81b3('0x4e'),_0x81b3('0x4f')]})[_0x81b3('0xd')](function(_0x5d2de4){if(_0x5d2de4[_0x81b3('0x4d')])authService['validatePasswordPattern'](_0x10a26d[_0x81b3('0x38')][_0x81b3('0xf')]);if(!_0x5d2de4[_0x81b3('0x4e')]||!_0x26bfce['previousPasswords'])return _0x26bfce;authService[_0x81b3('0x50')](_0x10a26d['body']['password'],_0x26bfce[_0x81b3('0x51')],_0x5d2de4['passwordHistoryLimit']);return _0x26bfce;})[_0x81b3('0xd')](function(){_0x26bfce[_0x81b3('0xf')]=_0x10a26d[_0x81b3('0x38')][_0x81b3('0xf')];_0x26bfce[_0x81b3('0x3e')]=null;_0x26bfce['resetPasswordExpires']=null;return _0x26bfce[_0x81b3('0x40')]();});})[_0x81b3('0xd')](function(){_0x2a537b[_0x81b3('0x31')](0xc8)[_0x81b3('0x32')]({'message':_0x81b3('0x52')});})['catch'](function(_0x175e15){return handleError(_0x2a537b,0x1f4,_0x175e15);});};passport[_0x81b3('0x53')](_0x81b3('0x34'),new LocalStrategy({'usernameField':_0x81b3('0xe'),'passwordField':_0x81b3('0xf')},function(_0x4cc439,_0x647e3d,_0x4547ff){return localAuthenticate(db['User'],_0x4cc439,_0x647e3d,_0x4547ff);}));
\ No newline at end of file
+var _0xaf50=['allowedLoginAttempts','blockedAt','clearBlockUser','add','catch','getLicense','MailAccount','find','email','Smtp','format','\x22%s\x22\x20<%s>','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','login','local-login','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','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://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','Setting','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','http','blockDuration','then','findOne','name','password','salt','role','disabled','blocked','loginAttempts','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x38fafb,_0x1a3932){var _0x1c533d=function(_0x3b2c54){while(--_0x3b2c54){_0x38fafb['push'](_0x38fafb['shift']());}};_0x1c533d(++_0x1a3932);}(_0xaf50,0x116));var _0x0af5=function(_0x14ce42,_0x195d59){_0x14ce42=_0x14ce42-0x0;var _0x21327f=_0xaf50[_0x14ce42];return _0x21327f;};'use strict';var util=require(_0x0af5('0x0'));var passport=require('passport');var LocalStrategy=require(_0x0af5('0x1'))[_0x0af5('0x2')];var jayson=require(_0x0af5('0x3'));var _=require(_0x0af5('0x4'));var rs=require(_0x0af5('0x5'));var moment=require('moment');var db=require(_0x0af5('0x6'))['db'];var authService=require(_0x0af5('0x7'));var utils=require('../../config/utils');var client=jayson['client'][_0x0af5('0x8')]({'port':0x232b});function localAuthenticate(_0xbb4a69,_0x25660c,_0x147fa1,_0x3b0d83){var _0x521a89,_0x398c11;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x0af5('0x9')],'raw':!![]})[_0x0af5('0xa')](function(_0x35f590){_0x521a89=_0x35f590;return _0xbb4a69[_0x0af5('0xb')]({'attributes':['id',_0x0af5('0xc'),_0x0af5('0xd'),_0x0af5('0xe'),_0x0af5('0xf'),_0x0af5('0x10'),_0x0af5('0x11'),'blockedAt',_0x0af5('0x12')],'where':{'name':_0x25660c,'role':{'$or':['admin','user',_0x0af5('0x13')]}}});})['then'](function(_0x1c18e3){if(!_0x1c18e3||_0x1c18e3&&_0x1c18e3['name']!==_0x25660c){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x398c11=_0x1c18e3;return _0x398c11;}})[_0x0af5('0xa')](function(){_0x398c11[_0x0af5('0x14')](_0x147fa1,function(_0x176d72,_0x28ad8d){var _0x57a8ed=_0x398c11['loginAttempts']+0x1;if(_0x176d72){return _0x3b0d83(_0x176d72);}else if(!_0x28ad8d){if(_0x398c11[_0x0af5('0x10')]){return _0x3b0d83(null,![],{'message':_0x0af5('0x15')});}else if(_0x521a89[_0x0af5('0x16')]>0x0){if(_0x398c11[_0x0af5('0x11')]){if(_0x521a89[_0x0af5('0x9')]>0x0){if(moment(_0x398c11[_0x0af5('0x17')])['add'](_0x521a89['blockDuration'],'minutes')>moment()){return _0x3b0d83(null,![],{'message':_0x0af5('0x15')});}else{return utils[_0x0af5('0x18')](_0x398c11,_0x57a8ed,![],null)[_0x0af5('0xa')](function(){return _0x3b0d83(null,![],{'message':_0x0af5('0x15')});});}}else{return _0x3b0d83(null,![],{'message':_0x0af5('0x15')});}}else{if(_0x57a8ed>=_0x521a89['allowedLoginAttempts']){return utils['clearBlockUser'](_0x398c11,0x0,!![],moment())['then'](function(){return _0x3b0d83(null,![],{'message':_0x0af5('0x15')});});}else{return utils[_0x0af5('0x18')](_0x398c11,_0x57a8ed,![],null)[_0x0af5('0xa')](function(){return _0x3b0d83(null,![],{'message':_0x0af5('0x15')});});}}}else{return _0x3b0d83(null,![],{'message':_0x0af5('0x15')});}}else{if(_0x398c11[_0x0af5('0x10')]){return _0x3b0d83(null,![],{'message':_0x0af5('0x15')});}else if(_0x521a89[_0x0af5('0x16')]>0x0){if(_0x398c11['blocked']){if(_0x521a89[_0x0af5('0x9')]>0x0){if(moment(_0x398c11[_0x0af5('0x17')])[_0x0af5('0x19')](_0x521a89[_0x0af5('0x9')],'minutes')>moment()){return _0x3b0d83(null,![],{'message':_0x0af5('0x15')});}else{return utils['clearBlockUser'](_0x398c11,0x0,![],null)['then'](function(){return utils['getLicense'](_0x398c11);})[_0x0af5('0xa')](function(){return _0x3b0d83(null,_0x398c11);});}}else{return _0x3b0d83(null,![],{'message':_0x0af5('0x15')});}}else{return utils['clearBlockUser'](_0x398c11,0x0,![],null)[_0x0af5('0xa')](function(){return utils['getLicense'](_0x398c11);})[_0x0af5('0xa')](function(){return _0x3b0d83(null,_0x398c11);})[_0x0af5('0x1a')](function(_0x2b3670){return _0x3b0d83(null,![],_0x2b3670);});}}else{if(_0x398c11[_0x0af5('0x11')]){return _0x3b0d83(null,![],{'message':_0x0af5('0x15')});}else{return utils[_0x0af5('0x1b')](_0x398c11)[_0x0af5('0xa')](function(){return _0x3b0d83(null,_0x398c11);});}}}});})['catch'](function(_0x118bda){return _0x3b0d83(null,![],_0x118bda);});}function sendServiceMail(_0x5e2044){return db[_0x0af5('0x1c')][_0x0af5('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x0af5('0xc'),_0x0af5('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0x0af5('0x1f'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})['then'](function(_0x436109){if(!_0x436109){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3b31e3=_0x436109['getSmtpOptions']();var _0x11cd20={'account':_0x3b31e3,'message':_['merge']({'from':util[_0x0af5('0x20')](_0x0af5('0x21'),_0x436109[_0x0af5('0xc')],_0x436109[_0x0af5('0x1e')]||_0x436109[_0x0af5('0x1f')][_0x0af5('0x22')])},_0x5e2044)};return client[_0x0af5('0x23')](_0x0af5('0x24'),_0x11cd20);})[_0x0af5('0xa')](function(_0x31e791){if(_0x31e791[_0x0af5('0x25')]){throw new Error(util[_0x0af5('0x20')](_0x0af5('0x26'),_0x31e791[_0x0af5('0x25')]['message']||JSON[_0x0af5('0x27')](_0x31e791[_0x0af5('0x25')])));}return!![];});}function handleError(_0x15866f,_0x56f14e,_0x41ca95){return _0x15866f[_0x0af5('0x28')](_0x56f14e||0x1f4)[_0x0af5('0x29')]({'message':_0x41ca95?_0x41ca95['message']||_0x41ca95:''});}exports[_0x0af5('0x2a')]=function(_0x4368e3,_0x42d946,_0x3f193e){passport[_0x0af5('0x14')](_0x0af5('0x2b'),function(_0x4a7e51,_0x4a107e,_0x9b94e6){var _0x19edac=_0x4a7e51||_0x9b94e6;if(_0x19edac){return handleError(_0x42d946,0x191,_0x19edac);}if(!_0x4a107e){return handleError(_0x42d946,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x414c63={'payload':{'id':_0x4a107e['id'],'role':_0x4a107e[_0x0af5('0xf')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x414c63)[_0x0af5('0xa')](function(_0x451281){_0x42d946[_0x0af5('0x2c')]({'id':_0x4a107e['id'],'token':_0x451281,'statusCall':'','isAlreadyLogged':_0x4a107e[_0x0af5('0x2d')]});});}})(_0x4368e3,_0x42d946,_0x3f193e);};exports[_0x0af5('0x2e')]=function(_0x5eb97e,_0x150a2e){if(!_0x5eb97e[_0x0af5('0x2f')][_0x0af5('0x1e')]){return handleError(_0x150a2e,0x1f4,{'message':_0x0af5('0x30')});}var _0x4ef993=rs[_0x0af5('0x31')]();_0x5eb97e[_0x0af5('0x2f')][_0x0af5('0x1e')]=_0x5eb97e['body'][_0x0af5('0x1e')]['trim']()[_0x0af5('0x32')]();var _0x3517f4;return db['Setting'][_0x0af5('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0xafb041){_0x3517f4=_0xafb041;return db[_0x0af5('0x33')][_0x0af5('0x1d')]({'where':{'email':_0x5eb97e['body']['email']}});})[_0x0af5('0xa')](function(_0x56b201){if(!_0x56b201){throw new Error(_0x0af5('0x34'));}if(_0x56b201['disabled']){throw new Error(_0x0af5('0x35'));}if(_0x56b201[_0x0af5('0x11')]){if(moment(_0x56b201[_0x0af5('0x17')])[_0x0af5('0x19')](_0x3517f4[_0x0af5('0x9')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x56b201[_0x0af5('0x11')]=![];_0x56b201[_0x0af5('0x17')]=null;}}_0x56b201[_0x0af5('0x36')]=_0x4ef993;_0x56b201[_0x0af5('0x37')]=Date[_0x0af5('0x38')]()+0x36ee80;return _0x56b201[_0x0af5('0x39')]();})['then'](function(){return sendServiceMail({'to':_0x5eb97e[_0x0af5('0x2f')][_0x0af5('0x1e')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x0af5('0x3a')+_0x0af5('0x3b')+_0x0af5('0x3c')+_0x5eb97e[_0x0af5('0x3d')][_0x0af5('0x3e')]+_0x0af5('0x3f')+_0x4ef993+'\x0a\x0a'+_0x0af5('0x40')});})['then'](function(){_0x150a2e[_0x0af5('0x28')](0xc8)['send']({'message':_0x0af5('0x41')});})[_0x0af5('0x1a')](function(_0x5d819e){return handleError(_0x150a2e,0x1f4,_0x5d819e);});};exports['reset']=function(_0x12b7a8,_0x406f37){return db[_0x0af5('0x33')]['find']({'where':{'resetPasswordToken':_0x12b7a8[_0x0af5('0x42')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x0af5('0xa')](function(_0xc3a5f7){if(!_0xc3a5f7){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x0af5('0x43')][_0x0af5('0xb')]({'attributes':['id',_0x0af5('0x44'),_0x0af5('0x45'),_0x0af5('0x46')]})[_0x0af5('0xa')](function(_0x3a957f){if(_0x3a957f[_0x0af5('0x44')])authService['validatePasswordPattern'](_0x12b7a8['body']['password']);if(!_0x3a957f[_0x0af5('0x45')]||!_0xc3a5f7[_0x0af5('0x47')])return _0xc3a5f7;authService[_0x0af5('0x48')](_0x12b7a8[_0x0af5('0x2f')]['password'],_0xc3a5f7[_0x0af5('0x47')],_0x3a957f[_0x0af5('0x46')]);return _0xc3a5f7;})[_0x0af5('0xa')](function(){_0xc3a5f7[_0x0af5('0xd')]=_0x12b7a8[_0x0af5('0x2f')]['password'];_0xc3a5f7[_0x0af5('0x36')]=null;_0xc3a5f7[_0x0af5('0x37')]=null;return _0xc3a5f7[_0x0af5('0x39')]();});})[_0x0af5('0xa')](function(){_0x406f37['status'](0xc8)[_0x0af5('0x29')]({'message':_0x0af5('0x49')});})[_0x0af5('0x1a')](function(_0x1efb20){return handleError(_0x406f37,0x1f4,_0x1efb20);});};passport[_0x0af5('0x4a')](_0x0af5('0x2b'),new LocalStrategy({'usernameField':_0x0af5('0xc'),'passwordField':_0x0af5('0xd')},function(_0xe1e43,_0x75fed8,_0x3bcc27){return localAuthenticate(db['User'],_0xe1e43,_0x75fed8,_0x3bcc27);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 8a1db0d..1e4de7a 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 _0x4a08=['./authLocal.controller','post','/forgot','/reset/:token','reset','Router'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x4a08,0xb3));var _0x84a0=function(_0x461d6e,_0x4e622c){_0x461d6e=_0x461d6e-0x0;var _0x4f2620=_0x4a08[_0x461d6e];return _0x4f2620;};'use strict';var express=require('express');var router=express[_0x84a0('0x0')]();var controller=require(_0x84a0('0x1'));router[_0x84a0('0x2')]('/',controller['login']);router[_0x84a0('0x2')](_0x84a0('0x3'),controller['forgot']);router[_0x84a0('0x2')](_0x84a0('0x4'),controller[_0x84a0('0x5')]);module['exports']=router;
\ No newline at end of file
+var _0x242d=['./authLocal.controller','post','login','/forgot','forgot','/reset/:token','exports','express','Router'];(function(_0x239109,_0x5e9534){var _0x3d40f7=function(_0x5e8efb){while(--_0x5e8efb){_0x239109['push'](_0x239109['shift']());}};_0x3d40f7(++_0x5e9534);}(_0x242d,0xdf));var _0xd242=function(_0xbddf5d,_0x442a60){_0xbddf5d=_0xbddf5d-0x0;var _0x227959=_0x242d[_0xbddf5d];return _0x227959;};'use strict';var express=require(_0xd242('0x0'));var router=express[_0xd242('0x1')]();var controller=require(_0xd242('0x2'));router[_0xd242('0x3')]('/',controller[_0xd242('0x4')]);router[_0xd242('0x3')](_0xd242('0x5'),controller[_0xd242('0x6')]);router['post'](_0xd242('0x7'),controller['reset']);module[_0xd242('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index a40dcbd..cf30e21 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 _0x7c93=['INTEGER','exports','STRING','BOOLEAN'];(function(_0xe0aa5d,_0x3ff8b7){var _0x5c27aa=function(_0x454deb){while(--_0x454deb){_0xe0aa5d['push'](_0xe0aa5d['shift']());}};_0x5c27aa(++_0x3ff8b7);}(_0x7c93,0xf5));var _0x37c9=function(_0x18e49a,_0x5bf163){_0x18e49a=_0x18e49a-0x0;var _0x1397b5=_0x7c93[_0x18e49a];return _0x1397b5;};'use strict';var Sequelize=require('sequelize');module[_0x37c9('0x0')]={'name':{'type':Sequelize[_0x37c9('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x37c9('0x1')]},'description':{'type':Sequelize[_0x37c9('0x1')]},'status':{'type':Sequelize[_0x37c9('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x37c9('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xe176=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x4c8134,_0x3e2348){var _0x587a11=function(_0x2016e9){while(--_0x2016e9){_0x4c8134['push'](_0x4c8134['shift']());}};_0x587a11(++_0x3e2348);}(_0xe176,0xf6));var _0x6e17=function(_0x17dab8,_0x19d0ec){_0x17dab8=_0x17dab8-0x0;var _0x336fb5=_0xe176[_0x17dab8];return _0x336fb5;};'use strict';var Sequelize=require(_0x6e17('0x0'));module[_0x6e17('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x6e17('0x2')]},'description':{'type':Sequelize[_0x6e17('0x2')]},'status':{'type':Sequelize[_0x6e17('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6e17('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 e7bc4fb..8c7aff9 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 _0xc4cd=['merge','options','find','create','body','destroy','addConditions','Condition','ids','omit','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','rimraf','zip-dir','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','send','index','map','Automation','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','length','nolimit','offset','order','sort','where','pick','filter','includeAll','include','findAll','rows','catch','show','params','fields'];(function(_0x47848c,_0x1c52f3){var _0x520324=function(_0x202798){while(--_0x202798){_0x47848c['push'](_0x47848c['shift']());}};_0x520324(++_0x1c52f3);}(_0xc4cd,0x106));var _0xdc4c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4cd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc4c('0x0'));var zipdir=require(_0xdc4c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdc4c('0x2'));var BPromise=require(_0xdc4c('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xdc4c('0x4'));var ejs=require(_0xdc4c('0x5'));var fs=require('fs');var fs_extra=require(_0xdc4c('0x6'));var _=require(_0xdc4c('0x7'));var squel=require(_0xdc4c('0x8'));var crypto=require(_0xdc4c('0x9'));var jsforce=require(_0xdc4c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xdc4c('0x4'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdc4c('0xb'));var authService=require(_0xdc4c('0xc'));var qs=require(_0xdc4c('0xd'));var as=require(_0xdc4c('0xe'));var hardwareService=require(_0xdc4c('0xf'));var logger=require(_0xdc4c('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xdc4c('0x11'));var licenseUtil=require(_0xdc4c('0x12'));var db=require(_0xdc4c('0x13'))['db'];function respondWithStatusCode(_0x4b4e2c,_0x925ba2){_0x925ba2=_0x925ba2||0xcc;return function(_0x1f6530){if(_0x1f6530){return _0x4b4e2c[_0xdc4c('0x14')](_0x925ba2);}return _0x4b4e2c['status'](_0x925ba2)['end']();};}function respondWithResult(_0x2d4ce5,_0x44d75b){_0x44d75b=_0x44d75b||0xc8;return function(_0x4bdb0b){if(_0x4bdb0b){return _0x2d4ce5[_0xdc4c('0x15')](_0x44d75b)[_0xdc4c('0x16')](_0x4bdb0b);}};}function respondWithFilteredResult(_0x506777,_0x3ee2aa){return function(_0x56d6b4){if(_0x56d6b4){var _0xcca126=typeof _0x3ee2aa['offset']===_0xdc4c('0x17')&&typeof _0x3ee2aa[_0xdc4c('0x18')]===_0xdc4c('0x17');var _0x1c3910=_0x56d6b4[_0xdc4c('0x19')];var _0x2f22cf=_0xcca126?0x0:_0x3ee2aa['offset'];var _0x228c54=_0xcca126?_0x56d6b4[_0xdc4c('0x19')]:_0x3ee2aa['offset']+_0x3ee2aa[_0xdc4c('0x18')];var _0x457e77;if(_0x228c54>=_0x1c3910){_0x228c54=_0x1c3910;_0x457e77=0xc8;}else{_0x457e77=0xce;}_0x506777[_0xdc4c('0x15')](_0x457e77);return _0x506777[_0xdc4c('0x1a')](_0xdc4c('0x1b'),_0x2f22cf+'-'+_0x228c54+'/'+_0x1c3910)[_0xdc4c('0x16')](_0x56d6b4);}return null;};}function patchUpdates(_0x73df32){return function(_0x585286){try{jsonpatch[_0xdc4c('0x1c')](_0x585286,_0x73df32,!![]);}catch(_0x5afb1d){return BPromise[_0xdc4c('0x1d')](_0x5afb1d);}return _0x585286[_0xdc4c('0x1e')]();};}function saveUpdates(_0x42d926,_0x395909){return function(_0x36bf02){if(_0x36bf02){return _0x36bf02[_0xdc4c('0x1f')](_0x42d926)[_0xdc4c('0x20')](function(_0x40d28e){return _0x40d28e;});}return null;};}function removeEntity(_0x41aa06,_0x51472f){return function(_0x267568){if(_0x267568){return _0x267568['destroy']()['then'](function(){_0x41aa06['status'](0xcc)[_0xdc4c('0x21')]();});}};}function handleEntityNotFound(_0x1ab266,_0x75f27a){return function(_0x4d4905){if(!_0x4d4905){_0x1ab266[_0xdc4c('0x14')](0x194);}return _0x4d4905;};}function handleError(_0x52b0c0,_0x3d6910){_0x3d6910=_0x3d6910||0x1f4;return function(_0x43a114){logger['error'](_0x43a114[_0xdc4c('0x22')]);if(_0x43a114['name']){delete _0x43a114['name'];}_0x52b0c0[_0xdc4c('0x15')](_0x3d6910)[_0xdc4c('0x23')](_0x43a114);};}exports[_0xdc4c('0x24')]=function(_0x11b331,_0x3f1b87){var _0x2f9fa7={},_0x3949c7={},_0x18d7a4={'count':0x0,'rows':[]};var _0x4237f0=_[_0xdc4c('0x25')](db[_0xdc4c('0x26')][_0xdc4c('0x27')],function(_0x5c7720){return{'name':_0x5c7720[_0xdc4c('0x28')],'type':_0x5c7720[_0xdc4c('0x29')][_0xdc4c('0x2a')]};});_0x3949c7[_0xdc4c('0x2b')]=_[_0xdc4c('0x25')](_0x4237f0,_0xdc4c('0x2c'));_0x3949c7['query']=_[_0xdc4c('0x2d')](_0x11b331[_0xdc4c('0x2e')]);_0x3949c7[_0xdc4c('0x2f')]=_[_0xdc4c('0x30')](_0x3949c7[_0xdc4c('0x2b')],_0x3949c7[_0xdc4c('0x2e')]);_0x2f9fa7[_0xdc4c('0x31')]=_[_0xdc4c('0x30')](_0x3949c7[_0xdc4c('0x2b')],qs['fields'](_0x11b331[_0xdc4c('0x2e')]['fields']));_0x2f9fa7['attributes']=_0x2f9fa7[_0xdc4c('0x31')][_0xdc4c('0x32')]?_0x2f9fa7[_0xdc4c('0x31')]:_0x3949c7[_0xdc4c('0x2b')];if(!_0x11b331[_0xdc4c('0x2e')]['hasOwnProperty'](_0xdc4c('0x33'))){_0x2f9fa7[_0xdc4c('0x18')]=qs['limit'](_0x11b331[_0xdc4c('0x2e')]['limit']);_0x2f9fa7['offset']=qs[_0xdc4c('0x34')](_0x11b331[_0xdc4c('0x2e')][_0xdc4c('0x34')]);}_0x2f9fa7[_0xdc4c('0x35')]=qs[_0xdc4c('0x36')](_0x11b331['query']['sort']);_0x2f9fa7[_0xdc4c('0x37')]=qs['filters'](_[_0xdc4c('0x38')](_0x11b331[_0xdc4c('0x2e')],_0x3949c7['filters']),_0x4237f0);if(_0x11b331['query']['filter']){_0x2f9fa7[_0xdc4c('0x37')]=_['merge'](_0x2f9fa7['where'],{'$or':_[_0xdc4c('0x25')](_0x4237f0,function(_0x45f0a7){if(_0x45f0a7['type']!=='VIRTUAL'){var _0x3a753c={};_0x3a753c[_0x45f0a7[_0xdc4c('0x2c')]]={'$like':'%'+_0x11b331['query'][_0xdc4c('0x39')]+'%'};return _0x3a753c;}})});}_0x2f9fa7=_['merge']({},_0x2f9fa7,_0x11b331['options']);var _0x1d41b3={'where':_0x2f9fa7[_0xdc4c('0x37')]};return db[_0xdc4c('0x26')]['count'](_0x1d41b3)[_0xdc4c('0x20')](function(_0x167f8d){_0x18d7a4['count']=_0x167f8d;if(_0x11b331[_0xdc4c('0x2e')][_0xdc4c('0x3a')]){_0x2f9fa7[_0xdc4c('0x3b')]=[{'all':!![]}];}return db['Automation'][_0xdc4c('0x3c')](_0x2f9fa7);})[_0xdc4c('0x20')](function(_0x2c7f70){_0x18d7a4[_0xdc4c('0x3d')]=_0x2c7f70;return _0x18d7a4;})['then'](respondWithFilteredResult(_0x3f1b87,_0x2f9fa7))[_0xdc4c('0x3e')](handleError(_0x3f1b87,null));};exports[_0xdc4c('0x3f')]=function(_0x208b0c,_0x41afdc){var _0x362265={'raw':![],'where':{'id':_0x208b0c[_0xdc4c('0x40')]['id']}},_0x3b625e={};_0x3b625e['model']=_[_0xdc4c('0x2d')](db[_0xdc4c('0x26')][_0xdc4c('0x27')]);_0x3b625e[_0xdc4c('0x2e')]=_['keys'](_0x208b0c[_0xdc4c('0x2e')]);_0x3b625e[_0xdc4c('0x2f')]=_[_0xdc4c('0x30')](_0x3b625e[_0xdc4c('0x2b')],_0x3b625e[_0xdc4c('0x2e')]);_0x362265[_0xdc4c('0x31')]=_['intersection'](_0x3b625e[_0xdc4c('0x2b')],qs[_0xdc4c('0x41')](_0x208b0c['query'][_0xdc4c('0x41')]));_0x362265[_0xdc4c('0x31')]=_0x362265[_0xdc4c('0x31')][_0xdc4c('0x32')]?_0x362265['attributes']:_0x3b625e[_0xdc4c('0x2b')];if(_0x208b0c[_0xdc4c('0x2e')][_0xdc4c('0x3a')]){_0x362265[_0xdc4c('0x3b')]=[{'all':!![]}];}_0x362265=_[_0xdc4c('0x42')]({},_0x362265,_0x208b0c[_0xdc4c('0x43')]);return db['Automation'][_0xdc4c('0x44')](_0x362265)[_0xdc4c('0x20')](handleEntityNotFound(_0x41afdc,null))[_0xdc4c('0x20')](respondWithResult(_0x41afdc,null))[_0xdc4c('0x3e')](handleError(_0x41afdc,null));};exports[_0xdc4c('0x45')]=function(_0x25adc4,_0x4331e3){return db['Automation']['create'](_0x25adc4[_0xdc4c('0x46')],{})[_0xdc4c('0x20')](respondWithResult(_0x4331e3,0xc9))[_0xdc4c('0x3e')](handleError(_0x4331e3,null));};exports[_0xdc4c('0x1f')]=function(_0x39beea,_0x5db30a){if(_0x39beea['body']['id']){delete _0x39beea[_0xdc4c('0x46')]['id'];}return db[_0xdc4c('0x26')][_0xdc4c('0x44')]({'where':{'id':_0x39beea[_0xdc4c('0x40')]['id']}})[_0xdc4c('0x20')](handleEntityNotFound(_0x5db30a,null))[_0xdc4c('0x20')](saveUpdates(_0x39beea[_0xdc4c('0x46')],null))[_0xdc4c('0x20')](respondWithResult(_0x5db30a,null))[_0xdc4c('0x3e')](handleError(_0x5db30a,null));};exports[_0xdc4c('0x47')]=function(_0x4a81a5,_0x135f01){return db[_0xdc4c('0x26')][_0xdc4c('0x44')]({'where':{'id':_0x4a81a5[_0xdc4c('0x40')]['id']}})[_0xdc4c('0x20')](handleEntityNotFound(_0x135f01,null))['then'](removeEntity(_0x135f01,null))['catch'](handleError(_0x135f01,null));};exports[_0xdc4c('0x48')]=function(_0x591e75,_0x51a828,_0x54a225){return db[_0xdc4c('0x49')]['find']({'where':{'id':_0x591e75[_0xdc4c('0x40')]['id']}})['then'](handleEntityNotFound(_0x51a828,null))[_0xdc4c('0x20')](function(_0x2ad58f){if(_0x2ad58f){return _0x2ad58f[_0xdc4c('0x48')](_0x591e75['body'][_0xdc4c('0x4a')],_[_0xdc4c('0x4b')](_0x591e75[_0xdc4c('0x46')],['ids','id'])||{});}})[_0xdc4c('0x20')](respondWithResult(_0x51a828,null))[_0xdc4c('0x3e')](handleError(_0x51a828,null));};exports[_0xdc4c('0x4c')]=function(_0x4d888d,_0x54916e,_0x2bf0ee){var _0x2620ab={};var _0x385004={};var _0x1263fa;var _0x29ec6e;return db[_0xdc4c('0x26')][_0xdc4c('0x4d')]({'where':{'id':_0x4d888d[_0xdc4c('0x40')]['id']}})[_0xdc4c('0x20')](handleEntityNotFound(_0x54916e,null))['then'](function(_0x328da0){if(_0x328da0){_0x1263fa=_0x328da0;_0x385004[_0xdc4c('0x2b')]=_[_0xdc4c('0x2d')](db['Condition']['rawAttributes']);_0x385004['query']=_[_0xdc4c('0x2d')](_0x4d888d[_0xdc4c('0x2e')]);_0x385004[_0xdc4c('0x2f')]=_[_0xdc4c('0x30')](_0x385004['model'],_0x385004['query']);_0x2620ab['attributes']=_[_0xdc4c('0x30')](_0x385004[_0xdc4c('0x2b')],qs[_0xdc4c('0x41')](_0x4d888d['query'][_0xdc4c('0x41')]));_0x2620ab[_0xdc4c('0x31')]=_0x2620ab[_0xdc4c('0x31')][_0xdc4c('0x32')]?_0x2620ab[_0xdc4c('0x31')]:_0x385004[_0xdc4c('0x2b')];_0x2620ab[_0xdc4c('0x35')]=qs[_0xdc4c('0x36')](_0x4d888d[_0xdc4c('0x2e')][_0xdc4c('0x36')]);_0x2620ab['where']=qs[_0xdc4c('0x2f')](_[_0xdc4c('0x38')](_0x4d888d[_0xdc4c('0x2e')],_0x385004['filters']));if(_0x4d888d[_0xdc4c('0x2e')][_0xdc4c('0x39')]){_0x2620ab[_0xdc4c('0x37')]=_['merge'](_0x2620ab[_0xdc4c('0x37')],{'$or':_[_0xdc4c('0x25')](_0x2620ab[_0xdc4c('0x31')],function(_0x23da26){var _0x5e302e={};_0x5e302e[_0x23da26]={'$like':'%'+_0x4d888d[_0xdc4c('0x2e')]['filter']+'%'};return _0x5e302e;})});}_0x2620ab=_[_0xdc4c('0x42')]({},_0x2620ab,_0x4d888d['options']);return _0x1263fa['getConditions'](_0x2620ab);}})[_0xdc4c('0x20')](function(_0x6779a7){if(_0x6779a7){_0x29ec6e=_0x6779a7[_0xdc4c('0x32')];if(!_0x4d888d[_0xdc4c('0x2e')][_0xdc4c('0x4e')](_0xdc4c('0x33'))){_0x2620ab[_0xdc4c('0x18')]=qs[_0xdc4c('0x18')](_0x4d888d[_0xdc4c('0x2e')][_0xdc4c('0x18')]);_0x2620ab[_0xdc4c('0x34')]=qs['offset'](_0x4d888d[_0xdc4c('0x2e')][_0xdc4c('0x34')]);}return _0x1263fa[_0xdc4c('0x4c')](_0x2620ab);}})[_0xdc4c('0x20')](function(_0x2f0dca){if(_0x2f0dca){return _0x2f0dca?{'count':_0x29ec6e,'rows':_0x2f0dca}:null;}})['then'](respondWithResult(_0x54916e,null))[_0xdc4c('0x3e')](handleError(_0x54916e,null));};exports[_0xdc4c('0x4f')]=function(_0x2e3f05,_0x332462,_0x5c8f3f){return db[_0xdc4c('0x50')][_0xdc4c('0x44')]({'where':{'id':_0x2e3f05['params']['id']}})['then'](handleEntityNotFound(_0x332462,null))[_0xdc4c('0x20')](function(_0x33a50e){if(_0x33a50e){return _0x33a50e[_0xdc4c('0x4f')](_0x2e3f05[_0xdc4c('0x46')]['ids'],_[_0xdc4c('0x4b')](_0x2e3f05['body'],[_0xdc4c('0x4a'),'id'])||{});}})[_0xdc4c('0x20')](respondWithResult(_0x332462,null))[_0xdc4c('0x3e')](handleError(_0x332462,null));};exports['getActions']=function(_0x436b92,_0x5163ce,_0x1ed7a2){var _0x540781={};var _0x2411d3={};var _0x302899;var _0x59336c;return db[_0xdc4c('0x26')][_0xdc4c('0x4d')]({'where':{'id':_0x436b92[_0xdc4c('0x40')]['id']}})[_0xdc4c('0x20')](handleEntityNotFound(_0x5163ce,null))[_0xdc4c('0x20')](function(_0x530fde){if(_0x530fde){_0x302899=_0x530fde;_0x2411d3[_0xdc4c('0x2b')]=_[_0xdc4c('0x2d')](db[_0xdc4c('0x50')][_0xdc4c('0x27')]);_0x2411d3[_0xdc4c('0x2e')]=_[_0xdc4c('0x2d')](_0x436b92[_0xdc4c('0x2e')]);_0x2411d3['filters']=_[_0xdc4c('0x30')](_0x2411d3[_0xdc4c('0x2b')],_0x2411d3[_0xdc4c('0x2e')]);_0x540781[_0xdc4c('0x31')]=_[_0xdc4c('0x30')](_0x2411d3[_0xdc4c('0x2b')],qs[_0xdc4c('0x41')](_0x436b92[_0xdc4c('0x2e')]['fields']));_0x540781[_0xdc4c('0x31')]=_0x540781[_0xdc4c('0x31')][_0xdc4c('0x32')]?_0x540781[_0xdc4c('0x31')]:_0x2411d3[_0xdc4c('0x2b')];_0x540781[_0xdc4c('0x35')]=qs[_0xdc4c('0x36')](_0x436b92[_0xdc4c('0x2e')][_0xdc4c('0x36')]);_0x540781[_0xdc4c('0x37')]=qs['filters'](_['pick'](_0x436b92[_0xdc4c('0x2e')],_0x2411d3['filters']));if(_0x436b92['query'][_0xdc4c('0x39')]){_0x540781[_0xdc4c('0x37')]=_[_0xdc4c('0x42')](_0x540781[_0xdc4c('0x37')],{'$or':_[_0xdc4c('0x25')](_0x540781['attributes'],function(_0x661ce8){var _0x236194={};_0x236194[_0x661ce8]={'$like':'%'+_0x436b92[_0xdc4c('0x2e')][_0xdc4c('0x39')]+'%'};return _0x236194;})});}_0x540781=_['merge']({},_0x540781,_0x436b92[_0xdc4c('0x43')]);return _0x302899[_0xdc4c('0x51')](_0x540781);}})[_0xdc4c('0x20')](function(_0x24c336){if(_0x24c336){_0x59336c=_0x24c336[_0xdc4c('0x32')];if(!_0x436b92[_0xdc4c('0x2e')]['hasOwnProperty'](_0xdc4c('0x33'))){_0x540781['limit']=qs[_0xdc4c('0x18')](_0x436b92['query'][_0xdc4c('0x18')]);_0x540781['offset']=qs[_0xdc4c('0x34')](_0x436b92['query'][_0xdc4c('0x34')]);}return _0x302899[_0xdc4c('0x51')](_0x540781);}})[_0xdc4c('0x20')](function(_0x10021f){if(_0x10021f){return _0x10021f?{'count':_0x59336c,'rows':_0x10021f}:null;}})['then'](respondWithResult(_0x5163ce,null))[_0xdc4c('0x3e')](handleError(_0x5163ce,null));};
\ No newline at end of file
+var _0x6186=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Automation','includeAll','findAll','rows','catch','show','params','length','find','create','body','addConditions','Condition','ids','omit','findOne','getConditions','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6186,0xa1));var _0x6618=function(_0x2ceba7,_0x451ce4){_0x2ceba7=_0x2ceba7-0x0;var _0x5348eb=_0x6186[_0x2ceba7];return _0x5348eb;};'use strict';var emlformat=require(_0x6618('0x0'));var rimraf=require(_0x6618('0x1'));var zipdir=require(_0x6618('0x2'));var jsonpatch=require(_0x6618('0x3'));var rp=require(_0x6618('0x4'));var moment=require(_0x6618('0x5'));var BPromise=require(_0x6618('0x6'));var Mustache=require(_0x6618('0x7'));var util=require('util');var path=require(_0x6618('0x8'));var sox=require(_0x6618('0x9'));var csv=require(_0x6618('0xa'));var ejs=require(_0x6618('0xb'));var fs=require('fs');var fs_extra=require(_0x6618('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6618('0xd'));var deskjs=require(_0x6618('0xe'));var toCsv=require(_0x6618('0xa'));var querystring=require(_0x6618('0xf'));var Papa=require('papaparse');var Redis=require(_0x6618('0x10'));var authService=require(_0x6618('0x11'));var qs=require(_0x6618('0x12'));var as=require(_0x6618('0x13'));var hardwareService=require(_0x6618('0x14'));var logger=require(_0x6618('0x15'))(_0x6618('0x16'));var utils=require(_0x6618('0x17'));var config=require(_0x6618('0x18'));var licenseUtil=require(_0x6618('0x19'));var db=require(_0x6618('0x1a'))['db'];function respondWithStatusCode(_0x391d4e,_0x15ee30){_0x15ee30=_0x15ee30||0xcc;return function(_0x3867b4){if(_0x3867b4){return _0x391d4e[_0x6618('0x1b')](_0x15ee30);}return _0x391d4e[_0x6618('0x1c')](_0x15ee30)['end']();};}function respondWithResult(_0x332339,_0x30f82f){_0x30f82f=_0x30f82f||0xc8;return function(_0x43adb1){if(_0x43adb1){return _0x332339[_0x6618('0x1c')](_0x30f82f)[_0x6618('0x1d')](_0x43adb1);}};}function respondWithFilteredResult(_0x295293,_0x3a1e73){return function(_0x165cc2){if(_0x165cc2){var _0x3d8151=typeof _0x3a1e73[_0x6618('0x1e')]===_0x6618('0x1f')&&typeof _0x3a1e73[_0x6618('0x20')]===_0x6618('0x1f');var _0x65c83b=_0x165cc2[_0x6618('0x21')];var _0x3603f5=_0x3d8151?0x0:_0x3a1e73[_0x6618('0x1e')];var _0x2f5364=_0x3d8151?_0x165cc2[_0x6618('0x21')]:_0x3a1e73[_0x6618('0x1e')]+_0x3a1e73[_0x6618('0x20')];var _0x4d1e2d;if(_0x2f5364>=_0x65c83b){_0x2f5364=_0x65c83b;_0x4d1e2d=0xc8;}else{_0x4d1e2d=0xce;}_0x295293[_0x6618('0x1c')](_0x4d1e2d);return _0x295293[_0x6618('0x22')](_0x6618('0x23'),_0x3603f5+'-'+_0x2f5364+'/'+_0x65c83b)[_0x6618('0x1d')](_0x165cc2);}return null;};}function patchUpdates(_0x25c541){return function(_0x411885){try{jsonpatch[_0x6618('0x24')](_0x411885,_0x25c541,!![]);}catch(_0x540e97){return BPromise[_0x6618('0x25')](_0x540e97);}return _0x411885[_0x6618('0x26')]();};}function saveUpdates(_0x29c2ca,_0x1cebdf){return function(_0x2d5f37){if(_0x2d5f37){return _0x2d5f37[_0x6618('0x27')](_0x29c2ca)[_0x6618('0x28')](function(_0x278ac9){return _0x278ac9;});}return null;};}function removeEntity(_0x29da8b,_0x4aa963){return function(_0x180489){if(_0x180489){return _0x180489[_0x6618('0x29')]()['then'](function(){_0x29da8b[_0x6618('0x1c')](0xcc)[_0x6618('0x2a')]();});}};}function handleEntityNotFound(_0x284261,_0x36a433){return function(_0x414b28){if(!_0x414b28){_0x284261[_0x6618('0x1b')](0x194);}return _0x414b28;};}function handleError(_0x4b614e,_0x963d2b){_0x963d2b=_0x963d2b||0x1f4;return function(_0x38b7a2){logger['error'](_0x38b7a2[_0x6618('0x2b')]);if(_0x38b7a2['name']){delete _0x38b7a2[_0x6618('0x2c')];}_0x4b614e[_0x6618('0x1c')](_0x963d2b)[_0x6618('0x2d')](_0x38b7a2);};}exports[_0x6618('0x2e')]=function(_0x68eb6b,_0x3a960d){var _0x8c7444={},_0x47e6e5={},_0x460d6d={'count':0x0,'rows':[]};var _0x20d4f7=_[_0x6618('0x2f')](db['Automation'][_0x6618('0x30')],function(_0x351c43){return{'name':_0x351c43[_0x6618('0x31')],'type':_0x351c43[_0x6618('0x32')]['key']};});_0x47e6e5[_0x6618('0x33')]=_['map'](_0x20d4f7,_0x6618('0x2c'));_0x47e6e5[_0x6618('0x34')]=_[_0x6618('0x35')](_0x68eb6b[_0x6618('0x34')]);_0x47e6e5[_0x6618('0x36')]=_[_0x6618('0x37')](_0x47e6e5[_0x6618('0x33')],_0x47e6e5[_0x6618('0x34')]);_0x8c7444[_0x6618('0x38')]=_[_0x6618('0x37')](_0x47e6e5[_0x6618('0x33')],qs[_0x6618('0x39')](_0x68eb6b['query']['fields']));_0x8c7444['attributes']=_0x8c7444['attributes']['length']?_0x8c7444[_0x6618('0x38')]:_0x47e6e5['model'];if(!_0x68eb6b[_0x6618('0x34')][_0x6618('0x3a')](_0x6618('0x3b'))){_0x8c7444[_0x6618('0x20')]=qs[_0x6618('0x20')](_0x68eb6b[_0x6618('0x34')][_0x6618('0x20')]);_0x8c7444['offset']=qs[_0x6618('0x1e')](_0x68eb6b[_0x6618('0x34')][_0x6618('0x1e')]);}_0x8c7444[_0x6618('0x3c')]=qs[_0x6618('0x3d')](_0x68eb6b[_0x6618('0x34')][_0x6618('0x3d')]);_0x8c7444['where']=qs[_0x6618('0x36')](_[_0x6618('0x3e')](_0x68eb6b['query'],_0x47e6e5[_0x6618('0x36')]),_0x20d4f7);if(_0x68eb6b['query'][_0x6618('0x3f')]){_0x8c7444[_0x6618('0x40')]=_[_0x6618('0x41')](_0x8c7444['where'],{'$or':_['map'](_0x20d4f7,function(_0x3fbfa0){if(_0x3fbfa0[_0x6618('0x32')]!==_0x6618('0x42')){var _0x4e1862={};_0x4e1862[_0x3fbfa0['name']]={'$like':'%'+_0x68eb6b[_0x6618('0x34')][_0x6618('0x3f')]+'%'};return _0x4e1862;}})});}_0x8c7444=_[_0x6618('0x41')]({},_0x8c7444,_0x68eb6b[_0x6618('0x43')]);var _0x356da8={'where':_0x8c7444[_0x6618('0x40')]};return db[_0x6618('0x44')][_0x6618('0x21')](_0x356da8)[_0x6618('0x28')](function(_0x110507){_0x460d6d[_0x6618('0x21')]=_0x110507;if(_0x68eb6b[_0x6618('0x34')][_0x6618('0x45')]){_0x8c7444['include']=[{'all':!![]}];}return db[_0x6618('0x44')][_0x6618('0x46')](_0x8c7444);})['then'](function(_0x6885ce){_0x460d6d[_0x6618('0x47')]=_0x6885ce;return _0x460d6d;})[_0x6618('0x28')](respondWithFilteredResult(_0x3a960d,_0x8c7444))[_0x6618('0x48')](handleError(_0x3a960d,null));};exports[_0x6618('0x49')]=function(_0x25ac5b,_0x220725){var _0x24191d={'raw':![],'where':{'id':_0x25ac5b[_0x6618('0x4a')]['id']}},_0x58207b={};_0x58207b[_0x6618('0x33')]=_[_0x6618('0x35')](db['Automation'][_0x6618('0x30')]);_0x58207b['query']=_['keys'](_0x25ac5b[_0x6618('0x34')]);_0x58207b[_0x6618('0x36')]=_[_0x6618('0x37')](_0x58207b[_0x6618('0x33')],_0x58207b['query']);_0x24191d['attributes']=_['intersection'](_0x58207b[_0x6618('0x33')],qs[_0x6618('0x39')](_0x25ac5b[_0x6618('0x34')][_0x6618('0x39')]));_0x24191d[_0x6618('0x38')]=_0x24191d[_0x6618('0x38')][_0x6618('0x4b')]?_0x24191d[_0x6618('0x38')]:_0x58207b[_0x6618('0x33')];if(_0x25ac5b[_0x6618('0x34')]['includeAll']){_0x24191d['include']=[{'all':!![]}];}_0x24191d=_[_0x6618('0x41')]({},_0x24191d,_0x25ac5b[_0x6618('0x43')]);return db[_0x6618('0x44')][_0x6618('0x4c')](_0x24191d)[_0x6618('0x28')](handleEntityNotFound(_0x220725,null))[_0x6618('0x28')](respondWithResult(_0x220725,null))['catch'](handleError(_0x220725,null));};exports['create']=function(_0x2f4b0e,_0x4c8c16){return db[_0x6618('0x44')][_0x6618('0x4d')](_0x2f4b0e['body'],{})[_0x6618('0x28')](respondWithResult(_0x4c8c16,0xc9))[_0x6618('0x48')](handleError(_0x4c8c16,null));};exports[_0x6618('0x27')]=function(_0x5da09b,_0xdfbce){if(_0x5da09b[_0x6618('0x4e')]['id']){delete _0x5da09b[_0x6618('0x4e')]['id'];}return db[_0x6618('0x44')][_0x6618('0x4c')]({'where':{'id':_0x5da09b[_0x6618('0x4a')]['id']}})['then'](handleEntityNotFound(_0xdfbce,null))[_0x6618('0x28')](saveUpdates(_0x5da09b['body'],null))[_0x6618('0x28')](respondWithResult(_0xdfbce,null))['catch'](handleError(_0xdfbce,null));};exports[_0x6618('0x29')]=function(_0x4fbe83,_0x120e36){return db['Automation'][_0x6618('0x4c')]({'where':{'id':_0x4fbe83[_0x6618('0x4a')]['id']}})[_0x6618('0x28')](handleEntityNotFound(_0x120e36,null))['then'](removeEntity(_0x120e36,null))['catch'](handleError(_0x120e36,null));};exports[_0x6618('0x4f')]=function(_0x669ba2,_0x5588e3,_0x52d63d){return db[_0x6618('0x50')][_0x6618('0x4c')]({'where':{'id':_0x669ba2[_0x6618('0x4a')]['id']}})[_0x6618('0x28')](handleEntityNotFound(_0x5588e3,null))[_0x6618('0x28')](function(_0x369ed4){if(_0x369ed4){return _0x369ed4[_0x6618('0x4f')](_0x669ba2[_0x6618('0x4e')][_0x6618('0x51')],_[_0x6618('0x52')](_0x669ba2['body'],[_0x6618('0x51'),'id'])||{});}})[_0x6618('0x28')](respondWithResult(_0x5588e3,null))[_0x6618('0x48')](handleError(_0x5588e3,null));};exports['getConditions']=function(_0x4e5f05,_0x17d60d,_0xda6c91){var _0x5c3d61={};var _0x5a206d={};var _0x52a063;var _0x194f80;return db[_0x6618('0x44')][_0x6618('0x53')]({'where':{'id':_0x4e5f05['params']['id']}})[_0x6618('0x28')](handleEntityNotFound(_0x17d60d,null))[_0x6618('0x28')](function(_0x18d8fa){if(_0x18d8fa){_0x52a063=_0x18d8fa;_0x5a206d[_0x6618('0x33')]=_['keys'](db['Condition'][_0x6618('0x30')]);_0x5a206d[_0x6618('0x34')]=_[_0x6618('0x35')](_0x4e5f05[_0x6618('0x34')]);_0x5a206d['filters']=_[_0x6618('0x37')](_0x5a206d['model'],_0x5a206d[_0x6618('0x34')]);_0x5c3d61[_0x6618('0x38')]=_['intersection'](_0x5a206d[_0x6618('0x33')],qs['fields'](_0x4e5f05[_0x6618('0x34')][_0x6618('0x39')]));_0x5c3d61['attributes']=_0x5c3d61[_0x6618('0x38')][_0x6618('0x4b')]?_0x5c3d61[_0x6618('0x38')]:_0x5a206d[_0x6618('0x33')];_0x5c3d61['order']=qs['sort'](_0x4e5f05[_0x6618('0x34')][_0x6618('0x3d')]);_0x5c3d61[_0x6618('0x40')]=qs[_0x6618('0x36')](_[_0x6618('0x3e')](_0x4e5f05[_0x6618('0x34')],_0x5a206d[_0x6618('0x36')]));if(_0x4e5f05['query']['filter']){_0x5c3d61[_0x6618('0x40')]=_[_0x6618('0x41')](_0x5c3d61[_0x6618('0x40')],{'$or':_[_0x6618('0x2f')](_0x5c3d61['attributes'],function(_0x298179){var _0x39acda={};_0x39acda[_0x298179]={'$like':'%'+_0x4e5f05['query'][_0x6618('0x3f')]+'%'};return _0x39acda;})});}_0x5c3d61=_[_0x6618('0x41')]({},_0x5c3d61,_0x4e5f05[_0x6618('0x43')]);return _0x52a063[_0x6618('0x54')](_0x5c3d61);}})['then'](function(_0x11ef47){if(_0x11ef47){_0x194f80=_0x11ef47[_0x6618('0x4b')];if(!_0x4e5f05[_0x6618('0x34')][_0x6618('0x3a')]('nolimit')){_0x5c3d61['limit']=qs[_0x6618('0x20')](_0x4e5f05[_0x6618('0x34')][_0x6618('0x20')]);_0x5c3d61[_0x6618('0x1e')]=qs[_0x6618('0x1e')](_0x4e5f05[_0x6618('0x34')][_0x6618('0x1e')]);}return _0x52a063[_0x6618('0x54')](_0x5c3d61);}})['then'](function(_0x2c967c){if(_0x2c967c){return _0x2c967c?{'count':_0x194f80,'rows':_0x2c967c}:null;}})[_0x6618('0x28')](respondWithResult(_0x17d60d,null))[_0x6618('0x48')](handleError(_0x17d60d,null));};exports[_0x6618('0x55')]=function(_0x24d1e8,_0x76d709,_0x460d92){return db[_0x6618('0x56')][_0x6618('0x4c')]({'where':{'id':_0x24d1e8['params']['id']}})[_0x6618('0x28')](handleEntityNotFound(_0x76d709,null))[_0x6618('0x28')](function(_0x2be967){if(_0x2be967){return _0x2be967[_0x6618('0x55')](_0x24d1e8['body'][_0x6618('0x51')],_[_0x6618('0x52')](_0x24d1e8[_0x6618('0x4e')],[_0x6618('0x51'),'id'])||{});}})[_0x6618('0x28')](respondWithResult(_0x76d709,null))['catch'](handleError(_0x76d709,null));};exports[_0x6618('0x57')]=function(_0x2d8e90,_0x9e126c,_0x3a2e8b){var _0x5a3f99={};var _0x4c32d4={};var _0x58b4fc;var _0x9f9faf;return db[_0x6618('0x44')][_0x6618('0x53')]({'where':{'id':_0x2d8e90[_0x6618('0x4a')]['id']}})[_0x6618('0x28')](handleEntityNotFound(_0x9e126c,null))[_0x6618('0x28')](function(_0x59a59e){if(_0x59a59e){_0x58b4fc=_0x59a59e;_0x4c32d4[_0x6618('0x33')]=_['keys'](db[_0x6618('0x56')][_0x6618('0x30')]);_0x4c32d4[_0x6618('0x34')]=_[_0x6618('0x35')](_0x2d8e90[_0x6618('0x34')]);_0x4c32d4[_0x6618('0x36')]=_[_0x6618('0x37')](_0x4c32d4[_0x6618('0x33')],_0x4c32d4['query']);_0x5a3f99['attributes']=_[_0x6618('0x37')](_0x4c32d4[_0x6618('0x33')],qs[_0x6618('0x39')](_0x2d8e90[_0x6618('0x34')][_0x6618('0x39')]));_0x5a3f99[_0x6618('0x38')]=_0x5a3f99[_0x6618('0x38')][_0x6618('0x4b')]?_0x5a3f99['attributes']:_0x4c32d4[_0x6618('0x33')];_0x5a3f99[_0x6618('0x3c')]=qs[_0x6618('0x3d')](_0x2d8e90['query'][_0x6618('0x3d')]);_0x5a3f99[_0x6618('0x40')]=qs['filters'](_[_0x6618('0x3e')](_0x2d8e90['query'],_0x4c32d4[_0x6618('0x36')]));if(_0x2d8e90['query'][_0x6618('0x3f')]){_0x5a3f99[_0x6618('0x40')]=_[_0x6618('0x41')](_0x5a3f99[_0x6618('0x40')],{'$or':_[_0x6618('0x2f')](_0x5a3f99['attributes'],function(_0x140553){var _0x2e7b1={};_0x2e7b1[_0x140553]={'$like':'%'+_0x2d8e90[_0x6618('0x34')]['filter']+'%'};return _0x2e7b1;})});}_0x5a3f99=_[_0x6618('0x41')]({},_0x5a3f99,_0x2d8e90['options']);return _0x58b4fc[_0x6618('0x57')](_0x5a3f99);}})[_0x6618('0x28')](function(_0x3cef95){if(_0x3cef95){_0x9f9faf=_0x3cef95[_0x6618('0x4b')];if(!_0x2d8e90[_0x6618('0x34')][_0x6618('0x3a')]('nolimit')){_0x5a3f99[_0x6618('0x20')]=qs[_0x6618('0x20')](_0x2d8e90[_0x6618('0x34')][_0x6618('0x20')]);_0x5a3f99[_0x6618('0x1e')]=qs[_0x6618('0x1e')](_0x2d8e90[_0x6618('0x34')][_0x6618('0x1e')]);}return _0x58b4fc[_0x6618('0x57')](_0x5a3f99);}})[_0x6618('0x28')](function(_0x532f26){if(_0x532f26){return _0x532f26?{'count':_0x9f9faf,'rows':_0x532f26}:null;}})[_0x6618('0x28')](respondWithResult(_0x9e126c,null))[_0x6618('0x48')](handleError(_0x9e126c,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 6d7765c..c8fb1d9 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 _0xb1d3=['bluebird','request-promise','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','util','../../config/logger','api'];(function(_0x4aa838,_0x4aa14f){var _0x3abff0=function(_0x402d55){while(--_0x402d55){_0x4aa838['push'](_0x4aa838['shift']());}};_0x3abff0(++_0x4aa14f);}(_0xb1d3,0x81));var _0x3b1d=function(_0xc724e5,_0x11fcdc){_0xc724e5=_0xc724e5-0x0;var _0x363065=_0xb1d3[_0xc724e5];return _0x363065;};'use strict';var _=require('lodash');var util=require(_0x3b1d('0x0'));var logger=require(_0x3b1d('0x1'))(_0x3b1d('0x2'));var moment=require('moment');var BPromise=require(_0x3b1d('0x3'));var rp=require(_0x3b1d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3b1d('0x5'));var attributes=require(_0x3b1d('0x6'));module[_0x3b1d('0x7')]=function(_0x308a19,_0xb65a78){return _0x308a19[_0x3b1d('0x8')](_0x3b1d('0x9'),attributes,{'tableName':_0x3b1d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3709=['request-promise','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','bluebird'];(function(_0x3cec8c,_0x3f6c1d){var _0x38032e=function(_0x4ef75b){while(--_0x4ef75b){_0x3cec8c['push'](_0x3cec8c['shift']());}};_0x38032e(++_0x3f6c1d);}(_0x3709,0xe5));var _0x9370=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x3709[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x9370('0x0'));var util=require(_0x9370('0x1'));var logger=require(_0x9370('0x2'))(_0x9370('0x3'));var moment=require('moment');var BPromise=require(_0x9370('0x4'));var rp=require(_0x9370('0x5'));var fs=require('fs');var path=require(_0x9370('0x6'));var rimraf=require(_0x9370('0x7'));var config=require('../../config/environment');var attributes=require(_0x9370('0x8'));module[_0x9370('0x9')]=function(_0x82ee63,_0x3ab958){return _0x82ee63[_0x9370('0xa')](_0x9370('0xb'),attributes,{'tableName':_0x9370('0xc'),'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 e146ede..7e97964 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 _0x3264=['jayson/promise','client','http','request','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','Automation,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/environment'];(function(_0x48f860,_0x495541){var _0x550734=function(_0x30f5e4){while(--_0x30f5e4){_0x48f860['push'](_0x48f860['shift']());}};_0x550734(++_0x495541);}(_0x3264,0x7f));var _0x4326=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x3264[_0x1caf6a];return _0x1bf493;};'use strict';var _=require('lodash');var util=require(_0x4326('0x0'));var moment=require(_0x4326('0x1'));var BPromise=require(_0x4326('0x2'));var rs=require(_0x4326('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4326('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4326('0x5'));var jayson=require(_0x4326('0x6'));var client=jayson[_0x4326('0x7')][_0x4326('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56bcce,_0x3a7544,_0x2993a1){return new BPromise(function(_0x22071c,_0x129365){return client[_0x4326('0x9')](_0x56bcce,_0x2993a1)[_0x4326('0xa')](function(_0x1609f){logger['info']('Automation,\x20%s,\x20%s',_0x3a7544,_0x4326('0xb'));logger[_0x4326('0xc')](_0x4326('0xd'),_0x3a7544,_0x4326('0xb'),JSON['stringify'](_0x1609f));if(_0x1609f['error']){if(_0x1609f[_0x4326('0xe')]['code']===0x1f4){logger[_0x4326('0xe')](_0x4326('0xf'),_0x3a7544,_0x1609f[_0x4326('0xe')]['message']);return _0x129365(_0x1609f['error'][_0x4326('0x10')]);}logger['error']('Automation,\x20%s,\x20%s',_0x3a7544,_0x1609f[_0x4326('0xe')][_0x4326('0x10')]);return _0x22071c(_0x1609f[_0x4326('0xe')][_0x4326('0x10')]);}else{logger['info'](_0x4326('0xf'),_0x3a7544,_0x4326('0xb'));_0x22071c(_0x1609f[_0x4326('0x11')]['message']);}})[_0x4326('0x12')](function(_0x40c169){logger[_0x4326('0xe')](_0x4326('0xf'),_0x3a7544,_0x40c169);_0x129365(_0x40c169);});});}
\ No newline at end of file
+var _0xa958=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error','message','lodash','moment','bluebird','randomstring'];(function(_0x141a86,_0xefe6c0){var _0x5e7c1b=function(_0x276243){while(--_0x276243){_0x141a86['push'](_0x141a86['shift']());}};_0x5e7c1b(++_0xefe6c0);}(_0xa958,0x94));var _0x8a95=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xa958[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0x8a95('0x0'));var util=require('util');var moment=require(_0x8a95('0x1'));var BPromise=require(_0x8a95('0x2'));var rs=require(_0x8a95('0x3'));var fs=require('fs');var Redis=require(_0x8a95('0x4'));var db=require(_0x8a95('0x5'))['db'];var utils=require(_0x8a95('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8a95('0x7'));var jayson=require(_0x8a95('0x8'));var client=jayson[_0x8a95('0x9')][_0x8a95('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x387db4,_0xdd54e1,_0x161f00){return new BPromise(function(_0x49287d,_0xe03b31){return client[_0x8a95('0xb')](_0x387db4,_0x161f00)[_0x8a95('0xc')](function(_0x240b22){logger[_0x8a95('0xd')](_0x8a95('0xe'),_0xdd54e1,_0x8a95('0xf'));logger['debug'](_0x8a95('0x10'),_0xdd54e1,_0x8a95('0xf'),JSON['stringify'](_0x240b22));if(_0x240b22[_0x8a95('0x11')]){if(_0x240b22['error']['code']===0x1f4){logger[_0x8a95('0x11')]('Automation,\x20%s,\x20%s',_0xdd54e1,_0x240b22[_0x8a95('0x11')][_0x8a95('0x12')]);return _0xe03b31(_0x240b22['error'][_0x8a95('0x12')]);}logger[_0x8a95('0x11')]('Automation,\x20%s,\x20%s',_0xdd54e1,_0x240b22[_0x8a95('0x11')][_0x8a95('0x12')]);return _0x49287d(_0x240b22[_0x8a95('0x11')][_0x8a95('0x12')]);}else{logger[_0x8a95('0xd')](_0x8a95('0xe'),_0xdd54e1,_0x8a95('0xf'));_0x49287d(_0x240b22['result'][_0x8a95('0x12')]);}})['catch'](function(_0x334b18){logger['error'](_0x8a95('0xe'),_0xdd54e1,_0x334b18);_0xe03b31(_0x334b18);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index c0e0aad..bc2c501 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 _0x899a=['/:id/conditions','getConditions','/:id/actions','getActions','addConditions','post','addActions','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x899a,0x1b6));var _0xa899=function(_0x582a71,_0x3594fa){_0x582a71=_0x582a71-0x0;var _0x1c0b81=_0x899a[_0x582a71];return _0x1c0b81;};'use strict';var multer=require(_0xa899('0x0'));var util=require(_0xa899('0x1'));var path=require('path');var timeout=require(_0xa899('0x2'));var express=require(_0xa899('0x3'));var router=express['Router']();var fs_extra=require(_0xa899('0x4'));var auth=require(_0xa899('0x5'));var interaction=require(_0xa899('0x6'));var config=require(_0xa899('0x7'));var controller=require('./automation.controller');router[_0xa899('0x8')]('/',auth[_0xa899('0x9')](),controller[_0xa899('0xa')]);router[_0xa899('0x8')]('/:id',auth[_0xa899('0x9')](),controller[_0xa899('0xb')]);router[_0xa899('0x8')](_0xa899('0xc'),auth[_0xa899('0x9')](),controller[_0xa899('0xd')]);router[_0xa899('0x8')](_0xa899('0xe'),auth[_0xa899('0x9')](),controller[_0xa899('0xf')]);router['post']('/',auth[_0xa899('0x9')](),controller['create']);router['post']('/:id/conditions',auth['isAuthenticated'](),controller[_0xa899('0x10')]);router[_0xa899('0x11')](_0xa899('0xe'),auth['isAuthenticated'](),controller[_0xa899('0x12')]);router[_0xa899('0x13')]('/:id',auth[_0xa899('0x9')](),controller[_0xa899('0x14')]);router[_0xa899('0x15')](_0xa899('0x16'),auth['isAuthenticated'](),controller[_0xa899('0x17')]);module[_0xa899('0x18')]=router;
\ No newline at end of file
+var _0x0d77=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','create','addConditions','post','addActions','put','update','exports','multer','util','path','express','Router'];(function(_0x392f8b,_0x121ff9){var _0x3bea2d=function(_0x25be3e){while(--_0x25be3e){_0x392f8b['push'](_0x392f8b['shift']());}};_0x3bea2d(++_0x121ff9);}(_0x0d77,0x8b));var _0x70d7=function(_0x1627ce,_0x9b92ed){_0x1627ce=_0x1627ce-0x0;var _0xb11196=_0x0d77[_0x1627ce];return _0xb11196;};'use strict';var multer=require(_0x70d7('0x0'));var util=require(_0x70d7('0x1'));var path=require(_0x70d7('0x2'));var timeout=require('connect-timeout');var express=require(_0x70d7('0x3'));var router=express[_0x70d7('0x4')]();var fs_extra=require(_0x70d7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x70d7('0x6'));var config=require(_0x70d7('0x7'));var controller=require('./automation.controller');router[_0x70d7('0x8')]('/',auth[_0x70d7('0x9')](),controller[_0x70d7('0xa')]);router[_0x70d7('0x8')](_0x70d7('0xb'),auth['isAuthenticated'](),controller[_0x70d7('0xc')]);router['get'](_0x70d7('0xd'),auth['isAuthenticated'](),controller[_0x70d7('0xe')]);router['get'](_0x70d7('0xf'),auth[_0x70d7('0x9')](),controller[_0x70d7('0x10')]);router['post']('/',auth[_0x70d7('0x9')](),controller[_0x70d7('0x11')]);router['post']('/:id/conditions',auth[_0x70d7('0x9')](),controller[_0x70d7('0x12')]);router[_0x70d7('0x13')](_0x70d7('0xf'),auth[_0x70d7('0x9')](),controller[_0x70d7('0x14')]);router[_0x70d7('0x15')](_0x70d7('0xb'),auth[_0x70d7('0x9')](),controller[_0x70d7('0x16')]);router['delete'](_0x70d7('0xb'),auth[_0x70d7('0x9')](),controller['destroy']);module[_0x70d7('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 6441ad6..025c245 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 _0x6d11=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x6d11,0xbf));var _0x16d1=function(_0xb381b2,_0x1d209f){_0xb381b2=_0xb381b2-0x0;var _0x3e24fd=_0x6d11[_0xb381b2];return _0x3e24fd;};'use strict';var Sequelize=require(_0x16d1('0x0'));module[_0x16d1('0x1')]={'name':{'type':Sequelize[_0x16d1('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x16d1('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x16d1('0x4')},'description':{'type':Sequelize[_0x16d1('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x16d1('0x5')](0x4)[_0x16d1('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x16d1('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x16d1('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x16d1('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16d1('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x16d1('0x5')](0x5)[_0x16d1('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16d1('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x16d1('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16d1('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x16d1('0x5')](0x5)[_0x16d1('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16d1('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'defaultValue':0x3,'comment':_0x16d1('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x16d1('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16d1('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x16d1('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x16d1('0x2')],'defaultValue':_0x16d1('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x16d1('0x3')](_0x16d1('0x10'),_0x16d1('0x11'),_0x16d1('0x12')),'defaultValue':_0x16d1('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x16d1('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x16d1('0x5')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x16d1('0x5')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x16d1('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x16d1('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x16d1('0x5')](0x9)[_0x16d1('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x16d1('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x16d1('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x16d1('0x5')](0x9)[_0x16d1('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x16d1('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x16d1('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x16d1('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x16d1('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x16d1('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x16d1('0x3')](_0x16d1('0x19'),_0x16d1('0x1a')),'defaultValue':_0x16d1('0x19')},'dialPrefix':{'type':Sequelize[_0x16d1('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x16d1('0x1b')},'dialCutDigit':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x16d1('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16d1('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x16d1('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16d1('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x16d1('0x5')](0x5)[_0x16d1('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16d1('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16d1('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x16d1('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16d1('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16d1('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16d1('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16d1('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x16d1('0x5')](0x5)[_0x16d1('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16d1('0x25')}};
\ No newline at end of file
+var _0x1280=['NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1280,0x98));var _0x0128=function(_0x2bafde,_0x39326c){_0x2bafde=_0x2bafde-0x0;var _0x5733dc=_0x1280[_0x2bafde];return _0x5733dc;};'use strict';var Sequelize=require(_0x0128('0x0'));module[_0x0128('0x1')]={'name':{'type':Sequelize[_0x0128('0x2')],'unique':_0x0128('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x0128('0x4')),'allowNull':![],'defaultValue':_0x0128('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x0128('0x5')],'defaultValue':0x0,'comment':_0x0128('0x6')},'limitCalls':{'type':Sequelize[_0x0128('0x7')](0x4)[_0x0128('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0128('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0128('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x0128('0x7')](0x3)[_0x0128('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x0128('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0128('0x7')](0x5)[_0x0128('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0128('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x0128('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0128('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0128('0x7')](0x5)[_0x0128('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0128('0x8')],'defaultValue':0x3,'comment':_0x0128('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0128('0x7')](0x5)[_0x0128('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0128('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0128('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x0128('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0128('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x0128('0xe')](_0x0128('0xf'),'never',_0x0128('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x0128('0x5')],'defaultValue':0x0,'comment':_0x0128('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x0128('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x0128('0x7')](0x9)[_0x0128('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0128('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0128('0x7')](0x9)[_0x0128('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0128('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0128('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x0128('0x7')](0x9)[_0x0128('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0128('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0128('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0128('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0128('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0128('0x7')](0x9)[_0x0128('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0128('0x18')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0128('0x19')),'defaultValue':_0x0128('0x1a')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x0128('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0128('0x1b')},'dialCutDigit':{'type':Sequelize[_0x0128('0x7')](0x3)[_0x0128('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0128('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0128('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0128('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0128('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0128('0x7')](0x3)[_0x0128('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0128('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0128('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0128('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0128('0x7')](0x5)[_0x0128('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0128('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0128('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0128('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0128('0x20')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 1d69b59..b4688e7 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 _0x1c8a=['cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','select','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','ContactId','NOW()','CmListId','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','error','stack','send','map','rawAttributes','fieldName','type','key','model','name','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','Campaign','include','findAll','catch','show','params','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','getHoppers','findOne','CmHopper','pick','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ListId','field','scheduledAt','toString','from'];(function(_0x16eb3d,_0x157803){var _0x31612a=function(_0xedbb00){while(--_0xedbb00){_0x16eb3d['push'](_0x16eb3d['shift']());}};_0x31612a(++_0x157803);}(_0x1c8a,0x140));var _0xa1c8=function(_0x47dd29,_0x5a47a8){_0x47dd29=_0x47dd29-0x0;var _0x5c1eab=_0x1c8a[_0x47dd29];return _0x5c1eab;};'use strict';var emlformat=require(_0xa1c8('0x0'));var rimraf=require(_0xa1c8('0x1'));var zipdir=require(_0xa1c8('0x2'));var jsonpatch=require(_0xa1c8('0x3'));var rp=require(_0xa1c8('0x4'));var moment=require('moment');var BPromise=require(_0xa1c8('0x5'));var Mustache=require('mustache');var util=require(_0xa1c8('0x6'));var path=require(_0xa1c8('0x7'));var sox=require(_0xa1c8('0x8'));var csv=require('to-csv');var ejs=require(_0xa1c8('0x9'));var fs=require('fs');var fs_extra=require(_0xa1c8('0xa'));var _=require(_0xa1c8('0xb'));var squel=require('squel');var crypto=require(_0xa1c8('0xc'));var jsforce=require(_0xa1c8('0xd'));var deskjs=require(_0xa1c8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa1c8('0xf'));var Papa=require(_0xa1c8('0x10'));var Redis=require(_0xa1c8('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa1c8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa1c8('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa1c8('0x14'));var db=require(_0xa1c8('0x15'))['db'];function respondWithStatusCode(_0x2647fa,_0x707249){_0x707249=_0x707249||0xcc;return function(_0x644e9c){if(_0x644e9c){return _0x2647fa[_0xa1c8('0x16')](_0x707249);}return _0x2647fa['status'](_0x707249)[_0xa1c8('0x17')]();};}function respondWithResult(_0x282525,_0xcccc7b){_0xcccc7b=_0xcccc7b||0xc8;return function(_0x3797fe){if(_0x3797fe){return _0x282525[_0xa1c8('0x18')](_0xcccc7b)[_0xa1c8('0x19')](_0x3797fe);}};}function respondWithFilteredResult(_0x517130,_0x7f1128){return function(_0x51b1c3){if(_0x51b1c3){var _0x17d4d2=typeof _0x7f1128[_0xa1c8('0x1a')]===_0xa1c8('0x1b')&&typeof _0x7f1128['limit']===_0xa1c8('0x1b');var _0x59284a=_0x51b1c3['count'];var _0x1fe87f=_0x17d4d2?0x0:_0x7f1128[_0xa1c8('0x1a')];var _0x57fe23=_0x17d4d2?_0x51b1c3[_0xa1c8('0x1c')]:_0x7f1128[_0xa1c8('0x1a')]+_0x7f1128[_0xa1c8('0x1d')];var _0x4e967e;if(_0x57fe23>=_0x59284a){_0x57fe23=_0x59284a;_0x4e967e=0xc8;}else{_0x4e967e=0xce;}_0x517130[_0xa1c8('0x18')](_0x4e967e);return _0x517130[_0xa1c8('0x1e')](_0xa1c8('0x1f'),_0x1fe87f+'-'+_0x57fe23+'/'+_0x59284a)['json'](_0x51b1c3);}return null;};}function patchUpdates(_0x2eabb2){return function(_0x874b1f){try{jsonpatch['apply'](_0x874b1f,_0x2eabb2,!![]);}catch(_0x38008a){return BPromise[_0xa1c8('0x20')](_0x38008a);}return _0x874b1f[_0xa1c8('0x21')]();};}function saveUpdates(_0x2a7fa5,_0x19fe5a){return function(_0x23ff11){if(_0x23ff11){return _0x23ff11[_0xa1c8('0x22')](_0x2a7fa5)[_0xa1c8('0x23')](function(_0x40bb1d){return _0x40bb1d;});}return null;};}function removeEntity(_0x193077,_0x28473c){return function(_0x125047){if(_0x125047){return _0x125047[_0xa1c8('0x24')]()[_0xa1c8('0x23')](function(){var _0x3f929f=_0x125047[_0xa1c8('0x25')]({'plain':!![]});var _0x572362=_0xa1c8('0x26');return db['UserProfileResource'][_0xa1c8('0x24')]({'where':{'type':_0x572362,'resourceId':_0x3f929f['id']}})['then'](function(){return _0x125047;});})[_0xa1c8('0x23')](function(){_0x193077[_0xa1c8('0x18')](0xcc)[_0xa1c8('0x17')]();});}};}function handleEntityNotFound(_0x4eb627,_0x305148){return function(_0x914018){if(!_0x914018){_0x4eb627[_0xa1c8('0x16')](0x194);}return _0x914018;};}function handleError(_0xa067ae,_0x5d756d){_0x5d756d=_0x5d756d||0x1f4;return function(_0x23131b){logger[_0xa1c8('0x27')](_0x23131b[_0xa1c8('0x28')]);if(_0x23131b['name']){delete _0x23131b['name'];}_0xa067ae[_0xa1c8('0x18')](_0x5d756d)[_0xa1c8('0x29')](_0x23131b);};}exports['index']=function(_0x348356,_0x42326b){var _0xeadfdd={},_0x560b55={},_0x4bd7cf={'count':0x0,'rows':[]};var _0x5c78eb=_[_0xa1c8('0x2a')](db['Campaign'][_0xa1c8('0x2b')],function(_0x2cee8b){return{'name':_0x2cee8b[_0xa1c8('0x2c')],'type':_0x2cee8b[_0xa1c8('0x2d')][_0xa1c8('0x2e')]};});_0x560b55[_0xa1c8('0x2f')]=_['map'](_0x5c78eb,_0xa1c8('0x30'));_0x560b55[_0xa1c8('0x31')]=_[_0xa1c8('0x32')](_0x348356[_0xa1c8('0x31')]);_0x560b55['filters']=_['intersection'](_0x560b55[_0xa1c8('0x2f')],_0x560b55['query']);_0xeadfdd[_0xa1c8('0x33')]=_[_0xa1c8('0x34')](_0x560b55[_0xa1c8('0x2f')],qs[_0xa1c8('0x35')](_0x348356[_0xa1c8('0x31')][_0xa1c8('0x35')]));_0xeadfdd[_0xa1c8('0x33')]=_0xeadfdd[_0xa1c8('0x33')]['length']?_0xeadfdd[_0xa1c8('0x33')]:_0x560b55[_0xa1c8('0x2f')];if(!_0x348356[_0xa1c8('0x31')][_0xa1c8('0x36')](_0xa1c8('0x37'))){_0xeadfdd[_0xa1c8('0x1d')]=qs[_0xa1c8('0x1d')](_0x348356[_0xa1c8('0x31')][_0xa1c8('0x1d')]);_0xeadfdd[_0xa1c8('0x1a')]=qs[_0xa1c8('0x1a')](_0x348356[_0xa1c8('0x31')][_0xa1c8('0x1a')]);}_0xeadfdd[_0xa1c8('0x38')]=qs['sort'](_0x348356['query'][_0xa1c8('0x39')]);_0xeadfdd[_0xa1c8('0x3a')]=qs[_0xa1c8('0x3b')](_['pick'](_0x348356['query'],_0x560b55['filters']),_0x5c78eb);if(_0x348356[_0xa1c8('0x31')]['filter']){_0xeadfdd['where']=_[_0xa1c8('0x3c')](_0xeadfdd[_0xa1c8('0x3a')],{'$or':_[_0xa1c8('0x2a')](_0x5c78eb,function(_0x4d3899){if(_0x4d3899[_0xa1c8('0x2d')]!==_0xa1c8('0x3d')){var _0x585ba2={};_0x585ba2[_0x4d3899[_0xa1c8('0x30')]]={'$like':'%'+_0x348356[_0xa1c8('0x31')][_0xa1c8('0x3e')]+'%'};return _0x585ba2;}})});}_0xeadfdd=_['merge']({},_0xeadfdd,_0x348356[_0xa1c8('0x3f')]);var _0x947616={'where':_0xeadfdd[_0xa1c8('0x3a')]};return db[_0xa1c8('0x40')][_0xa1c8('0x1c')](_0x947616)['then'](function(_0x52aea5){_0x4bd7cf['count']=_0x52aea5;if(_0x348356['query']['includeAll']){_0xeadfdd[_0xa1c8('0x41')]=[{'all':!![]}];}return db[_0xa1c8('0x40')][_0xa1c8('0x42')](_0xeadfdd);})[_0xa1c8('0x23')](function(_0x3a5cd4){_0x4bd7cf['rows']=_0x3a5cd4;return _0x4bd7cf;})['then'](respondWithFilteredResult(_0x42326b,_0xeadfdd))[_0xa1c8('0x43')](handleError(_0x42326b,null));};exports[_0xa1c8('0x44')]=function(_0x1b0fad,_0x4d6e10){var _0x55d0e0={'raw':![],'where':{'id':_0x1b0fad[_0xa1c8('0x45')]['id']}},_0x45a913={};_0x45a913[_0xa1c8('0x2f')]=_[_0xa1c8('0x32')](db[_0xa1c8('0x40')][_0xa1c8('0x2b')]);_0x45a913[_0xa1c8('0x31')]=_['keys'](_0x1b0fad[_0xa1c8('0x31')]);_0x45a913['filters']=_[_0xa1c8('0x34')](_0x45a913[_0xa1c8('0x2f')],_0x45a913[_0xa1c8('0x31')]);_0x55d0e0['attributes']=_[_0xa1c8('0x34')](_0x45a913['model'],qs[_0xa1c8('0x35')](_0x1b0fad[_0xa1c8('0x31')][_0xa1c8('0x35')]));_0x55d0e0['attributes']=_0x55d0e0[_0xa1c8('0x33')][_0xa1c8('0x46')]?_0x55d0e0['attributes']:_0x45a913[_0xa1c8('0x2f')];if(_0x1b0fad[_0xa1c8('0x31')][_0xa1c8('0x47')]){_0x55d0e0[_0xa1c8('0x41')]=[{'all':!![]}];}_0x55d0e0=_[_0xa1c8('0x3c')]({},_0x55d0e0,_0x1b0fad[_0xa1c8('0x3f')]);return db[_0xa1c8('0x40')][_0xa1c8('0x48')](_0x55d0e0)[_0xa1c8('0x23')](handleEntityNotFound(_0x4d6e10,null))['then'](respondWithResult(_0x4d6e10,null))[_0xa1c8('0x43')](handleError(_0x4d6e10,null));};exports[_0xa1c8('0x49')]=function(_0x470479,_0xf29fc){return db['Campaign'][_0xa1c8('0x49')](_0x470479[_0xa1c8('0x4a')],{})[_0xa1c8('0x23')](function(_0x44580d){var _0x364b57=_0x470479['user'][_0xa1c8('0x25')]({'plain':!![]});if(!_0x364b57)throw new Error(_0xa1c8('0x4b'));if(_0x364b57[_0xa1c8('0x4c')]===_0xa1c8('0x4d')){var _0x14ce13=_0x44580d['get']({'plain':!![]});var _0x5bbef3=_0xa1c8('0x26');return db[_0xa1c8('0x4e')][_0xa1c8('0x48')]({'where':{'name':_0x5bbef3,'userProfileId':_0x364b57['userProfileId']},'raw':!![]})[_0xa1c8('0x23')](function(_0x475590){if(_0x475590&&_0x475590[_0xa1c8('0x4f')]===0x0){return db[_0xa1c8('0x50')][_0xa1c8('0x49')]({'name':_0x14ce13[_0xa1c8('0x30')],'resourceId':_0x14ce13['id'],'type':_0x475590[_0xa1c8('0x30')],'sectionId':_0x475590['id']},{})[_0xa1c8('0x23')](function(){return _0x44580d;});}else{return _0x44580d;}})[_0xa1c8('0x43')](function(_0xf13fa3){logger[_0xa1c8('0x27')](_0xa1c8('0x51'),_0xf13fa3);throw _0xf13fa3;});}return _0x44580d;})[_0xa1c8('0x23')](respondWithResult(_0xf29fc,0xc9))['catch'](handleError(_0xf29fc,null));};exports[_0xa1c8('0x52')]=function(_0x1a117a,_0x3fb365){var _0x3d35b4={'where':{'id':_0x1a117a[_0xa1c8('0x45')]['id']}},_0x56a38d={};_0x56a38d[_0xa1c8('0x2f')]=_[_0xa1c8('0x32')](db['Campaign'][_0xa1c8('0x2b')]);_0x3d35b4[_0xa1c8('0x33')]=_[_0xa1c8('0x34')](_0x56a38d[_0xa1c8('0x2f')],qs['fields'](_0x1a117a['query'][_0xa1c8('0x35')]));_0x3d35b4['attributes']=_0x3d35b4[_0xa1c8('0x33')][_0xa1c8('0x46')]?_0x3d35b4[_0xa1c8('0x33')]:_0x56a38d[_0xa1c8('0x2f')];if(_0x1a117a[_0xa1c8('0x31')][_0xa1c8('0x47')]){_0x3d35b4['include']=[{'all':!![]}];}_0x3d35b4=_[_0xa1c8('0x3c')]({},_0x3d35b4,_0x1a117a['options']);return db[_0xa1c8('0x40')]['find'](_0x3d35b4)[_0xa1c8('0x23')](handleEntityNotFound(_0x3fb365,null))[_0xa1c8('0x23')](function(_0x437ca8){if(_0x437ca8){var _0x1ccdd9=_0x437ca8['get']({'plain':!![]});_0x1ccdd9=qs[_0xa1c8('0x53')](_0x1ccdd9,['id',_0xa1c8('0x54'),_0xa1c8('0x55')]);_0x1a117a[_0xa1c8('0x4a')]=_[_0xa1c8('0x53')](_0x1a117a['body'],['id','createdAt',_0xa1c8('0x55')]);return db[_0xa1c8('0x40')]['create'](_[_0xa1c8('0x3c')](_0x1ccdd9,_0x1a117a['body']),{'include':_0x1a117a['query']['includeAll']?[{'all':!![]}]:undefined})[_0xa1c8('0x23')](function(_0x4df225){var _0x529182=_0x1a117a[_0xa1c8('0x4d')]['get']({'plain':!![]});if(!_0x529182)throw new Error(_0xa1c8('0x4b'));if(_0x529182['role']==='user'){var _0x419bbe=_0x4df225[_0xa1c8('0x25')]({'plain':!![]});var _0x2722a7='IvrCampaigns';return db[_0xa1c8('0x4e')][_0xa1c8('0x48')]({'where':{'name':_0x2722a7,'userProfileId':_0x529182[_0xa1c8('0x56')]},'raw':!![]})['then'](function(_0x458579){if(_0x458579&&_0x458579[_0xa1c8('0x4f')]===0x0){return db['UserProfileResource'][_0xa1c8('0x49')]({'name':_0x419bbe[_0xa1c8('0x30')],'resourceId':_0x419bbe['id'],'type':_0x458579[_0xa1c8('0x30')],'sectionId':_0x458579['id']},{})['then'](function(){return _0x4df225;});}else{return _0x4df225;}})[_0xa1c8('0x43')](function(_0x98355b){logger['error'](_0xa1c8('0x51'),_0x98355b);throw _0x98355b;});}return _0x4df225;});}})['then'](respondWithResult(_0x3fb365,0xc9))[_0xa1c8('0x43')](handleError(_0x3fb365,null));};exports['update']=function(_0x125cfb,_0x2938ed){if(_0x125cfb[_0xa1c8('0x4a')]['id']){delete _0x125cfb[_0xa1c8('0x4a')]['id'];}return db[_0xa1c8('0x40')][_0xa1c8('0x48')]({'where':{'id':_0x125cfb[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x2938ed,null))['then'](saveUpdates(_0x125cfb[_0xa1c8('0x4a')],null))[_0xa1c8('0x23')](respondWithResult(_0x2938ed,null))[_0xa1c8('0x43')](handleError(_0x2938ed,null));};exports[_0xa1c8('0x24')]=function(_0xbe6d30,_0x809ee3){return db[_0xa1c8('0x40')][_0xa1c8('0x48')]({'where':{'id':_0xbe6d30[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x809ee3,null))[_0xa1c8('0x23')](removeEntity(_0x809ee3,null))[_0xa1c8('0x43')](handleError(_0x809ee3,null));};exports[_0xa1c8('0x57')]=function(_0x42e30c,_0x2c62b2,_0x15321d){var _0x3dee79={'raw':!![],'where':{}};var _0x1630bc={};var _0x376f19={'count':0x0,'rows':[]};return db[_0xa1c8('0x40')][_0xa1c8('0x58')]({'where':{'id':_0x42e30c[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x2c62b2,null))[_0xa1c8('0x23')](function(_0x7bce81){if(_0x7bce81){_0x1630bc['model']=_[_0xa1c8('0x32')](db[_0xa1c8('0x59')][_0xa1c8('0x2b')]);_0x1630bc[_0xa1c8('0x31')]=_['keys'](_0x42e30c[_0xa1c8('0x31')]);_0x1630bc['filters']=_[_0xa1c8('0x34')](_0x1630bc[_0xa1c8('0x2f')],_0x1630bc[_0xa1c8('0x31')]);_0x3dee79[_0xa1c8('0x33')]=_[_0xa1c8('0x34')](_0x1630bc[_0xa1c8('0x2f')],qs[_0xa1c8('0x35')](_0x42e30c[_0xa1c8('0x31')][_0xa1c8('0x35')]));_0x3dee79[_0xa1c8('0x33')]=_0x3dee79['attributes'][_0xa1c8('0x46')]?_0x3dee79[_0xa1c8('0x33')]:_0x1630bc[_0xa1c8('0x2f')];if(!_0x42e30c[_0xa1c8('0x31')][_0xa1c8('0x36')](_0xa1c8('0x37'))){_0x3dee79[_0xa1c8('0x1d')]=qs[_0xa1c8('0x1d')](_0x42e30c[_0xa1c8('0x31')]['limit']);_0x3dee79['offset']=qs[_0xa1c8('0x1a')](_0x42e30c[_0xa1c8('0x31')]['offset']);}_0x3dee79[_0xa1c8('0x38')]=qs['sort'](_0x42e30c['query'][_0xa1c8('0x39')]);_0x3dee79['where']=qs[_0xa1c8('0x3b')](_[_0xa1c8('0x5a')](_0x42e30c['query'],_0x1630bc['filters']));_0x3dee79[_0xa1c8('0x3a')][_0xa1c8('0x5b')]=_0x7bce81['id'];if(_0x42e30c['query']['filter']){_0x3dee79[_0xa1c8('0x3a')]=_[_0xa1c8('0x3c')](_0x3dee79[_0xa1c8('0x3a')],{'$or':_[_0xa1c8('0x2a')](_0x3dee79[_0xa1c8('0x33')],function(_0xaecf67){var _0x2c0a57={};_0x2c0a57[_0xaecf67]={'$like':'%'+_0x42e30c['query'][_0xa1c8('0x3e')]+'%'};return _0x2c0a57;})});}_0x3dee79=_[_0xa1c8('0x3c')]({},_0x3dee79,_0x42e30c[_0xa1c8('0x3f')]);return db[_0xa1c8('0x59')][_0xa1c8('0x1c')]({'where':_0x3dee79[_0xa1c8('0x3a')]})[_0xa1c8('0x23')](function(_0x15c664){_0x376f19[_0xa1c8('0x1c')]=_0x15c664;if(_0x42e30c[_0xa1c8('0x31')][_0xa1c8('0x47')]){_0x3dee79['include']=[{'all':!![]}];}return db['CmHopper'][_0xa1c8('0x42')](_0x3dee79);})[_0xa1c8('0x23')](function(_0x557dc3){_0x376f19[_0xa1c8('0x5c')]=_0x557dc3;return _0x376f19;});}})['then'](respondWithFilteredResult(_0x2c62b2,_0x3dee79))[_0xa1c8('0x43')](handleError(_0x2c62b2,null));};exports[_0xa1c8('0x5d')]=function(_0x54f3b9,_0x31c23f,_0x9397e7){var _0x467372={'raw':!![],'where':{}};var _0x36d508={};var _0x3bb064={'count':0x0,'rows':[]};return db[_0xa1c8('0x40')][_0xa1c8('0x58')]({'where':{'id':_0x54f3b9['params']['id']}})['then'](handleEntityNotFound(_0x31c23f,null))[_0xa1c8('0x23')](function(_0x4b829f){if(_0x4b829f){_0x36d508[_0xa1c8('0x2f')]=_[_0xa1c8('0x32')](db[_0xa1c8('0x5e')][_0xa1c8('0x2b')]);_0x36d508['query']=_['keys'](_0x54f3b9['query']);_0x36d508[_0xa1c8('0x3b')]=_[_0xa1c8('0x34')](_0x36d508[_0xa1c8('0x2f')],_0x36d508[_0xa1c8('0x31')]);_0x467372[_0xa1c8('0x33')]=_[_0xa1c8('0x34')](_0x36d508['model'],qs[_0xa1c8('0x35')](_0x54f3b9[_0xa1c8('0x31')][_0xa1c8('0x35')]));_0x467372[_0xa1c8('0x33')]=_0x467372['attributes']['length']?_0x467372[_0xa1c8('0x33')]:_0x36d508[_0xa1c8('0x2f')];if(!_0x54f3b9[_0xa1c8('0x31')][_0xa1c8('0x36')](_0xa1c8('0x37'))){_0x467372[_0xa1c8('0x1d')]=qs[_0xa1c8('0x1d')](_0x54f3b9[_0xa1c8('0x31')][_0xa1c8('0x1d')]);_0x467372[_0xa1c8('0x1a')]=qs[_0xa1c8('0x1a')](_0x54f3b9[_0xa1c8('0x31')][_0xa1c8('0x1a')]);}_0x467372[_0xa1c8('0x38')]=qs[_0xa1c8('0x39')](_0x54f3b9[_0xa1c8('0x31')]['sort']);_0x467372['where']=qs['filters'](_[_0xa1c8('0x5a')](_0x54f3b9[_0xa1c8('0x31')],_0x36d508[_0xa1c8('0x3b')]));_0x467372['where'][_0xa1c8('0x5b')]=_0x4b829f['id'];if(_0x54f3b9[_0xa1c8('0x31')][_0xa1c8('0x3e')]){_0x467372[_0xa1c8('0x3a')]=_[_0xa1c8('0x3c')](_0x467372['where'],{'$or':_[_0xa1c8('0x2a')](_0x467372[_0xa1c8('0x33')],function(_0x3d71fc){var _0x17ebe8={};_0x17ebe8[_0x3d71fc]={'$like':'%'+_0x54f3b9[_0xa1c8('0x31')]['filter']+'%'};return _0x17ebe8;})});}_0x467372=_[_0xa1c8('0x3c')]({},_0x467372,_0x54f3b9[_0xa1c8('0x3f')]);return db[_0xa1c8('0x5e')]['count']({'where':_0x467372[_0xa1c8('0x3a')]})[_0xa1c8('0x23')](function(_0x4797b3){_0x3bb064[_0xa1c8('0x1c')]=_0x4797b3;if(_0x54f3b9[_0xa1c8('0x31')]['includeAll']){_0x467372[_0xa1c8('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xa1c8('0x42')](_0x467372);})['then'](function(_0x1e1128){_0x3bb064[_0xa1c8('0x5c')]=_0x1e1128;return _0x3bb064;});}})[_0xa1c8('0x23')](respondWithFilteredResult(_0x31c23f,_0x467372))[_0xa1c8('0x43')](handleError(_0x31c23f,null));};exports[_0xa1c8('0x5f')]=function(_0x5ee23c,_0x514d1f,_0x432c54){var _0x1eb4ac={'raw':!![],'where':{}};var _0x30c9e9={};var _0x369590={'count':0x0,'rows':[]};return db[_0xa1c8('0x40')][_0xa1c8('0x58')]({'where':{'id':_0x5ee23c[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x514d1f,null))[_0xa1c8('0x23')](function(_0x5709cb){if(_0x5709cb){_0x30c9e9[_0xa1c8('0x2f')]=_[_0xa1c8('0x32')](db['CmHopperFinal'][_0xa1c8('0x2b')]);_0x30c9e9[_0xa1c8('0x31')]=_[_0xa1c8('0x32')](_0x5ee23c[_0xa1c8('0x31')]);_0x30c9e9[_0xa1c8('0x3b')]=_[_0xa1c8('0x34')](_0x30c9e9['model'],_0x30c9e9[_0xa1c8('0x31')]);_0x1eb4ac[_0xa1c8('0x33')]=_[_0xa1c8('0x34')](_0x30c9e9[_0xa1c8('0x2f')],qs['fields'](_0x5ee23c[_0xa1c8('0x31')][_0xa1c8('0x35')]));_0x1eb4ac['attributes']=_0x1eb4ac[_0xa1c8('0x33')]['length']?_0x1eb4ac[_0xa1c8('0x33')]:_0x30c9e9['model'];if(!_0x5ee23c['query'][_0xa1c8('0x36')](_0xa1c8('0x37'))){_0x1eb4ac['limit']=qs[_0xa1c8('0x1d')](_0x5ee23c[_0xa1c8('0x31')][_0xa1c8('0x1d')]);_0x1eb4ac[_0xa1c8('0x1a')]=qs[_0xa1c8('0x1a')](_0x5ee23c[_0xa1c8('0x31')][_0xa1c8('0x1a')]);}_0x1eb4ac[_0xa1c8('0x38')]=qs['sort'](_0x5ee23c[_0xa1c8('0x31')]['sort']);_0x1eb4ac['where']=qs[_0xa1c8('0x3b')](_[_0xa1c8('0x5a')](_0x5ee23c[_0xa1c8('0x31')],_0x30c9e9[_0xa1c8('0x3b')]));_0x1eb4ac[_0xa1c8('0x3a')][_0xa1c8('0x5b')]=_0x5709cb['id'];if(_0x5ee23c[_0xa1c8('0x31')]['filter']){_0x1eb4ac[_0xa1c8('0x3a')]=_[_0xa1c8('0x3c')](_0x1eb4ac[_0xa1c8('0x3a')],{'$or':_[_0xa1c8('0x2a')](_0x1eb4ac['attributes'],function(_0x50a1b6){var _0x470ef9={};_0x470ef9[_0x50a1b6]={'$like':'%'+_0x5ee23c[_0xa1c8('0x31')][_0xa1c8('0x3e')]+'%'};return _0x470ef9;})});}_0x1eb4ac=_[_0xa1c8('0x3c')]({},_0x1eb4ac,_0x5ee23c['options']);return db[_0xa1c8('0x60')][_0xa1c8('0x1c')]({'where':_0x1eb4ac[_0xa1c8('0x3a')]})[_0xa1c8('0x23')](function(_0x5dee1e){_0x369590[_0xa1c8('0x1c')]=_0x5dee1e;if(_0x5ee23c[_0xa1c8('0x31')]['includeAll']){_0x1eb4ac[_0xa1c8('0x41')]=[{'all':!![]}];}return db[_0xa1c8('0x60')]['findAll'](_0x1eb4ac);})['then'](function(_0x51e6da){_0x369590[_0xa1c8('0x5c')]=_0x51e6da;return _0x369590;});}})[_0xa1c8('0x23')](respondWithFilteredResult(_0x514d1f,_0x1eb4ac))['catch'](handleError(_0x514d1f,null));};exports[_0xa1c8('0x61')]=function(_0x179894,_0x24d2e6,_0xa08588){var _0x5819e0={'raw':!![],'where':{}};var _0x517145={};var _0x4c1297={'count':0x0,'rows':[]};return db[_0xa1c8('0x40')][_0xa1c8('0x58')]({'where':{'id':_0x179894[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x24d2e6,null))[_0xa1c8('0x23')](function(_0x5ecd81){if(_0x5ecd81){_0x517145[_0xa1c8('0x2f')]=_[_0xa1c8('0x32')](db['CmHopperBlack']['rawAttributes']);_0x517145[_0xa1c8('0x31')]=_[_0xa1c8('0x32')](_0x179894[_0xa1c8('0x31')]);_0x517145[_0xa1c8('0x3b')]=_[_0xa1c8('0x34')](_0x517145[_0xa1c8('0x2f')],_0x517145[_0xa1c8('0x31')]);_0x5819e0[_0xa1c8('0x33')]=_['intersection'](_0x517145[_0xa1c8('0x2f')],qs[_0xa1c8('0x35')](_0x179894[_0xa1c8('0x31')]['fields']));_0x5819e0[_0xa1c8('0x33')]=_0x5819e0[_0xa1c8('0x33')]['length']?_0x5819e0[_0xa1c8('0x33')]:_0x517145[_0xa1c8('0x2f')];if(!_0x179894[_0xa1c8('0x31')][_0xa1c8('0x36')](_0xa1c8('0x37'))){_0x5819e0['limit']=qs[_0xa1c8('0x1d')](_0x179894[_0xa1c8('0x31')][_0xa1c8('0x1d')]);_0x5819e0[_0xa1c8('0x1a')]=qs['offset'](_0x179894[_0xa1c8('0x31')][_0xa1c8('0x1a')]);}_0x5819e0[_0xa1c8('0x38')]=qs['sort'](_0x179894[_0xa1c8('0x31')]['sort']);_0x5819e0['where']=qs[_0xa1c8('0x3b')](_['pick'](_0x179894[_0xa1c8('0x31')],_0x517145[_0xa1c8('0x3b')]));_0x5819e0['where'][_0xa1c8('0x5b')]=_0x5ecd81['id'];if(_0x179894[_0xa1c8('0x31')][_0xa1c8('0x3e')]){_0x5819e0[_0xa1c8('0x3a')]=_['merge'](_0x5819e0[_0xa1c8('0x3a')],{'$or':_['map'](_0x5819e0[_0xa1c8('0x33')],function(_0x43144d){var _0x384094={};_0x384094[_0x43144d]={'$like':'%'+_0x179894[_0xa1c8('0x31')][_0xa1c8('0x3e')]+'%'};return _0x384094;})});}_0x5819e0=_['merge']({},_0x5819e0,_0x179894[_0xa1c8('0x3f')]);return db[_0xa1c8('0x62')]['count']({'where':_0x5819e0[_0xa1c8('0x3a')]})[_0xa1c8('0x23')](function(_0x691df5){_0x4c1297[_0xa1c8('0x1c')]=_0x691df5;if(_0x179894[_0xa1c8('0x31')][_0xa1c8('0x47')]){_0x5819e0['include']=[{'all':!![]}];}return db[_0xa1c8('0x62')]['findAll'](_0x5819e0);})[_0xa1c8('0x23')](function(_0x4fc625){_0x4c1297['rows']=_0x4fc625;return _0x4c1297;});}})[_0xa1c8('0x23')](respondWithFilteredResult(_0x24d2e6,_0x5819e0))['catch'](handleError(_0x24d2e6,null));};exports[_0xa1c8('0x63')]=function(_0x263bb9,_0x1c5286,_0x502b29){var _0x241af7={};var _0x5e52cd={};var _0x58e7fb;var _0x500ba9;return db[_0xa1c8('0x40')][_0xa1c8('0x58')]({'where':{'id':_0x263bb9['params']['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x1c5286,null))[_0xa1c8('0x23')](function(_0x8b3dc6){if(_0x8b3dc6){_0x58e7fb=_0x8b3dc6;_0x5e52cd['model']=_[_0xa1c8('0x32')](db[_0xa1c8('0x64')][_0xa1c8('0x2b')]);_0x5e52cd[_0xa1c8('0x31')]=_[_0xa1c8('0x32')](_0x263bb9[_0xa1c8('0x31')]);_0x5e52cd[_0xa1c8('0x3b')]=_['intersection'](_0x5e52cd[_0xa1c8('0x2f')],_0x5e52cd[_0xa1c8('0x31')]);_0x241af7[_0xa1c8('0x33')]=_['intersection'](_0x5e52cd[_0xa1c8('0x2f')],qs[_0xa1c8('0x35')](_0x263bb9[_0xa1c8('0x31')][_0xa1c8('0x35')]));_0x241af7[_0xa1c8('0x33')]=_0x241af7[_0xa1c8('0x33')][_0xa1c8('0x46')]?_0x241af7['attributes']:_0x5e52cd[_0xa1c8('0x2f')];_0x241af7[_0xa1c8('0x38')]=qs['sort'](_0x263bb9['query'][_0xa1c8('0x39')]);_0x241af7[_0xa1c8('0x3a')]=qs[_0xa1c8('0x3b')](_[_0xa1c8('0x5a')](_0x263bb9[_0xa1c8('0x31')],_0x5e52cd['filters']));if(_0x263bb9[_0xa1c8('0x31')][_0xa1c8('0x3e')]){_0x241af7[_0xa1c8('0x3a')]=_['merge'](_0x241af7['where'],{'$or':_[_0xa1c8('0x2a')](_0x241af7[_0xa1c8('0x33')],function(_0x40cbdb){var _0x39a2e5={};_0x39a2e5[_0x40cbdb]={'$like':'%'+_0x263bb9['query'][_0xa1c8('0x3e')]+'%'};return _0x39a2e5;})});}_0x241af7=_[_0xa1c8('0x3c')]({},_0x241af7,_0x263bb9['options']);return _0x58e7fb[_0xa1c8('0x63')](_0x241af7);}})['then'](function(_0x1b09a5){if(_0x1b09a5){_0x500ba9=_0x1b09a5[_0xa1c8('0x46')];if(!_0x263bb9[_0xa1c8('0x31')][_0xa1c8('0x36')](_0xa1c8('0x37'))){_0x241af7[_0xa1c8('0x1d')]=qs[_0xa1c8('0x1d')](_0x263bb9[_0xa1c8('0x31')][_0xa1c8('0x1d')]);_0x241af7[_0xa1c8('0x1a')]=qs[_0xa1c8('0x1a')](_0x263bb9[_0xa1c8('0x31')][_0xa1c8('0x1a')]);}return _0x58e7fb['getLists'](_0x241af7);}})[_0xa1c8('0x23')](function(_0x4f5a4e){if(_0x4f5a4e){return _0x4f5a4e?{'count':_0x500ba9,'rows':_0x4f5a4e}:null;}})[_0xa1c8('0x23')](respondWithResult(_0x1c5286,null))['catch'](handleError(_0x1c5286,null));};exports[_0xa1c8('0x65')]=function(_0x4f3382,_0x1b19ce,_0x3df5ee){var _0x5f3dd8,_0x253b86;var _0x5cd3c8=[];var _0x456956=moment()[_0xa1c8('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0xa1c8('0x48')]({'where':{'id':_0x4f3382[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x1b19ce,null))['then'](function(_0x26e7df){if(_0x26e7df){_0x253b86=_0x26e7df;return _0x26e7df['addLists'](_0x4f3382[_0xa1c8('0x4a')][_0xa1c8('0x67')],_[_0xa1c8('0x53')](_0x4f3382[_0xa1c8('0x4a')],[_0xa1c8('0x67'),'id'])||{});}return null;})['spread'](function(_0x52200a){var _0x18b6fd;var _0x615b5b;_0x5f3dd8=_0x52200a||[];var _0x3a19af=[];if(_0x52200a){for(var _0x3c8715=0x0;_0x3c8715<_0x52200a[_0xa1c8('0x46')];_0x3c8715+=0x1){var _0x135214=_0x52200a[_0x3c8715]['get']({'plain':!![]});_0x253b86['dialCheckDuplicateType']=_0x4f3382[_0xa1c8('0x4a')][_0xa1c8('0x68')]?_0x4f3382[_0xa1c8('0x4a')][_0xa1c8('0x68')]:_0x253b86[_0xa1c8('0x68')];switch(_0x253b86[_0xa1c8('0x68')]){case _0xa1c8('0x69'):_0x18b6fd=squel[_0xa1c8('0x6a')]()[_0xa1c8('0x6b')](_0xa1c8('0x6c'))['fromQuery']([_0xa1c8('0x6d'),'scheduledAt','ContactId',_0xa1c8('0x6e'),_0xa1c8('0x5b'),_0xa1c8('0x54'),_0xa1c8('0x55')],squel['select']()[_0xa1c8('0x6f')](_0xa1c8('0x6d'),_0xa1c8('0x6d'))[_0xa1c8('0x6f')]('NOW()',_0xa1c8('0x70'))['field']('id','ContactId')[_0xa1c8('0x6f')](_0x135214['CmListId'][_0xa1c8('0x71')](),_0xa1c8('0x6e'))[_0xa1c8('0x6f')](_0x4f3382['params']['id'][_0xa1c8('0x71')](),_0xa1c8('0x5b'))[_0xa1c8('0x6f')]('\x27'+_0x456956+'\x27',_0xa1c8('0x54'))[_0xa1c8('0x6f')]('\x27'+_0x456956+'\x27',_0xa1c8('0x55'))[_0xa1c8('0x72')](_0xa1c8('0x73'))[_0xa1c8('0x3a')](_0xa1c8('0x74'))[_0xa1c8('0x3a')](_0xa1c8('0x75'),_0x135214['CmListId']['toString']())['where'](_0xa1c8('0x76'))[_0xa1c8('0x3a')](_0xa1c8('0x77'),squel['select']()['field'](_0xa1c8('0x78'))[_0xa1c8('0x72')]('cm_hopper_final')[_0xa1c8('0x3a')]('CampaignId\x20=\x20?',_0x4f3382['params']['id'][_0xa1c8('0x71')]()))[_0xa1c8('0x3a')](_0xa1c8('0x77'),squel[_0xa1c8('0x79')]()[_0xa1c8('0x6f')](_0xa1c8('0x7a'))[_0xa1c8('0x72')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x4f3382['params']['id']['toString']())))[_0xa1c8('0x71')]();break;case _0xa1c8('0x7b'):_0x18b6fd=squel[_0xa1c8('0x6a')]()[_0xa1c8('0x6b')](_0xa1c8('0x6c'))[_0xa1c8('0x7c')]([_0xa1c8('0x6d'),_0xa1c8('0x70'),_0xa1c8('0x7d'),'ListId','CampaignId',_0xa1c8('0x54'),_0xa1c8('0x55')],squel['select']()[_0xa1c8('0x6f')](_0xa1c8('0x6d'),_0xa1c8('0x6d'))[_0xa1c8('0x6f')](_0xa1c8('0x7e'),'scheduledAt')[_0xa1c8('0x6f')]('id','ContactId')['field'](_0x135214[_0xa1c8('0x7f')][_0xa1c8('0x71')](),_0xa1c8('0x6e'))[_0xa1c8('0x6f')](_0x4f3382['params']['id']['toString'](),_0xa1c8('0x5b'))[_0xa1c8('0x6f')]('\x27'+_0x456956+'\x27',_0xa1c8('0x54'))[_0xa1c8('0x6f')]('\x27'+_0x456956+'\x27',_0xa1c8('0x55'))[_0xa1c8('0x72')](_0xa1c8('0x73'))['where'](_0xa1c8('0x74'))[_0xa1c8('0x3a')]('ListId\x20=\x20?',_0x135214[_0xa1c8('0x7f')][_0xa1c8('0x71')]())['where'](_0xa1c8('0x76'))['where'](_0xa1c8('0x77'),squel[_0xa1c8('0x79')]()[_0xa1c8('0x6f')](_0xa1c8('0x7a'))[_0xa1c8('0x72')]('cm_hopper')[_0xa1c8('0x3a')]('CampaignId\x20=\x20?',_0x4f3382[_0xa1c8('0x45')]['id']['toString']())))[_0xa1c8('0x71')]();break;default:_0x18b6fd=squel['insert']()['into']('cm_hopper')[_0xa1c8('0x7c')](['phone',_0xa1c8('0x70'),_0xa1c8('0x7d'),'ListId',_0xa1c8('0x5b'),_0xa1c8('0x54'),_0xa1c8('0x55')],squel['select']()['field']('phone','phone')[_0xa1c8('0x6f')](_0xa1c8('0x7e'),_0xa1c8('0x70'))[_0xa1c8('0x6f')]('id',_0xa1c8('0x7d'))[_0xa1c8('0x6f')](_0x135214[_0xa1c8('0x7f')][_0xa1c8('0x71')](),_0xa1c8('0x6e'))[_0xa1c8('0x6f')](_0x4f3382[_0xa1c8('0x45')]['id'][_0xa1c8('0x71')](),_0xa1c8('0x5b'))[_0xa1c8('0x6f')]('\x27'+_0x456956+'\x27','createdAt')[_0xa1c8('0x6f')]('\x27'+_0x456956+'\x27','updatedAt')['from']('cm_contacts')[_0xa1c8('0x3a')](_0xa1c8('0x74'))['where'](_0xa1c8('0x75'),_0x135214[_0xa1c8('0x7f')][_0xa1c8('0x71')]())[_0xa1c8('0x3a')](_0xa1c8('0x76')))['toString']();}_0x615b5b=squel['insert']()[_0xa1c8('0x6b')](_0xa1c8('0x80'))[_0xa1c8('0x7c')]([_0xa1c8('0x81'),_0xa1c8('0x70'),'phone',_0xa1c8('0x82'),_0xa1c8('0x54'),_0xa1c8('0x55')],squel[_0xa1c8('0x79')]()[_0xa1c8('0x6f')](_0xa1c8('0x83'),'id')[_0xa1c8('0x6f')](_0xa1c8('0x7e'),'scheduledAt')['field'](_0xa1c8('0x84'),_0xa1c8('0x6d'))[_0xa1c8('0x6f')](_0xa1c8('0x85'),'OrderBy')[_0xa1c8('0x6f')]('\x27'+_0x456956+'\x27',_0xa1c8('0x54'))[_0xa1c8('0x6f')]('\x27'+_0x456956+'\x27',_0xa1c8('0x55'))['from']('cm_contact_has_items','ci')['join'](_0xa1c8('0x6c'),'h',_0xa1c8('0x86'))['where']('h.ListId\x20=\x20?',_0x135214[_0xa1c8('0x7f')][_0xa1c8('0x71')]())[_0xa1c8('0x3a')]('h.CampaignId=?',_0x4f3382[_0xa1c8('0x45')]['id'][_0xa1c8('0x71')]())[_0xa1c8('0x3a')](_0xa1c8('0x87'),_0x456956))[_0xa1c8('0x71')]();_0x3a19af['push'](db[_0xa1c8('0x88')][_0xa1c8('0x31')](_0x18b6fd));_0x5cd3c8[_0xa1c8('0x89')](db[_0xa1c8('0x88')]['query'](_0x615b5b));}return BPromise[_0xa1c8('0x8a')](_0x3a19af);}})[_0xa1c8('0x23')](function(){return BPromise[_0xa1c8('0x8a')](_0x5cd3c8);})['then'](function(){return _0x5f3dd8;})[_0xa1c8('0x23')](respondWithResult(_0x1b19ce,null))[_0xa1c8('0x43')](handleError(_0x1b19ce,null));};exports['removeLists']=function(_0x19f9b1,_0x3375da,_0x52468d){return db[_0xa1c8('0x40')][_0xa1c8('0x48')]({'where':{'id':_0x19f9b1[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x3375da,null))[_0xa1c8('0x23')](function(_0x1292e7){if(_0x1292e7){return _0x1292e7[_0xa1c8('0x8b')](_0x19f9b1['query']['ids']);}})[_0xa1c8('0x23')](function(_0x1f2ff3){if(_0x1f2ff3){return db[_0xa1c8('0x59')][_0xa1c8('0x24')]({'where':{'ListId':_0x19f9b1[_0xa1c8('0x31')][_0xa1c8('0x67')],'CampaignId':_0x19f9b1['params']['id']}})[_0xa1c8('0x23')](function(){return _0x1f2ff3;});}})[_0xa1c8('0x23')](respondWithStatusCode(_0x3375da,null))[_0xa1c8('0x43')](handleError(_0x3375da,null));};exports[_0xa1c8('0x8c')]=function(_0x4e188b,_0x39bd90,_0x51c8ac){var _0x522608={};var _0x399ddc={};var _0x147fce;var _0x1909bb;return db[_0xa1c8('0x40')][_0xa1c8('0x58')]({'where':{'id':_0x4e188b[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x39bd90,null))[_0xa1c8('0x23')](function(_0x1f60e3){if(_0x1f60e3){_0x147fce=_0x1f60e3;_0x399ddc[_0xa1c8('0x2f')]=_[_0xa1c8('0x32')](db[_0xa1c8('0x64')][_0xa1c8('0x2b')]);_0x399ddc['query']=_[_0xa1c8('0x32')](_0x4e188b[_0xa1c8('0x31')]);_0x399ddc['filters']=_['intersection'](_0x399ddc[_0xa1c8('0x2f')],_0x399ddc[_0xa1c8('0x31')]);_0x522608[_0xa1c8('0x33')]=_[_0xa1c8('0x34')](_0x399ddc[_0xa1c8('0x2f')],qs[_0xa1c8('0x35')](_0x4e188b[_0xa1c8('0x31')]['fields']));_0x522608['attributes']=_0x522608[_0xa1c8('0x33')][_0xa1c8('0x46')]?_0x522608[_0xa1c8('0x33')]:_0x399ddc[_0xa1c8('0x2f')];_0x522608['order']=qs[_0xa1c8('0x39')](_0x4e188b[_0xa1c8('0x31')][_0xa1c8('0x39')]);_0x522608['where']=qs['filters'](_[_0xa1c8('0x5a')](_0x4e188b[_0xa1c8('0x31')],_0x399ddc[_0xa1c8('0x3b')]));if(_0x4e188b['query'][_0xa1c8('0x3e')]){_0x522608[_0xa1c8('0x3a')]=_[_0xa1c8('0x3c')](_0x522608[_0xa1c8('0x3a')],{'$or':_[_0xa1c8('0x2a')](_0x522608[_0xa1c8('0x33')],function(_0x1ec82f){var _0x1e63a6={};_0x1e63a6[_0x1ec82f]={'$like':'%'+_0x4e188b[_0xa1c8('0x31')][_0xa1c8('0x3e')]+'%'};return _0x1e63a6;})});}_0x522608=_[_0xa1c8('0x3c')]({},_0x522608,_0x4e188b[_0xa1c8('0x3f')]);return _0x147fce[_0xa1c8('0x8c')](_0x522608);}})['then'](function(_0x498a84){if(_0x498a84){_0x1909bb=_0x498a84['length'];if(!_0x4e188b[_0xa1c8('0x31')]['hasOwnProperty'](_0xa1c8('0x37'))){_0x522608[_0xa1c8('0x1d')]=qs[_0xa1c8('0x1d')](_0x4e188b[_0xa1c8('0x31')][_0xa1c8('0x1d')]);_0x522608[_0xa1c8('0x1a')]=qs['offset'](_0x4e188b[_0xa1c8('0x31')][_0xa1c8('0x1a')]);}return _0x147fce[_0xa1c8('0x8c')](_0x522608);}})['then'](function(_0x595f0a){if(_0x595f0a){return _0x595f0a?{'count':_0x1909bb,'rows':_0x595f0a}:null;}})[_0xa1c8('0x23')](respondWithResult(_0x39bd90,null))[_0xa1c8('0x43')](handleError(_0x39bd90,null));};exports[_0xa1c8('0x8d')]=function(_0x196c41,_0xca5f56,_0x3f495d){var _0x591183,_0x5b7e15;var _0x58ad36=[];var _0xab9b23=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0xa1c8('0x48')]({'where':{'id':_0x196c41[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0xca5f56,null))[_0xa1c8('0x23')](function(_0x10bec3){if(_0x10bec3){_0x5b7e15=_0x10bec3;return _0x10bec3['addBlackLists'](_0x196c41[_0xa1c8('0x4a')][_0xa1c8('0x67')],_[_0xa1c8('0x53')](_0x196c41[_0xa1c8('0x4a')],[_0xa1c8('0x67'),'id'])||{});}return null;})[_0xa1c8('0x8e')](function(_0x420b49){var _0x1cc0ef;var _0x15c987;_0x591183=_0x420b49||[];var _0x32ab13=[];if(_0x420b49){for(var _0xc891a1=0x0;_0xc891a1<_0x420b49[_0xa1c8('0x46')];_0xc891a1+=0x1){var _0x57ca6f=_0x420b49[_0xc891a1][_0xa1c8('0x25')]({'plain':!![]});_0x1cc0ef=squel['insert']()[_0xa1c8('0x6b')](_0xa1c8('0x8f'))[_0xa1c8('0x7c')](['phone','ContactId','ListId',_0xa1c8('0x5b'),_0xa1c8('0x54'),_0xa1c8('0x55')],squel[_0xa1c8('0x79')]()[_0xa1c8('0x6f')](_0xa1c8('0x6d'),_0xa1c8('0x6d'))[_0xa1c8('0x6f')]('id',_0xa1c8('0x7d'))[_0xa1c8('0x6f')](_0x57ca6f[_0xa1c8('0x7f')]['toString'](),_0xa1c8('0x6e'))['field'](_0x196c41[_0xa1c8('0x45')]['id'][_0xa1c8('0x71')](),_0xa1c8('0x5b'))['field'](_0xa1c8('0x7e'),_0xa1c8('0x54'))['field']('NOW()',_0xa1c8('0x55'))[_0xa1c8('0x72')](_0xa1c8('0x73'))[_0xa1c8('0x3a')](_0xa1c8('0x74'))[_0xa1c8('0x3a')]('ListId\x20=\x20?',_0x57ca6f[_0xa1c8('0x7f')][_0xa1c8('0x71')]())['where'](_0xa1c8('0x76')))['toString']();_0x32ab13[_0xa1c8('0x89')](db[_0xa1c8('0x88')][_0xa1c8('0x31')](_0x1cc0ef));}return BPromise['all'](_0x32ab13);}})[_0xa1c8('0x23')](function(){return _0x591183;})[_0xa1c8('0x23')](respondWithResult(_0xca5f56,null))['catch'](handleError(_0xca5f56,null));};exports[_0xa1c8('0x90')]=function(_0x28ad90,_0x42eb01,_0x276439){return db['Campaign'][_0xa1c8('0x48')]({'where':{'id':_0x28ad90[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x42eb01,null))[_0xa1c8('0x23')](function(_0x432ccd){if(_0x432ccd){return _0x432ccd[_0xa1c8('0x90')](_0x28ad90['query'][_0xa1c8('0x67')]);}})['then'](function(_0x4f1eb7){if(_0x4f1eb7){return db[_0xa1c8('0x62')][_0xa1c8('0x24')]({'where':{'ListId':_0x28ad90[_0xa1c8('0x31')][_0xa1c8('0x67')],'CampaignId':_0x28ad90[_0xa1c8('0x45')]['id']}})['then'](function(){return _0x4f1eb7;});}})['then'](respondWithStatusCode(_0x42eb01,null))[_0xa1c8('0x43')](handleError(_0x42eb01,null));};
\ No newline at end of file
+var _0x4242=['field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','phone\x20IS\x20NOT\x20NULL','ListId\x20=\x20?','insert','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','findAll','catch','show','params','length','include','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','body','createdAt','UserProfileSection','userProfileId','autoAssociation','getHoppers','findOne','CampaignId','CmHopper','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','into','cm_hopper','phone','ContactId','ListId','select'];(function(_0x380711,_0x274f90){var _0x23156e=function(_0x139b34){while(--_0x139b34){_0x380711['push'](_0x380711['shift']());}};_0x23156e(++_0x274f90);}(_0x4242,0xb5));var _0x2424=function(_0x41d268,_0x34ed51){_0x41d268=_0x41d268-0x0;var _0x14962d=_0x4242[_0x41d268];return _0x14962d;};'use strict';var emlformat=require(_0x2424('0x0'));var rimraf=require(_0x2424('0x1'));var zipdir=require(_0x2424('0x2'));var jsonpatch=require(_0x2424('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2424('0x4'));var Mustache=require(_0x2424('0x5'));var util=require(_0x2424('0x6'));var path=require('path');var sox=require(_0x2424('0x7'));var csv=require(_0x2424('0x8'));var ejs=require(_0x2424('0x9'));var fs=require('fs');var fs_extra=require(_0x2424('0xa'));var _=require(_0x2424('0xb'));var squel=require('squel');var crypto=require(_0x2424('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2424('0x8'));var querystring=require(_0x2424('0xd'));var Papa=require(_0x2424('0xe'));var Redis=require('ioredis');var authService=require(_0x2424('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2424('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2424('0x11'))(_0x2424('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2424('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa18032,_0x35926e){_0x35926e=_0x35926e||0xcc;return function(_0x4a0d97){if(_0x4a0d97){return _0xa18032[_0x2424('0x14')](_0x35926e);}return _0xa18032[_0x2424('0x15')](_0x35926e)[_0x2424('0x16')]();};}function respondWithResult(_0x449b27,_0x6cbc4d){_0x6cbc4d=_0x6cbc4d||0xc8;return function(_0x28d9eb){if(_0x28d9eb){return _0x449b27['status'](_0x6cbc4d)[_0x2424('0x17')](_0x28d9eb);}};}function respondWithFilteredResult(_0x5922ef,_0x4af4c4){return function(_0x5b1ed9){if(_0x5b1ed9){var _0x9798ad=typeof _0x4af4c4['offset']===_0x2424('0x18')&&typeof _0x4af4c4[_0x2424('0x19')]===_0x2424('0x18');var _0x363a15=_0x5b1ed9[_0x2424('0x1a')];var _0x26a9ce=_0x9798ad?0x0:_0x4af4c4['offset'];var _0x2becd7=_0x9798ad?_0x5b1ed9['count']:_0x4af4c4['offset']+_0x4af4c4[_0x2424('0x19')];var _0x390b4c;if(_0x2becd7>=_0x363a15){_0x2becd7=_0x363a15;_0x390b4c=0xc8;}else{_0x390b4c=0xce;}_0x5922ef[_0x2424('0x15')](_0x390b4c);return _0x5922ef[_0x2424('0x1b')]('Content-Range',_0x26a9ce+'-'+_0x2becd7+'/'+_0x363a15)['json'](_0x5b1ed9);}return null;};}function patchUpdates(_0x4ebd68){return function(_0x5468e1){try{jsonpatch[_0x2424('0x1c')](_0x5468e1,_0x4ebd68,!![]);}catch(_0x14e96b){return BPromise[_0x2424('0x1d')](_0x14e96b);}return _0x5468e1[_0x2424('0x1e')]();};}function saveUpdates(_0x33346b,_0x176a05){return function(_0x4e7f2d){if(_0x4e7f2d){return _0x4e7f2d[_0x2424('0x1f')](_0x33346b)[_0x2424('0x20')](function(_0xf2352f){return _0xf2352f;});}return null;};}function removeEntity(_0x6de5a0,_0x155d6f){return function(_0x4787cc){if(_0x4787cc){return _0x4787cc['destroy']()[_0x2424('0x20')](function(){var _0x1c9b1e=_0x4787cc[_0x2424('0x21')]({'plain':!![]});var _0x346576=_0x2424('0x22');return db[_0x2424('0x23')][_0x2424('0x24')]({'where':{'type':_0x346576,'resourceId':_0x1c9b1e['id']}})[_0x2424('0x20')](function(){return _0x4787cc;});})[_0x2424('0x20')](function(){_0x6de5a0[_0x2424('0x15')](0xcc)[_0x2424('0x16')]();});}};}function handleEntityNotFound(_0x1e9f18,_0x32914c){return function(_0x3c32a5){if(!_0x3c32a5){_0x1e9f18[_0x2424('0x14')](0x194);}return _0x3c32a5;};}function handleError(_0x178458,_0x21e87e){_0x21e87e=_0x21e87e||0x1f4;return function(_0x4e5770){logger['error'](_0x4e5770[_0x2424('0x25')]);if(_0x4e5770[_0x2424('0x26')]){delete _0x4e5770[_0x2424('0x26')];}_0x178458['status'](_0x21e87e)[_0x2424('0x27')](_0x4e5770);};}exports[_0x2424('0x28')]=function(_0x359d0b,_0xc0bec2){var _0x41c9d1={},_0x355f8c={},_0x4f5318={'count':0x0,'rows':[]};var _0xc88f0=_[_0x2424('0x29')](db[_0x2424('0x2a')][_0x2424('0x2b')],function(_0x3a5fff){return{'name':_0x3a5fff[_0x2424('0x2c')],'type':_0x3a5fff['type'][_0x2424('0x2d')]};});_0x355f8c[_0x2424('0x2e')]=_[_0x2424('0x29')](_0xc88f0,_0x2424('0x26'));_0x355f8c[_0x2424('0x2f')]=_[_0x2424('0x30')](_0x359d0b[_0x2424('0x2f')]);_0x355f8c[_0x2424('0x31')]=_[_0x2424('0x32')](_0x355f8c[_0x2424('0x2e')],_0x355f8c[_0x2424('0x2f')]);_0x41c9d1[_0x2424('0x33')]=_[_0x2424('0x32')](_0x355f8c[_0x2424('0x2e')],qs[_0x2424('0x34')](_0x359d0b[_0x2424('0x2f')][_0x2424('0x34')]));_0x41c9d1[_0x2424('0x33')]=_0x41c9d1[_0x2424('0x33')]['length']?_0x41c9d1[_0x2424('0x33')]:_0x355f8c[_0x2424('0x2e')];if(!_0x359d0b[_0x2424('0x2f')][_0x2424('0x35')](_0x2424('0x36'))){_0x41c9d1[_0x2424('0x19')]=qs[_0x2424('0x19')](_0x359d0b['query'][_0x2424('0x19')]);_0x41c9d1[_0x2424('0x37')]=qs[_0x2424('0x37')](_0x359d0b[_0x2424('0x2f')][_0x2424('0x37')]);}_0x41c9d1[_0x2424('0x38')]=qs[_0x2424('0x39')](_0x359d0b[_0x2424('0x2f')]['sort']);_0x41c9d1[_0x2424('0x3a')]=qs[_0x2424('0x31')](_[_0x2424('0x3b')](_0x359d0b[_0x2424('0x2f')],_0x355f8c[_0x2424('0x31')]),_0xc88f0);if(_0x359d0b['query'][_0x2424('0x3c')]){_0x41c9d1[_0x2424('0x3a')]=_['merge'](_0x41c9d1[_0x2424('0x3a')],{'$or':_[_0x2424('0x29')](_0xc88f0,function(_0x34b67f){if(_0x34b67f[_0x2424('0x3d')]!==_0x2424('0x3e')){var _0x5ce73c={};_0x5ce73c[_0x34b67f[_0x2424('0x26')]]={'$like':'%'+_0x359d0b['query'][_0x2424('0x3c')]+'%'};return _0x5ce73c;}})});}_0x41c9d1=_[_0x2424('0x3f')]({},_0x41c9d1,_0x359d0b['options']);var _0x3765a4={'where':_0x41c9d1[_0x2424('0x3a')]};return db['Campaign'][_0x2424('0x1a')](_0x3765a4)[_0x2424('0x20')](function(_0xa3890c){_0x4f5318[_0x2424('0x1a')]=_0xa3890c;if(_0x359d0b['query'][_0x2424('0x40')]){_0x41c9d1['include']=[{'all':!![]}];}return db['Campaign'][_0x2424('0x41')](_0x41c9d1);})['then'](function(_0x2eb008){_0x4f5318['rows']=_0x2eb008;return _0x4f5318;})[_0x2424('0x20')](respondWithFilteredResult(_0xc0bec2,_0x41c9d1))[_0x2424('0x42')](handleError(_0xc0bec2,null));};exports[_0x2424('0x43')]=function(_0x1732af,_0x592fef){var _0x50cbad={'raw':![],'where':{'id':_0x1732af[_0x2424('0x44')]['id']}},_0xe497e9={};_0xe497e9[_0x2424('0x2e')]=_[_0x2424('0x30')](db[_0x2424('0x2a')][_0x2424('0x2b')]);_0xe497e9[_0x2424('0x2f')]=_[_0x2424('0x30')](_0x1732af[_0x2424('0x2f')]);_0xe497e9[_0x2424('0x31')]=_['intersection'](_0xe497e9[_0x2424('0x2e')],_0xe497e9[_0x2424('0x2f')]);_0x50cbad[_0x2424('0x33')]=_[_0x2424('0x32')](_0xe497e9[_0x2424('0x2e')],qs[_0x2424('0x34')](_0x1732af['query'][_0x2424('0x34')]));_0x50cbad[_0x2424('0x33')]=_0x50cbad[_0x2424('0x33')][_0x2424('0x45')]?_0x50cbad[_0x2424('0x33')]:_0xe497e9['model'];if(_0x1732af[_0x2424('0x2f')][_0x2424('0x40')]){_0x50cbad[_0x2424('0x46')]=[{'all':!![]}];}_0x50cbad=_[_0x2424('0x3f')]({},_0x50cbad,_0x1732af[_0x2424('0x47')]);return db[_0x2424('0x2a')]['find'](_0x50cbad)[_0x2424('0x20')](handleEntityNotFound(_0x592fef,null))['then'](respondWithResult(_0x592fef,null))['catch'](handleError(_0x592fef,null));};exports[_0x2424('0x48')]=function(_0x396545,_0x117b24){return db[_0x2424('0x2a')][_0x2424('0x48')](_0x396545['body'],{})[_0x2424('0x20')](function(_0x21aa9a){var _0x29cf75=_0x396545[_0x2424('0x49')][_0x2424('0x21')]({'plain':!![]});if(!_0x29cf75)throw new Error(_0x2424('0x4a'));if(_0x29cf75[_0x2424('0x4b')]===_0x2424('0x49')){var _0x2a2310=_0x21aa9a[_0x2424('0x21')]({'plain':!![]});var _0x103ce7=_0x2424('0x22');return db['UserProfileSection'][_0x2424('0x4c')]({'where':{'name':_0x103ce7,'userProfileId':_0x29cf75['userProfileId']},'raw':!![]})[_0x2424('0x20')](function(_0x41e97b){if(_0x41e97b&&_0x41e97b['autoAssociation']===0x0){return db[_0x2424('0x23')][_0x2424('0x48')]({'name':_0x2a2310[_0x2424('0x26')],'resourceId':_0x2a2310['id'],'type':_0x41e97b[_0x2424('0x26')],'sectionId':_0x41e97b['id']},{})[_0x2424('0x20')](function(){return _0x21aa9a;});}else{return _0x21aa9a;}})[_0x2424('0x42')](function(_0x25ed24){logger[_0x2424('0x4d')](_0x2424('0x4e'),_0x25ed24);throw _0x25ed24;});}return _0x21aa9a;})[_0x2424('0x20')](respondWithResult(_0x117b24,0xc9))['catch'](handleError(_0x117b24,null));};exports['clone']=function(_0x32c4d5,_0x17cc8b){var _0x22b37e={'where':{'id':_0x32c4d5[_0x2424('0x44')]['id']}},_0x3e7017={};_0x3e7017[_0x2424('0x2e')]=_[_0x2424('0x30')](db[_0x2424('0x2a')][_0x2424('0x2b')]);_0x22b37e[_0x2424('0x33')]=_[_0x2424('0x32')](_0x3e7017[_0x2424('0x2e')],qs[_0x2424('0x34')](_0x32c4d5[_0x2424('0x2f')][_0x2424('0x34')]));_0x22b37e[_0x2424('0x33')]=_0x22b37e[_0x2424('0x33')]['length']?_0x22b37e[_0x2424('0x33')]:_0x3e7017[_0x2424('0x2e')];if(_0x32c4d5['query'][_0x2424('0x40')]){_0x22b37e['include']=[{'all':!![]}];}_0x22b37e=_[_0x2424('0x3f')]({},_0x22b37e,_0x32c4d5[_0x2424('0x47')]);return db['Campaign']['find'](_0x22b37e)[_0x2424('0x20')](handleEntityNotFound(_0x17cc8b,null))['then'](function(_0x580b5e){if(_0x580b5e){var _0x47e1ec=_0x580b5e[_0x2424('0x21')]({'plain':!![]});_0x47e1ec=qs[_0x2424('0x4f')](_0x47e1ec,['id','createdAt',_0x2424('0x50')]);_0x32c4d5[_0x2424('0x51')]=_[_0x2424('0x4f')](_0x32c4d5['body'],['id',_0x2424('0x52'),_0x2424('0x50')]);return db[_0x2424('0x2a')]['create'](_[_0x2424('0x3f')](_0x47e1ec,_0x32c4d5['body']),{'include':_0x32c4d5[_0x2424('0x2f')][_0x2424('0x40')]?[{'all':!![]}]:undefined})[_0x2424('0x20')](function(_0x1ed445){var _0x49b040=_0x32c4d5['user'][_0x2424('0x21')]({'plain':!![]});if(!_0x49b040)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49b040[_0x2424('0x4b')]===_0x2424('0x49')){var _0x49c2a8=_0x1ed445['get']({'plain':!![]});var _0x40b356=_0x2424('0x22');return db[_0x2424('0x53')][_0x2424('0x4c')]({'where':{'name':_0x40b356,'userProfileId':_0x49b040[_0x2424('0x54')]},'raw':!![]})[_0x2424('0x20')](function(_0x5bd6ac){if(_0x5bd6ac&&_0x5bd6ac[_0x2424('0x55')]===0x0){return db[_0x2424('0x23')]['create']({'name':_0x49c2a8[_0x2424('0x26')],'resourceId':_0x49c2a8['id'],'type':_0x5bd6ac[_0x2424('0x26')],'sectionId':_0x5bd6ac['id']},{})[_0x2424('0x20')](function(){return _0x1ed445;});}else{return _0x1ed445;}})['catch'](function(_0x31ce02){logger[_0x2424('0x4d')](_0x2424('0x4e'),_0x31ce02);throw _0x31ce02;});}return _0x1ed445;});}})[_0x2424('0x20')](respondWithResult(_0x17cc8b,0xc9))['catch'](handleError(_0x17cc8b,null));};exports[_0x2424('0x1f')]=function(_0x28c04c,_0x54b0c5){if(_0x28c04c['body']['id']){delete _0x28c04c['body']['id'];}return db[_0x2424('0x2a')][_0x2424('0x4c')]({'where':{'id':_0x28c04c[_0x2424('0x44')]['id']}})[_0x2424('0x20')](handleEntityNotFound(_0x54b0c5,null))[_0x2424('0x20')](saveUpdates(_0x28c04c[_0x2424('0x51')],null))[_0x2424('0x20')](respondWithResult(_0x54b0c5,null))['catch'](handleError(_0x54b0c5,null));};exports[_0x2424('0x24')]=function(_0xa22f3b,_0x43484b){return db[_0x2424('0x2a')][_0x2424('0x4c')]({'where':{'id':_0xa22f3b[_0x2424('0x44')]['id']}})[_0x2424('0x20')](handleEntityNotFound(_0x43484b,null))['then'](removeEntity(_0x43484b,null))[_0x2424('0x42')](handleError(_0x43484b,null));};exports[_0x2424('0x56')]=function(_0x1c1ce6,_0x23bb5f,_0x5a8377){var _0xc0c2ee={'raw':!![],'where':{}};var _0x3a3b76={};var _0x1a88b7={'count':0x0,'rows':[]};return db[_0x2424('0x2a')][_0x2424('0x57')]({'where':{'id':_0x1c1ce6['params']['id']}})[_0x2424('0x20')](handleEntityNotFound(_0x23bb5f,null))[_0x2424('0x20')](function(_0x2bb46e){if(_0x2bb46e){_0x3a3b76['model']=_[_0x2424('0x30')](db['CmHopper'][_0x2424('0x2b')]);_0x3a3b76[_0x2424('0x2f')]=_['keys'](_0x1c1ce6['query']);_0x3a3b76['filters']=_['intersection'](_0x3a3b76[_0x2424('0x2e')],_0x3a3b76[_0x2424('0x2f')]);_0xc0c2ee[_0x2424('0x33')]=_[_0x2424('0x32')](_0x3a3b76[_0x2424('0x2e')],qs['fields'](_0x1c1ce6[_0x2424('0x2f')]['fields']));_0xc0c2ee[_0x2424('0x33')]=_0xc0c2ee[_0x2424('0x33')][_0x2424('0x45')]?_0xc0c2ee[_0x2424('0x33')]:_0x3a3b76['model'];if(!_0x1c1ce6['query'][_0x2424('0x35')](_0x2424('0x36'))){_0xc0c2ee[_0x2424('0x19')]=qs[_0x2424('0x19')](_0x1c1ce6[_0x2424('0x2f')]['limit']);_0xc0c2ee['offset']=qs['offset'](_0x1c1ce6[_0x2424('0x2f')][_0x2424('0x37')]);}_0xc0c2ee[_0x2424('0x38')]=qs[_0x2424('0x39')](_0x1c1ce6[_0x2424('0x2f')][_0x2424('0x39')]);_0xc0c2ee['where']=qs['filters'](_['pick'](_0x1c1ce6[_0x2424('0x2f')],_0x3a3b76[_0x2424('0x31')]));_0xc0c2ee['where'][_0x2424('0x58')]=_0x2bb46e['id'];if(_0x1c1ce6[_0x2424('0x2f')][_0x2424('0x3c')]){_0xc0c2ee[_0x2424('0x3a')]=_[_0x2424('0x3f')](_0xc0c2ee[_0x2424('0x3a')],{'$or':_['map'](_0xc0c2ee[_0x2424('0x33')],function(_0x53efd3){var _0x4de1f8={};_0x4de1f8[_0x53efd3]={'$like':'%'+_0x1c1ce6[_0x2424('0x2f')][_0x2424('0x3c')]+'%'};return _0x4de1f8;})});}_0xc0c2ee=_['merge']({},_0xc0c2ee,_0x1c1ce6['options']);return db['CmHopper'][_0x2424('0x1a')]({'where':_0xc0c2ee[_0x2424('0x3a')]})['then'](function(_0x5329eb){_0x1a88b7['count']=_0x5329eb;if(_0x1c1ce6[_0x2424('0x2f')][_0x2424('0x40')]){_0xc0c2ee['include']=[{'all':!![]}];}return db[_0x2424('0x59')][_0x2424('0x41')](_0xc0c2ee);})[_0x2424('0x20')](function(_0x22b950){_0x1a88b7[_0x2424('0x5a')]=_0x22b950;return _0x1a88b7;});}})['then'](respondWithFilteredResult(_0x23bb5f,_0xc0c2ee))[_0x2424('0x42')](handleError(_0x23bb5f,null));};exports[_0x2424('0x5b')]=function(_0x2bd44e,_0x44cab1,_0x1a9e01){var _0x1bfa59={'raw':!![],'where':{}};var _0x36a853={};var _0x234d6f={'count':0x0,'rows':[]};return db[_0x2424('0x2a')]['findOne']({'where':{'id':_0x2bd44e[_0x2424('0x44')]['id']}})[_0x2424('0x20')](handleEntityNotFound(_0x44cab1,null))['then'](function(_0x559a9f){if(_0x559a9f){_0x36a853['model']=_[_0x2424('0x30')](db['CmHopperHistory'][_0x2424('0x2b')]);_0x36a853[_0x2424('0x2f')]=_['keys'](_0x2bd44e['query']);_0x36a853[_0x2424('0x31')]=_[_0x2424('0x32')](_0x36a853[_0x2424('0x2e')],_0x36a853[_0x2424('0x2f')]);_0x1bfa59[_0x2424('0x33')]=_[_0x2424('0x32')](_0x36a853[_0x2424('0x2e')],qs['fields'](_0x2bd44e['query'][_0x2424('0x34')]));_0x1bfa59[_0x2424('0x33')]=_0x1bfa59['attributes']['length']?_0x1bfa59[_0x2424('0x33')]:_0x36a853[_0x2424('0x2e')];if(!_0x2bd44e[_0x2424('0x2f')][_0x2424('0x35')](_0x2424('0x36'))){_0x1bfa59[_0x2424('0x19')]=qs['limit'](_0x2bd44e[_0x2424('0x2f')][_0x2424('0x19')]);_0x1bfa59[_0x2424('0x37')]=qs['offset'](_0x2bd44e[_0x2424('0x2f')][_0x2424('0x37')]);}_0x1bfa59[_0x2424('0x38')]=qs[_0x2424('0x39')](_0x2bd44e['query']['sort']);_0x1bfa59['where']=qs[_0x2424('0x31')](_[_0x2424('0x3b')](_0x2bd44e[_0x2424('0x2f')],_0x36a853[_0x2424('0x31')]));_0x1bfa59['where']['CampaignId']=_0x559a9f['id'];if(_0x2bd44e['query'][_0x2424('0x3c')]){_0x1bfa59[_0x2424('0x3a')]=_[_0x2424('0x3f')](_0x1bfa59[_0x2424('0x3a')],{'$or':_[_0x2424('0x29')](_0x1bfa59[_0x2424('0x33')],function(_0x2141fd){var _0x645a00={};_0x645a00[_0x2141fd]={'$like':'%'+_0x2bd44e[_0x2424('0x2f')][_0x2424('0x3c')]+'%'};return _0x645a00;})});}_0x1bfa59=_[_0x2424('0x3f')]({},_0x1bfa59,_0x2bd44e['options']);return db[_0x2424('0x5c')][_0x2424('0x1a')]({'where':_0x1bfa59[_0x2424('0x3a')]})['then'](function(_0x10a1a3){_0x234d6f[_0x2424('0x1a')]=_0x10a1a3;if(_0x2bd44e['query']['includeAll']){_0x1bfa59[_0x2424('0x46')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x1bfa59);})[_0x2424('0x20')](function(_0x5703ad){_0x234d6f[_0x2424('0x5a')]=_0x5703ad;return _0x234d6f;});}})[_0x2424('0x20')](respondWithFilteredResult(_0x44cab1,_0x1bfa59))['catch'](handleError(_0x44cab1,null));};exports[_0x2424('0x5d')]=function(_0x5cac35,_0x334eec,_0x216df9){var _0x3caa67={'raw':!![],'where':{}};var _0x1da12b={};var _0x4ceeac={'count':0x0,'rows':[]};return db[_0x2424('0x2a')][_0x2424('0x57')]({'where':{'id':_0x5cac35[_0x2424('0x44')]['id']}})['then'](handleEntityNotFound(_0x334eec,null))[_0x2424('0x20')](function(_0x9dc490){if(_0x9dc490){_0x1da12b[_0x2424('0x2e')]=_[_0x2424('0x30')](db[_0x2424('0x5e')]['rawAttributes']);_0x1da12b[_0x2424('0x2f')]=_[_0x2424('0x30')](_0x5cac35[_0x2424('0x2f')]);_0x1da12b[_0x2424('0x31')]=_[_0x2424('0x32')](_0x1da12b['model'],_0x1da12b[_0x2424('0x2f')]);_0x3caa67[_0x2424('0x33')]=_[_0x2424('0x32')](_0x1da12b[_0x2424('0x2e')],qs[_0x2424('0x34')](_0x5cac35[_0x2424('0x2f')]['fields']));_0x3caa67[_0x2424('0x33')]=_0x3caa67['attributes']['length']?_0x3caa67['attributes']:_0x1da12b[_0x2424('0x2e')];if(!_0x5cac35[_0x2424('0x2f')][_0x2424('0x35')](_0x2424('0x36'))){_0x3caa67[_0x2424('0x19')]=qs['limit'](_0x5cac35[_0x2424('0x2f')]['limit']);_0x3caa67['offset']=qs[_0x2424('0x37')](_0x5cac35['query'][_0x2424('0x37')]);}_0x3caa67[_0x2424('0x38')]=qs[_0x2424('0x39')](_0x5cac35[_0x2424('0x2f')][_0x2424('0x39')]);_0x3caa67[_0x2424('0x3a')]=qs[_0x2424('0x31')](_[_0x2424('0x3b')](_0x5cac35[_0x2424('0x2f')],_0x1da12b[_0x2424('0x31')]));_0x3caa67[_0x2424('0x3a')][_0x2424('0x58')]=_0x9dc490['id'];if(_0x5cac35[_0x2424('0x2f')][_0x2424('0x3c')]){_0x3caa67[_0x2424('0x3a')]=_[_0x2424('0x3f')](_0x3caa67['where'],{'$or':_['map'](_0x3caa67['attributes'],function(_0x151557){var _0x3b3a61={};_0x3b3a61[_0x151557]={'$like':'%'+_0x5cac35[_0x2424('0x2f')][_0x2424('0x3c')]+'%'};return _0x3b3a61;})});}_0x3caa67=_['merge']({},_0x3caa67,_0x5cac35[_0x2424('0x47')]);return db[_0x2424('0x5e')]['count']({'where':_0x3caa67[_0x2424('0x3a')]})[_0x2424('0x20')](function(_0xa59944){_0x4ceeac[_0x2424('0x1a')]=_0xa59944;if(_0x5cac35[_0x2424('0x2f')][_0x2424('0x40')]){_0x3caa67[_0x2424('0x46')]=[{'all':!![]}];}return db[_0x2424('0x5e')][_0x2424('0x41')](_0x3caa67);})[_0x2424('0x20')](function(_0x2b93ed){_0x4ceeac[_0x2424('0x5a')]=_0x2b93ed;return _0x4ceeac;});}})['then'](respondWithFilteredResult(_0x334eec,_0x3caa67))[_0x2424('0x42')](handleError(_0x334eec,null));};exports[_0x2424('0x5f')]=function(_0x3701da,_0x39118e,_0x42ae8b){var _0x370b3d={'raw':!![],'where':{}};var _0x31bb69={};var _0x156d08={'count':0x0,'rows':[]};return db[_0x2424('0x2a')][_0x2424('0x57')]({'where':{'id':_0x3701da['params']['id']}})['then'](handleEntityNotFound(_0x39118e,null))[_0x2424('0x20')](function(_0x15366a){if(_0x15366a){_0x31bb69[_0x2424('0x2e')]=_[_0x2424('0x30')](db[_0x2424('0x60')][_0x2424('0x2b')]);_0x31bb69[_0x2424('0x2f')]=_['keys'](_0x3701da[_0x2424('0x2f')]);_0x31bb69['filters']=_[_0x2424('0x32')](_0x31bb69[_0x2424('0x2e')],_0x31bb69[_0x2424('0x2f')]);_0x370b3d[_0x2424('0x33')]=_[_0x2424('0x32')](_0x31bb69['model'],qs[_0x2424('0x34')](_0x3701da[_0x2424('0x2f')][_0x2424('0x34')]));_0x370b3d[_0x2424('0x33')]=_0x370b3d[_0x2424('0x33')][_0x2424('0x45')]?_0x370b3d['attributes']:_0x31bb69[_0x2424('0x2e')];if(!_0x3701da['query'][_0x2424('0x35')]('nolimit')){_0x370b3d[_0x2424('0x19')]=qs['limit'](_0x3701da[_0x2424('0x2f')][_0x2424('0x19')]);_0x370b3d[_0x2424('0x37')]=qs['offset'](_0x3701da[_0x2424('0x2f')][_0x2424('0x37')]);}_0x370b3d[_0x2424('0x38')]=qs[_0x2424('0x39')](_0x3701da[_0x2424('0x2f')][_0x2424('0x39')]);_0x370b3d[_0x2424('0x3a')]=qs[_0x2424('0x31')](_['pick'](_0x3701da[_0x2424('0x2f')],_0x31bb69['filters']));_0x370b3d[_0x2424('0x3a')][_0x2424('0x58')]=_0x15366a['id'];if(_0x3701da[_0x2424('0x2f')][_0x2424('0x3c')]){_0x370b3d[_0x2424('0x3a')]=_['merge'](_0x370b3d[_0x2424('0x3a')],{'$or':_[_0x2424('0x29')](_0x370b3d['attributes'],function(_0x44ecbf){var _0xeab622={};_0xeab622[_0x44ecbf]={'$like':'%'+_0x3701da[_0x2424('0x2f')][_0x2424('0x3c')]+'%'};return _0xeab622;})});}_0x370b3d=_[_0x2424('0x3f')]({},_0x370b3d,_0x3701da[_0x2424('0x47')]);return db['CmHopperBlack']['count']({'where':_0x370b3d[_0x2424('0x3a')]})[_0x2424('0x20')](function(_0x2df43e){_0x156d08[_0x2424('0x1a')]=_0x2df43e;if(_0x3701da[_0x2424('0x2f')][_0x2424('0x40')]){_0x370b3d[_0x2424('0x46')]=[{'all':!![]}];}return db[_0x2424('0x60')]['findAll'](_0x370b3d);})[_0x2424('0x20')](function(_0x12386a){_0x156d08[_0x2424('0x5a')]=_0x12386a;return _0x156d08;});}})['then'](respondWithFilteredResult(_0x39118e,_0x370b3d))[_0x2424('0x42')](handleError(_0x39118e,null));};exports['getLists']=function(_0x6722fc,_0x476c51,_0x3d171a){var _0x11ecf2={};var _0x372797={};var _0x34a0bb;var _0x43c087;return db[_0x2424('0x2a')][_0x2424('0x57')]({'where':{'id':_0x6722fc['params']['id']}})[_0x2424('0x20')](handleEntityNotFound(_0x476c51,null))[_0x2424('0x20')](function(_0x5b3ab7){if(_0x5b3ab7){_0x34a0bb=_0x5b3ab7;_0x372797[_0x2424('0x2e')]=_[_0x2424('0x30')](db['CmList'][_0x2424('0x2b')]);_0x372797[_0x2424('0x2f')]=_['keys'](_0x6722fc[_0x2424('0x2f')]);_0x372797['filters']=_[_0x2424('0x32')](_0x372797[_0x2424('0x2e')],_0x372797[_0x2424('0x2f')]);_0x11ecf2[_0x2424('0x33')]=_[_0x2424('0x32')](_0x372797[_0x2424('0x2e')],qs[_0x2424('0x34')](_0x6722fc[_0x2424('0x2f')][_0x2424('0x34')]));_0x11ecf2['attributes']=_0x11ecf2[_0x2424('0x33')][_0x2424('0x45')]?_0x11ecf2[_0x2424('0x33')]:_0x372797[_0x2424('0x2e')];_0x11ecf2[_0x2424('0x38')]=qs['sort'](_0x6722fc['query']['sort']);_0x11ecf2[_0x2424('0x3a')]=qs[_0x2424('0x31')](_['pick'](_0x6722fc['query'],_0x372797[_0x2424('0x31')]));if(_0x6722fc['query'][_0x2424('0x3c')]){_0x11ecf2[_0x2424('0x3a')]=_[_0x2424('0x3f')](_0x11ecf2['where'],{'$or':_[_0x2424('0x29')](_0x11ecf2[_0x2424('0x33')],function(_0x150d7e){var _0x1cbad4={};_0x1cbad4[_0x150d7e]={'$like':'%'+_0x6722fc[_0x2424('0x2f')][_0x2424('0x3c')]+'%'};return _0x1cbad4;})});}_0x11ecf2=_[_0x2424('0x3f')]({},_0x11ecf2,_0x6722fc[_0x2424('0x47')]);return _0x34a0bb['getLists'](_0x11ecf2);}})[_0x2424('0x20')](function(_0x43c10f){if(_0x43c10f){_0x43c087=_0x43c10f[_0x2424('0x45')];if(!_0x6722fc['query'][_0x2424('0x35')](_0x2424('0x36'))){_0x11ecf2[_0x2424('0x19')]=qs[_0x2424('0x19')](_0x6722fc['query']['limit']);_0x11ecf2['offset']=qs[_0x2424('0x37')](_0x6722fc['query']['offset']);}return _0x34a0bb[_0x2424('0x61')](_0x11ecf2);}})[_0x2424('0x20')](function(_0x33fe81){if(_0x33fe81){return _0x33fe81?{'count':_0x43c087,'rows':_0x33fe81}:null;}})['then'](respondWithResult(_0x476c51,null))['catch'](handleError(_0x476c51,null));};exports['addLists']=function(_0x361fa6,_0x589d99,_0x2ae3dc){var _0x129ad9,_0x276a22;var _0x3238ad=[];var _0x51d857=moment()[_0x2424('0x62')](_0x2424('0x63'));return db[_0x2424('0x2a')]['find']({'where':{'id':_0x361fa6[_0x2424('0x44')]['id']}})[_0x2424('0x20')](handleEntityNotFound(_0x589d99,null))[_0x2424('0x20')](function(_0x384049){if(_0x384049){_0x276a22=_0x384049;return _0x384049[_0x2424('0x64')](_0x361fa6[_0x2424('0x51')][_0x2424('0x65')],_[_0x2424('0x4f')](_0x361fa6[_0x2424('0x51')],[_0x2424('0x65'),'id'])||{});}return null;})[_0x2424('0x66')](function(_0x413359){var _0x259e1a;var _0x58c7a6;_0x129ad9=_0x413359||[];var _0x50d55a=[];if(_0x413359){for(var _0x4fd595=0x0;_0x4fd595<_0x413359['length'];_0x4fd595+=0x1){var _0x4837ee=_0x413359[_0x4fd595][_0x2424('0x21')]({'plain':!![]});_0x276a22['dialCheckDuplicateType']=_0x361fa6[_0x2424('0x51')]['dialCheckDuplicateType']?_0x361fa6['body']['dialCheckDuplicateType']:_0x276a22['dialCheckDuplicateType'];switch(_0x276a22['dialCheckDuplicateType']){case'always':_0x259e1a=squel['insert']()[_0x2424('0x67')](_0x2424('0x68'))['fromQuery']([_0x2424('0x69'),'scheduledAt',_0x2424('0x6a'),_0x2424('0x6b'),'CampaignId',_0x2424('0x52'),_0x2424('0x50')],squel[_0x2424('0x6c')]()[_0x2424('0x6d')](_0x2424('0x69'),_0x2424('0x69'))['field'](_0x2424('0x6e'),_0x2424('0x6f'))[_0x2424('0x6d')]('id',_0x2424('0x6a'))[_0x2424('0x6d')](_0x4837ee['CmListId'][_0x2424('0x70')](),'ListId')[_0x2424('0x6d')](_0x361fa6[_0x2424('0x44')]['id'][_0x2424('0x70')](),_0x2424('0x58'))['field']('\x27'+_0x51d857+'\x27','createdAt')[_0x2424('0x6d')]('\x27'+_0x51d857+'\x27',_0x2424('0x50'))[_0x2424('0x71')](_0x2424('0x72'))[_0x2424('0x3a')](_0x2424('0x73'))[_0x2424('0x3a')]('ListId\x20=\x20?',_0x4837ee[_0x2424('0x74')]['toString']())[_0x2424('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0x2424('0x3a')](_0x2424('0x75'),squel[_0x2424('0x6c')]()[_0x2424('0x6d')](_0x2424('0x76'))['from'](_0x2424('0x77'))[_0x2424('0x3a')](_0x2424('0x78'),_0x361fa6['params']['id'][_0x2424('0x70')]()))[_0x2424('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x2424('0x6d')](_0x2424('0x79'))[_0x2424('0x71')](_0x2424('0x68'))[_0x2424('0x3a')]('CampaignId\x20=\x20?',_0x361fa6[_0x2424('0x44')]['id']['toString']())))[_0x2424('0x70')]();break;case _0x2424('0x7a'):_0x259e1a=squel['insert']()['into'](_0x2424('0x68'))[_0x2424('0x7b')]([_0x2424('0x69'),_0x2424('0x6f'),_0x2424('0x6a'),'ListId',_0x2424('0x58'),_0x2424('0x52'),_0x2424('0x50')],squel['select']()[_0x2424('0x6d')](_0x2424('0x69'),'phone')[_0x2424('0x6d')](_0x2424('0x6e'),_0x2424('0x6f'))[_0x2424('0x6d')]('id',_0x2424('0x6a'))[_0x2424('0x6d')](_0x4837ee[_0x2424('0x74')][_0x2424('0x70')](),_0x2424('0x6b'))[_0x2424('0x6d')](_0x361fa6[_0x2424('0x44')]['id']['toString'](),_0x2424('0x58'))[_0x2424('0x6d')]('\x27'+_0x51d857+'\x27',_0x2424('0x52'))[_0x2424('0x6d')]('\x27'+_0x51d857+'\x27',_0x2424('0x50'))[_0x2424('0x71')](_0x2424('0x72'))[_0x2424('0x3a')](_0x2424('0x73'))[_0x2424('0x3a')]('ListId\x20=\x20?',_0x4837ee[_0x2424('0x74')][_0x2424('0x70')]())[_0x2424('0x3a')](_0x2424('0x7c'))[_0x2424('0x3a')](_0x2424('0x75'),squel[_0x2424('0x6c')]()[_0x2424('0x6d')]('COALESCE(phone,\x27\x27)')[_0x2424('0x71')]('cm_hopper')[_0x2424('0x3a')](_0x2424('0x78'),_0x361fa6[_0x2424('0x44')]['id'][_0x2424('0x70')]())))[_0x2424('0x70')]();break;default:_0x259e1a=squel['insert']()[_0x2424('0x67')](_0x2424('0x68'))[_0x2424('0x7b')]([_0x2424('0x69'),_0x2424('0x6f'),_0x2424('0x6a'),_0x2424('0x6b'),_0x2424('0x58'),_0x2424('0x52'),_0x2424('0x50')],squel['select']()[_0x2424('0x6d')]('phone','phone')[_0x2424('0x6d')](_0x2424('0x6e'),'scheduledAt')[_0x2424('0x6d')]('id',_0x2424('0x6a'))[_0x2424('0x6d')](_0x4837ee[_0x2424('0x74')][_0x2424('0x70')](),_0x2424('0x6b'))[_0x2424('0x6d')](_0x361fa6['params']['id'][_0x2424('0x70')](),_0x2424('0x58'))['field']('\x27'+_0x51d857+'\x27',_0x2424('0x52'))[_0x2424('0x6d')]('\x27'+_0x51d857+'\x27',_0x2424('0x50'))[_0x2424('0x71')](_0x2424('0x72'))[_0x2424('0x3a')]('deletedAt\x20IS\x20NULL')[_0x2424('0x3a')](_0x2424('0x7d'),_0x4837ee[_0x2424('0x74')]['toString']())[_0x2424('0x3a')](_0x2424('0x7c')))[_0x2424('0x70')]();}_0x58c7a6=squel[_0x2424('0x7e')]()['into'](_0x2424('0x7f'))['fromQuery'](['cmHopperId',_0x2424('0x6f'),_0x2424('0x69'),_0x2424('0x80'),_0x2424('0x52'),'updatedAt'],squel[_0x2424('0x6c')]()[_0x2424('0x6d')](_0x2424('0x81'),'id')[_0x2424('0x6d')]('NOW()',_0x2424('0x6f'))[_0x2424('0x6d')](_0x2424('0x82'),_0x2424('0x69'))['field'](_0x2424('0x83'),_0x2424('0x80'))[_0x2424('0x6d')]('\x27'+_0x51d857+'\x27','createdAt')['field']('\x27'+_0x51d857+'\x27',_0x2424('0x50'))[_0x2424('0x71')]('cm_contact_has_items','ci')[_0x2424('0x84')](_0x2424('0x68'),'h',_0x2424('0x85'))[_0x2424('0x3a')](_0x2424('0x86'),_0x4837ee['CmListId'][_0x2424('0x70')]())[_0x2424('0x3a')](_0x2424('0x87'),_0x361fa6['params']['id'][_0x2424('0x70')]())[_0x2424('0x3a')]('h.createdAt\x20=\x20?',_0x51d857))['toString']();_0x50d55a[_0x2424('0x88')](db[_0x2424('0x89')][_0x2424('0x2f')](_0x259e1a));_0x3238ad[_0x2424('0x88')](db[_0x2424('0x89')][_0x2424('0x2f')](_0x58c7a6));}return BPromise[_0x2424('0x8a')](_0x50d55a);}})[_0x2424('0x20')](function(){return BPromise[_0x2424('0x8a')](_0x3238ad);})[_0x2424('0x20')](function(){return _0x129ad9;})[_0x2424('0x20')](respondWithResult(_0x589d99,null))[_0x2424('0x42')](handleError(_0x589d99,null));};exports[_0x2424('0x8b')]=function(_0x5e6e6e,_0x3f01ba,_0xaf370b){return db[_0x2424('0x2a')]['find']({'where':{'id':_0x5e6e6e[_0x2424('0x44')]['id']}})[_0x2424('0x20')](handleEntityNotFound(_0x3f01ba,null))[_0x2424('0x20')](function(_0x4fb517){if(_0x4fb517){return _0x4fb517[_0x2424('0x8b')](_0x5e6e6e[_0x2424('0x2f')][_0x2424('0x65')]);}})[_0x2424('0x20')](function(_0x250169){if(_0x250169){return db[_0x2424('0x59')]['destroy']({'where':{'ListId':_0x5e6e6e[_0x2424('0x2f')][_0x2424('0x65')],'CampaignId':_0x5e6e6e['params']['id']}})['then'](function(){return _0x250169;});}})[_0x2424('0x20')](respondWithStatusCode(_0x3f01ba,null))[_0x2424('0x42')](handleError(_0x3f01ba,null));};exports[_0x2424('0x8c')]=function(_0x224cae,_0x3558ff,_0x32c856){var _0x4b0ee6={};var _0x2ee97d={};var _0x196790;var _0x19981f;return db[_0x2424('0x2a')][_0x2424('0x57')]({'where':{'id':_0x224cae['params']['id']}})['then'](handleEntityNotFound(_0x3558ff,null))[_0x2424('0x20')](function(_0x19d620){if(_0x19d620){_0x196790=_0x19d620;_0x2ee97d[_0x2424('0x2e')]=_[_0x2424('0x30')](db[_0x2424('0x8d')]['rawAttributes']);_0x2ee97d['query']=_[_0x2424('0x30')](_0x224cae[_0x2424('0x2f')]);_0x2ee97d[_0x2424('0x31')]=_[_0x2424('0x32')](_0x2ee97d[_0x2424('0x2e')],_0x2ee97d['query']);_0x4b0ee6[_0x2424('0x33')]=_[_0x2424('0x32')](_0x2ee97d[_0x2424('0x2e')],qs['fields'](_0x224cae[_0x2424('0x2f')][_0x2424('0x34')]));_0x4b0ee6[_0x2424('0x33')]=_0x4b0ee6[_0x2424('0x33')]['length']?_0x4b0ee6[_0x2424('0x33')]:_0x2ee97d[_0x2424('0x2e')];_0x4b0ee6[_0x2424('0x38')]=qs[_0x2424('0x39')](_0x224cae[_0x2424('0x2f')]['sort']);_0x4b0ee6[_0x2424('0x3a')]=qs['filters'](_[_0x2424('0x3b')](_0x224cae[_0x2424('0x2f')],_0x2ee97d['filters']));if(_0x224cae[_0x2424('0x2f')][_0x2424('0x3c')]){_0x4b0ee6[_0x2424('0x3a')]=_[_0x2424('0x3f')](_0x4b0ee6[_0x2424('0x3a')],{'$or':_['map'](_0x4b0ee6[_0x2424('0x33')],function(_0x17cb45){var _0x2e9ab6={};_0x2e9ab6[_0x17cb45]={'$like':'%'+_0x224cae[_0x2424('0x2f')]['filter']+'%'};return _0x2e9ab6;})});}_0x4b0ee6=_[_0x2424('0x3f')]({},_0x4b0ee6,_0x224cae[_0x2424('0x47')]);return _0x196790[_0x2424('0x8c')](_0x4b0ee6);}})[_0x2424('0x20')](function(_0x59a3d0){if(_0x59a3d0){_0x19981f=_0x59a3d0[_0x2424('0x45')];if(!_0x224cae['query'][_0x2424('0x35')](_0x2424('0x36'))){_0x4b0ee6[_0x2424('0x19')]=qs[_0x2424('0x19')](_0x224cae['query']['limit']);_0x4b0ee6[_0x2424('0x37')]=qs['offset'](_0x224cae[_0x2424('0x2f')][_0x2424('0x37')]);}return _0x196790[_0x2424('0x8c')](_0x4b0ee6);}})[_0x2424('0x20')](function(_0x31fd3b){if(_0x31fd3b){return _0x31fd3b?{'count':_0x19981f,'rows':_0x31fd3b}:null;}})['then'](respondWithResult(_0x3558ff,null))[_0x2424('0x42')](handleError(_0x3558ff,null));};exports[_0x2424('0x8e')]=function(_0x17e968,_0x51c062,_0x4ee736){var _0x1d62a1,_0x2628c5;var _0x5aa025=[];var _0x1ef05d=moment()[_0x2424('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x2424('0x2a')][_0x2424('0x4c')]({'where':{'id':_0x17e968['params']['id']}})[_0x2424('0x20')](handleEntityNotFound(_0x51c062,null))['then'](function(_0x23d83c){if(_0x23d83c){_0x2628c5=_0x23d83c;return _0x23d83c[_0x2424('0x8e')](_0x17e968['body'][_0x2424('0x65')],_[_0x2424('0x4f')](_0x17e968[_0x2424('0x51')],['ids','id'])||{});}return null;})[_0x2424('0x66')](function(_0x63955d){var _0x7b7ee8;var _0x53ac48;_0x1d62a1=_0x63955d||[];var _0x30ba78=[];if(_0x63955d){for(var _0x626faf=0x0;_0x626faf<_0x63955d[_0x2424('0x45')];_0x626faf+=0x1){var _0xd41693=_0x63955d[_0x626faf][_0x2424('0x21')]({'plain':!![]});_0x7b7ee8=squel[_0x2424('0x7e')]()[_0x2424('0x67')](_0x2424('0x8f'))['fromQuery']([_0x2424('0x69'),_0x2424('0x6a'),_0x2424('0x6b'),'CampaignId','createdAt','updatedAt'],squel[_0x2424('0x6c')]()[_0x2424('0x6d')](_0x2424('0x69'),_0x2424('0x69'))['field']('id',_0x2424('0x6a'))[_0x2424('0x6d')](_0xd41693[_0x2424('0x74')][_0x2424('0x70')](),_0x2424('0x6b'))['field'](_0x17e968[_0x2424('0x44')]['id'][_0x2424('0x70')](),_0x2424('0x58'))[_0x2424('0x6d')](_0x2424('0x6e'),'createdAt')[_0x2424('0x6d')](_0x2424('0x6e'),_0x2424('0x50'))[_0x2424('0x71')](_0x2424('0x72'))[_0x2424('0x3a')]('deletedAt\x20IS\x20NULL')[_0x2424('0x3a')]('ListId\x20=\x20?',_0xd41693[_0x2424('0x74')]['toString']())[_0x2424('0x3a')](_0x2424('0x7c')))['toString']();_0x30ba78[_0x2424('0x88')](db[_0x2424('0x89')][_0x2424('0x2f')](_0x7b7ee8));}return BPromise['all'](_0x30ba78);}})['then'](function(){return _0x1d62a1;})[_0x2424('0x20')](respondWithResult(_0x51c062,null))['catch'](handleError(_0x51c062,null));};exports[_0x2424('0x90')]=function(_0x135b4a,_0x11d42a,_0x305756){return db[_0x2424('0x2a')][_0x2424('0x4c')]({'where':{'id':_0x135b4a[_0x2424('0x44')]['id']}})[_0x2424('0x20')](handleEntityNotFound(_0x11d42a,null))['then'](function(_0x441d1e){if(_0x441d1e){return _0x441d1e[_0x2424('0x90')](_0x135b4a[_0x2424('0x2f')][_0x2424('0x65')]);}})[_0x2424('0x20')](function(_0x261f68){if(_0x261f68){return db[_0x2424('0x60')][_0x2424('0x24')]({'where':{'ListId':_0x135b4a[_0x2424('0x2f')][_0x2424('0x65')],'CampaignId':_0x135b4a[_0x2424('0x44')]['id']}})[_0x2424('0x20')](function(){return _0x261f68;});}})[_0x2424('0x20')](respondWithStatusCode(_0x11d42a,null))['catch'](handleError(_0x11d42a,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index e4e3a97..f31b6b7 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x3ef4ce,_0x5b4e3e){var _0x414d9d=function(_0x28e388){while(--_0x28e388){_0x3ef4ce['push'](_0x3ef4ce['shift']());}};_0x414d9d(++_0x5b4e3e);}(_0x7a54,0x106));var _0x47a5=function(_0x54b5c6,_0x53fd66){_0x54b5c6=_0x54b5c6-0x0;var _0x428829=_0x7a54[_0x54b5c6];return _0x428829;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x58f6fd,_0x8e6c3d){var _0x44dce4=function(_0x451ea8){while(--_0x451ea8){_0x58f6fd['push'](_0x58f6fd['shift']());}};_0x44dce4(++_0x8e6c3d);}(_0x7a54,0x106));var _0x47a5=function(_0x41300c,_0x5f471e){_0x41300c=_0x41300c-0x0;var _0x28ed92=_0x7a54[_0x41300c];return _0x28ed92;};'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 1b03fbd..456ff92 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 _0xbc17=['bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','lodash','util'];(function(_0x5acaba,_0x383a16){var _0x1bf657=function(_0x390901){while(--_0x390901){_0x5acaba['push'](_0x5acaba['shift']());}};_0x1bf657(++_0x383a16);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x354b70,_0x2ee366){_0x354b70=_0x354b70-0x0;var _0x56a7e8=_0xbc17[_0x354b70];return _0x56a7e8;};'use strict';var _=require(_0x7bc1('0x0'));var util=require(_0x7bc1('0x1'));var moment=require('moment');var BPromise=require(_0x7bc1('0x2'));var rs=require(_0x7bc1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7bc1('0x4'));var logger=require(_0x7bc1('0x5'))('rpc');var config=require(_0x7bc1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7bc1('0x7')][_0x7bc1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b720f,_0x3aed05,_0x3fdce7){return new BPromise(function(_0x351340,_0x3c08dc){return client[_0x7bc1('0x9')](_0x1b720f,_0x3fdce7)['then'](function(_0x48454c){logger[_0x7bc1('0xa')](_0x7bc1('0xb'),_0x3aed05,_0x7bc1('0xc'));logger['debug'](_0x7bc1('0xd'),_0x3aed05,_0x7bc1('0xc'),JSON[_0x7bc1('0xe')](_0x48454c));if(_0x48454c[_0x7bc1('0xf')]){if(_0x48454c[_0x7bc1('0xf')][_0x7bc1('0x10')]===0x1f4){logger[_0x7bc1('0xf')](_0x7bc1('0xb'),_0x3aed05,_0x48454c[_0x7bc1('0xf')]['message']);return _0x3c08dc(_0x48454c[_0x7bc1('0xf')][_0x7bc1('0x11')]);}logger['error'](_0x7bc1('0xb'),_0x3aed05,_0x48454c[_0x7bc1('0xf')]['message']);return _0x351340(_0x48454c[_0x7bc1('0xf')][_0x7bc1('0x11')]);}else{logger['info'](_0x7bc1('0xb'),_0x3aed05,_0x7bc1('0xc'));_0x351340(_0x48454c[_0x7bc1('0x12')][_0x7bc1('0x11')]);}})[_0x7bc1('0x13')](function(_0x5a5a59){logger[_0x7bc1('0xf')]('Campaign,\x20%s,\x20%s',_0x3aed05,_0x5a5a59);_0x3c08dc(_0x5a5a59);});});}exports[_0x7bc1('0x14')]=function(_0x901465){var _0xdf994=this;return new Promise(function(_0x22e6fd,_0x20ce32){return db[_0x7bc1('0x15')][_0x7bc1('0x16')]({'raw':_0x901465[_0x7bc1('0x17')]?_0x901465['options'][_0x7bc1('0x18')]===undefined?!![]:![]:!![],'where':_0x901465[_0x7bc1('0x17')]?_0x901465[_0x7bc1('0x17')][_0x7bc1('0x19')]||null:null,'attributes':_0x901465[_0x7bc1('0x17')]?_0x901465['options'][_0x7bc1('0x1a')]||null:null,'limit':_0x901465['options']?_0x901465[_0x7bc1('0x17')][_0x7bc1('0x1b')]||null:null,'include':_0x901465[_0x7bc1('0x17')]?_0x901465[_0x7bc1('0x17')][_0x7bc1('0x1c')]?_['map'](_0x901465['options'][_0x7bc1('0x1c')],function(_0x306db7){return{'model':db[_0x306db7['model']],'as':_0x306db7['as'],'attributes':_0x306db7['attributes'],'include':_0x306db7[_0x7bc1('0x1c')]?_[_0x7bc1('0x1d')](_0x306db7['include'],function(_0x1e9b8a){return{'model':db[_0x1e9b8a[_0x7bc1('0x1e')]],'as':_0x1e9b8a['as'],'attributes':_0x1e9b8a[_0x7bc1('0x1a')],'include':_0x1e9b8a[_0x7bc1('0x1c')]?_[_0x7bc1('0x1d')](_0x1e9b8a[_0x7bc1('0x1c')],function(_0x25d3a9){return{'model':db[_0x25d3a9[_0x7bc1('0x1e')]],'as':_0x25d3a9['as'],'attributes':_0x25d3a9[_0x7bc1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7bc1('0x1f')](function(_0x3eb13b){logger[_0x7bc1('0xa')](_0x7bc1('0x14'),_0x901465);logger[_0x7bc1('0x20')]('GetCampaign',_0x901465,JSON[_0x7bc1('0xe')](_0x3eb13b));_0x22e6fd(_0x3eb13b);})[_0x7bc1('0x13')](function(_0x26bf05){logger[_0x7bc1('0xf')](_0x7bc1('0x14'),_0x26bf05[_0x7bc1('0x11')],_0x901465);_0x20ce32(_0xdf994[_0x7bc1('0xf')](0x1f4,_0x26bf05[_0x7bc1('0x11')]));});});};
\ No newline at end of file
+var _0x20ce=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','Campaign','options','raw','attributes','limit','include','model','map','lodash','util','moment'];(function(_0x4df771,_0x198e2f){var _0x1cfd83=function(_0x15b866){while(--_0x15b866){_0x4df771['push'](_0x4df771['shift']());}};_0x1cfd83(++_0x198e2f);}(_0x20ce,0x10d));var _0xe20c=function(_0x3b0c30,_0x488e87){_0x3b0c30=_0x3b0c30-0x0;var _0x55ba8c=_0x20ce[_0x3b0c30];return _0x55ba8c;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var moment=require(_0xe20c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe20c('0x3'));var fs=require('fs');var Redis=require(_0xe20c('0x4'));var db=require(_0xe20c('0x5'))['db'];var utils=require(_0xe20c('0x6'));var logger=require(_0xe20c('0x7'))(_0xe20c('0x8'));var config=require(_0xe20c('0x9'));var jayson=require(_0xe20c('0xa'));var client=jayson[_0xe20c('0xb')][_0xe20c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x893e48,_0x26b9be,_0x2d88b5){return new BPromise(function(_0x8f79ad,_0x290fb5){return client[_0xe20c('0xd')](_0x893e48,_0x2d88b5)[_0xe20c('0xe')](function(_0x385d61){logger[_0xe20c('0xf')](_0xe20c('0x10'),_0x26b9be,_0xe20c('0x11'));logger[_0xe20c('0x12')](_0xe20c('0x13'),_0x26b9be,_0xe20c('0x11'),JSON['stringify'](_0x385d61));if(_0x385d61[_0xe20c('0x14')]){if(_0x385d61[_0xe20c('0x14')][_0xe20c('0x15')]===0x1f4){logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x385d61['error'][_0xe20c('0x16')]);return _0x290fb5(_0x385d61[_0xe20c('0x14')]['message']);}logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x385d61[_0xe20c('0x14')]['message']);return _0x8f79ad(_0x385d61[_0xe20c('0x14')][_0xe20c('0x16')]);}else{logger[_0xe20c('0xf')](_0xe20c('0x10'),_0x26b9be,'request\x20sent');_0x8f79ad(_0x385d61[_0xe20c('0x17')]['message']);}})[_0xe20c('0x18')](function(_0x4061ed){logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x4061ed);_0x290fb5(_0x4061ed);});});}exports[_0xe20c('0x19')]=function(_0x2d58a7){var _0x2a4292=this;return new Promise(function(_0x3d8df5,_0x305f2f){return db[_0xe20c('0x1a')]['findAll']({'raw':_0x2d58a7[_0xe20c('0x1b')]?_0x2d58a7[_0xe20c('0x1b')][_0xe20c('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d58a7[_0xe20c('0x1b')]?_0x2d58a7['options']['where']||null:null,'attributes':_0x2d58a7[_0xe20c('0x1b')]?_0x2d58a7[_0xe20c('0x1b')][_0xe20c('0x1d')]||null:null,'limit':_0x2d58a7['options']?_0x2d58a7['options'][_0xe20c('0x1e')]||null:null,'include':_0x2d58a7[_0xe20c('0x1b')]?_0x2d58a7[_0xe20c('0x1b')][_0xe20c('0x1f')]?_['map'](_0x2d58a7[_0xe20c('0x1b')]['include'],function(_0x13bf33){return{'model':db[_0x13bf33[_0xe20c('0x20')]],'as':_0x13bf33['as'],'attributes':_0x13bf33[_0xe20c('0x1d')],'include':_0x13bf33[_0xe20c('0x1f')]?_[_0xe20c('0x21')](_0x13bf33[_0xe20c('0x1f')],function(_0x12846c){return{'model':db[_0x12846c['model']],'as':_0x12846c['as'],'attributes':_0x12846c[_0xe20c('0x1d')],'include':_0x12846c[_0xe20c('0x1f')]?_[_0xe20c('0x21')](_0x12846c[_0xe20c('0x1f')],function(_0x2dd621){return{'model':db[_0x2dd621[_0xe20c('0x20')]],'as':_0x2dd621['as'],'attributes':_0x2dd621[_0xe20c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe20c('0xe')](function(_0x562e52){logger[_0xe20c('0xf')](_0xe20c('0x19'),_0x2d58a7);logger[_0xe20c('0x12')](_0xe20c('0x19'),_0x2d58a7,JSON['stringify'](_0x562e52));_0x3d8df5(_0x562e52);})[_0xe20c('0x18')](function(_0x54df97){logger['error'](_0xe20c('0x19'),_0x54df97[_0xe20c('0x16')],_0x2d58a7);_0x305f2f(_0x2a4292[_0xe20c('0x14')](0x1f4,_0x54df97['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index f52a2bb..5801728 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 _0x0834=['get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','getBlackLists','create','post','/:id/clone','addLists','addBlackLists','put','delete','destroy','removeLists','/:id/blacklists','exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./campaign.controller'];(function(_0x54aaf1,_0x21b5ba){var _0x1a9abe=function(_0x1ea09b){while(--_0x1ea09b){_0x54aaf1['push'](_0x54aaf1['shift']());}};_0x1a9abe(++_0x21b5ba);}(_0x0834,0x18e));var _0x4083=function(_0x21d97e,_0x3eb1de){_0x21d97e=_0x21d97e-0x0;var _0x2623eb=_0x0834[_0x21d97e];return _0x2623eb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4083('0x0'));var timeout=require(_0x4083('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4083('0x2'));var interaction=require(_0x4083('0x3'));var config=require('../../config/environment');var controller=require(_0x4083('0x4'));router[_0x4083('0x5')]('/',auth['isAuthenticated'](),controller[_0x4083('0x6')]);router['get'](_0x4083('0x7'),auth[_0x4083('0x8')](),controller[_0x4083('0x9')]);router[_0x4083('0x5')](_0x4083('0xa'),auth[_0x4083('0x8')](),controller[_0x4083('0xb')]);router[_0x4083('0x5')](_0x4083('0xc'),auth[_0x4083('0x8')](),controller[_0x4083('0xd')]);router[_0x4083('0x5')](_0x4083('0xe'),auth[_0x4083('0x8')](),controller[_0x4083('0xf')]);router['get']('/:id/hopper_black',auth[_0x4083('0x8')](),controller[_0x4083('0x10')]);router['get'](_0x4083('0x11'),auth[_0x4083('0x8')](),controller[_0x4083('0x12')]);router['get']('/:id/blacklists',auth[_0x4083('0x8')](),controller[_0x4083('0x13')]);router['post']('/',auth[_0x4083('0x8')](),controller[_0x4083('0x14')]);router[_0x4083('0x15')](_0x4083('0x16'),auth[_0x4083('0x8')](),controller['clone']);router[_0x4083('0x15')](_0x4083('0x11'),auth[_0x4083('0x8')](),controller[_0x4083('0x17')]);router['post']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x4083('0x18')]);router[_0x4083('0x19')]('/:id',auth[_0x4083('0x8')](),controller['update']);router[_0x4083('0x1a')](_0x4083('0x7'),auth[_0x4083('0x8')](),controller[_0x4083('0x1b')]);router['delete'](_0x4083('0x11'),auth['isAuthenticated'](),controller[_0x4083('0x1c')]);router[_0x4083('0x1a')](_0x4083('0x1d'),auth[_0x4083('0x8')](),controller['removeBlackLists']);module[_0x4083('0x1e')]=router;
\ No newline at end of file
+var _0x28ed=['clone','addLists','addBlackLists','put','delete','removeLists','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','show','getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','/:id/clone'];(function(_0x21f089,_0x5ebacd){var _0x59c5e7=function(_0x2af336){while(--_0x2af336){_0x21f089['push'](_0x21f089['shift']());}};_0x59c5e7(++_0x5ebacd);}(_0x28ed,0x1b9));var _0xd28e=function(_0x289818,_0x43e99f){_0x289818=_0x289818-0x0;var _0x30e9cb=_0x28ed[_0x289818];return _0x30e9cb;};'use strict';var multer=require('multer');var util=require(_0xd28e('0x0'));var path=require('path');var timeout=require(_0xd28e('0x1'));var express=require(_0xd28e('0x2'));var router=express[_0xd28e('0x3')]();var fs_extra=require(_0xd28e('0x4'));var auth=require(_0xd28e('0x5'));var interaction=require(_0xd28e('0x6'));var config=require(_0xd28e('0x7'));var controller=require(_0xd28e('0x8'));router[_0xd28e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd28e('0x9')](_0xd28e('0xa'),auth[_0xd28e('0xb')](),controller[_0xd28e('0xc')]);router[_0xd28e('0x9')]('/:id/hoppers',auth[_0xd28e('0xb')](),controller[_0xd28e('0xd')]);router['get'](_0xd28e('0xe'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xd28e('0x9')](_0xd28e('0xf'),auth[_0xd28e('0xb')](),controller['getHopperFinals']);router[_0xd28e('0x9')](_0xd28e('0x10'),auth[_0xd28e('0xb')](),controller[_0xd28e('0x11')]);router['get'](_0xd28e('0x12'),auth[_0xd28e('0xb')](),controller[_0xd28e('0x13')]);router[_0xd28e('0x9')](_0xd28e('0x14'),auth[_0xd28e('0xb')](),controller['getBlackLists']);router[_0xd28e('0x15')]('/',auth[_0xd28e('0xb')](),controller['create']);router['post'](_0xd28e('0x16'),auth[_0xd28e('0xb')](),controller[_0xd28e('0x17')]);router['post'](_0xd28e('0x12'),auth[_0xd28e('0xb')](),controller[_0xd28e('0x18')]);router[_0xd28e('0x15')](_0xd28e('0x14'),auth[_0xd28e('0xb')](),controller[_0xd28e('0x19')]);router[_0xd28e('0x1a')]('/:id',auth[_0xd28e('0xb')](),controller['update']);router['delete'](_0xd28e('0xa'),auth[_0xd28e('0xb')](),controller['destroy']);router[_0xd28e('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xd28e('0x1c')]);router[_0xd28e('0x1b')](_0xd28e('0x14'),auth[_0xd28e('0xb')](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 2541c36..a2242b7 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 _0xd1a2=['sequelize','exports','STRING','medium','VIRTUAL','getDataValue'];(function(_0x1876c7,_0x379202){var _0x2b9572=function(_0x9bf2ff){while(--_0x9bf2ff){_0x1876c7['push'](_0x1876c7['shift']());}};_0x2b9572(++_0x379202);}(_0xd1a2,0x12c));var _0x2d1a=function(_0x1f7290,_0x3d4325){_0x1f7290=_0x1f7290-0x0;var _0x129d16=_0xd1a2[_0x1f7290];return _0x129d16;};'use strict';var Sequelize=require(_0x2d1a('0x0'));module[_0x2d1a('0x1')]={'key':{'type':Sequelize[_0x2d1a('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0x2d1a('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x2d1a('0x2')]},'name':{'type':Sequelize[_0x2d1a('0x4')],'get':function(){return this[_0x2d1a('0x5')]('key');}}};
\ No newline at end of file
+var _0xa626=['key','sequelize','exports','STRING','TEXT','medium','VIRTUAL','getDataValue'];(function(_0x3965ce,_0x4dfc39){var _0x1528b5=function(_0x5b2cb1){while(--_0x5b2cb1){_0x3965ce['push'](_0x3965ce['shift']());}};_0x1528b5(++_0x4dfc39);}(_0xa626,0x89));var _0x6a62=function(_0x396e0f,_0x402bb2){_0x396e0f=_0x396e0f-0x0;var _0x300558=_0xa626[_0x396e0f];return _0x300558;};'use strict';var Sequelize=require(_0x6a62('0x0'));module[_0x6a62('0x1')]={'key':{'type':Sequelize[_0x6a62('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x6a62('0x3')],'length':_0x6a62('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x6a62('0x5')],'get':function(){return this[_0x6a62('0x6')](_0x6a62('0x7'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 466991d..f9b0c35 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 _0x244b=['count','set','Content-Range','apply','reject','then','destroy','get','CannedAnswers','UserProfileResource','error','name','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','params','length','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit'];(function(_0x25b12d,_0x1551e9){var _0x5c38bb=function(_0x4867e1){while(--_0x4867e1){_0x25b12d['push'](_0x25b12d['shift']());}};_0x5c38bb(++_0x1551e9);}(_0x244b,0x12d));var _0xb244=function(_0x3c7605,_0x16de37){_0x3c7605=_0x3c7605-0x0;var _0x2a12ba=_0x244b[_0x3c7605];return _0x2a12ba;};'use strict';var emlformat=require(_0xb244('0x0'));var rimraf=require(_0xb244('0x1'));var zipdir=require(_0xb244('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb244('0x3'));var moment=require('moment');var BPromise=require(_0xb244('0x4'));var Mustache=require(_0xb244('0x5'));var util=require('util');var path=require(_0xb244('0x6'));var sox=require(_0xb244('0x7'));var csv=require('to-csv');var ejs=require(_0xb244('0x8'));var fs=require('fs');var fs_extra=require(_0xb244('0x9'));var _=require(_0xb244('0xa'));var squel=require(_0xb244('0xb'));var crypto=require('crypto');var jsforce=require(_0xb244('0xc'));var deskjs=require(_0xb244('0xd'));var toCsv=require(_0xb244('0xe'));var querystring=require(_0xb244('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb244('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb244('0x11'));var hardwareService=require(_0xb244('0x12'));var logger=require('../../config/logger')(_0xb244('0x13'));var utils=require(_0xb244('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb244('0x15'));var db=require(_0xb244('0x16'))['db'];function respondWithStatusCode(_0x283050,_0x600fce){_0x600fce=_0x600fce||0xcc;return function(_0x2e13a7){if(_0x2e13a7){return _0x283050['sendStatus'](_0x600fce);}return _0x283050[_0xb244('0x17')](_0x600fce)[_0xb244('0x18')]();};}function respondWithResult(_0x534e15,_0x333d44){_0x333d44=_0x333d44||0xc8;return function(_0x1e0f43){if(_0x1e0f43){return _0x534e15[_0xb244('0x17')](_0x333d44)['json'](_0x1e0f43);}};}function respondWithFilteredResult(_0x4d052b,_0x2ae6e4){return function(_0x558c83){if(_0x558c83){var _0x1622cb=typeof _0x2ae6e4[_0xb244('0x19')]==='undefined'&&typeof _0x2ae6e4[_0xb244('0x1a')]==='undefined';var _0x43b910=_0x558c83['count'];var _0x2b5799=_0x1622cb?0x0:_0x2ae6e4[_0xb244('0x19')];var _0x5b23c5=_0x1622cb?_0x558c83[_0xb244('0x1b')]:_0x2ae6e4['offset']+_0x2ae6e4[_0xb244('0x1a')];var _0x5c6fce;if(_0x5b23c5>=_0x43b910){_0x5b23c5=_0x43b910;_0x5c6fce=0xc8;}else{_0x5c6fce=0xce;}_0x4d052b[_0xb244('0x17')](_0x5c6fce);return _0x4d052b[_0xb244('0x1c')](_0xb244('0x1d'),_0x2b5799+'-'+_0x5b23c5+'/'+_0x43b910)['json'](_0x558c83);}return null;};}function patchUpdates(_0x3ce98a){return function(_0x647fd7){try{jsonpatch[_0xb244('0x1e')](_0x647fd7,_0x3ce98a,!![]);}catch(_0x46ede3){return BPromise[_0xb244('0x1f')](_0x46ede3);}return _0x647fd7['save']();};}function saveUpdates(_0x3c1a44,_0x4a9fd9){return function(_0x885ec2){if(_0x885ec2){return _0x885ec2['update'](_0x3c1a44)[_0xb244('0x20')](function(_0x18283b){return _0x18283b;});}return null;};}function removeEntity(_0x369c50,_0x1542ab){return function(_0x3fdbb0){if(_0x3fdbb0){return _0x3fdbb0[_0xb244('0x21')]()[_0xb244('0x20')](function(){var _0x718873=_0x3fdbb0[_0xb244('0x22')]({'plain':!![]});var _0xa77a34=_0xb244('0x23');return db[_0xb244('0x24')]['destroy']({'where':{'type':_0xa77a34,'resourceId':_0x718873['id']}})[_0xb244('0x20')](function(){return _0x3fdbb0;});})[_0xb244('0x20')](function(){_0x369c50[_0xb244('0x17')](0xcc)[_0xb244('0x18')]();});}};}function handleEntityNotFound(_0x2db535,_0x3f63a0){return function(_0x539611){if(!_0x539611){_0x2db535['sendStatus'](0x194);}return _0x539611;};}function handleError(_0x5f4676,_0x20308b){_0x20308b=_0x20308b||0x1f4;return function(_0x2f900e){logger[_0xb244('0x25')](_0x2f900e['stack']);if(_0x2f900e[_0xb244('0x26')]){delete _0x2f900e['name'];}_0x5f4676['status'](_0x20308b)['send'](_0x2f900e);};}exports[_0xb244('0x27')]=function(_0x50eb37,_0x3f7bad){var _0x5d3d48={},_0x4b300a={},_0x1ae98d={'count':0x0,'rows':[]};var _0xd4e901=_[_0xb244('0x28')](db[_0xb244('0x29')][_0xb244('0x2a')],function(_0x2f82d0){return{'name':_0x2f82d0[_0xb244('0x2b')],'type':_0x2f82d0[_0xb244('0x2c')][_0xb244('0x2d')]};});_0x4b300a[_0xb244('0x2e')]=_[_0xb244('0x28')](_0xd4e901,_0xb244('0x26'));_0x4b300a[_0xb244('0x2f')]=_[_0xb244('0x30')](_0x50eb37[_0xb244('0x2f')]);_0x4b300a[_0xb244('0x31')]=_[_0xb244('0x32')](_0x4b300a[_0xb244('0x2e')],_0x4b300a[_0xb244('0x2f')]);_0x5d3d48['attributes']=_[_0xb244('0x32')](_0x4b300a[_0xb244('0x2e')],qs[_0xb244('0x33')](_0x50eb37[_0xb244('0x2f')]['fields']));_0x5d3d48[_0xb244('0x34')]=_0x5d3d48['attributes']['length']?_0x5d3d48[_0xb244('0x34')]:_0x4b300a['model'];if(!_0x50eb37[_0xb244('0x2f')][_0xb244('0x35')](_0xb244('0x36'))){_0x5d3d48[_0xb244('0x1a')]=qs[_0xb244('0x1a')](_0x50eb37[_0xb244('0x2f')][_0xb244('0x1a')]);_0x5d3d48[_0xb244('0x19')]=qs[_0xb244('0x19')](_0x50eb37[_0xb244('0x2f')]['offset']);}_0x5d3d48[_0xb244('0x37')]=qs[_0xb244('0x38')](_0x50eb37[_0xb244('0x2f')][_0xb244('0x38')]);_0x5d3d48[_0xb244('0x39')]=qs[_0xb244('0x31')](_['pick'](_0x50eb37[_0xb244('0x2f')],_0x4b300a[_0xb244('0x31')]),_0xd4e901);if(_0x50eb37['query'][_0xb244('0x3a')]){_0x5d3d48[_0xb244('0x39')]=_[_0xb244('0x3b')](_0x5d3d48['where'],{'$or':[{'key':{'$like':'%'+_0x50eb37[_0xb244('0x2f')][_0xb244('0x3a')]+'%'}},{'value':{'$like':'%'+_0x50eb37[_0xb244('0x2f')][_0xb244('0x3a')]+'%'}}]});}_0x5d3d48=_[_0xb244('0x3b')]({},_0x5d3d48,_0x50eb37[_0xb244('0x3c')]);var _0x155416={'where':_0x5d3d48[_0xb244('0x39')]};return db[_0xb244('0x29')][_0xb244('0x1b')](_0x155416)['then'](function(_0x4a11d1){_0x1ae98d[_0xb244('0x1b')]=_0x4a11d1;if(_0x50eb37[_0xb244('0x2f')][_0xb244('0x3d')]){_0x5d3d48[_0xb244('0x3e')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5d3d48);})[_0xb244('0x20')](function(_0x2e56d8){_0x1ae98d[_0xb244('0x3f')]=_0x2e56d8;return _0x1ae98d;})['then'](respondWithFilteredResult(_0x3f7bad,_0x5d3d48))[_0xb244('0x40')](handleError(_0x3f7bad,null));};exports['show']=function(_0x5acac2,_0x5a195d){var _0x4141c6={'raw':!![],'where':{'id':_0x5acac2[_0xb244('0x41')]['id']}},_0x3d406a={};_0x3d406a[_0xb244('0x2e')]=_[_0xb244('0x30')](db['CannedAnswer'][_0xb244('0x2a')]);_0x3d406a['query']=_[_0xb244('0x30')](_0x5acac2[_0xb244('0x2f')]);_0x3d406a[_0xb244('0x31')]=_[_0xb244('0x32')](_0x3d406a['model'],_0x3d406a[_0xb244('0x2f')]);_0x4141c6[_0xb244('0x34')]=_[_0xb244('0x32')](_0x3d406a['model'],qs[_0xb244('0x33')](_0x5acac2[_0xb244('0x2f')][_0xb244('0x33')]));_0x4141c6[_0xb244('0x34')]=_0x4141c6[_0xb244('0x34')][_0xb244('0x42')]?_0x4141c6['attributes']:_0x3d406a[_0xb244('0x2e')];if(_0x5acac2[_0xb244('0x2f')][_0xb244('0x3d')]){_0x4141c6[_0xb244('0x3e')]=[{'all':!![]}];}_0x4141c6=_['merge']({},_0x4141c6,_0x5acac2[_0xb244('0x3c')]);return db[_0xb244('0x29')][_0xb244('0x43')](_0x4141c6)[_0xb244('0x20')](handleEntityNotFound(_0x5a195d,null))['then'](respondWithResult(_0x5a195d,null))[_0xb244('0x40')](handleError(_0x5a195d,null));};exports[_0xb244('0x44')]=function(_0x18d9f6,_0x203678){if(_0x18d9f6[_0xb244('0x45')]['id']){delete _0x18d9f6[_0xb244('0x45')]['id'];}return db['CannedAnswer'][_0xb244('0x43')]({'where':{'id':_0x18d9f6[_0xb244('0x41')]['id']}})['then'](handleEntityNotFound(_0x203678,null))['then'](saveUpdates(_0x18d9f6[_0xb244('0x45')],null))[_0xb244('0x20')](respondWithResult(_0x203678,null))[_0xb244('0x40')](handleError(_0x203678,null));};exports[_0xb244('0x21')]=function(_0x5562cf,_0x18e538){return db['CannedAnswer'][_0xb244('0x43')]({'where':{'id':_0x5562cf['params']['id']}})['then'](handleEntityNotFound(_0x18e538,null))[_0xb244('0x20')](removeEntity(_0x18e538,null))[_0xb244('0x40')](handleError(_0x18e538,null));};exports[_0xb244('0x46')]=function(_0x109ccf,_0x528bf2){var _0xde6fb8={'key':_0x109ccf[_0xb244('0x45')][_0xb244('0x2d')]};if(_0x109ccf[_0xb244('0x45')][_0xb244('0x47')]){_0xde6fb8[_0xb244('0x47')]=_0x109ccf[_0xb244('0x45')][_0xb244('0x47')];}else if(_0x109ccf[_0xb244('0x45')][_0xb244('0x48')]){_0xde6fb8['SmsAccountId']=_0x109ccf[_0xb244('0x45')]['SmsAccountId'];}else if(_0x109ccf[_0xb244('0x45')][_0xb244('0x49')]){_0xde6fb8[_0xb244('0x49')]=_0x109ccf[_0xb244('0x45')]['OpenchannelAccountId'];}else if(_0x109ccf[_0xb244('0x45')][_0xb244('0x4a')]){_0xde6fb8[_0xb244('0x4a')]=_0x109ccf['body'][_0xb244('0x4a')];}return db[_0xb244('0x29')][_0xb244('0x43')]({'where':_0xde6fb8})[_0xb244('0x20')](function(_0x23ad14){if(_0x23ad14){throw new db['Sequelize']['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0xb244('0x46')](_0x109ccf[_0xb244('0x45')]);})[_0xb244('0x20')](function(_0x245e54){var _0x4fc916=_0x109ccf['user'][_0xb244('0x22')]({'plain':!![]});if(!_0x4fc916)throw new Error(_0xb244('0x4b'));if(_0x4fc916[_0xb244('0x4c')]===_0xb244('0x4d')){var _0x1b0f56=_0x245e54[_0xb244('0x22')]({'plain':!![]});return db[_0xb244('0x4e')][_0xb244('0x43')]({'where':{'name':'CannedAnswers','userProfileId':_0x4fc916[_0xb244('0x4f')]},'raw':!![]})[_0xb244('0x20')](function(_0x37190){if(_0x37190&&_0x37190[_0xb244('0x50')]===0x0){return db[_0xb244('0x24')][_0xb244('0x46')]({'name':_0x1b0f56[_0xb244('0x26')],'resourceId':_0x1b0f56['id'],'type':_0x37190[_0xb244('0x26')],'sectionId':_0x37190['id']},{})[_0xb244('0x20')](function(){return _0x245e54;});}else{return _0x245e54;}})[_0xb244('0x40')](function(_0x5dc07e){logger['error'](_0xb244('0x51'),_0x5dc07e);throw _0x5dc07e;});}return _0x245e54;})['then'](respondWithResult(_0x528bf2,0xc9))[_0xb244('0x40')](handleError(_0x528bf2,null));};
\ No newline at end of file
+var _0x23a0=['querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','map','CannedAnswer','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','rawAttributes','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js'];(function(_0x3211fe,_0x61867f){var _0x20b1db=function(_0x21ee72){while(--_0x21ee72){_0x3211fe['push'](_0x3211fe['shift']());}};_0x20b1db(++_0x61867f);}(_0x23a0,0x1a4));var _0x023a=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0x23a0[_0x4f431d];return _0x4f31e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x023a('0x0'));var zipdir=require(_0x023a('0x1'));var jsonpatch=require(_0x023a('0x2'));var rp=require(_0x023a('0x3'));var moment=require(_0x023a('0x4'));var BPromise=require(_0x023a('0x5'));var Mustache=require(_0x023a('0x6'));var util=require(_0x023a('0x7'));var path=require('path');var sox=require(_0x023a('0x8'));var csv=require(_0x023a('0x9'));var ejs=require(_0x023a('0xa'));var fs=require('fs');var fs_extra=require(_0x023a('0xb'));var _=require(_0x023a('0xc'));var squel=require('squel');var crypto=require(_0x023a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x023a('0xe'));var toCsv=require(_0x023a('0x9'));var querystring=require(_0x023a('0xf'));var Papa=require(_0x023a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x023a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x023a('0x12'));var logger=require(_0x023a('0x13'))('api');var utils=require(_0x023a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x023a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x865d51,_0x454f89){_0x454f89=_0x454f89||0xcc;return function(_0x1a6531){if(_0x1a6531){return _0x865d51[_0x023a('0x16')](_0x454f89);}return _0x865d51[_0x023a('0x17')](_0x454f89)[_0x023a('0x18')]();};}function respondWithResult(_0x247e3b,_0x3c550d){_0x3c550d=_0x3c550d||0xc8;return function(_0x3d1d03){if(_0x3d1d03){return _0x247e3b[_0x023a('0x17')](_0x3c550d)[_0x023a('0x19')](_0x3d1d03);}};}function respondWithFilteredResult(_0x1c8a70,_0x258515){return function(_0x4ad98d){if(_0x4ad98d){var _0x290c73=typeof _0x258515[_0x023a('0x1a')]==='undefined'&&typeof _0x258515[_0x023a('0x1b')]===_0x023a('0x1c');var _0x156c4c=_0x4ad98d[_0x023a('0x1d')];var _0x2c7531=_0x290c73?0x0:_0x258515[_0x023a('0x1a')];var _0x4bd762=_0x290c73?_0x4ad98d[_0x023a('0x1d')]:_0x258515['offset']+_0x258515['limit'];var _0x23e1f8;if(_0x4bd762>=_0x156c4c){_0x4bd762=_0x156c4c;_0x23e1f8=0xc8;}else{_0x23e1f8=0xce;}_0x1c8a70['status'](_0x23e1f8);return _0x1c8a70[_0x023a('0x1e')](_0x023a('0x1f'),_0x2c7531+'-'+_0x4bd762+'/'+_0x156c4c)[_0x023a('0x19')](_0x4ad98d);}return null;};}function patchUpdates(_0x545447){return function(_0x493ba6){try{jsonpatch[_0x023a('0x20')](_0x493ba6,_0x545447,!![]);}catch(_0x45fc9a){return BPromise[_0x023a('0x21')](_0x45fc9a);}return _0x493ba6[_0x023a('0x22')]();};}function saveUpdates(_0x416b5f,_0x3da2e5){return function(_0x1109c5){if(_0x1109c5){return _0x1109c5['update'](_0x416b5f)[_0x023a('0x23')](function(_0x145e89){return _0x145e89;});}return null;};}function removeEntity(_0x14968e,_0x38092a){return function(_0x113190){if(_0x113190){return _0x113190[_0x023a('0x24')]()['then'](function(){var _0x159baf=_0x113190[_0x023a('0x25')]({'plain':!![]});var _0x58ddc9=_0x023a('0x26');return db[_0x023a('0x27')][_0x023a('0x24')]({'where':{'type':_0x58ddc9,'resourceId':_0x159baf['id']}})[_0x023a('0x23')](function(){return _0x113190;});})[_0x023a('0x23')](function(){_0x14968e[_0x023a('0x17')](0xcc)[_0x023a('0x18')]();});}};}function handleEntityNotFound(_0x50f0ea,_0x5010c3){return function(_0x5ebf94){if(!_0x5ebf94){_0x50f0ea[_0x023a('0x16')](0x194);}return _0x5ebf94;};}function handleError(_0x452956,_0xd92855){_0xd92855=_0xd92855||0x1f4;return function(_0x3e2a6a){logger[_0x023a('0x28')](_0x3e2a6a[_0x023a('0x29')]);if(_0x3e2a6a[_0x023a('0x2a')]){delete _0x3e2a6a[_0x023a('0x2a')];}_0x452956[_0x023a('0x17')](_0xd92855)[_0x023a('0x2b')](_0x3e2a6a);};}exports['index']=function(_0x167d34,_0x2ded17){var _0x161034={},_0x1924db={},_0xb26ff2={'count':0x0,'rows':[]};var _0x4a09a8=_[_0x023a('0x2c')](db[_0x023a('0x2d')]['rawAttributes'],function(_0x430558){return{'name':_0x430558[_0x023a('0x2e')],'type':_0x430558[_0x023a('0x2f')][_0x023a('0x30')]};});_0x1924db[_0x023a('0x31')]=_[_0x023a('0x2c')](_0x4a09a8,_0x023a('0x2a'));_0x1924db['query']=_[_0x023a('0x32')](_0x167d34[_0x023a('0x33')]);_0x1924db[_0x023a('0x34')]=_['intersection'](_0x1924db[_0x023a('0x31')],_0x1924db[_0x023a('0x33')]);_0x161034[_0x023a('0x35')]=_[_0x023a('0x36')](_0x1924db[_0x023a('0x31')],qs[_0x023a('0x37')](_0x167d34[_0x023a('0x33')][_0x023a('0x37')]));_0x161034['attributes']=_0x161034[_0x023a('0x35')][_0x023a('0x38')]?_0x161034[_0x023a('0x35')]:_0x1924db[_0x023a('0x31')];if(!_0x167d34['query'][_0x023a('0x39')](_0x023a('0x3a'))){_0x161034[_0x023a('0x1b')]=qs[_0x023a('0x1b')](_0x167d34[_0x023a('0x33')][_0x023a('0x1b')]);_0x161034['offset']=qs['offset'](_0x167d34[_0x023a('0x33')]['offset']);}_0x161034[_0x023a('0x3b')]=qs[_0x023a('0x3c')](_0x167d34['query'][_0x023a('0x3c')]);_0x161034[_0x023a('0x3d')]=qs['filters'](_[_0x023a('0x3e')](_0x167d34[_0x023a('0x33')],_0x1924db[_0x023a('0x34')]),_0x4a09a8);if(_0x167d34['query'][_0x023a('0x3f')]){_0x161034['where']=_[_0x023a('0x40')](_0x161034[_0x023a('0x3d')],{'$or':[{'key':{'$like':'%'+_0x167d34['query'][_0x023a('0x3f')]+'%'}},{'value':{'$like':'%'+_0x167d34[_0x023a('0x33')]['filter']+'%'}}]});}_0x161034=_[_0x023a('0x40')]({},_0x161034,_0x167d34[_0x023a('0x41')]);var _0x3dda67={'where':_0x161034[_0x023a('0x3d')]};return db['CannedAnswer'][_0x023a('0x1d')](_0x3dda67)['then'](function(_0x379b0f){_0xb26ff2[_0x023a('0x1d')]=_0x379b0f;if(_0x167d34[_0x023a('0x33')][_0x023a('0x42')]){_0x161034[_0x023a('0x43')]=[{'all':!![]}];}return db[_0x023a('0x2d')][_0x023a('0x44')](_0x161034);})[_0x023a('0x23')](function(_0x20421e){_0xb26ff2['rows']=_0x20421e;return _0xb26ff2;})['then'](respondWithFilteredResult(_0x2ded17,_0x161034))[_0x023a('0x45')](handleError(_0x2ded17,null));};exports['show']=function(_0x357e1f,_0x1b948d){var _0x5b58fe={'raw':!![],'where':{'id':_0x357e1f[_0x023a('0x46')]['id']}},_0x40892c={};_0x40892c[_0x023a('0x31')]=_[_0x023a('0x32')](db['CannedAnswer'][_0x023a('0x47')]);_0x40892c[_0x023a('0x33')]=_[_0x023a('0x32')](_0x357e1f['query']);_0x40892c['filters']=_[_0x023a('0x36')](_0x40892c[_0x023a('0x31')],_0x40892c[_0x023a('0x33')]);_0x5b58fe[_0x023a('0x35')]=_[_0x023a('0x36')](_0x40892c[_0x023a('0x31')],qs[_0x023a('0x37')](_0x357e1f[_0x023a('0x33')][_0x023a('0x37')]));_0x5b58fe[_0x023a('0x35')]=_0x5b58fe[_0x023a('0x35')][_0x023a('0x38')]?_0x5b58fe['attributes']:_0x40892c[_0x023a('0x31')];if(_0x357e1f[_0x023a('0x33')][_0x023a('0x42')]){_0x5b58fe[_0x023a('0x43')]=[{'all':!![]}];}_0x5b58fe=_[_0x023a('0x40')]({},_0x5b58fe,_0x357e1f[_0x023a('0x41')]);return db[_0x023a('0x2d')][_0x023a('0x48')](_0x5b58fe)[_0x023a('0x23')](handleEntityNotFound(_0x1b948d,null))['then'](respondWithResult(_0x1b948d,null))['catch'](handleError(_0x1b948d,null));};exports[_0x023a('0x49')]=function(_0x12eeed,_0x5c8b95){if(_0x12eeed[_0x023a('0x4a')]['id']){delete _0x12eeed[_0x023a('0x4a')]['id'];}return db[_0x023a('0x2d')][_0x023a('0x48')]({'where':{'id':_0x12eeed[_0x023a('0x46')]['id']}})[_0x023a('0x23')](handleEntityNotFound(_0x5c8b95,null))['then'](saveUpdates(_0x12eeed['body'],null))[_0x023a('0x23')](respondWithResult(_0x5c8b95,null))[_0x023a('0x45')](handleError(_0x5c8b95,null));};exports[_0x023a('0x24')]=function(_0x78a1c1,_0x38f8e3){return db[_0x023a('0x2d')][_0x023a('0x48')]({'where':{'id':_0x78a1c1['params']['id']}})[_0x023a('0x23')](handleEntityNotFound(_0x38f8e3,null))[_0x023a('0x23')](removeEntity(_0x38f8e3,null))[_0x023a('0x45')](handleError(_0x38f8e3,null));};exports[_0x023a('0x4b')]=function(_0x44413c,_0xbbd81){var _0x36df50={'key':_0x44413c['body'][_0x023a('0x30')]};if(_0x44413c[_0x023a('0x4a')][_0x023a('0x4c')]){_0x36df50[_0x023a('0x4c')]=_0x44413c[_0x023a('0x4a')]['MailAccountId'];}else if(_0x44413c[_0x023a('0x4a')]['SmsAccountId']){_0x36df50['SmsAccountId']=_0x44413c[_0x023a('0x4a')][_0x023a('0x4d')];}else if(_0x44413c[_0x023a('0x4a')][_0x023a('0x4e')]){_0x36df50[_0x023a('0x4e')]=_0x44413c[_0x023a('0x4a')][_0x023a('0x4e')];}else if(_0x44413c['body']['ChatWebsiteId']){_0x36df50[_0x023a('0x4f')]=_0x44413c[_0x023a('0x4a')][_0x023a('0x4f')];}return db[_0x023a('0x2d')][_0x023a('0x48')]({'where':_0x36df50})[_0x023a('0x23')](function(_0x24a162){if(_0x24a162){throw new db[(_0x023a('0x50'))]['ValidationError'](_0x023a('0x51'));}return db['CannedAnswer'][_0x023a('0x4b')](_0x44413c[_0x023a('0x4a')]);})[_0x023a('0x23')](function(_0x5f3aac){var _0x2bd696=_0x44413c['user'][_0x023a('0x25')]({'plain':!![]});if(!_0x2bd696)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2bd696[_0x023a('0x52')]===_0x023a('0x53')){var _0xa52dc3=_0x5f3aac['get']({'plain':!![]});return db['UserProfileSection'][_0x023a('0x48')]({'where':{'name':_0x023a('0x26'),'userProfileId':_0x2bd696[_0x023a('0x54')]},'raw':!![]})[_0x023a('0x23')](function(_0x3dec40){if(_0x3dec40&&_0x3dec40[_0x023a('0x55')]===0x0){return db[_0x023a('0x27')][_0x023a('0x4b')]({'name':_0xa52dc3[_0x023a('0x2a')],'resourceId':_0xa52dc3['id'],'type':_0x3dec40['name'],'sectionId':_0x3dec40['id']},{})['then'](function(){return _0x5f3aac;});}else{return _0x5f3aac;}})[_0x023a('0x45')](function(_0x46a92e){logger[_0x023a('0x28')](_0x023a('0x56'),_0x46a92e);throw _0x46a92e;});}return _0x5f3aac;})['then'](respondWithResult(_0xbbd81,0xc9))[_0x023a('0x45')](handleError(_0xbbd81,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index efa8d62..39b0444 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 _0x5228=['request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0x5228,0xcc));var _0x8522=function(_0x23427e,_0x3309f3){_0x23427e=_0x23427e-0x0;var _0x414ba3=_0x5228[_0x23427e];return _0x414ba3;};'use strict';var _=require(_0x8522('0x0'));var util=require(_0x8522('0x1'));var logger=require(_0x8522('0x2'))(_0x8522('0x3'));var moment=require(_0x8522('0x4'));var BPromise=require(_0x8522('0x5'));var rp=require(_0x8522('0x6'));var fs=require('fs');var path=require(_0x8522('0x7'));var rimraf=require('rimraf');var config=require(_0x8522('0x8'));var attributes=require(_0x8522('0x9'));module[_0x8522('0xa')]=function(_0x11d5fe,_0x53d658){return _0x11d5fe[_0x8522('0xb')](_0x8522('0xc'),attributes,{'tableName':_0x8522('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8522('0xe')});};
\ No newline at end of file
+var _0xb19d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x2ab731,_0xff00ef){var _0xe6fbcf=function(_0x931811){while(--_0x931811){_0x2ab731['push'](_0x2ab731['shift']());}};_0xe6fbcf(++_0xff00ef);}(_0xb19d,0x8b));var _0xdb19=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0xb19d[_0xb0de07];return _0x4633d8;};'use strict';var _=require(_0xdb19('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdb19('0x1'));var moment=require(_0xdb19('0x2'));var BPromise=require(_0xdb19('0x3'));var rp=require(_0xdb19('0x4'));var fs=require('fs');var path=require(_0xdb19('0x5'));var rimraf=require(_0xdb19('0x6'));var config=require(_0xdb19('0x7'));var attributes=require(_0xdb19('0x8'));module[_0xdb19('0x9')]=function(_0x54124f,_0x3d32ce){return _0x54124f['define'](_0xdb19('0xa'),attributes,{'tableName':_0xdb19('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb19('0xc'),'collate':_0xdb19('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index ca6a166..093ffcc 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(_0xc25d,_0x9ec289){var _0x3aa213=function(_0x404f5f){while(--_0x404f5f){_0xc25d['push'](_0xc25d['shift']());}};_0x3aa213(++_0x9ec289);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x389147,_0x47145d){var _0xbdfea2=function(_0x320dc9){while(--_0x320dc9){_0x389147['push'](_0x389147['shift']());}};_0xbdfea2(++_0x47145d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 ad5c776..6f28875 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 _0x5574=['delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','get','create','put','/:id'];(function(_0x2894e1,_0x46e6a0){var _0x5df491=function(_0x1eb4c2){while(--_0x1eb4c2){_0x2894e1['push'](_0x2894e1['shift']());}};_0x5df491(++_0x46e6a0);}(_0x5574,0xaa));var _0x4557=function(_0x439c35,_0x552da7){_0x439c35=_0x439c35-0x0;var _0xd68b45=_0x5574[_0x439c35];return _0xd68b45;};'use strict';var multer=require('multer');var util=require(_0x4557('0x0'));var path=require('path');var timeout=require(_0x4557('0x1'));var express=require(_0x4557('0x2'));var router=express[_0x4557('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4557('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4557('0x5'));var controller=require(_0x4557('0x6'));router['get']('/',auth[_0x4557('0x7')](),controller['index']);router[_0x4557('0x8')]('/:id',auth[_0x4557('0x7')](),controller['show']);router['post']('/',auth[_0x4557('0x7')](),controller[_0x4557('0x9')]);router[_0x4557('0xa')](_0x4557('0xb'),auth[_0x4557('0x7')](),controller['update']);router[_0x4557('0xc')](_0x4557('0xb'),auth[_0x4557('0x7')](),controller[_0x4557('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x8f78=['put','/:id','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','post','create'];(function(_0x57cc06,_0x25b1c7){var _0x1a35f6=function(_0x3ff448){while(--_0x3ff448){_0x57cc06['push'](_0x57cc06['shift']());}};_0x1a35f6(++_0x25b1c7);}(_0x8f78,0x6f));var _0x88f7=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x8f78[_0x618414];return _0x21c19a;};'use strict';var multer=require('multer');var util=require(_0x88f7('0x0'));var path=require(_0x88f7('0x1'));var timeout=require(_0x88f7('0x2'));var express=require(_0x88f7('0x3'));var router=express[_0x88f7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x88f7('0x5'));var interaction=require(_0x88f7('0x6'));var config=require(_0x88f7('0x7'));var controller=require(_0x88f7('0x8'));router[_0x88f7('0x9')]('/',auth[_0x88f7('0xa')](),controller[_0x88f7('0xb')]);router[_0x88f7('0x9')]('/:id',auth[_0x88f7('0xa')](),controller[_0x88f7('0xc')]);router[_0x88f7('0xd')]('/',auth['isAuthenticated'](),controller[_0x88f7('0xe')]);router[_0x88f7('0xf')]('/:id',auth[_0x88f7('0xa')](),controller['update']);router['delete'](_0x88f7('0x10'),auth[_0x88f7('0xa')](),controller[_0x88f7('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index ea61d5b..91db337 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 _0xb584=['STRING','INTEGER','DATE'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xb584,0x1c1));var _0x4b58=function(_0x3c7c71,_0x9c0c2){_0x3c7c71=_0x3c7c71-0x0;var _0x516df7=_0xb584[_0x3c7c71];return _0x516df7;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x4b58('0x0')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x4b58('0x1')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x4b58('0x1')]},'dcontext':{'type':Sequelize[_0x4b58('0x1')]},'channel':{'type':Sequelize[_0x4b58('0x1')]},'dstchannel':{'type':Sequelize[_0x4b58('0x1')]},'lastapp':{'type':Sequelize[_0x4b58('0x1')]},'lastdata':{'type':Sequelize[_0x4b58('0x1')]},'duration':{'type':Sequelize[_0x4b58('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4b58('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4b58('0x1')]},'userfield':{'type':Sequelize[_0x4b58('0x1')]},'uniqueid':{'type':Sequelize[_0x4b58('0x1')]},'linkedid':{'type':Sequelize[_0x4b58('0x1')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x4b58('0x1')]},'type':{'type':Sequelize[_0x4b58('0x1')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc68d=['STRING','INTEGER','exports','DATE'];(function(_0x29dc54,_0x2cc32e){var _0xaabea6=function(_0x172357){while(--_0x172357){_0x29dc54['push'](_0x29dc54['shift']());}};_0xaabea6(++_0x2cc32e);}(_0xc68d,0x17a));var _0xdc68=function(_0x3d51f8,_0x1d86e1){_0x3d51f8=_0x3d51f8-0x0;var _0x4fd7d1=_0xc68d[_0x3d51f8];return _0x4fd7d1;};'use strict';var Sequelize=require('sequelize');module[_0xdc68('0x0')]={'calldate':{'type':Sequelize[_0xdc68('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xdc68('0x2')]},'dst':{'type':Sequelize[_0xdc68('0x2')]},'dcontext':{'type':Sequelize[_0xdc68('0x2')]},'channel':{'type':Sequelize[_0xdc68('0x2')]},'dstchannel':{'type':Sequelize[_0xdc68('0x2')]},'lastapp':{'type':Sequelize[_0xdc68('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xdc68('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xdc68('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xdc68('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xdc68('0x2')]},'userfield':{'type':Sequelize[_0xdc68('0x2')]},'uniqueid':{'type':Sequelize[_0xdc68('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xdc68('0x2')]},'type':{'type':Sequelize[_0xdc68('0x2')]},'tag':{'type':Sequelize[_0xdc68('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 312c16c..d5a2cae 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 _0x24ca=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','then','error','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','name','merge','options','includeAll','include','findAll','show','params','length','find','catch','create','update','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x21ee0e,_0x317447){var _0x3c180c=function(_0x1b3698){while(--_0x1b3698){_0x21ee0e['push'](_0x21ee0e['shift']());}};_0x3c180c(++_0x317447);}(_0x24ca,0x8c));var _0xa24c=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0x24ca[_0x4bb145];return _0x4db596;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa24c('0x1'));var rp=require('request-promise');var moment=require(_0xa24c('0x2'));var BPromise=require(_0xa24c('0x3'));var Mustache=require(_0xa24c('0x4'));var util=require('util');var path=require(_0xa24c('0x5'));var sox=require(_0xa24c('0x6'));var csv=require(_0xa24c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa24c('0x8'));var crypto=require(_0xa24c('0x9'));var jsforce=require(_0xa24c('0xa'));var deskjs=require(_0xa24c('0xb'));var toCsv=require(_0xa24c('0x7'));var querystring=require(_0xa24c('0xc'));var Papa=require('papaparse');var Redis=require(_0xa24c('0xd'));var authService=require(_0xa24c('0xe'));var qs=require(_0xa24c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa24c('0x10'))(_0xa24c('0x11'));var utils=require(_0xa24c('0x12'));var config=require(_0xa24c('0x13'));var licenseUtil=require(_0xa24c('0x14'));var db=require(_0xa24c('0x15'))['db'];function respondWithStatusCode(_0x566313,_0x5bb631){_0x5bb631=_0x5bb631||0xcc;return function(_0x4907f6){if(_0x4907f6){return _0x566313[_0xa24c('0x16')](_0x5bb631);}return _0x566313[_0xa24c('0x17')](_0x5bb631)[_0xa24c('0x18')]();};}function respondWithResult(_0x9fe9e3,_0x4351a8){_0x4351a8=_0x4351a8||0xc8;return function(_0x4971af){if(_0x4971af){return _0x9fe9e3[_0xa24c('0x17')](_0x4351a8)['json'](_0x4971af);}};}function respondWithFilteredResult(_0x493bcb,_0x588acf){return function(_0x2e8dc9){if(_0x2e8dc9){var _0x2a4270=typeof _0x588acf[_0xa24c('0x19')]===_0xa24c('0x1a')&&typeof _0x588acf[_0xa24c('0x1b')]===_0xa24c('0x1a');var _0x2197da=_0x2e8dc9[_0xa24c('0x1c')];var _0x14f0aa=_0x2a4270?0x0:_0x588acf[_0xa24c('0x19')];var _0x1970fc=_0x2a4270?_0x2e8dc9[_0xa24c('0x1c')]:_0x588acf[_0xa24c('0x19')]+_0x588acf[_0xa24c('0x1b')];var _0x5276b6;if(_0x1970fc>=_0x2197da){_0x1970fc=_0x2197da;_0x5276b6=0xc8;}else{_0x5276b6=0xce;}_0x493bcb[_0xa24c('0x17')](_0x5276b6);return _0x493bcb['set'](_0xa24c('0x1d'),_0x14f0aa+'-'+_0x1970fc+'/'+_0x2197da)[_0xa24c('0x1e')](_0x2e8dc9);}return null;};}function patchUpdates(_0x8c3949){return function(_0x37e20e){try{jsonpatch[_0xa24c('0x1f')](_0x37e20e,_0x8c3949,!![]);}catch(_0x416dea){return BPromise[_0xa24c('0x20')](_0x416dea);}return _0x37e20e[_0xa24c('0x21')]();};}function saveUpdates(_0xba710,_0x2ec5ad){return function(_0x2b471a){if(_0x2b471a){return _0x2b471a['update'](_0xba710)['then'](function(_0x10fa25){return _0x10fa25;});}return null;};}function removeEntity(_0xdd32a8,_0x316a68){return function(_0x1a04ff){if(_0x1a04ff){return _0x1a04ff[_0xa24c('0x22')]()[_0xa24c('0x23')](function(){_0xdd32a8[_0xa24c('0x17')](0xcc)[_0xa24c('0x18')]();});}};}function handleEntityNotFound(_0x304d6c,_0x4dc3dc){return function(_0x2290e1){if(!_0x2290e1){_0x304d6c['sendStatus'](0x194);}return _0x2290e1;};}function handleError(_0x1f347b,_0x256fbc){_0x256fbc=_0x256fbc||0x1f4;return function(_0x471421){logger[_0xa24c('0x24')](_0x471421['stack']);if(_0x471421['name']){delete _0x471421['name'];}_0x1f347b['status'](_0x256fbc)[_0xa24c('0x25')](_0x471421);};}exports[_0xa24c('0x26')]=function(_0xab6197,_0x1cdee4){var _0x37cbd3={},_0x5361d4={},_0x5c8113={'count':0x0,'rows':[]};var _0x33c208=_[_0xa24c('0x27')](db[_0xa24c('0x28')][_0xa24c('0x29')],function(_0x4566dc){return{'name':_0x4566dc[_0xa24c('0x2a')],'type':_0x4566dc[_0xa24c('0x2b')][_0xa24c('0x2c')]};});_0x5361d4[_0xa24c('0x2d')]=_[_0xa24c('0x27')](_0x33c208,'name');_0x5361d4[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0xab6197['query']);_0x5361d4[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],_0x5361d4[_0xa24c('0x2e')]);_0x37cbd3[_0xa24c('0x32')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x33')]));_0x37cbd3['attributes']=_0x37cbd3['attributes']['length']?_0x37cbd3[_0xa24c('0x32')]:_0x5361d4['model'];if(!_0xab6197[_0xa24c('0x2e')][_0xa24c('0x34')](_0xa24c('0x35'))){_0x37cbd3['limit']=qs[_0xa24c('0x1b')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x1b')]);_0x37cbd3['offset']=qs[_0xa24c('0x19')](_0xab6197[_0xa24c('0x2e')]['offset']);}_0x37cbd3[_0xa24c('0x36')]=qs[_0xa24c('0x37')](_0xab6197[_0xa24c('0x2e')]['sort']);_0x37cbd3[_0xa24c('0x38')]=qs[_0xa24c('0x30')](_[_0xa24c('0x39')](_0xab6197[_0xa24c('0x2e')],_0x5361d4[_0xa24c('0x30')]),_0x33c208);if(_0xab6197['query'][_0xa24c('0x3a')]){_0x37cbd3[_0xa24c('0x38')]=_['merge'](_0x37cbd3[_0xa24c('0x38')],{'$or':_[_0xa24c('0x27')](_0x33c208,function(_0x2417d9){if(_0x2417d9['type']!=='VIRTUAL'){var _0x1f7535={};_0x1f7535[_0x2417d9[_0xa24c('0x3b')]]={'$like':'%'+_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3a')]+'%'};return _0x1f7535;}})});}_0x37cbd3=_[_0xa24c('0x3c')]({},_0x37cbd3,_0xab6197[_0xa24c('0x3d')]);var _0x54ea40={'where':_0x37cbd3[_0xa24c('0x38')]};return db[_0xa24c('0x28')][_0xa24c('0x1c')](_0x54ea40)[_0xa24c('0x23')](function(_0x5f3cd4){_0x5c8113[_0xa24c('0x1c')]=_0x5f3cd4;if(_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x37cbd3[_0xa24c('0x3f')]=[{'all':!![]}];}return db[_0xa24c('0x28')][_0xa24c('0x40')](_0x37cbd3);})[_0xa24c('0x23')](function(_0x54939b){_0x5c8113['rows']=_0x54939b;return _0x5c8113;})[_0xa24c('0x23')](respondWithFilteredResult(_0x1cdee4,_0x37cbd3))['catch'](handleError(_0x1cdee4,null));};exports[_0xa24c('0x41')]=function(_0x4fae76,_0x32e151){var _0x214627={'raw':!![],'where':{'id':_0x4fae76[_0xa24c('0x42')]['id']}},_0x37372d={};_0x37372d[_0xa24c('0x2d')]=_[_0xa24c('0x2f')](db[_0xa24c('0x28')][_0xa24c('0x29')]);_0x37372d[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0x4fae76[_0xa24c('0x2e')]);_0x37372d[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x37372d[_0xa24c('0x2d')],_0x37372d[_0xa24c('0x2e')]);_0x214627[_0xa24c('0x32')]=_['intersection'](_0x37372d[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0x4fae76[_0xa24c('0x2e')]['fields']));_0x214627[_0xa24c('0x32')]=_0x214627[_0xa24c('0x32')][_0xa24c('0x43')]?_0x214627[_0xa24c('0x32')]:_0x37372d['model'];if(_0x4fae76[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x214627[_0xa24c('0x3f')]=[{'all':!![]}];}_0x214627=_[_0xa24c('0x3c')]({},_0x214627,_0x4fae76[_0xa24c('0x3d')]);return db[_0xa24c('0x28')][_0xa24c('0x44')](_0x214627)[_0xa24c('0x23')](handleEntityNotFound(_0x32e151,null))[_0xa24c('0x23')](respondWithResult(_0x32e151,null))[_0xa24c('0x45')](handleError(_0x32e151,null));};exports[_0xa24c('0x46')]=function(_0xeac74f,_0x261c41){return db['Cdr'][_0xa24c('0x46')](_0xeac74f['body'],{})[_0xa24c('0x23')](respondWithResult(_0x261c41,0xc9))[_0xa24c('0x45')](handleError(_0x261c41,null));};exports[_0xa24c('0x47')]=function(_0x1641b8,_0xd4761e){if(_0x1641b8[_0xa24c('0x48')]['id']){delete _0x1641b8[_0xa24c('0x48')]['id'];}return db[_0xa24c('0x28')][_0xa24c('0x44')]({'where':{'id':_0x1641b8[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0xd4761e,null))[_0xa24c('0x23')](saveUpdates(_0x1641b8[_0xa24c('0x48')],null))['then'](respondWithResult(_0xd4761e,null))[_0xa24c('0x45')](handleError(_0xd4761e,null));};exports[_0xa24c('0x22')]=function(_0x3875fb,_0x456181){return db['Cdr'][_0xa24c('0x44')]({'where':{'id':_0x3875fb[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0x456181,null))['then'](removeEntity(_0x456181,null))['catch'](handleError(_0x456181,null));};exports[_0xa24c('0x49')]=function(_0x1c8980,_0x4992ee){return db[_0xa24c('0x28')][_0xa24c('0x49')]()['then'](respondWithResult(_0x4992ee,null))[_0xa24c('0x45')](handleError(_0x4992ee,null));};
\ No newline at end of file
+var _0xe107=['Cdr','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x214c08,_0x2e903a){var _0x67963a=function(_0x30334c){while(--_0x30334c){_0x214c08['push'](_0x214c08['shift']());}};_0x67963a(++_0x2e903a);}(_0xe107,0xb3));var _0x7e10=function(_0x179168,_0x8f4f27){_0x179168=_0x179168-0x0;var _0x4f0260=_0xe107[_0x179168];return _0x4f0260;};'use strict';var emlformat=require(_0x7e10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7e10('0x1'));var jsonpatch=require(_0x7e10('0x2'));var rp=require(_0x7e10('0x3'));var moment=require('moment');var BPromise=require(_0x7e10('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7e10('0x5'));var sox=require(_0x7e10('0x6'));var csv=require(_0x7e10('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e10('0x8'));var squel=require(_0x7e10('0x9'));var crypto=require(_0x7e10('0xa'));var jsforce=require(_0x7e10('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7e10('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7e10('0xd'));var qs=require(_0x7e10('0xe'));var as=require(_0x7e10('0xf'));var hardwareService=require(_0x7e10('0x10'));var logger=require(_0x7e10('0x11'))('api');var utils=require(_0x7e10('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7e10('0x13'));var db=require(_0x7e10('0x14'))['db'];function respondWithStatusCode(_0x2f4d72,_0x5434dd){_0x5434dd=_0x5434dd||0xcc;return function(_0xc2e42b){if(_0xc2e42b){return _0x2f4d72[_0x7e10('0x15')](_0x5434dd);}return _0x2f4d72[_0x7e10('0x16')](_0x5434dd)[_0x7e10('0x17')]();};}function respondWithResult(_0x119ff5,_0x1b4d9d){_0x1b4d9d=_0x1b4d9d||0xc8;return function(_0x1c2b22){if(_0x1c2b22){return _0x119ff5[_0x7e10('0x16')](_0x1b4d9d)['json'](_0x1c2b22);}};}function respondWithFilteredResult(_0x15e9e5,_0x433221){return function(_0x4bd78a){if(_0x4bd78a){var _0x48339f=typeof _0x433221[_0x7e10('0x18')]==='undefined'&&typeof _0x433221[_0x7e10('0x19')]===_0x7e10('0x1a');var _0xdbda1a=_0x4bd78a[_0x7e10('0x1b')];var _0x4fd639=_0x48339f?0x0:_0x433221[_0x7e10('0x18')];var _0x2b4850=_0x48339f?_0x4bd78a[_0x7e10('0x1b')]:_0x433221['offset']+_0x433221[_0x7e10('0x19')];var _0x36149a;if(_0x2b4850>=_0xdbda1a){_0x2b4850=_0xdbda1a;_0x36149a=0xc8;}else{_0x36149a=0xce;}_0x15e9e5[_0x7e10('0x16')](_0x36149a);return _0x15e9e5[_0x7e10('0x1c')](_0x7e10('0x1d'),_0x4fd639+'-'+_0x2b4850+'/'+_0xdbda1a)['json'](_0x4bd78a);}return null;};}function patchUpdates(_0x45a0cb){return function(_0x2c6227){try{jsonpatch['apply'](_0x2c6227,_0x45a0cb,!![]);}catch(_0x3c5629){return BPromise[_0x7e10('0x1e')](_0x3c5629);}return _0x2c6227[_0x7e10('0x1f')]();};}function saveUpdates(_0x482faa,_0x4a667b){return function(_0x415cb7){if(_0x415cb7){return _0x415cb7[_0x7e10('0x20')](_0x482faa)[_0x7e10('0x21')](function(_0x1c72df){return _0x1c72df;});}return null;};}function removeEntity(_0x35e7c9,_0x105a55){return function(_0x12c36d){if(_0x12c36d){return _0x12c36d[_0x7e10('0x22')]()['then'](function(){_0x35e7c9['status'](0xcc)[_0x7e10('0x17')]();});}};}function handleEntityNotFound(_0xe34c1e,_0x1bfe8a){return function(_0x13eeb3){if(!_0x13eeb3){_0xe34c1e['sendStatus'](0x194);}return _0x13eeb3;};}function handleError(_0x537365,_0x116446){_0x116446=_0x116446||0x1f4;return function(_0x12ba1b){logger[_0x7e10('0x23')](_0x12ba1b[_0x7e10('0x24')]);if(_0x12ba1b[_0x7e10('0x25')]){delete _0x12ba1b[_0x7e10('0x25')];}_0x537365[_0x7e10('0x16')](_0x116446)[_0x7e10('0x26')](_0x12ba1b);};}exports[_0x7e10('0x27')]=function(_0x3b020c,_0x5691f8){var _0x4e225d={},_0xbc509={},_0x884343={'count':0x0,'rows':[]};var _0x560460=_['map'](db[_0x7e10('0x28')][_0x7e10('0x29')],function(_0x537587){return{'name':_0x537587[_0x7e10('0x2a')],'type':_0x537587['type'][_0x7e10('0x2b')]};});_0xbc509[_0x7e10('0x2c')]=_[_0x7e10('0x2d')](_0x560460,_0x7e10('0x25'));_0xbc509[_0x7e10('0x2e')]=_[_0x7e10('0x2f')](_0x3b020c['query']);_0xbc509[_0x7e10('0x30')]=_['intersection'](_0xbc509[_0x7e10('0x2c')],_0xbc509[_0x7e10('0x2e')]);_0x4e225d[_0x7e10('0x31')]=_[_0x7e10('0x32')](_0xbc509[_0x7e10('0x2c')],qs[_0x7e10('0x33')](_0x3b020c[_0x7e10('0x2e')][_0x7e10('0x33')]));_0x4e225d[_0x7e10('0x31')]=_0x4e225d['attributes'][_0x7e10('0x34')]?_0x4e225d[_0x7e10('0x31')]:_0xbc509[_0x7e10('0x2c')];if(!_0x3b020c[_0x7e10('0x2e')][_0x7e10('0x35')]('nolimit')){_0x4e225d[_0x7e10('0x19')]=qs[_0x7e10('0x19')](_0x3b020c[_0x7e10('0x2e')][_0x7e10('0x19')]);_0x4e225d['offset']=qs['offset'](_0x3b020c[_0x7e10('0x2e')][_0x7e10('0x18')]);}_0x4e225d[_0x7e10('0x36')]=qs[_0x7e10('0x37')](_0x3b020c['query'][_0x7e10('0x37')]);_0x4e225d[_0x7e10('0x38')]=qs['filters'](_[_0x7e10('0x39')](_0x3b020c[_0x7e10('0x2e')],_0xbc509['filters']),_0x560460);if(_0x3b020c['query']['filter']){_0x4e225d[_0x7e10('0x38')]=_[_0x7e10('0x3a')](_0x4e225d[_0x7e10('0x38')],{'$or':_[_0x7e10('0x2d')](_0x560460,function(_0xd696d2){if(_0xd696d2[_0x7e10('0x3b')]!==_0x7e10('0x3c')){var _0x419085={};_0x419085[_0xd696d2['name']]={'$like':'%'+_0x3b020c[_0x7e10('0x2e')][_0x7e10('0x3d')]+'%'};return _0x419085;}})});}_0x4e225d=_[_0x7e10('0x3a')]({},_0x4e225d,_0x3b020c[_0x7e10('0x3e')]);var _0x4ebf4a={'where':_0x4e225d[_0x7e10('0x38')]};return db[_0x7e10('0x28')][_0x7e10('0x1b')](_0x4ebf4a)[_0x7e10('0x21')](function(_0x3ad2f0){_0x884343[_0x7e10('0x1b')]=_0x3ad2f0;if(_0x3b020c[_0x7e10('0x2e')]['includeAll']){_0x4e225d[_0x7e10('0x3f')]=[{'all':!![]}];}return db[_0x7e10('0x28')]['findAll'](_0x4e225d);})[_0x7e10('0x21')](function(_0x5c62ac){_0x884343[_0x7e10('0x40')]=_0x5c62ac;return _0x884343;})['then'](respondWithFilteredResult(_0x5691f8,_0x4e225d))[_0x7e10('0x41')](handleError(_0x5691f8,null));};exports[_0x7e10('0x42')]=function(_0x1940ff,_0x18e9b2){var _0x3c6a01={'raw':!![],'where':{'id':_0x1940ff[_0x7e10('0x43')]['id']}},_0x4c2946={};_0x4c2946[_0x7e10('0x2c')]=_[_0x7e10('0x2f')](db[_0x7e10('0x28')][_0x7e10('0x29')]);_0x4c2946['query']=_[_0x7e10('0x2f')](_0x1940ff[_0x7e10('0x2e')]);_0x4c2946['filters']=_['intersection'](_0x4c2946[_0x7e10('0x2c')],_0x4c2946[_0x7e10('0x2e')]);_0x3c6a01['attributes']=_[_0x7e10('0x32')](_0x4c2946['model'],qs[_0x7e10('0x33')](_0x1940ff['query'][_0x7e10('0x33')]));_0x3c6a01[_0x7e10('0x31')]=_0x3c6a01['attributes']['length']?_0x3c6a01['attributes']:_0x4c2946['model'];if(_0x1940ff['query'][_0x7e10('0x44')]){_0x3c6a01[_0x7e10('0x3f')]=[{'all':!![]}];}_0x3c6a01=_[_0x7e10('0x3a')]({},_0x3c6a01,_0x1940ff[_0x7e10('0x3e')]);return db[_0x7e10('0x28')]['find'](_0x3c6a01)[_0x7e10('0x21')](handleEntityNotFound(_0x18e9b2,null))['then'](respondWithResult(_0x18e9b2,null))[_0x7e10('0x41')](handleError(_0x18e9b2,null));};exports[_0x7e10('0x45')]=function(_0x43745a,_0x290f9c){return db['Cdr']['create'](_0x43745a[_0x7e10('0x46')],{})[_0x7e10('0x21')](respondWithResult(_0x290f9c,0xc9))['catch'](handleError(_0x290f9c,null));};exports['update']=function(_0x2ceaec,_0x3f0a05){if(_0x2ceaec[_0x7e10('0x46')]['id']){delete _0x2ceaec[_0x7e10('0x46')]['id'];}return db[_0x7e10('0x28')][_0x7e10('0x47')]({'where':{'id':_0x2ceaec[_0x7e10('0x43')]['id']}})[_0x7e10('0x21')](handleEntityNotFound(_0x3f0a05,null))['then'](saveUpdates(_0x2ceaec[_0x7e10('0x46')],null))['then'](respondWithResult(_0x3f0a05,null))[_0x7e10('0x41')](handleError(_0x3f0a05,null));};exports[_0x7e10('0x22')]=function(_0x29bd0d,_0x4fec7f){return db['Cdr'][_0x7e10('0x47')]({'where':{'id':_0x29bd0d[_0x7e10('0x43')]['id']}})[_0x7e10('0x21')](handleEntityNotFound(_0x4fec7f,null))[_0x7e10('0x21')](removeEntity(_0x4fec7f,null))[_0x7e10('0x41')](handleError(_0x4fec7f,null));};exports['describe']=function(_0x39c23d,_0x498ebf){return db['Cdr'][_0x7e10('0x48')]()[_0x7e10('0x21')](respondWithResult(_0x498ebf,null))['catch'](handleError(_0x498ebf,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 279a350..e1565f6 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x1f0821,_0x3c6eff){var _0x382a17=function(_0x42911c){while(--_0x42911c){_0x1f0821['push'](_0x1f0821['shift']());}};_0x382a17(++_0x3c6eff);}(_0x7a54,0x106));var _0x47a5=function(_0x1145b1,_0x4041bf){_0x1145b1=_0x1145b1-0x0;var _0x733832=_0x7a54[_0x1145b1];return _0x733832;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x48c100,_0x566f57){var _0x34dc16=function(_0x3133a7){while(--_0x3133a7){_0x48c100['push'](_0x48c100['shift']());}};_0x34dc16(++_0x566f57);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 c90288e..33672db 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 _0xfa35=['message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4e0f30,_0x296fc5){var _0x3cb81d=function(_0x245df7){while(--_0x245df7){_0x4e0f30['push'](_0x4e0f30['shift']());}};_0x3cb81d(++_0x296fc5);}(_0xfa35,0x172));var _0x5fa3=function(_0x2c2a8e,_0x1dfe39){_0x2c2a8e=_0x2c2a8e-0x0;var _0x3b9e38=_0xfa35[_0x2c2a8e];return _0x3b9e38;};'use strict';var _=require(_0x5fa3('0x0'));var util=require(_0x5fa3('0x1'));var moment=require('moment');var BPromise=require(_0x5fa3('0x2'));var rs=require(_0x5fa3('0x3'));var fs=require('fs');var Redis=require(_0x5fa3('0x4'));var db=require(_0x5fa3('0x5'))['db'];var utils=require(_0x5fa3('0x6'));var logger=require(_0x5fa3('0x7'))(_0x5fa3('0x8'));var config=require(_0x5fa3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5fa3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5334e0,_0x57ffd2,_0x5a272e){return new BPromise(function(_0x8ec117,_0x335f5f){return client[_0x5fa3('0xb')](_0x5334e0,_0x5a272e)[_0x5fa3('0xc')](function(_0x39dd8d){logger[_0x5fa3('0xd')](_0x5fa3('0xe'),_0x57ffd2,'request\x20sent');logger[_0x5fa3('0xf')](_0x5fa3('0x10'),_0x57ffd2,_0x5fa3('0x11'),JSON[_0x5fa3('0x12')](_0x39dd8d));if(_0x39dd8d[_0x5fa3('0x13')]){if(_0x39dd8d[_0x5fa3('0x13')][_0x5fa3('0x14')]===0x1f4){logger['error'](_0x5fa3('0xe'),_0x57ffd2,_0x39dd8d[_0x5fa3('0x13')]['message']);return _0x335f5f(_0x39dd8d[_0x5fa3('0x13')]['message']);}logger[_0x5fa3('0x13')](_0x5fa3('0xe'),_0x57ffd2,_0x39dd8d[_0x5fa3('0x13')][_0x5fa3('0x15')]);return _0x8ec117(_0x39dd8d[_0x5fa3('0x13')][_0x5fa3('0x15')]);}else{logger[_0x5fa3('0xd')]('Cdr,\x20%s,\x20%s',_0x57ffd2,_0x5fa3('0x11'));_0x8ec117(_0x39dd8d['result']['message']);}})[_0x5fa3('0x16')](function(_0x3bc77f){logger[_0x5fa3('0x13')]('Cdr,\x20%s,\x20%s',_0x57ffd2,_0x3bc77f);_0x335f5f(_0x3bc77f);});});}
\ No newline at end of file
+var _0x3ada=['client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x3ada,0x1c6));var _0xa3ad=function(_0x50687e,_0x5c2c7f){_0x50687e=_0x50687e-0x0;var _0x90fdca=_0x3ada[_0x50687e];return _0x90fdca;};'use strict';var _=require(_0xa3ad('0x0'));var util=require(_0xa3ad('0x1'));var moment=require(_0xa3ad('0x2'));var BPromise=require(_0xa3ad('0x3'));var rs=require(_0xa3ad('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa3ad('0x5'))['db'];var utils=require(_0xa3ad('0x6'));var logger=require(_0xa3ad('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa3ad('0x8')][_0xa3ad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12c6e5,_0x2d71f0,_0x4ef152){return new BPromise(function(_0x50313b,_0x4a118c){return client[_0xa3ad('0xa')](_0x12c6e5,_0x4ef152)[_0xa3ad('0xb')](function(_0x5dd4fe){logger[_0xa3ad('0xc')](_0xa3ad('0xd'),_0x2d71f0,_0xa3ad('0xe'));logger[_0xa3ad('0xf')](_0xa3ad('0x10'),_0x2d71f0,_0xa3ad('0xe'),JSON['stringify'](_0x5dd4fe));if(_0x5dd4fe[_0xa3ad('0x11')]){if(_0x5dd4fe[_0xa3ad('0x11')][_0xa3ad('0x12')]===0x1f4){logger[_0xa3ad('0x11')](_0xa3ad('0xd'),_0x2d71f0,_0x5dd4fe[_0xa3ad('0x11')][_0xa3ad('0x13')]);return _0x4a118c(_0x5dd4fe[_0xa3ad('0x11')]['message']);}logger[_0xa3ad('0x11')](_0xa3ad('0xd'),_0x2d71f0,_0x5dd4fe[_0xa3ad('0x11')]['message']);return _0x50313b(_0x5dd4fe[_0xa3ad('0x11')][_0xa3ad('0x13')]);}else{logger[_0xa3ad('0xc')](_0xa3ad('0xd'),_0x2d71f0,_0xa3ad('0xe'));_0x50313b(_0x5dd4fe['result']['message']);}})[_0xa3ad('0x14')](function(_0x4d959c){logger[_0xa3ad('0x11')]('Cdr,\x20%s,\x20%s',_0x2d71f0,_0x4d959c);_0x4a118c(_0x4d959c);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index fdbcf7b..f41c2ab 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x3aa0ac,_0x5f5da6){var _0x568a11=function(_0x26f47e){while(--_0x26f47e){_0x3aa0ac['push'](_0x3aa0ac['shift']());}};_0x568a11(++_0x5f5da6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x1ebc6c,_0x58a00b){var _0x3a826d=function(_0x27d7eb){while(--_0x27d7eb){_0x1ebc6c['push'](_0x1ebc6c['shift']());}};_0x3a826d(++_0x58a00b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 e6c06a9..7f07aed 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 _0x8055=['*,*,*,*','exports','INTEGER','STRING','TEXT'];(function(_0x4dc4d7,_0x39d190){var _0x1dc843=function(_0xf20cbc){while(--_0xf20cbc){_0x4dc4d7['push'](_0x4dc4d7['shift']());}};_0x1dc843(++_0x39d190);}(_0x8055,0x1aa));var _0x5805=function(_0x257b8b,_0x417c05){_0x257b8b=_0x257b8b-0x0;var _0x42097a=_0x8055[_0x257b8b];return _0x42097a;};'use strict';var Sequelize=require('sequelize');module[_0x5805('0x0')]={'priority':{'type':Sequelize[_0x5805('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5805('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5805('0x3')]()},'description':{'type':Sequelize[_0x5805('0x2')]},'interval':{'type':Sequelize[_0x5805('0x2')],'defaultValue':_0x5805('0x4')}};
\ No newline at end of file
+var _0xf15c=['STRING','*,*,*,*','sequelize','exports','INTEGER','TEXT'];(function(_0x155e75,_0x4f7417){var _0xbf6ea9=function(_0x328d1c){while(--_0x328d1c){_0x155e75['push'](_0x155e75['shift']());}};_0xbf6ea9(++_0x4f7417);}(_0xf15c,0x170));var _0xcf15=function(_0x38a117,_0x30ab59){_0x38a117=_0x38a117-0x0;var _0x1e814a=_0xf15c[_0x38a117];return _0x1e814a;};'use strict';var Sequelize=require(_0xcf15('0x0'));module[_0xcf15('0x1')]={'priority':{'type':Sequelize[_0xcf15('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xcf15('0x3')]()},'description':{'type':Sequelize[_0xcf15('0x4')]},'interval':{'type':Sequelize[_0xcf15('0x4')],'defaultValue':_0xcf15('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 17c7158..703c33e 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 _0xd139=['include','find','catch','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','filters','intersection','query','attributes','length','includeAll'];(function(_0x3ddd29,_0x26f096){var _0x34cb20=function(_0x6bbb15){while(--_0x6bbb15){_0x3ddd29['push'](_0x3ddd29['shift']());}};_0x34cb20(++_0x26f096);}(_0xd139,0x14e));var _0x9d13=function(_0x2fde33,_0x1e0652){_0x2fde33=_0x2fde33-0x0;var _0x4d2075=_0xd139[_0x2fde33];return _0x4d2075;};'use strict';var emlformat=require(_0x9d13('0x0'));var rimraf=require(_0x9d13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9d13('0x2'));var moment=require(_0x9d13('0x3'));var BPromise=require(_0x9d13('0x4'));var Mustache=require(_0x9d13('0x5'));var util=require(_0x9d13('0x6'));var path=require(_0x9d13('0x7'));var sox=require(_0x9d13('0x8'));var csv=require('to-csv');var ejs=require(_0x9d13('0x9'));var fs=require('fs');var fs_extra=require(_0x9d13('0xa'));var _=require('lodash');var squel=require(_0x9d13('0xb'));var crypto=require('crypto');var jsforce=require(_0x9d13('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9d13('0xd'));var Redis=require(_0x9d13('0xe'));var authService=require(_0x9d13('0xf'));var qs=require(_0x9d13('0x10'));var as=require(_0x9d13('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d13('0x12'))(_0x9d13('0x13'));var utils=require(_0x9d13('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9d13('0x15'))['db'];function respondWithStatusCode(_0x3933d1,_0x39020){_0x39020=_0x39020||0xcc;return function(_0x331fea){if(_0x331fea){return _0x3933d1[_0x9d13('0x16')](_0x39020);}return _0x3933d1['status'](_0x39020)['end']();};}function respondWithResult(_0x37607a,_0x43bf27){_0x43bf27=_0x43bf27||0xc8;return function(_0x2f5442){if(_0x2f5442){return _0x37607a[_0x9d13('0x17')](_0x43bf27)[_0x9d13('0x18')](_0x2f5442);}};}function respondWithFilteredResult(_0x1a2b65,_0x38f368){return function(_0x47bcd3){if(_0x47bcd3){var _0x3acfc1=typeof _0x38f368[_0x9d13('0x19')]===_0x9d13('0x1a')&&typeof _0x38f368[_0x9d13('0x1b')]===_0x9d13('0x1a');var _0x42d5a5=_0x47bcd3[_0x9d13('0x1c')];var _0x10aa89=_0x3acfc1?0x0:_0x38f368[_0x9d13('0x19')];var _0x2acb0b=_0x3acfc1?_0x47bcd3[_0x9d13('0x1c')]:_0x38f368[_0x9d13('0x19')]+_0x38f368[_0x9d13('0x1b')];var _0x4d6b9d;if(_0x2acb0b>=_0x42d5a5){_0x2acb0b=_0x42d5a5;_0x4d6b9d=0xc8;}else{_0x4d6b9d=0xce;}_0x1a2b65[_0x9d13('0x17')](_0x4d6b9d);return _0x1a2b65[_0x9d13('0x1d')](_0x9d13('0x1e'),_0x10aa89+'-'+_0x2acb0b+'/'+_0x42d5a5)[_0x9d13('0x18')](_0x47bcd3);}return null;};}function patchUpdates(_0x4e1425){return function(_0x48ce3d){try{jsonpatch['apply'](_0x48ce3d,_0x4e1425,!![]);}catch(_0x223ea5){return BPromise[_0x9d13('0x1f')](_0x223ea5);}return _0x48ce3d[_0x9d13('0x20')]();};}function saveUpdates(_0x1fefe4,_0x3971e0){return function(_0x3040e7){if(_0x3040e7){return _0x3040e7[_0x9d13('0x21')](_0x1fefe4)[_0x9d13('0x22')](function(_0x5d14c8){return _0x5d14c8;});}return null;};}function removeEntity(_0xb34817,_0xd5a981){return function(_0x22963f){if(_0x22963f){return _0x22963f[_0x9d13('0x23')]()['then'](function(){_0xb34817[_0x9d13('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40c673,_0xfaf587){return function(_0xe0c57){if(!_0xe0c57){_0x40c673[_0x9d13('0x16')](0x194);}return _0xe0c57;};}function handleError(_0x453536,_0x45a299){_0x45a299=_0x45a299||0x1f4;return function(_0x1c36e5){logger[_0x9d13('0x24')](_0x1c36e5['stack']);if(_0x1c36e5[_0x9d13('0x25')]){delete _0x1c36e5['name'];}_0x453536[_0x9d13('0x17')](_0x45a299)[_0x9d13('0x26')](_0x1c36e5);};}exports[_0x9d13('0x27')]=function(_0x1d9f56,_0x5ebfaf){var _0x23c91f={'raw':!![],'where':{'id':_0x1d9f56[_0x9d13('0x28')]['id']}},_0x441118={};_0x441118[_0x9d13('0x29')]=_[_0x9d13('0x2a')](db[_0x9d13('0x2b')][_0x9d13('0x2c')]);_0x441118['query']=_[_0x9d13('0x2a')](_0x1d9f56['query']);_0x441118[_0x9d13('0x2d')]=_[_0x9d13('0x2e')](_0x441118['model'],_0x441118[_0x9d13('0x2f')]);_0x23c91f[_0x9d13('0x30')]=_['intersection'](_0x441118['model'],qs['fields'](_0x1d9f56[_0x9d13('0x2f')]['fields']));_0x23c91f[_0x9d13('0x30')]=_0x23c91f[_0x9d13('0x30')][_0x9d13('0x31')]?_0x23c91f['attributes']:_0x441118[_0x9d13('0x29')];if(_0x1d9f56[_0x9d13('0x2f')][_0x9d13('0x32')]){_0x23c91f[_0x9d13('0x33')]=[{'all':!![]}];}_0x23c91f=_['merge']({},_0x23c91f,_0x1d9f56['options']);return db[_0x9d13('0x2b')][_0x9d13('0x34')](_0x23c91f)['then'](handleEntityNotFound(_0x5ebfaf,null))[_0x9d13('0x22')](respondWithResult(_0x5ebfaf,null))[_0x9d13('0x35')](handleError(_0x5ebfaf,null));};exports[_0x9d13('0x21')]=function(_0x96da64,_0x7f7a0f){if(_0x96da64[_0x9d13('0x36')]['id']){delete _0x96da64[_0x9d13('0x36')]['id'];}return db['ChatApplication'][_0x9d13('0x34')]({'where':{'id':_0x96da64['params']['id']}})['then'](handleEntityNotFound(_0x7f7a0f,null))['then'](saveUpdates(_0x96da64[_0x9d13('0x36')],null))[_0x9d13('0x22')](respondWithResult(_0x7f7a0f,null))[_0x9d13('0x35')](handleError(_0x7f7a0f,null));};exports[_0x9d13('0x23')]=function(_0x3467eb,_0x4b32d8){return db[_0x9d13('0x2b')][_0x9d13('0x34')]({'where':{'id':_0x3467eb[_0x9d13('0x28')]['id']}})[_0x9d13('0x22')](handleEntityNotFound(_0x4b32d8,null))[_0x9d13('0x22')](removeEntity(_0x4b32d8,null))[_0x9d13('0x35')](handleError(_0x4b32d8,null));};
\ No newline at end of file
+var _0x05b0=['includeAll','merge','catch','find','params','body','destroy','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','save','update','then','end','error','stack','name','send','show','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length'];(function(_0xc84cac,_0x188911){var _0x2ed0fe=function(_0x1d3aea){while(--_0x1d3aea){_0xc84cac['push'](_0xc84cac['shift']());}};_0x2ed0fe(++_0x188911);}(_0x05b0,0x188));var _0x005b=function(_0x2b494e,_0x419bf4){_0x2b494e=_0x2b494e-0x0;var _0x523f0a=_0x05b0[_0x2b494e];return _0x523f0a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x005b('0x0'));var jsonpatch=require(_0x005b('0x1'));var rp=require('request-promise');var moment=require(_0x005b('0x2'));var BPromise=require(_0x005b('0x3'));var Mustache=require('mustache');var util=require(_0x005b('0x4'));var path=require(_0x005b('0x5'));var sox=require('sox');var csv=require(_0x005b('0x6'));var ejs=require(_0x005b('0x7'));var fs=require('fs');var fs_extra=require(_0x005b('0x8'));var _=require(_0x005b('0x9'));var squel=require(_0x005b('0xa'));var crypto=require(_0x005b('0xb'));var jsforce=require(_0x005b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x005b('0x6'));var querystring=require(_0x005b('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x005b('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x005b('0xf'))(_0x005b('0x10'));var utils=require('../../config/utils');var config=require(_0x005b('0x11'));var licenseUtil=require(_0x005b('0x12'));var db=require(_0x005b('0x13'))['db'];function respondWithStatusCode(_0x10f9bb,_0xce7212){_0xce7212=_0xce7212||0xcc;return function(_0xe2674e){if(_0xe2674e){return _0x10f9bb[_0x005b('0x14')](_0xce7212);}return _0x10f9bb['status'](_0xce7212)['end']();};}function respondWithResult(_0x52ad9c,_0x309c8f){_0x309c8f=_0x309c8f||0xc8;return function(_0x50b7ce){if(_0x50b7ce){return _0x52ad9c[_0x005b('0x15')](_0x309c8f)['json'](_0x50b7ce);}};}function respondWithFilteredResult(_0x1c8eed,_0x1f7743){return function(_0x2ce01e){if(_0x2ce01e){var _0x1991e8=typeof _0x1f7743[_0x005b('0x16')]==='undefined'&&typeof _0x1f7743[_0x005b('0x17')]===_0x005b('0x18');var _0xf3cf84=_0x2ce01e['count'];var _0x206c0a=_0x1991e8?0x0:_0x1f7743[_0x005b('0x16')];var _0x50a6eb=_0x1991e8?_0x2ce01e[_0x005b('0x19')]:_0x1f7743[_0x005b('0x16')]+_0x1f7743[_0x005b('0x17')];var _0x434874;if(_0x50a6eb>=_0xf3cf84){_0x50a6eb=_0xf3cf84;_0x434874=0xc8;}else{_0x434874=0xce;}_0x1c8eed[_0x005b('0x15')](_0x434874);return _0x1c8eed['set'](_0x005b('0x1a'),_0x206c0a+'-'+_0x50a6eb+'/'+_0xf3cf84)[_0x005b('0x1b')](_0x2ce01e);}return null;};}function patchUpdates(_0x4ae164){return function(_0x24637d){try{jsonpatch[_0x005b('0x1c')](_0x24637d,_0x4ae164,!![]);}catch(_0xd97375){return BPromise['reject'](_0xd97375);}return _0x24637d[_0x005b('0x1d')]();};}function saveUpdates(_0x145c36,_0x319981){return function(_0x3521c9){if(_0x3521c9){return _0x3521c9[_0x005b('0x1e')](_0x145c36)[_0x005b('0x1f')](function(_0x4f632f){return _0x4f632f;});}return null;};}function removeEntity(_0x322229,_0x169428){return function(_0x1fef26){if(_0x1fef26){return _0x1fef26['destroy']()[_0x005b('0x1f')](function(){_0x322229['status'](0xcc)[_0x005b('0x20')]();});}};}function handleEntityNotFound(_0x527294,_0x542fa2){return function(_0x2dc341){if(!_0x2dc341){_0x527294[_0x005b('0x14')](0x194);}return _0x2dc341;};}function handleError(_0x3effd5,_0x267f10){_0x267f10=_0x267f10||0x1f4;return function(_0x6730d4){logger[_0x005b('0x21')](_0x6730d4[_0x005b('0x22')]);if(_0x6730d4[_0x005b('0x23')]){delete _0x6730d4['name'];}_0x3effd5[_0x005b('0x15')](_0x267f10)[_0x005b('0x24')](_0x6730d4);};}exports[_0x005b('0x25')]=function(_0x13e834,_0x2e92d1){var _0x1d8f93={'raw':!![],'where':{'id':_0x13e834['params']['id']}},_0x4775a2={};_0x4775a2[_0x005b('0x26')]=_[_0x005b('0x27')](db[_0x005b('0x28')][_0x005b('0x29')]);_0x4775a2['query']=_['keys'](_0x13e834[_0x005b('0x2a')]);_0x4775a2[_0x005b('0x2b')]=_['intersection'](_0x4775a2['model'],_0x4775a2[_0x005b('0x2a')]);_0x1d8f93['attributes']=_[_0x005b('0x2c')](_0x4775a2[_0x005b('0x26')],qs[_0x005b('0x2d')](_0x13e834['query']['fields']));_0x1d8f93[_0x005b('0x2e')]=_0x1d8f93[_0x005b('0x2e')][_0x005b('0x2f')]?_0x1d8f93['attributes']:_0x4775a2['model'];if(_0x13e834[_0x005b('0x2a')][_0x005b('0x30')]){_0x1d8f93['include']=[{'all':!![]}];}_0x1d8f93=_[_0x005b('0x31')]({},_0x1d8f93,_0x13e834['options']);return db[_0x005b('0x28')]['find'](_0x1d8f93)['then'](handleEntityNotFound(_0x2e92d1,null))[_0x005b('0x1f')](respondWithResult(_0x2e92d1,null))[_0x005b('0x32')](handleError(_0x2e92d1,null));};exports[_0x005b('0x1e')]=function(_0xe5b24e,_0x430d10){if(_0xe5b24e['body']['id']){delete _0xe5b24e['body']['id'];}return db[_0x005b('0x28')][_0x005b('0x33')]({'where':{'id':_0xe5b24e[_0x005b('0x34')]['id']}})[_0x005b('0x1f')](handleEntityNotFound(_0x430d10,null))[_0x005b('0x1f')](saveUpdates(_0xe5b24e[_0x005b('0x35')],null))['then'](respondWithResult(_0x430d10,null))[_0x005b('0x32')](handleError(_0x430d10,null));};exports[_0x005b('0x36')]=function(_0x2c2ced,_0x58923d){return db[_0x005b('0x28')][_0x005b('0x33')]({'where':{'id':_0x2c2ced[_0x005b('0x34')]['id']}})[_0x005b('0x1f')](handleEntityNotFound(_0x58923d,null))[_0x005b('0x1f')](removeEntity(_0x58923d,null))[_0x005b('0x32')](handleError(_0x58923d,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 3e62332..6d86dde 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 _0x8cec=['../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x1cd577,_0x180f2a){var _0x790837=function(_0x2cace5){while(--_0x2cace5){_0x1cd577['push'](_0x1cd577['shift']());}};_0x790837(++_0x180f2a);}(_0x8cec,0x104));var _0xc8ce=function(_0x44249e,_0x5a0e0c){_0x44249e=_0x44249e-0x0;var _0x333e30=_0x8cec[_0x44249e];return _0x333e30;};'use strict';var _=require(_0xc8ce('0x0'));var util=require('util');var logger=require(_0xc8ce('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc8ce('0x2'));var rp=require(_0xc8ce('0x3'));var fs=require('fs');var path=require(_0xc8ce('0x4'));var rimraf=require(_0xc8ce('0x5'));var config=require(_0xc8ce('0x6'));var attributes=require(_0xc8ce('0x7'));module[_0xc8ce('0x8')]=function(_0x8f677c,_0x4662bb){return _0x8f677c[_0xc8ce('0x9')](_0xc8ce('0xa'),attributes,{'tableName':_0xc8ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc8ce('0xc'),'collate':_0xc8ce('0xd')});};
\ No newline at end of file
+var _0x963a=['bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x158bec,_0x39eb7e){var _0x33575a=function(_0x20abb5){while(--_0x20abb5){_0x158bec['push'](_0x158bec['shift']());}};_0x33575a(++_0x39eb7e);}(_0x963a,0xbe));var _0xa963=function(_0xb12056,_0x389b06){_0xb12056=_0xb12056-0x0;var _0x5bc09a=_0x963a[_0xb12056];return _0x5bc09a;};'use strict';var _=require(_0xa963('0x0'));var util=require(_0xa963('0x1'));var logger=require(_0xa963('0x2'))(_0xa963('0x3'));var moment=require(_0xa963('0x4'));var BPromise=require(_0xa963('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa963('0x6'));var rimraf=require(_0xa963('0x7'));var config=require(_0xa963('0x8'));var attributes=require(_0xa963('0x9'));module['exports']=function(_0x34110d,_0x4c9765){return _0x34110d[_0xa963('0xa')](_0xa963('0xb'),attributes,{'tableName':_0xa963('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa963('0xd'),'collate':_0xa963('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index c045186..bc99977 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 _0xbbe0=['info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x730dc0,_0x2ce9cc){var _0x96a727=function(_0x42bc3b){while(--_0x42bc3b){_0x730dc0['push'](_0x730dc0['shift']());}};_0x96a727(++_0x2ce9cc);}(_0xbbe0,0xc3));var _0x0bbe=function(_0x2dde57,_0x54ef96){_0x2dde57=_0x2dde57-0x0;var _0x2c74f2=_0xbbe0[_0x2dde57];return _0x2c74f2;};'use strict';var _=require(_0x0bbe('0x0'));var util=require('util');var moment=require(_0x0bbe('0x1'));var BPromise=require(_0x0bbe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bbe('0x3'));var db=require(_0x0bbe('0x4'))['db'];var utils=require(_0x0bbe('0x5'));var logger=require(_0x0bbe('0x6'))(_0x0bbe('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bbe('0x8')][_0x0bbe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c48fb,_0x495008,_0x20ea37){return new BPromise(function(_0x4e344b,_0x13e967){return client[_0x0bbe('0xa')](_0x1c48fb,_0x20ea37)[_0x0bbe('0xb')](function(_0x42b625){logger[_0x0bbe('0xc')](_0x0bbe('0xd'),_0x495008,_0x0bbe('0xe'));logger[_0x0bbe('0xf')](_0x0bbe('0x10'),_0x495008,_0x0bbe('0xe'),JSON[_0x0bbe('0x11')](_0x42b625));if(_0x42b625[_0x0bbe('0x12')]){if(_0x42b625[_0x0bbe('0x12')][_0x0bbe('0x13')]===0x1f4){logger['error'](_0x0bbe('0xd'),_0x495008,_0x42b625[_0x0bbe('0x12')]['message']);return _0x13e967(_0x42b625[_0x0bbe('0x12')][_0x0bbe('0x14')]);}logger[_0x0bbe('0x12')](_0x0bbe('0xd'),_0x495008,_0x42b625['error']['message']);return _0x4e344b(_0x42b625[_0x0bbe('0x12')][_0x0bbe('0x14')]);}else{logger['info'](_0x0bbe('0xd'),_0x495008,_0x0bbe('0xe'));_0x4e344b(_0x42b625[_0x0bbe('0x15')][_0x0bbe('0x14')]);}})[_0x0bbe('0x16')](function(_0x38c835){logger[_0x0bbe('0x12')]('ChatApplication,\x20%s,\x20%s',_0x495008,_0x38c835);_0x13e967(_0x38c835);});});}
\ No newline at end of file
+var _0xe877=['request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0xe877,0x1e7));var _0x7e87=function(_0x1bb51d,_0x1c2d9c){_0x1bb51d=_0x1bb51d-0x0;var _0x386643=_0xe877[_0x1bb51d];return _0x386643;};'use strict';var _=require(_0x7e87('0x0'));var util=require(_0x7e87('0x1'));var moment=require(_0x7e87('0x2'));var BPromise=require(_0x7e87('0x3'));var rs=require(_0x7e87('0x4'));var fs=require('fs');var Redis=require(_0x7e87('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e87('0x6'));var logger=require(_0x7e87('0x7'))(_0x7e87('0x8'));var config=require(_0x7e87('0x9'));var jayson=require(_0x7e87('0xa'));var client=jayson[_0x7e87('0xb')][_0x7e87('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x359486,_0x266518,_0x5e4354){return new BPromise(function(_0x45da89,_0x21b672){return client[_0x7e87('0xd')](_0x359486,_0x5e4354)[_0x7e87('0xe')](function(_0x451c25){logger[_0x7e87('0xf')](_0x7e87('0x10'),_0x266518,'request\x20sent');logger[_0x7e87('0x11')](_0x7e87('0x12'),_0x266518,'request\x20sent',JSON[_0x7e87('0x13')](_0x451c25));if(_0x451c25[_0x7e87('0x14')]){if(_0x451c25['error'][_0x7e87('0x15')]===0x1f4){logger[_0x7e87('0x14')](_0x7e87('0x10'),_0x266518,_0x451c25[_0x7e87('0x14')][_0x7e87('0x16')]);return _0x21b672(_0x451c25[_0x7e87('0x14')][_0x7e87('0x16')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x266518,_0x451c25[_0x7e87('0x14')][_0x7e87('0x16')]);return _0x45da89(_0x451c25[_0x7e87('0x14')][_0x7e87('0x16')]);}else{logger[_0x7e87('0xf')](_0x7e87('0x10'),_0x266518,_0x7e87('0x17'));_0x45da89(_0x451c25['result'][_0x7e87('0x16')]);}})[_0x7e87('0x18')](function(_0x1c46b4){logger[_0x7e87('0x14')](_0x7e87('0x10'),_0x266518,_0x1c46b4);_0x21b672(_0x1c46b4);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 4029d8b..42b4adc 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 _0xd2ab=['./chatApplication.controller','/:id','show','put','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0xd2ab,0x78));var _0xbd2a=function(_0x308a44,_0x479628){_0x308a44=_0x308a44-0x0;var _0x567c52=_0xd2ab[_0x308a44];return _0x567c52;};'use strict';var multer=require(_0xbd2a('0x0'));var util=require(_0xbd2a('0x1'));var path=require(_0xbd2a('0x2'));var timeout=require(_0xbd2a('0x3'));var express=require(_0xbd2a('0x4'));var router=express[_0xbd2a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbd2a('0x6'));var interaction=require(_0xbd2a('0x7'));var config=require('../../config/environment');var controller=require(_0xbd2a('0x8'));router['get'](_0xbd2a('0x9'),auth['isAuthenticated'](),controller[_0xbd2a('0xa')]);router[_0xbd2a('0xb')](_0xbd2a('0x9'),auth[_0xbd2a('0xc')](),controller[_0xbd2a('0xd')]);router['delete'](_0xbd2a('0x9'),auth[_0xbd2a('0xc')](),controller[_0xbd2a('0xe')]);module[_0xbd2a('0xf')]=router;
\ No newline at end of file
+var _0xaa21=['./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xaa21,0xe6));var _0x1aa2=function(_0x3c368b,_0x2746e6){_0x3c368b=_0x3c368b-0x0;var _0x3b610a=_0xaa21[_0x3c368b];return _0x3b610a;};'use strict';var multer=require(_0x1aa2('0x0'));var util=require(_0x1aa2('0x1'));var path=require('path');var timeout=require(_0x1aa2('0x2'));var express=require(_0x1aa2('0x3'));var router=express[_0x1aa2('0x4')]();var fs_extra=require(_0x1aa2('0x5'));var auth=require(_0x1aa2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1aa2('0x7'));var controller=require(_0x1aa2('0x8'));router[_0x1aa2('0x9')]('/:id',auth[_0x1aa2('0xa')](),controller[_0x1aa2('0xb')]);router[_0x1aa2('0xc')](_0x1aa2('0xd'),auth[_0x1aa2('0xa')](),controller[_0x1aa2('0xe')]);router['delete'](_0x1aa2('0xd'),auth[_0x1aa2('0xa')](),controller[_0x1aa2('0xf')]);module[_0x1aa2('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 84aa386..06bd8aa 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 _0x02b6=['STRING','BOOLEAN','sequelize'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x02b6,0xfe));var _0x602b=function(_0x4475b3,_0xf90028){_0x4475b3=_0x4475b3-0x0;var _0x1f06c7=_0x02b6[_0x4475b3];return _0x1f06c7;};'use strict';var Sequelize=require(_0x602b('0x0'));module['exports']={'name':{'type':Sequelize[_0x602b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x602b('0x1')]},'write':{'type':Sequelize[_0x602b('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x13c5=['sequelize'];(function(_0x242b57,_0x4c78da){var _0x42ee35=function(_0x4d7593){while(--_0x4d7593){_0x242b57['push'](_0x242b57['shift']());}};_0x42ee35(++_0x4c78da);}(_0x13c5,0x7a));var _0x513c=function(_0x30bfc6,_0x493833){_0x30bfc6=_0x30bfc6-0x0;var _0x2ac420=_0x13c5[_0x30bfc6];return _0x2ac420;};'use strict';var Sequelize=require(_0x513c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 88fbf0d..71a008d 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 _0x12dd=['include','findAll','rows','catch','show','rawAttributes','find','create','update','body','params','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','User','pick','getMembers','length','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','error','send','index','map','fieldName','type','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','merge','name','options','ChatGroup','includeAll'];(function(_0x231146,_0x561e18){var _0x562350=function(_0x21d5ed){while(--_0x21d5ed){_0x231146['push'](_0x231146['shift']());}};_0x562350(++_0x561e18);}(_0x12dd,0x14b));var _0xd12d=function(_0x446414,_0x166ce3){_0x446414=_0x446414-0x0;var _0x3bbeac=_0x12dd[_0x446414];return _0x3bbeac;};'use strict';var emlformat=require(_0xd12d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd12d('0x1'));var jsonpatch=require(_0xd12d('0x2'));var rp=require(_0xd12d('0x3'));var moment=require(_0xd12d('0x4'));var BPromise=require(_0xd12d('0x5'));var Mustache=require(_0xd12d('0x6'));var util=require('util');var path=require(_0xd12d('0x7'));var sox=require(_0xd12d('0x8'));var csv=require('to-csv');var ejs=require(_0xd12d('0x9'));var fs=require('fs');var fs_extra=require(_0xd12d('0xa'));var _=require(_0xd12d('0xb'));var squel=require(_0xd12d('0xc'));var crypto=require(_0xd12d('0xd'));var jsforce=require(_0xd12d('0xe'));var deskjs=require(_0xd12d('0xf'));var toCsv=require(_0xd12d('0x10'));var querystring=require('querystring');var Papa=require(_0xd12d('0x11'));var Redis=require(_0xd12d('0x12'));var authService=require(_0xd12d('0x13'));var qs=require(_0xd12d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd12d('0x15'));var logger=require(_0xd12d('0x16'))(_0xd12d('0x17'));var utils=require(_0xd12d('0x18'));var config=require(_0xd12d('0x19'));var licenseUtil=require(_0xd12d('0x1a'));var db=require(_0xd12d('0x1b'))['db'];config[_0xd12d('0x1c')]=_['defaults'](config[_0xd12d('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xd12d('0x1d'))(new Redis(config[_0xd12d('0x1c')]));require(_0xd12d('0x1e'))[_0xd12d('0x1f')](socket);function respondWithStatusCode(_0x20cd55,_0x52b175){_0x52b175=_0x52b175||0xcc;return function(_0xc34984){if(_0xc34984){return _0x20cd55[_0xd12d('0x20')](_0x52b175);}return _0x20cd55[_0xd12d('0x21')](_0x52b175)[_0xd12d('0x22')]();};}function respondWithResult(_0x543be4,_0x535561){_0x535561=_0x535561||0xc8;return function(_0x191e05){if(_0x191e05){return _0x543be4[_0xd12d('0x21')](_0x535561)[_0xd12d('0x23')](_0x191e05);}};}function respondWithFilteredResult(_0x3ed8da,_0x2f3c0e){return function(_0x19f0f6){if(_0x19f0f6){var _0x546c37=typeof _0x2f3c0e[_0xd12d('0x24')]===_0xd12d('0x25')&&typeof _0x2f3c0e['limit']===_0xd12d('0x25');var _0x5ea3af=_0x19f0f6[_0xd12d('0x26')];var _0x301c84=_0x546c37?0x0:_0x2f3c0e[_0xd12d('0x24')];var _0x58ec9b=_0x546c37?_0x19f0f6[_0xd12d('0x26')]:_0x2f3c0e[_0xd12d('0x24')]+_0x2f3c0e[_0xd12d('0x27')];var _0xc6262;if(_0x58ec9b>=_0x5ea3af){_0x58ec9b=_0x5ea3af;_0xc6262=0xc8;}else{_0xc6262=0xce;}_0x3ed8da['status'](_0xc6262);return _0x3ed8da[_0xd12d('0x28')](_0xd12d('0x29'),_0x301c84+'-'+_0x58ec9b+'/'+_0x5ea3af)['json'](_0x19f0f6);}return null;};}function patchUpdates(_0x44aa31){return function(_0x31a39b){try{jsonpatch['apply'](_0x31a39b,_0x44aa31,!![]);}catch(_0x33d0b4){return BPromise[_0xd12d('0x2a')](_0x33d0b4);}return _0x31a39b[_0xd12d('0x2b')]();};}function saveUpdates(_0x4c70ef,_0x3ab3c3){return function(_0x289fce){if(_0x289fce){return _0x289fce['update'](_0x4c70ef)[_0xd12d('0x2c')](function(_0xd2fd2e){return _0xd2fd2e;});}return null;};}function removeEntity(_0x375358,_0x13a5df){return function(_0x132015){if(_0x132015){return _0x132015[_0xd12d('0x2d')]()['then'](function(){_0x375358[_0xd12d('0x21')](0xcc)[_0xd12d('0x22')]();});}};}function handleEntityNotFound(_0x34377d,_0x881470){return function(_0x7e9a4a){if(!_0x7e9a4a){_0x34377d['sendStatus'](0x194);}return _0x7e9a4a;};}function handleError(_0x22e811,_0x36f462){_0x36f462=_0x36f462||0x1f4;return function(_0x90cfdc){logger[_0xd12d('0x2e')](_0x90cfdc['stack']);if(_0x90cfdc['name']){delete _0x90cfdc['name'];}_0x22e811[_0xd12d('0x21')](_0x36f462)[_0xd12d('0x2f')](_0x90cfdc);};}exports[_0xd12d('0x30')]=function(_0x3a8e45,_0x33fa64){var _0x16b154={},_0x5a98cc={},_0x563add={'count':0x0,'rows':[]};var _0x2df34e=_[_0xd12d('0x31')](db['ChatGroup']['rawAttributes'],function(_0x4b5275){return{'name':_0x4b5275[_0xd12d('0x32')],'type':_0x4b5275[_0xd12d('0x33')]['key']};});_0x5a98cc[_0xd12d('0x34')]=_[_0xd12d('0x31')](_0x2df34e,'name');_0x5a98cc['query']=_[_0xd12d('0x35')](_0x3a8e45[_0xd12d('0x36')]);_0x5a98cc['filters']=_[_0xd12d('0x37')](_0x5a98cc[_0xd12d('0x34')],_0x5a98cc[_0xd12d('0x36')]);_0x16b154[_0xd12d('0x38')]=_[_0xd12d('0x37')](_0x5a98cc[_0xd12d('0x34')],qs[_0xd12d('0x39')](_0x3a8e45[_0xd12d('0x36')][_0xd12d('0x39')]));_0x16b154[_0xd12d('0x38')]=_0x16b154[_0xd12d('0x38')]['length']?_0x16b154[_0xd12d('0x38')]:_0x5a98cc[_0xd12d('0x34')];if(!_0x3a8e45[_0xd12d('0x36')]['hasOwnProperty'](_0xd12d('0x3a'))){_0x16b154[_0xd12d('0x27')]=qs[_0xd12d('0x27')](_0x3a8e45[_0xd12d('0x36')][_0xd12d('0x27')]);_0x16b154['offset']=qs[_0xd12d('0x24')](_0x3a8e45[_0xd12d('0x36')][_0xd12d('0x24')]);}_0x16b154[_0xd12d('0x3b')]=qs[_0xd12d('0x3c')](_0x3a8e45[_0xd12d('0x36')]['sort']);_0x16b154[_0xd12d('0x3d')]=qs[_0xd12d('0x3e')](_['pick'](_0x3a8e45[_0xd12d('0x36')],_0x5a98cc[_0xd12d('0x3e')]),_0x2df34e);if(_0x3a8e45[_0xd12d('0x36')][_0xd12d('0x3f')]){_0x16b154['where']=_[_0xd12d('0x40')](_0x16b154[_0xd12d('0x3d')],{'$or':_['map'](_0x2df34e,function(_0x1f1e6c){if(_0x1f1e6c[_0xd12d('0x33')]!=='VIRTUAL'){var _0x356bf7={};_0x356bf7[_0x1f1e6c[_0xd12d('0x41')]]={'$like':'%'+_0x3a8e45[_0xd12d('0x36')][_0xd12d('0x3f')]+'%'};return _0x356bf7;}})});}_0x16b154=_[_0xd12d('0x40')]({},_0x16b154,_0x3a8e45[_0xd12d('0x42')]);var _0xf4ecca={'where':_0x16b154['where']};return db[_0xd12d('0x43')][_0xd12d('0x26')](_0xf4ecca)['then'](function(_0x109e55){_0x563add[_0xd12d('0x26')]=_0x109e55;if(_0x3a8e45[_0xd12d('0x36')][_0xd12d('0x44')]){_0x16b154[_0xd12d('0x45')]=[{'all':!![]}];}return db['ChatGroup'][_0xd12d('0x46')](_0x16b154);})[_0xd12d('0x2c')](function(_0x272984){_0x563add[_0xd12d('0x47')]=_0x272984;return _0x563add;})[_0xd12d('0x2c')](respondWithFilteredResult(_0x33fa64,_0x16b154))[_0xd12d('0x48')](handleError(_0x33fa64,null));};exports[_0xd12d('0x49')]=function(_0x1b24e0,_0x2c0f0c){var _0x1cabec={'raw':!![],'where':{'id':_0x1b24e0['params']['id']}},_0x1967ad={};_0x1967ad[_0xd12d('0x34')]=_[_0xd12d('0x35')](db['ChatGroup'][_0xd12d('0x4a')]);_0x1967ad['query']=_[_0xd12d('0x35')](_0x1b24e0[_0xd12d('0x36')]);_0x1967ad[_0xd12d('0x3e')]=_['intersection'](_0x1967ad['model'],_0x1967ad[_0xd12d('0x36')]);_0x1cabec['attributes']=_['intersection'](_0x1967ad[_0xd12d('0x34')],qs['fields'](_0x1b24e0[_0xd12d('0x36')][_0xd12d('0x39')]));_0x1cabec[_0xd12d('0x38')]=_0x1cabec['attributes']['length']?_0x1cabec['attributes']:_0x1967ad[_0xd12d('0x34')];if(_0x1b24e0['query'][_0xd12d('0x44')]){_0x1cabec['include']=[{'all':!![]}];}_0x1cabec=_[_0xd12d('0x40')]({},_0x1cabec,_0x1b24e0['options']);return db[_0xd12d('0x43')][_0xd12d('0x4b')](_0x1cabec)[_0xd12d('0x2c')](handleEntityNotFound(_0x2c0f0c,null))[_0xd12d('0x2c')](respondWithResult(_0x2c0f0c,null))[_0xd12d('0x48')](handleError(_0x2c0f0c,null));};exports['create']=function(_0x2e9f86,_0x33fb0d){return db['ChatGroup'][_0xd12d('0x4c')](_0x2e9f86['body'],{})[_0xd12d('0x2c')](respondWithResult(_0x33fb0d,0xc9))[_0xd12d('0x48')](handleError(_0x33fb0d,null));};exports[_0xd12d('0x4d')]=function(_0x6246a7,_0x527ee4){if(_0x6246a7[_0xd12d('0x4e')]['id']){delete _0x6246a7['body']['id'];}return db[_0xd12d('0x43')][_0xd12d('0x4b')]({'where':{'id':_0x6246a7['params']['id']}})[_0xd12d('0x2c')](handleEntityNotFound(_0x527ee4,null))[_0xd12d('0x2c')](saveUpdates(_0x6246a7[_0xd12d('0x4e')],null))['then'](respondWithResult(_0x527ee4,null))[_0xd12d('0x48')](handleError(_0x527ee4,null));};exports[_0xd12d('0x2d')]=function(_0x2bf44e,_0x1f7de2){return db[_0xd12d('0x43')][_0xd12d('0x4b')]({'where':{'id':_0x2bf44e[_0xd12d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1f7de2,null))['then'](removeEntity(_0x1f7de2,null))[_0xd12d('0x48')](handleError(_0x1f7de2,null));};exports[_0xd12d('0x50')]=function(_0xdf029,_0x47e46d){return db[_0xd12d('0x43')]['describe']()[_0xd12d('0x2c')](respondWithResult(_0x47e46d,null))[_0xd12d('0x48')](handleError(_0x47e46d,null));};exports['getUnread']=function(_0xf1663f,_0x5cae69,_0x7aff96){return db[_0xd12d('0x51')][_0xd12d('0x26')]({'where':{'ChatGroupId':_0xf1663f[_0xd12d('0x4f')]['id'],'ToId':_0xf1663f[_0xd12d('0x52')]['id'],'read':![]}})[_0xd12d('0x2c')](function(_0x3c5baa){return{'id':_[_0xd12d('0x53')](_0xf1663f[_0xd12d('0x4f')]['id']),'count':_0x3c5baa};})[_0xd12d('0x2c')](respondWithResult(_0x5cae69,null))['catch'](handleError(_0x5cae69,null));};exports[_0xd12d('0x54')]=function(_0x34f8c4,_0x484781,_0x38d671){return db['ChatGroup'][_0xd12d('0x4b')]({'where':{'id':_0x34f8c4[_0xd12d('0x4f')]['id']}})[_0xd12d('0x2c')](handleEntityNotFound(_0x484781,null))['then'](function(_0x5c8ad4){if(_0x5c8ad4){return _0x5c8ad4[_0xd12d('0x54')](_0x34f8c4[_0xd12d('0x4e')][_0xd12d('0x55')],_[_0xd12d('0x56')](_0x34f8c4[_0xd12d('0x4e')],['ids','id'])||{});}})[_0xd12d('0x2c')](respondWithResult(_0x484781,null))['catch'](handleError(_0x484781,null));};exports['getMembers']=function(_0x122fae,_0x5b6e09,_0x3b9e8d){var _0x1d1648={};var _0xd11b81={};var _0x4cc63d;var _0x34b1e5;return db[_0xd12d('0x43')][_0xd12d('0x57')]({'where':{'id':_0x122fae['params']['id']}})[_0xd12d('0x2c')](handleEntityNotFound(_0x5b6e09,null))[_0xd12d('0x2c')](function(_0x57fed0){if(_0x57fed0){_0x4cc63d=_0x57fed0;_0xd11b81['model']=_['keys'](db[_0xd12d('0x58')][_0xd12d('0x4a')]);_0xd11b81[_0xd12d('0x36')]=_[_0xd12d('0x35')](_0x122fae[_0xd12d('0x36')]);_0xd11b81[_0xd12d('0x3e')]=_[_0xd12d('0x37')](_0xd11b81[_0xd12d('0x34')],_0xd11b81[_0xd12d('0x36')]);_0x1d1648[_0xd12d('0x38')]=_[_0xd12d('0x37')](_0xd11b81[_0xd12d('0x34')],qs[_0xd12d('0x39')](_0x122fae[_0xd12d('0x36')][_0xd12d('0x39')]));_0x1d1648[_0xd12d('0x38')]=_0x1d1648[_0xd12d('0x38')]['length']?_0x1d1648[_0xd12d('0x38')]:_0xd11b81[_0xd12d('0x34')];_0x1d1648[_0xd12d('0x3b')]=qs['sort'](_0x122fae['query'][_0xd12d('0x3c')]);_0x1d1648[_0xd12d('0x3d')]=qs[_0xd12d('0x3e')](_[_0xd12d('0x59')](_0x122fae[_0xd12d('0x36')],_0xd11b81[_0xd12d('0x3e')]));if(_0x122fae[_0xd12d('0x36')]['filter']){_0x1d1648[_0xd12d('0x3d')]=_[_0xd12d('0x40')](_0x1d1648[_0xd12d('0x3d')],{'$or':_[_0xd12d('0x31')](_0x1d1648[_0xd12d('0x38')],function(_0x792ff){var _0x124074={};_0x124074[_0x792ff]={'$like':'%'+_0x122fae[_0xd12d('0x36')][_0xd12d('0x3f')]+'%'};return _0x124074;})});}_0x1d1648=_[_0xd12d('0x40')]({},_0x1d1648,_0x122fae[_0xd12d('0x42')]);return _0x4cc63d[_0xd12d('0x5a')](_0x1d1648);}})[_0xd12d('0x2c')](function(_0x6b954e){if(_0x6b954e){_0x34b1e5=_0x6b954e[_0xd12d('0x5b')];if(!_0x122fae[_0xd12d('0x36')][_0xd12d('0x5c')](_0xd12d('0x3a'))){_0x1d1648[_0xd12d('0x27')]=qs['limit'](_0x122fae[_0xd12d('0x36')][_0xd12d('0x27')]);_0x1d1648[_0xd12d('0x24')]=qs[_0xd12d('0x24')](_0x122fae['query'][_0xd12d('0x24')]);}return _0x4cc63d[_0xd12d('0x5a')](_0x1d1648);}})[_0xd12d('0x2c')](function(_0x4a4843){if(_0x4a4843){return _0x4a4843?{'count':_0x34b1e5,'rows':_0x4a4843}:null;}})[_0xd12d('0x2c')](respondWithResult(_0x5b6e09,null))[_0xd12d('0x48')](handleError(_0x5b6e09,null));};exports['removeMembers']=function(_0x49abf4,_0x487ecc,_0x342b4d){return db[_0xd12d('0x43')][_0xd12d('0x4b')]({'where':{'id':_0x49abf4['params']['id']}})['then'](handleEntityNotFound(_0x487ecc,null))[_0xd12d('0x2c')](function(_0x1694f9){if(_0x1694f9){return _0x1694f9[_0xd12d('0x5d')](_0x49abf4[_0xd12d('0x36')][_0xd12d('0x55')]);}})[_0xd12d('0x2c')](respondWithStatusCode(_0x487ecc,null))[_0xd12d('0x48')](handleError(_0x487ecc,null));};exports[_0xd12d('0x5e')]=function(_0x34135e,_0xd4d85c,_0x25c86c){if(_0x34135e[_0xd12d('0x4e')]['id']){delete _0x34135e[_0xd12d('0x4e')]['id'];}return db[_0xd12d('0x43')][_0xd12d('0x4b')]({'where':{'id':_0x34135e['params']['id']}})[_0xd12d('0x2c')](handleEntityNotFound(_0xd4d85c,null))[_0xd12d('0x2c')](function(_0x210541){if(_0x210541){_0x34135e[_0xd12d('0x4e')][_0xd12d('0x5f')]=_0x210541['id'];return db[_0xd12d('0x51')][_0xd12d('0x4c')](_0x34135e[_0xd12d('0x4e')]);}})[_0xd12d('0x2c')](respondWithResult(_0xd4d85c,null))['catch'](handleError(_0xd4d85c,null));};exports[_0xd12d('0x60')]=function(_0x1e22b7,_0x3527b2,_0x53b7f0){var _0x5f034a={};var _0x38be77={};var _0x4f46bc;var _0x43802e;return db[_0xd12d('0x43')]['findOne']({'where':{'id':_0x1e22b7[_0xd12d('0x4f')]['id']}})[_0xd12d('0x2c')](handleEntityNotFound(_0x3527b2,null))[_0xd12d('0x2c')](function(_0x56a7b6){if(_0x56a7b6){_0x4f46bc=_0x56a7b6;_0x38be77['model']=_[_0xd12d('0x35')](db['ChatInternalMessage'][_0xd12d('0x4a')]);_0x38be77[_0xd12d('0x36')]=_[_0xd12d('0x35')](_0x1e22b7['query']);_0x38be77[_0xd12d('0x3e')]=_[_0xd12d('0x37')](_0x38be77['model'],_0x38be77['query']);_0x5f034a[_0xd12d('0x38')]=_['intersection'](_0x38be77[_0xd12d('0x34')],qs[_0xd12d('0x39')](_0x1e22b7[_0xd12d('0x36')][_0xd12d('0x39')]));_0x5f034a[_0xd12d('0x38')]=_0x5f034a[_0xd12d('0x38')][_0xd12d('0x5b')]?_0x5f034a[_0xd12d('0x38')]:_0x38be77['model'];_0x5f034a['order']=qs['sort'](_0x1e22b7[_0xd12d('0x36')][_0xd12d('0x3c')]);_0x5f034a[_0xd12d('0x3d')]=qs['filters'](_['pick'](_0x1e22b7[_0xd12d('0x36')],_0x38be77[_0xd12d('0x3e')]));if(_0x1e22b7['query']['filter']){_0x5f034a[_0xd12d('0x3d')]=_[_0xd12d('0x40')](_0x5f034a[_0xd12d('0x3d')],{'$or':_[_0xd12d('0x31')](_0x5f034a[_0xd12d('0x38')],function(_0x4600f7){var _0x4e6f7b={};_0x4e6f7b[_0x4600f7]={'$like':'%'+_0x1e22b7['query'][_0xd12d('0x3f')]+'%'};return _0x4e6f7b;})});}if(_0x1e22b7[_0xd12d('0x36')][_0xd12d('0x61')]){var _0xea625d=_0x1e22b7[_0xd12d('0x36')][_0xd12d('0x61')]['split'](',');var _0x455748={};_0x455748[_0xea625d[0x0]]={'$gte':moment(_0xea625d[0x1])[_0xd12d('0x62')](_0xd12d('0x63'))};_0x5f034a[_0xd12d('0x3d')]=_['merge'](_0x5f034a[_0xd12d('0x3d')],_0x455748);}_0x5f034a=_[_0xd12d('0x40')]({},_0x5f034a,_0x1e22b7[_0xd12d('0x42')]);return _0x4f46bc[_0xd12d('0x60')](_0x5f034a);}})['then'](function(_0x52a426){if(_0x52a426){_0x43802e=_0x52a426[_0xd12d('0x5b')];if(!_0x1e22b7[_0xd12d('0x36')][_0xd12d('0x5c')](_0xd12d('0x3a'))){_0x5f034a[_0xd12d('0x27')]=qs['limit'](_0x1e22b7[_0xd12d('0x36')]['limit']);_0x5f034a[_0xd12d('0x24')]=qs[_0xd12d('0x24')](_0x1e22b7[_0xd12d('0x36')]['offset']);}return _0x4f46bc[_0xd12d('0x60')](_0x5f034a);}})[_0xd12d('0x2c')](function(_0x3c5c28){if(_0x3c5c28){return _0x3c5c28?{'count':_0x43802e,'rows':_0x3c5c28}:null;}})[_0xd12d('0x2c')](respondWithResult(_0x3527b2,null))[_0xd12d('0x48')](handleError(_0x3527b2,null));};
\ No newline at end of file
+var _0xce1e=['getMessages','zip-dir','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','offset','undefined','count','limit','set','json','reject','save','then','destroy','sendStatus','error','stack','name','send','map','ChatGroup','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','create','body','update','find','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','User','nolimit','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','$gte','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x23a246,_0x4eb2c5){var _0x4684a9=function(_0xa064aa){while(--_0xa064aa){_0x23a246['push'](_0x23a246['shift']());}};_0x4684a9(++_0x4eb2c5);}(_0xce1e,0x1c3));var _0xece1=function(_0x2e1924,_0x391674){_0x2e1924=_0x2e1924-0x0;var _0x34cd54=_0xce1e[_0x2e1924];return _0x34cd54;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xece1('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xece1('0x1'));var BPromise=require(_0xece1('0x2'));var Mustache=require('mustache');var util=require(_0xece1('0x3'));var path=require('path');var sox=require(_0xece1('0x4'));var csv=require('to-csv');var ejs=require(_0xece1('0x5'));var fs=require('fs');var fs_extra=require(_0xece1('0x6'));var _=require(_0xece1('0x7'));var squel=require('squel');var crypto=require(_0xece1('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xece1('0x9'));var querystring=require(_0xece1('0xa'));var Papa=require(_0xece1('0xb'));var Redis=require(_0xece1('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xece1('0xd'));var as=require(_0xece1('0xe'));var hardwareService=require(_0xece1('0xf'));var logger=require(_0xece1('0x10'))('api');var utils=require(_0xece1('0x11'));var config=require(_0xece1('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xece1('0x13'))['db'];config['redis']=_[_0xece1('0x14')](config[_0xece1('0x15')],{'host':_0xece1('0x16'),'port':0x18eb});var socket=require(_0xece1('0x17'))(new Redis(config['redis']));require(_0xece1('0x18'))[_0xece1('0x19')](socket);function respondWithStatusCode(_0x4819d0,_0x369e1a){_0x369e1a=_0x369e1a||0xcc;return function(_0x1a004b){if(_0x1a004b){return _0x4819d0['sendStatus'](_0x369e1a);}return _0x4819d0[_0xece1('0x1a')](_0x369e1a)[_0xece1('0x1b')]();};}function respondWithResult(_0x4f713c,_0x18cf26){_0x18cf26=_0x18cf26||0xc8;return function(_0x34e08a){if(_0x34e08a){return _0x4f713c['status'](_0x18cf26)['json'](_0x34e08a);}};}function respondWithFilteredResult(_0x350980,_0x1c6227){return function(_0x2837f5){if(_0x2837f5){var _0x2d56e3=typeof _0x1c6227[_0xece1('0x1c')]==='undefined'&&typeof _0x1c6227['limit']===_0xece1('0x1d');var _0x213653=_0x2837f5['count'];var _0x11fc32=_0x2d56e3?0x0:_0x1c6227[_0xece1('0x1c')];var _0x58f6c6=_0x2d56e3?_0x2837f5[_0xece1('0x1e')]:_0x1c6227[_0xece1('0x1c')]+_0x1c6227[_0xece1('0x1f')];var _0x1f1cc1;if(_0x58f6c6>=_0x213653){_0x58f6c6=_0x213653;_0x1f1cc1=0xc8;}else{_0x1f1cc1=0xce;}_0x350980[_0xece1('0x1a')](_0x1f1cc1);return _0x350980[_0xece1('0x20')]('Content-Range',_0x11fc32+'-'+_0x58f6c6+'/'+_0x213653)[_0xece1('0x21')](_0x2837f5);}return null;};}function patchUpdates(_0x42258c){return function(_0x44c6ed){try{jsonpatch['apply'](_0x44c6ed,_0x42258c,!![]);}catch(_0x19e892){return BPromise[_0xece1('0x22')](_0x19e892);}return _0x44c6ed[_0xece1('0x23')]();};}function saveUpdates(_0x326ac4,_0x3d788a){return function(_0x37a6d5){if(_0x37a6d5){return _0x37a6d5['update'](_0x326ac4)[_0xece1('0x24')](function(_0x52bfbd){return _0x52bfbd;});}return null;};}function removeEntity(_0x3e6d67,_0x263283){return function(_0x5af9b5){if(_0x5af9b5){return _0x5af9b5[_0xece1('0x25')]()[_0xece1('0x24')](function(){_0x3e6d67[_0xece1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cbd63,_0x4c9e57){return function(_0x451a5d){if(!_0x451a5d){_0x3cbd63[_0xece1('0x26')](0x194);}return _0x451a5d;};}function handleError(_0x2d59a4,_0x1df1f8){_0x1df1f8=_0x1df1f8||0x1f4;return function(_0x498688){logger[_0xece1('0x27')](_0x498688[_0xece1('0x28')]);if(_0x498688[_0xece1('0x29')]){delete _0x498688[_0xece1('0x29')];}_0x2d59a4[_0xece1('0x1a')](_0x1df1f8)[_0xece1('0x2a')](_0x498688);};}exports['index']=function(_0x157928,_0x5f27ec){var _0x19b534={},_0x3636e6={},_0x260c94={'count':0x0,'rows':[]};var _0x1b03f2=_[_0xece1('0x2b')](db[_0xece1('0x2c')][_0xece1('0x2d')],function(_0x750eb2){return{'name':_0x750eb2[_0xece1('0x2e')],'type':_0x750eb2['type']['key']};});_0x3636e6[_0xece1('0x2f')]=_[_0xece1('0x2b')](_0x1b03f2,_0xece1('0x29'));_0x3636e6[_0xece1('0x30')]=_[_0xece1('0x31')](_0x157928['query']);_0x3636e6['filters']=_[_0xece1('0x32')](_0x3636e6[_0xece1('0x2f')],_0x3636e6[_0xece1('0x30')]);_0x19b534[_0xece1('0x33')]=_['intersection'](_0x3636e6[_0xece1('0x2f')],qs[_0xece1('0x34')](_0x157928[_0xece1('0x30')][_0xece1('0x34')]));_0x19b534[_0xece1('0x33')]=_0x19b534[_0xece1('0x33')][_0xece1('0x35')]?_0x19b534[_0xece1('0x33')]:_0x3636e6['model'];if(!_0x157928[_0xece1('0x30')][_0xece1('0x36')]('nolimit')){_0x19b534[_0xece1('0x1f')]=qs[_0xece1('0x1f')](_0x157928[_0xece1('0x30')][_0xece1('0x1f')]);_0x19b534[_0xece1('0x1c')]=qs[_0xece1('0x1c')](_0x157928[_0xece1('0x30')]['offset']);}_0x19b534[_0xece1('0x37')]=qs[_0xece1('0x38')](_0x157928[_0xece1('0x30')][_0xece1('0x38')]);_0x19b534[_0xece1('0x39')]=qs['filters'](_[_0xece1('0x3a')](_0x157928[_0xece1('0x30')],_0x3636e6[_0xece1('0x3b')]),_0x1b03f2);if(_0x157928[_0xece1('0x30')][_0xece1('0x3c')]){_0x19b534[_0xece1('0x39')]=_[_0xece1('0x3d')](_0x19b534['where'],{'$or':_[_0xece1('0x2b')](_0x1b03f2,function(_0x5a8c13){if(_0x5a8c13['type']!==_0xece1('0x3e')){var _0x13cb72={};_0x13cb72[_0x5a8c13[_0xece1('0x29')]]={'$like':'%'+_0x157928[_0xece1('0x30')][_0xece1('0x3c')]+'%'};return _0x13cb72;}})});}_0x19b534=_[_0xece1('0x3d')]({},_0x19b534,_0x157928[_0xece1('0x3f')]);var _0x2844c5={'where':_0x19b534['where']};return db[_0xece1('0x2c')][_0xece1('0x1e')](_0x2844c5)[_0xece1('0x24')](function(_0x20f274){_0x260c94[_0xece1('0x1e')]=_0x20f274;if(_0x157928['query'][_0xece1('0x40')]){_0x19b534['include']=[{'all':!![]}];}return db[_0xece1('0x2c')][_0xece1('0x41')](_0x19b534);})[_0xece1('0x24')](function(_0x40e1c2){_0x260c94[_0xece1('0x42')]=_0x40e1c2;return _0x260c94;})[_0xece1('0x24')](respondWithFilteredResult(_0x5f27ec,_0x19b534))[_0xece1('0x43')](handleError(_0x5f27ec,null));};exports['show']=function(_0x53fb7b,_0x5dba92){var _0x28e432={'raw':!![],'where':{'id':_0x53fb7b[_0xece1('0x44')]['id']}},_0x5b6699={};_0x5b6699['model']=_[_0xece1('0x31')](db[_0xece1('0x2c')][_0xece1('0x2d')]);_0x5b6699['query']=_[_0xece1('0x31')](_0x53fb7b['query']);_0x5b6699[_0xece1('0x3b')]=_[_0xece1('0x32')](_0x5b6699[_0xece1('0x2f')],_0x5b6699[_0xece1('0x30')]);_0x28e432[_0xece1('0x33')]=_[_0xece1('0x32')](_0x5b6699[_0xece1('0x2f')],qs[_0xece1('0x34')](_0x53fb7b[_0xece1('0x30')][_0xece1('0x34')]));_0x28e432[_0xece1('0x33')]=_0x28e432[_0xece1('0x33')][_0xece1('0x35')]?_0x28e432[_0xece1('0x33')]:_0x5b6699[_0xece1('0x2f')];if(_0x53fb7b[_0xece1('0x30')]['includeAll']){_0x28e432['include']=[{'all':!![]}];}_0x28e432=_['merge']({},_0x28e432,_0x53fb7b[_0xece1('0x3f')]);return db['ChatGroup']['find'](_0x28e432)[_0xece1('0x24')](handleEntityNotFound(_0x5dba92,null))[_0xece1('0x24')](respondWithResult(_0x5dba92,null))[_0xece1('0x43')](handleError(_0x5dba92,null));};exports[_0xece1('0x45')]=function(_0x622c6f,_0xa47ce2){return db[_0xece1('0x2c')][_0xece1('0x45')](_0x622c6f[_0xece1('0x46')],{})['then'](respondWithResult(_0xa47ce2,0xc9))[_0xece1('0x43')](handleError(_0xa47ce2,null));};exports[_0xece1('0x47')]=function(_0x1f1118,_0x521745){if(_0x1f1118[_0xece1('0x46')]['id']){delete _0x1f1118[_0xece1('0x46')]['id'];}return db['ChatGroup'][_0xece1('0x48')]({'where':{'id':_0x1f1118[_0xece1('0x44')]['id']}})['then'](handleEntityNotFound(_0x521745,null))[_0xece1('0x24')](saveUpdates(_0x1f1118['body'],null))[_0xece1('0x24')](respondWithResult(_0x521745,null))['catch'](handleError(_0x521745,null));};exports['destroy']=function(_0x3bfdad,_0xdc467b){return db[_0xece1('0x2c')][_0xece1('0x48')]({'where':{'id':_0x3bfdad[_0xece1('0x44')]['id']}})[_0xece1('0x24')](handleEntityNotFound(_0xdc467b,null))[_0xece1('0x24')](removeEntity(_0xdc467b,null))[_0xece1('0x43')](handleError(_0xdc467b,null));};exports[_0xece1('0x49')]=function(_0x22aa89,_0x40a523){return db[_0xece1('0x2c')][_0xece1('0x49')]()[_0xece1('0x24')](respondWithResult(_0x40a523,null))['catch'](handleError(_0x40a523,null));};exports[_0xece1('0x4a')]=function(_0x22b0f0,_0x41d16b,_0x23d22e){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x22b0f0[_0xece1('0x44')]['id'],'ToId':_0x22b0f0[_0xece1('0x4b')]['id'],'read':![]}})[_0xece1('0x24')](function(_0x558910){return{'id':_[_0xece1('0x4c')](_0x22b0f0[_0xece1('0x44')]['id']),'count':_0x558910};})[_0xece1('0x24')](respondWithResult(_0x41d16b,null))[_0xece1('0x43')](handleError(_0x41d16b,null));};exports[_0xece1('0x4d')]=function(_0xecda99,_0x5cfee4,_0x293311){return db[_0xece1('0x2c')]['find']({'where':{'id':_0xecda99[_0xece1('0x44')]['id']}})[_0xece1('0x24')](handleEntityNotFound(_0x5cfee4,null))['then'](function(_0x513cb6){if(_0x513cb6){return _0x513cb6[_0xece1('0x4d')](_0xecda99[_0xece1('0x46')][_0xece1('0x4e')],_[_0xece1('0x4f')](_0xecda99[_0xece1('0x46')],[_0xece1('0x4e'),'id'])||{});}})[_0xece1('0x24')](respondWithResult(_0x5cfee4,null))[_0xece1('0x43')](handleError(_0x5cfee4,null));};exports[_0xece1('0x50')]=function(_0x5d843a,_0x15425c,_0x5daca1){var _0x50f272={};var _0x5d0406={};var _0x5bbdf1;var _0x3897d3;return db[_0xece1('0x2c')]['findOne']({'where':{'id':_0x5d843a[_0xece1('0x44')]['id']}})['then'](handleEntityNotFound(_0x15425c,null))['then'](function(_0x34da65){if(_0x34da65){_0x5bbdf1=_0x34da65;_0x5d0406['model']=_[_0xece1('0x31')](db[_0xece1('0x51')][_0xece1('0x2d')]);_0x5d0406['query']=_[_0xece1('0x31')](_0x5d843a['query']);_0x5d0406['filters']=_[_0xece1('0x32')](_0x5d0406['model'],_0x5d0406[_0xece1('0x30')]);_0x50f272[_0xece1('0x33')]=_['intersection'](_0x5d0406[_0xece1('0x2f')],qs[_0xece1('0x34')](_0x5d843a[_0xece1('0x30')]['fields']));_0x50f272['attributes']=_0x50f272[_0xece1('0x33')][_0xece1('0x35')]?_0x50f272[_0xece1('0x33')]:_0x5d0406[_0xece1('0x2f')];_0x50f272['order']=qs['sort'](_0x5d843a[_0xece1('0x30')][_0xece1('0x38')]);_0x50f272[_0xece1('0x39')]=qs[_0xece1('0x3b')](_['pick'](_0x5d843a[_0xece1('0x30')],_0x5d0406['filters']));if(_0x5d843a[_0xece1('0x30')][_0xece1('0x3c')]){_0x50f272[_0xece1('0x39')]=_['merge'](_0x50f272[_0xece1('0x39')],{'$or':_[_0xece1('0x2b')](_0x50f272['attributes'],function(_0x43ab16){var _0x1a4f2a={};_0x1a4f2a[_0x43ab16]={'$like':'%'+_0x5d843a[_0xece1('0x30')][_0xece1('0x3c')]+'%'};return _0x1a4f2a;})});}_0x50f272=_[_0xece1('0x3d')]({},_0x50f272,_0x5d843a[_0xece1('0x3f')]);return _0x5bbdf1[_0xece1('0x50')](_0x50f272);}})['then'](function(_0x2ffd86){if(_0x2ffd86){_0x3897d3=_0x2ffd86[_0xece1('0x35')];if(!_0x5d843a[_0xece1('0x30')][_0xece1('0x36')](_0xece1('0x52'))){_0x50f272['limit']=qs[_0xece1('0x1f')](_0x5d843a['query'][_0xece1('0x1f')]);_0x50f272[_0xece1('0x1c')]=qs[_0xece1('0x1c')](_0x5d843a[_0xece1('0x30')]['offset']);}return _0x5bbdf1[_0xece1('0x50')](_0x50f272);}})[_0xece1('0x24')](function(_0x1583c7){if(_0x1583c7){return _0x1583c7?{'count':_0x3897d3,'rows':_0x1583c7}:null;}})[_0xece1('0x24')](respondWithResult(_0x15425c,null))[_0xece1('0x43')](handleError(_0x15425c,null));};exports[_0xece1('0x53')]=function(_0x49e8ed,_0x5a9c9f,_0x5dc6ee){return db[_0xece1('0x2c')][_0xece1('0x48')]({'where':{'id':_0x49e8ed[_0xece1('0x44')]['id']}})[_0xece1('0x24')](handleEntityNotFound(_0x5a9c9f,null))[_0xece1('0x24')](function(_0x3f62f4){if(_0x3f62f4){return _0x3f62f4[_0xece1('0x53')](_0x49e8ed[_0xece1('0x30')][_0xece1('0x4e')]);}})['then'](respondWithStatusCode(_0x5a9c9f,null))[_0xece1('0x43')](handleError(_0x5a9c9f,null));};exports[_0xece1('0x54')]=function(_0x399690,_0x3e36f6,_0x519a62){if(_0x399690['body']['id']){delete _0x399690[_0xece1('0x46')]['id'];}return db[_0xece1('0x2c')][_0xece1('0x48')]({'where':{'id':_0x399690['params']['id']}})[_0xece1('0x24')](handleEntityNotFound(_0x3e36f6,null))[_0xece1('0x24')](function(_0x2720ea){if(_0x2720ea){_0x399690['body'][_0xece1('0x55')]=_0x2720ea['id'];return db[_0xece1('0x56')][_0xece1('0x45')](_0x399690[_0xece1('0x46')]);}})[_0xece1('0x24')](respondWithResult(_0x3e36f6,null))[_0xece1('0x43')](handleError(_0x3e36f6,null));};exports['getMessages']=function(_0x4494d2,_0x13af42,_0x3c85cc){var _0x5da0d3={};var _0xf9895e={};var _0x544bdd;var _0x3ad8f3;return db['ChatGroup']['findOne']({'where':{'id':_0x4494d2[_0xece1('0x44')]['id']}})[_0xece1('0x24')](handleEntityNotFound(_0x13af42,null))[_0xece1('0x24')](function(_0x32552e){if(_0x32552e){_0x544bdd=_0x32552e;_0xf9895e[_0xece1('0x2f')]=_['keys'](db[_0xece1('0x56')][_0xece1('0x2d')]);_0xf9895e[_0xece1('0x30')]=_[_0xece1('0x31')](_0x4494d2[_0xece1('0x30')]);_0xf9895e[_0xece1('0x3b')]=_[_0xece1('0x32')](_0xf9895e[_0xece1('0x2f')],_0xf9895e[_0xece1('0x30')]);_0x5da0d3[_0xece1('0x33')]=_['intersection'](_0xf9895e[_0xece1('0x2f')],qs[_0xece1('0x34')](_0x4494d2[_0xece1('0x30')][_0xece1('0x34')]));_0x5da0d3[_0xece1('0x33')]=_0x5da0d3[_0xece1('0x33')]['length']?_0x5da0d3[_0xece1('0x33')]:_0xf9895e[_0xece1('0x2f')];_0x5da0d3[_0xece1('0x37')]=qs['sort'](_0x4494d2[_0xece1('0x30')][_0xece1('0x38')]);_0x5da0d3['where']=qs[_0xece1('0x3b')](_[_0xece1('0x3a')](_0x4494d2[_0xece1('0x30')],_0xf9895e[_0xece1('0x3b')]));if(_0x4494d2[_0xece1('0x30')][_0xece1('0x3c')]){_0x5da0d3[_0xece1('0x39')]=_[_0xece1('0x3d')](_0x5da0d3[_0xece1('0x39')],{'$or':_['map'](_0x5da0d3[_0xece1('0x33')],function(_0x55e969){var _0x368fe6={};_0x368fe6[_0x55e969]={'$like':'%'+_0x4494d2[_0xece1('0x30')][_0xece1('0x3c')]+'%'};return _0x368fe6;})});}if(_0x4494d2[_0xece1('0x30')][_0xece1('0x57')]){var _0x5b31c4=_0x4494d2[_0xece1('0x30')]['$gte']['split'](',');var _0x3ec215={};_0x3ec215[_0x5b31c4[0x0]]={'$gte':moment(_0x5b31c4[0x1])['format'](_0xece1('0x58'))};_0x5da0d3[_0xece1('0x39')]=_['merge'](_0x5da0d3[_0xece1('0x39')],_0x3ec215);}_0x5da0d3=_['merge']({},_0x5da0d3,_0x4494d2['options']);return _0x544bdd['getMessages'](_0x5da0d3);}})[_0xece1('0x24')](function(_0x4383f4){if(_0x4383f4){_0x3ad8f3=_0x4383f4[_0xece1('0x35')];if(!_0x4494d2[_0xece1('0x30')][_0xece1('0x36')](_0xece1('0x52'))){_0x5da0d3[_0xece1('0x1f')]=qs['limit'](_0x4494d2['query'][_0xece1('0x1f')]);_0x5da0d3[_0xece1('0x1c')]=qs[_0xece1('0x1c')](_0x4494d2[_0xece1('0x30')][_0xece1('0x1c')]);}return _0x544bdd[_0xece1('0x59')](_0x5da0d3);}})['then'](function(_0x321c3c){if(_0x321c3c){return _0x321c3c?{'count':_0x3ad8f3,'rows':_0x321c3c}:null;}})[_0xece1('0x24')](respondWithResult(_0x13af42,null))[_0xece1('0x43')](handleError(_0x13af42,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 7802af4..c78352d 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 _0x7e74=['events','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x5930ba,_0x325f6f){var _0x4899a9=function(_0x125131){while(--_0x125131){_0x5930ba['push'](_0x5930ba['shift']());}};_0x4899a9(++_0x325f6f);}(_0x7e74,0xbd));var _0x47e7=function(_0x5a74d2,_0x23fe51){_0x5a74d2=_0x5a74d2-0x0;var _0x17d102=_0x7e74[_0x5a74d2];return _0x17d102;};'use strict';var EventEmitter=require(_0x47e7('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x47e7('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x47e7('0x2')](0x0);var events={'afterCreate':_0x47e7('0x3'),'afterUpdate':_0x47e7('0x4'),'afterDestroy':_0x47e7('0x5')};function emitEvent(_0x548d8b){return function(_0x2f084c,_0x75f99d,_0xb4dd0){ChatGroupEvents[_0x47e7('0x6')](_0x548d8b+':'+_0x2f084c['id'],_0x2f084c);ChatGroupEvents[_0x47e7('0x6')](_0x548d8b,_0x2f084c);_0xb4dd0(null);};}for(var e in events){if(events[_0x47e7('0x7')](e)){var event=events[e];ChatGroup[_0x47e7('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x6440=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x3cafb8,_0x32860e){var _0x4b7f85=function(_0x31b11d){while(--_0x31b11d){_0x3cafb8['push'](_0x3cafb8['shift']());}};_0x4b7f85(++_0x32860e);}(_0x6440,0x1de));var _0x0644=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0x6440[_0x1d6a82];return _0x5834ac;};'use strict';var EventEmitter=require(_0x0644('0x0'));var ChatGroup=require(_0x0644('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0644('0x2')](0x0);var events={'afterCreate':_0x0644('0x3'),'afterUpdate':_0x0644('0x4'),'afterDestroy':'remove'};function emitEvent(_0x46b094){return function(_0x40db45,_0x15eb72,_0x3fba73){ChatGroupEvents[_0x0644('0x5')](_0x46b094+':'+_0x40db45['id'],_0x40db45);ChatGroupEvents[_0x0644('0x5')](_0x46b094,_0x40db45);_0x3fba73(null);};}for(var e in events){if(events[_0x0644('0x6')](e)){var event=events[e];ChatGroup[_0x0644('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index bf3ed81..ce153af 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 _0x4637=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x6d76e8,_0x3a5b96){var _0x10a933=function(_0xcca43b){while(--_0xcca43b){_0x6d76e8['push'](_0x6d76e8['shift']());}};_0x10a933(++_0x3a5b96);}(_0x4637,0x114));var _0x7463=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x4637[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x7463('0x0'));var util=require('util');var logger=require(_0x7463('0x1'))('api');var moment=require(_0x7463('0x2'));var BPromise=require(_0x7463('0x3'));var rp=require(_0x7463('0x4'));var fs=require('fs');var path=require(_0x7463('0x5'));var rimraf=require(_0x7463('0x6'));var config=require(_0x7463('0x7'));var attributes=require(_0x7463('0x8'));module[_0x7463('0x9')]=function(_0x3d5a76,_0x4ec237){return _0x3d5a76[_0x7463('0xa')](_0x7463('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xde73=['../../config/environment','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0xa30026,_0x3136b6){var _0x2bb310=function(_0x8a3b65){while(--_0x8a3b65){_0xa30026['push'](_0xa30026['shift']());}};_0x2bb310(++_0x3136b6);}(_0xde73,0x185));var _0x3de7=function(_0x4e6b0b,_0x3f1de2){_0x4e6b0b=_0x4e6b0b-0x0;var _0x2c9f2f=_0xde73[_0x4e6b0b];return _0x2c9f2f;};'use strict';var _=require(_0x3de7('0x0'));var util=require(_0x3de7('0x1'));var logger=require(_0x3de7('0x2'))('api');var moment=require(_0x3de7('0x3'));var BPromise=require('bluebird');var rp=require(_0x3de7('0x4'));var fs=require('fs');var path=require(_0x3de7('0x5'));var rimraf=require(_0x3de7('0x6'));var config=require(_0x3de7('0x7'));var attributes=require('./chatGroup.attributes');module[_0x3de7('0x8')]=function(_0x572696,_0x271b02){return _0x572696[_0x3de7('0x9')](_0x3de7('0xa'),attributes,{'tableName':_0x3de7('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 456a2bc..ba6c33c 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 _0x536e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatGroup.socket','register','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x536e,0x155));var _0xe536=function(_0x5b7696,_0x3ebd92){_0x5b7696=_0x5b7696-0x0;var _0x42d7b9=_0x536e[_0x5b7696];return _0x42d7b9;};'use strict';var _=require(_0xe536('0x0'));var util=require(_0xe536('0x1'));var moment=require(_0xe536('0x2'));var BPromise=require(_0xe536('0x3'));var rs=require(_0xe536('0x4'));var fs=require('fs');var Redis=require(_0xe536('0x5'));var db=require(_0xe536('0x6'))['db'];var utils=require(_0xe536('0x7'));var logger=require(_0xe536('0x8'))(_0xe536('0x9'));var config=require(_0xe536('0xa'));var jayson=require(_0xe536('0xb'));var client=jayson[_0xe536('0xc')][_0xe536('0xd')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe536('0xe')],{'host':_0xe536('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe536('0xe')]));require(_0xe536('0x10'))[_0xe536('0x11')](socket);function respondWithRpcPromise(_0x1d9dcd,_0x2581df,_0x1df409){return new BPromise(function(_0xe08ef0,_0x507dad){return client['request'](_0x1d9dcd,_0x1df409)[_0xe536('0x12')](function(_0xbec6ca){logger['info'](_0xe536('0x13'),_0x2581df,_0xe536('0x14'));logger[_0xe536('0x15')](_0xe536('0x16'),_0x2581df,_0xe536('0x14'),JSON[_0xe536('0x17')](_0xbec6ca));if(_0xbec6ca['error']){if(_0xbec6ca[_0xe536('0x18')][_0xe536('0x19')]===0x1f4){logger[_0xe536('0x18')](_0xe536('0x13'),_0x2581df,_0xbec6ca[_0xe536('0x18')]['message']);return _0x507dad(_0xbec6ca[_0xe536('0x18')][_0xe536('0x1a')]);}logger[_0xe536('0x18')]('ChatGroup,\x20%s,\x20%s',_0x2581df,_0xbec6ca[_0xe536('0x18')][_0xe536('0x1a')]);return _0xe08ef0(_0xbec6ca[_0xe536('0x18')][_0xe536('0x1a')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x2581df,_0xe536('0x14'));_0xe08ef0(_0xbec6ca[_0xe536('0x1b')][_0xe536('0x1a')]);}})[_0xe536('0x1c')](function(_0x4f6eb2){logger['error'](_0xe536('0x13'),_0x2581df,_0x4f6eb2);_0x507dad(_0x4f6eb2);});});}
\ No newline at end of file
+var _0x35e2=['ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info'];(function(_0x4282a7,_0x351556){var _0x5b7916=function(_0x216bac){while(--_0x216bac){_0x4282a7['push'](_0x4282a7['shift']());}};_0x5b7916(++_0x351556);}(_0x35e2,0x1ed));var _0x235e=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x35e2[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x235e('0x0'));var util=require('util');var moment=require(_0x235e('0x1'));var BPromise=require(_0x235e('0x2'));var rs=require(_0x235e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x235e('0x4'))['db'];var utils=require(_0x235e('0x5'));var logger=require(_0x235e('0x6'))(_0x235e('0x7'));var config=require(_0x235e('0x8'));var jayson=require(_0x235e('0x9'));var client=jayson[_0x235e('0xa')][_0x235e('0xb')]({'port':0x232a});config[_0x235e('0xc')]=_[_0x235e('0xd')](config[_0x235e('0xc')],{'host':_0x235e('0xe'),'port':0x18eb});var socket=require(_0x235e('0xf'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x235e('0x10')](socket);function respondWithRpcPromise(_0x41f1c8,_0x4a3ec7,_0x40dc4d){return new BPromise(function(_0x22a10d,_0x247da6){return client[_0x235e('0x11')](_0x41f1c8,_0x40dc4d)[_0x235e('0x12')](function(_0x1a85f6){logger[_0x235e('0x13')](_0x235e('0x14'),_0x4a3ec7,_0x235e('0x15'));logger[_0x235e('0x16')](_0x235e('0x17'),_0x4a3ec7,_0x235e('0x15'),JSON[_0x235e('0x18')](_0x1a85f6));if(_0x1a85f6[_0x235e('0x19')]){if(_0x1a85f6['error']['code']===0x1f4){logger[_0x235e('0x19')](_0x235e('0x14'),_0x4a3ec7,_0x1a85f6[_0x235e('0x19')][_0x235e('0x1a')]);return _0x247da6(_0x1a85f6[_0x235e('0x19')][_0x235e('0x1a')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x4a3ec7,_0x1a85f6[_0x235e('0x19')][_0x235e('0x1a')]);return _0x22a10d(_0x1a85f6[_0x235e('0x19')][_0x235e('0x1a')]);}else{logger[_0x235e('0x13')](_0x235e('0x14'),_0x4a3ec7,_0x235e('0x15'));_0x22a10d(_0x1a85f6['result'][_0x235e('0x1a')]);}})['catch'](function(_0x3b4ce9){logger[_0x235e('0x19')](_0x235e('0x14'),_0x4a3ec7,_0x3b4ce9);_0x247da6(_0x3b4ce9);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 538d146..e256bb3 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 _0x57a9=['update','removeListener','register','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x5ace25,_0x536239){var _0x4ba17a=function(_0x1ee54e){while(--_0x1ee54e){_0x5ace25['push'](_0x5ace25['shift']());}};_0x4ba17a(++_0x536239);}(_0x57a9,0x1d5));var _0x957a=function(_0x4e8659,_0x8d6bc6){_0x4e8659=_0x4e8659-0x0;var _0x44d415=_0x57a9[_0x4e8659];return _0x44d415;};'use strict';var ChatGroupEvents=require(_0x957a('0x0'));var events=[_0x957a('0x1'),_0x957a('0x2'),_0x957a('0x3')];function createListener(_0x6d6b35,_0x4ac365){return function(_0x533099){_0x4ac365['emit'](_0x6d6b35,_0x533099);};}function removeListener(_0xc92e85,_0x46b7a7){return function(){ChatGroupEvents[_0x957a('0x4')](_0xc92e85,_0x46b7a7);};}exports[_0x957a('0x5')]=function(_0x34e441){for(var _0x491a34=0x0,_0x9766f=events[_0x957a('0x6')];_0x491a34<_0x9766f;_0x491a34++){var _0x281f42=events[_0x491a34];var _0x55d88f=createListener(_0x957a('0x7')+_0x281f42,_0x34e441);ChatGroupEvents['on'](_0x281f42,_0x55d88f);}};
\ No newline at end of file
+var _0x3098=['length','chatGroup:','./chatGroup.events','update','emit','removeListener'];(function(_0xf4cdcd,_0x159fdb){var _0x1ab584=function(_0x161fae){while(--_0x161fae){_0xf4cdcd['push'](_0xf4cdcd['shift']());}};_0x1ab584(++_0x159fdb);}(_0x3098,0xd4));var _0x8309=function(_0x5bd4f6,_0xf4e45c){_0x5bd4f6=_0x5bd4f6-0x0;var _0x33a165=_0x3098[_0x5bd4f6];return _0x33a165;};'use strict';var ChatGroupEvents=require(_0x8309('0x0'));var events=['save','remove',_0x8309('0x1')];function createListener(_0x50364d,_0x43f999){return function(_0x4a05dc){_0x43f999[_0x8309('0x2')](_0x50364d,_0x4a05dc);};}function removeListener(_0x5646b7,_0x3dd970){return function(){ChatGroupEvents[_0x8309('0x3')](_0x5646b7,_0x3dd970);};}exports['register']=function(_0x9b911b){for(var _0x5ecd62=0x0,_0x409a82=events[_0x8309('0x4')];_0x5ecd62<_0x409a82;_0x5ecd62++){var _0x27dfe0=events[_0x5ecd62];var _0x472b7e=createListener(_0x8309('0x5')+_0x27dfe0,_0x9b911b);ChatGroupEvents['on'](_0x27dfe0,_0x472b7e);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 8af2921..2852c86 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 _0x4059=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','put'];(function(_0x43da28,_0x223efe){var _0x2c26a5=function(_0x4724b7){while(--_0x4724b7){_0x43da28['push'](_0x43da28['shift']());}};_0x2c26a5(++_0x223efe);}(_0x4059,0x1be));var _0x9405=function(_0x4a8ab9,_0x5615d3){_0x4a8ab9=_0x4a8ab9-0x0;var _0x22ce40=_0x4059[_0x4a8ab9];return _0x22ce40;};'use strict';var multer=require(_0x9405('0x0'));var util=require(_0x9405('0x1'));var path=require(_0x9405('0x2'));var timeout=require(_0x9405('0x3'));var express=require(_0x9405('0x4'));var router=express['Router']();var fs_extra=require(_0x9405('0x5'));var auth=require(_0x9405('0x6'));var interaction=require(_0x9405('0x7'));var config=require(_0x9405('0x8'));var controller=require('./chatGroup.controller');router[_0x9405('0x9')]('/',auth[_0x9405('0xa')](),controller[_0x9405('0xb')]);router[_0x9405('0x9')](_0x9405('0xc'),auth[_0x9405('0xa')](),controller['describe']);router[_0x9405('0x9')](_0x9405('0xd'),auth[_0x9405('0xa')](),controller[_0x9405('0xe')]);router[_0x9405('0x9')](_0x9405('0xf'),auth[_0x9405('0xa')](),controller[_0x9405('0x10')]);router[_0x9405('0x9')](_0x9405('0x11'),auth[_0x9405('0xa')](),controller[_0x9405('0x12')]);router[_0x9405('0x9')](_0x9405('0x13'),auth[_0x9405('0xa')](),controller['getMessages']);router[_0x9405('0x14')]('/',auth[_0x9405('0xa')](),controller['create']);router['post'](_0x9405('0x11'),auth['isAuthenticated'](),controller['addMembers']);router[_0x9405('0x14')]('/:id/messages',auth[_0x9405('0xa')](),controller['addMessage']);router[_0x9405('0x15')](_0x9405('0xd'),auth[_0x9405('0xa')](),controller[_0x9405('0x16')]);router[_0x9405('0x17')]('/:id',auth[_0x9405('0xa')](),controller[_0x9405('0x18')]);router[_0x9405('0x17')](_0x9405('0x11'),auth[_0x9405('0xa')](),controller['removeMembers']);module[_0x9405('0x19')]=router;
\ No newline at end of file
+var _0x667e=['get','isAuthenticated','index','/describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','put','update','delete','removeMembers','exports','multer','connect-timeout','express','Router','fs-extra','./chatGroup.controller'];(function(_0x1db117,_0x40b195){var _0xd31170=function(_0x396a9a){while(--_0x396a9a){_0x1db117['push'](_0x1db117['shift']());}};_0xd31170(++_0x40b195);}(_0x667e,0x90));var _0xe667=function(_0x4fb992,_0x3a43f2){_0x4fb992=_0x4fb992-0x0;var _0x4271a5=_0x667e[_0x4fb992];return _0x4271a5;};'use strict';var multer=require(_0xe667('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe667('0x1'));var express=require(_0xe667('0x2'));var router=express[_0xe667('0x3')]();var fs_extra=require(_0xe667('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe667('0x5'));router[_0xe667('0x6')]('/',auth[_0xe667('0x7')](),controller[_0xe667('0x8')]);router[_0xe667('0x6')](_0xe667('0x9'),auth[_0xe667('0x7')](),controller['describe']);router[_0xe667('0x6')](_0xe667('0xa'),auth[_0xe667('0x7')](),controller['show']);router['get'](_0xe667('0xb'),auth['isAuthenticated'](),controller[_0xe667('0xc')]);router[_0xe667('0x6')](_0xe667('0xd'),auth[_0xe667('0x7')](),controller[_0xe667('0xe')]);router[_0xe667('0x6')](_0xe667('0xf'),auth[_0xe667('0x7')](),controller[_0xe667('0x10')]);router['post']('/',auth[_0xe667('0x7')](),controller[_0xe667('0x11')]);router[_0xe667('0x12')](_0xe667('0xd'),auth[_0xe667('0x7')](),controller[_0xe667('0x13')]);router[_0xe667('0x12')](_0xe667('0xf'),auth[_0xe667('0x7')](),controller['addMessage']);router[_0xe667('0x14')]('/:id',auth[_0xe667('0x7')](),controller[_0xe667('0x15')]);router['delete'](_0xe667('0xa'),auth[_0xe667('0x7')](),controller['destroy']);router[_0xe667('0x16')](_0xe667('0xd'),auth['isAuthenticated'](),controller[_0xe667('0x17')]);module[_0xe667('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 854c3d8..2f5587a 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 _0x2805=['DATE','long','out','INTEGER','exports','BOOLEAN','star','thumb','TEXT','STRING'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x2805,0x13a));var _0x5280=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x2805[_0x20589d];return _0x422de9;};'use strict';var Sequelize=require('sequelize');module[_0x5280('0x0')]={'closed':{'type':Sequelize[_0x5280('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x5280('0x2'),_0x5280('0x3')),'defaultValue':_0x5280('0x2')},'ratingMessage':{'type':Sequelize[_0x5280('0x4')]},'pathTranscript':{'type':Sequelize[_0x5280('0x4')]},'mailTranscript':{'type':Sequelize[_0x5280('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x5280('0x6')]},'disposition':{'type':Sequelize[_0x5280('0x5')]},'secondDisposition':{'type':Sequelize[_0x5280('0x5')]},'thirdDisposition':{'type':Sequelize[_0x5280('0x5')]},'note':{'type':Sequelize[_0x5280('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x5280('0x5')]},'osName':{'type':Sequelize[_0x5280('0x5')]},'osVersion':{'type':Sequelize[_0x5280('0x5')]},'deviceModel':{'type':Sequelize[_0x5280('0x5')]},'deviceVendor':{'type':Sequelize[_0x5280('0x5')]},'deviceType':{'type':Sequelize[_0x5280('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x5280('0x5')]},'formData':{'type':Sequelize[_0x5280('0x4')](_0x5280('0x7'))},'read1stAt':{'type':Sequelize[_0x5280('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5280('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x5280('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x5280('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x5280('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x5280('0x9')]}};
\ No newline at end of file
+var _0x1276=['thumb','TEXT','DATE','STRING','long','ENUM','out','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x5c0374,_0x3f578c){var _0x514224=function(_0x905ec){while(--_0x905ec){_0x5c0374['push'](_0x5c0374['shift']());}};_0x514224(++_0x3f578c);}(_0x1276,0x131));var _0x6127=function(_0x2c12fa,_0x536777){_0x2c12fa=_0x2c12fa-0x0;var _0x78d795=_0x1276[_0x2c12fa];return _0x78d795;};'use strict';var Sequelize=require(_0x6127('0x0'));module[_0x6127('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6127('0x2')]},'ratingType':{'type':Sequelize['ENUM']('star',_0x6127('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x6127('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6127('0x5')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x6127('0x6')]},'thirdDisposition':{'type':Sequelize[_0x6127('0x6')]},'note':{'type':Sequelize[_0x6127('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x6127('0x6')]},'osVersion':{'type':Sequelize[_0x6127('0x6')]},'deviceModel':{'type':Sequelize[_0x6127('0x6')]},'deviceVendor':{'type':Sequelize[_0x6127('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x6127('0x4')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x6127('0x4')](_0x6127('0x7'))},'read1stAt':{'type':Sequelize[_0x6127('0x5')]},'lastMsgAt':{'type':Sequelize[_0x6127('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x6127('0x8')]('in',_0x6127('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6127('0x6')]},'customerPort':{'type':Sequelize[_0x6127('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x6127('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x6127('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x6127('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 226ea18..bffbf25 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 _0x03fa=['../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','update','destroy','stack','name','send','render','body','agent','interaction','account','index','map','ChatInteraction','fieldName','type','key','findAll','chat','query','user','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','isNull','parse','metadata','Sequelize','ValidationError','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','now','pathTranscript','User','ChatWebsite','ContactId','Messages','format','%s%d','agentAlias','System','agentIdentifier','website_alias','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','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','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','rows','getMyMessages','includeAgent','addTags','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','lastName','read','Owner','get','mkdirSync','Chat','Account','toString','closedAt','browserName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','value','renderFile','transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','ejs','ioredis','../../components/interaction/service','../../config/logger','api'];(function(_0x302c75,_0x3701e7){var _0x473a4d=function(_0x117dbb){while(--_0x117dbb){_0x302c75['push'](_0x302c75['shift']());}};_0x473a4d(++_0x3701e7);}(_0x03fa,0x199));var _0xa03f=function(_0x346097,_0xf7c47b){_0x346097=_0x346097-0x0;var _0x52065e=_0x03fa[_0x346097];return _0x52065e;};'use strict';var rimraf=require(_0xa03f('0x0'));var zipdir=require(_0xa03f('0x1'));var rp=require('request-promise');var moment=require(_0xa03f('0x2'));var BPromise=require(_0xa03f('0x3'));var Mustache=require(_0xa03f('0x4'));var util=require(_0xa03f('0x5'));var path=require('path');var ejs=require(_0xa03f('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xa03f('0x7'));var interaction=require(_0xa03f('0x8'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0xa03f('0x9'))(_0xa03f('0xa'));var config=require('../../config/environment');var db=require(_0xa03f('0xb'))['db'];config['redis']=_[_0xa03f('0xc')](config['redis'],{'host':_0xa03f('0xd'),'port':0x18eb});var socket=require(_0xa03f('0xe'))(new Redis(config[_0xa03f('0xf')]));require(_0xa03f('0x10'))[_0xa03f('0x11')](socket);var jayson=require(_0xa03f('0x12'));var client=jayson[_0xa03f('0x13')][_0xa03f('0x14')]({'port':0x232b});var client9004=jayson[_0xa03f('0x13')][_0xa03f('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x1c7d2e,_0x31878b,_0x4fb1c2,_0x4ef29a){return new BPromise(function(_0x5ca89e,_0x4cf73f){var _0x365403=_0x4ef29a||client;return _0x365403[_0xa03f('0x15')](_0x1c7d2e,_0x4fb1c2)[_0xa03f('0x16')](function(_0x53785a){logger[_0xa03f('0x17')](_0xa03f('0x18'),_0x31878b,_0xa03f('0x19'));logger['debug'](_0xa03f('0x1a'),_0x31878b,_0xa03f('0x19'),JSON[_0xa03f('0x1b')](_0x53785a));if(_0x53785a[_0xa03f('0x1c')]){if(_0x53785a['error']['code']===0x1f4){logger[_0xa03f('0x1c')](_0xa03f('0x18'),_0x31878b,_0x53785a[_0xa03f('0x1c')][_0xa03f('0x1d')]);return _0x4cf73f(_0x53785a['error'][_0xa03f('0x1d')]);}logger[_0xa03f('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x31878b,_0x53785a[_0xa03f('0x1c')][_0xa03f('0x1d')]);return _0x5ca89e(_0x53785a['error'][_0xa03f('0x1d')]);}else{logger[_0xa03f('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x31878b,_0xa03f('0x19'));_0x5ca89e(_0x53785a[_0xa03f('0x1e')][_0xa03f('0x1d')]);}})[_0xa03f('0x1f')](function(_0x43ac65){logger[_0xa03f('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x31878b,_0x43ac65);_0x4cf73f(_0x43ac65);});});}function respondWithStatusCode(_0xbbd263,_0x2b03f6){_0x2b03f6=_0x2b03f6||0xcc;return function(_0x22472c){if(_0x22472c){return _0xbbd263[_0xa03f('0x20')](_0x2b03f6);}return _0xbbd263['status'](_0x2b03f6)[_0xa03f('0x21')]();};}function respondWithResult(_0x5b0313,_0x3ee6eb){_0x3ee6eb=_0x3ee6eb||0xc8;return function(_0x4c9287){if(_0x4c9287){return _0x5b0313[_0xa03f('0x22')](_0x3ee6eb)[_0xa03f('0x23')](_0x4c9287);}};}function respondWithFilteredResult(_0x4e4d44,_0x6ed85e){return function(_0x36c817){if(_0x36c817){var _0xc158cf=typeof _0x6ed85e['offset']===_0xa03f('0x24')&&typeof _0x6ed85e['limit']===_0xa03f('0x24');var _0x589c5a=_0x36c817[_0xa03f('0x25')];var _0x84769c=_0xc158cf?0x0:_0x6ed85e[_0xa03f('0x26')];var _0x25a272=_0xc158cf?_0x36c817[_0xa03f('0x25')]:_0x6ed85e[_0xa03f('0x26')]+_0x6ed85e[_0xa03f('0x27')];var _0xa114b1;if(_0x25a272>=_0x589c5a){_0x25a272=_0x589c5a;_0xa114b1=0xc8;}else{_0xa114b1=0xce;}_0x4e4d44[_0xa03f('0x22')](_0xa114b1);return _0x4e4d44[_0xa03f('0x28')](_0xa03f('0x29'),_0x84769c+'-'+_0x25a272+'/'+_0x589c5a)[_0xa03f('0x23')](_0x36c817);}return null;};}function saveUpdates(_0x2ac4ec){return function(_0xe502ac){if(_0xe502ac){return _0xe502ac[_0xa03f('0x2a')](_0x2ac4ec)[_0xa03f('0x16')](function(_0x5f3207){return _0x5f3207;});}return null;};}function removeEntity(_0x11298d){return function(_0x6a57cd){if(_0x6a57cd){return _0x6a57cd[_0xa03f('0x2b')]()[_0xa03f('0x16')](function(){_0x11298d[_0xa03f('0x22')](0xcc)[_0xa03f('0x21')]();});}};}function handleEntityNotFound(_0x4f7fce){return function(_0x36eff6){if(!_0x36eff6){_0x4f7fce[_0xa03f('0x20')](0x194);}return _0x36eff6;};}function handleError(_0x22d5b3,_0x1c1b5e){_0x1c1b5e=_0x1c1b5e||0x1f4;return function(_0x10336d){logger[_0xa03f('0x1c')](_0x10336d[_0xa03f('0x2c')]);if(_0x10336d[_0xa03f('0x2d')]){delete _0x10336d[_0xa03f('0x2d')];}_0x22d5b3['status'](_0x1c1b5e)[_0xa03f('0x2e')](_0x10336d);};}function getMustacheRender(_0x1da92c,_0x53214a){return Mustache[_0xa03f('0x2f')](_0x1da92c,_['merge'](_0x53214a[_0xa03f('0x30')],{'contact':_0x53214a['contact'],'message':_0x53214a[_0xa03f('0x1d')],'agent':_0x53214a[_0xa03f('0x31')],'interaction':_0x53214a[_0xa03f('0x32')],'account':_0x53214a[_0xa03f('0x33')]}))||'';}exports[_0xa03f('0x34')]=function(_0xdb9cff,_0x22b56f){var _0x2083a3={};var _0x30a050=_[_0xa03f('0x35')](db[_0xa03f('0x36')]['rawAttributes'],function(_0x25114b){return{'name':_0x25114b[_0xa03f('0x37')],'type':_0x25114b[_0xa03f('0x38')][_0xa03f('0x39')]};});_0x2083a3=qs['getOptions'](_0x30a050,_0xdb9cff);return interaction[_0xa03f('0x3a')](_0xa03f('0x3b'),_0xdb9cff[_0xa03f('0x3c')],_0xdb9cff[_0xa03f('0x3d')],_0x2083a3,_0x30a050)[_0xa03f('0x16')](respondWithFilteredResult(_0x22b56f,_0x2083a3))['catch'](handleError(_0x22b56f,null));};exports[_0xa03f('0x3e')]=function(_0x552ba0,_0x297fca){var _0x12740a={'raw':![],'where':{'id':_0x552ba0[_0xa03f('0x3f')]['id']}},_0x10f354={};_0x10f354[_0xa03f('0x40')]=_[_0xa03f('0x41')](db[_0xa03f('0x36')][_0xa03f('0x42')]);_0x10f354[_0xa03f('0x3c')]=_['keys'](_0x552ba0['query']);_0x10f354[_0xa03f('0x43')]=_[_0xa03f('0x44')](_0x10f354[_0xa03f('0x40')],_0x10f354[_0xa03f('0x3c')]);_0x12740a[_0xa03f('0x45')]=_[_0xa03f('0x44')](_0x10f354[_0xa03f('0x40')],qs[_0xa03f('0x46')](_0x552ba0['query'][_0xa03f('0x46')]));_0x12740a[_0xa03f('0x45')]=_0x12740a['attributes'][_0xa03f('0x47')]?_0x12740a['attributes']:_0x10f354['model'];if(_0x552ba0[_0xa03f('0x3c')][_0xa03f('0x48')]){_0x12740a['include']=[{'all':!![]}];}_0x12740a=_[_0xa03f('0x49')]({},_0x12740a,_0x552ba0[_0xa03f('0x4a')]);return db[_0xa03f('0x36')][_0xa03f('0x4b')](_0x12740a)[_0xa03f('0x16')](handleEntityNotFound(_0x297fca,null))[_0xa03f('0x16')](respondWithResult(_0x297fca,null))[_0xa03f('0x1f')](handleError(_0x297fca,null));};exports[_0xa03f('0x4c')]=function(_0x51cf58,_0x1e1961){return db['ChatInteraction'][_0xa03f('0x4c')](_0x51cf58[_0xa03f('0x30')],{})[_0xa03f('0x16')](respondWithResult(_0x1e1961,0xc9))[_0xa03f('0x1f')](handleError(_0x1e1961,null));};exports['update']=function(_0x583449,_0x1211cc){if(_0x583449['body']['id']){delete _0x583449[_0xa03f('0x30')]['id'];}return db[_0xa03f('0x36')][_0xa03f('0x4b')]({'where':{'id':_0x583449[_0xa03f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1211cc,null))[_0xa03f('0x16')](saveUpdates(_0x583449[_0xa03f('0x30')],null))[_0xa03f('0x16')](respondWithResult(_0x1211cc,null))[_0xa03f('0x1f')](handleError(_0x1211cc,null));};exports['destroy']=function(_0x31145f,_0x8e4b13){return db[_0xa03f('0x36')]['find']({'where':{'id':_0x31145f[_0xa03f('0x3f')]['id']}})[_0xa03f('0x16')](handleEntityNotFound(_0x8e4b13,null))['then'](removeEntity(_0x8e4b13,null))[_0xa03f('0x1f')](handleError(_0x8e4b13,null));};exports[_0xa03f('0x4d')]=function(_0xfb610,_0x4272c2){return db[_0xa03f('0x36')][_0xa03f('0x4d')]()['then'](respondWithResult(_0x4272c2,null))['catch'](handleError(_0x4272c2,null));};exports[_0xa03f('0x4e')]=function(_0x3bec9e,_0x4ec390){var _0x173df4=_0x3bec9e[_0xa03f('0x3f')]['id'];var _0x3f8a2a;var _0x1b35b6;var _0xcd3ff1;return db['ChatInteraction'][_0xa03f('0x4f')]({'where':{'id':_0x173df4}})[_0xa03f('0x16')](function(_0x3bd8f6){_0x3f8a2a=_0x3bd8f6;return db['ChatWebsite'][_0xa03f('0x4f')]({'where':{'id':_0x3bd8f6[_0xa03f('0x50')]},'attributes':['id','vidaooApiKey',_0xa03f('0x51'),_0xa03f('0x52'),_0xa03f('0x53'),_0xa03f('0x54')],'raw':!![]});})[_0xa03f('0x16')](function(_0x37c6f4){if(_0x37c6f4&&_0x37c6f4['vidaooApiKey']&&_0x37c6f4[_0xa03f('0x51')]){_0x1b35b6=_0x37c6f4;var _0x5dd430={'interaction':{'id':_0x173df4},'agent':{'id':_0x3bec9e[_0xa03f('0x3d')]['id'],'name':_0x3bec9e[_0xa03f('0x3d')][_0xa03f('0x2d')],'fullname':_0x3bec9e[_0xa03f('0x3d')]['fullname'],'email':_0x3bec9e[_0xa03f('0x3d')][_0xa03f('0x55')]},'contact':_0x3bec9e[_0xa03f('0x30')][_0xa03f('0x56')],'account':_0x3bec9e[_0xa03f('0x30')]['account']};var _0x547d1f={'rejectUnauthorized':![],'method':_0xa03f('0x57'),'url':_0xa03f('0x58'),'headers':{'X-APIKEY':_0x37c6f4[_0xa03f('0x59')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3bec9e['user'][_0xa03f('0x55')]],'buttons':null,'topic':_0x1b35b6['vidaooTopic'],'note':_[_0xa03f('0x5a')](_0x1b35b6[_0xa03f('0x53')])?null:getMustacheRender(_0x1b35b6['vidaooNote'],_0x5dd430),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xa03f('0x5a')](_0x1b35b6[_0xa03f('0x54')])){var _0x230a94=getMustacheRender(_0x1b35b6['vidaooMetadata'],_0x5dd430);var _0x30e95c=JSON[_0xa03f('0x5b')](_0x230a94);_0x547d1f[_0xa03f('0x30')][_0xa03f('0x5c')]=_0x30e95c;}}catch(_0x426ef7){throw new db[(_0xa03f('0x5d'))][(_0xa03f('0x5e'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x547d1f);}else{throw new db[(_0xa03f('0x5d'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x17967b){_0xcd3ff1=_0x17967b;if(_0xcd3ff1['id']){var _0x35986e={'body':_0xcd3ff1[_0xa03f('0x5f')],'ChatWebsiteId':_0x1b35b6['id'],'ChatInteractionId':_0x3f8a2a['id'],'direction':_0xa03f('0x60'),'UserId':_0x3bec9e['user']['id']};return db[_0xa03f('0x61')][_0xa03f('0x4c')](_0x35986e,{});}else{throw new db[(_0xa03f('0x5d'))][(_0xa03f('0x5e'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x3f8a2a[_0xa03f('0x62')]({'vidaooSessionId':_0xcd3ff1['id']});})[_0xa03f('0x16')](respondWithResult(_0x4ec390,null))['catch'](handleError(_0x4ec390,null));};exports[_0xa03f('0x63')]=function(_0x16ce62,_0x25a831){if(_0x16ce62[_0xa03f('0x30')]['id']){delete _0x16ce62['body']['id'];}return db[_0xa03f('0x36')]['find']({'where':{'id':_0x16ce62['params']['id']},'include':[{'model':db[_0xa03f('0x64')],'as':_0xa03f('0x65')}]})[_0xa03f('0x16')](handleEntityNotFound(_0x25a831,null))[_0xa03f('0x16')](saveUpdates(_0x16ce62['body'],null))[_0xa03f('0x16')](respondWithResult(_0x25a831,null))[_0xa03f('0x1f')](handleError(_0x25a831,null));};exports[_0xa03f('0x66')]=function(_0x2e234c,_0x588b0a){if(_0x2e234c[_0xa03f('0x30')]['id']){delete _0x2e234c[_0xa03f('0x30')]['id'];}return db[_0xa03f('0x36')]['find']({'where':{'id':_0x2e234c[_0xa03f('0x3f')]['id']}})[_0xa03f('0x16')](function(_0x2b3cc5){if(!_0x2b3cc5){logger[_0xa03f('0x1c')](_0xa03f('0x67'),'abandon',0x194,'entity\x20not\x20found');_0x588b0a[_0xa03f('0x20')](0x194);}else{if(_0x2b3cc5[_0xa03f('0x68')]){throw new db[(_0xa03f('0x5d'))][(_0xa03f('0x5e'))](_0xa03f('0x69'));}}return _0x2b3cc5;})[_0xa03f('0x16')](function(_0x189044){if(_0x189044){return _0x189044[_0xa03f('0x2a')]({'closed':_0x2e234c[_0xa03f('0x30')][_0xa03f('0x6a')],'disposition':_0x2e234c['body'][_0xa03f('0x6b')]})[_0xa03f('0x16')](function(_0x2159b8){return _0x2159b8;});}})[_0xa03f('0x16')](function(){return respondWithRpcPromise('AbandonInteraction',_0xa03f('0x66'),_0x2e234c[_0xa03f('0x30')],client9004);})[_0xa03f('0x16')](respondWithResult(_0x588b0a,null))['catch'](handleError(_0x588b0a,null));};exports[_0xa03f('0x6c')]=function(_0x49e6fc,_0x35d137){_0x49e6fc[_0xa03f('0x30')][_0xa03f('0x2d')]=_0x49e6fc[_0xa03f('0x6d')]['originalname'];_0x49e6fc['body'][_0xa03f('0x6e')]=_0x49e6fc[_0xa03f('0x6d')][_0xa03f('0x6f')];_0x49e6fc[_0xa03f('0x30')]['type']=_0x49e6fc['file'][_0xa03f('0x70')];return db[_0xa03f('0x71')][_0xa03f('0x4c')](_0x49e6fc[_0xa03f('0x30')])[_0xa03f('0x16')](respondWithResult(_0x35d137,0xc9))[_0xa03f('0x1f')](handleError(_0x35d137,null));};exports[_0xa03f('0x72')]=function(_0x2007aa,_0x47e512){return db[_0xa03f('0x36')][_0xa03f('0x4f')]({'where':{'id':_0x2007aa[_0xa03f('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x47e512,null))['then'](function(_0x4708a4){if(_0x4708a4){if(_0x4708a4['closed']){return _0x47e512['status'](0x193)[_0xa03f('0x23')]({'status':0x193,'message':_0xa03f('0x73')});}return db['Attachment'][_0xa03f('0x4f')]({'where':{'id':_0x2007aa[_0xa03f('0x3c')]['attachId']},'raw':!![]})[_0xa03f('0x16')](handleEntityNotFound(_0x47e512,null));}})[_0xa03f('0x16')](function(_0x556f7a){if(_0x556f7a){var _0x1a5bf6=_0x556f7a['ChatOfflineMessageId']!==null;var _0x1b83f0=path[_0xa03f('0x74')](config[_0xa03f('0x75')],_0xa03f('0x76'));if(_0x1a5bf6){_0x1b83f0=path[_0xa03f('0x74')](_0x1b83f0,'offline-chat/');}var _0x4b783d=path[_0xa03f('0x74')](_0x1b83f0,_0x556f7a['basename']);return _0x47e512[_0xa03f('0x77')](_0x4b783d);}})[_0xa03f('0x1f')](handleError(_0x47e512,null));};exports[_0xa03f('0x78')]=function(_0x4dfb95,_0x4bed41){var _0x3afed5=null;var _0x5b22d9=null;var _0x449764=null;if(_0x4dfb95[_0xa03f('0x30')]['id']){delete _0x4dfb95[_0xa03f('0x30')]['id'];}if(_0x4dfb95[_0xa03f('0x30')][_0xa03f('0x79')]){_0x449764=path[_0xa03f('0x74')](config['root'],_0xa03f('0x7a'),util['format']('transcript-%s.txt',Date[_0xa03f('0x7b')]()));_0x4dfb95[_0xa03f('0x30')][_0xa03f('0x7c')]=_0x449764;}return db[_0xa03f('0x36')]['find']({'where':{'id':_0x4dfb95[_0xa03f('0x3f')]['id']},'include':[{'model':db[_0xa03f('0x61')],'as':'Messages','include':[{'model':db[_0xa03f('0x7d')],'as':_0xa03f('0x7d')}]}]})[_0xa03f('0x16')](handleEntityNotFound(_0x4bed41,null))[_0xa03f('0x16')](saveUpdates(_0x4dfb95['body'],null))[_0xa03f('0x16')](function(_0x2c1d4f){if(_0x2c1d4f){_0x3afed5=_0x2c1d4f;return db[_0xa03f('0x7e')][_0xa03f('0x4b')]({'where':{'id':_0x3afed5[_0xa03f('0x50')]}});}})[_0xa03f('0x16')](function(_0x217aae){if(_0x217aae){_0x5b22d9=_0x217aae;return db['CmContact'][_0xa03f('0x4b')]({'where':{'id':_0x3afed5[_0xa03f('0x7f')]}});}})[_0xa03f('0x16')](function(_0x166d99){if(_0x166d99){if(_0x449764){var _0x31cad5=null;for(var _0x5ee519=0x1;_0x5ee519<_0x3afed5[_0xa03f('0x80')]['length'];++_0x5ee519){_0x31cad5=_0x3afed5[_0xa03f('0x80')][_0x5ee519];var _0x4e3fa2=_0x31cad5[_0xa03f('0x68')]?util[_0xa03f('0x81')](_0xa03f('0x82'),_0x5b22d9[_0xa03f('0x83')],_0x31cad5[_0xa03f('0x68')]):_0xa03f('0x84');var _0x4ff0e9=_0x4dfb95['body']['customer']||util[_0xa03f('0x81')](_0xa03f('0x82'),'Visitor',_0x31cad5[_0xa03f('0x7f')]);switch(_0x5b22d9[_0xa03f('0x85')]){case _0xa03f('0x86'):_0x4e3fa2=_0x31cad5[_0xa03f('0x68')]?util['format'](_0xa03f('0x82'),_0x5b22d9[_0xa03f('0x83')],_0x31cad5['UserId']):'System';break;case _0xa03f('0x87'):_0x4e3fa2=_0x31cad5['UserId']?_0x31cad5[_0xa03f('0x7d')][_0xa03f('0x88')]||_0x31cad5[_0xa03f('0x7d')][_0xa03f('0x89')]:_0xa03f('0x84');break;case _0xa03f('0x8a'):_0x4e3fa2=_0x31cad5['UserId']?_0x31cad5['User'][_0xa03f('0x89')]:_0xa03f('0x84');break;default:_0x4e3fa2=_0x31cad5['UserId']?util[_0xa03f('0x81')]('%s%d',_0x5b22d9[_0xa03f('0x83')],_0x31cad5[_0xa03f('0x68')]):_0xa03f('0x84');}var _0x5b36f5=util[_0xa03f('0x81')](_0xa03f('0x8b'),moment(_0x31cad5[_0xa03f('0x8c')])[_0xa03f('0x81')](_0xa03f('0x8d')),_0x31cad5[_0xa03f('0x8e')]==='in'?_0x4ff0e9:_0x4e3fa2,_0x31cad5['body']);if(!_0x31cad5['secret']){fs['appendFileSync'](_0x449764,_0x5b36f5);}}return db[_0xa03f('0x8f')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xa03f('0x90')],'as':_0xa03f('0x91'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xa03f('0x92'),'raw':!![]}]}]});}}})[_0xa03f('0x16')](function(_0x40af97){if(!_0x40af97||!_0x40af97[_0xa03f('0x91')]||!_0x4dfb95['body'])return _0x3afed5;var _0x331816=_0x40af97[_0xa03f('0x93')]();return respondWithRpcPromise(_0xa03f('0x94'),_0xa03f('0x95'),{'account':_0x331816,'message':{'from':util[_0xa03f('0x81')](_0xa03f('0x96'),_0x40af97['name'],_0x40af97[_0xa03f('0x55')]||_0x40af97[_0xa03f('0x91')][_0xa03f('0x3d')]),'to':_0x4dfb95[_0xa03f('0x30')][_0xa03f('0x79')],'subject':_0xa03f('0x97'),'text':util[_0xa03f('0x81')](_0xa03f('0x98'),_0x4dfb95[_0xa03f('0x30')][_0xa03f('0x79')]),'attachments':[{'path':_0x449764}]}})[_0xa03f('0x16')](function(){return _0x3afed5;})['catch'](function(_0x2d0c46){logger[_0xa03f('0x1c')](_0x2d0c46);});})[_0xa03f('0x16')](respondWithStatusCode(_0x4bed41,0xc8))[_0xa03f('0x1f')](handleError(_0x4bed41,null));};exports[_0xa03f('0x99')]=function(_0x378bbc,_0x437572){return db['ChatMessage'][_0xa03f('0x4b')]({'where':{'id':_0x378bbc[_0xa03f('0x3f')]['id']}})[_0xa03f('0x16')](handleEntityNotFound(_0x437572,null))['then'](function(_0x160ac7){if(_0x160ac7){return _0x160ac7['addMessage'](_0x378bbc['body'][_0xa03f('0x9a')],_[_0xa03f('0x9b')](_0x378bbc['body'],[_0xa03f('0x9a'),'id'])||{});}})[_0xa03f('0x16')](respondWithResult(_0x437572,null))['catch'](handleError(_0x437572,null));};exports[_0xa03f('0x9c')]=function(_0x10bd39,_0x4b1fdb){var _0x47124a={'raw':![],'where':{}};var _0x23f603={};var _0x4c8ca1={'count':0x0,'rows':[]};return db[_0xa03f('0x36')]['findOne']({'where':{'id':_0x10bd39[_0xa03f('0x3f')]['id']}})[_0xa03f('0x16')](handleEntityNotFound(_0x4b1fdb,null))['then'](function(_0x436e3e){if(_0x436e3e){_0x23f603[_0xa03f('0x40')]=_[_0xa03f('0x41')](db[_0xa03f('0x61')][_0xa03f('0x42')]);_0x23f603[_0xa03f('0x3c')]=_['keys'](_0x10bd39[_0xa03f('0x3c')]);_0x23f603[_0xa03f('0x43')]=_[_0xa03f('0x44')](_0x23f603['model'],_0x23f603[_0xa03f('0x3c')]);_0x47124a[_0xa03f('0x45')]=_[_0xa03f('0x44')](_0x23f603[_0xa03f('0x40')],qs['fields'](_0x10bd39[_0xa03f('0x3c')][_0xa03f('0x46')]));_0x47124a[_0xa03f('0x45')]=_0x47124a[_0xa03f('0x45')][_0xa03f('0x47')]?_0x47124a[_0xa03f('0x45')]:_0x23f603['model'];if(!_0x10bd39['query'][_0xa03f('0x9d')](_0xa03f('0x9e'))){_0x47124a['limit']=qs[_0xa03f('0x27')](_0x10bd39[_0xa03f('0x3c')]['limit']);_0x47124a[_0xa03f('0x26')]=qs['offset'](_0x10bd39[_0xa03f('0x3c')][_0xa03f('0x26')]);}_0x47124a[_0xa03f('0x9f')]=qs[_0xa03f('0xa0')](_0x10bd39[_0xa03f('0x3c')][_0xa03f('0xa0')]);_0x47124a[_0xa03f('0xa1')]=qs[_0xa03f('0x43')](_[_0xa03f('0xa2')](_0x10bd39[_0xa03f('0x3c')],_0x23f603[_0xa03f('0x43')]));_0x47124a[_0xa03f('0xa1')][_0xa03f('0xa3')]=_0x436e3e['id'];if(_0x10bd39[_0xa03f('0x3c')][_0xa03f('0xa4')]){_0x47124a['where']=_[_0xa03f('0x49')](_0x47124a['where'],{'$or':_[_0xa03f('0x35')](_0x47124a[_0xa03f('0x45')],function(_0x221517){var _0x1ec65b={};_0x1ec65b[_0x221517]={'$like':'%'+_0x10bd39['query']['filter']+'%'};return _0x1ec65b;})});}if(_0x10bd39['query'][_0xa03f('0xa5')]){var _0x1cb361=_0x10bd39[_0xa03f('0x3c')][_0xa03f('0xa5')][_0xa03f('0xa6')](',');var _0xb20b91={};_0xb20b91[_0x1cb361[0x0]]={'$gte':moment(_0x1cb361[0x1])[_0xa03f('0x81')](_0xa03f('0xa7'))};_0x47124a[_0xa03f('0xa1')]=_[_0xa03f('0x49')](_0x47124a[_0xa03f('0xa1')],_0xb20b91);}_0x47124a=_[_0xa03f('0x49')]({},_0x47124a,_0x10bd39[_0xa03f('0x4a')]);return db[_0xa03f('0x61')][_0xa03f('0x25')]({'where':_0x47124a['where']})[_0xa03f('0x16')](function(_0x19913e){_0x4c8ca1['count']=_0x19913e;if(_0x10bd39['query'][_0xa03f('0x48')]){_0x47124a[_0xa03f('0xa8')]=[{'all':!![]}];}return db[_0xa03f('0x61')][_0xa03f('0x3a')](_0x47124a);})['then'](function(_0x22dc6d){_0x4c8ca1[_0xa03f('0xa9')]=_0x22dc6d;return _0x4c8ca1;});}})['then'](respondWithFilteredResult(_0x4b1fdb,_0x47124a))[_0xa03f('0x1f')](handleError(_0x4b1fdb,null));};exports[_0xa03f('0xaa')]=function(_0x37d3cb,_0x4f392a){var _0x3da1fb={'where':{}},_0x102103={},_0x53efb8={'count':0x0,'rows':[]};return db[_0xa03f('0x36')]['findOne']({'where':{'id':_0x37d3cb['params']['id']}})[_0xa03f('0x16')](handleEntityNotFound(_0x4f392a,null))['then'](function(_0x53fbac){if(_0x53fbac){_0x102103[_0xa03f('0x40')]=_[_0xa03f('0x41')](db[_0xa03f('0x61')][_0xa03f('0x42')]);_0x102103[_0xa03f('0x3c')]=_['keys'](_0x37d3cb[_0xa03f('0x3c')]);_0x102103['filters']=_[_0xa03f('0x44')](_0x102103['model'],_0x102103[_0xa03f('0x3c')]);_0x3da1fb[_0xa03f('0x45')]=_[_0xa03f('0x44')](_0x102103[_0xa03f('0x40')],qs[_0xa03f('0x46')](_0x37d3cb[_0xa03f('0x3c')][_0xa03f('0x46')]));_0x3da1fb[_0xa03f('0x45')]=_0x3da1fb[_0xa03f('0x45')]['length']?_0x3da1fb[_0xa03f('0x45')]:_0x102103[_0xa03f('0x40')];if(!_0x37d3cb[_0xa03f('0x3c')][_0xa03f('0x9d')](_0xa03f('0x9e'))){_0x3da1fb['limit']=qs[_0xa03f('0x27')](_0x37d3cb[_0xa03f('0x3c')][_0xa03f('0x27')]);_0x3da1fb[_0xa03f('0x26')]=qs[_0xa03f('0x26')](_0x37d3cb[_0xa03f('0x3c')][_0xa03f('0x26')]);}_0x3da1fb[_0xa03f('0x9f')]=qs[_0xa03f('0xa0')](_0x37d3cb[_0xa03f('0x3c')]['sort']);_0x3da1fb[_0xa03f('0xa1')]=qs[_0xa03f('0x43')](_[_0xa03f('0xa2')](_0x37d3cb[_0xa03f('0x3c')],_0x102103[_0xa03f('0x43')]));_0x3da1fb['where'][_0xa03f('0xa3')]=_0x53fbac['id'];if(_0x37d3cb[_0xa03f('0x3c')][_0xa03f('0xa4')]){_0x3da1fb[_0xa03f('0xa1')]=_[_0xa03f('0x49')](_0x3da1fb[_0xa03f('0xa1')],{'$or':_['map'](_0x3da1fb[_0xa03f('0x45')],function(_0xeaa31e){var _0x36f6af={};_0x36f6af[_0xeaa31e]={'$like':'%'+_0x37d3cb[_0xa03f('0x3c')][_0xa03f('0xa4')]+'%'};return _0x36f6af;})});}_0x3da1fb[_0xa03f('0xa1')]['secret']=![];if(_0x37d3cb[_0xa03f('0x3c')]['id']){_0x3da1fb[_0xa03f('0xa1')]['id']={'$gt':_0x37d3cb['query']['id']};}_0x3da1fb=_[_0xa03f('0x49')]({},_0x3da1fb,_0x37d3cb[_0xa03f('0x4a')]);return db[_0xa03f('0x61')][_0xa03f('0x25')]({'where':_0x3da1fb[_0xa03f('0xa1')]})['then'](function(_0x80e591){_0x53efb8['count']=_0x80e591;_0x3da1fb[_0xa03f('0xa8')]=[];if(_0x37d3cb[_0xa03f('0x3c')][_0xa03f('0xab')]){_0x3da1fb[_0xa03f('0xa8')]['push']({'model':db[_0xa03f('0x7d')],'as':_0xa03f('0x7d'),'attributes':['id',_0xa03f('0x89'),'alias']});}if(_0x37d3cb[_0xa03f('0x3c')][_0xa03f('0x48')]){_0x3da1fb[_0xa03f('0xa8')]=[{'all':!![]}];}return db[_0xa03f('0x61')][_0xa03f('0x3a')](_0x3da1fb);})[_0xa03f('0x16')](function(_0x180fdc){_0x53efb8[_0xa03f('0xa9')]=_0x180fdc;return _0x53efb8;});}})[_0xa03f('0x16')](respondWithFilteredResult(_0x4f392a,_0x3da1fb))['catch'](handleError(_0x4f392a,null));};exports[_0xa03f('0xac')]=function(_0x5db843,_0x412a3e){return db['ChatInteraction'][_0xa03f('0x4b')]({'where':{'id':_0x5db843[_0xa03f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x412a3e,null))[_0xa03f('0x16')](function(_0x5a3520){if(_0x5a3520){return _0x5a3520[_0xa03f('0xad')](_0x5db843[_0xa03f('0x30')][_0xa03f('0x9a')],_[_0xa03f('0x9b')](_0x5db843[_0xa03f('0x30')],[_0xa03f('0x9a'),'id'])||{})[_0xa03f('0xae')](function(){return db[_0xa03f('0xaf')][_0xa03f('0x3a')]({'attributes':['id',_0xa03f('0x2d'),'color'],'where':{'id':_0x5db843[_0xa03f('0x30')][_0xa03f('0x9a')]}});})['then'](function(_0x1dd0b6){socket[_0xa03f('0xb0')](_0xa03f('0xb1'),{'id':Number(_0x5db843[_0xa03f('0x3f')]['id']),'tags':_0x1dd0b6||[]});return{'id':Number(_0x5db843[_0xa03f('0x3f')]['id']),'tags':_0x1dd0b6||[]};});}})[_0xa03f('0x16')](respondWithResult(_0x412a3e,null))[_0xa03f('0x1f')](handleError(_0x412a3e,null));};exports[_0xa03f('0xb2')]=function(_0x38d390,_0x4108a6){return db[_0xa03f('0x36')][_0xa03f('0x4b')]({'where':{'id':_0x38d390[_0xa03f('0x3f')]['id']}})[_0xa03f('0x16')](handleEntityNotFound(_0x4108a6,null))[_0xa03f('0x16')](function(_0xf4a0de){if(_0xf4a0de){return _0xf4a0de['removeTags'](_0x38d390[_0xa03f('0x3c')][_0xa03f('0x9a')]);}})[_0xa03f('0x16')](respondWithStatusCode(_0x4108a6,null))[_0xa03f('0x1f')](handleError(_0x4108a6,null));};exports[_0xa03f('0x77')]=function(_0x596435,_0x583fdf){var _0x36d6eb=moment()[_0xa03f('0xb3')]()['toString']();var _0x1bc66e=path[_0xa03f('0x74')](config['root'],'server',_0xa03f('0xb4'),_0xa03f('0xb5'));var _0x372fe1=path[_0xa03f('0x74')](config[_0xa03f('0x75')],'server',_0xa03f('0xb4'),_0xa03f('0xb6'));var _0x28ef80=path['join'](_0x1bc66e,_0x36d6eb);var _0x504d44=util[_0xa03f('0x81')](_0xa03f('0xb7'),_0x596435[_0xa03f('0x3f')]['id'],_0x36d6eb);var _0x2713db=path['join'](_0x1bc66e,_0x504d44);var _0x209d70=[];_0x209d70[_0xa03f('0xb8')]({'model':db[_0xa03f('0x7d')],'as':_0xa03f('0x7d'),'attributes':['id',_0xa03f('0x89')],'raw':!![]});_0x209d70[_0xa03f('0xb8')]({'model':db[_0xa03f('0x64')],'as':'Contact','attributes':['id',_0xa03f('0xb9'),_0xa03f('0xba')],'raw':!![]});if(_0x596435[_0xa03f('0x3c')]['attachments']){_0x209d70['push']({'model':db[_0xa03f('0x71')],'as':'Attachment','raw':!![]});}var _0x3febb4=[{'model':db[_0xa03f('0x61')],'as':_0xa03f('0x80'),'attributes':['id',_0xa03f('0x30'),'createdAt',_0xa03f('0x8e'),'secret',_0xa03f('0xbb')],'include':_0x209d70}];_0x3febb4['push']({'model':db[_0xa03f('0x7e')],'as':'Account','attributes':['id','name']});_0x3febb4[_0xa03f('0xb8')]({'model':db[_0xa03f('0x7d')],'as':_0xa03f('0xbc'),'attributes':['id',_0xa03f('0x89')]});return db['ChatInteraction'][_0xa03f('0x4b')]({'where':{'id':_0x596435[_0xa03f('0x3f')]['id']},'include':_0x3febb4})[_0xa03f('0x16')](handleEntityNotFound(_0x583fdf,null))['then'](function(_0x55ea99){if(_0x55ea99){var _0x1060e3=_0x55ea99[_0xa03f('0xbd')]({'plain':!![]});fs[_0xa03f('0xbe')](_0x28ef80);var _0x507e45={'channel':_0xa03f('0xbf'),'account':_0x1060e3[_0xa03f('0xc0')][_0xa03f('0x2d')],'agent':_0x1060e3[_0xa03f('0xbc')]?_0x1060e3[_0xa03f('0xbc')][_0xa03f('0x89')]:'N.A.','createdAt':moment(_0x1060e3[_0xa03f('0x8c')])[_0xa03f('0x81')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa03f('0xc1')](),'closedAt':_0x1060e3['closed']?moment(_0x1060e3[_0xa03f('0xc2')])[_0xa03f('0x81')](_0xa03f('0xa7'))[_0xa03f('0xc1')]():'','disposition':_0x1060e3['disposition'],'chatInfo':{'browser':_0x1060e3[_0xa03f('0xc3')],'os':_0x1060e3['osName'],'referer':_0x1060e3[_0xa03f('0xc4')],'customerIp':_0x1060e3[_0xa03f('0xc5')],'customerPort':_0x1060e3[_0xa03f('0xc6')]?_0x1060e3[_0xa03f('0xc6')]:_0xa03f('0xc7')},'messages':_(_0x1060e3[_0xa03f('0x80')])[_0xa03f('0xc8')]()[_0xa03f('0xa4')]({'secret':![]})[_0xa03f('0x35')](function(_0x35cd5f){if(_0x35cd5f[_0xa03f('0x71')]){var _0x3a013e=path[_0xa03f('0x74')](_0x372fe1,_0x35cd5f[_0xa03f('0x71')][_0xa03f('0x6e')]);if(fs[_0xa03f('0xc9')](_0x3a013e)){fs[_0xa03f('0xca')](_0x3a013e)[_0xa03f('0xcb')](fs['createWriteStream'](path[_0xa03f('0x74')](_0x28ef80,_0x35cd5f['Attachment'][_0xa03f('0x6e')])));}}return{'date':moment(_0x35cd5f['createdAt'])[_0xa03f('0x81')](_0xa03f('0xa7'))['toString'](),'sender':_0x35cd5f[_0xa03f('0x8e')]===_0xa03f('0x60')?_0x35cd5f['User']?_0x35cd5f[_0xa03f('0x7d')][_0xa03f('0x89')]:'System':_0x35cd5f['Contact']['firstName']+(_0x35cd5f[_0xa03f('0x65')][_0xa03f('0xba')]?'\x20'+_0x35cd5f[_0xa03f('0x65')][_0xa03f('0xba')]:''),'body':_0x35cd5f[_0xa03f('0x71')]?_0x35cd5f[_0xa03f('0x71')]['basename']:_0x35cd5f[_0xa03f('0x30')],'direction':_0x35cd5f[_0xa03f('0x8e')]===_0xa03f('0x60')?'A':'C','secret':_0x35cd5f['secret'],'read':_0x35cd5f['read'],'attachment':_0x35cd5f[_0xa03f('0x71')]};})[_0xa03f('0xcc')]()};return ejs[_0xa03f('0xcd')](path[_0xa03f('0x74')](config[_0xa03f('0x75')],'server','views','downloadInteraction.ejs'),{'interaction':_0x507e45})[_0xa03f('0x16')](function(_0x2e6295){var _0x10c333=path['join'](_0x28ef80,_0xa03f('0xce')+_0x1060e3['id']+'-'+_0x36d6eb+_0xa03f('0xcf'));var _0x202de1={'path':_0x10c333,'channel':_0xa03f('0xbf'),'interactionId':_0x1060e3['id']};return pdf['createPdfFromHTML'](_0x2e6295,_0x202de1);})[_0xa03f('0x16')](function(){return new Promise(function(_0x16e6ef,_0x46b7d2){zipdir(_0x28ef80,{'saveTo':_0x2713db},function(_0x2360fe,_0x16f53b){if(_0x2360fe)return _0x46b7d2(_0x2360fe);return _0x16e6ef(_0x16f53b);});})[_0xa03f('0x16')](function(){return new BPromise(function(_0x4e7878,_0x23b937){rimraf(_0x28ef80,function(_0x5e7733){if(_0x5e7733)_0x23b937(_0x5e7733);return _0x4e7878();});});})['then'](function(){return _0x583fdf[_0xa03f('0x77')](_0x2713db,_0x504d44,function(_0x48ee5e){if(_0x48ee5e){logger['error'](_0xa03f('0xd0'),_0x48ee5e);}else{fs[_0xa03f('0xd1')](_0x2713db);}});});});}else{return _0x583fdf['sendStatus'](0xc8);}})['catch'](handleError(_0x583fdf,null));};
\ No newline at end of file
+var _0x96ee=['color','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','push','firstName','lastName','direction','read','Owner','get','mkdirSync','N.A.','closed','closedAt','disposition','browserName','osName','customerIp','customerPort','tail','createReadStream','pipe','value','renderFile','views','downloadInteraction.ejs','transcript-','Chat','createPdfFromHTML','err','rimraf','request-promise','mustache','util','path','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','stack','name','send','render','merge','contact','agent','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','query','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','find','create','body','update','describe','createVidaooSession','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','attachmentUpload','file','originalname','basename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','ChatOfflineMessageId','join','root','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','%s%d','System','customer','agentIdentifier','agent_alias','alias','agent_fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','hasOwnProperty','nolimit','sort','pick','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','getMyMessages','ChatInteractionId','secret','includeAgent','addTags','spread','Tag'];(function(_0x1cef73,_0xa6d6a){var _0x2fae84=function(_0x2e3955){while(--_0x2e3955){_0x1cef73['push'](_0x1cef73['shift']());}};_0x2fae84(++_0xa6d6a);}(_0x96ee,0xf5));var _0xe96e=function(_0x590381,_0x5c3948){_0x590381=_0x590381-0x0;var _0xe300df=_0x96ee[_0x590381];return _0xe300df;};'use strict';var rimraf=require(_0xe96e('0x0'));var zipdir=require('zip-dir');var rp=require(_0xe96e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe96e('0x2'));var util=require(_0xe96e('0x3'));var path=require(_0xe96e('0x4'));var ejs=require(_0xe96e('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xe96e('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xe96e('0x7'));var pdf=require(_0xe96e('0x8'));var logger=require(_0xe96e('0x9'))(_0xe96e('0xa'));var config=require('../../config/environment');var db=require(_0xe96e('0xb'))['db'];config['redis']=_[_0xe96e('0xc')](config[_0xe96e('0xd')],{'host':_0xe96e('0xe'),'port':0x18eb});var socket=require(_0xe96e('0xf'))(new Redis(config[_0xe96e('0xd')]));require(_0xe96e('0x10'))[_0xe96e('0x11')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe96e('0x12')][_0xe96e('0x13')]({'port':0x232b});var client9004=jayson[_0xe96e('0x12')][_0xe96e('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x2f3307,_0x518d0f,_0x9c9186,_0xbfe6f9){return new BPromise(function(_0x36403d,_0x4278d2){var _0x4b91c5=_0xbfe6f9||client;return _0x4b91c5[_0xe96e('0x14')](_0x2f3307,_0x9c9186)[_0xe96e('0x15')](function(_0x1ad776){logger[_0xe96e('0x16')](_0xe96e('0x17'),_0x518d0f,'request\x20sent');logger[_0xe96e('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x518d0f,'request\x20sent',JSON[_0xe96e('0x19')](_0x1ad776));if(_0x1ad776[_0xe96e('0x1a')]){if(_0x1ad776[_0xe96e('0x1a')]['code']===0x1f4){logger[_0xe96e('0x1a')](_0xe96e('0x17'),_0x518d0f,_0x1ad776[_0xe96e('0x1a')][_0xe96e('0x1b')]);return _0x4278d2(_0x1ad776[_0xe96e('0x1a')][_0xe96e('0x1b')]);}logger['error'](_0xe96e('0x17'),_0x518d0f,_0x1ad776[_0xe96e('0x1a')][_0xe96e('0x1b')]);return _0x36403d(_0x1ad776[_0xe96e('0x1a')][_0xe96e('0x1b')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x518d0f,_0xe96e('0x1c'));_0x36403d(_0x1ad776[_0xe96e('0x1d')]['message']);}})[_0xe96e('0x1e')](function(_0x2fe9c1){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x518d0f,_0x2fe9c1);_0x4278d2(_0x2fe9c1);});});}function respondWithStatusCode(_0x3b076c,_0x2fd521){_0x2fd521=_0x2fd521||0xcc;return function(_0x3479d1){if(_0x3479d1){return _0x3b076c[_0xe96e('0x1f')](_0x2fd521);}return _0x3b076c[_0xe96e('0x20')](_0x2fd521)[_0xe96e('0x21')]();};}function respondWithResult(_0x38484f,_0x3a5ee7){_0x3a5ee7=_0x3a5ee7||0xc8;return function(_0x9ceb4b){if(_0x9ceb4b){return _0x38484f[_0xe96e('0x20')](_0x3a5ee7)[_0xe96e('0x22')](_0x9ceb4b);}};}function respondWithFilteredResult(_0x459c49,_0xf5d16){return function(_0x3b6206){if(_0x3b6206){var _0x440512=typeof _0xf5d16[_0xe96e('0x23')]===_0xe96e('0x24')&&typeof _0xf5d16[_0xe96e('0x25')]==='undefined';var _0x270985=_0x3b6206[_0xe96e('0x26')];var _0x5f17a5=_0x440512?0x0:_0xf5d16['offset'];var _0x94e258=_0x440512?_0x3b6206[_0xe96e('0x26')]:_0xf5d16[_0xe96e('0x23')]+_0xf5d16[_0xe96e('0x25')];var _0x2eee27;if(_0x94e258>=_0x270985){_0x94e258=_0x270985;_0x2eee27=0xc8;}else{_0x2eee27=0xce;}_0x459c49[_0xe96e('0x20')](_0x2eee27);return _0x459c49[_0xe96e('0x27')](_0xe96e('0x28'),_0x5f17a5+'-'+_0x94e258+'/'+_0x270985)['json'](_0x3b6206);}return null;};}function saveUpdates(_0x121a90){return function(_0xafeaa4){if(_0xafeaa4){return _0xafeaa4['update'](_0x121a90)['then'](function(_0x4b487d){return _0x4b487d;});}return null;};}function removeEntity(_0x400bd7){return function(_0x420297){if(_0x420297){return _0x420297[_0xe96e('0x29')]()['then'](function(){_0x400bd7[_0xe96e('0x20')](0xcc)[_0xe96e('0x21')]();});}};}function handleEntityNotFound(_0x43a5b5){return function(_0x36bc95){if(!_0x36bc95){_0x43a5b5[_0xe96e('0x1f')](0x194);}return _0x36bc95;};}function handleError(_0x3bca47,_0xa1b923){_0xa1b923=_0xa1b923||0x1f4;return function(_0xefe248){logger[_0xe96e('0x1a')](_0xefe248[_0xe96e('0x2a')]);if(_0xefe248[_0xe96e('0x2b')]){delete _0xefe248[_0xe96e('0x2b')];}_0x3bca47[_0xe96e('0x20')](_0xa1b923)[_0xe96e('0x2c')](_0xefe248);};}function getMustacheRender(_0x51b717,_0x2e6f15){return Mustache[_0xe96e('0x2d')](_0x51b717,_[_0xe96e('0x2e')](_0x2e6f15['body'],{'contact':_0x2e6f15[_0xe96e('0x2f')],'message':_0x2e6f15['message'],'agent':_0x2e6f15[_0xe96e('0x30')],'interaction':_0x2e6f15['interaction'],'account':_0x2e6f15[_0xe96e('0x31')]}))||'';}exports[_0xe96e('0x32')]=function(_0x246bab,_0xe3ac2a){var _0x5df22c={};var _0x378f11=_[_0xe96e('0x33')](db[_0xe96e('0x34')][_0xe96e('0x35')],function(_0x278fcb){return{'name':_0x278fcb[_0xe96e('0x36')],'type':_0x278fcb[_0xe96e('0x37')][_0xe96e('0x38')]};});_0x5df22c=qs[_0xe96e('0x39')](_0x378f11,_0x246bab);return interaction['findAll']('chat',_0x246bab[_0xe96e('0x3a')],_0x246bab['user'],_0x5df22c,_0x378f11)['then'](respondWithFilteredResult(_0xe3ac2a,_0x5df22c))[_0xe96e('0x1e')](handleError(_0xe3ac2a,null));};exports[_0xe96e('0x3b')]=function(_0x14d405,_0xb0ca4f){var _0x302ac2={'raw':![],'where':{'id':_0x14d405[_0xe96e('0x3c')]['id']}},_0x4ab390={};_0x4ab390[_0xe96e('0x3d')]=_['keys'](db[_0xe96e('0x34')]['rawAttributes']);_0x4ab390[_0xe96e('0x3a')]=_[_0xe96e('0x3e')](_0x14d405[_0xe96e('0x3a')]);_0x4ab390[_0xe96e('0x3f')]=_[_0xe96e('0x40')](_0x4ab390[_0xe96e('0x3d')],_0x4ab390[_0xe96e('0x3a')]);_0x302ac2[_0xe96e('0x41')]=_['intersection'](_0x4ab390[_0xe96e('0x3d')],qs[_0xe96e('0x42')](_0x14d405[_0xe96e('0x3a')][_0xe96e('0x42')]));_0x302ac2[_0xe96e('0x41')]=_0x302ac2['attributes'][_0xe96e('0x43')]?_0x302ac2[_0xe96e('0x41')]:_0x4ab390[_0xe96e('0x3d')];if(_0x14d405[_0xe96e('0x3a')][_0xe96e('0x44')]){_0x302ac2[_0xe96e('0x45')]=[{'all':!![]}];}_0x302ac2=_[_0xe96e('0x2e')]({},_0x302ac2,_0x14d405['options']);return db[_0xe96e('0x34')][_0xe96e('0x46')](_0x302ac2)[_0xe96e('0x15')](handleEntityNotFound(_0xb0ca4f,null))[_0xe96e('0x15')](respondWithResult(_0xb0ca4f,null))[_0xe96e('0x1e')](handleError(_0xb0ca4f,null));};exports['create']=function(_0x44917e,_0x3c1f63){return db[_0xe96e('0x34')][_0xe96e('0x47')](_0x44917e[_0xe96e('0x48')],{})['then'](respondWithResult(_0x3c1f63,0xc9))[_0xe96e('0x1e')](handleError(_0x3c1f63,null));};exports[_0xe96e('0x49')]=function(_0x1a9d84,_0x5e027b){if(_0x1a9d84['body']['id']){delete _0x1a9d84[_0xe96e('0x48')]['id'];}return db[_0xe96e('0x34')][_0xe96e('0x46')]({'where':{'id':_0x1a9d84[_0xe96e('0x3c')]['id']}})[_0xe96e('0x15')](handleEntityNotFound(_0x5e027b,null))[_0xe96e('0x15')](saveUpdates(_0x1a9d84[_0xe96e('0x48')],null))['then'](respondWithResult(_0x5e027b,null))[_0xe96e('0x1e')](handleError(_0x5e027b,null));};exports['destroy']=function(_0x52be25,_0x22d2f4){return db[_0xe96e('0x34')][_0xe96e('0x46')]({'where':{'id':_0x52be25['params']['id']}})[_0xe96e('0x15')](handleEntityNotFound(_0x22d2f4,null))[_0xe96e('0x15')](removeEntity(_0x22d2f4,null))['catch'](handleError(_0x22d2f4,null));};exports[_0xe96e('0x4a')]=function(_0x3b4436,_0x226ba8){return db['ChatInteraction'][_0xe96e('0x4a')]()[_0xe96e('0x15')](respondWithResult(_0x226ba8,null))['catch'](handleError(_0x226ba8,null));};exports[_0xe96e('0x4b')]=function(_0x585f9f,_0x1964d5){var _0x393a08=_0x585f9f[_0xe96e('0x3c')]['id'];var _0x30db48;var _0x1f4989;var _0x4777da;return db[_0xe96e('0x34')]['findOne']({'where':{'id':_0x393a08}})[_0xe96e('0x15')](function(_0x96e9ab){_0x30db48=_0x96e9ab;return db[_0xe96e('0x4c')]['findOne']({'where':{'id':_0x96e9ab[_0xe96e('0x4d')]},'attributes':['id',_0xe96e('0x4e'),'vidaooEscalation',_0xe96e('0x4f'),_0xe96e('0x50'),_0xe96e('0x51')],'raw':!![]});})[_0xe96e('0x15')](function(_0x358eae){if(_0x358eae&&_0x358eae['vidaooApiKey']&&_0x358eae[_0xe96e('0x52')]){_0x1f4989=_0x358eae;var _0x2b5c42={'interaction':{'id':_0x393a08},'agent':{'id':_0x585f9f[_0xe96e('0x53')]['id'],'name':_0x585f9f[_0xe96e('0x53')][_0xe96e('0x2b')],'fullname':_0x585f9f[_0xe96e('0x53')][_0xe96e('0x54')],'email':_0x585f9f[_0xe96e('0x53')][_0xe96e('0x55')]},'contact':_0x585f9f[_0xe96e('0x48')][_0xe96e('0x2f')],'account':_0x585f9f[_0xe96e('0x48')]['account']};var _0x2d41dc={'rejectUnauthorized':![],'method':_0xe96e('0x56'),'url':_0xe96e('0x57'),'headers':{'X-APIKEY':_0x358eae[_0xe96e('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x585f9f[_0xe96e('0x53')][_0xe96e('0x55')]],'buttons':null,'topic':_0x1f4989['vidaooTopic'],'note':_[_0xe96e('0x58')](_0x1f4989[_0xe96e('0x50')])?null:getMustacheRender(_0x1f4989['vidaooNote'],_0x2b5c42),'metadata':null},'redirect':_0xe96e('0x59'),'json':!![]};try{if(!_['isNull'](_0x1f4989[_0xe96e('0x51')])){var _0x33d522=getMustacheRender(_0x1f4989[_0xe96e('0x51')],_0x2b5c42);var _0x17deab=JSON['parse'](_0x33d522);_0x2d41dc['body'][_0xe96e('0x5a')]=_0x17deab;}}catch(_0x2f0a6c){throw new db[(_0xe96e('0x5b'))][(_0xe96e('0x5c'))](_0xe96e('0x5d'));}return rp(_0x2d41dc);}else{throw new db[(_0xe96e('0x5b'))][(_0xe96e('0x5c'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xe96e('0x15')](function(_0x4ffc04){_0x4777da=_0x4ffc04;if(_0x4777da['id']){var _0x420da7={'body':_0x4777da[_0xe96e('0x5e')],'ChatWebsiteId':_0x1f4989['id'],'ChatInteractionId':_0x30db48['id'],'direction':_0xe96e('0x5f'),'UserId':_0x585f9f['user']['id']};return db[_0xe96e('0x60')][_0xe96e('0x47')](_0x420da7,{});}else{throw new db[(_0xe96e('0x5b'))][(_0xe96e('0x5c'))](_0xe96e('0x61'));}})[_0xe96e('0x15')](function(){return _0x30db48[_0xe96e('0x62')]({'vidaooSessionId':_0x4777da['id']});})[_0xe96e('0x15')](respondWithResult(_0x1964d5,null))['catch'](handleError(_0x1964d5,null));};exports['customUpdate']=function(_0x2bb4f3,_0x42577c){if(_0x2bb4f3[_0xe96e('0x48')]['id']){delete _0x2bb4f3[_0xe96e('0x48')]['id'];}return db[_0xe96e('0x34')][_0xe96e('0x46')]({'where':{'id':_0x2bb4f3[_0xe96e('0x3c')]['id']},'include':[{'model':db[_0xe96e('0x63')],'as':_0xe96e('0x64')}]})['then'](handleEntityNotFound(_0x42577c,null))['then'](saveUpdates(_0x2bb4f3[_0xe96e('0x48')],null))[_0xe96e('0x15')](respondWithResult(_0x42577c,null))[_0xe96e('0x1e')](handleError(_0x42577c,null));};exports[_0xe96e('0x65')]=function(_0x373989,_0x1ee563){if(_0x373989[_0xe96e('0x48')]['id']){delete _0x373989[_0xe96e('0x48')]['id'];}return db[_0xe96e('0x34')][_0xe96e('0x46')]({'where':{'id':_0x373989[_0xe96e('0x3c')]['id']}})[_0xe96e('0x15')](function(_0x1ad969){if(!_0x1ad969){logger[_0xe96e('0x1a')](_0xe96e('0x66'),'abandon',0x194,_0xe96e('0x67'));_0x1ee563[_0xe96e('0x1f')](0x194);}else{if(_0x1ad969[_0xe96e('0x68')]){throw new db[(_0xe96e('0x5b'))][(_0xe96e('0x5c'))](_0xe96e('0x69'));}}return _0x1ad969;})[_0xe96e('0x15')](function(_0x5bbd94){if(_0x5bbd94){return _0x5bbd94[_0xe96e('0x49')]({'closed':_0x373989[_0xe96e('0x48')]['closed'],'disposition':_0x373989[_0xe96e('0x48')]['disposition']})[_0xe96e('0x15')](function(_0x3864a3){return _0x3864a3;});}})[_0xe96e('0x15')](function(){return respondWithRpcPromise('AbandonInteraction',_0xe96e('0x65'),_0x373989['body'],client9004);})[_0xe96e('0x15')](respondWithResult(_0x1ee563,null))['catch'](handleError(_0x1ee563,null));};exports[_0xe96e('0x6a')]=function(_0x13c2e3,_0xb51c71){_0x13c2e3[_0xe96e('0x48')][_0xe96e('0x2b')]=_0x13c2e3[_0xe96e('0x6b')][_0xe96e('0x6c')];_0x13c2e3[_0xe96e('0x48')][_0xe96e('0x6d')]=_0x13c2e3[_0xe96e('0x6b')]['filename'];_0x13c2e3[_0xe96e('0x48')]['type']=_0x13c2e3[_0xe96e('0x6b')][_0xe96e('0x6e')];return db[_0xe96e('0x6f')][_0xe96e('0x47')](_0x13c2e3[_0xe96e('0x48')])['then'](respondWithResult(_0xb51c71,0xc9))[_0xe96e('0x1e')](handleError(_0xb51c71,null));};exports[_0xe96e('0x70')]=function(_0x19c66f,_0x40e52c){return db[_0xe96e('0x34')][_0xe96e('0x71')]({'where':{'id':_0x19c66f[_0xe96e('0x3c')]['id']},'raw':!![]})[_0xe96e('0x15')](handleEntityNotFound(_0x40e52c,null))[_0xe96e('0x15')](function(_0x12e021){if(_0x12e021){if(_0x12e021['closed']){return _0x40e52c[_0xe96e('0x20')](0x193)[_0xe96e('0x22')]({'status':0x193,'message':_0xe96e('0x72')});}return db[_0xe96e('0x6f')][_0xe96e('0x71')]({'where':{'id':_0x19c66f[_0xe96e('0x3a')][_0xe96e('0x73')]},'raw':!![]})[_0xe96e('0x15')](handleEntityNotFound(_0x40e52c,null));}})['then'](function(_0x1adaea){if(_0x1adaea){var _0x47b73a=_0x1adaea[_0xe96e('0x74')]!==null;var _0x2f9543=path[_0xe96e('0x75')](config[_0xe96e('0x76')],'server/files/attachments/');if(_0x47b73a){_0x2f9543=path[_0xe96e('0x75')](_0x2f9543,'offline-chat/');}var _0x1f6759=path[_0xe96e('0x75')](_0x2f9543,_0x1adaea[_0xe96e('0x6d')]);return _0x40e52c[_0xe96e('0x77')](_0x1f6759);}})[_0xe96e('0x1e')](handleError(_0x40e52c,null));};exports[_0xe96e('0x78')]=function(_0xd6004f,_0x5169ae){var _0x533e29=null;var _0x54913e=null;var _0x287fce=null;if(_0xd6004f[_0xe96e('0x48')]['id']){delete _0xd6004f[_0xe96e('0x48')]['id'];}if(_0xd6004f['body'][_0xe96e('0x79')]){_0x287fce=path[_0xe96e('0x75')](config[_0xe96e('0x76')],_0xe96e('0x7a'),util[_0xe96e('0x7b')](_0xe96e('0x7c'),Date[_0xe96e('0x7d')]()));_0xd6004f[_0xe96e('0x48')][_0xe96e('0x7e')]=_0x287fce;}return db[_0xe96e('0x34')][_0xe96e('0x46')]({'where':{'id':_0xd6004f['params']['id']},'include':[{'model':db[_0xe96e('0x60')],'as':_0xe96e('0x7f'),'include':[{'model':db[_0xe96e('0x80')],'as':_0xe96e('0x80')}]}]})[_0xe96e('0x15')](handleEntityNotFound(_0x5169ae,null))[_0xe96e('0x15')](saveUpdates(_0xd6004f[_0xe96e('0x48')],null))[_0xe96e('0x15')](function(_0x3395a3){if(_0x3395a3){_0x533e29=_0x3395a3;return db[_0xe96e('0x4c')][_0xe96e('0x46')]({'where':{'id':_0x533e29[_0xe96e('0x4d')]}});}})[_0xe96e('0x15')](function(_0x503442){if(_0x503442){_0x54913e=_0x503442;return db[_0xe96e('0x63')][_0xe96e('0x46')]({'where':{'id':_0x533e29[_0xe96e('0x81')]}});}})[_0xe96e('0x15')](function(_0x2b94ff){if(_0x2b94ff){if(_0x287fce){var _0x33727e=null;for(var _0x1d0b4c=0x1;_0x1d0b4c<_0x533e29[_0xe96e('0x7f')][_0xe96e('0x43')];++_0x1d0b4c){_0x33727e=_0x533e29[_0xe96e('0x7f')][_0x1d0b4c];var _0x3d319f=_0x33727e[_0xe96e('0x68')]?util[_0xe96e('0x7b')](_0xe96e('0x82'),_0x54913e['agentAlias'],_0x33727e[_0xe96e('0x68')]):_0xe96e('0x83');var _0x584101=_0xd6004f[_0xe96e('0x48')][_0xe96e('0x84')]||util[_0xe96e('0x7b')]('%s%d','Visitor',_0x33727e[_0xe96e('0x81')]);switch(_0x54913e[_0xe96e('0x85')]){case'website_alias':_0x3d319f=_0x33727e[_0xe96e('0x68')]?util[_0xe96e('0x7b')](_0xe96e('0x82'),_0x54913e['agentAlias'],_0x33727e[_0xe96e('0x68')]):'System';break;case _0xe96e('0x86'):_0x3d319f=_0x33727e[_0xe96e('0x68')]?_0x33727e[_0xe96e('0x80')][_0xe96e('0x87')]||_0x33727e[_0xe96e('0x80')]['fullname']:_0xe96e('0x83');break;case _0xe96e('0x88'):_0x3d319f=_0x33727e[_0xe96e('0x68')]?_0x33727e['User'][_0xe96e('0x54')]:'System';break;default:_0x3d319f=_0x33727e[_0xe96e('0x68')]?util[_0xe96e('0x7b')](_0xe96e('0x82'),_0x54913e[_0xe96e('0x89')],_0x33727e[_0xe96e('0x68')]):_0xe96e('0x83');}var _0x322e26=util[_0xe96e('0x7b')](_0xe96e('0x8a'),moment(_0x33727e[_0xe96e('0x8b')])[_0xe96e('0x7b')](_0xe96e('0x8c')),_0x33727e['direction']==='in'?_0x584101:_0x3d319f,_0x33727e[_0xe96e('0x48')]);if(!_0x33727e['secret']){fs[_0xe96e('0x8d')](_0x287fce,_0x322e26);}}return db[_0xe96e('0x8e')][_0xe96e('0x71')]({'where':{'service':!![]},'include':[{'model':db[_0xe96e('0x8f')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xe96e('0x90'),'raw':!![]}]}]});}}})[_0xe96e('0x15')](function(_0x53c0b6){if(!_0x53c0b6||!_0x53c0b6[_0xe96e('0x91')]||!_0xd6004f[_0xe96e('0x48')])return _0x533e29;var _0xe3e71e=_0x53c0b6[_0xe96e('0x92')]();return respondWithRpcPromise(_0xe96e('0x93'),_0xe96e('0x94'),{'account':_0xe3e71e,'message':{'from':util[_0xe96e('0x7b')](_0xe96e('0x95'),_0x53c0b6['name'],_0x53c0b6[_0xe96e('0x55')]||_0x53c0b6['Smtp'][_0xe96e('0x53')]),'to':_0xd6004f[_0xe96e('0x48')][_0xe96e('0x79')],'subject':_0xe96e('0x96'),'text':util[_0xe96e('0x7b')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0xd6004f[_0xe96e('0x48')]['mailTranscript']),'attachments':[{'path':_0x287fce}]}})[_0xe96e('0x15')](function(){return _0x533e29;})[_0xe96e('0x1e')](function(_0x4e8612){logger[_0xe96e('0x1a')](_0x4e8612);});})[_0xe96e('0x15')](respondWithStatusCode(_0x5169ae,0xc8))['catch'](handleError(_0x5169ae,null));};exports['addMessage']=function(_0x1d6c82,_0x1c72de){return db['ChatMessage']['find']({'where':{'id':_0x1d6c82['params']['id']}})[_0xe96e('0x15')](handleEntityNotFound(_0x1c72de,null))[_0xe96e('0x15')](function(_0x204d41){if(_0x204d41){return _0x204d41[_0xe96e('0x97')](_0x1d6c82[_0xe96e('0x48')][_0xe96e('0x98')],_[_0xe96e('0x99')](_0x1d6c82[_0xe96e('0x48')],[_0xe96e('0x98'),'id'])||{});}})['then'](respondWithResult(_0x1c72de,null))[_0xe96e('0x1e')](handleError(_0x1c72de,null));};exports['getMessages']=function(_0x1b4e13,_0x104db5){var _0x4d93f4={'raw':![],'where':{}};var _0x236a05={};var _0x3c4487={'count':0x0,'rows':[]};return db[_0xe96e('0x34')][_0xe96e('0x71')]({'where':{'id':_0x1b4e13[_0xe96e('0x3c')]['id']}})['then'](handleEntityNotFound(_0x104db5,null))[_0xe96e('0x15')](function(_0x120001){if(_0x120001){_0x236a05[_0xe96e('0x3d')]=_[_0xe96e('0x3e')](db[_0xe96e('0x60')][_0xe96e('0x35')]);_0x236a05[_0xe96e('0x3a')]=_[_0xe96e('0x3e')](_0x1b4e13[_0xe96e('0x3a')]);_0x236a05[_0xe96e('0x3f')]=_['intersection'](_0x236a05[_0xe96e('0x3d')],_0x236a05[_0xe96e('0x3a')]);_0x4d93f4['attributes']=_[_0xe96e('0x40')](_0x236a05[_0xe96e('0x3d')],qs[_0xe96e('0x42')](_0x1b4e13[_0xe96e('0x3a')]['fields']));_0x4d93f4[_0xe96e('0x41')]=_0x4d93f4[_0xe96e('0x41')][_0xe96e('0x43')]?_0x4d93f4[_0xe96e('0x41')]:_0x236a05[_0xe96e('0x3d')];if(!_0x1b4e13[_0xe96e('0x3a')][_0xe96e('0x9a')](_0xe96e('0x9b'))){_0x4d93f4[_0xe96e('0x25')]=qs[_0xe96e('0x25')](_0x1b4e13[_0xe96e('0x3a')][_0xe96e('0x25')]);_0x4d93f4[_0xe96e('0x23')]=qs[_0xe96e('0x23')](_0x1b4e13[_0xe96e('0x3a')][_0xe96e('0x23')]);}_0x4d93f4['order']=qs[_0xe96e('0x9c')](_0x1b4e13['query'][_0xe96e('0x9c')]);_0x4d93f4['where']=qs[_0xe96e('0x3f')](_[_0xe96e('0x9d')](_0x1b4e13[_0xe96e('0x3a')],_0x236a05[_0xe96e('0x3f')]));_0x4d93f4[_0xe96e('0x9e')]['ChatInteractionId']=_0x120001['id'];if(_0x1b4e13['query'][_0xe96e('0x9f')]){_0x4d93f4[_0xe96e('0x9e')]=_['merge'](_0x4d93f4[_0xe96e('0x9e')],{'$or':_[_0xe96e('0x33')](_0x4d93f4[_0xe96e('0x41')],function(_0x33d216){var _0x5d4030={};_0x5d4030[_0x33d216]={'$like':'%'+_0x1b4e13[_0xe96e('0x3a')][_0xe96e('0x9f')]+'%'};return _0x5d4030;})});}if(_0x1b4e13['query'][_0xe96e('0xa0')]){var _0x59f6f9=_0x1b4e13[_0xe96e('0x3a')][_0xe96e('0xa0')][_0xe96e('0xa1')](',');var _0x2a88da={};_0x2a88da[_0x59f6f9[0x0]]={'$gte':moment(_0x59f6f9[0x1])['format'](_0xe96e('0xa2'))};_0x4d93f4[_0xe96e('0x9e')]=_[_0xe96e('0x2e')](_0x4d93f4[_0xe96e('0x9e')],_0x2a88da);}_0x4d93f4=_[_0xe96e('0x2e')]({},_0x4d93f4,_0x1b4e13[_0xe96e('0xa3')]);return db[_0xe96e('0x60')][_0xe96e('0x26')]({'where':_0x4d93f4[_0xe96e('0x9e')]})[_0xe96e('0x15')](function(_0x5e93f1){_0x3c4487[_0xe96e('0x26')]=_0x5e93f1;if(_0x1b4e13[_0xe96e('0x3a')][_0xe96e('0x44')]){_0x4d93f4[_0xe96e('0x45')]=[{'all':!![]}];}return db[_0xe96e('0x60')][_0xe96e('0xa4')](_0x4d93f4);})[_0xe96e('0x15')](function(_0x2df5f3){_0x3c4487[_0xe96e('0xa5')]=_0x2df5f3;return _0x3c4487;});}})['then'](respondWithFilteredResult(_0x104db5,_0x4d93f4))['catch'](handleError(_0x104db5,null));};exports[_0xe96e('0xa6')]=function(_0x2111d1,_0x4cf3a3){var _0x4abe37={'where':{}},_0x581016={},_0x383fe8={'count':0x0,'rows':[]};return db[_0xe96e('0x34')][_0xe96e('0x71')]({'where':{'id':_0x2111d1[_0xe96e('0x3c')]['id']}})[_0xe96e('0x15')](handleEntityNotFound(_0x4cf3a3,null))[_0xe96e('0x15')](function(_0x413697){if(_0x413697){_0x581016['model']=_[_0xe96e('0x3e')](db[_0xe96e('0x60')][_0xe96e('0x35')]);_0x581016[_0xe96e('0x3a')]=_['keys'](_0x2111d1['query']);_0x581016[_0xe96e('0x3f')]=_['intersection'](_0x581016[_0xe96e('0x3d')],_0x581016[_0xe96e('0x3a')]);_0x4abe37['attributes']=_['intersection'](_0x581016['model'],qs[_0xe96e('0x42')](_0x2111d1[_0xe96e('0x3a')][_0xe96e('0x42')]));_0x4abe37[_0xe96e('0x41')]=_0x4abe37[_0xe96e('0x41')][_0xe96e('0x43')]?_0x4abe37['attributes']:_0x581016[_0xe96e('0x3d')];if(!_0x2111d1[_0xe96e('0x3a')]['hasOwnProperty'](_0xe96e('0x9b'))){_0x4abe37[_0xe96e('0x25')]=qs[_0xe96e('0x25')](_0x2111d1[_0xe96e('0x3a')][_0xe96e('0x25')]);_0x4abe37[_0xe96e('0x23')]=qs[_0xe96e('0x23')](_0x2111d1[_0xe96e('0x3a')][_0xe96e('0x23')]);}_0x4abe37['order']=qs[_0xe96e('0x9c')](_0x2111d1['query'][_0xe96e('0x9c')]);_0x4abe37[_0xe96e('0x9e')]=qs[_0xe96e('0x3f')](_[_0xe96e('0x9d')](_0x2111d1[_0xe96e('0x3a')],_0x581016[_0xe96e('0x3f')]));_0x4abe37[_0xe96e('0x9e')][_0xe96e('0xa7')]=_0x413697['id'];if(_0x2111d1[_0xe96e('0x3a')][_0xe96e('0x9f')]){_0x4abe37[_0xe96e('0x9e')]=_[_0xe96e('0x2e')](_0x4abe37['where'],{'$or':_['map'](_0x4abe37[_0xe96e('0x41')],function(_0x4ca553){var _0xd40b59={};_0xd40b59[_0x4ca553]={'$like':'%'+_0x2111d1[_0xe96e('0x3a')]['filter']+'%'};return _0xd40b59;})});}_0x4abe37[_0xe96e('0x9e')][_0xe96e('0xa8')]=![];if(_0x2111d1[_0xe96e('0x3a')]['id']){_0x4abe37['where']['id']={'$gt':_0x2111d1[_0xe96e('0x3a')]['id']};}_0x4abe37=_[_0xe96e('0x2e')]({},_0x4abe37,_0x2111d1[_0xe96e('0xa3')]);return db[_0xe96e('0x60')][_0xe96e('0x26')]({'where':_0x4abe37[_0xe96e('0x9e')]})[_0xe96e('0x15')](function(_0xe1f2aa){_0x383fe8[_0xe96e('0x26')]=_0xe1f2aa;_0x4abe37[_0xe96e('0x45')]=[];if(_0x2111d1['query'][_0xe96e('0xa9')]){_0x4abe37['include']['push']({'model':db[_0xe96e('0x80')],'as':'User','attributes':['id','fullname','alias']});}if(_0x2111d1[_0xe96e('0x3a')]['includeAll']){_0x4abe37[_0xe96e('0x45')]=[{'all':!![]}];}return db['ChatMessage'][_0xe96e('0xa4')](_0x4abe37);})[_0xe96e('0x15')](function(_0x6e0bd4){_0x383fe8[_0xe96e('0xa5')]=_0x6e0bd4;return _0x383fe8;});}})[_0xe96e('0x15')](respondWithFilteredResult(_0x4cf3a3,_0x4abe37))['catch'](handleError(_0x4cf3a3,null));};exports[_0xe96e('0xaa')]=function(_0x3f1d4f,_0x37bb01){return db['ChatInteraction'][_0xe96e('0x46')]({'where':{'id':_0x3f1d4f[_0xe96e('0x3c')]['id']}})[_0xe96e('0x15')](handleEntityNotFound(_0x37bb01,null))[_0xe96e('0x15')](function(_0x5a0cd8){if(_0x5a0cd8){return _0x5a0cd8['setTags'](_0x3f1d4f[_0xe96e('0x48')][_0xe96e('0x98')],_['omit'](_0x3f1d4f['body'],['ids','id'])||{})[_0xe96e('0xab')](function(){return db[_0xe96e('0xac')][_0xe96e('0xa4')]({'attributes':['id',_0xe96e('0x2b'),_0xe96e('0xad')],'where':{'id':_0x3f1d4f['body'][_0xe96e('0x98')]}});})[_0xe96e('0x15')](function(_0x27aa9c){socket['emit'](_0xe96e('0xae'),{'id':Number(_0x3f1d4f[_0xe96e('0x3c')]['id']),'tags':_0x27aa9c||[]});return{'id':Number(_0x3f1d4f['params']['id']),'tags':_0x27aa9c||[]};});}})['then'](respondWithResult(_0x37bb01,null))[_0xe96e('0x1e')](handleError(_0x37bb01,null));};exports[_0xe96e('0xaf')]=function(_0xb8a649,_0x4ea8ae){return db[_0xe96e('0x34')][_0xe96e('0x46')]({'where':{'id':_0xb8a649['params']['id']}})[_0xe96e('0x15')](handleEntityNotFound(_0x4ea8ae,null))[_0xe96e('0x15')](function(_0x2a79ec){if(_0x2a79ec){return _0x2a79ec[_0xe96e('0xaf')](_0xb8a649[_0xe96e('0x3a')][_0xe96e('0x98')]);}})[_0xe96e('0x15')](respondWithStatusCode(_0x4ea8ae,null))[_0xe96e('0x1e')](handleError(_0x4ea8ae,null));};exports[_0xe96e('0x77')]=function(_0x4c275a,_0x4a3211){var _0x4decb6=moment()[_0xe96e('0xb0')]()[_0xe96e('0xb1')]();var _0x47dcc5=path[_0xe96e('0x75')](config['root'],_0xe96e('0xb2'),_0xe96e('0xb3'),_0xe96e('0xb4'));var _0x140ac5=path[_0xe96e('0x75')](config['root'],_0xe96e('0xb2'),_0xe96e('0xb3'),_0xe96e('0xb5'));var _0x414c49=path[_0xe96e('0x75')](_0x47dcc5,_0x4decb6);var _0x29dc15=util[_0xe96e('0x7b')]('transcript-%d-%s.zip',_0x4c275a[_0xe96e('0x3c')]['id'],_0x4decb6);var _0x39bcd9=path['join'](_0x47dcc5,_0x29dc15);var _0x5f240c=[];_0x5f240c[_0xe96e('0xb6')]({'model':db[_0xe96e('0x80')],'as':_0xe96e('0x80'),'attributes':['id','fullname'],'raw':!![]});_0x5f240c['push']({'model':db[_0xe96e('0x63')],'as':_0xe96e('0x64'),'attributes':['id',_0xe96e('0xb7'),_0xe96e('0xb8')],'raw':!![]});if(_0x4c275a['query'][_0xe96e('0xb5')]){_0x5f240c[_0xe96e('0xb6')]({'model':db['Attachment'],'as':_0xe96e('0x6f'),'raw':!![]});}var _0x2b6c77=[{'model':db[_0xe96e('0x60')],'as':_0xe96e('0x7f'),'attributes':['id','body',_0xe96e('0x8b'),_0xe96e('0xb9'),_0xe96e('0xa8'),_0xe96e('0xba')],'include':_0x5f240c}];_0x2b6c77['push']({'model':db[_0xe96e('0x4c')],'as':'Account','attributes':['id',_0xe96e('0x2b')]});_0x2b6c77[_0xe96e('0xb6')]({'model':db[_0xe96e('0x80')],'as':_0xe96e('0xbb'),'attributes':['id',_0xe96e('0x54')]});return db[_0xe96e('0x34')][_0xe96e('0x46')]({'where':{'id':_0x4c275a[_0xe96e('0x3c')]['id']},'include':_0x2b6c77})['then'](handleEntityNotFound(_0x4a3211,null))[_0xe96e('0x15')](function(_0xf4f2f3){if(_0xf4f2f3){var _0x35a58d=_0xf4f2f3[_0xe96e('0xbc')]({'plain':!![]});fs[_0xe96e('0xbd')](_0x414c49);var _0x2986e8={'channel':'Chat','account':_0x35a58d['Account']['name'],'agent':_0x35a58d[_0xe96e('0xbb')]?_0x35a58d[_0xe96e('0xbb')][_0xe96e('0x54')]:_0xe96e('0xbe'),'createdAt':moment(_0x35a58d['createdAt'])[_0xe96e('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe96e('0xb1')](),'closedAt':_0x35a58d[_0xe96e('0xbf')]?moment(_0x35a58d[_0xe96e('0xc0')])[_0xe96e('0x7b')](_0xe96e('0xa2'))[_0xe96e('0xb1')]():'','disposition':_0x35a58d[_0xe96e('0xc1')],'chatInfo':{'browser':_0x35a58d[_0xe96e('0xc2')],'os':_0x35a58d[_0xe96e('0xc3')],'referer':_0x35a58d['referer'],'customerIp':_0x35a58d[_0xe96e('0xc4')],'customerPort':_0x35a58d[_0xe96e('0xc5')]?_0x35a58d[_0xe96e('0xc5')]:_0xe96e('0xbe')},'messages':_(_0x35a58d[_0xe96e('0x7f')])[_0xe96e('0xc6')]()[_0xe96e('0x9f')]({'secret':![]})[_0xe96e('0x33')](function(_0x1831e3){if(_0x1831e3[_0xe96e('0x6f')]){var _0x3d3f49=path[_0xe96e('0x75')](_0x140ac5,_0x1831e3[_0xe96e('0x6f')]['basename']);if(fs['existsSync'](_0x3d3f49)){fs[_0xe96e('0xc7')](_0x3d3f49)[_0xe96e('0xc8')](fs['createWriteStream'](path[_0xe96e('0x75')](_0x414c49,_0x1831e3['Attachment'][_0xe96e('0x6d')])));}}return{'date':moment(_0x1831e3[_0xe96e('0x8b')])[_0xe96e('0x7b')](_0xe96e('0xa2'))[_0xe96e('0xb1')](),'sender':_0x1831e3['direction']===_0xe96e('0x5f')?_0x1831e3['User']?_0x1831e3['User'][_0xe96e('0x54')]:_0xe96e('0x83'):_0x1831e3[_0xe96e('0x64')][_0xe96e('0xb7')]+(_0x1831e3[_0xe96e('0x64')]['lastName']?'\x20'+_0x1831e3[_0xe96e('0x64')][_0xe96e('0xb8')]:''),'body':_0x1831e3['Attachment']?_0x1831e3['Attachment'][_0xe96e('0x6d')]:_0x1831e3[_0xe96e('0x48')],'direction':_0x1831e3[_0xe96e('0xb9')]===_0xe96e('0x5f')?'A':'C','secret':_0x1831e3[_0xe96e('0xa8')],'read':_0x1831e3[_0xe96e('0xba')],'attachment':_0x1831e3[_0xe96e('0x6f')]};})[_0xe96e('0xc9')]()};return ejs[_0xe96e('0xca')](path[_0xe96e('0x75')](config['root'],_0xe96e('0xb2'),_0xe96e('0xcb'),_0xe96e('0xcc')),{'interaction':_0x2986e8})[_0xe96e('0x15')](function(_0x826008){var _0x3d5cec=path[_0xe96e('0x75')](_0x414c49,_0xe96e('0xcd')+_0x35a58d['id']+'-'+_0x4decb6+'.pdf');var _0x31244c={'path':_0x3d5cec,'channel':_0xe96e('0xce'),'interactionId':_0x35a58d['id']};return pdf[_0xe96e('0xcf')](_0x826008,_0x31244c);})[_0xe96e('0x15')](function(){return new Promise(function(_0x3792b0,_0x178ed3){zipdir(_0x414c49,{'saveTo':_0x39bcd9},function(_0x1b464b,_0x4d55fa){if(_0x1b464b)return _0x178ed3(_0x1b464b);return _0x3792b0(_0x4d55fa);});})[_0xe96e('0x15')](function(){return new BPromise(function(_0xd121bb,_0x587609){rimraf(_0x414c49,function(_0x211e62){if(_0x211e62)_0x587609(_0x211e62);return _0xd121bb();});});})[_0xe96e('0x15')](function(){return _0x4a3211[_0xe96e('0x77')](_0x39bcd9,_0x29dc15,function(_0x214a83){if(_0x214a83){logger[_0xe96e('0x1a')](_0xe96e('0xd0'),_0x214a83);}else{fs['unlinkSync'](_0x39bcd9);}});});});}else{return _0x4a3211['sendStatus'](0xc8);}})['catch'](handleError(_0x4a3211,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index ba3abf8..467cabc 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 _0x9ee6=['../../mysqldb','ChatInteraction','ChatMessage','save','remove','getUsers','then','setDataValue','Users','map','emit','catch','hasOwnProperty','exports','events'];(function(_0xc7484e,_0x33d408){var _0x3a2ae7=function(_0xe774f7){while(--_0xe774f7){_0xc7484e['push'](_0xc7484e['shift']());}};_0x3a2ae7(++_0x33d408);}(_0x9ee6,0x11c));var _0x69ee=function(_0x37b3e5,_0x33b516){_0x37b3e5=_0x37b3e5-0x0;var _0x207f20=_0x9ee6[_0x37b3e5];return _0x207f20;};'use strict';var EventEmitter=require(_0x69ee('0x0'));var ChatInteraction=require(_0x69ee('0x1'))['db'][_0x69ee('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x69ee('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x69ee('0x4'),'afterUpdate':'update','afterDestroy':_0x69ee('0x5')};function emitEvent(_0x1b2db6){return function(_0x2f109e,_0x143bb2,_0x154891){_0x2f109e[_0x69ee('0x6')]({'attributes':['id'],'raw':!![]})[_0x69ee('0x7')](function(_0x5cd47a){_0x2f109e[_0x69ee('0x8')](_0x69ee('0x9'),_0x5cd47a[_0x69ee('0xa')](function(_0x49bdcb){return{'id':_0x49bdcb['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2f109e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x69ee('0x7')](function(_0x451a18){_0x2f109e[_0x69ee('0x8')]('unreadMessages',_0x451a18['length']);ChatInteractionEvents[_0x69ee('0xb')](_0x1b2db6+':'+_0x2f109e['id'],_0x2f109e);ChatInteractionEvents[_0x69ee('0xb')](_0x1b2db6,_0x2f109e);_0x154891(null);})[_0x69ee('0xc')](_0x154891(null));};}for(var e in events){if(events[_0x69ee('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x69ee('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x10e1=['ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x10e1,0x6f));var _0x110e=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x10e1[_0xaa1b3e];return _0x454d7d;};'use strict';var EventEmitter=require(_0x110e('0x0'));var ChatInteraction=require(_0x110e('0x1'))['db'][_0x110e('0x2')];var ChatMessage=require(_0x110e('0x1'))['db'][_0x110e('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x110e('0x4')](0x0);var events={'afterCreate':_0x110e('0x5'),'afterUpdate':_0x110e('0x6'),'afterDestroy':_0x110e('0x7')};function emitEvent(_0x37fd08){return function(_0x330b98,_0x16ebab,_0x3f6a99){_0x330b98[_0x110e('0x8')]({'attributes':['id'],'raw':!![]})[_0x110e('0x9')](function(_0x5e1860){_0x330b98['setDataValue'](_0x110e('0xa'),_0x5e1860[_0x110e('0xb')](function(_0x3deffd){return{'id':_0x3deffd['id']};}));return ChatMessage[_0x110e('0xc')]({'where':{'ChatInteractionId':_0x330b98['id'],'direction':'in','read':![]},'raw':!![]});})[_0x110e('0x9')](function(_0x5c1799){_0x330b98[_0x110e('0xd')](_0x110e('0xe'),_0x5c1799['length']);ChatInteractionEvents[_0x110e('0xf')](_0x37fd08+':'+_0x330b98['id'],_0x330b98);ChatInteractionEvents[_0x110e('0xf')](_0x37fd08,_0x330b98);_0x3f6a99(null);})[_0x110e('0x10')](_0x3f6a99(null));};}for(var e in events){if(events[_0x110e('0x11')](e)){var event=events[e];ChatInteraction[_0x110e('0x12')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 50e701c..7ae2c60 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 _0x0454=['utf8mb4','util','api','moment','request-promise','path','rimraf','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x27e208,_0x4d1182){var _0xcda460=function(_0x2b7f75){while(--_0x2b7f75){_0x27e208['push'](_0x27e208['shift']());}};_0xcda460(++_0x4d1182);}(_0x0454,0x1dd));var _0x4045=function(_0x552a93,_0x154d78){_0x552a93=_0x552a93-0x0;var _0x2a2fed=_0x0454[_0x552a93];return _0x2a2fed;};'use strict';var _=require('lodash');var util=require(_0x4045('0x0'));var logger=require('../../config/logger')(_0x4045('0x1'));var moment=require(_0x4045('0x2'));var BPromise=require('bluebird');var rp=require(_0x4045('0x3'));var fs=require('fs');var path=require(_0x4045('0x4'));var rimraf=require(_0x4045('0x5'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x4d12e4,_0x269748){return _0x4d12e4['define'](_0x4045('0x6'),attributes,{'tableName':_0x4045('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2470c3,_0x19fcad,_0x2ab312){if(_0x2470c3[_0x4045('0x8')](_0x4045('0x9'))){_0x2470c3[_0x4045('0xa')]=moment()[_0x4045('0xb')](_0x4045('0xc'));}_0x2ab312(null,_0x2470c3);}},'charset':_0x4045('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x5eed=['../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x2c8a49,_0x483a66){var _0x5f4ec3=function(_0x381a42){while(--_0x381a42){_0x2c8a49['push'](_0x2c8a49['shift']());}};_0x5f4ec3(++_0x483a66);}(_0x5eed,0x134));var _0xd5ee=function(_0x20f322,_0x3631b2){_0x20f322=_0x20f322-0x0;var _0x57b28b=_0x5eed[_0x20f322];return _0x57b28b;};'use strict';var _=require(_0xd5ee('0x0'));var util=require(_0xd5ee('0x1'));var logger=require(_0xd5ee('0x2'))('api');var moment=require(_0xd5ee('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd5ee('0x4'));var attributes=require(_0xd5ee('0x5'));module[_0xd5ee('0x6')]=function(_0x32f128,_0xcabcdf){return _0x32f128['define'](_0xd5ee('0x7'),attributes,{'tableName':_0xd5ee('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3751f6,_0x26c6f6,_0x4b6a26){if(_0x3751f6['changed']('closed')){_0x3751f6['closedAt']=moment()[_0xd5ee('0x9')](_0xd5ee('0xa'));}_0x4b6a26(null,_0x3751f6);}},'charset':_0xd5ee('0xb'),'collate':_0xd5ee('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 051c3b1..323fcf5 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 _0xedb3=['client','http','redis','defaults','localhost','register','request','then','info','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','debug','AddTagsToChatInteraction','ChatInteraction','find','addTags','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x53e661,_0xc28ce3){var _0xb5873f=function(_0x3a2af5){while(--_0x3a2af5){_0x53e661['push'](_0x53e661['shift']());}};_0xb5873f(++_0xc28ce3);}(_0xedb3,0x1a5));var _0x3edb=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xedb3[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0x3edb('0x0'));var util=require('util');var moment=require(_0x3edb('0x1'));var BPromise=require(_0x3edb('0x2'));var rs=require(_0x3edb('0x3'));var fs=require('fs');var Redis=require(_0x3edb('0x4'));var db=require(_0x3edb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3edb('0x6'))(_0x3edb('0x7'));var config=require('../../config/environment');var jayson=require(_0x3edb('0x8'));var client=jayson[_0x3edb('0x9')][_0x3edb('0xa')]({'port':0x232a});config[_0x3edb('0xb')]=_[_0x3edb('0xc')](config[_0x3edb('0xb')],{'host':_0x3edb('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3edb('0xb')]));require('./chatInteraction.socket')[_0x3edb('0xe')](socket);function respondWithRpcPromise(_0x2d8eec,_0x3f07b3,_0xdc1591){return new BPromise(function(_0x465f51,_0x2aeb00){return client[_0x3edb('0xf')](_0x2d8eec,_0xdc1591)[_0x3edb('0x10')](function(_0x80ae06){logger[_0x3edb('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x3f07b3,'request\x20sent');logger['debug'](_0x3edb('0x12'),_0x3f07b3,_0x3edb('0x13'),JSON[_0x3edb('0x14')](_0x80ae06));if(_0x80ae06[_0x3edb('0x15')]){if(_0x80ae06[_0x3edb('0x15')][_0x3edb('0x16')]===0x1f4){logger[_0x3edb('0x15')](_0x3edb('0x17'),_0x3f07b3,_0x80ae06[_0x3edb('0x15')][_0x3edb('0x18')]);return _0x2aeb00(_0x80ae06[_0x3edb('0x15')][_0x3edb('0x18')]);}logger[_0x3edb('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x3f07b3,_0x80ae06[_0x3edb('0x15')][_0x3edb('0x18')]);return _0x465f51(_0x80ae06['error'][_0x3edb('0x18')]);}else{logger[_0x3edb('0x11')](_0x3edb('0x17'),_0x3f07b3,'request\x20sent');_0x465f51(_0x80ae06[_0x3edb('0x19')][_0x3edb('0x18')]);}})[_0x3edb('0x1a')](function(_0x5899da){logger[_0x3edb('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x3f07b3,_0x5899da);_0x2aeb00(_0x5899da);});});}exports['UpdateChatInteraction']=function(_0x49e539){var _0x1515e9=this;return new Promise(function(_0x2616cd,_0x1ed4b2){return db['ChatInteraction'][_0x3edb('0x1b')](_0x49e539[_0x3edb('0x1c')],{'raw':_0x49e539[_0x3edb('0x1d')]?_0x49e539[_0x3edb('0x1d')][_0x3edb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49e539['options']?_0x49e539[_0x3edb('0x1d')][_0x3edb('0x1f')]||null:null,'attributes':_0x49e539[_0x3edb('0x1d')]?_0x49e539['options'][_0x3edb('0x20')]||null:null,'limit':_0x49e539[_0x3edb('0x1d')]?_0x49e539[_0x3edb('0x1d')][_0x3edb('0x21')]||null:null})[_0x3edb('0x10')](function(_0x39228e){logger[_0x3edb('0x11')](_0x3edb('0x22'),_0x49e539);logger[_0x3edb('0x23')](_0x3edb('0x22'),_0x49e539,JSON[_0x3edb('0x14')](_0x39228e));_0x2616cd(_0x39228e);})['catch'](function(_0xeef83f){logger[_0x3edb('0x15')](_0x3edb('0x22'),_0xeef83f[_0x3edb('0x18')],_0x49e539);_0x1ed4b2(_0x1515e9[_0x3edb('0x15')](0x1f4,_0xeef83f[_0x3edb('0x18')]));});});};exports[_0x3edb('0x24')]=function(_0x3f73ec){return new Promise(function(_0x3b4804,_0x49460e){return db[_0x3edb('0x25')][_0x3edb('0x26')]({'where':_0x3f73ec[_0x3edb('0x1d')]?_0x3f73ec[_0x3edb('0x1d')]['where']||null:null})[_0x3edb('0x10')](function(_0x12f397){if(_0x12f397){return _0x12f397[_0x3edb('0x27')](_0x3f73ec[_0x3edb('0x1c')][_0x3edb('0x28')],_['omit'](_0x3f73ec[_0x3edb('0x1c')],[_0x3edb('0x28'),'id'])||{});}})[_0x3edb('0x29')](function(_0x400dce){logger[_0x3edb('0x11')](_0x3edb('0x2a'),_0x3f73ec);logger[_0x3edb('0x23')]('AddTags',_0x3f73ec,JSON[_0x3edb('0x14')](_0x400dce));_0x3b4804(_0x400dce);})[_0x3edb('0x1a')](function(_0x58efdc){logger[_0x3edb('0x15')]('AddTags',_0x58efdc[_0x3edb('0x18')],_0x3f73ec);_0x49460e(_this[_0x3edb('0x15')](0x1f4,_0x58efdc['message']));});});};
\ No newline at end of file
+var _0xc311=['error','code','message','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','attributes','limit','AddTagsToChatInteraction','find','where','addTags','ids','omit','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1e2bed,_0x2be54b){var _0xcfab35=function(_0xf81f45){while(--_0xf81f45){_0x1e2bed['push'](_0x1e2bed['shift']());}};_0xcfab35(++_0x2be54b);}(_0xc311,0x1ac));var _0x1c31=function(_0x47deac,_0x229fd7){_0x47deac=_0x47deac-0x0;var _0x2e6b3d=_0xc311[_0x47deac];return _0x2e6b3d;};'use strict';var _=require(_0x1c31('0x0'));var util=require('util');var moment=require(_0x1c31('0x1'));var BPromise=require('bluebird');var rs=require(_0x1c31('0x2'));var fs=require('fs');var Redis=require(_0x1c31('0x3'));var db=require(_0x1c31('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c31('0x5'))(_0x1c31('0x6'));var config=require(_0x1c31('0x7'));var jayson=require(_0x1c31('0x8'));var client=jayson['client'][_0x1c31('0x9')]({'port':0x232a});config[_0x1c31('0xa')]=_[_0x1c31('0xb')](config[_0x1c31('0xa')],{'host':_0x1c31('0xc'),'port':0x18eb});var socket=require(_0x1c31('0xd'))(new Redis(config[_0x1c31('0xa')]));require('./chatInteraction.socket')[_0x1c31('0xe')](socket);function respondWithRpcPromise(_0x5d65bb,_0x576586,_0x5d182a){return new BPromise(function(_0x412615,_0x474d2d){return client[_0x1c31('0xf')](_0x5d65bb,_0x5d182a)[_0x1c31('0x10')](function(_0x3d26a3){logger[_0x1c31('0x11')](_0x1c31('0x12'),_0x576586,_0x1c31('0x13'));logger[_0x1c31('0x14')](_0x1c31('0x15'),_0x576586,_0x1c31('0x13'),JSON[_0x1c31('0x16')](_0x3d26a3));if(_0x3d26a3[_0x1c31('0x17')]){if(_0x3d26a3[_0x1c31('0x17')][_0x1c31('0x18')]===0x1f4){logger[_0x1c31('0x17')](_0x1c31('0x12'),_0x576586,_0x3d26a3[_0x1c31('0x17')][_0x1c31('0x19')]);return _0x474d2d(_0x3d26a3['error'][_0x1c31('0x19')]);}logger[_0x1c31('0x17')](_0x1c31('0x12'),_0x576586,_0x3d26a3[_0x1c31('0x17')]['message']);return _0x412615(_0x3d26a3[_0x1c31('0x17')][_0x1c31('0x19')]);}else{logger[_0x1c31('0x11')](_0x1c31('0x12'),_0x576586,_0x1c31('0x13'));_0x412615(_0x3d26a3['result'][_0x1c31('0x19')]);}})[_0x1c31('0x1a')](function(_0x342d21){logger[_0x1c31('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x576586,_0x342d21);_0x474d2d(_0x342d21);});});}exports[_0x1c31('0x1b')]=function(_0x338809){var _0x1c17da=this;return new Promise(function(_0x35ce5e,_0x3c8dfc){return db[_0x1c31('0x1c')]['update'](_0x338809[_0x1c31('0x1d')],{'raw':_0x338809['options']?_0x338809[_0x1c31('0x1e')][_0x1c31('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x338809[_0x1c31('0x1e')]?_0x338809[_0x1c31('0x1e')]['where']||null:null,'attributes':_0x338809[_0x1c31('0x1e')]?_0x338809[_0x1c31('0x1e')][_0x1c31('0x20')]||null:null,'limit':_0x338809[_0x1c31('0x1e')]?_0x338809[_0x1c31('0x1e')][_0x1c31('0x21')]||null:null})['then'](function(_0xdfbdb1){logger[_0x1c31('0x11')](_0x1c31('0x1b'),_0x338809);logger['debug'](_0x1c31('0x1b'),_0x338809,JSON[_0x1c31('0x16')](_0xdfbdb1));_0x35ce5e(_0xdfbdb1);})[_0x1c31('0x1a')](function(_0x3b474f){logger[_0x1c31('0x17')]('UpdateChatInteraction',_0x3b474f[_0x1c31('0x19')],_0x338809);_0x3c8dfc(_0x1c17da[_0x1c31('0x17')](0x1f4,_0x3b474f[_0x1c31('0x19')]));});});};exports[_0x1c31('0x22')]=function(_0x35383b){return new Promise(function(_0x2cab5f,_0x31cc91){return db[_0x1c31('0x1c')][_0x1c31('0x23')]({'where':_0x35383b['options']?_0x35383b[_0x1c31('0x1e')][_0x1c31('0x24')]||null:null})[_0x1c31('0x10')](function(_0x4beb56){if(_0x4beb56){return _0x4beb56[_0x1c31('0x25')](_0x35383b[_0x1c31('0x1d')][_0x1c31('0x26')],_[_0x1c31('0x27')](_0x35383b[_0x1c31('0x1d')],['ids','id'])||{});}})['spread'](function(_0x3ba33e){logger[_0x1c31('0x11')](_0x1c31('0x28'),_0x35383b);logger[_0x1c31('0x14')](_0x1c31('0x28'),_0x35383b,JSON[_0x1c31('0x16')](_0x3ba33e));_0x2cab5f(_0x3ba33e);})[_0x1c31('0x1a')](function(_0x3a74a0){logger[_0x1c31('0x17')](_0x1c31('0x28'),_0x3a74a0[_0x1c31('0x19')],_0x35383b);_0x31cc91(_this['error'](0x1f4,_0x3a74a0['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index ad84b5f..2f80698 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 _0x53d5=['removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove','update'];(function(_0x3eda00,_0x224b78){var _0x44b022=function(_0x377ef0){while(--_0x377ef0){_0x3eda00['push'](_0x3eda00['shift']());}};_0x44b022(++_0x224b78);}(_0x53d5,0x1cc));var _0x553d=function(_0x2ff5c6,_0x248fe2){_0x2ff5c6=_0x2ff5c6-0x0;var _0x5605f2=_0x53d5[_0x2ff5c6];return _0x5605f2;};'use strict';var ChatInteractionEvents=require(_0x553d('0x0'));var events=[_0x553d('0x1'),_0x553d('0x2'),_0x553d('0x3')];function createListener(_0x1036b6,_0x81eca2){return function(_0x36f940){_0x81eca2['emit'](_0x1036b6,_0x36f940);};}function removeListener(_0xd5d2f7,_0x9e2c06){return function(){ChatInteractionEvents[_0x553d('0x4')](_0xd5d2f7,_0x9e2c06);};}exports[_0x553d('0x5')]=function(_0x2936ad){for(var _0x5328ca=0x0,_0x1d5a5e=events[_0x553d('0x6')];_0x5328ca<_0x1d5a5e;_0x5328ca++){var _0x1c38b2=events[_0x5328ca];var _0x14ef22=createListener(_0x553d('0x7')+_0x1c38b2,_0x2936ad);ChatInteractionEvents['on'](_0x1c38b2,_0x14ef22);}};
\ No newline at end of file
+var _0x0fd1=['remove','emit','removeListener','register','length','./chatInteraction.events','save'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x0fd1,0x12b));var _0x10fd=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x0fd1[_0x1f9f37];return _0x21c080;};'use strict';var ChatInteractionEvents=require(_0x10fd('0x0'));var events=[_0x10fd('0x1'),_0x10fd('0x2'),'update'];function createListener(_0x17838b,_0x462192){return function(_0x463e65){_0x462192[_0x10fd('0x3')](_0x17838b,_0x463e65);};}function removeListener(_0x634117,_0x33b0ec){return function(){ChatInteractionEvents[_0x10fd('0x4')](_0x634117,_0x33b0ec);};}exports[_0x10fd('0x5')]=function(_0x48150b){for(var _0x35a74b=0x0,_0x1d8be4=events[_0x10fd('0x6')];_0x35a74b<_0x1d8be4;_0x35a74b++){var _0x28094f=events[_0x35a74b];var _0x362c75=createListener('chatInteraction:'+_0x28094f,_0x48150b);ChatInteractionEvents['on'](_0x28094f,_0x362c75);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index c319b98..b1df7fe 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 _0x7ec7=['/:id/attachment_download','/:id/messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','isChatInteractionAuthorized'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x7ec7,0x1d6));var _0x77ec=function(_0x1be34d,_0x1c5537){_0x1be34d=_0x1be34d-0x0;var _0x449843=_0x7ec7[_0x1be34d];return _0x449843;};'use strict';var multer=require(_0x77ec('0x0'));var util=require(_0x77ec('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x77ec('0x2'));var router=express[_0x77ec('0x3')]();var fs_extra=require(_0x77ec('0x4'));var auth=require(_0x77ec('0x5'));var interaction=require(_0x77ec('0x6'));var config=require(_0x77ec('0x7'));var controller=require(_0x77ec('0x8'));router['get']('/',auth[_0x77ec('0x9')](),controller[_0x77ec('0xa')]);router['get'](_0x77ec('0xb'),auth[_0x77ec('0x9')](),controller[_0x77ec('0xc')]);router[_0x77ec('0xd')](_0x77ec('0xe'),auth[_0x77ec('0xf')](),controller['show']);router[_0x77ec('0xd')](_0x77ec('0x10'),auth[_0x77ec('0xf')](),controller['attachmentDownload']);router[_0x77ec('0xd')](_0x77ec('0x11'),auth[_0x77ec('0x9')](),controller['getMessages']);router['get']('/:id/my_messages',auth[_0x77ec('0xf')](),controller[_0x77ec('0x12')]);router[_0x77ec('0xd')](_0x77ec('0x13'),auth[_0x77ec('0x9')](),controller['download']);router[_0x77ec('0x14')]('/',auth[_0x77ec('0x9')](),controller[_0x77ec('0x15')]);router[_0x77ec('0x14')](_0x77ec('0x16'),auth[_0x77ec('0x9')](),controller[_0x77ec('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3b18c6,_0x28b260,_0x1f6523){_0x1f6523(null,path[_0x77ec('0x18')](config[_0x77ec('0x19')],_0x77ec('0x1a')));},'filename':function(_0x964f4e,_0x301815,_0x1ae428){_0x1ae428(null,util[_0x77ec('0x1b')](_0x77ec('0x1c'),Date[_0x77ec('0x1d')](),_0x301815[_0x77ec('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x77ec('0x14')](_0x77ec('0x1f'),upload[_0x77ec('0x20')](_0x77ec('0x21')),controller[_0x77ec('0x22')]);router[_0x77ec('0x14')](_0x77ec('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x77ec('0x23')]);router[_0x77ec('0x14')](_0x77ec('0x24'),auth[_0x77ec('0x9')](),interaction[_0x77ec('0x25')](_0x77ec('0x26'),_0x77ec('0x27')),controller[_0x77ec('0x28')]);router[_0x77ec('0x29')](_0x77ec('0xe'),auth['isAuthenticated'](),interaction[_0x77ec('0x25')]('chat',_0x77ec('0x2a')),controller['update']);router['put'](_0x77ec('0x2b'),controller[_0x77ec('0x2c')]);router[_0x77ec('0x29')](_0x77ec('0x2d'),auth[_0x77ec('0xf')](),controller[_0x77ec('0x2e')]);router[_0x77ec('0x29')](_0x77ec('0x2f'),controller[_0x77ec('0x30')]);router[_0x77ec('0x31')](_0x77ec('0xe'),auth[_0x77ec('0x9')](),interaction[_0x77ec('0x25')](_0x77ec('0x26'),_0x77ec('0x32')),controller[_0x77ec('0x33')]);router[_0x77ec('0x31')](_0x77ec('0x24'),auth['isAuthenticated'](),controller[_0x77ec('0x34')]);module[_0x77ec('0x35')]=router;
\ No newline at end of file
+var _0xf407=['isAuthenticated','index','/:id','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','join','root','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','abandon','close','delete','chat','chatinteraction:destroy','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get'];(function(_0x37f94c,_0x474dd6){var _0x4452a4=function(_0x30da23){while(--_0x30da23){_0x37f94c['push'](_0x37f94c['shift']());}};_0x4452a4(++_0x474dd6);}(_0xf407,0xc2));var _0x7f40=function(_0x55b6e1,_0x37c619){_0x55b6e1=_0x55b6e1-0x0;var _0x410f04=_0xf407[_0x55b6e1];return _0x410f04;};'use strict';var multer=require('multer');var util=require(_0x7f40('0x0'));var path=require(_0x7f40('0x1'));var timeout=require(_0x7f40('0x2'));var express=require(_0x7f40('0x3'));var router=express['Router']();var fs_extra=require(_0x7f40('0x4'));var auth=require(_0x7f40('0x5'));var interaction=require(_0x7f40('0x6'));var config=require(_0x7f40('0x7'));var controller=require(_0x7f40('0x8'));router[_0x7f40('0x9')]('/',auth[_0x7f40('0xa')](),controller[_0x7f40('0xb')]);router[_0x7f40('0x9')]('/describe',auth[_0x7f40('0xa')](),controller['describe']);router['get'](_0x7f40('0xc'),auth['isChatInteractionAuthorized'](),controller['show']);router[_0x7f40('0x9')](_0x7f40('0xd'),auth[_0x7f40('0xe')](),controller[_0x7f40('0xf')]);router[_0x7f40('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x7f40('0x10')]);router[_0x7f40('0x9')](_0x7f40('0x11'),auth[_0x7f40('0xe')](),controller[_0x7f40('0x12')]);router[_0x7f40('0x9')]('/:id/download',auth[_0x7f40('0xa')](),controller[_0x7f40('0x13')]);router[_0x7f40('0x14')]('/',auth[_0x7f40('0xa')](),controller[_0x7f40('0x15')]);router[_0x7f40('0x14')](_0x7f40('0x16'),auth[_0x7f40('0xa')](),controller[_0x7f40('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x25a5b9,_0x531a87,_0x1fa906){_0x1fa906(null,path[_0x7f40('0x18')](config[_0x7f40('0x19')],'server/files/attachments/'));},'filename':function(_0x64c9fc,_0xe7c7ca,_0x2ae059){_0x2ae059(null,util[_0x7f40('0x1a')](_0x7f40('0x1b'),Date[_0x7f40('0x1c')](),_0xe7c7ca[_0x7f40('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7f40('0x14')](_0x7f40('0x1e'),upload[_0x7f40('0x1f')](_0x7f40('0x20')),controller[_0x7f40('0x21')]);router['post'](_0x7f40('0x22'),auth['isChatInteractionAuthorized'](),controller[_0x7f40('0x23')]);router[_0x7f40('0x14')](_0x7f40('0x24'),auth[_0x7f40('0xa')](),interaction[_0x7f40('0x25')]('chat',_0x7f40('0x26')),controller[_0x7f40('0x27')]);router[_0x7f40('0x28')](_0x7f40('0xc'),auth[_0x7f40('0xa')](),interaction[_0x7f40('0x25')]('chat',_0x7f40('0x29')),controller[_0x7f40('0x2a')]);router[_0x7f40('0x28')](_0x7f40('0x2b'),controller['customUpdate']);router[_0x7f40('0x28')]('/:id/abandon',auth[_0x7f40('0xe')](),controller[_0x7f40('0x2c')]);router[_0x7f40('0x28')]('/:id/close',controller[_0x7f40('0x2d')]);router[_0x7f40('0x2e')](_0x7f40('0xc'),auth[_0x7f40('0xa')](),interaction['tracked'](_0x7f40('0x2f'),_0x7f40('0x30')),controller[_0x7f40('0x31')]);router[_0x7f40('0x2e')]('/:id/tags',auth[_0x7f40('0xa')](),controller['removeTags']);module[_0x7f40('0x32')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index aad828a..98b0d2b 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 _0x610e=['exports','medium','BOOLEAN','sequelize'];(function(_0x31fb32,_0x52dd18){var _0x3ee276=function(_0x4c53a6){while(--_0x4c53a6){_0x31fb32['push'](_0x31fb32['shift']());}};_0x3ee276(++_0x52dd18);}(_0x610e,0x73));var _0xe610=function(_0x3946f0,_0x50663c){_0x3946f0=_0x3946f0-0x0;var _0x5dfae0=_0x610e[_0x3946f0];return _0x5dfae0;};'use strict';var Sequelize=require(_0xe610('0x0'));module[_0xe610('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe610('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe610('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x5e39=['BOOLEAN','INTEGER','sequelize','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5e39,0x19e));var _0x95e3=function(_0x20e8d8,_0x4e5d66){_0x20e8d8=_0x20e8d8-0x0;var _0x3ed8dd=_0x5e39[_0x20e8d8];return _0x3ed8dd;};'use strict';var Sequelize=require(_0x95e3('0x0'));module['exports']={'body':{'type':Sequelize[_0x95e3('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x95e3('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x95e3('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index a5adc19..f7d78bf 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 _0x950a=['create','body','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','user','fullname','userpic','online','showWebBar','-online','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','length','role','resourceId','push','FromId','ToId','read','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find'];(function(_0x1abad1,_0x54ec22){var _0x46639a=function(_0x284108){while(--_0x284108){_0x1abad1['push'](_0x1abad1['shift']());}};_0x46639a(++_0x54ec22);}(_0x950a,0x100));var _0xa950=function(_0x31d353,_0x438585){_0x31d353=_0x31d353-0x0;var _0x46ace9=_0x950a[_0x31d353];return _0x46ace9;};'use strict';var emlformat=require(_0xa950('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa950('0x1'));var jsonpatch=require(_0xa950('0x2'));var rp=require(_0xa950('0x3'));var moment=require(_0xa950('0x4'));var BPromise=require(_0xa950('0x5'));var Mustache=require(_0xa950('0x6'));var util=require(_0xa950('0x7'));var path=require(_0xa950('0x8'));var sox=require('sox');var csv=require(_0xa950('0x9'));var ejs=require(_0xa950('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa950('0xb'));var squel=require(_0xa950('0xc'));var crypto=require(_0xa950('0xd'));var jsforce=require(_0xa950('0xe'));var deskjs=require(_0xa950('0xf'));var toCsv=require(_0xa950('0x9'));var querystring=require(_0xa950('0x10'));var Papa=require(_0xa950('0x11'));var Redis=require(_0xa950('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa950('0x13'));var as=require(_0xa950('0x14'));var hardwareService=require(_0xa950('0x15'));var logger=require(_0xa950('0x16'))(_0xa950('0x17'));var utils=require(_0xa950('0x18'));var config=require(_0xa950('0x19'));var licenseUtil=require(_0xa950('0x1a'));var db=require(_0xa950('0x1b'))['db'];config[_0xa950('0x1c')]=_[_0xa950('0x1d')](config[_0xa950('0x1c')],{'host':_0xa950('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa950('0x1f'))[_0xa950('0x20')](socket);function respondWithStatusCode(_0x19e8ef,_0x3922fc){_0x3922fc=_0x3922fc||0xcc;return function(_0x2c6575){if(_0x2c6575){return _0x19e8ef[_0xa950('0x21')](_0x3922fc);}return _0x19e8ef[_0xa950('0x22')](_0x3922fc)[_0xa950('0x23')]();};}function respondWithResult(_0x596fec,_0x557e77){_0x557e77=_0x557e77||0xc8;return function(_0x11a870){if(_0x11a870){return _0x596fec[_0xa950('0x22')](_0x557e77)[_0xa950('0x24')](_0x11a870);}};}function respondWithFilteredResult(_0x3737cb,_0x463a33){return function(_0x12c4cf){if(_0x12c4cf){var _0x5c2edd=typeof _0x463a33[_0xa950('0x25')]==='undefined'&&typeof _0x463a33[_0xa950('0x26')]===_0xa950('0x27');var _0x4e552e=_0x12c4cf[_0xa950('0x28')];var _0x568c96=_0x5c2edd?0x0:_0x463a33[_0xa950('0x25')];var _0x39c529=_0x5c2edd?_0x12c4cf[_0xa950('0x28')]:_0x463a33[_0xa950('0x25')]+_0x463a33[_0xa950('0x26')];var _0x47f9ae;if(_0x39c529>=_0x4e552e){_0x39c529=_0x4e552e;_0x47f9ae=0xc8;}else{_0x47f9ae=0xce;}_0x3737cb['status'](_0x47f9ae);return _0x3737cb['set'](_0xa950('0x29'),_0x568c96+'-'+_0x39c529+'/'+_0x4e552e)[_0xa950('0x24')](_0x12c4cf);}return null;};}function patchUpdates(_0x52ec4d){return function(_0x58db42){try{jsonpatch[_0xa950('0x2a')](_0x58db42,_0x52ec4d,!![]);}catch(_0x4aa1dd){return BPromise[_0xa950('0x2b')](_0x4aa1dd);}return _0x58db42[_0xa950('0x2c')]();};}function saveUpdates(_0x415b0a,_0x653ed7){return function(_0x5af40b){if(_0x5af40b){return _0x5af40b[_0xa950('0x2d')](_0x415b0a)[_0xa950('0x2e')](function(_0x306807){return _0x306807;});}return null;};}function removeEntity(_0x57582c,_0x1e1529){return function(_0x357f71){if(_0x357f71){return _0x357f71[_0xa950('0x2f')]()[_0xa950('0x2e')](function(){_0x57582c['status'](0xcc)[_0xa950('0x23')]();});}};}function handleEntityNotFound(_0x13dce0,_0x37008f){return function(_0xb14b4c){if(!_0xb14b4c){_0x13dce0['sendStatus'](0x194);}return _0xb14b4c;};}function handleError(_0x4543b7,_0x3e4824){_0x3e4824=_0x3e4824||0x1f4;return function(_0x116c24){logger['error'](_0x116c24[_0xa950('0x30')]);if(_0x116c24[_0xa950('0x31')]){delete _0x116c24[_0xa950('0x31')];}_0x4543b7[_0xa950('0x22')](_0x3e4824)[_0xa950('0x32')](_0x116c24);};}exports['index']=function(_0x152aaa,_0xfa0333){var _0x271e87={},_0x331989={},_0x1b6a2a={'count':0x0,'rows':[]};var _0x1e3157=_[_0xa950('0x33')](db[_0xa950('0x34')][_0xa950('0x35')],function(_0x9b8edb){return{'name':_0x9b8edb[_0xa950('0x36')],'type':_0x9b8edb[_0xa950('0x37')][_0xa950('0x38')]};});_0x331989[_0xa950('0x39')]=_['map'](_0x1e3157,_0xa950('0x31'));_0x331989['query']=_[_0xa950('0x3a')](_0x152aaa['query']);_0x331989[_0xa950('0x3b')]=_[_0xa950('0x3c')](_0x331989[_0xa950('0x39')],_0x331989[_0xa950('0x3d')]);_0x271e87[_0xa950('0x3e')]=_[_0xa950('0x3c')](_0x331989[_0xa950('0x39')],qs[_0xa950('0x3f')](_0x152aaa['query'][_0xa950('0x3f')]));_0x271e87['attributes']=_0x271e87[_0xa950('0x3e')]['length']?_0x271e87['attributes']:_0x331989[_0xa950('0x39')];if(!_0x152aaa[_0xa950('0x3d')]['hasOwnProperty'](_0xa950('0x40'))){_0x271e87[_0xa950('0x26')]=qs[_0xa950('0x26')](_0x152aaa[_0xa950('0x3d')][_0xa950('0x26')]);_0x271e87[_0xa950('0x25')]=qs[_0xa950('0x25')](_0x152aaa[_0xa950('0x3d')][_0xa950('0x25')]);}_0x271e87['order']=qs['sort'](_0x152aaa[_0xa950('0x3d')][_0xa950('0x41')]);_0x271e87[_0xa950('0x42')]=qs[_0xa950('0x3b')](_['pick'](_0x152aaa[_0xa950('0x3d')],_0x331989[_0xa950('0x3b')]),_0x1e3157);if(_0x152aaa['query'][_0xa950('0x43')]){_0x271e87[_0xa950('0x42')]=_[_0xa950('0x44')](_0x271e87['where'],{'$or':_[_0xa950('0x33')](_0x1e3157,function(_0x115b23){if(_0x115b23[_0xa950('0x37')]!==_0xa950('0x45')){var _0x1eb499={};_0x1eb499[_0x115b23[_0xa950('0x31')]]={'$like':'%'+_0x152aaa[_0xa950('0x3d')][_0xa950('0x43')]+'%'};return _0x1eb499;}})});}_0x271e87=_[_0xa950('0x44')]({},_0x271e87,_0x152aaa[_0xa950('0x46')]);var _0x2eec53={'where':_0x271e87['where']};return db[_0xa950('0x34')]['count'](_0x2eec53)['then'](function(_0x4643c6){_0x1b6a2a[_0xa950('0x28')]=_0x4643c6;if(_0x152aaa[_0xa950('0x3d')][_0xa950('0x47')]){_0x271e87[_0xa950('0x48')]=[{'all':!![]}];}return db[_0xa950('0x34')]['findAll'](_0x271e87);})[_0xa950('0x2e')](function(_0x15fa60){_0x1b6a2a['rows']=_0x15fa60;return _0x1b6a2a;})['then'](respondWithFilteredResult(_0xfa0333,_0x271e87))[_0xa950('0x49')](handleError(_0xfa0333,null));};exports[_0xa950('0x4a')]=function(_0xf40575,_0x4e2c23){var _0x2ffd19={'raw':!![],'where':{'id':_0xf40575[_0xa950('0x4b')]['id']}},_0x1e6ac7={};_0x1e6ac7[_0xa950('0x39')]=_[_0xa950('0x3a')](db[_0xa950('0x34')]['rawAttributes']);_0x1e6ac7[_0xa950('0x3d')]=_[_0xa950('0x3a')](_0xf40575[_0xa950('0x3d')]);_0x1e6ac7['filters']=_[_0xa950('0x3c')](_0x1e6ac7[_0xa950('0x39')],_0x1e6ac7[_0xa950('0x3d')]);_0x2ffd19[_0xa950('0x3e')]=_[_0xa950('0x3c')](_0x1e6ac7['model'],qs[_0xa950('0x3f')](_0xf40575[_0xa950('0x3d')][_0xa950('0x3f')]));_0x2ffd19[_0xa950('0x3e')]=_0x2ffd19['attributes']['length']?_0x2ffd19['attributes']:_0x1e6ac7[_0xa950('0x39')];if(_0xf40575[_0xa950('0x3d')]['includeAll']){_0x2ffd19[_0xa950('0x48')]=[{'all':!![]}];}_0x2ffd19=_['merge']({},_0x2ffd19,_0xf40575[_0xa950('0x46')]);return db['ChatInternalMessage'][_0xa950('0x4c')](_0x2ffd19)['then'](handleEntityNotFound(_0x4e2c23,null))[_0xa950('0x2e')](respondWithResult(_0x4e2c23,null))['catch'](handleError(_0x4e2c23,null));};exports[_0xa950('0x4d')]=function(_0x26e9c0,_0x3c600a){return db['ChatInternalMessage'][_0xa950('0x4d')](_0x26e9c0['body'],{})[_0xa950('0x2e')](respondWithResult(_0x3c600a,0xc9))['catch'](handleError(_0x3c600a,null));};exports[_0xa950('0x2d')]=function(_0x2f27a8,_0x291017){if(_0x2f27a8[_0xa950('0x4e')]['id']){delete _0x2f27a8['body']['id'];}return db[_0xa950('0x34')][_0xa950('0x4c')]({'where':{'id':_0x2f27a8['params']['id']}})[_0xa950('0x2e')](handleEntityNotFound(_0x291017,null))[_0xa950('0x2e')](saveUpdates(_0x2f27a8[_0xa950('0x4e')],null))[_0xa950('0x2e')](respondWithResult(_0x291017,null))[_0xa950('0x49')](handleError(_0x291017,null));};exports[_0xa950('0x2f')]=function(_0x51481a,_0x39c125){return db[_0xa950('0x34')][_0xa950('0x4c')]({'where':{'id':_0x51481a[_0xa950('0x4b')]['id']}})[_0xa950('0x2e')](handleEntityNotFound(_0x39c125,null))[_0xa950('0x2e')](removeEntity(_0x39c125,null))[_0xa950('0x49')](handleError(_0x39c125,null));};exports[_0xa950('0x4f')]=function(_0x5aaa84,_0x23a211){return db[_0xa950('0x34')][_0xa950('0x4f')]()[_0xa950('0x2e')](respondWithResult(_0x23a211,null))[_0xa950('0x49')](handleError(_0x23a211,null));};function wrapUser(_0x3d7e57){return function(_0x3e511c){var _0xf0a8a=_0x3d7e57[_0xa950('0x50')]({'plain':!![]});_0xf0a8a[_0xa950('0x51')]=[];if(_0x3e511c){_0xf0a8a['lastMessageAt']=_0x3e511c[_0xa950('0x52')];_0xf0a8a[_0xa950('0x53')]=_0x3e511c;}else{_0xf0a8a[_0xa950('0x54')]=moment(0x0)[_0xa950('0x55')](_0xa950('0x56'));_0xf0a8a[_0xa950('0x53')]={};}return _0xf0a8a;};}exports[_0xa950('0x57')]=function(_0x10fa02,_0x58fd84,_0x5c86c9){var _0x1db7ac=[];return db[_0xa950('0x58')][_0xa950('0x59')]({'where':{'role':[_0xa950('0x5a'),'admin',_0xa950('0x5b')]},'attributes':['id',_0xa950('0x5c'),_0xa950('0x31'),'role',_0xa950('0x5d'),'internal',_0xa950('0x5e'),'lastLoginAt','allowmessenger',_0xa950('0x5f')],'order':qs[_0xa950('0x41')](_0xa950('0x60')),'include':[{'model':db['VoiceQueue'],'as':_0xa950('0x61'),'attributes':['id','name',_0xa950('0x37')],'through':{'attributes':[]}}]})[_0xa950('0x2e')](function(_0x57ae0f){if(_0x57ae0f){var _0xee450=_0x10fa02[_0xa950('0x5b')][_0xa950('0x50')]({'plain':!![]});if(!_0xee450)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xee450['role']===_0xa950('0x5b')){return db[_0xa950('0x62')][_0xa950('0x4c')]({'where':{'name':_0xa950('0x63'),'userProfileId':_0xee450[_0xa950('0x64')]},'raw':!![]})['then'](function(_0x290162){if(_0x290162){if(_0x290162[_0xa950('0x65')]===0x0){return db[_0xa950('0x66')][_0xa950('0x59')]({'where':{'sectionId':_0x290162['id']},'raw':!![]})[_0xa950('0x2e')](function(_0xcf5da){var _0x301e88=[];if(_[_0xa950('0x67')](_0xcf5da)){_0x301e88=_[_0xa950('0x43')](_0x57ae0f,function(_0x347e9d){if(_0x347e9d['role']!=='agent'){return _0x347e9d;}});return _0x301e88;}else{for(var _0x4c4e6d=0x0;_0x4c4e6d<_0x57ae0f[_0xa950('0x68')];_0x4c4e6d++){var _0x56588d=_0x57ae0f[_0x4c4e6d];if(_0x56588d[_0xa950('0x69')]===_0xa950('0x5a')){var _0x11e25d=_['find'](_0xcf5da,function(_0x5cd86f){return _0x5cd86f[_0xa950('0x6a')]===_0x56588d['id'];});if(_0x11e25d)_0x301e88[_0xa950('0x6b')](_0x56588d);}else{_0x301e88[_0xa950('0x6b')](_0x56588d);}}return _0x301e88;}});}else{return _0x57ae0f;}}else{var _0x5c81a2=_['filter'](_0x57ae0f,function(_0x2ce80c){if(_0x2ce80c['role']!==_0xa950('0x5a')){return _0x2ce80c;}});return _0x5c81a2;}});}else{return _0x57ae0f;}}})[_0xa950('0x2e')](function(_0x17e710){var _0x115352=[];if(_0x17e710){_0x1db7ac=_0x17e710;for(var _0x5a6943=0x0;_0x5a6943<_0x17e710[_0xa950('0x68')];_0x5a6943+=0x1){_0x1db7ac[_0x5a6943][_0xa950('0x51')]=[];_0x115352['push'](db[_0xa950('0x34')][_0xa950('0x4c')]({'where':{'FromId':[_0x10fa02[_0xa950('0x5b')]['id'],_0x17e710[_0x5a6943]['id']],'ToId':[_0x10fa02[_0xa950('0x5b')]['id'],_0x17e710[_0x5a6943]['id']],'ChatGroupId':null},'attributes':['id',_0xa950('0x52'),_0xa950('0x6c'),_0xa950('0x6d'),_0xa950('0x6e'),_0xa950('0x4e')],'order':qs[_0xa950('0x41')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa950('0x2e')](wrapUser(_0x17e710[_0x5a6943])));}return BPromise['all'](_0x115352);}return[];})[_0xa950('0x2e')](function(_0x220b05){return{'rows':_0x220b05,'count':_0x220b05[_0xa950('0x68')]};})[_0xa950('0x2e')](respondWithResult(_0x58fd84,null))[_0xa950('0x49')](handleError(_0x58fd84,null));};
\ No newline at end of file
+var _0x36f6=['nolimit','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','options','create','body','update','find','params','describe','messages','lastMessageAt','createdAt','format','lastMessage','User','agent','role','userpic','internal','online','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','type','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','all','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','destroy','then','error','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x4ec322,_0x4192ca){var _0x24aa83=function(_0x4f5f7a){while(--_0x4f5f7a){_0x4ec322['push'](_0x4ec322['shift']());}};_0x24aa83(++_0x4192ca);}(_0x36f6,0x103));var _0x636f=function(_0x2a9548,_0x2742f6){_0x2a9548=_0x2a9548-0x0;var _0xf55c55=_0x36f6[_0x2a9548];return _0xf55c55;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x636f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x636f('0x1'));var rp=require('request-promise');var moment=require(_0x636f('0x2'));var BPromise=require(_0x636f('0x3'));var Mustache=require(_0x636f('0x4'));var util=require(_0x636f('0x5'));var path=require('path');var sox=require(_0x636f('0x6'));var csv=require('to-csv');var ejs=require(_0x636f('0x7'));var fs=require('fs');var fs_extra=require(_0x636f('0x8'));var _=require('lodash');var squel=require(_0x636f('0x9'));var crypto=require(_0x636f('0xa'));var jsforce=require(_0x636f('0xb'));var deskjs=require(_0x636f('0xc'));var toCsv=require(_0x636f('0xd'));var querystring=require(_0x636f('0xe'));var Papa=require('papaparse');var Redis=require(_0x636f('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x636f('0x10'));var hardwareService=require(_0x636f('0x11'));var logger=require('../../config/logger')(_0x636f('0x12'));var utils=require(_0x636f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x636f('0x14'));var db=require(_0x636f('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x636f('0x16'),'port':0x18eb});var socket=require(_0x636f('0x17'))(new Redis(config[_0x636f('0x18')]));require(_0x636f('0x19'))[_0x636f('0x1a')](socket);function respondWithStatusCode(_0x4e5b79,_0x29433b){_0x29433b=_0x29433b||0xcc;return function(_0x5297d2){if(_0x5297d2){return _0x4e5b79[_0x636f('0x1b')](_0x29433b);}return _0x4e5b79[_0x636f('0x1c')](_0x29433b)[_0x636f('0x1d')]();};}function respondWithResult(_0x2fb846,_0x5201f4){_0x5201f4=_0x5201f4||0xc8;return function(_0x190208){if(_0x190208){return _0x2fb846[_0x636f('0x1c')](_0x5201f4)[_0x636f('0x1e')](_0x190208);}};}function respondWithFilteredResult(_0x52cb39,_0x16d460){return function(_0xc8f2fd){if(_0xc8f2fd){var _0x33730c=typeof _0x16d460['offset']===_0x636f('0x1f')&&typeof _0x16d460[_0x636f('0x20')]===_0x636f('0x1f');var _0x190a58=_0xc8f2fd[_0x636f('0x21')];var _0x235b3a=_0x33730c?0x0:_0x16d460[_0x636f('0x22')];var _0x150983=_0x33730c?_0xc8f2fd[_0x636f('0x21')]:_0x16d460[_0x636f('0x22')]+_0x16d460[_0x636f('0x20')];var _0xd25ba9;if(_0x150983>=_0x190a58){_0x150983=_0x190a58;_0xd25ba9=0xc8;}else{_0xd25ba9=0xce;}_0x52cb39[_0x636f('0x1c')](_0xd25ba9);return _0x52cb39[_0x636f('0x23')](_0x636f('0x24'),_0x235b3a+'-'+_0x150983+'/'+_0x190a58)[_0x636f('0x1e')](_0xc8f2fd);}return null;};}function patchUpdates(_0x5b9cdd){return function(_0x599c7e){try{jsonpatch['apply'](_0x599c7e,_0x5b9cdd,!![]);}catch(_0x5ee310){return BPromise[_0x636f('0x25')](_0x5ee310);}return _0x599c7e[_0x636f('0x26')]();};}function saveUpdates(_0x1f51b5,_0x5eb4cb){return function(_0x16ff4b){if(_0x16ff4b){return _0x16ff4b['update'](_0x1f51b5)['then'](function(_0x1fbbb8){return _0x1fbbb8;});}return null;};}function removeEntity(_0x49d207,_0x30dd8d){return function(_0x3b35c2){if(_0x3b35c2){return _0x3b35c2[_0x636f('0x27')]()[_0x636f('0x28')](function(){_0x49d207[_0x636f('0x1c')](0xcc)[_0x636f('0x1d')]();});}};}function handleEntityNotFound(_0x60e9bb,_0x504391){return function(_0x1a488c){if(!_0x1a488c){_0x60e9bb['sendStatus'](0x194);}return _0x1a488c;};}function handleError(_0xc930eb,_0x48a5b8){_0x48a5b8=_0x48a5b8||0x1f4;return function(_0x32fc6a){logger[_0x636f('0x29')](_0x32fc6a[_0x636f('0x2a')]);if(_0x32fc6a[_0x636f('0x2b')]){delete _0x32fc6a[_0x636f('0x2b')];}_0xc930eb['status'](_0x48a5b8)[_0x636f('0x2c')](_0x32fc6a);};}exports['index']=function(_0x169342,_0x35416e){var _0x457113={},_0x13772a={},_0x40f256={'count':0x0,'rows':[]};var _0x2d7d67=_[_0x636f('0x2d')](db[_0x636f('0x2e')][_0x636f('0x2f')],function(_0xb20b20){return{'name':_0xb20b20[_0x636f('0x30')],'type':_0xb20b20['type'][_0x636f('0x31')]};});_0x13772a[_0x636f('0x32')]=_[_0x636f('0x2d')](_0x2d7d67,'name');_0x13772a[_0x636f('0x33')]=_[_0x636f('0x34')](_0x169342[_0x636f('0x33')]);_0x13772a[_0x636f('0x35')]=_[_0x636f('0x36')](_0x13772a[_0x636f('0x32')],_0x13772a[_0x636f('0x33')]);_0x457113[_0x636f('0x37')]=_[_0x636f('0x36')](_0x13772a[_0x636f('0x32')],qs[_0x636f('0x38')](_0x169342[_0x636f('0x33')]['fields']));_0x457113['attributes']=_0x457113[_0x636f('0x37')][_0x636f('0x39')]?_0x457113[_0x636f('0x37')]:_0x13772a['model'];if(!_0x169342['query'][_0x636f('0x3a')](_0x636f('0x3b'))){_0x457113[_0x636f('0x20')]=qs[_0x636f('0x20')](_0x169342[_0x636f('0x33')][_0x636f('0x20')]);_0x457113['offset']=qs[_0x636f('0x22')](_0x169342['query'][_0x636f('0x22')]);}_0x457113['order']=qs[_0x636f('0x3c')](_0x169342[_0x636f('0x33')][_0x636f('0x3c')]);_0x457113['where']=qs[_0x636f('0x35')](_[_0x636f('0x3d')](_0x169342['query'],_0x13772a['filters']),_0x2d7d67);if(_0x169342['query']['filter']){_0x457113[_0x636f('0x3e')]=_[_0x636f('0x3f')](_0x457113[_0x636f('0x3e')],{'$or':_[_0x636f('0x2d')](_0x2d7d67,function(_0x4a0bb2){if(_0x4a0bb2['type']!==_0x636f('0x40')){var _0x2e9654={};_0x2e9654[_0x4a0bb2['name']]={'$like':'%'+_0x169342[_0x636f('0x33')][_0x636f('0x41')]+'%'};return _0x2e9654;}})});}_0x457113=_[_0x636f('0x3f')]({},_0x457113,_0x169342['options']);var _0x537c16={'where':_0x457113[_0x636f('0x3e')]};return db[_0x636f('0x2e')][_0x636f('0x21')](_0x537c16)[_0x636f('0x28')](function(_0x17d552){_0x40f256[_0x636f('0x21')]=_0x17d552;if(_0x169342[_0x636f('0x33')][_0x636f('0x42')]){_0x457113[_0x636f('0x43')]=[{'all':!![]}];}return db[_0x636f('0x2e')][_0x636f('0x44')](_0x457113);})[_0x636f('0x28')](function(_0x2a38df){_0x40f256[_0x636f('0x45')]=_0x2a38df;return _0x40f256;})[_0x636f('0x28')](respondWithFilteredResult(_0x35416e,_0x457113))[_0x636f('0x46')](handleError(_0x35416e,null));};exports['show']=function(_0x504dd4,_0xeb1b69){var _0x3bee5c={'raw':!![],'where':{'id':_0x504dd4['params']['id']}},_0x193aa8={};_0x193aa8[_0x636f('0x32')]=_[_0x636f('0x34')](db[_0x636f('0x2e')][_0x636f('0x2f')]);_0x193aa8[_0x636f('0x33')]=_[_0x636f('0x34')](_0x504dd4['query']);_0x193aa8[_0x636f('0x35')]=_['intersection'](_0x193aa8[_0x636f('0x32')],_0x193aa8[_0x636f('0x33')]);_0x3bee5c[_0x636f('0x37')]=_[_0x636f('0x36')](_0x193aa8['model'],qs['fields'](_0x504dd4['query'][_0x636f('0x38')]));_0x3bee5c[_0x636f('0x37')]=_0x3bee5c[_0x636f('0x37')][_0x636f('0x39')]?_0x3bee5c[_0x636f('0x37')]:_0x193aa8['model'];if(_0x504dd4[_0x636f('0x33')][_0x636f('0x42')]){_0x3bee5c[_0x636f('0x43')]=[{'all':!![]}];}_0x3bee5c=_[_0x636f('0x3f')]({},_0x3bee5c,_0x504dd4[_0x636f('0x47')]);return db[_0x636f('0x2e')]['find'](_0x3bee5c)[_0x636f('0x28')](handleEntityNotFound(_0xeb1b69,null))[_0x636f('0x28')](respondWithResult(_0xeb1b69,null))[_0x636f('0x46')](handleError(_0xeb1b69,null));};exports[_0x636f('0x48')]=function(_0x4ca429,_0x4b07a5){return db['ChatInternalMessage']['create'](_0x4ca429[_0x636f('0x49')],{})['then'](respondWithResult(_0x4b07a5,0xc9))[_0x636f('0x46')](handleError(_0x4b07a5,null));};exports[_0x636f('0x4a')]=function(_0x45664f,_0x542365){if(_0x45664f[_0x636f('0x49')]['id']){delete _0x45664f['body']['id'];}return db[_0x636f('0x2e')][_0x636f('0x4b')]({'where':{'id':_0x45664f['params']['id']}})[_0x636f('0x28')](handleEntityNotFound(_0x542365,null))[_0x636f('0x28')](saveUpdates(_0x45664f[_0x636f('0x49')],null))[_0x636f('0x28')](respondWithResult(_0x542365,null))['catch'](handleError(_0x542365,null));};exports['destroy']=function(_0xcf7537,_0x13e7ea){return db[_0x636f('0x2e')][_0x636f('0x4b')]({'where':{'id':_0xcf7537[_0x636f('0x4c')]['id']}})[_0x636f('0x28')](handleEntityNotFound(_0x13e7ea,null))[_0x636f('0x28')](removeEntity(_0x13e7ea,null))[_0x636f('0x46')](handleError(_0x13e7ea,null));};exports['describe']=function(_0x13fb11,_0x367649){return db[_0x636f('0x2e')][_0x636f('0x4d')]()[_0x636f('0x28')](respondWithResult(_0x367649,null))[_0x636f('0x46')](handleError(_0x367649,null));};function wrapUser(_0x4b43d5){return function(_0x3c726a){var _0x5b44ef=_0x4b43d5['get']({'plain':!![]});_0x5b44ef[_0x636f('0x4e')]=[];if(_0x3c726a){_0x5b44ef[_0x636f('0x4f')]=_0x3c726a[_0x636f('0x50')];_0x5b44ef['lastMessage']=_0x3c726a;}else{_0x5b44ef['lastMessageAt']=moment(0x0)[_0x636f('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x5b44ef[_0x636f('0x52')]={};}return _0x5b44ef;};}exports['getUsers']=function(_0x367443,_0x5a6218,_0x51bdc7){var _0x3b7629=[];return db[_0x636f('0x53')][_0x636f('0x44')]({'where':{'role':[_0x636f('0x54'),'admin','user']},'attributes':['id','fullname',_0x636f('0x2b'),_0x636f('0x55'),_0x636f('0x56'),_0x636f('0x57'),_0x636f('0x58'),_0x636f('0x59'),'allowmessenger',_0x636f('0x5a')],'order':qs[_0x636f('0x3c')]('-online'),'include':[{'model':db[_0x636f('0x5b')],'as':_0x636f('0x5c'),'attributes':['id',_0x636f('0x2b'),_0x636f('0x5d')],'through':{'attributes':[]}}]})[_0x636f('0x28')](function(_0x392225){if(_0x392225){var _0x5f0fa5=_0x367443['user'][_0x636f('0x5e')]({'plain':!![]});if(!_0x5f0fa5)throw new Error(_0x636f('0x5f'));if(_0x5f0fa5[_0x636f('0x55')]===_0x636f('0x60')){return db[_0x636f('0x61')][_0x636f('0x4b')]({'where':{'name':'Agents','userProfileId':_0x5f0fa5[_0x636f('0x62')]},'raw':!![]})[_0x636f('0x28')](function(_0x1a7dbe){if(_0x1a7dbe){if(_0x1a7dbe[_0x636f('0x63')]===0x0){return db[_0x636f('0x64')]['findAll']({'where':{'sectionId':_0x1a7dbe['id']},'raw':!![]})[_0x636f('0x28')](function(_0x506fe0){var _0x5c6a19=[];if(_['isEmpty'](_0x506fe0)){_0x5c6a19=_[_0x636f('0x41')](_0x392225,function(_0x1b6cbc){if(_0x1b6cbc['role']!==_0x636f('0x54')){return _0x1b6cbc;}});return _0x5c6a19;}else{for(var _0x65e34=0x0;_0x65e34<_0x392225[_0x636f('0x39')];_0x65e34++){var _0x418abf=_0x392225[_0x65e34];if(_0x418abf[_0x636f('0x55')]==='agent'){var _0x1f18af=_['find'](_0x506fe0,function(_0x28c77e){return _0x28c77e[_0x636f('0x65')]===_0x418abf['id'];});if(_0x1f18af)_0x5c6a19['push'](_0x418abf);}else{_0x5c6a19[_0x636f('0x66')](_0x418abf);}}return _0x5c6a19;}});}else{return _0x392225;}}else{var _0x2d55a0=_[_0x636f('0x41')](_0x392225,function(_0x2dec9e){if(_0x2dec9e['role']!==_0x636f('0x54')){return _0x2dec9e;}});return _0x2d55a0;}});}else{return _0x392225;}}})[_0x636f('0x28')](function(_0x50b730){var _0x370879=[];if(_0x50b730){_0x3b7629=_0x50b730;for(var _0x2649a3=0x0;_0x2649a3<_0x50b730[_0x636f('0x39')];_0x2649a3+=0x1){_0x3b7629[_0x2649a3][_0x636f('0x4e')]=[];_0x370879[_0x636f('0x66')](db['ChatInternalMessage'][_0x636f('0x4b')]({'where':{'FromId':[_0x367443['user']['id'],_0x50b730[_0x2649a3]['id']],'ToId':[_0x367443['user']['id'],_0x50b730[_0x2649a3]['id']],'ChatGroupId':null},'attributes':['id',_0x636f('0x50'),_0x636f('0x67'),_0x636f('0x68'),'read',_0x636f('0x49')],'order':qs[_0x636f('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x636f('0x28')](wrapUser(_0x50b730[_0x2649a3])));}return BPromise[_0x636f('0x69')](_0x370879);}return[];})[_0x636f('0x28')](function(_0x2124d4){return{'rows':_0x2124d4,'count':_0x2124d4[_0x636f('0x39')]};})[_0x636f('0x28')](respondWithResult(_0x5a6218,null))[_0x636f('0x46')](handleError(_0x5a6218,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index c0fed80..004c80e 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 _0xb126=['hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','remove','emit'];(function(_0x1ff8d7,_0x309a3b){var _0x22afc1=function(_0x309f38){while(--_0x309f38){_0x1ff8d7['push'](_0x1ff8d7['shift']());}};_0x22afc1(++_0x309a3b);}(_0xb126,0x127));var _0x6b12=function(_0x7ff018,_0x5719a6){_0x7ff018=_0x7ff018-0x0;var _0x470172=_0xb126[_0x7ff018];return _0x470172;};'use strict';var EventEmitter=require(_0x6b12('0x0'));var ChatInternalMessage=require(_0x6b12('0x1'))['db'][_0x6b12('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6b12('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6b12('0x4')};function emitEvent(_0xcecb2){return function(_0x4bae8c,_0x4e0286,_0x12fbf2){ChatInternalMessageEvents[_0x6b12('0x5')](_0xcecb2+':'+_0x4bae8c['id'],_0x4bae8c);ChatInternalMessageEvents['emit'](_0xcecb2,_0x4bae8c);_0x12fbf2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x6b12('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x9370=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x30c552,_0x2b82e5){var _0x19b79c=function(_0x4a8e42){while(--_0x4a8e42){_0x30c552['push'](_0x30c552['shift']());}};_0x19b79c(++_0x2b82e5);}(_0x9370,0x158));var _0x0937=function(_0x242cf7,_0x45077c){_0x242cf7=_0x242cf7-0x0;var _0x2611d6=_0x9370[_0x242cf7];return _0x2611d6;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x0937('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0937('0x1')](0x0);var events={'afterCreate':_0x0937('0x2'),'afterUpdate':_0x0937('0x3'),'afterDestroy':'remove'};function emitEvent(_0x18af83){return function(_0x42bcab,_0x4577cb,_0x470d2a){ChatInternalMessageEvents[_0x0937('0x4')](_0x18af83+':'+_0x42bcab['id'],_0x42bcab);ChatInternalMessageEvents[_0x0937('0x4')](_0x18af83,_0x42bcab);_0x470d2a(null);};}for(var e in events){if(events[_0x0937('0x5')](e)){var event=events[e];ChatInternalMessage[_0x0937('0x6')](e,emitEvent(event));}}module[_0x0937('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index fdb94e2..c924062 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 _0x35fe=['utf8mb4_unicode_ci','lodash','util','api','path','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0x2a36ea,_0x312d3f){var _0x248369=function(_0x15401e){while(--_0x15401e){_0x2a36ea['push'](_0x2a36ea['shift']());}};_0x248369(++_0x312d3f);}(_0x35fe,0x85));var _0xe35f=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x35fe[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0xe35f('0x0'));var util=require(_0xe35f('0x1'));var logger=require('../../config/logger')(_0xe35f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe35f('0x3'));var rimraf=require(_0xe35f('0x4'));var config=require(_0xe35f('0x5'));var attributes=require(_0xe35f('0x6'));module['exports']=function(_0x19d8c4,_0x1a5e76){return _0x19d8c4[_0xe35f('0x7')](_0xe35f('0x8'),attributes,{'tableName':_0xe35f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe35f('0xa'),'collate':_0xe35f('0xb')});};
\ No newline at end of file
+var _0x148a=['./chatInternalMessage.attributes','exports','chat_internal_messages','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','../../config/environment'];(function(_0x193dd8,_0x4ad6c6){var _0x2ddafe=function(_0x348691){while(--_0x348691){_0x193dd8['push'](_0x193dd8['shift']());}};_0x2ddafe(++_0x4ad6c6);}(_0x148a,0xb8));var _0xa148=function(_0x440ad1,_0x329511){_0x440ad1=_0x440ad1-0x0;var _0x32cebd=_0x148a[_0x440ad1];return _0x32cebd;};'use strict';var _=require(_0xa148('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa148('0x1'));var BPromise=require(_0xa148('0x2'));var rp=require(_0xa148('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa148('0x4'));var attributes=require(_0xa148('0x5'));module[_0xa148('0x6')]=function(_0x1ee966,_0x49efd3){return _0x1ee966['define']('ChatInternalMessage',attributes,{'tableName':_0xa148('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa148('0x8')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index dadf410..21f7ef1 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 _0x4cad=['debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x22e535,_0x2344a7){var _0x2b8eac=function(_0xcea172){while(--_0xcea172){_0x22e535['push'](_0x22e535['shift']());}};_0x2b8eac(++_0x2344a7);}(_0x4cad,0xe7));var _0xd4ca=function(_0x536aea,_0x48e27d){_0x536aea=_0x536aea-0x0;var _0x275449=_0x4cad[_0x536aea];return _0x275449;};'use strict';var _=require(_0xd4ca('0x0'));var util=require(_0xd4ca('0x1'));var moment=require(_0xd4ca('0x2'));var BPromise=require(_0xd4ca('0x3'));var rs=require(_0xd4ca('0x4'));var fs=require('fs');var Redis=require(_0xd4ca('0x5'));var db=require(_0xd4ca('0x6'))['db'];var utils=require(_0xd4ca('0x7'));var logger=require(_0xd4ca('0x8'))(_0xd4ca('0x9'));var config=require(_0xd4ca('0xa'));var jayson=require(_0xd4ca('0xb'));var client=jayson[_0xd4ca('0xc')][_0xd4ca('0xd')]({'port':0x232a});config[_0xd4ca('0xe')]=_[_0xd4ca('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd4ca('0x10'))(new Redis(config[_0xd4ca('0xe')]));require('./chatInternalMessage.socket')[_0xd4ca('0x11')](socket);function respondWithRpcPromise(_0x47855b,_0x428f88,_0x3d5781){return new BPromise(function(_0x19abf7,_0x1e66e6){return client['request'](_0x47855b,_0x3d5781)['then'](function(_0xb8ffbf){logger[_0xd4ca('0x12')](_0xd4ca('0x13'),_0x428f88,_0xd4ca('0x14'));logger[_0xd4ca('0x15')](_0xd4ca('0x16'),_0x428f88,'request\x20sent',JSON['stringify'](_0xb8ffbf));if(_0xb8ffbf[_0xd4ca('0x17')]){if(_0xb8ffbf['error'][_0xd4ca('0x18')]===0x1f4){logger[_0xd4ca('0x17')](_0xd4ca('0x13'),_0x428f88,_0xb8ffbf[_0xd4ca('0x17')][_0xd4ca('0x19')]);return _0x1e66e6(_0xb8ffbf[_0xd4ca('0x17')][_0xd4ca('0x19')]);}logger[_0xd4ca('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x428f88,_0xb8ffbf[_0xd4ca('0x17')][_0xd4ca('0x19')]);return _0x19abf7(_0xb8ffbf[_0xd4ca('0x17')]['message']);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x428f88,_0xd4ca('0x14'));_0x19abf7(_0xb8ffbf[_0xd4ca('0x1a')][_0xd4ca('0x19')]);}})[_0xd4ca('0x1b')](function(_0x2fd3cb){logger[_0xd4ca('0x17')](_0xd4ca('0x13'),_0x428f88,_0x2fd3cb);_0x1e66e6(_0x2fd3cb);});});}
\ No newline at end of file
+var _0xef1c=['ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','then'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xef1c,0x176));var _0xcef1=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xef1c[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xcef1('0x0'));var util=require(_0xcef1('0x1'));var moment=require('moment');var BPromise=require(_0xcef1('0x2'));var rs=require(_0xcef1('0x3'));var fs=require('fs');var Redis=require(_0xcef1('0x4'));var db=require(_0xcef1('0x5'))['db'];var utils=require(_0xcef1('0x6'));var logger=require(_0xcef1('0x7'))('rpc');var config=require(_0xcef1('0x8'));var jayson=require(_0xcef1('0x9'));var client=jayson[_0xcef1('0xa')]['http']({'port':0x232a});config[_0xcef1('0xb')]=_['defaults'](config[_0xcef1('0xb')],{'host':_0xcef1('0xc'),'port':0x18eb});var socket=require(_0xcef1('0xd'))(new Redis(config[_0xcef1('0xb')]));require('./chatInternalMessage.socket')[_0xcef1('0xe')](socket);function respondWithRpcPromise(_0x44bc05,_0x4fe666,_0x1352f4){return new BPromise(function(_0x12b227,_0x2a450b){return client['request'](_0x44bc05,_0x1352f4)[_0xcef1('0xf')](function(_0x5316dd){logger['info'](_0xcef1('0x10'),_0x4fe666,'request\x20sent');logger[_0xcef1('0x11')](_0xcef1('0x12'),_0x4fe666,_0xcef1('0x13'),JSON['stringify'](_0x5316dd));if(_0x5316dd[_0xcef1('0x14')]){if(_0x5316dd[_0xcef1('0x14')][_0xcef1('0x15')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x4fe666,_0x5316dd[_0xcef1('0x14')]['message']);return _0x2a450b(_0x5316dd['error'][_0xcef1('0x16')]);}logger[_0xcef1('0x14')](_0xcef1('0x10'),_0x4fe666,_0x5316dd[_0xcef1('0x14')]['message']);return _0x12b227(_0x5316dd[_0xcef1('0x14')][_0xcef1('0x16')]);}else{logger[_0xcef1('0x17')](_0xcef1('0x10'),_0x4fe666,_0xcef1('0x13'));_0x12b227(_0x5316dd[_0xcef1('0x18')][_0xcef1('0x16')]);}})[_0xcef1('0x19')](function(_0x57f94a){logger[_0xcef1('0x14')](_0xcef1('0x10'),_0x4fe666,_0x57f94a);_0x2a450b(_0x57f94a);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index dedb097..fae3e7f 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 _0x9523=['register','length','chatInternalMessage:','./chatInternalMessage.events','save','update','removeListener'];(function(_0x52c71b,_0x4d8190){var _0x12fd26=function(_0x3dd283){while(--_0x3dd283){_0x52c71b['push'](_0x52c71b['shift']());}};_0x12fd26(++_0x4d8190);}(_0x9523,0x14c));var _0x3952=function(_0x20cb27,_0x13a7f){_0x20cb27=_0x20cb27-0x0;var _0xeee669=_0x9523[_0x20cb27];return _0xeee669;};'use strict';var ChatInternalMessageEvents=require(_0x3952('0x0'));var events=[_0x3952('0x1'),'remove',_0x3952('0x2')];function createListener(_0x5f04e2,_0x4097f1){return function(_0x48c613){_0x4097f1['emit'](_0x5f04e2,_0x48c613);};}function removeListener(_0x4bcca2,_0x345b8d){return function(){ChatInternalMessageEvents[_0x3952('0x3')](_0x4bcca2,_0x345b8d);};}exports[_0x3952('0x4')]=function(_0x29e194){for(var _0x1fd6e7=0x0,_0x21847e=events[_0x3952('0x5')];_0x1fd6e7<_0x21847e;_0x1fd6e7++){var _0x4a7d40=events[_0x1fd6e7];var _0x4d77ed=createListener(_0x3952('0x6')+_0x4a7d40,_0x29e194);ChatInternalMessageEvents['on'](_0x4a7d40,_0x4d77ed);}};
\ No newline at end of file
+var _0x5c31=['emit','register','chatInternalMessage:','remove'];(function(_0x1c92b9,_0x4dfa28){var _0x32e602=function(_0x25e2ff){while(--_0x25e2ff){_0x1c92b9['push'](_0x1c92b9['shift']());}};_0x32e602(++_0x4dfa28);}(_0x5c31,0x107));var _0x15c3=function(_0x5964c8,_0x3b18a8){_0x5964c8=_0x5964c8-0x0;var _0x140b2d=_0x5c31[_0x5964c8];return _0x140b2d;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0x15c3('0x0'),'update'];function createListener(_0x3f0079,_0x53116c){return function(_0x40ae25){_0x53116c[_0x15c3('0x1')](_0x3f0079,_0x40ae25);};}function removeListener(_0x5a1a85,_0xea579c){return function(){ChatInternalMessageEvents['removeListener'](_0x5a1a85,_0xea579c);};}exports[_0x15c3('0x2')]=function(_0x299879){for(var _0x38f303=0x0,_0x57cc0f=events['length'];_0x38f303<_0x57cc0f;_0x38f303++){var _0x5635c1=events[_0x38f303];var _0x34f4ef=createListener(_0x15c3('0x3')+_0x5635c1,_0x299879);ChatInternalMessageEvents['on'](_0x5635c1,_0x34f4ef);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 4e538a2..d38ebcd 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 _0x260e=['index','/describe','describe','/users','getUsers','/:id','show','create','put','update','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x57cf34,_0x2cf8c5){var _0x378b6a=function(_0x423342){while(--_0x423342){_0x57cf34['push'](_0x57cf34['shift']());}};_0x378b6a(++_0x2cf8c5);}(_0x260e,0x1d7));var _0xe260=function(_0x1b8cb0,_0x148054){_0x1b8cb0=_0x1b8cb0-0x0;var _0x5cfe5a=_0x260e[_0x1b8cb0];return _0x5cfe5a;};'use strict';var multer=require(_0xe260('0x0'));var util=require(_0xe260('0x1'));var path=require('path');var timeout=require(_0xe260('0x2'));var express=require(_0xe260('0x3'));var router=express[_0xe260('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe260('0x5'));var config=require('../../config/environment');var controller=require(_0xe260('0x6'));router[_0xe260('0x7')]('/',auth[_0xe260('0x8')](),controller[_0xe260('0x9')]);router[_0xe260('0x7')](_0xe260('0xa'),auth['isAuthenticated'](),controller[_0xe260('0xb')]);router[_0xe260('0x7')](_0xe260('0xc'),auth[_0xe260('0x8')](),controller[_0xe260('0xd')]);router[_0xe260('0x7')](_0xe260('0xe'),auth['isAuthenticated'](),controller[_0xe260('0xf')]);router['post']('/',auth[_0xe260('0x8')](),controller[_0xe260('0x10')]);router[_0xe260('0x11')](_0xe260('0xe'),controller[_0xe260('0x12')]);router['delete'](_0xe260('0xe'),auth[_0xe260('0x8')](),controller[_0xe260('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x0143=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','/users','getUsers','/:id','show','post','create','put','update','multer'];(function(_0x45c8e3,_0x4c2b9f){var _0x5068b3=function(_0x3e1c72){while(--_0x3e1c72){_0x45c8e3['push'](_0x45c8e3['shift']());}};_0x5068b3(++_0x4c2b9f);}(_0x0143,0x113));var _0x3014=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x0143[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x3014('0x0'));var util=require(_0x3014('0x1'));var path=require(_0x3014('0x2'));var timeout=require('connect-timeout');var express=require(_0x3014('0x3'));var router=express[_0x3014('0x4')]();var fs_extra=require(_0x3014('0x5'));var auth=require(_0x3014('0x6'));var interaction=require(_0x3014('0x7'));var config=require(_0x3014('0x8'));var controller=require(_0x3014('0x9'));router[_0x3014('0xa')]('/',auth['isAuthenticated'](),controller[_0x3014('0xb')]);router['get'](_0x3014('0xc'),auth[_0x3014('0xd')](),controller[_0x3014('0xe')]);router[_0x3014('0xa')](_0x3014('0xf'),auth[_0x3014('0xd')](),controller[_0x3014('0x10')]);router['get'](_0x3014('0x11'),auth[_0x3014('0xd')](),controller[_0x3014('0x12')]);router[_0x3014('0x13')]('/',auth[_0x3014('0xd')](),controller[_0x3014('0x14')]);router[_0x3014('0x15')](_0x3014('0x11'),controller[_0x3014('0x16')]);router['delete'](_0x3014('0x11'),auth[_0x3014('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 56e7bc1..b4f311d 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 _0xd0e4=['out','DATE','STRING','sequelize','exports','TEXT','medium','ENUM'];(function(_0x3e36be,_0xf8506){var _0x107cbe=function(_0x3cab73){while(--_0x3cab73){_0x3e36be['push'](_0x3e36be['shift']());}};_0x107cbe(++_0xf8506);}(_0xd0e4,0x1d3));var _0x4d0e=function(_0x52017c,_0x393604){_0x52017c=_0x52017c-0x0;var _0xada67d=_0xd0e4[_0x52017c];return _0xada67d;};'use strict';var Sequelize=require(_0x4d0e('0x0'));module[_0x4d0e('0x1')]={'body':{'type':Sequelize[_0x4d0e('0x2')](_0x4d0e('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4d0e('0x4')]('in',_0x4d0e('0x5')),'defaultValue':_0x4d0e('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4d0e('0x6')]},'providerName':{'type':Sequelize[_0x4d0e('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x4213=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x3ccd28,_0x4f37fc){var _0x50548c=function(_0x422f25){while(--_0x422f25){_0x3ccd28['push'](_0x3ccd28['shift']());}};_0x50548c(++_0x4f37fc);}(_0x4213,0x77));var _0x3421=function(_0x5a660a,_0x3a388f){_0x5a660a=_0x5a660a-0x0;var _0x53a90b=_0x4213[_0x5a660a];return _0x53a90b;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'body':{'type':Sequelize[_0x3421('0x2')](_0x3421('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3421('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3421('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3421('0x5')]('in','out'),'defaultValue':_0x3421('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x3421('0x7')]},'providerResponse':{'type':Sequelize[_0x3421('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 9427827..0758d70 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 _0x7e74=['includeAll','include','findAll','rows','show','params','keys','find','create','body','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','email','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','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','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','end','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options'];(function(_0xee76bb,_0x583e9b){var _0x35a5c1=function(_0x3f516b){while(--_0x3f516b){_0xee76bb['push'](_0xee76bb['shift']());}};_0x35a5c1(++_0x583e9b);}(_0x7e74,0xbd));var _0x47e7=function(_0x5d1ca7,_0x40be3c){_0x5d1ca7=_0x5d1ca7-0x0;var _0x1448f6=_0x7e74[_0x5d1ca7];return _0x1448f6;};'use strict';var emlformat=require(_0x47e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x47e7('0x1'));var jsonpatch=require(_0x47e7('0x2'));var rp=require(_0x47e7('0x3'));var moment=require(_0x47e7('0x4'));var BPromise=require(_0x47e7('0x5'));var Mustache=require('mustache');var util=require(_0x47e7('0x6'));var path=require(_0x47e7('0x7'));var sox=require(_0x47e7('0x8'));var csv=require(_0x47e7('0x9'));var ejs=require(_0x47e7('0xa'));var fs=require('fs');var fs_extra=require(_0x47e7('0xb'));var _=require(_0x47e7('0xc'));var squel=require('squel');var crypto=require(_0x47e7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x47e7('0xe'));var toCsv=require(_0x47e7('0x9'));var querystring=require(_0x47e7('0xf'));var Papa=require(_0x47e7('0x10'));var Redis=require(_0x47e7('0x11'));var authService=require(_0x47e7('0x12'));var qs=require(_0x47e7('0x13'));var as=require(_0x47e7('0x14'));var hardwareService=require(_0x47e7('0x15'));var logger=require(_0x47e7('0x16'))(_0x47e7('0x17'));var utils=require(_0x47e7('0x18'));var config=require(_0x47e7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x47e7('0x1a'))['db'];config[_0x47e7('0x1b')]=_[_0x47e7('0x1c')](config['redis'],{'host':_0x47e7('0x1d'),'port':0x18eb});var socket=require(_0x47e7('0x1e'))(new Redis(config[_0x47e7('0x1b')]));require(_0x47e7('0x1f'))['register'](socket);var jayson=require(_0x47e7('0x20'));var client=jayson[_0x47e7('0x21')][_0x47e7('0x22')]({'port':0x232c});var client9002=jayson[_0x47e7('0x21')][_0x47e7('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x5369d4,_0x2e2aeb,_0x5d4801,_0x402ccc){return new BPromise(function(_0x8c320e,_0x14b43f){var _0x433705=_0x402ccc||client;return _0x433705[_0x47e7('0x23')](_0x5369d4,_0x5d4801)[_0x47e7('0x24')](function(_0x6a3682){logger[_0x47e7('0x25')](_0x47e7('0x26'),_0x2e2aeb,_0x47e7('0x27'));logger[_0x47e7('0x28')](_0x47e7('0x29'),_0x2e2aeb,_0x47e7('0x27'),JSON[_0x47e7('0x2a')](_0x6a3682));if(_0x6a3682['error']){if(_0x6a3682['error']['code']===0x1f4){logger['error'](_0x47e7('0x26'),_0x2e2aeb,_0x6a3682[_0x47e7('0x2b')][_0x47e7('0x2c')]);return _0x14b43f(_0x6a3682[_0x47e7('0x2b')]['message']);}logger['error'](_0x47e7('0x26'),_0x2e2aeb,_0x6a3682['error'][_0x47e7('0x2c')]);return _0x8c320e(_0x6a3682['error'][_0x47e7('0x2c')]);}else{logger[_0x47e7('0x25')](_0x47e7('0x26'),_0x2e2aeb,_0x47e7('0x27'));_0x8c320e(_0x6a3682['result']['message']);}})[_0x47e7('0x2d')](function(_0x25c0ca){logger[_0x47e7('0x2b')](_0x47e7('0x26'),_0x2e2aeb,_0x25c0ca);_0x14b43f(_0x25c0ca);});});}function respondWithStatusCode(_0x5b6736,_0x43fa51){_0x43fa51=_0x43fa51||0xcc;return function(_0x105add){if(_0x105add){return _0x5b6736[_0x47e7('0x2e')](_0x43fa51);}return _0x5b6736[_0x47e7('0x2f')](_0x43fa51)['end']();};}function respondWithResult(_0x2fb377,_0x1bdb4c){_0x1bdb4c=_0x1bdb4c||0xc8;return function(_0x301a68){if(_0x301a68){return _0x2fb377[_0x47e7('0x2f')](_0x1bdb4c)[_0x47e7('0x30')](_0x301a68);}};}function respondWithFilteredResult(_0x303ff6,_0x150c8b){return function(_0x55866e){if(_0x55866e){var _0x172c80=typeof _0x150c8b[_0x47e7('0x31')]===_0x47e7('0x32')&&typeof _0x150c8b[_0x47e7('0x33')]===_0x47e7('0x32');var _0x247515=_0x55866e['count'];var _0x2bc66d=_0x172c80?0x0:_0x150c8b[_0x47e7('0x31')];var _0x4078bd=_0x172c80?_0x55866e[_0x47e7('0x34')]:_0x150c8b[_0x47e7('0x31')]+_0x150c8b['limit'];var _0x47662b;if(_0x4078bd>=_0x247515){_0x4078bd=_0x247515;_0x47662b=0xc8;}else{_0x47662b=0xce;}_0x303ff6[_0x47e7('0x2f')](_0x47662b);return _0x303ff6[_0x47e7('0x35')](_0x47e7('0x36'),_0x2bc66d+'-'+_0x4078bd+'/'+_0x247515)[_0x47e7('0x30')](_0x55866e);}return null;};}function patchUpdates(_0x24f833){return function(_0x437b89){try{jsonpatch['apply'](_0x437b89,_0x24f833,!![]);}catch(_0x5dfae3){return BPromise[_0x47e7('0x37')](_0x5dfae3);}return _0x437b89['save']();};}function saveUpdates(_0x2d73c8,_0x6be695){return function(_0x5667fe){if(_0x5667fe){return _0x5667fe[_0x47e7('0x38')](_0x2d73c8)[_0x47e7('0x24')](function(_0x1f80e0){return _0x1f80e0;});}return null;};}function removeEntity(_0x526ad1,_0x58657f){return function(_0x2ad26d){if(_0x2ad26d){return _0x2ad26d[_0x47e7('0x39')]()['then'](function(){_0x526ad1[_0x47e7('0x2f')](0xcc)[_0x47e7('0x3a')]();});}};}function handleEntityNotFound(_0x3af095,_0x54542a){return function(_0x1fc445){if(!_0x1fc445){_0x3af095['sendStatus'](0x194);}return _0x1fc445;};}function handleError(_0x442081,_0x33c4f6){_0x33c4f6=_0x33c4f6||0x1f4;return function(_0x182cb9){logger['error'](_0x182cb9[_0x47e7('0x3b')]);if(_0x182cb9[_0x47e7('0x3c')]){delete _0x182cb9[_0x47e7('0x3c')];}_0x442081[_0x47e7('0x2f')](_0x33c4f6)[_0x47e7('0x3d')](_0x182cb9);};}exports[_0x47e7('0x3e')]=function(_0x4a551a,_0x5621ed){var _0x2b4994={},_0x4dabbb={},_0x16f2dd={'count':0x0,'rows':[]};var _0x3eb435=_[_0x47e7('0x3f')](db[_0x47e7('0x40')][_0x47e7('0x41')],function(_0x127bdc){return{'name':_0x127bdc[_0x47e7('0x42')],'type':_0x127bdc[_0x47e7('0x43')][_0x47e7('0x44')]};});_0x4dabbb[_0x47e7('0x45')]=_['map'](_0x3eb435,_0x47e7('0x3c'));_0x4dabbb['query']=_['keys'](_0x4a551a['query']);_0x4dabbb[_0x47e7('0x46')]=_[_0x47e7('0x47')](_0x4dabbb['model'],_0x4dabbb[_0x47e7('0x48')]);_0x2b4994[_0x47e7('0x49')]=_[_0x47e7('0x47')](_0x4dabbb[_0x47e7('0x45')],qs[_0x47e7('0x4a')](_0x4a551a['query'][_0x47e7('0x4a')]));_0x2b4994['attributes']=_0x2b4994[_0x47e7('0x49')][_0x47e7('0x4b')]?_0x2b4994[_0x47e7('0x49')]:_0x4dabbb['model'];if(!_0x4a551a[_0x47e7('0x48')][_0x47e7('0x4c')]('nolimit')){_0x2b4994['limit']=qs[_0x47e7('0x33')](_0x4a551a[_0x47e7('0x48')][_0x47e7('0x33')]);_0x2b4994['offset']=qs[_0x47e7('0x31')](_0x4a551a[_0x47e7('0x48')][_0x47e7('0x31')]);}_0x2b4994[_0x47e7('0x4d')]=qs[_0x47e7('0x4e')](_0x4a551a[_0x47e7('0x48')][_0x47e7('0x4e')]);_0x2b4994[_0x47e7('0x4f')]=qs[_0x47e7('0x46')](_[_0x47e7('0x50')](_0x4a551a[_0x47e7('0x48')],_0x4dabbb['filters']),_0x3eb435);if(_0x4a551a[_0x47e7('0x48')]['filter']){_0x2b4994[_0x47e7('0x4f')]=_['merge'](_0x2b4994[_0x47e7('0x4f')],{'$or':_['map'](_0x3eb435,function(_0x515665){if(_0x515665[_0x47e7('0x43')]!==_0x47e7('0x51')){var _0x594509={};_0x594509[_0x515665[_0x47e7('0x3c')]]={'$like':'%'+_0x4a551a[_0x47e7('0x48')][_0x47e7('0x52')]+'%'};return _0x594509;}})});}_0x2b4994=_[_0x47e7('0x53')]({},_0x2b4994,_0x4a551a[_0x47e7('0x54')]);var _0x8f2e5b={'where':_0x2b4994[_0x47e7('0x4f')]};return db[_0x47e7('0x40')][_0x47e7('0x34')](_0x8f2e5b)['then'](function(_0x18449a){_0x16f2dd['count']=_0x18449a;if(_0x4a551a['query'][_0x47e7('0x55')]){_0x2b4994[_0x47e7('0x56')]=[{'all':!![]}];}return db[_0x47e7('0x40')][_0x47e7('0x57')](_0x2b4994);})['then'](function(_0x59cc9a){_0x16f2dd[_0x47e7('0x58')]=_0x59cc9a;return _0x16f2dd;})[_0x47e7('0x24')](respondWithFilteredResult(_0x5621ed,_0x2b4994))[_0x47e7('0x2d')](handleError(_0x5621ed,null));};exports[_0x47e7('0x59')]=function(_0x5d0ad6,_0x926bc4){var _0x4db135={'raw':!![],'where':{'id':_0x5d0ad6[_0x47e7('0x5a')]['id']}},_0x5611fd={};_0x5611fd['model']=_[_0x47e7('0x5b')](db[_0x47e7('0x40')][_0x47e7('0x41')]);_0x5611fd[_0x47e7('0x48')]=_[_0x47e7('0x5b')](_0x5d0ad6[_0x47e7('0x48')]);_0x5611fd[_0x47e7('0x46')]=_[_0x47e7('0x47')](_0x5611fd[_0x47e7('0x45')],_0x5611fd[_0x47e7('0x48')]);_0x4db135[_0x47e7('0x49')]=_[_0x47e7('0x47')](_0x5611fd['model'],qs[_0x47e7('0x4a')](_0x5d0ad6['query'][_0x47e7('0x4a')]));_0x4db135[_0x47e7('0x49')]=_0x4db135[_0x47e7('0x49')][_0x47e7('0x4b')]?_0x4db135[_0x47e7('0x49')]:_0x5611fd[_0x47e7('0x45')];if(_0x5d0ad6[_0x47e7('0x48')][_0x47e7('0x55')]){_0x4db135[_0x47e7('0x56')]=[{'all':!![]}];}_0x4db135=_[_0x47e7('0x53')]({},_0x4db135,_0x5d0ad6[_0x47e7('0x54')]);return db[_0x47e7('0x40')][_0x47e7('0x5c')](_0x4db135)[_0x47e7('0x24')](handleEntityNotFound(_0x926bc4,null))[_0x47e7('0x24')](respondWithResult(_0x926bc4,null))['catch'](handleError(_0x926bc4,null));};exports['create']=function(_0x393a7e,_0x342ae3){return db['ChatMessage'][_0x47e7('0x5d')](_0x393a7e[_0x47e7('0x5e')],{})[_0x47e7('0x24')](respondWithResult(_0x342ae3,0xc9))['catch'](handleError(_0x342ae3,null));};exports[_0x47e7('0x38')]=function(_0x47d3fb,_0x4200c2){if(_0x47d3fb[_0x47e7('0x5e')]['id']){delete _0x47d3fb['body']['id'];}return db[_0x47e7('0x40')][_0x47e7('0x5c')]({'where':{'id':_0x47d3fb[_0x47e7('0x5a')]['id']}})[_0x47e7('0x24')](handleEntityNotFound(_0x4200c2,null))[_0x47e7('0x24')](saveUpdates(_0x47d3fb[_0x47e7('0x5e')],null))[_0x47e7('0x24')](respondWithResult(_0x4200c2,null))['catch'](handleError(_0x4200c2,null));};exports[_0x47e7('0x39')]=function(_0x12868c,_0x2da89c){return db[_0x47e7('0x40')]['find']({'where':{'id':_0x12868c[_0x47e7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2da89c,null))[_0x47e7('0x24')](removeEntity(_0x2da89c,null))['catch'](handleError(_0x2da89c,null));};exports[_0x47e7('0x5f')]=function(_0x5a953a,_0x192f8f){return db[_0x47e7('0x40')][_0x47e7('0x5f')]()[_0x47e7('0x24')](respondWithResult(_0x192f8f,null))[_0x47e7('0x2d')](handleError(_0x192f8f,null));};var interaction_log=require(_0x47e7('0x16'))(_0x47e7('0x60'));exports[_0x47e7('0x61')]=function(_0xb92a0b,_0x5c8213,_0x4f7aba){var _0x3788b8={'agent':{},'channel':_0x47e7('0x62')};if(_0xb92a0b['body']['id']){delete _0xb92a0b[_0x47e7('0x5e')]['id'];}_0xb92a0b[_0x47e7('0x5e')][_0x47e7('0x63')]=!![];_0xb92a0b[_0x47e7('0x5e')]['readAt']=moment()[_0x47e7('0x64')](_0x47e7('0x65'));_0xb92a0b[_0x47e7('0x5e')][_0x47e7('0x66')]=_0xb92a0b[_0x47e7('0x5e')][_0x47e7('0x66')]||_0xb92a0b[_0x47e7('0x67')]['id'];_0x3788b8[_0x47e7('0x68')]['id']=_0xb92a0b[_0x47e7('0x5e')]['UserId'];return db[_0x47e7('0x40')][_0x47e7('0x5c')]({'where':{'id':_0xb92a0b[_0x47e7('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5c8213,null))[_0x47e7('0x24')](saveUpdates(_0xb92a0b[_0x47e7('0x5e')],null))['then'](function(_0x52de0c){if(_0x52de0c){_0x3788b8[_0x47e7('0x2c')]=_0x52de0c[_0x47e7('0x69')]({'plain':!![]});return db[_0x47e7('0x6a')][_0x47e7('0x5c')]({'where':{'id':_0x52de0c[_0x47e7('0x6b')]}});}return null;})[_0x47e7('0x24')](handleEntityNotFound(_0x5c8213,null))['then'](function(_0x50df62){if(_0x50df62){return _0x50df62[_0x47e7('0x38')]({'UserId':_0xb92a0b[_0x47e7('0x5e')]['UserId'],'read1stAt':_['isNil'](_0x50df62[_0x47e7('0x6c')])?moment()[_0x47e7('0x64')](_0x47e7('0x65')):undefined});}return null;})['then'](function(_0x8c3fa6){if(_0x8c3fa6){_0x3788b8[_0x47e7('0x6d')]=_0x8c3fa6[_0x47e7('0x69')]({'plain':!![]});interaction_log['info'](_0x47e7('0x6e'),_0xb92a0b[_0x47e7('0x67')]['id'],_0xb92a0b[_0x47e7('0x67')][_0x47e7('0x3c')],_0xb92a0b[_0x47e7('0x67')]['role'],_0x3788b8[_0x47e7('0x6d')]['id'],_0xb92a0b['body']?JSON[_0x47e7('0x2a')](_0xb92a0b[_0x47e7('0x5e')]):_0x47e7('0x6f'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3788b8);}return null;})[_0x47e7('0x24')](function(_0x5ac619){var _0x5a33b2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5ac619['message'][_0x47e7('0x70')];return db['sequelize']['query'](_0x5a33b2,{'type':db[_0x47e7('0x71')][_0x47e7('0x72')][_0x47e7('0x73')],'raw':!![]})[_0x47e7('0x24')](function(_0x1e3cdb){return _0x1e3cdb;});})[_0x47e7('0x24')](function(_0x43ca43){if(_0x43ca43){_0x3788b8[_0x47e7('0x2c')][_0x47e7('0x74')]=_0x43ca43[0x0];if(!_0xb92a0b[_0x47e7('0x5e')][_0x47e7('0x66')])return;return db['User'][_0x47e7('0x5c')]({'where':{'id':_0xb92a0b[_0x47e7('0x5e')][_0x47e7('0x66')],'role':_0x47e7('0x68')},'attributes':['id',_0x47e7('0x3c'),_0x47e7('0x75'),'email',_0x47e7('0x76')],'raw':!![]});}return null;})[_0x47e7('0x24')](function(_0x5a5cfd){if(!_0x5a5cfd)return null;_0x3788b8[_0x47e7('0x2c')]['agent']=_0x5a5cfd;return _0x3788b8;})[_0x47e7('0x24')](function(_0x421efb){if(_0x421efb){if(_0xb92a0b[_0x47e7('0x5e')][_0x47e7('0x77')]){_0x3788b8['message'][_0x47e7('0x78')]=util[_0x47e7('0x64')](_0x47e7('0x79'),_0xb92a0b['user']['name']);_0x3788b8[_0x47e7('0x2c')]['channel']=_0x3788b8[_0x47e7('0x7a')];_0x3788b8[_0x47e7('0x2c')][_0x47e7('0x7b')]=_0x3788b8[_0x47e7('0x7a')];_0x3788b8['message'][_0x47e7('0x7c')]=_0x47e7('0x61');return respondWithRpcPromise(_0x47e7('0x7d'),_0x47e7('0x7d'),{'event':_0x47e7('0x7e'),'message':_[_0x47e7('0x53')](_0x3788b8[_0x47e7('0x2c')],JSON[_0x47e7('0x7f')](_0x3788b8['interaction'][_0x47e7('0x80')]))},client9002)[_0x47e7('0x24')](function(){return _0x3788b8;});}return _0x3788b8;}return null;})[_0x47e7('0x24')](respondWithResult(_0x5c8213,null))[_0x47e7('0x2d')](handleError(_0x5c8213,null));};var interaction_log=require(_0x47e7('0x16'))('chat-interactions');exports['reject']=function(_0x347ba9,_0x4916e1,_0x1ceed6){var _0x454d8c={'agent':{},'channel':_0x47e7('0x62')};if(_0x347ba9['body']['id']){delete _0x347ba9['body']['id'];}_0x347ba9[_0x47e7('0x5e')]['UserId']=_0x347ba9[_0x47e7('0x5e')][_0x47e7('0x66')]||_0x347ba9[_0x47e7('0x67')]['id'];_0x454d8c[_0x47e7('0x68')]['id']=_0x347ba9[_0x47e7('0x5e')][_0x47e7('0x66')];return db['ChatMessage'][_0x47e7('0x5c')]({'where':{'id':_0x347ba9[_0x47e7('0x5a')]['id'],'UserId':null}})[_0x47e7('0x24')](handleEntityNotFound(_0x4916e1,null))['then'](function(_0x3cba0d){if(_0x3cba0d){_0x454d8c['message']=_0x3cba0d[_0x47e7('0x69')]({'plain':!![]});return db[_0x47e7('0x6a')][_0x47e7('0x5c')]({'where':{'id':_0x3cba0d[_0x47e7('0x6b')]}});}return null;})[_0x47e7('0x24')](handleEntityNotFound(_0x4916e1,null))[_0x47e7('0x24')](function(_0x3d9f17){if(_0x3d9f17){_0x454d8c[_0x47e7('0x6d')]=_0x3d9f17['get']({'plain':!![]});interaction_log[_0x47e7('0x25')](_0x47e7('0x81'),_0x347ba9['user']['id'],_0x347ba9[_0x47e7('0x67')][_0x47e7('0x3c')],_0x347ba9['user'][_0x47e7('0x82')],_0x454d8c['interaction']['id'],_0x347ba9[_0x47e7('0x5e')]?JSON['stringify'](_0x347ba9[_0x47e7('0x5e')]):'null');return respondWithRpcPromise(_0x47e7('0x83'),_0x47e7('0x84'),_0x454d8c);}return null;})[_0x47e7('0x24')](function(_0x417da2){var _0x6f88fa=_0x47e7('0x85')+_0x417da2[_0x47e7('0x2c')][_0x47e7('0x70')];return db[_0x47e7('0x86')][_0x47e7('0x48')](_0x6f88fa,{'type':db[_0x47e7('0x71')][_0x47e7('0x72')][_0x47e7('0x73')],'raw':!![]})['then'](function(_0x58b318){return _0x58b318;});})[_0x47e7('0x24')](function(_0xd25b68){if(_0xd25b68){_0x454d8c[_0x47e7('0x2c')]['contact']=_0xd25b68[0x0];if(!_0x347ba9[_0x47e7('0x5e')]['UserId'])return;return db['User']['find']({'where':{'id':_0x347ba9['body'][_0x47e7('0x66')],'role':'agent'},'attributes':['id','name',_0x47e7('0x75'),_0x47e7('0x87'),'internal'],'raw':!![]});}return null;})[_0x47e7('0x24')](function(_0x149fe0){if(!_0x149fe0)return null;_0x454d8c[_0x47e7('0x2c')][_0x47e7('0x68')]=_0x149fe0;return _0x454d8c;})[_0x47e7('0x24')](function(_0x47b71d){if(_0x47b71d){_0x47b71d['message'][_0x47e7('0x78')]=util[_0x47e7('0x64')](_0x47e7('0x79'),_0x347ba9['user'][_0x47e7('0x3c')]);_0x47b71d[_0x47e7('0x2c')][_0x47e7('0x7a')]=_0x454d8c[_0x47e7('0x7a')];_0x47b71d[_0x47e7('0x2c')][_0x47e7('0x7b')]=_0x454d8c[_0x47e7('0x7a')];_0x47b71d[_0x47e7('0x2c')][_0x47e7('0x7c')]='reject';respondWithRpcPromise(_0x47e7('0x7d'),_0x47e7('0x7d'),{'event':_0x47e7('0x88'),'message':_[_0x47e7('0x53')](_0x454d8c[_0x47e7('0x2c')],JSON['parse'](_0x454d8c[_0x47e7('0x6d')]['formData']))},client9002);return _0x454d8c;}return null;})[_0x47e7('0x24')](respondWithResult(_0x4916e1,null))[_0x47e7('0x2d')](handleError(_0x4916e1,null));};
\ No newline at end of file
+var _0x89a7=['stack','name','send','ChatMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','show','params','create','body','update','find','describe','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','email','internal','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','formData','chat-interactions','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','sequelize','parse','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','end'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0x89a7,0x1ea));var _0x789a=function(_0x35dbd1,_0x5d53b8){_0x35dbd1=_0x35dbd1-0x0;var _0x5ebe70=_0x89a7[_0x35dbd1];return _0x5ebe70;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x789a('0x0'));var zipdir=require(_0x789a('0x1'));var jsonpatch=require(_0x789a('0x2'));var rp=require(_0x789a('0x3'));var moment=require(_0x789a('0x4'));var BPromise=require(_0x789a('0x5'));var Mustache=require(_0x789a('0x6'));var util=require(_0x789a('0x7'));var path=require(_0x789a('0x8'));var sox=require(_0x789a('0x9'));var csv=require('to-csv');var ejs=require(_0x789a('0xa'));var fs=require('fs');var fs_extra=require(_0x789a('0xb'));var _=require(_0x789a('0xc'));var squel=require(_0x789a('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x789a('0xe'));var toCsv=require(_0x789a('0xf'));var querystring=require(_0x789a('0x10'));var Papa=require('papaparse');var Redis=require(_0x789a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x789a('0x12'));var as=require(_0x789a('0x13'));var hardwareService=require(_0x789a('0x14'));var logger=require(_0x789a('0x15'))(_0x789a('0x16'));var utils=require(_0x789a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x789a('0x18'));var db=require('../../mysqldb')['db'];config[_0x789a('0x19')]=_[_0x789a('0x1a')](config['redis'],{'host':_0x789a('0x1b'),'port':0x18eb});var socket=require(_0x789a('0x1c'))(new Redis(config[_0x789a('0x19')]));require(_0x789a('0x1d'))[_0x789a('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x789a('0x1f')][_0x789a('0x20')]({'port':0x232c});var client9002=jayson[_0x789a('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4622b0,_0x8bd795,_0xf6e08,_0xdb29e1){return new BPromise(function(_0x5565e6,_0x2e50c0){var _0x163a41=_0xdb29e1||client;return _0x163a41[_0x789a('0x21')](_0x4622b0,_0xf6e08)[_0x789a('0x22')](function(_0x47e981){logger[_0x789a('0x23')](_0x789a('0x24'),_0x8bd795,'request\x20sent');logger[_0x789a('0x25')](_0x789a('0x26'),_0x8bd795,_0x789a('0x27'),JSON['stringify'](_0x47e981));if(_0x47e981[_0x789a('0x28')]){if(_0x47e981[_0x789a('0x28')]['code']===0x1f4){logger[_0x789a('0x28')](_0x789a('0x24'),_0x8bd795,_0x47e981[_0x789a('0x28')]['message']);return _0x2e50c0(_0x47e981['error']['message']);}logger[_0x789a('0x28')](_0x789a('0x24'),_0x8bd795,_0x47e981[_0x789a('0x28')][_0x789a('0x29')]);return _0x5565e6(_0x47e981[_0x789a('0x28')][_0x789a('0x29')]);}else{logger[_0x789a('0x23')](_0x789a('0x24'),_0x8bd795,_0x789a('0x27'));_0x5565e6(_0x47e981[_0x789a('0x2a')]['message']);}})[_0x789a('0x2b')](function(_0x6046bf){logger[_0x789a('0x28')](_0x789a('0x24'),_0x8bd795,_0x6046bf);_0x2e50c0(_0x6046bf);});});}function respondWithStatusCode(_0x170205,_0x477431){_0x477431=_0x477431||0xcc;return function(_0x59e174){if(_0x59e174){return _0x170205[_0x789a('0x2c')](_0x477431);}return _0x170205['status'](_0x477431)['end']();};}function respondWithResult(_0x94113f,_0x507acc){_0x507acc=_0x507acc||0xc8;return function(_0x11fa40){if(_0x11fa40){return _0x94113f[_0x789a('0x2d')](_0x507acc)[_0x789a('0x2e')](_0x11fa40);}};}function respondWithFilteredResult(_0x8268d8,_0x13fa67){return function(_0x162ae3){if(_0x162ae3){var _0x3bd461=typeof _0x13fa67[_0x789a('0x2f')]===_0x789a('0x30')&&typeof _0x13fa67[_0x789a('0x31')]===_0x789a('0x30');var _0x4ae3fc=_0x162ae3['count'];var _0xe77aff=_0x3bd461?0x0:_0x13fa67[_0x789a('0x2f')];var _0x56bbfd=_0x3bd461?_0x162ae3[_0x789a('0x32')]:_0x13fa67[_0x789a('0x2f')]+_0x13fa67[_0x789a('0x31')];var _0x577c77;if(_0x56bbfd>=_0x4ae3fc){_0x56bbfd=_0x4ae3fc;_0x577c77=0xc8;}else{_0x577c77=0xce;}_0x8268d8['status'](_0x577c77);return _0x8268d8[_0x789a('0x33')](_0x789a('0x34'),_0xe77aff+'-'+_0x56bbfd+'/'+_0x4ae3fc)['json'](_0x162ae3);}return null;};}function patchUpdates(_0x2401d4){return function(_0x297201){try{jsonpatch[_0x789a('0x35')](_0x297201,_0x2401d4,!![]);}catch(_0x1445c1){return BPromise[_0x789a('0x36')](_0x1445c1);}return _0x297201[_0x789a('0x37')]();};}function saveUpdates(_0x3a2f72,_0x234d83){return function(_0xacbadc){if(_0xacbadc){return _0xacbadc['update'](_0x3a2f72)[_0x789a('0x22')](function(_0x3c6f69){return _0x3c6f69;});}return null;};}function removeEntity(_0x322b0d,_0x457fb0){return function(_0x2893fa){if(_0x2893fa){return _0x2893fa[_0x789a('0x38')]()['then'](function(){_0x322b0d['status'](0xcc)[_0x789a('0x39')]();});}};}function handleEntityNotFound(_0x1eed3e,_0x418b44){return function(_0x316b92){if(!_0x316b92){_0x1eed3e['sendStatus'](0x194);}return _0x316b92;};}function handleError(_0x216f17,_0x5b840f){_0x5b840f=_0x5b840f||0x1f4;return function(_0x3a26b2){logger[_0x789a('0x28')](_0x3a26b2[_0x789a('0x3a')]);if(_0x3a26b2[_0x789a('0x3b')]){delete _0x3a26b2['name'];}_0x216f17[_0x789a('0x2d')](_0x5b840f)[_0x789a('0x3c')](_0x3a26b2);};}exports['index']=function(_0x355b9b,_0x4ab5d3){var _0x153e8d={},_0x290687={},_0x48ae84={'count':0x0,'rows':[]};var _0x4c7362=_['map'](db[_0x789a('0x3d')][_0x789a('0x3e')],function(_0x3aadff){return{'name':_0x3aadff[_0x789a('0x3f')],'type':_0x3aadff[_0x789a('0x40')][_0x789a('0x41')]};});_0x290687[_0x789a('0x42')]=_[_0x789a('0x43')](_0x4c7362,_0x789a('0x3b'));_0x290687[_0x789a('0x44')]=_[_0x789a('0x45')](_0x355b9b[_0x789a('0x44')]);_0x290687[_0x789a('0x46')]=_[_0x789a('0x47')](_0x290687['model'],_0x290687[_0x789a('0x44')]);_0x153e8d['attributes']=_[_0x789a('0x47')](_0x290687[_0x789a('0x42')],qs[_0x789a('0x48')](_0x355b9b['query'][_0x789a('0x48')]));_0x153e8d[_0x789a('0x49')]=_0x153e8d[_0x789a('0x49')][_0x789a('0x4a')]?_0x153e8d[_0x789a('0x49')]:_0x290687[_0x789a('0x42')];if(!_0x355b9b[_0x789a('0x44')][_0x789a('0x4b')](_0x789a('0x4c'))){_0x153e8d['limit']=qs[_0x789a('0x31')](_0x355b9b[_0x789a('0x44')][_0x789a('0x31')]);_0x153e8d['offset']=qs[_0x789a('0x2f')](_0x355b9b[_0x789a('0x44')][_0x789a('0x2f')]);}_0x153e8d[_0x789a('0x4d')]=qs[_0x789a('0x4e')](_0x355b9b[_0x789a('0x44')][_0x789a('0x4e')]);_0x153e8d[_0x789a('0x4f')]=qs[_0x789a('0x46')](_[_0x789a('0x50')](_0x355b9b[_0x789a('0x44')],_0x290687['filters']),_0x4c7362);if(_0x355b9b[_0x789a('0x44')]['filter']){_0x153e8d[_0x789a('0x4f')]=_['merge'](_0x153e8d[_0x789a('0x4f')],{'$or':_['map'](_0x4c7362,function(_0x443e63){if(_0x443e63['type']!==_0x789a('0x51')){var _0x4edf9c={};_0x4edf9c[_0x443e63[_0x789a('0x3b')]]={'$like':'%'+_0x355b9b[_0x789a('0x44')][_0x789a('0x52')]+'%'};return _0x4edf9c;}})});}_0x153e8d=_[_0x789a('0x53')]({},_0x153e8d,_0x355b9b[_0x789a('0x54')]);var _0x1de307={'where':_0x153e8d[_0x789a('0x4f')]};return db['ChatMessage'][_0x789a('0x32')](_0x1de307)[_0x789a('0x22')](function(_0x2a778b){_0x48ae84[_0x789a('0x32')]=_0x2a778b;if(_0x355b9b['query'][_0x789a('0x55')]){_0x153e8d['include']=[{'all':!![]}];}return db[_0x789a('0x3d')][_0x789a('0x56')](_0x153e8d);})['then'](function(_0x2307fc){_0x48ae84['rows']=_0x2307fc;return _0x48ae84;})[_0x789a('0x22')](respondWithFilteredResult(_0x4ab5d3,_0x153e8d))[_0x789a('0x2b')](handleError(_0x4ab5d3,null));};exports[_0x789a('0x57')]=function(_0x34d1c3,_0x1e9994){var _0x1105c5={'raw':!![],'where':{'id':_0x34d1c3[_0x789a('0x58')]['id']}},_0x1a47dd={};_0x1a47dd['model']=_[_0x789a('0x45')](db['ChatMessage'][_0x789a('0x3e')]);_0x1a47dd[_0x789a('0x44')]=_['keys'](_0x34d1c3['query']);_0x1a47dd[_0x789a('0x46')]=_[_0x789a('0x47')](_0x1a47dd[_0x789a('0x42')],_0x1a47dd[_0x789a('0x44')]);_0x1105c5['attributes']=_[_0x789a('0x47')](_0x1a47dd['model'],qs[_0x789a('0x48')](_0x34d1c3['query'][_0x789a('0x48')]));_0x1105c5[_0x789a('0x49')]=_0x1105c5['attributes'][_0x789a('0x4a')]?_0x1105c5[_0x789a('0x49')]:_0x1a47dd['model'];if(_0x34d1c3[_0x789a('0x44')]['includeAll']){_0x1105c5['include']=[{'all':!![]}];}_0x1105c5=_[_0x789a('0x53')]({},_0x1105c5,_0x34d1c3['options']);return db['ChatMessage']['find'](_0x1105c5)[_0x789a('0x22')](handleEntityNotFound(_0x1e9994,null))[_0x789a('0x22')](respondWithResult(_0x1e9994,null))[_0x789a('0x2b')](handleError(_0x1e9994,null));};exports[_0x789a('0x59')]=function(_0x13f868,_0x50c861){return db[_0x789a('0x3d')][_0x789a('0x59')](_0x13f868[_0x789a('0x5a')],{})['then'](respondWithResult(_0x50c861,0xc9))['catch'](handleError(_0x50c861,null));};exports[_0x789a('0x5b')]=function(_0x4b1562,_0x4df20c){if(_0x4b1562['body']['id']){delete _0x4b1562[_0x789a('0x5a')]['id'];}return db[_0x789a('0x3d')][_0x789a('0x5c')]({'where':{'id':_0x4b1562['params']['id']}})['then'](handleEntityNotFound(_0x4df20c,null))[_0x789a('0x22')](saveUpdates(_0x4b1562[_0x789a('0x5a')],null))[_0x789a('0x22')](respondWithResult(_0x4df20c,null))[_0x789a('0x2b')](handleError(_0x4df20c,null));};exports[_0x789a('0x38')]=function(_0x5ec407,_0x496f09){return db[_0x789a('0x3d')][_0x789a('0x5c')]({'where':{'id':_0x5ec407[_0x789a('0x58')]['id']}})[_0x789a('0x22')](handleEntityNotFound(_0x496f09,null))[_0x789a('0x22')](removeEntity(_0x496f09,null))[_0x789a('0x2b')](handleError(_0x496f09,null));};exports[_0x789a('0x5d')]=function(_0x51b4d9,_0x36920e){return db[_0x789a('0x3d')][_0x789a('0x5d')]()[_0x789a('0x22')](respondWithResult(_0x36920e,null))[_0x789a('0x2b')](handleError(_0x36920e,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x3bf3c6,_0x2fcd2b,_0x3c7175){var _0x2971ee={'agent':{},'channel':_0x789a('0x5e')};if(_0x3bf3c6[_0x789a('0x5a')]['id']){delete _0x3bf3c6['body']['id'];}_0x3bf3c6[_0x789a('0x5a')][_0x789a('0x5f')]=!![];_0x3bf3c6[_0x789a('0x5a')][_0x789a('0x60')]=moment()[_0x789a('0x61')](_0x789a('0x62'));_0x3bf3c6[_0x789a('0x5a')][_0x789a('0x63')]=_0x3bf3c6['body'][_0x789a('0x63')]||_0x3bf3c6[_0x789a('0x64')]['id'];_0x2971ee[_0x789a('0x65')]['id']=_0x3bf3c6['body'][_0x789a('0x63')];return db[_0x789a('0x3d')][_0x789a('0x5c')]({'where':{'id':_0x3bf3c6['params']['id'],'UserId':null}})[_0x789a('0x22')](handleEntityNotFound(_0x2fcd2b,null))[_0x789a('0x22')](saveUpdates(_0x3bf3c6[_0x789a('0x5a')],null))[_0x789a('0x22')](function(_0x4ee645){if(_0x4ee645){_0x2971ee[_0x789a('0x29')]=_0x4ee645['get']({'plain':!![]});return db[_0x789a('0x66')][_0x789a('0x5c')]({'where':{'id':_0x4ee645['ChatInteractionId']}});}return null;})[_0x789a('0x22')](handleEntityNotFound(_0x2fcd2b,null))[_0x789a('0x22')](function(_0x41c1c1){if(_0x41c1c1){return _0x41c1c1[_0x789a('0x5b')]({'UserId':_0x3bf3c6['body'][_0x789a('0x63')],'read1stAt':_[_0x789a('0x67')](_0x41c1c1[_0x789a('0x68')])?moment()[_0x789a('0x61')](_0x789a('0x62')):undefined});}return null;})[_0x789a('0x22')](function(_0x13a209){if(_0x13a209){_0x2971ee[_0x789a('0x69')]=_0x13a209[_0x789a('0x6a')]({'plain':!![]});interaction_log['info'](_0x789a('0x6b'),_0x3bf3c6[_0x789a('0x64')]['id'],_0x3bf3c6[_0x789a('0x64')][_0x789a('0x3b')],_0x3bf3c6['user'][_0x789a('0x6c')],_0x2971ee[_0x789a('0x69')]['id'],_0x3bf3c6[_0x789a('0x5a')]?JSON['stringify'](_0x3bf3c6[_0x789a('0x5a')]):_0x789a('0x6d'));return respondWithRpcPromise(_0x789a('0x6e'),_0x789a('0x6f'),_0x2971ee);}return null;})['then'](function(_0x575071){var _0x4a4fa4=_0x789a('0x70')+_0x575071[_0x789a('0x29')]['ContactId'];return db['sequelize'][_0x789a('0x44')](_0x4a4fa4,{'type':db[_0x789a('0x71')][_0x789a('0x72')][_0x789a('0x73')],'raw':!![]})[_0x789a('0x22')](function(_0x535aab){return _0x535aab;});})['then'](function(_0x53c228){if(_0x53c228){_0x2971ee[_0x789a('0x29')][_0x789a('0x74')]=_0x53c228[0x0];if(!_0x3bf3c6[_0x789a('0x5a')][_0x789a('0x63')])return;return db[_0x789a('0x75')]['find']({'where':{'id':_0x3bf3c6['body'][_0x789a('0x63')],'role':'agent'},'attributes':['id','name','fullname',_0x789a('0x76'),_0x789a('0x77')],'raw':!![]});}return null;})['then'](function(_0x18e4f9){if(!_0x18e4f9)return null;_0x2971ee[_0x789a('0x29')]['agent']=_0x18e4f9;return _0x2971ee;})[_0x789a('0x22')](function(_0x153c7e){if(_0x153c7e){if(_0x3bf3c6[_0x789a('0x5a')]['manual']){_0x2971ee[_0x789a('0x29')][_0x789a('0x78')]=util[_0x789a('0x61')](_0x789a('0x79'),_0x3bf3c6[_0x789a('0x64')][_0x789a('0x3b')]);_0x2971ee[_0x789a('0x29')][_0x789a('0x7a')]=_0x2971ee[_0x789a('0x7a')];_0x2971ee['message'][_0x789a('0x7b')]=_0x2971ee[_0x789a('0x7a')];_0x2971ee[_0x789a('0x29')][_0x789a('0x7c')]=_0x789a('0x7d');return respondWithRpcPromise(_0x789a('0x7e'),_0x789a('0x7e'),{'event':_0x789a('0x7f'),'message':_[_0x789a('0x53')](_0x2971ee[_0x789a('0x29')],JSON['parse'](_0x2971ee[_0x789a('0x69')][_0x789a('0x80')]))},client9002)[_0x789a('0x22')](function(){return _0x2971ee;});}return _0x2971ee;}return null;})[_0x789a('0x22')](respondWithResult(_0x2fcd2b,null))[_0x789a('0x2b')](handleError(_0x2fcd2b,null));};var interaction_log=require('../../config/logger')(_0x789a('0x81'));exports['reject']=function(_0x26caba,_0x461757,_0x1c3d84){var _0x1a3a2f={'agent':{},'channel':_0x789a('0x5e')};if(_0x26caba['body']['id']){delete _0x26caba[_0x789a('0x5a')]['id'];}_0x26caba['body'][_0x789a('0x63')]=_0x26caba[_0x789a('0x5a')][_0x789a('0x63')]||_0x26caba[_0x789a('0x64')]['id'];_0x1a3a2f[_0x789a('0x65')]['id']=_0x26caba[_0x789a('0x5a')][_0x789a('0x63')];return db['ChatMessage'][_0x789a('0x5c')]({'where':{'id':_0x26caba['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x461757,null))[_0x789a('0x22')](function(_0x23b9ac){if(_0x23b9ac){_0x1a3a2f[_0x789a('0x29')]=_0x23b9ac[_0x789a('0x6a')]({'plain':!![]});return db[_0x789a('0x66')][_0x789a('0x5c')]({'where':{'id':_0x23b9ac[_0x789a('0x82')]}});}return null;})[_0x789a('0x22')](handleEntityNotFound(_0x461757,null))[_0x789a('0x22')](function(_0x236e63){if(_0x236e63){_0x1a3a2f[_0x789a('0x69')]=_0x236e63[_0x789a('0x6a')]({'plain':!![]});interaction_log[_0x789a('0x23')](_0x789a('0x83'),_0x26caba[_0x789a('0x64')]['id'],_0x26caba[_0x789a('0x64')][_0x789a('0x3b')],_0x26caba[_0x789a('0x64')][_0x789a('0x6c')],_0x1a3a2f['interaction']['id'],_0x26caba['body']?JSON['stringify'](_0x26caba['body']):_0x789a('0x6d'));return respondWithRpcPromise(_0x789a('0x84'),_0x789a('0x85'),_0x1a3a2f);}return null;})['then'](function(_0x1ebb55){var _0x4ed710=_0x789a('0x70')+_0x1ebb55[_0x789a('0x29')][_0x789a('0x86')];return db[_0x789a('0x87')][_0x789a('0x44')](_0x4ed710,{'type':db[_0x789a('0x71')]['QueryTypes'][_0x789a('0x73')],'raw':!![]})['then'](function(_0x48dd09){return _0x48dd09;});})[_0x789a('0x22')](function(_0x154d02){if(_0x154d02){_0x1a3a2f['message'][_0x789a('0x74')]=_0x154d02[0x0];if(!_0x26caba[_0x789a('0x5a')][_0x789a('0x63')])return;return db[_0x789a('0x75')][_0x789a('0x5c')]({'where':{'id':_0x26caba[_0x789a('0x5a')][_0x789a('0x63')],'role':_0x789a('0x65')},'attributes':['id',_0x789a('0x3b'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x789a('0x22')](function(_0x26cd2d){if(!_0x26cd2d)return null;_0x1a3a2f['message'][_0x789a('0x65')]=_0x26cd2d;return _0x1a3a2f;})[_0x789a('0x22')](function(_0x2e2de7){if(_0x2e2de7){_0x2e2de7[_0x789a('0x29')][_0x789a('0x78')]=util[_0x789a('0x61')](_0x789a('0x79'),_0x26caba[_0x789a('0x64')][_0x789a('0x3b')]);_0x2e2de7[_0x789a('0x29')][_0x789a('0x7a')]=_0x1a3a2f[_0x789a('0x7a')];_0x2e2de7['message'][_0x789a('0x7b')]=_0x1a3a2f['channel'];_0x2e2de7[_0x789a('0x29')][_0x789a('0x7c')]=_0x789a('0x36');respondWithRpcPromise(_0x789a('0x7e'),_0x789a('0x7e'),{'event':'rejectmessage','message':_[_0x789a('0x53')](_0x1a3a2f[_0x789a('0x29')],JSON[_0x789a('0x88')](_0x1a3a2f[_0x789a('0x69')][_0x789a('0x80')]))},client9002);return _0x1a3a2f;}return null;})[_0x789a('0x22')](respondWithResult(_0x461757,null))['catch'](handleError(_0x461757,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 9df2b3e..25d8295 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 _0x044c=['exports','../../mysqldb','save','update','emit','hasOwnProperty','hook'];(function(_0x155a6a,_0xd1824e){var _0x2d8a38=function(_0x44bbd3){while(--_0x44bbd3){_0x155a6a['push'](_0x155a6a['shift']());}};_0x2d8a38(++_0xd1824e);}(_0x044c,0xd3));var _0xc044=function(_0x352fbb,_0x2a6bfa){_0x352fbb=_0x352fbb-0x0;var _0x2a14ab=_0x044c[_0x352fbb];return _0x2a14ab;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xc044('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc044('0x1'),'afterUpdate':_0xc044('0x2'),'afterDestroy':'remove'};function emitEvent(_0x451826){return function(_0x5cfc29,_0x3e64a2,_0x201a7d){ChatMessageEvents[_0xc044('0x3')](_0x451826+':'+_0x5cfc29['id'],_0x5cfc29);ChatMessageEvents['emit'](_0x451826,_0x5cfc29);_0x201a7d(null);};}for(var e in events){if(events[_0xc044('0x4')](e)){var event=events[e];ChatMessage[_0xc044('0x5')](e,emitEvent(event));}}module[_0xc044('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0x18bc=['emit','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','update','remove'];(function(_0x6afc9c,_0xf6b755){var _0x195d68=function(_0x48f1eb){while(--_0x48f1eb){_0x6afc9c['push'](_0x6afc9c['shift']());}};_0x195d68(++_0xf6b755);}(_0x18bc,0x13b));var _0xc18b=function(_0x3eff8f,_0x58a445){_0x3eff8f=_0x3eff8f-0x0;var _0x23eabd=_0x18bc[_0x3eff8f];return _0x23eabd;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xc18b('0x0'))['db'][_0xc18b('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc18b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc18b('0x3'),'afterDestroy':_0xc18b('0x4')};function emitEvent(_0x466f19){return function(_0x3e3642,_0x5076e2,_0x185661){ChatMessageEvents[_0xc18b('0x5')](_0x466f19+':'+_0x3e3642['id'],_0x3e3642);ChatMessageEvents[_0xc18b('0x5')](_0x466f19,_0x3e3642);_0x185661(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xc18b('0x6')](e,emitEvent(event));}}module[_0xc18b('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 720ab24..cc6e82d 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 _0xdbd0=['moment','request-promise','path','rimraf','./chatMessage.attributes','exports','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xdbd0,0x88));var _0x0dbd=function(_0x464292,_0x33a95b){_0x464292=_0x464292-0x0;var _0x3c0e40=_0xdbd0[_0x464292];return _0x3c0e40;};'use strict';var _=require(_0x0dbd('0x0'));var util=require(_0x0dbd('0x1'));var logger=require(_0x0dbd('0x2'))(_0x0dbd('0x3'));var moment=require(_0x0dbd('0x4'));var BPromise=require('bluebird');var rp=require(_0x0dbd('0x5'));var fs=require('fs');var path=require(_0x0dbd('0x6'));var rimraf=require(_0x0dbd('0x7'));var config=require('../../config/environment');var attributes=require(_0x0dbd('0x8'));module[_0x0dbd('0x9')]=function(_0xcd515f,_0x3bd770){return _0xcd515f['define']('ChatMessage',attributes,{'tableName':_0x0dbd('0xa'),'paranoid':![],'indexes':[{'name':_0x0dbd('0xb'),'fields':[_0x0dbd('0xc')],'type':_0x0dbd('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x12057a,_0x453836,_0x5329e7){var _0x55f318=_0xcd515f[_0x0dbd('0xe')];var _0x1e0d57=_0x12057a[_0x0dbd('0xf')]({'plain':!![]});if(_0x1e0d57[_0x0dbd('0x10')][_0x0dbd('0x11')]()==='in'||_0x1e0d57[_0x0dbd('0x10')][_0x0dbd('0x11')]()===_0x0dbd('0x12')&&!_0x1e0d57['secret']&&!_[_0x0dbd('0x13')](_0x1e0d57[_0x0dbd('0x14')])){_0x55f318[_0x0dbd('0x15')]['findOne']({'where':{'id':_0x1e0d57[_0x0dbd('0x16')]}})[_0x0dbd('0x17')](function(_0x1a45d0){if(_0x1a45d0){_0x1a45d0[_0x0dbd('0x18')]({'lastMsgAt':_0x1e0d57[_0x0dbd('0x19')],'lastMsgDirection':_0x1e0d57[_0x0dbd('0x10')][_0x0dbd('0x11')]()});}})[_0x0dbd('0x1a')](function(_0x1b9134){console['error'](_0x1b9134);});}_0x5329e7();}},'charset':'utf8mb4','collate':_0x0dbd('0x1b')});};
\ No newline at end of file
+var _0x25ab=['../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','ChatInteraction','ChatInteractionId','then','update','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x8b9e62,_0x173b44){var _0x31a9a0=function(_0x5cacf7){while(--_0x5cacf7){_0x8b9e62['push'](_0x8b9e62['shift']());}};_0x31a9a0(++_0x173b44);}(_0x25ab,0xe7));var _0xb25a=function(_0xed4502,_0x2852ed){_0xed4502=_0xed4502-0x0;var _0x155e33=_0x25ab[_0xed4502];return _0x155e33;};'use strict';var _=require(_0xb25a('0x0'));var util=require(_0xb25a('0x1'));var logger=require(_0xb25a('0x2'))(_0xb25a('0x3'));var moment=require(_0xb25a('0x4'));var BPromise=require(_0xb25a('0x5'));var rp=require(_0xb25a('0x6'));var fs=require('fs');var path=require(_0xb25a('0x7'));var rimraf=require(_0xb25a('0x8'));var config=require(_0xb25a('0x9'));var attributes=require(_0xb25a('0xa'));module[_0xb25a('0xb')]=function(_0x1d917f,_0x358e83){return _0x1d917f[_0xb25a('0xc')](_0xb25a('0xd'),attributes,{'tableName':_0xb25a('0xe'),'paranoid':![],'indexes':[{'name':_0xb25a('0xf'),'fields':[_0xb25a('0x10')],'type':_0xb25a('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x36bb4c,_0xfafb6a,_0x1a6cef){var _0x1ab887=_0x1d917f[_0xb25a('0x12')];var _0x20de0a=_0x36bb4c[_0xb25a('0x13')]({'plain':!![]});if(_0x20de0a['direction'][_0xb25a('0x14')]()==='in'||_0x20de0a[_0xb25a('0x15')][_0xb25a('0x14')]()===_0xb25a('0x16')&&!_0x20de0a['secret']&&!_['isNil'](_0x20de0a['UserId'])){_0x1ab887[_0xb25a('0x17')]['findOne']({'where':{'id':_0x20de0a[_0xb25a('0x18')]}})[_0xb25a('0x19')](function(_0x354e13){if(_0x354e13){_0x354e13[_0xb25a('0x1a')]({'lastMsgAt':_0x20de0a['createdAt'],'lastMsgDirection':_0x20de0a[_0xb25a('0x15')][_0xb25a('0x14')]()});}})[_0xb25a('0x1b')](function(_0x4f1c10){console[_0xb25a('0x1c')](_0x4f1c10);});}_0x1a6cef();}},'charset':_0xb25a('0x1d'),'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 e09f211..d7bbd56 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 _0x209e=['request\x20sent','debug','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s'];(function(_0x1f7839,_0x2a26e6){var _0x36b42e=function(_0x553222){while(--_0x553222){_0x1f7839['push'](_0x1f7839['shift']());}};_0x36b42e(++_0x2a26e6);}(_0x209e,0x70));var _0xe209=function(_0x504023,_0x8d76bc){_0x504023=_0x504023-0x0;var _0x36acf4=_0x209e[_0x504023];return _0x36acf4;};'use strict';var _=require(_0xe209('0x0'));var util=require(_0xe209('0x1'));var moment=require(_0xe209('0x2'));var BPromise=require(_0xe209('0x3'));var rs=require(_0xe209('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe209('0x5'))['db'];var utils=require(_0xe209('0x6'));var logger=require(_0xe209('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe209('0x8'));var client=jayson[_0xe209('0x9')][_0xe209('0xa')]({'port':0x232a});config[_0xe209('0xb')]=_[_0xe209('0xc')](config[_0xe209('0xb')],{'host':_0xe209('0xd'),'port':0x18eb});var socket=require(_0xe209('0xe'))(new Redis(config[_0xe209('0xb')]));require('./chatMessage.socket')[_0xe209('0xf')](socket);function respondWithRpcPromise(_0x2c2437,_0x517e98,_0x8dd254){return new BPromise(function(_0x4511a9,_0x90f35e){return client[_0xe209('0x10')](_0x2c2437,_0x8dd254)[_0xe209('0x11')](function(_0x4fc971){logger[_0xe209('0x12')](_0xe209('0x13'),_0x517e98,_0xe209('0x14'));logger[_0xe209('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x517e98,_0xe209('0x14'),JSON['stringify'](_0x4fc971));if(_0x4fc971[_0xe209('0x16')]){if(_0x4fc971[_0xe209('0x16')][_0xe209('0x17')]===0x1f4){logger[_0xe209('0x16')](_0xe209('0x13'),_0x517e98,_0x4fc971[_0xe209('0x16')]['message']);return _0x90f35e(_0x4fc971[_0xe209('0x16')][_0xe209('0x18')]);}logger[_0xe209('0x16')](_0xe209('0x13'),_0x517e98,_0x4fc971['error'][_0xe209('0x18')]);return _0x4511a9(_0x4fc971[_0xe209('0x16')][_0xe209('0x18')]);}else{logger[_0xe209('0x12')](_0xe209('0x13'),_0x517e98,'request\x20sent');_0x4511a9(_0x4fc971[_0xe209('0x19')][_0xe209('0x18')]);}})[_0xe209('0x1a')](function(_0x1e927a){logger[_0xe209('0x16')](_0xe209('0x13'),_0x517e98,_0x1e927a);_0x90f35e(_0x1e927a);});});}exports[_0xe209('0x1b')]=function(_0x35b05c){var _0x5197ef=this;return new Promise(function(_0xde1346,_0x1e35ed){return db[_0xe209('0x1c')][_0xe209('0x1d')](_0x35b05c['body'],{'raw':_0x35b05c['options']?_0x35b05c[_0xe209('0x1e')][_0xe209('0x1f')]===undefined?!![]:![]:!![]})[_0xe209('0x11')](function(_0x9a7ee){logger[_0xe209('0x12')](_0xe209('0x1b'),_0x35b05c);logger['debug'](_0xe209('0x1b'),_0x35b05c,JSON[_0xe209('0x20')](_0x9a7ee));_0xde1346(_0x9a7ee);})[_0xe209('0x1a')](function(_0x173f4d){logger['error'](_0xe209('0x1b'),_0x173f4d[_0xe209('0x18')],_0x35b05c);_0x1e35ed(_0x5197ef[_0xe209('0x16')](0x1f4,_0x173f4d['message']));});});};
\ No newline at end of file
+var _0xc83f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','body','options','raw','CreateChatMessage','lodash','util'];(function(_0x57fd0d,_0x2630ea){var _0x4b57f6=function(_0x5d314c){while(--_0x5d314c){_0x57fd0d['push'](_0x57fd0d['shift']());}};_0x4b57f6(++_0x2630ea);}(_0xc83f,0xf6));var _0xfc83=function(_0x336221,_0x4e04de){_0x336221=_0x336221-0x0;var _0x2ad2a5=_0xc83f[_0x336221];return _0x2ad2a5;};'use strict';var _=require(_0xfc83('0x0'));var util=require(_0xfc83('0x1'));var moment=require('moment');var BPromise=require(_0xfc83('0x2'));var rs=require(_0xfc83('0x3'));var fs=require('fs');var Redis=require(_0xfc83('0x4'));var db=require(_0xfc83('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc83('0x6'))(_0xfc83('0x7'));var config=require(_0xfc83('0x8'));var jayson=require(_0xfc83('0x9'));var client=jayson[_0xfc83('0xa')][_0xfc83('0xb')]({'port':0x232a});config[_0xfc83('0xc')]=_['defaults'](config[_0xfc83('0xc')],{'host':_0xfc83('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfc83('0xe'))[_0xfc83('0xf')](socket);function respondWithRpcPromise(_0x578dcc,_0x14e792,_0x12ee60){return new BPromise(function(_0xae5fd8,_0x4beed1){return client[_0xfc83('0x10')](_0x578dcc,_0x12ee60)[_0xfc83('0x11')](function(_0x1d0dd4){logger[_0xfc83('0x12')](_0xfc83('0x13'),_0x14e792,'request\x20sent');logger[_0xfc83('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x14e792,_0xfc83('0x15'),JSON[_0xfc83('0x16')](_0x1d0dd4));if(_0x1d0dd4['error']){if(_0x1d0dd4['error']['code']===0x1f4){logger[_0xfc83('0x17')](_0xfc83('0x13'),_0x14e792,_0x1d0dd4[_0xfc83('0x17')][_0xfc83('0x18')]);return _0x4beed1(_0x1d0dd4[_0xfc83('0x17')]['message']);}logger[_0xfc83('0x17')]('ChatMessage,\x20%s,\x20%s',_0x14e792,_0x1d0dd4['error'][_0xfc83('0x18')]);return _0xae5fd8(_0x1d0dd4[_0xfc83('0x17')][_0xfc83('0x18')]);}else{logger['info'](_0xfc83('0x13'),_0x14e792,_0xfc83('0x15'));_0xae5fd8(_0x1d0dd4[_0xfc83('0x19')][_0xfc83('0x18')]);}})[_0xfc83('0x1a')](function(_0x188c7e){logger[_0xfc83('0x17')](_0xfc83('0x13'),_0x14e792,_0x188c7e);_0x4beed1(_0x188c7e);});});}exports['CreateChatMessage']=function(_0xb2d9d4){var _0x45dd1b=this;return new Promise(function(_0x3cce2f,_0x54ff9c){return db['ChatMessage']['create'](_0xb2d9d4[_0xfc83('0x1b')],{'raw':_0xb2d9d4[_0xfc83('0x1c')]?_0xb2d9d4['options'][_0xfc83('0x1d')]===undefined?!![]:![]:!![]})[_0xfc83('0x11')](function(_0x173918){logger[_0xfc83('0x12')](_0xfc83('0x1e'),_0xb2d9d4);logger[_0xfc83('0x14')](_0xfc83('0x1e'),_0xb2d9d4,JSON[_0xfc83('0x16')](_0x173918));_0x3cce2f(_0x173918);})['catch'](function(_0x40c5f2){logger[_0xfc83('0x17')](_0xfc83('0x1e'),_0x40c5f2[_0xfc83('0x18')],_0xb2d9d4);_0x54ff9c(_0x45dd1b[_0xfc83('0x17')](0x1f4,_0x40c5f2[_0xfc83('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 771cbe1..9b4ef2c 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 _0xaa3f=['register','length','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x11bcbd,_0x4d39b3){var _0x58aa24=function(_0x7b15f3){while(--_0x7b15f3){_0x11bcbd['push'](_0x11bcbd['shift']());}};_0x58aa24(++_0x4d39b3);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x503a45,_0x12312f){_0x503a45=_0x503a45-0x0;var _0x1a27d1=_0xaa3f[_0x503a45];return _0x1a27d1;};'use strict';var ChatMessageEvents=require(_0xfaa3('0x0'));var events=[_0xfaa3('0x1'),_0xfaa3('0x2'),_0xfaa3('0x3')];function createListener(_0x1ebbfb,_0x1da39b){return function(_0x408343){_0x1da39b[_0xfaa3('0x4')](_0x1ebbfb,_0x408343);};}function removeListener(_0x32f4e1,_0x5123a3){return function(){ChatMessageEvents['removeListener'](_0x32f4e1,_0x5123a3);};}exports[_0xfaa3('0x5')]=function(_0x4bac92){for(var _0x3d09aa=0x0,_0xeecce5=events[_0xfaa3('0x6')];_0x3d09aa<_0xeecce5;_0x3d09aa++){var _0xbf270c=events[_0x3d09aa];var _0x328d5f=createListener(_0xfaa3('0x7')+_0xbf270c,_0x4bac92);ChatMessageEvents['on'](_0xbf270c,_0x328d5f);}};
\ No newline at end of file
+var _0xec39=['length','chatMessage:','./chatMessage.events','save','remove','update','removeListener'];(function(_0x108b66,_0x37db88){var _0x3ed76=function(_0x2a22c5){while(--_0x2a22c5){_0x108b66['push'](_0x108b66['shift']());}};_0x3ed76(++_0x37db88);}(_0xec39,0x19f));var _0x9ec3=function(_0x2fb75b,_0x2b327d){_0x2fb75b=_0x2fb75b-0x0;var _0x49e6ce=_0xec39[_0x2fb75b];return _0x49e6ce;};'use strict';var ChatMessageEvents=require(_0x9ec3('0x0'));var events=[_0x9ec3('0x1'),_0x9ec3('0x2'),_0x9ec3('0x3')];function createListener(_0x1fc7a7,_0xb3d117){return function(_0x3d481c){_0xb3d117['emit'](_0x1fc7a7,_0x3d481c);};}function removeListener(_0x1f43fb,_0x1c944d){return function(){ChatMessageEvents[_0x9ec3('0x4')](_0x1f43fb,_0x1c944d);};}exports['register']=function(_0x49ddff){for(var _0x55adba=0x0,_0x3742c5=events[_0x9ec3('0x5')];_0x55adba<_0x3742c5;_0x55adba++){var _0x29a6a2=events[_0x55adba];var _0x595e3a=createListener(_0x9ec3('0x6')+_0x29a6a2,_0x49ddff);ChatMessageEvents['on'](_0x29a6a2,_0x595e3a);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 85f1ed6..fbbda93 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 _0x3c8a=['update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','post','tracked','chat','chatmessage:create','put'];(function(_0x5dafd0,_0x3bcbb6){var _0x364354=function(_0x5da31c){while(--_0x5da31c){_0x5dafd0['push'](_0x5dafd0['shift']());}};_0x364354(++_0x3bcbb6);}(_0x3c8a,0xb6));var _0xa3c8=function(_0x4e82ff,_0x3cbf4b){_0x4e82ff=_0x4e82ff-0x0;var _0x495205=_0x3c8a[_0x4e82ff];return _0x495205;};'use strict';var multer=require(_0xa3c8('0x0'));var util=require(_0xa3c8('0x1'));var path=require(_0xa3c8('0x2'));var timeout=require(_0xa3c8('0x3'));var express=require(_0xa3c8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa3c8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa3c8('0x6'));var controller=require(_0xa3c8('0x7'));router[_0xa3c8('0x8')]('/',auth[_0xa3c8('0x9')](),controller[_0xa3c8('0xa')]);router[_0xa3c8('0x8')]('/describe',auth[_0xa3c8('0x9')](),controller[_0xa3c8('0xb')]);router[_0xa3c8('0x8')](_0xa3c8('0xc'),auth[_0xa3c8('0x9')](),controller['show']);router[_0xa3c8('0xd')]('/',auth['isAuthenticated'](),interaction[_0xa3c8('0xe')](_0xa3c8('0xf'),_0xa3c8('0x10')),controller['create']);router[_0xa3c8('0x11')](_0xa3c8('0xc'),controller[_0xa3c8('0x12')]);router[_0xa3c8('0x11')]('/:id/accept',auth[_0xa3c8('0x9')](),controller[_0xa3c8('0x13')]);router[_0xa3c8('0x11')](_0xa3c8('0x14'),auth[_0xa3c8('0x9')](),controller[_0xa3c8('0x15')]);router[_0xa3c8('0x16')](_0xa3c8('0xc'),auth[_0xa3c8('0x9')](),controller[_0xa3c8('0x17')]);module[_0xa3c8('0x18')]=router;
\ No newline at end of file
+var _0x668b=['chat','chatmessage:create','create','put','update','/:id/accept','reject','delete','/:id','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','tracked'];(function(_0x3e3cab,_0x246974){var _0x5ca183=function(_0x2422a5){while(--_0x2422a5){_0x3e3cab['push'](_0x3e3cab['shift']());}};_0x5ca183(++_0x246974);}(_0x668b,0x1a8));var _0xb668=function(_0x5b077b,_0x50b707){_0x5b077b=_0x5b077b-0x0;var _0x16faf7=_0x668b[_0x5b077b];return _0x16faf7;};'use strict';var multer=require(_0xb668('0x0'));var util=require('util');var path=require(_0xb668('0x1'));var timeout=require(_0xb668('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb668('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb668('0x4'));var config=require(_0xb668('0x5'));var controller=require(_0xb668('0x6'));router[_0xb668('0x7')]('/',auth[_0xb668('0x8')](),controller[_0xb668('0x9')]);router[_0xb668('0x7')](_0xb668('0xa'),auth[_0xb668('0x8')](),controller[_0xb668('0xb')]);router[_0xb668('0x7')]('/:id',auth[_0xb668('0x8')](),controller['show']);router['post']('/',auth[_0xb668('0x8')](),interaction[_0xb668('0xc')](_0xb668('0xd'),_0xb668('0xe')),controller[_0xb668('0xf')]);router[_0xb668('0x10')]('/:id',controller[_0xb668('0x11')]);router[_0xb668('0x10')](_0xb668('0x12'),auth[_0xb668('0x8')](),controller['accept']);router[_0xb668('0x10')]('/:id/reject',auth[_0xb668('0x8')](),controller[_0xb668('0x13')]);router[_0xb668('0x14')](_0xb668('0x15'),auth[_0xb668('0x8')](),controller['destroy']);module[_0xb668('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 86db0dd..8f11e87 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x263957,_0x39f977){var _0x55d0f9=function(_0x27f20a){while(--_0x27f20a){_0x263957['push'](_0x263957['shift']());}};_0x55d0f9(++_0x39f977);}(_0x5f2f,0x73));var _0xf5f2=function(_0x138293,_0x197e7f){_0x138293=_0x138293-0x0;var _0x34c4a2=_0x5f2f[_0x138293];return _0x34c4a2;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x2032=['medium','exports','TEXT'];(function(_0x166e34,_0x38f5ab){var _0x15061b=function(_0x356112){while(--_0x356112){_0x166e34['push'](_0x166e34['shift']());}};_0x15061b(++_0x38f5ab);}(_0x2032,0xd9));var _0x2203=function(_0x1ed5d9,_0x52d183){_0x1ed5d9=_0x1ed5d9-0x0;var _0x326c59=_0x2032[_0x1ed5d9];return _0x326c59;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 2c39eac..979732d 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(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x7a54,0x106));var _0x47a5=function(_0x5ab49e,_0xcb5a13){_0x5ab49e=_0x5ab49e-0x0;var _0x233117=_0x7a54[_0x5ab49e];return _0x233117;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x205dc5,_0x191197){var _0x442e92=function(_0x13d30c){while(--_0x13d30c){_0x205dc5['push'](_0x205dc5['shift']());}};_0x442e92(++_0x191197);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index ef0291c..14374a0 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 _0x299c=['ChatOfflineMessage','save','update','emit','hasOwnProperty','exports','events'];(function(_0x44b795,_0x8d7c1b){var _0x2bb91e=function(_0x4027f1){while(--_0x4027f1){_0x44b795['push'](_0x44b795['shift']());}};_0x2bb91e(++_0x8d7c1b);}(_0x299c,0x180));var _0xc299=function(_0x213c03,_0x22ba9d){_0x213c03=_0x213c03-0x0;var _0x478e2d=_0x299c[_0x213c03];return _0x478e2d;};'use strict';var EventEmitter=require(_0xc299('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xc299('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc299('0x2'),'afterUpdate':_0xc299('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3550ec){return function(_0x17d6c5,_0x453b10,_0x577391){ChatOfflineMessageEvents[_0xc299('0x4')](_0x3550ec+':'+_0x17d6c5['id'],_0x17d6c5);ChatOfflineMessageEvents[_0xc299('0x4')](_0x3550ec,_0x17d6c5);_0x577391(null);};}for(var e in events){if(events[_0xc299('0x5')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xc299('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xb0b4=['events','../../mysqldb','setMaxListeners','save','remove','emit','exports'];(function(_0x4f5c5c,_0x20088e){var _0x4e686c=function(_0x2aa945){while(--_0x2aa945){_0x4f5c5c['push'](_0x4f5c5c['shift']());}};_0x4e686c(++_0x20088e);}(_0xb0b4,0x134));var _0x4b0b=function(_0x47210c,_0x127cb3){_0x47210c=_0x47210c-0x0;var _0x24d779=_0xb0b4[_0x47210c];return _0x24d779;};'use strict';var EventEmitter=require(_0x4b0b('0x0'));var ChatOfflineMessage=require(_0x4b0b('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x4b0b('0x2')](0x0);var events={'afterCreate':_0x4b0b('0x3'),'afterUpdate':'update','afterDestroy':_0x4b0b('0x4')};function emitEvent(_0x365ce2){return function(_0x2ec8b6,_0x1d66f1,_0x315e2d){ChatOfflineMessageEvents[_0x4b0b('0x5')](_0x365ce2+':'+_0x2ec8b6['id'],_0x2ec8b6);ChatOfflineMessageEvents[_0x4b0b('0x5')](_0x365ce2,_0x2ec8b6);_0x315e2d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x4b0b('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 99bd5ab..e1b889c 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 _0xb0a2=['exports','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x588e96,_0x3a4978){var _0x3683df=function(_0x1cbc4a){while(--_0x1cbc4a){_0x588e96['push'](_0x588e96['shift']());}};_0x3683df(++_0x3a4978);}(_0xb0a2,0x117));var _0x2b0a=function(_0x5aeedb,_0x2e9c48){_0x5aeedb=_0x5aeedb-0x0;var _0x3e5e60=_0xb0a2[_0x5aeedb];return _0x3e5e60;};'use strict';var attributes=require(_0x2b0a('0x0'));module[_0x2b0a('0x1')]=function(_0x3a3d1c){return _0x3a3d1c['define'](_0x2b0a('0x2'),attributes,{'tableName':_0x2b0a('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2b0a('0x4')});};
\ No newline at end of file
+var _0xd1d4=['./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd1d4,0x84));var _0x4d1d=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xd1d4[_0x24259d];return _0x5a701;};'use strict';var attributes=require(_0x4d1d('0x0'));module[_0x4d1d('0x1')]=function(_0x27c02c){return _0x27c02c[_0x4d1d('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x4d1d('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4d1d('0x4'),'collate':_0x4d1d('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index feba091..a30c8e1 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 _0x1580=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3f9f9d,_0x923a36){var _0x3f9fc9=function(_0x1b0e3d){while(--_0x1b0e3d){_0x3f9f9d['push'](_0x3f9f9d['shift']());}};_0x3f9fc9(++_0x923a36);}(_0x1580,0x15a));var _0x0158=function(_0x4e699b,_0x459659){_0x4e699b=_0x4e699b-0x0;var _0x59d53b=_0x1580[_0x4e699b];return _0x59d53b;};'use strict';var _=require(_0x0158('0x0'));var util=require(_0x0158('0x1'));var moment=require(_0x0158('0x2'));var BPromise=require(_0x0158('0x3'));var rs=require(_0x0158('0x4'));var fs=require('fs');var Redis=require(_0x0158('0x5'));var db=require(_0x0158('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0158('0x7'))('rpc');var config=require(_0x0158('0x8'));var jayson=require(_0x0158('0x9'));var client=jayson['client'][_0x0158('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b9af3,_0xecf81c,_0x2d7a30){return new BPromise(function(_0x3e885c,_0x4d5047){return client[_0x0158('0xb')](_0x2b9af3,_0x2d7a30)[_0x0158('0xc')](function(_0x4b5450){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0xecf81c,_0x0158('0xd'));logger['debug'](_0x0158('0xe'),_0xecf81c,_0x0158('0xd'),JSON[_0x0158('0xf')](_0x4b5450));if(_0x4b5450[_0x0158('0x10')]){if(_0x4b5450[_0x0158('0x10')]['code']===0x1f4){logger[_0x0158('0x10')](_0x0158('0x11'),_0xecf81c,_0x4b5450['error'][_0x0158('0x12')]);return _0x4d5047(_0x4b5450[_0x0158('0x10')][_0x0158('0x12')]);}logger[_0x0158('0x10')](_0x0158('0x11'),_0xecf81c,_0x4b5450[_0x0158('0x10')][_0x0158('0x12')]);return _0x3e885c(_0x4b5450[_0x0158('0x10')][_0x0158('0x12')]);}else{logger[_0x0158('0x13')](_0x0158('0x11'),_0xecf81c,_0x0158('0xd'));_0x3e885c(_0x4b5450[_0x0158('0x14')][_0x0158('0x12')]);}})[_0x0158('0x15')](function(_0x52d6af){logger['error'](_0x0158('0x11'),_0xecf81c,_0x52d6af);_0x4d5047(_0x52d6af);});});}
\ No newline at end of file
+var _0x1e9d=['ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','then','info'];(function(_0x50c86a,_0x2fec99){var _0x53420a=function(_0x56bb66){while(--_0x56bb66){_0x50c86a['push'](_0x50c86a['shift']());}};_0x53420a(++_0x2fec99);}(_0x1e9d,0x1dd));var _0xd1e9=function(_0x36c06c,_0x208e85){_0x36c06c=_0x36c06c-0x0;var _0x2abf77=_0x1e9d[_0x36c06c];return _0x2abf77;};'use strict';var _=require(_0xd1e9('0x0'));var util=require('util');var moment=require(_0xd1e9('0x1'));var BPromise=require(_0xd1e9('0x2'));var rs=require(_0xd1e9('0x3'));var fs=require('fs');var Redis=require(_0xd1e9('0x4'));var db=require(_0xd1e9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd1e9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15061,_0x3dea6,_0x3a9acc){return new BPromise(function(_0x5aff45,_0x466da8){return client['request'](_0x15061,_0x3a9acc)[_0xd1e9('0x7')](function(_0x207bee){logger[_0xd1e9('0x8')](_0xd1e9('0x9'),_0x3dea6,_0xd1e9('0xa'));logger[_0xd1e9('0xb')](_0xd1e9('0xc'),_0x3dea6,_0xd1e9('0xa'),JSON[_0xd1e9('0xd')](_0x207bee));if(_0x207bee[_0xd1e9('0xe')]){if(_0x207bee[_0xd1e9('0xe')]['code']===0x1f4){logger[_0xd1e9('0xe')](_0xd1e9('0x9'),_0x3dea6,_0x207bee[_0xd1e9('0xe')][_0xd1e9('0xf')]);return _0x466da8(_0x207bee[_0xd1e9('0xe')]['message']);}logger[_0xd1e9('0xe')](_0xd1e9('0x9'),_0x3dea6,_0x207bee[_0xd1e9('0xe')][_0xd1e9('0xf')]);return _0x5aff45(_0x207bee['error']['message']);}else{logger['info'](_0xd1e9('0x9'),_0x3dea6,'request\x20sent');_0x5aff45(_0x207bee[_0xd1e9('0x10')][_0xd1e9('0xf')]);}})[_0xd1e9('0x11')](function(_0xc89082){logger[_0xd1e9('0xe')](_0xd1e9('0x9'),_0x3dea6,_0xc89082);_0x466da8(_0xc89082);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 97d714a..5e24fa1 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 _0x9de4=['/:id','exports','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x9de4,0x92));var _0x49de=function(_0x583ee5,_0x2acd9a){_0x583ee5=_0x583ee5-0x0;var _0x3f002a=_0x9de4[_0x583ee5];return _0x3f002a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49de('0x0'));var timeout=require(_0x49de('0x1'));var express=require(_0x49de('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x49de('0x3'));var config=require(_0x49de('0x4'));var controller=require(_0x49de('0x5'));router[_0x49de('0x6')]('/',auth[_0x49de('0x7')](),controller[_0x49de('0x8')]);router[_0x49de('0x6')](_0x49de('0x9'),auth['isAuthenticated'](),controller[_0x49de('0xa')]);router[_0x49de('0x6')]('/:id',auth[_0x49de('0x7')](),controller[_0x49de('0xb')]);router[_0x49de('0xc')]('/',auth[_0x49de('0x7')](),controller[_0x49de('0xd')]);router['put'](_0x49de('0xe'),auth[_0x49de('0x7')](),controller['update']);router['delete'](_0x49de('0xe'),auth[_0x49de('0x7')](),controller['destroy']);module[_0x49de('0xf')]=router;
\ No newline at end of file
+var _0x219e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0xaf280a,_0x3b0cdb){var _0x7453b=function(_0x24e59a){while(--_0x24e59a){_0xaf280a['push'](_0xaf280a['shift']());}};_0x7453b(++_0x3b0cdb);}(_0x219e,0x80));var _0xe219=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x219e[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require('multer');var util=require(_0xe219('0x0'));var path=require(_0xe219('0x1'));var timeout=require(_0xe219('0x2'));var express=require(_0xe219('0x3'));var router=express['Router']();var fs_extra=require(_0xe219('0x4'));var auth=require(_0xe219('0x5'));var interaction=require(_0xe219('0x6'));var config=require(_0xe219('0x7'));var controller=require(_0xe219('0x8'));router[_0xe219('0x9')]('/',auth[_0xe219('0xa')](),controller[_0xe219('0xb')]);router[_0xe219('0x9')](_0xe219('0xc'),auth[_0xe219('0xa')](),controller[_0xe219('0xd')]);router[_0xe219('0x9')](_0xe219('0xe'),auth['isAuthenticated'](),controller[_0xe219('0xf')]);router[_0xe219('0x10')]('/',auth['isAuthenticated'](),controller[_0xe219('0x11')]);router[_0xe219('0x12')]('/:id',auth[_0xe219('0xa')](),controller['update']);router[_0xe219('0x13')](_0xe219('0xe'),auth[_0xe219('0xa')](),controller[_0xe219('0x14')]);module[_0xe219('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index a32c39f..1aa7041 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 _0xa20e=['STRING','ENUM','mouseOver','timeout','exports'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0xa20e,0x1a8));var _0xea20=function(_0x4369ef,_0x55cfbc){_0x4369ef=_0x4369ef-0x0;var _0x5b6913=_0xa20e[_0x4369ef];return _0x5b6913;};'use strict';var Sequelize=require('sequelize');module[_0xea20('0x0')]={'name':{'type':Sequelize[_0xea20('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xea20('0x2')](_0xea20('0x3'),_0xea20('0x4')),'defaultValue':_0xea20('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xd3e1=['ENUM','timeout','mouseOver','sequelize','exports'];(function(_0x362195,_0x15100b){var _0x5c4054=function(_0x43c26){while(--_0x43c26){_0x362195['push'](_0x362195['shift']());}};_0x5c4054(++_0x15100b);}(_0xd3e1,0x18e));var _0x1d3e=function(_0x3109ee,_0x32a8c1){_0x3109ee=_0x3109ee-0x0;var _0x288424=_0xd3e1[_0x3109ee];return _0x288424;};'use strict';var Sequelize=require(_0x1d3e('0x0'));module[_0x1d3e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1d3e('0x2')]('mouseOver',_0x1d3e('0x3')),'defaultValue':_0x1d3e('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 65248b5..c7a9ed1 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 _0x3f27=['find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','end','error','stack','name','send','params','model','keys','ChatProactiveAction','query','intersection','attributes','length','includeAll','include','options'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x3f27,0x1f4));var _0x73f2=function(_0x31fa80,_0x506183){_0x31fa80=_0x31fa80-0x0;var _0x1cc1de=_0x3f27[_0x31fa80];return _0x1cc1de;};'use strict';var emlformat=require(_0x73f2('0x0'));var rimraf=require(_0x73f2('0x1'));var zipdir=require(_0x73f2('0x2'));var jsonpatch=require(_0x73f2('0x3'));var rp=require(_0x73f2('0x4'));var moment=require('moment');var BPromise=require(_0x73f2('0x5'));var Mustache=require(_0x73f2('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x73f2('0x7'));var ejs=require(_0x73f2('0x8'));var fs=require('fs');var fs_extra=require(_0x73f2('0x9'));var _=require(_0x73f2('0xa'));var squel=require(_0x73f2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x73f2('0xc'));var toCsv=require(_0x73f2('0x7'));var querystring=require(_0x73f2('0xd'));var Papa=require(_0x73f2('0xe'));var Redis=require(_0x73f2('0xf'));var authService=require(_0x73f2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x73f2('0x11'));var hardwareService=require(_0x73f2('0x12'));var logger=require(_0x73f2('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x73f2('0x14'));var db=require(_0x73f2('0x15'))['db'];function respondWithStatusCode(_0x20d4f3,_0x25e1bc){_0x25e1bc=_0x25e1bc||0xcc;return function(_0x454352){if(_0x454352){return _0x20d4f3[_0x73f2('0x16')](_0x25e1bc);}return _0x20d4f3[_0x73f2('0x17')](_0x25e1bc)['end']();};}function respondWithResult(_0x4d4bd2,_0x469686){_0x469686=_0x469686||0xc8;return function(_0x45e8e0){if(_0x45e8e0){return _0x4d4bd2['status'](_0x469686)['json'](_0x45e8e0);}};}function respondWithFilteredResult(_0x2c0720,_0x39feae){return function(_0x2a1ac6){if(_0x2a1ac6){var _0x262f51=typeof _0x39feae[_0x73f2('0x18')]===_0x73f2('0x19')&&typeof _0x39feae[_0x73f2('0x1a')]===_0x73f2('0x19');var _0x41e10c=_0x2a1ac6[_0x73f2('0x1b')];var _0x1dee61=_0x262f51?0x0:_0x39feae[_0x73f2('0x18')];var _0x2546a0=_0x262f51?_0x2a1ac6['count']:_0x39feae[_0x73f2('0x18')]+_0x39feae[_0x73f2('0x1a')];var _0x13c6ec;if(_0x2546a0>=_0x41e10c){_0x2546a0=_0x41e10c;_0x13c6ec=0xc8;}else{_0x13c6ec=0xce;}_0x2c0720[_0x73f2('0x17')](_0x13c6ec);return _0x2c0720['set'](_0x73f2('0x1c'),_0x1dee61+'-'+_0x2546a0+'/'+_0x41e10c)[_0x73f2('0x1d')](_0x2a1ac6);}return null;};}function patchUpdates(_0x416ead){return function(_0x2ae791){try{jsonpatch['apply'](_0x2ae791,_0x416ead,!![]);}catch(_0xd80727){return BPromise[_0x73f2('0x1e')](_0xd80727);}return _0x2ae791[_0x73f2('0x1f')]();};}function saveUpdates(_0x55416e,_0x4a723b){return function(_0x444b06){if(_0x444b06){return _0x444b06[_0x73f2('0x20')](_0x55416e)[_0x73f2('0x21')](function(_0x5e8f4c){return _0x5e8f4c;});}return null;};}function removeEntity(_0x4844df,_0x11a5da){return function(_0xd5bb3b){if(_0xd5bb3b){return _0xd5bb3b['destroy']()[_0x73f2('0x21')](function(){_0x4844df[_0x73f2('0x17')](0xcc)[_0x73f2('0x22')]();});}};}function handleEntityNotFound(_0x4ecdc7,_0x1b3f34){return function(_0x87e4e4){if(!_0x87e4e4){_0x4ecdc7[_0x73f2('0x16')](0x194);}return _0x87e4e4;};}function handleError(_0x5e06cb,_0x58bd99){_0x58bd99=_0x58bd99||0x1f4;return function(_0x5c52e3){logger[_0x73f2('0x23')](_0x5c52e3[_0x73f2('0x24')]);if(_0x5c52e3[_0x73f2('0x25')]){delete _0x5c52e3[_0x73f2('0x25')];}_0x5e06cb[_0x73f2('0x17')](_0x58bd99)[_0x73f2('0x26')](_0x5c52e3);};}exports['show']=function(_0x2840f0,_0xf0e828){var _0x4a90ac={'raw':!![],'where':{'id':_0x2840f0[_0x73f2('0x27')]['id']}},_0x21b18={};_0x21b18[_0x73f2('0x28')]=_[_0x73f2('0x29')](db[_0x73f2('0x2a')]['rawAttributes']);_0x21b18[_0x73f2('0x2b')]=_[_0x73f2('0x29')](_0x2840f0['query']);_0x21b18['filters']=_[_0x73f2('0x2c')](_0x21b18[_0x73f2('0x28')],_0x21b18[_0x73f2('0x2b')]);_0x4a90ac['attributes']=_['intersection'](_0x21b18['model'],qs['fields'](_0x2840f0[_0x73f2('0x2b')]['fields']));_0x4a90ac[_0x73f2('0x2d')]=_0x4a90ac[_0x73f2('0x2d')][_0x73f2('0x2e')]?_0x4a90ac[_0x73f2('0x2d')]:_0x21b18['model'];if(_0x2840f0[_0x73f2('0x2b')][_0x73f2('0x2f')]){_0x4a90ac[_0x73f2('0x30')]=[{'all':!![]}];}_0x4a90ac=_['merge']({},_0x4a90ac,_0x2840f0[_0x73f2('0x31')]);return db[_0x73f2('0x2a')][_0x73f2('0x32')](_0x4a90ac)['then'](handleEntityNotFound(_0xf0e828,null))[_0x73f2('0x21')](respondWithResult(_0xf0e828,null))[_0x73f2('0x33')](handleError(_0xf0e828,null));};exports[_0x73f2('0x34')]=function(_0x2ba1ec,_0x3f50b2){return db[_0x73f2('0x2a')][_0x73f2('0x34')](_0x2ba1ec[_0x73f2('0x35')],{})[_0x73f2('0x21')](respondWithResult(_0x3f50b2,0xc9))['catch'](handleError(_0x3f50b2,null));};exports['update']=function(_0x54a21f,_0x379cee){if(_0x54a21f[_0x73f2('0x35')]['id']){delete _0x54a21f[_0x73f2('0x35')]['id'];}return db['ChatProactiveAction'][_0x73f2('0x32')]({'where':{'id':_0x54a21f[_0x73f2('0x27')]['id']}})[_0x73f2('0x21')](handleEntityNotFound(_0x379cee,null))[_0x73f2('0x21')](saveUpdates(_0x54a21f[_0x73f2('0x35')],null))['then'](respondWithResult(_0x379cee,null))[_0x73f2('0x33')](handleError(_0x379cee,null));};exports[_0x73f2('0x36')]=function(_0xde2a1c,_0x42e3b5){return db[_0x73f2('0x2a')][_0x73f2('0x32')]({'where':{'id':_0xde2a1c['params']['id']}})[_0x73f2('0x21')](handleEntityNotFound(_0x42e3b5,null))['then'](removeEntity(_0x42e3b5,null))[_0x73f2('0x33')](handleError(_0x42e3b5,null));};
\ No newline at end of file
+var _0x294b=['length','includeAll','include','options','ChatProactiveAction','find','create','body','catch','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','apply','save','then','sendStatus','error','name','send','show','params','model','query','keys','filters','intersection','attributes','fields'];(function(_0x1147fb,_0x57bfa2){var _0x4d8bbe=function(_0x55707b){while(--_0x55707b){_0x1147fb['push'](_0x1147fb['shift']());}};_0x4d8bbe(++_0x57bfa2);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb294('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb294('0x1'));var jsonpatch=require(_0xb294('0x2'));var rp=require(_0xb294('0x3'));var moment=require(_0xb294('0x4'));var BPromise=require(_0xb294('0x5'));var Mustache=require(_0xb294('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb294('0x7'));var csv=require(_0xb294('0x8'));var ejs=require(_0xb294('0x9'));var fs=require('fs');var fs_extra=require(_0xb294('0xa'));var _=require(_0xb294('0xb'));var squel=require('squel');var crypto=require(_0xb294('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb294('0xd'));var Papa=require(_0xb294('0xe'));var Redis=require(_0xb294('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb294('0x10'));var logger=require(_0xb294('0x11'))(_0xb294('0x12'));var utils=require(_0xb294('0x13'));var config=require(_0xb294('0x14'));var licenseUtil=require(_0xb294('0x15'));var db=require(_0xb294('0x16'))['db'];function respondWithStatusCode(_0x13a3fc,_0x2b2bb5){_0x2b2bb5=_0x2b2bb5||0xcc;return function(_0x3e0fe5){if(_0x3e0fe5){return _0x13a3fc['sendStatus'](_0x2b2bb5);}return _0x13a3fc['status'](_0x2b2bb5)[_0xb294('0x17')]();};}function respondWithResult(_0x4c0959,_0x4b5996){_0x4b5996=_0x4b5996||0xc8;return function(_0x22beca){if(_0x22beca){return _0x4c0959[_0xb294('0x18')](_0x4b5996)[_0xb294('0x19')](_0x22beca);}};}function respondWithFilteredResult(_0x366f8f,_0x3f7323){return function(_0x2f3b62){if(_0x2f3b62){var _0x1a4089=typeof _0x3f7323[_0xb294('0x1a')]===_0xb294('0x1b')&&typeof _0x3f7323[_0xb294('0x1c')]===_0xb294('0x1b');var _0x51110b=_0x2f3b62[_0xb294('0x1d')];var _0x1ecc68=_0x1a4089?0x0:_0x3f7323['offset'];var _0x5e8ce6=_0x1a4089?_0x2f3b62[_0xb294('0x1d')]:_0x3f7323[_0xb294('0x1a')]+_0x3f7323[_0xb294('0x1c')];var _0x449e81;if(_0x5e8ce6>=_0x51110b){_0x5e8ce6=_0x51110b;_0x449e81=0xc8;}else{_0x449e81=0xce;}_0x366f8f[_0xb294('0x18')](_0x449e81);return _0x366f8f['set']('Content-Range',_0x1ecc68+'-'+_0x5e8ce6+'/'+_0x51110b)[_0xb294('0x19')](_0x2f3b62);}return null;};}function patchUpdates(_0x46b2ac){return function(_0x526914){try{jsonpatch[_0xb294('0x1e')](_0x526914,_0x46b2ac,!![]);}catch(_0x18e7dd){return BPromise['reject'](_0x18e7dd);}return _0x526914[_0xb294('0x1f')]();};}function saveUpdates(_0x21b9b2,_0x33c416){return function(_0x4afd48){if(_0x4afd48){return _0x4afd48['update'](_0x21b9b2)[_0xb294('0x20')](function(_0x5bdc68){return _0x5bdc68;});}return null;};}function removeEntity(_0x36b173,_0x5be6d5){return function(_0x101339){if(_0x101339){return _0x101339['destroy']()[_0xb294('0x20')](function(){_0x36b173['status'](0xcc)[_0xb294('0x17')]();});}};}function handleEntityNotFound(_0x405b66,_0x2d0c62){return function(_0xabcb26){if(!_0xabcb26){_0x405b66[_0xb294('0x21')](0x194);}return _0xabcb26;};}function handleError(_0x469647,_0x2fe3a9){_0x2fe3a9=_0x2fe3a9||0x1f4;return function(_0x52853){logger[_0xb294('0x22')](_0x52853['stack']);if(_0x52853['name']){delete _0x52853[_0xb294('0x23')];}_0x469647[_0xb294('0x18')](_0x2fe3a9)[_0xb294('0x24')](_0x52853);};}exports[_0xb294('0x25')]=function(_0x47fca9,_0x59fbde){var _0x1167e5={'raw':!![],'where':{'id':_0x47fca9[_0xb294('0x26')]['id']}},_0x3c2aa5={};_0x3c2aa5[_0xb294('0x27')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x3c2aa5[_0xb294('0x28')]=_[_0xb294('0x29')](_0x47fca9[_0xb294('0x28')]);_0x3c2aa5[_0xb294('0x2a')]=_[_0xb294('0x2b')](_0x3c2aa5[_0xb294('0x27')],_0x3c2aa5[_0xb294('0x28')]);_0x1167e5[_0xb294('0x2c')]=_[_0xb294('0x2b')](_0x3c2aa5[_0xb294('0x27')],qs[_0xb294('0x2d')](_0x47fca9[_0xb294('0x28')][_0xb294('0x2d')]));_0x1167e5['attributes']=_0x1167e5['attributes'][_0xb294('0x2e')]?_0x1167e5['attributes']:_0x3c2aa5[_0xb294('0x27')];if(_0x47fca9[_0xb294('0x28')][_0xb294('0x2f')]){_0x1167e5[_0xb294('0x30')]=[{'all':!![]}];}_0x1167e5=_['merge']({},_0x1167e5,_0x47fca9[_0xb294('0x31')]);return db[_0xb294('0x32')][_0xb294('0x33')](_0x1167e5)[_0xb294('0x20')](handleEntityNotFound(_0x59fbde,null))[_0xb294('0x20')](respondWithResult(_0x59fbde,null))['catch'](handleError(_0x59fbde,null));};exports['create']=function(_0x47fbf3,_0x324f8f){return db[_0xb294('0x32')][_0xb294('0x34')](_0x47fbf3[_0xb294('0x35')],{})[_0xb294('0x20')](respondWithResult(_0x324f8f,0xc9))[_0xb294('0x36')](handleError(_0x324f8f,null));};exports[_0xb294('0x37')]=function(_0x5df86d,_0x3f2e12){if(_0x5df86d[_0xb294('0x35')]['id']){delete _0x5df86d[_0xb294('0x35')]['id'];}return db[_0xb294('0x32')][_0xb294('0x33')]({'where':{'id':_0x5df86d[_0xb294('0x26')]['id']}})[_0xb294('0x20')](handleEntityNotFound(_0x3f2e12,null))[_0xb294('0x20')](saveUpdates(_0x5df86d['body'],null))['then'](respondWithResult(_0x3f2e12,null))[_0xb294('0x36')](handleError(_0x3f2e12,null));};exports['destroy']=function(_0x26af32,_0x565546){return db[_0xb294('0x32')][_0xb294('0x33')]({'where':{'id':_0x26af32[_0xb294('0x26')]['id']}})[_0xb294('0x20')](handleEntityNotFound(_0x565546,null))[_0xb294('0x20')](removeEntity(_0x565546,null))['catch'](handleError(_0x565546,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index ed95d8e..04f5601 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 _0xdc5f=['request-promise','path','rimraf','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment'];(function(_0x187184,_0x13aadf){var _0x390763=function(_0x49f325){while(--_0x49f325){_0x187184['push'](_0x187184['shift']());}};_0x390763(++_0x13aadf);}(_0xdc5f,0xaf));var _0xfdc5=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xdc5f[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0xfdc5('0x0'));var util=require(_0xfdc5('0x1'));var logger=require(_0xfdc5('0x2'))(_0xfdc5('0x3'));var moment=require(_0xfdc5('0x4'));var BPromise=require('bluebird');var rp=require(_0xfdc5('0x5'));var fs=require('fs');var path=require(_0xfdc5('0x6'));var rimraf=require(_0xfdc5('0x7'));var config=require('../../config/environment');var attributes=require(_0xfdc5('0x8'));module[_0xfdc5('0x9')]=function(_0x2ec582,_0x5ee63c){return _0x2ec582['define'](_0xfdc5('0xa'),attributes,{'tableName':_0xfdc5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd8e=['path','rimraf','./chatProactiveAction.attributes','exports','ChatProactiveAction','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xca11fe,_0x33eb73){var _0x55bcd0=function(_0x582433){while(--_0x582433){_0xca11fe['push'](_0xca11fe['shift']());}};_0x55bcd0(++_0x33eb73);}(_0xbd8e,0x1e9));var _0xebd8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xbd8e[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xebd8('0x0'));var util=require(_0xebd8('0x1'));var logger=require(_0xebd8('0x2'))(_0xebd8('0x3'));var moment=require(_0xebd8('0x4'));var BPromise=require('bluebird');var rp=require(_0xebd8('0x5'));var fs=require('fs');var path=require(_0xebd8('0x6'));var rimraf=require(_0xebd8('0x7'));var config=require('../../config/environment');var attributes=require(_0xebd8('0x8'));module[_0xebd8('0x9')]=function(_0xcaf978,_0x340a79){return _0xcaf978['define'](_0xebd8('0xa'),attributes,{'tableName':'chat_proactive_actions','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 976ad32..64d01bf 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 _0xb0fb=['jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb0fb,0x15e));var _0xbb0f=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xb0fb[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var util=require(_0xbb0f('0x0'));var moment=require(_0xbb0f('0x1'));var BPromise=require('bluebird');var rs=require(_0xbb0f('0x2'));var fs=require('fs');var Redis=require(_0xbb0f('0x3'));var db=require(_0xbb0f('0x4'))['db'];var utils=require(_0xbb0f('0x5'));var logger=require(_0xbb0f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbb0f('0x7'));var client=jayson[_0xbb0f('0x8')][_0xbb0f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xaa1c5f,_0x43cd28,_0x2d10d3){return new BPromise(function(_0x596f10,_0xd7d346){return client[_0xbb0f('0xa')](_0xaa1c5f,_0x2d10d3)[_0xbb0f('0xb')](function(_0x17f95b){logger[_0xbb0f('0xc')](_0xbb0f('0xd'),_0x43cd28,'request\x20sent');logger[_0xbb0f('0xe')](_0xbb0f('0xf'),_0x43cd28,_0xbb0f('0x10'),JSON['stringify'](_0x17f95b));if(_0x17f95b[_0xbb0f('0x11')]){if(_0x17f95b[_0xbb0f('0x11')]['code']===0x1f4){logger[_0xbb0f('0x11')](_0xbb0f('0xd'),_0x43cd28,_0x17f95b[_0xbb0f('0x11')][_0xbb0f('0x12')]);return _0xd7d346(_0x17f95b[_0xbb0f('0x11')]['message']);}logger[_0xbb0f('0x11')](_0xbb0f('0xd'),_0x43cd28,_0x17f95b[_0xbb0f('0x11')]['message']);return _0x596f10(_0x17f95b[_0xbb0f('0x11')]['message']);}else{logger[_0xbb0f('0xc')](_0xbb0f('0xd'),_0x43cd28,_0xbb0f('0x10'));_0x596f10(_0x17f95b[_0xbb0f('0x13')][_0xbb0f('0x12')]);}})[_0xbb0f('0x14')](function(_0x3efe1a){logger['error'](_0xbb0f('0xd'),_0x43cd28,_0x3efe1a);_0xd7d346(_0x3efe1a);});});}
\ No newline at end of file
+var _0x96ce=['result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x25d7ab,_0x21f44b){var _0x513242=function(_0x536fda){while(--_0x536fda){_0x25d7ab['push'](_0x25d7ab['shift']());}};_0x513242(++_0x21f44b);}(_0x96ce,0x144));var _0xe96c=function(_0x4b2a8f,_0x5277ac){_0x4b2a8f=_0x4b2a8f-0x0;var _0x311556=_0x96ce[_0x4b2a8f];return _0x311556;};'use strict';var _=require(_0xe96c('0x0'));var util=require(_0xe96c('0x1'));var moment=require(_0xe96c('0x2'));var BPromise=require(_0xe96c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe96c('0x4'));var logger=require(_0xe96c('0x5'))(_0xe96c('0x6'));var config=require(_0xe96c('0x7'));var jayson=require(_0xe96c('0x8'));var client=jayson[_0xe96c('0x9')][_0xe96c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14e91a,_0x4d9203,_0x3ae7c5){return new BPromise(function(_0x2b5cae,_0x45b7c8){return client[_0xe96c('0xb')](_0x14e91a,_0x3ae7c5)['then'](function(_0x38a8b1){logger['info'](_0xe96c('0xc'),_0x4d9203,_0xe96c('0xd'));logger[_0xe96c('0xe')](_0xe96c('0xf'),_0x4d9203,_0xe96c('0xd'),JSON[_0xe96c('0x10')](_0x38a8b1));if(_0x38a8b1[_0xe96c('0x11')]){if(_0x38a8b1[_0xe96c('0x11')][_0xe96c('0x12')]===0x1f4){logger[_0xe96c('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x4d9203,_0x38a8b1[_0xe96c('0x11')][_0xe96c('0x13')]);return _0x45b7c8(_0x38a8b1[_0xe96c('0x11')][_0xe96c('0x13')]);}logger[_0xe96c('0x11')](_0xe96c('0xc'),_0x4d9203,_0x38a8b1[_0xe96c('0x11')][_0xe96c('0x13')]);return _0x2b5cae(_0x38a8b1[_0xe96c('0x11')][_0xe96c('0x13')]);}else{logger[_0xe96c('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x4d9203,_0xe96c('0xd'));_0x2b5cae(_0x38a8b1[_0xe96c('0x15')][_0xe96c('0x13')]);}})[_0xe96c('0x16')](function(_0x51d852){logger[_0xe96c('0x11')](_0xe96c('0xc'),_0x4d9203,_0x51d852);_0x45b7c8(_0x51d852);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index d56c5df..7933199 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 _0xa630=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x582028,_0x5c1dc0){var _0xc3f006=function(_0x16624a){while(--_0x16624a){_0x582028['push'](_0x582028['shift']());}};_0xc3f006(++_0x5c1dc0);}(_0xa630,0xbe));var _0x0a63=function(_0x3fa127,_0x557c3d){_0x3fa127=_0x3fa127-0x0;var _0x4c32d5=_0xa630[_0x3fa127];return _0x4c32d5;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0x9')]);router[_0x0a63('0xa')]('/',auth[_0x0a63('0xb')](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0x8'),auth[_0x0a63('0xb')](),controller[_0x0a63('0x10')]);module[_0x0a63('0x11')]=router;
\ No newline at end of file
+var _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0xcabd19,_0x55efa6){_0xcabd19=_0xcabd19-0x0;var _0x387a0d=_0xb4c7[_0xcabd19];return _0x387a0d;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('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 1b9d4c8..979d6aa 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 _0x6d09=['exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x2f5c3a,_0x30dbe0){var _0x363a19=function(_0x29110b){while(--_0x29110b){_0x2f5c3a['push'](_0x2f5c3a['shift']());}};_0x363a19(++_0x30dbe0);}(_0x6d09,0x13f));var _0x96d0=function(_0x1dbb50,_0x5a4d06){_0x1dbb50=_0x1dbb50-0x0;var _0x4ccd44=_0x6d09[_0x1dbb50];return _0x4ccd44;};'use strict';var Sequelize=require(_0x96d0('0x0'));module[_0x96d0('0x1')]={'name':{'type':Sequelize[_0x96d0('0x2')],'unique':_0x96d0('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x96d0('0x2')]},'timeout':{'type':Sequelize[_0x96d0('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x96d0('0x5')](_0x96d0('0x6'),'beepall',_0x96d0('0x7'))}};
\ No newline at end of file
+var _0xb9b6=['ENUM','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x29db4e,_0x323087){var _0xa264bc=function(_0x4d7f84){while(--_0x4d7f84){_0x29db4e['push'](_0x29db4e['shift']());}};_0xa264bc(++_0x323087);}(_0xb9b6,0x1bf));var _0x6b9b=function(_0x24392f,_0x15a3e5){_0x24392f=_0x24392f-0x0;var _0x591e33=_0xb9b6[_0x24392f];return _0x591e33;};'use strict';var Sequelize=require(_0x6b9b('0x0'));module[_0x6b9b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6b9b('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6b9b('0x3')]('rrmemory',_0x6b9b('0x4'),_0x6b9b('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 35aab2d..e5b312f 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 _0x8a25=['rows','catch','show','model','keys','intersection','fields','attributes','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMembers','findOne','length','nolimit','order','sort','filters','pick','UserChatQueue','findAndCountAll','agent','chatPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','filter','ids','User','Agents','voicePause','interface','flatMap','sequelize','addTeams','each','findOrCreate','userChatQueue:save','removeTeams','field','tq.TeamId','from','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','transaction','isEmpty','removeAgents','emit','userChatQueue:remove','omit','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','sendStatus','status','offset','undefined','count','limit','set','then','destroy','get','ChatQueues','UserProfileResource','end','error','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll'];(function(_0x2573ca,_0x550022){var _0x220656=function(_0x1ac82c){while(--_0x1ac82c){_0x2573ca['push'](_0x2573ca['shift']());}};_0x220656(++_0x550022);}(_0x8a25,0x12f));var _0x58a2=function(_0x4b75e7,_0xdb714a){_0x4b75e7=_0x4b75e7-0x0;var _0x1ea0d8=_0x8a25[_0x4b75e7];return _0x1ea0d8;};'use strict';var BPromise=require(_0x58a2('0x0'));var util=require(_0x58a2('0x1'));var _=require(_0x58a2('0x2'));var squel=require(_0x58a2('0x3'));var Redis=require(_0x58a2('0x4'));var qs=require(_0x58a2('0x5'));var logger=require(_0x58a2('0x6'))(_0x58a2('0x7'));var config=require(_0x58a2('0x8'));var db=require(_0x58a2('0x9'))['db'];config[_0x58a2('0xa')]=_[_0x58a2('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x58a2('0xc'))(new Redis(config[_0x58a2('0xa')]));require(_0x58a2('0xd'))['register'](socket);function respondWithStatusCode(_0x5d9d60,_0x2fadfd){_0x2fadfd=_0x2fadfd||0xcc;return function(_0x2d3318){if(_0x2d3318){return _0x5d9d60[_0x58a2('0xe')](_0x2fadfd);}return _0x5d9d60[_0x58a2('0xf')](_0x2fadfd)['end']();};}function respondWithResult(_0x4664b6,_0x15e75d){_0x15e75d=_0x15e75d||0xc8;return function(_0x3f6b2c){if(_0x3f6b2c){return _0x4664b6[_0x58a2('0xf')](_0x15e75d)['json'](_0x3f6b2c);}};}function respondWithFilteredResult(_0x486c89,_0x2d9497){return function(_0x40c476){if(_0x40c476){var _0xc728fb=typeof _0x2d9497[_0x58a2('0x10')]===_0x58a2('0x11')&&typeof _0x2d9497['limit']===_0x58a2('0x11');var _0x12d102=_0x40c476['count'];var _0x27f897=_0xc728fb?0x0:_0x2d9497[_0x58a2('0x10')];var _0x2a7422=_0xc728fb?_0x40c476[_0x58a2('0x12')]:_0x2d9497['offset']+_0x2d9497[_0x58a2('0x13')];var _0x337d25;if(_0x2a7422>=_0x12d102){_0x2a7422=_0x12d102;_0x337d25=0xc8;}else{_0x337d25=0xce;}_0x486c89[_0x58a2('0xf')](_0x337d25);return _0x486c89[_0x58a2('0x14')]('Content-Range',_0x27f897+'-'+_0x2a7422+'/'+_0x12d102)['json'](_0x40c476);}return null;};}function saveUpdates(_0x11abe4){return function(_0x5cf5f){if(_0x5cf5f){return _0x5cf5f['update'](_0x11abe4)[_0x58a2('0x15')](function(_0x53b834){return _0x53b834;});}return null;};}function removeEntity(_0x9401d5){return function(_0x3d8cbe){if(_0x3d8cbe){return _0x3d8cbe[_0x58a2('0x16')]()[_0x58a2('0x15')](function(){var _0x46937e=_0x3d8cbe[_0x58a2('0x17')]({'plain':!![]});var _0x2491f5=_0x58a2('0x18');return db[_0x58a2('0x19')][_0x58a2('0x16')]({'where':{'type':_0x2491f5,'resourceId':_0x46937e['id']}})[_0x58a2('0x15')](function(){return _0x3d8cbe;});})['then'](function(){_0x9401d5[_0x58a2('0xf')](0xcc)[_0x58a2('0x1a')]();});}};}function handleEntityNotFound(_0x49529f){return function(_0x50198b){if(!_0x50198b){_0x49529f['sendStatus'](0x194);}return _0x50198b;};}function handleError(_0x2fc2bc,_0x3da2b1){_0x3da2b1=_0x3da2b1||0x1f4;return function(_0x4f7df6){logger[_0x58a2('0x1b')](_0x4f7df6[_0x58a2('0x1c')]);if(_0x4f7df6[_0x58a2('0x1d')]){delete _0x4f7df6[_0x58a2('0x1d')];}_0x2fc2bc[_0x58a2('0xf')](_0x3da2b1)[_0x58a2('0x1e')](_0x4f7df6);};}exports['index']=function(_0x3c7b9a,_0x5308e2){var _0x276194={};var _0x25d705={'count':0x0,'rows':[]};var _0x34b7d9=_[_0x58a2('0x1f')](db[_0x58a2('0x20')][_0x58a2('0x21')],function(_0x1226cc){return{'name':_0x1226cc[_0x58a2('0x22')],'type':_0x1226cc[_0x58a2('0x23')][_0x58a2('0x24')]};});_0x276194=qs[_0x58a2('0x25')](_0x34b7d9,_0x3c7b9a);var _0x4bff13={'where':_0x276194[_0x58a2('0x26')]};return db[_0x58a2('0x20')][_0x58a2('0x12')](_0x4bff13)[_0x58a2('0x15')](function(_0x1f59d0){_0x25d705[_0x58a2('0x12')]=_0x1f59d0;_0x276194[_0x58a2('0x27')]=qs[_0x58a2('0x27')](_0x3c7b9a[_0x58a2('0x28')]);return db['ChatQueue'][_0x58a2('0x29')](_0x276194);})[_0x58a2('0x15')](function(_0x575a97){_0x25d705[_0x58a2('0x2a')]=_0x575a97;return _0x25d705;})['then'](respondWithFilteredResult(_0x5308e2,_0x276194))[_0x58a2('0x2b')](handleError(_0x5308e2,null));};exports[_0x58a2('0x2c')]=function(_0x423feb,_0x175a4d){var _0x508374={'raw':!![],'where':{'id':_0x423feb['params']['id']}},_0x123ef3={};_0x123ef3[_0x58a2('0x2d')]=_[_0x58a2('0x2e')](db['ChatQueue']['rawAttributes']);_0x123ef3[_0x58a2('0x28')]=_[_0x58a2('0x2e')](_0x423feb[_0x58a2('0x28')]);_0x123ef3['filters']=_['intersection'](_0x123ef3[_0x58a2('0x2d')],_0x123ef3[_0x58a2('0x28')]);_0x508374['attributes']=_[_0x58a2('0x2f')](_0x123ef3['model'],qs[_0x58a2('0x30')](_0x423feb['query']['fields']));_0x508374[_0x58a2('0x31')]=_0x508374[_0x58a2('0x31')]['length']?_0x508374[_0x58a2('0x31')]:_0x123ef3['model'];if(_0x423feb['query']['includeAll']){_0x508374[_0x58a2('0x27')]=[{'all':!![]}];}_0x508374=_[_0x58a2('0x32')]({},_0x508374,_0x423feb[_0x58a2('0x33')]);return db[_0x58a2('0x20')][_0x58a2('0x34')](_0x508374)[_0x58a2('0x15')](handleEntityNotFound(_0x175a4d,null))[_0x58a2('0x15')](respondWithResult(_0x175a4d,null))[_0x58a2('0x2b')](handleError(_0x175a4d,null));};exports[_0x58a2('0x35')]=function(_0xee6ac6,_0x4d0c86){return db[_0x58a2('0x20')]['create'](_0xee6ac6[_0x58a2('0x36')],{})[_0x58a2('0x15')](function(_0x377aa1){var _0x3eacc0=_0xee6ac6['user'][_0x58a2('0x17')]({'plain':!![]});if(!_0x3eacc0)throw new Error(_0x58a2('0x37'));if(_0x3eacc0[_0x58a2('0x38')]===_0x58a2('0x39')){var _0x584899=_0x377aa1[_0x58a2('0x17')]({'plain':!![]});var _0x5a9215='ChatQueues';return db[_0x58a2('0x3a')][_0x58a2('0x34')]({'where':{'name':_0x5a9215,'userProfileId':_0x3eacc0[_0x58a2('0x3b')]},'raw':!![]})[_0x58a2('0x15')](function(_0x3387a2){if(_0x3387a2&&_0x3387a2['autoAssociation']===0x0){return db[_0x58a2('0x19')][_0x58a2('0x35')]({'name':_0x584899['name'],'resourceId':_0x584899['id'],'type':_0x3387a2['name'],'sectionId':_0x3387a2['id']},{})[_0x58a2('0x15')](function(){return _0x377aa1;});}else{return _0x377aa1;}})['catch'](function(_0x58d4e8){logger['error'](_0x58a2('0x3c'),_0x58d4e8);throw _0x58d4e8;});}return _0x377aa1;})[_0x58a2('0x15')](respondWithResult(_0x4d0c86,0xc9))[_0x58a2('0x2b')](handleError(_0x4d0c86,null));};exports['update']=function(_0x1edab5,_0xfc281b){if(_0x1edab5[_0x58a2('0x36')]['id']){delete _0x1edab5['body']['id'];}return db[_0x58a2('0x20')]['find']({'where':{'id':_0x1edab5[_0x58a2('0x3d')]['id']}})[_0x58a2('0x15')](handleEntityNotFound(_0xfc281b,null))[_0x58a2('0x15')](saveUpdates(_0x1edab5[_0x58a2('0x36')],null))['then'](respondWithResult(_0xfc281b,null))['catch'](handleError(_0xfc281b,null));};exports[_0x58a2('0x16')]=function(_0x47f8df,_0x20a731){return db['ChatQueue'][_0x58a2('0x34')]({'where':{'id':_0x47f8df[_0x58a2('0x3d')]['id']}})['then'](handleEntityNotFound(_0x20a731,null))[_0x58a2('0x15')](removeEntity(_0x20a731,null))[_0x58a2('0x2b')](handleError(_0x20a731,null));};exports['describe']=function(_0x4917f8,_0x7903c9){return db['ChatQueue']['describe']()[_0x58a2('0x15')](respondWithResult(_0x7903c9,null))[_0x58a2('0x2b')](handleError(_0x7903c9,null));};exports[_0x58a2('0x3e')]=function(_0x20ee69,_0x3058cd){var _0x2220c8={'raw':!![],'where':{}},_0x168454={},_0xd1b879;return db[_0x58a2('0x20')][_0x58a2('0x3f')]({'where':{'id':_0x20ee69[_0x58a2('0x3d')]['id']}})[_0x58a2('0x15')](handleEntityNotFound(_0x3058cd,null))[_0x58a2('0x15')](function(_0x193836){if(_0x193836){_0xd1b879=_0x193836[_0x58a2('0x17')]({'plain':!![]});_0x168454[_0x58a2('0x2d')]=_[_0x58a2('0x2e')](db['UserChatQueue']['rawAttributes']);_0x168454[_0x58a2('0x28')]=_[_0x58a2('0x2e')](_0x20ee69[_0x58a2('0x28')]);_0x168454['filters']=_[_0x58a2('0x2f')](_0x168454[_0x58a2('0x2d')],_0x168454[_0x58a2('0x28')]);_0x2220c8[_0x58a2('0x31')]=_[_0x58a2('0x2f')](_0x168454[_0x58a2('0x2d')],qs[_0x58a2('0x30')](_0x20ee69[_0x58a2('0x28')][_0x58a2('0x30')]));_0x2220c8['attributes']=_0x2220c8[_0x58a2('0x31')][_0x58a2('0x40')]?_0x2220c8['attributes']:_0x168454[_0x58a2('0x2d')];if(!_0x20ee69['query']['hasOwnProperty'](_0x58a2('0x41'))){_0x2220c8[_0x58a2('0x13')]=qs['limit'](_0x20ee69[_0x58a2('0x28')][_0x58a2('0x13')]);_0x2220c8[_0x58a2('0x10')]=qs[_0x58a2('0x10')](_0x20ee69['query']['offset']);}_0x2220c8[_0x58a2('0x42')]=qs[_0x58a2('0x43')](_0x20ee69['query'][_0x58a2('0x43')]);_0x2220c8[_0x58a2('0x26')]=qs[_0x58a2('0x44')](_[_0x58a2('0x45')](_0x20ee69[_0x58a2('0x28')],_0x168454[_0x58a2('0x44')]));_0x2220c8[_0x58a2('0x26')]['ChatQueueId']=_0x193836['id'];if(_0x20ee69[_0x58a2('0x28')]['filter']){_0x2220c8['where']=_[_0x58a2('0x32')](_0x2220c8[_0x58a2('0x26')],{'$or':_[_0x58a2('0x1f')](_0x2220c8['attributes'],function(_0x402d5b){var _0x278f55={};_0x278f55[_0x402d5b]={'$like':'%'+_0x20ee69[_0x58a2('0x28')]['filter']+'%'};return _0x278f55;})});}_0x2220c8=_[_0x58a2('0x32')]({},_0x2220c8,_0x20ee69[_0x58a2('0x33')]);return db[_0x58a2('0x46')][_0x58a2('0x29')](_0x2220c8);}})[_0x58a2('0x15')](function(_0x366175){if(_0x366175){return db['User'][_0x58a2('0x47')]({'where':{'id':_['map'](_0x366175,'UserId'),'role':_0x58a2('0x48')},'attributes':['id',_0x58a2('0x1d'),_0x58a2('0x49'),'updatedAt',_0x58a2('0x4a')]});}})[_0x58a2('0x15')](function(_0x5f5d55){if(_0x5f5d55){return{'count':_0x5f5d55[_0x58a2('0x12')],'rows':_[_0x58a2('0x1f')](_0x5f5d55[_0x58a2('0x2a')],function(_0x4fd85a){return{'membername':_0x4fd85a[_0x58a2('0x1d')],'UserId':_0x4fd85a['id'],'queue_name':_0xd1b879[_0x58a2('0x1d')],'ChatQueueId':_0xd1b879['id'],'interface':util['format'](_0x58a2('0x4b'),_0x58a2('0x4c'),_0x4fd85a[_0x58a2('0x1d')]),'penalty':0x0,'paused':_0x4fd85a[_0x58a2('0x49')],'createdAt':_0x4fd85a[_0x58a2('0x4a')],'updatedAt':_0x4fd85a[_0x58a2('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3058cd,_0x2220c8))[_0x58a2('0x2b')](handleError(_0x3058cd,null));};exports[_0x58a2('0x4e')]=function(_0x383316,_0x5da002){var _0x5c4598={};var _0x4ac150={};var _0x2519a8;var _0x2b7637;return db['ChatQueue'][_0x58a2('0x3f')]({'where':{'id':_0x383316[_0x58a2('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5da002,null))[_0x58a2('0x15')](function(_0x5d6550){if(_0x5d6550){_0x2519a8=_0x5d6550;_0x4ac150['model']=_[_0x58a2('0x2e')](db[_0x58a2('0x4f')][_0x58a2('0x21')]);_0x4ac150[_0x58a2('0x28')]=_[_0x58a2('0x2e')](_0x383316[_0x58a2('0x28')]);_0x4ac150[_0x58a2('0x44')]=_[_0x58a2('0x2f')](_0x4ac150[_0x58a2('0x2d')],_0x4ac150[_0x58a2('0x28')]);_0x5c4598[_0x58a2('0x31')]=_[_0x58a2('0x2f')](_0x4ac150[_0x58a2('0x2d')],qs[_0x58a2('0x30')](_0x383316[_0x58a2('0x28')][_0x58a2('0x30')]));_0x5c4598[_0x58a2('0x31')]=_0x5c4598[_0x58a2('0x31')][_0x58a2('0x40')]?_0x5c4598['attributes']:_0x4ac150[_0x58a2('0x2d')];_0x5c4598['order']=qs[_0x58a2('0x43')](_0x383316[_0x58a2('0x28')][_0x58a2('0x43')]);_0x5c4598[_0x58a2('0x26')]=qs['filters'](_['pick'](_0x383316['query'],_0x4ac150[_0x58a2('0x44')]));if(_0x383316[_0x58a2('0x28')]['filter']){_0x5c4598[_0x58a2('0x26')]=_[_0x58a2('0x32')](_0x5c4598[_0x58a2('0x26')],{'$or':_[_0x58a2('0x1f')](_0x5c4598[_0x58a2('0x31')],function(_0x1dab55){var _0x5b6166={};_0x5b6166[_0x1dab55]={'$like':'%'+_0x383316['query'][_0x58a2('0x50')]+'%'};return _0x5b6166;})});}_0x5c4598=_[_0x58a2('0x32')]({},_0x5c4598,_0x383316[_0x58a2('0x33')]);return _0x2519a8[_0x58a2('0x4e')](_0x5c4598);}})[_0x58a2('0x15')](function(_0x241163){if(_0x241163){_0x2b7637=_0x241163['length'];if(!_0x383316[_0x58a2('0x28')]['hasOwnProperty'](_0x58a2('0x41'))){_0x5c4598[_0x58a2('0x13')]=qs['limit'](_0x383316['query']['limit']);_0x5c4598[_0x58a2('0x10')]=qs[_0x58a2('0x10')](_0x383316[_0x58a2('0x28')][_0x58a2('0x10')]);}return _0x2519a8['getTeams'](_0x5c4598);}})['then'](function(_0x16c1ec){if(_0x16c1ec){return _0x16c1ec?{'count':_0x2b7637,'rows':_0x16c1ec}:null;}})['then'](respondWithResult(_0x5da002,null))[_0x58a2('0x2b')](handleError(_0x5da002,null));};exports['addTeams']=function(_0xa1f741,_0x2f0d0e){var _0x400fd2=_0xa1f741[_0x58a2('0x36')][_0x58a2('0x51')];return db['Team'][_0x58a2('0x29')]({'where':{'id':_0x400fd2},'attributes':['id'],'include':[{'model':db[_0x58a2('0x52')],'as':_0x58a2('0x53'),'attributes':['id','name','online',_0x58a2('0x54'),_0x58a2('0x55')],'raw':!![]}]})[_0x58a2('0x15')](function(_0x45879d){if(_0x45879d){var _0x1077a5=_[_0x58a2('0x56')](_0x45879d,function(_0xc99838){var _0x31e992=_0xc99838[_0x58a2('0x17')]({'plain':!![]});return _0x31e992[_0x58a2('0x53')];});return db[_0x58a2('0x20')]['find']({'where':{'id':_0xa1f741[_0x58a2('0x3d')]['id']}})[_0x58a2('0x15')](function(_0x343d0a){return db[_0x58a2('0x57')]['transaction'](function(_0x408ffc){return _0x343d0a[_0x58a2('0x58')](_0x400fd2,{'transaction':_0x408ffc})[_0x58a2('0x15')](function(){return BPromise[_0x58a2('0x59')](_0x1077a5,function(_0x24ab2b){return db['UserChatQueue'][_0x58a2('0x5a')]({'where':{'UserId':_0x24ab2b['id'],'ChatQueueId':_0xa1f741['params']['id']},'transaction':_0x408ffc});});})[_0x58a2('0x15')](function(){_0x1077a5['forEach'](function(_0x5e2a9c){socket['emit'](_0x58a2('0x5b'),{'UserId':_0x5e2a9c['id'],'ChatQueueId':_0x343d0a['id']});});});});});}})[_0x58a2('0x15')](respondWithStatusCode(_0x2f0d0e,null))['catch'](handleError(_0x2f0d0e,null));};exports[_0x58a2('0x5c')]=function(_0x3da9fc,_0x47efb4){return db[_0x58a2('0x4f')]['findAll']({'where':{'id':_0x3da9fc[_0x58a2('0x28')][_0x58a2('0x51')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x58a2('0x15')](handleEntityNotFound(_0x47efb4,null))[_0x58a2('0x15')](function(_0x3b03f6){var _0x51a593=_[_0x58a2('0x1f')](_0x3b03f6,'id');var _0xed6d92=[];var _0x301afd=[];var _0x993553=squel['select']();_0x993553[_0x58a2('0x5d')](_0x58a2('0x5e'))[_0x58a2('0x5f')]('team_has_chat_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x58a2('0x60'),_0x3da9fc[_0x58a2('0x3d')]['id']);for(var _0x103ca0=0x0;_0x103ca0<_0x3b03f6[_0x58a2('0x40')];_0x103ca0+=0x1){let _0x4371fc=_0x3b03f6[_0x103ca0];for(var _0x1958a7=0x0;_0x1958a7<_0x4371fc[_0x58a2('0x53')][_0x58a2('0x40')];_0x1958a7+=0x1){let _0x48d0e1=_0x4371fc[_0x58a2('0x53')][_0x1958a7];var _0x15642b=_0x993553['clone']();_0x15642b[_0x58a2('0x26')](_0x58a2('0x61'),_0x48d0e1['id']);_0x301afd[_0x58a2('0x62')](db[_0x58a2('0x57')][_0x58a2('0x28')](_0x15642b['toString'](),{'type':db[_0x58a2('0x57')][_0x58a2('0x63')][_0x58a2('0x64')]})[_0x58a2('0x15')](function(_0x106ba3){if(_0x106ba3[_0x58a2('0x40')]===0x1){return _0x48d0e1['id'];}else{var _0x4c623b=_[_0x58a2('0x65')](_[_0x58a2('0x1f')](_0x106ba3,_0x58a2('0x66')),function(_0x1704aa){return _[_0x58a2('0x67')](_0x51a593,_0x1704aa);});if(_0x4c623b){return _0x48d0e1['id'];}}}));}}return BPromise[_0x58a2('0x68')](_0x301afd)[_0x58a2('0x15')](function(_0x2b381f){_0xed6d92=_(_0xed6d92)[_0x58a2('0x69')](_0x2b381f)['compact']()['value']();return db[_0x58a2('0x20')][_0x58a2('0x34')]({'where':{'id':_0x3da9fc['params']['id']}})['then'](function(_0xf3b157){return db[_0x58a2('0x57')][_0x58a2('0x6a')](function(_0x4483e5){return _0xf3b157[_0x58a2('0x5c')](_0x3da9fc[_0x58a2('0x28')][_0x58a2('0x51')],{'transaction':_0x4483e5})['then'](function(){if(!_[_0x58a2('0x6b')](_0xed6d92)){return _0xf3b157[_0x58a2('0x6c')](_0xed6d92,{'transaction':_0x4483e5});}})[_0x58a2('0x15')](function(){_0xed6d92['forEach'](function(_0x1b0ec7){socket[_0x58a2('0x6d')](_0x58a2('0x6e'),{'UserId':_0x1b0ec7,'ChatQueueId':_0xf3b157['id']});});});});});});})[_0x58a2('0x15')](respondWithStatusCode(_0x47efb4,null))[_0x58a2('0x2b')](handleError(_0x47efb4,null));};exports['addAgents']=function(_0x510463,_0x33e19a){return db['ChatQueue']['find']({'where':{'id':_0x510463[_0x58a2('0x3d')]['id']}})[_0x58a2('0x15')](handleEntityNotFound(_0x33e19a,null))['then'](function(_0x200108){if(_0x200108){return _0x200108['addAgents'](_0x510463[_0x58a2('0x36')][_0x58a2('0x51')],_[_0x58a2('0x6f')](_0x510463[_0x58a2('0x36')],['ids','id'])||{})[_0x58a2('0x70')](function(_0x713134){for(var _0x2bb710=0x0;_0x2bb710<_0x510463['body'][_0x58a2('0x51')]['length'];_0x2bb710+=0x1){socket[_0x58a2('0x6d')](_0x58a2('0x5b'),{'UserId':Number(_0x510463[_0x58a2('0x36')][_0x58a2('0x51')][_0x2bb710]),'ChatQueueId':Number(_0x510463[_0x58a2('0x3d')]['id'])});}return _0x713134;});}})['then'](respondWithResult(_0x33e19a,null))[_0x58a2('0x2b')](handleError(_0x33e19a,null));};exports[_0x58a2('0x6c')]=function(_0x1da349,_0x3f6905){return db[_0x58a2('0x20')]['find']({'where':{'id':_0x1da349[_0x58a2('0x3d')]['id']}})[_0x58a2('0x15')](handleEntityNotFound(_0x3f6905,null))[_0x58a2('0x15')](function(_0x426f93){if(_0x426f93){return _0x426f93[_0x58a2('0x6c')](_0x1da349[_0x58a2('0x28')]['ids'])['then'](function(){if(_[_0x58a2('0x71')](_0x1da349[_0x58a2('0x28')][_0x58a2('0x51')])){for(var _0x3dd624=0x0;_0x3dd624<_0x1da349['query'][_0x58a2('0x51')][_0x58a2('0x40')];_0x3dd624+=0x1){socket[_0x58a2('0x6d')](_0x58a2('0x6e'),{'UserId':Number(_0x1da349[_0x58a2('0x28')][_0x58a2('0x51')][_0x3dd624]),'ChatQueueId':Number(_0x1da349[_0x58a2('0x3d')]['id'])});}}else{socket[_0x58a2('0x6d')](_0x58a2('0x6e'),{'UserId':Number(_0x1da349[_0x58a2('0x28')][_0x58a2('0x51')]),'ChatQueueId':Number(_0x1da349[_0x58a2('0x3d')]['id'])});}});}})[_0x58a2('0x15')](respondWithStatusCode(_0x3f6905,null))[_0x58a2('0x2b')](handleError(_0x3f6905,null));};exports[_0x58a2('0x72')]=function(_0x59866c,_0x49f3e0){var _0x3c020e={};var _0x257131={};var _0x28f0d7;var _0x3e3757;return db[_0x58a2('0x20')][_0x58a2('0x3f')]({'where':{'id':_0x59866c[_0x58a2('0x3d')]['id']}})[_0x58a2('0x15')](handleEntityNotFound(_0x49f3e0,null))[_0x58a2('0x15')](function(_0x238396){if(_0x238396){_0x28f0d7=_0x238396;_0x257131[_0x58a2('0x2d')]=_[_0x58a2('0x2e')](db[_0x58a2('0x52')][_0x58a2('0x21')]);_0x257131[_0x58a2('0x28')]=_[_0x58a2('0x2e')](_0x59866c[_0x58a2('0x28')]);_0x257131[_0x58a2('0x44')]=_[_0x58a2('0x2f')](_0x257131[_0x58a2('0x2d')],_0x257131[_0x58a2('0x28')]);_0x3c020e[_0x58a2('0x31')]=_[_0x58a2('0x2f')](_0x257131[_0x58a2('0x2d')],qs[_0x58a2('0x30')](_0x59866c['query']['fields']));_0x3c020e[_0x58a2('0x31')]=_0x3c020e[_0x58a2('0x31')][_0x58a2('0x40')]?_0x3c020e[_0x58a2('0x31')]:_0x257131[_0x58a2('0x2d')];_0x3c020e[_0x58a2('0x42')]=qs[_0x58a2('0x43')](_0x59866c[_0x58a2('0x28')]['sort']);_0x3c020e[_0x58a2('0x26')]=qs['filters'](_[_0x58a2('0x45')](_0x59866c['query'],_0x257131[_0x58a2('0x44')]));if(_0x59866c[_0x58a2('0x28')]['filter']){_0x3c020e['where']=_[_0x58a2('0x32')](_0x3c020e['where'],{'$or':_[_0x58a2('0x1f')](_0x3c020e[_0x58a2('0x31')],function(_0x5cbfb){var _0xe08006={};_0xe08006[_0x5cbfb]={'$like':'%'+_0x59866c['query'][_0x58a2('0x50')]+'%'};return _0xe08006;})});}_0x3c020e=_[_0x58a2('0x32')]({},_0x3c020e,_0x59866c[_0x58a2('0x33')]);return _0x28f0d7[_0x58a2('0x72')](_0x3c020e);}})[_0x58a2('0x15')](function(_0x5dc26c){if(_0x5dc26c){_0x3e3757=_0x5dc26c[_0x58a2('0x40')];if(!_0x59866c[_0x58a2('0x28')]['hasOwnProperty'](_0x58a2('0x41'))){_0x3c020e[_0x58a2('0x13')]=qs[_0x58a2('0x13')](_0x59866c['query']['limit']);_0x3c020e[_0x58a2('0x10')]=qs[_0x58a2('0x10')](_0x59866c[_0x58a2('0x28')][_0x58a2('0x10')]);}return _0x28f0d7[_0x58a2('0x72')](_0x3c020e);}})[_0x58a2('0x15')](function(_0x2fb75c){if(_0x2fb75c){return _0x2fb75c?{'count':_0x3e3757,'rows':_0x2fb75c}:null;}})[_0x58a2('0x15')](respondWithResult(_0x49f3e0,null))['catch'](handleError(_0x49f3e0,null));};
\ No newline at end of file
+var _0x879c=['sendStatus','error','stack','name','index','map','fieldName','type','key','getOptions','where','ChatQueue','count','include','query','findAll','rows','catch','show','params','model','keys','rawAttributes','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','describe','getMembers','findOne','UserChatQueue','filters','hasOwnProperty','nolimit','limit','order','sort','pick','ChatQueueId','filter','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','Team','getTeams','addTeams','ids','User','online','interface','flatMap','Agents','sequelize','transaction','each','forEach','userChatQueue:save','removeTeams','select','field','from','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','emit','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','end','undefined','offset','status','set','Content-Range','json','update','then','destroy','ChatQueues','UserProfileResource'];(function(_0x390fa7,_0xb1b52c){var _0x3dddbe=function(_0x5aa8e6){while(--_0x5aa8e6){_0x390fa7['push'](_0x390fa7['shift']());}};_0x3dddbe(++_0xb1b52c);}(_0x879c,0x153));var _0xc879=function(_0x3ccc28,_0x5036d5){_0x3ccc28=_0x3ccc28-0x0;var _0x47dd45=_0x879c[_0x3ccc28];return _0x47dd45;};'use strict';var BPromise=require(_0xc879('0x0'));var util=require(_0xc879('0x1'));var _=require('lodash');var squel=require(_0xc879('0x2'));var Redis=require(_0xc879('0x3'));var qs=require(_0xc879('0x4'));var logger=require('../../config/logger')('api');var config=require(_0xc879('0x5'));var db=require(_0xc879('0x6'))['db'];config[_0xc879('0x7')]=_[_0xc879('0x8')](config[_0xc879('0x7')],{'host':_0xc879('0x9'),'port':0x18eb});var socket=require(_0xc879('0xa'))(new Redis(config[_0xc879('0x7')]));require('./chatQueue.socket')[_0xc879('0xb')](socket);function respondWithStatusCode(_0x18a3d2,_0x157f6c){_0x157f6c=_0x157f6c||0xcc;return function(_0x3700ce){if(_0x3700ce){return _0x18a3d2['sendStatus'](_0x157f6c);}return _0x18a3d2['status'](_0x157f6c)[_0xc879('0xc')]();};}function respondWithResult(_0x38715a,_0x1c6263){_0x1c6263=_0x1c6263||0xc8;return function(_0x1f13b9){if(_0x1f13b9){return _0x38715a['status'](_0x1c6263)['json'](_0x1f13b9);}};}function respondWithFilteredResult(_0x2e5829,_0x375941){return function(_0x2c2653){if(_0x2c2653){var _0x5478b2=typeof _0x375941['offset']==='undefined'&&typeof _0x375941['limit']===_0xc879('0xd');var _0x6f9cab=_0x2c2653['count'];var _0x483ba6=_0x5478b2?0x0:_0x375941[_0xc879('0xe')];var _0x31c9ed=_0x5478b2?_0x2c2653['count']:_0x375941[_0xc879('0xe')]+_0x375941['limit'];var _0x4841c4;if(_0x31c9ed>=_0x6f9cab){_0x31c9ed=_0x6f9cab;_0x4841c4=0xc8;}else{_0x4841c4=0xce;}_0x2e5829[_0xc879('0xf')](_0x4841c4);return _0x2e5829[_0xc879('0x10')](_0xc879('0x11'),_0x483ba6+'-'+_0x31c9ed+'/'+_0x6f9cab)[_0xc879('0x12')](_0x2c2653);}return null;};}function saveUpdates(_0x21b975){return function(_0x8631c3){if(_0x8631c3){return _0x8631c3[_0xc879('0x13')](_0x21b975)[_0xc879('0x14')](function(_0x50fe4a){return _0x50fe4a;});}return null;};}function removeEntity(_0x19d6b7){return function(_0x4aca43){if(_0x4aca43){return _0x4aca43[_0xc879('0x15')]()[_0xc879('0x14')](function(){var _0x324ff3=_0x4aca43['get']({'plain':!![]});var _0x460655=_0xc879('0x16');return db[_0xc879('0x17')]['destroy']({'where':{'type':_0x460655,'resourceId':_0x324ff3['id']}})[_0xc879('0x14')](function(){return _0x4aca43;});})[_0xc879('0x14')](function(){_0x19d6b7['status'](0xcc)[_0xc879('0xc')]();});}};}function handleEntityNotFound(_0x31301c){return function(_0x5a1968){if(!_0x5a1968){_0x31301c[_0xc879('0x18')](0x194);}return _0x5a1968;};}function handleError(_0x2044ce,_0x58c9dc){_0x58c9dc=_0x58c9dc||0x1f4;return function(_0x183ae5){logger[_0xc879('0x19')](_0x183ae5[_0xc879('0x1a')]);if(_0x183ae5[_0xc879('0x1b')]){delete _0x183ae5[_0xc879('0x1b')];}_0x2044ce[_0xc879('0xf')](_0x58c9dc)['send'](_0x183ae5);};}exports[_0xc879('0x1c')]=function(_0xb61693,_0x3243ce){var _0x31e0d5={};var _0x19b2df={'count':0x0,'rows':[]};var _0xfdda72=_[_0xc879('0x1d')](db['ChatQueue']['rawAttributes'],function(_0x1a6165){return{'name':_0x1a6165[_0xc879('0x1e')],'type':_0x1a6165[_0xc879('0x1f')][_0xc879('0x20')]};});_0x31e0d5=qs[_0xc879('0x21')](_0xfdda72,_0xb61693);var _0x5a2b91={'where':_0x31e0d5[_0xc879('0x22')]};return db[_0xc879('0x23')][_0xc879('0x24')](_0x5a2b91)['then'](function(_0x4eed06){_0x19b2df[_0xc879('0x24')]=_0x4eed06;_0x31e0d5[_0xc879('0x25')]=qs[_0xc879('0x25')](_0xb61693[_0xc879('0x26')]);return db[_0xc879('0x23')][_0xc879('0x27')](_0x31e0d5);})[_0xc879('0x14')](function(_0x25a8a5){_0x19b2df[_0xc879('0x28')]=_0x25a8a5;return _0x19b2df;})[_0xc879('0x14')](respondWithFilteredResult(_0x3243ce,_0x31e0d5))[_0xc879('0x29')](handleError(_0x3243ce,null));};exports[_0xc879('0x2a')]=function(_0x2c16b1,_0x507968){var _0x1a5359={'raw':!![],'where':{'id':_0x2c16b1[_0xc879('0x2b')]['id']}},_0x451e31={};_0x451e31[_0xc879('0x2c')]=_[_0xc879('0x2d')](db[_0xc879('0x23')][_0xc879('0x2e')]);_0x451e31[_0xc879('0x26')]=_[_0xc879('0x2d')](_0x2c16b1[_0xc879('0x26')]);_0x451e31['filters']=_[_0xc879('0x2f')](_0x451e31[_0xc879('0x2c')],_0x451e31['query']);_0x1a5359[_0xc879('0x30')]=_[_0xc879('0x2f')](_0x451e31[_0xc879('0x2c')],qs[_0xc879('0x31')](_0x2c16b1['query'][_0xc879('0x31')]));_0x1a5359[_0xc879('0x30')]=_0x1a5359['attributes'][_0xc879('0x32')]?_0x1a5359['attributes']:_0x451e31['model'];if(_0x2c16b1[_0xc879('0x26')][_0xc879('0x33')]){_0x1a5359['include']=[{'all':!![]}];}_0x1a5359=_[_0xc879('0x34')]({},_0x1a5359,_0x2c16b1[_0xc879('0x35')]);return db[_0xc879('0x23')][_0xc879('0x36')](_0x1a5359)['then'](handleEntityNotFound(_0x507968,null))[_0xc879('0x14')](respondWithResult(_0x507968,null))[_0xc879('0x29')](handleError(_0x507968,null));};exports[_0xc879('0x37')]=function(_0x129f85,_0x105d4c){return db[_0xc879('0x23')][_0xc879('0x37')](_0x129f85[_0xc879('0x38')],{})['then'](function(_0x5d3cce){var _0x2591b2=_0x129f85[_0xc879('0x39')][_0xc879('0x3a')]({'plain':!![]});if(!_0x2591b2)throw new Error(_0xc879('0x3b'));if(_0x2591b2[_0xc879('0x3c')]===_0xc879('0x39')){var _0x16fb1a=_0x5d3cce[_0xc879('0x3a')]({'plain':!![]});var _0x19210e=_0xc879('0x16');return db[_0xc879('0x3d')]['find']({'where':{'name':_0x19210e,'userProfileId':_0x2591b2[_0xc879('0x3e')]},'raw':!![]})[_0xc879('0x14')](function(_0x501ce6){if(_0x501ce6&&_0x501ce6['autoAssociation']===0x0){return db[_0xc879('0x17')]['create']({'name':_0x16fb1a['name'],'resourceId':_0x16fb1a['id'],'type':_0x501ce6[_0xc879('0x1b')],'sectionId':_0x501ce6['id']},{})[_0xc879('0x14')](function(){return _0x5d3cce;});}else{return _0x5d3cce;}})[_0xc879('0x29')](function(_0x42b378){logger[_0xc879('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42b378);throw _0x42b378;});}return _0x5d3cce;})[_0xc879('0x14')](respondWithResult(_0x105d4c,0xc9))[_0xc879('0x29')](handleError(_0x105d4c,null));};exports['update']=function(_0x237cb3,_0x24a9f4){if(_0x237cb3['body']['id']){delete _0x237cb3[_0xc879('0x38')]['id'];}return db[_0xc879('0x23')]['find']({'where':{'id':_0x237cb3[_0xc879('0x2b')]['id']}})[_0xc879('0x14')](handleEntityNotFound(_0x24a9f4,null))[_0xc879('0x14')](saveUpdates(_0x237cb3['body'],null))[_0xc879('0x14')](respondWithResult(_0x24a9f4,null))[_0xc879('0x29')](handleError(_0x24a9f4,null));};exports[_0xc879('0x15')]=function(_0x1ba7cc,_0x4abe70){return db[_0xc879('0x23')][_0xc879('0x36')]({'where':{'id':_0x1ba7cc['params']['id']}})[_0xc879('0x14')](handleEntityNotFound(_0x4abe70,null))[_0xc879('0x14')](removeEntity(_0x4abe70,null))[_0xc879('0x29')](handleError(_0x4abe70,null));};exports['describe']=function(_0x2c99ce,_0x461857){return db['ChatQueue'][_0xc879('0x3f')]()[_0xc879('0x14')](respondWithResult(_0x461857,null))[_0xc879('0x29')](handleError(_0x461857,null));};exports[_0xc879('0x40')]=function(_0x39a6b5,_0x4ff21d){var _0x2c70ae={'raw':!![],'where':{}},_0x3f7d89={},_0x46a3f0;return db[_0xc879('0x23')][_0xc879('0x41')]({'where':{'id':_0x39a6b5[_0xc879('0x2b')]['id']}})[_0xc879('0x14')](handleEntityNotFound(_0x4ff21d,null))[_0xc879('0x14')](function(_0x3f2db1){if(_0x3f2db1){_0x46a3f0=_0x3f2db1[_0xc879('0x3a')]({'plain':!![]});_0x3f7d89[_0xc879('0x2c')]=_[_0xc879('0x2d')](db[_0xc879('0x42')][_0xc879('0x2e')]);_0x3f7d89['query']=_[_0xc879('0x2d')](_0x39a6b5[_0xc879('0x26')]);_0x3f7d89[_0xc879('0x43')]=_[_0xc879('0x2f')](_0x3f7d89['model'],_0x3f7d89[_0xc879('0x26')]);_0x2c70ae[_0xc879('0x30')]=_[_0xc879('0x2f')](_0x3f7d89[_0xc879('0x2c')],qs['fields'](_0x39a6b5['query'][_0xc879('0x31')]));_0x2c70ae[_0xc879('0x30')]=_0x2c70ae[_0xc879('0x30')][_0xc879('0x32')]?_0x2c70ae[_0xc879('0x30')]:_0x3f7d89[_0xc879('0x2c')];if(!_0x39a6b5[_0xc879('0x26')][_0xc879('0x44')](_0xc879('0x45'))){_0x2c70ae[_0xc879('0x46')]=qs[_0xc879('0x46')](_0x39a6b5[_0xc879('0x26')][_0xc879('0x46')]);_0x2c70ae['offset']=qs[_0xc879('0xe')](_0x39a6b5[_0xc879('0x26')][_0xc879('0xe')]);}_0x2c70ae[_0xc879('0x47')]=qs[_0xc879('0x48')](_0x39a6b5['query'][_0xc879('0x48')]);_0x2c70ae[_0xc879('0x22')]=qs[_0xc879('0x43')](_[_0xc879('0x49')](_0x39a6b5[_0xc879('0x26')],_0x3f7d89[_0xc879('0x43')]));_0x2c70ae[_0xc879('0x22')][_0xc879('0x4a')]=_0x3f2db1['id'];if(_0x39a6b5[_0xc879('0x26')][_0xc879('0x4b')]){_0x2c70ae['where']=_[_0xc879('0x34')](_0x2c70ae[_0xc879('0x22')],{'$or':_[_0xc879('0x1d')](_0x2c70ae[_0xc879('0x30')],function(_0x21ae3e){var _0x81349e={};_0x81349e[_0x21ae3e]={'$like':'%'+_0x39a6b5[_0xc879('0x26')][_0xc879('0x4b')]+'%'};return _0x81349e;})});}_0x2c70ae=_[_0xc879('0x34')]({},_0x2c70ae,_0x39a6b5[_0xc879('0x35')]);return db[_0xc879('0x42')][_0xc879('0x27')](_0x2c70ae);}})['then'](function(_0x4d23bc){if(_0x4d23bc){return db['User'][_0xc879('0x4c')]({'where':{'id':_['map'](_0x4d23bc,_0xc879('0x4d')),'role':_0xc879('0x4e')},'attributes':['id',_0xc879('0x1b'),_0xc879('0x4f'),_0xc879('0x50'),_0xc879('0x51')]});}})[_0xc879('0x14')](function(_0x17a4f9){if(_0x17a4f9){return{'count':_0x17a4f9[_0xc879('0x24')],'rows':_[_0xc879('0x1d')](_0x17a4f9[_0xc879('0x28')],function(_0x376290){return{'membername':_0x376290['name'],'UserId':_0x376290['id'],'queue_name':_0x46a3f0[_0xc879('0x1b')],'ChatQueueId':_0x46a3f0['id'],'interface':util['format']('%s/%s','SIP',_0x376290[_0xc879('0x1b')]),'penalty':0x0,'paused':_0x376290[_0xc879('0x4f')],'createdAt':_0x376290['createdAt'],'updatedAt':_0x376290[_0xc879('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc879('0x14')](respondWithFilteredResult(_0x4ff21d,_0x2c70ae))['catch'](handleError(_0x4ff21d,null));};exports['getTeams']=function(_0x47fbfb,_0x1ffdc9){var _0x38bb30={};var _0x391f3e={};var _0xdeeeaa;var _0x459452;return db['ChatQueue'][_0xc879('0x41')]({'where':{'id':_0x47fbfb[_0xc879('0x2b')]['id']}})['then'](handleEntityNotFound(_0x1ffdc9,null))[_0xc879('0x14')](function(_0x5b1cee){if(_0x5b1cee){_0xdeeeaa=_0x5b1cee;_0x391f3e[_0xc879('0x2c')]=_[_0xc879('0x2d')](db[_0xc879('0x52')][_0xc879('0x2e')]);_0x391f3e[_0xc879('0x26')]=_['keys'](_0x47fbfb['query']);_0x391f3e['filters']=_[_0xc879('0x2f')](_0x391f3e[_0xc879('0x2c')],_0x391f3e[_0xc879('0x26')]);_0x38bb30[_0xc879('0x30')]=_[_0xc879('0x2f')](_0x391f3e[_0xc879('0x2c')],qs['fields'](_0x47fbfb[_0xc879('0x26')][_0xc879('0x31')]));_0x38bb30[_0xc879('0x30')]=_0x38bb30[_0xc879('0x30')][_0xc879('0x32')]?_0x38bb30[_0xc879('0x30')]:_0x391f3e[_0xc879('0x2c')];_0x38bb30[_0xc879('0x47')]=qs[_0xc879('0x48')](_0x47fbfb[_0xc879('0x26')][_0xc879('0x48')]);_0x38bb30[_0xc879('0x22')]=qs[_0xc879('0x43')](_[_0xc879('0x49')](_0x47fbfb[_0xc879('0x26')],_0x391f3e[_0xc879('0x43')]));if(_0x47fbfb[_0xc879('0x26')][_0xc879('0x4b')]){_0x38bb30[_0xc879('0x22')]=_[_0xc879('0x34')](_0x38bb30[_0xc879('0x22')],{'$or':_[_0xc879('0x1d')](_0x38bb30[_0xc879('0x30')],function(_0x26a4d){var _0x4eff4c={};_0x4eff4c[_0x26a4d]={'$like':'%'+_0x47fbfb['query'][_0xc879('0x4b')]+'%'};return _0x4eff4c;})});}_0x38bb30=_[_0xc879('0x34')]({},_0x38bb30,_0x47fbfb[_0xc879('0x35')]);return _0xdeeeaa['getTeams'](_0x38bb30);}})[_0xc879('0x14')](function(_0x4cd76c){if(_0x4cd76c){_0x459452=_0x4cd76c[_0xc879('0x32')];if(!_0x47fbfb[_0xc879('0x26')][_0xc879('0x44')](_0xc879('0x45'))){_0x38bb30[_0xc879('0x46')]=qs[_0xc879('0x46')](_0x47fbfb[_0xc879('0x26')]['limit']);_0x38bb30['offset']=qs['offset'](_0x47fbfb[_0xc879('0x26')]['offset']);}return _0xdeeeaa[_0xc879('0x53')](_0x38bb30);}})[_0xc879('0x14')](function(_0x615d6f){if(_0x615d6f){return _0x615d6f?{'count':_0x459452,'rows':_0x615d6f}:null;}})[_0xc879('0x14')](respondWithResult(_0x1ffdc9,null))[_0xc879('0x29')](handleError(_0x1ffdc9,null));};exports[_0xc879('0x54')]=function(_0x3eeeee,_0x21d876){var _0xf97f1f=_0x3eeeee['body'][_0xc879('0x55')];return db[_0xc879('0x52')][_0xc879('0x27')]({'where':{'id':_0xf97f1f},'attributes':['id'],'include':[{'model':db[_0xc879('0x56')],'as':'Agents','attributes':['id',_0xc879('0x1b'),_0xc879('0x57'),'voicePause',_0xc879('0x58')],'raw':!![]}]})[_0xc879('0x14')](function(_0x5f06a6){if(_0x5f06a6){var _0x2c5fb6=_[_0xc879('0x59')](_0x5f06a6,function(_0x15af03){var _0x4f4e31=_0x15af03[_0xc879('0x3a')]({'plain':!![]});return _0x4f4e31[_0xc879('0x5a')];});return db[_0xc879('0x23')][_0xc879('0x36')]({'where':{'id':_0x3eeeee[_0xc879('0x2b')]['id']}})[_0xc879('0x14')](function(_0x166db5){return db[_0xc879('0x5b')][_0xc879('0x5c')](function(_0x55332b){return _0x166db5[_0xc879('0x54')](_0xf97f1f,{'transaction':_0x55332b})['then'](function(){return BPromise[_0xc879('0x5d')](_0x2c5fb6,function(_0x1868fa){return db[_0xc879('0x42')]['findOrCreate']({'where':{'UserId':_0x1868fa['id'],'ChatQueueId':_0x3eeeee[_0xc879('0x2b')]['id']},'transaction':_0x55332b});});})[_0xc879('0x14')](function(){_0x2c5fb6[_0xc879('0x5e')](function(_0x5afa40){socket['emit'](_0xc879('0x5f'),{'UserId':_0x5afa40['id'],'ChatQueueId':_0x166db5['id']});});});});});}})[_0xc879('0x14')](respondWithStatusCode(_0x21d876,null))[_0xc879('0x29')](handleError(_0x21d876,null));};exports[_0xc879('0x60')]=function(_0x3bcdf2,_0x3a625a){return db[_0xc879('0x52')][_0xc879('0x27')]({'where':{'id':_0x3bcdf2[_0xc879('0x26')][_0xc879('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc879('0x14')](handleEntityNotFound(_0x3a625a,null))['then'](function(_0x1b9b46){var _0x3cbf87=_[_0xc879('0x1d')](_0x1b9b46,'id');var _0x56870f=[];var _0x160ed5=[];var _0x4ec3af=squel[_0xc879('0x61')]();_0x4ec3af[_0xc879('0x62')]('tq.TeamId')[_0xc879('0x63')]('team_has_chat_queues','tq')['join'](_0xc879('0x64'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc879('0x22')](_0xc879('0x65'),_0x3bcdf2[_0xc879('0x2b')]['id']);for(var _0x86455e=0x0;_0x86455e<_0x1b9b46[_0xc879('0x32')];_0x86455e+=0x1){let _0x23d53c=_0x1b9b46[_0x86455e];for(var _0xc0bbc1=0x0;_0xc0bbc1<_0x23d53c[_0xc879('0x5a')][_0xc879('0x32')];_0xc0bbc1+=0x1){let _0x3f830c=_0x23d53c[_0xc879('0x5a')][_0xc0bbc1];var _0x18aebb=_0x4ec3af[_0xc879('0x66')]();_0x18aebb[_0xc879('0x22')](_0xc879('0x67'),_0x3f830c['id']);_0x160ed5['push'](db[_0xc879('0x5b')][_0xc879('0x26')](_0x18aebb['toString'](),{'type':db[_0xc879('0x5b')][_0xc879('0x68')][_0xc879('0x69')]})[_0xc879('0x14')](function(_0x51fa7f){if(_0x51fa7f[_0xc879('0x32')]===0x1){return _0x3f830c['id'];}else{var _0x4a5042=_[_0xc879('0x6a')](_[_0xc879('0x1d')](_0x51fa7f,_0xc879('0x6b')),function(_0x5ec0aa){return _[_0xc879('0x6c')](_0x3cbf87,_0x5ec0aa);});if(_0x4a5042){return _0x3f830c['id'];}}}));}}return BPromise[_0xc879('0x6d')](_0x160ed5)['then'](function(_0x3cb142){_0x56870f=_(_0x56870f)[_0xc879('0x6e')](_0x3cb142)[_0xc879('0x6f')]()[_0xc879('0x70')]();return db[_0xc879('0x23')][_0xc879('0x36')]({'where':{'id':_0x3bcdf2['params']['id']}})[_0xc879('0x14')](function(_0x48fb57){return db[_0xc879('0x5b')][_0xc879('0x5c')](function(_0x1366bc){return _0x48fb57['removeTeams'](_0x3bcdf2['query'][_0xc879('0x55')],{'transaction':_0x1366bc})[_0xc879('0x14')](function(){if(!_[_0xc879('0x71')](_0x56870f)){return _0x48fb57[_0xc879('0x72')](_0x56870f,{'transaction':_0x1366bc});}})[_0xc879('0x14')](function(){_0x56870f[_0xc879('0x5e')](function(_0x208c3a){socket['emit'](_0xc879('0x73'),{'UserId':_0x208c3a,'ChatQueueId':_0x48fb57['id']});});});});});});})[_0xc879('0x14')](respondWithStatusCode(_0x3a625a,null))['catch'](handleError(_0x3a625a,null));};exports[_0xc879('0x74')]=function(_0x18572f,_0x527029){return db[_0xc879('0x23')]['find']({'where':{'id':_0x18572f[_0xc879('0x2b')]['id']}})[_0xc879('0x14')](handleEntityNotFound(_0x527029,null))[_0xc879('0x14')](function(_0x4da649){if(_0x4da649){return _0x4da649['addAgents'](_0x18572f['body']['ids'],_[_0xc879('0x75')](_0x18572f[_0xc879('0x38')],[_0xc879('0x55'),'id'])||{})[_0xc879('0x76')](function(_0x14ef02){for(var _0x45f866=0x0;_0x45f866<_0x18572f['body'][_0xc879('0x55')][_0xc879('0x32')];_0x45f866+=0x1){socket[_0xc879('0x77')](_0xc879('0x5f'),{'UserId':Number(_0x18572f[_0xc879('0x38')]['ids'][_0x45f866]),'ChatQueueId':Number(_0x18572f['params']['id'])});}return _0x14ef02;});}})[_0xc879('0x14')](respondWithResult(_0x527029,null))[_0xc879('0x29')](handleError(_0x527029,null));};exports[_0xc879('0x72')]=function(_0x5b4814,_0x1cbae7){return db['ChatQueue']['find']({'where':{'id':_0x5b4814[_0xc879('0x2b')]['id']}})[_0xc879('0x14')](handleEntityNotFound(_0x1cbae7,null))[_0xc879('0x14')](function(_0x2244d3){if(_0x2244d3){return _0x2244d3['removeAgents'](_0x5b4814[_0xc879('0x26')][_0xc879('0x55')])[_0xc879('0x14')](function(){if(_['isArray'](_0x5b4814['query'][_0xc879('0x55')])){for(var _0xee6d61=0x0;_0xee6d61<_0x5b4814[_0xc879('0x26')][_0xc879('0x55')]['length'];_0xee6d61+=0x1){socket['emit'](_0xc879('0x73'),{'UserId':Number(_0x5b4814[_0xc879('0x26')][_0xc879('0x55')][_0xee6d61]),'ChatQueueId':Number(_0x5b4814['params']['id'])});}}else{socket[_0xc879('0x77')](_0xc879('0x73'),{'UserId':Number(_0x5b4814[_0xc879('0x26')][_0xc879('0x55')]),'ChatQueueId':Number(_0x5b4814[_0xc879('0x2b')]['id'])});}});}})[_0xc879('0x14')](respondWithStatusCode(_0x1cbae7,null))[_0xc879('0x29')](handleError(_0x1cbae7,null));};exports['getAgents']=function(_0xd5adc4,_0x447dc){var _0x488897={};var _0x1483d9={};var _0x1df534;var _0x172452;return db['ChatQueue']['findOne']({'where':{'id':_0xd5adc4[_0xc879('0x2b')]['id']}})['then'](handleEntityNotFound(_0x447dc,null))[_0xc879('0x14')](function(_0x4ecfba){if(_0x4ecfba){_0x1df534=_0x4ecfba;_0x1483d9[_0xc879('0x2c')]=_['keys'](db[_0xc879('0x56')][_0xc879('0x2e')]);_0x1483d9['query']=_[_0xc879('0x2d')](_0xd5adc4[_0xc879('0x26')]);_0x1483d9['filters']=_['intersection'](_0x1483d9[_0xc879('0x2c')],_0x1483d9[_0xc879('0x26')]);_0x488897[_0xc879('0x30')]=_[_0xc879('0x2f')](_0x1483d9['model'],qs['fields'](_0xd5adc4[_0xc879('0x26')][_0xc879('0x31')]));_0x488897[_0xc879('0x30')]=_0x488897[_0xc879('0x30')][_0xc879('0x32')]?_0x488897[_0xc879('0x30')]:_0x1483d9[_0xc879('0x2c')];_0x488897[_0xc879('0x47')]=qs['sort'](_0xd5adc4['query'][_0xc879('0x48')]);_0x488897['where']=qs[_0xc879('0x43')](_[_0xc879('0x49')](_0xd5adc4['query'],_0x1483d9['filters']));if(_0xd5adc4[_0xc879('0x26')][_0xc879('0x4b')]){_0x488897[_0xc879('0x22')]=_['merge'](_0x488897[_0xc879('0x22')],{'$or':_['map'](_0x488897[_0xc879('0x30')],function(_0x370840){var _0x5689ea={};_0x5689ea[_0x370840]={'$like':'%'+_0xd5adc4['query'][_0xc879('0x4b')]+'%'};return _0x5689ea;})});}_0x488897=_['merge']({},_0x488897,_0xd5adc4[_0xc879('0x35')]);return _0x1df534[_0xc879('0x78')](_0x488897);}})[_0xc879('0x14')](function(_0x51a092){if(_0x51a092){_0x172452=_0x51a092[_0xc879('0x32')];if(!_0xd5adc4[_0xc879('0x26')][_0xc879('0x44')]('nolimit')){_0x488897['limit']=qs[_0xc879('0x46')](_0xd5adc4['query'][_0xc879('0x46')]);_0x488897[_0xc879('0xe')]=qs[_0xc879('0xe')](_0xd5adc4[_0xc879('0x26')][_0xc879('0xe')]);}return _0x1df534[_0xc879('0x78')](_0x488897);}})[_0xc879('0x14')](function(_0x358cb2){if(_0x358cb2){return _0x358cb2?{'count':_0x172452,'rows':_0x358cb2}:null;}})[_0xc879('0x14')](respondWithResult(_0x447dc,null))[_0xc879('0x29')](handleError(_0x447dc,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index c2972a2..c07d08e 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 _0xa001=['events','../../mysqldb','setMaxListeners','update','emit','hook','exports'];(function(_0x2f8cd9,_0x3c07da){var _0x21554b=function(_0x10e2d5){while(--_0x10e2d5){_0x2f8cd9['push'](_0x2f8cd9['shift']());}};_0x21554b(++_0x3c07da);}(_0xa001,0x93));var _0x1a00=function(_0xdf58ed,_0x1de90e){_0xdf58ed=_0xdf58ed-0x0;var _0x374120=_0xa001[_0xdf58ed];return _0x374120;};'use strict';var EventEmitter=require(_0x1a00('0x0'));var ChatQueue=require(_0x1a00('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1a00('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1a00('0x3'),'afterDestroy':'remove'};function emitEvent(_0x50afe8){return function(_0x52b9df,_0x17d4e9,_0x4ca9cc){ChatQueueEvents[_0x1a00('0x4')](_0x50afe8+':'+_0x52b9df['id'],_0x52b9df);ChatQueueEvents['emit'](_0x50afe8,_0x52b9df);_0x4ca9cc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x1a00('0x5')](e,emitEvent(event));}}module[_0x1a00('0x6')]=ChatQueueEvents;
\ No newline at end of file
+var _0x4566=['hook','exports','events','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4566,0x80));var _0x6456=function(_0x30bf06,_0x5a6c0b){_0x30bf06=_0x30bf06-0x0;var _0x11f9e2=_0x4566[_0x30bf06];return _0x11f9e2;};'use strict';var EventEmitter=require(_0x6456('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x6456('0x1')](0x0);var events={'afterCreate':_0x6456('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3dc644){return function(_0x5b9137,_0x1cec40,_0x28a80c){ChatQueueEvents[_0x6456('0x3')](_0x3dc644+':'+_0x5b9137['id'],_0x5b9137);ChatQueueEvents[_0x6456('0x3')](_0x3dc644,_0x5b9137);_0x28a80c(null);};}for(var e in events){if(events[_0x6456('0x4')](e)){var event=events[e];ChatQueue[_0x6456('0x5')](e,emitEvent(event));}}module[_0x6456('0x6')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 069bb88..2418f73 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 _0xc791=['chat_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xc791,0x1e1));var _0x1c79=function(_0x27c741,_0x4bab7c){_0x27c741=_0x27c741-0x0;var _0x353e2b=_0xc791[_0x27c741];return _0x353e2b;};'use strict';var _=require(_0x1c79('0x0'));var util=require(_0x1c79('0x1'));var logger=require('../../config/logger')(_0x1c79('0x2'));var moment=require(_0x1c79('0x3'));var BPromise=require(_0x1c79('0x4'));var rp=require(_0x1c79('0x5'));var fs=require('fs');var path=require(_0x1c79('0x6'));var rimraf=require(_0x1c79('0x7'));var config=require(_0x1c79('0x8'));var attributes=require(_0x1c79('0x9'));module[_0x1c79('0xa')]=function(_0x3b50ec,_0x5d12a8){return _0x3b50ec['define']('ChatQueue',attributes,{'tableName':_0x1c79('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd92a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash'];(function(_0x400f6d,_0x488583){var _0x57ee04=function(_0x53c4b8){while(--_0x53c4b8){_0x400f6d['push'](_0x400f6d['shift']());}};_0x57ee04(++_0x488583);}(_0xd92a,0x12b));var _0xad92=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd92a[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xad92('0x0'));var util=require(_0xad92('0x1'));var logger=require(_0xad92('0x2'))(_0xad92('0x3'));var moment=require(_0xad92('0x4'));var BPromise=require(_0xad92('0x5'));var rp=require(_0xad92('0x6'));var fs=require('fs');var path=require(_0xad92('0x7'));var rimraf=require(_0xad92('0x8'));var config=require(_0xad92('0x9'));var attributes=require(_0xad92('0xa'));module[_0xad92('0xb')]=function(_0x59172c,_0x2c15e4){return _0x59172c[_0xad92('0xc')](_0xad92('0xd'),attributes,{'tableName':_0xad92('0xe'),'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 bd74cda..d943e23 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 _0x404d=['register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetChatQueue','find','ShowChatQueue','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter'];(function(_0x34273d,_0x4cee59){var _0xd7efeb=function(_0x1491c0){while(--_0x1491c0){_0x34273d['push'](_0x34273d['shift']());}};_0xd7efeb(++_0x4cee59);}(_0x404d,0x1e9));var _0xd404=function(_0x4a652a,_0x20a238){_0x4a652a=_0x4a652a-0x0;var _0x13a67e=_0x404d[_0x4a652a];return _0x13a67e;};'use strict';var _=require(_0xd404('0x0'));var util=require(_0xd404('0x1'));var moment=require(_0xd404('0x2'));var BPromise=require(_0xd404('0x3'));var rs=require(_0xd404('0x4'));var fs=require('fs');var Redis=require(_0xd404('0x5'));var db=require(_0xd404('0x6'))['db'];var utils=require(_0xd404('0x7'));var logger=require(_0xd404('0x8'))('rpc');var config=require(_0xd404('0x9'));var jayson=require(_0xd404('0xa'));var client=jayson['client'][_0xd404('0xb')]({'port':0x232a});config[_0xd404('0xc')]=_['defaults'](config['redis'],{'host':_0xd404('0xd'),'port':0x18eb});var socket=require(_0xd404('0xe'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xd404('0xf')](socket);function respondWithRpcPromise(_0x1b99d2,_0x3a1a89,_0xb018fc){return new BPromise(function(_0x5d3faf,_0x4b60f2){return client[_0xd404('0x10')](_0x1b99d2,_0xb018fc)[_0xd404('0x11')](function(_0x569542){logger[_0xd404('0x12')](_0xd404('0x13'),_0x3a1a89,_0xd404('0x14'));logger[_0xd404('0x15')](_0xd404('0x16'),_0x3a1a89,_0xd404('0x14'),JSON[_0xd404('0x17')](_0x569542));if(_0x569542[_0xd404('0x18')]){if(_0x569542[_0xd404('0x18')][_0xd404('0x19')]===0x1f4){logger[_0xd404('0x18')](_0xd404('0x13'),_0x3a1a89,_0x569542[_0xd404('0x18')][_0xd404('0x1a')]);return _0x4b60f2(_0x569542[_0xd404('0x18')][_0xd404('0x1a')]);}logger[_0xd404('0x18')](_0xd404('0x13'),_0x3a1a89,_0x569542[_0xd404('0x18')][_0xd404('0x1a')]);return _0x5d3faf(_0x569542[_0xd404('0x18')]['message']);}else{logger[_0xd404('0x12')](_0xd404('0x13'),_0x3a1a89,'request\x20sent');_0x5d3faf(_0x569542[_0xd404('0x1b')][_0xd404('0x1a')]);}})['catch'](function(_0x209a6b){logger[_0xd404('0x18')](_0xd404('0x13'),_0x3a1a89,_0x209a6b);_0x4b60f2(_0x209a6b);});});}exports['GetChatQueue']=function(_0x2fd888){var _0x399a06=this;return new Promise(function(_0x27d9a1,_0x3e8183){return db[_0xd404('0x1c')][_0xd404('0x1d')]({'raw':_0x2fd888[_0xd404('0x1e')]?_0x2fd888['options'][_0xd404('0x1f')]===undefined?!![]:![]:!![],'where':_0x2fd888[_0xd404('0x1e')]?_0x2fd888['options'][_0xd404('0x20')]||null:null,'attributes':_0x2fd888['options']?_0x2fd888['options'][_0xd404('0x21')]||null:null,'limit':_0x2fd888[_0xd404('0x1e')]?_0x2fd888[_0xd404('0x1e')][_0xd404('0x22')]||null:null,'include':_0x2fd888['options']?_0x2fd888[_0xd404('0x1e')][_0xd404('0x23')]?_[_0xd404('0x24')](_0x2fd888['options']['include'],function(_0x3e706a){return{'model':db[_0x3e706a[_0xd404('0x25')]],'as':_0x3e706a['as'],'attributes':_0x3e706a[_0xd404('0x21')],'include':_0x3e706a[_0xd404('0x23')]?_[_0xd404('0x24')](_0x3e706a[_0xd404('0x23')],function(_0x256277){return{'model':db[_0x256277[_0xd404('0x25')]],'as':_0x256277['as'],'attributes':_0x256277['attributes'],'include':_0x256277['include']?_[_0xd404('0x24')](_0x256277['include'],function(_0x2b14ec){return{'model':db[_0x2b14ec['model']],'as':_0x2b14ec['as'],'attributes':_0x2b14ec[_0xd404('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd404('0x11')](function(_0x3e746e){logger[_0xd404('0x12')](_0xd404('0x26'),_0x2fd888);logger[_0xd404('0x15')](_0xd404('0x26'),_0x2fd888,JSON['stringify'](_0x3e746e));_0x27d9a1(_0x3e746e);})['catch'](function(_0xc60d87){logger['error']('GetChatQueue',_0xc60d87[_0xd404('0x1a')],_0x2fd888);_0x3e8183(_0x399a06[_0xd404('0x18')](0x1f4,_0xc60d87[_0xd404('0x1a')]));});});};exports['ShowChatQueue']=function(_0x63430e){var _0x54f0c5=this;return new Promise(function(_0x2ee9b3,_0x1de7b9){return db['ChatQueue'][_0xd404('0x27')]({'raw':_0x63430e[_0xd404('0x1e')]?_0x63430e[_0xd404('0x1e')][_0xd404('0x1f')]===undefined?!![]:![]:!![],'where':_0x63430e[_0xd404('0x1e')]?_0x63430e['options'][_0xd404('0x20')]||null:null,'attributes':_0x63430e[_0xd404('0x1e')]?_0x63430e[_0xd404('0x1e')]['attributes']||null:null,'include':_0x63430e[_0xd404('0x1e')]?_0x63430e[_0xd404('0x1e')][_0xd404('0x23')]?_[_0xd404('0x24')](_0x63430e['options']['include'],function(_0x2551b5){return{'model':db[_0x2551b5[_0xd404('0x25')]],'as':_0x2551b5['as'],'attributes':_0x2551b5[_0xd404('0x21')],'include':_0x2551b5[_0xd404('0x23')]?_[_0xd404('0x24')](_0x2551b5[_0xd404('0x23')],function(_0x50d8ef){return{'model':db[_0x50d8ef[_0xd404('0x25')]],'as':_0x50d8ef['as'],'attributes':_0x50d8ef[_0xd404('0x21')],'include':_0x50d8ef[_0xd404('0x23')]?_['map'](_0x50d8ef[_0xd404('0x23')],function(_0x2e0786){return{'model':db[_0x2e0786[_0xd404('0x25')]],'as':_0x2e0786['as'],'attributes':_0x2e0786['attributes']};}):[]};}):[]};}):[]:[]})[_0xd404('0x11')](function(_0x21111e){logger[_0xd404('0x12')]('ShowChatQueue',_0x63430e);logger[_0xd404('0x15')](_0xd404('0x28'),_0x63430e,JSON['stringify'](_0x21111e));_0x2ee9b3(_0x21111e);})[_0xd404('0x29')](function(_0x128da0){logger[_0xd404('0x18')](_0xd404('0x28'),_0x128da0[_0xd404('0x1a')],_0x63430e);_0x1de7b9(_0x54f0c5[_0xd404('0x18')](0x1f4,_0x128da0[_0xd404('0x1a')]));});});};
\ No newline at end of file
+var _0xe8a1=['result','catch','GetChatQueue','raw','options','where','attributes','include','model','map','then','info','stringify','ShowChatQueue','ChatQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','code','error','message'];(function(_0x4632a9,_0x11306d){var _0x2cfe3f=function(_0x4b0530){while(--_0x4b0530){_0x4632a9['push'](_0x4632a9['shift']());}};_0x2cfe3f(++_0x11306d);}(_0xe8a1,0x1d8));var _0x1e8a=function(_0x44223c,_0x43a1e4){_0x44223c=_0x44223c-0x0;var _0x2314ce=_0xe8a1[_0x44223c];return _0x2314ce;};'use strict';var _=require(_0x1e8a('0x0'));var util=require(_0x1e8a('0x1'));var moment=require(_0x1e8a('0x2'));var BPromise=require('bluebird');var rs=require(_0x1e8a('0x3'));var fs=require('fs');var Redis=require(_0x1e8a('0x4'));var db=require(_0x1e8a('0x5'))['db'];var utils=require(_0x1e8a('0x6'));var logger=require(_0x1e8a('0x7'))(_0x1e8a('0x8'));var config=require(_0x1e8a('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1e8a('0xa')]({'port':0x232a});config[_0x1e8a('0xb')]=_[_0x1e8a('0xc')](config[_0x1e8a('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1e8a('0xb')]));require('./chatQueue.socket')[_0x1e8a('0xd')](socket);function respondWithRpcPromise(_0x271b82,_0x4ac6b6,_0x5793af){return new BPromise(function(_0x439024,_0x170fc4){return client[_0x1e8a('0xe')](_0x271b82,_0x5793af)['then'](function(_0xaf3fee){logger['info'](_0x1e8a('0xf'),_0x4ac6b6,_0x1e8a('0x10'));logger[_0x1e8a('0x11')](_0x1e8a('0x12'),_0x4ac6b6,'request\x20sent',JSON['stringify'](_0xaf3fee));if(_0xaf3fee['error']){if(_0xaf3fee['error'][_0x1e8a('0x13')]===0x1f4){logger[_0x1e8a('0x14')](_0x1e8a('0xf'),_0x4ac6b6,_0xaf3fee['error']['message']);return _0x170fc4(_0xaf3fee[_0x1e8a('0x14')][_0x1e8a('0x15')]);}logger['error'](_0x1e8a('0xf'),_0x4ac6b6,_0xaf3fee[_0x1e8a('0x14')][_0x1e8a('0x15')]);return _0x439024(_0xaf3fee[_0x1e8a('0x14')][_0x1e8a('0x15')]);}else{logger['info'](_0x1e8a('0xf'),_0x4ac6b6,'request\x20sent');_0x439024(_0xaf3fee[_0x1e8a('0x16')]['message']);}})[_0x1e8a('0x17')](function(_0x4d0e63){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4ac6b6,_0x4d0e63);_0x170fc4(_0x4d0e63);});});}exports[_0x1e8a('0x18')]=function(_0x2a9e0e){var _0x1e7d2e=this;return new Promise(function(_0x482b9b,_0xc9c032){return db['ChatQueue']['findAll']({'raw':_0x2a9e0e['options']?_0x2a9e0e['options'][_0x1e8a('0x19')]===undefined?!![]:![]:!![],'where':_0x2a9e0e[_0x1e8a('0x1a')]?_0x2a9e0e['options'][_0x1e8a('0x1b')]||null:null,'attributes':_0x2a9e0e[_0x1e8a('0x1a')]?_0x2a9e0e[_0x1e8a('0x1a')][_0x1e8a('0x1c')]||null:null,'limit':_0x2a9e0e[_0x1e8a('0x1a')]?_0x2a9e0e[_0x1e8a('0x1a')]['limit']||null:null,'include':_0x2a9e0e[_0x1e8a('0x1a')]?_0x2a9e0e['options'][_0x1e8a('0x1d')]?_['map'](_0x2a9e0e['options']['include'],function(_0xd4a087){return{'model':db[_0xd4a087[_0x1e8a('0x1e')]],'as':_0xd4a087['as'],'attributes':_0xd4a087[_0x1e8a('0x1c')],'include':_0xd4a087[_0x1e8a('0x1d')]?_[_0x1e8a('0x1f')](_0xd4a087[_0x1e8a('0x1d')],function(_0x2b0197){return{'model':db[_0x2b0197[_0x1e8a('0x1e')]],'as':_0x2b0197['as'],'attributes':_0x2b0197[_0x1e8a('0x1c')],'include':_0x2b0197[_0x1e8a('0x1d')]?_[_0x1e8a('0x1f')](_0x2b0197[_0x1e8a('0x1d')],function(_0x5eea6c){return{'model':db[_0x5eea6c[_0x1e8a('0x1e')]],'as':_0x5eea6c['as'],'attributes':_0x5eea6c[_0x1e8a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1e8a('0x20')](function(_0x1d2d48){logger[_0x1e8a('0x21')](_0x1e8a('0x18'),_0x2a9e0e);logger['debug'](_0x1e8a('0x18'),_0x2a9e0e,JSON[_0x1e8a('0x22')](_0x1d2d48));_0x482b9b(_0x1d2d48);})[_0x1e8a('0x17')](function(_0x33d056){logger[_0x1e8a('0x14')](_0x1e8a('0x18'),_0x33d056[_0x1e8a('0x15')],_0x2a9e0e);_0xc9c032(_0x1e7d2e[_0x1e8a('0x14')](0x1f4,_0x33d056[_0x1e8a('0x15')]));});});};exports[_0x1e8a('0x23')]=function(_0xccb74f){var _0x264d8f=this;return new Promise(function(_0x52d2fe,_0x2ee088){return db[_0x1e8a('0x24')][_0x1e8a('0x25')]({'raw':_0xccb74f[_0x1e8a('0x1a')]?_0xccb74f[_0x1e8a('0x1a')][_0x1e8a('0x19')]===undefined?!![]:![]:!![],'where':_0xccb74f['options']?_0xccb74f[_0x1e8a('0x1a')][_0x1e8a('0x1b')]||null:null,'attributes':_0xccb74f[_0x1e8a('0x1a')]?_0xccb74f[_0x1e8a('0x1a')]['attributes']||null:null,'include':_0xccb74f[_0x1e8a('0x1a')]?_0xccb74f[_0x1e8a('0x1a')][_0x1e8a('0x1d')]?_[_0x1e8a('0x1f')](_0xccb74f[_0x1e8a('0x1a')][_0x1e8a('0x1d')],function(_0x151a62){return{'model':db[_0x151a62['model']],'as':_0x151a62['as'],'attributes':_0x151a62[_0x1e8a('0x1c')],'include':_0x151a62['include']?_['map'](_0x151a62['include'],function(_0x574796){return{'model':db[_0x574796[_0x1e8a('0x1e')]],'as':_0x574796['as'],'attributes':_0x574796['attributes'],'include':_0x574796[_0x1e8a('0x1d')]?_[_0x1e8a('0x1f')](_0x574796[_0x1e8a('0x1d')],function(_0x4b2737){return{'model':db[_0x4b2737['model']],'as':_0x4b2737['as'],'attributes':_0x4b2737[_0x1e8a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1e8a('0x20')](function(_0x57edb1){logger[_0x1e8a('0x21')](_0x1e8a('0x23'),_0xccb74f);logger['debug'](_0x1e8a('0x23'),_0xccb74f,JSON[_0x1e8a('0x22')](_0x57edb1));_0x52d2fe(_0x57edb1);})[_0x1e8a('0x17')](function(_0x519628){logger['error'](_0x1e8a('0x23'),_0x519628['message'],_0xccb74f);_0x2ee088(_0x264d8f[_0x1e8a('0x14')](0x1f4,_0x519628[_0x1e8a('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index c534b3b..dee3df4 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 _0x9b9b=['save','emit','removeListener','register','length','chatQueue:'];(function(_0x43a327,_0xb19748){var _0x4a6d7e=function(_0x219643){while(--_0x219643){_0x43a327['push'](_0x43a327['shift']());}};_0x4a6d7e(++_0xb19748);}(_0x9b9b,0x114));var _0xb9b9=function(_0x2675da,_0x5a250e){_0x2675da=_0x2675da-0x0;var _0x5e6153=_0x9b9b[_0x2675da];return _0x5e6153;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xb9b9('0x0'),'remove','update'];function createListener(_0x2ae8a0,_0x153734){return function(_0x1adf50){_0x153734[_0xb9b9('0x1')](_0x2ae8a0,_0x1adf50);};}function removeListener(_0x1d6ab6,_0x43c8ff){return function(){ChatQueueEvents[_0xb9b9('0x2')](_0x1d6ab6,_0x43c8ff);};}exports[_0xb9b9('0x3')]=function(_0x79dd){for(var _0x3d1a95=0x0,_0x85eec=events[_0xb9b9('0x4')];_0x3d1a95<_0x85eec;_0x3d1a95++){var _0x5be5bc=events[_0x3d1a95];var _0x297cb6=createListener(_0xb9b9('0x5')+_0x5be5bc,_0x79dd);ChatQueueEvents['on'](_0x5be5bc,_0x297cb6);}};
\ No newline at end of file
+var _0xac31=['remove','update','length','chatQueue:','./chatQueue.events','save'];(function(_0x4f4757,_0x44241a){var _0x549c37=function(_0x3c3cfb){while(--_0x3c3cfb){_0x4f4757['push'](_0x4f4757['shift']());}};_0x549c37(++_0x44241a);}(_0xac31,0xca));var _0x1ac3=function(_0x2b4863,_0x5811ee){_0x2b4863=_0x2b4863-0x0;var _0x3733f1=_0xac31[_0x2b4863];return _0x3733f1;};'use strict';var ChatQueueEvents=require(_0x1ac3('0x0'));var events=[_0x1ac3('0x1'),_0x1ac3('0x2'),_0x1ac3('0x3')];function createListener(_0xd6934,_0x11dd6d){return function(_0x95548d){_0x11dd6d['emit'](_0xd6934,_0x95548d);};}function removeListener(_0x33b5ab,_0x434b5e){return function(){ChatQueueEvents['removeListener'](_0x33b5ab,_0x434b5e);};}exports['register']=function(_0xbe22b7){for(var _0x20027f=0x0,_0x2bf9b1=events[_0x1ac3('0x4')];_0x20027f<_0x2bf9b1;_0x20027f++){var _0x157604=events[_0x20027f];var _0x57893c=createListener(_0x1ac3('0x5')+_0x157604,_0xbe22b7);ChatQueueEvents['on'](_0x157604,_0x57893c);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 64f9ed1..3a2e5ec 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x935c9c,_0x56f0b7){var _0x10dfad=function(_0x54af8e){while(--_0x54af8e){_0x935c9c['push'](_0x935c9c['shift']());}};_0x10dfad(++_0x56f0b7);}(_0x55ca,0x126));var _0xa55c=function(_0x3b2369,_0x4c68b9){_0x3b2369=_0x3b2369-0x0;var _0x5a1367=_0x55ca[_0x3b2369];return _0x5a1367;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
+var _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(_0x44d42a,_0xe76ad8){var _0x172b8f=function(_0x4560b1){while(--_0x4560b1){_0x44d42a['push'](_0x44d42a['shift']());}};_0x172b8f(++_0xe76ad8);}(_0x814b,0x1a2));var _0xb814=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0x814b[_0xc87d08];return _0x30a714;};'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 289d7ae..3cc4641 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 _0x2c19=['exports','STRING','DATE','moment','sequelize'];(function(_0x591875,_0x195f1d){var _0x51778e=function(_0x3c28b0){while(--_0x3c28b0){_0x591875['push'](_0x591875['shift']());}};_0x51778e(++_0x195f1d);}(_0x2c19,0x17a));var _0x92c1=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x2c19[_0x2b4411];return _0x8e41ef;};'use strict';var moment=require(_0x92c1('0x0'));var Sequelize=require(_0x92c1('0x1'));module[_0x92c1('0x2')]={'uniqueid':{'type':Sequelize[_0x92c1('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x92c1('0x4')]},'acceptAt':{'type':Sequelize[_0x92c1('0x4')]},'exitAt':{'type':Sequelize[_0x92c1('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x45a8=['sequelize','exports','STRING','DATE','moment'];(function(_0x182700,_0x87ffd5){var _0x1bb3b2=function(_0x1296ee){while(--_0x1296ee){_0x182700['push'](_0x182700['shift']());}};_0x1bb3b2(++_0x87ffd5);}(_0x45a8,0x112));var _0x845a=function(_0x11d10f,_0x275d65){_0x11d10f=_0x11d10f-0x0;var _0x4f3a86=_0x45a8[_0x11d10f];return _0x4f3a86;};'use strict';var moment=require(_0x845a('0x0'));var Sequelize=require(_0x845a('0x1'));module[_0x845a('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x845a('0x3')]},'joinAt':{'type':Sequelize[_0x845a('0x4')]},'leaveAt':{'type':Sequelize[_0x845a('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x845a('0x4')]},'reason':{'type':Sequelize[_0x845a('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index d423ad8..5f4a680 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 _0x00cd=['find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params'];(function(_0x37aece,_0xdbfe91){var _0x34dd0b=function(_0x4533ec){while(--_0x4533ec){_0x37aece['push'](_0x37aece['shift']());}};_0x34dd0b(++_0xdbfe91);}(_0x00cd,0xee));var _0xd00c=function(_0x16a223,_0x31b6e8){_0x16a223=_0x16a223-0x0;var _0x5ded66=_0x00cd[_0x16a223];return _0x5ded66;};'use strict';var emlformat=require(_0xd00c('0x0'));var rimraf=require(_0xd00c('0x1'));var zipdir=require(_0xd00c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd00c('0x3'));var BPromise=require(_0xd00c('0x4'));var Mustache=require(_0xd00c('0x5'));var util=require(_0xd00c('0x6'));var path=require(_0xd00c('0x7'));var sox=require('sox');var csv=require(_0xd00c('0x8'));var ejs=require(_0xd00c('0x9'));var fs=require('fs');var fs_extra=require(_0xd00c('0xa'));var _=require(_0xd00c('0xb'));var squel=require(_0xd00c('0xc'));var crypto=require(_0xd00c('0xd'));var jsforce=require(_0xd00c('0xe'));var deskjs=require(_0xd00c('0xf'));var toCsv=require(_0xd00c('0x8'));var querystring=require(_0xd00c('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd00c('0x11'));var qs=require(_0xd00c('0x12'));var as=require(_0xd00c('0x13'));var hardwareService=require(_0xd00c('0x14'));var logger=require('../../config/logger')(_0xd00c('0x15'));var utils=require('../../config/utils');var config=require(_0xd00c('0x16'));var licenseUtil=require(_0xd00c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49238e,_0x51f391){_0x51f391=_0x51f391||0xcc;return function(_0x4afd7d){if(_0x4afd7d){return _0x49238e[_0xd00c('0x18')](_0x51f391);}return _0x49238e[_0xd00c('0x19')](_0x51f391)[_0xd00c('0x1a')]();};}function respondWithResult(_0x4c0c0f,_0x24c12b){_0x24c12b=_0x24c12b||0xc8;return function(_0x5ed7e7){if(_0x5ed7e7){return _0x4c0c0f[_0xd00c('0x19')](_0x24c12b)[_0xd00c('0x1b')](_0x5ed7e7);}};}function respondWithFilteredResult(_0x3dc54d,_0x4a52b0){return function(_0x50b22e){if(_0x50b22e){var _0x41f67c=typeof _0x4a52b0[_0xd00c('0x1c')]===_0xd00c('0x1d')&&typeof _0x4a52b0[_0xd00c('0x1e')]===_0xd00c('0x1d');var _0x2a5531=_0x50b22e[_0xd00c('0x1f')];var _0x3864a9=_0x41f67c?0x0:_0x4a52b0['offset'];var _0x2b167a=_0x41f67c?_0x50b22e[_0xd00c('0x1f')]:_0x4a52b0[_0xd00c('0x1c')]+_0x4a52b0['limit'];var _0x541174;if(_0x2b167a>=_0x2a5531){_0x2b167a=_0x2a5531;_0x541174=0xc8;}else{_0x541174=0xce;}_0x3dc54d[_0xd00c('0x19')](_0x541174);return _0x3dc54d[_0xd00c('0x20')](_0xd00c('0x21'),_0x3864a9+'-'+_0x2b167a+'/'+_0x2a5531)[_0xd00c('0x1b')](_0x50b22e);}return null;};}function patchUpdates(_0xbced81){return function(_0x40a352){try{jsonpatch[_0xd00c('0x22')](_0x40a352,_0xbced81,!![]);}catch(_0x4ef9f8){return BPromise[_0xd00c('0x23')](_0x4ef9f8);}return _0x40a352[_0xd00c('0x24')]();};}function saveUpdates(_0x3a0b2f,_0x3807fb){return function(_0x10d08d){if(_0x10d08d){return _0x10d08d['update'](_0x3a0b2f)['then'](function(_0x27c892){return _0x27c892;});}return null;};}function removeEntity(_0x22b914,_0x5bcf19){return function(_0x4a6c84){if(_0x4a6c84){return _0x4a6c84['destroy']()[_0xd00c('0x25')](function(){_0x22b914['status'](0xcc)[_0xd00c('0x1a')]();});}};}function handleEntityNotFound(_0x4a918f,_0x25300a){return function(_0x276eef){if(!_0x276eef){_0x4a918f['sendStatus'](0x194);}return _0x276eef;};}function handleError(_0x4c78e9,_0x24f5c8){_0x24f5c8=_0x24f5c8||0x1f4;return function(_0x32e998){logger[_0xd00c('0x26')](_0x32e998[_0xd00c('0x27')]);if(_0x32e998['name']){delete _0x32e998[_0xd00c('0x28')];}_0x4c78e9[_0xd00c('0x19')](_0x24f5c8)[_0xd00c('0x29')](_0x32e998);};}exports[_0xd00c('0x2a')]=function(_0x4987c5,_0x17e58d){var _0x5bb7c4={},_0x3e7e2c={},_0x127a0b={'count':0x0,'rows':[]};var _0x291b71=_[_0xd00c('0x2b')](db[_0xd00c('0x2c')][_0xd00c('0x2d')],function(_0xbbbf0e){return{'name':_0xbbbf0e[_0xd00c('0x2e')],'type':_0xbbbf0e[_0xd00c('0x2f')][_0xd00c('0x30')]};});_0x3e7e2c[_0xd00c('0x31')]=_[_0xd00c('0x2b')](_0x291b71,_0xd00c('0x28'));_0x3e7e2c[_0xd00c('0x32')]=_[_0xd00c('0x33')](_0x4987c5[_0xd00c('0x32')]);_0x3e7e2c[_0xd00c('0x34')]=_[_0xd00c('0x35')](_0x3e7e2c['model'],_0x3e7e2c['query']);_0x5bb7c4[_0xd00c('0x36')]=_['intersection'](_0x3e7e2c[_0xd00c('0x31')],qs[_0xd00c('0x37')](_0x4987c5[_0xd00c('0x32')][_0xd00c('0x37')]));_0x5bb7c4[_0xd00c('0x36')]=_0x5bb7c4['attributes'][_0xd00c('0x38')]?_0x5bb7c4[_0xd00c('0x36')]:_0x3e7e2c['model'];if(!_0x4987c5[_0xd00c('0x32')][_0xd00c('0x39')](_0xd00c('0x3a'))){_0x5bb7c4[_0xd00c('0x1e')]=qs[_0xd00c('0x1e')](_0x4987c5[_0xd00c('0x32')]['limit']);_0x5bb7c4[_0xd00c('0x1c')]=qs['offset'](_0x4987c5[_0xd00c('0x32')]['offset']);}_0x5bb7c4['order']=qs['sort'](_0x4987c5[_0xd00c('0x32')][_0xd00c('0x3b')]);_0x5bb7c4[_0xd00c('0x3c')]=qs['filters'](_[_0xd00c('0x3d')](_0x4987c5[_0xd00c('0x32')],_0x3e7e2c[_0xd00c('0x34')]),_0x291b71);if(_0x4987c5['query'][_0xd00c('0x3e')]){_0x5bb7c4[_0xd00c('0x3c')]=_[_0xd00c('0x3f')](_0x5bb7c4[_0xd00c('0x3c')],{'$or':_[_0xd00c('0x2b')](_0x291b71,function(_0xfb7519){if(_0xfb7519[_0xd00c('0x2f')]!==_0xd00c('0x40')){var _0x1fdc4d={};_0x1fdc4d[_0xfb7519[_0xd00c('0x28')]]={'$like':'%'+_0x4987c5['query'][_0xd00c('0x3e')]+'%'};return _0x1fdc4d;}})});}_0x5bb7c4=_[_0xd00c('0x3f')]({},_0x5bb7c4,_0x4987c5['options']);var _0x1e565f={'where':_0x5bb7c4[_0xd00c('0x3c')]};return db['ChatQueueReport'][_0xd00c('0x1f')](_0x1e565f)[_0xd00c('0x25')](function(_0x3d31a7){_0x127a0b[_0xd00c('0x1f')]=_0x3d31a7;if(_0x4987c5[_0xd00c('0x32')][_0xd00c('0x41')]){_0x5bb7c4[_0xd00c('0x42')]=[{'all':!![]}];}return db[_0xd00c('0x2c')]['findAll'](_0x5bb7c4);})[_0xd00c('0x25')](function(_0x193117){_0x127a0b[_0xd00c('0x43')]=_0x193117;return _0x127a0b;})[_0xd00c('0x25')](respondWithFilteredResult(_0x17e58d,_0x5bb7c4))['catch'](handleError(_0x17e58d,null));};exports[_0xd00c('0x44')]=function(_0x6bcc79,_0x5b0b2b){var _0x923db0={'raw':!![],'where':{'id':_0x6bcc79[_0xd00c('0x45')]['id']}},_0x640a87={};_0x640a87['model']=_[_0xd00c('0x33')](db['ChatQueueReport']['rawAttributes']);_0x640a87[_0xd00c('0x32')]=_['keys'](_0x6bcc79[_0xd00c('0x32')]);_0x640a87[_0xd00c('0x34')]=_[_0xd00c('0x35')](_0x640a87[_0xd00c('0x31')],_0x640a87[_0xd00c('0x32')]);_0x923db0[_0xd00c('0x36')]=_[_0xd00c('0x35')](_0x640a87[_0xd00c('0x31')],qs[_0xd00c('0x37')](_0x6bcc79[_0xd00c('0x32')][_0xd00c('0x37')]));_0x923db0['attributes']=_0x923db0[_0xd00c('0x36')][_0xd00c('0x38')]?_0x923db0[_0xd00c('0x36')]:_0x640a87['model'];if(_0x6bcc79[_0xd00c('0x32')][_0xd00c('0x41')]){_0x923db0['include']=[{'all':!![]}];}_0x923db0=_['merge']({},_0x923db0,_0x6bcc79['options']);return db[_0xd00c('0x2c')][_0xd00c('0x46')](_0x923db0)[_0xd00c('0x25')](handleEntityNotFound(_0x5b0b2b,null))[_0xd00c('0x25')](respondWithResult(_0x5b0b2b,null))[_0xd00c('0x47')](handleError(_0x5b0b2b,null));};exports[_0xd00c('0x48')]=function(_0x3bc7e6,_0x1efbda){return db['ChatQueueReport'][_0xd00c('0x48')](_0x3bc7e6[_0xd00c('0x49')],{})[_0xd00c('0x25')](respondWithResult(_0x1efbda,0xc9))[_0xd00c('0x47')](handleError(_0x1efbda,null));};exports[_0xd00c('0x4a')]=function(_0x207cbc,_0x20ed7c){if(_0x207cbc[_0xd00c('0x49')]['id']){delete _0x207cbc[_0xd00c('0x49')]['id'];}return db[_0xd00c('0x2c')][_0xd00c('0x46')]({'where':{'id':_0x207cbc[_0xd00c('0x45')]['id']}})[_0xd00c('0x25')](handleEntityNotFound(_0x20ed7c,null))[_0xd00c('0x25')](saveUpdates(_0x207cbc['body'],null))[_0xd00c('0x25')](respondWithResult(_0x20ed7c,null))[_0xd00c('0x47')](handleError(_0x20ed7c,null));};exports[_0xd00c('0x4b')]=function(_0x380147,_0x1f7d40){return db[_0xd00c('0x2c')]['find']({'where':{'id':_0x380147[_0xd00c('0x45')]['id']}})[_0xd00c('0x25')](handleEntityNotFound(_0x1f7d40,null))[_0xd00c('0x25')](removeEntity(_0x1f7d40,null))['catch'](handleError(_0x1f7d40,null));};exports[_0xd00c('0x4c')]=function(_0x3c237c,_0x28d8ff){return db['ChatQueueReport']['describe']()[_0xd00c('0x25')](respondWithResult(_0x28d8ff,null))[_0xd00c('0x47')](handleError(_0x28d8ff,null));};
\ No newline at end of file
+var _0xcac3=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','describe','rimraf','zip-dir'];(function(_0x14d956,_0x569303){var _0xc46c95=function(_0x37468b){while(--_0x37468b){_0x14d956['push'](_0x14d956['shift']());}};_0xc46c95(++_0x569303);}(_0xcac3,0x193));var _0x3cac=function(_0x4c03ea,_0x3465be){_0x4c03ea=_0x4c03ea-0x0;var _0x7a6922=_0xcac3[_0x4c03ea];return _0x7a6922;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3cac('0x0'));var zipdir=require(_0x3cac('0x1'));var jsonpatch=require(_0x3cac('0x2'));var rp=require(_0x3cac('0x3'));var moment=require(_0x3cac('0x4'));var BPromise=require(_0x3cac('0x5'));var Mustache=require(_0x3cac('0x6'));var util=require(_0x3cac('0x7'));var path=require(_0x3cac('0x8'));var sox=require(_0x3cac('0x9'));var csv=require(_0x3cac('0xa'));var ejs=require(_0x3cac('0xb'));var fs=require('fs');var fs_extra=require(_0x3cac('0xc'));var _=require(_0x3cac('0xd'));var squel=require(_0x3cac('0xe'));var crypto=require(_0x3cac('0xf'));var jsforce=require(_0x3cac('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3cac('0xa'));var querystring=require(_0x3cac('0x11'));var Papa=require(_0x3cac('0x12'));var Redis=require(_0x3cac('0x13'));var authService=require(_0x3cac('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3cac('0x15'));var hardwareService=require(_0x3cac('0x16'));var logger=require(_0x3cac('0x17'))(_0x3cac('0x18'));var utils=require(_0x3cac('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3cac('0x1a'))['db'];function respondWithStatusCode(_0xfc7684,_0x2d3ca6){_0x2d3ca6=_0x2d3ca6||0xcc;return function(_0x134b95){if(_0x134b95){return _0xfc7684[_0x3cac('0x1b')](_0x2d3ca6);}return _0xfc7684[_0x3cac('0x1c')](_0x2d3ca6)[_0x3cac('0x1d')]();};}function respondWithResult(_0x4bee52,_0x37a3b1){_0x37a3b1=_0x37a3b1||0xc8;return function(_0x2db008){if(_0x2db008){return _0x4bee52[_0x3cac('0x1c')](_0x37a3b1)[_0x3cac('0x1e')](_0x2db008);}};}function respondWithFilteredResult(_0x4680aa,_0x8d8927){return function(_0x202437){if(_0x202437){var _0x37e529=typeof _0x8d8927[_0x3cac('0x1f')]===_0x3cac('0x20')&&typeof _0x8d8927[_0x3cac('0x21')]===_0x3cac('0x20');var _0x2c1766=_0x202437[_0x3cac('0x22')];var _0x1b1007=_0x37e529?0x0:_0x8d8927[_0x3cac('0x1f')];var _0x752c5b=_0x37e529?_0x202437[_0x3cac('0x22')]:_0x8d8927[_0x3cac('0x1f')]+_0x8d8927[_0x3cac('0x21')];var _0x1a2e7e;if(_0x752c5b>=_0x2c1766){_0x752c5b=_0x2c1766;_0x1a2e7e=0xc8;}else{_0x1a2e7e=0xce;}_0x4680aa[_0x3cac('0x1c')](_0x1a2e7e);return _0x4680aa['set'](_0x3cac('0x23'),_0x1b1007+'-'+_0x752c5b+'/'+_0x2c1766)[_0x3cac('0x1e')](_0x202437);}return null;};}function patchUpdates(_0x5af4b9){return function(_0x1d5d41){try{jsonpatch[_0x3cac('0x24')](_0x1d5d41,_0x5af4b9,!![]);}catch(_0x40a088){return BPromise[_0x3cac('0x25')](_0x40a088);}return _0x1d5d41[_0x3cac('0x26')]();};}function saveUpdates(_0x147d3b,_0x530057){return function(_0x19010f){if(_0x19010f){return _0x19010f['update'](_0x147d3b)['then'](function(_0x5a78ed){return _0x5a78ed;});}return null;};}function removeEntity(_0xf63f1d,_0x842c3d){return function(_0x2fe8a9){if(_0x2fe8a9){return _0x2fe8a9[_0x3cac('0x27')]()[_0x3cac('0x28')](function(){_0xf63f1d[_0x3cac('0x1c')](0xcc)[_0x3cac('0x1d')]();});}};}function handleEntityNotFound(_0x3f79b6,_0x303d05){return function(_0x456883){if(!_0x456883){_0x3f79b6[_0x3cac('0x1b')](0x194);}return _0x456883;};}function handleError(_0x407e8b,_0x5c60df){_0x5c60df=_0x5c60df||0x1f4;return function(_0x24c4fb){logger[_0x3cac('0x29')](_0x24c4fb[_0x3cac('0x2a')]);if(_0x24c4fb[_0x3cac('0x2b')]){delete _0x24c4fb[_0x3cac('0x2b')];}_0x407e8b[_0x3cac('0x1c')](_0x5c60df)[_0x3cac('0x2c')](_0x24c4fb);};}exports[_0x3cac('0x2d')]=function(_0xbc5721,_0x2d7847){var _0x2b7caf={},_0x391412={},_0x2019c0={'count':0x0,'rows':[]};var _0x29c896=_[_0x3cac('0x2e')](db[_0x3cac('0x2f')][_0x3cac('0x30')],function(_0xa08a6){return{'name':_0xa08a6[_0x3cac('0x31')],'type':_0xa08a6[_0x3cac('0x32')][_0x3cac('0x33')]};});_0x391412[_0x3cac('0x34')]=_[_0x3cac('0x2e')](_0x29c896,'name');_0x391412[_0x3cac('0x35')]=_[_0x3cac('0x36')](_0xbc5721[_0x3cac('0x35')]);_0x391412[_0x3cac('0x37')]=_[_0x3cac('0x38')](_0x391412['model'],_0x391412['query']);_0x2b7caf[_0x3cac('0x39')]=_[_0x3cac('0x38')](_0x391412['model'],qs[_0x3cac('0x3a')](_0xbc5721['query']['fields']));_0x2b7caf[_0x3cac('0x39')]=_0x2b7caf[_0x3cac('0x39')]['length']?_0x2b7caf[_0x3cac('0x39')]:_0x391412[_0x3cac('0x34')];if(!_0xbc5721[_0x3cac('0x35')][_0x3cac('0x3b')](_0x3cac('0x3c'))){_0x2b7caf[_0x3cac('0x21')]=qs[_0x3cac('0x21')](_0xbc5721[_0x3cac('0x35')][_0x3cac('0x21')]);_0x2b7caf['offset']=qs['offset'](_0xbc5721[_0x3cac('0x35')][_0x3cac('0x1f')]);}_0x2b7caf[_0x3cac('0x3d')]=qs[_0x3cac('0x3e')](_0xbc5721[_0x3cac('0x35')][_0x3cac('0x3e')]);_0x2b7caf[_0x3cac('0x3f')]=qs[_0x3cac('0x37')](_['pick'](_0xbc5721[_0x3cac('0x35')],_0x391412[_0x3cac('0x37')]),_0x29c896);if(_0xbc5721['query'][_0x3cac('0x40')]){_0x2b7caf[_0x3cac('0x3f')]=_[_0x3cac('0x41')](_0x2b7caf['where'],{'$or':_['map'](_0x29c896,function(_0x22e17b){if(_0x22e17b[_0x3cac('0x32')]!==_0x3cac('0x42')){var _0xc9b8c2={};_0xc9b8c2[_0x22e17b[_0x3cac('0x2b')]]={'$like':'%'+_0xbc5721[_0x3cac('0x35')][_0x3cac('0x40')]+'%'};return _0xc9b8c2;}})});}_0x2b7caf=_[_0x3cac('0x41')]({},_0x2b7caf,_0xbc5721[_0x3cac('0x43')]);var _0x2cb2c0={'where':_0x2b7caf[_0x3cac('0x3f')]};return db[_0x3cac('0x2f')][_0x3cac('0x22')](_0x2cb2c0)['then'](function(_0x25b897){_0x2019c0['count']=_0x25b897;if(_0xbc5721[_0x3cac('0x35')][_0x3cac('0x44')]){_0x2b7caf[_0x3cac('0x45')]=[{'all':!![]}];}return db[_0x3cac('0x2f')][_0x3cac('0x46')](_0x2b7caf);})['then'](function(_0x135a22){_0x2019c0[_0x3cac('0x47')]=_0x135a22;return _0x2019c0;})[_0x3cac('0x28')](respondWithFilteredResult(_0x2d7847,_0x2b7caf))[_0x3cac('0x48')](handleError(_0x2d7847,null));};exports[_0x3cac('0x49')]=function(_0x455487,_0x1f46ce){var _0x25f972={'raw':!![],'where':{'id':_0x455487[_0x3cac('0x4a')]['id']}},_0x1fb9be={};_0x1fb9be[_0x3cac('0x34')]=_[_0x3cac('0x36')](db['ChatQueueReport']['rawAttributes']);_0x1fb9be[_0x3cac('0x35')]=_[_0x3cac('0x36')](_0x455487['query']);_0x1fb9be[_0x3cac('0x37')]=_[_0x3cac('0x38')](_0x1fb9be['model'],_0x1fb9be[_0x3cac('0x35')]);_0x25f972[_0x3cac('0x39')]=_[_0x3cac('0x38')](_0x1fb9be[_0x3cac('0x34')],qs[_0x3cac('0x3a')](_0x455487[_0x3cac('0x35')][_0x3cac('0x3a')]));_0x25f972[_0x3cac('0x39')]=_0x25f972['attributes'][_0x3cac('0x4b')]?_0x25f972['attributes']:_0x1fb9be['model'];if(_0x455487[_0x3cac('0x35')][_0x3cac('0x44')]){_0x25f972['include']=[{'all':!![]}];}_0x25f972=_[_0x3cac('0x41')]({},_0x25f972,_0x455487[_0x3cac('0x43')]);return db[_0x3cac('0x2f')][_0x3cac('0x4c')](_0x25f972)[_0x3cac('0x28')](handleEntityNotFound(_0x1f46ce,null))['then'](respondWithResult(_0x1f46ce,null))[_0x3cac('0x48')](handleError(_0x1f46ce,null));};exports[_0x3cac('0x4d')]=function(_0x550a9c,_0x3f26d1){return db[_0x3cac('0x2f')][_0x3cac('0x4d')](_0x550a9c[_0x3cac('0x4e')],{})['then'](respondWithResult(_0x3f26d1,0xc9))[_0x3cac('0x48')](handleError(_0x3f26d1,null));};exports[_0x3cac('0x4f')]=function(_0x1827ba,_0xab4339){if(_0x1827ba[_0x3cac('0x4e')]['id']){delete _0x1827ba['body']['id'];}return db[_0x3cac('0x2f')][_0x3cac('0x4c')]({'where':{'id':_0x1827ba[_0x3cac('0x4a')]['id']}})['then'](handleEntityNotFound(_0xab4339,null))[_0x3cac('0x28')](saveUpdates(_0x1827ba[_0x3cac('0x4e')],null))[_0x3cac('0x28')](respondWithResult(_0xab4339,null))[_0x3cac('0x48')](handleError(_0xab4339,null));};exports['destroy']=function(_0x22b140,_0x39c044){return db['ChatQueueReport'][_0x3cac('0x4c')]({'where':{'id':_0x22b140['params']['id']}})[_0x3cac('0x28')](handleEntityNotFound(_0x39c044,null))[_0x3cac('0x28')](removeEntity(_0x39c044,null))[_0x3cac('0x48')](handleError(_0x39c044,null));};exports['describe']=function(_0x503fca,_0x568c7b){return db[_0x3cac('0x2f')][_0x3cac('0x50')]()['then'](respondWithResult(_0x568c7b,null))[_0x3cac('0x48')](handleError(_0x568c7b,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 66e76f7..f5b7dd0 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x187499,_0x5e416a){var _0x2965fe=function(_0xc6645e){while(--_0xc6645e){_0x187499['push'](_0x187499['shift']());}};_0x2965fe(++_0x5e416a);}(_0xe706,0xa3));var _0x6e70=function(_0x3f553b,_0x49a9c2){_0x3f553b=_0x3f553b-0x0;var _0x183c4e=_0xe706[_0x3f553b];return _0x183c4e;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x2f8805,_0x2f1d21){var _0xa16375=function(_0x1c5bcc){while(--_0x1c5bcc){_0x2f8805['push'](_0x2f8805['shift']());}};_0xa16375(++_0x2f1d21);}(_0xb10b,0x12a));var _0xbb10=function(_0x1de01d,_0xeb122c){_0x1de01d=_0x1de01d-0x0;var _0x2865ef=_0xb10b[_0x1de01d];return _0x2865ef;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 43b182d..31b38d0 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 _0xaad5=['error','code','message','result','ChatQueueReport','create','options','raw','catch','CreateChatQueueReport','UpdateChatQueueReport','update','body','attributes','limit','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1ae951,_0x28d675){var _0x3570aa=function(_0x458cb5){while(--_0x458cb5){_0x1ae951['push'](_0x1ae951['shift']());}};_0x3570aa(++_0x28d675);}(_0xaad5,0x177));var _0x5aad=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xaad5[_0x3e2fcf];return _0x497db7;};'use strict';var _=require(_0x5aad('0x0'));var util=require(_0x5aad('0x1'));var moment=require(_0x5aad('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5aad('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5aad('0x4'))(_0x5aad('0x5'));var config=require(_0x5aad('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5aad('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3b02e4,_0x59aef4,_0x57e1ed){return new BPromise(function(_0x3f7a73,_0x2dc9d4){return client[_0x5aad('0x8')](_0x3b02e4,_0x57e1ed)[_0x5aad('0x9')](function(_0x543d05){logger[_0x5aad('0xa')](_0x5aad('0xb'),_0x59aef4,_0x5aad('0xc'));logger[_0x5aad('0xd')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x59aef4,_0x5aad('0xc'),JSON[_0x5aad('0xe')](_0x543d05));if(_0x543d05[_0x5aad('0xf')]){if(_0x543d05[_0x5aad('0xf')][_0x5aad('0x10')]===0x1f4){logger[_0x5aad('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x59aef4,_0x543d05['error'][_0x5aad('0x11')]);return _0x2dc9d4(_0x543d05[_0x5aad('0xf')][_0x5aad('0x11')]);}logger[_0x5aad('0xf')](_0x5aad('0xb'),_0x59aef4,_0x543d05[_0x5aad('0xf')]['message']);return _0x3f7a73(_0x543d05[_0x5aad('0xf')][_0x5aad('0x11')]);}else{logger[_0x5aad('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x59aef4,'request\x20sent');_0x3f7a73(_0x543d05[_0x5aad('0x12')][_0x5aad('0x11')]);}})['catch'](function(_0x3d5720){logger['error'](_0x5aad('0xb'),_0x59aef4,_0x3d5720);_0x2dc9d4(_0x3d5720);});});}exports['CreateChatQueueReport']=function(_0x26d226){var _0x194b2c=this;return new Promise(function(_0x5e4ca3,_0x108464){return db[_0x5aad('0x13')][_0x5aad('0x14')](_0x26d226['body'],{'raw':_0x26d226[_0x5aad('0x15')]?_0x26d226[_0x5aad('0x15')][_0x5aad('0x16')]===undefined?!![]:![]:!![]})[_0x5aad('0x9')](function(_0x42a98b){logger['info']('CreateChatQueueReport',_0x26d226);logger[_0x5aad('0xd')]('CreateChatQueueReport',_0x26d226,JSON[_0x5aad('0xe')](_0x42a98b));_0x5e4ca3(_0x42a98b);})[_0x5aad('0x17')](function(_0x3ceb52){logger[_0x5aad('0xf')](_0x5aad('0x18'),_0x3ceb52['message'],_0x26d226);_0x108464(_0x194b2c[_0x5aad('0xf')](0x1f4,_0x3ceb52[_0x5aad('0x11')]));});});};exports[_0x5aad('0x19')]=function(_0x19e67a){var _0x5ad3fe=this;return new Promise(function(_0x48f075,_0x233a36){return db[_0x5aad('0x13')][_0x5aad('0x1a')](_0x19e67a[_0x5aad('0x1b')],{'raw':_0x19e67a[_0x5aad('0x15')]?_0x19e67a[_0x5aad('0x15')][_0x5aad('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19e67a[_0x5aad('0x15')]?_0x19e67a[_0x5aad('0x15')]['where']||null:null,'attributes':_0x19e67a[_0x5aad('0x15')]?_0x19e67a[_0x5aad('0x15')][_0x5aad('0x1c')]||null:null,'limit':_0x19e67a[_0x5aad('0x15')]?_0x19e67a[_0x5aad('0x15')][_0x5aad('0x1d')]||null:null})['then'](function(_0x29a9e9){logger[_0x5aad('0xa')](_0x5aad('0x19'),_0x19e67a);logger[_0x5aad('0xd')](_0x5aad('0x19'),_0x19e67a,JSON[_0x5aad('0xe')](_0x29a9e9));_0x48f075(_0x29a9e9);})['catch'](function(_0x59e7c6){logger[_0x5aad('0xf')]('UpdateChatQueueReport',_0x59e7c6[_0x5aad('0x11')],_0x19e67a);_0x233a36(_0x5ad3fe[_0x5aad('0xf')](0x1f4,_0x59e7c6[_0x5aad('0x11')]));});});};
\ No newline at end of file
+var _0xccde=['ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','ChatQueueReport','create','options','raw','info','CreateChatQueueReport','catch','UpdateChatQueueReport','update','body','where','limit','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','ChatQueueReport,\x20%s,\x20%s','debug'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xccde,0x113));var _0xeccd=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0xccde[_0x4099ee];return _0x1b7bfc;};'use strict';var _=require('lodash');var util=require(_0xeccd('0x0'));var moment=require('moment');var BPromise=require(_0xeccd('0x1'));var rs=require(_0xeccd('0x2'));var fs=require('fs');var Redis=require(_0xeccd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xeccd('0x4'));var logger=require(_0xeccd('0x5'))('rpc');var config=require(_0xeccd('0x6'));var jayson=require(_0xeccd('0x7'));var client=jayson[_0xeccd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b6f0e,_0x4beb0a,_0x25f064){return new BPromise(function(_0x34be82,_0x47fa75){return client[_0xeccd('0x9')](_0x1b6f0e,_0x25f064)[_0xeccd('0xa')](function(_0x31fda3){logger['info'](_0xeccd('0xb'),_0x4beb0a,'request\x20sent');logger[_0xeccd('0xc')](_0xeccd('0xd'),_0x4beb0a,_0xeccd('0xe'),JSON[_0xeccd('0xf')](_0x31fda3));if(_0x31fda3['error']){if(_0x31fda3['error'][_0xeccd('0x10')]===0x1f4){logger['error'](_0xeccd('0xb'),_0x4beb0a,_0x31fda3[_0xeccd('0x11')][_0xeccd('0x12')]);return _0x47fa75(_0x31fda3[_0xeccd('0x11')][_0xeccd('0x12')]);}logger[_0xeccd('0x11')](_0xeccd('0xb'),_0x4beb0a,_0x31fda3[_0xeccd('0x11')][_0xeccd('0x12')]);return _0x34be82(_0x31fda3[_0xeccd('0x11')][_0xeccd('0x12')]);}else{logger['info'](_0xeccd('0xb'),_0x4beb0a,'request\x20sent');_0x34be82(_0x31fda3[_0xeccd('0x13')][_0xeccd('0x12')]);}})['catch'](function(_0x38a381){logger[_0xeccd('0x11')](_0xeccd('0xb'),_0x4beb0a,_0x38a381);_0x47fa75(_0x38a381);});});}exports['CreateChatQueueReport']=function(_0x575cef){var _0x4da23c=this;return new Promise(function(_0x393825,_0x156370){return db[_0xeccd('0x14')][_0xeccd('0x15')](_0x575cef['body'],{'raw':_0x575cef[_0xeccd('0x16')]?_0x575cef[_0xeccd('0x16')][_0xeccd('0x17')]===undefined?!![]:![]:!![]})[_0xeccd('0xa')](function(_0x4d2d06){logger[_0xeccd('0x18')](_0xeccd('0x19'),_0x575cef);logger[_0xeccd('0xc')](_0xeccd('0x19'),_0x575cef,JSON[_0xeccd('0xf')](_0x4d2d06));_0x393825(_0x4d2d06);})[_0xeccd('0x1a')](function(_0x2f35c1){logger[_0xeccd('0x11')](_0xeccd('0x19'),_0x2f35c1[_0xeccd('0x12')],_0x575cef);_0x156370(_0x4da23c['error'](0x1f4,_0x2f35c1[_0xeccd('0x12')]));});});};exports[_0xeccd('0x1b')]=function(_0x1ff48a){var _0xa09a02=this;return new Promise(function(_0x48b655,_0x1a9af4){return db[_0xeccd('0x14')][_0xeccd('0x1c')](_0x1ff48a[_0xeccd('0x1d')],{'raw':_0x1ff48a[_0xeccd('0x16')]?_0x1ff48a[_0xeccd('0x16')][_0xeccd('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ff48a['options']?_0x1ff48a[_0xeccd('0x16')][_0xeccd('0x1e')]||null:null,'attributes':_0x1ff48a[_0xeccd('0x16')]?_0x1ff48a[_0xeccd('0x16')]['attributes']||null:null,'limit':_0x1ff48a[_0xeccd('0x16')]?_0x1ff48a[_0xeccd('0x16')][_0xeccd('0x1f')]||null:null})[_0xeccd('0xa')](function(_0x266096){logger[_0xeccd('0x18')]('UpdateChatQueueReport',_0x1ff48a);logger[_0xeccd('0xc')](_0xeccd('0x1b'),_0x1ff48a,JSON['stringify'](_0x266096));_0x48b655(_0x266096);})[_0xeccd('0x1a')](function(_0x39424b){logger['error'](_0xeccd('0x1b'),_0x39424b[_0xeccd('0x12')],_0x1ff48a);_0x1a9af4(_0xa09a02[_0xeccd('0x11')](0x1f4,_0x39424b[_0xeccd('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index d44763e..0b320b0 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 _0x9d5c=['create','delete','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','describe','/:id','post'];(function(_0x375f69,_0x53535f){var _0x34ffba=function(_0x1709c1){while(--_0x1709c1){_0x375f69['push'](_0x375f69['shift']());}};_0x34ffba(++_0x53535f);}(_0x9d5c,0x64));var _0xc9d5=function(_0x1a1055,_0x36ed21){_0x1a1055=_0x1a1055-0x0;var _0x1abd1b=_0x9d5c[_0x1a1055];return _0x1abd1b;};'use strict';var multer=require(_0xc9d5('0x0'));var util=require(_0xc9d5('0x1'));var path=require(_0xc9d5('0x2'));var timeout=require(_0xc9d5('0x3'));var express=require(_0xc9d5('0x4'));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(_0xc9d5('0x5'));var controller=require(_0xc9d5('0x6'));router[_0xc9d5('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc9d5('0x7')]('/describe',auth[_0xc9d5('0x8')](),controller[_0xc9d5('0x9')]);router[_0xc9d5('0x7')](_0xc9d5('0xa'),auth[_0xc9d5('0x8')](),controller['show']);router[_0xc9d5('0xb')]('/',auth[_0xc9d5('0x8')](),controller[_0xc9d5('0xc')]);router['put']('/:id',auth[_0xc9d5('0x8')](),controller['update']);router[_0xc9d5('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xc9d5('0xe')]);module[_0xc9d5('0xf')]=router;
\ No newline at end of file
+var _0x2c78=['get','isAuthenticated','index','describe','create','put','/:id','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2c78,0x6e));var _0x82c7=function(_0x4eb662,_0x540e40){_0x4eb662=_0x4eb662-0x0;var _0x2d7889=_0x2c78[_0x4eb662];return _0x2d7889;};'use strict';var multer=require(_0x82c7('0x0'));var util=require(_0x82c7('0x1'));var path=require(_0x82c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x82c7('0x3'));var router=express[_0x82c7('0x4')]();var fs_extra=require(_0x82c7('0x5'));var auth=require(_0x82c7('0x6'));var interaction=require(_0x82c7('0x7'));var config=require(_0x82c7('0x8'));var controller=require(_0x82c7('0x9'));router[_0x82c7('0xa')]('/',auth[_0x82c7('0xb')](),controller[_0x82c7('0xc')]);router[_0x82c7('0xa')]('/describe',auth[_0x82c7('0xb')](),controller[_0x82c7('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x82c7('0xe')]);router[_0x82c7('0xf')](_0x82c7('0x10'),auth['isAuthenticated'](),controller[_0x82c7('0x11')]);router['delete']('/:id',auth[_0x82c7('0xb')](),controller[_0x82c7('0x12')]);module[_0x82c7('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 37dc448..381e088 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x29f720,_0x13226d){var _0x47519d=function(_0x123858){while(--_0x123858){_0x29f720['push'](_0x29f720['shift']());}};_0x47519d(++_0x13226d);}(_0xe706,0xa3));var _0x6e70=function(_0x36a997,_0x288f0b){_0x36a997=_0x36a997-0x0;var _0x561b1b=_0xe706[_0x36a997];return _0x561b1b;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}};
\ No newline at end of file
+var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4d3681,_0x136f19){var _0x22c7ac=function(_0x3c6120){while(--_0x3c6120){_0x4d3681['push'](_0x4d3681['shift']());}};_0x22c7ac(++_0x136f19);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 11228ef..3422a24 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 _0x7918=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','update','then','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','filters','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','querystring','papaparse','ioredis'];(function(_0x2acd7e,_0x4a5f48){var _0x5a6790=function(_0x52e03c){while(--_0x52e03c){_0x2acd7e['push'](_0x2acd7e['shift']());}};_0x5a6790(++_0x4a5f48);}(_0x7918,0x1e1));var _0x8791=function(_0x10ea94,_0x45b5f1){_0x10ea94=_0x10ea94-0x0;var _0x87c1bf=_0x7918[_0x10ea94];return _0x87c1bf;};'use strict';var emlformat=require(_0x8791('0x0'));var rimraf=require(_0x8791('0x1'));var zipdir=require(_0x8791('0x2'));var jsonpatch=require(_0x8791('0x3'));var rp=require(_0x8791('0x4'));var moment=require(_0x8791('0x5'));var BPromise=require(_0x8791('0x6'));var Mustache=require(_0x8791('0x7'));var util=require('util');var path=require(_0x8791('0x8'));var sox=require(_0x8791('0x9'));var csv=require(_0x8791('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8791('0xb'));var crypto=require(_0x8791('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8791('0xd'));var Papa=require(_0x8791('0xe'));var Redis=require(_0x8791('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8791('0x10'));var as=require(_0x8791('0x11'));var hardwareService=require(_0x8791('0x12'));var logger=require('../../config/logger')(_0x8791('0x13'));var utils=require('../../config/utils');var config=require(_0x8791('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20b190,_0x42000e){_0x42000e=_0x42000e||0xcc;return function(_0x313273){if(_0x313273){return _0x20b190[_0x8791('0x15')](_0x42000e);}return _0x20b190['status'](_0x42000e)[_0x8791('0x16')]();};}function respondWithResult(_0x2b42db,_0x32d001){_0x32d001=_0x32d001||0xc8;return function(_0x5cb392){if(_0x5cb392){return _0x2b42db[_0x8791('0x17')](_0x32d001)[_0x8791('0x18')](_0x5cb392);}};}function respondWithFilteredResult(_0xc74b91,_0x58b131){return function(_0x53600b){if(_0x53600b){var _0xc85c60=typeof _0x58b131['offset']==='undefined'&&typeof _0x58b131['limit']==='undefined';var _0x33c9db=_0x53600b[_0x8791('0x19')];var _0x1db2e1=_0xc85c60?0x0:_0x58b131['offset'];var _0x2f8672=_0xc85c60?_0x53600b[_0x8791('0x19')]:_0x58b131[_0x8791('0x1a')]+_0x58b131[_0x8791('0x1b')];var _0x61b79a;if(_0x2f8672>=_0x33c9db){_0x2f8672=_0x33c9db;_0x61b79a=0xc8;}else{_0x61b79a=0xce;}_0xc74b91[_0x8791('0x17')](_0x61b79a);return _0xc74b91[_0x8791('0x1c')](_0x8791('0x1d'),_0x1db2e1+'-'+_0x2f8672+'/'+_0x33c9db)[_0x8791('0x18')](_0x53600b);}return null;};}function patchUpdates(_0x1003f9){return function(_0xb37712){try{jsonpatch['apply'](_0xb37712,_0x1003f9,!![]);}catch(_0x58326f){return BPromise[_0x8791('0x1e')](_0x58326f);}return _0xb37712['save']();};}function saveUpdates(_0x5e25de,_0x5eade7){return function(_0x9d6d90){if(_0x9d6d90){return _0x9d6d90[_0x8791('0x1f')](_0x5e25de)[_0x8791('0x20')](function(_0x13d92e){return _0x13d92e;});}return null;};}function removeEntity(_0x19a75d,_0x17b090){return function(_0x17329f){if(_0x17329f){return _0x17329f['destroy']()[_0x8791('0x20')](function(){_0x19a75d['status'](0xcc)[_0x8791('0x16')]();});}};}function handleEntityNotFound(_0x372fa2,_0x492b1d){return function(_0x411ffe){if(!_0x411ffe){_0x372fa2[_0x8791('0x15')](0x194);}return _0x411ffe;};}function handleError(_0x1de0bc,_0x51edbd){_0x51edbd=_0x51edbd||0x1f4;return function(_0x2e400b){logger[_0x8791('0x21')](_0x2e400b[_0x8791('0x22')]);if(_0x2e400b[_0x8791('0x23')]){delete _0x2e400b['name'];}_0x1de0bc[_0x8791('0x17')](_0x51edbd)['send'](_0x2e400b);};}exports[_0x8791('0x24')]=function(_0x306e3a,_0x1aa4ef){var _0x5b13e1={},_0x546636={},_0x5dc91f={'count':0x0,'rows':[]};var _0x257d0e=_[_0x8791('0x25')](db[_0x8791('0x26')][_0x8791('0x27')],function(_0x3f410c){return{'name':_0x3f410c[_0x8791('0x28')],'type':_0x3f410c[_0x8791('0x29')][_0x8791('0x2a')]};});_0x546636[_0x8791('0x2b')]=_['map'](_0x257d0e,'name');_0x546636[_0x8791('0x2c')]=_[_0x8791('0x2d')](_0x306e3a[_0x8791('0x2c')]);_0x546636['filters']=_[_0x8791('0x2e')](_0x546636['model'],_0x546636[_0x8791('0x2c')]);_0x5b13e1['attributes']=_['intersection'](_0x546636[_0x8791('0x2b')],qs['fields'](_0x306e3a[_0x8791('0x2c')][_0x8791('0x2f')]));_0x5b13e1[_0x8791('0x30')]=_0x5b13e1[_0x8791('0x30')][_0x8791('0x31')]?_0x5b13e1[_0x8791('0x30')]:_0x546636[_0x8791('0x2b')];if(!_0x306e3a[_0x8791('0x2c')]['hasOwnProperty'](_0x8791('0x32'))){_0x5b13e1[_0x8791('0x1b')]=qs[_0x8791('0x1b')](_0x306e3a[_0x8791('0x2c')][_0x8791('0x1b')]);_0x5b13e1[_0x8791('0x1a')]=qs[_0x8791('0x1a')](_0x306e3a['query'][_0x8791('0x1a')]);}_0x5b13e1[_0x8791('0x33')]=qs['sort'](_0x306e3a['query']['sort']);_0x5b13e1['where']=qs[_0x8791('0x34')](_[_0x8791('0x35')](_0x306e3a['query'],_0x546636[_0x8791('0x34')]),_0x257d0e);if(_0x306e3a[_0x8791('0x2c')][_0x8791('0x36')]){_0x5b13e1['where']=_[_0x8791('0x37')](_0x5b13e1[_0x8791('0x38')],{'$or':_['map'](_0x257d0e,function(_0x13eb4b){if(_0x13eb4b[_0x8791('0x29')]!==_0x8791('0x39')){var _0x9372a1={};_0x9372a1[_0x13eb4b['name']]={'$like':'%'+_0x306e3a[_0x8791('0x2c')]['filter']+'%'};return _0x9372a1;}})});}_0x5b13e1=_[_0x8791('0x37')]({},_0x5b13e1,_0x306e3a['options']);var _0x127547={'where':_0x5b13e1[_0x8791('0x38')]};return db[_0x8791('0x26')][_0x8791('0x19')](_0x127547)[_0x8791('0x20')](function(_0x1fe837){_0x5dc91f['count']=_0x1fe837;if(_0x306e3a[_0x8791('0x2c')][_0x8791('0x3a')]){_0x5b13e1[_0x8791('0x3b')]=[{'all':!![]}];}return db[_0x8791('0x26')][_0x8791('0x3c')](_0x5b13e1);})[_0x8791('0x20')](function(_0x30b988){_0x5dc91f[_0x8791('0x3d')]=_0x30b988;return _0x5dc91f;})[_0x8791('0x20')](respondWithFilteredResult(_0x1aa4ef,_0x5b13e1))[_0x8791('0x3e')](handleError(_0x1aa4ef,null));};exports[_0x8791('0x3f')]=function(_0x5bc630,_0x15b2de){var _0x477edf={'raw':!![],'where':{'id':_0x5bc630[_0x8791('0x40')]['id']}},_0x3220e4={};_0x3220e4[_0x8791('0x2b')]=_[_0x8791('0x2d')](db[_0x8791('0x26')][_0x8791('0x27')]);_0x3220e4[_0x8791('0x2c')]=_[_0x8791('0x2d')](_0x5bc630['query']);_0x3220e4['filters']=_[_0x8791('0x2e')](_0x3220e4[_0x8791('0x2b')],_0x3220e4[_0x8791('0x2c')]);_0x477edf[_0x8791('0x30')]=_[_0x8791('0x2e')](_0x3220e4[_0x8791('0x2b')],qs['fields'](_0x5bc630[_0x8791('0x2c')][_0x8791('0x2f')]));_0x477edf[_0x8791('0x30')]=_0x477edf[_0x8791('0x30')][_0x8791('0x31')]?_0x477edf[_0x8791('0x30')]:_0x3220e4[_0x8791('0x2b')];if(_0x5bc630[_0x8791('0x2c')][_0x8791('0x3a')]){_0x477edf[_0x8791('0x3b')]=[{'all':!![]}];}_0x477edf=_[_0x8791('0x37')]({},_0x477edf,_0x5bc630[_0x8791('0x41')]);return db['ChatTransferReport'][_0x8791('0x42')](_0x477edf)[_0x8791('0x20')](handleEntityNotFound(_0x15b2de,null))[_0x8791('0x20')](respondWithResult(_0x15b2de,null))[_0x8791('0x3e')](handleError(_0x15b2de,null));};exports[_0x8791('0x43')]=function(_0x4b9d2d,_0x4894f9){return db[_0x8791('0x26')]['create'](_0x4b9d2d[_0x8791('0x44')],{})[_0x8791('0x20')](respondWithResult(_0x4894f9,0xc9))[_0x8791('0x3e')](handleError(_0x4894f9,null));};exports['update']=function(_0x197525,_0x1cab3){if(_0x197525['body']['id']){delete _0x197525[_0x8791('0x44')]['id'];}return db[_0x8791('0x26')]['find']({'where':{'id':_0x197525[_0x8791('0x40')]['id']}})[_0x8791('0x20')](handleEntityNotFound(_0x1cab3,null))[_0x8791('0x20')](saveUpdates(_0x197525[_0x8791('0x44')],null))[_0x8791('0x20')](respondWithResult(_0x1cab3,null))['catch'](handleError(_0x1cab3,null));};exports[_0x8791('0x45')]=function(_0x164d0e,_0x30f5f8){return db[_0x8791('0x26')][_0x8791('0x42')]({'where':{'id':_0x164d0e[_0x8791('0x40')]['id']}})[_0x8791('0x20')](handleEntityNotFound(_0x30f5f8,null))[_0x8791('0x20')](removeEntity(_0x30f5f8,null))[_0x8791('0x3e')](handleError(_0x30f5f8,null));};exports['describe']=function(_0x5a7791,_0x331785){return db[_0x8791('0x26')][_0x8791('0x46')]()[_0x8791('0x20')](respondWithResult(_0x331785,null))['catch'](handleError(_0x331785,null));};
\ No newline at end of file
+var _0x05df=['offset','undefined','count','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','status','end','json'];(function(_0xa21cbf,_0x551394){var _0xed2632=function(_0x31f41e){while(--_0x31f41e){_0xa21cbf['push'](_0xa21cbf['shift']());}};_0xed2632(++_0x551394);}(_0x05df,0x101));var _0xf05d=function(_0x63fecc,_0x318df4){_0x63fecc=_0x63fecc-0x0;var _0x17936c=_0x05df[_0x63fecc];return _0x17936c;};'use strict';var emlformat=require(_0xf05d('0x0'));var rimraf=require(_0xf05d('0x1'));var zipdir=require(_0xf05d('0x2'));var jsonpatch=require(_0xf05d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf05d('0x4'));var Mustache=require(_0xf05d('0x5'));var util=require(_0xf05d('0x6'));var path=require(_0xf05d('0x7'));var sox=require('sox');var csv=require(_0xf05d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf05d('0x9'));var squel=require('squel');var crypto=require(_0xf05d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf05d('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf05d('0xc'));var Papa=require(_0xf05d('0xd'));var Redis=require(_0xf05d('0xe'));var authService=require(_0xf05d('0xf'));var qs=require(_0xf05d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf05d('0x11'));var logger=require('../../config/logger')(_0xf05d('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf05d('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10f652,_0x192871){_0x192871=_0x192871||0xcc;return function(_0x111fde){if(_0x111fde){return _0x10f652['sendStatus'](_0x192871);}return _0x10f652[_0xf05d('0x14')](_0x192871)[_0xf05d('0x15')]();};}function respondWithResult(_0x46f79e,_0x314140){_0x314140=_0x314140||0xc8;return function(_0x271815){if(_0x271815){return _0x46f79e['status'](_0x314140)[_0xf05d('0x16')](_0x271815);}};}function respondWithFilteredResult(_0x49a010,_0x3ac901){return function(_0x106297){if(_0x106297){var _0x2b97c0=typeof _0x3ac901[_0xf05d('0x17')]===_0xf05d('0x18')&&typeof _0x3ac901['limit']===_0xf05d('0x18');var _0x3697c3=_0x106297[_0xf05d('0x19')];var _0x22e3ad=_0x2b97c0?0x0:_0x3ac901[_0xf05d('0x17')];var _0x4d59d3=_0x2b97c0?_0x106297['count']:_0x3ac901[_0xf05d('0x17')]+_0x3ac901['limit'];var _0x5522e4;if(_0x4d59d3>=_0x3697c3){_0x4d59d3=_0x3697c3;_0x5522e4=0xc8;}else{_0x5522e4=0xce;}_0x49a010[_0xf05d('0x14')](_0x5522e4);return _0x49a010['set']('Content-Range',_0x22e3ad+'-'+_0x4d59d3+'/'+_0x3697c3)[_0xf05d('0x16')](_0x106297);}return null;};}function patchUpdates(_0x5ad4fe){return function(_0x21941b){try{jsonpatch[_0xf05d('0x1a')](_0x21941b,_0x5ad4fe,!![]);}catch(_0x4024bc){return BPromise[_0xf05d('0x1b')](_0x4024bc);}return _0x21941b[_0xf05d('0x1c')]();};}function saveUpdates(_0x4dfcfe,_0xc8c4e1){return function(_0x41296e){if(_0x41296e){return _0x41296e[_0xf05d('0x1d')](_0x4dfcfe)[_0xf05d('0x1e')](function(_0x34fee9){return _0x34fee9;});}return null;};}function removeEntity(_0x20c706,_0x29321b){return function(_0x1b84ea){if(_0x1b84ea){return _0x1b84ea[_0xf05d('0x1f')]()[_0xf05d('0x1e')](function(){_0x20c706[_0xf05d('0x14')](0xcc)[_0xf05d('0x15')]();});}};}function handleEntityNotFound(_0x5829dd,_0x2d1a41){return function(_0x433e02){if(!_0x433e02){_0x5829dd[_0xf05d('0x20')](0x194);}return _0x433e02;};}function handleError(_0x329330,_0x43161e){_0x43161e=_0x43161e||0x1f4;return function(_0x1039e4){logger[_0xf05d('0x21')](_0x1039e4[_0xf05d('0x22')]);if(_0x1039e4[_0xf05d('0x23')]){delete _0x1039e4[_0xf05d('0x23')];}_0x329330[_0xf05d('0x14')](_0x43161e)[_0xf05d('0x24')](_0x1039e4);};}exports['index']=function(_0x1a585c,_0x5bcb99){var _0x341ec0={},_0x2ec064={},_0x388596={'count':0x0,'rows':[]};var _0x2f7436=_['map'](db[_0xf05d('0x25')][_0xf05d('0x26')],function(_0x45f3ce){return{'name':_0x45f3ce[_0xf05d('0x27')],'type':_0x45f3ce[_0xf05d('0x28')][_0xf05d('0x29')]};});_0x2ec064[_0xf05d('0x2a')]=_[_0xf05d('0x2b')](_0x2f7436,_0xf05d('0x23'));_0x2ec064[_0xf05d('0x2c')]=_['keys'](_0x1a585c[_0xf05d('0x2c')]);_0x2ec064['filters']=_[_0xf05d('0x2d')](_0x2ec064[_0xf05d('0x2a')],_0x2ec064[_0xf05d('0x2c')]);_0x341ec0[_0xf05d('0x2e')]=_[_0xf05d('0x2d')](_0x2ec064[_0xf05d('0x2a')],qs[_0xf05d('0x2f')](_0x1a585c[_0xf05d('0x2c')][_0xf05d('0x2f')]));_0x341ec0[_0xf05d('0x2e')]=_0x341ec0[_0xf05d('0x2e')][_0xf05d('0x30')]?_0x341ec0[_0xf05d('0x2e')]:_0x2ec064[_0xf05d('0x2a')];if(!_0x1a585c[_0xf05d('0x2c')][_0xf05d('0x31')](_0xf05d('0x32'))){_0x341ec0['limit']=qs['limit'](_0x1a585c[_0xf05d('0x2c')][_0xf05d('0x33')]);_0x341ec0[_0xf05d('0x17')]=qs[_0xf05d('0x17')](_0x1a585c[_0xf05d('0x2c')]['offset']);}_0x341ec0[_0xf05d('0x34')]=qs['sort'](_0x1a585c[_0xf05d('0x2c')][_0xf05d('0x35')]);_0x341ec0[_0xf05d('0x36')]=qs[_0xf05d('0x37')](_['pick'](_0x1a585c[_0xf05d('0x2c')],_0x2ec064[_0xf05d('0x37')]),_0x2f7436);if(_0x1a585c[_0xf05d('0x2c')][_0xf05d('0x38')]){_0x341ec0['where']=_[_0xf05d('0x39')](_0x341ec0[_0xf05d('0x36')],{'$or':_[_0xf05d('0x2b')](_0x2f7436,function(_0x3f171f){if(_0x3f171f[_0xf05d('0x28')]!=='VIRTUAL'){var _0x112fa5={};_0x112fa5[_0x3f171f[_0xf05d('0x23')]]={'$like':'%'+_0x1a585c[_0xf05d('0x2c')][_0xf05d('0x38')]+'%'};return _0x112fa5;}})});}_0x341ec0=_['merge']({},_0x341ec0,_0x1a585c[_0xf05d('0x3a')]);var _0x220968={'where':_0x341ec0[_0xf05d('0x36')]};return db[_0xf05d('0x25')][_0xf05d('0x19')](_0x220968)['then'](function(_0x133989){_0x388596[_0xf05d('0x19')]=_0x133989;if(_0x1a585c[_0xf05d('0x2c')][_0xf05d('0x3b')]){_0x341ec0['include']=[{'all':!![]}];}return db[_0xf05d('0x25')][_0xf05d('0x3c')](_0x341ec0);})[_0xf05d('0x1e')](function(_0x592abc){_0x388596[_0xf05d('0x3d')]=_0x592abc;return _0x388596;})[_0xf05d('0x1e')](respondWithFilteredResult(_0x5bcb99,_0x341ec0))[_0xf05d('0x3e')](handleError(_0x5bcb99,null));};exports[_0xf05d('0x3f')]=function(_0x1a66ef,_0x2a02d4){var _0xe17bcf={'raw':!![],'where':{'id':_0x1a66ef[_0xf05d('0x40')]['id']}},_0x2f3c89={};_0x2f3c89[_0xf05d('0x2a')]=_[_0xf05d('0x41')](db[_0xf05d('0x25')][_0xf05d('0x26')]);_0x2f3c89[_0xf05d('0x2c')]=_[_0xf05d('0x41')](_0x1a66ef['query']);_0x2f3c89[_0xf05d('0x37')]=_[_0xf05d('0x2d')](_0x2f3c89['model'],_0x2f3c89[_0xf05d('0x2c')]);_0xe17bcf[_0xf05d('0x2e')]=_[_0xf05d('0x2d')](_0x2f3c89[_0xf05d('0x2a')],qs[_0xf05d('0x2f')](_0x1a66ef[_0xf05d('0x2c')][_0xf05d('0x2f')]));_0xe17bcf[_0xf05d('0x2e')]=_0xe17bcf[_0xf05d('0x2e')][_0xf05d('0x30')]?_0xe17bcf[_0xf05d('0x2e')]:_0x2f3c89[_0xf05d('0x2a')];if(_0x1a66ef[_0xf05d('0x2c')][_0xf05d('0x3b')]){_0xe17bcf[_0xf05d('0x42')]=[{'all':!![]}];}_0xe17bcf=_['merge']({},_0xe17bcf,_0x1a66ef['options']);return db[_0xf05d('0x25')][_0xf05d('0x43')](_0xe17bcf)[_0xf05d('0x1e')](handleEntityNotFound(_0x2a02d4,null))['then'](respondWithResult(_0x2a02d4,null))['catch'](handleError(_0x2a02d4,null));};exports[_0xf05d('0x44')]=function(_0x166e72,_0x32336f){return db[_0xf05d('0x25')][_0xf05d('0x44')](_0x166e72[_0xf05d('0x45')],{})[_0xf05d('0x1e')](respondWithResult(_0x32336f,0xc9))[_0xf05d('0x3e')](handleError(_0x32336f,null));};exports['update']=function(_0x37f345,_0x1f328e){if(_0x37f345['body']['id']){delete _0x37f345[_0xf05d('0x45')]['id'];}return db['ChatTransferReport'][_0xf05d('0x43')]({'where':{'id':_0x37f345[_0xf05d('0x40')]['id']}})[_0xf05d('0x1e')](handleEntityNotFound(_0x1f328e,null))[_0xf05d('0x1e')](saveUpdates(_0x37f345[_0xf05d('0x45')],null))[_0xf05d('0x1e')](respondWithResult(_0x1f328e,null))[_0xf05d('0x3e')](handleError(_0x1f328e,null));};exports[_0xf05d('0x1f')]=function(_0x594090,_0x118e41){return db[_0xf05d('0x25')][_0xf05d('0x43')]({'where':{'id':_0x594090['params']['id']}})[_0xf05d('0x1e')](handleEntityNotFound(_0x118e41,null))[_0xf05d('0x1e')](removeEntity(_0x118e41,null))['catch'](handleError(_0x118e41,null));};exports['describe']=function(_0x2a0d20,_0x1ef603){return db[_0xf05d('0x25')]['describe']()[_0xf05d('0x1e')](respondWithResult(_0x1ef603,null))[_0xf05d('0x3e')](handleError(_0x1ef603,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index a313e35..2024a25 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 _0x4a54=['request-promise','path','rimraf','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x14d06a,_0x4fa706){var _0x580485=function(_0x286fa3){while(--_0x286fa3){_0x14d06a['push'](_0x14d06a['shift']());}};_0x580485(++_0x4fa706);}(_0x4a54,0x133));var _0x44a5=function(_0x58ef64,_0x47c44e){_0x58ef64=_0x58ef64-0x0;var _0x51584b=_0x4a54[_0x58ef64];return _0x51584b;};'use strict';var _=require(_0x44a5('0x0'));var util=require(_0x44a5('0x1'));var logger=require(_0x44a5('0x2'))(_0x44a5('0x3'));var moment=require(_0x44a5('0x4'));var BPromise=require('bluebird');var rp=require(_0x44a5('0x5'));var fs=require('fs');var path=require(_0x44a5('0x6'));var rimraf=require(_0x44a5('0x7'));var config=require('../../config/environment');var attributes=require(_0x44a5('0x8'));module['exports']=function(_0x4f1ff3,_0x45cbe5){return _0x4f1ff3['define'](_0x44a5('0x9'),attributes,{'tableName':_0x44a5('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x44a5('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x57e4=['report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x57e4,0x197));var _0x457e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x57e4[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x457e('0x0'));var util=require(_0x457e('0x1'));var logger=require(_0x457e('0x2'))(_0x457e('0x3'));var moment=require('moment');var BPromise=require(_0x457e('0x4'));var rp=require(_0x457e('0x5'));var fs=require('fs');var path=require(_0x457e('0x6'));var rimraf=require(_0x457e('0x7'));var config=require(_0x457e('0x8'));var attributes=require(_0x457e('0x9'));module[_0x457e('0xa')]=function(_0x21de0e,_0x22cca9){return _0x21de0e[_0x457e('0xb')](_0x457e('0xc'),attributes,{'tableName':_0x457e('0xd'),'paranoid':![],'indexes':[{'name':_0x457e('0xe'),'fields':[_0x457e('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index d3fb934..50190c3 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 _0x1ef8=['then','info','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x11e2d1,_0x1edb96){var _0x51fb77=function(_0x246a1d){while(--_0x246a1d){_0x11e2d1['push'](_0x11e2d1['shift']());}};_0x51fb77(++_0x1edb96);}(_0x1ef8,0x137));var _0x81ef=function(_0x38c8c0,_0x52678b){_0x38c8c0=_0x38c8c0-0x0;var _0x397bd5=_0x1ef8[_0x38c8c0];return _0x397bd5;};'use strict';var _=require(_0x81ef('0x0'));var util=require(_0x81ef('0x1'));var moment=require(_0x81ef('0x2'));var BPromise=require(_0x81ef('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81ef('0x4'));var db=require(_0x81ef('0x5'))['db'];var utils=require(_0x81ef('0x6'));var logger=require(_0x81ef('0x7'))(_0x81ef('0x8'));var config=require(_0x81ef('0x9'));var jayson=require(_0x81ef('0xa'));var client=jayson[_0x81ef('0xb')][_0x81ef('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16bc33,_0x468d55,_0x1c6e46){return new BPromise(function(_0x39235f,_0x19c253){return client[_0x81ef('0xd')](_0x16bc33,_0x1c6e46)[_0x81ef('0xe')](function(_0x19ef26){logger[_0x81ef('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x468d55,'request\x20sent');logger['debug'](_0x81ef('0x10'),_0x468d55,_0x81ef('0x11'),JSON[_0x81ef('0x12')](_0x19ef26));if(_0x19ef26['error']){if(_0x19ef26['error'][_0x81ef('0x13')]===0x1f4){logger[_0x81ef('0x14')](_0x81ef('0x15'),_0x468d55,_0x19ef26[_0x81ef('0x14')]['message']);return _0x19c253(_0x19ef26[_0x81ef('0x14')][_0x81ef('0x16')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x468d55,_0x19ef26['error'][_0x81ef('0x16')]);return _0x39235f(_0x19ef26['error'][_0x81ef('0x16')]);}else{logger['info'](_0x81ef('0x15'),_0x468d55,_0x81ef('0x11'));_0x39235f(_0x19ef26[_0x81ef('0x17')][_0x81ef('0x16')]);}})[_0x81ef('0x18')](function(_0x5bd731){logger[_0x81ef('0x14')](_0x81ef('0x15'),_0x468d55,_0x5bd731);_0x19c253(_0x5bd731);});});}
\ No newline at end of file
+var _0xe802=['client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','bluebird','randomstring','../../config/environment','jayson/promise'];(function(_0x275caa,_0x166d5e){var _0x28d670=function(_0x2a20e1){while(--_0x2a20e1){_0x275caa['push'](_0x275caa['shift']());}};_0x28d670(++_0x166d5e);}(_0xe802,0x8b));var _0x2e80=function(_0x1de352,_0x5e2970){_0x1de352=_0x1de352-0x0;var _0x2e80fd=_0xe802[_0x1de352];return _0x2e80fd;};'use strict';var _=require(_0x2e80('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2e80('0x1'));var rs=require(_0x2e80('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2e80('0x3'));var jayson=require(_0x2e80('0x4'));var client=jayson[_0x2e80('0x5')][_0x2e80('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x405e81,_0x277072,_0x3b9aa7){return new BPromise(function(_0x54ea09,_0x402768){return client[_0x2e80('0x7')](_0x405e81,_0x3b9aa7)[_0x2e80('0x8')](function(_0x4bd762){logger[_0x2e80('0x9')](_0x2e80('0xa'),_0x277072,_0x2e80('0xb'));logger[_0x2e80('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x277072,'request\x20sent',JSON[_0x2e80('0xd')](_0x4bd762));if(_0x4bd762[_0x2e80('0xe')]){if(_0x4bd762[_0x2e80('0xe')][_0x2e80('0xf')]===0x1f4){logger[_0x2e80('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x277072,_0x4bd762[_0x2e80('0xe')][_0x2e80('0x10')]);return _0x402768(_0x4bd762[_0x2e80('0xe')][_0x2e80('0x10')]);}logger[_0x2e80('0xe')](_0x2e80('0xa'),_0x277072,_0x4bd762['error'][_0x2e80('0x10')]);return _0x54ea09(_0x4bd762['error']['message']);}else{logger[_0x2e80('0x9')](_0x2e80('0xa'),_0x277072,_0x2e80('0xb'));_0x54ea09(_0x4bd762[_0x2e80('0x11')][_0x2e80('0x10')]);}})['catch'](function(_0x4ac39c){logger[_0x2e80('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x277072,_0x4ac39c);_0x402768(_0x4ac39c);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 42e2389..483f338 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 _0x5889=['../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','multer','connect-timeout','express','../../components/auth/service'];(function(_0x310990,_0x245984){var _0x648534=function(_0xd320e5){while(--_0xd320e5){_0x310990['push'](_0x310990['shift']());}};_0x648534(++_0x245984);}(_0x5889,0x1e2));var _0x9588=function(_0x3714ae,_0x2b7ddd){_0x3714ae=_0x3714ae-0x0;var _0x23aa06=_0x5889[_0x3714ae];return _0x23aa06;};'use strict';var multer=require(_0x9588('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9588('0x1'));var express=require(_0x9588('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9588('0x3'));var interaction=require(_0x9588('0x4'));var config=require(_0x9588('0x5'));var controller=require(_0x9588('0x6'));router[_0x9588('0x7')]('/',auth[_0x9588('0x8')](),controller[_0x9588('0x9')]);router['get'](_0x9588('0xa'),auth[_0x9588('0x8')](),controller[_0x9588('0xb')]);router[_0x9588('0x7')](_0x9588('0xc'),auth[_0x9588('0x8')](),controller[_0x9588('0xd')]);router[_0x9588('0xe')]('/',auth[_0x9588('0x8')](),controller[_0x9588('0xf')]);router['put'](_0x9588('0xc'),auth['isAuthenticated'](),controller[_0x9588('0x10')]);router[_0x9588('0x11')](_0x9588('0xc'),auth[_0x9588('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x99ec=['../../config/environment','./chatTransferReport.controller','isAuthenticated','index','/describe','describe','get','/:id','post','create','put','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x557b4a,_0x5c3929){var _0x59fa97=function(_0x24694f){while(--_0x24694f){_0x557b4a['push'](_0x557b4a['shift']());}};_0x59fa97(++_0x5c3929);}(_0x99ec,0x176));var _0xc99e=function(_0xb984a7,_0x564ef9){_0xb984a7=_0xb984a7-0x0;var _0x247044=_0x99ec[_0xb984a7];return _0x247044;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc99e('0x0'));var express=require(_0xc99e('0x1'));var router=express[_0xc99e('0x2')]();var fs_extra=require(_0xc99e('0x3'));var auth=require(_0xc99e('0x4'));var interaction=require(_0xc99e('0x5'));var config=require(_0xc99e('0x6'));var controller=require(_0xc99e('0x7'));router['get']('/',auth[_0xc99e('0x8')](),controller[_0xc99e('0x9')]);router['get'](_0xc99e('0xa'),auth[_0xc99e('0x8')](),controller[_0xc99e('0xb')]);router[_0xc99e('0xc')](_0xc99e('0xd'),auth[_0xc99e('0x8')](),controller['show']);router[_0xc99e('0xe')]('/',auth[_0xc99e('0x8')](),controller[_0xc99e('0xf')]);router[_0xc99e('0x10')](_0xc99e('0xd'),auth[_0xc99e('0x8')](),controller['update']);router[_0xc99e('0x11')](_0xc99e('0xd'),auth[_0xc99e('0x8')](),controller[_0xc99e('0x12')]);module[_0xc99e('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index a140f5a..62ce960 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 _0xdfea=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','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','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','INTEGER','stringify','input','name','getDataValue','onlineForm','setDataValue','textarea','offlineForm','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','Your\x20request\x20has\x20not\x20been\x20processed.'];(function(_0x4efc87,_0x17a7d1){var _0x191fc4=function(_0x19dda1){while(--_0x19dda1){_0x4efc87['push'](_0x4efc87['shift']());}};_0x191fc4(++_0x17a7d1);}(_0xdfea,0x12f));var _0xadfe=function(_0x38a1b6,_0x652988){_0x38a1b6=_0x38a1b6-0x0;var _0xfbd3d2=_0xdfea[_0x38a1b6];return _0xfbd3d2;};'use strict';var Sequelize=require(_0xadfe('0x0'));var rs=require(_0xadfe('0x1'));module[_0xadfe('0x2')]={'name':{'type':Sequelize[_0xadfe('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xadfe('0x4')},'description':{'type':Sequelize[_0xadfe('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xadfe('0x5')},'mapKeyOffline':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xadfe('0x6')},'customerAlias':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xadfe('0x3')],'allowNull':![],'defaultValue':_0xadfe('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xadfe('0x3')],'allowNull':![],'defaultValue':_0xadfe('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xadfe('0x3')]},'animation':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xadfe('0xa')](_0xadfe('0xb'),_0xadfe('0xc')),'defaultValue':_0xadfe('0xb')},'header_online':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0xd')},'start_chat_button':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xadfe('0xe')},'header_offline':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0xf')},'download_transcript':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xadfe('0x11')]},'closingQuestion':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x14')},'noteTitle':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x15')},'placeholderMessage':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x16')},'closingMessage':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x17')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x18')},'conditionAgreement':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xadfe('0xa')](_0xadfe('0x19'),_0xadfe('0x1a')),'defaultValue':_0xadfe('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xadfe('0x1b')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xadfe('0x11')],'defaultValue':function(){return JSON[_0xadfe('0x1c')]({'items':[{'type':_0xadfe('0x1d'),'variable':null,'config':{'placeholder':_0xadfe('0x1e'),'type':'text','required':!![]},'props':{'title':_0xadfe('0x1e'),'helpText':''}},{'type':_0xadfe('0x1d'),'props':{'title':_0xadfe('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xadfe('0x5'),'type':_0xadfe('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xadfe('0x1f')](_0xadfe('0x20'))?JSON['parse'](this['getDataValue'](_0xadfe('0x20'))):{};},'set':function(_0x3996e6){return this[_0xadfe('0x21')](_0xadfe('0x20'),JSON[_0xadfe('0x1c')](_0x3996e6));}},'offlineForm':{'type':Sequelize[_0xadfe('0x11')],'defaultValue':function(){return JSON[_0xadfe('0x1c')]({'items':[{'type':_0xadfe('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xadfe('0x5'),'type':_0xadfe('0x5')},'variable':null},{'type':_0xadfe('0x22'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xadfe('0x1f')](_0xadfe('0x23'))?JSON['parse'](this[_0xadfe('0x1f')](_0xadfe('0x23'))):{};},'set':function(_0x162aec){return this[_0xadfe('0x21')]('offlineForm',JSON[_0xadfe('0x1c')](_0x162aec));}},'token':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xadfe('0x3')]},'forwardOffline':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xadfe('0x3')]},'waitingTitle':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x24')},'waitingMessage':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x26')},'offlineMessageBody':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x27')},'skipUnmanaged':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x18')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xadfe('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xadfe('0x11')]},'showAgentAvatar':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xadfe('0x28');}},'notificationSound':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xadfe('0x1b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xadfe('0x1b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x2a')},'messagesAlignment':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x2b')},'defaultTitle':{'type':Sequelize[_0xadfe('0x3')]},'customerAvatar':{'type':Sequelize[_0xadfe('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xadfe('0x3')],'allowNull':![],'defaultValue':_0xadfe('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xadfe('0x1b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x2d')},'systemAvatar':{'type':Sequelize[_0xadfe('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xadfe('0x1b')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![],'comment':_0xadfe('0x2e'),'set':function(_0x339465){if(!_0x339465)this[_0xadfe('0x21')]('mandatoryDispositionPauseId',null);this[_0xadfe('0x21')]('mandatoryDisposition',_0x339465);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xadfe('0x3')],'allowNull':![],'defaultValue':_0xadfe('0x2f')},'vidaooNote':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':function(){return _0xadfe('0x30');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xadfe('0x11')]}};
\ No newline at end of file
+var _0x0b8b=['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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','CHAT','alternate','#fafafa','System','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','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b8b,0x116));var _0xb0b8=function(_0x498bdd,_0x470eeb){_0x498bdd=_0x498bdd-0x0;var _0x392cb7=_0x0b8b[_0x498bdd];return _0x392cb7;};'use strict';var Sequelize=require(_0xb0b8('0x0'));var rs=require(_0xb0b8('0x1'));module[_0xb0b8('0x2')]={'name':{'type':Sequelize[_0xb0b8('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xb0b8('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0x4')},'mapKeyOffline':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0x4')},'key':{'type':Sequelize[_0xb0b8('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb0b8('0x3')],'allowNull':![],'defaultValue':_0xb0b8('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb0b8('0x3')],'allowNull':![],'defaultValue':_0xb0b8('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb0b8('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xb0b8('0x3')],'allowNull':![],'defaultValue':_0xb0b8('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb0b8('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb0b8('0x3')]},'animation':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb0b8('0x9')](_0xb0b8('0xa'),_0xb0b8('0xb')),'defaultValue':_0xb0b8('0xa')},'header_online':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0xc')},'start_chat_button':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0xd')},'offline_chat_button':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0xe')},'header_offline':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb0b8('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb0b8('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb0b8('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb0b8('0x13')},'closingMessageButton':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0x14')},'conditionAgreement':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0x15')},'ratingType':{'type':Sequelize[_0xb0b8('0x9')](_0xb0b8('0x16'),_0xb0b8('0x17')),'defaultValue':_0xb0b8('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb0b8('0x11')],'defaultValue':function(){return JSON[_0xb0b8('0x18')]({'items':[{'type':_0xb0b8('0x19'),'variable':null,'config':{'placeholder':_0xb0b8('0x1a'),'type':'text','required':!![]},'props':{'title':_0xb0b8('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0xb0b8('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb0b8('0x4'),'type':_0xb0b8('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xb0b8('0x1b'))?JSON['parse'](this['getDataValue'](_0xb0b8('0x1b'))):{};},'set':function(_0x549c23){return this[_0xb0b8('0x1c')](_0xb0b8('0x1b'),JSON[_0xb0b8('0x18')](_0x549c23));}},'offlineForm':{'type':Sequelize[_0xb0b8('0x11')],'defaultValue':function(){return JSON[_0xb0b8('0x18')]({'items':[{'type':'input','props':{'title':_0xb0b8('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb0b8('0x4'),'type':_0xb0b8('0x4')},'variable':null},{'type':_0xb0b8('0x1d'),'config':{'placeholder':_0xb0b8('0x1e')},'props':{'title':_0xb0b8('0x1e'),'helpText':_0xb0b8('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0xb0b8('0x20')](_0xb0b8('0x21'))?JSON[_0xb0b8('0x22')](this[_0xb0b8('0x20')]('offlineForm')):{};},'set':function(_0x495bf3){return this[_0xb0b8('0x1c')](_0xb0b8('0x21'),JSON[_0xb0b8('0x18')](_0x495bf3));}},'token':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':function(){return rs[_0xb0b8('0x23')]();}},'autoclose':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb0b8('0x3')]},'forwardOffline':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb0b8('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb0b8('0x27')},'skipUnmanaged':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0x14')},'sendUnmanaged':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb0b8('0x11')]},'showAgentAvatar':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb0b8('0x3')]},'notificationTemplate':{'type':Sequelize[_0xb0b8('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xb0b8('0x28')},'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[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0x29')},'verticalAlignment':{'type':Sequelize[_0xb0b8('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0x2a')},'messagesAlignment':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0x2b')},'defaultTitle':{'type':Sequelize[_0xb0b8('0x3')]},'customerAvatar':{'type':Sequelize[_0xb0b8('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb0b8('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb0b8('0x3')],'allowNull':![],'defaultValue':_0xb0b8('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb0b8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb0b8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb0b8('0x3')],'defaultValue':_0xb0b8('0x2d')},'systemAvatar':{'type':Sequelize[_0xb0b8('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb0b8('0x7')],'comment':_0xb0b8('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':![],'comment':_0xb0b8('0x2f'),'set':function(_0x3d94b8){if(!_0x3d94b8)this[_0xb0b8('0x1c')](_0xb0b8('0x30'),null);this[_0xb0b8('0x1c')](_0xb0b8('0x31'),_0x3d94b8);}},'vidaooEscalation':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb0b8('0x3')]},'vidaooTopic':{'type':Sequelize[_0xb0b8('0x3')],'allowNull':![],'defaultValue':_0xb0b8('0x32')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xb0b8('0x33');}},'vidaooMetadata':{'type':Sequelize[_0xb0b8('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb0b8('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb0b8('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 6b95dd2..df55292 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 _0x5ca6=['created','autoclose','close','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','difference','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','email','MailAccountId','subjectOffline','offlineMessageSubject','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tags','tag','getProactiveActions','getLicense','virtual','increment','utf8','URL','3.5.0','remote','x-real-ip','remoteAddress','referer','replace','alignment','labelText','textColor','textButtonColor','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','ChatProactiveAction','false','offlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash','querystring','html-to-text','url','../../components/parsers/qs','api','../../config/environment','../../errors/api','APIOutOfIntervalError','APINotFoundError','../../mysqldb','redis','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','limit','count','Content-Range','update','destroy','get','ChatWebsites','sendStatus','stack','name','timezone','interval','true','ONLINE','OFFLINE','No\x20timezone','map','Intervals','some','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','split','lastName','browser','version','format','unknown','%s\x20%s','model','device','vendor','Pause','rawAttributes','fieldName','query','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','ChatWebsite','include','findAll','rows','params','mandatoryDispositionPause','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','ChatWebsiteId','Disposition','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','addLogo','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','custom','isNil','existsSync','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','ValidationError','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','ChatApplication','Applications','Interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','priority','asc','defaults','ListId','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','contact','firstName','messageId'];(function(_0x2ac4af,_0x288c53){var _0x3a36df=function(_0x271b11){while(--_0x271b11){_0x2ac4af['push'](_0x2ac4af['shift']());}};_0x3a36df(++_0x288c53);}(_0x5ca6,0x181));var _0x65ca=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x5ca6[_0x5d6e30];return _0x3d3f3b;};'use strict';var Mustache=require(_0x65ca('0x0'));var util=require('util');var path=require(_0x65ca('0x1'));var ejs=require(_0x65ca('0x2'));var fs=require('fs');var fs_extra=require(_0x65ca('0x3'));var _=require(_0x65ca('0x4'));var querystring=require(_0x65ca('0x5'));var htmlToText=require(_0x65ca('0x6'));var Redis=require('ioredis');var jayson=require('jayson/promise');var url=require(_0x65ca('0x7'));var qs=require(_0x65ca('0x8'));var logger=require('../../config/logger')(_0x65ca('0x9'));var config=require(_0x65ca('0xa'));var APIOutOfIntervalError=require(_0x65ca('0xb'))[_0x65ca('0xc')];var APINotFoundError=require(_0x65ca('0xb'))[_0x65ca('0xd')];var APIHandleError=require('../../errors/api')['handleError'];var db=require(_0x65ca('0xe'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65ca('0xf')]));require('./chatWebsite.socket')[_0x65ca('0x10')](socket);var client=jayson[_0x65ca('0x11')][_0x65ca('0x12')]({'port':0x232c});var client9002=jayson[_0x65ca('0x11')]['http']({'port':0x232a});var client9003=jayson[_0x65ca('0x11')][_0x65ca('0x12')]({'port':0x232b});var client9001=jayson[_0x65ca('0x11')][_0x65ca('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x782230,_0x189a32,_0x18adc0,_0x6c7a94){return new Promise(function(_0x89ed0f,_0x2cc491){var _0x5d6e20=_0x6c7a94||client;return _0x5d6e20[_0x65ca('0x13')](_0x782230,_0x18adc0)[_0x65ca('0x14')](function(_0x2708c7){logger[_0x65ca('0x15')](_0x65ca('0x16'),_0x189a32,_0x65ca('0x17'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x189a32,'request\x20sent',JSON[_0x65ca('0x18')](_0x2708c7));if(_0x2708c7[_0x65ca('0x19')]){if(_0x2708c7['error'][_0x65ca('0x1a')]===0x1f4){logger[_0x65ca('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x189a32,_0x2708c7[_0x65ca('0x19')][_0x65ca('0x1b')]);return _0x2cc491(_0x2708c7[_0x65ca('0x19')][_0x65ca('0x1b')]);}logger[_0x65ca('0x19')](_0x65ca('0x16'),_0x189a32,_0x2708c7['error'][_0x65ca('0x1b')]);return _0x89ed0f(_0x2708c7[_0x65ca('0x19')][_0x65ca('0x1b')]);}else{logger[_0x65ca('0x15')](_0x65ca('0x16'),_0x189a32,_0x65ca('0x17'));_0x89ed0f(_0x2708c7[_0x65ca('0x1c')][_0x65ca('0x1b')]);}})[_0x65ca('0x1d')](function(_0x333a4f){logger['error'](_0x65ca('0x16'),_0x189a32,_0x333a4f);_0x2cc491(_0x333a4f);});});}function respondWithStatusCode(_0x4fe67f,_0x3a99c9){_0x3a99c9=_0x3a99c9||0xcc;return function(_0x4e389c){if(_0x4e389c){return _0x4fe67f['sendStatus'](_0x3a99c9);}return _0x4fe67f[_0x65ca('0x1e')](_0x3a99c9)[_0x65ca('0x1f')]();};}function respondWithResult(_0x295015,_0x4be997){_0x4be997=_0x4be997||0xc8;return function(_0x19d189){if(_0x19d189){return _0x295015['status'](_0x4be997)[_0x65ca('0x20')](_0x19d189);}};}function respondWithFilteredResult(_0x539045,_0x21dc45){return function(_0x2156c0){if(_0x2156c0){var _0x1cb000=typeof _0x21dc45[_0x65ca('0x21')]==='undefined'&&typeof _0x21dc45[_0x65ca('0x22')]==='undefined';var _0x197f47=_0x2156c0['count'];var _0xb2726c=_0x1cb000?0x0:_0x21dc45[_0x65ca('0x21')];var _0x43a25b=_0x1cb000?_0x2156c0[_0x65ca('0x23')]:_0x21dc45[_0x65ca('0x21')]+_0x21dc45[_0x65ca('0x22')];var _0x1de895;if(_0x43a25b>=_0x197f47){_0x43a25b=_0x197f47;_0x1de895=0xc8;}else{_0x1de895=0xce;}_0x539045['status'](_0x1de895);return _0x539045['set'](_0x65ca('0x24'),_0xb2726c+'-'+_0x43a25b+'/'+_0x197f47)['json'](_0x2156c0);}return null;};}function saveUpdates(_0x51dba2){return function(_0x53b815){if(_0x53b815){return _0x53b815[_0x65ca('0x25')](_0x51dba2)[_0x65ca('0x14')](function(_0x4ab7dc){return _0x4ab7dc;});}return null;};}function removeEntity(_0x387910){return function(_0x14ad15){if(_0x14ad15){return _0x14ad15[_0x65ca('0x26')]()[_0x65ca('0x14')](function(){var _0xc74c7c=_0x14ad15[_0x65ca('0x27')]({'plain':!![]});var _0x3f3fd8=_0x65ca('0x28');return db['UserProfileResource'][_0x65ca('0x26')]({'where':{'type':_0x3f3fd8,'resourceId':_0xc74c7c['id']}})['then'](function(){return _0x14ad15;});})[_0x65ca('0x14')](function(){_0x387910['status'](0xcc)[_0x65ca('0x1f')]();});}};}function handleEntityNotFound(_0x1dd335){return function(_0x34374a){if(!_0x34374a){_0x1dd335[_0x65ca('0x29')](0x194);}return _0x34374a;};}function handleError(_0xbf92b5,_0x12fe28){_0x12fe28=_0x12fe28||0x1f4;return function(_0x50dcb7){logger[_0x65ca('0x19')](_0x50dcb7[_0x65ca('0x2a')]);if(_0x50dcb7[_0x65ca('0x2b')]){delete _0x50dcb7[_0x65ca('0x2b')];}_0xbf92b5['status'](_0x12fe28)['send'](_0x50dcb7);};}function iftimePromise(_0x1a912a,_0x46b66f){return respondWithRpcPromise('Command','getSnippet',{'command':_0x46b66f[_0x65ca('0x2c')]?util['format']('iftime\x20%s,%s',_0x1a912a[_0x65ca('0x2d')],_0x46b66f[_0x65ca('0x2c')]):util['format']('iftime\x20%s',_0x1a912a['interval'])},client9002)[_0x65ca('0x14')](function(_0x18040e){var _0x4f2ba6=_0x18040e&&_0x18040e['indexOf'](_0x65ca('0x2e'))>=0x0?!![]:![];logger[_0x65ca('0x15')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x46b66f['id'],_0x1a912a['id'],_0x1a912a[_0x65ca('0x2d')],_0x4f2ba6?_0x65ca('0x2f'):_0x65ca('0x30'),_0x46b66f['timezone']?_0x46b66f[_0x65ca('0x2c')]:'No\x20timezone');return _0x4f2ba6;})[_0x65ca('0x1d')](function(_0x56b303){logger[_0x65ca('0x19')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x46b66f['id'],_0x1a912a['id'],_0x1a912a[_0x65ca('0x2d')],util['inspect'](_0x56b303,{'showHidden':![],'depth':null}),_0x46b66f[_0x65ca('0x2c')]?_0x46b66f['timezone']:_0x65ca('0x31'));return![];});}function checkWebsiteIntervals(_0x1ee098){var _0x51bba3=_[_0x65ca('0x32')](_0x1ee098['Interval'][_0x65ca('0x33')],function(_0x44a80f){var _0xfa72c3=_0x44a80f[_0x65ca('0x27')]({'plain':!![]});return iftimePromise(_0xfa72c3,_0x1ee098);});return Promise['all'](_0x51bba3)[_0x65ca('0x14')](function(_0xbca68d){return _[_0x65ca('0x34')](_0xbca68d);});}function createInteractionObject(_0x877020,_0x21a900,_0x4627c9,_0x481699){var _0x1a559e=require(_0x65ca('0x35'));var _0x28aa66=new _0x1a559e();var _0x31b83a=_0x28aa66['setUA'](_0x4627c9[_0x65ca('0x36')])[_0x65ca('0x37')]();var _0x5ea32d=_0x21a900[_0x65ca('0x38')];if(_0x4627c9[_0x65ca('0x39')]){_0x5ea32d=_0x4627c9[_0x65ca('0x39')];}else if(_0x4627c9[_0x65ca('0x3a')]){_0x5ea32d=_['first'](_0x4627c9[_0x65ca('0x3a')][_0x65ca('0x3b')](','));}return{'ContactId':_0x481699['id'],'ChatWebsiteId':_0x877020,'from':(_0x481699['firstName']||'')+'\x20'+(_0x481699[_0x65ca('0x3c')]||''),'customerIp':_0x5ea32d,'customerPort':_0x4627c9['x-real-port']?_0x4627c9['x-real-port']:null,'referer':_0x21a900['referer'],'browserName':_0x31b83a['browser'][_0x65ca('0x2b')]&&_0x31b83a[_0x65ca('0x3d')][_0x65ca('0x3e')]?util[_0x65ca('0x3f')]('%s\x20%s',_0x31b83a[_0x65ca('0x3d')][_0x65ca('0x2b')],_0x31b83a[_0x65ca('0x3d')][_0x65ca('0x3e')]):_0x65ca('0x40'),'browserVersion':_0x31b83a[_0x65ca('0x3d')][_0x65ca('0x3e')]||'unknown','osName':util['format'](_0x65ca('0x41'),_0x31b83a['os'][_0x65ca('0x2b')],_0x31b83a['os']['version']),'osVersion':_0x31b83a['os'][_0x65ca('0x3e')],'deviceModel':_0x31b83a['device'][_0x65ca('0x42')]&&_0x31b83a[_0x65ca('0x43')][_0x65ca('0x44')]?util[_0x65ca('0x3f')]('%s\x20%s\x20%s',_0x31b83a[_0x65ca('0x43')]['model'],_0x31b83a[_0x65ca('0x43')][_0x65ca('0x44')],_0x31b83a['device']['type']):null,'deviceVendor':_0x31b83a[_0x65ca('0x43')][_0x65ca('0x44')],'deviceType':_0x31b83a[_0x65ca('0x43')]['type'],'formData':JSON['stringify'](_0x21a900)};}exports['index']=function(_0x6969de,_0x45456d){var _0x5e555f={'include':[{'model':db[_0x65ca('0x45')],'as':'mandatoryDispositionPause'}]},_0x3e1b77={},_0x509037={'count':0x0,'rows':[]};var _0x271289=_[_0x65ca('0x32')](db['ChatWebsite'][_0x65ca('0x46')],function(_0x53c33c){return{'name':_0x53c33c[_0x65ca('0x47')],'type':_0x53c33c['type']['key']};});_0x3e1b77['model']=_[_0x65ca('0x32')](_0x271289,_0x65ca('0x2b'));_0x3e1b77[_0x65ca('0x48')]=_['keys'](_0x6969de[_0x65ca('0x48')]);_0x3e1b77[_0x65ca('0x49')]=_[_0x65ca('0x4a')](_0x3e1b77[_0x65ca('0x42')],_0x3e1b77[_0x65ca('0x48')]);_0x5e555f['attributes']=_[_0x65ca('0x4a')](_0x3e1b77['model'],qs['fields'](_0x6969de[_0x65ca('0x48')][_0x65ca('0x4b')]));_0x5e555f[_0x65ca('0x4c')]=_0x5e555f[_0x65ca('0x4c')][_0x65ca('0x4d')]?_0x5e555f[_0x65ca('0x4c')]:_0x3e1b77[_0x65ca('0x42')];if(!_0x6969de[_0x65ca('0x48')]['hasOwnProperty'](_0x65ca('0x4e'))){_0x5e555f[_0x65ca('0x22')]=qs[_0x65ca('0x22')](_0x6969de[_0x65ca('0x48')][_0x65ca('0x22')]);_0x5e555f['offset']=qs[_0x65ca('0x21')](_0x6969de[_0x65ca('0x48')]['offset']);}_0x5e555f['order']=qs['sort'](_0x6969de['query'][_0x65ca('0x4f')]);_0x5e555f['where']=qs['filters'](_[_0x65ca('0x50')](_0x6969de[_0x65ca('0x48')],_0x3e1b77[_0x65ca('0x49')]),_0x271289);if(_0x6969de[_0x65ca('0x48')][_0x65ca('0x51')]){_0x5e555f[_0x65ca('0x52')]=_[_0x65ca('0x53')](_0x5e555f[_0x65ca('0x52')],{'$or':_[_0x65ca('0x32')](_0x271289,function(_0x4c3036){if(_0x4c3036['type']!==_0x65ca('0x54')){var _0x3d22e5={};_0x3d22e5[_0x4c3036[_0x65ca('0x2b')]]={'$like':'%'+_0x6969de[_0x65ca('0x48')][_0x65ca('0x51')]+'%'};return _0x3d22e5;}})});}_0x5e555f=_[_0x65ca('0x53')]({},_0x5e555f,_0x6969de[_0x65ca('0x55')]);var _0x4c05e9={'where':_0x5e555f[_0x65ca('0x52')]};return db[_0x65ca('0x56')][_0x65ca('0x23')](_0x4c05e9)[_0x65ca('0x14')](function(_0x45819a){_0x509037['count']=_0x45819a;if(_0x6969de[_0x65ca('0x48')]['includeAll']){_0x5e555f[_0x65ca('0x57')]=[{'all':!![]}];}return db[_0x65ca('0x56')][_0x65ca('0x58')](_0x5e555f);})[_0x65ca('0x14')](function(_0x133d78){_0x509037[_0x65ca('0x59')]=_0x133d78;return _0x509037;})['then'](respondWithFilteredResult(_0x45456d,_0x5e555f))['catch'](handleError(_0x45456d,null));};exports['show']=function(_0x55fee2,_0x2d1fb4){var _0x4db809={'raw':![],'where':{'id':_0x55fee2[_0x65ca('0x5a')]['id']},'include':[{'model':db[_0x65ca('0x45')],'as':_0x65ca('0x5b')}]},_0x1d7a0a={};_0x1d7a0a[_0x65ca('0x42')]=_['keys'](db[_0x65ca('0x56')][_0x65ca('0x46')]);_0x1d7a0a[_0x65ca('0x48')]=_[_0x65ca('0x5c')](_0x55fee2[_0x65ca('0x48')]);_0x1d7a0a[_0x65ca('0x49')]=_[_0x65ca('0x4a')](_0x1d7a0a[_0x65ca('0x42')],_0x1d7a0a[_0x65ca('0x48')]);_0x4db809['attributes']=_['intersection'](_0x1d7a0a[_0x65ca('0x42')],qs[_0x65ca('0x4b')](_0x55fee2['query']['fields']));_0x4db809[_0x65ca('0x4c')]=_0x4db809['attributes'][_0x65ca('0x4d')]?_0x4db809[_0x65ca('0x4c')]:_0x1d7a0a[_0x65ca('0x42')];if(_0x55fee2[_0x65ca('0x48')][_0x65ca('0x5d')]){_0x4db809['include']=[{'all':!![]}];}_0x4db809=_['merge']({},_0x4db809,_0x55fee2[_0x65ca('0x55')]);return db[_0x65ca('0x56')][_0x65ca('0x5e')](_0x4db809)[_0x65ca('0x14')](handleEntityNotFound(_0x2d1fb4,null))['then'](respondWithResult(_0x2d1fb4,null))[_0x65ca('0x1d')](handleError(_0x2d1fb4,null));};exports[_0x65ca('0x5f')]=function(_0x42b216,_0x5688d2){return db[_0x65ca('0x56')][_0x65ca('0x5f')](_0x42b216[_0x65ca('0x60')],{})[_0x65ca('0x14')](function(_0x14f91b){var _0x4c0932=_0x42b216[_0x65ca('0x61')][_0x65ca('0x27')]({'plain':!![]});if(!_0x4c0932)throw new Error(_0x65ca('0x62'));if(_0x4c0932['role']===_0x65ca('0x61')){var _0x2c6f73=_0x14f91b['get']({'plain':!![]});var _0x438ca5=_0x65ca('0x28');return db[_0x65ca('0x63')][_0x65ca('0x5e')]({'where':{'name':_0x438ca5,'userProfileId':_0x4c0932[_0x65ca('0x64')]},'raw':!![]})['then'](function(_0x5c31bf){if(_0x5c31bf&&_0x5c31bf[_0x65ca('0x65')]===0x0){return db[_0x65ca('0x66')]['create']({'name':_0x2c6f73[_0x65ca('0x2b')],'resourceId':_0x2c6f73['id'],'type':_0x5c31bf[_0x65ca('0x2b')],'sectionId':_0x5c31bf['id']},{})[_0x65ca('0x14')](function(){return _0x14f91b;});}else{return _0x14f91b;}})[_0x65ca('0x1d')](function(_0x7d769e){logger[_0x65ca('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7d769e);throw _0x7d769e;});}return _0x14f91b;})[_0x65ca('0x14')](respondWithResult(_0x5688d2,0xc9))['catch'](handleError(_0x5688d2,null));};exports[_0x65ca('0x25')]=function(_0x14dec6,_0xa323a2){if(_0x14dec6['body']['id']){delete _0x14dec6[_0x65ca('0x60')]['id'];}return db[_0x65ca('0x56')][_0x65ca('0x5e')]({'where':{'id':_0x14dec6[_0x65ca('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x65ca('0x5b')}]})[_0x65ca('0x14')](handleEntityNotFound(_0xa323a2,null))['then'](saveUpdates(_0x14dec6[_0x65ca('0x60')],null))['then'](respondWithResult(_0xa323a2,null))[_0x65ca('0x1d')](handleError(_0xa323a2,null));};exports['destroy']=function(_0x36c132,_0x25c39f){return db[_0x65ca('0x56')][_0x65ca('0x5e')]({'where':{'id':_0x36c132[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x25c39f,null))[_0x65ca('0x14')](removeEntity(_0x25c39f,null))['catch'](handleError(_0x25c39f,null));};exports['describe']=function(_0x5c4718,_0x49712f){return db['ChatWebsite'][_0x65ca('0x67')]()[_0x65ca('0x14')](respondWithResult(_0x49712f,null))[_0x65ca('0x1d')](handleError(_0x49712f,null));};exports[_0x65ca('0x68')]=function(_0x5cd4d1,_0x112ce4){if(_0x5cd4d1['body']['id']){delete _0x5cd4d1['body']['id'];}return db[_0x65ca('0x56')][_0x65ca('0x5e')]({'where':{'id':_0x5cd4d1[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x112ce4,null))[_0x65ca('0x14')](function(_0x8716fd){if(_0x8716fd){_0x5cd4d1[_0x65ca('0x60')][_0x65ca('0x69')]=_0x8716fd['id'];return db[_0x65ca('0x6a')][_0x65ca('0x5f')](_0x5cd4d1['body']);}})[_0x65ca('0x14')](respondWithResult(_0x112ce4,null))['catch'](handleError(_0x112ce4,null));};exports['getDispositions']=function(_0x45e31a,_0x38c5a3){var _0x219b9a={'raw':![],'where':{}};var _0x3ffc24={};var _0x52abc2={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x65ca('0x6b')]({'where':{'id':_0x45e31a[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x38c5a3,null))['then'](function(_0x19ff90){if(_0x19ff90){_0x3ffc24[_0x65ca('0x42')]=_[_0x65ca('0x5c')](db[_0x65ca('0x6a')][_0x65ca('0x46')]);_0x3ffc24[_0x65ca('0x48')]=_[_0x65ca('0x5c')](_0x45e31a['query']);_0x3ffc24[_0x65ca('0x49')]=_[_0x65ca('0x4a')](_0x3ffc24[_0x65ca('0x42')],_0x3ffc24[_0x65ca('0x48')]);_0x219b9a[_0x65ca('0x4c')]=_[_0x65ca('0x4a')](_0x3ffc24[_0x65ca('0x42')],qs[_0x65ca('0x4b')](_0x45e31a[_0x65ca('0x48')][_0x65ca('0x4b')]));_0x219b9a['attributes']=_0x219b9a['attributes'][_0x65ca('0x4d')]?_0x219b9a[_0x65ca('0x4c')]:_0x3ffc24[_0x65ca('0x42')];if(!_0x45e31a[_0x65ca('0x48')][_0x65ca('0x6c')](_0x65ca('0x4e'))){_0x219b9a[_0x65ca('0x22')]=qs[_0x65ca('0x22')](_0x45e31a['query'][_0x65ca('0x22')]);_0x219b9a[_0x65ca('0x21')]=qs[_0x65ca('0x21')](_0x45e31a[_0x65ca('0x48')][_0x65ca('0x21')]);}_0x219b9a['order']=qs[_0x65ca('0x4f')](_0x45e31a[_0x65ca('0x48')][_0x65ca('0x4f')]);_0x219b9a[_0x65ca('0x52')]=qs['filters'](_[_0x65ca('0x50')](_0x45e31a[_0x65ca('0x48')],_0x3ffc24[_0x65ca('0x49')]));_0x219b9a['where'][_0x65ca('0x69')]=_0x19ff90['id'];if(_0x45e31a[_0x65ca('0x48')][_0x65ca('0x51')]){_0x219b9a[_0x65ca('0x52')]=_[_0x65ca('0x53')](_0x219b9a[_0x65ca('0x52')],{'$or':_[_0x65ca('0x32')](_0x219b9a['attributes'],function(_0xcfaf1d){var _0x9d63cd={};_0x9d63cd[_0xcfaf1d]={'$like':'%'+_0x45e31a[_0x65ca('0x48')]['filter']+'%'};return _0x9d63cd;})});}_0x219b9a=_[_0x65ca('0x53')]({},_0x219b9a,_0x45e31a[_0x65ca('0x55')]);return db['Disposition'][_0x65ca('0x23')]({'where':_0x219b9a[_0x65ca('0x52')]})[_0x65ca('0x14')](function(_0x153ae8){_0x52abc2[_0x65ca('0x23')]=_0x153ae8;if(_0x45e31a[_0x65ca('0x48')][_0x65ca('0x5d')]){_0x219b9a[_0x65ca('0x57')]=[{'all':!![]}];}return db[_0x65ca('0x6a')]['findAll'](_0x219b9a);})['then'](function(_0x56feaf){_0x52abc2['rows']=_0x56feaf;return _0x52abc2;});}})['then'](respondWithFilteredResult(_0x38c5a3,_0x219b9a))[_0x65ca('0x1d')](handleError(_0x38c5a3,null));};exports['removeDispositions']=function(_0x977f32,_0x5e25de){return db[_0x65ca('0x56')]['find']({'where':{'id':_0x977f32[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x5e25de,null))[_0x65ca('0x14')](function(_0x1a577a){if(_0x1a577a){return _0x1a577a[_0x65ca('0x6d')](_0x977f32['query'][_0x65ca('0x6e')]);}})[_0x65ca('0x14')](respondWithStatusCode(_0x5e25de,null))['catch'](handleError(_0x5e25de,null));};exports[_0x65ca('0x6f')]=function(_0x22fab6,_0x4826d3){if(_0x22fab6[_0x65ca('0x60')]['id']){delete _0x22fab6[_0x65ca('0x60')]['id'];}return db['ChatWebsite'][_0x65ca('0x5e')]({'where':{'id':_0x22fab6[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x4826d3,null))[_0x65ca('0x14')](function(_0x930e51){if(_0x930e51){_0x22fab6[_0x65ca('0x60')][_0x65ca('0x69')]=_0x930e51['id'];return db[_0x65ca('0x70')]['create'](_0x22fab6[_0x65ca('0x60')]);}})['then'](respondWithResult(_0x4826d3,null))['catch'](handleError(_0x4826d3,null));};exports[_0x65ca('0x71')]=function(_0x540e2c,_0x545514){var _0x51fcae={'raw':![],'where':{}};var _0x222f4f={};var _0xea3cd2={'count':0x0,'rows':[]};return db[_0x65ca('0x56')][_0x65ca('0x6b')]({'where':{'id':_0x540e2c[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x545514,null))[_0x65ca('0x14')](function(_0x5d52e6){if(_0x5d52e6){_0x222f4f[_0x65ca('0x42')]=_['keys'](db['CannedAnswer'][_0x65ca('0x46')]);_0x222f4f[_0x65ca('0x48')]=_[_0x65ca('0x5c')](_0x540e2c[_0x65ca('0x48')]);_0x222f4f[_0x65ca('0x49')]=_[_0x65ca('0x4a')](_0x222f4f['model'],_0x222f4f[_0x65ca('0x48')]);_0x51fcae['attributes']=_[_0x65ca('0x4a')](_0x222f4f[_0x65ca('0x42')],qs[_0x65ca('0x4b')](_0x540e2c['query'][_0x65ca('0x4b')]));_0x51fcae[_0x65ca('0x4c')]=_0x51fcae[_0x65ca('0x4c')][_0x65ca('0x4d')]?_0x51fcae[_0x65ca('0x4c')]:_0x222f4f[_0x65ca('0x42')];if(!_0x540e2c[_0x65ca('0x48')][_0x65ca('0x6c')]('nolimit')){_0x51fcae[_0x65ca('0x22')]=qs[_0x65ca('0x22')](_0x540e2c[_0x65ca('0x48')][_0x65ca('0x22')]);_0x51fcae['offset']=qs['offset'](_0x540e2c['query'][_0x65ca('0x21')]);}_0x51fcae[_0x65ca('0x72')]=qs[_0x65ca('0x4f')](_0x540e2c[_0x65ca('0x48')][_0x65ca('0x4f')]);_0x51fcae[_0x65ca('0x52')]=qs['filters'](_[_0x65ca('0x50')](_0x540e2c[_0x65ca('0x48')],_0x222f4f['filters']));_0x51fcae[_0x65ca('0x52')][_0x65ca('0x69')]=_0x5d52e6['id'];if(_0x540e2c[_0x65ca('0x48')][_0x65ca('0x51')]){_0x51fcae[_0x65ca('0x52')]=_[_0x65ca('0x53')](_0x51fcae['where'],{'$or':_['map'](_0x51fcae[_0x65ca('0x4c')],function(_0x3054ab){var _0x3ba20b={};_0x3ba20b[_0x3054ab]={'$like':'%'+_0x540e2c[_0x65ca('0x48')][_0x65ca('0x51')]+'%'};return _0x3ba20b;})});}_0x51fcae=_['merge']({},_0x51fcae,_0x540e2c[_0x65ca('0x55')]);return db[_0x65ca('0x70')]['count']({'where':_0x51fcae[_0x65ca('0x52')]})[_0x65ca('0x14')](function(_0x20f5ba){_0xea3cd2[_0x65ca('0x23')]=_0x20f5ba;if(_0x540e2c[_0x65ca('0x48')][_0x65ca('0x5d')]){_0x51fcae[_0x65ca('0x57')]=[{'all':!![]}];}return db[_0x65ca('0x70')]['findAll'](_0x51fcae);})[_0x65ca('0x14')](function(_0x3c9dce){_0xea3cd2[_0x65ca('0x59')]=_0x3c9dce;return _0xea3cd2;});}})[_0x65ca('0x14')](respondWithFilteredResult(_0x545514,_0x51fcae))[_0x65ca('0x1d')](handleError(_0x545514,null));};exports[_0x65ca('0x73')]=function(_0x314217,_0x24c2e9){return db[_0x65ca('0x56')]['find']({'where':{'id':_0x314217[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x24c2e9,null))['then'](function(_0x5a74c8){if(_0x5a74c8){return _0x5a74c8[_0x65ca('0x73')](_0x314217[_0x65ca('0x48')]['ids']);}})[_0x65ca('0x14')](respondWithStatusCode(_0x24c2e9,null))[_0x65ca('0x1d')](handleError(_0x24c2e9,null));};exports[_0x65ca('0x74')]=function(_0x27a9d7,_0x1ddc42){_0x27a9d7[_0x65ca('0x60')]['sitepic']=_0x27a9d7['file'][_0x65ca('0x75')];return db[_0x65ca('0x56')][_0x65ca('0x5e')]({'where':{'id':_0x27a9d7[_0x65ca('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1ddc42,null))[_0x65ca('0x14')](saveUpdates(_0x27a9d7[_0x65ca('0x60')],null))['then'](respondWithResult(_0x1ddc42,null))[_0x65ca('0x1d')](handleError(_0x1ddc42,null));};exports[_0x65ca('0x76')]=function(_0x5cb5d3,_0x4b56c0){_0x5cb5d3[_0x65ca('0x60')][_0x65ca('0x77')]=_0x5cb5d3[_0x65ca('0x78')][_0x65ca('0x75')];return db[_0x65ca('0x56')][_0x65ca('0x5e')]({'where':{'id':_0x5cb5d3[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x4b56c0,null))['then'](saveUpdates(_0x5cb5d3[_0x65ca('0x60')],null))[_0x65ca('0x14')](respondWithResult(_0x4b56c0,null))['catch'](handleError(_0x4b56c0,null));};exports[_0x65ca('0x79')]=function(_0x24627c,_0x1809e0){_0x24627c['body'][_0x65ca('0x7a')]=_0x24627c['file'][_0x65ca('0x75')];return db['ChatWebsite']['find']({'where':{'id':_0x24627c[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x1809e0,null))[_0x65ca('0x14')](saveUpdates(_0x24627c[_0x65ca('0x60')],null))['then'](respondWithResult(_0x1809e0,null))['catch'](handleError(_0x1809e0,null));};exports['addSystemAvatar']=function(_0xf649fd,_0x5e474f){_0xf649fd[_0x65ca('0x60')]['systemAvatar']=_0xf649fd[_0x65ca('0x78')][_0x65ca('0x75')];return db[_0x65ca('0x56')][_0x65ca('0x5e')]({'where':{'id':_0xf649fd[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x5e474f,null))[_0x65ca('0x14')](saveUpdates(_0xf649fd[_0x65ca('0x60')],null))[_0x65ca('0x14')](respondWithResult(_0x5e474f,null))[_0x65ca('0x1d')](handleError(_0x5e474f,null));};exports[_0x65ca('0x7b')]=function(_0x2b0e7b,_0x4fe8f3){var _0x45d47b=path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],_0x65ca('0x7e'));var _0x497880={'where':{'id':_0x2b0e7b[_0x65ca('0x5a')]['id']},'attributes':['id',_0x65ca('0x7f')],'raw':!![]};var _0xbad6ef=![];return require('../../config/license/util')['getLicense']()[_0x65ca('0x14')](function(_0x59b9e2){if(_0x59b9e2){_0xbad6ef=_0x59b9e2[_0x65ca('0x80')];}})[_0x65ca('0x14')](function(){return db[_0x65ca('0x56')]['find'](_0x497880);})[_0x65ca('0x14')](handleEntityNotFound(_0x4fe8f3,null))[_0x65ca('0x14')](function(_0x2b31f2){if(_0x2b31f2){if(!_[_0x65ca('0x81')](_0x2b31f2['sitepic'])){if(fs[_0x65ca('0x82')](path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],'server/files/images/logos/',_0x2b31f2[_0x65ca('0x7f')]))&&_0xbad6ef){_0x45d47b=path[_0x65ca('0x7c')](config['root'],'server/files/images/logos/',_0x2b31f2[_0x65ca('0x7f')]);}}return _0x4fe8f3[_0x65ca('0x83')](_0x45d47b);}})['catch'](handleError(_0x4fe8f3,null));};exports[_0x65ca('0x84')]=function(_0x535634,_0x3c30ab){var _0x3109e5=path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],_0x65ca('0x85'));var _0x4549eb={'where':{'id':_0x535634[_0x65ca('0x5a')]['id']},'attributes':['id',_0x65ca('0x77')],'raw':!![]};return db[_0x65ca('0x56')][_0x65ca('0x5e')](_0x4549eb)[_0x65ca('0x14')](handleEntityNotFound(_0x3c30ab,null))[_0x65ca('0x14')](function(_0x3bc765){if(_0x3bc765){if(!_[_0x65ca('0x81')](_0x3bc765[_0x65ca('0x77')])){if(fs[_0x65ca('0x82')](path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],_0x65ca('0x86'),_0x3bc765[_0x65ca('0x77')]))){_0x3109e5=path[_0x65ca('0x7c')](config['root'],_0x65ca('0x86'),_0x3bc765[_0x65ca('0x77')]);}}return _0x3c30ab[_0x65ca('0x83')](_0x3109e5);}})[_0x65ca('0x1d')](handleError(_0x3c30ab,null));};exports[_0x65ca('0x87')]=function(_0x3a1ad5,_0x51910c){var _0x383cbc=path[_0x65ca('0x7c')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0xfcda7e={'where':{'id':_0x3a1ad5['params']['id']},'attributes':['id',_0x65ca('0x7a'),'showCustomerAvatar'],'raw':!![]};return db[_0x65ca('0x56')][_0x65ca('0x5e')](_0xfcda7e)[_0x65ca('0x14')](handleEntityNotFound(_0x51910c,null))['then'](function(_0x1e735c){if(_0x1e735c){if(!_[_0x65ca('0x81')](_0x1e735c[_0x65ca('0x7a')])){if(fs[_0x65ca('0x82')](path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],_0x65ca('0x86'),_0x1e735c[_0x65ca('0x7a')]))&&_0x1e735c[_0x65ca('0x88')]){_0x383cbc=path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],_0x65ca('0x86'),_0x1e735c[_0x65ca('0x7a')]);}}return _0x51910c[_0x65ca('0x83')](_0x383cbc);}})['catch'](handleError(_0x51910c,null));};exports[_0x65ca('0x89')]=function(_0x30bfa3,_0x4903bf){var _0x222649=path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],_0x65ca('0x8a'));var _0x331093={'where':{'id':_0x30bfa3['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x65ca('0x56')][_0x65ca('0x5e')](_0x331093)[_0x65ca('0x14')](handleEntityNotFound(_0x4903bf,null))['then'](function(_0x5bbc7a){if(_0x5bbc7a){if(!_[_0x65ca('0x81')](_0x5bbc7a[_0x65ca('0x8b')])){if(fs[_0x65ca('0x82')](path['join'](config[_0x65ca('0x7d')],'server/files/images/avatars/',_0x5bbc7a[_0x65ca('0x8b')]))){_0x222649=path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],'server/files/images/avatars/',_0x5bbc7a['systemAvatar']);}}return _0x4903bf['download'](_0x222649);}})['catch'](handleError(_0x4903bf,null));};exports[_0x65ca('0x8c')]=function(_0x1768d1,_0x5e5c3b){var _0xd1aac={'body':_0x1768d1[_0x65ca('0x60')],'channel':'chat'};var _0x525f3e=[];var _0x4db97b=[];var _0x13dcb6={};var _0x2eda1a=![];return db['CmContact'][_0x65ca('0x67')]()[_0x65ca('0x14')](function(_0x117389){if(!_0x117389){throw new db['Sequelize'][(_0x65ca('0x8d'))]('no\x20available\x20attributes');}_0x525f3e=_['difference'](_[_0x65ca('0x5c')](_0x117389),[_0x65ca('0x8e'),_0x65ca('0x8f')]);_0x4db97b=_['difference'](_[_0x65ca('0x5c')](_0x117389),[_0x65ca('0x8e'),_0x65ca('0x8f'),_0x65ca('0x90'),'ListId']);if(_0x1768d1[_0x65ca('0x60')]['id']){delete _0x1768d1[_0x65ca('0x60')]['id'];}if(_[_0x65ca('0x81')](_0x1768d1[_0x65ca('0x60')][_0x65ca('0x91')])){throw new db['Sequelize'][(_0x65ca('0x8d'))](_0x65ca('0x92'));}if(_[_0x65ca('0x81')](_0x1768d1[_0x65ca('0x60')][_0x65ca('0x60')])||_0x1768d1[_0x65ca('0x60')][_0x65ca('0x60')]===''){throw new db[(_0x65ca('0x93'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1768d1['body'][_0x65ca('0x94')])){throw new db[(_0x65ca('0x93'))][(_0x65ca('0x8d'))](_0x65ca('0x95')+_0x4db97b);}if(!_['includes'](_0x4db97b,_0x1768d1[_0x65ca('0x60')][_0x65ca('0x94')])){throw new db['Sequelize']['ValidationError'](_0x65ca('0x96')+_0x4db97b);}_0x13dcb6[_0x1768d1[_0x65ca('0x60')][_0x65ca('0x94')]]=_0x1768d1[_0x65ca('0x60')][_0x65ca('0x91')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x1768d1[_0x65ca('0x5a')]['id']},'include':[{'model':db[_0x65ca('0x97')],'as':_0x65ca('0x98'),'include':[{'model':db[_0x65ca('0x99')],'as':_0x65ca('0x9a'),'where':_0x13dcb6,'limit':0x1,'order':[[_0x65ca('0x8f'),'DESC']]}]},{'model':db[_0x65ca('0x9b')],'as':_0x65ca('0x9c')},{'model':db['Interval'],'as':_0x65ca('0x9d'),'include':[{'model':db[_0x65ca('0x9d')],'as':'Intervals','attributes':['id',_0x65ca('0x2d')],'raw':!![]}]}]});})['then'](function(_0x3f0eaf){if(!_0x3f0eaf)throw new APINotFoundError(util[_0x65ca('0x3f')](_0x65ca('0x9e'),_0x1768d1[_0x65ca('0x5a')]['id']));if(!_0x3f0eaf['Interval']||!_0x3f0eaf['Interval'][_0x65ca('0x33')])return[_0x3f0eaf,!![]];return[_0x3f0eaf,checkWebsiteIntervals(_0x3f0eaf)];})[_0x65ca('0x9f')](function(_0x4700c7,_0x3782fc){if(!_0x3782fc)throw new APIOutOfIntervalError();if(!_0x4700c7[_0x65ca('0x98')])return;_0xd1aac[_0x65ca('0xa0')]=_0x4700c7;_0xd1aac[_0x65ca('0xa1')]=_0x4700c7['List'];_0xd1aac[_0x65ca('0xa2')]=_[_0x65ca('0xa3')](_0x4700c7[_0x65ca('0x9c')],[_0x65ca('0xa4')],[_0x65ca('0xa5')]);if(_0xd1aac[_0x65ca('0xa0')][_0x65ca('0x9c')]){delete _0xd1aac[_0x65ca('0xa0')][_0x65ca('0x9c')];}if(_0xd1aac['account'][_0x65ca('0x98')]&&_0xd1aac[_0x65ca('0xa0')]['List'][_0x65ca('0x9a')][_0x65ca('0x4d')]){return _0xd1aac[_0x65ca('0xa0')][_0x65ca('0x98')][_0x65ca('0x9a')][0x0];}var _0x4a7cf0=_[_0x65ca('0xa6')](_0x1768d1['body'],{'firstName':_0x1768d1[_0x65ca('0x60')][_0x65ca('0x91')],'ListId':_0x4700c7[_0x65ca('0xa7')]});_0x4a7cf0[_0x1768d1[_0x65ca('0x60')]['mapKey']]=_0x1768d1[_0x65ca('0x60')][_0x65ca('0x91')];return db[_0x65ca('0x99')][_0x65ca('0x5f')](_0x4a7cf0,{'fields':_0x525f3e,'raw':!![]});})[_0x65ca('0x14')](function(_0x3fcbbb){_0xd1aac['contact']=_0x3fcbbb;var _0x53ad5b=createInteractionObject(_0x1768d1[_0x65ca('0x5a')]['id'],_0x1768d1[_0x65ca('0x60')],_0x1768d1[_0x65ca('0xa8')],_0x3fcbbb);var _0x29db8c={'ChatWebsiteId':_0x1768d1[_0x65ca('0x5a')]['id'],'closed':![]};if(_0x1768d1[_0x65ca('0x60')][_0x65ca('0xa9')]){_0x29db8c[_0x65ca('0xa9')]=_0x1768d1[_0x65ca('0x60')][_0x65ca('0xa9')];return db[_0x65ca('0xaa')][_0x65ca('0x5e')]({'where':_0x29db8c})[_0x65ca('0x14')](function(_0x408ed4){if(_0x408ed4){_0x2eda1a=!![];return _0x408ed4;}_0x53ad5b[_0x65ca('0xa9')]=_0x1768d1['body'][_0x65ca('0xa9')];_0x53ad5b[_0x65ca('0xab')]=_0x1768d1[_0x65ca('0x60')][_0x65ca('0xab')];return db['ChatInteraction'][_0x65ca('0x5f')](_0x53ad5b);});}_0x29db8c[_0x65ca('0xac')]=_0x3fcbbb['id'];if(_0x1768d1[_0x65ca('0x60')][_0x65ca('0xad')]&&_0x1768d1[_0x65ca('0x60')][_0x65ca('0xad')]['id']){_0x29db8c['id']=_0x1768d1[_0x65ca('0x60')]['interaction']['id'];return db['ChatInteraction']['find']({'where':_0x29db8c})['then'](function(_0xff95a5){if(_0xff95a5){_0x2eda1a=!![];return _0xff95a5;}return db[_0x65ca('0xaa')][_0x65ca('0x5f')](_0x53ad5b);});}return db['ChatInteraction'][_0x65ca('0x5f')](_0x53ad5b);})['then'](function(_0x13245b){if(!_0x2eda1a)return _0x13245b;var _0x4345d7={'from':(_0xd1aac[_0x65ca('0xae')][_0x65ca('0xaf')]||'')+'\x20'+(_0xd1aac[_0x65ca('0xae')]['lastName']||'')};if(_0x1768d1[_0x65ca('0x60')][_0x65ca('0xa9')]&&_0x1768d1[_0x65ca('0x60')][_0x65ca('0xb0')]&&_0x1768d1[_0x65ca('0x60')][_0x65ca('0xa9')]!=_0x1768d1[_0x65ca('0x60')][_0x65ca('0xb0')]){_0x4345d7[_0x65ca('0xa9')]=_0x1768d1['body'][_0x65ca('0xb0')];}return _0x13245b[_0x65ca('0x25')](_0x4345d7);})[_0x65ca('0x14')](function(_0x3edb11){_0xd1aac[_0x65ca('0xad')]=_0x3edb11[_0x65ca('0x27')]({'plain':!![]});_0xd1aac[_0x65ca('0xad')][_0x65ca('0xb1')]=!_0x2eda1a;if(_0xd1aac[_0x65ca('0xad')][_0x65ca('0xb1')]){if(_0xd1aac['account'][_0x65ca('0xb2')]){_0xd1aac['applications']['push']({'id':0x0,'priority':_0xd1aac['applications'][_0x65ca('0x4d')]+0x1,'app':_0x65ca('0xb3'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x65ca('0xb4')][_0x65ca('0x5f')]({'body':_0x1768d1[_0x65ca('0x60')][_0x65ca('0x60')],'ChatWebsiteId':_0x1768d1['params']['id'],'ChatInteractionId':_0x3edb11['id'],'direction':'in','ContactId':_0xd1aac[_0x65ca('0xae')]['id'],'AttachmentId':_0x1768d1[_0x65ca('0x60')][_0x65ca('0xb5')]});})[_0x65ca('0x14')](function(_0x29f9a8){_0xd1aac[_0x65ca('0x1b')]=_0x29f9a8;if(!_0xd1aac[_0x65ca('0xad')][_0x65ca('0xb6')]){return;}return db[_0x65ca('0xb7')][_0x65ca('0x5e')]({'attributes':['id',_0x65ca('0x2b')],'where':{'id':_0xd1aac[_0x65ca('0xad')][_0x65ca('0xb6')]}});})[_0x65ca('0x14')](function(_0x57218d){if(_0x57218d){_0xd1aac[_0x65ca('0xa2')][_0x65ca('0xb8')]({'id':0x0,'priority':0x0,'app':_0x65ca('0xb9'),'appdata':_0x57218d['name']+','+(_0xd1aac[_0x65ca('0xa0')][_0x65ca('0xba')]||0xa),'interval':_0x65ca('0xbb')});_0xd1aac[_0x65ca('0xbc')]=!![];}if(!_0xd1aac[_0x65ca('0xad')]['queueId']){return;}return db[_0x65ca('0xbd')][_0x65ca('0x5e')]({'attributes':['id',_0x65ca('0x2b')],'where':{'id':_0xd1aac['interaction']['queueId']}});})[_0x65ca('0x14')](function(_0x2b0b0b){if(_0x2b0b0b){_0xd1aac[_0x65ca('0xa2')][_0x65ca('0xb8')]({'id':0x0,'priority':0x1,'app':_0x65ca('0xbe'),'appdata':_0x2b0b0b[_0x65ca('0x2b')]+','+(_0xd1aac[_0x65ca('0xa0')][_0x65ca('0xbf')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x65ca('0xc0'),_0x65ca('0xc1'),_0xd1aac);})[_0x65ca('0x14')](function(_0x2ce01d){respondWithRpcPromise(_0x65ca('0xc2'),_0x65ca('0xc2'),{'event':_0x65ca('0x8c'),'message':_0x2ce01d},client9002);return _0x2ce01d;})[_0x65ca('0x14')](respondWithResult(_0x5e5c3b,null))[_0x65ca('0x1d')](APIHandleError(_0x5e5c3b));};exports[_0x65ca('0xc3')]=function(_0x3c4d6c,_0x109db6){var _0x58d483,_0x495df0,_0x575f1d;var _0xd33a5f=[];var _0x8e4505={};var _0x4a371f=_0x3c4d6c['files']||[];var _0x4e9e53=[];var _0x428263;return db[_0x65ca('0x99')][_0x65ca('0x67')]()[_0x65ca('0x14')](function(_0x17e65e){if(!_0x17e65e){throw new db[(_0x65ca('0x93'))]['ValidationError']('no\x20available\x20attributes');}_0xd33a5f=_[_0x65ca('0xc4')](_[_0x65ca('0x5c')](_0x17e65e),['createdAt','updatedAt',_0x65ca('0x90'),_0x65ca('0xa7')]);if(_0x3c4d6c['body']['id']){delete _0x3c4d6c[_0x65ca('0x60')]['id'];}if(_[_0x65ca('0x81')](_0x3c4d6c['body'][_0x65ca('0x91')])){throw _0x109db6[_0x65ca('0x1e')](0x1f4)[_0x65ca('0xc5')](new db['Sequelize'][(_0x65ca('0x8d'))](_0x65ca('0x92')));}if(_[_0x65ca('0x81')](_0x3c4d6c['body'][_0x65ca('0x60')])||_0x3c4d6c[_0x65ca('0x60')][_0x65ca('0x60')]===''){throw _0x109db6[_0x65ca('0x1e')](0x1f4)[_0x65ca('0xc5')](new db[(_0x65ca('0x93'))][(_0x65ca('0x8d'))](_0x65ca('0xc6')));}if(_[_0x65ca('0x81')](_0x3c4d6c[_0x65ca('0x60')]['mapKeyOffline'])){throw _0x109db6[_0x65ca('0x1e')](0x1f4)[_0x65ca('0xc5')](new db[(_0x65ca('0x93'))][(_0x65ca('0x8d'))](_0x65ca('0xc7')+_0xd33a5f));}if(!_['includes'](_0xd33a5f,_0x3c4d6c[_0x65ca('0x60')][_0x65ca('0xc8')])){throw _0x109db6[_0x65ca('0x1e')](0x1f4)[_0x65ca('0xc5')](new db[(_0x65ca('0x93'))][(_0x65ca('0x8d'))](_0x65ca('0xc9')+_0xd33a5f));}_0x8e4505[_0x3c4d6c[_0x65ca('0x60')][_0x65ca('0xc8')]]=_0x3c4d6c[_0x65ca('0x60')][_0x65ca('0x91')];})[_0x65ca('0x14')](function(){return db[_0x65ca('0x56')][_0x65ca('0x5e')]({'where':{'id':_0x3c4d6c[_0x65ca('0x5a')]['id']},'include':[{'model':db[_0x65ca('0x97')],'as':_0x65ca('0x98')},{'model':db[_0x65ca('0xca')],'as':_0x65ca('0xca')}]});})['then'](handleEntityNotFound(_0x109db6,null))['then'](function(_0x37accc){if(_0x37accc&&_0x37accc[_0x65ca('0x98')]){_0x495df0=_0x37accc;var _0xf1a60a=_[_0x65ca('0xa6')](_0x3c4d6c[_0x65ca('0x60')],{'firstName':_0x3c4d6c[_0x65ca('0x60')]['from'],'phone':_0x3c4d6c[_0x65ca('0x60')][_0x65ca('0x91')],'ListId':_0x37accc[_0x65ca('0xa7')]});_0xf1a60a[_0x3c4d6c[_0x65ca('0x60')][_0x65ca('0xc8')]]=_0x3c4d6c[_0x65ca('0x60')][_0x65ca('0x91')];return db[_0x65ca('0x99')]['findOrCreate']({'where':_0x8e4505,'defaults':_0xf1a60a});}})[_0x65ca('0x9f')](function(_0x438a21){if(_0x438a21){_0x575f1d=_0x438a21;var _0x24135e=fs[_0x65ca('0xcb')](path['join'](config[_0x65ca('0x7d')],_0x65ca('0xcc')),'utf8');var _0x178c63=ejs[_0x65ca('0xcd')](_0x24135e,{'body':_[_0x65ca('0xce')](_0x3c4d6c[_0x65ca('0x60')][_0x65ca('0x60')]),'bodyTitle':_0x495df0[_0x65ca('0xcf')]});return db[_0x65ca('0xd0')][_0x65ca('0x5f')]({'body':_0x178c63,'plainBody':htmlToText[_0x65ca('0xd1')](_0x178c63),'ContactId':_0x438a21['id'],'ChatWebsiteId':_0x495df0['id']});}})[_0x65ca('0x14')](function(_0x44cd94){_0x428263=_0x44cd94;if(_0x4a371f[_0x65ca('0x4d')]){var _0x5ea09b=_0x4a371f[_0x65ca('0x32')](function(_0x5b5e45){return{'name':_0x5b5e45[_0x65ca('0xd2')],'basename':_0x5b5e45[_0x65ca('0x75')],'type':_0x5b5e45[_0x65ca('0xd3')],'ChatOfflineMessageId':_0x44cd94['id']};});_0x4e9e53=_0x5ea09b[_0x65ca('0x32')](_0x15dae9=>{var _0x42689b={'filename':_0x15dae9[_0x65ca('0x2b')],'path':path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],_0x65ca('0xd4'),_0x65ca('0xd5'),_0x65ca('0xd6'),_0x65ca('0xd7'),_0x15dae9[_0x65ca('0xd8')])};return _0x42689b;});if(!_0x495df0[_0x65ca('0xd9')]){return db[_0x65ca('0xda')][_0x65ca('0xdb')](function(_0x1aa96b){return db[_0x65ca('0xdc')][_0x65ca('0xdd')](_0x5ea09b,{'transaction':_0x1aa96b});});}}})['then'](function(){if(_0x428263){_0x58d483=_0x428263;return db[_0x65ca('0xca')][_0x65ca('0x6b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x65ca('0xde'),'raw':!![],'include':[{'model':db[_0x65ca('0xdf')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x65ca('0x14')](function(_0x3a1938){if(_0x3a1938&&_0x3a1938[_0x65ca('0xde')]&&_0x495df0[_0x65ca('0xe0')]&&_0x495df0[_0x65ca('0xe1')]){var _0x45b23a=_0x3a1938['getSmtpOptions']();return respondWithRpcPromise(_0x65ca('0xe2'),'sendMail',{'account':_0x45b23a,'message':{'from':util[_0x65ca('0x3f')]('\x22%s\x22\x20<%s>',_0x3a1938[_0x65ca('0x2b')],_0x3a1938[_0x65ca('0xe3')]||_0x3a1938[_0x65ca('0xde')][_0x65ca('0x61')]),'to':_0x495df0[_0x65ca('0xe1')],'subject':_0x495df0['offlineMessageSubject'],'html':_0x58d483[_0x65ca('0x60')],'attachments':_0x4e9e53}},client9003)[_0x65ca('0x14')](function(){return _0x58d483;})[_0x65ca('0x1d')](function(_0x34f660){logger['error'](_0x34f660);});}})[_0x65ca('0x14')](function(){if(_0x495df0&&_0x495df0[_0x65ca('0xd9')]&&_0x495df0[_0x65ca('0xe4')]){var _0x52ccec=[];if(_0x4a371f[_0x65ca('0x4d')]){_0x52ccec=_0x4a371f[_0x65ca('0x32')](function(_0xf51ca6){return{'name':_0xf51ca6[_0x65ca('0xd2')],'basename':_0xf51ca6['filename'],'type':_0xf51ca6[_0x65ca('0xd3')],'ChatOfflineMessageId':_0x428263['id']};});}var _0x5a557f;if(!_[_0x65ca('0x81')](_0x495df0['subjectOffline'])){var _0x31abbf=_['map'](_0x3c4d6c[_0x65ca('0x60')],function(_0xf24f07){return _0xf24f07;});var _0x2857b8=_['toPairsIn'](_0x31abbf)[0x0];var _0x2190a5=_['mapValues'](_0x2857b8,function(_0x338901){return _0x338901;});_0x5a557f=_0x2190a5[0x1][_0x495df0[_0x65ca('0xe5')]];}var _0x1c3688={'from':_0x575f1d[_0x65ca('0xe3')],'firstName':_0x575f1d[_0x65ca('0xaf')],'lastName':_0x575f1d['lastName'],'mapKey':_0x65ca('0xe3'),'message':{'from':_0x575f1d['email'],'to':_0x495df0[_0x65ca('0xca')]['email'],'cc':'','subject':_[_0x65ca('0x81')](_0x5a557f)?_0x495df0[_0x65ca('0xe6')]:_0x5a557f,'messageId':'','sentAt':new Date(),'attach':_0x52ccec[_0x65ca('0x4d')],'attachments':_0x52ccec,'originChannel':'Chat','ChatWebsiteId':_0x495df0['id'],'ChatOfflineMessageId':_0x58d483['id'],'originTo':_0x495df0[_0x65ca('0xca')][_0x65ca('0xe3')]},'body':_0x58d483[_0x65ca('0x60')]};var _0x3a200d={'account':{'id':_0x495df0['MailAccountId']},'body':_0x1c3688,'log':_0x65ca('0xe7')};return respondWithRpcPromise(_0x65ca('0xe7'),_0x65ca('0xe8'),_0x3a200d,client9001)['then'](function(){return _0x58d483;})[_0x65ca('0x1d')](function(_0x905625){logger[_0x65ca('0x19')](_0x905625);});}return;})[_0x65ca('0x14')](function(){if(_0x58d483){return _0x58d483;}})['then'](respondWithResult(_0x109db6,null))[_0x65ca('0x1d')](function(){for(var _0x31ba50 of _0x4a371f){var _0x4a0957=path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],'server',_0x65ca('0xd5'),_0x65ca('0xd6'),_0x65ca('0xd7'),_0x31ba50[_0x65ca('0x75')]);fs_extra[_0x65ca('0xe9')](_0x4a0957)[_0x65ca('0x1d')](function(_0x10e2f4){logger[_0x65ca('0x19')](_0x65ca('0xea'),_0x4a0957,_0x10e2f4);});}});};exports['addInteraction']=function(_0x104eff,_0x1d97c7){return db[_0x65ca('0xaa')]['find']({'where':{'id':_0x104eff['params']['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x1d97c7,null))['then'](function(_0x2f3158){if(_0x2f3158){return _0x2f3158[_0x65ca('0xeb')](_0x104eff['body'][_0x65ca('0x6e')],_[_0x65ca('0xec')](_0x104eff[_0x65ca('0x60')],[_0x65ca('0x6e'),'id'])||{});}})[_0x65ca('0x14')](respondWithResult(_0x1d97c7,null))['catch'](handleError(_0x1d97c7,null));};exports[_0x65ca('0xed')]=function(_0x545935,_0x4952f9){var _0x4ac9e1={'raw':![],'where':{}};var _0x110640={};var _0x23fcfe={'count':0x0,'rows':[]};return db[_0x65ca('0x56')]['findOne']({'where':{'id':_0x545935[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x4952f9,null))[_0x65ca('0x14')](function(_0x3778cb){if(_0x3778cb){_0x110640[_0x65ca('0x42')]=_[_0x65ca('0x5c')](db[_0x65ca('0xaa')][_0x65ca('0x46')]);_0x110640[_0x65ca('0x48')]=_[_0x65ca('0x5c')](_0x545935['query']);_0x110640[_0x65ca('0x49')]=_[_0x65ca('0x4a')](_0x110640[_0x65ca('0x42')],_0x110640['query']);_0x4ac9e1[_0x65ca('0x4c')]=_[_0x65ca('0x4a')](_0x110640[_0x65ca('0x42')],qs['fields'](_0x545935['query'][_0x65ca('0x4b')]));_0x4ac9e1['attributes']=_0x4ac9e1['attributes']['length']?_0x4ac9e1[_0x65ca('0x4c')]:_0x110640[_0x65ca('0x42')];if(!_0x545935[_0x65ca('0x48')][_0x65ca('0x6c')]('nolimit')){_0x4ac9e1[_0x65ca('0x22')]=qs['limit'](_0x545935[_0x65ca('0x48')][_0x65ca('0x22')]);_0x4ac9e1[_0x65ca('0x21')]=qs[_0x65ca('0x21')](_0x545935[_0x65ca('0x48')][_0x65ca('0x21')]);}_0x4ac9e1[_0x65ca('0x72')]=qs[_0x65ca('0x4f')](_0x545935[_0x65ca('0x48')][_0x65ca('0x4f')]);_0x4ac9e1[_0x65ca('0x52')]=qs[_0x65ca('0x49')](_[_0x65ca('0x50')](_0x545935[_0x65ca('0x48')],_0x110640[_0x65ca('0x49')]));_0x4ac9e1['where'][_0x65ca('0x69')]=_0x3778cb['id'];if(_0x545935['query']['filter']){_0x4ac9e1[_0x65ca('0x52')]=_[_0x65ca('0x53')](_0x4ac9e1['where'],{'$or':_['map'](_0x4ac9e1[_0x65ca('0x4c')],function(_0x120cb3){var _0x4f7c6d={};_0x4f7c6d[_0x120cb3]={'$like':'%'+_0x545935[_0x65ca('0x48')][_0x65ca('0x51')]+'%'};return _0x4f7c6d;})});}_0x4ac9e1=_[_0x65ca('0x53')]({},_0x4ac9e1,_0x545935[_0x65ca('0x55')]);return db['ChatInteraction']['count']({'where':_0x4ac9e1['where']})[_0x65ca('0x14')](function(_0x5d5556){_0x23fcfe[_0x65ca('0x23')]=_0x5d5556;if(_0x545935[_0x65ca('0x48')][_0x65ca('0x5d')]){_0x4ac9e1['include']=[{'model':db[_0x65ca('0x99')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x65ca('0xee'),'attributes':[_0x65ca('0x2b'),_0x65ca('0xef'),_0x65ca('0xf0')],'required':![]},{'model':db['Tag'],'as':_0x65ca('0xf1'),'attributes':['id',_0x65ca('0x2b'),'color'],'where':_0x545935[_0x65ca('0x48')][_0x65ca('0xf2')]?{'id':_0x545935[_0x65ca('0x48')][_0x65ca('0xf2')]}:undefined,'required':_0x545935[_0x65ca('0x48')][_0x65ca('0xf2')]?!![]:![]}];}return db['ChatInteraction'][_0x65ca('0x58')](_0x4ac9e1);})[_0x65ca('0x14')](function(_0x442f08){_0x23fcfe[_0x65ca('0x59')]=_0x442f08;return _0x23fcfe;});}})['then'](respondWithFilteredResult(_0x4952f9,_0x4ac9e1))[_0x65ca('0x1d')](handleError(_0x4952f9,null));};exports['getSnippet']=function(_0x3077e0,_0x5dfbf4){var _0x90752e=0x0;var _0xb5afcd=0x0;var _0x5a16b3=![];var _0x54cd6f;var _0x2215b4;return db['ChatWebsite'][_0x65ca('0x5e')]({'where':{'id':_0x3077e0[_0x65ca('0x5a')]['id']},'include':[{'model':db[_0x65ca('0x9d')],'as':_0x65ca('0x9d'),'include':[{'model':db[_0x65ca('0x9d')],'as':_0x65ca('0x33'),'attributes':['id',_0x65ca('0x2d')]}]}]})[_0x65ca('0x14')](handleEntityNotFound(_0x5dfbf4,null))[_0x65ca('0x14')](function(_0x5469b0){if(_0x5469b0){_0x54cd6f=_0x5469b0;return _0x5469b0[_0x65ca('0xf3')]({'raw':!![]});}})[_0x65ca('0x14')](function(_0x28df01){if(_0x54cd6f){if(_0x28df01){_0x2215b4=_0x28df01;}}return require('../../config/license/util')[_0x65ca('0xf4')]();})[_0x65ca('0x14')](function(_0x183979){if(_0x183979){_0xb5afcd=_0x183979[_0x65ca('0xf5')];_0x5a16b3=_0x183979['custom'];}})['then'](function(){return db[_0x65ca('0xaa')]['count']({'where':{'closed':![]}});})[_0x65ca('0x14')](function(_0x1543bf){_0x90752e=_0x1543bf;if(_0xb5afcd&&_0x1543bf>_0xb5afcd){return db['License'][_0x65ca('0x6b')]({'where':{'id':0x1}})[_0x65ca('0x14')](function(_0x4373a9){if(_0x4373a9){_0x4373a9[_0x65ca('0xf6')]('chatLicenseExceeded');}});}})['then'](function(){if(!_0x54cd6f[_0x65ca('0x9d')]||!_0x54cd6f['Interval'][_0x65ca('0x33')])return!![];return checkWebsiteIntervals(_0x54cd6f);})['then'](function(_0xc7c019){var _0x4eed0f=fs['readFileSync'](path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],'server/files/chat/iframe.ejs'),_0x65ca('0xf7'));var _0x4004bd=new url[(_0x65ca('0xf8'))](_0x54cd6f['address'])['origin'];var _0x4d4f48=_0x65ca('0xf9');var _0x49be28=![];var _0xfe3576={'chatVersion':_0x4d4f48,'chatWebsiteAddressOrigin':_0x4004bd,'remote':_0x54cd6f[_0x65ca('0xfa')],'query':querystring[_0x65ca('0x18')](_[_0x65ca('0x53')](_0x54cd6f[_0x65ca('0x27')]({'plain':!![]}),{'customerIp':_0x3077e0['headers'][_0x65ca('0x3a')]||_0x3077e0[_0x65ca('0xa8')][_0x65ca('0xfb')]||_0x3077e0['connection'][_0x65ca('0xfc')]||_0x3077e0['ip'],'referer':_0x3077e0[_0x65ca('0xa8')][_0x65ca('0xfd')],'openedInteractions':_0x90752e,'maxInteractions':_0xb5afcd,'virtual':_0x5a16b3[_0x65ca('0xf5')],'online':_0xc7c019,'custom':_0x5a16b3}))[_0x65ca('0xfe')](/'/g,'\x5c\x27')};_0x5dfbf4[_0x65ca('0xc5')](ejs[_0x65ca('0xcd')](Mustache[_0x65ca('0xcd')](_0x4eed0f,_0xfe3576),{'proactiveActions':_0x2215b4,'alignment':_0x54cd6f[_0x65ca('0xff')],'verticalAlignment':_0x54cd6f['verticalAlignment'],'div_color':_0x54cd6f['color'],'labelText':_0x54cd6f[_0x65ca('0x100')],'text_color':_0x54cd6f[_0x65ca('0x101')],'text_button_color':_0x54cd6f[_0x65ca('0x102')],'button_color':_0x54cd6f['color_button'],'background_color':_0x54cd6f['backgroundColor'],'hideWhenOffline':_0x54cd6f[_0x65ca('0x103')],'intervalId':_0x54cd6f[_0x65ca('0x104')],'isDevelopment':_0x49be28,'chatVersion':_0x4d4f48}));})[_0x65ca('0x1d')](handleError(_0x5dfbf4,null));};exports['addApplications']=function(_0x1d7d66,_0x258ea6){var _0x30954d=_0x1d7d66[_0x65ca('0x5a')]['id'];var _0x317ef8=_0x1d7d66[_0x65ca('0x60')];var _0x550ebc=0xc8;var _0x13a2b2=null;return db[_0x65ca('0xda')][_0x65ca('0xdb')]({'isolationLevel':db[_0x65ca('0xda')][_0x65ca('0x105')][_0x65ca('0x106')][_0x65ca('0x107')]},function(_0x1409ca){return db[_0x65ca('0x56')]['findOne']({'where':{'id':_0x30954d},'transaction':_0x1409ca})['then'](function(_0x579a33){if(_0x579a33){return db[_0x65ca('0x9b')][_0x65ca('0x26')]({'where':{'ChatWebsiteId':_0x30954d},'transaction':_0x1409ca})[_0x65ca('0x14')](function(){var _0x48672d=_[_0x65ca('0x32')](_0x317ef8,function(_0x239487){_0x239487[_0x65ca('0x69')]=_0x30954d;return _0x239487;});return db['ChatApplication'][_0x65ca('0xdd')](_0x48672d,{'transaction':_0x1409ca});});}else{_0x550ebc=0x194;_0x13a2b2=[];}});})[_0x65ca('0x14')](function(){if(_0x550ebc!==0x194){return db[_0x65ca('0x9b')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x30954d},'order':_0x65ca('0xa4')})[_0x65ca('0x14')](function(_0x3e1ada){_0x13a2b2=_0x3e1ada;});}})[_0x65ca('0x1d')](function(_0x2ef69f){_0x550ebc=0x1f4;logger[_0x65ca('0x19')](_0x2ef69f[_0x65ca('0x2a')]);if(_0x2ef69f[_0x65ca('0x2b')]){delete _0x2ef69f[_0x65ca('0x2b')];}_0x13a2b2=_0x2ef69f;})[_0x65ca('0x108')](function(){if(_0x13a2b2===null){_0x258ea6['sendStatus'](_0x550ebc);}else{if(_0x550ebc===0x1f4){_0x258ea6[_0x65ca('0x1e')](_0x550ebc)[_0x65ca('0xc5')](_0x13a2b2);}else{_0x258ea6[_0x65ca('0x1e')](_0x550ebc)['json'](_0x13a2b2);}}});};exports[_0x65ca('0x109')]=function(_0x3ff6dc,_0x4c5093){var _0x2066fe={};var _0x164317={};var _0x11b39b;var _0x455ef7;return db[_0x65ca('0x56')][_0x65ca('0x6b')]({'where':{'id':_0x3ff6dc[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x4c5093,null))['then'](function(_0x2b6297){if(_0x2b6297){_0x11b39b=_0x2b6297;_0x164317['model']=_[_0x65ca('0x5c')](db['ChatApplication'][_0x65ca('0x46')]);_0x164317[_0x65ca('0x48')]=_[_0x65ca('0x5c')](_0x3ff6dc[_0x65ca('0x48')]);_0x164317[_0x65ca('0x49')]=_['intersection'](_0x164317['model'],_0x164317['query']);_0x2066fe[_0x65ca('0x4c')]=_['intersection'](_0x164317[_0x65ca('0x42')],qs[_0x65ca('0x4b')](_0x3ff6dc['query'][_0x65ca('0x4b')]));_0x2066fe[_0x65ca('0x4c')]=_0x2066fe[_0x65ca('0x4c')][_0x65ca('0x4d')]?_0x2066fe['attributes']:_0x164317[_0x65ca('0x42')];_0x2066fe[_0x65ca('0x72')]=qs[_0x65ca('0x4f')](_0x3ff6dc[_0x65ca('0x48')]['sort']);_0x2066fe[_0x65ca('0x52')]=qs[_0x65ca('0x49')](_[_0x65ca('0x50')](_0x3ff6dc['query'],_0x164317[_0x65ca('0x49')]));if(_0x3ff6dc[_0x65ca('0x48')][_0x65ca('0x51')]){_0x2066fe['where']=_[_0x65ca('0x53')](_0x2066fe['where'],{'$or':_[_0x65ca('0x32')](_0x2066fe[_0x65ca('0x4c')],function(_0x339ce0){var _0x2539cf={};_0x2539cf[_0x339ce0]={'$like':'%'+_0x3ff6dc[_0x65ca('0x48')][_0x65ca('0x51')]+'%'};return _0x2539cf;})});}_0x2066fe=_[_0x65ca('0x53')]({},_0x2066fe,_0x3ff6dc[_0x65ca('0x55')]);return _0x11b39b['getApplications'](_0x2066fe);}})[_0x65ca('0x14')](function(_0x23a85d){if(_0x23a85d){_0x455ef7=_0x23a85d[_0x65ca('0x4d')];if(!_0x3ff6dc[_0x65ca('0x48')][_0x65ca('0x6c')]('nolimit')){_0x2066fe['limit']=qs[_0x65ca('0x22')](_0x3ff6dc[_0x65ca('0x48')][_0x65ca('0x22')]);_0x2066fe[_0x65ca('0x21')]=qs[_0x65ca('0x21')](_0x3ff6dc['query'][_0x65ca('0x21')]);}return _0x11b39b[_0x65ca('0x109')](_0x2066fe);}})[_0x65ca('0x14')](function(_0x121959){if(_0x121959){return _0x121959?{'count':_0x455ef7,'rows':_0x121959}:null;}})['then'](respondWithResult(_0x4c5093,null))[_0x65ca('0x1d')](handleError(_0x4c5093,null));};exports[_0x65ca('0x10a')]=function(_0x1b34a5,_0x29a56a){return db['chatProactiveAction'][_0x65ca('0x5e')]({'where':{'id':_0x1b34a5['params']['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x29a56a,null))[_0x65ca('0x14')](function(_0x58f852){if(_0x58f852){return _0x58f852[_0x65ca('0x10a')](_0x1b34a5[_0x65ca('0x60')][_0x65ca('0x6e')],_['omit'](_0x1b34a5['body'],[_0x65ca('0x6e'),'id'])||{});}})[_0x65ca('0x14')](respondWithResult(_0x29a56a,null))['catch'](handleError(_0x29a56a,null));};exports[_0x65ca('0xf3')]=function(_0x4cbf4a,_0x196769){var _0x397c14={};var _0x578c54={};var _0x3c08d3;var _0xcf9335;return db[_0x65ca('0x56')][_0x65ca('0x6b')]({'where':{'id':_0x4cbf4a[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x196769,null))[_0x65ca('0x14')](function(_0x3833fc){if(_0x3833fc){_0x3c08d3=_0x3833fc;_0x578c54[_0x65ca('0x42')]=_[_0x65ca('0x5c')](db[_0x65ca('0x10b')][_0x65ca('0x46')]);_0x578c54[_0x65ca('0x48')]=_[_0x65ca('0x5c')](_0x4cbf4a[_0x65ca('0x48')]);_0x578c54[_0x65ca('0x49')]=_[_0x65ca('0x4a')](_0x578c54[_0x65ca('0x42')],_0x578c54[_0x65ca('0x48')]);_0x397c14[_0x65ca('0x4c')]=_['intersection'](_0x578c54['model'],qs[_0x65ca('0x4b')](_0x4cbf4a['query'][_0x65ca('0x4b')]));_0x397c14[_0x65ca('0x4c')]=_0x397c14['attributes'][_0x65ca('0x4d')]?_0x397c14[_0x65ca('0x4c')]:_0x578c54[_0x65ca('0x42')];_0x397c14[_0x65ca('0x72')]=qs['sort'](_0x4cbf4a[_0x65ca('0x48')][_0x65ca('0x4f')]);_0x397c14[_0x65ca('0x52')]=qs[_0x65ca('0x49')](_[_0x65ca('0x50')](_0x4cbf4a[_0x65ca('0x48')],_0x578c54[_0x65ca('0x49')]));if(_0x4cbf4a[_0x65ca('0x48')]['filter']){_0x397c14[_0x65ca('0x52')]=_[_0x65ca('0x53')](_0x397c14[_0x65ca('0x52')],{'$or':_['map'](_0x397c14['attributes'],function(_0x19bf8a){var _0x121224={};_0x121224[_0x19bf8a]={'$like':'%'+_0x4cbf4a['query'][_0x65ca('0x51')]+'%'};return _0x121224;})});}_0x397c14=_[_0x65ca('0x53')]({},_0x397c14,_0x4cbf4a[_0x65ca('0x55')]);return _0x3c08d3[_0x65ca('0xf3')](_0x397c14);}})[_0x65ca('0x14')](function(_0x2bc40a){if(_0x2bc40a){_0xcf9335=_0x2bc40a[_0x65ca('0x4d')];if(!_0x4cbf4a[_0x65ca('0x48')][_0x65ca('0x6c')](_0x65ca('0x4e'))){_0x397c14[_0x65ca('0x22')]=qs[_0x65ca('0x22')](_0x4cbf4a[_0x65ca('0x48')][_0x65ca('0x22')]);_0x397c14['offset']=qs[_0x65ca('0x21')](_0x4cbf4a['query'][_0x65ca('0x21')]);}return _0x3c08d3['getProactiveActions'](_0x397c14);}})[_0x65ca('0x14')](function(_0x3013c6){if(_0x3013c6){return _0x3013c6?{'count':_0xcf9335,'rows':_0x3013c6}:null;}})[_0x65ca('0x14')](respondWithResult(_0x196769,null))[_0x65ca('0x1d')](handleError(_0x196769,null));};exports['getFields']=function(_0x225412,_0x3199b3){var _0x23a14f=_0x225412[_0x65ca('0x48')]['online']===_0x65ca('0x10c')?_0x65ca('0x10d'):'onlineForm';return db[_0x65ca('0x56')][_0x65ca('0x5e')]({'attributes':['id',_0x23a14f],'where':{'id':_0x225412[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x3199b3,null))[_0x65ca('0x14')](function(_0x1589c9){if(_0x1589c9){var _0x4b6c1f=_0x1589c9[_0x23a14f];var _0x29f953=_0x4b6c1f&&_0x4b6c1f['items']?_0x4b6c1f[_0x65ca('0x10e')]:[];_0x3199b3[_0x65ca('0xc5')]({'fromKey':_['isNil'](_0x4b6c1f[_0x65ca('0x10f')])?undefined:_0x4b6c1f['fromKey'],'count':_0x29f953['length'],'rows':_0x29f953});}})[_0x65ca('0x1d')](handleError(_0x3199b3,null));};exports[_0x65ca('0x110')]=function(_0x2bd1b4,_0x10468b){var _0x14c8e4={'raw':![],'where':{}};var _0x5887a0={};var _0x314dd3={'count':0x0,'rows':[]};return db[_0x65ca('0x56')][_0x65ca('0x6b')]({'where':{'id':_0x2bd1b4[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x10468b,null))[_0x65ca('0x14')](function(_0x33da7b){if(_0x33da7b){_0x5887a0[_0x65ca('0x42')]=_[_0x65ca('0x5c')](db['ChatOfflineMessage'][_0x65ca('0x46')]);_0x5887a0[_0x65ca('0x48')]=_[_0x65ca('0x5c')](_0x2bd1b4[_0x65ca('0x48')]);_0x5887a0['filters']=_[_0x65ca('0x4a')](_0x5887a0[_0x65ca('0x42')],_0x5887a0[_0x65ca('0x48')]);_0x14c8e4[_0x65ca('0x4c')]=_[_0x65ca('0x4a')](_0x5887a0[_0x65ca('0x42')],qs['fields'](_0x2bd1b4['query'][_0x65ca('0x4b')]));_0x14c8e4['attributes']=_0x14c8e4[_0x65ca('0x4c')]['length']?_0x14c8e4[_0x65ca('0x4c')]:_0x5887a0[_0x65ca('0x42')];if(!_0x2bd1b4[_0x65ca('0x48')][_0x65ca('0x6c')]('nolimit')){_0x14c8e4['limit']=qs[_0x65ca('0x22')](_0x2bd1b4['query'][_0x65ca('0x22')]);_0x14c8e4[_0x65ca('0x21')]=qs[_0x65ca('0x21')](_0x2bd1b4[_0x65ca('0x48')][_0x65ca('0x21')]);}_0x14c8e4[_0x65ca('0x72')]=qs[_0x65ca('0x4f')](_0x2bd1b4[_0x65ca('0x48')][_0x65ca('0x4f')]);_0x14c8e4[_0x65ca('0x52')]=qs[_0x65ca('0x49')](_[_0x65ca('0x50')](_0x2bd1b4[_0x65ca('0x48')],_0x5887a0[_0x65ca('0x49')]));_0x14c8e4[_0x65ca('0x52')][_0x65ca('0x69')]=_0x33da7b['id'];if(_0x2bd1b4[_0x65ca('0x48')][_0x65ca('0x51')]){_0x14c8e4['where']=_[_0x65ca('0x53')](_0x14c8e4[_0x65ca('0x52')],{'$or':_['map'](_0x14c8e4[_0x65ca('0x4c')],function(_0x506328){var _0x301d5d={};_0x301d5d[_0x506328]={'$like':'%'+_0x2bd1b4['query']['filter']+'%'};return _0x301d5d;})});}_0x14c8e4=_[_0x65ca('0x53')]({},_0x14c8e4,_0x2bd1b4[_0x65ca('0x55')]);return db['ChatOfflineMessage'][_0x65ca('0x23')]({'where':_0x14c8e4[_0x65ca('0x52')]})[_0x65ca('0x14')](function(_0x5755db){_0x314dd3[_0x65ca('0x23')]=_0x5755db;if(_0x2bd1b4[_0x65ca('0x48')][_0x65ca('0x5d')]){_0x14c8e4[_0x65ca('0x57')]=[{'all':!![]}];}else{_0x14c8e4[_0x65ca('0x57')]=[{'model':db[_0x65ca('0x99')],'as':_0x65ca('0x111'),'required':![]},{'model':db[_0x65ca('0xdc')],'as':_0x65ca('0x112'),'required':![]}];}return db[_0x65ca('0xd0')][_0x65ca('0x58')](_0x14c8e4);})['then'](function(_0x3a2047){_0x314dd3['rows']=_0x3a2047;return _0x314dd3;});}})['then'](respondWithFilteredResult(_0x10468b,_0x14c8e4))[_0x65ca('0x1d')](handleError(_0x10468b,null));};exports[_0x65ca('0x113')]=function(_0x4399db,_0x53bdc5){return db[_0x65ca('0x56')]['find']({'where':{'id':_0x4399db[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x53bdc5,null))[_0x65ca('0x14')](function(_0x209d58){if(_0x209d58){return _0x209d58[_0x65ca('0x113')](_0x4399db['body']['ids'],_[_0x65ca('0xec')](_0x4399db[_0x65ca('0x60')],['ids','id'])||{})['spread'](function(_0x157569){for(var _0x3a3954=0x0;_0x3a3954<_0x4399db[_0x65ca('0x60')]['ids'][_0x65ca('0x4d')];_0x3a3954+=0x1){socket[_0x65ca('0x114')](_0x65ca('0x115'),{'UserId':Number(_0x4399db[_0x65ca('0x60')][_0x65ca('0x6e')][_0x3a3954]),'ChatWebsiteId':Number(_0x4399db['params']['id'])});}return _0x157569;});}})[_0x65ca('0x14')](respondWithResult(_0x53bdc5,null))['catch'](handleError(_0x53bdc5,null));};exports[_0x65ca('0x116')]=function(_0x5ecd25,_0x143293){return db['ChatWebsite'][_0x65ca('0x5e')]({'where':{'id':_0x5ecd25[_0x65ca('0x5a')]['id']}})['then'](handleEntityNotFound(_0x143293,null))[_0x65ca('0x14')](function(_0x157fa3){if(_0x157fa3){return _0x157fa3[_0x65ca('0x116')](_0x5ecd25[_0x65ca('0x48')][_0x65ca('0x6e')])[_0x65ca('0x14')](function(){if(_['isArray'](_0x5ecd25['query'][_0x65ca('0x6e')])){for(var _0x1d2180=0x0;_0x1d2180<_0x5ecd25[_0x65ca('0x48')]['ids'][_0x65ca('0x4d')];_0x1d2180+=0x1){socket['emit'](_0x65ca('0x117'),{'UserId':Number(_0x5ecd25[_0x65ca('0x48')]['ids'][_0x1d2180]),'ChatWebsiteId':Number(_0x5ecd25[_0x65ca('0x5a')]['id'])});}}else{socket[_0x65ca('0x114')](_0x65ca('0x117'),{'UserId':Number(_0x5ecd25[_0x65ca('0x48')][_0x65ca('0x6e')]),'ChatWebsiteId':Number(_0x5ecd25[_0x65ca('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x143293,null))[_0x65ca('0x1d')](handleError(_0x143293,null));};exports['getAgents']=function(_0x183aa3,_0x505356){var _0x3bc0c2={};var _0x55772e={};var _0x176bd6;var _0x3a807b;return db[_0x65ca('0x56')]['findOne']({'where':{'id':_0x183aa3['params']['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x505356,null))['then'](function(_0x187eea){if(_0x187eea){_0x176bd6=_0x187eea;_0x55772e[_0x65ca('0x42')]=_[_0x65ca('0x5c')](db['User'][_0x65ca('0x46')]);_0x55772e[_0x65ca('0x48')]=_[_0x65ca('0x5c')](_0x183aa3[_0x65ca('0x48')]);_0x55772e[_0x65ca('0x49')]=_[_0x65ca('0x4a')](_0x55772e['model'],_0x55772e[_0x65ca('0x48')]);_0x3bc0c2[_0x65ca('0x4c')]=_[_0x65ca('0x4a')](_0x55772e[_0x65ca('0x42')],qs['fields'](_0x183aa3['query'][_0x65ca('0x4b')]));_0x3bc0c2[_0x65ca('0x4c')]=_0x3bc0c2[_0x65ca('0x4c')][_0x65ca('0x4d')]?_0x3bc0c2[_0x65ca('0x4c')]:_0x55772e[_0x65ca('0x42')];_0x3bc0c2[_0x65ca('0x72')]=qs[_0x65ca('0x4f')](_0x183aa3[_0x65ca('0x48')][_0x65ca('0x4f')]);_0x3bc0c2[_0x65ca('0x52')]=qs['filters'](_[_0x65ca('0x50')](_0x183aa3[_0x65ca('0x48')],_0x55772e[_0x65ca('0x49')]));if(_0x183aa3['query'][_0x65ca('0x51')]){_0x3bc0c2[_0x65ca('0x52')]=_[_0x65ca('0x53')](_0x3bc0c2[_0x65ca('0x52')],{'$or':_[_0x65ca('0x32')](_0x3bc0c2[_0x65ca('0x4c')],function(_0x66c77b){var _0x331be7={};_0x331be7[_0x66c77b]={'$like':'%'+_0x183aa3['query'][_0x65ca('0x51')]+'%'};return _0x331be7;})});}_0x3bc0c2=_[_0x65ca('0x53')]({},_0x3bc0c2,_0x183aa3[_0x65ca('0x55')]);return _0x176bd6[_0x65ca('0x118')](_0x3bc0c2);}})[_0x65ca('0x14')](function(_0x39f851){if(_0x39f851){_0x3a807b=_0x39f851[_0x65ca('0x4d')];if(!_0x183aa3[_0x65ca('0x48')][_0x65ca('0x6c')](_0x65ca('0x4e'))){_0x3bc0c2[_0x65ca('0x22')]=qs['limit'](_0x183aa3[_0x65ca('0x48')][_0x65ca('0x22')]);_0x3bc0c2[_0x65ca('0x21')]=qs['offset'](_0x183aa3['query']['offset']);}return _0x176bd6[_0x65ca('0x118')](_0x3bc0c2);}})['then'](function(_0xc0d25){if(_0xc0d25){return _0xc0d25?{'count':_0x3a807b,'rows':_0xc0d25}:null;}})[_0x65ca('0x14')](respondWithResult(_0x505356,null))[_0x65ca('0x1d')](handleError(_0x505356,null));};
\ No newline at end of file
+var _0x5611=['Contacts','DESC','ChatApplication','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','List','applications','orderBy','priority','asc','account','contact','headers','threadId','ChatInteraction','externalUrl','interaction','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','email','Smtp','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','Could\x20not\x20remove\x20attachment\x20file','addInteraction','fullname','Tag','Tags','color','tag','getSnippet','getProactiveActions','virtual','License','increment','chatLicenseExceeded','URL','address','remote','x-real-ip','connection','referer','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','offlineForm','items','fromKey','Contact','Attachments','addAgents','omit','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','mustache','util','path','lodash','html-to-text','jayson/promise','url','../../config/logger','api','../../config/environment','../../errors/api','APIOutOfIntervalError','APINotFoundError','handleError','../../mysqldb','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','ChatWebsites','UserProfileResource','destroy','stack','name','send','Command','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','map','Interval','Intervals','get','all','user-agent-parser','setUA','user-agent','getResult','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','browser','version','unknown','%s\x20%s','device','%s\x20%s\x20%s','model','vendor','type','index','mandatoryDispositionPause','rawAttributes','fieldName','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','pick','filter','where','merge','options','ChatWebsite','includeAll','findAll','params','Pause','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addDisposition','getDispositions','findOne','sort','ChatWebsiteId','Disposition','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','showCustomerAvatar','server/files/images/avatars/','notify','CmContact','describe','Sequelize','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList'];(function(_0x299ec9,_0x1992db){var _0x4402fe=function(_0x5c75c9){while(--_0x5c75c9){_0x299ec9['push'](_0x299ec9['shift']());}};_0x4402fe(++_0x1992db);}(_0x5611,0x7c));var _0x1561=function(_0xd34b6e,_0x4ba79c){_0xd34b6e=_0xd34b6e-0x0;var _0x51f242=_0x5611[_0xd34b6e];return _0x51f242;};'use strict';var Mustache=require(_0x1561('0x0'));var util=require(_0x1561('0x1'));var path=require(_0x1561('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1561('0x3'));var querystring=require('querystring');var htmlToText=require(_0x1561('0x4'));var Redis=require('ioredis');var jayson=require(_0x1561('0x5'));var url=require(_0x1561('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x1561('0x7'))(_0x1561('0x8'));var config=require(_0x1561('0x9'));var APIOutOfIntervalError=require(_0x1561('0xa'))[_0x1561('0xb')];var APINotFoundError=require('../../errors/api')[_0x1561('0xc')];var APIHandleError=require(_0x1561('0xa'))[_0x1561('0xd')];var db=require(_0x1561('0xe'))['db'];config['redis']=_[_0x1561('0xf')](config['redis'],{'host':_0x1561('0x10'),'port':0x18eb});var socket=require(_0x1561('0x11'))(new Redis(config['redis']));require(_0x1561('0x12'))[_0x1561('0x13')](socket);var client=jayson[_0x1561('0x14')][_0x1561('0x15')]({'port':0x232c});var client9002=jayson[_0x1561('0x14')][_0x1561('0x15')]({'port':0x232a});var client9003=jayson[_0x1561('0x14')][_0x1561('0x15')]({'port':0x232b});var client9001=jayson[_0x1561('0x14')][_0x1561('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x4798c9,_0x558fc0,_0x14c41b,_0x25f8cb){return new Promise(function(_0x3400e8,_0x19e3f3){var _0x157ebc=_0x25f8cb||client;return _0x157ebc[_0x1561('0x16')](_0x4798c9,_0x14c41b)[_0x1561('0x17')](function(_0x2d9fa8){logger['info'](_0x1561('0x18'),_0x558fc0,_0x1561('0x19'));logger[_0x1561('0x1a')](_0x1561('0x1b'),_0x558fc0,_0x1561('0x19'),JSON[_0x1561('0x1c')](_0x2d9fa8));if(_0x2d9fa8[_0x1561('0x1d')]){if(_0x2d9fa8['error'][_0x1561('0x1e')]===0x1f4){logger[_0x1561('0x1d')](_0x1561('0x18'),_0x558fc0,_0x2d9fa8[_0x1561('0x1d')]['message']);return _0x19e3f3(_0x2d9fa8[_0x1561('0x1d')][_0x1561('0x1f')]);}logger[_0x1561('0x1d')](_0x1561('0x18'),_0x558fc0,_0x2d9fa8['error'][_0x1561('0x1f')]);return _0x3400e8(_0x2d9fa8[_0x1561('0x1d')][_0x1561('0x1f')]);}else{logger[_0x1561('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x558fc0,_0x1561('0x19'));_0x3400e8(_0x2d9fa8[_0x1561('0x21')]['message']);}})[_0x1561('0x22')](function(_0x209c8d){logger[_0x1561('0x1d')](_0x1561('0x18'),_0x558fc0,_0x209c8d);_0x19e3f3(_0x209c8d);});});}function respondWithStatusCode(_0x1324ff,_0x4a01a3){_0x4a01a3=_0x4a01a3||0xcc;return function(_0x1a4b32){if(_0x1a4b32){return _0x1324ff[_0x1561('0x23')](_0x4a01a3);}return _0x1324ff[_0x1561('0x24')](_0x4a01a3)[_0x1561('0x25')]();};}function respondWithResult(_0x4d8e5e,_0x118931){_0x118931=_0x118931||0xc8;return function(_0x276905){if(_0x276905){return _0x4d8e5e['status'](_0x118931)[_0x1561('0x26')](_0x276905);}};}function respondWithFilteredResult(_0x7a0c2f,_0x336189){return function(_0x26337c){if(_0x26337c){var _0x118d05=typeof _0x336189[_0x1561('0x27')]===_0x1561('0x28')&&typeof _0x336189[_0x1561('0x29')]===_0x1561('0x28');var _0x20e8fd=_0x26337c[_0x1561('0x2a')];var _0x5d6ab2=_0x118d05?0x0:_0x336189[_0x1561('0x27')];var _0x780404=_0x118d05?_0x26337c[_0x1561('0x2a')]:_0x336189[_0x1561('0x27')]+_0x336189['limit'];var _0x50adf5;if(_0x780404>=_0x20e8fd){_0x780404=_0x20e8fd;_0x50adf5=0xc8;}else{_0x50adf5=0xce;}_0x7a0c2f[_0x1561('0x24')](_0x50adf5);return _0x7a0c2f['set'](_0x1561('0x2b'),_0x5d6ab2+'-'+_0x780404+'/'+_0x20e8fd)[_0x1561('0x26')](_0x26337c);}return null;};}function saveUpdates(_0x4272b7){return function(_0x51cb3f){if(_0x51cb3f){return _0x51cb3f[_0x1561('0x2c')](_0x4272b7)['then'](function(_0x10efe8){return _0x10efe8;});}return null;};}function removeEntity(_0x2fdb32){return function(_0x4b005b){if(_0x4b005b){return _0x4b005b['destroy']()['then'](function(){var _0x5ec5c9=_0x4b005b['get']({'plain':!![]});var _0x3e602a=_0x1561('0x2d');return db[_0x1561('0x2e')][_0x1561('0x2f')]({'where':{'type':_0x3e602a,'resourceId':_0x5ec5c9['id']}})['then'](function(){return _0x4b005b;});})[_0x1561('0x17')](function(){_0x2fdb32[_0x1561('0x24')](0xcc)[_0x1561('0x25')]();});}};}function handleEntityNotFound(_0x4b4bca){return function(_0x2ddcd3){if(!_0x2ddcd3){_0x4b4bca['sendStatus'](0x194);}return _0x2ddcd3;};}function handleError(_0x489383,_0x4847f4){_0x4847f4=_0x4847f4||0x1f4;return function(_0x3f35bd){logger['error'](_0x3f35bd[_0x1561('0x30')]);if(_0x3f35bd[_0x1561('0x31')]){delete _0x3f35bd[_0x1561('0x31')];}_0x489383['status'](_0x4847f4)[_0x1561('0x32')](_0x3f35bd);};}function iftimePromise(_0x1df4db,_0x422a42){return respondWithRpcPromise(_0x1561('0x33'),'getSnippet',{'command':_0x422a42[_0x1561('0x34')]?util[_0x1561('0x35')](_0x1561('0x36'),_0x1df4db[_0x1561('0x37')],_0x422a42['timezone']):util[_0x1561('0x35')](_0x1561('0x38'),_0x1df4db[_0x1561('0x37')])},client9002)['then'](function(_0x2232ad){var _0x2244d7=_0x2232ad&&_0x2232ad[_0x1561('0x39')](_0x1561('0x3a'))>=0x0?!![]:![];logger[_0x1561('0x20')](_0x1561('0x3b'),_0x422a42['id'],_0x1df4db['id'],_0x1df4db[_0x1561('0x37')],_0x2244d7?_0x1561('0x3c'):_0x1561('0x3d'),_0x422a42[_0x1561('0x34')]?_0x422a42[_0x1561('0x34')]:'No\x20timezone');return _0x2244d7;})['catch'](function(_0x5e6248){logger[_0x1561('0x1d')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x422a42['id'],_0x1df4db['id'],_0x1df4db['interval'],util['inspect'](_0x5e6248,{'showHidden':![],'depth':null}),_0x422a42[_0x1561('0x34')]?_0x422a42['timezone']:_0x1561('0x3e'));return![];});}function checkWebsiteIntervals(_0x332551){var _0x6bd523=_[_0x1561('0x3f')](_0x332551[_0x1561('0x40')][_0x1561('0x41')],function(_0x4e26ae){var _0x4ff0c3=_0x4e26ae[_0x1561('0x42')]({'plain':!![]});return iftimePromise(_0x4ff0c3,_0x332551);});return Promise[_0x1561('0x43')](_0x6bd523)[_0x1561('0x17')](function(_0x54685f){return _['some'](_0x54685f);});}function createInteractionObject(_0x1f2055,_0xc564b,_0x28d772,_0x1ea721){var _0x280f5b=require(_0x1561('0x44'));var _0x14e7d1=new _0x280f5b();var _0x371dab=_0x14e7d1[_0x1561('0x45')](_0x28d772[_0x1561('0x46')])[_0x1561('0x47')]();var _0x3b93b5=_0xc564b['customerIp'];if(_0x28d772['cf-connecting-ip']){_0x3b93b5=_0x28d772[_0x1561('0x48')];}else if(_0x28d772['x-forwarded-for']){_0x3b93b5=_[_0x1561('0x49')](_0x28d772[_0x1561('0x4a')][_0x1561('0x4b')](','));}return{'ContactId':_0x1ea721['id'],'ChatWebsiteId':_0x1f2055,'from':(_0x1ea721[_0x1561('0x4c')]||'')+'\x20'+(_0x1ea721[_0x1561('0x4d')]||''),'customerIp':_0x3b93b5,'customerPort':_0x28d772['x-real-port']?_0x28d772['x-real-port']:null,'referer':_0xc564b['referer'],'browserName':_0x371dab[_0x1561('0x4e')][_0x1561('0x31')]&&_0x371dab[_0x1561('0x4e')][_0x1561('0x4f')]?util[_0x1561('0x35')]('%s\x20%s',_0x371dab[_0x1561('0x4e')][_0x1561('0x31')],_0x371dab[_0x1561('0x4e')][_0x1561('0x4f')]):_0x1561('0x50'),'browserVersion':_0x371dab['browser'][_0x1561('0x4f')]||_0x1561('0x50'),'osName':util[_0x1561('0x35')](_0x1561('0x51'),_0x371dab['os']['name'],_0x371dab['os'][_0x1561('0x4f')]),'osVersion':_0x371dab['os']['version'],'deviceModel':_0x371dab[_0x1561('0x52')]['model']&&_0x371dab[_0x1561('0x52')]['vendor']?util['format'](_0x1561('0x53'),_0x371dab[_0x1561('0x52')][_0x1561('0x54')],_0x371dab['device'][_0x1561('0x55')],_0x371dab[_0x1561('0x52')][_0x1561('0x56')]):null,'deviceVendor':_0x371dab[_0x1561('0x52')][_0x1561('0x55')],'deviceType':_0x371dab[_0x1561('0x52')][_0x1561('0x56')],'formData':JSON[_0x1561('0x1c')](_0xc564b)};}exports[_0x1561('0x57')]=function(_0x2f6eec,_0x1da955){var _0x163d3d={'include':[{'model':db['Pause'],'as':_0x1561('0x58')}]},_0x38e8f6={},_0xb4d577={'count':0x0,'rows':[]};var _0x56f74e=_[_0x1561('0x3f')](db['ChatWebsite'][_0x1561('0x59')],function(_0x3fbb38){return{'name':_0x3fbb38[_0x1561('0x5a')],'type':_0x3fbb38['type']['key']};});_0x38e8f6['model']=_[_0x1561('0x3f')](_0x56f74e,_0x1561('0x31'));_0x38e8f6[_0x1561('0x5b')]=_[_0x1561('0x5c')](_0x2f6eec[_0x1561('0x5b')]);_0x38e8f6[_0x1561('0x5d')]=_[_0x1561('0x5e')](_0x38e8f6[_0x1561('0x54')],_0x38e8f6[_0x1561('0x5b')]);_0x163d3d['attributes']=_[_0x1561('0x5e')](_0x38e8f6[_0x1561('0x54')],qs[_0x1561('0x5f')](_0x2f6eec[_0x1561('0x5b')][_0x1561('0x5f')]));_0x163d3d[_0x1561('0x60')]=_0x163d3d[_0x1561('0x60')][_0x1561('0x61')]?_0x163d3d[_0x1561('0x60')]:_0x38e8f6['model'];if(!_0x2f6eec['query'][_0x1561('0x62')]('nolimit')){_0x163d3d['limit']=qs[_0x1561('0x29')](_0x2f6eec[_0x1561('0x5b')][_0x1561('0x29')]);_0x163d3d[_0x1561('0x27')]=qs[_0x1561('0x27')](_0x2f6eec['query'][_0x1561('0x27')]);}_0x163d3d[_0x1561('0x63')]=qs['sort'](_0x2f6eec['query']['sort']);_0x163d3d['where']=qs['filters'](_[_0x1561('0x64')](_0x2f6eec[_0x1561('0x5b')],_0x38e8f6['filters']),_0x56f74e);if(_0x2f6eec[_0x1561('0x5b')][_0x1561('0x65')]){_0x163d3d[_0x1561('0x66')]=_[_0x1561('0x67')](_0x163d3d[_0x1561('0x66')],{'$or':_[_0x1561('0x3f')](_0x56f74e,function(_0x2d8f76){if(_0x2d8f76[_0x1561('0x56')]!=='VIRTUAL'){var _0x52fd60={};_0x52fd60[_0x2d8f76[_0x1561('0x31')]]={'$like':'%'+_0x2f6eec[_0x1561('0x5b')][_0x1561('0x65')]+'%'};return _0x52fd60;}})});}_0x163d3d=_[_0x1561('0x67')]({},_0x163d3d,_0x2f6eec[_0x1561('0x68')]);var _0x418ca5={'where':_0x163d3d[_0x1561('0x66')]};return db[_0x1561('0x69')]['count'](_0x418ca5)[_0x1561('0x17')](function(_0x9bad5a){_0xb4d577[_0x1561('0x2a')]=_0x9bad5a;if(_0x2f6eec[_0x1561('0x5b')][_0x1561('0x6a')]){_0x163d3d['include']=[{'all':!![]}];}return db['ChatWebsite'][_0x1561('0x6b')](_0x163d3d);})[_0x1561('0x17')](function(_0x2fb70e){_0xb4d577['rows']=_0x2fb70e;return _0xb4d577;})['then'](respondWithFilteredResult(_0x1da955,_0x163d3d))[_0x1561('0x22')](handleError(_0x1da955,null));};exports['show']=function(_0x19ac9a,_0x3bd2f6){var _0x5d96ad={'raw':![],'where':{'id':_0x19ac9a[_0x1561('0x6c')]['id']},'include':[{'model':db[_0x1561('0x6d')],'as':_0x1561('0x58')}]},_0x50e4bf={};_0x50e4bf['model']=_[_0x1561('0x5c')](db[_0x1561('0x69')][_0x1561('0x59')]);_0x50e4bf[_0x1561('0x5b')]=_[_0x1561('0x5c')](_0x19ac9a[_0x1561('0x5b')]);_0x50e4bf[_0x1561('0x5d')]=_['intersection'](_0x50e4bf[_0x1561('0x54')],_0x50e4bf[_0x1561('0x5b')]);_0x5d96ad[_0x1561('0x60')]=_[_0x1561('0x5e')](_0x50e4bf[_0x1561('0x54')],qs['fields'](_0x19ac9a[_0x1561('0x5b')][_0x1561('0x5f')]));_0x5d96ad[_0x1561('0x60')]=_0x5d96ad[_0x1561('0x60')][_0x1561('0x61')]?_0x5d96ad[_0x1561('0x60')]:_0x50e4bf[_0x1561('0x54')];if(_0x19ac9a[_0x1561('0x5b')][_0x1561('0x6a')]){_0x5d96ad[_0x1561('0x6e')]=[{'all':!![]}];}_0x5d96ad=_[_0x1561('0x67')]({},_0x5d96ad,_0x19ac9a[_0x1561('0x68')]);return db[_0x1561('0x69')][_0x1561('0x6f')](_0x5d96ad)[_0x1561('0x17')](handleEntityNotFound(_0x3bd2f6,null))[_0x1561('0x17')](respondWithResult(_0x3bd2f6,null))[_0x1561('0x22')](handleError(_0x3bd2f6,null));};exports[_0x1561('0x70')]=function(_0xc185dc,_0x2ab30d){return db[_0x1561('0x69')][_0x1561('0x70')](_0xc185dc['body'],{})['then'](function(_0x11b478){var _0x27757a=_0xc185dc[_0x1561('0x71')]['get']({'plain':!![]});if(!_0x27757a)throw new Error(_0x1561('0x72'));if(_0x27757a[_0x1561('0x73')]===_0x1561('0x71')){var _0x43b698=_0x11b478[_0x1561('0x42')]({'plain':!![]});var _0x3ea798='ChatWebsites';return db['UserProfileSection'][_0x1561('0x6f')]({'where':{'name':_0x3ea798,'userProfileId':_0x27757a[_0x1561('0x74')]},'raw':!![]})[_0x1561('0x17')](function(_0x1d5dbe){if(_0x1d5dbe&&_0x1d5dbe[_0x1561('0x75')]===0x0){return db[_0x1561('0x2e')][_0x1561('0x70')]({'name':_0x43b698[_0x1561('0x31')],'resourceId':_0x43b698['id'],'type':_0x1d5dbe[_0x1561('0x31')],'sectionId':_0x1d5dbe['id']},{})[_0x1561('0x17')](function(){return _0x11b478;});}else{return _0x11b478;}})[_0x1561('0x22')](function(_0x6ef25f){logger['error'](_0x1561('0x76'),_0x6ef25f);throw _0x6ef25f;});}return _0x11b478;})['then'](respondWithResult(_0x2ab30d,0xc9))[_0x1561('0x22')](handleError(_0x2ab30d,null));};exports[_0x1561('0x2c')]=function(_0x14e31e,_0xf4b317){if(_0x14e31e[_0x1561('0x77')]['id']){delete _0x14e31e[_0x1561('0x77')]['id'];}return db[_0x1561('0x69')][_0x1561('0x6f')]({'where':{'id':_0x14e31e['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0xf4b317,null))[_0x1561('0x17')](saveUpdates(_0x14e31e['body'],null))[_0x1561('0x17')](respondWithResult(_0xf4b317,null))[_0x1561('0x22')](handleError(_0xf4b317,null));};exports[_0x1561('0x2f')]=function(_0x228235,_0x2a6cd4){return db['ChatWebsite'][_0x1561('0x6f')]({'where':{'id':_0x228235['params']['id']}})[_0x1561('0x17')](handleEntityNotFound(_0x2a6cd4,null))[_0x1561('0x17')](removeEntity(_0x2a6cd4,null))['catch'](handleError(_0x2a6cd4,null));};exports['describe']=function(_0x4e060b,_0x3eb78d){return db[_0x1561('0x69')]['describe']()[_0x1561('0x17')](respondWithResult(_0x3eb78d,null))[_0x1561('0x22')](handleError(_0x3eb78d,null));};exports[_0x1561('0x78')]=function(_0x336954,_0x35c92e){if(_0x336954['body']['id']){delete _0x336954['body']['id'];}return db['ChatWebsite'][_0x1561('0x6f')]({'where':{'id':_0x336954[_0x1561('0x6c')]['id']}})['then'](handleEntityNotFound(_0x35c92e,null))[_0x1561('0x17')](function(_0x4f3397){if(_0x4f3397){_0x336954['body']['ChatWebsiteId']=_0x4f3397['id'];return db['Disposition'][_0x1561('0x70')](_0x336954[_0x1561('0x77')]);}})[_0x1561('0x17')](respondWithResult(_0x35c92e,null))[_0x1561('0x22')](handleError(_0x35c92e,null));};exports[_0x1561('0x79')]=function(_0xb50dae,_0x5a0143){var _0x4c33b9={'raw':![],'where':{}};var _0x4bee5d={};var _0x5bba97={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1561('0x7a')]({'where':{'id':_0xb50dae[_0x1561('0x6c')]['id']}})[_0x1561('0x17')](handleEntityNotFound(_0x5a0143,null))['then'](function(_0x22b8b3){if(_0x22b8b3){_0x4bee5d['model']=_[_0x1561('0x5c')](db['Disposition'][_0x1561('0x59')]);_0x4bee5d['query']=_['keys'](_0xb50dae[_0x1561('0x5b')]);_0x4bee5d[_0x1561('0x5d')]=_['intersection'](_0x4bee5d[_0x1561('0x54')],_0x4bee5d[_0x1561('0x5b')]);_0x4c33b9[_0x1561('0x60')]=_[_0x1561('0x5e')](_0x4bee5d[_0x1561('0x54')],qs[_0x1561('0x5f')](_0xb50dae[_0x1561('0x5b')][_0x1561('0x5f')]));_0x4c33b9[_0x1561('0x60')]=_0x4c33b9['attributes'][_0x1561('0x61')]?_0x4c33b9[_0x1561('0x60')]:_0x4bee5d['model'];if(!_0xb50dae['query'][_0x1561('0x62')]('nolimit')){_0x4c33b9[_0x1561('0x29')]=qs[_0x1561('0x29')](_0xb50dae['query']['limit']);_0x4c33b9['offset']=qs[_0x1561('0x27')](_0xb50dae[_0x1561('0x5b')][_0x1561('0x27')]);}_0x4c33b9[_0x1561('0x63')]=qs[_0x1561('0x7b')](_0xb50dae['query'][_0x1561('0x7b')]);_0x4c33b9[_0x1561('0x66')]=qs['filters'](_[_0x1561('0x64')](_0xb50dae['query'],_0x4bee5d[_0x1561('0x5d')]));_0x4c33b9[_0x1561('0x66')][_0x1561('0x7c')]=_0x22b8b3['id'];if(_0xb50dae[_0x1561('0x5b')][_0x1561('0x65')]){_0x4c33b9[_0x1561('0x66')]=_[_0x1561('0x67')](_0x4c33b9[_0x1561('0x66')],{'$or':_[_0x1561('0x3f')](_0x4c33b9[_0x1561('0x60')],function(_0x58d7aa){var _0x4f7966={};_0x4f7966[_0x58d7aa]={'$like':'%'+_0xb50dae[_0x1561('0x5b')][_0x1561('0x65')]+'%'};return _0x4f7966;})});}_0x4c33b9=_[_0x1561('0x67')]({},_0x4c33b9,_0xb50dae[_0x1561('0x68')]);return db[_0x1561('0x7d')][_0x1561('0x2a')]({'where':_0x4c33b9[_0x1561('0x66')]})[_0x1561('0x17')](function(_0x2a2ca4){_0x5bba97[_0x1561('0x2a')]=_0x2a2ca4;if(_0xb50dae['query'][_0x1561('0x6a')]){_0x4c33b9[_0x1561('0x6e')]=[{'all':!![]}];}return db[_0x1561('0x7d')][_0x1561('0x6b')](_0x4c33b9);})[_0x1561('0x17')](function(_0x4ee1dd){_0x5bba97[_0x1561('0x7e')]=_0x4ee1dd;return _0x5bba97;});}})[_0x1561('0x17')](respondWithFilteredResult(_0x5a0143,_0x4c33b9))[_0x1561('0x22')](handleError(_0x5a0143,null));};exports[_0x1561('0x7f')]=function(_0x2395a2,_0x45a96e){return db[_0x1561('0x69')][_0x1561('0x6f')]({'where':{'id':_0x2395a2[_0x1561('0x6c')]['id']}})['then'](handleEntityNotFound(_0x45a96e,null))[_0x1561('0x17')](function(_0x30e7f4){if(_0x30e7f4){return _0x30e7f4[_0x1561('0x7f')](_0x2395a2['query']['ids']);}})[_0x1561('0x17')](respondWithStatusCode(_0x45a96e,null))[_0x1561('0x22')](handleError(_0x45a96e,null));};exports[_0x1561('0x80')]=function(_0x517c21,_0x313c96){if(_0x517c21[_0x1561('0x77')]['id']){delete _0x517c21[_0x1561('0x77')]['id'];}return db[_0x1561('0x69')]['find']({'where':{'id':_0x517c21[_0x1561('0x6c')]['id']}})[_0x1561('0x17')](handleEntityNotFound(_0x313c96,null))[_0x1561('0x17')](function(_0x1d5096){if(_0x1d5096){_0x517c21[_0x1561('0x77')][_0x1561('0x7c')]=_0x1d5096['id'];return db[_0x1561('0x81')][_0x1561('0x70')](_0x517c21[_0x1561('0x77')]);}})[_0x1561('0x17')](respondWithResult(_0x313c96,null))[_0x1561('0x22')](handleError(_0x313c96,null));};exports[_0x1561('0x82')]=function(_0x21aff2,_0x3a15e5){var _0x3485c4={'raw':![],'where':{}};var _0x481c7d={};var _0x37ac38={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1561('0x7a')]({'where':{'id':_0x21aff2[_0x1561('0x6c')]['id']}})['then'](handleEntityNotFound(_0x3a15e5,null))[_0x1561('0x17')](function(_0x56d943){if(_0x56d943){_0x481c7d[_0x1561('0x54')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x481c7d[_0x1561('0x5b')]=_[_0x1561('0x5c')](_0x21aff2[_0x1561('0x5b')]);_0x481c7d['filters']=_[_0x1561('0x5e')](_0x481c7d['model'],_0x481c7d['query']);_0x3485c4[_0x1561('0x60')]=_[_0x1561('0x5e')](_0x481c7d[_0x1561('0x54')],qs['fields'](_0x21aff2[_0x1561('0x5b')][_0x1561('0x5f')]));_0x3485c4['attributes']=_0x3485c4['attributes']['length']?_0x3485c4[_0x1561('0x60')]:_0x481c7d[_0x1561('0x54')];if(!_0x21aff2['query']['hasOwnProperty'](_0x1561('0x83'))){_0x3485c4[_0x1561('0x29')]=qs[_0x1561('0x29')](_0x21aff2['query'][_0x1561('0x29')]);_0x3485c4['offset']=qs[_0x1561('0x27')](_0x21aff2['query']['offset']);}_0x3485c4['order']=qs['sort'](_0x21aff2[_0x1561('0x5b')][_0x1561('0x7b')]);_0x3485c4[_0x1561('0x66')]=qs['filters'](_[_0x1561('0x64')](_0x21aff2['query'],_0x481c7d[_0x1561('0x5d')]));_0x3485c4[_0x1561('0x66')][_0x1561('0x7c')]=_0x56d943['id'];if(_0x21aff2['query'][_0x1561('0x65')]){_0x3485c4[_0x1561('0x66')]=_[_0x1561('0x67')](_0x3485c4[_0x1561('0x66')],{'$or':_['map'](_0x3485c4[_0x1561('0x60')],function(_0x56ff77){var _0x3a8cd0={};_0x3a8cd0[_0x56ff77]={'$like':'%'+_0x21aff2[_0x1561('0x5b')][_0x1561('0x65')]+'%'};return _0x3a8cd0;})});}_0x3485c4=_[_0x1561('0x67')]({},_0x3485c4,_0x21aff2[_0x1561('0x68')]);return db[_0x1561('0x81')][_0x1561('0x2a')]({'where':_0x3485c4[_0x1561('0x66')]})[_0x1561('0x17')](function(_0x4d8364){_0x37ac38['count']=_0x4d8364;if(_0x21aff2[_0x1561('0x5b')][_0x1561('0x6a')]){_0x3485c4[_0x1561('0x6e')]=[{'all':!![]}];}return db[_0x1561('0x81')][_0x1561('0x6b')](_0x3485c4);})['then'](function(_0x19b8b1){_0x37ac38['rows']=_0x19b8b1;return _0x37ac38;});}})['then'](respondWithFilteredResult(_0x3a15e5,_0x3485c4))['catch'](handleError(_0x3a15e5,null));};exports[_0x1561('0x84')]=function(_0x796fe8,_0xc323a7){return db[_0x1561('0x69')][_0x1561('0x6f')]({'where':{'id':_0x796fe8[_0x1561('0x6c')]['id']}})[_0x1561('0x17')](handleEntityNotFound(_0xc323a7,null))[_0x1561('0x17')](function(_0x5dc259){if(_0x5dc259){return _0x5dc259[_0x1561('0x84')](_0x796fe8[_0x1561('0x5b')][_0x1561('0x85')]);}})[_0x1561('0x17')](respondWithStatusCode(_0xc323a7,null))['catch'](handleError(_0xc323a7,null));};exports[_0x1561('0x86')]=function(_0x147748,_0x1de350){_0x147748[_0x1561('0x77')][_0x1561('0x87')]=_0x147748[_0x1561('0x88')][_0x1561('0x89')];return db[_0x1561('0x69')]['find']({'where':{'id':_0x147748[_0x1561('0x6c')]['id']}})[_0x1561('0x17')](handleEntityNotFound(_0x1de350,null))[_0x1561('0x17')](saveUpdates(_0x147748[_0x1561('0x77')],null))[_0x1561('0x17')](respondWithResult(_0x1de350,null))[_0x1561('0x22')](handleError(_0x1de350,null));};exports[_0x1561('0x8a')]=function(_0x3cdfef,_0x5405bc){_0x3cdfef[_0x1561('0x77')][_0x1561('0x8b')]=_0x3cdfef['file'][_0x1561('0x89')];return db[_0x1561('0x69')]['find']({'where':{'id':_0x3cdfef[_0x1561('0x6c')]['id']}})[_0x1561('0x17')](handleEntityNotFound(_0x5405bc,null))[_0x1561('0x17')](saveUpdates(_0x3cdfef[_0x1561('0x77')],null))[_0x1561('0x17')](respondWithResult(_0x5405bc,null))[_0x1561('0x22')](handleError(_0x5405bc,null));};exports[_0x1561('0x8c')]=function(_0x5282b0,_0x47c93a){_0x5282b0[_0x1561('0x77')][_0x1561('0x8d')]=_0x5282b0['file']['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x5282b0[_0x1561('0x6c')]['id']}})[_0x1561('0x17')](handleEntityNotFound(_0x47c93a,null))[_0x1561('0x17')](saveUpdates(_0x5282b0[_0x1561('0x77')],null))[_0x1561('0x17')](respondWithResult(_0x47c93a,null))[_0x1561('0x22')](handleError(_0x47c93a,null));};exports[_0x1561('0x8e')]=function(_0x33fe37,_0x17d3a5){_0x33fe37['body'][_0x1561('0x8f')]=_0x33fe37[_0x1561('0x88')][_0x1561('0x89')];return db[_0x1561('0x69')]['find']({'where':{'id':_0x33fe37['params']['id']}})[_0x1561('0x17')](handleEntityNotFound(_0x17d3a5,null))[_0x1561('0x17')](saveUpdates(_0x33fe37[_0x1561('0x77')],null))[_0x1561('0x17')](respondWithResult(_0x17d3a5,null))[_0x1561('0x22')](handleError(_0x17d3a5,null));};exports[_0x1561('0x90')]=function(_0x494ee7,_0xc79403){var _0x192e78=path[_0x1561('0x91')](config[_0x1561('0x92')],'server/files/images/logos/default_logo.svg');var _0x2dcb71={'where':{'id':_0x494ee7[_0x1561('0x6c')]['id']},'attributes':['id',_0x1561('0x87')],'raw':!![]};var _0x4e4565=![];return require(_0x1561('0x93'))[_0x1561('0x94')]()[_0x1561('0x17')](function(_0x1ab77e){if(_0x1ab77e){_0x4e4565=_0x1ab77e[_0x1561('0x95')];}})['then'](function(){return db[_0x1561('0x69')][_0x1561('0x6f')](_0x2dcb71);})[_0x1561('0x17')](handleEntityNotFound(_0xc79403,null))[_0x1561('0x17')](function(_0x55e0fd){if(_0x55e0fd){if(!_[_0x1561('0x96')](_0x55e0fd[_0x1561('0x87')])){if(fs[_0x1561('0x97')](path[_0x1561('0x91')](config[_0x1561('0x92')],_0x1561('0x98'),_0x55e0fd[_0x1561('0x87')]))&&_0x4e4565){_0x192e78=path[_0x1561('0x91')](config['root'],_0x1561('0x98'),_0x55e0fd[_0x1561('0x87')]);}}return _0xc79403[_0x1561('0x99')](_0x192e78);}})[_0x1561('0x22')](handleError(_0xc79403,null));};exports[_0x1561('0x9a')]=function(_0x33b318,_0x5cbce0){var _0x23e0d8=path[_0x1561('0x91')](config[_0x1561('0x92')],'server/files/images/avatars/default_avatar.png');var _0x400859={'where':{'id':_0x33b318['params']['id']},'attributes':['id',_0x1561('0x8b')],'raw':!![]};return db[_0x1561('0x69')][_0x1561('0x6f')](_0x400859)[_0x1561('0x17')](handleEntityNotFound(_0x5cbce0,null))[_0x1561('0x17')](function(_0x34c621){if(_0x34c621){if(!_[_0x1561('0x96')](_0x34c621[_0x1561('0x8b')])){if(fs[_0x1561('0x97')](path[_0x1561('0x91')](config['root'],'server/files/images/avatars/',_0x34c621['agentAvatar']))){_0x23e0d8=path[_0x1561('0x91')](config['root'],'server/files/images/avatars/',_0x34c621[_0x1561('0x8b')]);}}return _0x5cbce0[_0x1561('0x99')](_0x23e0d8);}})['catch'](handleError(_0x5cbce0,null));};exports['getCustomerAvatar']=function(_0x2e99f8,_0x206df1){var _0x10fc33=path[_0x1561('0x91')](config[_0x1561('0x92')],'server/files/images/avatars/customer_avatar.png');var _0x162af2={'where':{'id':_0x2e99f8[_0x1561('0x6c')]['id']},'attributes':['id',_0x1561('0x8d'),_0x1561('0x9b')],'raw':!![]};return db[_0x1561('0x69')]['find'](_0x162af2)['then'](handleEntityNotFound(_0x206df1,null))[_0x1561('0x17')](function(_0x3d9a95){if(_0x3d9a95){if(!_['isNil'](_0x3d9a95[_0x1561('0x8d')])){if(fs[_0x1561('0x97')](path[_0x1561('0x91')](config[_0x1561('0x92')],_0x1561('0x9c'),_0x3d9a95[_0x1561('0x8d')]))&&_0x3d9a95[_0x1561('0x9b')]){_0x10fc33=path[_0x1561('0x91')](config[_0x1561('0x92')],'server/files/images/avatars/',_0x3d9a95[_0x1561('0x8d')]);}}return _0x206df1[_0x1561('0x99')](_0x10fc33);}})[_0x1561('0x22')](handleError(_0x206df1,null));};exports['getSystemAvatar']=function(_0x1fc423,_0x9b9863){var _0x46ee01=path[_0x1561('0x91')](config[_0x1561('0x92')],'server/files/images/avatars/system_avatar.png');var _0x58aaf5={'where':{'id':_0x1fc423[_0x1561('0x6c')]['id']},'attributes':['id',_0x1561('0x8f')],'raw':!![]};return db[_0x1561('0x69')]['find'](_0x58aaf5)['then'](handleEntityNotFound(_0x9b9863,null))['then'](function(_0x2885e0){if(_0x2885e0){if(!_[_0x1561('0x96')](_0x2885e0[_0x1561('0x8f')])){if(fs[_0x1561('0x97')](path[_0x1561('0x91')](config[_0x1561('0x92')],_0x1561('0x9c'),_0x2885e0[_0x1561('0x8f')]))){_0x46ee01=path[_0x1561('0x91')](config[_0x1561('0x92')],_0x1561('0x9c'),_0x2885e0[_0x1561('0x8f')]);}}return _0x9b9863['download'](_0x46ee01);}})[_0x1561('0x22')](handleError(_0x9b9863,null));};exports[_0x1561('0x9d')]=function(_0x2ff53c,_0xdcac39){var _0x3f3642={'body':_0x2ff53c[_0x1561('0x77')],'channel':'chat'};var _0xfa2a50=[];var _0x95b3ad=[];var _0x548ccd={};var _0x59d7e8=![];return db[_0x1561('0x9e')][_0x1561('0x9f')]()[_0x1561('0x17')](function(_0x20c34a){if(!_0x20c34a){throw new db[(_0x1561('0xa0'))]['ValidationError'](_0x1561('0xa1'));}_0xfa2a50=_['difference'](_['keys'](_0x20c34a),['createdAt',_0x1561('0xa2')]);_0x95b3ad=_[_0x1561('0xa3')](_[_0x1561('0x5c')](_0x20c34a),[_0x1561('0xa4'),_0x1561('0xa2'),_0x1561('0xa5'),_0x1561('0xa6')]);if(_0x2ff53c[_0x1561('0x77')]['id']){delete _0x2ff53c['body']['id'];}if(_[_0x1561('0x96')](_0x2ff53c['body'][_0x1561('0xa7')])){throw new db[(_0x1561('0xa0'))][(_0x1561('0xa8'))](_0x1561('0xa9'));}if(_[_0x1561('0x96')](_0x2ff53c[_0x1561('0x77')][_0x1561('0x77')])||_0x2ff53c['body']['body']===''){throw new db[(_0x1561('0xa0'))][(_0x1561('0xa8'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2ff53c[_0x1561('0x77')][_0x1561('0xaa')])){throw new db[(_0x1561('0xa0'))][(_0x1561('0xa8'))](_0x1561('0xab')+_0x95b3ad);}if(!_[_0x1561('0xac')](_0x95b3ad,_0x2ff53c['body'][_0x1561('0xaa')])){throw new db[(_0x1561('0xa0'))]['ValidationError'](_0x1561('0xad')+_0x95b3ad);}_0x548ccd[_0x2ff53c[_0x1561('0x77')][_0x1561('0xaa')]]=_0x2ff53c['body'][_0x1561('0xa7')];})[_0x1561('0x17')](function(){return db[_0x1561('0x69')][_0x1561('0x6f')]({'where':{'id':_0x2ff53c[_0x1561('0x6c')]['id']},'include':[{'model':db[_0x1561('0xae')],'as':'List','include':[{'model':db[_0x1561('0x9e')],'as':_0x1561('0xaf'),'where':_0x548ccd,'limit':0x1,'order':[[_0x1561('0xa2'),_0x1561('0xb0')]]}]},{'model':db[_0x1561('0xb1')],'as':_0x1561('0xb2')},{'model':db[_0x1561('0x40')],'as':_0x1561('0x40'),'include':[{'model':db[_0x1561('0x40')],'as':'Intervals','attributes':['id',_0x1561('0x37')],'raw':!![]}]}]});})[_0x1561('0x17')](function(_0x1e45c8){if(!_0x1e45c8)throw new APINotFoundError(util[_0x1561('0x35')](_0x1561('0xb3'),_0x2ff53c['params']['id']));if(!_0x1e45c8[_0x1561('0x40')]||!_0x1e45c8[_0x1561('0x40')][_0x1561('0x41')])return[_0x1e45c8,!![]];return[_0x1e45c8,checkWebsiteIntervals(_0x1e45c8)];})[_0x1561('0xb4')](function(_0x1b6008,_0x318ab4){if(!_0x318ab4)throw new APIOutOfIntervalError();if(!_0x1b6008[_0x1561('0xb5')])return;_0x3f3642['account']=_0x1b6008;_0x3f3642['list']=_0x1b6008[_0x1561('0xb5')];_0x3f3642[_0x1561('0xb6')]=_[_0x1561('0xb7')](_0x1b6008[_0x1561('0xb2')],[_0x1561('0xb8')],[_0x1561('0xb9')]);if(_0x3f3642[_0x1561('0xba')]['Applications']){delete _0x3f3642['account']['Applications'];}if(_0x3f3642['account'][_0x1561('0xb5')]&&_0x3f3642[_0x1561('0xba')][_0x1561('0xb5')][_0x1561('0xaf')]['length']){return _0x3f3642['account'][_0x1561('0xb5')][_0x1561('0xaf')][0x0];}var _0x9ba11c=_[_0x1561('0xf')](_0x2ff53c[_0x1561('0x77')],{'firstName':_0x2ff53c[_0x1561('0x77')]['from'],'ListId':_0x1b6008[_0x1561('0xa6')]});_0x9ba11c[_0x2ff53c[_0x1561('0x77')][_0x1561('0xaa')]]=_0x2ff53c[_0x1561('0x77')]['from'];return db[_0x1561('0x9e')]['create'](_0x9ba11c,{'fields':_0xfa2a50,'raw':!![]});})[_0x1561('0x17')](function(_0x11716f){_0x3f3642[_0x1561('0xbb')]=_0x11716f;var _0x43c516=createInteractionObject(_0x2ff53c['params']['id'],_0x2ff53c[_0x1561('0x77')],_0x2ff53c[_0x1561('0xbc')],_0x11716f);var _0x47f469={'ChatWebsiteId':_0x2ff53c[_0x1561('0x6c')]['id'],'closed':![]};if(_0x2ff53c[_0x1561('0x77')][_0x1561('0xbd')]){_0x47f469[_0x1561('0xbd')]=_0x2ff53c[_0x1561('0x77')][_0x1561('0xbd')];return db[_0x1561('0xbe')][_0x1561('0x6f')]({'where':_0x47f469})[_0x1561('0x17')](function(_0x1cfabd){if(_0x1cfabd){_0x59d7e8=!![];return _0x1cfabd;}_0x43c516['threadId']=_0x2ff53c[_0x1561('0x77')][_0x1561('0xbd')];_0x43c516['externalUrl']=_0x2ff53c['body'][_0x1561('0xbf')];return db[_0x1561('0xbe')]['create'](_0x43c516);});}_0x47f469['ContactId']=_0x11716f['id'];if(_0x2ff53c[_0x1561('0x77')]['interaction']&&_0x2ff53c['body'][_0x1561('0xc0')]['id']){_0x47f469['id']=_0x2ff53c[_0x1561('0x77')][_0x1561('0xc0')]['id'];return db[_0x1561('0xbe')][_0x1561('0x6f')]({'where':_0x47f469})[_0x1561('0x17')](function(_0x59b465){if(_0x59b465){_0x59d7e8=!![];return _0x59b465;}return db[_0x1561('0xbe')]['create'](_0x43c516);});}return db['ChatInteraction']['create'](_0x43c516);})[_0x1561('0x17')](function(_0x4bfe55){if(!_0x59d7e8)return _0x4bfe55;var _0x4144b4={'from':(_0x3f3642[_0x1561('0xbb')][_0x1561('0x4c')]||'')+'\x20'+(_0x3f3642['contact'][_0x1561('0x4d')]||'')};if(_0x2ff53c[_0x1561('0x77')][_0x1561('0xbd')]&&_0x2ff53c[_0x1561('0x77')][_0x1561('0xc1')]&&_0x2ff53c['body']['threadId']!=_0x2ff53c[_0x1561('0x77')][_0x1561('0xc1')]){_0x4144b4[_0x1561('0xbd')]=_0x2ff53c['body'][_0x1561('0xc1')];}return _0x4bfe55[_0x1561('0x2c')](_0x4144b4);})[_0x1561('0x17')](function(_0x43537d){_0x3f3642[_0x1561('0xc0')]=_0x43537d[_0x1561('0x42')]({'plain':!![]});_0x3f3642['interaction'][_0x1561('0xc2')]=!_0x59d7e8;if(_0x3f3642[_0x1561('0xc0')][_0x1561('0xc2')]){if(_0x3f3642[_0x1561('0xba')][_0x1561('0xc3')]){_0x3f3642[_0x1561('0xb6')][_0x1561('0xc4')]({'id':0x0,'priority':_0x3f3642[_0x1561('0xb6')][_0x1561('0x61')]+0x1,'app':'close','appdata':_0x1561('0xc5'),'interval':_0x1561('0xc6')});}}return db[_0x1561('0xc7')]['create']({'body':_0x2ff53c['body'][_0x1561('0x77')],'ChatWebsiteId':_0x2ff53c[_0x1561('0x6c')]['id'],'ChatInteractionId':_0x43537d['id'],'direction':'in','ContactId':_0x3f3642[_0x1561('0xbb')]['id'],'AttachmentId':_0x2ff53c[_0x1561('0x77')][_0x1561('0xc8')]});})['then'](function(_0x355b79){_0x3f3642['message']=_0x355b79;if(!_0x3f3642['interaction']['UserId']){return;}return db[_0x1561('0xc9')][_0x1561('0x6f')]({'attributes':['id',_0x1561('0x31')],'where':{'id':_0x3f3642[_0x1561('0xc0')][_0x1561('0xca')]}});})[_0x1561('0x17')](function(_0x487526){if(_0x487526){_0x3f3642[_0x1561('0xb6')][_0x1561('0xcb')]({'id':0x0,'priority':0x0,'app':_0x1561('0xcc'),'appdata':_0x487526['name']+','+(_0x3f3642['account'][_0x1561('0xcd')]||0xa),'interval':'*,*,*,*'});_0x3f3642[_0x1561('0xce')]=!![];}if(!_0x3f3642[_0x1561('0xc0')][_0x1561('0xcf')]){return;}return db['ChatQueue'][_0x1561('0x6f')]({'attributes':['id',_0x1561('0x31')],'where':{'id':_0x3f3642[_0x1561('0xc0')][_0x1561('0xcf')]}});})[_0x1561('0x17')](function(_0x14d5a9){if(_0x14d5a9){_0x3f3642['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0x1561('0xd0'),'appdata':_0x14d5a9[_0x1561('0x31')]+','+(_0x3f3642[_0x1561('0xba')][_0x1561('0xd1')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x1561('0xd2'),_0x1561('0xd3'),_0x3f3642);})[_0x1561('0x17')](function(_0x344b52){respondWithRpcPromise(_0x1561('0xd4'),_0x1561('0xd4'),{'event':'notify','message':_0x344b52},client9002);return _0x344b52;})[_0x1561('0x17')](respondWithResult(_0xdcac39,null))[_0x1561('0x22')](APIHandleError(_0xdcac39));};exports[_0x1561('0xd5')]=function(_0x57f605,_0x33fc53){var _0x303c43,_0x144ffa,_0x1c15e9;var _0x888327=[];var _0x5b89b6={};var _0x4c1885=_0x57f605[_0x1561('0xd6')]||[];var _0x3dd49e=[];var _0x1dccb9;return db[_0x1561('0x9e')][_0x1561('0x9f')]()[_0x1561('0x17')](function(_0x229ebe){if(!_0x229ebe){throw new db[(_0x1561('0xa0'))][(_0x1561('0xa8'))](_0x1561('0xa1'));}_0x888327=_[_0x1561('0xa3')](_[_0x1561('0x5c')](_0x229ebe),['createdAt',_0x1561('0xa2'),_0x1561('0xa5'),_0x1561('0xa6')]);if(_0x57f605[_0x1561('0x77')]['id']){delete _0x57f605[_0x1561('0x77')]['id'];}if(_[_0x1561('0x96')](_0x57f605['body'][_0x1561('0xa7')])){throw _0x33fc53[_0x1561('0x24')](0x1f4)[_0x1561('0x32')](new db[(_0x1561('0xa0'))][(_0x1561('0xa8'))](_0x1561('0xa9')));}if(_[_0x1561('0x96')](_0x57f605[_0x1561('0x77')][_0x1561('0x77')])||_0x57f605[_0x1561('0x77')][_0x1561('0x77')]===''){throw _0x33fc53[_0x1561('0x24')](0x1f4)[_0x1561('0x32')](new db['Sequelize'][(_0x1561('0xa8'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x57f605[_0x1561('0x77')][_0x1561('0xd7')])){throw _0x33fc53[_0x1561('0x24')](0x1f4)[_0x1561('0x32')](new db[(_0x1561('0xa0'))]['ValidationError'](_0x1561('0xd8')+_0x888327));}if(!_[_0x1561('0xac')](_0x888327,_0x57f605['body'][_0x1561('0xd7')])){throw _0x33fc53['status'](0x1f4)[_0x1561('0x32')](new db[(_0x1561('0xa0'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x888327));}_0x5b89b6[_0x57f605['body'][_0x1561('0xd7')]]=_0x57f605['body'][_0x1561('0xa7')];})[_0x1561('0x17')](function(){return db[_0x1561('0x69')][_0x1561('0x6f')]({'where':{'id':_0x57f605['params']['id']},'include':[{'model':db['CmList'],'as':_0x1561('0xb5')},{'model':db[_0x1561('0xd9')],'as':_0x1561('0xd9')}]});})[_0x1561('0x17')](handleEntityNotFound(_0x33fc53,null))[_0x1561('0x17')](function(_0x25d8f9){if(_0x25d8f9&&_0x25d8f9['List']){_0x144ffa=_0x25d8f9;var _0x13a3e7=_[_0x1561('0xf')](_0x57f605['body'],{'firstName':_0x57f605[_0x1561('0x77')][_0x1561('0xa7')],'phone':_0x57f605[_0x1561('0x77')]['from'],'ListId':_0x25d8f9[_0x1561('0xa6')]});_0x13a3e7[_0x57f605['body'][_0x1561('0xd7')]]=_0x57f605[_0x1561('0x77')][_0x1561('0xa7')];return db[_0x1561('0x9e')][_0x1561('0xda')]({'where':_0x5b89b6,'defaults':_0x13a3e7});}})[_0x1561('0xb4')](function(_0x1d9548){if(_0x1d9548){_0x1c15e9=_0x1d9548;var _0x48bf6d=fs[_0x1561('0xdb')](path['join'](config['root'],_0x1561('0xdc')),'utf8');var _0x109f59=ejs[_0x1561('0xdd')](_0x48bf6d,{'body':_[_0x1561('0xde')](_0x57f605['body'][_0x1561('0x77')]),'bodyTitle':_0x144ffa[_0x1561('0xdf')]});return db[_0x1561('0xe0')][_0x1561('0x70')]({'body':_0x109f59,'plainBody':htmlToText[_0x1561('0xe1')](_0x109f59),'ContactId':_0x1d9548['id'],'ChatWebsiteId':_0x144ffa['id']});}})['then'](function(_0x3bdd05){_0x1dccb9=_0x3bdd05;if(_0x4c1885['length']){var _0x100ece=_0x4c1885[_0x1561('0x3f')](function(_0x59ed43){return{'name':_0x59ed43[_0x1561('0xe2')],'basename':_0x59ed43[_0x1561('0x89')],'type':_0x59ed43[_0x1561('0xe3')],'ChatOfflineMessageId':_0x3bdd05['id']};});_0x3dd49e=_0x100ece[_0x1561('0x3f')](_0x2e1210=>{var _0x1ba24d={'filename':_0x2e1210['name'],'path':path[_0x1561('0x91')](config[_0x1561('0x92')],_0x1561('0xe4'),'files',_0x1561('0xe5'),_0x1561('0xe6'),_0x2e1210['basename'])};return _0x1ba24d;});if(!_0x144ffa[_0x1561('0xe7')]){return db[_0x1561('0xe8')][_0x1561('0xe9')](function(_0x1a5258){return db[_0x1561('0xea')][_0x1561('0xeb')](_0x100ece,{'transaction':_0x1a5258});});}}})[_0x1561('0x17')](function(){if(_0x1dccb9){_0x303c43=_0x1dccb9;return db[_0x1561('0xd9')][_0x1561('0x7a')]({'where':{'service':!![]},'include':[{'model':db[_0x1561('0xec')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x1561('0xed')],'as':_0x1561('0xed'),'raw':!![]}]}]});}})[_0x1561('0x17')](function(_0x2b44cc){if(_0x2b44cc&&_0x2b44cc['Smtp']&&_0x144ffa['forwardOffline']&&_0x144ffa[_0x1561('0xee')]){var _0x52eb8c=_0x2b44cc[_0x1561('0xef')]();return respondWithRpcPromise(_0x1561('0xf0'),'sendMail',{'account':_0x52eb8c,'message':{'from':util[_0x1561('0x35')]('\x22%s\x22\x20<%s>',_0x2b44cc[_0x1561('0x31')],_0x2b44cc[_0x1561('0xf1')]||_0x2b44cc[_0x1561('0xf2')]['user']),'to':_0x144ffa[_0x1561('0xee')],'subject':_0x144ffa[_0x1561('0xf3')],'html':_0x303c43[_0x1561('0x77')],'attachments':_0x3dd49e}},client9003)[_0x1561('0x17')](function(){return _0x303c43;})[_0x1561('0x22')](function(_0xa67f15){logger[_0x1561('0x1d')](_0xa67f15);});}})[_0x1561('0x17')](function(){if(_0x144ffa&&_0x144ffa[_0x1561('0xe7')]&&_0x144ffa[_0x1561('0xf4')]){var _0x38329b=[];if(_0x4c1885[_0x1561('0x61')]){_0x38329b=_0x4c1885[_0x1561('0x3f')](function(_0x15bf97){return{'name':_0x15bf97[_0x1561('0xe2')],'basename':_0x15bf97[_0x1561('0x89')],'type':_0x15bf97[_0x1561('0xe3')],'ChatOfflineMessageId':_0x1dccb9['id']};});}var _0x3530f8;if(!_[_0x1561('0x96')](_0x144ffa[_0x1561('0xf5')])){var _0x4ea266=_[_0x1561('0x3f')](_0x57f605[_0x1561('0x77')],function(_0x2f52b5){return _0x2f52b5;});var _0x24c71f=_['toPairsIn'](_0x4ea266)[0x0];var _0x4364e9=_[_0x1561('0xf6')](_0x24c71f,function(_0x1bdbdd){return _0x1bdbdd;});_0x3530f8=_0x4364e9[0x1][_0x144ffa['subjectOffline']];}var _0x4b03c6={'from':_0x1c15e9[_0x1561('0xf1')],'firstName':_0x1c15e9[_0x1561('0x4c')],'lastName':_0x1c15e9['lastName'],'mapKey':_0x1561('0xf1'),'message':{'from':_0x1c15e9[_0x1561('0xf1')],'to':_0x144ffa['MailAccount'][_0x1561('0xf1')],'cc':'','subject':_['isNil'](_0x3530f8)?_0x144ffa[_0x1561('0xf3')]:_0x3530f8,'messageId':'','sentAt':new Date(),'attach':_0x38329b[_0x1561('0x61')],'attachments':_0x38329b,'originChannel':_0x1561('0xf7'),'ChatWebsiteId':_0x144ffa['id'],'ChatOfflineMessageId':_0x303c43['id'],'originTo':_0x144ffa[_0x1561('0xd9')]['email']},'body':_0x303c43[_0x1561('0x77')]};var _0x52a961={'account':{'id':_0x144ffa[_0x1561('0xf4')]},'body':_0x4b03c6,'log':_0x1561('0xf8')};return respondWithRpcPromise(_0x1561('0xf8'),'notifyMail',_0x52a961,client9001)[_0x1561('0x17')](function(){return _0x303c43;})[_0x1561('0x22')](function(_0x4859e6){logger[_0x1561('0x1d')](_0x4859e6);});}return;})[_0x1561('0x17')](function(){if(_0x303c43){return _0x303c43;}})[_0x1561('0x17')](respondWithResult(_0x33fc53,null))[_0x1561('0x22')](function(){for(var _0x31c465 of _0x4c1885){var _0x2108d0=path[_0x1561('0x91')](config[_0x1561('0x92')],_0x1561('0xe4'),_0x1561('0xd6'),_0x1561('0xe5'),_0x1561('0xe6'),_0x31c465[_0x1561('0x89')]);fs_extra['remove'](_0x2108d0)[_0x1561('0x22')](function(_0x316b0c){logger[_0x1561('0x1d')](_0x1561('0xf9'),_0x2108d0,_0x316b0c);});}});};exports[_0x1561('0xfa')]=function(_0x3388a3,_0x533113){return db[_0x1561('0xbe')][_0x1561('0x6f')]({'where':{'id':_0x3388a3['params']['id']}})[_0x1561('0x17')](handleEntityNotFound(_0x533113,null))[_0x1561('0x17')](function(_0x59619a){if(_0x59619a){return _0x59619a[_0x1561('0xfa')](_0x3388a3['body'][_0x1561('0x85')],_['omit'](_0x3388a3[_0x1561('0x77')],[_0x1561('0x85'),'id'])||{});}})[_0x1561('0x17')](respondWithResult(_0x533113,null))['catch'](handleError(_0x533113,null));};exports['getInteractions']=function(_0x4af397,_0x326da2){var _0x1d0707={'raw':![],'where':{}};var _0x7fc646={};var _0x420dfb={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1561('0x7a')]({'where':{'id':_0x4af397[_0x1561('0x6c')]['id']}})[_0x1561('0x17')](handleEntityNotFound(_0x326da2,null))[_0x1561('0x17')](function(_0x33cd80){if(_0x33cd80){_0x7fc646[_0x1561('0x54')]=_[_0x1561('0x5c')](db[_0x1561('0xbe')][_0x1561('0x59')]);_0x7fc646['query']=_['keys'](_0x4af397[_0x1561('0x5b')]);_0x7fc646[_0x1561('0x5d')]=_[_0x1561('0x5e')](_0x7fc646[_0x1561('0x54')],_0x7fc646['query']);_0x1d0707[_0x1561('0x60')]=_[_0x1561('0x5e')](_0x7fc646[_0x1561('0x54')],qs[_0x1561('0x5f')](_0x4af397['query'][_0x1561('0x5f')]));_0x1d0707[_0x1561('0x60')]=_0x1d0707[_0x1561('0x60')][_0x1561('0x61')]?_0x1d0707[_0x1561('0x60')]:_0x7fc646[_0x1561('0x54')];if(!_0x4af397[_0x1561('0x5b')][_0x1561('0x62')](_0x1561('0x83'))){_0x1d0707[_0x1561('0x29')]=qs[_0x1561('0x29')](_0x4af397[_0x1561('0x5b')][_0x1561('0x29')]);_0x1d0707[_0x1561('0x27')]=qs['offset'](_0x4af397[_0x1561('0x5b')][_0x1561('0x27')]);}_0x1d0707['order']=qs[_0x1561('0x7b')](_0x4af397[_0x1561('0x5b')][_0x1561('0x7b')]);_0x1d0707[_0x1561('0x66')]=qs[_0x1561('0x5d')](_[_0x1561('0x64')](_0x4af397['query'],_0x7fc646['filters']));_0x1d0707[_0x1561('0x66')][_0x1561('0x7c')]=_0x33cd80['id'];if(_0x4af397[_0x1561('0x5b')][_0x1561('0x65')]){_0x1d0707['where']=_[_0x1561('0x67')](_0x1d0707['where'],{'$or':_[_0x1561('0x3f')](_0x1d0707[_0x1561('0x60')],function(_0xe7fdf9){var _0x311bd1={};_0x311bd1[_0xe7fdf9]={'$like':'%'+_0x4af397[_0x1561('0x5b')][_0x1561('0x65')]+'%'};return _0x311bd1;})});}_0x1d0707=_[_0x1561('0x67')]({},_0x1d0707,_0x4af397[_0x1561('0x68')]);return db[_0x1561('0xbe')][_0x1561('0x2a')]({'where':_0x1d0707['where']})[_0x1561('0x17')](function(_0x4c4913){_0x420dfb[_0x1561('0x2a')]=_0x4c4913;if(_0x4af397[_0x1561('0x5b')][_0x1561('0x6a')]){_0x1d0707[_0x1561('0x6e')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x1561('0xc9')],'as':'Owner','attributes':[_0x1561('0x31'),_0x1561('0xfb'),'internal'],'required':![]},{'model':db[_0x1561('0xfc')],'as':_0x1561('0xfd'),'attributes':['id',_0x1561('0x31'),_0x1561('0xfe')],'where':_0x4af397[_0x1561('0x5b')][_0x1561('0xff')]?{'id':_0x4af397[_0x1561('0x5b')]['tag']}:undefined,'required':_0x4af397['query'][_0x1561('0xff')]?!![]:![]}];}return db[_0x1561('0xbe')][_0x1561('0x6b')](_0x1d0707);})[_0x1561('0x17')](function(_0xbb4a14){_0x420dfb[_0x1561('0x7e')]=_0xbb4a14;return _0x420dfb;});}})[_0x1561('0x17')](respondWithFilteredResult(_0x326da2,_0x1d0707))[_0x1561('0x22')](handleError(_0x326da2,null));};exports[_0x1561('0x100')]=function(_0x290042,_0x53cc1b){var _0x4a06a3=0x0;var _0x2a8ecf=0x0;var _0x2d7223=![];var _0x6fb213;var _0x5d7afe;return db['ChatWebsite'][_0x1561('0x6f')]({'where':{'id':_0x290042['params']['id']},'include':[{'model':db[_0x1561('0x40')],'as':_0x1561('0x40'),'include':[{'model':db['Interval'],'as':_0x1561('0x41'),'attributes':['id',_0x1561('0x37')]}]}]})['then'](handleEntityNotFound(_0x53cc1b,null))['then'](function(_0x552415){if(_0x552415){_0x6fb213=_0x552415;return _0x552415[_0x1561('0x101')]({'raw':!![]});}})['then'](function(_0x527177){if(_0x6fb213){if(_0x527177){_0x5d7afe=_0x527177;}}return require(_0x1561('0x93'))[_0x1561('0x94')]();})[_0x1561('0x17')](function(_0x58acdd){if(_0x58acdd){_0x2a8ecf=_0x58acdd[_0x1561('0x102')];_0x2d7223=_0x58acdd[_0x1561('0x95')];}})['then'](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})['then'](function(_0x10eb0c){_0x4a06a3=_0x10eb0c;if(_0x2a8ecf&&_0x10eb0c>_0x2a8ecf){return db[_0x1561('0x103')][_0x1561('0x7a')]({'where':{'id':0x1}})['then'](function(_0x5e3cb9){if(_0x5e3cb9){_0x5e3cb9[_0x1561('0x104')](_0x1561('0x105'));}});}})[_0x1561('0x17')](function(){if(!_0x6fb213[_0x1561('0x40')]||!_0x6fb213[_0x1561('0x40')]['Intervals'])return!![];return checkWebsiteIntervals(_0x6fb213);})['then'](function(_0x44f1aa){var _0xce3ca8=fs[_0x1561('0xdb')](path[_0x1561('0x91')](config['root'],'server/files/chat/iframe.ejs'),'utf8');var _0x4f49aa=new url[(_0x1561('0x106'))](_0x6fb213[_0x1561('0x107')])['origin'];var _0x1e21a6='3.5.0';var _0x6cfa1=![];var _0x476c34={'chatVersion':_0x1e21a6,'chatWebsiteAddressOrigin':_0x4f49aa,'remote':_0x6fb213[_0x1561('0x108')],'query':querystring[_0x1561('0x1c')](_['merge'](_0x6fb213[_0x1561('0x42')]({'plain':!![]}),{'customerIp':_0x290042[_0x1561('0xbc')]['x-forwarded-for']||_0x290042['headers'][_0x1561('0x109')]||_0x290042[_0x1561('0x10a')]['remoteAddress']||_0x290042['ip'],'referer':_0x290042[_0x1561('0xbc')][_0x1561('0x10b')],'openedInteractions':_0x4a06a3,'maxInteractions':_0x2a8ecf,'virtual':_0x2d7223[_0x1561('0x102')],'online':_0x44f1aa,'custom':_0x2d7223}))['replace'](/'/g,'\x5c\x27')};_0x53cc1b[_0x1561('0x32')](ejs[_0x1561('0xdd')](Mustache[_0x1561('0xdd')](_0xce3ca8,_0x476c34),{'proactiveActions':_0x5d7afe,'alignment':_0x6fb213[_0x1561('0x10c')],'verticalAlignment':_0x6fb213[_0x1561('0x10d')],'div_color':_0x6fb213['color'],'labelText':_0x6fb213[_0x1561('0x10e')],'text_color':_0x6fb213[_0x1561('0x10f')],'text_button_color':_0x6fb213[_0x1561('0x110')],'button_color':_0x6fb213[_0x1561('0x111')],'background_color':_0x6fb213[_0x1561('0x112')],'hideWhenOffline':_0x6fb213[_0x1561('0x113')],'intervalId':_0x6fb213[_0x1561('0x114')],'isDevelopment':_0x6cfa1,'chatVersion':_0x1e21a6}));})[_0x1561('0x22')](handleError(_0x53cc1b,null));};exports[_0x1561('0x115')]=function(_0x326614,_0x2e0575){var _0x346693=_0x326614[_0x1561('0x6c')]['id'];var _0x2d6cf9=_0x326614[_0x1561('0x77')];var _0x5354f5=0xc8;var _0x65cd36=null;return db[_0x1561('0xe8')][_0x1561('0xe9')]({'isolationLevel':db['sequelize'][_0x1561('0x116')][_0x1561('0x117')][_0x1561('0x118')]},function(_0x2dec8f){return db['ChatWebsite'][_0x1561('0x7a')]({'where':{'id':_0x346693},'transaction':_0x2dec8f})['then'](function(_0x116b22){if(_0x116b22){return db[_0x1561('0xb1')][_0x1561('0x2f')]({'where':{'ChatWebsiteId':_0x346693},'transaction':_0x2dec8f})[_0x1561('0x17')](function(){var _0x2be6a4=_[_0x1561('0x3f')](_0x2d6cf9,function(_0x449a01){_0x449a01[_0x1561('0x7c')]=_0x346693;return _0x449a01;});return db[_0x1561('0xb1')][_0x1561('0xeb')](_0x2be6a4,{'transaction':_0x2dec8f});});}else{_0x5354f5=0x194;_0x65cd36=[];}});})[_0x1561('0x17')](function(){if(_0x5354f5!==0x194){return db['ChatApplication'][_0x1561('0x119')]({'where':{'ChatWebsiteId':_0x346693},'order':'priority'})['then'](function(_0x3eb9b5){_0x65cd36=_0x3eb9b5;});}})[_0x1561('0x22')](function(_0x1484eb){_0x5354f5=0x1f4;logger[_0x1561('0x1d')](_0x1484eb[_0x1561('0x30')]);if(_0x1484eb[_0x1561('0x31')]){delete _0x1484eb[_0x1561('0x31')];}_0x65cd36=_0x1484eb;})[_0x1561('0x11a')](function(){if(_0x65cd36===null){_0x2e0575[_0x1561('0x23')](_0x5354f5);}else{if(_0x5354f5===0x1f4){_0x2e0575['status'](_0x5354f5)['send'](_0x65cd36);}else{_0x2e0575[_0x1561('0x24')](_0x5354f5)[_0x1561('0x26')](_0x65cd36);}}});};exports['getApplications']=function(_0x46c063,_0x351a8b){var _0x5a85c8={};var _0x150ea2={};var _0x3af1e9;var _0x32e464;return db[_0x1561('0x69')][_0x1561('0x7a')]({'where':{'id':_0x46c063[_0x1561('0x6c')]['id']}})[_0x1561('0x17')](handleEntityNotFound(_0x351a8b,null))['then'](function(_0x68bd68){if(_0x68bd68){_0x3af1e9=_0x68bd68;_0x150ea2[_0x1561('0x54')]=_[_0x1561('0x5c')](db[_0x1561('0xb1')]['rawAttributes']);_0x150ea2[_0x1561('0x5b')]=_[_0x1561('0x5c')](_0x46c063[_0x1561('0x5b')]);_0x150ea2[_0x1561('0x5d')]=_['intersection'](_0x150ea2['model'],_0x150ea2[_0x1561('0x5b')]);_0x5a85c8[_0x1561('0x60')]=_[_0x1561('0x5e')](_0x150ea2[_0x1561('0x54')],qs[_0x1561('0x5f')](_0x46c063[_0x1561('0x5b')][_0x1561('0x5f')]));_0x5a85c8[_0x1561('0x60')]=_0x5a85c8[_0x1561('0x60')][_0x1561('0x61')]?_0x5a85c8[_0x1561('0x60')]:_0x150ea2[_0x1561('0x54')];_0x5a85c8[_0x1561('0x63')]=qs[_0x1561('0x7b')](_0x46c063['query']['sort']);_0x5a85c8[_0x1561('0x66')]=qs[_0x1561('0x5d')](_['pick'](_0x46c063[_0x1561('0x5b')],_0x150ea2[_0x1561('0x5d')]));if(_0x46c063[_0x1561('0x5b')][_0x1561('0x65')]){_0x5a85c8['where']=_[_0x1561('0x67')](_0x5a85c8['where'],{'$or':_[_0x1561('0x3f')](_0x5a85c8['attributes'],function(_0x91e005){var _0x2048c7={};_0x2048c7[_0x91e005]={'$like':'%'+_0x46c063['query'][_0x1561('0x65')]+'%'};return _0x2048c7;})});}_0x5a85c8=_[_0x1561('0x67')]({},_0x5a85c8,_0x46c063[_0x1561('0x68')]);return _0x3af1e9[_0x1561('0x11b')](_0x5a85c8);}})[_0x1561('0x17')](function(_0x464f34){if(_0x464f34){_0x32e464=_0x464f34[_0x1561('0x61')];if(!_0x46c063['query']['hasOwnProperty']('nolimit')){_0x5a85c8['limit']=qs['limit'](_0x46c063[_0x1561('0x5b')][_0x1561('0x29')]);_0x5a85c8[_0x1561('0x27')]=qs[_0x1561('0x27')](_0x46c063[_0x1561('0x5b')][_0x1561('0x27')]);}return _0x3af1e9[_0x1561('0x11b')](_0x5a85c8);}})[_0x1561('0x17')](function(_0x1846d1){if(_0x1846d1){return _0x1846d1?{'count':_0x32e464,'rows':_0x1846d1}:null;}})[_0x1561('0x17')](respondWithResult(_0x351a8b,null))[_0x1561('0x22')](handleError(_0x351a8b,null));};exports['addProactiveActions']=function(_0x48d72e,_0x3edc49){return db['chatProactiveAction'][_0x1561('0x6f')]({'where':{'id':_0x48d72e['params']['id']}})[_0x1561('0x17')](handleEntityNotFound(_0x3edc49,null))['then'](function(_0x5eaa93){if(_0x5eaa93){return _0x5eaa93[_0x1561('0x11c')](_0x48d72e[_0x1561('0x77')][_0x1561('0x85')],_['omit'](_0x48d72e[_0x1561('0x77')],[_0x1561('0x85'),'id'])||{});}})['then'](respondWithResult(_0x3edc49,null))[_0x1561('0x22')](handleError(_0x3edc49,null));};exports[_0x1561('0x101')]=function(_0x368cda,_0x15d78e){var _0x5d8a7c={};var _0x117297={};var _0x26876d;var _0x156145;return db[_0x1561('0x69')][_0x1561('0x7a')]({'where':{'id':_0x368cda[_0x1561('0x6c')]['id']}})[_0x1561('0x17')](handleEntityNotFound(_0x15d78e,null))[_0x1561('0x17')](function(_0x301e17){if(_0x301e17){_0x26876d=_0x301e17;_0x117297[_0x1561('0x54')]=_[_0x1561('0x5c')](db[_0x1561('0x11d')]['rawAttributes']);_0x117297[_0x1561('0x5b')]=_[_0x1561('0x5c')](_0x368cda[_0x1561('0x5b')]);_0x117297[_0x1561('0x5d')]=_['intersection'](_0x117297[_0x1561('0x54')],_0x117297[_0x1561('0x5b')]);_0x5d8a7c[_0x1561('0x60')]=_[_0x1561('0x5e')](_0x117297[_0x1561('0x54')],qs[_0x1561('0x5f')](_0x368cda[_0x1561('0x5b')][_0x1561('0x5f')]));_0x5d8a7c[_0x1561('0x60')]=_0x5d8a7c[_0x1561('0x60')][_0x1561('0x61')]?_0x5d8a7c[_0x1561('0x60')]:_0x117297[_0x1561('0x54')];_0x5d8a7c[_0x1561('0x63')]=qs[_0x1561('0x7b')](_0x368cda[_0x1561('0x5b')][_0x1561('0x7b')]);_0x5d8a7c[_0x1561('0x66')]=qs['filters'](_['pick'](_0x368cda[_0x1561('0x5b')],_0x117297[_0x1561('0x5d')]));if(_0x368cda['query'][_0x1561('0x65')]){_0x5d8a7c[_0x1561('0x66')]=_[_0x1561('0x67')](_0x5d8a7c[_0x1561('0x66')],{'$or':_[_0x1561('0x3f')](_0x5d8a7c[_0x1561('0x60')],function(_0x5e32bd){var _0x4fd881={};_0x4fd881[_0x5e32bd]={'$like':'%'+_0x368cda[_0x1561('0x5b')][_0x1561('0x65')]+'%'};return _0x4fd881;})});}_0x5d8a7c=_[_0x1561('0x67')]({},_0x5d8a7c,_0x368cda[_0x1561('0x68')]);return _0x26876d['getProactiveActions'](_0x5d8a7c);}})[_0x1561('0x17')](function(_0x2df266){if(_0x2df266){_0x156145=_0x2df266[_0x1561('0x61')];if(!_0x368cda[_0x1561('0x5b')]['hasOwnProperty'](_0x1561('0x83'))){_0x5d8a7c[_0x1561('0x29')]=qs['limit'](_0x368cda[_0x1561('0x5b')][_0x1561('0x29')]);_0x5d8a7c[_0x1561('0x27')]=qs['offset'](_0x368cda[_0x1561('0x5b')][_0x1561('0x27')]);}return _0x26876d['getProactiveActions'](_0x5d8a7c);}})[_0x1561('0x17')](function(_0x179c07){if(_0x179c07){return _0x179c07?{'count':_0x156145,'rows':_0x179c07}:null;}})[_0x1561('0x17')](respondWithResult(_0x15d78e,null))['catch'](handleError(_0x15d78e,null));};exports[_0x1561('0x11e')]=function(_0x4cb41c,_0x13f759){var _0x47c714=_0x4cb41c['query']['online']==='false'?_0x1561('0x11f'):'onlineForm';return db[_0x1561('0x69')][_0x1561('0x6f')]({'attributes':['id',_0x47c714],'where':{'id':_0x4cb41c['params']['id']}})[_0x1561('0x17')](handleEntityNotFound(_0x13f759,null))['then'](function(_0x46b060){if(_0x46b060){var _0x30ebe6=_0x46b060[_0x47c714];var _0x25352d=_0x30ebe6&&_0x30ebe6['items']?_0x30ebe6[_0x1561('0x120')]:[];_0x13f759['send']({'fromKey':_['isNil'](_0x30ebe6[_0x1561('0x121')])?undefined:_0x30ebe6[_0x1561('0x121')],'count':_0x25352d[_0x1561('0x61')],'rows':_0x25352d});}})[_0x1561('0x22')](handleError(_0x13f759,null));};exports['getOfflineMessages']=function(_0x4c079c,_0x18006a){var _0x41d00d={'raw':![],'where':{}};var _0x4b360e={};var _0x4b2b5a={'count':0x0,'rows':[]};return db[_0x1561('0x69')][_0x1561('0x7a')]({'where':{'id':_0x4c079c[_0x1561('0x6c')]['id']}})[_0x1561('0x17')](handleEntityNotFound(_0x18006a,null))['then'](function(_0x4557a1){if(_0x4557a1){_0x4b360e[_0x1561('0x54')]=_[_0x1561('0x5c')](db[_0x1561('0xe0')][_0x1561('0x59')]);_0x4b360e[_0x1561('0x5b')]=_['keys'](_0x4c079c[_0x1561('0x5b')]);_0x4b360e['filters']=_[_0x1561('0x5e')](_0x4b360e[_0x1561('0x54')],_0x4b360e[_0x1561('0x5b')]);_0x41d00d[_0x1561('0x60')]=_[_0x1561('0x5e')](_0x4b360e[_0x1561('0x54')],qs[_0x1561('0x5f')](_0x4c079c[_0x1561('0x5b')]['fields']));_0x41d00d[_0x1561('0x60')]=_0x41d00d[_0x1561('0x60')][_0x1561('0x61')]?_0x41d00d[_0x1561('0x60')]:_0x4b360e[_0x1561('0x54')];if(!_0x4c079c['query']['hasOwnProperty'](_0x1561('0x83'))){_0x41d00d[_0x1561('0x29')]=qs[_0x1561('0x29')](_0x4c079c[_0x1561('0x5b')][_0x1561('0x29')]);_0x41d00d[_0x1561('0x27')]=qs[_0x1561('0x27')](_0x4c079c[_0x1561('0x5b')][_0x1561('0x27')]);}_0x41d00d[_0x1561('0x63')]=qs[_0x1561('0x7b')](_0x4c079c['query'][_0x1561('0x7b')]);_0x41d00d[_0x1561('0x66')]=qs[_0x1561('0x5d')](_[_0x1561('0x64')](_0x4c079c[_0x1561('0x5b')],_0x4b360e[_0x1561('0x5d')]));_0x41d00d['where'][_0x1561('0x7c')]=_0x4557a1['id'];if(_0x4c079c[_0x1561('0x5b')]['filter']){_0x41d00d[_0x1561('0x66')]=_[_0x1561('0x67')](_0x41d00d[_0x1561('0x66')],{'$or':_[_0x1561('0x3f')](_0x41d00d[_0x1561('0x60')],function(_0x18bc69){var _0x5d2a01={};_0x5d2a01[_0x18bc69]={'$like':'%'+_0x4c079c[_0x1561('0x5b')]['filter']+'%'};return _0x5d2a01;})});}_0x41d00d=_[_0x1561('0x67')]({},_0x41d00d,_0x4c079c[_0x1561('0x68')]);return db[_0x1561('0xe0')]['count']({'where':_0x41d00d['where']})[_0x1561('0x17')](function(_0x49977e){_0x4b2b5a['count']=_0x49977e;if(_0x4c079c[_0x1561('0x5b')][_0x1561('0x6a')]){_0x41d00d[_0x1561('0x6e')]=[{'all':!![]}];}else{_0x41d00d[_0x1561('0x6e')]=[{'model':db[_0x1561('0x9e')],'as':_0x1561('0x122'),'required':![]},{'model':db[_0x1561('0xea')],'as':_0x1561('0x123'),'required':![]}];}return db[_0x1561('0xe0')][_0x1561('0x6b')](_0x41d00d);})[_0x1561('0x17')](function(_0x37a62e){_0x4b2b5a[_0x1561('0x7e')]=_0x37a62e;return _0x4b2b5a;});}})[_0x1561('0x17')](respondWithFilteredResult(_0x18006a,_0x41d00d))[_0x1561('0x22')](handleError(_0x18006a,null));};exports[_0x1561('0x124')]=function(_0x415f38,_0x30557b){return db[_0x1561('0x69')][_0x1561('0x6f')]({'where':{'id':_0x415f38[_0x1561('0x6c')]['id']}})[_0x1561('0x17')](handleEntityNotFound(_0x30557b,null))[_0x1561('0x17')](function(_0x183858){if(_0x183858){return _0x183858[_0x1561('0x124')](_0x415f38[_0x1561('0x77')][_0x1561('0x85')],_[_0x1561('0x125')](_0x415f38[_0x1561('0x77')],[_0x1561('0x85'),'id'])||{})['spread'](function(_0x3f2aa6){for(var _0x4fb287=0x0;_0x4fb287<_0x415f38[_0x1561('0x77')]['ids'][_0x1561('0x61')];_0x4fb287+=0x1){socket['emit'](_0x1561('0x126'),{'UserId':Number(_0x415f38['body'][_0x1561('0x85')][_0x4fb287]),'ChatWebsiteId':Number(_0x415f38[_0x1561('0x6c')]['id'])});}return _0x3f2aa6;});}})[_0x1561('0x17')](respondWithResult(_0x30557b,null))[_0x1561('0x22')](handleError(_0x30557b,null));};exports[_0x1561('0x127')]=function(_0x446e53,_0x1f9e3e){return db[_0x1561('0x69')][_0x1561('0x6f')]({'where':{'id':_0x446e53[_0x1561('0x6c')]['id']}})['then'](handleEntityNotFound(_0x1f9e3e,null))[_0x1561('0x17')](function(_0xae2f9c){if(_0xae2f9c){return _0xae2f9c[_0x1561('0x127')](_0x446e53[_0x1561('0x5b')][_0x1561('0x85')])[_0x1561('0x17')](function(){if(_['isArray'](_0x446e53[_0x1561('0x5b')][_0x1561('0x85')])){for(var _0x1665dc=0x0;_0x1665dc<_0x446e53[_0x1561('0x5b')]['ids']['length'];_0x1665dc+=0x1){socket[_0x1561('0x128')](_0x1561('0x129'),{'UserId':Number(_0x446e53[_0x1561('0x5b')]['ids'][_0x1665dc]),'ChatWebsiteId':Number(_0x446e53['params']['id'])});}}else{socket[_0x1561('0x128')](_0x1561('0x129'),{'UserId':Number(_0x446e53[_0x1561('0x5b')][_0x1561('0x85')]),'ChatWebsiteId':Number(_0x446e53[_0x1561('0x6c')]['id'])});}});}})[_0x1561('0x17')](respondWithStatusCode(_0x1f9e3e,null))[_0x1561('0x22')](handleError(_0x1f9e3e,null));};exports[_0x1561('0x12a')]=function(_0x21d007,_0x3f62b0){var _0x17d13b={};var _0x194cb4={};var _0x2070a6;var _0x2f95ef;return db[_0x1561('0x69')]['findOne']({'where':{'id':_0x21d007[_0x1561('0x6c')]['id']}})['then'](handleEntityNotFound(_0x3f62b0,null))[_0x1561('0x17')](function(_0x262f76){if(_0x262f76){_0x2070a6=_0x262f76;_0x194cb4[_0x1561('0x54')]=_['keys'](db['User'][_0x1561('0x59')]);_0x194cb4['query']=_['keys'](_0x21d007[_0x1561('0x5b')]);_0x194cb4[_0x1561('0x5d')]=_[_0x1561('0x5e')](_0x194cb4[_0x1561('0x54')],_0x194cb4[_0x1561('0x5b')]);_0x17d13b['attributes']=_[_0x1561('0x5e')](_0x194cb4[_0x1561('0x54')],qs[_0x1561('0x5f')](_0x21d007['query'][_0x1561('0x5f')]));_0x17d13b[_0x1561('0x60')]=_0x17d13b[_0x1561('0x60')]['length']?_0x17d13b[_0x1561('0x60')]:_0x194cb4['model'];_0x17d13b[_0x1561('0x63')]=qs['sort'](_0x21d007[_0x1561('0x5b')]['sort']);_0x17d13b[_0x1561('0x66')]=qs[_0x1561('0x5d')](_['pick'](_0x21d007[_0x1561('0x5b')],_0x194cb4[_0x1561('0x5d')]));if(_0x21d007[_0x1561('0x5b')]['filter']){_0x17d13b[_0x1561('0x66')]=_[_0x1561('0x67')](_0x17d13b[_0x1561('0x66')],{'$or':_['map'](_0x17d13b[_0x1561('0x60')],function(_0x12eea0){var _0x2265cf={};_0x2265cf[_0x12eea0]={'$like':'%'+_0x21d007[_0x1561('0x5b')][_0x1561('0x65')]+'%'};return _0x2265cf;})});}_0x17d13b=_['merge']({},_0x17d13b,_0x21d007['options']);return _0x2070a6[_0x1561('0x12a')](_0x17d13b);}})[_0x1561('0x17')](function(_0xefddf8){if(_0xefddf8){_0x2f95ef=_0xefddf8[_0x1561('0x61')];if(!_0x21d007[_0x1561('0x5b')]['hasOwnProperty'](_0x1561('0x83'))){_0x17d13b[_0x1561('0x29')]=qs[_0x1561('0x29')](_0x21d007['query'][_0x1561('0x29')]);_0x17d13b[_0x1561('0x27')]=qs[_0x1561('0x27')](_0x21d007['query'][_0x1561('0x27')]);}return _0x2070a6[_0x1561('0x12a')](_0x17d13b);}})[_0x1561('0x17')](function(_0x2a3f85){if(_0x2a3f85){return _0x2a3f85?{'count':_0x2f95ef,'rows':_0x2a3f85}:null;}})[_0x1561('0x17')](respondWithResult(_0x3f62b0,null))[_0x1561('0x22')](handleError(_0x3f62b0,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index f5475eb..5a0c09d 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 _0xb7a8=['hook','exports','../../mysqldb','ChatWebsite','save','update','remove','emit','hasOwnProperty'];(function(_0x2eee25,_0x53460d){var _0x1cb8c4=function(_0x4dad56){while(--_0x4dad56){_0x2eee25['push'](_0x2eee25['shift']());}};_0x1cb8c4(++_0x53460d);}(_0xb7a8,0xec));var _0x8b7a=function(_0x3c5752,_0x4df06b){_0x3c5752=_0x3c5752-0x0;var _0x1a98c7=_0xb7a8[_0x3c5752];return _0x1a98c7;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x8b7a('0x0'))['db'][_0x8b7a('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8b7a('0x2'),'afterUpdate':_0x8b7a('0x3'),'afterDestroy':_0x8b7a('0x4')};function emitEvent(_0x5b033a){return function(_0x3847b8,_0x2c7217,_0x1185b9){ChatWebsiteEvents[_0x8b7a('0x5')](_0x5b033a+':'+_0x3847b8['id'],_0x3847b8);ChatWebsiteEvents[_0x8b7a('0x5')](_0x5b033a,_0x3847b8);_0x1185b9(null);};}for(var e in events){if(events[_0x8b7a('0x6')](e)){var event=events[e];ChatWebsite[_0x8b7a('0x7')](e,emitEvent(event));}}module[_0x8b7a('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x979e=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update'];(function(_0x2ed85c,_0x388634){var _0x4d37e1=function(_0x66e27d){while(--_0x66e27d){_0x2ed85c['push'](_0x2ed85c['shift']());}};_0x4d37e1(++_0x388634);}(_0x979e,0x195));var _0xe979=function(_0x553881,_0x44aecc){_0x553881=_0x553881-0x0;var _0x3378fc=_0x979e[_0x553881];return _0x3378fc;};'use strict';var EventEmitter=require(_0xe979('0x0'));var ChatWebsite=require(_0xe979('0x1'))['db'][_0xe979('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe979('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe979('0x4'),'afterDestroy':_0xe979('0x5')};function emitEvent(_0x386036){return function(_0x3b4b06,_0x2d62dd,_0x5afb7f){ChatWebsiteEvents[_0xe979('0x6')](_0x386036+':'+_0x3b4b06['id'],_0x3b4b06);ChatWebsiteEvents['emit'](_0x386036,_0x3b4b06);_0x5afb7f(null);};}for(var e in events){if(events[_0xe979('0x7')](e)){var event=events[e];ChatWebsite[_0xe979('0x8')](e,emitEvent(event));}}module[_0xe979('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index cba2de3..053beba 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 _0x9c74=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_websites','lodash'];(function(_0x1377da,_0x116f21){var _0x4acefe=function(_0x3bb55e){while(--_0x3bb55e){_0x1377da['push'](_0x1377da['shift']());}};_0x4acefe(++_0x116f21);}(_0x9c74,0x167));var _0x49c7=function(_0x368563,_0x1720cb){_0x368563=_0x368563-0x0;var _0x50a723=_0x9c74[_0x368563];return _0x50a723;};'use strict';var _=require(_0x49c7('0x0'));var util=require(_0x49c7('0x1'));var logger=require(_0x49c7('0x2'))(_0x49c7('0x3'));var moment=require(_0x49c7('0x4'));var BPromise=require(_0x49c7('0x5'));var rp=require(_0x49c7('0x6'));var fs=require('fs');var path=require(_0x49c7('0x7'));var rimraf=require(_0x49c7('0x8'));var config=require(_0x49c7('0x9'));var attributes=require('./chatWebsite.attributes');module[_0x49c7('0xa')]=function(_0x490f2e,_0xed0bb0){return _0x490f2e['define']('ChatWebsite',attributes,{'tableName':_0x49c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f9d=['moment','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util'];(function(_0x20e8bd,_0x353719){var _0x1db780=function(_0x179db8){while(--_0x179db8){_0x20e8bd['push'](_0x20e8bd['shift']());}};_0x1db780(++_0x353719);}(_0x6f9d,0x98));var _0xd6f9=function(_0x59f691,_0x1b656d){_0x59f691=_0x59f691-0x0;var _0x1f80bb=_0x6f9d[_0x59f691];return _0x1f80bb;};'use strict';var _=require(_0xd6f9('0x0'));var util=require(_0xd6f9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd6f9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6f9('0x3'));var rimraf=require(_0xd6f9('0x4'));var config=require(_0xd6f9('0x5'));var attributes=require(_0xd6f9('0x6'));module[_0xd6f9('0x7')]=function(_0xe27204,_0x148444){return _0xe27204[_0xd6f9('0x8')](_0xd6f9('0x9'),attributes,{'tableName':_0xd6f9('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 40a54d8..71727e9 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 _0x1e1f=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0xfbca3,_0xfba1fd){var _0x2c3fa1=function(_0x47d5bd){while(--_0x47d5bd){_0xfbca3['push'](_0xfbca3['shift']());}};_0x2c3fa1(++_0xfba1fd);}(_0x1e1f,0x1c4));var _0xf1e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e1f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf1e1('0x0'));var util=require('util');var moment=require(_0xf1e1('0x1'));var BPromise=require('bluebird');var rs=require(_0xf1e1('0x2'));var fs=require('fs');var Redis=require(_0xf1e1('0x3'));var db=require(_0xf1e1('0x4'))['db'];var utils=require(_0xf1e1('0x5'));var logger=require(_0xf1e1('0x6'))(_0xf1e1('0x7'));var config=require(_0xf1e1('0x8'));var jayson=require(_0xf1e1('0x9'));var client=jayson['client'][_0xf1e1('0xa')]({'port':0x232a});config[_0xf1e1('0xb')]=_[_0xf1e1('0xc')](config[_0xf1e1('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf1e1('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xf1e1('0xe')](socket);function respondWithRpcPromise(_0x1a54e6,_0x2cdccf,_0x2f7c3d){return new BPromise(function(_0xa30826,_0x208cd2){return client['request'](_0x1a54e6,_0x2f7c3d)[_0xf1e1('0xf')](function(_0x5544be){logger[_0xf1e1('0x10')](_0xf1e1('0x11'),_0x2cdccf,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2cdccf,_0xf1e1('0x12'),JSON[_0xf1e1('0x13')](_0x5544be));if(_0x5544be['error']){if(_0x5544be['error'][_0xf1e1('0x14')]===0x1f4){logger[_0xf1e1('0x15')](_0xf1e1('0x11'),_0x2cdccf,_0x5544be[_0xf1e1('0x15')][_0xf1e1('0x16')]);return _0x208cd2(_0x5544be[_0xf1e1('0x15')][_0xf1e1('0x16')]);}logger[_0xf1e1('0x15')](_0xf1e1('0x11'),_0x2cdccf,_0x5544be[_0xf1e1('0x15')]['message']);return _0xa30826(_0x5544be[_0xf1e1('0x15')][_0xf1e1('0x16')]);}else{logger[_0xf1e1('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x2cdccf,_0xf1e1('0x12'));_0xa30826(_0x5544be[_0xf1e1('0x17')][_0xf1e1('0x16')]);}})[_0xf1e1('0x18')](function(_0x46bdad){logger[_0xf1e1('0x15')](_0xf1e1('0x11'),_0x2cdccf,_0x46bdad);_0x208cd2(_0x46bdad);});});}
\ No newline at end of file
+var _0x15f1=['redis','defaults','localhost','socket.io-emitter','register','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http'];(function(_0x538e20,_0x374aed){var _0x2d969e=function(_0x282d4c){while(--_0x282d4c){_0x538e20['push'](_0x538e20['shift']());}};_0x2d969e(++_0x374aed);}(_0x15f1,0x9e));var _0x115f=function(_0x2837ae,_0x2c47ca){_0x2837ae=_0x2837ae-0x0;var _0xf8f847=_0x15f1[_0x2837ae];return _0xf8f847;};'use strict';var _=require(_0x115f('0x0'));var util=require(_0x115f('0x1'));var moment=require(_0x115f('0x2'));var BPromise=require(_0x115f('0x3'));var rs=require(_0x115f('0x4'));var fs=require('fs');var Redis=require(_0x115f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x115f('0x6'))(_0x115f('0x7'));var config=require(_0x115f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x115f('0x9')]({'port':0x232a});config[_0x115f('0xa')]=_[_0x115f('0xb')](config[_0x115f('0xa')],{'host':_0x115f('0xc'),'port':0x18eb});var socket=require(_0x115f('0xd'))(new Redis(config[_0x115f('0xa')]));require('./chatWebsite.socket')[_0x115f('0xe')](socket);function respondWithRpcPromise(_0x4affb9,_0x1c9bf8,_0x37c19a){return new BPromise(function(_0x4f7860,_0xd1c42b){return client['request'](_0x4affb9,_0x37c19a)['then'](function(_0x4f64d5){logger[_0x115f('0xf')](_0x115f('0x10'),_0x1c9bf8,_0x115f('0x11'));logger[_0x115f('0x12')](_0x115f('0x13'),_0x1c9bf8,_0x115f('0x11'),JSON[_0x115f('0x14')](_0x4f64d5));if(_0x4f64d5[_0x115f('0x15')]){if(_0x4f64d5[_0x115f('0x15')][_0x115f('0x16')]===0x1f4){logger['error'](_0x115f('0x10'),_0x1c9bf8,_0x4f64d5[_0x115f('0x15')][_0x115f('0x17')]);return _0xd1c42b(_0x4f64d5['error'][_0x115f('0x17')]);}logger[_0x115f('0x15')](_0x115f('0x10'),_0x1c9bf8,_0x4f64d5['error'][_0x115f('0x17')]);return _0x4f7860(_0x4f64d5[_0x115f('0x15')]['message']);}else{logger[_0x115f('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x1c9bf8,'request\x20sent');_0x4f7860(_0x4f64d5['result'][_0x115f('0x17')]);}})['catch'](function(_0x37768b){logger[_0x115f('0x15')](_0x115f('0x10'),_0x1c9bf8,_0x37768b);_0xd1c42b(_0x37768b);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 0fd9d03..da4ba4e 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 _0x2e0f=['removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0xc35608,_0x6f0a34){var _0x4be993=function(_0x424f6c){while(--_0x424f6c){_0xc35608['push'](_0xc35608['shift']());}};_0x4be993(++_0x6f0a34);}(_0x2e0f,0x17c));var _0xf2e0=function(_0x4b32d1,_0xd8ac22){_0x4b32d1=_0x4b32d1-0x0;var _0xcd942d=_0x2e0f[_0x4b32d1];return _0xcd942d;};'use strict';var ChatWebsiteEvents=require(_0xf2e0('0x0'));var events=[_0xf2e0('0x1'),_0xf2e0('0x2'),_0xf2e0('0x3')];function createListener(_0x41ea3b,_0x41af33){return function(_0x4df069){_0x41af33['emit'](_0x41ea3b,_0x4df069);};}function removeListener(_0x25eeeb,_0x493d2c){return function(){ChatWebsiteEvents[_0xf2e0('0x4')](_0x25eeeb,_0x493d2c);};}exports[_0xf2e0('0x5')]=function(_0x24a61b){for(var _0x495fa3=0x0,_0xf40ad9=events[_0xf2e0('0x6')];_0x495fa3<_0xf40ad9;_0x495fa3++){var _0xaa48fc=events[_0x495fa3];var _0x949231=createListener(_0xf2e0('0x7')+_0xaa48fc,_0x24a61b);ChatWebsiteEvents['on'](_0xaa48fc,_0x949231);}};
\ No newline at end of file
+var _0x99cb=['remove','update','emit','removeListener','register','chatWebsite:','save'];(function(_0x4f8e6c,_0x66370f){var _0x1f6937=function(_0x27cb53){while(--_0x27cb53){_0x4f8e6c['push'](_0x4f8e6c['shift']());}};_0x1f6937(++_0x66370f);}(_0x99cb,0xd8));var _0xb99c=function(_0x339b9e,_0x5d0bbc){_0x339b9e=_0x339b9e-0x0;var _0x2a669e=_0x99cb[_0x339b9e];return _0x2a669e;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xb99c('0x0'),_0xb99c('0x1'),_0xb99c('0x2')];function createListener(_0x45ee85,_0xe4b0bd){return function(_0x715376){_0xe4b0bd[_0xb99c('0x3')](_0x45ee85,_0x715376);};}function removeListener(_0x2a1f60,_0x406455){return function(){ChatWebsiteEvents[_0xb99c('0x4')](_0x2a1f60,_0x406455);};}exports[_0xb99c('0x5')]=function(_0x4b9790){for(var _0x1226d5=0x0,_0x189c0a=events['length'];_0x1226d5<_0x189c0a;_0x1226d5++){var _0x6783a7=events[_0x1226d5];var _0xa94de=createListener(_0xb99c('0x6')+_0x6783a7,_0x4b9790);ChatWebsiteEvents['on'](_0x6783a7,_0xa94de);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index c57da56..d40e2d5 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 _0x008f=['/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','originalname','file','server/files/images/avatars/','single','addAvatar','addCustomerAvatar','%s-%s','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','addInteraction','/:id/applications','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x008f,0x10c));var _0xf008=function(_0x3b04ce,_0x1030f8){_0x3b04ce=_0x3b04ce-0x0;var _0x4fe066=_0x008f[_0x3b04ce];return _0x4fe066;};'use strict';var multer=require(_0xf008('0x0'));var util=require(_0xf008('0x1'));var path=require(_0xf008('0x2'));var timeout=require(_0xf008('0x3'));var express=require('express');var router=express[_0xf008('0x4')]();var fs_extra=require(_0xf008('0x5'));var auth=require(_0xf008('0x6'));var interaction=require(_0xf008('0x7'));var config=require(_0xf008('0x8'));var controller=require(_0xf008('0x9'));router['get']('/',auth[_0xf008('0xa')](),controller[_0xf008('0xb')]);router[_0xf008('0xc')](_0xf008('0xd'),auth['isAuthenticated'](),controller[_0xf008('0xe')]);router[_0xf008('0xc')](_0xf008('0xf'),auth[_0xf008('0xa')](),controller['show']);router[_0xf008('0xc')](_0xf008('0x10'),auth[_0xf008('0xa')](),controller[_0xf008('0x11')]);router[_0xf008('0xc')](_0xf008('0x12'),auth[_0xf008('0xa')](),controller['getAnswers']);router[_0xf008('0xc')](_0xf008('0x13'),controller['getLogo']);router['get'](_0xf008('0x14'),controller[_0xf008('0x15')]);router['get'](_0xf008('0x16'),controller[_0xf008('0x17')]);router['get'](_0xf008('0x18'),controller[_0xf008('0x19')]);router[_0xf008('0xc')]('/:id/interactions',auth[_0xf008('0xa')](),controller[_0xf008('0x1a')]);router[_0xf008('0xc')](_0xf008('0x1b'),controller['getSnippet']);router['get']('/:id/applications',auth[_0xf008('0xa')](),controller[_0xf008('0x1c')]);router[_0xf008('0xc')](_0xf008('0x1d'),auth[_0xf008('0xa')](),controller['getProactiveActions']);router[_0xf008('0xc')]('/:id/fields',controller[_0xf008('0x1e')]);router[_0xf008('0xc')](_0xf008('0x1f'),auth[_0xf008('0xa')](),controller[_0xf008('0x20')]);router[_0xf008('0xc')](_0xf008('0x21'),auth[_0xf008('0xa')](),controller[_0xf008('0x22')]);router[_0xf008('0x23')]('/',auth[_0xf008('0xa')](),controller[_0xf008('0x24')]);router[_0xf008('0x23')](_0xf008('0x10'),auth[_0xf008('0xa')](),controller['addDisposition']);router[_0xf008('0x23')](_0xf008('0x12'),auth[_0xf008('0xa')](),controller[_0xf008('0x25')]);var upload=multer({'storage':multer[_0xf008('0x26')]({'destination':function(_0x319f05,_0x42033a,_0xb03eaf){_0xb03eaf(null,path[_0xf008('0x27')](config[_0xf008('0x28')],_0xf008('0x29')));},'filename':function(_0x19919b,_0x316b01,_0x439bd0){_0x439bd0(null,util[_0xf008('0x2a')]('%s-%s',Date[_0xf008('0x2b')](),_0x316b01[_0xf008('0x2c')]));}})});router[_0xf008('0x23')](_0xf008('0x13'),upload['single'](_0xf008('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0xf008('0x26')]({'destination':function(_0x60abc4,_0x43c193,_0x1bcfee){_0x1bcfee(null,path[_0xf008('0x27')](config['root'],_0xf008('0x2e')));},'filename':function(_0x591848,_0x11d849,_0x4cf232){_0x4cf232(null,util[_0xf008('0x2a')]('%s-%s',Date[_0xf008('0x2b')](),_0x11d849[_0xf008('0x2c')]));}})});router[_0xf008('0x23')](_0xf008('0x14'),upload[_0xf008('0x2f')](_0xf008('0x2d')),controller[_0xf008('0x30')]);var upload=multer({'storage':multer[_0xf008('0x26')]({'destination':function(_0x463d69,_0x2ad02f,_0xf3f325){_0xf3f325(null,path[_0xf008('0x27')](config[_0xf008('0x28')],_0xf008('0x2e')));},'filename':function(_0x29efc4,_0x115806,_0xb007f3){_0xb007f3(null,util[_0xf008('0x2a')]('%s-%s',Date[_0xf008('0x2b')](),_0x115806[_0xf008('0x2c')]));}})});router[_0xf008('0x23')](_0xf008('0x16'),upload[_0xf008('0x2f')](_0xf008('0x2d')),controller[_0xf008('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xd509d5,_0x4394ea,_0x3f5884){_0x3f5884(null,path['join'](config[_0xf008('0x28')],_0xf008('0x2e')));},'filename':function(_0x52bbdd,_0x1ac458,_0x243d9d){_0x243d9d(null,util['format'](_0xf008('0x32'),Date['now'](),_0x1ac458[_0xf008('0x2c')]));}})});router[_0xf008('0x23')](_0xf008('0x18'),upload['single']('file'),controller[_0xf008('0x33')]);router[_0xf008('0x23')](_0xf008('0x34'),controller[_0xf008('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xf008('0x26')]({'destination':function(_0x340f9a,_0x10738a,_0x18be09){const _0x5e16ea=path[_0xf008('0x27')](config['root'],_0xf008('0x36'),_0xf008('0x37'),_0xf008('0x38'));fs_extra[_0xf008('0x39')](_0x5e16ea,function(){_0x18be09(null,_0x5e16ea);});},'filename':function(_0x4848ca,_0x531720,_0x7e7443){const _0x4f7e14=_0x531720[_0xf008('0x2c')][_0xf008('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1410ee=path['extname'](_0x4f7e14);const _0x49dc2b=Date['now']()+'-'+_0x4f7e14[_0xf008('0x3a')](_0x1410ee,'')+_0x1410ee;_0x7e7443(null,_0x49dc2b);}})});router[_0xf008('0x23')](_0xf008('0x3b'),offlineUploadMulter['any'](),controller['offline']);router['post']('/:id/interactions',auth[_0xf008('0xa')](),controller[_0xf008('0x3c')]);router['post'](_0xf008('0x3d'),auth['isAuthenticated'](),controller[_0xf008('0x3e')]);router[_0xf008('0x23')](_0xf008('0x1d'),auth[_0xf008('0xa')](),controller[_0xf008('0x3f')]);router[_0xf008('0x23')](_0xf008('0x21'),auth[_0xf008('0xa')](),controller[_0xf008('0x40')]);router[_0xf008('0x41')](_0xf008('0xf'),auth[_0xf008('0xa')](),controller[_0xf008('0x42')]);router[_0xf008('0x43')](_0xf008('0xf'),auth[_0xf008('0xa')](),controller[_0xf008('0x44')]);router[_0xf008('0x43')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0xf008('0x43')](_0xf008('0x12'),auth[_0xf008('0xa')](),controller[_0xf008('0x45')]);router[_0xf008('0x43')](_0xf008('0x21'),auth[_0xf008('0xa')](),controller[_0xf008('0x46')]);module[_0xf008('0x47')]=router;
\ No newline at end of file
+var _0x505e=['show','/:id/dispositions','getDispositions','/:id/canned_answers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','now','single','file','addLogo','root','server/files/images/avatars/','%s-%s','originalname','addAvatar','addCustomerAvatar','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','addInteraction','addApplications','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/:id'];(function(_0x5edd83,_0x53c99d){var _0x203431=function(_0xb11787){while(--_0xb11787){_0x5edd83['push'](_0x5edd83['shift']());}};_0x203431(++_0x53c99d);}(_0x505e,0x77));var _0xe505=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0x505e[_0x3cc9d9];return _0x1a425d;};'use strict';var multer=require(_0xe505('0x0'));var util=require(_0xe505('0x1'));var path=require('path');var timeout=require(_0xe505('0x2'));var express=require(_0xe505('0x3'));var router=express['Router']();var fs_extra=require(_0xe505('0x4'));var auth=require(_0xe505('0x5'));var interaction=require(_0xe505('0x6'));var config=require(_0xe505('0x7'));var controller=require(_0xe505('0x8'));router[_0xe505('0x9')]('/',auth[_0xe505('0xa')](),controller[_0xe505('0xb')]);router['get']('/describe',auth[_0xe505('0xa')](),controller['describe']);router['get'](_0xe505('0xc'),auth[_0xe505('0xa')](),controller[_0xe505('0xd')]);router[_0xe505('0x9')](_0xe505('0xe'),auth['isAuthenticated'](),controller[_0xe505('0xf')]);router[_0xe505('0x9')](_0xe505('0x10'),auth[_0xe505('0xa')](),controller['getAnswers']);router[_0xe505('0x9')]('/:id/logo',controller[_0xe505('0x11')]);router[_0xe505('0x9')](_0xe505('0x12'),controller[_0xe505('0x13')]);router[_0xe505('0x9')](_0xe505('0x14'),controller['getCustomerAvatar']);router[_0xe505('0x9')](_0xe505('0x15'),controller[_0xe505('0x16')]);router[_0xe505('0x9')](_0xe505('0x17'),auth[_0xe505('0xa')](),controller[_0xe505('0x18')]);router['get'](_0xe505('0x19'),controller['getSnippet']);router[_0xe505('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0xe505('0x1a')]);router['get'](_0xe505('0x1b'),auth[_0xe505('0xa')](),controller[_0xe505('0x1c')]);router[_0xe505('0x9')](_0xe505('0x1d'),controller[_0xe505('0x1e')]);router[_0xe505('0x9')]('/:id/offline_messages',auth[_0xe505('0xa')](),controller[_0xe505('0x1f')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xe505('0x20')]);router[_0xe505('0x21')]('/',auth['isAuthenticated'](),controller[_0xe505('0x22')]);router['post'](_0xe505('0xe'),auth[_0xe505('0xa')](),controller[_0xe505('0x23')]);router[_0xe505('0x21')](_0xe505('0x10'),auth[_0xe505('0xa')](),controller[_0xe505('0x24')]);var upload=multer({'storage':multer[_0xe505('0x25')]({'destination':function(_0x5b0a69,_0x9a618f,_0x2559bb){_0x2559bb(null,path[_0xe505('0x26')](config['root'],_0xe505('0x27')));},'filename':function(_0x54befc,_0xa96285,_0x21df52){_0x21df52(null,util[_0xe505('0x28')]('%s-%s',Date[_0xe505('0x29')](),_0xa96285['originalname']));}})});router[_0xe505('0x21')]('/:id/logo',upload[_0xe505('0x2a')](_0xe505('0x2b')),controller[_0xe505('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x117a4f,_0x569f2d,_0xb34df3){_0xb34df3(null,path[_0xe505('0x26')](config[_0xe505('0x2d')],_0xe505('0x2e')));},'filename':function(_0x156b6f,_0x2667e0,_0x2d7d2a){_0x2d7d2a(null,util[_0xe505('0x28')](_0xe505('0x2f'),Date[_0xe505('0x29')](),_0x2667e0[_0xe505('0x30')]));}})});router[_0xe505('0x21')](_0xe505('0x12'),upload['single'](_0xe505('0x2b')),controller[_0xe505('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x49b512,_0x5b7dc5,_0x22413b){_0x22413b(null,path['join'](config['root'],_0xe505('0x2e')));},'filename':function(_0x3e6c3f,_0x296296,_0x1830b8){_0x1830b8(null,util['format'](_0xe505('0x2f'),Date[_0xe505('0x29')](),_0x296296[_0xe505('0x30')]));}})});router[_0xe505('0x21')](_0xe505('0x14'),upload[_0xe505('0x2a')](_0xe505('0x2b')),controller[_0xe505('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x536e27,_0x1fd5d4,_0x3acf47){_0x3acf47(null,path[_0xe505('0x26')](config['root'],_0xe505('0x2e')));},'filename':function(_0x58e57e,_0x104300,_0x1eb522){_0x1eb522(null,util[_0xe505('0x28')](_0xe505('0x2f'),Date[_0xe505('0x29')](),_0x104300[_0xe505('0x30')]));}})});router['post'](_0xe505('0x15'),upload[_0xe505('0x2a')]('file'),controller['addSystemAvatar']);router[_0xe505('0x21')]('/:id/notify',controller[_0xe505('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0xe505('0x25')]({'destination':function(_0x232abf,_0x3f2c21,_0x3e595e){const _0x35590b=path[_0xe505('0x26')](config[_0xe505('0x2d')],'server/files',_0xe505('0x34'),_0xe505('0x35'));fs_extra[_0xe505('0x36')](_0x35590b,function(){_0x3e595e(null,_0x35590b);});},'filename':function(_0x5581b7,_0x1e5119,_0x12e771){const _0x4e8e03=_0x1e5119[_0xe505('0x30')][_0xe505('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x39e49b=path[_0xe505('0x38')](_0x4e8e03);const _0x4a1080=Date['now']()+'-'+_0x4e8e03[_0xe505('0x37')](_0x39e49b,'')+_0x39e49b;_0x12e771(null,_0x4a1080);}})});router['post'](_0xe505('0x39'),offlineUploadMulter['any'](),controller['offline']);router[_0xe505('0x21')](_0xe505('0x17'),auth['isAuthenticated'](),controller[_0xe505('0x3a')]);router['post']('/:id/applications',auth[_0xe505('0xa')](),controller[_0xe505('0x3b')]);router[_0xe505('0x21')](_0xe505('0x1b'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0xe505('0x21')]('/:id/users',auth[_0xe505('0xa')](),controller['addAgents']);router['put'](_0xe505('0xc'),auth[_0xe505('0xa')](),controller[_0xe505('0x3c')]);router[_0xe505('0x3d')](_0xe505('0xc'),auth[_0xe505('0xa')](),controller[_0xe505('0x3e')]);router['delete'](_0xe505('0xe'),auth['isAuthenticated'](),controller[_0xe505('0x3f')]);router[_0xe505('0x3d')](_0xe505('0x10'),auth[_0xe505('0xa')](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0xe505('0xa')](),controller[_0xe505('0x40')]);module[_0xe505('0x41')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 75bfe4b..0ded495 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 _0x6d8a=['exports','beaver-logger/server','../components/auth/service','env','production','app','get','client-side-logger','expressEndpoint','use'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0x6d8a,0x1a5));var _0xa6d8=function(_0x1196bd,_0xba4aea){_0x1196bd=_0x1196bd-0x0;var _0x26014f=_0x6d8a[_0x1196bd];return _0x26014f;};var beaverLogger=require(_0xa6d8('0x0'));var express=require('express');var auth=require(_0xa6d8('0x1'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0xa6d8('0x2')]===_0xa6d8('0x3')||![];function clientSideLogs(_0x53f40,_0x202397,_0x5f19be){var _0x545d72=_0x53f40[_0xa6d8('0x4')][_0xa6d8('0x5')](_0xa6d8('0x6'));if(!_0x545d72){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xa6d8('0x7')]({'uri':'/client-logs','logger':_0x545d72,'enableCors':!isProduction})(_0x53f40,_0x202397,_0x5f19be);}router[_0xa6d8('0x8')](auth['isAuthenticated'](),clientSideLogs);module[_0xa6d8('0x9')]=router;
\ No newline at end of file
+var _0x0ea4=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','env','app','get','client-side-logger'];(function(_0x51aa5b,_0x512fc0){var _0x5066d8=function(_0x2bdda9){while(--_0x2bdda9){_0x51aa5b['push'](_0x51aa5b['shift']());}};_0x5066d8(++_0x512fc0);}(_0x0ea4,0x181));var _0x40ea=function(_0x276e08,_0x2c5ce5){_0x276e08=_0x276e08-0x0;var _0x54dd69=_0x0ea4[_0x276e08];return _0x54dd69;};var beaverLogger=require(_0x40ea('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x40ea('0x1')]==='production'||![];function clientSideLogs(_0x41c3d6,_0x30f87e,_0x343bcc){var _0x344e1f=_0x41c3d6[_0x40ea('0x2')][_0x40ea('0x3')](_0x40ea('0x4'));if(!_0x344e1f){throw new Error(_0x40ea('0x5'));}return beaverLogger[_0x40ea('0x6')]({'uri':'/client-logs','logger':_0x344e1f,'enableCors':!isProduction})(_0x41c3d6,_0x30f87e,_0x343bcc);}router[_0x40ea('0x7')](auth[_0x40ea('0x8')](),clientSideLogs);module[_0x40ea('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 2f54b67..0e2c14f 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 _0x51de=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','ENUM','AmazonAWS','MicrosoftAzure','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x1feb3b,_0x54f735){var _0x28b0a2=function(_0xdfe1d3){while(--_0xdfe1d3){_0x1feb3b['push'](_0x1feb3b['shift']());}};_0x28b0a2(++_0x54f735);}(_0x51de,0x1d5));var _0xe51d=function(_0x66840d,_0x4106af){_0x66840d=_0x66840d-0x0;var _0x5ef852=_0x51de[_0x66840d];return _0x5ef852;};'use strict';var Sequelize=require(_0xe51d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe51d('0x1')](_0xe51d('0x2'),'Google',_0xe51d('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xe51d('0x1')]('Outlook365',_0xe51d('0x4'))},'data1':{'type':Sequelize[_0xe51d('0x5')],'comment':_0xe51d('0x6')},'data2':{'type':Sequelize['STRING'],'comment':_0xe51d('0x7')},'data3':{'type':Sequelize[_0xe51d('0x5')],'comment':_0xe51d('0x8')},'data4':{'type':Sequelize[_0xe51d('0x5')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xe51d('0x9')],'comment':_0xe51d('0xa')},'data6':{'type':Sequelize['TEXT'],'comment':_0xe51d('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':_0xe51d('0xc')}};
\ No newline at end of file
+var _0xcd5f=['exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcd5f,0x1a0));var _0xfcd5=function(_0x103f49,_0x2d8350){_0x103f49=_0x103f49-0x0;var _0x7fbb3b=_0xcd5f[_0x103f49];return _0x7fbb3b;};'use strict';var Sequelize=require('sequelize');module[_0xfcd5('0x0')]={'name':{'type':Sequelize[_0xfcd5('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xfcd5('0x2')](_0xfcd5('0x3'),_0xfcd5('0x4'),_0xfcd5('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xfcd5('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0xfcd5('0x1')],'comment':_0xfcd5('0x7')},'data2':{'type':Sequelize[_0xfcd5('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xfcd5('0x1')],'comment':_0xfcd5('0x8')},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xfcd5('0x9')],'comment':_0xfcd5('0xa')},'data6':{'type':Sequelize[_0xfcd5('0x9')],'comment':_0xfcd5('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':_0xfcd5('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 3f0b9c4..7e914a3 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 _0x0029=['update','then','end','stack','name','send','padEnd','slice','index','map','type','key','model','keys','intersection','query','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','CloudProvider','includeAll','include','findAll','rows','service','decryptString','data3','catch','rawAttributes','find','Service\x20parameter\x20not\x20specified','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','MicrosoftAzure','encryptString','params','destroy','findOne','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0029,0x1bd));var _0x9002=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x0029[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var Redis=require(_0x9002('0x0'));var qs=require(_0x9002('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x9002('0x2'));var logger=require(_0x9002('0x3'))(_0x9002('0x4'));var db=require(_0x9002('0x5'))['db'];var oauth=require(_0x9002('0x6'));config[_0x9002('0x7')]=_[_0x9002('0x8')](config['redis'],{'host':_0x9002('0x9'),'port':0x18eb});var socket=require(_0x9002('0xa'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0xaa6cfe,_0x1bc871){_0x1bc871=_0x1bc871||0xcc;return function(_0x439cd4){if(_0x439cd4){return _0xaa6cfe[_0x9002('0xb')](_0x1bc871);}return _0xaa6cfe[_0x9002('0xc')](_0x1bc871)['end']();};}function respondWithResult(_0x21df76,_0x87e11f){_0x87e11f=_0x87e11f||0xc8;return function(_0x530c37){if(_0x530c37){return _0x21df76[_0x9002('0xc')](_0x87e11f)[_0x9002('0xd')](_0x530c37);}};}function respondWithFilteredResult(_0x1016a4,_0x3e9a65){return function(_0x46416b){if(_0x46416b){var _0x68b66f=typeof _0x3e9a65[_0x9002('0xe')]===_0x9002('0xf')&&typeof _0x3e9a65[_0x9002('0x10')]===_0x9002('0xf');var _0x27e4cb=_0x46416b[_0x9002('0x11')];var _0x1586b4=_0x68b66f?0x0:_0x3e9a65[_0x9002('0xe')];var _0x533e6c=_0x68b66f?_0x46416b[_0x9002('0x11')]:_0x3e9a65['offset']+_0x3e9a65['limit'];var _0x5e2060;if(_0x533e6c>=_0x27e4cb){_0x533e6c=_0x27e4cb;_0x5e2060=0xc8;}else{_0x5e2060=0xce;}_0x1016a4[_0x9002('0xc')](_0x5e2060);return _0x1016a4[_0x9002('0x12')](_0x9002('0x13'),_0x1586b4+'-'+_0x533e6c+'/'+_0x27e4cb)[_0x9002('0xd')](_0x46416b);}return null;};}function saveUpdates(_0x7a208f){return function(_0x5767ee){if(_0x5767ee){return _0x5767ee[_0x9002('0x14')](_0x7a208f)['then'](function(_0x196329){return _0x196329;});}return null;};}function removeEntity(_0x103909){return function(_0x307558){if(_0x307558){return _0x307558['destroy']()[_0x9002('0x15')](function(){_0x103909[_0x9002('0xc')](0xcc)[_0x9002('0x16')]();});}};}function handleEntityNotFound(_0x280b74){return function(_0x18d74a){if(!_0x18d74a){_0x280b74[_0x9002('0xb')](0x194);}return _0x18d74a;};}function handleError(_0x5d1bd2,_0x590bf6){_0x590bf6=_0x590bf6||0x1f4;return function(_0x12c71b){logger['error'](_0x12c71b[_0x9002('0x17')]);if(_0x12c71b[_0x9002('0x18')]){delete _0x12c71b[_0x9002('0x18')];}_0x5d1bd2[_0x9002('0xc')](_0x590bf6)[_0x9002('0x19')](_0x12c71b);};}function maskClientSecret(_0x4a3309){return _[_0x9002('0x1a')](_0x4a3309[_0x9002('0x1b')](0x0,0x3),0x14,'*');}exports[_0x9002('0x1c')]=function(_0x288253,_0x2b80f9){var _0x29801b={},_0x10885d={},_0x2129fa={'count':0x0,'rows':[]};var _0x11800f=_[_0x9002('0x1d')](db['CloudProvider']['rawAttributes'],function(_0x3dcb21){return{'name':_0x3dcb21['fieldName'],'type':_0x3dcb21[_0x9002('0x1e')][_0x9002('0x1f')]};});_0x10885d[_0x9002('0x20')]=_[_0x9002('0x1d')](_0x11800f,_0x9002('0x18'));_0x10885d['query']=_[_0x9002('0x21')](_0x288253['query']);_0x10885d['filters']=_[_0x9002('0x22')](_0x10885d[_0x9002('0x20')],_0x10885d[_0x9002('0x23')]);_0x29801b[_0x9002('0x24')]=_[_0x9002('0x22')](_0x10885d[_0x9002('0x20')],qs[_0x9002('0x25')](_0x288253[_0x9002('0x23')]['fields']));_0x29801b['attributes']=_0x29801b[_0x9002('0x24')]['length']?_0x29801b[_0x9002('0x24')]:_0x10885d[_0x9002('0x20')];if(!_0x288253[_0x9002('0x23')]['hasOwnProperty'](_0x9002('0x26'))){_0x29801b[_0x9002('0x10')]=qs['limit'](_0x288253[_0x9002('0x23')][_0x9002('0x10')]);_0x29801b['offset']=qs['offset'](_0x288253[_0x9002('0x23')][_0x9002('0xe')]);}_0x29801b['order']=qs['sort'](_0x288253[_0x9002('0x23')][_0x9002('0x27')]);_0x29801b[_0x9002('0x28')]=qs[_0x9002('0x29')](_[_0x9002('0x2a')](_0x288253[_0x9002('0x23')],_0x10885d[_0x9002('0x29')]),_0x11800f);if(_0x288253[_0x9002('0x23')][_0x9002('0x2b')]){_0x29801b[_0x9002('0x28')]=_[_0x9002('0x2c')](_0x29801b[_0x9002('0x28')],{'$or':_[_0x9002('0x1d')](_0x11800f,function(_0x5273fa){if(_0x5273fa[_0x9002('0x1e')]!==_0x9002('0x2d')){var _0x67efe0={};_0x67efe0[_0x5273fa[_0x9002('0x18')]]={'$like':'%'+_0x288253[_0x9002('0x23')][_0x9002('0x2b')]+'%'};return _0x67efe0;}})});}_0x29801b=_[_0x9002('0x2c')]({},_0x29801b,_0x288253[_0x9002('0x2e')]);var _0x424aa0={'where':_0x29801b[_0x9002('0x28')]};return db[_0x9002('0x2f')][_0x9002('0x11')](_0x424aa0)[_0x9002('0x15')](function(_0xab61ef){_0x2129fa['count']=_0xab61ef;if(_0x288253[_0x9002('0x23')][_0x9002('0x30')]){_0x29801b[_0x9002('0x31')]=[{'all':!![]}];}return db['CloudProvider'][_0x9002('0x32')](_0x29801b);})['then'](function(_0x38a339){_0x2129fa[_0x9002('0x33')]=_[_0x9002('0x1d')](_0x38a339,function(_0x9b1275){if(_0x9b1275[_0x9002('0x34')]==='MicrosoftAzure'){var _0x4b9499=encryptor[_0x9002('0x35')](_0x9b1275[_0x9002('0x36')]);_0x9b1275[_0x9002('0x36')]=maskClientSecret(_0x4b9499);}return _0x9b1275;});return _0x2129fa;})[_0x9002('0x15')](respondWithFilteredResult(_0x2b80f9,_0x29801b))[_0x9002('0x37')](handleError(_0x2b80f9,null));};exports['show']=function(_0x28639a,_0x157232){var _0xe2b587={'raw':!![],'where':{'id':_0x28639a['params']['id']}},_0x47ab63={};_0x47ab63[_0x9002('0x20')]=_[_0x9002('0x21')](db[_0x9002('0x2f')][_0x9002('0x38')]);_0x47ab63[_0x9002('0x23')]=_[_0x9002('0x21')](_0x28639a[_0x9002('0x23')]);_0x47ab63['filters']=_[_0x9002('0x22')](_0x47ab63[_0x9002('0x20')],_0x47ab63[_0x9002('0x23')]);_0xe2b587[_0x9002('0x24')]=_[_0x9002('0x22')](_0x47ab63[_0x9002('0x20')],qs['fields'](_0x28639a[_0x9002('0x23')][_0x9002('0x25')]));_0xe2b587[_0x9002('0x24')]=_0xe2b587[_0x9002('0x24')]['length']?_0xe2b587[_0x9002('0x24')]:_0x47ab63[_0x9002('0x20')];if(_0x28639a[_0x9002('0x23')][_0x9002('0x30')]){_0xe2b587[_0x9002('0x31')]=[{'all':!![]}];}_0xe2b587=_[_0x9002('0x2c')]({},_0xe2b587,_0x28639a[_0x9002('0x2e')]);return db[_0x9002('0x2f')][_0x9002('0x39')](_0xe2b587)['then'](handleEntityNotFound(_0x157232,null))['then'](function(_0x13a40e){if(_0x13a40e['service']==='MicrosoftAzure'){var _0x2c2c53=encryptor[_0x9002('0x35')](_0x13a40e[_0x9002('0x36')]);_0x13a40e[_0x9002('0x36')]=maskClientSecret(_0x2c2c53);}return _0x13a40e;})[_0x9002('0x15')](respondWithResult(_0x157232,null))['catch'](handleError(_0x157232,null));};exports['create']=function(_0x6e5dbb,_0x48e19d){if(!_0x6e5dbb['body'][_0x9002('0x18')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x6e5dbb['body']['service'])throw new Error(_0x9002('0x3a'));var _0x669d33=db[_0x9002('0x2f')][_0x9002('0x38')][_0x9002('0x34')]['values'];if(!_0x669d33['includes'](_0x6e5dbb[_0x9002('0x3b')]['service']))throw new Error(_0x9002('0x3c')+_0x669d33[_0x9002('0x3d')](',\x20'));if(_0x6e5dbb[_0x9002('0x3b')]['service']===_0x9002('0x3e')&&_0x6e5dbb['body'][_0x9002('0x36')]){_0x6e5dbb['body'][_0x9002('0x36')]=encryptor[_0x9002('0x3f')](_0x6e5dbb['body'][_0x9002('0x36')]);}return db['CloudProvider']['create'](_0x6e5dbb[_0x9002('0x3b')],{})[_0x9002('0x15')](respondWithResult(_0x48e19d,0xc9))[_0x9002('0x37')](handleError(_0x48e19d,null));};exports[_0x9002('0x14')]=function(_0x5a7000,_0x30726c){if(_0x5a7000['body']['id']){delete _0x5a7000[_0x9002('0x3b')]['id'];}return db[_0x9002('0x2f')]['find']({'where':{'id':_0x5a7000[_0x9002('0x40')]['id']}})[_0x9002('0x15')](handleEntityNotFound(_0x30726c,null))[_0x9002('0x15')](function(_0x3c8a0b){if(_0x3c8a0b[_0x9002('0x34')]===_0x9002('0x3e')&&_0x5a7000[_0x9002('0x3b')]['data3']){_0x5a7000[_0x9002('0x3b')][_0x9002('0x36')]=encryptor['encryptString'](_0x5a7000[_0x9002('0x3b')][_0x9002('0x36')]);}return _0x3c8a0b;})[_0x9002('0x15')](saveUpdates(_0x5a7000[_0x9002('0x3b')],null))[_0x9002('0x15')](respondWithResult(_0x30726c,null))['catch'](handleError(_0x30726c,null));};exports[_0x9002('0x41')]=function(_0x3b094b,_0x3273e3){return db[_0x9002('0x2f')][_0x9002('0x39')]({'where':{'id':_0x3b094b['params']['id']}})[_0x9002('0x15')](handleEntityNotFound(_0x3273e3,null))['then'](removeEntity(_0x3273e3,null))[_0x9002('0x37')](handleError(_0x3273e3,null));};exports['oauth2MicrosoftAuthorize']=function(_0x569bef,_0x36561c){return db[_0x9002('0x2f')][_0x9002('0x42')]({'where':{'id':_0x569bef[_0x9002('0x40')]['id']},'raw':!![]})['then'](function(_0x321acd){if(!_0x321acd)return _0x36561c['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x321acd,_0x569bef['user']['id'])};})['then'](respondWithResult(_0x36561c,null))[_0x9002('0x37')](handleError(_0x36561c,null));};exports[_0x9002('0x43')]=function(_0x15c5fe,_0x5ad4dd){var _0x29d993=_0x15c5fe[_0x9002('0x3b')];var _0x42d845;var _0x45b53c;if(_0x29d993['error'])throw _0x29d993;redis['get'](_0x29d993[_0x9002('0x44')])[_0x9002('0x15')](function(_0x17e4e1){if(!_0x17e4e1)throw new Error(_0x9002('0x45'));_0x42d845=JSON[_0x9002('0x46')](_0x17e4e1);var _0x396d07=Buffer[_0x9002('0x47')](_0x29d993[_0x9002('0x44')],_0x9002('0x48'))[_0x9002('0x49')](_0x9002('0x4a'));_0x45b53c=JSON[_0x9002('0x46')](_0x396d07);if(!oauth[_0x9002('0x4b')](_0x29d993[_0x9002('0x4c')],_0x42d845[_0x9002('0x4d')]))throw new Error(_0x9002('0x4e'));redis['del'](_0x29d993[_0x9002('0x44')]);return oauth[_0x9002('0x4f')](_0x29d993['code'],_0x42d845);})[_0x9002('0x15')](function(_0x4c6206){_0x42d845[_0x9002('0x50')]=_0x4c6206[_0x9002('0x51')];_0x42d845[_0x9002('0x52')]=_0x4c6206[_0x9002('0x53')];return db[_0x9002('0x2f')][_0x9002('0x14')]({'data5':_0x42d845['data5'],'data6':_0x42d845['data6']},{'where':{'id':_0x42d845['id']}});})[_0x9002('0x15')](function(){oauth[_0x9002('0x54')](_0x42d845);socket[_0x9002('0x55')](_0x9002('0x56'),{'id':_0x45b53c['id']});return;})[_0x9002('0x15')](respondWithStatusCode(_0x5ad4dd,null))[_0x9002('0x37')](function(_0x18b5f7){if(_0x45b53c){socket[_0x9002('0x55')](_0x9002('0x57'),{'id':_0x45b53c['id']});}if(!_0x42d845){logger[_0x9002('0x58')](_0x9002('0x59'),_0x18b5f7);return _0x5ad4dd[_0x9002('0xc')](0x1f4)[_0x9002('0x19')](_0x18b5f7[_0x9002('0x5a')]);}logger[_0x9002('0x58')](_0x9002('0x5b'),_0x42d845['id'],JSON[_0x9002('0x5c')](_0x18b5f7));});};
\ No newline at end of file
+var _0xe58b=['data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','filters','intersection','attributes','fields','hasOwnProperty','nolimit','query','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','options','find','body','Service\x20parameter\x20not\x20specified','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','base64','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code'];(function(_0xec3aa8,_0x113c4b){var _0x33029b=function(_0x378db3){while(--_0x378db3){_0xec3aa8['push'](_0xec3aa8['shift']());}};_0x33029b(++_0x113c4b);}(_0xe58b,0x18a));var _0xbe58=function(_0x5e94e4,_0x32f8ee){_0x5e94e4=_0x5e94e4-0x0;var _0x59b607=_0xe58b[_0x5e94e4];return _0x59b607;};'use strict';var _=require(_0xbe58('0x0'));var Redis=require('ioredis');var qs=require(_0xbe58('0x1'));var encryptor=require(_0xbe58('0x2'));var config=require(_0xbe58('0x3'));var logger=require('../../config/logger')(_0xbe58('0x4'));var db=require(_0xbe58('0x5'))['db'];var oauth=require(_0xbe58('0x6'));config[_0xbe58('0x7')]=_['defaults'](config[_0xbe58('0x7')],{'host':_0xbe58('0x8'),'port':0x18eb});var socket=require(_0xbe58('0x9'))(new Redis(config['redis']));var redis=new Redis(config[_0xbe58('0x7')]);function respondWithStatusCode(_0x411997,_0xb1fdf8){_0xb1fdf8=_0xb1fdf8||0xcc;return function(_0xf4e016){if(_0xf4e016){return _0x411997[_0xbe58('0xa')](_0xb1fdf8);}return _0x411997[_0xbe58('0xb')](_0xb1fdf8)['end']();};}function respondWithResult(_0x46299a,_0x27da6b){_0x27da6b=_0x27da6b||0xc8;return function(_0x2ca3b3){if(_0x2ca3b3){return _0x46299a['status'](_0x27da6b)['json'](_0x2ca3b3);}};}function respondWithFilteredResult(_0xe1610a,_0x558075){return function(_0xe3a2be){if(_0xe3a2be){var _0x136866=typeof _0x558075[_0xbe58('0xc')]===_0xbe58('0xd')&&typeof _0x558075['limit']==='undefined';var _0x24b609=_0xe3a2be[_0xbe58('0xe')];var _0x4cc07b=_0x136866?0x0:_0x558075[_0xbe58('0xc')];var _0x3258b8=_0x136866?_0xe3a2be[_0xbe58('0xe')]:_0x558075[_0xbe58('0xc')]+_0x558075[_0xbe58('0xf')];var _0x58005a;if(_0x3258b8>=_0x24b609){_0x3258b8=_0x24b609;_0x58005a=0xc8;}else{_0x58005a=0xce;}_0xe1610a[_0xbe58('0xb')](_0x58005a);return _0xe1610a[_0xbe58('0x10')](_0xbe58('0x11'),_0x4cc07b+'-'+_0x3258b8+'/'+_0x24b609)[_0xbe58('0x12')](_0xe3a2be);}return null;};}function saveUpdates(_0x5975d6){return function(_0x2d02dc){if(_0x2d02dc){return _0x2d02dc[_0xbe58('0x13')](_0x5975d6)[_0xbe58('0x14')](function(_0x2d2545){return _0x2d2545;});}return null;};}function removeEntity(_0x4dd33b){return function(_0x2b4f63){if(_0x2b4f63){return _0x2b4f63[_0xbe58('0x15')]()[_0xbe58('0x14')](function(){_0x4dd33b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5291e2){return function(_0x4d3416){if(!_0x4d3416){_0x5291e2['sendStatus'](0x194);}return _0x4d3416;};}function handleError(_0x2f15cc,_0x4714b0){_0x4714b0=_0x4714b0||0x1f4;return function(_0x2d6116){logger[_0xbe58('0x16')](_0x2d6116[_0xbe58('0x17')]);if(_0x2d6116[_0xbe58('0x18')]){delete _0x2d6116[_0xbe58('0x18')];}_0x2f15cc[_0xbe58('0xb')](_0x4714b0)[_0xbe58('0x19')](_0x2d6116);};}function maskClientSecret(_0x3d3bc9){return _[_0xbe58('0x1a')](_0x3d3bc9[_0xbe58('0x1b')](0x0,0x3),0x14,'*');}exports[_0xbe58('0x1c')]=function(_0x1e3f28,_0x51e08c){var _0x5b2fab={},_0x503ffc={},_0x547595={'count':0x0,'rows':[]};var _0x36e028=_[_0xbe58('0x1d')](db[_0xbe58('0x1e')][_0xbe58('0x1f')],function(_0x49b78d){return{'name':_0x49b78d[_0xbe58('0x20')],'type':_0x49b78d[_0xbe58('0x21')][_0xbe58('0x22')]};});_0x503ffc[_0xbe58('0x23')]=_[_0xbe58('0x1d')](_0x36e028,_0xbe58('0x18'));_0x503ffc['query']=_['keys'](_0x1e3f28['query']);_0x503ffc[_0xbe58('0x24')]=_[_0xbe58('0x25')](_0x503ffc[_0xbe58('0x23')],_0x503ffc['query']);_0x5b2fab[_0xbe58('0x26')]=_['intersection'](_0x503ffc[_0xbe58('0x23')],qs[_0xbe58('0x27')](_0x1e3f28['query'][_0xbe58('0x27')]));_0x5b2fab[_0xbe58('0x26')]=_0x5b2fab[_0xbe58('0x26')]['length']?_0x5b2fab[_0xbe58('0x26')]:_0x503ffc[_0xbe58('0x23')];if(!_0x1e3f28['query'][_0xbe58('0x28')](_0xbe58('0x29'))){_0x5b2fab[_0xbe58('0xf')]=qs['limit'](_0x1e3f28[_0xbe58('0x2a')][_0xbe58('0xf')]);_0x5b2fab[_0xbe58('0xc')]=qs['offset'](_0x1e3f28['query']['offset']);}_0x5b2fab[_0xbe58('0x2b')]=qs[_0xbe58('0x2c')](_0x1e3f28[_0xbe58('0x2a')]['sort']);_0x5b2fab[_0xbe58('0x2d')]=qs[_0xbe58('0x24')](_[_0xbe58('0x2e')](_0x1e3f28[_0xbe58('0x2a')],_0x503ffc[_0xbe58('0x24')]),_0x36e028);if(_0x1e3f28[_0xbe58('0x2a')]['filter']){_0x5b2fab['where']=_[_0xbe58('0x2f')](_0x5b2fab[_0xbe58('0x2d')],{'$or':_[_0xbe58('0x1d')](_0x36e028,function(_0x5a3ac0){if(_0x5a3ac0[_0xbe58('0x21')]!==_0xbe58('0x30')){var _0x4cd886={};_0x4cd886[_0x5a3ac0[_0xbe58('0x18')]]={'$like':'%'+_0x1e3f28['query'][_0xbe58('0x31')]+'%'};return _0x4cd886;}})});}_0x5b2fab=_[_0xbe58('0x2f')]({},_0x5b2fab,_0x1e3f28['options']);var _0x42e218={'where':_0x5b2fab[_0xbe58('0x2d')]};return db[_0xbe58('0x1e')][_0xbe58('0xe')](_0x42e218)['then'](function(_0x22757e){_0x547595[_0xbe58('0xe')]=_0x22757e;if(_0x1e3f28[_0xbe58('0x2a')][_0xbe58('0x32')]){_0x5b2fab[_0xbe58('0x33')]=[{'all':!![]}];}return db['CloudProvider'][_0xbe58('0x34')](_0x5b2fab);})['then'](function(_0x376256){_0x547595[_0xbe58('0x35')]=_['map'](_0x376256,function(_0x562ce0){if(_0x562ce0[_0xbe58('0x36')]===_0xbe58('0x37')){var _0x3a81a4=encryptor[_0xbe58('0x38')](_0x562ce0[_0xbe58('0x39')]);_0x562ce0[_0xbe58('0x39')]=maskClientSecret(_0x3a81a4);}return _0x562ce0;});return _0x547595;})['then'](respondWithFilteredResult(_0x51e08c,_0x5b2fab))[_0xbe58('0x3a')](handleError(_0x51e08c,null));};exports[_0xbe58('0x3b')]=function(_0x2f6254,_0x1c5738){var _0x12daab={'raw':!![],'where':{'id':_0x2f6254[_0xbe58('0x3c')]['id']}},_0x5526cf={};_0x5526cf[_0xbe58('0x23')]=_['keys'](db['CloudProvider'][_0xbe58('0x1f')]);_0x5526cf[_0xbe58('0x2a')]=_['keys'](_0x2f6254[_0xbe58('0x2a')]);_0x5526cf[_0xbe58('0x24')]=_[_0xbe58('0x25')](_0x5526cf[_0xbe58('0x23')],_0x5526cf[_0xbe58('0x2a')]);_0x12daab[_0xbe58('0x26')]=_[_0xbe58('0x25')](_0x5526cf['model'],qs[_0xbe58('0x27')](_0x2f6254[_0xbe58('0x2a')][_0xbe58('0x27')]));_0x12daab['attributes']=_0x12daab['attributes']['length']?_0x12daab['attributes']:_0x5526cf['model'];if(_0x2f6254[_0xbe58('0x2a')][_0xbe58('0x32')]){_0x12daab[_0xbe58('0x33')]=[{'all':!![]}];}_0x12daab=_[_0xbe58('0x2f')]({},_0x12daab,_0x2f6254[_0xbe58('0x3d')]);return db[_0xbe58('0x1e')][_0xbe58('0x3e')](_0x12daab)[_0xbe58('0x14')](handleEntityNotFound(_0x1c5738,null))['then'](function(_0x28e0bb){if(_0x28e0bb[_0xbe58('0x36')]===_0xbe58('0x37')){var _0xaee2bf=encryptor[_0xbe58('0x38')](_0x28e0bb[_0xbe58('0x39')]);_0x28e0bb['data3']=maskClientSecret(_0xaee2bf);}return _0x28e0bb;})['then'](respondWithResult(_0x1c5738,null))['catch'](handleError(_0x1c5738,null));};exports['create']=function(_0x9d9a1e,_0x332a09){if(!_0x9d9a1e[_0xbe58('0x3f')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x9d9a1e['body']['service'])throw new Error(_0xbe58('0x40'));var _0x925f3b=db['CloudProvider']['rawAttributes']['service']['values'];if(!_0x925f3b['includes'](_0x9d9a1e['body'][_0xbe58('0x36')]))throw new Error(_0xbe58('0x41')+_0x925f3b[_0xbe58('0x42')](',\x20'));if(_0x9d9a1e['body'][_0xbe58('0x36')]===_0xbe58('0x37')&&_0x9d9a1e[_0xbe58('0x3f')][_0xbe58('0x39')]){_0x9d9a1e[_0xbe58('0x3f')][_0xbe58('0x39')]=encryptor[_0xbe58('0x43')](_0x9d9a1e[_0xbe58('0x3f')][_0xbe58('0x39')]);}return db[_0xbe58('0x1e')][_0xbe58('0x44')](_0x9d9a1e['body'],{})[_0xbe58('0x14')](respondWithResult(_0x332a09,0xc9))[_0xbe58('0x3a')](handleError(_0x332a09,null));};exports[_0xbe58('0x13')]=function(_0x209125,_0xb6fad6){if(_0x209125[_0xbe58('0x3f')]['id']){delete _0x209125[_0xbe58('0x3f')]['id'];}return db[_0xbe58('0x1e')]['find']({'where':{'id':_0x209125[_0xbe58('0x3c')]['id']}})['then'](handleEntityNotFound(_0xb6fad6,null))[_0xbe58('0x14')](function(_0x3b343e){if(_0x3b343e[_0xbe58('0x36')]==='MicrosoftAzure'&&_0x209125[_0xbe58('0x3f')][_0xbe58('0x39')]){_0x209125['body']['data3']=encryptor[_0xbe58('0x43')](_0x209125[_0xbe58('0x3f')][_0xbe58('0x39')]);}return _0x3b343e;})[_0xbe58('0x14')](saveUpdates(_0x209125[_0xbe58('0x3f')],null))['then'](respondWithResult(_0xb6fad6,null))['catch'](handleError(_0xb6fad6,null));};exports[_0xbe58('0x15')]=function(_0x2bbcae,_0x3f60bd){return db['CloudProvider'][_0xbe58('0x3e')]({'where':{'id':_0x2bbcae['params']['id']}})[_0xbe58('0x14')](handleEntityNotFound(_0x3f60bd,null))[_0xbe58('0x14')](removeEntity(_0x3f60bd,null))[_0xbe58('0x3a')](handleError(_0x3f60bd,null));};exports[_0xbe58('0x45')]=function(_0x92d27c,_0x37ff42){return db['CloudProvider'][_0xbe58('0x46')]({'where':{'id':_0x92d27c[_0xbe58('0x3c')]['id']},'raw':!![]})['then'](function(_0x358dc2){if(!_0x358dc2)return _0x37ff42[_0xbe58('0xa')](0x194);return{'url':oauth[_0xbe58('0x47')](_0x358dc2,_0x92d27c[_0xbe58('0x48')]['id'])};})['then'](respondWithResult(_0x37ff42,null))[_0xbe58('0x3a')](handleError(_0x37ff42,null));};exports[_0xbe58('0x49')]=function(_0x32c10c,_0x472a82){var _0xabfaf5=_0x32c10c['body'];var _0x1b7c50;var _0x48b7f8;if(_0xabfaf5[_0xbe58('0x16')])throw _0xabfaf5;redis['get'](_0xabfaf5[_0xbe58('0x4a')])['then'](function(_0x443a07){if(!_0x443a07)throw new Error(_0xbe58('0x4b'));_0x1b7c50=JSON[_0xbe58('0x4c')](_0x443a07);var _0x59052e=Buffer[_0xbe58('0x4d')](_0xabfaf5[_0xbe58('0x4a')],_0xbe58('0x4e'))['toString'](_0xbe58('0x4f'));_0x48b7f8=JSON['parse'](_0x59052e);if(!oauth[_0xbe58('0x50')](_0xabfaf5[_0xbe58('0x51')],_0x1b7c50[_0xbe58('0x52')]))throw new Error(_0xbe58('0x53'));redis[_0xbe58('0x54')](_0xabfaf5[_0xbe58('0x4a')]);return oauth['getOauth2MicrosoftAccessToken'](_0xabfaf5[_0xbe58('0x55')],_0x1b7c50);})[_0xbe58('0x14')](function(_0x4ebeff){_0x1b7c50[_0xbe58('0x56')]=_0x4ebeff[_0xbe58('0x57')];_0x1b7c50[_0xbe58('0x58')]=_0x4ebeff[_0xbe58('0x59')];return db[_0xbe58('0x1e')][_0xbe58('0x13')]({'data5':_0x1b7c50[_0xbe58('0x56')],'data6':_0x1b7c50[_0xbe58('0x58')]},{'where':{'id':_0x1b7c50['id']}});})[_0xbe58('0x14')](function(){oauth[_0xbe58('0x5a')](_0x1b7c50);socket[_0xbe58('0x5b')](_0xbe58('0x5c'),{'id':_0x48b7f8['id']});return;})[_0xbe58('0x14')](respondWithStatusCode(_0x472a82,null))['catch'](function(_0x5060a1){if(_0x48b7f8){socket[_0xbe58('0x5b')]('microsoftAuthorization:error',{'id':_0x48b7f8['id']});}if(!_0x1b7c50){logger[_0xbe58('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x5060a1);return _0x472a82[_0xbe58('0xb')](0x1f4)[_0xbe58('0x19')](_0x5060a1[_0xbe58('0x5d')]);}logger['error'](_0xbe58('0x5e'),_0x1b7c50['id'],JSON[_0xbe58('0x5f')](_0x5060a1));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index bfdea8c..8a500e3 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 _0xb965=['request-promise','../../config/environment','exports','define','CloudProvider','cloud_providers','lodash','util','api','moment','bluebird'];(function(_0x21b438,_0x45de54){var _0x2d1fcf=function(_0xce22d7){while(--_0xce22d7){_0x21b438['push'](_0x21b438['shift']());}};_0x2d1fcf(++_0x45de54);}(_0xb965,0x15b));var _0x5b96=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0xb965[_0x382a62];return _0x490a25;};'use strict';var _=require(_0x5b96('0x0'));var util=require(_0x5b96('0x1'));var logger=require('../../config/logger')(_0x5b96('0x2'));var moment=require(_0x5b96('0x3'));var BPromise=require(_0x5b96('0x4'));var rp=require(_0x5b96('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5b96('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x5b96('0x7')]=function(_0x95655,_0x29935c){return _0x95655[_0x5b96('0x8')](_0x5b96('0x9'),attributes,{'tableName':_0x5b96('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfcd7=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes'];(function(_0x3348b6,_0x4fa79f){var _0xb4f7e0=function(_0x3d1958){while(--_0x3d1958){_0x3348b6['push'](_0x3348b6['shift']());}};_0xb4f7e0(++_0x4fa79f);}(_0xfcd7,0x198));var _0x7fcd=function(_0x17483e,_0x115c9a){_0x17483e=_0x17483e-0x0;var _0x507e15=_0xfcd7[_0x17483e];return _0x507e15;};'use strict';var _=require('lodash');var util=require(_0x7fcd('0x0'));var logger=require(_0x7fcd('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7fcd('0x2'));var rp=require(_0x7fcd('0x3'));var fs=require('fs');var path=require(_0x7fcd('0x4'));var rimraf=require(_0x7fcd('0x5'));var config=require(_0x7fcd('0x6'));var attributes=require(_0x7fcd('0x7'));module['exports']=function(_0x3743be,_0x4f3266){return _0x3743be['define']('CloudProvider',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 d12dfea..f67b8f2 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 _0x227e=['id_token','stringify','toString','base64','hex','client_id','data1','response_type','join','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','key','value','set','decode','payload','iss','issuer','aud','isAfter','exp','resolve','then','data3','CloudProvider','findOne','data6','decryptString','POST','data5','access_token','intervals','bind','findAll','catch','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','/token','map','type','push','data7','Outlook365','replace','{TENANT_ID}','data2','code'];(function(_0x28d21b,_0x29693c){var _0x1b1c41=function(_0x4d73f6){while(--_0x4d73f6){_0x28d21b['push'](_0x28d21b['shift']());}};_0x1b1c41(++_0x29693c);}(_0x227e,0x75));var _0xe227=function(_0x1ed95b,_0x1e0bbe){_0x1ed95b=_0x1ed95b-0x0;var _0x4d96a8=_0x227e[_0x1ed95b];return _0x4d96a8;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0xe227('0x0'));var encryptor=require(_0xe227('0x1'));var config=require(_0xe227('0x2'));var logger=require(_0xe227('0x3'))(_0xe227('0x4'));var schedule=require(_0xe227('0x5'));var db=require(_0xe227('0x6'))['db'];config[_0xe227('0x7')]=_[_0xe227('0x8')](config['redis'],{'host':_0xe227('0x9'),'port':0x18eb});var redis=new Redis(config[_0xe227('0x7')]);var MICROSOFT_AUTH_URL=_0xe227('0xa');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xe227('0xb'),_0xe227('0xc'),_0xe227('0xd'),_0xe227('0xe'),_0xe227('0xf'),_0xe227('0x10')],'Dynamics365':[_0xe227('0x11'),_0xe227('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0xe227('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xe227('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5b338a){var _0x4479a5=_[_0xe227('0x14')](AZURE_AUTH_SCOPES[_0x5b338a[_0xe227('0x15')]]);if(_0x5b338a['type']==='Dynamics365')_0x4479a5[_0xe227('0x16')](_0x5b338a[_0xe227('0x17')]+'/.default');return _0x4479a5['join']('\x20');}function getAccessTokenScope(_0x151f03){if(_0x151f03[_0xe227('0x15')]===_0xe227('0x18'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x151f03[_0xe227('0x15')]==='Dynamics365')return _0x151f03[_0xe227('0x17')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x4c8fb3,_0x48dad3){var _0x460eb0=MICROSOFT_AUTH_URL[_0xe227('0x19')](_0xe227('0x1a'),_0x4c8fb3[_0xe227('0x1b')]);var _0x470ed3=[_0xe227('0x1c'),_0xe227('0x1d')];var _0x5150d0=Buffer['from'](JSON[_0xe227('0x1e')]({'id':_0x48dad3}))[_0xe227('0x1f')](_0xe227('0x20'));var _0x4e6a47=crypto['randomBytes'](0x10)['toString'](_0xe227('0x21'));var _0x36af94=getAuthorizationScopes(_0x4c8fb3);var _0x57c448=[{'key':_0xe227('0x22'),'value':_0x4c8fb3[_0xe227('0x23')]},{'key':_0xe227('0x24'),'value':encodeURIComponent(_0x470ed3[_0xe227('0x25')]('\x20'))},{'key':_0xe227('0x26'),'value':_0x4c8fb3[_0xe227('0x27')]},{'key':_0xe227('0x28'),'value':_0xe227('0x29')},{'key':_0xe227('0x2a'),'value':encodeURIComponent(_0x36af94)},{'key':_0xe227('0x2b'),'value':_0x5150d0},{'key':_0xe227('0x2c'),'value':_0x4e6a47},{'key':_0xe227('0x2d'),'value':_0xe227('0x2e')}];var _0x1ce688=_0x460eb0+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x57c448,function(_0x273ac8){return _0x273ac8[_0xe227('0x2f')]+'='+_0x273ac8[_0xe227('0x30')];})[_0xe227('0x25')]('&');_0x4c8fb3['oauth2Claims']={'issuer':_0x460eb0[_0xe227('0x19')]('oauth2/',''),'audience':_0x4c8fb3[_0xe227('0x23')],'state':_0x5150d0,'nonce':_0x4e6a47};redis[_0xe227('0x31')](_0x5150d0,JSON['stringify'](_0x4c8fb3));return _0x1ce688;}function isValidIdToken(_0x53e28c,_0xba4703){try{var _0x2b228a=jwt[_0xe227('0x32')](_0x53e28c,{'complete':!![]});var _0x21fdbe=_0x2b228a[_0xe227('0x33')];if(_0x21fdbe[_0xe227('0x34')]!==_0xba4703[_0xe227('0x35')])return![];if(_0x21fdbe[_0xe227('0x36')]!==_0xba4703['audience'])return![];if(_0x21fdbe[_0xe227('0x2c')]!==_0xba4703[_0xe227('0x2c')])return![];if(moment()[_0xe227('0x37')](moment['unix'](_0x21fdbe[_0xe227('0x38')])))return![];return!![];}catch(_0x88d3e6){throw _0x88d3e6;}}function refreshOauth2MicrosoftAccessToken(_0x481f9c){return Promise[_0xe227('0x39')]()[_0xe227('0x3a')](function(){if(_0x481f9c[_0xe227('0x3b')])return _0x481f9c;return db[_0xe227('0x3c')][_0xe227('0x3d')]({'where':{'id':_0x481f9c['id']},'raw':!![]});})[_0xe227('0x3a')](function(_0x80e0e2){var _0x4f7dde={'grant_type':'refresh_token','refresh_token':_0x80e0e2[_0xe227('0x3e')],'scope':getAccessTokenScope(_0x80e0e2),'redirect_uri':_0x80e0e2['data4'],'client_id':_0x80e0e2[_0xe227('0x23')],'client_secret':encryptor[_0xe227('0x3f')](_0x80e0e2[_0xe227('0x3b')])};var _0xf0b447={'method':_0xe227('0x40'),'uri':MICROSOFT_AUTH_URL[_0xe227('0x19')](_0xe227('0x1a'),_0x80e0e2[_0xe227('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4f7dde,'json':!![]};return rp(_0xf0b447);})['then'](function(_0x5b2afd){_0x481f9c[_0xe227('0x41')]=_0x5b2afd[_0xe227('0x42')];_0x481f9c['data6']=_0x5b2afd['refresh_token'];return db[_0xe227('0x3c')]['update']({'data5':_0x481f9c[_0xe227('0x41')],'data6':_0x481f9c['data6']},{'where':{'id':_0x481f9c['id']}});})[_0xe227('0x3a')](function(){return _0x481f9c;})['catch'](function(_0x40b2e9){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x481f9c['id'],_0x40b2e9);});}function getOauth2MicrosoftAccessToken(_0x23d953,_0x176afa){var _0xa593b5={'grant_type':'authorization_code','code':_0x23d953,'scope':getAccessTokenScope(_0x176afa),'redirect_uri':_0x176afa[_0xe227('0x27')],'client_id':_0x176afa['data1'],'client_secret':encryptor[_0xe227('0x3f')](_0x176afa[_0xe227('0x3b')])};var _0x35f8e1={'method':_0xe227('0x40'),'uri':MICROSOFT_AUTH_URL[_0xe227('0x19')](_0xe227('0x1a'),_0x176afa[_0xe227('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xa593b5,'json':!![]};return rp(_0x35f8e1);}function startRefreshInterval(_0x3bbaa7){var _0x30c6d7=schedule[_0xe227('0x43')];if(_0x30c6d7[_0x3bbaa7['id']])clearInterval(_0x30c6d7[_0x3bbaa7['id']]);_0x30c6d7[_0x3bbaa7['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xe227('0x44')](this,{'id':_0x3bbaa7['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xe227('0x43')]=_0x30c6d7;}function startAllRefreshIntervals(){return db[_0xe227('0x3c')][_0xe227('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xe227('0x3a')](function(_0x5a6399){var _0x2b825f=_0x5a6399[_0xe227('0x14')](function(_0x35f9b8){return refreshOauth2MicrosoftAccessToken(_0x35f9b8)[_0xe227('0x3a')](function(_0x529847){startRefreshInterval(_0x529847);});});return Promise['all'](_0x2b825f);})[_0xe227('0x46')](function(_0x12614d){var _0x525040=_0x12614d?util['inspect'](_0x12614d,{'showHidden':![],'depth':null}):'';logger[_0xe227('0x47')](_0xe227('0x48'),_0x525040);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x3118=['data4','form_post','scope','state','nonce','prompt','login','map','key','value','oauth2Claims','oauth2/','set','stringify','decode','iss','issuer','aud','audience','isAfter','unix','exp','then','data3','CloudProvider','findOne','refresh_token','{TENANT_ID}','data2','access_token','data6','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','POST','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','openid','/authorize','/token','type','data7','/.default','join','Dynamics365','replace','from','toString','base64','hex','client_id','data1','response_type','redirect_uri'];(function(_0x32faea,_0x3235d7){var _0x152fe9=function(_0x2f83e7){while(--_0x2f83e7){_0x32faea['push'](_0x32faea['shift']());}};_0x152fe9(++_0x3235d7);}(_0x3118,0x7e));var _0x8311=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x3118[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x8311('0x0'));var crypto=require(_0x8311('0x1'));var jwt=require(_0x8311('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0x8311('0x3'));var encryptor=require('../../components/encryptor');var config=require(_0x8311('0x4'));var logger=require(_0x8311('0x5'))(_0x8311('0x6'));var schedule=require(_0x8311('0x7'));var db=require(_0x8311('0x8'))['db'];config['redis']=_[_0x8311('0x9')](config[_0x8311('0xa')],{'host':_0x8311('0xb'),'port':0x18eb});var redis=new Redis(config[_0x8311('0xa')]);var MICROSOFT_AUTH_URL=_0x8311('0xc');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x8311('0xd'),_0x8311('0xe'),_0x8311('0xf'),_0x8311('0x10'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x8311('0x11'),_0x8311('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x8311('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x8311('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x32f6e8){var _0x564e42=_['map'](AZURE_AUTH_SCOPES[_0x32f6e8[_0x8311('0x14')]]);if(_0x32f6e8[_0x8311('0x14')]==='Dynamics365')_0x564e42['push'](_0x32f6e8[_0x8311('0x15')]+_0x8311('0x16'));return _0x564e42[_0x8311('0x17')]('\x20');}function getAccessTokenScope(_0x47a059){if(_0x47a059['type']==='Outlook365')return _0x8311('0x10');if(_0x47a059[_0x8311('0x14')]===_0x8311('0x18'))return _0x47a059[_0x8311('0x15')]+_0x8311('0x16');}function generateMicrosoftAuthorizationUrl(_0x3f6157,_0x4f904b){var _0x50b927=MICROSOFT_AUTH_URL[_0x8311('0x19')]('{TENANT_ID}',_0x3f6157['data2']);var _0x1ed1da=['code','id_token'];var _0x548850=Buffer[_0x8311('0x1a')](JSON['stringify']({'id':_0x4f904b}))[_0x8311('0x1b')](_0x8311('0x1c'));var _0x45d11a=crypto['randomBytes'](0x10)[_0x8311('0x1b')](_0x8311('0x1d'));var _0x82491b=getAuthorizationScopes(_0x3f6157);var _0x1e1518=[{'key':_0x8311('0x1e'),'value':_0x3f6157[_0x8311('0x1f')]},{'key':_0x8311('0x20'),'value':encodeURIComponent(_0x1ed1da[_0x8311('0x17')]('\x20'))},{'key':_0x8311('0x21'),'value':_0x3f6157[_0x8311('0x22')]},{'key':'response_mode','value':_0x8311('0x23')},{'key':_0x8311('0x24'),'value':encodeURIComponent(_0x82491b)},{'key':_0x8311('0x25'),'value':_0x548850},{'key':_0x8311('0x26'),'value':_0x45d11a},{'key':_0x8311('0x27'),'value':_0x8311('0x28')}];var _0x2b5cc6=_0x50b927+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x8311('0x29')](_0x1e1518,function(_0x3c8549){return _0x3c8549[_0x8311('0x2a')]+'='+_0x3c8549[_0x8311('0x2b')];})[_0x8311('0x17')]('&');_0x3f6157[_0x8311('0x2c')]={'issuer':_0x50b927[_0x8311('0x19')](_0x8311('0x2d'),''),'audience':_0x3f6157[_0x8311('0x1f')],'state':_0x548850,'nonce':_0x45d11a};redis[_0x8311('0x2e')](_0x548850,JSON[_0x8311('0x2f')](_0x3f6157));return _0x2b5cc6;}function isValidIdToken(_0x158a6d,_0x6c6aeb){try{var _0x5460a9=jwt[_0x8311('0x30')](_0x158a6d,{'complete':!![]});var _0x16d446=_0x5460a9['payload'];if(_0x16d446[_0x8311('0x31')]!==_0x6c6aeb[_0x8311('0x32')])return![];if(_0x16d446[_0x8311('0x33')]!==_0x6c6aeb[_0x8311('0x34')])return![];if(_0x16d446['nonce']!==_0x6c6aeb[_0x8311('0x26')])return![];if(moment()[_0x8311('0x35')](moment[_0x8311('0x36')](_0x16d446[_0x8311('0x37')])))return![];return!![];}catch(_0x4a3eaf){throw _0x4a3eaf;}}function refreshOauth2MicrosoftAccessToken(_0x3abc07){return Promise['resolve']()[_0x8311('0x38')](function(){if(_0x3abc07[_0x8311('0x39')])return _0x3abc07;return db[_0x8311('0x3a')][_0x8311('0x3b')]({'where':{'id':_0x3abc07['id']},'raw':!![]});})[_0x8311('0x38')](function(_0xf1073a){var _0x24726e={'grant_type':_0x8311('0x3c'),'refresh_token':_0xf1073a['data6'],'scope':getAccessTokenScope(_0xf1073a),'redirect_uri':_0xf1073a[_0x8311('0x22')],'client_id':_0xf1073a['data1'],'client_secret':encryptor['decryptString'](_0xf1073a[_0x8311('0x39')])};var _0x162d46={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x8311('0x19')](_0x8311('0x3d'),_0xf1073a[_0x8311('0x3e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x24726e,'json':!![]};return rp(_0x162d46);})[_0x8311('0x38')](function(_0x32e10a){_0x3abc07['data5']=_0x32e10a[_0x8311('0x3f')];_0x3abc07[_0x8311('0x40')]=_0x32e10a[_0x8311('0x3c')];return db[_0x8311('0x3a')][_0x8311('0x41')]({'data5':_0x3abc07[_0x8311('0x42')],'data6':_0x3abc07[_0x8311('0x40')]},{'where':{'id':_0x3abc07['id']}});})[_0x8311('0x38')](function(){return _0x3abc07;})[_0x8311('0x43')](function(_0x599bb3){logger[_0x8311('0x44')](_0x8311('0x45'),_0x3abc07['id'],_0x599bb3);});}function getOauth2MicrosoftAccessToken(_0x5502e4,_0x258ed1){var _0x302313={'grant_type':_0x8311('0x46'),'code':_0x5502e4,'scope':getAccessTokenScope(_0x258ed1),'redirect_uri':_0x258ed1[_0x8311('0x22')],'client_id':_0x258ed1[_0x8311('0x1f')],'client_secret':encryptor[_0x8311('0x47')](_0x258ed1[_0x8311('0x39')])};var _0x119e4d={'method':_0x8311('0x48'),'uri':MICROSOFT_AUTH_URL[_0x8311('0x19')](_0x8311('0x3d'),_0x258ed1[_0x8311('0x3e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x302313,'json':!![]};return rp(_0x119e4d);}function startRefreshInterval(_0x5591e8){var _0xa9d474=schedule[_0x8311('0x49')];if(_0xa9d474[_0x5591e8['id']])clearInterval(_0xa9d474[_0x5591e8['id']]);_0xa9d474[_0x5591e8['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8311('0x4a')](this,{'id':_0x5591e8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0xa9d474;}function startAllRefreshIntervals(){return db[_0x8311('0x3a')][_0x8311('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8311('0x38')](function(_0x340a2f){var _0x3300de=_0x340a2f[_0x8311('0x29')](function(_0x529ba6){return refreshOauth2MicrosoftAccessToken(_0x529ba6)[_0x8311('0x38')](function(_0xbdc990){startRefreshInterval(_0xbdc990);});});return Promise[_0x8311('0x4c')](_0x3300de);})[_0x8311('0x43')](function(_0x4be096){var _0x33a302=_0x4be096?util[_0x8311('0x4d')](_0x4be096,{'showHidden':![],'depth':null}):'';logger[_0x8311('0x44')](_0x8311('0x4e'),_0x33a302);});}module[_0x8311('0x4f')]={'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 5987229..d4d72bc 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 _0x26c2=['request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CloudProvider,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x26c2,0x1d6));var _0x226c=function(_0x3a54b1,_0x2a93cd){_0x3a54b1=_0x3a54b1-0x0;var _0x5b451b=_0x26c2[_0x3a54b1];return _0x5b451b;};'use strict';var _=require('lodash');var util=require(_0x226c('0x0'));var moment=require(_0x226c('0x1'));var BPromise=require(_0x226c('0x2'));var rs=require(_0x226c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x226c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x226c('0x5'))(_0x226c('0x6'));var config=require(_0x226c('0x7'));var jayson=require(_0x226c('0x8'));var client=jayson[_0x226c('0x9')][_0x226c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23ccdb,_0x50654d,_0x58ebd8){return new BPromise(function(_0x53fc4f,_0x10cae2){return client[_0x226c('0xb')](_0x23ccdb,_0x58ebd8)['then'](function(_0x475e09){logger[_0x226c('0xc')](_0x226c('0xd'),_0x50654d,_0x226c('0xe'));logger[_0x226c('0xf')](_0x226c('0x10'),_0x50654d,_0x226c('0xe'),JSON['stringify'](_0x475e09));if(_0x475e09['error']){if(_0x475e09[_0x226c('0x11')][_0x226c('0x12')]===0x1f4){logger[_0x226c('0x11')](_0x226c('0xd'),_0x50654d,_0x475e09['error']['message']);return _0x10cae2(_0x475e09[_0x226c('0x11')][_0x226c('0x13')]);}logger[_0x226c('0x11')](_0x226c('0xd'),_0x50654d,_0x475e09[_0x226c('0x11')]['message']);return _0x53fc4f(_0x475e09[_0x226c('0x11')][_0x226c('0x13')]);}else{logger[_0x226c('0xc')]('CloudProvider,\x20%s,\x20%s',_0x50654d,_0x226c('0xe'));_0x53fc4f(_0x475e09[_0x226c('0x14')][_0x226c('0x13')]);}})[_0x226c('0x15')](function(_0x3b6d9a){logger[_0x226c('0x11')](_0x226c('0xd'),_0x50654d,_0x3b6d9a);_0x10cae2(_0x3b6d9a);});});}
\ No newline at end of file
+var _0x1c77=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird'];(function(_0x179b7b,_0x57b44d){var _0x5eea20=function(_0x5582aa){while(--_0x5582aa){_0x179b7b['push'](_0x179b7b['shift']());}};_0x5eea20(++_0x57b44d);}(_0x1c77,0xed));var _0x71c7=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0x1c77[_0x207811];return _0x170d56;};'use strict';var _=require('lodash');var util=require(_0x71c7('0x0'));var moment=require(_0x71c7('0x1'));var BPromise=require(_0x71c7('0x2'));var rs=require(_0x71c7('0x3'));var fs=require('fs');var Redis=require(_0x71c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x71c7('0x5'));var logger=require(_0x71c7('0x6'))(_0x71c7('0x7'));var config=require(_0x71c7('0x8'));var jayson=require(_0x71c7('0x9'));var client=jayson[_0x71c7('0xa')][_0x71c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57fb10,_0x57bbb6,_0x2c25a4){return new BPromise(function(_0x244867,_0x229b00){return client[_0x71c7('0xc')](_0x57fb10,_0x2c25a4)['then'](function(_0x1f5fc9){logger['info']('CloudProvider,\x20%s,\x20%s',_0x57bbb6,_0x71c7('0xd'));logger[_0x71c7('0xe')](_0x71c7('0xf'),_0x57bbb6,_0x71c7('0xd'),JSON[_0x71c7('0x10')](_0x1f5fc9));if(_0x1f5fc9['error']){if(_0x1f5fc9[_0x71c7('0x11')][_0x71c7('0x12')]===0x1f4){logger[_0x71c7('0x11')](_0x71c7('0x13'),_0x57bbb6,_0x1f5fc9['error'][_0x71c7('0x14')]);return _0x229b00(_0x1f5fc9[_0x71c7('0x11')][_0x71c7('0x14')]);}logger[_0x71c7('0x11')](_0x71c7('0x13'),_0x57bbb6,_0x1f5fc9[_0x71c7('0x11')]['message']);return _0x244867(_0x1f5fc9['error'][_0x71c7('0x14')]);}else{logger[_0x71c7('0x15')](_0x71c7('0x13'),_0x57bbb6,_0x71c7('0xd'));_0x244867(_0x1f5fc9[_0x71c7('0x16')][_0x71c7('0x14')]);}})[_0x71c7('0x17')](function(_0x115262){logger['error'](_0x71c7('0x13'),_0x57bbb6,_0x115262);_0x229b00(_0x115262);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 6a708ef..96a3747 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 _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0x5f2f,0x73));var _0xf5f2=function(_0x214c21,_0x545f27){_0x214c21=_0x214c21-0x0;var _0x34b2cf=_0x5f2f[_0x214c21];return _0x34b2cf;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
+var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x7a54,0x106));var _0x47a5=function(_0x150930,_0x22a97b){_0x150930=_0x150930-0x0;var _0x3dce60=_0x7a54[_0x150930];return _0x3dce60;};'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
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 162d2e4..01a586b 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 _0x4172=['sequelize','STRING','name'];(function(_0x541095,_0x582b30){var _0x5a2c40=function(_0xb7650f){while(--_0xb7650f){_0x541095['push'](_0x541095['shift']());}};_0x5a2c40(++_0x582b30);}(_0x4172,0x1aa));var _0x2417=function(_0x1293dc,_0x285c24){_0x1293dc=_0x1293dc-0x0;var _0x3f8089=_0x4172[_0x1293dc];return _0x3f8089;};'use strict';var Sequelize=require(_0x2417('0x0'));module['exports']={'name':{'type':Sequelize[_0x2417('0x1')],'unique':_0x2417('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2417('0x1')]},'companyId':{'type':Sequelize[_0x2417('0x1')]},'website':{'type':Sequelize[_0x2417('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2417('0x1')]},'street':{'type':Sequelize[_0x2417('0x1')]},'postalCode':{'type':Sequelize[_0x2417('0x1')]},'city':{'type':Sequelize[_0x2417('0x1')]},'country':{'type':Sequelize[_0x2417('0x1')]},'email':{'type':Sequelize[_0x2417('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2417('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x2417('0x1')]},'sCity':{'type':Sequelize[_0x2417('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2417('0x1')]}};
\ No newline at end of file
+var _0xbf22=['sequelize','exports','name','STRING'];(function(_0x3a5ac2,_0x4c9440){var _0x3df059=function(_0x5c04a4){while(--_0x5c04a4){_0x3a5ac2['push'](_0x3a5ac2['shift']());}};_0x3df059(++_0x4c9440);}(_0xbf22,0x11c));var _0x2bf2=function(_0x293fc0,_0x6e53d9){_0x293fc0=_0x293fc0-0x0;var _0x1e1a7c=_0xbf22[_0x293fc0];return _0x1e1a7c;};'use strict';var Sequelize=require(_0x2bf2('0x0'));module[_0x2bf2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2bf2('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x2bf2('0x3')]},'website':{'type':Sequelize[_0x2bf2('0x3')]},'phone':{'type':Sequelize[_0x2bf2('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2bf2('0x3')]},'street':{'type':Sequelize[_0x2bf2('0x3')]},'postalCode':{'type':Sequelize[_0x2bf2('0x3')]},'city':{'type':Sequelize[_0x2bf2('0x3')]},'country':{'type':Sequelize[_0x2bf2('0x3')]},'email':{'type':Sequelize[_0x2bf2('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x2bf2('0x3')]},'sPostalCode':{'type':Sequelize[_0x2bf2('0x3')]},'sCity':{'type':Sequelize[_0x2bf2('0x3')]},'sCountry':{'type':Sequelize[_0x2bf2('0x3')]},'description':{'type':Sequelize[_0x2bf2('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index d2dc0a8..4daf7a7 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 _0xb10d=['send','index','CmCompany','describe','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','findOne','CmContact','pick','filter','map','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Companies','UserProfileResource','error','stack','name'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xb10d,0x132));var _0xdb10=function(_0x10b466,_0x18194f){_0x10b466=_0x10b466-0x0;var _0x2e860a=_0xb10d[_0x10b466];return _0x2e860a;};'use strict';var emlformat=require(_0xdb10('0x0'));var rimraf=require(_0xdb10('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb10('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdb10('0x3'));var Mustache=require(_0xdb10('0x4'));var util=require(_0xdb10('0x5'));var path=require(_0xdb10('0x6'));var sox=require(_0xdb10('0x7'));var csv=require(_0xdb10('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb10('0x9'));var _=require('lodash');var squel=require(_0xdb10('0xa'));var crypto=require(_0xdb10('0xb'));var jsforce=require(_0xdb10('0xc'));var deskjs=require(_0xdb10('0xd'));var toCsv=require(_0xdb10('0x8'));var querystring=require('querystring');var Papa=require(_0xdb10('0xe'));var Redis=require('ioredis');var authService=require(_0xdb10('0xf'));var qs=require(_0xdb10('0x10'));var as=require(_0xdb10('0x11'));var hardwareService=require(_0xdb10('0x12'));var logger=require(_0xdb10('0x13'))(_0xdb10('0x14'));var utils=require(_0xdb10('0x15'));var config=require(_0xdb10('0x16'));var licenseUtil=require(_0xdb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39fa93,_0x1df989){_0x1df989=_0x1df989||0xcc;return function(_0x3401e0){if(_0x3401e0){return _0x39fa93[_0xdb10('0x18')](_0x1df989);}return _0x39fa93[_0xdb10('0x19')](_0x1df989)[_0xdb10('0x1a')]();};}function respondWithResult(_0x25bbed,_0x2c8df9){_0x2c8df9=_0x2c8df9||0xc8;return function(_0x4dc75d){if(_0x4dc75d){return _0x25bbed[_0xdb10('0x19')](_0x2c8df9)[_0xdb10('0x1b')](_0x4dc75d);}};}function respondWithFilteredResult(_0x168f30,_0x508824){return function(_0x5f58c0){if(_0x5f58c0){var _0x388441=typeof _0x508824['offset']===_0xdb10('0x1c')&&typeof _0x508824[_0xdb10('0x1d')]===_0xdb10('0x1c');var _0x3ef485=_0x5f58c0[_0xdb10('0x1e')];var _0x263170=_0x388441?0x0:_0x508824[_0xdb10('0x1f')];var _0x1f5f47=_0x388441?_0x5f58c0['count']:_0x508824['offset']+_0x508824[_0xdb10('0x1d')];var _0x4b3b19;if(_0x1f5f47>=_0x3ef485){_0x1f5f47=_0x3ef485;_0x4b3b19=0xc8;}else{_0x4b3b19=0xce;}_0x168f30[_0xdb10('0x19')](_0x4b3b19);return _0x168f30[_0xdb10('0x20')](_0xdb10('0x21'),_0x263170+'-'+_0x1f5f47+'/'+_0x3ef485)[_0xdb10('0x1b')](_0x5f58c0);}return null;};}function patchUpdates(_0x93883){return function(_0x44b880){try{jsonpatch[_0xdb10('0x22')](_0x44b880,_0x93883,!![]);}catch(_0x58216f){return BPromise[_0xdb10('0x23')](_0x58216f);}return _0x44b880[_0xdb10('0x24')]();};}function saveUpdates(_0x4709b4,_0x445919){return function(_0x134cfc){if(_0x134cfc){return _0x134cfc[_0xdb10('0x25')](_0x4709b4)['then'](function(_0x491161){return _0x491161;});}return null;};}function removeEntity(_0x2b31c7,_0x250810){return function(_0x577e95){if(_0x577e95){return _0x577e95[_0xdb10('0x26')]()[_0xdb10('0x27')](function(){var _0x2185b2=_0x577e95[_0xdb10('0x28')]({'plain':!![]});var _0x1e7cc7=_0xdb10('0x29');return db[_0xdb10('0x2a')][_0xdb10('0x26')]({'where':{'type':_0x1e7cc7,'resourceId':_0x2185b2['id']}})[_0xdb10('0x27')](function(){return _0x577e95;});})[_0xdb10('0x27')](function(){_0x2b31c7[_0xdb10('0x19')](0xcc)[_0xdb10('0x1a')]();});}};}function handleEntityNotFound(_0x2d6998,_0x5f0d47){return function(_0x5995cc){if(!_0x5995cc){_0x2d6998['sendStatus'](0x194);}return _0x5995cc;};}function handleError(_0x3582d5,_0x3b6d77){_0x3b6d77=_0x3b6d77||0x1f4;return function(_0x47c633){logger[_0xdb10('0x2b')](_0x47c633[_0xdb10('0x2c')]);if(_0x47c633[_0xdb10('0x2d')]){delete _0x47c633[_0xdb10('0x2d')];}_0x3582d5['status'](_0x3b6d77)[_0xdb10('0x2e')](_0x47c633);};}exports[_0xdb10('0x2f')]=function(_0x4caefd,_0x46a728){var _0x1f04b0={},_0x59e77b={},_0x2468eb={'count':0x0,'rows':[]};return db[_0xdb10('0x30')][_0xdb10('0x31')]()[_0xdb10('0x27')](function(_0x11bcb9){_0x59e77b[_0xdb10('0x32')]=_[_0xdb10('0x33')](_0x11bcb9);_0x59e77b[_0xdb10('0x34')]=_[_0xdb10('0x33')](_0x4caefd['query']);_0x59e77b['filters']=_[_0xdb10('0x35')](_0x59e77b[_0xdb10('0x32')],_0x59e77b['query']);_0x1f04b0['attributes']=_['intersection'](_0x59e77b[_0xdb10('0x32')],qs['fields'](_0x4caefd['query'][_0xdb10('0x36')]));_0x1f04b0[_0xdb10('0x37')]=_0x1f04b0[_0xdb10('0x37')][_0xdb10('0x38')]?_0x1f04b0[_0xdb10('0x37')]:_0x59e77b['model'];if(!_0x4caefd[_0xdb10('0x34')][_0xdb10('0x39')](_0xdb10('0x3a'))){_0x1f04b0[_0xdb10('0x1d')]=qs[_0xdb10('0x1d')](_0x4caefd[_0xdb10('0x34')][_0xdb10('0x1d')]);_0x1f04b0['offset']=qs[_0xdb10('0x1f')](_0x4caefd[_0xdb10('0x34')][_0xdb10('0x1f')]);}_0x1f04b0[_0xdb10('0x3b')]=qs[_0xdb10('0x3c')](_0x4caefd[_0xdb10('0x34')][_0xdb10('0x3c')]);_0x1f04b0[_0xdb10('0x3d')]=qs[_0xdb10('0x3e')](_['pick'](_0x4caefd[_0xdb10('0x34')],_0x59e77b['filters']),_0x11bcb9);if(_0x4caefd[_0xdb10('0x34')]['filter']){_0x1f04b0[_0xdb10('0x3d')]=_[_0xdb10('0x3f')](_0x1f04b0['where'],{'$or':_['map'](_0x1f04b0['attributes'],function(_0x5b338a){var _0x1bb60e={};_0x1bb60e[_0x5b338a]={'$like':'%'+_0x4caefd[_0xdb10('0x34')]['filter']+'%'};return _0x1bb60e;})});}_0x1f04b0=_[_0xdb10('0x3f')]({},_0x1f04b0,_0x4caefd[_0xdb10('0x40')]);var _0x20261b={'where':_0x1f04b0[_0xdb10('0x3d')]};return db[_0xdb10('0x30')][_0xdb10('0x1e')](_0x20261b)['then'](function(_0x3f3009){_0x2468eb['count']=_0x3f3009;if(_0x4caefd[_0xdb10('0x34')][_0xdb10('0x41')]){_0x1f04b0[_0xdb10('0x42')]=[{'all':!![]}];}return db[_0xdb10('0x30')][_0xdb10('0x43')](_0x1f04b0);})['then'](function(_0x2d3561){_0x2468eb['rows']=_0x2d3561;return _0x2468eb;})[_0xdb10('0x27')](respondWithFilteredResult(_0x46a728,_0x1f04b0))[_0xdb10('0x44')](handleError(_0x46a728,null));})[_0xdb10('0x44')](handleError(_0x46a728,null));};exports[_0xdb10('0x45')]=function(_0x52cdc2,_0x19996d){var _0x4d2d4f={'raw':![],'where':{'id':_0x52cdc2[_0xdb10('0x46')]['id']}},_0x40ce47={};_0x40ce47[_0xdb10('0x32')]=_[_0xdb10('0x33')](db[_0xdb10('0x30')]['rawAttributes']);_0x40ce47[_0xdb10('0x34')]=_[_0xdb10('0x33')](_0x52cdc2[_0xdb10('0x34')]);_0x40ce47[_0xdb10('0x3e')]=_[_0xdb10('0x35')](_0x40ce47[_0xdb10('0x32')],_0x40ce47['query']);_0x4d2d4f['attributes']=_[_0xdb10('0x35')](_0x40ce47[_0xdb10('0x32')],qs[_0xdb10('0x36')](_0x52cdc2['query'][_0xdb10('0x36')]));_0x4d2d4f[_0xdb10('0x37')]=_0x4d2d4f[_0xdb10('0x37')]['length']?_0x4d2d4f[_0xdb10('0x37')]:_0x40ce47['model'];if(_0x52cdc2[_0xdb10('0x34')][_0xdb10('0x41')]){_0x4d2d4f[_0xdb10('0x42')]=[{'all':!![]}];}_0x4d2d4f=_[_0xdb10('0x3f')]({},_0x4d2d4f,_0x52cdc2[_0xdb10('0x40')]);return db[_0xdb10('0x30')][_0xdb10('0x47')](_0x4d2d4f)[_0xdb10('0x27')](handleEntityNotFound(_0x19996d,null))[_0xdb10('0x27')](respondWithResult(_0x19996d,null))[_0xdb10('0x44')](handleError(_0x19996d,null));};exports[_0xdb10('0x48')]=function(_0xe83e07,_0x4553c4){return db['CmCompany'][_0xdb10('0x48')](_0xe83e07[_0xdb10('0x49')],{})[_0xdb10('0x27')](function(_0x54ae80){var _0x2c0d47=_0xe83e07[_0xdb10('0x4a')][_0xdb10('0x28')]({'plain':!![]});if(!_0x2c0d47)throw new Error(_0xdb10('0x4b'));if(_0x2c0d47[_0xdb10('0x4c')]==='user'){var _0x168148=_0x54ae80[_0xdb10('0x28')]({'plain':!![]});var _0x497a18=_0xdb10('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x497a18,'userProfileId':_0x2c0d47[_0xdb10('0x4d')]},'raw':!![]})['then'](function(_0x1eaafd){if(_0x1eaafd&&_0x1eaafd['autoAssociation']===0x0){return db[_0xdb10('0x2a')]['create']({'name':_0x168148['name'],'resourceId':_0x168148['id'],'type':_0x1eaafd[_0xdb10('0x2d')],'sectionId':_0x1eaafd['id']},{})['then'](function(){return _0x54ae80;});}else{return _0x54ae80;}})[_0xdb10('0x44')](function(_0x298687){logger[_0xdb10('0x2b')](_0xdb10('0x4e'),_0x298687);throw _0x298687;});}return _0x54ae80;})[_0xdb10('0x27')](respondWithResult(_0x4553c4,0xc9))[_0xdb10('0x44')](handleError(_0x4553c4,null));};exports['update']=function(_0x422424,_0x180e93){if(_0x422424[_0xdb10('0x49')]['id']){delete _0x422424[_0xdb10('0x49')]['id'];}return db['CmCompany'][_0xdb10('0x47')]({'where':{'id':_0x422424[_0xdb10('0x46')]['id']}})['then'](handleEntityNotFound(_0x180e93,null))['then'](saveUpdates(_0x422424[_0xdb10('0x49')],null))[_0xdb10('0x27')](respondWithResult(_0x180e93,null))['catch'](handleError(_0x180e93,null));};exports['destroy']=function(_0x5f30d1,_0x1a3f35){return db['CmCompany'][_0xdb10('0x47')]({'where':{'id':_0x5f30d1[_0xdb10('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a3f35,null))[_0xdb10('0x27')](removeEntity(_0x1a3f35,null))[_0xdb10('0x44')](handleError(_0x1a3f35,null));};exports['describe']=function(_0x226bf7,_0xf03bb0){return db[_0xdb10('0x30')][_0xdb10('0x31')]()[_0xdb10('0x27')](respondWithResult(_0xf03bb0,null))[_0xdb10('0x44')](handleError(_0xf03bb0,null));};exports[_0xdb10('0x4f')]=function(_0x55e66f,_0x7df24f,_0x454c29){return db['CmContact']['find']({'where':{'id':_0x55e66f[_0xdb10('0x46')]['id']}})[_0xdb10('0x27')](handleEntityNotFound(_0x7df24f,null))[_0xdb10('0x27')](function(_0x40a7f1){if(_0x40a7f1){return _0x40a7f1[_0xdb10('0x4f')](_0x55e66f[_0xdb10('0x49')][_0xdb10('0x50')],_[_0xdb10('0x51')](_0x55e66f[_0xdb10('0x49')],[_0xdb10('0x50'),'id'])||{});}})['then'](respondWithResult(_0x7df24f,null))[_0xdb10('0x44')](handleError(_0x7df24f,null));};exports[_0xdb10('0x52')]=function(_0xf2e7e3,_0x3a9825,_0x311812){var _0x309cea={};var _0x398685={};var _0x3bff88;var _0x9a22a5;return db[_0xdb10('0x30')][_0xdb10('0x53')]({'where':{'id':_0xf2e7e3['params']['id']}})[_0xdb10('0x27')](handleEntityNotFound(_0x3a9825,null))['then'](function(_0x5390bc){if(_0x5390bc){_0x3bff88=_0x5390bc;_0x398685['model']=_[_0xdb10('0x33')](db[_0xdb10('0x54')]['rawAttributes']);_0x398685[_0xdb10('0x34')]=_[_0xdb10('0x33')](_0xf2e7e3[_0xdb10('0x34')]);_0x398685[_0xdb10('0x3e')]=_[_0xdb10('0x35')](_0x398685[_0xdb10('0x32')],_0x398685[_0xdb10('0x34')]);_0x309cea[_0xdb10('0x37')]=_[_0xdb10('0x35')](_0x398685[_0xdb10('0x32')],qs[_0xdb10('0x36')](_0xf2e7e3[_0xdb10('0x34')]['fields']));_0x309cea['attributes']=_0x309cea[_0xdb10('0x37')][_0xdb10('0x38')]?_0x309cea[_0xdb10('0x37')]:_0x398685[_0xdb10('0x32')];_0x309cea[_0xdb10('0x3b')]=qs[_0xdb10('0x3c')](_0xf2e7e3[_0xdb10('0x34')][_0xdb10('0x3c')]);_0x309cea[_0xdb10('0x3d')]=qs['filters'](_[_0xdb10('0x55')](_0xf2e7e3[_0xdb10('0x34')],_0x398685[_0xdb10('0x3e')]));if(_0xf2e7e3[_0xdb10('0x34')][_0xdb10('0x56')]){_0x309cea[_0xdb10('0x3d')]=_[_0xdb10('0x3f')](_0x309cea[_0xdb10('0x3d')],{'$or':_[_0xdb10('0x57')](_0x309cea['attributes'],function(_0x9d0161){var _0x59e5f2={};_0x59e5f2[_0x9d0161]={'$like':'%'+_0xf2e7e3[_0xdb10('0x34')][_0xdb10('0x56')]+'%'};return _0x59e5f2;})});}_0x309cea=_[_0xdb10('0x3f')]({},_0x309cea,_0xf2e7e3[_0xdb10('0x40')]);return _0x3bff88[_0xdb10('0x52')](_0x309cea);}})['then'](function(_0x58d648){if(_0x58d648){_0x9a22a5=_0x58d648[_0xdb10('0x38')];if(!_0xf2e7e3[_0xdb10('0x34')][_0xdb10('0x39')](_0xdb10('0x3a'))){_0x309cea['limit']=qs[_0xdb10('0x1d')](_0xf2e7e3[_0xdb10('0x34')]['limit']);_0x309cea[_0xdb10('0x1f')]=qs[_0xdb10('0x1f')](_0xf2e7e3[_0xdb10('0x34')][_0xdb10('0x1f')]);}return _0x3bff88['getContacts'](_0x309cea);}})[_0xdb10('0x27')](function(_0x45e689){if(_0x45e689){return _0x45e689?{'count':_0x9a22a5,'rows':_0x45e689}:null;}})[_0xdb10('0x27')](respondWithResult(_0x3a9825,null))[_0xdb10('0x44')](handleError(_0x3a9825,null));};
\ No newline at end of file
+var _0x189f=['findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','getContacts','findOne','sort','map','eml-format','fast-json-patch','moment','bluebird','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','CmCompany'];(function(_0x14b741,_0x5caa3a){var _0x45b689=function(_0x349326){while(--_0x349326){_0x14b741['push'](_0x14b741['shift']());}};_0x45b689(++_0x5caa3a);}(_0x189f,0xd0));var _0xf189=function(_0x13f601,_0x4dc50f){_0x13f601=_0x13f601-0x0;var _0xad44c0=_0x189f[_0x13f601];return _0xad44c0;};'use strict';var emlformat=require(_0xf189('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf189('0x1'));var rp=require('request-promise');var moment=require(_0xf189('0x2'));var BPromise=require(_0xf189('0x3'));var Mustache=require('mustache');var util=require(_0xf189('0x4'));var path=require(_0xf189('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf189('0x6'));var _=require(_0xf189('0x7'));var squel=require(_0xf189('0x8'));var crypto=require('crypto');var jsforce=require(_0xf189('0x9'));var deskjs=require(_0xf189('0xa'));var toCsv=require(_0xf189('0xb'));var querystring=require(_0xf189('0xc'));var Papa=require(_0xf189('0xd'));var Redis=require(_0xf189('0xe'));var authService=require(_0xf189('0xf'));var qs=require(_0xf189('0x10'));var as=require(_0xf189('0x11'));var hardwareService=require(_0xf189('0x12'));var logger=require(_0xf189('0x13'))(_0xf189('0x14'));var utils=require(_0xf189('0x15'));var config=require(_0xf189('0x16'));var licenseUtil=require(_0xf189('0x17'));var db=require(_0xf189('0x18'))['db'];function respondWithStatusCode(_0x4d1a7e,_0x2d14e5){_0x2d14e5=_0x2d14e5||0xcc;return function(_0x303575){if(_0x303575){return _0x4d1a7e[_0xf189('0x19')](_0x2d14e5);}return _0x4d1a7e[_0xf189('0x1a')](_0x2d14e5)[_0xf189('0x1b')]();};}function respondWithResult(_0x12dfcf,_0x36dfc0){_0x36dfc0=_0x36dfc0||0xc8;return function(_0xcd6f8f){if(_0xcd6f8f){return _0x12dfcf[_0xf189('0x1a')](_0x36dfc0)[_0xf189('0x1c')](_0xcd6f8f);}};}function respondWithFilteredResult(_0xefe15a,_0x25e646){return function(_0xe00868){if(_0xe00868){var _0x341b6f=typeof _0x25e646[_0xf189('0x1d')]===_0xf189('0x1e')&&typeof _0x25e646['limit']===_0xf189('0x1e');var _0x23e301=_0xe00868[_0xf189('0x1f')];var _0x2fab10=_0x341b6f?0x0:_0x25e646[_0xf189('0x1d')];var _0x30f8e7=_0x341b6f?_0xe00868[_0xf189('0x1f')]:_0x25e646[_0xf189('0x1d')]+_0x25e646[_0xf189('0x20')];var _0x23941f;if(_0x30f8e7>=_0x23e301){_0x30f8e7=_0x23e301;_0x23941f=0xc8;}else{_0x23941f=0xce;}_0xefe15a[_0xf189('0x1a')](_0x23941f);return _0xefe15a[_0xf189('0x21')](_0xf189('0x22'),_0x2fab10+'-'+_0x30f8e7+'/'+_0x23e301)[_0xf189('0x1c')](_0xe00868);}return null;};}function patchUpdates(_0x37b227){return function(_0x52f511){try{jsonpatch[_0xf189('0x23')](_0x52f511,_0x37b227,!![]);}catch(_0x5513d0){return BPromise[_0xf189('0x24')](_0x5513d0);}return _0x52f511[_0xf189('0x25')]();};}function saveUpdates(_0x32056d,_0x5e8c75){return function(_0x40e061){if(_0x40e061){return _0x40e061['update'](_0x32056d)[_0xf189('0x26')](function(_0x20d44f){return _0x20d44f;});}return null;};}function removeEntity(_0x13e872,_0x47df8e){return function(_0x52aeeb){if(_0x52aeeb){return _0x52aeeb[_0xf189('0x27')]()[_0xf189('0x26')](function(){var _0x1b7736=_0x52aeeb[_0xf189('0x28')]({'plain':!![]});var _0x273525=_0xf189('0x29');return db[_0xf189('0x2a')]['destroy']({'where':{'type':_0x273525,'resourceId':_0x1b7736['id']}})[_0xf189('0x26')](function(){return _0x52aeeb;});})[_0xf189('0x26')](function(){_0x13e872['status'](0xcc)[_0xf189('0x1b')]();});}};}function handleEntityNotFound(_0x9106b0,_0x4af020){return function(_0x50f4e1){if(!_0x50f4e1){_0x9106b0[_0xf189('0x19')](0x194);}return _0x50f4e1;};}function handleError(_0x54e8e2,_0x5a8083){_0x5a8083=_0x5a8083||0x1f4;return function(_0x3876fb){logger[_0xf189('0x2b')](_0x3876fb[_0xf189('0x2c')]);if(_0x3876fb[_0xf189('0x2d')]){delete _0x3876fb['name'];}_0x54e8e2[_0xf189('0x1a')](_0x5a8083)[_0xf189('0x2e')](_0x3876fb);};}exports[_0xf189('0x2f')]=function(_0x1f9155,_0x2389ce){var _0x1c63b6={},_0x352977={},_0x4c3157={'count':0x0,'rows':[]};return db['CmCompany'][_0xf189('0x30')]()['then'](function(_0xb9c9ed){_0x352977['model']=_['keys'](_0xb9c9ed);_0x352977['query']=_[_0xf189('0x31')](_0x1f9155[_0xf189('0x32')]);_0x352977[_0xf189('0x33')]=_[_0xf189('0x34')](_0x352977[_0xf189('0x35')],_0x352977[_0xf189('0x32')]);_0x1c63b6[_0xf189('0x36')]=_[_0xf189('0x34')](_0x352977['model'],qs[_0xf189('0x37')](_0x1f9155[_0xf189('0x32')][_0xf189('0x37')]));_0x1c63b6[_0xf189('0x36')]=_0x1c63b6[_0xf189('0x36')][_0xf189('0x38')]?_0x1c63b6[_0xf189('0x36')]:_0x352977[_0xf189('0x35')];if(!_0x1f9155[_0xf189('0x32')][_0xf189('0x39')](_0xf189('0x3a'))){_0x1c63b6[_0xf189('0x20')]=qs[_0xf189('0x20')](_0x1f9155[_0xf189('0x32')]['limit']);_0x1c63b6['offset']=qs['offset'](_0x1f9155[_0xf189('0x32')][_0xf189('0x1d')]);}_0x1c63b6[_0xf189('0x3b')]=qs['sort'](_0x1f9155[_0xf189('0x32')]['sort']);_0x1c63b6[_0xf189('0x3c')]=qs['filters'](_[_0xf189('0x3d')](_0x1f9155[_0xf189('0x32')],_0x352977[_0xf189('0x33')]),_0xb9c9ed);if(_0x1f9155['query'][_0xf189('0x3e')]){_0x1c63b6['where']=_['merge'](_0x1c63b6[_0xf189('0x3c')],{'$or':_['map'](_0x1c63b6[_0xf189('0x36')],function(_0x2d2d28){var _0x3e86ff={};_0x3e86ff[_0x2d2d28]={'$like':'%'+_0x1f9155['query'][_0xf189('0x3e')]+'%'};return _0x3e86ff;})});}_0x1c63b6=_[_0xf189('0x3f')]({},_0x1c63b6,_0x1f9155[_0xf189('0x40')]);var _0x35b2a1={'where':_0x1c63b6[_0xf189('0x3c')]};return db['CmCompany'][_0xf189('0x1f')](_0x35b2a1)[_0xf189('0x26')](function(_0xf9bfb7){_0x4c3157[_0xf189('0x1f')]=_0xf9bfb7;if(_0x1f9155[_0xf189('0x32')][_0xf189('0x41')]){_0x1c63b6[_0xf189('0x42')]=[{'all':!![]}];}return db[_0xf189('0x43')][_0xf189('0x44')](_0x1c63b6);})['then'](function(_0x3ae77d){_0x4c3157[_0xf189('0x45')]=_0x3ae77d;return _0x4c3157;})[_0xf189('0x26')](respondWithFilteredResult(_0x2389ce,_0x1c63b6))[_0xf189('0x46')](handleError(_0x2389ce,null));})[_0xf189('0x46')](handleError(_0x2389ce,null));};exports[_0xf189('0x47')]=function(_0x5dd99a,_0x1131d7){var _0x7386b5={'raw':![],'where':{'id':_0x5dd99a[_0xf189('0x48')]['id']}},_0x335f52={};_0x335f52[_0xf189('0x35')]=_['keys'](db[_0xf189('0x43')][_0xf189('0x49')]);_0x335f52['query']=_[_0xf189('0x31')](_0x5dd99a[_0xf189('0x32')]);_0x335f52[_0xf189('0x33')]=_['intersection'](_0x335f52['model'],_0x335f52[_0xf189('0x32')]);_0x7386b5['attributes']=_[_0xf189('0x34')](_0x335f52[_0xf189('0x35')],qs[_0xf189('0x37')](_0x5dd99a[_0xf189('0x32')][_0xf189('0x37')]));_0x7386b5[_0xf189('0x36')]=_0x7386b5['attributes'][_0xf189('0x38')]?_0x7386b5[_0xf189('0x36')]:_0x335f52[_0xf189('0x35')];if(_0x5dd99a[_0xf189('0x32')][_0xf189('0x41')]){_0x7386b5[_0xf189('0x42')]=[{'all':!![]}];}_0x7386b5=_[_0xf189('0x3f')]({},_0x7386b5,_0x5dd99a[_0xf189('0x40')]);return db[_0xf189('0x43')][_0xf189('0x4a')](_0x7386b5)[_0xf189('0x26')](handleEntityNotFound(_0x1131d7,null))[_0xf189('0x26')](respondWithResult(_0x1131d7,null))[_0xf189('0x46')](handleError(_0x1131d7,null));};exports[_0xf189('0x4b')]=function(_0x460bcf,_0x5e1c11){return db['CmCompany'][_0xf189('0x4b')](_0x460bcf[_0xf189('0x4c')],{})[_0xf189('0x26')](function(_0x15ec49){var _0x4231f0=_0x460bcf[_0xf189('0x4d')][_0xf189('0x28')]({'plain':!![]});if(!_0x4231f0)throw new Error(_0xf189('0x4e'));if(_0x4231f0[_0xf189('0x4f')]==='user'){var _0x259433=_0x15ec49[_0xf189('0x28')]({'plain':!![]});var _0x5a321b=_0xf189('0x29');return db[_0xf189('0x50')]['find']({'where':{'name':_0x5a321b,'userProfileId':_0x4231f0[_0xf189('0x51')]},'raw':!![]})[_0xf189('0x26')](function(_0x7d2f62){if(_0x7d2f62&&_0x7d2f62[_0xf189('0x52')]===0x0){return db['UserProfileResource'][_0xf189('0x4b')]({'name':_0x259433[_0xf189('0x2d')],'resourceId':_0x259433['id'],'type':_0x7d2f62[_0xf189('0x2d')],'sectionId':_0x7d2f62['id']},{})[_0xf189('0x26')](function(){return _0x15ec49;});}else{return _0x15ec49;}})[_0xf189('0x46')](function(_0x390e28){logger[_0xf189('0x2b')](_0xf189('0x53'),_0x390e28);throw _0x390e28;});}return _0x15ec49;})[_0xf189('0x26')](respondWithResult(_0x5e1c11,0xc9))[_0xf189('0x46')](handleError(_0x5e1c11,null));};exports[_0xf189('0x54')]=function(_0x5643f7,_0x21bafd){if(_0x5643f7[_0xf189('0x4c')]['id']){delete _0x5643f7['body']['id'];}return db[_0xf189('0x43')]['find']({'where':{'id':_0x5643f7[_0xf189('0x48')]['id']}})[_0xf189('0x26')](handleEntityNotFound(_0x21bafd,null))['then'](saveUpdates(_0x5643f7[_0xf189('0x4c')],null))[_0xf189('0x26')](respondWithResult(_0x21bafd,null))[_0xf189('0x46')](handleError(_0x21bafd,null));};exports[_0xf189('0x27')]=function(_0x383d11,_0x5639d5){return db['CmCompany'][_0xf189('0x4a')]({'where':{'id':_0x383d11[_0xf189('0x48')]['id']}})[_0xf189('0x26')](handleEntityNotFound(_0x5639d5,null))['then'](removeEntity(_0x5639d5,null))[_0xf189('0x46')](handleError(_0x5639d5,null));};exports[_0xf189('0x30')]=function(_0x228ff1,_0x5b682c){return db[_0xf189('0x43')]['describe']()[_0xf189('0x26')](respondWithResult(_0x5b682c,null))[_0xf189('0x46')](handleError(_0x5b682c,null));};exports[_0xf189('0x55')]=function(_0x3363e1,_0x545117,_0x5b2dea){return db[_0xf189('0x56')][_0xf189('0x4a')]({'where':{'id':_0x3363e1[_0xf189('0x48')]['id']}})[_0xf189('0x26')](handleEntityNotFound(_0x545117,null))[_0xf189('0x26')](function(_0x363cad){if(_0x363cad){return _0x363cad[_0xf189('0x55')](_0x3363e1[_0xf189('0x4c')][_0xf189('0x57')],_['omit'](_0x3363e1[_0xf189('0x4c')],['ids','id'])||{});}})[_0xf189('0x26')](respondWithResult(_0x545117,null))[_0xf189('0x46')](handleError(_0x545117,null));};exports[_0xf189('0x58')]=function(_0x2c76fc,_0x417c9b,_0x3eee11){var _0x3e9ad0={};var _0xcb775e={};var _0x4aaf70;var _0x235bf9;return db['CmCompany'][_0xf189('0x59')]({'where':{'id':_0x2c76fc[_0xf189('0x48')]['id']}})[_0xf189('0x26')](handleEntityNotFound(_0x417c9b,null))[_0xf189('0x26')](function(_0x51beb5){if(_0x51beb5){_0x4aaf70=_0x51beb5;_0xcb775e[_0xf189('0x35')]=_[_0xf189('0x31')](db[_0xf189('0x56')]['rawAttributes']);_0xcb775e[_0xf189('0x32')]=_[_0xf189('0x31')](_0x2c76fc[_0xf189('0x32')]);_0xcb775e[_0xf189('0x33')]=_[_0xf189('0x34')](_0xcb775e[_0xf189('0x35')],_0xcb775e[_0xf189('0x32')]);_0x3e9ad0['attributes']=_[_0xf189('0x34')](_0xcb775e['model'],qs['fields'](_0x2c76fc[_0xf189('0x32')][_0xf189('0x37')]));_0x3e9ad0[_0xf189('0x36')]=_0x3e9ad0[_0xf189('0x36')]['length']?_0x3e9ad0[_0xf189('0x36')]:_0xcb775e[_0xf189('0x35')];_0x3e9ad0[_0xf189('0x3b')]=qs[_0xf189('0x5a')](_0x2c76fc[_0xf189('0x32')][_0xf189('0x5a')]);_0x3e9ad0[_0xf189('0x3c')]=qs[_0xf189('0x33')](_[_0xf189('0x3d')](_0x2c76fc[_0xf189('0x32')],_0xcb775e[_0xf189('0x33')]));if(_0x2c76fc[_0xf189('0x32')][_0xf189('0x3e')]){_0x3e9ad0[_0xf189('0x3c')]=_[_0xf189('0x3f')](_0x3e9ad0[_0xf189('0x3c')],{'$or':_[_0xf189('0x5b')](_0x3e9ad0[_0xf189('0x36')],function(_0x6863da){var _0x5945fa={};_0x5945fa[_0x6863da]={'$like':'%'+_0x2c76fc[_0xf189('0x32')]['filter']+'%'};return _0x5945fa;})});}_0x3e9ad0=_[_0xf189('0x3f')]({},_0x3e9ad0,_0x2c76fc['options']);return _0x4aaf70[_0xf189('0x58')](_0x3e9ad0);}})[_0xf189('0x26')](function(_0x329256){if(_0x329256){_0x235bf9=_0x329256[_0xf189('0x38')];if(!_0x2c76fc[_0xf189('0x32')][_0xf189('0x39')]('nolimit')){_0x3e9ad0[_0xf189('0x20')]=qs['limit'](_0x2c76fc[_0xf189('0x32')]['limit']);_0x3e9ad0[_0xf189('0x1d')]=qs[_0xf189('0x1d')](_0x2c76fc[_0xf189('0x32')][_0xf189('0x1d')]);}return _0x4aaf70[_0xf189('0x58')](_0x3e9ad0);}})[_0xf189('0x26')](function(_0x17e3cc){if(_0x17e3cc){return _0x17e3cc?{'count':_0x235bf9,'rows':_0x17e3cc}:null;}})[_0xf189('0x26')](respondWithResult(_0x417c9b,null))[_0xf189('0x46')](handleError(_0x417c9b,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index cb81716..305ca54 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 _0x3446=['CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x26c11f,_0x196f33){var _0x4ca44b=function(_0x215c31){while(--_0x215c31){_0x26c11f['push'](_0x26c11f['shift']());}};_0x4ca44b(++_0x196f33);}(_0x3446,0x152));var _0x6344=function(_0x2a98fa,_0x3ce464){_0x2a98fa=_0x2a98fa-0x0;var _0x92da7f=_0x3446[_0x2a98fa];return _0x92da7f;};'use strict';var _=require(_0x6344('0x0'));var util=require(_0x6344('0x1'));var logger=require(_0x6344('0x2'))(_0x6344('0x3'));var moment=require(_0x6344('0x4'));var BPromise=require(_0x6344('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6344('0x6'));var rimraf=require(_0x6344('0x7'));var config=require(_0x6344('0x8'));var attributes=require('./cmCompany.attributes');module[_0x6344('0x9')]=function(_0x5a70ba,_0x135c16){return _0x5a70ba['define'](_0x6344('0xa'),attributes,{'tableName':_0x6344('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc7c1=['../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1b701d,_0xa83eac){var _0x271fd7=function(_0x54fdce){while(--_0x54fdce){_0x1b701d['push'](_0x1b701d['shift']());}};_0x271fd7(++_0xa83eac);}(_0xc7c1,0x1e6));var _0x1c7c=function(_0x156b37,_0x442e2e){_0x156b37=_0x156b37-0x0;var _0x12ae4c=_0xc7c1[_0x156b37];return _0x12ae4c;};'use strict';var _=require(_0x1c7c('0x0'));var util=require(_0x1c7c('0x1'));var logger=require(_0x1c7c('0x2'))('api');var moment=require(_0x1c7c('0x3'));var BPromise=require(_0x1c7c('0x4'));var rp=require(_0x1c7c('0x5'));var fs=require('fs');var path=require(_0x1c7c('0x6'));var rimraf=require(_0x1c7c('0x7'));var config=require(_0x1c7c('0x8'));var attributes=require(_0x1c7c('0x9'));module[_0x1c7c('0xa')]=function(_0x1f2b09,_0xbf22ab){return _0x1f2b09['define'](_0x1c7c('0xb'),attributes,{'tableName':_0x1c7c('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 3d87399..37128e1 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 _0x4166=['http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x38841c,_0x1af0bf){var _0x500610=function(_0x225955){while(--_0x225955){_0x38841c['push'](_0x38841c['shift']());}};_0x500610(++_0x1af0bf);}(_0x4166,0x82));var _0x6416=function(_0x2cad67,_0x30a165){_0x2cad67=_0x2cad67-0x0;var _0x557943=_0x4166[_0x2cad67];return _0x557943;};'use strict';var _=require(_0x6416('0x0'));var util=require('util');var moment=require(_0x6416('0x1'));var BPromise=require(_0x6416('0x2'));var rs=require(_0x6416('0x3'));var fs=require('fs');var Redis=require(_0x6416('0x4'));var db=require(_0x6416('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6416('0x6'))(_0x6416('0x7'));var config=require(_0x6416('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6416('0x9')][_0x6416('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54a683,_0x5169ea,_0x180660){return new BPromise(function(_0x2e68ef,_0x99a990){return client[_0x6416('0xb')](_0x54a683,_0x180660)[_0x6416('0xc')](function(_0x2e72a3){logger[_0x6416('0xd')](_0x6416('0xe'),_0x5169ea,_0x6416('0xf'));logger['debug'](_0x6416('0x10'),_0x5169ea,_0x6416('0xf'),JSON['stringify'](_0x2e72a3));if(_0x2e72a3[_0x6416('0x11')]){if(_0x2e72a3['error']['code']===0x1f4){logger[_0x6416('0x11')](_0x6416('0xe'),_0x5169ea,_0x2e72a3[_0x6416('0x11')]['message']);return _0x99a990(_0x2e72a3[_0x6416('0x11')]['message']);}logger[_0x6416('0x11')](_0x6416('0xe'),_0x5169ea,_0x2e72a3[_0x6416('0x11')][_0x6416('0x12')]);return _0x2e68ef(_0x2e72a3[_0x6416('0x11')][_0x6416('0x12')]);}else{logger[_0x6416('0xd')](_0x6416('0xe'),_0x5169ea,_0x6416('0xf'));_0x2e68ef(_0x2e72a3['result'][_0x6416('0x12')]);}})[_0x6416('0x13')](function(_0x382a0d){logger[_0x6416('0x11')]('CmCompany,\x20%s,\x20%s',_0x5169ea,_0x382a0d);_0x99a990(_0x382a0d);});});}
\ No newline at end of file
+var _0x6ac0=['http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x6ac0,0x17c));var _0x06ac=function(_0x199318,_0x217869){_0x199318=_0x199318-0x0;var _0x171a8d=_0x6ac0[_0x199318];return _0x171a8d;};'use strict';var _=require(_0x06ac('0x0'));var util=require(_0x06ac('0x1'));var moment=require(_0x06ac('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06ac('0x3'));var db=require(_0x06ac('0x4'))['db'];var utils=require(_0x06ac('0x5'));var logger=require(_0x06ac('0x6'))(_0x06ac('0x7'));var config=require(_0x06ac('0x8'));var jayson=require(_0x06ac('0x9'));var client=jayson[_0x06ac('0xa')][_0x06ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5497f3,_0x4754e8,_0x1891b6){return new BPromise(function(_0x2e195c,_0x1c1441){return client[_0x06ac('0xc')](_0x5497f3,_0x1891b6)[_0x06ac('0xd')](function(_0x202068){logger[_0x06ac('0xe')]('CmCompany,\x20%s,\x20%s',_0x4754e8,_0x06ac('0xf'));logger[_0x06ac('0x10')](_0x06ac('0x11'),_0x4754e8,_0x06ac('0xf'),JSON[_0x06ac('0x12')](_0x202068));if(_0x202068['error']){if(_0x202068[_0x06ac('0x13')]['code']===0x1f4){logger[_0x06ac('0x13')](_0x06ac('0x14'),_0x4754e8,_0x202068[_0x06ac('0x13')][_0x06ac('0x15')]);return _0x1c1441(_0x202068['error'][_0x06ac('0x15')]);}logger[_0x06ac('0x13')](_0x06ac('0x14'),_0x4754e8,_0x202068[_0x06ac('0x13')][_0x06ac('0x15')]);return _0x2e195c(_0x202068[_0x06ac('0x13')][_0x06ac('0x15')]);}else{logger[_0x06ac('0xe')](_0x06ac('0x14'),_0x4754e8,_0x06ac('0xf'));_0x2e195c(_0x202068['result'][_0x06ac('0x15')]);}})[_0x06ac('0x16')](function(_0xb077c3){logger[_0x06ac('0x13')](_0x06ac('0x14'),_0x4754e8,_0xb077c3);_0x1c1441(_0xb077c3);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index d966745..2b85603 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 _0xa551=['isAuthenticated','describe','show','/:id/contacts','post','addContacts','put','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','/describe'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xa551,0x16a));var _0x1a55=function(_0x308b8e,_0x3de00c){_0x308b8e=_0x308b8e-0x0;var _0x308324=_0xa551[_0x308b8e];return _0x308324;};'use strict';var multer=require(_0x1a55('0x0'));var util=require(_0x1a55('0x1'));var path=require('path');var timeout=require(_0x1a55('0x2'));var express=require(_0x1a55('0x3'));var router=express[_0x1a55('0x4')]();var fs_extra=require(_0x1a55('0x5'));var auth=require(_0x1a55('0x6'));var interaction=require(_0x1a55('0x7'));var config=require(_0x1a55('0x8'));var controller=require(_0x1a55('0x9'));router[_0x1a55('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1a55('0xa')](_0x1a55('0xb'),auth[_0x1a55('0xc')](),controller[_0x1a55('0xd')]);router[_0x1a55('0xa')]('/:id',auth[_0x1a55('0xc')](),controller[_0x1a55('0xe')]);router[_0x1a55('0xa')](_0x1a55('0xf'),auth[_0x1a55('0xc')](),controller['getContacts']);router[_0x1a55('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x1a55('0xf'),auth['isAuthenticated'](),controller[_0x1a55('0x11')]);router[_0x1a55('0x12')](_0x1a55('0x13'),auth[_0x1a55('0xc')](),controller['update']);router['delete'](_0x1a55('0x13'),auth['isAuthenticated'](),controller[_0x1a55('0x14')]);module[_0x1a55('0x15')]=router;
\ No newline at end of file
+var _0x8d4d=['../../components/auth/service','../../components/interaction/service','./cmCompany.controller','isAuthenticated','describe','get','/:id','getContacts','/:id/contacts','addContacts','put','update','multer','path','connect-timeout','express','Router'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8d4d,0x94));var _0xd8d4=function(_0x115497,_0x3e7156){_0x115497=_0x115497-0x0;var _0xccd20f=_0x8d4d[_0x115497];return _0xccd20f;};'use strict';var multer=require(_0xd8d4('0x0'));var util=require('util');var path=require(_0xd8d4('0x1'));var timeout=require(_0xd8d4('0x2'));var express=require(_0xd8d4('0x3'));var router=express[_0xd8d4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd8d4('0x5'));var interaction=require(_0xd8d4('0x6'));var config=require('../../config/environment');var controller=require(_0xd8d4('0x7'));router['get']('/',auth[_0xd8d4('0x8')](),controller['index']);router['get']('/describe',auth[_0xd8d4('0x8')](),controller[_0xd8d4('0x9')]);router[_0xd8d4('0xa')](_0xd8d4('0xb'),auth[_0xd8d4('0x8')](),controller['show']);router[_0xd8d4('0xa')]('/:id/contacts',auth[_0xd8d4('0x8')](),controller[_0xd8d4('0xc')]);router['post']('/',auth[_0xd8d4('0x8')](),controller['create']);router['post'](_0xd8d4('0xd'),auth[_0xd8d4('0x8')](),controller[_0xd8d4('0xe')]);router[_0xd8d4('0xf')](_0xd8d4('0xb'),auth['isAuthenticated'](),controller[_0xd8d4('0x10')]);router['delete'](_0xd8d4('0xb'),auth[_0xd8d4('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index bae8f72..083d9ae 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 _0x54da=['UNSIGNED','NOW','INTEGER','sequelize','exports','STRING','TEXT'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0x54da,0x106));var _0xa54d=function(_0x5699e7,_0xb9ca23){_0x5699e7=_0x5699e7-0x0;var _0x1e8559=_0x54da[_0x5699e7];return _0x1e8559;};'use strict';var _=require('lodash');var Sequelize=require(_0xa54d('0x0'));module[_0xa54d('0x1')]={'firstName':{'type':Sequelize[_0xa54d('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xa54d('0x2')]},'street':{'type':Sequelize[_0xa54d('0x2')]},'postalCode':{'type':Sequelize[_0xa54d('0x2')]},'city':{'type':Sequelize[_0xa54d('0x2')]},'country':{'type':Sequelize[_0xa54d('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa54d('0x2')]},'description':{'type':Sequelize[_0xa54d('0x3')]},'phone':{'type':Sequelize[_0xa54d('0x2')]},'mobile':{'type':Sequelize[_0xa54d('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa54d('0x2')]},'url':{'type':Sequelize[_0xa54d('0x2')]},'facebook':{'type':Sequelize[_0xa54d('0x2')]},'fb_data':{'type':Sequelize[_0xa54d('0x2')]},'twitter':{'type':Sequelize[_0xa54d('0x2')]},'skype':{'type':Sequelize[_0xa54d('0x2')]},'teams':{'type':Sequelize[_0xa54d('0x2')]},'viber':{'type':Sequelize[_0xa54d('0x2')]},'line':{'type':Sequelize[_0xa54d('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xa54d('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xa54d('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xa54d('0x5')]},'dialTimezone':{'type':Sequelize[_0xa54d('0x2')]},'utcOffset':{'type':Sequelize[_0xa54d('0x6')]}};
\ No newline at end of file
+var _0x1071=['TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','exports','STRING'];(function(_0x3c6ff6,_0x4e136a){var _0x4ac5ba=function(_0x1da29e){while(--_0x1da29e){_0x3c6ff6['push'](_0x3c6ff6['shift']());}};_0x4ac5ba(++_0x4e136a);}(_0x1071,0x75));var _0x1107=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1071[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x1107('0x0'));var Sequelize=require('sequelize');module[_0x1107('0x1')]={'firstName':{'type':Sequelize[_0x1107('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1107('0x2')]},'street':{'type':Sequelize[_0x1107('0x2')]},'postalCode':{'type':Sequelize[_0x1107('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x1107('0x2')]},'dateOfBirth':{'type':Sequelize[_0x1107('0x2')]},'description':{'type':Sequelize[_0x1107('0x3')]},'phone':{'type':Sequelize[_0x1107('0x2')]},'mobile':{'type':Sequelize[_0x1107('0x2')]},'fax':{'type':Sequelize[_0x1107('0x2')]},'email':{'type':Sequelize[_0x1107('0x2')]},'url':{'type':Sequelize[_0x1107('0x2')]},'facebook':{'type':Sequelize[_0x1107('0x2')]},'fb_data':{'type':Sequelize[_0x1107('0x2')]},'twitter':{'type':Sequelize[_0x1107('0x2')]},'skype':{'type':Sequelize[_0x1107('0x2')]},'teams':{'type':Sequelize[_0x1107('0x2')]},'viber':{'type':Sequelize[_0x1107('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x1107('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x1107('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x1107('0x4')](0x2)[_0x1107('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1107('0x6')],'defaultValue':Sequelize[_0x1107('0x7')]},'dialTimezone':{'type':Sequelize[_0x1107('0x2')]},'utcOffset':{'type':Sequelize[_0x1107('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index f145c5e..ff71bf8 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 _0xa8fa=['OpenchannelInteraction','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isArray','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','$or','push','where','ListId','findOrCreate','spread','hasOwnProperty','all','find','color','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','omit','format','cf_%d','isEmpty','table','toParam','sequelize','phone','getTags','findOne','model','rawAttributes','intersection','attributes','fields','sort','filters','pick','filter','map','nolimit','setTags','ids','items','item_types','ItemTypeId','description','OrderBy','PHONE','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','order','ContactId','options','includeAll','rows','getHopperHistories','CmHopperHistory','include','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','zipObject','No\x20phone\x20column\x20specified','firstName','server/files/tmp','file','chmodSync','0777','fork','CompanyId','pid','upload','parse','meta','import','User','agent','binding','No\x20firstName\x20column\x20specified','child_process','stringify','message','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','getJourney','mail','sms','fax','voice','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','findAndCountAll','fullname','startCase','chat','Account','closed','closedAt','secondDisposition','Owner','Tag','Tags','browserName','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','Interaction','flatten','reverse','slice','moment','util','path','lodash','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','redis','localhost','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','name','index','describe','getOptions','findAll','user','catch','params','CmContact','tags','keys','length','startsWith','cf_','columnName','displayName','query','CmCustomField','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','from','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','SmsMessage','FaxInteraction','FaxMessage'];(function(_0x560900,_0xefaf5a){var _0x399414=function(_0x388c9f){while(--_0x388c9f){_0x560900['push'](_0x560900['shift']());}};_0x399414(++_0xefaf5a);}(_0xa8fa,0x1a5));var _0xaa8f=function(_0x26cbe2,_0x21f2d3){_0x26cbe2=_0x26cbe2-0x0;var _0x231423=_0xa8fa[_0x26cbe2];return _0x231423;};'use strict';var moment=require(_0xaa8f('0x0'));var BPromise=require('bluebird');var util=require(_0xaa8f('0x1'));var path=require(_0xaa8f('0x2'));var fs=require('fs');var _=require(_0xaa8f('0x3'));var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0xaa8f('0x4'));var contacts=require(_0xaa8f('0x5'));var qs=require(_0xaa8f('0x6'));var logger=require(_0xaa8f('0x7'))('api');var config=require(_0xaa8f('0x8'));var shared=require(_0xaa8f('0x9'));var db=require(_0xaa8f('0xa'))['db'];config[_0xaa8f('0xb')]=_['defaults'](config[_0xaa8f('0xb')],{'host':_0xaa8f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa8f('0xb')]));require('./cmContact.socket')['register'](socket);function respondWithResult(_0xa4102d,_0x21cabe){_0x21cabe=_0x21cabe||0xc8;return function(_0x7665a3){if(_0x7665a3){return _0xa4102d[_0xaa8f('0xd')](_0x21cabe)[_0xaa8f('0xe')](_0x7665a3);}};}function respondWithFilteredResult(_0x27cb56,_0x5deb31){return function(_0x1864eb){if(_0x1864eb){var _0x145c99=typeof _0x5deb31[_0xaa8f('0xf')]===_0xaa8f('0x10')&&typeof _0x5deb31[_0xaa8f('0x11')]==='undefined';var _0x14c2d3=_0x1864eb['count'];var _0x2b018c=_0x145c99?0x0:_0x5deb31[_0xaa8f('0xf')];var _0x52ec27=_0x145c99?_0x1864eb[_0xaa8f('0x12')]:_0x5deb31[_0xaa8f('0xf')]+_0x5deb31[_0xaa8f('0x11')];var _0x67606e;if(_0x52ec27>=_0x14c2d3){_0x52ec27=_0x14c2d3;_0x67606e=0xc8;}else{_0x67606e=0xce;}_0x27cb56['status'](_0x67606e);return _0x27cb56[_0xaa8f('0x13')](_0xaa8f('0x14'),_0x2b018c+'-'+_0x52ec27+'/'+_0x14c2d3)[_0xaa8f('0xe')](_0x1864eb);}return null;};}function saveUpdates(_0x23deb4){return function(_0x4d3e43){if(_0x4d3e43){return _0x4d3e43[_0xaa8f('0x15')](_0x23deb4)[_0xaa8f('0x16')](function(_0x287947){return _0x287947;});}return null;};}function removeEntity(_0x336ac5){return function(_0x18cf9f){if(_0x18cf9f){return _0x18cf9f[_0xaa8f('0x17')]()[_0xaa8f('0x16')](function(){_0x336ac5['status'](0xcc)[_0xaa8f('0x18')]();});}};}function handleEntityNotFound(_0x38f7e8){return function(_0x5c7228){if(!_0x5c7228){_0x38f7e8[_0xaa8f('0x19')](0x194);}return _0x5c7228;};}function handleError(_0x4ec3e8,_0x2a72fd){_0x2a72fd=_0x2a72fd||0x1f4;return function(_0x3a17cf){logger['error'](_0x3a17cf['stack']);if(_0x3a17cf[_0xaa8f('0x1a')]){delete _0x3a17cf['name'];}_0x4ec3e8['status'](_0x2a72fd)['send'](_0x3a17cf);};}exports[_0xaa8f('0x1b')]=function(_0x172aa6,_0x1c069f){var _0x2c97a8={};return contacts[_0xaa8f('0x1c')]()[_0xaa8f('0x16')](function(_0xe6b3d8){_0x2c97a8=qs[_0xaa8f('0x1d')](_0xe6b3d8,_0x172aa6);return contacts[_0xaa8f('0x1e')](_0x172aa6['query'],_0x172aa6[_0xaa8f('0x1f')],_0x2c97a8,_0xe6b3d8);})[_0xaa8f('0x16')](respondWithFilteredResult(_0x1c069f,_0x2c97a8))[_0xaa8f('0x20')](handleError(_0x1c069f,null));};exports['destroy']=function(_0x2dad2a,_0xce5d2f){return db['CmContact']['find']({'where':{'id':_0x2dad2a[_0xaa8f('0x21')]['id']}})[_0xaa8f('0x16')](handleEntityNotFound(_0xce5d2f,null))[_0xaa8f('0x16')](removeEntity(_0xce5d2f,null))[_0xaa8f('0x20')](handleError(_0xce5d2f,null));};exports[_0xaa8f('0x1c')]=function(_0x3794b5,_0x298fd9){return db[_0xaa8f('0x22')][_0xaa8f('0x1c')]()[_0xaa8f('0x16')](function(_0x9a4b54){delete _0x9a4b54[_0xaa8f('0x23')];for(var _0x59c53d=0x0;_0x59c53d
','generateXOAuth2Token','auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','path','util','node-tnef'];(function(_0x117a9d,_0x54bd98){var _0x259966=function(_0x1dd7bc){while(--_0x1dd7bc){_0x117a9d['push'](_0x117a9d['shift']());}};_0x259966(++_0x54bd98);}(_0xde07,0x11e));var _0x7de0=function(_0x1601c0,_0x8d1d34){_0x1601c0=_0x1601c0-0x0;var _0x24bade=_0xde07[_0x1601c0];return _0x24bade;};'use strict';var _=require(_0x7de0('0x0'));var moment=require(_0x7de0('0x1'));var random=require(_0x7de0('0x2'));var fs=require('fs');var path=require(_0x7de0('0x3'));var util=require(_0x7de0('0x4'));var tnef=require(_0x7de0('0x5'));var logger=require('../../../config/logger')(_0x7de0('0x6'));var config=require(_0x7de0('0x7'));function getAddress(_0x218921){var _0x3b9768=_[_0x7de0('0x8')](_0x218921['value']);return _0x3b9768&&_0x3b9768[_0x7de0('0x9')]?_0x3b9768[_0x7de0('0x9')]:_0x7de0('0xa')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0x4f6a6c){var _0x32d5d5=_[_0x7de0('0x8')](_0x4f6a6c[_0x7de0('0xb')]);if(_0x32d5d5&&_0x32d5d5[_0x7de0('0xc')]){if(_0x32d5d5[_0x7de0('0xc')]==_0x32d5d5[_0x7de0('0x9')]){return _0x32d5d5[_0x7de0('0xc')][_0x7de0('0xd')](0x0,_0x32d5d5[_0x7de0('0xc')]['indexOf']('@'));}var _0x296bf8=_0x32d5d5[_0x7de0('0xc')][_0x7de0('0xe')](/\s+/);return _0x296bf8['length']>0x1?_0x296bf8[_0x7de0('0xf')](0x0,-0x1)[_0x7de0('0x10')]('\x20'):_0x32d5d5[_0x7de0('0xc')];}return _0x7de0('0x11');}function getLastName(_0x3db3de){var _0x5106a2=_[_0x7de0('0x8')](_0x3db3de[_0x7de0('0xb')]);if(_0x5106a2&&_0x5106a2['name']){var _0x49616d=_0x5106a2['name'][_0x7de0('0xe')](/\s+/);return _0x49616d[_0x7de0('0x12')]>0x1?_0x49616d[_0x7de0('0x13')]():'';}return'';}function getMails(_0x4811ef,_0x52e39a){var _0x365e8c='';for(var _0x491a75=0x0;_0x491a75<_0x52e39a['value'][_0x7de0('0x12')];_0x491a75+=0x1){if(_0x52e39a[_0x7de0('0xb')][_0x491a75][_0x7de0('0x9')]!==_0x4811ef){if(!_[_0x7de0('0x14')](_0x365e8c)){_0x365e8c+=',';}_0x365e8c+=_0x52e39a['value'][_0x491a75][_0x7de0('0xc')]||_0x52e39a['value'][_0x491a75][_0x7de0('0x9')]||'';_0x365e8c+='\x20<';_0x365e8c+=_0x52e39a[_0x7de0('0xb')][_0x491a75][_0x7de0('0x9')]?_0x52e39a[_0x7de0('0xb')][_0x491a75][_0x7de0('0x9')]:_0x7de0('0xa')+random['generate'](0x6)+_0x7de0('0x15');_0x365e8c+='>';}}return _0x365e8c;}function parseEmail(_0x10f31b,_0x183578,_0x252709){if(_0x183578[_0x7de0('0x16')]){var _0x227be4=/