From: Andrea Amorese
Date: Wed, 22 Sep 2021 14:45:23 +0000 (+0200)
Subject: Built motion from commit 008d0846.|2.5.35
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22card-image.png//%27?a=commitdiff_plain;h=120f342b34bc71f0575aa6f49e1da428d0f7ad3e;p=motion2.git
Built motion from commit 008d0846.|2.5.35
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index daba2d3..3989244 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-22T14:12:21.701Z",
+ "time": "2021-09-22T14:32:34.968Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 19dfd20..e62a065 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-22T14:12:21.701Z",
+ "time": "2021-09-22T14:32:34.968Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index b506c89..450c3b6 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 _0x5410=['exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]'];(function(_0x42bb6d,_0x412255){var _0x1db89b=function(_0x5da43a){while(--_0x5da43a){_0x42bb6d['push'](_0x42bb6d['shift']());}};_0x1db89b(++_0x412255);}(_0x5410,0xa0));var _0x0541=function(_0x55c234,_0x7a8f12){_0x55c234=_0x55c234-0x0;var _0x18728a=_0x5410[_0x55c234];return _0x18728a;};'use strict';var Sequelize=require('sequelize');module[_0x0541('0x0')]={'name':{'type':Sequelize[_0x0541('0x1')],'get':function(_0x8c456b){return this[_0x0541('0x2')](_0x0541('0x3'));}},'action':{'type':Sequelize[_0x0541('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x0541('0x5'),_0x0541('0x6'),_0x0541('0x7'),_0x0541('0x8'),'urlForward',_0x0541('0x9'),_0x0541('0xa'),_0x0541('0xb')]],'msg':_0x0541('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x0541('0x4')](0x1000),'comment':_0x0541('0xd')},'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[_0x0541('0x4')](0x1000),'comment':_0x0541('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x0541('0xf')},'data5':{'type':Sequelize[_0x0541('0x4')](0x1000),'comments':_0x0541('0x10')},'data6':{'type':Sequelize[_0x0541('0x4')],'comments':_0x0541('0x11')},'data7':{'type':Sequelize[_0x0541('0x12')],'comments':_0x0541('0x13')}};
\ No newline at end of file
+var _0xc69b=['jscripty','urlForward','browser','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)]','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]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar'];(function(_0x392a29,_0x4ea6c1){var _0xe66a49=function(_0x49b321){while(--_0x49b321){_0x392a29['push'](_0x392a29['shift']());}};_0xe66a49(++_0x4ea6c1);}(_0xc69b,0x1d3));var _0xbc69=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0xc69b[_0x50e40b];return _0x2608b7;};'use strict';var Sequelize=require(_0xbc69('0x0'));module[_0xbc69('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3f1ece){return this[_0xbc69('0x2')](_0xbc69('0x3'));}},'action':{'type':Sequelize[_0xbc69('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xbc69('0x5'),_0xbc69('0x6'),_0xbc69('0x7'),_0xbc69('0x8'),_0xbc69('0x9'),_0xbc69('0xa'),_0xbc69('0xb'),'script']],'msg':_0xbc69('0xc')}},'comment':_0xbc69('0xc')},'data1':{'type':Sequelize[_0xbc69('0x4')](0x1000),'comment':_0xbc69('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xbc69('0xe')},'data3':{'type':Sequelize[_0xbc69('0x4')](0x1000),'comment':_0xbc69('0xf')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xbc69('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xbc69('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xbc69('0x11')],'comments':_0xbc69('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 8929fce..457efd0 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 _0x597e=['sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','stack','name','send','body','Action','find','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x3bdc30,_0x119486){var _0x1a4986=function(_0x4a2ed0){while(--_0x4a2ed0){_0x3bdc30['push'](_0x3bdc30['shift']());}};_0x1a4986(++_0x119486);}(_0x597e,0x6e));var _0xe597=function(_0x178aed,_0x4dd59b){_0x178aed=_0x178aed-0x0;var _0x35d896=_0x597e[_0x178aed];return _0x35d896;};'use strict';var emlformat=require(_0xe597('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe597('0x1'));var jsonpatch=require(_0xe597('0x2'));var rp=require(_0xe597('0x3'));var moment=require(_0xe597('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe597('0x5'));var path=require(_0xe597('0x6'));var sox=require(_0xe597('0x7'));var csv=require('to-csv');var ejs=require(_0xe597('0x8'));var fs=require('fs');var fs_extra=require(_0xe597('0x9'));var _=require(_0xe597('0xa'));var squel=require(_0xe597('0xb'));var crypto=require('crypto');var jsforce=require(_0xe597('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe597('0xd'));var querystring=require(_0xe597('0xe'));var Papa=require(_0xe597('0xf'));var Redis=require(_0xe597('0x10'));var authService=require(_0xe597('0x11'));var qs=require(_0xe597('0x12'));var as=require(_0xe597('0x13'));var hardwareService=require(_0xe597('0x14'));var logger=require(_0xe597('0x15'))('api');var utils=require(_0xe597('0x16'));var config=require(_0xe597('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe597('0x18'))['db'];function respondWithStatusCode(_0x3792db,_0x52e824){_0x52e824=_0x52e824||0xcc;return function(_0x3156b3){if(_0x3156b3){return _0x3792db[_0xe597('0x19')](_0x52e824);}return _0x3792db[_0xe597('0x1a')](_0x52e824)[_0xe597('0x1b')]();};}function respondWithResult(_0x7ff3eb,_0x391565){_0x391565=_0x391565||0xc8;return function(_0x36071d){if(_0x36071d){return _0x7ff3eb['status'](_0x391565)[_0xe597('0x1c')](_0x36071d);}};}function respondWithFilteredResult(_0xdd026f,_0x4265fe){return function(_0x453c84){if(_0x453c84){var _0x43b3d8=typeof _0x4265fe[_0xe597('0x1d')]===_0xe597('0x1e')&&typeof _0x4265fe[_0xe597('0x1f')]===_0xe597('0x1e');var _0x5bca11=_0x453c84[_0xe597('0x20')];var _0x45b265=_0x43b3d8?0x0:_0x4265fe['offset'];var _0x573666=_0x43b3d8?_0x453c84['count']:_0x4265fe[_0xe597('0x1d')]+_0x4265fe['limit'];var _0x5e55c6;if(_0x573666>=_0x5bca11){_0x573666=_0x5bca11;_0x5e55c6=0xc8;}else{_0x5e55c6=0xce;}_0xdd026f[_0xe597('0x1a')](_0x5e55c6);return _0xdd026f['set']('Content-Range',_0x45b265+'-'+_0x573666+'/'+_0x5bca11)[_0xe597('0x1c')](_0x453c84);}return null;};}function patchUpdates(_0x712e2d){return function(_0x5edcd8){try{jsonpatch['apply'](_0x5edcd8,_0x712e2d,!![]);}catch(_0x4c2485){return BPromise[_0xe597('0x21')](_0x4c2485);}return _0x5edcd8[_0xe597('0x22')]();};}function saveUpdates(_0x795126,_0x14e007){return function(_0x4b3d96){if(_0x4b3d96){return _0x4b3d96[_0xe597('0x23')](_0x795126)[_0xe597('0x24')](function(_0x341b80){return _0x341b80;});}return null;};}function removeEntity(_0x53af4a,_0x318e4e){return function(_0x3b4e93){if(_0x3b4e93){return _0x3b4e93[_0xe597('0x25')]()['then'](function(){_0x53af4a[_0xe597('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eb2c5,_0x1cb205){return function(_0x555dfd){if(!_0x555dfd){_0x1eb2c5[_0xe597('0x19')](0x194);}return _0x555dfd;};}function handleError(_0x187053,_0x3de7ce){_0x3de7ce=_0x3de7ce||0x1f4;return function(_0x1db1c0){logger['error'](_0x1db1c0[_0xe597('0x26')]);if(_0x1db1c0[_0xe597('0x27')]){delete _0x1db1c0[_0xe597('0x27')];}_0x187053[_0xe597('0x1a')](_0x3de7ce)[_0xe597('0x28')](_0x1db1c0);};}exports[_0xe597('0x23')]=function(_0xba9b7f,_0xe8cbba){if(_0xba9b7f[_0xe597('0x29')]['id']){delete _0xba9b7f[_0xe597('0x29')]['id'];}return db[_0xe597('0x2a')][_0xe597('0x2b')]({'where':{'id':_0xba9b7f['params']['id']}})[_0xe597('0x24')](handleEntityNotFound(_0xe8cbba,null))['then'](saveUpdates(_0xba9b7f[_0xe597('0x29')],null))[_0xe597('0x24')](respondWithResult(_0xe8cbba,null))[_0xe597('0x2c')](handleError(_0xe8cbba,null));};exports[_0xe597('0x25')]=function(_0xce44d8,_0x27fb35){return db['Action'][_0xe597('0x2b')]({'where':{'id':_0xce44d8['params']['id']}})['then'](handleEntityNotFound(_0x27fb35,null))[_0xe597('0x24')](removeEntity(_0x27fb35,null))[_0xe597('0x2c')](handleError(_0x27fb35,null));};
\ No newline at end of file
+var _0xf9c3=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','body','find','params','catch','Action','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4c6abc,_0x5dfb0b){var _0x146d22=function(_0x371bf2){while(--_0x371bf2){_0x4c6abc['push'](_0x4c6abc['shift']());}};_0x146d22(++_0x5dfb0b);}(_0xf9c3,0xd5));var _0x3f9c=function(_0x5dea35,_0x4403ce){_0x5dea35=_0x5dea35-0x0;var _0x420537=_0xf9c3[_0x5dea35];return _0x420537;};'use strict';var emlformat=require(_0x3f9c('0x0'));var rimraf=require(_0x3f9c('0x1'));var zipdir=require(_0x3f9c('0x2'));var jsonpatch=require(_0x3f9c('0x3'));var rp=require('request-promise');var moment=require(_0x3f9c('0x4'));var BPromise=require(_0x3f9c('0x5'));var Mustache=require(_0x3f9c('0x6'));var util=require(_0x3f9c('0x7'));var path=require('path');var sox=require(_0x3f9c('0x8'));var csv=require(_0x3f9c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f9c('0xa'));var squel=require(_0x3f9c('0xb'));var crypto=require(_0x3f9c('0xc'));var jsforce=require(_0x3f9c('0xd'));var deskjs=require(_0x3f9c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3f9c('0xf'));var Papa=require(_0x3f9c('0x10'));var Redis=require(_0x3f9c('0x11'));var authService=require(_0x3f9c('0x12'));var qs=require(_0x3f9c('0x13'));var as=require(_0x3f9c('0x14'));var hardwareService=require(_0x3f9c('0x15'));var logger=require(_0x3f9c('0x16'))('api');var utils=require(_0x3f9c('0x17'));var config=require(_0x3f9c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f9c('0x19'))['db'];function respondWithStatusCode(_0x5d42b5,_0x2c460c){_0x2c460c=_0x2c460c||0xcc;return function(_0x3196b9){if(_0x3196b9){return _0x5d42b5['sendStatus'](_0x2c460c);}return _0x5d42b5[_0x3f9c('0x1a')](_0x2c460c)[_0x3f9c('0x1b')]();};}function respondWithResult(_0x53478a,_0x1bbf39){_0x1bbf39=_0x1bbf39||0xc8;return function(_0x3cf94e){if(_0x3cf94e){return _0x53478a['status'](_0x1bbf39)[_0x3f9c('0x1c')](_0x3cf94e);}};}function respondWithFilteredResult(_0x3ebc42,_0x3ea7a8){return function(_0x1b654d){if(_0x1b654d){var _0x5c189f=typeof _0x3ea7a8[_0x3f9c('0x1d')]===_0x3f9c('0x1e')&&typeof _0x3ea7a8['limit']==='undefined';var _0xb797cd=_0x1b654d['count'];var _0x5d8363=_0x5c189f?0x0:_0x3ea7a8[_0x3f9c('0x1d')];var _0x42037c=_0x5c189f?_0x1b654d[_0x3f9c('0x1f')]:_0x3ea7a8['offset']+_0x3ea7a8['limit'];var _0x53605c;if(_0x42037c>=_0xb797cd){_0x42037c=_0xb797cd;_0x53605c=0xc8;}else{_0x53605c=0xce;}_0x3ebc42[_0x3f9c('0x1a')](_0x53605c);return _0x3ebc42[_0x3f9c('0x20')](_0x3f9c('0x21'),_0x5d8363+'-'+_0x42037c+'/'+_0xb797cd)['json'](_0x1b654d);}return null;};}function patchUpdates(_0x49d438){return function(_0xff853c){try{jsonpatch[_0x3f9c('0x22')](_0xff853c,_0x49d438,!![]);}catch(_0x10c5de){return BPromise[_0x3f9c('0x23')](_0x10c5de);}return _0xff853c['save']();};}function saveUpdates(_0x45411f,_0x2d51d1){return function(_0x32b1be){if(_0x32b1be){return _0x32b1be[_0x3f9c('0x24')](_0x45411f)[_0x3f9c('0x25')](function(_0x15f0b3){return _0x15f0b3;});}return null;};}function removeEntity(_0x1d091f,_0xdd4960){return function(_0xcf697){if(_0xcf697){return _0xcf697[_0x3f9c('0x26')]()[_0x3f9c('0x25')](function(){_0x1d091f[_0x3f9c('0x1a')](0xcc)[_0x3f9c('0x1b')]();});}};}function handleEntityNotFound(_0x17c554,_0x240dde){return function(_0x36168c){if(!_0x36168c){_0x17c554['sendStatus'](0x194);}return _0x36168c;};}function handleError(_0xb2a148,_0x2a8b73){_0x2a8b73=_0x2a8b73||0x1f4;return function(_0x469a7f){logger[_0x3f9c('0x27')](_0x469a7f[_0x3f9c('0x28')]);if(_0x469a7f['name']){delete _0x469a7f[_0x3f9c('0x29')];}_0xb2a148[_0x3f9c('0x1a')](_0x2a8b73)['send'](_0x469a7f);};}exports[_0x3f9c('0x24')]=function(_0x2ca57d,_0x1f9612){if(_0x2ca57d[_0x3f9c('0x2a')]['id']){delete _0x2ca57d[_0x3f9c('0x2a')]['id'];}return db['Action'][_0x3f9c('0x2b')]({'where':{'id':_0x2ca57d[_0x3f9c('0x2c')]['id']}})[_0x3f9c('0x25')](handleEntityNotFound(_0x1f9612,null))[_0x3f9c('0x25')](saveUpdates(_0x2ca57d[_0x3f9c('0x2a')],null))[_0x3f9c('0x25')](respondWithResult(_0x1f9612,null))[_0x3f9c('0x2d')](handleError(_0x1f9612,null));};exports[_0x3f9c('0x26')]=function(_0x4eadae,_0x52fbc5){return db[_0x3f9c('0x2e')][_0x3f9c('0x2b')]({'where':{'id':_0x4eadae['params']['id']}})[_0x3f9c('0x25')](handleEntityNotFound(_0x52fbc5,null))[_0x3f9c('0x25')](removeEntity(_0x52fbc5,null))['catch'](handleError(_0x52fbc5,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 9975d81..9f07a60 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 _0x5305=['moment','path','rimraf','define','Action','tools_actions','util','../../config/logger'];(function(_0x2aceeb,_0x262b37){var _0xd0c95e=function(_0x535a59){while(--_0x535a59){_0x2aceeb['push'](_0x2aceeb['shift']());}};_0xd0c95e(++_0x262b37);}(_0x5305,0x9e));var _0x5530=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5305[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x5530('0x0'));var logger=require(_0x5530('0x1'))('api');var moment=require(_0x5530('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5530('0x3'));var rimraf=require(_0x5530('0x4'));var config=require('../../config/environment');var attributes=require('./action.attributes');module['exports']=function(_0x9fa2a2,_0x4cf450){return _0x9fa2a2[_0x5530('0x5')](_0x5530('0x6'),attributes,{'tableName':_0x5530('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeff4=['api','moment','bluebird','request-promise','rimraf','Action','tools_actions','lodash','util','../../config/logger'];(function(_0x5bc372,_0x446052){var _0x4749ba=function(_0x9a972c){while(--_0x9a972c){_0x5bc372['push'](_0x5bc372['shift']());}};_0x4749ba(++_0x446052);}(_0xeff4,0x16f));var _0x4eff=function(_0x126f47,_0x2199e9){_0x126f47=_0x126f47-0x0;var _0x49508a=_0xeff4[_0x126f47];return _0x49508a;};'use strict';var _=require(_0x4eff('0x0'));var util=require(_0x4eff('0x1'));var logger=require(_0x4eff('0x2'))(_0x4eff('0x3'));var moment=require(_0x4eff('0x4'));var BPromise=require(_0x4eff('0x5'));var rp=require(_0x4eff('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4eff('0x7'));var config=require('../../config/environment');var attributes=require('./action.attributes');module['exports']=function(_0x3fd53c,_0x413ee2){return _0x3fd53c['define'](_0x4eff('0x8'),attributes,{'tableName':_0x4eff('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 ae8a7c0..df3c3ff 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 _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4d7f3f,_0x4d2803){var _0x5d67cc=function(_0x2c37f4){while(--_0x2c37f4){_0x4d7f3f['push'](_0x4d7f3f['shift']());}};_0x5d67cc(++_0x4d2803);}(_0xf494,0x1c6));var _0x4f49=function(_0x34042c,_0x3ccb92){_0x34042c=_0x34042c-0x0;var _0x53f279=_0xf494[_0x34042c];return _0x53f279;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
+var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0xf494,0x1c6));var _0x4f49=function(_0x17cce8,_0x2ad6d5){_0x17cce8=_0x17cce8-0x0;var _0x41d0d8=_0xf494[_0x17cce8];return _0x41d0d8;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index dd66430..274b527 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 _0xb825=['fs-extra','../../components/auth/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','express','Router'];(function(_0x3439ea,_0x3c68ba){var _0x3900a3=function(_0x38f9a5){while(--_0x38f9a5){_0x3439ea['push'](_0x3439ea['shift']());}};_0x3900a3(++_0x3c68ba);}(_0xb825,0x130));var _0x5b82=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb825[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x5b82('0x0'));var util=require(_0x5b82('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5b82('0x2'));var router=express[_0x5b82('0x3')]();var fs_extra=require(_0x5b82('0x4'));var auth=require(_0x5b82('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5b82('0x6'));var controller=require('./action.controller');router[_0x5b82('0x7')](_0x5b82('0x8'),auth[_0x5b82('0x9')](),controller[_0x5b82('0xa')]);router[_0x5b82('0xb')](_0x5b82('0x8'),auth[_0x5b82('0x9')](),controller[_0x5b82('0xc')]);module[_0x5b82('0xd')]=router;
\ No newline at end of file
+var _0xd80f=['delete','isAuthenticated','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','put','/:id','update'];(function(_0xe39824,_0xbdf61f){var _0x4bc31e=function(_0x594760){while(--_0x594760){_0xe39824['push'](_0xe39824['shift']());}};_0x4bc31e(++_0xbdf61f);}(_0xd80f,0xc7));var _0xfd80=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd80f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfd80('0x0'));var util=require(_0xfd80('0x1'));var path=require('path');var timeout=require(_0xfd80('0x2'));var express=require(_0xfd80('0x3'));var router=express[_0xfd80('0x4')]();var fs_extra=require(_0xfd80('0x5'));var auth=require(_0xfd80('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfd80('0x7'));var controller=require('./action.controller');router[_0xfd80('0x8')](_0xfd80('0x9'),auth['isAuthenticated'](),controller[_0xfd80('0xa')]);router[_0xfd80('0xb')](_0xfd80('0x9'),auth[_0xfd80('0xc')](),controller[_0xfd80('0xd')]);module[_0xfd80('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 7bc8758..d49f9b8 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 _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4701d9,_0x4bd3e4){_0x4701d9=_0x4701d9-0x0;var _0x8f8620=_0x1cb9[_0x4701d9];return _0x8f8620;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x91cb('0x1')]},'parent':{'type':Sequelize[_0x91cb('0x1')]},'table':{'type':Sequelize[_0x91cb('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x91cb('0x2')]}};
\ No newline at end of file
+var _0xae24=['sequelize','STRING'];(function(_0x2dc272,_0x28b70d){var _0x109da9=function(_0x46f63e){while(--_0x46f63e){_0x2dc272['push'](_0x2dc272['shift']());}};_0x109da9(++_0x28b70d);}(_0xae24,0x182));var _0x4ae2=function(_0x206fd0,_0x4e33a4){_0x206fd0=_0x206fd0-0x0;var _0x2457be=_0xae24[_0x206fd0];return _0x2457be;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ae2('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4ae2('0x1')]},'table':{'type':Sequelize[_0x4ae2('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 3f31035..5095b51 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 _0x26c8=['operator','value','Sequelize','ValidationErrorItem','keyBy','select','metric','groupBy','clone','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','join','../../components/export/','countTable','COUNT(*)','SELECT','run','runReport','UNIX_TIMESTAMP(%s)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','limit','offset','count','set','reject','save','update','then','get','CustomReports','UserProfileResource','destroy','error','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','include','rows','catch','show','params','length','find','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%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)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','options','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','from','table','MetricId','field','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','MAX(%s)','DATE(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY'];(function(_0x3c6a91,_0x2cf7ee){var _0x170a38=function(_0x41df54){while(--_0x41df54){_0x3c6a91['push'](_0x3c6a91['shift']());}};_0x170a38(++_0x2cf7ee);}(_0x26c8,0xc9));var _0x826c=function(_0x72b94c,_0x22de6a){_0x72b94c=_0x72b94c-0x0;var _0x5893fd=_0x26c8[_0x72b94c];return _0x5893fd;};'use strict';var emlformat=require(_0x826c('0x0'));var rimraf=require(_0x826c('0x1'));var zipdir=require(_0x826c('0x2'));var jsonpatch=require(_0x826c('0x3'));var rp=require(_0x826c('0x4'));var moment=require(_0x826c('0x5'));var BPromise=require(_0x826c('0x6'));var Mustache=require(_0x826c('0x7'));var util=require(_0x826c('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x826c('0x9'));var ejs=require(_0x826c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x826c('0xb'));var crypto=require(_0x826c('0xc'));var jsforce=require(_0x826c('0xd'));var deskjs=require(_0x826c('0xe'));var toCsv=require(_0x826c('0x9'));var querystring=require(_0x826c('0xf'));var Papa=require(_0x826c('0x10'));var Redis=require(_0x826c('0x11'));var authService=require(_0x826c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x826c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x826c('0x14'))(_0x826c('0x15'));var utils=require(_0x826c('0x16'));var config=require(_0x826c('0x17'));var licenseUtil=require(_0x826c('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x826c('0x19'))[_0x826c('0x1a')];function respondWithStatusCode(_0x4d922f,_0x509241){_0x509241=_0x509241||0xcc;return function(_0x5bce7b){if(_0x5bce7b){return _0x4d922f[_0x826c('0x1b')](_0x509241);}return _0x4d922f[_0x826c('0x1c')](_0x509241)[_0x826c('0x1d')]();};}function respondWithResult(_0x317a85,_0x4e1a04){_0x4e1a04=_0x4e1a04||0xc8;return function(_0x4d9afa){if(_0x4d9afa){return _0x317a85['status'](_0x4e1a04)[_0x826c('0x1e')](_0x4d9afa);}};}function respondWithFilteredResult(_0x1e82e5,_0x13fc9){return function(_0x2c49df){if(_0x2c49df){var _0x318cef=typeof _0x13fc9['offset']===_0x826c('0x1f')&&typeof _0x13fc9[_0x826c('0x20')]==='undefined';var _0x4e3899=_0x2c49df['count'];var _0x5867e5=_0x318cef?0x0:_0x13fc9[_0x826c('0x21')];var _0x8a2f88=_0x318cef?_0x2c49df[_0x826c('0x22')]:_0x13fc9[_0x826c('0x21')]+_0x13fc9[_0x826c('0x20')];var _0x12be20;if(_0x8a2f88>=_0x4e3899){_0x8a2f88=_0x4e3899;_0x12be20=0xc8;}else{_0x12be20=0xce;}_0x1e82e5[_0x826c('0x1c')](_0x12be20);return _0x1e82e5[_0x826c('0x23')]('Content-Range',_0x5867e5+'-'+_0x8a2f88+'/'+_0x4e3899)['json'](_0x2c49df);}return null;};}function patchUpdates(_0x55780d){return function(_0x4f02fa){try{jsonpatch['apply'](_0x4f02fa,_0x55780d,!![]);}catch(_0x4c154c){return BPromise[_0x826c('0x24')](_0x4c154c);}return _0x4f02fa[_0x826c('0x25')]();};}function saveUpdates(_0x3c0c46,_0x4dfeb8){return function(_0x5397b1){if(_0x5397b1){return _0x5397b1[_0x826c('0x26')](_0x3c0c46)['then'](function(_0x4d438f){return _0x4d438f;});}return null;};}function removeEntity(_0x50f755,_0x31dcd6){return function(_0x38adea){if(_0x38adea){return _0x38adea['destroy']()[_0x826c('0x27')](function(){var _0x3a3901=_0x38adea[_0x826c('0x28')]({'plain':!![]});var _0x2968e6=_0x826c('0x29');return db[_0x826c('0x2a')][_0x826c('0x2b')]({'where':{'type':_0x2968e6,'resourceId':_0x3a3901['id']}})['then'](function(){return _0x38adea;});})['then'](function(){_0x50f755['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40c9d3,_0x324ebf){return function(_0x43e6e5){if(!_0x43e6e5){_0x40c9d3[_0x826c('0x1b')](0x194);}return _0x43e6e5;};}function handleError(_0x354f73,_0x3c9718){_0x3c9718=_0x3c9718||0x1f4;return function(_0x3928c2){logger[_0x826c('0x2c')](_0x3928c2['stack']);if(_0x3928c2[_0x826c('0x2d')]){delete _0x3928c2[_0x826c('0x2d')];}_0x354f73[_0x826c('0x1c')](_0x3c9718)[_0x826c('0x2e')](_0x3928c2);};}exports[_0x826c('0x2f')]=function(_0x45d74f,_0x39da9b){var _0x34ce56={},_0x341f6e={},_0x11ee9e={'count':0x0,'rows':[]};var _0x337584=_['map'](db[_0x826c('0x30')][_0x826c('0x31')],function(_0x5b7246){return{'name':_0x5b7246[_0x826c('0x32')],'type':_0x5b7246['type']['key']};});_0x341f6e['model']=_[_0x826c('0x33')](_0x337584,_0x826c('0x2d'));_0x341f6e['query']=_[_0x826c('0x34')](_0x45d74f[_0x826c('0x35')]);_0x341f6e[_0x826c('0x36')]=_[_0x826c('0x37')](_0x341f6e[_0x826c('0x38')],_0x341f6e['query']);_0x34ce56[_0x826c('0x39')]=_[_0x826c('0x37')](_0x341f6e['model'],qs[_0x826c('0x3a')](_0x45d74f['query'][_0x826c('0x3a')]));_0x34ce56['attributes']=_0x34ce56[_0x826c('0x39')]['length']?_0x34ce56[_0x826c('0x39')]:_0x341f6e[_0x826c('0x38')];if(!_0x45d74f[_0x826c('0x35')][_0x826c('0x3b')]('nolimit')){_0x34ce56[_0x826c('0x20')]=qs[_0x826c('0x20')](_0x45d74f['query'][_0x826c('0x20')]);_0x34ce56[_0x826c('0x21')]=qs[_0x826c('0x21')](_0x45d74f[_0x826c('0x35')][_0x826c('0x21')]);}_0x34ce56[_0x826c('0x3c')]=qs[_0x826c('0x3d')](_0x45d74f[_0x826c('0x35')]['sort']);_0x34ce56['where']=qs['filters'](_[_0x826c('0x3e')](_0x45d74f[_0x826c('0x35')],_0x341f6e[_0x826c('0x36')]),_0x337584);if(_0x45d74f[_0x826c('0x35')][_0x826c('0x3f')]){_0x34ce56[_0x826c('0x40')]=_['merge'](_0x34ce56['where'],{'$or':_[_0x826c('0x33')](_0x337584,function(_0x3ad961){if(_0x3ad961[_0x826c('0x41')]!==_0x826c('0x42')){var _0x4d4833={};_0x4d4833[_0x3ad961['name']]={'$like':'%'+_0x45d74f[_0x826c('0x35')][_0x826c('0x3f')]+'%'};return _0x4d4833;}})});}_0x34ce56=_[_0x826c('0x43')]({},_0x34ce56,_0x45d74f['options']);var _0x42151b={'where':_0x34ce56['where']};return db[_0x826c('0x30')][_0x826c('0x22')](_0x42151b)[_0x826c('0x27')](function(_0x2dc6ee){_0x11ee9e['count']=_0x2dc6ee;if(_0x45d74f[_0x826c('0x35')][_0x826c('0x44')]){_0x34ce56[_0x826c('0x45')]=[{'all':!![]}];}return db[_0x826c('0x30')]['findAll'](_0x34ce56);})[_0x826c('0x27')](function(_0x4b4066){_0x11ee9e[_0x826c('0x46')]=_0x4b4066;return _0x11ee9e;})[_0x826c('0x27')](respondWithFilteredResult(_0x39da9b,_0x34ce56))[_0x826c('0x47')](handleError(_0x39da9b,null));};exports[_0x826c('0x48')]=function(_0x32364c,_0x13df2f){var _0x16a8fa={'raw':![],'where':{'id':_0x32364c[_0x826c('0x49')]['id']}},_0x1fc492={};_0x1fc492[_0x826c('0x38')]=_[_0x826c('0x34')](db[_0x826c('0x30')][_0x826c('0x31')]);_0x1fc492[_0x826c('0x35')]=_[_0x826c('0x34')](_0x32364c[_0x826c('0x35')]);_0x1fc492[_0x826c('0x36')]=_[_0x826c('0x37')](_0x1fc492[_0x826c('0x38')],_0x1fc492[_0x826c('0x35')]);_0x16a8fa[_0x826c('0x39')]=_[_0x826c('0x37')](_0x1fc492[_0x826c('0x38')],qs[_0x826c('0x3a')](_0x32364c['query'][_0x826c('0x3a')]));_0x16a8fa[_0x826c('0x39')]=_0x16a8fa[_0x826c('0x39')][_0x826c('0x4a')]?_0x16a8fa[_0x826c('0x39')]:_0x1fc492[_0x826c('0x38')];if(_0x32364c['query'][_0x826c('0x44')]){_0x16a8fa['include']=[{'all':!![]}];}_0x16a8fa=_[_0x826c('0x43')]({},_0x16a8fa,_0x32364c['options']);return db[_0x826c('0x30')][_0x826c('0x4b')](_0x16a8fa)[_0x826c('0x27')](handleEntityNotFound(_0x13df2f,null))['then'](respondWithResult(_0x13df2f,null))[_0x826c('0x47')](handleError(_0x13df2f,null));};exports[_0x826c('0x4c')]=function(_0x595447,_0x1a1f82){return db[_0x826c('0x30')][_0x826c('0x4c')](_0x595447[_0x826c('0x4d')],{})[_0x826c('0x27')](function(_0x84bb69){var _0x1b7837=_0x595447[_0x826c('0x4e')]['get']({'plain':!![]});if(!_0x1b7837)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b7837[_0x826c('0x4f')]==='user'){var _0x11003e=_0x84bb69[_0x826c('0x28')]({'plain':!![]});var _0x212679=_0x826c('0x50');return db[_0x826c('0x51')][_0x826c('0x4b')]({'where':{'name':_0x212679,'userProfileId':_0x1b7837[_0x826c('0x52')]},'raw':!![]})[_0x826c('0x27')](function(_0x4e94f1){if(_0x4e94f1&&_0x4e94f1[_0x826c('0x53')]===0x0){return db[_0x826c('0x2a')][_0x826c('0x4c')]({'name':_0x11003e[_0x826c('0x2d')],'resourceId':_0x11003e['id'],'type':'CustomReports','sectionId':_0x4e94f1['id']},{})[_0x826c('0x27')](function(){return _0x84bb69;});}else{return _0x84bb69;}})[_0x826c('0x47')](function(_0x1e4a71){logger[_0x826c('0x2c')](_0x826c('0x54'),_0x1e4a71);throw _0x1e4a71;});}return _0x84bb69;})['then'](respondWithResult(_0x1a1f82,0xc9))['catch'](handleError(_0x1a1f82,null));};exports[_0x826c('0x26')]=function(_0x4d4a26,_0x4bf407){if(_0x4d4a26['body']['id']){delete _0x4d4a26[_0x826c('0x4d')]['id'];}return db[_0x826c('0x30')][_0x826c('0x4b')]({'where':{'id':_0x4d4a26[_0x826c('0x49')]['id']}})[_0x826c('0x27')](handleEntityNotFound(_0x4bf407,null))[_0x826c('0x27')](saveUpdates(_0x4d4a26[_0x826c('0x4d')],null))[_0x826c('0x27')](respondWithResult(_0x4bf407,null))[_0x826c('0x47')](handleError(_0x4bf407,null));};exports[_0x826c('0x2b')]=function(_0x1b0998,_0x17fc18){return db[_0x826c('0x30')][_0x826c('0x4b')]({'where':{'id':_0x1b0998[_0x826c('0x49')]['id']}})['then'](handleEntityNotFound(_0x17fc18,null))[_0x826c('0x27')](removeEntity(_0x17fc18,null))['catch'](handleError(_0x17fc18,null));};exports[_0x826c('0x55')]=function(_0x14da02,_0x37efda){var _0xfef486=0xa;var _0x2bf9ad=['join',_0x826c('0x56'),'right_join',_0x826c('0x57')];var _0xb90cb5={'SUM':_0x826c('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x826c('0x59'),'MAX':'MAX(%s)','MIN':_0x826c('0x5a'),'AVG':_0x826c('0x5b'),'GROUP_CONCAT':_0x826c('0x5c'),'GROUP_CONCAT ASC':_0x826c('0x5d'),'GROUP_CONCAT DESC':_0x826c('0x5e')};var _0x138f4a={'SEC_TO_TIME':_0x826c('0x5f'),'DATE':'DATE(%s)','HOUR':_0x826c('0x60'),'ROUND':_0x826c('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x22cd0d=function(_0x8d39f4){return!_[_0x826c('0x62')]([_0x826c('0x63'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x826c('0x64')],_0x8d39f4);};var _0x16e36d=function(_0x3cff87){if(!_0x3cff87||!_0x3cff87[_0x826c('0x65')]['length']){return'';}for(var _0x49766c='(',_0x1a7585=0x0;_0x1a7585<_0x3cff87[_0x826c('0x65')]['length'];_0x1a7585+=0x1){_0x1a7585>0x0&&(_0x49766c+='\x20'+_0x3cff87['operator']+'\x20');_0x49766c+=_0x3cff87[_0x826c('0x65')][_0x1a7585]['group']?_0x16e36d(_0x3cff87['rules'][_0x1a7585][_0x826c('0x66')]):_0x3cff87[_0x826c('0x65')][_0x1a7585]['field']+'\x20'+_0x3cff87['rules'][_0x1a7585][_0x826c('0x67')]+(_0x22cd0d(_0x3cff87[_0x826c('0x65')][_0x1a7585]['condition'])?'\x20'+_0x3cff87[_0x826c('0x65')][_0x1a7585]['value']:'');}return _0x49766c+')';};var _0x47ee39={'where':{'id':_0x14da02[_0x826c('0x49')]['id']}},_0x5e9aff,_0x59f844,_0x393f53,_0x4dab08,_0x3f941a;_0x47ee39=_['merge']({},_0x47ee39,_0x14da02[_0x826c('0x68')]);return db[_0x826c('0x30')][_0x826c('0x4b')](_0x47ee39)['then'](function(_0x1911c8){if(_0x1911c8){_0x5e9aff=_0x1911c8;return _0x1911c8[_0x826c('0x69')]();}return null;})[_0x826c('0x27')](function(_0x105cdc){if(_0x105cdc){if(!_0x105cdc[_0x826c('0x4a')]){throw new db['Sequelize']['ValidationErrorItem'](_0x826c('0x6a'),0x193);}_0x59f844=_0x105cdc;return db[_0x826c('0x6b')][_0x826c('0x6c')]({'raw':!![]});}return null;})[_0x826c('0x27')](function(_0x42c8b0){if(_0x42c8b0){_0x393f53=_['keyBy'](_0x42c8b0,'id');var _0x19fbbe;var _0x3f07b6=squel['select']();_0x3f07b6[_0x826c('0x6d')](_0x5e9aff[_0x826c('0x6e')]);for(var _0x5e0424=0x0;_0x5e0424<_0x59f844[_0x826c('0x4a')];_0x5e0424+=0x1){_0x19fbbe=_0x59f844[_0x5e0424]['MetricId']?_0x393f53[_0x59f844[_0x5e0424][_0x826c('0x6f')]]['metric']:_0x59f844[_0x5e0424][_0x826c('0x70')];_0x19fbbe=_0x59f844[_0x5e0424][_0x826c('0x71')]?_[_0x826c('0x72')](_0xb90cb5[_0x59f844[_0x5e0424][_0x826c('0x71')]],'%s',_0x19fbbe):_0x19fbbe;_0x19fbbe=_0x59f844[_0x5e0424][_0x826c('0x73')]?_[_0x826c('0x72')](_0x138f4a[_0x59f844[_0x5e0424]['format']],'%s',_0x19fbbe):_0x19fbbe;if(_0x59f844[_0x5e0424]['groupBy']){_0x3f07b6[_0x826c('0x66')](_0x19fbbe);}_0x59f844[_0x5e0424][_0x826c('0x74')]&&_0x3f07b6[_0x826c('0x3c')](_0x19fbbe,_0x59f844[_0x5e0424][_0x826c('0x74')]===_0x826c('0x75')?![]:!![]);_0x3f07b6[_0x826c('0x70')](_0x19fbbe,_0x59f844[_0x5e0424][_0x826c('0x76')]||_0x19fbbe);}if(_0x5e9aff[_0x826c('0x77')]){_0x5e9aff[_0x826c('0x77')]=JSON[_0x826c('0x78')](_0x5e9aff['joins']);for(var _0x17cd9b=0x0;_0x17cd9b<_0x5e9aff[_0x826c('0x77')][_0x826c('0x4a')];_0x17cd9b+=0x1){if(_0x5e9aff[_0x826c('0x77')][_0x17cd9b][_0x826c('0x41')]&&_['includes'](_0x2bf9ad,_0x5e9aff[_0x826c('0x77')][_0x17cd9b][_0x826c('0x41')])&&_0x5e9aff[_0x826c('0x77')][_0x17cd9b][_0x826c('0x79')]&&_0x5e9aff[_0x826c('0x77')][_0x17cd9b][_0x826c('0x7a')]&&_0x5e9aff['joins'][_0x17cd9b][_0x826c('0x7b')]){_0x3f07b6[_0x5e9aff[_0x826c('0x77')][_0x17cd9b][_0x826c('0x41')]](_0x5e9aff[_0x826c('0x77')][_0x17cd9b][_0x826c('0x7a')],null,util[_0x826c('0x73')](_0x826c('0x7c'),_0x5e9aff['table'],_0x5e9aff[_0x826c('0x77')][_0x17cd9b][_0x826c('0x79')],_0x5e9aff[_0x826c('0x77')][_0x17cd9b][_0x826c('0x7a')],_0x5e9aff[_0x826c('0x77')][_0x17cd9b][_0x826c('0x7b')]));}}}if(_0x5e9aff[_0x826c('0x7d')]){_0x5e9aff[_0x826c('0x7d')]=JSON[_0x826c('0x78')](_0x5e9aff[_0x826c('0x7d')]);_0x3f07b6['where'](_0x16e36d(_0x5e9aff['conditions'][_0x826c('0x66')]));}_0x3f941a=_0x3f07b6['clone']();_0x3f07b6[_0x826c('0x20')](_0xfef486);_0x3f07b6['offset'](0x0);logger[_0x826c('0x7e')](_0x826c('0x7f'),_0x3f07b6[_0x826c('0x80')]());return dbH[_0x826c('0x81')][_0x826c('0x35')](_0x3f07b6[_0x826c('0x80')](),{'type':dbH[_0x826c('0x81')][_0x826c('0x82')]['SELECT']});}})['then'](respondWithResult(_0x37efda,null))[_0x826c('0x47')](handleError(_0x37efda,null));};function runReport(_0x4e7018,_0x56bd0d,_0x10c2b8){var _0x43f2af=_0x56bd0d[_0x826c('0x2d')];var _0x26d496=0xa;var _0xe32ede=['join','left_join','right_join',_0x826c('0x57')];var _0x3b0364={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x826c('0x59'),'MAX':_0x826c('0x83'),'MIN':_0x826c('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x826c('0x5c'),'GROUP_CONCAT ASC':_0x826c('0x5d'),'GROUP_CONCAT DESC':_0x826c('0x5e')};var _0x315044={'SEC_TO_TIME':_0x826c('0x5f'),'DATE':_0x826c('0x84'),'HOUR':_0x826c('0x60'),'ROUND':_0x826c('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x44b0f3=function(_0x5ccc63){return!_[_0x826c('0x62')]([_0x826c('0x63'),_0x826c('0x85'),_0x826c('0x86'),_0x826c('0x64')],_0x5ccc63);};var _0x33a654=function(_0x34ac3e){if(!_0x34ac3e||!_0x34ac3e[_0x826c('0x65')][_0x826c('0x4a')]){return'';}for(var _0x11210f='(',_0x2cdad5=0x0;_0x2cdad5<_0x34ac3e[_0x826c('0x65')][_0x826c('0x4a')];_0x2cdad5+=0x1){_0x2cdad5>0x0&&(_0x11210f+='\x20'+_0x34ac3e[_0x826c('0x87')]+'\x20');_0x11210f+=_0x34ac3e[_0x826c('0x65')][_0x2cdad5][_0x826c('0x66')]?_0x33a654(_0x34ac3e[_0x826c('0x65')][_0x2cdad5][_0x826c('0x66')]):_0x34ac3e['rules'][_0x2cdad5]['field']+'\x20'+_0x34ac3e[_0x826c('0x65')][_0x2cdad5][_0x826c('0x67')]+(_0x44b0f3(_0x34ac3e[_0x826c('0x65')][_0x2cdad5][_0x826c('0x67')])?'\x20'+_0x34ac3e[_0x826c('0x65')][_0x2cdad5][_0x826c('0x88')]:'');}return _0x11210f+')';};var _0x38bdf2={'where':{'id':_0x4e7018['id']}},_0xed4289,_0x1454e0,_0x4238db,_0x1fd976,_0xef41be;_0x38bdf2=_[_0x826c('0x43')]({},_0x38bdf2,_0x10c2b8);return db[_0x826c('0x30')][_0x826c('0x4b')](_0x38bdf2)['then'](function(_0x4330c3){if(_0x4330c3){_0xed4289=_0x4330c3;return _0x4330c3[_0x826c('0x69')]();}return null;})['then'](function(_0x4085c3){if(_0x4085c3){if(!_0x4085c3['length']){throw new db[(_0x826c('0x89'))][(_0x826c('0x8a'))](_0x826c('0x6a'),0x193);}_0x1454e0=_0x4085c3;return db['AnalyticMetric'][_0x826c('0x6c')]({'raw':!![]});}return null;})[_0x826c('0x27')](function(_0x324d7d){if(_0x324d7d){_0x4238db=_[_0x826c('0x8b')](_0x324d7d,'id');var _0x4f6679;var _0x2b0d7a=squel[_0x826c('0x8c')]();_0x2b0d7a['from'](_0xed4289[_0x826c('0x6e')]);for(var _0x4b83b1=0x0;_0x4b83b1<_0x1454e0[_0x826c('0x4a')];_0x4b83b1+=0x1){_0x4f6679=_0x1454e0[_0x4b83b1]['MetricId']?_0x4238db[_0x1454e0[_0x4b83b1]['MetricId']][_0x826c('0x8d')]:_0x1454e0[_0x4b83b1]['field'];_0x4f6679=_0x1454e0[_0x4b83b1]['function']?_[_0x826c('0x72')](_0x3b0364[_0x1454e0[_0x4b83b1][_0x826c('0x71')]],'%s',_0x4f6679):_0x4f6679;_0x4f6679=_0x1454e0[_0x4b83b1][_0x826c('0x73')]?_[_0x826c('0x72')](_0x315044[_0x1454e0[_0x4b83b1][_0x826c('0x73')]],'%s',_0x4f6679):_0x4f6679;if(_0x1454e0[_0x4b83b1][_0x826c('0x8e')]){_0x2b0d7a['group'](_0x4f6679);}_0x1454e0[_0x4b83b1][_0x826c('0x74')]&&_0x2b0d7a[_0x826c('0x3c')](_0x4f6679,_0x1454e0[_0x4b83b1]['orderBy']===_0x826c('0x75')?![]:!![]);_0x2b0d7a[_0x826c('0x70')](_0x4f6679,_0x1454e0[_0x4b83b1][_0x826c('0x76')]||_0x4f6679);}if(_0xed4289[_0x826c('0x77')]){_0xed4289[_0x826c('0x77')]=JSON['parse'](_0xed4289['joins']);for(var _0x1ab561=0x0;_0x1ab561<_0xed4289[_0x826c('0x77')][_0x826c('0x4a')];_0x1ab561+=0x1){if(_0xed4289[_0x826c('0x77')][_0x1ab561]['type']&&_['includes'](_0xe32ede,_0xed4289[_0x826c('0x77')][_0x1ab561]['type'])&&_0xed4289[_0x826c('0x77')][_0x1ab561][_0x826c('0x79')]&&_0xed4289[_0x826c('0x77')][_0x1ab561][_0x826c('0x7a')]&&_0xed4289[_0x826c('0x77')][_0x1ab561][_0x826c('0x7b')]){_0x2b0d7a[_0xed4289[_0x826c('0x77')][_0x1ab561][_0x826c('0x41')]](_0xed4289[_0x826c('0x77')][_0x1ab561][_0x826c('0x7a')],null,util[_0x826c('0x73')]('%s.%s\x20=\x20%s.%s',_0xed4289['table'],_0xed4289[_0x826c('0x77')][_0x1ab561][_0x826c('0x79')],_0xed4289[_0x826c('0x77')][_0x1ab561][_0x826c('0x7a')],_0xed4289['joins'][_0x1ab561][_0x826c('0x7b')]));}}}if(_0xed4289[_0x826c('0x7d')]){_0xed4289[_0x826c('0x7d')]=JSON[_0x826c('0x78')](_0xed4289[_0x826c('0x7d')]);_0x2b0d7a[_0x826c('0x40')](_0x33a654(_0xed4289[_0x826c('0x7d')][_0x826c('0x66')]));}_0xef41be=_0x2b0d7a[_0x826c('0x8f')]();_0x2b0d7a[_0x826c('0x20')](_0x26d496);_0x2b0d7a['offset'](0x0);return;}})[_0x826c('0x27')](function(){if(_0x56bd0d['output']===_0x826c('0x90')){return null;}var _0x3733f5=_['merge'](_0x56bd0d,{'name':_0x56bd0d[_0x826c('0x91')]||_0x56bd0d[_0x826c('0x2d')]||_0xed4289[_0x826c('0x2d')],'basename':_0x43f2af,'savename':util[_0x826c('0x73')](_0x826c('0x92'),_0x56bd0d[_0x826c('0x2d')]||_0xed4289[_0x826c('0x2d')],require(_0x826c('0x93'))[_0x826c('0x94')](0x4),_0x56bd0d[_0x826c('0x95')]||_0x826c('0x96')),'reportId':_0xed4289['id'],'reportType':_0x826c('0x97')});return db[_0x826c('0x98')][_0x826c('0x4c')](_0x3733f5,{'raw':!![]});})['then'](function(_0x107014){if(_0xed4289[_0x826c('0x6e')]===_0x826c('0x99')){_0xef41be[_0x826c('0x40')](_0xed4289[_0x826c('0x6e')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x56bd0d['startDate'],_0x56bd0d[_0x826c('0x9a')]);}else{_0xef41be['where'](_0xed4289['table']+_0x826c('0x9b'),_0x56bd0d[_0x826c('0x9c')],_0x56bd0d[_0x826c('0x9a')]);}if(_0x107014){logger[_0x826c('0x9d')](_0x826c('0x9e'),_0xef41be[_0x826c('0x80')]());require(_0x826c('0x9f'))['fork'](path[_0x826c('0xa0')](__dirname,_0x826c('0xa1'),_0x107014[_0x826c('0x95')]),[_0x107014['id'],_0xef41be['toString'](),path[_0x826c('0xa0')](__dirname,'../../files/reports',_0x107014['savename']),_0x43f2af]);return _0x107014;}else{var _0x4ade44=squel[_0x826c('0x8c')]();_0x4ade44['from']('('+_0xef41be['toString']()+')',_0x826c('0xa2'));_0x4ade44[_0x826c('0x70')](_0x826c('0xa3'),_0x826c('0x22'));_0xef41be[_0x826c('0x20')](_0x56bd0d[_0x826c('0x20')]||_0x26d496);_0xef41be['offset'](_0x56bd0d[_0x826c('0x21')]||0x0);return dbH['sequelize'][_0x826c('0x35')](_0x4ade44['toString'](),{'type':dbH[_0x826c('0x81')][_0x826c('0x82')][_0x826c('0xa4')]})[_0x826c('0x27')](function(_0xef0dec){if(!_0xef0dec[_0x826c('0x4a')]){_0x1fd976=0x0;}else{_0x1fd976=_0xef0dec[0x0][_0x826c('0x22')]||0x0;}return dbH[_0x826c('0x81')][_0x826c('0x35')](_0xef41be['toString'](),{'type':dbH[_0x826c('0x81')][_0x826c('0x82')][_0x826c('0xa4')]});})[_0x826c('0x27')](function(_0x242123){return{'rows':_0x242123||[],'count':_0x1fd976};});}});}exports[_0x826c('0xa5')]=function(_0x17ab6f,_0x4d733f){return runReport(_0x17ab6f[_0x826c('0x49')],_0x17ab6f[_0x826c('0x35')],_0x17ab6f[_0x826c('0x68')])[_0x826c('0x27')](respondWithResult(_0x4d733f,null))[_0x826c('0x47')](handleError(_0x4d733f,null));};exports[_0x826c('0xa6')]=runReport;exports[_0x826c('0x35')]=function(_0x1c1036,_0x36a876){var _0x43a0e6=0xa;var _0x3131f1=[_0x826c('0xa0'),_0x826c('0x56'),'right_join',_0x826c('0x57')];var _0x2b381d={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x826c('0x59'),'MAX':_0x826c('0x83'),'MIN':'MIN(%s)','AVG':_0x826c('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x826c('0x5d'),'GROUP_CONCAT DESC':_0x826c('0x5e')};var _0x78484f={'SEC_TO_TIME':_0x826c('0x5f'),'DATE':'DATE(%s)','HOUR':_0x826c('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x826c('0xa7')};var _0x4c5b0a=function(_0x1a3c40){return!_['includes'](['IS\x20NULL',_0x826c('0x85'),_0x826c('0x86'),_0x826c('0x64')],_0x1a3c40);};var _0x30e752=function(_0xea9af5){if(!_0xea9af5||!_0xea9af5[_0x826c('0x65')]['length']){return'';}for(var _0x4fffb9='(',_0xfc98fb=0x0;_0xfc98fb<_0xea9af5[_0x826c('0x65')]['length'];_0xfc98fb+=0x1){_0xfc98fb>0x0&&(_0x4fffb9+='\x20'+_0xea9af5[_0x826c('0x87')]+'\x20');_0x4fffb9+=_0xea9af5[_0x826c('0x65')][_0xfc98fb][_0x826c('0x66')]?_0x30e752(_0xea9af5[_0x826c('0x65')][_0xfc98fb]['group']):_0xea9af5['rules'][_0xfc98fb][_0x826c('0x70')]+'\x20'+_0xea9af5[_0x826c('0x65')][_0xfc98fb][_0x826c('0x67')]+(_0x4c5b0a(_0xea9af5[_0x826c('0x65')][_0xfc98fb][_0x826c('0x67')])?'\x20'+_0xea9af5[_0x826c('0x65')][_0xfc98fb][_0x826c('0x88')]:'');}return _0x4fffb9+')';};var _0x35332b={'where':{'id':_0x1c1036[_0x826c('0x49')]['id']}},_0xe66e85,_0x1a667a,_0x43a7cb,_0x4f23ff,_0x249bad;_0x35332b=_[_0x826c('0x43')]({},_0x35332b,_0x1c1036[_0x826c('0x68')]);return db[_0x826c('0x30')][_0x826c('0x4b')](_0x35332b)['then'](function(_0x45cd64){if(_0x45cd64){_0xe66e85=_0x45cd64;return _0x45cd64[_0x826c('0x69')]();}return null;})['then'](function(_0x537b6b){if(_0x537b6b){if(!_0x537b6b[_0x826c('0x4a')]){throw new db[(_0x826c('0x89'))]['ValidationErrorItem'](_0x826c('0x6a'),0x193);}_0x1a667a=_0x537b6b;return db[_0x826c('0x6b')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x117b12){if(_0x117b12){_0x43a7cb=_[_0x826c('0x8b')](_0x117b12,'id');var _0x2d1804;var _0x365967=squel[_0x826c('0x8c')]();_0x365967[_0x826c('0x6d')](_0xe66e85[_0x826c('0x6e')]);for(var _0x81b254=0x0;_0x81b254<_0x1a667a[_0x826c('0x4a')];_0x81b254+=0x1){_0x2d1804=_0x1a667a[_0x81b254][_0x826c('0x6f')]?_0x43a7cb[_0x1a667a[_0x81b254][_0x826c('0x6f')]][_0x826c('0x8d')]:_0x1a667a[_0x81b254][_0x826c('0x70')];_0x2d1804=_0x1a667a[_0x81b254]['function']?_[_0x826c('0x72')](_0x2b381d[_0x1a667a[_0x81b254][_0x826c('0x71')]],'%s',_0x2d1804):_0x2d1804;_0x2d1804=_0x1a667a[_0x81b254][_0x826c('0x73')]?_[_0x826c('0x72')](_0x78484f[_0x1a667a[_0x81b254][_0x826c('0x73')]],'%s',_0x2d1804):_0x2d1804;if(_0x1a667a[_0x81b254][_0x826c('0x8e')]){_0x365967['group'](_0x2d1804);}_0x1a667a[_0x81b254]['orderBy']&&_0x365967[_0x826c('0x3c')](_0x2d1804,_0x1a667a[_0x81b254][_0x826c('0x74')]===_0x826c('0x75')?![]:!![]);_0x365967[_0x826c('0x70')](_0x2d1804,_0x1a667a[_0x81b254][_0x826c('0x76')]||_0x2d1804);}if(_0xe66e85[_0x826c('0x77')]){_0xe66e85[_0x826c('0x77')]=JSON['parse'](_0xe66e85['joins']);for(var _0x2c4887=0x0;_0x2c4887<_0xe66e85[_0x826c('0x77')]['length'];_0x2c4887+=0x1){if(_0xe66e85[_0x826c('0x77')][_0x2c4887]['type']&&_['includes'](_0x3131f1,_0xe66e85[_0x826c('0x77')][_0x2c4887][_0x826c('0x41')])&&_0xe66e85[_0x826c('0x77')][_0x2c4887]['parentKey']&&_0xe66e85[_0x826c('0x77')][_0x2c4887][_0x826c('0x7a')]&&_0xe66e85[_0x826c('0x77')][_0x2c4887][_0x826c('0x7b')]){_0x365967[_0xe66e85[_0x826c('0x77')][_0x2c4887]['type']](_0xe66e85['joins'][_0x2c4887][_0x826c('0x7a')],null,util[_0x826c('0x73')](_0x826c('0x7c'),_0xe66e85[_0x826c('0x6e')],_0xe66e85[_0x826c('0x77')][_0x2c4887][_0x826c('0x79')],_0xe66e85[_0x826c('0x77')][_0x2c4887]['foreignTable'],_0xe66e85['joins'][_0x2c4887][_0x826c('0x7b')]));}}}if(_0xe66e85['conditions']){_0xe66e85['conditions']=JSON[_0x826c('0x78')](_0xe66e85['conditions']);_0x365967[_0x826c('0x40')](_0x30e752(_0xe66e85[_0x826c('0x7d')][_0x826c('0x66')]));}_0x249bad=_0x365967[_0x826c('0x8f')]();_0x365967['limit'](_0x43a0e6);_0x365967['offset'](0x0);logger['debug'](_0x826c('0x7f'),_0x365967[_0x826c('0x80')]());return dbH[_0x826c('0x81')][_0x826c('0x35')](_0x365967[_0x826c('0x80')](),{'type':dbH[_0x826c('0x81')][_0x826c('0x82')][_0x826c('0xa4')]});}})[_0x826c('0x27')](function(){return{'sql':_0x249bad[_0x826c('0x80')]()};})[_0x826c('0x27')](respondWithResult(_0x36a876,null))['catch'](handleError(_0x36a876,null));};
\ No newline at end of file
+var _0x07a6=['COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NULL','IS\x20NOT\x20EMPTY','operator','from','replace','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','run','runReport','metric','debug','Limited\x20Query:','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','CustomReports','UserProfileResource','end','error','stack','name','status','send','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','nolimit','order','sort','filter','where','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','findAll','rows','catch','show','params','keys','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','field','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','toString','sequelize','QueryTypes','SELECT'];(function(_0x70588,_0x2e21dd){var _0x1981d8=function(_0x5bbfb6){while(--_0x5bbfb6){_0x70588['push'](_0x70588['shift']());}};_0x1981d8(++_0x2e21dd);}(_0x07a6,0xbf));var _0x607a=function(_0x166744,_0x1ae2e6){_0x166744=_0x166744-0x0;var _0x4068b5=_0x07a6[_0x166744];return _0x4068b5;};'use strict';var emlformat=require(_0x607a('0x0'));var rimraf=require(_0x607a('0x1'));var zipdir=require(_0x607a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x607a('0x3'));var BPromise=require(_0x607a('0x4'));var Mustache=require(_0x607a('0x5'));var util=require('util');var path=require(_0x607a('0x6'));var sox=require('sox');var csv=require(_0x607a('0x7'));var ejs=require(_0x607a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x607a('0x9'));var squel=require('squel');var crypto=require(_0x607a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x607a('0xb'));var toCsv=require(_0x607a('0x7'));var querystring=require('querystring');var Papa=require(_0x607a('0xc'));var Redis=require(_0x607a('0xd'));var authService=require(_0x607a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x607a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x607a('0x10'))(_0x607a('0x11'));var utils=require(_0x607a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x607a('0x13'));var db=require('../../mysqldb')['db'];var dbH=require(_0x607a('0x14'))[_0x607a('0x15')];function respondWithStatusCode(_0xe8daee,_0x409d7e){_0x409d7e=_0x409d7e||0xcc;return function(_0x3ae30b){if(_0x3ae30b){return _0xe8daee['sendStatus'](_0x409d7e);}return _0xe8daee['status'](_0x409d7e)['end']();};}function respondWithResult(_0x3088c1,_0x191a7d){_0x191a7d=_0x191a7d||0xc8;return function(_0x406d33){if(_0x406d33){return _0x3088c1['status'](_0x191a7d)['json'](_0x406d33);}};}function respondWithFilteredResult(_0x31978b,_0x26568){return function(_0x3aa202){if(_0x3aa202){var _0x385fe6=typeof _0x26568[_0x607a('0x16')]===_0x607a('0x17')&&typeof _0x26568[_0x607a('0x18')]===_0x607a('0x17');var _0x5bf009=_0x3aa202[_0x607a('0x19')];var _0x53f3c6=_0x385fe6?0x0:_0x26568['offset'];var _0x57bca7=_0x385fe6?_0x3aa202[_0x607a('0x19')]:_0x26568[_0x607a('0x16')]+_0x26568[_0x607a('0x18')];var _0x3ce7a9;if(_0x57bca7>=_0x5bf009){_0x57bca7=_0x5bf009;_0x3ce7a9=0xc8;}else{_0x3ce7a9=0xce;}_0x31978b['status'](_0x3ce7a9);return _0x31978b['set'](_0x607a('0x1a'),_0x53f3c6+'-'+_0x57bca7+'/'+_0x5bf009)['json'](_0x3aa202);}return null;};}function patchUpdates(_0x54f4cb){return function(_0xe98d92){try{jsonpatch[_0x607a('0x1b')](_0xe98d92,_0x54f4cb,!![]);}catch(_0x24cf19){return BPromise[_0x607a('0x1c')](_0x24cf19);}return _0xe98d92['save']();};}function saveUpdates(_0x235d71,_0x49f0e2){return function(_0x599098){if(_0x599098){return _0x599098[_0x607a('0x1d')](_0x235d71)[_0x607a('0x1e')](function(_0x14c615){return _0x14c615;});}return null;};}function removeEntity(_0x2f6740,_0xb451f7){return function(_0x13c836){if(_0x13c836){return _0x13c836[_0x607a('0x1f')]()['then'](function(){var _0x1ae8be=_0x13c836[_0x607a('0x20')]({'plain':!![]});var _0xd7e01a=_0x607a('0x21');return db[_0x607a('0x22')][_0x607a('0x1f')]({'where':{'type':_0xd7e01a,'resourceId':_0x1ae8be['id']}})[_0x607a('0x1e')](function(){return _0x13c836;});})['then'](function(){_0x2f6740['status'](0xcc)[_0x607a('0x23')]();});}};}function handleEntityNotFound(_0x6f89db,_0x4db730){return function(_0x28e4ae){if(!_0x28e4ae){_0x6f89db['sendStatus'](0x194);}return _0x28e4ae;};}function handleError(_0x31ae92,_0x460dd0){_0x460dd0=_0x460dd0||0x1f4;return function(_0x323a09){logger[_0x607a('0x24')](_0x323a09[_0x607a('0x25')]);if(_0x323a09[_0x607a('0x26')]){delete _0x323a09[_0x607a('0x26')];}_0x31ae92[_0x607a('0x27')](_0x460dd0)[_0x607a('0x28')](_0x323a09);};}exports['index']=function(_0x3205ec,_0x79df0a){var _0x5b44e0={},_0x5443df={},_0x294b59={'count':0x0,'rows':[]};var _0x5b1be6=_['map'](db['AnalyticCustomReport'][_0x607a('0x29')],function(_0x2d451b){return{'name':_0x2d451b[_0x607a('0x2a')],'type':_0x2d451b[_0x607a('0x2b')][_0x607a('0x2c')]};});_0x5443df[_0x607a('0x2d')]=_[_0x607a('0x2e')](_0x5b1be6,'name');_0x5443df['query']=_['keys'](_0x3205ec[_0x607a('0x2f')]);_0x5443df[_0x607a('0x30')]=_['intersection'](_0x5443df[_0x607a('0x2d')],_0x5443df[_0x607a('0x2f')]);_0x5b44e0[_0x607a('0x31')]=_[_0x607a('0x32')](_0x5443df[_0x607a('0x2d')],qs['fields'](_0x3205ec[_0x607a('0x2f')][_0x607a('0x33')]));_0x5b44e0[_0x607a('0x31')]=_0x5b44e0[_0x607a('0x31')]['length']?_0x5b44e0[_0x607a('0x31')]:_0x5443df[_0x607a('0x2d')];if(!_0x3205ec[_0x607a('0x2f')]['hasOwnProperty'](_0x607a('0x34'))){_0x5b44e0['limit']=qs['limit'](_0x3205ec[_0x607a('0x2f')][_0x607a('0x18')]);_0x5b44e0[_0x607a('0x16')]=qs[_0x607a('0x16')](_0x3205ec[_0x607a('0x2f')][_0x607a('0x16')]);}_0x5b44e0[_0x607a('0x35')]=qs[_0x607a('0x36')](_0x3205ec[_0x607a('0x2f')][_0x607a('0x36')]);_0x5b44e0['where']=qs[_0x607a('0x30')](_['pick'](_0x3205ec[_0x607a('0x2f')],_0x5443df['filters']),_0x5b1be6);if(_0x3205ec[_0x607a('0x2f')][_0x607a('0x37')]){_0x5b44e0[_0x607a('0x38')]=_[_0x607a('0x39')](_0x5b44e0['where'],{'$or':_[_0x607a('0x2e')](_0x5b1be6,function(_0x3913ad){if(_0x3913ad[_0x607a('0x2b')]!==_0x607a('0x3a')){var _0x5ee105={};_0x5ee105[_0x3913ad[_0x607a('0x26')]]={'$like':'%'+_0x3205ec[_0x607a('0x2f')]['filter']+'%'};return _0x5ee105;}})});}_0x5b44e0=_[_0x607a('0x39')]({},_0x5b44e0,_0x3205ec[_0x607a('0x3b')]);var _0x476a39={'where':_0x5b44e0[_0x607a('0x38')]};return db[_0x607a('0x3c')][_0x607a('0x19')](_0x476a39)[_0x607a('0x1e')](function(_0x32a142){_0x294b59[_0x607a('0x19')]=_0x32a142;if(_0x3205ec[_0x607a('0x2f')][_0x607a('0x3d')]){_0x5b44e0['include']=[{'all':!![]}];}return db[_0x607a('0x3c')][_0x607a('0x3e')](_0x5b44e0);})[_0x607a('0x1e')](function(_0x5bfe64){_0x294b59[_0x607a('0x3f')]=_0x5bfe64;return _0x294b59;})[_0x607a('0x1e')](respondWithFilteredResult(_0x79df0a,_0x5b44e0))[_0x607a('0x40')](handleError(_0x79df0a,null));};exports[_0x607a('0x41')]=function(_0xd16f71,_0x335c39){var _0x59372b={'raw':![],'where':{'id':_0xd16f71[_0x607a('0x42')]['id']}},_0x768414={};_0x768414[_0x607a('0x2d')]=_[_0x607a('0x43')](db[_0x607a('0x3c')][_0x607a('0x29')]);_0x768414[_0x607a('0x2f')]=_[_0x607a('0x43')](_0xd16f71['query']);_0x768414[_0x607a('0x30')]=_[_0x607a('0x32')](_0x768414['model'],_0x768414[_0x607a('0x2f')]);_0x59372b[_0x607a('0x31')]=_[_0x607a('0x32')](_0x768414[_0x607a('0x2d')],qs[_0x607a('0x33')](_0xd16f71['query'][_0x607a('0x33')]));_0x59372b[_0x607a('0x31')]=_0x59372b[_0x607a('0x31')][_0x607a('0x44')]?_0x59372b[_0x607a('0x31')]:_0x768414[_0x607a('0x2d')];if(_0xd16f71[_0x607a('0x2f')][_0x607a('0x3d')]){_0x59372b['include']=[{'all':!![]}];}_0x59372b=_[_0x607a('0x39')]({},_0x59372b,_0xd16f71[_0x607a('0x3b')]);return db[_0x607a('0x3c')]['find'](_0x59372b)[_0x607a('0x1e')](handleEntityNotFound(_0x335c39,null))[_0x607a('0x1e')](respondWithResult(_0x335c39,null))[_0x607a('0x40')](handleError(_0x335c39,null));};exports[_0x607a('0x45')]=function(_0x52fe50,_0x31c738){return db[_0x607a('0x3c')][_0x607a('0x45')](_0x52fe50['body'],{})[_0x607a('0x1e')](function(_0x2aa296){var _0x4c323c=_0x52fe50[_0x607a('0x46')]['get']({'plain':!![]});if(!_0x4c323c)throw new Error(_0x607a('0x47'));if(_0x4c323c[_0x607a('0x48')]===_0x607a('0x46')){var _0x67b110=_0x2aa296['get']({'plain':!![]});var _0x33d632=_0x607a('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x33d632,'userProfileId':_0x4c323c['userProfileId']},'raw':!![]})[_0x607a('0x1e')](function(_0x4a2a45){if(_0x4a2a45&&_0x4a2a45[_0x607a('0x4a')]===0x0){return db[_0x607a('0x22')][_0x607a('0x45')]({'name':_0x67b110[_0x607a('0x26')],'resourceId':_0x67b110['id'],'type':_0x607a('0x21'),'sectionId':_0x4a2a45['id']},{})['then'](function(){return _0x2aa296;});}else{return _0x2aa296;}})[_0x607a('0x40')](function(_0x29c9ff){logger[_0x607a('0x24')](_0x607a('0x4b'),_0x29c9ff);throw _0x29c9ff;});}return _0x2aa296;})[_0x607a('0x1e')](respondWithResult(_0x31c738,0xc9))[_0x607a('0x40')](handleError(_0x31c738,null));};exports[_0x607a('0x1d')]=function(_0x522b00,_0x53fce8){if(_0x522b00[_0x607a('0x4c')]['id']){delete _0x522b00[_0x607a('0x4c')]['id'];}return db[_0x607a('0x3c')][_0x607a('0x4d')]({'where':{'id':_0x522b00[_0x607a('0x42')]['id']}})['then'](handleEntityNotFound(_0x53fce8,null))[_0x607a('0x1e')](saveUpdates(_0x522b00[_0x607a('0x4c')],null))['then'](respondWithResult(_0x53fce8,null))[_0x607a('0x40')](handleError(_0x53fce8,null));};exports[_0x607a('0x1f')]=function(_0x203b60,_0x592e67){return db['AnalyticCustomReport'][_0x607a('0x4d')]({'where':{'id':_0x203b60[_0x607a('0x42')]['id']}})[_0x607a('0x1e')](handleEntityNotFound(_0x592e67,null))[_0x607a('0x1e')](removeEntity(_0x592e67,null))[_0x607a('0x40')](handleError(_0x592e67,null));};exports['preview']=function(_0x1b89d4,_0x39aeca){var _0x230129=0xa;var _0x5ed167=[_0x607a('0x4e'),_0x607a('0x4f'),_0x607a('0x50'),_0x607a('0x51')];var _0x1dfb1a={'SUM':_0x607a('0x52'),'COUNT':_0x607a('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x607a('0x54'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x607a('0x55'),'GROUP_CONCAT ASC':_0x607a('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x58af56={'SEC_TO_TIME':_0x607a('0x57'),'DATE':_0x607a('0x58'),'HOUR':_0x607a('0x59'),'ROUND':_0x607a('0x5a'),'UNIX_TIMESTAMP':_0x607a('0x5b')};var _0x3f5abd=function(_0x1a0175){return!_[_0x607a('0x5c')](['IS\x20NULL',_0x607a('0x5d'),_0x607a('0x5e'),'IS\x20NOT\x20EMPTY'],_0x1a0175);};var _0x2c3059=function(_0x196bf4){if(!_0x196bf4||!_0x196bf4[_0x607a('0x5f')][_0x607a('0x44')]){return'';}for(var _0x166a6e='(',_0xc3ee9e=0x0;_0xc3ee9e<_0x196bf4[_0x607a('0x5f')]['length'];_0xc3ee9e+=0x1){_0xc3ee9e>0x0&&(_0x166a6e+='\x20'+_0x196bf4['operator']+'\x20');_0x166a6e+=_0x196bf4[_0x607a('0x5f')][_0xc3ee9e][_0x607a('0x60')]?_0x2c3059(_0x196bf4[_0x607a('0x5f')][_0xc3ee9e]['group']):_0x196bf4['rules'][_0xc3ee9e]['field']+'\x20'+_0x196bf4[_0x607a('0x5f')][_0xc3ee9e][_0x607a('0x61')]+(_0x3f5abd(_0x196bf4[_0x607a('0x5f')][_0xc3ee9e]['condition'])?'\x20'+_0x196bf4[_0x607a('0x5f')][_0xc3ee9e][_0x607a('0x62')]:'');}return _0x166a6e+')';};var _0x1ec950={'where':{'id':_0x1b89d4[_0x607a('0x42')]['id']}},_0x2f7eef,_0x2cc1cc,_0x477976,_0x19c37b,_0x57ff76;_0x1ec950=_['merge']({},_0x1ec950,_0x1b89d4['options']);return db['AnalyticCustomReport'][_0x607a('0x4d')](_0x1ec950)[_0x607a('0x1e')](function(_0x3ed285){if(_0x3ed285){_0x2f7eef=_0x3ed285;return _0x3ed285[_0x607a('0x63')]();}return null;})[_0x607a('0x1e')](function(_0x372a18){if(_0x372a18){if(!_0x372a18[_0x607a('0x44')]){throw new db[(_0x607a('0x64'))][(_0x607a('0x65'))](_0x607a('0x66'),0x193);}_0x2cc1cc=_0x372a18;return db[_0x607a('0x67')][_0x607a('0x3e')]({'raw':!![]});}return null;})[_0x607a('0x1e')](function(_0x29b770){if(_0x29b770){_0x477976=_[_0x607a('0x68')](_0x29b770,'id');var _0x186622;var _0x236b95=squel[_0x607a('0x69')]();_0x236b95['from'](_0x2f7eef[_0x607a('0x6a')]);for(var _0x42867f=0x0;_0x42867f<_0x2cc1cc[_0x607a('0x44')];_0x42867f+=0x1){_0x186622=_0x2cc1cc[_0x42867f]['MetricId']?_0x477976[_0x2cc1cc[_0x42867f][_0x607a('0x6b')]]['metric']:_0x2cc1cc[_0x42867f][_0x607a('0x6c')];_0x186622=_0x2cc1cc[_0x42867f][_0x607a('0x6d')]?_['replace'](_0x1dfb1a[_0x2cc1cc[_0x42867f][_0x607a('0x6d')]],'%s',_0x186622):_0x186622;_0x186622=_0x2cc1cc[_0x42867f][_0x607a('0x6e')]?_['replace'](_0x58af56[_0x2cc1cc[_0x42867f][_0x607a('0x6e')]],'%s',_0x186622):_0x186622;if(_0x2cc1cc[_0x42867f][_0x607a('0x6f')]){_0x236b95['group'](_0x186622);}_0x2cc1cc[_0x42867f][_0x607a('0x70')]&&_0x236b95[_0x607a('0x35')](_0x186622,_0x2cc1cc[_0x42867f][_0x607a('0x70')]===_0x607a('0x71')?![]:!![]);_0x236b95[_0x607a('0x6c')](_0x186622,_0x2cc1cc[_0x42867f][_0x607a('0x72')]||_0x186622);}if(_0x2f7eef[_0x607a('0x73')]){_0x2f7eef[_0x607a('0x73')]=JSON[_0x607a('0x74')](_0x2f7eef[_0x607a('0x73')]);for(var _0x38d8e7=0x0;_0x38d8e7<_0x2f7eef[_0x607a('0x73')][_0x607a('0x44')];_0x38d8e7+=0x1){if(_0x2f7eef[_0x607a('0x73')][_0x38d8e7][_0x607a('0x2b')]&&_['includes'](_0x5ed167,_0x2f7eef[_0x607a('0x73')][_0x38d8e7][_0x607a('0x2b')])&&_0x2f7eef[_0x607a('0x73')][_0x38d8e7][_0x607a('0x75')]&&_0x2f7eef['joins'][_0x38d8e7][_0x607a('0x76')]&&_0x2f7eef[_0x607a('0x73')][_0x38d8e7]['foreignKey']){_0x236b95[_0x2f7eef[_0x607a('0x73')][_0x38d8e7][_0x607a('0x2b')]](_0x2f7eef[_0x607a('0x73')][_0x38d8e7][_0x607a('0x76')],null,util[_0x607a('0x6e')](_0x607a('0x77'),_0x2f7eef[_0x607a('0x6a')],_0x2f7eef['joins'][_0x38d8e7][_0x607a('0x75')],_0x2f7eef[_0x607a('0x73')][_0x38d8e7][_0x607a('0x76')],_0x2f7eef['joins'][_0x38d8e7][_0x607a('0x78')]));}}}if(_0x2f7eef[_0x607a('0x79')]){_0x2f7eef['conditions']=JSON[_0x607a('0x74')](_0x2f7eef[_0x607a('0x79')]);_0x236b95[_0x607a('0x38')](_0x2c3059(_0x2f7eef['conditions'][_0x607a('0x60')]));}_0x57ff76=_0x236b95[_0x607a('0x7a')]();_0x236b95[_0x607a('0x18')](_0x230129);_0x236b95[_0x607a('0x16')](0x0);logger['debug']('Limited\x20Query:',_0x236b95[_0x607a('0x7b')]());return dbH[_0x607a('0x7c')][_0x607a('0x2f')](_0x236b95[_0x607a('0x7b')](),{'type':dbH[_0x607a('0x7c')][_0x607a('0x7d')][_0x607a('0x7e')]});}})['then'](respondWithResult(_0x39aeca,null))['catch'](handleError(_0x39aeca,null));};function runReport(_0x29eec4,_0x4330be,_0x212a82){var _0x521c67=_0x4330be[_0x607a('0x26')];var _0x453ecd=0xa;var _0x42311b=[_0x607a('0x4e'),_0x607a('0x4f'),_0x607a('0x50'),'cross_join'];var _0x3b42c1={'SUM':_0x607a('0x52'),'COUNT':_0x607a('0x53'),'COUNT DISTINCT':_0x607a('0x7f'),'MAX':_0x607a('0x54'),'MIN':_0x607a('0x80'),'AVG':_0x607a('0x81'),'GROUP_CONCAT':_0x607a('0x55'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x607a('0x82')};var _0x1ba53b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x607a('0x58'),'HOUR':_0x607a('0x59'),'ROUND':_0x607a('0x5a'),'UNIX_TIMESTAMP':_0x607a('0x5b')};var _0x74df18=function(_0x2fb8ec){return!_['includes']([_0x607a('0x83'),_0x607a('0x5d'),'IS\x20EMPTY',_0x607a('0x84')],_0x2fb8ec);};var _0xea3934=function(_0x4e1d8b){if(!_0x4e1d8b||!_0x4e1d8b[_0x607a('0x5f')][_0x607a('0x44')]){return'';}for(var _0x30db35='(',_0x13c2c2=0x0;_0x13c2c2<_0x4e1d8b[_0x607a('0x5f')][_0x607a('0x44')];_0x13c2c2+=0x1){_0x13c2c2>0x0&&(_0x30db35+='\x20'+_0x4e1d8b[_0x607a('0x85')]+'\x20');_0x30db35+=_0x4e1d8b[_0x607a('0x5f')][_0x13c2c2]['group']?_0xea3934(_0x4e1d8b[_0x607a('0x5f')][_0x13c2c2][_0x607a('0x60')]):_0x4e1d8b[_0x607a('0x5f')][_0x13c2c2]['field']+'\x20'+_0x4e1d8b[_0x607a('0x5f')][_0x13c2c2][_0x607a('0x61')]+(_0x74df18(_0x4e1d8b[_0x607a('0x5f')][_0x13c2c2][_0x607a('0x61')])?'\x20'+_0x4e1d8b[_0x607a('0x5f')][_0x13c2c2][_0x607a('0x62')]:'');}return _0x30db35+')';};var _0x3230af={'where':{'id':_0x29eec4['id']}},_0x3b3f10,_0x44a33b,_0x48f643,_0x4cc3d8,_0x415f27;_0x3230af=_['merge']({},_0x3230af,_0x212a82);return db[_0x607a('0x3c')]['find'](_0x3230af)[_0x607a('0x1e')](function(_0x466e40){if(_0x466e40){_0x3b3f10=_0x466e40;return _0x466e40['getFields']();}return null;})[_0x607a('0x1e')](function(_0x57cf98){if(_0x57cf98){if(!_0x57cf98[_0x607a('0x44')]){throw new db[(_0x607a('0x64'))][(_0x607a('0x65'))](_0x607a('0x66'),0x193);}_0x44a33b=_0x57cf98;return db[_0x607a('0x67')][_0x607a('0x3e')]({'raw':!![]});}return null;})['then'](function(_0x14b589){if(_0x14b589){_0x48f643=_[_0x607a('0x68')](_0x14b589,'id');var _0x22d410;var _0x1f9b66=squel['select']();_0x1f9b66[_0x607a('0x86')](_0x3b3f10['table']);for(var _0x3a0250=0x0;_0x3a0250<_0x44a33b[_0x607a('0x44')];_0x3a0250+=0x1){_0x22d410=_0x44a33b[_0x3a0250][_0x607a('0x6b')]?_0x48f643[_0x44a33b[_0x3a0250][_0x607a('0x6b')]]['metric']:_0x44a33b[_0x3a0250][_0x607a('0x6c')];_0x22d410=_0x44a33b[_0x3a0250][_0x607a('0x6d')]?_['replace'](_0x3b42c1[_0x44a33b[_0x3a0250]['function']],'%s',_0x22d410):_0x22d410;_0x22d410=_0x44a33b[_0x3a0250][_0x607a('0x6e')]?_[_0x607a('0x87')](_0x1ba53b[_0x44a33b[_0x3a0250]['format']],'%s',_0x22d410):_0x22d410;if(_0x44a33b[_0x3a0250][_0x607a('0x6f')]){_0x1f9b66['group'](_0x22d410);}_0x44a33b[_0x3a0250][_0x607a('0x70')]&&_0x1f9b66[_0x607a('0x35')](_0x22d410,_0x44a33b[_0x3a0250][_0x607a('0x70')]===_0x607a('0x71')?![]:!![]);_0x1f9b66['field'](_0x22d410,_0x44a33b[_0x3a0250][_0x607a('0x72')]||_0x22d410);}if(_0x3b3f10[_0x607a('0x73')]){_0x3b3f10[_0x607a('0x73')]=JSON['parse'](_0x3b3f10[_0x607a('0x73')]);for(var _0x2aa28c=0x0;_0x2aa28c<_0x3b3f10[_0x607a('0x73')][_0x607a('0x44')];_0x2aa28c+=0x1){if(_0x3b3f10[_0x607a('0x73')][_0x2aa28c]['type']&&_[_0x607a('0x5c')](_0x42311b,_0x3b3f10[_0x607a('0x73')][_0x2aa28c][_0x607a('0x2b')])&&_0x3b3f10[_0x607a('0x73')][_0x2aa28c][_0x607a('0x75')]&&_0x3b3f10['joins'][_0x2aa28c]['foreignTable']&&_0x3b3f10[_0x607a('0x73')][_0x2aa28c][_0x607a('0x78')]){_0x1f9b66[_0x3b3f10[_0x607a('0x73')][_0x2aa28c]['type']](_0x3b3f10['joins'][_0x2aa28c][_0x607a('0x76')],null,util[_0x607a('0x6e')](_0x607a('0x77'),_0x3b3f10[_0x607a('0x6a')],_0x3b3f10[_0x607a('0x73')][_0x2aa28c][_0x607a('0x75')],_0x3b3f10[_0x607a('0x73')][_0x2aa28c][_0x607a('0x76')],_0x3b3f10['joins'][_0x2aa28c][_0x607a('0x78')]));}}}if(_0x3b3f10[_0x607a('0x79')]){_0x3b3f10[_0x607a('0x79')]=JSON[_0x607a('0x74')](_0x3b3f10[_0x607a('0x79')]);_0x1f9b66[_0x607a('0x38')](_0xea3934(_0x3b3f10[_0x607a('0x79')][_0x607a('0x60')]));}_0x415f27=_0x1f9b66[_0x607a('0x7a')]();_0x1f9b66[_0x607a('0x18')](_0x453ecd);_0x1f9b66[_0x607a('0x16')](0x0);return;}})['then'](function(){if(_0x4330be[_0x607a('0x88')]===_0x607a('0x89')){return null;}var _0x41219a=_[_0x607a('0x39')](_0x4330be,{'name':_0x4330be[_0x607a('0x8a')]||_0x4330be[_0x607a('0x26')]||_0x3b3f10[_0x607a('0x26')],'basename':_0x521c67,'savename':util[_0x607a('0x6e')](_0x607a('0x8b'),_0x4330be[_0x607a('0x26')]||_0x3b3f10[_0x607a('0x26')],require('randomstring')[_0x607a('0x8c')](0x4),_0x4330be['output']||_0x607a('0x8d')),'reportId':_0x3b3f10['id'],'reportType':_0x607a('0x8e')});return db[_0x607a('0x8f')][_0x607a('0x45')](_0x41219a,{'raw':!![]});})['then'](function(_0x44500a){if(_0x3b3f10[_0x607a('0x6a')]===_0x607a('0x90')){_0x415f27[_0x607a('0x38')](_0x3b3f10[_0x607a('0x6a')]+_0x607a('0x91'),_0x4330be['startDate'],_0x4330be['endDate']);}else{_0x415f27['where'](_0x3b3f10[_0x607a('0x6a')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4330be[_0x607a('0x92')],_0x4330be[_0x607a('0x93')]);}if(_0x44500a){logger[_0x607a('0x94')](_0x607a('0x95'),_0x415f27[_0x607a('0x7b')]());require(_0x607a('0x96'))[_0x607a('0x97')](path[_0x607a('0x4e')](__dirname,_0x607a('0x98'),_0x44500a[_0x607a('0x88')]),[_0x44500a['id'],_0x415f27[_0x607a('0x7b')](),path['join'](__dirname,'../../files/reports',_0x44500a[_0x607a('0x99')]),_0x521c67]);return _0x44500a;}else{var _0x261b01=squel[_0x607a('0x69')]();_0x261b01[_0x607a('0x86')]('('+_0x415f27[_0x607a('0x7b')]()+')','countTable');_0x261b01['field']('COUNT(*)',_0x607a('0x19'));_0x415f27[_0x607a('0x18')](_0x4330be[_0x607a('0x18')]||_0x453ecd);_0x415f27[_0x607a('0x16')](_0x4330be[_0x607a('0x16')]||0x0);return dbH['sequelize'][_0x607a('0x2f')](_0x261b01['toString'](),{'type':dbH[_0x607a('0x7c')][_0x607a('0x7d')][_0x607a('0x7e')]})['then'](function(_0x2aa024){if(!_0x2aa024[_0x607a('0x44')]){_0x4cc3d8=0x0;}else{_0x4cc3d8=_0x2aa024[0x0][_0x607a('0x19')]||0x0;}return dbH['sequelize'][_0x607a('0x2f')](_0x415f27[_0x607a('0x7b')](),{'type':dbH['sequelize']['QueryTypes'][_0x607a('0x7e')]});})[_0x607a('0x1e')](function(_0x58f779){return{'rows':_0x58f779||[],'count':_0x4cc3d8};});}});}exports[_0x607a('0x9a')]=function(_0x40a92c,_0x2e4cc5){return runReport(_0x40a92c[_0x607a('0x42')],_0x40a92c[_0x607a('0x2f')],_0x40a92c[_0x607a('0x3b')])[_0x607a('0x1e')](respondWithResult(_0x2e4cc5,null))[_0x607a('0x40')](handleError(_0x2e4cc5,null));};exports[_0x607a('0x9b')]=runReport;exports[_0x607a('0x2f')]=function(_0x39e9ca,_0x547f9e){var _0x572b2c=0xa;var _0x2d1e13=[_0x607a('0x4e'),_0x607a('0x4f'),_0x607a('0x50'),_0x607a('0x51')];var _0x47f64e={'SUM':_0x607a('0x52'),'COUNT':_0x607a('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x607a('0x54'),'MIN':_0x607a('0x80'),'AVG':_0x607a('0x81'),'GROUP_CONCAT':_0x607a('0x55'),'GROUP_CONCAT ASC':_0x607a('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1779af={'SEC_TO_TIME':_0x607a('0x57'),'DATE':_0x607a('0x58'),'HOUR':'HOUR(%s)','ROUND':_0x607a('0x5a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x58c2d3=function(_0x3e6037){return!_[_0x607a('0x5c')]([_0x607a('0x83'),_0x607a('0x5d'),_0x607a('0x5e'),_0x607a('0x84')],_0x3e6037);};var _0x422d45=function(_0x4ba40b){if(!_0x4ba40b||!_0x4ba40b[_0x607a('0x5f')][_0x607a('0x44')]){return'';}for(var _0x2fe19f='(',_0x4fd4fc=0x0;_0x4fd4fc<_0x4ba40b[_0x607a('0x5f')]['length'];_0x4fd4fc+=0x1){_0x4fd4fc>0x0&&(_0x2fe19f+='\x20'+_0x4ba40b[_0x607a('0x85')]+'\x20');_0x2fe19f+=_0x4ba40b['rules'][_0x4fd4fc]['group']?_0x422d45(_0x4ba40b[_0x607a('0x5f')][_0x4fd4fc]['group']):_0x4ba40b['rules'][_0x4fd4fc][_0x607a('0x6c')]+'\x20'+_0x4ba40b['rules'][_0x4fd4fc][_0x607a('0x61')]+(_0x58c2d3(_0x4ba40b[_0x607a('0x5f')][_0x4fd4fc][_0x607a('0x61')])?'\x20'+_0x4ba40b[_0x607a('0x5f')][_0x4fd4fc][_0x607a('0x62')]:'');}return _0x2fe19f+')';};var _0x47a8e2={'where':{'id':_0x39e9ca[_0x607a('0x42')]['id']}},_0x1c6ac9,_0x3047a1,_0x5a802b,_0x25284d,_0x2a4d3c;_0x47a8e2=_[_0x607a('0x39')]({},_0x47a8e2,_0x39e9ca[_0x607a('0x3b')]);return db[_0x607a('0x3c')][_0x607a('0x4d')](_0x47a8e2)['then'](function(_0x3b9de7){if(_0x3b9de7){_0x1c6ac9=_0x3b9de7;return _0x3b9de7[_0x607a('0x63')]();}return null;})[_0x607a('0x1e')](function(_0x439382){if(_0x439382){if(!_0x439382[_0x607a('0x44')]){throw new db['Sequelize'][(_0x607a('0x65'))](_0x607a('0x66'),0x193);}_0x3047a1=_0x439382;return db[_0x607a('0x67')][_0x607a('0x3e')]({'raw':!![]});}return null;})[_0x607a('0x1e')](function(_0x449f12){if(_0x449f12){_0x5a802b=_['keyBy'](_0x449f12,'id');var _0x15ff5c;var _0x14609b=squel[_0x607a('0x69')]();_0x14609b[_0x607a('0x86')](_0x1c6ac9[_0x607a('0x6a')]);for(var _0x522920=0x0;_0x522920<_0x3047a1[_0x607a('0x44')];_0x522920+=0x1){_0x15ff5c=_0x3047a1[_0x522920]['MetricId']?_0x5a802b[_0x3047a1[_0x522920][_0x607a('0x6b')]][_0x607a('0x9c')]:_0x3047a1[_0x522920][_0x607a('0x6c')];_0x15ff5c=_0x3047a1[_0x522920]['function']?_[_0x607a('0x87')](_0x47f64e[_0x3047a1[_0x522920]['function']],'%s',_0x15ff5c):_0x15ff5c;_0x15ff5c=_0x3047a1[_0x522920][_0x607a('0x6e')]?_[_0x607a('0x87')](_0x1779af[_0x3047a1[_0x522920][_0x607a('0x6e')]],'%s',_0x15ff5c):_0x15ff5c;if(_0x3047a1[_0x522920][_0x607a('0x6f')]){_0x14609b[_0x607a('0x60')](_0x15ff5c);}_0x3047a1[_0x522920]['orderBy']&&_0x14609b['order'](_0x15ff5c,_0x3047a1[_0x522920][_0x607a('0x70')]===_0x607a('0x71')?![]:!![]);_0x14609b[_0x607a('0x6c')](_0x15ff5c,_0x3047a1[_0x522920][_0x607a('0x72')]||_0x15ff5c);}if(_0x1c6ac9[_0x607a('0x73')]){_0x1c6ac9[_0x607a('0x73')]=JSON['parse'](_0x1c6ac9[_0x607a('0x73')]);for(var _0x1e51e4=0x0;_0x1e51e4<_0x1c6ac9[_0x607a('0x73')][_0x607a('0x44')];_0x1e51e4+=0x1){if(_0x1c6ac9[_0x607a('0x73')][_0x1e51e4]['type']&&_[_0x607a('0x5c')](_0x2d1e13,_0x1c6ac9['joins'][_0x1e51e4][_0x607a('0x2b')])&&_0x1c6ac9[_0x607a('0x73')][_0x1e51e4][_0x607a('0x75')]&&_0x1c6ac9['joins'][_0x1e51e4][_0x607a('0x76')]&&_0x1c6ac9[_0x607a('0x73')][_0x1e51e4][_0x607a('0x78')]){_0x14609b[_0x1c6ac9['joins'][_0x1e51e4]['type']](_0x1c6ac9[_0x607a('0x73')][_0x1e51e4][_0x607a('0x76')],null,util[_0x607a('0x6e')]('%s.%s\x20=\x20%s.%s',_0x1c6ac9[_0x607a('0x6a')],_0x1c6ac9['joins'][_0x1e51e4][_0x607a('0x75')],_0x1c6ac9[_0x607a('0x73')][_0x1e51e4][_0x607a('0x76')],_0x1c6ac9[_0x607a('0x73')][_0x1e51e4]['foreignKey']));}}}if(_0x1c6ac9[_0x607a('0x79')]){_0x1c6ac9[_0x607a('0x79')]=JSON['parse'](_0x1c6ac9[_0x607a('0x79')]);_0x14609b[_0x607a('0x38')](_0x422d45(_0x1c6ac9['conditions']['group']));}_0x2a4d3c=_0x14609b['clone']();_0x14609b['limit'](_0x572b2c);_0x14609b[_0x607a('0x16')](0x0);logger[_0x607a('0x9d')](_0x607a('0x9e'),_0x14609b['toString']());return dbH[_0x607a('0x7c')][_0x607a('0x2f')](_0x14609b[_0x607a('0x7b')](),{'type':dbH[_0x607a('0x7c')][_0x607a('0x7d')][_0x607a('0x7e')]});}})[_0x607a('0x1e')](function(){return{'sql':_0x2a4d3c[_0x607a('0x7b')]()};})[_0x607a('0x1e')](respondWithResult(_0x547f9e,null))[_0x607a('0x40')](handleError(_0x547f9e,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 0aa7258..1bd4bff 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 _0x0e74=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x4cc1c3,_0x425835){var _0x45943c=function(_0x523ee6){while(--_0x523ee6){_0x4cc1c3['push'](_0x4cc1c3['shift']());}};_0x45943c(++_0x425835);}(_0x0e74,0x8c));var _0x40e7=function(_0x282155,_0x1b1b0a){_0x282155=_0x282155-0x0;var _0x2e8147=_0x0e74[_0x282155];return _0x2e8147;};'use strict';var _=require(_0x40e7('0x0'));var util=require(_0x40e7('0x1'));var logger=require(_0x40e7('0x2'))(_0x40e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x40e7('0x4'));var fs=require('fs');var path=require(_0x40e7('0x5'));var rimraf=require(_0x40e7('0x6'));var config=require(_0x40e7('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x40e7('0x8')]=function(_0xe35ac5,_0x1d7b95){return _0xe35ac5[_0x40e7('0x9')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc2d9=['./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x22ac93,_0x508cb0){var _0x3454e2=function(_0x5acf55){while(--_0x5acf55){_0x22ac93['push'](_0x22ac93['shift']());}};_0x3454e2(++_0x508cb0);}(_0xc2d9,0xc9));var _0x9c2d=function(_0x390dd5,_0x3289fd){_0x390dd5=_0x390dd5-0x0;var _0x1d6241=_0xc2d9[_0x390dd5];return _0x1d6241;};'use strict';var _=require(_0x9c2d('0x0'));var util=require('util');var logger=require(_0x9c2d('0x1'))(_0x9c2d('0x2'));var moment=require(_0x9c2d('0x3'));var BPromise=require(_0x9c2d('0x4'));var rp=require(_0x9c2d('0x5'));var fs=require('fs');var path=require(_0x9c2d('0x6'));var rimraf=require(_0x9c2d('0x7'));var config=require(_0x9c2d('0x8'));var attributes=require(_0x9c2d('0x9'));module[_0x9c2d('0xa')]=function(_0x645f59,_0x324b5e){return _0x645f59[_0x9c2d('0xb')](_0x9c2d('0xc'),attributes,{'tableName':_0x9c2d('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 36b2a9f..4444c97 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 _0x3db0=['code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','info','request\x20sent','stringify','error'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x3db0,0x77));var _0x03db=function(_0xa4c85,_0x2b52a7){_0xa4c85=_0xa4c85-0x0;var _0x172c1f=_0x3db0[_0xa4c85];return _0x172c1f;};'use strict';var _=require('lodash');var util=require(_0x03db('0x0'));var moment=require(_0x03db('0x1'));var BPromise=require(_0x03db('0x2'));var rs=require(_0x03db('0x3'));var fs=require('fs');var Redis=require(_0x03db('0x4'));var db=require(_0x03db('0x5'))['db'];var utils=require(_0x03db('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x03db('0x7'));var jayson=require(_0x03db('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4aeab0,_0x4efb56,_0x484301){return new BPromise(function(_0x3409e3,_0x16281a){return client[_0x03db('0x9')](_0x4aeab0,_0x484301)['then'](function(_0x355b0f){logger[_0x03db('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4efb56,_0x03db('0xb'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x4efb56,_0x03db('0xb'),JSON[_0x03db('0xc')](_0x355b0f));if(_0x355b0f['error']){if(_0x355b0f[_0x03db('0xd')][_0x03db('0xe')]===0x1f4){logger[_0x03db('0xd')](_0x03db('0xf'),_0x4efb56,_0x355b0f[_0x03db('0xd')]['message']);return _0x16281a(_0x355b0f[_0x03db('0xd')][_0x03db('0x10')]);}logger[_0x03db('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4efb56,_0x355b0f['error'][_0x03db('0x10')]);return _0x3409e3(_0x355b0f['error'][_0x03db('0x10')]);}else{logger['info'](_0x03db('0xf'),_0x4efb56,'request\x20sent');_0x3409e3(_0x355b0f[_0x03db('0x11')]['message']);}})[_0x03db('0x12')](function(_0x5982d8){logger['error'](_0x03db('0xf'),_0x4efb56,_0x5982d8);_0x16281a(_0x5982d8);});});}
\ No newline at end of file
+var _0xd33b=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x54650c,_0xf51041){var _0x3cf7a3=function(_0x1fa00b){while(--_0x1fa00b){_0x54650c['push'](_0x54650c['shift']());}};_0x3cf7a3(++_0xf51041);}(_0xd33b,0x74));var _0xbd33=function(_0x3a99a4,_0x2c70d){_0x3a99a4=_0x3a99a4-0x0;var _0x1b3c84=_0xd33b[_0x3a99a4];return _0x1b3c84;};'use strict';var _=require(_0xbd33('0x0'));var util=require(_0xbd33('0x1'));var moment=require('moment');var BPromise=require(_0xbd33('0x2'));var rs=require(_0xbd33('0x3'));var fs=require('fs');var Redis=require(_0xbd33('0x4'));var db=require(_0xbd33('0x5'))['db'];var utils=require(_0xbd33('0x6'));var logger=require(_0xbd33('0x7'))(_0xbd33('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd33('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x118217,_0x3eb162,_0x373731){return new BPromise(function(_0x183ef0,_0x594d5b){return client[_0xbd33('0xa')](_0x118217,_0x373731)[_0xbd33('0xb')](function(_0x16e65f){logger[_0xbd33('0xc')](_0xbd33('0xd'),_0x3eb162,'request\x20sent');logger[_0xbd33('0xe')](_0xbd33('0xf'),_0x3eb162,_0xbd33('0x10'),JSON[_0xbd33('0x11')](_0x16e65f));if(_0x16e65f[_0xbd33('0x12')]){if(_0x16e65f[_0xbd33('0x12')][_0xbd33('0x13')]===0x1f4){logger[_0xbd33('0x12')](_0xbd33('0xd'),_0x3eb162,_0x16e65f[_0xbd33('0x12')][_0xbd33('0x14')]);return _0x594d5b(_0x16e65f[_0xbd33('0x12')][_0xbd33('0x14')]);}logger[_0xbd33('0x12')](_0xbd33('0xd'),_0x3eb162,_0x16e65f[_0xbd33('0x12')]['message']);return _0x183ef0(_0x16e65f[_0xbd33('0x12')][_0xbd33('0x14')]);}else{logger['info'](_0xbd33('0xd'),_0x3eb162,'request\x20sent');_0x183ef0(_0x16e65f[_0xbd33('0x15')][_0xbd33('0x14')]);}})[_0xbd33('0x16')](function(_0x2b026b){logger[_0xbd33('0x12')](_0xbd33('0xd'),_0x3eb162,_0x2b026b);_0x594d5b(_0x2b026b);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 3db3104..57ed0cb 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 _0x1ca5=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query'];(function(_0x13ff53,_0x5e1424){var _0x290228=function(_0x3e3133){while(--_0x3e3133){_0x13ff53['push'](_0x13ff53['shift']());}};_0x290228(++_0x5e1424);}(_0x1ca5,0xec));var _0x51ca=function(_0x213721,_0xc41653){_0x213721=_0x213721-0x0;var _0x6435ee=_0x1ca5[_0x213721];return _0x6435ee;};'use strict';var multer=require(_0x51ca('0x0'));var util=require(_0x51ca('0x1'));var path=require(_0x51ca('0x2'));var timeout=require(_0x51ca('0x3'));var express=require('express');var router=express[_0x51ca('0x4')]();var fs_extra=require(_0x51ca('0x5'));var auth=require(_0x51ca('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x51ca('0x7'));router[_0x51ca('0x8')]('/',auth[_0x51ca('0x9')](),controller[_0x51ca('0xa')]);router[_0x51ca('0x8')](_0x51ca('0xb'),auth['isAuthenticated'](),controller[_0x51ca('0xc')]);router[_0x51ca('0x8')](_0x51ca('0xd'),auth['isAuthenticated'](),controller[_0x51ca('0xe')]);router['get']('/:id/run',auth[_0x51ca('0x9')](),controller[_0x51ca('0xf')]);router[_0x51ca('0x8')](_0x51ca('0x10'),auth['isAuthenticated'](),controller['query']);router['post']('/',auth['isAuthenticated'](),controller[_0x51ca('0x11')]);router[_0x51ca('0x12')](_0x51ca('0xb'),auth[_0x51ca('0x9')](),controller[_0x51ca('0x13')]);router[_0x51ca('0x14')](_0x51ca('0xb'),auth['isAuthenticated'](),controller[_0x51ca('0x15')]);module[_0x51ca('0x16')]=router;
\ No newline at end of file
+var _0x926b=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','/:id/query','query','post'];(function(_0x1e71b1,_0x59d4d3){var _0x49d61f=function(_0x37db02){while(--_0x37db02){_0x1e71b1['push'](_0x1e71b1['shift']());}};_0x49d61f(++_0x59d4d3);}(_0x926b,0x18b));var _0xb926=function(_0x5d8bf1,_0x1ce7ea){_0x5d8bf1=_0x5d8bf1-0x0;var _0x378510=_0x926b[_0x5d8bf1];return _0x378510;};'use strict';var multer=require(_0xb926('0x0'));var util=require(_0xb926('0x1'));var path=require(_0xb926('0x2'));var timeout=require(_0xb926('0x3'));var express=require(_0xb926('0x4'));var router=express[_0xb926('0x5')]();var fs_extra=require(_0xb926('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb926('0x7'));var controller=require('./analyticCustomReport.controller');router[_0xb926('0x8')]('/',auth[_0xb926('0x9')](),controller[_0xb926('0xa')]);router[_0xb926('0x8')](_0xb926('0xb'),auth['isAuthenticated'](),controller[_0xb926('0xc')]);router[_0xb926('0x8')]('/:id/preview',auth[_0xb926('0x9')](),controller[_0xb926('0xd')]);router[_0xb926('0x8')](_0xb926('0xe'),auth[_0xb926('0x9')](),controller[_0xb926('0xf')]);router[_0xb926('0x8')](_0xb926('0x10'),auth[_0xb926('0x9')](),controller[_0xb926('0x11')]);router[_0xb926('0x12')]('/',auth[_0xb926('0x9')](),controller['create']);router[_0xb926('0x13')](_0xb926('0xb'),auth[_0xb926('0x9')](),controller[_0xb926('0x14')]);router[_0xb926('0x15')](_0xb926('0xb'),auth[_0xb926('0x9')](),controller[_0xb926('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index ae0923c..8d02cc0 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x307967,_0x5c0f8f){var _0x20acf1=function(_0x2a1f91){while(--_0x2a1f91){_0x307967['push'](_0x307967['shift']());}};_0x20acf1(++_0x5c0f8f);}(_0x814b,0x1a2));var _0xb814=function(_0x546c68,_0x5c0116){_0x546c68=_0x546c68-0x0;var _0x4a2389=_0x814b[_0x546c68];return _0x4a2389;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}};
\ No newline at end of file
+var _0x7c09=['exports','STRING','TEXT'];(function(_0x10ed7b,_0x18bc05){var _0x2e928e=function(_0x3b89c2){while(--_0x3b89c2){_0x10ed7b['push'](_0x10ed7b['shift']());}};_0x2e928e(++_0x18bc05);}(_0x7c09,0x102));var _0x97c0=function(_0x2d1258,_0x19cfd1){_0x2d1258=_0x2d1258-0x0;var _0x2174dd=_0x7c09[_0x2d1258];return _0x2174dd;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index e1b57b0..97217e7 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 _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x5d6994,_0x3bd35a){var _0x347a53=function(_0x4fb4fa){while(--_0x4fb4fa){_0x5d6994['push'](_0x5d6994['shift']());}};_0x347a53(++_0x3bd35a);}(_0x1967,0x173));var _0x7196=function(_0x3a813b,_0xa62f8e){_0x3a813b=_0x3a813b-0x0;var _0x20b24c=_0x1967[_0x3a813b];return _0x20b24c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));};
\ No newline at end of file
+var _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x2ef3,0xba));var _0x32ef=function(_0x4c5fa5,_0x4d6cd9){_0x4c5fa5=_0x4c5fa5-0x0;var _0x1e340a=_0x2ef3[_0x4c5fa5];return _0x1e340a;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 74b0012..e2025d4 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 _0xb222=['analytics_default_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0x522141,_0x535eb0){var _0x214b97=function(_0x212006){while(--_0x212006){_0x522141['push'](_0x522141['shift']());}};_0x214b97(++_0x535eb0);}(_0xb222,0x11f));var _0x2b22=function(_0x4dc268,_0x3ea099){_0x4dc268=_0x4dc268-0x0;var _0x24799b=_0xb222[_0x4dc268];return _0x24799b;};'use strict';var _=require(_0x2b22('0x0'));var util=require(_0x2b22('0x1'));var logger=require(_0x2b22('0x2'))('api');var moment=require(_0x2b22('0x3'));var BPromise=require(_0x2b22('0x4'));var rp=require(_0x2b22('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b22('0x6'));var config=require(_0x2b22('0x7'));var attributes=require(_0x2b22('0x8'));module[_0x2b22('0x9')]=function(_0x5d5f26,_0x5a8c8d){return _0x5d5f26[_0x2b22('0xa')](_0x2b22('0xb'),attributes,{'tableName':_0x2b22('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd783=['bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','api','moment'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xd783,0xb2));var _0x3d78=function(_0x3c5aa6,_0x4c4f86){_0x3c5aa6=_0x3c5aa6-0x0;var _0x49e397=_0xd783[_0x3c5aa6];return _0x49e397;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3d78('0x0'));var moment=require(_0x3d78('0x1'));var BPromise=require(_0x3d78('0x2'));var rp=require(_0x3d78('0x3'));var fs=require('fs');var path=require(_0x3d78('0x4'));var rimraf=require('rimraf');var config=require(_0x3d78('0x5'));var attributes=require(_0x3d78('0x6'));module[_0x3d78('0x7')]=function(_0x2794f5,_0x15f189){return _0x2794f5['define'](_0x3d78('0x8'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 988665f..ce47d39 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 _0xdcd4=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x236ed6,_0x562e24){var _0x2507e4=function(_0x1fdd4b){while(--_0x1fdd4b){_0x236ed6['push'](_0x236ed6['shift']());}};_0x2507e4(++_0x562e24);}(_0xdcd4,0xd7));var _0x4dcd=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xdcd4[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x4dcd('0x0'));var util=require(_0x4dcd('0x1'));var moment=require(_0x4dcd('0x2'));var BPromise=require(_0x4dcd('0x3'));var rs=require(_0x4dcd('0x4'));var fs=require('fs');var Redis=require(_0x4dcd('0x5'));var db=require(_0x4dcd('0x6'))['db'];var utils=require(_0x4dcd('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x4dcd('0x8'));var jayson=require(_0x4dcd('0x9'));var client=jayson[_0x4dcd('0xa')][_0x4dcd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a90ea,_0x33c0bf,_0x4262b3){return new BPromise(function(_0xe31b79,_0x1a9a13){return client[_0x4dcd('0xc')](_0x1a90ea,_0x4262b3)['then'](function(_0x470be1){logger['info'](_0x4dcd('0xd'),_0x33c0bf,'request\x20sent');logger['debug'](_0x4dcd('0xe'),_0x33c0bf,_0x4dcd('0xf'),JSON[_0x4dcd('0x10')](_0x470be1));if(_0x470be1[_0x4dcd('0x11')]){if(_0x470be1[_0x4dcd('0x11')][_0x4dcd('0x12')]===0x1f4){logger['error'](_0x4dcd('0xd'),_0x33c0bf,_0x470be1[_0x4dcd('0x11')][_0x4dcd('0x13')]);return _0x1a9a13(_0x470be1[_0x4dcd('0x11')][_0x4dcd('0x13')]);}logger['error'](_0x4dcd('0xd'),_0x33c0bf,_0x470be1[_0x4dcd('0x11')][_0x4dcd('0x13')]);return _0xe31b79(_0x470be1[_0x4dcd('0x11')][_0x4dcd('0x13')]);}else{logger[_0x4dcd('0x14')](_0x4dcd('0xd'),_0x33c0bf,_0x4dcd('0xf'));_0xe31b79(_0x470be1['result'][_0x4dcd('0x13')]);}})[_0x4dcd('0x15')](function(_0x4b7ce8){logger[_0x4dcd('0x11')](_0x4dcd('0xd'),_0x33c0bf,_0x4b7ce8);_0x1a9a13(_0x4b7ce8);});});}
\ No newline at end of file
+var _0xd21c=['then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','http','request'];(function(_0x4f14cb,_0x26d0b5){var _0x399057=function(_0x4672a9){while(--_0x4672a9){_0x4f14cb['push'](_0x4f14cb['shift']());}};_0x399057(++_0x26d0b5);}(_0xd21c,0x101));var _0xcd21=function(_0x45bc6a,_0x301e14){_0x45bc6a=_0x45bc6a-0x0;var _0x171a81=_0xd21c[_0x45bc6a];return _0x171a81;};'use strict';var _=require(_0xcd21('0x0'));var util=require(_0xcd21('0x1'));var moment=require(_0xcd21('0x2'));var BPromise=require(_0xcd21('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd21('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcd21('0x5'))('rpc');var config=require(_0xcd21('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcd21('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x391944,_0x2ecae8,_0x17ed77){return new BPromise(function(_0x335ca3,_0x1b5fef){return client[_0xcd21('0x8')](_0x391944,_0x17ed77)[_0xcd21('0x9')](function(_0x49b918){logger[_0xcd21('0xa')](_0xcd21('0xb'),_0x2ecae8,_0xcd21('0xc'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2ecae8,'request\x20sent',JSON[_0xcd21('0xd')](_0x49b918));if(_0x49b918[_0xcd21('0xe')]){if(_0x49b918[_0xcd21('0xe')][_0xcd21('0xf')]===0x1f4){logger[_0xcd21('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2ecae8,_0x49b918[_0xcd21('0xe')][_0xcd21('0x10')]);return _0x1b5fef(_0x49b918[_0xcd21('0xe')][_0xcd21('0x10')]);}logger[_0xcd21('0xe')](_0xcd21('0xb'),_0x2ecae8,_0x49b918[_0xcd21('0xe')][_0xcd21('0x10')]);return _0x335ca3(_0x49b918[_0xcd21('0xe')][_0xcd21('0x10')]);}else{logger[_0xcd21('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2ecae8,_0xcd21('0xc'));_0x335ca3(_0x49b918[_0xcd21('0x11')][_0xcd21('0x10')]);}})[_0xcd21('0x12')](function(_0x326662){logger[_0xcd21('0xe')](_0xcd21('0xb'),_0x2ecae8,_0x326662);_0x1b5fef(_0x326662);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 8bcc299..0b7b8f2 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 _0x644f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/preview','/:id/run','run','create','put','update','delete','/:id','util','path','connect-timeout'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x644f,0x177));var _0xf644=function(_0x20cc29,_0x30a46d){_0x20cc29=_0x20cc29-0x0;var _0x28d513=_0x644f[_0x20cc29];return _0x28d513;};'use strict';var multer=require('multer');var util=require(_0xf644('0x0'));var path=require(_0xf644('0x1'));var timeout=require(_0xf644('0x2'));var express=require(_0xf644('0x3'));var router=express[_0xf644('0x4')]();var fs_extra=require(_0xf644('0x5'));var auth=require(_0xf644('0x6'));var interaction=require(_0xf644('0x7'));var config=require(_0xf644('0x8'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0xf644('0x9')](),controller[_0xf644('0xa')]);router[_0xf644('0xb')]('/:id',auth[_0xf644('0x9')](),controller[_0xf644('0xc')]);router[_0xf644('0xb')](_0xf644('0xd'),auth[_0xf644('0x9')](),controller['preview']);router[_0xf644('0xb')](_0xf644('0xe'),auth[_0xf644('0x9')](),controller[_0xf644('0xf')]);router['get']('/:id/query',auth[_0xf644('0x9')](),controller['query']);router['post']('/',auth[_0xf644('0x9')](),controller[_0xf644('0x10')]);router[_0xf644('0x11')]('/:id',auth[_0xf644('0x9')](),controller[_0xf644('0x12')]);router[_0xf644('0x13')](_0xf644('0x14'),auth[_0xf644('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xa337=['/:id/run','run','/:id/query','post','/:id','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview'];(function(_0x28eab5,_0x3f6403){var _0x1be3c0=function(_0x347bea){while(--_0x347bea){_0x28eab5['push'](_0x28eab5['shift']());}};_0x1be3c0(++_0x3f6403);}(_0xa337,0x7f));var _0x7a33=function(_0x245164,_0x1a9842){_0x245164=_0x245164-0x0;var _0x2de85c=_0xa337[_0x245164];return _0x2de85c;};'use strict';var multer=require(_0x7a33('0x0'));var util=require('util');var path=require(_0x7a33('0x1'));var timeout=require('connect-timeout');var express=require(_0x7a33('0x2'));var router=express['Router']();var fs_extra=require(_0x7a33('0x3'));var auth=require(_0x7a33('0x4'));var interaction=require(_0x7a33('0x5'));var config=require(_0x7a33('0x6'));var controller=require(_0x7a33('0x7'));router[_0x7a33('0x8')]('/',auth[_0x7a33('0x9')](),controller[_0x7a33('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7a33('0xb')]);router['get'](_0x7a33('0xc'),auth[_0x7a33('0x9')](),controller['preview']);router[_0x7a33('0x8')](_0x7a33('0xd'),auth['isAuthenticated'](),controller[_0x7a33('0xe')]);router[_0x7a33('0x8')](_0x7a33('0xf'),auth[_0x7a33('0x9')](),controller['query']);router[_0x7a33('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x7a33('0x11'),auth[_0x7a33('0x9')](),controller['update']);router['delete'](_0x7a33('0x11'),auth[_0x7a33('0x9')](),controller[_0x7a33('0x12')]);module[_0x7a33('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index ea865c5..ad2031e 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 _0xd6f0=['STRING','ENUM','csv','pdf','DATE','manual','scheduled','INTEGER','sequelize'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xd6f0,0xd7));var _0x0d6f=function(_0x2e8a70,_0x43d2b0){_0x2e8a70=_0x2e8a70-0x0;var _0x1ffcdf=_0xd6f0[_0x2e8a70];return _0x1ffcdf;};'use strict';var Sequelize=require(_0x0d6f('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x0d6f('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x0d6f('0x2')](_0x0d6f('0x3'),_0x0d6f('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0x0d6f('0x3')},'savename':{'type':Sequelize[_0x0d6f('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0d6f('0x5')]},'endDate':{'type':Sequelize[_0x0d6f('0x5')]},'status':{'type':Sequelize[_0x0d6f('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x0d6f('0x2')](_0x0d6f('0x6'),_0x0d6f('0x7')),'allowNull':![],'defaultValue':_0x0d6f('0x6')},'reportId':{'type':Sequelize[_0x0d6f('0x8')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xcebe=['csv','xlsx','DATE','Loading','manual','scheduled','UNSIGNED','sequelize','moment','exports','STRING','ENUM'];(function(_0x456a4b,_0x51df8){var _0x42957c=function(_0x431de8){while(--_0x431de8){_0x456a4b['push'](_0x456a4b['shift']());}};_0x42957c(++_0x51df8);}(_0xcebe,0xc7));var _0xeceb=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xcebe[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0xeceb('0x0'));var moment=require(_0xeceb('0x1'));module[_0xeceb('0x2')]={'name':{'type':Sequelize[_0xeceb('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xeceb('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xeceb('0x4')](_0xeceb('0x5'),'pdf',_0xeceb('0x6')),'allowNull':![],'defaultValue':_0xeceb('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xeceb('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xeceb('0x8')},'type':{'type':Sequelize[_0xeceb('0x4')](_0xeceb('0x9'),_0xeceb('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xeceb('0xb')]},'reportType':{'type':Sequelize[_0xeceb('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 532a611..6fe78f9 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 _0x34d4=['catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','get','ExtractedReports','error','stack','name','send','index','map','AnalyticExtractedReport','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','params','keys','rawAttributes','find'];(function(_0x308374,_0x550e85){var _0x1f71e0=function(_0x18377d){while(--_0x18377d){_0x308374['push'](_0x308374['shift']());}};_0x1f71e0(++_0x550e85);}(_0x34d4,0x199));var _0x434d=function(_0x49577e,_0x444992){_0x49577e=_0x49577e-0x0;var _0x57aec6=_0x34d4[_0x49577e];return _0x57aec6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x434d('0x0'));var zipdir=require(_0x434d('0x1'));var jsonpatch=require(_0x434d('0x2'));var rp=require('request-promise');var moment=require(_0x434d('0x3'));var BPromise=require(_0x434d('0x4'));var Mustache=require(_0x434d('0x5'));var util=require(_0x434d('0x6'));var path=require('path');var sox=require(_0x434d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x434d('0x8'));var _=require(_0x434d('0x9'));var squel=require(_0x434d('0xa'));var crypto=require(_0x434d('0xb'));var jsforce=require(_0x434d('0xc'));var deskjs=require(_0x434d('0xd'));var toCsv=require(_0x434d('0xe'));var querystring=require(_0x434d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x434d('0x10'));var as=require(_0x434d('0x11'));var hardwareService=require(_0x434d('0x12'));var logger=require(_0x434d('0x13'))(_0x434d('0x14'));var utils=require(_0x434d('0x15'));var config=require(_0x434d('0x16'));var licenseUtil=require(_0x434d('0x17'));var db=require(_0x434d('0x18'))['db'];function respondWithStatusCode(_0x3f66c4,_0x435179){_0x435179=_0x435179||0xcc;return function(_0x170623){if(_0x170623){return _0x3f66c4[_0x434d('0x19')](_0x435179);}return _0x3f66c4['status'](_0x435179)[_0x434d('0x1a')]();};}function respondWithResult(_0x2f8f1f,_0x1cb623){_0x1cb623=_0x1cb623||0xc8;return function(_0x52cd71){if(_0x52cd71){return _0x2f8f1f[_0x434d('0x1b')](_0x1cb623)['json'](_0x52cd71);}};}function respondWithFilteredResult(_0x1c45fc,_0x1eda70){return function(_0x272cb3){if(_0x272cb3){var _0x301bea=typeof _0x1eda70[_0x434d('0x1c')]===_0x434d('0x1d')&&typeof _0x1eda70['limit']===_0x434d('0x1d');var _0x220ad6=_0x272cb3[_0x434d('0x1e')];var _0x270771=_0x301bea?0x0:_0x1eda70[_0x434d('0x1c')];var _0xb738c5=_0x301bea?_0x272cb3[_0x434d('0x1e')]:_0x1eda70[_0x434d('0x1c')]+_0x1eda70[_0x434d('0x1f')];var _0x436592;if(_0xb738c5>=_0x220ad6){_0xb738c5=_0x220ad6;_0x436592=0xc8;}else{_0x436592=0xce;}_0x1c45fc[_0x434d('0x1b')](_0x436592);return _0x1c45fc[_0x434d('0x20')](_0x434d('0x21'),_0x270771+'-'+_0xb738c5+'/'+_0x220ad6)['json'](_0x272cb3);}return null;};}function patchUpdates(_0x39822c){return function(_0x329bd3){try{jsonpatch[_0x434d('0x22')](_0x329bd3,_0x39822c,!![]);}catch(_0x505a88){return BPromise[_0x434d('0x23')](_0x505a88);}return _0x329bd3['save']();};}function saveUpdates(_0x21d30f,_0x47e98a){return function(_0x974b18){if(_0x974b18){return _0x974b18['update'](_0x21d30f)[_0x434d('0x24')](function(_0x59be8e){return _0x59be8e;});}return null;};}function removeEntity(_0x548c19,_0x3a07ee){return function(_0x34c782){if(_0x34c782){return _0x34c782[_0x434d('0x25')]()[_0x434d('0x24')](function(){var _0x24aa25=_0x34c782[_0x434d('0x26')]({'plain':!![]});var _0x291f94=_0x434d('0x27');return db['UserProfileResource'][_0x434d('0x25')]({'where':{'type':_0x291f94,'resourceId':_0x24aa25['id']}})[_0x434d('0x24')](function(){return _0x34c782;});})[_0x434d('0x24')](function(){_0x548c19[_0x434d('0x1b')](0xcc)[_0x434d('0x1a')]();});}};}function handleEntityNotFound(_0xbe7a33,_0x57dce3){return function(_0x32e6a8){if(!_0x32e6a8){_0xbe7a33['sendStatus'](0x194);}return _0x32e6a8;};}function handleError(_0x2af2bc,_0xd8bfce){_0xd8bfce=_0xd8bfce||0x1f4;return function(_0x5def06){logger[_0x434d('0x28')](_0x5def06[_0x434d('0x29')]);if(_0x5def06['name']){delete _0x5def06[_0x434d('0x2a')];}_0x2af2bc[_0x434d('0x1b')](_0xd8bfce)[_0x434d('0x2b')](_0x5def06);};}exports[_0x434d('0x2c')]=function(_0x325010,_0x449032){var _0x499bb7={},_0x50f373={},_0x8cfcd2={'count':0x0,'rows':[]};var _0x51bf0f=_[_0x434d('0x2d')](db[_0x434d('0x2e')]['rawAttributes'],function(_0x5bd5f5){return{'name':_0x5bd5f5['fieldName'],'type':_0x5bd5f5[_0x434d('0x2f')][_0x434d('0x30')]};});_0x50f373[_0x434d('0x31')]=_['map'](_0x51bf0f,'name');_0x50f373['query']=_['keys'](_0x325010[_0x434d('0x32')]);_0x50f373[_0x434d('0x33')]=_[_0x434d('0x34')](_0x50f373[_0x434d('0x31')],_0x50f373[_0x434d('0x32')]);_0x499bb7[_0x434d('0x35')]=_[_0x434d('0x34')](_0x50f373[_0x434d('0x31')],qs[_0x434d('0x36')](_0x325010[_0x434d('0x32')][_0x434d('0x36')]));_0x499bb7[_0x434d('0x35')]=_0x499bb7['attributes'][_0x434d('0x37')]?_0x499bb7[_0x434d('0x35')]:_0x50f373['model'];if(!_0x325010['query'][_0x434d('0x38')](_0x434d('0x39'))){_0x499bb7[_0x434d('0x1f')]=qs[_0x434d('0x1f')](_0x325010[_0x434d('0x32')][_0x434d('0x1f')]);_0x499bb7[_0x434d('0x1c')]=qs['offset'](_0x325010[_0x434d('0x32')][_0x434d('0x1c')]);}_0x499bb7[_0x434d('0x3a')]=qs[_0x434d('0x3b')](_0x325010['query'][_0x434d('0x3b')]);_0x499bb7[_0x434d('0x3c')]=qs[_0x434d('0x33')](_['pick'](_0x325010[_0x434d('0x32')],_0x50f373['filters']),_0x51bf0f);if(_0x325010['query']['filter']){_0x499bb7[_0x434d('0x3c')]=_[_0x434d('0x3d')](_0x499bb7[_0x434d('0x3c')],{'$or':_[_0x434d('0x2d')](_0x51bf0f,function(_0x4effac){if(_0x4effac[_0x434d('0x2f')]!==_0x434d('0x3e')){var _0x3259ab={};_0x3259ab[_0x4effac[_0x434d('0x2a')]]={'$like':'%'+_0x325010[_0x434d('0x32')][_0x434d('0x3f')]+'%'};return _0x3259ab;}})});}_0x499bb7=_[_0x434d('0x3d')]({},_0x499bb7,_0x325010[_0x434d('0x40')]);var _0x328fe5={'where':_0x499bb7[_0x434d('0x3c')]};return db[_0x434d('0x2e')][_0x434d('0x1e')](_0x328fe5)['then'](function(_0x2ccad3){_0x8cfcd2[_0x434d('0x1e')]=_0x2ccad3;if(_0x325010[_0x434d('0x32')][_0x434d('0x41')]){_0x499bb7[_0x434d('0x42')]=[{'all':!![]}];}return db[_0x434d('0x2e')]['findAll'](_0x499bb7);})[_0x434d('0x24')](function(_0x24029f){_0x8cfcd2['rows']=_0x24029f;return _0x8cfcd2;})[_0x434d('0x24')](respondWithFilteredResult(_0x449032,_0x499bb7))['catch'](handleError(_0x449032,null));};exports['show']=function(_0xf72e37,_0x50207b){var _0x522dfd={'raw':!![],'where':{'id':_0xf72e37[_0x434d('0x43')]['id']}},_0x48f65c={};_0x48f65c['model']=_[_0x434d('0x44')](db[_0x434d('0x2e')][_0x434d('0x45')]);_0x48f65c[_0x434d('0x32')]=_[_0x434d('0x44')](_0xf72e37[_0x434d('0x32')]);_0x48f65c[_0x434d('0x33')]=_[_0x434d('0x34')](_0x48f65c['model'],_0x48f65c[_0x434d('0x32')]);_0x522dfd[_0x434d('0x35')]=_[_0x434d('0x34')](_0x48f65c[_0x434d('0x31')],qs[_0x434d('0x36')](_0xf72e37[_0x434d('0x32')][_0x434d('0x36')]));_0x522dfd[_0x434d('0x35')]=_0x522dfd[_0x434d('0x35')][_0x434d('0x37')]?_0x522dfd[_0x434d('0x35')]:_0x48f65c['model'];if(_0xf72e37[_0x434d('0x32')][_0x434d('0x41')]){_0x522dfd[_0x434d('0x42')]=[{'all':!![]}];}_0x522dfd=_[_0x434d('0x3d')]({},_0x522dfd,_0xf72e37['options']);return db['AnalyticExtractedReport'][_0x434d('0x46')](_0x522dfd)['then'](handleEntityNotFound(_0x50207b,null))[_0x434d('0x24')](respondWithResult(_0x50207b,null))[_0x434d('0x47')](handleError(_0x50207b,null));};exports['create']=function(_0x471ed3,_0x20d98c){return db[_0x434d('0x2e')][_0x434d('0x48')](_0x471ed3[_0x434d('0x49')],{})[_0x434d('0x24')](function(_0x23d0ac){var _0xafd768=_0x471ed3['user']['get']({'plain':!![]});if(!_0xafd768)throw new Error(_0x434d('0x4a'));if(_0xafd768[_0x434d('0x4b')]===_0x434d('0x4c')){var _0x2179af=_0x23d0ac[_0x434d('0x26')]({'plain':!![]});var _0x22746d=_0x434d('0x27');return db[_0x434d('0x4d')][_0x434d('0x46')]({'where':{'name':_0x22746d,'userProfileId':_0xafd768[_0x434d('0x4e')]},'raw':!![]})[_0x434d('0x24')](function(_0x5ef567){if(_0x5ef567&&_0x5ef567['autoAssociation']===0x0){return db[_0x434d('0x4f')][_0x434d('0x48')]({'name':_0x2179af['name'],'resourceId':_0x2179af['id'],'type':_0x5ef567['name'],'sectionId':_0x5ef567['id']},{})[_0x434d('0x24')](function(){return _0x23d0ac;});}else{return _0x23d0ac;}})[_0x434d('0x47')](function(_0x3da46c){logger[_0x434d('0x28')](_0x434d('0x50'),_0x3da46c);throw _0x3da46c;});}return _0x23d0ac;})[_0x434d('0x24')](respondWithResult(_0x20d98c,0xc9))[_0x434d('0x47')](handleError(_0x20d98c,null));};exports[_0x434d('0x51')]=function(_0xea0769,_0x504e51){if(_0xea0769[_0x434d('0x49')]['id']){delete _0xea0769[_0x434d('0x49')]['id'];}return db['AnalyticExtractedReport'][_0x434d('0x46')]({'where':{'id':_0xea0769[_0x434d('0x43')]['id']}})[_0x434d('0x24')](handleEntityNotFound(_0x504e51,null))['then'](saveUpdates(_0xea0769[_0x434d('0x49')],null))[_0x434d('0x24')](respondWithResult(_0x504e51,null))[_0x434d('0x47')](handleError(_0x504e51,null));};exports[_0x434d('0x25')]=function(_0x205473,_0x1d932e){return db[_0x434d('0x2e')][_0x434d('0x46')]({'where':{'id':_0x205473['params']['id']}})[_0x434d('0x24')](handleEntityNotFound(_0x1d932e,null))[_0x434d('0x24')](removeEntity(_0x1d932e,null))['catch'](handleError(_0x1d932e,null));};exports[_0x434d('0x52')]=function(_0x482e12,_0x3a31ed,_0x15d1b9){return db['AnalyticExtractedReport'][_0x434d('0x46')]({'where':{'id':_0x482e12[_0x434d('0x43')]['id']},'attributes':[_0x434d('0x2a'),_0x434d('0x53'),_0x434d('0x54'),_0x434d('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x3a31ed,null))[_0x434d('0x24')](function(_0x368178){if(_0x368178){if(!fs[_0x434d('0x56')](path['join'](config[_0x434d('0x57')],_0x434d('0x58'),_0x368178['savename']))){throw new db[(_0x434d('0x59'))][(_0x434d('0x5a'))](_0x434d('0x5b'));}if(_0x482e12[_0x434d('0x32')][_0x434d('0x5c')]){return _0x3a31ed[_0x434d('0x19')](0xc8);}return _0x3a31ed[_0x434d('0x52')](path[_0x434d('0x5d')](config['root'],'server/files/reports',_0x368178[_0x434d('0x54')]),util[_0x434d('0x5e')](_0x434d('0x5f'),_0x368178['basename']||_0x368178['name'],_0x368178['output']['toLowerCase']()));}})['catch'](handleError(_0x3a31ed,null));};
\ No newline at end of file
+var _0xc4b0=['filter','options','includeAll','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','format','%s.%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','json','undefined','count','offset','limit','set','update','then','get','ExtractedReports','UserProfileResource','destroy','end','sendStatus','stack','name','send','map','AnalyticExtractedReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge'];(function(_0x597e54,_0x4bd022){var _0x1bfeb2=function(_0x1c4ce8){while(--_0x1c4ce8){_0x597e54['push'](_0x597e54['shift']());}};_0x1bfeb2(++_0x4bd022);}(_0xc4b0,0x125));var _0x0c4b=function(_0x3f23d9,_0x4f118e){_0x3f23d9=_0x3f23d9-0x0;var _0x5f15be=_0xc4b0[_0x3f23d9];return _0x5f15be;};'use strict';var emlformat=require(_0x0c4b('0x0'));var rimraf=require(_0x0c4b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c4b('0x2'));var rp=require(_0x0c4b('0x3'));var moment=require(_0x0c4b('0x4'));var BPromise=require(_0x0c4b('0x5'));var Mustache=require(_0x0c4b('0x6'));var util=require('util');var path=require(_0x0c4b('0x7'));var sox=require(_0x0c4b('0x8'));var csv=require(_0x0c4b('0x9'));var ejs=require(_0x0c4b('0xa'));var fs=require('fs');var fs_extra=require(_0x0c4b('0xb'));var _=require('lodash');var squel=require(_0x0c4b('0xc'));var crypto=require('crypto');var jsforce=require(_0x0c4b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0c4b('0x9'));var querystring=require(_0x0c4b('0xe'));var Papa=require(_0x0c4b('0xf'));var Redis=require(_0x0c4b('0x10'));var authService=require(_0x0c4b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0c4b('0x12'));var hardwareService=require(_0x0c4b('0x13'));var logger=require('../../config/logger')(_0x0c4b('0x14'));var utils=require(_0x0c4b('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0c4b('0x16'))['db'];function respondWithStatusCode(_0x5de9c0,_0x48fbd9){_0x48fbd9=_0x48fbd9||0xcc;return function(_0x27baca){if(_0x27baca){return _0x5de9c0['sendStatus'](_0x48fbd9);}return _0x5de9c0[_0x0c4b('0x17')](_0x48fbd9)['end']();};}function respondWithResult(_0x2197a5,_0x4b002a){_0x4b002a=_0x4b002a||0xc8;return function(_0x431a71){if(_0x431a71){return _0x2197a5[_0x0c4b('0x17')](_0x4b002a)[_0x0c4b('0x18')](_0x431a71);}};}function respondWithFilteredResult(_0x2783ff,_0x507667){return function(_0x193fb8){if(_0x193fb8){var _0x926317=typeof _0x507667['offset']===_0x0c4b('0x19')&&typeof _0x507667['limit']==='undefined';var _0x3b80ef=_0x193fb8[_0x0c4b('0x1a')];var _0x4e8cb0=_0x926317?0x0:_0x507667['offset'];var _0x50eb2a=_0x926317?_0x193fb8[_0x0c4b('0x1a')]:_0x507667[_0x0c4b('0x1b')]+_0x507667[_0x0c4b('0x1c')];var _0x155a6b;if(_0x50eb2a>=_0x3b80ef){_0x50eb2a=_0x3b80ef;_0x155a6b=0xc8;}else{_0x155a6b=0xce;}_0x2783ff[_0x0c4b('0x17')](_0x155a6b);return _0x2783ff[_0x0c4b('0x1d')]('Content-Range',_0x4e8cb0+'-'+_0x50eb2a+'/'+_0x3b80ef)[_0x0c4b('0x18')](_0x193fb8);}return null;};}function patchUpdates(_0x961c21){return function(_0x21ea46){try{jsonpatch['apply'](_0x21ea46,_0x961c21,!![]);}catch(_0x2cd71e){return BPromise['reject'](_0x2cd71e);}return _0x21ea46['save']();};}function saveUpdates(_0x111f54,_0x4e5b54){return function(_0x3c674f){if(_0x3c674f){return _0x3c674f[_0x0c4b('0x1e')](_0x111f54)[_0x0c4b('0x1f')](function(_0xefccf0){return _0xefccf0;});}return null;};}function removeEntity(_0x16bca5,_0x30a8e8){return function(_0x396c2e){if(_0x396c2e){return _0x396c2e['destroy']()['then'](function(){var _0x5a7d42=_0x396c2e[_0x0c4b('0x20')]({'plain':!![]});var _0x1312ed=_0x0c4b('0x21');return db[_0x0c4b('0x22')][_0x0c4b('0x23')]({'where':{'type':_0x1312ed,'resourceId':_0x5a7d42['id']}})['then'](function(){return _0x396c2e;});})[_0x0c4b('0x1f')](function(){_0x16bca5[_0x0c4b('0x17')](0xcc)[_0x0c4b('0x24')]();});}};}function handleEntityNotFound(_0x3e0948,_0x2f40b7){return function(_0x4841a5){if(!_0x4841a5){_0x3e0948[_0x0c4b('0x25')](0x194);}return _0x4841a5;};}function handleError(_0x3d55cd,_0x264eb3){_0x264eb3=_0x264eb3||0x1f4;return function(_0x4dbbea){logger['error'](_0x4dbbea[_0x0c4b('0x26')]);if(_0x4dbbea['name']){delete _0x4dbbea[_0x0c4b('0x27')];}_0x3d55cd[_0x0c4b('0x17')](_0x264eb3)[_0x0c4b('0x28')](_0x4dbbea);};}exports['index']=function(_0x2ea317,_0x1239d0){var _0x495a76={},_0x45d122={},_0xfa1dcf={'count':0x0,'rows':[]};var _0x56d7a1=_[_0x0c4b('0x29')](db[_0x0c4b('0x2a')][_0x0c4b('0x2b')],function(_0xf3172c){return{'name':_0xf3172c['fieldName'],'type':_0xf3172c[_0x0c4b('0x2c')]['key']};});_0x45d122[_0x0c4b('0x2d')]=_[_0x0c4b('0x29')](_0x56d7a1,'name');_0x45d122[_0x0c4b('0x2e')]=_[_0x0c4b('0x2f')](_0x2ea317['query']);_0x45d122[_0x0c4b('0x30')]=_[_0x0c4b('0x31')](_0x45d122['model'],_0x45d122[_0x0c4b('0x2e')]);_0x495a76[_0x0c4b('0x32')]=_[_0x0c4b('0x31')](_0x45d122[_0x0c4b('0x2d')],qs[_0x0c4b('0x33')](_0x2ea317[_0x0c4b('0x2e')][_0x0c4b('0x33')]));_0x495a76['attributes']=_0x495a76[_0x0c4b('0x32')][_0x0c4b('0x34')]?_0x495a76[_0x0c4b('0x32')]:_0x45d122[_0x0c4b('0x2d')];if(!_0x2ea317['query'][_0x0c4b('0x35')](_0x0c4b('0x36'))){_0x495a76['limit']=qs[_0x0c4b('0x1c')](_0x2ea317[_0x0c4b('0x2e')][_0x0c4b('0x1c')]);_0x495a76[_0x0c4b('0x1b')]=qs[_0x0c4b('0x1b')](_0x2ea317[_0x0c4b('0x2e')]['offset']);}_0x495a76[_0x0c4b('0x37')]=qs[_0x0c4b('0x38')](_0x2ea317[_0x0c4b('0x2e')]['sort']);_0x495a76[_0x0c4b('0x39')]=qs[_0x0c4b('0x30')](_['pick'](_0x2ea317[_0x0c4b('0x2e')],_0x45d122[_0x0c4b('0x30')]),_0x56d7a1);if(_0x2ea317[_0x0c4b('0x2e')]['filter']){_0x495a76[_0x0c4b('0x39')]=_[_0x0c4b('0x3a')](_0x495a76[_0x0c4b('0x39')],{'$or':_['map'](_0x56d7a1,function(_0x3f4403){if(_0x3f4403[_0x0c4b('0x2c')]!=='VIRTUAL'){var _0x491e11={};_0x491e11[_0x3f4403['name']]={'$like':'%'+_0x2ea317[_0x0c4b('0x2e')][_0x0c4b('0x3b')]+'%'};return _0x491e11;}})});}_0x495a76=_[_0x0c4b('0x3a')]({},_0x495a76,_0x2ea317[_0x0c4b('0x3c')]);var _0x4bafe7={'where':_0x495a76['where']};return db[_0x0c4b('0x2a')]['count'](_0x4bafe7)[_0x0c4b('0x1f')](function(_0x102d21){_0xfa1dcf['count']=_0x102d21;if(_0x2ea317[_0x0c4b('0x2e')][_0x0c4b('0x3d')]){_0x495a76['include']=[{'all':!![]}];}return db[_0x0c4b('0x2a')][_0x0c4b('0x3e')](_0x495a76);})[_0x0c4b('0x1f')](function(_0x3dcd23){_0xfa1dcf[_0x0c4b('0x3f')]=_0x3dcd23;return _0xfa1dcf;})['then'](respondWithFilteredResult(_0x1239d0,_0x495a76))['catch'](handleError(_0x1239d0,null));};exports[_0x0c4b('0x40')]=function(_0x1b23f8,_0x55b84f){var _0x173b0a={'raw':!![],'where':{'id':_0x1b23f8[_0x0c4b('0x41')]['id']}},_0x464e45={};_0x464e45[_0x0c4b('0x2d')]=_['keys'](db['AnalyticExtractedReport'][_0x0c4b('0x2b')]);_0x464e45[_0x0c4b('0x2e')]=_[_0x0c4b('0x2f')](_0x1b23f8['query']);_0x464e45[_0x0c4b('0x30')]=_['intersection'](_0x464e45[_0x0c4b('0x2d')],_0x464e45[_0x0c4b('0x2e')]);_0x173b0a[_0x0c4b('0x32')]=_[_0x0c4b('0x31')](_0x464e45[_0x0c4b('0x2d')],qs['fields'](_0x1b23f8[_0x0c4b('0x2e')][_0x0c4b('0x33')]));_0x173b0a[_0x0c4b('0x32')]=_0x173b0a[_0x0c4b('0x32')][_0x0c4b('0x34')]?_0x173b0a[_0x0c4b('0x32')]:_0x464e45[_0x0c4b('0x2d')];if(_0x1b23f8['query'][_0x0c4b('0x3d')]){_0x173b0a['include']=[{'all':!![]}];}_0x173b0a=_[_0x0c4b('0x3a')]({},_0x173b0a,_0x1b23f8[_0x0c4b('0x3c')]);return db[_0x0c4b('0x2a')]['find'](_0x173b0a)[_0x0c4b('0x1f')](handleEntityNotFound(_0x55b84f,null))[_0x0c4b('0x1f')](respondWithResult(_0x55b84f,null))[_0x0c4b('0x42')](handleError(_0x55b84f,null));};exports['create']=function(_0x147b9a,_0x36b27e){return db[_0x0c4b('0x2a')][_0x0c4b('0x43')](_0x147b9a[_0x0c4b('0x44')],{})[_0x0c4b('0x1f')](function(_0x1ca0fe){var _0x3ce778=_0x147b9a[_0x0c4b('0x45')][_0x0c4b('0x20')]({'plain':!![]});if(!_0x3ce778)throw new Error(_0x0c4b('0x46'));if(_0x3ce778[_0x0c4b('0x47')]==='user'){var _0x522fe2=_0x1ca0fe['get']({'plain':!![]});var _0x5b496e=_0x0c4b('0x21');return db[_0x0c4b('0x48')][_0x0c4b('0x49')]({'where':{'name':_0x5b496e,'userProfileId':_0x3ce778[_0x0c4b('0x4a')]},'raw':!![]})[_0x0c4b('0x1f')](function(_0x345e2a){if(_0x345e2a&&_0x345e2a[_0x0c4b('0x4b')]===0x0){return db[_0x0c4b('0x22')][_0x0c4b('0x43')]({'name':_0x522fe2[_0x0c4b('0x27')],'resourceId':_0x522fe2['id'],'type':_0x345e2a[_0x0c4b('0x27')],'sectionId':_0x345e2a['id']},{})['then'](function(){return _0x1ca0fe;});}else{return _0x1ca0fe;}})['catch'](function(_0x192f05){logger[_0x0c4b('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x192f05);throw _0x192f05;});}return _0x1ca0fe;})[_0x0c4b('0x1f')](respondWithResult(_0x36b27e,0xc9))['catch'](handleError(_0x36b27e,null));};exports['update']=function(_0x24bbbb,_0x2aaa99){if(_0x24bbbb[_0x0c4b('0x44')]['id']){delete _0x24bbbb['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x24bbbb[_0x0c4b('0x41')]['id']}})[_0x0c4b('0x1f')](handleEntityNotFound(_0x2aaa99,null))['then'](saveUpdates(_0x24bbbb[_0x0c4b('0x44')],null))[_0x0c4b('0x1f')](respondWithResult(_0x2aaa99,null))[_0x0c4b('0x42')](handleError(_0x2aaa99,null));};exports['destroy']=function(_0x361791,_0x302092){return db[_0x0c4b('0x2a')][_0x0c4b('0x49')]({'where':{'id':_0x361791[_0x0c4b('0x41')]['id']}})[_0x0c4b('0x1f')](handleEntityNotFound(_0x302092,null))[_0x0c4b('0x1f')](removeEntity(_0x302092,null))[_0x0c4b('0x42')](handleError(_0x302092,null));};exports['download']=function(_0x44f02d,_0x53882f,_0x5c70fe){return db[_0x0c4b('0x2a')][_0x0c4b('0x49')]({'where':{'id':_0x44f02d[_0x0c4b('0x41')]['id']},'attributes':[_0x0c4b('0x27'),_0x0c4b('0x4d'),_0x0c4b('0x4e'),'output'],'raw':!![]})[_0x0c4b('0x1f')](handleEntityNotFound(_0x53882f,null))['then'](function(_0x54aa63){if(_0x54aa63){if(!fs[_0x0c4b('0x4f')](path[_0x0c4b('0x50')](config[_0x0c4b('0x51')],_0x0c4b('0x52'),_0x54aa63['savename']))){throw new db[(_0x0c4b('0x53'))][(_0x0c4b('0x54'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x44f02d[_0x0c4b('0x2e')][_0x0c4b('0x55')]){return _0x53882f['sendStatus'](0xc8);}return _0x53882f['download'](path[_0x0c4b('0x50')](config[_0x0c4b('0x51')],_0x0c4b('0x52'),_0x54aa63[_0x0c4b('0x4e')]),util[_0x0c4b('0x56')](_0x0c4b('0x57'),_0x54aa63[_0x0c4b('0x4d')]||_0x54aa63[_0x0c4b('0x27')],_0x54aa63['output']['toLowerCase']()));}})[_0x0c4b('0x42')](handleError(_0x53882f,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 3a2c1ba..8bc2901 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 _0x1ca6=['./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','util','api','moment','path','rimraf','../../config/environment'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x1ca6,0x1c6));var _0x61ca=function(_0x20f9a9,_0x1536e6){_0x20f9a9=_0x20f9a9-0x0;var _0x273941=_0x1ca6[_0x20f9a9];return _0x273941;};'use strict';var _=require('lodash');var util=require(_0x61ca('0x0'));var logger=require('../../config/logger')(_0x61ca('0x1'));var moment=require(_0x61ca('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x61ca('0x3'));var rimraf=require(_0x61ca('0x4'));var config=require(_0x61ca('0x5'));var attributes=require(_0x61ca('0x6'));module[_0x61ca('0x7')]=function(_0x773b50,_0x183a30){return _0x773b50[_0x61ca('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0x61ca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x398a=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1bd0c4,_0x2405e0){var _0x13a3af=function(_0xe18df9){while(--_0xe18df9){_0x1bd0c4['push'](_0x1bd0c4['shift']());}};_0x13a3af(++_0x2405e0);}(_0x398a,0xe9));var _0xa398=function(_0x2bfad3,_0x3e842c){_0x2bfad3=_0x2bfad3-0x0;var _0x5eb73d=_0x398a[_0x2bfad3];return _0x5eb73d;};'use strict';var _=require(_0xa398('0x0'));var util=require(_0xa398('0x1'));var logger=require(_0xa398('0x2'))(_0xa398('0x3'));var moment=require(_0xa398('0x4'));var BPromise=require(_0xa398('0x5'));var rp=require(_0xa398('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa398('0x7'));module[_0xa398('0x8')]=function(_0x4d89e0,_0xe69622){return _0x4d89e0[_0xa398('0x9')](_0xa398('0xa'),attributes,{'tableName':_0xa398('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 5bae6a7..3ce4de5 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 _0x48e7=['http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x5d00e2,_0x4549d2){var _0x4c1b6f=function(_0x12de4d){while(--_0x12de4d){_0x5d00e2['push'](_0x5d00e2['shift']());}};_0x4c1b6f(++_0x4549d2);}(_0x48e7,0x1db));var _0x748e=function(_0x1b175e,_0x59004f){_0x1b175e=_0x1b175e-0x0;var _0x1c09f9=_0x48e7[_0x1b175e];return _0x1c09f9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x748e('0x0'));var BPromise=require(_0x748e('0x1'));var rs=require(_0x748e('0x2'));var fs=require('fs');var Redis=require(_0x748e('0x3'));var db=require(_0x748e('0x4'))['db'];var utils=require(_0x748e('0x5'));var logger=require('../../config/logger')(_0x748e('0x6'));var config=require(_0x748e('0x7'));var jayson=require(_0x748e('0x8'));var client=jayson['client'][_0x748e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25228f,_0x302198,_0x53edb6){return new BPromise(function(_0x313e39,_0x55e34d){return client[_0x748e('0xa')](_0x25228f,_0x53edb6)[_0x748e('0xb')](function(_0x2050e4){logger[_0x748e('0xc')](_0x748e('0xd'),_0x302198,'request\x20sent');logger[_0x748e('0xe')](_0x748e('0xf'),_0x302198,'request\x20sent',JSON[_0x748e('0x10')](_0x2050e4));if(_0x2050e4[_0x748e('0x11')]){if(_0x2050e4[_0x748e('0x11')][_0x748e('0x12')]===0x1f4){logger[_0x748e('0x11')](_0x748e('0xd'),_0x302198,_0x2050e4[_0x748e('0x11')][_0x748e('0x13')]);return _0x55e34d(_0x2050e4[_0x748e('0x11')][_0x748e('0x13')]);}logger[_0x748e('0x11')](_0x748e('0xd'),_0x302198,_0x2050e4['error'][_0x748e('0x13')]);return _0x313e39(_0x2050e4['error'][_0x748e('0x13')]);}else{logger[_0x748e('0xc')](_0x748e('0xd'),_0x302198,_0x748e('0x14'));_0x313e39(_0x2050e4[_0x748e('0x15')][_0x748e('0x13')]);}})['catch'](function(_0x2d29fb){logger[_0x748e('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x302198,_0x2d29fb);_0x55e34d(_0x2d29fb);});});}
\ No newline at end of file
+var _0x7f5e=['client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x57ebf5,_0x3de518){var _0x2523c6=function(_0x29a242){while(--_0x29a242){_0x57ebf5['push'](_0x57ebf5['shift']());}};_0x2523c6(++_0x3de518);}(_0x7f5e,0x139));var _0xe7f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7f5e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe7f5('0x0'));var util=require(_0xe7f5('0x1'));var moment=require('moment');var BPromise=require(_0xe7f5('0x2'));var rs=require(_0xe7f5('0x3'));var fs=require('fs');var Redis=require(_0xe7f5('0x4'));var db=require(_0xe7f5('0x5'))['db'];var utils=require(_0xe7f5('0x6'));var logger=require(_0xe7f5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe7f5('0x8'));var client=jayson[_0xe7f5('0x9')][_0xe7f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d870f,_0x109d1c,_0x6caf0d){return new BPromise(function(_0x2b528b,_0x2b7095){return client[_0xe7f5('0xb')](_0x3d870f,_0x6caf0d)[_0xe7f5('0xc')](function(_0x304323){logger['info'](_0xe7f5('0xd'),_0x109d1c,_0xe7f5('0xe'));logger[_0xe7f5('0xf')](_0xe7f5('0x10'),_0x109d1c,_0xe7f5('0xe'),JSON['stringify'](_0x304323));if(_0x304323[_0xe7f5('0x11')]){if(_0x304323[_0xe7f5('0x11')][_0xe7f5('0x12')]===0x1f4){logger[_0xe7f5('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x109d1c,_0x304323[_0xe7f5('0x11')][_0xe7f5('0x13')]);return _0x2b7095(_0x304323[_0xe7f5('0x11')][_0xe7f5('0x13')]);}logger['error'](_0xe7f5('0xd'),_0x109d1c,_0x304323['error'][_0xe7f5('0x13')]);return _0x2b528b(_0x304323[_0xe7f5('0x11')][_0xe7f5('0x13')]);}else{logger[_0xe7f5('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x109d1c,_0xe7f5('0xe'));_0x2b528b(_0x304323[_0xe7f5('0x15')][_0xe7f5('0x13')]);}})[_0xe7f5('0x16')](function(_0x5671aa){logger['error'](_0xe7f5('0xd'),_0x109d1c,_0x5671aa);_0x2b7095(_0x5671aa);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index f86b23c..e5bac4a 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 _0xe680=['show','/:id/download','download','post','put','/:id','update','delete','util','path','connect-timeout','Router','../../config/environment','get','isAuthenticated'];(function(_0x19c5f2,_0x44ed13){var _0xb94caf=function(_0x1b3522){while(--_0x1b3522){_0x19c5f2['push'](_0x19c5f2['shift']());}};_0xb94caf(++_0x44ed13);}(_0xe680,0x8f));var _0x0e68=function(_0x2e50a2,_0x27f31e){_0x2e50a2=_0x2e50a2-0x0;var _0x47e5de=_0xe680[_0x2e50a2];return _0x47e5de;};'use strict';var multer=require('multer');var util=require(_0x0e68('0x0'));var path=require(_0x0e68('0x1'));var timeout=require(_0x0e68('0x2'));var express=require('express');var router=express[_0x0e68('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0e68('0x4'));var controller=require('./analyticExtractedReport.controller');router[_0x0e68('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x0e68('0x6')](),controller[_0x0e68('0x7')]);router['get'](_0x0e68('0x8'),auth[_0x0e68('0x6')](),controller[_0x0e68('0x9')]);router[_0x0e68('0xa')]('/',auth[_0x0e68('0x6')](),controller['create']);router[_0x0e68('0xb')](_0x0e68('0xc'),auth[_0x0e68('0x6')](),controller[_0x0e68('0xd')]);router[_0x0e68('0xe')](_0x0e68('0xc'),auth[_0x0e68('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x4d97=['../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','put','delete','destroy','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x3697d0,_0x707b25){var _0x2e0e5a=function(_0x10934a){while(--_0x10934a){_0x3697d0['push'](_0x3697d0['shift']());}};_0x2e0e5a(++_0x707b25);}(_0x4d97,0x11b));var _0x74d9=function(_0x44597b,_0x23e7be){_0x44597b=_0x44597b-0x0;var _0x3ba4e6=_0x4d97[_0x44597b];return _0x3ba4e6;};'use strict';var multer=require('multer');var util=require(_0x74d9('0x0'));var path=require(_0x74d9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x74d9('0x2')]();var fs_extra=require(_0x74d9('0x3'));var auth=require(_0x74d9('0x4'));var interaction=require(_0x74d9('0x5'));var config=require('../../config/environment');var controller=require(_0x74d9('0x6'));router[_0x74d9('0x7')]('/',auth[_0x74d9('0x8')](),controller[_0x74d9('0x9')]);router[_0x74d9('0x7')](_0x74d9('0xa'),auth['isAuthenticated'](),controller[_0x74d9('0xb')]);router[_0x74d9('0x7')](_0x74d9('0xc'),auth[_0x74d9('0x8')](),controller[_0x74d9('0xd')]);router['post']('/',auth[_0x74d9('0x8')](),controller[_0x74d9('0xe')]);router[_0x74d9('0xf')]('/:id',auth[_0x74d9('0x8')](),controller['update']);router[_0x74d9('0x10')]('/:id',auth[_0x74d9('0x8')](),controller[_0x74d9('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 386d97d..309e838 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 _0xfe01=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xfe01,0xee));var _0x1fe0=function(_0x42b04a,_0x5ad2bd){_0x42b04a=_0x42b04a-0x0;var _0x5ea034=_0xfe01[_0x42b04a];return _0x5ea034;};'use strict';var Sequelize=require(_0x1fe0('0x0'));module[_0x1fe0('0x1')]={'field':{'type':Sequelize[_0x1fe0('0x2')]},'alias':{'type':Sequelize[_0x1fe0('0x3')]},'function':{'type':Sequelize[_0x1fe0('0x3')]},'format':{'type':Sequelize[_0x1fe0('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1fe0('0x3')]},'custom':{'type':Sequelize[_0x1fe0('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe303=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x4847c8,_0x1bfbd2){var _0x413de8=function(_0x16b0e0){while(--_0x16b0e0){_0x4847c8['push'](_0x4847c8['shift']());}};_0x413de8(++_0x1bfbd2);}(_0xe303,0x1c9));var _0x3e30=function(_0x2313ed,_0x23179c){_0x2313ed=_0x2313ed-0x0;var _0x409e22=_0xe303[_0x2313ed];return _0x409e22;};'use strict';var Sequelize=require(_0x3e30('0x0'));module[_0x3e30('0x1')]={'field':{'type':Sequelize[_0x3e30('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x3e30('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x3e30('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3e30('0x3')]},'custom':{'type':Sequelize[_0x3e30('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 6bdd8fd..19d841a 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 _0x799b=['fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','AnalyticFieldReport','includeAll','include','findAll','catch','params','body','bulkCreate','update','find','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','save','then','error','stack','name','send','index','rawAttributes'];(function(_0x35db2d,_0x584dd0){var _0x2bbd30=function(_0x504fe7){while(--_0x504fe7){_0x35db2d['push'](_0x35db2d['shift']());}};_0x2bbd30(++_0x584dd0);}(_0x799b,0xcb));var _0xb799=function(_0x5a833b,_0x330316){_0x5a833b=_0x5a833b-0x0;var _0x10cae1=_0x799b[_0x5a833b];return _0x10cae1;};'use strict';var emlformat=require(_0xb799('0x0'));var rimraf=require(_0xb799('0x1'));var zipdir=require(_0xb799('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb799('0x3'));var Mustache=require('mustache');var util=require(_0xb799('0x4'));var path=require(_0xb799('0x5'));var sox=require(_0xb799('0x6'));var csv=require(_0xb799('0x7'));var ejs=require(_0xb799('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb799('0x9'));var squel=require(_0xb799('0xa'));var crypto=require(_0xb799('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb799('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb799('0xd'));var Redis=require(_0xb799('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb799('0xf'));var hardwareService=require(_0xb799('0x10'));var logger=require(_0xb799('0x11'))(_0xb799('0x12'));var utils=require('../../config/utils');var config=require(_0xb799('0x13'));var licenseUtil=require(_0xb799('0x14'));var db=require(_0xb799('0x15'))['db'];function respondWithStatusCode(_0x2aa71f,_0x15e577){_0x15e577=_0x15e577||0xcc;return function(_0x2b25de){if(_0x2b25de){return _0x2aa71f[_0xb799('0x16')](_0x15e577);}return _0x2aa71f['status'](_0x15e577)[_0xb799('0x17')]();};}function respondWithResult(_0x1e9510,_0x19041f){_0x19041f=_0x19041f||0xc8;return function(_0x29f7a9){if(_0x29f7a9){return _0x1e9510[_0xb799('0x18')](_0x19041f)[_0xb799('0x19')](_0x29f7a9);}};}function respondWithFilteredResult(_0x258012,_0x28ae7f){return function(_0xfaaa9f){if(_0xfaaa9f){var _0x326a1c=typeof _0x28ae7f[_0xb799('0x1a')]==='undefined'&&typeof _0x28ae7f[_0xb799('0x1b')]===_0xb799('0x1c');var _0x3e2247=_0xfaaa9f[_0xb799('0x1d')];var _0x1620f3=_0x326a1c?0x0:_0x28ae7f['offset'];var _0x4991fb=_0x326a1c?_0xfaaa9f[_0xb799('0x1d')]:_0x28ae7f[_0xb799('0x1a')]+_0x28ae7f[_0xb799('0x1b')];var _0x17e058;if(_0x4991fb>=_0x3e2247){_0x4991fb=_0x3e2247;_0x17e058=0xc8;}else{_0x17e058=0xce;}_0x258012[_0xb799('0x18')](_0x17e058);return _0x258012['set'](_0xb799('0x1e'),_0x1620f3+'-'+_0x4991fb+'/'+_0x3e2247)[_0xb799('0x19')](_0xfaaa9f);}return null;};}function patchUpdates(_0x41d7f5){return function(_0x594a22){try{jsonpatch[_0xb799('0x1f')](_0x594a22,_0x41d7f5,!![]);}catch(_0x27fce0){return BPromise['reject'](_0x27fce0);}return _0x594a22[_0xb799('0x20')]();};}function saveUpdates(_0x195e9b,_0x349a0a){return function(_0x5c4888){if(_0x5c4888){return _0x5c4888['update'](_0x195e9b)[_0xb799('0x21')](function(_0x3625fc){return _0x3625fc;});}return null;};}function removeEntity(_0x3e9912,_0x4dfa76){return function(_0x5588c2){if(_0x5588c2){return _0x5588c2['destroy']()[_0xb799('0x21')](function(){_0x3e9912[_0xb799('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x232506,_0x346229){return function(_0x158d10){if(!_0x158d10){_0x232506['sendStatus'](0x194);}return _0x158d10;};}function handleError(_0x1ec8c6,_0x500bd2){_0x500bd2=_0x500bd2||0x1f4;return function(_0x4dee36){logger[_0xb799('0x22')](_0x4dee36[_0xb799('0x23')]);if(_0x4dee36[_0xb799('0x24')]){delete _0x4dee36['name'];}_0x1ec8c6[_0xb799('0x18')](_0x500bd2)[_0xb799('0x25')](_0x4dee36);};}exports[_0xb799('0x26')]=function(_0xcb06fc,_0x5c40ac){var _0x2d482f={},_0x1da46e={},_0x16009c={'count':0x0,'rows':[]};var _0x2a6228=_['map'](db['AnalyticFieldReport'][_0xb799('0x27')],function(_0x2d208b){return{'name':_0x2d208b[_0xb799('0x28')],'type':_0x2d208b['type'][_0xb799('0x29')]};});_0x1da46e[_0xb799('0x2a')]=_[_0xb799('0x2b')](_0x2a6228,_0xb799('0x24'));_0x1da46e[_0xb799('0x2c')]=_[_0xb799('0x2d')](_0xcb06fc[_0xb799('0x2c')]);_0x1da46e[_0xb799('0x2e')]=_['intersection'](_0x1da46e[_0xb799('0x2a')],_0x1da46e['query']);_0x2d482f['attributes']=_[_0xb799('0x2f')](_0x1da46e[_0xb799('0x2a')],qs[_0xb799('0x30')](_0xcb06fc[_0xb799('0x2c')][_0xb799('0x30')]));_0x2d482f[_0xb799('0x31')]=_0x2d482f[_0xb799('0x31')][_0xb799('0x32')]?_0x2d482f[_0xb799('0x31')]:_0x1da46e[_0xb799('0x2a')];if(!_0xcb06fc[_0xb799('0x2c')][_0xb799('0x33')](_0xb799('0x34'))){_0x2d482f[_0xb799('0x1b')]=qs['limit'](_0xcb06fc[_0xb799('0x2c')][_0xb799('0x1b')]);_0x2d482f[_0xb799('0x1a')]=qs[_0xb799('0x1a')](_0xcb06fc[_0xb799('0x2c')]['offset']);}_0x2d482f[_0xb799('0x35')]=qs['sort'](_0xcb06fc[_0xb799('0x2c')][_0xb799('0x36')]);_0x2d482f['where']=qs[_0xb799('0x2e')](_[_0xb799('0x37')](_0xcb06fc[_0xb799('0x2c')],_0x1da46e[_0xb799('0x2e')]),_0x2a6228);if(_0xcb06fc[_0xb799('0x2c')][_0xb799('0x38')]){_0x2d482f['where']=_[_0xb799('0x39')](_0x2d482f[_0xb799('0x3a')],{'$or':_[_0xb799('0x2b')](_0x2a6228,function(_0xc720e1){if(_0xc720e1[_0xb799('0x3b')]!==_0xb799('0x3c')){var _0x1acb95={};_0x1acb95[_0xc720e1[_0xb799('0x24')]]={'$like':'%'+_0xcb06fc['query']['filter']+'%'};return _0x1acb95;}})});}_0x2d482f=_[_0xb799('0x39')]({},_0x2d482f,_0xcb06fc[_0xb799('0x3d')]);var _0x5d1fbc={'where':_0x2d482f['where']};return db[_0xb799('0x3e')][_0xb799('0x1d')](_0x5d1fbc)[_0xb799('0x21')](function(_0x55ac2d){_0x16009c['count']=_0x55ac2d;if(_0xcb06fc[_0xb799('0x2c')][_0xb799('0x3f')]){_0x2d482f[_0xb799('0x40')]=[{'all':!![]}];}return db[_0xb799('0x3e')][_0xb799('0x41')](_0x2d482f);})[_0xb799('0x21')](function(_0x2833cb){_0x16009c['rows']=_0x2833cb;return _0x16009c;})[_0xb799('0x21')](respondWithFilteredResult(_0x5c40ac,_0x2d482f))[_0xb799('0x42')](handleError(_0x5c40ac,null));};exports['show']=function(_0x5d0994,_0x313f40){var _0xe803bc={'raw':![],'where':{'id':_0x5d0994[_0xb799('0x43')]['id']}},_0x12af32={};_0x12af32[_0xb799('0x2a')]=_[_0xb799('0x2d')](db[_0xb799('0x3e')][_0xb799('0x27')]);_0x12af32['query']=_[_0xb799('0x2d')](_0x5d0994['query']);_0x12af32[_0xb799('0x2e')]=_[_0xb799('0x2f')](_0x12af32[_0xb799('0x2a')],_0x12af32[_0xb799('0x2c')]);_0xe803bc[_0xb799('0x31')]=_[_0xb799('0x2f')](_0x12af32['model'],qs['fields'](_0x5d0994[_0xb799('0x2c')][_0xb799('0x30')]));_0xe803bc['attributes']=_0xe803bc[_0xb799('0x31')]['length']?_0xe803bc[_0xb799('0x31')]:_0x12af32[_0xb799('0x2a')];if(_0x5d0994['query']['includeAll']){_0xe803bc[_0xb799('0x40')]=[{'all':!![]}];}_0xe803bc=_[_0xb799('0x39')]({},_0xe803bc,_0x5d0994[_0xb799('0x3d')]);return db[_0xb799('0x3e')]['find'](_0xe803bc)[_0xb799('0x21')](handleEntityNotFound(_0x313f40,null))[_0xb799('0x21')](respondWithResult(_0x313f40,null))['catch'](handleError(_0x313f40,null));};exports['create']=function(_0x1a343e,_0x28284b){return db['AnalyticFieldReport']['create'](_0x1a343e[_0xb799('0x44')],{})[_0xb799('0x21')](respondWithResult(_0x28284b,0xc9))['catch'](handleError(_0x28284b,null));};exports['bulkCreate']=function(_0xffca4,_0x363bb8){return db[_0xb799('0x3e')][_0xb799('0x45')](_0xffca4[_0xb799('0x44')],{'raw':![],'individualHooks':!![]})[_0xb799('0x21')](respondWithResult(_0x363bb8,0xc9))['catch'](handleError(_0x363bb8,null));};exports[_0xb799('0x46')]=function(_0x17f980,_0x38882c){if(_0x17f980[_0xb799('0x44')]['id']){delete _0x17f980['body']['id'];}return db['AnalyticFieldReport'][_0xb799('0x47')]({'where':{'id':_0x17f980[_0xb799('0x43')]['id']}})[_0xb799('0x21')](handleEntityNotFound(_0x38882c,null))[_0xb799('0x21')](saveUpdates(_0x17f980[_0xb799('0x44')],null))['then'](respondWithResult(_0x38882c,null))['catch'](handleError(_0x38882c,null));};exports[_0xb799('0x48')]=function(_0x3195cf,_0x35af8f){return db[_0xb799('0x3e')][_0xb799('0x47')]({'where':{'id':_0x3195cf[_0xb799('0x43')]['id']}})[_0xb799('0x21')](handleEntityNotFound(_0x35af8f,null))[_0xb799('0x21')](removeEntity(_0x35af8f,null))[_0xb799('0x42')](handleError(_0x35af8f,null));};exports[_0xb799('0x49')]=function(_0x12f557,_0x2a1a64){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x12f557[_0xb799('0x2c')][_0xb799('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xb799('0x21')](respondWithResult(_0x2a1a64,0xcc))['catch'](handleError(_0x2a1a64,null));};exports[_0xb799('0x4b')]=function(_0x9f0a83,_0x3a0928,_0x5e5306){return db[_0xb799('0x4c')][_0xb799('0x4d')]({'where':{'id':_0x9f0a83[_0xb799('0x43')]['id']}})[_0xb799('0x21')](handleEntityNotFound(_0x3a0928,null))['then'](function(_0x517a85){if(_0x517a85){return db[_0xb799('0x4e')][_0xb799('0x4f')](function(_0x60edea){return db[_0xb799('0x3e')]['destroy']({'where':{'CustomReportId':_0x9f0a83['params']['id']},'transaction':_0x60edea})[_0xb799('0x21')](function(_0x5791b6){var _0x87e5ba=_['map'](_0x9f0a83[_0xb799('0x44')],function(_0x130d54){delete _0x130d54['id'];_0x130d54[_0xb799('0x50')]=_0x9f0a83['params']['id'];return _0x130d54;});return db['AnalyticFieldReport'][_0xb799('0x45')](_0x87e5ba,{'transaction':_0x60edea});});})[_0xb799('0x21')](function(){return db[_0xb799('0x3e')][_0xb799('0x41')]({'where':{'CustomReportId':_0x9f0a83['params']['id']}});});}})['then'](respondWithResult(_0x3a0928,null))[_0xb799('0x42')](handleError(_0x3a0928,null));};
\ No newline at end of file
+var _0x91fa=['fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','apply','reject','update','then','destroy','end','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','create','body','bulkCreate','find','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir'];(function(_0x48afe4,_0x43f02b){var _0x3f17b4=function(_0x23a0cf){while(--_0x23a0cf){_0x48afe4['push'](_0x48afe4['shift']());}};_0x3f17b4(++_0x43f02b);}(_0x91fa,0x1ab));var _0xa91f=function(_0x3167b1,_0x5ad266){_0x3167b1=_0x3167b1-0x0;var _0x362152=_0x91fa[_0x3167b1];return _0x362152;};'use strict';var emlformat=require(_0xa91f('0x0'));var rimraf=require(_0xa91f('0x1'));var zipdir=require(_0xa91f('0x2'));var jsonpatch=require(_0xa91f('0x3'));var rp=require(_0xa91f('0x4'));var moment=require('moment');var BPromise=require(_0xa91f('0x5'));var Mustache=require(_0xa91f('0x6'));var util=require('util');var path=require(_0xa91f('0x7'));var sox=require(_0xa91f('0x8'));var csv=require(_0xa91f('0x9'));var ejs=require(_0xa91f('0xa'));var fs=require('fs');var fs_extra=require(_0xa91f('0xb'));var _=require(_0xa91f('0xc'));var squel=require(_0xa91f('0xd'));var crypto=require(_0xa91f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa91f('0xf'));var toCsv=require(_0xa91f('0x9'));var querystring=require(_0xa91f('0x10'));var Papa=require(_0xa91f('0x11'));var Redis=require(_0xa91f('0x12'));var authService=require(_0xa91f('0x13'));var qs=require(_0xa91f('0x14'));var as=require(_0xa91f('0x15'));var hardwareService=require(_0xa91f('0x16'));var logger=require(_0xa91f('0x17'))(_0xa91f('0x18'));var utils=require(_0xa91f('0x19'));var config=require(_0xa91f('0x1a'));var licenseUtil=require(_0xa91f('0x1b'));var db=require(_0xa91f('0x1c'))['db'];function respondWithStatusCode(_0x9df49d,_0x5339f0){_0x5339f0=_0x5339f0||0xcc;return function(_0x167452){if(_0x167452){return _0x9df49d[_0xa91f('0x1d')](_0x5339f0);}return _0x9df49d[_0xa91f('0x1e')](_0x5339f0)['end']();};}function respondWithResult(_0xc89093,_0x576eff){_0x576eff=_0x576eff||0xc8;return function(_0x502f0a){if(_0x502f0a){return _0xc89093['status'](_0x576eff)[_0xa91f('0x1f')](_0x502f0a);}};}function respondWithFilteredResult(_0x2282cd,_0x2ac9b7){return function(_0x45b837){if(_0x45b837){var _0x2d3b32=typeof _0x2ac9b7[_0xa91f('0x20')]===_0xa91f('0x21')&&typeof _0x2ac9b7['limit']===_0xa91f('0x21');var _0x4f2745=_0x45b837['count'];var _0x199bfb=_0x2d3b32?0x0:_0x2ac9b7['offset'];var _0x1cda4c=_0x2d3b32?_0x45b837['count']:_0x2ac9b7[_0xa91f('0x20')]+_0x2ac9b7[_0xa91f('0x22')];var _0x464f02;if(_0x1cda4c>=_0x4f2745){_0x1cda4c=_0x4f2745;_0x464f02=0xc8;}else{_0x464f02=0xce;}_0x2282cd[_0xa91f('0x1e')](_0x464f02);return _0x2282cd[_0xa91f('0x23')]('Content-Range',_0x199bfb+'-'+_0x1cda4c+'/'+_0x4f2745)[_0xa91f('0x1f')](_0x45b837);}return null;};}function patchUpdates(_0xb2bb5b){return function(_0x5c6e2a){try{jsonpatch[_0xa91f('0x24')](_0x5c6e2a,_0xb2bb5b,!![]);}catch(_0x995bc7){return BPromise[_0xa91f('0x25')](_0x995bc7);}return _0x5c6e2a['save']();};}function saveUpdates(_0x3a0f16,_0xbf7498){return function(_0x42294d){if(_0x42294d){return _0x42294d[_0xa91f('0x26')](_0x3a0f16)[_0xa91f('0x27')](function(_0x3f8979){return _0x3f8979;});}return null;};}function removeEntity(_0x2979d2,_0x276ba0){return function(_0x513e47){if(_0x513e47){return _0x513e47[_0xa91f('0x28')]()[_0xa91f('0x27')](function(){_0x2979d2[_0xa91f('0x1e')](0xcc)[_0xa91f('0x29')]();});}};}function handleEntityNotFound(_0x2f6115,_0x105298){return function(_0x4935f7){if(!_0x4935f7){_0x2f6115[_0xa91f('0x1d')](0x194);}return _0x4935f7;};}function handleError(_0x5ae887,_0x317ba8){_0x317ba8=_0x317ba8||0x1f4;return function(_0x5a3879){logger['error'](_0x5a3879[_0xa91f('0x2a')]);if(_0x5a3879['name']){delete _0x5a3879[_0xa91f('0x2b')];}_0x5ae887[_0xa91f('0x1e')](_0x317ba8)[_0xa91f('0x2c')](_0x5a3879);};}exports[_0xa91f('0x2d')]=function(_0x1c1779,_0x56a368){var _0x8f69d9={},_0x439a53={},_0x181386={'count':0x0,'rows':[]};var _0x16bd28=_['map'](db[_0xa91f('0x2e')][_0xa91f('0x2f')],function(_0x4aa8b3){return{'name':_0x4aa8b3[_0xa91f('0x30')],'type':_0x4aa8b3[_0xa91f('0x31')][_0xa91f('0x32')]};});_0x439a53[_0xa91f('0x33')]=_['map'](_0x16bd28,_0xa91f('0x2b'));_0x439a53[_0xa91f('0x34')]=_['keys'](_0x1c1779['query']);_0x439a53[_0xa91f('0x35')]=_[_0xa91f('0x36')](_0x439a53[_0xa91f('0x33')],_0x439a53['query']);_0x8f69d9[_0xa91f('0x37')]=_[_0xa91f('0x36')](_0x439a53[_0xa91f('0x33')],qs[_0xa91f('0x38')](_0x1c1779[_0xa91f('0x34')][_0xa91f('0x38')]));_0x8f69d9[_0xa91f('0x37')]=_0x8f69d9[_0xa91f('0x37')][_0xa91f('0x39')]?_0x8f69d9[_0xa91f('0x37')]:_0x439a53[_0xa91f('0x33')];if(!_0x1c1779[_0xa91f('0x34')]['hasOwnProperty'](_0xa91f('0x3a'))){_0x8f69d9['limit']=qs[_0xa91f('0x22')](_0x1c1779['query'][_0xa91f('0x22')]);_0x8f69d9[_0xa91f('0x20')]=qs[_0xa91f('0x20')](_0x1c1779[_0xa91f('0x34')][_0xa91f('0x20')]);}_0x8f69d9[_0xa91f('0x3b')]=qs[_0xa91f('0x3c')](_0x1c1779[_0xa91f('0x34')][_0xa91f('0x3c')]);_0x8f69d9['where']=qs['filters'](_[_0xa91f('0x3d')](_0x1c1779['query'],_0x439a53[_0xa91f('0x35')]),_0x16bd28);if(_0x1c1779[_0xa91f('0x34')][_0xa91f('0x3e')]){_0x8f69d9[_0xa91f('0x3f')]=_[_0xa91f('0x40')](_0x8f69d9['where'],{'$or':_[_0xa91f('0x41')](_0x16bd28,function(_0x31665d){if(_0x31665d[_0xa91f('0x31')]!==_0xa91f('0x42')){var _0x10cf7a={};_0x10cf7a[_0x31665d[_0xa91f('0x2b')]]={'$like':'%'+_0x1c1779['query'][_0xa91f('0x3e')]+'%'};return _0x10cf7a;}})});}_0x8f69d9=_[_0xa91f('0x40')]({},_0x8f69d9,_0x1c1779[_0xa91f('0x43')]);var _0x1af87f={'where':_0x8f69d9[_0xa91f('0x3f')]};return db[_0xa91f('0x2e')][_0xa91f('0x44')](_0x1af87f)[_0xa91f('0x27')](function(_0x25ade2){_0x181386['count']=_0x25ade2;if(_0x1c1779[_0xa91f('0x34')][_0xa91f('0x45')]){_0x8f69d9[_0xa91f('0x46')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa91f('0x47')](_0x8f69d9);})[_0xa91f('0x27')](function(_0x3c7222){_0x181386['rows']=_0x3c7222;return _0x181386;})['then'](respondWithFilteredResult(_0x56a368,_0x8f69d9))[_0xa91f('0x48')](handleError(_0x56a368,null));};exports[_0xa91f('0x49')]=function(_0x5a992d,_0x5b9f86){var _0x3dc18e={'raw':![],'where':{'id':_0x5a992d[_0xa91f('0x4a')]['id']}},_0x380f9f={};_0x380f9f[_0xa91f('0x33')]=_['keys'](db[_0xa91f('0x2e')][_0xa91f('0x2f')]);_0x380f9f[_0xa91f('0x34')]=_['keys'](_0x5a992d[_0xa91f('0x34')]);_0x380f9f[_0xa91f('0x35')]=_['intersection'](_0x380f9f[_0xa91f('0x33')],_0x380f9f[_0xa91f('0x34')]);_0x3dc18e[_0xa91f('0x37')]=_[_0xa91f('0x36')](_0x380f9f['model'],qs[_0xa91f('0x38')](_0x5a992d['query'][_0xa91f('0x38')]));_0x3dc18e[_0xa91f('0x37')]=_0x3dc18e[_0xa91f('0x37')][_0xa91f('0x39')]?_0x3dc18e[_0xa91f('0x37')]:_0x380f9f['model'];if(_0x5a992d[_0xa91f('0x34')][_0xa91f('0x45')]){_0x3dc18e[_0xa91f('0x46')]=[{'all':!![]}];}_0x3dc18e=_[_0xa91f('0x40')]({},_0x3dc18e,_0x5a992d[_0xa91f('0x43')]);return db[_0xa91f('0x2e')]['find'](_0x3dc18e)['then'](handleEntityNotFound(_0x5b9f86,null))[_0xa91f('0x27')](respondWithResult(_0x5b9f86,null))[_0xa91f('0x48')](handleError(_0x5b9f86,null));};exports[_0xa91f('0x4b')]=function(_0x30871c,_0x19ec1a){return db[_0xa91f('0x2e')][_0xa91f('0x4b')](_0x30871c[_0xa91f('0x4c')],{})[_0xa91f('0x27')](respondWithResult(_0x19ec1a,0xc9))[_0xa91f('0x48')](handleError(_0x19ec1a,null));};exports[_0xa91f('0x4d')]=function(_0x4b94eb,_0x17f795){return db[_0xa91f('0x2e')][_0xa91f('0x4d')](_0x4b94eb[_0xa91f('0x4c')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x17f795,0xc9))[_0xa91f('0x48')](handleError(_0x17f795,null));};exports[_0xa91f('0x26')]=function(_0x24eaaa,_0x64651d){if(_0x24eaaa[_0xa91f('0x4c')]['id']){delete _0x24eaaa[_0xa91f('0x4c')]['id'];}return db[_0xa91f('0x2e')][_0xa91f('0x4e')]({'where':{'id':_0x24eaaa['params']['id']}})['then'](handleEntityNotFound(_0x64651d,null))[_0xa91f('0x27')](saveUpdates(_0x24eaaa[_0xa91f('0x4c')],null))['then'](respondWithResult(_0x64651d,null))[_0xa91f('0x48')](handleError(_0x64651d,null));};exports['destroy']=function(_0x8c52c2,_0x2f130d){return db[_0xa91f('0x2e')][_0xa91f('0x4e')]({'where':{'id':_0x8c52c2[_0xa91f('0x4a')]['id']}})[_0xa91f('0x27')](handleEntityNotFound(_0x2f130d,null))['then'](removeEntity(_0x2f130d,null))[_0xa91f('0x48')](handleError(_0x2f130d,null));};exports[_0xa91f('0x4f')]=function(_0x25ccee,_0x855825){return db[_0xa91f('0x2e')][_0xa91f('0x28')]({'where':{'id':_0x25ccee[_0xa91f('0x34')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xa91f('0x27')](respondWithResult(_0x855825,0xcc))[_0xa91f('0x48')](handleError(_0x855825,null));};exports[_0xa91f('0x50')]=function(_0x443fa5,_0x2990a7,_0x5eee01){return db[_0xa91f('0x51')][_0xa91f('0x52')]({'where':{'id':_0x443fa5[_0xa91f('0x4a')]['id']}})[_0xa91f('0x27')](handleEntityNotFound(_0x2990a7,null))[_0xa91f('0x27')](function(_0x1a5219){if(_0x1a5219){return db[_0xa91f('0x53')][_0xa91f('0x54')](function(_0x1c1c9c){return db[_0xa91f('0x2e')][_0xa91f('0x28')]({'where':{'CustomReportId':_0x443fa5[_0xa91f('0x4a')]['id']},'transaction':_0x1c1c9c})[_0xa91f('0x27')](function(_0x1ca880){var _0x37b67a=_['map'](_0x443fa5[_0xa91f('0x4c')],function(_0x589f0b){delete _0x589f0b['id'];_0x589f0b[_0xa91f('0x55')]=_0x443fa5['params']['id'];return _0x589f0b;});return db[_0xa91f('0x2e')][_0xa91f('0x4d')](_0x37b67a,{'transaction':_0x1c1c9c});});})['then'](function(){return db[_0xa91f('0x2e')]['findAll']({'where':{'CustomReportId':_0x443fa5[_0xa91f('0x4a')]['id']}});});}})[_0xa91f('0x27')](respondWithResult(_0x2990a7,null))['catch'](handleError(_0x2990a7,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 6fe3971..0f74f02 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 _0xe759=['define','analytics_report_fields','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3f9979,_0x3ffc24){var _0x1c583f=function(_0x76833c){while(--_0x76833c){_0x3f9979['push'](_0x3f9979['shift']());}};_0x1c583f(++_0x3ffc24);}(_0xe759,0x124));var _0x9e75=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xe759[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x9e75('0x0'));var logger=require(_0x9e75('0x1'))('api');var moment=require(_0x9e75('0x2'));var BPromise=require('bluebird');var rp=require(_0x9e75('0x3'));var fs=require('fs');var path=require(_0x9e75('0x4'));var rimraf=require(_0x9e75('0x5'));var config=require(_0x9e75('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0x9e75('0x7')]=function(_0x5378e2,_0x2fa6de){return _0x5378e2[_0x9e75('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0x9e75('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x40e3=['../../config/environment','exports','define','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3a05a7,_0x311feb){var _0x5edd08=function(_0x404ea3){while(--_0x404ea3){_0x3a05a7['push'](_0x3a05a7['shift']());}};_0x5edd08(++_0x311feb);}(_0x40e3,0x154));var _0x340e=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0x40e3[_0x2ae2ad];return _0x26dbd7;};'use strict';var _=require(_0x340e('0x0'));var util=require(_0x340e('0x1'));var logger=require(_0x340e('0x2'))(_0x340e('0x3'));var moment=require(_0x340e('0x4'));var BPromise=require(_0x340e('0x5'));var rp=require(_0x340e('0x6'));var fs=require('fs');var path=require(_0x340e('0x7'));var rimraf=require('rimraf');var config=require(_0x340e('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0x340e('0x9')]=function(_0x3a8f39,_0x2a811e){return _0x3a8f39[_0x340e('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x340e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 60ab2a1..dd614f9 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 _0x0046=['request\x20sent','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','rpc','../../config/environment','client','http','request','then','info'];(function(_0x331564,_0xf2516a){var _0x2ba08f=function(_0x52ac16){while(--_0x52ac16){_0x331564['push'](_0x331564['shift']());}};_0x2ba08f(++_0xf2516a);}(_0x0046,0x139));var _0x6004=function(_0x530dc8,_0x3f034d){_0x530dc8=_0x530dc8-0x0;var _0x3e481b=_0x0046[_0x530dc8];return _0x3e481b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6004('0x0'));var BPromise=require(_0x6004('0x1'));var rs=require(_0x6004('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6004('0x3'));var config=require(_0x6004('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x6004('0x5')][_0x6004('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x15ecad,_0x1ff228,_0x4a34e3){return new BPromise(function(_0x4bd755,_0x28f430){return client[_0x6004('0x7')](_0x15ecad,_0x4a34e3)[_0x6004('0x8')](function(_0x143310){logger[_0x6004('0x9')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1ff228,_0x6004('0xa'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1ff228,_0x6004('0xa'),JSON['stringify'](_0x143310));if(_0x143310[_0x6004('0xb')]){if(_0x143310[_0x6004('0xb')][_0x6004('0xc')]===0x1f4){logger[_0x6004('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1ff228,_0x143310[_0x6004('0xb')][_0x6004('0xd')]);return _0x28f430(_0x143310[_0x6004('0xb')][_0x6004('0xd')]);}logger[_0x6004('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1ff228,_0x143310[_0x6004('0xb')][_0x6004('0xd')]);return _0x4bd755(_0x143310['error'][_0x6004('0xd')]);}else{logger[_0x6004('0x9')](_0x6004('0xe'),_0x1ff228,_0x6004('0xa'));_0x4bd755(_0x143310[_0x6004('0xf')][_0x6004('0xd')]);}})[_0x6004('0x10')](function(_0x242541){logger[_0x6004('0xb')](_0x6004('0xe'),_0x1ff228,_0x242541);_0x28f430(_0x242541);});});}
\ No newline at end of file
+var _0x7329=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird'];(function(_0x21bfce,_0x4c2c80){var _0x1cd9e0=function(_0x3fb74c){while(--_0x3fb74c){_0x21bfce['push'](_0x21bfce['shift']());}};_0x1cd9e0(++_0x4c2c80);}(_0x7329,0xe3));var _0x9732=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0x7329[_0x528575];return _0x3063b7;};'use strict';var _=require(_0x9732('0x0'));var util=require('util');var moment=require(_0x9732('0x1'));var BPromise=require(_0x9732('0x2'));var rs=require(_0x9732('0x3'));var fs=require('fs');var Redis=require(_0x9732('0x4'));var db=require(_0x9732('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9732('0x6'))(_0x9732('0x7'));var config=require(_0x9732('0x8'));var jayson=require(_0x9732('0x9'));var client=jayson[_0x9732('0xa')][_0x9732('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18504a,_0xb7a52f,_0xfed98f){return new BPromise(function(_0x3ddb66,_0x2bca4d){return client[_0x9732('0xc')](_0x18504a,_0xfed98f)[_0x9732('0xd')](function(_0x9d9aa2){logger[_0x9732('0xe')](_0x9732('0xf'),_0xb7a52f,_0x9732('0x10'));logger[_0x9732('0x11')](_0x9732('0x12'),_0xb7a52f,'request\x20sent',JSON['stringify'](_0x9d9aa2));if(_0x9d9aa2[_0x9732('0x13')]){if(_0x9d9aa2['error']['code']===0x1f4){logger[_0x9732('0x13')](_0x9732('0xf'),_0xb7a52f,_0x9d9aa2['error'][_0x9732('0x14')]);return _0x2bca4d(_0x9d9aa2['error']['message']);}logger[_0x9732('0x13')](_0x9732('0xf'),_0xb7a52f,_0x9d9aa2[_0x9732('0x13')]['message']);return _0x3ddb66(_0x9d9aa2[_0x9732('0x13')][_0x9732('0x14')]);}else{logger['info'](_0x9732('0xf'),_0xb7a52f,_0x9732('0x10'));_0x3ddb66(_0x9d9aa2[_0x9732('0x15')][_0x9732('0x14')]);}})[_0x9732('0x16')](function(_0x463ebf){logger[_0x9732('0x13')](_0x9732('0xf'),_0xb7a52f,_0x463ebf);_0x2bca4d(_0x463ebf);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index dbd111d..ae4a6aa 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(_0x3e1f72,_0x303482){var _0x2c5221=function(_0xfc83c1){while(--_0xfc83c1){_0x3e1f72['push'](_0x3e1f72['shift']());}};_0x2c5221(++_0x303482);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x388228,_0x431132){var _0x4246f9=function(_0x2778f7){while(--_0x2778f7){_0x388228['push'](_0x388228['shift']());}};_0x4246f9(++_0x431132);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 34258be..53caab9 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 _0x6a55=['sequelize','STRING','name','TEXT'];(function(_0x223af1,_0x408d59){var _0x1a3d69=function(_0x15fdcf){while(--_0x15fdcf){_0x223af1['push'](_0x223af1['shift']());}};_0x1a3d69(++_0x408d59);}(_0x6a55,0x154));var _0x56a5=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0x6a55[_0x50e593];return _0x3821d0;};'use strict';var Sequelize=require(_0x56a5('0x0'));module['exports']={'name':{'type':Sequelize[_0x56a5('0x1')],'allowNull':![],'unique':_0x56a5('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x56a5('0x3')]},'description':{'type':Sequelize[_0x56a5('0x1')]}};
\ No newline at end of file
+var _0xc900=['name','STRING'];(function(_0xf5dbed,_0x28884b){var _0x1b102f=function(_0x198396){while(--_0x198396){_0xf5dbed['push'](_0xf5dbed['shift']());}};_0x1b102f(++_0x28884b);}(_0xc900,0xb3));var _0x0c90=function(_0x1c4801,_0x2ad6bf){_0x1c4801=_0x1c4801-0x0;var _0x452caa=_0xc900[_0x1c4801];return _0x452caa;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0c90('0x0')],'allowNull':![],'unique':_0x0c90('0x1')},'table':{'type':Sequelize[_0x0c90('0x0')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x0c90('0x0')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index ef5abf0..4de03d5 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 _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0xc19cae,_0x26f14e){var _0x2e7f6f=function(_0x432b1a){while(--_0x432b1a){_0xc19cae['push'](_0xc19cae['shift']());}};_0x2e7f6f(++_0x26f14e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2c9b79,_0x7cf58b){_0x2c9b79=_0x2c9b79-0x0;var _0x265032=_0x5fc3[_0x2c9b79];return _0x265032;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,null));};
\ No newline at end of file
+var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../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','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1c16a7,_0x5cb6ae){var _0x2a9b65=function(_0x546d2f){while(--_0x546d2f){_0x1c16a7['push'](_0x1c16a7['shift']());}};_0x2a9b65(++_0x5cb6ae);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0x7fbe[_0x2cd1fb];return _0x48fd2b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 452ed4d..9e8fc12 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 _0x4819=['analytics_metrics','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','AnalyticMetric'];(function(_0x2e640b,_0x5a4e00){var _0x335894=function(_0x457b2b){while(--_0x457b2b){_0x2e640b['push'](_0x2e640b['shift']());}};_0x335894(++_0x5a4e00);}(_0x4819,0xcd));var _0x9481=function(_0xba0c2,_0x54cc50){_0xba0c2=_0xba0c2-0x0;var _0x5a9fa0=_0x4819[_0xba0c2];return _0x5a9fa0;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x39e6=['exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x265829,_0x3fe6a0){var _0x4b9dd4=function(_0x168a69){while(--_0x168a69){_0x265829['push'](_0x265829['shift']());}};_0x4b9dd4(++_0x3fe6a0);}(_0x39e6,0x9e));var _0x639e=function(_0x211918,_0x1c062a){_0x211918=_0x211918-0x0;var _0x2bf94f=_0x39e6[_0x211918];return _0x2bf94f;};'use strict';var _=require(_0x639e('0x0'));var util=require('util');var logger=require(_0x639e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x639e('0x2'));var rp=require(_0x639e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x639e('0x4'));var config=require(_0x639e('0x5'));var attributes=require(_0x639e('0x6'));module[_0x639e('0x7')]=function(_0x15e5df,_0x320448){return _0x15e5df[_0x639e('0x8')](_0x639e('0x9'),attributes,{'tableName':_0x639e('0xa'),'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 ee1b8db..a2d73ab 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 _0x34b6=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','../../config/utils','rpc'];(function(_0x2379cf,_0x365a43){var _0x2ae3cf=function(_0x3b8068){while(--_0x3b8068){_0x2379cf['push'](_0x2379cf['shift']());}};_0x2ae3cf(++_0x365a43);}(_0x34b6,0x19f));var _0x634b=function(_0x5062db,_0x1894fb){_0x5062db=_0x5062db-0x0;var _0x389f5=_0x34b6[_0x5062db];return _0x389f5;};'use strict';var _=require('lodash');var util=require(_0x634b('0x0'));var moment=require('moment');var BPromise=require(_0x634b('0x1'));var rs=require(_0x634b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x634b('0x3'));var logger=require('../../config/logger')(_0x634b('0x4'));var config=require(_0x634b('0x5'));var jayson=require(_0x634b('0x6'));var client=jayson[_0x634b('0x7')][_0x634b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d8b33,_0xccbb0c,_0x4e65fa){return new BPromise(function(_0x6ad15f,_0x21a378){return client[_0x634b('0x9')](_0x2d8b33,_0x4e65fa)[_0x634b('0xa')](function(_0x60911d){logger[_0x634b('0xb')](_0x634b('0xc'),_0xccbb0c,'request\x20sent');logger['debug'](_0x634b('0xd'),_0xccbb0c,_0x634b('0xe'),JSON[_0x634b('0xf')](_0x60911d));if(_0x60911d[_0x634b('0x10')]){if(_0x60911d[_0x634b('0x10')][_0x634b('0x11')]===0x1f4){logger['error'](_0x634b('0xc'),_0xccbb0c,_0x60911d['error'][_0x634b('0x12')]);return _0x21a378(_0x60911d[_0x634b('0x10')][_0x634b('0x12')]);}logger[_0x634b('0x10')](_0x634b('0xc'),_0xccbb0c,_0x60911d[_0x634b('0x10')]['message']);return _0x6ad15f(_0x60911d[_0x634b('0x10')][_0x634b('0x12')]);}else{logger[_0x634b('0xb')](_0x634b('0xc'),_0xccbb0c,_0x634b('0xe'));_0x6ad15f(_0x60911d[_0x634b('0x13')][_0x634b('0x12')]);}})[_0x634b('0x14')](function(_0x41a86f){logger[_0x634b('0x10')](_0x634b('0xc'),_0xccbb0c,_0x41a86f);_0x21a378(_0x41a86f);});});}
\ No newline at end of file
+var _0x8088=['error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8088,0xb5));var _0x8808=function(_0x5e9ad3,_0x548e04){_0x5e9ad3=_0x5e9ad3-0x0;var _0x32c8dd=_0x8088[_0x5e9ad3];return _0x32c8dd;};'use strict';var _=require(_0x8808('0x0'));var util=require(_0x8808('0x1'));var moment=require(_0x8808('0x2'));var BPromise=require(_0x8808('0x3'));var rs=require(_0x8808('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8808('0x5'))['db'];var utils=require(_0x8808('0x6'));var logger=require('../../config/logger')(_0x8808('0x7'));var config=require(_0x8808('0x8'));var jayson=require(_0x8808('0x9'));var client=jayson[_0x8808('0xa')][_0x8808('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13378e,_0x5f018d,_0x7d2af2){return new BPromise(function(_0x1c4563,_0x984db1){return client['request'](_0x13378e,_0x7d2af2)[_0x8808('0xc')](function(_0x158e96){logger[_0x8808('0xd')](_0x8808('0xe'),_0x5f018d,'request\x20sent');logger['debug'](_0x8808('0xf'),_0x5f018d,'request\x20sent',JSON[_0x8808('0x10')](_0x158e96));if(_0x158e96['error']){if(_0x158e96[_0x8808('0x11')]['code']===0x1f4){logger[_0x8808('0x11')](_0x8808('0xe'),_0x5f018d,_0x158e96['error']['message']);return _0x984db1(_0x158e96[_0x8808('0x11')]['message']);}logger[_0x8808('0x11')](_0x8808('0xe'),_0x5f018d,_0x158e96[_0x8808('0x11')][_0x8808('0x12')]);return _0x1c4563(_0x158e96[_0x8808('0x11')]['message']);}else{logger[_0x8808('0xd')](_0x8808('0xe'),_0x5f018d,_0x8808('0x13'));_0x1c4563(_0x158e96[_0x8808('0x14')][_0x8808('0x12')]);}})[_0x8808('0x15')](function(_0x1ec433){logger[_0x8808('0x11')](_0x8808('0xe'),_0x5f018d,_0x1ec433);_0x984db1(_0x1ec433);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 8c76476..e5c2ff2 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 _0x3eea=['get','isAuthenticated','/:id','show','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x51853c,_0x3a5d99){var _0x31eb5=function(_0xd2cf74){while(--_0xd2cf74){_0x51853c['push'](_0x51853c['shift']());}};_0x31eb5(++_0x3a5d99);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x5d4c9a,_0x344495){_0x5d4c9a=_0x5d4c9a-0x0;var _0x5e771f=_0x3eea[_0x5d4c9a];return _0x5e771f;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')]('/',auth[_0xa3ee('0xb')](),controller['index']);router['get'](_0xa3ee('0xc'),auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['post']('/',auth[_0xa3ee('0xb')](),controller['create']);router[_0xa3ee('0xe')]('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0xf')]);router[_0xa3ee('0x10')]('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x8832=['fs-extra','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','show','create','put','/:id','update','multer','util','express','Router'];(function(_0x31f0d5,_0x4b76e3){var _0x55253f=function(_0x19448f){while(--_0x19448f){_0x31f0d5['push'](_0x31f0d5['shift']());}};_0x55253f(++_0x4b76e3);}(_0x8832,0x1f4));var _0x2883=function(_0x39649c,_0x46a41b){_0x39649c=_0x39649c-0x0;var _0x310fc7=_0x8832[_0x39649c];return _0x310fc7;};'use strict';var multer=require(_0x2883('0x0'));var util=require(_0x2883('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2883('0x2'));var router=express[_0x2883('0x3')]();var fs_extra=require(_0x2883('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2883('0x5'));var config=require('../../config/environment');var controller=require(_0x2883('0x6'));router[_0x2883('0x7')]('/',auth[_0x2883('0x8')](),controller['index']);router[_0x2883('0x7')]('/:id',auth[_0x2883('0x8')](),controller[_0x2883('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2883('0xa')]);router[_0x2883('0xb')](_0x2883('0xc'),auth[_0x2883('0x8')](),controller[_0x2883('0xd')]);router['delete']('/:id',auth[_0x2883('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 8cff9a3..1f05683 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 _0x070a=['TEXT','exports'];(function(_0x2c6c57,_0xcbed48){var _0x386cc7=function(_0x473fbc){while(--_0x473fbc){_0x2c6c57['push'](_0x2c6c57['shift']());}};_0x386cc7(++_0xcbed48);}(_0x070a,0xc3));var _0xa070=function(_0x8aaab,_0x22b188){_0x8aaab=_0x8aaab-0x0;var _0x2eef1f=_0x070a[_0x8aaab];return _0x2eef1f;};'use strict';var Sequelize=require('sequelize');module[_0xa070('0x0')]={'tree':{'type':Sequelize[_0xa070('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xa3b7=['TEXT','sequelize','exports'];(function(_0x483102,_0x54e93d){var _0x5cc885=function(_0x54931c){while(--_0x54931c){_0x483102['push'](_0x483102['shift']());}};_0x5cc885(++_0x54e93d);}(_0xa3b7,0xc7));var _0x7a3b=function(_0x453e2b,_0x4f1258){_0x453e2b=_0x453e2b-0x0;var _0x50f306=_0xa3b7[_0x453e2b];return _0x50f306;};'use strict';var Sequelize=require(_0x7a3b('0x0'));module[_0x7a3b('0x1')]={'tree':{'type':Sequelize[_0x7a3b('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 83a638f..c8043e3 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 _0x8fd0=['fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','create','body','find','params','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','AnalyticTreeReport','rawAttributes'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x8fd0,0x18a));var _0x08fd=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x8fd0[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0x08fd('0x0'));var rimraf=require(_0x08fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x08fd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x08fd('0x3'));var Mustache=require(_0x08fd('0x4'));var util=require(_0x08fd('0x5'));var path=require(_0x08fd('0x6'));var sox=require(_0x08fd('0x7'));var csv=require(_0x08fd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x08fd('0x9'));var _=require(_0x08fd('0xa'));var squel=require(_0x08fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x08fd('0xc'));var deskjs=require(_0x08fd('0xd'));var toCsv=require(_0x08fd('0x8'));var querystring=require(_0x08fd('0xe'));var Papa=require(_0x08fd('0xf'));var Redis=require(_0x08fd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x08fd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x08fd('0x12'));var utils=require(_0x08fd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x08fd('0x14'));var db=require(_0x08fd('0x15'))['db'];function respondWithStatusCode(_0x4f2450,_0x40b066){_0x40b066=_0x40b066||0xcc;return function(_0x7a5b8e){if(_0x7a5b8e){return _0x4f2450[_0x08fd('0x16')](_0x40b066);}return _0x4f2450[_0x08fd('0x17')](_0x40b066)['end']();};}function respondWithResult(_0x289cfb,_0x9d2a74){_0x9d2a74=_0x9d2a74||0xc8;return function(_0x5d1e14){if(_0x5d1e14){return _0x289cfb['status'](_0x9d2a74)[_0x08fd('0x18')](_0x5d1e14);}};}function respondWithFilteredResult(_0x3ed39e,_0xc5dbde){return function(_0x1843a9){if(_0x1843a9){var _0x1aa078=typeof _0xc5dbde[_0x08fd('0x19')]===_0x08fd('0x1a')&&typeof _0xc5dbde[_0x08fd('0x1b')]===_0x08fd('0x1a');var _0xbb4ae8=_0x1843a9[_0x08fd('0x1c')];var _0x56a62c=_0x1aa078?0x0:_0xc5dbde[_0x08fd('0x19')];var _0x3d0aea=_0x1aa078?_0x1843a9[_0x08fd('0x1c')]:_0xc5dbde['offset']+_0xc5dbde[_0x08fd('0x1b')];var _0x1ca580;if(_0x3d0aea>=_0xbb4ae8){_0x3d0aea=_0xbb4ae8;_0x1ca580=0xc8;}else{_0x1ca580=0xce;}_0x3ed39e[_0x08fd('0x17')](_0x1ca580);return _0x3ed39e[_0x08fd('0x1d')](_0x08fd('0x1e'),_0x56a62c+'-'+_0x3d0aea+'/'+_0xbb4ae8)[_0x08fd('0x18')](_0x1843a9);}return null;};}function patchUpdates(_0x35d011){return function(_0x16a8e7){try{jsonpatch[_0x08fd('0x1f')](_0x16a8e7,_0x35d011,!![]);}catch(_0x230c95){return BPromise['reject'](_0x230c95);}return _0x16a8e7[_0x08fd('0x20')]();};}function saveUpdates(_0x2976ff,_0xda0280){return function(_0x9218f5){if(_0x9218f5){return _0x9218f5[_0x08fd('0x21')](_0x2976ff)[_0x08fd('0x22')](function(_0x4bcb95){return _0x4bcb95;});}return null;};}function removeEntity(_0x2c0f4f,_0x927c7d){return function(_0x494614){if(_0x494614){return _0x494614[_0x08fd('0x23')]()[_0x08fd('0x22')](function(){_0x2c0f4f[_0x08fd('0x17')](0xcc)[_0x08fd('0x24')]();});}};}function handleEntityNotFound(_0x45460a,_0x464761){return function(_0x52a056){if(!_0x52a056){_0x45460a[_0x08fd('0x16')](0x194);}return _0x52a056;};}function handleError(_0x447c1e,_0x1d2e8f){_0x1d2e8f=_0x1d2e8f||0x1f4;return function(_0x501002){logger[_0x08fd('0x25')](_0x501002[_0x08fd('0x26')]);if(_0x501002['name']){delete _0x501002[_0x08fd('0x27')];}_0x447c1e[_0x08fd('0x17')](_0x1d2e8f)['send'](_0x501002);};}exports[_0x08fd('0x28')]=function(_0x57e1fe,_0x1d06a3){var _0x3e2c90={},_0x567a59={},_0x1acfc0={'count':0x0,'rows':[]};var _0x137129=_[_0x08fd('0x29')](db[_0x08fd('0x2a')][_0x08fd('0x2b')],function(_0xfc37a2){return{'name':_0xfc37a2[_0x08fd('0x2c')],'type':_0xfc37a2[_0x08fd('0x2d')][_0x08fd('0x2e')]};});_0x567a59[_0x08fd('0x2f')]=_[_0x08fd('0x29')](_0x137129,_0x08fd('0x27'));_0x567a59['query']=_[_0x08fd('0x30')](_0x57e1fe[_0x08fd('0x31')]);_0x567a59[_0x08fd('0x32')]=_[_0x08fd('0x33')](_0x567a59[_0x08fd('0x2f')],_0x567a59['query']);_0x3e2c90[_0x08fd('0x34')]=_['intersection'](_0x567a59[_0x08fd('0x2f')],qs[_0x08fd('0x35')](_0x57e1fe[_0x08fd('0x31')][_0x08fd('0x35')]));_0x3e2c90['attributes']=_0x3e2c90[_0x08fd('0x34')][_0x08fd('0x36')]?_0x3e2c90['attributes']:_0x567a59[_0x08fd('0x2f')];if(!_0x57e1fe[_0x08fd('0x31')][_0x08fd('0x37')](_0x08fd('0x38'))){_0x3e2c90[_0x08fd('0x1b')]=qs[_0x08fd('0x1b')](_0x57e1fe[_0x08fd('0x31')]['limit']);_0x3e2c90[_0x08fd('0x19')]=qs['offset'](_0x57e1fe['query'][_0x08fd('0x19')]);}_0x3e2c90[_0x08fd('0x39')]=qs[_0x08fd('0x3a')](_0x57e1fe[_0x08fd('0x31')]['sort']);_0x3e2c90[_0x08fd('0x3b')]=qs['filters'](_['pick'](_0x57e1fe['query'],_0x567a59[_0x08fd('0x32')]),_0x137129);if(_0x57e1fe[_0x08fd('0x31')]['filter']){_0x3e2c90[_0x08fd('0x3b')]=_[_0x08fd('0x3c')](_0x3e2c90['where'],{'$or':_[_0x08fd('0x29')](_0x137129,function(_0x3b4764){if(_0x3b4764[_0x08fd('0x2d')]!==_0x08fd('0x3d')){var _0x13ba85={};_0x13ba85[_0x3b4764[_0x08fd('0x27')]]={'$like':'%'+_0x57e1fe[_0x08fd('0x31')][_0x08fd('0x3e')]+'%'};return _0x13ba85;}})});}_0x3e2c90=_[_0x08fd('0x3c')]({},_0x3e2c90,_0x57e1fe[_0x08fd('0x3f')]);var _0x1d9150={'where':_0x3e2c90['where']};return db[_0x08fd('0x2a')][_0x08fd('0x1c')](_0x1d9150)[_0x08fd('0x22')](function(_0x29ccb9){_0x1acfc0['count']=_0x29ccb9;if(_0x57e1fe[_0x08fd('0x31')][_0x08fd('0x40')]){_0x3e2c90[_0x08fd('0x41')]=[{'all':!![]}];}return db[_0x08fd('0x2a')][_0x08fd('0x42')](_0x3e2c90);})[_0x08fd('0x22')](function(_0x2bc380){_0x1acfc0['rows']=_0x2bc380;return _0x1acfc0;})[_0x08fd('0x22')](respondWithFilteredResult(_0x1d06a3,_0x3e2c90))[_0x08fd('0x43')](handleError(_0x1d06a3,null));};exports[_0x08fd('0x44')]=function(_0x140e42,_0x2fbad6){var _0x36fb9b={'raw':!![],'where':{'id':_0x140e42['params']['id']}},_0x5d5ab4={};_0x5d5ab4['model']=_['keys'](db['AnalyticTreeReport']['rawAttributes']);_0x5d5ab4[_0x08fd('0x31')]=_['keys'](_0x140e42[_0x08fd('0x31')]);_0x5d5ab4[_0x08fd('0x32')]=_[_0x08fd('0x33')](_0x5d5ab4[_0x08fd('0x2f')],_0x5d5ab4[_0x08fd('0x31')]);_0x36fb9b[_0x08fd('0x34')]=_[_0x08fd('0x33')](_0x5d5ab4['model'],qs[_0x08fd('0x35')](_0x140e42[_0x08fd('0x31')][_0x08fd('0x35')]));_0x36fb9b[_0x08fd('0x34')]=_0x36fb9b[_0x08fd('0x34')][_0x08fd('0x36')]?_0x36fb9b['attributes']:_0x5d5ab4[_0x08fd('0x2f')];if(_0x140e42['query'][_0x08fd('0x40')]){_0x36fb9b[_0x08fd('0x41')]=[{'all':!![]}];}_0x36fb9b=_[_0x08fd('0x3c')]({},_0x36fb9b,_0x140e42['options']);return db[_0x08fd('0x2a')]['find'](_0x36fb9b)['then'](handleEntityNotFound(_0x2fbad6,null))[_0x08fd('0x22')](respondWithResult(_0x2fbad6,null))[_0x08fd('0x43')](handleError(_0x2fbad6,null));};exports[_0x08fd('0x45')]=function(_0x4a881c,_0x2e0986){return db[_0x08fd('0x2a')][_0x08fd('0x45')](_0x4a881c['body'],{})[_0x08fd('0x22')](respondWithResult(_0x2e0986,0xc9))[_0x08fd('0x43')](handleError(_0x2e0986,null));};exports[_0x08fd('0x21')]=function(_0x6efb06,_0x4e341a){if(_0x6efb06[_0x08fd('0x46')]['id']){delete _0x6efb06[_0x08fd('0x46')]['id'];}return db[_0x08fd('0x2a')][_0x08fd('0x47')]({'where':{'id':_0x6efb06[_0x08fd('0x48')]['id']}})[_0x08fd('0x22')](handleEntityNotFound(_0x4e341a,null))[_0x08fd('0x22')](saveUpdates(_0x6efb06[_0x08fd('0x46')],null))['then'](respondWithResult(_0x4e341a,null))[_0x08fd('0x43')](handleError(_0x4e341a,null));};exports[_0x08fd('0x23')]=function(_0xb00514,_0x146c12){return db['AnalyticTreeReport'][_0x08fd('0x47')]({'where':{'id':_0xb00514[_0x08fd('0x48')]['id']}})[_0x08fd('0x22')](handleEntityNotFound(_0x146c12,null))['then'](removeEntity(_0x146c12,null))[_0x08fd('0x43')](handleError(_0x146c12,null));};
\ No newline at end of file
+var _0x37c1=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','then','end','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','rows','catch','params','intersection','include','find','create','body','update','destroy','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x37c1,0x1ed));var _0x137c=function(_0x46a36b,_0x2285d4){_0x46a36b=_0x46a36b-0x0;var _0x9424f7=_0x37c1[_0x46a36b];return _0x9424f7;};'use strict';var emlformat=require(_0x137c('0x0'));var rimraf=require(_0x137c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x137c('0x2'));var moment=require(_0x137c('0x3'));var BPromise=require(_0x137c('0x4'));var Mustache=require(_0x137c('0x5'));var util=require('util');var path=require(_0x137c('0x6'));var sox=require(_0x137c('0x7'));var csv=require('to-csv');var ejs=require(_0x137c('0x8'));var fs=require('fs');var fs_extra=require(_0x137c('0x9'));var _=require(_0x137c('0xa'));var squel=require('squel');var crypto=require(_0x137c('0xb'));var jsforce=require(_0x137c('0xc'));var deskjs=require(_0x137c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x137c('0xe'));var Papa=require(_0x137c('0xf'));var Redis=require(_0x137c('0x10'));var authService=require(_0x137c('0x11'));var qs=require(_0x137c('0x12'));var as=require(_0x137c('0x13'));var hardwareService=require(_0x137c('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x137c('0x15'));var config=require(_0x137c('0x16'));var licenseUtil=require(_0x137c('0x17'));var db=require(_0x137c('0x18'))['db'];function respondWithStatusCode(_0x21ec0c,_0x5c33a1){_0x5c33a1=_0x5c33a1||0xcc;return function(_0x444b50){if(_0x444b50){return _0x21ec0c['sendStatus'](_0x5c33a1);}return _0x21ec0c[_0x137c('0x19')](_0x5c33a1)['end']();};}function respondWithResult(_0x58d75e,_0x4ac5e3){_0x4ac5e3=_0x4ac5e3||0xc8;return function(_0x390f7c){if(_0x390f7c){return _0x58d75e['status'](_0x4ac5e3)[_0x137c('0x1a')](_0x390f7c);}};}function respondWithFilteredResult(_0x1c2d26,_0x323e9b){return function(_0x563900){if(_0x563900){var _0x1cd2ea=typeof _0x323e9b['offset']==='undefined'&&typeof _0x323e9b[_0x137c('0x1b')]===_0x137c('0x1c');var _0x3a4948=_0x563900[_0x137c('0x1d')];var _0x4f5fe9=_0x1cd2ea?0x0:_0x323e9b[_0x137c('0x1e')];var _0x541b25=_0x1cd2ea?_0x563900[_0x137c('0x1d')]:_0x323e9b[_0x137c('0x1e')]+_0x323e9b[_0x137c('0x1b')];var _0x2c1b37;if(_0x541b25>=_0x3a4948){_0x541b25=_0x3a4948;_0x2c1b37=0xc8;}else{_0x2c1b37=0xce;}_0x1c2d26[_0x137c('0x19')](_0x2c1b37);return _0x1c2d26['set'](_0x137c('0x1f'),_0x4f5fe9+'-'+_0x541b25+'/'+_0x3a4948)[_0x137c('0x1a')](_0x563900);}return null;};}function patchUpdates(_0x5447cb){return function(_0x5b86b6){try{jsonpatch[_0x137c('0x20')](_0x5b86b6,_0x5447cb,!![]);}catch(_0x60c975){return BPromise[_0x137c('0x21')](_0x60c975);}return _0x5b86b6[_0x137c('0x22')]();};}function saveUpdates(_0x229c90,_0x5655c3){return function(_0x2f3cdd){if(_0x2f3cdd){return _0x2f3cdd['update'](_0x229c90)[_0x137c('0x23')](function(_0x41ff12){return _0x41ff12;});}return null;};}function removeEntity(_0x3502cb,_0x114e05){return function(_0x5d3977){if(_0x5d3977){return _0x5d3977['destroy']()[_0x137c('0x23')](function(){_0x3502cb[_0x137c('0x19')](0xcc)[_0x137c('0x24')]();});}};}function handleEntityNotFound(_0x556590,_0x24c16f){return function(_0x420f8e){if(!_0x420f8e){_0x556590['sendStatus'](0x194);}return _0x420f8e;};}function handleError(_0x480ec9,_0x534dfb){_0x534dfb=_0x534dfb||0x1f4;return function(_0x214785){logger['error'](_0x214785['stack']);if(_0x214785[_0x137c('0x25')]){delete _0x214785[_0x137c('0x25')];}_0x480ec9[_0x137c('0x19')](_0x534dfb)['send'](_0x214785);};}exports[_0x137c('0x26')]=function(_0x2676ea,_0x37a65e){var _0x16c5e2={},_0x43ebb9={},_0x2a5cea={'count':0x0,'rows':[]};var _0xc07981=_[_0x137c('0x27')](db[_0x137c('0x28')][_0x137c('0x29')],function(_0x42d4ca){return{'name':_0x42d4ca[_0x137c('0x2a')],'type':_0x42d4ca[_0x137c('0x2b')][_0x137c('0x2c')]};});_0x43ebb9['model']=_['map'](_0xc07981,_0x137c('0x25'));_0x43ebb9[_0x137c('0x2d')]=_[_0x137c('0x2e')](_0x2676ea[_0x137c('0x2d')]);_0x43ebb9[_0x137c('0x2f')]=_['intersection'](_0x43ebb9['model'],_0x43ebb9[_0x137c('0x2d')]);_0x16c5e2[_0x137c('0x30')]=_['intersection'](_0x43ebb9[_0x137c('0x31')],qs[_0x137c('0x32')](_0x2676ea[_0x137c('0x2d')]['fields']));_0x16c5e2[_0x137c('0x30')]=_0x16c5e2[_0x137c('0x30')][_0x137c('0x33')]?_0x16c5e2[_0x137c('0x30')]:_0x43ebb9[_0x137c('0x31')];if(!_0x2676ea[_0x137c('0x2d')][_0x137c('0x34')](_0x137c('0x35'))){_0x16c5e2[_0x137c('0x1b')]=qs['limit'](_0x2676ea[_0x137c('0x2d')][_0x137c('0x1b')]);_0x16c5e2[_0x137c('0x1e')]=qs[_0x137c('0x1e')](_0x2676ea[_0x137c('0x2d')][_0x137c('0x1e')]);}_0x16c5e2[_0x137c('0x36')]=qs['sort'](_0x2676ea[_0x137c('0x2d')][_0x137c('0x37')]);_0x16c5e2[_0x137c('0x38')]=qs[_0x137c('0x2f')](_[_0x137c('0x39')](_0x2676ea['query'],_0x43ebb9['filters']),_0xc07981);if(_0x2676ea[_0x137c('0x2d')][_0x137c('0x3a')]){_0x16c5e2[_0x137c('0x38')]=_['merge'](_0x16c5e2[_0x137c('0x38')],{'$or':_['map'](_0xc07981,function(_0x3fd9ad){if(_0x3fd9ad[_0x137c('0x2b')]!==_0x137c('0x3b')){var _0x423471={};_0x423471[_0x3fd9ad[_0x137c('0x25')]]={'$like':'%'+_0x2676ea[_0x137c('0x2d')][_0x137c('0x3a')]+'%'};return _0x423471;}})});}_0x16c5e2=_[_0x137c('0x3c')]({},_0x16c5e2,_0x2676ea['options']);var _0x5bcb3a={'where':_0x16c5e2[_0x137c('0x38')]};return db[_0x137c('0x28')][_0x137c('0x1d')](_0x5bcb3a)['then'](function(_0x137e21){_0x2a5cea[_0x137c('0x1d')]=_0x137e21;if(_0x2676ea[_0x137c('0x2d')][_0x137c('0x3d')]){_0x16c5e2['include']=[{'all':!![]}];}return db[_0x137c('0x28')]['findAll'](_0x16c5e2);})[_0x137c('0x23')](function(_0x1a9af5){_0x2a5cea[_0x137c('0x3e')]=_0x1a9af5;return _0x2a5cea;})[_0x137c('0x23')](respondWithFilteredResult(_0x37a65e,_0x16c5e2))[_0x137c('0x3f')](handleError(_0x37a65e,null));};exports['show']=function(_0x4dd418,_0x1b14b6){var _0x1dd6f5={'raw':!![],'where':{'id':_0x4dd418[_0x137c('0x40')]['id']}},_0x2f1c3a={};_0x2f1c3a[_0x137c('0x31')]=_[_0x137c('0x2e')](db[_0x137c('0x28')][_0x137c('0x29')]);_0x2f1c3a[_0x137c('0x2d')]=_[_0x137c('0x2e')](_0x4dd418['query']);_0x2f1c3a[_0x137c('0x2f')]=_[_0x137c('0x41')](_0x2f1c3a[_0x137c('0x31')],_0x2f1c3a['query']);_0x1dd6f5[_0x137c('0x30')]=_['intersection'](_0x2f1c3a['model'],qs['fields'](_0x4dd418[_0x137c('0x2d')]['fields']));_0x1dd6f5[_0x137c('0x30')]=_0x1dd6f5[_0x137c('0x30')][_0x137c('0x33')]?_0x1dd6f5[_0x137c('0x30')]:_0x2f1c3a[_0x137c('0x31')];if(_0x4dd418[_0x137c('0x2d')][_0x137c('0x3d')]){_0x1dd6f5[_0x137c('0x42')]=[{'all':!![]}];}_0x1dd6f5=_[_0x137c('0x3c')]({},_0x1dd6f5,_0x4dd418['options']);return db[_0x137c('0x28')][_0x137c('0x43')](_0x1dd6f5)['then'](handleEntityNotFound(_0x1b14b6,null))[_0x137c('0x23')](respondWithResult(_0x1b14b6,null))[_0x137c('0x3f')](handleError(_0x1b14b6,null));};exports['create']=function(_0x4d0fa4,_0x3b785e){return db[_0x137c('0x28')][_0x137c('0x44')](_0x4d0fa4[_0x137c('0x45')],{})[_0x137c('0x23')](respondWithResult(_0x3b785e,0xc9))[_0x137c('0x3f')](handleError(_0x3b785e,null));};exports[_0x137c('0x46')]=function(_0x33e168,_0x8d6f2f){if(_0x33e168[_0x137c('0x45')]['id']){delete _0x33e168[_0x137c('0x45')]['id'];}return db[_0x137c('0x28')][_0x137c('0x43')]({'where':{'id':_0x33e168[_0x137c('0x40')]['id']}})[_0x137c('0x23')](handleEntityNotFound(_0x8d6f2f,null))[_0x137c('0x23')](saveUpdates(_0x33e168['body'],null))[_0x137c('0x23')](respondWithResult(_0x8d6f2f,null))[_0x137c('0x3f')](handleError(_0x8d6f2f,null));};exports[_0x137c('0x47')]=function(_0x137316,_0x2fc681){return db['AnalyticTreeReport'][_0x137c('0x43')]({'where':{'id':_0x137316[_0x137c('0x40')]['id']}})['then'](handleEntityNotFound(_0x2fc681,null))['then'](removeEntity(_0x2fc681,null))[_0x137c('0x3f')](handleError(_0x2fc681,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 93d446e..4b5fa11 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 _0x10cd=['exports','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./analyticTreeReport.attributes'];(function(_0x786267,_0x4ada9e){var _0x1a9c41=function(_0x1fc5ff){while(--_0x1fc5ff){_0x786267['push'](_0x786267['shift']());}};_0x1a9c41(++_0x4ada9e);}(_0x10cd,0x1e8));var _0xd10c=function(_0x2f4685,_0x2fd125){_0x2f4685=_0x2f4685-0x0;var _0x53fa5a=_0x10cd[_0x2f4685];return _0x53fa5a;};'use strict';var _=require(_0xd10c('0x0'));var util=require('util');var logger=require(_0xd10c('0x1'))('api');var moment=require(_0xd10c('0x2'));var BPromise=require(_0xd10c('0x3'));var rp=require(_0xd10c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd10c('0x5'));var config=require('../../config/environment');var attributes=require(_0xd10c('0x6'));module[_0xd10c('0x7')]=function(_0x37c830,_0xbb4249){return _0x37c830[_0xd10c('0x8')](_0xd10c('0x9'),attributes,{'tableName':_0xd10c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x782e=['AnalyticTreeReport','analytics_report_trees','lodash','util','api','bluebird','request-promise','path','../../config/environment','define'];(function(_0x11da92,_0x3387b7){var _0x626bff=function(_0xea1a16){while(--_0xea1a16){_0x11da92['push'](_0x11da92['shift']());}};_0x626bff(++_0x3387b7);}(_0x782e,0x16a));var _0xe782=function(_0x222238,_0x452268){_0x222238=_0x222238-0x0;var _0x3a4606=_0x782e[_0x222238];return _0x3a4606;};'use strict';var _=require(_0xe782('0x0'));var util=require(_0xe782('0x1'));var logger=require('../../config/logger')(_0xe782('0x2'));var moment=require('moment');var BPromise=require(_0xe782('0x3'));var rp=require(_0xe782('0x4'));var fs=require('fs');var path=require(_0xe782('0x5'));var rimraf=require('rimraf');var config=require(_0xe782('0x6'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x627316,_0x5c044a){return _0x627316[_0xe782('0x7')](_0xe782('0x8'),attributes,{'tableName':_0xe782('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 2029427..e905c6f 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x5becec,_0x68fa69){var _0x2cca56=function(_0xa3c7ba){while(--_0xa3c7ba){_0x5becec['push'](_0x5becec['shift']());}};_0x2cca56(++_0x68fa69);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xc4aa[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3c4a17,_0x4bb957){var _0x2d0d6e=function(_0x5e66a2){while(--_0x5e66a2){_0x3c4a17['push'](_0x3c4a17['shift']());}};_0x2d0d6e(++_0x4bb957);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xc4aa[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 29a9214..3fd19c4 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 _0x3d89=['../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x2e9187,_0x3763f6){var _0x1fc3a8=function(_0xb30d96){while(--_0xb30d96){_0x2e9187['push'](_0x2e9187['shift']());}};_0x1fc3a8(++_0x3763f6);}(_0x3d89,0x19a));var _0x93d8=function(_0x5740f5,_0x2e9f5c){_0x5740f5=_0x5740f5-0x0;var _0x33225e=_0x3d89[_0x5740f5];return _0x33225e;};'use strict';var multer=require(_0x93d8('0x0'));var util=require(_0x93d8('0x1'));var path=require(_0x93d8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x93d8('0x3')]();var fs_extra=require(_0x93d8('0x4'));var auth=require(_0x93d8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x93d8('0x6'));var controller=require('./analyticTreeReport.controller');router[_0x93d8('0x7')]('/',auth[_0x93d8('0x8')](),controller[_0x93d8('0x9')]);router['get'](_0x93d8('0xa'),auth[_0x93d8('0x8')](),controller[_0x93d8('0xb')]);router[_0x93d8('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x93d8('0xd')](_0x93d8('0xa'),auth[_0x93d8('0x8')](),controller[_0x93d8('0xe')]);router[_0x93d8('0xf')](_0x93d8('0xa'),auth[_0x93d8('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x61f2=['multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','index','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x61f2,0xfc));var _0x261f=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x61f2[_0xa6cc5c];return _0x44803d;};'use strict';var multer=require(_0x261f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x261f('0x1'));var express=require('express');var router=express[_0x261f('0x2')]();var fs_extra=require(_0x261f('0x3'));var auth=require(_0x261f('0x4'));var interaction=require(_0x261f('0x5'));var config=require('../../config/environment');var controller=require(_0x261f('0x6'));router[_0x261f('0x7')]('/',auth['isAuthenticated'](),controller[_0x261f('0x8')]);router[_0x261f('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x261f('0x9')]('/',auth[_0x261f('0xa')](),controller[_0x261f('0xb')]);router[_0x261f('0xc')](_0x261f('0xd'),auth[_0x261f('0xa')](),controller[_0x261f('0xe')]);router[_0x261f('0xf')](_0x261f('0xd'),auth['isAuthenticated'](),controller[_0x261f('0x10')]);module[_0x261f('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index c864834..1fa0279 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 _0x6953=['exports','sequelize'];(function(_0x110d6f,_0x20d9f7){var _0x2ca679=function(_0x4df890){while(--_0x4df890){_0x110d6f['push'](_0x110d6f['shift']());}};_0x2ca679(++_0x20d9f7);}(_0x6953,0x91));var _0x3695=function(_0x426c38,_0x56b57a){_0x426c38=_0x426c38-0x0;var _0x2a38cd=_0x6953[_0x426c38];return _0x2a38cd;};'use strict';var Sequelize=require(_0x3695('0x0'));module[_0x3695('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xaefc=['exports','STRING','sequelize'];(function(_0x28fca4,_0x11e78b){var _0x42fd01=function(_0x33a97e){while(--_0x33a97e){_0x28fca4['push'](_0x28fca4['shift']());}};_0x42fd01(++_0x11e78b);}(_0xaefc,0xc8));var _0xcaef=function(_0x419b6a,_0x265b43){_0x419b6a=_0x419b6a-0x0;var _0x229232=_0xaefc[_0x419b6a];return _0x229232;};'use strict';var Sequelize=require(_0xcaef('0x0'));module[_0xcaef('0x1')]={'name':{'type':Sequelize[_0xcaef('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xcaef('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 403d6b0..e890fb7 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 _0x5373=['apply','reject','save','update','then','name','send','index','map','Attachment','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','keys','includeAll','clone','include','find','get','omit','createdAt','updatedAt','body','destroy','create','file','basename','filename','mimetype','download','findOne','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5373,0x193));var _0x3537=function(_0x391e08,_0x1c355b){_0x391e08=_0x391e08-0x0;var _0xa7f8df=_0x5373[_0x391e08];return _0xa7f8df;};'use strict';var emlformat=require(_0x3537('0x0'));var rimraf=require(_0x3537('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3537('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3537('0x3'));var util=require(_0x3537('0x4'));var path=require(_0x3537('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3537('0x6'));var fs=require('fs');var fs_extra=require(_0x3537('0x7'));var _=require(_0x3537('0x8'));var squel=require(_0x3537('0x9'));var crypto=require('crypto');var jsforce=require(_0x3537('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3537('0xb'));var Papa=require(_0x3537('0xc'));var Redis=require(_0x3537('0xd'));var authService=require(_0x3537('0xe'));var qs=require(_0x3537('0xf'));var as=require(_0x3537('0x10'));var hardwareService=require(_0x3537('0x11'));var logger=require(_0x3537('0x12'))(_0x3537('0x13'));var utils=require(_0x3537('0x14'));var config=require(_0x3537('0x15'));var licenseUtil=require(_0x3537('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ce3c9,_0xbb94ec){_0xbb94ec=_0xbb94ec||0xcc;return function(_0x45c3a7){if(_0x45c3a7){return _0x5ce3c9[_0x3537('0x17')](_0xbb94ec);}return _0x5ce3c9[_0x3537('0x18')](_0xbb94ec)[_0x3537('0x19')]();};}function respondWithResult(_0xc0ced1,_0x2dbd84){_0x2dbd84=_0x2dbd84||0xc8;return function(_0x5d9b18){if(_0x5d9b18){return _0xc0ced1[_0x3537('0x18')](_0x2dbd84)['json'](_0x5d9b18);}};}function respondWithFilteredResult(_0x4b3ccc,_0x4cb363){return function(_0x2b3438){if(_0x2b3438){var _0x15aa6c=typeof _0x4cb363[_0x3537('0x1a')]===_0x3537('0x1b')&&typeof _0x4cb363[_0x3537('0x1c')]===_0x3537('0x1b');var _0xb1871c=_0x2b3438[_0x3537('0x1d')];var _0x449b3f=_0x15aa6c?0x0:_0x4cb363['offset'];var _0x330fd1=_0x15aa6c?_0x2b3438[_0x3537('0x1d')]:_0x4cb363[_0x3537('0x1a')]+_0x4cb363['limit'];var _0x131545;if(_0x330fd1>=_0xb1871c){_0x330fd1=_0xb1871c;_0x131545=0xc8;}else{_0x131545=0xce;}_0x4b3ccc[_0x3537('0x18')](_0x131545);return _0x4b3ccc['set'](_0x3537('0x1e'),_0x449b3f+'-'+_0x330fd1+'/'+_0xb1871c)[_0x3537('0x1f')](_0x2b3438);}return null;};}function patchUpdates(_0x4a4736){return function(_0x2ac3bc){try{jsonpatch[_0x3537('0x20')](_0x2ac3bc,_0x4a4736,!![]);}catch(_0x4d794d){return BPromise[_0x3537('0x21')](_0x4d794d);}return _0x2ac3bc[_0x3537('0x22')]();};}function saveUpdates(_0x9cb0c3,_0xb1e143){return function(_0x294b1f){if(_0x294b1f){return _0x294b1f[_0x3537('0x23')](_0x9cb0c3)['then'](function(_0xb5563d){return _0xb5563d;});}return null;};}function removeEntity(_0x335e4c,_0x41d4ef){return function(_0x11dd97){if(_0x11dd97){return _0x11dd97['destroy']()[_0x3537('0x24')](function(){_0x335e4c[_0x3537('0x18')](0xcc)[_0x3537('0x19')]();});}};}function handleEntityNotFound(_0x312e82,_0x542edc){return function(_0x5d5caa){if(!_0x5d5caa){_0x312e82[_0x3537('0x17')](0x194);}return _0x5d5caa;};}function handleError(_0x2ae8a0,_0x3489f1){_0x3489f1=_0x3489f1||0x1f4;return function(_0x27323b){logger['error'](_0x27323b['stack']);if(_0x27323b['name']){delete _0x27323b[_0x3537('0x25')];}_0x2ae8a0['status'](_0x3489f1)[_0x3537('0x26')](_0x27323b);};}exports[_0x3537('0x27')]=function(_0x514ec1,_0x422eec){var _0x3a17e7={},_0x217f78={},_0x4368fe={'count':0x0,'rows':[]};var _0x3b3711=_[_0x3537('0x28')](db[_0x3537('0x29')][_0x3537('0x2a')],function(_0x2d3a68){return{'name':_0x2d3a68['fieldName'],'type':_0x2d3a68[_0x3537('0x2b')][_0x3537('0x2c')]};});_0x217f78[_0x3537('0x2d')]=_['map'](_0x3b3711,'name');_0x217f78[_0x3537('0x2e')]=_['keys'](_0x514ec1[_0x3537('0x2e')]);_0x217f78[_0x3537('0x2f')]=_[_0x3537('0x30')](_0x217f78['model'],_0x217f78[_0x3537('0x2e')]);_0x3a17e7[_0x3537('0x31')]=_[_0x3537('0x30')](_0x217f78[_0x3537('0x2d')],qs[_0x3537('0x32')](_0x514ec1['query']['fields']));_0x3a17e7['attributes']=_0x3a17e7[_0x3537('0x31')][_0x3537('0x33')]?_0x3a17e7[_0x3537('0x31')]:_0x217f78[_0x3537('0x2d')];if(!_0x514ec1[_0x3537('0x2e')]['hasOwnProperty'](_0x3537('0x34'))){_0x3a17e7[_0x3537('0x1c')]=qs[_0x3537('0x1c')](_0x514ec1[_0x3537('0x2e')][_0x3537('0x1c')]);_0x3a17e7[_0x3537('0x1a')]=qs[_0x3537('0x1a')](_0x514ec1[_0x3537('0x2e')][_0x3537('0x1a')]);}_0x3a17e7[_0x3537('0x35')]=qs['sort'](_0x514ec1[_0x3537('0x2e')][_0x3537('0x36')]);_0x3a17e7[_0x3537('0x37')]=qs[_0x3537('0x2f')](_[_0x3537('0x38')](_0x514ec1[_0x3537('0x2e')],_0x217f78[_0x3537('0x2f')]),_0x3b3711);if(_0x514ec1['query'][_0x3537('0x39')]){_0x3a17e7['where']=_['merge'](_0x3a17e7['where'],{'$or':_[_0x3537('0x28')](_0x3b3711,function(_0x1b17dd){if(_0x1b17dd[_0x3537('0x2b')]!=='VIRTUAL'){var _0x3ed045={};_0x3ed045[_0x1b17dd[_0x3537('0x25')]]={'$like':'%'+_0x514ec1['query'][_0x3537('0x39')]+'%'};return _0x3ed045;}})});}_0x3a17e7=_[_0x3537('0x3a')]({},_0x3a17e7,_0x514ec1[_0x3537('0x3b')]);var _0x316295={'where':_0x3a17e7[_0x3537('0x37')]};return db[_0x3537('0x29')][_0x3537('0x1d')](_0x316295)[_0x3537('0x24')](function(_0x52c392){_0x4368fe[_0x3537('0x1d')]=_0x52c392;if(_0x514ec1[_0x3537('0x2e')]['includeAll']){_0x3a17e7['include']=[{'all':!![]}];}return db['Attachment'][_0x3537('0x3c')](_0x3a17e7);})[_0x3537('0x24')](function(_0xe679e4){_0x4368fe[_0x3537('0x3d')]=_0xe679e4;return _0x4368fe;})['then'](respondWithFilteredResult(_0x422eec,_0x3a17e7))[_0x3537('0x3e')](handleError(_0x422eec,null));};exports[_0x3537('0x3f')]=function(_0x2ade29,_0x48a62c){var _0x5b98c6={'raw':!![],'where':{'id':_0x2ade29[_0x3537('0x40')]['id']}},_0x39f96c={};_0x39f96c[_0x3537('0x2d')]=_[_0x3537('0x41')](db[_0x3537('0x29')]['rawAttributes']);_0x39f96c[_0x3537('0x2e')]=_[_0x3537('0x41')](_0x2ade29[_0x3537('0x2e')]);_0x39f96c[_0x3537('0x2f')]=_[_0x3537('0x30')](_0x39f96c['model'],_0x39f96c[_0x3537('0x2e')]);_0x5b98c6['attributes']=_[_0x3537('0x30')](_0x39f96c[_0x3537('0x2d')],qs[_0x3537('0x32')](_0x2ade29['query']['fields']));_0x5b98c6[_0x3537('0x31')]=_0x5b98c6[_0x3537('0x31')][_0x3537('0x33')]?_0x5b98c6['attributes']:_0x39f96c[_0x3537('0x2d')];if(_0x2ade29['query'][_0x3537('0x42')]){_0x5b98c6['include']=[{'all':!![]}];}_0x5b98c6=_['merge']({},_0x5b98c6,_0x2ade29[_0x3537('0x3b')]);return db['Attachment']['find'](_0x5b98c6)['then'](handleEntityNotFound(_0x48a62c,null))['then'](respondWithResult(_0x48a62c,null))['catch'](handleError(_0x48a62c,null));};exports[_0x3537('0x43')]=function(_0x968090,_0x16899f){var _0x46317e={'where':{'id':_0x968090[_0x3537('0x40')]['id']}},_0x2626cb={};_0x2626cb['model']=_[_0x3537('0x41')](db[_0x3537('0x29')][_0x3537('0x2a')]);_0x46317e[_0x3537('0x31')]=_[_0x3537('0x30')](_0x2626cb[_0x3537('0x2d')],qs['fields'](_0x968090[_0x3537('0x2e')][_0x3537('0x32')]));_0x46317e['attributes']=_0x46317e[_0x3537('0x31')]['length']?_0x46317e['attributes']:_0x2626cb[_0x3537('0x2d')];if(_0x968090['query'][_0x3537('0x42')]){_0x46317e[_0x3537('0x44')]=[{'all':!![]}];}_0x46317e=_['merge']({},_0x46317e,_0x968090[_0x3537('0x3b')]);return db['Attachment'][_0x3537('0x45')](_0x46317e)[_0x3537('0x24')](handleEntityNotFound(_0x16899f,null))[_0x3537('0x24')](function(_0x66ef22){if(_0x66ef22){var _0x23ab87=_0x66ef22[_0x3537('0x46')]({'plain':!![]});_0x23ab87=qs[_0x3537('0x47')](_0x23ab87,['id',_0x3537('0x48'),_0x3537('0x49')]);_0x968090[_0x3537('0x4a')]=_[_0x3537('0x47')](_0x968090[_0x3537('0x4a')],['id',_0x3537('0x48'),_0x3537('0x49')]);return db[_0x3537('0x29')]['create'](_[_0x3537('0x3a')](_0x23ab87,_0x968090['body']),{'include':_0x968090[_0x3537('0x2e')][_0x3537('0x42')]?[{'all':!![]}]:undefined});}})[_0x3537('0x24')](respondWithResult(_0x16899f,0xc9))['catch'](handleError(_0x16899f,null));};exports[_0x3537('0x23')]=function(_0x2f8732,_0x42f177){if(_0x2f8732[_0x3537('0x4a')]['id']){delete _0x2f8732[_0x3537('0x4a')]['id'];}return db[_0x3537('0x29')][_0x3537('0x45')]({'where':{'id':_0x2f8732[_0x3537('0x40')]['id']}})['then'](handleEntityNotFound(_0x42f177,null))[_0x3537('0x24')](saveUpdates(_0x2f8732[_0x3537('0x4a')],null))[_0x3537('0x24')](respondWithResult(_0x42f177,null))['catch'](handleError(_0x42f177,null));};exports[_0x3537('0x4b')]=function(_0x581cfd,_0x2bb1bf){return db[_0x3537('0x29')]['find']({'where':{'id':_0x581cfd[_0x3537('0x40')]['id']}})[_0x3537('0x24')](handleEntityNotFound(_0x2bb1bf,null))[_0x3537('0x24')](removeEntity(_0x2bb1bf,null))[_0x3537('0x3e')](handleError(_0x2bb1bf,null));};exports[_0x3537('0x4c')]=function(_0x2ea66c,_0x9aac49,_0x161b25){_0x2ea66c[_0x3537('0x4a')][_0x3537('0x25')]=_0x2ea66c[_0x3537('0x4d')]['originalname'];_0x2ea66c['body'][_0x3537('0x4e')]=_0x2ea66c['file'][_0x3537('0x4f')];_0x2ea66c[_0x3537('0x4a')][_0x3537('0x2b')]=_0x2ea66c[_0x3537('0x4d')][_0x3537('0x50')];return db[_0x3537('0x29')][_0x3537('0x4c')](_0x2ea66c[_0x3537('0x4a')])[_0x3537('0x24')](respondWithResult(_0x9aac49,0xc9))[_0x3537('0x3e')](handleError(_0x9aac49,null));};exports[_0x3537('0x51')]=function(_0x8e11bd,_0x5d8668,_0x489b7e){return db[_0x3537('0x29')][_0x3537('0x52')]({'where':{'id':_0x8e11bd['params']['id']},'raw':!![]})[_0x3537('0x24')](handleEntityNotFound(_0x5d8668,null))['then'](function(_0x449fea){if(_0x449fea){var _0x531242=_0x449fea['ChatOfflineMessageId']!==null;var _0xe095f2=path['join'](config[_0x3537('0x53')],_0x3537('0x54'));if(_0x531242){_0xe095f2=path[_0x3537('0x55')](_0xe095f2,_0x3537('0x56'));}var _0x23a6ff=path[_0x3537('0x55')](_0xe095f2,_0x449fea[_0x3537('0x4e')]);return _0x5d8668[_0x3537('0x51')](_0x23a6ff);}})[_0x3537('0x3e')](handleError(_0x5d8668,null));};
\ No newline at end of file
+var _0x8b85=['request-promise','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','name','send','index','map','Attachment','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','keys','rawAttributes','include','find','clone','get','updatedAt','body','omit','create','file','originalname','basename','filename','download','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','fast-json-patch'];(function(_0x42e626,_0x3973d4){var _0x1c324e=function(_0x1e7c0f){while(--_0x1e7c0f){_0x42e626['push'](_0x42e626['shift']());}};_0x1c324e(++_0x3973d4);}(_0x8b85,0xa7));var _0x58b8=function(_0x470f24,_0x2436a9){_0x470f24=_0x470f24-0x0;var _0x2c6fc8=_0x8b85[_0x470f24];return _0x2c6fc8;};'use strict';var emlformat=require(_0x58b8('0x0'));var rimraf=require(_0x58b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x58b8('0x2'));var rp=require(_0x58b8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x58b8('0x4'));var util=require(_0x58b8('0x5'));var path=require(_0x58b8('0x6'));var sox=require(_0x58b8('0x7'));var csv=require('to-csv');var ejs=require(_0x58b8('0x8'));var fs=require('fs');var fs_extra=require(_0x58b8('0x9'));var _=require('lodash');var squel=require(_0x58b8('0xa'));var crypto=require(_0x58b8('0xb'));var jsforce=require(_0x58b8('0xc'));var deskjs=require(_0x58b8('0xd'));var toCsv=require(_0x58b8('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x58b8('0xf'));var authService=require(_0x58b8('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x58b8('0x11'));var logger=require(_0x58b8('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x58b8('0x13'));var licenseUtil=require(_0x58b8('0x14'));var db=require(_0x58b8('0x15'))['db'];function respondWithStatusCode(_0x1b4038,_0x4863c2){_0x4863c2=_0x4863c2||0xcc;return function(_0x3347ac){if(_0x3347ac){return _0x1b4038[_0x58b8('0x16')](_0x4863c2);}return _0x1b4038[_0x58b8('0x17')](_0x4863c2)[_0x58b8('0x18')]();};}function respondWithResult(_0xc8c641,_0xf5fa31){_0xf5fa31=_0xf5fa31||0xc8;return function(_0x42ec6e){if(_0x42ec6e){return _0xc8c641[_0x58b8('0x17')](_0xf5fa31)[_0x58b8('0x19')](_0x42ec6e);}};}function respondWithFilteredResult(_0x21c42d,_0x12abba){return function(_0x3db64e){if(_0x3db64e){var _0x4b7a28=typeof _0x12abba[_0x58b8('0x1a')]===_0x58b8('0x1b')&&typeof _0x12abba[_0x58b8('0x1c')]==='undefined';var _0x123ba4=_0x3db64e[_0x58b8('0x1d')];var _0x58a9e5=_0x4b7a28?0x0:_0x12abba[_0x58b8('0x1a')];var _0x2e17df=_0x4b7a28?_0x3db64e[_0x58b8('0x1d')]:_0x12abba[_0x58b8('0x1a')]+_0x12abba[_0x58b8('0x1c')];var _0x2c3eca;if(_0x2e17df>=_0x123ba4){_0x2e17df=_0x123ba4;_0x2c3eca=0xc8;}else{_0x2c3eca=0xce;}_0x21c42d['status'](_0x2c3eca);return _0x21c42d[_0x58b8('0x1e')](_0x58b8('0x1f'),_0x58a9e5+'-'+_0x2e17df+'/'+_0x123ba4)['json'](_0x3db64e);}return null;};}function patchUpdates(_0x1fcfe6){return function(_0x2fa4f3){try{jsonpatch[_0x58b8('0x20')](_0x2fa4f3,_0x1fcfe6,!![]);}catch(_0x30e247){return BPromise[_0x58b8('0x21')](_0x30e247);}return _0x2fa4f3['save']();};}function saveUpdates(_0x43e674,_0x203a74){return function(_0x48d5b2){if(_0x48d5b2){return _0x48d5b2['update'](_0x43e674)[_0x58b8('0x22')](function(_0x2692aa){return _0x2692aa;});}return null;};}function removeEntity(_0x219559,_0x229f2b){return function(_0x47f252){if(_0x47f252){return _0x47f252[_0x58b8('0x23')]()[_0x58b8('0x22')](function(){_0x219559[_0x58b8('0x17')](0xcc)[_0x58b8('0x18')]();});}};}function handleEntityNotFound(_0x1fc9f8,_0x94570e){return function(_0x3c201f){if(!_0x3c201f){_0x1fc9f8[_0x58b8('0x16')](0x194);}return _0x3c201f;};}function handleError(_0x13b820,_0x21383b){_0x21383b=_0x21383b||0x1f4;return function(_0x5ed2d3){logger[_0x58b8('0x24')](_0x5ed2d3['stack']);if(_0x5ed2d3[_0x58b8('0x25')]){delete _0x5ed2d3[_0x58b8('0x25')];}_0x13b820[_0x58b8('0x17')](_0x21383b)[_0x58b8('0x26')](_0x5ed2d3);};}exports[_0x58b8('0x27')]=function(_0x5c2615,_0x336d9b){var _0x4e67d1={},_0x9ca5da={},_0x1f9312={'count':0x0,'rows':[]};var _0x1fd0d8=_[_0x58b8('0x28')](db[_0x58b8('0x29')]['rawAttributes'],function(_0x3c4213){return{'name':_0x3c4213[_0x58b8('0x2a')],'type':_0x3c4213[_0x58b8('0x2b')][_0x58b8('0x2c')]};});_0x9ca5da['model']=_[_0x58b8('0x28')](_0x1fd0d8,_0x58b8('0x25'));_0x9ca5da['query']=_['keys'](_0x5c2615[_0x58b8('0x2d')]);_0x9ca5da[_0x58b8('0x2e')]=_[_0x58b8('0x2f')](_0x9ca5da[_0x58b8('0x30')],_0x9ca5da[_0x58b8('0x2d')]);_0x4e67d1[_0x58b8('0x31')]=_['intersection'](_0x9ca5da[_0x58b8('0x30')],qs[_0x58b8('0x32')](_0x5c2615[_0x58b8('0x2d')]['fields']));_0x4e67d1[_0x58b8('0x31')]=_0x4e67d1[_0x58b8('0x31')][_0x58b8('0x33')]?_0x4e67d1['attributes']:_0x9ca5da[_0x58b8('0x30')];if(!_0x5c2615[_0x58b8('0x2d')][_0x58b8('0x34')](_0x58b8('0x35'))){_0x4e67d1[_0x58b8('0x1c')]=qs[_0x58b8('0x1c')](_0x5c2615[_0x58b8('0x2d')]['limit']);_0x4e67d1[_0x58b8('0x1a')]=qs[_0x58b8('0x1a')](_0x5c2615[_0x58b8('0x2d')][_0x58b8('0x1a')]);}_0x4e67d1['order']=qs[_0x58b8('0x36')](_0x5c2615[_0x58b8('0x2d')][_0x58b8('0x36')]);_0x4e67d1['where']=qs['filters'](_[_0x58b8('0x37')](_0x5c2615[_0x58b8('0x2d')],_0x9ca5da[_0x58b8('0x2e')]),_0x1fd0d8);if(_0x5c2615[_0x58b8('0x2d')]['filter']){_0x4e67d1[_0x58b8('0x38')]=_[_0x58b8('0x39')](_0x4e67d1['where'],{'$or':_['map'](_0x1fd0d8,function(_0x50bfd4){if(_0x50bfd4['type']!==_0x58b8('0x3a')){var _0x5c4bef={};_0x5c4bef[_0x50bfd4[_0x58b8('0x25')]]={'$like':'%'+_0x5c2615[_0x58b8('0x2d')][_0x58b8('0x3b')]+'%'};return _0x5c4bef;}})});}_0x4e67d1=_['merge']({},_0x4e67d1,_0x5c2615[_0x58b8('0x3c')]);var _0x1484f0={'where':_0x4e67d1['where']};return db['Attachment']['count'](_0x1484f0)[_0x58b8('0x22')](function(_0x1e4f6a){_0x1f9312['count']=_0x1e4f6a;if(_0x5c2615['query'][_0x58b8('0x3d')]){_0x4e67d1['include']=[{'all':!![]}];}return db[_0x58b8('0x29')]['findAll'](_0x4e67d1);})['then'](function(_0x29cc97){_0x1f9312[_0x58b8('0x3e')]=_0x29cc97;return _0x1f9312;})[_0x58b8('0x22')](respondWithFilteredResult(_0x336d9b,_0x4e67d1))[_0x58b8('0x3f')](handleError(_0x336d9b,null));};exports[_0x58b8('0x40')]=function(_0x2c5177,_0x120035){var _0x4a28f1={'raw':!![],'where':{'id':_0x2c5177[_0x58b8('0x41')]['id']}},_0x385eac={};_0x385eac[_0x58b8('0x30')]=_[_0x58b8('0x42')](db[_0x58b8('0x29')][_0x58b8('0x43')]);_0x385eac[_0x58b8('0x2d')]=_[_0x58b8('0x42')](_0x2c5177[_0x58b8('0x2d')]);_0x385eac[_0x58b8('0x2e')]=_[_0x58b8('0x2f')](_0x385eac[_0x58b8('0x30')],_0x385eac[_0x58b8('0x2d')]);_0x4a28f1[_0x58b8('0x31')]=_[_0x58b8('0x2f')](_0x385eac[_0x58b8('0x30')],qs[_0x58b8('0x32')](_0x2c5177['query']['fields']));_0x4a28f1[_0x58b8('0x31')]=_0x4a28f1['attributes'][_0x58b8('0x33')]?_0x4a28f1['attributes']:_0x385eac['model'];if(_0x2c5177['query']['includeAll']){_0x4a28f1[_0x58b8('0x44')]=[{'all':!![]}];}_0x4a28f1=_[_0x58b8('0x39')]({},_0x4a28f1,_0x2c5177[_0x58b8('0x3c')]);return db[_0x58b8('0x29')][_0x58b8('0x45')](_0x4a28f1)[_0x58b8('0x22')](handleEntityNotFound(_0x120035,null))['then'](respondWithResult(_0x120035,null))[_0x58b8('0x3f')](handleError(_0x120035,null));};exports[_0x58b8('0x46')]=function(_0x24d0b3,_0xf89ad){var _0x526e15={'where':{'id':_0x24d0b3['params']['id']}},_0x326930={};_0x326930[_0x58b8('0x30')]=_[_0x58b8('0x42')](db[_0x58b8('0x29')][_0x58b8('0x43')]);_0x526e15[_0x58b8('0x31')]=_[_0x58b8('0x2f')](_0x326930[_0x58b8('0x30')],qs[_0x58b8('0x32')](_0x24d0b3[_0x58b8('0x2d')][_0x58b8('0x32')]));_0x526e15['attributes']=_0x526e15[_0x58b8('0x31')][_0x58b8('0x33')]?_0x526e15[_0x58b8('0x31')]:_0x326930['model'];if(_0x24d0b3[_0x58b8('0x2d')][_0x58b8('0x3d')]){_0x526e15[_0x58b8('0x44')]=[{'all':!![]}];}_0x526e15=_[_0x58b8('0x39')]({},_0x526e15,_0x24d0b3[_0x58b8('0x3c')]);return db['Attachment'][_0x58b8('0x45')](_0x526e15)['then'](handleEntityNotFound(_0xf89ad,null))[_0x58b8('0x22')](function(_0x8ffe7e){if(_0x8ffe7e){var _0x1f36c5=_0x8ffe7e[_0x58b8('0x47')]({'plain':!![]});_0x1f36c5=qs['omit'](_0x1f36c5,['id','createdAt',_0x58b8('0x48')]);_0x24d0b3[_0x58b8('0x49')]=_[_0x58b8('0x4a')](_0x24d0b3[_0x58b8('0x49')],['id','createdAt',_0x58b8('0x48')]);return db[_0x58b8('0x29')]['create'](_[_0x58b8('0x39')](_0x1f36c5,_0x24d0b3['body']),{'include':_0x24d0b3[_0x58b8('0x2d')][_0x58b8('0x3d')]?[{'all':!![]}]:undefined});}})[_0x58b8('0x22')](respondWithResult(_0xf89ad,0xc9))['catch'](handleError(_0xf89ad,null));};exports['update']=function(_0x16451c,_0xce39a3){if(_0x16451c[_0x58b8('0x49')]['id']){delete _0x16451c['body']['id'];}return db[_0x58b8('0x29')][_0x58b8('0x45')]({'where':{'id':_0x16451c[_0x58b8('0x41')]['id']}})[_0x58b8('0x22')](handleEntityNotFound(_0xce39a3,null))[_0x58b8('0x22')](saveUpdates(_0x16451c[_0x58b8('0x49')],null))[_0x58b8('0x22')](respondWithResult(_0xce39a3,null))[_0x58b8('0x3f')](handleError(_0xce39a3,null));};exports[_0x58b8('0x23')]=function(_0x51fb93,_0xd74a6){return db[_0x58b8('0x29')][_0x58b8('0x45')]({'where':{'id':_0x51fb93[_0x58b8('0x41')]['id']}})[_0x58b8('0x22')](handleEntityNotFound(_0xd74a6,null))[_0x58b8('0x22')](removeEntity(_0xd74a6,null))[_0x58b8('0x3f')](handleError(_0xd74a6,null));};exports[_0x58b8('0x4b')]=function(_0x287b13,_0x17971b,_0x484c9f){_0x287b13['body'][_0x58b8('0x25')]=_0x287b13[_0x58b8('0x4c')][_0x58b8('0x4d')];_0x287b13[_0x58b8('0x49')][_0x58b8('0x4e')]=_0x287b13[_0x58b8('0x4c')][_0x58b8('0x4f')];_0x287b13[_0x58b8('0x49')]['type']=_0x287b13[_0x58b8('0x4c')]['mimetype'];return db[_0x58b8('0x29')][_0x58b8('0x4b')](_0x287b13[_0x58b8('0x49')])['then'](respondWithResult(_0x17971b,0xc9))['catch'](handleError(_0x17971b,null));};exports[_0x58b8('0x50')]=function(_0x32c32b,_0x2280e7,_0x4168e9){return db['Attachment']['findOne']({'where':{'id':_0x32c32b[_0x58b8('0x41')]['id']},'raw':!![]})[_0x58b8('0x22')](handleEntityNotFound(_0x2280e7,null))[_0x58b8('0x22')](function(_0x1e382e){if(_0x1e382e){var _0x223a7d=_0x1e382e[_0x58b8('0x51')]!==null;var _0x24a51c=path[_0x58b8('0x52')](config[_0x58b8('0x53')],'server/files/attachments/');if(_0x223a7d){_0x24a51c=path['join'](_0x24a51c,_0x58b8('0x54'));}var _0x205232=path[_0x58b8('0x52')](_0x24a51c,_0x1e382e[_0x58b8('0x4e')]);return _0x2280e7['download'](_0x205232);}})[_0x58b8('0x3f')](handleError(_0x2280e7,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 57b9630..9ec035e 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 _0x9732=['../../config/logger','api','bluebird','request-promise','rimraf','exports','Attachment','attachments','lodash'];(function(_0x7a8365,_0x563ade){var _0x55359f=function(_0x344dc2){while(--_0x344dc2){_0x7a8365['push'](_0x7a8365['shift']());}};_0x55359f(++_0x563ade);}(_0x9732,0x1b8));var _0x2973=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x9732[_0x1f36bb];return _0xaf97fa;};'use strict';var _=require(_0x2973('0x0'));var util=require('util');var logger=require(_0x2973('0x1'))(_0x2973('0x2'));var moment=require('moment');var BPromise=require(_0x2973('0x3'));var rp=require(_0x2973('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2973('0x5'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x2973('0x6')]=function(_0x3facff,_0x56897f){return _0x3facff['define'](_0x2973('0x7'),attributes,{'tableName':_0x2973('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xafca=['util','api','moment','bluebird','path','rimraf','exports','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xafca,0x167));var _0xaafc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xafca[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xaafc('0x0'));var util=require(_0xaafc('0x1'));var logger=require('../../config/logger')(_0xaafc('0x2'));var moment=require(_0xaafc('0x3'));var BPromise=require(_0xaafc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaafc('0x5'));var rimraf=require(_0xaafc('0x6'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0xaafc('0x7')]=function(_0x2c679d,_0x466ff9){return _0x2c679d['define']('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 262f3f6..2a3b44d 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 _0xe706=['result','catch','CreateAttachment','create','body','options','raw','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x4e7cf6,_0x490184){var _0x13c52c=function(_0x4d58ed){while(--_0x4d58ed){_0x4e7cf6['push'](_0x4e7cf6['shift']());}};_0x13c52c(++_0x490184);}(_0xe706,0xa3));var _0x6e70=function(_0x3faaf8,_0x16d9ae){_0x3faaf8=_0x3faaf8-0x0;var _0x1a3527=_0xe706[_0x3faaf8];return _0x1a3527;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('Attachment,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['Attachment'][_0x6e70('0x1a')](_0x5ea7a5[_0x6e70('0x1b')],{'raw':_0x5ea7a5[_0x6e70('0x1c')]?_0x5ea7a5[_0x6e70('0x1c')][_0x6e70('0x1d')]===undefined?!![]:![]:!![]})[_0x6e70('0xe')](function(_0x1b2453){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('CreateAttachment',_0x5ea7a5,JSON[_0x6e70('0x1e')](_0x1b2453));_0x173afe(_0x1b2453);})[_0x6e70('0x18')](function(_0x27b294){logger['error'](_0x6e70('0x19'),_0x27b294[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0x27b294['message']));});});};
\ No newline at end of file
+var _0x2dae=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Attachment','body','options','raw','info','CreateAttachment','lodash'];(function(_0x172298,_0x542449){var _0x44856d=function(_0xa648ba){while(--_0xa648ba){_0x172298['push'](_0x172298['shift']());}};_0x44856d(++_0x542449);}(_0x2dae,0xc3));var _0xe2da=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x2dae[_0x51fe5f];return _0x4abce9;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var moment=require(_0xe2da('0x1'));var BPromise=require(_0xe2da('0x2'));var rs=require(_0xe2da('0x3'));var fs=require('fs');var Redis=require(_0xe2da('0x4'));var db=require(_0xe2da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2da('0x6'))(_0xe2da('0x7'));var config=require(_0xe2da('0x8'));var jayson=require(_0xe2da('0x9'));var client=jayson['client'][_0xe2da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x89c70b,_0x34cc98,_0x2efbd8){return new BPromise(function(_0x238da3,_0x1c71ea){return client[_0xe2da('0xb')](_0x89c70b,_0x2efbd8)[_0xe2da('0xc')](function(_0x68aa40){logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));logger[_0xe2da('0xf')](_0xe2da('0x10'),_0x34cc98,_0xe2da('0xe'),JSON[_0xe2da('0x11')](_0x68aa40));if(_0x68aa40[_0xe2da('0x12')]){if(_0x68aa40[_0xe2da('0x12')]['code']===0x1f4){logger[_0xe2da('0x12')]('Attachment,\x20%s,\x20%s',_0x34cc98,_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);return _0x1c71ea(_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);}logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x68aa40[_0xe2da('0x12')]['message']);return _0x238da3(_0x68aa40[_0xe2da('0x12')]['message']);}else{logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));_0x238da3(_0x68aa40[_0xe2da('0x14')]['message']);}})[_0xe2da('0x15')](function(_0x2c0353){logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x2c0353);_0x1c71ea(_0x2c0353);});});}exports['CreateAttachment']=function(_0x45bb92){var _0x1f7d33=this;return new Promise(function(_0x417363,_0x2e5730){return db[_0xe2da('0x16')]['create'](_0x45bb92[_0xe2da('0x17')],{'raw':_0x45bb92[_0xe2da('0x18')]?_0x45bb92['options'][_0xe2da('0x19')]===undefined?!![]:![]:!![]})[_0xe2da('0xc')](function(_0x332193){logger[_0xe2da('0x1a')](_0xe2da('0x1b'),_0x45bb92);logger[_0xe2da('0xf')]('CreateAttachment',_0x45bb92,JSON[_0xe2da('0x11')](_0x332193));_0x417363(_0x332193);})['catch'](function(_0x30efdc){logger[_0xe2da('0x12')](_0xe2da('0x1b'),_0x30efdc[_0xe2da('0x13')],_0x45bb92);_0x2e5730(_0x1f7d33[_0xe2da('0x12')](0x1f4,_0x30efdc[_0xe2da('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index dd80a28..d22b5d4 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x52cce9,_0x130edf){var _0x2bcf4a=function(_0x2db516){while(--_0x2db516){_0x52cce9['push'](_0x52cce9['shift']());}};_0x2bcf4a(++_0x130edf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x155762,_0x5e466b){_0x155762=_0x155762-0x0;var _0x3e5332=_0x5f2f[_0x155762];return _0x3e5332;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x227685,_0x586c72){var _0xefd128=function(_0x432d70){while(--_0x432d70){_0x227685['push'](_0x227685['shift']());}};_0xefd128(++_0x586c72);}(_0x5f2f,0x73));var _0xf5f2=function(_0x22da09,_0x29f1b0){_0x22da09=_0x22da09-0x0;var _0x56a486=_0x5f2f[_0x22da09];return _0x56a486;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index b637189..87529ad 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 _0x65ab=['google','/login','profile','email','callback','use','clientID','clientSecret','Setting','then','User','find','emails','value','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','authenticate'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x65ab,0x18f));var _0xb65a=function(_0x304c76,_0x24b856){_0x304c76=_0x304c76-0x0;var _0x4b1536=_0x65ab[_0x304c76];return _0x4b1536;};'use strict';var _=require(_0xb65a('0x0'));var passport=require('passport');var GoogleStrategy=require(_0xb65a('0x1'))[_0xb65a('0x2')];var moment=require(_0xb65a('0x3'));var db=require(_0xb65a('0x4'))['db'];var config=require(_0xb65a('0x5'));var signToken=require(_0xb65a('0x6'))['signToken'];var utils=require(_0xb65a('0x7'));exports['login']=passport[_0xb65a('0x8')](_0xb65a('0x9'),{'failureRedirect':_0xb65a('0xa'),'scope':[_0xb65a('0xb'),_0xb65a('0xc')],'session':![]});exports[_0xb65a('0xd')]=passport[_0xb65a('0x8')](_0xb65a('0x9'),{'failureRedirect':_0xb65a('0xa'),'session':![]});passport[_0xb65a('0xe')](new GoogleStrategy({'clientID':config[_0xb65a('0x9')]?config[_0xb65a('0x9')][_0xb65a('0xf')]:'id','clientSecret':config[_0xb65a('0x9')]?config['google'][_0xb65a('0x10')]:'secret','callbackURL':config[_0xb65a('0x9')]?config[_0xb65a('0x9')]['callbackURL']:''},function(_0x42c4fe,_0x608834,_0x558f99,_0x405c6e){var _0x10bbf4,_0x4e1f83;return db[_0xb65a('0x11')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xb65a('0x12')](function(_0x4a3735){_0x10bbf4=_0x4a3735;return db[_0xb65a('0x13')][_0xb65a('0x14')]({'where':{'email':_['map'](_0x558f99[_0xb65a('0x15')],_0xb65a('0x16')),'role':{'$or':['admin','user',_0xb65a('0x17')]}}});})[_0xb65a('0x12')](function(_0x588797){_0x4e1f83=_0x588797;if(_0x4e1f83){if(_0x4e1f83[_0xb65a('0x18')]){return _0x405c6e(_0xb65a('0x19'));}else if(_0x10bbf4[_0xb65a('0x1a')]>0x0){if(_0x4e1f83[_0xb65a('0x1b')]){if(moment(_0x4e1f83[_0xb65a('0x1c')])[_0xb65a('0x1d')](_0x10bbf4['blockDuration'],_0xb65a('0x1e'))>moment()){return _0x405c6e(_0xb65a('0x19'));}else{return utils[_0xb65a('0x1f')](_0x4e1f83,0x0,![],null)[_0xb65a('0x12')](function(){return utils[_0xb65a('0x20')](_0x4e1f83);})[_0xb65a('0x12')](function(){return _0x405c6e(null,_0x4e1f83);});}}else{return utils[_0xb65a('0x20')](_0x4e1f83)[_0xb65a('0x12')](function(){return _0x405c6e(null,_0x4e1f83);});}}else{return utils[_0xb65a('0x20')](_0x4e1f83)[_0xb65a('0x12')](function(){return _0x405c6e(null,_0x4e1f83);});}}return _0x405c6e('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xb65a('0x21')](function(_0x9d762d){_0x405c6e(_0x9d762d);});}));
\ No newline at end of file
+var _0x2835=['../../mysqldb','../../config/environment','signToken','login','authenticate','google','/login','profile','email','callback','use','clientID','secret','callbackURL','Setting','blockDuration','then','User','emails','value','admin','agent','disabled','blocked','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','lodash','Strategy'];(function(_0x199261,_0x1a017c){var _0x5a2249=function(_0x28693f){while(--_0x28693f){_0x199261['push'](_0x199261['shift']());}};_0x5a2249(++_0x1a017c);}(_0x2835,0x1be));var _0x5283=function(_0x153cfc,_0x2acad7){_0x153cfc=_0x153cfc-0x0;var _0x4b34b7=_0x2835[_0x153cfc];return _0x4b34b7;};'use strict';var _=require(_0x5283('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')[_0x5283('0x1')];var moment=require('moment');var db=require(_0x5283('0x2'))['db'];var config=require(_0x5283('0x3'));var signToken=require('../../components/auth/service')[_0x5283('0x4')];var utils=require('../../config/utils');exports[_0x5283('0x5')]=passport[_0x5283('0x6')](_0x5283('0x7'),{'failureRedirect':_0x5283('0x8'),'scope':[_0x5283('0x9'),_0x5283('0xa')],'session':![]});exports[_0x5283('0xb')]=passport[_0x5283('0x6')](_0x5283('0x7'),{'failureRedirect':_0x5283('0x8'),'session':![]});passport[_0x5283('0xc')](new GoogleStrategy({'clientID':config[_0x5283('0x7')]?config[_0x5283('0x7')][_0x5283('0xd')]:'id','clientSecret':config[_0x5283('0x7')]?config[_0x5283('0x7')]['clientSecret']:_0x5283('0xe'),'callbackURL':config[_0x5283('0x7')]?config[_0x5283('0x7')][_0x5283('0xf')]:''},function(_0x5cf919,_0x49ba6a,_0x439f38,_0x1e37b4){var _0x3f0ef5,_0x2aa684;return db[_0x5283('0x10')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x5283('0x11')],'raw':!![]})[_0x5283('0x12')](function(_0x59871b){_0x3f0ef5=_0x59871b;return db[_0x5283('0x13')]['find']({'where':{'email':_['map'](_0x439f38[_0x5283('0x14')],_0x5283('0x15')),'role':{'$or':[_0x5283('0x16'),'user',_0x5283('0x17')]}}});})[_0x5283('0x12')](function(_0xccc9e4){_0x2aa684=_0xccc9e4;if(_0x2aa684){if(_0x2aa684[_0x5283('0x18')]){return _0x1e37b4('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x3f0ef5[_0x5283('0x11')]>0x0){if(_0x2aa684[_0x5283('0x19')]){if(moment(_0x2aa684['blockedAt'])[_0x5283('0x1a')](_0x3f0ef5[_0x5283('0x11')],_0x5283('0x1b'))>moment()){return _0x1e37b4(_0x5283('0x1c'));}else{return utils[_0x5283('0x1d')](_0x2aa684,0x0,![],null)[_0x5283('0x12')](function(){return utils[_0x5283('0x1e')](_0x2aa684);})['then'](function(){return _0x1e37b4(null,_0x2aa684);});}}else{return utils['getLicense'](_0x2aa684)[_0x5283('0x12')](function(){return _0x1e37b4(null,_0x2aa684);});}}else{return utils[_0x5283('0x1e')](_0x2aa684)[_0x5283('0x12')](function(){return _0x1e37b4(null,_0x2aa684);});}}return _0x1e37b4(_0x5283('0x1c'));})[_0x5283('0x1f')](function(_0x6b8345){_0x1e37b4(_0x6b8345);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index bbd8c66..5df24be 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 _0xb00a=['get','/callback','callback','isMiddleware','exports','express','passport','../user/user.controller.js'];(function(_0x39e6cd,_0x44e972){var _0x2a321a=function(_0x5b8b8f){while(--_0x5b8b8f){_0x39e6cd['push'](_0x39e6cd['shift']());}};_0x2a321a(++_0x44e972);}(_0xb00a,0xb5));var _0xab00=function(_0x2ab4a4,_0x11a3c5){_0x2ab4a4=_0x2ab4a4-0x0;var _0x1508ab=_0xb00a[_0x2ab4a4];return _0x1508ab;};'use strict';var express=require(_0xab00('0x0'));var passport=require(_0xab00('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xab00('0x2'));var authService=require('../../components/auth/service');router[_0xab00('0x3')]('/',controller['login']);router[_0xab00('0x3')](_0xab00('0x4'),controller[_0xab00('0x5')],authService[_0xab00('0x6')],userController['login'],authService['setTokenCookie']);module[_0xab00('0x7')]=router;
\ No newline at end of file
+var _0x766c=['get','login','isMiddleware','setTokenCookie','exports','express','passport','./authGoogle.controller','../../components/auth/service'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x766c,0xa7));var _0xc766=function(_0x3ac29d,_0x470873){_0x3ac29d=_0x3ac29d-0x0;var _0x17bf03=_0x766c[_0x3ac29d];return _0x17bf03;};'use strict';var express=require(_0xc766('0x0'));var passport=require(_0xc766('0x1'));var router=express['Router']();var controller=require(_0xc766('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0xc766('0x3'));router[_0xc766('0x4')]('/',controller[_0xc766('0x5')]);router[_0xc766('0x4')]('/callback',controller['callback'],authService[_0xc766('0x6')],userController[_0xc766('0x5')],authService[_0xc766('0x7')]);module[_0xc766('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 143a53f..e2966f4 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 _0x85ae=['blockedAt','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','disabled','clearBlockUser','add','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','merge','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','message','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','passwordHistoryLimit','securePassword','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','blocked'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x85ae,0xf7));var _0xe85a=function(_0x283043,_0x36f59b){_0x283043=_0x283043-0x0;var _0x37c686=_0x85ae[_0x283043];return _0x37c686;};'use strict';var util=require(_0xe85a('0x0'));var passport=require(_0xe85a('0x1'));var LocalStrategy=require(_0xe85a('0x2'))[_0xe85a('0x3')];var jayson=require(_0xe85a('0x4'));var _=require(_0xe85a('0x5'));var rs=require('randomstring');var moment=require(_0xe85a('0x6'));var db=require(_0xe85a('0x7'))['db'];var authService=require(_0xe85a('0x8'));var utils=require(_0xe85a('0x9'));var client=jayson['client'][_0xe85a('0xa')]({'port':0x232b});function localAuthenticate(_0x4e855d,_0x2b7138,_0x7ee9e5,_0x104aa6){var _0x9c7611,_0x3f105d;return db[_0xe85a('0xb')][_0xe85a('0xc')]({'where':{'id':0x1},'attributes':[_0xe85a('0xd'),_0xe85a('0xe')],'raw':!![]})[_0xe85a('0xf')](function(_0x1b1c94){_0x9c7611=_0x1b1c94;return _0x4e855d[_0xe85a('0xc')]({'attributes':['id',_0xe85a('0x10'),_0xe85a('0x11'),'salt',_0xe85a('0x12'),'disabled',_0xe85a('0x13'),_0xe85a('0x14'),'loginAttempts'],'where':{'name':_0x2b7138,'role':{'$or':[_0xe85a('0x15'),'user',_0xe85a('0x16')]}}});})[_0xe85a('0xf')](function(_0x39c623){if(!_0x39c623||_0x39c623&&_0x39c623[_0xe85a('0x10')]!==_0x2b7138){throw new Error(_0xe85a('0x17'));}else{_0x3f105d=_0x39c623;return _0x3f105d;}})[_0xe85a('0xf')](function(){_0x3f105d[_0xe85a('0x18')](_0x7ee9e5,function(_0xdb5687,_0x1d92ad){var _0x1da2e3=_0x3f105d[_0xe85a('0x19')]+0x1;if(_0xdb5687){return _0x104aa6(_0xdb5687);}else if(!_0x1d92ad){if(_0x3f105d[_0xe85a('0x1a')]){return _0x104aa6(null,![],{'message':_0xe85a('0x17')});}else if(_0x9c7611[_0xe85a('0xd')]>0x0){if(_0x3f105d[_0xe85a('0x13')]){if(_0x9c7611[_0xe85a('0xe')]>0x0){if(moment(_0x3f105d[_0xe85a('0x14')])['add'](_0x9c7611['blockDuration'],'minutes')>moment()){return _0x104aa6(null,![],{'message':_0xe85a('0x17')});}else{return utils[_0xe85a('0x1b')](_0x3f105d,_0x1da2e3,![],null)[_0xe85a('0xf')](function(){return _0x104aa6(null,![],{'message':_0xe85a('0x17')});});}}else{return _0x104aa6(null,![],{'message':_0xe85a('0x17')});}}else{if(_0x1da2e3>=_0x9c7611[_0xe85a('0xd')]){return utils['clearBlockUser'](_0x3f105d,0x0,!![],moment())[_0xe85a('0xf')](function(){return _0x104aa6(null,![],{'message':_0xe85a('0x17')});});}else{return utils['clearBlockUser'](_0x3f105d,_0x1da2e3,![],null)['then'](function(){return _0x104aa6(null,![],{'message':_0xe85a('0x17')});});}}}else{return _0x104aa6(null,![],{'message':_0xe85a('0x17')});}}else{if(_0x3f105d[_0xe85a('0x1a')]){return _0x104aa6(null,![],{'message':_0xe85a('0x17')});}else if(_0x9c7611[_0xe85a('0xd')]>0x0){if(_0x3f105d[_0xe85a('0x13')]){if(_0x9c7611[_0xe85a('0xe')]>0x0){if(moment(_0x3f105d[_0xe85a('0x14')])[_0xe85a('0x1c')](_0x9c7611[_0xe85a('0xe')],_0xe85a('0x1d'))>moment()){return _0x104aa6(null,![],{'message':_0xe85a('0x17')});}else{return utils['clearBlockUser'](_0x3f105d,0x0,![],null)[_0xe85a('0xf')](function(){return utils['getLicense'](_0x3f105d);})['then'](function(){return _0x104aa6(null,_0x3f105d);});}}else{return _0x104aa6(null,![],{'message':_0xe85a('0x17')});}}else{return utils[_0xe85a('0x1b')](_0x3f105d,0x0,![],null)[_0xe85a('0xf')](function(){return utils[_0xe85a('0x1e')](_0x3f105d);})[_0xe85a('0xf')](function(){return _0x104aa6(null,_0x3f105d);})['catch'](function(_0x1b7807){return _0x104aa6(null,![],_0x1b7807);});}}else{if(_0x3f105d[_0xe85a('0x13')]){return _0x104aa6(null,![],{'message':_0xe85a('0x17')});}else{return utils[_0xe85a('0x1e')](_0x3f105d)[_0xe85a('0xf')](function(){return _0x104aa6(null,_0x3f105d);});}}}});})[_0xe85a('0x1f')](function(_0x3a9522){return _0x104aa6(null,![],_0x3a9522);});}function sendServiceMail(_0x5b8f94){return db[_0xe85a('0x20')][_0xe85a('0x21')]({'where':{'service':!![]},'attributes':['id',_0xe85a('0x10'),_0xe85a('0x22')],'include':[{'model':db[_0xe85a('0x23')],'as':_0xe85a('0x24')}]})[_0xe85a('0xf')](function(_0x437ab2){if(!_0x437ab2){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x2e0630={'tls':{'rejectUnauthorized':![]}};if(_0x437ab2[_0xe85a('0x24')][_0xe85a('0x25')]){_0x2e0630[_0xe85a('0x25')]=_0x437ab2[_0xe85a('0x24')][_0xe85a('0x25')];}else{_0x2e0630[_0xe85a('0x26')]=_0x437ab2[_0xe85a('0x24')][_0xe85a('0x26')];_0x2e0630[_0xe85a('0x27')]=_0x437ab2[_0xe85a('0x24')][_0xe85a('0x27')];_0x2e0630[_0xe85a('0x28')]=_0x437ab2['Smtp'][_0xe85a('0x28')];}if(_0x437ab2[_0xe85a('0x24')][_0xe85a('0x29')]){_0x2e0630[_0xe85a('0x2a')]={'user':_0x437ab2[_0xe85a('0x24')][_0xe85a('0x2b')],'pass':_0x437ab2['Smtp'][_0xe85a('0x2c')]};}var _0x4eb429={'account':_0x2e0630,'message':_[_0xe85a('0x2d')]({'from':util['format'](_0xe85a('0x2e'),_0x437ab2[_0xe85a('0x10')],_0x437ab2[_0xe85a('0x22')]||_0x437ab2[_0xe85a('0x24')][_0xe85a('0x2b')])},_0x5b8f94)};return client[_0xe85a('0x2f')](_0xe85a('0x30'),_0x4eb429);})[_0xe85a('0xf')](function(_0x2456a5){if(_0x2456a5[_0xe85a('0x31')]){throw new Error(util['format'](_0xe85a('0x32'),_0x2456a5['error']['message']||JSON[_0xe85a('0x33')](_0x2456a5[_0xe85a('0x31')])));}return!![];});}function handleError(_0x3e484a,_0x176772,_0x49fcdc){return _0x3e484a['status'](_0x176772||0x1f4)['send']({'message':_0x49fcdc?_0x49fcdc[_0xe85a('0x34')]||_0x49fcdc:''});}exports[_0xe85a('0x35')]=function(_0x509d6b,_0x4eb70f,_0x36765c){passport[_0xe85a('0x18')](_0xe85a('0x36'),function(_0x304119,_0x4d0edd,_0x58bcea){var _0x5a5144=_0x304119||_0x58bcea;if(_0x5a5144){return handleError(_0x4eb70f,0x191,_0x5a5144);}if(!_0x4d0edd){return handleError(_0x4eb70f,0x194,{'message':_0xe85a('0x37')});}else{var _0xdad63c={'payload':{'id':_0x4d0edd['id'],'role':_0x4d0edd[_0xe85a('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0xe85a('0x38')](_0xdad63c)[_0xe85a('0xf')](function(_0x1069fa){_0x4eb70f[_0xe85a('0x39')]({'id':_0x4d0edd['id'],'token':_0x1069fa,'statusCall':'','isAlreadyLogged':_0x4d0edd[_0xe85a('0x3a')]});});}})(_0x509d6b,_0x4eb70f,_0x36765c);};exports[_0xe85a('0x3b')]=function(_0x259f45,_0x5be8fc,_0x2ca060){if(!_0x259f45[_0xe85a('0x3c')][_0xe85a('0x22')]){return handleError(_0x5be8fc,0x1f4,{'message':_0xe85a('0x3d')});}var _0x417a67=rs[_0xe85a('0x3e')]();_0x259f45['body'][_0xe85a('0x22')]=_0x259f45[_0xe85a('0x3c')][_0xe85a('0x22')]['trim']()['toLowerCase']();var _0x34930c;return db['Setting'][_0xe85a('0xc')]({'where':{'id':0x1},'attributes':[_0xe85a('0xd'),_0xe85a('0xe')],'raw':!![]})[_0xe85a('0xf')](function(_0x5ad87f){_0x34930c=_0x5ad87f;return db[_0xe85a('0x3f')][_0xe85a('0x21')]({'where':{'email':_0x259f45['body']['email']}});})['then'](function(_0x3b0ea5){if(!_0x3b0ea5){throw new Error(_0xe85a('0x40'));}if(_0x3b0ea5[_0xe85a('0x1a')]){throw new Error(_0xe85a('0x41'));}if(_0x3b0ea5[_0xe85a('0x13')]){if(moment(_0x3b0ea5[_0xe85a('0x14')])[_0xe85a('0x1c')](_0x34930c['blockDuration'],_0xe85a('0x1d'))>moment()){throw new Error(_0xe85a('0x42'));}else{_0x3b0ea5['blocked']=![];_0x3b0ea5[_0xe85a('0x14')]=null;}}_0x3b0ea5[_0xe85a('0x43')]=_0x417a67;_0x3b0ea5[_0xe85a('0x44')]=Date[_0xe85a('0x45')]()+0x36ee80;return _0x3b0ea5[_0xe85a('0x46')]();})[_0xe85a('0xf')](function(){return sendServiceMail({'to':_0x259f45['body']['email'],'subject':_0xe85a('0x47'),'text':_0xe85a('0x48')+_0xe85a('0x49')+_0xe85a('0x4a')+_0x259f45['headers'][_0xe85a('0x26')]+'/reset/'+_0x417a67+'\x0a\x0a'+_0xe85a('0x4b')});})[_0xe85a('0xf')](function(){_0x5be8fc[_0xe85a('0x4c')](0xc8)[_0xe85a('0x4d')]({'message':_0xe85a('0x4e')});})[_0xe85a('0x1f')](function(_0x19c716){return handleError(_0x5be8fc,0x1f4,_0x19c716);});};exports[_0xe85a('0x4f')]=function(_0x5a0fee,_0x3b5494,_0x44a5cc){return db['User'][_0xe85a('0x21')]({'where':{'resetPasswordToken':_0x5a0fee[_0xe85a('0x50')]['token'],'resetPasswordExpires':{'$gt':Date[_0xe85a('0x45')]()}}})[_0xe85a('0xf')](function(_0x1bd252){if(!_0x1bd252){throw new Error(_0xe85a('0x51'));}return db[_0xe85a('0xb')][_0xe85a('0xc')]({'attributes':['id','securePassword','enforcePasswordHistory',_0xe85a('0x52')]})['then'](function(_0x4e5ea6){if(_0x4e5ea6[_0xe85a('0x53')])authService[_0xe85a('0x54')](_0x5a0fee[_0xe85a('0x3c')]['password']);if(!_0x4e5ea6[_0xe85a('0x55')]||!_0x1bd252[_0xe85a('0x56')])return _0x1bd252;authService[_0xe85a('0x57')](_0x5a0fee[_0xe85a('0x3c')]['password'],_0x1bd252[_0xe85a('0x56')],_0x4e5ea6['passwordHistoryLimit']);return _0x1bd252;})[_0xe85a('0xf')](function(){_0x1bd252[_0xe85a('0x11')]=_0x5a0fee[_0xe85a('0x3c')][_0xe85a('0x11')];_0x1bd252[_0xe85a('0x43')]=null;_0x1bd252[_0xe85a('0x44')]=null;return _0x1bd252['save']();});})[_0xe85a('0xf')](function(){_0x3b5494['status'](0xc8)[_0xe85a('0x4d')]({'message':_0xe85a('0x58')});})[_0xe85a('0x1f')](function(_0x4a6455){return handleError(_0x3b5494,0x1f4,_0x4a6455);});};passport['use'](new LocalStrategy({'usernameField':'name','passwordField':_0xe85a('0x11')},function(_0x5df2b7,_0x27351a,_0x53a17b){return localAuthenticate(db[_0xe85a('0x3f')],_0x5df2b7,_0x27351a,_0x53a17b);}));
\ No newline at end of file
+var _0xbf1a=['User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Setting','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','Password\x20reset!','util','passport','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','then','password','disabled','blocked','admin','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','blockDuration','blockedAt','clearBlockUser','add','getLicense','catch','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','user','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','login','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','Email\x20parameter\x20is\x20missing','generate','body','trim'];(function(_0x27999e,_0x1cbbd2){var _0x19498d=function(_0x2bd9ab){while(--_0x2bd9ab){_0x27999e['push'](_0x27999e['shift']());}};_0x19498d(++_0x1cbbd2);}(_0xbf1a,0x16d));var _0xabf1=function(_0x342e6d,_0xe4cce2){_0x342e6d=_0x342e6d-0x0;var _0x45ae7f=_0xbf1a[_0x342e6d];return _0x45ae7f;};'use strict';var util=require(_0xabf1('0x0'));var passport=require(_0xabf1('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0xabf1('0x2'));var _=require(_0xabf1('0x3'));var rs=require(_0xabf1('0x4'));var moment=require(_0xabf1('0x5'));var db=require(_0xabf1('0x6'))['db'];var authService=require(_0xabf1('0x7'));var utils=require(_0xabf1('0x8'));var client=jayson[_0xabf1('0x9')][_0xabf1('0xa')]({'port':0x232b});function localAuthenticate(_0x2dad0a,_0x2e5203,_0x4be08b,_0x1bf70e){var _0xcfec60,_0x48c89c;return db['Setting'][_0xabf1('0xb')]({'where':{'id':0x1},'attributes':[_0xabf1('0xc'),'blockDuration'],'raw':!![]})[_0xabf1('0xd')](function(_0x496107){_0xcfec60=_0x496107;return _0x2dad0a[_0xabf1('0xb')]({'attributes':['id','name',_0xabf1('0xe'),'salt','role',_0xabf1('0xf'),_0xabf1('0x10'),'blockedAt','loginAttempts'],'where':{'name':_0x2e5203,'role':{'$or':[_0xabf1('0x11'),'user',_0xabf1('0x12')]}}});})[_0xabf1('0xd')](function(_0x22f909){if(!_0x22f909||_0x22f909&&_0x22f909[_0xabf1('0x13')]!==_0x2e5203){throw new Error(_0xabf1('0x14'));}else{_0x48c89c=_0x22f909;return _0x48c89c;}})[_0xabf1('0xd')](function(){_0x48c89c['authenticate'](_0x4be08b,function(_0x5a3aa9,_0x49208c){var _0x2f0444=_0x48c89c[_0xabf1('0x15')]+0x1;if(_0x5a3aa9){return _0x1bf70e(_0x5a3aa9);}else if(!_0x49208c){if(_0x48c89c[_0xabf1('0xf')]){return _0x1bf70e(null,![],{'message':_0xabf1('0x14')});}else if(_0xcfec60[_0xabf1('0xc')]>0x0){if(_0x48c89c['blocked']){if(_0xcfec60[_0xabf1('0x16')]>0x0){if(moment(_0x48c89c[_0xabf1('0x17')])['add'](_0xcfec60['blockDuration'],'minutes')>moment()){return _0x1bf70e(null,![],{'message':_0xabf1('0x14')});}else{return utils[_0xabf1('0x18')](_0x48c89c,_0x2f0444,![],null)[_0xabf1('0xd')](function(){return _0x1bf70e(null,![],{'message':_0xabf1('0x14')});});}}else{return _0x1bf70e(null,![],{'message':_0xabf1('0x14')});}}else{if(_0x2f0444>=_0xcfec60['allowedLoginAttempts']){return utils[_0xabf1('0x18')](_0x48c89c,0x0,!![],moment())[_0xabf1('0xd')](function(){return _0x1bf70e(null,![],{'message':_0xabf1('0x14')});});}else{return utils[_0xabf1('0x18')](_0x48c89c,_0x2f0444,![],null)[_0xabf1('0xd')](function(){return _0x1bf70e(null,![],{'message':_0xabf1('0x14')});});}}}else{return _0x1bf70e(null,![],{'message':_0xabf1('0x14')});}}else{if(_0x48c89c['disabled']){return _0x1bf70e(null,![],{'message':_0xabf1('0x14')});}else if(_0xcfec60[_0xabf1('0xc')]>0x0){if(_0x48c89c[_0xabf1('0x10')]){if(_0xcfec60[_0xabf1('0x16')]>0x0){if(moment(_0x48c89c[_0xabf1('0x17')])[_0xabf1('0x19')](_0xcfec60['blockDuration'],'minutes')>moment()){return _0x1bf70e(null,![],{'message':_0xabf1('0x14')});}else{return utils[_0xabf1('0x18')](_0x48c89c,0x0,![],null)['then'](function(){return utils[_0xabf1('0x1a')](_0x48c89c);})[_0xabf1('0xd')](function(){return _0x1bf70e(null,_0x48c89c);});}}else{return _0x1bf70e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xabf1('0x18')](_0x48c89c,0x0,![],null)[_0xabf1('0xd')](function(){return utils[_0xabf1('0x1a')](_0x48c89c);})[_0xabf1('0xd')](function(){return _0x1bf70e(null,_0x48c89c);})[_0xabf1('0x1b')](function(_0x246975){return _0x1bf70e(null,![],_0x246975);});}}else{if(_0x48c89c['blocked']){return _0x1bf70e(null,![],{'message':_0xabf1('0x14')});}else{return utils[_0xabf1('0x1a')](_0x48c89c)[_0xabf1('0xd')](function(){return _0x1bf70e(null,_0x48c89c);});}}}});})['catch'](function(_0x5912f8){return _0x1bf70e(null,![],_0x5912f8);});}function sendServiceMail(_0x5f5e07){return db['MailAccount'][_0xabf1('0x1c')]({'where':{'service':!![]},'attributes':['id',_0xabf1('0x13'),_0xabf1('0x1d')],'include':[{'model':db[_0xabf1('0x1e')],'as':_0xabf1('0x1f')}]})[_0xabf1('0xd')](function(_0x3a0b53){if(!_0x3a0b53){throw new Error(_0xabf1('0x20'));}var _0x2a283c={'tls':{'rejectUnauthorized':![]}};if(_0x3a0b53[_0xabf1('0x1f')]['service']){_0x2a283c[_0xabf1('0x21')]=_0x3a0b53[_0xabf1('0x1f')]['service'];}else{_0x2a283c[_0xabf1('0x22')]=_0x3a0b53[_0xabf1('0x1f')][_0xabf1('0x22')];_0x2a283c[_0xabf1('0x23')]=_0x3a0b53[_0xabf1('0x1f')][_0xabf1('0x23')];_0x2a283c[_0xabf1('0x24')]=_0x3a0b53[_0xabf1('0x1f')]['secure'];}if(_0x3a0b53[_0xabf1('0x1f')][_0xabf1('0x25')]){_0x2a283c[_0xabf1('0x26')]={'user':_0x3a0b53[_0xabf1('0x1f')][_0xabf1('0x27')],'pass':_0x3a0b53['Smtp'][_0xabf1('0x28')]};}var _0x1a71c2={'account':_0x2a283c,'message':_[_0xabf1('0x29')]({'from':util[_0xabf1('0x2a')](_0xabf1('0x2b'),_0x3a0b53[_0xabf1('0x13')],_0x3a0b53[_0xabf1('0x1d')]||_0x3a0b53[_0xabf1('0x1f')][_0xabf1('0x27')])},_0x5f5e07)};return client[_0xabf1('0x2c')]('SendMail',_0x1a71c2);})['then'](function(_0x3d4578){if(_0x3d4578['error']){throw new Error(util[_0xabf1('0x2a')](_0xabf1('0x2d'),_0x3d4578['error'][_0xabf1('0x2e')]||JSON['stringify'](_0x3d4578['error'])));}return!![];});}function handleError(_0x53aa50,_0xc55c3b,_0x49707){return _0x53aa50[_0xabf1('0x2f')](_0xc55c3b||0x1f4)['send']({'message':_0x49707?_0x49707[_0xabf1('0x2e')]||_0x49707:''});}exports[_0xabf1('0x30')]=function(_0x160383,_0x49de9a,_0x57dc08){passport[_0xabf1('0x31')](_0xabf1('0x32'),function(_0x156374,_0x17d666,_0x2f9d77){var _0x40bc9a=_0x156374||_0x2f9d77;if(_0x40bc9a){return handleError(_0x49de9a,0x191,_0x40bc9a);}if(!_0x17d666){return handleError(_0x49de9a,0x194,{'message':_0xabf1('0x33')});}else{var _0x31e88d={'payload':{'id':_0x17d666['id'],'role':_0x17d666[_0xabf1('0x34')]},'options':{'expiresIn':0x15180}};return authService[_0xabf1('0x35')](_0x31e88d)[_0xabf1('0xd')](function(_0x197efa){_0x49de9a[_0xabf1('0x36')]({'id':_0x17d666['id'],'token':_0x197efa,'statusCall':'','isAlreadyLogged':_0x17d666[_0xabf1('0x37')]});});}})(_0x160383,_0x49de9a,_0x57dc08);};exports['forgot']=function(_0x4e9265,_0x1964da,_0x23fd56){if(!_0x4e9265['body']['email']){return handleError(_0x1964da,0x1f4,{'message':_0xabf1('0x38')});}var _0x12c9d1=rs[_0xabf1('0x39')]();_0x4e9265[_0xabf1('0x3a')][_0xabf1('0x1d')]=_0x4e9265['body'][_0xabf1('0x1d')][_0xabf1('0x3b')]()['toLowerCase']();var _0x593949;return db['Setting'][_0xabf1('0xb')]({'where':{'id':0x1},'attributes':[_0xabf1('0xc'),_0xabf1('0x16')],'raw':!![]})[_0xabf1('0xd')](function(_0x17a6ff){_0x593949=_0x17a6ff;return db[_0xabf1('0x3c')][_0xabf1('0x1c')]({'where':{'email':_0x4e9265[_0xabf1('0x3a')][_0xabf1('0x1d')]}});})['then'](function(_0x166a22){if(!_0x166a22){throw new Error(_0xabf1('0x3d'));}if(_0x166a22['disabled']){throw new Error(_0xabf1('0x3e'));}if(_0x166a22['blocked']){if(moment(_0x166a22[_0xabf1('0x17')])[_0xabf1('0x19')](_0x593949[_0xabf1('0x16')],'minutes')>moment()){throw new Error(_0xabf1('0x3f'));}else{_0x166a22['blocked']=![];_0x166a22[_0xabf1('0x17')]=null;}}_0x166a22[_0xabf1('0x40')]=_0x12c9d1;_0x166a22[_0xabf1('0x41')]=Date['now']()+0x36ee80;return _0x166a22['save']();})[_0xabf1('0xd')](function(){return sendServiceMail({'to':_0x4e9265[_0xabf1('0x3a')][_0xabf1('0x1d')],'subject':_0xabf1('0x42'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xabf1('0x43')+_0xabf1('0x44')+_0x4e9265[_0xabf1('0x45')]['host']+_0xabf1('0x46')+_0x12c9d1+'\x0a\x0a'+_0xabf1('0x47')});})[_0xabf1('0xd')](function(){_0x1964da[_0xabf1('0x2f')](0xc8)[_0xabf1('0x48')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x2b511b){return handleError(_0x1964da,0x1f4,_0x2b511b);});};exports[_0xabf1('0x49')]=function(_0x1e9410,_0x28e661,_0x475f9f){return db[_0xabf1('0x3c')]['find']({'where':{'resetPasswordToken':_0x1e9410[_0xabf1('0x4a')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xabf1('0xd')](function(_0x131003){if(!_0x131003){throw new Error(_0xabf1('0x4b'));}return db[_0xabf1('0x4c')][_0xabf1('0xb')]({'attributes':['id',_0xabf1('0x4d'),_0xabf1('0x4e'),_0xabf1('0x4f')]})[_0xabf1('0xd')](function(_0x4a5d83){if(_0x4a5d83[_0xabf1('0x4d')])authService[_0xabf1('0x50')](_0x1e9410[_0xabf1('0x3a')]['password']);if(!_0x4a5d83['enforcePasswordHistory']||!_0x131003[_0xabf1('0x51')])return _0x131003;authService[_0xabf1('0x52')](_0x1e9410[_0xabf1('0x3a')]['password'],_0x131003[_0xabf1('0x51')],_0x4a5d83[_0xabf1('0x4f')]);return _0x131003;})[_0xabf1('0xd')](function(){_0x131003[_0xabf1('0xe')]=_0x1e9410[_0xabf1('0x3a')][_0xabf1('0xe')];_0x131003['resetPasswordToken']=null;_0x131003[_0xabf1('0x41')]=null;return _0x131003[_0xabf1('0x53')]();});})[_0xabf1('0xd')](function(){_0x28e661[_0xabf1('0x2f')](0xc8)['send']({'message':_0xabf1('0x54')});})[_0xabf1('0x1b')](function(_0xa6ae21){return handleError(_0x28e661,0x1f4,_0xa6ae21);});};passport['use'](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x2fab98,_0x1c0913,_0x4cb354){return localAuthenticate(db[_0xabf1('0x3c')],_0x2fab98,_0x1c0913,_0x4cb354);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 40aa124..d79f13d 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 _0x8518=['/forgot','forgot','/reset/:token','reset','exports','express','./authLocal.controller','post'];(function(_0x2a0080,_0x58e8bc){var _0x55c13e=function(_0xc0f365){while(--_0xc0f365){_0x2a0080['push'](_0x2a0080['shift']());}};_0x55c13e(++_0x58e8bc);}(_0x8518,0xcd));var _0x8851=function(_0x367dd3,_0xd1d1bf){_0x367dd3=_0x367dd3-0x0;var _0x5b7728=_0x8518[_0x367dd3];return _0x5b7728;};'use strict';var express=require(_0x8851('0x0'));var router=express['Router']();var controller=require(_0x8851('0x1'));router[_0x8851('0x2')]('/',controller['login']);router['post'](_0x8851('0x3'),controller[_0x8851('0x4')]);router[_0x8851('0x2')](_0x8851('0x5'),controller[_0x8851('0x6')]);module[_0x8851('0x7')]=router;
\ No newline at end of file
+var _0xc1b1=['exports','express','Router','./authLocal.controller','post','/forgot','forgot','/reset/:token','reset'];(function(_0x1decb9,_0x5e3ce0){var _0x4772a4=function(_0x1afcdd){while(--_0x1afcdd){_0x1decb9['push'](_0x1decb9['shift']());}};_0x4772a4(++_0x5e3ce0);}(_0xc1b1,0xeb));var _0x1c1b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc1b1[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0x1c1b('0x0'));var router=express[_0x1c1b('0x1')]();var controller=require(_0x1c1b('0x2'));router[_0x1c1b('0x3')]('/',controller['login']);router['post'](_0x1c1b('0x4'),controller[_0x1c1b('0x5')]);router[_0x1c1b('0x3')](_0x1c1b('0x6'),controller[_0x1c1b('0x7')]);module[_0x1c1b('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 f04c308..a21175b 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 _0xad97=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xad97,0x17b));var _0x7ad9=function(_0x505d54,_0x550691){_0x505d54=_0x505d54-0x0;var _0x3c648b=_0xad97[_0x505d54];return _0x3c648b;};'use strict';var Sequelize=require(_0x7ad9('0x0'));module['exports']={'name':{'type':Sequelize[_0x7ad9('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x7ad9('0x1')]},'description':{'type':Sequelize[_0x7ad9('0x1')]},'status':{'type':Sequelize[_0x7ad9('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7ad9('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x3394=['INTEGER','sequelize','STRING'];(function(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0x3394,0xd9));var _0x4339=function(_0x5544cd,_0x2e881c){_0x5544cd=_0x5544cd-0x0;var _0x27e176=_0x3394[_0x5544cd];return _0x27e176;};'use strict';var Sequelize=require(_0x4339('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x4339('0x1')]},'description':{'type':Sequelize[_0x4339('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4339('0x2')],'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 6dce654..bbd1ffe 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 _0x03b4=['addActions','Action','getActions','findOne','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','destroy','error','map','Automation','rawAttributes','fieldName','type','query','keys','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','name','merge','options','then','include','rows','catch','show','params','intersection','length','includeAll','create','body','update','find','addConditions','Condition','ids','omit','getConditions'];(function(_0x2fb900,_0x2a6ba2){var _0x4e99e2=function(_0x57cbbd){while(--_0x57cbbd){_0x2fb900['push'](_0x2fb900['shift']());}};_0x4e99e2(++_0x2a6ba2);}(_0x03b4,0xa4));var _0x403b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x03b4[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x403b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x403b('0x1'));var moment=require('moment');var BPromise=require(_0x403b('0x2'));var Mustache=require(_0x403b('0x3'));var util=require(_0x403b('0x4'));var path=require(_0x403b('0x5'));var sox=require('sox');var csv=require(_0x403b('0x6'));var ejs=require(_0x403b('0x7'));var fs=require('fs');var fs_extra=require(_0x403b('0x8'));var _=require(_0x403b('0x9'));var squel=require(_0x403b('0xa'));var crypto=require('crypto');var jsforce=require(_0x403b('0xb'));var deskjs=require(_0x403b('0xc'));var toCsv=require(_0x403b('0x6'));var querystring=require('querystring');var Papa=require(_0x403b('0xd'));var Redis=require('ioredis');var authService=require(_0x403b('0xe'));var qs=require(_0x403b('0xf'));var as=require(_0x403b('0x10'));var hardwareService=require(_0x403b('0x11'));var logger=require(_0x403b('0x12'))(_0x403b('0x13'));var utils=require(_0x403b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x403b('0x15'));var db=require(_0x403b('0x16'))['db'];function respondWithStatusCode(_0x38ecf9,_0x10c248){_0x10c248=_0x10c248||0xcc;return function(_0x1f8369){if(_0x1f8369){return _0x38ecf9[_0x403b('0x17')](_0x10c248);}return _0x38ecf9['status'](_0x10c248)[_0x403b('0x18')]();};}function respondWithResult(_0x11db23,_0x1dec43){_0x1dec43=_0x1dec43||0xc8;return function(_0x56d577){if(_0x56d577){return _0x11db23[_0x403b('0x19')](_0x1dec43)[_0x403b('0x1a')](_0x56d577);}};}function respondWithFilteredResult(_0x4428c1,_0x4ee7cd){return function(_0x1bc9c7){if(_0x1bc9c7){var _0x3c9288=typeof _0x4ee7cd[_0x403b('0x1b')]==='undefined'&&typeof _0x4ee7cd[_0x403b('0x1c')]===_0x403b('0x1d');var _0x19a061=_0x1bc9c7[_0x403b('0x1e')];var _0xc920d9=_0x3c9288?0x0:_0x4ee7cd['offset'];var _0x52f109=_0x3c9288?_0x1bc9c7[_0x403b('0x1e')]:_0x4ee7cd[_0x403b('0x1b')]+_0x4ee7cd[_0x403b('0x1c')];var _0x34d3ff;if(_0x52f109>=_0x19a061){_0x52f109=_0x19a061;_0x34d3ff=0xc8;}else{_0x34d3ff=0xce;}_0x4428c1['status'](_0x34d3ff);return _0x4428c1[_0x403b('0x1f')](_0x403b('0x20'),_0xc920d9+'-'+_0x52f109+'/'+_0x19a061)[_0x403b('0x1a')](_0x1bc9c7);}return null;};}function patchUpdates(_0x71a5e8){return function(_0x360c0b){try{jsonpatch['apply'](_0x360c0b,_0x71a5e8,!![]);}catch(_0x10fcb6){return BPromise[_0x403b('0x21')](_0x10fcb6);}return _0x360c0b[_0x403b('0x22')]();};}function saveUpdates(_0x14c3f7,_0x463edd){return function(_0x1fb769){if(_0x1fb769){return _0x1fb769['update'](_0x14c3f7)['then'](function(_0x1daa26){return _0x1daa26;});}return null;};}function removeEntity(_0x22b304,_0x8cdb88){return function(_0x45ab98){if(_0x45ab98){return _0x45ab98[_0x403b('0x23')]()['then'](function(){_0x22b304[_0x403b('0x19')](0xcc)[_0x403b('0x18')]();});}};}function handleEntityNotFound(_0x751121,_0x1203bc){return function(_0xfdc92f){if(!_0xfdc92f){_0x751121['sendStatus'](0x194);}return _0xfdc92f;};}function handleError(_0x5b8378,_0x5313af){_0x5313af=_0x5313af||0x1f4;return function(_0xc91a85){logger[_0x403b('0x24')](_0xc91a85['stack']);if(_0xc91a85['name']){delete _0xc91a85['name'];}_0x5b8378[_0x403b('0x19')](_0x5313af)['send'](_0xc91a85);};}exports['index']=function(_0x532b3e,_0x2ff20f){var _0x28fed3={},_0x18d452={},_0x2ec5be={'count':0x0,'rows':[]};var _0x4f6adc=_[_0x403b('0x25')](db[_0x403b('0x26')][_0x403b('0x27')],function(_0x33c1a4){return{'name':_0x33c1a4[_0x403b('0x28')],'type':_0x33c1a4[_0x403b('0x29')]['key']};});_0x18d452['model']=_[_0x403b('0x25')](_0x4f6adc,'name');_0x18d452[_0x403b('0x2a')]=_[_0x403b('0x2b')](_0x532b3e[_0x403b('0x2a')]);_0x18d452['filters']=_['intersection'](_0x18d452['model'],_0x18d452[_0x403b('0x2a')]);_0x28fed3['attributes']=_['intersection'](_0x18d452[_0x403b('0x2c')],qs[_0x403b('0x2d')](_0x532b3e[_0x403b('0x2a')]['fields']));_0x28fed3[_0x403b('0x2e')]=_0x28fed3[_0x403b('0x2e')]['length']?_0x28fed3[_0x403b('0x2e')]:_0x18d452[_0x403b('0x2c')];if(!_0x532b3e[_0x403b('0x2a')][_0x403b('0x2f')](_0x403b('0x30'))){_0x28fed3[_0x403b('0x1c')]=qs['limit'](_0x532b3e['query'][_0x403b('0x1c')]);_0x28fed3['offset']=qs[_0x403b('0x1b')](_0x532b3e[_0x403b('0x2a')][_0x403b('0x1b')]);}_0x28fed3[_0x403b('0x31')]=qs[_0x403b('0x32')](_0x532b3e[_0x403b('0x2a')][_0x403b('0x32')]);_0x28fed3[_0x403b('0x33')]=qs['filters'](_[_0x403b('0x34')](_0x532b3e[_0x403b('0x2a')],_0x18d452[_0x403b('0x35')]),_0x4f6adc);if(_0x532b3e['query'][_0x403b('0x36')]){_0x28fed3['where']=_['merge'](_0x28fed3[_0x403b('0x33')],{'$or':_[_0x403b('0x25')](_0x4f6adc,function(_0xc2eab8){if(_0xc2eab8[_0x403b('0x29')]!=='VIRTUAL'){var _0x3cb60a={};_0x3cb60a[_0xc2eab8[_0x403b('0x37')]]={'$like':'%'+_0x532b3e['query'][_0x403b('0x36')]+'%'};return _0x3cb60a;}})});}_0x28fed3=_[_0x403b('0x38')]({},_0x28fed3,_0x532b3e[_0x403b('0x39')]);var _0xeef2d7={'where':_0x28fed3[_0x403b('0x33')]};return db['Automation'][_0x403b('0x1e')](_0xeef2d7)[_0x403b('0x3a')](function(_0x468f94){_0x2ec5be['count']=_0x468f94;if(_0x532b3e[_0x403b('0x2a')]['includeAll']){_0x28fed3[_0x403b('0x3b')]=[{'all':!![]}];}return db[_0x403b('0x26')]['findAll'](_0x28fed3);})[_0x403b('0x3a')](function(_0x4b802c){_0x2ec5be[_0x403b('0x3c')]=_0x4b802c;return _0x2ec5be;})[_0x403b('0x3a')](respondWithFilteredResult(_0x2ff20f,_0x28fed3))[_0x403b('0x3d')](handleError(_0x2ff20f,null));};exports[_0x403b('0x3e')]=function(_0x5e23ca,_0x22e706){var _0x2093bd={'raw':![],'where':{'id':_0x5e23ca[_0x403b('0x3f')]['id']}},_0x78a048={};_0x78a048[_0x403b('0x2c')]=_[_0x403b('0x2b')](db[_0x403b('0x26')][_0x403b('0x27')]);_0x78a048[_0x403b('0x2a')]=_[_0x403b('0x2b')](_0x5e23ca['query']);_0x78a048[_0x403b('0x35')]=_[_0x403b('0x40')](_0x78a048['model'],_0x78a048[_0x403b('0x2a')]);_0x2093bd[_0x403b('0x2e')]=_[_0x403b('0x40')](_0x78a048[_0x403b('0x2c')],qs['fields'](_0x5e23ca[_0x403b('0x2a')][_0x403b('0x2d')]));_0x2093bd[_0x403b('0x2e')]=_0x2093bd[_0x403b('0x2e')][_0x403b('0x41')]?_0x2093bd[_0x403b('0x2e')]:_0x78a048[_0x403b('0x2c')];if(_0x5e23ca[_0x403b('0x2a')][_0x403b('0x42')]){_0x2093bd[_0x403b('0x3b')]=[{'all':!![]}];}_0x2093bd=_['merge']({},_0x2093bd,_0x5e23ca[_0x403b('0x39')]);return db[_0x403b('0x26')]['find'](_0x2093bd)[_0x403b('0x3a')](handleEntityNotFound(_0x22e706,null))['then'](respondWithResult(_0x22e706,null))[_0x403b('0x3d')](handleError(_0x22e706,null));};exports['create']=function(_0x23af0a,_0x46ee73){return db[_0x403b('0x26')][_0x403b('0x43')](_0x23af0a[_0x403b('0x44')],{})[_0x403b('0x3a')](respondWithResult(_0x46ee73,0xc9))[_0x403b('0x3d')](handleError(_0x46ee73,null));};exports[_0x403b('0x45')]=function(_0x55f720,_0x8cdb28){if(_0x55f720[_0x403b('0x44')]['id']){delete _0x55f720[_0x403b('0x44')]['id'];}return db[_0x403b('0x26')][_0x403b('0x46')]({'where':{'id':_0x55f720[_0x403b('0x3f')]['id']}})[_0x403b('0x3a')](handleEntityNotFound(_0x8cdb28,null))['then'](saveUpdates(_0x55f720[_0x403b('0x44')],null))[_0x403b('0x3a')](respondWithResult(_0x8cdb28,null))['catch'](handleError(_0x8cdb28,null));};exports[_0x403b('0x23')]=function(_0x401488,_0x5a20c2){return db[_0x403b('0x26')]['find']({'where':{'id':_0x401488[_0x403b('0x3f')]['id']}})[_0x403b('0x3a')](handleEntityNotFound(_0x5a20c2,null))[_0x403b('0x3a')](removeEntity(_0x5a20c2,null))['catch'](handleError(_0x5a20c2,null));};exports[_0x403b('0x47')]=function(_0x2b1400,_0x93be85,_0xc6808){return db[_0x403b('0x48')]['find']({'where':{'id':_0x2b1400[_0x403b('0x3f')]['id']}})[_0x403b('0x3a')](handleEntityNotFound(_0x93be85,null))['then'](function(_0x47c9a5){if(_0x47c9a5){return _0x47c9a5['addConditions'](_0x2b1400[_0x403b('0x44')][_0x403b('0x49')],_[_0x403b('0x4a')](_0x2b1400[_0x403b('0x44')],[_0x403b('0x49'),'id'])||{});}})[_0x403b('0x3a')](respondWithResult(_0x93be85,null))[_0x403b('0x3d')](handleError(_0x93be85,null));};exports[_0x403b('0x4b')]=function(_0x52c90a,_0x1d73d1,_0x49cbac){var _0x4803e8={};var _0x31a0f3={};var _0xd5817f;var _0x425b14;return db[_0x403b('0x26')]['findOne']({'where':{'id':_0x52c90a[_0x403b('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1d73d1,null))[_0x403b('0x3a')](function(_0x2900cb){if(_0x2900cb){_0xd5817f=_0x2900cb;_0x31a0f3['model']=_[_0x403b('0x2b')](db[_0x403b('0x48')][_0x403b('0x27')]);_0x31a0f3[_0x403b('0x2a')]=_[_0x403b('0x2b')](_0x52c90a[_0x403b('0x2a')]);_0x31a0f3['filters']=_[_0x403b('0x40')](_0x31a0f3[_0x403b('0x2c')],_0x31a0f3[_0x403b('0x2a')]);_0x4803e8[_0x403b('0x2e')]=_[_0x403b('0x40')](_0x31a0f3[_0x403b('0x2c')],qs[_0x403b('0x2d')](_0x52c90a['query'][_0x403b('0x2d')]));_0x4803e8[_0x403b('0x2e')]=_0x4803e8[_0x403b('0x2e')][_0x403b('0x41')]?_0x4803e8['attributes']:_0x31a0f3[_0x403b('0x2c')];_0x4803e8[_0x403b('0x31')]=qs[_0x403b('0x32')](_0x52c90a['query']['sort']);_0x4803e8[_0x403b('0x33')]=qs['filters'](_['pick'](_0x52c90a[_0x403b('0x2a')],_0x31a0f3['filters']));if(_0x52c90a[_0x403b('0x2a')][_0x403b('0x36')]){_0x4803e8[_0x403b('0x33')]=_['merge'](_0x4803e8[_0x403b('0x33')],{'$or':_[_0x403b('0x25')](_0x4803e8['attributes'],function(_0x218e06){var _0x4876bd={};_0x4876bd[_0x218e06]={'$like':'%'+_0x52c90a['query'][_0x403b('0x36')]+'%'};return _0x4876bd;})});}_0x4803e8=_[_0x403b('0x38')]({},_0x4803e8,_0x52c90a['options']);return _0xd5817f['getConditions'](_0x4803e8);}})[_0x403b('0x3a')](function(_0x4f5fd1){if(_0x4f5fd1){_0x425b14=_0x4f5fd1['length'];if(!_0x52c90a['query']['hasOwnProperty'](_0x403b('0x30'))){_0x4803e8[_0x403b('0x1c')]=qs['limit'](_0x52c90a[_0x403b('0x2a')][_0x403b('0x1c')]);_0x4803e8[_0x403b('0x1b')]=qs[_0x403b('0x1b')](_0x52c90a[_0x403b('0x2a')]['offset']);}return _0xd5817f[_0x403b('0x4b')](_0x4803e8);}})[_0x403b('0x3a')](function(_0x44855d){if(_0x44855d){return _0x44855d?{'count':_0x425b14,'rows':_0x44855d}:null;}})[_0x403b('0x3a')](respondWithResult(_0x1d73d1,null))['catch'](handleError(_0x1d73d1,null));};exports[_0x403b('0x4c')]=function(_0x5e399d,_0x1d82a3,_0x359399){return db[_0x403b('0x4d')][_0x403b('0x46')]({'where':{'id':_0x5e399d[_0x403b('0x3f')]['id']}})[_0x403b('0x3a')](handleEntityNotFound(_0x1d82a3,null))[_0x403b('0x3a')](function(_0x2f14f6){if(_0x2f14f6){return _0x2f14f6['addActions'](_0x5e399d[_0x403b('0x44')][_0x403b('0x49')],_[_0x403b('0x4a')](_0x5e399d[_0x403b('0x44')],[_0x403b('0x49'),'id'])||{});}})[_0x403b('0x3a')](respondWithResult(_0x1d82a3,null))[_0x403b('0x3d')](handleError(_0x1d82a3,null));};exports[_0x403b('0x4e')]=function(_0x2d43ab,_0x24aa77,_0x4dec4d){var _0x567b0f={};var _0x4e2d4e={};var _0x229dd4;var _0xc077e4;return db[_0x403b('0x26')][_0x403b('0x4f')]({'where':{'id':_0x2d43ab['params']['id']}})['then'](handleEntityNotFound(_0x24aa77,null))[_0x403b('0x3a')](function(_0x426048){if(_0x426048){_0x229dd4=_0x426048;_0x4e2d4e['model']=_[_0x403b('0x2b')](db[_0x403b('0x4d')][_0x403b('0x27')]);_0x4e2d4e['query']=_['keys'](_0x2d43ab['query']);_0x4e2d4e['filters']=_[_0x403b('0x40')](_0x4e2d4e[_0x403b('0x2c')],_0x4e2d4e[_0x403b('0x2a')]);_0x567b0f[_0x403b('0x2e')]=_[_0x403b('0x40')](_0x4e2d4e[_0x403b('0x2c')],qs['fields'](_0x2d43ab['query']['fields']));_0x567b0f['attributes']=_0x567b0f[_0x403b('0x2e')][_0x403b('0x41')]?_0x567b0f[_0x403b('0x2e')]:_0x4e2d4e[_0x403b('0x2c')];_0x567b0f['order']=qs[_0x403b('0x32')](_0x2d43ab['query']['sort']);_0x567b0f[_0x403b('0x33')]=qs[_0x403b('0x35')](_[_0x403b('0x34')](_0x2d43ab['query'],_0x4e2d4e['filters']));if(_0x2d43ab[_0x403b('0x2a')][_0x403b('0x36')]){_0x567b0f['where']=_['merge'](_0x567b0f[_0x403b('0x33')],{'$or':_[_0x403b('0x25')](_0x567b0f[_0x403b('0x2e')],function(_0x4dbf0c){var _0x3a944d={};_0x3a944d[_0x4dbf0c]={'$like':'%'+_0x2d43ab['query'][_0x403b('0x36')]+'%'};return _0x3a944d;})});}_0x567b0f=_['merge']({},_0x567b0f,_0x2d43ab[_0x403b('0x39')]);return _0x229dd4[_0x403b('0x4e')](_0x567b0f);}})['then'](function(_0x2ebc11){if(_0x2ebc11){_0xc077e4=_0x2ebc11[_0x403b('0x41')];if(!_0x2d43ab[_0x403b('0x2a')][_0x403b('0x2f')](_0x403b('0x30'))){_0x567b0f[_0x403b('0x1c')]=qs['limit'](_0x2d43ab[_0x403b('0x2a')][_0x403b('0x1c')]);_0x567b0f[_0x403b('0x1b')]=qs[_0x403b('0x1b')](_0x2d43ab[_0x403b('0x2a')][_0x403b('0x1b')]);}return _0x229dd4[_0x403b('0x4e')](_0x567b0f);}})[_0x403b('0x3a')](function(_0x1658ee){if(_0x1658ee){return _0x1658ee?{'count':_0xc077e4,'rows':_0x1658ee}:null;}})[_0x403b('0x3a')](respondWithResult(_0x24aa77,null))[_0x403b('0x3d')](handleError(_0x24aa77,null));};
\ No newline at end of file
+var _0x3821=['lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','error','stack','name','index','map','rawAttributes','key','query','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','Automation','then','includeAll','include','rows','catch','show','params','keys','intersection','length','options','find','create','body','Condition','addConditions','ids','omit','getConditions','addActions','Action','getActions','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x7b59f0,_0x43505f){var _0x596190=function(_0x2f322e){while(--_0x2f322e){_0x7b59f0['push'](_0x7b59f0['shift']());}};_0x596190(++_0x43505f);}(_0x3821,0xe5));var _0x1382=function(_0x2360c7,_0x4b71fc){_0x2360c7=_0x2360c7-0x0;var _0x44cf57=_0x3821[_0x2360c7];return _0x44cf57;};'use strict';var emlformat=require(_0x1382('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1382('0x1'));var jsonpatch=require(_0x1382('0x2'));var rp=require(_0x1382('0x3'));var moment=require(_0x1382('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1382('0x5'));var path=require(_0x1382('0x6'));var sox=require(_0x1382('0x7'));var csv=require(_0x1382('0x8'));var ejs=require(_0x1382('0x9'));var fs=require('fs');var fs_extra=require(_0x1382('0xa'));var _=require(_0x1382('0xb'));var squel=require('squel');var crypto=require(_0x1382('0xc'));var jsforce=require(_0x1382('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1382('0x8'));var querystring=require('querystring');var Papa=require(_0x1382('0xe'));var Redis=require(_0x1382('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1382('0x10'));var as=require(_0x1382('0x11'));var hardwareService=require(_0x1382('0x12'));var logger=require(_0x1382('0x13'))(_0x1382('0x14'));var utils=require('../../config/utils');var config=require(_0x1382('0x15'));var licenseUtil=require(_0x1382('0x16'));var db=require(_0x1382('0x17'))['db'];function respondWithStatusCode(_0x24f77a,_0x1d5245){_0x1d5245=_0x1d5245||0xcc;return function(_0x2ff71e){if(_0x2ff71e){return _0x24f77a[_0x1382('0x18')](_0x1d5245);}return _0x24f77a[_0x1382('0x19')](_0x1d5245)[_0x1382('0x1a')]();};}function respondWithResult(_0x5dcc12,_0x47d698){_0x47d698=_0x47d698||0xc8;return function(_0x4b0fbf){if(_0x4b0fbf){return _0x5dcc12['status'](_0x47d698)['json'](_0x4b0fbf);}};}function respondWithFilteredResult(_0x53e6e2,_0x5124d5){return function(_0x21c68b){if(_0x21c68b){var _0x23eb0b=typeof _0x5124d5[_0x1382('0x1b')]===_0x1382('0x1c')&&typeof _0x5124d5[_0x1382('0x1d')]==='undefined';var _0x4bc22d=_0x21c68b['count'];var _0x47fb25=_0x23eb0b?0x0:_0x5124d5[_0x1382('0x1b')];var _0x4a9e20=_0x23eb0b?_0x21c68b[_0x1382('0x1e')]:_0x5124d5[_0x1382('0x1b')]+_0x5124d5['limit'];var _0x11cb7a;if(_0x4a9e20>=_0x4bc22d){_0x4a9e20=_0x4bc22d;_0x11cb7a=0xc8;}else{_0x11cb7a=0xce;}_0x53e6e2[_0x1382('0x19')](_0x11cb7a);return _0x53e6e2['set'](_0x1382('0x1f'),_0x47fb25+'-'+_0x4a9e20+'/'+_0x4bc22d)['json'](_0x21c68b);}return null;};}function patchUpdates(_0x1ab3ef){return function(_0xbab65b){try{jsonpatch[_0x1382('0x20')](_0xbab65b,_0x1ab3ef,!![]);}catch(_0x33b97c){return BPromise[_0x1382('0x21')](_0x33b97c);}return _0xbab65b[_0x1382('0x22')]();};}function saveUpdates(_0x58c650,_0x2274a0){return function(_0x2e7890){if(_0x2e7890){return _0x2e7890['update'](_0x58c650)['then'](function(_0x4e4547){return _0x4e4547;});}return null;};}function removeEntity(_0x501368,_0x4c89ea){return function(_0xf82423){if(_0xf82423){return _0xf82423[_0x1382('0x23')]()['then'](function(){_0x501368[_0x1382('0x19')](0xcc)[_0x1382('0x1a')]();});}};}function handleEntityNotFound(_0x5a22a7,_0x3680b9){return function(_0x2781bd){if(!_0x2781bd){_0x5a22a7[_0x1382('0x18')](0x194);}return _0x2781bd;};}function handleError(_0x3ce8d3,_0x3c4dbe){_0x3c4dbe=_0x3c4dbe||0x1f4;return function(_0x47aceb){logger[_0x1382('0x24')](_0x47aceb[_0x1382('0x25')]);if(_0x47aceb[_0x1382('0x26')]){delete _0x47aceb[_0x1382('0x26')];}_0x3ce8d3[_0x1382('0x19')](_0x3c4dbe)['send'](_0x47aceb);};}exports[_0x1382('0x27')]=function(_0x28d22e,_0x282831){var _0x272fe6={},_0x3d2050={},_0x24e45f={'count':0x0,'rows':[]};var _0x34cf7d=_[_0x1382('0x28')](db['Automation'][_0x1382('0x29')],function(_0x7dd14e){return{'name':_0x7dd14e['fieldName'],'type':_0x7dd14e['type'][_0x1382('0x2a')]};});_0x3d2050['model']=_['map'](_0x34cf7d,_0x1382('0x26'));_0x3d2050['query']=_['keys'](_0x28d22e[_0x1382('0x2b')]);_0x3d2050['filters']=_['intersection'](_0x3d2050['model'],_0x3d2050['query']);_0x272fe6[_0x1382('0x2c')]=_['intersection'](_0x3d2050['model'],qs[_0x1382('0x2d')](_0x28d22e[_0x1382('0x2b')]['fields']));_0x272fe6[_0x1382('0x2c')]=_0x272fe6['attributes']['length']?_0x272fe6[_0x1382('0x2c')]:_0x3d2050[_0x1382('0x2e')];if(!_0x28d22e[_0x1382('0x2b')][_0x1382('0x2f')](_0x1382('0x30'))){_0x272fe6[_0x1382('0x1d')]=qs[_0x1382('0x1d')](_0x28d22e[_0x1382('0x2b')]['limit']);_0x272fe6[_0x1382('0x1b')]=qs[_0x1382('0x1b')](_0x28d22e[_0x1382('0x2b')][_0x1382('0x1b')]);}_0x272fe6[_0x1382('0x31')]=qs[_0x1382('0x32')](_0x28d22e[_0x1382('0x2b')][_0x1382('0x32')]);_0x272fe6[_0x1382('0x33')]=qs[_0x1382('0x34')](_[_0x1382('0x35')](_0x28d22e[_0x1382('0x2b')],_0x3d2050[_0x1382('0x34')]),_0x34cf7d);if(_0x28d22e['query'][_0x1382('0x36')]){_0x272fe6[_0x1382('0x33')]=_[_0x1382('0x37')](_0x272fe6[_0x1382('0x33')],{'$or':_['map'](_0x34cf7d,function(_0x493f1a){if(_0x493f1a['type']!=='VIRTUAL'){var _0x4382e8={};_0x4382e8[_0x493f1a[_0x1382('0x26')]]={'$like':'%'+_0x28d22e[_0x1382('0x2b')][_0x1382('0x36')]+'%'};return _0x4382e8;}})});}_0x272fe6=_['merge']({},_0x272fe6,_0x28d22e['options']);var _0x5011b2={'where':_0x272fe6['where']};return db[_0x1382('0x38')][_0x1382('0x1e')](_0x5011b2)[_0x1382('0x39')](function(_0x2fece5){_0x24e45f[_0x1382('0x1e')]=_0x2fece5;if(_0x28d22e['query'][_0x1382('0x3a')]){_0x272fe6[_0x1382('0x3b')]=[{'all':!![]}];}return db[_0x1382('0x38')]['findAll'](_0x272fe6);})[_0x1382('0x39')](function(_0x23cfe2){_0x24e45f[_0x1382('0x3c')]=_0x23cfe2;return _0x24e45f;})[_0x1382('0x39')](respondWithFilteredResult(_0x282831,_0x272fe6))[_0x1382('0x3d')](handleError(_0x282831,null));};exports[_0x1382('0x3e')]=function(_0x360185,_0x2191eb){var _0x3aa4da={'raw':![],'where':{'id':_0x360185[_0x1382('0x3f')]['id']}},_0x1e0071={};_0x1e0071[_0x1382('0x2e')]=_[_0x1382('0x40')](db[_0x1382('0x38')][_0x1382('0x29')]);_0x1e0071['query']=_[_0x1382('0x40')](_0x360185[_0x1382('0x2b')]);_0x1e0071['filters']=_['intersection'](_0x1e0071['model'],_0x1e0071[_0x1382('0x2b')]);_0x3aa4da['attributes']=_[_0x1382('0x41')](_0x1e0071['model'],qs[_0x1382('0x2d')](_0x360185[_0x1382('0x2b')]['fields']));_0x3aa4da['attributes']=_0x3aa4da['attributes'][_0x1382('0x42')]?_0x3aa4da[_0x1382('0x2c')]:_0x1e0071[_0x1382('0x2e')];if(_0x360185[_0x1382('0x2b')][_0x1382('0x3a')]){_0x3aa4da['include']=[{'all':!![]}];}_0x3aa4da=_['merge']({},_0x3aa4da,_0x360185[_0x1382('0x43')]);return db['Automation'][_0x1382('0x44')](_0x3aa4da)[_0x1382('0x39')](handleEntityNotFound(_0x2191eb,null))[_0x1382('0x39')](respondWithResult(_0x2191eb,null))['catch'](handleError(_0x2191eb,null));};exports[_0x1382('0x45')]=function(_0x5860c2,_0x194556){return db[_0x1382('0x38')][_0x1382('0x45')](_0x5860c2[_0x1382('0x46')],{})[_0x1382('0x39')](respondWithResult(_0x194556,0xc9))[_0x1382('0x3d')](handleError(_0x194556,null));};exports['update']=function(_0xc4a11,_0x1520a9){if(_0xc4a11[_0x1382('0x46')]['id']){delete _0xc4a11[_0x1382('0x46')]['id'];}return db[_0x1382('0x38')][_0x1382('0x44')]({'where':{'id':_0xc4a11[_0x1382('0x3f')]['id']}})[_0x1382('0x39')](handleEntityNotFound(_0x1520a9,null))[_0x1382('0x39')](saveUpdates(_0xc4a11[_0x1382('0x46')],null))[_0x1382('0x39')](respondWithResult(_0x1520a9,null))[_0x1382('0x3d')](handleError(_0x1520a9,null));};exports[_0x1382('0x23')]=function(_0x575ea7,_0x4b88d2){return db['Automation']['find']({'where':{'id':_0x575ea7[_0x1382('0x3f')]['id']}})[_0x1382('0x39')](handleEntityNotFound(_0x4b88d2,null))[_0x1382('0x39')](removeEntity(_0x4b88d2,null))[_0x1382('0x3d')](handleError(_0x4b88d2,null));};exports['addConditions']=function(_0x5d6b1c,_0x4009b2,_0x519166){return db[_0x1382('0x47')][_0x1382('0x44')]({'where':{'id':_0x5d6b1c[_0x1382('0x3f')]['id']}})[_0x1382('0x39')](handleEntityNotFound(_0x4009b2,null))[_0x1382('0x39')](function(_0x11ba49){if(_0x11ba49){return _0x11ba49[_0x1382('0x48')](_0x5d6b1c['body'][_0x1382('0x49')],_[_0x1382('0x4a')](_0x5d6b1c[_0x1382('0x46')],[_0x1382('0x49'),'id'])||{});}})[_0x1382('0x39')](respondWithResult(_0x4009b2,null))['catch'](handleError(_0x4009b2,null));};exports[_0x1382('0x4b')]=function(_0x3e09f3,_0x426b95,_0x8f3f2b){var _0x36e155={};var _0x3c55d3={};var _0x4677ab;var _0x1fa5df;return db[_0x1382('0x38')]['findOne']({'where':{'id':_0x3e09f3[_0x1382('0x3f')]['id']}})[_0x1382('0x39')](handleEntityNotFound(_0x426b95,null))[_0x1382('0x39')](function(_0x242d66){if(_0x242d66){_0x4677ab=_0x242d66;_0x3c55d3[_0x1382('0x2e')]=_[_0x1382('0x40')](db[_0x1382('0x47')][_0x1382('0x29')]);_0x3c55d3[_0x1382('0x2b')]=_[_0x1382('0x40')](_0x3e09f3[_0x1382('0x2b')]);_0x3c55d3[_0x1382('0x34')]=_[_0x1382('0x41')](_0x3c55d3['model'],_0x3c55d3[_0x1382('0x2b')]);_0x36e155[_0x1382('0x2c')]=_[_0x1382('0x41')](_0x3c55d3[_0x1382('0x2e')],qs['fields'](_0x3e09f3[_0x1382('0x2b')]['fields']));_0x36e155['attributes']=_0x36e155[_0x1382('0x2c')][_0x1382('0x42')]?_0x36e155[_0x1382('0x2c')]:_0x3c55d3[_0x1382('0x2e')];_0x36e155[_0x1382('0x31')]=qs[_0x1382('0x32')](_0x3e09f3[_0x1382('0x2b')][_0x1382('0x32')]);_0x36e155[_0x1382('0x33')]=qs[_0x1382('0x34')](_[_0x1382('0x35')](_0x3e09f3['query'],_0x3c55d3[_0x1382('0x34')]));if(_0x3e09f3[_0x1382('0x2b')][_0x1382('0x36')]){_0x36e155[_0x1382('0x33')]=_['merge'](_0x36e155['where'],{'$or':_[_0x1382('0x28')](_0x36e155[_0x1382('0x2c')],function(_0xfae43b){var _0x1f7850={};_0x1f7850[_0xfae43b]={'$like':'%'+_0x3e09f3[_0x1382('0x2b')][_0x1382('0x36')]+'%'};return _0x1f7850;})});}_0x36e155=_[_0x1382('0x37')]({},_0x36e155,_0x3e09f3[_0x1382('0x43')]);return _0x4677ab[_0x1382('0x4b')](_0x36e155);}})[_0x1382('0x39')](function(_0x4029f3){if(_0x4029f3){_0x1fa5df=_0x4029f3[_0x1382('0x42')];if(!_0x3e09f3[_0x1382('0x2b')][_0x1382('0x2f')](_0x1382('0x30'))){_0x36e155[_0x1382('0x1d')]=qs['limit'](_0x3e09f3[_0x1382('0x2b')]['limit']);_0x36e155[_0x1382('0x1b')]=qs[_0x1382('0x1b')](_0x3e09f3[_0x1382('0x2b')]['offset']);}return _0x4677ab['getConditions'](_0x36e155);}})[_0x1382('0x39')](function(_0x351ffd){if(_0x351ffd){return _0x351ffd?{'count':_0x1fa5df,'rows':_0x351ffd}:null;}})['then'](respondWithResult(_0x426b95,null))[_0x1382('0x3d')](handleError(_0x426b95,null));};exports[_0x1382('0x4c')]=function(_0x4c0e94,_0x1d5b14,_0x47f1b6){return db[_0x1382('0x4d')][_0x1382('0x44')]({'where':{'id':_0x4c0e94[_0x1382('0x3f')]['id']}})[_0x1382('0x39')](handleEntityNotFound(_0x1d5b14,null))[_0x1382('0x39')](function(_0x1cfd1d){if(_0x1cfd1d){return _0x1cfd1d[_0x1382('0x4c')](_0x4c0e94['body'][_0x1382('0x49')],_[_0x1382('0x4a')](_0x4c0e94['body'],[_0x1382('0x49'),'id'])||{});}})[_0x1382('0x39')](respondWithResult(_0x1d5b14,null))[_0x1382('0x3d')](handleError(_0x1d5b14,null));};exports[_0x1382('0x4e')]=function(_0x587203,_0x5af2fb,_0x40b8fe){var _0x5867a8={};var _0x4fe2c6={};var _0x159ed9;var _0x4994b1;return db[_0x1382('0x38')][_0x1382('0x4f')]({'where':{'id':_0x587203[_0x1382('0x3f')]['id']}})[_0x1382('0x39')](handleEntityNotFound(_0x5af2fb,null))[_0x1382('0x39')](function(_0x3ec992){if(_0x3ec992){_0x159ed9=_0x3ec992;_0x4fe2c6[_0x1382('0x2e')]=_[_0x1382('0x40')](db[_0x1382('0x4d')][_0x1382('0x29')]);_0x4fe2c6[_0x1382('0x2b')]=_['keys'](_0x587203[_0x1382('0x2b')]);_0x4fe2c6[_0x1382('0x34')]=_[_0x1382('0x41')](_0x4fe2c6[_0x1382('0x2e')],_0x4fe2c6[_0x1382('0x2b')]);_0x5867a8[_0x1382('0x2c')]=_[_0x1382('0x41')](_0x4fe2c6['model'],qs['fields'](_0x587203['query'][_0x1382('0x2d')]));_0x5867a8[_0x1382('0x2c')]=_0x5867a8['attributes'][_0x1382('0x42')]?_0x5867a8[_0x1382('0x2c')]:_0x4fe2c6[_0x1382('0x2e')];_0x5867a8[_0x1382('0x31')]=qs['sort'](_0x587203['query']['sort']);_0x5867a8[_0x1382('0x33')]=qs[_0x1382('0x34')](_[_0x1382('0x35')](_0x587203['query'],_0x4fe2c6[_0x1382('0x34')]));if(_0x587203['query'][_0x1382('0x36')]){_0x5867a8['where']=_['merge'](_0x5867a8['where'],{'$or':_[_0x1382('0x28')](_0x5867a8['attributes'],function(_0x5c9f4a){var _0x379192={};_0x379192[_0x5c9f4a]={'$like':'%'+_0x587203[_0x1382('0x2b')][_0x1382('0x36')]+'%'};return _0x379192;})});}_0x5867a8=_['merge']({},_0x5867a8,_0x587203[_0x1382('0x43')]);return _0x159ed9[_0x1382('0x4e')](_0x5867a8);}})[_0x1382('0x39')](function(_0x579faa){if(_0x579faa){_0x4994b1=_0x579faa[_0x1382('0x42')];if(!_0x587203['query'][_0x1382('0x2f')](_0x1382('0x30'))){_0x5867a8[_0x1382('0x1d')]=qs[_0x1382('0x1d')](_0x587203[_0x1382('0x2b')][_0x1382('0x1d')]);_0x5867a8[_0x1382('0x1b')]=qs[_0x1382('0x1b')](_0x587203[_0x1382('0x2b')]['offset']);}return _0x159ed9[_0x1382('0x4e')](_0x5867a8);}})[_0x1382('0x39')](function(_0x1a60d2){if(_0x1a60d2){return _0x1a60d2?{'count':_0x4994b1,'rows':_0x1a60d2}:null;}})[_0x1382('0x39')](respondWithResult(_0x5af2fb,null))[_0x1382('0x3d')](handleError(_0x5af2fb,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 095a21f..103dd3b 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 _0x3ee2=['tools_automations','lodash','util','api','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x48ea4b,_0x31ff53){var _0x13f7d6=function(_0xe198fb){while(--_0xe198fb){_0x48ea4b['push'](_0x48ea4b['shift']());}};_0x13f7d6(++_0x31ff53);}(_0x3ee2,0xb5));var _0x23ee=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3ee2[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x23ee('0x0'));var util=require(_0x23ee('0x1'));var logger=require('../../config/logger')(_0x23ee('0x2'));var moment=require('moment');var BPromise=require(_0x23ee('0x3'));var rp=require(_0x23ee('0x4'));var fs=require('fs');var path=require(_0x23ee('0x5'));var rimraf=require('rimraf');var config=require(_0x23ee('0x6'));var attributes=require(_0x23ee('0x7'));module[_0x23ee('0x8')]=function(_0x30f44d,_0x385038){return _0x30f44d[_0x23ee('0x9')](_0x23ee('0xa'),attributes,{'tableName':_0x23ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6321=['tools_automations','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes','exports','define'];(function(_0xb68772,_0x5253ac){var _0x4189bb=function(_0x1b0cf3){while(--_0x1b0cf3){_0xb68772['push'](_0xb68772['shift']());}};_0x4189bb(++_0x5253ac);}(_0x6321,0x114));var _0x1632=function(_0x2591b2,_0x29992c){_0x2591b2=_0x2591b2-0x0;var _0x13fe70=_0x6321[_0x2591b2];return _0x13fe70;};'use strict';var _=require('lodash');var util=require(_0x1632('0x0'));var logger=require(_0x1632('0x1'))('api');var moment=require(_0x1632('0x2'));var BPromise=require(_0x1632('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1632('0x4'));var rimraf=require(_0x1632('0x5'));var config=require(_0x1632('0x6'));var attributes=require(_0x1632('0x7'));module[_0x1632('0x8')]=function(_0x3de7c7,_0x38b23d){return _0x3de7c7[_0x1632('0x9')]('Automation',attributes,{'tableName':_0x1632('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 950c999..1172407 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 _0x8b35=['code','Automation,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error'];(function(_0xb7c5cc,_0x2af752){var _0x165be5=function(_0x5726e9){while(--_0x5726e9){_0xb7c5cc['push'](_0xb7c5cc['shift']());}};_0x165be5(++_0x2af752);}(_0x8b35,0x17a));var _0x58b3=function(_0x33075d,_0x557cc9){_0x33075d=_0x33075d-0x0;var _0x28a237=_0x8b35[_0x33075d];return _0x28a237;};'use strict';var _=require(_0x58b3('0x0'));var util=require(_0x58b3('0x1'));var moment=require(_0x58b3('0x2'));var BPromise=require(_0x58b3('0x3'));var rs=require(_0x58b3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58b3('0x5'))['db'];var utils=require(_0x58b3('0x6'));var logger=require(_0x58b3('0x7'))(_0x58b3('0x8'));var config=require(_0x58b3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x58b3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35d044,_0x5ec362,_0x503b78){return new BPromise(function(_0x126232,_0x46fda3){return client[_0x58b3('0xb')](_0x35d044,_0x503b78)[_0x58b3('0xc')](function(_0x446e8d){logger[_0x58b3('0xd')]('Automation,\x20%s,\x20%s',_0x5ec362,_0x58b3('0xe'));logger[_0x58b3('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x5ec362,_0x58b3('0xe'),JSON[_0x58b3('0x10')](_0x446e8d));if(_0x446e8d[_0x58b3('0x11')]){if(_0x446e8d['error'][_0x58b3('0x12')]===0x1f4){logger['error'](_0x58b3('0x13'),_0x5ec362,_0x446e8d[_0x58b3('0x11')][_0x58b3('0x14')]);return _0x46fda3(_0x446e8d[_0x58b3('0x11')][_0x58b3('0x14')]);}logger[_0x58b3('0x11')](_0x58b3('0x13'),_0x5ec362,_0x446e8d['error'][_0x58b3('0x14')]);return _0x126232(_0x446e8d[_0x58b3('0x11')]['message']);}else{logger[_0x58b3('0xd')](_0x58b3('0x13'),_0x5ec362,'request\x20sent');_0x126232(_0x446e8d['result'][_0x58b3('0x14')]);}})[_0x58b3('0x15')](function(_0x38f6a7){logger[_0x58b3('0x11')]('Automation,\x20%s,\x20%s',_0x5ec362,_0x38f6a7);_0x46fda3(_0x38f6a7);});});}
\ No newline at end of file
+var _0x4af8=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','Automation,\x20%s,\x20%s','result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x44faf5,_0x1f0f92){var _0x4c0a90=function(_0x46f01e){while(--_0x46f01e){_0x44faf5['push'](_0x44faf5['shift']());}};_0x4c0a90(++_0x1f0f92);}(_0x4af8,0x1ad));var _0x84af=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x4af8[_0x12d033];return _0x3b4e80;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x84af('0x0'));var fs=require('fs');var Redis=require(_0x84af('0x1'));var db=require(_0x84af('0x2'))['db'];var utils=require(_0x84af('0x3'));var logger=require('../../config/logger')(_0x84af('0x4'));var config=require(_0x84af('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x84af('0x6')][_0x84af('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x550ee6,_0x422c5b,_0x294bc8){return new BPromise(function(_0x483ecc,_0x5b5e45){return client[_0x84af('0x8')](_0x550ee6,_0x294bc8)[_0x84af('0x9')](function(_0x479e1b){logger[_0x84af('0xa')]('Automation,\x20%s,\x20%s',_0x422c5b,_0x84af('0xb'));logger[_0x84af('0xc')](_0x84af('0xd'),_0x422c5b,_0x84af('0xb'),JSON['stringify'](_0x479e1b));if(_0x479e1b[_0x84af('0xe')]){if(_0x479e1b['error'][_0x84af('0xf')]===0x1f4){logger[_0x84af('0xe')]('Automation,\x20%s,\x20%s',_0x422c5b,_0x479e1b[_0x84af('0xe')][_0x84af('0x10')]);return _0x5b5e45(_0x479e1b[_0x84af('0xe')][_0x84af('0x10')]);}logger['error'](_0x84af('0x11'),_0x422c5b,_0x479e1b['error'][_0x84af('0x10')]);return _0x483ecc(_0x479e1b[_0x84af('0xe')]['message']);}else{logger[_0x84af('0xa')](_0x84af('0x11'),_0x422c5b,'request\x20sent');_0x483ecc(_0x479e1b[_0x84af('0x12')]['message']);}})[_0x84af('0x13')](function(_0x33baf1){logger['error']('Automation,\x20%s,\x20%s',_0x422c5b,_0x33baf1);_0x5b5e45(_0x33baf1);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 7f08fef..1ccdf6d 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 _0x3c17=['Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','getConditions','/:id/actions','getActions','post','/:id/conditions','addConditions','addActions','destroy','multer','path','express'];(function(_0x4b7022,_0x20c8c0){var _0x4d70d2=function(_0x3455e3){while(--_0x3455e3){_0x4b7022['push'](_0x4b7022['shift']());}};_0x4d70d2(++_0x20c8c0);}(_0x3c17,0x1a1));var _0x73c1=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x3c17[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require(_0x73c1('0x0'));var util=require('util');var path=require(_0x73c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x73c1('0x2'));var router=express[_0x73c1('0x3')]();var fs_extra=require(_0x73c1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x73c1('0x5'));var config=require(_0x73c1('0x6'));var controller=require(_0x73c1('0x7'));router[_0x73c1('0x8')]('/',auth['isAuthenticated'](),controller[_0x73c1('0x9')]);router['get'](_0x73c1('0xa'),auth[_0x73c1('0xb')](),controller[_0x73c1('0xc')]);router['get']('/:id/conditions',auth[_0x73c1('0xb')](),controller[_0x73c1('0xd')]);router[_0x73c1('0x8')](_0x73c1('0xe'),auth[_0x73c1('0xb')](),controller[_0x73c1('0xf')]);router[_0x73c1('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x73c1('0x10')](_0x73c1('0x11'),auth[_0x73c1('0xb')](),controller[_0x73c1('0x12')]);router['post'](_0x73c1('0xe'),auth['isAuthenticated'](),controller[_0x73c1('0x13')]);router['put'](_0x73c1('0xa'),auth[_0x73c1('0xb')](),controller['update']);router['delete'](_0x73c1('0xa'),auth['isAuthenticated'](),controller[_0x73c1('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xd7ed=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','getActions','post','create','addConditions','addActions','put','update','delete','exports','util'];(function(_0x155665,_0x1bb0e2){var _0x5728b6=function(_0x2acbf0){while(--_0x2acbf0){_0x155665['push'](_0x155665['shift']());}};_0x5728b6(++_0x1bb0e2);}(_0xd7ed,0x1a8));var _0xdd7e=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xd7ed[_0x56916d];return _0x2b7f1f;};'use strict';var multer=require('multer');var util=require(_0xdd7e('0x0'));var path=require(_0xdd7e('0x1'));var timeout=require(_0xdd7e('0x2'));var express=require(_0xdd7e('0x3'));var router=express[_0xdd7e('0x4')]();var fs_extra=require(_0xdd7e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdd7e('0x6'));var config=require(_0xdd7e('0x7'));var controller=require(_0xdd7e('0x8'));router[_0xdd7e('0x9')]('/',auth[_0xdd7e('0xa')](),controller[_0xdd7e('0xb')]);router['get'](_0xdd7e('0xc'),auth['isAuthenticated'](),controller[_0xdd7e('0xd')]);router[_0xdd7e('0x9')](_0xdd7e('0xe'),auth[_0xdd7e('0xa')](),controller[_0xdd7e('0xf')]);router['get']('/:id/actions',auth[_0xdd7e('0xa')](),controller[_0xdd7e('0x10')]);router[_0xdd7e('0x11')]('/',auth['isAuthenticated'](),controller[_0xdd7e('0x12')]);router[_0xdd7e('0x11')](_0xdd7e('0xe'),auth[_0xdd7e('0xa')](),controller[_0xdd7e('0x13')]);router[_0xdd7e('0x11')]('/:id/actions',auth[_0xdd7e('0xa')](),controller[_0xdd7e('0x14')]);router[_0xdd7e('0x15')](_0xdd7e('0xc'),auth[_0xdd7e('0xa')](),controller[_0xdd7e('0x16')]);router[_0xdd7e('0x17')](_0xdd7e('0xc'),auth[_0xdd7e('0xa')](),controller['destroy']);module[_0xdd7e('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index db22b90..a14778d 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 _0xb8a0=['Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ivr','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x5aba20,_0x399db1){var _0x42fadb=function(_0xd1da6b){while(--_0xd1da6b){_0x5aba20['push'](_0x5aba20['shift']());}};_0x42fadb(++_0x399db1);}(_0xb8a0,0x111));var _0x0b8a=function(_0x38fb3c,_0x31514a){_0x38fb3c=_0x38fb3c-0x0;var _0x34b0b8=_0xb8a0[_0x38fb3c];return _0x34b0b8;};'use strict';var Sequelize=require('sequelize');module[_0x0b8a('0x0')]={'name':{'type':Sequelize[_0x0b8a('0x1')],'unique':_0x0b8a('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x0b8a('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x0b8a('0x4')](0x4)[_0x0b8a('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0b8a('0x6')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0b8a('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x0b8a('0x4')](0x3)[_0x0b8a('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b8a('0x7')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b8a('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b8a('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b8a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b8a('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x0b8a('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b8a('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0b8a('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0b8a('0x4')](0x3)[_0x0b8a('0x5')],'defaultValue':0x3,'comment':_0x0b8a('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0b8a('0x4')](0x5)[_0x0b8a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b8a('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0b8a('0x4')](0x3)[_0x0b8a('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x0b8a('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0b8a('0x1')],'defaultValue':_0x0b8a('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x0b8a('0xe')](_0x0b8a('0xf'),_0x0b8a('0x10'),_0x0b8a('0x11')),'defaultValue':_0x0b8a('0xf')},'dialAMDActive':{'type':Sequelize[_0x0b8a('0x12')],'defaultValue':0x0,'comment':_0x0b8a('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x0b8a('0x4')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x0b8a('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0b8a('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0b8a('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0b8a('0x4')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b8a('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0b8a('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0b8a('0x4')](0x9)[_0x0b8a('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0b8a('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x0b8a('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0b8a('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0b8a('0x4')](0x5)[_0x0b8a('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0b8a('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0b8a('0x4')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b8a('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':_0x0b8a('0x1a')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x0b8a('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x0b8a('0x4')](0x3)[_0x0b8a('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0b8a('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0b8a('0x4')](0x3)[_0x0b8a('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b8a('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0b8a('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x0b8a('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b8a('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x0b8a('0x4')](0x5)[_0x0b8a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b8a('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0b8a('0x4')](0x3)[_0x0b8a('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b8a('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0b8a('0x4')](0x5)[_0x0b8a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b8a('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x0b8a('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0b8a('0x4')](0x5)[_0x0b8a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b8a('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0b8a('0x4')](0x3)[_0x0b8a('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0b8a('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x4838=['never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','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)','always'];(function(_0x302514,_0x2f2385){var _0x1c13ee=function(_0x127a4a){while(--_0x127a4a){_0x302514['push'](_0x302514['shift']());}};_0x1c13ee(++_0x2f2385);}(_0x4838,0x111));var _0x8483=function(_0x5a078f,_0x5aeb9b){_0x5a078f=_0x5a078f-0x0;var _0x22b22d=_0x4838[_0x5a078f];return _0x22b22d;};'use strict';var Sequelize=require('sequelize');module[_0x8483('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x8483('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x8483('0x2')](_0x8483('0x3')),'allowNull':![],'defaultValue':_0x8483('0x3')},'description':{'type':Sequelize[_0x8483('0x4')]},'active':{'type':Sequelize[_0x8483('0x5')],'defaultValue':0x0,'comment':_0x8483('0x6')},'limitCalls':{'type':Sequelize[_0x8483('0x7')](0x4)[_0x8483('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x8483('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8483('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8483('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x8483('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8483('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8483('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8483('0x7')](0x5)[_0x8483('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8483('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8483('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8483('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8483('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8483('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8483('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8483('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8483('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x8483('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8483('0x4')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x8483('0x2')](_0x8483('0xe'),_0x8483('0xf'),_0x8483('0x10')),'defaultValue':_0x8483('0xe')},'dialAMDActive':{'type':Sequelize[_0x8483('0x5')],'defaultValue':0x0,'comment':_0x8483('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x8483('0x7')](0x9)[_0x8483('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8483('0x12')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x8483('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8483('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8483('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8483('0x14')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x8483('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8483('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8483('0x7')](0x9)[_0x8483('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8483('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8483('0x7')](0x9)[_0x8483('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'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[_0x8483('0x7')](0x9)[_0x8483('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x8483('0x17'),'ASC'),'defaultValue':_0x8483('0x17')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8483('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8483('0x18')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x8483('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8483('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8483('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8483('0x19')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8483('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8483('0x1a')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8483('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8483('0x7')](0x3)[_0x8483('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8483('0x1b')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8483('0x1c')},'dialMachineMaxRetry':{'type':Sequelize[_0x8483('0x7')](0x3)[_0x8483('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8483('0x1d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x8483('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8483('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8483('0x1e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8483('0x7')](0x5)[_0x8483('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8483('0x1f')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 9d521c2..ddf3318 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 _0x79dc=['CampaignId','CmHopper','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','rows','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','into','fromQuery','scheduledAt','ListId','select','field','phone','NOW()','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','insert','cm_hopper','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','IvrCampaigns','error','stack','name','send','index','map','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','where','merge','VIRTUAL','filter','options','Campaign','includeAll','include','catch','params','keys','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','clone','createdAt','updatedAt','omit','destroy','findOne','nolimit'];(function(_0x33f6be,_0x2864a6){var _0x3de6ac=function(_0x3e5c26){while(--_0x3e5c26){_0x33f6be['push'](_0x33f6be['shift']());}};_0x3de6ac(++_0x2864a6);}(_0x79dc,0x13a));var _0xc79d=function(_0x128152,_0x2944b7){_0x128152=_0x128152-0x0;var _0x87e1ec=_0x79dc[_0x128152];return _0x87e1ec;};'use strict';var emlformat=require(_0xc79d('0x0'));var rimraf=require(_0xc79d('0x1'));var zipdir=require(_0xc79d('0x2'));var jsonpatch=require(_0xc79d('0x3'));var rp=require(_0xc79d('0x4'));var moment=require(_0xc79d('0x5'));var BPromise=require(_0xc79d('0x6'));var Mustache=require(_0xc79d('0x7'));var util=require(_0xc79d('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc79d('0x9'));var _=require(_0xc79d('0xa'));var squel=require(_0xc79d('0xb'));var crypto=require('crypto');var jsforce=require(_0xc79d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc79d('0xd'));var querystring=require(_0xc79d('0xe'));var Papa=require(_0xc79d('0xf'));var Redis=require(_0xc79d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc79d('0x11'));var as=require(_0xc79d('0x12'));var hardwareService=require(_0xc79d('0x13'));var logger=require('../../config/logger')(_0xc79d('0x14'));var utils=require(_0xc79d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc79d('0x16'));var db=require(_0xc79d('0x17'))['db'];function respondWithStatusCode(_0xe71829,_0x20c888){_0x20c888=_0x20c888||0xcc;return function(_0x3862d9){if(_0x3862d9){return _0xe71829[_0xc79d('0x18')](_0x20c888);}return _0xe71829['status'](_0x20c888)[_0xc79d('0x19')]();};}function respondWithResult(_0x31841c,_0x35906c){_0x35906c=_0x35906c||0xc8;return function(_0x30e925){if(_0x30e925){return _0x31841c[_0xc79d('0x1a')](_0x35906c)[_0xc79d('0x1b')](_0x30e925);}};}function respondWithFilteredResult(_0x555db3,_0x34294e){return function(_0x5c46fe){if(_0x5c46fe){var _0x582bed=typeof _0x34294e[_0xc79d('0x1c')]==='undefined'&&typeof _0x34294e[_0xc79d('0x1d')]===_0xc79d('0x1e');var _0xee71c8=_0x5c46fe[_0xc79d('0x1f')];var _0x452e28=_0x582bed?0x0:_0x34294e['offset'];var _0x34f516=_0x582bed?_0x5c46fe[_0xc79d('0x1f')]:_0x34294e[_0xc79d('0x1c')]+_0x34294e[_0xc79d('0x1d')];var _0x2dde1c;if(_0x34f516>=_0xee71c8){_0x34f516=_0xee71c8;_0x2dde1c=0xc8;}else{_0x2dde1c=0xce;}_0x555db3[_0xc79d('0x1a')](_0x2dde1c);return _0x555db3[_0xc79d('0x20')](_0xc79d('0x21'),_0x452e28+'-'+_0x34f516+'/'+_0xee71c8)[_0xc79d('0x1b')](_0x5c46fe);}return null;};}function patchUpdates(_0x42f0cc){return function(_0x268ea1){try{jsonpatch[_0xc79d('0x22')](_0x268ea1,_0x42f0cc,!![]);}catch(_0x3d041e){return BPromise[_0xc79d('0x23')](_0x3d041e);}return _0x268ea1[_0xc79d('0x24')]();};}function saveUpdates(_0x36e990,_0x260d52){return function(_0x19e3a8){if(_0x19e3a8){return _0x19e3a8['update'](_0x36e990)[_0xc79d('0x25')](function(_0x319ef8){return _0x319ef8;});}return null;};}function removeEntity(_0x53ba86,_0x2676df){return function(_0x31bc7a){if(_0x31bc7a){return _0x31bc7a['destroy']()['then'](function(){var _0x11a1b9=_0x31bc7a['get']({'plain':!![]});var _0x49f36e=_0xc79d('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x49f36e,'resourceId':_0x11a1b9['id']}})['then'](function(){return _0x31bc7a;});})[_0xc79d('0x25')](function(){_0x53ba86['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12343c,_0x4e2417){return function(_0x381290){if(!_0x381290){_0x12343c['sendStatus'](0x194);}return _0x381290;};}function handleError(_0x8be74,_0xdfaf41){_0xdfaf41=_0xdfaf41||0x1f4;return function(_0x4b9058){logger[_0xc79d('0x27')](_0x4b9058[_0xc79d('0x28')]);if(_0x4b9058[_0xc79d('0x29')]){delete _0x4b9058[_0xc79d('0x29')];}_0x8be74[_0xc79d('0x1a')](_0xdfaf41)[_0xc79d('0x2a')](_0x4b9058);};}exports[_0xc79d('0x2b')]=function(_0x3870a3,_0x5ed991){var _0x30c89f={},_0x11d2df={},_0x4b7f2b={'count':0x0,'rows':[]};var _0x348c15=_[_0xc79d('0x2c')](db['Campaign'][_0xc79d('0x2d')],function(_0x185c2b){return{'name':_0x185c2b['fieldName'],'type':_0x185c2b[_0xc79d('0x2e')]['key']};});_0x11d2df[_0xc79d('0x2f')]=_['map'](_0x348c15,_0xc79d('0x29'));_0x11d2df[_0xc79d('0x30')]=_['keys'](_0x3870a3[_0xc79d('0x30')]);_0x11d2df['filters']=_[_0xc79d('0x31')](_0x11d2df[_0xc79d('0x2f')],_0x11d2df['query']);_0x30c89f[_0xc79d('0x32')]=_[_0xc79d('0x31')](_0x11d2df[_0xc79d('0x2f')],qs['fields'](_0x3870a3[_0xc79d('0x30')][_0xc79d('0x33')]));_0x30c89f[_0xc79d('0x32')]=_0x30c89f['attributes'][_0xc79d('0x34')]?_0x30c89f[_0xc79d('0x32')]:_0x11d2df[_0xc79d('0x2f')];if(!_0x3870a3[_0xc79d('0x30')][_0xc79d('0x35')]('nolimit')){_0x30c89f[_0xc79d('0x1d')]=qs['limit'](_0x3870a3[_0xc79d('0x30')]['limit']);_0x30c89f[_0xc79d('0x1c')]=qs[_0xc79d('0x1c')](_0x3870a3[_0xc79d('0x30')][_0xc79d('0x1c')]);}_0x30c89f[_0xc79d('0x36')]=qs[_0xc79d('0x37')](_0x3870a3['query']['sort']);_0x30c89f['where']=qs['filters'](_[_0xc79d('0x38')](_0x3870a3[_0xc79d('0x30')],_0x11d2df[_0xc79d('0x39')]),_0x348c15);if(_0x3870a3[_0xc79d('0x30')]['filter']){_0x30c89f[_0xc79d('0x3a')]=_[_0xc79d('0x3b')](_0x30c89f['where'],{'$or':_[_0xc79d('0x2c')](_0x348c15,function(_0x2f5bb6){if(_0x2f5bb6[_0xc79d('0x2e')]!==_0xc79d('0x3c')){var _0x578fd5={};_0x578fd5[_0x2f5bb6[_0xc79d('0x29')]]={'$like':'%'+_0x3870a3[_0xc79d('0x30')][_0xc79d('0x3d')]+'%'};return _0x578fd5;}})});}_0x30c89f=_[_0xc79d('0x3b')]({},_0x30c89f,_0x3870a3[_0xc79d('0x3e')]);var _0x2cc9bc={'where':_0x30c89f[_0xc79d('0x3a')]};return db[_0xc79d('0x3f')]['count'](_0x2cc9bc)['then'](function(_0x17c8ab){_0x4b7f2b[_0xc79d('0x1f')]=_0x17c8ab;if(_0x3870a3[_0xc79d('0x30')][_0xc79d('0x40')]){_0x30c89f[_0xc79d('0x41')]=[{'all':!![]}];}return db[_0xc79d('0x3f')]['findAll'](_0x30c89f);})['then'](function(_0x16fae9){_0x4b7f2b['rows']=_0x16fae9;return _0x4b7f2b;})['then'](respondWithFilteredResult(_0x5ed991,_0x30c89f))[_0xc79d('0x42')](handleError(_0x5ed991,null));};exports['show']=function(_0x3927a3,_0x59fad2){var _0x20a031={'raw':![],'where':{'id':_0x3927a3[_0xc79d('0x43')]['id']}},_0x56f36={};_0x56f36[_0xc79d('0x2f')]=_[_0xc79d('0x44')](db[_0xc79d('0x3f')][_0xc79d('0x2d')]);_0x56f36[_0xc79d('0x30')]=_[_0xc79d('0x44')](_0x3927a3[_0xc79d('0x30')]);_0x56f36[_0xc79d('0x39')]=_['intersection'](_0x56f36[_0xc79d('0x2f')],_0x56f36['query']);_0x20a031[_0xc79d('0x32')]=_[_0xc79d('0x31')](_0x56f36[_0xc79d('0x2f')],qs[_0xc79d('0x33')](_0x3927a3[_0xc79d('0x30')][_0xc79d('0x33')]));_0x20a031[_0xc79d('0x32')]=_0x20a031[_0xc79d('0x32')]['length']?_0x20a031[_0xc79d('0x32')]:_0x56f36['model'];if(_0x3927a3[_0xc79d('0x30')][_0xc79d('0x40')]){_0x20a031[_0xc79d('0x41')]=[{'all':!![]}];}_0x20a031=_[_0xc79d('0x3b')]({},_0x20a031,_0x3927a3[_0xc79d('0x3e')]);return db[_0xc79d('0x3f')][_0xc79d('0x45')](_0x20a031)[_0xc79d('0x25')](handleEntityNotFound(_0x59fad2,null))['then'](respondWithResult(_0x59fad2,null))[_0xc79d('0x42')](handleError(_0x59fad2,null));};exports[_0xc79d('0x46')]=function(_0x34fbe6,_0x195483){return db[_0xc79d('0x3f')][_0xc79d('0x46')](_0x34fbe6[_0xc79d('0x47')],{})[_0xc79d('0x25')](function(_0x4a32ed){var _0x1c3e4=_0x34fbe6[_0xc79d('0x48')][_0xc79d('0x49')]({'plain':!![]});if(!_0x1c3e4)throw new Error(_0xc79d('0x4a'));if(_0x1c3e4[_0xc79d('0x4b')]===_0xc79d('0x48')){var _0x44138a=_0x4a32ed['get']({'plain':!![]});var _0x530931=_0xc79d('0x26');return db[_0xc79d('0x4c')][_0xc79d('0x45')]({'where':{'name':_0x530931,'userProfileId':_0x1c3e4[_0xc79d('0x4d')]},'raw':!![]})[_0xc79d('0x25')](function(_0x131cec){if(_0x131cec&&_0x131cec[_0xc79d('0x4e')]===0x0){return db[_0xc79d('0x4f')]['create']({'name':_0x44138a[_0xc79d('0x29')],'resourceId':_0x44138a['id'],'type':_0x131cec[_0xc79d('0x29')],'sectionId':_0x131cec['id']},{})['then'](function(){return _0x4a32ed;});}else{return _0x4a32ed;}})[_0xc79d('0x42')](function(_0x2829a3){logger[_0xc79d('0x27')](_0xc79d('0x50'),_0x2829a3);throw _0x2829a3;});}return _0x4a32ed;})[_0xc79d('0x25')](respondWithResult(_0x195483,0xc9))[_0xc79d('0x42')](handleError(_0x195483,null));};exports[_0xc79d('0x51')]=function(_0x58fe4d,_0x5b8bf6){var _0x1e76e5={'where':{'id':_0x58fe4d[_0xc79d('0x43')]['id']}},_0x2a828f={};_0x2a828f[_0xc79d('0x2f')]=_[_0xc79d('0x44')](db[_0xc79d('0x3f')]['rawAttributes']);_0x1e76e5['attributes']=_[_0xc79d('0x31')](_0x2a828f[_0xc79d('0x2f')],qs[_0xc79d('0x33')](_0x58fe4d[_0xc79d('0x30')][_0xc79d('0x33')]));_0x1e76e5[_0xc79d('0x32')]=_0x1e76e5[_0xc79d('0x32')][_0xc79d('0x34')]?_0x1e76e5['attributes']:_0x2a828f['model'];if(_0x58fe4d[_0xc79d('0x30')][_0xc79d('0x40')]){_0x1e76e5[_0xc79d('0x41')]=[{'all':!![]}];}_0x1e76e5=_[_0xc79d('0x3b')]({},_0x1e76e5,_0x58fe4d[_0xc79d('0x3e')]);return db['Campaign'][_0xc79d('0x45')](_0x1e76e5)[_0xc79d('0x25')](handleEntityNotFound(_0x5b8bf6,null))['then'](function(_0x512543){if(_0x512543){var _0x437820=_0x512543[_0xc79d('0x49')]({'plain':!![]});_0x437820=qs['omit'](_0x437820,['id',_0xc79d('0x52'),_0xc79d('0x53')]);_0x58fe4d['body']=_[_0xc79d('0x54')](_0x58fe4d['body'],['id',_0xc79d('0x52'),'updatedAt']);return db[_0xc79d('0x3f')][_0xc79d('0x46')](_[_0xc79d('0x3b')](_0x437820,_0x58fe4d['body']),{'include':_0x58fe4d[_0xc79d('0x30')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x310fca){var _0x1eb852=_0x58fe4d[_0xc79d('0x48')][_0xc79d('0x49')]({'plain':!![]});if(!_0x1eb852)throw new Error(_0xc79d('0x4a'));if(_0x1eb852['role']===_0xc79d('0x48')){var _0x450523=_0x310fca[_0xc79d('0x49')]({'plain':!![]});var _0x1539d8=_0xc79d('0x26');return db[_0xc79d('0x4c')][_0xc79d('0x45')]({'where':{'name':_0x1539d8,'userProfileId':_0x1eb852[_0xc79d('0x4d')]},'raw':!![]})[_0xc79d('0x25')](function(_0x4b7b31){if(_0x4b7b31&&_0x4b7b31[_0xc79d('0x4e')]===0x0){return db[_0xc79d('0x4f')]['create']({'name':_0x450523[_0xc79d('0x29')],'resourceId':_0x450523['id'],'type':_0x4b7b31[_0xc79d('0x29')],'sectionId':_0x4b7b31['id']},{})[_0xc79d('0x25')](function(){return _0x310fca;});}else{return _0x310fca;}})[_0xc79d('0x42')](function(_0x39b5c7){logger[_0xc79d('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39b5c7);throw _0x39b5c7;});}return _0x310fca;});}})[_0xc79d('0x25')](respondWithResult(_0x5b8bf6,0xc9))[_0xc79d('0x42')](handleError(_0x5b8bf6,null));};exports['update']=function(_0x25a379,_0x3bc34e){if(_0x25a379[_0xc79d('0x47')]['id']){delete _0x25a379[_0xc79d('0x47')]['id'];}return db[_0xc79d('0x3f')][_0xc79d('0x45')]({'where':{'id':_0x25a379['params']['id']}})[_0xc79d('0x25')](handleEntityNotFound(_0x3bc34e,null))[_0xc79d('0x25')](saveUpdates(_0x25a379[_0xc79d('0x47')],null))['then'](respondWithResult(_0x3bc34e,null))['catch'](handleError(_0x3bc34e,null));};exports[_0xc79d('0x55')]=function(_0x283d4f,_0x12c1e4){return db[_0xc79d('0x3f')]['find']({'where':{'id':_0x283d4f['params']['id']}})[_0xc79d('0x25')](handleEntityNotFound(_0x12c1e4,null))[_0xc79d('0x25')](removeEntity(_0x12c1e4,null))[_0xc79d('0x42')](handleError(_0x12c1e4,null));};exports['getHoppers']=function(_0x6c1e2b,_0x518137,_0x208bce){var _0x21bcad={'raw':!![],'where':{}};var _0x5ab26b={};var _0x3bb246={'count':0x0,'rows':[]};return db[_0xc79d('0x3f')][_0xc79d('0x56')]({'where':{'id':_0x6c1e2b[_0xc79d('0x43')]['id']}})[_0xc79d('0x25')](handleEntityNotFound(_0x518137,null))[_0xc79d('0x25')](function(_0x488840){if(_0x488840){_0x5ab26b[_0xc79d('0x2f')]=_[_0xc79d('0x44')](db['CmHopper'][_0xc79d('0x2d')]);_0x5ab26b[_0xc79d('0x30')]=_['keys'](_0x6c1e2b[_0xc79d('0x30')]);_0x5ab26b[_0xc79d('0x39')]=_['intersection'](_0x5ab26b['model'],_0x5ab26b[_0xc79d('0x30')]);_0x21bcad[_0xc79d('0x32')]=_[_0xc79d('0x31')](_0x5ab26b[_0xc79d('0x2f')],qs['fields'](_0x6c1e2b[_0xc79d('0x30')][_0xc79d('0x33')]));_0x21bcad[_0xc79d('0x32')]=_0x21bcad[_0xc79d('0x32')][_0xc79d('0x34')]?_0x21bcad[_0xc79d('0x32')]:_0x5ab26b[_0xc79d('0x2f')];if(!_0x6c1e2b[_0xc79d('0x30')][_0xc79d('0x35')](_0xc79d('0x57'))){_0x21bcad[_0xc79d('0x1d')]=qs['limit'](_0x6c1e2b[_0xc79d('0x30')][_0xc79d('0x1d')]);_0x21bcad['offset']=qs[_0xc79d('0x1c')](_0x6c1e2b[_0xc79d('0x30')][_0xc79d('0x1c')]);}_0x21bcad['order']=qs[_0xc79d('0x37')](_0x6c1e2b['query'][_0xc79d('0x37')]);_0x21bcad['where']=qs[_0xc79d('0x39')](_[_0xc79d('0x38')](_0x6c1e2b[_0xc79d('0x30')],_0x5ab26b[_0xc79d('0x39')]));_0x21bcad[_0xc79d('0x3a')][_0xc79d('0x58')]=_0x488840['id'];if(_0x6c1e2b[_0xc79d('0x30')]['filter']){_0x21bcad[_0xc79d('0x3a')]=_[_0xc79d('0x3b')](_0x21bcad[_0xc79d('0x3a')],{'$or':_[_0xc79d('0x2c')](_0x21bcad[_0xc79d('0x32')],function(_0x1d8c56){var _0x584956={};_0x584956[_0x1d8c56]={'$like':'%'+_0x6c1e2b['query'][_0xc79d('0x3d')]+'%'};return _0x584956;})});}_0x21bcad=_[_0xc79d('0x3b')]({},_0x21bcad,_0x6c1e2b['options']);return db[_0xc79d('0x59')][_0xc79d('0x1f')]({'where':_0x21bcad['where']})['then'](function(_0x28597e){_0x3bb246[_0xc79d('0x1f')]=_0x28597e;if(_0x6c1e2b[_0xc79d('0x30')][_0xc79d('0x40')]){_0x21bcad[_0xc79d('0x41')]=[{'all':!![]}];}return db[_0xc79d('0x59')][_0xc79d('0x5a')](_0x21bcad);})['then'](function(_0x362237){_0x3bb246['rows']=_0x362237;return _0x3bb246;});}})[_0xc79d('0x25')](respondWithFilteredResult(_0x518137,_0x21bcad))[_0xc79d('0x42')](handleError(_0x518137,null));};exports[_0xc79d('0x5b')]=function(_0x34dee0,_0x3984fb,_0x21976c){var _0x4e283a={'raw':!![],'where':{}};var _0x537b2d={};var _0x14fd9a={'count':0x0,'rows':[]};return db[_0xc79d('0x3f')]['findOne']({'where':{'id':_0x34dee0[_0xc79d('0x43')]['id']}})[_0xc79d('0x25')](handleEntityNotFound(_0x3984fb,null))[_0xc79d('0x25')](function(_0x3f204d){if(_0x3f204d){_0x537b2d[_0xc79d('0x2f')]=_[_0xc79d('0x44')](db[_0xc79d('0x5c')][_0xc79d('0x2d')]);_0x537b2d[_0xc79d('0x30')]=_[_0xc79d('0x44')](_0x34dee0['query']);_0x537b2d[_0xc79d('0x39')]=_[_0xc79d('0x31')](_0x537b2d['model'],_0x537b2d['query']);_0x4e283a[_0xc79d('0x32')]=_[_0xc79d('0x31')](_0x537b2d[_0xc79d('0x2f')],qs[_0xc79d('0x33')](_0x34dee0[_0xc79d('0x30')]['fields']));_0x4e283a[_0xc79d('0x32')]=_0x4e283a[_0xc79d('0x32')][_0xc79d('0x34')]?_0x4e283a[_0xc79d('0x32')]:_0x537b2d[_0xc79d('0x2f')];if(!_0x34dee0[_0xc79d('0x30')][_0xc79d('0x35')](_0xc79d('0x57'))){_0x4e283a['limit']=qs[_0xc79d('0x1d')](_0x34dee0['query']['limit']);_0x4e283a[_0xc79d('0x1c')]=qs[_0xc79d('0x1c')](_0x34dee0[_0xc79d('0x30')]['offset']);}_0x4e283a[_0xc79d('0x36')]=qs[_0xc79d('0x37')](_0x34dee0[_0xc79d('0x30')]['sort']);_0x4e283a[_0xc79d('0x3a')]=qs[_0xc79d('0x39')](_['pick'](_0x34dee0[_0xc79d('0x30')],_0x537b2d[_0xc79d('0x39')]));_0x4e283a[_0xc79d('0x3a')][_0xc79d('0x58')]=_0x3f204d['id'];if(_0x34dee0[_0xc79d('0x30')][_0xc79d('0x3d')]){_0x4e283a[_0xc79d('0x3a')]=_['merge'](_0x4e283a[_0xc79d('0x3a')],{'$or':_['map'](_0x4e283a[_0xc79d('0x32')],function(_0x240e8b){var _0x4ca919={};_0x4ca919[_0x240e8b]={'$like':'%'+_0x34dee0[_0xc79d('0x30')][_0xc79d('0x3d')]+'%'};return _0x4ca919;})});}_0x4e283a=_[_0xc79d('0x3b')]({},_0x4e283a,_0x34dee0[_0xc79d('0x3e')]);return db['CmHopperHistory'][_0xc79d('0x1f')]({'where':_0x4e283a[_0xc79d('0x3a')]})[_0xc79d('0x25')](function(_0x23fadc){_0x14fd9a[_0xc79d('0x1f')]=_0x23fadc;if(_0x34dee0[_0xc79d('0x30')][_0xc79d('0x40')]){_0x4e283a['include']=[{'all':!![]}];}return db[_0xc79d('0x5c')][_0xc79d('0x5a')](_0x4e283a);})[_0xc79d('0x25')](function(_0x313f7c){_0x14fd9a['rows']=_0x313f7c;return _0x14fd9a;});}})[_0xc79d('0x25')](respondWithFilteredResult(_0x3984fb,_0x4e283a))[_0xc79d('0x42')](handleError(_0x3984fb,null));};exports[_0xc79d('0x5d')]=function(_0x33a0fe,_0x236c35,_0x5800c6){var _0x2b9cd4={'raw':!![],'where':{}};var _0x378983={};var _0x59a736={'count':0x0,'rows':[]};return db[_0xc79d('0x3f')][_0xc79d('0x56')]({'where':{'id':_0x33a0fe['params']['id']}})[_0xc79d('0x25')](handleEntityNotFound(_0x236c35,null))[_0xc79d('0x25')](function(_0x5a0205){if(_0x5a0205){_0x378983[_0xc79d('0x2f')]=_[_0xc79d('0x44')](db[_0xc79d('0x5e')]['rawAttributes']);_0x378983[_0xc79d('0x30')]=_[_0xc79d('0x44')](_0x33a0fe[_0xc79d('0x30')]);_0x378983[_0xc79d('0x39')]=_[_0xc79d('0x31')](_0x378983[_0xc79d('0x2f')],_0x378983['query']);_0x2b9cd4[_0xc79d('0x32')]=_[_0xc79d('0x31')](_0x378983['model'],qs[_0xc79d('0x33')](_0x33a0fe[_0xc79d('0x30')][_0xc79d('0x33')]));_0x2b9cd4['attributes']=_0x2b9cd4[_0xc79d('0x32')][_0xc79d('0x34')]?_0x2b9cd4['attributes']:_0x378983[_0xc79d('0x2f')];if(!_0x33a0fe[_0xc79d('0x30')][_0xc79d('0x35')](_0xc79d('0x57'))){_0x2b9cd4['limit']=qs[_0xc79d('0x1d')](_0x33a0fe[_0xc79d('0x30')][_0xc79d('0x1d')]);_0x2b9cd4['offset']=qs[_0xc79d('0x1c')](_0x33a0fe[_0xc79d('0x30')]['offset']);}_0x2b9cd4[_0xc79d('0x36')]=qs[_0xc79d('0x37')](_0x33a0fe[_0xc79d('0x30')][_0xc79d('0x37')]);_0x2b9cd4[_0xc79d('0x3a')]=qs[_0xc79d('0x39')](_[_0xc79d('0x38')](_0x33a0fe[_0xc79d('0x30')],_0x378983[_0xc79d('0x39')]));_0x2b9cd4[_0xc79d('0x3a')][_0xc79d('0x58')]=_0x5a0205['id'];if(_0x33a0fe[_0xc79d('0x30')][_0xc79d('0x3d')]){_0x2b9cd4[_0xc79d('0x3a')]=_[_0xc79d('0x3b')](_0x2b9cd4[_0xc79d('0x3a')],{'$or':_[_0xc79d('0x2c')](_0x2b9cd4[_0xc79d('0x32')],function(_0x5e7c41){var _0x59b262={};_0x59b262[_0x5e7c41]={'$like':'%'+_0x33a0fe[_0xc79d('0x30')]['filter']+'%'};return _0x59b262;})});}_0x2b9cd4=_[_0xc79d('0x3b')]({},_0x2b9cd4,_0x33a0fe[_0xc79d('0x3e')]);return db[_0xc79d('0x5e')][_0xc79d('0x1f')]({'where':_0x2b9cd4['where']})[_0xc79d('0x25')](function(_0x52ab22){_0x59a736['count']=_0x52ab22;if(_0x33a0fe[_0xc79d('0x30')][_0xc79d('0x40')]){_0x2b9cd4[_0xc79d('0x41')]=[{'all':!![]}];}return db[_0xc79d('0x5e')][_0xc79d('0x5a')](_0x2b9cd4);})[_0xc79d('0x25')](function(_0x9c95a){_0x59a736[_0xc79d('0x5f')]=_0x9c95a;return _0x59a736;});}})[_0xc79d('0x25')](respondWithFilteredResult(_0x236c35,_0x2b9cd4))[_0xc79d('0x42')](handleError(_0x236c35,null));};exports['getHopperBlacks']=function(_0xc85cc0,_0x5d827e,_0x29f105){var _0x447019={'raw':!![],'where':{}};var _0x629f83={};var _0x162575={'count':0x0,'rows':[]};return db[_0xc79d('0x3f')][_0xc79d('0x56')]({'where':{'id':_0xc85cc0[_0xc79d('0x43')]['id']}})[_0xc79d('0x25')](handleEntityNotFound(_0x5d827e,null))['then'](function(_0x443820){if(_0x443820){_0x629f83[_0xc79d('0x2f')]=_[_0xc79d('0x44')](db[_0xc79d('0x60')][_0xc79d('0x2d')]);_0x629f83[_0xc79d('0x30')]=_['keys'](_0xc85cc0['query']);_0x629f83[_0xc79d('0x39')]=_[_0xc79d('0x31')](_0x629f83['model'],_0x629f83[_0xc79d('0x30')]);_0x447019['attributes']=_[_0xc79d('0x31')](_0x629f83['model'],qs['fields'](_0xc85cc0[_0xc79d('0x30')][_0xc79d('0x33')]));_0x447019[_0xc79d('0x32')]=_0x447019['attributes'][_0xc79d('0x34')]?_0x447019['attributes']:_0x629f83[_0xc79d('0x2f')];if(!_0xc85cc0[_0xc79d('0x30')][_0xc79d('0x35')](_0xc79d('0x57'))){_0x447019[_0xc79d('0x1d')]=qs[_0xc79d('0x1d')](_0xc85cc0[_0xc79d('0x30')]['limit']);_0x447019[_0xc79d('0x1c')]=qs[_0xc79d('0x1c')](_0xc85cc0[_0xc79d('0x30')][_0xc79d('0x1c')]);}_0x447019[_0xc79d('0x36')]=qs['sort'](_0xc85cc0[_0xc79d('0x30')][_0xc79d('0x37')]);_0x447019[_0xc79d('0x3a')]=qs[_0xc79d('0x39')](_[_0xc79d('0x38')](_0xc85cc0['query'],_0x629f83['filters']));_0x447019[_0xc79d('0x3a')][_0xc79d('0x58')]=_0x443820['id'];if(_0xc85cc0['query']['filter']){_0x447019[_0xc79d('0x3a')]=_[_0xc79d('0x3b')](_0x447019[_0xc79d('0x3a')],{'$or':_[_0xc79d('0x2c')](_0x447019['attributes'],function(_0x5e5afb){var _0x14399b={};_0x14399b[_0x5e5afb]={'$like':'%'+_0xc85cc0['query'][_0xc79d('0x3d')]+'%'};return _0x14399b;})});}_0x447019=_['merge']({},_0x447019,_0xc85cc0[_0xc79d('0x3e')]);return db[_0xc79d('0x60')][_0xc79d('0x1f')]({'where':_0x447019[_0xc79d('0x3a')]})[_0xc79d('0x25')](function(_0x3d4843){_0x162575['count']=_0x3d4843;if(_0xc85cc0[_0xc79d('0x30')][_0xc79d('0x40')]){_0x447019[_0xc79d('0x41')]=[{'all':!![]}];}return db[_0xc79d('0x60')]['findAll'](_0x447019);})[_0xc79d('0x25')](function(_0x3726d4){_0x162575[_0xc79d('0x5f')]=_0x3726d4;return _0x162575;});}})['then'](respondWithFilteredResult(_0x5d827e,_0x447019))[_0xc79d('0x42')](handleError(_0x5d827e,null));};exports[_0xc79d('0x61')]=function(_0x23ea40,_0x18a349,_0x252f2d){var _0x399c89={};var _0x4b4b16={};var _0x34cb5d;var _0xf04f24;return db['Campaign'][_0xc79d('0x56')]({'where':{'id':_0x23ea40[_0xc79d('0x43')]['id']}})[_0xc79d('0x25')](handleEntityNotFound(_0x18a349,null))[_0xc79d('0x25')](function(_0x337cbd){if(_0x337cbd){_0x34cb5d=_0x337cbd;_0x4b4b16[_0xc79d('0x2f')]=_[_0xc79d('0x44')](db[_0xc79d('0x62')][_0xc79d('0x2d')]);_0x4b4b16[_0xc79d('0x30')]=_[_0xc79d('0x44')](_0x23ea40['query']);_0x4b4b16['filters']=_[_0xc79d('0x31')](_0x4b4b16[_0xc79d('0x2f')],_0x4b4b16[_0xc79d('0x30')]);_0x399c89[_0xc79d('0x32')]=_['intersection'](_0x4b4b16['model'],qs['fields'](_0x23ea40['query'][_0xc79d('0x33')]));_0x399c89[_0xc79d('0x32')]=_0x399c89[_0xc79d('0x32')][_0xc79d('0x34')]?_0x399c89[_0xc79d('0x32')]:_0x4b4b16[_0xc79d('0x2f')];_0x399c89[_0xc79d('0x36')]=qs[_0xc79d('0x37')](_0x23ea40[_0xc79d('0x30')][_0xc79d('0x37')]);_0x399c89[_0xc79d('0x3a')]=qs['filters'](_[_0xc79d('0x38')](_0x23ea40[_0xc79d('0x30')],_0x4b4b16[_0xc79d('0x39')]));if(_0x23ea40[_0xc79d('0x30')]['filter']){_0x399c89['where']=_[_0xc79d('0x3b')](_0x399c89['where'],{'$or':_[_0xc79d('0x2c')](_0x399c89[_0xc79d('0x32')],function(_0x171013){var _0x31062b={};_0x31062b[_0x171013]={'$like':'%'+_0x23ea40[_0xc79d('0x30')][_0xc79d('0x3d')]+'%'};return _0x31062b;})});}_0x399c89=_[_0xc79d('0x3b')]({},_0x399c89,_0x23ea40[_0xc79d('0x3e')]);return _0x34cb5d[_0xc79d('0x61')](_0x399c89);}})[_0xc79d('0x25')](function(_0x6862b4){if(_0x6862b4){_0xf04f24=_0x6862b4[_0xc79d('0x34')];if(!_0x23ea40['query']['hasOwnProperty'](_0xc79d('0x57'))){_0x399c89[_0xc79d('0x1d')]=qs[_0xc79d('0x1d')](_0x23ea40['query'][_0xc79d('0x1d')]);_0x399c89[_0xc79d('0x1c')]=qs['offset'](_0x23ea40[_0xc79d('0x30')][_0xc79d('0x1c')]);}return _0x34cb5d[_0xc79d('0x61')](_0x399c89);}})['then'](function(_0x27c576){if(_0x27c576){return _0x27c576?{'count':_0xf04f24,'rows':_0x27c576}:null;}})[_0xc79d('0x25')](respondWithResult(_0x18a349,null))[_0xc79d('0x42')](handleError(_0x18a349,null));};exports['addLists']=function(_0x31aaae,_0x274009,_0x14ce67){var _0x968627,_0x11a90e;return db[_0xc79d('0x3f')][_0xc79d('0x45')]({'where':{'id':_0x31aaae[_0xc79d('0x43')]['id']}})['then'](handleEntityNotFound(_0x274009,null))[_0xc79d('0x25')](function(_0x273ec4){if(_0x273ec4){_0x11a90e=_0x273ec4;return _0x273ec4[_0xc79d('0x63')](_0x31aaae[_0xc79d('0x47')][_0xc79d('0x64')],_[_0xc79d('0x54')](_0x31aaae[_0xc79d('0x47')],[_0xc79d('0x64'),'id'])||{});}return null;})[_0xc79d('0x65')](function(_0x2a1197){var _0x32d1c6;_0x968627=_0x2a1197||[];var _0xec40c7=[];if(_0x2a1197){for(var _0x1dffd4=0x0;_0x1dffd4<_0x2a1197[_0xc79d('0x34')];_0x1dffd4+=0x1){var _0x35d613=_0x2a1197[_0x1dffd4][_0xc79d('0x49')]({'plain':!![]});_0x11a90e[_0xc79d('0x66')]=_0x31aaae[_0xc79d('0x47')][_0xc79d('0x66')]?_0x31aaae[_0xc79d('0x47')][_0xc79d('0x66')]:_0x11a90e['dialCheckDuplicateType'];switch(_0x11a90e[_0xc79d('0x66')]){case'always':_0x32d1c6=squel['insert']()[_0xc79d('0x67')]('cm_hopper')[_0xc79d('0x68')](['phone',_0xc79d('0x69'),'ContactId',_0xc79d('0x6a'),_0xc79d('0x58'),_0xc79d('0x52'),_0xc79d('0x53')],squel[_0xc79d('0x6b')]()[_0xc79d('0x6c')]('phone',_0xc79d('0x6d'))['field'](_0xc79d('0x6e'),'scheduledAt')[_0xc79d('0x6c')]('id',_0xc79d('0x6f'))['field'](_0x35d613[_0xc79d('0x70')][_0xc79d('0x71')](),'ListId')[_0xc79d('0x6c')](_0x31aaae['params']['id'][_0xc79d('0x71')](),'CampaignId')[_0xc79d('0x6c')](_0xc79d('0x6e'),_0xc79d('0x52'))[_0xc79d('0x6c')](_0xc79d('0x6e'),_0xc79d('0x53'))[_0xc79d('0x72')](_0xc79d('0x73'))[_0xc79d('0x3a')](_0xc79d('0x74'))['where'](_0xc79d('0x75'),_0x35d613[_0xc79d('0x70')][_0xc79d('0x71')]())[_0xc79d('0x3a')](_0xc79d('0x76'))[_0xc79d('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xc79d('0x6c')](_0xc79d('0x77'))[_0xc79d('0x72')](_0xc79d('0x78'))[_0xc79d('0x3a')]('CampaignId\x20=\x20?',_0x31aaae['params']['id'][_0xc79d('0x71')]()))[_0xc79d('0x3a')](_0xc79d('0x79'),squel[_0xc79d('0x6b')]()[_0xc79d('0x6c')](_0xc79d('0x7a'))[_0xc79d('0x72')]('cm_hopper')[_0xc79d('0x3a')](_0xc79d('0x7b'),_0x31aaae[_0xc79d('0x43')]['id'][_0xc79d('0x71')]())))['toString']();break;case'onlyIfOpen':_0x32d1c6=squel[_0xc79d('0x7c')]()[_0xc79d('0x67')](_0xc79d('0x7d'))[_0xc79d('0x68')]([_0xc79d('0x6d'),'scheduledAt',_0xc79d('0x6f'),_0xc79d('0x6a'),_0xc79d('0x58'),_0xc79d('0x52'),_0xc79d('0x53')],squel['select']()['field']('phone',_0xc79d('0x6d'))[_0xc79d('0x6c')](_0xc79d('0x6e'),_0xc79d('0x69'))[_0xc79d('0x6c')]('id',_0xc79d('0x6f'))[_0xc79d('0x6c')](_0x35d613[_0xc79d('0x70')][_0xc79d('0x71')](),_0xc79d('0x6a'))['field'](_0x31aaae[_0xc79d('0x43')]['id'][_0xc79d('0x71')](),'CampaignId')[_0xc79d('0x6c')]('NOW()','createdAt')[_0xc79d('0x6c')](_0xc79d('0x6e'),_0xc79d('0x53'))[_0xc79d('0x72')]('cm_contacts')[_0xc79d('0x3a')](_0xc79d('0x74'))[_0xc79d('0x3a')](_0xc79d('0x75'),_0x35d613[_0xc79d('0x70')][_0xc79d('0x71')]())['where'](_0xc79d('0x76'))['where'](_0xc79d('0x79'),squel['select']()['field']('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0xc79d('0x3a')](_0xc79d('0x7b'),_0x31aaae[_0xc79d('0x43')]['id'][_0xc79d('0x71')]())))[_0xc79d('0x71')]();break;default:_0x32d1c6=squel['insert']()[_0xc79d('0x67')](_0xc79d('0x7d'))[_0xc79d('0x68')]([_0xc79d('0x6d'),'scheduledAt','ContactId',_0xc79d('0x6a'),'CampaignId',_0xc79d('0x52'),_0xc79d('0x53')],squel[_0xc79d('0x6b')]()['field'](_0xc79d('0x6d'),_0xc79d('0x6d'))['field'](_0xc79d('0x6e'),_0xc79d('0x69'))[_0xc79d('0x6c')]('id',_0xc79d('0x6f'))[_0xc79d('0x6c')](_0x35d613[_0xc79d('0x70')][_0xc79d('0x71')](),'ListId')['field'](_0x31aaae[_0xc79d('0x43')]['id'][_0xc79d('0x71')](),_0xc79d('0x58'))['field']('NOW()',_0xc79d('0x52'))[_0xc79d('0x6c')](_0xc79d('0x6e'),_0xc79d('0x53'))[_0xc79d('0x72')](_0xc79d('0x73'))['where'](_0xc79d('0x74'))[_0xc79d('0x3a')]('ListId\x20=\x20?',_0x35d613[_0xc79d('0x70')]['toString']())['where'](_0xc79d('0x76')))['toString']();}_0xec40c7[_0xc79d('0x7e')](db[_0xc79d('0x7f')][_0xc79d('0x30')](_0x32d1c6));}return BPromise[_0xc79d('0x80')](_0xec40c7);}})[_0xc79d('0x25')](function(){return _0x968627;})['then'](respondWithResult(_0x274009,null))['catch'](handleError(_0x274009,null));};exports[_0xc79d('0x81')]=function(_0x30fc44,_0x4650d,_0x13af02){return db['Campaign'][_0xc79d('0x45')]({'where':{'id':_0x30fc44[_0xc79d('0x43')]['id']}})['then'](handleEntityNotFound(_0x4650d,null))['then'](function(_0x587b04){if(_0x587b04){return _0x587b04[_0xc79d('0x81')](_0x30fc44[_0xc79d('0x30')][_0xc79d('0x64')]);}})[_0xc79d('0x25')](function(_0x7cf18c){if(_0x7cf18c){return db[_0xc79d('0x59')][_0xc79d('0x55')]({'where':{'ListId':_0x30fc44[_0xc79d('0x30')][_0xc79d('0x64')],'CampaignId':_0x30fc44[_0xc79d('0x43')]['id']}})[_0xc79d('0x25')](function(){return _0x7cf18c;});}})['then'](respondWithStatusCode(_0x4650d,null))['catch'](handleError(_0x4650d,null));};exports['getBlackLists']=function(_0x103e89,_0x2e33b2,_0x79fc21){var _0x263795={};var _0x247843={};var _0x379b43;var _0x3733fa;return db[_0xc79d('0x3f')][_0xc79d('0x56')]({'where':{'id':_0x103e89[_0xc79d('0x43')]['id']}})[_0xc79d('0x25')](handleEntityNotFound(_0x2e33b2,null))['then'](function(_0x5d3466){if(_0x5d3466){_0x379b43=_0x5d3466;_0x247843['model']=_[_0xc79d('0x44')](db[_0xc79d('0x62')]['rawAttributes']);_0x247843[_0xc79d('0x30')]=_[_0xc79d('0x44')](_0x103e89[_0xc79d('0x30')]);_0x247843['filters']=_[_0xc79d('0x31')](_0x247843[_0xc79d('0x2f')],_0x247843[_0xc79d('0x30')]);_0x263795['attributes']=_[_0xc79d('0x31')](_0x247843[_0xc79d('0x2f')],qs[_0xc79d('0x33')](_0x103e89[_0xc79d('0x30')][_0xc79d('0x33')]));_0x263795[_0xc79d('0x32')]=_0x263795[_0xc79d('0x32')][_0xc79d('0x34')]?_0x263795[_0xc79d('0x32')]:_0x247843['model'];_0x263795['order']=qs['sort'](_0x103e89[_0xc79d('0x30')][_0xc79d('0x37')]);_0x263795[_0xc79d('0x3a')]=qs['filters'](_['pick'](_0x103e89[_0xc79d('0x30')],_0x247843[_0xc79d('0x39')]));if(_0x103e89[_0xc79d('0x30')][_0xc79d('0x3d')]){_0x263795['where']=_[_0xc79d('0x3b')](_0x263795['where'],{'$or':_[_0xc79d('0x2c')](_0x263795[_0xc79d('0x32')],function(_0x1189ac){var _0x54a7c2={};_0x54a7c2[_0x1189ac]={'$like':'%'+_0x103e89[_0xc79d('0x30')]['filter']+'%'};return _0x54a7c2;})});}_0x263795=_[_0xc79d('0x3b')]({},_0x263795,_0x103e89['options']);return _0x379b43[_0xc79d('0x82')](_0x263795);}})['then'](function(_0x39268a){if(_0x39268a){_0x3733fa=_0x39268a['length'];if(!_0x103e89[_0xc79d('0x30')]['hasOwnProperty']('nolimit')){_0x263795[_0xc79d('0x1d')]=qs[_0xc79d('0x1d')](_0x103e89[_0xc79d('0x30')][_0xc79d('0x1d')]);_0x263795[_0xc79d('0x1c')]=qs['offset'](_0x103e89['query']['offset']);}return _0x379b43['getBlackLists'](_0x263795);}})[_0xc79d('0x25')](function(_0x13a0c3){if(_0x13a0c3){return _0x13a0c3?{'count':_0x3733fa,'rows':_0x13a0c3}:null;}})['then'](respondWithResult(_0x2e33b2,null))['catch'](handleError(_0x2e33b2,null));};exports[_0xc79d('0x83')]=function(_0x298266,_0x1d1b0d,_0x1915fd){var _0x5532c3,_0x17acb6;return db[_0xc79d('0x3f')][_0xc79d('0x45')]({'where':{'id':_0x298266['params']['id']}})[_0xc79d('0x25')](handleEntityNotFound(_0x1d1b0d,null))[_0xc79d('0x25')](function(_0x5913cb){if(_0x5913cb){_0x17acb6=_0x5913cb;return _0x5913cb[_0xc79d('0x83')](_0x298266['body'][_0xc79d('0x64')],_[_0xc79d('0x54')](_0x298266[_0xc79d('0x47')],[_0xc79d('0x64'),'id'])||{});}return null;})[_0xc79d('0x65')](function(_0x2b8153){var _0x3f931b;_0x5532c3=_0x2b8153||[];var _0x5c0465=[];if(_0x2b8153){for(var _0x4fec57=0x0;_0x4fec57<_0x2b8153[_0xc79d('0x34')];_0x4fec57+=0x1){var _0x1fad75=_0x2b8153[_0x4fec57][_0xc79d('0x49')]({'plain':!![]});_0x3f931b=squel['insert']()['into'](_0xc79d('0x84'))['fromQuery']([_0xc79d('0x6d'),'ContactId',_0xc79d('0x6a'),_0xc79d('0x58'),_0xc79d('0x52'),_0xc79d('0x53')],squel[_0xc79d('0x6b')]()['field'](_0xc79d('0x6d'),_0xc79d('0x6d'))[_0xc79d('0x6c')]('id',_0xc79d('0x6f'))['field'](_0x1fad75[_0xc79d('0x70')]['toString'](),_0xc79d('0x6a'))['field'](_0x298266[_0xc79d('0x43')]['id'][_0xc79d('0x71')](),_0xc79d('0x58'))[_0xc79d('0x6c')](_0xc79d('0x6e'),'createdAt')[_0xc79d('0x6c')]('NOW()',_0xc79d('0x53'))['from'](_0xc79d('0x73'))[_0xc79d('0x3a')](_0xc79d('0x74'))[_0xc79d('0x3a')]('ListId\x20=\x20?',_0x1fad75[_0xc79d('0x70')]['toString']())[_0xc79d('0x3a')](_0xc79d('0x76')))[_0xc79d('0x71')]();_0x5c0465['push'](db[_0xc79d('0x7f')][_0xc79d('0x30')](_0x3f931b));}return BPromise[_0xc79d('0x80')](_0x5c0465);}})[_0xc79d('0x25')](function(){return _0x5532c3;})[_0xc79d('0x25')](respondWithResult(_0x1d1b0d,null))[_0xc79d('0x42')](handleError(_0x1d1b0d,null));};exports[_0xc79d('0x85')]=function(_0x24dc15,_0x5729b5,_0x30dd05){return db[_0xc79d('0x3f')][_0xc79d('0x45')]({'where':{'id':_0x24dc15[_0xc79d('0x43')]['id']}})['then'](handleEntityNotFound(_0x5729b5,null))[_0xc79d('0x25')](function(_0x1fe8af){if(_0x1fe8af){return _0x1fe8af[_0xc79d('0x85')](_0x24dc15[_0xc79d('0x30')][_0xc79d('0x64')]);}})['then'](function(_0x430902){if(_0x430902){return db[_0xc79d('0x60')]['destroy']({'where':{'ListId':_0x24dc15[_0xc79d('0x30')][_0xc79d('0x64')],'CampaignId':_0x24dc15[_0xc79d('0x43')]['id']}})[_0xc79d('0x25')](function(){return _0x430902;});}})['then'](respondWithStatusCode(_0x5729b5,null))['catch'](handleError(_0x5729b5,null));};
\ No newline at end of file
+var _0x264c=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','Campaign','includeAll','findAll','rows','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','find','userProfileId','autoAssociation','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','nolimit','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','into','deletedAt\x20IS\x20NULL','push','all','removeLists','getBlackLists','CmList','addBlackLists','omit','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x4c86a1,_0x4ff656){var _0x81ea80=function(_0x31857b){while(--_0x31857b){_0x4c86a1['push'](_0x4c86a1['shift']());}};_0x81ea80(++_0x4ff656);}(_0x264c,0x81));var _0xc264=function(_0x35f7f5,_0x4e2ee1){_0x35f7f5=_0x35f7f5-0x0;var _0x5567a4=_0x264c[_0x35f7f5];return _0x5567a4;};'use strict';var emlformat=require(_0xc264('0x0'));var rimraf=require(_0xc264('0x1'));var zipdir=require(_0xc264('0x2'));var jsonpatch=require(_0xc264('0x3'));var rp=require(_0xc264('0x4'));var moment=require(_0xc264('0x5'));var BPromise=require(_0xc264('0x6'));var Mustache=require(_0xc264('0x7'));var util=require(_0xc264('0x8'));var path=require(_0xc264('0x9'));var sox=require(_0xc264('0xa'));var csv=require(_0xc264('0xb'));var ejs=require(_0xc264('0xc'));var fs=require('fs');var fs_extra=require(_0xc264('0xd'));var _=require(_0xc264('0xe'));var squel=require(_0xc264('0xf'));var crypto=require(_0xc264('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc264('0x11'));var Papa=require(_0xc264('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc264('0x13'));var as=require(_0xc264('0x14'));var hardwareService=require(_0xc264('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc264('0x16'));var licenseUtil=require(_0xc264('0x17'));var db=require(_0xc264('0x18'))['db'];function respondWithStatusCode(_0x100d3b,_0x406fb6){_0x406fb6=_0x406fb6||0xcc;return function(_0x59dd00){if(_0x59dd00){return _0x100d3b[_0xc264('0x19')](_0x406fb6);}return _0x100d3b[_0xc264('0x1a')](_0x406fb6)[_0xc264('0x1b')]();};}function respondWithResult(_0x4d7f84,_0x5393e1){_0x5393e1=_0x5393e1||0xc8;return function(_0x4beb37){if(_0x4beb37){return _0x4d7f84[_0xc264('0x1a')](_0x5393e1)['json'](_0x4beb37);}};}function respondWithFilteredResult(_0x10bffa,_0x19fed0){return function(_0xb2777e){if(_0xb2777e){var _0x338839=typeof _0x19fed0[_0xc264('0x1c')]===_0xc264('0x1d')&&typeof _0x19fed0[_0xc264('0x1e')]===_0xc264('0x1d');var _0x4e0207=_0xb2777e[_0xc264('0x1f')];var _0x162a14=_0x338839?0x0:_0x19fed0['offset'];var _0xd1bd73=_0x338839?_0xb2777e[_0xc264('0x1f')]:_0x19fed0[_0xc264('0x1c')]+_0x19fed0[_0xc264('0x1e')];var _0x1174e8;if(_0xd1bd73>=_0x4e0207){_0xd1bd73=_0x4e0207;_0x1174e8=0xc8;}else{_0x1174e8=0xce;}_0x10bffa[_0xc264('0x1a')](_0x1174e8);return _0x10bffa['set'](_0xc264('0x20'),_0x162a14+'-'+_0xd1bd73+'/'+_0x4e0207)[_0xc264('0x21')](_0xb2777e);}return null;};}function patchUpdates(_0x51689e){return function(_0x7441f5){try{jsonpatch[_0xc264('0x22')](_0x7441f5,_0x51689e,!![]);}catch(_0x2c71fa){return BPromise[_0xc264('0x23')](_0x2c71fa);}return _0x7441f5[_0xc264('0x24')]();};}function saveUpdates(_0x2d4b58,_0x275bc7){return function(_0xbce538){if(_0xbce538){return _0xbce538[_0xc264('0x25')](_0x2d4b58)[_0xc264('0x26')](function(_0x44246c){return _0x44246c;});}return null;};}function removeEntity(_0x4b1149,_0x526bce){return function(_0x5aa29f){if(_0x5aa29f){return _0x5aa29f['destroy']()[_0xc264('0x26')](function(){var _0x5ebb19=_0x5aa29f[_0xc264('0x27')]({'plain':!![]});var _0x240ad2=_0xc264('0x28');return db[_0xc264('0x29')][_0xc264('0x2a')]({'where':{'type':_0x240ad2,'resourceId':_0x5ebb19['id']}})[_0xc264('0x26')](function(){return _0x5aa29f;});})[_0xc264('0x26')](function(){_0x4b1149[_0xc264('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16c598,_0x3ab31b){return function(_0x3be8c9){if(!_0x3be8c9){_0x16c598[_0xc264('0x19')](0x194);}return _0x3be8c9;};}function handleError(_0x543081,_0x55a8c7){_0x55a8c7=_0x55a8c7||0x1f4;return function(_0x19a214){logger[_0xc264('0x2b')](_0x19a214[_0xc264('0x2c')]);if(_0x19a214['name']){delete _0x19a214[_0xc264('0x2d')];}_0x543081[_0xc264('0x1a')](_0x55a8c7)[_0xc264('0x2e')](_0x19a214);};}exports[_0xc264('0x2f')]=function(_0x2360c7,_0x2f8de9){var _0x3c99bd={},_0x4e72ff={},_0x1ef11a={'count':0x0,'rows':[]};var _0x14b8cf=_['map'](db['Campaign'][_0xc264('0x30')],function(_0x421143){return{'name':_0x421143[_0xc264('0x31')],'type':_0x421143[_0xc264('0x32')]['key']};});_0x4e72ff['model']=_[_0xc264('0x33')](_0x14b8cf,_0xc264('0x2d'));_0x4e72ff[_0xc264('0x34')]=_[_0xc264('0x35')](_0x2360c7['query']);_0x4e72ff[_0xc264('0x36')]=_[_0xc264('0x37')](_0x4e72ff['model'],_0x4e72ff[_0xc264('0x34')]);_0x3c99bd[_0xc264('0x38')]=_['intersection'](_0x4e72ff[_0xc264('0x39')],qs[_0xc264('0x3a')](_0x2360c7[_0xc264('0x34')][_0xc264('0x3a')]));_0x3c99bd[_0xc264('0x38')]=_0x3c99bd[_0xc264('0x38')][_0xc264('0x3b')]?_0x3c99bd[_0xc264('0x38')]:_0x4e72ff[_0xc264('0x39')];if(!_0x2360c7['query'][_0xc264('0x3c')]('nolimit')){_0x3c99bd[_0xc264('0x1e')]=qs['limit'](_0x2360c7[_0xc264('0x34')][_0xc264('0x1e')]);_0x3c99bd['offset']=qs[_0xc264('0x1c')](_0x2360c7[_0xc264('0x34')][_0xc264('0x1c')]);}_0x3c99bd[_0xc264('0x3d')]=qs[_0xc264('0x3e')](_0x2360c7[_0xc264('0x34')][_0xc264('0x3e')]);_0x3c99bd[_0xc264('0x3f')]=qs[_0xc264('0x36')](_[_0xc264('0x40')](_0x2360c7['query'],_0x4e72ff['filters']),_0x14b8cf);if(_0x2360c7['query']['filter']){_0x3c99bd[_0xc264('0x3f')]=_[_0xc264('0x41')](_0x3c99bd['where'],{'$or':_[_0xc264('0x33')](_0x14b8cf,function(_0x203cb4){if(_0x203cb4[_0xc264('0x32')]!==_0xc264('0x42')){var _0x3ce790={};_0x3ce790[_0x203cb4[_0xc264('0x2d')]]={'$like':'%'+_0x2360c7[_0xc264('0x34')][_0xc264('0x43')]+'%'};return _0x3ce790;}})});}_0x3c99bd=_[_0xc264('0x41')]({},_0x3c99bd,_0x2360c7[_0xc264('0x44')]);var _0x599ea6={'where':_0x3c99bd[_0xc264('0x3f')]};return db[_0xc264('0x45')][_0xc264('0x1f')](_0x599ea6)[_0xc264('0x26')](function(_0x422a6d){_0x1ef11a['count']=_0x422a6d;if(_0x2360c7[_0xc264('0x34')][_0xc264('0x46')]){_0x3c99bd['include']=[{'all':!![]}];}return db[_0xc264('0x45')][_0xc264('0x47')](_0x3c99bd);})[_0xc264('0x26')](function(_0x1f82cc){_0x1ef11a[_0xc264('0x48')]=_0x1f82cc;return _0x1ef11a;})[_0xc264('0x26')](respondWithFilteredResult(_0x2f8de9,_0x3c99bd))[_0xc264('0x49')](handleError(_0x2f8de9,null));};exports[_0xc264('0x4a')]=function(_0x47bff1,_0x460aa2){var _0x3afc8b={'raw':![],'where':{'id':_0x47bff1[_0xc264('0x4b')]['id']}},_0x21ae2f={};_0x21ae2f[_0xc264('0x39')]=_[_0xc264('0x35')](db[_0xc264('0x45')][_0xc264('0x30')]);_0x21ae2f[_0xc264('0x34')]=_[_0xc264('0x35')](_0x47bff1[_0xc264('0x34')]);_0x21ae2f[_0xc264('0x36')]=_['intersection'](_0x21ae2f[_0xc264('0x39')],_0x21ae2f[_0xc264('0x34')]);_0x3afc8b[_0xc264('0x38')]=_[_0xc264('0x37')](_0x21ae2f['model'],qs[_0xc264('0x3a')](_0x47bff1[_0xc264('0x34')][_0xc264('0x3a')]));_0x3afc8b[_0xc264('0x38')]=_0x3afc8b[_0xc264('0x38')][_0xc264('0x3b')]?_0x3afc8b[_0xc264('0x38')]:_0x21ae2f['model'];if(_0x47bff1[_0xc264('0x34')][_0xc264('0x46')]){_0x3afc8b[_0xc264('0x4c')]=[{'all':!![]}];}_0x3afc8b=_['merge']({},_0x3afc8b,_0x47bff1[_0xc264('0x44')]);return db[_0xc264('0x45')]['find'](_0x3afc8b)[_0xc264('0x26')](handleEntityNotFound(_0x460aa2,null))[_0xc264('0x26')](respondWithResult(_0x460aa2,null))[_0xc264('0x49')](handleError(_0x460aa2,null));};exports[_0xc264('0x4d')]=function(_0x57f7cd,_0x187994){return db[_0xc264('0x45')][_0xc264('0x4d')](_0x57f7cd[_0xc264('0x4e')],{})[_0xc264('0x26')](function(_0x3d3e96){var _0x550166=_0x57f7cd[_0xc264('0x4f')][_0xc264('0x27')]({'plain':!![]});if(!_0x550166)throw new Error(_0xc264('0x50'));if(_0x550166[_0xc264('0x51')]===_0xc264('0x4f')){var _0x398056=_0x3d3e96['get']({'plain':!![]});var _0x355ddb=_0xc264('0x28');return db[_0xc264('0x52')]['find']({'where':{'name':_0x355ddb,'userProfileId':_0x550166['userProfileId']},'raw':!![]})[_0xc264('0x26')](function(_0x3e061a){if(_0x3e061a&&_0x3e061a['autoAssociation']===0x0){return db[_0xc264('0x29')][_0xc264('0x4d')]({'name':_0x398056[_0xc264('0x2d')],'resourceId':_0x398056['id'],'type':_0x3e061a['name'],'sectionId':_0x3e061a['id']},{})[_0xc264('0x26')](function(){return _0x3d3e96;});}else{return _0x3d3e96;}})['catch'](function(_0x5ee2c4){logger[_0xc264('0x2b')](_0xc264('0x53'),_0x5ee2c4);throw _0x5ee2c4;});}return _0x3d3e96;})[_0xc264('0x26')](respondWithResult(_0x187994,0xc9))['catch'](handleError(_0x187994,null));};exports[_0xc264('0x54')]=function(_0x2acd42,_0x756528){var _0x541355={'where':{'id':_0x2acd42['params']['id']}},_0x359d2={};_0x359d2['model']=_[_0xc264('0x35')](db[_0xc264('0x45')][_0xc264('0x30')]);_0x541355[_0xc264('0x38')]=_[_0xc264('0x37')](_0x359d2[_0xc264('0x39')],qs[_0xc264('0x3a')](_0x2acd42[_0xc264('0x34')][_0xc264('0x3a')]));_0x541355[_0xc264('0x38')]=_0x541355[_0xc264('0x38')][_0xc264('0x3b')]?_0x541355[_0xc264('0x38')]:_0x359d2[_0xc264('0x39')];if(_0x2acd42[_0xc264('0x34')]['includeAll']){_0x541355[_0xc264('0x4c')]=[{'all':!![]}];}_0x541355=_[_0xc264('0x41')]({},_0x541355,_0x2acd42[_0xc264('0x44')]);return db['Campaign']['find'](_0x541355)['then'](handleEntityNotFound(_0x756528,null))[_0xc264('0x26')](function(_0x43d2bc){if(_0x43d2bc){var _0x3caeef=_0x43d2bc[_0xc264('0x27')]({'plain':!![]});_0x3caeef=qs['omit'](_0x3caeef,['id',_0xc264('0x55'),_0xc264('0x56')]);_0x2acd42[_0xc264('0x4e')]=_['omit'](_0x2acd42[_0xc264('0x4e')],['id',_0xc264('0x55'),'updatedAt']);return db[_0xc264('0x45')]['create'](_[_0xc264('0x41')](_0x3caeef,_0x2acd42[_0xc264('0x4e')]),{'include':_0x2acd42['query'][_0xc264('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x218502){var _0x3928cf=_0x2acd42[_0xc264('0x4f')][_0xc264('0x27')]({'plain':!![]});if(!_0x3928cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3928cf[_0xc264('0x51')]==='user'){var _0x1291e0=_0x218502[_0xc264('0x27')]({'plain':!![]});var _0x3ebb2a='IvrCampaigns';return db[_0xc264('0x52')][_0xc264('0x57')]({'where':{'name':_0x3ebb2a,'userProfileId':_0x3928cf[_0xc264('0x58')]},'raw':!![]})['then'](function(_0x1c815c){if(_0x1c815c&&_0x1c815c[_0xc264('0x59')]===0x0){return db[_0xc264('0x29')]['create']({'name':_0x1291e0[_0xc264('0x2d')],'resourceId':_0x1291e0['id'],'type':_0x1c815c[_0xc264('0x2d')],'sectionId':_0x1c815c['id']},{})[_0xc264('0x26')](function(){return _0x218502;});}else{return _0x218502;}})[_0xc264('0x49')](function(_0x510602){logger[_0xc264('0x2b')](_0xc264('0x53'),_0x510602);throw _0x510602;});}return _0x218502;});}})[_0xc264('0x26')](respondWithResult(_0x756528,0xc9))['catch'](handleError(_0x756528,null));};exports[_0xc264('0x25')]=function(_0x47f49c,_0x42c123){if(_0x47f49c['body']['id']){delete _0x47f49c[_0xc264('0x4e')]['id'];}return db[_0xc264('0x45')][_0xc264('0x57')]({'where':{'id':_0x47f49c['params']['id']}})[_0xc264('0x26')](handleEntityNotFound(_0x42c123,null))[_0xc264('0x26')](saveUpdates(_0x47f49c[_0xc264('0x4e')],null))[_0xc264('0x26')](respondWithResult(_0x42c123,null))['catch'](handleError(_0x42c123,null));};exports[_0xc264('0x2a')]=function(_0x209656,_0x540e19){return db[_0xc264('0x45')][_0xc264('0x57')]({'where':{'id':_0x209656[_0xc264('0x4b')]['id']}})[_0xc264('0x26')](handleEntityNotFound(_0x540e19,null))[_0xc264('0x26')](removeEntity(_0x540e19,null))[_0xc264('0x49')](handleError(_0x540e19,null));};exports[_0xc264('0x5a')]=function(_0x2c251d,_0x5d07ea,_0x3fd31e){var _0x51a9d2={'raw':!![],'where':{}};var _0x30438e={};var _0x2490c3={'count':0x0,'rows':[]};return db[_0xc264('0x45')][_0xc264('0x5b')]({'where':{'id':_0x2c251d['params']['id']}})[_0xc264('0x26')](handleEntityNotFound(_0x5d07ea,null))[_0xc264('0x26')](function(_0x455ffe){if(_0x455ffe){_0x30438e[_0xc264('0x39')]=_['keys'](db[_0xc264('0x5c')]['rawAttributes']);_0x30438e[_0xc264('0x34')]=_[_0xc264('0x35')](_0x2c251d['query']);_0x30438e[_0xc264('0x36')]=_['intersection'](_0x30438e[_0xc264('0x39')],_0x30438e[_0xc264('0x34')]);_0x51a9d2[_0xc264('0x38')]=_['intersection'](_0x30438e[_0xc264('0x39')],qs[_0xc264('0x3a')](_0x2c251d[_0xc264('0x34')][_0xc264('0x3a')]));_0x51a9d2['attributes']=_0x51a9d2[_0xc264('0x38')][_0xc264('0x3b')]?_0x51a9d2[_0xc264('0x38')]:_0x30438e[_0xc264('0x39')];if(!_0x2c251d[_0xc264('0x34')]['hasOwnProperty']('nolimit')){_0x51a9d2[_0xc264('0x1e')]=qs[_0xc264('0x1e')](_0x2c251d[_0xc264('0x34')][_0xc264('0x1e')]);_0x51a9d2[_0xc264('0x1c')]=qs[_0xc264('0x1c')](_0x2c251d[_0xc264('0x34')][_0xc264('0x1c')]);}_0x51a9d2[_0xc264('0x3d')]=qs[_0xc264('0x3e')](_0x2c251d[_0xc264('0x34')][_0xc264('0x3e')]);_0x51a9d2[_0xc264('0x3f')]=qs[_0xc264('0x36')](_['pick'](_0x2c251d['query'],_0x30438e[_0xc264('0x36')]));_0x51a9d2[_0xc264('0x3f')]['CampaignId']=_0x455ffe['id'];if(_0x2c251d[_0xc264('0x34')][_0xc264('0x43')]){_0x51a9d2[_0xc264('0x3f')]=_[_0xc264('0x41')](_0x51a9d2[_0xc264('0x3f')],{'$or':_[_0xc264('0x33')](_0x51a9d2['attributes'],function(_0x40c383){var _0x4481c9={};_0x4481c9[_0x40c383]={'$like':'%'+_0x2c251d[_0xc264('0x34')][_0xc264('0x43')]+'%'};return _0x4481c9;})});}_0x51a9d2=_[_0xc264('0x41')]({},_0x51a9d2,_0x2c251d[_0xc264('0x44')]);return db[_0xc264('0x5c')][_0xc264('0x1f')]({'where':_0x51a9d2[_0xc264('0x3f')]})[_0xc264('0x26')](function(_0x587fcc){_0x2490c3[_0xc264('0x1f')]=_0x587fcc;if(_0x2c251d[_0xc264('0x34')][_0xc264('0x46')]){_0x51a9d2[_0xc264('0x4c')]=[{'all':!![]}];}return db[_0xc264('0x5c')][_0xc264('0x47')](_0x51a9d2);})[_0xc264('0x26')](function(_0x3de8af){_0x2490c3[_0xc264('0x48')]=_0x3de8af;return _0x2490c3;});}})[_0xc264('0x26')](respondWithFilteredResult(_0x5d07ea,_0x51a9d2))[_0xc264('0x49')](handleError(_0x5d07ea,null));};exports[_0xc264('0x5d')]=function(_0x3de360,_0x585abe,_0x26f4d5){var _0x298c49={'raw':!![],'where':{}};var _0x86379e={};var _0x141cb0={'count':0x0,'rows':[]};return db['Campaign'][_0xc264('0x5b')]({'where':{'id':_0x3de360[_0xc264('0x4b')]['id']}})['then'](handleEntityNotFound(_0x585abe,null))[_0xc264('0x26')](function(_0x324302){if(_0x324302){_0x86379e[_0xc264('0x39')]=_[_0xc264('0x35')](db[_0xc264('0x5e')]['rawAttributes']);_0x86379e[_0xc264('0x34')]=_[_0xc264('0x35')](_0x3de360[_0xc264('0x34')]);_0x86379e['filters']=_[_0xc264('0x37')](_0x86379e['model'],_0x86379e[_0xc264('0x34')]);_0x298c49[_0xc264('0x38')]=_[_0xc264('0x37')](_0x86379e[_0xc264('0x39')],qs[_0xc264('0x3a')](_0x3de360[_0xc264('0x34')][_0xc264('0x3a')]));_0x298c49[_0xc264('0x38')]=_0x298c49[_0xc264('0x38')][_0xc264('0x3b')]?_0x298c49['attributes']:_0x86379e[_0xc264('0x39')];if(!_0x3de360[_0xc264('0x34')][_0xc264('0x3c')](_0xc264('0x5f'))){_0x298c49[_0xc264('0x1e')]=qs['limit'](_0x3de360[_0xc264('0x34')][_0xc264('0x1e')]);_0x298c49[_0xc264('0x1c')]=qs[_0xc264('0x1c')](_0x3de360[_0xc264('0x34')][_0xc264('0x1c')]);}_0x298c49['order']=qs[_0xc264('0x3e')](_0x3de360[_0xc264('0x34')]['sort']);_0x298c49['where']=qs[_0xc264('0x36')](_[_0xc264('0x40')](_0x3de360[_0xc264('0x34')],_0x86379e['filters']));_0x298c49[_0xc264('0x3f')][_0xc264('0x60')]=_0x324302['id'];if(_0x3de360['query'][_0xc264('0x43')]){_0x298c49[_0xc264('0x3f')]=_[_0xc264('0x41')](_0x298c49['where'],{'$or':_[_0xc264('0x33')](_0x298c49[_0xc264('0x38')],function(_0x8f490a){var _0x290869={};_0x290869[_0x8f490a]={'$like':'%'+_0x3de360['query'][_0xc264('0x43')]+'%'};return _0x290869;})});}_0x298c49=_[_0xc264('0x41')]({},_0x298c49,_0x3de360[_0xc264('0x44')]);return db['CmHopperHistory'][_0xc264('0x1f')]({'where':_0x298c49[_0xc264('0x3f')]})[_0xc264('0x26')](function(_0x4e9d4a){_0x141cb0[_0xc264('0x1f')]=_0x4e9d4a;if(_0x3de360[_0xc264('0x34')][_0xc264('0x46')]){_0x298c49[_0xc264('0x4c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xc264('0x47')](_0x298c49);})['then'](function(_0x3d88ff){_0x141cb0[_0xc264('0x48')]=_0x3d88ff;return _0x141cb0;});}})[_0xc264('0x26')](respondWithFilteredResult(_0x585abe,_0x298c49))[_0xc264('0x49')](handleError(_0x585abe,null));};exports[_0xc264('0x61')]=function(_0x2e6b66,_0x375d85,_0x470ebd){var _0x2edf9a={'raw':!![],'where':{}};var _0x319a7f={};var _0x259f6f={'count':0x0,'rows':[]};return db[_0xc264('0x45')]['findOne']({'where':{'id':_0x2e6b66[_0xc264('0x4b')]['id']}})[_0xc264('0x26')](handleEntityNotFound(_0x375d85,null))[_0xc264('0x26')](function(_0x432051){if(_0x432051){_0x319a7f[_0xc264('0x39')]=_[_0xc264('0x35')](db['CmHopperFinal'][_0xc264('0x30')]);_0x319a7f[_0xc264('0x34')]=_[_0xc264('0x35')](_0x2e6b66[_0xc264('0x34')]);_0x319a7f[_0xc264('0x36')]=_[_0xc264('0x37')](_0x319a7f[_0xc264('0x39')],_0x319a7f[_0xc264('0x34')]);_0x2edf9a[_0xc264('0x38')]=_[_0xc264('0x37')](_0x319a7f[_0xc264('0x39')],qs['fields'](_0x2e6b66[_0xc264('0x34')][_0xc264('0x3a')]));_0x2edf9a[_0xc264('0x38')]=_0x2edf9a[_0xc264('0x38')][_0xc264('0x3b')]?_0x2edf9a[_0xc264('0x38')]:_0x319a7f['model'];if(!_0x2e6b66[_0xc264('0x34')]['hasOwnProperty'](_0xc264('0x5f'))){_0x2edf9a['limit']=qs[_0xc264('0x1e')](_0x2e6b66[_0xc264('0x34')][_0xc264('0x1e')]);_0x2edf9a[_0xc264('0x1c')]=qs[_0xc264('0x1c')](_0x2e6b66['query']['offset']);}_0x2edf9a[_0xc264('0x3d')]=qs[_0xc264('0x3e')](_0x2e6b66[_0xc264('0x34')][_0xc264('0x3e')]);_0x2edf9a[_0xc264('0x3f')]=qs[_0xc264('0x36')](_['pick'](_0x2e6b66[_0xc264('0x34')],_0x319a7f[_0xc264('0x36')]));_0x2edf9a['where'][_0xc264('0x60')]=_0x432051['id'];if(_0x2e6b66[_0xc264('0x34')]['filter']){_0x2edf9a[_0xc264('0x3f')]=_['merge'](_0x2edf9a[_0xc264('0x3f')],{'$or':_[_0xc264('0x33')](_0x2edf9a[_0xc264('0x38')],function(_0x1d2f09){var _0x7aba75={};_0x7aba75[_0x1d2f09]={'$like':'%'+_0x2e6b66['query']['filter']+'%'};return _0x7aba75;})});}_0x2edf9a=_[_0xc264('0x41')]({},_0x2edf9a,_0x2e6b66[_0xc264('0x44')]);return db[_0xc264('0x62')][_0xc264('0x1f')]({'where':_0x2edf9a[_0xc264('0x3f')]})[_0xc264('0x26')](function(_0x4e4995){_0x259f6f[_0xc264('0x1f')]=_0x4e4995;if(_0x2e6b66[_0xc264('0x34')][_0xc264('0x46')]){_0x2edf9a[_0xc264('0x4c')]=[{'all':!![]}];}return db[_0xc264('0x62')][_0xc264('0x47')](_0x2edf9a);})[_0xc264('0x26')](function(_0x5d45a0){_0x259f6f[_0xc264('0x48')]=_0x5d45a0;return _0x259f6f;});}})[_0xc264('0x26')](respondWithFilteredResult(_0x375d85,_0x2edf9a))['catch'](handleError(_0x375d85,null));};exports[_0xc264('0x63')]=function(_0x2d030b,_0x3a6d05,_0x34ee0c){var _0x9c8868={'raw':!![],'where':{}};var _0x274383={};var _0xd4eec3={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x2d030b[_0xc264('0x4b')]['id']}})[_0xc264('0x26')](handleEntityNotFound(_0x3a6d05,null))[_0xc264('0x26')](function(_0x295457){if(_0x295457){_0x274383[_0xc264('0x39')]=_[_0xc264('0x35')](db['CmHopperBlack'][_0xc264('0x30')]);_0x274383[_0xc264('0x34')]=_[_0xc264('0x35')](_0x2d030b[_0xc264('0x34')]);_0x274383[_0xc264('0x36')]=_[_0xc264('0x37')](_0x274383[_0xc264('0x39')],_0x274383[_0xc264('0x34')]);_0x9c8868[_0xc264('0x38')]=_['intersection'](_0x274383[_0xc264('0x39')],qs[_0xc264('0x3a')](_0x2d030b[_0xc264('0x34')][_0xc264('0x3a')]));_0x9c8868['attributes']=_0x9c8868['attributes'][_0xc264('0x3b')]?_0x9c8868[_0xc264('0x38')]:_0x274383[_0xc264('0x39')];if(!_0x2d030b[_0xc264('0x34')]['hasOwnProperty'](_0xc264('0x5f'))){_0x9c8868[_0xc264('0x1e')]=qs[_0xc264('0x1e')](_0x2d030b[_0xc264('0x34')]['limit']);_0x9c8868[_0xc264('0x1c')]=qs[_0xc264('0x1c')](_0x2d030b['query'][_0xc264('0x1c')]);}_0x9c8868[_0xc264('0x3d')]=qs[_0xc264('0x3e')](_0x2d030b[_0xc264('0x34')]['sort']);_0x9c8868[_0xc264('0x3f')]=qs[_0xc264('0x36')](_[_0xc264('0x40')](_0x2d030b['query'],_0x274383[_0xc264('0x36')]));_0x9c8868['where'][_0xc264('0x60')]=_0x295457['id'];if(_0x2d030b[_0xc264('0x34')][_0xc264('0x43')]){_0x9c8868[_0xc264('0x3f')]=_[_0xc264('0x41')](_0x9c8868[_0xc264('0x3f')],{'$or':_[_0xc264('0x33')](_0x9c8868[_0xc264('0x38')],function(_0x3f015d){var _0x595a27={};_0x595a27[_0x3f015d]={'$like':'%'+_0x2d030b[_0xc264('0x34')]['filter']+'%'};return _0x595a27;})});}_0x9c8868=_[_0xc264('0x41')]({},_0x9c8868,_0x2d030b[_0xc264('0x44')]);return db[_0xc264('0x64')][_0xc264('0x1f')]({'where':_0x9c8868[_0xc264('0x3f')]})[_0xc264('0x26')](function(_0x354220){_0xd4eec3['count']=_0x354220;if(_0x2d030b['query'][_0xc264('0x46')]){_0x9c8868[_0xc264('0x4c')]=[{'all':!![]}];}return db[_0xc264('0x64')]['findAll'](_0x9c8868);})[_0xc264('0x26')](function(_0xfbe525){_0xd4eec3['rows']=_0xfbe525;return _0xd4eec3;});}})[_0xc264('0x26')](respondWithFilteredResult(_0x3a6d05,_0x9c8868))[_0xc264('0x49')](handleError(_0x3a6d05,null));};exports[_0xc264('0x65')]=function(_0x369513,_0x4d8f9a,_0x4944d0){var _0x30150e={};var _0x14db5b={};var _0x4bb12d;var _0x82ebb2;return db[_0xc264('0x45')]['findOne']({'where':{'id':_0x369513[_0xc264('0x4b')]['id']}})[_0xc264('0x26')](handleEntityNotFound(_0x4d8f9a,null))['then'](function(_0x1c162a){if(_0x1c162a){_0x4bb12d=_0x1c162a;_0x14db5b['model']=_[_0xc264('0x35')](db['CmList'][_0xc264('0x30')]);_0x14db5b[_0xc264('0x34')]=_[_0xc264('0x35')](_0x369513[_0xc264('0x34')]);_0x14db5b[_0xc264('0x36')]=_[_0xc264('0x37')](_0x14db5b[_0xc264('0x39')],_0x14db5b[_0xc264('0x34')]);_0x30150e[_0xc264('0x38')]=_['intersection'](_0x14db5b[_0xc264('0x39')],qs['fields'](_0x369513[_0xc264('0x34')][_0xc264('0x3a')]));_0x30150e[_0xc264('0x38')]=_0x30150e['attributes'][_0xc264('0x3b')]?_0x30150e[_0xc264('0x38')]:_0x14db5b[_0xc264('0x39')];_0x30150e[_0xc264('0x3d')]=qs['sort'](_0x369513[_0xc264('0x34')]['sort']);_0x30150e[_0xc264('0x3f')]=qs[_0xc264('0x36')](_[_0xc264('0x40')](_0x369513['query'],_0x14db5b['filters']));if(_0x369513['query'][_0xc264('0x43')]){_0x30150e[_0xc264('0x3f')]=_[_0xc264('0x41')](_0x30150e[_0xc264('0x3f')],{'$or':_[_0xc264('0x33')](_0x30150e[_0xc264('0x38')],function(_0x5d7292){var _0x59b91e={};_0x59b91e[_0x5d7292]={'$like':'%'+_0x369513[_0xc264('0x34')][_0xc264('0x43')]+'%'};return _0x59b91e;})});}_0x30150e=_[_0xc264('0x41')]({},_0x30150e,_0x369513['options']);return _0x4bb12d[_0xc264('0x65')](_0x30150e);}})[_0xc264('0x26')](function(_0x32f2ba){if(_0x32f2ba){_0x82ebb2=_0x32f2ba[_0xc264('0x3b')];if(!_0x369513[_0xc264('0x34')][_0xc264('0x3c')](_0xc264('0x5f'))){_0x30150e[_0xc264('0x1e')]=qs[_0xc264('0x1e')](_0x369513[_0xc264('0x34')][_0xc264('0x1e')]);_0x30150e[_0xc264('0x1c')]=qs[_0xc264('0x1c')](_0x369513['query'][_0xc264('0x1c')]);}return _0x4bb12d[_0xc264('0x65')](_0x30150e);}})[_0xc264('0x26')](function(_0x3a3abd){if(_0x3a3abd){return _0x3a3abd?{'count':_0x82ebb2,'rows':_0x3a3abd}:null;}})[_0xc264('0x26')](respondWithResult(_0x4d8f9a,null))['catch'](handleError(_0x4d8f9a,null));};exports['addLists']=function(_0x2962ca,_0x4fc58d,_0x4ddebc){var _0x4539cc,_0x37596f;return db['Campaign'][_0xc264('0x57')]({'where':{'id':_0x2962ca[_0xc264('0x4b')]['id']}})[_0xc264('0x26')](handleEntityNotFound(_0x4fc58d,null))[_0xc264('0x26')](function(_0x3b24dc){if(_0x3b24dc){_0x37596f=_0x3b24dc;return _0x3b24dc[_0xc264('0x66')](_0x2962ca['body'][_0xc264('0x67')],_['omit'](_0x2962ca['body'],['ids','id'])||{});}return null;})[_0xc264('0x68')](function(_0x3a70c8){var _0xa5427c;_0x4539cc=_0x3a70c8||[];var _0x3f9f17=[];if(_0x3a70c8){for(var _0x294e6b=0x0;_0x294e6b<_0x3a70c8[_0xc264('0x3b')];_0x294e6b+=0x1){var _0x1c5a83=_0x3a70c8[_0x294e6b][_0xc264('0x27')]({'plain':!![]});_0x37596f[_0xc264('0x69')]=_0x2962ca[_0xc264('0x4e')][_0xc264('0x69')]?_0x2962ca[_0xc264('0x4e')][_0xc264('0x69')]:_0x37596f[_0xc264('0x69')];switch(_0x37596f['dialCheckDuplicateType']){case _0xc264('0x6a'):_0xa5427c=squel[_0xc264('0x6b')]()['into'](_0xc264('0x6c'))[_0xc264('0x6d')]([_0xc264('0x6e'),_0xc264('0x6f'),_0xc264('0x70'),_0xc264('0x71'),_0xc264('0x60'),'createdAt',_0xc264('0x56')],squel[_0xc264('0x72')]()[_0xc264('0x73')](_0xc264('0x6e'),_0xc264('0x6e'))[_0xc264('0x73')](_0xc264('0x74'),_0xc264('0x6f'))[_0xc264('0x73')]('id','ContactId')[_0xc264('0x73')](_0x1c5a83[_0xc264('0x75')][_0xc264('0x76')](),_0xc264('0x71'))[_0xc264('0x73')](_0x2962ca['params']['id'][_0xc264('0x76')](),_0xc264('0x60'))['field'](_0xc264('0x74'),_0xc264('0x55'))[_0xc264('0x73')]('NOW()',_0xc264('0x56'))[_0xc264('0x77')](_0xc264('0x78'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xc264('0x79'),_0x1c5a83[_0xc264('0x75')][_0xc264('0x76')]())[_0xc264('0x3f')](_0xc264('0x7a'))['where'](_0xc264('0x7b'),squel[_0xc264('0x72')]()[_0xc264('0x73')]('COALESCE(calleridnum,\x27\x27)')['from'](_0xc264('0x7c'))[_0xc264('0x3f')](_0xc264('0x7d'),_0x2962ca[_0xc264('0x4b')]['id'][_0xc264('0x76')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xc264('0x73')](_0xc264('0x7e'))[_0xc264('0x77')]('cm_hopper')[_0xc264('0x3f')](_0xc264('0x7d'),_0x2962ca[_0xc264('0x4b')]['id'][_0xc264('0x76')]())))[_0xc264('0x76')]();break;case'onlyIfOpen':_0xa5427c=squel[_0xc264('0x6b')]()[_0xc264('0x7f')](_0xc264('0x6c'))[_0xc264('0x6d')]([_0xc264('0x6e'),_0xc264('0x6f'),_0xc264('0x70'),_0xc264('0x71'),'CampaignId',_0xc264('0x55'),_0xc264('0x56')],squel[_0xc264('0x72')]()['field'](_0xc264('0x6e'),'phone')[_0xc264('0x73')](_0xc264('0x74'),_0xc264('0x6f'))[_0xc264('0x73')]('id',_0xc264('0x70'))[_0xc264('0x73')](_0x1c5a83[_0xc264('0x75')][_0xc264('0x76')](),'ListId')[_0xc264('0x73')](_0x2962ca[_0xc264('0x4b')]['id']['toString'](),'CampaignId')[_0xc264('0x73')](_0xc264('0x74'),'createdAt')['field'](_0xc264('0x74'),_0xc264('0x56'))[_0xc264('0x77')](_0xc264('0x78'))[_0xc264('0x3f')](_0xc264('0x80'))[_0xc264('0x3f')](_0xc264('0x79'),_0x1c5a83[_0xc264('0x75')][_0xc264('0x76')]())[_0xc264('0x3f')](_0xc264('0x7a'))[_0xc264('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc264('0x72')]()['field'](_0xc264('0x7e'))['from']('cm_hopper')[_0xc264('0x3f')](_0xc264('0x7d'),_0x2962ca[_0xc264('0x4b')]['id'][_0xc264('0x76')]())))[_0xc264('0x76')]();break;default:_0xa5427c=squel[_0xc264('0x6b')]()['into'](_0xc264('0x6c'))[_0xc264('0x6d')]([_0xc264('0x6e'),'scheduledAt',_0xc264('0x70'),_0xc264('0x71'),'CampaignId',_0xc264('0x55'),_0xc264('0x56')],squel['select']()['field'](_0xc264('0x6e'),_0xc264('0x6e'))[_0xc264('0x73')](_0xc264('0x74'),_0xc264('0x6f'))[_0xc264('0x73')]('id',_0xc264('0x70'))[_0xc264('0x73')](_0x1c5a83[_0xc264('0x75')][_0xc264('0x76')](),_0xc264('0x71'))[_0xc264('0x73')](_0x2962ca[_0xc264('0x4b')]['id']['toString'](),_0xc264('0x60'))['field'](_0xc264('0x74'),_0xc264('0x55'))[_0xc264('0x73')](_0xc264('0x74'),'updatedAt')['from'](_0xc264('0x78'))[_0xc264('0x3f')](_0xc264('0x80'))[_0xc264('0x3f')](_0xc264('0x79'),_0x1c5a83[_0xc264('0x75')][_0xc264('0x76')]())[_0xc264('0x3f')](_0xc264('0x7a')))[_0xc264('0x76')]();}_0x3f9f17[_0xc264('0x81')](db['sequelize']['query'](_0xa5427c));}return BPromise[_0xc264('0x82')](_0x3f9f17);}})['then'](function(){return _0x4539cc;})[_0xc264('0x26')](respondWithResult(_0x4fc58d,null))[_0xc264('0x49')](handleError(_0x4fc58d,null));};exports[_0xc264('0x83')]=function(_0x59f1bc,_0x47017e,_0x1879a5){return db[_0xc264('0x45')]['find']({'where':{'id':_0x59f1bc[_0xc264('0x4b')]['id']}})[_0xc264('0x26')](handleEntityNotFound(_0x47017e,null))['then'](function(_0x3bee0e){if(_0x3bee0e){return _0x3bee0e[_0xc264('0x83')](_0x59f1bc[_0xc264('0x34')]['ids']);}})[_0xc264('0x26')](function(_0xda292){if(_0xda292){return db[_0xc264('0x5c')][_0xc264('0x2a')]({'where':{'ListId':_0x59f1bc[_0xc264('0x34')]['ids'],'CampaignId':_0x59f1bc[_0xc264('0x4b')]['id']}})['then'](function(){return _0xda292;});}})[_0xc264('0x26')](respondWithStatusCode(_0x47017e,null))[_0xc264('0x49')](handleError(_0x47017e,null));};exports[_0xc264('0x84')]=function(_0x2d7b03,_0x4288a8,_0x480abb){var _0x12bbd9={};var _0x4bea7b={};var _0x115027;var _0x226eeb;return db[_0xc264('0x45')][_0xc264('0x5b')]({'where':{'id':_0x2d7b03[_0xc264('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4288a8,null))[_0xc264('0x26')](function(_0x32818f){if(_0x32818f){_0x115027=_0x32818f;_0x4bea7b[_0xc264('0x39')]=_[_0xc264('0x35')](db[_0xc264('0x85')][_0xc264('0x30')]);_0x4bea7b['query']=_[_0xc264('0x35')](_0x2d7b03[_0xc264('0x34')]);_0x4bea7b['filters']=_[_0xc264('0x37')](_0x4bea7b['model'],_0x4bea7b[_0xc264('0x34')]);_0x12bbd9[_0xc264('0x38')]=_[_0xc264('0x37')](_0x4bea7b['model'],qs[_0xc264('0x3a')](_0x2d7b03[_0xc264('0x34')][_0xc264('0x3a')]));_0x12bbd9[_0xc264('0x38')]=_0x12bbd9['attributes'][_0xc264('0x3b')]?_0x12bbd9[_0xc264('0x38')]:_0x4bea7b['model'];_0x12bbd9[_0xc264('0x3d')]=qs[_0xc264('0x3e')](_0x2d7b03[_0xc264('0x34')]['sort']);_0x12bbd9[_0xc264('0x3f')]=qs[_0xc264('0x36')](_[_0xc264('0x40')](_0x2d7b03[_0xc264('0x34')],_0x4bea7b['filters']));if(_0x2d7b03['query'][_0xc264('0x43')]){_0x12bbd9['where']=_[_0xc264('0x41')](_0x12bbd9[_0xc264('0x3f')],{'$or':_[_0xc264('0x33')](_0x12bbd9[_0xc264('0x38')],function(_0x145960){var _0x402f2d={};_0x402f2d[_0x145960]={'$like':'%'+_0x2d7b03[_0xc264('0x34')][_0xc264('0x43')]+'%'};return _0x402f2d;})});}_0x12bbd9=_[_0xc264('0x41')]({},_0x12bbd9,_0x2d7b03[_0xc264('0x44')]);return _0x115027[_0xc264('0x84')](_0x12bbd9);}})['then'](function(_0x1424f5){if(_0x1424f5){_0x226eeb=_0x1424f5[_0xc264('0x3b')];if(!_0x2d7b03['query'][_0xc264('0x3c')](_0xc264('0x5f'))){_0x12bbd9[_0xc264('0x1e')]=qs[_0xc264('0x1e')](_0x2d7b03[_0xc264('0x34')][_0xc264('0x1e')]);_0x12bbd9[_0xc264('0x1c')]=qs[_0xc264('0x1c')](_0x2d7b03[_0xc264('0x34')][_0xc264('0x1c')]);}return _0x115027[_0xc264('0x84')](_0x12bbd9);}})[_0xc264('0x26')](function(_0xc5838){if(_0xc5838){return _0xc5838?{'count':_0x226eeb,'rows':_0xc5838}:null;}})[_0xc264('0x26')](respondWithResult(_0x4288a8,null))[_0xc264('0x49')](handleError(_0x4288a8,null));};exports[_0xc264('0x86')]=function(_0x5a24fc,_0x1b07f0,_0x9ce058){var _0x5b1732,_0x572a31;return db['Campaign'][_0xc264('0x57')]({'where':{'id':_0x5a24fc[_0xc264('0x4b')]['id']}})[_0xc264('0x26')](handleEntityNotFound(_0x1b07f0,null))[_0xc264('0x26')](function(_0x48dae3){if(_0x48dae3){_0x572a31=_0x48dae3;return _0x48dae3[_0xc264('0x86')](_0x5a24fc['body'][_0xc264('0x67')],_[_0xc264('0x87')](_0x5a24fc[_0xc264('0x4e')],[_0xc264('0x67'),'id'])||{});}return null;})[_0xc264('0x68')](function(_0x32250c){var _0xbaabf2;_0x5b1732=_0x32250c||[];var _0x3943c6=[];if(_0x32250c){for(var _0x24d328=0x0;_0x24d328<_0x32250c['length'];_0x24d328+=0x1){var _0x1a8c26=_0x32250c[_0x24d328][_0xc264('0x27')]({'plain':!![]});_0xbaabf2=squel['insert']()['into'](_0xc264('0x88'))['fromQuery']([_0xc264('0x6e'),_0xc264('0x70'),_0xc264('0x71'),_0xc264('0x60'),_0xc264('0x55'),_0xc264('0x56')],squel['select']()[_0xc264('0x73')]('phone',_0xc264('0x6e'))[_0xc264('0x73')]('id',_0xc264('0x70'))['field'](_0x1a8c26[_0xc264('0x75')][_0xc264('0x76')](),_0xc264('0x71'))['field'](_0x5a24fc['params']['id'][_0xc264('0x76')](),_0xc264('0x60'))[_0xc264('0x73')](_0xc264('0x74'),_0xc264('0x55'))[_0xc264('0x73')]('NOW()',_0xc264('0x56'))[_0xc264('0x77')](_0xc264('0x78'))['where'](_0xc264('0x80'))[_0xc264('0x3f')]('ListId\x20=\x20?',_0x1a8c26['CmListId']['toString']())['where'](_0xc264('0x7a')))[_0xc264('0x76')]();_0x3943c6['push'](db[_0xc264('0x89')]['query'](_0xbaabf2));}return BPromise['all'](_0x3943c6);}})['then'](function(){return _0x5b1732;})[_0xc264('0x26')](respondWithResult(_0x1b07f0,null))['catch'](handleError(_0x1b07f0,null));};exports[_0xc264('0x8a')]=function(_0x5bca5e,_0x5f4173,_0x264bc3){return db[_0xc264('0x45')][_0xc264('0x57')]({'where':{'id':_0x5bca5e['params']['id']}})[_0xc264('0x26')](handleEntityNotFound(_0x5f4173,null))[_0xc264('0x26')](function(_0x404983){if(_0x404983){return _0x404983['removeBlackLists'](_0x5bca5e[_0xc264('0x34')][_0xc264('0x67')]);}})[_0xc264('0x26')](function(_0x48b766){if(_0x48b766){return db[_0xc264('0x64')][_0xc264('0x2a')]({'where':{'ListId':_0x5bca5e[_0xc264('0x34')][_0xc264('0x67')],'CampaignId':_0x5bca5e['params']['id']}})[_0xc264('0x26')](function(){return _0x48b766;});}})[_0xc264('0x26')](respondWithStatusCode(_0x5f4173,null))[_0xc264('0x49')](handleError(_0x5f4173,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 210a28a..43b44a8 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1a423e,_0xb86076){var _0x29de4b=function(_0x3190ac){while(--_0x3190ac){_0x1a423e['push'](_0x1a423e['shift']());}};_0x29de4b(++_0xb86076);}(_0x7a54,0x106));var _0x47a5=function(_0x43d75d,_0x143085){_0x43d75d=_0x43d75d-0x0;var _0x456eb8=_0x7a54[_0x43d75d];return _0x456eb8;};'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 242e5ea..96ea444 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 _0xfa68=['info','request\x20sent','debug','stringify','error','code','message','Campaign,\x20%s,\x20%s','result','findAll','options','raw','limit','include','map','model','attributes','GetCampaign','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4bd6d3,_0x3a7e64){var _0x3e663c=function(_0x23f1d6){while(--_0x23f1d6){_0x4bd6d3['push'](_0x4bd6d3['shift']());}};_0x3e663c(++_0x3a7e64);}(_0xfa68,0x86));var _0x8fa6=function(_0x3bb8b0,_0x15ba06){_0x3bb8b0=_0x3bb8b0-0x0;var _0x44df08=_0xfa68[_0x3bb8b0];return _0x44df08;};'use strict';var _=require(_0x8fa6('0x0'));var util=require(_0x8fa6('0x1'));var moment=require(_0x8fa6('0x2'));var BPromise=require('bluebird');var rs=require(_0x8fa6('0x3'));var fs=require('fs');var Redis=require(_0x8fa6('0x4'));var db=require(_0x8fa6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8fa6('0x6'))(_0x8fa6('0x7'));var config=require(_0x8fa6('0x8'));var jayson=require(_0x8fa6('0x9'));var client=jayson[_0x8fa6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ab645,_0x42b044,_0x523f62){return new BPromise(function(_0x1cdf94,_0x269bda){return client['request'](_0x1ab645,_0x523f62)['then'](function(_0x1f3a90){logger[_0x8fa6('0xb')]('Campaign,\x20%s,\x20%s',_0x42b044,_0x8fa6('0xc'));logger[_0x8fa6('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x42b044,'request\x20sent',JSON[_0x8fa6('0xe')](_0x1f3a90));if(_0x1f3a90[_0x8fa6('0xf')]){if(_0x1f3a90['error'][_0x8fa6('0x10')]===0x1f4){logger[_0x8fa6('0xf')]('Campaign,\x20%s,\x20%s',_0x42b044,_0x1f3a90[_0x8fa6('0xf')][_0x8fa6('0x11')]);return _0x269bda(_0x1f3a90['error'][_0x8fa6('0x11')]);}logger[_0x8fa6('0xf')](_0x8fa6('0x12'),_0x42b044,_0x1f3a90[_0x8fa6('0xf')][_0x8fa6('0x11')]);return _0x1cdf94(_0x1f3a90['error']['message']);}else{logger[_0x8fa6('0xb')]('Campaign,\x20%s,\x20%s',_0x42b044,_0x8fa6('0xc'));_0x1cdf94(_0x1f3a90[_0x8fa6('0x13')][_0x8fa6('0x11')]);}})['catch'](function(_0x210bfe){logger[_0x8fa6('0xf')](_0x8fa6('0x12'),_0x42b044,_0x210bfe);_0x269bda(_0x210bfe);});});}exports['GetCampaign']=function(_0x329f97){var _0x2f7baf=this;return new Promise(function(_0x8de44e,_0x2dffbe){return db['Campaign'][_0x8fa6('0x14')]({'raw':_0x329f97['options']?_0x329f97[_0x8fa6('0x15')][_0x8fa6('0x16')]===undefined?!![]:![]:!![],'where':_0x329f97[_0x8fa6('0x15')]?_0x329f97[_0x8fa6('0x15')]['where']||null:null,'attributes':_0x329f97[_0x8fa6('0x15')]?_0x329f97[_0x8fa6('0x15')]['attributes']||null:null,'limit':_0x329f97[_0x8fa6('0x15')]?_0x329f97[_0x8fa6('0x15')][_0x8fa6('0x17')]||null:null,'include':_0x329f97['options']?_0x329f97[_0x8fa6('0x15')][_0x8fa6('0x18')]?_[_0x8fa6('0x19')](_0x329f97['options']['include'],function(_0x588001){return{'model':db[_0x588001[_0x8fa6('0x1a')]],'as':_0x588001['as'],'attributes':_0x588001[_0x8fa6('0x1b')],'include':_0x588001['include']?_['map'](_0x588001[_0x8fa6('0x18')],function(_0x3f86d8){return{'model':db[_0x3f86d8['model']],'as':_0x3f86d8['as'],'attributes':_0x3f86d8['attributes'],'include':_0x3f86d8[_0x8fa6('0x18')]?_[_0x8fa6('0x19')](_0x3f86d8[_0x8fa6('0x18')],function(_0x4efd81){return{'model':db[_0x4efd81[_0x8fa6('0x1a')]],'as':_0x4efd81['as'],'attributes':_0x4efd81[_0x8fa6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb59c50){logger[_0x8fa6('0xb')]('GetCampaign',_0x329f97);logger[_0x8fa6('0xd')](_0x8fa6('0x1c'),_0x329f97,JSON['stringify'](_0xb59c50));_0x8de44e(_0xb59c50);})['catch'](function(_0x23fdc9){logger[_0x8fa6('0xf')]('GetCampaign',_0x23fdc9['message'],_0x329f97);_0x2dffbe(_0x2f7baf[_0x8fa6('0xf')](0x1f4,_0x23fdc9[_0x8fa6('0x11')]));});});};
\ No newline at end of file
+var _0x2bd6=['where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw'];(function(_0x46841b,_0xd0c2){var _0x38a08c=function(_0x37acb0){while(--_0x37acb0){_0x46841b['push'](_0x46841b['shift']());}};_0x38a08c(++_0xd0c2);}(_0x2bd6,0x1f4));var _0x62bd=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x2bd6[_0x191154];return _0x3dcd73;};'use strict';var _=require(_0x62bd('0x0'));var util=require(_0x62bd('0x1'));var moment=require(_0x62bd('0x2'));var BPromise=require(_0x62bd('0x3'));var rs=require(_0x62bd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x62bd('0x5'))['db'];var utils=require(_0x62bd('0x6'));var logger=require(_0x62bd('0x7'))('rpc');var config=require(_0x62bd('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x62bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39af04,_0x55d811,_0x3d0d8b){return new BPromise(function(_0x11af94,_0x4ff8b8){return client[_0x62bd('0xa')](_0x39af04,_0x3d0d8b)[_0x62bd('0xb')](function(_0x1e2413){logger[_0x62bd('0xc')](_0x62bd('0xd'),_0x55d811,_0x62bd('0xe'));logger[_0x62bd('0xf')](_0x62bd('0x10'),_0x55d811,_0x62bd('0xe'),JSON[_0x62bd('0x11')](_0x1e2413));if(_0x1e2413['error']){if(_0x1e2413['error'][_0x62bd('0x12')]===0x1f4){logger[_0x62bd('0x13')](_0x62bd('0xd'),_0x55d811,_0x1e2413[_0x62bd('0x13')][_0x62bd('0x14')]);return _0x4ff8b8(_0x1e2413[_0x62bd('0x13')]['message']);}logger[_0x62bd('0x13')]('Campaign,\x20%s,\x20%s',_0x55d811,_0x1e2413[_0x62bd('0x13')]['message']);return _0x11af94(_0x1e2413['error'][_0x62bd('0x14')]);}else{logger[_0x62bd('0xc')](_0x62bd('0xd'),_0x55d811,_0x62bd('0xe'));_0x11af94(_0x1e2413[_0x62bd('0x15')][_0x62bd('0x14')]);}})[_0x62bd('0x16')](function(_0x16f723){logger['error'](_0x62bd('0xd'),_0x55d811,_0x16f723);_0x4ff8b8(_0x16f723);});});}exports[_0x62bd('0x17')]=function(_0x1e0b6a){var _0x38eb80=this;return new Promise(function(_0x59a648,_0x3d050b){return db[_0x62bd('0x18')][_0x62bd('0x19')]({'raw':_0x1e0b6a[_0x62bd('0x1a')]?_0x1e0b6a['options'][_0x62bd('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e0b6a[_0x62bd('0x1a')]?_0x1e0b6a[_0x62bd('0x1a')][_0x62bd('0x1c')]||null:null,'attributes':_0x1e0b6a['options']?_0x1e0b6a[_0x62bd('0x1a')][_0x62bd('0x1d')]||null:null,'limit':_0x1e0b6a[_0x62bd('0x1a')]?_0x1e0b6a[_0x62bd('0x1a')]['limit']||null:null,'include':_0x1e0b6a[_0x62bd('0x1a')]?_0x1e0b6a[_0x62bd('0x1a')][_0x62bd('0x1e')]?_[_0x62bd('0x1f')](_0x1e0b6a[_0x62bd('0x1a')][_0x62bd('0x1e')],function(_0x245628){return{'model':db[_0x245628[_0x62bd('0x20')]],'as':_0x245628['as'],'attributes':_0x245628[_0x62bd('0x1d')],'include':_0x245628[_0x62bd('0x1e')]?_[_0x62bd('0x1f')](_0x245628[_0x62bd('0x1e')],function(_0x45e4f2){return{'model':db[_0x45e4f2['model']],'as':_0x45e4f2['as'],'attributes':_0x45e4f2[_0x62bd('0x1d')],'include':_0x45e4f2[_0x62bd('0x1e')]?_['map'](_0x45e4f2[_0x62bd('0x1e')],function(_0x3c6761){return{'model':db[_0x3c6761[_0x62bd('0x20')]],'as':_0x3c6761['as'],'attributes':_0x3c6761['attributes']};}):[]};}):[]};}):[]:[]})[_0x62bd('0xb')](function(_0x205d78){logger[_0x62bd('0xc')](_0x62bd('0x17'),_0x1e0b6a);logger[_0x62bd('0xf')](_0x62bd('0x17'),_0x1e0b6a,JSON[_0x62bd('0x11')](_0x205d78));_0x59a648(_0x205d78);})[_0x62bd('0x16')](function(_0x532515){logger['error'](_0x62bd('0x17'),_0x532515[_0x62bd('0x14')],_0x1e0b6a);_0x3d050b(_0x38eb80[_0x62bd('0x13')](0x1f4,_0x532515[_0x62bd('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 03b3a93..aaacc00 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 _0xf430=['/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','clone','addBlackLists','/:id','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','show'];(function(_0x149759,_0x7f4feb){var _0xb05afc=function(_0x192149){while(--_0x192149){_0x149759['push'](_0x149759['shift']());}};_0xb05afc(++_0x7f4feb);}(_0xf430,0x1e4));var _0x0f43=function(_0x106214,_0x454b8d){_0x106214=_0x106214-0x0;var _0x5f5cea=_0xf430[_0x106214];return _0x5f5cea;};'use strict';var multer=require(_0x0f43('0x0'));var util=require(_0x0f43('0x1'));var path=require(_0x0f43('0x2'));var timeout=require('connect-timeout');var express=require(_0x0f43('0x3'));var router=express[_0x0f43('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0f43('0x5'));var config=require(_0x0f43('0x6'));var controller=require(_0x0f43('0x7'));router['get']('/',auth[_0x0f43('0x8')](),controller[_0x0f43('0x9')]);router[_0x0f43('0xa')]('/:id',auth[_0x0f43('0x8')](),controller[_0x0f43('0xb')]);router[_0x0f43('0xa')]('/:id/hoppers',auth[_0x0f43('0x8')](),controller['getHoppers']);router[_0x0f43('0xa')](_0x0f43('0xc'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x0f43('0xa')](_0x0f43('0xd'),auth[_0x0f43('0x8')](),controller[_0x0f43('0xe')]);router[_0x0f43('0xa')]('/:id/hopper_black',auth[_0x0f43('0x8')](),controller[_0x0f43('0xf')]);router[_0x0f43('0xa')](_0x0f43('0x10'),auth[_0x0f43('0x8')](),controller[_0x0f43('0x11')]);router[_0x0f43('0xa')](_0x0f43('0x12'),auth[_0x0f43('0x8')](),controller[_0x0f43('0x13')]);router[_0x0f43('0x14')]('/',auth['isAuthenticated'](),controller[_0x0f43('0x15')]);router[_0x0f43('0x14')]('/:id/clone',auth[_0x0f43('0x8')](),controller[_0x0f43('0x16')]);router[_0x0f43('0x14')]('/:id/lists',auth[_0x0f43('0x8')](),controller['addLists']);router[_0x0f43('0x14')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x0f43('0x17')]);router['put'](_0x0f43('0x18'),auth['isAuthenticated'](),controller[_0x0f43('0x19')]);router[_0x0f43('0x1a')](_0x0f43('0x18'),auth[_0x0f43('0x8')](),controller[_0x0f43('0x1b')]);router[_0x0f43('0x1a')]('/:id/lists',auth[_0x0f43('0x8')](),controller[_0x0f43('0x1c')]);router[_0x0f43('0x1a')](_0x0f43('0x12'),auth[_0x0f43('0x8')](),controller[_0x0f43('0x1d')]);module[_0x0f43('0x1e')]=router;
\ No newline at end of file
+var _0xf566=['/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories'];(function(_0x549276,_0x3fdac8){var _0xee59d2=function(_0x4a9eca){while(--_0x4a9eca){_0x549276['push'](_0x549276['shift']());}};_0xee59d2(++_0x3fdac8);}(_0xf566,0x186));var _0x6f56=function(_0xd31b2c,_0x2bccdd){_0xd31b2c=_0xd31b2c-0x0;var _0x5ec823=_0xf566[_0xd31b2c];return _0x5ec823;};'use strict';var multer=require(_0x6f56('0x0'));var util=require(_0x6f56('0x1'));var path=require(_0x6f56('0x2'));var timeout=require(_0x6f56('0x3'));var express=require(_0x6f56('0x4'));var router=express[_0x6f56('0x5')]();var fs_extra=require(_0x6f56('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6f56('0x7'));var config=require(_0x6f56('0x8'));var controller=require('./campaign.controller');router[_0x6f56('0x9')]('/',auth[_0x6f56('0xa')](),controller[_0x6f56('0xb')]);router['get'](_0x6f56('0xc'),auth[_0x6f56('0xa')](),controller[_0x6f56('0xd')]);router[_0x6f56('0x9')](_0x6f56('0xe'),auth['isAuthenticated'](),controller[_0x6f56('0xf')]);router[_0x6f56('0x9')](_0x6f56('0x10'),auth[_0x6f56('0xa')](),controller[_0x6f56('0x11')]);router['get'](_0x6f56('0x12'),auth['isAuthenticated'](),controller[_0x6f56('0x13')]);router[_0x6f56('0x9')]('/:id/hopper_black',auth[_0x6f56('0xa')](),controller['getHopperBlacks']);router['get'](_0x6f56('0x14'),auth[_0x6f56('0xa')](),controller[_0x6f56('0x15')]);router[_0x6f56('0x9')](_0x6f56('0x16'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x6f56('0x17')]('/',auth[_0x6f56('0xa')](),controller[_0x6f56('0x18')]);router[_0x6f56('0x17')](_0x6f56('0x19'),auth[_0x6f56('0xa')](),controller['clone']);router['post'](_0x6f56('0x14'),auth[_0x6f56('0xa')](),controller[_0x6f56('0x1a')]);router[_0x6f56('0x17')](_0x6f56('0x16'),auth[_0x6f56('0xa')](),controller[_0x6f56('0x1b')]);router[_0x6f56('0x1c')]('/:id',auth[_0x6f56('0xa')](),controller[_0x6f56('0x1d')]);router[_0x6f56('0x1e')](_0x6f56('0xc'),auth[_0x6f56('0xa')](),controller[_0x6f56('0x1f')]);router['delete'](_0x6f56('0x14'),auth[_0x6f56('0xa')](),controller[_0x6f56('0x20')]);router[_0x6f56('0x1e')](_0x6f56('0x16'),auth[_0x6f56('0xa')](),controller['removeBlackLists']);module[_0x6f56('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 8af8793..46eae11 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 _0xe6c1=['TEXT','VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x7ec78e,_0x31931f){var _0x3ab195=function(_0x31fc08){while(--_0x31fc08){_0x7ec78e['push'](_0x7ec78e['shift']());}};_0x3ab195(++_0x31931f);}(_0xe6c1,0x14d));var _0x1e6c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6c1[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x1e6c('0x0'));module[_0x1e6c('0x1')]={'key':{'type':Sequelize[_0x1e6c('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x1e6c('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x1e6c('0x2')]},'name':{'type':Sequelize[_0x1e6c('0x4')],'get':function(){return this[_0x1e6c('0x5')](_0x1e6c('0x6'));}}};
\ No newline at end of file
+var _0x9d48=['VIRTUAL','key','sequelize','exports','STRING','TEXT'];(function(_0x4ae5c7,_0x11b6e5){var _0xf7bb0a=function(_0x14e564){while(--_0x14e564){_0x4ae5c7['push'](_0x4ae5c7['shift']());}};_0xf7bb0a(++_0x11b6e5);}(_0x9d48,0x158));var _0x89d4=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0x9d48[_0xc14df7];return _0x34a445;};'use strict';var Sequelize=require(_0x89d4('0x0'));module[_0x89d4('0x1')]={'key':{'type':Sequelize[_0x89d4('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x89d4('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x89d4('0x2')]},'name':{'type':Sequelize[_0x89d4('0x4')],'get':function(){return this['getDataValue'](_0x89d4('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 2082d04..f5b998a 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 _0x6157=['Unable\x20to\x20retrieve\x20the\x20current\x20user','user','CannedAnswers','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','get','UserProfileResource','error','stack','name','send','map','CannedAnswer','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x6157,0x16d));var _0x7615=function(_0x3e6646,_0x2bab80){_0x3e6646=_0x3e6646-0x0;var _0x4b771e=_0x6157[_0x3e6646];return _0x4b771e;};'use strict';var emlformat=require(_0x7615('0x0'));var rimraf=require(_0x7615('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7615('0x2'));var moment=require(_0x7615('0x3'));var BPromise=require(_0x7615('0x4'));var Mustache=require('mustache');var util=require(_0x7615('0x5'));var path=require('path');var sox=require(_0x7615('0x6'));var csv=require(_0x7615('0x7'));var ejs=require(_0x7615('0x8'));var fs=require('fs');var fs_extra=require(_0x7615('0x9'));var _=require(_0x7615('0xa'));var squel=require(_0x7615('0xb'));var crypto=require(_0x7615('0xc'));var jsforce=require(_0x7615('0xd'));var deskjs=require(_0x7615('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7615('0xf'));var Papa=require(_0x7615('0x10'));var Redis=require(_0x7615('0x11'));var authService=require(_0x7615('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7615('0x13'));var hardwareService=require(_0x7615('0x14'));var logger=require(_0x7615('0x15'))(_0x7615('0x16'));var utils=require(_0x7615('0x17'));var config=require(_0x7615('0x18'));var licenseUtil=require(_0x7615('0x19'));var db=require(_0x7615('0x1a'))['db'];function respondWithStatusCode(_0x21839b,_0x2bd7f1){_0x2bd7f1=_0x2bd7f1||0xcc;return function(_0x945199){if(_0x945199){return _0x21839b[_0x7615('0x1b')](_0x2bd7f1);}return _0x21839b[_0x7615('0x1c')](_0x2bd7f1)[_0x7615('0x1d')]();};}function respondWithResult(_0x5b7403,_0x14caf1){_0x14caf1=_0x14caf1||0xc8;return function(_0x16d65b){if(_0x16d65b){return _0x5b7403[_0x7615('0x1c')](_0x14caf1)[_0x7615('0x1e')](_0x16d65b);}};}function respondWithFilteredResult(_0x2d127f,_0x26b206){return function(_0x5d6810){if(_0x5d6810){var _0x595734=typeof _0x26b206[_0x7615('0x1f')]==='undefined'&&typeof _0x26b206[_0x7615('0x20')]===_0x7615('0x21');var _0xd062ed=_0x5d6810['count'];var _0x3e9cd2=_0x595734?0x0:_0x26b206[_0x7615('0x1f')];var _0x5018da=_0x595734?_0x5d6810[_0x7615('0x22')]:_0x26b206[_0x7615('0x1f')]+_0x26b206[_0x7615('0x20')];var _0x1e520e;if(_0x5018da>=_0xd062ed){_0x5018da=_0xd062ed;_0x1e520e=0xc8;}else{_0x1e520e=0xce;}_0x2d127f[_0x7615('0x1c')](_0x1e520e);return _0x2d127f[_0x7615('0x23')](_0x7615('0x24'),_0x3e9cd2+'-'+_0x5018da+'/'+_0xd062ed)[_0x7615('0x1e')](_0x5d6810);}return null;};}function patchUpdates(_0x39698c){return function(_0x48b42b){try{jsonpatch['apply'](_0x48b42b,_0x39698c,!![]);}catch(_0x2d6305){return BPromise[_0x7615('0x25')](_0x2d6305);}return _0x48b42b['save']();};}function saveUpdates(_0xcb17c4,_0x2bd10c){return function(_0x2b052e){if(_0x2b052e){return _0x2b052e[_0x7615('0x26')](_0xcb17c4)['then'](function(_0x2d3498){return _0x2d3498;});}return null;};}function removeEntity(_0xfea72e,_0x369bab){return function(_0x4e52c6){if(_0x4e52c6){return _0x4e52c6['destroy']()[_0x7615('0x27')](function(){var _0x4d0a3c=_0x4e52c6[_0x7615('0x28')]({'plain':!![]});var _0x243f4c='CannedAnswers';return db[_0x7615('0x29')]['destroy']({'where':{'type':_0x243f4c,'resourceId':_0x4d0a3c['id']}})[_0x7615('0x27')](function(){return _0x4e52c6;});})[_0x7615('0x27')](function(){_0xfea72e[_0x7615('0x1c')](0xcc)[_0x7615('0x1d')]();});}};}function handleEntityNotFound(_0x5272bf,_0x18893b){return function(_0x19750d){if(!_0x19750d){_0x5272bf[_0x7615('0x1b')](0x194);}return _0x19750d;};}function handleError(_0x570da5,_0x1f8836){_0x1f8836=_0x1f8836||0x1f4;return function(_0x19a0a3){logger[_0x7615('0x2a')](_0x19a0a3[_0x7615('0x2b')]);if(_0x19a0a3[_0x7615('0x2c')]){delete _0x19a0a3['name'];}_0x570da5[_0x7615('0x1c')](_0x1f8836)[_0x7615('0x2d')](_0x19a0a3);};}exports['index']=function(_0x5d7116,_0x5b7377){var _0x14308e={},_0x3e8746={},_0x35fff9={'count':0x0,'rows':[]};var _0x1f6935=_[_0x7615('0x2e')](db[_0x7615('0x2f')]['rawAttributes'],function(_0x570cea){return{'name':_0x570cea[_0x7615('0x30')],'type':_0x570cea[_0x7615('0x31')][_0x7615('0x32')]};});_0x3e8746[_0x7615('0x33')]=_[_0x7615('0x2e')](_0x1f6935,_0x7615('0x2c'));_0x3e8746[_0x7615('0x34')]=_[_0x7615('0x35')](_0x5d7116[_0x7615('0x34')]);_0x3e8746[_0x7615('0x36')]=_[_0x7615('0x37')](_0x3e8746[_0x7615('0x33')],_0x3e8746[_0x7615('0x34')]);_0x14308e[_0x7615('0x38')]=_[_0x7615('0x37')](_0x3e8746[_0x7615('0x33')],qs[_0x7615('0x39')](_0x5d7116[_0x7615('0x34')][_0x7615('0x39')]));_0x14308e['attributes']=_0x14308e[_0x7615('0x38')][_0x7615('0x3a')]?_0x14308e['attributes']:_0x3e8746[_0x7615('0x33')];if(!_0x5d7116[_0x7615('0x34')][_0x7615('0x3b')](_0x7615('0x3c'))){_0x14308e[_0x7615('0x20')]=qs[_0x7615('0x20')](_0x5d7116[_0x7615('0x34')]['limit']);_0x14308e['offset']=qs[_0x7615('0x1f')](_0x5d7116[_0x7615('0x34')][_0x7615('0x1f')]);}_0x14308e[_0x7615('0x3d')]=qs[_0x7615('0x3e')](_0x5d7116[_0x7615('0x34')][_0x7615('0x3e')]);_0x14308e[_0x7615('0x3f')]=qs[_0x7615('0x36')](_['pick'](_0x5d7116[_0x7615('0x34')],_0x3e8746[_0x7615('0x36')]),_0x1f6935);if(_0x5d7116[_0x7615('0x34')][_0x7615('0x40')]){_0x14308e[_0x7615('0x3f')]=_[_0x7615('0x41')](_0x14308e[_0x7615('0x3f')],{'$or':[{'key':{'$like':'%'+_0x5d7116[_0x7615('0x34')]['filter']+'%'}},{'value':{'$like':'%'+_0x5d7116[_0x7615('0x34')][_0x7615('0x40')]+'%'}}]});}_0x14308e=_['merge']({},_0x14308e,_0x5d7116[_0x7615('0x42')]);var _0x132d3f={'where':_0x14308e[_0x7615('0x3f')]};return db[_0x7615('0x2f')][_0x7615('0x22')](_0x132d3f)['then'](function(_0x369ced){_0x35fff9['count']=_0x369ced;if(_0x5d7116['query'][_0x7615('0x43')]){_0x14308e['include']=[{'all':!![]}];}return db[_0x7615('0x2f')][_0x7615('0x44')](_0x14308e);})[_0x7615('0x27')](function(_0x281486){_0x35fff9[_0x7615('0x45')]=_0x281486;return _0x35fff9;})['then'](respondWithFilteredResult(_0x5b7377,_0x14308e))[_0x7615('0x46')](handleError(_0x5b7377,null));};exports[_0x7615('0x47')]=function(_0x789fd3,_0x6ef0b5){var _0x25980e={'raw':!![],'where':{'id':_0x789fd3[_0x7615('0x48')]['id']}},_0x16900c={};_0x16900c[_0x7615('0x33')]=_[_0x7615('0x35')](db[_0x7615('0x2f')][_0x7615('0x49')]);_0x16900c[_0x7615('0x34')]=_['keys'](_0x789fd3['query']);_0x16900c[_0x7615('0x36')]=_[_0x7615('0x37')](_0x16900c[_0x7615('0x33')],_0x16900c[_0x7615('0x34')]);_0x25980e['attributes']=_['intersection'](_0x16900c[_0x7615('0x33')],qs['fields'](_0x789fd3[_0x7615('0x34')]['fields']));_0x25980e[_0x7615('0x38')]=_0x25980e[_0x7615('0x38')][_0x7615('0x3a')]?_0x25980e[_0x7615('0x38')]:_0x16900c[_0x7615('0x33')];if(_0x789fd3['query'][_0x7615('0x43')]){_0x25980e[_0x7615('0x4a')]=[{'all':!![]}];}_0x25980e=_[_0x7615('0x41')]({},_0x25980e,_0x789fd3[_0x7615('0x42')]);return db['CannedAnswer']['find'](_0x25980e)[_0x7615('0x27')](handleEntityNotFound(_0x6ef0b5,null))[_0x7615('0x27')](respondWithResult(_0x6ef0b5,null))[_0x7615('0x46')](handleError(_0x6ef0b5,null));};exports[_0x7615('0x26')]=function(_0x38885e,_0x5c2b34){if(_0x38885e['body']['id']){delete _0x38885e[_0x7615('0x4b')]['id'];}return db[_0x7615('0x2f')][_0x7615('0x4c')]({'where':{'id':_0x38885e[_0x7615('0x48')]['id']}})[_0x7615('0x27')](handleEntityNotFound(_0x5c2b34,null))[_0x7615('0x27')](saveUpdates(_0x38885e[_0x7615('0x4b')],null))[_0x7615('0x27')](respondWithResult(_0x5c2b34,null))[_0x7615('0x46')](handleError(_0x5c2b34,null));};exports['destroy']=function(_0xdef03b,_0x2bc57c){return db[_0x7615('0x2f')][_0x7615('0x4c')]({'where':{'id':_0xdef03b[_0x7615('0x48')]['id']}})[_0x7615('0x27')](handleEntityNotFound(_0x2bc57c,null))[_0x7615('0x27')](removeEntity(_0x2bc57c,null))[_0x7615('0x46')](handleError(_0x2bc57c,null));};exports[_0x7615('0x4d')]=function(_0x3b3865,_0x4f236a){var _0x1f2b1a={'key':_0x3b3865['body'][_0x7615('0x32')]};if(_0x3b3865[_0x7615('0x4b')][_0x7615('0x4e')]){_0x1f2b1a[_0x7615('0x4e')]=_0x3b3865[_0x7615('0x4b')][_0x7615('0x4e')];}else if(_0x3b3865[_0x7615('0x4b')][_0x7615('0x4f')]){_0x1f2b1a[_0x7615('0x4f')]=_0x3b3865[_0x7615('0x4b')][_0x7615('0x4f')];}else if(_0x3b3865[_0x7615('0x4b')][_0x7615('0x50')]){_0x1f2b1a[_0x7615('0x50')]=_0x3b3865[_0x7615('0x4b')][_0x7615('0x50')];}else if(_0x3b3865['body'][_0x7615('0x51')]){_0x1f2b1a['ChatWebsiteId']=_0x3b3865[_0x7615('0x4b')][_0x7615('0x51')];}return db[_0x7615('0x2f')][_0x7615('0x4c')]({'where':_0x1f2b1a})[_0x7615('0x27')](function(_0x40f281){if(_0x40f281){throw new db[(_0x7615('0x52'))][(_0x7615('0x53'))](_0x7615('0x54'));}return db[_0x7615('0x2f')][_0x7615('0x4d')](_0x3b3865[_0x7615('0x4b')]);})[_0x7615('0x27')](function(_0x30d538){var _0x1350aa=_0x3b3865['user'][_0x7615('0x28')]({'plain':!![]});if(!_0x1350aa)throw new Error(_0x7615('0x55'));if(_0x1350aa['role']===_0x7615('0x56')){var _0x283e40=_0x30d538[_0x7615('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x7615('0x4c')]({'where':{'name':_0x7615('0x57'),'userProfileId':_0x1350aa[_0x7615('0x58')]},'raw':!![]})[_0x7615('0x27')](function(_0x15f300){if(_0x15f300&&_0x15f300['autoAssociation']===0x0){return db[_0x7615('0x29')][_0x7615('0x4d')]({'name':_0x283e40[_0x7615('0x2c')],'resourceId':_0x283e40['id'],'type':_0x15f300[_0x7615('0x2c')],'sectionId':_0x15f300['id']},{})['then'](function(){return _0x30d538;});}else{return _0x30d538;}})['catch'](function(_0x43d7b9){logger[_0x7615('0x2a')](_0x7615('0x59'),_0x43d7b9);throw _0x43d7b9;});}return _0x30d538;})[_0x7615('0x27')](respondWithResult(_0x4f236a,0xc9))[_0x7615('0x46')](handleError(_0x4f236a,null));};
\ No newline at end of file
+var _0x670e=['api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','includeAll','findAll','rows','catch','show','params','keys','merge','options','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x8065e0,_0x530006){var _0x5b0f55=function(_0x241f58){while(--_0x241f58){_0x8065e0['push'](_0x8065e0['shift']());}};_0x5b0f55(++_0x530006);}(_0x670e,0x155));var _0xe670=function(_0x247d83,_0x3d9584){_0x247d83=_0x247d83-0x0;var _0x17bab4=_0x670e[_0x247d83];return _0x17bab4;};'use strict';var emlformat=require(_0xe670('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe670('0x1'));var jsonpatch=require(_0xe670('0x2'));var rp=require(_0xe670('0x3'));var moment=require(_0xe670('0x4'));var BPromise=require(_0xe670('0x5'));var Mustache=require(_0xe670('0x6'));var util=require(_0xe670('0x7'));var path=require(_0xe670('0x8'));var sox=require(_0xe670('0x9'));var csv=require(_0xe670('0xa'));var ejs=require(_0xe670('0xb'));var fs=require('fs');var fs_extra=require(_0xe670('0xc'));var _=require('lodash');var squel=require(_0xe670('0xd'));var crypto=require(_0xe670('0xe'));var jsforce=require(_0xe670('0xf'));var deskjs=require(_0xe670('0x10'));var toCsv=require(_0xe670('0xa'));var querystring=require(_0xe670('0x11'));var Papa=require(_0xe670('0x12'));var Redis=require(_0xe670('0x13'));var authService=require(_0xe670('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe670('0x15'));var hardwareService=require(_0xe670('0x16'));var logger=require('../../config/logger')(_0xe670('0x17'));var utils=require(_0xe670('0x18'));var config=require(_0xe670('0x19'));var licenseUtil=require(_0xe670('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dcd93,_0x20f975){_0x20f975=_0x20f975||0xcc;return function(_0x798769){if(_0x798769){return _0x5dcd93['sendStatus'](_0x20f975);}return _0x5dcd93[_0xe670('0x1b')](_0x20f975)[_0xe670('0x1c')]();};}function respondWithResult(_0x29a3d6,_0x54f546){_0x54f546=_0x54f546||0xc8;return function(_0x87c751){if(_0x87c751){return _0x29a3d6['status'](_0x54f546)[_0xe670('0x1d')](_0x87c751);}};}function respondWithFilteredResult(_0x21b095,_0x359140){return function(_0x46cea7){if(_0x46cea7){var _0x202710=typeof _0x359140[_0xe670('0x1e')]===_0xe670('0x1f')&&typeof _0x359140[_0xe670('0x20')]===_0xe670('0x1f');var _0x3ee20f=_0x46cea7[_0xe670('0x21')];var _0x8272f3=_0x202710?0x0:_0x359140[_0xe670('0x1e')];var _0x13588b=_0x202710?_0x46cea7[_0xe670('0x21')]:_0x359140[_0xe670('0x1e')]+_0x359140[_0xe670('0x20')];var _0x160ef5;if(_0x13588b>=_0x3ee20f){_0x13588b=_0x3ee20f;_0x160ef5=0xc8;}else{_0x160ef5=0xce;}_0x21b095['status'](_0x160ef5);return _0x21b095[_0xe670('0x22')](_0xe670('0x23'),_0x8272f3+'-'+_0x13588b+'/'+_0x3ee20f)[_0xe670('0x1d')](_0x46cea7);}return null;};}function patchUpdates(_0x1539bb){return function(_0x166139){try{jsonpatch['apply'](_0x166139,_0x1539bb,!![]);}catch(_0x1cce7d){return BPromise[_0xe670('0x24')](_0x1cce7d);}return _0x166139['save']();};}function saveUpdates(_0x13c194,_0x4b6046){return function(_0x270970){if(_0x270970){return _0x270970[_0xe670('0x25')](_0x13c194)[_0xe670('0x26')](function(_0x4e0c41){return _0x4e0c41;});}return null;};}function removeEntity(_0x5a3e5c,_0x14a05e){return function(_0x3f253e){if(_0x3f253e){return _0x3f253e[_0xe670('0x27')]()['then'](function(){var _0x593749=_0x3f253e['get']({'plain':!![]});var _0x126cb6=_0xe670('0x28');return db[_0xe670('0x29')][_0xe670('0x27')]({'where':{'type':_0x126cb6,'resourceId':_0x593749['id']}})['then'](function(){return _0x3f253e;});})['then'](function(){_0x5a3e5c[_0xe670('0x1b')](0xcc)[_0xe670('0x1c')]();});}};}function handleEntityNotFound(_0x381b46,_0x369f73){return function(_0x55da67){if(!_0x55da67){_0x381b46[_0xe670('0x2a')](0x194);}return _0x55da67;};}function handleError(_0x23118e,_0x321e9b){_0x321e9b=_0x321e9b||0x1f4;return function(_0x46d4c2){logger[_0xe670('0x2b')](_0x46d4c2[_0xe670('0x2c')]);if(_0x46d4c2[_0xe670('0x2d')]){delete _0x46d4c2[_0xe670('0x2d')];}_0x23118e[_0xe670('0x1b')](_0x321e9b)[_0xe670('0x2e')](_0x46d4c2);};}exports[_0xe670('0x2f')]=function(_0x3d5826,_0x67e30d){var _0xf705c2={},_0x5e08ff={},_0x17d5df={'count':0x0,'rows':[]};var _0x173ba8=_[_0xe670('0x30')](db[_0xe670('0x31')][_0xe670('0x32')],function(_0x2b45de){return{'name':_0x2b45de['fieldName'],'type':_0x2b45de[_0xe670('0x33')][_0xe670('0x34')]};});_0x5e08ff[_0xe670('0x35')]=_['map'](_0x173ba8,'name');_0x5e08ff[_0xe670('0x36')]=_['keys'](_0x3d5826[_0xe670('0x36')]);_0x5e08ff[_0xe670('0x37')]=_[_0xe670('0x38')](_0x5e08ff[_0xe670('0x35')],_0x5e08ff[_0xe670('0x36')]);_0xf705c2[_0xe670('0x39')]=_['intersection'](_0x5e08ff['model'],qs[_0xe670('0x3a')](_0x3d5826[_0xe670('0x36')][_0xe670('0x3a')]));_0xf705c2['attributes']=_0xf705c2['attributes'][_0xe670('0x3b')]?_0xf705c2['attributes']:_0x5e08ff[_0xe670('0x35')];if(!_0x3d5826[_0xe670('0x36')]['hasOwnProperty'](_0xe670('0x3c'))){_0xf705c2['limit']=qs[_0xe670('0x20')](_0x3d5826['query'][_0xe670('0x20')]);_0xf705c2[_0xe670('0x1e')]=qs[_0xe670('0x1e')](_0x3d5826['query'][_0xe670('0x1e')]);}_0xf705c2['order']=qs[_0xe670('0x3d')](_0x3d5826[_0xe670('0x36')]['sort']);_0xf705c2[_0xe670('0x3e')]=qs[_0xe670('0x37')](_[_0xe670('0x3f')](_0x3d5826['query'],_0x5e08ff[_0xe670('0x37')]),_0x173ba8);if(_0x3d5826[_0xe670('0x36')][_0xe670('0x40')]){_0xf705c2[_0xe670('0x3e')]=_['merge'](_0xf705c2[_0xe670('0x3e')],{'$or':[{'key':{'$like':'%'+_0x3d5826[_0xe670('0x36')][_0xe670('0x40')]+'%'}},{'value':{'$like':'%'+_0x3d5826[_0xe670('0x36')][_0xe670('0x40')]+'%'}}]});}_0xf705c2=_['merge']({},_0xf705c2,_0x3d5826['options']);var _0x2d375f={'where':_0xf705c2['where']};return db['CannedAnswer']['count'](_0x2d375f)[_0xe670('0x26')](function(_0x2a7ca1){_0x17d5df[_0xe670('0x21')]=_0x2a7ca1;if(_0x3d5826[_0xe670('0x36')][_0xe670('0x41')]){_0xf705c2['include']=[{'all':!![]}];}return db[_0xe670('0x31')][_0xe670('0x42')](_0xf705c2);})[_0xe670('0x26')](function(_0x1aa83f){_0x17d5df[_0xe670('0x43')]=_0x1aa83f;return _0x17d5df;})[_0xe670('0x26')](respondWithFilteredResult(_0x67e30d,_0xf705c2))[_0xe670('0x44')](handleError(_0x67e30d,null));};exports[_0xe670('0x45')]=function(_0x4fff49,_0x153e7d){var _0x5ad1b3={'raw':!![],'where':{'id':_0x4fff49[_0xe670('0x46')]['id']}},_0x1cc73d={};_0x1cc73d[_0xe670('0x35')]=_['keys'](db[_0xe670('0x31')][_0xe670('0x32')]);_0x1cc73d[_0xe670('0x36')]=_[_0xe670('0x47')](_0x4fff49[_0xe670('0x36')]);_0x1cc73d['filters']=_['intersection'](_0x1cc73d[_0xe670('0x35')],_0x1cc73d[_0xe670('0x36')]);_0x5ad1b3[_0xe670('0x39')]=_['intersection'](_0x1cc73d[_0xe670('0x35')],qs[_0xe670('0x3a')](_0x4fff49[_0xe670('0x36')][_0xe670('0x3a')]));_0x5ad1b3[_0xe670('0x39')]=_0x5ad1b3[_0xe670('0x39')][_0xe670('0x3b')]?_0x5ad1b3['attributes']:_0x1cc73d['model'];if(_0x4fff49[_0xe670('0x36')][_0xe670('0x41')]){_0x5ad1b3['include']=[{'all':!![]}];}_0x5ad1b3=_[_0xe670('0x48')]({},_0x5ad1b3,_0x4fff49[_0xe670('0x49')]);return db[_0xe670('0x31')][_0xe670('0x4a')](_0x5ad1b3)[_0xe670('0x26')](handleEntityNotFound(_0x153e7d,null))['then'](respondWithResult(_0x153e7d,null))['catch'](handleError(_0x153e7d,null));};exports[_0xe670('0x25')]=function(_0x2b44b3,_0x5db1e6){if(_0x2b44b3[_0xe670('0x4b')]['id']){delete _0x2b44b3[_0xe670('0x4b')]['id'];}return db['CannedAnswer'][_0xe670('0x4a')]({'where':{'id':_0x2b44b3[_0xe670('0x46')]['id']}})['then'](handleEntityNotFound(_0x5db1e6,null))[_0xe670('0x26')](saveUpdates(_0x2b44b3[_0xe670('0x4b')],null))['then'](respondWithResult(_0x5db1e6,null))['catch'](handleError(_0x5db1e6,null));};exports[_0xe670('0x27')]=function(_0x188683,_0x49fb33){return db[_0xe670('0x31')][_0xe670('0x4a')]({'where':{'id':_0x188683[_0xe670('0x46')]['id']}})[_0xe670('0x26')](handleEntityNotFound(_0x49fb33,null))[_0xe670('0x26')](removeEntity(_0x49fb33,null))['catch'](handleError(_0x49fb33,null));};exports['create']=function(_0x5f2750,_0x1df3d3){var _0x4f7ea3={'key':_0x5f2750[_0xe670('0x4b')]['key']};if(_0x5f2750['body']['MailAccountId']){_0x4f7ea3[_0xe670('0x4c')]=_0x5f2750[_0xe670('0x4b')]['MailAccountId'];}else if(_0x5f2750[_0xe670('0x4b')]['SmsAccountId']){_0x4f7ea3[_0xe670('0x4d')]=_0x5f2750[_0xe670('0x4b')][_0xe670('0x4d')];}else if(_0x5f2750[_0xe670('0x4b')][_0xe670('0x4e')]){_0x4f7ea3['OpenchannelAccountId']=_0x5f2750[_0xe670('0x4b')][_0xe670('0x4e')];}else if(_0x5f2750[_0xe670('0x4b')]['ChatWebsiteId']){_0x4f7ea3['ChatWebsiteId']=_0x5f2750[_0xe670('0x4b')]['ChatWebsiteId'];}return db[_0xe670('0x31')][_0xe670('0x4a')]({'where':_0x4f7ea3})[_0xe670('0x26')](function(_0x231cf0){if(_0x231cf0){throw new db[(_0xe670('0x4f'))][(_0xe670('0x50'))](_0xe670('0x51'));}return db['CannedAnswer'][_0xe670('0x52')](_0x5f2750[_0xe670('0x4b')]);})['then'](function(_0x4264eb){var _0x4e2c42=_0x5f2750[_0xe670('0x53')][_0xe670('0x54')]({'plain':!![]});if(!_0x4e2c42)throw new Error(_0xe670('0x55'));if(_0x4e2c42[_0xe670('0x56')]===_0xe670('0x53')){var _0x50de2b=_0x4264eb['get']({'plain':!![]});return db[_0xe670('0x57')][_0xe670('0x4a')]({'where':{'name':_0xe670('0x28'),'userProfileId':_0x4e2c42[_0xe670('0x58')]},'raw':!![]})['then'](function(_0x22504e){if(_0x22504e&&_0x22504e[_0xe670('0x59')]===0x0){return db['UserProfileResource'][_0xe670('0x52')]({'name':_0x50de2b[_0xe670('0x2d')],'resourceId':_0x50de2b['id'],'type':_0x22504e['name'],'sectionId':_0x22504e['id']},{})[_0xe670('0x26')](function(){return _0x4264eb;});}else{return _0x4264eb;}})[_0xe670('0x44')](function(_0x5c86bf){logger[_0xe670('0x2b')](_0xe670('0x5a'),_0x5c86bf);throw _0x5c86bf;});}return _0x4264eb;})['then'](respondWithResult(_0x1df3d3,0xc9))['catch'](handleError(_0x1df3d3,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 96fe834..9a6aab1 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 _0x674d=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x159cf1,_0x59bd2a){var _0x366e65=function(_0x504248){while(--_0x504248){_0x159cf1['push'](_0x159cf1['shift']());}};_0x366e65(++_0x59bd2a);}(_0x674d,0xfe));var _0xd674=function(_0x3b7e6f,_0x1565b5){_0x3b7e6f=_0x3b7e6f-0x0;var _0x4873c3=_0x674d[_0x3b7e6f];return _0x4873c3;};'use strict';var _=require(_0xd674('0x0'));var util=require(_0xd674('0x1'));var logger=require(_0xd674('0x2'))(_0xd674('0x3'));var moment=require(_0xd674('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd674('0x5'));var rimraf=require(_0xd674('0x6'));var config=require(_0xd674('0x7'));var attributes=require(_0xd674('0x8'));module[_0xd674('0x9')]=function(_0x51be27,_0x141151){return _0x51be27[_0xd674('0xa')](_0xd674('0xb'),attributes,{'tableName':_0xd674('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd674('0xd'),'collate':_0xd674('0xe')});};
\ No newline at end of file
+var _0xfbae=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x2deed4,_0x2793e8){var _0xfb91f4=function(_0x31cb98){while(--_0x31cb98){_0x2deed4['push'](_0x2deed4['shift']());}};_0xfb91f4(++_0x2793e8);}(_0xfbae,0x17e));var _0xefba=function(_0x1da0d3,_0x32ccc4){_0x1da0d3=_0x1da0d3-0x0;var _0x5ea778=_0xfbae[_0x1da0d3];return _0x5ea778;};'use strict';var _=require(_0xefba('0x0'));var util=require(_0xefba('0x1'));var logger=require(_0xefba('0x2'))(_0xefba('0x3'));var moment=require('moment');var BPromise=require(_0xefba('0x4'));var rp=require(_0xefba('0x5'));var fs=require('fs');var path=require(_0xefba('0x6'));var rimraf=require(_0xefba('0x7'));var config=require(_0xefba('0x8'));var attributes=require(_0xefba('0x9'));module[_0xefba('0xa')]=function(_0x4e83d8,_0x3ba262){return _0x4e83d8[_0xefba('0xb')](_0xefba('0xc'),attributes,{'tableName':_0xefba('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xefba('0xe'),'collate':_0xefba('0xf')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 43ae92f..3d7f5c3 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(_0x4bfed6,_0x4d7e0a){var _0x2e0ca7=function(_0x4a0a87){while(--_0x4a0a87){_0x4bfed6['push'](_0x4bfed6['shift']());}};_0x2e0ca7(++_0x4d7e0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0x33837f,_0x3f9615){var _0x56416d=function(_0x593ecd){while(--_0x593ecd){_0x33837f['push'](_0x33837f['shift']());}};_0x56416d(++_0x3f9615);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 4234bc4..65936eb 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 _0x88ef=['util','connect-timeout','express','Router','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0x88ef,0x1db));var _0xf88e=function(_0x2c78e8,_0x171644){_0x2c78e8=_0x2c78e8-0x0;var _0x3dcc57=_0x88ef[_0x2c78e8];return _0x3dcc57;};'use strict';var multer=require(_0xf88e('0x0'));var util=require(_0xf88e('0x1'));var path=require('path');var timeout=require(_0xf88e('0x2'));var express=require(_0xf88e('0x3'));var router=express[_0xf88e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf88e('0x5'));var config=require('../../config/environment');var controller=require(_0xf88e('0x6'));router['get']('/',auth[_0xf88e('0x7')](),controller[_0xf88e('0x8')]);router['get'](_0xf88e('0x9'),auth[_0xf88e('0x7')](),controller['show']);router[_0xf88e('0xa')]('/',auth[_0xf88e('0x7')](),controller[_0xf88e('0xb')]);router[_0xf88e('0xc')]('/:id',auth[_0xf88e('0x7')](),controller[_0xf88e('0xd')]);router[_0xf88e('0xe')](_0xf88e('0x9'),auth[_0xf88e('0x7')](),controller[_0xf88e('0xf')]);module[_0xf88e('0x10')]=router;
\ No newline at end of file
+var _0x427f=['update','delete','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','put'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x427f,0x18b));var _0xf427=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x427f[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xf427('0x0'));var path=require(_0xf427('0x1'));var timeout=require(_0xf427('0x2'));var express=require(_0xf427('0x3'));var router=express[_0xf427('0x4')]();var fs_extra=require(_0xf427('0x5'));var auth=require(_0xf427('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf427('0x7'));var controller=require('./cannedAnswer.controller');router[_0xf427('0x8')]('/',auth[_0xf427('0x9')](),controller[_0xf427('0xa')]);router[_0xf427('0x8')]('/:id',auth[_0xf427('0x9')](),controller[_0xf427('0xb')]);router['post']('/',auth[_0xf427('0x9')](),controller['create']);router[_0xf427('0xc')]('/:id',auth[_0xf427('0x9')](),controller[_0xf427('0xd')]);router[_0xf427('0xe')](_0xf427('0xf'),auth[_0xf427('0x9')](),controller['destroy']);module[_0xf427('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 330ec20..1a7bdfc 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 _0xb7f1=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x244f60,_0x251eb1){var _0x40d2a3=function(_0x334506){while(--_0x334506){_0x244f60['push'](_0x244f60['shift']());}};_0x40d2a3(++_0x251eb1);}(_0xb7f1,0xdc));var _0x1b7f=function(_0x34a7db,_0x41e361){_0x34a7db=_0x34a7db-0x0;var _0x4c6716=_0xb7f1[_0x34a7db];return _0x4c6716;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x1b7f('0x0')],'allowNull':![],'defaultValue':_0x1b7f('0x1')},'clid':{'type':Sequelize[_0x1b7f('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x1b7f('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x1b7f('0x2')]},'lastapp':{'type':Sequelize[_0x1b7f('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x1b7f('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1b7f('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1b7f('0x2')]},'amaflags':{'type':Sequelize[_0x1b7f('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1b7f('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1b7f('0x2')]},'linkedid':{'type':Sequelize[_0x1b7f('0x2')]},'sequence':{'type':Sequelize[_0x1b7f('0x2')]},'peeraccount':{'type':Sequelize[_0x1b7f('0x2')]},'type':{'type':Sequelize[_0x1b7f('0x2')]},'tag':{'type':Sequelize[_0x1b7f('0x2')]}};
\ No newline at end of file
+var _0x4edf=['STRING','INTEGER','sequelize','exports'];(function(_0x4e259a,_0x3b2e75){var _0x546de4=function(_0xde421){while(--_0xde421){_0x4e259a['push'](_0x4e259a['shift']());}};_0x546de4(++_0x3b2e75);}(_0x4edf,0x196));var _0xf4ed=function(_0x3b76f7,_0x566c53){_0x3b76f7=_0x3b76f7-0x0;var _0x43984e=_0x4edf[_0x3b76f7];return _0x43984e;};'use strict';var Sequelize=require(_0xf4ed('0x0'));module[_0xf4ed('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xf4ed('0x2')]},'src':{'type':Sequelize[_0xf4ed('0x2')]},'dst':{'type':Sequelize[_0xf4ed('0x2')]},'dcontext':{'type':Sequelize[_0xf4ed('0x2')]},'channel':{'type':Sequelize[_0xf4ed('0x2')]},'dstchannel':{'type':Sequelize[_0xf4ed('0x2')]},'lastapp':{'type':Sequelize[_0xf4ed('0x2')]},'lastdata':{'type':Sequelize[_0xf4ed('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf4ed('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf4ed('0x2')]},'amaflags':{'type':Sequelize[_0xf4ed('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf4ed('0x2')]},'userfield':{'type':Sequelize[_0xf4ed('0x2')]},'uniqueid':{'type':Sequelize[_0xf4ed('0x2')]},'linkedid':{'type':Sequelize[_0xf4ed('0x2')]},'sequence':{'type':Sequelize[_0xf4ed('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf4ed('0x2')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 679e00a..620933e 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 _0x7f42=['key','query','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','Cdr','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type'];(function(_0x1e33fb,_0x3b3cb2){var _0x551faf=function(_0x10ae66){while(--_0x10ae66){_0x1e33fb['push'](_0x1e33fb['shift']());}};_0x551faf(++_0x3b3cb2);}(_0x7f42,0x1dd));var _0x27f4=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7f42[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x27f4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x27f4('0x1'));var jsonpatch=require(_0x27f4('0x2'));var rp=require('request-promise');var moment=require(_0x27f4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x27f4('0x4'));var util=require('util');var path=require(_0x27f4('0x5'));var sox=require('sox');var csv=require(_0x27f4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27f4('0x7'));var _=require(_0x27f4('0x8'));var squel=require(_0x27f4('0x9'));var crypto=require(_0x27f4('0xa'));var jsforce=require(_0x27f4('0xb'));var deskjs=require(_0x27f4('0xc'));var toCsv=require(_0x27f4('0x6'));var querystring=require(_0x27f4('0xd'));var Papa=require(_0x27f4('0xe'));var Redis=require(_0x27f4('0xf'));var authService=require(_0x27f4('0x10'));var qs=require(_0x27f4('0x11'));var as=require(_0x27f4('0x12'));var hardwareService=require(_0x27f4('0x13'));var logger=require(_0x27f4('0x14'))(_0x27f4('0x15'));var utils=require(_0x27f4('0x16'));var config=require(_0x27f4('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e0941,_0x1347ea){_0x1347ea=_0x1347ea||0xcc;return function(_0x27cdaa){if(_0x27cdaa){return _0x1e0941[_0x27f4('0x18')](_0x1347ea);}return _0x1e0941[_0x27f4('0x19')](_0x1347ea)[_0x27f4('0x1a')]();};}function respondWithResult(_0x14f82e,_0x40393e){_0x40393e=_0x40393e||0xc8;return function(_0x5cd1bd){if(_0x5cd1bd){return _0x14f82e['status'](_0x40393e)[_0x27f4('0x1b')](_0x5cd1bd);}};}function respondWithFilteredResult(_0x39c39c,_0x10f24a){return function(_0x2e8264){if(_0x2e8264){var _0x4e0e5b=typeof _0x10f24a[_0x27f4('0x1c')]===_0x27f4('0x1d')&&typeof _0x10f24a[_0x27f4('0x1e')]==='undefined';var _0x3203af=_0x2e8264[_0x27f4('0x1f')];var _0x43203e=_0x4e0e5b?0x0:_0x10f24a['offset'];var _0x4f4c1d=_0x4e0e5b?_0x2e8264[_0x27f4('0x1f')]:_0x10f24a['offset']+_0x10f24a['limit'];var _0x3c287a;if(_0x4f4c1d>=_0x3203af){_0x4f4c1d=_0x3203af;_0x3c287a=0xc8;}else{_0x3c287a=0xce;}_0x39c39c[_0x27f4('0x19')](_0x3c287a);return _0x39c39c[_0x27f4('0x20')](_0x27f4('0x21'),_0x43203e+'-'+_0x4f4c1d+'/'+_0x3203af)[_0x27f4('0x1b')](_0x2e8264);}return null;};}function patchUpdates(_0x575af4){return function(_0x28e88c){try{jsonpatch[_0x27f4('0x22')](_0x28e88c,_0x575af4,!![]);}catch(_0x235648){return BPromise[_0x27f4('0x23')](_0x235648);}return _0x28e88c[_0x27f4('0x24')]();};}function saveUpdates(_0x23f465,_0x22f794){return function(_0x4035f4){if(_0x4035f4){return _0x4035f4[_0x27f4('0x25')](_0x23f465)['then'](function(_0xe69de0){return _0xe69de0;});}return null;};}function removeEntity(_0x112803,_0x202e8f){return function(_0x3e1dca){if(_0x3e1dca){return _0x3e1dca[_0x27f4('0x26')]()[_0x27f4('0x27')](function(){_0x112803[_0x27f4('0x19')](0xcc)[_0x27f4('0x1a')]();});}};}function handleEntityNotFound(_0x328123,_0x34c943){return function(_0x2fe71b){if(!_0x2fe71b){_0x328123[_0x27f4('0x18')](0x194);}return _0x2fe71b;};}function handleError(_0x167574,_0x400d8d){_0x400d8d=_0x400d8d||0x1f4;return function(_0x2b9e38){logger[_0x27f4('0x28')](_0x2b9e38[_0x27f4('0x29')]);if(_0x2b9e38['name']){delete _0x2b9e38[_0x27f4('0x2a')];}_0x167574['status'](_0x400d8d)[_0x27f4('0x2b')](_0x2b9e38);};}exports[_0x27f4('0x2c')]=function(_0x9c39b9,_0x48beb5){var _0x38eb1c={},_0x351dba={},_0x4874f2={'count':0x0,'rows':[]};var _0x350767=_[_0x27f4('0x2d')](db['Cdr'][_0x27f4('0x2e')],function(_0x2079fb){return{'name':_0x2079fb['fieldName'],'type':_0x2079fb[_0x27f4('0x2f')][_0x27f4('0x30')]};});_0x351dba['model']=_[_0x27f4('0x2d')](_0x350767,_0x27f4('0x2a'));_0x351dba[_0x27f4('0x31')]=_['keys'](_0x9c39b9['query']);_0x351dba['filters']=_['intersection'](_0x351dba[_0x27f4('0x32')],_0x351dba[_0x27f4('0x31')]);_0x38eb1c[_0x27f4('0x33')]=_[_0x27f4('0x34')](_0x351dba[_0x27f4('0x32')],qs[_0x27f4('0x35')](_0x9c39b9[_0x27f4('0x31')][_0x27f4('0x35')]));_0x38eb1c[_0x27f4('0x33')]=_0x38eb1c[_0x27f4('0x33')][_0x27f4('0x36')]?_0x38eb1c['attributes']:_0x351dba[_0x27f4('0x32')];if(!_0x9c39b9[_0x27f4('0x31')][_0x27f4('0x37')]('nolimit')){_0x38eb1c[_0x27f4('0x1e')]=qs[_0x27f4('0x1e')](_0x9c39b9[_0x27f4('0x31')][_0x27f4('0x1e')]);_0x38eb1c[_0x27f4('0x1c')]=qs[_0x27f4('0x1c')](_0x9c39b9[_0x27f4('0x31')][_0x27f4('0x1c')]);}_0x38eb1c[_0x27f4('0x38')]=qs[_0x27f4('0x39')](_0x9c39b9[_0x27f4('0x31')][_0x27f4('0x39')]);_0x38eb1c[_0x27f4('0x3a')]=qs[_0x27f4('0x3b')](_[_0x27f4('0x3c')](_0x9c39b9[_0x27f4('0x31')],_0x351dba['filters']),_0x350767);if(_0x9c39b9['query'][_0x27f4('0x3d')]){_0x38eb1c[_0x27f4('0x3a')]=_[_0x27f4('0x3e')](_0x38eb1c['where'],{'$or':_[_0x27f4('0x2d')](_0x350767,function(_0x32e794){if(_0x32e794[_0x27f4('0x2f')]!=='VIRTUAL'){var _0x3c7bef={};_0x3c7bef[_0x32e794[_0x27f4('0x2a')]]={'$like':'%'+_0x9c39b9['query'][_0x27f4('0x3d')]+'%'};return _0x3c7bef;}})});}_0x38eb1c=_[_0x27f4('0x3e')]({},_0x38eb1c,_0x9c39b9[_0x27f4('0x3f')]);var _0x1dbe8b={'where':_0x38eb1c[_0x27f4('0x3a')]};return db['Cdr'][_0x27f4('0x1f')](_0x1dbe8b)[_0x27f4('0x27')](function(_0x441a1b){_0x4874f2[_0x27f4('0x1f')]=_0x441a1b;if(_0x9c39b9['query'][_0x27f4('0x40')]){_0x38eb1c[_0x27f4('0x41')]=[{'all':!![]}];}return db[_0x27f4('0x42')]['findAll'](_0x38eb1c);})[_0x27f4('0x27')](function(_0x5c895f){_0x4874f2[_0x27f4('0x43')]=_0x5c895f;return _0x4874f2;})[_0x27f4('0x27')](respondWithFilteredResult(_0x48beb5,_0x38eb1c))[_0x27f4('0x44')](handleError(_0x48beb5,null));};exports[_0x27f4('0x45')]=function(_0x4a33a4,_0x290c58){var _0x3f7051={'raw':!![],'where':{'id':_0x4a33a4[_0x27f4('0x46')]['id']}},_0x28fc2d={};_0x28fc2d[_0x27f4('0x32')]=_['keys'](db[_0x27f4('0x42')]['rawAttributes']);_0x28fc2d['query']=_['keys'](_0x4a33a4[_0x27f4('0x31')]);_0x28fc2d[_0x27f4('0x3b')]=_[_0x27f4('0x34')](_0x28fc2d[_0x27f4('0x32')],_0x28fc2d['query']);_0x3f7051[_0x27f4('0x33')]=_[_0x27f4('0x34')](_0x28fc2d[_0x27f4('0x32')],qs[_0x27f4('0x35')](_0x4a33a4['query']['fields']));_0x3f7051[_0x27f4('0x33')]=_0x3f7051[_0x27f4('0x33')][_0x27f4('0x36')]?_0x3f7051[_0x27f4('0x33')]:_0x28fc2d['model'];if(_0x4a33a4[_0x27f4('0x31')]['includeAll']){_0x3f7051['include']=[{'all':!![]}];}_0x3f7051=_['merge']({},_0x3f7051,_0x4a33a4[_0x27f4('0x3f')]);return db['Cdr'][_0x27f4('0x47')](_0x3f7051)[_0x27f4('0x27')](handleEntityNotFound(_0x290c58,null))['then'](respondWithResult(_0x290c58,null))[_0x27f4('0x44')](handleError(_0x290c58,null));};exports[_0x27f4('0x48')]=function(_0x4f0f90,_0x1f424a){return db[_0x27f4('0x42')][_0x27f4('0x48')](_0x4f0f90[_0x27f4('0x49')],{})[_0x27f4('0x27')](respondWithResult(_0x1f424a,0xc9))[_0x27f4('0x44')](handleError(_0x1f424a,null));};exports[_0x27f4('0x25')]=function(_0x3d4973,_0x505d5a){if(_0x3d4973[_0x27f4('0x49')]['id']){delete _0x3d4973['body']['id'];}return db[_0x27f4('0x42')][_0x27f4('0x47')]({'where':{'id':_0x3d4973[_0x27f4('0x46')]['id']}})['then'](handleEntityNotFound(_0x505d5a,null))['then'](saveUpdates(_0x3d4973[_0x27f4('0x49')],null))[_0x27f4('0x27')](respondWithResult(_0x505d5a,null))['catch'](handleError(_0x505d5a,null));};exports[_0x27f4('0x26')]=function(_0x4a0801,_0x4714df){return db[_0x27f4('0x42')][_0x27f4('0x47')]({'where':{'id':_0x4a0801[_0x27f4('0x46')]['id']}})[_0x27f4('0x27')](handleEntityNotFound(_0x4714df,null))[_0x27f4('0x27')](removeEntity(_0x4714df,null))[_0x27f4('0x44')](handleError(_0x4714df,null));};exports['describe']=function(_0x4ef06c,_0x1d3284){return db['Cdr'][_0x27f4('0x4a')]()[_0x27f4('0x27')](respondWithResult(_0x1d3284,null))['catch'](handleError(_0x1d3284,null));};
\ No newline at end of file
+var _0xc818=['rows','catch','show','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','findAll'];(function(_0x453da4,_0x25271c){var _0x45f433=function(_0x430f46){while(--_0x430f46){_0x453da4['push'](_0x453da4['shift']());}};_0x45f433(++_0x25271c);}(_0xc818,0x1e3));var _0x8c81=function(_0x438987,_0x133b85){_0x438987=_0x438987-0x0;var _0xffcbd8=_0xc818[_0x438987];return _0xffcbd8;};'use strict';var emlformat=require(_0x8c81('0x0'));var rimraf=require(_0x8c81('0x1'));var zipdir=require(_0x8c81('0x2'));var jsonpatch=require(_0x8c81('0x3'));var rp=require('request-promise');var moment=require(_0x8c81('0x4'));var BPromise=require(_0x8c81('0x5'));var Mustache=require(_0x8c81('0x6'));var util=require(_0x8c81('0x7'));var path=require(_0x8c81('0x8'));var sox=require(_0x8c81('0x9'));var csv=require(_0x8c81('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c81('0xb'));var _=require(_0x8c81('0xc'));var squel=require(_0x8c81('0xd'));var crypto=require(_0x8c81('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8c81('0xf'));var toCsv=require(_0x8c81('0xa'));var querystring=require(_0x8c81('0x10'));var Papa=require(_0x8c81('0x11'));var Redis=require(_0x8c81('0x12'));var authService=require(_0x8c81('0x13'));var qs=require(_0x8c81('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c81('0x15'));var logger=require(_0x8c81('0x16'))(_0x8c81('0x17'));var utils=require(_0x8c81('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8c81('0x19'));var db=require(_0x8c81('0x1a'))['db'];function respondWithStatusCode(_0x63f11f,_0x31ff3f){_0x31ff3f=_0x31ff3f||0xcc;return function(_0x2a945d){if(_0x2a945d){return _0x63f11f[_0x8c81('0x1b')](_0x31ff3f);}return _0x63f11f[_0x8c81('0x1c')](_0x31ff3f)[_0x8c81('0x1d')]();};}function respondWithResult(_0x1500cc,_0x5a6e72){_0x5a6e72=_0x5a6e72||0xc8;return function(_0x4bb8ee){if(_0x4bb8ee){return _0x1500cc[_0x8c81('0x1c')](_0x5a6e72)[_0x8c81('0x1e')](_0x4bb8ee);}};}function respondWithFilteredResult(_0x238ce5,_0x4fa5){return function(_0xf1682e){if(_0xf1682e){var _0x3e59e3=typeof _0x4fa5['offset']===_0x8c81('0x1f')&&typeof _0x4fa5[_0x8c81('0x20')]===_0x8c81('0x1f');var _0x1fc95b=_0xf1682e[_0x8c81('0x21')];var _0x5c09f3=_0x3e59e3?0x0:_0x4fa5[_0x8c81('0x22')];var _0x4d0b75=_0x3e59e3?_0xf1682e['count']:_0x4fa5['offset']+_0x4fa5[_0x8c81('0x20')];var _0x13e312;if(_0x4d0b75>=_0x1fc95b){_0x4d0b75=_0x1fc95b;_0x13e312=0xc8;}else{_0x13e312=0xce;}_0x238ce5[_0x8c81('0x1c')](_0x13e312);return _0x238ce5['set'](_0x8c81('0x23'),_0x5c09f3+'-'+_0x4d0b75+'/'+_0x1fc95b)[_0x8c81('0x1e')](_0xf1682e);}return null;};}function patchUpdates(_0x348d79){return function(_0x4e4de3){try{jsonpatch[_0x8c81('0x24')](_0x4e4de3,_0x348d79,!![]);}catch(_0x16c71a){return BPromise['reject'](_0x16c71a);}return _0x4e4de3[_0x8c81('0x25')]();};}function saveUpdates(_0x31c4a2,_0x4bc287){return function(_0x566cfc){if(_0x566cfc){return _0x566cfc[_0x8c81('0x26')](_0x31c4a2)[_0x8c81('0x27')](function(_0xfaf3d9){return _0xfaf3d9;});}return null;};}function removeEntity(_0x49cedc,_0x8c399c){return function(_0x46f558){if(_0x46f558){return _0x46f558[_0x8c81('0x28')]()[_0x8c81('0x27')](function(){_0x49cedc[_0x8c81('0x1c')](0xcc)[_0x8c81('0x1d')]();});}};}function handleEntityNotFound(_0x2fcf75,_0x44999d){return function(_0x4bfa48){if(!_0x4bfa48){_0x2fcf75['sendStatus'](0x194);}return _0x4bfa48;};}function handleError(_0x255dcb,_0x1ee94c){_0x1ee94c=_0x1ee94c||0x1f4;return function(_0x2b9df6){logger[_0x8c81('0x29')](_0x2b9df6[_0x8c81('0x2a')]);if(_0x2b9df6[_0x8c81('0x2b')]){delete _0x2b9df6[_0x8c81('0x2b')];}_0x255dcb[_0x8c81('0x1c')](_0x1ee94c)[_0x8c81('0x2c')](_0x2b9df6);};}exports[_0x8c81('0x2d')]=function(_0x477a9e,_0x35901a){var _0x34dd6b={},_0x59c7e8={},_0x1d73ac={'count':0x0,'rows':[]};var _0xc9de87=_[_0x8c81('0x2e')](db[_0x8c81('0x2f')][_0x8c81('0x30')],function(_0x3b9527){return{'name':_0x3b9527[_0x8c81('0x31')],'type':_0x3b9527[_0x8c81('0x32')][_0x8c81('0x33')]};});_0x59c7e8['model']=_[_0x8c81('0x2e')](_0xc9de87,_0x8c81('0x2b'));_0x59c7e8[_0x8c81('0x34')]=_[_0x8c81('0x35')](_0x477a9e[_0x8c81('0x34')]);_0x59c7e8['filters']=_[_0x8c81('0x36')](_0x59c7e8[_0x8c81('0x37')],_0x59c7e8[_0x8c81('0x34')]);_0x34dd6b[_0x8c81('0x38')]=_[_0x8c81('0x36')](_0x59c7e8['model'],qs['fields'](_0x477a9e[_0x8c81('0x34')][_0x8c81('0x39')]));_0x34dd6b[_0x8c81('0x38')]=_0x34dd6b['attributes'][_0x8c81('0x3a')]?_0x34dd6b[_0x8c81('0x38')]:_0x59c7e8[_0x8c81('0x37')];if(!_0x477a9e[_0x8c81('0x34')]['hasOwnProperty'](_0x8c81('0x3b'))){_0x34dd6b[_0x8c81('0x20')]=qs['limit'](_0x477a9e[_0x8c81('0x34')]['limit']);_0x34dd6b['offset']=qs[_0x8c81('0x22')](_0x477a9e[_0x8c81('0x34')][_0x8c81('0x22')]);}_0x34dd6b[_0x8c81('0x3c')]=qs['sort'](_0x477a9e[_0x8c81('0x34')][_0x8c81('0x3d')]);_0x34dd6b[_0x8c81('0x3e')]=qs['filters'](_['pick'](_0x477a9e[_0x8c81('0x34')],_0x59c7e8[_0x8c81('0x3f')]),_0xc9de87);if(_0x477a9e[_0x8c81('0x34')]['filter']){_0x34dd6b[_0x8c81('0x3e')]=_['merge'](_0x34dd6b['where'],{'$or':_['map'](_0xc9de87,function(_0x3f4459){if(_0x3f4459['type']!==_0x8c81('0x40')){var _0x498f25={};_0x498f25[_0x3f4459['name']]={'$like':'%'+_0x477a9e[_0x8c81('0x34')][_0x8c81('0x41')]+'%'};return _0x498f25;}})});}_0x34dd6b=_[_0x8c81('0x42')]({},_0x34dd6b,_0x477a9e[_0x8c81('0x43')]);var _0x1e070d={'where':_0x34dd6b[_0x8c81('0x3e')]};return db[_0x8c81('0x2f')]['count'](_0x1e070d)[_0x8c81('0x27')](function(_0x15e499){_0x1d73ac[_0x8c81('0x21')]=_0x15e499;if(_0x477a9e[_0x8c81('0x34')][_0x8c81('0x44')]){_0x34dd6b['include']=[{'all':!![]}];}return db[_0x8c81('0x2f')][_0x8c81('0x45')](_0x34dd6b);})[_0x8c81('0x27')](function(_0x225955){_0x1d73ac[_0x8c81('0x46')]=_0x225955;return _0x1d73ac;})[_0x8c81('0x27')](respondWithFilteredResult(_0x35901a,_0x34dd6b))[_0x8c81('0x47')](handleError(_0x35901a,null));};exports[_0x8c81('0x48')]=function(_0x4d3d89,_0x287794){var _0xae952a={'raw':!![],'where':{'id':_0x4d3d89['params']['id']}},_0xc7871={};_0xc7871['model']=_[_0x8c81('0x35')](db[_0x8c81('0x2f')][_0x8c81('0x30')]);_0xc7871[_0x8c81('0x34')]=_[_0x8c81('0x35')](_0x4d3d89[_0x8c81('0x34')]);_0xc7871[_0x8c81('0x3f')]=_['intersection'](_0xc7871['model'],_0xc7871[_0x8c81('0x34')]);_0xae952a[_0x8c81('0x38')]=_[_0x8c81('0x36')](_0xc7871[_0x8c81('0x37')],qs[_0x8c81('0x39')](_0x4d3d89[_0x8c81('0x34')][_0x8c81('0x39')]));_0xae952a['attributes']=_0xae952a[_0x8c81('0x38')][_0x8c81('0x3a')]?_0xae952a[_0x8c81('0x38')]:_0xc7871[_0x8c81('0x37')];if(_0x4d3d89['query']['includeAll']){_0xae952a[_0x8c81('0x49')]=[{'all':!![]}];}_0xae952a=_[_0x8c81('0x42')]({},_0xae952a,_0x4d3d89[_0x8c81('0x43')]);return db[_0x8c81('0x2f')][_0x8c81('0x4a')](_0xae952a)[_0x8c81('0x27')](handleEntityNotFound(_0x287794,null))[_0x8c81('0x27')](respondWithResult(_0x287794,null))[_0x8c81('0x47')](handleError(_0x287794,null));};exports[_0x8c81('0x4b')]=function(_0x155d9c,_0x9a46e5){return db[_0x8c81('0x2f')][_0x8c81('0x4b')](_0x155d9c[_0x8c81('0x4c')],{})[_0x8c81('0x27')](respondWithResult(_0x9a46e5,0xc9))[_0x8c81('0x47')](handleError(_0x9a46e5,null));};exports[_0x8c81('0x26')]=function(_0x25b569,_0x39dbc8){if(_0x25b569[_0x8c81('0x4c')]['id']){delete _0x25b569[_0x8c81('0x4c')]['id'];}return db['Cdr'][_0x8c81('0x4a')]({'where':{'id':_0x25b569[_0x8c81('0x4d')]['id']}})['then'](handleEntityNotFound(_0x39dbc8,null))[_0x8c81('0x27')](saveUpdates(_0x25b569[_0x8c81('0x4c')],null))[_0x8c81('0x27')](respondWithResult(_0x39dbc8,null))['catch'](handleError(_0x39dbc8,null));};exports[_0x8c81('0x28')]=function(_0x25b5f9,_0x13638c){return db['Cdr']['find']({'where':{'id':_0x25b5f9[_0x8c81('0x4d')]['id']}})[_0x8c81('0x27')](handleEntityNotFound(_0x13638c,null))[_0x8c81('0x27')](removeEntity(_0x13638c,null))['catch'](handleError(_0x13638c,null));};exports[_0x8c81('0x4e')]=function(_0xc4fa7e,_0x25124d){return db[_0x8c81('0x2f')][_0x8c81('0x4e')]()[_0x8c81('0x27')](respondWithResult(_0x25124d,null))[_0x8c81('0x47')](handleError(_0x25124d,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 88a7b5e..b4da12c 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(_0xcc6f99,_0x4445e7){var _0x4dd524=function(_0x32f668){while(--_0x32f668){_0xcc6f99['push'](_0xcc6f99['shift']());}};_0x4dd524(++_0x4445e7);}(_0x7a54,0x106));var _0x47a5=function(_0x495ea0,_0x554044){_0x495ea0=_0x495ea0-0x0;var _0xbc7642=_0x7a54[_0x495ea0];return _0xbc7642;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x2a49ed,_0x264ab2){var _0x327521=function(_0x54544e){while(--_0x54544e){_0x2a49ed['push'](_0x2a49ed['shift']());}};_0x327521(++_0x264ab2);}(_0x7a54,0x106));var _0x47a5=function(_0x5baa38,_0x1d8275){_0x5baa38=_0x5baa38-0x0;var _0x28fdb6=_0x7a54[_0x5baa38];return _0x28fdb6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 307c639..2b8e1c1 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 _0x1a70=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','request\x20sent','debug','stringify','code','error','message','Cdr,\x20%s,\x20%s','result','lodash','util'];(function(_0x9acc24,_0x3b3a36){var _0xc17b7e=function(_0x1df677){while(--_0x1df677){_0x9acc24['push'](_0x9acc24['shift']());}};_0xc17b7e(++_0x3b3a36);}(_0x1a70,0xc6));var _0x01a7=function(_0xd53b14,_0x54d7e7){_0xd53b14=_0xd53b14-0x0;var _0x542de3=_0x1a70[_0xd53b14];return _0x542de3;};'use strict';var _=require(_0x01a7('0x0'));var util=require(_0x01a7('0x1'));var moment=require('moment');var BPromise=require(_0x01a7('0x2'));var rs=require(_0x01a7('0x3'));var fs=require('fs');var Redis=require(_0x01a7('0x4'));var db=require(_0x01a7('0x5'))['db'];var utils=require(_0x01a7('0x6'));var logger=require(_0x01a7('0x7'))('rpc');var config=require(_0x01a7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x01a7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19ad78,_0x53f543,_0x19c5a6){return new BPromise(function(_0x14c712,_0x3ceef2){return client[_0x01a7('0xa')](_0x19ad78,_0x19c5a6)[_0x01a7('0xb')](function(_0x11f09c){logger['info']('Cdr,\x20%s,\x20%s',_0x53f543,_0x01a7('0xc'));logger[_0x01a7('0xd')]('Cdr,\x20%s,\x20%s,\x20%s',_0x53f543,_0x01a7('0xc'),JSON[_0x01a7('0xe')](_0x11f09c));if(_0x11f09c['error']){if(_0x11f09c['error'][_0x01a7('0xf')]===0x1f4){logger[_0x01a7('0x10')]('Cdr,\x20%s,\x20%s',_0x53f543,_0x11f09c[_0x01a7('0x10')][_0x01a7('0x11')]);return _0x3ceef2(_0x11f09c['error'][_0x01a7('0x11')]);}logger[_0x01a7('0x10')]('Cdr,\x20%s,\x20%s',_0x53f543,_0x11f09c[_0x01a7('0x10')][_0x01a7('0x11')]);return _0x14c712(_0x11f09c['error'][_0x01a7('0x11')]);}else{logger['info'](_0x01a7('0x12'),_0x53f543,'request\x20sent');_0x14c712(_0x11f09c[_0x01a7('0x13')][_0x01a7('0x11')]);}})['catch'](function(_0x430ee0){logger[_0x01a7('0x10')](_0x01a7('0x12'),_0x53f543,_0x430ee0);_0x3ceef2(_0x430ee0);});});}
\ No newline at end of file
+var _0xebc4=['error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x8b2a7f,_0x5987a7){var _0x2116e4=function(_0x4dcaf1){while(--_0x4dcaf1){_0x8b2a7f['push'](_0x8b2a7f['shift']());}};_0x2116e4(++_0x5987a7);}(_0xebc4,0x1e8));var _0x4ebc=function(_0x5f746f,_0x5b05ab){_0x5f746f=_0x5f746f-0x0;var _0x198d15=_0xebc4[_0x5f746f];return _0x198d15;};'use strict';var _=require(_0x4ebc('0x0'));var util=require(_0x4ebc('0x1'));var moment=require(_0x4ebc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ebc('0x3'));var db=require(_0x4ebc('0x4'))['db'];var utils=require(_0x4ebc('0x5'));var logger=require(_0x4ebc('0x6'))(_0x4ebc('0x7'));var config=require(_0x4ebc('0x8'));var jayson=require(_0x4ebc('0x9'));var client=jayson[_0x4ebc('0xa')][_0x4ebc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33e841,_0x28709a,_0x480323){return new BPromise(function(_0xabf50d,_0x4cd69b){return client['request'](_0x33e841,_0x480323)[_0x4ebc('0xc')](function(_0x1d077a){logger[_0x4ebc('0xd')](_0x4ebc('0xe'),_0x28709a,_0x4ebc('0xf'));logger['debug'](_0x4ebc('0x10'),_0x28709a,_0x4ebc('0xf'),JSON[_0x4ebc('0x11')](_0x1d077a));if(_0x1d077a[_0x4ebc('0x12')]){if(_0x1d077a[_0x4ebc('0x12')][_0x4ebc('0x13')]===0x1f4){logger['error'](_0x4ebc('0xe'),_0x28709a,_0x1d077a['error'][_0x4ebc('0x14')]);return _0x4cd69b(_0x1d077a[_0x4ebc('0x12')][_0x4ebc('0x14')]);}logger[_0x4ebc('0x12')](_0x4ebc('0xe'),_0x28709a,_0x1d077a[_0x4ebc('0x12')][_0x4ebc('0x14')]);return _0xabf50d(_0x1d077a[_0x4ebc('0x12')]['message']);}else{logger[_0x4ebc('0xd')](_0x4ebc('0xe'),_0x28709a,_0x4ebc('0xf'));_0xabf50d(_0x1d077a[_0x4ebc('0x15')]['message']);}})['catch'](function(_0xf60397){logger[_0x4ebc('0x12')](_0x4ebc('0xe'),_0x28709a,_0xf60397);_0x4cd69b(_0xf60397);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 668afb3..6b2548b 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2bb6dd,_0x252667){var _0x2a07dc=function(_0x1b6693){while(--_0x1b6693){_0x2bb6dd['push'](_0x2bb6dd['shift']());}};_0x2a07dc(++_0x252667);}(_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 be57d72..9a41e11 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 _0x1752=['STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x5d62b8,_0x123ab0){var _0x13cc08=function(_0x16fc1c){while(--_0x16fc1c){_0x5d62b8['push'](_0x5d62b8['shift']());}};_0x13cc08(++_0x123ab0);}(_0x1752,0xd0));var _0x2175=function(_0x2dd3c4,_0x5b2819){_0x2dd3c4=_0x2dd3c4-0x0;var _0x21c45e=_0x1752[_0x2dd3c4];return _0x21c45e;};'use strict';var Sequelize=require(_0x2175('0x0'));module[_0x2175('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2175('0x2')],'allowNull':![],'defaultValue':_0x2175('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x2175('0x2')]},'interval':{'type':Sequelize[_0x2175('0x2')],'defaultValue':_0x2175('0x4')}};
\ No newline at end of file
+var _0x617f=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0xd73548,_0x5a2c88){var _0x5c42e4=function(_0x896228){while(--_0x896228){_0xd73548['push'](_0xd73548['shift']());}};_0x5c42e4(++_0x5a2c88);}(_0x617f,0xa5));var _0xf617=function(_0x417155,_0x3d0491){_0x417155=_0x417155-0x0;var _0x267ce8=_0x617f[_0x417155];return _0x267ce8;};'use strict';var Sequelize=require(_0xf617('0x0'));module[_0xf617('0x1')]={'priority':{'type':Sequelize[_0xf617('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf617('0x3')],'allowNull':![],'defaultValue':_0xf617('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf617('0x3')],'defaultValue':_0xf617('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 2fcc1bc..9220713 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 _0xb12d=['request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','update','then','destroy','error','name','send','show','model','keys','ChatApplication','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','catch','params','eml-format','rimraf','zip-dir'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0xb12d,0x124));var _0xdb12=function(_0x380307,_0x440ccd){_0x380307=_0x380307-0x0;var _0x9ea14b=_0xb12d[_0x380307];return _0x9ea14b;};'use strict';var emlformat=require(_0xdb12('0x0'));var rimraf=require(_0xdb12('0x1'));var zipdir=require(_0xdb12('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb12('0x3'));var moment=require('moment');var BPromise=require(_0xdb12('0x4'));var Mustache=require(_0xdb12('0x5'));var util=require(_0xdb12('0x6'));var path=require(_0xdb12('0x7'));var sox=require(_0xdb12('0x8'));var csv=require(_0xdb12('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb12('0xa'));var _=require(_0xdb12('0xb'));var squel=require(_0xdb12('0xc'));var crypto=require(_0xdb12('0xd'));var jsforce=require(_0xdb12('0xe'));var deskjs=require(_0xdb12('0xf'));var toCsv=require(_0xdb12('0x9'));var querystring=require(_0xdb12('0x10'));var Papa=require('papaparse');var Redis=require(_0xdb12('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdb12('0x12'));var as=require(_0xdb12('0x13'));var hardwareService=require(_0xdb12('0x14'));var logger=require('../../config/logger')(_0xdb12('0x15'));var utils=require(_0xdb12('0x16'));var config=require(_0xdb12('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb12('0x18'))['db'];function respondWithStatusCode(_0x588a94,_0x3f607f){_0x3f607f=_0x3f607f||0xcc;return function(_0x127a69){if(_0x127a69){return _0x588a94[_0xdb12('0x19')](_0x3f607f);}return _0x588a94['status'](_0x3f607f)[_0xdb12('0x1a')]();};}function respondWithResult(_0x2e39b3,_0x55d032){_0x55d032=_0x55d032||0xc8;return function(_0x44b39c){if(_0x44b39c){return _0x2e39b3['status'](_0x55d032)[_0xdb12('0x1b')](_0x44b39c);}};}function respondWithFilteredResult(_0xdaa517,_0x54a745){return function(_0x1dc8b8){if(_0x1dc8b8){var _0x4325a9=typeof _0x54a745[_0xdb12('0x1c')]===_0xdb12('0x1d')&&typeof _0x54a745['limit']==='undefined';var _0x3ed16a=_0x1dc8b8[_0xdb12('0x1e')];var _0x506a6e=_0x4325a9?0x0:_0x54a745[_0xdb12('0x1c')];var _0x3e2e70=_0x4325a9?_0x1dc8b8[_0xdb12('0x1e')]:_0x54a745[_0xdb12('0x1c')]+_0x54a745[_0xdb12('0x1f')];var _0x1d5f77;if(_0x3e2e70>=_0x3ed16a){_0x3e2e70=_0x3ed16a;_0x1d5f77=0xc8;}else{_0x1d5f77=0xce;}_0xdaa517[_0xdb12('0x20')](_0x1d5f77);return _0xdaa517[_0xdb12('0x21')](_0xdb12('0x22'),_0x506a6e+'-'+_0x3e2e70+'/'+_0x3ed16a)[_0xdb12('0x1b')](_0x1dc8b8);}return null;};}function patchUpdates(_0x25ed7a){return function(_0x3aaafc){try{jsonpatch[_0xdb12('0x23')](_0x3aaafc,_0x25ed7a,!![]);}catch(_0x11d0ab){return BPromise[_0xdb12('0x24')](_0x11d0ab);}return _0x3aaafc['save']();};}function saveUpdates(_0x472e74,_0x2ae3c9){return function(_0x20aecf){if(_0x20aecf){return _0x20aecf[_0xdb12('0x25')](_0x472e74)[_0xdb12('0x26')](function(_0x334251){return _0x334251;});}return null;};}function removeEntity(_0x9dc121,_0x32190c){return function(_0x3ae83a){if(_0x3ae83a){return _0x3ae83a[_0xdb12('0x27')]()[_0xdb12('0x26')](function(){_0x9dc121[_0xdb12('0x20')](0xcc)[_0xdb12('0x1a')]();});}};}function handleEntityNotFound(_0xebd0c2,_0x182090){return function(_0x1f5a3e){if(!_0x1f5a3e){_0xebd0c2[_0xdb12('0x19')](0x194);}return _0x1f5a3e;};}function handleError(_0x373cff,_0x456395){_0x456395=_0x456395||0x1f4;return function(_0x5ec5af){logger[_0xdb12('0x28')](_0x5ec5af['stack']);if(_0x5ec5af['name']){delete _0x5ec5af[_0xdb12('0x29')];}_0x373cff[_0xdb12('0x20')](_0x456395)[_0xdb12('0x2a')](_0x5ec5af);};}exports[_0xdb12('0x2b')]=function(_0x4595f3,_0xa5da71){var _0x2187e6={'raw':!![],'where':{'id':_0x4595f3['params']['id']}},_0x43131b={};_0x43131b[_0xdb12('0x2c')]=_[_0xdb12('0x2d')](db[_0xdb12('0x2e')]['rawAttributes']);_0x43131b['query']=_[_0xdb12('0x2d')](_0x4595f3[_0xdb12('0x2f')]);_0x43131b[_0xdb12('0x30')]=_[_0xdb12('0x31')](_0x43131b[_0xdb12('0x2c')],_0x43131b[_0xdb12('0x2f')]);_0x2187e6[_0xdb12('0x32')]=_[_0xdb12('0x31')](_0x43131b[_0xdb12('0x2c')],qs[_0xdb12('0x33')](_0x4595f3[_0xdb12('0x2f')][_0xdb12('0x33')]));_0x2187e6[_0xdb12('0x32')]=_0x2187e6['attributes'][_0xdb12('0x34')]?_0x2187e6[_0xdb12('0x32')]:_0x43131b['model'];if(_0x4595f3['query'][_0xdb12('0x35')]){_0x2187e6[_0xdb12('0x36')]=[{'all':!![]}];}_0x2187e6=_[_0xdb12('0x37')]({},_0x2187e6,_0x4595f3['options']);return db['ChatApplication'][_0xdb12('0x38')](_0x2187e6)['then'](handleEntityNotFound(_0xa5da71,null))[_0xdb12('0x26')](respondWithResult(_0xa5da71,null))[_0xdb12('0x39')](handleError(_0xa5da71,null));};exports[_0xdb12('0x25')]=function(_0x20cbfa,_0x3c7950){if(_0x20cbfa['body']['id']){delete _0x20cbfa['body']['id'];}return db['ChatApplication']['find']({'where':{'id':_0x20cbfa[_0xdb12('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3c7950,null))[_0xdb12('0x26')](saveUpdates(_0x20cbfa['body'],null))['then'](respondWithResult(_0x3c7950,null))['catch'](handleError(_0x3c7950,null));};exports[_0xdb12('0x27')]=function(_0x4880b2,_0x17e5f5){return db['ChatApplication']['find']({'where':{'id':_0x4880b2['params']['id']}})['then'](handleEntityNotFound(_0x17e5f5,null))[_0xdb12('0x26')](removeEntity(_0x17e5f5,null))[_0xdb12('0x39')](handleError(_0x17e5f5,null));};
\ No newline at end of file
+var _0x13f6=['send','model','keys','ChatApplication','query','filters','attributes','intersection','fields','includeAll','include','merge','options','catch','find','params','body','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','name'];(function(_0x3214ca,_0x4053d7){var _0x4e756e=function(_0x3244f1){while(--_0x3244f1){_0x3214ca['push'](_0x3214ca['shift']());}};_0x4e756e(++_0x4053d7);}(_0x13f6,0x124));var _0x613f=function(_0x1f86c8,_0x2ec96a){_0x1f86c8=_0x1f86c8-0x0;var _0x1db2f7=_0x13f6[_0x1f86c8];return _0x1db2f7;};'use strict';var emlformat=require(_0x613f('0x0'));var rimraf=require(_0x613f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x613f('0x2'));var moment=require(_0x613f('0x3'));var BPromise=require(_0x613f('0x4'));var Mustache=require('mustache');var util=require(_0x613f('0x5'));var path=require(_0x613f('0x6'));var sox=require(_0x613f('0x7'));var csv=require('to-csv');var ejs=require(_0x613f('0x8'));var fs=require('fs');var fs_extra=require(_0x613f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613f('0xa'));var toCsv=require(_0x613f('0xb'));var querystring=require(_0x613f('0xc'));var Papa=require(_0x613f('0xd'));var Redis=require('ioredis');var authService=require(_0x613f('0xe'));var qs=require(_0x613f('0xf'));var as=require(_0x613f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x613f('0x11'))(_0x613f('0x12'));var utils=require(_0x613f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x613f('0x14'));var db=require(_0x613f('0x15'))['db'];function respondWithStatusCode(_0x542230,_0x4c2a85){_0x4c2a85=_0x4c2a85||0xcc;return function(_0x517f57){if(_0x517f57){return _0x542230[_0x613f('0x16')](_0x4c2a85);}return _0x542230[_0x613f('0x17')](_0x4c2a85)[_0x613f('0x18')]();};}function respondWithResult(_0x375db1,_0x329fcf){_0x329fcf=_0x329fcf||0xc8;return function(_0x4a6fc){if(_0x4a6fc){return _0x375db1[_0x613f('0x17')](_0x329fcf)[_0x613f('0x19')](_0x4a6fc);}};}function respondWithFilteredResult(_0x2eee4d,_0x1d68fd){return function(_0x548218){if(_0x548218){var _0x3c9edf=typeof _0x1d68fd['offset']==='undefined'&&typeof _0x1d68fd[_0x613f('0x1a')]===_0x613f('0x1b');var _0x544eca=_0x548218[_0x613f('0x1c')];var _0x4f9dae=_0x3c9edf?0x0:_0x1d68fd[_0x613f('0x1d')];var _0x1e5a11=_0x3c9edf?_0x548218[_0x613f('0x1c')]:_0x1d68fd[_0x613f('0x1d')]+_0x1d68fd[_0x613f('0x1a')];var _0x1ba35f;if(_0x1e5a11>=_0x544eca){_0x1e5a11=_0x544eca;_0x1ba35f=0xc8;}else{_0x1ba35f=0xce;}_0x2eee4d['status'](_0x1ba35f);return _0x2eee4d['set'](_0x613f('0x1e'),_0x4f9dae+'-'+_0x1e5a11+'/'+_0x544eca)['json'](_0x548218);}return null;};}function patchUpdates(_0x48493c){return function(_0x3c9b58){try{jsonpatch[_0x613f('0x1f')](_0x3c9b58,_0x48493c,!![]);}catch(_0x4f5a5a){return BPromise[_0x613f('0x20')](_0x4f5a5a);}return _0x3c9b58[_0x613f('0x21')]();};}function saveUpdates(_0x2aa14b,_0x48b28a){return function(_0x5401c2){if(_0x5401c2){return _0x5401c2[_0x613f('0x22')](_0x2aa14b)[_0x613f('0x23')](function(_0x2acfcf){return _0x2acfcf;});}return null;};}function removeEntity(_0x51f376,_0x41104e){return function(_0x33e0c6){if(_0x33e0c6){return _0x33e0c6[_0x613f('0x24')]()[_0x613f('0x23')](function(){_0x51f376[_0x613f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30fb15,_0x204185){return function(_0x51bba1){if(!_0x51bba1){_0x30fb15[_0x613f('0x16')](0x194);}return _0x51bba1;};}function handleError(_0x5d4ff6,_0x32e747){_0x32e747=_0x32e747||0x1f4;return function(_0x4a878d){logger['error'](_0x4a878d['stack']);if(_0x4a878d[_0x613f('0x25')]){delete _0x4a878d['name'];}_0x5d4ff6[_0x613f('0x17')](_0x32e747)[_0x613f('0x26')](_0x4a878d);};}exports['show']=function(_0x121241,_0x2551c1){var _0x4c8aa1={'raw':!![],'where':{'id':_0x121241['params']['id']}},_0x4cff5d={};_0x4cff5d[_0x613f('0x27')]=_[_0x613f('0x28')](db[_0x613f('0x29')]['rawAttributes']);_0x4cff5d[_0x613f('0x2a')]=_[_0x613f('0x28')](_0x121241[_0x613f('0x2a')]);_0x4cff5d[_0x613f('0x2b')]=_['intersection'](_0x4cff5d[_0x613f('0x27')],_0x4cff5d[_0x613f('0x2a')]);_0x4c8aa1[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x4cff5d[_0x613f('0x27')],qs[_0x613f('0x2e')](_0x121241['query'][_0x613f('0x2e')]));_0x4c8aa1[_0x613f('0x2c')]=_0x4c8aa1[_0x613f('0x2c')]['length']?_0x4c8aa1[_0x613f('0x2c')]:_0x4cff5d['model'];if(_0x121241[_0x613f('0x2a')][_0x613f('0x2f')]){_0x4c8aa1[_0x613f('0x30')]=[{'all':!![]}];}_0x4c8aa1=_[_0x613f('0x31')]({},_0x4c8aa1,_0x121241[_0x613f('0x32')]);return db[_0x613f('0x29')]['find'](_0x4c8aa1)[_0x613f('0x23')](handleEntityNotFound(_0x2551c1,null))[_0x613f('0x23')](respondWithResult(_0x2551c1,null))[_0x613f('0x33')](handleError(_0x2551c1,null));};exports[_0x613f('0x22')]=function(_0x477ac9,_0x47a9f6){if(_0x477ac9['body']['id']){delete _0x477ac9['body']['id'];}return db[_0x613f('0x29')][_0x613f('0x34')]({'where':{'id':_0x477ac9[_0x613f('0x35')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x47a9f6,null))['then'](saveUpdates(_0x477ac9[_0x613f('0x36')],null))[_0x613f('0x23')](respondWithResult(_0x47a9f6,null))['catch'](handleError(_0x47a9f6,null));};exports[_0x613f('0x24')]=function(_0x550cea,_0x310016){return db['ChatApplication'][_0x613f('0x34')]({'where':{'id':_0x550cea['params']['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x310016,null))[_0x613f('0x23')](removeEntity(_0x310016,null))[_0x613f('0x33')](handleError(_0x310016,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 816d1a4..76a8f55 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 _0x0296=['chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','request-promise','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x0296,0x1bf));var _0x6029=function(_0x52fa77,_0x2b381b){_0x52fa77=_0x52fa77-0x0;var _0x477535=_0x0296[_0x52fa77];return _0x477535;};'use strict';var _=require(_0x6029('0x0'));var util=require('util');var logger=require(_0x6029('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6029('0x2'));var fs=require('fs');var path=require(_0x6029('0x3'));var rimraf=require('rimraf');var config=require(_0x6029('0x4'));var attributes=require(_0x6029('0x5'));module[_0x6029('0x6')]=function(_0x5701a5,_0x5419a9){return _0x5701a5[_0x6029('0x7')](_0x6029('0x8'),attributes,{'tableName':_0x6029('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6029('0xa'),'collate':_0x6029('0xb')});};
\ No newline at end of file
+var _0x2d70=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x2d70,0xd2));var _0x02d7=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0x2d70[_0x55c1f0];return _0x1530fa;};'use strict';var _=require(_0x02d7('0x0'));var util=require('util');var logger=require(_0x02d7('0x1'))(_0x02d7('0x2'));var moment=require(_0x02d7('0x3'));var BPromise=require('bluebird');var rp=require(_0x02d7('0x4'));var fs=require('fs');var path=require(_0x02d7('0x5'));var rimraf=require(_0x02d7('0x6'));var config=require(_0x02d7('0x7'));var attributes=require(_0x02d7('0x8'));module[_0x02d7('0x9')]=function(_0xb7ad71,_0x34e039){return _0xb7ad71[_0x02d7('0xa')](_0x02d7('0xb'),attributes,{'tableName':_0x02d7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x02d7('0xd'),'collate':_0x02d7('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 0537a80..836658a 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 _0x9784=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x9784,0x181));var _0x4978=function(_0x1b5ef9,_0x411c6e){_0x1b5ef9=_0x1b5ef9-0x0;var _0x3b8304=_0x9784[_0x1b5ef9];return _0x3b8304;};'use strict';var _=require(_0x4978('0x0'));var util=require(_0x4978('0x1'));var moment=require(_0x4978('0x2'));var BPromise=require(_0x4978('0x3'));var rs=require(_0x4978('0x4'));var fs=require('fs');var Redis=require(_0x4978('0x5'));var db=require(_0x4978('0x6'))['db'];var utils=require(_0x4978('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x4978('0x8'));var jayson=require(_0x4978('0x9'));var client=jayson[_0x4978('0xa')][_0x4978('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x238201,_0x4a0f07,_0x4426b9){return new BPromise(function(_0x1ac669,_0x4dddf4){return client[_0x4978('0xc')](_0x238201,_0x4426b9)[_0x4978('0xd')](function(_0x8454f5){logger['info'](_0x4978('0xe'),_0x4a0f07,_0x4978('0xf'));logger[_0x4978('0x10')](_0x4978('0x11'),_0x4a0f07,_0x4978('0xf'),JSON['stringify'](_0x8454f5));if(_0x8454f5[_0x4978('0x12')]){if(_0x8454f5['error'][_0x4978('0x13')]===0x1f4){logger[_0x4978('0x12')](_0x4978('0xe'),_0x4a0f07,_0x8454f5[_0x4978('0x12')]['message']);return _0x4dddf4(_0x8454f5[_0x4978('0x12')]['message']);}logger[_0x4978('0x12')]('ChatApplication,\x20%s,\x20%s',_0x4a0f07,_0x8454f5[_0x4978('0x12')][_0x4978('0x14')]);return _0x1ac669(_0x8454f5[_0x4978('0x12')][_0x4978('0x14')]);}else{logger[_0x4978('0x15')](_0x4978('0xe'),_0x4a0f07,_0x4978('0xf'));_0x1ac669(_0x8454f5['result'][_0x4978('0x14')]);}})[_0x4978('0x16')](function(_0x113f8e){logger['error'](_0x4978('0xe'),_0x4a0f07,_0x113f8e);_0x4dddf4(_0x113f8e);});});}
\ No newline at end of file
+var _0x0ee7=['lodash','util','moment','bluebird','randomstring','../../config/environment','http','request','then','info','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0ee7,0xc6));var _0x70ee=function(_0x3f1a7f,_0x18c487){_0x3f1a7f=_0x3f1a7f-0x0;var _0x16cf32=_0x0ee7[_0x3f1a7f];return _0x16cf32;};'use strict';var _=require(_0x70ee('0x0'));var util=require(_0x70ee('0x1'));var moment=require(_0x70ee('0x2'));var BPromise=require(_0x70ee('0x3'));var rs=require(_0x70ee('0x4'));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(_0x70ee('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x70ee('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1ab6b0,_0x539130,_0x4d0728){return new BPromise(function(_0x2f39d9,_0x21c7c6){return client[_0x70ee('0x7')](_0x1ab6b0,_0x4d0728)[_0x70ee('0x8')](function(_0x491a3e){logger[_0x70ee('0x9')](_0x70ee('0xa'),_0x539130,'request\x20sent');logger['debug'](_0x70ee('0xb'),_0x539130,_0x70ee('0xc'),JSON[_0x70ee('0xd')](_0x491a3e));if(_0x491a3e[_0x70ee('0xe')]){if(_0x491a3e[_0x70ee('0xe')][_0x70ee('0xf')]===0x1f4){logger[_0x70ee('0xe')](_0x70ee('0xa'),_0x539130,_0x491a3e[_0x70ee('0xe')][_0x70ee('0x10')]);return _0x21c7c6(_0x491a3e[_0x70ee('0xe')]['message']);}logger[_0x70ee('0xe')]('ChatApplication,\x20%s,\x20%s',_0x539130,_0x491a3e['error']['message']);return _0x2f39d9(_0x491a3e['error'][_0x70ee('0x10')]);}else{logger['info'](_0x70ee('0xa'),_0x539130,_0x70ee('0xc'));_0x2f39d9(_0x491a3e[_0x70ee('0x11')][_0x70ee('0x10')]);}})['catch'](function(_0x5239f3){logger[_0x70ee('0xe')](_0x70ee('0xa'),_0x539130,_0x5239f3);_0x21c7c6(_0x5239f3);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 6273e62..a46a579 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 _0x0ce7=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','put','update'];(function(_0x309f96,_0x121997){var _0x4c405c=function(_0xe61988){while(--_0xe61988){_0x309f96['push'](_0x309f96['shift']());}};_0x4c405c(++_0x121997);}(_0x0ce7,0x1a4));var _0x70ce=function(_0x4d4c28,_0x189564){_0x4d4c28=_0x4d4c28-0x0;var _0x4ecef4=_0x0ce7[_0x4d4c28];return _0x4ecef4;};'use strict';var multer=require('multer');var util=require(_0x70ce('0x0'));var path=require(_0x70ce('0x1'));var timeout=require(_0x70ce('0x2'));var express=require(_0x70ce('0x3'));var router=express['Router']();var fs_extra=require(_0x70ce('0x4'));var auth=require(_0x70ce('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x70ce('0x6'));var controller=require(_0x70ce('0x7'));router['get'](_0x70ce('0x8'),auth[_0x70ce('0x9')](),controller['show']);router[_0x70ce('0xa')](_0x70ce('0x8'),auth[_0x70ce('0x9')](),controller[_0x70ce('0xb')]);router['delete'](_0x70ce('0x8'),auth[_0x70ce('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x7494=['../../config/environment','./chatApplication.controller','/:id','put','delete','isAuthenticated','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2071a0,_0x2912bb){var _0x23e144=function(_0x23bbad){while(--_0x23bbad){_0x2071a0['push'](_0x2071a0['shift']());}};_0x23e144(++_0x2912bb);}(_0x7494,0x173));var _0x4749=function(_0x1308b8,_0x4711dd){_0x1308b8=_0x1308b8-0x0;var _0x24d58a=_0x7494[_0x1308b8];return _0x24d58a;};'use strict';var multer=require(_0x4749('0x0'));var util=require(_0x4749('0x1'));var path=require('path');var timeout=require(_0x4749('0x2'));var express=require(_0x4749('0x3'));var router=express[_0x4749('0x4')]();var fs_extra=require(_0x4749('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4749('0x6'));var config=require(_0x4749('0x7'));var controller=require(_0x4749('0x8'));router['get'](_0x4749('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x4749('0xa')](_0x4749('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x4749('0xb')]('/:id',auth[_0x4749('0xc')](),controller['destroy']);module[_0x4749('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 18d24da..8d27ba0 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 _0x63aa=['sequelize','exports','STRING','BOOLEAN'];(function(_0xe5b37c,_0x40071b){var _0x52a6d0=function(_0x5bcabd){while(--_0x5bcabd){_0xe5b37c['push'](_0xe5b37c['shift']());}};_0x52a6d0(++_0x40071b);}(_0x63aa,0x98));var _0xa63a=function(_0x2fa4c2,_0x46cd49){_0x2fa4c2=_0x2fa4c2-0x0;var _0x24e30f=_0x63aa[_0x2fa4c2];return _0x24e30f;};'use strict';var Sequelize=require(_0xa63a('0x0'));module[_0xa63a('0x1')]={'name':{'type':Sequelize[_0xa63a('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xa63a('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xad07=['STRING','sequelize'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xad07,0x1ab));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7ad0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x7ad0('0x1')]},'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 4db22f1..74a41df 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 _0x0f97=['end','status','json','offset','limit','count','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','type','key','keys','query','filters','intersection','attributes','model','fields','sort','where','pick','merge','VIRTUAL','filter','options','include','show','ChatGroup','length','create','catch','body','find','params','describe','getUnread','user','toInteger','addMembers','ids','omit','findOne','User','getMembers','hasOwnProperty','nolimit','removeMembers','ChatGroupId','ChatInternalMessage','getMessages','order','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatGroup.socket','register'];(function(_0xb3cf51,_0x1f9fd6){var _0x24d096=function(_0x56b8b4){while(--_0x56b8b4){_0xb3cf51['push'](_0xb3cf51['shift']());}};_0x24d096(++_0x1f9fd6);}(_0x0f97,0x9a));var _0x70f9=function(_0x17afca,_0x5d6455){_0x17afca=_0x17afca-0x0;var _0x4691c9=_0x0f97[_0x17afca];return _0x4691c9;};'use strict';var emlformat=require(_0x70f9('0x0'));var rimraf=require(_0x70f9('0x1'));var zipdir=require(_0x70f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x70f9('0x3'));var Mustache=require(_0x70f9('0x4'));var util=require(_0x70f9('0x5'));var path=require(_0x70f9('0x6'));var sox=require('sox');var csv=require(_0x70f9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x70f9('0x8'));var _=require(_0x70f9('0x9'));var squel=require(_0x70f9('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x70f9('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x70f9('0xc'));var authService=require(_0x70f9('0xd'));var qs=require(_0x70f9('0xe'));var as=require(_0x70f9('0xf'));var hardwareService=require(_0x70f9('0x10'));var logger=require(_0x70f9('0x11'))(_0x70f9('0x12'));var utils=require(_0x70f9('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x70f9('0x14'));var db=require(_0x70f9('0x15'))['db'];config[_0x70f9('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x70f9('0x17'))(new Redis(config['redis']));require(_0x70f9('0x18'))[_0x70f9('0x19')](socket);function respondWithStatusCode(_0x5d11bb,_0x1e1d4f){_0x1e1d4f=_0x1e1d4f||0xcc;return function(_0x56c086){if(_0x56c086){return _0x5d11bb['sendStatus'](_0x1e1d4f);}return _0x5d11bb['status'](_0x1e1d4f)[_0x70f9('0x1a')]();};}function respondWithResult(_0x462be5,_0x2faa64){_0x2faa64=_0x2faa64||0xc8;return function(_0x463039){if(_0x463039){return _0x462be5[_0x70f9('0x1b')](_0x2faa64)[_0x70f9('0x1c')](_0x463039);}};}function respondWithFilteredResult(_0x374aed,_0x5dab31){return function(_0x583d62){if(_0x583d62){var _0x1d7a19=typeof _0x5dab31[_0x70f9('0x1d')]==='undefined'&&typeof _0x5dab31[_0x70f9('0x1e')]==='undefined';var _0x3cb4d4=_0x583d62[_0x70f9('0x1f')];var _0x499eee=_0x1d7a19?0x0:_0x5dab31[_0x70f9('0x1d')];var _0x4cf438=_0x1d7a19?_0x583d62[_0x70f9('0x1f')]:_0x5dab31[_0x70f9('0x1d')]+_0x5dab31['limit'];var _0x1056fb;if(_0x4cf438>=_0x3cb4d4){_0x4cf438=_0x3cb4d4;_0x1056fb=0xc8;}else{_0x1056fb=0xce;}_0x374aed[_0x70f9('0x1b')](_0x1056fb);return _0x374aed['set'](_0x70f9('0x20'),_0x499eee+'-'+_0x4cf438+'/'+_0x3cb4d4)[_0x70f9('0x1c')](_0x583d62);}return null;};}function patchUpdates(_0x2bb8df){return function(_0x355be9){try{jsonpatch[_0x70f9('0x21')](_0x355be9,_0x2bb8df,!![]);}catch(_0x577e5e){return BPromise['reject'](_0x577e5e);}return _0x355be9[_0x70f9('0x22')]();};}function saveUpdates(_0x512dcf,_0x5c244d){return function(_0x3278ad){if(_0x3278ad){return _0x3278ad[_0x70f9('0x23')](_0x512dcf)[_0x70f9('0x24')](function(_0x51fbe5){return _0x51fbe5;});}return null;};}function removeEntity(_0x574767,_0x2c87cf){return function(_0x6238bf){if(_0x6238bf){return _0x6238bf[_0x70f9('0x25')]()[_0x70f9('0x24')](function(){_0x574767[_0x70f9('0x1b')](0xcc)[_0x70f9('0x1a')]();});}};}function handleEntityNotFound(_0x1edf66,_0x30c84e){return function(_0x50dd40){if(!_0x50dd40){_0x1edf66[_0x70f9('0x26')](0x194);}return _0x50dd40;};}function handleError(_0x32f587,_0x8480aa){_0x8480aa=_0x8480aa||0x1f4;return function(_0x17412a){logger['error'](_0x17412a[_0x70f9('0x27')]);if(_0x17412a['name']){delete _0x17412a[_0x70f9('0x28')];}_0x32f587[_0x70f9('0x1b')](_0x8480aa)[_0x70f9('0x29')](_0x17412a);};}exports[_0x70f9('0x2a')]=function(_0x5afecc,_0x1421bf){var _0x1f358f={},_0x44ce1d={},_0x3fe7a3={'count':0x0,'rows':[]};var _0x24a38b=_[_0x70f9('0x2b')](db['ChatGroup'][_0x70f9('0x2c')],function(_0x72a870){return{'name':_0x72a870['fieldName'],'type':_0x72a870[_0x70f9('0x2d')][_0x70f9('0x2e')]};});_0x44ce1d['model']=_[_0x70f9('0x2b')](_0x24a38b,'name');_0x44ce1d['query']=_[_0x70f9('0x2f')](_0x5afecc[_0x70f9('0x30')]);_0x44ce1d[_0x70f9('0x31')]=_[_0x70f9('0x32')](_0x44ce1d['model'],_0x44ce1d['query']);_0x1f358f[_0x70f9('0x33')]=_['intersection'](_0x44ce1d[_0x70f9('0x34')],qs[_0x70f9('0x35')](_0x5afecc[_0x70f9('0x30')][_0x70f9('0x35')]));_0x1f358f[_0x70f9('0x33')]=_0x1f358f['attributes']['length']?_0x1f358f[_0x70f9('0x33')]:_0x44ce1d['model'];if(!_0x5afecc['query']['hasOwnProperty']('nolimit')){_0x1f358f[_0x70f9('0x1e')]=qs[_0x70f9('0x1e')](_0x5afecc[_0x70f9('0x30')][_0x70f9('0x1e')]);_0x1f358f[_0x70f9('0x1d')]=qs[_0x70f9('0x1d')](_0x5afecc['query'][_0x70f9('0x1d')]);}_0x1f358f['order']=qs[_0x70f9('0x36')](_0x5afecc['query'][_0x70f9('0x36')]);_0x1f358f[_0x70f9('0x37')]=qs[_0x70f9('0x31')](_[_0x70f9('0x38')](_0x5afecc[_0x70f9('0x30')],_0x44ce1d[_0x70f9('0x31')]),_0x24a38b);if(_0x5afecc[_0x70f9('0x30')]['filter']){_0x1f358f['where']=_[_0x70f9('0x39')](_0x1f358f['where'],{'$or':_[_0x70f9('0x2b')](_0x24a38b,function(_0x546483){if(_0x546483[_0x70f9('0x2d')]!==_0x70f9('0x3a')){var _0x5f15fb={};_0x5f15fb[_0x546483[_0x70f9('0x28')]]={'$like':'%'+_0x5afecc['query'][_0x70f9('0x3b')]+'%'};return _0x5f15fb;}})});}_0x1f358f=_['merge']({},_0x1f358f,_0x5afecc[_0x70f9('0x3c')]);var _0x4b82e3={'where':_0x1f358f['where']};return db['ChatGroup'][_0x70f9('0x1f')](_0x4b82e3)[_0x70f9('0x24')](function(_0x1169fc){_0x3fe7a3[_0x70f9('0x1f')]=_0x1169fc;if(_0x5afecc[_0x70f9('0x30')]['includeAll']){_0x1f358f[_0x70f9('0x3d')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x1f358f);})[_0x70f9('0x24')](function(_0x5c12fa){_0x3fe7a3['rows']=_0x5c12fa;return _0x3fe7a3;})[_0x70f9('0x24')](respondWithFilteredResult(_0x1421bf,_0x1f358f))['catch'](handleError(_0x1421bf,null));};exports[_0x70f9('0x3e')]=function(_0x4713ad,_0x151e9a){var _0x37c2a7={'raw':!![],'where':{'id':_0x4713ad['params']['id']}},_0x294946={};_0x294946[_0x70f9('0x34')]=_[_0x70f9('0x2f')](db[_0x70f9('0x3f')][_0x70f9('0x2c')]);_0x294946[_0x70f9('0x30')]=_[_0x70f9('0x2f')](_0x4713ad['query']);_0x294946[_0x70f9('0x31')]=_[_0x70f9('0x32')](_0x294946[_0x70f9('0x34')],_0x294946[_0x70f9('0x30')]);_0x37c2a7[_0x70f9('0x33')]=_[_0x70f9('0x32')](_0x294946[_0x70f9('0x34')],qs[_0x70f9('0x35')](_0x4713ad[_0x70f9('0x30')][_0x70f9('0x35')]));_0x37c2a7['attributes']=_0x37c2a7['attributes'][_0x70f9('0x40')]?_0x37c2a7[_0x70f9('0x33')]:_0x294946[_0x70f9('0x34')];if(_0x4713ad[_0x70f9('0x30')]['includeAll']){_0x37c2a7[_0x70f9('0x3d')]=[{'all':!![]}];}_0x37c2a7=_[_0x70f9('0x39')]({},_0x37c2a7,_0x4713ad['options']);return db['ChatGroup']['find'](_0x37c2a7)[_0x70f9('0x24')](handleEntityNotFound(_0x151e9a,null))[_0x70f9('0x24')](respondWithResult(_0x151e9a,null))['catch'](handleError(_0x151e9a,null));};exports[_0x70f9('0x41')]=function(_0x2f91b5,_0x165b9f){return db[_0x70f9('0x3f')][_0x70f9('0x41')](_0x2f91b5['body'],{})[_0x70f9('0x24')](respondWithResult(_0x165b9f,0xc9))[_0x70f9('0x42')](handleError(_0x165b9f,null));};exports['update']=function(_0x5b26d8,_0xe1772c){if(_0x5b26d8[_0x70f9('0x43')]['id']){delete _0x5b26d8[_0x70f9('0x43')]['id'];}return db[_0x70f9('0x3f')][_0x70f9('0x44')]({'where':{'id':_0x5b26d8[_0x70f9('0x45')]['id']}})[_0x70f9('0x24')](handleEntityNotFound(_0xe1772c,null))[_0x70f9('0x24')](saveUpdates(_0x5b26d8[_0x70f9('0x43')],null))['then'](respondWithResult(_0xe1772c,null))[_0x70f9('0x42')](handleError(_0xe1772c,null));};exports[_0x70f9('0x25')]=function(_0x2c31d7,_0x2e4481){return db[_0x70f9('0x3f')][_0x70f9('0x44')]({'where':{'id':_0x2c31d7[_0x70f9('0x45')]['id']}})[_0x70f9('0x24')](handleEntityNotFound(_0x2e4481,null))[_0x70f9('0x24')](removeEntity(_0x2e4481,null))[_0x70f9('0x42')](handleError(_0x2e4481,null));};exports[_0x70f9('0x46')]=function(_0xac6fc6,_0x4981a6){return db[_0x70f9('0x3f')][_0x70f9('0x46')]()[_0x70f9('0x24')](respondWithResult(_0x4981a6,null))[_0x70f9('0x42')](handleError(_0x4981a6,null));};exports[_0x70f9('0x47')]=function(_0x260095,_0x14170b,_0x374b26){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x260095[_0x70f9('0x45')]['id'],'ToId':_0x260095[_0x70f9('0x48')]['id'],'read':![]}})[_0x70f9('0x24')](function(_0x32ab74){return{'id':_[_0x70f9('0x49')](_0x260095[_0x70f9('0x45')]['id']),'count':_0x32ab74};})[_0x70f9('0x24')](respondWithResult(_0x14170b,null))['catch'](handleError(_0x14170b,null));};exports[_0x70f9('0x4a')]=function(_0x26c8b6,_0x4650df,_0x5db2f8){return db['ChatGroup'][_0x70f9('0x44')]({'where':{'id':_0x26c8b6[_0x70f9('0x45')]['id']}})['then'](handleEntityNotFound(_0x4650df,null))[_0x70f9('0x24')](function(_0x1184dd){if(_0x1184dd){return _0x1184dd[_0x70f9('0x4a')](_0x26c8b6[_0x70f9('0x43')][_0x70f9('0x4b')],_[_0x70f9('0x4c')](_0x26c8b6[_0x70f9('0x43')],['ids','id'])||{});}})[_0x70f9('0x24')](respondWithResult(_0x4650df,null))[_0x70f9('0x42')](handleError(_0x4650df,null));};exports['getMembers']=function(_0x4619aa,_0x9f8aff,_0x20b4e7){var _0x4c7693={};var _0x859dc3={};var _0x300fab;var _0xdbf905;return db['ChatGroup'][_0x70f9('0x4d')]({'where':{'id':_0x4619aa[_0x70f9('0x45')]['id']}})[_0x70f9('0x24')](handleEntityNotFound(_0x9f8aff,null))[_0x70f9('0x24')](function(_0x1a7bf3){if(_0x1a7bf3){_0x300fab=_0x1a7bf3;_0x859dc3[_0x70f9('0x34')]=_['keys'](db[_0x70f9('0x4e')]['rawAttributes']);_0x859dc3['query']=_['keys'](_0x4619aa[_0x70f9('0x30')]);_0x859dc3[_0x70f9('0x31')]=_['intersection'](_0x859dc3['model'],_0x859dc3[_0x70f9('0x30')]);_0x4c7693[_0x70f9('0x33')]=_[_0x70f9('0x32')](_0x859dc3[_0x70f9('0x34')],qs[_0x70f9('0x35')](_0x4619aa['query'][_0x70f9('0x35')]));_0x4c7693[_0x70f9('0x33')]=_0x4c7693[_0x70f9('0x33')]['length']?_0x4c7693[_0x70f9('0x33')]:_0x859dc3[_0x70f9('0x34')];_0x4c7693['order']=qs['sort'](_0x4619aa[_0x70f9('0x30')][_0x70f9('0x36')]);_0x4c7693[_0x70f9('0x37')]=qs['filters'](_[_0x70f9('0x38')](_0x4619aa['query'],_0x859dc3[_0x70f9('0x31')]));if(_0x4619aa['query'][_0x70f9('0x3b')]){_0x4c7693[_0x70f9('0x37')]=_[_0x70f9('0x39')](_0x4c7693[_0x70f9('0x37')],{'$or':_[_0x70f9('0x2b')](_0x4c7693[_0x70f9('0x33')],function(_0x9cb97){var _0x17b234={};_0x17b234[_0x9cb97]={'$like':'%'+_0x4619aa[_0x70f9('0x30')][_0x70f9('0x3b')]+'%'};return _0x17b234;})});}_0x4c7693=_[_0x70f9('0x39')]({},_0x4c7693,_0x4619aa[_0x70f9('0x3c')]);return _0x300fab[_0x70f9('0x4f')](_0x4c7693);}})['then'](function(_0x4b791b){if(_0x4b791b){_0xdbf905=_0x4b791b[_0x70f9('0x40')];if(!_0x4619aa['query'][_0x70f9('0x50')](_0x70f9('0x51'))){_0x4c7693[_0x70f9('0x1e')]=qs[_0x70f9('0x1e')](_0x4619aa[_0x70f9('0x30')]['limit']);_0x4c7693[_0x70f9('0x1d')]=qs[_0x70f9('0x1d')](_0x4619aa[_0x70f9('0x30')]['offset']);}return _0x300fab['getMembers'](_0x4c7693);}})['then'](function(_0x279861){if(_0x279861){return _0x279861?{'count':_0xdbf905,'rows':_0x279861}:null;}})[_0x70f9('0x24')](respondWithResult(_0x9f8aff,null))['catch'](handleError(_0x9f8aff,null));};exports['removeMembers']=function(_0x3f5ea3,_0x1d903a,_0x61c1b3){return db[_0x70f9('0x3f')][_0x70f9('0x44')]({'where':{'id':_0x3f5ea3[_0x70f9('0x45')]['id']}})[_0x70f9('0x24')](handleEntityNotFound(_0x1d903a,null))[_0x70f9('0x24')](function(_0x5a192){if(_0x5a192){return _0x5a192[_0x70f9('0x52')](_0x3f5ea3['query']['ids']);}})['then'](respondWithStatusCode(_0x1d903a,null))[_0x70f9('0x42')](handleError(_0x1d903a,null));};exports['addMessage']=function(_0x516600,_0xa06e72,_0x42768e){if(_0x516600['body']['id']){delete _0x516600['body']['id'];}return db[_0x70f9('0x3f')]['find']({'where':{'id':_0x516600[_0x70f9('0x45')]['id']}})['then'](handleEntityNotFound(_0xa06e72,null))[_0x70f9('0x24')](function(_0x7ea33f){if(_0x7ea33f){_0x516600[_0x70f9('0x43')][_0x70f9('0x53')]=_0x7ea33f['id'];return db[_0x70f9('0x54')][_0x70f9('0x41')](_0x516600[_0x70f9('0x43')]);}})[_0x70f9('0x24')](respondWithResult(_0xa06e72,null))[_0x70f9('0x42')](handleError(_0xa06e72,null));};exports[_0x70f9('0x55')]=function(_0x16d271,_0x4b7b53,_0x136043){var _0x2d0dd7={};var _0x333213={};var _0x55c773;var _0x2e3f44;return db[_0x70f9('0x3f')][_0x70f9('0x4d')]({'where':{'id':_0x16d271[_0x70f9('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b7b53,null))[_0x70f9('0x24')](function(_0xd95119){if(_0xd95119){_0x55c773=_0xd95119;_0x333213[_0x70f9('0x34')]=_[_0x70f9('0x2f')](db['ChatInternalMessage'][_0x70f9('0x2c')]);_0x333213[_0x70f9('0x30')]=_[_0x70f9('0x2f')](_0x16d271[_0x70f9('0x30')]);_0x333213[_0x70f9('0x31')]=_[_0x70f9('0x32')](_0x333213['model'],_0x333213[_0x70f9('0x30')]);_0x2d0dd7[_0x70f9('0x33')]=_[_0x70f9('0x32')](_0x333213['model'],qs[_0x70f9('0x35')](_0x16d271[_0x70f9('0x30')][_0x70f9('0x35')]));_0x2d0dd7[_0x70f9('0x33')]=_0x2d0dd7['attributes'][_0x70f9('0x40')]?_0x2d0dd7[_0x70f9('0x33')]:_0x333213[_0x70f9('0x34')];_0x2d0dd7[_0x70f9('0x56')]=qs['sort'](_0x16d271[_0x70f9('0x30')]['sort']);_0x2d0dd7[_0x70f9('0x37')]=qs[_0x70f9('0x31')](_[_0x70f9('0x38')](_0x16d271['query'],_0x333213[_0x70f9('0x31')]));if(_0x16d271[_0x70f9('0x30')][_0x70f9('0x3b')]){_0x2d0dd7[_0x70f9('0x37')]=_[_0x70f9('0x39')](_0x2d0dd7['where'],{'$or':_[_0x70f9('0x2b')](_0x2d0dd7[_0x70f9('0x33')],function(_0x90abbd){var _0x291ad1={};_0x291ad1[_0x90abbd]={'$like':'%'+_0x16d271[_0x70f9('0x30')][_0x70f9('0x3b')]+'%'};return _0x291ad1;})});}if(_0x16d271['query'][_0x70f9('0x57')]){var _0x256d01=_0x16d271['query'][_0x70f9('0x57')]['split'](',');var _0x21ba72={};_0x21ba72[_0x256d01[0x0]]={'$gte':moment(_0x256d01[0x1])[_0x70f9('0x58')](_0x70f9('0x59'))};_0x2d0dd7[_0x70f9('0x37')]=_[_0x70f9('0x39')](_0x2d0dd7[_0x70f9('0x37')],_0x21ba72);}_0x2d0dd7=_['merge']({},_0x2d0dd7,_0x16d271[_0x70f9('0x3c')]);return _0x55c773['getMessages'](_0x2d0dd7);}})[_0x70f9('0x24')](function(_0x4fe786){if(_0x4fe786){_0x2e3f44=_0x4fe786['length'];if(!_0x16d271['query'][_0x70f9('0x50')](_0x70f9('0x51'))){_0x2d0dd7['limit']=qs[_0x70f9('0x1e')](_0x16d271[_0x70f9('0x30')]['limit']);_0x2d0dd7[_0x70f9('0x1d')]=qs[_0x70f9('0x1d')](_0x16d271[_0x70f9('0x30')][_0x70f9('0x1d')]);}return _0x55c773[_0x70f9('0x55')](_0x2d0dd7);}})['then'](function(_0x30032b){if(_0x30032b){return _0x30032b?{'count':_0x2e3f44,'rows':_0x30032b}:null;}})[_0x70f9('0x24')](respondWithResult(_0x4b7b53,null))[_0x70f9('0x42')](handleError(_0x4b7b53,null));};
\ No newline at end of file
+var _0xc099=['length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','ids','omit','getMembers','User','removeMembers','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields'];(function(_0x307c57,_0x2ff9e5){var _0x232faa=function(_0xef7f){while(--_0xef7f){_0x307c57['push'](_0x307c57['shift']());}};_0x232faa(++_0x2ff9e5);}(_0xc099,0xe0));var _0x9c09=function(_0x5dd3ee,_0x1a78fb){_0x5dd3ee=_0x5dd3ee-0x0;var _0x6dbf95=_0xc099[_0x5dd3ee];return _0x6dbf95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9c09('0x0'));var zipdir=require(_0x9c09('0x1'));var jsonpatch=require(_0x9c09('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9c09('0x3'));var Mustache=require(_0x9c09('0x4'));var util=require(_0x9c09('0x5'));var path=require(_0x9c09('0x6'));var sox=require(_0x9c09('0x7'));var csv=require(_0x9c09('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9c09('0x9'));var crypto=require(_0x9c09('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9c09('0xb'));var toCsv=require(_0x9c09('0x8'));var querystring=require(_0x9c09('0xc'));var Papa=require(_0x9c09('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9c09('0xe'));var as=require(_0x9c09('0xf'));var hardwareService=require(_0x9c09('0x10'));var logger=require(_0x9c09('0x11'))(_0x9c09('0x12'));var utils=require(_0x9c09('0x13'));var config=require(_0x9c09('0x14'));var licenseUtil=require(_0x9c09('0x15'));var db=require('../../mysqldb')['db'];config[_0x9c09('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9c09('0x17'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x423d45,_0x45d6a0){_0x45d6a0=_0x45d6a0||0xcc;return function(_0x38f47e){if(_0x38f47e){return _0x423d45[_0x9c09('0x18')](_0x45d6a0);}return _0x423d45['status'](_0x45d6a0)[_0x9c09('0x19')]();};}function respondWithResult(_0x4e4494,_0x2f83db){_0x2f83db=_0x2f83db||0xc8;return function(_0x592715){if(_0x592715){return _0x4e4494[_0x9c09('0x1a')](_0x2f83db)[_0x9c09('0x1b')](_0x592715);}};}function respondWithFilteredResult(_0x5c27a8,_0x3c7b51){return function(_0x165806){if(_0x165806){var _0x2b8de8=typeof _0x3c7b51[_0x9c09('0x1c')]===_0x9c09('0x1d')&&typeof _0x3c7b51['limit']==='undefined';var _0xc48a76=_0x165806[_0x9c09('0x1e')];var _0x538e5d=_0x2b8de8?0x0:_0x3c7b51[_0x9c09('0x1c')];var _0x5828b6=_0x2b8de8?_0x165806['count']:_0x3c7b51[_0x9c09('0x1c')]+_0x3c7b51['limit'];var _0x569bd9;if(_0x5828b6>=_0xc48a76){_0x5828b6=_0xc48a76;_0x569bd9=0xc8;}else{_0x569bd9=0xce;}_0x5c27a8[_0x9c09('0x1a')](_0x569bd9);return _0x5c27a8[_0x9c09('0x1f')](_0x9c09('0x20'),_0x538e5d+'-'+_0x5828b6+'/'+_0xc48a76)['json'](_0x165806);}return null;};}function patchUpdates(_0x24e802){return function(_0x520420){try{jsonpatch[_0x9c09('0x21')](_0x520420,_0x24e802,!![]);}catch(_0x2b2488){return BPromise[_0x9c09('0x22')](_0x2b2488);}return _0x520420[_0x9c09('0x23')]();};}function saveUpdates(_0x31a7a2,_0x1fbb5c){return function(_0x3bad44){if(_0x3bad44){return _0x3bad44[_0x9c09('0x24')](_0x31a7a2)[_0x9c09('0x25')](function(_0x2df294){return _0x2df294;});}return null;};}function removeEntity(_0x5824b0,_0x9988a1){return function(_0x2ecf1d){if(_0x2ecf1d){return _0x2ecf1d['destroy']()[_0x9c09('0x25')](function(){_0x5824b0['status'](0xcc)[_0x9c09('0x19')]();});}};}function handleEntityNotFound(_0x2a0f30,_0x2d8593){return function(_0x55bf05){if(!_0x55bf05){_0x2a0f30[_0x9c09('0x18')](0x194);}return _0x55bf05;};}function handleError(_0xf5cd28,_0x2b4b89){_0x2b4b89=_0x2b4b89||0x1f4;return function(_0x55b5c0){logger[_0x9c09('0x26')](_0x55b5c0['stack']);if(_0x55b5c0[_0x9c09('0x27')]){delete _0x55b5c0['name'];}_0xf5cd28[_0x9c09('0x1a')](_0x2b4b89)[_0x9c09('0x28')](_0x55b5c0);};}exports[_0x9c09('0x29')]=function(_0x2ae68f,_0x22d60f){var _0x4514c3={},_0x39a675={},_0x5ec4a7={'count':0x0,'rows':[]};var _0x4fe692=_[_0x9c09('0x2a')](db[_0x9c09('0x2b')][_0x9c09('0x2c')],function(_0x5b8f2b){return{'name':_0x5b8f2b[_0x9c09('0x2d')],'type':_0x5b8f2b[_0x9c09('0x2e')][_0x9c09('0x2f')]};});_0x39a675['model']=_[_0x9c09('0x2a')](_0x4fe692,_0x9c09('0x27'));_0x39a675[_0x9c09('0x30')]=_[_0x9c09('0x31')](_0x2ae68f['query']);_0x39a675[_0x9c09('0x32')]=_[_0x9c09('0x33')](_0x39a675['model'],_0x39a675[_0x9c09('0x30')]);_0x4514c3[_0x9c09('0x34')]=_[_0x9c09('0x33')](_0x39a675[_0x9c09('0x35')],qs[_0x9c09('0x36')](_0x2ae68f['query'][_0x9c09('0x36')]));_0x4514c3[_0x9c09('0x34')]=_0x4514c3[_0x9c09('0x34')][_0x9c09('0x37')]?_0x4514c3[_0x9c09('0x34')]:_0x39a675['model'];if(!_0x2ae68f[_0x9c09('0x30')][_0x9c09('0x38')](_0x9c09('0x39'))){_0x4514c3[_0x9c09('0x3a')]=qs['limit'](_0x2ae68f[_0x9c09('0x30')][_0x9c09('0x3a')]);_0x4514c3[_0x9c09('0x1c')]=qs['offset'](_0x2ae68f[_0x9c09('0x30')][_0x9c09('0x1c')]);}_0x4514c3[_0x9c09('0x3b')]=qs[_0x9c09('0x3c')](_0x2ae68f[_0x9c09('0x30')][_0x9c09('0x3c')]);_0x4514c3[_0x9c09('0x3d')]=qs['filters'](_[_0x9c09('0x3e')](_0x2ae68f['query'],_0x39a675[_0x9c09('0x32')]),_0x4fe692);if(_0x2ae68f[_0x9c09('0x30')][_0x9c09('0x3f')]){_0x4514c3[_0x9c09('0x3d')]=_[_0x9c09('0x40')](_0x4514c3[_0x9c09('0x3d')],{'$or':_[_0x9c09('0x2a')](_0x4fe692,function(_0x1126f4){if(_0x1126f4[_0x9c09('0x2e')]!==_0x9c09('0x41')){var _0x4ac18f={};_0x4ac18f[_0x1126f4['name']]={'$like':'%'+_0x2ae68f[_0x9c09('0x30')]['filter']+'%'};return _0x4ac18f;}})});}_0x4514c3=_['merge']({},_0x4514c3,_0x2ae68f['options']);var _0x37ce93={'where':_0x4514c3[_0x9c09('0x3d')]};return db[_0x9c09('0x2b')][_0x9c09('0x1e')](_0x37ce93)[_0x9c09('0x25')](function(_0x15e1e6){_0x5ec4a7['count']=_0x15e1e6;if(_0x2ae68f['query'][_0x9c09('0x42')]){_0x4514c3[_0x9c09('0x43')]=[{'all':!![]}];}return db[_0x9c09('0x2b')]['findAll'](_0x4514c3);})[_0x9c09('0x25')](function(_0x4bb9a1){_0x5ec4a7[_0x9c09('0x44')]=_0x4bb9a1;return _0x5ec4a7;})['then'](respondWithFilteredResult(_0x22d60f,_0x4514c3))[_0x9c09('0x45')](handleError(_0x22d60f,null));};exports[_0x9c09('0x46')]=function(_0x1f5b9e,_0x46bef4){var _0x3b9280={'raw':!![],'where':{'id':_0x1f5b9e[_0x9c09('0x47')]['id']}},_0x2c71e9={};_0x2c71e9[_0x9c09('0x35')]=_['keys'](db['ChatGroup']['rawAttributes']);_0x2c71e9[_0x9c09('0x30')]=_[_0x9c09('0x31')](_0x1f5b9e[_0x9c09('0x30')]);_0x2c71e9['filters']=_[_0x9c09('0x33')](_0x2c71e9['model'],_0x2c71e9['query']);_0x3b9280[_0x9c09('0x34')]=_[_0x9c09('0x33')](_0x2c71e9[_0x9c09('0x35')],qs['fields'](_0x1f5b9e['query'][_0x9c09('0x36')]));_0x3b9280['attributes']=_0x3b9280[_0x9c09('0x34')]['length']?_0x3b9280['attributes']:_0x2c71e9[_0x9c09('0x35')];if(_0x1f5b9e[_0x9c09('0x30')][_0x9c09('0x42')]){_0x3b9280[_0x9c09('0x43')]=[{'all':!![]}];}_0x3b9280=_[_0x9c09('0x40')]({},_0x3b9280,_0x1f5b9e[_0x9c09('0x48')]);return db[_0x9c09('0x2b')][_0x9c09('0x49')](_0x3b9280)[_0x9c09('0x25')](handleEntityNotFound(_0x46bef4,null))['then'](respondWithResult(_0x46bef4,null))[_0x9c09('0x45')](handleError(_0x46bef4,null));};exports[_0x9c09('0x4a')]=function(_0x43d8ca,_0x4c515d){return db[_0x9c09('0x2b')]['create'](_0x43d8ca[_0x9c09('0x4b')],{})[_0x9c09('0x25')](respondWithResult(_0x4c515d,0xc9))[_0x9c09('0x45')](handleError(_0x4c515d,null));};exports[_0x9c09('0x24')]=function(_0x1e8bbf,_0x265958){if(_0x1e8bbf['body']['id']){delete _0x1e8bbf[_0x9c09('0x4b')]['id'];}return db['ChatGroup'][_0x9c09('0x49')]({'where':{'id':_0x1e8bbf['params']['id']}})[_0x9c09('0x25')](handleEntityNotFound(_0x265958,null))[_0x9c09('0x25')](saveUpdates(_0x1e8bbf[_0x9c09('0x4b')],null))[_0x9c09('0x25')](respondWithResult(_0x265958,null))[_0x9c09('0x45')](handleError(_0x265958,null));};exports['destroy']=function(_0x56375f,_0x5e173a){return db[_0x9c09('0x2b')][_0x9c09('0x49')]({'where':{'id':_0x56375f['params']['id']}})['then'](handleEntityNotFound(_0x5e173a,null))[_0x9c09('0x25')](removeEntity(_0x5e173a,null))[_0x9c09('0x45')](handleError(_0x5e173a,null));};exports[_0x9c09('0x4c')]=function(_0x3d96f8,_0x102bfe){return db['ChatGroup'][_0x9c09('0x4c')]()[_0x9c09('0x25')](respondWithResult(_0x102bfe,null))['catch'](handleError(_0x102bfe,null));};exports[_0x9c09('0x4d')]=function(_0x2a0cab,_0x395e9b,_0x43fe6f){return db[_0x9c09('0x4e')][_0x9c09('0x1e')]({'where':{'ChatGroupId':_0x2a0cab[_0x9c09('0x47')]['id'],'ToId':_0x2a0cab[_0x9c09('0x4f')]['id'],'read':![]}})[_0x9c09('0x25')](function(_0x5be2a4){return{'id':_[_0x9c09('0x50')](_0x2a0cab[_0x9c09('0x47')]['id']),'count':_0x5be2a4};})['then'](respondWithResult(_0x395e9b,null))[_0x9c09('0x45')](handleError(_0x395e9b,null));};exports['addMembers']=function(_0x1b4d70,_0x5b58a5,_0x1487c9){return db[_0x9c09('0x2b')]['find']({'where':{'id':_0x1b4d70[_0x9c09('0x47')]['id']}})[_0x9c09('0x25')](handleEntityNotFound(_0x5b58a5,null))[_0x9c09('0x25')](function(_0x5c3c6e){if(_0x5c3c6e){return _0x5c3c6e['addMembers'](_0x1b4d70[_0x9c09('0x4b')][_0x9c09('0x51')],_[_0x9c09('0x52')](_0x1b4d70[_0x9c09('0x4b')],[_0x9c09('0x51'),'id'])||{});}})[_0x9c09('0x25')](respondWithResult(_0x5b58a5,null))[_0x9c09('0x45')](handleError(_0x5b58a5,null));};exports[_0x9c09('0x53')]=function(_0x5ac606,_0x4c41da,_0x26002c){var _0x5e61da={};var _0x178900={};var _0x1f7bbd;var _0x3d57d4;return db[_0x9c09('0x2b')]['findOne']({'where':{'id':_0x5ac606['params']['id']}})[_0x9c09('0x25')](handleEntityNotFound(_0x4c41da,null))[_0x9c09('0x25')](function(_0x531f0e){if(_0x531f0e){_0x1f7bbd=_0x531f0e;_0x178900[_0x9c09('0x35')]=_[_0x9c09('0x31')](db[_0x9c09('0x54')]['rawAttributes']);_0x178900[_0x9c09('0x30')]=_[_0x9c09('0x31')](_0x5ac606[_0x9c09('0x30')]);_0x178900[_0x9c09('0x32')]=_[_0x9c09('0x33')](_0x178900[_0x9c09('0x35')],_0x178900[_0x9c09('0x30')]);_0x5e61da[_0x9c09('0x34')]=_['intersection'](_0x178900[_0x9c09('0x35')],qs[_0x9c09('0x36')](_0x5ac606['query']['fields']));_0x5e61da['attributes']=_0x5e61da[_0x9c09('0x34')][_0x9c09('0x37')]?_0x5e61da[_0x9c09('0x34')]:_0x178900[_0x9c09('0x35')];_0x5e61da[_0x9c09('0x3b')]=qs['sort'](_0x5ac606['query'][_0x9c09('0x3c')]);_0x5e61da[_0x9c09('0x3d')]=qs[_0x9c09('0x32')](_[_0x9c09('0x3e')](_0x5ac606[_0x9c09('0x30')],_0x178900['filters']));if(_0x5ac606['query'][_0x9c09('0x3f')]){_0x5e61da[_0x9c09('0x3d')]=_[_0x9c09('0x40')](_0x5e61da[_0x9c09('0x3d')],{'$or':_[_0x9c09('0x2a')](_0x5e61da['attributes'],function(_0x2db8a1){var _0x3593fa={};_0x3593fa[_0x2db8a1]={'$like':'%'+_0x5ac606[_0x9c09('0x30')]['filter']+'%'};return _0x3593fa;})});}_0x5e61da=_[_0x9c09('0x40')]({},_0x5e61da,_0x5ac606[_0x9c09('0x48')]);return _0x1f7bbd[_0x9c09('0x53')](_0x5e61da);}})[_0x9c09('0x25')](function(_0x4f8779){if(_0x4f8779){_0x3d57d4=_0x4f8779[_0x9c09('0x37')];if(!_0x5ac606[_0x9c09('0x30')]['hasOwnProperty'](_0x9c09('0x39'))){_0x5e61da[_0x9c09('0x3a')]=qs['limit'](_0x5ac606[_0x9c09('0x30')][_0x9c09('0x3a')]);_0x5e61da[_0x9c09('0x1c')]=qs['offset'](_0x5ac606[_0x9c09('0x30')][_0x9c09('0x1c')]);}return _0x1f7bbd[_0x9c09('0x53')](_0x5e61da);}})[_0x9c09('0x25')](function(_0x1fb4fe){if(_0x1fb4fe){return _0x1fb4fe?{'count':_0x3d57d4,'rows':_0x1fb4fe}:null;}})[_0x9c09('0x25')](respondWithResult(_0x4c41da,null))[_0x9c09('0x45')](handleError(_0x4c41da,null));};exports[_0x9c09('0x55')]=function(_0x367ec0,_0x1b6ead,_0x11d5b7){return db[_0x9c09('0x2b')]['find']({'where':{'id':_0x367ec0['params']['id']}})[_0x9c09('0x25')](handleEntityNotFound(_0x1b6ead,null))[_0x9c09('0x25')](function(_0xa5cf2a){if(_0xa5cf2a){return _0xa5cf2a[_0x9c09('0x55')](_0x367ec0[_0x9c09('0x30')][_0x9c09('0x51')]);}})['then'](respondWithStatusCode(_0x1b6ead,null))['catch'](handleError(_0x1b6ead,null));};exports['addMessage']=function(_0x3d5a93,_0x528dbc,_0x28f1ca){if(_0x3d5a93[_0x9c09('0x4b')]['id']){delete _0x3d5a93[_0x9c09('0x4b')]['id'];}return db['ChatGroup'][_0x9c09('0x49')]({'where':{'id':_0x3d5a93['params']['id']}})['then'](handleEntityNotFound(_0x528dbc,null))[_0x9c09('0x25')](function(_0x5e58c2){if(_0x5e58c2){_0x3d5a93[_0x9c09('0x4b')][_0x9c09('0x56')]=_0x5e58c2['id'];return db[_0x9c09('0x4e')][_0x9c09('0x4a')](_0x3d5a93[_0x9c09('0x4b')]);}})[_0x9c09('0x25')](respondWithResult(_0x528dbc,null))[_0x9c09('0x45')](handleError(_0x528dbc,null));};exports[_0x9c09('0x57')]=function(_0x174804,_0x671c8a,_0x955631){var _0x3ea03d={};var _0xe083ab={};var _0x4ffc7f;var _0x1f2bab;return db[_0x9c09('0x2b')][_0x9c09('0x58')]({'where':{'id':_0x174804[_0x9c09('0x47')]['id']}})[_0x9c09('0x25')](handleEntityNotFound(_0x671c8a,null))[_0x9c09('0x25')](function(_0x37c422){if(_0x37c422){_0x4ffc7f=_0x37c422;_0xe083ab[_0x9c09('0x35')]=_['keys'](db[_0x9c09('0x4e')][_0x9c09('0x2c')]);_0xe083ab[_0x9c09('0x30')]=_['keys'](_0x174804[_0x9c09('0x30')]);_0xe083ab[_0x9c09('0x32')]=_[_0x9c09('0x33')](_0xe083ab[_0x9c09('0x35')],_0xe083ab[_0x9c09('0x30')]);_0x3ea03d[_0x9c09('0x34')]=_['intersection'](_0xe083ab[_0x9c09('0x35')],qs[_0x9c09('0x36')](_0x174804[_0x9c09('0x30')][_0x9c09('0x36')]));_0x3ea03d[_0x9c09('0x34')]=_0x3ea03d[_0x9c09('0x34')][_0x9c09('0x37')]?_0x3ea03d[_0x9c09('0x34')]:_0xe083ab[_0x9c09('0x35')];_0x3ea03d['order']=qs[_0x9c09('0x3c')](_0x174804[_0x9c09('0x30')][_0x9c09('0x3c')]);_0x3ea03d[_0x9c09('0x3d')]=qs[_0x9c09('0x32')](_[_0x9c09('0x3e')](_0x174804[_0x9c09('0x30')],_0xe083ab['filters']));if(_0x174804[_0x9c09('0x30')][_0x9c09('0x3f')]){_0x3ea03d[_0x9c09('0x3d')]=_[_0x9c09('0x40')](_0x3ea03d[_0x9c09('0x3d')],{'$or':_['map'](_0x3ea03d[_0x9c09('0x34')],function(_0x4c981a){var _0x473a90={};_0x473a90[_0x4c981a]={'$like':'%'+_0x174804[_0x9c09('0x30')]['filter']+'%'};return _0x473a90;})});}if(_0x174804[_0x9c09('0x30')][_0x9c09('0x59')]){var _0xe08e76=_0x174804[_0x9c09('0x30')][_0x9c09('0x59')][_0x9c09('0x5a')](',');var _0x542fad={};_0x542fad[_0xe08e76[0x0]]={'$gte':moment(_0xe08e76[0x1])[_0x9c09('0x5b')](_0x9c09('0x5c'))};_0x3ea03d[_0x9c09('0x3d')]=_['merge'](_0x3ea03d[_0x9c09('0x3d')],_0x542fad);}_0x3ea03d=_[_0x9c09('0x40')]({},_0x3ea03d,_0x174804[_0x9c09('0x48')]);return _0x4ffc7f['getMessages'](_0x3ea03d);}})[_0x9c09('0x25')](function(_0x4cbc57){if(_0x4cbc57){_0x1f2bab=_0x4cbc57[_0x9c09('0x37')];if(!_0x174804[_0x9c09('0x30')][_0x9c09('0x38')](_0x9c09('0x39'))){_0x3ea03d[_0x9c09('0x3a')]=qs[_0x9c09('0x3a')](_0x174804[_0x9c09('0x30')][_0x9c09('0x3a')]);_0x3ea03d[_0x9c09('0x1c')]=qs[_0x9c09('0x1c')](_0x174804['query'][_0x9c09('0x1c')]);}return _0x4ffc7f[_0x9c09('0x57')](_0x3ea03d);}})[_0x9c09('0x25')](function(_0x186ce0){if(_0x186ce0){return _0x186ce0?{'count':_0x1f2bab,'rows':_0x186ce0}:null;}})[_0x9c09('0x25')](respondWithResult(_0x671c8a,null))[_0x9c09('0x45')](handleError(_0x671c8a,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index e9eec9b..715dbda 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 _0xfa94=['exports','events','ChatGroup','save','update','emit','hasOwnProperty'];(function(_0x53f693,_0x5afcff){var _0x1e617f=function(_0x59db9a){while(--_0x59db9a){_0x53f693['push'](_0x53f693['shift']());}};_0x1e617f(++_0x5afcff);}(_0xfa94,0xef));var _0x4fa9=function(_0x49b984,_0x387c83){_0x49b984=_0x49b984-0x0;var _0x49d1e0=_0xfa94[_0x49b984];return _0x49d1e0;};'use strict';var EventEmitter=require(_0x4fa9('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x4fa9('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4fa9('0x2'),'afterUpdate':_0x4fa9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x40e2f6){return function(_0xa08385,_0xe1adab,_0x22e87d){ChatGroupEvents[_0x4fa9('0x4')](_0x40e2f6+':'+_0xa08385['id'],_0xa08385);ChatGroupEvents[_0x4fa9('0x4')](_0x40e2f6,_0xa08385);_0x22e87d(null);};}for(var e in events){if(events[_0x4fa9('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x4fa9('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0xef4b=['emit','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x4421a7,_0x11ee9e){var _0x38250a=function(_0x4cd9a7){while(--_0x4cd9a7){_0x4421a7['push'](_0x4421a7['shift']());}};_0x38250a(++_0x11ee9e);}(_0xef4b,0x17b));var _0xbef4=function(_0x335f37,_0x37302b){_0x335f37=_0x335f37-0x0;var _0x1768f4=_0xef4b[_0x335f37];return _0x1768f4;};'use strict';var EventEmitter=require(_0xbef4('0x0'));var ChatGroup=require(_0xbef4('0x1'))['db'][_0xbef4('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbef4('0x3')](0x0);var events={'afterCreate':_0xbef4('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3533dd){return function(_0x3e66b3,_0x44eb93,_0x1ad210){ChatGroupEvents[_0xbef4('0x5')](_0x3533dd+':'+_0x3e66b3['id'],_0x3e66b3);ChatGroupEvents[_0xbef4('0x5')](_0x3533dd,_0x3e66b3);_0x1ad210(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](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 9f0b6ec..6f873a8 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 _0x282a=['request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','../../config/logger','api','moment','bluebird'];(function(_0x457cd6,_0x4d8bba){var _0x366513=function(_0x1ac550){while(--_0x1ac550){_0x457cd6['push'](_0x457cd6['shift']());}};_0x366513(++_0x4d8bba);}(_0x282a,0xd8));var _0xa282=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x282a[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa282('0x0'))(_0xa282('0x1'));var moment=require(_0xa282('0x2'));var BPromise=require(_0xa282('0x3'));var rp=require(_0xa282('0x4'));var fs=require('fs');var path=require(_0xa282('0x5'));var rimraf=require('rimraf');var config=require(_0xa282('0x6'));var attributes=require(_0xa282('0x7'));module[_0xa282('0x8')]=function(_0x5c29f6,_0x28710c){return _0x5c29f6[_0xa282('0x9')]('ChatGroup',attributes,{'tableName':_0xa282('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb4e3=['path','./chatGroup.attributes','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1ed5be,_0x34fd21){var _0x4154a7=function(_0x1bffb6){while(--_0x1bffb6){_0x1ed5be['push'](_0x1ed5be['shift']());}};_0x4154a7(++_0x34fd21);}(_0xb4e3,0x180));var _0x3b4e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xb4e3[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x3b4e('0x0'));var util=require(_0x3b4e('0x1'));var logger=require(_0x3b4e('0x2'))(_0x3b4e('0x3'));var moment=require(_0x3b4e('0x4'));var BPromise=require(_0x3b4e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b4e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3b4e('0x7'));module['exports']=function(_0x515f0a,_0x52ae03){return _0x515f0a['define'](_0x3b4e('0x8'),attributes,{'tableName':_0x3b4e('0x9'),'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 518d336..e92131d 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 _0x6d6f=['error','ChatGroup,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','redis','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','stringify'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6d6f,0x159));var _0xf6d6=function(_0x462fe4,_0x394d3e){_0x462fe4=_0x462fe4-0x0;var _0x82b23a=_0x6d6f[_0x462fe4];return _0x82b23a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf6d6('0x0'));var rs=require(_0xf6d6('0x1'));var fs=require('fs');var Redis=require(_0xf6d6('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf6d6('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xf6d6('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xf6d6('0x5')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xf6d6('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xf6d6('0x7'))(new Redis(config[_0xf6d6('0x6')]));require(_0xf6d6('0x8'))[_0xf6d6('0x9')](socket);function respondWithRpcPromise(_0x3f6a6c,_0x104461,_0x411773){return new BPromise(function(_0x4bb47a,_0x4b1f52){return client[_0xf6d6('0xa')](_0x3f6a6c,_0x411773)[_0xf6d6('0xb')](function(_0x37e17c){logger[_0xf6d6('0xc')]('ChatGroup,\x20%s,\x20%s',_0x104461,_0xf6d6('0xd'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x104461,_0xf6d6('0xd'),JSON[_0xf6d6('0xe')](_0x37e17c));if(_0x37e17c[_0xf6d6('0xf')]){if(_0x37e17c[_0xf6d6('0xf')]['code']===0x1f4){logger['error'](_0xf6d6('0x10'),_0x104461,_0x37e17c[_0xf6d6('0xf')][_0xf6d6('0x11')]);return _0x4b1f52(_0x37e17c[_0xf6d6('0xf')]['message']);}logger[_0xf6d6('0xf')](_0xf6d6('0x10'),_0x104461,_0x37e17c['error']['message']);return _0x4bb47a(_0x37e17c['error'][_0xf6d6('0x11')]);}else{logger[_0xf6d6('0xc')](_0xf6d6('0x10'),_0x104461,_0xf6d6('0xd'));_0x4bb47a(_0x37e17c[_0xf6d6('0x12')][_0xf6d6('0x11')]);}})[_0xf6d6('0x13')](function(_0x21d74a){logger[_0xf6d6('0xf')](_0xf6d6('0x10'),_0x104461,_0x21d74a);_0x4b1f52(_0x21d74a);});});}
\ No newline at end of file
+var _0x9dc3=['info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','then'];(function(_0x54e333,_0x4ba478){var _0x47279e=function(_0x8e4f0b){while(--_0x8e4f0b){_0x54e333['push'](_0x54e333['shift']());}};_0x47279e(++_0x4ba478);}(_0x9dc3,0xa5));var _0x39dc=function(_0x44bf47,_0x23b58b){_0x44bf47=_0x44bf47-0x0;var _0x43c7e2=_0x9dc3[_0x44bf47];return _0x43c7e2;};'use strict';var _=require(_0x39dc('0x0'));var util=require(_0x39dc('0x1'));var moment=require(_0x39dc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39dc('0x3'));var db=require(_0x39dc('0x4'))['db'];var utils=require(_0x39dc('0x5'));var logger=require(_0x39dc('0x6'))(_0x39dc('0x7'));var config=require(_0x39dc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x39dc('0x9')][_0x39dc('0xa')]({'port':0x232a});config[_0x39dc('0xb')]=_[_0x39dc('0xc')](config[_0x39dc('0xb')],{'host':_0x39dc('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')[_0x39dc('0xe')](socket);function respondWithRpcPromise(_0x44f334,_0x16bbbd,_0xffe473){return new BPromise(function(_0x2b4d22,_0x1eebb1){return client[_0x39dc('0xf')](_0x44f334,_0xffe473)[_0x39dc('0x10')](function(_0x54490e){logger[_0x39dc('0x11')](_0x39dc('0x12'),_0x16bbbd,_0x39dc('0x13'));logger[_0x39dc('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x16bbbd,_0x39dc('0x13'),JSON[_0x39dc('0x15')](_0x54490e));if(_0x54490e[_0x39dc('0x16')]){if(_0x54490e['error'][_0x39dc('0x17')]===0x1f4){logger[_0x39dc('0x16')](_0x39dc('0x12'),_0x16bbbd,_0x54490e[_0x39dc('0x16')][_0x39dc('0x18')]);return _0x1eebb1(_0x54490e['error'][_0x39dc('0x18')]);}logger[_0x39dc('0x16')](_0x39dc('0x12'),_0x16bbbd,_0x54490e[_0x39dc('0x16')][_0x39dc('0x18')]);return _0x2b4d22(_0x54490e[_0x39dc('0x16')][_0x39dc('0x18')]);}else{logger['info'](_0x39dc('0x12'),_0x16bbbd,_0x39dc('0x13'));_0x2b4d22(_0x54490e['result']['message']);}})[_0x39dc('0x19')](function(_0x11fb9b){logger[_0x39dc('0x16')](_0x39dc('0x12'),_0x16bbbd,_0x11fb9b);_0x1eebb1(_0x11fb9b);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 8a6277a..5b00734 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 _0x0801=['removeListener','register','chatGroup:','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0801,0x9f));var _0x1080=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x0801[_0x5d2803];return _0xdcad2c;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save','remove','update'];function createListener(_0x5acf44,_0x2d9a11){return function(_0x584267){_0x2d9a11[_0x1080('0x0')](_0x5acf44,_0x584267);};}function removeListener(_0x4a0e44,_0x15a70f){return function(){ChatGroupEvents[_0x1080('0x1')](_0x4a0e44,_0x15a70f);};}exports[_0x1080('0x2')]=function(_0x3d1614){for(var _0xfda756=0x0,_0x4e7822=events['length'];_0xfda756<_0x4e7822;_0xfda756++){var _0x23cc58=events[_0xfda756];var _0x57cdab=createListener(_0x1080('0x3')+_0x23cc58,_0x3d1614);ChatGroupEvents['on'](_0x23cc58,_0x57cdab);}};
\ No newline at end of file
+var _0xa107=['emit','register','length','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xa107,0xcc));var _0x7a10=function(_0x5d92d5,_0x44806a){_0x5d92d5=_0x5d92d5-0x0;var _0x23d3f8=_0xa107[_0x5d92d5];return _0x23d3f8;};'use strict';var ChatGroupEvents=require(_0x7a10('0x0'));var events=[_0x7a10('0x1'),_0x7a10('0x2'),_0x7a10('0x3')];function createListener(_0x1d1e59,_0x8e0dbf){return function(_0x3fc060){_0x8e0dbf[_0x7a10('0x4')](_0x1d1e59,_0x3fc060);};}function removeListener(_0x31e537,_0x34ed32){return function(){ChatGroupEvents['removeListener'](_0x31e537,_0x34ed32);};}exports[_0x7a10('0x5')]=function(_0x3e1724){for(var _0x58666a=0x0,_0x24b0ca=events[_0x7a10('0x6')];_0x58666a<_0x24b0ca;_0x58666a++){var _0xd25ea7=events[_0x58666a];var _0x319f77=createListener(_0x7a10('0x7')+_0xd25ea7,_0x3e1724);ChatGroupEvents['on'](_0xd25ea7,_0x319f77);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 89ef4cd..599d06a 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 _0x584d=['isAuthenticated','index','/:id','show','/:id/unread','getUnread','/:id/messages','post','create','/:id/members','put','update','delete','destroy','removeMembers','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./chatGroup.controller','get'];(function(_0x1020f3,_0x54f5ce){var _0x3ad75c=function(_0xc6fe4f){while(--_0xc6fe4f){_0x1020f3['push'](_0x1020f3['shift']());}};_0x3ad75c(++_0x54f5ce);}(_0x584d,0x148));var _0xd584=function(_0x3a5c5c,_0x173174){_0x3a5c5c=_0x3a5c5c-0x0;var _0xf03dcc=_0x584d[_0x3a5c5c];return _0xf03dcc;};'use strict';var multer=require(_0xd584('0x0'));var util=require(_0xd584('0x1'));var path=require('path');var timeout=require(_0xd584('0x2'));var express=require(_0xd584('0x3'));var router=express['Router']();var fs_extra=require(_0xd584('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd584('0x5'));var config=require('../../config/environment');var controller=require(_0xd584('0x6'));router[_0xd584('0x7')]('/',auth[_0xd584('0x8')](),controller[_0xd584('0x9')]);router['get']('/describe',auth[_0xd584('0x8')](),controller['describe']);router[_0xd584('0x7')](_0xd584('0xa'),auth[_0xd584('0x8')](),controller[_0xd584('0xb')]);router['get'](_0xd584('0xc'),auth[_0xd584('0x8')](),controller[_0xd584('0xd')]);router[_0xd584('0x7')]('/:id/members',auth[_0xd584('0x8')](),controller['getMembers']);router[_0xd584('0x7')](_0xd584('0xe'),auth[_0xd584('0x8')](),controller['getMessages']);router[_0xd584('0xf')]('/',auth['isAuthenticated'](),controller[_0xd584('0x10')]);router[_0xd584('0xf')](_0xd584('0x11'),auth[_0xd584('0x8')](),controller['addMembers']);router[_0xd584('0xf')](_0xd584('0xe'),auth['isAuthenticated'](),controller['addMessage']);router[_0xd584('0x12')](_0xd584('0xa'),auth['isAuthenticated'](),controller[_0xd584('0x13')]);router[_0xd584('0x14')](_0xd584('0xa'),auth['isAuthenticated'](),controller[_0xd584('0x15')]);router[_0xd584('0x14')](_0xd584('0x11'),auth['isAuthenticated'](),controller[_0xd584('0x16')]);module[_0xd584('0x17')]=router;
\ No newline at end of file
+var _0x25e2=['./chatGroup.controller','get','isAuthenticated','describe','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages','post','addMembers','addMessage','put','delete','removeMembers','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2e94e0,_0x2d2c89){var _0x1fff4c=function(_0x3c0c78){while(--_0x3c0c78){_0x2e94e0['push'](_0x2e94e0['shift']());}};_0x1fff4c(++_0x2d2c89);}(_0x25e2,0x170));var _0x225e=function(_0x15044a,_0x42f0d7){_0x15044a=_0x15044a-0x0;var _0x2b0308=_0x25e2[_0x15044a];return _0x2b0308;};'use strict';var multer=require('multer');var util=require(_0x225e('0x0'));var path=require(_0x225e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x225e('0x2')]();var fs_extra=require(_0x225e('0x3'));var auth=require(_0x225e('0x4'));var interaction=require(_0x225e('0x5'));var config=require('../../config/environment');var controller=require(_0x225e('0x6'));router[_0x225e('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x225e('0x7')]('/describe',auth[_0x225e('0x8')](),controller[_0x225e('0x9')]);router[_0x225e('0x7')](_0x225e('0xa'),auth['isAuthenticated'](),controller[_0x225e('0xb')]);router[_0x225e('0x7')](_0x225e('0xc'),auth[_0x225e('0x8')](),controller['getUnread']);router['get'](_0x225e('0xd'),auth[_0x225e('0x8')](),controller[_0x225e('0xe')]);router[_0x225e('0x7')](_0x225e('0xf'),auth[_0x225e('0x8')](),controller['getMessages']);router[_0x225e('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x225e('0x10')](_0x225e('0xd'),auth['isAuthenticated'](),controller[_0x225e('0x11')]);router[_0x225e('0x10')](_0x225e('0xf'),auth[_0x225e('0x8')](),controller[_0x225e('0x12')]);router[_0x225e('0x13')](_0x225e('0xa'),auth[_0x225e('0x8')](),controller['update']);router['delete'](_0x225e('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0x225e('0x14')]('/:id/members',auth[_0x225e('0x8')](),controller[_0x225e('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index def9858..50a1bea 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 _0x8b29=['sequelize','BOOLEAN','INTEGER','thumb','star','TEXT','DATE','STRING','long','out'];(function(_0x121bbd,_0x558daf){var _0x553c53=function(_0x320a7d){while(--_0x320a7d){_0x121bbd['push'](_0x121bbd['shift']());}};_0x553c53(++_0x558daf);}(_0x8b29,0xbe));var _0x98b2=function(_0x1518db,_0x3dc644){_0x1518db=_0x1518db-0x0;var _0x102ccf=_0x8b29[_0x1518db];return _0x102ccf;};'use strict';var Sequelize=require(_0x98b2('0x0'));module['exports']={'closed':{'type':Sequelize[_0x98b2('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x98b2('0x2')]},'ratingType':{'type':Sequelize['ENUM']('star',_0x98b2('0x3')),'defaultValue':_0x98b2('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x98b2('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x98b2('0x6')]},'disposition':{'type':Sequelize[_0x98b2('0x7')]},'secondDisposition':{'type':Sequelize[_0x98b2('0x7')]},'thirdDisposition':{'type':Sequelize[_0x98b2('0x7')]},'note':{'type':Sequelize[_0x98b2('0x7')]},'browserName':{'type':Sequelize[_0x98b2('0x7')]},'browserVersion':{'type':Sequelize[_0x98b2('0x7')]},'osName':{'type':Sequelize[_0x98b2('0x7')]},'osVersion':{'type':Sequelize[_0x98b2('0x7')]},'deviceModel':{'type':Sequelize[_0x98b2('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x98b2('0x5')]},'customerIp':{'type':Sequelize[_0x98b2('0x7')]},'formData':{'type':Sequelize[_0x98b2('0x5')](_0x98b2('0x8'))},'read1stAt':{'type':Sequelize[_0x98b2('0x6')]},'lastMsgAt':{'type':Sequelize[_0x98b2('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x98b2('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x98b2('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x98b2('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x98b2('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0972=['BOOLEAN','exports','INTEGER','star','thumb','TEXT','STRING','DATE','long','ENUM','out'];(function(_0xf96956,_0x201650){var _0x314653=function(_0x4c37e5){while(--_0x4c37e5){_0xf96956['push'](_0xf96956['shift']());}};_0x314653(++_0x201650);}(_0x0972,0x64));var _0x2097=function(_0x54b5d5,_0x4631a5){_0x54b5d5=_0x54b5d5-0x0;var _0x23ecb7=_0x0972[_0x54b5d5];return _0x23ecb7;};'use strict';var Sequelize=require('sequelize');module[_0x2097('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2097('0x1')]},'ratingType':{'type':Sequelize['ENUM'](_0x2097('0x2'),_0x2097('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x2097('0x4')]},'pathTranscript':{'type':Sequelize[_0x2097('0x4')]},'mailTranscript':{'type':Sequelize[_0x2097('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2097('0x6')]},'disposition':{'type':Sequelize[_0x2097('0x5')]},'secondDisposition':{'type':Sequelize[_0x2097('0x5')]},'thirdDisposition':{'type':Sequelize[_0x2097('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x2097('0x5')]},'browserVersion':{'type':Sequelize[_0x2097('0x5')]},'osName':{'type':Sequelize[_0x2097('0x5')]},'osVersion':{'type':Sequelize[_0x2097('0x5')]},'deviceModel':{'type':Sequelize[_0x2097('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x2097('0x5')]},'referer':{'type':Sequelize[_0x2097('0x4')]},'customerIp':{'type':Sequelize[_0x2097('0x5')]},'formData':{'type':Sequelize[_0x2097('0x4')](_0x2097('0x7'))},'read1stAt':{'type':Sequelize[_0x2097('0x6')]},'lastMsgAt':{'type':Sequelize[_0x2097('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x2097('0x8')]('in',_0x2097('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2097('0x5')]},'customerPort':{'type':Sequelize[_0x2097('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x2097('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x2097('0xa')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index f71e296..2ed6389 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 _0x0abf=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','select','field','color','from','tools_tags','user_has_chat_interactions','users','chat_interactions','left_join','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','SELECT','clone','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','include','options','params','describe','ChatWebsite','findOne','vidaooApiKey','vidaooTopic','vidaooMetadata','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','create','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','download','mailTranscript','format','transcript-%s.txt','now','User','CmContact','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','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','pick','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','root','attachments','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','firstName','views','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json','offset','undefined','limit','count','reject','update','destroy','end','stack','name','render','merge','body','contact','agent','account','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','rawAttributes','fieldName','type','key','model'];(function(_0x42c841,_0x5e8840){var _0x213b83=function(_0x543571){while(--_0x543571){_0x42c841['push'](_0x42c841['shift']());}};_0x213b83(++_0x5e8840);}(_0x0abf,0xe8));var _0xf0ab=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x0abf[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0xf0ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ab('0x1'));var jsonpatch=require(_0xf0ab('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0ab('0x3'));var Mustache=require('mustache');var util=require(_0xf0ab('0x4'));var path=require(_0xf0ab('0x5'));var sox=require(_0xf0ab('0x6'));var csv=require(_0xf0ab('0x7'));var ejs=require(_0xf0ab('0x8'));var fs=require('fs');var fs_extra=require(_0xf0ab('0x9'));var _=require(_0xf0ab('0xa'));var squel=require('squel');var crypto=require(_0xf0ab('0xb'));var jsforce=require(_0xf0ab('0xc'));var deskjs=require(_0xf0ab('0xd'));var toCsv=require(_0xf0ab('0x7'));var querystring=require('querystring');var Papa=require(_0xf0ab('0xe'));var Redis=require(_0xf0ab('0xf'));var authService=require(_0xf0ab('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xf0ab('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0ab('0x12'))(_0xf0ab('0x13'));var utils=require(_0xf0ab('0x14'));var config=require(_0xf0ab('0x15'));var licenseUtil=require(_0xf0ab('0x16'));var db=require(_0xf0ab('0x17'))['db'];config[_0xf0ab('0x18')]=_['defaults'](config[_0xf0ab('0x18')],{'host':_0xf0ab('0x19'),'port':0x18eb});var socket=require(_0xf0ab('0x1a'))(new Redis(config[_0xf0ab('0x18')]));require(_0xf0ab('0x1b'))[_0xf0ab('0x1c')](socket);var jayson=require(_0xf0ab('0x1d'));var client=jayson[_0xf0ab('0x1e')][_0xf0ab('0x1f')]({'port':0x232b});var client9004=jayson[_0xf0ab('0x1e')][_0xf0ab('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x221bac,_0x200cf5,_0x2f4618,_0x230f40){return new BPromise(function(_0x54b0ce,_0x457465){var _0x9e3b47=_0x230f40||client;return _0x9e3b47[_0xf0ab('0x20')](_0x221bac,_0x2f4618)[_0xf0ab('0x21')](function(_0x776619){logger[_0xf0ab('0x22')](_0xf0ab('0x23'),_0x200cf5,_0xf0ab('0x24'));logger[_0xf0ab('0x25')](_0xf0ab('0x26'),_0x200cf5,_0xf0ab('0x24'),JSON[_0xf0ab('0x27')](_0x776619));if(_0x776619[_0xf0ab('0x28')]){if(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x29')]===0x1f4){logger[_0xf0ab('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);return _0x457465(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);}logger[_0xf0ab('0x28')](_0xf0ab('0x23'),_0x200cf5,_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);return _0x54b0ce(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);}else{logger[_0xf0ab('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,'request\x20sent');_0x54b0ce(_0x776619['result'][_0xf0ab('0x2a')]);}})['catch'](function(_0x3eca32){logger[_0xf0ab('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,_0x3eca32);_0x457465(_0x3eca32);});});}function respondWithStatusCode(_0x163078,_0x22671e){_0x22671e=_0x22671e||0xcc;return function(_0x10bf5f){if(_0x10bf5f){return _0x163078[_0xf0ab('0x2b')](_0x22671e);}return _0x163078[_0xf0ab('0x2c')](_0x22671e)['end']();};}function respondWithResult(_0x2d0da7,_0x574ce7){_0x574ce7=_0x574ce7||0xc8;return function(_0x55d799){if(_0x55d799){return _0x2d0da7[_0xf0ab('0x2c')](_0x574ce7)[_0xf0ab('0x2d')](_0x55d799);}};}function respondWithFilteredResult(_0x1b223d,_0x445160){return function(_0x43476c){if(_0x43476c){var _0x174052=typeof _0x445160[_0xf0ab('0x2e')]===_0xf0ab('0x2f')&&typeof _0x445160[_0xf0ab('0x30')]===_0xf0ab('0x2f');var _0x21e8ac=_0x43476c[_0xf0ab('0x31')];var _0x58cbe1=_0x174052?0x0:_0x445160[_0xf0ab('0x2e')];var _0x35973a=_0x174052?_0x43476c['count']:_0x445160['offset']+_0x445160[_0xf0ab('0x30')];var _0x1dc84e;if(_0x35973a>=_0x21e8ac){_0x35973a=_0x21e8ac;_0x1dc84e=0xc8;}else{_0x1dc84e=0xce;}_0x1b223d[_0xf0ab('0x2c')](_0x1dc84e);return _0x1b223d['set']('Content-Range',_0x58cbe1+'-'+_0x35973a+'/'+_0x21e8ac)[_0xf0ab('0x2d')](_0x43476c);}return null;};}function patchUpdates(_0x58fa03){return function(_0x1cfd52){try{jsonpatch['apply'](_0x1cfd52,_0x58fa03,!![]);}catch(_0x3f66fa){return BPromise[_0xf0ab('0x32')](_0x3f66fa);}return _0x1cfd52['save']();};}function saveUpdates(_0x56e728,_0x469f42){return function(_0x27c6f9){if(_0x27c6f9){return _0x27c6f9[_0xf0ab('0x33')](_0x56e728)[_0xf0ab('0x21')](function(_0x2519c7){return _0x2519c7;});}return null;};}function removeEntity(_0x36195d,_0x17f3b3){return function(_0xf8f0f4){if(_0xf8f0f4){return _0xf8f0f4[_0xf0ab('0x34')]()[_0xf0ab('0x21')](function(){_0x36195d[_0xf0ab('0x2c')](0xcc)[_0xf0ab('0x35')]();});}};}function handleEntityNotFound(_0x22dcfe,_0x437fdb){return function(_0x5d8443){if(!_0x5d8443){_0x22dcfe[_0xf0ab('0x2b')](0x194);}return _0x5d8443;};}function handleError(_0x45c449,_0xc575ed){_0xc575ed=_0xc575ed||0x1f4;return function(_0x5c9192){logger[_0xf0ab('0x28')](_0x5c9192[_0xf0ab('0x36')]);if(_0x5c9192[_0xf0ab('0x37')]){delete _0x5c9192['name'];}_0x45c449[_0xf0ab('0x2c')](_0xc575ed)['send'](_0x5c9192);};}function getMustacheRender(_0xda3971,_0x492d7c){return Mustache[_0xf0ab('0x38')](_0xda3971,_[_0xf0ab('0x39')](_0x492d7c[_0xf0ab('0x3a')],{'contact':_0x492d7c[_0xf0ab('0x3b')],'message':_0x492d7c[_0xf0ab('0x2a')],'agent':_0x492d7c[_0xf0ab('0x3c')],'interaction':_0x492d7c['interaction'],'account':_0x492d7c[_0xf0ab('0x3d')]}))||'';}function getInteractionUsers(_0x683d08,_0x5a6df5){return new BPromise(function(_0x207fbb,_0xce89bc){try{if(_0x5a6df5[_0x683d08['id']]){_0x683d08[_0xf0ab('0x3e')]=_[_0xf0ab('0x3f')](_0x5a6df5[_0x683d08['id']],function(_0x31fa72){return{'id':_0x31fa72['id'],'fullname':_0x31fa72[_0xf0ab('0x40')]};});}}catch(_0x28c20c){_0xce89bc(_0x28c20c);}_0x207fbb(_0x683d08);});}function getInteractionTags(_0x528d4b,_0x406a1d){return new BPromise(function(_0x4f6e93,_0x7c4629){try{if(_0x528d4b['TagIds']){_0x528d4b[_0xf0ab('0x41')]=[];_0x528d4b[_0xf0ab('0x42')][_0xf0ab('0x43')](',')[_0xf0ab('0x44')](function(_0x2b7ed5){_0x528d4b['Tags'][_0xf0ab('0x45')](_0x406a1d[_0x2b7ed5]);});}delete _0x528d4b[_0xf0ab('0x42')];}catch(_0x28e7a4){_0x7c4629(_0x28e7a4);}_0x4f6e93(_0x528d4b);});}function updateChatInteraction(_0x197955,_0x191caf,_0x17a73){return new BPromise(function(_0x45849c,_0x413f5c){return getInteractionUsers(_0x197955,_0x17a73)[_0xf0ab('0x21')](function(_0x3b214a){return getInteractionTags(_0x3b214a,_0x191caf);})[_0xf0ab('0x21')](function(_0x32ec93){_0x45849c(_0x32ec93);})[_0xf0ab('0x46')](function(_0x5e6b6b){_0x413f5c(_0x5e6b6b);});});}exports['index']=function(_0x2fc677,_0x4e6c41){var _0x1fc766={},_0x2d50c0={},_0x4bbdf6={'count':0x0,'rows':[]};var _0x8c2d2c=_[_0xf0ab('0x3f')](db['ChatInteraction'][_0xf0ab('0x47')],function(_0x29cc6a){return{'name':_0x29cc6a[_0xf0ab('0x48')],'type':_0x29cc6a[_0xf0ab('0x49')][_0xf0ab('0x4a')]};});_0x2d50c0[_0xf0ab('0x4b')]=_[_0xf0ab('0x3f')](_0x8c2d2c,_0xf0ab('0x37'));_0x2d50c0[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x2fc677[_0xf0ab('0x4c')]);_0x2d50c0[_0xf0ab('0x4e')]=_[_0xf0ab('0x4f')](_0x2d50c0[_0xf0ab('0x4b')],_0x2d50c0['query']);_0x1fc766['attributes']=_[_0xf0ab('0x4f')](_0x2d50c0['model'],qs['fields'](_0x2fc677['query'][_0xf0ab('0x50')]));_0x1fc766[_0xf0ab('0x51')]=_0x1fc766[_0xf0ab('0x51')][_0xf0ab('0x52')]?_0x1fc766[_0xf0ab('0x51')]:_0x2d50c0[_0xf0ab('0x4b')];if(!_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x53')](_0xf0ab('0x54'))){_0x1fc766[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x2fc677[_0xf0ab('0x4c')]['limit']);_0x1fc766[_0xf0ab('0x2e')]=qs[_0xf0ab('0x2e')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x2e')]);}_0x1fc766[_0xf0ab('0x55')]=qs[_0xf0ab('0x56')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x56')]);_0x1fc766['where']=qs['filters'](_['pick'](_0x2fc677[_0xf0ab('0x4c')],_0x2d50c0[_0xf0ab('0x4e')]),_0x8c2d2c);var _0x577c85=[];var _0xa1a416=squel[_0xf0ab('0x57')]()['field']('id')[_0xf0ab('0x58')](_0xf0ab('0x37'))[_0xf0ab('0x58')](_0xf0ab('0x59'))[_0xf0ab('0x5a')](_0xf0ab('0x5b'));var _0x26508b=squel['select']()[_0xf0ab('0x58')]('u.id')[_0xf0ab('0x58')]('u.fullname')[_0xf0ab('0x58')]('ui.ChatInteractionId')['from'](_0xf0ab('0x5c'),'ui')['left_join'](_0xf0ab('0x5d'),'u','u.id\x20=\x20ui.UserId');var _0x2eff07=squel['select']()[_0xf0ab('0x5a')](_0xf0ab('0x5e'),'i')[_0xf0ab('0x5f')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xf0ab('0x5d'),'o',_0xf0ab('0x60'))['left_join']('chat_websites','a',_0xf0ab('0x61'))[_0xf0ab('0x5f')](_0xf0ab('0x62'),'me',_0xf0ab('0x63'))[_0xf0ab('0x5f')](_0xf0ab('0x64'),'it',_0xf0ab('0x65'))[_0xf0ab('0x5f')](_0xf0ab('0x5b'),'t',_0xf0ab('0x66'));var _0x1e6a4e=squel['expr']();var _0x41ed17=[];var _0x5b24e3=squel[_0xf0ab('0x67')]();var _0x61d3db;if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x68')]){_0x61d3db=as[_0xf0ab('0x69')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x68')]);var _0x1f11aa=_0x61d3db[_0xf0ab('0x6a')];for(var _0x180ee6=0x0;_0x180ee6<_0x61d3db['conditions'][_0xf0ab('0x52')];_0x180ee6++){var _0x2266f3=_0x61d3db[_0xf0ab('0x6b')][_0x180ee6];var _0x1d4a72='i';var _0x2232eb=_[_0xf0ab('0x6c')](_0x8c2d2c,[_0xf0ab('0x37'),_0x2266f3[_0xf0ab('0x58')]]);if(!_0x2232eb){switch(_0x2266f3[_0xf0ab('0x58')]){case'unreadMessages':if(_0x2266f3['value']==0x1){_0x2eff07[_0xf0ab('0x6d')]('`'+_0x2266f3[_0xf0ab('0x58')]+_0xf0ab('0x6e'));}else{_0x2eff07['having']('`'+_0x2266f3[_0xf0ab('0x58')]+_0xf0ab('0x6f'));}break;case _0xf0ab('0x70'):if(_0x2266f3['operator']===_0xf0ab('0x71')){if(_0x2266f3[_0xf0ab('0x72')][_0xf0ab('0x43')]('\x20')[_0xf0ab('0x52')]>0x1){_0x1e6a4e[_0x1f11aa](_0xf0ab('0x73'),qs['getFullTextValue'](_0x2266f3[_0xf0ab('0x72')]),null);}else{var _0x70b02d='%'+_0x2266f3[_0xf0ab('0x72')]+'%';_0x1e6a4e[_0x1f11aa](_0xf0ab('0x74'),_0x70b02d,_0x70b02d,_0x70b02d);}}else{_0x2232eb=_[_0xf0ab('0x6c')](_0x8c2d2c,[_0xf0ab('0x37'),_0xf0ab('0x75')]);_0x2266f3[_0xf0ab('0x58')]=_0xf0ab('0x75');_0x5154f5=as[_0xf0ab('0x76')](_0x1d4a72,_0x2232eb[_0xf0ab('0x49')],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')]['start'],_0x5154f5['value'][_0xf0ab('0x35')]);}break;case _0xf0ab('0x78'):var _0x325ad6=_0x2266f3['value'][_0xf0ab('0x43')](',')['map'](function(_0x1a32dc){return Number(_0x1a32dc);});_0x325ad6[_0xf0ab('0x44')](function(_0x1787e2){_0x5b24e3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1787e2+',%');});_0x41ed17=_[_0xf0ab('0x79')](_0x41ed17,_0x325ad6);break;case'User':if(_0x2266f3['operator']===_0xf0ab('0x71')){_0x1e6a4e[_0x1f11aa](_0xf0ab('0x7a'),'%'+_0x2266f3[_0xf0ab('0x72')]+'%',null);}else{_0x2232eb=_['find'](_0x8c2d2c,[_0xf0ab('0x37'),_0xf0ab('0x7b')]);_0x2266f3[_0xf0ab('0x58')]=_0xf0ab('0x7b');_0x5154f5=as['buildExpression'](_0x1d4a72,_0x2232eb['type'],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5['text'],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);}break;case _0xf0ab('0x3a'):_0x5154f5=as[_0xf0ab('0x76')]('me',null,_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);break;}}else{var _0x5154f5=as[_0xf0ab('0x76')](_0x1d4a72,_0x2232eb[_0xf0ab('0x49')],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);}}}else{var _0x42f067=_(_0x2fc677['query'])[_0xf0ab('0x4d')]()[_0xf0ab('0x3f')](function(_0x4c8e95){return _['some'](_0x8c2d2c,['name',_0x4c8e95])?_0x4c8e95:undefined;})[_0xf0ab('0x7d')]()[_0xf0ab('0x72')]();if(!_[_0xf0ab('0x7e')](_0x42f067)){_0x42f067[_0xf0ab('0x44')](function(_0x15aa78){if(_0x15aa78===_0xf0ab('0x7f')){_0x2eff07['where'](_0xf0ab('0x80'),[]['concat'](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]));}else if(_0x15aa78==='createdAt'){var _0x2978a9=JSON['parse'](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78])['$gte'];var _0x58ca28=JSON[_0xf0ab('0x81')](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78])[_0xf0ab('0x82')];_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x84'),_0x2978a9,_0x58ca28);}else{if(_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]===_0xf0ab('0x85')){_0x2eff07[_0xf0ab('0x83')]('i.'+_0x15aa78+_0xf0ab('0x86'));}else{_0x2eff07[_0xf0ab('0x83')]('i.'+_0x15aa78+_0xf0ab('0x87'),_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]);}}});}if(_0x2fc677[_0xf0ab('0x4c')]['read']){if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x88')]==0x1){_0x2eff07[_0xf0ab('0x6d')](_0xf0ab('0x89'));}else{_0x2eff07[_0xf0ab('0x6d')](_0xf0ab('0x8a'));}}if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')]){_0x41ed17=_[_0xf0ab('0x8c')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')])?_0x2fc677[_0xf0ab('0x4c')]['tag']:new Array(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')]);_0x41ed17[_0xf0ab('0x44')](function(_0x2196a7){_0x5b24e3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2196a7+',%');});}if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8d')]){var _0x4463cc=_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8d')]['replace']('\x5c','\x5c\x5c')[_0xf0ab('0x8e')](/'/g,'\x27\x27');if(qs[_0xf0ab('0x8f')](_0x4463cc)){_0x1e6a4e['or']('i.id\x20LIKE\x20?',_0x4463cc+'%');}else{_0x1e6a4e['or'](_0xf0ab('0x90'),qs['getFullTextValue'](_0x4463cc))['or'](_0xf0ab('0x91'),_0x4463cc+'%');}}}_0x2eff07[_0xf0ab('0x83')](_0x1e6a4e);_0x2eff07['group'](_0xf0ab('0x92'));var _0x148a72={'type':db['Sequelize']['QueryTypes'][_0xf0ab('0x93')],'raw':!![]};var _0x58140c=_0x2eff07[_0xf0ab('0x94')]();_0x58140c[_0xf0ab('0x58')]('i.id');_0x58140c['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf0ab('0x95'));if(_0x1fc766[_0xf0ab('0x55')]){_0x1fc766[_0xf0ab('0x55')][_0xf0ab('0x44')](function(_0x49c89f){var _0x272f9c=_0x49c89f[0x0]===_0xf0ab('0x96')?_0x49c89f[0x0]:'i.'+_0x49c89f[0x0];_0x2eff07[_0xf0ab('0x55')](_0x272f9c,_0x49c89f[0x1]===_0xf0ab('0x97')?![]:!![]);});}if(!_[_0xf0ab('0x7e')](_0x41ed17)){_0x2eff07['having'](_0x5b24e3);_0x58140c['where'](_0xf0ab('0x98'),_0x41ed17);}BPromise[_0xf0ab('0x99')]()['then'](function(){if(!_0x61d3db){if(_0x2fc677['query'][_0xf0ab('0x7f')])return;_0x58140c[_0xf0ab('0x83')](_0xf0ab('0x9a'));_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x9a'));return;}if(_0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9c')]!==_0xf0ab('0x3c'))return;return _0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9d')]({'attributes':['id'],'raw':!![]})[_0xf0ab('0x21')](function(_0x52eca9){if(_['isEmpty'](_0x52eca9)){_0x58140c[_0xf0ab('0x83')]('i.ChatWebsiteId\x20IS\x20NULL');_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x9e'));}else{_0x58140c[_0xf0ab('0x83')](_0xf0ab('0x80'),_['map'](_0x52eca9,'id'));_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x80'),_[_0xf0ab('0x3f')](_0x52eca9,'id'));}});})[_0xf0ab('0x21')](function(){if(_0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9c')]===_0xf0ab('0x3c')&&!_0x61d3db&&!_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x7f')])return[];return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0x58140c[_0xf0ab('0xa0')](),_0x148a72);})[_0xf0ab('0x21')](function(_0x4211a1){_0x4bbdf6['count']=_0x4211a1[_0xf0ab('0x52')];if(_0x4bbdf6[_0xf0ab('0x31')]===0x0)return[];return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0xa1a416[_0xf0ab('0xa0')](),_0x148a72)[_0xf0ab('0x21')](function(_0x611cf7){_0x577c85=_['keyBy'](_0x611cf7,'id');_0x148a72=_['merge'](_0x148a72,{'model':db[_0xf0ab('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x50')]){_0x1fc766['attributes'][_0xf0ab('0x44')](function(_0x405b34){_0x2eff07[_0xf0ab('0x58')]('i.'+_0x405b34);});}else{_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa2'),'unreadMessages');_0x2eff07['field'](_0xf0ab('0xa3'),'Account.key');_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa4'),'Account.mandatoryDisposition');_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa5'),_0xf0ab('0x96'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa6'));_0x2eff07['field'](_0xf0ab('0xa7'),_0xf0ab('0xa8'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa9'),_0xf0ab('0xaa'));_0x2eff07['field'](_0xf0ab('0xab'),_0xf0ab('0xac'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xad'),_0xf0ab('0xae'));_0x2eff07['field'](_0xf0ab('0xaf'),_0xf0ab('0xb0'));_0x2eff07[_0xf0ab('0x58')]('c.fax',_0xf0ab('0xb1'));_0x2eff07['field'](_0xf0ab('0xb2'),_0xf0ab('0xb3'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xb4'),'Owner.internal');_0x2eff07[_0xf0ab('0x58')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x1fc766[_0xf0ab('0x30')])_0x2eff07['limit'](_0x1fc766['limit']);if(_0x1fc766[_0xf0ab('0x2e')])_0x2eff07[_0xf0ab('0x2e')](_0x1fc766['offset']);return db['sequelize']['query'](_0x2eff07['toString'](),_0x148a72);})[_0xf0ab('0x21')](function(_0x12d9b6){if(_0x12d9b6[_0xf0ab('0x52')]>0x0)_0x26508b[_0xf0ab('0x83')](_0xf0ab('0xb5'),_['map'](_0x12d9b6,'id'));return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0x26508b[_0xf0ab('0xa0')](),_0x148a72)[_0xf0ab('0x21')](function(_0x84eab9){var _0x27cd98=_[_0xf0ab('0xb6')](_0x84eab9,'ChatInteractionId');var _0x16dca7=[];_0x12d9b6[_0xf0ab('0x44')](function(_0x39633a){_0x16dca7[_0xf0ab('0x45')](updateChatInteraction(_0x39633a,_0x577c85,_0x27cd98));});return BPromise[_0xf0ab('0xb7')](_0x16dca7);});});})[_0xf0ab('0x21')](function(_0x527a4b){_0x4bbdf6[_0xf0ab('0xb8')]=_0x527a4b;return _0x4bbdf6;})[_0xf0ab('0x21')](respondWithFilteredResult(_0x4e6c41,_0x1fc766))[_0xf0ab('0x46')](handleError(_0x4e6c41,null));};exports[_0xf0ab('0xb9')]=function(_0x4ca7a3,_0x426419){var _0x395bf6={'raw':![],'where':{'id':_0x4ca7a3['params']['id']}},_0x5b7744={};_0x5b7744[_0xf0ab('0x4b')]=_[_0xf0ab('0x4d')](db[_0xf0ab('0xa1')][_0xf0ab('0x47')]);_0x5b7744[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x4ca7a3[_0xf0ab('0x4c')]);_0x5b7744[_0xf0ab('0x4e')]=_['intersection'](_0x5b7744[_0xf0ab('0x4b')],_0x5b7744['query']);_0x395bf6['attributes']=_[_0xf0ab('0x4f')](_0x5b7744[_0xf0ab('0x4b')],qs[_0xf0ab('0x50')](_0x4ca7a3[_0xf0ab('0x4c')][_0xf0ab('0x50')]));_0x395bf6[_0xf0ab('0x51')]=_0x395bf6[_0xf0ab('0x51')][_0xf0ab('0x52')]?_0x395bf6['attributes']:_0x5b7744[_0xf0ab('0x4b')];if(_0x4ca7a3[_0xf0ab('0x4c')][_0xf0ab('0xba')]){_0x395bf6[_0xf0ab('0xbb')]=[{'all':!![]}];}_0x395bf6=_[_0xf0ab('0x39')]({},_0x395bf6,_0x4ca7a3[_0xf0ab('0xbc')]);return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')](_0x395bf6)[_0xf0ab('0x21')](handleEntityNotFound(_0x426419,null))[_0xf0ab('0x21')](respondWithResult(_0x426419,null))['catch'](handleError(_0x426419,null));};exports['create']=function(_0x58946c,_0x2f339d){return db['ChatInteraction']['create'](_0x58946c[_0xf0ab('0x3a')],{})[_0xf0ab('0x21')](respondWithResult(_0x2f339d,0xc9))[_0xf0ab('0x46')](handleError(_0x2f339d,null));};exports[_0xf0ab('0x33')]=function(_0xdf495,_0x55a296){if(_0xdf495[_0xf0ab('0x3a')]['id']){delete _0xdf495[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0xdf495[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x55a296,null))[_0xf0ab('0x21')](saveUpdates(_0xdf495[_0xf0ab('0x3a')],null))['then'](respondWithResult(_0x55a296,null))[_0xf0ab('0x46')](handleError(_0x55a296,null));};exports['destroy']=function(_0x3c1a2c,_0x17a3b6){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x3c1a2c[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x17a3b6,null))[_0xf0ab('0x21')](removeEntity(_0x17a3b6,null))[_0xf0ab('0x46')](handleError(_0x17a3b6,null));};exports[_0xf0ab('0xbe')]=function(_0x1f2efa,_0x1d12fb){return db[_0xf0ab('0xa1')]['describe']()[_0xf0ab('0x21')](respondWithResult(_0x1d12fb,null))[_0xf0ab('0x46')](handleError(_0x1d12fb,null));};exports['createVidaooSession']=function(_0x35486d,_0x3f5ade){var _0x135a10=_0x35486d[_0xf0ab('0xbd')]['id'];var _0x48fc7e;var _0x5f55d2;var _0x7c7c3b;return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x135a10}})[_0xf0ab('0x21')](function(_0x2beaaa){_0x48fc7e=_0x2beaaa;return db[_0xf0ab('0xbf')][_0xf0ab('0xc0')]({'where':{'id':_0x2beaaa[_0xf0ab('0x7f')]},'attributes':['id',_0xf0ab('0xc1'),'vidaooEscalation',_0xf0ab('0xc2'),'vidaooNote',_0xf0ab('0xc3')],'raw':!![]});})[_0xf0ab('0x21')](function(_0x354e18){if(_0x354e18&&_0x354e18['vidaooApiKey']&&_0x354e18[_0xf0ab('0xc4')]){_0x5f55d2=_0x354e18;var _0x2068d6={'interaction':{'id':_0x135a10},'agent':{'id':_0x35486d[_0xf0ab('0x9b')]['id'],'name':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0x37')],'fullname':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0x40')],'email':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0xc5')]},'contact':_0x35486d['body']['contact'],'account':_0x35486d[_0xf0ab('0x3a')][_0xf0ab('0x3d')]};var _0x35b480={'rejectUnauthorized':![],'method':_0xf0ab('0xc6'),'url':_0xf0ab('0xc7'),'headers':{'X-APIKEY':_0x354e18[_0xf0ab('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0xc5')]],'buttons':null,'topic':_0x5f55d2[_0xf0ab('0xc2')],'note':_[_0xf0ab('0xc8')](_0x5f55d2['vidaooNote'])?null:getMustacheRender(_0x5f55d2[_0xf0ab('0xc9')],_0x2068d6),'metadata':null},'redirect':_0xf0ab('0xca'),'json':!![]};try{if(!_[_0xf0ab('0xc8')](_0x5f55d2[_0xf0ab('0xc3')])){var _0x41e2d8=getMustacheRender(_0x5f55d2[_0xf0ab('0xc3')],_0x2068d6);var _0x57f44d=JSON[_0xf0ab('0x81')](_0x41e2d8);_0x35b480[_0xf0ab('0x3a')][_0xf0ab('0xcb')]=_0x57f44d;}}catch(_0x533b37){throw new db[(_0xf0ab('0xcc'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x35b480);}else{throw new db[(_0xf0ab('0xcc'))][(_0xf0ab('0xcd'))](_0xf0ab('0xce'));}})['then'](function(_0x1697ca){_0x7c7c3b=_0x1697ca;if(_0x7c7c3b['id']){var _0x15da8a={'body':_0x7c7c3b[_0xf0ab('0xcf')],'ChatWebsiteId':_0x5f55d2['id'],'ChatInteractionId':_0x48fc7e['id'],'direction':'out','UserId':_0x35486d[_0xf0ab('0x9b')]['id']};return db[_0xf0ab('0xd0')][_0xf0ab('0xd1')](_0x15da8a,{});}else{throw new db['Sequelize'][(_0xf0ab('0xcd'))](_0xf0ab('0xd2'));}})[_0xf0ab('0x21')](function(){return _0x48fc7e[_0xf0ab('0xd3')]({'vidaooSessionId':_0x7c7c3b['id']});})[_0xf0ab('0x21')](respondWithResult(_0x3f5ade,null))[_0xf0ab('0x46')](handleError(_0x3f5ade,null));};exports[_0xf0ab('0xd4')]=function(_0x115e3d,_0x2d0f9c){if(_0x115e3d[_0xf0ab('0x3a')]['id']){delete _0x115e3d[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x115e3d[_0xf0ab('0xbd')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xf0ab('0x21')](handleEntityNotFound(_0x2d0f9c,null))[_0xf0ab('0x21')](saveUpdates(_0x115e3d['body'],null))[_0xf0ab('0x21')](respondWithResult(_0x2d0f9c,null))['catch'](handleError(_0x2d0f9c,null));};exports[_0xf0ab('0xd5')]=function(_0x1e9768,_0x4398a3,_0x4195d9){if(_0x1e9768[_0xf0ab('0x3a')]['id']){delete _0x1e9768[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x1e9768[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](function(_0x5f10a5){if(!_0x5f10a5){logger[_0xf0ab('0x28')](_0xf0ab('0xd6'),_0xf0ab('0xd5'),0x194,_0xf0ab('0xd7'));_0x4398a3[_0xf0ab('0x2b')](0x194);}else{if(_0x5f10a5[_0xf0ab('0x7b')]){throw new db['Sequelize']['ValidationError'](_0xf0ab('0xd8'));}}return _0x5f10a5;})[_0xf0ab('0x21')](function(_0x564124){if(_0x564124){return _0x564124[_0xf0ab('0x33')]({'closed':_0x1e9768[_0xf0ab('0x3a')][_0xf0ab('0xd9')],'disposition':_0x1e9768['body'][_0xf0ab('0xda')]})[_0xf0ab('0x21')](function(_0x2d9046){return _0x2d9046;});}})[_0xf0ab('0x21')](function(_0x4e5f1e){return respondWithRpcPromise(_0xf0ab('0xdb'),_0xf0ab('0xd5'),_0x1e9768[_0xf0ab('0x3a')],client9004);})['then'](respondWithResult(_0x4398a3,null))['catch'](handleError(_0x4398a3,null));};exports['attachmentUpload']=function(_0x581cb1,_0x22251d,_0x2b5993){_0x581cb1[_0xf0ab('0x3a')]['name']=_0x581cb1[_0xf0ab('0xdc')]['originalname'];_0x581cb1[_0xf0ab('0x3a')][_0xf0ab('0xdd')]=_0x581cb1[_0xf0ab('0xdc')][_0xf0ab('0xde')];_0x581cb1[_0xf0ab('0x3a')][_0xf0ab('0x49')]=_0x581cb1[_0xf0ab('0xdc')][_0xf0ab('0xdf')];return db[_0xf0ab('0xe0')][_0xf0ab('0xd1')](_0x581cb1[_0xf0ab('0x3a')])[_0xf0ab('0x21')](respondWithResult(_0x22251d,0xc9))[_0xf0ab('0x46')](handleError(_0x22251d,null));};exports[_0xf0ab('0xe1')]=function(_0x4d09bf,_0x415b9d,_0x11ed58){return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x4d09bf[_0xf0ab('0xbd')]['id']},'raw':!![]})[_0xf0ab('0x21')](handleEntityNotFound(_0x415b9d,null))[_0xf0ab('0x21')](function(_0x278e32){if(_0x278e32){if(_0x278e32['closed']){return _0x415b9d[_0xf0ab('0x2c')](0x193)[_0xf0ab('0x2d')]({'status':0x193,'message':_0xf0ab('0xe2')});}return db[_0xf0ab('0xe0')][_0xf0ab('0xc0')]({'where':{'id':_0x4d09bf[_0xf0ab('0x4c')][_0xf0ab('0xe3')]},'raw':!![]})[_0xf0ab('0x21')](handleEntityNotFound(_0x415b9d,null));}})['then'](function(_0xadae03){if(_0xadae03){var _0x550b00=_0xadae03[_0xf0ab('0xe4')]!==null;var _0x2bfb6a=path[_0xf0ab('0xe5')](config['root'],_0xf0ab('0xe6'));if(_0x550b00){_0x2bfb6a=path[_0xf0ab('0xe5')](_0x2bfb6a,'offline-chat/');}var _0x5d62e4=path['join'](_0x2bfb6a,_0xadae03['basename']);return _0x415b9d[_0xf0ab('0xe7')](_0x5d62e4);}})['catch'](handleError(_0x415b9d,null));};exports['close']=function(_0x3b8bbe,_0x7e24c4){var _0x2d0ea3=null;var _0x4a18ad=null;var _0x57aaae=null;var _0x2ab0be=null;if(_0x3b8bbe[_0xf0ab('0x3a')]['id']){delete _0x3b8bbe['body']['id'];}if(_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xe8')]){_0x2ab0be=path['join'](config['root'],'server/files/chat/upload/',util[_0xf0ab('0xe9')](_0xf0ab('0xea'),Date[_0xf0ab('0xeb')]()));_0x3b8bbe[_0xf0ab('0x3a')]['pathTranscript']=_0x2ab0be;}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x3b8bbe['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0xf0ab('0xec')],'as':'User'}]}]})[_0xf0ab('0x21')](handleEntityNotFound(_0x7e24c4,null))[_0xf0ab('0x21')](saveUpdates(_0x3b8bbe[_0xf0ab('0x3a')],null))[_0xf0ab('0x21')](function(_0x116c84){if(_0x116c84){_0x2d0ea3=_0x116c84;return db[_0xf0ab('0xbf')][_0xf0ab('0x6c')]({'where':{'id':_0x2d0ea3[_0xf0ab('0x7f')]}});}})[_0xf0ab('0x21')](function(_0x1d6e15){if(_0x1d6e15){_0x57aaae=_0x1d6e15;return db[_0xf0ab('0xed')][_0xf0ab('0x6c')]({'where':{'id':_0x2d0ea3['ContactId']}});}})[_0xf0ab('0x21')](function(_0x29427c){if(_0x29427c){_0x4a18ad=_0x29427c;if(_0x2ab0be){var _0x29d4a1=null;for(var _0x50e996=0x1;_0x50e996<_0x2d0ea3['Messages'][_0xf0ab('0x52')];++_0x50e996){_0x29d4a1=_0x2d0ea3[_0xf0ab('0xee')][_0x50e996];var _0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae[_0xf0ab('0xf0')],_0x29d4a1[_0xf0ab('0x7b')]):_0xf0ab('0xf1');var _0xc1537e=_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xf2')]||util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0xf0ab('0xf3'),_0x29d4a1[_0xf0ab('0x75')]);switch(_0x57aaae[_0xf0ab('0xf4')]){case _0xf0ab('0xf5'):_0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae['agentAlias'],_0x29d4a1[_0xf0ab('0x7b')]):'System';break;case _0xf0ab('0xf6'):_0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?_0x29d4a1[_0xf0ab('0xec')][_0xf0ab('0xf7')]||_0x29d4a1['User'][_0xf0ab('0x40')]:'System';break;case'agent_fullname':_0x8e04bb=_0x29d4a1['UserId']?_0x29d4a1[_0xf0ab('0xec')][_0xf0ab('0x40')]:_0xf0ab('0xf1');break;default:_0x8e04bb=_0x29d4a1['UserId']?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae[_0xf0ab('0xf0')],_0x29d4a1[_0xf0ab('0x7b')]):_0xf0ab('0xf1');}var _0x2c39f0=util[_0xf0ab('0xe9')](_0xf0ab('0xf8'),moment(_0x29d4a1[_0xf0ab('0xf9')])[_0xf0ab('0xe9')](_0xf0ab('0xfa')),_0x29d4a1[_0xf0ab('0xfb')]==='in'?_0xc1537e:_0x8e04bb,_0x29d4a1['body']);if(!_0x29d4a1[_0xf0ab('0xfc')]){fs[_0xf0ab('0xfd')](_0x2ab0be,_0x2c39f0);}}return db[_0xf0ab('0xfe')][_0xf0ab('0xc0')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf0ab('0xff'),'raw':!![]}]});}}})['then'](function(_0x21eb2b){if(_0x21eb2b&&_0x21eb2b['Smtp']&&_0x3b8bbe[_0xf0ab('0x3a')]){var _0x262659={'tls':{'rejectUnauthorized':![]}};if(_0x21eb2b['Smtp'][_0xf0ab('0x100')]){_0x262659[_0xf0ab('0x100')]=_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x100')];}else{_0x262659[_0xf0ab('0x101')]=_0x21eb2b['Smtp'][_0xf0ab('0x101')];_0x262659[_0xf0ab('0x102')]=_0x21eb2b[_0xf0ab('0xff')]['port'];_0x262659['secure']=_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x103')];}if(_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x104')]){_0x262659['auth']={'user':_0x21eb2b['Smtp'][_0xf0ab('0x9b')],'pass':_0x21eb2b[_0xf0ab('0xff')]['pass']};}return respondWithRpcPromise('SendMail',_0xf0ab('0x105'),{'account':_0x262659,'message':{'from':util['format'](_0xf0ab('0x106'),_0x21eb2b['name'],_0x21eb2b[_0xf0ab('0xc5')]||_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x9b')]),'to':_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xe8')],'subject':_0xf0ab('0x107'),'text':util[_0xf0ab('0xe9')](_0xf0ab('0x108'),_0x3b8bbe['body'][_0xf0ab('0xe8')]),'attachments':[{'path':_0x2ab0be}]}})[_0xf0ab('0x21')](function(){return _0x2d0ea3;})[_0xf0ab('0x46')](function(_0x15f041){console[_0xf0ab('0x28')](_0x15f041);});}else{return _0x2d0ea3;}})['then'](respondWithStatusCode(_0x7e24c4,0xc8))[_0xf0ab('0x46')](handleError(_0x7e24c4,null));};exports[_0xf0ab('0x109')]=function(_0x5eda4b,_0x57a8ab,_0x3cee1d){return db[_0xf0ab('0xd0')][_0xf0ab('0x6c')]({'where':{'id':_0x5eda4b[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x57a8ab,null))[_0xf0ab('0x21')](function(_0x4dff6e){if(_0x4dff6e){return _0x4dff6e[_0xf0ab('0x109')](_0x5eda4b[_0xf0ab('0x3a')][_0xf0ab('0x10a')],_[_0xf0ab('0x10b')](_0x5eda4b[_0xf0ab('0x3a')],[_0xf0ab('0x10a'),'id'])||{});}})['then'](respondWithResult(_0x57a8ab,null))[_0xf0ab('0x46')](handleError(_0x57a8ab,null));};exports['getMessages']=function(_0x283bf5,_0x1afcea,_0x22a9f8){var _0x33dbfc={'raw':![],'where':{}};var _0x487318={};var _0x546e13={'count':0x0,'rows':[]};return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x283bf5[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x1afcea,null))[_0xf0ab('0x21')](function(_0xa3b903){if(_0xa3b903){_0x487318['model']=_[_0xf0ab('0x4d')](db[_0xf0ab('0xd0')][_0xf0ab('0x47')]);_0x487318[_0xf0ab('0x4c')]=_['keys'](_0x283bf5[_0xf0ab('0x4c')]);_0x487318[_0xf0ab('0x4e')]=_['intersection'](_0x487318[_0xf0ab('0x4b')],_0x487318[_0xf0ab('0x4c')]);_0x33dbfc[_0xf0ab('0x51')]=_[_0xf0ab('0x4f')](_0x487318[_0xf0ab('0x4b')],qs['fields'](_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x50')]));_0x33dbfc[_0xf0ab('0x51')]=_0x33dbfc['attributes'][_0xf0ab('0x52')]?_0x33dbfc[_0xf0ab('0x51')]:_0x487318[_0xf0ab('0x4b')];if(!_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x53')](_0xf0ab('0x54'))){_0x33dbfc[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x30')]);_0x33dbfc['offset']=qs['offset'](_0x283bf5[_0xf0ab('0x4c')]['offset']);}_0x33dbfc['order']=qs[_0xf0ab('0x56')](_0x283bf5[_0xf0ab('0x4c')]['sort']);_0x33dbfc[_0xf0ab('0x83')]=qs[_0xf0ab('0x4e')](_[_0xf0ab('0x10c')](_0x283bf5['query'],_0x487318[_0xf0ab('0x4e')]));_0x33dbfc['where'][_0xf0ab('0x10d')]=_0xa3b903['id'];if(_0x283bf5['query'][_0xf0ab('0x8d')]){_0x33dbfc[_0xf0ab('0x83')]=_[_0xf0ab('0x39')](_0x33dbfc['where'],{'$or':_[_0xf0ab('0x3f')](_0x33dbfc[_0xf0ab('0x51')],function(_0x2ddc1d){var _0x3cef14={};_0x3cef14[_0x2ddc1d]={'$like':'%'+_0x283bf5['query'][_0xf0ab('0x8d')]+'%'};return _0x3cef14;})});}if(_0x283bf5[_0xf0ab('0x4c')]['$gte']){var _0x38ea18=_0x283bf5[_0xf0ab('0x4c')]['$gte']['split'](',');var _0x7ee6b3={};_0x7ee6b3[_0x38ea18[0x0]]={'$gte':moment(_0x38ea18[0x1])[_0xf0ab('0xe9')](_0xf0ab('0x10e'))};_0x33dbfc['where']=_[_0xf0ab('0x39')](_0x33dbfc['where'],_0x7ee6b3);}_0x33dbfc=_[_0xf0ab('0x39')]({},_0x33dbfc,_0x283bf5['options']);return db[_0xf0ab('0xd0')]['count']({'where':_0x33dbfc['where']})['then'](function(_0x1d1451){_0x546e13['count']=_0x1d1451;if(_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0xba')]){_0x33dbfc[_0xf0ab('0xbb')]=[{'all':!![]}];}return db[_0xf0ab('0xd0')][_0xf0ab('0x10f')](_0x33dbfc);})['then'](function(_0x16a1d2){_0x546e13[_0xf0ab('0xb8')]=_0x16a1d2;return _0x546e13;});}})[_0xf0ab('0x21')](respondWithFilteredResult(_0x1afcea,_0x33dbfc))[_0xf0ab('0x46')](handleError(_0x1afcea,null));};exports[_0xf0ab('0x110')]=function(_0x4b91de,_0x3a602f,_0x47788a){var _0x3592f1={'where':{}},_0x577f13={},_0x2f99c2={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf0ab('0xc0')]({'where':{'id':_0x4b91de[_0xf0ab('0xbd')]['id']}})['then'](handleEntityNotFound(_0x3a602f,null))['then'](function(_0x43c6b8){if(_0x43c6b8){_0x577f13['model']=_[_0xf0ab('0x4d')](db[_0xf0ab('0xd0')][_0xf0ab('0x47')]);_0x577f13[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x4b91de[_0xf0ab('0x4c')]);_0x577f13['filters']=_[_0xf0ab('0x4f')](_0x577f13[_0xf0ab('0x4b')],_0x577f13[_0xf0ab('0x4c')]);_0x3592f1[_0xf0ab('0x51')]=_[_0xf0ab('0x4f')](_0x577f13[_0xf0ab('0x4b')],qs[_0xf0ab('0x50')](_0x4b91de['query'][_0xf0ab('0x50')]));_0x3592f1[_0xf0ab('0x51')]=_0x3592f1['attributes'][_0xf0ab('0x52')]?_0x3592f1['attributes']:_0x577f13[_0xf0ab('0x4b')];if(!_0x4b91de['query']['hasOwnProperty']('nolimit')){_0x3592f1[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x30')]);_0x3592f1[_0xf0ab('0x2e')]=qs[_0xf0ab('0x2e')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x2e')]);}_0x3592f1[_0xf0ab('0x55')]=qs[_0xf0ab('0x56')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x56')]);_0x3592f1[_0xf0ab('0x83')]=qs[_0xf0ab('0x4e')](_[_0xf0ab('0x10c')](_0x4b91de[_0xf0ab('0x4c')],_0x577f13[_0xf0ab('0x4e')]));_0x3592f1['where'][_0xf0ab('0x10d')]=_0x43c6b8['id'];if(_0x4b91de['query'][_0xf0ab('0x8d')]){_0x3592f1['where']=_[_0xf0ab('0x39')](_0x3592f1[_0xf0ab('0x83')],{'$or':_[_0xf0ab('0x3f')](_0x3592f1['attributes'],function(_0x58f64c){var _0x5dc7d4={};_0x5dc7d4[_0x58f64c]={'$like':'%'+_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x8d')]+'%'};return _0x5dc7d4;})});}_0x3592f1['where'][_0xf0ab('0xfc')]=![];if(_0x4b91de[_0xf0ab('0x4c')]['id']){_0x3592f1[_0xf0ab('0x83')]['id']={'$gt':_0x4b91de[_0xf0ab('0x4c')]['id']};}_0x3592f1=_['merge']({},_0x3592f1,_0x4b91de['options']);return db[_0xf0ab('0xd0')][_0xf0ab('0x31')]({'where':_0x3592f1[_0xf0ab('0x83')]})[_0xf0ab('0x21')](function(_0x2ab983){_0x2f99c2['count']=_0x2ab983;_0x3592f1[_0xf0ab('0xbb')]=[];if(_0x4b91de['query'][_0xf0ab('0x111')]){_0x3592f1[_0xf0ab('0xbb')][_0xf0ab('0x45')]({'model':db['User'],'as':_0xf0ab('0xec'),'attributes':['id',_0xf0ab('0x40'),_0xf0ab('0xf7')]});}if(_0x4b91de[_0xf0ab('0x4c')]['includeAll']){_0x3592f1[_0xf0ab('0xbb')]=[{'all':!![]}];}return db[_0xf0ab('0xd0')][_0xf0ab('0x10f')](_0x3592f1);})[_0xf0ab('0x21')](function(_0x3d70c0){_0x2f99c2[_0xf0ab('0xb8')]=_0x3d70c0;return _0x2f99c2;});}})[_0xf0ab('0x21')](respondWithFilteredResult(_0x3a602f,_0x3592f1))[_0xf0ab('0x46')](handleError(_0x3a602f,null));};exports['addTags']=function(_0x4d10af,_0x5cf4bd,_0x368523){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x4d10af['params']['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x5cf4bd,null))[_0xf0ab('0x21')](function(_0x46a38a){if(_0x46a38a){return _0x46a38a[_0xf0ab('0x112')](_0x4d10af[_0xf0ab('0x3a')][_0xf0ab('0x10a')],_['omit'](_0x4d10af[_0xf0ab('0x3a')],[_0xf0ab('0x10a'),'id'])||{})[_0xf0ab('0x113')](function(){return db['Tag'][_0xf0ab('0x10f')]({'attributes':['id',_0xf0ab('0x37'),_0xf0ab('0x59')],'where':{'id':_0x4d10af[_0xf0ab('0x3a')][_0xf0ab('0x10a')]}});})[_0xf0ab('0x21')](function(_0x1df97b){socket[_0xf0ab('0x114')](_0xf0ab('0x115'),{'id':Number(_0x4d10af[_0xf0ab('0xbd')]['id']),'tags':_0x1df97b||[]});return{'id':Number(_0x4d10af[_0xf0ab('0xbd')]['id']),'tags':_0x1df97b||[]};});}})[_0xf0ab('0x21')](respondWithResult(_0x5cf4bd,null))['catch'](handleError(_0x5cf4bd,null));};exports[_0xf0ab('0x116')]=function(_0x3ca465,_0x4e379d,_0x122e66){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x3ca465[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x4e379d,null))[_0xf0ab('0x21')](function(_0x5c56e0){if(_0x5c56e0){return _0x5c56e0[_0xf0ab('0x116')](_0x3ca465[_0xf0ab('0x4c')][_0xf0ab('0x10a')]);}})['then'](respondWithStatusCode(_0x4e379d,null))[_0xf0ab('0x46')](handleError(_0x4e379d,null));};exports[_0xf0ab('0xe7')]=function(_0x2baa40,_0x4ff52d){var _0x2a2fea=moment()[_0xf0ab('0x117')]()[_0xf0ab('0xa0')]();var _0x4eccbd=path['join'](config['root'],_0xf0ab('0x118'),_0xf0ab('0x119'),_0xf0ab('0x11a'));var _0x5b6475=path[_0xf0ab('0xe5')](config[_0xf0ab('0x11b')],'server',_0xf0ab('0x119'),_0xf0ab('0x11c'));var _0x595bda=path[_0xf0ab('0xe5')](_0x4eccbd,_0x2a2fea);var _0x2bd3e3=util['format']('transcript-%d-%s.zip',_0x2baa40[_0xf0ab('0xbd')]['id'],_0x2a2fea);var _0x25242e=path[_0xf0ab('0xe5')](_0x4eccbd,_0x2bd3e3);var _0x3d8794=[];_0x3d8794[_0xf0ab('0x45')]({'model':db['User'],'as':_0xf0ab('0xec'),'attributes':['id','fullname'],'raw':!![]});_0x3d8794[_0xf0ab('0x45')]({'model':db[_0xf0ab('0xed')],'as':_0xf0ab('0x70'),'attributes':['id','firstName',_0xf0ab('0x11d')],'raw':!![]});if(_0x2baa40[_0xf0ab('0x4c')][_0xf0ab('0x11c')]){_0x3d8794[_0xf0ab('0x45')]({'model':db[_0xf0ab('0xe0')],'as':'Attachment','raw':!![]});}var _0x243763=[{'model':db[_0xf0ab('0xd0')],'as':_0xf0ab('0xee'),'attributes':['id',_0xf0ab('0x3a'),'createdAt',_0xf0ab('0xfb'),_0xf0ab('0xfc'),_0xf0ab('0x88')],'include':_0x3d8794}];_0x243763['push']({'model':db[_0xf0ab('0xbf')],'as':_0xf0ab('0x11e'),'attributes':['id',_0xf0ab('0x37')]});_0x243763['push']({'model':db[_0xf0ab('0xec')],'as':_0xf0ab('0x11f'),'attributes':['id',_0xf0ab('0x40')]});return db[_0xf0ab('0xa1')]['find']({'where':{'id':_0x2baa40[_0xf0ab('0xbd')]['id']},'include':_0x243763})[_0xf0ab('0x21')](handleEntityNotFound(_0x4ff52d,null))[_0xf0ab('0x21')](function(_0x2c2e20){if(_0x2c2e20){var _0x57bd77=_0x2c2e20[_0xf0ab('0x120')]({'plain':!![]});fs[_0xf0ab('0x121')](_0x595bda);var _0x169b02={'channel':_0xf0ab('0x122'),'account':_0x57bd77[_0xf0ab('0x11e')]['name'],'agent':_0x57bd77[_0xf0ab('0x11f')]?_0x57bd77['Owner'][_0xf0ab('0x40')]:_0xf0ab('0x123'),'createdAt':moment(_0x57bd77[_0xf0ab('0xf9')])['format'](_0xf0ab('0x10e'))['toString'](),'closedAt':_0x57bd77['closed']?moment(_0x57bd77['closedAt'])[_0xf0ab('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x57bd77[_0xf0ab('0xda')],'chatInfo':{'browser':_0x57bd77[_0xf0ab('0x124')],'os':_0x57bd77[_0xf0ab('0x125')],'referer':_0x57bd77[_0xf0ab('0x126')],'customerIp':_0x57bd77[_0xf0ab('0x127')],'customerPort':_0x57bd77['customerPort']?_0x57bd77[_0xf0ab('0x128')]:_0xf0ab('0x123')},'messages':_(_0x57bd77['Messages'])[_0xf0ab('0x129')]()[_0xf0ab('0x8d')]({'secret':![]})[_0xf0ab('0x3f')](function(_0x2aa512){if(_0x2aa512['Attachment']){var _0x26009e=path[_0xf0ab('0xe5')](_0x5b6475,_0x2aa512['Attachment'][_0xf0ab('0xdd')]);if(fs[_0xf0ab('0x12a')](_0x26009e)){fs['createReadStream'](_0x26009e)[_0xf0ab('0x12b')](fs[_0xf0ab('0x12c')](path['join'](_0x595bda,_0x2aa512[_0xf0ab('0xe0')][_0xf0ab('0xdd')])));}}return{'date':moment(_0x2aa512[_0xf0ab('0xf9')])[_0xf0ab('0xe9')](_0xf0ab('0x10e'))['toString'](),'sender':_0x2aa512[_0xf0ab('0xfb')]==='out'?_0x2aa512[_0xf0ab('0xec')]?_0x2aa512['User'][_0xf0ab('0x40')]:_0xf0ab('0xf1'):_0x2aa512[_0xf0ab('0x70')][_0xf0ab('0x12d')]+(_0x2aa512[_0xf0ab('0x70')][_0xf0ab('0x11d')]?'\x20'+_0x2aa512[_0xf0ab('0x70')]['lastName']:''),'body':_0x2aa512[_0xf0ab('0xe0')]?_0x2aa512[_0xf0ab('0xe0')][_0xf0ab('0xdd')]:_0x2aa512[_0xf0ab('0x3a')],'direction':_0x2aa512[_0xf0ab('0xfb')]==='out'?'A':'C','secret':_0x2aa512[_0xf0ab('0xfc')],'read':_0x2aa512[_0xf0ab('0x88')],'attachment':_0x2aa512[_0xf0ab('0xe0')]};})[_0xf0ab('0x72')]()};return ejs['renderFile'](path[_0xf0ab('0xe5')](config[_0xf0ab('0x11b')],_0xf0ab('0x118'),_0xf0ab('0x12e'),'downloadInteraction.ejs'),{'interaction':_0x169b02})['then'](function(_0x3ad886){var _0x3df4a2=path['join'](_0x595bda,'transcript-'+_0x57bd77['id']+'-'+_0x2a2fea+_0xf0ab('0x12f'));var _0x378d44={'path':_0x3df4a2,'channel':_0xf0ab('0x122'),'interactionId':_0x57bd77['id']};return pdf[_0xf0ab('0x130')](_0x3ad886,_0x378d44);})[_0xf0ab('0x21')](function(){return new BPromise(function(_0x1e4acb,_0x25a1eb){zipdir(_0x595bda,{'saveTo':_0x25242e},function(_0x406090,_0x414d09){if(_0x406090)return _0x25a1eb(_0x406090);return _0x1e4acb(_0x414d09);});})[_0xf0ab('0x21')](function(){return new BPromise(function(_0x235528,_0x581c80){rimraf(_0x595bda,function(_0x14332a){if(_0x14332a)_0x581c80(_0x14332a);return _0x235528();});});})[_0xf0ab('0x21')](function(){return _0x4ff52d[_0xf0ab('0xe7')](_0x25242e,_0x2bd3e3,function(_0x4f9211){if(_0x4f9211){console[_0xf0ab('0x131')](_0xf0ab('0x132'),_0x4f9211);}else{fs[_0xf0ab('0x133')](_0x25242e);}});});});}else{return _0x4ff52d['sendStatus'](0xc8);}})[_0xf0ab('0x46')](handleError(_0x4ff52d,null));};
\ No newline at end of file
+var _0x9ffd=['MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','params','includeAll','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooNote','vidaooApiKey','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','create','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','secret','include','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','CmContact','firstName','attachments','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','stack','name','render','merge','body','contact','account','Users','fullname','Tags','TagIds','split','forEach','index','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','left_join','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x56002f,_0x21b9e6){_0x56002f=_0x56002f-0x0;var _0xc59164=_0x9ffd[_0x56002f];return _0xc59164;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var pdf=require(_0xd9ff('0x13'));var hardwareService=require(_0xd9ff('0x14'));var logger=require(_0xd9ff('0x15'))(_0xd9ff('0x16'));var utils=require(_0xd9ff('0x17'));var config=require(_0xd9ff('0x18'));var licenseUtil=require(_0xd9ff('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd9ff('0x1a')](config[_0xd9ff('0x1b')],{'host':_0xd9ff('0x1c'),'port':0x18eb});var socket=require(_0xd9ff('0x1d'))(new Redis(config[_0xd9ff('0x1b')]));require('./chatInteraction.socket')[_0xd9ff('0x1e')](socket);var jayson=require(_0xd9ff('0x1f'));var client=jayson['client'][_0xd9ff('0x20')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x547e28,_0x4c5718,_0x271287,_0x4f9d6d){return new BPromise(function(_0x35679e,_0xa30fd2){var _0x39c6ce=_0x4f9d6d||client;return _0x39c6ce[_0xd9ff('0x21')](_0x547e28,_0x271287)[_0xd9ff('0x22')](function(_0x2d4df1){logger[_0xd9ff('0x23')](_0xd9ff('0x24'),_0x4c5718,_0xd9ff('0x25'));logger[_0xd9ff('0x26')](_0xd9ff('0x27'),_0x4c5718,_0xd9ff('0x25'),JSON[_0xd9ff('0x28')](_0x2d4df1));if(_0x2d4df1['error']){if(_0x2d4df1['error'][_0xd9ff('0x29')]===0x1f4){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x2d4df1['error']['message']);return _0xa30fd2(_0x2d4df1['error'][_0xd9ff('0x2b')]);}logger['error'](_0xd9ff('0x24'),_0x4c5718,_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);return _0x35679e(_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);}else{logger[_0xd9ff('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,'request\x20sent');_0x35679e(_0x2d4df1[_0xd9ff('0x2c')]['message']);}})[_0xd9ff('0x2d')](function(_0x4d86fe){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x4d86fe);_0xa30fd2(_0x4d86fe);});});}function respondWithStatusCode(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0xcc;return function(_0x2138b4){if(_0x2138b4){return _0x10cbdd[_0xd9ff('0x2e')](_0x159e56);}return _0x10cbdd['status'](_0x159e56)[_0xd9ff('0x2f')]();};}function respondWithResult(_0xe11f88,_0x1c78c4){_0x1c78c4=_0x1c78c4||0xc8;return function(_0x4390f7){if(_0x4390f7){return _0xe11f88['status'](_0x1c78c4)[_0xd9ff('0x30')](_0x4390f7);}};}function respondWithFilteredResult(_0x3792d9,_0x44b5a7){return function(_0x45fb63){if(_0x45fb63){var _0x263d3a=typeof _0x44b5a7[_0xd9ff('0x31')]===_0xd9ff('0x32')&&typeof _0x44b5a7[_0xd9ff('0x33')]===_0xd9ff('0x32');var _0x5706cf=_0x45fb63[_0xd9ff('0x34')];var _0x4ba2be=_0x263d3a?0x0:_0x44b5a7[_0xd9ff('0x31')];var _0x29c532=_0x263d3a?_0x45fb63[_0xd9ff('0x34')]:_0x44b5a7['offset']+_0x44b5a7[_0xd9ff('0x33')];var _0x3b26da;if(_0x29c532>=_0x5706cf){_0x29c532=_0x5706cf;_0x3b26da=0xc8;}else{_0x3b26da=0xce;}_0x3792d9[_0xd9ff('0x35')](_0x3b26da);return _0x3792d9[_0xd9ff('0x36')]('Content-Range',_0x4ba2be+'-'+_0x29c532+'/'+_0x5706cf)[_0xd9ff('0x30')](_0x45fb63);}return null;};}function patchUpdates(_0x5743de){return function(_0x18c28b){try{jsonpatch[_0xd9ff('0x37')](_0x18c28b,_0x5743de,!![]);}catch(_0x323cb5){return BPromise[_0xd9ff('0x38')](_0x323cb5);}return _0x18c28b[_0xd9ff('0x39')]();};}function saveUpdates(_0xdf3947,_0x2cc2ae){return function(_0x281c7b){if(_0x281c7b){return _0x281c7b[_0xd9ff('0x3a')](_0xdf3947)[_0xd9ff('0x22')](function(_0x4813a5){return _0x4813a5;});}return null;};}function removeEntity(_0x34e9a9,_0x4670e4){return function(_0x66f4d){if(_0x66f4d){return _0x66f4d['destroy']()[_0xd9ff('0x22')](function(){_0x34e9a9[_0xd9ff('0x35')](0xcc)[_0xd9ff('0x2f')]();});}};}function handleEntityNotFound(_0x4ab10f,_0x3d449d){return function(_0x5e3ff9){if(!_0x5e3ff9){_0x4ab10f[_0xd9ff('0x2e')](0x194);}return _0x5e3ff9;};}function handleError(_0x4ae56b,_0x20a021){_0x20a021=_0x20a021||0x1f4;return function(_0x5db498){logger[_0xd9ff('0x2a')](_0x5db498[_0xd9ff('0x3b')]);if(_0x5db498[_0xd9ff('0x3c')]){delete _0x5db498['name'];}_0x4ae56b['status'](_0x20a021)['send'](_0x5db498);};}function getMustacheRender(_0x7ac3d1,_0x30fc5b){return Mustache[_0xd9ff('0x3d')](_0x7ac3d1,_[_0xd9ff('0x3e')](_0x30fc5b[_0xd9ff('0x3f')],{'contact':_0x30fc5b[_0xd9ff('0x40')],'message':_0x30fc5b['message'],'agent':_0x30fc5b['agent'],'interaction':_0x30fc5b['interaction'],'account':_0x30fc5b[_0xd9ff('0x41')]}))||'';}function getInteractionUsers(_0x252edc,_0x918c9a){return new BPromise(function(_0x32adae,_0x56b94d){try{if(_0x918c9a[_0x252edc['id']]){_0x252edc[_0xd9ff('0x42')]=_['map'](_0x918c9a[_0x252edc['id']],function(_0x3cff52){return{'id':_0x3cff52['id'],'fullname':_0x3cff52[_0xd9ff('0x43')]};});}}catch(_0x1bedaf){_0x56b94d(_0x1bedaf);}_0x32adae(_0x252edc);});}function getInteractionTags(_0x169dc7,_0x59fc07){return new BPromise(function(_0x1e34da,_0x2d4d97){try{if(_0x169dc7['TagIds']){_0x169dc7[_0xd9ff('0x44')]=[];_0x169dc7[_0xd9ff('0x45')][_0xd9ff('0x46')](',')[_0xd9ff('0x47')](function(_0x1fe44d){_0x169dc7[_0xd9ff('0x44')]['push'](_0x59fc07[_0x1fe44d]);});}delete _0x169dc7[_0xd9ff('0x45')];}catch(_0x116f28){_0x2d4d97(_0x116f28);}_0x1e34da(_0x169dc7);});}function updateChatInteraction(_0x10533a,_0x39fbbb,_0x472724){return new BPromise(function(_0x52aab8,_0x3178cd){return getInteractionUsers(_0x10533a,_0x472724)[_0xd9ff('0x22')](function(_0xe0bc49){return getInteractionTags(_0xe0bc49,_0x39fbbb);})['then'](function(_0x5d06dd){_0x52aab8(_0x5d06dd);})[_0xd9ff('0x2d')](function(_0x7eb1a){_0x3178cd(_0x7eb1a);});});}exports[_0xd9ff('0x48')]=function(_0x2dfb8f,_0x437561){var _0x30c69d={},_0x564ef4={},_0xd64585={'count':0x0,'rows':[]};var _0x2d3013=_['map'](db[_0xd9ff('0x49')][_0xd9ff('0x4a')],function(_0x13a1ec){return{'name':_0x13a1ec[_0xd9ff('0x4b')],'type':_0x13a1ec[_0xd9ff('0x4c')]['key']};});_0x564ef4['model']=_['map'](_0x2d3013,_0xd9ff('0x3c'));_0x564ef4['query']=_[_0xd9ff('0x4d')](_0x2dfb8f[_0xd9ff('0x4e')]);_0x564ef4[_0xd9ff('0x4f')]=_['intersection'](_0x564ef4[_0xd9ff('0x50')],_0x564ef4[_0xd9ff('0x4e')]);_0x30c69d['attributes']=_[_0xd9ff('0x51')](_0x564ef4[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x2dfb8f[_0xd9ff('0x4e')]['fields']));_0x30c69d[_0xd9ff('0x53')]=_0x30c69d['attributes'][_0xd9ff('0x54')]?_0x30c69d['attributes']:_0x564ef4[_0xd9ff('0x50')];if(!_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x30c69d[_0xd9ff('0x33')]=qs['limit'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x30c69d[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2dfb8f['query']['offset']);}_0x30c69d['order']=qs[_0xd9ff('0x57')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x30c69d['where']=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0x2dfb8f[_0xd9ff('0x4e')],_0x564ef4[_0xd9ff('0x4f')]),_0x2d3013);var _0xfede73=[];var _0x40d391=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5a')]('id')[_0xd9ff('0x5a')](_0xd9ff('0x3c'))[_0xd9ff('0x5a')](_0xd9ff('0x5b'))[_0xd9ff('0x5c')]('tools_tags');var _0x3ed112=squel['select']()[_0xd9ff('0x5a')]('u.id')[_0xd9ff('0x5a')]('u.fullname')[_0xd9ff('0x5a')]('ui.ChatInteractionId')[_0xd9ff('0x5c')]('user_has_chat_interactions','ui')[_0xd9ff('0x5d')]('users','u',_0xd9ff('0x5e'));var _0x5da1a8=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5c')](_0xd9ff('0x5f'),'i')[_0xd9ff('0x5d')]('cm_contacts','c',_0xd9ff('0x60'))[_0xd9ff('0x5d')](_0xd9ff('0x61'),'o','o.id\x20=\x20i.UserId')[_0xd9ff('0x5d')](_0xd9ff('0x62'),'a',_0xd9ff('0x63'))[_0xd9ff('0x5d')](_0xd9ff('0x64'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xd9ff('0x5d')](_0xd9ff('0x65'),'it',_0xd9ff('0x66'))[_0xd9ff('0x5d')](_0xd9ff('0x67'),'t',_0xd9ff('0x68'));var _0x458fd4=squel['expr']();var _0x3be850=[];var _0x11251f=squel['expr']();var _0x1c885f;if(_0x2dfb8f[_0xd9ff('0x4e')]['search']){_0x1c885f=as[_0xd9ff('0x69')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x6a')]);var _0x54ea27=_0x1c885f['sqlOperator'];for(var _0x39473e=0x0;_0x39473e<_0x1c885f['conditions'][_0xd9ff('0x54')];_0x39473e++){var _0x1e4d0c=_0x1c885f[_0xd9ff('0x6b')][_0x39473e];var _0x102aea='i';var _0x53a230=_['find'](_0x2d3013,['name',_0x1e4d0c[_0xd9ff('0x5a')]]);if(!_0x53a230){switch(_0x1e4d0c[_0xd9ff('0x5a')]){case _0xd9ff('0x6c'):if(_0x1e4d0c[_0xd9ff('0x6d')]==0x1){_0x5da1a8[_0xd9ff('0x6e')]('`'+_0x1e4d0c['field']+_0xd9ff('0x6f'));}else{_0x5da1a8['having']('`'+_0x1e4d0c[_0xd9ff('0x5a')]+_0xd9ff('0x70'));}break;case _0xd9ff('0x71'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){if(_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')]('\x20')[_0xd9ff('0x54')]>0x1){_0x458fd4[_0x54ea27]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd9ff('0x74')](_0x1e4d0c[_0xd9ff('0x6d')]),null);}else{var _0x4f5338='%'+_0x1e4d0c['value']+'%';_0x458fd4[_0x54ea27](_0xd9ff('0x75'),_0x4f5338,_0x4f5338,_0x4f5338);}}else{_0x53a230=_['find'](_0x2d3013,[_0xd9ff('0x3c'),_0xd9ff('0x76')]);_0x1e4d0c['field']=_0xd9ff('0x76');_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')]['start'],_0x58c9c2[_0xd9ff('0x6d')]['end']);}break;case'Tag':var _0x3dabb1=_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')](',')[_0xd9ff('0x79')](function(_0x56d822){return Number(_0x56d822);});_0x3dabb1[_0xd9ff('0x47')](function(_0x23b816){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x23b816+',%');});_0x3be850=_[_0xd9ff('0x7b')](_0x3be850,_0x3dabb1);break;case _0xd9ff('0x7c'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){_0x458fd4[_0x54ea27](_0xd9ff('0x7d'),'%'+_0x1e4d0c['value']+'%',null);}else{_0x53a230=_['find'](_0x2d3013,['name',_0xd9ff('0x7e')]);_0x1e4d0c[_0xd9ff('0x5a')]='UserId';_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}break;case _0xd9ff('0x3f'):_0x58c9c2=as['buildExpression']('me',null,_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2['value'][_0xd9ff('0x2f')]);break;}}else{var _0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2['value'][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}}}else{var _0x1cd620=_(_0x2dfb8f['query'])[_0xd9ff('0x4d')]()[_0xd9ff('0x79')](function(_0x1de5c9){return _['some'](_0x2d3013,[_0xd9ff('0x3c'),_0x1de5c9])?_0x1de5c9:undefined;})[_0xd9ff('0x80')]()[_0xd9ff('0x6d')]();if(!_['isEmpty'](_0x1cd620)){_0x1cd620[_0xd9ff('0x47')](function(_0x35926f){if(_0x35926f===_0xd9ff('0x81')){_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0x83'),[]['concat'](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]));}else if(_0x35926f===_0xd9ff('0x84')){var _0x59af0a=JSON[_0xd9ff('0x85')](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f])[_0xd9ff('0x86')];var _0x5d1973=JSON[_0xd9ff('0x85')](_0x2dfb8f['query'][_0x35926f])[_0xd9ff('0x87')];_0x5da1a8['where'](_0xd9ff('0x88'),_0x59af0a,_0x5d1973);}else{if(_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]===_0xd9ff('0x89')){_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8a'));}else{_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8b'),_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]);}}});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8c')]){if(_0x2dfb8f['query'][_0xd9ff('0x8c')]==0x1){_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8d'));}else{_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8e'));}}if(_0x2dfb8f[_0xd9ff('0x4e')]['tag']){_0x3be850=_['isArray'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')])?_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]:new Array(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]);_0x3be850['forEach'](function(_0x1d34a1){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x1d34a1+',%');});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x90')]){var _0x14c89f=_0x2dfb8f[_0xd9ff('0x4e')]['filter'][_0xd9ff('0x91')]('\x5c','\x5c\x5c')[_0xd9ff('0x91')](/'/g,'\x27\x27');if(qs[_0xd9ff('0x92')](_0x14c89f)){_0x458fd4['or'](_0xd9ff('0x93'),_0x14c89f+'%');}else{_0x458fd4['or'](_0xd9ff('0x94'),qs[_0xd9ff('0x74')](_0x14c89f))['or'](_0xd9ff('0x95'),_0x14c89f+'%');}}}_0x5da1a8[_0xd9ff('0x82')](_0x458fd4);_0x5da1a8['group'](_0xd9ff('0x96'));var _0x4c2ad5={'type':db[_0xd9ff('0x97')][_0xd9ff('0x98')][_0xd9ff('0x99')],'raw':!![]};var _0x2d2d1c=_0x5da1a8[_0xd9ff('0x9a')]();_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x96'));_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));if(_0x30c69d[_0xd9ff('0x9c')]){_0x30c69d[_0xd9ff('0x9c')][_0xd9ff('0x47')](function(_0x5d29b9){var _0x4413c4=_0x5d29b9[0x0]===_0xd9ff('0x9d')?_0x5d29b9[0x0]:'i.'+_0x5d29b9[0x0];_0x5da1a8[_0xd9ff('0x9c')](_0x4413c4,_0x5d29b9[0x1]===_0xd9ff('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x3be850)){_0x5da1a8[_0xd9ff('0x6e')](_0x11251f);_0x2d2d1c[_0xd9ff('0x82')]('t.id\x20IN\x20?',_0x3be850);}BPromise[_0xd9ff('0x9f')]()[_0xd9ff('0x22')](function(){if(!_0x1c885f){if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x81')])return;_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa0'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2dfb8f[_0xd9ff('0xa1')]['role']!==_0xd9ff('0xa2'))return;return _0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa3')]({'attributes':['id'],'raw':!![]})[_0xd9ff('0x22')](function(_0x320adb){if(_[_0xd9ff('0xa4')](_0x320adb)){_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa5'));_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0xa5'));}else{_0x2d2d1c[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));}});})[_0xd9ff('0x22')](function(){if(_0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa6')]===_0xd9ff('0xa2')&&!_0x1c885f&&!_0x2dfb8f[_0xd9ff('0x4e')]['ChatWebsiteId'])return[];return db['sequelize'][_0xd9ff('0x4e')](_0x2d2d1c['toString'](),_0x4c2ad5);})['then'](function(_0x4a55c1){_0xd64585['count']=_0x4a55c1[_0xd9ff('0x54')];if(_0xd64585[_0xd9ff('0x34')]===0x0)return[];return db[_0xd9ff('0xa7')]['query'](_0x40d391['toString'](),_0x4c2ad5)[_0xd9ff('0x22')](function(_0x5e7f52){_0xfede73=_[_0xd9ff('0xa8')](_0x5e7f52,'id');_0x4c2ad5=_['merge'](_0x4c2ad5,{'model':db[_0xd9ff('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x52')]){_0x30c69d[_0xd9ff('0x53')][_0xd9ff('0x47')](function(_0x4e6dd2){_0x5da1a8['field']('i.'+_0x4e6dd2);});}else{_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xa9'),'Account.key');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xaa'),_0xd9ff('0xab'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xac'),_0xd9ff('0x9d'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xad'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xae'),_0xd9ff('0xaf'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb0'),'Contact.lastName');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb1'),'Contact.email');_0x5da1a8['field'](_0xd9ff('0xb2'),_0xd9ff('0xb3'));_0x5da1a8['field'](_0xd9ff('0xb4'),_0xd9ff('0xb5'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb6'),_0xd9ff('0xb7'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb8'),_0xd9ff('0xb9'));_0x5da1a8['field']('o.internal','Owner.internal');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xba'),_0xd9ff('0x45'));}if(_0x30c69d['limit'])_0x5da1a8[_0xd9ff('0x33')](_0x30c69d[_0xd9ff('0x33')]);if(_0x30c69d[_0xd9ff('0x31')])_0x5da1a8[_0xd9ff('0x31')](_0x30c69d[_0xd9ff('0x31')]);return db[_0xd9ff('0xa7')]['query'](_0x5da1a8[_0xd9ff('0xbb')](),_0x4c2ad5);})['then'](function(_0x5cb3af){if(_0x5cb3af[_0xd9ff('0x54')]>0x0)_0x3ed112[_0xd9ff('0x82')](_0xd9ff('0xbc'),_['map'](_0x5cb3af,'id'));return db[_0xd9ff('0xa7')][_0xd9ff('0x4e')](_0x3ed112['toString'](),_0x4c2ad5)['then'](function(_0x4aa6d5){var _0x11840a=_[_0xd9ff('0xbd')](_0x4aa6d5,'ChatInteractionId');var _0x2871ec=[];_0x5cb3af[_0xd9ff('0x47')](function(_0x16e130){_0x2871ec['push'](updateChatInteraction(_0x16e130,_0xfede73,_0x11840a));});return BPromise['all'](_0x2871ec);});});})['then'](function(_0xdf2e33){_0xd64585['rows']=_0xdf2e33;return _0xd64585;})[_0xd9ff('0x22')](respondWithFilteredResult(_0x437561,_0x30c69d))[_0xd9ff('0x2d')](handleError(_0x437561,null));};exports['show']=function(_0x1b048b,_0x5eeeaf){var _0x3339e5={'raw':![],'where':{'id':_0x1b048b[_0xd9ff('0xbe')]['id']}},_0x1f7d87={};_0x1f7d87['model']=_[_0xd9ff('0x4d')](db['ChatInteraction']['rawAttributes']);_0x1f7d87['query']=_[_0xd9ff('0x4d')](_0x1b048b[_0xd9ff('0x4e')]);_0x1f7d87[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x1f7d87['model'],_0x1f7d87['query']);_0x3339e5[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x1f7d87[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x1b048b[_0xd9ff('0x4e')]['fields']));_0x3339e5['attributes']=_0x3339e5[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x3339e5[_0xd9ff('0x53')]:_0x1f7d87[_0xd9ff('0x50')];if(_0x1b048b[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x3339e5['include']=[{'all':!![]}];}_0x3339e5=_[_0xd9ff('0x3e')]({},_0x3339e5,_0x1b048b['options']);return db['ChatInteraction'][_0xd9ff('0xc0')](_0x3339e5)[_0xd9ff('0x22')](handleEntityNotFound(_0x5eeeaf,null))[_0xd9ff('0x22')](respondWithResult(_0x5eeeaf,null))[_0xd9ff('0x2d')](handleError(_0x5eeeaf,null));};exports['create']=function(_0x4e3fdd,_0x2cf8da){return db['ChatInteraction']['create'](_0x4e3fdd[_0xd9ff('0x3f')],{})['then'](respondWithResult(_0x2cf8da,0xc9))[_0xd9ff('0x2d')](handleError(_0x2cf8da,null));};exports['update']=function(_0x327cd8,_0xd95329){if(_0x327cd8[_0xd9ff('0x3f')]['id']){delete _0x327cd8[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x327cd8[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0xd95329,null))[_0xd9ff('0x22')](saveUpdates(_0x327cd8['body'],null))['then'](respondWithResult(_0xd95329,null))[_0xd9ff('0x2d')](handleError(_0xd95329,null));};exports[_0xd9ff('0xc1')]=function(_0x499869,_0x3c86ac){return db['ChatInteraction']['find']({'where':{'id':_0x499869[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x3c86ac,null))[_0xd9ff('0x22')](removeEntity(_0x3c86ac,null))[_0xd9ff('0x2d')](handleError(_0x3c86ac,null));};exports[_0xd9ff('0xc2')]=function(_0x11c84f,_0x2d0261){return db[_0xd9ff('0x49')][_0xd9ff('0xc2')]()[_0xd9ff('0x22')](respondWithResult(_0x2d0261,null))[_0xd9ff('0x2d')](handleError(_0x2d0261,null));};exports[_0xd9ff('0xc3')]=function(_0x73cfcf,_0x538f20){var _0x51feff=_0x73cfcf['params']['id'];var _0x30c62c;var _0x50b6b2;var _0x413aef;return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x51feff}})[_0xd9ff('0x22')](function(_0x54c390){_0x30c62c=_0x54c390;return db[_0xd9ff('0xc5')]['findOne']({'where':{'id':_0x54c390[_0xd9ff('0x81')]},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0xd9ff('0xc6'),'vidaooMetadata'],'raw':!![]});})[_0xd9ff('0x22')](function(_0x54524c){if(_0x54524c&&_0x54524c[_0xd9ff('0xc7')]&&_0x54524c[_0xd9ff('0xc8')]){_0x50b6b2=_0x54524c;var _0x696e18={'interaction':{'id':_0x51feff},'agent':{'id':_0x73cfcf[_0xd9ff('0xa1')]['id'],'name':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0x3c')],'fullname':_0x73cfcf['user']['fullname'],'email':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]},'contact':_0x73cfcf[_0xd9ff('0x3f')][_0xd9ff('0x40')],'account':_0x73cfcf[_0xd9ff('0x3f')]['account']};var _0x432854={'rejectUnauthorized':![],'method':_0xd9ff('0xca'),'url':_0xd9ff('0xcb'),'headers':{'X-APIKEY':_0x54524c[_0xd9ff('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]],'buttons':null,'topic':_0x50b6b2['vidaooTopic'],'note':_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xc6')])?null:getMustacheRender(_0x50b6b2[_0xd9ff('0xc6')],_0x696e18),'metadata':null},'redirect':_0xd9ff('0xcd'),'json':!![]};try{if(!_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xce')])){var _0x1c8e55=getMustacheRender(_0x50b6b2[_0xd9ff('0xce')],_0x696e18);var _0x29fdb8=JSON[_0xd9ff('0x85')](_0x1c8e55);_0x432854[_0xd9ff('0x3f')][_0xd9ff('0xcf')]=_0x29fdb8;}}catch(_0xfc755a){throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))](_0xd9ff('0xd1'));}return rp(_0x432854);}else{throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd9ff('0x22')](function(_0x282183){_0x413aef=_0x282183;if(_0x413aef['id']){var _0x3aba00={'body':_0x413aef[_0xd9ff('0xd2')],'ChatWebsiteId':_0x50b6b2['id'],'ChatInteractionId':_0x30c62c['id'],'direction':_0xd9ff('0xd3'),'UserId':_0x73cfcf[_0xd9ff('0xa1')]['id']};return db[_0xd9ff('0xd4')][_0xd9ff('0xd5')](_0x3aba00,{});}else{throw new db['Sequelize'][(_0xd9ff('0xd0'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xd9ff('0x22')](function(){return _0x30c62c[_0xd9ff('0xd6')]({'vidaooSessionId':_0x413aef['id']});})[_0xd9ff('0x22')](respondWithResult(_0x538f20,null))[_0xd9ff('0x2d')](handleError(_0x538f20,null));};exports[_0xd9ff('0xd7')]=function(_0x204127,_0xf98666){if(_0x204127['body']['id']){delete _0x204127[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x204127[_0xd9ff('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xd9ff('0x71')}]})[_0xd9ff('0x22')](handleEntityNotFound(_0xf98666,null))['then'](saveUpdates(_0x204127[_0xd9ff('0x3f')],null))[_0xd9ff('0x22')](respondWithResult(_0xf98666,null))['catch'](handleError(_0xf98666,null));};exports['abandon']=function(_0x5c4138,_0x560ea2,_0x1e6d5a){if(_0x5c4138[_0xd9ff('0x3f')]['id']){delete _0x5c4138[_0xd9ff('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5c4138[_0xd9ff('0xbe')]['id']}})['then'](function(_0x43a941){if(!_0x43a941){logger[_0xd9ff('0x2a')](_0xd9ff('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x560ea2['sendStatus'](0x194);}else{if(_0x43a941[_0xd9ff('0x7e')]){throw new db[(_0xd9ff('0x97'))]['ValidationError'](_0xd9ff('0xd9'));}}return _0x43a941;})[_0xd9ff('0x22')](function(_0x7efe12){if(_0x7efe12){return _0x7efe12[_0xd9ff('0x3a')]({'closed':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xda')],'disposition':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xdb')]})[_0xd9ff('0x22')](function(_0x3b7aeb){return _0x3b7aeb;});}})[_0xd9ff('0x22')](function(_0x37eb49){return respondWithRpcPromise(_0xd9ff('0xdc'),_0xd9ff('0xdd'),_0x5c4138[_0xd9ff('0x3f')],client9004);})[_0xd9ff('0x22')](respondWithResult(_0x560ea2,null))[_0xd9ff('0x2d')](handleError(_0x560ea2,null));};exports[_0xd9ff('0xde')]=function(_0x3b05c4,_0x32c04e,_0x1bcf8f){_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0x3c')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe0')];_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0xe1')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe2')];_0x3b05c4['body'][_0xd9ff('0x4c')]=_0x3b05c4[_0xd9ff('0xdf')]['mimetype'];return db[_0xd9ff('0xe3')][_0xd9ff('0xd5')](_0x3b05c4[_0xd9ff('0x3f')])[_0xd9ff('0x22')](respondWithResult(_0x32c04e,0xc9))[_0xd9ff('0x2d')](handleError(_0x32c04e,null));};exports[_0xd9ff('0xe4')]=function(_0x5978ad,_0x4ddfe7,_0x30c520){return db['ChatInteraction']['findOne']({'where':{'id':_0x5978ad[_0xd9ff('0xbe')]['id']},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null))['then'](function(_0x327362){if(_0x327362){if(_0x327362[_0xd9ff('0xda')]){return _0x4ddfe7[_0xd9ff('0x35')](0x193)[_0xd9ff('0x30')]({'status':0x193,'message':'Unauthorized'});}return db[_0xd9ff('0xe3')][_0xd9ff('0xc4')]({'where':{'id':_0x5978ad['query'][_0xd9ff('0xe5')]},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null));}})['then'](function(_0x62f1f3){if(_0x62f1f3){var _0xd188cf=_0x62f1f3[_0xd9ff('0xe6')]!==null;var _0x5b2e9c=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],_0xd9ff('0xe9'));if(_0xd188cf){_0x5b2e9c=path['join'](_0x5b2e9c,_0xd9ff('0xea'));}var _0x53a25a=path[_0xd9ff('0xe7')](_0x5b2e9c,_0x62f1f3[_0xd9ff('0xe1')]);return _0x4ddfe7[_0xd9ff('0xeb')](_0x53a25a);}})[_0xd9ff('0x2d')](handleError(_0x4ddfe7,null));};exports[_0xd9ff('0xec')]=function(_0x10397d,_0x51039f){var _0x37ea50=null;var _0x3cf2ef=null;var _0x171195=null;var _0x24c066=null;if(_0x10397d[_0xd9ff('0x3f')]['id']){delete _0x10397d['body']['id'];}if(_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]){_0x24c066=path['join'](config[_0xd9ff('0xe8')],_0xd9ff('0xee'),util[_0xd9ff('0xef')](_0xd9ff('0xf0'),Date[_0xd9ff('0xf1')]()));_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xf2')]=_0x24c066;}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x10397d[_0xd9ff('0xbe')]['id']},'include':[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'include':[{'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c')}]}]})[_0xd9ff('0x22')](handleEntityNotFound(_0x51039f,null))[_0xd9ff('0x22')](saveUpdates(_0x10397d['body'],null))['then'](function(_0x497e36){if(_0x497e36){_0x37ea50=_0x497e36;return db[_0xd9ff('0xc5')]['find']({'where':{'id':_0x37ea50[_0xd9ff('0x81')]}});}})['then'](function(_0x4d4cc0){if(_0x4d4cc0){_0x171195=_0x4d4cc0;return db['CmContact'][_0xd9ff('0xc0')]({'where':{'id':_0x37ea50['ContactId']}});}})['then'](function(_0x474b4c){if(_0x474b4c){_0x3cf2ef=_0x474b4c;if(_0x24c066){var _0x144cf7=null;for(var _0x9eac7f=0x1;_0x9eac7f<_0x37ea50[_0xd9ff('0xf3')][_0xd9ff('0x54')];++_0x9eac7f){_0x144cf7=_0x37ea50[_0xd9ff('0xf3')][_0x9eac7f];var _0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');var _0x4531bc=_0x10397d['body']['customer']||util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0xd9ff('0xf7'),_0x144cf7[_0xd9ff('0x76')]);switch(_0x171195[_0xd9ff('0xf8')]){case _0xd9ff('0xf9'):_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')]('%s%d',_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');break;case _0xd9ff('0xfa'):_0x2450da=_0x144cf7['UserId']?_0x144cf7['User'][_0xd9ff('0xfb')]||_0x144cf7[_0xd9ff('0x7c')]['fullname']:_0xd9ff('0xf6');break;case _0xd9ff('0xfc'):_0x2450da=_0x144cf7['UserId']?_0x144cf7[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6');break;default:_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7['UserId']):_0xd9ff('0xf6');}var _0x62b518=util[_0xd9ff('0xef')](_0xd9ff('0xfd'),moment(_0x144cf7[_0xd9ff('0x84')])['format'](_0xd9ff('0xfe')),_0x144cf7[_0xd9ff('0xff')]==='in'?_0x4531bc:_0x2450da,_0x144cf7[_0xd9ff('0x3f')]);if(!_0x144cf7['secret']){fs[_0xd9ff('0x100')](_0x24c066,_0x62b518);}}return db[_0xd9ff('0x101')][_0xd9ff('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd9ff('0x102'),'raw':!![]}]});}}})['then'](function(_0x5e07ae){if(_0x5e07ae&&_0x5e07ae['Smtp']&&_0x10397d['body']){var _0x578f41={'tls':{'rejectUnauthorized':![]}};if(_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')]){_0x578f41['service']=_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')];}else{_0x578f41[_0xd9ff('0x104')]=_0x5e07ae['Smtp'][_0xd9ff('0x104')];_0x578f41['port']=_0x5e07ae['Smtp'][_0xd9ff('0x105')];_0x578f41[_0xd9ff('0x106')]=_0x5e07ae[_0xd9ff('0x102')]['secure'];}if(_0x5e07ae['Smtp'][_0xd9ff('0x107')]){_0x578f41[_0xd9ff('0x108')]={'user':_0x5e07ae['Smtp'][_0xd9ff('0xa1')],'pass':_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x109')]};}return respondWithRpcPromise(_0xd9ff('0x10a'),_0xd9ff('0x10b'),{'account':_0x578f41,'message':{'from':util[_0xd9ff('0xef')](_0xd9ff('0x10c'),_0x5e07ae['name'],_0x5e07ae[_0xd9ff('0xc9')]||_0x5e07ae[_0xd9ff('0x102')]['user']),'to':_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')],'subject':'Mail\x20Transcript','text':util[_0xd9ff('0xef')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]),'attachments':[{'path':_0x24c066}]}})['then'](function(){return _0x37ea50;})[_0xd9ff('0x2d')](function(_0x4d6172){console[_0xd9ff('0x2a')](_0x4d6172);});}else{return _0x37ea50;}})[_0xd9ff('0x22')](respondWithStatusCode(_0x51039f,0xc8))[_0xd9ff('0x2d')](handleError(_0x51039f,null));};exports[_0xd9ff('0x10d')]=function(_0x6a2524,_0x356583,_0x5c1165){return db['ChatMessage'][_0xd9ff('0xc0')]({'where':{'id':_0x6a2524['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x356583,null))[_0xd9ff('0x22')](function(_0x599273){if(_0x599273){return _0x599273['addMessage'](_0x6a2524['body'][_0xd9ff('0x10e')],_[_0xd9ff('0x10f')](_0x6a2524[_0xd9ff('0x3f')],['ids','id'])||{});}})[_0xd9ff('0x22')](respondWithResult(_0x356583,null))[_0xd9ff('0x2d')](handleError(_0x356583,null));};exports[_0xd9ff('0x110')]=function(_0x2832b7,_0x618c47,_0x109140){var _0x278670={'raw':![],'where':{}};var _0x5e064d={};var _0x231b46={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x2832b7[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x618c47,null))[_0xd9ff('0x22')](function(_0x1802b1){if(_0x1802b1){_0x5e064d[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')][_0xd9ff('0x4a')]);_0x5e064d['query']=_['keys'](_0x2832b7[_0xd9ff('0x4e')]);_0x5e064d['filters']=_['intersection'](_0x5e064d[_0xd9ff('0x50')],_0x5e064d[_0xd9ff('0x4e')]);_0x278670[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x5e064d[_0xd9ff('0x50')],qs['fields'](_0x2832b7[_0xd9ff('0x4e')]['fields']));_0x278670[_0xd9ff('0x53')]=_0x278670[_0xd9ff('0x53')]['length']?_0x278670[_0xd9ff('0x53')]:_0x5e064d[_0xd9ff('0x50')];if(!_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x278670[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0x2832b7['query'][_0xd9ff('0x33')]);_0x278670[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x31')]);}_0x278670[_0xd9ff('0x9c')]=qs['sort'](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x278670[_0xd9ff('0x82')]=qs['filters'](_[_0xd9ff('0x58')](_0x2832b7['query'],_0x5e064d[_0xd9ff('0x4f')]));_0x278670['where'][_0xd9ff('0x111')]=_0x1802b1['id'];if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x278670['where']=_[_0xd9ff('0x3e')](_0x278670['where'],{'$or':_[_0xd9ff('0x79')](_0x278670[_0xd9ff('0x53')],function(_0x2b2a50){var _0x34f3f0={};_0x34f3f0[_0x2b2a50]={'$like':'%'+_0x2832b7[_0xd9ff('0x4e')]['filter']+'%'};return _0x34f3f0;})});}if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')]){var _0x955328=_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')][_0xd9ff('0x46')](',');var _0x5d95b1={};_0x5d95b1[_0x955328[0x0]]={'$gte':moment(_0x955328[0x1])['format'](_0xd9ff('0x112'))};_0x278670[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x278670[_0xd9ff('0x82')],_0x5d95b1);}_0x278670=_[_0xd9ff('0x3e')]({},_0x278670,_0x2832b7[_0xd9ff('0x113')]);return db[_0xd9ff('0xd4')]['count']({'where':_0x278670[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x3e90fe){_0x231b46[_0xd9ff('0x34')]=_0x3e90fe;if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x278670['include']=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x278670);})[_0xd9ff('0x22')](function(_0x33f933){_0x231b46[_0xd9ff('0x115')]=_0x33f933;return _0x231b46;});}})[_0xd9ff('0x22')](respondWithFilteredResult(_0x618c47,_0x278670))['catch'](handleError(_0x618c47,null));};exports['getMyMessages']=function(_0xf3a93b,_0x473ecf,_0x1213a4){var _0x6f731a={'where':{}},_0x193c57={},_0x4572b2={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0xf3a93b['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x473ecf,null))[_0xd9ff('0x22')](function(_0x4115a3){if(_0x4115a3){_0x193c57[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')]['rawAttributes']);_0x193c57[_0xd9ff('0x4e')]=_['keys'](_0xf3a93b['query']);_0x193c57[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],_0x193c57[_0xd9ff('0x4e')]);_0x6f731a[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0xf3a93b['query'][_0xd9ff('0x52')]));_0x6f731a['attributes']=_0x6f731a[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x6f731a[_0xd9ff('0x53')]:_0x193c57[_0xd9ff('0x50')];if(!_0xf3a93b['query'][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x6f731a[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x6f731a[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0xf3a93b[_0xd9ff('0x4e')]['offset']);}_0x6f731a[_0xd9ff('0x9c')]=qs['sort'](_0xf3a93b['query'][_0xd9ff('0x57')]);_0x6f731a[_0xd9ff('0x82')]=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0xf3a93b[_0xd9ff('0x4e')],_0x193c57[_0xd9ff('0x4f')]));_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x111')]=_0x4115a3['id'];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x6f731a[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x6f731a['where'],{'$or':_[_0xd9ff('0x79')](_0x6f731a['attributes'],function(_0x1bb980){var _0x3ccf5d={};_0x3ccf5d[_0x1bb980]={'$like':'%'+_0xf3a93b['query']['filter']+'%'};return _0x3ccf5d;})});}_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x116')]=![];if(_0xf3a93b['query']['id']){_0x6f731a[_0xd9ff('0x82')]['id']={'$gt':_0xf3a93b[_0xd9ff('0x4e')]['id']};}_0x6f731a=_['merge']({},_0x6f731a,_0xf3a93b[_0xd9ff('0x113')]);return db['ChatMessage'][_0xd9ff('0x34')]({'where':_0x6f731a[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x42d9ff){_0x4572b2[_0xd9ff('0x34')]=_0x42d9ff;_0x6f731a[_0xd9ff('0x117')]=[];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x118')]){_0x6f731a[_0xd9ff('0x117')][_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43'),_0xd9ff('0xfb')]});}if(_0xf3a93b['query'][_0xd9ff('0xbf')]){_0x6f731a[_0xd9ff('0x117')]=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x6f731a);})[_0xd9ff('0x22')](function(_0x314f18){_0x4572b2['rows']=_0x314f18;return _0x4572b2;});}})['then'](respondWithFilteredResult(_0x473ecf,_0x6f731a))['catch'](handleError(_0x473ecf,null));};exports['addTags']=function(_0x4699d3,_0x2e91a8,_0x4956b2){return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x4699d3[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2e91a8,null))['then'](function(_0x217023){if(_0x217023){return _0x217023[_0xd9ff('0x11a')](_0x4699d3['body']['ids'],_['omit'](_0x4699d3['body'],['ids','id'])||{})[_0xd9ff('0x11b')](function(){return db[_0xd9ff('0x11c')][_0xd9ff('0x114')]({'attributes':['id',_0xd9ff('0x3c'),_0xd9ff('0x5b')],'where':{'id':_0x4699d3[_0xd9ff('0x3f')][_0xd9ff('0x10e')]}});})[_0xd9ff('0x22')](function(_0x317f93){socket[_0xd9ff('0x11d')](_0xd9ff('0x11e'),{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]});return{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]};});}})[_0xd9ff('0x22')](respondWithResult(_0x2e91a8,null))[_0xd9ff('0x2d')](handleError(_0x2e91a8,null));};exports[_0xd9ff('0x11f')]=function(_0x404baf,_0x5d73cd,_0xdb719b){return db['ChatInteraction'][_0xd9ff('0xc0')]({'where':{'id':_0x404baf['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x5d73cd,null))[_0xd9ff('0x22')](function(_0x10935d){if(_0x10935d){return _0x10935d['removeTags'](_0x404baf['query']['ids']);}})['then'](respondWithStatusCode(_0x5d73cd,null))['catch'](handleError(_0x5d73cd,null));};exports[_0xd9ff('0xeb')]=function(_0x2031e9,_0x3b50d9){var _0x410fae=moment()[_0xd9ff('0x120')]()[_0xd9ff('0xbb')]();var _0x494da6=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server','files',_0xd9ff('0x121'));var _0x49c9cc=path[_0xd9ff('0xe7')](config['root'],_0xd9ff('0x122'),_0xd9ff('0x123'),'attachments');var _0x378746=path[_0xd9ff('0xe7')](_0x494da6,_0x410fae);var _0x2acbe3=util[_0xd9ff('0xef')]('transcript-%d-%s.zip',_0x2031e9['params']['id'],_0x410fae);var _0x46d12c=path[_0xd9ff('0xe7')](_0x494da6,_0x2acbe3);var _0x54f4aa=[];_0x54f4aa[_0xd9ff('0x119')]({'model':db['User'],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43')],'raw':!![]});_0x54f4aa[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x124')],'as':_0xd9ff('0x71'),'attributes':['id',_0xd9ff('0x125'),'lastName'],'raw':!![]});if(_0x2031e9['query'][_0xd9ff('0x126')]){_0x54f4aa['push']({'model':db[_0xd9ff('0xe3')],'as':'Attachment','raw':!![]});}var _0xd015e9=[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'attributes':['id','body',_0xd9ff('0x84'),_0xd9ff('0xff'),'secret','read'],'include':_0x54f4aa}];_0xd015e9['push']({'model':db[_0xd9ff('0xc5')],'as':_0xd9ff('0x127'),'attributes':['id',_0xd9ff('0x3c')]});_0xd015e9[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x128'),'attributes':['id',_0xd9ff('0x43')]});return db[_0xd9ff('0x49')]['find']({'where':{'id':_0x2031e9[_0xd9ff('0xbe')]['id']},'include':_0xd015e9})[_0xd9ff('0x22')](handleEntityNotFound(_0x3b50d9,null))[_0xd9ff('0x22')](function(_0x1b452e){if(_0x1b452e){var _0x3ab927=_0x1b452e[_0xd9ff('0x129')]({'plain':!![]});fs[_0xd9ff('0x12a')](_0x378746);var _0x2b6e15={'channel':_0xd9ff('0x12b'),'account':_0x3ab927['Account']['name'],'agent':_0x3ab927['Owner']?_0x3ab927[_0xd9ff('0x128')][_0xd9ff('0x43')]:'N.A.','createdAt':moment(_0x3ab927[_0xd9ff('0x84')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd9ff('0xbb')](),'closedAt':_0x3ab927[_0xd9ff('0xda')]?moment(_0x3ab927[_0xd9ff('0x12c')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')]():'','disposition':_0x3ab927['disposition'],'chatInfo':{'browser':_0x3ab927[_0xd9ff('0x12d')],'os':_0x3ab927[_0xd9ff('0x12e')],'referer':_0x3ab927[_0xd9ff('0x12f')],'customerIp':_0x3ab927[_0xd9ff('0x130')],'customerPort':_0x3ab927[_0xd9ff('0x131')]?_0x3ab927['customerPort']:'N.A.'},'messages':_(_0x3ab927[_0xd9ff('0xf3')])[_0xd9ff('0x132')]()[_0xd9ff('0x90')]({'secret':![]})[_0xd9ff('0x79')](function(_0x319248){if(_0x319248[_0xd9ff('0xe3')]){var _0x1ea603=path[_0xd9ff('0xe7')](_0x49c9cc,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')]);if(fs[_0xd9ff('0x133')](_0x1ea603)){fs[_0xd9ff('0x134')](_0x1ea603)[_0xd9ff('0x135')](fs['createWriteStream'](path[_0xd9ff('0xe7')](_0x378746,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')])));}}return{'date':moment(_0x319248[_0xd9ff('0x84')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')](),'sender':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?_0x319248[_0xd9ff('0x7c')]?_0x319248[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6'):_0x319248['Contact'][_0xd9ff('0x125')]+(_0x319248[_0xd9ff('0x71')][_0xd9ff('0x136')]?'\x20'+_0x319248[_0xd9ff('0x71')]['lastName']:''),'body':_0x319248[_0xd9ff('0xe3')]?_0x319248['Attachment']['basename']:_0x319248[_0xd9ff('0x3f')],'direction':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?'A':'C','secret':_0x319248[_0xd9ff('0x116')],'read':_0x319248[_0xd9ff('0x8c')],'attachment':_0x319248[_0xd9ff('0xe3')]};})[_0xd9ff('0x6d')]()};return ejs['renderFile'](path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server',_0xd9ff('0x137'),_0xd9ff('0x138')),{'interaction':_0x2b6e15})[_0xd9ff('0x22')](function(_0xb07a14){var _0x1c419f=path[_0xd9ff('0xe7')](_0x378746,_0xd9ff('0x139')+_0x3ab927['id']+'-'+_0x410fae+_0xd9ff('0x13a'));var _0x3156c8={'path':_0x1c419f,'channel':_0xd9ff('0x12b'),'interactionId':_0x3ab927['id']};return pdf[_0xd9ff('0x13b')](_0xb07a14,_0x3156c8);})['then'](function(){return new BPromise(function(_0x567007,_0x1019f9){zipdir(_0x378746,{'saveTo':_0x46d12c},function(_0x2ab78a,_0x4649d9){if(_0x2ab78a)return _0x1019f9(_0x2ab78a);return _0x567007(_0x4649d9);});})[_0xd9ff('0x22')](function(){return new BPromise(function(_0x166033,_0x3c40e4){rimraf(_0x378746,function(_0x346d93){if(_0x346d93)_0x3c40e4(_0x346d93);return _0x166033();});});})[_0xd9ff('0x22')](function(){return _0x3b50d9['download'](_0x46d12c,_0x2acbe3,function(_0x22680e){if(_0x22680e){console['log'](_0xd9ff('0x13c'),_0x22680e);}else{fs[_0xd9ff('0x13d')](_0x46d12c);}});});});}else{return _0x3b50d9['sendStatus'](0xc8);}})[_0xd9ff('0x2d')](handleError(_0x3b50d9,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index e3e4712..e77535e 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 _0xe530=['then','setDataValue','map','findAll','unreadMessages','length','hasOwnProperty','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','getUsers'];(function(_0x361229,_0x89f7fd){var _0x484ed0=function(_0x23bd60){while(--_0x23bd60){_0x361229['push'](_0x361229['shift']());}};_0x484ed0(++_0x89f7fd);}(_0xe530,0x19d));var _0x0e53=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xe530[_0xefd519];return _0x4bb882;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x0e53('0x0'))['db'][_0x0e53('0x1')];var ChatMessage=require(_0x0e53('0x0'))['db'][_0x0e53('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0e53('0x3')](0x0);var events={'afterCreate':_0x0e53('0x4'),'afterUpdate':'update','afterDestroy':_0x0e53('0x5')};function emitEvent(_0x47625e){return function(_0x1348dd,_0x5c7e70,_0x5e9b9a){_0x1348dd[_0x0e53('0x6')]({'attributes':['id'],'raw':!![]})[_0x0e53('0x7')](function(_0x57f6f8){_0x1348dd[_0x0e53('0x8')]('Users',_0x57f6f8[_0x0e53('0x9')](function(_0x194db7){return{'id':_0x194db7['id']};}));return ChatMessage[_0x0e53('0xa')]({'where':{'ChatInteractionId':_0x1348dd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0e53('0x7')](function(_0x15d592){_0x1348dd[_0x0e53('0x8')](_0x0e53('0xb'),_0x15d592[_0x0e53('0xc')]);ChatInteractionEvents['emit'](_0x47625e+':'+_0x1348dd['id'],_0x1348dd);ChatInteractionEvents['emit'](_0x47625e,_0x1348dd);_0x5e9b9a(null);})['catch'](_0x5e9b9a(null));};}for(var e in events){if(events[_0x0e53('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x0e53('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x82f0=['update','remove','getUsers','then','map','findAll','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save'];(function(_0x5e7361,_0x31140d){var _0x248a05=function(_0x292e2c){while(--_0x292e2c){_0x5e7361['push'](_0x5e7361['shift']());}};_0x248a05(++_0x31140d);}(_0x82f0,0x1d6));var _0x082f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x82f0[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x082f('0x0'));var ChatInteraction=require(_0x082f('0x1'))['db'][_0x082f('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x082f('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x082f('0x4')](0x0);var events={'afterCreate':_0x082f('0x5'),'afterUpdate':_0x082f('0x6'),'afterDestroy':_0x082f('0x7')};function emitEvent(_0x9cb553){return function(_0x4ae7ca,_0xa5dcb7,_0x151a3e){_0x4ae7ca[_0x082f('0x8')]({'attributes':['id'],'raw':!![]})[_0x082f('0x9')](function(_0x3c6282){_0x4ae7ca['setDataValue']('Users',_0x3c6282[_0x082f('0xa')](function(_0x2f3576){return{'id':_0x2f3576['id']};}));return ChatMessage[_0x082f('0xb')]({'where':{'ChatInteractionId':_0x4ae7ca['id'],'direction':'in','read':![]},'raw':!![]});})[_0x082f('0x9')](function(_0x4fbe6c){_0x4ae7ca['setDataValue'](_0x082f('0xc'),_0x4fbe6c[_0x082f('0xd')]);ChatInteractionEvents[_0x082f('0xe')](_0x9cb553+':'+_0x4ae7ca['id'],_0x4ae7ca);ChatInteractionEvents['emit'](_0x9cb553,_0x4ae7ca);_0x151a3e(null);})['catch'](_0x151a3e(null));};}for(var e in events){if(events[_0x082f('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x082f('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index d1669f0..04678a8 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 _0x5538=['util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x5538,0x10d));var _0x8553=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x5538[_0x29d915];return _0x160f86;};'use strict';var _=require(_0x8553('0x0'));var util=require(_0x8553('0x1'));var logger=require(_0x8553('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8553('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8553('0x4'));var rimraf=require(_0x8553('0x5'));var config=require(_0x8553('0x6'));var attributes=require(_0x8553('0x7'));module[_0x8553('0x8')]=function(_0x2aa9ec,_0x333ec7){return _0x2aa9ec[_0x8553('0x9')](_0x8553('0xa'),attributes,{'tableName':_0x8553('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3571b9,_0xe21d1d,_0x83962c){if(_0x3571b9[_0x8553('0xc')](_0x8553('0xd'))){_0x3571b9['closedAt']=moment()[_0x8553('0xe')](_0x8553('0xf'));}_0x83962c(null,_0x3571b9);}},'charset':_0x8553('0x10'),'collate':_0x8553('0x11')});};
\ No newline at end of file
+var _0xbb69=['moment','request-promise','path','rimraf','./chatInteraction.attributes','exports','define','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x5e601a,_0x16931f){var _0x5e34c4=function(_0x120dc7){while(--_0x120dc7){_0x5e601a['push'](_0x5e601a['shift']());}};_0x5e34c4(++_0x16931f);}(_0xbb69,0x10d));var _0x9bb6=function(_0x5035d5,_0x4a802e){_0x5035d5=_0x5035d5-0x0;var _0x14ba47=_0xbb69[_0x5035d5];return _0x14ba47;};'use strict';var _=require(_0x9bb6('0x0'));var util=require(_0x9bb6('0x1'));var logger=require('../../config/logger')(_0x9bb6('0x2'));var moment=require(_0x9bb6('0x3'));var BPromise=require('bluebird');var rp=require(_0x9bb6('0x4'));var fs=require('fs');var path=require(_0x9bb6('0x5'));var rimraf=require(_0x9bb6('0x6'));var config=require('../../config/environment');var attributes=require(_0x9bb6('0x7'));module[_0x9bb6('0x8')]=function(_0x151759,_0x40b278){return _0x151759[_0x9bb6('0x9')]('ChatInteraction',attributes,{'tableName':_0x9bb6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d4936,_0x3bb585,_0x34794b){if(_0x4d4936[_0x9bb6('0xb')]('closed')){_0x4d4936[_0x9bb6('0xc')]=moment()[_0x9bb6('0xd')](_0x9bb6('0xe'));}_0x34794b(null,_0x4d4936);}},'charset':_0x9bb6('0xf'),'collate':_0x9bb6('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 613b66a..6f7bac4 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 _0x5243=['error','code','message','catch','UpdateChatInteraction','options','attributes','limit','AddTagsToChatInteraction','ChatInteraction','find','where','then','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0x5243,0x8a));var _0x3524=function(_0x5578d3,_0x2f41a8){_0x5578d3=_0x5578d3-0x0;var _0x289fc5=_0x5243[_0x5578d3];return _0x289fc5;};'use strict';var _=require(_0x3524('0x0'));var util=require(_0x3524('0x1'));var moment=require(_0x3524('0x2'));var BPromise=require(_0x3524('0x3'));var rs=require(_0x3524('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3524('0x5'))['db'];var utils=require(_0x3524('0x6'));var logger=require(_0x3524('0x7'))('rpc');var config=require(_0x3524('0x8'));var jayson=require(_0x3524('0x9'));var client=jayson['client'][_0x3524('0xa')]({'port':0x232a});config[_0x3524('0xb')]=_['defaults'](config[_0x3524('0xb')],{'host':_0x3524('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3524('0xb')]));require(_0x3524('0xd'))[_0x3524('0xe')](socket);function respondWithRpcPromise(_0x1a57ee,_0x2d1611,_0x2e5131){return new BPromise(function(_0x5da6f0,_0x322068){return client[_0x3524('0xf')](_0x1a57ee,_0x2e5131)['then'](function(_0x41fcaa){logger[_0x3524('0x10')](_0x3524('0x11'),_0x2d1611,_0x3524('0x12'));logger[_0x3524('0x13')](_0x3524('0x14'),_0x2d1611,_0x3524('0x12'),JSON[_0x3524('0x15')](_0x41fcaa));if(_0x41fcaa[_0x3524('0x16')]){if(_0x41fcaa[_0x3524('0x16')][_0x3524('0x17')]===0x1f4){logger[_0x3524('0x16')](_0x3524('0x11'),_0x2d1611,_0x41fcaa[_0x3524('0x16')]['message']);return _0x322068(_0x41fcaa['error'][_0x3524('0x18')]);}logger['error'](_0x3524('0x11'),_0x2d1611,_0x41fcaa[_0x3524('0x16')][_0x3524('0x18')]);return _0x5da6f0(_0x41fcaa[_0x3524('0x16')]['message']);}else{logger['info'](_0x3524('0x11'),_0x2d1611,_0x3524('0x12'));_0x5da6f0(_0x41fcaa['result'][_0x3524('0x18')]);}})[_0x3524('0x19')](function(_0x4e6e4a){logger[_0x3524('0x16')](_0x3524('0x11'),_0x2d1611,_0x4e6e4a);_0x322068(_0x4e6e4a);});});}exports[_0x3524('0x1a')]=function(_0x1d9d8f){var _0x350eb9=this;return new Promise(function(_0x55f960,_0x2dd58e){return db['ChatInteraction']['update'](_0x1d9d8f['body'],{'raw':_0x1d9d8f['options']?_0x1d9d8f[_0x3524('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d9d8f[_0x3524('0x1b')]?_0x1d9d8f['options']['where']||null:null,'attributes':_0x1d9d8f[_0x3524('0x1b')]?_0x1d9d8f['options'][_0x3524('0x1c')]||null:null,'limit':_0x1d9d8f[_0x3524('0x1b')]?_0x1d9d8f['options'][_0x3524('0x1d')]||null:null})['then'](function(_0xea0d70){logger[_0x3524('0x10')]('UpdateChatInteraction',_0x1d9d8f);logger[_0x3524('0x13')]('UpdateChatInteraction',_0x1d9d8f,JSON['stringify'](_0xea0d70));_0x55f960(_0xea0d70);})[_0x3524('0x19')](function(_0x164fd4){logger[_0x3524('0x16')](_0x3524('0x1a'),_0x164fd4[_0x3524('0x18')],_0x1d9d8f);_0x2dd58e(_0x350eb9[_0x3524('0x16')](0x1f4,_0x164fd4[_0x3524('0x18')]));});});};exports[_0x3524('0x1e')]=function(_0x344ba9){return new Promise(function(_0x13fb9f,_0x4c285a){return db[_0x3524('0x1f')][_0x3524('0x20')]({'where':_0x344ba9[_0x3524('0x1b')]?_0x344ba9['options'][_0x3524('0x21')]||null:null})[_0x3524('0x22')](function(_0x3c9ca8){if(_0x3c9ca8){return _0x3c9ca8['addTags'](_0x344ba9[_0x3524('0x23')][_0x3524('0x24')],_[_0x3524('0x25')](_0x344ba9['body'],[_0x3524('0x24'),'id'])||{});}})[_0x3524('0x26')](function(_0x34167c){logger[_0x3524('0x10')](_0x3524('0x27'),_0x344ba9);logger['debug']('AddTags',_0x344ba9,JSON[_0x3524('0x15')](_0x34167c));_0x13fb9f(_0x34167c);})[_0x3524('0x19')](function(_0x49b175){logger[_0x3524('0x16')](_0x3524('0x27'),_0x49b175['message'],_0x344ba9);_0x4c285a(_this[_0x3524('0x16')](0x1f4,_0x49b175[_0x3524('0x18')]));});});};
\ No newline at end of file
+var _0x0ca4=['AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','stringify','catch','find','addTags','ids','omit','spread'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x0ca4,0xc4));var _0x40ca=function(_0x49cd07,_0x417853){_0x49cd07=_0x49cd07-0x0;var _0x1f6a3b=_0x0ca4[_0x49cd07];return _0x1f6a3b;};'use strict';var _=require(_0x40ca('0x0'));var util=require('util');var moment=require(_0x40ca('0x1'));var BPromise=require(_0x40ca('0x2'));var rs=require(_0x40ca('0x3'));var fs=require('fs');var Redis=require(_0x40ca('0x4'));var db=require(_0x40ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x40ca('0x6'))(_0x40ca('0x7'));var config=require('../../config/environment');var jayson=require(_0x40ca('0x8'));var client=jayson[_0x40ca('0x9')][_0x40ca('0xa')]({'port':0x232a});config[_0x40ca('0xb')]=_['defaults'](config[_0x40ca('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x40ca('0xc'))(new Redis(config['redis']));require(_0x40ca('0xd'))['register'](socket);function respondWithRpcPromise(_0x5499e4,_0xa58426,_0x4a15f7){return new BPromise(function(_0x81d41c,_0x1beb18){return client[_0x40ca('0xe')](_0x5499e4,_0x4a15f7)[_0x40ca('0xf')](function(_0x4fd9d3){logger[_0x40ca('0x10')](_0x40ca('0x11'),_0xa58426,_0x40ca('0x12'));logger[_0x40ca('0x13')](_0x40ca('0x14'),_0xa58426,'request\x20sent',JSON['stringify'](_0x4fd9d3));if(_0x4fd9d3[_0x40ca('0x15')]){if(_0x4fd9d3[_0x40ca('0x15')][_0x40ca('0x16')]===0x1f4){logger[_0x40ca('0x15')]('ChatInteraction,\x20%s,\x20%s',_0xa58426,_0x4fd9d3['error']['message']);return _0x1beb18(_0x4fd9d3[_0x40ca('0x15')][_0x40ca('0x17')]);}logger[_0x40ca('0x15')](_0x40ca('0x11'),_0xa58426,_0x4fd9d3['error'][_0x40ca('0x17')]);return _0x81d41c(_0x4fd9d3['error'][_0x40ca('0x17')]);}else{logger[_0x40ca('0x10')](_0x40ca('0x11'),_0xa58426,_0x40ca('0x12'));_0x81d41c(_0x4fd9d3['result'][_0x40ca('0x17')]);}})['catch'](function(_0x2038de){logger['error'](_0x40ca('0x11'),_0xa58426,_0x2038de);_0x1beb18(_0x2038de);});});}exports[_0x40ca('0x18')]=function(_0x24d8ba){var _0x22f60e=this;return new Promise(function(_0x4ba991,_0x5a7af0){return db[_0x40ca('0x19')]['update'](_0x24d8ba[_0x40ca('0x1a')],{'raw':_0x24d8ba[_0x40ca('0x1b')]?_0x24d8ba[_0x40ca('0x1b')][_0x40ca('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24d8ba[_0x40ca('0x1b')]?_0x24d8ba[_0x40ca('0x1b')][_0x40ca('0x1d')]||null:null,'attributes':_0x24d8ba[_0x40ca('0x1b')]?_0x24d8ba['options'][_0x40ca('0x1e')]||null:null,'limit':_0x24d8ba['options']?_0x24d8ba[_0x40ca('0x1b')]['limit']||null:null})[_0x40ca('0xf')](function(_0x8a9d6e){logger['info'](_0x40ca('0x18'),_0x24d8ba);logger[_0x40ca('0x13')]('UpdateChatInteraction',_0x24d8ba,JSON[_0x40ca('0x1f')](_0x8a9d6e));_0x4ba991(_0x8a9d6e);})[_0x40ca('0x20')](function(_0x415010){logger[_0x40ca('0x15')](_0x40ca('0x18'),_0x415010['message'],_0x24d8ba);_0x5a7af0(_0x22f60e[_0x40ca('0x15')](0x1f4,_0x415010[_0x40ca('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x5879cc){return new Promise(function(_0x5f4765,_0x290232){return db[_0x40ca('0x19')][_0x40ca('0x21')]({'where':_0x5879cc[_0x40ca('0x1b')]?_0x5879cc['options'][_0x40ca('0x1d')]||null:null})['then'](function(_0x21d904){if(_0x21d904){return _0x21d904[_0x40ca('0x22')](_0x5879cc['body'][_0x40ca('0x23')],_[_0x40ca('0x24')](_0x5879cc['body'],[_0x40ca('0x23'),'id'])||{});}})[_0x40ca('0x25')](function(_0x588e9d){logger[_0x40ca('0x10')](_0x40ca('0x26'),_0x5879cc);logger[_0x40ca('0x13')]('AddTags',_0x5879cc,JSON[_0x40ca('0x1f')](_0x588e9d));_0x5f4765(_0x588e9d);})['catch'](function(_0x20f93c){logger[_0x40ca('0x15')](_0x40ca('0x26'),_0x20f93c[_0x40ca('0x17')],_0x5879cc);_0x290232(_this[_0x40ca('0x15')](0x1f4,_0x20f93c[_0x40ca('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index a512840..13bbdca 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 _0x7825=['removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove','emit'];(function(_0x3403d5,_0x3d99fc){var _0xf9df4f=function(_0x33d748){while(--_0x33d748){_0x3403d5['push'](_0x3403d5['shift']());}};_0xf9df4f(++_0x3d99fc);}(_0x7825,0xfc));var _0x5782=function(_0x503ec3,_0x5f851e){_0x503ec3=_0x503ec3-0x0;var _0x4ce7cf=_0x7825[_0x503ec3];return _0x4ce7cf;};'use strict';var ChatInteractionEvents=require(_0x5782('0x0'));var events=[_0x5782('0x1'),_0x5782('0x2'),'update'];function createListener(_0x9a0bd,_0x82a2b5){return function(_0x435009){_0x82a2b5[_0x5782('0x3')](_0x9a0bd,_0x435009);};}function removeListener(_0x4f618b,_0x53335f){return function(){ChatInteractionEvents[_0x5782('0x4')](_0x4f618b,_0x53335f);};}exports[_0x5782('0x5')]=function(_0x3a7cc6){for(var _0x17214b=0x0,_0x334879=events[_0x5782('0x6')];_0x17214b<_0x334879;_0x17214b++){var _0x62007f=events[_0x17214b];var _0x1418c4=createListener(_0x5782('0x7')+_0x62007f,_0x3a7cc6);ChatInteractionEvents['on'](_0x62007f,_0x1418c4);}};
\ No newline at end of file
+var _0xa2c5=['emit','register','save','remove','update'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa2c5,0x7a));var _0x5a2c=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xa2c5[_0x369151];return _0x4292d5;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x5a2c('0x0'),_0x5a2c('0x1'),_0x5a2c('0x2')];function createListener(_0x650de5,_0x56a201){return function(_0x3eb4cc){_0x56a201[_0x5a2c('0x3')](_0x650de5,_0x3eb4cc);};}function removeListener(_0x5b9b16,_0x26cfec){return function(){ChatInteractionEvents['removeListener'](_0x5b9b16,_0x26cfec);};}exports[_0x5a2c('0x4')]=function(_0x42a5c7){for(var _0xf13236=0x0,_0x5e43dc=events['length'];_0xf13236<_0x5e43dc;_0xf13236++){var _0x929717=events[_0xf13236];var _0x82ba11=createListener('chatInteraction:'+_0x929717,_0x42a5c7);ChatInteractionEvents['on'](_0x929717,_0x82ba11);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index bf449db..87253d7 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 _0x534f=['describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe'];(function(_0x3734a2,_0x250e45){var _0x595ca9=function(_0x271b76){while(--_0x271b76){_0x3734a2['push'](_0x3734a2['shift']());}};_0x595ca9(++_0x250e45);}(_0x534f,0x1d8));var _0xf534=function(_0x19ae33,_0xfa776a){_0x19ae33=_0x19ae33-0x0;var _0x3d57f0=_0x534f[_0x19ae33];return _0x3d57f0;};'use strict';var multer=require(_0xf534('0x0'));var util=require(_0xf534('0x1'));var path=require(_0xf534('0x2'));var timeout=require(_0xf534('0x3'));var express=require(_0xf534('0x4'));var router=express[_0xf534('0x5')]();var fs_extra=require(_0xf534('0x6'));var auth=require(_0xf534('0x7'));var interaction=require(_0xf534('0x8'));var config=require(_0xf534('0x9'));var controller=require(_0xf534('0xa'));router[_0xf534('0xb')]('/',auth[_0xf534('0xc')](),controller['index']);router[_0xf534('0xb')](_0xf534('0xd'),auth[_0xf534('0xc')](),controller[_0xf534('0xe')]);router[_0xf534('0xb')](_0xf534('0xf'),auth[_0xf534('0x10')](),controller['show']);router['get']('/:id/attachment_download',auth[_0xf534('0x10')](),controller[_0xf534('0x11')]);router['get'](_0xf534('0x12'),auth[_0xf534('0xc')](),controller['getMessages']);router[_0xf534('0xb')]('/:id/my_messages',auth[_0xf534('0x10')](),controller[_0xf534('0x13')]);router[_0xf534('0xb')](_0xf534('0x14'),auth['isAuthenticated'](),controller[_0xf534('0x15')]);router[_0xf534('0x16')]('/',auth[_0xf534('0xc')](),controller[_0xf534('0x17')]);router[_0xf534('0x16')](_0xf534('0x18'),auth[_0xf534('0xc')](),controller[_0xf534('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xf59186,_0x2e5f9d,_0x56f48e){_0x56f48e(null,path[_0xf534('0x1a')](config[_0xf534('0x1b')],_0xf534('0x1c')));},'filename':function(_0x4a83d3,_0x2abbc8,_0x55d371){_0x55d371(null,util['format'](_0xf534('0x1d'),Date[_0xf534('0x1e')](),_0x2abbc8[_0xf534('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf534('0x16')](_0xf534('0x20'),upload[_0xf534('0x21')](_0xf534('0x22')),controller[_0xf534('0x23')]);router[_0xf534('0x16')](_0xf534('0x12'),auth[_0xf534('0x10')](),controller[_0xf534('0x24')]);router[_0xf534('0x16')]('/:id/tags',auth[_0xf534('0xc')](),interaction[_0xf534('0x25')](_0xf534('0x26'),_0xf534('0x27')),controller[_0xf534('0x28')]);router['put'](_0xf534('0xf'),auth['isAuthenticated'](),interaction[_0xf534('0x25')]('chat','chatinteraction:update'),controller[_0xf534('0x29')]);router[_0xf534('0x2a')](_0xf534('0x2b'),controller[_0xf534('0x2c')]);router[_0xf534('0x2a')](_0xf534('0x2d'),auth[_0xf534('0x10')](),controller[_0xf534('0x2e')]);router['put'](_0xf534('0x2f'),controller[_0xf534('0x30')]);router[_0xf534('0x31')](_0xf534('0xf'),auth[_0xf534('0xc')](),interaction[_0xf534('0x25')](_0xf534('0x26'),_0xf534('0x32')),controller[_0xf534('0x33')]);router[_0xf534('0x31')](_0xf534('0x34'),auth[_0xf534('0xc')](),controller[_0xf534('0x35')]);module['exports']=router;
\ No newline at end of file
+var _0x31ad=['isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','join','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','tracked','chatinteraction:update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x167b75,_0x4b6ab7){var _0x3c305f=function(_0x542d7d){while(--_0x542d7d){_0x167b75['push'](_0x167b75['shift']());}};_0x3c305f(++_0x4b6ab7);}(_0x31ad,0xca));var _0xd31a=function(_0x251230,_0x3a5c8f){_0x251230=_0x251230-0x0;var _0x3b3ebd=_0x31ad[_0x251230];return _0x3b3ebd;};'use strict';var multer=require(_0xd31a('0x0'));var util=require('util');var path=require(_0xd31a('0x1'));var timeout=require(_0xd31a('0x2'));var express=require(_0xd31a('0x3'));var router=express[_0xd31a('0x4')]();var fs_extra=require(_0xd31a('0x5'));var auth=require(_0xd31a('0x6'));var interaction=require(_0xd31a('0x7'));var config=require(_0xd31a('0x8'));var controller=require('./chatInteraction.controller');router[_0xd31a('0x9')]('/',auth[_0xd31a('0xa')](),controller[_0xd31a('0xb')]);router[_0xd31a('0x9')](_0xd31a('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xd31a('0x9')](_0xd31a('0xd'),auth[_0xd31a('0xe')](),controller['show']);router['get']('/:id/attachment_download',auth[_0xd31a('0xe')](),controller[_0xd31a('0xf')]);router[_0xd31a('0x9')](_0xd31a('0x10'),auth['isAuthenticated'](),controller[_0xd31a('0x11')]);router['get'](_0xd31a('0x12'),auth[_0xd31a('0xe')](),controller[_0xd31a('0x13')]);router[_0xd31a('0x9')](_0xd31a('0x14'),auth['isAuthenticated'](),controller[_0xd31a('0x15')]);router[_0xd31a('0x16')]('/',auth['isAuthenticated'](),controller[_0xd31a('0x17')]);router[_0xd31a('0x16')](_0xd31a('0x18'),auth[_0xd31a('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xd31a('0x19')]({'destination':function(_0x51f04d,_0x4198e4,_0x138999){_0x138999(null,path[_0xd31a('0x1a')](config['root'],'server/files/attachments/'));},'filename':function(_0x5e8d2a,_0x9cb0f2,_0x196807){_0x196807(null,util['format'](_0xd31a('0x1b'),Date[_0xd31a('0x1c')](),_0x9cb0f2[_0xd31a('0x1d')][_0xd31a('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd31a('0x16')](_0xd31a('0x1f'),upload[_0xd31a('0x20')](_0xd31a('0x21')),controller[_0xd31a('0x22')]);router[_0xd31a('0x16')]('/:id/messages',auth[_0xd31a('0xe')](),controller[_0xd31a('0x23')]);router[_0xd31a('0x16')](_0xd31a('0x24'),auth[_0xd31a('0xa')](),interaction['tracked'](_0xd31a('0x25'),_0xd31a('0x26')),controller[_0xd31a('0x27')]);router['put']('/:id',auth[_0xd31a('0xa')](),interaction[_0xd31a('0x28')](_0xd31a('0x25'),_0xd31a('0x29')),controller['update']);router[_0xd31a('0x2a')](_0xd31a('0x2b'),controller[_0xd31a('0x2c')]);router[_0xd31a('0x2a')](_0xd31a('0x2d'),auth[_0xd31a('0xe')](),controller[_0xd31a('0x2e')]);router[_0xd31a('0x2a')]('/:id/close',controller[_0xd31a('0x2f')]);router[_0xd31a('0x30')]('/:id',auth[_0xd31a('0xa')](),interaction[_0xd31a('0x28')](_0xd31a('0x25'),_0xd31a('0x31')),controller[_0xd31a('0x32')]);router[_0xd31a('0x30')](_0xd31a('0x24'),auth['isAuthenticated'](),controller[_0xd31a('0x33')]);module[_0xd31a('0x34')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 78aa166..0177ae1 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 _0x3554=['medium','BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x3554,0x111));var _0x4355=function(_0x258bfa,_0x5acb66){_0x258bfa=_0x258bfa-0x0;var _0x3076fd=_0x3554[_0x258bfa];return _0x3076fd;};'use strict';var Sequelize=require(_0x4355('0x0'));module[_0x4355('0x1')]={'body':{'type':Sequelize[_0x4355('0x2')](_0x4355('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4355('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4355('0x5')]}};
\ No newline at end of file
+var _0x9fb9=['BOOLEAN','sequelize','exports','TEXT'];(function(_0x59767d,_0x2ed59f){var _0xf30900=function(_0x24b003){while(--_0x24b003){_0x59767d['push'](_0x59767d['shift']());}};_0xf30900(++_0x2ed59f);}(_0x9fb9,0xa1));var _0x99fb=function(_0x80b524,_0x62f0d6){_0x80b524=_0x80b524-0x0;var _0x167770=_0x9fb9[_0x80b524];return _0x167770;};'use strict';var Sequelize=require(_0x99fb('0x0'));module[_0x99fb('0x1')]={'body':{'type':Sequelize[_0x99fb('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x99fb('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index f1d5e7e..d4c63c5 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 _0x840b=['get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','length','resourceId','push','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','destroy','describe'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0x840b,0x104));var _0xb840=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x840b[_0xc8a931];return _0x28bd27;};'use strict';var emlformat=require(_0xb840('0x0'));var rimraf=require(_0xb840('0x1'));var zipdir=require(_0xb840('0x2'));var jsonpatch=require(_0xb840('0x3'));var rp=require(_0xb840('0x4'));var moment=require(_0xb840('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb840('0x6'));var util=require(_0xb840('0x7'));var path=require(_0xb840('0x8'));var sox=require(_0xb840('0x9'));var csv=require(_0xb840('0xa'));var ejs=require(_0xb840('0xb'));var fs=require('fs');var fs_extra=require(_0xb840('0xc'));var _=require(_0xb840('0xd'));var squel=require(_0xb840('0xe'));var crypto=require(_0xb840('0xf'));var jsforce=require(_0xb840('0x10'));var deskjs=require(_0xb840('0x11'));var toCsv=require(_0xb840('0xa'));var querystring=require('querystring');var Papa=require(_0xb840('0x12'));var Redis=require('ioredis');var authService=require(_0xb840('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb840('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb840('0x15'));var utils=require(_0xb840('0x16'));var config=require(_0xb840('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb840('0x18')]=_[_0xb840('0x19')](config[_0xb840('0x18')],{'host':_0xb840('0x1a'),'port':0x18eb});var socket=require(_0xb840('0x1b'))(new Redis(config[_0xb840('0x18')]));require('./chatInternalMessage.socket')[_0xb840('0x1c')](socket);function respondWithStatusCode(_0xe605b,_0x516f21){_0x516f21=_0x516f21||0xcc;return function(_0x16d27c){if(_0x16d27c){return _0xe605b[_0xb840('0x1d')](_0x516f21);}return _0xe605b[_0xb840('0x1e')](_0x516f21)[_0xb840('0x1f')]();};}function respondWithResult(_0x84bd1a,_0x269c53){_0x269c53=_0x269c53||0xc8;return function(_0x306dff){if(_0x306dff){return _0x84bd1a[_0xb840('0x1e')](_0x269c53)[_0xb840('0x20')](_0x306dff);}};}function respondWithFilteredResult(_0x5bf2d0,_0x9249a7){return function(_0x5bb8e0){if(_0x5bb8e0){var _0x2686d1=typeof _0x9249a7[_0xb840('0x21')]==='undefined'&&typeof _0x9249a7['limit']===_0xb840('0x22');var _0x5bb96c=_0x5bb8e0[_0xb840('0x23')];var _0xb19a4e=_0x2686d1?0x0:_0x9249a7[_0xb840('0x21')];var _0x4b43bf=_0x2686d1?_0x5bb8e0[_0xb840('0x23')]:_0x9249a7[_0xb840('0x21')]+_0x9249a7[_0xb840('0x24')];var _0xbbc21e;if(_0x4b43bf>=_0x5bb96c){_0x4b43bf=_0x5bb96c;_0xbbc21e=0xc8;}else{_0xbbc21e=0xce;}_0x5bf2d0['status'](_0xbbc21e);return _0x5bf2d0[_0xb840('0x25')](_0xb840('0x26'),_0xb19a4e+'-'+_0x4b43bf+'/'+_0x5bb96c)['json'](_0x5bb8e0);}return null;};}function patchUpdates(_0x55b902){return function(_0xcfc93d){try{jsonpatch[_0xb840('0x27')](_0xcfc93d,_0x55b902,!![]);}catch(_0x1b0f3a){return BPromise['reject'](_0x1b0f3a);}return _0xcfc93d['save']();};}function saveUpdates(_0x34eadb,_0xf52092){return function(_0x484161){if(_0x484161){return _0x484161['update'](_0x34eadb)['then'](function(_0x28820f){return _0x28820f;});}return null;};}function removeEntity(_0x439736,_0x26210d){return function(_0x1b499f){if(_0x1b499f){return _0x1b499f['destroy']()[_0xb840('0x28')](function(){_0x439736[_0xb840('0x1e')](0xcc)[_0xb840('0x1f')]();});}};}function handleEntityNotFound(_0x633a75,_0x34dbda){return function(_0x174649){if(!_0x174649){_0x633a75['sendStatus'](0x194);}return _0x174649;};}function handleError(_0x10d2c3,_0x493285){_0x493285=_0x493285||0x1f4;return function(_0x429d45){logger[_0xb840('0x29')](_0x429d45[_0xb840('0x2a')]);if(_0x429d45[_0xb840('0x2b')]){delete _0x429d45[_0xb840('0x2b')];}_0x10d2c3['status'](_0x493285)[_0xb840('0x2c')](_0x429d45);};}exports[_0xb840('0x2d')]=function(_0x56be87,_0x46c5cb){var _0xae7e98={},_0xc9cf51={},_0x35810e={'count':0x0,'rows':[]};var _0x1092a6=_[_0xb840('0x2e')](db[_0xb840('0x2f')][_0xb840('0x30')],function(_0x5b6f1b){return{'name':_0x5b6f1b[_0xb840('0x31')],'type':_0x5b6f1b[_0xb840('0x32')]['key']};});_0xc9cf51[_0xb840('0x33')]=_[_0xb840('0x2e')](_0x1092a6,'name');_0xc9cf51['query']=_['keys'](_0x56be87['query']);_0xc9cf51['filters']=_[_0xb840('0x34')](_0xc9cf51[_0xb840('0x33')],_0xc9cf51[_0xb840('0x35')]);_0xae7e98[_0xb840('0x36')]=_['intersection'](_0xc9cf51[_0xb840('0x33')],qs[_0xb840('0x37')](_0x56be87[_0xb840('0x35')]['fields']));_0xae7e98[_0xb840('0x36')]=_0xae7e98[_0xb840('0x36')]['length']?_0xae7e98[_0xb840('0x36')]:_0xc9cf51[_0xb840('0x33')];if(!_0x56be87['query'][_0xb840('0x38')](_0xb840('0x39'))){_0xae7e98[_0xb840('0x24')]=qs[_0xb840('0x24')](_0x56be87[_0xb840('0x35')]['limit']);_0xae7e98[_0xb840('0x21')]=qs[_0xb840('0x21')](_0x56be87[_0xb840('0x35')]['offset']);}_0xae7e98['order']=qs[_0xb840('0x3a')](_0x56be87['query'][_0xb840('0x3a')]);_0xae7e98[_0xb840('0x3b')]=qs[_0xb840('0x3c')](_[_0xb840('0x3d')](_0x56be87[_0xb840('0x35')],_0xc9cf51[_0xb840('0x3c')]),_0x1092a6);if(_0x56be87['query'][_0xb840('0x3e')]){_0xae7e98[_0xb840('0x3b')]=_[_0xb840('0x3f')](_0xae7e98[_0xb840('0x3b')],{'$or':_[_0xb840('0x2e')](_0x1092a6,function(_0xeb9c84){if(_0xeb9c84[_0xb840('0x32')]!==_0xb840('0x40')){var _0x196f93={};_0x196f93[_0xeb9c84[_0xb840('0x2b')]]={'$like':'%'+_0x56be87[_0xb840('0x35')][_0xb840('0x3e')]+'%'};return _0x196f93;}})});}_0xae7e98=_[_0xb840('0x3f')]({},_0xae7e98,_0x56be87[_0xb840('0x41')]);var _0x192fcc={'where':_0xae7e98['where']};return db[_0xb840('0x2f')][_0xb840('0x23')](_0x192fcc)[_0xb840('0x28')](function(_0x5bc23e){_0x35810e[_0xb840('0x23')]=_0x5bc23e;if(_0x56be87[_0xb840('0x35')][_0xb840('0x42')]){_0xae7e98[_0xb840('0x43')]=[{'all':!![]}];}return db[_0xb840('0x2f')][_0xb840('0x44')](_0xae7e98);})['then'](function(_0x2ad550){_0x35810e[_0xb840('0x45')]=_0x2ad550;return _0x35810e;})['then'](respondWithFilteredResult(_0x46c5cb,_0xae7e98))[_0xb840('0x46')](handleError(_0x46c5cb,null));};exports[_0xb840('0x47')]=function(_0xa1d119,_0x44f235){var _0xaaec9b={'raw':!![],'where':{'id':_0xa1d119[_0xb840('0x48')]['id']}},_0x2b8716={};_0x2b8716[_0xb840('0x33')]=_[_0xb840('0x49')](db[_0xb840('0x2f')][_0xb840('0x30')]);_0x2b8716[_0xb840('0x35')]=_[_0xb840('0x49')](_0xa1d119['query']);_0x2b8716[_0xb840('0x3c')]=_[_0xb840('0x34')](_0x2b8716[_0xb840('0x33')],_0x2b8716[_0xb840('0x35')]);_0xaaec9b[_0xb840('0x36')]=_[_0xb840('0x34')](_0x2b8716[_0xb840('0x33')],qs[_0xb840('0x37')](_0xa1d119[_0xb840('0x35')][_0xb840('0x37')]));_0xaaec9b[_0xb840('0x36')]=_0xaaec9b[_0xb840('0x36')]['length']?_0xaaec9b[_0xb840('0x36')]:_0x2b8716[_0xb840('0x33')];if(_0xa1d119['query']['includeAll']){_0xaaec9b[_0xb840('0x43')]=[{'all':!![]}];}_0xaaec9b=_[_0xb840('0x3f')]({},_0xaaec9b,_0xa1d119[_0xb840('0x41')]);return db[_0xb840('0x2f')]['find'](_0xaaec9b)['then'](handleEntityNotFound(_0x44f235,null))[_0xb840('0x28')](respondWithResult(_0x44f235,null))['catch'](handleError(_0x44f235,null));};exports[_0xb840('0x4a')]=function(_0x12fb1f,_0x3b0f1c){return db[_0xb840('0x2f')][_0xb840('0x4a')](_0x12fb1f[_0xb840('0x4b')],{})[_0xb840('0x28')](respondWithResult(_0x3b0f1c,0xc9))[_0xb840('0x46')](handleError(_0x3b0f1c,null));};exports['update']=function(_0x57095e,_0x166263){if(_0x57095e[_0xb840('0x4b')]['id']){delete _0x57095e[_0xb840('0x4b')]['id'];}return db[_0xb840('0x2f')][_0xb840('0x4c')]({'where':{'id':_0x57095e[_0xb840('0x48')]['id']}})['then'](handleEntityNotFound(_0x166263,null))['then'](saveUpdates(_0x57095e[_0xb840('0x4b')],null))[_0xb840('0x28')](respondWithResult(_0x166263,null))[_0xb840('0x46')](handleError(_0x166263,null));};exports[_0xb840('0x4d')]=function(_0x2296fc,_0xddf546){return db[_0xb840('0x2f')]['find']({'where':{'id':_0x2296fc[_0xb840('0x48')]['id']}})[_0xb840('0x28')](handleEntityNotFound(_0xddf546,null))[_0xb840('0x28')](removeEntity(_0xddf546,null))[_0xb840('0x46')](handleError(_0xddf546,null));};exports[_0xb840('0x4e')]=function(_0x25e6fa,_0x530653){return db[_0xb840('0x2f')][_0xb840('0x4e')]()[_0xb840('0x28')](respondWithResult(_0x530653,null))[_0xb840('0x46')](handleError(_0x530653,null));};function wrapUser(_0x4abacd){return function(_0x28d68f){var _0x4b8e2b=_0x4abacd[_0xb840('0x4f')]({'plain':!![]});_0x4b8e2b[_0xb840('0x50')]=[];if(_0x28d68f){_0x4b8e2b[_0xb840('0x51')]=_0x28d68f[_0xb840('0x52')];_0x4b8e2b[_0xb840('0x53')]=_0x28d68f;}else{_0x4b8e2b['lastMessageAt']=moment(0x0)[_0xb840('0x54')](_0xb840('0x55'));_0x4b8e2b[_0xb840('0x53')]={};}return _0x4b8e2b;};}exports[_0xb840('0x56')]=function(_0x5006ee,_0x3c470a,_0x14a029){var _0x2b9bd6=[];return db[_0xb840('0x57')][_0xb840('0x44')]({'where':{'role':[_0xb840('0x58'),_0xb840('0x59'),_0xb840('0x5a')]},'attributes':['id',_0xb840('0x5b'),_0xb840('0x2b'),_0xb840('0x5c'),_0xb840('0x5d'),_0xb840('0x5e'),_0xb840('0x5f'),_0xb840('0x60'),_0xb840('0x61'),'showWebBar'],'order':qs['sort'](_0xb840('0x62')),'include':[{'model':db['VoiceQueue'],'as':_0xb840('0x63'),'attributes':['id','name',_0xb840('0x32')],'through':{'attributes':[]}}]})[_0xb840('0x28')](function(_0x1abdf0){if(_0x1abdf0){var _0x2336a6=_0x5006ee[_0xb840('0x5a')][_0xb840('0x4f')]({'plain':!![]});if(!_0x2336a6)throw new Error(_0xb840('0x64'));if(_0x2336a6[_0xb840('0x5c')]==='user'){return db[_0xb840('0x65')]['find']({'where':{'name':_0xb840('0x66'),'userProfileId':_0x2336a6['userProfileId']},'raw':!![]})[_0xb840('0x28')](function(_0x81163a){if(_0x81163a){if(_0x81163a[_0xb840('0x67')]===0x0){return db[_0xb840('0x68')][_0xb840('0x44')]({'where':{'sectionId':_0x81163a['id']},'raw':!![]})[_0xb840('0x28')](function(_0x2a0826){var _0x3c832a=[];if(_[_0xb840('0x69')](_0x2a0826)){_0x3c832a=_['filter'](_0x1abdf0,function(_0x312c14){if(_0x312c14['role']!==_0xb840('0x58')){return _0x312c14;}});return _0x3c832a;}else{for(var _0x54db6c=0x0;_0x54db6c<_0x1abdf0[_0xb840('0x6a')];_0x54db6c++){var _0x5965ca=_0x1abdf0[_0x54db6c];if(_0x5965ca[_0xb840('0x5c')]===_0xb840('0x58')){var _0x371cbc=_[_0xb840('0x4c')](_0x2a0826,function(_0x2decf5){return _0x2decf5[_0xb840('0x6b')]===_0x5965ca['id'];});if(_0x371cbc)_0x3c832a[_0xb840('0x6c')](_0x5965ca);}else{_0x3c832a[_0xb840('0x6c')](_0x5965ca);}}return _0x3c832a;}});}else{return _0x1abdf0;}}else{var _0x374bcc=_['filter'](_0x1abdf0,function(_0x5a9475){if(_0x5a9475[_0xb840('0x5c')]!==_0xb840('0x58')){return _0x5a9475;}});return _0x374bcc;}});}else{return _0x1abdf0;}}})[_0xb840('0x28')](function(_0x40d349){var _0x2d466b=[];if(_0x40d349){_0x2b9bd6=_0x40d349;for(var _0x49c9c3=0x0;_0x49c9c3<_0x40d349[_0xb840('0x6a')];_0x49c9c3+=0x1){_0x2b9bd6[_0x49c9c3][_0xb840('0x50')]=[];_0x2d466b[_0xb840('0x6c')](db['ChatInternalMessage'][_0xb840('0x4c')]({'where':{'FromId':[_0x5006ee[_0xb840('0x5a')]['id'],_0x40d349[_0x49c9c3]['id']],'ToId':[_0x5006ee[_0xb840('0x5a')]['id'],_0x40d349[_0x49c9c3]['id']],'ChatGroupId':null},'attributes':['id',_0xb840('0x52'),_0xb840('0x6d'),_0xb840('0x6e'),'read',_0xb840('0x4b')],'order':qs[_0xb840('0x3a')](_0xb840('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb840('0x28')](wrapUser(_0x40d349[_0x49c9c3])));}return BPromise[_0xb840('0x70')](_0x2d466b);}return[];})[_0xb840('0x28')](function(_0x1dbcb0){return{'rows':_0x1dbcb0,'count':_0x1dbcb0[_0xb840('0x6a')]};})[_0xb840('0x28')](respondWithResult(_0x3c470a,null))[_0xb840('0x46')](handleError(_0x3c470a,null));};
\ No newline at end of file
+var _0xf2a3=['../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','options','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueues','user','UserProfileSection','Agents','UserProfileResource','isEmpty','resourceId','push','messages','FromId','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2472b7,_0x234e44){var _0x478dbc=function(_0x2b1d4f){while(--_0x2b1d4f){_0x2472b7['push'](_0x2472b7['shift']());}};_0x478dbc(++_0x234e44);}(_0xf2a3,0x13c));var _0x3f2a=function(_0x33c65a,_0x2fa474){_0x33c65a=_0x33c65a-0x0;var _0x55b76e=_0xf2a3[_0x33c65a];return _0x55b76e;};'use strict';var emlformat=require(_0x3f2a('0x0'));var rimraf=require(_0x3f2a('0x1'));var zipdir=require(_0x3f2a('0x2'));var jsonpatch=require(_0x3f2a('0x3'));var rp=require('request-promise');var moment=require(_0x3f2a('0x4'));var BPromise=require(_0x3f2a('0x5'));var Mustache=require(_0x3f2a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3f2a('0x7'));var csv=require(_0x3f2a('0x8'));var ejs=require(_0x3f2a('0x9'));var fs=require('fs');var fs_extra=require(_0x3f2a('0xa'));var _=require(_0x3f2a('0xb'));var squel=require(_0x3f2a('0xc'));var crypto=require(_0x3f2a('0xd'));var jsforce=require(_0x3f2a('0xe'));var deskjs=require(_0x3f2a('0xf'));var toCsv=require(_0x3f2a('0x8'));var querystring=require(_0x3f2a('0x10'));var Papa=require(_0x3f2a('0x11'));var Redis=require(_0x3f2a('0x12'));var authService=require(_0x3f2a('0x13'));var qs=require(_0x3f2a('0x14'));var as=require(_0x3f2a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3f2a('0x16'));var utils=require('../../config/utils');var config=require(_0x3f2a('0x17'));var licenseUtil=require(_0x3f2a('0x18'));var db=require('../../mysqldb')['db'];config[_0x3f2a('0x19')]=_['defaults'](config['redis'],{'host':_0x3f2a('0x1a'),'port':0x18eb});var socket=require(_0x3f2a('0x1b'))(new Redis(config['redis']));require(_0x3f2a('0x1c'))[_0x3f2a('0x1d')](socket);function respondWithStatusCode(_0xa7ea76,_0xea14d6){_0xea14d6=_0xea14d6||0xcc;return function(_0x24e13b){if(_0x24e13b){return _0xa7ea76[_0x3f2a('0x1e')](_0xea14d6);}return _0xa7ea76[_0x3f2a('0x1f')](_0xea14d6)['end']();};}function respondWithResult(_0x5cd745,_0x241c94){_0x241c94=_0x241c94||0xc8;return function(_0x3fe36f){if(_0x3fe36f){return _0x5cd745[_0x3f2a('0x1f')](_0x241c94)[_0x3f2a('0x20')](_0x3fe36f);}};}function respondWithFilteredResult(_0x1f0fd6,_0x59a20){return function(_0x227ac2){if(_0x227ac2){var _0x1728fd=typeof _0x59a20[_0x3f2a('0x21')]===_0x3f2a('0x22')&&typeof _0x59a20[_0x3f2a('0x23')]===_0x3f2a('0x22');var _0x192b9e=_0x227ac2[_0x3f2a('0x24')];var _0xa50745=_0x1728fd?0x0:_0x59a20[_0x3f2a('0x21')];var _0x5eb7b7=_0x1728fd?_0x227ac2[_0x3f2a('0x24')]:_0x59a20[_0x3f2a('0x21')]+_0x59a20[_0x3f2a('0x23')];var _0x3a6b6c;if(_0x5eb7b7>=_0x192b9e){_0x5eb7b7=_0x192b9e;_0x3a6b6c=0xc8;}else{_0x3a6b6c=0xce;}_0x1f0fd6[_0x3f2a('0x1f')](_0x3a6b6c);return _0x1f0fd6[_0x3f2a('0x25')](_0x3f2a('0x26'),_0xa50745+'-'+_0x5eb7b7+'/'+_0x192b9e)[_0x3f2a('0x20')](_0x227ac2);}return null;};}function patchUpdates(_0x2ffabd){return function(_0x120d5d){try{jsonpatch[_0x3f2a('0x27')](_0x120d5d,_0x2ffabd,!![]);}catch(_0x218e80){return BPromise[_0x3f2a('0x28')](_0x218e80);}return _0x120d5d[_0x3f2a('0x29')]();};}function saveUpdates(_0x55fa25,_0x44ec1f){return function(_0x5d8a12){if(_0x5d8a12){return _0x5d8a12[_0x3f2a('0x2a')](_0x55fa25)['then'](function(_0x37608b){return _0x37608b;});}return null;};}function removeEntity(_0x569799,_0x7135b4){return function(_0x3b564d){if(_0x3b564d){return _0x3b564d[_0x3f2a('0x2b')]()[_0x3f2a('0x2c')](function(){_0x569799[_0x3f2a('0x1f')](0xcc)[_0x3f2a('0x2d')]();});}};}function handleEntityNotFound(_0x569444,_0x599d22){return function(_0x490ff9){if(!_0x490ff9){_0x569444['sendStatus'](0x194);}return _0x490ff9;};}function handleError(_0x2912ab,_0x5e1af1){_0x5e1af1=_0x5e1af1||0x1f4;return function(_0x46e06d){logger[_0x3f2a('0x2e')](_0x46e06d[_0x3f2a('0x2f')]);if(_0x46e06d[_0x3f2a('0x30')]){delete _0x46e06d[_0x3f2a('0x30')];}_0x2912ab[_0x3f2a('0x1f')](_0x5e1af1)[_0x3f2a('0x31')](_0x46e06d);};}exports[_0x3f2a('0x32')]=function(_0x274cde,_0x508a6b){var _0x318451={},_0x3570d4={},_0x35595f={'count':0x0,'rows':[]};var _0x946f3d=_[_0x3f2a('0x33')](db[_0x3f2a('0x34')][_0x3f2a('0x35')],function(_0x22980d){return{'name':_0x22980d[_0x3f2a('0x36')],'type':_0x22980d['type'][_0x3f2a('0x37')]};});_0x3570d4[_0x3f2a('0x38')]=_[_0x3f2a('0x33')](_0x946f3d,_0x3f2a('0x30'));_0x3570d4['query']=_[_0x3f2a('0x39')](_0x274cde['query']);_0x3570d4[_0x3f2a('0x3a')]=_[_0x3f2a('0x3b')](_0x3570d4['model'],_0x3570d4['query']);_0x318451[_0x3f2a('0x3c')]=_[_0x3f2a('0x3b')](_0x3570d4[_0x3f2a('0x38')],qs[_0x3f2a('0x3d')](_0x274cde[_0x3f2a('0x3e')][_0x3f2a('0x3d')]));_0x318451[_0x3f2a('0x3c')]=_0x318451[_0x3f2a('0x3c')][_0x3f2a('0x3f')]?_0x318451[_0x3f2a('0x3c')]:_0x3570d4[_0x3f2a('0x38')];if(!_0x274cde[_0x3f2a('0x3e')][_0x3f2a('0x40')](_0x3f2a('0x41'))){_0x318451[_0x3f2a('0x23')]=qs['limit'](_0x274cde[_0x3f2a('0x3e')][_0x3f2a('0x23')]);_0x318451['offset']=qs[_0x3f2a('0x21')](_0x274cde[_0x3f2a('0x3e')][_0x3f2a('0x21')]);}_0x318451['order']=qs[_0x3f2a('0x42')](_0x274cde[_0x3f2a('0x3e')][_0x3f2a('0x42')]);_0x318451[_0x3f2a('0x43')]=qs['filters'](_['pick'](_0x274cde[_0x3f2a('0x3e')],_0x3570d4['filters']),_0x946f3d);if(_0x274cde[_0x3f2a('0x3e')][_0x3f2a('0x44')]){_0x318451[_0x3f2a('0x43')]=_[_0x3f2a('0x45')](_0x318451[_0x3f2a('0x43')],{'$or':_[_0x3f2a('0x33')](_0x946f3d,function(_0x22e30e){if(_0x22e30e[_0x3f2a('0x46')]!==_0x3f2a('0x47')){var _0x5916f7={};_0x5916f7[_0x22e30e[_0x3f2a('0x30')]]={'$like':'%'+_0x274cde['query'][_0x3f2a('0x44')]+'%'};return _0x5916f7;}})});}_0x318451=_[_0x3f2a('0x45')]({},_0x318451,_0x274cde['options']);var _0x4fcaee={'where':_0x318451[_0x3f2a('0x43')]};return db['ChatInternalMessage'][_0x3f2a('0x24')](_0x4fcaee)[_0x3f2a('0x2c')](function(_0x4a3b93){_0x35595f[_0x3f2a('0x24')]=_0x4a3b93;if(_0x274cde[_0x3f2a('0x3e')][_0x3f2a('0x48')]){_0x318451['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x3f2a('0x49')](_0x318451);})['then'](function(_0x1cc79b){_0x35595f[_0x3f2a('0x4a')]=_0x1cc79b;return _0x35595f;})[_0x3f2a('0x2c')](respondWithFilteredResult(_0x508a6b,_0x318451))[_0x3f2a('0x4b')](handleError(_0x508a6b,null));};exports[_0x3f2a('0x4c')]=function(_0x10b566,_0x373b15){var _0x5a1820={'raw':!![],'where':{'id':_0x10b566[_0x3f2a('0x4d')]['id']}},_0x1c6387={};_0x1c6387[_0x3f2a('0x38')]=_[_0x3f2a('0x39')](db[_0x3f2a('0x34')][_0x3f2a('0x35')]);_0x1c6387['query']=_[_0x3f2a('0x39')](_0x10b566[_0x3f2a('0x3e')]);_0x1c6387[_0x3f2a('0x3a')]=_['intersection'](_0x1c6387[_0x3f2a('0x38')],_0x1c6387[_0x3f2a('0x3e')]);_0x5a1820['attributes']=_['intersection'](_0x1c6387[_0x3f2a('0x38')],qs[_0x3f2a('0x3d')](_0x10b566[_0x3f2a('0x3e')][_0x3f2a('0x3d')]));_0x5a1820[_0x3f2a('0x3c')]=_0x5a1820[_0x3f2a('0x3c')]['length']?_0x5a1820[_0x3f2a('0x3c')]:_0x1c6387[_0x3f2a('0x38')];if(_0x10b566[_0x3f2a('0x3e')]['includeAll']){_0x5a1820['include']=[{'all':!![]}];}_0x5a1820=_['merge']({},_0x5a1820,_0x10b566[_0x3f2a('0x4e')]);return db[_0x3f2a('0x34')][_0x3f2a('0x4f')](_0x5a1820)[_0x3f2a('0x2c')](handleEntityNotFound(_0x373b15,null))[_0x3f2a('0x2c')](respondWithResult(_0x373b15,null))['catch'](handleError(_0x373b15,null));};exports[_0x3f2a('0x50')]=function(_0x1b0732,_0x59e670){return db[_0x3f2a('0x34')][_0x3f2a('0x50')](_0x1b0732[_0x3f2a('0x51')],{})[_0x3f2a('0x2c')](respondWithResult(_0x59e670,0xc9))[_0x3f2a('0x4b')](handleError(_0x59e670,null));};exports[_0x3f2a('0x2a')]=function(_0x383477,_0x1caeb1){if(_0x383477['body']['id']){delete _0x383477[_0x3f2a('0x51')]['id'];}return db[_0x3f2a('0x34')]['find']({'where':{'id':_0x383477[_0x3f2a('0x4d')]['id']}})[_0x3f2a('0x2c')](handleEntityNotFound(_0x1caeb1,null))[_0x3f2a('0x2c')](saveUpdates(_0x383477[_0x3f2a('0x51')],null))[_0x3f2a('0x2c')](respondWithResult(_0x1caeb1,null))[_0x3f2a('0x4b')](handleError(_0x1caeb1,null));};exports[_0x3f2a('0x2b')]=function(_0x307c29,_0x585f43){return db[_0x3f2a('0x34')][_0x3f2a('0x4f')]({'where':{'id':_0x307c29['params']['id']}})[_0x3f2a('0x2c')](handleEntityNotFound(_0x585f43,null))[_0x3f2a('0x2c')](removeEntity(_0x585f43,null))[_0x3f2a('0x4b')](handleError(_0x585f43,null));};exports[_0x3f2a('0x52')]=function(_0x44c6d8,_0x3805cc){return db['ChatInternalMessage'][_0x3f2a('0x52')]()[_0x3f2a('0x2c')](respondWithResult(_0x3805cc,null))[_0x3f2a('0x4b')](handleError(_0x3805cc,null));};function wrapUser(_0x40ea54){return function(_0x1d0def){var _0x4f1109=_0x40ea54[_0x3f2a('0x53')]({'plain':!![]});_0x4f1109['messages']=[];if(_0x1d0def){_0x4f1109[_0x3f2a('0x54')]=_0x1d0def[_0x3f2a('0x55')];_0x4f1109[_0x3f2a('0x56')]=_0x1d0def;}else{_0x4f1109[_0x3f2a('0x54')]=moment(0x0)['format'](_0x3f2a('0x57'));_0x4f1109[_0x3f2a('0x56')]={};}return _0x4f1109;};}exports[_0x3f2a('0x58')]=function(_0x245327,_0xe710dd,_0x10b761){var _0x55fcb7=[];return db[_0x3f2a('0x59')][_0x3f2a('0x49')]({'where':{'role':[_0x3f2a('0x5a'),_0x3f2a('0x5b'),'user']},'attributes':['id',_0x3f2a('0x5c'),_0x3f2a('0x30'),_0x3f2a('0x5d'),'userpic',_0x3f2a('0x5e'),_0x3f2a('0x5f'),_0x3f2a('0x60'),_0x3f2a('0x61'),_0x3f2a('0x62')],'order':qs[_0x3f2a('0x42')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x3f2a('0x63'),'attributes':['id',_0x3f2a('0x30'),_0x3f2a('0x46')],'through':{'attributes':[]}}]})[_0x3f2a('0x2c')](function(_0x27bc95){if(_0x27bc95){var _0x358917=_0x245327['user'][_0x3f2a('0x53')]({'plain':!![]});if(!_0x358917)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x358917['role']===_0x3f2a('0x64')){return db[_0x3f2a('0x65')]['find']({'where':{'name':_0x3f2a('0x66'),'userProfileId':_0x358917['userProfileId']},'raw':!![]})[_0x3f2a('0x2c')](function(_0x43eb8d){if(_0x43eb8d){if(_0x43eb8d['autoAssociation']===0x0){return db[_0x3f2a('0x67')][_0x3f2a('0x49')]({'where':{'sectionId':_0x43eb8d['id']},'raw':!![]})['then'](function(_0x4ee55e){var _0x169f45=[];if(_[_0x3f2a('0x68')](_0x4ee55e)){_0x169f45=_[_0x3f2a('0x44')](_0x27bc95,function(_0x43eb3f){if(_0x43eb3f['role']!==_0x3f2a('0x5a')){return _0x43eb3f;}});return _0x169f45;}else{for(var _0x4a66eb=0x0;_0x4a66eb<_0x27bc95[_0x3f2a('0x3f')];_0x4a66eb++){var _0x23ac9e=_0x27bc95[_0x4a66eb];if(_0x23ac9e[_0x3f2a('0x5d')]==='agent'){var _0x2fb32e=_[_0x3f2a('0x4f')](_0x4ee55e,function(_0x6d318e){return _0x6d318e[_0x3f2a('0x69')]===_0x23ac9e['id'];});if(_0x2fb32e)_0x169f45[_0x3f2a('0x6a')](_0x23ac9e);}else{_0x169f45[_0x3f2a('0x6a')](_0x23ac9e);}}return _0x169f45;}});}else{return _0x27bc95;}}else{var _0x182236=_['filter'](_0x27bc95,function(_0x3d3a75){if(_0x3d3a75[_0x3f2a('0x5d')]!==_0x3f2a('0x5a')){return _0x3d3a75;}});return _0x182236;}});}else{return _0x27bc95;}}})['then'](function(_0x27a317){var _0xb9662=[];if(_0x27a317){_0x55fcb7=_0x27a317;for(var _0x3a3eb9=0x0;_0x3a3eb9<_0x27a317[_0x3f2a('0x3f')];_0x3a3eb9+=0x1){_0x55fcb7[_0x3a3eb9][_0x3f2a('0x6b')]=[];_0xb9662['push'](db[_0x3f2a('0x34')][_0x3f2a('0x4f')]({'where':{'FromId':[_0x245327[_0x3f2a('0x64')]['id'],_0x27a317[_0x3a3eb9]['id']],'ToId':[_0x245327[_0x3f2a('0x64')]['id'],_0x27a317[_0x3a3eb9]['id']],'ChatGroupId':null},'attributes':['id',_0x3f2a('0x55'),_0x3f2a('0x6c'),_0x3f2a('0x6d'),_0x3f2a('0x6e'),_0x3f2a('0x51')],'order':qs[_0x3f2a('0x42')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x27a317[_0x3a3eb9])));}return BPromise[_0x3f2a('0x6f')](_0xb9662);}return[];})[_0x3f2a('0x2c')](function(_0x1a9585){return{'rows':_0x1a9585,'count':_0x1a9585[_0x3f2a('0x3f')]};})[_0x3f2a('0x2c')](respondWithResult(_0xe710dd,null))[_0x3f2a('0x4b')](handleError(_0xe710dd,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 76089dc..0968236 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 _0xd497=['ChatInternalMessage','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xd497,0x19b));var _0x7d49=function(_0x194536,_0x55dd43){_0x194536=_0x194536-0x0;var _0x61b223=_0xd497[_0x194536];return _0x61b223;};'use strict';var EventEmitter=require(_0x7d49('0x0'));var ChatInternalMessage=require(_0x7d49('0x1'))['db'][_0x7d49('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7d49('0x3'),'afterDestroy':_0x7d49('0x4')};function emitEvent(_0x544a90){return function(_0xaa9d1c,_0x1ed2fa,_0x3b7ed3){ChatInternalMessageEvents[_0x7d49('0x5')](_0x544a90+':'+_0xaa9d1c['id'],_0xaa9d1c);ChatInternalMessageEvents[_0x7d49('0x5')](_0x544a90,_0xaa9d1c);_0x3b7ed3(null);};}for(var e in events){if(events[_0x7d49('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xc93e=['remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x4c3780,_0x27ce2b){var _0x3050b9=function(_0xf84436){while(--_0xf84436){_0x4c3780['push'](_0x4c3780['shift']());}};_0x3050b9(++_0x27ce2b);}(_0xc93e,0x143));var _0xec93=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0xc93e[_0x3b19ea];return _0x40ece9;};'use strict';var EventEmitter=require(_0xec93('0x0'));var ChatInternalMessage=require(_0xec93('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xec93('0x2')](0x0);var events={'afterCreate':_0xec93('0x3'),'afterUpdate':_0xec93('0x4'),'afterDestroy':_0xec93('0x5')};function emitEvent(_0x2ccbe0){return function(_0x52d4c1,_0x140ada,_0x5ed1dd){ChatInternalMessageEvents[_0xec93('0x6')](_0x2ccbe0+':'+_0x52d4c1['id'],_0x52d4c1);ChatInternalMessageEvents[_0xec93('0x6')](_0x2ccbe0,_0x52d4c1);_0x5ed1dd(null);};}for(var e in events){if(events[_0xec93('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index e691945..ee58451 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 _0xd07e=['request-promise','path','rimraf','./chatInternalMessage.attributes','define','utf8mb4','util','../../config/logger','moment','bluebird'];(function(_0x5b127a,_0x34d1af){var _0x6fcc76=function(_0x2f7e4e){while(--_0x2f7e4e){_0x5b127a['push'](_0x5b127a['shift']());}};_0x6fcc76(++_0x34d1af);}(_0xd07e,0x1f0));var _0xed07=function(_0x567f69,_0x128fbe){_0x567f69=_0x567f69-0x0;var _0x32f2f8=_0xd07e[_0x567f69];return _0x32f2f8;};'use strict';var _=require('lodash');var util=require(_0xed07('0x0'));var logger=require(_0xed07('0x1'))('api');var moment=require(_0xed07('0x2'));var BPromise=require(_0xed07('0x3'));var rp=require(_0xed07('0x4'));var fs=require('fs');var path=require(_0xed07('0x5'));var rimraf=require(_0xed07('0x6'));var config=require('../../config/environment');var attributes=require(_0xed07('0x7'));module['exports']=function(_0x2577b6,_0x1601df){return _0x2577b6[_0xed07('0x8')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xed07('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xcf21=['../../config/environment','exports','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf21,0x131));var _0x1cf2=function(_0x782c74,_0x2d94ca){_0x782c74=_0x782c74-0x0;var _0x229f8e=_0xcf21[_0x782c74];return _0x229f8e;};'use strict';var _=require(_0x1cf2('0x0'));var util=require(_0x1cf2('0x1'));var logger=require(_0x1cf2('0x2'))(_0x1cf2('0x3'));var moment=require(_0x1cf2('0x4'));var BPromise=require(_0x1cf2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1cf2('0x6'));var config=require(_0x1cf2('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0x1cf2('0x8')]=function(_0x4a0493,_0x197d22){return _0x4a0493['define']('ChatInternalMessage',attributes,{'tableName':_0x1cf2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1cf2('0xa'),'collate':_0x1cf2('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 56272ee..13ab46a 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 _0x1b21=['../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb'];(function(_0x128561,_0x3f5e94){var _0x58efaa=function(_0x135b10){while(--_0x135b10){_0x128561['push'](_0x128561['shift']());}};_0x58efaa(++_0x3f5e94);}(_0x1b21,0x1b6));var _0x11b2=function(_0x3a7835,_0x16de15){_0x3a7835=_0x3a7835-0x0;var _0x1b98d3=_0x1b21[_0x3a7835];return _0x1b98d3;};'use strict';var _=require(_0x11b2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x11b2('0x1'));var fs=require('fs');var Redis=require(_0x11b2('0x2'));var db=require(_0x11b2('0x3'))['db'];var utils=require(_0x11b2('0x4'));var logger=require(_0x11b2('0x5'))('rpc');var config=require(_0x11b2('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x11b2('0x7')]({'port':0x232a});config[_0x11b2('0x8')]=_[_0x11b2('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x11b2('0xa'))(new Redis(config[_0x11b2('0x8')]));require(_0x11b2('0xb'))[_0x11b2('0xc')](socket);function respondWithRpcPromise(_0x58a120,_0xeb1900,_0x2702a7){return new BPromise(function(_0x1073df,_0x8ef9a2){return client[_0x11b2('0xd')](_0x58a120,_0x2702a7)[_0x11b2('0xe')](function(_0x4738cf){logger[_0x11b2('0xf')](_0x11b2('0x10'),_0xeb1900,'request\x20sent');logger[_0x11b2('0x11')](_0x11b2('0x12'),_0xeb1900,_0x11b2('0x13'),JSON[_0x11b2('0x14')](_0x4738cf));if(_0x4738cf[_0x11b2('0x15')]){if(_0x4738cf[_0x11b2('0x15')][_0x11b2('0x16')]===0x1f4){logger[_0x11b2('0x15')](_0x11b2('0x10'),_0xeb1900,_0x4738cf[_0x11b2('0x15')][_0x11b2('0x17')]);return _0x8ef9a2(_0x4738cf[_0x11b2('0x15')][_0x11b2('0x17')]);}logger['error'](_0x11b2('0x10'),_0xeb1900,_0x4738cf['error']['message']);return _0x1073df(_0x4738cf[_0x11b2('0x15')][_0x11b2('0x17')]);}else{logger[_0x11b2('0xf')](_0x11b2('0x10'),_0xeb1900,_0x11b2('0x13'));_0x1073df(_0x4738cf[_0x11b2('0x18')]['message']);}})[_0x11b2('0x19')](function(_0x3f17b1){logger[_0x11b2('0x15')](_0x11b2('0x10'),_0xeb1900,_0x3f17b1);_0x8ef9a2(_0x3f17b1);});});}
\ No newline at end of file
+var _0x5ad0=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2f4d1b,_0x1f65be){var _0x5da6c2=function(_0x5cd4a2){while(--_0x5cd4a2){_0x2f4d1b['push'](_0x2f4d1b['shift']());}};_0x5da6c2(++_0x1f65be);}(_0x5ad0,0x137));var _0x05ad=function(_0x590766,_0x26a057){_0x590766=_0x590766-0x0;var _0x4e2f10=_0x5ad0[_0x590766];return _0x4e2f10;};'use strict';var _=require(_0x05ad('0x0'));var util=require(_0x05ad('0x1'));var moment=require(_0x05ad('0x2'));var BPromise=require(_0x05ad('0x3'));var rs=require(_0x05ad('0x4'));var fs=require('fs');var Redis=require(_0x05ad('0x5'));var db=require(_0x05ad('0x6'))['db'];var utils=require(_0x05ad('0x7'));var logger=require(_0x05ad('0x8'))(_0x05ad('0x9'));var config=require(_0x05ad('0xa'));var jayson=require(_0x05ad('0xb'));var client=jayson[_0x05ad('0xc')][_0x05ad('0xd')]({'port':0x232a});config[_0x05ad('0xe')]=_['defaults'](config[_0x05ad('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x05ad('0xe')]));require(_0x05ad('0xf'))[_0x05ad('0x10')](socket);function respondWithRpcPromise(_0x2e28dd,_0xb38819,_0x50ed0b){return new BPromise(function(_0x33a953,_0x576763){return client['request'](_0x2e28dd,_0x50ed0b)[_0x05ad('0x11')](function(_0x21dfd6){logger[_0x05ad('0x12')](_0x05ad('0x13'),_0xb38819,_0x05ad('0x14'));logger[_0x05ad('0x15')](_0x05ad('0x16'),_0xb38819,_0x05ad('0x14'),JSON[_0x05ad('0x17')](_0x21dfd6));if(_0x21dfd6[_0x05ad('0x18')]){if(_0x21dfd6[_0x05ad('0x18')][_0x05ad('0x19')]===0x1f4){logger[_0x05ad('0x18')](_0x05ad('0x13'),_0xb38819,_0x21dfd6['error'][_0x05ad('0x1a')]);return _0x576763(_0x21dfd6[_0x05ad('0x18')]['message']);}logger[_0x05ad('0x18')](_0x05ad('0x13'),_0xb38819,_0x21dfd6['error'][_0x05ad('0x1a')]);return _0x33a953(_0x21dfd6[_0x05ad('0x18')]['message']);}else{logger[_0x05ad('0x12')](_0x05ad('0x13'),_0xb38819,_0x05ad('0x14'));_0x33a953(_0x21dfd6[_0x05ad('0x1b')]['message']);}})['catch'](function(_0x11c4ad){logger['error'](_0x05ad('0x13'),_0xb38819,_0x11c4ad);_0x576763(_0x11c4ad);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 4cbba3a..3821d5d 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 _0x4fcb=['update','emit','removeListener','register','length','chatInternalMessage:','save','remove'];(function(_0x2c3bb9,_0x4d333b){var _0x1e944b=function(_0x181e7f){while(--_0x181e7f){_0x2c3bb9['push'](_0x2c3bb9['shift']());}};_0x1e944b(++_0x4d333b);}(_0x4fcb,0xce));var _0xb4fc=function(_0x2c18af,_0x3c9861){_0x2c18af=_0x2c18af-0x0;var _0x5a64ca=_0x4fcb[_0x2c18af];return _0x5a64ca;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xb4fc('0x0'),_0xb4fc('0x1'),_0xb4fc('0x2')];function createListener(_0x3b7ce5,_0x36489d){return function(_0x1466f3){_0x36489d[_0xb4fc('0x3')](_0x3b7ce5,_0x1466f3);};}function removeListener(_0x27e090,_0x5b9846){return function(){ChatInternalMessageEvents[_0xb4fc('0x4')](_0x27e090,_0x5b9846);};}exports[_0xb4fc('0x5')]=function(_0x1cc2c1){for(var _0x22651d=0x0,_0x414898=events[_0xb4fc('0x6')];_0x22651d<_0x414898;_0x22651d++){var _0x233ae4=events[_0x22651d];var _0x48f336=createListener(_0xb4fc('0x7')+_0x233ae4,_0x1cc2c1);ChatInternalMessageEvents['on'](_0x233ae4,_0x48f336);}};
\ No newline at end of file
+var _0xd9f2=['register','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x2e6444,_0xdf751e){var _0x297793=function(_0x2bf64d){while(--_0x2bf64d){_0x2e6444['push'](_0x2e6444['shift']());}};_0x297793(++_0xdf751e);}(_0xd9f2,0xd4));var _0x2d9f=function(_0x226373,_0x30bc8a){_0x226373=_0x226373-0x0;var _0x10dea7=_0xd9f2[_0x226373];return _0x10dea7;};'use strict';var ChatInternalMessageEvents=require(_0x2d9f('0x0'));var events=[_0x2d9f('0x1'),_0x2d9f('0x2'),_0x2d9f('0x3')];function createListener(_0x240c03,_0x34029f){return function(_0x42ad46){_0x34029f['emit'](_0x240c03,_0x42ad46);};}function removeListener(_0x3d9380,_0x5b1445){return function(){ChatInternalMessageEvents['removeListener'](_0x3d9380,_0x5b1445);};}exports[_0x2d9f('0x4')]=function(_0x1985d6){for(var _0x4b61d8=0x0,_0x4709e7=events['length'];_0x4b61d8<_0x4709e7;_0x4b61d8++){var _0x1a374d=events[_0x4b61d8];var _0x1c688b=createListener(_0x2d9f('0x5')+_0x1a374d,_0x1985d6);ChatInternalMessageEvents['on'](_0x1a374d,_0x1c688b);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index dc67063..1a894fe 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 _0x6ddf=['/describe','isAuthenticated','/users','getUsers','show','post','create','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index'];(function(_0x2c34ff,_0x1e8bee){var _0x476508=function(_0x3e50db){while(--_0x3e50db){_0x2c34ff['push'](_0x2c34ff['shift']());}};_0x476508(++_0x1e8bee);}(_0x6ddf,0xbc));var _0xf6dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ddf[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xf6dd('0x0'));var path=require(_0xf6dd('0x1'));var timeout=require(_0xf6dd('0x2'));var express=require(_0xf6dd('0x3'));var router=express[_0xf6dd('0x4')]();var fs_extra=require(_0xf6dd('0x5'));var auth=require(_0xf6dd('0x6'));var interaction=require(_0xf6dd('0x7'));var config=require(_0xf6dd('0x8'));var controller=require(_0xf6dd('0x9'));router[_0xf6dd('0xa')]('/',auth['isAuthenticated'](),controller[_0xf6dd('0xb')]);router[_0xf6dd('0xa')](_0xf6dd('0xc'),auth[_0xf6dd('0xd')](),controller['describe']);router[_0xf6dd('0xa')](_0xf6dd('0xe'),auth[_0xf6dd('0xd')](),controller[_0xf6dd('0xf')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf6dd('0x10')]);router[_0xf6dd('0x11')]('/',auth[_0xf6dd('0xd')](),controller[_0xf6dd('0x12')]);router[_0xf6dd('0x13')]('/:id',controller[_0xf6dd('0x14')]);router[_0xf6dd('0x15')](_0xf6dd('0x16'),auth[_0xf6dd('0xd')](),controller[_0xf6dd('0x17')]);module[_0xf6dd('0x18')]=router;
\ No newline at end of file
+var _0x7109=['delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','/describe','/users','getUsers','get','/:id','post','put','update'];(function(_0x22c684,_0x753309){var _0x39fcbb=function(_0x38b631){while(--_0x38b631){_0x22c684['push'](_0x22c684['shift']());}};_0x39fcbb(++_0x753309);}(_0x7109,0xd4));var _0x9710=function(_0x13b7fd,_0x4eaf7f){_0x13b7fd=_0x13b7fd-0x0;var _0x32a74a=_0x7109[_0x13b7fd];return _0x32a74a;};'use strict';var multer=require(_0x9710('0x0'));var util=require(_0x9710('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9710('0x2'));var router=express[_0x9710('0x3')]();var fs_extra=require(_0x9710('0x4'));var auth=require(_0x9710('0x5'));var interaction=require(_0x9710('0x6'));var config=require(_0x9710('0x7'));var controller=require(_0x9710('0x8'));router['get']('/',auth[_0x9710('0x9')](),controller[_0x9710('0xa')]);router['get'](_0x9710('0xb'),auth[_0x9710('0x9')](),controller['describe']);router['get'](_0x9710('0xc'),auth[_0x9710('0x9')](),controller[_0x9710('0xd')]);router[_0x9710('0xe')](_0x9710('0xf'),auth[_0x9710('0x9')](),controller['show']);router[_0x9710('0x10')]('/',auth[_0x9710('0x9')](),controller['create']);router[_0x9710('0x11')](_0x9710('0xf'),controller[_0x9710('0x12')]);router[_0x9710('0x13')](_0x9710('0xf'),auth[_0x9710('0x9')](),controller['destroy']);module[_0x9710('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 257c975..978182d 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 _0x081e=['exports','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT','sequelize'];(function(_0xdbce2e,_0x1ba5ba){var _0x570025=function(_0x45cd9f){while(--_0x45cd9f){_0xdbce2e['push'](_0xdbce2e['shift']());}};_0x570025(++_0x1ba5ba);}(_0x081e,0xc5));var _0xe081=function(_0xd1315c,_0x2ce3a0){_0xd1315c=_0xd1315c-0x0;var _0x40565a=_0x081e[_0xd1315c];return _0x40565a;};'use strict';var Sequelize=require(_0xe081('0x0'));module[_0xe081('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe081('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xe081('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe081('0x4')]('in',_0xe081('0x5')),'defaultValue':_0xe081('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe081('0x6')]},'providerName':{'type':Sequelize[_0xe081('0x7')]},'providerResponse':{'type':Sequelize[_0xe081('0x8')]}};
\ No newline at end of file
+var _0x7894=['medium','BOOLEAN','out','STRING','sequelize','exports','TEXT'];(function(_0x9a23c4,_0x410fb0){var _0x27775a=function(_0x175e99){while(--_0x175e99){_0x9a23c4['push'](_0x9a23c4['shift']());}};_0x27775a(++_0x410fb0);}(_0x7894,0x170));var _0x4789=function(_0x1ec3dd,_0x3f108a){_0x1ec3dd=_0x1ec3dd-0x0;var _0x5529be=_0x7894[_0x1ec3dd];return _0x5529be;};'use strict';var Sequelize=require(_0x4789('0x0'));module[_0x4789('0x1')]={'body':{'type':Sequelize[_0x4789('0x2')](_0x4789('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4789('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4789('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4789('0x5')),'defaultValue':_0x4789('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x4789('0x6')]},'providerResponse':{'type':Sequelize[_0x4789('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 8beaccc..7a6487b 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 _0xae93=['status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','stack','name','send','map','ChatMessage','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','rawAttributes','length','find','create','body','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','ChatInteraction','ChatInteractionId','isNil','read1stAt','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','agent','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','../../config/logger','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','internal','reject','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','jayson/promise','http','client','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xae93,0x173));var _0x3ae9=function(_0x19fec1,_0x1cc62f){_0x19fec1=_0x19fec1-0x0;var _0x29cd35=_0xae93[_0x19fec1];return _0x29cd35;};'use strict';var emlformat=require(_0x3ae9('0x0'));var rimraf=require(_0x3ae9('0x1'));var zipdir=require(_0x3ae9('0x2'));var jsonpatch=require(_0x3ae9('0x3'));var rp=require(_0x3ae9('0x4'));var moment=require(_0x3ae9('0x5'));var BPromise=require(_0x3ae9('0x6'));var Mustache=require(_0x3ae9('0x7'));var util=require('util');var path=require(_0x3ae9('0x8'));var sox=require(_0x3ae9('0x9'));var csv=require(_0x3ae9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ae9('0xb'));var _=require(_0x3ae9('0xc'));var squel=require(_0x3ae9('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3ae9('0xe'));var toCsv=require(_0x3ae9('0xa'));var querystring=require('querystring');var Papa=require(_0x3ae9('0xf'));var Redis=require('ioredis');var authService=require(_0x3ae9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3ae9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3ae9('0x12'));var utils=require(_0x3ae9('0x13'));var config=require(_0x3ae9('0x14'));var licenseUtil=require(_0x3ae9('0x15'));var db=require(_0x3ae9('0x16'))['db'];config[_0x3ae9('0x17')]=_[_0x3ae9('0x18')](config[_0x3ae9('0x17')],{'host':_0x3ae9('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3ae9('0x17')]));require(_0x3ae9('0x1a'))['register'](socket);var jayson=require(_0x3ae9('0x1b'));var client=jayson['client'][_0x3ae9('0x1c')]({'port':0x232c});var client9002=jayson[_0x3ae9('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x191942,_0x3f8003,_0x312599,_0x133664){return new BPromise(function(_0x345ef7,_0x61b4e9){var _0x1620b7=_0x133664||client;return _0x1620b7[_0x3ae9('0x1e')](_0x191942,_0x312599)['then'](function(_0x49a57f){logger[_0x3ae9('0x1f')](_0x3ae9('0x20'),_0x3f8003,_0x3ae9('0x21'));logger[_0x3ae9('0x22')](_0x3ae9('0x23'),_0x3f8003,_0x3ae9('0x21'),JSON[_0x3ae9('0x24')](_0x49a57f));if(_0x49a57f[_0x3ae9('0x25')]){if(_0x49a57f['error'][_0x3ae9('0x26')]===0x1f4){logger[_0x3ae9('0x25')](_0x3ae9('0x20'),_0x3f8003,_0x49a57f[_0x3ae9('0x25')][_0x3ae9('0x27')]);return _0x61b4e9(_0x49a57f[_0x3ae9('0x25')][_0x3ae9('0x27')]);}logger['error'](_0x3ae9('0x20'),_0x3f8003,_0x49a57f['error']['message']);return _0x345ef7(_0x49a57f['error'][_0x3ae9('0x27')]);}else{logger[_0x3ae9('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x3f8003,_0x3ae9('0x21'));_0x345ef7(_0x49a57f[_0x3ae9('0x28')][_0x3ae9('0x27')]);}})[_0x3ae9('0x29')](function(_0x1f4d47){logger[_0x3ae9('0x25')]('ChatMessage,\x20%s,\x20%s',_0x3f8003,_0x1f4d47);_0x61b4e9(_0x1f4d47);});});}function respondWithStatusCode(_0x4040bf,_0x531af2){_0x531af2=_0x531af2||0xcc;return function(_0x3e34c1){if(_0x3e34c1){return _0x4040bf[_0x3ae9('0x2a')](_0x531af2);}return _0x4040bf[_0x3ae9('0x2b')](_0x531af2)['end']();};}function respondWithResult(_0x405c3d,_0x13f8e2){_0x13f8e2=_0x13f8e2||0xc8;return function(_0x2ad544){if(_0x2ad544){return _0x405c3d[_0x3ae9('0x2b')](_0x13f8e2)[_0x3ae9('0x2c')](_0x2ad544);}};}function respondWithFilteredResult(_0x250fe5,_0x40f69c){return function(_0x3911f1){if(_0x3911f1){var _0x2e1f35=typeof _0x40f69c[_0x3ae9('0x2d')]===_0x3ae9('0x2e')&&typeof _0x40f69c['limit']==='undefined';var _0x1d9737=_0x3911f1[_0x3ae9('0x2f')];var _0x31d362=_0x2e1f35?0x0:_0x40f69c[_0x3ae9('0x2d')];var _0x19e83b=_0x2e1f35?_0x3911f1[_0x3ae9('0x2f')]:_0x40f69c[_0x3ae9('0x2d')]+_0x40f69c[_0x3ae9('0x30')];var _0x1a001e;if(_0x19e83b>=_0x1d9737){_0x19e83b=_0x1d9737;_0x1a001e=0xc8;}else{_0x1a001e=0xce;}_0x250fe5[_0x3ae9('0x2b')](_0x1a001e);return _0x250fe5[_0x3ae9('0x31')](_0x3ae9('0x32'),_0x31d362+'-'+_0x19e83b+'/'+_0x1d9737)[_0x3ae9('0x2c')](_0x3911f1);}return null;};}function patchUpdates(_0x24dd2d){return function(_0x110622){try{jsonpatch['apply'](_0x110622,_0x24dd2d,!![]);}catch(_0x4f7b2f){return BPromise['reject'](_0x4f7b2f);}return _0x110622[_0x3ae9('0x33')]();};}function saveUpdates(_0x352c01,_0x4ce01c){return function(_0x233f00){if(_0x233f00){return _0x233f00[_0x3ae9('0x34')](_0x352c01)[_0x3ae9('0x35')](function(_0x5a452c){return _0x5a452c;});}return null;};}function removeEntity(_0x45771a,_0x2c3578){return function(_0xa8bb39){if(_0xa8bb39){return _0xa8bb39[_0x3ae9('0x36')]()[_0x3ae9('0x35')](function(){_0x45771a[_0x3ae9('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x507bf8,_0x585cea){return function(_0x2c5d68){if(!_0x2c5d68){_0x507bf8['sendStatus'](0x194);}return _0x2c5d68;};}function handleError(_0xf5fcca,_0x51eda6){_0x51eda6=_0x51eda6||0x1f4;return function(_0x3ccd6a){logger['error'](_0x3ccd6a[_0x3ae9('0x37')]);if(_0x3ccd6a[_0x3ae9('0x38')]){delete _0x3ccd6a[_0x3ae9('0x38')];}_0xf5fcca[_0x3ae9('0x2b')](_0x51eda6)[_0x3ae9('0x39')](_0x3ccd6a);};}exports['index']=function(_0x32b2b8,_0x100b4c){var _0x33c797={},_0x4d3c76={},_0x20da01={'count':0x0,'rows':[]};var _0x4b587d=_[_0x3ae9('0x3a')](db[_0x3ae9('0x3b')]['rawAttributes'],function(_0x489f73){return{'name':_0x489f73[_0x3ae9('0x3c')],'type':_0x489f73[_0x3ae9('0x3d')][_0x3ae9('0x3e')]};});_0x4d3c76['model']=_[_0x3ae9('0x3a')](_0x4b587d,_0x3ae9('0x38'));_0x4d3c76[_0x3ae9('0x3f')]=_['keys'](_0x32b2b8[_0x3ae9('0x3f')]);_0x4d3c76[_0x3ae9('0x40')]=_[_0x3ae9('0x41')](_0x4d3c76[_0x3ae9('0x42')],_0x4d3c76[_0x3ae9('0x3f')]);_0x33c797['attributes']=_[_0x3ae9('0x41')](_0x4d3c76[_0x3ae9('0x42')],qs[_0x3ae9('0x43')](_0x32b2b8[_0x3ae9('0x3f')][_0x3ae9('0x43')]));_0x33c797['attributes']=_0x33c797['attributes']['length']?_0x33c797[_0x3ae9('0x44')]:_0x4d3c76[_0x3ae9('0x42')];if(!_0x32b2b8[_0x3ae9('0x3f')][_0x3ae9('0x45')](_0x3ae9('0x46'))){_0x33c797['limit']=qs[_0x3ae9('0x30')](_0x32b2b8[_0x3ae9('0x3f')]['limit']);_0x33c797[_0x3ae9('0x2d')]=qs[_0x3ae9('0x2d')](_0x32b2b8[_0x3ae9('0x3f')][_0x3ae9('0x2d')]);}_0x33c797[_0x3ae9('0x47')]=qs[_0x3ae9('0x48')](_0x32b2b8['query'][_0x3ae9('0x48')]);_0x33c797['where']=qs['filters'](_[_0x3ae9('0x49')](_0x32b2b8[_0x3ae9('0x3f')],_0x4d3c76[_0x3ae9('0x40')]),_0x4b587d);if(_0x32b2b8[_0x3ae9('0x3f')][_0x3ae9('0x4a')]){_0x33c797[_0x3ae9('0x4b')]=_[_0x3ae9('0x4c')](_0x33c797[_0x3ae9('0x4b')],{'$or':_[_0x3ae9('0x3a')](_0x4b587d,function(_0x1cc58c){if(_0x1cc58c[_0x3ae9('0x3d')]!==_0x3ae9('0x4d')){var _0x2a2621={};_0x2a2621[_0x1cc58c[_0x3ae9('0x38')]]={'$like':'%'+_0x32b2b8[_0x3ae9('0x3f')][_0x3ae9('0x4a')]+'%'};return _0x2a2621;}})});}_0x33c797=_[_0x3ae9('0x4c')]({},_0x33c797,_0x32b2b8[_0x3ae9('0x4e')]);var _0x1b52fa={'where':_0x33c797[_0x3ae9('0x4b')]};return db[_0x3ae9('0x3b')]['count'](_0x1b52fa)[_0x3ae9('0x35')](function(_0x31371c){_0x20da01[_0x3ae9('0x2f')]=_0x31371c;if(_0x32b2b8['query'][_0x3ae9('0x4f')]){_0x33c797['include']=[{'all':!![]}];}return db[_0x3ae9('0x3b')][_0x3ae9('0x50')](_0x33c797);})[_0x3ae9('0x35')](function(_0x589843){_0x20da01[_0x3ae9('0x51')]=_0x589843;return _0x20da01;})[_0x3ae9('0x35')](respondWithFilteredResult(_0x100b4c,_0x33c797))[_0x3ae9('0x29')](handleError(_0x100b4c,null));};exports[_0x3ae9('0x52')]=function(_0x354fa8,_0x539bb1){var _0x5ca3fa={'raw':!![],'where':{'id':_0x354fa8[_0x3ae9('0x53')]['id']}},_0x215145={};_0x215145[_0x3ae9('0x42')]=_[_0x3ae9('0x54')](db[_0x3ae9('0x3b')][_0x3ae9('0x55')]);_0x215145['query']=_[_0x3ae9('0x54')](_0x354fa8[_0x3ae9('0x3f')]);_0x215145[_0x3ae9('0x40')]=_[_0x3ae9('0x41')](_0x215145[_0x3ae9('0x42')],_0x215145[_0x3ae9('0x3f')]);_0x5ca3fa[_0x3ae9('0x44')]=_[_0x3ae9('0x41')](_0x215145['model'],qs['fields'](_0x354fa8[_0x3ae9('0x3f')][_0x3ae9('0x43')]));_0x5ca3fa[_0x3ae9('0x44')]=_0x5ca3fa[_0x3ae9('0x44')][_0x3ae9('0x56')]?_0x5ca3fa[_0x3ae9('0x44')]:_0x215145['model'];if(_0x354fa8[_0x3ae9('0x3f')]['includeAll']){_0x5ca3fa['include']=[{'all':!![]}];}_0x5ca3fa=_[_0x3ae9('0x4c')]({},_0x5ca3fa,_0x354fa8[_0x3ae9('0x4e')]);return db[_0x3ae9('0x3b')][_0x3ae9('0x57')](_0x5ca3fa)[_0x3ae9('0x35')](handleEntityNotFound(_0x539bb1,null))['then'](respondWithResult(_0x539bb1,null))[_0x3ae9('0x29')](handleError(_0x539bb1,null));};exports[_0x3ae9('0x58')]=function(_0x453ef2,_0x465613){return db[_0x3ae9('0x3b')][_0x3ae9('0x58')](_0x453ef2['body'],{})[_0x3ae9('0x35')](respondWithResult(_0x465613,0xc9))['catch'](handleError(_0x465613,null));};exports[_0x3ae9('0x34')]=function(_0x4d7861,_0x1260e5){if(_0x4d7861['body']['id']){delete _0x4d7861['body']['id'];}return db[_0x3ae9('0x3b')][_0x3ae9('0x57')]({'where':{'id':_0x4d7861[_0x3ae9('0x53')]['id']}})[_0x3ae9('0x35')](handleEntityNotFound(_0x1260e5,null))[_0x3ae9('0x35')](saveUpdates(_0x4d7861[_0x3ae9('0x59')],null))[_0x3ae9('0x35')](respondWithResult(_0x1260e5,null))['catch'](handleError(_0x1260e5,null));};exports[_0x3ae9('0x36')]=function(_0x23a4fe,_0x5f32f8){return db[_0x3ae9('0x3b')][_0x3ae9('0x57')]({'where':{'id':_0x23a4fe['params']['id']}})[_0x3ae9('0x35')](handleEntityNotFound(_0x5f32f8,null))[_0x3ae9('0x35')](removeEntity(_0x5f32f8,null))[_0x3ae9('0x29')](handleError(_0x5f32f8,null));};exports[_0x3ae9('0x5a')]=function(_0x649b06,_0x51e5b6){return db[_0x3ae9('0x3b')][_0x3ae9('0x5a')]()[_0x3ae9('0x35')](respondWithResult(_0x51e5b6,null))['catch'](handleError(_0x51e5b6,null));};var interaction_log=require('../../config/logger')(_0x3ae9('0x5b'));exports['accept']=function(_0xb1beb0,_0x40f233,_0x5b6ee6){var _0x3531a9={'agent':{},'channel':_0x3ae9('0x5c')};if(_0xb1beb0['body']['id']){delete _0xb1beb0[_0x3ae9('0x59')]['id'];}_0xb1beb0[_0x3ae9('0x59')][_0x3ae9('0x5d')]=!![];_0xb1beb0[_0x3ae9('0x59')][_0x3ae9('0x5e')]=moment()[_0x3ae9('0x5f')](_0x3ae9('0x60'));_0xb1beb0[_0x3ae9('0x59')]['UserId']=_0xb1beb0[_0x3ae9('0x59')][_0x3ae9('0x61')]||_0xb1beb0['user']['id'];_0x3531a9['agent']['id']=_0xb1beb0[_0x3ae9('0x59')]['UserId'];return db[_0x3ae9('0x3b')][_0x3ae9('0x57')]({'where':{'id':_0xb1beb0['params']['id'],'UserId':null}})[_0x3ae9('0x35')](handleEntityNotFound(_0x40f233,null))[_0x3ae9('0x35')](saveUpdates(_0xb1beb0[_0x3ae9('0x59')],null))[_0x3ae9('0x35')](function(_0x59bb48){if(_0x59bb48){_0x3531a9[_0x3ae9('0x27')]=_0x59bb48['get']({'plain':!![]});return db[_0x3ae9('0x62')]['find']({'where':{'id':_0x59bb48[_0x3ae9('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x40f233,null))[_0x3ae9('0x35')](function(_0x2ea977){if(_0x2ea977){return _0x2ea977['update']({'UserId':_0xb1beb0['body'][_0x3ae9('0x61')],'read1stAt':_[_0x3ae9('0x64')](_0x2ea977[_0x3ae9('0x65')])?moment()[_0x3ae9('0x5f')](_0x3ae9('0x60')):undefined});}return null;})[_0x3ae9('0x35')](function(_0x325399){if(_0x325399){_0x3531a9['interaction']=_0x325399[_0x3ae9('0x66')]({'plain':!![]});interaction_log[_0x3ae9('0x1f')](_0x3ae9('0x67'),_0xb1beb0['user']['id'],_0xb1beb0[_0x3ae9('0x68')][_0x3ae9('0x38')],_0xb1beb0[_0x3ae9('0x68')][_0x3ae9('0x69')],_0x3531a9[_0x3ae9('0x6a')]['id'],_0xb1beb0['body']?JSON[_0x3ae9('0x24')](_0xb1beb0[_0x3ae9('0x59')]):_0x3ae9('0x6b'));return respondWithRpcPromise(_0x3ae9('0x6c'),_0x3ae9('0x6d'),_0x3531a9);}return null;})[_0x3ae9('0x35')](function(_0x280c98){var _0xcc045e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x280c98[_0x3ae9('0x27')][_0x3ae9('0x6e')];return db[_0x3ae9('0x6f')]['query'](_0xcc045e,{'type':db['Sequelize'][_0x3ae9('0x70')][_0x3ae9('0x71')],'raw':!![]})[_0x3ae9('0x35')](function(_0x4b33f5){return _0x4b33f5;});})[_0x3ae9('0x35')](function(_0x44b85d){if(_0x44b85d){_0x3531a9['message'][_0x3ae9('0x72')]=_0x44b85d[0x0];if(!_0xb1beb0[_0x3ae9('0x59')][_0x3ae9('0x61')])return;return db[_0x3ae9('0x73')]['find']({'where':{'id':_0xb1beb0[_0x3ae9('0x59')][_0x3ae9('0x61')],'role':'agent'},'attributes':['id',_0x3ae9('0x38'),_0x3ae9('0x74'),_0x3ae9('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0xbe79a2){if(!_0xbe79a2)return null;_0x3531a9[_0x3ae9('0x27')][_0x3ae9('0x76')]=_0xbe79a2;return _0x3531a9;})[_0x3ae9('0x35')](function(_0x2a7202){if(_0x2a7202){if(_0xb1beb0['body'][_0x3ae9('0x77')]){_0x3531a9[_0x3ae9('0x27')][_0x3ae9('0x78')]=util[_0x3ae9('0x5f')](_0x3ae9('0x79'),_0xb1beb0[_0x3ae9('0x68')][_0x3ae9('0x38')]);_0x3531a9['message']['channel']=_0x3531a9[_0x3ae9('0x7a')];_0x3531a9['message'][_0x3ae9('0x7b')]=_0x3531a9[_0x3ae9('0x7a')];_0x3531a9[_0x3ae9('0x27')][_0x3ae9('0x7c')]=_0x3ae9('0x7d');return respondWithRpcPromise(_0x3ae9('0x7e'),_0x3ae9('0x7e'),{'event':_0x3ae9('0x7f'),'message':_[_0x3ae9('0x4c')](_0x3531a9[_0x3ae9('0x27')],JSON[_0x3ae9('0x80')](_0x3531a9[_0x3ae9('0x6a')]['formData']))},client9002)[_0x3ae9('0x35')](function(){return _0x3531a9;});}return _0x3531a9;}return null;})[_0x3ae9('0x35')](respondWithResult(_0x40f233,null))[_0x3ae9('0x29')](handleError(_0x40f233,null));};var interaction_log=require(_0x3ae9('0x81'))(_0x3ae9('0x5b'));exports['reject']=function(_0x51e885,_0x52f573,_0x24ba2f){var _0x1ee041={'agent':{},'channel':_0x3ae9('0x5c')};if(_0x51e885[_0x3ae9('0x59')]['id']){delete _0x51e885[_0x3ae9('0x59')]['id'];}_0x51e885[_0x3ae9('0x59')][_0x3ae9('0x61')]=_0x51e885[_0x3ae9('0x59')][_0x3ae9('0x61')]||_0x51e885[_0x3ae9('0x68')]['id'];_0x1ee041[_0x3ae9('0x76')]['id']=_0x51e885[_0x3ae9('0x59')]['UserId'];return db[_0x3ae9('0x3b')][_0x3ae9('0x57')]({'where':{'id':_0x51e885[_0x3ae9('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x52f573,null))[_0x3ae9('0x35')](function(_0x1e1e29){if(_0x1e1e29){_0x1ee041['message']=_0x1e1e29[_0x3ae9('0x66')]({'plain':!![]});return db[_0x3ae9('0x62')][_0x3ae9('0x57')]({'where':{'id':_0x1e1e29[_0x3ae9('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x52f573,null))[_0x3ae9('0x35')](function(_0x47ab4c){if(_0x47ab4c){_0x1ee041['interaction']=_0x47ab4c[_0x3ae9('0x66')]({'plain':!![]});interaction_log['info'](_0x3ae9('0x82'),_0x51e885['user']['id'],_0x51e885[_0x3ae9('0x68')]['name'],_0x51e885[_0x3ae9('0x68')][_0x3ae9('0x69')],_0x1ee041[_0x3ae9('0x6a')]['id'],_0x51e885['body']?JSON[_0x3ae9('0x24')](_0x51e885[_0x3ae9('0x59')]):'null');return respondWithRpcPromise(_0x3ae9('0x83'),_0x3ae9('0x84'),_0x1ee041);}return null;})[_0x3ae9('0x35')](function(_0x20fd0b){var _0x1638da='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20fd0b['message'][_0x3ae9('0x6e')];return db[_0x3ae9('0x6f')][_0x3ae9('0x3f')](_0x1638da,{'type':db[_0x3ae9('0x85')][_0x3ae9('0x70')][_0x3ae9('0x71')],'raw':!![]})[_0x3ae9('0x35')](function(_0x1dceff){return _0x1dceff;});})['then'](function(_0x1fa489){if(_0x1fa489){_0x1ee041['message'][_0x3ae9('0x72')]=_0x1fa489[0x0];if(!_0x51e885[_0x3ae9('0x59')]['UserId'])return;return db['User'][_0x3ae9('0x57')]({'where':{'id':_0x51e885[_0x3ae9('0x59')][_0x3ae9('0x61')],'role':'agent'},'attributes':['id',_0x3ae9('0x38'),_0x3ae9('0x74'),_0x3ae9('0x75'),_0x3ae9('0x86')],'raw':!![]});}return null;})[_0x3ae9('0x35')](function(_0x40bdc8){if(!_0x40bdc8)return null;_0x1ee041['message']['agent']=_0x40bdc8;return _0x1ee041;})[_0x3ae9('0x35')](function(_0x21e19e){if(_0x21e19e){_0x21e19e[_0x3ae9('0x27')][_0x3ae9('0x78')]=util[_0x3ae9('0x5f')](_0x3ae9('0x79'),_0x51e885[_0x3ae9('0x68')][_0x3ae9('0x38')]);_0x21e19e[_0x3ae9('0x27')][_0x3ae9('0x7a')]=_0x1ee041[_0x3ae9('0x7a')];_0x21e19e[_0x3ae9('0x27')][_0x3ae9('0x7b')]=_0x1ee041['channel'];_0x21e19e[_0x3ae9('0x27')][_0x3ae9('0x7c')]=_0x3ae9('0x87');respondWithRpcPromise('EventManager',_0x3ae9('0x7e'),{'event':_0x3ae9('0x88'),'message':_[_0x3ae9('0x4c')](_0x1ee041[_0x3ae9('0x27')],JSON[_0x3ae9('0x80')](_0x1ee041[_0x3ae9('0x6a')][_0x3ae9('0x89')]))},client9002);return _0x1ee041;}return null;})[_0x3ae9('0x35')](respondWithResult(_0x52f573,null))[_0x3ae9('0x29')](handleError(_0x52f573,null));};
\ No newline at end of file
+var _0xd97a=['acceptMessage','sequelize','QueryTypes','email','internal','interface','SIP/%s','motionChannel','channel','event','EventManager','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','contact','fullname','rejectmessage','parse','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./chatMessage.socket','register','http','client','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','limit','offset','Content-Range','apply','reject','save','update','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','ChatMessage','findAll','rows','show','params','keys','length','options','find','create','body','destroy','describe','chat-interactions','chat','read','readAt','format','UserId','user','agent','get','ChatInteraction','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage'];(function(_0x390bda,_0x4752bb){var _0x3790e6=function(_0x1b7286){while(--_0x1b7286){_0x390bda['push'](_0x390bda['shift']());}};_0x3790e6(++_0x4752bb);}(_0xd97a,0x11a));var _0xad97=function(_0x201587,_0x4bc5f4){_0x201587=_0x201587-0x0;var _0x92e6dc=_0xd97a[_0x201587];return _0x92e6dc;};'use strict';var emlformat=require(_0xad97('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xad97('0x1'));var jsonpatch=require(_0xad97('0x2'));var rp=require(_0xad97('0x3'));var moment=require(_0xad97('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xad97('0x5'));var util=require(_0xad97('0x6'));var path=require(_0xad97('0x7'));var sox=require(_0xad97('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad97('0x9'));var _=require('lodash');var squel=require(_0xad97('0xa'));var crypto=require(_0xad97('0xb'));var jsforce=require(_0xad97('0xc'));var deskjs=require(_0xad97('0xd'));var toCsv=require(_0xad97('0xe'));var querystring=require('querystring');var Papa=require(_0xad97('0xf'));var Redis=require(_0xad97('0x10'));var authService=require(_0xad97('0x11'));var qs=require(_0xad97('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xad97('0x13'));var logger=require(_0xad97('0x14'))(_0xad97('0x15'));var utils=require('../../config/utils');var config=require(_0xad97('0x16'));var licenseUtil=require(_0xad97('0x17'));var db=require('../../mysqldb')['db'];config[_0xad97('0x18')]=_[_0xad97('0x19')](config[_0xad97('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xad97('0x1a'))(new Redis(config[_0xad97('0x18')]));require(_0xad97('0x1b'))[_0xad97('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xad97('0x1d')]({'port':0x232c});var client9002=jayson[_0xad97('0x1e')][_0xad97('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2c9d71,_0x1d0bae,_0x349685,_0x188778){return new BPromise(function(_0x19b733,_0x5379d8){var _0x149e79=_0x188778||client;return _0x149e79['request'](_0x2c9d71,_0x349685)[_0xad97('0x1f')](function(_0x44511c){logger[_0xad97('0x20')](_0xad97('0x21'),_0x1d0bae,_0xad97('0x22'));logger[_0xad97('0x23')](_0xad97('0x24'),_0x1d0bae,_0xad97('0x22'),JSON[_0xad97('0x25')](_0x44511c));if(_0x44511c[_0xad97('0x26')]){if(_0x44511c[_0xad97('0x26')][_0xad97('0x27')]===0x1f4){logger['error'](_0xad97('0x21'),_0x1d0bae,_0x44511c[_0xad97('0x26')]['message']);return _0x5379d8(_0x44511c[_0xad97('0x26')]['message']);}logger[_0xad97('0x26')](_0xad97('0x21'),_0x1d0bae,_0x44511c['error'][_0xad97('0x28')]);return _0x19b733(_0x44511c[_0xad97('0x26')]['message']);}else{logger[_0xad97('0x20')](_0xad97('0x21'),_0x1d0bae,_0xad97('0x22'));_0x19b733(_0x44511c['result'][_0xad97('0x28')]);}})[_0xad97('0x29')](function(_0x464fd8){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1d0bae,_0x464fd8);_0x5379d8(_0x464fd8);});});}function respondWithStatusCode(_0x4ee96e,_0x23d678){_0x23d678=_0x23d678||0xcc;return function(_0x3a76dc){if(_0x3a76dc){return _0x4ee96e['sendStatus'](_0x23d678);}return _0x4ee96e[_0xad97('0x2a')](_0x23d678)[_0xad97('0x2b')]();};}function respondWithResult(_0x77386b,_0x41efe3){_0x41efe3=_0x41efe3||0xc8;return function(_0xf88c5a){if(_0xf88c5a){return _0x77386b[_0xad97('0x2a')](_0x41efe3)[_0xad97('0x2c')](_0xf88c5a);}};}function respondWithFilteredResult(_0x229761,_0x5a071e){return function(_0x1c7919){if(_0x1c7919){var _0x8c6f36=typeof _0x5a071e['offset']==='undefined'&&typeof _0x5a071e[_0xad97('0x2d')]==='undefined';var _0x383490=_0x1c7919['count'];var _0x55eba5=_0x8c6f36?0x0:_0x5a071e[_0xad97('0x2e')];var _0x25078f=_0x8c6f36?_0x1c7919['count']:_0x5a071e[_0xad97('0x2e')]+_0x5a071e['limit'];var _0x471fbe;if(_0x25078f>=_0x383490){_0x25078f=_0x383490;_0x471fbe=0xc8;}else{_0x471fbe=0xce;}_0x229761[_0xad97('0x2a')](_0x471fbe);return _0x229761['set'](_0xad97('0x2f'),_0x55eba5+'-'+_0x25078f+'/'+_0x383490)[_0xad97('0x2c')](_0x1c7919);}return null;};}function patchUpdates(_0x572690){return function(_0x3db0fc){try{jsonpatch[_0xad97('0x30')](_0x3db0fc,_0x572690,!![]);}catch(_0x1f1792){return BPromise[_0xad97('0x31')](_0x1f1792);}return _0x3db0fc[_0xad97('0x32')]();};}function saveUpdates(_0x396d81,_0x1db97a){return function(_0x306ba8){if(_0x306ba8){return _0x306ba8[_0xad97('0x33')](_0x396d81)['then'](function(_0x18ea45){return _0x18ea45;});}return null;};}function removeEntity(_0x4ad36b,_0x274259){return function(_0x53bd56){if(_0x53bd56){return _0x53bd56['destroy']()[_0xad97('0x1f')](function(){_0x4ad36b['status'](0xcc)[_0xad97('0x2b')]();});}};}function handleEntityNotFound(_0x3469c8,_0x183570){return function(_0x1129df){if(!_0x1129df){_0x3469c8[_0xad97('0x34')](0x194);}return _0x1129df;};}function handleError(_0x2035ab,_0x347afd){_0x347afd=_0x347afd||0x1f4;return function(_0xc12766){logger[_0xad97('0x26')](_0xc12766[_0xad97('0x35')]);if(_0xc12766[_0xad97('0x36')]){delete _0xc12766[_0xad97('0x36')];}_0x2035ab[_0xad97('0x2a')](_0x347afd)[_0xad97('0x37')](_0xc12766);};}exports[_0xad97('0x38')]=function(_0x5ed2aa,_0x1e32ef){var _0x1da322={},_0x28370f={},_0x12410e={'count':0x0,'rows':[]};var _0x2c4a80=_[_0xad97('0x39')](db['ChatMessage'][_0xad97('0x3a')],function(_0xf7245){return{'name':_0xf7245[_0xad97('0x3b')],'type':_0xf7245[_0xad97('0x3c')][_0xad97('0x3d')]};});_0x28370f['model']=_[_0xad97('0x39')](_0x2c4a80,_0xad97('0x36'));_0x28370f['query']=_['keys'](_0x5ed2aa[_0xad97('0x3e')]);_0x28370f[_0xad97('0x3f')]=_[_0xad97('0x40')](_0x28370f[_0xad97('0x41')],_0x28370f['query']);_0x1da322[_0xad97('0x42')]=_[_0xad97('0x40')](_0x28370f[_0xad97('0x41')],qs[_0xad97('0x43')](_0x5ed2aa[_0xad97('0x3e')][_0xad97('0x43')]));_0x1da322[_0xad97('0x42')]=_0x1da322[_0xad97('0x42')]['length']?_0x1da322[_0xad97('0x42')]:_0x28370f[_0xad97('0x41')];if(!_0x5ed2aa[_0xad97('0x3e')]['hasOwnProperty'](_0xad97('0x44'))){_0x1da322[_0xad97('0x2d')]=qs[_0xad97('0x2d')](_0x5ed2aa[_0xad97('0x3e')]['limit']);_0x1da322[_0xad97('0x2e')]=qs[_0xad97('0x2e')](_0x5ed2aa[_0xad97('0x3e')][_0xad97('0x2e')]);}_0x1da322[_0xad97('0x45')]=qs[_0xad97('0x46')](_0x5ed2aa[_0xad97('0x3e')][_0xad97('0x46')]);_0x1da322[_0xad97('0x47')]=qs['filters'](_[_0xad97('0x48')](_0x5ed2aa[_0xad97('0x3e')],_0x28370f[_0xad97('0x3f')]),_0x2c4a80);if(_0x5ed2aa[_0xad97('0x3e')][_0xad97('0x49')]){_0x1da322[_0xad97('0x47')]=_[_0xad97('0x4a')](_0x1da322[_0xad97('0x47')],{'$or':_[_0xad97('0x39')](_0x2c4a80,function(_0x455782){if(_0x455782[_0xad97('0x3c')]!==_0xad97('0x4b')){var _0x157a26={};_0x157a26[_0x455782['name']]={'$like':'%'+_0x5ed2aa[_0xad97('0x3e')][_0xad97('0x49')]+'%'};return _0x157a26;}})});}_0x1da322=_[_0xad97('0x4a')]({},_0x1da322,_0x5ed2aa['options']);var _0x3e20ca={'where':_0x1da322[_0xad97('0x47')]};return db['ChatMessage'][_0xad97('0x4c')](_0x3e20ca)['then'](function(_0x314f94){_0x12410e[_0xad97('0x4c')]=_0x314f94;if(_0x5ed2aa['query'][_0xad97('0x4d')]){_0x1da322[_0xad97('0x4e')]=[{'all':!![]}];}return db[_0xad97('0x4f')][_0xad97('0x50')](_0x1da322);})[_0xad97('0x1f')](function(_0x50fece){_0x12410e[_0xad97('0x51')]=_0x50fece;return _0x12410e;})[_0xad97('0x1f')](respondWithFilteredResult(_0x1e32ef,_0x1da322))[_0xad97('0x29')](handleError(_0x1e32ef,null));};exports[_0xad97('0x52')]=function(_0x34404d,_0x2ab83d){var _0x4d638f={'raw':!![],'where':{'id':_0x34404d[_0xad97('0x53')]['id']}},_0x145c58={};_0x145c58['model']=_[_0xad97('0x54')](db['ChatMessage'][_0xad97('0x3a')]);_0x145c58[_0xad97('0x3e')]=_[_0xad97('0x54')](_0x34404d[_0xad97('0x3e')]);_0x145c58[_0xad97('0x3f')]=_[_0xad97('0x40')](_0x145c58['model'],_0x145c58['query']);_0x4d638f['attributes']=_[_0xad97('0x40')](_0x145c58['model'],qs[_0xad97('0x43')](_0x34404d[_0xad97('0x3e')][_0xad97('0x43')]));_0x4d638f[_0xad97('0x42')]=_0x4d638f['attributes'][_0xad97('0x55')]?_0x4d638f['attributes']:_0x145c58[_0xad97('0x41')];if(_0x34404d['query'][_0xad97('0x4d')]){_0x4d638f['include']=[{'all':!![]}];}_0x4d638f=_[_0xad97('0x4a')]({},_0x4d638f,_0x34404d[_0xad97('0x56')]);return db[_0xad97('0x4f')][_0xad97('0x57')](_0x4d638f)[_0xad97('0x1f')](handleEntityNotFound(_0x2ab83d,null))['then'](respondWithResult(_0x2ab83d,null))['catch'](handleError(_0x2ab83d,null));};exports[_0xad97('0x58')]=function(_0x47808e,_0xf74040){return db[_0xad97('0x4f')][_0xad97('0x58')](_0x47808e[_0xad97('0x59')],{})[_0xad97('0x1f')](respondWithResult(_0xf74040,0xc9))[_0xad97('0x29')](handleError(_0xf74040,null));};exports['update']=function(_0x3d10c2,_0x32ad06){if(_0x3d10c2[_0xad97('0x59')]['id']){delete _0x3d10c2['body']['id'];}return db[_0xad97('0x4f')][_0xad97('0x57')]({'where':{'id':_0x3d10c2['params']['id']}})[_0xad97('0x1f')](handleEntityNotFound(_0x32ad06,null))[_0xad97('0x1f')](saveUpdates(_0x3d10c2['body'],null))[_0xad97('0x1f')](respondWithResult(_0x32ad06,null))[_0xad97('0x29')](handleError(_0x32ad06,null));};exports[_0xad97('0x5a')]=function(_0xedcebe,_0x4f9fe8){return db[_0xad97('0x4f')][_0xad97('0x57')]({'where':{'id':_0xedcebe[_0xad97('0x53')]['id']}})[_0xad97('0x1f')](handleEntityNotFound(_0x4f9fe8,null))[_0xad97('0x1f')](removeEntity(_0x4f9fe8,null))['catch'](handleError(_0x4f9fe8,null));};exports[_0xad97('0x5b')]=function(_0x453a5d,_0x565581){return db[_0xad97('0x4f')][_0xad97('0x5b')]()[_0xad97('0x1f')](respondWithResult(_0x565581,null))['catch'](handleError(_0x565581,null));};var interaction_log=require(_0xad97('0x14'))(_0xad97('0x5c'));exports['accept']=function(_0x217d36,_0x3e8924,_0x34dc73){var _0x1480d8={'agent':{},'channel':_0xad97('0x5d')};if(_0x217d36[_0xad97('0x59')]['id']){delete _0x217d36[_0xad97('0x59')]['id'];}_0x217d36[_0xad97('0x59')][_0xad97('0x5e')]=!![];_0x217d36['body'][_0xad97('0x5f')]=moment()[_0xad97('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x217d36[_0xad97('0x59')][_0xad97('0x61')]=_0x217d36[_0xad97('0x59')][_0xad97('0x61')]||_0x217d36[_0xad97('0x62')]['id'];_0x1480d8[_0xad97('0x63')]['id']=_0x217d36[_0xad97('0x59')][_0xad97('0x61')];return db['ChatMessage'][_0xad97('0x57')]({'where':{'id':_0x217d36[_0xad97('0x53')]['id'],'UserId':null}})[_0xad97('0x1f')](handleEntityNotFound(_0x3e8924,null))[_0xad97('0x1f')](saveUpdates(_0x217d36[_0xad97('0x59')],null))[_0xad97('0x1f')](function(_0x273d6a){if(_0x273d6a){_0x1480d8[_0xad97('0x28')]=_0x273d6a[_0xad97('0x64')]({'plain':!![]});return db[_0xad97('0x65')][_0xad97('0x57')]({'where':{'id':_0x273d6a['ChatInteractionId']}});}return null;})[_0xad97('0x1f')](handleEntityNotFound(_0x3e8924,null))[_0xad97('0x1f')](function(_0xc48dbc){if(_0xc48dbc){return _0xc48dbc[_0xad97('0x33')]({'UserId':_0x217d36[_0xad97('0x59')]['UserId'],'read1stAt':_['isNil'](_0xc48dbc['read1stAt'])?moment()['format'](_0xad97('0x66')):undefined});}return null;})[_0xad97('0x1f')](function(_0x4c1600){if(_0x4c1600){_0x1480d8[_0xad97('0x67')]=_0x4c1600[_0xad97('0x64')]({'plain':!![]});interaction_log['info'](_0xad97('0x68'),_0x217d36[_0xad97('0x62')]['id'],_0x217d36['user'][_0xad97('0x36')],_0x217d36[_0xad97('0x62')][_0xad97('0x69')],_0x1480d8[_0xad97('0x67')]['id'],_0x217d36[_0xad97('0x59')]?JSON[_0xad97('0x25')](_0x217d36[_0xad97('0x59')]):_0xad97('0x6a'));return respondWithRpcPromise(_0xad97('0x6b'),_0xad97('0x6c'),_0x1480d8);}return null;})[_0xad97('0x1f')](function(_0x4fd91d){var _0x180c63='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4fd91d['message']['ContactId'];return db[_0xad97('0x6d')][_0xad97('0x3e')](_0x180c63,{'type':db['Sequelize'][_0xad97('0x6e')]['SELECT'],'raw':!![]})[_0xad97('0x1f')](function(_0x4782a8){return _0x4782a8;});})[_0xad97('0x1f')](function(_0x4bd5a3){if(_0x4bd5a3){_0x1480d8[_0xad97('0x28')]['contact']=_0x4bd5a3[0x0];if(!_0x217d36['body'][_0xad97('0x61')])return;return db['User'][_0xad97('0x57')]({'where':{'id':_0x217d36['body'][_0xad97('0x61')],'role':'agent'},'attributes':['id',_0xad97('0x36'),'fullname',_0xad97('0x6f'),_0xad97('0x70')],'raw':!![]});}return null;})[_0xad97('0x1f')](function(_0x55393f){if(!_0x55393f)return null;_0x1480d8[_0xad97('0x28')][_0xad97('0x63')]=_0x55393f;return _0x1480d8;})[_0xad97('0x1f')](function(_0x39a581){if(_0x39a581){if(_0x217d36[_0xad97('0x59')]['manual']){_0x1480d8['message'][_0xad97('0x71')]=util['format'](_0xad97('0x72'),_0x217d36[_0xad97('0x62')][_0xad97('0x36')]);_0x1480d8['message']['channel']=_0x1480d8['channel'];_0x1480d8['message'][_0xad97('0x73')]=_0x1480d8[_0xad97('0x74')];_0x1480d8[_0xad97('0x28')][_0xad97('0x75')]='accept';return respondWithRpcPromise('EventManager',_0xad97('0x76'),{'event':'acceptmessage','message':_['merge'](_0x1480d8[_0xad97('0x28')],JSON['parse'](_0x1480d8[_0xad97('0x67')][_0xad97('0x77')]))},client9002)['then'](function(){return _0x1480d8;});}return _0x1480d8;}return null;})[_0xad97('0x1f')](respondWithResult(_0x3e8924,null))[_0xad97('0x29')](handleError(_0x3e8924,null));};var interaction_log=require(_0xad97('0x14'))(_0xad97('0x5c'));exports['reject']=function(_0x136242,_0x40a4b4,_0x324a0b){var _0x7aa8d0={'agent':{},'channel':_0xad97('0x5d')};if(_0x136242['body']['id']){delete _0x136242[_0xad97('0x59')]['id'];}_0x136242['body']['UserId']=_0x136242[_0xad97('0x59')][_0xad97('0x61')]||_0x136242[_0xad97('0x62')]['id'];_0x7aa8d0['agent']['id']=_0x136242['body'][_0xad97('0x61')];return db[_0xad97('0x4f')][_0xad97('0x57')]({'where':{'id':_0x136242['params']['id'],'UserId':null}})[_0xad97('0x1f')](handleEntityNotFound(_0x40a4b4,null))['then'](function(_0x4799c5){if(_0x4799c5){_0x7aa8d0[_0xad97('0x28')]=_0x4799c5[_0xad97('0x64')]({'plain':!![]});return db[_0xad97('0x65')][_0xad97('0x57')]({'where':{'id':_0x4799c5[_0xad97('0x78')]}});}return null;})[_0xad97('0x1f')](handleEntityNotFound(_0x40a4b4,null))[_0xad97('0x1f')](function(_0xc0d9e7){if(_0xc0d9e7){_0x7aa8d0[_0xad97('0x67')]=_0xc0d9e7[_0xad97('0x64')]({'plain':!![]});interaction_log['info'](_0xad97('0x79'),_0x136242['user']['id'],_0x136242[_0xad97('0x62')][_0xad97('0x36')],_0x136242[_0xad97('0x62')][_0xad97('0x69')],_0x7aa8d0[_0xad97('0x67')]['id'],_0x136242[_0xad97('0x59')]?JSON['stringify'](_0x136242[_0xad97('0x59')]):'null');return respondWithRpcPromise(_0xad97('0x7a'),'rejectMessage',_0x7aa8d0);}return null;})[_0xad97('0x1f')](function(_0x317fec){var _0x321f0a=_0xad97('0x7b')+_0x317fec['message']['ContactId'];return db['sequelize'][_0xad97('0x3e')](_0x321f0a,{'type':db[_0xad97('0x7c')][_0xad97('0x6e')][_0xad97('0x7d')],'raw':!![]})[_0xad97('0x1f')](function(_0x8f5157){return _0x8f5157;});})[_0xad97('0x1f')](function(_0x2a30d1){if(_0x2a30d1){_0x7aa8d0[_0xad97('0x28')][_0xad97('0x7e')]=_0x2a30d1[0x0];if(!_0x136242['body'][_0xad97('0x61')])return;return db['User'][_0xad97('0x57')]({'where':{'id':_0x136242[_0xad97('0x59')][_0xad97('0x61')],'role':_0xad97('0x63')},'attributes':['id',_0xad97('0x36'),_0xad97('0x7f'),_0xad97('0x6f'),'internal'],'raw':!![]});}return null;})[_0xad97('0x1f')](function(_0x39a815){if(!_0x39a815)return null;_0x7aa8d0[_0xad97('0x28')]['agent']=_0x39a815;return _0x7aa8d0;})[_0xad97('0x1f')](function(_0x8d839a){if(_0x8d839a){_0x8d839a[_0xad97('0x28')]['interface']=util[_0xad97('0x60')](_0xad97('0x72'),_0x136242['user'][_0xad97('0x36')]);_0x8d839a['message']['channel']=_0x7aa8d0[_0xad97('0x74')];_0x8d839a[_0xad97('0x28')][_0xad97('0x73')]=_0x7aa8d0[_0xad97('0x74')];_0x8d839a[_0xad97('0x28')][_0xad97('0x75')]='reject';respondWithRpcPromise(_0xad97('0x76'),_0xad97('0x76'),{'event':_0xad97('0x80'),'message':_[_0xad97('0x4a')](_0x7aa8d0[_0xad97('0x28')],JSON[_0xad97('0x81')](_0x7aa8d0['interaction']['formData']))},client9002);return _0x7aa8d0;}return null;})[_0xad97('0x1f')](respondWithResult(_0x40a4b4,null))[_0xad97('0x29')](handleError(_0x40a4b4,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 10c76f8..0503dbc 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 _0x61d1=['update','emit','hasOwnProperty','hook','exports','ChatMessage','setMaxListeners','save'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x61d1,0xf5));var _0x161d=function(_0x44594e,_0x1a0374){_0x44594e=_0x44594e-0x0;var _0x10af21=_0x61d1[_0x44594e];return _0x10af21;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x161d('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x161d('0x1')](0x0);var events={'afterCreate':_0x161d('0x2'),'afterUpdate':_0x161d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x31bd59){return function(_0x5e626d,_0x388fe2,_0x66ff74){ChatMessageEvents['emit'](_0x31bd59+':'+_0x5e626d['id'],_0x5e626d);ChatMessageEvents[_0x161d('0x4')](_0x31bd59,_0x5e626d);_0x66ff74(null);};}for(var e in events){if(events[_0x161d('0x5')](e)){var event=events[e];ChatMessage[_0x161d('0x6')](e,emitEvent(event));}}module[_0x161d('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x2bb8=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x4d04d6,_0x38ae19){var _0x2e937a=function(_0x4961c8){while(--_0x4961c8){_0x4d04d6['push'](_0x4d04d6['shift']());}};_0x2e937a(++_0x38ae19);}(_0x2bb8,0x13d));var _0x82bb=function(_0x45767b,_0x29551f){_0x45767b=_0x45767b-0x0;var _0x3172d5=_0x2bb8[_0x45767b];return _0x3172d5;};'use strict';var EventEmitter=require(_0x82bb('0x0'));var ChatMessage=require(_0x82bb('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x82bb('0x2')](0x0);var events={'afterCreate':_0x82bb('0x3'),'afterUpdate':_0x82bb('0x4'),'afterDestroy':_0x82bb('0x5')};function emitEvent(_0x781857){return function(_0x460f5b,_0x3fee04,_0x4003f2){ChatMessageEvents[_0x82bb('0x6')](_0x781857+':'+_0x460f5b['id'],_0x460f5b);ChatMessageEvents['emit'](_0x781857,_0x460f5b);_0x4003f2(null);};}for(var e in events){if(events[_0x82bb('0x7')](e)){var event=events[e];ChatMessage[_0x82bb('0x8')](e,emitEvent(event));}}module[_0x82bb('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 15073fa..0d80ac1 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 _0xb328=['ChatInteraction','findOne','ChatInteractionId','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x394c8b,_0x2a4219){var _0x216544=function(_0x1ea695){while(--_0x1ea695){_0x394c8b['push'](_0x394c8b['shift']());}};_0x216544(++_0x2a4219);}(_0xb328,0xcc));var _0x8b32=function(_0x4d22fd,_0x129c95){_0x4d22fd=_0x4d22fd-0x0;var _0x40045b=_0xb328[_0x4d22fd];return _0x40045b;};'use strict';var _=require(_0x8b32('0x0'));var util=require(_0x8b32('0x1'));var logger=require(_0x8b32('0x2'))('api');var moment=require(_0x8b32('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b32('0x4'));var rimraf=require(_0x8b32('0x5'));var config=require('../../config/environment');var attributes=require(_0x8b32('0x6'));module[_0x8b32('0x7')]=function(_0x12f29a,_0x1e6233){return _0x12f29a[_0x8b32('0x8')](_0x8b32('0x9'),attributes,{'tableName':_0x8b32('0xa'),'paranoid':![],'indexes':[{'name':_0x8b32('0xb'),'fields':[_0x8b32('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x171189,_0x10c4d0,_0xe0b9ac){var _0x4626ea=_0x12f29a[_0x8b32('0xd')];var _0x2e15bc=_0x171189[_0x8b32('0xe')]({'plain':!![]});if(_0x2e15bc[_0x8b32('0xf')][_0x8b32('0x10')]()==='in'||_0x2e15bc[_0x8b32('0xf')][_0x8b32('0x10')]()===_0x8b32('0x11')&&!_0x2e15bc[_0x8b32('0x12')]&&!_[_0x8b32('0x13')](_0x2e15bc['UserId'])){_0x4626ea[_0x8b32('0x14')][_0x8b32('0x15')]({'where':{'id':_0x2e15bc[_0x8b32('0x16')]}})['then'](function(_0x30c7b){if(_0x30c7b){_0x30c7b[_0x8b32('0x17')]({'lastMsgAt':_0x2e15bc[_0x8b32('0x18')],'lastMsgDirection':_0x2e15bc['direction']['toLowerCase']()});}})[_0x8b32('0x19')](function(_0x2cf03b){console['error'](_0x2cf03b);});}_0xe0b9ac();}},'charset':_0x8b32('0x1a'),'collate':_0x8b32('0x1b')});};
\ No newline at end of file
+var _0xf3c5=['FULLTEXT','get','toLowerCase','direction','out','secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body'];(function(_0x228dac,_0x456312){var _0x1d3708=function(_0x4d850b){while(--_0x4d850b){_0x228dac['push'](_0x228dac['shift']());}};_0x1d3708(++_0x456312);}(_0xf3c5,0x178));var _0x5f3c=function(_0x1cfba1,_0xceafc){_0x1cfba1=_0x1cfba1-0x0;var _0x4fd6aa=_0xf3c5[_0x1cfba1];return _0x4fd6aa;};'use strict';var _=require(_0x5f3c('0x0'));var util=require(_0x5f3c('0x1'));var logger=require(_0x5f3c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5f3c('0x3'));var rp=require(_0x5f3c('0x4'));var fs=require('fs');var path=require(_0x5f3c('0x5'));var rimraf=require(_0x5f3c('0x6'));var config=require(_0x5f3c('0x7'));var attributes=require('./chatMessage.attributes');module[_0x5f3c('0x8')]=function(_0x44055b,_0x95f1bb){return _0x44055b[_0x5f3c('0x9')](_0x5f3c('0xa'),attributes,{'tableName':_0x5f3c('0xb'),'paranoid':![],'indexes':[{'name':_0x5f3c('0xc'),'fields':[_0x5f3c('0xd')],'type':_0x5f3c('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e6dfb,_0x2c9a95,_0xf79496){var _0x8fd044=_0x44055b['models'];var _0x5ab8c3=_0x2e6dfb[_0x5f3c('0xf')]({'plain':!![]});if(_0x5ab8c3['direction'][_0x5f3c('0x10')]()==='in'||_0x5ab8c3[_0x5f3c('0x11')][_0x5f3c('0x10')]()===_0x5f3c('0x12')&&!_0x5ab8c3[_0x5f3c('0x13')]&&!_[_0x5f3c('0x14')](_0x5ab8c3[_0x5f3c('0x15')])){_0x8fd044[_0x5f3c('0x16')][_0x5f3c('0x17')]({'where':{'id':_0x5ab8c3['ChatInteractionId']}})[_0x5f3c('0x18')](function(_0x546a8a){if(_0x546a8a){_0x546a8a[_0x5f3c('0x19')]({'lastMsgAt':_0x5ab8c3[_0x5f3c('0x1a')],'lastMsgDirection':_0x5ab8c3[_0x5f3c('0x11')][_0x5f3c('0x10')]()});}})[_0x5f3c('0x1b')](function(_0x4f1c94){console['error'](_0x4f1c94);});}_0xf79496();}},'charset':_0x5f3c('0x1c'),'collate':_0x5f3c('0x1d')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index fea55a2..e9dc93e 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 _0x407b=['options','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0x407b,0x1a2));var _0xb407=function(_0x1408ee,_0x175ac9){_0x1408ee=_0x1408ee-0x0;var _0x4e1a95=_0x407b[_0x1408ee];return _0x4e1a95;};'use strict';var _=require(_0xb407('0x0'));var util=require(_0xb407('0x1'));var moment=require('moment');var BPromise=require(_0xb407('0x2'));var rs=require(_0xb407('0x3'));var fs=require('fs');var Redis=require(_0xb407('0x4'));var db=require(_0xb407('0x5'))['db'];var utils=require(_0xb407('0x6'));var logger=require(_0xb407('0x7'))(_0xb407('0x8'));var config=require('../../config/environment');var jayson=require(_0xb407('0x9'));var client=jayson[_0xb407('0xa')][_0xb407('0xb')]({'port':0x232a});config[_0xb407('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb407('0xd'))(new Redis(config[_0xb407('0xc')]));require('./chatMessage.socket')[_0xb407('0xe')](socket);function respondWithRpcPromise(_0x57f177,_0x184c38,_0xd65be7){return new BPromise(function(_0x3d8d8e,_0x35ea8f){return client[_0xb407('0xf')](_0x57f177,_0xd65be7)[_0xb407('0x10')](function(_0x501d35){logger[_0xb407('0x11')]('ChatMessage,\x20%s,\x20%s',_0x184c38,_0xb407('0x12'));logger['debug'](_0xb407('0x13'),_0x184c38,_0xb407('0x12'),JSON[_0xb407('0x14')](_0x501d35));if(_0x501d35[_0xb407('0x15')]){if(_0x501d35[_0xb407('0x15')][_0xb407('0x16')]===0x1f4){logger[_0xb407('0x15')](_0xb407('0x17'),_0x184c38,_0x501d35[_0xb407('0x15')][_0xb407('0x18')]);return _0x35ea8f(_0x501d35[_0xb407('0x15')][_0xb407('0x18')]);}logger['error'](_0xb407('0x17'),_0x184c38,_0x501d35[_0xb407('0x15')][_0xb407('0x18')]);return _0x3d8d8e(_0x501d35[_0xb407('0x15')][_0xb407('0x18')]);}else{logger[_0xb407('0x11')](_0xb407('0x17'),_0x184c38,'request\x20sent');_0x3d8d8e(_0x501d35[_0xb407('0x19')][_0xb407('0x18')]);}})[_0xb407('0x1a')](function(_0x46af14){logger[_0xb407('0x15')](_0xb407('0x17'),_0x184c38,_0x46af14);_0x35ea8f(_0x46af14);});});}exports[_0xb407('0x1b')]=function(_0x445006){var _0x34bf0f=this;return new Promise(function(_0x2101d0,_0x229683){return db[_0xb407('0x1c')][_0xb407('0x1d')](_0x445006['body'],{'raw':_0x445006[_0xb407('0x1e')]?_0x445006[_0xb407('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xb407('0x10')](function(_0x3e71fe){logger[_0xb407('0x11')](_0xb407('0x1b'),_0x445006);logger[_0xb407('0x1f')](_0xb407('0x1b'),_0x445006,JSON[_0xb407('0x14')](_0x3e71fe));_0x2101d0(_0x3e71fe);})['catch'](function(_0x4acef2){logger[_0xb407('0x15')]('CreateChatMessage',_0x4acef2['message'],_0x445006);_0x229683(_0x34bf0f[_0xb407('0x15')](0x1f4,_0x4acef2['message']));});});};
\ No newline at end of file
+var _0xc1c6=['defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x21e6a6,_0x2ad980){_0x21e6a6=_0x21e6a6-0x0;var _0x1d2357=_0xc1c6[_0x21e6a6];return _0x1d2357;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});config['redis']=_[_0x6c1c('0x9')](config[_0x6c1c('0xa')],{'host':_0x6c1c('0xb'),'port':0x18eb});var socket=require(_0x6c1c('0xc'))(new Redis(config['redis']));require(_0x6c1c('0xd'))[_0x6c1c('0xe')](socket);function respondWithRpcPromise(_0x524d21,_0x147c7b,_0x36275f){return new BPromise(function(_0xb3bd12,_0x1137e8){return client['request'](_0x524d21,_0x36275f)[_0x6c1c('0xf')](function(_0x2a4fd4){logger[_0x6c1c('0x10')]('ChatMessage,\x20%s,\x20%s',_0x147c7b,_0x6c1c('0x11'));logger[_0x6c1c('0x12')](_0x6c1c('0x13'),_0x147c7b,'request\x20sent',JSON[_0x6c1c('0x14')](_0x2a4fd4));if(_0x2a4fd4['error']){if(_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x16')]===0x1f4){logger[_0x6c1c('0x15')](_0x6c1c('0x17'),_0x147c7b,_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);return _0x1137e8(_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);}logger[_0x6c1c('0x15')]('ChatMessage,\x20%s,\x20%s',_0x147c7b,_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);return _0xb3bd12(_0x2a4fd4['error'][_0x6c1c('0x18')]);}else{logger[_0x6c1c('0x10')]('ChatMessage,\x20%s,\x20%s',_0x147c7b,_0x6c1c('0x11'));_0xb3bd12(_0x2a4fd4['result'][_0x6c1c('0x18')]);}})[_0x6c1c('0x19')](function(_0x5a3bb7){logger[_0x6c1c('0x15')]('ChatMessage,\x20%s,\x20%s',_0x147c7b,_0x5a3bb7);_0x1137e8(_0x5a3bb7);});});}exports[_0x6c1c('0x1a')]=function(_0x3527bf){var _0x23470e=this;return new Promise(function(_0x211f49,_0x1acf7f){return db[_0x6c1c('0x1b')][_0x6c1c('0x1c')](_0x3527bf[_0x6c1c('0x1d')],{'raw':_0x3527bf[_0x6c1c('0x1e')]?_0x3527bf[_0x6c1c('0x1e')][_0x6c1c('0x1f')]===undefined?!![]:![]:!![]})[_0x6c1c('0xf')](function(_0x2382c0){logger[_0x6c1c('0x10')](_0x6c1c('0x1a'),_0x3527bf);logger[_0x6c1c('0x12')](_0x6c1c('0x1a'),_0x3527bf,JSON[_0x6c1c('0x14')](_0x2382c0));_0x211f49(_0x2382c0);})[_0x6c1c('0x19')](function(_0x1dba08){logger[_0x6c1c('0x15')](_0x6c1c('0x1a'),_0x1dba08[_0x6c1c('0x18')],_0x3527bf);_0x1acf7f(_0x23470e[_0x6c1c('0x15')](0x1f4,_0x1dba08[_0x6c1c('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 2fef56a..8f6a151 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 _0x3c94=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x155a9b,_0x196d07){var _0x43deca=function(_0x53a5f1){while(--_0x53a5f1){_0x155a9b['push'](_0x155a9b['shift']());}};_0x43deca(++_0x196d07);}(_0x3c94,0xcd));var _0x43c9=function(_0x1b5aea,_0x1afe6f){_0x1b5aea=_0x1b5aea-0x0;var _0x51cae9=_0x3c94[_0x1b5aea];return _0x51cae9;};'use strict';var ChatMessageEvents=require(_0x43c9('0x0'));var events=[_0x43c9('0x1'),_0x43c9('0x2'),_0x43c9('0x3')];function createListener(_0x188507,_0x2da73f){return function(_0xe05adb){_0x2da73f[_0x43c9('0x4')](_0x188507,_0xe05adb);};}function removeListener(_0x170a0d,_0x44fc3){return function(){ChatMessageEvents[_0x43c9('0x5')](_0x170a0d,_0x44fc3);};}exports[_0x43c9('0x6')]=function(_0x4fdfc2){for(var _0x39c220=0x0,_0xf03007=events[_0x43c9('0x7')];_0x39c220<_0xf03007;_0x39c220++){var _0x37c029=events[_0x39c220];var _0x383adb=createListener(_0x43c9('0x8')+_0x37c029,_0x4fdfc2);ChatMessageEvents['on'](_0x37c029,_0x383adb);}};
\ No newline at end of file
+var _0x950a=['chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x950a,0x111));var _0xa950=function(_0x3f8353,_0x493caa){_0x3f8353=_0x3f8353-0x0;var _0x513881=_0x950a[_0x3f8353];return _0x513881;};'use strict';var ChatMessageEvents=require(_0xa950('0x0'));var events=[_0xa950('0x1'),_0xa950('0x2'),_0xa950('0x3')];function createListener(_0x5569f7,_0x305b26){return function(_0xa583df){_0x305b26[_0xa950('0x4')](_0x5569f7,_0xa583df);};}function removeListener(_0x2c80ed,_0x5cd4aa){return function(){ChatMessageEvents[_0xa950('0x5')](_0x2c80ed,_0x5cd4aa);};}exports[_0xa950('0x6')]=function(_0x512c0e){for(var _0x14b4ac=0x0,_0x3645b6=events['length'];_0x14b4ac<_0x3645b6;_0x14b4ac++){var _0x5675f8=events[_0x14b4ac];var _0x26e05c=createListener(_0xa950('0x7')+_0x5675f8,_0x512c0e);ChatMessageEvents['on'](_0x5675f8,_0x26e05c);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 416fb5c..65146d6 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 _0xa3cd=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','isAuthenticated','describe','get','post','tracked','chatmessage:create','create','/:id','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy'];(function(_0x217483,_0x422422){var _0x37f8a4=function(_0x7639ac){while(--_0x7639ac){_0x217483['push'](_0x217483['shift']());}};_0x37f8a4(++_0x422422);}(_0xa3cd,0x6c));var _0xda3c=function(_0xcf88e3,_0x1bdfd2){_0xcf88e3=_0xcf88e3-0x0;var _0x575673=_0xa3cd[_0xcf88e3];return _0x575673;};'use strict';var multer=require(_0xda3c('0x0'));var util=require(_0xda3c('0x1'));var path=require('path');var timeout=require(_0xda3c('0x2'));var express=require(_0xda3c('0x3'));var router=express[_0xda3c('0x4')]();var fs_extra=require(_0xda3c('0x5'));var auth=require(_0xda3c('0x6'));var interaction=require(_0xda3c('0x7'));var config=require(_0xda3c('0x8'));var controller=require(_0xda3c('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xda3c('0xa')]);router['get']('/describe',auth[_0xda3c('0xb')](),controller[_0xda3c('0xc')]);router[_0xda3c('0xd')]('/:id',auth[_0xda3c('0xb')](),controller['show']);router[_0xda3c('0xe')]('/',auth[_0xda3c('0xb')](),interaction[_0xda3c('0xf')]('chat',_0xda3c('0x10')),controller[_0xda3c('0x11')]);router['put'](_0xda3c('0x12'),controller[_0xda3c('0x13')]);router[_0xda3c('0x14')](_0xda3c('0x15'),auth[_0xda3c('0xb')](),controller[_0xda3c('0x16')]);router[_0xda3c('0x14')](_0xda3c('0x17'),auth[_0xda3c('0xb')](),controller[_0xda3c('0x18')]);router[_0xda3c('0x19')]('/:id',auth[_0xda3c('0xb')](),controller[_0xda3c('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0xf245=['tracked','chat','chatmessage:create','put','update','/:id/reject','reject','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x1289a6,_0x4b4b17){var _0x3cd965=function(_0xc721d3){while(--_0xc721d3){_0x1289a6['push'](_0x1289a6['shift']());}};_0x3cd965(++_0x4b4b17);}(_0xf245,0x1ad));var _0x5f24=function(_0x154940,_0x4a448a){_0x154940=_0x154940-0x0;var _0x401409=_0xf245[_0x154940];return _0x401409;};'use strict';var multer=require(_0x5f24('0x0'));var util=require(_0x5f24('0x1'));var path=require('path');var timeout=require(_0x5f24('0x2'));var express=require('express');var router=express[_0x5f24('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5f24('0x4'));var config=require('../../config/environment');var controller=require(_0x5f24('0x5'));router[_0x5f24('0x6')]('/',auth[_0x5f24('0x7')](),controller[_0x5f24('0x8')]);router[_0x5f24('0x6')]('/describe',auth[_0x5f24('0x7')](),controller['describe']);router[_0x5f24('0x6')](_0x5f24('0x9'),auth[_0x5f24('0x7')](),controller[_0x5f24('0xa')]);router[_0x5f24('0xb')]('/',auth['isAuthenticated'](),interaction[_0x5f24('0xc')](_0x5f24('0xd'),_0x5f24('0xe')),controller['create']);router[_0x5f24('0xf')](_0x5f24('0x9'),controller[_0x5f24('0x10')]);router['put']('/:id/accept',auth[_0x5f24('0x7')](),controller['accept']);router[_0x5f24('0xf')](_0x5f24('0x11'),auth[_0x5f24('0x7')](),controller[_0x5f24('0x12')]);router['delete'](_0x5f24('0x9'),auth[_0x5f24('0x7')](),controller[_0x5f24('0x13')]);module[_0x5f24('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 36063f8..3f6dff9 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 _0x3728=['medium','exports'];(function(_0xb1cd92,_0x49dbfa){var _0x1cb782=function(_0x690a5e){while(--_0x690a5e){_0xb1cd92['push'](_0xb1cd92['shift']());}};_0x1cb782(++_0x49dbfa);}(_0x3728,0x16d));var _0x8372=function(_0x9b6377,_0x4d64ac){_0x9b6377=_0x9b6377-0x0;var _0x305473=_0x3728[_0x9b6377];return _0x305473;};'use strict';var Sequelize=require('sequelize');module[_0x8372('0x0')]={'body':{'type':Sequelize['TEXT'](_0x8372('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x967a=['sequelize','exports','TEXT','medium'];(function(_0xaadddb,_0x2e5965){var _0x5c9ba2=function(_0x12802a){while(--_0x12802a){_0xaadddb['push'](_0xaadddb['shift']());}};_0x5c9ba2(++_0x2e5965);}(_0x967a,0x160));var _0xa967=function(_0x3d0efa,_0x10915d){_0x3d0efa=_0x3d0efa-0x0;var _0x4df027=_0x967a[_0x3d0efa];return _0x4df027;};'use strict';var Sequelize=require(_0xa967('0x0'));module[_0xa967('0x1')]={'body':{'type':Sequelize[_0xa967('0x2')](_0xa967('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 7761ac9..e0acb77 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x4cea3a,_0x5f56ef){var _0x24cd85=function(_0x308dc7){while(--_0x308dc7){_0x4cea3a['push'](_0x4cea3a['shift']());}};_0x24cd85(++_0x5f56ef);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _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(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x7a54,0x106));var _0x47a5=function(_0x4c2765,_0x39389f){_0x4c2765=_0x4c2765-0x0;var _0x5f1ed3=_0x7a54[_0x4c2765];return _0x5f1ed3;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 6150e33..5ec12e5 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 _0xf1c3=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf1c3,0x12b));var _0x3f1c=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xf1c3[_0x9dfc10];return _0x4f938a;};'use strict';var _=require('lodash');var util=require(_0x3f1c('0x0'));var logger=require(_0x3f1c('0x1'))(_0x3f1c('0x2'));var moment=require(_0x3f1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x3f1c('0x4'));var fs=require('fs');var path=require(_0x3f1c('0x5'));var rimraf=require(_0x3f1c('0x6'));var config=require(_0x3f1c('0x7'));var attributes=require('./chatOfflineMessage.attributes');module[_0x3f1c('0x8')]=function(_0x1c0bd9,_0x36eaca){return _0x1c0bd9[_0x3f1c('0x9')](_0x3f1c('0xa'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3f1c('0xb'),'collate':_0x3f1c('0xc')});};
\ No newline at end of file
+var _0x82f4=['define','chat_offline_messages','utf8mb4','lodash','util','api','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x82f4,0x142));var _0x482f=function(_0x673d68,_0x115d89){_0x673d68=_0x673d68-0x0;var _0x51b40b=_0x82f4[_0x673d68];return _0x51b40b;};'use strict';var _=require(_0x482f('0x0'));var util=require(_0x482f('0x1'));var logger=require('../../config/logger')(_0x482f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x482f('0x3'));var fs=require('fs');var path=require(_0x482f('0x4'));var rimraf=require(_0x482f('0x5'));var config=require('../../config/environment');var attributes=require(_0x482f('0x6'));module[_0x482f('0x7')]=function(_0x2afbe6,_0x3023ba){return _0x2afbe6[_0x482f('0x8')]('ChatOfflineMessage',attributes,{'tableName':_0x482f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x482f('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 0e89be1..497a330 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 _0xb926=['../../config/logger','rpc','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x1a8b0b,_0x3c5346){var _0x5d5fdb=function(_0x12b1b6){while(--_0x12b1b6){_0x1a8b0b['push'](_0x1a8b0b['shift']());}};_0x5d5fdb(++_0x3c5346);}(_0xb926,0x83));var _0x6b92=function(_0x214efd,_0x3cd6c9){_0x214efd=_0x214efd-0x0;var _0x524cc6=_0xb926[_0x214efd];return _0x524cc6;};'use strict';var _=require(_0x6b92('0x0'));var util=require(_0x6b92('0x1'));var moment=require(_0x6b92('0x2'));var BPromise=require(_0x6b92('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b92('0x4'));var db=require(_0x6b92('0x5'))['db'];var utils=require(_0x6b92('0x6'));var logger=require(_0x6b92('0x7'))(_0x6b92('0x8'));var config=require('../../config/environment');var jayson=require(_0x6b92('0x9'));var client=jayson[_0x6b92('0xa')][_0x6b92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c93ee,_0x4d69ea,_0x530be8){return new BPromise(function(_0x2e420c,_0x16b0df){return client[_0x6b92('0xc')](_0x3c93ee,_0x530be8)['then'](function(_0xf59d20){logger[_0x6b92('0xd')](_0x6b92('0xe'),_0x4d69ea,_0x6b92('0xf'));logger[_0x6b92('0x10')](_0x6b92('0x11'),_0x4d69ea,_0x6b92('0xf'),JSON[_0x6b92('0x12')](_0xf59d20));if(_0xf59d20[_0x6b92('0x13')]){if(_0xf59d20[_0x6b92('0x13')][_0x6b92('0x14')]===0x1f4){logger[_0x6b92('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4d69ea,_0xf59d20[_0x6b92('0x13')][_0x6b92('0x15')]);return _0x16b0df(_0xf59d20[_0x6b92('0x13')][_0x6b92('0x15')]);}logger[_0x6b92('0x13')](_0x6b92('0xe'),_0x4d69ea,_0xf59d20['error'][_0x6b92('0x15')]);return _0x2e420c(_0xf59d20[_0x6b92('0x13')][_0x6b92('0x15')]);}else{logger[_0x6b92('0xd')](_0x6b92('0xe'),_0x4d69ea,_0x6b92('0xf'));_0x2e420c(_0xf59d20['result'][_0x6b92('0x15')]);}})[_0x6b92('0x16')](function(_0x1feb5f){logger[_0x6b92('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4d69ea,_0x1feb5f);_0x16b0df(_0x1feb5f);});});}
\ No newline at end of file
+var _0x448a=['../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','randomstring','../../config/utils','../../config/logger'];(function(_0x1411a2,_0x1e9aab){var _0x3adb9b=function(_0x1eb6bc){while(--_0x1eb6bc){_0x1411a2['push'](_0x1411a2['shift']());}};_0x3adb9b(++_0x1e9aab);}(_0x448a,0x1ef));var _0xa448=function(_0x3bb2e6,_0x204bff){_0x3bb2e6=_0x3bb2e6-0x0;var _0x25f839=_0x448a[_0x3bb2e6];return _0x25f839;};'use strict';var _=require('lodash');var util=require(_0xa448('0x0'));var moment=require(_0xa448('0x1'));var BPromise=require('bluebird');var rs=require(_0xa448('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa448('0x3'));var logger=require(_0xa448('0x4'))('rpc');var config=require(_0xa448('0x5'));var jayson=require(_0xa448('0x6'));var client=jayson[_0xa448('0x7')][_0xa448('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12b0e2,_0x1f4749,_0x1ec2d8){return new BPromise(function(_0x54bdb0,_0x5df2c1){return client[_0xa448('0x9')](_0x12b0e2,_0x1ec2d8)[_0xa448('0xa')](function(_0x40006c){logger[_0xa448('0xb')](_0xa448('0xc'),_0x1f4749,_0xa448('0xd'));logger[_0xa448('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1f4749,'request\x20sent',JSON[_0xa448('0xf')](_0x40006c));if(_0x40006c[_0xa448('0x10')]){if(_0x40006c['error'][_0xa448('0x11')]===0x1f4){logger[_0xa448('0x10')](_0xa448('0xc'),_0x1f4749,_0x40006c[_0xa448('0x10')][_0xa448('0x12')]);return _0x5df2c1(_0x40006c[_0xa448('0x10')][_0xa448('0x12')]);}logger[_0xa448('0x10')](_0xa448('0xc'),_0x1f4749,_0x40006c['error']['message']);return _0x54bdb0(_0x40006c[_0xa448('0x10')][_0xa448('0x12')]);}else{logger[_0xa448('0xb')](_0xa448('0xc'),_0x1f4749,_0xa448('0xd'));_0x54bdb0(_0x40006c[_0xa448('0x13')]['message']);}})['catch'](function(_0x5b8899){logger['error'](_0xa448('0xc'),_0x1f4749,_0x5b8899);_0x5df2c1(_0x5b8899);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 319889f..8433420 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 _0x0256=['exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','/:id','post','create','update','delete','destroy'];(function(_0x1282d5,_0x3f4224){var _0x5590de=function(_0x2e9126){while(--_0x2e9126){_0x1282d5['push'](_0x1282d5['shift']());}};_0x5590de(++_0x3f4224);}(_0x0256,0xf1));var _0x6025=function(_0x1fd0d5,_0x3cb655){_0x1fd0d5=_0x1fd0d5-0x0;var _0x57d242=_0x0256[_0x1fd0d5];return _0x57d242;};'use strict';var multer=require(_0x6025('0x0'));var util=require(_0x6025('0x1'));var path=require(_0x6025('0x2'));var timeout=require('connect-timeout');var express=require(_0x6025('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6025('0x4'));var interaction=require(_0x6025('0x5'));var config=require('../../config/environment');var controller=require(_0x6025('0x6'));router[_0x6025('0x7')]('/',auth[_0x6025('0x8')](),controller['index']);router[_0x6025('0x7')]('/describe',auth[_0x6025('0x8')](),controller['describe']);router[_0x6025('0x7')](_0x6025('0x9'),auth[_0x6025('0x8')](),controller['show']);router[_0x6025('0xa')]('/',auth[_0x6025('0x8')](),controller[_0x6025('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6025('0xc')]);router[_0x6025('0xd')](_0x6025('0x9'),auth[_0x6025('0x8')](),controller[_0x6025('0xe')]);module[_0x6025('0xf')]=router;
\ No newline at end of file
+var _0x26be=['delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','index','describe','get','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x228c67,_0x561a54){var _0x9f7b85=function(_0x251008){while(--_0x251008){_0x228c67['push'](_0x228c67['shift']());}};_0x9f7b85(++_0x561a54);}(_0x26be,0xd4));var _0xe26b=function(_0x6ee0af,_0x55ca08){_0x6ee0af=_0x6ee0af-0x0;var _0x3047dc=_0x26be[_0x6ee0af];return _0x3047dc;};'use strict';var multer=require(_0xe26b('0x0'));var util=require('util');var path=require(_0xe26b('0x1'));var timeout=require(_0xe26b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe26b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xe26b('0x4'));var controller=require(_0xe26b('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xe26b('0x6')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xe26b('0x7')]);router[_0xe26b('0x8')](_0xe26b('0x9'),auth[_0xe26b('0xa')](),controller[_0xe26b('0xb')]);router[_0xe26b('0xc')]('/',auth[_0xe26b('0xa')](),controller[_0xe26b('0xd')]);router[_0xe26b('0xe')]('/:id',auth[_0xe26b('0xa')](),controller[_0xe26b('0xf')]);router[_0xe26b('0x10')](_0xe26b('0x9'),auth[_0xe26b('0xa')](),controller[_0xe26b('0x11')]);module[_0xe26b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index b4d9890..f984d52 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 _0x3af9=['INTEGER','sequelize','exports','ENUM','mouseOver','timeout','STRING'];(function(_0x3c198a,_0x3246d4){var _0x1a455c=function(_0x5e74e2){while(--_0x5e74e2){_0x3c198a['push'](_0x3c198a['shift']());}};_0x1a455c(++_0x3246d4);}(_0x3af9,0xa9));var _0x93af=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3af9[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x93af('0x0'));module[_0x93af('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x93af('0x2')](_0x93af('0x3'),_0x93af('0x4')),'defaultValue':_0x93af('0x3')},'selector':{'type':Sequelize[_0x93af('0x5')]},'timeout':{'type':Sequelize[_0x93af('0x6')]}};
\ No newline at end of file
+var _0xfa6a=['mouseOver','timeout','sequelize','exports','STRING'];(function(_0xb9dcf0,_0x3d46bf){var _0x156afb=function(_0x237b64){while(--_0x237b64){_0xb9dcf0['push'](_0xb9dcf0['shift']());}};_0x156afb(++_0x3d46bf);}(_0xfa6a,0x13d));var _0xafa6=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xfa6a[_0x819464];return _0x49dcc0;};'use strict';var Sequelize=require(_0xafa6('0x0'));module[_0xafa6('0x1')]={'name':{'type':Sequelize[_0xafa6('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xafa6('0x3'),_0xafa6('0x4')),'defaultValue':_0xafa6('0x3')},'selector':{'type':Sequelize[_0xafa6('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 5286250..af10b62 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 _0x34aa=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','show','params','keys','ChatProactiveAction','query','intersection','model','attributes','fields','length','includeAll','include','merge','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x1835e1,_0x519a22){var _0x3dbd85=function(_0x2c6f84){while(--_0x2c6f84){_0x1835e1['push'](_0x1835e1['shift']());}};_0x3dbd85(++_0x519a22);}(_0x34aa,0x171));var _0xa34a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x34aa[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xa34a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa34a('0x1'));var jsonpatch=require(_0xa34a('0x2'));var rp=require(_0xa34a('0x3'));var moment=require(_0xa34a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa34a('0x5'));var util=require(_0xa34a('0x6'));var path=require(_0xa34a('0x7'));var sox=require(_0xa34a('0x8'));var csv=require(_0xa34a('0x9'));var ejs=require(_0xa34a('0xa'));var fs=require('fs');var fs_extra=require(_0xa34a('0xb'));var _=require(_0xa34a('0xc'));var squel=require(_0xa34a('0xd'));var crypto=require(_0xa34a('0xe'));var jsforce=require(_0xa34a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa34a('0x9'));var querystring=require(_0xa34a('0x10'));var Papa=require(_0xa34a('0x11'));var Redis=require(_0xa34a('0x12'));var authService=require(_0xa34a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa34a('0x14'));var hardwareService=require(_0xa34a('0x15'));var logger=require(_0xa34a('0x16'))(_0xa34a('0x17'));var utils=require(_0xa34a('0x18'));var config=require(_0xa34a('0x19'));var licenseUtil=require(_0xa34a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3145e9,_0x33e150){_0x33e150=_0x33e150||0xcc;return function(_0x1c2972){if(_0x1c2972){return _0x3145e9['sendStatus'](_0x33e150);}return _0x3145e9[_0xa34a('0x1b')](_0x33e150)[_0xa34a('0x1c')]();};}function respondWithResult(_0x525eff,_0x2f5ded){_0x2f5ded=_0x2f5ded||0xc8;return function(_0x3d5926){if(_0x3d5926){return _0x525eff['status'](_0x2f5ded)[_0xa34a('0x1d')](_0x3d5926);}};}function respondWithFilteredResult(_0x7ac9a2,_0x19580a){return function(_0xfd0d79){if(_0xfd0d79){var _0x41b9bb=typeof _0x19580a['offset']===_0xa34a('0x1e')&&typeof _0x19580a['limit']===_0xa34a('0x1e');var _0x14837d=_0xfd0d79[_0xa34a('0x1f')];var _0x181dcc=_0x41b9bb?0x0:_0x19580a['offset'];var _0x27ad19=_0x41b9bb?_0xfd0d79[_0xa34a('0x1f')]:_0x19580a[_0xa34a('0x20')]+_0x19580a[_0xa34a('0x21')];var _0xaa360e;if(_0x27ad19>=_0x14837d){_0x27ad19=_0x14837d;_0xaa360e=0xc8;}else{_0xaa360e=0xce;}_0x7ac9a2['status'](_0xaa360e);return _0x7ac9a2[_0xa34a('0x22')](_0xa34a('0x23'),_0x181dcc+'-'+_0x27ad19+'/'+_0x14837d)[_0xa34a('0x1d')](_0xfd0d79);}return null;};}function patchUpdates(_0x5a641c){return function(_0x14a18b){try{jsonpatch[_0xa34a('0x24')](_0x14a18b,_0x5a641c,!![]);}catch(_0x36749d){return BPromise[_0xa34a('0x25')](_0x36749d);}return _0x14a18b[_0xa34a('0x26')]();};}function saveUpdates(_0x14e24c,_0x4f9342){return function(_0x28249a){if(_0x28249a){return _0x28249a[_0xa34a('0x27')](_0x14e24c)['then'](function(_0x13135a){return _0x13135a;});}return null;};}function removeEntity(_0x377c4a,_0x746078){return function(_0x254b75){if(_0x254b75){return _0x254b75[_0xa34a('0x28')]()[_0xa34a('0x29')](function(){_0x377c4a[_0xa34a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x351b9e,_0xb314d2){return function(_0x473c15){if(!_0x473c15){_0x351b9e[_0xa34a('0x2a')](0x194);}return _0x473c15;};}function handleError(_0x502b4d,_0x1ab30a){_0x1ab30a=_0x1ab30a||0x1f4;return function(_0x7ecf44){logger[_0xa34a('0x2b')](_0x7ecf44[_0xa34a('0x2c')]);if(_0x7ecf44['name']){delete _0x7ecf44[_0xa34a('0x2d')];}_0x502b4d[_0xa34a('0x1b')](_0x1ab30a)[_0xa34a('0x2e')](_0x7ecf44);};}exports[_0xa34a('0x2f')]=function(_0x48e428,_0x2b03a7){var _0x82350e={'raw':!![],'where':{'id':_0x48e428[_0xa34a('0x30')]['id']}},_0x196681={};_0x196681['model']=_[_0xa34a('0x31')](db[_0xa34a('0x32')]['rawAttributes']);_0x196681[_0xa34a('0x33')]=_[_0xa34a('0x31')](_0x48e428['query']);_0x196681['filters']=_[_0xa34a('0x34')](_0x196681[_0xa34a('0x35')],_0x196681[_0xa34a('0x33')]);_0x82350e[_0xa34a('0x36')]=_[_0xa34a('0x34')](_0x196681[_0xa34a('0x35')],qs['fields'](_0x48e428[_0xa34a('0x33')][_0xa34a('0x37')]));_0x82350e['attributes']=_0x82350e[_0xa34a('0x36')][_0xa34a('0x38')]?_0x82350e[_0xa34a('0x36')]:_0x196681[_0xa34a('0x35')];if(_0x48e428['query'][_0xa34a('0x39')]){_0x82350e[_0xa34a('0x3a')]=[{'all':!![]}];}_0x82350e=_[_0xa34a('0x3b')]({},_0x82350e,_0x48e428['options']);return db[_0xa34a('0x32')][_0xa34a('0x3c')](_0x82350e)[_0xa34a('0x29')](handleEntityNotFound(_0x2b03a7,null))[_0xa34a('0x29')](respondWithResult(_0x2b03a7,null))[_0xa34a('0x3d')](handleError(_0x2b03a7,null));};exports[_0xa34a('0x3e')]=function(_0x50fa82,_0x4c7a6e){return db['ChatProactiveAction'][_0xa34a('0x3e')](_0x50fa82[_0xa34a('0x3f')],{})[_0xa34a('0x29')](respondWithResult(_0x4c7a6e,0xc9))[_0xa34a('0x3d')](handleError(_0x4c7a6e,null));};exports[_0xa34a('0x27')]=function(_0xc74618,_0x58b8ba){if(_0xc74618[_0xa34a('0x3f')]['id']){delete _0xc74618[_0xa34a('0x3f')]['id'];}return db[_0xa34a('0x32')][_0xa34a('0x3c')]({'where':{'id':_0xc74618[_0xa34a('0x30')]['id']}})[_0xa34a('0x29')](handleEntityNotFound(_0x58b8ba,null))['then'](saveUpdates(_0xc74618[_0xa34a('0x3f')],null))[_0xa34a('0x29')](respondWithResult(_0x58b8ba,null))['catch'](handleError(_0x58b8ba,null));};exports[_0xa34a('0x28')]=function(_0x53f4a4,_0x41a4d5){return db[_0xa34a('0x32')][_0xa34a('0x3c')]({'where':{'id':_0x53f4a4[_0xa34a('0x30')]['id']}})[_0xa34a('0x29')](handleEntityNotFound(_0x41a4d5,null))[_0xa34a('0x29')](removeEntity(_0x41a4d5,null))[_0xa34a('0x3d')](handleError(_0x41a4d5,null));};
\ No newline at end of file
+var _0x36bb=['status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','show','model','ChatProactiveAction','rawAttributes','keys','query','filters','intersection','attributes','fields','length','merge','options','catch','create','body','params','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x45c957,_0x276317){var _0x1bf7f4=function(_0x51688b){while(--_0x51688b){_0x45c957['push'](_0x45c957['shift']());}};_0x1bf7f4(++_0x276317);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb36b('0x0'));var rimraf=require(_0xb36b('0x1'));var zipdir=require(_0xb36b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb36b('0x3'));var moment=require(_0xb36b('0x4'));var BPromise=require(_0xb36b('0x5'));var Mustache=require(_0xb36b('0x6'));var util=require(_0xb36b('0x7'));var path=require(_0xb36b('0x8'));var sox=require(_0xb36b('0x9'));var csv=require(_0xb36b('0xa'));var ejs=require(_0xb36b('0xb'));var fs=require('fs');var fs_extra=require(_0xb36b('0xc'));var _=require(_0xb36b('0xd'));var squel=require(_0xb36b('0xe'));var crypto=require(_0xb36b('0xf'));var jsforce=require(_0xb36b('0x10'));var deskjs=require(_0xb36b('0x11'));var toCsv=require(_0xb36b('0xa'));var querystring=require(_0xb36b('0x12'));var Papa=require(_0xb36b('0x13'));var Redis=require(_0xb36b('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xb36b('0x15'));var as=require(_0xb36b('0x16'));var hardwareService=require(_0xb36b('0x17'));var logger=require('../../config/logger')(_0xb36b('0x18'));var utils=require(_0xb36b('0x19'));var config=require(_0xb36b('0x1a'));var licenseUtil=require(_0xb36b('0x1b'));var db=require(_0xb36b('0x1c'))['db'];function respondWithStatusCode(_0x11f775,_0x1ad623){_0x1ad623=_0x1ad623||0xcc;return function(_0x1c266a){if(_0x1c266a){return _0x11f775[_0xb36b('0x1d')](_0x1ad623);}return _0x11f775[_0xb36b('0x1e')](_0x1ad623)[_0xb36b('0x1f')]();};}function respondWithResult(_0x59af21,_0x1aef0b){_0x1aef0b=_0x1aef0b||0xc8;return function(_0x4c2c46){if(_0x4c2c46){return _0x59af21['status'](_0x1aef0b)[_0xb36b('0x20')](_0x4c2c46);}};}function respondWithFilteredResult(_0x329f60,_0x23e960){return function(_0x4b74f1){if(_0x4b74f1){var _0x5c7255=typeof _0x23e960[_0xb36b('0x21')]==='undefined'&&typeof _0x23e960[_0xb36b('0x22')]===_0xb36b('0x23');var _0xfe29fc=_0x4b74f1[_0xb36b('0x24')];var _0x53ec0e=_0x5c7255?0x0:_0x23e960[_0xb36b('0x21')];var _0x211a91=_0x5c7255?_0x4b74f1[_0xb36b('0x24')]:_0x23e960['offset']+_0x23e960[_0xb36b('0x22')];var _0x572d88;if(_0x211a91>=_0xfe29fc){_0x211a91=_0xfe29fc;_0x572d88=0xc8;}else{_0x572d88=0xce;}_0x329f60[_0xb36b('0x1e')](_0x572d88);return _0x329f60[_0xb36b('0x25')](_0xb36b('0x26'),_0x53ec0e+'-'+_0x211a91+'/'+_0xfe29fc)[_0xb36b('0x20')](_0x4b74f1);}return null;};}function patchUpdates(_0x4049fa){return function(_0x5f6648){try{jsonpatch[_0xb36b('0x27')](_0x5f6648,_0x4049fa,!![]);}catch(_0x5c68de){return BPromise[_0xb36b('0x28')](_0x5c68de);}return _0x5f6648['save']();};}function saveUpdates(_0x218995,_0x52b74f){return function(_0x3b8030){if(_0x3b8030){return _0x3b8030[_0xb36b('0x29')](_0x218995)[_0xb36b('0x2a')](function(_0x174795){return _0x174795;});}return null;};}function removeEntity(_0x2fe32e,_0x5f4a25){return function(_0x474083){if(_0x474083){return _0x474083[_0xb36b('0x2b')]()[_0xb36b('0x2a')](function(){_0x2fe32e['status'](0xcc)[_0xb36b('0x1f')]();});}};}function handleEntityNotFound(_0x4a58d4,_0x5dbe3b){return function(_0x50e8e4){if(!_0x50e8e4){_0x4a58d4[_0xb36b('0x1d')](0x194);}return _0x50e8e4;};}function handleError(_0x1d904e,_0x2e8402){_0x2e8402=_0x2e8402||0x1f4;return function(_0x5c4aee){logger[_0xb36b('0x2c')](_0x5c4aee[_0xb36b('0x2d')]);if(_0x5c4aee[_0xb36b('0x2e')]){delete _0x5c4aee[_0xb36b('0x2e')];}_0x1d904e['status'](_0x2e8402)['send'](_0x5c4aee);};}exports[_0xb36b('0x2f')]=function(_0x2724bf,_0x24149b){var _0x138f74={'raw':!![],'where':{'id':_0x2724bf['params']['id']}},_0x4aabf5={};_0x4aabf5[_0xb36b('0x30')]=_['keys'](db[_0xb36b('0x31')][_0xb36b('0x32')]);_0x4aabf5['query']=_[_0xb36b('0x33')](_0x2724bf[_0xb36b('0x34')]);_0x4aabf5[_0xb36b('0x35')]=_[_0xb36b('0x36')](_0x4aabf5[_0xb36b('0x30')],_0x4aabf5[_0xb36b('0x34')]);_0x138f74[_0xb36b('0x37')]=_[_0xb36b('0x36')](_0x4aabf5[_0xb36b('0x30')],qs[_0xb36b('0x38')](_0x2724bf[_0xb36b('0x34')][_0xb36b('0x38')]));_0x138f74['attributes']=_0x138f74['attributes'][_0xb36b('0x39')]?_0x138f74[_0xb36b('0x37')]:_0x4aabf5['model'];if(_0x2724bf[_0xb36b('0x34')]['includeAll']){_0x138f74['include']=[{'all':!![]}];}_0x138f74=_[_0xb36b('0x3a')]({},_0x138f74,_0x2724bf[_0xb36b('0x3b')]);return db[_0xb36b('0x31')]['find'](_0x138f74)['then'](handleEntityNotFound(_0x24149b,null))[_0xb36b('0x2a')](respondWithResult(_0x24149b,null))[_0xb36b('0x3c')](handleError(_0x24149b,null));};exports[_0xb36b('0x3d')]=function(_0x46bde0,_0x39c80e){return db[_0xb36b('0x31')]['create'](_0x46bde0[_0xb36b('0x3e')],{})[_0xb36b('0x2a')](respondWithResult(_0x39c80e,0xc9))[_0xb36b('0x3c')](handleError(_0x39c80e,null));};exports[_0xb36b('0x29')]=function(_0x301e12,_0x185bb2){if(_0x301e12[_0xb36b('0x3e')]['id']){delete _0x301e12[_0xb36b('0x3e')]['id'];}return db[_0xb36b('0x31')]['find']({'where':{'id':_0x301e12[_0xb36b('0x3f')]['id']}})[_0xb36b('0x2a')](handleEntityNotFound(_0x185bb2,null))[_0xb36b('0x2a')](saveUpdates(_0x301e12['body'],null))[_0xb36b('0x2a')](respondWithResult(_0x185bb2,null))[_0xb36b('0x3c')](handleError(_0x185bb2,null));};exports[_0xb36b('0x2b')]=function(_0x26b77f,_0x55b694){return db['ChatProactiveAction'][_0xb36b('0x40')]({'where':{'id':_0x26b77f[_0xb36b('0x3f')]['id']}})[_0xb36b('0x2a')](handleEntityNotFound(_0x55b694,null))[_0xb36b('0x2a')](removeEntity(_0x55b694,null))[_0xb36b('0x3c')](handleError(_0x55b694,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 314348f..87b6d00 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 _0x8fcb=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions'];(function(_0xb32001,_0x506e9f){var _0x495897=function(_0x24f606){while(--_0x24f606){_0xb32001['push'](_0xb32001['shift']());}};_0x495897(++_0x506e9f);}(_0x8fcb,0x1ec));var _0xb8fc=function(_0x1f414c,_0x2ff27c){_0x1f414c=_0x1f414c-0x0;var _0x37b39a=_0x8fcb[_0x1f414c];return _0x37b39a;};'use strict';var _=require(_0xb8fc('0x0'));var util=require(_0xb8fc('0x1'));var logger=require(_0xb8fc('0x2'))(_0xb8fc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb8fc('0x4'));var fs=require('fs');var path=require(_0xb8fc('0x5'));var rimraf=require(_0xb8fc('0x6'));var config=require(_0xb8fc('0x7'));var attributes=require(_0xb8fc('0x8'));module[_0xb8fc('0x9')]=function(_0x4485ba,_0x33f9ed){return _0x4485ba['define'](_0xb8fc('0xa'),attributes,{'tableName':_0xb8fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c5b=['./chatProactiveAction.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x2c5b,0xfd));var _0xb2c5=function(_0x471b5c,_0x22e279){_0x471b5c=_0x471b5c-0x0;var _0x1bbcec=_0x2c5b[_0x471b5c];return _0x1bbcec;};'use strict';var _=require(_0xb2c5('0x0'));var util=require(_0xb2c5('0x1'));var logger=require(_0xb2c5('0x2'))(_0xb2c5('0x3'));var moment=require('moment');var BPromise=require(_0xb2c5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2c5('0x5'));var rimraf=require('rimraf');var config=require(_0xb2c5('0x6'));var attributes=require(_0xb2c5('0x7'));module[_0xb2c5('0x8')]=function(_0x83dd40,_0x47ef10){return _0x83dd40[_0xb2c5('0x9')]('ChatProactiveAction',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 39ac251..756e960 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 _0xc97e=['../../mysqldb','rpc','../../config/environment','client','http','request','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','info','request\x20sent','result','lodash','util','moment','bluebird'];(function(_0x2df383,_0x3b3e81){var _0x2c7845=function(_0x387f32){while(--_0x387f32){_0x2df383['push'](_0x2df383['shift']());}};_0x2c7845(++_0x3b3e81);}(_0xc97e,0x114));var _0xec97=function(_0x4640c6,_0xc268af){_0x4640c6=_0x4640c6-0x0;var _0x6d91dd=_0xc97e[_0x4640c6];return _0x6d91dd;};'use strict';var _=require(_0xec97('0x0'));var util=require(_0xec97('0x1'));var moment=require(_0xec97('0x2'));var BPromise=require(_0xec97('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec97('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xec97('0x5'));var config=require(_0xec97('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xec97('0x7')][_0xec97('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b1d75,_0x581990,_0x14032b){return new BPromise(function(_0x3a5ba9,_0x425021){return client[_0xec97('0x9')](_0x1b1d75,_0x14032b)['then'](function(_0x4dab19){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x581990,'request\x20sent');logger[_0xec97('0xa')](_0xec97('0xb'),_0x581990,'request\x20sent',JSON[_0xec97('0xc')](_0x4dab19));if(_0x4dab19[_0xec97('0xd')]){if(_0x4dab19[_0xec97('0xd')][_0xec97('0xe')]===0x1f4){logger['error'](_0xec97('0xf'),_0x581990,_0x4dab19[_0xec97('0xd')][_0xec97('0x10')]);return _0x425021(_0x4dab19['error'][_0xec97('0x10')]);}logger[_0xec97('0xd')](_0xec97('0xf'),_0x581990,_0x4dab19[_0xec97('0xd')]['message']);return _0x3a5ba9(_0x4dab19[_0xec97('0xd')][_0xec97('0x10')]);}else{logger[_0xec97('0x11')](_0xec97('0xf'),_0x581990,_0xec97('0x12'));_0x3a5ba9(_0x4dab19[_0xec97('0x13')][_0xec97('0x10')]);}})['catch'](function(_0x89b3e3){logger[_0xec97('0xd')](_0xec97('0xf'),_0x581990,_0x89b3e3);_0x425021(_0x89b3e3);});});}
\ No newline at end of file
+var _0xb667=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash'];(function(_0x55754e,_0x286388){var _0x2e9948=function(_0x1eaeff){while(--_0x1eaeff){_0x55754e['push'](_0x55754e['shift']());}};_0x2e9948(++_0x286388);}(_0xb667,0x142));var _0x7b66=function(_0x2e12c7,_0x1ef1db){_0x2e12c7=_0x2e12c7-0x0;var _0x397bcf=_0xb667[_0x2e12c7];return _0x397bcf;};'use strict';var _=require(_0x7b66('0x0'));var util=require('util');var moment=require(_0x7b66('0x1'));var BPromise=require(_0x7b66('0x2'));var rs=require(_0x7b66('0x3'));var fs=require('fs');var Redis=require(_0x7b66('0x4'));var db=require(_0x7b66('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7b66('0x6'));var config=require('../../config/environment');var jayson=require(_0x7b66('0x7'));var client=jayson[_0x7b66('0x8')][_0x7b66('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdca87,_0x39202a,_0x293066){return new BPromise(function(_0x577eea,_0x395f90){return client['request'](_0xdca87,_0x293066)['then'](function(_0x103b64){logger[_0x7b66('0xa')](_0x7b66('0xb'),_0x39202a,_0x7b66('0xc'));logger[_0x7b66('0xd')](_0x7b66('0xe'),_0x39202a,_0x7b66('0xc'),JSON['stringify'](_0x103b64));if(_0x103b64[_0x7b66('0xf')]){if(_0x103b64[_0x7b66('0xf')][_0x7b66('0x10')]===0x1f4){logger[_0x7b66('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x39202a,_0x103b64['error'][_0x7b66('0x11')]);return _0x395f90(_0x103b64['error']['message']);}logger[_0x7b66('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x39202a,_0x103b64['error'][_0x7b66('0x11')]);return _0x577eea(_0x103b64[_0x7b66('0xf')][_0x7b66('0x11')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x39202a,_0x7b66('0xc'));_0x577eea(_0x103b64[_0x7b66('0x12')][_0x7b66('0x11')]);}})['catch'](function(_0x2470bb){logger[_0x7b66('0xf')](_0x7b66('0xb'),_0x39202a,_0x2470bb);_0x395f90(_0x2470bb);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 14feff7..2d3fc36 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 _0xed1f=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x513f27,_0x1cbc87){var _0xa316b7=function(_0x3b592d){while(--_0x3b592d){_0x513f27['push'](_0x513f27['shift']());}};_0xa316b7(++_0x1cbc87);}(_0xed1f,0x6a));var _0xfed1=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xed1f[_0x11c573];return _0x6b72de;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller[_0xfed1('0xe')]);router[_0xfed1('0xf')]('/',auth[_0xfed1('0xd')](),controller[_0xfed1('0x10')]);router['put'](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller['update']);router[_0xfed1('0x11')](_0xfed1('0xc'),auth['isAuthenticated'](),controller[_0xfed1('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xabce=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','isAuthenticated','create','put'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xabce,0x103));var _0xeabc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xabce[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0xeabc('0x8'),auth['isAuthenticated'](),controller[_0xeabc('0x9')]);router['post']('/',auth[_0xeabc('0xa')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/:id',auth[_0xeabc('0xa')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0x8'),auth[_0xeabc('0xa')](),controller[_0xeabc('0xf')]);module[_0xeabc('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index db3526f..7ac6ab7 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 _0x8656=['rrmemory','beepall','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x44c974,_0x1bcfde){var _0x5214c6=function(_0x10aad5){while(--_0x10aad5){_0x44c974['push'](_0x44c974['shift']());}};_0x5214c6(++_0x1bcfde);}(_0x8656,0x12f));var _0x6865=function(_0x54c191,_0x4a04ef){_0x54c191=_0x54c191-0x0;var _0x40ee4a=_0x8656[_0x54c191];return _0x40ee4a;};'use strict';var Sequelize=require(_0x6865('0x0'));module[_0x6865('0x1')]={'name':{'type':Sequelize[_0x6865('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6865('0x2')]},'timeout':{'type':Sequelize[_0x6865('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6865('0x4')](_0x6865('0x5'),_0x6865('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0xf132=['ENUM','beepall','roundrobin','sequelize','exports','name','STRING','INTEGER'];(function(_0x1b9005,_0xc912e1){var _0x244966=function(_0x4c9ea3){while(--_0x4c9ea3){_0x1b9005['push'](_0x1b9005['shift']());}};_0x244966(++_0xc912e1);}(_0xf132,0x15b));var _0x2f13=function(_0x5e2e41,_0x150b32){_0x5e2e41=_0x5e2e41-0x0;var _0x1a3838=_0xf132[_0x5e2e41];return _0x1a3838;};'use strict';var Sequelize=require(_0x2f13('0x0'));module[_0x2f13('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2f13('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2f13('0x3')]},'timeout':{'type':Sequelize[_0x2f13('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2f13('0x5')]('rrmemory',_0x2f13('0x6'),_0x2f13('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index eb79cee..66dc20d 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 _0x258a=['defaults','socket.io-emitter','redis','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','sendStatus','status','undefined','limit','offset','count','set','Content-Range','json','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','map','ChatQueue','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','keys','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','length','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','format','SIP','createdAt','getTeams','Team','pick','ids','Agents','online','interface','transaction','addTeams','UserChatQueue','forEach','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeAgents','emit','userChatQueue:remove','omit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x360319,_0x1cd1ee){var _0x4062fb=function(_0x213292){while(--_0x213292){_0x360319['push'](_0x360319['shift']());}};_0x4062fb(++_0x1cd1ee);}(_0x258a,0x112));var _0xa258=function(_0x5a3bae,_0x22d71b){_0x5a3bae=_0x5a3bae-0x0;var _0x17a174=_0x258a[_0x5a3bae];return _0x17a174;};'use strict';var emlformat=require(_0xa258('0x0'));var rimraf=require(_0xa258('0x1'));var zipdir=require(_0xa258('0x2'));var jsonpatch=require(_0xa258('0x3'));var rp=require('request-promise');var moment=require(_0xa258('0x4'));var BPromise=require(_0xa258('0x5'));var Mustache=require('mustache');var util=require(_0xa258('0x6'));var path=require(_0xa258('0x7'));var sox=require(_0xa258('0x8'));var csv=require('to-csv');var ejs=require(_0xa258('0x9'));var fs=require('fs');var fs_extra=require(_0xa258('0xa'));var _=require(_0xa258('0xb'));var squel=require(_0xa258('0xc'));var crypto=require('crypto');var jsforce=require(_0xa258('0xd'));var deskjs=require(_0xa258('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa258('0xf'));var Papa=require(_0xa258('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa258('0x11'));var as=require(_0xa258('0x12'));var hardwareService=require(_0xa258('0x13'));var logger=require(_0xa258('0x14'))(_0xa258('0x15'));var utils=require(_0xa258('0x16'));var config=require(_0xa258('0x17'));var licenseUtil=require(_0xa258('0x18'));var db=require(_0xa258('0x19'))['db'];config['redis']=_[_0xa258('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa258('0x1b'))(new Redis(config[_0xa258('0x1c')]));require(_0xa258('0x1d'))[_0xa258('0x1e')](socket);var jayson=require(_0xa258('0x1f'));var client=jayson[_0xa258('0x20')][_0xa258('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x26548b,_0x53223d,_0x4b216b,_0x536c6b){return new BPromise(function(_0x19cfe3,_0x1894de){var _0x3aff4e=_0x536c6b||client;return _0x3aff4e[_0xa258('0x22')](_0x26548b,_0x4b216b)[_0xa258('0x23')](function(_0x4813d4){logger['info'](_0xa258('0x24'),_0x53223d,_0xa258('0x25'));logger[_0xa258('0x26')](_0xa258('0x27'),_0x53223d,_0xa258('0x25'),JSON[_0xa258('0x28')](_0x4813d4));if(_0x4813d4['error']){if(_0x4813d4['error'][_0xa258('0x29')]===0x1f4){logger[_0xa258('0x2a')](_0xa258('0x24'),_0x53223d,_0x4813d4[_0xa258('0x2a')]['message']);return _0x1894de(_0x4813d4[_0xa258('0x2a')][_0xa258('0x2b')]);}logger[_0xa258('0x2a')](_0xa258('0x24'),_0x53223d,_0x4813d4[_0xa258('0x2a')][_0xa258('0x2b')]);return _0x19cfe3(_0x4813d4['error']['message']);}else{logger['info'](_0xa258('0x24'),_0x53223d,_0xa258('0x25'));_0x19cfe3(_0x4813d4[_0xa258('0x2c')][_0xa258('0x2b')]);}})['catch'](function(_0x147030){logger[_0xa258('0x2a')](_0xa258('0x24'),_0x53223d,_0x147030);_0x1894de(_0x147030);});});}function respondWithStatusCode(_0x567aed,_0x5117ce){_0x5117ce=_0x5117ce||0xcc;return function(_0x472ae2){if(_0x472ae2){return _0x567aed[_0xa258('0x2d')](_0x5117ce);}return _0x567aed[_0xa258('0x2e')](_0x5117ce)['end']();};}function respondWithResult(_0x3e018c,_0x1f1543){_0x1f1543=_0x1f1543||0xc8;return function(_0x2efdfc){if(_0x2efdfc){return _0x3e018c[_0xa258('0x2e')](_0x1f1543)['json'](_0x2efdfc);}};}function respondWithFilteredResult(_0x22dc9a,_0x567336){return function(_0x434997){if(_0x434997){var _0x4e787b=typeof _0x567336['offset']===_0xa258('0x2f')&&typeof _0x567336[_0xa258('0x30')]===_0xa258('0x2f');var _0x2606aa=_0x434997['count'];var _0x56e47c=_0x4e787b?0x0:_0x567336[_0xa258('0x31')];var _0x565d2f=_0x4e787b?_0x434997[_0xa258('0x32')]:_0x567336['offset']+_0x567336[_0xa258('0x30')];var _0x51ce16;if(_0x565d2f>=_0x2606aa){_0x565d2f=_0x2606aa;_0x51ce16=0xc8;}else{_0x51ce16=0xce;}_0x22dc9a[_0xa258('0x2e')](_0x51ce16);return _0x22dc9a[_0xa258('0x33')](_0xa258('0x34'),_0x56e47c+'-'+_0x565d2f+'/'+_0x2606aa)[_0xa258('0x35')](_0x434997);}return null;};}function patchUpdates(_0x17e6f0){return function(_0x1bae91){try{jsonpatch['apply'](_0x1bae91,_0x17e6f0,!![]);}catch(_0x81f6fc){return BPromise[_0xa258('0x36')](_0x81f6fc);}return _0x1bae91[_0xa258('0x37')]();};}function saveUpdates(_0x4f37bb,_0x2462f2){return function(_0x19036d){if(_0x19036d){return _0x19036d[_0xa258('0x38')](_0x4f37bb)[_0xa258('0x23')](function(_0x366a6a){return _0x366a6a;});}return null;};}function removeEntity(_0xfe054c,_0x448777){return function(_0x51e34a){if(_0x51e34a){return _0x51e34a[_0xa258('0x39')]()[_0xa258('0x23')](function(){var _0x2aeee7=_0x51e34a[_0xa258('0x3a')]({'plain':!![]});var _0xb41884=_0xa258('0x3b');return db[_0xa258('0x3c')]['destroy']({'where':{'type':_0xb41884,'resourceId':_0x2aeee7['id']}})[_0xa258('0x23')](function(){return _0x51e34a;});})[_0xa258('0x23')](function(){_0xfe054c[_0xa258('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x589606,_0x18d074){return function(_0x5458fe){if(!_0x5458fe){_0x589606[_0xa258('0x2d')](0x194);}return _0x5458fe;};}function handleError(_0x4f9d98,_0x4d1282){_0x4d1282=_0x4d1282||0x1f4;return function(_0x45a990){logger['error'](_0x45a990[_0xa258('0x3d')]);if(_0x45a990[_0xa258('0x3e')]){delete _0x45a990[_0xa258('0x3e')];}_0x4f9d98[_0xa258('0x2e')](_0x4d1282)[_0xa258('0x3f')](_0x45a990);};}exports['index']=function(_0x52c782,_0x2cd41){var _0x4bad24={},_0x3ee8c9={},_0x3836c2={'count':0x0,'rows':[]};var _0x483e14=_[_0xa258('0x40')](db[_0xa258('0x41')][_0xa258('0x42')],function(_0x37f8e7){return{'name':_0x37f8e7['fieldName'],'type':_0x37f8e7[_0xa258('0x43')][_0xa258('0x44')]};});_0x3ee8c9[_0xa258('0x45')]=_['map'](_0x483e14,_0xa258('0x3e'));_0x3ee8c9[_0xa258('0x46')]=_['keys'](_0x52c782[_0xa258('0x46')]);_0x3ee8c9[_0xa258('0x47')]=_[_0xa258('0x48')](_0x3ee8c9[_0xa258('0x45')],_0x3ee8c9[_0xa258('0x46')]);_0x4bad24[_0xa258('0x49')]=_[_0xa258('0x48')](_0x3ee8c9[_0xa258('0x45')],qs[_0xa258('0x4a')](_0x52c782['query'][_0xa258('0x4a')]));_0x4bad24[_0xa258('0x49')]=_0x4bad24[_0xa258('0x49')]['length']?_0x4bad24[_0xa258('0x49')]:_0x3ee8c9['model'];if(!_0x52c782[_0xa258('0x46')][_0xa258('0x4b')](_0xa258('0x4c'))){_0x4bad24[_0xa258('0x30')]=qs[_0xa258('0x30')](_0x52c782[_0xa258('0x46')][_0xa258('0x30')]);_0x4bad24[_0xa258('0x31')]=qs['offset'](_0x52c782[_0xa258('0x46')][_0xa258('0x31')]);}_0x4bad24[_0xa258('0x4d')]=qs[_0xa258('0x4e')](_0x52c782[_0xa258('0x46')]['sort']);_0x4bad24[_0xa258('0x4f')]=qs['filters'](_['pick'](_0x52c782[_0xa258('0x46')],_0x3ee8c9[_0xa258('0x47')]),_0x483e14);if(_0x52c782[_0xa258('0x46')][_0xa258('0x50')]){_0x4bad24['where']=_[_0xa258('0x51')](_0x4bad24[_0xa258('0x4f')],{'$or':_[_0xa258('0x40')](_0x483e14,function(_0x502782){if(_0x502782[_0xa258('0x43')]!==_0xa258('0x52')){var _0x518aca={};_0x518aca[_0x502782['name']]={'$like':'%'+_0x52c782[_0xa258('0x46')]['filter']+'%'};return _0x518aca;}})});}_0x4bad24=_[_0xa258('0x51')]({},_0x4bad24,_0x52c782[_0xa258('0x53')]);var _0x199611={'where':_0x4bad24['where']};return db[_0xa258('0x41')][_0xa258('0x32')](_0x199611)[_0xa258('0x23')](function(_0x11d742){_0x3836c2['count']=_0x11d742;if(_0x52c782['query']['includeAll']){_0x4bad24['include']=[{'all':!![]}];}return db[_0xa258('0x41')][_0xa258('0x54')](_0x4bad24);})[_0xa258('0x23')](function(_0x125db5){_0x3836c2[_0xa258('0x55')]=_0x125db5;return _0x3836c2;})[_0xa258('0x23')](respondWithFilteredResult(_0x2cd41,_0x4bad24))[_0xa258('0x56')](handleError(_0x2cd41,null));};exports['show']=function(_0x23cc92,_0x3712c3){var _0x3dc276={'raw':!![],'where':{'id':_0x23cc92['params']['id']}},_0xaa3de={};_0xaa3de[_0xa258('0x45')]=_[_0xa258('0x57')](db[_0xa258('0x41')][_0xa258('0x42')]);_0xaa3de['query']=_['keys'](_0x23cc92[_0xa258('0x46')]);_0xaa3de['filters']=_[_0xa258('0x48')](_0xaa3de[_0xa258('0x45')],_0xaa3de['query']);_0x3dc276['attributes']=_['intersection'](_0xaa3de[_0xa258('0x45')],qs[_0xa258('0x4a')](_0x23cc92[_0xa258('0x46')][_0xa258('0x4a')]));_0x3dc276[_0xa258('0x49')]=_0x3dc276[_0xa258('0x49')]['length']?_0x3dc276[_0xa258('0x49')]:_0xaa3de[_0xa258('0x45')];if(_0x23cc92[_0xa258('0x46')][_0xa258('0x58')]){_0x3dc276[_0xa258('0x59')]=[{'all':!![]}];}_0x3dc276=_[_0xa258('0x51')]({},_0x3dc276,_0x23cc92[_0xa258('0x53')]);return db['ChatQueue'][_0xa258('0x5a')](_0x3dc276)['then'](handleEntityNotFound(_0x3712c3,null))['then'](respondWithResult(_0x3712c3,null))[_0xa258('0x56')](handleError(_0x3712c3,null));};exports[_0xa258('0x5b')]=function(_0xc26de3,_0x1f1ae2){return db[_0xa258('0x41')][_0xa258('0x5b')](_0xc26de3[_0xa258('0x5c')],{})[_0xa258('0x23')](function(_0x5666fc){var _0x138151=_0xc26de3[_0xa258('0x5d')][_0xa258('0x3a')]({'plain':!![]});if(!_0x138151)throw new Error(_0xa258('0x5e'));if(_0x138151[_0xa258('0x5f')]===_0xa258('0x5d')){var _0x27c486=_0x5666fc['get']({'plain':!![]});var _0x5e541e=_0xa258('0x3b');return db['UserProfileSection'][_0xa258('0x5a')]({'where':{'name':_0x5e541e,'userProfileId':_0x138151['userProfileId']},'raw':!![]})[_0xa258('0x23')](function(_0x18f7bd){if(_0x18f7bd&&_0x18f7bd[_0xa258('0x60')]===0x0){return db['UserProfileResource'][_0xa258('0x5b')]({'name':_0x27c486[_0xa258('0x3e')],'resourceId':_0x27c486['id'],'type':_0x18f7bd[_0xa258('0x3e')],'sectionId':_0x18f7bd['id']},{})[_0xa258('0x23')](function(){return _0x5666fc;});}else{return _0x5666fc;}})[_0xa258('0x56')](function(_0x159a21){logger['error'](_0xa258('0x61'),_0x159a21);throw _0x159a21;});}return _0x5666fc;})[_0xa258('0x23')](respondWithResult(_0x1f1ae2,0xc9))['catch'](handleError(_0x1f1ae2,null));};exports[_0xa258('0x38')]=function(_0x2de611,_0x3245ee){if(_0x2de611['body']['id']){delete _0x2de611['body']['id'];}return db['ChatQueue'][_0xa258('0x5a')]({'where':{'id':_0x2de611['params']['id']}})[_0xa258('0x23')](handleEntityNotFound(_0x3245ee,null))[_0xa258('0x23')](saveUpdates(_0x2de611['body'],null))[_0xa258('0x23')](respondWithResult(_0x3245ee,null))[_0xa258('0x56')](handleError(_0x3245ee,null));};exports[_0xa258('0x39')]=function(_0x12c665,_0x4e1f4a){return db[_0xa258('0x41')][_0xa258('0x5a')]({'where':{'id':_0x12c665[_0xa258('0x62')]['id']}})[_0xa258('0x23')](handleEntityNotFound(_0x4e1f4a,null))['then'](removeEntity(_0x4e1f4a,null))[_0xa258('0x56')](handleError(_0x4e1f4a,null));};exports[_0xa258('0x63')]=function(_0xb780c0,_0x5d9562){return db[_0xa258('0x41')][_0xa258('0x63')]()[_0xa258('0x23')](respondWithResult(_0x5d9562,null))[_0xa258('0x56')](handleError(_0x5d9562,null));};exports['getMembers']=function(_0x29a4fd,_0x1eee61,_0x54c0c4){var _0x51c335={'raw':!![],'where':{}},_0x5418a8={},_0x325f22;return db['ChatQueue'][_0xa258('0x64')]({'where':{'id':_0x29a4fd[_0xa258('0x62')]['id']}})[_0xa258('0x23')](handleEntityNotFound(_0x1eee61,null))['then'](function(_0x4980fa){if(_0x4980fa){_0x325f22=_0x4980fa[_0xa258('0x3a')]({'plain':!![]});_0x5418a8[_0xa258('0x45')]=_[_0xa258('0x57')](db['UserChatQueue'][_0xa258('0x42')]);_0x5418a8[_0xa258('0x46')]=_[_0xa258('0x57')](_0x29a4fd[_0xa258('0x46')]);_0x5418a8[_0xa258('0x47')]=_['intersection'](_0x5418a8[_0xa258('0x45')],_0x5418a8[_0xa258('0x46')]);_0x51c335['attributes']=_['intersection'](_0x5418a8[_0xa258('0x45')],qs[_0xa258('0x4a')](_0x29a4fd[_0xa258('0x46')]['fields']));_0x51c335[_0xa258('0x49')]=_0x51c335[_0xa258('0x49')][_0xa258('0x65')]?_0x51c335[_0xa258('0x49')]:_0x5418a8[_0xa258('0x45')];if(!_0x29a4fd['query']['hasOwnProperty'](_0xa258('0x4c'))){_0x51c335['limit']=qs['limit'](_0x29a4fd[_0xa258('0x46')][_0xa258('0x30')]);_0x51c335[_0xa258('0x31')]=qs['offset'](_0x29a4fd['query'][_0xa258('0x31')]);}_0x51c335[_0xa258('0x4d')]=qs[_0xa258('0x4e')](_0x29a4fd[_0xa258('0x46')][_0xa258('0x4e')]);_0x51c335['where']=qs[_0xa258('0x47')](_['pick'](_0x29a4fd[_0xa258('0x46')],_0x5418a8[_0xa258('0x47')]));_0x51c335[_0xa258('0x4f')][_0xa258('0x66')]=_0x4980fa['id'];if(_0x29a4fd[_0xa258('0x46')][_0xa258('0x50')]){_0x51c335[_0xa258('0x4f')]=_['merge'](_0x51c335[_0xa258('0x4f')],{'$or':_['map'](_0x51c335[_0xa258('0x49')],function(_0x59e3c7){var _0x2b2c70={};_0x2b2c70[_0x59e3c7]={'$like':'%'+_0x29a4fd[_0xa258('0x46')][_0xa258('0x50')]+'%'};return _0x2b2c70;})});}_0x51c335=_['merge']({},_0x51c335,_0x29a4fd[_0xa258('0x53')]);return db['UserChatQueue'][_0xa258('0x54')](_0x51c335);}})[_0xa258('0x23')](function(_0x39964e){if(_0x39964e){return db[_0xa258('0x67')][_0xa258('0x68')]({'where':{'id':_[_0xa258('0x40')](_0x39964e,_0xa258('0x69')),'role':_0xa258('0x6a')},'attributes':['id',_0xa258('0x3e'),_0xa258('0x6b'),_0xa258('0x6c'),'createdAt']});}})[_0xa258('0x23')](function(_0x17d311){if(_0x17d311){return{'count':_0x17d311[_0xa258('0x32')],'rows':_[_0xa258('0x40')](_0x17d311[_0xa258('0x55')],function(_0x5e9f5e){return{'membername':_0x5e9f5e[_0xa258('0x3e')],'UserId':_0x5e9f5e['id'],'queue_name':_0x325f22[_0xa258('0x3e')],'ChatQueueId':_0x325f22['id'],'interface':util[_0xa258('0x6d')]('%s/%s',_0xa258('0x6e'),_0x5e9f5e[_0xa258('0x3e')]),'penalty':0x0,'paused':_0x5e9f5e[_0xa258('0x6b')],'createdAt':_0x5e9f5e[_0xa258('0x6f')],'updatedAt':_0x5e9f5e[_0xa258('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1eee61,_0x51c335))[_0xa258('0x56')](handleError(_0x1eee61,null));};exports[_0xa258('0x70')]=function(_0x302db4,_0x1332d7,_0x3bea16){var _0x308c0b={};var _0x31c15e={};var _0x317b78;var _0x83a52f;return db['ChatQueue'][_0xa258('0x64')]({'where':{'id':_0x302db4[_0xa258('0x62')]['id']}})[_0xa258('0x23')](handleEntityNotFound(_0x1332d7,null))['then'](function(_0x19f3a5){if(_0x19f3a5){_0x317b78=_0x19f3a5;_0x31c15e[_0xa258('0x45')]=_[_0xa258('0x57')](db[_0xa258('0x71')][_0xa258('0x42')]);_0x31c15e[_0xa258('0x46')]=_[_0xa258('0x57')](_0x302db4[_0xa258('0x46')]);_0x31c15e[_0xa258('0x47')]=_[_0xa258('0x48')](_0x31c15e[_0xa258('0x45')],_0x31c15e['query']);_0x308c0b['attributes']=_['intersection'](_0x31c15e[_0xa258('0x45')],qs[_0xa258('0x4a')](_0x302db4[_0xa258('0x46')][_0xa258('0x4a')]));_0x308c0b['attributes']=_0x308c0b['attributes'][_0xa258('0x65')]?_0x308c0b[_0xa258('0x49')]:_0x31c15e[_0xa258('0x45')];_0x308c0b['order']=qs[_0xa258('0x4e')](_0x302db4[_0xa258('0x46')][_0xa258('0x4e')]);_0x308c0b[_0xa258('0x4f')]=qs[_0xa258('0x47')](_[_0xa258('0x72')](_0x302db4[_0xa258('0x46')],_0x31c15e[_0xa258('0x47')]));if(_0x302db4['query']['filter']){_0x308c0b[_0xa258('0x4f')]=_[_0xa258('0x51')](_0x308c0b[_0xa258('0x4f')],{'$or':_[_0xa258('0x40')](_0x308c0b[_0xa258('0x49')],function(_0x5c9037){var _0x491af6={};_0x491af6[_0x5c9037]={'$like':'%'+_0x302db4[_0xa258('0x46')][_0xa258('0x50')]+'%'};return _0x491af6;})});}_0x308c0b=_[_0xa258('0x51')]({},_0x308c0b,_0x302db4[_0xa258('0x53')]);return _0x317b78[_0xa258('0x70')](_0x308c0b);}})[_0xa258('0x23')](function(_0x69f281){if(_0x69f281){_0x83a52f=_0x69f281['length'];if(!_0x302db4[_0xa258('0x46')][_0xa258('0x4b')](_0xa258('0x4c'))){_0x308c0b[_0xa258('0x30')]=qs['limit'](_0x302db4[_0xa258('0x46')][_0xa258('0x30')]);_0x308c0b[_0xa258('0x31')]=qs['offset'](_0x302db4[_0xa258('0x46')][_0xa258('0x31')]);}return _0x317b78[_0xa258('0x70')](_0x308c0b);}})[_0xa258('0x23')](function(_0x78fde4){if(_0x78fde4){return _0x78fde4?{'count':_0x83a52f,'rows':_0x78fde4}:null;}})[_0xa258('0x23')](respondWithResult(_0x1332d7,null))[_0xa258('0x56')](handleError(_0x1332d7,null));};exports['addTeams']=function(_0x2d2e82,_0x396ce5,_0x47b321){var _0xf73b0=_0x2d2e82['body'][_0xa258('0x73')];return db[_0xa258('0x71')][_0xa258('0x54')]({'where':{'id':_0xf73b0},'attributes':['id'],'include':[{'model':db[_0xa258('0x67')],'as':_0xa258('0x74'),'attributes':['id',_0xa258('0x3e'),_0xa258('0x75'),'voicePause',_0xa258('0x76')],'raw':!![]}]})['then'](function(_0x4c0e9b){if(_0x4c0e9b){var _0x5de3b7=_['flatMap'](_0x4c0e9b,function(_0xa95252){var _0x379cbc=_0xa95252[_0xa258('0x3a')]({'plain':!![]});return _0x379cbc[_0xa258('0x74')];});return db[_0xa258('0x41')][_0xa258('0x5a')]({'where':{'id':_0x2d2e82[_0xa258('0x62')]['id']}})[_0xa258('0x23')](function(_0x2ae786){return db['sequelize'][_0xa258('0x77')](function(_0x5d1051){return _0x2ae786[_0xa258('0x78')](_0xf73b0,{'transaction':_0x5d1051})['then'](function(){return BPromise['each'](_0x5de3b7,function(_0x9afdad){return db[_0xa258('0x79')]['findOrCreate']({'where':{'UserId':_0x9afdad['id'],'ChatQueueId':_0x2d2e82[_0xa258('0x62')]['id']},'transaction':_0x5d1051});});})['then'](function(){_0x5de3b7[_0xa258('0x7a')](function(_0x52a83f){socket['emit'](_0xa258('0x7b'),{'UserId':_0x52a83f['id'],'ChatQueueId':_0x2ae786['id']});});});});});}})['then'](respondWithStatusCode(_0x396ce5,null))[_0xa258('0x56')](handleError(_0x396ce5,null));};exports[_0xa258('0x7c')]=function(_0x117d0e,_0x140645,_0xad96d0){return db[_0xa258('0x71')][_0xa258('0x54')]({'where':{'id':_0x117d0e[_0xa258('0x46')][_0xa258('0x73')]},'attributes':['id'],'include':[{'model':db[_0xa258('0x67')],'as':_0xa258('0x74'),'attributes':['id'],'raw':!![]}]})[_0xa258('0x23')](handleEntityNotFound(_0x140645,null))[_0xa258('0x23')](function(_0x81da8){var _0x1f4197=_[_0xa258('0x40')](_0x81da8,'id');var _0x50a7ce=[];var _0x477e4d=[];var _0x3068ec=squel['select']();_0x3068ec[_0xa258('0x7d')](_0xa258('0x7e'))[_0xa258('0x7f')](_0xa258('0x80'),'tq')[_0xa258('0x81')](_0xa258('0x82'),'ut',_0xa258('0x83'))[_0xa258('0x4f')](_0xa258('0x84'),_0x117d0e[_0xa258('0x62')]['id']);for(var _0x385b71=0x0;_0x385b71<_0x81da8[_0xa258('0x65')];_0x385b71+=0x1){let _0x4f65e0=_0x81da8[_0x385b71];for(var _0x25ceb9=0x0;_0x25ceb9<_0x4f65e0[_0xa258('0x74')][_0xa258('0x65')];_0x25ceb9+=0x1){let _0x49501c=_0x4f65e0[_0xa258('0x74')][_0x25ceb9];var _0x380f1d=_0x3068ec[_0xa258('0x85')]();_0x380f1d[_0xa258('0x4f')](_0xa258('0x86'),_0x49501c['id']);_0x477e4d['push'](db['sequelize'][_0xa258('0x46')](_0x380f1d[_0xa258('0x87')](),{'type':db[_0xa258('0x88')][_0xa258('0x89')][_0xa258('0x8a')]})['then'](function(_0x33c9d8){if(_0x33c9d8[_0xa258('0x65')]===0x1){return _0x49501c['id'];}else{var _0x487573=_['every'](_['map'](_0x33c9d8,_0xa258('0x8b')),function(_0x56c6c4){return _[_0xa258('0x8c')](_0x1f4197,_0x56c6c4);});if(_0x487573){return _0x49501c['id'];}}}));}}return BPromise[_0xa258('0x8d')](_0x477e4d)['then'](function(_0x32b034){_0x50a7ce=_(_0x50a7ce)[_0xa258('0x8e')](_0x32b034)[_0xa258('0x8f')]()[_0xa258('0x90')]();return db['ChatQueue']['find']({'where':{'id':_0x117d0e[_0xa258('0x62')]['id']}})[_0xa258('0x23')](function(_0x2e0598){return db['sequelize'][_0xa258('0x77')](function(_0xa468a6){return _0x2e0598[_0xa258('0x7c')](_0x117d0e[_0xa258('0x46')][_0xa258('0x73')],{'transaction':_0xa468a6})[_0xa258('0x23')](function(){if(!_['isEmpty'](_0x50a7ce)){return _0x2e0598[_0xa258('0x91')](_0x50a7ce,{'transaction':_0xa468a6});}})[_0xa258('0x23')](function(){_0x50a7ce[_0xa258('0x7a')](function(_0x462d7d){socket[_0xa258('0x92')](_0xa258('0x93'),{'UserId':_0x462d7d,'ChatQueueId':_0x2e0598['id']});});});});});});})[_0xa258('0x23')](respondWithStatusCode(_0x140645,null))['catch'](handleError(_0x140645,null));};exports['addAgents']=function(_0xf52574,_0x43cc6e,_0xcf69bf){return db[_0xa258('0x41')]['find']({'where':{'id':_0xf52574[_0xa258('0x62')]['id']}})[_0xa258('0x23')](handleEntityNotFound(_0x43cc6e,null))['then'](function(_0x2318f6){if(_0x2318f6){return _0x2318f6['addAgents'](_0xf52574[_0xa258('0x5c')][_0xa258('0x73')],_[_0xa258('0x94')](_0xf52574[_0xa258('0x5c')],[_0xa258('0x73'),'id'])||{})['spread'](function(_0x5f69ea){for(var _0x4fb7ac=0x0;_0x4fb7ac<_0xf52574[_0xa258('0x5c')][_0xa258('0x73')][_0xa258('0x65')];_0x4fb7ac+=0x1){socket[_0xa258('0x92')](_0xa258('0x7b'),{'UserId':Number(_0xf52574['body'][_0xa258('0x73')][_0x4fb7ac]),'ChatQueueId':Number(_0xf52574[_0xa258('0x62')]['id'])});}return _0x5f69ea;});}})[_0xa258('0x23')](respondWithResult(_0x43cc6e,null))[_0xa258('0x56')](handleError(_0x43cc6e,null));};exports[_0xa258('0x91')]=function(_0x4e0428,_0x11cdb,_0x4f56d7){return db[_0xa258('0x41')]['find']({'where':{'id':_0x4e0428[_0xa258('0x62')]['id']}})[_0xa258('0x23')](handleEntityNotFound(_0x11cdb,null))['then'](function(_0x4624d0){if(_0x4624d0){return _0x4624d0[_0xa258('0x91')](_0x4e0428[_0xa258('0x46')][_0xa258('0x73')])['then'](function(){if(_['isArray'](_0x4e0428[_0xa258('0x46')][_0xa258('0x73')])){for(var _0x232b8f=0x0;_0x232b8f<_0x4e0428[_0xa258('0x46')]['ids'][_0xa258('0x65')];_0x232b8f+=0x1){socket['emit'](_0xa258('0x93'),{'UserId':Number(_0x4e0428['query'][_0xa258('0x73')][_0x232b8f]),'ChatQueueId':Number(_0x4e0428[_0xa258('0x62')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x4e0428[_0xa258('0x46')][_0xa258('0x73')]),'ChatQueueId':Number(_0x4e0428[_0xa258('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x11cdb,null))[_0xa258('0x56')](handleError(_0x11cdb,null));};exports[_0xa258('0x95')]=function(_0x591722,_0x248a39,_0x156a2b){var _0x2e11a3={};var _0x2d6f3e={};var _0x1b50c6;var _0x1b811f;return db[_0xa258('0x41')][_0xa258('0x64')]({'where':{'id':_0x591722['params']['id']}})['then'](handleEntityNotFound(_0x248a39,null))['then'](function(_0x509e25){if(_0x509e25){_0x1b50c6=_0x509e25;_0x2d6f3e[_0xa258('0x45')]=_[_0xa258('0x57')](db['User'][_0xa258('0x42')]);_0x2d6f3e[_0xa258('0x46')]=_[_0xa258('0x57')](_0x591722['query']);_0x2d6f3e[_0xa258('0x47')]=_[_0xa258('0x48')](_0x2d6f3e[_0xa258('0x45')],_0x2d6f3e[_0xa258('0x46')]);_0x2e11a3[_0xa258('0x49')]=_['intersection'](_0x2d6f3e[_0xa258('0x45')],qs['fields'](_0x591722[_0xa258('0x46')]['fields']));_0x2e11a3[_0xa258('0x49')]=_0x2e11a3[_0xa258('0x49')][_0xa258('0x65')]?_0x2e11a3[_0xa258('0x49')]:_0x2d6f3e['model'];_0x2e11a3[_0xa258('0x4d')]=qs[_0xa258('0x4e')](_0x591722[_0xa258('0x46')][_0xa258('0x4e')]);_0x2e11a3[_0xa258('0x4f')]=qs['filters'](_[_0xa258('0x72')](_0x591722[_0xa258('0x46')],_0x2d6f3e['filters']));if(_0x591722[_0xa258('0x46')][_0xa258('0x50')]){_0x2e11a3[_0xa258('0x4f')]=_[_0xa258('0x51')](_0x2e11a3[_0xa258('0x4f')],{'$or':_[_0xa258('0x40')](_0x2e11a3[_0xa258('0x49')],function(_0x41fe2f){var _0x5a19aa={};_0x5a19aa[_0x41fe2f]={'$like':'%'+_0x591722[_0xa258('0x46')][_0xa258('0x50')]+'%'};return _0x5a19aa;})});}_0x2e11a3=_[_0xa258('0x51')]({},_0x2e11a3,_0x591722[_0xa258('0x53')]);return _0x1b50c6[_0xa258('0x95')](_0x2e11a3);}})['then'](function(_0x31037e){if(_0x31037e){_0x1b811f=_0x31037e['length'];if(!_0x591722[_0xa258('0x46')][_0xa258('0x4b')](_0xa258('0x4c'))){_0x2e11a3[_0xa258('0x30')]=qs[_0xa258('0x30')](_0x591722[_0xa258('0x46')][_0xa258('0x30')]);_0x2e11a3['offset']=qs[_0xa258('0x31')](_0x591722[_0xa258('0x46')][_0xa258('0x31')]);}return _0x1b50c6['getAgents'](_0x2e11a3);}})[_0xa258('0x23')](function(_0x5297a0){if(_0x5297a0){return _0x5297a0?{'count':_0x1b811f,'rows':_0x5297a0}:null;}})[_0xa258('0x23')](respondWithResult(_0x248a39,null))[_0xa258('0x56')](handleError(_0x248a39,null));};
\ No newline at end of file
+var _0x0e6b=['options','includeAll','include','findAll','rows','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','describe','order','ChatQueueId','UserChatQueue','User','UserId','agent','chatPause','createdAt','format','SIP','updatedAt','getTeams','findOne','Team','hasOwnProperty','addTeams','ids','Agents','online','interface','transaction','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','clone','toString','sequelize','QueryTypes','TeamId','includes','union','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','info','request\x20sent','debug','error','code','ChatQueue,\x20%s,\x20%s','message','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','destroy','get','ChatQueues','UserProfileResource','then','end','stack','name','map','ChatQueue','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x2d23a4,_0xc79e87){var _0x3c2660=function(_0x36c817){while(--_0x36c817){_0x2d23a4['push'](_0x2d23a4['shift']());}};_0x3c2660(++_0xc79e87);}(_0x0e6b,0x161));var _0xb0e6=function(_0x5e6bec,_0x1eb54d){_0x5e6bec=_0x5e6bec-0x0;var _0x5dc5cf=_0x0e6b[_0x5e6bec];return _0x5dc5cf;};'use strict';var emlformat=require(_0xb0e6('0x0'));var rimraf=require(_0xb0e6('0x1'));var zipdir=require(_0xb0e6('0x2'));var jsonpatch=require(_0xb0e6('0x3'));var rp=require(_0xb0e6('0x4'));var moment=require(_0xb0e6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb0e6('0x6'));var util=require(_0xb0e6('0x7'));var path=require(_0xb0e6('0x8'));var sox=require(_0xb0e6('0x9'));var csv=require(_0xb0e6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb0e6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb0e6('0xc'));var deskjs=require(_0xb0e6('0xd'));var toCsv=require(_0xb0e6('0xa'));var querystring=require(_0xb0e6('0xe'));var Papa=require(_0xb0e6('0xf'));var Redis=require(_0xb0e6('0x10'));var authService=require(_0xb0e6('0x11'));var qs=require(_0xb0e6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb0e6('0x13'));var logger=require('../../config/logger')(_0xb0e6('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb0e6('0x15'));var db=require(_0xb0e6('0x16'))['db'];config['redis']=_[_0xb0e6('0x17')](config[_0xb0e6('0x18')],{'host':_0xb0e6('0x19'),'port':0x18eb});var socket=require(_0xb0e6('0x1a'))(new Redis(config[_0xb0e6('0x18')]));require(_0xb0e6('0x1b'))[_0xb0e6('0x1c')](socket);var jayson=require(_0xb0e6('0x1d'));var client=jayson[_0xb0e6('0x1e')][_0xb0e6('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x51fe31,_0x2e46c2,_0x517f44,_0xb2ad96){return new BPromise(function(_0x1a51c6,_0x3844bf){var _0x20975f=_0xb2ad96||client;return _0x20975f['request'](_0x51fe31,_0x517f44)['then'](function(_0x437da5){logger[_0xb0e6('0x20')]('ChatQueue,\x20%s,\x20%s',_0x2e46c2,_0xb0e6('0x21'));logger[_0xb0e6('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2e46c2,'request\x20sent',JSON['stringify'](_0x437da5));if(_0x437da5[_0xb0e6('0x23')]){if(_0x437da5[_0xb0e6('0x23')][_0xb0e6('0x24')]===0x1f4){logger[_0xb0e6('0x23')](_0xb0e6('0x25'),_0x2e46c2,_0x437da5[_0xb0e6('0x23')][_0xb0e6('0x26')]);return _0x3844bf(_0x437da5[_0xb0e6('0x23')][_0xb0e6('0x26')]);}logger[_0xb0e6('0x23')](_0xb0e6('0x25'),_0x2e46c2,_0x437da5[_0xb0e6('0x23')][_0xb0e6('0x26')]);return _0x1a51c6(_0x437da5[_0xb0e6('0x23')][_0xb0e6('0x26')]);}else{logger[_0xb0e6('0x20')](_0xb0e6('0x25'),_0x2e46c2,_0xb0e6('0x21'));_0x1a51c6(_0x437da5['result'][_0xb0e6('0x26')]);}})[_0xb0e6('0x27')](function(_0x124fec){logger['error']('ChatQueue,\x20%s,\x20%s',_0x2e46c2,_0x124fec);_0x3844bf(_0x124fec);});});}function respondWithStatusCode(_0x4c4a5c,_0x3ee338){_0x3ee338=_0x3ee338||0xcc;return function(_0x36b051){if(_0x36b051){return _0x4c4a5c[_0xb0e6('0x28')](_0x3ee338);}return _0x4c4a5c[_0xb0e6('0x29')](_0x3ee338)['end']();};}function respondWithResult(_0x3b3359,_0x49ebc6){_0x49ebc6=_0x49ebc6||0xc8;return function(_0x21f4f9){if(_0x21f4f9){return _0x3b3359[_0xb0e6('0x29')](_0x49ebc6)[_0xb0e6('0x2a')](_0x21f4f9);}};}function respondWithFilteredResult(_0x16e59b,_0x48f8ae){return function(_0x28e1e0){if(_0x28e1e0){var _0x2ea417=typeof _0x48f8ae['offset']===_0xb0e6('0x2b')&&typeof _0x48f8ae['limit']==='undefined';var _0x523002=_0x28e1e0[_0xb0e6('0x2c')];var _0x8904b2=_0x2ea417?0x0:_0x48f8ae[_0xb0e6('0x2d')];var _0x2944c2=_0x2ea417?_0x28e1e0[_0xb0e6('0x2c')]:_0x48f8ae['offset']+_0x48f8ae[_0xb0e6('0x2e')];var _0x116942;if(_0x2944c2>=_0x523002){_0x2944c2=_0x523002;_0x116942=0xc8;}else{_0x116942=0xce;}_0x16e59b[_0xb0e6('0x29')](_0x116942);return _0x16e59b[_0xb0e6('0x2f')](_0xb0e6('0x30'),_0x8904b2+'-'+_0x2944c2+'/'+_0x523002)[_0xb0e6('0x2a')](_0x28e1e0);}return null;};}function patchUpdates(_0x3017a9){return function(_0x56509b){try{jsonpatch[_0xb0e6('0x31')](_0x56509b,_0x3017a9,!![]);}catch(_0x5f22db){return BPromise[_0xb0e6('0x32')](_0x5f22db);}return _0x56509b['save']();};}function saveUpdates(_0x2fedc3,_0x58a00d){return function(_0x4dddb5){if(_0x4dddb5){return _0x4dddb5['update'](_0x2fedc3)['then'](function(_0x44367f){return _0x44367f;});}return null;};}function removeEntity(_0x21b40e,_0x3ac299){return function(_0x1a9c7d){if(_0x1a9c7d){return _0x1a9c7d[_0xb0e6('0x33')]()['then'](function(){var _0x55cc97=_0x1a9c7d[_0xb0e6('0x34')]({'plain':!![]});var _0x117dd9=_0xb0e6('0x35');return db[_0xb0e6('0x36')][_0xb0e6('0x33')]({'where':{'type':_0x117dd9,'resourceId':_0x55cc97['id']}})[_0xb0e6('0x37')](function(){return _0x1a9c7d;});})[_0xb0e6('0x37')](function(){_0x21b40e[_0xb0e6('0x29')](0xcc)[_0xb0e6('0x38')]();});}};}function handleEntityNotFound(_0x5f3afc,_0x11406c){return function(_0xcbd101){if(!_0xcbd101){_0x5f3afc[_0xb0e6('0x28')](0x194);}return _0xcbd101;};}function handleError(_0x5d84a2,_0x3d2672){_0x3d2672=_0x3d2672||0x1f4;return function(_0x421676){logger[_0xb0e6('0x23')](_0x421676[_0xb0e6('0x39')]);if(_0x421676['name']){delete _0x421676[_0xb0e6('0x3a')];}_0x5d84a2['status'](_0x3d2672)['send'](_0x421676);};}exports['index']=function(_0x2408aa,_0x1fd1ee){var _0x44417a={},_0x30bd4f={},_0x4e8280={'count':0x0,'rows':[]};var _0x39cd77=_[_0xb0e6('0x3b')](db[_0xb0e6('0x3c')][_0xb0e6('0x3d')],function(_0xc46b9b){return{'name':_0xc46b9b[_0xb0e6('0x3e')],'type':_0xc46b9b[_0xb0e6('0x3f')][_0xb0e6('0x40')]};});_0x30bd4f[_0xb0e6('0x41')]=_['map'](_0x39cd77,'name');_0x30bd4f['query']=_[_0xb0e6('0x42')](_0x2408aa['query']);_0x30bd4f[_0xb0e6('0x43')]=_['intersection'](_0x30bd4f[_0xb0e6('0x41')],_0x30bd4f[_0xb0e6('0x44')]);_0x44417a[_0xb0e6('0x45')]=_['intersection'](_0x30bd4f[_0xb0e6('0x41')],qs[_0xb0e6('0x46')](_0x2408aa[_0xb0e6('0x44')][_0xb0e6('0x46')]));_0x44417a[_0xb0e6('0x45')]=_0x44417a[_0xb0e6('0x45')][_0xb0e6('0x47')]?_0x44417a['attributes']:_0x30bd4f['model'];if(!_0x2408aa[_0xb0e6('0x44')]['hasOwnProperty'](_0xb0e6('0x48'))){_0x44417a[_0xb0e6('0x2e')]=qs[_0xb0e6('0x2e')](_0x2408aa['query'][_0xb0e6('0x2e')]);_0x44417a['offset']=qs[_0xb0e6('0x2d')](_0x2408aa[_0xb0e6('0x44')][_0xb0e6('0x2d')]);}_0x44417a['order']=qs[_0xb0e6('0x49')](_0x2408aa['query'][_0xb0e6('0x49')]);_0x44417a[_0xb0e6('0x4a')]=qs[_0xb0e6('0x43')](_[_0xb0e6('0x4b')](_0x2408aa[_0xb0e6('0x44')],_0x30bd4f['filters']),_0x39cd77);if(_0x2408aa[_0xb0e6('0x44')][_0xb0e6('0x4c')]){_0x44417a[_0xb0e6('0x4a')]=_['merge'](_0x44417a[_0xb0e6('0x4a')],{'$or':_[_0xb0e6('0x3b')](_0x39cd77,function(_0x369662){if(_0x369662[_0xb0e6('0x3f')]!==_0xb0e6('0x4d')){var _0x4cb4ca={};_0x4cb4ca[_0x369662['name']]={'$like':'%'+_0x2408aa[_0xb0e6('0x44')][_0xb0e6('0x4c')]+'%'};return _0x4cb4ca;}})});}_0x44417a=_[_0xb0e6('0x4e')]({},_0x44417a,_0x2408aa[_0xb0e6('0x4f')]);var _0x39ccfd={'where':_0x44417a[_0xb0e6('0x4a')]};return db[_0xb0e6('0x3c')][_0xb0e6('0x2c')](_0x39ccfd)[_0xb0e6('0x37')](function(_0x1d28b3){_0x4e8280[_0xb0e6('0x2c')]=_0x1d28b3;if(_0x2408aa['query'][_0xb0e6('0x50')]){_0x44417a[_0xb0e6('0x51')]=[{'all':!![]}];}return db[_0xb0e6('0x3c')][_0xb0e6('0x52')](_0x44417a);})[_0xb0e6('0x37')](function(_0x39980d){_0x4e8280[_0xb0e6('0x53')]=_0x39980d;return _0x4e8280;})['then'](respondWithFilteredResult(_0x1fd1ee,_0x44417a))[_0xb0e6('0x27')](handleError(_0x1fd1ee,null));};exports[_0xb0e6('0x54')]=function(_0x2a999f,_0x18a42b){var _0xed89ba={'raw':!![],'where':{'id':_0x2a999f[_0xb0e6('0x55')]['id']}},_0x272d65={};_0x272d65[_0xb0e6('0x41')]=_[_0xb0e6('0x42')](db[_0xb0e6('0x3c')]['rawAttributes']);_0x272d65[_0xb0e6('0x44')]=_['keys'](_0x2a999f[_0xb0e6('0x44')]);_0x272d65[_0xb0e6('0x43')]=_[_0xb0e6('0x56')](_0x272d65[_0xb0e6('0x41')],_0x272d65[_0xb0e6('0x44')]);_0xed89ba[_0xb0e6('0x45')]=_[_0xb0e6('0x56')](_0x272d65[_0xb0e6('0x41')],qs[_0xb0e6('0x46')](_0x2a999f[_0xb0e6('0x44')][_0xb0e6('0x46')]));_0xed89ba[_0xb0e6('0x45')]=_0xed89ba[_0xb0e6('0x45')]['length']?_0xed89ba['attributes']:_0x272d65[_0xb0e6('0x41')];if(_0x2a999f[_0xb0e6('0x44')][_0xb0e6('0x50')]){_0xed89ba[_0xb0e6('0x51')]=[{'all':!![]}];}_0xed89ba=_['merge']({},_0xed89ba,_0x2a999f[_0xb0e6('0x4f')]);return db[_0xb0e6('0x3c')][_0xb0e6('0x57')](_0xed89ba)[_0xb0e6('0x37')](handleEntityNotFound(_0x18a42b,null))['then'](respondWithResult(_0x18a42b,null))['catch'](handleError(_0x18a42b,null));};exports[_0xb0e6('0x58')]=function(_0x226021,_0x1397e9){return db[_0xb0e6('0x3c')][_0xb0e6('0x58')](_0x226021[_0xb0e6('0x59')],{})[_0xb0e6('0x37')](function(_0x2d12c1){var _0x2038c7=_0x226021[_0xb0e6('0x5a')]['get']({'plain':!![]});if(!_0x2038c7)throw new Error(_0xb0e6('0x5b'));if(_0x2038c7[_0xb0e6('0x5c')]===_0xb0e6('0x5a')){var _0x8304a2=_0x2d12c1[_0xb0e6('0x34')]({'plain':!![]});var _0x451251=_0xb0e6('0x35');return db[_0xb0e6('0x5d')][_0xb0e6('0x57')]({'where':{'name':_0x451251,'userProfileId':_0x2038c7[_0xb0e6('0x5e')]},'raw':!![]})[_0xb0e6('0x37')](function(_0x331b11){if(_0x331b11&&_0x331b11['autoAssociation']===0x0){return db[_0xb0e6('0x36')]['create']({'name':_0x8304a2[_0xb0e6('0x3a')],'resourceId':_0x8304a2['id'],'type':_0x331b11[_0xb0e6('0x3a')],'sectionId':_0x331b11['id']},{})[_0xb0e6('0x37')](function(){return _0x2d12c1;});}else{return _0x2d12c1;}})[_0xb0e6('0x27')](function(_0x5cafa0){logger[_0xb0e6('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5cafa0);throw _0x5cafa0;});}return _0x2d12c1;})['then'](respondWithResult(_0x1397e9,0xc9))['catch'](handleError(_0x1397e9,null));};exports[_0xb0e6('0x5f')]=function(_0x2292ab,_0x1ff106){if(_0x2292ab['body']['id']){delete _0x2292ab['body']['id'];}return db[_0xb0e6('0x3c')]['find']({'where':{'id':_0x2292ab['params']['id']}})[_0xb0e6('0x37')](handleEntityNotFound(_0x1ff106,null))['then'](saveUpdates(_0x2292ab[_0xb0e6('0x59')],null))[_0xb0e6('0x37')](respondWithResult(_0x1ff106,null))[_0xb0e6('0x27')](handleError(_0x1ff106,null));};exports[_0xb0e6('0x33')]=function(_0x51c7b2,_0x545ddb){return db[_0xb0e6('0x3c')][_0xb0e6('0x57')]({'where':{'id':_0x51c7b2[_0xb0e6('0x55')]['id']}})['then'](handleEntityNotFound(_0x545ddb,null))[_0xb0e6('0x37')](removeEntity(_0x545ddb,null))[_0xb0e6('0x27')](handleError(_0x545ddb,null));};exports[_0xb0e6('0x60')]=function(_0x385411,_0x178499){return db[_0xb0e6('0x3c')]['describe']()['then'](respondWithResult(_0x178499,null))[_0xb0e6('0x27')](handleError(_0x178499,null));};exports['getMembers']=function(_0x41a35c,_0x6d6b04,_0x29ccb0){var _0x4f7ee1={'raw':!![],'where':{}},_0x3b1260={},_0x1168e9;return db['ChatQueue']['findOne']({'where':{'id':_0x41a35c[_0xb0e6('0x55')]['id']}})[_0xb0e6('0x37')](handleEntityNotFound(_0x6d6b04,null))[_0xb0e6('0x37')](function(_0x33462c){if(_0x33462c){_0x1168e9=_0x33462c[_0xb0e6('0x34')]({'plain':!![]});_0x3b1260[_0xb0e6('0x41')]=_[_0xb0e6('0x42')](db['UserChatQueue'][_0xb0e6('0x3d')]);_0x3b1260['query']=_[_0xb0e6('0x42')](_0x41a35c['query']);_0x3b1260[_0xb0e6('0x43')]=_[_0xb0e6('0x56')](_0x3b1260[_0xb0e6('0x41')],_0x3b1260[_0xb0e6('0x44')]);_0x4f7ee1[_0xb0e6('0x45')]=_[_0xb0e6('0x56')](_0x3b1260[_0xb0e6('0x41')],qs['fields'](_0x41a35c[_0xb0e6('0x44')]['fields']));_0x4f7ee1[_0xb0e6('0x45')]=_0x4f7ee1[_0xb0e6('0x45')][_0xb0e6('0x47')]?_0x4f7ee1[_0xb0e6('0x45')]:_0x3b1260['model'];if(!_0x41a35c['query']['hasOwnProperty'](_0xb0e6('0x48'))){_0x4f7ee1[_0xb0e6('0x2e')]=qs[_0xb0e6('0x2e')](_0x41a35c[_0xb0e6('0x44')][_0xb0e6('0x2e')]);_0x4f7ee1[_0xb0e6('0x2d')]=qs['offset'](_0x41a35c[_0xb0e6('0x44')][_0xb0e6('0x2d')]);}_0x4f7ee1[_0xb0e6('0x61')]=qs[_0xb0e6('0x49')](_0x41a35c[_0xb0e6('0x44')]['sort']);_0x4f7ee1[_0xb0e6('0x4a')]=qs['filters'](_['pick'](_0x41a35c['query'],_0x3b1260[_0xb0e6('0x43')]));_0x4f7ee1['where'][_0xb0e6('0x62')]=_0x33462c['id'];if(_0x41a35c[_0xb0e6('0x44')][_0xb0e6('0x4c')]){_0x4f7ee1['where']=_[_0xb0e6('0x4e')](_0x4f7ee1[_0xb0e6('0x4a')],{'$or':_[_0xb0e6('0x3b')](_0x4f7ee1[_0xb0e6('0x45')],function(_0xbbcb23){var _0x51177d={};_0x51177d[_0xbbcb23]={'$like':'%'+_0x41a35c[_0xb0e6('0x44')][_0xb0e6('0x4c')]+'%'};return _0x51177d;})});}_0x4f7ee1=_[_0xb0e6('0x4e')]({},_0x4f7ee1,_0x41a35c['options']);return db[_0xb0e6('0x63')][_0xb0e6('0x52')](_0x4f7ee1);}})[_0xb0e6('0x37')](function(_0x11e5e3){if(_0x11e5e3){return db[_0xb0e6('0x64')]['findAndCountAll']({'where':{'id':_[_0xb0e6('0x3b')](_0x11e5e3,_0xb0e6('0x65')),'role':_0xb0e6('0x66')},'attributes':['id',_0xb0e6('0x3a'),_0xb0e6('0x67'),'updatedAt',_0xb0e6('0x68')]});}})['then'](function(_0x3b010b){if(_0x3b010b){return{'count':_0x3b010b[_0xb0e6('0x2c')],'rows':_[_0xb0e6('0x3b')](_0x3b010b[_0xb0e6('0x53')],function(_0x57ecd8){return{'membername':_0x57ecd8[_0xb0e6('0x3a')],'UserId':_0x57ecd8['id'],'queue_name':_0x1168e9[_0xb0e6('0x3a')],'ChatQueueId':_0x1168e9['id'],'interface':util[_0xb0e6('0x69')]('%s/%s',_0xb0e6('0x6a'),_0x57ecd8['name']),'penalty':0x0,'paused':_0x57ecd8[_0xb0e6('0x67')],'createdAt':_0x57ecd8[_0xb0e6('0x68')],'updatedAt':_0x57ecd8[_0xb0e6('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb0e6('0x37')](respondWithFilteredResult(_0x6d6b04,_0x4f7ee1))[_0xb0e6('0x27')](handleError(_0x6d6b04,null));};exports[_0xb0e6('0x6c')]=function(_0x58f1ff,_0x2ada44,_0x43bc91){var _0x442a04={};var _0x17ce0d={};var _0xfc3ac4;var _0x149d6c;return db[_0xb0e6('0x3c')][_0xb0e6('0x6d')]({'where':{'id':_0x58f1ff['params']['id']}})[_0xb0e6('0x37')](handleEntityNotFound(_0x2ada44,null))[_0xb0e6('0x37')](function(_0x246acd){if(_0x246acd){_0xfc3ac4=_0x246acd;_0x17ce0d[_0xb0e6('0x41')]=_[_0xb0e6('0x42')](db[_0xb0e6('0x6e')][_0xb0e6('0x3d')]);_0x17ce0d[_0xb0e6('0x44')]=_[_0xb0e6('0x42')](_0x58f1ff['query']);_0x17ce0d[_0xb0e6('0x43')]=_[_0xb0e6('0x56')](_0x17ce0d[_0xb0e6('0x41')],_0x17ce0d[_0xb0e6('0x44')]);_0x442a04['attributes']=_[_0xb0e6('0x56')](_0x17ce0d[_0xb0e6('0x41')],qs[_0xb0e6('0x46')](_0x58f1ff['query'][_0xb0e6('0x46')]));_0x442a04[_0xb0e6('0x45')]=_0x442a04[_0xb0e6('0x45')][_0xb0e6('0x47')]?_0x442a04[_0xb0e6('0x45')]:_0x17ce0d['model'];_0x442a04[_0xb0e6('0x61')]=qs[_0xb0e6('0x49')](_0x58f1ff[_0xb0e6('0x44')][_0xb0e6('0x49')]);_0x442a04[_0xb0e6('0x4a')]=qs[_0xb0e6('0x43')](_[_0xb0e6('0x4b')](_0x58f1ff[_0xb0e6('0x44')],_0x17ce0d[_0xb0e6('0x43')]));if(_0x58f1ff[_0xb0e6('0x44')][_0xb0e6('0x4c')]){_0x442a04[_0xb0e6('0x4a')]=_[_0xb0e6('0x4e')](_0x442a04[_0xb0e6('0x4a')],{'$or':_[_0xb0e6('0x3b')](_0x442a04['attributes'],function(_0x52588a){var _0x44ecc7={};_0x44ecc7[_0x52588a]={'$like':'%'+_0x58f1ff[_0xb0e6('0x44')][_0xb0e6('0x4c')]+'%'};return _0x44ecc7;})});}_0x442a04=_[_0xb0e6('0x4e')]({},_0x442a04,_0x58f1ff['options']);return _0xfc3ac4[_0xb0e6('0x6c')](_0x442a04);}})[_0xb0e6('0x37')](function(_0x530385){if(_0x530385){_0x149d6c=_0x530385['length'];if(!_0x58f1ff['query'][_0xb0e6('0x6f')](_0xb0e6('0x48'))){_0x442a04[_0xb0e6('0x2e')]=qs[_0xb0e6('0x2e')](_0x58f1ff['query'][_0xb0e6('0x2e')]);_0x442a04[_0xb0e6('0x2d')]=qs['offset'](_0x58f1ff[_0xb0e6('0x44')][_0xb0e6('0x2d')]);}return _0xfc3ac4[_0xb0e6('0x6c')](_0x442a04);}})[_0xb0e6('0x37')](function(_0x287658){if(_0x287658){return _0x287658?{'count':_0x149d6c,'rows':_0x287658}:null;}})[_0xb0e6('0x37')](respondWithResult(_0x2ada44,null))[_0xb0e6('0x27')](handleError(_0x2ada44,null));};exports[_0xb0e6('0x70')]=function(_0x4e1d3f,_0x245911,_0x219312){var _0x4f4a80=_0x4e1d3f[_0xb0e6('0x59')][_0xb0e6('0x71')];return db[_0xb0e6('0x6e')]['findAll']({'where':{'id':_0x4f4a80},'attributes':['id'],'include':[{'model':db[_0xb0e6('0x64')],'as':_0xb0e6('0x72'),'attributes':['id','name',_0xb0e6('0x73'),'voicePause',_0xb0e6('0x74')],'raw':!![]}]})[_0xb0e6('0x37')](function(_0x2baf3e){if(_0x2baf3e){var _0x48c943=_['flatMap'](_0x2baf3e,function(_0x2a7130){var _0x2f6281=_0x2a7130['get']({'plain':!![]});return _0x2f6281['Agents'];});return db[_0xb0e6('0x3c')]['find']({'where':{'id':_0x4e1d3f[_0xb0e6('0x55')]['id']}})[_0xb0e6('0x37')](function(_0x36af5d){return db['sequelize'][_0xb0e6('0x75')](function(_0x3c326f){return _0x36af5d[_0xb0e6('0x70')](_0x4f4a80,{'transaction':_0x3c326f})[_0xb0e6('0x37')](function(){return BPromise['each'](_0x48c943,function(_0x40452a){return db[_0xb0e6('0x63')][_0xb0e6('0x76')]({'where':{'UserId':_0x40452a['id'],'ChatQueueId':_0x4e1d3f[_0xb0e6('0x55')]['id']},'transaction':_0x3c326f});});})[_0xb0e6('0x37')](function(){_0x48c943[_0xb0e6('0x77')](function(_0x4f3b63){socket['emit'](_0xb0e6('0x78'),{'UserId':_0x4f3b63['id'],'ChatQueueId':_0x36af5d['id']});});});});});}})[_0xb0e6('0x37')](respondWithStatusCode(_0x245911,null))[_0xb0e6('0x27')](handleError(_0x245911,null));};exports[_0xb0e6('0x79')]=function(_0x56fb7e,_0x8ba401,_0x2e0474){return db[_0xb0e6('0x6e')][_0xb0e6('0x52')]({'where':{'id':_0x56fb7e[_0xb0e6('0x44')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb0e6('0x64')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb0e6('0x37')](handleEntityNotFound(_0x8ba401,null))[_0xb0e6('0x37')](function(_0x3ab808){var _0x59a156=_[_0xb0e6('0x3b')](_0x3ab808,'id');var _0x58ca1a=[];var _0x3f390e=[];var _0xc73c55=squel[_0xb0e6('0x7a')]();_0xc73c55[_0xb0e6('0x7b')](_0xb0e6('0x7c'))[_0xb0e6('0x7d')](_0xb0e6('0x7e'),'tq')[_0xb0e6('0x7f')](_0xb0e6('0x80'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb0e6('0x4a')]('ChatQueueId\x20=\x20?',_0x56fb7e[_0xb0e6('0x55')]['id']);for(var _0x500622=0x0;_0x500622<_0x3ab808[_0xb0e6('0x47')];_0x500622+=0x1){let _0x215bd0=_0x3ab808[_0x500622];for(var _0x19b842=0x0;_0x19b842<_0x215bd0[_0xb0e6('0x72')][_0xb0e6('0x47')];_0x19b842+=0x1){let _0x5f5c41=_0x215bd0['Agents'][_0x19b842];var _0x4f2bcf=_0xc73c55[_0xb0e6('0x81')]();_0x4f2bcf[_0xb0e6('0x4a')]('ut.UserId\x20=\x20?',_0x5f5c41['id']);_0x3f390e['push'](db['sequelize'][_0xb0e6('0x44')](_0x4f2bcf[_0xb0e6('0x82')](),{'type':db[_0xb0e6('0x83')][_0xb0e6('0x84')]['SELECT']})[_0xb0e6('0x37')](function(_0xa31122){if(_0xa31122[_0xb0e6('0x47')]===0x1){return _0x5f5c41['id'];}else{var _0x2aef33=_['every'](_[_0xb0e6('0x3b')](_0xa31122,_0xb0e6('0x85')),function(_0x20d0b7){return _[_0xb0e6('0x86')](_0x59a156,_0x20d0b7);});if(_0x2aef33){return _0x5f5c41['id'];}}}));}}return BPromise['all'](_0x3f390e)[_0xb0e6('0x37')](function(_0x349ccf){_0x58ca1a=_(_0x58ca1a)[_0xb0e6('0x87')](_0x349ccf)[_0xb0e6('0x88')]()[_0xb0e6('0x89')]();return db[_0xb0e6('0x3c')][_0xb0e6('0x57')]({'where':{'id':_0x56fb7e[_0xb0e6('0x55')]['id']}})[_0xb0e6('0x37')](function(_0x57a761){return db[_0xb0e6('0x83')][_0xb0e6('0x75')](function(_0x5779dd){return _0x57a761['removeTeams'](_0x56fb7e[_0xb0e6('0x44')][_0xb0e6('0x71')],{'transaction':_0x5779dd})[_0xb0e6('0x37')](function(){if(!_[_0xb0e6('0x8a')](_0x58ca1a)){return _0x57a761[_0xb0e6('0x8b')](_0x58ca1a,{'transaction':_0x5779dd});}})[_0xb0e6('0x37')](function(){_0x58ca1a[_0xb0e6('0x77')](function(_0x268151){socket[_0xb0e6('0x8c')](_0xb0e6('0x8d'),{'UserId':_0x268151,'ChatQueueId':_0x57a761['id']});});});});});});})['then'](respondWithStatusCode(_0x8ba401,null))['catch'](handleError(_0x8ba401,null));};exports['addAgents']=function(_0x28859a,_0x3cfafd,_0x15bbed){return db[_0xb0e6('0x3c')][_0xb0e6('0x57')]({'where':{'id':_0x28859a[_0xb0e6('0x55')]['id']}})[_0xb0e6('0x37')](handleEntityNotFound(_0x3cfafd,null))[_0xb0e6('0x37')](function(_0x3f60c2){if(_0x3f60c2){return _0x3f60c2['addAgents'](_0x28859a['body']['ids'],_['omit'](_0x28859a[_0xb0e6('0x59')],[_0xb0e6('0x71'),'id'])||{})['spread'](function(_0x1bfe30){for(var _0x592580=0x0;_0x592580<_0x28859a[_0xb0e6('0x59')][_0xb0e6('0x71')][_0xb0e6('0x47')];_0x592580+=0x1){socket[_0xb0e6('0x8c')](_0xb0e6('0x78'),{'UserId':Number(_0x28859a['body'][_0xb0e6('0x71')][_0x592580]),'ChatQueueId':Number(_0x28859a[_0xb0e6('0x55')]['id'])});}return _0x1bfe30;});}})[_0xb0e6('0x37')](respondWithResult(_0x3cfafd,null))[_0xb0e6('0x27')](handleError(_0x3cfafd,null));};exports[_0xb0e6('0x8b')]=function(_0x9a9cd5,_0x38d852,_0x2ff060){return db[_0xb0e6('0x3c')][_0xb0e6('0x57')]({'where':{'id':_0x9a9cd5[_0xb0e6('0x55')]['id']}})['then'](handleEntityNotFound(_0x38d852,null))[_0xb0e6('0x37')](function(_0x5c683c){if(_0x5c683c){return _0x5c683c[_0xb0e6('0x8b')](_0x9a9cd5[_0xb0e6('0x44')]['ids'])[_0xb0e6('0x37')](function(){if(_[_0xb0e6('0x8e')](_0x9a9cd5['query'][_0xb0e6('0x71')])){for(var _0x5d6df9=0x0;_0x5d6df9<_0x9a9cd5[_0xb0e6('0x44')][_0xb0e6('0x71')]['length'];_0x5d6df9+=0x1){socket[_0xb0e6('0x8c')](_0xb0e6('0x8d'),{'UserId':Number(_0x9a9cd5[_0xb0e6('0x44')][_0xb0e6('0x71')][_0x5d6df9]),'ChatQueueId':Number(_0x9a9cd5['params']['id'])});}}else{socket[_0xb0e6('0x8c')](_0xb0e6('0x8d'),{'UserId':Number(_0x9a9cd5[_0xb0e6('0x44')][_0xb0e6('0x71')]),'ChatQueueId':Number(_0x9a9cd5[_0xb0e6('0x55')]['id'])});}});}})[_0xb0e6('0x37')](respondWithStatusCode(_0x38d852,null))[_0xb0e6('0x27')](handleError(_0x38d852,null));};exports[_0xb0e6('0x8f')]=function(_0xed7078,_0x55c2b5,_0x1c8126){var _0x4e6c19={};var _0x5984ff={};var _0x443ce7;var _0x463185;return db[_0xb0e6('0x3c')][_0xb0e6('0x6d')]({'where':{'id':_0xed7078[_0xb0e6('0x55')]['id']}})[_0xb0e6('0x37')](handleEntityNotFound(_0x55c2b5,null))[_0xb0e6('0x37')](function(_0x1dee9e){if(_0x1dee9e){_0x443ce7=_0x1dee9e;_0x5984ff['model']=_[_0xb0e6('0x42')](db[_0xb0e6('0x64')]['rawAttributes']);_0x5984ff['query']=_['keys'](_0xed7078[_0xb0e6('0x44')]);_0x5984ff[_0xb0e6('0x43')]=_[_0xb0e6('0x56')](_0x5984ff['model'],_0x5984ff[_0xb0e6('0x44')]);_0x4e6c19['attributes']=_[_0xb0e6('0x56')](_0x5984ff['model'],qs[_0xb0e6('0x46')](_0xed7078[_0xb0e6('0x44')]['fields']));_0x4e6c19[_0xb0e6('0x45')]=_0x4e6c19[_0xb0e6('0x45')]['length']?_0x4e6c19[_0xb0e6('0x45')]:_0x5984ff[_0xb0e6('0x41')];_0x4e6c19['order']=qs[_0xb0e6('0x49')](_0xed7078[_0xb0e6('0x44')][_0xb0e6('0x49')]);_0x4e6c19[_0xb0e6('0x4a')]=qs[_0xb0e6('0x43')](_[_0xb0e6('0x4b')](_0xed7078[_0xb0e6('0x44')],_0x5984ff[_0xb0e6('0x43')]));if(_0xed7078[_0xb0e6('0x44')][_0xb0e6('0x4c')]){_0x4e6c19[_0xb0e6('0x4a')]=_[_0xb0e6('0x4e')](_0x4e6c19[_0xb0e6('0x4a')],{'$or':_[_0xb0e6('0x3b')](_0x4e6c19[_0xb0e6('0x45')],function(_0x239e7c){var _0x2fa624={};_0x2fa624[_0x239e7c]={'$like':'%'+_0xed7078[_0xb0e6('0x44')][_0xb0e6('0x4c')]+'%'};return _0x2fa624;})});}_0x4e6c19=_[_0xb0e6('0x4e')]({},_0x4e6c19,_0xed7078[_0xb0e6('0x4f')]);return _0x443ce7['getAgents'](_0x4e6c19);}})[_0xb0e6('0x37')](function(_0x4903d3){if(_0x4903d3){_0x463185=_0x4903d3[_0xb0e6('0x47')];if(!_0xed7078[_0xb0e6('0x44')][_0xb0e6('0x6f')]('nolimit')){_0x4e6c19[_0xb0e6('0x2e')]=qs['limit'](_0xed7078['query'][_0xb0e6('0x2e')]);_0x4e6c19[_0xb0e6('0x2d')]=qs[_0xb0e6('0x2d')](_0xed7078['query'][_0xb0e6('0x2d')]);}return _0x443ce7['getAgents'](_0x4e6c19);}})[_0xb0e6('0x37')](function(_0x1cb55f){if(_0x1cb55f){return _0x1cb55f?{'count':_0x463185,'rows':_0x1cb55f}:null;}})[_0xb0e6('0x37')](respondWithResult(_0x55c2b5,null))['catch'](handleError(_0x55c2b5,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index dae7a21..1a10ae2 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 _0x0531=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3e18c9,_0x395158){var _0x254bb5=function(_0x2dd9ab){while(--_0x2dd9ab){_0x3e18c9['push'](_0x3e18c9['shift']());}};_0x254bb5(++_0x395158);}(_0x0531,0xde));var _0x1053=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0x0531[_0x3afe18];return _0x19ed1f;};'use strict';var EventEmitter=require(_0x1053('0x0'));var ChatQueue=require(_0x1053('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1053('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1c256c){return function(_0x117b5a,_0x12d7ea,_0x480ee9){ChatQueueEvents[_0x1053('0x3')](_0x1c256c+':'+_0x117b5a['id'],_0x117b5a);ChatQueueEvents[_0x1053('0x3')](_0x1c256c,_0x117b5a);_0x480ee9(null);};}for(var e in events){if(events[_0x1053('0x4')](e)){var event=events[e];ChatQueue[_0x1053('0x5')](e,emitEvent(event));}}module[_0x1053('0x6')]=ChatQueueEvents;
\ No newline at end of file
+var _0x203a=['emit','hasOwnProperty','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x1df814,_0x23c5a3){var _0x1c024a=function(_0x33903d){while(--_0x33903d){_0x1df814['push'](_0x1df814['shift']());}};_0x1c024a(++_0x23c5a3);}(_0x203a,0x136));var _0xa203=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x203a[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xa203('0x0'))['db'][_0xa203('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa203('0x2')](0x0);var events={'afterCreate':_0xa203('0x3'),'afterUpdate':_0xa203('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5bdf43){return function(_0x4541c8,_0xba923f,_0x2ed294){ChatQueueEvents[_0xa203('0x5')](_0x5bdf43+':'+_0x4541c8['id'],_0x4541c8);ChatQueueEvents[_0xa203('0x5')](_0x5bdf43,_0x4541c8);_0x2ed294(null);};}for(var e in events){if(events[_0xa203('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index aad0080..00a9124 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 _0xab4b=['chat_queues','util','api','moment','bluebird','rimraf','define','ChatQueue'];(function(_0x404c96,_0x16d4d6){var _0xaf8051=function(_0x4652d7){while(--_0x4652d7){_0x404c96['push'](_0x404c96['shift']());}};_0xaf8051(++_0x16d4d6);}(_0xab4b,0x189));var _0xbab4=function(_0x4c941f,_0x13e01d){_0x4c941f=_0x4c941f-0x0;var _0x59f360=_0xab4b[_0x4c941f];return _0x59f360;};'use strict';var _=require('lodash');var util=require(_0xbab4('0x0'));var logger=require('../../config/logger')(_0xbab4('0x1'));var moment=require(_0xbab4('0x2'));var BPromise=require(_0xbab4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbab4('0x4'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module['exports']=function(_0x130195,_0x41ee7e){return _0x130195[_0xbab4('0x5')](_0xbab4('0x6'),attributes,{'tableName':_0xbab4('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb86=['api','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','util','../../config/logger'];(function(_0x8b4d03,_0x309b11){var _0x23fb53=function(_0x20fde6){while(--_0x20fde6){_0x8b4d03['push'](_0x8b4d03['shift']());}};_0x23fb53(++_0x309b11);}(_0xfb86,0x1aa));var _0x6fb8=function(_0x16f77c,_0x5256b1){_0x16f77c=_0x16f77c-0x0;var _0x78986e=_0xfb86[_0x16f77c];return _0x78986e;};'use strict';var _=require(_0x6fb8('0x0'));var util=require(_0x6fb8('0x1'));var logger=require(_0x6fb8('0x2'))(_0x6fb8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6fb8('0x4'));var rimraf=require(_0x6fb8('0x5'));var config=require(_0x6fb8('0x6'));var attributes=require(_0x6fb8('0x7'));module[_0x6fb8('0x8')]=function(_0x2bf60e,_0x5605ef){return _0x2bf60e[_0x6fb8('0x9')](_0x6fb8('0xa'),attributes,{'tableName':'chat_queues','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 d183f77..9daf840 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 _0x2d07=['http','redis','defaults','socket.io-emitter','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetChatQueue','findAll','options','raw','where','attributes','include','map','model','then','ShowChatQueue','ChatQueue','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x2d07,0x13a));var _0x72d0=function(_0x4d3a2b,_0x32a224){_0x4d3a2b=_0x4d3a2b-0x0;var _0xdd32c8=_0x2d07[_0x4d3a2b];return _0xdd32c8;};'use strict';var _=require(_0x72d0('0x0'));var util=require(_0x72d0('0x1'));var moment=require('moment');var BPromise=require(_0x72d0('0x2'));var rs=require(_0x72d0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d0('0x4'))['db'];var utils=require(_0x72d0('0x5'));var logger=require(_0x72d0('0x6'))(_0x72d0('0x7'));var config=require(_0x72d0('0x8'));var jayson=require(_0x72d0('0x9'));var client=jayson['client'][_0x72d0('0xa')]({'port':0x232a});config[_0x72d0('0xb')]=_[_0x72d0('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x72d0('0xd'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0xb6293,_0x4116c1,_0x1d8102){return new BPromise(function(_0x36c904,_0x4b545f){return client['request'](_0xb6293,_0x1d8102)['then'](function(_0x17f795){logger[_0x72d0('0xe')](_0x72d0('0xf'),_0x4116c1,_0x72d0('0x10'));logger[_0x72d0('0x11')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4116c1,_0x72d0('0x10'),JSON[_0x72d0('0x12')](_0x17f795));if(_0x17f795[_0x72d0('0x13')]){if(_0x17f795['error'][_0x72d0('0x14')]===0x1f4){logger[_0x72d0('0x13')](_0x72d0('0xf'),_0x4116c1,_0x17f795[_0x72d0('0x13')][_0x72d0('0x15')]);return _0x4b545f(_0x17f795[_0x72d0('0x13')]['message']);}logger[_0x72d0('0x13')](_0x72d0('0xf'),_0x4116c1,_0x17f795[_0x72d0('0x13')][_0x72d0('0x15')]);return _0x36c904(_0x17f795[_0x72d0('0x13')][_0x72d0('0x15')]);}else{logger[_0x72d0('0xe')](_0x72d0('0xf'),_0x4116c1,_0x72d0('0x10'));_0x36c904(_0x17f795['result'][_0x72d0('0x15')]);}})[_0x72d0('0x16')](function(_0x2cd4aa){logger[_0x72d0('0x13')](_0x72d0('0xf'),_0x4116c1,_0x2cd4aa);_0x4b545f(_0x2cd4aa);});});}exports[_0x72d0('0x17')]=function(_0x59d3d9){var _0x4d65f3=this;return new Promise(function(_0x5c905a,_0x4cbdf1){return db['ChatQueue'][_0x72d0('0x18')]({'raw':_0x59d3d9[_0x72d0('0x19')]?_0x59d3d9['options'][_0x72d0('0x1a')]===undefined?!![]:![]:!![],'where':_0x59d3d9[_0x72d0('0x19')]?_0x59d3d9['options'][_0x72d0('0x1b')]||null:null,'attributes':_0x59d3d9[_0x72d0('0x19')]?_0x59d3d9['options'][_0x72d0('0x1c')]||null:null,'limit':_0x59d3d9[_0x72d0('0x19')]?_0x59d3d9[_0x72d0('0x19')]['limit']||null:null,'include':_0x59d3d9[_0x72d0('0x19')]?_0x59d3d9[_0x72d0('0x19')][_0x72d0('0x1d')]?_[_0x72d0('0x1e')](_0x59d3d9['options'][_0x72d0('0x1d')],function(_0x136d5e){return{'model':db[_0x136d5e[_0x72d0('0x1f')]],'as':_0x136d5e['as'],'attributes':_0x136d5e[_0x72d0('0x1c')],'include':_0x136d5e[_0x72d0('0x1d')]?_[_0x72d0('0x1e')](_0x136d5e[_0x72d0('0x1d')],function(_0x4e6093){return{'model':db[_0x4e6093[_0x72d0('0x1f')]],'as':_0x4e6093['as'],'attributes':_0x4e6093['attributes'],'include':_0x4e6093[_0x72d0('0x1d')]?_[_0x72d0('0x1e')](_0x4e6093[_0x72d0('0x1d')],function(_0x2191db){return{'model':db[_0x2191db[_0x72d0('0x1f')]],'as':_0x2191db['as'],'attributes':_0x2191db['attributes']};}):[]};}):[]};}):[]:[]})[_0x72d0('0x20')](function(_0x174cd0){logger['info'](_0x72d0('0x17'),_0x59d3d9);logger[_0x72d0('0x11')](_0x72d0('0x17'),_0x59d3d9,JSON['stringify'](_0x174cd0));_0x5c905a(_0x174cd0);})[_0x72d0('0x16')](function(_0x1d16fa){logger['error'](_0x72d0('0x17'),_0x1d16fa['message'],_0x59d3d9);_0x4cbdf1(_0x4d65f3[_0x72d0('0x13')](0x1f4,_0x1d16fa[_0x72d0('0x15')]));});});};exports[_0x72d0('0x21')]=function(_0x1759fa){var _0x2e596f=this;return new Promise(function(_0x293a3e,_0x3b4459){return db[_0x72d0('0x22')][_0x72d0('0x23')]({'raw':_0x1759fa[_0x72d0('0x19')]?_0x1759fa[_0x72d0('0x19')][_0x72d0('0x1a')]===undefined?!![]:![]:!![],'where':_0x1759fa['options']?_0x1759fa[_0x72d0('0x19')][_0x72d0('0x1b')]||null:null,'attributes':_0x1759fa[_0x72d0('0x19')]?_0x1759fa[_0x72d0('0x19')][_0x72d0('0x1c')]||null:null,'include':_0x1759fa[_0x72d0('0x19')]?_0x1759fa[_0x72d0('0x19')][_0x72d0('0x1d')]?_['map'](_0x1759fa[_0x72d0('0x19')][_0x72d0('0x1d')],function(_0x509aab){return{'model':db[_0x509aab['model']],'as':_0x509aab['as'],'attributes':_0x509aab[_0x72d0('0x1c')],'include':_0x509aab[_0x72d0('0x1d')]?_[_0x72d0('0x1e')](_0x509aab[_0x72d0('0x1d')],function(_0x1ffd9a){return{'model':db[_0x1ffd9a[_0x72d0('0x1f')]],'as':_0x1ffd9a['as'],'attributes':_0x1ffd9a[_0x72d0('0x1c')],'include':_0x1ffd9a[_0x72d0('0x1d')]?_[_0x72d0('0x1e')](_0x1ffd9a[_0x72d0('0x1d')],function(_0x14ddf2){return{'model':db[_0x14ddf2[_0x72d0('0x1f')]],'as':_0x14ddf2['as'],'attributes':_0x14ddf2[_0x72d0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x72d0('0x20')](function(_0x4ae4fd){logger['info'](_0x72d0('0x21'),_0x1759fa);logger[_0x72d0('0x11')]('ShowChatQueue',_0x1759fa,JSON[_0x72d0('0x12')](_0x4ae4fd));_0x293a3e(_0x4ae4fd);})[_0x72d0('0x16')](function(_0x519e8a){logger[_0x72d0('0x13')](_0x72d0('0x21'),_0x519e8a[_0x72d0('0x15')],_0x1759fa);_0x3b4459(_0x2e596f['error'](0x1f4,_0x519e8a[_0x72d0('0x15')]));});});};
\ No newline at end of file
+var _0x5323=['ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','result','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetChatQueue','catch','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','socket.io-emitter','register','request\x20sent','debug'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x5323,0x88));var _0x3532=function(_0x2bd622,_0x3ced57){_0x2bd622=_0x2bd622-0x0;var _0x4c4cb4=_0x5323[_0x2bd622];return _0x4c4cb4;};'use strict';var _=require(_0x3532('0x0'));var util=require(_0x3532('0x1'));var moment=require(_0x3532('0x2'));var BPromise=require(_0x3532('0x3'));var rs=require(_0x3532('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3532('0x5'))['db'];var utils=require(_0x3532('0x6'));var logger=require(_0x3532('0x7'))('rpc');var config=require(_0x3532('0x8'));var jayson=require(_0x3532('0x9'));var client=jayson[_0x3532('0xa')]['http']({'port':0x232a});config[_0x3532('0xb')]=_['defaults'](config[_0x3532('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3532('0xc'))(new Redis(config[_0x3532('0xb')]));require('./chatQueue.socket')[_0x3532('0xd')](socket);function respondWithRpcPromise(_0x256950,_0x1f2444,_0x3d840a){return new BPromise(function(_0x56bebc,_0x502a7e){return client['request'](_0x256950,_0x3d840a)['then'](function(_0x127a0b){logger['info']('ChatQueue,\x20%s,\x20%s',_0x1f2444,_0x3532('0xe'));logger[_0x3532('0xf')](_0x3532('0x10'),_0x1f2444,'request\x20sent',JSON[_0x3532('0x11')](_0x127a0b));if(_0x127a0b[_0x3532('0x12')]){if(_0x127a0b['error'][_0x3532('0x13')]===0x1f4){logger[_0x3532('0x12')](_0x3532('0x14'),_0x1f2444,_0x127a0b[_0x3532('0x12')]['message']);return _0x502a7e(_0x127a0b[_0x3532('0x12')]['message']);}logger['error'](_0x3532('0x14'),_0x1f2444,_0x127a0b[_0x3532('0x12')]['message']);return _0x56bebc(_0x127a0b[_0x3532('0x12')][_0x3532('0x15')]);}else{logger[_0x3532('0x16')](_0x3532('0x14'),_0x1f2444,_0x3532('0xe'));_0x56bebc(_0x127a0b[_0x3532('0x17')][_0x3532('0x15')]);}})['catch'](function(_0x325a5b){logger[_0x3532('0x12')](_0x3532('0x14'),_0x1f2444,_0x325a5b);_0x502a7e(_0x325a5b);});});}exports['GetChatQueue']=function(_0x11f070){var _0x4139b7=this;return new Promise(function(_0x45bc6d,_0x250590){return db[_0x3532('0x18')][_0x3532('0x19')]({'raw':_0x11f070[_0x3532('0x1a')]?_0x11f070[_0x3532('0x1a')][_0x3532('0x1b')]===undefined?!![]:![]:!![],'where':_0x11f070[_0x3532('0x1a')]?_0x11f070[_0x3532('0x1a')][_0x3532('0x1c')]||null:null,'attributes':_0x11f070['options']?_0x11f070[_0x3532('0x1a')][_0x3532('0x1d')]||null:null,'limit':_0x11f070['options']?_0x11f070[_0x3532('0x1a')][_0x3532('0x1e')]||null:null,'include':_0x11f070[_0x3532('0x1a')]?_0x11f070[_0x3532('0x1a')][_0x3532('0x1f')]?_['map'](_0x11f070[_0x3532('0x1a')][_0x3532('0x1f')],function(_0x1ed50b){return{'model':db[_0x1ed50b[_0x3532('0x20')]],'as':_0x1ed50b['as'],'attributes':_0x1ed50b[_0x3532('0x1d')],'include':_0x1ed50b['include']?_[_0x3532('0x21')](_0x1ed50b[_0x3532('0x1f')],function(_0x486e90){return{'model':db[_0x486e90[_0x3532('0x20')]],'as':_0x486e90['as'],'attributes':_0x486e90[_0x3532('0x1d')],'include':_0x486e90[_0x3532('0x1f')]?_[_0x3532('0x21')](_0x486e90['include'],function(_0x59b39a){return{'model':db[_0x59b39a[_0x3532('0x20')]],'as':_0x59b39a['as'],'attributes':_0x59b39a[_0x3532('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4058b8){logger['info'](_0x3532('0x22'),_0x11f070);logger['debug'](_0x3532('0x22'),_0x11f070,JSON['stringify'](_0x4058b8));_0x45bc6d(_0x4058b8);})[_0x3532('0x23')](function(_0x574b20){logger[_0x3532('0x12')](_0x3532('0x22'),_0x574b20[_0x3532('0x15')],_0x11f070);_0x250590(_0x4139b7[_0x3532('0x12')](0x1f4,_0x574b20['message']));});});};exports[_0x3532('0x24')]=function(_0xaafb12){var _0x5f28d9=this;return new Promise(function(_0x28e145,_0x57baca){return db[_0x3532('0x18')][_0x3532('0x25')]({'raw':_0xaafb12['options']?_0xaafb12[_0x3532('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xaafb12[_0x3532('0x1a')]?_0xaafb12[_0x3532('0x1a')][_0x3532('0x1c')]||null:null,'attributes':_0xaafb12[_0x3532('0x1a')]?_0xaafb12[_0x3532('0x1a')]['attributes']||null:null,'include':_0xaafb12['options']?_0xaafb12[_0x3532('0x1a')][_0x3532('0x1f')]?_[_0x3532('0x21')](_0xaafb12[_0x3532('0x1a')]['include'],function(_0x26d267){return{'model':db[_0x26d267[_0x3532('0x20')]],'as':_0x26d267['as'],'attributes':_0x26d267['attributes'],'include':_0x26d267['include']?_['map'](_0x26d267['include'],function(_0x159b05){return{'model':db[_0x159b05['model']],'as':_0x159b05['as'],'attributes':_0x159b05[_0x3532('0x1d')],'include':_0x159b05['include']?_['map'](_0x159b05[_0x3532('0x1f')],function(_0x99eca0){return{'model':db[_0x99eca0[_0x3532('0x20')]],'as':_0x99eca0['as'],'attributes':_0x99eca0[_0x3532('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27f3cf){logger[_0x3532('0x16')](_0x3532('0x24'),_0xaafb12);logger[_0x3532('0xf')](_0x3532('0x24'),_0xaafb12,JSON[_0x3532('0x11')](_0x27f3cf));_0x28e145(_0x27f3cf);})['catch'](function(_0x4a7e4c){logger[_0x3532('0x12')](_0x3532('0x24'),_0x4a7e4c[_0x3532('0x15')],_0xaafb12);_0x57baca(_0x5f28d9['error'](0x1f4,_0x4a7e4c['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index eebd220..27d3804 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 _0x6aa7=['update','emit','length','chatQueue:','./chatQueue.events','remove'];(function(_0x413727,_0x17adb1){var _0x5f46d7=function(_0xbb668e){while(--_0xbb668e){_0x413727['push'](_0x413727['shift']());}};_0x5f46d7(++_0x17adb1);}(_0x6aa7,0x178));var _0x76aa=function(_0x2ddfbc,_0x3df0d2){_0x2ddfbc=_0x2ddfbc-0x0;var _0x184214=_0x6aa7[_0x2ddfbc];return _0x184214;};'use strict';var ChatQueueEvents=require(_0x76aa('0x0'));var events=['save',_0x76aa('0x1'),_0x76aa('0x2')];function createListener(_0x25c818,_0x2db4fe){return function(_0x4f007e){_0x2db4fe[_0x76aa('0x3')](_0x25c818,_0x4f007e);};}function removeListener(_0xef15ef,_0x1d6e04){return function(){ChatQueueEvents['removeListener'](_0xef15ef,_0x1d6e04);};}exports['register']=function(_0x1aceaa){for(var _0x4d53f6=0x0,_0x32dee5=events[_0x76aa('0x4')];_0x4d53f6<_0x32dee5;_0x4d53f6++){var _0xa9b695=events[_0x4d53f6];var _0x56d6bc=createListener(_0x76aa('0x5')+_0xa9b695,_0x1aceaa);ChatQueueEvents['on'](_0xa9b695,_0x56d6bc);}};
\ No newline at end of file
+var _0x4ea3=['removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x54175d,_0x41e8d6){var _0x48d99e=function(_0x2cd915){while(--_0x2cd915){_0x54175d['push'](_0x54175d['shift']());}};_0x48d99e(++_0x41e8d6);}(_0x4ea3,0x70));var _0x34ea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4ea3[_0x14add3];return _0x4a174f;};'use strict';var ChatQueueEvents=require(_0x34ea('0x0'));var events=[_0x34ea('0x1'),_0x34ea('0x2'),_0x34ea('0x3')];function createListener(_0x588172,_0x374ec1){return function(_0x494b56){_0x374ec1[_0x34ea('0x4')](_0x588172,_0x494b56);};}function removeListener(_0x571f1b,_0x5e5a84){return function(){ChatQueueEvents[_0x34ea('0x5')](_0x571f1b,_0x5e5a84);};}exports[_0x34ea('0x6')]=function(_0x962596){for(var _0x123d48=0x0,_0x40434e=events[_0x34ea('0x7')];_0x123d48<_0x40434e;_0x123d48++){var _0x22b09e=events[_0x123d48];var _0x5bec7c=createListener(_0x34ea('0x8')+_0x22b09e,_0x962596);ChatQueueEvents['on'](_0x22b09e,_0x5bec7c);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index ee05915..9f31c67 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e74,0x175));var _0x43e7=function(_0x24f8a4,_0x1a7be4){_0x24f8a4=_0x24f8a4-0x0;var _0x22b7a1=_0x3e74[_0x24f8a4];return _0x22b7a1;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
+var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2d24b5,_0x4d840a){var _0x2556b5=function(_0x66db30){while(--_0x66db30){_0x2d24b5['push'](_0x2d24b5['shift']());}};_0x2556b5(++_0x4d840a);}(_0x7217,0x19e));var _0x7721=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x7217[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index e290dc3..09aa1cd 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 _0x4172=['moment','sequelize','STRING','DATE'];(function(_0x2d32fa,_0x1bb197){var _0x1584f4=function(_0x208364){while(--_0x208364){_0x2d32fa['push'](_0x2d32fa['shift']());}};_0x1584f4(++_0x1bb197);}(_0x4172,0xbc));var _0x2417=function(_0x1b3b38,_0x2ba1bf){_0x1b3b38=_0x1b3b38-0x0;var _0x25fb7c=_0x4172[_0x1b3b38];return _0x25fb7c;};'use strict';var moment=require(_0x2417('0x0'));var Sequelize=require(_0x2417('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x2417('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2417('0x2')]},'joinAt':{'type':Sequelize[_0x2417('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2417('0x3')]},'reason':{'type':Sequelize[_0x2417('0x2')]}};
\ No newline at end of file
+var _0xae3d=['sequelize','exports','STRING','DATE'];(function(_0x13c854,_0x78a8cf){var _0x37ac27=function(_0x260638){while(--_0x260638){_0x13c854['push'](_0x13c854['shift']());}};_0x37ac27(++_0x78a8cf);}(_0xae3d,0x148));var _0xdae3=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xae3d[_0x11c573];return _0x6b72de;};'use strict';var moment=require('moment');var Sequelize=require(_0xdae3('0x0'));module[_0xdae3('0x1')]={'uniqueid':{'type':Sequelize[_0xdae3('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xdae3('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xdae3('0x3')]},'exitAt':{'type':Sequelize[_0xdae3('0x3')]},'reason':{'type':Sequelize[_0xdae3('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 2a5b66b..cc96b87 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 _0x9e69=['ChatQueueReport','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map'];(function(_0x1c9c24,_0x2a517b){var _0x349c69=function(_0x259ff7){while(--_0x259ff7){_0x1c9c24['push'](_0x1c9c24['shift']());}};_0x349c69(++_0x2a517b);}(_0x9e69,0x150));var _0x99e6=function(_0x5f1c7b,_0x406874){_0x5f1c7b=_0x5f1c7b-0x0;var _0x1f6a0d=_0x9e69[_0x5f1c7b];return _0x1f6a0d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x99e6('0x0'));var zipdir=require(_0x99e6('0x1'));var jsonpatch=require(_0x99e6('0x2'));var rp=require(_0x99e6('0x3'));var moment=require('moment');var BPromise=require(_0x99e6('0x4'));var Mustache=require(_0x99e6('0x5'));var util=require('util');var path=require(_0x99e6('0x6'));var sox=require(_0x99e6('0x7'));var csv=require(_0x99e6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99e6('0x9'));var _=require(_0x99e6('0xa'));var squel=require(_0x99e6('0xb'));var crypto=require('crypto');var jsforce=require(_0x99e6('0xc'));var deskjs=require(_0x99e6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x99e6('0xe'));var Papa=require(_0x99e6('0xf'));var Redis=require('ioredis');var authService=require(_0x99e6('0x10'));var qs=require(_0x99e6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x99e6('0x12'))(_0x99e6('0x13'));var utils=require(_0x99e6('0x14'));var config=require(_0x99e6('0x15'));var licenseUtil=require(_0x99e6('0x16'));var db=require(_0x99e6('0x17'))['db'];function respondWithStatusCode(_0x51de85,_0x13a62b){_0x13a62b=_0x13a62b||0xcc;return function(_0x4033c5){if(_0x4033c5){return _0x51de85[_0x99e6('0x18')](_0x13a62b);}return _0x51de85['status'](_0x13a62b)[_0x99e6('0x19')]();};}function respondWithResult(_0x4061b2,_0x2cf6a4){_0x2cf6a4=_0x2cf6a4||0xc8;return function(_0x57111c){if(_0x57111c){return _0x4061b2['status'](_0x2cf6a4)['json'](_0x57111c);}};}function respondWithFilteredResult(_0x40fdb8,_0x4741c9){return function(_0x1d910a){if(_0x1d910a){var _0x5d5cd5=typeof _0x4741c9[_0x99e6('0x1a')]===_0x99e6('0x1b')&&typeof _0x4741c9[_0x99e6('0x1c')]===_0x99e6('0x1b');var _0x3a302d=_0x1d910a['count'];var _0x2e9e24=_0x5d5cd5?0x0:_0x4741c9['offset'];var _0x2749bf=_0x5d5cd5?_0x1d910a[_0x99e6('0x1d')]:_0x4741c9['offset']+_0x4741c9[_0x99e6('0x1c')];var _0x3c4cc8;if(_0x2749bf>=_0x3a302d){_0x2749bf=_0x3a302d;_0x3c4cc8=0xc8;}else{_0x3c4cc8=0xce;}_0x40fdb8[_0x99e6('0x1e')](_0x3c4cc8);return _0x40fdb8[_0x99e6('0x1f')](_0x99e6('0x20'),_0x2e9e24+'-'+_0x2749bf+'/'+_0x3a302d)[_0x99e6('0x21')](_0x1d910a);}return null;};}function patchUpdates(_0x41a32b){return function(_0x95a8e5){try{jsonpatch[_0x99e6('0x22')](_0x95a8e5,_0x41a32b,!![]);}catch(_0xef736c){return BPromise['reject'](_0xef736c);}return _0x95a8e5[_0x99e6('0x23')]();};}function saveUpdates(_0xef9c63,_0x16f05d){return function(_0x249872){if(_0x249872){return _0x249872[_0x99e6('0x24')](_0xef9c63)[_0x99e6('0x25')](function(_0x2a308f){return _0x2a308f;});}return null;};}function removeEntity(_0xa0b949,_0x2033af){return function(_0x1b4339){if(_0x1b4339){return _0x1b4339[_0x99e6('0x26')]()[_0x99e6('0x25')](function(){_0xa0b949[_0x99e6('0x1e')](0xcc)[_0x99e6('0x19')]();});}};}function handleEntityNotFound(_0x210b02,_0x19d2f1){return function(_0x17bc07){if(!_0x17bc07){_0x210b02['sendStatus'](0x194);}return _0x17bc07;};}function handleError(_0x43038d,_0x5390b3){_0x5390b3=_0x5390b3||0x1f4;return function(_0x30b956){logger[_0x99e6('0x27')](_0x30b956[_0x99e6('0x28')]);if(_0x30b956['name']){delete _0x30b956[_0x99e6('0x29')];}_0x43038d['status'](_0x5390b3)[_0x99e6('0x2a')](_0x30b956);};}exports['index']=function(_0x39ca5d,_0x46343f){var _0x4b58c7={},_0x4d6b19={},_0x2c9b92={'count':0x0,'rows':[]};var _0x350fa0=_[_0x99e6('0x2b')](db[_0x99e6('0x2c')][_0x99e6('0x2d')],function(_0x4b92af){return{'name':_0x4b92af[_0x99e6('0x2e')],'type':_0x4b92af[_0x99e6('0x2f')][_0x99e6('0x30')]};});_0x4d6b19['model']=_['map'](_0x350fa0,_0x99e6('0x29'));_0x4d6b19['query']=_['keys'](_0x39ca5d[_0x99e6('0x31')]);_0x4d6b19['filters']=_[_0x99e6('0x32')](_0x4d6b19[_0x99e6('0x33')],_0x4d6b19[_0x99e6('0x31')]);_0x4b58c7['attributes']=_[_0x99e6('0x32')](_0x4d6b19[_0x99e6('0x33')],qs[_0x99e6('0x34')](_0x39ca5d[_0x99e6('0x31')]['fields']));_0x4b58c7[_0x99e6('0x35')]=_0x4b58c7[_0x99e6('0x35')][_0x99e6('0x36')]?_0x4b58c7[_0x99e6('0x35')]:_0x4d6b19[_0x99e6('0x33')];if(!_0x39ca5d[_0x99e6('0x31')]['hasOwnProperty'](_0x99e6('0x37'))){_0x4b58c7['limit']=qs['limit'](_0x39ca5d['query'][_0x99e6('0x1c')]);_0x4b58c7[_0x99e6('0x1a')]=qs['offset'](_0x39ca5d[_0x99e6('0x31')][_0x99e6('0x1a')]);}_0x4b58c7[_0x99e6('0x38')]=qs[_0x99e6('0x39')](_0x39ca5d[_0x99e6('0x31')][_0x99e6('0x39')]);_0x4b58c7['where']=qs[_0x99e6('0x3a')](_[_0x99e6('0x3b')](_0x39ca5d[_0x99e6('0x31')],_0x4d6b19[_0x99e6('0x3a')]),_0x350fa0);if(_0x39ca5d['query'][_0x99e6('0x3c')]){_0x4b58c7[_0x99e6('0x3d')]=_[_0x99e6('0x3e')](_0x4b58c7[_0x99e6('0x3d')],{'$or':_[_0x99e6('0x2b')](_0x350fa0,function(_0x2fc6e5){if(_0x2fc6e5[_0x99e6('0x2f')]!=='VIRTUAL'){var _0x4b888c={};_0x4b888c[_0x2fc6e5['name']]={'$like':'%'+_0x39ca5d[_0x99e6('0x31')][_0x99e6('0x3c')]+'%'};return _0x4b888c;}})});}_0x4b58c7=_['merge']({},_0x4b58c7,_0x39ca5d[_0x99e6('0x3f')]);var _0x2975d8={'where':_0x4b58c7[_0x99e6('0x3d')]};return db[_0x99e6('0x2c')][_0x99e6('0x1d')](_0x2975d8)[_0x99e6('0x25')](function(_0x26cade){_0x2c9b92[_0x99e6('0x1d')]=_0x26cade;if(_0x39ca5d[_0x99e6('0x31')][_0x99e6('0x40')]){_0x4b58c7[_0x99e6('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x99e6('0x42')](_0x4b58c7);})[_0x99e6('0x25')](function(_0x13ee61){_0x2c9b92[_0x99e6('0x43')]=_0x13ee61;return _0x2c9b92;})[_0x99e6('0x25')](respondWithFilteredResult(_0x46343f,_0x4b58c7))[_0x99e6('0x44')](handleError(_0x46343f,null));};exports[_0x99e6('0x45')]=function(_0x34991f,_0x2f5b4f){var _0x534f05={'raw':!![],'where':{'id':_0x34991f['params']['id']}},_0x562921={};_0x562921['model']=_['keys'](db[_0x99e6('0x2c')][_0x99e6('0x2d')]);_0x562921['query']=_[_0x99e6('0x46')](_0x34991f[_0x99e6('0x31')]);_0x562921[_0x99e6('0x3a')]=_[_0x99e6('0x32')](_0x562921[_0x99e6('0x33')],_0x562921[_0x99e6('0x31')]);_0x534f05['attributes']=_[_0x99e6('0x32')](_0x562921[_0x99e6('0x33')],qs[_0x99e6('0x34')](_0x34991f[_0x99e6('0x31')][_0x99e6('0x34')]));_0x534f05[_0x99e6('0x35')]=_0x534f05[_0x99e6('0x35')][_0x99e6('0x36')]?_0x534f05[_0x99e6('0x35')]:_0x562921[_0x99e6('0x33')];if(_0x34991f[_0x99e6('0x31')][_0x99e6('0x40')]){_0x534f05[_0x99e6('0x41')]=[{'all':!![]}];}_0x534f05=_[_0x99e6('0x3e')]({},_0x534f05,_0x34991f['options']);return db['ChatQueueReport']['find'](_0x534f05)['then'](handleEntityNotFound(_0x2f5b4f,null))[_0x99e6('0x25')](respondWithResult(_0x2f5b4f,null))[_0x99e6('0x44')](handleError(_0x2f5b4f,null));};exports[_0x99e6('0x47')]=function(_0x10d693,_0x2c071f){return db['ChatQueueReport']['create'](_0x10d693[_0x99e6('0x48')],{})[_0x99e6('0x25')](respondWithResult(_0x2c071f,0xc9))['catch'](handleError(_0x2c071f,null));};exports['update']=function(_0x10a08e,_0x437bf2){if(_0x10a08e['body']['id']){delete _0x10a08e[_0x99e6('0x48')]['id'];}return db['ChatQueueReport'][_0x99e6('0x49')]({'where':{'id':_0x10a08e[_0x99e6('0x4a')]['id']}})[_0x99e6('0x25')](handleEntityNotFound(_0x437bf2,null))['then'](saveUpdates(_0x10a08e[_0x99e6('0x48')],null))[_0x99e6('0x25')](respondWithResult(_0x437bf2,null))['catch'](handleError(_0x437bf2,null));};exports[_0x99e6('0x26')]=function(_0x202159,_0x35973e){return db['ChatQueueReport']['find']({'where':{'id':_0x202159[_0x99e6('0x4a')]['id']}})[_0x99e6('0x25')](handleEntityNotFound(_0x35973e,null))['then'](removeEntity(_0x35973e,null))[_0x99e6('0x44')](handleError(_0x35973e,null));};exports[_0x99e6('0x4b')]=function(_0x20d286,_0x40de95){return db[_0x99e6('0x2c')][_0x99e6('0x4b')]()[_0x99e6('0x25')](respondWithResult(_0x40de95,null))['catch'](handleError(_0x40de95,null));};
\ No newline at end of file
+var _0x297f=['params','keys','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','save','update','then','error','stack','name','ChatQueueReport','rawAttributes','fieldName','type','key','map','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch'];(function(_0x581705,_0x383fee){var _0x112198=function(_0xc74131){while(--_0xc74131){_0x581705['push'](_0x581705['shift']());}};_0x112198(++_0x383fee);}(_0x297f,0x1f0));var _0xf297=function(_0x15e5c8,_0xb433a0){_0x15e5c8=_0x15e5c8-0x0;var _0x204b3e=_0x297f[_0x15e5c8];return _0x204b3e;};'use strict';var emlformat=require(_0xf297('0x0'));var rimraf=require(_0xf297('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf297('0x2'));var moment=require(_0xf297('0x3'));var BPromise=require(_0xf297('0x4'));var Mustache=require(_0xf297('0x5'));var util=require('util');var path=require(_0xf297('0x6'));var sox=require('sox');var csv=require(_0xf297('0x7'));var ejs=require(_0xf297('0x8'));var fs=require('fs');var fs_extra=require(_0xf297('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf297('0xa'));var jsforce=require(_0xf297('0xb'));var deskjs=require(_0xf297('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf297('0xd'));var Papa=require(_0xf297('0xe'));var Redis=require('ioredis');var authService=require(_0xf297('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf297('0x10'));var hardwareService=require(_0xf297('0x11'));var logger=require(_0xf297('0x12'))('api');var utils=require(_0xf297('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf297('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5534f1,_0x395101){_0x395101=_0x395101||0xcc;return function(_0x3554b1){if(_0x3554b1){return _0x5534f1[_0xf297('0x15')](_0x395101);}return _0x5534f1[_0xf297('0x16')](_0x395101)[_0xf297('0x17')]();};}function respondWithResult(_0x3b7941,_0x5c5e7c){_0x5c5e7c=_0x5c5e7c||0xc8;return function(_0xb7647b){if(_0xb7647b){return _0x3b7941[_0xf297('0x16')](_0x5c5e7c)['json'](_0xb7647b);}};}function respondWithFilteredResult(_0x42fd50,_0x5eed15){return function(_0x2dd842){if(_0x2dd842){var _0x12c499=typeof _0x5eed15[_0xf297('0x18')]==='undefined'&&typeof _0x5eed15['limit']===_0xf297('0x19');var _0x1e2a77=_0x2dd842['count'];var _0x47d584=_0x12c499?0x0:_0x5eed15[_0xf297('0x18')];var _0x1932df=_0x12c499?_0x2dd842['count']:_0x5eed15[_0xf297('0x18')]+_0x5eed15[_0xf297('0x1a')];var _0x3ccb7;if(_0x1932df>=_0x1e2a77){_0x1932df=_0x1e2a77;_0x3ccb7=0xc8;}else{_0x3ccb7=0xce;}_0x42fd50['status'](_0x3ccb7);return _0x42fd50[_0xf297('0x1b')](_0xf297('0x1c'),_0x47d584+'-'+_0x1932df+'/'+_0x1e2a77)[_0xf297('0x1d')](_0x2dd842);}return null;};}function patchUpdates(_0x556c15){return function(_0x5f96ba){try{jsonpatch[_0xf297('0x1e')](_0x5f96ba,_0x556c15,!![]);}catch(_0x13ec1d){return BPromise['reject'](_0x13ec1d);}return _0x5f96ba[_0xf297('0x1f')]();};}function saveUpdates(_0x10830f,_0x4023a3){return function(_0x4cf7f7){if(_0x4cf7f7){return _0x4cf7f7[_0xf297('0x20')](_0x10830f)[_0xf297('0x21')](function(_0x6721c2){return _0x6721c2;});}return null;};}function removeEntity(_0x18d62b,_0x5335ca){return function(_0x27265c){if(_0x27265c){return _0x27265c['destroy']()[_0xf297('0x21')](function(){_0x18d62b[_0xf297('0x16')](0xcc)[_0xf297('0x17')]();});}};}function handleEntityNotFound(_0x3064dc,_0x2bd9a3){return function(_0x5a6335){if(!_0x5a6335){_0x3064dc['sendStatus'](0x194);}return _0x5a6335;};}function handleError(_0x8fb0dc,_0x3b4d86){_0x3b4d86=_0x3b4d86||0x1f4;return function(_0x73cabe){logger[_0xf297('0x22')](_0x73cabe[_0xf297('0x23')]);if(_0x73cabe[_0xf297('0x24')]){delete _0x73cabe['name'];}_0x8fb0dc[_0xf297('0x16')](_0x3b4d86)['send'](_0x73cabe);};}exports['index']=function(_0x58f5f3,_0x44d18e){var _0xca3c5e={},_0xa91424={},_0x901699={'count':0x0,'rows':[]};var _0x2cdfc6=_['map'](db[_0xf297('0x25')][_0xf297('0x26')],function(_0x566743){return{'name':_0x566743[_0xf297('0x27')],'type':_0x566743[_0xf297('0x28')][_0xf297('0x29')]};});_0xa91424['model']=_[_0xf297('0x2a')](_0x2cdfc6,_0xf297('0x24'));_0xa91424[_0xf297('0x2b')]=_['keys'](_0x58f5f3[_0xf297('0x2b')]);_0xa91424[_0xf297('0x2c')]=_['intersection'](_0xa91424[_0xf297('0x2d')],_0xa91424[_0xf297('0x2b')]);_0xca3c5e[_0xf297('0x2e')]=_[_0xf297('0x2f')](_0xa91424[_0xf297('0x2d')],qs[_0xf297('0x30')](_0x58f5f3['query'][_0xf297('0x30')]));_0xca3c5e[_0xf297('0x2e')]=_0xca3c5e['attributes'][_0xf297('0x31')]?_0xca3c5e[_0xf297('0x2e')]:_0xa91424[_0xf297('0x2d')];if(!_0x58f5f3[_0xf297('0x2b')]['hasOwnProperty'](_0xf297('0x32'))){_0xca3c5e[_0xf297('0x1a')]=qs[_0xf297('0x1a')](_0x58f5f3['query'][_0xf297('0x1a')]);_0xca3c5e[_0xf297('0x18')]=qs[_0xf297('0x18')](_0x58f5f3[_0xf297('0x2b')][_0xf297('0x18')]);}_0xca3c5e[_0xf297('0x33')]=qs[_0xf297('0x34')](_0x58f5f3[_0xf297('0x2b')]['sort']);_0xca3c5e[_0xf297('0x35')]=qs[_0xf297('0x2c')](_[_0xf297('0x36')](_0x58f5f3[_0xf297('0x2b')],_0xa91424[_0xf297('0x2c')]),_0x2cdfc6);if(_0x58f5f3[_0xf297('0x2b')][_0xf297('0x37')]){_0xca3c5e[_0xf297('0x35')]=_[_0xf297('0x38')](_0xca3c5e[_0xf297('0x35')],{'$or':_[_0xf297('0x2a')](_0x2cdfc6,function(_0x3f2b0a){if(_0x3f2b0a[_0xf297('0x28')]!==_0xf297('0x39')){var _0x317d03={};_0x317d03[_0x3f2b0a['name']]={'$like':'%'+_0x58f5f3[_0xf297('0x2b')][_0xf297('0x37')]+'%'};return _0x317d03;}})});}_0xca3c5e=_['merge']({},_0xca3c5e,_0x58f5f3[_0xf297('0x3a')]);var _0x463b21={'where':_0xca3c5e[_0xf297('0x35')]};return db[_0xf297('0x25')][_0xf297('0x3b')](_0x463b21)[_0xf297('0x21')](function(_0x575a67){_0x901699['count']=_0x575a67;if(_0x58f5f3[_0xf297('0x2b')][_0xf297('0x3c')]){_0xca3c5e[_0xf297('0x3d')]=[{'all':!![]}];}return db[_0xf297('0x25')][_0xf297('0x3e')](_0xca3c5e);})['then'](function(_0x53be11){_0x901699['rows']=_0x53be11;return _0x901699;})[_0xf297('0x21')](respondWithFilteredResult(_0x44d18e,_0xca3c5e))[_0xf297('0x3f')](handleError(_0x44d18e,null));};exports['show']=function(_0x625d81,_0x4e6483){var _0x2cbfe8={'raw':!![],'where':{'id':_0x625d81[_0xf297('0x40')]['id']}},_0x1503cd={};_0x1503cd['model']=_[_0xf297('0x41')](db[_0xf297('0x25')][_0xf297('0x26')]);_0x1503cd[_0xf297('0x2b')]=_[_0xf297('0x41')](_0x625d81[_0xf297('0x2b')]);_0x1503cd['filters']=_[_0xf297('0x2f')](_0x1503cd[_0xf297('0x2d')],_0x1503cd[_0xf297('0x2b')]);_0x2cbfe8['attributes']=_['intersection'](_0x1503cd[_0xf297('0x2d')],qs['fields'](_0x625d81[_0xf297('0x2b')][_0xf297('0x30')]));_0x2cbfe8[_0xf297('0x2e')]=_0x2cbfe8['attributes']['length']?_0x2cbfe8['attributes']:_0x1503cd[_0xf297('0x2d')];if(_0x625d81[_0xf297('0x2b')]['includeAll']){_0x2cbfe8[_0xf297('0x3d')]=[{'all':!![]}];}_0x2cbfe8=_['merge']({},_0x2cbfe8,_0x625d81[_0xf297('0x3a')]);return db['ChatQueueReport'][_0xf297('0x42')](_0x2cbfe8)['then'](handleEntityNotFound(_0x4e6483,null))[_0xf297('0x21')](respondWithResult(_0x4e6483,null))['catch'](handleError(_0x4e6483,null));};exports[_0xf297('0x43')]=function(_0x1213f8,_0x564ae3){return db['ChatQueueReport']['create'](_0x1213f8[_0xf297('0x44')],{})[_0xf297('0x21')](respondWithResult(_0x564ae3,0xc9))[_0xf297('0x3f')](handleError(_0x564ae3,null));};exports[_0xf297('0x20')]=function(_0x528887,_0x4d1215){if(_0x528887[_0xf297('0x44')]['id']){delete _0x528887[_0xf297('0x44')]['id'];}return db[_0xf297('0x25')][_0xf297('0x42')]({'where':{'id':_0x528887[_0xf297('0x40')]['id']}})['then'](handleEntityNotFound(_0x4d1215,null))[_0xf297('0x21')](saveUpdates(_0x528887[_0xf297('0x44')],null))[_0xf297('0x21')](respondWithResult(_0x4d1215,null))[_0xf297('0x3f')](handleError(_0x4d1215,null));};exports['destroy']=function(_0x23efc6,_0xf82b07){return db[_0xf297('0x25')]['find']({'where':{'id':_0x23efc6[_0xf297('0x40')]['id']}})[_0xf297('0x21')](handleEntityNotFound(_0xf82b07,null))[_0xf297('0x21')](removeEntity(_0xf82b07,null))[_0xf297('0x3f')](handleError(_0xf82b07,null));};exports[_0xf297('0x45')]=function(_0xf7c9ba,_0x1d2e33){return db[_0xf297('0x25')][_0xf297('0x45')]()['then'](respondWithResult(_0x1d2e33,null))['catch'](handleError(_0x1d2e33,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 7a2e16d..0c8ad5c 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x11f5ff,_0xa0ef18){var _0x46eefb=function(_0x51872a){while(--_0x51872a){_0x11f5ff['push'](_0x11f5ff['shift']());}};_0x46eefb(++_0xa0ef18);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x1713bc,_0x337d8c){var _0x59fe87=function(_0x5ec0c0){while(--_0x5ec0c0){_0x1713bc['push'](_0x1713bc['shift']());}};_0x59fe87(++_0x337d8c);}(_0xe706,0xa3));var _0x6e70=function(_0x5cceb8,_0xa8e57a){_0x5cceb8=_0x5cceb8-0x0;var _0xeaf4be=_0xe706[_0x5cceb8];return _0xeaf4be;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 921daa6..42ae5e1 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 _0x88cc=['limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','request','then','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport','update','raw','attributes'];(function(_0x14b5b7,_0x182edf){var _0xaaa57f=function(_0x218a92){while(--_0x218a92){_0x14b5b7['push'](_0x14b5b7['shift']());}};_0xaaa57f(++_0x182edf);}(_0x88cc,0xc1));var _0xc88c=function(_0x21d7a2,_0x5aecda){_0x21d7a2=_0x21d7a2-0x0;var _0x1da981=_0x88cc[_0x21d7a2];return _0x1da981;};'use strict';var _=require(_0xc88c('0x0'));var util=require(_0xc88c('0x1'));var moment=require(_0xc88c('0x2'));var BPromise=require(_0xc88c('0x3'));var rs=require(_0xc88c('0x4'));var fs=require('fs');var Redis=require(_0xc88c('0x5'));var db=require(_0xc88c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc88c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc88c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b0109,_0x24cf50,_0x19a19d){return new BPromise(function(_0x46e209,_0x2d2cb2){return client[_0xc88c('0x9')](_0x5b0109,_0x19a19d)[_0xc88c('0xa')](function(_0x565806){logger[_0xc88c('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x24cf50,'request\x20sent');logger[_0xc88c('0xc')](_0xc88c('0xd'),_0x24cf50,_0xc88c('0xe'),JSON[_0xc88c('0xf')](_0x565806));if(_0x565806[_0xc88c('0x10')]){if(_0x565806[_0xc88c('0x10')][_0xc88c('0x11')]===0x1f4){logger['error'](_0xc88c('0x12'),_0x24cf50,_0x565806[_0xc88c('0x10')][_0xc88c('0x13')]);return _0x2d2cb2(_0x565806[_0xc88c('0x10')][_0xc88c('0x13')]);}logger[_0xc88c('0x10')](_0xc88c('0x12'),_0x24cf50,_0x565806['error'][_0xc88c('0x13')]);return _0x46e209(_0x565806[_0xc88c('0x10')][_0xc88c('0x13')]);}else{logger['info'](_0xc88c('0x12'),_0x24cf50,_0xc88c('0xe'));_0x46e209(_0x565806[_0xc88c('0x14')][_0xc88c('0x13')]);}})[_0xc88c('0x15')](function(_0x5e694e){logger[_0xc88c('0x10')](_0xc88c('0x12'),_0x24cf50,_0x5e694e);_0x2d2cb2(_0x5e694e);});});}exports[_0xc88c('0x16')]=function(_0x9f0deb){var _0x3c5525=this;return new Promise(function(_0x572e3f,_0xaf1da1){return db[_0xc88c('0x17')][_0xc88c('0x18')](_0x9f0deb[_0xc88c('0x19')],{'raw':_0x9f0deb[_0xc88c('0x1a')]?_0x9f0deb[_0xc88c('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5daedf){logger[_0xc88c('0xb')](_0xc88c('0x16'),_0x9f0deb);logger['debug']('CreateChatQueueReport',_0x9f0deb,JSON[_0xc88c('0xf')](_0x5daedf));_0x572e3f(_0x5daedf);})[_0xc88c('0x15')](function(_0x92e8b0){logger[_0xc88c('0x10')](_0xc88c('0x16'),_0x92e8b0[_0xc88c('0x13')],_0x9f0deb);_0xaf1da1(_0x3c5525[_0xc88c('0x10')](0x1f4,_0x92e8b0['message']));});});};exports[_0xc88c('0x1b')]=function(_0x3ff4cf){var _0x5119ca=this;return new Promise(function(_0x3c1749,_0x432756){return db[_0xc88c('0x17')][_0xc88c('0x1c')](_0x3ff4cf['body'],{'raw':_0x3ff4cf[_0xc88c('0x1a')]?_0x3ff4cf[_0xc88c('0x1a')][_0xc88c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ff4cf[_0xc88c('0x1a')]?_0x3ff4cf[_0xc88c('0x1a')]['where']||null:null,'attributes':_0x3ff4cf[_0xc88c('0x1a')]?_0x3ff4cf['options'][_0xc88c('0x1e')]||null:null,'limit':_0x3ff4cf[_0xc88c('0x1a')]?_0x3ff4cf[_0xc88c('0x1a')][_0xc88c('0x1f')]||null:null})['then'](function(_0x439f79){logger[_0xc88c('0xb')]('UpdateChatQueueReport',_0x3ff4cf);logger[_0xc88c('0xc')](_0xc88c('0x1b'),_0x3ff4cf,JSON['stringify'](_0x439f79));_0x3c1749(_0x439f79);})[_0xc88c('0x15')](function(_0x4edecd){logger[_0xc88c('0x10')](_0xc88c('0x1b'),_0x4edecd[_0xc88c('0x13')],_0x3ff4cf);_0x432756(_0x5119ca[_0xc88c('0x10')](0x1f4,_0x4edecd[_0xc88c('0x13')]));});});};
\ No newline at end of file
+var _0xc932=['body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','then','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create'];(function(_0x5db2ac,_0x5b7037){var _0x5486ac=function(_0x346afd){while(--_0x346afd){_0x5db2ac['push'](_0x5db2ac['shift']());}};_0x5486ac(++_0x5b7037);}(_0xc932,0x18f));var _0x2c93=function(_0x47878f,_0x48d3bf){_0x47878f=_0x47878f-0x0;var _0x4b05b8=_0xc932[_0x47878f];return _0x4b05b8;};'use strict';var _=require(_0x2c93('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2c93('0x1'));var rs=require(_0x2c93('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c93('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2c93('0x4'))(_0x2c93('0x5'));var config=require(_0x2c93('0x6'));var jayson=require(_0x2c93('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x55a5c1,_0x5803f3,_0xe205e3){return new BPromise(function(_0x10a55b,_0x210631){return client[_0x2c93('0x8')](_0x55a5c1,_0xe205e3)['then'](function(_0x115a35){logger[_0x2c93('0x9')](_0x2c93('0xa'),_0x5803f3,'request\x20sent');logger[_0x2c93('0xb')](_0x2c93('0xc'),_0x5803f3,_0x2c93('0xd'),JSON['stringify'](_0x115a35));if(_0x115a35['error']){if(_0x115a35[_0x2c93('0xe')]['code']===0x1f4){logger['error'](_0x2c93('0xa'),_0x5803f3,_0x115a35[_0x2c93('0xe')][_0x2c93('0xf')]);return _0x210631(_0x115a35[_0x2c93('0xe')]['message']);}logger[_0x2c93('0xe')](_0x2c93('0xa'),_0x5803f3,_0x115a35[_0x2c93('0xe')][_0x2c93('0xf')]);return _0x10a55b(_0x115a35[_0x2c93('0xe')]['message']);}else{logger[_0x2c93('0x9')](_0x2c93('0xa'),_0x5803f3,_0x2c93('0xd'));_0x10a55b(_0x115a35[_0x2c93('0x10')][_0x2c93('0xf')]);}})[_0x2c93('0x11')](function(_0x527207){logger[_0x2c93('0xe')](_0x2c93('0xa'),_0x5803f3,_0x527207);_0x210631(_0x527207);});});}exports[_0x2c93('0x12')]=function(_0x477a1f){var _0x32fcdf=this;return new Promise(function(_0x20fcea,_0x6ff1ee){return db[_0x2c93('0x13')][_0x2c93('0x14')](_0x477a1f[_0x2c93('0x15')],{'raw':_0x477a1f['options']?_0x477a1f[_0x2c93('0x16')][_0x2c93('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x1d4fdb){logger[_0x2c93('0x9')](_0x2c93('0x12'),_0x477a1f);logger['debug'](_0x2c93('0x12'),_0x477a1f,JSON['stringify'](_0x1d4fdb));_0x20fcea(_0x1d4fdb);})[_0x2c93('0x11')](function(_0x17338){logger[_0x2c93('0xe')](_0x2c93('0x12'),_0x17338[_0x2c93('0xf')],_0x477a1f);_0x6ff1ee(_0x32fcdf[_0x2c93('0xe')](0x1f4,_0x17338[_0x2c93('0xf')]));});});};exports[_0x2c93('0x18')]=function(_0xb6e62d){var _0x2dd127=this;return new Promise(function(_0x298518,_0x3ac3ab){return db[_0x2c93('0x13')][_0x2c93('0x19')](_0xb6e62d['body'],{'raw':_0xb6e62d['options']?_0xb6e62d[_0x2c93('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb6e62d[_0x2c93('0x16')]?_0xb6e62d[_0x2c93('0x16')][_0x2c93('0x1a')]||null:null,'attributes':_0xb6e62d[_0x2c93('0x16')]?_0xb6e62d[_0x2c93('0x16')][_0x2c93('0x1b')]||null:null,'limit':_0xb6e62d[_0x2c93('0x16')]?_0xb6e62d[_0x2c93('0x16')][_0x2c93('0x1c')]||null:null})[_0x2c93('0x1d')](function(_0x1177e9){logger[_0x2c93('0x9')](_0x2c93('0x18'),_0xb6e62d);logger[_0x2c93('0xb')](_0x2c93('0x18'),_0xb6e62d,JSON['stringify'](_0x1177e9));_0x298518(_0x1177e9);})['catch'](function(_0x1399af){logger[_0x2c93('0xe')](_0x2c93('0x18'),_0x1399af[_0x2c93('0xf')],_0xb6e62d);_0x3ac3ab(_0x2dd127[_0x2c93('0xe')](0x1f4,_0x1399af[_0x2c93('0xf')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index a5af45e..a3ab693 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 _0x7eb9=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','index','get','isAuthenticated','show','/:id','update','delete','exports'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x7eb9,0xbb));var _0x97eb=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7eb9[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x97eb('0x0'));var util=require(_0x97eb('0x1'));var path=require('path');var timeout=require(_0x97eb('0x2'));var express=require(_0x97eb('0x3'));var router=express[_0x97eb('0x4')]();var fs_extra=require(_0x97eb('0x5'));var auth=require(_0x97eb('0x6'));var interaction=require(_0x97eb('0x7'));var config=require('../../config/environment');var controller=require(_0x97eb('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x97eb('0x9')]);router[_0x97eb('0xa')]('/describe',auth[_0x97eb('0xb')](),controller['describe']);router[_0x97eb('0xa')]('/:id',auth[_0x97eb('0xb')](),controller[_0x97eb('0xc')]);router['post']('/',auth[_0x97eb('0xb')](),controller['create']);router['put'](_0x97eb('0xd'),auth['isAuthenticated'](),controller[_0x97eb('0xe')]);router[_0x97eb('0xf')]('/:id',auth[_0x97eb('0xb')](),controller['destroy']);module[_0x97eb('0x10')]=router;
\ No newline at end of file
+var _0x021e=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe','/:id','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x021e,0x1b4));var _0xe021=function(_0x3eb050,_0x56ccfc){_0x3eb050=_0x3eb050-0x0;var _0x456c0f=_0x021e[_0x3eb050];return _0x456c0f;};'use strict';var multer=require(_0xe021('0x0'));var util=require(_0xe021('0x1'));var path=require(_0xe021('0x2'));var timeout=require(_0xe021('0x3'));var express=require(_0xe021('0x4'));var router=express[_0xe021('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe021('0x6'));var interaction=require(_0xe021('0x7'));var config=require(_0xe021('0x8'));var controller=require(_0xe021('0x9'));router[_0xe021('0xa')]('/',auth[_0xe021('0xb')](),controller[_0xe021('0xc')]);router[_0xe021('0xa')]('/describe',auth[_0xe021('0xb')](),controller[_0xe021('0xd')]);router[_0xe021('0xa')](_0xe021('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xe021('0xb')](),controller[_0xe021('0xf')]);router[_0xe021('0x10')](_0xe021('0xe'),auth[_0xe021('0xb')](),controller[_0xe021('0x11')]);router[_0xe021('0x12')](_0xe021('0xe'),auth[_0xe021('0xb')](),controller[_0xe021('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index a6be9fd..b1ebd13 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x307fd8,_0x25d8ac){var _0xd3f818=function(_0x2eba75){while(--_0x2eba75){_0x307fd8['push'](_0x307fd8['shift']());}};_0xd3f818(++_0x25d8ac);}(_0x34e8,0x12c));var _0x834e=function(_0x56f5ea,_0x3a8fc1){_0x56f5ea=_0x56f5ea-0x0;var _0x16b3ff=_0x34e8[_0x56f5ea];return _0x16b3ff;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x4cfc07,_0x3409a2){var _0x355841=function(_0x427b15){while(--_0x427b15){_0x4cfc07['push'](_0x4cfc07['shift']());}};_0x355841(++_0x3409a2);}(_0xf4eb,0xec));var _0xbf4e=function(_0x30e5ed,_0x1017ac){_0x30e5ed=_0x30e5ed-0x0;var _0x21576f=_0xf4eb[_0x30e5ed];return _0x21576f;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 8ddaa26..8f10357 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 _0x6ef9=['../../config/utils','../../mysqldb','sendStatus','end','status','limit','undefined','count','offset','set','apply','reject','update','then','error','stack','name','index','ChatTransferReport','rawAttributes','fieldName','type','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','show','keys','merge','create','body','catch','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api'];(function(_0x2098d0,_0x3eadb9){var _0x2c4e88=function(_0x3f3610){while(--_0x3f3610){_0x2098d0['push'](_0x2098d0['shift']());}};_0x2c4e88(++_0x3eadb9);}(_0x6ef9,0x7d));var _0x96ef=function(_0x71cd05,_0x36ac11){_0x71cd05=_0x71cd05-0x0;var _0x59c9e7=_0x6ef9[_0x71cd05];return _0x59c9e7;};'use strict';var emlformat=require(_0x96ef('0x0'));var rimraf=require(_0x96ef('0x1'));var zipdir=require(_0x96ef('0x2'));var jsonpatch=require(_0x96ef('0x3'));var rp=require(_0x96ef('0x4'));var moment=require(_0x96ef('0x5'));var BPromise=require(_0x96ef('0x6'));var Mustache=require(_0x96ef('0x7'));var util=require('util');var path=require(_0x96ef('0x8'));var sox=require(_0x96ef('0x9'));var csv=require(_0x96ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96ef('0xb'));var _=require(_0x96ef('0xc'));var squel=require(_0x96ef('0xd'));var crypto=require(_0x96ef('0xe'));var jsforce=require(_0x96ef('0xf'));var deskjs=require(_0x96ef('0x10'));var toCsv=require(_0x96ef('0xa'));var querystring=require(_0x96ef('0x11'));var Papa=require(_0x96ef('0x12'));var Redis=require(_0x96ef('0x13'));var authService=require(_0x96ef('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96ef('0x15'));var logger=require('../../config/logger')(_0x96ef('0x16'));var utils=require(_0x96ef('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x96ef('0x18'))['db'];function respondWithStatusCode(_0x3454c7,_0x2cdef0){_0x2cdef0=_0x2cdef0||0xcc;return function(_0x15b8ad){if(_0x15b8ad){return _0x3454c7[_0x96ef('0x19')](_0x2cdef0);}return _0x3454c7['status'](_0x2cdef0)[_0x96ef('0x1a')]();};}function respondWithResult(_0x2ab7f1,_0x38e930){_0x38e930=_0x38e930||0xc8;return function(_0x4da88b){if(_0x4da88b){return _0x2ab7f1[_0x96ef('0x1b')](_0x38e930)['json'](_0x4da88b);}};}function respondWithFilteredResult(_0x5bdc55,_0x4a5ec3){return function(_0x163a8e){if(_0x163a8e){var _0x2b7eef=typeof _0x4a5ec3['offset']==='undefined'&&typeof _0x4a5ec3[_0x96ef('0x1c')]===_0x96ef('0x1d');var _0xab3483=_0x163a8e[_0x96ef('0x1e')];var _0x1c9799=_0x2b7eef?0x0:_0x4a5ec3['offset'];var _0x3f5d19=_0x2b7eef?_0x163a8e[_0x96ef('0x1e')]:_0x4a5ec3[_0x96ef('0x1f')]+_0x4a5ec3[_0x96ef('0x1c')];var _0x1e0bc9;if(_0x3f5d19>=_0xab3483){_0x3f5d19=_0xab3483;_0x1e0bc9=0xc8;}else{_0x1e0bc9=0xce;}_0x5bdc55['status'](_0x1e0bc9);return _0x5bdc55[_0x96ef('0x20')]('Content-Range',_0x1c9799+'-'+_0x3f5d19+'/'+_0xab3483)['json'](_0x163a8e);}return null;};}function patchUpdates(_0x20ddaa){return function(_0x3f43ae){try{jsonpatch[_0x96ef('0x21')](_0x3f43ae,_0x20ddaa,!![]);}catch(_0x47daae){return BPromise[_0x96ef('0x22')](_0x47daae);}return _0x3f43ae['save']();};}function saveUpdates(_0x592635,_0x172333){return function(_0x5642d5){if(_0x5642d5){return _0x5642d5[_0x96ef('0x23')](_0x592635)[_0x96ef('0x24')](function(_0x20a8d6){return _0x20a8d6;});}return null;};}function removeEntity(_0x144f30,_0x53e421){return function(_0x1ca921){if(_0x1ca921){return _0x1ca921['destroy']()[_0x96ef('0x24')](function(){_0x144f30[_0x96ef('0x1b')](0xcc)[_0x96ef('0x1a')]();});}};}function handleEntityNotFound(_0x382994,_0xf40135){return function(_0x143eb5){if(!_0x143eb5){_0x382994[_0x96ef('0x19')](0x194);}return _0x143eb5;};}function handleError(_0x59d7f5,_0x2fb493){_0x2fb493=_0x2fb493||0x1f4;return function(_0x1eca4b){logger[_0x96ef('0x25')](_0x1eca4b[_0x96ef('0x26')]);if(_0x1eca4b[_0x96ef('0x27')]){delete _0x1eca4b[_0x96ef('0x27')];}_0x59d7f5['status'](_0x2fb493)['send'](_0x1eca4b);};}exports[_0x96ef('0x28')]=function(_0x49bb4a,_0x246dce){var _0x57ed15={},_0x1cfb15={},_0x13778d={'count':0x0,'rows':[]};var _0x176a90=_['map'](db[_0x96ef('0x29')][_0x96ef('0x2a')],function(_0x4f0bf3){return{'name':_0x4f0bf3[_0x96ef('0x2b')],'type':_0x4f0bf3[_0x96ef('0x2c')]['key']};});_0x1cfb15[_0x96ef('0x2d')]=_[_0x96ef('0x2e')](_0x176a90,_0x96ef('0x27'));_0x1cfb15['query']=_['keys'](_0x49bb4a['query']);_0x1cfb15[_0x96ef('0x2f')]=_[_0x96ef('0x30')](_0x1cfb15[_0x96ef('0x2d')],_0x1cfb15[_0x96ef('0x31')]);_0x57ed15[_0x96ef('0x32')]=_[_0x96ef('0x30')](_0x1cfb15['model'],qs[_0x96ef('0x33')](_0x49bb4a[_0x96ef('0x31')][_0x96ef('0x33')]));_0x57ed15[_0x96ef('0x32')]=_0x57ed15[_0x96ef('0x32')][_0x96ef('0x34')]?_0x57ed15[_0x96ef('0x32')]:_0x1cfb15[_0x96ef('0x2d')];if(!_0x49bb4a['query'][_0x96ef('0x35')](_0x96ef('0x36'))){_0x57ed15[_0x96ef('0x1c')]=qs['limit'](_0x49bb4a[_0x96ef('0x31')][_0x96ef('0x1c')]);_0x57ed15[_0x96ef('0x1f')]=qs[_0x96ef('0x1f')](_0x49bb4a[_0x96ef('0x31')][_0x96ef('0x1f')]);}_0x57ed15[_0x96ef('0x37')]=qs[_0x96ef('0x38')](_0x49bb4a[_0x96ef('0x31')][_0x96ef('0x38')]);_0x57ed15[_0x96ef('0x39')]=qs[_0x96ef('0x2f')](_[_0x96ef('0x3a')](_0x49bb4a[_0x96ef('0x31')],_0x1cfb15[_0x96ef('0x2f')]),_0x176a90);if(_0x49bb4a[_0x96ef('0x31')][_0x96ef('0x3b')]){_0x57ed15[_0x96ef('0x39')]=_['merge'](_0x57ed15[_0x96ef('0x39')],{'$or':_[_0x96ef('0x2e')](_0x176a90,function(_0x2d3290){if(_0x2d3290[_0x96ef('0x2c')]!==_0x96ef('0x3c')){var _0x3b753d={};_0x3b753d[_0x2d3290[_0x96ef('0x27')]]={'$like':'%'+_0x49bb4a[_0x96ef('0x31')][_0x96ef('0x3b')]+'%'};return _0x3b753d;}})});}_0x57ed15=_['merge']({},_0x57ed15,_0x49bb4a[_0x96ef('0x3d')]);var _0x5e3fa4={'where':_0x57ed15[_0x96ef('0x39')]};return db[_0x96ef('0x29')][_0x96ef('0x1e')](_0x5e3fa4)[_0x96ef('0x24')](function(_0x3d561c){_0x13778d[_0x96ef('0x1e')]=_0x3d561c;if(_0x49bb4a[_0x96ef('0x31')][_0x96ef('0x3e')]){_0x57ed15[_0x96ef('0x3f')]=[{'all':!![]}];}return db[_0x96ef('0x29')][_0x96ef('0x40')](_0x57ed15);})[_0x96ef('0x24')](function(_0x80c65b){_0x13778d['rows']=_0x80c65b;return _0x13778d;})['then'](respondWithFilteredResult(_0x246dce,_0x57ed15))['catch'](handleError(_0x246dce,null));};exports[_0x96ef('0x41')]=function(_0x9621d2,_0x460d00){var _0x13b7bb={'raw':!![],'where':{'id':_0x9621d2['params']['id']}},_0x5e39cc={};_0x5e39cc[_0x96ef('0x2d')]=_[_0x96ef('0x42')](db[_0x96ef('0x29')]['rawAttributes']);_0x5e39cc[_0x96ef('0x31')]=_['keys'](_0x9621d2[_0x96ef('0x31')]);_0x5e39cc[_0x96ef('0x2f')]=_[_0x96ef('0x30')](_0x5e39cc[_0x96ef('0x2d')],_0x5e39cc[_0x96ef('0x31')]);_0x13b7bb[_0x96ef('0x32')]=_['intersection'](_0x5e39cc[_0x96ef('0x2d')],qs['fields'](_0x9621d2['query'][_0x96ef('0x33')]));_0x13b7bb[_0x96ef('0x32')]=_0x13b7bb[_0x96ef('0x32')]['length']?_0x13b7bb[_0x96ef('0x32')]:_0x5e39cc[_0x96ef('0x2d')];if(_0x9621d2['query']['includeAll']){_0x13b7bb[_0x96ef('0x3f')]=[{'all':!![]}];}_0x13b7bb=_[_0x96ef('0x43')]({},_0x13b7bb,_0x9621d2[_0x96ef('0x3d')]);return db[_0x96ef('0x29')]['find'](_0x13b7bb)[_0x96ef('0x24')](handleEntityNotFound(_0x460d00,null))[_0x96ef('0x24')](respondWithResult(_0x460d00,null))['catch'](handleError(_0x460d00,null));};exports[_0x96ef('0x44')]=function(_0x41a627,_0x43d5ad){return db['ChatTransferReport'][_0x96ef('0x44')](_0x41a627[_0x96ef('0x45')],{})[_0x96ef('0x24')](respondWithResult(_0x43d5ad,0xc9))[_0x96ef('0x46')](handleError(_0x43d5ad,null));};exports[_0x96ef('0x23')]=function(_0x1a913b,_0x3194cb){if(_0x1a913b['body']['id']){delete _0x1a913b['body']['id'];}return db[_0x96ef('0x29')][_0x96ef('0x47')]({'where':{'id':_0x1a913b['params']['id']}})[_0x96ef('0x24')](handleEntityNotFound(_0x3194cb,null))[_0x96ef('0x24')](saveUpdates(_0x1a913b[_0x96ef('0x45')],null))[_0x96ef('0x24')](respondWithResult(_0x3194cb,null))['catch'](handleError(_0x3194cb,null));};exports[_0x96ef('0x48')]=function(_0x33892d,_0x2f4ee6){return db[_0x96ef('0x29')][_0x96ef('0x47')]({'where':{'id':_0x33892d['params']['id']}})[_0x96ef('0x24')](handleEntityNotFound(_0x2f4ee6,null))[_0x96ef('0x24')](removeEntity(_0x2f4ee6,null))[_0x96ef('0x46')](handleError(_0x2f4ee6,null));};exports[_0x96ef('0x49')]=function(_0x467566,_0xa20d81){return db[_0x96ef('0x29')]['describe']()[_0x96ef('0x24')](respondWithResult(_0xa20d81,null))[_0x96ef('0x46')](handleError(_0xa20d81,null));};
\ No newline at end of file
+var _0xd94b=['model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','key'];(function(_0x7c0646,_0x45d16b){var _0x32416d=function(_0x22abdd){while(--_0x22abdd){_0x7c0646['push'](_0x7c0646['shift']());}};_0x32416d(++_0x45d16b);}(_0xd94b,0xbf));var _0xbd94=function(_0x1b4695,_0x3a90e3){_0x1b4695=_0x1b4695-0x0;var _0x376a90=_0xd94b[_0x1b4695];return _0x376a90;};'use strict';var emlformat=require(_0xbd94('0x0'));var rimraf=require(_0xbd94('0x1'));var zipdir=require(_0xbd94('0x2'));var jsonpatch=require(_0xbd94('0x3'));var rp=require('request-promise');var moment=require(_0xbd94('0x4'));var BPromise=require(_0xbd94('0x5'));var Mustache=require(_0xbd94('0x6'));var util=require(_0xbd94('0x7'));var path=require('path');var sox=require(_0xbd94('0x8'));var csv=require(_0xbd94('0x9'));var ejs=require(_0xbd94('0xa'));var fs=require('fs');var fs_extra=require(_0xbd94('0xb'));var _=require(_0xbd94('0xc'));var squel=require(_0xbd94('0xd'));var crypto=require(_0xbd94('0xe'));var jsforce=require(_0xbd94('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbd94('0x9'));var querystring=require(_0xbd94('0x10'));var Papa=require(_0xbd94('0x11'));var Redis=require(_0xbd94('0x12'));var authService=require(_0xbd94('0x13'));var qs=require(_0xbd94('0x14'));var as=require(_0xbd94('0x15'));var hardwareService=require(_0xbd94('0x16'));var logger=require('../../config/logger')(_0xbd94('0x17'));var utils=require(_0xbd94('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xbd94('0x19'));var db=require(_0xbd94('0x1a'))['db'];function respondWithStatusCode(_0x108a2b,_0x64aa0c){_0x64aa0c=_0x64aa0c||0xcc;return function(_0x3fe88c){if(_0x3fe88c){return _0x108a2b[_0xbd94('0x1b')](_0x64aa0c);}return _0x108a2b[_0xbd94('0x1c')](_0x64aa0c)[_0xbd94('0x1d')]();};}function respondWithResult(_0x20d4fc,_0x26c385){_0x26c385=_0x26c385||0xc8;return function(_0x3c159a){if(_0x3c159a){return _0x20d4fc[_0xbd94('0x1c')](_0x26c385)[_0xbd94('0x1e')](_0x3c159a);}};}function respondWithFilteredResult(_0x5ecd44,_0x1c2ce7){return function(_0x365b0b){if(_0x365b0b){var _0x26b981=typeof _0x1c2ce7[_0xbd94('0x1f')]==='undefined'&&typeof _0x1c2ce7[_0xbd94('0x20')]===_0xbd94('0x21');var _0x210725=_0x365b0b[_0xbd94('0x22')];var _0x1a6d43=_0x26b981?0x0:_0x1c2ce7[_0xbd94('0x1f')];var _0x5c1c1a=_0x26b981?_0x365b0b[_0xbd94('0x22')]:_0x1c2ce7[_0xbd94('0x1f')]+_0x1c2ce7[_0xbd94('0x20')];var _0x200bfd;if(_0x5c1c1a>=_0x210725){_0x5c1c1a=_0x210725;_0x200bfd=0xc8;}else{_0x200bfd=0xce;}_0x5ecd44[_0xbd94('0x1c')](_0x200bfd);return _0x5ecd44['set'](_0xbd94('0x23'),_0x1a6d43+'-'+_0x5c1c1a+'/'+_0x210725)['json'](_0x365b0b);}return null;};}function patchUpdates(_0x218c11){return function(_0x1f425e){try{jsonpatch[_0xbd94('0x24')](_0x1f425e,_0x218c11,!![]);}catch(_0x5641a4){return BPromise[_0xbd94('0x25')](_0x5641a4);}return _0x1f425e[_0xbd94('0x26')]();};}function saveUpdates(_0x51a07a,_0xece059){return function(_0x469489){if(_0x469489){return _0x469489[_0xbd94('0x27')](_0x51a07a)['then'](function(_0x4dde6e){return _0x4dde6e;});}return null;};}function removeEntity(_0x18c548,_0x45447c){return function(_0x3b316d){if(_0x3b316d){return _0x3b316d[_0xbd94('0x28')]()[_0xbd94('0x29')](function(){_0x18c548['status'](0xcc)[_0xbd94('0x1d')]();});}};}function handleEntityNotFound(_0x1388e9,_0x3c46e6){return function(_0x31ac23){if(!_0x31ac23){_0x1388e9[_0xbd94('0x1b')](0x194);}return _0x31ac23;};}function handleError(_0x19506c,_0x1ed057){_0x1ed057=_0x1ed057||0x1f4;return function(_0x4ec5eb){logger[_0xbd94('0x2a')](_0x4ec5eb[_0xbd94('0x2b')]);if(_0x4ec5eb[_0xbd94('0x2c')]){delete _0x4ec5eb[_0xbd94('0x2c')];}_0x19506c[_0xbd94('0x1c')](_0x1ed057)[_0xbd94('0x2d')](_0x4ec5eb);};}exports[_0xbd94('0x2e')]=function(_0x36335b,_0x259c20){var _0x27bf3d={},_0x29a4ef={},_0x37d798={'count':0x0,'rows':[]};var _0x298bd0=_[_0xbd94('0x2f')](db[_0xbd94('0x30')]['rawAttributes'],function(_0x6d601d){return{'name':_0x6d601d[_0xbd94('0x31')],'type':_0x6d601d[_0xbd94('0x32')][_0xbd94('0x33')]};});_0x29a4ef[_0xbd94('0x34')]=_[_0xbd94('0x2f')](_0x298bd0,_0xbd94('0x2c'));_0x29a4ef[_0xbd94('0x35')]=_['keys'](_0x36335b[_0xbd94('0x35')]);_0x29a4ef['filters']=_[_0xbd94('0x36')](_0x29a4ef['model'],_0x29a4ef[_0xbd94('0x35')]);_0x27bf3d[_0xbd94('0x37')]=_[_0xbd94('0x36')](_0x29a4ef[_0xbd94('0x34')],qs[_0xbd94('0x38')](_0x36335b[_0xbd94('0x35')]['fields']));_0x27bf3d[_0xbd94('0x37')]=_0x27bf3d[_0xbd94('0x37')][_0xbd94('0x39')]?_0x27bf3d[_0xbd94('0x37')]:_0x29a4ef[_0xbd94('0x34')];if(!_0x36335b[_0xbd94('0x35')][_0xbd94('0x3a')](_0xbd94('0x3b'))){_0x27bf3d[_0xbd94('0x20')]=qs[_0xbd94('0x20')](_0x36335b[_0xbd94('0x35')][_0xbd94('0x20')]);_0x27bf3d[_0xbd94('0x1f')]=qs[_0xbd94('0x1f')](_0x36335b[_0xbd94('0x35')][_0xbd94('0x1f')]);}_0x27bf3d[_0xbd94('0x3c')]=qs[_0xbd94('0x3d')](_0x36335b[_0xbd94('0x35')][_0xbd94('0x3d')]);_0x27bf3d[_0xbd94('0x3e')]=qs[_0xbd94('0x3f')](_[_0xbd94('0x40')](_0x36335b['query'],_0x29a4ef[_0xbd94('0x3f')]),_0x298bd0);if(_0x36335b[_0xbd94('0x35')]['filter']){_0x27bf3d['where']=_[_0xbd94('0x41')](_0x27bf3d[_0xbd94('0x3e')],{'$or':_[_0xbd94('0x2f')](_0x298bd0,function(_0x17e0d0){if(_0x17e0d0[_0xbd94('0x32')]!==_0xbd94('0x42')){var _0xc0557e={};_0xc0557e[_0x17e0d0['name']]={'$like':'%'+_0x36335b[_0xbd94('0x35')][_0xbd94('0x43')]+'%'};return _0xc0557e;}})});}_0x27bf3d=_['merge']({},_0x27bf3d,_0x36335b['options']);var _0x2b00bb={'where':_0x27bf3d['where']};return db[_0xbd94('0x30')][_0xbd94('0x22')](_0x2b00bb)[_0xbd94('0x29')](function(_0x26c6c9){_0x37d798[_0xbd94('0x22')]=_0x26c6c9;if(_0x36335b[_0xbd94('0x35')]['includeAll']){_0x27bf3d['include']=[{'all':!![]}];}return db[_0xbd94('0x30')][_0xbd94('0x44')](_0x27bf3d);})[_0xbd94('0x29')](function(_0x19df4a){_0x37d798[_0xbd94('0x45')]=_0x19df4a;return _0x37d798;})[_0xbd94('0x29')](respondWithFilteredResult(_0x259c20,_0x27bf3d))[_0xbd94('0x46')](handleError(_0x259c20,null));};exports[_0xbd94('0x47')]=function(_0x4a7799,_0x5eadc0){var _0x414e6b={'raw':!![],'where':{'id':_0x4a7799[_0xbd94('0x48')]['id']}},_0x445889={};_0x445889[_0xbd94('0x34')]=_[_0xbd94('0x49')](db['ChatTransferReport'][_0xbd94('0x4a')]);_0x445889['query']=_[_0xbd94('0x49')](_0x4a7799[_0xbd94('0x35')]);_0x445889[_0xbd94('0x3f')]=_['intersection'](_0x445889['model'],_0x445889['query']);_0x414e6b[_0xbd94('0x37')]=_[_0xbd94('0x36')](_0x445889[_0xbd94('0x34')],qs[_0xbd94('0x38')](_0x4a7799[_0xbd94('0x35')][_0xbd94('0x38')]));_0x414e6b[_0xbd94('0x37')]=_0x414e6b['attributes'][_0xbd94('0x39')]?_0x414e6b['attributes']:_0x445889[_0xbd94('0x34')];if(_0x4a7799[_0xbd94('0x35')][_0xbd94('0x4b')]){_0x414e6b['include']=[{'all':!![]}];}_0x414e6b=_[_0xbd94('0x41')]({},_0x414e6b,_0x4a7799[_0xbd94('0x4c')]);return db[_0xbd94('0x30')][_0xbd94('0x4d')](_0x414e6b)[_0xbd94('0x29')](handleEntityNotFound(_0x5eadc0,null))[_0xbd94('0x29')](respondWithResult(_0x5eadc0,null))[_0xbd94('0x46')](handleError(_0x5eadc0,null));};exports['create']=function(_0x137d5a,_0x5b86bf){return db[_0xbd94('0x30')][_0xbd94('0x4e')](_0x137d5a[_0xbd94('0x4f')],{})[_0xbd94('0x29')](respondWithResult(_0x5b86bf,0xc9))[_0xbd94('0x46')](handleError(_0x5b86bf,null));};exports[_0xbd94('0x27')]=function(_0x3f2743,_0x20fe9c){if(_0x3f2743['body']['id']){delete _0x3f2743[_0xbd94('0x4f')]['id'];}return db[_0xbd94('0x30')][_0xbd94('0x4d')]({'where':{'id':_0x3f2743[_0xbd94('0x48')]['id']}})[_0xbd94('0x29')](handleEntityNotFound(_0x20fe9c,null))[_0xbd94('0x29')](saveUpdates(_0x3f2743['body'],null))[_0xbd94('0x29')](respondWithResult(_0x20fe9c,null))[_0xbd94('0x46')](handleError(_0x20fe9c,null));};exports[_0xbd94('0x28')]=function(_0x3ce9f9,_0x3a5575){return db[_0xbd94('0x30')][_0xbd94('0x4d')]({'where':{'id':_0x3ce9f9[_0xbd94('0x48')]['id']}})[_0xbd94('0x29')](handleEntityNotFound(_0x3a5575,null))[_0xbd94('0x29')](removeEntity(_0x3a5575,null))[_0xbd94('0x46')](handleError(_0x3a5575,null));};exports[_0xbd94('0x50')]=function(_0x5f185e,_0x586838){return db[_0xbd94('0x30')][_0xbd94('0x50')]()[_0xbd94('0x29')](respondWithResult(_0x586838,null))['catch'](handleError(_0x586838,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 57dde03..b907680 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 _0x1246=['path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','api','moment','bluebird'];(function(_0x484945,_0x44c47d){var _0x5de501=function(_0xc3ac8e){while(--_0xc3ac8e){_0x484945['push'](_0x484945['shift']());}};_0x5de501(++_0x44c47d);}(_0x1246,0x164));var _0x6124=function(_0x33ab77,_0x3011a2){_0x33ab77=_0x33ab77-0x0;var _0x531e25=_0x1246[_0x33ab77];return _0x531e25;};'use strict';var _=require(_0x6124('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6124('0x1'));var moment=require(_0x6124('0x2'));var BPromise=require(_0x6124('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6124('0x4'));var rimraf=require(_0x6124('0x5'));var config=require(_0x6124('0x6'));var attributes=require(_0x6124('0x7'));module['exports']=function(_0x368f9f,_0x3f7134){return _0x368f9f[_0x6124('0x8')](_0x6124('0x9'),attributes,{'tableName':_0x6124('0xa'),'paranoid':![],'indexes':[{'name':_0x6124('0xb'),'fields':[_0x6124('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b2c=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','uniqueid','lodash','util'];(function(_0x5d6913,_0x254795){var _0x101110=function(_0x8c8c65){while(--_0x8c8c65){_0x5d6913['push'](_0x5d6913['shift']());}};_0x101110(++_0x254795);}(_0x0b2c,0x177));var _0xc0b2=function(_0x4c1176,_0x7b83b0){_0x4c1176=_0x4c1176-0x0;var _0x1faf91=_0x0b2c[_0x4c1176];return _0x1faf91;};'use strict';var _=require(_0xc0b2('0x0'));var util=require(_0xc0b2('0x1'));var logger=require(_0xc0b2('0x2'))(_0xc0b2('0x3'));var moment=require(_0xc0b2('0x4'));var BPromise=require(_0xc0b2('0x5'));var rp=require(_0xc0b2('0x6'));var fs=require('fs');var path=require(_0xc0b2('0x7'));var rimraf=require('rimraf');var config=require(_0xc0b2('0x8'));var attributes=require(_0xc0b2('0x9'));module['exports']=function(_0x192e51,_0x1f3014){return _0x192e51[_0xc0b2('0xa')](_0xc0b2('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xc0b2('0xc'),'fields':[_0xc0b2('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index cb363e5..785fa05 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 _0x60a1=['rpc','../../config/environment','jayson/promise','client','http','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x67d2b,_0xc3be07){var _0x23e7c1=function(_0x290c5e){while(--_0x290c5e){_0x67d2b['push'](_0x67d2b['shift']());}};_0x23e7c1(++_0xc3be07);}(_0x60a1,0x16d));var _0x160a=function(_0x3ef7d,_0x950b28){_0x3ef7d=_0x3ef7d-0x0;var _0x16f27=_0x60a1[_0x3ef7d];return _0x16f27;};'use strict';var _=require(_0x160a('0x0'));var util=require(_0x160a('0x1'));var moment=require(_0x160a('0x2'));var BPromise=require(_0x160a('0x3'));var rs=require(_0x160a('0x4'));var fs=require('fs');var Redis=require(_0x160a('0x5'));var db=require(_0x160a('0x6'))['db'];var utils=require(_0x160a('0x7'));var logger=require(_0x160a('0x8'))(_0x160a('0x9'));var config=require(_0x160a('0xa'));var jayson=require(_0x160a('0xb'));var client=jayson[_0x160a('0xc')][_0x160a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1768a6,_0x277f09,_0x212860){return new BPromise(function(_0x304b3d,_0x4efee3){return client['request'](_0x1768a6,_0x212860)[_0x160a('0xe')](function(_0x414fbe){logger['info'](_0x160a('0xf'),_0x277f09,_0x160a('0x10'));logger[_0x160a('0x11')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x277f09,_0x160a('0x10'),JSON[_0x160a('0x12')](_0x414fbe));if(_0x414fbe['error']){if(_0x414fbe[_0x160a('0x13')]['code']===0x1f4){logger['error'](_0x160a('0xf'),_0x277f09,_0x414fbe['error']['message']);return _0x4efee3(_0x414fbe[_0x160a('0x13')]['message']);}logger[_0x160a('0x13')](_0x160a('0xf'),_0x277f09,_0x414fbe[_0x160a('0x13')][_0x160a('0x14')]);return _0x304b3d(_0x414fbe[_0x160a('0x13')][_0x160a('0x14')]);}else{logger['info'](_0x160a('0xf'),_0x277f09,_0x160a('0x10'));_0x304b3d(_0x414fbe[_0x160a('0x15')][_0x160a('0x14')]);}})['catch'](function(_0x4fe30e){logger[_0x160a('0x13')](_0x160a('0xf'),_0x277f09,_0x4fe30e);_0x4efee3(_0x4fe30e);});});}
\ No newline at end of file
+var _0x167b=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x167b,0x74));var _0xb167=function(_0x34319b,_0x2f3dff){_0x34319b=_0x34319b-0x0;var _0x16821e=_0x167b[_0x34319b];return _0x16821e;};'use strict';var _=require(_0xb167('0x0'));var util=require(_0xb167('0x1'));var moment=require(_0xb167('0x2'));var BPromise=require(_0xb167('0x3'));var rs=require(_0xb167('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb167('0x5'))['db'];var utils=require(_0xb167('0x6'));var logger=require(_0xb167('0x7'))('rpc');var config=require(_0xb167('0x8'));var jayson=require(_0xb167('0x9'));var client=jayson[_0xb167('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ec2bd,_0x31154a,_0x4875b0){return new BPromise(function(_0x2e8ef7,_0xf3a3b6){return client[_0xb167('0xb')](_0x4ec2bd,_0x4875b0)[_0xb167('0xc')](function(_0x2ef1b2){logger[_0xb167('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x31154a,_0xb167('0xe'));logger[_0xb167('0xf')](_0xb167('0x10'),_0x31154a,_0xb167('0xe'),JSON[_0xb167('0x11')](_0x2ef1b2));if(_0x2ef1b2['error']){if(_0x2ef1b2[_0xb167('0x12')][_0xb167('0x13')]===0x1f4){logger[_0xb167('0x12')](_0xb167('0x14'),_0x31154a,_0x2ef1b2[_0xb167('0x12')][_0xb167('0x15')]);return _0xf3a3b6(_0x2ef1b2[_0xb167('0x12')][_0xb167('0x15')]);}logger['error'](_0xb167('0x14'),_0x31154a,_0x2ef1b2['error'][_0xb167('0x15')]);return _0x2e8ef7(_0x2ef1b2['error']['message']);}else{logger[_0xb167('0xd')](_0xb167('0x14'),_0x31154a,_0xb167('0xe'));_0x2e8ef7(_0x2ef1b2[_0xb167('0x16')]['message']);}})[_0xb167('0x17')](function(_0x427ba3){logger[_0xb167('0x12')](_0xb167('0x14'),_0x31154a,_0x427ba3);_0xf3a3b6(_0x427ba3);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 9fb7029..e7a14cc 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 _0x066b=['../../config/environment','get','index','/describe','isAuthenticated','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x3ccc44,_0x207b0c){var _0x5d74bb=function(_0x59989a){while(--_0x59989a){_0x3ccc44['push'](_0x3ccc44['shift']());}};_0x5d74bb(++_0x207b0c);}(_0x066b,0xa4));var _0xb066=function(_0x587391,_0x1c2e51){_0x587391=_0x587391-0x0;var _0x549f32=_0x066b[_0x587391];return _0x549f32;};'use strict';var multer=require(_0xb066('0x0'));var util=require(_0xb066('0x1'));var path=require(_0xb066('0x2'));var timeout=require(_0xb066('0x3'));var express=require(_0xb066('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb066('0x5'));var interaction=require(_0xb066('0x6'));var config=require(_0xb066('0x7'));var controller=require('./chatTransferReport.controller');router[_0xb066('0x8')]('/',auth['isAuthenticated'](),controller[_0xb066('0x9')]);router['get'](_0xb066('0xa'),auth[_0xb066('0xb')](),controller['describe']);router[_0xb066('0x8')](_0xb066('0xc'),auth['isAuthenticated'](),controller[_0xb066('0xd')]);router[_0xb066('0xe')]('/',auth[_0xb066('0xb')](),controller[_0xb066('0xf')]);router[_0xb066('0x10')](_0xb066('0xc'),auth[_0xb066('0xb')](),controller['update']);router[_0xb066('0x11')]('/:id',auth[_0xb066('0xb')](),controller[_0xb066('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x458e=['./chatTransferReport.controller','get','isAuthenticated','/describe','show','post','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5a46a6,_0x397243){var _0x3a6af4=function(_0xea0f48){while(--_0xea0f48){_0x5a46a6['push'](_0x5a46a6['shift']());}};_0x3a6af4(++_0x397243);}(_0x458e,0xf5));var _0xe458=function(_0x2fbe43,_0x24e8cd){_0x2fbe43=_0x2fbe43-0x0;var _0x11567a=_0x458e[_0x2fbe43];return _0x11567a;};'use strict';var multer=require(_0xe458('0x0'));var util=require(_0xe458('0x1'));var path=require('path');var timeout=require(_0xe458('0x2'));var express=require(_0xe458('0x3'));var router=express[_0xe458('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe458('0x5'));var interaction=require(_0xe458('0x6'));var config=require('../../config/environment');var controller=require(_0xe458('0x7'));router[_0xe458('0x8')]('/',auth[_0xe458('0x9')](),controller['index']);router[_0xe458('0x8')](_0xe458('0xa'),auth[_0xe458('0x9')](),controller['describe']);router[_0xe458('0x8')]('/:id',auth[_0xe458('0x9')](),controller[_0xe458('0xb')]);router[_0xe458('0xc')]('/',auth[_0xe458('0x9')](),controller['create']);router[_0xe458('0xd')](_0xe458('0xe'),auth[_0xe458('0x9')](),controller[_0xe458('0xf')]);router[_0xe458('0x10')](_0xe458('0xe'),auth['isAuthenticated'](),controller[_0xe458('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 5aabfd5..38d2c01 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 _0xcbed=['Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Skip','Feedback','star','thumb','stringify','input','text','name','getDataValue','setDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xcbed,0x164));var _0xdcbe=function(_0x429b9c,_0x4171e9){_0x429b9c=_0x429b9c-0x0;var _0x2ebf77=_0xcbed[_0x429b9c];return _0x2ebf77;};'use strict';var Sequelize=require(_0xdcbe('0x0'));var rs=require(_0xdcbe('0x1'));module[_0xdcbe('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xdcbe('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xdcbe('0x4')},'key':{'type':Sequelize[_0xdcbe('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdcbe('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xdcbe('0x3')],'allowNull':![],'defaultValue':_0xdcbe('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xdcbe('0x3')],'allowNull':![],'defaultValue':_0xdcbe('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xdcbe('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xdcbe('0x3')]},'animation':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xdcbe('0xa')](_0xdcbe('0xb'),_0xdcbe('0xc')),'defaultValue':_0xdcbe('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xdcbe('0xd')},'start_chat_button':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0xe')},'offline_chat_button':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0xf')},'header_offline':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0x10')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xdcbe('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0x11')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xdcbe('0x12')]},'closingQuestion':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0x14')},'noteTitle':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0xf')},'skipMessageButton':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0x16')},'conditionAgreement':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0x17')},'ratingType':{'type':Sequelize[_0xdcbe('0xa')](_0xdcbe('0x18'),_0xdcbe('0x19')),'defaultValue':_0xdcbe('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xdcbe('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xdcbe('0x12')],'defaultValue':function(){return JSON[_0xdcbe('0x1a')]({'items':[{'type':_0xdcbe('0x1b'),'variable':null,'config':{'placeholder':'name','type':_0xdcbe('0x1c'),'required':!![]},'props':{'title':_0xdcbe('0x1d'),'helpText':''}},{'type':_0xdcbe('0x1b'),'props':{'title':_0xdcbe('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xdcbe('0x4'),'type':_0xdcbe('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xdcbe('0x1e')]('onlineForm')?JSON['parse'](this[_0xdcbe('0x1e')]('onlineForm')):{};},'set':function(_0x7e3157){return this[_0xdcbe('0x1f')](_0xdcbe('0x20'),JSON[_0xdcbe('0x1a')](_0x7e3157));}},'offlineForm':{'type':Sequelize[_0xdcbe('0x12')],'defaultValue':function(){return JSON[_0xdcbe('0x1a')]({'items':[{'type':_0xdcbe('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xdcbe('0x4'),'type':_0xdcbe('0x4')},'variable':null},{'type':_0xdcbe('0x21'),'config':{'placeholder':_0xdcbe('0x22')},'props':{'title':_0xdcbe('0x22'),'helpText':_0xdcbe('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xdcbe('0x1e')](_0xdcbe('0x24'))?JSON[_0xdcbe('0x25')](this[_0xdcbe('0x1e')](_0xdcbe('0x24'))):{};},'set':function(_0x137c16){return this['setDataValue'](_0xdcbe('0x24'),JSON[_0xdcbe('0x1a')](_0x137c16));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xdcbe('0x26')]();}},'autoclose':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xdcbe('0x3')]},'forwardOffline':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xdcbe('0x3')]},'waitingTitle':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0x27')},'waitingMessage':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0x28')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xdcbe('0x29')},'offlineMessageBody':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0x2b')},'skipUnmanaged':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0x16')},'sendUnmanaged':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xdcbe('0x12')]},'showAgentAvatar':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xdcbe('0x3')]},'notificationTemplate':{'type':Sequelize[_0xdcbe('0x12')],'defaultValue':function(){return _0xdcbe('0x2c');}},'notificationSound':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize[_0xdcbe('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xdcbe('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0x2e')},'defaultTitle':{'type':Sequelize[_0xdcbe('0x3')]},'customerAvatar':{'type':Sequelize[_0xdcbe('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xdcbe('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xdcbe('0x3')],'allowNull':![],'defaultValue':_0xdcbe('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdcbe('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdcbe('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':_0xdcbe('0x30')},'systemAvatar':{'type':Sequelize[_0xdcbe('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdcbe('0x8')],'comment':_0xdcbe('0x31')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x267e50){if(!_0x267e50)this['setDataValue'](_0xdcbe('0x32'),null);this['setDataValue']('mandatoryDisposition',_0x267e50);}},'vidaooEscalation':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xdcbe('0x3')]},'vidaooTopic':{'type':Sequelize[_0xdcbe('0x3')],'allowNull':![],'defaultValue':_0xdcbe('0x33')},'vidaooNote':{'type':Sequelize[_0xdcbe('0x3')],'defaultValue':function(){return _0xdcbe('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xdcbe('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xdcbe('0x12')]}};
\ No newline at end of file
+var _0xfd24=['#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','INTEGER','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','TEXT','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','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','STRING','email','Agent'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0xfd24,0xff));var _0x4fd2=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xfd24[_0x1deb03];return _0x189fe7;};'use strict';var Sequelize=require(_0x4fd2('0x0'));var rs=require(_0x4fd2('0x1'));module['exports']={'name':{'type':Sequelize[_0x4fd2('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x4fd2('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x4fd2('0x2')]},'mapKey':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':_0x4fd2('0x3')},'mapKeyOffline':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':_0x4fd2('0x3')},'key':{'type':Sequelize[_0x4fd2('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':_0x4fd2('0x4')},'customerAlias':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x4fd2('0x2')],'allowNull':![],'defaultValue':_0x4fd2('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x4fd2('0x2')],'allowNull':![],'defaultValue':_0x4fd2('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x4fd2('0x2')],'allowNull':![],'defaultValue':_0x4fd2('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4fd2('0x2')]},'animation':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x4fd2('0x8')](_0x4fd2('0x9'),_0x4fd2('0xa')),'defaultValue':_0x4fd2('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x4fd2('0xb')},'start_chat_button':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':_0x4fd2('0xc')},'header_offline':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x4fd2('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':_0x4fd2('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4fd2('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':_0x4fd2('0x10')},'noteTitle':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':_0x4fd2('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4fd2('0x12')},'closingMessage':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':_0x4fd2('0x13')},'closingMessageButton':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':_0x4fd2('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x4fd2('0x14')},'conditionAgreement':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x4fd2('0x15')},'ratingType':{'type':Sequelize[_0x4fd2('0x8')]('star',_0x4fd2('0x16')),'defaultValue':_0x4fd2('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x4fd2('0x18')],'defaultValue':function(){return JSON[_0x4fd2('0x19')]({'items':[{'type':_0x4fd2('0x1a'),'variable':null,'config':{'placeholder':_0x4fd2('0x1b'),'type':_0x4fd2('0x1c'),'required':!![]},'props':{'title':_0x4fd2('0x1b'),'helpText':''}},{'type':_0x4fd2('0x1a'),'props':{'title':_0x4fd2('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x4fd2('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x4fd2('0x1d')](_0x4fd2('0x1e'))?JSON[_0x4fd2('0x1f')](this['getDataValue']('onlineForm')):{};},'set':function(_0x465aa8){return this[_0x4fd2('0x20')](_0x4fd2('0x1e'),JSON[_0x4fd2('0x19')](_0x465aa8));}},'offlineForm':{'type':Sequelize[_0x4fd2('0x18')],'defaultValue':function(){return JSON[_0x4fd2('0x19')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x4fd2('0x3')},'variable':null},{'type':_0x4fd2('0x21'),'config':{'placeholder':_0x4fd2('0x22')},'props':{'title':_0x4fd2('0x22'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x4fd2('0x1d')](_0x4fd2('0x23'))?JSON[_0x4fd2('0x1f')](this[_0x4fd2('0x1d')](_0x4fd2('0x23'))):{};},'set':function(_0x30d919){return this['setDataValue']('offlineForm',JSON[_0x4fd2('0x19')](_0x30d919));}},'token':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':function(){return rs[_0x4fd2('0x24')]();}},'autoclose':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4fd2('0x2')]},'forwardOffline':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x4fd2('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':_0x4fd2('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':_0x4fd2('0x26')},'offlineMessageBody':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':_0x4fd2('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':_0x4fd2('0x14')},'sendUnmanaged':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x4fd2('0x18')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x4fd2('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x4fd2('0x28');}},'notificationSound':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':_0x4fd2('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x4fd2('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':_0x4fd2('0x2a')},'verticalAlignment':{'type':Sequelize[_0x4fd2('0xd')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x4fd2('0x2b')},'defaultTitle':{'type':Sequelize[_0x4fd2('0x2')]},'customerAvatar':{'type':Sequelize[_0x4fd2('0x18')]},'showCustomerAvatar':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x4fd2('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x4fd2('0x2')],'allowNull':![],'defaultValue':_0x4fd2('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4fd2('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4fd2('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':_0x4fd2('0x2d')},'systemAvatar':{'type':Sequelize[_0x4fd2('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4fd2('0xd')],'comment':_0x4fd2('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':![],'comment':_0x4fd2('0x2f'),'set':function(_0x2e5200){if(!_0x2e5200)this[_0x4fd2('0x20')](_0x4fd2('0x30'),null);this['setDataValue'](_0x4fd2('0x31'),_0x2e5200);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x4fd2('0x2')],'allowNull':![],'defaultValue':_0x4fd2('0x32')},'vidaooNote':{'type':Sequelize[_0x4fd2('0x2')],'defaultValue':function(){return _0x4fd2('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x4fd2('0x18')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x4fd2('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 08a31a3..320d44b 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 _0x8840=['emit','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','ChatWebsites','UserProfileResource','destroy','name','index','Pause','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','ChatWebsite','rows','catch','show','params','mandatoryDispositionPause','includeAll','find','create','body','user','role','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','findOne','Disposition','ChatWebsiteId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','hasOwnProperty','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','setUA','headers','user-agent','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','account','applications','Applications','asc','defaults','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','autoclose','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','Start','startRouting','EventManager','send','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','mimetype','files','attachments','offline-chat','basename','openNewInteraction','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','pass','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','email','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','virtual','License','increment','chatLicenseExceeded','some','server/files/chat/iframe.ejs','remote','stringify','x-real-ip','connection','remoteAddress','replace','render','alignment','textColor','color_button','addApplications','sequelize','ChatApplication','bulkCreate','priority','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachment','Attachments','addAgents'];(function(_0x2bf466,_0x4929a5){var _0x856885=function(_0x102ef1){while(--_0x102ef1){_0x2bf466['push'](_0x2bf466['shift']());}};_0x856885(++_0x4929a5);}(_0x8840,0x12f));var _0x0884=function(_0x330723,_0x8de382){_0x330723=_0x330723-0x0;var _0x60c546=_0x8840[_0x330723];return _0x60c546;};'use strict';var emlformat=require(_0x0884('0x0'));var rimraf=require(_0x0884('0x1'));var zipdir=require(_0x0884('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0884('0x3'));var moment=require(_0x0884('0x4'));var BPromise=require(_0x0884('0x5'));var Mustache=require(_0x0884('0x6'));var util=require(_0x0884('0x7'));var path=require(_0x0884('0x8'));var sox=require(_0x0884('0x9'));var csv=require(_0x0884('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0884('0xb'));var crypto=require(_0x0884('0xc'));var jsforce=require(_0x0884('0xd'));var deskjs=require(_0x0884('0xe'));var toCsv=require(_0x0884('0xa'));var querystring=require(_0x0884('0xf'));var Papa=require('papaparse');var Redis=require(_0x0884('0x10'));var authService=require(_0x0884('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0884('0x12'));var hardwareService=require(_0x0884('0x13'));var logger=require(_0x0884('0x14'))(_0x0884('0x15'));var utils=require(_0x0884('0x16'));var config=require(_0x0884('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0884('0x18'))['db'];config['redis']=_['defaults'](config[_0x0884('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0884('0x1a'))(new Redis(config[_0x0884('0x19')]));require(_0x0884('0x1b'))[_0x0884('0x1c')](socket);var jayson=require(_0x0884('0x1d'));var client=jayson[_0x0884('0x1e')][_0x0884('0x1f')]({'port':0x232c});var client9002=jayson[_0x0884('0x1e')]['http']({'port':0x232a});var client9003=jayson[_0x0884('0x1e')][_0x0884('0x1f')]({'port':0x232b});var client9001=jayson['client'][_0x0884('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x25c63f,_0x23f99e,_0x4a1b68,_0x460119){return new BPromise(function(_0x12fbab,_0x1add15){var _0x4bee6f=_0x460119||client;return _0x4bee6f['request'](_0x25c63f,_0x4a1b68)[_0x0884('0x20')](function(_0xd8d59e){logger[_0x0884('0x21')](_0x0884('0x22'),_0x23f99e,_0x0884('0x23'));logger[_0x0884('0x24')](_0x0884('0x25'),_0x23f99e,_0x0884('0x23'),JSON['stringify'](_0xd8d59e));if(_0xd8d59e[_0x0884('0x26')]){if(_0xd8d59e['error']['code']===0x1f4){logger[_0x0884('0x26')](_0x0884('0x22'),_0x23f99e,_0xd8d59e[_0x0884('0x26')][_0x0884('0x27')]);return _0x1add15(_0xd8d59e[_0x0884('0x26')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x23f99e,_0xd8d59e[_0x0884('0x26')][_0x0884('0x27')]);return _0x12fbab(_0xd8d59e[_0x0884('0x26')][_0x0884('0x27')]);}else{logger[_0x0884('0x21')](_0x0884('0x22'),_0x23f99e,'request\x20sent');_0x12fbab(_0xd8d59e[_0x0884('0x28')][_0x0884('0x27')]);}})['catch'](function(_0x2e9c50){logger[_0x0884('0x26')](_0x0884('0x22'),_0x23f99e,_0x2e9c50);_0x1add15(_0x2e9c50);});});}function respondWithStatusCode(_0x28cf9a,_0xc2e2b){_0xc2e2b=_0xc2e2b||0xcc;return function(_0x18ee43){if(_0x18ee43){return _0x28cf9a[_0x0884('0x29')](_0xc2e2b);}return _0x28cf9a[_0x0884('0x2a')](_0xc2e2b)[_0x0884('0x2b')]();};}function respondWithResult(_0x5fce70,_0x2f6f92){_0x2f6f92=_0x2f6f92||0xc8;return function(_0x184600){if(_0x184600){return _0x5fce70[_0x0884('0x2a')](_0x2f6f92)[_0x0884('0x2c')](_0x184600);}};}function respondWithFilteredResult(_0x4324b4,_0x4149f8){return function(_0x1ec4af){if(_0x1ec4af){var _0x2bd364=typeof _0x4149f8[_0x0884('0x2d')]===_0x0884('0x2e')&&typeof _0x4149f8[_0x0884('0x2f')]===_0x0884('0x2e');var _0x1e9a6b=_0x1ec4af[_0x0884('0x30')];var _0x1c863f=_0x2bd364?0x0:_0x4149f8[_0x0884('0x2d')];var _0x4bc86c=_0x2bd364?_0x1ec4af[_0x0884('0x30')]:_0x4149f8['offset']+_0x4149f8[_0x0884('0x2f')];var _0x17eec2;if(_0x4bc86c>=_0x1e9a6b){_0x4bc86c=_0x1e9a6b;_0x17eec2=0xc8;}else{_0x17eec2=0xce;}_0x4324b4[_0x0884('0x2a')](_0x17eec2);return _0x4324b4[_0x0884('0x31')](_0x0884('0x32'),_0x1c863f+'-'+_0x4bc86c+'/'+_0x1e9a6b)[_0x0884('0x2c')](_0x1ec4af);}return null;};}function patchUpdates(_0x521d01){return function(_0xfc56c8){try{jsonpatch[_0x0884('0x33')](_0xfc56c8,_0x521d01,!![]);}catch(_0x4e008e){return BPromise['reject'](_0x4e008e);}return _0xfc56c8[_0x0884('0x34')]();};}function saveUpdates(_0x185baa,_0x2551c5){return function(_0x5caf34){if(_0x5caf34){return _0x5caf34[_0x0884('0x35')](_0x185baa)[_0x0884('0x20')](function(_0x105384){return _0x105384;});}return null;};}function removeEntity(_0x48c264,_0x3ac2c2){return function(_0x355c59){if(_0x355c59){return _0x355c59['destroy']()[_0x0884('0x20')](function(){var _0x392a29=_0x355c59['get']({'plain':!![]});var _0x1f00c9=_0x0884('0x36');return db[_0x0884('0x37')][_0x0884('0x38')]({'where':{'type':_0x1f00c9,'resourceId':_0x392a29['id']}})[_0x0884('0x20')](function(){return _0x355c59;});})['then'](function(){_0x48c264['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42bc45,_0x26111a){return function(_0x487ece){if(!_0x487ece){_0x42bc45[_0x0884('0x29')](0x194);}return _0x487ece;};}function handleError(_0x51f504,_0x6b0aba){_0x6b0aba=_0x6b0aba||0x1f4;return function(_0x35bddb){logger[_0x0884('0x26')](_0x35bddb['stack']);if(_0x35bddb['name']){delete _0x35bddb[_0x0884('0x39')];}_0x51f504[_0x0884('0x2a')](_0x6b0aba)['send'](_0x35bddb);};}exports[_0x0884('0x3a')]=function(_0x316584,_0x3193dc){var _0xf9c600={'include':[{'model':db[_0x0884('0x3b')],'as':'mandatoryDispositionPause'}]},_0x169436={},_0xe3a57a={'count':0x0,'rows':[]};var _0x1ab6f5=_[_0x0884('0x3c')](db['ChatWebsite'][_0x0884('0x3d')],function(_0x5b7771){return{'name':_0x5b7771[_0x0884('0x3e')],'type':_0x5b7771[_0x0884('0x3f')][_0x0884('0x40')]};});_0x169436['model']=_[_0x0884('0x3c')](_0x1ab6f5,'name');_0x169436[_0x0884('0x41')]=_[_0x0884('0x42')](_0x316584[_0x0884('0x41')]);_0x169436[_0x0884('0x43')]=_[_0x0884('0x44')](_0x169436[_0x0884('0x45')],_0x169436['query']);_0xf9c600[_0x0884('0x46')]=_[_0x0884('0x44')](_0x169436[_0x0884('0x45')],qs[_0x0884('0x47')](_0x316584[_0x0884('0x41')][_0x0884('0x47')]));_0xf9c600['attributes']=_0xf9c600[_0x0884('0x46')][_0x0884('0x48')]?_0xf9c600[_0x0884('0x46')]:_0x169436[_0x0884('0x45')];if(!_0x316584['query']['hasOwnProperty'](_0x0884('0x49'))){_0xf9c600[_0x0884('0x2f')]=qs['limit'](_0x316584[_0x0884('0x41')]['limit']);_0xf9c600[_0x0884('0x2d')]=qs['offset'](_0x316584[_0x0884('0x41')][_0x0884('0x2d')]);}_0xf9c600[_0x0884('0x4a')]=qs[_0x0884('0x4b')](_0x316584[_0x0884('0x41')][_0x0884('0x4b')]);_0xf9c600[_0x0884('0x4c')]=qs['filters'](_[_0x0884('0x4d')](_0x316584['query'],_0x169436[_0x0884('0x43')]),_0x1ab6f5);if(_0x316584['query'][_0x0884('0x4e')]){_0xf9c600[_0x0884('0x4c')]=_[_0x0884('0x4f')](_0xf9c600[_0x0884('0x4c')],{'$or':_['map'](_0x1ab6f5,function(_0x10892f){if(_0x10892f[_0x0884('0x3f')]!==_0x0884('0x50')){var _0x15c07c={};_0x15c07c[_0x10892f['name']]={'$like':'%'+_0x316584[_0x0884('0x41')][_0x0884('0x4e')]+'%'};return _0x15c07c;}})});}_0xf9c600=_['merge']({},_0xf9c600,_0x316584[_0x0884('0x51')]);var _0x2e4485={'where':_0xf9c600['where']};return db['ChatWebsite'][_0x0884('0x30')](_0x2e4485)[_0x0884('0x20')](function(_0x23f9ec){_0xe3a57a['count']=_0x23f9ec;if(_0x316584[_0x0884('0x41')]['includeAll']){_0xf9c600[_0x0884('0x52')]=[{'all':!![]}];}return db[_0x0884('0x53')]['findAll'](_0xf9c600);})[_0x0884('0x20')](function(_0x3a3b76){_0xe3a57a[_0x0884('0x54')]=_0x3a3b76;return _0xe3a57a;})['then'](respondWithFilteredResult(_0x3193dc,_0xf9c600))[_0x0884('0x55')](handleError(_0x3193dc,null));};exports[_0x0884('0x56')]=function(_0x3fb7ba,_0x518e41){var _0x2a19d0={'raw':![],'where':{'id':_0x3fb7ba[_0x0884('0x57')]['id']},'include':[{'model':db[_0x0884('0x3b')],'as':_0x0884('0x58')}]},_0x546926={};_0x546926[_0x0884('0x45')]=_[_0x0884('0x42')](db[_0x0884('0x53')][_0x0884('0x3d')]);_0x546926[_0x0884('0x41')]=_[_0x0884('0x42')](_0x3fb7ba[_0x0884('0x41')]);_0x546926[_0x0884('0x43')]=_['intersection'](_0x546926[_0x0884('0x45')],_0x546926['query']);_0x2a19d0['attributes']=_['intersection'](_0x546926[_0x0884('0x45')],qs[_0x0884('0x47')](_0x3fb7ba[_0x0884('0x41')][_0x0884('0x47')]));_0x2a19d0[_0x0884('0x46')]=_0x2a19d0[_0x0884('0x46')][_0x0884('0x48')]?_0x2a19d0[_0x0884('0x46')]:_0x546926['model'];if(_0x3fb7ba[_0x0884('0x41')][_0x0884('0x59')]){_0x2a19d0[_0x0884('0x52')]=[{'all':!![]}];}_0x2a19d0=_[_0x0884('0x4f')]({},_0x2a19d0,_0x3fb7ba[_0x0884('0x51')]);return db[_0x0884('0x53')][_0x0884('0x5a')](_0x2a19d0)[_0x0884('0x20')](handleEntityNotFound(_0x518e41,null))[_0x0884('0x20')](respondWithResult(_0x518e41,null))[_0x0884('0x55')](handleError(_0x518e41,null));};exports['create']=function(_0x5c5dfe,_0x5c9bd6){return db[_0x0884('0x53')][_0x0884('0x5b')](_0x5c5dfe[_0x0884('0x5c')],{})['then'](function(_0xd56876){var _0x2844d2=_0x5c5dfe[_0x0884('0x5d')]['get']({'plain':!![]});if(!_0x2844d2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2844d2[_0x0884('0x5e')]==='user'){var _0x481abb=_0xd56876[_0x0884('0x5f')]({'plain':!![]});var _0x51dad4='ChatWebsites';return db[_0x0884('0x60')][_0x0884('0x5a')]({'where':{'name':_0x51dad4,'userProfileId':_0x2844d2['userProfileId']},'raw':!![]})[_0x0884('0x20')](function(_0x4f9623){if(_0x4f9623&&_0x4f9623['autoAssociation']===0x0){return db[_0x0884('0x37')][_0x0884('0x5b')]({'name':_0x481abb[_0x0884('0x39')],'resourceId':_0x481abb['id'],'type':_0x4f9623[_0x0884('0x39')],'sectionId':_0x4f9623['id']},{})[_0x0884('0x20')](function(){return _0xd56876;});}else{return _0xd56876;}})[_0x0884('0x55')](function(_0x58d4df){logger['error'](_0x0884('0x61'),_0x58d4df);throw _0x58d4df;});}return _0xd56876;})[_0x0884('0x20')](respondWithResult(_0x5c9bd6,0xc9))[_0x0884('0x55')](handleError(_0x5c9bd6,null));};exports[_0x0884('0x35')]=function(_0x575a82,_0x3a19a6){if(_0x575a82[_0x0884('0x5c')]['id']){delete _0x575a82['body']['id'];}return db[_0x0884('0x53')][_0x0884('0x5a')]({'where':{'id':_0x575a82[_0x0884('0x57')]['id']},'include':[{'model':db[_0x0884('0x3b')],'as':_0x0884('0x58')}]})[_0x0884('0x20')](handleEntityNotFound(_0x3a19a6,null))[_0x0884('0x20')](saveUpdates(_0x575a82['body'],null))['then'](respondWithResult(_0x3a19a6,null))[_0x0884('0x55')](handleError(_0x3a19a6,null));};exports['destroy']=function(_0x124f55,_0x4287a7){return db['ChatWebsite'][_0x0884('0x5a')]({'where':{'id':_0x124f55[_0x0884('0x57')]['id']}})[_0x0884('0x20')](handleEntityNotFound(_0x4287a7,null))[_0x0884('0x20')](removeEntity(_0x4287a7,null))[_0x0884('0x55')](handleError(_0x4287a7,null));};exports[_0x0884('0x62')]=function(_0x4e08c0,_0x1d6c10){return db['ChatWebsite'][_0x0884('0x62')]()[_0x0884('0x20')](respondWithResult(_0x1d6c10,null))['catch'](handleError(_0x1d6c10,null));};exports[_0x0884('0x63')]=function(_0x101ec0,_0xd38533,_0x31ff81){if(_0x101ec0[_0x0884('0x5c')]['id']){delete _0x101ec0[_0x0884('0x5c')]['id'];}return db['ChatWebsite'][_0x0884('0x5a')]({'where':{'id':_0x101ec0[_0x0884('0x57')]['id']}})['then'](handleEntityNotFound(_0xd38533,null))[_0x0884('0x20')](function(_0x5d6485){if(_0x5d6485){_0x101ec0[_0x0884('0x5c')]['ChatWebsiteId']=_0x5d6485['id'];return db['Disposition'][_0x0884('0x5b')](_0x101ec0[_0x0884('0x5c')]);}})['then'](respondWithResult(_0xd38533,null))[_0x0884('0x55')](handleError(_0xd38533,null));};exports['getDispositions']=function(_0x3e9313,_0x33777a,_0x19f644){var _0x14c0fb={'raw':![],'where':{}};var _0x2675ce={};var _0x347039={'count':0x0,'rows':[]};return db[_0x0884('0x53')][_0x0884('0x64')]({'where':{'id':_0x3e9313[_0x0884('0x57')]['id']}})[_0x0884('0x20')](handleEntityNotFound(_0x33777a,null))[_0x0884('0x20')](function(_0x41d9f8){if(_0x41d9f8){_0x2675ce['model']=_[_0x0884('0x42')](db[_0x0884('0x65')]['rawAttributes']);_0x2675ce[_0x0884('0x41')]=_[_0x0884('0x42')](_0x3e9313[_0x0884('0x41')]);_0x2675ce[_0x0884('0x43')]=_[_0x0884('0x44')](_0x2675ce['model'],_0x2675ce[_0x0884('0x41')]);_0x14c0fb['attributes']=_[_0x0884('0x44')](_0x2675ce['model'],qs['fields'](_0x3e9313[_0x0884('0x41')][_0x0884('0x47')]));_0x14c0fb[_0x0884('0x46')]=_0x14c0fb[_0x0884('0x46')][_0x0884('0x48')]?_0x14c0fb[_0x0884('0x46')]:_0x2675ce[_0x0884('0x45')];if(!_0x3e9313[_0x0884('0x41')]['hasOwnProperty'](_0x0884('0x49'))){_0x14c0fb[_0x0884('0x2f')]=qs['limit'](_0x3e9313[_0x0884('0x41')][_0x0884('0x2f')]);_0x14c0fb[_0x0884('0x2d')]=qs[_0x0884('0x2d')](_0x3e9313[_0x0884('0x41')][_0x0884('0x2d')]);}_0x14c0fb['order']=qs['sort'](_0x3e9313['query'][_0x0884('0x4b')]);_0x14c0fb[_0x0884('0x4c')]=qs[_0x0884('0x43')](_['pick'](_0x3e9313[_0x0884('0x41')],_0x2675ce[_0x0884('0x43')]));_0x14c0fb[_0x0884('0x4c')][_0x0884('0x66')]=_0x41d9f8['id'];if(_0x3e9313[_0x0884('0x41')][_0x0884('0x4e')]){_0x14c0fb[_0x0884('0x4c')]=_[_0x0884('0x4f')](_0x14c0fb['where'],{'$or':_[_0x0884('0x3c')](_0x14c0fb['attributes'],function(_0x5b4efa){var _0x2e2cde={};_0x2e2cde[_0x5b4efa]={'$like':'%'+_0x3e9313['query']['filter']+'%'};return _0x2e2cde;})});}_0x14c0fb=_[_0x0884('0x4f')]({},_0x14c0fb,_0x3e9313[_0x0884('0x51')]);return db['Disposition'][_0x0884('0x30')]({'where':_0x14c0fb['where']})[_0x0884('0x20')](function(_0x4a8bd0){_0x347039[_0x0884('0x30')]=_0x4a8bd0;if(_0x3e9313[_0x0884('0x41')][_0x0884('0x59')]){_0x14c0fb[_0x0884('0x52')]=[{'all':!![]}];}return db['Disposition'][_0x0884('0x67')](_0x14c0fb);})[_0x0884('0x20')](function(_0x1f4e6c){_0x347039[_0x0884('0x54')]=_0x1f4e6c;return _0x347039;});}})[_0x0884('0x20')](respondWithFilteredResult(_0x33777a,_0x14c0fb))[_0x0884('0x55')](handleError(_0x33777a,null));};exports[_0x0884('0x68')]=function(_0x1400b8,_0x401a19,_0x42fb68){return db[_0x0884('0x53')][_0x0884('0x5a')]({'where':{'id':_0x1400b8['params']['id']}})[_0x0884('0x20')](handleEntityNotFound(_0x401a19,null))[_0x0884('0x20')](function(_0x3be698){if(_0x3be698){return _0x3be698['removeDispositions'](_0x1400b8['query'][_0x0884('0x69')]);}})[_0x0884('0x20')](respondWithStatusCode(_0x401a19,null))[_0x0884('0x55')](handleError(_0x401a19,null));};exports[_0x0884('0x6a')]=function(_0x59be11,_0x45e037,_0x2882f6){if(_0x59be11['body']['id']){delete _0x59be11[_0x0884('0x5c')]['id'];}return db[_0x0884('0x53')]['find']({'where':{'id':_0x59be11[_0x0884('0x57')]['id']}})[_0x0884('0x20')](handleEntityNotFound(_0x45e037,null))['then'](function(_0xf89aad){if(_0xf89aad){_0x59be11[_0x0884('0x5c')][_0x0884('0x66')]=_0xf89aad['id'];return db['CannedAnswer'][_0x0884('0x5b')](_0x59be11[_0x0884('0x5c')]);}})[_0x0884('0x20')](respondWithResult(_0x45e037,null))[_0x0884('0x55')](handleError(_0x45e037,null));};exports['getAnswers']=function(_0x5b6906,_0x104bdb,_0x20eed3){var _0x3d245d={'raw':![],'where':{}};var _0x172de3={};var _0x4bf7f6={'count':0x0,'rows':[]};return db[_0x0884('0x53')][_0x0884('0x64')]({'where':{'id':_0x5b6906[_0x0884('0x57')]['id']}})[_0x0884('0x20')](handleEntityNotFound(_0x104bdb,null))[_0x0884('0x20')](function(_0x1cd6d2){if(_0x1cd6d2){_0x172de3[_0x0884('0x45')]=_[_0x0884('0x42')](db[_0x0884('0x6b')][_0x0884('0x3d')]);_0x172de3[_0x0884('0x41')]=_['keys'](_0x5b6906[_0x0884('0x41')]);_0x172de3[_0x0884('0x43')]=_[_0x0884('0x44')](_0x172de3[_0x0884('0x45')],_0x172de3[_0x0884('0x41')]);_0x3d245d[_0x0884('0x46')]=_[_0x0884('0x44')](_0x172de3[_0x0884('0x45')],qs[_0x0884('0x47')](_0x5b6906['query']['fields']));_0x3d245d[_0x0884('0x46')]=_0x3d245d['attributes'][_0x0884('0x48')]?_0x3d245d[_0x0884('0x46')]:_0x172de3['model'];if(!_0x5b6906[_0x0884('0x41')][_0x0884('0x6c')](_0x0884('0x49'))){_0x3d245d[_0x0884('0x2f')]=qs[_0x0884('0x2f')](_0x5b6906['query'][_0x0884('0x2f')]);_0x3d245d[_0x0884('0x2d')]=qs['offset'](_0x5b6906[_0x0884('0x41')][_0x0884('0x2d')]);}_0x3d245d[_0x0884('0x4a')]=qs[_0x0884('0x4b')](_0x5b6906[_0x0884('0x41')][_0x0884('0x4b')]);_0x3d245d[_0x0884('0x4c')]=qs[_0x0884('0x43')](_[_0x0884('0x4d')](_0x5b6906[_0x0884('0x41')],_0x172de3['filters']));_0x3d245d['where'][_0x0884('0x66')]=_0x1cd6d2['id'];if(_0x5b6906[_0x0884('0x41')][_0x0884('0x4e')]){_0x3d245d[_0x0884('0x4c')]=_[_0x0884('0x4f')](_0x3d245d['where'],{'$or':_[_0x0884('0x3c')](_0x3d245d[_0x0884('0x46')],function(_0x4a01ba){var _0x42f78f={};_0x42f78f[_0x4a01ba]={'$like':'%'+_0x5b6906['query'][_0x0884('0x4e')]+'%'};return _0x42f78f;})});}_0x3d245d=_[_0x0884('0x4f')]({},_0x3d245d,_0x5b6906[_0x0884('0x51')]);return db[_0x0884('0x6b')][_0x0884('0x30')]({'where':_0x3d245d[_0x0884('0x4c')]})[_0x0884('0x20')](function(_0x21ba35){_0x4bf7f6[_0x0884('0x30')]=_0x21ba35;if(_0x5b6906['query'][_0x0884('0x59')]){_0x3d245d[_0x0884('0x52')]=[{'all':!![]}];}return db[_0x0884('0x6b')][_0x0884('0x67')](_0x3d245d);})[_0x0884('0x20')](function(_0x24a58a){_0x4bf7f6['rows']=_0x24a58a;return _0x4bf7f6;});}})[_0x0884('0x20')](respondWithFilteredResult(_0x104bdb,_0x3d245d))[_0x0884('0x55')](handleError(_0x104bdb,null));};exports['removeAnswers']=function(_0x292603,_0x1a18ad,_0x4ec290){return db[_0x0884('0x53')]['find']({'where':{'id':_0x292603[_0x0884('0x57')]['id']}})[_0x0884('0x20')](handleEntityNotFound(_0x1a18ad,null))[_0x0884('0x20')](function(_0xf976e8){if(_0xf976e8){return _0xf976e8['removeAnswers'](_0x292603[_0x0884('0x41')][_0x0884('0x69')]);}})[_0x0884('0x20')](respondWithStatusCode(_0x1a18ad,null))[_0x0884('0x55')](handleError(_0x1a18ad,null));};exports['addLogo']=function(_0x490dcf,_0x3b0169,_0x2038e2){_0x490dcf[_0x0884('0x5c')][_0x0884('0x6d')]=_0x490dcf['file'][_0x0884('0x6e')];return db[_0x0884('0x53')]['find']({'where':{'id':_0x490dcf['params']['id']}})[_0x0884('0x20')](handleEntityNotFound(_0x3b0169,null))[_0x0884('0x20')](saveUpdates(_0x490dcf[_0x0884('0x5c')],null))[_0x0884('0x20')](respondWithResult(_0x3b0169,null))['catch'](handleError(_0x3b0169,null));};exports[_0x0884('0x6f')]=function(_0x27b4f4,_0x4d1e3b,_0x24dfb0){_0x27b4f4[_0x0884('0x5c')][_0x0884('0x70')]=_0x27b4f4[_0x0884('0x71')][_0x0884('0x6e')];return db[_0x0884('0x53')][_0x0884('0x5a')]({'where':{'id':_0x27b4f4[_0x0884('0x57')]['id']}})[_0x0884('0x20')](handleEntityNotFound(_0x4d1e3b,null))['then'](saveUpdates(_0x27b4f4[_0x0884('0x5c')],null))[_0x0884('0x20')](respondWithResult(_0x4d1e3b,null))[_0x0884('0x55')](handleError(_0x4d1e3b,null));};exports[_0x0884('0x72')]=function(_0x221e53,_0xa1df1d,_0x5e220a){_0x221e53['body'][_0x0884('0x73')]=_0x221e53[_0x0884('0x71')]['filename'];return db[_0x0884('0x53')][_0x0884('0x5a')]({'where':{'id':_0x221e53['params']['id']}})[_0x0884('0x20')](handleEntityNotFound(_0xa1df1d,null))['then'](saveUpdates(_0x221e53[_0x0884('0x5c')],null))[_0x0884('0x20')](respondWithResult(_0xa1df1d,null))[_0x0884('0x55')](handleError(_0xa1df1d,null));};exports[_0x0884('0x74')]=function(_0x489d04,_0xfa6706,_0xb44ca3){_0x489d04[_0x0884('0x5c')]['systemAvatar']=_0x489d04[_0x0884('0x71')][_0x0884('0x6e')];return db[_0x0884('0x53')][_0x0884('0x5a')]({'where':{'id':_0x489d04[_0x0884('0x57')]['id']}})[_0x0884('0x20')](handleEntityNotFound(_0xfa6706,null))['then'](saveUpdates(_0x489d04[_0x0884('0x5c')],null))[_0x0884('0x20')](respondWithResult(_0xfa6706,null))[_0x0884('0x55')](handleError(_0xfa6706,null));};exports['getLogo']=function(_0x2353c8,_0x9f0ed9,_0x3c0479){var _0x4cbdf1=path[_0x0884('0x75')](config[_0x0884('0x76')],_0x0884('0x77'));var _0x401475={'where':{'id':_0x2353c8[_0x0884('0x57')]['id']},'attributes':['id',_0x0884('0x6d')],'raw':!![]};var _0x3e1a4f=![];return require(_0x0884('0x78'))[_0x0884('0x79')]()[_0x0884('0x20')](function(_0x14ffa8){if(_0x14ffa8){_0x3e1a4f=_0x14ffa8[_0x0884('0x7a')];}})[_0x0884('0x20')](function(){return db[_0x0884('0x53')]['find'](_0x401475);})[_0x0884('0x20')](handleEntityNotFound(_0x9f0ed9,null))[_0x0884('0x20')](function(_0x324bc0){if(_0x324bc0){if(!_[_0x0884('0x7b')](_0x324bc0[_0x0884('0x6d')])){if(fs[_0x0884('0x7c')](path['join'](config[_0x0884('0x76')],'server/files/images/logos/',_0x324bc0[_0x0884('0x6d')]))&&_0x3e1a4f){_0x4cbdf1=path['join'](config['root'],_0x0884('0x7d'),_0x324bc0['sitepic']);}}return _0x9f0ed9[_0x0884('0x7e')](_0x4cbdf1);}})[_0x0884('0x55')](handleError(_0x9f0ed9,null));};exports[_0x0884('0x7f')]=function(_0x2b2ef5,_0x461e23,_0x50a5bc){var _0x113c0b=path[_0x0884('0x75')](config[_0x0884('0x76')],_0x0884('0x80'));var _0x42e8e0={'where':{'id':_0x2b2ef5[_0x0884('0x57')]['id']},'attributes':['id',_0x0884('0x70')],'raw':!![]};return db['ChatWebsite']['find'](_0x42e8e0)[_0x0884('0x20')](handleEntityNotFound(_0x461e23,null))[_0x0884('0x20')](function(_0x26d379){if(_0x26d379){if(!_['isNil'](_0x26d379[_0x0884('0x70')])){if(fs[_0x0884('0x7c')](path['join'](config['root'],_0x0884('0x81'),_0x26d379[_0x0884('0x70')]))){_0x113c0b=path['join'](config['root'],'server/files/images/avatars/',_0x26d379[_0x0884('0x70')]);}}return _0x461e23[_0x0884('0x7e')](_0x113c0b);}})[_0x0884('0x55')](handleError(_0x461e23,null));};exports[_0x0884('0x82')]=function(_0x587063,_0x10a62c,_0x2bc62f){var _0xcdd979=path['join'](config[_0x0884('0x76')],_0x0884('0x83'));var _0x80e4f3={'where':{'id':_0x587063[_0x0884('0x57')]['id']},'attributes':['id',_0x0884('0x73'),_0x0884('0x84')],'raw':!![]};return db['ChatWebsite'][_0x0884('0x5a')](_0x80e4f3)[_0x0884('0x20')](handleEntityNotFound(_0x10a62c,null))[_0x0884('0x20')](function(_0x23c520){if(_0x23c520){if(!_[_0x0884('0x7b')](_0x23c520[_0x0884('0x73')])){if(fs['existsSync'](path[_0x0884('0x75')](config[_0x0884('0x76')],_0x0884('0x81'),_0x23c520[_0x0884('0x73')]))&&_0x23c520[_0x0884('0x84')]){_0xcdd979=path['join'](config['root'],'server/files/images/avatars/',_0x23c520[_0x0884('0x73')]);}}return _0x10a62c[_0x0884('0x7e')](_0xcdd979);}})[_0x0884('0x55')](handleError(_0x10a62c,null));};exports['getSystemAvatar']=function(_0x4b5499,_0xf9a581,_0x33c7b1){var _0x204050=path[_0x0884('0x75')](config['root'],_0x0884('0x85'));var _0x519358={'where':{'id':_0x4b5499['params']['id']},'attributes':['id',_0x0884('0x86')],'raw':!![]};return db[_0x0884('0x53')][_0x0884('0x5a')](_0x519358)[_0x0884('0x20')](handleEntityNotFound(_0xf9a581,null))[_0x0884('0x20')](function(_0x15b31d){if(_0x15b31d){if(!_['isNil'](_0x15b31d[_0x0884('0x86')])){if(fs[_0x0884('0x7c')](path[_0x0884('0x75')](config['root'],_0x0884('0x81'),_0x15b31d[_0x0884('0x86')]))){_0x204050=path['join'](config[_0x0884('0x76')],'server/files/images/avatars/',_0x15b31d[_0x0884('0x86')]);}}return _0xf9a581[_0x0884('0x7e')](_0x204050);}})[_0x0884('0x55')](handleError(_0xf9a581,null));};exports[_0x0884('0x87')]=function(_0x4b15b6,_0x7f7df5,_0x170082){var _0x55776f=require('user-agent-parser');var _0x3ce8d8=new _0x55776f();var _0x5cfaa9=_0x3ce8d8[_0x0884('0x88')](_0x4b15b6[_0x0884('0x89')][_0x0884('0x8a')])[_0x0884('0x8b')]();var _0x5a6b34={'body':_0x4b15b6[_0x0884('0x5c')],'channel':'chat'};var _0x45e7f3=[];var _0x1b1584=[];var _0x22a5f4={};var _0x4265d3=![];return db[_0x0884('0x8c')][_0x0884('0x62')]()[_0x0884('0x20')](function(_0x4ce748){if(!_0x4ce748){throw new db[(_0x0884('0x8d'))][(_0x0884('0x8e'))](_0x0884('0x8f'));}_0x45e7f3=_[_0x0884('0x90')](_[_0x0884('0x42')](_0x4ce748),[_0x0884('0x91'),'updatedAt']);_0x1b1584=_[_0x0884('0x90')](_[_0x0884('0x42')](_0x4ce748),[_0x0884('0x91'),_0x0884('0x92'),_0x0884('0x93'),_0x0884('0x94')]);if(_0x4b15b6[_0x0884('0x5c')]['id']){delete _0x4b15b6['body']['id'];}if(_['isNil'](_0x4b15b6[_0x0884('0x5c')][_0x0884('0x95')])){throw new db['Sequelize'][(_0x0884('0x8e'))](_0x0884('0x96'));}if(_[_0x0884('0x7b')](_0x4b15b6[_0x0884('0x5c')][_0x0884('0x5c')])||_0x4b15b6[_0x0884('0x5c')][_0x0884('0x5c')]===''){throw new db[(_0x0884('0x8d'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0884('0x7b')](_0x4b15b6['body'][_0x0884('0x97')])){throw new db[(_0x0884('0x8d'))][(_0x0884('0x8e'))](_0x0884('0x98')+_0x1b1584);}if(!_[_0x0884('0x99')](_0x1b1584,_0x4b15b6[_0x0884('0x5c')][_0x0884('0x97')])){throw new db[(_0x0884('0x8d'))][(_0x0884('0x8e'))](_0x0884('0x9a')+_0x1b1584);}_0x22a5f4[_0x4b15b6['body'][_0x0884('0x97')]]=_0x4b15b6['body'][_0x0884('0x95')];})[_0x0884('0x20')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x4b15b6[_0x0884('0x57')]['id']},'include':[{'model':db[_0x0884('0x9b')],'as':_0x0884('0x9c'),'include':[{'model':db[_0x0884('0x8c')],'as':_0x0884('0x9d'),'where':_0x22a5f4,'limit':0x1,'order':[[_0x0884('0x92'),_0x0884('0x9e')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x0884('0x20')](handleEntityNotFound(_0x7f7df5,null))[_0x0884('0x20')](function(_0x560bfb){if(_0x560bfb&&_0x560bfb[_0x0884('0x9c')]){_0x5a6b34[_0x0884('0x9f')]=_0x560bfb;_0x5a6b34[_0x0884('0xa0')]=_0x560bfb[_0x0884('0xa1')];_0x5a6b34['list']=_0x560bfb['List'];_0x5a6b34['applications']=_['orderBy'](_0x5a6b34[_0x0884('0xa0')],['priority'],[_0x0884('0xa2')]);if(_0x5a6b34[_0x0884('0x9f')][_0x0884('0xa1')]){delete _0x5a6b34[_0x0884('0x9f')][_0x0884('0xa1')];}if(_0x5a6b34[_0x0884('0x9f')][_0x0884('0x9c')]&&_0x5a6b34[_0x0884('0x9f')][_0x0884('0x9c')][_0x0884('0x9d')]['length']){return _0x5a6b34[_0x0884('0x9f')][_0x0884('0x9c')][_0x0884('0x9d')][0x0];}var _0x4340a0=_[_0x0884('0xa3')](_0x4b15b6['body'],{'firstName':_0x4b15b6['body'][_0x0884('0x95')],'ListId':_0x560bfb[_0x0884('0x94')]});_0x4340a0[_0x4b15b6['body'][_0x0884('0x97')]]=_0x4b15b6['body'][_0x0884('0x95')];return db[_0x0884('0x8c')][_0x0884('0x5b')](_0x4340a0,{'fields':_0x45e7f3,'raw':!![]});}})[_0x0884('0x20')](handleEntityNotFound(_0x7f7df5,null))[_0x0884('0x20')](function(_0x393e48){_0x5a6b34['contact']=_0x393e48;var _0x2039cd=_0x4b15b6[_0x0884('0x5c')][_0x0884('0xa4')];if(_0x4b15b6[_0x0884('0x89')]['cf-connecting-ip']){_0x2039cd=_0x4b15b6[_0x0884('0x89')][_0x0884('0xa5')];}else if(_0x4b15b6['headers'][_0x0884('0xa6')]){_0x2039cd=_[_0x0884('0xa7')](_0x4b15b6[_0x0884('0x89')][_0x0884('0xa6')]['split'](','));}if(_0x393e48){var _0x121ac6={'ContactId':_0x393e48['id'],'ChatWebsiteId':_0x4b15b6[_0x0884('0x57')]['id'],'from':(_0x393e48[_0x0884('0xa8')]||'')+'\x20'+(_0x393e48[_0x0884('0xa9')]||''),'customerIp':_0x2039cd,'customerPort':_0x4b15b6[_0x0884('0x89')][_0x0884('0xaa')]?_0x4b15b6[_0x0884('0x89')]['x-real-port']:null,'referer':_0x4b15b6['body'][_0x0884('0xab')],'browserName':_0x5cfaa9[_0x0884('0xac')]['name']&&_0x5cfaa9[_0x0884('0xac')][_0x0884('0xad')]?util[_0x0884('0xae')](_0x0884('0xaf'),_0x5cfaa9[_0x0884('0xac')][_0x0884('0x39')],_0x5cfaa9['browser'][_0x0884('0xad')]):'unknown','browserVersion':_0x5cfaa9[_0x0884('0xac')][_0x0884('0xad')]||_0x0884('0xb0'),'osName':util['format'](_0x0884('0xaf'),_0x5cfaa9['os']['name'],_0x5cfaa9['os'][_0x0884('0xad')]),'osVersion':_0x5cfaa9['os'][_0x0884('0xad')],'deviceModel':_0x5cfaa9[_0x0884('0xb1')]['model']&&_0x5cfaa9['device'][_0x0884('0xb2')]?util[_0x0884('0xae')]('%s\x20%s\x20%s',_0x5cfaa9[_0x0884('0xb1')][_0x0884('0x45')],_0x5cfaa9['device'][_0x0884('0xb2')],_0x5cfaa9[_0x0884('0xb1')][_0x0884('0x3f')]):null,'deviceVendor':_0x5cfaa9[_0x0884('0xb1')][_0x0884('0xb2')],'deviceType':_0x5cfaa9[_0x0884('0xb1')][_0x0884('0x3f')],'formData':JSON['stringify'](_0x4b15b6['body'])};var _0x30050e={'ChatWebsiteId':_0x4b15b6[_0x0884('0x57')]['id'],'closed':![]};if(_0x4b15b6[_0x0884('0x5c')][_0x0884('0xb3')]){_0x30050e[_0x0884('0xb3')]=_0x4b15b6[_0x0884('0x5c')][_0x0884('0xb3')];return db['ChatInteraction'][_0x0884('0x5a')]({'where':_0x30050e})[_0x0884('0x20')](function(_0x2314a2){if(_0x2314a2){return[_0x2314a2,![]];}_0x121ac6[_0x0884('0xb3')]=_0x4b15b6[_0x0884('0x5c')]['threadId'];_0x121ac6[_0x0884('0xb4')]=_0x4b15b6[_0x0884('0x5c')][_0x0884('0xb4')];return db[_0x0884('0xb5')][_0x0884('0x5b')](_0x121ac6)[_0x0884('0x20')](function(_0x3512b0){return[_0x3512b0,!![]];});});}_0x30050e[_0x0884('0xb6')]=_0x393e48['id'];if(_0x4b15b6['body'][_0x0884('0xb7')]&&_0x4b15b6[_0x0884('0x5c')][_0x0884('0xb7')]['id']){_0x30050e['id']=_0x4b15b6[_0x0884('0x5c')][_0x0884('0xb7')]['id'];return db[_0x0884('0xb5')][_0x0884('0x5a')]({'where':_0x30050e})['then'](function(_0x1df355){if(_0x1df355){return[_0x1df355,![]];}return db[_0x0884('0xb5')]['create'](_0x121ac6)[_0x0884('0x20')](function(_0x3e3a05){return[_0x3e3a05,!![]];});});}return db[_0x0884('0xb5')]['create'](_0x121ac6)['then'](function(_0xb41e0e){return[_0xb41e0e,!![]];});}})['spread'](function(_0x1718a7,_0x58cac4){if(_0x1718a7){_0x4265d3=_0x58cac4;if(!_0x58cac4){var _0x539104={'from':(_0x5a6b34['contact']['firstName']||'')+'\x20'+(_0x5a6b34['contact'][_0x0884('0xa9')]||'')};if(_0x4b15b6[_0x0884('0x5c')][_0x0884('0xb3')]&&_0x4b15b6['body'][_0x0884('0xb8')]&&_0x4b15b6['body']['threadId']!=_0x4b15b6[_0x0884('0x5c')][_0x0884('0xb8')]){_0x539104[_0x0884('0xb3')]=_0x4b15b6[_0x0884('0x5c')][_0x0884('0xb8')];}return _0x1718a7['update'](_0x539104);}else{return _0x1718a7;}}})[_0x0884('0x20')](function(_0x43f9a7){_0x5a6b34[_0x0884('0xb7')]=_0x43f9a7[_0x0884('0x5f')]({'plain':!![]});_0x5a6b34['interaction']['created']=_0x4265d3;if(_0x5a6b34[_0x0884('0xb7')][_0x0884('0xb9')]){if(_0x5a6b34['account'][_0x0884('0xba')]){_0x5a6b34[_0x0884('0xa0')]['push']({'id':0x0,'priority':_0x5a6b34[_0x0884('0xa0')][_0x0884('0x48')]+0x1,'app':'close','appdata':_0x0884('0xbb'),'interval':_0x0884('0xbc')});}}return db[_0x0884('0xbd')][_0x0884('0x5b')]({'body':_0x4b15b6['body'][_0x0884('0x5c')],'ChatWebsiteId':_0x4b15b6['params']['id'],'ChatInteractionId':_0x43f9a7['id'],'direction':'in','ContactId':_0x5a6b34['contact']['id'],'AttachmentId':_0x4b15b6['body'][_0x0884('0xbe')]});})[_0x0884('0x20')](function(_0xd97070){_0x5a6b34[_0x0884('0x27')]=_0xd97070;if(_0x5a6b34[_0x0884('0xb7')][_0x0884('0xbf')]){return db['User'][_0x0884('0x5a')]({'attributes':['id',_0x0884('0x39')],'where':{'id':_0x5a6b34[_0x0884('0xb7')][_0x0884('0xbf')]}})[_0x0884('0x20')](function(_0x11b438){if(_0x11b438){_0x5a6b34['applications'][_0x0884('0xc0')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x11b438['name']+','+(_0x5a6b34[_0x0884('0x9f')]['waitForTheAssignedAgent']||0xa),'interval':_0x0884('0xbc')});_0x5a6b34['forcedOwnership']=!![];}return respondWithRpcPromise(_0x0884('0xc1'),_0x0884('0xc2'),_0x5a6b34);});}return respondWithRpcPromise('Start','startRouting',_0x5a6b34);})[_0x0884('0x20')](function(_0x3b5ec7){respondWithRpcPromise('EventManager',_0x0884('0xc3'),{'event':_0x0884('0x87'),'message':_0x3b5ec7},client9002);return _0x3b5ec7;})[_0x0884('0x20')](respondWithResult(_0x7f7df5,null))[_0x0884('0x55')](handleError(_0x7f7df5,null));};exports['offline']=function(_0x3082d2,_0x14bdec,_0x1d465f){var _0x31ee05,_0x26119f,_0x4774ea;var _0x2b198b=[];var _0x1a4113=[];var _0x3719f3={};var _0x5d43a9=_0x3082d2['files']||[];var _0x4390b5=[];var _0x3ae8a0;return db[_0x0884('0x8c')]['describe']()['then'](function(_0x413b19){if(!_0x413b19){throw new db['Sequelize']['ValidationError'](_0x0884('0x8f'));}_0x1a4113=_[_0x0884('0x90')](_[_0x0884('0x42')](_0x413b19),['createdAt','updatedAt']);_0x2b198b=_['difference'](_[_0x0884('0x42')](_0x413b19),[_0x0884('0x91'),_0x0884('0x92'),_0x0884('0x93'),_0x0884('0x94')]);if(_0x3082d2[_0x0884('0x5c')]['id']){delete _0x3082d2[_0x0884('0x5c')]['id'];}if(_[_0x0884('0x7b')](_0x3082d2[_0x0884('0x5c')][_0x0884('0x95')])){throw _0x14bdec['status'](0x1f4)[_0x0884('0xc4')](new db[(_0x0884('0x8d'))]['ValidationError'](_0x0884('0x96')));}if(_[_0x0884('0x7b')](_0x3082d2[_0x0884('0x5c')][_0x0884('0x5c')])||_0x3082d2[_0x0884('0x5c')]['body']===''){throw _0x14bdec[_0x0884('0x2a')](0x1f4)[_0x0884('0xc4')](new db[(_0x0884('0x8d'))][(_0x0884('0x8e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x3082d2[_0x0884('0x5c')]['mapKeyOffline'])){throw _0x14bdec['status'](0x1f4)[_0x0884('0xc4')](new db[(_0x0884('0x8d'))][(_0x0884('0x8e'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2b198b));}if(!_['includes'](_0x2b198b,_0x3082d2[_0x0884('0x5c')][_0x0884('0xc5')])){throw _0x14bdec[_0x0884('0x2a')](0x1f4)[_0x0884('0xc4')](new db[(_0x0884('0x8d'))][(_0x0884('0x8e'))](_0x0884('0xc6')+_0x2b198b));}_0x3719f3[_0x3082d2[_0x0884('0x5c')]['mapKeyOffline']]=_0x3082d2[_0x0884('0x5c')][_0x0884('0x95')];})[_0x0884('0x20')](function(){return db[_0x0884('0x53')][_0x0884('0x5a')]({'where':{'id':_0x3082d2[_0x0884('0x57')]['id']},'include':[{'model':db[_0x0884('0x9b')],'as':_0x0884('0x9c')},{'model':db[_0x0884('0xc7')],'as':_0x0884('0xc7')}]});})[_0x0884('0x20')](handleEntityNotFound(_0x14bdec,null))[_0x0884('0x20')](function(_0x53d461){if(_0x53d461&&_0x53d461[_0x0884('0x9c')]){_0x26119f=_0x53d461;var _0x50c81d=_[_0x0884('0xa3')](_0x3082d2[_0x0884('0x5c')],{'firstName':_0x3082d2[_0x0884('0x5c')][_0x0884('0x95')],'phone':_0x3082d2[_0x0884('0x5c')][_0x0884('0x95')],'ListId':_0x53d461['ListId']});_0x50c81d[_0x3082d2[_0x0884('0x5c')][_0x0884('0xc5')]]=_0x3082d2[_0x0884('0x5c')]['from'];return db[_0x0884('0x8c')][_0x0884('0xc8')]({'where':_0x3719f3,'defaults':_0x50c81d});}})[_0x0884('0xc9')](function(_0xb7e1d){if(_0xb7e1d){_0x4774ea=_0xb7e1d;var _0x5c6c34=fs[_0x0884('0xca')](path[_0x0884('0x75')](config[_0x0884('0x76')],_0x0884('0xcb')),_0x0884('0xcc'));var _0x5d48d7=ejs['render'](_0x5c6c34,{'body':_[_0x0884('0xcd')](_0x3082d2[_0x0884('0x5c')][_0x0884('0x5c')]),'bodyTitle':_0x26119f[_0x0884('0xce')]});return db['ChatOfflineMessage'][_0x0884('0x5b')]({'body':_0x5d48d7,'ContactId':_0xb7e1d['id'],'ChatWebsiteId':_0x26119f['id']});}})[_0x0884('0x20')](function(_0x4195ad){_0x3ae8a0=_0x4195ad;if(_0x5d43a9['length']){var _0x4153c7=_0x5d43a9['map'](function(_0x1de6df){return{'name':_0x1de6df['originalname'],'basename':_0x1de6df[_0x0884('0x6e')],'type':_0x1de6df[_0x0884('0xcf')],'ChatOfflineMessageId':_0x4195ad['id']};});_0x4390b5=_0x4153c7[_0x0884('0x3c')](_0x36d043=>{var _0x2a2f7f={'filename':_0x36d043[_0x0884('0x39')],'path':path[_0x0884('0x75')](config[_0x0884('0x76')],'server',_0x0884('0xd0'),_0x0884('0xd1'),_0x0884('0xd2'),_0x36d043[_0x0884('0xd3')])};return _0x2a2f7f;});if(!_0x26119f[_0x0884('0xd4')]){return db['sequelize']['transaction'](function(_0x49d4f5){return db['Attachment']['bulkCreate'](_0x4153c7,{'transaction':_0x49d4f5});});}}})[_0x0884('0x20')](function(){if(_0x3ae8a0){_0x31ee05=_0x3ae8a0;return db[_0x0884('0xc7')][_0x0884('0x64')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x0884('0xd5'),'raw':!![]}]});}})[_0x0884('0x20')](function(_0x343aa3){if(_0x343aa3&&_0x343aa3[_0x0884('0xd5')]&&_0x26119f[_0x0884('0xd6')]&&_0x26119f[_0x0884('0xd7')]){var _0x55fc98={'tls':{'rejectUnauthorized':![]}};if(_0x343aa3[_0x0884('0xd5')][_0x0884('0xd8')]){_0x55fc98[_0x0884('0xd8')]=_0x343aa3['Smtp'][_0x0884('0xd8')];}else{_0x55fc98[_0x0884('0xd9')]=_0x343aa3[_0x0884('0xd5')][_0x0884('0xd9')];_0x55fc98[_0x0884('0xda')]=_0x343aa3['Smtp'][_0x0884('0xda')];_0x55fc98[_0x0884('0xdb')]=_0x343aa3[_0x0884('0xd5')][_0x0884('0xdb')];}if(_0x343aa3[_0x0884('0xd5')]['authentication']){_0x55fc98[_0x0884('0xdc')]={'user':_0x343aa3[_0x0884('0xd5')][_0x0884('0x5d')],'pass':_0x343aa3[_0x0884('0xd5')][_0x0884('0xdd')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x55fc98,'message':{'from':util[_0x0884('0xae')](_0x0884('0xde'),_0x343aa3[_0x0884('0x39')],_0x343aa3['email']||_0x343aa3['Smtp'][_0x0884('0x5d')]),'to':_0x26119f[_0x0884('0xd7')],'subject':_0x26119f[_0x0884('0xdf')],'html':_0x31ee05[_0x0884('0x5c')],'attachments':_0x4390b5}},client9003)[_0x0884('0x20')](function(){return _0x31ee05;})[_0x0884('0x55')](function(_0x29885e){console[_0x0884('0x26')](_0x29885e);});}})[_0x0884('0x20')](function(){if(_0x26119f&&_0x26119f[_0x0884('0xd4')]&&_0x26119f[_0x0884('0xe0')]){var _0x4fba74=[];if(_0x5d43a9['length']){_0x4fba74=_0x5d43a9[_0x0884('0x3c')](function(_0x3dd7d0){return{'name':_0x3dd7d0[_0x0884('0xe1')],'basename':_0x3dd7d0[_0x0884('0x6e')],'type':_0x3dd7d0[_0x0884('0xcf')],'ChatOfflineMessageId':_0x3ae8a0['id']};});}var _0x33876f;if(!_[_0x0884('0x7b')](_0x26119f[_0x0884('0xe2')])){var _0x74d25c=_['map'](_0x3082d2[_0x0884('0x5c')],function(_0x4c229a){return _0x4c229a;});var _0x3a5e50=_[_0x0884('0xe3')](_0x74d25c)[0x0];var _0x3cc0f0=_[_0x0884('0xe4')](_0x3a5e50,function(_0x2d5dcf){return _0x2d5dcf;});_0x33876f=_0x3cc0f0[0x1][_0x26119f[_0x0884('0xe2')]];}var _0x591c16={'from':_0x4774ea[_0x0884('0xe5')],'firstName':_0x4774ea[_0x0884('0xa8')],'lastName':_0x4774ea['lastName'],'mapKey':_0x0884('0xe5'),'message':{'from':_0x4774ea[_0x0884('0xe5')],'to':_0x26119f['MailAccount']['email'],'cc':'','subject':_[_0x0884('0x7b')](_0x33876f)?_0x26119f[_0x0884('0xdf')]:_0x33876f,'messageId':'','sentAt':new Date(),'attach':_0x4fba74[_0x0884('0x48')],'attachments':_0x4fba74,'originChannel':'Chat','ChatWebsiteId':_0x26119f['id'],'ChatOfflineMessageId':_0x31ee05['id'],'originTo':_0x26119f[_0x0884('0xc7')][_0x0884('0xe5')]},'body':_0x31ee05[_0x0884('0x5c')]};var _0x258f86={'account':{'id':_0x26119f[_0x0884('0xe0')]},'body':_0x591c16,'log':_0x0884('0xe6')};return respondWithRpcPromise(_0x0884('0xe6'),_0x0884('0xe7'),_0x258f86,client9001)[_0x0884('0x20')](function(){return _0x31ee05;})[_0x0884('0x55')](function(_0x53e9ac){console[_0x0884('0x26')](_0x53e9ac);});}return;})[_0x0884('0x20')](function(){if(_0x31ee05){return _0x31ee05;}})['then'](respondWithResult(_0x14bdec,null))[_0x0884('0x55')](function(_0x4ee52a){console['error'](_0x0884('0x55'),_0x4ee52a);for(var _0x335ba5 of _0x5d43a9){var _0xb2529=path['join'](config['root'],'server',_0x0884('0xd0'),_0x0884('0xd1'),_0x0884('0xd2'),_0x335ba5[_0x0884('0x6e')]);fs_extra[_0x0884('0xe8')](_0xb2529)[_0x0884('0x55')](function(_0x2a0c84){console[_0x0884('0x26')](_0x0884('0xe9'),_0xb2529,_0x2a0c84);});}});};exports[_0x0884('0xea')]=function(_0x5de09a,_0x3dc598,_0x552c13){return db['ChatInteraction'][_0x0884('0x5a')]({'where':{'id':_0x5de09a[_0x0884('0x57')]['id']}})['then'](handleEntityNotFound(_0x3dc598,null))[_0x0884('0x20')](function(_0x55230e){if(_0x55230e){return _0x55230e[_0x0884('0xea')](_0x5de09a[_0x0884('0x5c')]['ids'],_[_0x0884('0xeb')](_0x5de09a[_0x0884('0x5c')],[_0x0884('0x69'),'id'])||{});}})[_0x0884('0x20')](respondWithResult(_0x3dc598,null))[_0x0884('0x55')](handleError(_0x3dc598,null));};exports[_0x0884('0xec')]=function(_0x1e6e58,_0x440702,_0x296239){var _0x510a9f={'raw':![],'where':{}};var _0x3aa5ea={};var _0x54abff={'count':0x0,'rows':[]};return db[_0x0884('0x53')]['findOne']({'where':{'id':_0x1e6e58['params']['id']}})[_0x0884('0x20')](handleEntityNotFound(_0x440702,null))['then'](function(_0x217238){if(_0x217238){_0x3aa5ea[_0x0884('0x45')]=_[_0x0884('0x42')](db[_0x0884('0xb5')][_0x0884('0x3d')]);_0x3aa5ea[_0x0884('0x41')]=_[_0x0884('0x42')](_0x1e6e58[_0x0884('0x41')]);_0x3aa5ea[_0x0884('0x43')]=_[_0x0884('0x44')](_0x3aa5ea[_0x0884('0x45')],_0x3aa5ea[_0x0884('0x41')]);_0x510a9f[_0x0884('0x46')]=_[_0x0884('0x44')](_0x3aa5ea[_0x0884('0x45')],qs[_0x0884('0x47')](_0x1e6e58[_0x0884('0x41')][_0x0884('0x47')]));_0x510a9f[_0x0884('0x46')]=_0x510a9f['attributes']['length']?_0x510a9f[_0x0884('0x46')]:_0x3aa5ea[_0x0884('0x45')];if(!_0x1e6e58[_0x0884('0x41')][_0x0884('0x6c')](_0x0884('0x49'))){_0x510a9f[_0x0884('0x2f')]=qs[_0x0884('0x2f')](_0x1e6e58[_0x0884('0x41')]['limit']);_0x510a9f[_0x0884('0x2d')]=qs[_0x0884('0x2d')](_0x1e6e58[_0x0884('0x41')]['offset']);}_0x510a9f[_0x0884('0x4a')]=qs[_0x0884('0x4b')](_0x1e6e58[_0x0884('0x41')][_0x0884('0x4b')]);_0x510a9f['where']=qs['filters'](_[_0x0884('0x4d')](_0x1e6e58[_0x0884('0x41')],_0x3aa5ea[_0x0884('0x43')]));_0x510a9f[_0x0884('0x4c')][_0x0884('0x66')]=_0x217238['id'];if(_0x1e6e58[_0x0884('0x41')]['filter']){_0x510a9f[_0x0884('0x4c')]=_[_0x0884('0x4f')](_0x510a9f[_0x0884('0x4c')],{'$or':_['map'](_0x510a9f[_0x0884('0x46')],function(_0x48b0c7){var _0xbb1dbc={};_0xbb1dbc[_0x48b0c7]={'$like':'%'+_0x1e6e58['query']['filter']+'%'};return _0xbb1dbc;})});}_0x510a9f=_[_0x0884('0x4f')]({},_0x510a9f,_0x1e6e58[_0x0884('0x51')]);return db[_0x0884('0xb5')][_0x0884('0x30')]({'where':_0x510a9f[_0x0884('0x4c')]})[_0x0884('0x20')](function(_0x7c9425){_0x54abff[_0x0884('0x30')]=_0x7c9425;if(_0x1e6e58['query'][_0x0884('0x59')]){_0x510a9f['include']=[{'model':db['CmContact'],'as':_0x0884('0xed'),'required':![]},{'model':db['User'],'as':_0x0884('0xee'),'attributes':[_0x0884('0x39'),_0x0884('0xef'),'internal'],'required':![]},{'model':db[_0x0884('0xf0')],'as':_0x0884('0xf1'),'attributes':['id',_0x0884('0x39'),_0x0884('0xf2')],'where':_0x1e6e58[_0x0884('0x41')][_0x0884('0xf3')]?{'id':_0x1e6e58[_0x0884('0x41')]['tag']}:undefined,'required':_0x1e6e58[_0x0884('0x41')][_0x0884('0xf3')]?!![]:![]}];}return db['ChatInteraction'][_0x0884('0x67')](_0x510a9f);})['then'](function(_0x151fc9){_0x54abff[_0x0884('0x54')]=_0x151fc9;return _0x54abff;});}})['then'](respondWithFilteredResult(_0x440702,_0x510a9f))['catch'](handleError(_0x440702,null));};function iftimePromise(_0x461a26,_0x2e4145){return respondWithRpcPromise(_0x0884('0xf4'),'getSnippet',{'command':_0x2e4145[_0x0884('0xf5')]?util[_0x0884('0xae')](_0x0884('0xf6'),_0x461a26[_0x0884('0xf7')],_0x2e4145['timezone']):util[_0x0884('0xae')]('iftime\x20%s',_0x461a26[_0x0884('0xf7')])},client9002)['then'](function(_0x3ab80b){var _0x2a9452=_0x3ab80b&&_0x3ab80b[_0x0884('0xf8')](_0x0884('0xf9'))>=0x0?!![]:![];logger['info'](_0x0884('0xfa'),_0x2e4145['id'],_0x461a26['id'],_0x461a26[_0x0884('0xf7')],_0x2a9452?_0x0884('0xfb'):_0x0884('0xfc'),_0x2e4145[_0x0884('0xf5')]?_0x2e4145[_0x0884('0xf5')]:_0x0884('0xfd'));return _0x2a9452;})[_0x0884('0x55')](function(_0x14c9da){logger[_0x0884('0x26')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2e4145['id'],_0x461a26['id'],_0x461a26[_0x0884('0xf7')],util[_0x0884('0xfe')](_0x14c9da,{'showHidden':![],'depth':null}),_0x2e4145['timezone']?_0x2e4145[_0x0884('0xf5')]:_0x0884('0xfd'));return![];});}exports[_0x0884('0xff')]=function(_0x22326b,_0x22b200,_0x14cd24){var _0x26a319=0x0;var _0x89d88=0x0;var _0x5d313c=![];var _0x1c45ff;var _0x2c9af1;return db['ChatWebsite']['find']({'where':{'id':_0x22326b[_0x0884('0x57')]['id']},'include':[{'model':db[_0x0884('0x100')],'as':_0x0884('0x100'),'include':[{'model':db[_0x0884('0x100')],'as':_0x0884('0x101'),'attributes':['id',_0x0884('0xf7')],'raw':!![]}]}]})[_0x0884('0x20')](handleEntityNotFound(_0x22b200,null))[_0x0884('0x20')](function(_0x5db9aa){if(_0x5db9aa){_0x1c45ff=_0x5db9aa;return _0x5db9aa['getProactiveActions']({'raw':!![]});}})[_0x0884('0x20')](function(_0x44c025){if(_0x1c45ff){if(_0x44c025){_0x2c9af1=_0x44c025;}}return require('../../config/license/util')[_0x0884('0x79')]();})['then'](function(_0x2b690b){if(_0x2b690b){_0x89d88=_0x2b690b[_0x0884('0x102')];_0x5d313c=_0x2b690b[_0x0884('0x7a')];}})[_0x0884('0x20')](function(){return db[_0x0884('0xb5')][_0x0884('0x30')]({'where':{'closed':![]}});})[_0x0884('0x20')](function(_0x577388){_0x26a319=_0x577388;if(_0x89d88&&_0x577388>_0x89d88){return db[_0x0884('0x103')][_0x0884('0x64')]({'where':{'id':0x1}})[_0x0884('0x20')](function(_0x279985){if(_0x279985){_0x279985[_0x0884('0x104')](_0x0884('0x105'));}});}})['then'](function(){if(_0x1c45ff[_0x0884('0x100')]&&_0x1c45ff['Interval']['Intervals']){var _0x1e0492=[];for(var _0x3a9425=0x0;_0x3a9425<_0x1c45ff[_0x0884('0x100')][_0x0884('0x101')][_0x0884('0x48')];_0x3a9425++){var _0x3037f4=_0x1c45ff[_0x0884('0x100')][_0x0884('0x101')][_0x3a9425]['get']({'plain':!![]});_0x1e0492['push'](iftimePromise(_0x3037f4,_0x1c45ff));}return BPromise['all'](_0x1e0492)[_0x0884('0x20')](function(_0xb10769){return _[_0x0884('0x106')](_0xb10769);});}else{return!![];}})[_0x0884('0x20')](function(_0xf9141e){var _0x5f013f=fs[_0x0884('0xca')](path[_0x0884('0x75')](config[_0x0884('0x76')],_0x0884('0x107')),'utf8');var _0x26bac3={'remote':_0x1c45ff[_0x0884('0x108')],'query':querystring[_0x0884('0x109')](_['merge'](_0x1c45ff[_0x0884('0x5f')]({'plain':!![]}),{'customerIp':_0x22326b[_0x0884('0x89')][_0x0884('0xa6')]||_0x22326b['headers'][_0x0884('0x10a')]||_0x22326b[_0x0884('0x10b')][_0x0884('0x10c')]||_0x22326b['ip'],'referer':_0x22326b[_0x0884('0x89')]['referer'],'openedInteractions':_0x26a319,'maxInteractions':_0x89d88,'virtual':_0x5d313c[_0x0884('0x102')],'online':_0xf9141e,'custom':_0x5d313c}))[_0x0884('0x10d')](/'/g,'\x5c\x27')};_0x22b200[_0x0884('0xc4')](ejs['render'](Mustache[_0x0884('0x10e')](_0x5f013f,_0x26bac3),{'proactiveActions':_0x2c9af1,'alignment':_0x1c45ff[_0x0884('0x10f')],'verticalAlignment':_0x1c45ff['verticalAlignment'],'div_color':_0x1c45ff[_0x0884('0xf2')],'text_color':_0x1c45ff[_0x0884('0x110')],'button_color':_0x1c45ff[_0x0884('0x111')],'background_color':_0x1c45ff['backgroundColor']}));})[_0x0884('0x55')](handleError(_0x22b200,null));};exports[_0x0884('0x112')]=function(_0x36ca86,_0x1a651b,_0x5bfad5){return db[_0x0884('0x53')][_0x0884('0x64')]({'where':{'id':_0x36ca86[_0x0884('0x57')]['id']}})[_0x0884('0x20')](handleEntityNotFound(_0x1a651b,null))['then'](function(_0x22e791){if(_0x22e791){return db[_0x0884('0x113')]['transaction'](function(_0x2b9855){return db[_0x0884('0x114')][_0x0884('0x38')]({'where':{'ChatWebsiteId':_0x36ca86[_0x0884('0x57')]['id']},'transaction':_0x2b9855})[_0x0884('0x20')](function(_0x805ca6){var _0x328b8e=_[_0x0884('0x3c')](_0x36ca86['body'],function(_0x5b6e35){_0x5b6e35[_0x0884('0x66')]=_0x36ca86['params']['id'];return _0x5b6e35;});return db[_0x0884('0x114')][_0x0884('0x115')](_0x328b8e,{'transaction':_0x2b9855});});})['then'](function(){return db[_0x0884('0x114')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x36ca86[_0x0884('0x57')]['id']},'order':_0x0884('0x116')});});}})[_0x0884('0x20')](respondWithResult(_0x1a651b,null))[_0x0884('0x55')](handleError(_0x1a651b,null));};exports['getApplications']=function(_0x53f796,_0x1ccb09,_0x2aa02e){var _0x1dce07={};var _0x36051d={};var _0x32f1f6;var _0x53214c;return db[_0x0884('0x53')]['findOne']({'where':{'id':_0x53f796[_0x0884('0x57')]['id']}})['then'](handleEntityNotFound(_0x1ccb09,null))[_0x0884('0x20')](function(_0x256b01){if(_0x256b01){_0x32f1f6=_0x256b01;_0x36051d[_0x0884('0x45')]=_[_0x0884('0x42')](db[_0x0884('0x114')]['rawAttributes']);_0x36051d[_0x0884('0x41')]=_[_0x0884('0x42')](_0x53f796['query']);_0x36051d[_0x0884('0x43')]=_['intersection'](_0x36051d[_0x0884('0x45')],_0x36051d[_0x0884('0x41')]);_0x1dce07[_0x0884('0x46')]=_['intersection'](_0x36051d[_0x0884('0x45')],qs[_0x0884('0x47')](_0x53f796[_0x0884('0x41')][_0x0884('0x47')]));_0x1dce07[_0x0884('0x46')]=_0x1dce07[_0x0884('0x46')][_0x0884('0x48')]?_0x1dce07[_0x0884('0x46')]:_0x36051d['model'];_0x1dce07['order']=qs['sort'](_0x53f796[_0x0884('0x41')][_0x0884('0x4b')]);_0x1dce07[_0x0884('0x4c')]=qs['filters'](_[_0x0884('0x4d')](_0x53f796[_0x0884('0x41')],_0x36051d[_0x0884('0x43')]));if(_0x53f796[_0x0884('0x41')][_0x0884('0x4e')]){_0x1dce07[_0x0884('0x4c')]=_[_0x0884('0x4f')](_0x1dce07['where'],{'$or':_[_0x0884('0x3c')](_0x1dce07['attributes'],function(_0x17b812){var _0x521ecb={};_0x521ecb[_0x17b812]={'$like':'%'+_0x53f796[_0x0884('0x41')]['filter']+'%'};return _0x521ecb;})});}_0x1dce07=_[_0x0884('0x4f')]({},_0x1dce07,_0x53f796[_0x0884('0x51')]);return _0x32f1f6[_0x0884('0x117')](_0x1dce07);}})['then'](function(_0x6dff7c){if(_0x6dff7c){_0x53214c=_0x6dff7c[_0x0884('0x48')];if(!_0x53f796['query'][_0x0884('0x6c')](_0x0884('0x49'))){_0x1dce07[_0x0884('0x2f')]=qs['limit'](_0x53f796['query'][_0x0884('0x2f')]);_0x1dce07[_0x0884('0x2d')]=qs[_0x0884('0x2d')](_0x53f796[_0x0884('0x41')][_0x0884('0x2d')]);}return _0x32f1f6['getApplications'](_0x1dce07);}})[_0x0884('0x20')](function(_0xb9920b){if(_0xb9920b){return _0xb9920b?{'count':_0x53214c,'rows':_0xb9920b}:null;}})[_0x0884('0x20')](respondWithResult(_0x1ccb09,null))[_0x0884('0x55')](handleError(_0x1ccb09,null));};exports[_0x0884('0x118')]=function(_0x32e9a8,_0xf2ad19,_0x48d17e){return db[_0x0884('0x119')][_0x0884('0x5a')]({'where':{'id':_0x32e9a8['params']['id']}})['then'](handleEntityNotFound(_0xf2ad19,null))[_0x0884('0x20')](function(_0x4dd18b){if(_0x4dd18b){return _0x4dd18b['addProactiveActions'](_0x32e9a8['body'][_0x0884('0x69')],_[_0x0884('0xeb')](_0x32e9a8[_0x0884('0x5c')],[_0x0884('0x69'),'id'])||{});}})[_0x0884('0x20')](respondWithResult(_0xf2ad19,null))[_0x0884('0x55')](handleError(_0xf2ad19,null));};exports[_0x0884('0x11a')]=function(_0x44a494,_0x3f14ff,_0xaff4e3){var _0x4e252b={};var _0x5cdb3d={};var _0x5eb535;var _0x3f2b8b;return db['ChatWebsite'][_0x0884('0x64')]({'where':{'id':_0x44a494[_0x0884('0x57')]['id']}})[_0x0884('0x20')](handleEntityNotFound(_0x3f14ff,null))[_0x0884('0x20')](function(_0x4ccf85){if(_0x4ccf85){_0x5eb535=_0x4ccf85;_0x5cdb3d['model']=_[_0x0884('0x42')](db[_0x0884('0x11b')]['rawAttributes']);_0x5cdb3d[_0x0884('0x41')]=_[_0x0884('0x42')](_0x44a494[_0x0884('0x41')]);_0x5cdb3d['filters']=_[_0x0884('0x44')](_0x5cdb3d[_0x0884('0x45')],_0x5cdb3d['query']);_0x4e252b[_0x0884('0x46')]=_[_0x0884('0x44')](_0x5cdb3d['model'],qs[_0x0884('0x47')](_0x44a494[_0x0884('0x41')]['fields']));_0x4e252b[_0x0884('0x46')]=_0x4e252b[_0x0884('0x46')][_0x0884('0x48')]?_0x4e252b['attributes']:_0x5cdb3d[_0x0884('0x45')];_0x4e252b[_0x0884('0x4a')]=qs[_0x0884('0x4b')](_0x44a494[_0x0884('0x41')][_0x0884('0x4b')]);_0x4e252b[_0x0884('0x4c')]=qs[_0x0884('0x43')](_[_0x0884('0x4d')](_0x44a494[_0x0884('0x41')],_0x5cdb3d[_0x0884('0x43')]));if(_0x44a494[_0x0884('0x41')][_0x0884('0x4e')]){_0x4e252b['where']=_['merge'](_0x4e252b[_0x0884('0x4c')],{'$or':_[_0x0884('0x3c')](_0x4e252b[_0x0884('0x46')],function(_0x3f50da){var _0x44dd4b={};_0x44dd4b[_0x3f50da]={'$like':'%'+_0x44a494[_0x0884('0x41')][_0x0884('0x4e')]+'%'};return _0x44dd4b;})});}_0x4e252b=_[_0x0884('0x4f')]({},_0x4e252b,_0x44a494['options']);return _0x5eb535['getProactiveActions'](_0x4e252b);}})[_0x0884('0x20')](function(_0x4eaea6){if(_0x4eaea6){_0x3f2b8b=_0x4eaea6[_0x0884('0x48')];if(!_0x44a494['query']['hasOwnProperty'](_0x0884('0x49'))){_0x4e252b['limit']=qs['limit'](_0x44a494['query'][_0x0884('0x2f')]);_0x4e252b[_0x0884('0x2d')]=qs[_0x0884('0x2d')](_0x44a494[_0x0884('0x41')]['offset']);}return _0x5eb535[_0x0884('0x11a')](_0x4e252b);}})['then'](function(_0x2c044a){if(_0x2c044a){return _0x2c044a?{'count':_0x3f2b8b,'rows':_0x2c044a}:null;}})[_0x0884('0x20')](respondWithResult(_0x3f14ff,null))[_0x0884('0x55')](handleError(_0x3f14ff,null));};exports[_0x0884('0x11c')]=function(_0x216c50,_0x153614,_0x2de6c3){var _0xc2c501=_0x216c50['query'][_0x0884('0x11d')]==='false'?_0x0884('0x11e'):_0x0884('0x11f');return db[_0x0884('0x53')]['find']({'attributes':['id',_0xc2c501],'where':{'id':_0x216c50['params']['id']}})[_0x0884('0x20')](handleEntityNotFound(_0x153614,null))['then'](function(_0x17d5b2){if(_0x17d5b2){var _0x44d714=_0x17d5b2[_0xc2c501];var _0xa7f683=_0x44d714&&_0x44d714['items']?_0x44d714[_0x0884('0x120')]:[];_0x153614[_0x0884('0xc4')]({'fromKey':_['isNil'](_0x44d714[_0x0884('0x121')])?undefined:_0x44d714[_0x0884('0x121')],'count':_0xa7f683[_0x0884('0x48')],'rows':_0xa7f683});}})['catch'](handleError(_0x153614,null));};exports[_0x0884('0x122')]=function(_0x1fc1c2,_0x3cdfc7,_0x176fc9){var _0x36e426={'raw':![],'where':{}};var _0x80b33b={};var _0x3e69f3={'count':0x0,'rows':[]};return db[_0x0884('0x53')]['findOne']({'where':{'id':_0x1fc1c2[_0x0884('0x57')]['id']}})[_0x0884('0x20')](handleEntityNotFound(_0x3cdfc7,null))[_0x0884('0x20')](function(_0x542034){if(_0x542034){_0x80b33b[_0x0884('0x45')]=_[_0x0884('0x42')](db['ChatOfflineMessage'][_0x0884('0x3d')]);_0x80b33b['query']=_[_0x0884('0x42')](_0x1fc1c2[_0x0884('0x41')]);_0x80b33b[_0x0884('0x43')]=_[_0x0884('0x44')](_0x80b33b[_0x0884('0x45')],_0x80b33b['query']);_0x36e426[_0x0884('0x46')]=_['intersection'](_0x80b33b[_0x0884('0x45')],qs['fields'](_0x1fc1c2[_0x0884('0x41')]['fields']));_0x36e426[_0x0884('0x46')]=_0x36e426[_0x0884('0x46')][_0x0884('0x48')]?_0x36e426['attributes']:_0x80b33b[_0x0884('0x45')];if(!_0x1fc1c2[_0x0884('0x41')][_0x0884('0x6c')]('nolimit')){_0x36e426[_0x0884('0x2f')]=qs[_0x0884('0x2f')](_0x1fc1c2['query']['limit']);_0x36e426[_0x0884('0x2d')]=qs[_0x0884('0x2d')](_0x1fc1c2['query'][_0x0884('0x2d')]);}_0x36e426[_0x0884('0x4a')]=qs[_0x0884('0x4b')](_0x1fc1c2[_0x0884('0x41')][_0x0884('0x4b')]);_0x36e426[_0x0884('0x4c')]=qs['filters'](_['pick'](_0x1fc1c2[_0x0884('0x41')],_0x80b33b[_0x0884('0x43')]));_0x36e426[_0x0884('0x4c')][_0x0884('0x66')]=_0x542034['id'];if(_0x1fc1c2[_0x0884('0x41')][_0x0884('0x4e')]){_0x36e426[_0x0884('0x4c')]=_[_0x0884('0x4f')](_0x36e426['where'],{'$or':_[_0x0884('0x3c')](_0x36e426['attributes'],function(_0x521bcc){var _0x2aae06={};_0x2aae06[_0x521bcc]={'$like':'%'+_0x1fc1c2[_0x0884('0x41')][_0x0884('0x4e')]+'%'};return _0x2aae06;})});}_0x36e426=_['merge']({},_0x36e426,_0x1fc1c2[_0x0884('0x51')]);return db[_0x0884('0x123')][_0x0884('0x30')]({'where':_0x36e426[_0x0884('0x4c')]})['then'](function(_0x5d2923){_0x3e69f3[_0x0884('0x30')]=_0x5d2923;if(_0x1fc1c2['query'][_0x0884('0x59')]){_0x36e426[_0x0884('0x52')]=[{'all':!![]}];}else{_0x36e426[_0x0884('0x52')]=[{'model':db[_0x0884('0x8c')],'as':'Contact','required':![]},{'model':db[_0x0884('0x124')],'as':_0x0884('0x125'),'required':![]}];}return db['ChatOfflineMessage'][_0x0884('0x67')](_0x36e426);})[_0x0884('0x20')](function(_0x3e5989){_0x3e69f3[_0x0884('0x54')]=_0x3e5989;return _0x3e69f3;});}})['then'](respondWithFilteredResult(_0x3cdfc7,_0x36e426))[_0x0884('0x55')](handleError(_0x3cdfc7,null));};exports[_0x0884('0x126')]=function(_0x877d3c,_0x38477b,_0x20b176){return db[_0x0884('0x53')][_0x0884('0x5a')]({'where':{'id':_0x877d3c[_0x0884('0x57')]['id']}})[_0x0884('0x20')](handleEntityNotFound(_0x38477b,null))['then'](function(_0x1bf650){if(_0x1bf650){return _0x1bf650['addAgents'](_0x877d3c[_0x0884('0x5c')][_0x0884('0x69')],_['omit'](_0x877d3c[_0x0884('0x5c')],[_0x0884('0x69'),'id'])||{})[_0x0884('0xc9')](function(_0x1265a3){for(var _0x20717e=0x0;_0x20717e<_0x877d3c[_0x0884('0x5c')][_0x0884('0x69')][_0x0884('0x48')];_0x20717e+=0x1){socket[_0x0884('0x127')]('userChatWebsite:save',{'UserId':Number(_0x877d3c[_0x0884('0x5c')][_0x0884('0x69')][_0x20717e]),'ChatWebsiteId':Number(_0x877d3c[_0x0884('0x57')]['id'])});}return _0x1265a3;});}})[_0x0884('0x20')](respondWithResult(_0x38477b,null))[_0x0884('0x55')](handleError(_0x38477b,null));};exports['removeAgents']=function(_0x1d43b4,_0x2105b2,_0x1f9f95){return db[_0x0884('0x53')][_0x0884('0x5a')]({'where':{'id':_0x1d43b4['params']['id']}})[_0x0884('0x20')](handleEntityNotFound(_0x2105b2,null))[_0x0884('0x20')](function(_0x506433){if(_0x506433){return _0x506433['removeAgents'](_0x1d43b4[_0x0884('0x41')][_0x0884('0x69')])['then'](function(){if(_[_0x0884('0x128')](_0x1d43b4[_0x0884('0x41')][_0x0884('0x69')])){for(var _0x2f8a25=0x0;_0x2f8a25<_0x1d43b4[_0x0884('0x41')][_0x0884('0x69')][_0x0884('0x48')];_0x2f8a25+=0x1){socket[_0x0884('0x127')]('userChatWebsite:remove',{'UserId':Number(_0x1d43b4[_0x0884('0x41')][_0x0884('0x69')][_0x2f8a25]),'ChatWebsiteId':Number(_0x1d43b4[_0x0884('0x57')]['id'])});}}else{socket[_0x0884('0x127')](_0x0884('0x129'),{'UserId':Number(_0x1d43b4['query'][_0x0884('0x69')]),'ChatWebsiteId':Number(_0x1d43b4[_0x0884('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x2105b2,null))[_0x0884('0x55')](handleError(_0x2105b2,null));};exports[_0x0884('0x12a')]=function(_0x15025a,_0x5ef7a5,_0x455a71){var _0x106b12={};var _0x34415e={};var _0x43c927;var _0x6e8b6e;return db[_0x0884('0x53')][_0x0884('0x64')]({'where':{'id':_0x15025a[_0x0884('0x57')]['id']}})[_0x0884('0x20')](handleEntityNotFound(_0x5ef7a5,null))[_0x0884('0x20')](function(_0x29f360){if(_0x29f360){_0x43c927=_0x29f360;_0x34415e[_0x0884('0x45')]=_[_0x0884('0x42')](db['User'][_0x0884('0x3d')]);_0x34415e[_0x0884('0x41')]=_[_0x0884('0x42')](_0x15025a['query']);_0x34415e[_0x0884('0x43')]=_['intersection'](_0x34415e[_0x0884('0x45')],_0x34415e[_0x0884('0x41')]);_0x106b12[_0x0884('0x46')]=_[_0x0884('0x44')](_0x34415e[_0x0884('0x45')],qs[_0x0884('0x47')](_0x15025a[_0x0884('0x41')][_0x0884('0x47')]));_0x106b12[_0x0884('0x46')]=_0x106b12[_0x0884('0x46')][_0x0884('0x48')]?_0x106b12[_0x0884('0x46')]:_0x34415e['model'];_0x106b12['order']=qs[_0x0884('0x4b')](_0x15025a['query'][_0x0884('0x4b')]);_0x106b12[_0x0884('0x4c')]=qs[_0x0884('0x43')](_[_0x0884('0x4d')](_0x15025a[_0x0884('0x41')],_0x34415e[_0x0884('0x43')]));if(_0x15025a['query'][_0x0884('0x4e')]){_0x106b12[_0x0884('0x4c')]=_[_0x0884('0x4f')](_0x106b12[_0x0884('0x4c')],{'$or':_[_0x0884('0x3c')](_0x106b12[_0x0884('0x46')],function(_0x5346a3){var _0x6617bf={};_0x6617bf[_0x5346a3]={'$like':'%'+_0x15025a['query'][_0x0884('0x4e')]+'%'};return _0x6617bf;})});}_0x106b12=_[_0x0884('0x4f')]({},_0x106b12,_0x15025a[_0x0884('0x51')]);return _0x43c927['getAgents'](_0x106b12);}})[_0x0884('0x20')](function(_0xbb0474){if(_0xbb0474){_0x6e8b6e=_0xbb0474[_0x0884('0x48')];if(!_0x15025a['query'][_0x0884('0x6c')](_0x0884('0x49'))){_0x106b12[_0x0884('0x2f')]=qs[_0x0884('0x2f')](_0x15025a[_0x0884('0x41')]['limit']);_0x106b12[_0x0884('0x2d')]=qs[_0x0884('0x2d')](_0x15025a['query'][_0x0884('0x2d')]);}return _0x43c927['getAgents'](_0x106b12);}})[_0x0884('0x20')](function(_0x559834){if(_0x559834){return _0x559834?{'count':_0x6e8b6e,'rows':_0x559834}:null;}})[_0x0884('0x20')](respondWithResult(_0x5ef7a5,null))[_0x0884('0x55')](handleError(_0x5ef7a5,null));};
\ No newline at end of file
+var _0x807c=['Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','chatLicenseExceeded','all','some','remote','connection','virtual','replace','alignment','textColor','color_button','backgroundColor','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','online','offlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','then','get','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','filter','options','ChatWebsite','includeAll','include','findAll','rows','catch','params','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','length','nolimit','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','list','applications','priority','asc','defaults','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','type','threadId','ChatInteraction','ContactId','interaction','spread','contact','lastName','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','startRouting','Start','EventManager','offline','files','CompanyId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','mimetype','attachments','basename','openNewInteraction','sequelize','Attachment','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','omit','Owner','fullname','internal'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x807c,0x15d));var _0xc807=function(_0xfa4373,_0x4f26cc){_0xfa4373=_0xfa4373-0x0;var _0x40d370=_0x807c[_0xfa4373];return _0x40d370;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc807('0x0'));var jsonpatch=require(_0xc807('0x1'));var rp=require(_0xc807('0x2'));var moment=require(_0xc807('0x3'));var BPromise=require(_0xc807('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc807('0x5'));var ejs=require(_0xc807('0x6'));var fs=require('fs');var fs_extra=require(_0xc807('0x7'));var _=require(_0xc807('0x8'));var squel=require(_0xc807('0x9'));var crypto=require('crypto');var jsforce=require(_0xc807('0xa'));var deskjs=require(_0xc807('0xb'));var toCsv=require(_0xc807('0x5'));var querystring=require(_0xc807('0xc'));var Papa=require('papaparse');var Redis=require(_0xc807('0xd'));var authService=require(_0xc807('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc807('0xf'));var logger=require(_0xc807('0x10'))('api');var utils=require(_0xc807('0x11'));var config=require(_0xc807('0x12'));var licenseUtil=require(_0xc807('0x13'));var db=require(_0xc807('0x14'))['db'];config[_0xc807('0x15')]=_['defaults'](config[_0xc807('0x15')],{'host':_0xc807('0x16'),'port':0x18eb});var socket=require(_0xc807('0x17'))(new Redis(config[_0xc807('0x15')]));require(_0xc807('0x18'))[_0xc807('0x19')](socket);var jayson=require(_0xc807('0x1a'));var client=jayson['client'][_0xc807('0x1b')]({'port':0x232c});var client9002=jayson[_0xc807('0x1c')]['http']({'port':0x232a});var client9003=jayson[_0xc807('0x1c')][_0xc807('0x1b')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x507a4e,_0x216a02,_0x2da1f9,_0x33d1fa){return new BPromise(function(_0x103fb9,_0x24ea49){var _0xa9f72a=_0x33d1fa||client;return _0xa9f72a['request'](_0x507a4e,_0x2da1f9)['then'](function(_0x14ac06){logger[_0xc807('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x216a02,_0xc807('0x1e'));logger['debug'](_0xc807('0x1f'),_0x216a02,'request\x20sent',JSON[_0xc807('0x20')](_0x14ac06));if(_0x14ac06[_0xc807('0x21')]){if(_0x14ac06[_0xc807('0x21')][_0xc807('0x22')]===0x1f4){logger['error'](_0xc807('0x23'),_0x216a02,_0x14ac06[_0xc807('0x21')]['message']);return _0x24ea49(_0x14ac06[_0xc807('0x21')][_0xc807('0x24')]);}logger[_0xc807('0x21')](_0xc807('0x23'),_0x216a02,_0x14ac06[_0xc807('0x21')][_0xc807('0x24')]);return _0x103fb9(_0x14ac06[_0xc807('0x21')][_0xc807('0x24')]);}else{logger[_0xc807('0x1d')](_0xc807('0x23'),_0x216a02,_0xc807('0x1e'));_0x103fb9(_0x14ac06['result'][_0xc807('0x24')]);}})['catch'](function(_0x341609){logger[_0xc807('0x21')]('ChatWebsite,\x20%s,\x20%s',_0x216a02,_0x341609);_0x24ea49(_0x341609);});});}function respondWithStatusCode(_0x5b2a33,_0x1b790e){_0x1b790e=_0x1b790e||0xcc;return function(_0x5762f9){if(_0x5762f9){return _0x5b2a33[_0xc807('0x25')](_0x1b790e);}return _0x5b2a33[_0xc807('0x26')](_0x1b790e)[_0xc807('0x27')]();};}function respondWithResult(_0x1573cc,_0x1f915c){_0x1f915c=_0x1f915c||0xc8;return function(_0x5ce8af){if(_0x5ce8af){return _0x1573cc[_0xc807('0x26')](_0x1f915c)[_0xc807('0x28')](_0x5ce8af);}};}function respondWithFilteredResult(_0x446956,_0x5aa11c){return function(_0x4a64a9){if(_0x4a64a9){var _0x5c1f8d=typeof _0x5aa11c[_0xc807('0x29')]===_0xc807('0x2a')&&typeof _0x5aa11c['limit']===_0xc807('0x2a');var _0x247632=_0x4a64a9[_0xc807('0x2b')];var _0x233cc3=_0x5c1f8d?0x0:_0x5aa11c['offset'];var _0x4f7edb=_0x5c1f8d?_0x4a64a9[_0xc807('0x2b')]:_0x5aa11c['offset']+_0x5aa11c[_0xc807('0x2c')];var _0x389475;if(_0x4f7edb>=_0x247632){_0x4f7edb=_0x247632;_0x389475=0xc8;}else{_0x389475=0xce;}_0x446956[_0xc807('0x26')](_0x389475);return _0x446956[_0xc807('0x2d')](_0xc807('0x2e'),_0x233cc3+'-'+_0x4f7edb+'/'+_0x247632)[_0xc807('0x28')](_0x4a64a9);}return null;};}function patchUpdates(_0x3f0c6d){return function(_0x180b76){try{jsonpatch['apply'](_0x180b76,_0x3f0c6d,!![]);}catch(_0x3f193e){return BPromise['reject'](_0x3f193e);}return _0x180b76['save']();};}function saveUpdates(_0x3eec05,_0x410edf){return function(_0x3485b7){if(_0x3485b7){return _0x3485b7[_0xc807('0x2f')](_0x3eec05)['then'](function(_0x213ab1){return _0x213ab1;});}return null;};}function removeEntity(_0x142428,_0x485255){return function(_0x1fd595){if(_0x1fd595){return _0x1fd595[_0xc807('0x30')]()[_0xc807('0x31')](function(){var _0x4fee98=_0x1fd595[_0xc807('0x32')]({'plain':!![]});var _0x4afd99='ChatWebsites';return db['UserProfileResource']['destroy']({'where':{'type':_0x4afd99,'resourceId':_0x4fee98['id']}})['then'](function(){return _0x1fd595;});})[_0xc807('0x31')](function(){_0x142428[_0xc807('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b7e6a,_0x46f4fb){return function(_0x3993f6){if(!_0x3993f6){_0x4b7e6a['sendStatus'](0x194);}return _0x3993f6;};}function handleError(_0x102b2e,_0x1f3120){_0x1f3120=_0x1f3120||0x1f4;return function(_0x4cdf8a){logger[_0xc807('0x21')](_0x4cdf8a[_0xc807('0x33')]);if(_0x4cdf8a[_0xc807('0x34')]){delete _0x4cdf8a['name'];}_0x102b2e[_0xc807('0x26')](_0x1f3120)[_0xc807('0x35')](_0x4cdf8a);};}exports['index']=function(_0x37daac,_0x1621ff){var _0x17aeb2={'include':[{'model':db[_0xc807('0x36')],'as':_0xc807('0x37')}]},_0x292571={},_0x4c7480={'count':0x0,'rows':[]};var _0x14c250=_[_0xc807('0x38')](db['ChatWebsite'][_0xc807('0x39')],function(_0x58bf5a){return{'name':_0x58bf5a[_0xc807('0x3a')],'type':_0x58bf5a['type'][_0xc807('0x3b')]};});_0x292571['model']=_[_0xc807('0x38')](_0x14c250,'name');_0x292571[_0xc807('0x3c')]=_[_0xc807('0x3d')](_0x37daac['query']);_0x292571[_0xc807('0x3e')]=_[_0xc807('0x3f')](_0x292571[_0xc807('0x40')],_0x292571['query']);_0x17aeb2['attributes']=_[_0xc807('0x3f')](_0x292571['model'],qs[_0xc807('0x41')](_0x37daac[_0xc807('0x3c')][_0xc807('0x41')]));_0x17aeb2[_0xc807('0x42')]=_0x17aeb2[_0xc807('0x42')]['length']?_0x17aeb2[_0xc807('0x42')]:_0x292571[_0xc807('0x40')];if(!_0x37daac[_0xc807('0x3c')][_0xc807('0x43')]('nolimit')){_0x17aeb2[_0xc807('0x2c')]=qs[_0xc807('0x2c')](_0x37daac['query'][_0xc807('0x2c')]);_0x17aeb2[_0xc807('0x29')]=qs['offset'](_0x37daac[_0xc807('0x3c')][_0xc807('0x29')]);}_0x17aeb2[_0xc807('0x44')]=qs['sort'](_0x37daac[_0xc807('0x3c')][_0xc807('0x45')]);_0x17aeb2[_0xc807('0x46')]=qs[_0xc807('0x3e')](_[_0xc807('0x47')](_0x37daac['query'],_0x292571['filters']),_0x14c250);if(_0x37daac[_0xc807('0x3c')]['filter']){_0x17aeb2[_0xc807('0x46')]=_[_0xc807('0x48')](_0x17aeb2[_0xc807('0x46')],{'$or':_['map'](_0x14c250,function(_0x171065){if(_0x171065['type']!=='VIRTUAL'){var _0x28dc76={};_0x28dc76[_0x171065[_0xc807('0x34')]]={'$like':'%'+_0x37daac[_0xc807('0x3c')][_0xc807('0x49')]+'%'};return _0x28dc76;}})});}_0x17aeb2=_['merge']({},_0x17aeb2,_0x37daac[_0xc807('0x4a')]);var _0x1b1a3d={'where':_0x17aeb2[_0xc807('0x46')]};return db[_0xc807('0x4b')]['count'](_0x1b1a3d)[_0xc807('0x31')](function(_0x588d5f){_0x4c7480[_0xc807('0x2b')]=_0x588d5f;if(_0x37daac[_0xc807('0x3c')][_0xc807('0x4c')]){_0x17aeb2[_0xc807('0x4d')]=[{'all':!![]}];}return db['ChatWebsite'][_0xc807('0x4e')](_0x17aeb2);})[_0xc807('0x31')](function(_0x2ff7f7){_0x4c7480[_0xc807('0x4f')]=_0x2ff7f7;return _0x4c7480;})['then'](respondWithFilteredResult(_0x1621ff,_0x17aeb2))[_0xc807('0x50')](handleError(_0x1621ff,null));};exports['show']=function(_0x2f4b07,_0x5cdd60){var _0x31f325={'raw':![],'where':{'id':_0x2f4b07[_0xc807('0x51')]['id']},'include':[{'model':db['Pause'],'as':_0xc807('0x37')}]},_0x37243d={};_0x37243d[_0xc807('0x40')]=_[_0xc807('0x3d')](db[_0xc807('0x4b')][_0xc807('0x39')]);_0x37243d['query']=_['keys'](_0x2f4b07[_0xc807('0x3c')]);_0x37243d[_0xc807('0x3e')]=_['intersection'](_0x37243d['model'],_0x37243d[_0xc807('0x3c')]);_0x31f325[_0xc807('0x42')]=_['intersection'](_0x37243d[_0xc807('0x40')],qs[_0xc807('0x41')](_0x2f4b07['query'][_0xc807('0x41')]));_0x31f325[_0xc807('0x42')]=_0x31f325[_0xc807('0x42')]['length']?_0x31f325['attributes']:_0x37243d[_0xc807('0x40')];if(_0x2f4b07[_0xc807('0x3c')][_0xc807('0x4c')]){_0x31f325[_0xc807('0x4d')]=[{'all':!![]}];}_0x31f325=_['merge']({},_0x31f325,_0x2f4b07[_0xc807('0x4a')]);return db['ChatWebsite']['find'](_0x31f325)[_0xc807('0x31')](handleEntityNotFound(_0x5cdd60,null))[_0xc807('0x31')](respondWithResult(_0x5cdd60,null))[_0xc807('0x50')](handleError(_0x5cdd60,null));};exports[_0xc807('0x52')]=function(_0x5d6ed5,_0x10e160){return db['ChatWebsite'][_0xc807('0x52')](_0x5d6ed5[_0xc807('0x53')],{})['then'](function(_0x57090e){var _0x551083=_0x5d6ed5[_0xc807('0x54')][_0xc807('0x32')]({'plain':!![]});if(!_0x551083)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x551083['role']===_0xc807('0x54')){var _0x21d7de=_0x57090e[_0xc807('0x32')]({'plain':!![]});var _0x46e59c='ChatWebsites';return db[_0xc807('0x55')][_0xc807('0x56')]({'where':{'name':_0x46e59c,'userProfileId':_0x551083[_0xc807('0x57')]},'raw':!![]})[_0xc807('0x31')](function(_0x25ae99){if(_0x25ae99&&_0x25ae99[_0xc807('0x58')]===0x0){return db[_0xc807('0x59')][_0xc807('0x52')]({'name':_0x21d7de['name'],'resourceId':_0x21d7de['id'],'type':_0x25ae99[_0xc807('0x34')],'sectionId':_0x25ae99['id']},{})[_0xc807('0x31')](function(){return _0x57090e;});}else{return _0x57090e;}})[_0xc807('0x50')](function(_0x2bdfc6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bdfc6);throw _0x2bdfc6;});}return _0x57090e;})[_0xc807('0x31')](respondWithResult(_0x10e160,0xc9))[_0xc807('0x50')](handleError(_0x10e160,null));};exports[_0xc807('0x2f')]=function(_0x4a1e9a,_0x313c39){if(_0x4a1e9a[_0xc807('0x53')]['id']){delete _0x4a1e9a[_0xc807('0x53')]['id'];}return db[_0xc807('0x4b')][_0xc807('0x56')]({'where':{'id':_0x4a1e9a['params']['id']},'include':[{'model':db['Pause'],'as':_0xc807('0x37')}]})['then'](handleEntityNotFound(_0x313c39,null))[_0xc807('0x31')](saveUpdates(_0x4a1e9a[_0xc807('0x53')],null))[_0xc807('0x31')](respondWithResult(_0x313c39,null))[_0xc807('0x50')](handleError(_0x313c39,null));};exports[_0xc807('0x30')]=function(_0x3d24ae,_0x1c44c9){return db[_0xc807('0x4b')][_0xc807('0x56')]({'where':{'id':_0x3d24ae['params']['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x1c44c9,null))[_0xc807('0x31')](removeEntity(_0x1c44c9,null))['catch'](handleError(_0x1c44c9,null));};exports[_0xc807('0x5a')]=function(_0x2192a6,_0x6fa434){return db[_0xc807('0x4b')][_0xc807('0x5a')]()[_0xc807('0x31')](respondWithResult(_0x6fa434,null))[_0xc807('0x50')](handleError(_0x6fa434,null));};exports[_0xc807('0x5b')]=function(_0x335b62,_0x5e195b,_0x2018ff){if(_0x335b62[_0xc807('0x53')]['id']){delete _0x335b62[_0xc807('0x53')]['id'];}return db[_0xc807('0x4b')][_0xc807('0x56')]({'where':{'id':_0x335b62[_0xc807('0x51')]['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x5e195b,null))['then'](function(_0x55a401){if(_0x55a401){_0x335b62['body'][_0xc807('0x5c')]=_0x55a401['id'];return db['Disposition'][_0xc807('0x52')](_0x335b62[_0xc807('0x53')]);}})[_0xc807('0x31')](respondWithResult(_0x5e195b,null))['catch'](handleError(_0x5e195b,null));};exports[_0xc807('0x5d')]=function(_0x30f4bd,_0x49355f,_0x3a7486){var _0x22c47c={'raw':![],'where':{}};var _0x1f0a6f={};var _0x3f4e7d={'count':0x0,'rows':[]};return db[_0xc807('0x4b')][_0xc807('0x5e')]({'where':{'id':_0x30f4bd[_0xc807('0x51')]['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x49355f,null))[_0xc807('0x31')](function(_0x553ce7){if(_0x553ce7){_0x1f0a6f[_0xc807('0x40')]=_[_0xc807('0x3d')](db[_0xc807('0x5f')]['rawAttributes']);_0x1f0a6f[_0xc807('0x3c')]=_['keys'](_0x30f4bd[_0xc807('0x3c')]);_0x1f0a6f['filters']=_[_0xc807('0x3f')](_0x1f0a6f[_0xc807('0x40')],_0x1f0a6f[_0xc807('0x3c')]);_0x22c47c[_0xc807('0x42')]=_['intersection'](_0x1f0a6f['model'],qs['fields'](_0x30f4bd['query'][_0xc807('0x41')]));_0x22c47c[_0xc807('0x42')]=_0x22c47c[_0xc807('0x42')][_0xc807('0x60')]?_0x22c47c['attributes']:_0x1f0a6f[_0xc807('0x40')];if(!_0x30f4bd[_0xc807('0x3c')][_0xc807('0x43')](_0xc807('0x61'))){_0x22c47c[_0xc807('0x2c')]=qs[_0xc807('0x2c')](_0x30f4bd[_0xc807('0x3c')]['limit']);_0x22c47c['offset']=qs[_0xc807('0x29')](_0x30f4bd[_0xc807('0x3c')][_0xc807('0x29')]);}_0x22c47c[_0xc807('0x44')]=qs[_0xc807('0x45')](_0x30f4bd[_0xc807('0x3c')][_0xc807('0x45')]);_0x22c47c['where']=qs[_0xc807('0x3e')](_[_0xc807('0x47')](_0x30f4bd[_0xc807('0x3c')],_0x1f0a6f[_0xc807('0x3e')]));_0x22c47c[_0xc807('0x46')]['ChatWebsiteId']=_0x553ce7['id'];if(_0x30f4bd[_0xc807('0x3c')][_0xc807('0x49')]){_0x22c47c['where']=_[_0xc807('0x48')](_0x22c47c[_0xc807('0x46')],{'$or':_[_0xc807('0x38')](_0x22c47c[_0xc807('0x42')],function(_0x750fe4){var _0x367730={};_0x367730[_0x750fe4]={'$like':'%'+_0x30f4bd[_0xc807('0x3c')]['filter']+'%'};return _0x367730;})});}_0x22c47c=_[_0xc807('0x48')]({},_0x22c47c,_0x30f4bd['options']);return db[_0xc807('0x5f')]['count']({'where':_0x22c47c[_0xc807('0x46')]})[_0xc807('0x31')](function(_0x323994){_0x3f4e7d['count']=_0x323994;if(_0x30f4bd[_0xc807('0x3c')][_0xc807('0x4c')]){_0x22c47c['include']=[{'all':!![]}];}return db['Disposition'][_0xc807('0x4e')](_0x22c47c);})[_0xc807('0x31')](function(_0x1b6387){_0x3f4e7d[_0xc807('0x4f')]=_0x1b6387;return _0x3f4e7d;});}})[_0xc807('0x31')](respondWithFilteredResult(_0x49355f,_0x22c47c))[_0xc807('0x50')](handleError(_0x49355f,null));};exports[_0xc807('0x62')]=function(_0x57df88,_0x238506,_0x1cd4cc){return db[_0xc807('0x4b')][_0xc807('0x56')]({'where':{'id':_0x57df88[_0xc807('0x51')]['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x238506,null))[_0xc807('0x31')](function(_0x176985){if(_0x176985){return _0x176985[_0xc807('0x62')](_0x57df88['query'][_0xc807('0x63')]);}})[_0xc807('0x31')](respondWithStatusCode(_0x238506,null))[_0xc807('0x50')](handleError(_0x238506,null));};exports['addAnswer']=function(_0x57f6dc,_0x3b1b41,_0x34a2f3){if(_0x57f6dc[_0xc807('0x53')]['id']){delete _0x57f6dc[_0xc807('0x53')]['id'];}return db[_0xc807('0x4b')][_0xc807('0x56')]({'where':{'id':_0x57f6dc[_0xc807('0x51')]['id']}})['then'](handleEntityNotFound(_0x3b1b41,null))['then'](function(_0x149511){if(_0x149511){_0x57f6dc[_0xc807('0x53')]['ChatWebsiteId']=_0x149511['id'];return db['CannedAnswer'][_0xc807('0x52')](_0x57f6dc[_0xc807('0x53')]);}})[_0xc807('0x31')](respondWithResult(_0x3b1b41,null))[_0xc807('0x50')](handleError(_0x3b1b41,null));};exports[_0xc807('0x64')]=function(_0x5bce47,_0x16d1a8,_0x4a2388){var _0x1ae17f={'raw':![],'where':{}};var _0x1b4bf1={};var _0x48dab3={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc807('0x5e')]({'where':{'id':_0x5bce47[_0xc807('0x51')]['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x16d1a8,null))[_0xc807('0x31')](function(_0x1d173d){if(_0x1d173d){_0x1b4bf1[_0xc807('0x40')]=_[_0xc807('0x3d')](db['CannedAnswer'][_0xc807('0x39')]);_0x1b4bf1['query']=_[_0xc807('0x3d')](_0x5bce47[_0xc807('0x3c')]);_0x1b4bf1[_0xc807('0x3e')]=_['intersection'](_0x1b4bf1[_0xc807('0x40')],_0x1b4bf1[_0xc807('0x3c')]);_0x1ae17f[_0xc807('0x42')]=_['intersection'](_0x1b4bf1['model'],qs['fields'](_0x5bce47[_0xc807('0x3c')][_0xc807('0x41')]));_0x1ae17f[_0xc807('0x42')]=_0x1ae17f[_0xc807('0x42')][_0xc807('0x60')]?_0x1ae17f[_0xc807('0x42')]:_0x1b4bf1[_0xc807('0x40')];if(!_0x5bce47[_0xc807('0x3c')][_0xc807('0x43')](_0xc807('0x61'))){_0x1ae17f['limit']=qs[_0xc807('0x2c')](_0x5bce47['query'][_0xc807('0x2c')]);_0x1ae17f[_0xc807('0x29')]=qs[_0xc807('0x29')](_0x5bce47['query']['offset']);}_0x1ae17f[_0xc807('0x44')]=qs[_0xc807('0x45')](_0x5bce47[_0xc807('0x3c')]['sort']);_0x1ae17f[_0xc807('0x46')]=qs[_0xc807('0x3e')](_[_0xc807('0x47')](_0x5bce47[_0xc807('0x3c')],_0x1b4bf1['filters']));_0x1ae17f[_0xc807('0x46')][_0xc807('0x5c')]=_0x1d173d['id'];if(_0x5bce47['query'][_0xc807('0x49')]){_0x1ae17f[_0xc807('0x46')]=_['merge'](_0x1ae17f['where'],{'$or':_[_0xc807('0x38')](_0x1ae17f['attributes'],function(_0x4c209f){var _0x49204f={};_0x49204f[_0x4c209f]={'$like':'%'+_0x5bce47[_0xc807('0x3c')][_0xc807('0x49')]+'%'};return _0x49204f;})});}_0x1ae17f=_['merge']({},_0x1ae17f,_0x5bce47[_0xc807('0x4a')]);return db[_0xc807('0x65')][_0xc807('0x2b')]({'where':_0x1ae17f[_0xc807('0x46')]})[_0xc807('0x31')](function(_0x1ec9cc){_0x48dab3['count']=_0x1ec9cc;if(_0x5bce47['query'][_0xc807('0x4c')]){_0x1ae17f[_0xc807('0x4d')]=[{'all':!![]}];}return db[_0xc807('0x65')][_0xc807('0x4e')](_0x1ae17f);})[_0xc807('0x31')](function(_0x9939a9){_0x48dab3[_0xc807('0x4f')]=_0x9939a9;return _0x48dab3;});}})[_0xc807('0x31')](respondWithFilteredResult(_0x16d1a8,_0x1ae17f))[_0xc807('0x50')](handleError(_0x16d1a8,null));};exports['removeAnswers']=function(_0x3d6f9f,_0x4bee29,_0x5a9b11){return db[_0xc807('0x4b')]['find']({'where':{'id':_0x3d6f9f[_0xc807('0x51')]['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x4bee29,null))[_0xc807('0x31')](function(_0x40c79b){if(_0x40c79b){return _0x40c79b[_0xc807('0x66')](_0x3d6f9f['query'][_0xc807('0x63')]);}})[_0xc807('0x31')](respondWithStatusCode(_0x4bee29,null))[_0xc807('0x50')](handleError(_0x4bee29,null));};exports[_0xc807('0x67')]=function(_0x55fa2b,_0x3e60cf,_0x4cdba4){_0x55fa2b[_0xc807('0x53')][_0xc807('0x68')]=_0x55fa2b[_0xc807('0x69')][_0xc807('0x6a')];return db[_0xc807('0x4b')]['find']({'where':{'id':_0x55fa2b['params']['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x3e60cf,null))['then'](saveUpdates(_0x55fa2b[_0xc807('0x53')],null))['then'](respondWithResult(_0x3e60cf,null))[_0xc807('0x50')](handleError(_0x3e60cf,null));};exports['addAvatar']=function(_0x33808c,_0x5a3fdc,_0x2a9543){_0x33808c[_0xc807('0x53')]['agentAvatar']=_0x33808c[_0xc807('0x69')]['filename'];return db[_0xc807('0x4b')][_0xc807('0x56')]({'where':{'id':_0x33808c[_0xc807('0x51')]['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x5a3fdc,null))[_0xc807('0x31')](saveUpdates(_0x33808c['body'],null))['then'](respondWithResult(_0x5a3fdc,null))[_0xc807('0x50')](handleError(_0x5a3fdc,null));};exports['addCustomerAvatar']=function(_0x54d821,_0x1d4bb6,_0x8f989e){_0x54d821[_0xc807('0x53')][_0xc807('0x6b')]=_0x54d821[_0xc807('0x69')][_0xc807('0x6a')];return db[_0xc807('0x4b')][_0xc807('0x56')]({'where':{'id':_0x54d821[_0xc807('0x51')]['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x1d4bb6,null))[_0xc807('0x31')](saveUpdates(_0x54d821[_0xc807('0x53')],null))[_0xc807('0x31')](respondWithResult(_0x1d4bb6,null))[_0xc807('0x50')](handleError(_0x1d4bb6,null));};exports[_0xc807('0x6c')]=function(_0x241619,_0x31d8fa,_0x230b13){_0x241619[_0xc807('0x53')][_0xc807('0x6d')]=_0x241619[_0xc807('0x69')][_0xc807('0x6a')];return db[_0xc807('0x4b')][_0xc807('0x56')]({'where':{'id':_0x241619['params']['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x31d8fa,null))['then'](saveUpdates(_0x241619['body'],null))[_0xc807('0x31')](respondWithResult(_0x31d8fa,null))[_0xc807('0x50')](handleError(_0x31d8fa,null));};exports[_0xc807('0x6e')]=function(_0x175dcb,_0x4e1232,_0xf49709){var _0x464247=path[_0xc807('0x6f')](config[_0xc807('0x70')],_0xc807('0x71'));var _0x20320c={'where':{'id':_0x175dcb[_0xc807('0x51')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x330503=![];return require('../../config/license/util')[_0xc807('0x72')]()[_0xc807('0x31')](function(_0x1646f6){if(_0x1646f6){_0x330503=_0x1646f6[_0xc807('0x73')];}})['then'](function(){return db[_0xc807('0x4b')][_0xc807('0x56')](_0x20320c);})[_0xc807('0x31')](handleEntityNotFound(_0x4e1232,null))[_0xc807('0x31')](function(_0x13974e){if(_0x13974e){if(!_[_0xc807('0x74')](_0x13974e['sitepic'])){if(fs[_0xc807('0x75')](path[_0xc807('0x6f')](config[_0xc807('0x70')],_0xc807('0x76'),_0x13974e[_0xc807('0x68')]))&&_0x330503){_0x464247=path[_0xc807('0x6f')](config['root'],_0xc807('0x76'),_0x13974e[_0xc807('0x68')]);}}return _0x4e1232[_0xc807('0x77')](_0x464247);}})['catch'](handleError(_0x4e1232,null));};exports['getAvatar']=function(_0x5024dd,_0x271597,_0x3529f4){var _0x13ba46=path[_0xc807('0x6f')](config[_0xc807('0x70')],_0xc807('0x78'));var _0x32a511={'where':{'id':_0x5024dd['params']['id']},'attributes':['id',_0xc807('0x79')],'raw':!![]};return db['ChatWebsite'][_0xc807('0x56')](_0x32a511)['then'](handleEntityNotFound(_0x271597,null))['then'](function(_0x4eb245){if(_0x4eb245){if(!_[_0xc807('0x74')](_0x4eb245[_0xc807('0x79')])){if(fs[_0xc807('0x75')](path['join'](config['root'],_0xc807('0x7a'),_0x4eb245[_0xc807('0x79')]))){_0x13ba46=path[_0xc807('0x6f')](config[_0xc807('0x70')],_0xc807('0x7a'),_0x4eb245[_0xc807('0x79')]);}}return _0x271597['download'](_0x13ba46);}})['catch'](handleError(_0x271597,null));};exports[_0xc807('0x7b')]=function(_0x4c2ce0,_0x4bce7e,_0x494646){var _0x16349d=path['join'](config[_0xc807('0x70')],_0xc807('0x7c'));var _0x171074={'where':{'id':_0x4c2ce0[_0xc807('0x51')]['id']},'attributes':['id',_0xc807('0x6b'),_0xc807('0x7d')],'raw':!![]};return db[_0xc807('0x4b')][_0xc807('0x56')](_0x171074)['then'](handleEntityNotFound(_0x4bce7e,null))['then'](function(_0x59ea9f){if(_0x59ea9f){if(!_['isNil'](_0x59ea9f[_0xc807('0x6b')])){if(fs[_0xc807('0x75')](path[_0xc807('0x6f')](config[_0xc807('0x70')],_0xc807('0x7a'),_0x59ea9f[_0xc807('0x6b')]))&&_0x59ea9f['showCustomerAvatar']){_0x16349d=path['join'](config[_0xc807('0x70')],_0xc807('0x7a'),_0x59ea9f['customerAvatar']);}}return _0x4bce7e[_0xc807('0x77')](_0x16349d);}})[_0xc807('0x50')](handleError(_0x4bce7e,null));};exports[_0xc807('0x7e')]=function(_0x1114a6,_0x33670b,_0x17bbbd){var _0x25aca6=path['join'](config[_0xc807('0x70')],_0xc807('0x7f'));var _0x52f513={'where':{'id':_0x1114a6[_0xc807('0x51')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xc807('0x4b')][_0xc807('0x56')](_0x52f513)[_0xc807('0x31')](handleEntityNotFound(_0x33670b,null))[_0xc807('0x31')](function(_0x2a16f1){if(_0x2a16f1){if(!_[_0xc807('0x74')](_0x2a16f1[_0xc807('0x6d')])){if(fs[_0xc807('0x75')](path['join'](config[_0xc807('0x70')],_0xc807('0x7a'),_0x2a16f1[_0xc807('0x6d')]))){_0x25aca6=path[_0xc807('0x6f')](config[_0xc807('0x70')],_0xc807('0x7a'),_0x2a16f1[_0xc807('0x6d')]);}}return _0x33670b[_0xc807('0x77')](_0x25aca6);}})[_0xc807('0x50')](handleError(_0x33670b,null));};exports[_0xc807('0x80')]=function(_0x1ce5b1,_0x2fc8cb,_0x1945cb){var _0x48cd7b=require(_0xc807('0x81'));var _0x4c48e2=new _0x48cd7b();var _0x1f7e54=_0x4c48e2[_0xc807('0x82')](_0x1ce5b1[_0xc807('0x83')][_0xc807('0x84')])['getResult']();var _0x31ead4={'body':_0x1ce5b1['body'],'channel':_0xc807('0x85')};var _0x4e3f55=[];var _0x3fd74a=[];var _0x16a2d6={};var _0x495b1e=![];return db[_0xc807('0x86')][_0xc807('0x5a')]()[_0xc807('0x31')](function(_0xf16356){if(!_0xf16356){throw new db[(_0xc807('0x87'))][(_0xc807('0x88'))](_0xc807('0x89'));}_0x4e3f55=_[_0xc807('0x8a')](_[_0xc807('0x3d')](_0xf16356),[_0xc807('0x8b'),_0xc807('0x8c')]);_0x3fd74a=_[_0xc807('0x8a')](_['keys'](_0xf16356),['createdAt',_0xc807('0x8c'),'CompanyId',_0xc807('0x8d')]);if(_0x1ce5b1[_0xc807('0x53')]['id']){delete _0x1ce5b1['body']['id'];}if(_['isNil'](_0x1ce5b1['body'][_0xc807('0x8e')])){throw new db[(_0xc807('0x87'))]['ValidationError'](_0xc807('0x8f'));}if(_['isNil'](_0x1ce5b1[_0xc807('0x53')]['body'])||_0x1ce5b1['body'][_0xc807('0x53')]===''){throw new db[(_0xc807('0x87'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc807('0x74')](_0x1ce5b1['body'][_0xc807('0x90')])){throw new db[(_0xc807('0x87'))][(_0xc807('0x88'))](_0xc807('0x91')+_0x3fd74a);}if(!_[_0xc807('0x92')](_0x3fd74a,_0x1ce5b1[_0xc807('0x53')][_0xc807('0x90')])){throw new db['Sequelize'][(_0xc807('0x88'))](_0xc807('0x93')+_0x3fd74a);}_0x16a2d6[_0x1ce5b1[_0xc807('0x53')][_0xc807('0x90')]]=_0x1ce5b1['body'][_0xc807('0x8e')];})[_0xc807('0x31')](function(){return db[_0xc807('0x4b')][_0xc807('0x56')]({'where':{'id':_0x1ce5b1['params']['id']},'include':[{'model':db[_0xc807('0x94')],'as':_0xc807('0x95'),'include':[{'model':db['CmContact'],'as':_0xc807('0x96'),'where':_0x16a2d6,'limit':0x1,'order':[[_0xc807('0x8c'),_0xc807('0x97')]]}]},{'model':db[_0xc807('0x98')],'as':_0xc807('0x99')}]});})['then'](handleEntityNotFound(_0x2fc8cb,null))[_0xc807('0x31')](function(_0x556830){if(_0x556830&&_0x556830[_0xc807('0x95')]){_0x31ead4[_0xc807('0x9a')]=_0x556830;_0x31ead4['applications']=_0x556830[_0xc807('0x99')];_0x31ead4[_0xc807('0x9b')]=_0x556830['List'];_0x31ead4['applications']=_['orderBy'](_0x31ead4[_0xc807('0x9c')],[_0xc807('0x9d')],[_0xc807('0x9e')]);if(_0x31ead4[_0xc807('0x9a')][_0xc807('0x99')]){delete _0x31ead4[_0xc807('0x9a')][_0xc807('0x99')];}if(_0x31ead4[_0xc807('0x9a')][_0xc807('0x95')]&&_0x31ead4[_0xc807('0x9a')]['List'][_0xc807('0x96')][_0xc807('0x60')]){return _0x31ead4[_0xc807('0x9a')]['List'][_0xc807('0x96')][0x0];}var _0x4ca71a=_[_0xc807('0x9f')](_0x1ce5b1['body'],{'firstName':_0x1ce5b1[_0xc807('0x53')][_0xc807('0x8e')],'ListId':_0x556830[_0xc807('0x8d')]});_0x4ca71a[_0x1ce5b1[_0xc807('0x53')][_0xc807('0x90')]]=_0x1ce5b1['body'][_0xc807('0x8e')];return db['CmContact'][_0xc807('0x52')](_0x4ca71a,{'fields':_0x4e3f55,'raw':!![]});}})[_0xc807('0x31')](handleEntityNotFound(_0x2fc8cb,null))['then'](function(_0x1a8929){_0x31ead4['contact']=_0x1a8929;var _0x3c3007=_0x1ce5b1[_0xc807('0x53')][_0xc807('0xa0')];if(_0x1ce5b1[_0xc807('0x83')][_0xc807('0xa1')]){_0x3c3007=_0x1ce5b1['headers'][_0xc807('0xa1')];}else if(_0x1ce5b1['headers'][_0xc807('0xa2')]){_0x3c3007=_[_0xc807('0xa3')](_0x1ce5b1['headers'][_0xc807('0xa2')]['split'](','));}if(_0x1a8929){var _0x3fe00d={'ContactId':_0x1a8929['id'],'ChatWebsiteId':_0x1ce5b1[_0xc807('0x51')]['id'],'from':(_0x1a8929[_0xc807('0xa4')]||'')+'\x20'+(_0x1a8929['lastName']||''),'customerIp':_0x3c3007,'customerPort':_0x1ce5b1[_0xc807('0x83')][_0xc807('0xa5')]?_0x1ce5b1[_0xc807('0x83')][_0xc807('0xa5')]:null,'referer':_0x1ce5b1[_0xc807('0x53')][_0xc807('0xa6')],'browserName':_0x1f7e54['browser'][_0xc807('0x34')]&&_0x1f7e54[_0xc807('0xa7')]['version']?util[_0xc807('0xa8')](_0xc807('0xa9'),_0x1f7e54['browser']['name'],_0x1f7e54['browser'][_0xc807('0xaa')]):_0xc807('0xab'),'browserVersion':_0x1f7e54['browser'][_0xc807('0xaa')]||_0xc807('0xab'),'osName':util[_0xc807('0xa8')](_0xc807('0xa9'),_0x1f7e54['os'][_0xc807('0x34')],_0x1f7e54['os'][_0xc807('0xaa')]),'osVersion':_0x1f7e54['os'][_0xc807('0xaa')],'deviceModel':_0x1f7e54[_0xc807('0xac')][_0xc807('0x40')]&&_0x1f7e54[_0xc807('0xac')][_0xc807('0xad')]?util[_0xc807('0xa8')](_0xc807('0xae'),_0x1f7e54['device'][_0xc807('0x40')],_0x1f7e54['device'][_0xc807('0xad')],_0x1f7e54[_0xc807('0xac')][_0xc807('0xaf')]):null,'deviceVendor':_0x1f7e54[_0xc807('0xac')][_0xc807('0xad')],'deviceType':_0x1f7e54[_0xc807('0xac')][_0xc807('0xaf')],'formData':JSON[_0xc807('0x20')](_0x1ce5b1[_0xc807('0x53')])};var _0x3a8998={'ChatWebsiteId':_0x1ce5b1['params']['id'],'closed':![]};if(_0x1ce5b1['body'][_0xc807('0xb0')]){_0x3a8998[_0xc807('0xb0')]=_0x1ce5b1[_0xc807('0x53')][_0xc807('0xb0')];return db[_0xc807('0xb1')][_0xc807('0x56')]({'where':_0x3a8998})['then'](function(_0x400f02){if(_0x400f02){return[_0x400f02,![]];}_0x3fe00d[_0xc807('0xb0')]=_0x1ce5b1[_0xc807('0x53')][_0xc807('0xb0')];_0x3fe00d['externalUrl']=_0x1ce5b1[_0xc807('0x53')]['externalUrl'];return db['ChatInteraction']['create'](_0x3fe00d)[_0xc807('0x31')](function(_0x18781e){return[_0x18781e,!![]];});});}_0x3a8998[_0xc807('0xb2')]=_0x1a8929['id'];if(_0x1ce5b1[_0xc807('0x53')][_0xc807('0xb3')]&&_0x1ce5b1[_0xc807('0x53')]['interaction']['id']){_0x3a8998['id']=_0x1ce5b1['body'][_0xc807('0xb3')]['id'];return db['ChatInteraction'][_0xc807('0x56')]({'where':_0x3a8998})['then'](function(_0x2cdaa0){if(_0x2cdaa0){return[_0x2cdaa0,![]];}return db[_0xc807('0xb1')][_0xc807('0x52')](_0x3fe00d)[_0xc807('0x31')](function(_0x58440b){return[_0x58440b,!![]];});});}return db[_0xc807('0xb1')][_0xc807('0x52')](_0x3fe00d)[_0xc807('0x31')](function(_0xc32761){return[_0xc32761,!![]];});}})[_0xc807('0xb4')](function(_0x2a38fd,_0x566517){if(_0x2a38fd){_0x495b1e=_0x566517;if(!_0x566517){var _0x1c8d18={'from':(_0x31ead4[_0xc807('0xb5')][_0xc807('0xa4')]||'')+'\x20'+(_0x31ead4['contact'][_0xc807('0xb6')]||'')};if(_0x1ce5b1[_0xc807('0x53')][_0xc807('0xb0')]&&_0x1ce5b1['body'][_0xc807('0xb7')]&&_0x1ce5b1[_0xc807('0x53')][_0xc807('0xb0')]!=_0x1ce5b1[_0xc807('0x53')]['messageId']){_0x1c8d18[_0xc807('0xb0')]=_0x1ce5b1[_0xc807('0x53')][_0xc807('0xb7')];}return _0x2a38fd[_0xc807('0x2f')](_0x1c8d18);}else{return _0x2a38fd;}}})[_0xc807('0x31')](function(_0x35e5a9){_0x31ead4['interaction']=_0x35e5a9[_0xc807('0x32')]({'plain':!![]});_0x31ead4[_0xc807('0xb3')]['created']=_0x495b1e;if(_0x31ead4[_0xc807('0xb3')][_0xc807('0xb8')]){if(_0x31ead4[_0xc807('0x9a')][_0xc807('0xb9')]){_0x31ead4[_0xc807('0x9c')][_0xc807('0xba')]({'id':0x0,'priority':_0x31ead4['applications'][_0xc807('0x60')]+0x1,'app':'close','appdata':_0xc807('0xbb'),'interval':_0xc807('0xbc')});}}return db[_0xc807('0xbd')][_0xc807('0x52')]({'body':_0x1ce5b1[_0xc807('0x53')]['body'],'ChatWebsiteId':_0x1ce5b1[_0xc807('0x51')]['id'],'ChatInteractionId':_0x35e5a9['id'],'direction':'in','ContactId':_0x31ead4[_0xc807('0xb5')]['id'],'AttachmentId':_0x1ce5b1[_0xc807('0x53')][_0xc807('0xbe')]});})[_0xc807('0x31')](function(_0x44b0c3){_0x31ead4[_0xc807('0x24')]=_0x44b0c3;if(_0x31ead4[_0xc807('0xb3')][_0xc807('0xbf')]){return db[_0xc807('0xc0')]['find']({'attributes':['id','name'],'where':{'id':_0x31ead4[_0xc807('0xb3')][_0xc807('0xbf')]}})['then'](function(_0x2f0c31){if(_0x2f0c31){_0x31ead4[_0xc807('0x9c')][_0xc807('0xc1')]({'id':0x0,'priority':0x0,'app':_0xc807('0xc2'),'appdata':_0x2f0c31[_0xc807('0x34')]+','+(_0x31ead4['account']['waitForTheAssignedAgent']||0xa),'interval':_0xc807('0xbc')});_0x31ead4[_0xc807('0xc3')]=!![];}return respondWithRpcPromise('Start',_0xc807('0xc4'),_0x31ead4);});}return respondWithRpcPromise(_0xc807('0xc5'),_0xc807('0xc4'),_0x31ead4);})['then'](function(_0x183100){respondWithRpcPromise('EventManager',_0xc807('0xc6'),{'event':_0xc807('0x80'),'message':_0x183100},client9002);return _0x183100;})['then'](respondWithResult(_0x2fc8cb,null))[_0xc807('0x50')](handleError(_0x2fc8cb,null));};exports[_0xc807('0xc7')]=function(_0x348abc,_0x2736c6,_0xb59b7e){var _0x510694,_0x22182a,_0x5f3cf1;var _0x4aeab8=[];var _0x867e33=[];var _0xdc1fb9={};var _0x5baf95=_0x348abc[_0xc807('0xc8')]||[];var _0xd975d1=[];var _0x3137db;return db[_0xc807('0x86')][_0xc807('0x5a')]()['then'](function(_0x4dcd4f){if(!_0x4dcd4f){throw new db[(_0xc807('0x87'))][(_0xc807('0x88'))](_0xc807('0x89'));}_0x867e33=_[_0xc807('0x8a')](_[_0xc807('0x3d')](_0x4dcd4f),[_0xc807('0x8b'),_0xc807('0x8c')]);_0x4aeab8=_[_0xc807('0x8a')](_[_0xc807('0x3d')](_0x4dcd4f),['createdAt',_0xc807('0x8c'),_0xc807('0xc9'),'ListId']);if(_0x348abc['body']['id']){delete _0x348abc['body']['id'];}if(_[_0xc807('0x74')](_0x348abc[_0xc807('0x53')][_0xc807('0x8e')])){throw _0x2736c6['status'](0x1f4)[_0xc807('0x35')](new db['Sequelize']['ValidationError'](_0xc807('0x8f')));}if(_['isNil'](_0x348abc[_0xc807('0x53')][_0xc807('0x53')])||_0x348abc[_0xc807('0x53')][_0xc807('0x53')]===''){throw _0x2736c6[_0xc807('0x26')](0x1f4)[_0xc807('0x35')](new db[(_0xc807('0x87'))][(_0xc807('0x88'))](_0xc807('0xca')));}if(_[_0xc807('0x74')](_0x348abc[_0xc807('0x53')][_0xc807('0xcb')])){throw _0x2736c6[_0xc807('0x26')](0x1f4)[_0xc807('0x35')](new db['Sequelize'][(_0xc807('0x88'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4aeab8));}if(!_[_0xc807('0x92')](_0x4aeab8,_0x348abc[_0xc807('0x53')]['mapKeyOffline'])){throw _0x2736c6[_0xc807('0x26')](0x1f4)[_0xc807('0x35')](new db[(_0xc807('0x87'))][(_0xc807('0x88'))](_0xc807('0xcc')+_0x4aeab8));}_0xdc1fb9[_0x348abc[_0xc807('0x53')][_0xc807('0xcb')]]=_0x348abc[_0xc807('0x53')]['from'];})['then'](function(){return db[_0xc807('0x4b')]['find']({'where':{'id':_0x348abc[_0xc807('0x51')]['id']},'include':[{'model':db[_0xc807('0x94')],'as':_0xc807('0x95')},{'model':db[_0xc807('0xcd')],'as':'MailAccount'}]});})[_0xc807('0x31')](handleEntityNotFound(_0x2736c6,null))[_0xc807('0x31')](function(_0x3a53c5){if(_0x3a53c5&&_0x3a53c5[_0xc807('0x95')]){_0x22182a=_0x3a53c5;var _0x5a7ec6=_[_0xc807('0x9f')](_0x348abc[_0xc807('0x53')],{'firstName':_0x348abc[_0xc807('0x53')][_0xc807('0x8e')],'phone':_0x348abc['body']['from'],'ListId':_0x3a53c5[_0xc807('0x8d')]});_0x5a7ec6[_0x348abc[_0xc807('0x53')][_0xc807('0xcb')]]=_0x348abc['body'][_0xc807('0x8e')];return db[_0xc807('0x86')][_0xc807('0xce')]({'where':_0xdc1fb9,'defaults':_0x5a7ec6});}})['spread'](function(_0x48ad54){if(_0x48ad54){_0x5f3cf1=_0x48ad54;var _0x47829f=fs[_0xc807('0xcf')](path[_0xc807('0x6f')](config[_0xc807('0x70')],_0xc807('0xd0')),_0xc807('0xd1'));var _0x224b6d=ejs[_0xc807('0xd2')](_0x47829f,{'body':_[_0xc807('0xd3')](_0x348abc[_0xc807('0x53')]['body']),'bodyTitle':_0x22182a['offlineMessageBody']});return db[_0xc807('0xd4')]['create']({'body':_0x224b6d,'ContactId':_0x48ad54['id'],'ChatWebsiteId':_0x22182a['id']});}})[_0xc807('0x31')](function(_0x396cd2){_0x3137db=_0x396cd2;if(_0x5baf95[_0xc807('0x60')]){var _0x3c6db4=_0x5baf95[_0xc807('0x38')](function(_0x505e33){return{'name':_0x505e33['originalname'],'basename':_0x505e33[_0xc807('0x6a')],'type':_0x505e33[_0xc807('0xd5')],'ChatOfflineMessageId':_0x396cd2['id']};});_0xd975d1=_0x3c6db4['map'](_0x4f866a=>{var _0x10a284={'filename':_0x4f866a[_0xc807('0x34')],'path':path[_0xc807('0x6f')](config[_0xc807('0x70')],'server',_0xc807('0xc8'),_0xc807('0xd6'),'offline-chat',_0x4f866a[_0xc807('0xd7')])};return _0x10a284;});if(!_0x22182a[_0xc807('0xd8')]){return db[_0xc807('0xd9')]['transaction'](function(_0x28ce42){return db[_0xc807('0xda')]['bulkCreate'](_0x3c6db4,{'transaction':_0x28ce42});});}}})['then'](function(){if(_0x3137db){_0x510694=_0x3137db;return db[_0xc807('0xcd')][_0xc807('0x5e')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xc807('0xdb'),'raw':!![]}]});}})[_0xc807('0x31')](function(_0x3e8cf8){if(_0x3e8cf8&&_0x3e8cf8[_0xc807('0xdb')]&&_0x22182a[_0xc807('0xdc')]&&_0x22182a[_0xc807('0xdd')]){var _0x49b9ad={'tls':{'rejectUnauthorized':![]}};if(_0x3e8cf8[_0xc807('0xdb')][_0xc807('0xde')]){_0x49b9ad[_0xc807('0xde')]=_0x3e8cf8['Smtp'][_0xc807('0xde')];}else{_0x49b9ad[_0xc807('0xdf')]=_0x3e8cf8[_0xc807('0xdb')][_0xc807('0xdf')];_0x49b9ad[_0xc807('0xe0')]=_0x3e8cf8['Smtp'][_0xc807('0xe0')];_0x49b9ad[_0xc807('0xe1')]=_0x3e8cf8[_0xc807('0xdb')][_0xc807('0xe1')];}if(_0x3e8cf8[_0xc807('0xdb')][_0xc807('0xe2')]){_0x49b9ad[_0xc807('0xe3')]={'user':_0x3e8cf8[_0xc807('0xdb')][_0xc807('0x54')],'pass':_0x3e8cf8[_0xc807('0xdb')][_0xc807('0xe4')]};}return respondWithRpcPromise('SendMail',_0xc807('0xe5'),{'account':_0x49b9ad,'message':{'from':util['format'](_0xc807('0xe6'),_0x3e8cf8[_0xc807('0x34')],_0x3e8cf8[_0xc807('0xe7')]||_0x3e8cf8[_0xc807('0xdb')][_0xc807('0x54')]),'to':_0x22182a[_0xc807('0xdd')],'subject':_0x22182a[_0xc807('0xe8')],'html':_0x510694['body'],'attachments':_0xd975d1}},client9003)[_0xc807('0x31')](function(){return _0x510694;})[_0xc807('0x50')](function(_0x5c9a5c){console[_0xc807('0x21')](_0x5c9a5c);});}})[_0xc807('0x31')](function(){if(_0x22182a&&_0x22182a['openNewInteraction']&&_0x22182a[_0xc807('0xe9')]){var _0x4dcf2d=[];if(_0x5baf95[_0xc807('0x60')]){_0x4dcf2d=_0x5baf95[_0xc807('0x38')](function(_0x5eb947){return{'name':_0x5eb947['originalname'],'basename':_0x5eb947[_0xc807('0x6a')],'type':_0x5eb947[_0xc807('0xd5')],'ChatOfflineMessageId':_0x3137db['id']};});}var _0x43cea1;if(!_[_0xc807('0x74')](_0x22182a[_0xc807('0xea')])){var _0x3ae499=_[_0xc807('0x38')](_0x348abc['body'],function(_0x434230){return _0x434230;});var _0x1f4e4a=_[_0xc807('0xeb')](_0x3ae499)[0x0];var _0xb59f12=_[_0xc807('0xec')](_0x1f4e4a,function(_0x439130){return _0x439130;});_0x43cea1=_0xb59f12[0x1][_0x22182a[_0xc807('0xea')]];}var _0x166030={'from':_0x5f3cf1['email'],'firstName':_0x5f3cf1[_0xc807('0xa4')],'lastName':_0x5f3cf1[_0xc807('0xb6')],'mapKey':'email','message':{'from':_0x5f3cf1[_0xc807('0xe7')],'to':_0x22182a[_0xc807('0xcd')]['email'],'cc':'','subject':_[_0xc807('0x74')](_0x43cea1)?_0x22182a['offlineMessageSubject']:_0x43cea1,'messageId':'','sentAt':new Date(),'attach':_0x4dcf2d[_0xc807('0x60')],'attachments':_0x4dcf2d,'originChannel':_0xc807('0xed'),'ChatWebsiteId':_0x22182a['id'],'ChatOfflineMessageId':_0x510694['id'],'originTo':_0x22182a[_0xc807('0xcd')][_0xc807('0xe7')]},'body':_0x510694['body']};var _0x4c53a4={'account':{'id':_0x22182a[_0xc807('0xe9')]},'body':_0x166030,'log':_0xc807('0xee')};return respondWithRpcPromise(_0xc807('0xee'),_0xc807('0xef'),_0x4c53a4,client9001)[_0xc807('0x31')](function(){return _0x510694;})['catch'](function(_0x4ae371){console[_0xc807('0x21')](_0x4ae371);});}return;})[_0xc807('0x31')](function(){if(_0x510694){return _0x510694;}})[_0xc807('0x31')](respondWithResult(_0x2736c6,null))[_0xc807('0x50')](function(_0x355052){console[_0xc807('0x21')]('catch',_0x355052);for(var _0x4f217f of _0x5baf95){var _0xe6ebd9=path['join'](config[_0xc807('0x70')],_0xc807('0xf0'),_0xc807('0xc8'),'attachments','offline-chat',_0x4f217f[_0xc807('0x6a')]);fs_extra[_0xc807('0xf1')](_0xe6ebd9)[_0xc807('0x50')](function(_0x49483d){console[_0xc807('0x21')](_0xc807('0xf2'),_0xe6ebd9,_0x49483d);});}});};exports['addInteraction']=function(_0x5d34cd,_0x1c2464,_0x2432c1){return db[_0xc807('0xb1')][_0xc807('0x56')]({'where':{'id':_0x5d34cd['params']['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x1c2464,null))[_0xc807('0x31')](function(_0x31fc42){if(_0x31fc42){return _0x31fc42['addInteraction'](_0x5d34cd['body'][_0xc807('0x63')],_[_0xc807('0xf3')](_0x5d34cd[_0xc807('0x53')],[_0xc807('0x63'),'id'])||{});}})[_0xc807('0x31')](respondWithResult(_0x1c2464,null))[_0xc807('0x50')](handleError(_0x1c2464,null));};exports['getInteractions']=function(_0x1666bb,_0x2d9062,_0x14aa10){var _0x57ec8a={'raw':![],'where':{}};var _0x421556={};var _0x3dcdc9={'count':0x0,'rows':[]};return db[_0xc807('0x4b')][_0xc807('0x5e')]({'where':{'id':_0x1666bb['params']['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x2d9062,null))['then'](function(_0x255ef2){if(_0x255ef2){_0x421556[_0xc807('0x40')]=_[_0xc807('0x3d')](db[_0xc807('0xb1')][_0xc807('0x39')]);_0x421556['query']=_['keys'](_0x1666bb[_0xc807('0x3c')]);_0x421556[_0xc807('0x3e')]=_[_0xc807('0x3f')](_0x421556[_0xc807('0x40')],_0x421556['query']);_0x57ec8a[_0xc807('0x42')]=_[_0xc807('0x3f')](_0x421556[_0xc807('0x40')],qs[_0xc807('0x41')](_0x1666bb['query'][_0xc807('0x41')]));_0x57ec8a[_0xc807('0x42')]=_0x57ec8a[_0xc807('0x42')][_0xc807('0x60')]?_0x57ec8a[_0xc807('0x42')]:_0x421556[_0xc807('0x40')];if(!_0x1666bb['query']['hasOwnProperty']('nolimit')){_0x57ec8a[_0xc807('0x2c')]=qs[_0xc807('0x2c')](_0x1666bb[_0xc807('0x3c')]['limit']);_0x57ec8a[_0xc807('0x29')]=qs[_0xc807('0x29')](_0x1666bb['query'][_0xc807('0x29')]);}_0x57ec8a['order']=qs[_0xc807('0x45')](_0x1666bb['query'][_0xc807('0x45')]);_0x57ec8a[_0xc807('0x46')]=qs[_0xc807('0x3e')](_['pick'](_0x1666bb[_0xc807('0x3c')],_0x421556[_0xc807('0x3e')]));_0x57ec8a['where'][_0xc807('0x5c')]=_0x255ef2['id'];if(_0x1666bb[_0xc807('0x3c')][_0xc807('0x49')]){_0x57ec8a['where']=_[_0xc807('0x48')](_0x57ec8a[_0xc807('0x46')],{'$or':_[_0xc807('0x38')](_0x57ec8a['attributes'],function(_0x4fd9f1){var _0x4e9307={};_0x4e9307[_0x4fd9f1]={'$like':'%'+_0x1666bb[_0xc807('0x3c')][_0xc807('0x49')]+'%'};return _0x4e9307;})});}_0x57ec8a=_[_0xc807('0x48')]({},_0x57ec8a,_0x1666bb[_0xc807('0x4a')]);return db[_0xc807('0xb1')][_0xc807('0x2b')]({'where':_0x57ec8a['where']})[_0xc807('0x31')](function(_0x2cb8bf){_0x3dcdc9[_0xc807('0x2b')]=_0x2cb8bf;if(_0x1666bb[_0xc807('0x3c')]['includeAll']){_0x57ec8a[_0xc807('0x4d')]=[{'model':db[_0xc807('0x86')],'as':'Contact','required':![]},{'model':db[_0xc807('0xc0')],'as':_0xc807('0xf4'),'attributes':[_0xc807('0x34'),_0xc807('0xf5'),_0xc807('0xf6')],'required':![]},{'model':db[_0xc807('0xf7')],'as':_0xc807('0xf8'),'attributes':['id',_0xc807('0x34'),_0xc807('0xf9')],'where':_0x1666bb['query']['tag']?{'id':_0x1666bb['query'][_0xc807('0xfa')]}:undefined,'required':_0x1666bb[_0xc807('0x3c')]['tag']?!![]:![]}];}return db[_0xc807('0xb1')][_0xc807('0x4e')](_0x57ec8a);})['then'](function(_0x5d9455){_0x3dcdc9[_0xc807('0x4f')]=_0x5d9455;return _0x3dcdc9;});}})[_0xc807('0x31')](respondWithFilteredResult(_0x2d9062,_0x57ec8a))[_0xc807('0x50')](handleError(_0x2d9062,null));};function iftimePromise(_0x464f7b,_0x314485){return respondWithRpcPromise(_0xc807('0xfb'),_0xc807('0xfc'),{'command':_0x314485[_0xc807('0xfd')]?util[_0xc807('0xa8')](_0xc807('0xfe'),_0x464f7b[_0xc807('0xff')],_0x314485[_0xc807('0xfd')]):util[_0xc807('0xa8')](_0xc807('0x100'),_0x464f7b[_0xc807('0xff')])},client9002)[_0xc807('0x31')](function(_0x90cb36){var _0x400a74=_0x90cb36&&_0x90cb36[_0xc807('0x101')](_0xc807('0x102'))>=0x0?!![]:![];logger[_0xc807('0x1d')](_0xc807('0x103'),_0x314485['id'],_0x464f7b['id'],_0x464f7b[_0xc807('0xff')],_0x400a74?_0xc807('0x104'):_0xc807('0x105'),_0x314485['timezone']?_0x314485[_0xc807('0xfd')]:_0xc807('0x106'));return _0x400a74;})['catch'](function(_0x2dbae2){logger[_0xc807('0x21')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x314485['id'],_0x464f7b['id'],_0x464f7b[_0xc807('0xff')],util[_0xc807('0x107')](_0x2dbae2,{'showHidden':![],'depth':null}),_0x314485[_0xc807('0xfd')]?_0x314485['timezone']:_0xc807('0x106'));return![];});}exports[_0xc807('0xfc')]=function(_0x5db4d7,_0x23e225,_0x364fc6){var _0x4a4777=0x0;var _0x12b772=0x0;var _0x705fde=![];var _0x288fe1;var _0x5445d2;return db[_0xc807('0x4b')][_0xc807('0x56')]({'where':{'id':_0x5db4d7[_0xc807('0x51')]['id']},'include':[{'model':db[_0xc807('0x108')],'as':_0xc807('0x108'),'include':[{'model':db[_0xc807('0x108')],'as':_0xc807('0x109'),'attributes':['id',_0xc807('0xff')],'raw':!![]}]}]})[_0xc807('0x31')](handleEntityNotFound(_0x23e225,null))[_0xc807('0x31')](function(_0x2cbf93){if(_0x2cbf93){_0x288fe1=_0x2cbf93;return _0x2cbf93[_0xc807('0x10a')]({'raw':!![]});}})[_0xc807('0x31')](function(_0x32b98d){if(_0x288fe1){if(_0x32b98d){_0x5445d2=_0x32b98d;}}return require('../../config/license/util')['getLicense']();})['then'](function(_0x421ed0){if(_0x421ed0){_0x12b772=_0x421ed0['virtual'];_0x705fde=_0x421ed0[_0xc807('0x73')];}})[_0xc807('0x31')](function(){return db[_0xc807('0xb1')][_0xc807('0x2b')]({'where':{'closed':![]}});})['then'](function(_0xe96375){_0x4a4777=_0xe96375;if(_0x12b772&&_0xe96375>_0x12b772){return db[_0xc807('0x10b')][_0xc807('0x5e')]({'where':{'id':0x1}})[_0xc807('0x31')](function(_0x189d1e){if(_0x189d1e){_0x189d1e['increment'](_0xc807('0x10c'));}});}})[_0xc807('0x31')](function(){if(_0x288fe1[_0xc807('0x108')]&&_0x288fe1[_0xc807('0x108')]['Intervals']){var _0x561581=[];for(var _0x2685b6=0x0;_0x2685b6<_0x288fe1['Interval'][_0xc807('0x109')][_0xc807('0x60')];_0x2685b6++){var _0x47e9c9=_0x288fe1['Interval'][_0xc807('0x109')][_0x2685b6][_0xc807('0x32')]({'plain':!![]});_0x561581[_0xc807('0xba')](iftimePromise(_0x47e9c9,_0x288fe1));}return BPromise[_0xc807('0x10d')](_0x561581)[_0xc807('0x31')](function(_0x8fb041){return _[_0xc807('0x10e')](_0x8fb041);});}else{return!![];}})[_0xc807('0x31')](function(_0x2b6483){var _0xa6ae91=fs[_0xc807('0xcf')](path[_0xc807('0x6f')](config[_0xc807('0x70')],'server/files/chat/iframe.ejs'),_0xc807('0xd1'));var _0x1722dc={'remote':_0x288fe1[_0xc807('0x10f')],'query':querystring[_0xc807('0x20')](_[_0xc807('0x48')](_0x288fe1[_0xc807('0x32')]({'plain':!![]}),{'customerIp':_0x5db4d7[_0xc807('0x83')][_0xc807('0xa2')]||_0x5db4d7[_0xc807('0x83')]['x-real-ip']||_0x5db4d7[_0xc807('0x110')]['remoteAddress']||_0x5db4d7['ip'],'referer':_0x5db4d7[_0xc807('0x83')][_0xc807('0xa6')],'openedInteractions':_0x4a4777,'maxInteractions':_0x12b772,'virtual':_0x705fde[_0xc807('0x111')],'online':_0x2b6483,'custom':_0x705fde}))[_0xc807('0x112')](/'/g,'\x5c\x27')};_0x23e225[_0xc807('0x35')](ejs[_0xc807('0xd2')](Mustache[_0xc807('0xd2')](_0xa6ae91,_0x1722dc),{'proactiveActions':_0x5445d2,'alignment':_0x288fe1[_0xc807('0x113')],'verticalAlignment':_0x288fe1['verticalAlignment'],'div_color':_0x288fe1[_0xc807('0xf9')],'text_color':_0x288fe1[_0xc807('0x114')],'button_color':_0x288fe1[_0xc807('0x115')],'background_color':_0x288fe1[_0xc807('0x116')]}));})[_0xc807('0x50')](handleError(_0x23e225,null));};exports['addApplications']=function(_0x3b836b,_0x47e0e3,_0x16fa06){return db[_0xc807('0x4b')][_0xc807('0x5e')]({'where':{'id':_0x3b836b[_0xc807('0x51')]['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x47e0e3,null))['then'](function(_0x395af9){if(_0x395af9){return db[_0xc807('0xd9')][_0xc807('0x117')](function(_0x83ab91){return db['ChatApplication'][_0xc807('0x30')]({'where':{'ChatWebsiteId':_0x3b836b[_0xc807('0x51')]['id']},'transaction':_0x83ab91})[_0xc807('0x31')](function(_0x1b6398){var _0xfb563c=_[_0xc807('0x38')](_0x3b836b[_0xc807('0x53')],function(_0x180c77){_0x180c77[_0xc807('0x5c')]=_0x3b836b[_0xc807('0x51')]['id'];return _0x180c77;});return db['ChatApplication'][_0xc807('0x118')](_0xfb563c,{'transaction':_0x83ab91});});})[_0xc807('0x31')](function(){return db['ChatApplication'][_0xc807('0x119')]({'where':{'ChatWebsiteId':_0x3b836b[_0xc807('0x51')]['id']},'order':_0xc807('0x9d')});});}})[_0xc807('0x31')](respondWithResult(_0x47e0e3,null))['catch'](handleError(_0x47e0e3,null));};exports[_0xc807('0x11a')]=function(_0x1cc2d1,_0x299c62,_0x2e782b){var _0x38d36d={};var _0xdf1c68={};var _0xb16d59;var _0x59f978;return db[_0xc807('0x4b')][_0xc807('0x5e')]({'where':{'id':_0x1cc2d1['params']['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x299c62,null))[_0xc807('0x31')](function(_0x40165a){if(_0x40165a){_0xb16d59=_0x40165a;_0xdf1c68[_0xc807('0x40')]=_[_0xc807('0x3d')](db[_0xc807('0x98')]['rawAttributes']);_0xdf1c68[_0xc807('0x3c')]=_[_0xc807('0x3d')](_0x1cc2d1['query']);_0xdf1c68[_0xc807('0x3e')]=_['intersection'](_0xdf1c68['model'],_0xdf1c68[_0xc807('0x3c')]);_0x38d36d[_0xc807('0x42')]=_['intersection'](_0xdf1c68['model'],qs[_0xc807('0x41')](_0x1cc2d1[_0xc807('0x3c')][_0xc807('0x41')]));_0x38d36d[_0xc807('0x42')]=_0x38d36d['attributes']['length']?_0x38d36d[_0xc807('0x42')]:_0xdf1c68[_0xc807('0x40')];_0x38d36d[_0xc807('0x44')]=qs[_0xc807('0x45')](_0x1cc2d1['query'][_0xc807('0x45')]);_0x38d36d[_0xc807('0x46')]=qs[_0xc807('0x3e')](_[_0xc807('0x47')](_0x1cc2d1[_0xc807('0x3c')],_0xdf1c68[_0xc807('0x3e')]));if(_0x1cc2d1[_0xc807('0x3c')][_0xc807('0x49')]){_0x38d36d['where']=_[_0xc807('0x48')](_0x38d36d[_0xc807('0x46')],{'$or':_[_0xc807('0x38')](_0x38d36d['attributes'],function(_0x109cbc){var _0x148e73={};_0x148e73[_0x109cbc]={'$like':'%'+_0x1cc2d1['query']['filter']+'%'};return _0x148e73;})});}_0x38d36d=_[_0xc807('0x48')]({},_0x38d36d,_0x1cc2d1['options']);return _0xb16d59[_0xc807('0x11a')](_0x38d36d);}})[_0xc807('0x31')](function(_0x2d9a4c){if(_0x2d9a4c){_0x59f978=_0x2d9a4c[_0xc807('0x60')];if(!_0x1cc2d1[_0xc807('0x3c')][_0xc807('0x43')]('nolimit')){_0x38d36d[_0xc807('0x2c')]=qs['limit'](_0x1cc2d1[_0xc807('0x3c')][_0xc807('0x2c')]);_0x38d36d[_0xc807('0x29')]=qs['offset'](_0x1cc2d1['query'][_0xc807('0x29')]);}return _0xb16d59['getApplications'](_0x38d36d);}})['then'](function(_0x51cf43){if(_0x51cf43){return _0x51cf43?{'count':_0x59f978,'rows':_0x51cf43}:null;}})[_0xc807('0x31')](respondWithResult(_0x299c62,null))[_0xc807('0x50')](handleError(_0x299c62,null));};exports[_0xc807('0x11b')]=function(_0x5bc179,_0x43f1bc,_0x570cca){return db['chatProactiveAction'][_0xc807('0x56')]({'where':{'id':_0x5bc179['params']['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x43f1bc,null))[_0xc807('0x31')](function(_0x5c32b2){if(_0x5c32b2){return _0x5c32b2[_0xc807('0x11b')](_0x5bc179['body']['ids'],_['omit'](_0x5bc179[_0xc807('0x53')],[_0xc807('0x63'),'id'])||{});}})[_0xc807('0x31')](respondWithResult(_0x43f1bc,null))['catch'](handleError(_0x43f1bc,null));};exports[_0xc807('0x10a')]=function(_0x2d8713,_0x2dba73,_0x5513ac){var _0x1c4c83={};var _0x4c3d07={};var _0x2d9dab;var _0x2d05c2;return db[_0xc807('0x4b')][_0xc807('0x5e')]({'where':{'id':_0x2d8713[_0xc807('0x51')]['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x2dba73,null))[_0xc807('0x31')](function(_0xa29c88){if(_0xa29c88){_0x2d9dab=_0xa29c88;_0x4c3d07['model']=_['keys'](db[_0xc807('0x11c')]['rawAttributes']);_0x4c3d07[_0xc807('0x3c')]=_[_0xc807('0x3d')](_0x2d8713[_0xc807('0x3c')]);_0x4c3d07[_0xc807('0x3e')]=_['intersection'](_0x4c3d07['model'],_0x4c3d07[_0xc807('0x3c')]);_0x1c4c83['attributes']=_[_0xc807('0x3f')](_0x4c3d07[_0xc807('0x40')],qs[_0xc807('0x41')](_0x2d8713[_0xc807('0x3c')][_0xc807('0x41')]));_0x1c4c83[_0xc807('0x42')]=_0x1c4c83[_0xc807('0x42')][_0xc807('0x60')]?_0x1c4c83['attributes']:_0x4c3d07['model'];_0x1c4c83[_0xc807('0x44')]=qs[_0xc807('0x45')](_0x2d8713[_0xc807('0x3c')][_0xc807('0x45')]);_0x1c4c83['where']=qs['filters'](_[_0xc807('0x47')](_0x2d8713[_0xc807('0x3c')],_0x4c3d07['filters']));if(_0x2d8713[_0xc807('0x3c')]['filter']){_0x1c4c83[_0xc807('0x46')]=_['merge'](_0x1c4c83['where'],{'$or':_[_0xc807('0x38')](_0x1c4c83['attributes'],function(_0x5484ac){var _0x578faa={};_0x578faa[_0x5484ac]={'$like':'%'+_0x2d8713[_0xc807('0x3c')][_0xc807('0x49')]+'%'};return _0x578faa;})});}_0x1c4c83=_['merge']({},_0x1c4c83,_0x2d8713[_0xc807('0x4a')]);return _0x2d9dab[_0xc807('0x10a')](_0x1c4c83);}})[_0xc807('0x31')](function(_0x58cda5){if(_0x58cda5){_0x2d05c2=_0x58cda5[_0xc807('0x60')];if(!_0x2d8713[_0xc807('0x3c')][_0xc807('0x43')](_0xc807('0x61'))){_0x1c4c83[_0xc807('0x2c')]=qs['limit'](_0x2d8713[_0xc807('0x3c')][_0xc807('0x2c')]);_0x1c4c83[_0xc807('0x29')]=qs['offset'](_0x2d8713[_0xc807('0x3c')][_0xc807('0x29')]);}return _0x2d9dab[_0xc807('0x10a')](_0x1c4c83);}})[_0xc807('0x31')](function(_0x25a06c){if(_0x25a06c){return _0x25a06c?{'count':_0x2d05c2,'rows':_0x25a06c}:null;}})[_0xc807('0x31')](respondWithResult(_0x2dba73,null))[_0xc807('0x50')](handleError(_0x2dba73,null));};exports['getFields']=function(_0x33e58e,_0x3dbdcd,_0x4ad328){var _0x13ee3d=_0x33e58e[_0xc807('0x3c')][_0xc807('0x11d')]==='false'?_0xc807('0x11e'):'onlineForm';return db[_0xc807('0x4b')][_0xc807('0x56')]({'attributes':['id',_0x13ee3d],'where':{'id':_0x33e58e[_0xc807('0x51')]['id']}})['then'](handleEntityNotFound(_0x3dbdcd,null))[_0xc807('0x31')](function(_0x42a037){if(_0x42a037){var _0x236999=_0x42a037[_0x13ee3d];var _0x441764=_0x236999&&_0x236999[_0xc807('0x11f')]?_0x236999[_0xc807('0x11f')]:[];_0x3dbdcd[_0xc807('0x35')]({'fromKey':_[_0xc807('0x74')](_0x236999['fromKey'])?undefined:_0x236999[_0xc807('0x120')],'count':_0x441764['length'],'rows':_0x441764});}})[_0xc807('0x50')](handleError(_0x3dbdcd,null));};exports[_0xc807('0x121')]=function(_0x44ac35,_0x355df2,_0x444a8d){var _0xc06fc={'raw':![],'where':{}};var _0x83b9e6={};var _0x5cbdc6={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc807('0x5e')]({'where':{'id':_0x44ac35['params']['id']}})['then'](handleEntityNotFound(_0x355df2,null))['then'](function(_0xcc77c9){if(_0xcc77c9){_0x83b9e6['model']=_[_0xc807('0x3d')](db['ChatOfflineMessage'][_0xc807('0x39')]);_0x83b9e6['query']=_[_0xc807('0x3d')](_0x44ac35['query']);_0x83b9e6[_0xc807('0x3e')]=_['intersection'](_0x83b9e6['model'],_0x83b9e6[_0xc807('0x3c')]);_0xc06fc[_0xc807('0x42')]=_[_0xc807('0x3f')](_0x83b9e6[_0xc807('0x40')],qs[_0xc807('0x41')](_0x44ac35['query'][_0xc807('0x41')]));_0xc06fc[_0xc807('0x42')]=_0xc06fc[_0xc807('0x42')][_0xc807('0x60')]?_0xc06fc[_0xc807('0x42')]:_0x83b9e6[_0xc807('0x40')];if(!_0x44ac35[_0xc807('0x3c')]['hasOwnProperty'](_0xc807('0x61'))){_0xc06fc[_0xc807('0x2c')]=qs['limit'](_0x44ac35['query']['limit']);_0xc06fc[_0xc807('0x29')]=qs[_0xc807('0x29')](_0x44ac35['query']['offset']);}_0xc06fc[_0xc807('0x44')]=qs[_0xc807('0x45')](_0x44ac35[_0xc807('0x3c')][_0xc807('0x45')]);_0xc06fc[_0xc807('0x46')]=qs['filters'](_[_0xc807('0x47')](_0x44ac35['query'],_0x83b9e6['filters']));_0xc06fc[_0xc807('0x46')][_0xc807('0x5c')]=_0xcc77c9['id'];if(_0x44ac35[_0xc807('0x3c')][_0xc807('0x49')]){_0xc06fc[_0xc807('0x46')]=_[_0xc807('0x48')](_0xc06fc[_0xc807('0x46')],{'$or':_[_0xc807('0x38')](_0xc06fc['attributes'],function(_0x19e559){var _0x54dcc3={};_0x54dcc3[_0x19e559]={'$like':'%'+_0x44ac35[_0xc807('0x3c')][_0xc807('0x49')]+'%'};return _0x54dcc3;})});}_0xc06fc=_['merge']({},_0xc06fc,_0x44ac35[_0xc807('0x4a')]);return db[_0xc807('0xd4')]['count']({'where':_0xc06fc['where']})[_0xc807('0x31')](function(_0xd524c5){_0x5cbdc6[_0xc807('0x2b')]=_0xd524c5;if(_0x44ac35[_0xc807('0x3c')]['includeAll']){_0xc06fc[_0xc807('0x4d')]=[{'all':!![]}];}else{_0xc06fc[_0xc807('0x4d')]=[{'model':db[_0xc807('0x86')],'as':_0xc807('0x122'),'required':![]},{'model':db['Attachment'],'as':_0xc807('0x123'),'required':![]}];}return db['ChatOfflineMessage'][_0xc807('0x4e')](_0xc06fc);})['then'](function(_0x18f02c){_0x5cbdc6[_0xc807('0x4f')]=_0x18f02c;return _0x5cbdc6;});}})[_0xc807('0x31')](respondWithFilteredResult(_0x355df2,_0xc06fc))[_0xc807('0x50')](handleError(_0x355df2,null));};exports['addAgents']=function(_0x2a95c9,_0x2cc27d,_0x3b7ec0){return db[_0xc807('0x4b')][_0xc807('0x56')]({'where':{'id':_0x2a95c9[_0xc807('0x51')]['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x2cc27d,null))['then'](function(_0x4b0363){if(_0x4b0363){return _0x4b0363[_0xc807('0x124')](_0x2a95c9[_0xc807('0x53')][_0xc807('0x63')],_[_0xc807('0xf3')](_0x2a95c9[_0xc807('0x53')],[_0xc807('0x63'),'id'])||{})[_0xc807('0xb4')](function(_0x355cdf){for(var _0x458d94=0x0;_0x458d94<_0x2a95c9[_0xc807('0x53')]['ids'][_0xc807('0x60')];_0x458d94+=0x1){socket[_0xc807('0x125')](_0xc807('0x126'),{'UserId':Number(_0x2a95c9[_0xc807('0x53')][_0xc807('0x63')][_0x458d94]),'ChatWebsiteId':Number(_0x2a95c9['params']['id'])});}return _0x355cdf;});}})[_0xc807('0x31')](respondWithResult(_0x2cc27d,null))[_0xc807('0x50')](handleError(_0x2cc27d,null));};exports['removeAgents']=function(_0x7cd4e0,_0x3482ef,_0x54b715){return db[_0xc807('0x4b')][_0xc807('0x56')]({'where':{'id':_0x7cd4e0[_0xc807('0x51')]['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x3482ef,null))[_0xc807('0x31')](function(_0xa0050b){if(_0xa0050b){return _0xa0050b['removeAgents'](_0x7cd4e0[_0xc807('0x3c')]['ids'])[_0xc807('0x31')](function(){if(_[_0xc807('0x127')](_0x7cd4e0[_0xc807('0x3c')][_0xc807('0x63')])){for(var _0x4f305c=0x0;_0x4f305c<_0x7cd4e0[_0xc807('0x3c')][_0xc807('0x63')]['length'];_0x4f305c+=0x1){socket[_0xc807('0x125')](_0xc807('0x128'),{'UserId':Number(_0x7cd4e0['query'][_0xc807('0x63')][_0x4f305c]),'ChatWebsiteId':Number(_0x7cd4e0[_0xc807('0x51')]['id'])});}}else{socket[_0xc807('0x125')](_0xc807('0x128'),{'UserId':Number(_0x7cd4e0[_0xc807('0x3c')][_0xc807('0x63')]),'ChatWebsiteId':Number(_0x7cd4e0['params']['id'])});}});}})[_0xc807('0x31')](respondWithStatusCode(_0x3482ef,null))['catch'](handleError(_0x3482ef,null));};exports[_0xc807('0x129')]=function(_0x5368e8,_0x4e17f0,_0x1cf71d){var _0x300913={};var _0x32c1dd={};var _0x3315bf;var _0x474964;return db['ChatWebsite'][_0xc807('0x5e')]({'where':{'id':_0x5368e8[_0xc807('0x51')]['id']}})[_0xc807('0x31')](handleEntityNotFound(_0x4e17f0,null))['then'](function(_0x5dad01){if(_0x5dad01){_0x3315bf=_0x5dad01;_0x32c1dd['model']=_['keys'](db[_0xc807('0xc0')][_0xc807('0x39')]);_0x32c1dd['query']=_['keys'](_0x5368e8['query']);_0x32c1dd[_0xc807('0x3e')]=_[_0xc807('0x3f')](_0x32c1dd[_0xc807('0x40')],_0x32c1dd['query']);_0x300913['attributes']=_[_0xc807('0x3f')](_0x32c1dd[_0xc807('0x40')],qs[_0xc807('0x41')](_0x5368e8[_0xc807('0x3c')]['fields']));_0x300913['attributes']=_0x300913[_0xc807('0x42')]['length']?_0x300913[_0xc807('0x42')]:_0x32c1dd[_0xc807('0x40')];_0x300913['order']=qs[_0xc807('0x45')](_0x5368e8[_0xc807('0x3c')][_0xc807('0x45')]);_0x300913[_0xc807('0x46')]=qs[_0xc807('0x3e')](_[_0xc807('0x47')](_0x5368e8[_0xc807('0x3c')],_0x32c1dd[_0xc807('0x3e')]));if(_0x5368e8['query']['filter']){_0x300913[_0xc807('0x46')]=_[_0xc807('0x48')](_0x300913['where'],{'$or':_[_0xc807('0x38')](_0x300913[_0xc807('0x42')],function(_0x462887){var _0x1837ef={};_0x1837ef[_0x462887]={'$like':'%'+_0x5368e8[_0xc807('0x3c')][_0xc807('0x49')]+'%'};return _0x1837ef;})});}_0x300913=_[_0xc807('0x48')]({},_0x300913,_0x5368e8[_0xc807('0x4a')]);return _0x3315bf[_0xc807('0x129')](_0x300913);}})[_0xc807('0x31')](function(_0x3cc969){if(_0x3cc969){_0x474964=_0x3cc969[_0xc807('0x60')];if(!_0x5368e8[_0xc807('0x3c')][_0xc807('0x43')](_0xc807('0x61'))){_0x300913[_0xc807('0x2c')]=qs[_0xc807('0x2c')](_0x5368e8[_0xc807('0x3c')][_0xc807('0x2c')]);_0x300913['offset']=qs[_0xc807('0x29')](_0x5368e8['query'][_0xc807('0x29')]);}return _0x3315bf[_0xc807('0x129')](_0x300913);}})[_0xc807('0x31')](function(_0xecb5f1){if(_0xecb5f1){return _0xecb5f1?{'count':_0x474964,'rows':_0xecb5f1}:null;}})[_0xc807('0x31')](respondWithResult(_0x4e17f0,null))[_0xc807('0x50')](handleError(_0x4e17f0,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 5e7b1fd..1d6b2f9 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 _0x8b04=['events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x8b04,0x130));var _0x48b0=function(_0xac30ba,_0x4a7fda){_0xac30ba=_0xac30ba-0x0;var _0x1ba237=_0x8b04[_0xac30ba];return _0x1ba237;};'use strict';var EventEmitter=require(_0x48b0('0x0'));var ChatWebsite=require(_0x48b0('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x48b0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x48b0('0x3'),'afterDestroy':_0x48b0('0x4')};function emitEvent(_0xc0b19b){return function(_0x468c90,_0x423a40,_0x1f1bb2){ChatWebsiteEvents[_0x48b0('0x5')](_0xc0b19b+':'+_0x468c90['id'],_0x468c90);ChatWebsiteEvents[_0x48b0('0x5')](_0xc0b19b,_0x468c90);_0x1f1bb2(null);};}for(var e in events){if(events[_0x48b0('0x6')](e)){var event=events[e];ChatWebsite[_0x48b0('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xfc76=['save','update','emit','hasOwnProperty','hook','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x2a21e9,_0x1b41e9){var _0x496fca=function(_0x2262fe){while(--_0x2262fe){_0x2a21e9['push'](_0x2a21e9['shift']());}};_0x496fca(++_0x1b41e9);}(_0xfc76,0xb5));var _0x6fc7=function(_0x3cff65,_0x4223ca){_0x3cff65=_0x3cff65-0x0;var _0x52b86a=_0xfc76[_0x3cff65];return _0x52b86a;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x6fc7('0x0'))['db'][_0x6fc7('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6fc7('0x2')](0x0);var events={'afterCreate':_0x6fc7('0x3'),'afterUpdate':_0x6fc7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x316cc4){return function(_0x40d212,_0x51280c,_0x13f682){ChatWebsiteEvents['emit'](_0x316cc4+':'+_0x40d212['id'],_0x40d212);ChatWebsiteEvents[_0x6fc7('0x5')](_0x316cc4,_0x40d212);_0x13f682(null);};}for(var e in events){if(events[_0x6fc7('0x6')](e)){var event=events[e];ChatWebsite[_0x6fc7('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index d9d2d74..dba9beb 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 _0x7d21=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','chat_websites','lodash','../../config/logger','api'];(function(_0x188b1d,_0x2248ed){var _0x116e65=function(_0x5bb02f){while(--_0x5bb02f){_0x188b1d['push'](_0x188b1d['shift']());}};_0x116e65(++_0x2248ed);}(_0x7d21,0xa2));var _0x17d2=function(_0x44cf0d,_0x1f023c){_0x44cf0d=_0x44cf0d-0x0;var _0x2657bd=_0x7d21[_0x44cf0d];return _0x2657bd;};'use strict';var _=require(_0x17d2('0x0'));var util=require('util');var logger=require(_0x17d2('0x1'))(_0x17d2('0x2'));var moment=require(_0x17d2('0x3'));var BPromise=require(_0x17d2('0x4'));var rp=require(_0x17d2('0x5'));var fs=require('fs');var path=require(_0x17d2('0x6'));var rimraf=require(_0x17d2('0x7'));var config=require(_0x17d2('0x8'));var attributes=require(_0x17d2('0x9'));module['exports']=function(_0x1d2db0,_0x147e1e){return _0x1d2db0['define']('ChatWebsite',attributes,{'tableName':_0x17d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x15c6=['request-promise','path','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','api','moment','bluebird'];(function(_0xe140a,_0x537b5b){var _0x15debc=function(_0x4cfd78){while(--_0x4cfd78){_0xe140a['push'](_0xe140a['shift']());}};_0x15debc(++_0x537b5b);}(_0x15c6,0x1f0));var _0x615c=function(_0x435dde,_0x2a2fa3){_0x435dde=_0x435dde-0x0;var _0x4aca2d=_0x15c6[_0x435dde];return _0x4aca2d;};'use strict';var _=require(_0x615c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x615c('0x1'));var moment=require(_0x615c('0x2'));var BPromise=require(_0x615c('0x3'));var rp=require(_0x615c('0x4'));var fs=require('fs');var path=require(_0x615c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x615c('0x6'));module[_0x615c('0x7')]=function(_0x1d8efc,_0x33f698){return _0x1d8efc['define'](_0x615c('0x8'),attributes,{'tableName':_0x615c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index cae412b..c4d7751 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 _0xaea6=['socket.io-emitter','./chatWebsite.socket','request','then','info','request\x20sent','debug','stringify','code','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost'];(function(_0x256a6f,_0x1d9bec){var _0x5437c7=function(_0x3fa4d9){while(--_0x3fa4d9){_0x256a6f['push'](_0x256a6f['shift']());}};_0x5437c7(++_0x1d9bec);}(_0xaea6,0xf6));var _0x6aea=function(_0x4c6494,_0x3f802c){_0x4c6494=_0x4c6494-0x0;var _0x24f2e3=_0xaea6[_0x4c6494];return _0x24f2e3;};'use strict';var _=require(_0x6aea('0x0'));var util=require(_0x6aea('0x1'));var moment=require(_0x6aea('0x2'));var BPromise=require(_0x6aea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6aea('0x4'));var db=require(_0x6aea('0x5'))['db'];var utils=require(_0x6aea('0x6'));var logger=require(_0x6aea('0x7'))(_0x6aea('0x8'));var config=require(_0x6aea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6aea('0xa')][_0x6aea('0xb')]({'port':0x232a});config['redis']=_[_0x6aea('0xc')](config[_0x6aea('0xd')],{'host':_0x6aea('0xe'),'port':0x18eb});var socket=require(_0x6aea('0xf'))(new Redis(config['redis']));require(_0x6aea('0x10'))['register'](socket);function respondWithRpcPromise(_0x5d941c,_0xb6a946,_0x12c1ae){return new BPromise(function(_0x66add0,_0x2cc8a9){return client[_0x6aea('0x11')](_0x5d941c,_0x12c1ae)[_0x6aea('0x12')](function(_0x1a6cd0){logger[_0x6aea('0x13')]('ChatWebsite,\x20%s,\x20%s',_0xb6a946,_0x6aea('0x14'));logger[_0x6aea('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xb6a946,_0x6aea('0x14'),JSON[_0x6aea('0x16')](_0x1a6cd0));if(_0x1a6cd0['error']){if(_0x1a6cd0['error'][_0x6aea('0x17')]===0x1f4){logger[_0x6aea('0x18')](_0x6aea('0x19'),_0xb6a946,_0x1a6cd0[_0x6aea('0x18')][_0x6aea('0x1a')]);return _0x2cc8a9(_0x1a6cd0['error'][_0x6aea('0x1a')]);}logger[_0x6aea('0x18')](_0x6aea('0x19'),_0xb6a946,_0x1a6cd0[_0x6aea('0x18')][_0x6aea('0x1a')]);return _0x66add0(_0x1a6cd0[_0x6aea('0x18')][_0x6aea('0x1a')]);}else{logger[_0x6aea('0x13')](_0x6aea('0x19'),_0xb6a946,_0x6aea('0x14'));_0x66add0(_0x1a6cd0[_0x6aea('0x1b')][_0x6aea('0x1a')]);}})[_0x6aea('0x1c')](function(_0x2958c7){logger['error'](_0x6aea('0x19'),_0xb6a946,_0x2958c7);_0x2cc8a9(_0x2958c7);});});}
\ No newline at end of file
+var _0x86cf=['debug','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','ChatWebsite,\x20%s,\x20%s','request\x20sent'];(function(_0x4e7b9c,_0x5a15d7){var _0x36ca02=function(_0x1e9f3b){while(--_0x1e9f3b){_0x4e7b9c['push'](_0x4e7b9c['shift']());}};_0x36ca02(++_0x5a15d7);}(_0x86cf,0x129));var _0xf86c=function(_0x139795,_0x14f5c8){_0x139795=_0x139795-0x0;var _0x3fdd92=_0x86cf[_0x139795];return _0x3fdd92;};'use strict';var _=require(_0xf86c('0x0'));var util=require(_0xf86c('0x1'));var moment=require(_0xf86c('0x2'));var BPromise=require(_0xf86c('0x3'));var rs=require(_0xf86c('0x4'));var fs=require('fs');var Redis=require(_0xf86c('0x5'));var db=require(_0xf86c('0x6'))['db'];var utils=require(_0xf86c('0x7'));var logger=require(_0xf86c('0x8'))(_0xf86c('0x9'));var config=require(_0xf86c('0xa'));var jayson=require(_0xf86c('0xb'));var client=jayson[_0xf86c('0xc')][_0xf86c('0xd')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf86c('0xe')],{'host':_0xf86c('0xf'),'port':0x18eb});var socket=require(_0xf86c('0x10'))(new Redis(config[_0xf86c('0xe')]));require(_0xf86c('0x11'))[_0xf86c('0x12')](socket);function respondWithRpcPromise(_0x1107ac,_0x4ce54f,_0x13b0bf){return new BPromise(function(_0x24187b,_0x3391d2){return client[_0xf86c('0x13')](_0x1107ac,_0x13b0bf)['then'](function(_0xdea2b7){logger['info'](_0xf86c('0x14'),_0x4ce54f,_0xf86c('0x15'));logger[_0xf86c('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4ce54f,_0xf86c('0x15'),JSON[_0xf86c('0x17')](_0xdea2b7));if(_0xdea2b7['error']){if(_0xdea2b7[_0xf86c('0x18')][_0xf86c('0x19')]===0x1f4){logger[_0xf86c('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x4ce54f,_0xdea2b7[_0xf86c('0x18')][_0xf86c('0x1a')]);return _0x3391d2(_0xdea2b7[_0xf86c('0x18')]['message']);}logger[_0xf86c('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x4ce54f,_0xdea2b7[_0xf86c('0x18')][_0xf86c('0x1a')]);return _0x24187b(_0xdea2b7[_0xf86c('0x18')][_0xf86c('0x1a')]);}else{logger[_0xf86c('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x4ce54f,'request\x20sent');_0x24187b(_0xdea2b7['result'][_0xf86c('0x1a')]);}})[_0xf86c('0x1c')](function(_0x67678){logger[_0xf86c('0x18')](_0xf86c('0x14'),_0x4ce54f,_0x67678);_0x3391d2(_0x67678);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 1952afa..2789064 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 _0xfe5c=['register','length','./chatWebsite.events','save','update','emit','removeListener'];(function(_0xeef8cc,_0x38e97e){var _0x392211=function(_0x476eb6){while(--_0x476eb6){_0xeef8cc['push'](_0xeef8cc['shift']());}};_0x392211(++_0x38e97e);}(_0xfe5c,0x87));var _0xcfe5=function(_0x5da631,_0x2c2cbe){_0x5da631=_0x5da631-0x0;var _0x3229b5=_0xfe5c[_0x5da631];return _0x3229b5;};'use strict';var ChatWebsiteEvents=require(_0xcfe5('0x0'));var events=[_0xcfe5('0x1'),'remove',_0xcfe5('0x2')];function createListener(_0x4b77c4,_0x4c26e3){return function(_0x2c7d52){_0x4c26e3[_0xcfe5('0x3')](_0x4b77c4,_0x2c7d52);};}function removeListener(_0x15ac9d,_0x1129a2){return function(){ChatWebsiteEvents[_0xcfe5('0x4')](_0x15ac9d,_0x1129a2);};}exports[_0xcfe5('0x5')]=function(_0x32efc7){for(var _0x1139dd=0x0,_0x2cd7c7=events[_0xcfe5('0x6')];_0x1139dd<_0x2cd7c7;_0x1139dd++){var _0x5b9fc3=events[_0x1139dd];var _0x4f26df=createListener('chatWebsite:'+_0x5b9fc3,_0x32efc7);ChatWebsiteEvents['on'](_0x5b9fc3,_0x4f26df);}};
\ No newline at end of file
+var _0x0f4a=['register','length','chatWebsite:','./chatWebsite.events','save','update','emit','removeListener'];(function(_0x3e1a1b,_0x1be7e0){var _0x408c2f=function(_0x7a9ec0){while(--_0x7a9ec0){_0x3e1a1b['push'](_0x3e1a1b['shift']());}};_0x408c2f(++_0x1be7e0);}(_0x0f4a,0xd3));var _0xa0f4=function(_0x3fb9bd,_0x1c498c){_0x3fb9bd=_0x3fb9bd-0x0;var _0x1a5d30=_0x0f4a[_0x3fb9bd];return _0x1a5d30;};'use strict';var ChatWebsiteEvents=require(_0xa0f4('0x0'));var events=[_0xa0f4('0x1'),'remove',_0xa0f4('0x2')];function createListener(_0x2c02f6,_0x3f80b7){return function(_0x5d4c54){_0x3f80b7[_0xa0f4('0x3')](_0x2c02f6,_0x5d4c54);};}function removeListener(_0x189768,_0x232b65){return function(){ChatWebsiteEvents[_0xa0f4('0x4')](_0x189768,_0x232b65);};}exports[_0xa0f4('0x5')]=function(_0x1b2fb5){for(var _0x35c65f=0x0,_0x75c3f2=events[_0xa0f4('0x6')];_0x35c65f<_0x75c3f2;_0x35c65f++){var _0x488570=events[_0x35c65f];var _0x57a4e3=createListener(_0xa0f4('0x7')+_0x488570,_0x1b2fb5);ChatWebsiteEvents['on'](_0x488570,_0x57a4e3);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 711f99a..b53bfcf 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 _0x98dd=['format','%s-%s','originalname','single','file','root','server/files/images/avatars/','diskStorage','addCustomerAvatar','now','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','offline','/:id/interactions','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','get','/describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','join','server/files/images/logos/'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x98dd,0x1c8));var _0xd98d=function(_0x58baf9,_0x446c3e){_0x58baf9=_0x58baf9-0x0;var _0x9b8f74=_0x98dd[_0x58baf9];return _0x9b8f74;};'use strict';var multer=require(_0xd98d('0x0'));var util=require(_0xd98d('0x1'));var path=require('path');var timeout=require(_0xd98d('0x2'));var express=require('express');var router=express[_0xd98d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd98d('0x4'));var interaction=require(_0xd98d('0x5'));var config=require(_0xd98d('0x6'));var controller=require(_0xd98d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd98d('0x8')]);router[_0xd98d('0x9')](_0xd98d('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xd98d('0xb'),auth[_0xd98d('0xc')](),controller[_0xd98d('0xd')]);router[_0xd98d('0x9')](_0xd98d('0xe'),auth[_0xd98d('0xc')](),controller[_0xd98d('0xf')]);router[_0xd98d('0x9')]('/:id/canned_answers',auth[_0xd98d('0xc')](),controller['getAnswers']);router[_0xd98d('0x9')](_0xd98d('0x10'),controller[_0xd98d('0x11')]);router[_0xd98d('0x9')](_0xd98d('0x12'),controller[_0xd98d('0x13')]);router[_0xd98d('0x9')](_0xd98d('0x14'),controller[_0xd98d('0x15')]);router['get'](_0xd98d('0x16'),controller['getSystemAvatar']);router[_0xd98d('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0xd98d('0x9')](_0xd98d('0x17'),controller[_0xd98d('0x18')]);router[_0xd98d('0x9')](_0xd98d('0x19'),auth[_0xd98d('0xc')](),controller['getApplications']);router[_0xd98d('0x9')](_0xd98d('0x1a'),auth[_0xd98d('0xc')](),controller[_0xd98d('0x1b')]);router['get'](_0xd98d('0x1c'),controller[_0xd98d('0x1d')]);router['get'](_0xd98d('0x1e'),auth['isAuthenticated'](),controller[_0xd98d('0x1f')]);router[_0xd98d('0x9')](_0xd98d('0x20'),auth[_0xd98d('0xc')](),controller[_0xd98d('0x21')]);router[_0xd98d('0x22')]('/',auth[_0xd98d('0xc')](),controller[_0xd98d('0x23')]);router[_0xd98d('0x22')](_0xd98d('0xe'),auth[_0xd98d('0xc')](),controller[_0xd98d('0x24')]);router[_0xd98d('0x22')](_0xd98d('0x25'),auth['isAuthenticated'](),controller[_0xd98d('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4ce1ab,_0x8f5c3c,_0xf22b38){_0xf22b38(null,path[_0xd98d('0x27')](config['root'],_0xd98d('0x28')));},'filename':function(_0x1db3ff,_0x5d205b,_0x27ca16){_0x27ca16(null,util[_0xd98d('0x29')](_0xd98d('0x2a'),Date['now'](),_0x5d205b[_0xd98d('0x2b')]));}})});router[_0xd98d('0x22')]('/:id/logo',upload[_0xd98d('0x2c')](_0xd98d('0x2d')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa69146,_0x14caf5,_0x4104e1){_0x4104e1(null,path[_0xd98d('0x27')](config[_0xd98d('0x2e')],_0xd98d('0x2f')));},'filename':function(_0xc58700,_0x310df5,_0x4267ad){_0x4267ad(null,util[_0xd98d('0x29')](_0xd98d('0x2a'),Date['now'](),_0x310df5[_0xd98d('0x2b')]));}})});router[_0xd98d('0x22')](_0xd98d('0x12'),upload['single'](_0xd98d('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0xd98d('0x30')]({'destination':function(_0x288fd6,_0x1d841c,_0x4a31a8){_0x4a31a8(null,path[_0xd98d('0x27')](config[_0xd98d('0x2e')],_0xd98d('0x2f')));},'filename':function(_0x20ca14,_0x4cb43a,_0x352d81){_0x352d81(null,util['format']('%s-%s',Date['now'](),_0x4cb43a[_0xd98d('0x2b')]));}})});router[_0xd98d('0x22')](_0xd98d('0x14'),upload[_0xd98d('0x2c')](_0xd98d('0x2d')),controller[_0xd98d('0x31')]);var upload=multer({'storage':multer[_0xd98d('0x30')]({'destination':function(_0x4d260d,_0x482c86,_0x2a8c39){_0x2a8c39(null,path[_0xd98d('0x27')](config['root'],_0xd98d('0x2f')));},'filename':function(_0x24b2b2,_0x4d4129,_0x1b5d67){_0x1b5d67(null,util[_0xd98d('0x29')]('%s-%s',Date[_0xd98d('0x32')](),_0x4d4129[_0xd98d('0x2b')]));}})});router[_0xd98d('0x22')](_0xd98d('0x16'),upload['single'](_0xd98d('0x2d')),controller[_0xd98d('0x33')]);router['post'](_0xd98d('0x34'),controller[_0xd98d('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xd98d('0x30')]({'destination':function(_0x28eccb,_0x23481d,_0x5ef372){const _0xa1b6b3=path[_0xd98d('0x27')](config[_0xd98d('0x2e')],_0xd98d('0x36'),'attachments',_0xd98d('0x37'));fs_extra[_0xd98d('0x38')](_0xa1b6b3,function(){_0x5ef372(null,_0xa1b6b3);});},'filename':function(_0x44718d,_0x577efa,_0xa077){const _0x26351b=_0x577efa['originalname'][_0xd98d('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xb92cdc=path[_0xd98d('0x3a')](_0x26351b);const _0x2b74f4=Date['now']()+'-'+_0x26351b['replace'](_0xb92cdc,'')+_0xb92cdc;_0xa077(null,_0x2b74f4);}})});router[_0xd98d('0x22')]('/:id/offline',offlineUploadMulter['any'](),controller[_0xd98d('0x3b')]);router[_0xd98d('0x22')](_0xd98d('0x3c'),auth[_0xd98d('0xc')](),controller['addInteraction']);router[_0xd98d('0x22')](_0xd98d('0x19'),auth['isAuthenticated'](),controller[_0xd98d('0x3d')]);router['post'](_0xd98d('0x1a'),auth[_0xd98d('0xc')](),controller[_0xd98d('0x3e')]);router[_0xd98d('0x22')](_0xd98d('0x20'),auth[_0xd98d('0xc')](),controller[_0xd98d('0x3f')]);router[_0xd98d('0x40')](_0xd98d('0xb'),auth[_0xd98d('0xc')](),controller[_0xd98d('0x41')]);router[_0xd98d('0x42')](_0xd98d('0xb'),auth['isAuthenticated'](),controller[_0xd98d('0x43')]);router['delete'](_0xd98d('0xe'),auth['isAuthenticated'](),controller[_0xd98d('0x44')]);router['delete'](_0xd98d('0x25'),auth[_0xd98d('0xc')](),controller[_0xd98d('0x45')]);router[_0xd98d('0x42')](_0xd98d('0x20'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xd98d('0x46')]=router;
\ No newline at end of file
+var _0xa777=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','now','originalname','single','file','addLogo','root','%s-%s','addAvatar','server/files/images/avatars/','/:id/customer_avatar','/:id/system_avatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','any','addInteraction','addApplications','addProactiveActions','addAgents','destroy','delete','/:id/canned_answers','removeAnswers','exports','multer','util','path'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa777,0x16f));var _0x7a77=function(_0x2f5a1d,_0x295d1d){_0x2f5a1d=_0x2f5a1d-0x0;var _0x1bc425=_0xa777[_0x2f5a1d];return _0x1bc425;};'use strict';var multer=require(_0x7a77('0x0'));var util=require(_0x7a77('0x1'));var path=require(_0x7a77('0x2'));var timeout=require(_0x7a77('0x3'));var express=require(_0x7a77('0x4'));var router=express[_0x7a77('0x5')]();var fs_extra=require(_0x7a77('0x6'));var auth=require(_0x7a77('0x7'));var interaction=require(_0x7a77('0x8'));var config=require(_0x7a77('0x9'));var controller=require('./chatWebsite.controller');router[_0x7a77('0xa')]('/',auth[_0x7a77('0xb')](),controller[_0x7a77('0xc')]);router[_0x7a77('0xa')](_0x7a77('0xd'),auth[_0x7a77('0xb')](),controller[_0x7a77('0xe')]);router['get'](_0x7a77('0xf'),auth[_0x7a77('0xb')](),controller['show']);router[_0x7a77('0xa')](_0x7a77('0x10'),auth[_0x7a77('0xb')](),controller[_0x7a77('0x11')]);router[_0x7a77('0xa')]('/:id/canned_answers',auth[_0x7a77('0xb')](),controller[_0x7a77('0x12')]);router[_0x7a77('0xa')](_0x7a77('0x13'),controller[_0x7a77('0x14')]);router[_0x7a77('0xa')](_0x7a77('0x15'),controller[_0x7a77('0x16')]);router['get']('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x7a77('0xa')]('/:id/system_avatar',controller[_0x7a77('0x17')]);router[_0x7a77('0xa')](_0x7a77('0x18'),auth[_0x7a77('0xb')](),controller[_0x7a77('0x19')]);router[_0x7a77('0xa')](_0x7a77('0x1a'),controller['getSnippet']);router[_0x7a77('0xa')](_0x7a77('0x1b'),auth[_0x7a77('0xb')](),controller[_0x7a77('0x1c')]);router[_0x7a77('0xa')](_0x7a77('0x1d'),auth[_0x7a77('0xb')](),controller[_0x7a77('0x1e')]);router['get'](_0x7a77('0x1f'),controller[_0x7a77('0x20')]);router[_0x7a77('0xa')](_0x7a77('0x21'),auth[_0x7a77('0xb')](),controller[_0x7a77('0x22')]);router[_0x7a77('0xa')](_0x7a77('0x23'),auth[_0x7a77('0xb')](),controller[_0x7a77('0x24')]);router[_0x7a77('0x25')]('/',auth[_0x7a77('0xb')](),controller[_0x7a77('0x26')]);router['post'](_0x7a77('0x10'),auth[_0x7a77('0xb')](),controller[_0x7a77('0x27')]);router[_0x7a77('0x25')]('/:id/canned_answers',auth[_0x7a77('0xb')](),controller[_0x7a77('0x28')]);var upload=multer({'storage':multer[_0x7a77('0x29')]({'destination':function(_0x5282cd,_0x1fba00,_0x4181f1){_0x4181f1(null,path[_0x7a77('0x2a')](config['root'],_0x7a77('0x2b')));},'filename':function(_0x1009cd,_0x2ea3d1,_0x5edad0){_0x5edad0(null,util[_0x7a77('0x2c')]('%s-%s',Date[_0x7a77('0x2d')](),_0x2ea3d1[_0x7a77('0x2e')]));}})});router['post'](_0x7a77('0x13'),upload[_0x7a77('0x2f')](_0x7a77('0x30')),controller[_0x7a77('0x31')]);var upload=multer({'storage':multer[_0x7a77('0x29')]({'destination':function(_0x5ab94b,_0x569c28,_0x1177d1){_0x1177d1(null,path[_0x7a77('0x2a')](config[_0x7a77('0x32')],'server/files/images/avatars/'));},'filename':function(_0x1eeb19,_0x5b7764,_0x3629fe){_0x3629fe(null,util[_0x7a77('0x2c')](_0x7a77('0x33'),Date[_0x7a77('0x2d')](),_0x5b7764['originalname']));}})});router[_0x7a77('0x25')](_0x7a77('0x15'),upload['single'](_0x7a77('0x30')),controller[_0x7a77('0x34')]);var upload=multer({'storage':multer[_0x7a77('0x29')]({'destination':function(_0x287132,_0x298997,_0x45e530){_0x45e530(null,path[_0x7a77('0x2a')](config[_0x7a77('0x32')],_0x7a77('0x35')));},'filename':function(_0x5bb6,_0x4b0e12,_0x336743){_0x336743(null,util['format'](_0x7a77('0x33'),Date['now'](),_0x4b0e12[_0x7a77('0x2e')]));}})});router['post'](_0x7a77('0x36'),upload[_0x7a77('0x2f')](_0x7a77('0x30')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x7a77('0x29')]({'destination':function(_0x477e7,_0x186b38,_0x3efe96){_0x3efe96(null,path[_0x7a77('0x2a')](config[_0x7a77('0x32')],_0x7a77('0x35')));},'filename':function(_0x4ee76d,_0x21545c,_0x23b6de){_0x23b6de(null,util['format'](_0x7a77('0x33'),Date[_0x7a77('0x2d')](),_0x21545c[_0x7a77('0x2e')]));}})});router[_0x7a77('0x25')](_0x7a77('0x37'),upload[_0x7a77('0x2f')](_0x7a77('0x30')),controller[_0x7a77('0x38')]);router['post'](_0x7a77('0x39'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x861ac5,_0x1c8515,_0x1de1d5){const _0x3e26fe=path[_0x7a77('0x2a')](config[_0x7a77('0x32')],_0x7a77('0x3a'),_0x7a77('0x3b'),_0x7a77('0x3c'));fs_extra['ensureDir'](_0x3e26fe,function(){_0x1de1d5(null,_0x3e26fe);});},'filename':function(_0x1e7656,_0x3790a6,_0x5620e8){const _0x3a7387=_0x3790a6[_0x7a77('0x2e')][_0x7a77('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1bc53d=path[_0x7a77('0x3e')](_0x3a7387);const _0x5dacf7=Date[_0x7a77('0x2d')]()+'-'+_0x3a7387[_0x7a77('0x3d')](_0x1bc53d,'')+_0x1bc53d;_0x5620e8(null,_0x5dacf7);}})});router[_0x7a77('0x25')](_0x7a77('0x3f'),offlineUploadMulter[_0x7a77('0x40')](),controller['offline']);router['post'](_0x7a77('0x18'),auth[_0x7a77('0xb')](),controller[_0x7a77('0x41')]);router[_0x7a77('0x25')](_0x7a77('0x1b'),auth[_0x7a77('0xb')](),controller[_0x7a77('0x42')]);router[_0x7a77('0x25')](_0x7a77('0x1d'),auth[_0x7a77('0xb')](),controller[_0x7a77('0x43')]);router[_0x7a77('0x25')]('/:id/users',auth[_0x7a77('0xb')](),controller[_0x7a77('0x44')]);router['put'](_0x7a77('0xf'),auth[_0x7a77('0xb')](),controller['update']);router['delete']('/:id',auth[_0x7a77('0xb')](),controller[_0x7a77('0x45')]);router[_0x7a77('0x46')](_0x7a77('0x10'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x7a77('0x46')](_0x7a77('0x47'),auth['isAuthenticated'](),controller[_0x7a77('0x48')]);router[_0x7a77('0x46')]('/:id/users',auth[_0x7a77('0xb')](),controller['removeAgents']);module[_0x7a77('0x49')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 6a00175..67e3dfc 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 _0x6f44=['ENUM','AmazonAWS','Google','STRING','sequelize','exports'];(function(_0x5c5c52,_0x36d085){var _0x4229ff=function(_0x3806df){while(--_0x3806df){_0x5c5c52['push'](_0x5c5c52['shift']());}};_0x4229ff(++_0x36d085);}(_0x6f44,0x1ea));var _0x46f4=function(_0x44e8b8,_0x7e2295){_0x44e8b8=_0x44e8b8-0x0;var _0x4acf3b=_0x6f44[_0x44e8b8];return _0x4acf3b;};'use strict';var Sequelize=require(_0x46f4('0x0'));module[_0x46f4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x46f4('0x2')](_0x46f4('0x3'),_0x46f4('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x46f4('0x5')]},'data2':{'type':Sequelize[_0x46f4('0x5')]}};
\ No newline at end of file
+var _0xb39f=['STRING','ENUM','sequelize','exports'];(function(_0x392dbc,_0x4d31cf){var _0x119302=function(_0x250580){while(--_0x250580){_0x392dbc['push'](_0x392dbc['shift']());}};_0x119302(++_0x4d31cf);}(_0xb39f,0x1e6));var _0xfb39=function(_0x3443de,_0x6e4cd3){_0x3443de=_0x3443de-0x0;var _0x3cf23b=_0xb39f[_0x3443de];return _0x3cf23b;};'use strict';var Sequelize=require(_0xfb39('0x0'));module[_0xfb39('0x1')]={'name':{'type':Sequelize[_0xfb39('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xfb39('0x3')]('AmazonAWS','Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xfb39('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index e2b6ebd..56d094c 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 _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x574797,_0x15f63b){_0x574797=_0x574797-0x0;var _0x1bed4f=_0x5f2f[_0x574797];return _0x1bed4f;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};
\ No newline at end of file
+var _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x38b06c,_0x423b3e){var _0x5d8ed2=function(_0x5132f9){while(--_0x5132f9){_0x38b06c['push'](_0x38b06c['shift']());}};_0x5d8ed2(++_0x423b3e);}(_0xdb28,0x106));var _0x8db2=function(_0x52d969,_0x352fd5){_0x52d969=_0x52d969-0x0;var _0x4da6e0=_0xdb28[_0x52d969];return _0x4da6e0;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index f724b10..f12d35b 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 _0xef33=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash'];(function(_0x5a07a1,_0x5a3fb2){var _0x5c7c75=function(_0x28ce71){while(--_0x28ce71){_0x5a07a1['push'](_0x5a07a1['shift']());}};_0x5c7c75(++_0x5a3fb2);}(_0xef33,0x12b));var _0x3ef3=function(_0xd4d04f,_0x50ef03){_0xd4d04f=_0xd4d04f-0x0;var _0x2e21d6=_0xef33[_0xd4d04f];return _0x2e21d6;};'use strict';var _=require(_0x3ef3('0x0'));var util=require('util');var logger=require(_0x3ef3('0x1'))(_0x3ef3('0x2'));var moment=require(_0x3ef3('0x3'));var BPromise=require(_0x3ef3('0x4'));var rp=require(_0x3ef3('0x5'));var fs=require('fs');var path=require(_0x3ef3('0x6'));var rimraf=require(_0x3ef3('0x7'));var config=require('../../config/environment');var attributes=require(_0x3ef3('0x8'));module[_0x3ef3('0x9')]=function(_0x48f4e1,_0x1e92ae){return _0x48f4e1['define'](_0x3ef3('0xa'),attributes,{'tableName':_0x3ef3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb94e=['CloudProvider','cloud_providers','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','define'];(function(_0x9b5afc,_0x4360fd){var _0x15295e=function(_0x959ec2){while(--_0x959ec2){_0x9b5afc['push'](_0x9b5afc['shift']());}};_0x15295e(++_0x4360fd);}(_0xb94e,0x7b));var _0xeb94=function(_0xc302ab,_0x5b12ee){_0xc302ab=_0xc302ab-0x0;var _0x6b8209=_0xb94e[_0xc302ab];return _0x6b8209;};'use strict';var _=require(_0xeb94('0x0'));var util=require(_0xeb94('0x1'));var logger=require(_0xeb94('0x2'))('api');var moment=require('moment');var BPromise=require(_0xeb94('0x3'));var rp=require(_0xeb94('0x4'));var fs=require('fs');var path=require(_0xeb94('0x5'));var rimraf=require('rimraf');var config=require(_0xeb94('0x6'));var attributes=require(_0xeb94('0x7'));module['exports']=function(_0xbed1da,_0x1e18e3){return _0xbed1da[_0xeb94('0x8')](_0xeb94('0x9'),attributes,{'tableName':_0xeb94('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index acba678..608ac5b 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 _0xd10f=['../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xd10f,0x198));var _0xfd10=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd10f[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xfd10('0x0'));var util=require(_0xfd10('0x1'));var moment=require(_0xfd10('0x2'));var BPromise=require(_0xfd10('0x3'));var rs=require(_0xfd10('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd10('0x5'))['db'];var utils=require(_0xfd10('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfd10('0x7'));var jayson=require(_0xfd10('0x8'));var client=jayson[_0xfd10('0x9')][_0xfd10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21610f,_0x10db32,_0xef584f){return new BPromise(function(_0x3ed592,_0x509cd6){return client[_0xfd10('0xb')](_0x21610f,_0xef584f)[_0xfd10('0xc')](function(_0x507ae0){logger[_0xfd10('0xd')](_0xfd10('0xe'),_0x10db32,_0xfd10('0xf'));logger[_0xfd10('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x10db32,'request\x20sent',JSON[_0xfd10('0x11')](_0x507ae0));if(_0x507ae0[_0xfd10('0x12')]){if(_0x507ae0['error'][_0xfd10('0x13')]===0x1f4){logger[_0xfd10('0x12')](_0xfd10('0xe'),_0x10db32,_0x507ae0[_0xfd10('0x12')][_0xfd10('0x14')]);return _0x509cd6(_0x507ae0[_0xfd10('0x12')][_0xfd10('0x14')]);}logger[_0xfd10('0x12')](_0xfd10('0xe'),_0x10db32,_0x507ae0[_0xfd10('0x12')][_0xfd10('0x14')]);return _0x3ed592(_0x507ae0[_0xfd10('0x12')][_0xfd10('0x14')]);}else{logger[_0xfd10('0xd')](_0xfd10('0xe'),_0x10db32,_0xfd10('0xf'));_0x3ed592(_0x507ae0[_0xfd10('0x15')][_0xfd10('0x14')]);}})[_0xfd10('0x16')](function(_0x1d0f8f){logger[_0xfd10('0x12')](_0xfd10('0xe'),_0x10db32,_0x1d0f8f);_0x509cd6(_0x1d0f8f);});});}
\ No newline at end of file
+var _0x6302=['moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','then','CloudProvider,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util'];(function(_0x5649c2,_0x5c8d04){var _0x28b072=function(_0x17c1a0){while(--_0x17c1a0){_0x5649c2['push'](_0x5649c2['shift']());}};_0x28b072(++_0x5c8d04);}(_0x6302,0x109));var _0x2630=function(_0x199497,_0x33dc54){_0x199497=_0x199497-0x0;var _0x15b282=_0x6302[_0x199497];return _0x15b282;};'use strict';var _=require('lodash');var util=require(_0x2630('0x0'));var moment=require(_0x2630('0x1'));var BPromise=require(_0x2630('0x2'));var rs=require(_0x2630('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2630('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x2630('0x5'));var jayson=require(_0x2630('0x6'));var client=jayson[_0x2630('0x7')][_0x2630('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2867f8,_0x19231a,_0x2e1867){return new BPromise(function(_0x353f73,_0x581f4d){return client['request'](_0x2867f8,_0x2e1867)[_0x2630('0x9')](function(_0x10ffdf){logger['info'](_0x2630('0xa'),_0x19231a,'request\x20sent');logger[_0x2630('0xb')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x19231a,_0x2630('0xc'),JSON[_0x2630('0xd')](_0x10ffdf));if(_0x10ffdf[_0x2630('0xe')]){if(_0x10ffdf[_0x2630('0xe')][_0x2630('0xf')]===0x1f4){logger[_0x2630('0xe')]('CloudProvider,\x20%s,\x20%s',_0x19231a,_0x10ffdf[_0x2630('0xe')][_0x2630('0x10')]);return _0x581f4d(_0x10ffdf[_0x2630('0xe')][_0x2630('0x10')]);}logger['error'](_0x2630('0xa'),_0x19231a,_0x10ffdf[_0x2630('0xe')][_0x2630('0x10')]);return _0x353f73(_0x10ffdf['error'][_0x2630('0x10')]);}else{logger['info'](_0x2630('0xa'),_0x19231a,_0x2630('0xc'));_0x353f73(_0x10ffdf[_0x2630('0x11')][_0x2630('0x10')]);}})[_0x2630('0x12')](function(_0x18b2b0){logger[_0x2630('0xe')](_0x2630('0xa'),_0x19231a,_0x18b2b0);_0x581f4d(_0x18b2b0);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index a133a2b..71c6f16 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 _0x3f96=['/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','index','get'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0x3f96,0x1d3));var _0x63f9=function(_0x124a01,_0x280aa9){_0x124a01=_0x124a01-0x0;var _0x5e97d9=_0x3f96[_0x124a01];return _0x5e97d9;};'use strict';var multer=require(_0x63f9('0x0'));var util=require(_0x63f9('0x1'));var path=require(_0x63f9('0x2'));var timeout=require(_0x63f9('0x3'));var express=require(_0x63f9('0x4'));var router=express['Router']();var fs_extra=require(_0x63f9('0x5'));var auth=require(_0x63f9('0x6'));var interaction=require(_0x63f9('0x7'));var config=require(_0x63f9('0x8'));var controller=require(_0x63f9('0x9'));router['get']('/',auth[_0x63f9('0xa')](),controller[_0x63f9('0xb')]);router[_0x63f9('0xc')](_0x63f9('0xd'),auth['isAuthenticated'](),controller[_0x63f9('0xe')]);router[_0x63f9('0xf')]('/',auth[_0x63f9('0xa')](),controller[_0x63f9('0x10')]);router[_0x63f9('0x11')](_0x63f9('0xd'),auth[_0x63f9('0xa')](),controller[_0x63f9('0x12')]);router['delete'](_0x63f9('0xd'),auth[_0x63f9('0xa')](),controller['destroy']);module[_0x63f9('0x13')]=router;
\ No newline at end of file
+var _0xfbb5=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x4fc676,_0x8e397d){var _0x2a991f=function(_0x10a7ce){while(--_0x10a7ce){_0x4fc676['push'](_0x4fc676['shift']());}};_0x2a991f(++_0x8e397d);}(_0xfbb5,0xc6));var _0x5fbb=function(_0x1f4c31,_0x5d6735){_0x1f4c31=_0x1f4c31-0x0;var _0x1d95d5=_0xfbb5[_0x1f4c31];return _0x1d95d5;};'use strict';var multer=require(_0x5fbb('0x0'));var util=require(_0x5fbb('0x1'));var path=require(_0x5fbb('0x2'));var timeout=require(_0x5fbb('0x3'));var express=require(_0x5fbb('0x4'));var router=express[_0x5fbb('0x5')]();var fs_extra=require(_0x5fbb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5fbb('0x7'));var config=require(_0x5fbb('0x8'));var controller=require('./cloudProvider.controller');router['get']('/',auth[_0x5fbb('0x9')](),controller[_0x5fbb('0xa')]);router[_0x5fbb('0xb')](_0x5fbb('0xc'),auth[_0x5fbb('0x9')](),controller[_0x5fbb('0xd')]);router[_0x5fbb('0xe')]('/',auth[_0x5fbb('0x9')](),controller[_0x5fbb('0xf')]);router[_0x5fbb('0x10')](_0x5fbb('0xc'),auth[_0x5fbb('0x9')](),controller[_0x5fbb('0x11')]);router[_0x5fbb('0x12')]('/:id',auth[_0x5fbb('0x9')](),controller[_0x5fbb('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index da8e570..2f2cc41 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 _0x644f=['sequelize','exports','STRING','name'];(function(_0x46add2,_0x4346d4){var _0x226d64=function(_0x11ae18){while(--_0x11ae18){_0x46add2['push'](_0x46add2['shift']());}};_0x226d64(++_0x4346d4);}(_0x644f,0x190));var _0xf644=function(_0x2265da,_0xfbbd2e){_0x2265da=_0x2265da-0x0;var _0x430c2b=_0x644f[_0x2265da];return _0x430c2b;};'use strict';var Sequelize=require(_0xf644('0x0'));module[_0xf644('0x1')]={'name':{'type':Sequelize[_0xf644('0x2')],'unique':_0xf644('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf644('0x2')]},'companyId':{'type':Sequelize[_0xf644('0x2')]},'website':{'type':Sequelize[_0xf644('0x2')]},'phone':{'type':Sequelize[_0xf644('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf644('0x2')]},'street':{'type':Sequelize[_0xf644('0x2')]},'postalCode':{'type':Sequelize[_0xf644('0x2')]},'city':{'type':Sequelize[_0xf644('0x2')]},'country':{'type':Sequelize[_0xf644('0x2')]},'email':{'type':Sequelize[_0xf644('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf644('0x2')]},'sStreet':{'type':Sequelize[_0xf644('0x2')]},'sPostalCode':{'type':Sequelize[_0xf644('0x2')]},'sCity':{'type':Sequelize[_0xf644('0x2')]},'sCountry':{'type':Sequelize[_0xf644('0x2')]},'description':{'type':Sequelize[_0xf644('0x2')]}};
\ No newline at end of file
+var _0xec15=['exports','STRING','sequelize'];(function(_0x582bef,_0x407e89){var _0x218ecd=function(_0x30c5a4){while(--_0x30c5a4){_0x582bef['push'](_0x582bef['shift']());}};_0x218ecd(++_0x407e89);}(_0xec15,0x1bb));var _0x5ec1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec15[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x5ec1('0x0'));module[_0x5ec1('0x1')]={'name':{'type':Sequelize[_0x5ec1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x5ec1('0x2')]},'website':{'type':Sequelize[_0x5ec1('0x2')]},'phone':{'type':Sequelize[_0x5ec1('0x2')]},'fax':{'type':Sequelize[_0x5ec1('0x2')]},'type':{'type':Sequelize[_0x5ec1('0x2')]},'street':{'type':Sequelize[_0x5ec1('0x2')]},'postalCode':{'type':Sequelize[_0x5ec1('0x2')]},'city':{'type':Sequelize[_0x5ec1('0x2')]},'country':{'type':Sequelize[_0x5ec1('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x5ec1('0x2')]},'sPostalCode':{'type':Sequelize[_0x5ec1('0x2')]},'sCity':{'type':Sequelize[_0x5ec1('0x2')]},'sCountry':{'type':Sequelize[_0x5ec1('0x2')]},'description':{'type':Sequelize[_0x5ec1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index d68ba36..3bcf44f 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 _0xbe5a=['merge','filter','options','CmCompany','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addContacts','ids','getContacts','findOne','CmContact','map','hasOwnProperty','nolimit','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','offset','undefined','limit','count','json','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','describe','model','keys','query','filters','intersection','attributes','fields','length','order','sort','pick','where'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbe5a,0x75));var _0xabe5=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xbe5a[_0x28aea5];return _0x6a55f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xabe5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xabe5('0x1'));var rp=require(_0xabe5('0x2'));var moment=require(_0xabe5('0x3'));var BPromise=require(_0xabe5('0x4'));var Mustache=require(_0xabe5('0x5'));var util=require(_0xabe5('0x6'));var path=require(_0xabe5('0x7'));var sox=require(_0xabe5('0x8'));var csv=require(_0xabe5('0x9'));var ejs=require(_0xabe5('0xa'));var fs=require('fs');var fs_extra=require(_0xabe5('0xb'));var _=require(_0xabe5('0xc'));var squel=require(_0xabe5('0xd'));var crypto=require(_0xabe5('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xabe5('0x9'));var querystring=require(_0xabe5('0xf'));var Papa=require(_0xabe5('0x10'));var Redis=require(_0xabe5('0x11'));var authService=require(_0xabe5('0x12'));var qs=require(_0xabe5('0x13'));var as=require(_0xabe5('0x14'));var hardwareService=require(_0xabe5('0x15'));var logger=require(_0xabe5('0x16'))(_0xabe5('0x17'));var utils=require(_0xabe5('0x18'));var config=require(_0xabe5('0x19'));var licenseUtil=require(_0xabe5('0x1a'));var db=require(_0xabe5('0x1b'))['db'];function respondWithStatusCode(_0x1231e2,_0x5cca47){_0x5cca47=_0x5cca47||0xcc;return function(_0x1f3685){if(_0x1f3685){return _0x1231e2[_0xabe5('0x1c')](_0x5cca47);}return _0x1231e2[_0xabe5('0x1d')](_0x5cca47)[_0xabe5('0x1e')]();};}function respondWithResult(_0x16d5ce,_0x1f2282){_0x1f2282=_0x1f2282||0xc8;return function(_0xb42547){if(_0xb42547){return _0x16d5ce['status'](_0x1f2282)['json'](_0xb42547);}};}function respondWithFilteredResult(_0xe1825c,_0x510985){return function(_0x33ff92){if(_0x33ff92){var _0x4ce082=typeof _0x510985[_0xabe5('0x1f')]===_0xabe5('0x20')&&typeof _0x510985[_0xabe5('0x21')]===_0xabe5('0x20');var _0xe51f5=_0x33ff92['count'];var _0x4f74ed=_0x4ce082?0x0:_0x510985[_0xabe5('0x1f')];var _0x1f1e54=_0x4ce082?_0x33ff92[_0xabe5('0x22')]:_0x510985[_0xabe5('0x1f')]+_0x510985[_0xabe5('0x21')];var _0x163b02;if(_0x1f1e54>=_0xe51f5){_0x1f1e54=_0xe51f5;_0x163b02=0xc8;}else{_0x163b02=0xce;}_0xe1825c[_0xabe5('0x1d')](_0x163b02);return _0xe1825c['set']('Content-Range',_0x4f74ed+'-'+_0x1f1e54+'/'+_0xe51f5)[_0xabe5('0x23')](_0x33ff92);}return null;};}function patchUpdates(_0x56612e){return function(_0x52eaec){try{jsonpatch['apply'](_0x52eaec,_0x56612e,!![]);}catch(_0x366478){return BPromise[_0xabe5('0x24')](_0x366478);}return _0x52eaec[_0xabe5('0x25')]();};}function saveUpdates(_0x4b0e2d,_0x50ea87){return function(_0x298f85){if(_0x298f85){return _0x298f85[_0xabe5('0x26')](_0x4b0e2d)[_0xabe5('0x27')](function(_0x27194f){return _0x27194f;});}return null;};}function removeEntity(_0xaaeb92,_0x1a40e1){return function(_0x5b040d){if(_0x5b040d){return _0x5b040d[_0xabe5('0x28')]()[_0xabe5('0x27')](function(){var _0x13fb5e=_0x5b040d[_0xabe5('0x29')]({'plain':!![]});var _0x227315=_0xabe5('0x2a');return db[_0xabe5('0x2b')][_0xabe5('0x28')]({'where':{'type':_0x227315,'resourceId':_0x13fb5e['id']}})[_0xabe5('0x27')](function(){return _0x5b040d;});})['then'](function(){_0xaaeb92[_0xabe5('0x1d')](0xcc)[_0xabe5('0x1e')]();});}};}function handleEntityNotFound(_0xfdf0e8,_0x41f525){return function(_0x111bcf){if(!_0x111bcf){_0xfdf0e8[_0xabe5('0x1c')](0x194);}return _0x111bcf;};}function handleError(_0x5b0c32,_0x293811){_0x293811=_0x293811||0x1f4;return function(_0x2e65f1){logger[_0xabe5('0x2c')](_0x2e65f1[_0xabe5('0x2d')]);if(_0x2e65f1[_0xabe5('0x2e')]){delete _0x2e65f1[_0xabe5('0x2e')];}_0x5b0c32[_0xabe5('0x1d')](_0x293811)[_0xabe5('0x2f')](_0x2e65f1);};}exports['index']=function(_0x330007,_0x4a9417){var _0x2a436e={},_0x4126c7={},_0xd4bc9a={'count':0x0,'rows':[]};return db['CmCompany'][_0xabe5('0x30')]()[_0xabe5('0x27')](function(_0x36d3c2){_0x4126c7[_0xabe5('0x31')]=_[_0xabe5('0x32')](_0x36d3c2);_0x4126c7[_0xabe5('0x33')]=_[_0xabe5('0x32')](_0x330007[_0xabe5('0x33')]);_0x4126c7[_0xabe5('0x34')]=_[_0xabe5('0x35')](_0x4126c7[_0xabe5('0x31')],_0x4126c7[_0xabe5('0x33')]);_0x2a436e[_0xabe5('0x36')]=_[_0xabe5('0x35')](_0x4126c7[_0xabe5('0x31')],qs[_0xabe5('0x37')](_0x330007[_0xabe5('0x33')][_0xabe5('0x37')]));_0x2a436e[_0xabe5('0x36')]=_0x2a436e[_0xabe5('0x36')][_0xabe5('0x38')]?_0x2a436e['attributes']:_0x4126c7[_0xabe5('0x31')];if(!_0x330007['query']['hasOwnProperty']('nolimit')){_0x2a436e[_0xabe5('0x21')]=qs['limit'](_0x330007[_0xabe5('0x33')]['limit']);_0x2a436e[_0xabe5('0x1f')]=qs['offset'](_0x330007[_0xabe5('0x33')][_0xabe5('0x1f')]);}_0x2a436e[_0xabe5('0x39')]=qs[_0xabe5('0x3a')](_0x330007[_0xabe5('0x33')]['sort']);_0x2a436e['where']=qs[_0xabe5('0x34')](_[_0xabe5('0x3b')](_0x330007[_0xabe5('0x33')],_0x4126c7[_0xabe5('0x34')]),_0x36d3c2);if(_0x330007['query']['filter']){_0x2a436e[_0xabe5('0x3c')]=_[_0xabe5('0x3d')](_0x2a436e[_0xabe5('0x3c')],{'$or':_['map'](_0x2a436e[_0xabe5('0x36')],function(_0x18e3b8){var _0x482ef4={};_0x482ef4[_0x18e3b8]={'$like':'%'+_0x330007[_0xabe5('0x33')][_0xabe5('0x3e')]+'%'};return _0x482ef4;})});}_0x2a436e=_[_0xabe5('0x3d')]({},_0x2a436e,_0x330007[_0xabe5('0x3f')]);var _0x207c48={'where':_0x2a436e[_0xabe5('0x3c')]};return db[_0xabe5('0x40')][_0xabe5('0x22')](_0x207c48)[_0xabe5('0x27')](function(_0x454bd7){_0xd4bc9a[_0xabe5('0x22')]=_0x454bd7;if(_0x330007[_0xabe5('0x33')][_0xabe5('0x41')]){_0x2a436e[_0xabe5('0x42')]=[{'all':!![]}];}return db[_0xabe5('0x40')][_0xabe5('0x43')](_0x2a436e);})[_0xabe5('0x27')](function(_0x320cbe){_0xd4bc9a[_0xabe5('0x44')]=_0x320cbe;return _0xd4bc9a;})[_0xabe5('0x27')](respondWithFilteredResult(_0x4a9417,_0x2a436e))[_0xabe5('0x45')](handleError(_0x4a9417,null));})[_0xabe5('0x45')](handleError(_0x4a9417,null));};exports[_0xabe5('0x46')]=function(_0x4ab9fe,_0x4ae0c9){var _0x2c08e2={'raw':![],'where':{'id':_0x4ab9fe[_0xabe5('0x47')]['id']}},_0x1bf859={};_0x1bf859[_0xabe5('0x31')]=_[_0xabe5('0x32')](db['CmCompany']['rawAttributes']);_0x1bf859[_0xabe5('0x33')]=_[_0xabe5('0x32')](_0x4ab9fe[_0xabe5('0x33')]);_0x1bf859[_0xabe5('0x34')]=_[_0xabe5('0x35')](_0x1bf859[_0xabe5('0x31')],_0x1bf859[_0xabe5('0x33')]);_0x2c08e2[_0xabe5('0x36')]=_[_0xabe5('0x35')](_0x1bf859['model'],qs[_0xabe5('0x37')](_0x4ab9fe[_0xabe5('0x33')][_0xabe5('0x37')]));_0x2c08e2[_0xabe5('0x36')]=_0x2c08e2[_0xabe5('0x36')][_0xabe5('0x38')]?_0x2c08e2[_0xabe5('0x36')]:_0x1bf859[_0xabe5('0x31')];if(_0x4ab9fe[_0xabe5('0x33')][_0xabe5('0x41')]){_0x2c08e2[_0xabe5('0x42')]=[{'all':!![]}];}_0x2c08e2=_[_0xabe5('0x3d')]({},_0x2c08e2,_0x4ab9fe[_0xabe5('0x3f')]);return db[_0xabe5('0x40')]['find'](_0x2c08e2)[_0xabe5('0x27')](handleEntityNotFound(_0x4ae0c9,null))['then'](respondWithResult(_0x4ae0c9,null))[_0xabe5('0x45')](handleError(_0x4ae0c9,null));};exports[_0xabe5('0x48')]=function(_0x19ac37,_0x530bca){return db[_0xabe5('0x40')][_0xabe5('0x48')](_0x19ac37[_0xabe5('0x49')],{})['then'](function(_0x184898){var _0x2d662a=_0x19ac37[_0xabe5('0x4a')]['get']({'plain':!![]});if(!_0x2d662a)throw new Error(_0xabe5('0x4b'));if(_0x2d662a[_0xabe5('0x4c')]===_0xabe5('0x4a')){var _0x58be35=_0x184898[_0xabe5('0x29')]({'plain':!![]});var _0x141490=_0xabe5('0x2a');return db[_0xabe5('0x4d')]['find']({'where':{'name':_0x141490,'userProfileId':_0x2d662a['userProfileId']},'raw':!![]})[_0xabe5('0x27')](function(_0x305f25){if(_0x305f25&&_0x305f25[_0xabe5('0x4e')]===0x0){return db[_0xabe5('0x2b')]['create']({'name':_0x58be35[_0xabe5('0x2e')],'resourceId':_0x58be35['id'],'type':_0x305f25[_0xabe5('0x2e')],'sectionId':_0x305f25['id']},{})[_0xabe5('0x27')](function(){return _0x184898;});}else{return _0x184898;}})[_0xabe5('0x45')](function(_0x2290d2){logger[_0xabe5('0x2c')](_0xabe5('0x4f'),_0x2290d2);throw _0x2290d2;});}return _0x184898;})['then'](respondWithResult(_0x530bca,0xc9))[_0xabe5('0x45')](handleError(_0x530bca,null));};exports['update']=function(_0x17ac3d,_0x1953ac){if(_0x17ac3d[_0xabe5('0x49')]['id']){delete _0x17ac3d[_0xabe5('0x49')]['id'];}return db[_0xabe5('0x40')][_0xabe5('0x50')]({'where':{'id':_0x17ac3d[_0xabe5('0x47')]['id']}})[_0xabe5('0x27')](handleEntityNotFound(_0x1953ac,null))[_0xabe5('0x27')](saveUpdates(_0x17ac3d['body'],null))[_0xabe5('0x27')](respondWithResult(_0x1953ac,null))['catch'](handleError(_0x1953ac,null));};exports[_0xabe5('0x28')]=function(_0x230dae,_0x5bb534){return db[_0xabe5('0x40')]['find']({'where':{'id':_0x230dae['params']['id']}})['then'](handleEntityNotFound(_0x5bb534,null))['then'](removeEntity(_0x5bb534,null))['catch'](handleError(_0x5bb534,null));};exports[_0xabe5('0x30')]=function(_0xf597cd,_0xdeb798){return db[_0xabe5('0x40')][_0xabe5('0x30')]()[_0xabe5('0x27')](respondWithResult(_0xdeb798,null))[_0xabe5('0x45')](handleError(_0xdeb798,null));};exports[_0xabe5('0x51')]=function(_0x55660a,_0x2d7eec,_0x16f0d2){return db['CmContact'][_0xabe5('0x50')]({'where':{'id':_0x55660a[_0xabe5('0x47')]['id']}})[_0xabe5('0x27')](handleEntityNotFound(_0x2d7eec,null))[_0xabe5('0x27')](function(_0x5b0abb){if(_0x5b0abb){return _0x5b0abb['addContacts'](_0x55660a['body'][_0xabe5('0x52')],_['omit'](_0x55660a['body'],[_0xabe5('0x52'),'id'])||{});}})[_0xabe5('0x27')](respondWithResult(_0x2d7eec,null))[_0xabe5('0x45')](handleError(_0x2d7eec,null));};exports[_0xabe5('0x53')]=function(_0x34ea57,_0x8008ac,_0x421516){var _0xc8db38={};var _0x2af756={};var _0x41ec9e;var _0x165056;return db[_0xabe5('0x40')][_0xabe5('0x54')]({'where':{'id':_0x34ea57['params']['id']}})['then'](handleEntityNotFound(_0x8008ac,null))[_0xabe5('0x27')](function(_0x88995e){if(_0x88995e){_0x41ec9e=_0x88995e;_0x2af756['model']=_[_0xabe5('0x32')](db[_0xabe5('0x55')]['rawAttributes']);_0x2af756['query']=_[_0xabe5('0x32')](_0x34ea57[_0xabe5('0x33')]);_0x2af756[_0xabe5('0x34')]=_['intersection'](_0x2af756[_0xabe5('0x31')],_0x2af756[_0xabe5('0x33')]);_0xc8db38[_0xabe5('0x36')]=_['intersection'](_0x2af756[_0xabe5('0x31')],qs[_0xabe5('0x37')](_0x34ea57[_0xabe5('0x33')]['fields']));_0xc8db38['attributes']=_0xc8db38[_0xabe5('0x36')][_0xabe5('0x38')]?_0xc8db38[_0xabe5('0x36')]:_0x2af756[_0xabe5('0x31')];_0xc8db38['order']=qs['sort'](_0x34ea57[_0xabe5('0x33')][_0xabe5('0x3a')]);_0xc8db38[_0xabe5('0x3c')]=qs[_0xabe5('0x34')](_[_0xabe5('0x3b')](_0x34ea57[_0xabe5('0x33')],_0x2af756[_0xabe5('0x34')]));if(_0x34ea57[_0xabe5('0x33')][_0xabe5('0x3e')]){_0xc8db38[_0xabe5('0x3c')]=_['merge'](_0xc8db38[_0xabe5('0x3c')],{'$or':_[_0xabe5('0x56')](_0xc8db38[_0xabe5('0x36')],function(_0x2d26de){var _0x2a9242={};_0x2a9242[_0x2d26de]={'$like':'%'+_0x34ea57['query'][_0xabe5('0x3e')]+'%'};return _0x2a9242;})});}_0xc8db38=_[_0xabe5('0x3d')]({},_0xc8db38,_0x34ea57[_0xabe5('0x3f')]);return _0x41ec9e[_0xabe5('0x53')](_0xc8db38);}})[_0xabe5('0x27')](function(_0x4c01c4){if(_0x4c01c4){_0x165056=_0x4c01c4[_0xabe5('0x38')];if(!_0x34ea57[_0xabe5('0x33')][_0xabe5('0x57')](_0xabe5('0x58'))){_0xc8db38[_0xabe5('0x21')]=qs[_0xabe5('0x21')](_0x34ea57[_0xabe5('0x33')]['limit']);_0xc8db38['offset']=qs[_0xabe5('0x1f')](_0x34ea57[_0xabe5('0x33')]['offset']);}return _0x41ec9e[_0xabe5('0x53')](_0xc8db38);}})['then'](function(_0x10d126){if(_0x10d126){return _0x10d126?{'count':_0x165056,'rows':_0x10d126}:null;}})[_0xabe5('0x27')](respondWithResult(_0x8008ac,null))[_0xabe5('0x45')](handleError(_0x8008ac,null));};
\ No newline at end of file
+var _0x78f0=['nolimit','limit','order','sort','pick','where','merge','map','filter','options','includeAll','include','findAll','rows','catch','show','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','params','addContacts','ids','omit','hasOwnProperty','getContacts','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','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','../../config/logger','api','../../config/utils','../../config/license/util','status','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','get','Companies','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','attributes','model','fields','length'];(function(_0x644e69,_0x54160e){var _0xa12727=function(_0xdd6d39){while(--_0xdd6d39){_0x644e69['push'](_0x644e69['shift']());}};_0xa12727(++_0x54160e);}(_0x78f0,0x181));var _0x078f=function(_0x4c92fa,_0x21e2da){_0x4c92fa=_0x4c92fa-0x0;var _0xbc129f=_0x78f0[_0x4c92fa];return _0xbc129f;};'use strict';var emlformat=require(_0x078f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x078f('0x1'));var rp=require(_0x078f('0x2'));var moment=require('moment');var BPromise=require(_0x078f('0x3'));var Mustache=require(_0x078f('0x4'));var util=require('util');var path=require(_0x078f('0x5'));var sox=require(_0x078f('0x6'));var csv=require(_0x078f('0x7'));var ejs=require(_0x078f('0x8'));var fs=require('fs');var fs_extra=require(_0x078f('0x9'));var _=require(_0x078f('0xa'));var squel=require(_0x078f('0xb'));var crypto=require('crypto');var jsforce=require(_0x078f('0xc'));var deskjs=require(_0x078f('0xd'));var toCsv=require(_0x078f('0x7'));var querystring=require(_0x078f('0xe'));var Papa=require(_0x078f('0xf'));var Redis=require(_0x078f('0x10'));var authService=require(_0x078f('0x11'));var qs=require(_0x078f('0x12'));var as=require(_0x078f('0x13'));var hardwareService=require(_0x078f('0x14'));var logger=require(_0x078f('0x15'))(_0x078f('0x16'));var utils=require(_0x078f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x078f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59b52f,_0x4c982d){_0x4c982d=_0x4c982d||0xcc;return function(_0x2a8c71){if(_0x2a8c71){return _0x59b52f['sendStatus'](_0x4c982d);}return _0x59b52f[_0x078f('0x19')](_0x4c982d)['end']();};}function respondWithResult(_0x1d568f,_0x526048){_0x526048=_0x526048||0xc8;return function(_0x2d51cf){if(_0x2d51cf){return _0x1d568f[_0x078f('0x19')](_0x526048)[_0x078f('0x1a')](_0x2d51cf);}};}function respondWithFilteredResult(_0x39fc0d,_0x59d289){return function(_0x2b1951){if(_0x2b1951){var _0x3e3c27=typeof _0x59d289[_0x078f('0x1b')]===_0x078f('0x1c')&&typeof _0x59d289['limit']===_0x078f('0x1c');var _0x4f1c5a=_0x2b1951[_0x078f('0x1d')];var _0x2f7aaf=_0x3e3c27?0x0:_0x59d289[_0x078f('0x1b')];var _0x1414c8=_0x3e3c27?_0x2b1951['count']:_0x59d289[_0x078f('0x1b')]+_0x59d289['limit'];var _0x26ee95;if(_0x1414c8>=_0x4f1c5a){_0x1414c8=_0x4f1c5a;_0x26ee95=0xc8;}else{_0x26ee95=0xce;}_0x39fc0d['status'](_0x26ee95);return _0x39fc0d[_0x078f('0x1e')](_0x078f('0x1f'),_0x2f7aaf+'-'+_0x1414c8+'/'+_0x4f1c5a)[_0x078f('0x1a')](_0x2b1951);}return null;};}function patchUpdates(_0x190886){return function(_0x32eeff){try{jsonpatch[_0x078f('0x20')](_0x32eeff,_0x190886,!![]);}catch(_0xf67f8e){return BPromise['reject'](_0xf67f8e);}return _0x32eeff['save']();};}function saveUpdates(_0x285f1b,_0x319bb5){return function(_0x341573){if(_0x341573){return _0x341573[_0x078f('0x21')](_0x285f1b)[_0x078f('0x22')](function(_0x28c4a0){return _0x28c4a0;});}return null;};}function removeEntity(_0x4184cb,_0x38c041){return function(_0x44dcb3){if(_0x44dcb3){return _0x44dcb3[_0x078f('0x23')]()[_0x078f('0x22')](function(){var _0x2c1c1f=_0x44dcb3[_0x078f('0x24')]({'plain':!![]});var _0xa590be=_0x078f('0x25');return db[_0x078f('0x26')]['destroy']({'where':{'type':_0xa590be,'resourceId':_0x2c1c1f['id']}})['then'](function(){return _0x44dcb3;});})['then'](function(){_0x4184cb[_0x078f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bb487,_0x183aa1){return function(_0x4387ce){if(!_0x4387ce){_0x4bb487[_0x078f('0x27')](0x194);}return _0x4387ce;};}function handleError(_0x2e7528,_0x169ea0){_0x169ea0=_0x169ea0||0x1f4;return function(_0x3b7d1c){logger[_0x078f('0x28')](_0x3b7d1c[_0x078f('0x29')]);if(_0x3b7d1c[_0x078f('0x2a')]){delete _0x3b7d1c['name'];}_0x2e7528[_0x078f('0x19')](_0x169ea0)[_0x078f('0x2b')](_0x3b7d1c);};}exports[_0x078f('0x2c')]=function(_0x5502e4,_0x375367){var _0x5a05e8={},_0x4b0f06={},_0x1f88a0={'count':0x0,'rows':[]};return db[_0x078f('0x2d')][_0x078f('0x2e')]()['then'](function(_0x136700){_0x4b0f06['model']=_[_0x078f('0x2f')](_0x136700);_0x4b0f06[_0x078f('0x30')]=_[_0x078f('0x2f')](_0x5502e4[_0x078f('0x30')]);_0x4b0f06[_0x078f('0x31')]=_[_0x078f('0x32')](_0x4b0f06['model'],_0x4b0f06['query']);_0x5a05e8[_0x078f('0x33')]=_['intersection'](_0x4b0f06[_0x078f('0x34')],qs[_0x078f('0x35')](_0x5502e4['query']['fields']));_0x5a05e8[_0x078f('0x33')]=_0x5a05e8[_0x078f('0x33')][_0x078f('0x36')]?_0x5a05e8[_0x078f('0x33')]:_0x4b0f06[_0x078f('0x34')];if(!_0x5502e4[_0x078f('0x30')]['hasOwnProperty'](_0x078f('0x37'))){_0x5a05e8[_0x078f('0x38')]=qs[_0x078f('0x38')](_0x5502e4[_0x078f('0x30')]['limit']);_0x5a05e8['offset']=qs[_0x078f('0x1b')](_0x5502e4[_0x078f('0x30')][_0x078f('0x1b')]);}_0x5a05e8[_0x078f('0x39')]=qs[_0x078f('0x3a')](_0x5502e4[_0x078f('0x30')]['sort']);_0x5a05e8['where']=qs[_0x078f('0x31')](_[_0x078f('0x3b')](_0x5502e4['query'],_0x4b0f06[_0x078f('0x31')]),_0x136700);if(_0x5502e4['query']['filter']){_0x5a05e8[_0x078f('0x3c')]=_[_0x078f('0x3d')](_0x5a05e8[_0x078f('0x3c')],{'$or':_[_0x078f('0x3e')](_0x5a05e8['attributes'],function(_0xe7ab75){var _0x3c2316={};_0x3c2316[_0xe7ab75]={'$like':'%'+_0x5502e4['query'][_0x078f('0x3f')]+'%'};return _0x3c2316;})});}_0x5a05e8=_[_0x078f('0x3d')]({},_0x5a05e8,_0x5502e4[_0x078f('0x40')]);var _0x1c5ccf={'where':_0x5a05e8[_0x078f('0x3c')]};return db[_0x078f('0x2d')][_0x078f('0x1d')](_0x1c5ccf)[_0x078f('0x22')](function(_0x5b67ee){_0x1f88a0[_0x078f('0x1d')]=_0x5b67ee;if(_0x5502e4[_0x078f('0x30')][_0x078f('0x41')]){_0x5a05e8[_0x078f('0x42')]=[{'all':!![]}];}return db['CmCompany'][_0x078f('0x43')](_0x5a05e8);})['then'](function(_0x5733bc){_0x1f88a0[_0x078f('0x44')]=_0x5733bc;return _0x1f88a0;})['then'](respondWithFilteredResult(_0x375367,_0x5a05e8))['catch'](handleError(_0x375367,null));})[_0x078f('0x45')](handleError(_0x375367,null));};exports[_0x078f('0x46')]=function(_0x3b78a8,_0x5e9e88){var _0x9cae30={'raw':![],'where':{'id':_0x3b78a8['params']['id']}},_0x40bf81={};_0x40bf81[_0x078f('0x34')]=_[_0x078f('0x2f')](db[_0x078f('0x2d')][_0x078f('0x47')]);_0x40bf81[_0x078f('0x30')]=_[_0x078f('0x2f')](_0x3b78a8['query']);_0x40bf81[_0x078f('0x31')]=_[_0x078f('0x32')](_0x40bf81['model'],_0x40bf81[_0x078f('0x30')]);_0x9cae30[_0x078f('0x33')]=_[_0x078f('0x32')](_0x40bf81[_0x078f('0x34')],qs[_0x078f('0x35')](_0x3b78a8[_0x078f('0x30')][_0x078f('0x35')]));_0x9cae30['attributes']=_0x9cae30[_0x078f('0x33')][_0x078f('0x36')]?_0x9cae30[_0x078f('0x33')]:_0x40bf81[_0x078f('0x34')];if(_0x3b78a8[_0x078f('0x30')][_0x078f('0x41')]){_0x9cae30['include']=[{'all':!![]}];}_0x9cae30=_['merge']({},_0x9cae30,_0x3b78a8[_0x078f('0x40')]);return db[_0x078f('0x2d')][_0x078f('0x48')](_0x9cae30)[_0x078f('0x22')](handleEntityNotFound(_0x5e9e88,null))['then'](respondWithResult(_0x5e9e88,null))[_0x078f('0x45')](handleError(_0x5e9e88,null));};exports[_0x078f('0x49')]=function(_0x317576,_0x434d00){return db['CmCompany'][_0x078f('0x49')](_0x317576[_0x078f('0x4a')],{})[_0x078f('0x22')](function(_0x4ba184){var _0x19e68b=_0x317576[_0x078f('0x4b')][_0x078f('0x24')]({'plain':!![]});if(!_0x19e68b)throw new Error(_0x078f('0x4c'));if(_0x19e68b[_0x078f('0x4d')]===_0x078f('0x4b')){var _0x591946=_0x4ba184[_0x078f('0x24')]({'plain':!![]});var _0x398e5f=_0x078f('0x25');return db[_0x078f('0x4e')]['find']({'where':{'name':_0x398e5f,'userProfileId':_0x19e68b[_0x078f('0x4f')]},'raw':!![]})['then'](function(_0x72a76f){if(_0x72a76f&&_0x72a76f[_0x078f('0x50')]===0x0){return db['UserProfileResource'][_0x078f('0x49')]({'name':_0x591946[_0x078f('0x2a')],'resourceId':_0x591946['id'],'type':_0x72a76f[_0x078f('0x2a')],'sectionId':_0x72a76f['id']},{})[_0x078f('0x22')](function(){return _0x4ba184;});}else{return _0x4ba184;}})[_0x078f('0x45')](function(_0x36538a){logger[_0x078f('0x28')](_0x078f('0x51'),_0x36538a);throw _0x36538a;});}return _0x4ba184;})[_0x078f('0x22')](respondWithResult(_0x434d00,0xc9))[_0x078f('0x45')](handleError(_0x434d00,null));};exports['update']=function(_0x191733,_0x390f2){if(_0x191733[_0x078f('0x4a')]['id']){delete _0x191733[_0x078f('0x4a')]['id'];}return db[_0x078f('0x2d')]['find']({'where':{'id':_0x191733[_0x078f('0x52')]['id']}})[_0x078f('0x22')](handleEntityNotFound(_0x390f2,null))['then'](saveUpdates(_0x191733[_0x078f('0x4a')],null))[_0x078f('0x22')](respondWithResult(_0x390f2,null))['catch'](handleError(_0x390f2,null));};exports[_0x078f('0x23')]=function(_0x44dc71,_0x4696e8){return db[_0x078f('0x2d')][_0x078f('0x48')]({'where':{'id':_0x44dc71[_0x078f('0x52')]['id']}})['then'](handleEntityNotFound(_0x4696e8,null))['then'](removeEntity(_0x4696e8,null))['catch'](handleError(_0x4696e8,null));};exports[_0x078f('0x2e')]=function(_0x372ab6,_0x4f9488){return db[_0x078f('0x2d')][_0x078f('0x2e')]()['then'](respondWithResult(_0x4f9488,null))['catch'](handleError(_0x4f9488,null));};exports[_0x078f('0x53')]=function(_0x560222,_0x595b20,_0x3a42af){return db['CmContact']['find']({'where':{'id':_0x560222[_0x078f('0x52')]['id']}})[_0x078f('0x22')](handleEntityNotFound(_0x595b20,null))[_0x078f('0x22')](function(_0x35127f){if(_0x35127f){return _0x35127f['addContacts'](_0x560222[_0x078f('0x4a')][_0x078f('0x54')],_[_0x078f('0x55')](_0x560222[_0x078f('0x4a')],[_0x078f('0x54'),'id'])||{});}})[_0x078f('0x22')](respondWithResult(_0x595b20,null))[_0x078f('0x45')](handleError(_0x595b20,null));};exports['getContacts']=function(_0x19ac25,_0x44144c,_0x5f2677){var _0x47e002={};var _0x483e8={};var _0x40f21d;var _0xb05314;return db[_0x078f('0x2d')]['findOne']({'where':{'id':_0x19ac25[_0x078f('0x52')]['id']}})[_0x078f('0x22')](handleEntityNotFound(_0x44144c,null))['then'](function(_0x38ee71){if(_0x38ee71){_0x40f21d=_0x38ee71;_0x483e8[_0x078f('0x34')]=_[_0x078f('0x2f')](db['CmContact'][_0x078f('0x47')]);_0x483e8['query']=_[_0x078f('0x2f')](_0x19ac25[_0x078f('0x30')]);_0x483e8[_0x078f('0x31')]=_['intersection'](_0x483e8[_0x078f('0x34')],_0x483e8[_0x078f('0x30')]);_0x47e002[_0x078f('0x33')]=_[_0x078f('0x32')](_0x483e8['model'],qs[_0x078f('0x35')](_0x19ac25[_0x078f('0x30')][_0x078f('0x35')]));_0x47e002[_0x078f('0x33')]=_0x47e002[_0x078f('0x33')][_0x078f('0x36')]?_0x47e002[_0x078f('0x33')]:_0x483e8[_0x078f('0x34')];_0x47e002[_0x078f('0x39')]=qs[_0x078f('0x3a')](_0x19ac25[_0x078f('0x30')][_0x078f('0x3a')]);_0x47e002[_0x078f('0x3c')]=qs[_0x078f('0x31')](_[_0x078f('0x3b')](_0x19ac25[_0x078f('0x30')],_0x483e8['filters']));if(_0x19ac25[_0x078f('0x30')][_0x078f('0x3f')]){_0x47e002[_0x078f('0x3c')]=_[_0x078f('0x3d')](_0x47e002['where'],{'$or':_[_0x078f('0x3e')](_0x47e002[_0x078f('0x33')],function(_0x4c68c1){var _0x541d55={};_0x541d55[_0x4c68c1]={'$like':'%'+_0x19ac25['query'][_0x078f('0x3f')]+'%'};return _0x541d55;})});}_0x47e002=_[_0x078f('0x3d')]({},_0x47e002,_0x19ac25['options']);return _0x40f21d['getContacts'](_0x47e002);}})['then'](function(_0x179513){if(_0x179513){_0xb05314=_0x179513[_0x078f('0x36')];if(!_0x19ac25['query'][_0x078f('0x56')](_0x078f('0x37'))){_0x47e002[_0x078f('0x38')]=qs[_0x078f('0x38')](_0x19ac25[_0x078f('0x30')][_0x078f('0x38')]);_0x47e002['offset']=qs[_0x078f('0x1b')](_0x19ac25[_0x078f('0x30')]['offset']);}return _0x40f21d[_0x078f('0x57')](_0x47e002);}})['then'](function(_0x367a73){if(_0x367a73){return _0x367a73?{'count':_0xb05314,'rows':_0x367a73}:null;}})['then'](respondWithResult(_0x44144c,null))[_0x078f('0x45')](handleError(_0x44144c,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 6a67a00..fdf57dd 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 _0xd32a=['request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','util','../../config/logger','api','moment','bluebird'];(function(_0xabb9fa,_0xb8acea){var _0x18c7e6=function(_0x324056){while(--_0x324056){_0xabb9fa['push'](_0xabb9fa['shift']());}};_0x18c7e6(++_0xb8acea);}(_0xd32a,0xd3));var _0xad32=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xd32a[_0x576170];return _0x397c70;};'use strict';var _=require('lodash');var util=require(_0xad32('0x0'));var logger=require(_0xad32('0x1'))(_0xad32('0x2'));var moment=require(_0xad32('0x3'));var BPromise=require(_0xad32('0x4'));var rp=require(_0xad32('0x5'));var fs=require('fs');var path=require(_0xad32('0x6'));var rimraf=require(_0xad32('0x7'));var config=require(_0xad32('0x8'));var attributes=require(_0xad32('0x9'));module[_0xad32('0xa')]=function(_0x306432,_0x329d56){return _0x306432['define'](_0xad32('0xb'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x94c2=['request-promise','path','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','api','bluebird'];(function(_0x30cbd2,_0x450576){var _0x13674f=function(_0x554ab6){while(--_0x554ab6){_0x30cbd2['push'](_0x30cbd2['shift']());}};_0x13674f(++_0x450576);}(_0x94c2,0xac));var _0x294c=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x94c2[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x294c('0x0'));var util=require(_0x294c('0x1'));var logger=require('../../config/logger')(_0x294c('0x2'));var moment=require('moment');var BPromise=require(_0x294c('0x3'));var rp=require(_0x294c('0x4'));var fs=require('fs');var path=require(_0x294c('0x5'));var rimraf=require('rimraf');var config=require(_0x294c('0x6'));var attributes=require(_0x294c('0x7'));module[_0x294c('0x8')]=function(_0x1f2f15,_0x100ee1){return _0x1f2f15['define'](_0x294c('0x9'),attributes,{'tableName':_0x294c('0xa'),'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 990a684..c5f35ef 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 _0x0ae9=['result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request\x20sent','debug','error','code','CmCompany,\x20%s,\x20%s','message','info'];(function(_0x2016bb,_0x1ea54d){var _0x78113b=function(_0x70ae0b){while(--_0x70ae0b){_0x2016bb['push'](_0x2016bb['shift']());}};_0x78113b(++_0x1ea54d);}(_0x0ae9,0xac));var _0x90ae=function(_0x428f57,_0x2d44e0){_0x428f57=_0x428f57-0x0;var _0x259d87=_0x0ae9[_0x428f57];return _0x259d87;};'use strict';var _=require(_0x90ae('0x0'));var util=require(_0x90ae('0x1'));var moment=require('moment');var BPromise=require(_0x90ae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x90ae('0x3'))['db'];var utils=require(_0x90ae('0x4'));var logger=require(_0x90ae('0x5'))(_0x90ae('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x90ae('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x401a33,_0xb1ade8,_0x90cb08){return new BPromise(function(_0x5821d7,_0x5baf3f){return client['request'](_0x401a33,_0x90cb08)['then'](function(_0x127d22){logger['info']('CmCompany,\x20%s,\x20%s',_0xb1ade8,_0x90ae('0x8'));logger[_0x90ae('0x9')]('CmCompany,\x20%s,\x20%s,\x20%s',_0xb1ade8,'request\x20sent',JSON['stringify'](_0x127d22));if(_0x127d22[_0x90ae('0xa')]){if(_0x127d22[_0x90ae('0xa')][_0x90ae('0xb')]===0x1f4){logger[_0x90ae('0xa')](_0x90ae('0xc'),_0xb1ade8,_0x127d22[_0x90ae('0xa')]['message']);return _0x5baf3f(_0x127d22[_0x90ae('0xa')][_0x90ae('0xd')]);}logger[_0x90ae('0xa')]('CmCompany,\x20%s,\x20%s',_0xb1ade8,_0x127d22['error'][_0x90ae('0xd')]);return _0x5821d7(_0x127d22[_0x90ae('0xa')][_0x90ae('0xd')]);}else{logger[_0x90ae('0xe')](_0x90ae('0xc'),_0xb1ade8,'request\x20sent');_0x5821d7(_0x127d22[_0x90ae('0xf')][_0x90ae('0xd')]);}})[_0x90ae('0x10')](function(_0x2f0408){logger[_0x90ae('0xa')](_0x90ae('0xc'),_0xb1ade8,_0x2f0408);_0x5baf3f(_0x2f0408);});});}
\ No newline at end of file
+var _0x57f1=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x49c622,_0x56ef86){var _0xb14076=function(_0x2fba33){while(--_0x2fba33){_0x49c622['push'](_0x49c622['shift']());}};_0xb14076(++_0x56ef86);}(_0x57f1,0x19d));var _0x157f=function(_0x1852f4,_0x342dbd){_0x1852f4=_0x1852f4-0x0;var _0x56aa2a=_0x57f1[_0x1852f4];return _0x56aa2a;};'use strict';var _=require(_0x157f('0x0'));var util=require(_0x157f('0x1'));var moment=require(_0x157f('0x2'));var BPromise=require(_0x157f('0x3'));var rs=require(_0x157f('0x4'));var fs=require('fs');var Redis=require(_0x157f('0x5'));var db=require(_0x157f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x157f('0x7'))(_0x157f('0x8'));var config=require(_0x157f('0x9'));var jayson=require(_0x157f('0xa'));var client=jayson['client'][_0x157f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a7e35,_0x5c9a21,_0x2a8f8){return new BPromise(function(_0x5d0f5f,_0x100eef){return client[_0x157f('0xc')](_0x4a7e35,_0x2a8f8)['then'](function(_0x12758a){logger[_0x157f('0xd')](_0x157f('0xe'),_0x5c9a21,'request\x20sent');logger['debug'](_0x157f('0xf'),_0x5c9a21,'request\x20sent',JSON[_0x157f('0x10')](_0x12758a));if(_0x12758a[_0x157f('0x11')]){if(_0x12758a[_0x157f('0x11')][_0x157f('0x12')]===0x1f4){logger['error'](_0x157f('0xe'),_0x5c9a21,_0x12758a[_0x157f('0x11')][_0x157f('0x13')]);return _0x100eef(_0x12758a[_0x157f('0x11')][_0x157f('0x13')]);}logger[_0x157f('0x11')]('CmCompany,\x20%s,\x20%s',_0x5c9a21,_0x12758a['error'][_0x157f('0x13')]);return _0x5d0f5f(_0x12758a[_0x157f('0x11')][_0x157f('0x13')]);}else{logger[_0x157f('0xd')](_0x157f('0xe'),_0x5c9a21,_0x157f('0x14'));_0x5d0f5f(_0x12758a['result'][_0x157f('0x13')]);}})[_0x157f('0x15')](function(_0x57f9aa){logger[_0x157f('0x11')](_0x157f('0xe'),_0x5c9a21,_0x57f9aa);_0x100eef(_0x57f9aa);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 542ed81..5336528 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 _0xf7f6=['destroy','exports','path','express','Router','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/:id','show','/:id/contacts','getContacts','post','put','update','delete'];(function(_0x5f2e17,_0x2de9f2){var _0x388526=function(_0x35b5be){while(--_0x35b5be){_0x5f2e17['push'](_0x5f2e17['shift']());}};_0x388526(++_0x2de9f2);}(_0xf7f6,0x1b7));var _0x6f7f=function(_0x172f21,_0xd55ee4){_0x172f21=_0x172f21-0x0;var _0x589ea2=_0xf7f6[_0x172f21];return _0x589ea2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f7f('0x0'));var timeout=require('connect-timeout');var express=require(_0x6f7f('0x1'));var router=express[_0x6f7f('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6f7f('0x3'));var config=require(_0x6f7f('0x4'));var controller=require(_0x6f7f('0x5'));router[_0x6f7f('0x6')]('/',auth[_0x6f7f('0x7')](),controller[_0x6f7f('0x8')]);router[_0x6f7f('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x6f7f('0x6')](_0x6f7f('0x9'),auth[_0x6f7f('0x7')](),controller[_0x6f7f('0xa')]);router[_0x6f7f('0x6')](_0x6f7f('0xb'),auth[_0x6f7f('0x7')](),controller[_0x6f7f('0xc')]);router[_0x6f7f('0xd')]('/',auth[_0x6f7f('0x7')](),controller['create']);router['post'](_0x6f7f('0xb'),auth['isAuthenticated'](),controller['addContacts']);router[_0x6f7f('0xe')]('/:id',auth[_0x6f7f('0x7')](),controller[_0x6f7f('0xf')]);router[_0x6f7f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6f7f('0x11')]);module[_0x6f7f('0x12')]=router;
\ No newline at end of file
+var _0x5c66=['isAuthenticated','index','get','/describe','/:id','/:id/contacts','getContacts','post','addContacts','put','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x5c66,0x148));var _0x65c6=function(_0x1af47f,_0x1eea3f){_0x1af47f=_0x1af47f-0x0;var _0x34012a=_0x5c66[_0x1af47f];return _0x34012a;};'use strict';var multer=require(_0x65c6('0x0'));var util=require('util');var path=require(_0x65c6('0x1'));var timeout=require(_0x65c6('0x2'));var express=require(_0x65c6('0x3'));var router=express['Router']();var fs_extra=require(_0x65c6('0x4'));var auth=require(_0x65c6('0x5'));var interaction=require(_0x65c6('0x6'));var config=require(_0x65c6('0x7'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0x65c6('0x8')](),controller[_0x65c6('0x9')]);router[_0x65c6('0xa')](_0x65c6('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x65c6('0xc'),auth[_0x65c6('0x8')](),controller['show']);router[_0x65c6('0xa')](_0x65c6('0xd'),auth[_0x65c6('0x8')](),controller[_0x65c6('0xe')]);router['post']('/',auth[_0x65c6('0x8')](),controller['create']);router[_0x65c6('0xf')]('/:id/contacts',auth[_0x65c6('0x8')](),controller[_0x65c6('0x10')]);router[_0x65c6('0x11')](_0x65c6('0xc'),auth[_0x65c6('0x8')](),controller[_0x65c6('0x12')]);router['delete']('/:id',auth[_0x65c6('0x8')](),controller[_0x65c6('0x13')]);module[_0x65c6('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 060b08a..b9d1849 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 _0xa6ce=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','exports'];(function(_0x5f2323,_0x10ee49){var _0x56a43e=function(_0x4ca081){while(--_0x4ca081){_0x5f2323['push'](_0x5f2323['shift']());}};_0x56a43e(++_0x10ee49);}(_0xa6ce,0xfe));var _0xea6c=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xa6ce[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0xea6c('0x0'));var Sequelize=require('sequelize');module[_0xea6c('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xea6c('0x2')]},'street':{'type':Sequelize[_0xea6c('0x2')]},'postalCode':{'type':Sequelize[_0xea6c('0x2')]},'city':{'type':Sequelize[_0xea6c('0x2')]},'country':{'type':Sequelize[_0xea6c('0x2')]},'dateOfBirth':{'type':Sequelize[_0xea6c('0x2')]},'description':{'type':Sequelize[_0xea6c('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xea6c('0x2')]},'fax':{'type':Sequelize[_0xea6c('0x2')]},'email':{'type':Sequelize[_0xea6c('0x2')]},'url':{'type':Sequelize[_0xea6c('0x2')]},'facebook':{'type':Sequelize[_0xea6c('0x2')]},'fb_data':{'type':Sequelize[_0xea6c('0x2')]},'twitter':{'type':Sequelize[_0xea6c('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xea6c('0x2')]},'viber':{'type':Sequelize[_0xea6c('0x2')]},'line':{'type':Sequelize[_0xea6c('0x2')]},'wechat':{'type':Sequelize[_0xea6c('0x2')]},'telegram':{'type':Sequelize[_0xea6c('0x2')]},'UserId':{'type':Sequelize[_0xea6c('0x4')]},'priority':{'type':Sequelize[_0xea6c('0x4')](0x2)[_0xea6c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xea6c('0x6')],'defaultValue':Sequelize[_0xea6c('0x7')]}};
\ No newline at end of file
+var _0x87b4=['INTEGER','UNSIGNED','NOW','exports','STRING','TEXT'];(function(_0x3f59b1,_0x25cdbe){var _0x11d2e8=function(_0x37b3fc){while(--_0x37b3fc){_0x3f59b1['push'](_0x3f59b1['shift']());}};_0x11d2e8(++_0x25cdbe);}(_0x87b4,0x159));var _0x487b=function(_0x49098d,_0x23ea75){_0x49098d=_0x49098d-0x0;var _0x1b092c=_0x87b4[_0x49098d];return _0x1b092c;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x487b('0x0')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x487b('0x1')]},'street':{'type':Sequelize[_0x487b('0x1')]},'postalCode':{'type':Sequelize[_0x487b('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x487b('0x1')]},'dateOfBirth':{'type':Sequelize[_0x487b('0x1')]},'description':{'type':Sequelize[_0x487b('0x2')]},'phone':{'type':Sequelize[_0x487b('0x1')]},'mobile':{'type':Sequelize[_0x487b('0x1')]},'fax':{'type':Sequelize[_0x487b('0x1')]},'email':{'type':Sequelize[_0x487b('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x487b('0x1')]},'fb_data':{'type':Sequelize[_0x487b('0x1')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x487b('0x1')]},'teams':{'type':Sequelize[_0x487b('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x487b('0x1')]},'wechat':{'type':Sequelize[_0x487b('0x1')]},'telegram':{'type':Sequelize[_0x487b('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x487b('0x3')](0x2)[_0x487b('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x487b('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index b46572f..71dd850 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 _0x9ebf=['c.fax','c.email','c.ListId','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','params','catch','tags','startsWith','displayName','CmCustomField','findAll','columnName','alias','body','get','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','duplicates','$or','findOrCreate','spread','$and','omit','format','cf_%d','pickBy','id\x20=\x20?','toParam','values','phone','getTags','rawAttributes','pick','options','ids','ContactId','includeAll','getHopperHistories','CmHopperFinal','getJscriptySessions','include','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','upload','parse','meta','import','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','getJourney','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','starttime','endtime','duration','note','createdAt','userDisposition','UserId','fullname','DESC','findAndCountAll','startCase','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','Owner','customerIp','customerPort','deviceModel','osName','ratingValue','referer','mail','subject','substatus','externalUrl','threadId','flatten','sortBy','reverse','slice','moment','bluebird','path','papaparse','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register','json','limit','undefined','count','status','Content-Range','update','destroy','then','end','sendStatus','stack','name','send','index','CmContact','describe','keys','length','cf_','push','findOne','all','fieldType','type','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','filters','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','find','Tag','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','value','start','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','SELECT','clone','having','t.id\x20IN\x20?','resolve','role','agent','some','User','getLists','c.ListId\x20IS\x20NULL','user','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.phone'];(function(_0x218fdc,_0x3b552b){var _0x54f74e=function(_0x515557){while(--_0x515557){_0x218fdc['push'](_0x218fdc['shift']());}};_0x54f74e(++_0x3b552b);}(_0x9ebf,0x9b));var _0xf9eb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9ebf[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0xf9eb('0x0'));var BPromise=require(_0xf9eb('0x1'));var util=require('util');var path=require(_0xf9eb('0x2'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var Papa=require(_0xf9eb('0x3'));var Redis=require(_0xf9eb('0x4'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0xf9eb('0x5'))(_0xf9eb('0x6'));var config=require('../../config/environment');var db=require(_0xf9eb('0x7'))['db'];config[_0xf9eb('0x8')]=_[_0xf9eb('0x9')](config[_0xf9eb('0x8')],{'host':_0xf9eb('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf9eb('0x8')]));require(_0xf9eb('0xb'))[_0xf9eb('0xc')](socket);function respondWithResult(_0x35e6c2,_0x1c7db1){_0x1c7db1=_0x1c7db1||0xc8;return function(_0x1f2f88){if(_0x1f2f88){return _0x35e6c2['status'](_0x1c7db1)[_0xf9eb('0xd')](_0x1f2f88);}};}function respondWithFilteredResult(_0x2f8595,_0x306880){return function(_0x443ef7){if(_0x443ef7){var _0x88c415=typeof _0x306880['offset']==='undefined'&&typeof _0x306880[_0xf9eb('0xe')]===_0xf9eb('0xf');var _0x53293b=_0x443ef7['count'];var _0x33b888=_0x88c415?0x0:_0x306880['offset'];var _0x57f6fa=_0x88c415?_0x443ef7[_0xf9eb('0x10')]:_0x306880['offset']+_0x306880[_0xf9eb('0xe')];var _0x3332ff;if(_0x57f6fa>=_0x53293b){_0x57f6fa=_0x53293b;_0x3332ff=0xc8;}else{_0x3332ff=0xce;}_0x2f8595[_0xf9eb('0x11')](_0x3332ff);return _0x2f8595['set'](_0xf9eb('0x12'),_0x33b888+'-'+_0x57f6fa+'/'+_0x53293b)[_0xf9eb('0xd')](_0x443ef7);}return null;};}function saveUpdates(_0x52bc27){return function(_0x2c80c7){if(_0x2c80c7){return _0x2c80c7[_0xf9eb('0x13')](_0x52bc27)['then'](function(_0x1e142c){return _0x1e142c;});}return null;};}function removeEntity(_0x1d0184){return function(_0x21f7b4){if(_0x21f7b4){return _0x21f7b4[_0xf9eb('0x14')]()[_0xf9eb('0x15')](function(){_0x1d0184[_0xf9eb('0x11')](0xcc)[_0xf9eb('0x16')]();});}};}function handleEntityNotFound(_0x2730fb){return function(_0x2a301c){if(!_0x2a301c){_0x2730fb[_0xf9eb('0x17')](0x194);}return _0x2a301c;};}function handleError(_0x47dfc8,_0xd8fb0d){_0xd8fb0d=_0xd8fb0d||0x1f4;return function(_0x524cb2){logger['error'](_0x524cb2[_0xf9eb('0x18')]);if(_0x524cb2[_0xf9eb('0x19')]){delete _0x524cb2[_0xf9eb('0x19')];}_0x47dfc8[_0xf9eb('0x11')](_0xd8fb0d)[_0xf9eb('0x1a')](_0x524cb2);};}exports[_0xf9eb('0x1b')]=function(_0x159641,_0x55853c){var _0x301cf9={},_0xc54753={},_0x15e758={'count':0x0,'rows':[]};return db[_0xf9eb('0x1c')][_0xf9eb('0x1d')]()[_0xf9eb('0x15')](function(_0x4942f5){var _0x13ccee=[];for(var _0x28a1d9=0x0;_0x28a1d9
','Attachments','Title','Data','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','127.0.0.1','moment','randomstring','util','node-tnef','../../../config/environment','head','value','address','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','anonymous','html'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7524,0xce));var _0x4752=function(_0x59664c,_0x108c41){_0x59664c=_0x59664c-0x0;var _0x870450=_0x7524[_0x59664c];return _0x870450;};'use strict';var _=require('lodash');var moment=require(_0x4752('0x0'));var random=require(_0x4752('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x4752('0x2'));var tnef=require(_0x4752('0x3'));var logger=require('../../../config/logger')('email');var config=require(_0x4752('0x4'));function getAddress(_0x4d5e05){var _0x3884b9=_[_0x4752('0x5')](_0x4d5e05[_0x4752('0x6')]);return _0x3884b9&&_0x3884b9[_0x4752('0x7')]?_0x3884b9[_0x4752('0x7')]:'anonymous'+random[_0x4752('0x8')](0x6)+_0x4752('0x9');}function getFirstName(_0x59477c){var _0x5db15c=_[_0x4752('0x5')](_0x59477c[_0x4752('0x6')]);if(_0x5db15c&&_0x5db15c[_0x4752('0xa')]){if(_0x5db15c[_0x4752('0xa')]==_0x5db15c['address']){return _0x5db15c[_0x4752('0xa')][_0x4752('0xb')](0x0,_0x5db15c[_0x4752('0xa')][_0x4752('0xc')]('@'));}var _0xcf0104=_0x5db15c['name'][_0x4752('0xd')](/\s+/);return _0xcf0104[_0x4752('0xe')]>0x1?_0xcf0104[_0x4752('0xf')](0x0,-0x1)[_0x4752('0x10')]('\x20'):_0x5db15c[_0x4752('0xa')];}return _0x4752('0x11');}function getLastName(_0xcee47){var _0x505d48=_[_0x4752('0x5')](_0xcee47['value']);if(_0x505d48&&_0x505d48[_0x4752('0xa')]){var _0x32d837=_0x505d48[_0x4752('0xa')][_0x4752('0xd')](/\s+/);return _0x32d837[_0x4752('0xe')]>0x1?_0x32d837[_0x4752('0x12')]():'';}return'';}function getMails(_0x410f88,_0x552daf){var _0x446a37='';for(var _0x1dad7c=0x0;_0x1dad7c<_0x552daf['value'][_0x4752('0xe')];_0x1dad7c+=0x1){if(_0x552daf['value'][_0x1dad7c][_0x4752('0x7')]!==_0x410f88){if(!_[_0x4752('0x13')](_0x446a37)){_0x446a37+=',';}_0x446a37+=_0x552daf['value'][_0x1dad7c][_0x4752('0xa')]||_0x552daf['value'][_0x1dad7c]['address']||'';_0x446a37+='\x20<';_0x446a37+=_0x552daf[_0x4752('0x6')][_0x1dad7c][_0x4752('0x7')]?_0x552daf[_0x4752('0x6')][_0x1dad7c][_0x4752('0x7')]:_0x4752('0x14')+random[_0x4752('0x8')](0x6)+'@xcally.com';_0x446a37+='>';}}return _0x446a37;}function parseEmail(_0x22215f,_0x2d2f9e,_0x477050){if(_0x2d2f9e[_0x4752('0x15')]){var _0x3facf5=/