From: support
Date: Wed, 6 Apr 2022 14:14:00 +0000 (+0000)
Subject: Built motion from commit 5ae82ce5.|2.6.7
X-Git-Url: http://repos.xcallymotion.com/base//%22http:/www.gravatar.com/avatar/%7B%7Bhash%7D%7D/%22?a=commitdiff_plain;h=9e72c9afa674406dccfdd10991f909dbb94b9a46;p=motion2.git
Built motion from commit 5ae82ce5.|2.6.7
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 278b492..cc2a70f 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-04-06T13:24:09.107Z",
+ "time": "2022-04-06T14:06:53.454Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 5ccdb21..cb436eb 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-04-06T13:24:09.107Z",
+ "time": "2022-04-06T14:06:53.454Z",
"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 a8ba5c5..5f85305 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 _0x8a02=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','contactManager','integration','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)]','STRING','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)]'];(function(_0x371f33,_0x278a69){var _0x246c96=function(_0x4f8bad){while(--_0x4f8bad){_0x371f33['push'](_0x371f33['shift']());}};_0x246c96(++_0x278a69);}(_0x8a02,0x1a9));var _0x28a0=function(_0x56d281,_0x461c77){_0x56d281=_0x56d281-0x0;var _0x5a3142=_0x8a02[_0x56d281];return _0x5a3142;};'use strict';var Sequelize=require(_0x28a0('0x0'));module[_0x28a0('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x54dd0c){return this[_0x28a0('0x2')](_0x28a0('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x28a0('0x4'),_0x28a0('0x5'),'motionbar',_0x28a0('0x6'),'urlForward',_0x28a0('0x7'),_0x28a0('0x8'),_0x28a0('0x9')]],'msg':_0x28a0('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x28a0('0xb')},'data2':{'type':Sequelize[_0x28a0('0xc')](0x1000),'comment':_0x28a0('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x28a0('0xe')},'data4':{'type':Sequelize[_0x28a0('0xc')](0x1000),'comments':_0x28a0('0xf')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x28a0('0x10')},'data6':{'type':Sequelize['STRING'],'comments':_0x28a0('0x11')},'data7':{'type':Sequelize[_0x28a0('0x12')],'comments':_0x28a0('0x13')}};
\ No newline at end of file
+var _0x7522=['action','STRING','contactManager','integration','motionbar','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','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]','TEXT','urlForward[body]','sequelize','exports','getDataValue'];(function(_0x13e36a,_0x57de74){var _0x5c9f65=function(_0x9f33f3){while(--_0x9f33f3){_0x13e36a['push'](_0x13e36a['shift']());}};_0x5c9f65(++_0x57de74);}(_0x7522,0x12f));var _0x2752=function(_0x576dd3,_0x5a22fa){_0x576dd3=_0x576dd3-0x0;var _0x52a931=_0x7522[_0x576dd3];return _0x52a931;};'use strict';var Sequelize=require(_0x2752('0x0'));module[_0x2752('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x9c6fb1){return this[_0x2752('0x2')](_0x2752('0x3'));}},'action':{'type':Sequelize[_0x2752('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x2752('0x5'),_0x2752('0x6'),_0x2752('0x7'),_0x2752('0x8'),'urlForward',_0x2752('0x9'),'bot',_0x2752('0xa')]],'msg':_0x2752('0xb')}},'comment':_0x2752('0xb')},'data1':{'type':Sequelize[_0x2752('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x2752('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x2752('0x4')](0x1000),'comment':_0x2752('0xc')},'data4':{'type':Sequelize[_0x2752('0x4')](0x1000),'comments':_0x2752('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x2752('0xe')},'data6':{'type':Sequelize[_0x2752('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x2752('0xf')],'comments':_0x2752('0x10')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 025b604..49c7a21 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 _0x02c9=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','bluebird'];(function(_0x31dc60,_0x805e4e){var _0x2d4cfe=function(_0x388fef){while(--_0x388fef){_0x31dc60['push'](_0x31dc60['shift']());}};_0x2d4cfe(++_0x805e4e);}(_0x02c9,0x1db));var _0x902c=function(_0x34694a,_0x3b3224){_0x34694a=_0x34694a-0x0;var _0x3ac315=_0x02c9[_0x34694a];return _0x3ac315;};'use strict';var emlformat=require(_0x902c('0x0'));var rimraf=require(_0x902c('0x1'));var zipdir=require(_0x902c('0x2'));var jsonpatch=require(_0x902c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x902c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x902c('0x5'));var sox=require(_0x902c('0x6'));var csv=require(_0x902c('0x7'));var ejs=require(_0x902c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x902c('0x9'));var squel=require(_0x902c('0xa'));var crypto=require(_0x902c('0xb'));var jsforce=require(_0x902c('0xc'));var deskjs=require(_0x902c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x902c('0xe'));var Redis=require(_0x902c('0xf'));var authService=require(_0x902c('0x10'));var qs=require(_0x902c('0x11'));var as=require(_0x902c('0x12'));var hardwareService=require(_0x902c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x902c('0x14'));var config=require(_0x902c('0x15'));var licenseUtil=require(_0x902c('0x16'));var db=require(_0x902c('0x17'))['db'];function respondWithStatusCode(_0x2a3570,_0x26c09d){_0x26c09d=_0x26c09d||0xcc;return function(_0x420b5b){if(_0x420b5b){return _0x2a3570['sendStatus'](_0x26c09d);}return _0x2a3570[_0x902c('0x18')](_0x26c09d)[_0x902c('0x19')]();};}function respondWithResult(_0x35ee8f,_0x187d04){_0x187d04=_0x187d04||0xc8;return function(_0x2d5e93){if(_0x2d5e93){return _0x35ee8f['status'](_0x187d04)[_0x902c('0x1a')](_0x2d5e93);}};}function respondWithFilteredResult(_0xbeca83,_0x22f137){return function(_0x49d445){if(_0x49d445){var _0x2edc6d=typeof _0x22f137['offset']===_0x902c('0x1b')&&typeof _0x22f137[_0x902c('0x1c')]===_0x902c('0x1b');var _0x9f601b=_0x49d445[_0x902c('0x1d')];var _0x516afc=_0x2edc6d?0x0:_0x22f137[_0x902c('0x1e')];var _0xa8f92a=_0x2edc6d?_0x49d445[_0x902c('0x1d')]:_0x22f137['offset']+_0x22f137['limit'];var _0x2f4544;if(_0xa8f92a>=_0x9f601b){_0xa8f92a=_0x9f601b;_0x2f4544=0xc8;}else{_0x2f4544=0xce;}_0xbeca83[_0x902c('0x18')](_0x2f4544);return _0xbeca83['set'](_0x902c('0x1f'),_0x516afc+'-'+_0xa8f92a+'/'+_0x9f601b)[_0x902c('0x1a')](_0x49d445);}return null;};}function patchUpdates(_0x45c363){return function(_0x1b60ab){try{jsonpatch[_0x902c('0x20')](_0x1b60ab,_0x45c363,!![]);}catch(_0x3165fd){return BPromise[_0x902c('0x21')](_0x3165fd);}return _0x1b60ab[_0x902c('0x22')]();};}function saveUpdates(_0x4bb293,_0x33e74f){return function(_0x307573){if(_0x307573){return _0x307573[_0x902c('0x23')](_0x4bb293)[_0x902c('0x24')](function(_0x1e60a4){return _0x1e60a4;});}return null;};}function removeEntity(_0x631500,_0x373caa){return function(_0x243460){if(_0x243460){return _0x243460[_0x902c('0x25')]()[_0x902c('0x24')](function(){_0x631500[_0x902c('0x18')](0xcc)[_0x902c('0x19')]();});}};}function handleEntityNotFound(_0x5953c6,_0x155a55){return function(_0x13d3cb){if(!_0x13d3cb){_0x5953c6[_0x902c('0x26')](0x194);}return _0x13d3cb;};}function handleError(_0x3ff6db,_0x2c0869){_0x2c0869=_0x2c0869||0x1f4;return function(_0x15b542){logger[_0x902c('0x27')](_0x15b542[_0x902c('0x28')]);if(_0x15b542[_0x902c('0x29')]){delete _0x15b542['name'];}_0x3ff6db[_0x902c('0x18')](_0x2c0869)[_0x902c('0x2a')](_0x15b542);};}exports[_0x902c('0x23')]=function(_0x5c3c81,_0xc9fac5){if(_0x5c3c81['body']['id']){delete _0x5c3c81[_0x902c('0x2b')]['id'];}return db[_0x902c('0x2c')][_0x902c('0x2d')]({'where':{'id':_0x5c3c81[_0x902c('0x2e')]['id']}})['then'](handleEntityNotFound(_0xc9fac5,null))[_0x902c('0x24')](saveUpdates(_0x5c3c81[_0x902c('0x2b')],null))['then'](respondWithResult(_0xc9fac5,null))[_0x902c('0x2f')](handleError(_0xc9fac5,null));};exports[_0x902c('0x25')]=function(_0x5920d1,_0x124281){return db[_0x902c('0x2c')][_0x902c('0x2d')]({'where':{'id':_0x5920d1[_0x902c('0x2e')]['id']}})['then'](handleEntityNotFound(_0x124281,null))[_0x902c('0x24')](removeEntity(_0x124281,null))[_0x902c('0x2f')](handleError(_0x124281,null));};
\ No newline at end of file
+var _0x1a7c=['then','destroy','sendStatus','error','stack','name','body','Action','find','params','catch','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update'];(function(_0x451c84,_0xc44ca){var _0x404605=function(_0x3c04c1){while(--_0x3c04c1){_0x451c84['push'](_0x451c84['shift']());}};_0x404605(++_0xc44ca);}(_0x1a7c,0x95));var _0xc1a7=function(_0x54b0f3,_0x1fe2f7){_0x54b0f3=_0x54b0f3-0x0;var _0x5ae957=_0x1a7c[_0x54b0f3];return _0x5ae957;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1a7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc1a7('0x1'));var rp=require(_0xc1a7('0x2'));var moment=require('moment');var BPromise=require(_0xc1a7('0x3'));var Mustache=require(_0xc1a7('0x4'));var util=require('util');var path=require(_0xc1a7('0x5'));var sox=require(_0xc1a7('0x6'));var csv=require(_0xc1a7('0x7'));var ejs=require(_0xc1a7('0x8'));var fs=require('fs');var fs_extra=require(_0xc1a7('0x9'));var _=require('lodash');var squel=require(_0xc1a7('0xa'));var crypto=require(_0xc1a7('0xb'));var jsforce=require(_0xc1a7('0xc'));var deskjs=require(_0xc1a7('0xd'));var toCsv=require(_0xc1a7('0x7'));var querystring=require(_0xc1a7('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc1a7('0xf'));var qs=require(_0xc1a7('0x10'));var as=require(_0xc1a7('0x11'));var hardwareService=require(_0xc1a7('0x12'));var logger=require(_0xc1a7('0x13'))(_0xc1a7('0x14'));var utils=require(_0xc1a7('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc1a7('0x16'))['db'];function respondWithStatusCode(_0x5e5176,_0x4c2f07){_0x4c2f07=_0x4c2f07||0xcc;return function(_0x2a4818){if(_0x2a4818){return _0x5e5176['sendStatus'](_0x4c2f07);}return _0x5e5176[_0xc1a7('0x17')](_0x4c2f07)[_0xc1a7('0x18')]();};}function respondWithResult(_0xee03b1,_0x2b56a1){_0x2b56a1=_0x2b56a1||0xc8;return function(_0x3612ba){if(_0x3612ba){return _0xee03b1['status'](_0x2b56a1)['json'](_0x3612ba);}};}function respondWithFilteredResult(_0x522b6a,_0x36e0fe){return function(_0x4e19d1){if(_0x4e19d1){var _0x3ccec3=typeof _0x36e0fe[_0xc1a7('0x19')]===_0xc1a7('0x1a')&&typeof _0x36e0fe[_0xc1a7('0x1b')]===_0xc1a7('0x1a');var _0x3bbaf9=_0x4e19d1[_0xc1a7('0x1c')];var _0x4f403f=_0x3ccec3?0x0:_0x36e0fe[_0xc1a7('0x19')];var _0x52a463=_0x3ccec3?_0x4e19d1[_0xc1a7('0x1c')]:_0x36e0fe['offset']+_0x36e0fe[_0xc1a7('0x1b')];var _0x3105c8;if(_0x52a463>=_0x3bbaf9){_0x52a463=_0x3bbaf9;_0x3105c8=0xc8;}else{_0x3105c8=0xce;}_0x522b6a[_0xc1a7('0x17')](_0x3105c8);return _0x522b6a['set'](_0xc1a7('0x1d'),_0x4f403f+'-'+_0x52a463+'/'+_0x3bbaf9)[_0xc1a7('0x1e')](_0x4e19d1);}return null;};}function patchUpdates(_0x41fae9){return function(_0x3f5cf7){try{jsonpatch[_0xc1a7('0x1f')](_0x3f5cf7,_0x41fae9,!![]);}catch(_0x3abcb9){return BPromise[_0xc1a7('0x20')](_0x3abcb9);}return _0x3f5cf7[_0xc1a7('0x21')]();};}function saveUpdates(_0x274dcb,_0x438985){return function(_0x16aa44){if(_0x16aa44){return _0x16aa44[_0xc1a7('0x22')](_0x274dcb)[_0xc1a7('0x23')](function(_0x27d3fd){return _0x27d3fd;});}return null;};}function removeEntity(_0x135b5e,_0x21a254){return function(_0x9f1553){if(_0x9f1553){return _0x9f1553[_0xc1a7('0x24')]()[_0xc1a7('0x23')](function(){_0x135b5e[_0xc1a7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9eeef6,_0x21fc6a){return function(_0x56eabd){if(!_0x56eabd){_0x9eeef6[_0xc1a7('0x25')](0x194);}return _0x56eabd;};}function handleError(_0x13ccce,_0x1650f0){_0x1650f0=_0x1650f0||0x1f4;return function(_0x2a3034){logger[_0xc1a7('0x26')](_0x2a3034[_0xc1a7('0x27')]);if(_0x2a3034[_0xc1a7('0x28')]){delete _0x2a3034[_0xc1a7('0x28')];}_0x13ccce[_0xc1a7('0x17')](_0x1650f0)['send'](_0x2a3034);};}exports[_0xc1a7('0x22')]=function(_0x303ab8,_0x74348d){if(_0x303ab8[_0xc1a7('0x29')]['id']){delete _0x303ab8[_0xc1a7('0x29')]['id'];}return db[_0xc1a7('0x2a')][_0xc1a7('0x2b')]({'where':{'id':_0x303ab8[_0xc1a7('0x2c')]['id']}})[_0xc1a7('0x23')](handleEntityNotFound(_0x74348d,null))[_0xc1a7('0x23')](saveUpdates(_0x303ab8[_0xc1a7('0x29')],null))['then'](respondWithResult(_0x74348d,null))[_0xc1a7('0x2d')](handleError(_0x74348d,null));};exports[_0xc1a7('0x24')]=function(_0x4bf991,_0x51dcb9){return db[_0xc1a7('0x2a')]['find']({'where':{'id':_0x4bf991[_0xc1a7('0x2c')]['id']}})[_0xc1a7('0x23')](handleEntityNotFound(_0x51dcb9,null))[_0xc1a7('0x23')](removeEntity(_0x51dcb9,null))[_0xc1a7('0x2d')](handleError(_0x51dcb9,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index a3d8a9a..3f4c53e 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 _0xde82=['./action.attributes','exports','define','tools_actions','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x408193,_0x388396){var _0x40e295=function(_0x318396){while(--_0x318396){_0x408193['push'](_0x408193['shift']());}};_0x40e295(++_0x388396);}(_0xde82,0xe0));var _0x2de8=function(_0xf3a154,_0x568aa0){_0xf3a154=_0xf3a154-0x0;var _0x35e9cf=_0xde82[_0xf3a154];return _0x35e9cf;};'use strict';var _=require(_0x2de8('0x0'));var util=require('util');var logger=require(_0x2de8('0x1'))(_0x2de8('0x2'));var moment=require(_0x2de8('0x3'));var BPromise=require(_0x2de8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2de8('0x5'));var rimraf=require(_0x2de8('0x6'));var config=require('../../config/environment');var attributes=require(_0x2de8('0x7'));module[_0x2de8('0x8')]=function(_0x34664e,_0x57f8eb){return _0x34664e[_0x2de8('0x9')]('Action',attributes,{'tableName':_0x2de8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c3c=['./action.attributes','Action','tools_actions','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4db483,_0x5293a9){var _0x401534=function(_0x15d072){while(--_0x15d072){_0x4db483['push'](_0x4db483['shift']());}};_0x401534(++_0x5293a9);}(_0x8c3c,0x142));var _0xc8c3=function(_0x2fa132,_0x14ab75){_0x2fa132=_0x2fa132-0x0;var _0x411d53=_0x8c3c[_0x2fa132];return _0x411d53;};'use strict';var _=require(_0xc8c3('0x0'));var util=require(_0xc8c3('0x1'));var logger=require(_0xc8c3('0x2'))(_0xc8c3('0x3'));var moment=require('moment');var BPromise=require(_0xc8c3('0x4'));var rp=require(_0xc8c3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc8c3('0x6'));var config=require(_0xc8c3('0x7'));var attributes=require(_0xc8c3('0x8'));module['exports']=function(_0x8a8f82,_0x1a4adb){return _0x8a8f82['define'](_0xc8c3('0x9'),attributes,{'tableName':_0xc8c3('0xa'),'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 7d30b2b..0a2e931 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 _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5ad88e,_0x5d42a1){var _0x549079=function(_0x3a4d6f){while(--_0x3a4d6f){_0x5ad88e['push'](_0x5ad88e['shift']());}};_0x549079(++_0x5d42a1);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x16bfae,_0x36ed25){_0x16bfae=_0x16bfae-0x0;var _0x3870f5=_0x7fbe[_0x16bfae];return _0x3870f5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
+var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x5e1914,_0x1313a3){var _0x4fb013=function(_0x31be59){while(--_0x31be59){_0x5e1914['push'](_0x5e1914['shift']());}};_0x4fb013(++_0x1313a3);}(_0xe14b,0x93));var _0xbe14=function(_0x20b807,_0x35fa4a){_0x20b807=_0x20b807-0x0;var _0x147302=_0xe14b[_0x20b807];return _0x147302;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index c7abd67..e429b36 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 _0x1e29=['../../components/interaction/service','put','/:id','update','destroy','multer','util','path','express','Router'];(function(_0x80a18e,_0x3d749){var _0x56f354=function(_0x68f489){while(--_0x68f489){_0x80a18e['push'](_0x80a18e['shift']());}};_0x56f354(++_0x3d749);}(_0x1e29,0xcd));var _0x91e2=function(_0x45b824,_0x38d8f1){_0x45b824=_0x45b824-0x0;var _0x52635c=_0x1e29[_0x45b824];return _0x52635c;};'use strict';var multer=require(_0x91e2('0x0'));var util=require(_0x91e2('0x1'));var path=require(_0x91e2('0x2'));var timeout=require('connect-timeout');var express=require(_0x91e2('0x3'));var router=express[_0x91e2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x91e2('0x5'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x91e2('0x6')](_0x91e2('0x7'),auth['isAuthenticated'](),controller[_0x91e2('0x8')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x91e2('0x9')]);module['exports']=router;
\ No newline at end of file
+var _0x9434=['isAuthenticated','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./action.controller'];(function(_0x53e137,_0x4cfdcd){var _0x39ae2e=function(_0x25a0ed){while(--_0x25a0ed){_0x53e137['push'](_0x53e137['shift']());}};_0x39ae2e(++_0x4cfdcd);}(_0x9434,0x71));var _0x4943=function(_0x430e88,_0x1eabcb){_0x430e88=_0x430e88-0x0;var _0x5616e0=_0x9434[_0x430e88];return _0x5616e0;};'use strict';var multer=require(_0x4943('0x0'));var util=require(_0x4943('0x1'));var path=require('path');var timeout=require(_0x4943('0x2'));var express=require(_0x4943('0x3'));var router=express[_0x4943('0x4')]();var fs_extra=require(_0x4943('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4943('0x6'));var config=require('../../config/environment');var controller=require(_0x4943('0x7'));router['put']('/:id',auth[_0x4943('0x8')](),controller[_0x4943('0x9')]);router[_0x4943('0xa')]('/:id',auth[_0x4943('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 3102f4f..6aade28 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 _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x517d65,_0x29cbc3){var _0xf911de=function(_0x1389ee){while(--_0x1389ee){_0x517d65['push'](_0x517d65['shift']());}};_0xf911de(++_0x29cbc3);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7995('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x7995('0x2')]},'conditions':{'type':Sequelize[_0x7995('0x3')]},'joins':{'type':Sequelize[_0x7995('0x3')]}};
\ No newline at end of file
+var _0xb138=['TEXT','sequelize','exports','STRING'];(function(_0x4da133,_0x3f7748){var _0xf1969e=function(_0x46055e){while(--_0x46055e){_0x4da133['push'](_0x4da133['shift']());}};_0xf1969e(++_0x3f7748);}(_0xb138,0x1dd));var _0x8b13=function(_0x37f2d6,_0x2aa0ca){_0x37f2d6=_0x37f2d6-0x0;var _0x2b3d86=_0xb138[_0x37f2d6];return _0x2b3d86;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'name':{'type':Sequelize[_0x8b13('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8b13('0x2')]},'parent':{'type':Sequelize[_0x8b13('0x2')]},'table':{'type':Sequelize[_0x8b13('0x2')]},'conditions':{'type':Sequelize[_0x8b13('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 8ea72c1..4ee8136 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 _0x8df2=['autoAssociation','UserProfileResource','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','MIN(%s)','GROUP_CONCAT(%s)','ROUND(%s)','groupBy','parse','output','%s-%s.%s','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','stack','name','map','AnalyticCustomReport','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','include','findAll','rows','catch','show','rawAttributes','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId'];(function(_0x27f7d6,_0x13fc7a){var _0x277c28=function(_0x5ac74d){while(--_0x5ac74d){_0x27f7d6['push'](_0x27f7d6['shift']());}};_0x277c28(++_0x13fc7a);}(_0x8df2,0x1b1));var _0x28df=function(_0x1c7a3c,_0x2639ac){_0x1c7a3c=_0x1c7a3c-0x0;var _0x36e66c=_0x8df2[_0x1c7a3c];return _0x36e66c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28df('0x0'));var zipdir=require(_0x28df('0x1'));var jsonpatch=require(_0x28df('0x2'));var rp=require(_0x28df('0x3'));var moment=require('moment');var BPromise=require(_0x28df('0x4'));var Mustache=require('mustache');var util=require(_0x28df('0x5'));var path=require('path');var sox=require(_0x28df('0x6'));var csv=require(_0x28df('0x7'));var ejs=require(_0x28df('0x8'));var fs=require('fs');var fs_extra=require(_0x28df('0x9'));var _=require(_0x28df('0xa'));var squel=require(_0x28df('0xb'));var crypto=require(_0x28df('0xc'));var jsforce=require(_0x28df('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x28df('0x7'));var querystring=require(_0x28df('0xe'));var Papa=require(_0x28df('0xf'));var Redis=require(_0x28df('0x10'));var authService=require(_0x28df('0x11'));var qs=require(_0x28df('0x12'));var as=require(_0x28df('0x13'));var hardwareService=require(_0x28df('0x14'));var logger=require('../../config/logger')(_0x28df('0x15'));var utils=require(_0x28df('0x16'));var config=require(_0x28df('0x17'));var licenseUtil=require(_0x28df('0x18'));var db=require(_0x28df('0x19'))['db'];var dbH=require(_0x28df('0x19'))[_0x28df('0x1a')];function respondWithStatusCode(_0x4d5018,_0x868d34){_0x868d34=_0x868d34||0xcc;return function(_0x18fe9e){if(_0x18fe9e){return _0x4d5018[_0x28df('0x1b')](_0x868d34);}return _0x4d5018[_0x28df('0x1c')](_0x868d34)['end']();};}function respondWithResult(_0x3691bb,_0x591526){_0x591526=_0x591526||0xc8;return function(_0x27c443){if(_0x27c443){return _0x3691bb[_0x28df('0x1c')](_0x591526)[_0x28df('0x1d')](_0x27c443);}};}function respondWithFilteredResult(_0x52fa5b,_0x11a39c){return function(_0x11afb5){if(_0x11afb5){var _0x163937=typeof _0x11a39c['offset']==='undefined'&&typeof _0x11a39c[_0x28df('0x1e')]==='undefined';var _0x586bba=_0x11afb5[_0x28df('0x1f')];var _0x24af0d=_0x163937?0x0:_0x11a39c[_0x28df('0x20')];var _0x508aca=_0x163937?_0x11afb5['count']:_0x11a39c[_0x28df('0x20')]+_0x11a39c[_0x28df('0x1e')];var _0x2a066b;if(_0x508aca>=_0x586bba){_0x508aca=_0x586bba;_0x2a066b=0xc8;}else{_0x2a066b=0xce;}_0x52fa5b[_0x28df('0x1c')](_0x2a066b);return _0x52fa5b[_0x28df('0x21')](_0x28df('0x22'),_0x24af0d+'-'+_0x508aca+'/'+_0x586bba)[_0x28df('0x1d')](_0x11afb5);}return null;};}function patchUpdates(_0x3230c1){return function(_0x6d8934){try{jsonpatch[_0x28df('0x23')](_0x6d8934,_0x3230c1,!![]);}catch(_0x2d3b01){return BPromise[_0x28df('0x24')](_0x2d3b01);}return _0x6d8934[_0x28df('0x25')]();};}function saveUpdates(_0xd9facc,_0x4ee7c3){return function(_0x2c8975){if(_0x2c8975){return _0x2c8975[_0x28df('0x26')](_0xd9facc)[_0x28df('0x27')](function(_0x5d46cf){return _0x5d46cf;});}return null;};}function removeEntity(_0x239f6d,_0x950856){return function(_0x141152){if(_0x141152){return _0x141152[_0x28df('0x28')]()[_0x28df('0x27')](function(){var _0x659ed0=_0x141152[_0x28df('0x29')]({'plain':!![]});var _0x227750='CustomReports';return db['UserProfileResource'][_0x28df('0x28')]({'where':{'type':_0x227750,'resourceId':_0x659ed0['id']}})[_0x28df('0x27')](function(){return _0x141152;});})[_0x28df('0x27')](function(){_0x239f6d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc04899,_0x680ca6){return function(_0x2489a5){if(!_0x2489a5){_0xc04899[_0x28df('0x1b')](0x194);}return _0x2489a5;};}function handleError(_0x205c95,_0x3b6328){_0x3b6328=_0x3b6328||0x1f4;return function(_0x289a12){logger['error'](_0x289a12[_0x28df('0x2a')]);if(_0x289a12[_0x28df('0x2b')]){delete _0x289a12[_0x28df('0x2b')];}_0x205c95['status'](_0x3b6328)['send'](_0x289a12);};}exports['index']=function(_0x171e12,_0x3f8748){var _0xca07d0={},_0x47fc26={},_0x472074={'count':0x0,'rows':[]};var _0x3493d2=_[_0x28df('0x2c')](db[_0x28df('0x2d')]['rawAttributes'],function(_0x384ac6){return{'name':_0x384ac6[_0x28df('0x2e')],'type':_0x384ac6[_0x28df('0x2f')][_0x28df('0x30')]};});_0x47fc26['model']=_[_0x28df('0x2c')](_0x3493d2,_0x28df('0x2b'));_0x47fc26[_0x28df('0x31')]=_[_0x28df('0x32')](_0x171e12[_0x28df('0x31')]);_0x47fc26['filters']=_['intersection'](_0x47fc26[_0x28df('0x33')],_0x47fc26[_0x28df('0x31')]);_0xca07d0[_0x28df('0x34')]=_[_0x28df('0x35')](_0x47fc26[_0x28df('0x33')],qs[_0x28df('0x36')](_0x171e12[_0x28df('0x31')][_0x28df('0x36')]));_0xca07d0['attributes']=_0xca07d0[_0x28df('0x34')][_0x28df('0x37')]?_0xca07d0['attributes']:_0x47fc26['model'];if(!_0x171e12[_0x28df('0x31')][_0x28df('0x38')](_0x28df('0x39'))){_0xca07d0[_0x28df('0x1e')]=qs['limit'](_0x171e12[_0x28df('0x31')]['limit']);_0xca07d0[_0x28df('0x20')]=qs[_0x28df('0x20')](_0x171e12[_0x28df('0x31')][_0x28df('0x20')]);}_0xca07d0[_0x28df('0x3a')]=qs[_0x28df('0x3b')](_0x171e12[_0x28df('0x31')][_0x28df('0x3b')]);_0xca07d0[_0x28df('0x3c')]=qs[_0x28df('0x3d')](_['pick'](_0x171e12[_0x28df('0x31')],_0x47fc26[_0x28df('0x3d')]),_0x3493d2);if(_0x171e12[_0x28df('0x31')][_0x28df('0x3e')]){_0xca07d0[_0x28df('0x3c')]=_['merge'](_0xca07d0[_0x28df('0x3c')],{'$or':_['map'](_0x3493d2,function(_0x12fb78){if(_0x12fb78['type']!==_0x28df('0x3f')){var _0x36b38b={};_0x36b38b[_0x12fb78[_0x28df('0x2b')]]={'$like':'%'+_0x171e12[_0x28df('0x31')][_0x28df('0x3e')]+'%'};return _0x36b38b;}})});}_0xca07d0=_['merge']({},_0xca07d0,_0x171e12['options']);var _0x29f573={'where':_0xca07d0[_0x28df('0x3c')]};return db[_0x28df('0x2d')]['count'](_0x29f573)[_0x28df('0x27')](function(_0x4dd28d){_0x472074[_0x28df('0x1f')]=_0x4dd28d;if(_0x171e12[_0x28df('0x31')]['includeAll']){_0xca07d0[_0x28df('0x40')]=[{'all':!![]}];}return db[_0x28df('0x2d')][_0x28df('0x41')](_0xca07d0);})[_0x28df('0x27')](function(_0x2cc300){_0x472074[_0x28df('0x42')]=_0x2cc300;return _0x472074;})[_0x28df('0x27')](respondWithFilteredResult(_0x3f8748,_0xca07d0))[_0x28df('0x43')](handleError(_0x3f8748,null));};exports[_0x28df('0x44')]=function(_0x45b268,_0x5edef1){var _0xc257ca={'raw':![],'where':{'id':_0x45b268['params']['id']}},_0x175344={};_0x175344['model']=_[_0x28df('0x32')](db[_0x28df('0x2d')][_0x28df('0x45')]);_0x175344[_0x28df('0x31')]=_[_0x28df('0x32')](_0x45b268[_0x28df('0x31')]);_0x175344['filters']=_['intersection'](_0x175344[_0x28df('0x33')],_0x175344[_0x28df('0x31')]);_0xc257ca['attributes']=_[_0x28df('0x35')](_0x175344['model'],qs[_0x28df('0x36')](_0x45b268[_0x28df('0x31')][_0x28df('0x36')]));_0xc257ca['attributes']=_0xc257ca[_0x28df('0x34')][_0x28df('0x37')]?_0xc257ca[_0x28df('0x34')]:_0x175344['model'];if(_0x45b268[_0x28df('0x31')][_0x28df('0x46')]){_0xc257ca[_0x28df('0x40')]=[{'all':!![]}];}_0xc257ca=_['merge']({},_0xc257ca,_0x45b268[_0x28df('0x47')]);return db[_0x28df('0x2d')][_0x28df('0x48')](_0xc257ca)[_0x28df('0x27')](handleEntityNotFound(_0x5edef1,null))[_0x28df('0x27')](respondWithResult(_0x5edef1,null))[_0x28df('0x43')](handleError(_0x5edef1,null));};exports[_0x28df('0x49')]=function(_0x14eca4,_0x39647a){return db['AnalyticCustomReport'][_0x28df('0x49')](_0x14eca4['body'],{})[_0x28df('0x27')](function(_0x10aced){var _0x3e8ea5=_0x14eca4[_0x28df('0x4a')][_0x28df('0x29')]({'plain':!![]});if(!_0x3e8ea5)throw new Error(_0x28df('0x4b'));if(_0x3e8ea5[_0x28df('0x4c')]===_0x28df('0x4a')){var _0x2e2782=_0x10aced[_0x28df('0x29')]({'plain':!![]});var _0x4ffb0b=_0x28df('0x4d');return db[_0x28df('0x4e')][_0x28df('0x48')]({'where':{'name':_0x4ffb0b,'userProfileId':_0x3e8ea5[_0x28df('0x4f')]},'raw':!![]})[_0x28df('0x27')](function(_0x740dc8){if(_0x740dc8&&_0x740dc8[_0x28df('0x50')]===0x0){return db[_0x28df('0x51')][_0x28df('0x49')]({'name':_0x2e2782[_0x28df('0x2b')],'resourceId':_0x2e2782['id'],'type':_0x28df('0x52'),'sectionId':_0x740dc8['id']},{})[_0x28df('0x27')](function(){return _0x10aced;});}else{return _0x10aced;}})[_0x28df('0x43')](function(_0x4285ce){logger[_0x28df('0x53')](_0x28df('0x54'),_0x4285ce);throw _0x4285ce;});}return _0x10aced;})['then'](respondWithResult(_0x39647a,0xc9))[_0x28df('0x43')](handleError(_0x39647a,null));};exports[_0x28df('0x26')]=function(_0x20acdc,_0x130cf0){if(_0x20acdc[_0x28df('0x55')]['id']){delete _0x20acdc[_0x28df('0x55')]['id'];}return db[_0x28df('0x2d')][_0x28df('0x48')]({'where':{'id':_0x20acdc[_0x28df('0x56')]['id']}})[_0x28df('0x27')](handleEntityNotFound(_0x130cf0,null))[_0x28df('0x27')](saveUpdates(_0x20acdc[_0x28df('0x55')],null))['then'](respondWithResult(_0x130cf0,null))[_0x28df('0x43')](handleError(_0x130cf0,null));};exports[_0x28df('0x28')]=function(_0x588a8c,_0x37ecac){return db[_0x28df('0x2d')][_0x28df('0x48')]({'where':{'id':_0x588a8c[_0x28df('0x56')]['id']}})[_0x28df('0x27')](handleEntityNotFound(_0x37ecac,null))['then'](removeEntity(_0x37ecac,null))[_0x28df('0x43')](handleError(_0x37ecac,null));};exports[_0x28df('0x57')]=function(_0x15d5dc,_0x13740e){var _0x1a5577=0xa;var _0x55e472=[_0x28df('0x58'),_0x28df('0x59'),_0x28df('0x5a'),_0x28df('0x5b')];var _0x494c8f={'SUM':_0x28df('0x5c'),'COUNT':_0x28df('0x5d'),'COUNT DISTINCT':_0x28df('0x5e'),'MAX':_0x28df('0x5f'),'MIN':'MIN(%s)','AVG':_0x28df('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x28df('0x61')};var _0x4068b5={'SEC_TO_TIME':_0x28df('0x62'),'DATE':_0x28df('0x63'),'HOUR':_0x28df('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x28df('0x65')};var _0x57cb04=function(_0x500a0f){return!_[_0x28df('0x66')]([_0x28df('0x67'),_0x28df('0x68'),_0x28df('0x69'),_0x28df('0x6a')],_0x500a0f);};var _0xce011a=function(_0x2f7e6a){if(!_0x2f7e6a||!_0x2f7e6a[_0x28df('0x6b')][_0x28df('0x37')]){return'';}for(var _0x315039='(',_0x10db1e=0x0;_0x10db1e<_0x2f7e6a[_0x28df('0x6b')]['length'];_0x10db1e+=0x1){_0x10db1e>0x0&&(_0x315039+='\x20'+_0x2f7e6a[_0x28df('0x6c')]+'\x20');_0x315039+=_0x2f7e6a[_0x28df('0x6b')][_0x10db1e]['group']?_0xce011a(_0x2f7e6a[_0x28df('0x6b')][_0x10db1e][_0x28df('0x6d')]):_0x2f7e6a[_0x28df('0x6b')][_0x10db1e][_0x28df('0x6e')]+'\x20'+_0x2f7e6a[_0x28df('0x6b')][_0x10db1e]['condition']+(_0x57cb04(_0x2f7e6a[_0x28df('0x6b')][_0x10db1e][_0x28df('0x6f')])?'\x20'+_0x2f7e6a[_0x28df('0x6b')][_0x10db1e][_0x28df('0x70')]:'');}return _0x315039+')';};var _0x34b224={'where':{'id':_0x15d5dc[_0x28df('0x56')]['id']}},_0x1fc504,_0x2bf6af,_0x273f7e,_0x5c743d,_0x10ce25;_0x34b224=_[_0x28df('0x71')]({},_0x34b224,_0x15d5dc[_0x28df('0x47')]);return db[_0x28df('0x2d')][_0x28df('0x48')](_0x34b224)[_0x28df('0x27')](function(_0x32e654){if(_0x32e654){_0x1fc504=_0x32e654;return _0x32e654[_0x28df('0x72')]();}return null;})[_0x28df('0x27')](function(_0x482414){if(_0x482414){if(!_0x482414['length']){throw new db[(_0x28df('0x73'))][(_0x28df('0x74'))](_0x28df('0x75'),0x193);}_0x2bf6af=_0x482414;return db[_0x28df('0x76')][_0x28df('0x41')]({'raw':!![]});}return null;})[_0x28df('0x27')](function(_0x33fa17){if(_0x33fa17){_0x273f7e=_[_0x28df('0x77')](_0x33fa17,'id');var _0x5cebcb;var _0x4416ed=squel[_0x28df('0x78')]();_0x4416ed[_0x28df('0x79')](_0x1fc504[_0x28df('0x7a')]);for(var _0x254945=0x0;_0x254945<_0x2bf6af[_0x28df('0x37')];_0x254945+=0x1){_0x5cebcb=_0x2bf6af[_0x254945][_0x28df('0x7b')]?_0x273f7e[_0x2bf6af[_0x254945][_0x28df('0x7b')]][_0x28df('0x7c')]:_0x2bf6af[_0x254945][_0x28df('0x6e')];_0x5cebcb=_0x2bf6af[_0x254945][_0x28df('0x7d')]?_[_0x28df('0x7e')](_0x494c8f[_0x2bf6af[_0x254945]['function']],'%s',_0x5cebcb):_0x5cebcb;_0x5cebcb=_0x2bf6af[_0x254945][_0x28df('0x7f')]?_[_0x28df('0x7e')](_0x4068b5[_0x2bf6af[_0x254945]['format']],'%s',_0x5cebcb):_0x5cebcb;if(_0x2bf6af[_0x254945]['groupBy']){_0x4416ed[_0x28df('0x6d')](_0x5cebcb);}_0x2bf6af[_0x254945][_0x28df('0x80')]&&_0x4416ed[_0x28df('0x3a')](_0x5cebcb,_0x2bf6af[_0x254945]['orderBy']===_0x28df('0x81')?![]:!![]);_0x4416ed[_0x28df('0x6e')](_0x5cebcb,_0x2bf6af[_0x254945][_0x28df('0x82')]||_0x5cebcb);}if(_0x1fc504[_0x28df('0x83')]){_0x1fc504['joins']=JSON['parse'](_0x1fc504[_0x28df('0x83')]);for(var _0x266f89=0x0;_0x266f89<_0x1fc504[_0x28df('0x83')][_0x28df('0x37')];_0x266f89+=0x1){if(_0x1fc504[_0x28df('0x83')][_0x266f89]['type']&&_[_0x28df('0x66')](_0x55e472,_0x1fc504[_0x28df('0x83')][_0x266f89][_0x28df('0x2f')])&&_0x1fc504[_0x28df('0x83')][_0x266f89]['parentKey']&&_0x1fc504[_0x28df('0x83')][_0x266f89][_0x28df('0x84')]&&_0x1fc504['joins'][_0x266f89][_0x28df('0x85')]){_0x4416ed[_0x1fc504[_0x28df('0x83')][_0x266f89]['type']](_0x1fc504[_0x28df('0x83')][_0x266f89]['foreignTable'],null,util['format'](_0x28df('0x86'),_0x1fc504[_0x28df('0x7a')],_0x1fc504[_0x28df('0x83')][_0x266f89][_0x28df('0x87')],_0x1fc504['joins'][_0x266f89][_0x28df('0x84')],_0x1fc504[_0x28df('0x83')][_0x266f89][_0x28df('0x85')]));}}}if(_0x1fc504[_0x28df('0x88')]){_0x1fc504[_0x28df('0x88')]=JSON['parse'](_0x1fc504[_0x28df('0x88')]);_0x4416ed[_0x28df('0x3c')](_0xce011a(_0x1fc504[_0x28df('0x88')]['group']));}_0x10ce25=_0x4416ed[_0x28df('0x89')]();_0x4416ed[_0x28df('0x1e')](_0x1a5577);_0x4416ed['offset'](0x0);logger[_0x28df('0x8a')](_0x28df('0x8b'),_0x4416ed['toString']());return dbH['sequelize'][_0x28df('0x31')](_0x4416ed['toString'](),{'type':dbH[_0x28df('0x8c')][_0x28df('0x8d')][_0x28df('0x8e')]});}})[_0x28df('0x27')](respondWithResult(_0x13740e,null))[_0x28df('0x43')](handleError(_0x13740e,null));};function runReport(_0x54c2d3,_0x48d0d2,_0x1ef0d2){var _0xa6f466=_0x48d0d2['name'];var _0xff79de=0xa;var _0x36e98d=['join',_0x28df('0x59'),_0x28df('0x5a'),_0x28df('0x5b')];var _0x4e97fa={'SUM':'SUM(%s)','COUNT':_0x28df('0x5d'),'COUNT DISTINCT':_0x28df('0x5e'),'MAX':'MAX(%s)','MIN':_0x28df('0x8f'),'AVG':_0x28df('0x60'),'GROUP_CONCAT':_0x28df('0x90'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x28df('0x61')};var _0x4a84c9={'SEC_TO_TIME':_0x28df('0x62'),'DATE':_0x28df('0x63'),'HOUR':_0x28df('0x64'),'ROUND':_0x28df('0x91'),'UNIX_TIMESTAMP':_0x28df('0x65')};var _0x496862=function(_0x2724e0){return!_['includes'](['IS\x20NULL',_0x28df('0x68'),_0x28df('0x69'),_0x28df('0x6a')],_0x2724e0);};var _0x5cdede=function(_0x4df21a){if(!_0x4df21a||!_0x4df21a['rules'][_0x28df('0x37')]){return'';}for(var _0x3bef0b='(',_0x3bf87d=0x0;_0x3bf87d<_0x4df21a['rules'][_0x28df('0x37')];_0x3bf87d+=0x1){_0x3bf87d>0x0&&(_0x3bef0b+='\x20'+_0x4df21a['operator']+'\x20');_0x3bef0b+=_0x4df21a['rules'][_0x3bf87d][_0x28df('0x6d')]?_0x5cdede(_0x4df21a[_0x28df('0x6b')][_0x3bf87d][_0x28df('0x6d')]):_0x4df21a[_0x28df('0x6b')][_0x3bf87d][_0x28df('0x6e')]+'\x20'+_0x4df21a[_0x28df('0x6b')][_0x3bf87d]['condition']+(_0x496862(_0x4df21a['rules'][_0x3bf87d][_0x28df('0x6f')])?'\x20'+_0x4df21a[_0x28df('0x6b')][_0x3bf87d]['value']:'');}return _0x3bef0b+')';};var _0x42b864={'where':{'id':_0x54c2d3['id']}},_0x4cdd56,_0x314bcb,_0x2aa012,_0x2d5a06,_0x2591fd;_0x42b864=_[_0x28df('0x71')]({},_0x42b864,_0x1ef0d2);return db[_0x28df('0x2d')][_0x28df('0x48')](_0x42b864)[_0x28df('0x27')](function(_0x2ee437){if(_0x2ee437){_0x4cdd56=_0x2ee437;return _0x2ee437[_0x28df('0x72')]();}return null;})[_0x28df('0x27')](function(_0x3e099a){if(_0x3e099a){if(!_0x3e099a[_0x28df('0x37')]){throw new db[(_0x28df('0x73'))][(_0x28df('0x74'))](_0x28df('0x75'),0x193);}_0x314bcb=_0x3e099a;return db[_0x28df('0x76')]['findAll']({'raw':!![]});}return null;})[_0x28df('0x27')](function(_0x249262){if(_0x249262){_0x2aa012=_[_0x28df('0x77')](_0x249262,'id');var _0x190863;var _0x2aedc3=squel[_0x28df('0x78')]();_0x2aedc3[_0x28df('0x79')](_0x4cdd56[_0x28df('0x7a')]);for(var _0x3189bd=0x0;_0x3189bd<_0x314bcb['length'];_0x3189bd+=0x1){_0x190863=_0x314bcb[_0x3189bd][_0x28df('0x7b')]?_0x2aa012[_0x314bcb[_0x3189bd][_0x28df('0x7b')]][_0x28df('0x7c')]:_0x314bcb[_0x3189bd][_0x28df('0x6e')];_0x190863=_0x314bcb[_0x3189bd][_0x28df('0x7d')]?_[_0x28df('0x7e')](_0x4e97fa[_0x314bcb[_0x3189bd]['function']],'%s',_0x190863):_0x190863;_0x190863=_0x314bcb[_0x3189bd][_0x28df('0x7f')]?_[_0x28df('0x7e')](_0x4a84c9[_0x314bcb[_0x3189bd][_0x28df('0x7f')]],'%s',_0x190863):_0x190863;if(_0x314bcb[_0x3189bd][_0x28df('0x92')]){_0x2aedc3[_0x28df('0x6d')](_0x190863);}_0x314bcb[_0x3189bd][_0x28df('0x80')]&&_0x2aedc3[_0x28df('0x3a')](_0x190863,_0x314bcb[_0x3189bd][_0x28df('0x80')]==='DESC'?![]:!![]);_0x2aedc3[_0x28df('0x6e')](_0x190863,_0x314bcb[_0x3189bd]['alias']||_0x190863);}if(_0x4cdd56[_0x28df('0x83')]){_0x4cdd56[_0x28df('0x83')]=JSON[_0x28df('0x93')](_0x4cdd56['joins']);for(var _0x5c76a5=0x0;_0x5c76a5<_0x4cdd56[_0x28df('0x83')][_0x28df('0x37')];_0x5c76a5+=0x1){if(_0x4cdd56['joins'][_0x5c76a5][_0x28df('0x2f')]&&_[_0x28df('0x66')](_0x36e98d,_0x4cdd56[_0x28df('0x83')][_0x5c76a5][_0x28df('0x2f')])&&_0x4cdd56[_0x28df('0x83')][_0x5c76a5][_0x28df('0x87')]&&_0x4cdd56['joins'][_0x5c76a5][_0x28df('0x84')]&&_0x4cdd56[_0x28df('0x83')][_0x5c76a5][_0x28df('0x85')]){_0x2aedc3[_0x4cdd56['joins'][_0x5c76a5][_0x28df('0x2f')]](_0x4cdd56['joins'][_0x5c76a5]['foreignTable'],null,util[_0x28df('0x7f')](_0x28df('0x86'),_0x4cdd56[_0x28df('0x7a')],_0x4cdd56['joins'][_0x5c76a5][_0x28df('0x87')],_0x4cdd56[_0x28df('0x83')][_0x5c76a5]['foreignTable'],_0x4cdd56['joins'][_0x5c76a5][_0x28df('0x85')]));}}}if(_0x4cdd56['conditions']){_0x4cdd56[_0x28df('0x88')]=JSON[_0x28df('0x93')](_0x4cdd56[_0x28df('0x88')]);_0x2aedc3['where'](_0x5cdede(_0x4cdd56[_0x28df('0x88')][_0x28df('0x6d')]));}_0x2591fd=_0x2aedc3[_0x28df('0x89')]();_0x2aedc3[_0x28df('0x1e')](_0xff79de);_0x2aedc3[_0x28df('0x20')](0x0);return;}})['then'](function(){if(_0x48d0d2[_0x28df('0x94')]==='web'){return null;}var _0x568860=_[_0x28df('0x71')](_0x48d0d2,{'name':_0x48d0d2['fullPath']||_0x48d0d2[_0x28df('0x2b')]||_0x4cdd56[_0x28df('0x2b')],'basename':_0xa6f466,'savename':util['format'](_0x28df('0x95'),_0x48d0d2[_0x28df('0x2b')]||_0x4cdd56['name'],require(_0x28df('0x96'))[_0x28df('0x97')](0x4),_0x48d0d2['output']||_0x28df('0x98')),'reportId':_0x4cdd56['id'],'reportType':_0x28df('0x99')});return db['AnalyticExtractedReport'][_0x28df('0x49')](_0x568860,{'raw':!![]});})[_0x28df('0x27')](function(_0x3e490b){if(_0x4cdd56[_0x28df('0x7a')]===_0x28df('0x9a')){_0x2591fd['where'](_0x4cdd56['table']+_0x28df('0x9b'),_0x48d0d2[_0x28df('0x9c')],_0x48d0d2[_0x28df('0x9d')]);}else{_0x2591fd[_0x28df('0x3c')](_0x4cdd56['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x48d0d2['startDate'],_0x48d0d2[_0x28df('0x9d')]);}if(_0x3e490b){logger[_0x28df('0x9e')](_0x28df('0x9f'),_0x2591fd[_0x28df('0xa0')]());require(_0x28df('0xa1'))[_0x28df('0xa2')](path['join'](__dirname,_0x28df('0xa3'),_0x3e490b[_0x28df('0x94')]),[_0x3e490b['id'],_0x2591fd[_0x28df('0xa0')](),path[_0x28df('0x58')](__dirname,_0x28df('0xa4'),_0x3e490b[_0x28df('0xa5')]),_0xa6f466]);return _0x3e490b;}else{var _0x4c8663=squel[_0x28df('0x78')]();_0x4c8663[_0x28df('0x79')]('('+_0x2591fd[_0x28df('0xa0')]()+')',_0x28df('0xa6'));_0x4c8663[_0x28df('0x6e')](_0x28df('0xa7'),_0x28df('0x1f'));_0x2591fd[_0x28df('0x1e')](_0x48d0d2[_0x28df('0x1e')]||_0xff79de);_0x2591fd[_0x28df('0x20')](_0x48d0d2[_0x28df('0x20')]||0x0);return dbH['sequelize'][_0x28df('0x31')](_0x4c8663['toString'](),{'type':dbH[_0x28df('0x8c')][_0x28df('0x8d')]['SELECT']})[_0x28df('0x27')](function(_0x4afb26){if(!_0x4afb26[_0x28df('0x37')]){_0x2d5a06=0x0;}else{_0x2d5a06=_0x4afb26[0x0][_0x28df('0x1f')]||0x0;}return dbH[_0x28df('0x8c')][_0x28df('0x31')](_0x2591fd[_0x28df('0xa0')](),{'type':dbH[_0x28df('0x8c')][_0x28df('0x8d')][_0x28df('0x8e')]});})['then'](function(_0x23414b){return{'rows':_0x23414b||[],'count':_0x2d5a06};});}});}exports[_0x28df('0xa8')]=function(_0xc2c98e,_0x4fc20a){return runReport(_0xc2c98e[_0x28df('0x56')],_0xc2c98e[_0x28df('0x31')],_0xc2c98e[_0x28df('0x47')])['then'](respondWithResult(_0x4fc20a,null))[_0x28df('0x43')](handleError(_0x4fc20a,null));};exports[_0x28df('0xa9')]=runReport;exports['query']=function(_0x142729,_0x548575){var _0x510e70=0xa;var _0xe552=[_0x28df('0x58'),_0x28df('0x59'),_0x28df('0x5a'),_0x28df('0x5b')];var _0x54b711={'SUM':_0x28df('0x5c'),'COUNT':_0x28df('0x5d'),'COUNT DISTINCT':_0x28df('0x5e'),'MAX':_0x28df('0x5f'),'MIN':_0x28df('0x8f'),'AVG':_0x28df('0x60'),'GROUP_CONCAT':_0x28df('0x90'),'GROUP_CONCAT ASC':_0x28df('0xaa'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x412642={'SEC_TO_TIME':_0x28df('0x62'),'DATE':_0x28df('0x63'),'HOUR':_0x28df('0x64'),'ROUND':_0x28df('0x91'),'UNIX_TIMESTAMP':_0x28df('0x65')};var _0x5b66ec=function(_0x2d35df){return!_['includes']([_0x28df('0x67'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x28df('0x6a')],_0x2d35df);};var _0xba2728=function(_0x2dbd90){if(!_0x2dbd90||!_0x2dbd90[_0x28df('0x6b')][_0x28df('0x37')]){return'';}for(var _0x1a66be='(',_0x4381f6=0x0;_0x4381f6<_0x2dbd90['rules'][_0x28df('0x37')];_0x4381f6+=0x1){_0x4381f6>0x0&&(_0x1a66be+='\x20'+_0x2dbd90[_0x28df('0x6c')]+'\x20');_0x1a66be+=_0x2dbd90[_0x28df('0x6b')][_0x4381f6]['group']?_0xba2728(_0x2dbd90[_0x28df('0x6b')][_0x4381f6][_0x28df('0x6d')]):_0x2dbd90[_0x28df('0x6b')][_0x4381f6][_0x28df('0x6e')]+'\x20'+_0x2dbd90[_0x28df('0x6b')][_0x4381f6][_0x28df('0x6f')]+(_0x5b66ec(_0x2dbd90[_0x28df('0x6b')][_0x4381f6][_0x28df('0x6f')])?'\x20'+_0x2dbd90[_0x28df('0x6b')][_0x4381f6][_0x28df('0x70')]:'');}return _0x1a66be+')';};var _0x483180={'where':{'id':_0x142729['params']['id']}},_0x2ceae9,_0x32909f,_0x32b8e1,_0x3f581c,_0x218c71;_0x483180=_[_0x28df('0x71')]({},_0x483180,_0x142729[_0x28df('0x47')]);return db['AnalyticCustomReport'][_0x28df('0x48')](_0x483180)['then'](function(_0x2cd16a){if(_0x2cd16a){_0x2ceae9=_0x2cd16a;return _0x2cd16a[_0x28df('0x72')]();}return null;})[_0x28df('0x27')](function(_0x29dac9){if(_0x29dac9){if(!_0x29dac9[_0x28df('0x37')]){throw new db['Sequelize'][(_0x28df('0x74'))](_0x28df('0x75'),0x193);}_0x32909f=_0x29dac9;return db[_0x28df('0x76')][_0x28df('0x41')]({'raw':!![]});}return null;})[_0x28df('0x27')](function(_0x4559d7){if(_0x4559d7){_0x32b8e1=_[_0x28df('0x77')](_0x4559d7,'id');var _0x99f4d0;var _0x2d90d0=squel[_0x28df('0x78')]();_0x2d90d0[_0x28df('0x79')](_0x2ceae9['table']);for(var _0x446a49=0x0;_0x446a49<_0x32909f[_0x28df('0x37')];_0x446a49+=0x1){_0x99f4d0=_0x32909f[_0x446a49][_0x28df('0x7b')]?_0x32b8e1[_0x32909f[_0x446a49][_0x28df('0x7b')]]['metric']:_0x32909f[_0x446a49][_0x28df('0x6e')];_0x99f4d0=_0x32909f[_0x446a49][_0x28df('0x7d')]?_[_0x28df('0x7e')](_0x54b711[_0x32909f[_0x446a49][_0x28df('0x7d')]],'%s',_0x99f4d0):_0x99f4d0;_0x99f4d0=_0x32909f[_0x446a49]['format']?_['replace'](_0x412642[_0x32909f[_0x446a49][_0x28df('0x7f')]],'%s',_0x99f4d0):_0x99f4d0;if(_0x32909f[_0x446a49]['groupBy']){_0x2d90d0[_0x28df('0x6d')](_0x99f4d0);}_0x32909f[_0x446a49][_0x28df('0x80')]&&_0x2d90d0[_0x28df('0x3a')](_0x99f4d0,_0x32909f[_0x446a49]['orderBy']===_0x28df('0x81')?![]:!![]);_0x2d90d0[_0x28df('0x6e')](_0x99f4d0,_0x32909f[_0x446a49][_0x28df('0x82')]||_0x99f4d0);}if(_0x2ceae9[_0x28df('0x83')]){_0x2ceae9[_0x28df('0x83')]=JSON[_0x28df('0x93')](_0x2ceae9[_0x28df('0x83')]);for(var _0x428030=0x0;_0x428030<_0x2ceae9['joins'][_0x28df('0x37')];_0x428030+=0x1){if(_0x2ceae9['joins'][_0x428030][_0x28df('0x2f')]&&_[_0x28df('0x66')](_0xe552,_0x2ceae9[_0x28df('0x83')][_0x428030][_0x28df('0x2f')])&&_0x2ceae9['joins'][_0x428030][_0x28df('0x87')]&&_0x2ceae9['joins'][_0x428030][_0x28df('0x84')]&&_0x2ceae9['joins'][_0x428030][_0x28df('0x85')]){_0x2d90d0[_0x2ceae9['joins'][_0x428030][_0x28df('0x2f')]](_0x2ceae9['joins'][_0x428030][_0x28df('0x84')],null,util[_0x28df('0x7f')](_0x28df('0x86'),_0x2ceae9['table'],_0x2ceae9[_0x28df('0x83')][_0x428030]['parentKey'],_0x2ceae9[_0x28df('0x83')][_0x428030]['foreignTable'],_0x2ceae9[_0x28df('0x83')][_0x428030][_0x28df('0x85')]));}}}if(_0x2ceae9[_0x28df('0x88')]){_0x2ceae9[_0x28df('0x88')]=JSON[_0x28df('0x93')](_0x2ceae9[_0x28df('0x88')]);_0x2d90d0[_0x28df('0x3c')](_0xba2728(_0x2ceae9[_0x28df('0x88')][_0x28df('0x6d')]));}_0x218c71=_0x2d90d0[_0x28df('0x89')]();_0x2d90d0[_0x28df('0x1e')](_0x510e70);_0x2d90d0[_0x28df('0x20')](0x0);logger['debug'](_0x28df('0x8b'),_0x2d90d0['toString']());return dbH['sequelize'][_0x28df('0x31')](_0x2d90d0['toString'](),{'type':dbH[_0x28df('0x8c')][_0x28df('0x8d')][_0x28df('0x8e')]});}})[_0x28df('0x27')](function(){return{'sql':_0x218c71[_0x28df('0xa0')]()};})[_0x28df('0x27')](respondWithResult(_0x548575,null))[_0x28df('0x43')](handleError(_0x548575,null));};
\ No newline at end of file
+var _0x7cbd=['generate','csv','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','savename','COUNT(*)','SELECT','run','runReport','AVG(%s)','groupBy','Limited\x20Query:','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','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','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','format','replace','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','keyBy','MetricId','metric','output','web','%s-%s.%s','randomstring'];(function(_0x5b1aed,_0x322c17){var _0x26add8=function(_0x58a9d7){while(--_0x58a9d7){_0x5b1aed['push'](_0x5b1aed['shift']());}};_0x26add8(++_0x322c17);}(_0x7cbd,0xb9));var _0xd7cb=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x7cbd[_0x173d7e];return _0x2220d6;};'use strict';var emlformat=require(_0xd7cb('0x0'));var rimraf=require(_0xd7cb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd7cb('0x2'));var moment=require(_0xd7cb('0x3'));var BPromise=require(_0xd7cb('0x4'));var Mustache=require('mustache');var util=require(_0xd7cb('0x5'));var path=require(_0xd7cb('0x6'));var sox=require(_0xd7cb('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7cb('0x8'));var squel=require(_0xd7cb('0x9'));var crypto=require(_0xd7cb('0xa'));var jsforce=require(_0xd7cb('0xb'));var deskjs=require(_0xd7cb('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd7cb('0xd'));var Papa=require(_0xd7cb('0xe'));var Redis=require(_0xd7cb('0xf'));var authService=require(_0xd7cb('0x10'));var qs=require(_0xd7cb('0x11'));var as=require(_0xd7cb('0x12'));var hardwareService=require(_0xd7cb('0x13'));var logger=require(_0xd7cb('0x14'))(_0xd7cb('0x15'));var utils=require(_0xd7cb('0x16'));var config=require(_0xd7cb('0x17'));var licenseUtil=require(_0xd7cb('0x18'));var db=require(_0xd7cb('0x19'))['db'];var dbH=require(_0xd7cb('0x19'))[_0xd7cb('0x1a')];function respondWithStatusCode(_0x166969,_0x243187){_0x243187=_0x243187||0xcc;return function(_0x293af2){if(_0x293af2){return _0x166969[_0xd7cb('0x1b')](_0x243187);}return _0x166969['status'](_0x243187)[_0xd7cb('0x1c')]();};}function respondWithResult(_0x2d86c8,_0x506981){_0x506981=_0x506981||0xc8;return function(_0x308185){if(_0x308185){return _0x2d86c8[_0xd7cb('0x1d')](_0x506981)[_0xd7cb('0x1e')](_0x308185);}};}function respondWithFilteredResult(_0x54b738,_0x34f217){return function(_0x3186a6){if(_0x3186a6){var _0x57af5b=typeof _0x34f217[_0xd7cb('0x1f')]===_0xd7cb('0x20')&&typeof _0x34f217[_0xd7cb('0x21')]==='undefined';var _0x4a026e=_0x3186a6[_0xd7cb('0x22')];var _0x23b582=_0x57af5b?0x0:_0x34f217['offset'];var _0x356327=_0x57af5b?_0x3186a6[_0xd7cb('0x22')]:_0x34f217[_0xd7cb('0x1f')]+_0x34f217['limit'];var _0x55f7f6;if(_0x356327>=_0x4a026e){_0x356327=_0x4a026e;_0x55f7f6=0xc8;}else{_0x55f7f6=0xce;}_0x54b738[_0xd7cb('0x1d')](_0x55f7f6);return _0x54b738[_0xd7cb('0x23')](_0xd7cb('0x24'),_0x23b582+'-'+_0x356327+'/'+_0x4a026e)[_0xd7cb('0x1e')](_0x3186a6);}return null;};}function patchUpdates(_0x1cb0cb){return function(_0x31b994){try{jsonpatch[_0xd7cb('0x25')](_0x31b994,_0x1cb0cb,!![]);}catch(_0x2a4e9f){return BPromise['reject'](_0x2a4e9f);}return _0x31b994[_0xd7cb('0x26')]();};}function saveUpdates(_0x4ac38c,_0x340817){return function(_0x3f2edf){if(_0x3f2edf){return _0x3f2edf[_0xd7cb('0x27')](_0x4ac38c)[_0xd7cb('0x28')](function(_0x255025){return _0x255025;});}return null;};}function removeEntity(_0x5b5c74,_0x200e39){return function(_0xab80a2){if(_0xab80a2){return _0xab80a2[_0xd7cb('0x29')]()[_0xd7cb('0x28')](function(){var _0x536d2d=_0xab80a2[_0xd7cb('0x2a')]({'plain':!![]});var _0x59e491=_0xd7cb('0x2b');return db[_0xd7cb('0x2c')][_0xd7cb('0x29')]({'where':{'type':_0x59e491,'resourceId':_0x536d2d['id']}})[_0xd7cb('0x28')](function(){return _0xab80a2;});})[_0xd7cb('0x28')](function(){_0x5b5c74['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x589eba,_0x4a7ae2){return function(_0x18cf55){if(!_0x18cf55){_0x589eba['sendStatus'](0x194);}return _0x18cf55;};}function handleError(_0x21a6f3,_0x49cbad){_0x49cbad=_0x49cbad||0x1f4;return function(_0x105787){logger[_0xd7cb('0x2d')](_0x105787[_0xd7cb('0x2e')]);if(_0x105787[_0xd7cb('0x2f')]){delete _0x105787[_0xd7cb('0x2f')];}_0x21a6f3[_0xd7cb('0x1d')](_0x49cbad)[_0xd7cb('0x30')](_0x105787);};}exports[_0xd7cb('0x31')]=function(_0x568833,_0x2ad5ab){var _0x2c9251={},_0x9cf5ed={},_0x13e90b={'count':0x0,'rows':[]};var _0x32bff5=_['map'](db[_0xd7cb('0x32')][_0xd7cb('0x33')],function(_0x120413){return{'name':_0x120413[_0xd7cb('0x34')],'type':_0x120413[_0xd7cb('0x35')][_0xd7cb('0x36')]};});_0x9cf5ed[_0xd7cb('0x37')]=_[_0xd7cb('0x38')](_0x32bff5,'name');_0x9cf5ed[_0xd7cb('0x39')]=_[_0xd7cb('0x3a')](_0x568833[_0xd7cb('0x39')]);_0x9cf5ed[_0xd7cb('0x3b')]=_[_0xd7cb('0x3c')](_0x9cf5ed[_0xd7cb('0x37')],_0x9cf5ed['query']);_0x2c9251['attributes']=_[_0xd7cb('0x3c')](_0x9cf5ed['model'],qs[_0xd7cb('0x3d')](_0x568833[_0xd7cb('0x39')]['fields']));_0x2c9251['attributes']=_0x2c9251['attributes']['length']?_0x2c9251[_0xd7cb('0x3e')]:_0x9cf5ed['model'];if(!_0x568833[_0xd7cb('0x39')][_0xd7cb('0x3f')](_0xd7cb('0x40'))){_0x2c9251['limit']=qs[_0xd7cb('0x21')](_0x568833[_0xd7cb('0x39')][_0xd7cb('0x21')]);_0x2c9251[_0xd7cb('0x1f')]=qs[_0xd7cb('0x1f')](_0x568833[_0xd7cb('0x39')][_0xd7cb('0x1f')]);}_0x2c9251[_0xd7cb('0x41')]=qs['sort'](_0x568833[_0xd7cb('0x39')][_0xd7cb('0x42')]);_0x2c9251[_0xd7cb('0x43')]=qs[_0xd7cb('0x3b')](_[_0xd7cb('0x44')](_0x568833[_0xd7cb('0x39')],_0x9cf5ed[_0xd7cb('0x3b')]),_0x32bff5);if(_0x568833[_0xd7cb('0x39')]['filter']){_0x2c9251['where']=_[_0xd7cb('0x45')](_0x2c9251[_0xd7cb('0x43')],{'$or':_['map'](_0x32bff5,function(_0xd9adaa){if(_0xd9adaa[_0xd7cb('0x35')]!==_0xd7cb('0x46')){var _0x30d665={};_0x30d665[_0xd9adaa['name']]={'$like':'%'+_0x568833[_0xd7cb('0x39')]['filter']+'%'};return _0x30d665;}})});}_0x2c9251=_['merge']({},_0x2c9251,_0x568833[_0xd7cb('0x47')]);var _0x4d7e7e={'where':_0x2c9251[_0xd7cb('0x43')]};return db[_0xd7cb('0x32')][_0xd7cb('0x22')](_0x4d7e7e)['then'](function(_0x232575){_0x13e90b[_0xd7cb('0x22')]=_0x232575;if(_0x568833['query'][_0xd7cb('0x48')]){_0x2c9251[_0xd7cb('0x49')]=[{'all':!![]}];}return db[_0xd7cb('0x32')][_0xd7cb('0x4a')](_0x2c9251);})['then'](function(_0x2631ca){_0x13e90b[_0xd7cb('0x4b')]=_0x2631ca;return _0x13e90b;})[_0xd7cb('0x28')](respondWithFilteredResult(_0x2ad5ab,_0x2c9251))[_0xd7cb('0x4c')](handleError(_0x2ad5ab,null));};exports[_0xd7cb('0x4d')]=function(_0x2df494,_0x44718b){var _0x20250e={'raw':![],'where':{'id':_0x2df494[_0xd7cb('0x4e')]['id']}},_0x5bb271={};_0x5bb271[_0xd7cb('0x37')]=_['keys'](db[_0xd7cb('0x32')][_0xd7cb('0x33')]);_0x5bb271[_0xd7cb('0x39')]=_[_0xd7cb('0x3a')](_0x2df494[_0xd7cb('0x39')]);_0x5bb271['filters']=_[_0xd7cb('0x3c')](_0x5bb271[_0xd7cb('0x37')],_0x5bb271[_0xd7cb('0x39')]);_0x20250e[_0xd7cb('0x3e')]=_[_0xd7cb('0x3c')](_0x5bb271['model'],qs[_0xd7cb('0x3d')](_0x2df494[_0xd7cb('0x39')][_0xd7cb('0x3d')]));_0x20250e[_0xd7cb('0x3e')]=_0x20250e[_0xd7cb('0x3e')][_0xd7cb('0x4f')]?_0x20250e['attributes']:_0x5bb271[_0xd7cb('0x37')];if(_0x2df494[_0xd7cb('0x39')]['includeAll']){_0x20250e[_0xd7cb('0x49')]=[{'all':!![]}];}_0x20250e=_['merge']({},_0x20250e,_0x2df494['options']);return db[_0xd7cb('0x32')][_0xd7cb('0x50')](_0x20250e)[_0xd7cb('0x28')](handleEntityNotFound(_0x44718b,null))[_0xd7cb('0x28')](respondWithResult(_0x44718b,null))[_0xd7cb('0x4c')](handleError(_0x44718b,null));};exports[_0xd7cb('0x51')]=function(_0x50fbdd,_0x28e6ca){return db[_0xd7cb('0x32')][_0xd7cb('0x51')](_0x50fbdd[_0xd7cb('0x52')],{})[_0xd7cb('0x28')](function(_0x264f3d){var _0x56044c=_0x50fbdd[_0xd7cb('0x53')]['get']({'plain':!![]});if(!_0x56044c)throw new Error(_0xd7cb('0x54'));if(_0x56044c[_0xd7cb('0x55')]===_0xd7cb('0x53')){var _0x1375b9=_0x264f3d[_0xd7cb('0x2a')]({'plain':!![]});var _0x3df897=_0xd7cb('0x56');return db['UserProfileSection']['find']({'where':{'name':_0x3df897,'userProfileId':_0x56044c[_0xd7cb('0x57')]},'raw':!![]})[_0xd7cb('0x28')](function(_0x6f0d9f){if(_0x6f0d9f&&_0x6f0d9f[_0xd7cb('0x58')]===0x0){return db[_0xd7cb('0x2c')][_0xd7cb('0x51')]({'name':_0x1375b9[_0xd7cb('0x2f')],'resourceId':_0x1375b9['id'],'type':_0xd7cb('0x2b'),'sectionId':_0x6f0d9f['id']},{})[_0xd7cb('0x28')](function(){return _0x264f3d;});}else{return _0x264f3d;}})[_0xd7cb('0x4c')](function(_0x1ecfc2){logger[_0xd7cb('0x2d')](_0xd7cb('0x59'),_0x1ecfc2);throw _0x1ecfc2;});}return _0x264f3d;})[_0xd7cb('0x28')](respondWithResult(_0x28e6ca,0xc9))['catch'](handleError(_0x28e6ca,null));};exports[_0xd7cb('0x27')]=function(_0x161542,_0x4c1c98){if(_0x161542['body']['id']){delete _0x161542[_0xd7cb('0x52')]['id'];}return db[_0xd7cb('0x32')][_0xd7cb('0x50')]({'where':{'id':_0x161542['params']['id']}})[_0xd7cb('0x28')](handleEntityNotFound(_0x4c1c98,null))[_0xd7cb('0x28')](saveUpdates(_0x161542[_0xd7cb('0x52')],null))[_0xd7cb('0x28')](respondWithResult(_0x4c1c98,null))['catch'](handleError(_0x4c1c98,null));};exports['destroy']=function(_0x575953,_0x40873b){return db[_0xd7cb('0x32')][_0xd7cb('0x50')]({'where':{'id':_0x575953[_0xd7cb('0x4e')]['id']}})[_0xd7cb('0x28')](handleEntityNotFound(_0x40873b,null))[_0xd7cb('0x28')](removeEntity(_0x40873b,null))['catch'](handleError(_0x40873b,null));};exports[_0xd7cb('0x5a')]=function(_0x46d01d,_0xc5ef31){var _0x1720e3=0xa;var _0x539f4c=[_0xd7cb('0x5b'),_0xd7cb('0x5c'),'right_join',_0xd7cb('0x5d')];var _0x241b38={'SUM':'SUM(%s)','COUNT':_0xd7cb('0x5e'),'COUNT DISTINCT':_0xd7cb('0x5f'),'MAX':_0xd7cb('0x60'),'MIN':_0xd7cb('0x61'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd7cb('0x62'),'GROUP_CONCAT ASC':_0xd7cb('0x63'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3ffb79={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd7cb('0x64'),'HOUR':_0xd7cb('0x65'),'ROUND':_0xd7cb('0x66'),'UNIX_TIMESTAMP':_0xd7cb('0x67')};var _0xd91467=function(_0x29ee06){return!_[_0xd7cb('0x68')]([_0xd7cb('0x69'),_0xd7cb('0x6a'),_0xd7cb('0x6b'),_0xd7cb('0x6c')],_0x29ee06);};var _0x13d0a0=function(_0x56d03f){if(!_0x56d03f||!_0x56d03f['rules'][_0xd7cb('0x4f')]){return'';}for(var _0x4b2bf5='(',_0x52ffe6=0x0;_0x52ffe6<_0x56d03f['rules'][_0xd7cb('0x4f')];_0x52ffe6+=0x1){_0x52ffe6>0x0&&(_0x4b2bf5+='\x20'+_0x56d03f[_0xd7cb('0x6d')]+'\x20');_0x4b2bf5+=_0x56d03f[_0xd7cb('0x6e')][_0x52ffe6][_0xd7cb('0x6f')]?_0x13d0a0(_0x56d03f[_0xd7cb('0x6e')][_0x52ffe6]['group']):_0x56d03f[_0xd7cb('0x6e')][_0x52ffe6][_0xd7cb('0x70')]+'\x20'+_0x56d03f[_0xd7cb('0x6e')][_0x52ffe6][_0xd7cb('0x71')]+(_0xd91467(_0x56d03f[_0xd7cb('0x6e')][_0x52ffe6][_0xd7cb('0x71')])?'\x20'+_0x56d03f[_0xd7cb('0x6e')][_0x52ffe6][_0xd7cb('0x72')]:'');}return _0x4b2bf5+')';};var _0x231b50={'where':{'id':_0x46d01d[_0xd7cb('0x4e')]['id']}},_0x256302,_0x45a8c8,_0x3da9ba,_0x589685,_0x2ae544;_0x231b50=_[_0xd7cb('0x45')]({},_0x231b50,_0x46d01d[_0xd7cb('0x47')]);return db[_0xd7cb('0x32')][_0xd7cb('0x50')](_0x231b50)['then'](function(_0x27b4b2){if(_0x27b4b2){_0x256302=_0x27b4b2;return _0x27b4b2[_0xd7cb('0x73')]();}return null;})[_0xd7cb('0x28')](function(_0x12f9f1){if(_0x12f9f1){if(!_0x12f9f1[_0xd7cb('0x4f')]){throw new db[(_0xd7cb('0x74'))][(_0xd7cb('0x75'))](_0xd7cb('0x76'),0x193);}_0x45a8c8=_0x12f9f1;return db[_0xd7cb('0x77')][_0xd7cb('0x4a')]({'raw':!![]});}return null;})['then'](function(_0x10b602){if(_0x10b602){_0x3da9ba=_['keyBy'](_0x10b602,'id');var _0x30d36d;var _0x3b7c12=squel[_0xd7cb('0x78')]();_0x3b7c12[_0xd7cb('0x79')](_0x256302[_0xd7cb('0x7a')]);for(var _0x235dfa=0x0;_0x235dfa<_0x45a8c8['length'];_0x235dfa+=0x1){_0x30d36d=_0x45a8c8[_0x235dfa]['MetricId']?_0x3da9ba[_0x45a8c8[_0x235dfa]['MetricId']]['metric']:_0x45a8c8[_0x235dfa][_0xd7cb('0x70')];_0x30d36d=_0x45a8c8[_0x235dfa][_0xd7cb('0x7b')]?_['replace'](_0x241b38[_0x45a8c8[_0x235dfa][_0xd7cb('0x7b')]],'%s',_0x30d36d):_0x30d36d;_0x30d36d=_0x45a8c8[_0x235dfa][_0xd7cb('0x7c')]?_[_0xd7cb('0x7d')](_0x3ffb79[_0x45a8c8[_0x235dfa][_0xd7cb('0x7c')]],'%s',_0x30d36d):_0x30d36d;if(_0x45a8c8[_0x235dfa]['groupBy']){_0x3b7c12['group'](_0x30d36d);}_0x45a8c8[_0x235dfa][_0xd7cb('0x7e')]&&_0x3b7c12['order'](_0x30d36d,_0x45a8c8[_0x235dfa][_0xd7cb('0x7e')]===_0xd7cb('0x7f')?![]:!![]);_0x3b7c12[_0xd7cb('0x70')](_0x30d36d,_0x45a8c8[_0x235dfa][_0xd7cb('0x80')]||_0x30d36d);}if(_0x256302[_0xd7cb('0x81')]){_0x256302[_0xd7cb('0x81')]=JSON[_0xd7cb('0x82')](_0x256302[_0xd7cb('0x81')]);for(var _0x509d52=0x0;_0x509d52<_0x256302[_0xd7cb('0x81')]['length'];_0x509d52+=0x1){if(_0x256302['joins'][_0x509d52][_0xd7cb('0x35')]&&_['includes'](_0x539f4c,_0x256302[_0xd7cb('0x81')][_0x509d52]['type'])&&_0x256302[_0xd7cb('0x81')][_0x509d52][_0xd7cb('0x83')]&&_0x256302['joins'][_0x509d52][_0xd7cb('0x84')]&&_0x256302[_0xd7cb('0x81')][_0x509d52][_0xd7cb('0x85')]){_0x3b7c12[_0x256302[_0xd7cb('0x81')][_0x509d52][_0xd7cb('0x35')]](_0x256302[_0xd7cb('0x81')][_0x509d52][_0xd7cb('0x84')],null,util['format'](_0xd7cb('0x86'),_0x256302[_0xd7cb('0x7a')],_0x256302['joins'][_0x509d52][_0xd7cb('0x83')],_0x256302[_0xd7cb('0x81')][_0x509d52][_0xd7cb('0x84')],_0x256302['joins'][_0x509d52][_0xd7cb('0x85')]));}}}if(_0x256302[_0xd7cb('0x87')]){_0x256302[_0xd7cb('0x87')]=JSON[_0xd7cb('0x82')](_0x256302[_0xd7cb('0x87')]);_0x3b7c12[_0xd7cb('0x43')](_0x13d0a0(_0x256302[_0xd7cb('0x87')][_0xd7cb('0x6f')]));}_0x2ae544=_0x3b7c12[_0xd7cb('0x88')]();_0x3b7c12[_0xd7cb('0x21')](_0x1720e3);_0x3b7c12['offset'](0x0);logger[_0xd7cb('0x89')]('Limited\x20Query:',_0x3b7c12['toString']());return dbH[_0xd7cb('0x8a')][_0xd7cb('0x39')](_0x3b7c12[_0xd7cb('0x8b')](),{'type':dbH['sequelize'][_0xd7cb('0x8c')]['SELECT']});}})['then'](respondWithResult(_0xc5ef31,null))['catch'](handleError(_0xc5ef31,null));};function runReport(_0x51aea9,_0x17fc1f,_0xa3467f){var _0x23f0b7=_0x17fc1f[_0xd7cb('0x2f')];var _0x6aa708=0xa;var _0x18303f=[_0xd7cb('0x5b'),_0xd7cb('0x5c'),_0xd7cb('0x8d'),'cross_join'];var _0xe1fb36={'SUM':_0xd7cb('0x8e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd7cb('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd7cb('0x62'),'GROUP_CONCAT ASC':_0xd7cb('0x63'),'GROUP_CONCAT DESC':_0xd7cb('0x8f')};var _0xb28ed9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xd7cb('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4b6c9b=function(_0x421701){return!_[_0xd7cb('0x68')](['IS\x20NULL',_0xd7cb('0x6a'),_0xd7cb('0x6b'),_0xd7cb('0x6c')],_0x421701);};var _0x79fe2e=function(_0x8f0933){if(!_0x8f0933||!_0x8f0933[_0xd7cb('0x6e')]['length']){return'';}for(var _0x29405d='(',_0x165bf1=0x0;_0x165bf1<_0x8f0933['rules'][_0xd7cb('0x4f')];_0x165bf1+=0x1){_0x165bf1>0x0&&(_0x29405d+='\x20'+_0x8f0933[_0xd7cb('0x6d')]+'\x20');_0x29405d+=_0x8f0933[_0xd7cb('0x6e')][_0x165bf1][_0xd7cb('0x6f')]?_0x79fe2e(_0x8f0933[_0xd7cb('0x6e')][_0x165bf1][_0xd7cb('0x6f')]):_0x8f0933[_0xd7cb('0x6e')][_0x165bf1][_0xd7cb('0x70')]+'\x20'+_0x8f0933['rules'][_0x165bf1][_0xd7cb('0x71')]+(_0x4b6c9b(_0x8f0933[_0xd7cb('0x6e')][_0x165bf1]['condition'])?'\x20'+_0x8f0933[_0xd7cb('0x6e')][_0x165bf1]['value']:'');}return _0x29405d+')';};var _0x1845af={'where':{'id':_0x51aea9['id']}},_0x14a00b,_0x2674a0,_0x524756,_0x368940,_0x9dd168;_0x1845af=_[_0xd7cb('0x45')]({},_0x1845af,_0xa3467f);return db['AnalyticCustomReport'][_0xd7cb('0x50')](_0x1845af)['then'](function(_0x17f6eb){if(_0x17f6eb){_0x14a00b=_0x17f6eb;return _0x17f6eb[_0xd7cb('0x73')]();}return null;})[_0xd7cb('0x28')](function(_0xe87b58){if(_0xe87b58){if(!_0xe87b58['length']){throw new db[(_0xd7cb('0x74'))][(_0xd7cb('0x75'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2674a0=_0xe87b58;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd7cb('0x28')](function(_0x513893){if(_0x513893){_0x524756=_[_0xd7cb('0x90')](_0x513893,'id');var _0x1a7cbb;var _0x3a4ace=squel[_0xd7cb('0x78')]();_0x3a4ace[_0xd7cb('0x79')](_0x14a00b[_0xd7cb('0x7a')]);for(var _0x498654=0x0;_0x498654<_0x2674a0[_0xd7cb('0x4f')];_0x498654+=0x1){_0x1a7cbb=_0x2674a0[_0x498654][_0xd7cb('0x91')]?_0x524756[_0x2674a0[_0x498654]['MetricId']][_0xd7cb('0x92')]:_0x2674a0[_0x498654][_0xd7cb('0x70')];_0x1a7cbb=_0x2674a0[_0x498654]['function']?_[_0xd7cb('0x7d')](_0xe1fb36[_0x2674a0[_0x498654][_0xd7cb('0x7b')]],'%s',_0x1a7cbb):_0x1a7cbb;_0x1a7cbb=_0x2674a0[_0x498654]['format']?_[_0xd7cb('0x7d')](_0xb28ed9[_0x2674a0[_0x498654][_0xd7cb('0x7c')]],'%s',_0x1a7cbb):_0x1a7cbb;if(_0x2674a0[_0x498654]['groupBy']){_0x3a4ace['group'](_0x1a7cbb);}_0x2674a0[_0x498654][_0xd7cb('0x7e')]&&_0x3a4ace[_0xd7cb('0x41')](_0x1a7cbb,_0x2674a0[_0x498654][_0xd7cb('0x7e')]===_0xd7cb('0x7f')?![]:!![]);_0x3a4ace[_0xd7cb('0x70')](_0x1a7cbb,_0x2674a0[_0x498654][_0xd7cb('0x80')]||_0x1a7cbb);}if(_0x14a00b[_0xd7cb('0x81')]){_0x14a00b[_0xd7cb('0x81')]=JSON[_0xd7cb('0x82')](_0x14a00b[_0xd7cb('0x81')]);for(var _0x49b382=0x0;_0x49b382<_0x14a00b[_0xd7cb('0x81')][_0xd7cb('0x4f')];_0x49b382+=0x1){if(_0x14a00b[_0xd7cb('0x81')][_0x49b382][_0xd7cb('0x35')]&&_[_0xd7cb('0x68')](_0x18303f,_0x14a00b['joins'][_0x49b382][_0xd7cb('0x35')])&&_0x14a00b[_0xd7cb('0x81')][_0x49b382]['parentKey']&&_0x14a00b[_0xd7cb('0x81')][_0x49b382]['foreignTable']&&_0x14a00b[_0xd7cb('0x81')][_0x49b382][_0xd7cb('0x85')]){_0x3a4ace[_0x14a00b[_0xd7cb('0x81')][_0x49b382][_0xd7cb('0x35')]](_0x14a00b[_0xd7cb('0x81')][_0x49b382][_0xd7cb('0x84')],null,util['format'](_0xd7cb('0x86'),_0x14a00b[_0xd7cb('0x7a')],_0x14a00b[_0xd7cb('0x81')][_0x49b382][_0xd7cb('0x83')],_0x14a00b['joins'][_0x49b382]['foreignTable'],_0x14a00b['joins'][_0x49b382][_0xd7cb('0x85')]));}}}if(_0x14a00b[_0xd7cb('0x87')]){_0x14a00b[_0xd7cb('0x87')]=JSON[_0xd7cb('0x82')](_0x14a00b[_0xd7cb('0x87')]);_0x3a4ace[_0xd7cb('0x43')](_0x79fe2e(_0x14a00b[_0xd7cb('0x87')][_0xd7cb('0x6f')]));}_0x9dd168=_0x3a4ace[_0xd7cb('0x88')]();_0x3a4ace[_0xd7cb('0x21')](_0x6aa708);_0x3a4ace[_0xd7cb('0x1f')](0x0);return;}})[_0xd7cb('0x28')](function(){if(_0x17fc1f[_0xd7cb('0x93')]===_0xd7cb('0x94')){return null;}var _0x38a1ff=_[_0xd7cb('0x45')](_0x17fc1f,{'name':_0x17fc1f['fullPath']||_0x17fc1f[_0xd7cb('0x2f')]||_0x14a00b[_0xd7cb('0x2f')],'basename':_0x23f0b7,'savename':util[_0xd7cb('0x7c')](_0xd7cb('0x95'),_0x17fc1f[_0xd7cb('0x2f')]||_0x14a00b['name'],require(_0xd7cb('0x96'))[_0xd7cb('0x97')](0x4),_0x17fc1f[_0xd7cb('0x93')]||_0xd7cb('0x98')),'reportId':_0x14a00b['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xd7cb('0x51')](_0x38a1ff,{'raw':!![]});})[_0xd7cb('0x28')](function(_0x31f1cd){if(_0x14a00b[_0xd7cb('0x7a')]===_0xd7cb('0x99')){_0x9dd168['where'](_0x14a00b[_0xd7cb('0x7a')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x17fc1f['startDate'],_0x17fc1f[_0xd7cb('0x9a')]);}else{_0x9dd168[_0xd7cb('0x43')](_0x14a00b[_0xd7cb('0x7a')]+_0xd7cb('0x9b'),_0x17fc1f['startDate'],_0x17fc1f[_0xd7cb('0x9a')]);}if(_0x31f1cd){logger['info'](_0xd7cb('0x9c'),_0x9dd168[_0xd7cb('0x8b')]());require(_0xd7cb('0x9d'))[_0xd7cb('0x9e')](path[_0xd7cb('0x5b')](__dirname,_0xd7cb('0x9f'),_0x31f1cd[_0xd7cb('0x93')]),[_0x31f1cd['id'],_0x9dd168[_0xd7cb('0x8b')](),path[_0xd7cb('0x5b')](__dirname,'../../files/reports',_0x31f1cd[_0xd7cb('0xa0')]),_0x23f0b7]);return _0x31f1cd;}else{var _0x13bea6=squel['select']();_0x13bea6[_0xd7cb('0x79')]('('+_0x9dd168[_0xd7cb('0x8b')]()+')','countTable');_0x13bea6['field'](_0xd7cb('0xa1'),_0xd7cb('0x22'));_0x9dd168['limit'](_0x17fc1f[_0xd7cb('0x21')]||_0x6aa708);_0x9dd168[_0xd7cb('0x1f')](_0x17fc1f[_0xd7cb('0x1f')]||0x0);return dbH['sequelize'][_0xd7cb('0x39')](_0x13bea6['toString'](),{'type':dbH[_0xd7cb('0x8a')][_0xd7cb('0x8c')][_0xd7cb('0xa2')]})[_0xd7cb('0x28')](function(_0x464dd2){if(!_0x464dd2[_0xd7cb('0x4f')]){_0x368940=0x0;}else{_0x368940=_0x464dd2[0x0][_0xd7cb('0x22')]||0x0;}return dbH['sequelize'][_0xd7cb('0x39')](_0x9dd168[_0xd7cb('0x8b')](),{'type':dbH[_0xd7cb('0x8a')][_0xd7cb('0x8c')][_0xd7cb('0xa2')]});})[_0xd7cb('0x28')](function(_0x45f19e){return{'rows':_0x45f19e||[],'count':_0x368940};});}});}exports[_0xd7cb('0xa3')]=function(_0xb76cd0,_0x239193){return runReport(_0xb76cd0[_0xd7cb('0x4e')],_0xb76cd0['query'],_0xb76cd0[_0xd7cb('0x47')])[_0xd7cb('0x28')](respondWithResult(_0x239193,null))['catch'](handleError(_0x239193,null));};exports[_0xd7cb('0xa4')]=runReport;exports[_0xd7cb('0x39')]=function(_0x58a8fa,_0x4303ef){var _0x59e857=0xa;var _0x43c806=[_0xd7cb('0x5b'),_0xd7cb('0x5c'),_0xd7cb('0x8d'),_0xd7cb('0x5d')];var _0x348e34={'SUM':_0xd7cb('0x8e'),'COUNT':_0xd7cb('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xd7cb('0x61'),'AVG':_0xd7cb('0xa5'),'GROUP_CONCAT':_0xd7cb('0x62'),'GROUP_CONCAT ASC':_0xd7cb('0x63'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x11f4ea={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd7cb('0x64'),'HOUR':_0xd7cb('0x65'),'ROUND':_0xd7cb('0x66'),'UNIX_TIMESTAMP':_0xd7cb('0x67')};var _0x21ecc2=function(_0x3c4e6c){return!_[_0xd7cb('0x68')]([_0xd7cb('0x69'),_0xd7cb('0x6a'),_0xd7cb('0x6b'),_0xd7cb('0x6c')],_0x3c4e6c);};var _0x4d8313=function(_0x9cebba){if(!_0x9cebba||!_0x9cebba[_0xd7cb('0x6e')][_0xd7cb('0x4f')]){return'';}for(var _0x4e8919='(',_0x3debdb=0x0;_0x3debdb<_0x9cebba['rules'][_0xd7cb('0x4f')];_0x3debdb+=0x1){_0x3debdb>0x0&&(_0x4e8919+='\x20'+_0x9cebba['operator']+'\x20');_0x4e8919+=_0x9cebba[_0xd7cb('0x6e')][_0x3debdb][_0xd7cb('0x6f')]?_0x4d8313(_0x9cebba['rules'][_0x3debdb]['group']):_0x9cebba[_0xd7cb('0x6e')][_0x3debdb][_0xd7cb('0x70')]+'\x20'+_0x9cebba[_0xd7cb('0x6e')][_0x3debdb][_0xd7cb('0x71')]+(_0x21ecc2(_0x9cebba[_0xd7cb('0x6e')][_0x3debdb]['condition'])?'\x20'+_0x9cebba[_0xd7cb('0x6e')][_0x3debdb][_0xd7cb('0x72')]:'');}return _0x4e8919+')';};var _0x566c78={'where':{'id':_0x58a8fa['params']['id']}},_0x396004,_0x3a0145,_0x184d50,_0x350621,_0x2f9d72;_0x566c78=_[_0xd7cb('0x45')]({},_0x566c78,_0x58a8fa['options']);return db[_0xd7cb('0x32')][_0xd7cb('0x50')](_0x566c78)[_0xd7cb('0x28')](function(_0x525de9){if(_0x525de9){_0x396004=_0x525de9;return _0x525de9[_0xd7cb('0x73')]();}return null;})[_0xd7cb('0x28')](function(_0x5d8eed){if(_0x5d8eed){if(!_0x5d8eed[_0xd7cb('0x4f')]){throw new db[(_0xd7cb('0x74'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3a0145=_0x5d8eed;return db['AnalyticMetric'][_0xd7cb('0x4a')]({'raw':!![]});}return null;})['then'](function(_0x5ad13d){if(_0x5ad13d){_0x184d50=_[_0xd7cb('0x90')](_0x5ad13d,'id');var _0x2235cc;var _0x3a7ccc=squel[_0xd7cb('0x78')]();_0x3a7ccc[_0xd7cb('0x79')](_0x396004[_0xd7cb('0x7a')]);for(var _0x2a24be=0x0;_0x2a24be<_0x3a0145[_0xd7cb('0x4f')];_0x2a24be+=0x1){_0x2235cc=_0x3a0145[_0x2a24be][_0xd7cb('0x91')]?_0x184d50[_0x3a0145[_0x2a24be][_0xd7cb('0x91')]][_0xd7cb('0x92')]:_0x3a0145[_0x2a24be][_0xd7cb('0x70')];_0x2235cc=_0x3a0145[_0x2a24be][_0xd7cb('0x7b')]?_[_0xd7cb('0x7d')](_0x348e34[_0x3a0145[_0x2a24be][_0xd7cb('0x7b')]],'%s',_0x2235cc):_0x2235cc;_0x2235cc=_0x3a0145[_0x2a24be]['format']?_['replace'](_0x11f4ea[_0x3a0145[_0x2a24be][_0xd7cb('0x7c')]],'%s',_0x2235cc):_0x2235cc;if(_0x3a0145[_0x2a24be][_0xd7cb('0xa6')]){_0x3a7ccc[_0xd7cb('0x6f')](_0x2235cc);}_0x3a0145[_0x2a24be][_0xd7cb('0x7e')]&&_0x3a7ccc['order'](_0x2235cc,_0x3a0145[_0x2a24be]['orderBy']===_0xd7cb('0x7f')?![]:!![]);_0x3a7ccc[_0xd7cb('0x70')](_0x2235cc,_0x3a0145[_0x2a24be][_0xd7cb('0x80')]||_0x2235cc);}if(_0x396004[_0xd7cb('0x81')]){_0x396004[_0xd7cb('0x81')]=JSON[_0xd7cb('0x82')](_0x396004[_0xd7cb('0x81')]);for(var _0x3dd5e0=0x0;_0x3dd5e0<_0x396004[_0xd7cb('0x81')][_0xd7cb('0x4f')];_0x3dd5e0+=0x1){if(_0x396004[_0xd7cb('0x81')][_0x3dd5e0]['type']&&_[_0xd7cb('0x68')](_0x43c806,_0x396004[_0xd7cb('0x81')][_0x3dd5e0][_0xd7cb('0x35')])&&_0x396004['joins'][_0x3dd5e0]['parentKey']&&_0x396004[_0xd7cb('0x81')][_0x3dd5e0]['foreignTable']&&_0x396004[_0xd7cb('0x81')][_0x3dd5e0][_0xd7cb('0x85')]){_0x3a7ccc[_0x396004[_0xd7cb('0x81')][_0x3dd5e0][_0xd7cb('0x35')]](_0x396004[_0xd7cb('0x81')][_0x3dd5e0][_0xd7cb('0x84')],null,util[_0xd7cb('0x7c')](_0xd7cb('0x86'),_0x396004[_0xd7cb('0x7a')],_0x396004['joins'][_0x3dd5e0]['parentKey'],_0x396004[_0xd7cb('0x81')][_0x3dd5e0]['foreignTable'],_0x396004[_0xd7cb('0x81')][_0x3dd5e0][_0xd7cb('0x85')]));}}}if(_0x396004[_0xd7cb('0x87')]){_0x396004[_0xd7cb('0x87')]=JSON[_0xd7cb('0x82')](_0x396004['conditions']);_0x3a7ccc['where'](_0x4d8313(_0x396004[_0xd7cb('0x87')][_0xd7cb('0x6f')]));}_0x2f9d72=_0x3a7ccc[_0xd7cb('0x88')]();_0x3a7ccc[_0xd7cb('0x21')](_0x59e857);_0x3a7ccc['offset'](0x0);logger['debug'](_0xd7cb('0xa7'),_0x3a7ccc[_0xd7cb('0x8b')]());return dbH['sequelize']['query'](_0x3a7ccc[_0xd7cb('0x8b')](),{'type':dbH[_0xd7cb('0x8a')]['QueryTypes'][_0xd7cb('0xa2')]});}})[_0xd7cb('0x28')](function(){return{'sql':_0x2f9d72[_0xd7cb('0x8b')]()};})['then'](respondWithResult(_0x4303ef,null))[_0xd7cb('0x4c')](handleError(_0x4303ef,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index c693945..d9bd9d9 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 _0xba89=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','moment','request-promise'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xba89,0x193));var _0x9ba8=function(_0x3f017a,_0x24ba1f){_0x3f017a=_0x3f017a-0x0;var _0x172281=_0xba89[_0x3f017a];return _0x172281;};'use strict';var _=require(_0x9ba8('0x0'));var util=require(_0x9ba8('0x1'));var logger=require('../../config/logger')(_0x9ba8('0x2'));var moment=require(_0x9ba8('0x3'));var BPromise=require('bluebird');var rp=require(_0x9ba8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ba8('0x5'));var config=require(_0x9ba8('0x6'));var attributes=require(_0x9ba8('0x7'));module[_0x9ba8('0x8')]=function(_0x97113f,_0x35950b){return _0x97113f[_0x9ba8('0x9')](_0x9ba8('0xa'),attributes,{'tableName':_0x9ba8('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0071=['exports','define','AnalyticCustomReport','analytics_custom_reports','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x3041dc,_0x17d011){var _0x38fd56=function(_0x591601){while(--_0x591601){_0x3041dc['push'](_0x3041dc['shift']());}};_0x38fd56(++_0x17d011);}(_0x0071,0x117));var _0x1007=function(_0x26679e,_0x508e1c){_0x26679e=_0x26679e-0x0;var _0x18c847=_0x0071[_0x26679e];return _0x18c847;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1007('0x0'))(_0x1007('0x1'));var moment=require('moment');var BPromise=require(_0x1007('0x2'));var rp=require(_0x1007('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1007('0x4'));var config=require(_0x1007('0x5'));var attributes=require(_0x1007('0x6'));module[_0x1007('0x7')]=function(_0x191b7b,_0x567754){return _0x191b7b[_0x1007('0x8')](_0x1007('0x9'),attributes,{'tableName':_0x1007('0xa'),'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 96250fd..04fbac1 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 _0xa45b=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xa45b,0x19d));var _0xba45=function(_0x37de20,_0x742c09){_0x37de20=_0x37de20-0x0;var _0xa5b52e=_0xa45b[_0x37de20];return _0xa5b52e;};'use strict';var _=require(_0xba45('0x0'));var util=require(_0xba45('0x1'));var moment=require(_0xba45('0x2'));var BPromise=require(_0xba45('0x3'));var rs=require(_0xba45('0x4'));var fs=require('fs');var Redis=require(_0xba45('0x5'));var db=require(_0xba45('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xba45('0x7'))(_0xba45('0x8'));var config=require(_0xba45('0x9'));var jayson=require(_0xba45('0xa'));var client=jayson[_0xba45('0xb')][_0xba45('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb3fac4,_0x3c9ed3,_0x1a9974){return new BPromise(function(_0x352984,_0x1b7936){return client[_0xba45('0xd')](_0xb3fac4,_0x1a9974)[_0xba45('0xe')](function(_0x3594ef){logger[_0xba45('0xf')](_0xba45('0x10'),_0x3c9ed3,_0xba45('0x11'));logger[_0xba45('0x12')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x3c9ed3,_0xba45('0x11'),JSON[_0xba45('0x13')](_0x3594ef));if(_0x3594ef[_0xba45('0x14')]){if(_0x3594ef['error'][_0xba45('0x15')]===0x1f4){logger[_0xba45('0x14')](_0xba45('0x10'),_0x3c9ed3,_0x3594ef[_0xba45('0x14')]['message']);return _0x1b7936(_0x3594ef[_0xba45('0x14')][_0xba45('0x16')]);}logger['error'](_0xba45('0x10'),_0x3c9ed3,_0x3594ef[_0xba45('0x14')][_0xba45('0x16')]);return _0x352984(_0x3594ef[_0xba45('0x14')]['message']);}else{logger[_0xba45('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3c9ed3,_0xba45('0x11'));_0x352984(_0x3594ef[_0xba45('0x17')][_0xba45('0x16')]);}})[_0xba45('0x18')](function(_0x516c16){logger[_0xba45('0x14')](_0xba45('0x10'),_0x3c9ed3,_0x516c16);_0x1b7936(_0x516c16);});});}
\ No newline at end of file
+var _0x7bc2=['jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x695b76,_0x551526){var _0x1dc21f=function(_0x5fdb1c){while(--_0x5fdb1c){_0x695b76['push'](_0x695b76['shift']());}};_0x1dc21f(++_0x551526);}(_0x7bc2,0xad));var _0x27bc=function(_0x135898,_0xccb464){_0x135898=_0x135898-0x0;var _0x27368e=_0x7bc2[_0x135898];return _0x27368e;};'use strict';var _=require(_0x27bc('0x0'));var util=require(_0x27bc('0x1'));var moment=require(_0x27bc('0x2'));var BPromise=require(_0x27bc('0x3'));var rs=require(_0x27bc('0x4'));var fs=require('fs');var Redis=require(_0x27bc('0x5'));var db=require(_0x27bc('0x6'))['db'];var utils=require(_0x27bc('0x7'));var logger=require(_0x27bc('0x8'))(_0x27bc('0x9'));var config=require(_0x27bc('0xa'));var jayson=require(_0x27bc('0xb'));var client=jayson['client'][_0x27bc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c1329,_0x1ddd7e,_0x42dd23){return new BPromise(function(_0x5c4190,_0x46b10c){return client[_0x27bc('0xd')](_0x4c1329,_0x42dd23)[_0x27bc('0xe')](function(_0x3ef077){logger[_0x27bc('0xf')](_0x27bc('0x10'),_0x1ddd7e,_0x27bc('0x11'));logger[_0x27bc('0x12')](_0x27bc('0x13'),_0x1ddd7e,'request\x20sent',JSON[_0x27bc('0x14')](_0x3ef077));if(_0x3ef077[_0x27bc('0x15')]){if(_0x3ef077['error']['code']===0x1f4){logger[_0x27bc('0x15')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1ddd7e,_0x3ef077[_0x27bc('0x15')][_0x27bc('0x16')]);return _0x46b10c(_0x3ef077[_0x27bc('0x15')][_0x27bc('0x16')]);}logger[_0x27bc('0x15')](_0x27bc('0x10'),_0x1ddd7e,_0x3ef077[_0x27bc('0x15')][_0x27bc('0x16')]);return _0x5c4190(_0x3ef077[_0x27bc('0x15')][_0x27bc('0x16')]);}else{logger['info'](_0x27bc('0x10'),_0x1ddd7e,'request\x20sent');_0x5c4190(_0x3ef077['result']['message']);}})['catch'](function(_0x2b52b1){logger[_0x27bc('0x15')](_0x27bc('0x10'),_0x1ddd7e,_0x2b52b1);_0x46b10c(_0x2b52b1);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index c952df5..ca19c10 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 _0xd37c=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','run','post','create','put','destroy','multer','util'];(function(_0x46bc12,_0x5e2b34){var _0x44e497=function(_0x335051){while(--_0x335051){_0x46bc12['push'](_0x46bc12['shift']());}};_0x44e497(++_0x5e2b34);}(_0xd37c,0x1e1));var _0xcd37=function(_0x4fd40a,_0xa699ab){_0x4fd40a=_0x4fd40a-0x0;var _0x586cc6=_0xd37c[_0x4fd40a];return _0x586cc6;};'use strict';var multer=require(_0xcd37('0x0'));var util=require(_0xcd37('0x1'));var path=require(_0xcd37('0x2'));var timeout=require(_0xcd37('0x3'));var express=require(_0xcd37('0x4'));var router=express[_0xcd37('0x5')]();var fs_extra=require(_0xcd37('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xcd37('0x7'));var config=require(_0xcd37('0x8'));var controller=require(_0xcd37('0x9'));router[_0xcd37('0xa')]('/',auth[_0xcd37('0xb')](),controller[_0xcd37('0xc')]);router[_0xcd37('0xa')](_0xcd37('0xd'),auth[_0xcd37('0xb')](),controller['show']);router[_0xcd37('0xa')](_0xcd37('0xe'),auth[_0xcd37('0xb')](),controller[_0xcd37('0xf')]);router[_0xcd37('0xa')]('/:id/run',auth['isAuthenticated'](),controller[_0xcd37('0x10')]);router[_0xcd37('0xa')]('/:id/query',auth[_0xcd37('0xb')](),controller['query']);router[_0xcd37('0x11')]('/',auth['isAuthenticated'](),controller[_0xcd37('0x12')]);router[_0xcd37('0x13')](_0xcd37('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xcd37('0xd'),auth[_0xcd37('0xb')](),controller[_0xcd37('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x4e15=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0xbd09e4,_0x42e6ae){var _0x55e630=function(_0x9b1917){while(--_0x9b1917){_0xbd09e4['push'](_0xbd09e4['shift']());}};_0x55e630(++_0x42e6ae);}(_0x4e15,0x1c6));var _0x54e1=function(_0x354da0,_0x1ee027){_0x354da0=_0x354da0-0x0;var _0x3c9244=_0x4e15[_0x354da0];return _0x3c9244;};'use strict';var multer=require(_0x54e1('0x0'));var util=require(_0x54e1('0x1'));var path=require(_0x54e1('0x2'));var timeout=require(_0x54e1('0x3'));var express=require(_0x54e1('0x4'));var router=express[_0x54e1('0x5')]();var fs_extra=require(_0x54e1('0x6'));var auth=require(_0x54e1('0x7'));var interaction=require(_0x54e1('0x8'));var config=require(_0x54e1('0x9'));var controller=require(_0x54e1('0xa'));router[_0x54e1('0xb')]('/',auth[_0x54e1('0xc')](),controller[_0x54e1('0xd')]);router['get'](_0x54e1('0xe'),auth[_0x54e1('0xc')](),controller[_0x54e1('0xf')]);router[_0x54e1('0xb')](_0x54e1('0x10'),auth[_0x54e1('0xc')](),controller[_0x54e1('0x11')]);router['get'](_0x54e1('0x12'),auth[_0x54e1('0xc')](),controller['run']);router[_0x54e1('0xb')](_0x54e1('0x13'),auth[_0x54e1('0xc')](),controller[_0x54e1('0x14')]);router[_0x54e1('0x15')]('/',auth[_0x54e1('0xc')](),controller[_0x54e1('0x16')]);router[_0x54e1('0x17')](_0x54e1('0xe'),auth[_0x54e1('0xc')](),controller[_0x54e1('0x18')]);router[_0x54e1('0x19')](_0x54e1('0xe'),auth[_0x54e1('0xc')](),controller['destroy']);module[_0x54e1('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index cd08bf8..171b13e 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 _0xae24=['sequelize','STRING'];(function(_0x4744ce,_0x476e99){var _0x41cf3f=function(_0x4dd841){while(--_0x4dd841){_0x4744ce['push'](_0x4744ce['shift']());}};_0x41cf3f(++_0x476e99);}(_0xae24,0x182));var _0x4ae2=function(_0x1f15de,_0x327ced){_0x1f15de=_0x1f15de-0x0;var _0x12b6a7=_0xae24[_0x1f15de];return _0x12b6a7;};'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
+var _0xb4c7=['STRING','TEXT','sequelize','exports'];(function(_0x52f159,_0x419d8a){var _0x156799=function(_0xf168e8){while(--_0xf168e8){_0x52f159['push'](_0x52f159['shift']());}};_0x156799(++_0x419d8a);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4445a9,_0x4d7cc8){_0x4445a9=_0x4445a9-0x0;var _0x18d7f8=_0xb4c7[_0x4445a9];return _0x18d7f8;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7b4c('0x2')]},'parent':{'type':Sequelize[_0x7b4c('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7b4c('0x3')]},'joins':{'type':Sequelize[_0x7b4c('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 98289a7..880a29a 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 _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x4e9467,_0x3e7800){var _0x5fe528=function(_0x6938ea){while(--_0x6938ea){_0x4e9467['push'](_0x4e9467['shift']());}};_0x5fe528(++_0x3e7800);}(_0xf494,0x1c6));var _0x4f49=function(_0x50e05c,_0x16834d){_0x50e05c=_0x50e05c-0x0;var _0x17b8fe=_0xf494[_0x50e05c];return _0x17b8fe;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,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(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x2ef3,0xba));var _0x32ef=function(_0x5d6f82,_0x1ec9b6){_0x5d6f82=_0x5d6f82-0x0;var _0x4f1af0=_0x2ef3[_0x5d6f82];return _0x4f1af0;};'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 db60b65..d6446dc 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 _0x4256=['rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x251b02,_0x38c0f7){var _0x14017c=function(_0x7a976a){while(--_0x7a976a){_0x251b02['push'](_0x251b02['shift']());}};_0x14017c(++_0x38c0f7);}(_0x4256,0x148));var _0x6425=function(_0x4a209a,_0x575ff9){_0x4a209a=_0x4a209a-0x0;var _0x4b3c20=_0x4256[_0x4a209a];return _0x4b3c20;};'use strict';var _=require(_0x6425('0x0'));var util=require(_0x6425('0x1'));var logger=require(_0x6425('0x2'))(_0x6425('0x3'));var moment=require(_0x6425('0x4'));var BPromise=require(_0x6425('0x5'));var rp=require(_0x6425('0x6'));var fs=require('fs');var path=require(_0x6425('0x7'));var rimraf=require(_0x6425('0x8'));var config=require(_0x6425('0x9'));var attributes=require('./analyticDefaultReport.attributes');module[_0x6425('0xa')]=function(_0x384476,_0x2caeed){return _0x384476[_0x6425('0xb')](_0x6425('0xc'),attributes,{'tableName':_0x6425('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x028e=['bluebird','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','lodash','util','../../config/logger','api'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x028e,0x71));var _0xe028=function(_0x11f24d,_0x58f26a){_0x11f24d=_0x11f24d-0x0;var _0x1a86e6=_0x028e[_0x11f24d];return _0x1a86e6;};'use strict';var _=require(_0xe028('0x0'));var util=require(_0xe028('0x1'));var logger=require(_0xe028('0x2'))(_0xe028('0x3'));var moment=require('moment');var BPromise=require(_0xe028('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe028('0x5'));var attributes=require(_0xe028('0x6'));module[_0xe028('0x7')]=function(_0x34e511,_0x3bc0d6){return _0x34e511['define']('AnalyticDefaultReport',attributes,{'tableName':_0xe028('0x8'),'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 bb393df..adc83fa 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 _0xcea9=['code','message','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x399b34,_0x30d7e0){var _0xd355a7=function(_0x515fe8){while(--_0x515fe8){_0x399b34['push'](_0x399b34['shift']());}};_0xd355a7(++_0x30d7e0);}(_0xcea9,0x1e2));var _0x9cea=function(_0x55730b,_0x160fe8){_0x55730b=_0x55730b-0x0;var _0x548413=_0xcea9[_0x55730b];return _0x548413;};'use strict';var _=require(_0x9cea('0x0'));var util=require(_0x9cea('0x1'));var moment=require(_0x9cea('0x2'));var BPromise=require('bluebird');var rs=require(_0x9cea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9cea('0x4'))['db'];var utils=require(_0x9cea('0x5'));var logger=require(_0x9cea('0x6'))('rpc');var config=require(_0x9cea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9cea('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1930c5,_0x497fa9,_0x5bc605){return new BPromise(function(_0x487740,_0xefdc1a){return client[_0x9cea('0x9')](_0x1930c5,_0x5bc605)[_0x9cea('0xa')](function(_0x5aa49f){logger[_0x9cea('0xb')](_0x9cea('0xc'),_0x497fa9,_0x9cea('0xd'));logger[_0x9cea('0xe')](_0x9cea('0xf'),_0x497fa9,'request\x20sent',JSON[_0x9cea('0x10')](_0x5aa49f));if(_0x5aa49f[_0x9cea('0x11')]){if(_0x5aa49f['error'][_0x9cea('0x12')]===0x1f4){logger[_0x9cea('0x11')](_0x9cea('0xc'),_0x497fa9,_0x5aa49f[_0x9cea('0x11')][_0x9cea('0x13')]);return _0xefdc1a(_0x5aa49f['error'][_0x9cea('0x13')]);}logger[_0x9cea('0x11')](_0x9cea('0xc'),_0x497fa9,_0x5aa49f[_0x9cea('0x11')]['message']);return _0x487740(_0x5aa49f[_0x9cea('0x11')][_0x9cea('0x13')]);}else{logger[_0x9cea('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x497fa9,_0x9cea('0xd'));_0x487740(_0x5aa49f['result'][_0x9cea('0x13')]);}})['catch'](function(_0x353655){logger[_0x9cea('0x11')](_0x9cea('0xc'),_0x497fa9,_0x353655);_0xefdc1a(_0x353655);});});}
\ No newline at end of file
+var _0xb711=['util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x7d152a,_0x2e9d56){var _0x35c0ae=function(_0x598bd4){while(--_0x598bd4){_0x7d152a['push'](_0x7d152a['shift']());}};_0x35c0ae(++_0x2e9d56);}(_0xb711,0x113));var _0x1b71=function(_0x2e0b2f,_0x25172b){_0x2e0b2f=_0x2e0b2f-0x0;var _0x5cf0fa=_0xb711[_0x2e0b2f];return _0x5cf0fa;};'use strict';var _=require(_0x1b71('0x0'));var util=require(_0x1b71('0x1'));var moment=require('moment');var BPromise=require(_0x1b71('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b71('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b71('0x4'))(_0x1b71('0x5'));var config=require(_0x1b71('0x6'));var jayson=require(_0x1b71('0x7'));var client=jayson[_0x1b71('0x8')][_0x1b71('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x498ed5,_0x276dff,_0x301e89){return new BPromise(function(_0xa642e0,_0xece037){return client[_0x1b71('0xa')](_0x498ed5,_0x301e89)[_0x1b71('0xb')](function(_0x5b5ba7){logger['info'](_0x1b71('0xc'),_0x276dff,_0x1b71('0xd'));logger[_0x1b71('0xe')](_0x1b71('0xf'),_0x276dff,_0x1b71('0xd'),JSON[_0x1b71('0x10')](_0x5b5ba7));if(_0x5b5ba7[_0x1b71('0x11')]){if(_0x5b5ba7['error'][_0x1b71('0x12')]===0x1f4){logger[_0x1b71('0x11')](_0x1b71('0xc'),_0x276dff,_0x5b5ba7['error'][_0x1b71('0x13')]);return _0xece037(_0x5b5ba7[_0x1b71('0x11')][_0x1b71('0x13')]);}logger[_0x1b71('0x11')](_0x1b71('0xc'),_0x276dff,_0x5b5ba7[_0x1b71('0x11')][_0x1b71('0x13')]);return _0xa642e0(_0x5b5ba7[_0x1b71('0x11')][_0x1b71('0x13')]);}else{logger[_0x1b71('0x14')](_0x1b71('0xc'),_0x276dff,'request\x20sent');_0xa642e0(_0x5b5ba7[_0x1b71('0x15')][_0x1b71('0x13')]);}})[_0x1b71('0x16')](function(_0x409816){logger[_0x1b71('0x11')](_0x1b71('0xc'),_0x276dff,_0x409816);_0xece037(_0x409816);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 86d2e82..ca6b3c1 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 _0x9c49=['multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','/:id','get','preview','/:id/run','/:id/query','post','create','put','update','destroy','exports'];(function(_0x1ebf08,_0x7a822b){var _0x1adb9d=function(_0xd4688){while(--_0xd4688){_0x1ebf08['push'](_0x1ebf08['shift']());}};_0x1adb9d(++_0x7a822b);}(_0x9c49,0x1c8));var _0x99c4=function(_0x18bf47,_0x400206){_0x18bf47=_0x18bf47-0x0;var _0x408e64=_0x9c49[_0x18bf47];return _0x408e64;};'use strict';var multer=require(_0x99c4('0x0'));var util=require(_0x99c4('0x1'));var path=require('path');var timeout=require(_0x99c4('0x2'));var express=require('express');var router=express[_0x99c4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x99c4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x99c4('0x5'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x99c4('0x6')](),controller[_0x99c4('0x7')]);router['get'](_0x99c4('0x8'),auth[_0x99c4('0x6')](),controller['show']);router[_0x99c4('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0x99c4('0xa')]);router['get'](_0x99c4('0xb'),auth[_0x99c4('0x6')](),controller['run']);router[_0x99c4('0x9')](_0x99c4('0xc'),auth[_0x99c4('0x6')](),controller['query']);router[_0x99c4('0xd')]('/',auth[_0x99c4('0x6')](),controller[_0x99c4('0xe')]);router[_0x99c4('0xf')](_0x99c4('0x8'),auth[_0x99c4('0x6')](),controller[_0x99c4('0x10')]);router['delete'](_0x99c4('0x8'),auth[_0x99c4('0x6')](),controller[_0x99c4('0x11')]);module[_0x99c4('0x12')]=router;
\ No newline at end of file
+var _0x19b7=['get','isAuthenticated','/:id/preview','/:id/run','run','/:id/query','query','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x19b7,0x157));var _0x719b=function(_0x47ca08,_0x3c48da){_0x47ca08=_0x47ca08-0x0;var _0x17636f=_0x19b7[_0x47ca08];return _0x17636f;};'use strict';var multer=require('multer');var util=require(_0x719b('0x0'));var path=require(_0x719b('0x1'));var timeout=require(_0x719b('0x2'));var express=require(_0x719b('0x3'));var router=express[_0x719b('0x4')]();var fs_extra=require(_0x719b('0x5'));var auth=require(_0x719b('0x6'));var interaction=require(_0x719b('0x7'));var config=require('../../config/environment');var controller=require(_0x719b('0x8'));router[_0x719b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x719b('0xa')](),controller['show']);router[_0x719b('0x9')](_0x719b('0xb'),auth[_0x719b('0xa')](),controller['preview']);router[_0x719b('0x9')](_0x719b('0xc'),auth[_0x719b('0xa')](),controller[_0x719b('0xd')]);router['get'](_0x719b('0xe'),auth[_0x719b('0xa')](),controller[_0x719b('0xf')]);router['post']('/',auth[_0x719b('0xa')](),controller[_0x719b('0x10')]);router['put'](_0x719b('0x11'),auth[_0x719b('0xa')](),controller[_0x719b('0x12')]);router[_0x719b('0x13')](_0x719b('0x11'),auth['isAuthenticated'](),controller[_0x719b('0x14')]);module[_0x719b('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 41002eb..a70434e 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 _0x3f7f=['sequelize','moment','STRING','ENUM','csv','pdf','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x49f02c,_0xaa1372){var _0x193b81=function(_0x3cc300){while(--_0x3cc300){_0x49f02c['push'](_0x49f02c['shift']());}};_0x193b81(++_0xaa1372);}(_0x3f7f,0x16b));var _0xf3f7=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x3f7f[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0xf3f7('0x0'));var moment=require(_0xf3f7('0x1'));module['exports']={'name':{'type':Sequelize[_0xf3f7('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xf3f7('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xf3f7('0x3')](_0xf3f7('0x4'),_0xf3f7('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0xf3f7('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xf3f7('0x6')]},'endDate':{'type':Sequelize[_0xf3f7('0x6')]},'status':{'type':Sequelize[_0xf3f7('0x2')],'defaultValue':_0xf3f7('0x7')},'type':{'type':Sequelize['ENUM'](_0xf3f7('0x8'),_0xf3f7('0x9')),'allowNull':![],'defaultValue':_0xf3f7('0x8')},'reportId':{'type':Sequelize[_0xf3f7('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x96ad=['moment','exports','STRING','ENUM','pdf','xlsx','csv','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x27e025,_0x2264f3){var _0x563bde=function(_0x22cd55){while(--_0x22cd55){_0x27e025['push'](_0x27e025['shift']());}};_0x563bde(++_0x2264f3);}(_0x96ad,0xf0));var _0xd96a=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0x96ad[_0x28a5ad];return _0x176b8a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd96a('0x0'));module[_0xd96a('0x1')]={'name':{'type':Sequelize[_0xd96a('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xd96a('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xd96a('0x3')]('csv',_0xd96a('0x4'),_0xd96a('0x5')),'allowNull':![],'defaultValue':_0xd96a('0x6')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xd96a('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0xd96a('0x8')},'type':{'type':Sequelize[_0xd96a('0x3')](_0xd96a('0x9'),_0xd96a('0xa')),'allowNull':![],'defaultValue':_0xd96a('0x9')},'reportId':{'type':Sequelize[_0xd96a('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xd96a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index f0ca3ae..2572f5f 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 _0x38dc=['output','existsSync','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','join','format','%s.%s','toLowerCase','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','sort','filter','merge','where','options','includeAll','include','rows','catch','show','params','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename'];(function(_0x3ec641,_0x2bb3b3){var _0xf002a2=function(_0x522f70){while(--_0x522f70){_0x3ec641['push'](_0x3ec641['shift']());}};_0xf002a2(++_0x2bb3b3);}(_0x38dc,0x6b));var _0xc38d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x38dc[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc38d('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc38d('0x1'));var moment=require(_0xc38d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc38d('0x3'));var util=require(_0xc38d('0x4'));var path=require(_0xc38d('0x5'));var sox=require(_0xc38d('0x6'));var csv=require(_0xc38d('0x7'));var ejs=require(_0xc38d('0x8'));var fs=require('fs');var fs_extra=require(_0xc38d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc38d('0xa'));var jsforce=require(_0xc38d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc38d('0x7'));var querystring=require(_0xc38d('0xc'));var Papa=require(_0xc38d('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc38d('0xe'));var as=require(_0xc38d('0xf'));var hardwareService=require(_0xc38d('0x10'));var logger=require(_0xc38d('0x11'))('api');var utils=require(_0xc38d('0x12'));var config=require(_0xc38d('0x13'));var licenseUtil=require(_0xc38d('0x14'));var db=require(_0xc38d('0x15'))['db'];function respondWithStatusCode(_0x2748c1,_0x29c85d){_0x29c85d=_0x29c85d||0xcc;return function(_0x5a689c){if(_0x5a689c){return _0x2748c1['sendStatus'](_0x29c85d);}return _0x2748c1[_0xc38d('0x16')](_0x29c85d)[_0xc38d('0x17')]();};}function respondWithResult(_0x19cd72,_0x1d40df){_0x1d40df=_0x1d40df||0xc8;return function(_0x2c239f){if(_0x2c239f){return _0x19cd72[_0xc38d('0x16')](_0x1d40df)[_0xc38d('0x18')](_0x2c239f);}};}function respondWithFilteredResult(_0x3460d9,_0x3aded6){return function(_0x1a78f3){if(_0x1a78f3){var _0x35864b=typeof _0x3aded6[_0xc38d('0x19')]===_0xc38d('0x1a')&&typeof _0x3aded6[_0xc38d('0x1b')]===_0xc38d('0x1a');var _0x5bd11c=_0x1a78f3[_0xc38d('0x1c')];var _0x5d4b27=_0x35864b?0x0:_0x3aded6[_0xc38d('0x19')];var _0x1d0c2b=_0x35864b?_0x1a78f3['count']:_0x3aded6[_0xc38d('0x19')]+_0x3aded6['limit'];var _0x424b74;if(_0x1d0c2b>=_0x5bd11c){_0x1d0c2b=_0x5bd11c;_0x424b74=0xc8;}else{_0x424b74=0xce;}_0x3460d9[_0xc38d('0x16')](_0x424b74);return _0x3460d9[_0xc38d('0x1d')]('Content-Range',_0x5d4b27+'-'+_0x1d0c2b+'/'+_0x5bd11c)[_0xc38d('0x18')](_0x1a78f3);}return null;};}function patchUpdates(_0x1a671f){return function(_0x1ad239){try{jsonpatch[_0xc38d('0x1e')](_0x1ad239,_0x1a671f,!![]);}catch(_0xf29bc8){return BPromise[_0xc38d('0x1f')](_0xf29bc8);}return _0x1ad239[_0xc38d('0x20')]();};}function saveUpdates(_0x4ced7f,_0x549d07){return function(_0x5b525a){if(_0x5b525a){return _0x5b525a[_0xc38d('0x21')](_0x4ced7f)[_0xc38d('0x22')](function(_0xcabdc7){return _0xcabdc7;});}return null;};}function removeEntity(_0x3a088b,_0x3c14f1){return function(_0x1fd785){if(_0x1fd785){return _0x1fd785['destroy']()['then'](function(){var _0x28a810=_0x1fd785[_0xc38d('0x23')]({'plain':!![]});var _0x26e487=_0xc38d('0x24');return db[_0xc38d('0x25')][_0xc38d('0x26')]({'where':{'type':_0x26e487,'resourceId':_0x28a810['id']}})[_0xc38d('0x22')](function(){return _0x1fd785;});})[_0xc38d('0x22')](function(){_0x3a088b[_0xc38d('0x16')](0xcc)[_0xc38d('0x17')]();});}};}function handleEntityNotFound(_0x333965,_0x40b869){return function(_0x538acb){if(!_0x538acb){_0x333965[_0xc38d('0x27')](0x194);}return _0x538acb;};}function handleError(_0x135974,_0x53152f){_0x53152f=_0x53152f||0x1f4;return function(_0x2c5612){logger[_0xc38d('0x28')](_0x2c5612[_0xc38d('0x29')]);if(_0x2c5612[_0xc38d('0x2a')]){delete _0x2c5612[_0xc38d('0x2a')];}_0x135974[_0xc38d('0x16')](_0x53152f)[_0xc38d('0x2b')](_0x2c5612);};}exports[_0xc38d('0x2c')]=function(_0x862e3,_0x493ca7){var _0x4aeada={},_0xa6f4c7={},_0x56a1b4={'count':0x0,'rows':[]};var _0x3b15d3=_[_0xc38d('0x2d')](db[_0xc38d('0x2e')][_0xc38d('0x2f')],function(_0x2f3410){return{'name':_0x2f3410[_0xc38d('0x30')],'type':_0x2f3410[_0xc38d('0x31')][_0xc38d('0x32')]};});_0xa6f4c7[_0xc38d('0x33')]=_[_0xc38d('0x2d')](_0x3b15d3,_0xc38d('0x2a'));_0xa6f4c7[_0xc38d('0x34')]=_[_0xc38d('0x35')](_0x862e3[_0xc38d('0x34')]);_0xa6f4c7[_0xc38d('0x36')]=_['intersection'](_0xa6f4c7['model'],_0xa6f4c7[_0xc38d('0x34')]);_0x4aeada[_0xc38d('0x37')]=_['intersection'](_0xa6f4c7['model'],qs['fields'](_0x862e3[_0xc38d('0x34')][_0xc38d('0x38')]));_0x4aeada[_0xc38d('0x37')]=_0x4aeada[_0xc38d('0x37')][_0xc38d('0x39')]?_0x4aeada[_0xc38d('0x37')]:_0xa6f4c7[_0xc38d('0x33')];if(!_0x862e3[_0xc38d('0x34')][_0xc38d('0x3a')]('nolimit')){_0x4aeada[_0xc38d('0x1b')]=qs[_0xc38d('0x1b')](_0x862e3[_0xc38d('0x34')][_0xc38d('0x1b')]);_0x4aeada[_0xc38d('0x19')]=qs[_0xc38d('0x19')](_0x862e3['query'][_0xc38d('0x19')]);}_0x4aeada['order']=qs['sort'](_0x862e3[_0xc38d('0x34')][_0xc38d('0x3b')]);_0x4aeada['where']=qs['filters'](_['pick'](_0x862e3[_0xc38d('0x34')],_0xa6f4c7[_0xc38d('0x36')]),_0x3b15d3);if(_0x862e3[_0xc38d('0x34')][_0xc38d('0x3c')]){_0x4aeada['where']=_[_0xc38d('0x3d')](_0x4aeada[_0xc38d('0x3e')],{'$or':_[_0xc38d('0x2d')](_0x3b15d3,function(_0x25bc4a){if(_0x25bc4a[_0xc38d('0x31')]!=='VIRTUAL'){var _0x1e1ee7={};_0x1e1ee7[_0x25bc4a['name']]={'$like':'%'+_0x862e3['query'][_0xc38d('0x3c')]+'%'};return _0x1e1ee7;}})});}_0x4aeada=_[_0xc38d('0x3d')]({},_0x4aeada,_0x862e3[_0xc38d('0x3f')]);var _0x41b919={'where':_0x4aeada['where']};return db[_0xc38d('0x2e')]['count'](_0x41b919)[_0xc38d('0x22')](function(_0x9d10a7){_0x56a1b4[_0xc38d('0x1c')]=_0x9d10a7;if(_0x862e3[_0xc38d('0x34')][_0xc38d('0x40')]){_0x4aeada[_0xc38d('0x41')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x4aeada);})['then'](function(_0x329f80){_0x56a1b4[_0xc38d('0x42')]=_0x329f80;return _0x56a1b4;})['then'](respondWithFilteredResult(_0x493ca7,_0x4aeada))[_0xc38d('0x43')](handleError(_0x493ca7,null));};exports[_0xc38d('0x44')]=function(_0x2297c9,_0x22c683){var _0x4bdf08={'raw':!![],'where':{'id':_0x2297c9[_0xc38d('0x45')]['id']}},_0x44ad38={};_0x44ad38['model']=_[_0xc38d('0x35')](db['AnalyticExtractedReport'][_0xc38d('0x2f')]);_0x44ad38[_0xc38d('0x34')]=_['keys'](_0x2297c9['query']);_0x44ad38['filters']=_['intersection'](_0x44ad38[_0xc38d('0x33')],_0x44ad38['query']);_0x4bdf08[_0xc38d('0x37')]=_[_0xc38d('0x46')](_0x44ad38[_0xc38d('0x33')],qs['fields'](_0x2297c9['query'][_0xc38d('0x38')]));_0x4bdf08['attributes']=_0x4bdf08['attributes']['length']?_0x4bdf08[_0xc38d('0x37')]:_0x44ad38[_0xc38d('0x33')];if(_0x2297c9['query']['includeAll']){_0x4bdf08[_0xc38d('0x41')]=[{'all':!![]}];}_0x4bdf08=_[_0xc38d('0x3d')]({},_0x4bdf08,_0x2297c9[_0xc38d('0x3f')]);return db[_0xc38d('0x2e')]['find'](_0x4bdf08)[_0xc38d('0x22')](handleEntityNotFound(_0x22c683,null))[_0xc38d('0x22')](respondWithResult(_0x22c683,null))[_0xc38d('0x43')](handleError(_0x22c683,null));};exports[_0xc38d('0x47')]=function(_0x59e975,_0x19d6bd){return db[_0xc38d('0x2e')][_0xc38d('0x47')](_0x59e975[_0xc38d('0x48')],{})[_0xc38d('0x22')](function(_0x2072c2){var _0x1177a6=_0x59e975[_0xc38d('0x49')][_0xc38d('0x23')]({'plain':!![]});if(!_0x1177a6)throw new Error(_0xc38d('0x4a'));if(_0x1177a6[_0xc38d('0x4b')]===_0xc38d('0x49')){var _0x2fb257=_0x2072c2[_0xc38d('0x23')]({'plain':!![]});var _0x36a18a='ExtractedReports';return db[_0xc38d('0x4c')][_0xc38d('0x4d')]({'where':{'name':_0x36a18a,'userProfileId':_0x1177a6[_0xc38d('0x4e')]},'raw':!![]})[_0xc38d('0x22')](function(_0x55f06a){if(_0x55f06a&&_0x55f06a[_0xc38d('0x4f')]===0x0){return db['UserProfileResource'][_0xc38d('0x47')]({'name':_0x2fb257[_0xc38d('0x2a')],'resourceId':_0x2fb257['id'],'type':_0x55f06a['name'],'sectionId':_0x55f06a['id']},{})[_0xc38d('0x22')](function(){return _0x2072c2;});}else{return _0x2072c2;}})[_0xc38d('0x43')](function(_0x46627a){logger[_0xc38d('0x28')](_0xc38d('0x50'),_0x46627a);throw _0x46627a;});}return _0x2072c2;})[_0xc38d('0x22')](respondWithResult(_0x19d6bd,0xc9))['catch'](handleError(_0x19d6bd,null));};exports[_0xc38d('0x21')]=function(_0x181ae8,_0x2f0179){if(_0x181ae8[_0xc38d('0x48')]['id']){delete _0x181ae8[_0xc38d('0x48')]['id'];}return db[_0xc38d('0x2e')]['find']({'where':{'id':_0x181ae8[_0xc38d('0x45')]['id']}})[_0xc38d('0x22')](handleEntityNotFound(_0x2f0179,null))['then'](saveUpdates(_0x181ae8[_0xc38d('0x48')],null))['then'](respondWithResult(_0x2f0179,null))[_0xc38d('0x43')](handleError(_0x2f0179,null));};exports[_0xc38d('0x26')]=function(_0x5661d5,_0x48c19d){return db[_0xc38d('0x2e')][_0xc38d('0x4d')]({'where':{'id':_0x5661d5[_0xc38d('0x45')]['id']}})['then'](handleEntityNotFound(_0x48c19d,null))[_0xc38d('0x22')](removeEntity(_0x48c19d,null))[_0xc38d('0x43')](handleError(_0x48c19d,null));};exports[_0xc38d('0x51')]=function(_0x1966ca,_0x59ca25,_0x3f5cef){return db[_0xc38d('0x2e')][_0xc38d('0x4d')]({'where':{'id':_0x1966ca[_0xc38d('0x45')]['id']},'attributes':[_0xc38d('0x2a'),_0xc38d('0x52'),'savename',_0xc38d('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x59ca25,null))[_0xc38d('0x22')](function(_0x3fd820){if(_0x3fd820){if(!fs[_0xc38d('0x54')](path['join'](config[_0xc38d('0x55')],_0xc38d('0x56'),_0x3fd820[_0xc38d('0x57')]))){throw new db[(_0xc38d('0x58'))][(_0xc38d('0x59'))](_0xc38d('0x5a'));}if(_0x1966ca[_0xc38d('0x34')]['exists']){return _0x59ca25[_0xc38d('0x27')](0xc8);}return _0x59ca25[_0xc38d('0x51')](path[_0xc38d('0x5b')](config['root'],'server/files/reports',_0x3fd820[_0xc38d('0x57')]),util[_0xc38d('0x5c')](_0xc38d('0x5d'),_0x3fd820[_0xc38d('0x52')]||_0x3fd820[_0xc38d('0x2a')],_0x3fd820[_0xc38d('0x53')][_0xc38d('0x5e')]()));}})[_0xc38d('0x43')](handleError(_0x59ca25,null));};
\ No newline at end of file
+var _0x4f68=['savename','output','existsSync','root','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','%s.%s','toLowerCase','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','error','name','index','map','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','download'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x4f68,0x11e));var _0x84f6=function(_0x240449,_0x512fd9){_0x240449=_0x240449-0x0;var _0x1ac45e=_0x4f68[_0x240449];return _0x1ac45e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x84f6('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x84f6('0x1'));var moment=require('moment');var BPromise=require(_0x84f6('0x2'));var Mustache=require(_0x84f6('0x3'));var util=require('util');var path=require(_0x84f6('0x4'));var sox=require(_0x84f6('0x5'));var csv=require(_0x84f6('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x84f6('0x7'));var _=require(_0x84f6('0x8'));var squel=require(_0x84f6('0x9'));var crypto=require(_0x84f6('0xa'));var jsforce=require(_0x84f6('0xb'));var deskjs=require(_0x84f6('0xc'));var toCsv=require(_0x84f6('0x6'));var querystring=require(_0x84f6('0xd'));var Papa=require(_0x84f6('0xe'));var Redis=require('ioredis');var authService=require(_0x84f6('0xf'));var qs=require(_0x84f6('0x10'));var as=require(_0x84f6('0x11'));var hardwareService=require(_0x84f6('0x12'));var logger=require(_0x84f6('0x13'))(_0x84f6('0x14'));var utils=require(_0x84f6('0x15'));var config=require(_0x84f6('0x16'));var licenseUtil=require(_0x84f6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b4d37,_0x418809){_0x418809=_0x418809||0xcc;return function(_0xbcaad7){if(_0xbcaad7){return _0x1b4d37[_0x84f6('0x18')](_0x418809);}return _0x1b4d37[_0x84f6('0x19')](_0x418809)[_0x84f6('0x1a')]();};}function respondWithResult(_0x39699d,_0x4a5733){_0x4a5733=_0x4a5733||0xc8;return function(_0x4b349c){if(_0x4b349c){return _0x39699d['status'](_0x4a5733)[_0x84f6('0x1b')](_0x4b349c);}};}function respondWithFilteredResult(_0x578c81,_0x54adbb){return function(_0x139374){if(_0x139374){var _0x288066=typeof _0x54adbb[_0x84f6('0x1c')]==='undefined'&&typeof _0x54adbb[_0x84f6('0x1d')]==='undefined';var _0x32115f=_0x139374['count'];var _0x15c6bb=_0x288066?0x0:_0x54adbb['offset'];var _0x3d1cec=_0x288066?_0x139374[_0x84f6('0x1e')]:_0x54adbb[_0x84f6('0x1c')]+_0x54adbb[_0x84f6('0x1d')];var _0x1fd074;if(_0x3d1cec>=_0x32115f){_0x3d1cec=_0x32115f;_0x1fd074=0xc8;}else{_0x1fd074=0xce;}_0x578c81[_0x84f6('0x19')](_0x1fd074);return _0x578c81[_0x84f6('0x1f')](_0x84f6('0x20'),_0x15c6bb+'-'+_0x3d1cec+'/'+_0x32115f)[_0x84f6('0x1b')](_0x139374);}return null;};}function patchUpdates(_0x37abb8){return function(_0x224b15){try{jsonpatch[_0x84f6('0x21')](_0x224b15,_0x37abb8,!![]);}catch(_0x18316e){return BPromise[_0x84f6('0x22')](_0x18316e);}return _0x224b15['save']();};}function saveUpdates(_0x176abe,_0x4c1f33){return function(_0x38b7eb){if(_0x38b7eb){return _0x38b7eb[_0x84f6('0x23')](_0x176abe)[_0x84f6('0x24')](function(_0x392bf3){return _0x392bf3;});}return null;};}function removeEntity(_0x24c011,_0x2d7733){return function(_0x3aff59){if(_0x3aff59){return _0x3aff59[_0x84f6('0x25')]()['then'](function(){var _0x57cd1a=_0x3aff59[_0x84f6('0x26')]({'plain':!![]});var _0x1f07c3='ExtractedReports';return db['UserProfileResource'][_0x84f6('0x25')]({'where':{'type':_0x1f07c3,'resourceId':_0x57cd1a['id']}})[_0x84f6('0x24')](function(){return _0x3aff59;});})[_0x84f6('0x24')](function(){_0x24c011['status'](0xcc)[_0x84f6('0x1a')]();});}};}function handleEntityNotFound(_0x3c7162,_0x43f65f){return function(_0x45d494){if(!_0x45d494){_0x3c7162[_0x84f6('0x18')](0x194);}return _0x45d494;};}function handleError(_0x4dfcbe,_0x31f460){_0x31f460=_0x31f460||0x1f4;return function(_0x5ce0b2){logger[_0x84f6('0x27')](_0x5ce0b2['stack']);if(_0x5ce0b2[_0x84f6('0x28')]){delete _0x5ce0b2[_0x84f6('0x28')];}_0x4dfcbe[_0x84f6('0x19')](_0x31f460)['send'](_0x5ce0b2);};}exports[_0x84f6('0x29')]=function(_0x2041a8,_0x52bc59){var _0x1e9c81={},_0x587386={},_0x229dd7={'count':0x0,'rows':[]};var _0x3ece71=_[_0x84f6('0x2a')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x27ed1d){return{'name':_0x27ed1d[_0x84f6('0x2b')],'type':_0x27ed1d['type']['key']};});_0x587386[_0x84f6('0x2c')]=_[_0x84f6('0x2a')](_0x3ece71,_0x84f6('0x28'));_0x587386[_0x84f6('0x2d')]=_[_0x84f6('0x2e')](_0x2041a8[_0x84f6('0x2d')]);_0x587386[_0x84f6('0x2f')]=_[_0x84f6('0x30')](_0x587386[_0x84f6('0x2c')],_0x587386[_0x84f6('0x2d')]);_0x1e9c81[_0x84f6('0x31')]=_[_0x84f6('0x30')](_0x587386[_0x84f6('0x2c')],qs[_0x84f6('0x32')](_0x2041a8[_0x84f6('0x2d')]['fields']));_0x1e9c81[_0x84f6('0x31')]=_0x1e9c81['attributes'][_0x84f6('0x33')]?_0x1e9c81[_0x84f6('0x31')]:_0x587386['model'];if(!_0x2041a8[_0x84f6('0x2d')][_0x84f6('0x34')](_0x84f6('0x35'))){_0x1e9c81[_0x84f6('0x1d')]=qs[_0x84f6('0x1d')](_0x2041a8[_0x84f6('0x2d')]['limit']);_0x1e9c81['offset']=qs['offset'](_0x2041a8[_0x84f6('0x2d')]['offset']);}_0x1e9c81[_0x84f6('0x36')]=qs[_0x84f6('0x37')](_0x2041a8[_0x84f6('0x2d')][_0x84f6('0x37')]);_0x1e9c81[_0x84f6('0x38')]=qs['filters'](_[_0x84f6('0x39')](_0x2041a8[_0x84f6('0x2d')],_0x587386['filters']),_0x3ece71);if(_0x2041a8['query'][_0x84f6('0x3a')]){_0x1e9c81[_0x84f6('0x38')]=_['merge'](_0x1e9c81[_0x84f6('0x38')],{'$or':_[_0x84f6('0x2a')](_0x3ece71,function(_0x8e5d56){if(_0x8e5d56[_0x84f6('0x3b')]!==_0x84f6('0x3c')){var _0x1757c8={};_0x1757c8[_0x8e5d56[_0x84f6('0x28')]]={'$like':'%'+_0x2041a8[_0x84f6('0x2d')]['filter']+'%'};return _0x1757c8;}})});}_0x1e9c81=_[_0x84f6('0x3d')]({},_0x1e9c81,_0x2041a8['options']);var _0x267eb7={'where':_0x1e9c81['where']};return db[_0x84f6('0x3e')][_0x84f6('0x1e')](_0x267eb7)['then'](function(_0x2b964f){_0x229dd7['count']=_0x2b964f;if(_0x2041a8['query'][_0x84f6('0x3f')]){_0x1e9c81[_0x84f6('0x40')]=[{'all':!![]}];}return db[_0x84f6('0x3e')][_0x84f6('0x41')](_0x1e9c81);})[_0x84f6('0x24')](function(_0x168b73){_0x229dd7[_0x84f6('0x42')]=_0x168b73;return _0x229dd7;})[_0x84f6('0x24')](respondWithFilteredResult(_0x52bc59,_0x1e9c81))[_0x84f6('0x43')](handleError(_0x52bc59,null));};exports[_0x84f6('0x44')]=function(_0x27a695,_0x42e78a){var _0xed11a4={'raw':!![],'where':{'id':_0x27a695['params']['id']}},_0x5df5b6={};_0x5df5b6[_0x84f6('0x2c')]=_[_0x84f6('0x2e')](db['AnalyticExtractedReport'][_0x84f6('0x45')]);_0x5df5b6[_0x84f6('0x2d')]=_[_0x84f6('0x2e')](_0x27a695[_0x84f6('0x2d')]);_0x5df5b6['filters']=_['intersection'](_0x5df5b6[_0x84f6('0x2c')],_0x5df5b6['query']);_0xed11a4[_0x84f6('0x31')]=_[_0x84f6('0x30')](_0x5df5b6[_0x84f6('0x2c')],qs[_0x84f6('0x32')](_0x27a695[_0x84f6('0x2d')]['fields']));_0xed11a4[_0x84f6('0x31')]=_0xed11a4[_0x84f6('0x31')]['length']?_0xed11a4['attributes']:_0x5df5b6['model'];if(_0x27a695[_0x84f6('0x2d')][_0x84f6('0x3f')]){_0xed11a4[_0x84f6('0x40')]=[{'all':!![]}];}_0xed11a4=_[_0x84f6('0x3d')]({},_0xed11a4,_0x27a695['options']);return db[_0x84f6('0x3e')][_0x84f6('0x46')](_0xed11a4)[_0x84f6('0x24')](handleEntityNotFound(_0x42e78a,null))[_0x84f6('0x24')](respondWithResult(_0x42e78a,null))[_0x84f6('0x43')](handleError(_0x42e78a,null));};exports['create']=function(_0x4ae3a0,_0x239dc4){return db[_0x84f6('0x3e')][_0x84f6('0x47')](_0x4ae3a0[_0x84f6('0x48')],{})[_0x84f6('0x24')](function(_0x490e59){var _0x462074=_0x4ae3a0[_0x84f6('0x49')][_0x84f6('0x26')]({'plain':!![]});if(!_0x462074)throw new Error(_0x84f6('0x4a'));if(_0x462074[_0x84f6('0x4b')]===_0x84f6('0x49')){var _0x4016f1=_0x490e59['get']({'plain':!![]});var _0x3f0a2c='ExtractedReports';return db[_0x84f6('0x4c')][_0x84f6('0x46')]({'where':{'name':_0x3f0a2c,'userProfileId':_0x462074[_0x84f6('0x4d')]},'raw':!![]})[_0x84f6('0x24')](function(_0xdca0a8){if(_0xdca0a8&&_0xdca0a8[_0x84f6('0x4e')]===0x0){return db[_0x84f6('0x4f')][_0x84f6('0x47')]({'name':_0x4016f1[_0x84f6('0x28')],'resourceId':_0x4016f1['id'],'type':_0xdca0a8[_0x84f6('0x28')],'sectionId':_0xdca0a8['id']},{})[_0x84f6('0x24')](function(){return _0x490e59;});}else{return _0x490e59;}})['catch'](function(_0xb3b3a8){logger[_0x84f6('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb3b3a8);throw _0xb3b3a8;});}return _0x490e59;})[_0x84f6('0x24')](respondWithResult(_0x239dc4,0xc9))[_0x84f6('0x43')](handleError(_0x239dc4,null));};exports['update']=function(_0x592e7a,_0x30a83b){if(_0x592e7a['body']['id']){delete _0x592e7a[_0x84f6('0x48')]['id'];}return db[_0x84f6('0x3e')][_0x84f6('0x46')]({'where':{'id':_0x592e7a[_0x84f6('0x50')]['id']}})[_0x84f6('0x24')](handleEntityNotFound(_0x30a83b,null))[_0x84f6('0x24')](saveUpdates(_0x592e7a['body'],null))[_0x84f6('0x24')](respondWithResult(_0x30a83b,null))['catch'](handleError(_0x30a83b,null));};exports[_0x84f6('0x25')]=function(_0x1b189e,_0x5ec9c6){return db['AnalyticExtractedReport'][_0x84f6('0x46')]({'where':{'id':_0x1b189e['params']['id']}})[_0x84f6('0x24')](handleEntityNotFound(_0x5ec9c6,null))[_0x84f6('0x24')](removeEntity(_0x5ec9c6,null))['catch'](handleError(_0x5ec9c6,null));};exports[_0x84f6('0x51')]=function(_0x10b357,_0x1e1e61,_0xd81e42){return db[_0x84f6('0x3e')][_0x84f6('0x46')]({'where':{'id':_0x10b357[_0x84f6('0x50')]['id']},'attributes':[_0x84f6('0x28'),'basename',_0x84f6('0x52'),_0x84f6('0x53')],'raw':!![]})[_0x84f6('0x24')](handleEntityNotFound(_0x1e1e61,null))[_0x84f6('0x24')](function(_0x551a43){if(_0x551a43){if(!fs[_0x84f6('0x54')](path['join'](config[_0x84f6('0x55')],'server/files/reports',_0x551a43[_0x84f6('0x52')]))){throw new db[(_0x84f6('0x56'))]['ValidationError'](_0x84f6('0x57'));}if(_0x10b357[_0x84f6('0x2d')][_0x84f6('0x58')]){return _0x1e1e61[_0x84f6('0x18')](0xc8);}return _0x1e1e61[_0x84f6('0x51')](path['join'](config[_0x84f6('0x55')],_0x84f6('0x59'),_0x551a43[_0x84f6('0x52')]),util['format'](_0x84f6('0x5a'),_0x551a43['basename']||_0x551a43[_0x84f6('0x28')],_0x551a43['output'][_0x84f6('0x5b')]()));}})[_0x84f6('0x43')](handleError(_0x1e1e61,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index ca64a8e..0351209 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 _0xe91b=['../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x119ef1,_0x17c4e5){var _0x33fcc5=function(_0x3fada2){while(--_0x3fada2){_0x119ef1['push'](_0x119ef1['shift']());}};_0x33fcc5(++_0x17c4e5);}(_0xe91b,0x101));var _0xbe91=function(_0x467cb0,_0x303070){_0x467cb0=_0x467cb0-0x0;var _0x2153f7=_0xe91b[_0x467cb0];return _0x2153f7;};'use strict';var _=require(_0xbe91('0x0'));var util=require(_0xbe91('0x1'));var logger=require(_0xbe91('0x2'))(_0xbe91('0x3'));var moment=require(_0xbe91('0x4'));var BPromise=require(_0xbe91('0x5'));var rp=require(_0xbe91('0x6'));var fs=require('fs');var path=require(_0xbe91('0x7'));var rimraf=require(_0xbe91('0x8'));var config=require(_0xbe91('0x9'));var attributes=require(_0xbe91('0xa'));module[_0xbe91('0xb')]=function(_0x339b24,_0x5774bf){return _0x339b24[_0xbe91('0xc')]('AnalyticExtractedReport',attributes,{'tableName':_0xbe91('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0c6e=['path','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports','../../config/logger','bluebird'];(function(_0x78cdea,_0x4d7fdc){var _0x4bf7da=function(_0x138a32){while(--_0x138a32){_0x78cdea['push'](_0x78cdea['shift']());}};_0x4bf7da(++_0x4d7fdc);}(_0x0c6e,0x116));var _0xe0c6=function(_0xf6cba6,_0x1d5375){_0xf6cba6=_0xf6cba6-0x0;var _0x5315c8=_0x0c6e[_0xf6cba6];return _0x5315c8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe0c6('0x0'))('api');var moment=require('moment');var BPromise=require(_0xe0c6('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe0c6('0x2'));var rimraf=require('rimraf');var config=require(_0xe0c6('0x3'));var attributes=require('./analyticExtractedReport.attributes');module[_0xe0c6('0x4')]=function(_0x574c2b,_0x36dda1){return _0x574c2b['define'](_0xe0c6('0x5'),attributes,{'tableName':_0xe0c6('0x6'),'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 d8acdd4..27ad509 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 _0xa9ba=['stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x7a97e0,_0x24151f){var _0x180320=function(_0x33b1d1){while(--_0x33b1d1){_0x7a97e0['push'](_0x7a97e0['shift']());}};_0x180320(++_0x24151f);}(_0xa9ba,0x16e));var _0xaa9b=function(_0x9d7196,_0x2155ab){_0x9d7196=_0x9d7196-0x0;var _0x15a2eb=_0xa9ba[_0x9d7196];return _0x15a2eb;};'use strict';var _=require('lodash');var util=require(_0xaa9b('0x0'));var moment=require(_0xaa9b('0x1'));var BPromise=require(_0xaa9b('0x2'));var rs=require(_0xaa9b('0x3'));var fs=require('fs');var Redis=require(_0xaa9b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa9b('0x5'));var logger=require(_0xaa9b('0x6'))(_0xaa9b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaa9b('0x8')][_0xaa9b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd0d065,_0x56f41d,_0x3cc80f){return new BPromise(function(_0x18f8fd,_0x4638f2){return client[_0xaa9b('0xa')](_0xd0d065,_0x3cc80f)['then'](function(_0x4b338d){logger[_0xaa9b('0xb')](_0xaa9b('0xc'),_0x56f41d,'request\x20sent');logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x56f41d,_0xaa9b('0xd'),JSON[_0xaa9b('0xe')](_0x4b338d));if(_0x4b338d[_0xaa9b('0xf')]){if(_0x4b338d[_0xaa9b('0xf')]['code']===0x1f4){logger[_0xaa9b('0xf')](_0xaa9b('0xc'),_0x56f41d,_0x4b338d[_0xaa9b('0xf')]['message']);return _0x4638f2(_0x4b338d['error'][_0xaa9b('0x10')]);}logger[_0xaa9b('0xf')](_0xaa9b('0xc'),_0x56f41d,_0x4b338d[_0xaa9b('0xf')][_0xaa9b('0x10')]);return _0x18f8fd(_0x4b338d['error'][_0xaa9b('0x10')]);}else{logger[_0xaa9b('0xb')](_0xaa9b('0xc'),_0x56f41d,_0xaa9b('0xd'));_0x18f8fd(_0x4b338d[_0xaa9b('0x11')][_0xaa9b('0x10')]);}})[_0xaa9b('0x12')](function(_0x26fa6d){logger['error'](_0xaa9b('0xc'),_0x56f41d,_0x26fa6d);_0x4638f2(_0x26fa6d);});});}
\ No newline at end of file
+var _0x889d=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x346f62,_0x5079bc){var _0x1783a8=function(_0x3dca5e){while(--_0x3dca5e){_0x346f62['push'](_0x346f62['shift']());}};_0x1783a8(++_0x5079bc);}(_0x889d,0x64));var _0xd889=function(_0x181a7b,_0x45b715){_0x181a7b=_0x181a7b-0x0;var _0x2344d4=_0x889d[_0x181a7b];return _0x2344d4;};'use strict';var _=require(_0xd889('0x0'));var util=require(_0xd889('0x1'));var moment=require(_0xd889('0x2'));var BPromise=require(_0xd889('0x3'));var rs=require(_0xd889('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd889('0x5'))['db'];var utils=require(_0xd889('0x6'));var logger=require('../../config/logger')(_0xd889('0x7'));var config=require(_0xd889('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd889('0x9')][_0xd889('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48d516,_0x296269,_0x5bb6f9){return new BPromise(function(_0x494685,_0x37391a){return client[_0xd889('0xb')](_0x48d516,_0x5bb6f9)[_0xd889('0xc')](function(_0x4671a0){logger['info'](_0xd889('0xd'),_0x296269,'request\x20sent');logger['debug'](_0xd889('0xe'),_0x296269,_0xd889('0xf'),JSON['stringify'](_0x4671a0));if(_0x4671a0[_0xd889('0x10')]){if(_0x4671a0[_0xd889('0x10')]['code']===0x1f4){logger[_0xd889('0x10')](_0xd889('0xd'),_0x296269,_0x4671a0['error'][_0xd889('0x11')]);return _0x37391a(_0x4671a0[_0xd889('0x10')][_0xd889('0x11')]);}logger['error'](_0xd889('0xd'),_0x296269,_0x4671a0['error'][_0xd889('0x11')]);return _0x494685(_0x4671a0[_0xd889('0x10')][_0xd889('0x11')]);}else{logger[_0xd889('0x12')](_0xd889('0xd'),_0x296269,'request\x20sent');_0x494685(_0x4671a0[_0xd889('0x13')][_0xd889('0x11')]);}})[_0xd889('0x14')](function(_0xb6a4de){logger[_0xd889('0x10')](_0xd889('0xd'),_0x296269,_0xb6a4de);_0x37391a(_0xb6a4de);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 16dffc5..cab2f5a 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 _0x4b45=['show','/:id/download','download','post','/:id','update','destroy','exports','util','path','connect-timeout','Router','get','isAuthenticated'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x4b45,0x19e));var _0x54b4=function(_0x47a618,_0x1252bc){_0x47a618=_0x47a618-0x0;var _0x5840f5=_0x4b45[_0x47a618];return _0x5840f5;};'use strict';var multer=require('multer');var util=require(_0x54b4('0x0'));var path=require(_0x54b4('0x1'));var timeout=require(_0x54b4('0x2'));var express=require('express');var router=express[_0x54b4('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x54b4('0x4')]('/',auth[_0x54b4('0x5')](),controller['index']);router[_0x54b4('0x4')]('/:id',auth[_0x54b4('0x5')](),controller[_0x54b4('0x6')]);router[_0x54b4('0x4')](_0x54b4('0x7'),auth[_0x54b4('0x5')](),controller[_0x54b4('0x8')]);router[_0x54b4('0x9')]('/',auth[_0x54b4('0x5')](),controller['create']);router['put'](_0x54b4('0xa'),auth[_0x54b4('0x5')](),controller[_0x54b4('0xb')]);router['delete'](_0x54b4('0xa'),auth[_0x54b4('0x5')](),controller[_0x54b4('0xc')]);module[_0x54b4('0xd')]=router;
\ No newline at end of file
+var _0x1fbe=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','/:id/download','download','post','create','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1a89a1,_0x56d889){var _0x3d5b46=function(_0x56debf){while(--_0x56debf){_0x1a89a1['push'](_0x1a89a1['shift']());}};_0x3d5b46(++_0x56d889);}(_0x1fbe,0x14d));var _0xe1fb=function(_0x1044e5,_0x498e01){_0x1044e5=_0x1044e5-0x0;var _0x5ad0dd=_0x1fbe[_0x1044e5];return _0x5ad0dd;};'use strict';var multer=require(_0xe1fb('0x0'));var util=require('util');var path=require(_0xe1fb('0x1'));var timeout=require(_0xe1fb('0x2'));var express=require(_0xe1fb('0x3'));var router=express[_0xe1fb('0x4')]();var fs_extra=require(_0xe1fb('0x5'));var auth=require(_0xe1fb('0x6'));var interaction=require(_0xe1fb('0x7'));var config=require(_0xe1fb('0x8'));var controller=require(_0xe1fb('0x9'));router['get']('/',auth[_0xe1fb('0xa')](),controller[_0xe1fb('0xb')]);router[_0xe1fb('0xc')](_0xe1fb('0xd'),auth[_0xe1fb('0xa')](),controller['show']);router[_0xe1fb('0xc')](_0xe1fb('0xe'),auth['isAuthenticated'](),controller[_0xe1fb('0xf')]);router[_0xe1fb('0x10')]('/',auth['isAuthenticated'](),controller[_0xe1fb('0x11')]);router['put'](_0xe1fb('0xd'),auth[_0xe1fb('0xa')](),controller['update']);router[_0xe1fb('0x12')](_0xe1fb('0xd'),auth[_0xe1fb('0xa')](),controller['destroy']);module[_0xe1fb('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index e466d93..6bf683c 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 _0xd102=['sequelize','exports','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd102,0xf8));var _0x2d10=function(_0x4fab09,_0x2e343b){_0x4fab09=_0x4fab09-0x0;var _0xf457df=_0xd102[_0x4fab09];return _0xf457df;};'use strict';var Sequelize=require(_0x2d10('0x0'));module[_0x2d10('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x2d10('0x2')]},'format':{'type':Sequelize[_0x2d10('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x2d10('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x956e=['BOOLEAN','exports','STRING'];(function(_0x2c4292,_0x39be32){var _0x50fff0=function(_0x178ee){while(--_0x178ee){_0x2c4292['push'](_0x2c4292['shift']());}};_0x50fff0(++_0x39be32);}(_0x956e,0x1e4));var _0xe956=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0x956e[_0x296923];return _0x29af70;};'use strict';var Sequelize=require('sequelize');module[_0xe956('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xe956('0x1')]},'format':{'type':Sequelize[_0xe956('0x1')]},'groupBy':{'type':Sequelize[_0xe956('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xe956('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index e59b12c..e7f3074 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 _0x19ee=['bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','options','findAll','rows','catch','show','params','include','create','body','bulkCreate','find','bulkDestroy','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir'];(function(_0x4bc56e,_0x4f2fc0){var _0x29c230=function(_0x2068d2){while(--_0x2068d2){_0x4bc56e['push'](_0x4bc56e['shift']());}};_0x29c230(++_0x4f2fc0);}(_0x19ee,0xe1));var _0xe19e=function(_0x118afa,_0x4bf0c1){_0x118afa=_0x118afa-0x0;var _0x167d76=_0x19ee[_0x118afa];return _0x167d76;};'use strict';var emlformat=require(_0xe19e('0x0'));var rimraf=require(_0xe19e('0x1'));var zipdir=require(_0xe19e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe19e('0x3'));var Mustache=require(_0xe19e('0x4'));var util=require('util');var path=require('path');var sox=require(_0xe19e('0x5'));var csv=require('to-csv');var ejs=require(_0xe19e('0x6'));var fs=require('fs');var fs_extra=require(_0xe19e('0x7'));var _=require(_0xe19e('0x8'));var squel=require('squel');var crypto=require(_0xe19e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe19e('0xa'));var toCsv=require(_0xe19e('0xb'));var querystring=require(_0xe19e('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe19e('0xd'))(_0xe19e('0xe'));var utils=require('../../config/utils');var config=require(_0xe19e('0xf'));var licenseUtil=require(_0xe19e('0x10'));var db=require(_0xe19e('0x11'))['db'];function respondWithStatusCode(_0x3ab8df,_0x32585e){_0x32585e=_0x32585e||0xcc;return function(_0xe4e142){if(_0xe4e142){return _0x3ab8df[_0xe19e('0x12')](_0x32585e);}return _0x3ab8df['status'](_0x32585e)[_0xe19e('0x13')]();};}function respondWithResult(_0x371e43,_0x3e3152){_0x3e3152=_0x3e3152||0xc8;return function(_0x597f6e){if(_0x597f6e){return _0x371e43[_0xe19e('0x14')](_0x3e3152)[_0xe19e('0x15')](_0x597f6e);}};}function respondWithFilteredResult(_0x46e3d1,_0x394144){return function(_0x12c0ba){if(_0x12c0ba){var _0x3a066d=typeof _0x394144['offset']===_0xe19e('0x16')&&typeof _0x394144[_0xe19e('0x17')]===_0xe19e('0x16');var _0x5401c7=_0x12c0ba[_0xe19e('0x18')];var _0x2b5095=_0x3a066d?0x0:_0x394144[_0xe19e('0x19')];var _0x48617e=_0x3a066d?_0x12c0ba['count']:_0x394144['offset']+_0x394144['limit'];var _0x3f0051;if(_0x48617e>=_0x5401c7){_0x48617e=_0x5401c7;_0x3f0051=0xc8;}else{_0x3f0051=0xce;}_0x46e3d1[_0xe19e('0x14')](_0x3f0051);return _0x46e3d1[_0xe19e('0x1a')](_0xe19e('0x1b'),_0x2b5095+'-'+_0x48617e+'/'+_0x5401c7)['json'](_0x12c0ba);}return null;};}function patchUpdates(_0x573c5b){return function(_0x172319){try{jsonpatch[_0xe19e('0x1c')](_0x172319,_0x573c5b,!![]);}catch(_0xcb19c4){return BPromise[_0xe19e('0x1d')](_0xcb19c4);}return _0x172319[_0xe19e('0x1e')]();};}function saveUpdates(_0x17d568,_0x423020){return function(_0x17a621){if(_0x17a621){return _0x17a621['update'](_0x17d568)['then'](function(_0x550c42){return _0x550c42;});}return null;};}function removeEntity(_0x483901,_0x3b8d65){return function(_0x1fee81){if(_0x1fee81){return _0x1fee81[_0xe19e('0x1f')]()[_0xe19e('0x20')](function(){_0x483901[_0xe19e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x101899,_0x2b2a09){return function(_0x25840a){if(!_0x25840a){_0x101899[_0xe19e('0x12')](0x194);}return _0x25840a;};}function handleError(_0xd5e757,_0xd8cffb){_0xd8cffb=_0xd8cffb||0x1f4;return function(_0x14ca7d){logger[_0xe19e('0x21')](_0x14ca7d[_0xe19e('0x22')]);if(_0x14ca7d[_0xe19e('0x23')]){delete _0x14ca7d[_0xe19e('0x23')];}_0xd5e757['status'](_0xd8cffb)[_0xe19e('0x24')](_0x14ca7d);};}exports[_0xe19e('0x25')]=function(_0x1bb022,_0x515c3f){var _0x3f0145={},_0x4bf47a={},_0x5d4541={'count':0x0,'rows':[]};var _0x40160d=_[_0xe19e('0x26')](db[_0xe19e('0x27')][_0xe19e('0x28')],function(_0x2d85ed){return{'name':_0x2d85ed[_0xe19e('0x29')],'type':_0x2d85ed['type'][_0xe19e('0x2a')]};});_0x4bf47a['model']=_[_0xe19e('0x26')](_0x40160d,_0xe19e('0x23'));_0x4bf47a[_0xe19e('0x2b')]=_[_0xe19e('0x2c')](_0x1bb022['query']);_0x4bf47a[_0xe19e('0x2d')]=_[_0xe19e('0x2e')](_0x4bf47a['model'],_0x4bf47a['query']);_0x3f0145['attributes']=_[_0xe19e('0x2e')](_0x4bf47a[_0xe19e('0x2f')],qs['fields'](_0x1bb022['query'][_0xe19e('0x30')]));_0x3f0145[_0xe19e('0x31')]=_0x3f0145[_0xe19e('0x31')][_0xe19e('0x32')]?_0x3f0145['attributes']:_0x4bf47a[_0xe19e('0x2f')];if(!_0x1bb022[_0xe19e('0x2b')]['hasOwnProperty'](_0xe19e('0x33'))){_0x3f0145[_0xe19e('0x17')]=qs['limit'](_0x1bb022[_0xe19e('0x2b')]['limit']);_0x3f0145[_0xe19e('0x19')]=qs[_0xe19e('0x19')](_0x1bb022[_0xe19e('0x2b')][_0xe19e('0x19')]);}_0x3f0145[_0xe19e('0x34')]=qs[_0xe19e('0x35')](_0x1bb022[_0xe19e('0x2b')]['sort']);_0x3f0145[_0xe19e('0x36')]=qs[_0xe19e('0x2d')](_[_0xe19e('0x37')](_0x1bb022[_0xe19e('0x2b')],_0x4bf47a[_0xe19e('0x2d')]),_0x40160d);if(_0x1bb022['query'][_0xe19e('0x38')]){_0x3f0145[_0xe19e('0x36')]=_[_0xe19e('0x39')](_0x3f0145[_0xe19e('0x36')],{'$or':_[_0xe19e('0x26')](_0x40160d,function(_0x4c4a8e){if(_0x4c4a8e[_0xe19e('0x3a')]!=='VIRTUAL'){var _0x4f66f4={};_0x4f66f4[_0x4c4a8e[_0xe19e('0x23')]]={'$like':'%'+_0x1bb022[_0xe19e('0x2b')]['filter']+'%'};return _0x4f66f4;}})});}_0x3f0145=_['merge']({},_0x3f0145,_0x1bb022[_0xe19e('0x3b')]);var _0x80b663={'where':_0x3f0145[_0xe19e('0x36')]};return db[_0xe19e('0x27')][_0xe19e('0x18')](_0x80b663)[_0xe19e('0x20')](function(_0x1a1e04){_0x5d4541[_0xe19e('0x18')]=_0x1a1e04;if(_0x1bb022[_0xe19e('0x2b')]['includeAll']){_0x3f0145['include']=[{'all':!![]}];}return db[_0xe19e('0x27')][_0xe19e('0x3c')](_0x3f0145);})[_0xe19e('0x20')](function(_0x7070ee){_0x5d4541[_0xe19e('0x3d')]=_0x7070ee;return _0x5d4541;})['then'](respondWithFilteredResult(_0x515c3f,_0x3f0145))[_0xe19e('0x3e')](handleError(_0x515c3f,null));};exports[_0xe19e('0x3f')]=function(_0x71a84d,_0x1a2a47){var _0x25acdf={'raw':![],'where':{'id':_0x71a84d[_0xe19e('0x40')]['id']}},_0x59a5a0={};_0x59a5a0[_0xe19e('0x2f')]=_[_0xe19e('0x2c')](db[_0xe19e('0x27')][_0xe19e('0x28')]);_0x59a5a0[_0xe19e('0x2b')]=_[_0xe19e('0x2c')](_0x71a84d[_0xe19e('0x2b')]);_0x59a5a0[_0xe19e('0x2d')]=_[_0xe19e('0x2e')](_0x59a5a0[_0xe19e('0x2f')],_0x59a5a0[_0xe19e('0x2b')]);_0x25acdf[_0xe19e('0x31')]=_['intersection'](_0x59a5a0[_0xe19e('0x2f')],qs[_0xe19e('0x30')](_0x71a84d['query']['fields']));_0x25acdf[_0xe19e('0x31')]=_0x25acdf[_0xe19e('0x31')][_0xe19e('0x32')]?_0x25acdf['attributes']:_0x59a5a0['model'];if(_0x71a84d['query']['includeAll']){_0x25acdf[_0xe19e('0x41')]=[{'all':!![]}];}_0x25acdf=_['merge']({},_0x25acdf,_0x71a84d[_0xe19e('0x3b')]);return db[_0xe19e('0x27')]['find'](_0x25acdf)[_0xe19e('0x20')](handleEntityNotFound(_0x1a2a47,null))[_0xe19e('0x20')](respondWithResult(_0x1a2a47,null))[_0xe19e('0x3e')](handleError(_0x1a2a47,null));};exports[_0xe19e('0x42')]=function(_0x145e6f,_0x305a2a){return db[_0xe19e('0x27')][_0xe19e('0x42')](_0x145e6f[_0xe19e('0x43')],{})[_0xe19e('0x20')](respondWithResult(_0x305a2a,0xc9))[_0xe19e('0x3e')](handleError(_0x305a2a,null));};exports[_0xe19e('0x44')]=function(_0x1ff924,_0x5be079){return db['AnalyticFieldReport'][_0xe19e('0x44')](_0x1ff924['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5be079,0xc9))[_0xe19e('0x3e')](handleError(_0x5be079,null));};exports['update']=function(_0x4f7fb7,_0x3ff71f){if(_0x4f7fb7[_0xe19e('0x43')]['id']){delete _0x4f7fb7['body']['id'];}return db['AnalyticFieldReport'][_0xe19e('0x45')]({'where':{'id':_0x4f7fb7['params']['id']}})[_0xe19e('0x20')](handleEntityNotFound(_0x3ff71f,null))[_0xe19e('0x20')](saveUpdates(_0x4f7fb7[_0xe19e('0x43')],null))['then'](respondWithResult(_0x3ff71f,null))[_0xe19e('0x3e')](handleError(_0x3ff71f,null));};exports[_0xe19e('0x1f')]=function(_0x3734c1,_0x3eb035){return db[_0xe19e('0x27')][_0xe19e('0x45')]({'where':{'id':_0x3734c1[_0xe19e('0x40')]['id']}})[_0xe19e('0x20')](handleEntityNotFound(_0x3eb035,null))[_0xe19e('0x20')](removeEntity(_0x3eb035,null))[_0xe19e('0x3e')](handleError(_0x3eb035,null));};exports[_0xe19e('0x46')]=function(_0x3807a7,_0x850647){return db[_0xe19e('0x27')][_0xe19e('0x1f')]({'where':{'id':_0x3807a7['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x850647,0xcc))[_0xe19e('0x3e')](handleError(_0x850647,null));};exports[_0xe19e('0x47')]=function(_0x4c43d9,_0x413f1a,_0x2c7266){return db[_0xe19e('0x48')][_0xe19e('0x49')]({'where':{'id':_0x4c43d9[_0xe19e('0x40')]['id']}})[_0xe19e('0x20')](handleEntityNotFound(_0x413f1a,null))['then'](function(_0x5cd94d){if(_0x5cd94d){return db['sequelize'][_0xe19e('0x4a')](function(_0x2b7e79){return db[_0xe19e('0x27')]['destroy']({'where':{'CustomReportId':_0x4c43d9[_0xe19e('0x40')]['id']},'transaction':_0x2b7e79})[_0xe19e('0x20')](function(_0x4547c6){var _0x13f188=_[_0xe19e('0x26')](_0x4c43d9[_0xe19e('0x43')],function(_0x2775a6){delete _0x2775a6['id'];_0x2775a6[_0xe19e('0x4b')]=_0x4c43d9['params']['id'];return _0x2775a6;});return db[_0xe19e('0x27')][_0xe19e('0x44')](_0x13f188,{'transaction':_0x2b7e79});});})['then'](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x4c43d9[_0xe19e('0x40')]['id']}});});}})[_0xe19e('0x20')](respondWithResult(_0x413f1a,null))['catch'](handleError(_0x413f1a,null));};
\ No newline at end of file
+var _0x13fc=['findAll','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','error','stack','name','map','AnalyticFieldReport','type','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','keys','rawAttributes','find','create','body','bulkCreate','update','bulkDestroy','addFields','AnalyticCustomReport','sequelize','transaction','params','CustomReportId'];(function(_0x6bd32b,_0x2a6baa){var _0x2e3f04=function(_0x4733c1){while(--_0x4733c1){_0x6bd32b['push'](_0x6bd32b['shift']());}};_0x2e3f04(++_0x2a6baa);}(_0x13fc,0xe5));var _0xc13f=function(_0x32279c,_0x154cd7){_0x32279c=_0x32279c-0x0;var _0x3c377f=_0x13fc[_0x32279c];return _0x3c377f;};'use strict';var emlformat=require(_0xc13f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc13f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc13f('0x2'));var moment=require(_0xc13f('0x3'));var BPromise=require(_0xc13f('0x4'));var Mustache=require(_0xc13f('0x5'));var util=require(_0xc13f('0x6'));var path=require(_0xc13f('0x7'));var sox=require(_0xc13f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc13f('0x9'));var _=require('lodash');var squel=require(_0xc13f('0xa'));var crypto=require(_0xc13f('0xb'));var jsforce=require(_0xc13f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc13f('0xd'));var querystring=require(_0xc13f('0xe'));var Papa=require(_0xc13f('0xf'));var Redis=require(_0xc13f('0x10'));var authService=require(_0xc13f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc13f('0x12'))(_0xc13f('0x13'));var utils=require(_0xc13f('0x14'));var config=require(_0xc13f('0x15'));var licenseUtil=require(_0xc13f('0x16'));var db=require(_0xc13f('0x17'))['db'];function respondWithStatusCode(_0x36716e,_0x10fa99){_0x10fa99=_0x10fa99||0xcc;return function(_0x3a0f2b){if(_0x3a0f2b){return _0x36716e[_0xc13f('0x18')](_0x10fa99);}return _0x36716e[_0xc13f('0x19')](_0x10fa99)[_0xc13f('0x1a')]();};}function respondWithResult(_0x56dedd,_0x5d86b8){_0x5d86b8=_0x5d86b8||0xc8;return function(_0x42d76a){if(_0x42d76a){return _0x56dedd[_0xc13f('0x19')](_0x5d86b8)[_0xc13f('0x1b')](_0x42d76a);}};}function respondWithFilteredResult(_0x5386b6,_0x184848){return function(_0x10c367){if(_0x10c367){var _0x561259=typeof _0x184848[_0xc13f('0x1c')]===_0xc13f('0x1d')&&typeof _0x184848[_0xc13f('0x1e')]===_0xc13f('0x1d');var _0x417543=_0x10c367[_0xc13f('0x1f')];var _0x1b0fb1=_0x561259?0x0:_0x184848[_0xc13f('0x1c')];var _0x232db1=_0x561259?_0x10c367[_0xc13f('0x1f')]:_0x184848[_0xc13f('0x1c')]+_0x184848[_0xc13f('0x1e')];var _0x5c6e65;if(_0x232db1>=_0x417543){_0x232db1=_0x417543;_0x5c6e65=0xc8;}else{_0x5c6e65=0xce;}_0x5386b6['status'](_0x5c6e65);return _0x5386b6['set']('Content-Range',_0x1b0fb1+'-'+_0x232db1+'/'+_0x417543)[_0xc13f('0x1b')](_0x10c367);}return null;};}function patchUpdates(_0x1f5700){return function(_0xffbb22){try{jsonpatch[_0xc13f('0x20')](_0xffbb22,_0x1f5700,!![]);}catch(_0x36dbd5){return BPromise[_0xc13f('0x21')](_0x36dbd5);}return _0xffbb22[_0xc13f('0x22')]();};}function saveUpdates(_0x11423c,_0x3aeb7c){return function(_0x181dfa){if(_0x181dfa){return _0x181dfa['update'](_0x11423c)[_0xc13f('0x23')](function(_0x4ed553){return _0x4ed553;});}return null;};}function removeEntity(_0x2074a7,_0x102b5c){return function(_0x5dabb2){if(_0x5dabb2){return _0x5dabb2[_0xc13f('0x24')]()[_0xc13f('0x23')](function(){_0x2074a7[_0xc13f('0x19')](0xcc)[_0xc13f('0x1a')]();});}};}function handleEntityNotFound(_0x3236fb,_0x25d110){return function(_0x96f7e0){if(!_0x96f7e0){_0x3236fb[_0xc13f('0x18')](0x194);}return _0x96f7e0;};}function handleError(_0x88e83a,_0x3111b1){_0x3111b1=_0x3111b1||0x1f4;return function(_0x332226){logger[_0xc13f('0x25')](_0x332226[_0xc13f('0x26')]);if(_0x332226[_0xc13f('0x27')]){delete _0x332226[_0xc13f('0x27')];}_0x88e83a[_0xc13f('0x19')](_0x3111b1)['send'](_0x332226);};}exports['index']=function(_0x264b9c,_0x3538e7){var _0x51b272={},_0x17cb7d={},_0x27b2b1={'count':0x0,'rows':[]};var _0x37a66a=_[_0xc13f('0x28')](db[_0xc13f('0x29')]['rawAttributes'],function(_0x37f024){return{'name':_0x37f024['fieldName'],'type':_0x37f024[_0xc13f('0x2a')]['key']};});_0x17cb7d[_0xc13f('0x2b')]=_[_0xc13f('0x28')](_0x37a66a,_0xc13f('0x27'));_0x17cb7d[_0xc13f('0x2c')]=_['keys'](_0x264b9c[_0xc13f('0x2c')]);_0x17cb7d[_0xc13f('0x2d')]=_[_0xc13f('0x2e')](_0x17cb7d['model'],_0x17cb7d[_0xc13f('0x2c')]);_0x51b272[_0xc13f('0x2f')]=_[_0xc13f('0x2e')](_0x17cb7d[_0xc13f('0x2b')],qs['fields'](_0x264b9c[_0xc13f('0x2c')]['fields']));_0x51b272['attributes']=_0x51b272['attributes']['length']?_0x51b272[_0xc13f('0x2f')]:_0x17cb7d[_0xc13f('0x2b')];if(!_0x264b9c[_0xc13f('0x2c')][_0xc13f('0x30')](_0xc13f('0x31'))){_0x51b272[_0xc13f('0x1e')]=qs[_0xc13f('0x1e')](_0x264b9c[_0xc13f('0x2c')][_0xc13f('0x1e')]);_0x51b272[_0xc13f('0x1c')]=qs[_0xc13f('0x1c')](_0x264b9c[_0xc13f('0x2c')][_0xc13f('0x1c')]);}_0x51b272['order']=qs['sort'](_0x264b9c[_0xc13f('0x2c')]['sort']);_0x51b272[_0xc13f('0x32')]=qs['filters'](_[_0xc13f('0x33')](_0x264b9c['query'],_0x17cb7d['filters']),_0x37a66a);if(_0x264b9c[_0xc13f('0x2c')]['filter']){_0x51b272['where']=_[_0xc13f('0x34')](_0x51b272['where'],{'$or':_[_0xc13f('0x28')](_0x37a66a,function(_0x38db64){if(_0x38db64[_0xc13f('0x2a')]!==_0xc13f('0x35')){var _0x58c97e={};_0x58c97e[_0x38db64[_0xc13f('0x27')]]={'$like':'%'+_0x264b9c[_0xc13f('0x2c')][_0xc13f('0x36')]+'%'};return _0x58c97e;}})});}_0x51b272=_[_0xc13f('0x34')]({},_0x51b272,_0x264b9c[_0xc13f('0x37')]);var _0xa4fd9a={'where':_0x51b272[_0xc13f('0x32')]};return db[_0xc13f('0x29')][_0xc13f('0x1f')](_0xa4fd9a)[_0xc13f('0x23')](function(_0x4d25cf){_0x27b2b1[_0xc13f('0x1f')]=_0x4d25cf;if(_0x264b9c[_0xc13f('0x2c')][_0xc13f('0x38')]){_0x51b272[_0xc13f('0x39')]=[{'all':!![]}];}return db[_0xc13f('0x29')]['findAll'](_0x51b272);})['then'](function(_0x2dacdf){_0x27b2b1[_0xc13f('0x3a')]=_0x2dacdf;return _0x27b2b1;})[_0xc13f('0x23')](respondWithFilteredResult(_0x3538e7,_0x51b272))[_0xc13f('0x3b')](handleError(_0x3538e7,null));};exports[_0xc13f('0x3c')]=function(_0x16132f,_0x3413a6){var _0x17fa70={'raw':![],'where':{'id':_0x16132f['params']['id']}},_0x1d9e27={};_0x1d9e27[_0xc13f('0x2b')]=_[_0xc13f('0x3d')](db[_0xc13f('0x29')][_0xc13f('0x3e')]);_0x1d9e27[_0xc13f('0x2c')]=_['keys'](_0x16132f['query']);_0x1d9e27[_0xc13f('0x2d')]=_[_0xc13f('0x2e')](_0x1d9e27[_0xc13f('0x2b')],_0x1d9e27['query']);_0x17fa70[_0xc13f('0x2f')]=_['intersection'](_0x1d9e27['model'],qs['fields'](_0x16132f[_0xc13f('0x2c')]['fields']));_0x17fa70[_0xc13f('0x2f')]=_0x17fa70['attributes']['length']?_0x17fa70[_0xc13f('0x2f')]:_0x1d9e27[_0xc13f('0x2b')];if(_0x16132f[_0xc13f('0x2c')][_0xc13f('0x38')]){_0x17fa70['include']=[{'all':!![]}];}_0x17fa70=_[_0xc13f('0x34')]({},_0x17fa70,_0x16132f[_0xc13f('0x37')]);return db[_0xc13f('0x29')][_0xc13f('0x3f')](_0x17fa70)[_0xc13f('0x23')](handleEntityNotFound(_0x3413a6,null))[_0xc13f('0x23')](respondWithResult(_0x3413a6,null))[_0xc13f('0x3b')](handleError(_0x3413a6,null));};exports[_0xc13f('0x40')]=function(_0x350c51,_0x21316b){return db[_0xc13f('0x29')][_0xc13f('0x40')](_0x350c51[_0xc13f('0x41')],{})[_0xc13f('0x23')](respondWithResult(_0x21316b,0xc9))['catch'](handleError(_0x21316b,null));};exports[_0xc13f('0x42')]=function(_0x54d803,_0x6f8fbd){return db[_0xc13f('0x29')][_0xc13f('0x42')](_0x54d803[_0xc13f('0x41')],{'raw':![],'individualHooks':!![]})[_0xc13f('0x23')](respondWithResult(_0x6f8fbd,0xc9))[_0xc13f('0x3b')](handleError(_0x6f8fbd,null));};exports[_0xc13f('0x43')]=function(_0x1f6c16,_0x198755){if(_0x1f6c16[_0xc13f('0x41')]['id']){delete _0x1f6c16['body']['id'];}return db[_0xc13f('0x29')][_0xc13f('0x3f')]({'where':{'id':_0x1f6c16['params']['id']}})[_0xc13f('0x23')](handleEntityNotFound(_0x198755,null))[_0xc13f('0x23')](saveUpdates(_0x1f6c16[_0xc13f('0x41')],null))[_0xc13f('0x23')](respondWithResult(_0x198755,null))[_0xc13f('0x3b')](handleError(_0x198755,null));};exports['destroy']=function(_0x5c7753,_0xc97d31){return db[_0xc13f('0x29')][_0xc13f('0x3f')]({'where':{'id':_0x5c7753['params']['id']}})[_0xc13f('0x23')](handleEntityNotFound(_0xc97d31,null))['then'](removeEntity(_0xc97d31,null))[_0xc13f('0x3b')](handleError(_0xc97d31,null));};exports[_0xc13f('0x44')]=function(_0x57617f,_0x1eb048){return db[_0xc13f('0x29')][_0xc13f('0x24')]({'where':{'id':_0x57617f[_0xc13f('0x2c')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xc13f('0x23')](respondWithResult(_0x1eb048,0xcc))['catch'](handleError(_0x1eb048,null));};exports[_0xc13f('0x45')]=function(_0x4b1d5a,_0x5d7c7c,_0x26bd5){return db[_0xc13f('0x46')]['findOne']({'where':{'id':_0x4b1d5a['params']['id']}})[_0xc13f('0x23')](handleEntityNotFound(_0x5d7c7c,null))[_0xc13f('0x23')](function(_0x37d99d){if(_0x37d99d){return db[_0xc13f('0x47')][_0xc13f('0x48')](function(_0x34cc1a){return db[_0xc13f('0x29')]['destroy']({'where':{'CustomReportId':_0x4b1d5a[_0xc13f('0x49')]['id']},'transaction':_0x34cc1a})[_0xc13f('0x23')](function(_0x3eb453){var _0x1461c4=_[_0xc13f('0x28')](_0x4b1d5a[_0xc13f('0x41')],function(_0x595ae3){delete _0x595ae3['id'];_0x595ae3[_0xc13f('0x4a')]=_0x4b1d5a[_0xc13f('0x49')]['id'];return _0x595ae3;});return db[_0xc13f('0x29')][_0xc13f('0x42')](_0x1461c4,{'transaction':_0x34cc1a});});})[_0xc13f('0x23')](function(){return db[_0xc13f('0x29')][_0xc13f('0x4b')]({'where':{'CustomReportId':_0x4b1d5a[_0xc13f('0x49')]['id']}});});}})[_0xc13f('0x23')](respondWithResult(_0x5d7c7c,null))[_0xc13f('0x3b')](handleError(_0x5d7c7c,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 2928f27..dccebdc 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 _0x9187=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x5448a9,_0x4764da){var _0x1924af=function(_0x34f9bf){while(--_0x34f9bf){_0x5448a9['push'](_0x5448a9['shift']());}};_0x1924af(++_0x4764da);}(_0x9187,0x1d0));var _0x7918=function(_0x7d5b1b,_0x20e692){_0x7d5b1b=_0x7d5b1b-0x0;var _0x51988c=_0x9187[_0x7d5b1b];return _0x51988c;};'use strict';var _=require(_0x7918('0x0'));var util=require(_0x7918('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7918('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7918('0x3'));var config=require(_0x7918('0x4'));var attributes=require(_0x7918('0x5'));module[_0x7918('0x6')]=function(_0x4f67e1,_0x260081){return _0x4f67e1[_0x7918('0x7')](_0x7918('0x8'),attributes,{'tableName':_0x7918('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8301=['api','moment','bluebird','request-promise','path','rimraf','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger'];(function(_0x83d650,_0x527216){var _0x300857=function(_0x57adad){while(--_0x57adad){_0x83d650['push'](_0x83d650['shift']());}};_0x300857(++_0x527216);}(_0x8301,0x136));var _0x1830=function(_0xf4add4,_0x5b9cc1){_0xf4add4=_0xf4add4-0x0;var _0x1c42fb=_0x8301[_0xf4add4];return _0x1c42fb;};'use strict';var _=require(_0x1830('0x0'));var util=require('util');var logger=require(_0x1830('0x1'))(_0x1830('0x2'));var moment=require(_0x1830('0x3'));var BPromise=require(_0x1830('0x4'));var rp=require(_0x1830('0x5'));var fs=require('fs');var path=require(_0x1830('0x6'));var rimraf=require(_0x1830('0x7'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x1830('0x8')]=function(_0x15486d,_0x1823d3){return _0x15486d[_0x1830('0x9')](_0x1830('0xa'),attributes,{'tableName':_0x1830('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 39b48a3..dde0408 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 _0xc92e=['request','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0xc92e,0x1d9));var _0xec92=function(_0x3f5b69,_0x29662b){_0x3f5b69=_0x3f5b69-0x0;var _0x210d91=_0xc92e[_0x3f5b69];return _0x210d91;};'use strict';var _=require(_0xec92('0x0'));var util=require(_0xec92('0x1'));var moment=require('moment');var BPromise=require(_0xec92('0x2'));var rs=require(_0xec92('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xec92('0x4'))(_0xec92('0x5'));var config=require(_0xec92('0x6'));var jayson=require(_0xec92('0x7'));var client=jayson[_0xec92('0x8')][_0xec92('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2aa10b,_0xe62556,_0x202e31){return new BPromise(function(_0x5b768c,_0x44a0d8){return client[_0xec92('0xa')](_0x2aa10b,_0x202e31)['then'](function(_0x3aac21){logger[_0xec92('0xb')](_0xec92('0xc'),_0xe62556,'request\x20sent');logger[_0xec92('0xd')](_0xec92('0xe'),_0xe62556,_0xec92('0xf'),JSON['stringify'](_0x3aac21));if(_0x3aac21['error']){if(_0x3aac21['error'][_0xec92('0x10')]===0x1f4){logger[_0xec92('0x11')](_0xec92('0xc'),_0xe62556,_0x3aac21[_0xec92('0x11')]['message']);return _0x44a0d8(_0x3aac21[_0xec92('0x11')]['message']);}logger[_0xec92('0x11')](_0xec92('0xc'),_0xe62556,_0x3aac21[_0xec92('0x11')][_0xec92('0x12')]);return _0x5b768c(_0x3aac21[_0xec92('0x11')][_0xec92('0x12')]);}else{logger[_0xec92('0xb')](_0xec92('0xc'),_0xe62556,_0xec92('0xf'));_0x5b768c(_0x3aac21[_0xec92('0x13')]['message']);}})[_0xec92('0x14')](function(_0x53f52b){logger[_0xec92('0x11')](_0xec92('0xc'),_0xe62556,_0x53f52b);_0x44a0d8(_0x53f52b);});});}
\ No newline at end of file
+var _0xbe42=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x10d373,_0x2a4e16){var _0x1cac4c=function(_0x505e08){while(--_0x505e08){_0x10d373['push'](_0x10d373['shift']());}};_0x1cac4c(++_0x2a4e16);}(_0xbe42,0x1ae));var _0x2be4=function(_0x838813,_0x448f0f){_0x838813=_0x838813-0x0;var _0x2bd32d=_0xbe42[_0x838813];return _0x2bd32d;};'use strict';var _=require(_0x2be4('0x0'));var util=require(_0x2be4('0x1'));var moment=require(_0x2be4('0x2'));var BPromise=require(_0x2be4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2be4('0x4'));var db=require(_0x2be4('0x5'))['db'];var utils=require(_0x2be4('0x6'));var logger=require('../../config/logger')(_0x2be4('0x7'));var config=require(_0x2be4('0x8'));var jayson=require(_0x2be4('0x9'));var client=jayson[_0x2be4('0xa')][_0x2be4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15f149,_0x2bf681,_0x2646e3){return new BPromise(function(_0x44c427,_0x43ef61){return client[_0x2be4('0xc')](_0x15f149,_0x2646e3)[_0x2be4('0xd')](function(_0x53acb6){logger[_0x2be4('0xe')](_0x2be4('0xf'),_0x2bf681,_0x2be4('0x10'));logger['debug'](_0x2be4('0x11'),_0x2bf681,'request\x20sent',JSON[_0x2be4('0x12')](_0x53acb6));if(_0x53acb6[_0x2be4('0x13')]){if(_0x53acb6[_0x2be4('0x13')][_0x2be4('0x14')]===0x1f4){logger[_0x2be4('0x13')](_0x2be4('0xf'),_0x2bf681,_0x53acb6[_0x2be4('0x13')][_0x2be4('0x15')]);return _0x43ef61(_0x53acb6[_0x2be4('0x13')][_0x2be4('0x15')]);}logger[_0x2be4('0x13')](_0x2be4('0xf'),_0x2bf681,_0x53acb6[_0x2be4('0x13')][_0x2be4('0x15')]);return _0x44c427(_0x53acb6[_0x2be4('0x13')]['message']);}else{logger[_0x2be4('0xe')](_0x2be4('0xf'),_0x2bf681,_0x2be4('0x10'));_0x44c427(_0x53acb6[_0x2be4('0x16')]['message']);}})['catch'](function(_0x2c8364){logger[_0x2be4('0x13')](_0x2be4('0xf'),_0x2bf681,_0x2c8364);_0x43ef61(_0x2c8364);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 9c2534a..a49946a 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(_0x12cbed,_0x250b62){var _0x56ba23=function(_0x572337){while(--_0x572337){_0x12cbed['push'](_0x12cbed['shift']());}};_0x56ba23(++_0x250b62);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0x2fbac2,_0x2b7376){var _0x52bc10=function(_0x4272e4){while(--_0x4272e4){_0x2fbac2['push'](_0x2fbac2['shift']());}};_0x52bc10(++_0x2b7376);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 7001457..9ff5ebe 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 _0x0d74=['STRING','TEXT','sequelize','exports'];(function(_0x579216,_0x287466){var _0x1c5ca9=function(_0x2b3084){while(--_0x2b3084){_0x579216['push'](_0x579216['shift']());}};_0x1c5ca9(++_0x287466);}(_0x0d74,0x146));var _0x40d7=function(_0xa43082,_0x24156b){_0xa43082=_0xa43082-0x0;var _0x64a0c6=_0x0d74[_0xa43082];return _0x64a0c6;};'use strict';var Sequelize=require(_0x40d7('0x0'));module[_0x40d7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x40d7('0x2')]},'metric':{'type':Sequelize[_0x40d7('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc5cf=['name','TEXT','sequelize','exports','STRING'];(function(_0x14f161,_0x2699b3){var _0x4a9a17=function(_0x2d2177){while(--_0x2d2177){_0x14f161['push'](_0x14f161['shift']());}};_0x4a9a17(++_0x2699b3);}(_0xc5cf,0x15b));var _0xfc5c=function(_0x4cfb5c,_0x5cdb52){_0x4cfb5c=_0x4cfb5c-0x0;var _0x45097c=_0xc5cf[_0x4cfb5c];return _0x45097c;};'use strict';var Sequelize=require(_0xfc5c('0x0'));module[_0xfc5c('0x1')]={'name':{'type':Sequelize[_0xfc5c('0x2')],'allowNull':![],'unique':_0xfc5c('0x3')},'table':{'type':Sequelize[_0xfc5c('0x2')]},'metric':{'type':Sequelize[_0xfc5c('0x4')]},'description':{'type':Sequelize[_0xfc5c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index f8f25eb..7a86802 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 _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x2f8028,_0x158207){var _0x42acbb=function(_0x52e8b7){while(--_0x52e8b7){_0x2f8028['push'](_0x2f8028['shift']());}};_0x42acbb(++_0x158207);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x00bb[_0x5c351c];return _0x26f3b3;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));};
\ No newline at end of file
+var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x4356cc,_0x5f19b2){var _0x26863f=function(_0x36f4ff){while(--_0x36f4ff){_0x4356cc['push'](_0x4356cc['shift']());}};_0x26863f(++_0x5f19b2);}(_0x9a19,0x114));var _0x99a1=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9a19[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index f60868b..ee493ae 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 _0x8ce1=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics'];(function(_0x281b57,_0x11632e){var _0x37a22d=function(_0x123d4c){while(--_0x123d4c){_0x281b57['push'](_0x281b57['shift']());}};_0x37a22d(++_0x11632e);}(_0x8ce1,0x152));var _0x18ce=function(_0x495f2a,_0x223c84){_0x495f2a=_0x495f2a-0x0;var _0x137470=_0x8ce1[_0x495f2a];return _0x137470;};'use strict';var _=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var logger=require(_0x18ce('0x2'))(_0x18ce('0x3'));var moment=require(_0x18ce('0x4'));var BPromise=require(_0x18ce('0x5'));var rp=require(_0x18ce('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x18ce('0x7'));var config=require(_0x18ce('0x8'));var attributes=require(_0x18ce('0x9'));module[_0x18ce('0xa')]=function(_0x532604,_0x17d12a){return _0x532604[_0x18ce('0xb')]('AnalyticMetric',attributes,{'tableName':_0x18ce('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb3d8=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x24dc59,_0x92ae8e){var _0x8d63ea=function(_0x1d72de){while(--_0x1d72de){_0x24dc59['push'](_0x24dc59['shift']());}};_0x8d63ea(++_0x92ae8e);}(_0xb3d8,0xdc));var _0x8b3d=function(_0x3730eb,_0x96ee91){_0x3730eb=_0x3730eb-0x0;var _0x5701be=_0xb3d8[_0x3730eb];return _0x5701be;};'use strict';var _=require('lodash');var util=require(_0x8b3d('0x0'));var logger=require(_0x8b3d('0x1'))(_0x8b3d('0x2'));var moment=require(_0x8b3d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b3d('0x4'));var rimraf=require(_0x8b3d('0x5'));var config=require(_0x8b3d('0x6'));var attributes=require(_0x8b3d('0x7'));module[_0x8b3d('0x8')]=function(_0x22d97b,_0x3b0f04){return _0x22d97b[_0x8b3d('0x9')](_0x8b3d('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 23877cf..0c308e1 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 _0xe01c=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','randomstring','../../config/utils'];(function(_0x3616ef,_0x211fd1){var _0x4df78b=function(_0x21ec0f){while(--_0x21ec0f){_0x3616ef['push'](_0x3616ef['shift']());}};_0x4df78b(++_0x211fd1);}(_0xe01c,0x14f));var _0xce01=function(_0x561ab7,_0x436ad1){_0x561ab7=_0x561ab7-0x0;var _0x4c995e=_0xe01c[_0x561ab7];return _0x4c995e;};'use strict';var _=require(_0xce01('0x0'));var util=require(_0xce01('0x1'));var moment=require(_0xce01('0x2'));var BPromise=require('bluebird');var rs=require(_0xce01('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xce01('0x4'));var logger=require(_0xce01('0x5'))('rpc');var config=require(_0xce01('0x6'));var jayson=require(_0xce01('0x7'));var client=jayson[_0xce01('0x8')][_0xce01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ecba4,_0x2b2b29,_0x19b3a2){return new BPromise(function(_0x901e28,_0xe915ea){return client[_0xce01('0xa')](_0x2ecba4,_0x19b3a2)[_0xce01('0xb')](function(_0x28ed4e){logger[_0xce01('0xc')](_0xce01('0xd'),_0x2b2b29,_0xce01('0xe'));logger[_0xce01('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x2b2b29,_0xce01('0xe'),JSON[_0xce01('0x10')](_0x28ed4e));if(_0x28ed4e[_0xce01('0x11')]){if(_0x28ed4e[_0xce01('0x11')][_0xce01('0x12')]===0x1f4){logger[_0xce01('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x2b2b29,_0x28ed4e[_0xce01('0x11')][_0xce01('0x13')]);return _0xe915ea(_0x28ed4e[_0xce01('0x11')][_0xce01('0x13')]);}logger[_0xce01('0x11')](_0xce01('0xd'),_0x2b2b29,_0x28ed4e[_0xce01('0x11')][_0xce01('0x13')]);return _0x901e28(_0x28ed4e[_0xce01('0x11')][_0xce01('0x13')]);}else{logger[_0xce01('0xc')](_0xce01('0xd'),_0x2b2b29,_0xce01('0xe'));_0x901e28(_0x28ed4e['result']['message']);}})['catch'](function(_0x1a0d14){logger[_0xce01('0x11')](_0xce01('0xd'),_0x2b2b29,_0x1a0d14);_0xe915ea(_0x1a0d14);});});}
\ No newline at end of file
+var _0xd07e=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd07e,0x14c));var _0xed07=function(_0x2fcbaa,_0x35eeb4){_0x2fcbaa=_0x2fcbaa-0x0;var _0x206a5a=_0xd07e[_0x2fcbaa];return _0x206a5a;};'use strict';var _=require('lodash');var util=require(_0xed07('0x0'));var moment=require(_0xed07('0x1'));var BPromise=require(_0xed07('0x2'));var rs=require(_0xed07('0x3'));var fs=require('fs');var Redis=require(_0xed07('0x4'));var db=require(_0xed07('0x5'))['db'];var utils=require(_0xed07('0x6'));var logger=require(_0xed07('0x7'))(_0xed07('0x8'));var config=require('../../config/environment');var jayson=require(_0xed07('0x9'));var client=jayson[_0xed07('0xa')][_0xed07('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2649db,_0x268ed7,_0x58cc48){return new BPromise(function(_0x1af133,_0x4fe486){return client[_0xed07('0xc')](_0x2649db,_0x58cc48)[_0xed07('0xd')](function(_0x14110d){logger[_0xed07('0xe')](_0xed07('0xf'),_0x268ed7,_0xed07('0x10'));logger[_0xed07('0x11')](_0xed07('0x12'),_0x268ed7,_0xed07('0x10'),JSON[_0xed07('0x13')](_0x14110d));if(_0x14110d[_0xed07('0x14')]){if(_0x14110d[_0xed07('0x14')][_0xed07('0x15')]===0x1f4){logger[_0xed07('0x14')](_0xed07('0xf'),_0x268ed7,_0x14110d[_0xed07('0x14')][_0xed07('0x16')]);return _0x4fe486(_0x14110d[_0xed07('0x14')][_0xed07('0x16')]);}logger[_0xed07('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x268ed7,_0x14110d['error'][_0xed07('0x16')]);return _0x1af133(_0x14110d[_0xed07('0x14')][_0xed07('0x16')]);}else{logger[_0xed07('0xe')](_0xed07('0xf'),_0x268ed7,_0xed07('0x10'));_0x1af133(_0x14110d[_0xed07('0x17')][_0xed07('0x16')]);}})[_0xed07('0x18')](function(_0x4f0e3e){logger['error'](_0xed07('0xf'),_0x268ed7,_0x4f0e3e);_0x4fe486(_0x4f0e3e);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index fe82d84..07f92b0 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 _0x6dc0=['multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticMetric.controller','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports'];(function(_0xa6330,_0x54d0c2){var _0x4755aa=function(_0x44dffd){while(--_0x44dffd){_0xa6330['push'](_0xa6330['shift']());}};_0x4755aa(++_0x54d0c2);}(_0x6dc0,0x18c));var _0x06dc=function(_0x5ce2e7,_0x36735e){_0x5ce2e7=_0x5ce2e7-0x0;var _0x15e5f5=_0x6dc0[_0x5ce2e7];return _0x15e5f5;};'use strict';var multer=require(_0x06dc('0x0'));var util=require('util');var path=require(_0x06dc('0x1'));var timeout=require(_0x06dc('0x2'));var express=require(_0x06dc('0x3'));var router=express[_0x06dc('0x4')]();var fs_extra=require(_0x06dc('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x06dc('0x6'));var controller=require(_0x06dc('0x7'));router['get']('/',auth[_0x06dc('0x8')](),controller[_0x06dc('0x9')]);router['get'](_0x06dc('0xa'),auth['isAuthenticated'](),controller[_0x06dc('0xb')]);router[_0x06dc('0xc')]('/',auth[_0x06dc('0x8')](),controller[_0x06dc('0xd')]);router[_0x06dc('0xe')]('/:id',auth[_0x06dc('0x8')](),controller['update']);router[_0x06dc('0xf')](_0x06dc('0xa'),auth['isAuthenticated'](),controller[_0x06dc('0x10')]);module[_0x06dc('0x11')]=router;
\ No newline at end of file
+var _0x3ca4=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy'];(function(_0x506330,_0x10062e){var _0x3dd612=function(_0x1978b3){while(--_0x1978b3){_0x506330['push'](_0x506330['shift']());}};_0x3dd612(++_0x10062e);}(_0x3ca4,0x17d));var _0x43ca=function(_0x3d0e7e,_0x564590){_0x3d0e7e=_0x3d0e7e-0x0;var _0x4819aa=_0x3ca4[_0x3d0e7e];return _0x4819aa;};'use strict';var multer=require(_0x43ca('0x0'));var util=require(_0x43ca('0x1'));var path=require(_0x43ca('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x43ca('0x3')]();var fs_extra=require(_0x43ca('0x4'));var auth=require(_0x43ca('0x5'));var interaction=require(_0x43ca('0x6'));var config=require(_0x43ca('0x7'));var controller=require(_0x43ca('0x8'));router[_0x43ca('0x9')]('/',auth['isAuthenticated'](),controller[_0x43ca('0xa')]);router[_0x43ca('0x9')](_0x43ca('0xb'),auth[_0x43ca('0xc')](),controller[_0x43ca('0xd')]);router[_0x43ca('0xe')]('/',auth[_0x43ca('0xc')](),controller[_0x43ca('0xf')]);router['put']('/:id',auth[_0x43ca('0xc')](),controller[_0x43ca('0x10')]);router[_0x43ca('0x11')](_0x43ca('0xb'),auth['isAuthenticated'](),controller[_0x43ca('0x12')]);module[_0x43ca('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 6a87640..cf101d1 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 _0x95ba=['exports','TEXT','sequelize'];(function(_0xab9864,_0x5ab487){var _0x500468=function(_0x441a7c){while(--_0x441a7c){_0xab9864['push'](_0xab9864['shift']());}};_0x500468(++_0x5ab487);}(_0x95ba,0x17c));var _0xa95b=function(_0x46f940,_0xc854e2){_0x46f940=_0x46f940-0x0;var _0x4572f3=_0x95ba[_0x46f940];return _0x4572f3;};'use strict';var Sequelize=require(_0xa95b('0x0'));module[_0xa95b('0x1')]={'tree':{'type':Sequelize[_0xa95b('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x7ca3=['exports','TEXT','sequelize'];(function(_0x4d46ee,_0xa971ad){var _0x3f9536=function(_0xe885c2){while(--_0xe885c2){_0x4d46ee['push'](_0x4d46ee['shift']());}};_0x3f9536(++_0xa971ad);}(_0x7ca3,0x17c));var _0x37ca=function(_0x29db71,_0x306de1){_0x29db71=_0x29db71-0x0;var _0x2c8a07=_0x7ca3[_0x29db71];return _0x2c8a07;};'use strict';var Sequelize=require(_0x37ca('0x0'));module[_0x37ca('0x1')]={'tree':{'type':Sequelize[_0x37ca('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 5665b1a..c048a64 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 _0xfb4b=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','stack','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','VIRTUAL','name','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','fast-json-patch','moment','mustache','util','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'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfb4b,0x7f));var _0xbfb4=function(_0x4722c7,_0x326525){_0x4722c7=_0x4722c7-0x0;var _0x24cb31=_0xfb4b[_0x4722c7];return _0x24cb31;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbfb4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbfb4('0x1'));var rp=require('request-promise');var moment=require(_0xbfb4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbfb4('0x3'));var util=require(_0xbfb4('0x4'));var path=require(_0xbfb4('0x5'));var sox=require('sox');var csv=require(_0xbfb4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbfb4('0x7'));var _=require(_0xbfb4('0x8'));var squel=require(_0xbfb4('0x9'));var crypto=require(_0xbfb4('0xa'));var jsforce=require(_0xbfb4('0xb'));var deskjs=require(_0xbfb4('0xc'));var toCsv=require(_0xbfb4('0x6'));var querystring=require(_0xbfb4('0xd'));var Papa=require(_0xbfb4('0xe'));var Redis=require(_0xbfb4('0xf'));var authService=require(_0xbfb4('0x10'));var qs=require(_0xbfb4('0x11'));var as=require(_0xbfb4('0x12'));var hardwareService=require(_0xbfb4('0x13'));var logger=require(_0xbfb4('0x14'))(_0xbfb4('0x15'));var utils=require(_0xbfb4('0x16'));var config=require(_0xbfb4('0x17'));var licenseUtil=require(_0xbfb4('0x18'));var db=require(_0xbfb4('0x19'))['db'];function respondWithStatusCode(_0x55802a,_0x4286c8){_0x4286c8=_0x4286c8||0xcc;return function(_0x23b52c){if(_0x23b52c){return _0x55802a[_0xbfb4('0x1a')](_0x4286c8);}return _0x55802a['status'](_0x4286c8)[_0xbfb4('0x1b')]();};}function respondWithResult(_0xe4a76f,_0x4fecb4){_0x4fecb4=_0x4fecb4||0xc8;return function(_0x61ce21){if(_0x61ce21){return _0xe4a76f[_0xbfb4('0x1c')](_0x4fecb4)[_0xbfb4('0x1d')](_0x61ce21);}};}function respondWithFilteredResult(_0x453b2b,_0x41dece){return function(_0x14b621){if(_0x14b621){var _0x55c538=typeof _0x41dece[_0xbfb4('0x1e')]==='undefined'&&typeof _0x41dece[_0xbfb4('0x1f')]===_0xbfb4('0x20');var _0xfb0f38=_0x14b621['count'];var _0x5b41a4=_0x55c538?0x0:_0x41dece[_0xbfb4('0x1e')];var _0x130a27=_0x55c538?_0x14b621[_0xbfb4('0x21')]:_0x41dece[_0xbfb4('0x1e')]+_0x41dece[_0xbfb4('0x1f')];var _0x5d9335;if(_0x130a27>=_0xfb0f38){_0x130a27=_0xfb0f38;_0x5d9335=0xc8;}else{_0x5d9335=0xce;}_0x453b2b[_0xbfb4('0x1c')](_0x5d9335);return _0x453b2b['set'](_0xbfb4('0x22'),_0x5b41a4+'-'+_0x130a27+'/'+_0xfb0f38)['json'](_0x14b621);}return null;};}function patchUpdates(_0x2c53e3){return function(_0x5887c8){try{jsonpatch[_0xbfb4('0x23')](_0x5887c8,_0x2c53e3,!![]);}catch(_0x294a66){return BPromise[_0xbfb4('0x24')](_0x294a66);}return _0x5887c8[_0xbfb4('0x25')]();};}function saveUpdates(_0x17d80a,_0x1a79c7){return function(_0x302c5e){if(_0x302c5e){return _0x302c5e[_0xbfb4('0x26')](_0x17d80a)[_0xbfb4('0x27')](function(_0x424ce4){return _0x424ce4;});}return null;};}function removeEntity(_0x45b9ee,_0x50137b){return function(_0x1749b0){if(_0x1749b0){return _0x1749b0[_0xbfb4('0x28')]()[_0xbfb4('0x27')](function(){_0x45b9ee[_0xbfb4('0x1c')](0xcc)[_0xbfb4('0x1b')]();});}};}function handleEntityNotFound(_0x3c0618,_0x5a5e76){return function(_0x27ce4d){if(!_0x27ce4d){_0x3c0618['sendStatus'](0x194);}return _0x27ce4d;};}function handleError(_0x20561d,_0x28a421){_0x28a421=_0x28a421||0x1f4;return function(_0x2c47b6){logger['error'](_0x2c47b6[_0xbfb4('0x29')]);if(_0x2c47b6['name']){delete _0x2c47b6['name'];}_0x20561d[_0xbfb4('0x1c')](_0x28a421)['send'](_0x2c47b6);};}exports[_0xbfb4('0x2a')]=function(_0x34f3a3,_0x2d1edb){var _0x117a96={},_0x20e5bb={},_0x310873={'count':0x0,'rows':[]};var _0x4f0e06=_[_0xbfb4('0x2b')](db[_0xbfb4('0x2c')][_0xbfb4('0x2d')],function(_0x59d90e){return{'name':_0x59d90e[_0xbfb4('0x2e')],'type':_0x59d90e[_0xbfb4('0x2f')]['key']};});_0x20e5bb[_0xbfb4('0x30')]=_[_0xbfb4('0x2b')](_0x4f0e06,'name');_0x20e5bb[_0xbfb4('0x31')]=_[_0xbfb4('0x32')](_0x34f3a3[_0xbfb4('0x31')]);_0x20e5bb[_0xbfb4('0x33')]=_[_0xbfb4('0x34')](_0x20e5bb['model'],_0x20e5bb[_0xbfb4('0x31')]);_0x117a96[_0xbfb4('0x35')]=_[_0xbfb4('0x34')](_0x20e5bb['model'],qs['fields'](_0x34f3a3[_0xbfb4('0x31')][_0xbfb4('0x36')]));_0x117a96[_0xbfb4('0x35')]=_0x117a96[_0xbfb4('0x35')][_0xbfb4('0x37')]?_0x117a96['attributes']:_0x20e5bb['model'];if(!_0x34f3a3['query']['hasOwnProperty'](_0xbfb4('0x38'))){_0x117a96[_0xbfb4('0x1f')]=qs['limit'](_0x34f3a3['query']['limit']);_0x117a96[_0xbfb4('0x1e')]=qs['offset'](_0x34f3a3[_0xbfb4('0x31')]['offset']);}_0x117a96['order']=qs[_0xbfb4('0x39')](_0x34f3a3[_0xbfb4('0x31')][_0xbfb4('0x39')]);_0x117a96['where']=qs[_0xbfb4('0x33')](_[_0xbfb4('0x3a')](_0x34f3a3[_0xbfb4('0x31')],_0x20e5bb['filters']),_0x4f0e06);if(_0x34f3a3[_0xbfb4('0x31')][_0xbfb4('0x3b')]){_0x117a96[_0xbfb4('0x3c')]=_['merge'](_0x117a96[_0xbfb4('0x3c')],{'$or':_[_0xbfb4('0x2b')](_0x4f0e06,function(_0x50b361){if(_0x50b361[_0xbfb4('0x2f')]!==_0xbfb4('0x3d')){var _0x14d082={};_0x14d082[_0x50b361[_0xbfb4('0x3e')]]={'$like':'%'+_0x34f3a3[_0xbfb4('0x31')][_0xbfb4('0x3b')]+'%'};return _0x14d082;}})});}_0x117a96=_[_0xbfb4('0x3f')]({},_0x117a96,_0x34f3a3[_0xbfb4('0x40')]);var _0x21198b={'where':_0x117a96[_0xbfb4('0x3c')]};return db[_0xbfb4('0x2c')][_0xbfb4('0x21')](_0x21198b)[_0xbfb4('0x27')](function(_0x19694c){_0x310873[_0xbfb4('0x21')]=_0x19694c;if(_0x34f3a3[_0xbfb4('0x31')][_0xbfb4('0x41')]){_0x117a96[_0xbfb4('0x42')]=[{'all':!![]}];}return db[_0xbfb4('0x2c')][_0xbfb4('0x43')](_0x117a96);})['then'](function(_0x5743e2){_0x310873[_0xbfb4('0x44')]=_0x5743e2;return _0x310873;})[_0xbfb4('0x27')](respondWithFilteredResult(_0x2d1edb,_0x117a96))[_0xbfb4('0x45')](handleError(_0x2d1edb,null));};exports[_0xbfb4('0x46')]=function(_0x5cf060,_0x299bcf){var _0x455c26={'raw':!![],'where':{'id':_0x5cf060[_0xbfb4('0x47')]['id']}},_0x16aa13={};_0x16aa13['model']=_[_0xbfb4('0x32')](db[_0xbfb4('0x2c')][_0xbfb4('0x2d')]);_0x16aa13[_0xbfb4('0x31')]=_[_0xbfb4('0x32')](_0x5cf060[_0xbfb4('0x31')]);_0x16aa13[_0xbfb4('0x33')]=_[_0xbfb4('0x34')](_0x16aa13['model'],_0x16aa13[_0xbfb4('0x31')]);_0x455c26[_0xbfb4('0x35')]=_[_0xbfb4('0x34')](_0x16aa13[_0xbfb4('0x30')],qs[_0xbfb4('0x36')](_0x5cf060[_0xbfb4('0x31')]['fields']));_0x455c26[_0xbfb4('0x35')]=_0x455c26[_0xbfb4('0x35')]['length']?_0x455c26['attributes']:_0x16aa13[_0xbfb4('0x30')];if(_0x5cf060[_0xbfb4('0x31')][_0xbfb4('0x41')]){_0x455c26[_0xbfb4('0x42')]=[{'all':!![]}];}_0x455c26=_[_0xbfb4('0x3f')]({},_0x455c26,_0x5cf060[_0xbfb4('0x40')]);return db[_0xbfb4('0x2c')][_0xbfb4('0x48')](_0x455c26)[_0xbfb4('0x27')](handleEntityNotFound(_0x299bcf,null))[_0xbfb4('0x27')](respondWithResult(_0x299bcf,null))[_0xbfb4('0x45')](handleError(_0x299bcf,null));};exports[_0xbfb4('0x49')]=function(_0x2ed802,_0x579cb4){return db[_0xbfb4('0x2c')][_0xbfb4('0x49')](_0x2ed802[_0xbfb4('0x4a')],{})[_0xbfb4('0x27')](respondWithResult(_0x579cb4,0xc9))['catch'](handleError(_0x579cb4,null));};exports[_0xbfb4('0x26')]=function(_0x5eac20,_0x452142){if(_0x5eac20['body']['id']){delete _0x5eac20['body']['id'];}return db['AnalyticTreeReport'][_0xbfb4('0x48')]({'where':{'id':_0x5eac20[_0xbfb4('0x47')]['id']}})['then'](handleEntityNotFound(_0x452142,null))['then'](saveUpdates(_0x5eac20[_0xbfb4('0x4a')],null))['then'](respondWithResult(_0x452142,null))[_0xbfb4('0x45')](handleError(_0x452142,null));};exports[_0xbfb4('0x28')]=function(_0x6afa06,_0xbe22ae){return db[_0xbfb4('0x2c')][_0xbfb4('0x48')]({'where':{'id':_0x6afa06['params']['id']}})[_0xbfb4('0x27')](handleEntityNotFound(_0xbe22ae,null))[_0xbfb4('0x27')](removeEntity(_0xbe22ae,null))[_0xbfb4('0x45')](handleError(_0xbe22ae,null));};
\ No newline at end of file
+var _0xc85f=['querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js'];(function(_0x32f8d7,_0x4da0bd){var _0x29ea63=function(_0x26c9d8){while(--_0x26c9d8){_0x32f8d7['push'](_0x32f8d7['shift']());}};_0x29ea63(++_0x4da0bd);}(_0xc85f,0x163));var _0xfc85=function(_0x3553b5,_0x27c233){_0x3553b5=_0x3553b5-0x0;var _0x47f68e=_0xc85f[_0x3553b5];return _0x47f68e;};'use strict';var emlformat=require(_0xfc85('0x0'));var rimraf=require(_0xfc85('0x1'));var zipdir=require(_0xfc85('0x2'));var jsonpatch=require(_0xfc85('0x3'));var rp=require(_0xfc85('0x4'));var moment=require(_0xfc85('0x5'));var BPromise=require(_0xfc85('0x6'));var Mustache=require(_0xfc85('0x7'));var util=require(_0xfc85('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xfc85('0x9'));var ejs=require(_0xfc85('0xa'));var fs=require('fs');var fs_extra=require(_0xfc85('0xb'));var _=require(_0xfc85('0xc'));var squel=require(_0xfc85('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfc85('0xe'));var toCsv=require(_0xfc85('0x9'));var querystring=require(_0xfc85('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfc85('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc85('0x11'));var logger=require(_0xfc85('0x12'))(_0xfc85('0x13'));var utils=require(_0xfc85('0x14'));var config=require(_0xfc85('0x15'));var licenseUtil=require(_0xfc85('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30b843,_0x3d90f6){_0x3d90f6=_0x3d90f6||0xcc;return function(_0x27f0eb){if(_0x27f0eb){return _0x30b843[_0xfc85('0x17')](_0x3d90f6);}return _0x30b843['status'](_0x3d90f6)[_0xfc85('0x18')]();};}function respondWithResult(_0x3d0906,_0x2503a6){_0x2503a6=_0x2503a6||0xc8;return function(_0x19dfde){if(_0x19dfde){return _0x3d0906['status'](_0x2503a6)[_0xfc85('0x19')](_0x19dfde);}};}function respondWithFilteredResult(_0x25db48,_0x504922){return function(_0x3068b6){if(_0x3068b6){var _0x3845b1=typeof _0x504922['offset']===_0xfc85('0x1a')&&typeof _0x504922[_0xfc85('0x1b')]===_0xfc85('0x1a');var _0x1f7d35=_0x3068b6[_0xfc85('0x1c')];var _0x4ad72b=_0x3845b1?0x0:_0x504922[_0xfc85('0x1d')];var _0x4b2a37=_0x3845b1?_0x3068b6[_0xfc85('0x1c')]:_0x504922[_0xfc85('0x1d')]+_0x504922[_0xfc85('0x1b')];var _0x13d158;if(_0x4b2a37>=_0x1f7d35){_0x4b2a37=_0x1f7d35;_0x13d158=0xc8;}else{_0x13d158=0xce;}_0x25db48[_0xfc85('0x1e')](_0x13d158);return _0x25db48[_0xfc85('0x1f')](_0xfc85('0x20'),_0x4ad72b+'-'+_0x4b2a37+'/'+_0x1f7d35)[_0xfc85('0x19')](_0x3068b6);}return null;};}function patchUpdates(_0x157c39){return function(_0x4e20c1){try{jsonpatch[_0xfc85('0x21')](_0x4e20c1,_0x157c39,!![]);}catch(_0x1e690a){return BPromise[_0xfc85('0x22')](_0x1e690a);}return _0x4e20c1[_0xfc85('0x23')]();};}function saveUpdates(_0x5f3586,_0x40cb71){return function(_0x5dd0b1){if(_0x5dd0b1){return _0x5dd0b1[_0xfc85('0x24')](_0x5f3586)[_0xfc85('0x25')](function(_0x56db18){return _0x56db18;});}return null;};}function removeEntity(_0x122111,_0x2eec52){return function(_0x5a030b){if(_0x5a030b){return _0x5a030b[_0xfc85('0x26')]()[_0xfc85('0x25')](function(){_0x122111[_0xfc85('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35bb69,_0x4aa3df){return function(_0x340633){if(!_0x340633){_0x35bb69[_0xfc85('0x17')](0x194);}return _0x340633;};}function handleError(_0x3f513c,_0x34187b){_0x34187b=_0x34187b||0x1f4;return function(_0x24adf3){logger[_0xfc85('0x27')](_0x24adf3[_0xfc85('0x28')]);if(_0x24adf3[_0xfc85('0x29')]){delete _0x24adf3['name'];}_0x3f513c[_0xfc85('0x1e')](_0x34187b)[_0xfc85('0x2a')](_0x24adf3);};}exports[_0xfc85('0x2b')]=function(_0x38a8bf,_0x1bb7e5){var _0x1fe253={},_0x438715={},_0x254778={'count':0x0,'rows':[]};var _0x202f66=_[_0xfc85('0x2c')](db['AnalyticTreeReport'][_0xfc85('0x2d')],function(_0x59eb35){return{'name':_0x59eb35[_0xfc85('0x2e')],'type':_0x59eb35[_0xfc85('0x2f')]['key']};});_0x438715[_0xfc85('0x30')]=_[_0xfc85('0x2c')](_0x202f66,_0xfc85('0x29'));_0x438715[_0xfc85('0x31')]=_[_0xfc85('0x32')](_0x38a8bf[_0xfc85('0x31')]);_0x438715[_0xfc85('0x33')]=_[_0xfc85('0x34')](_0x438715[_0xfc85('0x30')],_0x438715[_0xfc85('0x31')]);_0x1fe253['attributes']=_[_0xfc85('0x34')](_0x438715['model'],qs[_0xfc85('0x35')](_0x38a8bf[_0xfc85('0x31')]['fields']));_0x1fe253[_0xfc85('0x36')]=_0x1fe253['attributes'][_0xfc85('0x37')]?_0x1fe253[_0xfc85('0x36')]:_0x438715['model'];if(!_0x38a8bf[_0xfc85('0x31')][_0xfc85('0x38')](_0xfc85('0x39'))){_0x1fe253[_0xfc85('0x1b')]=qs['limit'](_0x38a8bf[_0xfc85('0x31')][_0xfc85('0x1b')]);_0x1fe253[_0xfc85('0x1d')]=qs[_0xfc85('0x1d')](_0x38a8bf['query']['offset']);}_0x1fe253[_0xfc85('0x3a')]=qs[_0xfc85('0x3b')](_0x38a8bf['query'][_0xfc85('0x3b')]);_0x1fe253[_0xfc85('0x3c')]=qs[_0xfc85('0x33')](_[_0xfc85('0x3d')](_0x38a8bf['query'],_0x438715['filters']),_0x202f66);if(_0x38a8bf[_0xfc85('0x31')][_0xfc85('0x3e')]){_0x1fe253[_0xfc85('0x3c')]=_[_0xfc85('0x3f')](_0x1fe253[_0xfc85('0x3c')],{'$or':_[_0xfc85('0x2c')](_0x202f66,function(_0x131636){if(_0x131636[_0xfc85('0x2f')]!=='VIRTUAL'){var _0x5bc62b={};_0x5bc62b[_0x131636[_0xfc85('0x29')]]={'$like':'%'+_0x38a8bf[_0xfc85('0x31')][_0xfc85('0x3e')]+'%'};return _0x5bc62b;}})});}_0x1fe253=_[_0xfc85('0x3f')]({},_0x1fe253,_0x38a8bf['options']);var _0xbb964b={'where':_0x1fe253[_0xfc85('0x3c')]};return db[_0xfc85('0x40')][_0xfc85('0x1c')](_0xbb964b)['then'](function(_0xbc5158){_0x254778[_0xfc85('0x1c')]=_0xbc5158;if(_0x38a8bf[_0xfc85('0x31')][_0xfc85('0x41')]){_0x1fe253['include']=[{'all':!![]}];}return db[_0xfc85('0x40')][_0xfc85('0x42')](_0x1fe253);})[_0xfc85('0x25')](function(_0x3a2863){_0x254778[_0xfc85('0x43')]=_0x3a2863;return _0x254778;})[_0xfc85('0x25')](respondWithFilteredResult(_0x1bb7e5,_0x1fe253))[_0xfc85('0x44')](handleError(_0x1bb7e5,null));};exports[_0xfc85('0x45')]=function(_0x1d533c,_0x1ffe51){var _0x5d764d={'raw':!![],'where':{'id':_0x1d533c[_0xfc85('0x46')]['id']}},_0x46f3cf={};_0x46f3cf[_0xfc85('0x30')]=_[_0xfc85('0x32')](db[_0xfc85('0x40')][_0xfc85('0x2d')]);_0x46f3cf[_0xfc85('0x31')]=_[_0xfc85('0x32')](_0x1d533c['query']);_0x46f3cf[_0xfc85('0x33')]=_[_0xfc85('0x34')](_0x46f3cf[_0xfc85('0x30')],_0x46f3cf[_0xfc85('0x31')]);_0x5d764d[_0xfc85('0x36')]=_[_0xfc85('0x34')](_0x46f3cf[_0xfc85('0x30')],qs['fields'](_0x1d533c[_0xfc85('0x31')][_0xfc85('0x35')]));_0x5d764d[_0xfc85('0x36')]=_0x5d764d[_0xfc85('0x36')][_0xfc85('0x37')]?_0x5d764d[_0xfc85('0x36')]:_0x46f3cf[_0xfc85('0x30')];if(_0x1d533c[_0xfc85('0x31')][_0xfc85('0x41')]){_0x5d764d['include']=[{'all':!![]}];}_0x5d764d=_[_0xfc85('0x3f')]({},_0x5d764d,_0x1d533c['options']);return db[_0xfc85('0x40')][_0xfc85('0x47')](_0x5d764d)[_0xfc85('0x25')](handleEntityNotFound(_0x1ffe51,null))['then'](respondWithResult(_0x1ffe51,null))[_0xfc85('0x44')](handleError(_0x1ffe51,null));};exports['create']=function(_0x32d674,_0x213019){return db[_0xfc85('0x40')][_0xfc85('0x48')](_0x32d674[_0xfc85('0x49')],{})[_0xfc85('0x25')](respondWithResult(_0x213019,0xc9))[_0xfc85('0x44')](handleError(_0x213019,null));};exports[_0xfc85('0x24')]=function(_0x1a3865,_0x54b6ac){if(_0x1a3865[_0xfc85('0x49')]['id']){delete _0x1a3865[_0xfc85('0x49')]['id'];}return db[_0xfc85('0x40')][_0xfc85('0x47')]({'where':{'id':_0x1a3865[_0xfc85('0x46')]['id']}})['then'](handleEntityNotFound(_0x54b6ac,null))['then'](saveUpdates(_0x1a3865[_0xfc85('0x49')],null))[_0xfc85('0x25')](respondWithResult(_0x54b6ac,null))[_0xfc85('0x44')](handleError(_0x54b6ac,null));};exports[_0xfc85('0x26')]=function(_0x344097,_0x88f8ed){return db[_0xfc85('0x40')]['find']({'where':{'id':_0x344097[_0xfc85('0x46')]['id']}})[_0xfc85('0x25')](handleEntityNotFound(_0x88f8ed,null))[_0xfc85('0x25')](removeEntity(_0x88f8ed,null))[_0xfc85('0x44')](handleError(_0x88f8ed,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index d1eac63..84612f5 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 _0x134d=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3ab53f,_0x508ae7){var _0x42c654=function(_0x4095e2){while(--_0x4095e2){_0x3ab53f['push'](_0x3ab53f['shift']());}};_0x42c654(++_0x508ae7);}(_0x134d,0x173));var _0xd134=function(_0x530a5d,_0x59d1ae){_0x530a5d=_0x530a5d-0x0;var _0x1b297d=_0x134d[_0x530a5d];return _0x1b297d;};'use strict';var _=require('lodash');var util=require(_0xd134('0x0'));var logger=require(_0xd134('0x1'))(_0xd134('0x2'));var moment=require(_0xd134('0x3'));var BPromise=require(_0xd134('0x4'));var rp=require(_0xd134('0x5'));var fs=require('fs');var path=require(_0xd134('0x6'));var rimraf=require(_0xd134('0x7'));var config=require(_0xd134('0x8'));var attributes=require(_0xd134('0x9'));module[_0xd134('0xa')]=function(_0x5d6249,_0x5911a5){return _0x5d6249[_0xd134('0xb')](_0xd134('0xc'),attributes,{'tableName':_0xd134('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f2b=['define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x266c69,_0xa8e09b){var _0x5f40b1=function(_0x462884){while(--_0x462884){_0x266c69['push'](_0x266c69['shift']());}};_0x5f40b1(++_0xa8e09b);}(_0x3f2b,0x9d));var _0xb3f2=function(_0x4a6949,_0x19f035){_0x4a6949=_0x4a6949-0x0;var _0x142277=_0x3f2b[_0x4a6949];return _0x142277;};'use strict';var _=require(_0xb3f2('0x0'));var util=require(_0xb3f2('0x1'));var logger=require(_0xb3f2('0x2'))(_0xb3f2('0x3'));var moment=require(_0xb3f2('0x4'));var BPromise=require(_0xb3f2('0x5'));var rp=require(_0xb3f2('0x6'));var fs=require('fs');var path=require(_0xb3f2('0x7'));var rimraf=require('rimraf');var config=require(_0xb3f2('0x8'));var attributes=require(_0xb3f2('0x9'));module[_0xb3f2('0xa')]=function(_0x58609b,_0x421be4){return _0x58609b[_0xb3f2('0xb')](_0xb3f2('0xc'),attributes,{'tableName':_0xb3f2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 6089a78..06a316c 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x5d628f,_0xdfa6ac){var _0x68983a=function(_0x3c28ae){while(--_0x3c28ae){_0x5d628f['push'](_0x5d628f['shift']());}};_0x68983a(++_0xdfa6ac);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2de25a,_0x5df46f){_0x2de25a=_0x2de25a-0x0;var _0x132f44=_0x5f2f[_0x2de25a];return _0x132f44;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x1bb832,_0x366797){_0x1bb832=_0x1bb832-0x0;var _0x38bc37=_0x7a54[_0x1bb832];return _0x38bc37;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index d0d2bbe..fda5717 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 _0x2472=['put','update','exports','util','path','Router','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x3609af,_0x3d20ea){var _0x438412=function(_0x3bc2a4){while(--_0x3bc2a4){_0x3609af['push'](_0x3609af['shift']());}};_0x438412(++_0x3d20ea);}(_0x2472,0xe3));var _0x2247=function(_0x4eb2b5,_0x35d937){_0x4eb2b5=_0x4eb2b5-0x0;var _0x226ef8=_0x2472[_0x4eb2b5];return _0x226ef8;};'use strict';var multer=require('multer');var util=require(_0x2247('0x0'));var path=require(_0x2247('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2247('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2247('0x3'));var config=require('../../config/environment');var controller=require(_0x2247('0x4'));router[_0x2247('0x5')]('/',auth[_0x2247('0x6')](),controller[_0x2247('0x7')]);router[_0x2247('0x5')](_0x2247('0x8'),auth[_0x2247('0x6')](),controller[_0x2247('0x9')]);router[_0x2247('0xa')]('/',auth[_0x2247('0x6')](),controller['create']);router[_0x2247('0xb')]('/:id',auth[_0x2247('0x6')](),controller[_0x2247('0xc')]);router['delete'](_0x2247('0x8'),auth[_0x2247('0x6')](),controller['destroy']);module[_0x2247('0xd')]=router;
\ No newline at end of file
+var _0xa6b6=['../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','exports','multer','util','path','fs-extra','../../components/auth/service'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xa6b6,0x171));var _0x6a6b=function(_0x161587,_0x5c4528){_0x161587=_0x161587-0x0;var _0x293546=_0xa6b6[_0x161587];return _0x293546;};'use strict';var multer=require(_0x6a6b('0x0'));var util=require(_0x6a6b('0x1'));var path=require(_0x6a6b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6a6b('0x3'));var auth=require(_0x6a6b('0x4'));var interaction=require(_0x6a6b('0x5'));var config=require('../../config/environment');var controller=require(_0x6a6b('0x6'));router[_0x6a6b('0x7')]('/',auth[_0x6a6b('0x8')](),controller[_0x6a6b('0x9')]);router[_0x6a6b('0x7')](_0x6a6b('0xa'),auth[_0x6a6b('0x8')](),controller[_0x6a6b('0xb')]);router[_0x6a6b('0xc')]('/',auth[_0x6a6b('0x8')](),controller[_0x6a6b('0xd')]);router['put'](_0x6a6b('0xa'),auth['isAuthenticated'](),controller[_0x6a6b('0xe')]);router[_0x6a6b('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6a6b('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index ce80c58..41ad5e6 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 _0xeedf=['sequelize','exports','STRING'];(function(_0x5c0431,_0x122734){var _0x516bfa=function(_0x4528e4){while(--_0x4528e4){_0x5c0431['push'](_0x5c0431['shift']());}};_0x516bfa(++_0x122734);}(_0xeedf,0x12c));var _0xfeed=function(_0x204912,_0x491149){_0x204912=_0x204912-0x0;var _0x568075=_0xeedf[_0x204912];return _0x568075;};'use strict';var Sequelize=require(_0xfeed('0x0'));module[_0xfeed('0x1')]={'name':{'type':Sequelize[_0xfeed('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xfeed('0x2')]}};
\ No newline at end of file
+var _0xecd5=['exports','STRING'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xecd5,0x110));var _0x5ecd=function(_0x32849f,_0x530722){_0x32849f=_0x32849f-0x0;var _0x2b34c7=_0xecd5[_0x32849f];return _0x2b34c7;};'use strict';var Sequelize=require('sequelize');module[_0x5ecd('0x0')]={'name':{'type':Sequelize[_0x5ecd('0x1')]},'basename':{'type':Sequelize[_0x5ecd('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index f66207d..32cbcd4 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 _0xf57f=['options','include','findAll','show','params','keys','Attachment','find','catch','clone','includeAll','get','omit','createdAt','updatedAt','body','create','file','basename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','then','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL'];(function(_0x2a2f72,_0x2dead3){var _0x369c6a=function(_0x252507){while(--_0x252507){_0x2a2f72['push'](_0x2a2f72['shift']());}};_0x369c6a(++_0x2dead3);}(_0xf57f,0x166));var _0xff57=function(_0x31abee,_0x11ff0c){_0x31abee=_0x31abee-0x0;var _0x3c1761=_0xf57f[_0x31abee];return _0x3c1761;};'use strict';var emlformat=require(_0xff57('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff57('0x1'));var jsonpatch=require(_0xff57('0x2'));var rp=require('request-promise');var moment=require(_0xff57('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xff57('0x4'));var sox=require(_0xff57('0x5'));var csv=require(_0xff57('0x6'));var ejs=require(_0xff57('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff57('0x8'));var squel=require('squel');var crypto=require(_0xff57('0x9'));var jsforce=require(_0xff57('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xff57('0x6'));var querystring=require(_0xff57('0xb'));var Papa=require('papaparse');var Redis=require(_0xff57('0xc'));var authService=require(_0xff57('0xd'));var qs=require(_0xff57('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff57('0xf'));var logger=require(_0xff57('0x10'))(_0xff57('0x11'));var utils=require(_0xff57('0x12'));var config=require(_0xff57('0x13'));var licenseUtil=require(_0xff57('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57c351,_0x322f1b){_0x322f1b=_0x322f1b||0xcc;return function(_0xa0ba48){if(_0xa0ba48){return _0x57c351['sendStatus'](_0x322f1b);}return _0x57c351[_0xff57('0x15')](_0x322f1b)[_0xff57('0x16')]();};}function respondWithResult(_0x292b3e,_0x4255d6){_0x4255d6=_0x4255d6||0xc8;return function(_0x2e830a){if(_0x2e830a){return _0x292b3e['status'](_0x4255d6)['json'](_0x2e830a);}};}function respondWithFilteredResult(_0x491eac,_0x3f2995){return function(_0x276127){if(_0x276127){var _0x2ed712=typeof _0x3f2995[_0xff57('0x17')]==='undefined'&&typeof _0x3f2995[_0xff57('0x18')]===_0xff57('0x19');var _0x1b4e66=_0x276127[_0xff57('0x1a')];var _0x4cf6fd=_0x2ed712?0x0:_0x3f2995[_0xff57('0x17')];var _0x1307c3=_0x2ed712?_0x276127[_0xff57('0x1a')]:_0x3f2995[_0xff57('0x17')]+_0x3f2995[_0xff57('0x18')];var _0x46cc53;if(_0x1307c3>=_0x1b4e66){_0x1307c3=_0x1b4e66;_0x46cc53=0xc8;}else{_0x46cc53=0xce;}_0x491eac[_0xff57('0x15')](_0x46cc53);return _0x491eac[_0xff57('0x1b')](_0xff57('0x1c'),_0x4cf6fd+'-'+_0x1307c3+'/'+_0x1b4e66)[_0xff57('0x1d')](_0x276127);}return null;};}function patchUpdates(_0xb1a8bd){return function(_0x53bf82){try{jsonpatch['apply'](_0x53bf82,_0xb1a8bd,!![]);}catch(_0x493d67){return BPromise[_0xff57('0x1e')](_0x493d67);}return _0x53bf82[_0xff57('0x1f')]();};}function saveUpdates(_0x532c6c,_0x568fd5){return function(_0x4fae20){if(_0x4fae20){return _0x4fae20['update'](_0x532c6c)[_0xff57('0x20')](function(_0x21ac20){return _0x21ac20;});}return null;};}function removeEntity(_0x4bb241,_0x39fd56){return function(_0x1977de){if(_0x1977de){return _0x1977de['destroy']()[_0xff57('0x20')](function(){_0x4bb241[_0xff57('0x15')](0xcc)[_0xff57('0x16')]();});}};}function handleEntityNotFound(_0x8c32f5,_0x1eb8bb){return function(_0x195a97){if(!_0x195a97){_0x8c32f5[_0xff57('0x21')](0x194);}return _0x195a97;};}function handleError(_0x13970a,_0x44886f){_0x44886f=_0x44886f||0x1f4;return function(_0x3699c0){logger[_0xff57('0x22')](_0x3699c0[_0xff57('0x23')]);if(_0x3699c0['name']){delete _0x3699c0[_0xff57('0x24')];}_0x13970a['status'](_0x44886f)['send'](_0x3699c0);};}exports[_0xff57('0x25')]=function(_0x4a2387,_0x49834e){var _0x3aa3e5={},_0x4f319c={},_0x27314e={'count':0x0,'rows':[]};var _0x13ba0b=_[_0xff57('0x26')](db['Attachment'][_0xff57('0x27')],function(_0x235e57){return{'name':_0x235e57[_0xff57('0x28')],'type':_0x235e57[_0xff57('0x29')]['key']};});_0x4f319c[_0xff57('0x2a')]=_[_0xff57('0x26')](_0x13ba0b,_0xff57('0x24'));_0x4f319c[_0xff57('0x2b')]=_['keys'](_0x4a2387[_0xff57('0x2b')]);_0x4f319c['filters']=_[_0xff57('0x2c')](_0x4f319c[_0xff57('0x2a')],_0x4f319c[_0xff57('0x2b')]);_0x3aa3e5[_0xff57('0x2d')]=_['intersection'](_0x4f319c[_0xff57('0x2a')],qs['fields'](_0x4a2387['query'][_0xff57('0x2e')]));_0x3aa3e5['attributes']=_0x3aa3e5[_0xff57('0x2d')][_0xff57('0x2f')]?_0x3aa3e5[_0xff57('0x2d')]:_0x4f319c[_0xff57('0x2a')];if(!_0x4a2387[_0xff57('0x2b')][_0xff57('0x30')](_0xff57('0x31'))){_0x3aa3e5[_0xff57('0x18')]=qs[_0xff57('0x18')](_0x4a2387[_0xff57('0x2b')]['limit']);_0x3aa3e5[_0xff57('0x17')]=qs['offset'](_0x4a2387[_0xff57('0x2b')][_0xff57('0x17')]);}_0x3aa3e5['order']=qs[_0xff57('0x32')](_0x4a2387[_0xff57('0x2b')][_0xff57('0x32')]);_0x3aa3e5['where']=qs[_0xff57('0x33')](_[_0xff57('0x34')](_0x4a2387[_0xff57('0x2b')],_0x4f319c['filters']),_0x13ba0b);if(_0x4a2387['query'][_0xff57('0x35')]){_0x3aa3e5[_0xff57('0x36')]=_[_0xff57('0x37')](_0x3aa3e5[_0xff57('0x36')],{'$or':_[_0xff57('0x26')](_0x13ba0b,function(_0x273b4b){if(_0x273b4b[_0xff57('0x29')]!==_0xff57('0x38')){var _0x364e9f={};_0x364e9f[_0x273b4b[_0xff57('0x24')]]={'$like':'%'+_0x4a2387[_0xff57('0x2b')][_0xff57('0x35')]+'%'};return _0x364e9f;}})});}_0x3aa3e5=_[_0xff57('0x37')]({},_0x3aa3e5,_0x4a2387[_0xff57('0x39')]);var _0x5086f3={'where':_0x3aa3e5[_0xff57('0x36')]};return db['Attachment'][_0xff57('0x1a')](_0x5086f3)['then'](function(_0x4c49ab){_0x27314e[_0xff57('0x1a')]=_0x4c49ab;if(_0x4a2387['query']['includeAll']){_0x3aa3e5[_0xff57('0x3a')]=[{'all':!![]}];}return db['Attachment'][_0xff57('0x3b')](_0x3aa3e5);})[_0xff57('0x20')](function(_0x1c1d4c){_0x27314e['rows']=_0x1c1d4c;return _0x27314e;})[_0xff57('0x20')](respondWithFilteredResult(_0x49834e,_0x3aa3e5))['catch'](handleError(_0x49834e,null));};exports[_0xff57('0x3c')]=function(_0x5939c2,_0x2098cf){var _0x6f220e={'raw':!![],'where':{'id':_0x5939c2[_0xff57('0x3d')]['id']}},_0x403f9b={};_0x403f9b[_0xff57('0x2a')]=_[_0xff57('0x3e')](db[_0xff57('0x3f')][_0xff57('0x27')]);_0x403f9b[_0xff57('0x2b')]=_[_0xff57('0x3e')](_0x5939c2[_0xff57('0x2b')]);_0x403f9b[_0xff57('0x33')]=_[_0xff57('0x2c')](_0x403f9b['model'],_0x403f9b[_0xff57('0x2b')]);_0x6f220e['attributes']=_[_0xff57('0x2c')](_0x403f9b['model'],qs[_0xff57('0x2e')](_0x5939c2[_0xff57('0x2b')][_0xff57('0x2e')]));_0x6f220e[_0xff57('0x2d')]=_0x6f220e[_0xff57('0x2d')][_0xff57('0x2f')]?_0x6f220e[_0xff57('0x2d')]:_0x403f9b[_0xff57('0x2a')];if(_0x5939c2['query']['includeAll']){_0x6f220e[_0xff57('0x3a')]=[{'all':!![]}];}_0x6f220e=_[_0xff57('0x37')]({},_0x6f220e,_0x5939c2['options']);return db['Attachment'][_0xff57('0x40')](_0x6f220e)['then'](handleEntityNotFound(_0x2098cf,null))[_0xff57('0x20')](respondWithResult(_0x2098cf,null))[_0xff57('0x41')](handleError(_0x2098cf,null));};exports[_0xff57('0x42')]=function(_0x4f7f35,_0x2911ee){var _0x273be7={'where':{'id':_0x4f7f35[_0xff57('0x3d')]['id']}},_0x66c534={};_0x66c534[_0xff57('0x2a')]=_[_0xff57('0x3e')](db[_0xff57('0x3f')][_0xff57('0x27')]);_0x273be7['attributes']=_[_0xff57('0x2c')](_0x66c534['model'],qs['fields'](_0x4f7f35[_0xff57('0x2b')][_0xff57('0x2e')]));_0x273be7['attributes']=_0x273be7[_0xff57('0x2d')][_0xff57('0x2f')]?_0x273be7[_0xff57('0x2d')]:_0x66c534[_0xff57('0x2a')];if(_0x4f7f35[_0xff57('0x2b')][_0xff57('0x43')]){_0x273be7['include']=[{'all':!![]}];}_0x273be7=_[_0xff57('0x37')]({},_0x273be7,_0x4f7f35['options']);return db[_0xff57('0x3f')]['find'](_0x273be7)[_0xff57('0x20')](handleEntityNotFound(_0x2911ee,null))['then'](function(_0xed4a6f){if(_0xed4a6f){var _0x1f513d=_0xed4a6f[_0xff57('0x44')]({'plain':!![]});_0x1f513d=qs[_0xff57('0x45')](_0x1f513d,['id',_0xff57('0x46'),_0xff57('0x47')]);_0x4f7f35[_0xff57('0x48')]=_[_0xff57('0x45')](_0x4f7f35['body'],['id','createdAt',_0xff57('0x47')]);return db['Attachment'][_0xff57('0x49')](_[_0xff57('0x37')](_0x1f513d,_0x4f7f35[_0xff57('0x48')]),{'include':_0x4f7f35[_0xff57('0x2b')][_0xff57('0x43')]?[{'all':!![]}]:undefined});}})[_0xff57('0x20')](respondWithResult(_0x2911ee,0xc9))[_0xff57('0x41')](handleError(_0x2911ee,null));};exports['update']=function(_0x211a35,_0x12355a){if(_0x211a35['body']['id']){delete _0x211a35[_0xff57('0x48')]['id'];}return db[_0xff57('0x3f')][_0xff57('0x40')]({'where':{'id':_0x211a35['params']['id']}})[_0xff57('0x20')](handleEntityNotFound(_0x12355a,null))[_0xff57('0x20')](saveUpdates(_0x211a35['body'],null))['then'](respondWithResult(_0x12355a,null))[_0xff57('0x41')](handleError(_0x12355a,null));};exports['destroy']=function(_0x2b0342,_0x1cec55){return db['Attachment'][_0xff57('0x40')]({'where':{'id':_0x2b0342[_0xff57('0x3d')]['id']}})[_0xff57('0x20')](handleEntityNotFound(_0x1cec55,null))[_0xff57('0x20')](removeEntity(_0x1cec55,null))[_0xff57('0x41')](handleError(_0x1cec55,null));};exports[_0xff57('0x49')]=function(_0x2c8bf2,_0x3bf119,_0x34ed44){_0x2c8bf2[_0xff57('0x48')][_0xff57('0x24')]=_0x2c8bf2[_0xff57('0x4a')]['originalname'];_0x2c8bf2['body'][_0xff57('0x4b')]=_0x2c8bf2['file']['filename'];_0x2c8bf2['body'][_0xff57('0x29')]=_0x2c8bf2[_0xff57('0x4a')]['mimetype'];return db[_0xff57('0x3f')][_0xff57('0x49')](_0x2c8bf2[_0xff57('0x48')])['then'](respondWithResult(_0x3bf119,0xc9))[_0xff57('0x41')](handleError(_0x3bf119,null));};exports[_0xff57('0x4c')]=function(_0x2f7427,_0x26ead9,_0x36be45){return db['Attachment'][_0xff57('0x4d')]({'where':{'id':_0x2f7427['params']['id']},'raw':!![]})[_0xff57('0x20')](handleEntityNotFound(_0x26ead9,null))[_0xff57('0x20')](function(_0x4518e0){if(_0x4518e0){var _0x1e3f54=_0x4518e0[_0xff57('0x4e')]!==null;var _0x95d87d=path[_0xff57('0x4f')](config[_0xff57('0x50')],_0xff57('0x51'));if(_0x1e3f54){_0x95d87d=path[_0xff57('0x4f')](_0x95d87d,_0xff57('0x52'));}var _0x490c04=path[_0xff57('0x4f')](_0x95d87d,_0x4518e0['basename']);return _0x26ead9[_0xff57('0x4c')](_0x490c04);}})[_0xff57('0x41')](handleError(_0x26ead9,null));};
\ No newline at end of file
+var _0x27bf=['status','end','json','offset','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','Attachment','include','findAll','catch','params','includeAll','find','clone','rawAttributes','get','omit','createdAt','updatedAt','create','body','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2dffb4,_0x4bbbf3){var _0x4174ec=function(_0x13ec24){while(--_0x13ec24){_0x2dffb4['push'](_0x2dffb4['shift']());}};_0x4174ec(++_0x4bbbf3);}(_0x27bf,0x14e));var _0xf27b=function(_0xbe46a1,_0x496093){_0xbe46a1=_0xbe46a1-0x0;var _0x399489=_0x27bf[_0xbe46a1];return _0x399489;};'use strict';var emlformat=require(_0xf27b('0x0'));var rimraf=require(_0xf27b('0x1'));var zipdir=require(_0xf27b('0x2'));var jsonpatch=require(_0xf27b('0x3'));var rp=require('request-promise');var moment=require(_0xf27b('0x4'));var BPromise=require(_0xf27b('0x5'));var Mustache=require(_0xf27b('0x6'));var util=require(_0xf27b('0x7'));var path=require(_0xf27b('0x8'));var sox=require(_0xf27b('0x9'));var csv=require(_0xf27b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf27b('0xb'));var squel=require(_0xf27b('0xc'));var crypto=require(_0xf27b('0xd'));var jsforce=require(_0xf27b('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf27b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf27b('0x10'));var qs=require(_0xf27b('0x11'));var as=require(_0xf27b('0x12'));var hardwareService=require(_0xf27b('0x13'));var logger=require(_0xf27b('0x14'))(_0xf27b('0x15'));var utils=require(_0xf27b('0x16'));var config=require(_0xf27b('0x17'));var licenseUtil=require(_0xf27b('0x18'));var db=require(_0xf27b('0x19'))['db'];function respondWithStatusCode(_0x1cffb7,_0x224efc){_0x224efc=_0x224efc||0xcc;return function(_0x23403c){if(_0x23403c){return _0x1cffb7['sendStatus'](_0x224efc);}return _0x1cffb7[_0xf27b('0x1a')](_0x224efc)[_0xf27b('0x1b')]();};}function respondWithResult(_0x199d02,_0x327fc8){_0x327fc8=_0x327fc8||0xc8;return function(_0x21402b){if(_0x21402b){return _0x199d02[_0xf27b('0x1a')](_0x327fc8)[_0xf27b('0x1c')](_0x21402b);}};}function respondWithFilteredResult(_0x510fc2,_0x214d76){return function(_0x58dd31){if(_0x58dd31){var _0x19ee90=typeof _0x214d76[_0xf27b('0x1d')]==='undefined'&&typeof _0x214d76[_0xf27b('0x1e')]==='undefined';var _0x6a1766=_0x58dd31[_0xf27b('0x1f')];var _0x249e9b=_0x19ee90?0x0:_0x214d76['offset'];var _0x1e22be=_0x19ee90?_0x58dd31[_0xf27b('0x1f')]:_0x214d76['offset']+_0x214d76[_0xf27b('0x1e')];var _0x4175cd;if(_0x1e22be>=_0x6a1766){_0x1e22be=_0x6a1766;_0x4175cd=0xc8;}else{_0x4175cd=0xce;}_0x510fc2[_0xf27b('0x1a')](_0x4175cd);return _0x510fc2['set'](_0xf27b('0x20'),_0x249e9b+'-'+_0x1e22be+'/'+_0x6a1766)['json'](_0x58dd31);}return null;};}function patchUpdates(_0x5c9f70){return function(_0x2b2cf3){try{jsonpatch[_0xf27b('0x21')](_0x2b2cf3,_0x5c9f70,!![]);}catch(_0xe8eeb){return BPromise[_0xf27b('0x22')](_0xe8eeb);}return _0x2b2cf3['save']();};}function saveUpdates(_0x25af00,_0x431ba4){return function(_0x5edcc7){if(_0x5edcc7){return _0x5edcc7[_0xf27b('0x23')](_0x25af00)[_0xf27b('0x24')](function(_0x53ab3a){return _0x53ab3a;});}return null;};}function removeEntity(_0x30bdcd,_0x66e78e){return function(_0x2446dd){if(_0x2446dd){return _0x2446dd[_0xf27b('0x25')]()['then'](function(){_0x30bdcd[_0xf27b('0x1a')](0xcc)[_0xf27b('0x1b')]();});}};}function handleEntityNotFound(_0x31c1ae,_0x292358){return function(_0x311994){if(!_0x311994){_0x31c1ae[_0xf27b('0x26')](0x194);}return _0x311994;};}function handleError(_0x2e6355,_0x3291ca){_0x3291ca=_0x3291ca||0x1f4;return function(_0x4251bb){logger[_0xf27b('0x27')](_0x4251bb[_0xf27b('0x28')]);if(_0x4251bb[_0xf27b('0x29')]){delete _0x4251bb['name'];}_0x2e6355[_0xf27b('0x1a')](_0x3291ca)[_0xf27b('0x2a')](_0x4251bb);};}exports[_0xf27b('0x2b')]=function(_0x2a0f63,_0xd77301){var _0x40b1c4={},_0x58f3b9={},_0xfe1fc4={'count':0x0,'rows':[]};var _0x30cd3d=_[_0xf27b('0x2c')](db['Attachment']['rawAttributes'],function(_0x1cad44){return{'name':_0x1cad44[_0xf27b('0x2d')],'type':_0x1cad44[_0xf27b('0x2e')]['key']};});_0x58f3b9['model']=_[_0xf27b('0x2c')](_0x30cd3d,'name');_0x58f3b9[_0xf27b('0x2f')]=_[_0xf27b('0x30')](_0x2a0f63[_0xf27b('0x2f')]);_0x58f3b9[_0xf27b('0x31')]=_[_0xf27b('0x32')](_0x58f3b9[_0xf27b('0x33')],_0x58f3b9[_0xf27b('0x2f')]);_0x40b1c4[_0xf27b('0x34')]=_[_0xf27b('0x32')](_0x58f3b9['model'],qs[_0xf27b('0x35')](_0x2a0f63[_0xf27b('0x2f')]['fields']));_0x40b1c4[_0xf27b('0x34')]=_0x40b1c4[_0xf27b('0x34')][_0xf27b('0x36')]?_0x40b1c4[_0xf27b('0x34')]:_0x58f3b9[_0xf27b('0x33')];if(!_0x2a0f63[_0xf27b('0x2f')][_0xf27b('0x37')](_0xf27b('0x38'))){_0x40b1c4[_0xf27b('0x1e')]=qs[_0xf27b('0x1e')](_0x2a0f63['query'][_0xf27b('0x1e')]);_0x40b1c4[_0xf27b('0x1d')]=qs[_0xf27b('0x1d')](_0x2a0f63['query'][_0xf27b('0x1d')]);}_0x40b1c4['order']=qs[_0xf27b('0x39')](_0x2a0f63[_0xf27b('0x2f')][_0xf27b('0x39')]);_0x40b1c4[_0xf27b('0x3a')]=qs[_0xf27b('0x31')](_['pick'](_0x2a0f63[_0xf27b('0x2f')],_0x58f3b9['filters']),_0x30cd3d);if(_0x2a0f63[_0xf27b('0x2f')][_0xf27b('0x3b')]){_0x40b1c4[_0xf27b('0x3a')]=_['merge'](_0x40b1c4[_0xf27b('0x3a')],{'$or':_[_0xf27b('0x2c')](_0x30cd3d,function(_0x41058c){if(_0x41058c['type']!==_0xf27b('0x3c')){var _0xe51d9e={};_0xe51d9e[_0x41058c['name']]={'$like':'%'+_0x2a0f63[_0xf27b('0x2f')][_0xf27b('0x3b')]+'%'};return _0xe51d9e;}})});}_0x40b1c4=_[_0xf27b('0x3d')]({},_0x40b1c4,_0x2a0f63[_0xf27b('0x3e')]);var _0x4f3515={'where':_0x40b1c4[_0xf27b('0x3a')]};return db[_0xf27b('0x3f')]['count'](_0x4f3515)[_0xf27b('0x24')](function(_0x1b8bd2){_0xfe1fc4[_0xf27b('0x1f')]=_0x1b8bd2;if(_0x2a0f63[_0xf27b('0x2f')]['includeAll']){_0x40b1c4[_0xf27b('0x40')]=[{'all':!![]}];}return db['Attachment'][_0xf27b('0x41')](_0x40b1c4);})[_0xf27b('0x24')](function(_0x36ee8a){_0xfe1fc4['rows']=_0x36ee8a;return _0xfe1fc4;})[_0xf27b('0x24')](respondWithFilteredResult(_0xd77301,_0x40b1c4))[_0xf27b('0x42')](handleError(_0xd77301,null));};exports['show']=function(_0x5364f2,_0x59ca9c){var _0x46931e={'raw':!![],'where':{'id':_0x5364f2[_0xf27b('0x43')]['id']}},_0x343212={};_0x343212[_0xf27b('0x33')]=_[_0xf27b('0x30')](db[_0xf27b('0x3f')]['rawAttributes']);_0x343212[_0xf27b('0x2f')]=_['keys'](_0x5364f2[_0xf27b('0x2f')]);_0x343212[_0xf27b('0x31')]=_[_0xf27b('0x32')](_0x343212['model'],_0x343212[_0xf27b('0x2f')]);_0x46931e[_0xf27b('0x34')]=_[_0xf27b('0x32')](_0x343212['model'],qs['fields'](_0x5364f2[_0xf27b('0x2f')]['fields']));_0x46931e[_0xf27b('0x34')]=_0x46931e['attributes'][_0xf27b('0x36')]?_0x46931e[_0xf27b('0x34')]:_0x343212[_0xf27b('0x33')];if(_0x5364f2[_0xf27b('0x2f')][_0xf27b('0x44')]){_0x46931e[_0xf27b('0x40')]=[{'all':!![]}];}_0x46931e=_[_0xf27b('0x3d')]({},_0x46931e,_0x5364f2[_0xf27b('0x3e')]);return db[_0xf27b('0x3f')][_0xf27b('0x45')](_0x46931e)['then'](handleEntityNotFound(_0x59ca9c,null))[_0xf27b('0x24')](respondWithResult(_0x59ca9c,null))[_0xf27b('0x42')](handleError(_0x59ca9c,null));};exports[_0xf27b('0x46')]=function(_0x3951a2,_0x24912){var _0x5acff9={'where':{'id':_0x3951a2[_0xf27b('0x43')]['id']}},_0x203b6e={};_0x203b6e['model']=_[_0xf27b('0x30')](db[_0xf27b('0x3f')][_0xf27b('0x47')]);_0x5acff9[_0xf27b('0x34')]=_[_0xf27b('0x32')](_0x203b6e[_0xf27b('0x33')],qs[_0xf27b('0x35')](_0x3951a2[_0xf27b('0x2f')]['fields']));_0x5acff9[_0xf27b('0x34')]=_0x5acff9[_0xf27b('0x34')][_0xf27b('0x36')]?_0x5acff9['attributes']:_0x203b6e['model'];if(_0x3951a2[_0xf27b('0x2f')]['includeAll']){_0x5acff9[_0xf27b('0x40')]=[{'all':!![]}];}_0x5acff9=_[_0xf27b('0x3d')]({},_0x5acff9,_0x3951a2[_0xf27b('0x3e')]);return db['Attachment']['find'](_0x5acff9)[_0xf27b('0x24')](handleEntityNotFound(_0x24912,null))[_0xf27b('0x24')](function(_0x3de91d){if(_0x3de91d){var _0x267f1f=_0x3de91d[_0xf27b('0x48')]({'plain':!![]});_0x267f1f=qs[_0xf27b('0x49')](_0x267f1f,['id',_0xf27b('0x4a'),'updatedAt']);_0x3951a2['body']=_[_0xf27b('0x49')](_0x3951a2['body'],['id',_0xf27b('0x4a'),_0xf27b('0x4b')]);return db[_0xf27b('0x3f')][_0xf27b('0x4c')](_['merge'](_0x267f1f,_0x3951a2[_0xf27b('0x4d')]),{'include':_0x3951a2['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0xf27b('0x24')](respondWithResult(_0x24912,0xc9))[_0xf27b('0x42')](handleError(_0x24912,null));};exports[_0xf27b('0x23')]=function(_0x39b22e,_0x29e462){if(_0x39b22e[_0xf27b('0x4d')]['id']){delete _0x39b22e['body']['id'];}return db[_0xf27b('0x3f')][_0xf27b('0x45')]({'where':{'id':_0x39b22e['params']['id']}})['then'](handleEntityNotFound(_0x29e462,null))[_0xf27b('0x24')](saveUpdates(_0x39b22e['body'],null))[_0xf27b('0x24')](respondWithResult(_0x29e462,null))[_0xf27b('0x42')](handleError(_0x29e462,null));};exports['destroy']=function(_0x5c5267,_0x4a3f95){return db[_0xf27b('0x3f')][_0xf27b('0x45')]({'where':{'id':_0x5c5267[_0xf27b('0x43')]['id']}})[_0xf27b('0x24')](handleEntityNotFound(_0x4a3f95,null))[_0xf27b('0x24')](removeEntity(_0x4a3f95,null))['catch'](handleError(_0x4a3f95,null));};exports[_0xf27b('0x4c')]=function(_0x5cbe1e,_0xe25b4c,_0x51d88a){_0x5cbe1e['body'][_0xf27b('0x29')]=_0x5cbe1e[_0xf27b('0x4e')][_0xf27b('0x4f')];_0x5cbe1e['body'][_0xf27b('0x50')]=_0x5cbe1e[_0xf27b('0x4e')][_0xf27b('0x51')];_0x5cbe1e[_0xf27b('0x4d')][_0xf27b('0x2e')]=_0x5cbe1e[_0xf27b('0x4e')][_0xf27b('0x52')];return db['Attachment'][_0xf27b('0x4c')](_0x5cbe1e[_0xf27b('0x4d')])[_0xf27b('0x24')](respondWithResult(_0xe25b4c,0xc9))[_0xf27b('0x42')](handleError(_0xe25b4c,null));};exports['download']=function(_0x3cff39,_0x3fdf2c,_0x1e3abb){return db[_0xf27b('0x3f')][_0xf27b('0x53')]({'where':{'id':_0x3cff39['params']['id']},'raw':!![]})[_0xf27b('0x24')](handleEntityNotFound(_0x3fdf2c,null))[_0xf27b('0x24')](function(_0xc48d01){if(_0xc48d01){var _0x64731f=_0xc48d01[_0xf27b('0x54')]!==null;var _0xd8ddae=path['join'](config[_0xf27b('0x55')],_0xf27b('0x56'));if(_0x64731f){_0xd8ddae=path[_0xf27b('0x57')](_0xd8ddae,_0xf27b('0x58'));}var _0x36d8c5=path[_0xf27b('0x57')](_0xd8ddae,_0xc48d01[_0xf27b('0x50')]);return _0x3fdf2c[_0xf27b('0x59')](_0x36d8c5);}})['catch'](handleError(_0x3fdf2c,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index b1962b6..0ec28c2 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 _0x9ed5=['bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','attachments','util','../../config/logger','moment'];(function(_0x4c9380,_0x2fefc0){var _0x49a523=function(_0x165e85){while(--_0x165e85){_0x4c9380['push'](_0x4c9380['shift']());}};_0x49a523(++_0x2fefc0);}(_0x9ed5,0x126));var _0x59ed=function(_0x27bd2c,_0x24bd98){_0x27bd2c=_0x27bd2c-0x0;var _0x3784ea=_0x9ed5[_0x27bd2c];return _0x3784ea;};'use strict';var _=require('lodash');var util=require(_0x59ed('0x0'));var logger=require(_0x59ed('0x1'))('api');var moment=require(_0x59ed('0x2'));var BPromise=require(_0x59ed('0x3'));var rp=require(_0x59ed('0x4'));var fs=require('fs');var path=require(_0x59ed('0x5'));var rimraf=require(_0x59ed('0x6'));var config=require(_0x59ed('0x7'));var attributes=require(_0x59ed('0x8'));module[_0x59ed('0x9')]=function(_0x583118,_0xb1d3db){return _0x583118['define']('Attachment',attributes,{'tableName':_0x59ed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1806=['bluebird','path','rimraf','./attachment.attributes','exports','define','Attachment','attachments','../../config/logger','moment'];(function(_0x4536a5,_0x4cbae1){var _0x4ed53a=function(_0x194805){while(--_0x194805){_0x4536a5['push'](_0x4536a5['shift']());}};_0x4ed53a(++_0x4cbae1);}(_0x1806,0x9e));var _0x6180=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1806[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6180('0x0'))('api');var moment=require(_0x6180('0x1'));var BPromise=require(_0x6180('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6180('0x3'));var rimraf=require(_0x6180('0x4'));var config=require('../../config/environment');var attributes=require(_0x6180('0x5'));module[_0x6180('0x6')]=function(_0x2d63f4,_0x4eb429){return _0x2d63f4[_0x6180('0x7')](_0x6180('0x8'),attributes,{'tableName':_0x6180('0x9'),'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 3e35751..516f4ad 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 _0xae79=['options','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','create','body'];(function(_0x2ab2cc,_0xe88512){var _0x4f89f6=function(_0x3f6e6c){while(--_0x3f6e6c){_0x2ab2cc['push'](_0x2ab2cc['shift']());}};_0x4f89f6(++_0xe88512);}(_0xae79,0x1d3));var _0x9ae7=function(_0x58d4ff,_0x20a955){_0x58d4ff=_0x58d4ff-0x0;var _0x227eea=_0xae79[_0x58d4ff];return _0x227eea;};'use strict';var _=require(_0x9ae7('0x0'));var util=require(_0x9ae7('0x1'));var moment=require(_0x9ae7('0x2'));var BPromise=require(_0x9ae7('0x3'));var rs=require(_0x9ae7('0x4'));var fs=require('fs');var Redis=require(_0x9ae7('0x5'));var db=require(_0x9ae7('0x6'))['db'];var utils=require(_0x9ae7('0x7'));var logger=require(_0x9ae7('0x8'))(_0x9ae7('0x9'));var config=require(_0x9ae7('0xa'));var jayson=require(_0x9ae7('0xb'));var client=jayson[_0x9ae7('0xc')][_0x9ae7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x409d34,_0x57114d,_0x2761c2){return new BPromise(function(_0x47774e,_0x3c7738){return client[_0x9ae7('0xe')](_0x409d34,_0x2761c2)[_0x9ae7('0xf')](function(_0xc023d2){logger['info'](_0x9ae7('0x10'),_0x57114d,'request\x20sent');logger[_0x9ae7('0x11')](_0x9ae7('0x12'),_0x57114d,_0x9ae7('0x13'),JSON[_0x9ae7('0x14')](_0xc023d2));if(_0xc023d2[_0x9ae7('0x15')]){if(_0xc023d2[_0x9ae7('0x15')][_0x9ae7('0x16')]===0x1f4){logger['error'](_0x9ae7('0x10'),_0x57114d,_0xc023d2[_0x9ae7('0x15')]['message']);return _0x3c7738(_0xc023d2[_0x9ae7('0x15')][_0x9ae7('0x17')]);}logger[_0x9ae7('0x15')](_0x9ae7('0x10'),_0x57114d,_0xc023d2[_0x9ae7('0x15')][_0x9ae7('0x17')]);return _0x47774e(_0xc023d2[_0x9ae7('0x15')]['message']);}else{logger[_0x9ae7('0x18')](_0x9ae7('0x10'),_0x57114d,_0x9ae7('0x13'));_0x47774e(_0xc023d2[_0x9ae7('0x19')]['message']);}})[_0x9ae7('0x1a')](function(_0xe1a2d1){logger[_0x9ae7('0x15')]('Attachment,\x20%s,\x20%s',_0x57114d,_0xe1a2d1);_0x3c7738(_0xe1a2d1);});});}exports['CreateAttachment']=function(_0x2c7643){var _0x5e69c2=this;return new Promise(function(_0x5d6ad1,_0x5d0635){return db['Attachment'][_0x9ae7('0x1b')](_0x2c7643[_0x9ae7('0x1c')],{'raw':_0x2c7643[_0x9ae7('0x1d')]?_0x2c7643[_0x9ae7('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x9ae7('0xf')](function(_0x1d94fb){logger['info'](_0x9ae7('0x1e'),_0x2c7643);logger['debug'](_0x9ae7('0x1e'),_0x2c7643,JSON[_0x9ae7('0x14')](_0x1d94fb));_0x5d6ad1(_0x1d94fb);})['catch'](function(_0x356559){logger['error']('CreateAttachment',_0x356559[_0x9ae7('0x17')],_0x2c7643);_0x5d0635(_0x5e69c2[_0x9ae7('0x15')](0x1f4,_0x356559[_0x9ae7('0x17')]));});});};
\ No newline at end of file
+var _0x9567=['../../config/utils','../../config/logger','../../config/environment','client','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateAttachment','create','options','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x4bbb84,_0x32d824){var _0x279ef5=function(_0x52f376){while(--_0x52f376){_0x4bbb84['push'](_0x4bbb84['shift']());}};_0x279ef5(++_0x32d824);}(_0x9567,0xdc));var _0x7956=function(_0x39cf69,_0x1ddc96){_0x39cf69=_0x39cf69-0x0;var _0x4c0fa6=_0x9567[_0x39cf69];return _0x4c0fa6;};'use strict';var _=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var moment=require(_0x7956('0x2'));var BPromise=require(_0x7956('0x3'));var rs=require(_0x7956('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7956('0x5'));var logger=require(_0x7956('0x6'))('rpc');var config=require(_0x7956('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7956('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1819b6,_0x31b50d,_0x48b2b3){return new BPromise(function(_0x3c213a,_0x50038a){return client[_0x7956('0x9')](_0x1819b6,_0x48b2b3)[_0x7956('0xa')](function(_0x53310c){logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,'request\x20sent');logger[_0x7956('0xd')](_0x7956('0xe'),_0x31b50d,_0x7956('0xf'),JSON['stringify'](_0x53310c));if(_0x53310c[_0x7956('0x10')]){if(_0x53310c[_0x7956('0x10')][_0x7956('0x11')]===0x1f4){logger[_0x7956('0x10')]('Attachment,\x20%s,\x20%s',_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x50038a(_0x53310c[_0x7956('0x10')]['message']);}logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x3c213a(_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);}else{logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,_0x7956('0xf'));_0x3c213a(_0x53310c[_0x7956('0x13')][_0x7956('0x12')]);}})[_0x7956('0x14')](function(_0x18ae51){logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x18ae51);_0x50038a(_0x18ae51);});});}exports[_0x7956('0x15')]=function(_0x5e6b90){var _0x5c3afb=this;return new Promise(function(_0x10b29c,_0x811122){return db['Attachment'][_0x7956('0x16')](_0x5e6b90['body'],{'raw':_0x5e6b90[_0x7956('0x17')]?_0x5e6b90[_0x7956('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x7956('0xa')](function(_0x2e31cd){logger[_0x7956('0xb')]('CreateAttachment',_0x5e6b90);logger[_0x7956('0xd')]('CreateAttachment',_0x5e6b90,JSON[_0x7956('0x18')](_0x2e31cd));_0x10b29c(_0x2e31cd);})['catch'](function(_0x427500){logger[_0x7956('0x10')](_0x7956('0x15'),_0x427500[_0x7956('0x12')],_0x5e6b90);_0x811122(_0x5c3afb['error'](0x1f4,_0x427500[_0x7956('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 8122923..e172257 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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x379b3d,_0xb565a7){var _0x5ae947=function(_0x31311b){while(--_0x31311b){_0x379b3d['push'](_0x379b3d['shift']());}};_0x5ae947(++_0xb565a7);}(_0x2032,0xd9));var _0x2203=function(_0x38bd5a,_0x526d00){_0x38bd5a=_0x38bd5a-0x0;var _0x3089a5=_0x2032[_0x38bd5a];return _0x3089a5;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3fe968,_0x4737f0){var _0x5241b5=function(_0x5b34c7){while(--_0x5b34c7){_0x3fe968['push'](_0x3fe968['shift']());}};_0x5241b5(++_0x4737f0);}(_0x2032,0xd9));var _0x2203=function(_0x5bcece,_0x3c0214){_0x5bcece=_0x5bcece-0x0;var _0x1092a2=_0x2032[_0x5bcece];return _0x1092a2;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 2964315..7758574 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xca15=['password','salt','role','disabled','blocked','blockedAt','online','agent','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','undefined','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name'];(function(_0x1bd027,_0x565a42){var _0x193de7=function(_0x4af495){while(--_0x4af495){_0x1bd027['push'](_0x1bd027['shift']());}};_0x193de7(++_0x565a42);}(_0xca15,0x83));var _0x5ca1=function(_0x7f6bc8,_0x98c3bf){_0x7f6bc8=_0x7f6bc8-0x0;var _0xb899c7=_0xca15[_0x7f6bc8];return _0xb899c7;};'use strict';var passport=require(_0x5ca1('0x0'));var LocalStrategy=require(_0x5ca1('0x1'))['Strategy'];var moment=require(_0x5ca1('0x2'));var ActiveDirectory=require(_0x5ca1('0x3'));var BPromise=require(_0x5ca1('0x4'));var util=require(_0x5ca1('0x5'));var db=require(_0x5ca1('0x6'))['db'];var authService=require(_0x5ca1('0x7'));var utils=require(_0x5ca1('0x8'));var config=require(_0x5ca1('0x9'));var logger=require(_0x5ca1('0xa'))(_0x5ca1('0xb'));function isActiveDirectoryConfigured(_0x265bc4){var _0x34d3d3=![];if(typeof _0x265bc4['activedirectory']!==_0x5ca1('0xc')){_0x34d3d3=_0x265bc4[_0x5ca1('0xd')][_0x5ca1('0xe')]&&_0x265bc4['activedirectory'][_0x5ca1('0xf')]&&_0x265bc4[_0x5ca1('0xd')][_0x5ca1('0x10')];}return _0x34d3d3;}function adAuthenticate(_0x5a2b42,_0x430be1,_0x51dcd0){return new BPromise(function(_0x47692a,_0x5cdb1d){try{var _0x5d0bd2=new ActiveDirectory(_0x5a2b42);_0x5d0bd2[_0x5ca1('0x11')](_0x430be1,_0x51dcd0,function(_0x3ab58,_0x257315){if(_0x3ab58){logger[_0x5ca1('0x12')](_0x5ca1('0x13'),_0x430be1,util[_0x5ca1('0x14')](_0x3ab58,{'showHidden':![],'depth':null}));_0x5cdb1d(_0x5ca1('0x15'));}else if(!_0x257315){logger[_0x5ca1('0x12')](_0x5ca1('0x16'),_0x430be1);_0x5cdb1d('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x47692a(_0x257315);}});}catch(_0x41ad97){_0x5cdb1d(_0x41ad97);}});}function ActiveDirectoryAuthenticate(_0x4bb32d,_0x2bf279,_0x1cfb4e,_0x4c8944){var _0x281acd,_0x16019f;if(!isActiveDirectoryConfigured(config)){logger[_0x5ca1('0x12')](_0x5ca1('0x17'),_0x2bf279);return _0x4c8944(null,![],{'message':_0x5ca1('0x15')});}return db[_0x5ca1('0x18')][_0x5ca1('0x19')]({'where':{'id':0x1},'attributes':[_0x5ca1('0x1a'),_0x5ca1('0x1b')],'raw':!![]})[_0x5ca1('0x1c')](function(_0x19b69a){_0x281acd=_0x19b69a;if(!_0x281acd[_0x5ca1('0x1a')]){logger[_0x5ca1('0x12')](_0x5ca1('0x1d'),_0x2bf279);throw new Error(_0x5ca1('0x15'));}return _0x4bb32d['findOne']({'attributes':['id',_0x5ca1('0x1e'),_0x5ca1('0x1f'),_0x5ca1('0x20'),_0x5ca1('0x21'),_0x5ca1('0x22'),_0x5ca1('0x23'),_0x5ca1('0x24'),_0x5ca1('0x25')],'where':{'name':_0x2bf279,'role':{'$or':['admin','user',_0x5ca1('0x26')]},'adSsoEnabled':!![]}});})['then'](function(_0x266de9){if(!_0x266de9||_0x266de9&&_0x266de9['name']!==_0x2bf279){throw new Error(_0x5ca1('0x15'));}_0x16019f=_0x266de9;var _0x3ac510=_0x16019f[_0x5ca1('0x1e')]+'@'+config['activedirectory'][_0x5ca1('0x10')];return adAuthenticate(config[_0x5ca1('0xd')],_0x3ac510,_0x1cfb4e);})['then'](function(_0x59252f){if(_0x16019f[_0x5ca1('0x22')]){throw new Error(_0x5ca1('0x15'));}if(_0x281acd[_0x5ca1('0x1b')]>0x0){if(_0x16019f[_0x5ca1('0x23')]){if(moment(_0x16019f[_0x5ca1('0x24')])[_0x5ca1('0x27')](_0x281acd[_0x5ca1('0x1b')],_0x5ca1('0x28'))>moment()){throw new Error(_0x5ca1('0x15'));}return utils[_0x5ca1('0x29')](_0x16019f,0x0,![],null)[_0x5ca1('0x1c')](function(){return utils[_0x5ca1('0x2a')](_0x16019f);})[_0x5ca1('0x1c')](function(){return _0x4c8944(null,_0x16019f);});}else{return utils[_0x5ca1('0x2a')](_0x16019f)[_0x5ca1('0x1c')](function(){return _0x4c8944(null,_0x16019f);});}}else{return utils['getLicense'](_0x16019f)[_0x5ca1('0x1c')](function(){return _0x4c8944(null,_0x16019f);});}})[_0x5ca1('0x2b')](function(_0x456aa8){return _0x4c8944(null,![],_0x456aa8);});}function handleError(_0x39939d,_0x4c1926,_0x595527){return _0x39939d[_0x5ca1('0x2c')](_0x4c1926||0x1f4)[_0x5ca1('0x2d')]({'message':_0x595527?_0x595527[_0x5ca1('0x2e')]||_0x595527:''});}exports[_0x5ca1('0x2f')]=function(_0x465921,_0x7add6c,_0x3e82f3){passport[_0x5ca1('0x11')](_0x5ca1('0x30'),function(_0x12fb2d,_0x2c8c0c,_0x360f1d){var _0x51adf5=_0x12fb2d||_0x360f1d;if(_0x51adf5){return handleError(_0x7add6c,0x191,_0x51adf5);}if(!_0x2c8c0c){return handleError(_0x7add6c,0x194,{'message':_0x5ca1('0x31')});}else{var _0x212691={'payload':{'id':_0x2c8c0c['id'],'role':_0x2c8c0c[_0x5ca1('0x21')]},'options':{'expiresIn':0x15180}};return authService[_0x5ca1('0x32')](_0x212691)[_0x5ca1('0x1c')](function(_0x5837c6){_0x7add6c[_0x5ca1('0x33')]({'id':_0x2c8c0c['id'],'token':_0x5837c6,'statusCall':'','isAlreadyLogged':_0x2c8c0c['online']});});}})(_0x465921,_0x7add6c,_0x3e82f3);};passport[_0x5ca1('0x34')](_0x5ca1('0x30'),new LocalStrategy({'usernameField':_0x5ca1('0x1e'),'passwordField':_0x5ca1('0x1f')},function(_0x545705,_0x2b80ec,_0x1f6f15){return ActiveDirectoryAuthenticate(db[_0x5ca1('0x35')],_0x545705,_0x2b80ec,_0x1f6f15);}));
\ No newline at end of file
+var _0x8411=['blocked','blockedAt','online','user','agent','add','minutes','clearBlockUser','getLicense','catch','status','send','message','ad-login','json','User','Strategy','moment','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled'];(function(_0x126a75,_0x30d0fc){var _0x5b3ab9=function(_0x42382c){while(--_0x42382c){_0x126a75['push'](_0x126a75['shift']());}};_0x5b3ab9(++_0x30d0fc);}(_0x8411,0x118));var _0x1841=function(_0x4cba83,_0x81e88f){_0x4cba83=_0x4cba83-0x0;var _0x4375e0=_0x8411[_0x4cba83];return _0x4375e0;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')[_0x1841('0x0')];var moment=require(_0x1841('0x1'));var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require(_0x1841('0x2'));var db=require(_0x1841('0x3'))['db'];var authService=require(_0x1841('0x4'));var utils=require(_0x1841('0x5'));var config=require(_0x1841('0x6'));var logger=require('../../config/logger')(_0x1841('0x7'));function isActiveDirectoryConfigured(_0x54a581){var _0x4224eb=![];if(typeof _0x54a581[_0x1841('0x8')]!==_0x1841('0x9')){_0x4224eb=_0x54a581[_0x1841('0x8')][_0x1841('0xa')]&&_0x54a581[_0x1841('0x8')][_0x1841('0xb')]&&_0x54a581[_0x1841('0x8')][_0x1841('0xc')];}return _0x4224eb;}function adAuthenticate(_0x4218ae,_0x108644,_0x1ae8b8){return new BPromise(function(_0x1a3293,_0x19422d){try{var _0x2d7810=new ActiveDirectory(_0x4218ae);_0x2d7810[_0x1841('0xd')](_0x108644,_0x1ae8b8,function(_0x16570d,_0x293ca7){if(_0x16570d){logger[_0x1841('0xe')]('Error\x20authenticate\x20%s:\x20%s',_0x108644,util[_0x1841('0xf')](_0x16570d,{'showHidden':![],'depth':null}));_0x19422d(_0x1841('0x10'));}else if(!_0x293ca7){logger[_0x1841('0xe')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x108644);_0x19422d('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1a3293(_0x293ca7);}});}catch(_0x415393){_0x19422d(_0x415393);}});}function ActiveDirectoryAuthenticate(_0x443172,_0x4c9df4,_0x101dfd,_0x9dc9c8){var _0x3e7e22,_0x287c5e;if(!isActiveDirectoryConfigured(config)){logger[_0x1841('0xe')](_0x1841('0x11'),_0x4c9df4);return _0x9dc9c8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x1841('0x12')][_0x1841('0x13')]({'where':{'id':0x1},'attributes':[_0x1841('0x14'),_0x1841('0x15')],'raw':!![]})[_0x1841('0x16')](function(_0x16917f){_0x3e7e22=_0x16917f;if(!_0x3e7e22[_0x1841('0x14')]){logger[_0x1841('0xe')](_0x1841('0x17'),_0x4c9df4);throw new Error(_0x1841('0x10'));}return _0x443172[_0x1841('0x13')]({'attributes':['id',_0x1841('0x18'),_0x1841('0x19'),_0x1841('0x1a'),'role',_0x1841('0x1b'),_0x1841('0x1c'),_0x1841('0x1d'),_0x1841('0x1e')],'where':{'name':_0x4c9df4,'role':{'$or':['admin',_0x1841('0x1f'),_0x1841('0x20')]},'adSsoEnabled':!![]}});})[_0x1841('0x16')](function(_0x1ed975){if(!_0x1ed975||_0x1ed975&&_0x1ed975[_0x1841('0x18')]!==_0x4c9df4){throw new Error(_0x1841('0x10'));}_0x287c5e=_0x1ed975;var _0x28a0d2=_0x287c5e[_0x1841('0x18')]+'@'+config[_0x1841('0x8')][_0x1841('0xc')];return adAuthenticate(config[_0x1841('0x8')],_0x28a0d2,_0x101dfd);})[_0x1841('0x16')](function(_0x60ab64){if(_0x287c5e['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x3e7e22[_0x1841('0x15')]>0x0){if(_0x287c5e['blocked']){if(moment(_0x287c5e[_0x1841('0x1d')])[_0x1841('0x21')](_0x3e7e22[_0x1841('0x15')],_0x1841('0x22'))>moment()){throw new Error(_0x1841('0x10'));}return utils[_0x1841('0x23')](_0x287c5e,0x0,![],null)[_0x1841('0x16')](function(){return utils[_0x1841('0x24')](_0x287c5e);})[_0x1841('0x16')](function(){return _0x9dc9c8(null,_0x287c5e);});}else{return utils[_0x1841('0x24')](_0x287c5e)['then'](function(){return _0x9dc9c8(null,_0x287c5e);});}}else{return utils['getLicense'](_0x287c5e)[_0x1841('0x16')](function(){return _0x9dc9c8(null,_0x287c5e);});}})[_0x1841('0x25')](function(_0x4eddde){return _0x9dc9c8(null,![],_0x4eddde);});}function handleError(_0x1f0985,_0x302824,_0x336e60){return _0x1f0985[_0x1841('0x26')](_0x302824||0x1f4)[_0x1841('0x27')]({'message':_0x336e60?_0x336e60[_0x1841('0x28')]||_0x336e60:''});}exports['login']=function(_0x2056cb,_0x3c952c,_0x34aaf2){passport[_0x1841('0xd')](_0x1841('0x29'),function(_0x10e12e,_0x5d3242,_0x371856){var _0x37cc52=_0x10e12e||_0x371856;if(_0x37cc52){return handleError(_0x3c952c,0x191,_0x37cc52);}if(!_0x5d3242){return handleError(_0x3c952c,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x296269={'payload':{'id':_0x5d3242['id'],'role':_0x5d3242['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x296269)[_0x1841('0x16')](function(_0x11d8ee){_0x3c952c[_0x1841('0x2a')]({'id':_0x5d3242['id'],'token':_0x11d8ee,'statusCall':'','isAlreadyLogged':_0x5d3242[_0x1841('0x1e')]});});}})(_0x2056cb,_0x3c952c,_0x34aaf2);};passport['use'](_0x1841('0x29'),new LocalStrategy({'usernameField':_0x1841('0x18'),'passwordField':_0x1841('0x19')},function(_0x59b4dd,_0x423a99,_0x1e3261){return ActiveDirectoryAuthenticate(db[_0x1841('0x2b')],_0x59b4dd,_0x423a99,_0x1e3261);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 268e594..42055ad 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x41ef=['exports','express','./authActiveDirectory.controller','post','login'];(function(_0x3a852f,_0x28fa07){var _0x3f40a5=function(_0x57c7e8){while(--_0x57c7e8){_0x3a852f['push'](_0x3a852f['shift']());}};_0x3f40a5(++_0x28fa07);}(_0x41ef,0x1eb));var _0xf41e=function(_0x1e4598,_0x1ba223){_0x1e4598=_0x1e4598-0x0;var _0x53b3ee=_0x41ef[_0x1e4598];return _0x53b3ee;};'use strict';var express=require(_0xf41e('0x0'));var router=express['Router']();var controller=require(_0xf41e('0x1'));router[_0xf41e('0x2')]('/',controller[_0xf41e('0x3')]);module[_0xf41e('0x4')]=router;
\ No newline at end of file
+var _0xa08c=['login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x20f38a,_0x6dd961){var _0x2ccf9f=function(_0x586553){while(--_0x586553){_0x20f38a['push'](_0x20f38a['shift']());}};_0x2ccf9f(++_0x6dd961);}(_0xa08c,0x133));var _0xca08=function(_0x276c4f,_0x55eee3){_0x276c4f=_0x276c4f-0x0;var _0x551485=_0xa08c[_0x276c4f];return _0x551485;};'use strict';var express=require(_0xca08('0x0'));var router=express[_0xca08('0x1')]();var controller=require(_0xca08('0x2'));router['post']('/',controller[_0xca08('0x3')]);module[_0xca08('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 66eb18c..e41478d 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x1089d4,_0x382a95){var _0xd170aa=function(_0x349cb3){while(--_0x349cb3){_0x1089d4['push'](_0x1089d4['shift']());}};_0xd170aa(++_0x382a95);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x7a54,0x106));var _0x47a5=function(_0x4a763a,_0x4350e2){_0x4a763a=_0x4a763a-0x0;var _0xaf1e01=_0x7a54[_0x4a763a];return _0xaf1e01;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 20595ee..0f09ae1 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 _0x7119=['login','callback','isMiddleware','setTokenCookie','exports','passport','./authGoogle.controller','../../components/auth/service','get'];(function(_0x579751,_0x4b96a2){var _0x1d00ba=function(_0x24cefc){while(--_0x24cefc){_0x579751['push'](_0x579751['shift']());}};_0x1d00ba(++_0x4b96a2);}(_0x7119,0x1c7));var _0x9711=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0x7119[_0x57d13b];return _0x467696;};'use strict';var express=require('express');var passport=require(_0x9711('0x0'));var router=express['Router']();var controller=require(_0x9711('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0x9711('0x2'));router[_0x9711('0x3')]('/',controller[_0x9711('0x4')]);router[_0x9711('0x3')]('/callback',controller[_0x9711('0x5')],authService[_0x9711('0x6')],userController[_0x9711('0x4')],authService[_0x9711('0x7')]);module[_0x9711('0x8')]=router;
\ No newline at end of file
+var _0x9f13=['../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','exports','express','passport','Router','./authGoogle.controller'];(function(_0xe15270,_0x227d06){var _0x1e813b=function(_0x1d590d){while(--_0x1d590d){_0xe15270['push'](_0xe15270['shift']());}};_0x1e813b(++_0x227d06);}(_0x9f13,0x1f4));var _0x39f1=function(_0x40fa64,_0xb797a4){_0x40fa64=_0x40fa64-0x0;var _0x272ab0=_0x9f13[_0x40fa64];return _0x272ab0;};'use strict';var express=require(_0x39f1('0x0'));var passport=require(_0x39f1('0x1'));var router=express[_0x39f1('0x2')]();var controller=require(_0x39f1('0x3'));var userController=require(_0x39f1('0x4'));var authService=require(_0x39f1('0x5'));router[_0x39f1('0x6')]('/',controller['login']);router[_0x39f1('0x6')](_0x39f1('0x7'),controller[_0x39f1('0x8')],authService[_0x39f1('0x9')],userController[_0x39f1('0xa')],authService['setTokenCookie']);module[_0x39f1('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index ad96a07..c0293dc 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 _0x75ad=['minutes','clearBlockUser','getLicense','catch','MailAccount','find','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','use','User','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','blockDuration','name','password','salt','role','disabled','blocked','admin','user','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','allowedLoginAttempts','blockedAt'];(function(_0x5c7a85,_0x41dd19){var _0x35290f=function(_0x26215b){while(--_0x26215b){_0x5c7a85['push'](_0x5c7a85['shift']());}};_0x35290f(++_0x41dd19);}(_0x75ad,0xd7));var _0xd75a=function(_0x1fe8a9,_0x374e5e){_0x1fe8a9=_0x1fe8a9-0x0;var _0x507e1c=_0x75ad[_0x1fe8a9];return _0x507e1c;};'use strict';var util=require(_0xd75a('0x0'));var passport=require(_0xd75a('0x1'));var LocalStrategy=require(_0xd75a('0x2'))[_0xd75a('0x3')];var jayson=require(_0xd75a('0x4'));var _=require(_0xd75a('0x5'));var rs=require('randomstring');var moment=require(_0xd75a('0x6'));var db=require(_0xd75a('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xd75a('0x8'));var client=jayson[_0xd75a('0x9')][_0xd75a('0xa')]({'port':0x232b});function localAuthenticate(_0x2d2ff4,_0x5c8ef9,_0x40ee1f,_0x396cd1){var _0x4c7bbe,_0x12a0de;return db[_0xd75a('0xb')][_0xd75a('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xd75a('0xd')],'raw':!![]})['then'](function(_0x593d01){_0x4c7bbe=_0x593d01;return _0x2d2ff4[_0xd75a('0xc')]({'attributes':['id',_0xd75a('0xe'),_0xd75a('0xf'),_0xd75a('0x10'),_0xd75a('0x11'),_0xd75a('0x12'),_0xd75a('0x13'),'blockedAt','loginAttempts'],'where':{'name':_0x5c8ef9,'role':{'$or':[_0xd75a('0x14'),_0xd75a('0x15'),'agent']}}});})[_0xd75a('0x16')](function(_0x28346e){if(!_0x28346e||_0x28346e&&_0x28346e[_0xd75a('0xe')]!==_0x5c8ef9){throw new Error(_0xd75a('0x17'));}else{_0x12a0de=_0x28346e;return _0x12a0de;}})[_0xd75a('0x16')](function(){_0x12a0de[_0xd75a('0x18')](_0x40ee1f,function(_0x431be2,_0x3f7b43){var _0x3b26fc=_0x12a0de[_0xd75a('0x19')]+0x1;if(_0x431be2){return _0x396cd1(_0x431be2);}else if(!_0x3f7b43){if(_0x12a0de[_0xd75a('0x12')]){return _0x396cd1(null,![],{'message':_0xd75a('0x17')});}else if(_0x4c7bbe[_0xd75a('0x1a')]>0x0){if(_0x12a0de['blocked']){if(_0x4c7bbe[_0xd75a('0xd')]>0x0){if(moment(_0x12a0de[_0xd75a('0x1b')])['add'](_0x4c7bbe['blockDuration'],_0xd75a('0x1c'))>moment()){return _0x396cd1(null,![],{'message':_0xd75a('0x17')});}else{return utils[_0xd75a('0x1d')](_0x12a0de,_0x3b26fc,![],null)['then'](function(){return _0x396cd1(null,![],{'message':_0xd75a('0x17')});});}}else{return _0x396cd1(null,![],{'message':_0xd75a('0x17')});}}else{if(_0x3b26fc>=_0x4c7bbe[_0xd75a('0x1a')]){return utils['clearBlockUser'](_0x12a0de,0x0,!![],moment())[_0xd75a('0x16')](function(){return _0x396cd1(null,![],{'message':_0xd75a('0x17')});});}else{return utils[_0xd75a('0x1d')](_0x12a0de,_0x3b26fc,![],null)[_0xd75a('0x16')](function(){return _0x396cd1(null,![],{'message':_0xd75a('0x17')});});}}}else{return _0x396cd1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x12a0de[_0xd75a('0x12')]){return _0x396cd1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4c7bbe['allowedLoginAttempts']>0x0){if(_0x12a0de[_0xd75a('0x13')]){if(_0x4c7bbe[_0xd75a('0xd')]>0x0){if(moment(_0x12a0de[_0xd75a('0x1b')])['add'](_0x4c7bbe[_0xd75a('0xd')],'minutes')>moment()){return _0x396cd1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xd75a('0x1d')](_0x12a0de,0x0,![],null)['then'](function(){return utils[_0xd75a('0x1e')](_0x12a0de);})['then'](function(){return _0x396cd1(null,_0x12a0de);});}}else{return _0x396cd1(null,![],{'message':_0xd75a('0x17')});}}else{return utils[_0xd75a('0x1d')](_0x12a0de,0x0,![],null)['then'](function(){return utils[_0xd75a('0x1e')](_0x12a0de);})[_0xd75a('0x16')](function(){return _0x396cd1(null,_0x12a0de);})[_0xd75a('0x1f')](function(_0x2a21aa){return _0x396cd1(null,![],_0x2a21aa);});}}else{if(_0x12a0de[_0xd75a('0x13')]){return _0x396cd1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x12a0de)[_0xd75a('0x16')](function(){return _0x396cd1(null,_0x12a0de);});}}}});})[_0xd75a('0x1f')](function(_0x186a10){return _0x396cd1(null,![],_0x186a10);});}function sendServiceMail(_0x1de00b){return db[_0xd75a('0x20')][_0xd75a('0x21')]({'where':{'service':!![]},'attributes':['id',_0xd75a('0xe'),'email'],'include':[{'model':db[_0xd75a('0x22')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})['then'](function(_0x4473e2){if(!_0x4473e2){throw new Error(_0xd75a('0x23'));}var _0x68ebe7=_0x4473e2[_0xd75a('0x24')]();var _0x39754e={'account':_0x68ebe7,'message':_['merge']({'from':util[_0xd75a('0x25')](_0xd75a('0x26'),_0x4473e2[_0xd75a('0xe')],_0x4473e2[_0xd75a('0x27')]||_0x4473e2['Smtp'][_0xd75a('0x15')])},_0x1de00b)};return client[_0xd75a('0x28')](_0xd75a('0x29'),_0x39754e);})[_0xd75a('0x16')](function(_0x110fa5){if(_0x110fa5[_0xd75a('0x2a')]){throw new Error(util[_0xd75a('0x25')](_0xd75a('0x2b'),_0x110fa5[_0xd75a('0x2a')][_0xd75a('0x2c')]||JSON[_0xd75a('0x2d')](_0x110fa5[_0xd75a('0x2a')])));}return!![];});}function handleError(_0x3517a1,_0xb031e9,_0x4b41fa){return _0x3517a1[_0xd75a('0x2e')](_0xb031e9||0x1f4)[_0xd75a('0x2f')]({'message':_0x4b41fa?_0x4b41fa['message']||_0x4b41fa:''});}exports['login']=function(_0x3c15f9,_0x141867,_0x194942){passport['authenticate'](_0xd75a('0x30'),function(_0x4590c4,_0x19f744,_0x2f1b98){var _0xa99280=_0x4590c4||_0x2f1b98;if(_0xa99280){return handleError(_0x141867,0x191,_0xa99280);}if(!_0x19f744){return handleError(_0x141867,0x194,{'message':_0xd75a('0x31')});}else{var _0x184f91={'payload':{'id':_0x19f744['id'],'role':_0x19f744[_0xd75a('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xd75a('0x32')](_0x184f91)[_0xd75a('0x16')](function(_0x35fdfd){_0x141867[_0xd75a('0x33')]({'id':_0x19f744['id'],'token':_0x35fdfd,'statusCall':'','isAlreadyLogged':_0x19f744[_0xd75a('0x34')]});});}})(_0x3c15f9,_0x141867,_0x194942);};exports[_0xd75a('0x35')]=function(_0x1b0703,_0x47d75e){if(!_0x1b0703[_0xd75a('0x36')][_0xd75a('0x27')]){return handleError(_0x47d75e,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x460377=rs[_0xd75a('0x37')]();_0x1b0703[_0xd75a('0x36')]['email']=_0x1b0703[_0xd75a('0x36')][_0xd75a('0x27')][_0xd75a('0x38')]()[_0xd75a('0x39')]();var _0x2f90a7;return db[_0xd75a('0xb')][_0xd75a('0xc')]({'where':{'id':0x1},'attributes':[_0xd75a('0x1a'),'blockDuration'],'raw':!![]})[_0xd75a('0x16')](function(_0x5f5c5d){_0x2f90a7=_0x5f5c5d;return db['User'][_0xd75a('0x21')]({'where':{'email':_0x1b0703[_0xd75a('0x36')][_0xd75a('0x27')]}});})[_0xd75a('0x16')](function(_0xbe68f5){if(!_0xbe68f5){throw new Error(_0xd75a('0x3a'));}if(_0xbe68f5[_0xd75a('0x12')]){throw new Error(_0xd75a('0x3b'));}if(_0xbe68f5[_0xd75a('0x13')]){if(moment(_0xbe68f5[_0xd75a('0x1b')])[_0xd75a('0x3c')](_0x2f90a7[_0xd75a('0xd')],_0xd75a('0x1c'))>moment()){throw new Error(_0xd75a('0x3d'));}else{_0xbe68f5['blocked']=![];_0xbe68f5[_0xd75a('0x1b')]=null;}}_0xbe68f5[_0xd75a('0x3e')]=_0x460377;_0xbe68f5[_0xd75a('0x3f')]=Date[_0xd75a('0x40')]()+0x36ee80;return _0xbe68f5[_0xd75a('0x41')]();})[_0xd75a('0x16')](function(){return sendServiceMail({'to':_0x1b0703[_0xd75a('0x36')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xd75a('0x42')+_0xd75a('0x43')+_0xd75a('0x44')+_0x1b0703[_0xd75a('0x45')]['host']+'/reset/'+_0x460377+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xd75a('0x16')](function(){_0x47d75e[_0xd75a('0x2e')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0xd75a('0x1f')](function(_0x44c4fb){return handleError(_0x47d75e,0x1f4,_0x44c4fb);});};exports[_0xd75a('0x46')]=function(_0x5307a5,_0x5d126e){return db['User'][_0xd75a('0x21')]({'where':{'resetPasswordToken':_0x5307a5[_0xd75a('0x47')][_0xd75a('0x48')],'resetPasswordExpires':{'$gt':Date[_0xd75a('0x40')]()}}})['then'](function(_0xf8be1a){if(!_0xf8be1a){throw new Error(_0xd75a('0x49'));}return db[_0xd75a('0xb')]['findOne']({'attributes':['id',_0xd75a('0x4a'),'enforcePasswordHistory',_0xd75a('0x4b')]})[_0xd75a('0x16')](function(_0xf97f3d){if(_0xf97f3d[_0xd75a('0x4a')])authService['validatePasswordPattern'](_0x5307a5[_0xd75a('0x36')][_0xd75a('0xf')]);if(!_0xf97f3d['enforcePasswordHistory']||!_0xf8be1a[_0xd75a('0x4c')])return _0xf8be1a;authService[_0xd75a('0x4d')](_0x5307a5['body'][_0xd75a('0xf')],_0xf8be1a[_0xd75a('0x4c')],_0xf97f3d[_0xd75a('0x4b')]);return _0xf8be1a;})[_0xd75a('0x16')](function(){_0xf8be1a[_0xd75a('0xf')]=_0x5307a5[_0xd75a('0x36')][_0xd75a('0xf')];_0xf8be1a[_0xd75a('0x3e')]=null;_0xf8be1a[_0xd75a('0x3f')]=null;return _0xf8be1a['save']();});})[_0xd75a('0x16')](function(){_0x5d126e[_0xd75a('0x2e')](0xc8)[_0xd75a('0x2f')]({'message':_0xd75a('0x4e')});})[_0xd75a('0x1f')](function(_0x3e9ea0){return handleError(_0x5d126e,0x1f4,_0x3e9ea0);});};passport[_0xd75a('0x4f')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0xd75a('0xf')},function(_0x4e9f22,_0x1797db,_0x3253f4){return localAuthenticate(db[_0xd75a('0x50')],_0x4e9f22,_0x1797db,_0x3253f4);}));
\ No newline at end of file
+var _0x915c=['Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','role','disabled','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','blockDuration','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','user','request','SendMail','error','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\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://','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0x915c,0xb7));var _0xc915=function(_0x36b8f4,_0x15f119){_0x36b8f4=_0x36b8f4-0x0;var _0x287feb=_0x915c[_0x36b8f4];return _0x287feb;};'use strict';var util=require(_0xc915('0x0'));var passport=require(_0xc915('0x1'));var LocalStrategy=require(_0xc915('0x2'))[_0xc915('0x3')];var jayson=require(_0xc915('0x4'));var _=require(_0xc915('0x5'));var rs=require(_0xc915('0x6'));var moment=require(_0xc915('0x7'));var db=require(_0xc915('0x8'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xc915('0x9'));var client=jayson[_0xc915('0xa')][_0xc915('0xb')]({'port':0x232b});function localAuthenticate(_0x4510d3,_0x1da764,_0x74763d,_0x57c617){var _0x20a704,_0x58dafa;return db[_0xc915('0xc')][_0xc915('0xd')]({'where':{'id':0x1},'attributes':[_0xc915('0xe'),'blockDuration'],'raw':!![]})[_0xc915('0xf')](function(_0x315184){_0x20a704=_0x315184;return _0x4510d3['findOne']({'attributes':['id',_0xc915('0x10'),_0xc915('0x11'),'salt',_0xc915('0x12'),_0xc915('0x13'),'blocked',_0xc915('0x14'),_0xc915('0x15')],'where':{'name':_0x1da764,'role':{'$or':[_0xc915('0x16'),'user',_0xc915('0x17')]}}});})[_0xc915('0xf')](function(_0x47906f){if(!_0x47906f||_0x47906f&&_0x47906f[_0xc915('0x10')]!==_0x1da764){throw new Error(_0xc915('0x18'));}else{_0x58dafa=_0x47906f;return _0x58dafa;}})[_0xc915('0xf')](function(){_0x58dafa['authenticate'](_0x74763d,function(_0x90f29c,_0x20546d){var _0x15ddf3=_0x58dafa[_0xc915('0x15')]+0x1;if(_0x90f29c){return _0x57c617(_0x90f29c);}else if(!_0x20546d){if(_0x58dafa[_0xc915('0x13')]){return _0x57c617(null,![],{'message':_0xc915('0x18')});}else if(_0x20a704[_0xc915('0xe')]>0x0){if(_0x58dafa[_0xc915('0x19')]){if(_0x20a704['blockDuration']>0x0){if(moment(_0x58dafa['blockedAt'])[_0xc915('0x1a')](_0x20a704[_0xc915('0x1b')],'minutes')>moment()){return _0x57c617(null,![],{'message':_0xc915('0x18')});}else{return utils['clearBlockUser'](_0x58dafa,_0x15ddf3,![],null)[_0xc915('0xf')](function(){return _0x57c617(null,![],{'message':_0xc915('0x18')});});}}else{return _0x57c617(null,![],{'message':_0xc915('0x18')});}}else{if(_0x15ddf3>=_0x20a704[_0xc915('0xe')]){return utils[_0xc915('0x1c')](_0x58dafa,0x0,!![],moment())[_0xc915('0xf')](function(){return _0x57c617(null,![],{'message':_0xc915('0x18')});});}else{return utils['clearBlockUser'](_0x58dafa,_0x15ddf3,![],null)[_0xc915('0xf')](function(){return _0x57c617(null,![],{'message':_0xc915('0x18')});});}}}else{return _0x57c617(null,![],{'message':_0xc915('0x18')});}}else{if(_0x58dafa[_0xc915('0x13')]){return _0x57c617(null,![],{'message':_0xc915('0x18')});}else if(_0x20a704[_0xc915('0xe')]>0x0){if(_0x58dafa[_0xc915('0x19')]){if(_0x20a704[_0xc915('0x1b')]>0x0){if(moment(_0x58dafa[_0xc915('0x14')])[_0xc915('0x1a')](_0x20a704['blockDuration'],_0xc915('0x1d'))>moment()){return _0x57c617(null,![],{'message':_0xc915('0x18')});}else{return utils['clearBlockUser'](_0x58dafa,0x0,![],null)[_0xc915('0xf')](function(){return utils[_0xc915('0x1e')](_0x58dafa);})['then'](function(){return _0x57c617(null,_0x58dafa);});}}else{return _0x57c617(null,![],{'message':_0xc915('0x18')});}}else{return utils['clearBlockUser'](_0x58dafa,0x0,![],null)[_0xc915('0xf')](function(){return utils[_0xc915('0x1e')](_0x58dafa);})[_0xc915('0xf')](function(){return _0x57c617(null,_0x58dafa);})[_0xc915('0x1f')](function(_0x32fa29){return _0x57c617(null,![],_0x32fa29);});}}else{if(_0x58dafa['blocked']){return _0x57c617(null,![],{'message':_0xc915('0x18')});}else{return utils[_0xc915('0x1e')](_0x58dafa)[_0xc915('0xf')](function(){return _0x57c617(null,_0x58dafa);});}}}});})['catch'](function(_0xf26dcc){return _0x57c617(null,![],_0xf26dcc);});}function sendServiceMail(_0x1470f2){return db[_0xc915('0x20')][_0xc915('0x21')]({'where':{'service':!![]},'attributes':['id',_0xc915('0x10'),_0xc915('0x22')],'include':[{'model':db[_0xc915('0x23')],'as':_0xc915('0x24'),'include':[{'model':db[_0xc915('0x25')],'as':_0xc915('0x25')}]}]})['then'](function(_0x30eb4d){if(!_0x30eb4d){throw new Error(_0xc915('0x26'));}var _0x37fe04=_0x30eb4d[_0xc915('0x27')]();var _0x118511={'account':_0x37fe04,'message':_[_0xc915('0x28')]({'from':util[_0xc915('0x29')]('\x22%s\x22\x20<%s>',_0x30eb4d[_0xc915('0x10')],_0x30eb4d[_0xc915('0x22')]||_0x30eb4d[_0xc915('0x24')][_0xc915('0x2a')])},_0x1470f2)};return client[_0xc915('0x2b')](_0xc915('0x2c'),_0x118511);})[_0xc915('0xf')](function(_0x3d1008){if(_0x3d1008[_0xc915('0x2d')]){throw new Error(util[_0xc915('0x29')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3d1008[_0xc915('0x2d')][_0xc915('0x2e')]||JSON[_0xc915('0x2f')](_0x3d1008['error'])));}return!![];});}function handleError(_0x20710a,_0x1ddd45,_0x5548ce){return _0x20710a[_0xc915('0x30')](_0x1ddd45||0x1f4)[_0xc915('0x31')]({'message':_0x5548ce?_0x5548ce['message']||_0x5548ce:''});}exports[_0xc915('0x32')]=function(_0x186cb8,_0xb4984a,_0x2b764b){passport[_0xc915('0x33')](_0xc915('0x34'),function(_0x82696c,_0x472a37,_0x5a82dc){var _0x53b8c9=_0x82696c||_0x5a82dc;if(_0x53b8c9){return handleError(_0xb4984a,0x191,_0x53b8c9);}if(!_0x472a37){return handleError(_0xb4984a,0x194,{'message':_0xc915('0x35')});}else{var _0x19f7df={'payload':{'id':_0x472a37['id'],'role':_0x472a37[_0xc915('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0xc915('0x36')](_0x19f7df)['then'](function(_0x4f4f79){_0xb4984a['json']({'id':_0x472a37['id'],'token':_0x4f4f79,'statusCall':'','isAlreadyLogged':_0x472a37['online']});});}})(_0x186cb8,_0xb4984a,_0x2b764b);};exports[_0xc915('0x37')]=function(_0x37afb5,_0x2cbc44){if(!_0x37afb5[_0xc915('0x38')][_0xc915('0x22')]){return handleError(_0x2cbc44,0x1f4,{'message':_0xc915('0x39')});}var _0x2b376f=rs[_0xc915('0x3a')]();_0x37afb5['body'][_0xc915('0x22')]=_0x37afb5['body'][_0xc915('0x22')][_0xc915('0x3b')]()[_0xc915('0x3c')]();var _0x30a7bf;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xc915('0xe'),'blockDuration'],'raw':!![]})['then'](function(_0x2fc044){_0x30a7bf=_0x2fc044;return db[_0xc915('0x3d')][_0xc915('0x21')]({'where':{'email':_0x37afb5[_0xc915('0x38')][_0xc915('0x22')]}});})[_0xc915('0xf')](function(_0x39b027){if(!_0x39b027){throw new Error(_0xc915('0x3e'));}if(_0x39b027[_0xc915('0x13')]){throw new Error(_0xc915('0x3f'));}if(_0x39b027['blocked']){if(moment(_0x39b027['blockedAt'])[_0xc915('0x1a')](_0x30a7bf[_0xc915('0x1b')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x39b027[_0xc915('0x19')]=![];_0x39b027['blockedAt']=null;}}_0x39b027[_0xc915('0x40')]=_0x2b376f;_0x39b027[_0xc915('0x41')]=Date[_0xc915('0x42')]()+0x36ee80;return _0x39b027[_0xc915('0x43')]();})[_0xc915('0xf')](function(){return sendServiceMail({'to':_0x37afb5['body'][_0xc915('0x22')],'subject':_0xc915('0x44'),'text':_0xc915('0x45')+_0xc915('0x46')+_0xc915('0x47')+_0x37afb5['headers'][_0xc915('0x48')]+'/reset/'+_0x2b376f+'\x0a\x0a'+_0xc915('0x49')});})[_0xc915('0xf')](function(){_0x2cbc44[_0xc915('0x30')](0xc8)[_0xc915('0x31')]({'message':_0xc915('0x4a')});})['catch'](function(_0x2c882e){return handleError(_0x2cbc44,0x1f4,_0x2c882e);});};exports[_0xc915('0x4b')]=function(_0x40878e,_0x4e6a21){return db[_0xc915('0x3d')][_0xc915('0x21')]({'where':{'resetPasswordToken':_0x40878e[_0xc915('0x4c')][_0xc915('0x4d')],'resetPasswordExpires':{'$gt':Date[_0xc915('0x42')]()}}})['then'](function(_0x462a1b){if(!_0x462a1b){throw new Error(_0xc915('0x4e'));}return db['Setting'][_0xc915('0xd')]({'attributes':['id','securePassword',_0xc915('0x4f'),_0xc915('0x50')]})[_0xc915('0xf')](function(_0x441a57){if(_0x441a57[_0xc915('0x51')])authService[_0xc915('0x52')](_0x40878e['body'][_0xc915('0x11')]);if(!_0x441a57[_0xc915('0x4f')]||!_0x462a1b[_0xc915('0x53')])return _0x462a1b;authService[_0xc915('0x54')](_0x40878e['body'][_0xc915('0x11')],_0x462a1b[_0xc915('0x53')],_0x441a57[_0xc915('0x50')]);return _0x462a1b;})[_0xc915('0xf')](function(){_0x462a1b[_0xc915('0x11')]=_0x40878e[_0xc915('0x38')][_0xc915('0x11')];_0x462a1b['resetPasswordToken']=null;_0x462a1b['resetPasswordExpires']=null;return _0x462a1b[_0xc915('0x43')]();});})[_0xc915('0xf')](function(){_0x4e6a21[_0xc915('0x30')](0xc8)['send']({'message':_0xc915('0x55')});})[_0xc915('0x1f')](function(_0x107f39){return handleError(_0x4e6a21,0x1f4,_0x107f39);});};passport[_0xc915('0x56')](_0xc915('0x34'),new LocalStrategy({'usernameField':_0xc915('0x10'),'passwordField':'password'},function(_0x399b1c,_0xbed1c,_0x5ee970){return localAuthenticate(db[_0xc915('0x3d')],_0x399b1c,_0xbed1c,_0x5ee970);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 51c78e3..4707575 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 _0xc323=['exports','express','./authLocal.controller','post','login','/forgot','/reset/:token'];(function(_0x448c9a,_0x36ed05){var _0x185c40=function(_0x61fe86){while(--_0x61fe86){_0x448c9a['push'](_0x448c9a['shift']());}};_0x185c40(++_0x36ed05);}(_0xc323,0x1d6));var _0x3c32=function(_0x5d27a6,_0x5b3184){_0x5d27a6=_0x5d27a6-0x0;var _0x221530=_0xc323[_0x5d27a6];return _0x221530;};'use strict';var express=require(_0x3c32('0x0'));var router=express['Router']();var controller=require(_0x3c32('0x1'));router[_0x3c32('0x2')]('/',controller[_0x3c32('0x3')]);router['post'](_0x3c32('0x4'),controller['forgot']);router['post'](_0x3c32('0x5'),controller['reset']);module[_0x3c32('0x6')]=router;
\ No newline at end of file
+var _0x22d3=['reset','exports','Router','./authLocal.controller','post','/forgot','forgot','/reset/:token'];(function(_0x5c3e11,_0x4dd35b){var _0x4e9064=function(_0x5ae0cf){while(--_0x5ae0cf){_0x5c3e11['push'](_0x5c3e11['shift']());}};_0x4e9064(++_0x4dd35b);}(_0x22d3,0x11a));var _0x322d=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x22d3[_0x10004e];return _0x5af990;};'use strict';var express=require('express');var router=express[_0x322d('0x0')]();var controller=require(_0x322d('0x1'));router[_0x322d('0x2')]('/',controller['login']);router[_0x322d('0x2')](_0x322d('0x3'),controller[_0x322d('0x4')]);router[_0x322d('0x2')](_0x322d('0x5'),controller[_0x322d('0x6')]);module[_0x322d('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index e66c3f6..e5fd2e0 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 _0xb222=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x22d53d,_0x339808){var _0x40dd91=function(_0x1ea0a6){while(--_0x1ea0a6){_0x22d53d['push'](_0x22d53d['shift']());}};_0x40dd91(++_0x339808);}(_0xb222,0xcd));var _0x2b22=function(_0x3260fa,_0x24dbb7){_0x3260fa=_0x3260fa-0x0;var _0x120340=_0xb222[_0x3260fa];return _0x120340;};'use strict';var Sequelize=require(_0x2b22('0x0'));module[_0x2b22('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x2b22('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x2b22('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x2b22('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xd105=['exports','STRING','BOOLEAN'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0xd105,0x144));var _0x5d10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd105[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x5d10('0x0')]={'name':{'type':Sequelize[_0x5d10('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x5d10('0x1')]},'description':{'type':Sequelize[_0x5d10('0x1')]},'status':{'type':Sequelize[_0x5d10('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 a48e3c0..329e48f 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 _0x6c61=['options','Automation','includeAll','include','findAll','catch','show','params','find','body','Condition','ids','getConditions','length','pick','nolimit','addActions','Action','omit','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','send','index','map','rawAttributes','fieldName','type','model','name','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL'];(function(_0x2e5fef,_0x252152){var _0xe38c0c=function(_0x1ded16){while(--_0x1ded16){_0x2e5fef['push'](_0x2e5fef['shift']());}};_0xe38c0c(++_0x252152);}(_0x6c61,0x169));var _0x16c6=function(_0x5646ff,_0x2dc956){_0x5646ff=_0x5646ff-0x0;var _0x2d9a0e=_0x6c61[_0x5646ff];return _0x2d9a0e;};'use strict';var emlformat=require(_0x16c6('0x0'));var rimraf=require(_0x16c6('0x1'));var zipdir=require(_0x16c6('0x2'));var jsonpatch=require(_0x16c6('0x3'));var rp=require(_0x16c6('0x4'));var moment=require('moment');var BPromise=require(_0x16c6('0x5'));var Mustache=require(_0x16c6('0x6'));var util=require('util');var path=require(_0x16c6('0x7'));var sox=require(_0x16c6('0x8'));var csv=require(_0x16c6('0x9'));var ejs=require(_0x16c6('0xa'));var fs=require('fs');var fs_extra=require(_0x16c6('0xb'));var _=require(_0x16c6('0xc'));var squel=require(_0x16c6('0xd'));var crypto=require('crypto');var jsforce=require(_0x16c6('0xe'));var deskjs=require(_0x16c6('0xf'));var toCsv=require(_0x16c6('0x9'));var querystring=require(_0x16c6('0x10'));var Papa=require(_0x16c6('0x11'));var Redis=require('ioredis');var authService=require(_0x16c6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x16c6('0x13'));var hardwareService=require(_0x16c6('0x14'));var logger=require(_0x16c6('0x15'))(_0x16c6('0x16'));var utils=require(_0x16c6('0x17'));var config=require(_0x16c6('0x18'));var licenseUtil=require(_0x16c6('0x19'));var db=require(_0x16c6('0x1a'))['db'];function respondWithStatusCode(_0x5e3677,_0x2ab493){_0x2ab493=_0x2ab493||0xcc;return function(_0x4cee50){if(_0x4cee50){return _0x5e3677['sendStatus'](_0x2ab493);}return _0x5e3677[_0x16c6('0x1b')](_0x2ab493)[_0x16c6('0x1c')]();};}function respondWithResult(_0x9c697,_0x3d2766){_0x3d2766=_0x3d2766||0xc8;return function(_0x1aeb94){if(_0x1aeb94){return _0x9c697[_0x16c6('0x1b')](_0x3d2766)[_0x16c6('0x1d')](_0x1aeb94);}};}function respondWithFilteredResult(_0x2b4e6f,_0x2a110e){return function(_0x5e7d24){if(_0x5e7d24){var _0x2227af=typeof _0x2a110e[_0x16c6('0x1e')]===_0x16c6('0x1f')&&typeof _0x2a110e[_0x16c6('0x20')]===_0x16c6('0x1f');var _0x5e4885=_0x5e7d24[_0x16c6('0x21')];var _0x597c47=_0x2227af?0x0:_0x2a110e[_0x16c6('0x1e')];var _0xcc8480=_0x2227af?_0x5e7d24[_0x16c6('0x21')]:_0x2a110e['offset']+_0x2a110e[_0x16c6('0x20')];var _0x3ddcbf;if(_0xcc8480>=_0x5e4885){_0xcc8480=_0x5e4885;_0x3ddcbf=0xc8;}else{_0x3ddcbf=0xce;}_0x2b4e6f[_0x16c6('0x1b')](_0x3ddcbf);return _0x2b4e6f[_0x16c6('0x22')](_0x16c6('0x23'),_0x597c47+'-'+_0xcc8480+'/'+_0x5e4885)[_0x16c6('0x1d')](_0x5e7d24);}return null;};}function patchUpdates(_0x55b975){return function(_0x16c5c0){try{jsonpatch[_0x16c6('0x24')](_0x16c5c0,_0x55b975,!![]);}catch(_0x3387c4){return BPromise[_0x16c6('0x25')](_0x3387c4);}return _0x16c5c0[_0x16c6('0x26')]();};}function saveUpdates(_0x28d634,_0x40f53a){return function(_0x4e1f93){if(_0x4e1f93){return _0x4e1f93[_0x16c6('0x27')](_0x28d634)[_0x16c6('0x28')](function(_0x4d92ee){return _0x4d92ee;});}return null;};}function removeEntity(_0x45620c,_0x39ebd8){return function(_0xe0927f){if(_0xe0927f){return _0xe0927f[_0x16c6('0x29')]()[_0x16c6('0x28')](function(){_0x45620c[_0x16c6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32b789,_0x3b25fe){return function(_0x3a3a33){if(!_0x3a3a33){_0x32b789[_0x16c6('0x2a')](0x194);}return _0x3a3a33;};}function handleError(_0x36c2cb,_0x449b1b){_0x449b1b=_0x449b1b||0x1f4;return function(_0x4f26e8){logger['error'](_0x4f26e8['stack']);if(_0x4f26e8['name']){delete _0x4f26e8['name'];}_0x36c2cb[_0x16c6('0x1b')](_0x449b1b)[_0x16c6('0x2b')](_0x4f26e8);};}exports[_0x16c6('0x2c')]=function(_0x5c12b3,_0x24c742){var _0x28ebfb={},_0x39cffc={},_0x2ef3f7={'count':0x0,'rows':[]};var _0x16c8b8=_[_0x16c6('0x2d')](db['Automation'][_0x16c6('0x2e')],function(_0x78dfde){return{'name':_0x78dfde[_0x16c6('0x2f')],'type':_0x78dfde[_0x16c6('0x30')]['key']};});_0x39cffc[_0x16c6('0x31')]=_[_0x16c6('0x2d')](_0x16c8b8,_0x16c6('0x32'));_0x39cffc[_0x16c6('0x33')]=_[_0x16c6('0x34')](_0x5c12b3[_0x16c6('0x33')]);_0x39cffc['filters']=_['intersection'](_0x39cffc[_0x16c6('0x31')],_0x39cffc['query']);_0x28ebfb[_0x16c6('0x35')]=_[_0x16c6('0x36')](_0x39cffc['model'],qs['fields'](_0x5c12b3[_0x16c6('0x33')][_0x16c6('0x37')]));_0x28ebfb[_0x16c6('0x35')]=_0x28ebfb[_0x16c6('0x35')]['length']?_0x28ebfb[_0x16c6('0x35')]:_0x39cffc[_0x16c6('0x31')];if(!_0x5c12b3[_0x16c6('0x33')][_0x16c6('0x38')]('nolimit')){_0x28ebfb['limit']=qs['limit'](_0x5c12b3[_0x16c6('0x33')]['limit']);_0x28ebfb[_0x16c6('0x1e')]=qs[_0x16c6('0x1e')](_0x5c12b3['query'][_0x16c6('0x1e')]);}_0x28ebfb[_0x16c6('0x39')]=qs[_0x16c6('0x3a')](_0x5c12b3['query'][_0x16c6('0x3a')]);_0x28ebfb[_0x16c6('0x3b')]=qs['filters'](_['pick'](_0x5c12b3[_0x16c6('0x33')],_0x39cffc[_0x16c6('0x3c')]),_0x16c8b8);if(_0x5c12b3[_0x16c6('0x33')][_0x16c6('0x3d')]){_0x28ebfb[_0x16c6('0x3b')]=_[_0x16c6('0x3e')](_0x28ebfb[_0x16c6('0x3b')],{'$or':_[_0x16c6('0x2d')](_0x16c8b8,function(_0x46b09f){if(_0x46b09f[_0x16c6('0x30')]!==_0x16c6('0x3f')){var _0x15d9a4={};_0x15d9a4[_0x46b09f[_0x16c6('0x32')]]={'$like':'%'+_0x5c12b3['query'][_0x16c6('0x3d')]+'%'};return _0x15d9a4;}})});}_0x28ebfb=_[_0x16c6('0x3e')]({},_0x28ebfb,_0x5c12b3[_0x16c6('0x40')]);var _0x5299f4={'where':_0x28ebfb[_0x16c6('0x3b')]};return db[_0x16c6('0x41')][_0x16c6('0x21')](_0x5299f4)[_0x16c6('0x28')](function(_0x97db5d){_0x2ef3f7[_0x16c6('0x21')]=_0x97db5d;if(_0x5c12b3[_0x16c6('0x33')][_0x16c6('0x42')]){_0x28ebfb[_0x16c6('0x43')]=[{'all':!![]}];}return db[_0x16c6('0x41')][_0x16c6('0x44')](_0x28ebfb);})[_0x16c6('0x28')](function(_0x2e21cd){_0x2ef3f7['rows']=_0x2e21cd;return _0x2ef3f7;})['then'](respondWithFilteredResult(_0x24c742,_0x28ebfb))[_0x16c6('0x45')](handleError(_0x24c742,null));};exports[_0x16c6('0x46')]=function(_0x2b4e4f,_0x4a1af1){var _0x495128={'raw':![],'where':{'id':_0x2b4e4f[_0x16c6('0x47')]['id']}},_0x550b99={};_0x550b99[_0x16c6('0x31')]=_[_0x16c6('0x34')](db[_0x16c6('0x41')][_0x16c6('0x2e')]);_0x550b99['query']=_[_0x16c6('0x34')](_0x2b4e4f[_0x16c6('0x33')]);_0x550b99[_0x16c6('0x3c')]=_[_0x16c6('0x36')](_0x550b99[_0x16c6('0x31')],_0x550b99[_0x16c6('0x33')]);_0x495128['attributes']=_[_0x16c6('0x36')](_0x550b99[_0x16c6('0x31')],qs[_0x16c6('0x37')](_0x2b4e4f[_0x16c6('0x33')][_0x16c6('0x37')]));_0x495128[_0x16c6('0x35')]=_0x495128[_0x16c6('0x35')]['length']?_0x495128[_0x16c6('0x35')]:_0x550b99[_0x16c6('0x31')];if(_0x2b4e4f[_0x16c6('0x33')][_0x16c6('0x42')]){_0x495128['include']=[{'all':!![]}];}_0x495128=_[_0x16c6('0x3e')]({},_0x495128,_0x2b4e4f['options']);return db['Automation'][_0x16c6('0x48')](_0x495128)[_0x16c6('0x28')](handleEntityNotFound(_0x4a1af1,null))[_0x16c6('0x28')](respondWithResult(_0x4a1af1,null))[_0x16c6('0x45')](handleError(_0x4a1af1,null));};exports['create']=function(_0x206257,_0x3c60db){return db[_0x16c6('0x41')]['create'](_0x206257['body'],{})['then'](respondWithResult(_0x3c60db,0xc9))[_0x16c6('0x45')](handleError(_0x3c60db,null));};exports[_0x16c6('0x27')]=function(_0x43d8ed,_0xff3277){if(_0x43d8ed[_0x16c6('0x49')]['id']){delete _0x43d8ed[_0x16c6('0x49')]['id'];}return db[_0x16c6('0x41')][_0x16c6('0x48')]({'where':{'id':_0x43d8ed[_0x16c6('0x47')]['id']}})[_0x16c6('0x28')](handleEntityNotFound(_0xff3277,null))[_0x16c6('0x28')](saveUpdates(_0x43d8ed[_0x16c6('0x49')],null))[_0x16c6('0x28')](respondWithResult(_0xff3277,null))[_0x16c6('0x45')](handleError(_0xff3277,null));};exports[_0x16c6('0x29')]=function(_0x280a2a,_0x4be668){return db[_0x16c6('0x41')][_0x16c6('0x48')]({'where':{'id':_0x280a2a[_0x16c6('0x47')]['id']}})['then'](handleEntityNotFound(_0x4be668,null))['then'](removeEntity(_0x4be668,null))[_0x16c6('0x45')](handleError(_0x4be668,null));};exports['addConditions']=function(_0x407d88,_0x1c1a49,_0x488b7c){return db[_0x16c6('0x4a')]['find']({'where':{'id':_0x407d88[_0x16c6('0x47')]['id']}})[_0x16c6('0x28')](handleEntityNotFound(_0x1c1a49,null))['then'](function(_0x46afbc){if(_0x46afbc){return _0x46afbc['addConditions'](_0x407d88[_0x16c6('0x49')][_0x16c6('0x4b')],_['omit'](_0x407d88[_0x16c6('0x49')],[_0x16c6('0x4b'),'id'])||{});}})[_0x16c6('0x28')](respondWithResult(_0x1c1a49,null))[_0x16c6('0x45')](handleError(_0x1c1a49,null));};exports[_0x16c6('0x4c')]=function(_0x40fd70,_0x139031,_0x49c600){var _0x4d9f68={};var _0x120dff={};var _0x8b88fa;var _0x374b65;return db[_0x16c6('0x41')]['findOne']({'where':{'id':_0x40fd70['params']['id']}})[_0x16c6('0x28')](handleEntityNotFound(_0x139031,null))[_0x16c6('0x28')](function(_0x55042a){if(_0x55042a){_0x8b88fa=_0x55042a;_0x120dff[_0x16c6('0x31')]=_[_0x16c6('0x34')](db[_0x16c6('0x4a')][_0x16c6('0x2e')]);_0x120dff['query']=_[_0x16c6('0x34')](_0x40fd70['query']);_0x120dff['filters']=_[_0x16c6('0x36')](_0x120dff[_0x16c6('0x31')],_0x120dff[_0x16c6('0x33')]);_0x4d9f68[_0x16c6('0x35')]=_[_0x16c6('0x36')](_0x120dff['model'],qs[_0x16c6('0x37')](_0x40fd70[_0x16c6('0x33')][_0x16c6('0x37')]));_0x4d9f68[_0x16c6('0x35')]=_0x4d9f68[_0x16c6('0x35')][_0x16c6('0x4d')]?_0x4d9f68[_0x16c6('0x35')]:_0x120dff[_0x16c6('0x31')];_0x4d9f68[_0x16c6('0x39')]=qs[_0x16c6('0x3a')](_0x40fd70['query'][_0x16c6('0x3a')]);_0x4d9f68[_0x16c6('0x3b')]=qs['filters'](_[_0x16c6('0x4e')](_0x40fd70[_0x16c6('0x33')],_0x120dff[_0x16c6('0x3c')]));if(_0x40fd70['query'][_0x16c6('0x3d')]){_0x4d9f68[_0x16c6('0x3b')]=_[_0x16c6('0x3e')](_0x4d9f68[_0x16c6('0x3b')],{'$or':_['map'](_0x4d9f68[_0x16c6('0x35')],function(_0x841309){var _0x3834d9={};_0x3834d9[_0x841309]={'$like':'%'+_0x40fd70[_0x16c6('0x33')][_0x16c6('0x3d')]+'%'};return _0x3834d9;})});}_0x4d9f68=_[_0x16c6('0x3e')]({},_0x4d9f68,_0x40fd70[_0x16c6('0x40')]);return _0x8b88fa[_0x16c6('0x4c')](_0x4d9f68);}})['then'](function(_0x421de9){if(_0x421de9){_0x374b65=_0x421de9['length'];if(!_0x40fd70['query'][_0x16c6('0x38')](_0x16c6('0x4f'))){_0x4d9f68[_0x16c6('0x20')]=qs['limit'](_0x40fd70[_0x16c6('0x33')][_0x16c6('0x20')]);_0x4d9f68[_0x16c6('0x1e')]=qs[_0x16c6('0x1e')](_0x40fd70[_0x16c6('0x33')]['offset']);}return _0x8b88fa[_0x16c6('0x4c')](_0x4d9f68);}})[_0x16c6('0x28')](function(_0x44aa96){if(_0x44aa96){return _0x44aa96?{'count':_0x374b65,'rows':_0x44aa96}:null;}})[_0x16c6('0x28')](respondWithResult(_0x139031,null))[_0x16c6('0x45')](handleError(_0x139031,null));};exports[_0x16c6('0x50')]=function(_0x1f37ec,_0xd2816b,_0x2ff565){return db[_0x16c6('0x51')][_0x16c6('0x48')]({'where':{'id':_0x1f37ec[_0x16c6('0x47')]['id']}})[_0x16c6('0x28')](handleEntityNotFound(_0xd2816b,null))[_0x16c6('0x28')](function(_0x26007e){if(_0x26007e){return _0x26007e['addActions'](_0x1f37ec[_0x16c6('0x49')][_0x16c6('0x4b')],_[_0x16c6('0x52')](_0x1f37ec[_0x16c6('0x49')],['ids','id'])||{});}})[_0x16c6('0x28')](respondWithResult(_0xd2816b,null))['catch'](handleError(_0xd2816b,null));};exports[_0x16c6('0x53')]=function(_0x3a9c66,_0x5a8ee6,_0xedb471){var _0xe0b0dd={};var _0x4d6352={};var _0x543352;var _0x281212;return db[_0x16c6('0x41')][_0x16c6('0x54')]({'where':{'id':_0x3a9c66['params']['id']}})[_0x16c6('0x28')](handleEntityNotFound(_0x5a8ee6,null))[_0x16c6('0x28')](function(_0xa279ab){if(_0xa279ab){_0x543352=_0xa279ab;_0x4d6352['model']=_[_0x16c6('0x34')](db[_0x16c6('0x51')][_0x16c6('0x2e')]);_0x4d6352['query']=_[_0x16c6('0x34')](_0x3a9c66[_0x16c6('0x33')]);_0x4d6352[_0x16c6('0x3c')]=_[_0x16c6('0x36')](_0x4d6352['model'],_0x4d6352[_0x16c6('0x33')]);_0xe0b0dd[_0x16c6('0x35')]=_[_0x16c6('0x36')](_0x4d6352[_0x16c6('0x31')],qs[_0x16c6('0x37')](_0x3a9c66[_0x16c6('0x33')]['fields']));_0xe0b0dd[_0x16c6('0x35')]=_0xe0b0dd[_0x16c6('0x35')][_0x16c6('0x4d')]?_0xe0b0dd['attributes']:_0x4d6352[_0x16c6('0x31')];_0xe0b0dd['order']=qs[_0x16c6('0x3a')](_0x3a9c66[_0x16c6('0x33')]['sort']);_0xe0b0dd[_0x16c6('0x3b')]=qs[_0x16c6('0x3c')](_['pick'](_0x3a9c66[_0x16c6('0x33')],_0x4d6352[_0x16c6('0x3c')]));if(_0x3a9c66[_0x16c6('0x33')][_0x16c6('0x3d')]){_0xe0b0dd[_0x16c6('0x3b')]=_[_0x16c6('0x3e')](_0xe0b0dd[_0x16c6('0x3b')],{'$or':_[_0x16c6('0x2d')](_0xe0b0dd[_0x16c6('0x35')],function(_0x558bd6){var _0x18ed07={};_0x18ed07[_0x558bd6]={'$like':'%'+_0x3a9c66['query'][_0x16c6('0x3d')]+'%'};return _0x18ed07;})});}_0xe0b0dd=_[_0x16c6('0x3e')]({},_0xe0b0dd,_0x3a9c66[_0x16c6('0x40')]);return _0x543352['getActions'](_0xe0b0dd);}})[_0x16c6('0x28')](function(_0x29c976){if(_0x29c976){_0x281212=_0x29c976['length'];if(!_0x3a9c66[_0x16c6('0x33')][_0x16c6('0x38')]('nolimit')){_0xe0b0dd[_0x16c6('0x20')]=qs[_0x16c6('0x20')](_0x3a9c66[_0x16c6('0x33')][_0x16c6('0x20')]);_0xe0b0dd[_0x16c6('0x1e')]=qs[_0x16c6('0x1e')](_0x3a9c66[_0x16c6('0x33')][_0x16c6('0x1e')]);}return _0x543352[_0x16c6('0x53')](_0xe0b0dd);}})[_0x16c6('0x28')](function(_0x34752e){if(_0x34752e){return _0x34752e?{'count':_0x281212,'rows':_0x34752e}:null;}})[_0x16c6('0x28')](respondWithResult(_0x5a8ee6,null))[_0x16c6('0x45')](handleError(_0x5a8ee6,null));};
\ No newline at end of file
+var _0xd1f2=['merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','Automation','length','find','create','update','body','params','addConditions','Condition','ids','omit','findOne','getConditions','Action','getActions','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','reject','save','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x39bd4a,_0x4e23f1){var _0x2354af=function(_0x703508){while(--_0x703508){_0x39bd4a['push'](_0x39bd4a['shift']());}};_0x2354af(++_0x4e23f1);}(_0xd1f2,0x1b9));var _0x2d1f=function(_0x18c101,_0x32cb6d){_0x18c101=_0x18c101-0x0;var _0x7305b4=_0xd1f2[_0x18c101];return _0x7305b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d1f('0x0'));var zipdir=require(_0x2d1f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d1f('0x2'));var moment=require('moment');var BPromise=require(_0x2d1f('0x3'));var Mustache=require(_0x2d1f('0x4'));var util=require(_0x2d1f('0x5'));var path=require(_0x2d1f('0x6'));var sox=require(_0x2d1f('0x7'));var csv=require(_0x2d1f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2d1f('0x9'));var jsforce=require(_0x2d1f('0xa'));var deskjs=require(_0x2d1f('0xb'));var toCsv=require(_0x2d1f('0x8'));var querystring=require(_0x2d1f('0xc'));var Papa=require(_0x2d1f('0xd'));var Redis=require(_0x2d1f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2d1f('0xf'));var hardwareService=require(_0x2d1f('0x10'));var logger=require(_0x2d1f('0x11'))(_0x2d1f('0x12'));var utils=require(_0x2d1f('0x13'));var config=require(_0x2d1f('0x14'));var licenseUtil=require(_0x2d1f('0x15'));var db=require(_0x2d1f('0x16'))['db'];function respondWithStatusCode(_0x153103,_0x2bfec1){_0x2bfec1=_0x2bfec1||0xcc;return function(_0x58940e){if(_0x58940e){return _0x153103[_0x2d1f('0x17')](_0x2bfec1);}return _0x153103[_0x2d1f('0x18')](_0x2bfec1)[_0x2d1f('0x19')]();};}function respondWithResult(_0x579306,_0x4b7df4){_0x4b7df4=_0x4b7df4||0xc8;return function(_0x33bf7a){if(_0x33bf7a){return _0x579306['status'](_0x4b7df4)[_0x2d1f('0x1a')](_0x33bf7a);}};}function respondWithFilteredResult(_0x2b2492,_0x127903){return function(_0x245b83){if(_0x245b83){var _0x181dcf=typeof _0x127903['offset']===_0x2d1f('0x1b')&&typeof _0x127903[_0x2d1f('0x1c')]===_0x2d1f('0x1b');var _0x2708f7=_0x245b83['count'];var _0x4f1f74=_0x181dcf?0x0:_0x127903[_0x2d1f('0x1d')];var _0x5972f1=_0x181dcf?_0x245b83[_0x2d1f('0x1e')]:_0x127903[_0x2d1f('0x1d')]+_0x127903[_0x2d1f('0x1c')];var _0x5c164b;if(_0x5972f1>=_0x2708f7){_0x5972f1=_0x2708f7;_0x5c164b=0xc8;}else{_0x5c164b=0xce;}_0x2b2492[_0x2d1f('0x18')](_0x5c164b);return _0x2b2492[_0x2d1f('0x1f')]('Content-Range',_0x4f1f74+'-'+_0x5972f1+'/'+_0x2708f7)[_0x2d1f('0x1a')](_0x245b83);}return null;};}function patchUpdates(_0x255781){return function(_0x347bcc){try{jsonpatch['apply'](_0x347bcc,_0x255781,!![]);}catch(_0x48fb01){return BPromise[_0x2d1f('0x20')](_0x48fb01);}return _0x347bcc[_0x2d1f('0x21')]();};}function saveUpdates(_0x4457c0,_0x2f3183){return function(_0x3d90ba){if(_0x3d90ba){return _0x3d90ba['update'](_0x4457c0)['then'](function(_0x25d132){return _0x25d132;});}return null;};}function removeEntity(_0x3e0be9,_0xbe00ae){return function(_0x489931){if(_0x489931){return _0x489931[_0x2d1f('0x22')]()['then'](function(){_0x3e0be9[_0x2d1f('0x18')](0xcc)[_0x2d1f('0x19')]();});}};}function handleEntityNotFound(_0x22bd8a,_0x158b84){return function(_0x425a7a){if(!_0x425a7a){_0x22bd8a['sendStatus'](0x194);}return _0x425a7a;};}function handleError(_0xc5f207,_0x56ab57){_0x56ab57=_0x56ab57||0x1f4;return function(_0x454768){logger[_0x2d1f('0x23')](_0x454768[_0x2d1f('0x24')]);if(_0x454768[_0x2d1f('0x25')]){delete _0x454768[_0x2d1f('0x25')];}_0xc5f207[_0x2d1f('0x18')](_0x56ab57)[_0x2d1f('0x26')](_0x454768);};}exports[_0x2d1f('0x27')]=function(_0x3b798b,_0x566ce1){var _0x1ee937={},_0x121f0e={},_0x10be9b={'count':0x0,'rows':[]};var _0x598d8a=_[_0x2d1f('0x28')](db['Automation'][_0x2d1f('0x29')],function(_0x485339){return{'name':_0x485339[_0x2d1f('0x2a')],'type':_0x485339['type']['key']};});_0x121f0e[_0x2d1f('0x2b')]=_[_0x2d1f('0x28')](_0x598d8a,'name');_0x121f0e[_0x2d1f('0x2c')]=_[_0x2d1f('0x2d')](_0x3b798b[_0x2d1f('0x2c')]);_0x121f0e[_0x2d1f('0x2e')]=_[_0x2d1f('0x2f')](_0x121f0e[_0x2d1f('0x2b')],_0x121f0e[_0x2d1f('0x2c')]);_0x1ee937['attributes']=_[_0x2d1f('0x2f')](_0x121f0e[_0x2d1f('0x2b')],qs[_0x2d1f('0x30')](_0x3b798b[_0x2d1f('0x2c')][_0x2d1f('0x30')]));_0x1ee937[_0x2d1f('0x31')]=_0x1ee937[_0x2d1f('0x31')]['length']?_0x1ee937['attributes']:_0x121f0e[_0x2d1f('0x2b')];if(!_0x3b798b['query'][_0x2d1f('0x32')](_0x2d1f('0x33'))){_0x1ee937['limit']=qs[_0x2d1f('0x1c')](_0x3b798b[_0x2d1f('0x2c')][_0x2d1f('0x1c')]);_0x1ee937[_0x2d1f('0x1d')]=qs[_0x2d1f('0x1d')](_0x3b798b['query'][_0x2d1f('0x1d')]);}_0x1ee937[_0x2d1f('0x34')]=qs[_0x2d1f('0x35')](_0x3b798b[_0x2d1f('0x2c')][_0x2d1f('0x35')]);_0x1ee937[_0x2d1f('0x36')]=qs['filters'](_[_0x2d1f('0x37')](_0x3b798b[_0x2d1f('0x2c')],_0x121f0e[_0x2d1f('0x2e')]),_0x598d8a);if(_0x3b798b['query'][_0x2d1f('0x38')]){_0x1ee937[_0x2d1f('0x36')]=_[_0x2d1f('0x39')](_0x1ee937['where'],{'$or':_['map'](_0x598d8a,function(_0x2aed86){if(_0x2aed86[_0x2d1f('0x3a')]!==_0x2d1f('0x3b')){var _0x232a9a={};_0x232a9a[_0x2aed86[_0x2d1f('0x25')]]={'$like':'%'+_0x3b798b[_0x2d1f('0x2c')]['filter']+'%'};return _0x232a9a;}})});}_0x1ee937=_[_0x2d1f('0x39')]({},_0x1ee937,_0x3b798b[_0x2d1f('0x3c')]);var _0x24ec2f={'where':_0x1ee937['where']};return db['Automation'][_0x2d1f('0x1e')](_0x24ec2f)[_0x2d1f('0x3d')](function(_0x31bfee){_0x10be9b[_0x2d1f('0x1e')]=_0x31bfee;if(_0x3b798b[_0x2d1f('0x2c')][_0x2d1f('0x3e')]){_0x1ee937[_0x2d1f('0x3f')]=[{'all':!![]}];}return db['Automation'][_0x2d1f('0x40')](_0x1ee937);})[_0x2d1f('0x3d')](function(_0x5853d6){_0x10be9b[_0x2d1f('0x41')]=_0x5853d6;return _0x10be9b;})[_0x2d1f('0x3d')](respondWithFilteredResult(_0x566ce1,_0x1ee937))[_0x2d1f('0x42')](handleError(_0x566ce1,null));};exports[_0x2d1f('0x43')]=function(_0x215d45,_0x44422a){var _0x3caad8={'raw':![],'where':{'id':_0x215d45['params']['id']}},_0x387075={};_0x387075[_0x2d1f('0x2b')]=_['keys'](db[_0x2d1f('0x44')][_0x2d1f('0x29')]);_0x387075[_0x2d1f('0x2c')]=_[_0x2d1f('0x2d')](_0x215d45[_0x2d1f('0x2c')]);_0x387075[_0x2d1f('0x2e')]=_['intersection'](_0x387075[_0x2d1f('0x2b')],_0x387075[_0x2d1f('0x2c')]);_0x3caad8[_0x2d1f('0x31')]=_[_0x2d1f('0x2f')](_0x387075[_0x2d1f('0x2b')],qs[_0x2d1f('0x30')](_0x215d45[_0x2d1f('0x2c')][_0x2d1f('0x30')]));_0x3caad8[_0x2d1f('0x31')]=_0x3caad8[_0x2d1f('0x31')][_0x2d1f('0x45')]?_0x3caad8[_0x2d1f('0x31')]:_0x387075[_0x2d1f('0x2b')];if(_0x215d45[_0x2d1f('0x2c')][_0x2d1f('0x3e')]){_0x3caad8[_0x2d1f('0x3f')]=[{'all':!![]}];}_0x3caad8=_[_0x2d1f('0x39')]({},_0x3caad8,_0x215d45[_0x2d1f('0x3c')]);return db[_0x2d1f('0x44')][_0x2d1f('0x46')](_0x3caad8)['then'](handleEntityNotFound(_0x44422a,null))[_0x2d1f('0x3d')](respondWithResult(_0x44422a,null))[_0x2d1f('0x42')](handleError(_0x44422a,null));};exports[_0x2d1f('0x47')]=function(_0x4d0536,_0x341d96){return db[_0x2d1f('0x44')][_0x2d1f('0x47')](_0x4d0536['body'],{})['then'](respondWithResult(_0x341d96,0xc9))[_0x2d1f('0x42')](handleError(_0x341d96,null));};exports[_0x2d1f('0x48')]=function(_0x535e98,_0x3fa093){if(_0x535e98[_0x2d1f('0x49')]['id']){delete _0x535e98['body']['id'];}return db[_0x2d1f('0x44')]['find']({'where':{'id':_0x535e98[_0x2d1f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3fa093,null))[_0x2d1f('0x3d')](saveUpdates(_0x535e98['body'],null))[_0x2d1f('0x3d')](respondWithResult(_0x3fa093,null))[_0x2d1f('0x42')](handleError(_0x3fa093,null));};exports['destroy']=function(_0x3165c4,_0x3194a2){return db[_0x2d1f('0x44')][_0x2d1f('0x46')]({'where':{'id':_0x3165c4[_0x2d1f('0x4a')]['id']}})[_0x2d1f('0x3d')](handleEntityNotFound(_0x3194a2,null))[_0x2d1f('0x3d')](removeEntity(_0x3194a2,null))[_0x2d1f('0x42')](handleError(_0x3194a2,null));};exports[_0x2d1f('0x4b')]=function(_0x406268,_0x2777f2,_0x299677){return db[_0x2d1f('0x4c')][_0x2d1f('0x46')]({'where':{'id':_0x406268[_0x2d1f('0x4a')]['id']}})[_0x2d1f('0x3d')](handleEntityNotFound(_0x2777f2,null))[_0x2d1f('0x3d')](function(_0x1878db){if(_0x1878db){return _0x1878db['addConditions'](_0x406268[_0x2d1f('0x49')][_0x2d1f('0x4d')],_[_0x2d1f('0x4e')](_0x406268[_0x2d1f('0x49')],[_0x2d1f('0x4d'),'id'])||{});}})[_0x2d1f('0x3d')](respondWithResult(_0x2777f2,null))[_0x2d1f('0x42')](handleError(_0x2777f2,null));};exports['getConditions']=function(_0x5ab22c,_0x5c27b7,_0x2f21a6){var _0x324c71={};var _0x5a2b96={};var _0x567396;var _0x235de5;return db[_0x2d1f('0x44')][_0x2d1f('0x4f')]({'where':{'id':_0x5ab22c['params']['id']}})['then'](handleEntityNotFound(_0x5c27b7,null))[_0x2d1f('0x3d')](function(_0x53ffbc){if(_0x53ffbc){_0x567396=_0x53ffbc;_0x5a2b96[_0x2d1f('0x2b')]=_[_0x2d1f('0x2d')](db[_0x2d1f('0x4c')][_0x2d1f('0x29')]);_0x5a2b96[_0x2d1f('0x2c')]=_[_0x2d1f('0x2d')](_0x5ab22c[_0x2d1f('0x2c')]);_0x5a2b96[_0x2d1f('0x2e')]=_['intersection'](_0x5a2b96['model'],_0x5a2b96['query']);_0x324c71[_0x2d1f('0x31')]=_['intersection'](_0x5a2b96[_0x2d1f('0x2b')],qs[_0x2d1f('0x30')](_0x5ab22c['query']['fields']));_0x324c71[_0x2d1f('0x31')]=_0x324c71['attributes'][_0x2d1f('0x45')]?_0x324c71[_0x2d1f('0x31')]:_0x5a2b96['model'];_0x324c71[_0x2d1f('0x34')]=qs[_0x2d1f('0x35')](_0x5ab22c[_0x2d1f('0x2c')][_0x2d1f('0x35')]);_0x324c71[_0x2d1f('0x36')]=qs['filters'](_[_0x2d1f('0x37')](_0x5ab22c[_0x2d1f('0x2c')],_0x5a2b96[_0x2d1f('0x2e')]));if(_0x5ab22c[_0x2d1f('0x2c')]['filter']){_0x324c71[_0x2d1f('0x36')]=_['merge'](_0x324c71[_0x2d1f('0x36')],{'$or':_['map'](_0x324c71[_0x2d1f('0x31')],function(_0x2a9f8d){var _0x355dbe={};_0x355dbe[_0x2a9f8d]={'$like':'%'+_0x5ab22c[_0x2d1f('0x2c')][_0x2d1f('0x38')]+'%'};return _0x355dbe;})});}_0x324c71=_['merge']({},_0x324c71,_0x5ab22c[_0x2d1f('0x3c')]);return _0x567396[_0x2d1f('0x50')](_0x324c71);}})['then'](function(_0x2cee56){if(_0x2cee56){_0x235de5=_0x2cee56[_0x2d1f('0x45')];if(!_0x5ab22c[_0x2d1f('0x2c')]['hasOwnProperty']('nolimit')){_0x324c71[_0x2d1f('0x1c')]=qs[_0x2d1f('0x1c')](_0x5ab22c['query'][_0x2d1f('0x1c')]);_0x324c71['offset']=qs['offset'](_0x5ab22c[_0x2d1f('0x2c')][_0x2d1f('0x1d')]);}return _0x567396[_0x2d1f('0x50')](_0x324c71);}})[_0x2d1f('0x3d')](function(_0x131a4c){if(_0x131a4c){return _0x131a4c?{'count':_0x235de5,'rows':_0x131a4c}:null;}})['then'](respondWithResult(_0x5c27b7,null))[_0x2d1f('0x42')](handleError(_0x5c27b7,null));};exports['addActions']=function(_0x2767ea,_0x2a6853,_0x247315){return db['Action'][_0x2d1f('0x46')]({'where':{'id':_0x2767ea['params']['id']}})['then'](handleEntityNotFound(_0x2a6853,null))['then'](function(_0x37b9bf){if(_0x37b9bf){return _0x37b9bf['addActions'](_0x2767ea['body'][_0x2d1f('0x4d')],_[_0x2d1f('0x4e')](_0x2767ea[_0x2d1f('0x49')],[_0x2d1f('0x4d'),'id'])||{});}})[_0x2d1f('0x3d')](respondWithResult(_0x2a6853,null))['catch'](handleError(_0x2a6853,null));};exports['getActions']=function(_0x1367a9,_0x27a508,_0x535950){var _0x48c5d9={};var _0x2323e6={};var _0x4a6966;var _0x28c242;return db['Automation']['findOne']({'where':{'id':_0x1367a9[_0x2d1f('0x4a')]['id']}})[_0x2d1f('0x3d')](handleEntityNotFound(_0x27a508,null))['then'](function(_0x3385f9){if(_0x3385f9){_0x4a6966=_0x3385f9;_0x2323e6[_0x2d1f('0x2b')]=_[_0x2d1f('0x2d')](db[_0x2d1f('0x51')]['rawAttributes']);_0x2323e6[_0x2d1f('0x2c')]=_[_0x2d1f('0x2d')](_0x1367a9[_0x2d1f('0x2c')]);_0x2323e6[_0x2d1f('0x2e')]=_['intersection'](_0x2323e6[_0x2d1f('0x2b')],_0x2323e6['query']);_0x48c5d9[_0x2d1f('0x31')]=_[_0x2d1f('0x2f')](_0x2323e6['model'],qs[_0x2d1f('0x30')](_0x1367a9[_0x2d1f('0x2c')][_0x2d1f('0x30')]));_0x48c5d9['attributes']=_0x48c5d9['attributes'][_0x2d1f('0x45')]?_0x48c5d9[_0x2d1f('0x31')]:_0x2323e6[_0x2d1f('0x2b')];_0x48c5d9['order']=qs[_0x2d1f('0x35')](_0x1367a9['query']['sort']);_0x48c5d9[_0x2d1f('0x36')]=qs[_0x2d1f('0x2e')](_[_0x2d1f('0x37')](_0x1367a9[_0x2d1f('0x2c')],_0x2323e6[_0x2d1f('0x2e')]));if(_0x1367a9['query'][_0x2d1f('0x38')]){_0x48c5d9[_0x2d1f('0x36')]=_[_0x2d1f('0x39')](_0x48c5d9[_0x2d1f('0x36')],{'$or':_[_0x2d1f('0x28')](_0x48c5d9['attributes'],function(_0x4ac1ee){var _0x82270c={};_0x82270c[_0x4ac1ee]={'$like':'%'+_0x1367a9[_0x2d1f('0x2c')][_0x2d1f('0x38')]+'%'};return _0x82270c;})});}_0x48c5d9=_[_0x2d1f('0x39')]({},_0x48c5d9,_0x1367a9['options']);return _0x4a6966[_0x2d1f('0x52')](_0x48c5d9);}})[_0x2d1f('0x3d')](function(_0x5d51ed){if(_0x5d51ed){_0x28c242=_0x5d51ed[_0x2d1f('0x45')];if(!_0x1367a9[_0x2d1f('0x2c')][_0x2d1f('0x32')](_0x2d1f('0x33'))){_0x48c5d9[_0x2d1f('0x1c')]=qs[_0x2d1f('0x1c')](_0x1367a9['query'][_0x2d1f('0x1c')]);_0x48c5d9[_0x2d1f('0x1d')]=qs[_0x2d1f('0x1d')](_0x1367a9[_0x2d1f('0x2c')][_0x2d1f('0x1d')]);}return _0x4a6966['getActions'](_0x48c5d9);}})[_0x2d1f('0x3d')](function(_0x52d24f){if(_0x52d24f){return _0x52d24f?{'count':_0x28c242,'rows':_0x52d24f}:null;}})['then'](respondWithResult(_0x27a508,null))[_0x2d1f('0x42')](handleError(_0x27a508,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 06c632a..612e3a3 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 _0xeb3f=['../../config/logger','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xeb3f,0x1f3));var _0xfeb3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xeb3f[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0xfeb3('0x0'));var logger=require(_0xfeb3('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfeb3('0x2'));var fs=require('fs');var path=require(_0xfeb3('0x3'));var rimraf=require(_0xfeb3('0x4'));var config=require(_0xfeb3('0x5'));var attributes=require(_0xfeb3('0x6'));module[_0xfeb3('0x7')]=function(_0x9ea1cb,_0x3b83da){return _0x9ea1cb['define'](_0xfeb3('0x8'),attributes,{'tableName':_0xfeb3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa45c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','util','api'];(function(_0x32ae4e,_0x1dd4b0){var _0x1084a7=function(_0x50c403){while(--_0x50c403){_0x32ae4e['push'](_0x32ae4e['shift']());}};_0x1084a7(++_0x1dd4b0);}(_0xa45c,0xb4));var _0xca45=function(_0x580955,_0x1ad93f){_0x580955=_0x580955-0x0;var _0x1c727f=_0xa45c[_0x580955];return _0x1c727f;};'use strict';var _=require('lodash');var util=require(_0xca45('0x0'));var logger=require('../../config/logger')(_0xca45('0x1'));var moment=require(_0xca45('0x2'));var BPromise=require(_0xca45('0x3'));var rp=require(_0xca45('0x4'));var fs=require('fs');var path=require(_0xca45('0x5'));var rimraf=require(_0xca45('0x6'));var config=require(_0xca45('0x7'));var attributes=require(_0xca45('0x8'));module[_0xca45('0x9')]=function(_0x435859,_0x45ca44){return _0x435859[_0xca45('0xa')](_0xca45('0xb'),attributes,{'tableName':_0xca45('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 8dee1e5..2cac947 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 _0xdfb1=['../../config/logger','client','http','request','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0xf8cca2,_0x12a2df){var _0x2ef044=function(_0x5e6c6b){while(--_0x5e6c6b){_0xf8cca2['push'](_0xf8cca2['shift']());}};_0x2ef044(++_0x12a2df);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x2d13a3,_0x480de5){_0x2d13a3=_0x2d13a3-0x0;var _0x5a993c=_0xdfb1[_0x2d13a3];return _0x5a993c;};'use strict';var _=require(_0x1dfb('0x0'));var util=require(_0x1dfb('0x1'));var moment=require(_0x1dfb('0x2'));var BPromise=require(_0x1dfb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1dfb('0x4'));var db=require(_0x1dfb('0x5'))['db'];var utils=require(_0x1dfb('0x6'));var logger=require(_0x1dfb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1dfb('0x8')][_0x1dfb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e10d9,_0x496be7,_0x42d45e){return new BPromise(function(_0x491406,_0x141081){return client[_0x1dfb('0xa')](_0x1e10d9,_0x42d45e)['then'](function(_0x24d8b9){logger[_0x1dfb('0xb')](_0x1dfb('0xc'),_0x496be7,'request\x20sent');logger[_0x1dfb('0xd')](_0x1dfb('0xe'),_0x496be7,_0x1dfb('0xf'),JSON[_0x1dfb('0x10')](_0x24d8b9));if(_0x24d8b9[_0x1dfb('0x11')]){if(_0x24d8b9[_0x1dfb('0x11')][_0x1dfb('0x12')]===0x1f4){logger[_0x1dfb('0x11')](_0x1dfb('0xc'),_0x496be7,_0x24d8b9['error'][_0x1dfb('0x13')]);return _0x141081(_0x24d8b9[_0x1dfb('0x11')]['message']);}logger[_0x1dfb('0x11')](_0x1dfb('0xc'),_0x496be7,_0x24d8b9[_0x1dfb('0x11')]['message']);return _0x491406(_0x24d8b9[_0x1dfb('0x11')][_0x1dfb('0x13')]);}else{logger[_0x1dfb('0xb')]('Automation,\x20%s,\x20%s',_0x496be7,_0x1dfb('0xf'));_0x491406(_0x24d8b9[_0x1dfb('0x14')][_0x1dfb('0x13')]);}})['catch'](function(_0x1186d1){logger[_0x1dfb('0x11')](_0x1dfb('0xc'),_0x496be7,_0x1186d1);_0x141081(_0x1186d1);});});}
\ No newline at end of file
+var _0xb6da=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0xff3f4a,_0x50f3b4){var _0x13db8a=function(_0x41d3c6){while(--_0x41d3c6){_0xff3f4a['push'](_0xff3f4a['shift']());}};_0x13db8a(++_0x50f3b4);}(_0xb6da,0x8e));var _0xab6d=function(_0x58ddb5,_0x16e1f7){_0x58ddb5=_0x58ddb5-0x0;var _0xc2a5bf=_0xb6da[_0x58ddb5];return _0xc2a5bf;};'use strict';var _=require(_0xab6d('0x0'));var util=require('util');var moment=require(_0xab6d('0x1'));var BPromise=require(_0xab6d('0x2'));var rs=require(_0xab6d('0x3'));var fs=require('fs');var Redis=require(_0xab6d('0x4'));var db=require(_0xab6d('0x5'))['db'];var utils=require(_0xab6d('0x6'));var logger=require(_0xab6d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xab6d('0x8'));var client=jayson[_0xab6d('0x9')][_0xab6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x130285,_0x359bef,_0x44d5fa){return new BPromise(function(_0x4ba0f7,_0x2e30f1){return client['request'](_0x130285,_0x44d5fa)[_0xab6d('0xb')](function(_0x590cfa){logger['info'](_0xab6d('0xc'),_0x359bef,_0xab6d('0xd'));logger['debug'](_0xab6d('0xe'),_0x359bef,'request\x20sent',JSON['stringify'](_0x590cfa));if(_0x590cfa[_0xab6d('0xf')]){if(_0x590cfa[_0xab6d('0xf')][_0xab6d('0x10')]===0x1f4){logger[_0xab6d('0xf')](_0xab6d('0xc'),_0x359bef,_0x590cfa[_0xab6d('0xf')][_0xab6d('0x11')]);return _0x2e30f1(_0x590cfa[_0xab6d('0xf')]['message']);}logger[_0xab6d('0xf')](_0xab6d('0xc'),_0x359bef,_0x590cfa[_0xab6d('0xf')][_0xab6d('0x11')]);return _0x4ba0f7(_0x590cfa[_0xab6d('0xf')][_0xab6d('0x11')]);}else{logger['info'](_0xab6d('0xc'),_0x359bef,_0xab6d('0xd'));_0x4ba0f7(_0x590cfa[_0xab6d('0x12')]['message']);}})[_0xab6d('0x13')](function(_0x3bd40a){logger[_0xab6d('0xf')](_0xab6d('0xc'),_0x359bef,_0x3bd40a);_0x2e30f1(_0x3bd40a);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index af7f0d0..195ec19 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 _0xd8ee=['../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','/:id/conditions','getActions','create','post','addActions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x59014b,_0x294587){var _0x176fc9=function(_0x755cce){while(--_0x755cce){_0x59014b['push'](_0x59014b['shift']());}};_0x176fc9(++_0x294587);}(_0xd8ee,0x1f2));var _0xed8e=function(_0x4e0f60,_0x426fe6){_0x4e0f60=_0x4e0f60-0x0;var _0x48e1ef=_0xd8ee[_0x4e0f60];return _0x48e1ef;};'use strict';var multer=require(_0xed8e('0x0'));var util=require('util');var path=require(_0xed8e('0x1'));var timeout=require(_0xed8e('0x2'));var express=require(_0xed8e('0x3'));var router=express['Router']();var fs_extra=require(_0xed8e('0x4'));var auth=require(_0xed8e('0x5'));var interaction=require(_0xed8e('0x6'));var config=require(_0xed8e('0x7'));var controller=require(_0xed8e('0x8'));router[_0xed8e('0x9')]('/',auth['isAuthenticated'](),controller[_0xed8e('0xa')]);router[_0xed8e('0x9')](_0xed8e('0xb'),auth[_0xed8e('0xc')](),controller[_0xed8e('0xd')]);router[_0xed8e('0x9')](_0xed8e('0xe'),auth['isAuthenticated'](),controller['getConditions']);router[_0xed8e('0x9')]('/:id/actions',auth['isAuthenticated'](),controller[_0xed8e('0xf')]);router['post']('/',auth[_0xed8e('0xc')](),controller[_0xed8e('0x10')]);router['post'](_0xed8e('0xe'),auth[_0xed8e('0xc')](),controller['addConditions']);router[_0xed8e('0x11')]('/:id/actions',auth[_0xed8e('0xc')](),controller[_0xed8e('0x12')]);router[_0xed8e('0x13')](_0xed8e('0xb'),auth[_0xed8e('0xc')](),controller[_0xed8e('0x14')]);router[_0xed8e('0x15')](_0xed8e('0xb'),auth[_0xed8e('0xc')](),controller[_0xed8e('0x16')]);module[_0xed8e('0x17')]=router;
\ No newline at end of file
+var _0xac5c=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','getActions','post','create','addActions','put','destroy','exports','multer','util'];(function(_0x2b5ae7,_0x4cf577){var _0x43faff=function(_0x2c6eff){while(--_0x2c6eff){_0x2b5ae7['push'](_0x2b5ae7['shift']());}};_0x43faff(++_0x4cf577);}(_0xac5c,0x10f));var _0xcac5=function(_0x225ff0,_0x152ece){_0x225ff0=_0x225ff0-0x0;var _0x497f5d=_0xac5c[_0x225ff0];return _0x497f5d;};'use strict';var multer=require(_0xcac5('0x0'));var util=require(_0xcac5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcac5('0x2'));var router=express[_0xcac5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcac5('0x4'));var interaction=require(_0xcac5('0x5'));var config=require(_0xcac5('0x6'));var controller=require(_0xcac5('0x7'));router[_0xcac5('0x8')]('/',auth[_0xcac5('0x9')](),controller[_0xcac5('0xa')]);router['get'](_0xcac5('0xb'),auth[_0xcac5('0x9')](),controller['show']);router[_0xcac5('0x8')](_0xcac5('0xc'),auth[_0xcac5('0x9')](),controller[_0xcac5('0xd')]);router[_0xcac5('0x8')]('/:id/actions',auth[_0xcac5('0x9')](),controller[_0xcac5('0xe')]);router[_0xcac5('0xf')]('/',auth[_0xcac5('0x9')](),controller[_0xcac5('0x10')]);router['post'](_0xcac5('0xc'),auth[_0xcac5('0x9')](),controller['addConditions']);router[_0xcac5('0xf')]('/:id/actions',auth['isAuthenticated'](),controller[_0xcac5('0x11')]);router[_0xcac5('0x12')](_0xcac5('0xb'),auth[_0xcac5('0x9')](),controller['update']);router['delete'](_0xcac5('0xb'),auth['isAuthenticated'](),controller[_0xcac5('0x13')]);module[_0xcac5('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 3ef89a2..a6c4bac 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 _0x0e8c=['NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)'];(function(_0x329990,_0x3f6357){var _0x1092b6=function(_0x82b85){while(--_0x82b85){_0x329990['push'](_0x329990['shift']());}};_0x1092b6(++_0x3f6357);}(_0x0e8c,0x1e0));var _0xc0e8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0e8c[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xc0e8('0x0')]={'name':{'type':Sequelize[_0xc0e8('0x1')],'unique':_0xc0e8('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc0e8('0x3')](_0xc0e8('0x4')),'allowNull':![],'defaultValue':_0xc0e8('0x4')},'description':{'type':Sequelize[_0xc0e8('0x1')]},'active':{'type':Sequelize[_0xc0e8('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc0e8('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc0e8('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc0e8('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xc0e8('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc0e8('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc0e8('0x7')](0x3)[_0xc0e8('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc0e8('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc0e8('0x7')](0x5)[_0xc0e8('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc0e8('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xc0e8('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc0e8('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc0e8('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc0e8('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc0e8('0x7')](0x3)[_0xc0e8('0x9')],'defaultValue':0x3,'comment':_0xc0e8('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc0e8('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc0e8('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc0e8('0x7')](0x3)[_0xc0e8('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xc0e8('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc0e8('0x1')],'defaultValue':_0xc0e8('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xc0e8('0x11'),'never',_0xc0e8('0x12')),'defaultValue':_0xc0e8('0x11')},'dialAMDActive':{'type':Sequelize[_0xc0e8('0x5')],'defaultValue':0x0,'comment':_0xc0e8('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xc0e8('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xc0e8('0x7')](0x9)[_0xc0e8('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc0e8('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc0e8('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc0e8('0x7')](0x9)[_0xc0e8('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xc0e8('0x7')](0x9)[_0xc0e8('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc0e8('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc0e8('0x7')](0x9)[_0xc0e8('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc0e8('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc0e8('0x7')](0x9)[_0xc0e8('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc0e8('0x7')](0x5)[_0xc0e8('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc0e8('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xc0e8('0x3')]('DESC','ASC'),'defaultValue':_0xc0e8('0x19')},'dialPrefix':{'type':Sequelize[_0xc0e8('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc0e8('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc0e8('0x1a')},'dialCutDigit':{'type':Sequelize[_0xc0e8('0x7')](0x3)[_0xc0e8('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc0e8('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc0e8('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc0e8('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc0e8('0x7')](0x5)[_0xc0e8('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xc0e8('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc0e8('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0xc0e8('0x7')](0x5)[_0xc0e8('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc0e8('0x7')](0x3)[_0xc0e8('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc0e8('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc0e8('0x7')](0x5)[_0xc0e8('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc0e8('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc0e8('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc0e8('0x7')](0x5)[_0xc0e8('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc0e8('0x7')](0x3)[_0xc0e8('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc0e8('0x7')](0x5)[_0xc0e8('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc0e8('0x20')}};
\ No newline at end of file
+var _0xd75d=['Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x2a5dbd,_0x8f6f0d){var _0x167312=function(_0x2c5481){while(--_0x2c5481){_0x2a5dbd['push'](_0x2a5dbd['shift']());}};_0x167312(++_0x8f6f0d);}(_0xd75d,0x185));var _0xdd75=function(_0x18550b,_0x75f16a){_0x18550b=_0x18550b-0x0;var _0xa07369=_0xd75d[_0x18550b];return _0xa07369;};'use strict';var Sequelize=require(_0xdd75('0x0'));module[_0xdd75('0x1')]={'name':{'type':Sequelize[_0xdd75('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xdd75('0x3')](_0xdd75('0x4')),'allowNull':![],'defaultValue':_0xdd75('0x4')},'description':{'type':Sequelize[_0xdd75('0x2')]},'active':{'type':Sequelize[_0xdd75('0x5')],'defaultValue':0x0,'comment':_0xdd75('0x6')},'limitCalls':{'type':Sequelize[_0xdd75('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xdd75('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xdd75('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdd75('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xdd75('0x7')](0x3)[_0xdd75('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd75('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdd75('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdd75('0x7')](0x5)[_0xdd75('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdd75('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xdd75('0x7')](0x5)[_0xdd75('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdd75('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xdd75('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xdd75('0x7')](0x5)[_0xdd75('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd75('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xdd75('0x7')](0x3)[_0xdd75('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xdd75('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xdd75('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xdd75('0x3')](_0xdd75('0xf'),'never','onlyIfOpen'),'defaultValue':_0xdd75('0xf')},'dialAMDActive':{'type':Sequelize[_0xdd75('0x5')],'defaultValue':0x0,'comment':_0xdd75('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0xdd75('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xdd75('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdd75('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xdd75('0x7')](0x9)[_0xdd75('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdd75('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdd75('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdd75('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xdd75('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdd75('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdd75('0x7')](0x9)[_0xdd75('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdd75('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdd75('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xdd75('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdd75('0x7')](0x9)[_0xdd75('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdd75('0x17')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0xdd75('0x18')),'defaultValue':_0xdd75('0x19')},'dialPrefix':{'type':Sequelize[_0xdd75('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdd75('0x7')](0x3)[_0xdd75('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdd75('0x1a')},'dialCutDigit':{'type':Sequelize[_0xdd75('0x7')](0x3)[_0xdd75('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xdd75('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdd75('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdd75('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xdd75('0x7')](0x5)[_0xdd75('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd75('0x1b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdd75('0x7')](0x3)[_0xdd75('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd75('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdd75('0x7')](0x5)[_0xdd75('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd75('0x1d')},'dialMachineMaxRetry':{'type':Sequelize[_0xdd75('0x7')](0x3)[_0xdd75('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd75('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize[_0xdd75('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdd75('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdd75('0x7')](0x5)[_0xdd75('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd75('0x1f')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 5dd9cc0..38d869f 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 _0x301e=['error','name','index','map','Campaign','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','autoAssociation','getHoppers','CmHopper','CampaignId','findAll','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','select','field','NOW()','ContactId','CmListId','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','toString','COALESCE(phone,\x27\x27)','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','IvrCampaigns','UserProfileResource'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x301e,0x6e));var _0xe301=function(_0x3c6df7,_0x538710){_0x3c6df7=_0x3c6df7-0x0;var _0x2d3584=_0x301e[_0x3c6df7];return _0x2d3584;};'use strict';var emlformat=require(_0xe301('0x0'));var rimraf=require(_0xe301('0x1'));var zipdir=require(_0xe301('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe301('0x3'));var moment=require(_0xe301('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe301('0x5'));var util=require(_0xe301('0x6'));var path=require(_0xe301('0x7'));var sox=require(_0xe301('0x8'));var csv=require(_0xe301('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe301('0xa'));var _=require(_0xe301('0xb'));var squel=require(_0xe301('0xc'));var crypto=require(_0xe301('0xd'));var jsforce=require(_0xe301('0xe'));var deskjs=require(_0xe301('0xf'));var toCsv=require(_0xe301('0x9'));var querystring=require(_0xe301('0x10'));var Papa=require(_0xe301('0x11'));var Redis=require(_0xe301('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe301('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe301('0x14'));var logger=require('../../config/logger')(_0xe301('0x15'));var utils=require(_0xe301('0x16'));var config=require(_0xe301('0x17'));var licenseUtil=require(_0xe301('0x18'));var db=require(_0xe301('0x19'))['db'];function respondWithStatusCode(_0x34c4c0,_0x9400ef){_0x9400ef=_0x9400ef||0xcc;return function(_0x5132d1){if(_0x5132d1){return _0x34c4c0[_0xe301('0x1a')](_0x9400ef);}return _0x34c4c0[_0xe301('0x1b')](_0x9400ef)[_0xe301('0x1c')]();};}function respondWithResult(_0xca2b87,_0x2aba8f){_0x2aba8f=_0x2aba8f||0xc8;return function(_0x17d7bf){if(_0x17d7bf){return _0xca2b87[_0xe301('0x1b')](_0x2aba8f)[_0xe301('0x1d')](_0x17d7bf);}};}function respondWithFilteredResult(_0x1f2017,_0x3a362a){return function(_0x4525c8){if(_0x4525c8){var _0x5e9a54=typeof _0x3a362a['offset']===_0xe301('0x1e')&&typeof _0x3a362a[_0xe301('0x1f')]==='undefined';var _0x4a65f3=_0x4525c8[_0xe301('0x20')];var _0x57b2cf=_0x5e9a54?0x0:_0x3a362a[_0xe301('0x21')];var _0x40673a=_0x5e9a54?_0x4525c8[_0xe301('0x20')]:_0x3a362a[_0xe301('0x21')]+_0x3a362a['limit'];var _0x38fbf8;if(_0x40673a>=_0x4a65f3){_0x40673a=_0x4a65f3;_0x38fbf8=0xc8;}else{_0x38fbf8=0xce;}_0x1f2017['status'](_0x38fbf8);return _0x1f2017[_0xe301('0x22')](_0xe301('0x23'),_0x57b2cf+'-'+_0x40673a+'/'+_0x4a65f3)[_0xe301('0x1d')](_0x4525c8);}return null;};}function patchUpdates(_0x549a71){return function(_0x576ebb){try{jsonpatch['apply'](_0x576ebb,_0x549a71,!![]);}catch(_0x1ed005){return BPromise['reject'](_0x1ed005);}return _0x576ebb[_0xe301('0x24')]();};}function saveUpdates(_0x3a97d2,_0x4a722a){return function(_0xd51582){if(_0xd51582){return _0xd51582[_0xe301('0x25')](_0x3a97d2)[_0xe301('0x26')](function(_0x70d8e){return _0x70d8e;});}return null;};}function removeEntity(_0x1f4957,_0xa8cf12){return function(_0x559fb0){if(_0x559fb0){return _0x559fb0[_0xe301('0x27')]()[_0xe301('0x26')](function(){var _0x215654=_0x559fb0['get']({'plain':!![]});var _0x195f1d=_0xe301('0x28');return db[_0xe301('0x29')][_0xe301('0x27')]({'where':{'type':_0x195f1d,'resourceId':_0x215654['id']}})[_0xe301('0x26')](function(){return _0x559fb0;});})[_0xe301('0x26')](function(){_0x1f4957['status'](0xcc)[_0xe301('0x1c')]();});}};}function handleEntityNotFound(_0x5a0625,_0x29a1a2){return function(_0x2214f8){if(!_0x2214f8){_0x5a0625[_0xe301('0x1a')](0x194);}return _0x2214f8;};}function handleError(_0xbcbd5,_0x31eec6){_0x31eec6=_0x31eec6||0x1f4;return function(_0x55dc45){logger[_0xe301('0x2a')](_0x55dc45['stack']);if(_0x55dc45[_0xe301('0x2b')]){delete _0x55dc45[_0xe301('0x2b')];}_0xbcbd5[_0xe301('0x1b')](_0x31eec6)['send'](_0x55dc45);};}exports[_0xe301('0x2c')]=function(_0x144548,_0x43ba1d){var _0x13fcd4={},_0x2ad878={},_0x380786={'count':0x0,'rows':[]};var _0x1b886d=_[_0xe301('0x2d')](db[_0xe301('0x2e')][_0xe301('0x2f')],function(_0x387378){return{'name':_0x387378['fieldName'],'type':_0x387378['type'][_0xe301('0x30')]};});_0x2ad878[_0xe301('0x31')]=_[_0xe301('0x2d')](_0x1b886d,_0xe301('0x2b'));_0x2ad878[_0xe301('0x32')]=_[_0xe301('0x33')](_0x144548['query']);_0x2ad878[_0xe301('0x34')]=_[_0xe301('0x35')](_0x2ad878[_0xe301('0x31')],_0x2ad878[_0xe301('0x32')]);_0x13fcd4[_0xe301('0x36')]=_['intersection'](_0x2ad878[_0xe301('0x31')],qs[_0xe301('0x37')](_0x144548['query'][_0xe301('0x37')]));_0x13fcd4[_0xe301('0x36')]=_0x13fcd4[_0xe301('0x36')][_0xe301('0x38')]?_0x13fcd4[_0xe301('0x36')]:_0x2ad878[_0xe301('0x31')];if(!_0x144548[_0xe301('0x32')][_0xe301('0x39')](_0xe301('0x3a'))){_0x13fcd4[_0xe301('0x1f')]=qs['limit'](_0x144548[_0xe301('0x32')][_0xe301('0x1f')]);_0x13fcd4[_0xe301('0x21')]=qs[_0xe301('0x21')](_0x144548['query'][_0xe301('0x21')]);}_0x13fcd4[_0xe301('0x3b')]=qs[_0xe301('0x3c')](_0x144548['query']['sort']);_0x13fcd4[_0xe301('0x3d')]=qs['filters'](_[_0xe301('0x3e')](_0x144548[_0xe301('0x32')],_0x2ad878[_0xe301('0x34')]),_0x1b886d);if(_0x144548[_0xe301('0x32')][_0xe301('0x3f')]){_0x13fcd4[_0xe301('0x3d')]=_[_0xe301('0x40')](_0x13fcd4['where'],{'$or':_[_0xe301('0x2d')](_0x1b886d,function(_0xb03a08){if(_0xb03a08[_0xe301('0x41')]!==_0xe301('0x42')){var _0x260f1b={};_0x260f1b[_0xb03a08[_0xe301('0x2b')]]={'$like':'%'+_0x144548['query'][_0xe301('0x3f')]+'%'};return _0x260f1b;}})});}_0x13fcd4=_[_0xe301('0x40')]({},_0x13fcd4,_0x144548[_0xe301('0x43')]);var _0x53eff2={'where':_0x13fcd4[_0xe301('0x3d')]};return db['Campaign'][_0xe301('0x20')](_0x53eff2)[_0xe301('0x26')](function(_0x458d81){_0x380786[_0xe301('0x20')]=_0x458d81;if(_0x144548[_0xe301('0x32')][_0xe301('0x44')]){_0x13fcd4[_0xe301('0x45')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x13fcd4);})[_0xe301('0x26')](function(_0x4bda55){_0x380786['rows']=_0x4bda55;return _0x380786;})['then'](respondWithFilteredResult(_0x43ba1d,_0x13fcd4))[_0xe301('0x46')](handleError(_0x43ba1d,null));};exports[_0xe301('0x47')]=function(_0x21a7b2,_0x43f570){var _0x1ea516={'raw':![],'where':{'id':_0x21a7b2[_0xe301('0x48')]['id']}},_0x311c4e={};_0x311c4e[_0xe301('0x31')]=_['keys'](db['Campaign'][_0xe301('0x2f')]);_0x311c4e[_0xe301('0x32')]=_[_0xe301('0x33')](_0x21a7b2['query']);_0x311c4e[_0xe301('0x34')]=_['intersection'](_0x311c4e['model'],_0x311c4e[_0xe301('0x32')]);_0x1ea516[_0xe301('0x36')]=_[_0xe301('0x35')](_0x311c4e[_0xe301('0x31')],qs[_0xe301('0x37')](_0x21a7b2['query'][_0xe301('0x37')]));_0x1ea516['attributes']=_0x1ea516[_0xe301('0x36')][_0xe301('0x38')]?_0x1ea516[_0xe301('0x36')]:_0x311c4e['model'];if(_0x21a7b2['query']['includeAll']){_0x1ea516[_0xe301('0x45')]=[{'all':!![]}];}_0x1ea516=_[_0xe301('0x40')]({},_0x1ea516,_0x21a7b2[_0xe301('0x43')]);return db['Campaign'][_0xe301('0x49')](_0x1ea516)[_0xe301('0x26')](handleEntityNotFound(_0x43f570,null))[_0xe301('0x26')](respondWithResult(_0x43f570,null))[_0xe301('0x46')](handleError(_0x43f570,null));};exports['create']=function(_0x5101a3,_0x3ae24c){return db['Campaign'][_0xe301('0x4a')](_0x5101a3[_0xe301('0x4b')],{})[_0xe301('0x26')](function(_0x6e46ba){var _0x525ebf=_0x5101a3[_0xe301('0x4c')][_0xe301('0x4d')]({'plain':!![]});if(!_0x525ebf)throw new Error(_0xe301('0x4e'));if(_0x525ebf[_0xe301('0x4f')]===_0xe301('0x4c')){var _0x4ec53a=_0x6e46ba[_0xe301('0x4d')]({'plain':!![]});var _0x14b006='IvrCampaigns';return db[_0xe301('0x50')][_0xe301('0x49')]({'where':{'name':_0x14b006,'userProfileId':_0x525ebf[_0xe301('0x51')]},'raw':!![]})[_0xe301('0x26')](function(_0x9a81c1){if(_0x9a81c1&&_0x9a81c1['autoAssociation']===0x0){return db[_0xe301('0x29')][_0xe301('0x4a')]({'name':_0x4ec53a[_0xe301('0x2b')],'resourceId':_0x4ec53a['id'],'type':_0x9a81c1[_0xe301('0x2b')],'sectionId':_0x9a81c1['id']},{})[_0xe301('0x26')](function(){return _0x6e46ba;});}else{return _0x6e46ba;}})[_0xe301('0x46')](function(_0x326eea){logger['error'](_0xe301('0x52'),_0x326eea);throw _0x326eea;});}return _0x6e46ba;})[_0xe301('0x26')](respondWithResult(_0x3ae24c,0xc9))[_0xe301('0x46')](handleError(_0x3ae24c,null));};exports[_0xe301('0x53')]=function(_0x485015,_0x375f34){var _0x5eabac={'where':{'id':_0x485015[_0xe301('0x48')]['id']}},_0x3ea172={};_0x3ea172[_0xe301('0x31')]=_[_0xe301('0x33')](db[_0xe301('0x2e')]['rawAttributes']);_0x5eabac[_0xe301('0x36')]=_[_0xe301('0x35')](_0x3ea172['model'],qs[_0xe301('0x37')](_0x485015['query']['fields']));_0x5eabac[_0xe301('0x36')]=_0x5eabac['attributes']['length']?_0x5eabac['attributes']:_0x3ea172['model'];if(_0x485015[_0xe301('0x32')][_0xe301('0x44')]){_0x5eabac[_0xe301('0x45')]=[{'all':!![]}];}_0x5eabac=_[_0xe301('0x40')]({},_0x5eabac,_0x485015['options']);return db['Campaign'][_0xe301('0x49')](_0x5eabac)[_0xe301('0x26')](handleEntityNotFound(_0x375f34,null))[_0xe301('0x26')](function(_0x5aa494){if(_0x5aa494){var _0x4dba2c=_0x5aa494[_0xe301('0x4d')]({'plain':!![]});_0x4dba2c=qs[_0xe301('0x54')](_0x4dba2c,['id','createdAt',_0xe301('0x55')]);_0x485015[_0xe301('0x4b')]=_['omit'](_0x485015['body'],['id',_0xe301('0x56'),_0xe301('0x55')]);return db['Campaign'][_0xe301('0x4a')](_[_0xe301('0x40')](_0x4dba2c,_0x485015[_0xe301('0x4b')]),{'include':_0x485015['query'][_0xe301('0x44')]?[{'all':!![]}]:undefined})[_0xe301('0x26')](function(_0x9a3600){var _0x3050d7=_0x485015[_0xe301('0x4c')][_0xe301('0x4d')]({'plain':!![]});if(!_0x3050d7)throw new Error(_0xe301('0x4e'));if(_0x3050d7[_0xe301('0x4f')]==='user'){var _0x5cdd9a=_0x9a3600[_0xe301('0x4d')]({'plain':!![]});var _0x4d365f=_0xe301('0x28');return db[_0xe301('0x50')][_0xe301('0x49')]({'where':{'name':_0x4d365f,'userProfileId':_0x3050d7[_0xe301('0x51')]},'raw':!![]})[_0xe301('0x26')](function(_0x45ff14){if(_0x45ff14&&_0x45ff14[_0xe301('0x57')]===0x0){return db[_0xe301('0x29')][_0xe301('0x4a')]({'name':_0x5cdd9a[_0xe301('0x2b')],'resourceId':_0x5cdd9a['id'],'type':_0x45ff14['name'],'sectionId':_0x45ff14['id']},{})[_0xe301('0x26')](function(){return _0x9a3600;});}else{return _0x9a3600;}})[_0xe301('0x46')](function(_0x536367){logger['error'](_0xe301('0x52'),_0x536367);throw _0x536367;});}return _0x9a3600;});}})['then'](respondWithResult(_0x375f34,0xc9))[_0xe301('0x46')](handleError(_0x375f34,null));};exports[_0xe301('0x25')]=function(_0xfa6a10,_0x471ae8){if(_0xfa6a10[_0xe301('0x4b')]['id']){delete _0xfa6a10[_0xe301('0x4b')]['id'];}return db[_0xe301('0x2e')]['find']({'where':{'id':_0xfa6a10[_0xe301('0x48')]['id']}})[_0xe301('0x26')](handleEntityNotFound(_0x471ae8,null))['then'](saveUpdates(_0xfa6a10[_0xe301('0x4b')],null))[_0xe301('0x26')](respondWithResult(_0x471ae8,null))['catch'](handleError(_0x471ae8,null));};exports[_0xe301('0x27')]=function(_0x51fab4,_0x4a96cb){return db['Campaign'][_0xe301('0x49')]({'where':{'id':_0x51fab4[_0xe301('0x48')]['id']}})[_0xe301('0x26')](handleEntityNotFound(_0x4a96cb,null))[_0xe301('0x26')](removeEntity(_0x4a96cb,null))[_0xe301('0x46')](handleError(_0x4a96cb,null));};exports[_0xe301('0x58')]=function(_0x74ea35,_0x1e1719,_0x3a5a1a){var _0x4cb2b5={'raw':!![],'where':{}};var _0x199a53={};var _0x3ab901={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x74ea35['params']['id']}})[_0xe301('0x26')](handleEntityNotFound(_0x1e1719,null))[_0xe301('0x26')](function(_0x3b3fe8){if(_0x3b3fe8){_0x199a53[_0xe301('0x31')]=_[_0xe301('0x33')](db[_0xe301('0x59')][_0xe301('0x2f')]);_0x199a53[_0xe301('0x32')]=_[_0xe301('0x33')](_0x74ea35[_0xe301('0x32')]);_0x199a53[_0xe301('0x34')]=_[_0xe301('0x35')](_0x199a53[_0xe301('0x31')],_0x199a53[_0xe301('0x32')]);_0x4cb2b5['attributes']=_[_0xe301('0x35')](_0x199a53[_0xe301('0x31')],qs['fields'](_0x74ea35[_0xe301('0x32')]['fields']));_0x4cb2b5[_0xe301('0x36')]=_0x4cb2b5['attributes'][_0xe301('0x38')]?_0x4cb2b5[_0xe301('0x36')]:_0x199a53['model'];if(!_0x74ea35['query'][_0xe301('0x39')](_0xe301('0x3a'))){_0x4cb2b5[_0xe301('0x1f')]=qs[_0xe301('0x1f')](_0x74ea35[_0xe301('0x32')]['limit']);_0x4cb2b5['offset']=qs[_0xe301('0x21')](_0x74ea35[_0xe301('0x32')]['offset']);}_0x4cb2b5['order']=qs[_0xe301('0x3c')](_0x74ea35[_0xe301('0x32')][_0xe301('0x3c')]);_0x4cb2b5[_0xe301('0x3d')]=qs[_0xe301('0x34')](_[_0xe301('0x3e')](_0x74ea35[_0xe301('0x32')],_0x199a53[_0xe301('0x34')]));_0x4cb2b5['where'][_0xe301('0x5a')]=_0x3b3fe8['id'];if(_0x74ea35[_0xe301('0x32')][_0xe301('0x3f')]){_0x4cb2b5['where']=_[_0xe301('0x40')](_0x4cb2b5[_0xe301('0x3d')],{'$or':_[_0xe301('0x2d')](_0x4cb2b5[_0xe301('0x36')],function(_0x36b09b){var _0x1e663f={};_0x1e663f[_0x36b09b]={'$like':'%'+_0x74ea35[_0xe301('0x32')][_0xe301('0x3f')]+'%'};return _0x1e663f;})});}_0x4cb2b5=_['merge']({},_0x4cb2b5,_0x74ea35['options']);return db[_0xe301('0x59')][_0xe301('0x20')]({'where':_0x4cb2b5[_0xe301('0x3d')]})[_0xe301('0x26')](function(_0xb9f930){_0x3ab901[_0xe301('0x20')]=_0xb9f930;if(_0x74ea35[_0xe301('0x32')][_0xe301('0x44')]){_0x4cb2b5['include']=[{'all':!![]}];}return db[_0xe301('0x59')][_0xe301('0x5b')](_0x4cb2b5);})[_0xe301('0x26')](function(_0x278e2b){_0x3ab901[_0xe301('0x5c')]=_0x278e2b;return _0x3ab901;});}})[_0xe301('0x26')](respondWithFilteredResult(_0x1e1719,_0x4cb2b5))[_0xe301('0x46')](handleError(_0x1e1719,null));};exports[_0xe301('0x5d')]=function(_0x452a63,_0x2799e8,_0xe09cef){var _0x31a79d={'raw':!![],'where':{}};var _0x40777b={};var _0x4364fe={'count':0x0,'rows':[]};return db[_0xe301('0x2e')][_0xe301('0x5e')]({'where':{'id':_0x452a63['params']['id']}})[_0xe301('0x26')](handleEntityNotFound(_0x2799e8,null))['then'](function(_0x29406d){if(_0x29406d){_0x40777b[_0xe301('0x31')]=_[_0xe301('0x33')](db[_0xe301('0x5f')]['rawAttributes']);_0x40777b[_0xe301('0x32')]=_['keys'](_0x452a63['query']);_0x40777b[_0xe301('0x34')]=_['intersection'](_0x40777b['model'],_0x40777b[_0xe301('0x32')]);_0x31a79d['attributes']=_[_0xe301('0x35')](_0x40777b[_0xe301('0x31')],qs[_0xe301('0x37')](_0x452a63[_0xe301('0x32')][_0xe301('0x37')]));_0x31a79d['attributes']=_0x31a79d['attributes'][_0xe301('0x38')]?_0x31a79d['attributes']:_0x40777b[_0xe301('0x31')];if(!_0x452a63['query'][_0xe301('0x39')]('nolimit')){_0x31a79d['limit']=qs[_0xe301('0x1f')](_0x452a63[_0xe301('0x32')]['limit']);_0x31a79d[_0xe301('0x21')]=qs[_0xe301('0x21')](_0x452a63['query'][_0xe301('0x21')]);}_0x31a79d[_0xe301('0x3b')]=qs[_0xe301('0x3c')](_0x452a63['query'][_0xe301('0x3c')]);_0x31a79d[_0xe301('0x3d')]=qs[_0xe301('0x34')](_['pick'](_0x452a63[_0xe301('0x32')],_0x40777b['filters']));_0x31a79d[_0xe301('0x3d')]['CampaignId']=_0x29406d['id'];if(_0x452a63[_0xe301('0x32')][_0xe301('0x3f')]){_0x31a79d['where']=_[_0xe301('0x40')](_0x31a79d[_0xe301('0x3d')],{'$or':_[_0xe301('0x2d')](_0x31a79d[_0xe301('0x36')],function(_0x2d8a5){var _0x5d1342={};_0x5d1342[_0x2d8a5]={'$like':'%'+_0x452a63[_0xe301('0x32')]['filter']+'%'};return _0x5d1342;})});}_0x31a79d=_[_0xe301('0x40')]({},_0x31a79d,_0x452a63[_0xe301('0x43')]);return db[_0xe301('0x5f')][_0xe301('0x20')]({'where':_0x31a79d['where']})[_0xe301('0x26')](function(_0x27bb65){_0x4364fe[_0xe301('0x20')]=_0x27bb65;if(_0x452a63[_0xe301('0x32')][_0xe301('0x44')]){_0x31a79d['include']=[{'all':!![]}];}return db[_0xe301('0x5f')][_0xe301('0x5b')](_0x31a79d);})[_0xe301('0x26')](function(_0x594422){_0x4364fe[_0xe301('0x5c')]=_0x594422;return _0x4364fe;});}})[_0xe301('0x26')](respondWithFilteredResult(_0x2799e8,_0x31a79d))[_0xe301('0x46')](handleError(_0x2799e8,null));};exports[_0xe301('0x60')]=function(_0x13d15c,_0x60c389,_0x2b22e8){var _0x25f2b4={'raw':!![],'where':{}};var _0x315b92={};var _0x413865={'count':0x0,'rows':[]};return db[_0xe301('0x2e')][_0xe301('0x5e')]({'where':{'id':_0x13d15c[_0xe301('0x48')]['id']}})['then'](handleEntityNotFound(_0x60c389,null))[_0xe301('0x26')](function(_0x43d7ae){if(_0x43d7ae){_0x315b92[_0xe301('0x31')]=_[_0xe301('0x33')](db[_0xe301('0x61')]['rawAttributes']);_0x315b92['query']=_[_0xe301('0x33')](_0x13d15c[_0xe301('0x32')]);_0x315b92[_0xe301('0x34')]=_[_0xe301('0x35')](_0x315b92[_0xe301('0x31')],_0x315b92[_0xe301('0x32')]);_0x25f2b4[_0xe301('0x36')]=_[_0xe301('0x35')](_0x315b92['model'],qs[_0xe301('0x37')](_0x13d15c[_0xe301('0x32')][_0xe301('0x37')]));_0x25f2b4['attributes']=_0x25f2b4['attributes'][_0xe301('0x38')]?_0x25f2b4[_0xe301('0x36')]:_0x315b92['model'];if(!_0x13d15c['query']['hasOwnProperty'](_0xe301('0x3a'))){_0x25f2b4[_0xe301('0x1f')]=qs[_0xe301('0x1f')](_0x13d15c[_0xe301('0x32')][_0xe301('0x1f')]);_0x25f2b4[_0xe301('0x21')]=qs[_0xe301('0x21')](_0x13d15c[_0xe301('0x32')][_0xe301('0x21')]);}_0x25f2b4[_0xe301('0x3b')]=qs[_0xe301('0x3c')](_0x13d15c[_0xe301('0x32')]['sort']);_0x25f2b4[_0xe301('0x3d')]=qs[_0xe301('0x34')](_[_0xe301('0x3e')](_0x13d15c[_0xe301('0x32')],_0x315b92[_0xe301('0x34')]));_0x25f2b4[_0xe301('0x3d')][_0xe301('0x5a')]=_0x43d7ae['id'];if(_0x13d15c['query']['filter']){_0x25f2b4[_0xe301('0x3d')]=_['merge'](_0x25f2b4[_0xe301('0x3d')],{'$or':_[_0xe301('0x2d')](_0x25f2b4[_0xe301('0x36')],function(_0x5fe076){var _0x11b481={};_0x11b481[_0x5fe076]={'$like':'%'+_0x13d15c[_0xe301('0x32')]['filter']+'%'};return _0x11b481;})});}_0x25f2b4=_['merge']({},_0x25f2b4,_0x13d15c[_0xe301('0x43')]);return db['CmHopperFinal'][_0xe301('0x20')]({'where':_0x25f2b4[_0xe301('0x3d')]})[_0xe301('0x26')](function(_0xd5d948){_0x413865[_0xe301('0x20')]=_0xd5d948;if(_0x13d15c[_0xe301('0x32')][_0xe301('0x44')]){_0x25f2b4[_0xe301('0x45')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x25f2b4);})[_0xe301('0x26')](function(_0x568008){_0x413865[_0xe301('0x5c')]=_0x568008;return _0x413865;});}})['then'](respondWithFilteredResult(_0x60c389,_0x25f2b4))[_0xe301('0x46')](handleError(_0x60c389,null));};exports[_0xe301('0x62')]=function(_0x24f75c,_0x1a0e4b,_0x21d73a){var _0x507460={'raw':!![],'where':{}};var _0x3a09b9={};var _0x5ccebc={'count':0x0,'rows':[]};return db[_0xe301('0x2e')][_0xe301('0x5e')]({'where':{'id':_0x24f75c[_0xe301('0x48')]['id']}})[_0xe301('0x26')](handleEntityNotFound(_0x1a0e4b,null))[_0xe301('0x26')](function(_0x493795){if(_0x493795){_0x3a09b9[_0xe301('0x31')]=_['keys'](db[_0xe301('0x63')][_0xe301('0x2f')]);_0x3a09b9[_0xe301('0x32')]=_[_0xe301('0x33')](_0x24f75c['query']);_0x3a09b9['filters']=_['intersection'](_0x3a09b9[_0xe301('0x31')],_0x3a09b9[_0xe301('0x32')]);_0x507460[_0xe301('0x36')]=_['intersection'](_0x3a09b9[_0xe301('0x31')],qs[_0xe301('0x37')](_0x24f75c[_0xe301('0x32')]['fields']));_0x507460['attributes']=_0x507460[_0xe301('0x36')][_0xe301('0x38')]?_0x507460[_0xe301('0x36')]:_0x3a09b9['model'];if(!_0x24f75c[_0xe301('0x32')][_0xe301('0x39')](_0xe301('0x3a'))){_0x507460['limit']=qs[_0xe301('0x1f')](_0x24f75c[_0xe301('0x32')][_0xe301('0x1f')]);_0x507460[_0xe301('0x21')]=qs[_0xe301('0x21')](_0x24f75c[_0xe301('0x32')]['offset']);}_0x507460[_0xe301('0x3b')]=qs[_0xe301('0x3c')](_0x24f75c[_0xe301('0x32')][_0xe301('0x3c')]);_0x507460[_0xe301('0x3d')]=qs['filters'](_['pick'](_0x24f75c['query'],_0x3a09b9[_0xe301('0x34')]));_0x507460[_0xe301('0x3d')][_0xe301('0x5a')]=_0x493795['id'];if(_0x24f75c['query']['filter']){_0x507460[_0xe301('0x3d')]=_[_0xe301('0x40')](_0x507460[_0xe301('0x3d')],{'$or':_[_0xe301('0x2d')](_0x507460[_0xe301('0x36')],function(_0x1a163f){var _0x5219fd={};_0x5219fd[_0x1a163f]={'$like':'%'+_0x24f75c[_0xe301('0x32')][_0xe301('0x3f')]+'%'};return _0x5219fd;})});}_0x507460=_[_0xe301('0x40')]({},_0x507460,_0x24f75c[_0xe301('0x43')]);return db['CmHopperBlack']['count']({'where':_0x507460[_0xe301('0x3d')]})[_0xe301('0x26')](function(_0x5686d0){_0x5ccebc[_0xe301('0x20')]=_0x5686d0;if(_0x24f75c['query'][_0xe301('0x44')]){_0x507460[_0xe301('0x45')]=[{'all':!![]}];}return db[_0xe301('0x63')][_0xe301('0x5b')](_0x507460);})[_0xe301('0x26')](function(_0x10cae9){_0x5ccebc[_0xe301('0x5c')]=_0x10cae9;return _0x5ccebc;});}})['then'](respondWithFilteredResult(_0x1a0e4b,_0x507460))[_0xe301('0x46')](handleError(_0x1a0e4b,null));};exports[_0xe301('0x64')]=function(_0x8622ae,_0x405bcb,_0x5de860){var _0x16af45={};var _0x1872b2={};var _0xa45a35;var _0x56437c;return db[_0xe301('0x2e')]['findOne']({'where':{'id':_0x8622ae['params']['id']}})[_0xe301('0x26')](handleEntityNotFound(_0x405bcb,null))[_0xe301('0x26')](function(_0x17b31d){if(_0x17b31d){_0xa45a35=_0x17b31d;_0x1872b2['model']=_[_0xe301('0x33')](db[_0xe301('0x65')][_0xe301('0x2f')]);_0x1872b2['query']=_[_0xe301('0x33')](_0x8622ae[_0xe301('0x32')]);_0x1872b2[_0xe301('0x34')]=_[_0xe301('0x35')](_0x1872b2[_0xe301('0x31')],_0x1872b2[_0xe301('0x32')]);_0x16af45['attributes']=_[_0xe301('0x35')](_0x1872b2['model'],qs[_0xe301('0x37')](_0x8622ae['query']['fields']));_0x16af45['attributes']=_0x16af45[_0xe301('0x36')]['length']?_0x16af45[_0xe301('0x36')]:_0x1872b2['model'];_0x16af45[_0xe301('0x3b')]=qs[_0xe301('0x3c')](_0x8622ae[_0xe301('0x32')][_0xe301('0x3c')]);_0x16af45[_0xe301('0x3d')]=qs[_0xe301('0x34')](_[_0xe301('0x3e')](_0x8622ae[_0xe301('0x32')],_0x1872b2['filters']));if(_0x8622ae[_0xe301('0x32')][_0xe301('0x3f')]){_0x16af45['where']=_['merge'](_0x16af45['where'],{'$or':_[_0xe301('0x2d')](_0x16af45[_0xe301('0x36')],function(_0x550445){var _0x4de898={};_0x4de898[_0x550445]={'$like':'%'+_0x8622ae['query'][_0xe301('0x3f')]+'%'};return _0x4de898;})});}_0x16af45=_[_0xe301('0x40')]({},_0x16af45,_0x8622ae[_0xe301('0x43')]);return _0xa45a35['getLists'](_0x16af45);}})[_0xe301('0x26')](function(_0x518cd4){if(_0x518cd4){_0x56437c=_0x518cd4[_0xe301('0x38')];if(!_0x8622ae[_0xe301('0x32')][_0xe301('0x39')](_0xe301('0x3a'))){_0x16af45[_0xe301('0x1f')]=qs['limit'](_0x8622ae[_0xe301('0x32')]['limit']);_0x16af45[_0xe301('0x21')]=qs[_0xe301('0x21')](_0x8622ae[_0xe301('0x32')][_0xe301('0x21')]);}return _0xa45a35[_0xe301('0x64')](_0x16af45);}})['then'](function(_0x331b39){if(_0x331b39){return _0x331b39?{'count':_0x56437c,'rows':_0x331b39}:null;}})['then'](respondWithResult(_0x405bcb,null))[_0xe301('0x46')](handleError(_0x405bcb,null));};exports[_0xe301('0x66')]=function(_0x1c35b6,_0x12f79b,_0x1316f0){var _0x2fcdd9,_0x3a7458;var _0x17f00e=[];var _0x1cfdfa=moment()['format'](_0xe301('0x67'));return db[_0xe301('0x2e')][_0xe301('0x49')]({'where':{'id':_0x1c35b6[_0xe301('0x48')]['id']}})[_0xe301('0x26')](handleEntityNotFound(_0x12f79b,null))['then'](function(_0x18f135){if(_0x18f135){_0x3a7458=_0x18f135;return _0x18f135['addLists'](_0x1c35b6[_0xe301('0x4b')]['ids'],_[_0xe301('0x54')](_0x1c35b6[_0xe301('0x4b')],[_0xe301('0x68'),'id'])||{});}return null;})[_0xe301('0x69')](function(_0xd7a2f7){var _0x150ef2;var _0x36d52a;_0x2fcdd9=_0xd7a2f7||[];var _0xecc418=[];if(_0xd7a2f7){for(var _0x3ef2fb=0x0;_0x3ef2fb<_0xd7a2f7[_0xe301('0x38')];_0x3ef2fb+=0x1){var _0x41996c=_0xd7a2f7[_0x3ef2fb][_0xe301('0x4d')]({'plain':!![]});_0x3a7458['dialCheckDuplicateType']=_0x1c35b6[_0xe301('0x4b')][_0xe301('0x6a')]?_0x1c35b6['body'][_0xe301('0x6a')]:_0x3a7458[_0xe301('0x6a')];switch(_0x3a7458[_0xe301('0x6a')]){case _0xe301('0x6b'):_0x150ef2=squel[_0xe301('0x6c')]()[_0xe301('0x6d')](_0xe301('0x6e'))[_0xe301('0x6f')]([_0xe301('0x70'),_0xe301('0x71'),'ContactId','ListId',_0xe301('0x5a'),'createdAt',_0xe301('0x55')],squel[_0xe301('0x72')]()['field'](_0xe301('0x70'),_0xe301('0x70'))[_0xe301('0x73')](_0xe301('0x74'),'scheduledAt')[_0xe301('0x73')]('id',_0xe301('0x75'))[_0xe301('0x73')](_0x41996c[_0xe301('0x76')]['toString'](),_0xe301('0x77'))[_0xe301('0x73')](_0x1c35b6[_0xe301('0x48')]['id']['toString'](),_0xe301('0x5a'))[_0xe301('0x73')]('\x27'+_0x1cfdfa+'\x27',_0xe301('0x56'))['field']('\x27'+_0x1cfdfa+'\x27',_0xe301('0x55'))[_0xe301('0x78')](_0xe301('0x79'))[_0xe301('0x3d')](_0xe301('0x7a'))[_0xe301('0x3d')]('ListId\x20=\x20?',_0x41996c[_0xe301('0x76')]['toString']())[_0xe301('0x3d')](_0xe301('0x7b'))[_0xe301('0x3d')](_0xe301('0x7c'),squel['select']()[_0xe301('0x73')](_0xe301('0x7d'))[_0xe301('0x78')](_0xe301('0x7e'))[_0xe301('0x3d')](_0xe301('0x7f'),_0x1c35b6['params']['id'][_0xe301('0x80')]()))['where'](_0xe301('0x7c'),squel[_0xe301('0x72')]()[_0xe301('0x73')](_0xe301('0x81'))[_0xe301('0x78')](_0xe301('0x6e'))['where'](_0xe301('0x7f'),_0x1c35b6[_0xe301('0x48')]['id']['toString']())))[_0xe301('0x80')]();break;case'onlyIfOpen':_0x150ef2=squel[_0xe301('0x6c')]()['into'](_0xe301('0x6e'))[_0xe301('0x6f')](['phone',_0xe301('0x71'),_0xe301('0x75'),'ListId','CampaignId','createdAt',_0xe301('0x55')],squel['select']()[_0xe301('0x73')]('phone','phone')[_0xe301('0x73')]('NOW()',_0xe301('0x71'))[_0xe301('0x73')]('id',_0xe301('0x75'))['field'](_0x41996c[_0xe301('0x76')]['toString'](),_0xe301('0x77'))[_0xe301('0x73')](_0x1c35b6[_0xe301('0x48')]['id'][_0xe301('0x80')](),_0xe301('0x5a'))[_0xe301('0x73')]('\x27'+_0x1cfdfa+'\x27','createdAt')[_0xe301('0x73')]('\x27'+_0x1cfdfa+'\x27','updatedAt')['from'](_0xe301('0x79'))[_0xe301('0x3d')](_0xe301('0x7a'))['where'](_0xe301('0x82'),_0x41996c[_0xe301('0x76')]['toString']())[_0xe301('0x3d')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xe301('0x7c'),squel['select']()['field'](_0xe301('0x81'))[_0xe301('0x78')]('cm_hopper')[_0xe301('0x3d')](_0xe301('0x7f'),_0x1c35b6[_0xe301('0x48')]['id'][_0xe301('0x80')]())))[_0xe301('0x80')]();break;default:_0x150ef2=squel[_0xe301('0x6c')]()[_0xe301('0x6d')]('cm_hopper')['fromQuery'](['phone',_0xe301('0x71'),_0xe301('0x75'),_0xe301('0x77'),_0xe301('0x5a'),_0xe301('0x56'),_0xe301('0x55')],squel[_0xe301('0x72')]()[_0xe301('0x73')](_0xe301('0x70'),_0xe301('0x70'))[_0xe301('0x73')](_0xe301('0x74'),'scheduledAt')['field']('id','ContactId')[_0xe301('0x73')](_0x41996c[_0xe301('0x76')]['toString'](),_0xe301('0x77'))[_0xe301('0x73')](_0x1c35b6['params']['id'][_0xe301('0x80')](),_0xe301('0x5a'))['field']('\x27'+_0x1cfdfa+'\x27',_0xe301('0x56'))[_0xe301('0x73')]('\x27'+_0x1cfdfa+'\x27','updatedAt')[_0xe301('0x78')]('cm_contacts')[_0xe301('0x3d')](_0xe301('0x7a'))[_0xe301('0x3d')](_0xe301('0x82'),_0x41996c['CmListId'][_0xe301('0x80')]())['where'](_0xe301('0x7b')))['toString']();}_0x36d52a=squel[_0xe301('0x6c')]()[_0xe301('0x6d')](_0xe301('0x83'))['fromQuery']([_0xe301('0x84'),_0xe301('0x71'),_0xe301('0x70'),_0xe301('0x85'),_0xe301('0x56'),_0xe301('0x55')],squel[_0xe301('0x72')]()[_0xe301('0x73')](_0xe301('0x86'),'id')[_0xe301('0x73')](_0xe301('0x74'),'scheduledAt')['field'](_0xe301('0x87'),_0xe301('0x70'))['field'](_0xe301('0x88'),'OrderBy')[_0xe301('0x73')]('\x27'+_0x1cfdfa+'\x27',_0xe301('0x56'))['field']('\x27'+_0x1cfdfa+'\x27',_0xe301('0x55'))[_0xe301('0x78')](_0xe301('0x89'),'ci')[_0xe301('0x8a')](_0xe301('0x6e'),'h',_0xe301('0x8b'))[_0xe301('0x3d')](_0xe301('0x8c'),_0x41996c[_0xe301('0x76')][_0xe301('0x80')]())[_0xe301('0x3d')](_0xe301('0x8d'),_0x1c35b6[_0xe301('0x48')]['id'][_0xe301('0x80')]())[_0xe301('0x3d')](_0xe301('0x8e'),_0x1cfdfa))[_0xe301('0x80')]();_0xecc418[_0xe301('0x8f')](db[_0xe301('0x90')][_0xe301('0x32')](_0x150ef2));_0x17f00e[_0xe301('0x8f')](db[_0xe301('0x90')]['query'](_0x36d52a));}return BPromise['all'](_0xecc418);}})[_0xe301('0x26')](function(){return BPromise[_0xe301('0x91')](_0x17f00e);})['then'](function(){return _0x2fcdd9;})['then'](respondWithResult(_0x12f79b,null))[_0xe301('0x46')](handleError(_0x12f79b,null));};exports[_0xe301('0x92')]=function(_0x1d05af,_0x4a3de4,_0x584f0b){return db[_0xe301('0x2e')]['find']({'where':{'id':_0x1d05af['params']['id']}})[_0xe301('0x26')](handleEntityNotFound(_0x4a3de4,null))[_0xe301('0x26')](function(_0x2f3e08){if(_0x2f3e08){return _0x2f3e08['removeLists'](_0x1d05af['query'][_0xe301('0x68')]);}})[_0xe301('0x26')](function(_0x27acc5){if(_0x27acc5){return db['CmHopper']['destroy']({'where':{'ListId':_0x1d05af[_0xe301('0x32')][_0xe301('0x68')],'CampaignId':_0x1d05af[_0xe301('0x48')]['id']}})[_0xe301('0x26')](function(){return _0x27acc5;});}})['then'](respondWithStatusCode(_0x4a3de4,null))[_0xe301('0x46')](handleError(_0x4a3de4,null));};exports[_0xe301('0x93')]=function(_0x56d660,_0x27e423,_0x504938){var _0x516914={};var _0xfa470a={};var _0xa1e70b;var _0x25816c;return db[_0xe301('0x2e')][_0xe301('0x5e')]({'where':{'id':_0x56d660['params']['id']}})[_0xe301('0x26')](handleEntityNotFound(_0x27e423,null))['then'](function(_0xce54af){if(_0xce54af){_0xa1e70b=_0xce54af;_0xfa470a[_0xe301('0x31')]=_['keys'](db[_0xe301('0x65')][_0xe301('0x2f')]);_0xfa470a[_0xe301('0x32')]=_[_0xe301('0x33')](_0x56d660[_0xe301('0x32')]);_0xfa470a[_0xe301('0x34')]=_[_0xe301('0x35')](_0xfa470a[_0xe301('0x31')],_0xfa470a[_0xe301('0x32')]);_0x516914[_0xe301('0x36')]=_['intersection'](_0xfa470a[_0xe301('0x31')],qs[_0xe301('0x37')](_0x56d660[_0xe301('0x32')][_0xe301('0x37')]));_0x516914[_0xe301('0x36')]=_0x516914[_0xe301('0x36')]['length']?_0x516914[_0xe301('0x36')]:_0xfa470a[_0xe301('0x31')];_0x516914['order']=qs[_0xe301('0x3c')](_0x56d660[_0xe301('0x32')]['sort']);_0x516914['where']=qs[_0xe301('0x34')](_[_0xe301('0x3e')](_0x56d660[_0xe301('0x32')],_0xfa470a[_0xe301('0x34')]));if(_0x56d660[_0xe301('0x32')][_0xe301('0x3f')]){_0x516914[_0xe301('0x3d')]=_[_0xe301('0x40')](_0x516914[_0xe301('0x3d')],{'$or':_['map'](_0x516914[_0xe301('0x36')],function(_0x2f408c){var _0x288397={};_0x288397[_0x2f408c]={'$like':'%'+_0x56d660['query'][_0xe301('0x3f')]+'%'};return _0x288397;})});}_0x516914=_['merge']({},_0x516914,_0x56d660[_0xe301('0x43')]);return _0xa1e70b['getBlackLists'](_0x516914);}})[_0xe301('0x26')](function(_0x2b7bcb){if(_0x2b7bcb){_0x25816c=_0x2b7bcb[_0xe301('0x38')];if(!_0x56d660[_0xe301('0x32')][_0xe301('0x39')]('nolimit')){_0x516914[_0xe301('0x1f')]=qs[_0xe301('0x1f')](_0x56d660[_0xe301('0x32')]['limit']);_0x516914['offset']=qs['offset'](_0x56d660['query'][_0xe301('0x21')]);}return _0xa1e70b[_0xe301('0x93')](_0x516914);}})['then'](function(_0x1ec2ec){if(_0x1ec2ec){return _0x1ec2ec?{'count':_0x25816c,'rows':_0x1ec2ec}:null;}})[_0xe301('0x26')](respondWithResult(_0x27e423,null))[_0xe301('0x46')](handleError(_0x27e423,null));};exports[_0xe301('0x94')]=function(_0x5bfec2,_0x584168,_0x1adf05){var _0x5bc019,_0xbfe3bd;var _0x2e351c=[];var _0x11bfb6=moment()[_0xe301('0x95')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xe301('0x2e')]['find']({'where':{'id':_0x5bfec2[_0xe301('0x48')]['id']}})[_0xe301('0x26')](handleEntityNotFound(_0x584168,null))[_0xe301('0x26')](function(_0x57748d){if(_0x57748d){_0xbfe3bd=_0x57748d;return _0x57748d[_0xe301('0x94')](_0x5bfec2['body'][_0xe301('0x68')],_[_0xe301('0x54')](_0x5bfec2[_0xe301('0x4b')],[_0xe301('0x68'),'id'])||{});}return null;})[_0xe301('0x69')](function(_0x1a9644){var _0x5eab32;var _0x4e94d6;_0x5bc019=_0x1a9644||[];var _0x5863bf=[];if(_0x1a9644){for(var _0x431536=0x0;_0x431536<_0x1a9644[_0xe301('0x38')];_0x431536+=0x1){var _0x4bb05e=_0x1a9644[_0x431536][_0xe301('0x4d')]({'plain':!![]});_0x5eab32=squel[_0xe301('0x6c')]()[_0xe301('0x6d')](_0xe301('0x96'))[_0xe301('0x6f')](['phone','ContactId',_0xe301('0x77'),_0xe301('0x5a'),'createdAt','updatedAt'],squel[_0xe301('0x72')]()[_0xe301('0x73')]('phone','phone')['field']('id',_0xe301('0x75'))[_0xe301('0x73')](_0x4bb05e[_0xe301('0x76')][_0xe301('0x80')](),_0xe301('0x77'))[_0xe301('0x73')](_0x5bfec2[_0xe301('0x48')]['id']['toString'](),'CampaignId')[_0xe301('0x73')](_0xe301('0x74'),_0xe301('0x56'))[_0xe301('0x73')]('NOW()','updatedAt')[_0xe301('0x78')](_0xe301('0x79'))['where']('deletedAt\x20IS\x20NULL')[_0xe301('0x3d')](_0xe301('0x82'),_0x4bb05e['CmListId'][_0xe301('0x80')]())[_0xe301('0x3d')](_0xe301('0x7b')))['toString']();_0x5863bf[_0xe301('0x8f')](db[_0xe301('0x90')]['query'](_0x5eab32));}return BPromise[_0xe301('0x91')](_0x5863bf);}})['then'](function(){return _0x5bc019;})[_0xe301('0x26')](respondWithResult(_0x584168,null))[_0xe301('0x46')](handleError(_0x584168,null));};exports[_0xe301('0x97')]=function(_0x28dc58,_0x1cfc9f,_0x1972d0){return db[_0xe301('0x2e')][_0xe301('0x49')]({'where':{'id':_0x28dc58[_0xe301('0x48')]['id']}})['then'](handleEntityNotFound(_0x1cfc9f,null))[_0xe301('0x26')](function(_0x412fb7){if(_0x412fb7){return _0x412fb7[_0xe301('0x97')](_0x28dc58[_0xe301('0x32')][_0xe301('0x68')]);}})[_0xe301('0x26')](function(_0x17d3cf){if(_0x17d3cf){return db[_0xe301('0x63')]['destroy']({'where':{'ListId':_0x28dc58[_0xe301('0x32')]['ids'],'CampaignId':_0x28dc58['params']['id']}})[_0xe301('0x26')](function(){return _0x17d3cf;});}})[_0xe301('0x26')](respondWithStatusCode(_0x1cfc9f,null))[_0xe301('0x46')](handleError(_0x1cfc9f,null));};
\ No newline at end of file
+var _0x959e=['fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','deletedAt\x20IS\x20NULL','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count','offset','set','Content-Range','apply','save','update','IvrCampaigns','UserProfileResource','then','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','destroy','getHoppers','findOne','CmHopper','nolimit','pick','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','into'];(function(_0x5d96ee,_0x523278){var _0x39092b=function(_0x4ae30b){while(--_0x4ae30b){_0x5d96ee['push'](_0x5d96ee['shift']());}};_0x39092b(++_0x523278);}(_0x959e,0x1e2));var _0xe959=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0x959e[_0xa60623];return _0x4a6487;};'use strict';var emlformat=require(_0xe959('0x0'));var rimraf=require(_0xe959('0x1'));var zipdir=require(_0xe959('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe959('0x3'));var moment=require(_0xe959('0x4'));var BPromise=require(_0xe959('0x5'));var Mustache=require(_0xe959('0x6'));var util=require(_0xe959('0x7'));var path=require(_0xe959('0x8'));var sox=require('sox');var csv=require(_0xe959('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe959('0xa'));var _=require(_0xe959('0xb'));var squel=require(_0xe959('0xc'));var crypto=require(_0xe959('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe959('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe959('0xe'));var authService=require(_0xe959('0xf'));var qs=require(_0xe959('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe959('0x11'));var logger=require(_0xe959('0x12'))(_0xe959('0x13'));var utils=require('../../config/utils');var config=require(_0xe959('0x14'));var licenseUtil=require(_0xe959('0x15'));var db=require(_0xe959('0x16'))['db'];function respondWithStatusCode(_0x3deca7,_0x1fa963){_0x1fa963=_0x1fa963||0xcc;return function(_0x5c7a12){if(_0x5c7a12){return _0x3deca7[_0xe959('0x17')](_0x1fa963);}return _0x3deca7['status'](_0x1fa963)[_0xe959('0x18')]();};}function respondWithResult(_0x5bd09e,_0x468f60){_0x468f60=_0x468f60||0xc8;return function(_0x2e68f7){if(_0x2e68f7){return _0x5bd09e[_0xe959('0x19')](_0x468f60)[_0xe959('0x1a')](_0x2e68f7);}};}function respondWithFilteredResult(_0x16a8da,_0x3bd45f){return function(_0x16835a){if(_0x16835a){var _0x48cc78=typeof _0x3bd45f['offset']==='undefined'&&typeof _0x3bd45f[_0xe959('0x1b')]==='undefined';var _0x26d496=_0x16835a[_0xe959('0x1c')];var _0x432c38=_0x48cc78?0x0:_0x3bd45f['offset'];var _0x326c4f=_0x48cc78?_0x16835a[_0xe959('0x1c')]:_0x3bd45f[_0xe959('0x1d')]+_0x3bd45f['limit'];var _0x7cd26d;if(_0x326c4f>=_0x26d496){_0x326c4f=_0x26d496;_0x7cd26d=0xc8;}else{_0x7cd26d=0xce;}_0x16a8da['status'](_0x7cd26d);return _0x16a8da[_0xe959('0x1e')](_0xe959('0x1f'),_0x432c38+'-'+_0x326c4f+'/'+_0x26d496)[_0xe959('0x1a')](_0x16835a);}return null;};}function patchUpdates(_0x40171c){return function(_0x4ad6ac){try{jsonpatch[_0xe959('0x20')](_0x4ad6ac,_0x40171c,!![]);}catch(_0x53cfcb){return BPromise['reject'](_0x53cfcb);}return _0x4ad6ac[_0xe959('0x21')]();};}function saveUpdates(_0x59ac7e,_0x5521e9){return function(_0x1bbf4f){if(_0x1bbf4f){return _0x1bbf4f[_0xe959('0x22')](_0x59ac7e)['then'](function(_0x34af4a){return _0x34af4a;});}return null;};}function removeEntity(_0x37f638,_0x5e2dda){return function(_0x4a0739){if(_0x4a0739){return _0x4a0739['destroy']()['then'](function(){var _0xbe0c93=_0x4a0739['get']({'plain':!![]});var _0x1a1cd9=_0xe959('0x23');return db[_0xe959('0x24')]['destroy']({'where':{'type':_0x1a1cd9,'resourceId':_0xbe0c93['id']}})[_0xe959('0x25')](function(){return _0x4a0739;});})[_0xe959('0x25')](function(){_0x37f638[_0xe959('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf5e0ed,_0x1cc676){return function(_0x2a39ad){if(!_0x2a39ad){_0xf5e0ed[_0xe959('0x17')](0x194);}return _0x2a39ad;};}function handleError(_0xbd3635,_0x14a521){_0x14a521=_0x14a521||0x1f4;return function(_0x562d76){logger['error'](_0x562d76[_0xe959('0x26')]);if(_0x562d76[_0xe959('0x27')]){delete _0x562d76[_0xe959('0x27')];}_0xbd3635['status'](_0x14a521)[_0xe959('0x28')](_0x562d76);};}exports[_0xe959('0x29')]=function(_0x6ba7a9,_0x147442){var _0x3eba7c={},_0x570cc1={},_0x55f000={'count':0x0,'rows':[]};var _0x2e1a73=_['map'](db[_0xe959('0x2a')][_0xe959('0x2b')],function(_0x1341c4){return{'name':_0x1341c4[_0xe959('0x2c')],'type':_0x1341c4[_0xe959('0x2d')][_0xe959('0x2e')]};});_0x570cc1[_0xe959('0x2f')]=_['map'](_0x2e1a73,'name');_0x570cc1[_0xe959('0x30')]=_[_0xe959('0x31')](_0x6ba7a9[_0xe959('0x30')]);_0x570cc1[_0xe959('0x32')]=_[_0xe959('0x33')](_0x570cc1[_0xe959('0x2f')],_0x570cc1[_0xe959('0x30')]);_0x3eba7c[_0xe959('0x34')]=_[_0xe959('0x33')](_0x570cc1['model'],qs[_0xe959('0x35')](_0x6ba7a9['query'][_0xe959('0x35')]));_0x3eba7c[_0xe959('0x34')]=_0x3eba7c['attributes'][_0xe959('0x36')]?_0x3eba7c[_0xe959('0x34')]:_0x570cc1[_0xe959('0x2f')];if(!_0x6ba7a9[_0xe959('0x30')][_0xe959('0x37')]('nolimit')){_0x3eba7c[_0xe959('0x1b')]=qs[_0xe959('0x1b')](_0x6ba7a9[_0xe959('0x30')]['limit']);_0x3eba7c['offset']=qs[_0xe959('0x1d')](_0x6ba7a9[_0xe959('0x30')][_0xe959('0x1d')]);}_0x3eba7c[_0xe959('0x38')]=qs[_0xe959('0x39')](_0x6ba7a9[_0xe959('0x30')][_0xe959('0x39')]);_0x3eba7c[_0xe959('0x3a')]=qs[_0xe959('0x32')](_['pick'](_0x6ba7a9[_0xe959('0x30')],_0x570cc1[_0xe959('0x32')]),_0x2e1a73);if(_0x6ba7a9[_0xe959('0x30')][_0xe959('0x3b')]){_0x3eba7c[_0xe959('0x3a')]=_[_0xe959('0x3c')](_0x3eba7c['where'],{'$or':_[_0xe959('0x3d')](_0x2e1a73,function(_0x4db9e5){if(_0x4db9e5[_0xe959('0x2d')]!==_0xe959('0x3e')){var _0x1af15b={};_0x1af15b[_0x4db9e5['name']]={'$like':'%'+_0x6ba7a9[_0xe959('0x30')][_0xe959('0x3b')]+'%'};return _0x1af15b;}})});}_0x3eba7c=_['merge']({},_0x3eba7c,_0x6ba7a9[_0xe959('0x3f')]);var _0x4e9310={'where':_0x3eba7c[_0xe959('0x3a')]};return db[_0xe959('0x2a')][_0xe959('0x1c')](_0x4e9310)['then'](function(_0x25ebe8){_0x55f000[_0xe959('0x1c')]=_0x25ebe8;if(_0x6ba7a9[_0xe959('0x30')][_0xe959('0x40')]){_0x3eba7c[_0xe959('0x41')]=[{'all':!![]}];}return db[_0xe959('0x2a')][_0xe959('0x42')](_0x3eba7c);})[_0xe959('0x25')](function(_0x813fe7){_0x55f000['rows']=_0x813fe7;return _0x55f000;})['then'](respondWithFilteredResult(_0x147442,_0x3eba7c))[_0xe959('0x43')](handleError(_0x147442,null));};exports[_0xe959('0x44')]=function(_0x475bdc,_0x20ea89){var _0x2ee38b={'raw':![],'where':{'id':_0x475bdc[_0xe959('0x45')]['id']}},_0x1d5cb6={};_0x1d5cb6[_0xe959('0x2f')]=_[_0xe959('0x31')](db[_0xe959('0x2a')][_0xe959('0x2b')]);_0x1d5cb6[_0xe959('0x30')]=_[_0xe959('0x31')](_0x475bdc['query']);_0x1d5cb6[_0xe959('0x32')]=_[_0xe959('0x33')](_0x1d5cb6[_0xe959('0x2f')],_0x1d5cb6[_0xe959('0x30')]);_0x2ee38b[_0xe959('0x34')]=_['intersection'](_0x1d5cb6['model'],qs['fields'](_0x475bdc[_0xe959('0x30')][_0xe959('0x35')]));_0x2ee38b[_0xe959('0x34')]=_0x2ee38b[_0xe959('0x34')][_0xe959('0x36')]?_0x2ee38b[_0xe959('0x34')]:_0x1d5cb6[_0xe959('0x2f')];if(_0x475bdc[_0xe959('0x30')][_0xe959('0x40')]){_0x2ee38b[_0xe959('0x41')]=[{'all':!![]}];}_0x2ee38b=_[_0xe959('0x3c')]({},_0x2ee38b,_0x475bdc['options']);return db[_0xe959('0x2a')]['find'](_0x2ee38b)['then'](handleEntityNotFound(_0x20ea89,null))[_0xe959('0x25')](respondWithResult(_0x20ea89,null))['catch'](handleError(_0x20ea89,null));};exports[_0xe959('0x46')]=function(_0x3ef0cc,_0x4bd6de){return db[_0xe959('0x2a')][_0xe959('0x46')](_0x3ef0cc[_0xe959('0x47')],{})[_0xe959('0x25')](function(_0x53a733){var _0x2b23af=_0x3ef0cc['user'][_0xe959('0x48')]({'plain':!![]});if(!_0x2b23af)throw new Error(_0xe959('0x49'));if(_0x2b23af['role']===_0xe959('0x4a')){var _0x3f5b8f=_0x53a733[_0xe959('0x48')]({'plain':!![]});var _0x1d08ed=_0xe959('0x23');return db[_0xe959('0x4b')][_0xe959('0x4c')]({'where':{'name':_0x1d08ed,'userProfileId':_0x2b23af[_0xe959('0x4d')]},'raw':!![]})[_0xe959('0x25')](function(_0x2d7d15){if(_0x2d7d15&&_0x2d7d15[_0xe959('0x4e')]===0x0){return db[_0xe959('0x24')]['create']({'name':_0x3f5b8f['name'],'resourceId':_0x3f5b8f['id'],'type':_0x2d7d15['name'],'sectionId':_0x2d7d15['id']},{})[_0xe959('0x25')](function(){return _0x53a733;});}else{return _0x53a733;}})[_0xe959('0x43')](function(_0x5dd705){logger[_0xe959('0x4f')](_0xe959('0x50'),_0x5dd705);throw _0x5dd705;});}return _0x53a733;})[_0xe959('0x25')](respondWithResult(_0x4bd6de,0xc9))['catch'](handleError(_0x4bd6de,null));};exports['clone']=function(_0x5e435b,_0x52ddcf){var _0x524181={'where':{'id':_0x5e435b[_0xe959('0x45')]['id']}},_0x4679d3={};_0x4679d3[_0xe959('0x2f')]=_[_0xe959('0x31')](db[_0xe959('0x2a')][_0xe959('0x2b')]);_0x524181[_0xe959('0x34')]=_[_0xe959('0x33')](_0x4679d3[_0xe959('0x2f')],qs[_0xe959('0x35')](_0x5e435b[_0xe959('0x30')][_0xe959('0x35')]));_0x524181[_0xe959('0x34')]=_0x524181['attributes']['length']?_0x524181[_0xe959('0x34')]:_0x4679d3[_0xe959('0x2f')];if(_0x5e435b[_0xe959('0x30')]['includeAll']){_0x524181['include']=[{'all':!![]}];}_0x524181=_[_0xe959('0x3c')]({},_0x524181,_0x5e435b[_0xe959('0x3f')]);return db[_0xe959('0x2a')][_0xe959('0x4c')](_0x524181)[_0xe959('0x25')](handleEntityNotFound(_0x52ddcf,null))[_0xe959('0x25')](function(_0x2a83c1){if(_0x2a83c1){var _0x57e046=_0x2a83c1[_0xe959('0x48')]({'plain':!![]});_0x57e046=qs[_0xe959('0x51')](_0x57e046,['id',_0xe959('0x52'),_0xe959('0x53')]);_0x5e435b[_0xe959('0x47')]=_[_0xe959('0x51')](_0x5e435b[_0xe959('0x47')],['id',_0xe959('0x52'),_0xe959('0x53')]);return db['Campaign'][_0xe959('0x46')](_['merge'](_0x57e046,_0x5e435b['body']),{'include':_0x5e435b[_0xe959('0x30')][_0xe959('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x2423c5){var _0x1829b8=_0x5e435b[_0xe959('0x4a')][_0xe959('0x48')]({'plain':!![]});if(!_0x1829b8)throw new Error(_0xe959('0x49'));if(_0x1829b8['role']==='user'){var _0x22b4c3=_0x2423c5[_0xe959('0x48')]({'plain':!![]});var _0x8ae9e7=_0xe959('0x23');return db[_0xe959('0x4b')]['find']({'where':{'name':_0x8ae9e7,'userProfileId':_0x1829b8[_0xe959('0x4d')]},'raw':!![]})[_0xe959('0x25')](function(_0x59d4eb){if(_0x59d4eb&&_0x59d4eb[_0xe959('0x4e')]===0x0){return db[_0xe959('0x24')]['create']({'name':_0x22b4c3[_0xe959('0x27')],'resourceId':_0x22b4c3['id'],'type':_0x59d4eb[_0xe959('0x27')],'sectionId':_0x59d4eb['id']},{})['then'](function(){return _0x2423c5;});}else{return _0x2423c5;}})[_0xe959('0x43')](function(_0x4de8cd){logger[_0xe959('0x4f')](_0xe959('0x50'),_0x4de8cd);throw _0x4de8cd;});}return _0x2423c5;});}})[_0xe959('0x25')](respondWithResult(_0x52ddcf,0xc9))['catch'](handleError(_0x52ddcf,null));};exports['update']=function(_0x535074,_0x222d97){if(_0x535074[_0xe959('0x47')]['id']){delete _0x535074['body']['id'];}return db[_0xe959('0x2a')][_0xe959('0x4c')]({'where':{'id':_0x535074[_0xe959('0x45')]['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x222d97,null))[_0xe959('0x25')](saveUpdates(_0x535074[_0xe959('0x47')],null))[_0xe959('0x25')](respondWithResult(_0x222d97,null))[_0xe959('0x43')](handleError(_0x222d97,null));};exports[_0xe959('0x54')]=function(_0x3704d8,_0x5445c2){return db[_0xe959('0x2a')]['find']({'where':{'id':_0x3704d8['params']['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x5445c2,null))['then'](removeEntity(_0x5445c2,null))[_0xe959('0x43')](handleError(_0x5445c2,null));};exports[_0xe959('0x55')]=function(_0x5acf08,_0x5ae0f3,_0x54d466){var _0x17459b={'raw':!![],'where':{}};var _0x1359be={};var _0x3dce85={'count':0x0,'rows':[]};return db['Campaign'][_0xe959('0x56')]({'where':{'id':_0x5acf08[_0xe959('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ae0f3,null))[_0xe959('0x25')](function(_0x527d8f){if(_0x527d8f){_0x1359be[_0xe959('0x2f')]=_[_0xe959('0x31')](db[_0xe959('0x57')]['rawAttributes']);_0x1359be[_0xe959('0x30')]=_[_0xe959('0x31')](_0x5acf08[_0xe959('0x30')]);_0x1359be['filters']=_[_0xe959('0x33')](_0x1359be[_0xe959('0x2f')],_0x1359be[_0xe959('0x30')]);_0x17459b[_0xe959('0x34')]=_[_0xe959('0x33')](_0x1359be[_0xe959('0x2f')],qs['fields'](_0x5acf08[_0xe959('0x30')][_0xe959('0x35')]));_0x17459b[_0xe959('0x34')]=_0x17459b[_0xe959('0x34')]['length']?_0x17459b[_0xe959('0x34')]:_0x1359be['model'];if(!_0x5acf08[_0xe959('0x30')]['hasOwnProperty'](_0xe959('0x58'))){_0x17459b[_0xe959('0x1b')]=qs[_0xe959('0x1b')](_0x5acf08[_0xe959('0x30')][_0xe959('0x1b')]);_0x17459b[_0xe959('0x1d')]=qs[_0xe959('0x1d')](_0x5acf08[_0xe959('0x30')][_0xe959('0x1d')]);}_0x17459b[_0xe959('0x38')]=qs[_0xe959('0x39')](_0x5acf08[_0xe959('0x30')][_0xe959('0x39')]);_0x17459b[_0xe959('0x3a')]=qs['filters'](_[_0xe959('0x59')](_0x5acf08[_0xe959('0x30')],_0x1359be['filters']));_0x17459b[_0xe959('0x3a')][_0xe959('0x5a')]=_0x527d8f['id'];if(_0x5acf08['query']['filter']){_0x17459b['where']=_['merge'](_0x17459b[_0xe959('0x3a')],{'$or':_[_0xe959('0x3d')](_0x17459b[_0xe959('0x34')],function(_0x260098){var _0x1a9a81={};_0x1a9a81[_0x260098]={'$like':'%'+_0x5acf08[_0xe959('0x30')][_0xe959('0x3b')]+'%'};return _0x1a9a81;})});}_0x17459b=_[_0xe959('0x3c')]({},_0x17459b,_0x5acf08[_0xe959('0x3f')]);return db[_0xe959('0x57')][_0xe959('0x1c')]({'where':_0x17459b[_0xe959('0x3a')]})['then'](function(_0x7aef49){_0x3dce85['count']=_0x7aef49;if(_0x5acf08['query'][_0xe959('0x40')]){_0x17459b[_0xe959('0x41')]=[{'all':!![]}];}return db[_0xe959('0x57')][_0xe959('0x42')](_0x17459b);})[_0xe959('0x25')](function(_0x216295){_0x3dce85[_0xe959('0x5b')]=_0x216295;return _0x3dce85;});}})[_0xe959('0x25')](respondWithFilteredResult(_0x5ae0f3,_0x17459b))[_0xe959('0x43')](handleError(_0x5ae0f3,null));};exports[_0xe959('0x5c')]=function(_0x24d15e,_0x5afa59,_0x4e9e4d){var _0x57a83a={'raw':!![],'where':{}};var _0x201bfe={};var _0x274139={'count':0x0,'rows':[]};return db[_0xe959('0x2a')]['findOne']({'where':{'id':_0x24d15e['params']['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x5afa59,null))[_0xe959('0x25')](function(_0x1dca35){if(_0x1dca35){_0x201bfe[_0xe959('0x2f')]=_[_0xe959('0x31')](db[_0xe959('0x5d')][_0xe959('0x2b')]);_0x201bfe[_0xe959('0x30')]=_[_0xe959('0x31')](_0x24d15e[_0xe959('0x30')]);_0x201bfe['filters']=_[_0xe959('0x33')](_0x201bfe[_0xe959('0x2f')],_0x201bfe['query']);_0x57a83a[_0xe959('0x34')]=_['intersection'](_0x201bfe[_0xe959('0x2f')],qs['fields'](_0x24d15e[_0xe959('0x30')]['fields']));_0x57a83a[_0xe959('0x34')]=_0x57a83a[_0xe959('0x34')][_0xe959('0x36')]?_0x57a83a[_0xe959('0x34')]:_0x201bfe['model'];if(!_0x24d15e['query']['hasOwnProperty'](_0xe959('0x58'))){_0x57a83a[_0xe959('0x1b')]=qs[_0xe959('0x1b')](_0x24d15e['query'][_0xe959('0x1b')]);_0x57a83a[_0xe959('0x1d')]=qs[_0xe959('0x1d')](_0x24d15e[_0xe959('0x30')][_0xe959('0x1d')]);}_0x57a83a[_0xe959('0x38')]=qs[_0xe959('0x39')](_0x24d15e['query'][_0xe959('0x39')]);_0x57a83a[_0xe959('0x3a')]=qs[_0xe959('0x32')](_[_0xe959('0x59')](_0x24d15e[_0xe959('0x30')],_0x201bfe[_0xe959('0x32')]));_0x57a83a[_0xe959('0x3a')][_0xe959('0x5a')]=_0x1dca35['id'];if(_0x24d15e['query']['filter']){_0x57a83a[_0xe959('0x3a')]=_[_0xe959('0x3c')](_0x57a83a['where'],{'$or':_['map'](_0x57a83a[_0xe959('0x34')],function(_0x1a59cd){var _0x325362={};_0x325362[_0x1a59cd]={'$like':'%'+_0x24d15e['query'][_0xe959('0x3b')]+'%'};return _0x325362;})});}_0x57a83a=_[_0xe959('0x3c')]({},_0x57a83a,_0x24d15e[_0xe959('0x3f')]);return db[_0xe959('0x5d')]['count']({'where':_0x57a83a[_0xe959('0x3a')]})[_0xe959('0x25')](function(_0x5ba992){_0x274139[_0xe959('0x1c')]=_0x5ba992;if(_0x24d15e[_0xe959('0x30')][_0xe959('0x40')]){_0x57a83a[_0xe959('0x41')]=[{'all':!![]}];}return db[_0xe959('0x5d')][_0xe959('0x42')](_0x57a83a);})[_0xe959('0x25')](function(_0x24337d){_0x274139[_0xe959('0x5b')]=_0x24337d;return _0x274139;});}})[_0xe959('0x25')](respondWithFilteredResult(_0x5afa59,_0x57a83a))['catch'](handleError(_0x5afa59,null));};exports[_0xe959('0x5e')]=function(_0x5a3d83,_0x2bc990,_0x38ff42){var _0x18d43a={'raw':!![],'where':{}};var _0x8285db={};var _0x2eb185={'count':0x0,'rows':[]};return db['Campaign'][_0xe959('0x56')]({'where':{'id':_0x5a3d83[_0xe959('0x45')]['id']}})['then'](handleEntityNotFound(_0x2bc990,null))['then'](function(_0x49e36e){if(_0x49e36e){_0x8285db[_0xe959('0x2f')]=_['keys'](db[_0xe959('0x5f')][_0xe959('0x2b')]);_0x8285db[_0xe959('0x30')]=_[_0xe959('0x31')](_0x5a3d83[_0xe959('0x30')]);_0x8285db[_0xe959('0x32')]=_['intersection'](_0x8285db['model'],_0x8285db[_0xe959('0x30')]);_0x18d43a['attributes']=_[_0xe959('0x33')](_0x8285db[_0xe959('0x2f')],qs['fields'](_0x5a3d83['query'][_0xe959('0x35')]));_0x18d43a[_0xe959('0x34')]=_0x18d43a[_0xe959('0x34')]['length']?_0x18d43a[_0xe959('0x34')]:_0x8285db[_0xe959('0x2f')];if(!_0x5a3d83[_0xe959('0x30')][_0xe959('0x37')](_0xe959('0x58'))){_0x18d43a['limit']=qs[_0xe959('0x1b')](_0x5a3d83[_0xe959('0x30')]['limit']);_0x18d43a['offset']=qs[_0xe959('0x1d')](_0x5a3d83[_0xe959('0x30')][_0xe959('0x1d')]);}_0x18d43a[_0xe959('0x38')]=qs[_0xe959('0x39')](_0x5a3d83[_0xe959('0x30')][_0xe959('0x39')]);_0x18d43a[_0xe959('0x3a')]=qs[_0xe959('0x32')](_['pick'](_0x5a3d83[_0xe959('0x30')],_0x8285db[_0xe959('0x32')]));_0x18d43a['where']['CampaignId']=_0x49e36e['id'];if(_0x5a3d83['query'][_0xe959('0x3b')]){_0x18d43a[_0xe959('0x3a')]=_[_0xe959('0x3c')](_0x18d43a['where'],{'$or':_['map'](_0x18d43a[_0xe959('0x34')],function(_0x4fe6de){var _0x3471f5={};_0x3471f5[_0x4fe6de]={'$like':'%'+_0x5a3d83[_0xe959('0x30')]['filter']+'%'};return _0x3471f5;})});}_0x18d43a=_[_0xe959('0x3c')]({},_0x18d43a,_0x5a3d83[_0xe959('0x3f')]);return db[_0xe959('0x5f')][_0xe959('0x1c')]({'where':_0x18d43a[_0xe959('0x3a')]})['then'](function(_0x590d93){_0x2eb185[_0xe959('0x1c')]=_0x590d93;if(_0x5a3d83[_0xe959('0x30')]['includeAll']){_0x18d43a[_0xe959('0x41')]=[{'all':!![]}];}return db[_0xe959('0x5f')][_0xe959('0x42')](_0x18d43a);})[_0xe959('0x25')](function(_0x18d23f){_0x2eb185[_0xe959('0x5b')]=_0x18d23f;return _0x2eb185;});}})[_0xe959('0x25')](respondWithFilteredResult(_0x2bc990,_0x18d43a))[_0xe959('0x43')](handleError(_0x2bc990,null));};exports[_0xe959('0x60')]=function(_0x1cdd45,_0x1b17a4,_0x3d78a1){var _0x2de441={'raw':!![],'where':{}};var _0x1a7e33={};var _0x3a1ab0={'count':0x0,'rows':[]};return db['Campaign'][_0xe959('0x56')]({'where':{'id':_0x1cdd45[_0xe959('0x45')]['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x1b17a4,null))[_0xe959('0x25')](function(_0x2bb9d1){if(_0x2bb9d1){_0x1a7e33[_0xe959('0x2f')]=_['keys'](db[_0xe959('0x61')][_0xe959('0x2b')]);_0x1a7e33[_0xe959('0x30')]=_[_0xe959('0x31')](_0x1cdd45[_0xe959('0x30')]);_0x1a7e33[_0xe959('0x32')]=_['intersection'](_0x1a7e33[_0xe959('0x2f')],_0x1a7e33[_0xe959('0x30')]);_0x2de441[_0xe959('0x34')]=_[_0xe959('0x33')](_0x1a7e33['model'],qs[_0xe959('0x35')](_0x1cdd45['query'][_0xe959('0x35')]));_0x2de441['attributes']=_0x2de441[_0xe959('0x34')][_0xe959('0x36')]?_0x2de441['attributes']:_0x1a7e33['model'];if(!_0x1cdd45[_0xe959('0x30')]['hasOwnProperty']('nolimit')){_0x2de441[_0xe959('0x1b')]=qs[_0xe959('0x1b')](_0x1cdd45[_0xe959('0x30')][_0xe959('0x1b')]);_0x2de441[_0xe959('0x1d')]=qs[_0xe959('0x1d')](_0x1cdd45[_0xe959('0x30')][_0xe959('0x1d')]);}_0x2de441['order']=qs[_0xe959('0x39')](_0x1cdd45['query'][_0xe959('0x39')]);_0x2de441['where']=qs['filters'](_['pick'](_0x1cdd45['query'],_0x1a7e33[_0xe959('0x32')]));_0x2de441[_0xe959('0x3a')][_0xe959('0x5a')]=_0x2bb9d1['id'];if(_0x1cdd45[_0xe959('0x30')][_0xe959('0x3b')]){_0x2de441[_0xe959('0x3a')]=_[_0xe959('0x3c')](_0x2de441[_0xe959('0x3a')],{'$or':_['map'](_0x2de441[_0xe959('0x34')],function(_0x409f69){var _0x289491={};_0x289491[_0x409f69]={'$like':'%'+_0x1cdd45[_0xe959('0x30')]['filter']+'%'};return _0x289491;})});}_0x2de441=_['merge']({},_0x2de441,_0x1cdd45[_0xe959('0x3f')]);return db[_0xe959('0x61')][_0xe959('0x1c')]({'where':_0x2de441[_0xe959('0x3a')]})[_0xe959('0x25')](function(_0x3235f1){_0x3a1ab0[_0xe959('0x1c')]=_0x3235f1;if(_0x1cdd45[_0xe959('0x30')][_0xe959('0x40')]){_0x2de441[_0xe959('0x41')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xe959('0x42')](_0x2de441);})[_0xe959('0x25')](function(_0x4b681e){_0x3a1ab0[_0xe959('0x5b')]=_0x4b681e;return _0x3a1ab0;});}})['then'](respondWithFilteredResult(_0x1b17a4,_0x2de441))[_0xe959('0x43')](handleError(_0x1b17a4,null));};exports[_0xe959('0x62')]=function(_0x14cedd,_0x4bca24,_0x56c81c){var _0x468d12={};var _0x2d53cc={};var _0x2246b3;var _0x3419ad;return db[_0xe959('0x2a')][_0xe959('0x56')]({'where':{'id':_0x14cedd[_0xe959('0x45')]['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x4bca24,null))[_0xe959('0x25')](function(_0x2be10d){if(_0x2be10d){_0x2246b3=_0x2be10d;_0x2d53cc['model']=_[_0xe959('0x31')](db['CmList'][_0xe959('0x2b')]);_0x2d53cc['query']=_[_0xe959('0x31')](_0x14cedd[_0xe959('0x30')]);_0x2d53cc['filters']=_[_0xe959('0x33')](_0x2d53cc[_0xe959('0x2f')],_0x2d53cc[_0xe959('0x30')]);_0x468d12[_0xe959('0x34')]=_[_0xe959('0x33')](_0x2d53cc[_0xe959('0x2f')],qs[_0xe959('0x35')](_0x14cedd['query']['fields']));_0x468d12[_0xe959('0x34')]=_0x468d12['attributes'][_0xe959('0x36')]?_0x468d12[_0xe959('0x34')]:_0x2d53cc[_0xe959('0x2f')];_0x468d12[_0xe959('0x38')]=qs['sort'](_0x14cedd['query']['sort']);_0x468d12[_0xe959('0x3a')]=qs[_0xe959('0x32')](_[_0xe959('0x59')](_0x14cedd[_0xe959('0x30')],_0x2d53cc[_0xe959('0x32')]));if(_0x14cedd['query'][_0xe959('0x3b')]){_0x468d12[_0xe959('0x3a')]=_['merge'](_0x468d12[_0xe959('0x3a')],{'$or':_['map'](_0x468d12[_0xe959('0x34')],function(_0x205094){var _0x53cc08={};_0x53cc08[_0x205094]={'$like':'%'+_0x14cedd[_0xe959('0x30')]['filter']+'%'};return _0x53cc08;})});}_0x468d12=_[_0xe959('0x3c')]({},_0x468d12,_0x14cedd[_0xe959('0x3f')]);return _0x2246b3[_0xe959('0x62')](_0x468d12);}})[_0xe959('0x25')](function(_0x9e4cc7){if(_0x9e4cc7){_0x3419ad=_0x9e4cc7[_0xe959('0x36')];if(!_0x14cedd['query']['hasOwnProperty'](_0xe959('0x58'))){_0x468d12[_0xe959('0x1b')]=qs[_0xe959('0x1b')](_0x14cedd[_0xe959('0x30')][_0xe959('0x1b')]);_0x468d12[_0xe959('0x1d')]=qs[_0xe959('0x1d')](_0x14cedd['query']['offset']);}return _0x2246b3[_0xe959('0x62')](_0x468d12);}})[_0xe959('0x25')](function(_0x13a7f1){if(_0x13a7f1){return _0x13a7f1?{'count':_0x3419ad,'rows':_0x13a7f1}:null;}})[_0xe959('0x25')](respondWithResult(_0x4bca24,null))[_0xe959('0x43')](handleError(_0x4bca24,null));};exports[_0xe959('0x63')]=function(_0x2d5152,_0x37b9cc,_0x54cefa){var _0x30ae03,_0x59a8e2;var _0xa15684=[];var _0x2cb28d=moment()[_0xe959('0x64')](_0xe959('0x65'));return db[_0xe959('0x2a')][_0xe959('0x4c')]({'where':{'id':_0x2d5152[_0xe959('0x45')]['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x37b9cc,null))[_0xe959('0x25')](function(_0x48397d){if(_0x48397d){_0x59a8e2=_0x48397d;return _0x48397d[_0xe959('0x63')](_0x2d5152[_0xe959('0x47')][_0xe959('0x66')],_[_0xe959('0x51')](_0x2d5152[_0xe959('0x47')],['ids','id'])||{});}return null;})[_0xe959('0x67')](function(_0x2a9668){var _0x339650;var _0x2a8ad3;_0x30ae03=_0x2a9668||[];var _0x565296=[];if(_0x2a9668){for(var _0x1287f6=0x0;_0x1287f6<_0x2a9668[_0xe959('0x36')];_0x1287f6+=0x1){var _0x253a27=_0x2a9668[_0x1287f6]['get']({'plain':!![]});_0x59a8e2[_0xe959('0x68')]=_0x2d5152[_0xe959('0x47')][_0xe959('0x68')]?_0x2d5152['body'][_0xe959('0x68')]:_0x59a8e2[_0xe959('0x68')];switch(_0x59a8e2[_0xe959('0x68')]){case'always':_0x339650=squel['insert']()[_0xe959('0x69')]('cm_hopper')[_0xe959('0x6a')](['phone',_0xe959('0x6b'),_0xe959('0x6c'),_0xe959('0x6d'),_0xe959('0x5a'),_0xe959('0x52'),_0xe959('0x53')],squel[_0xe959('0x6e')]()[_0xe959('0x6f')](_0xe959('0x70'),_0xe959('0x70'))['field'](_0xe959('0x71'),_0xe959('0x6b'))[_0xe959('0x6f')]('id','ContactId')[_0xe959('0x6f')](_0x253a27[_0xe959('0x72')][_0xe959('0x73')](),_0xe959('0x6d'))[_0xe959('0x6f')](_0x2d5152[_0xe959('0x45')]['id']['toString'](),_0xe959('0x5a'))['field']('\x27'+_0x2cb28d+'\x27','createdAt')[_0xe959('0x6f')]('\x27'+_0x2cb28d+'\x27',_0xe959('0x53'))[_0xe959('0x74')](_0xe959('0x75'))[_0xe959('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0xe959('0x76'),_0x253a27[_0xe959('0x72')]['toString']())[_0xe959('0x3a')](_0xe959('0x77'))['where'](_0xe959('0x78'),squel[_0xe959('0x6e')]()[_0xe959('0x6f')](_0xe959('0x79'))[_0xe959('0x74')](_0xe959('0x7a'))[_0xe959('0x3a')](_0xe959('0x7b'),_0x2d5152['params']['id'][_0xe959('0x73')]()))[_0xe959('0x3a')](_0xe959('0x78'),squel[_0xe959('0x6e')]()['field'](_0xe959('0x7c'))['from'](_0xe959('0x7d'))['where'](_0xe959('0x7b'),_0x2d5152[_0xe959('0x45')]['id'][_0xe959('0x73')]())))['toString']();break;case _0xe959('0x7e'):_0x339650=squel[_0xe959('0x7f')]()[_0xe959('0x69')](_0xe959('0x7d'))['fromQuery'](['phone',_0xe959('0x6b'),_0xe959('0x6c'),'ListId','CampaignId',_0xe959('0x52'),_0xe959('0x53')],squel['select']()[_0xe959('0x6f')](_0xe959('0x70'),_0xe959('0x70'))[_0xe959('0x6f')](_0xe959('0x71'),'scheduledAt')['field']('id',_0xe959('0x6c'))[_0xe959('0x6f')](_0x253a27['CmListId'][_0xe959('0x73')](),_0xe959('0x6d'))[_0xe959('0x6f')](_0x2d5152[_0xe959('0x45')]['id'][_0xe959('0x73')](),_0xe959('0x5a'))[_0xe959('0x6f')]('\x27'+_0x2cb28d+'\x27','createdAt')['field']('\x27'+_0x2cb28d+'\x27',_0xe959('0x53'))[_0xe959('0x74')](_0xe959('0x75'))['where'](_0xe959('0x80'))['where'](_0xe959('0x76'),_0x253a27[_0xe959('0x72')][_0xe959('0x73')]())[_0xe959('0x3a')](_0xe959('0x77'))[_0xe959('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xe959('0x6f')](_0xe959('0x7c'))[_0xe959('0x74')](_0xe959('0x7d'))[_0xe959('0x3a')]('CampaignId\x20=\x20?',_0x2d5152[_0xe959('0x45')]['id'][_0xe959('0x73')]())))['toString']();break;default:_0x339650=squel['insert']()['into'](_0xe959('0x7d'))['fromQuery']([_0xe959('0x70'),'scheduledAt',_0xe959('0x6c'),_0xe959('0x6d'),_0xe959('0x5a'),'createdAt','updatedAt'],squel['select']()['field'](_0xe959('0x70'),_0xe959('0x70'))[_0xe959('0x6f')](_0xe959('0x71'),_0xe959('0x6b'))[_0xe959('0x6f')]('id','ContactId')[_0xe959('0x6f')](_0x253a27['CmListId'][_0xe959('0x73')](),'ListId')[_0xe959('0x6f')](_0x2d5152['params']['id'][_0xe959('0x73')](),_0xe959('0x5a'))[_0xe959('0x6f')]('\x27'+_0x2cb28d+'\x27',_0xe959('0x52'))[_0xe959('0x6f')]('\x27'+_0x2cb28d+'\x27',_0xe959('0x53'))[_0xe959('0x74')](_0xe959('0x75'))[_0xe959('0x3a')](_0xe959('0x80'))[_0xe959('0x3a')](_0xe959('0x76'),_0x253a27[_0xe959('0x72')][_0xe959('0x73')]())[_0xe959('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0xe959('0x73')]();}_0x2a8ad3=squel[_0xe959('0x7f')]()[_0xe959('0x69')]('cm_hopper_additional_phones')[_0xe959('0x6a')]([_0xe959('0x81'),_0xe959('0x6b'),_0xe959('0x70'),_0xe959('0x82'),_0xe959('0x52'),_0xe959('0x53')],squel[_0xe959('0x6e')]()['field'](_0xe959('0x83'),'id')[_0xe959('0x6f')]('NOW()',_0xe959('0x6b'))[_0xe959('0x6f')](_0xe959('0x84'),_0xe959('0x70'))['field'](_0xe959('0x85'),_0xe959('0x82'))[_0xe959('0x6f')]('\x27'+_0x2cb28d+'\x27',_0xe959('0x52'))[_0xe959('0x6f')]('\x27'+_0x2cb28d+'\x27',_0xe959('0x53'))[_0xe959('0x74')](_0xe959('0x86'),'ci')[_0xe959('0x87')]('cm_hopper','h',_0xe959('0x88'))[_0xe959('0x3a')](_0xe959('0x89'),_0x253a27['CmListId']['toString']())['where'](_0xe959('0x8a'),_0x2d5152[_0xe959('0x45')]['id'][_0xe959('0x73')]())[_0xe959('0x3a')]('h.createdAt\x20=\x20?',_0x2cb28d))[_0xe959('0x73')]();_0x565296['push'](db['sequelize'][_0xe959('0x30')](_0x339650));_0xa15684[_0xe959('0x8b')](db[_0xe959('0x8c')][_0xe959('0x30')](_0x2a8ad3));}return BPromise[_0xe959('0x8d')](_0x565296);}})['then'](function(){return BPromise[_0xe959('0x8d')](_0xa15684);})[_0xe959('0x25')](function(){return _0x30ae03;})[_0xe959('0x25')](respondWithResult(_0x37b9cc,null))[_0xe959('0x43')](handleError(_0x37b9cc,null));};exports[_0xe959('0x8e')]=function(_0x58610f,_0x4220fa,_0x5fd409){return db['Campaign'][_0xe959('0x4c')]({'where':{'id':_0x58610f[_0xe959('0x45')]['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x4220fa,null))[_0xe959('0x25')](function(_0x113df5){if(_0x113df5){return _0x113df5[_0xe959('0x8e')](_0x58610f[_0xe959('0x30')][_0xe959('0x66')]);}})[_0xe959('0x25')](function(_0x300f25){if(_0x300f25){return db['CmHopper'][_0xe959('0x54')]({'where':{'ListId':_0x58610f[_0xe959('0x30')][_0xe959('0x66')],'CampaignId':_0x58610f[_0xe959('0x45')]['id']}})[_0xe959('0x25')](function(){return _0x300f25;});}})[_0xe959('0x25')](respondWithStatusCode(_0x4220fa,null))[_0xe959('0x43')](handleError(_0x4220fa,null));};exports[_0xe959('0x8f')]=function(_0x15cf08,_0x5b5ab5,_0x5ed44c){var _0x8f8873={};var _0x17deae={};var _0x34213f;var _0x11af9a;return db[_0xe959('0x2a')][_0xe959('0x56')]({'where':{'id':_0x15cf08['params']['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x5b5ab5,null))[_0xe959('0x25')](function(_0x512181){if(_0x512181){_0x34213f=_0x512181;_0x17deae[_0xe959('0x2f')]=_[_0xe959('0x31')](db['CmList'][_0xe959('0x2b')]);_0x17deae['query']=_['keys'](_0x15cf08[_0xe959('0x30')]);_0x17deae[_0xe959('0x32')]=_[_0xe959('0x33')](_0x17deae[_0xe959('0x2f')],_0x17deae[_0xe959('0x30')]);_0x8f8873['attributes']=_['intersection'](_0x17deae[_0xe959('0x2f')],qs[_0xe959('0x35')](_0x15cf08[_0xe959('0x30')][_0xe959('0x35')]));_0x8f8873[_0xe959('0x34')]=_0x8f8873['attributes'][_0xe959('0x36')]?_0x8f8873['attributes']:_0x17deae[_0xe959('0x2f')];_0x8f8873['order']=qs['sort'](_0x15cf08[_0xe959('0x30')][_0xe959('0x39')]);_0x8f8873['where']=qs[_0xe959('0x32')](_[_0xe959('0x59')](_0x15cf08[_0xe959('0x30')],_0x17deae[_0xe959('0x32')]));if(_0x15cf08[_0xe959('0x30')][_0xe959('0x3b')]){_0x8f8873['where']=_['merge'](_0x8f8873[_0xe959('0x3a')],{'$or':_[_0xe959('0x3d')](_0x8f8873[_0xe959('0x34')],function(_0x3bc421){var _0x13016c={};_0x13016c[_0x3bc421]={'$like':'%'+_0x15cf08[_0xe959('0x30')][_0xe959('0x3b')]+'%'};return _0x13016c;})});}_0x8f8873=_[_0xe959('0x3c')]({},_0x8f8873,_0x15cf08['options']);return _0x34213f['getBlackLists'](_0x8f8873);}})['then'](function(_0x459cd4){if(_0x459cd4){_0x11af9a=_0x459cd4[_0xe959('0x36')];if(!_0x15cf08[_0xe959('0x30')][_0xe959('0x37')](_0xe959('0x58'))){_0x8f8873[_0xe959('0x1b')]=qs[_0xe959('0x1b')](_0x15cf08[_0xe959('0x30')][_0xe959('0x1b')]);_0x8f8873[_0xe959('0x1d')]=qs['offset'](_0x15cf08['query'][_0xe959('0x1d')]);}return _0x34213f[_0xe959('0x8f')](_0x8f8873);}})[_0xe959('0x25')](function(_0x2c51a5){if(_0x2c51a5){return _0x2c51a5?{'count':_0x11af9a,'rows':_0x2c51a5}:null;}})[_0xe959('0x25')](respondWithResult(_0x5b5ab5,null))[_0xe959('0x43')](handleError(_0x5b5ab5,null));};exports[_0xe959('0x90')]=function(_0x23b8a7,_0x56d876,_0x851245){var _0x15739d,_0x1ac93e;var _0x5d2adf=[];var _0x458028=moment()[_0xe959('0x64')](_0xe959('0x65'));return db[_0xe959('0x2a')][_0xe959('0x4c')]({'where':{'id':_0x23b8a7[_0xe959('0x45')]['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x56d876,null))['then'](function(_0x5afc54){if(_0x5afc54){_0x1ac93e=_0x5afc54;return _0x5afc54[_0xe959('0x90')](_0x23b8a7['body'][_0xe959('0x66')],_['omit'](_0x23b8a7['body'],[_0xe959('0x66'),'id'])||{});}return null;})[_0xe959('0x67')](function(_0x37bd75){var _0x5d8179;var _0x54c716;_0x15739d=_0x37bd75||[];var _0x563353=[];if(_0x37bd75){for(var _0xdb4e84=0x0;_0xdb4e84<_0x37bd75[_0xe959('0x36')];_0xdb4e84+=0x1){var _0x8179cb=_0x37bd75[_0xdb4e84][_0xe959('0x48')]({'plain':!![]});_0x5d8179=squel[_0xe959('0x7f')]()[_0xe959('0x69')](_0xe959('0x91'))[_0xe959('0x6a')]([_0xe959('0x70'),_0xe959('0x6c'),'ListId',_0xe959('0x5a'),_0xe959('0x52'),_0xe959('0x53')],squel[_0xe959('0x6e')]()[_0xe959('0x6f')](_0xe959('0x70'),_0xe959('0x70'))[_0xe959('0x6f')]('id','ContactId')[_0xe959('0x6f')](_0x8179cb[_0xe959('0x72')][_0xe959('0x73')](),_0xe959('0x6d'))['field'](_0x23b8a7[_0xe959('0x45')]['id']['toString'](),_0xe959('0x5a'))['field'](_0xe959('0x71'),_0xe959('0x52'))[_0xe959('0x6f')](_0xe959('0x71'),_0xe959('0x53'))[_0xe959('0x74')](_0xe959('0x75'))[_0xe959('0x3a')](_0xe959('0x80'))[_0xe959('0x3a')](_0xe959('0x76'),_0x8179cb[_0xe959('0x72')][_0xe959('0x73')]())[_0xe959('0x3a')](_0xe959('0x77')))['toString']();_0x563353[_0xe959('0x8b')](db[_0xe959('0x8c')][_0xe959('0x30')](_0x5d8179));}return BPromise[_0xe959('0x8d')](_0x563353);}})['then'](function(){return _0x15739d;})['then'](respondWithResult(_0x56d876,null))['catch'](handleError(_0x56d876,null));};exports[_0xe959('0x92')]=function(_0x370ffc,_0x50bcea,_0x19a64a){return db['Campaign']['find']({'where':{'id':_0x370ffc['params']['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x50bcea,null))['then'](function(_0xbbfb25){if(_0xbbfb25){return _0xbbfb25['removeBlackLists'](_0x370ffc[_0xe959('0x30')][_0xe959('0x66')]);}})['then'](function(_0x535b64){if(_0x535b64){return db[_0xe959('0x61')][_0xe959('0x54')]({'where':{'ListId':_0x370ffc[_0xe959('0x30')]['ids'],'CampaignId':_0x370ffc[_0xe959('0x45')]['id']}})[_0xe959('0x25')](function(){return _0x535b64;});}})['then'](respondWithStatusCode(_0x50bcea,null))[_0xe959('0x43')](handleError(_0x50bcea,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 98c12ec..fc413f9 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x3410f3,_0x516979){var _0x5f2755=function(_0x305883){while(--_0x305883){_0x3410f3['push'](_0x3410f3['shift']());}};_0x5f2755(++_0x516979);}(_0x7a54,0x106));var _0x47a5=function(_0x2a9494,_0x4f59c4){_0x2a9494=_0x2a9494-0x0;var _0x214216=_0x7a54[_0x2a9494];return _0x214216;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x16446a,_0x5e9140){var _0x2c7051=function(_0x2e6a25){while(--_0x2e6a25){_0x16446a['push'](_0x16446a['shift']());}};_0x2c7051(++_0x5e9140);}(_0x7a54,0x106));var _0x47a5=function(_0x3f0407,_0x25a746){_0x3f0407=_0x3f0407-0x0;var _0x25863d=_0x7a54[_0x3f0407];return _0x25863d;};'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 f16f811..76e18a9 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 _0xef38=['include','info','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','attributes','limit','map','model'];(function(_0x517802,_0x2b4bc3){var _0x1dbe68=function(_0xd6e08c){while(--_0xd6e08c){_0x517802['push'](_0x517802['shift']());}};_0x1dbe68(++_0x2b4bc3);}(_0xef38,0x122));var _0x8ef3=function(_0x55b73e,_0x4f9036){_0x55b73e=_0x55b73e-0x0;var _0x2175cd=_0xef38[_0x55b73e];return _0x2175cd;};'use strict';var _=require('lodash');var util=require(_0x8ef3('0x0'));var moment=require(_0x8ef3('0x1'));var BPromise=require(_0x8ef3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ef3('0x3'))['db'];var utils=require(_0x8ef3('0x4'));var logger=require(_0x8ef3('0x5'))(_0x8ef3('0x6'));var config=require(_0x8ef3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8ef3('0x8')][_0x8ef3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ee13,_0x2c9ccd,_0x26107d){return new BPromise(function(_0x217874,_0x12b6c0){return client[_0x8ef3('0xa')](_0x50ee13,_0x26107d)[_0x8ef3('0xb')](function(_0xc4b3b3){logger['info'](_0x8ef3('0xc'),_0x2c9ccd,_0x8ef3('0xd'));logger[_0x8ef3('0xe')](_0x8ef3('0xf'),_0x2c9ccd,_0x8ef3('0xd'),JSON[_0x8ef3('0x10')](_0xc4b3b3));if(_0xc4b3b3[_0x8ef3('0x11')]){if(_0xc4b3b3[_0x8ef3('0x11')][_0x8ef3('0x12')]===0x1f4){logger[_0x8ef3('0x11')](_0x8ef3('0xc'),_0x2c9ccd,_0xc4b3b3[_0x8ef3('0x11')][_0x8ef3('0x13')]);return _0x12b6c0(_0xc4b3b3[_0x8ef3('0x11')][_0x8ef3('0x13')]);}logger[_0x8ef3('0x11')](_0x8ef3('0xc'),_0x2c9ccd,_0xc4b3b3[_0x8ef3('0x11')][_0x8ef3('0x13')]);return _0x217874(_0xc4b3b3['error'][_0x8ef3('0x13')]);}else{logger['info'](_0x8ef3('0xc'),_0x2c9ccd,'request\x20sent');_0x217874(_0xc4b3b3[_0x8ef3('0x14')][_0x8ef3('0x13')]);}})['catch'](function(_0x56884c){logger[_0x8ef3('0x11')](_0x8ef3('0xc'),_0x2c9ccd,_0x56884c);_0x12b6c0(_0x56884c);});});}exports[_0x8ef3('0x15')]=function(_0x434aa9){var _0x5296f2=this;return new Promise(function(_0x5cbed2,_0x29025b){return db[_0x8ef3('0x16')][_0x8ef3('0x17')]({'raw':_0x434aa9[_0x8ef3('0x18')]?_0x434aa9['options'][_0x8ef3('0x19')]===undefined?!![]:![]:!![],'where':_0x434aa9[_0x8ef3('0x18')]?_0x434aa9[_0x8ef3('0x18')]['where']||null:null,'attributes':_0x434aa9['options']?_0x434aa9[_0x8ef3('0x18')][_0x8ef3('0x1a')]||null:null,'limit':_0x434aa9[_0x8ef3('0x18')]?_0x434aa9[_0x8ef3('0x18')][_0x8ef3('0x1b')]||null:null,'include':_0x434aa9[_0x8ef3('0x18')]?_0x434aa9[_0x8ef3('0x18')]['include']?_[_0x8ef3('0x1c')](_0x434aa9[_0x8ef3('0x18')]['include'],function(_0xa9829e){return{'model':db[_0xa9829e[_0x8ef3('0x1d')]],'as':_0xa9829e['as'],'attributes':_0xa9829e[_0x8ef3('0x1a')],'include':_0xa9829e[_0x8ef3('0x1e')]?_[_0x8ef3('0x1c')](_0xa9829e['include'],function(_0x18ef45){return{'model':db[_0x18ef45[_0x8ef3('0x1d')]],'as':_0x18ef45['as'],'attributes':_0x18ef45[_0x8ef3('0x1a')],'include':_0x18ef45[_0x8ef3('0x1e')]?_['map'](_0x18ef45[_0x8ef3('0x1e')],function(_0x28637a){return{'model':db[_0x28637a[_0x8ef3('0x1d')]],'as':_0x28637a['as'],'attributes':_0x28637a[_0x8ef3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8ef3('0xb')](function(_0x28748f){logger[_0x8ef3('0x1f')](_0x8ef3('0x15'),_0x434aa9);logger[_0x8ef3('0xe')](_0x8ef3('0x15'),_0x434aa9,JSON[_0x8ef3('0x10')](_0x28748f));_0x5cbed2(_0x28748f);})['catch'](function(_0x4408f9){logger[_0x8ef3('0x11')](_0x8ef3('0x15'),_0x4408f9[_0x8ef3('0x13')],_0x434aa9);_0x29025b(_0x5296f2[_0x8ef3('0x11')](0x1f4,_0x4408f9[_0x8ef3('0x13')]));});});};
\ No newline at end of file
+var _0x98e1=['client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','message','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','GetCampaign','stringify','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x3c414c,_0x399dbb){var _0x4f3062=function(_0x1b71cc){while(--_0x1b71cc){_0x3c414c['push'](_0x3c414c['shift']());}};_0x4f3062(++_0x399dbb);}(_0x98e1,0x160));var _0x198e=function(_0x26a692,_0xacd9b7){_0x26a692=_0x26a692-0x0;var _0x277f46=_0x98e1[_0x26a692];return _0x277f46;};'use strict';var _=require('lodash');var util=require(_0x198e('0x0'));var moment=require(_0x198e('0x1'));var BPromise=require(_0x198e('0x2'));var rs=require(_0x198e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x198e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x198e('0x5'));var config=require(_0x198e('0x6'));var jayson=require(_0x198e('0x7'));var client=jayson[_0x198e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x545114,_0x46ac1b,_0x4d45d6){return new BPromise(function(_0x3322c5,_0x5ba06f){return client[_0x198e('0x9')](_0x545114,_0x4d45d6)[_0x198e('0xa')](function(_0x1ea2bf){logger[_0x198e('0xb')](_0x198e('0xc'),_0x46ac1b,_0x198e('0xd'));logger[_0x198e('0xe')](_0x198e('0xf'),_0x46ac1b,_0x198e('0xd'),JSON['stringify'](_0x1ea2bf));if(_0x1ea2bf[_0x198e('0x10')]){if(_0x1ea2bf[_0x198e('0x10')]['code']===0x1f4){logger[_0x198e('0x10')]('Campaign,\x20%s,\x20%s',_0x46ac1b,_0x1ea2bf[_0x198e('0x10')]['message']);return _0x5ba06f(_0x1ea2bf['error']['message']);}logger['error'](_0x198e('0xc'),_0x46ac1b,_0x1ea2bf[_0x198e('0x10')][_0x198e('0x11')]);return _0x3322c5(_0x1ea2bf['error'][_0x198e('0x11')]);}else{logger[_0x198e('0xb')](_0x198e('0xc'),_0x46ac1b,'request\x20sent');_0x3322c5(_0x1ea2bf['result']['message']);}})['catch'](function(_0x57f15e){logger[_0x198e('0x10')]('Campaign,\x20%s,\x20%s',_0x46ac1b,_0x57f15e);_0x5ba06f(_0x57f15e);});});}exports['GetCampaign']=function(_0x440975){var _0x46c980=this;return new Promise(function(_0x2485ea,_0x4cbf50){return db[_0x198e('0x12')][_0x198e('0x13')]({'raw':_0x440975[_0x198e('0x14')]?_0x440975[_0x198e('0x14')][_0x198e('0x15')]===undefined?!![]:![]:!![],'where':_0x440975['options']?_0x440975[_0x198e('0x14')][_0x198e('0x16')]||null:null,'attributes':_0x440975['options']?_0x440975[_0x198e('0x14')][_0x198e('0x17')]||null:null,'limit':_0x440975[_0x198e('0x14')]?_0x440975[_0x198e('0x14')][_0x198e('0x18')]||null:null,'include':_0x440975[_0x198e('0x14')]?_0x440975['options'][_0x198e('0x19')]?_[_0x198e('0x1a')](_0x440975[_0x198e('0x14')][_0x198e('0x19')],function(_0x17d04d){return{'model':db[_0x17d04d[_0x198e('0x1b')]],'as':_0x17d04d['as'],'attributes':_0x17d04d[_0x198e('0x17')],'include':_0x17d04d['include']?_[_0x198e('0x1a')](_0x17d04d[_0x198e('0x19')],function(_0x1fceba){return{'model':db[_0x1fceba[_0x198e('0x1b')]],'as':_0x1fceba['as'],'attributes':_0x1fceba[_0x198e('0x17')],'include':_0x1fceba[_0x198e('0x19')]?_[_0x198e('0x1a')](_0x1fceba[_0x198e('0x19')],function(_0x66c071){return{'model':db[_0x66c071['model']],'as':_0x66c071['as'],'attributes':_0x66c071['attributes']};}):[]};}):[]};}):[]:[]})[_0x198e('0xa')](function(_0x1a249c){logger['info']('GetCampaign',_0x440975);logger[_0x198e('0xe')](_0x198e('0x1c'),_0x440975,JSON[_0x198e('0x1d')](_0x1a249c));_0x2485ea(_0x1a249c);})['catch'](function(_0x5e657e){logger[_0x198e('0x10')](_0x198e('0x1c'),_0x5e657e[_0x198e('0x11')],_0x440975);_0x4cbf50(_0x46c980[_0x198e('0x10')](0x1f4,_0x5e657e[_0x198e('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index cc6bc27..3972e6e 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 _0x43b8=['post','/:id/clone','addLists','addBlackLists','put','/:id','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists'];(function(_0x2164a2,_0x4f1072){var _0x4d2275=function(_0x52968b){while(--_0x52968b){_0x2164a2['push'](_0x2164a2['shift']());}};_0x4d2275(++_0x4f1072);}(_0x43b8,0x1bd));var _0x843b=function(_0x244694,_0x4c866f){_0x244694=_0x244694-0x0;var _0x282042=_0x43b8[_0x244694];return _0x282042;};'use strict';var multer=require(_0x843b('0x0'));var util=require(_0x843b('0x1'));var path=require(_0x843b('0x2'));var timeout=require(_0x843b('0x3'));var express=require(_0x843b('0x4'));var router=express[_0x843b('0x5')]();var fs_extra=require(_0x843b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x843b('0x7'));var config=require(_0x843b('0x8'));var controller=require('./campaign.controller');router[_0x843b('0x9')]('/',auth[_0x843b('0xa')](),controller['index']);router[_0x843b('0x9')]('/:id',auth[_0x843b('0xa')](),controller['show']);router[_0x843b('0x9')](_0x843b('0xb'),auth[_0x843b('0xa')](),controller[_0x843b('0xc')]);router[_0x843b('0x9')](_0x843b('0xd'),auth[_0x843b('0xa')](),controller['getHopperHistories']);router[_0x843b('0x9')]('/:id/hopper_finals',auth[_0x843b('0xa')](),controller[_0x843b('0xe')]);router[_0x843b('0x9')](_0x843b('0xf'),auth[_0x843b('0xa')](),controller[_0x843b('0x10')]);router['get'](_0x843b('0x11'),auth[_0x843b('0xa')](),controller[_0x843b('0x12')]);router[_0x843b('0x9')]('/:id/blacklists',auth[_0x843b('0xa')](),controller[_0x843b('0x13')]);router[_0x843b('0x14')]('/',auth[_0x843b('0xa')](),controller['create']);router['post'](_0x843b('0x15'),auth[_0x843b('0xa')](),controller['clone']);router[_0x843b('0x14')](_0x843b('0x11'),auth['isAuthenticated'](),controller[_0x843b('0x16')]);router[_0x843b('0x14')]('/:id/blacklists',auth[_0x843b('0xa')](),controller[_0x843b('0x17')]);router[_0x843b('0x18')](_0x843b('0x19'),auth[_0x843b('0xa')](),controller['update']);router[_0x843b('0x1a')](_0x843b('0x19'),auth[_0x843b('0xa')](),controller[_0x843b('0x1b')]);router[_0x843b('0x1a')](_0x843b('0x11'),auth[_0x843b('0xa')](),controller[_0x843b('0x1c')]);router[_0x843b('0x1a')]('/:id/blacklists',auth[_0x843b('0xa')](),controller[_0x843b('0x1d')]);module[_0x843b('0x1e')]=router;
\ No newline at end of file
+var _0x0ca4=['put','update','delete','destroy','removeLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getLists','/:id/blacklists','getBlackLists','create','clone','post','/:id/lists','addLists','addBlackLists'];(function(_0x6237a0,_0x2b681b){var _0x37c8da=function(_0x47eba1){while(--_0x47eba1){_0x6237a0['push'](_0x6237a0['shift']());}};_0x37c8da(++_0x2b681b);}(_0x0ca4,0x15a));var _0x40ca=function(_0x16da80,_0x43672e){_0x16da80=_0x16da80-0x0;var _0x180dbf=_0x0ca4[_0x16da80];return _0x180dbf;};'use strict';var multer=require(_0x40ca('0x0'));var util=require('util');var path=require(_0x40ca('0x1'));var timeout=require(_0x40ca('0x2'));var express=require(_0x40ca('0x3'));var router=express[_0x40ca('0x4')]();var fs_extra=require(_0x40ca('0x5'));var auth=require(_0x40ca('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x40ca('0x7'));var controller=require(_0x40ca('0x8'));router[_0x40ca('0x9')]('/',auth[_0x40ca('0xa')](),controller[_0x40ca('0xb')]);router[_0x40ca('0x9')](_0x40ca('0xc'),auth[_0x40ca('0xa')](),controller[_0x40ca('0xd')]);router[_0x40ca('0x9')](_0x40ca('0xe'),auth['isAuthenticated'](),controller[_0x40ca('0xf')]);router[_0x40ca('0x9')]('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x40ca('0x9')](_0x40ca('0x10'),auth[_0x40ca('0xa')](),controller[_0x40ca('0x11')]);router[_0x40ca('0x9')](_0x40ca('0x12'),auth[_0x40ca('0xa')](),controller['getHopperBlacks']);router[_0x40ca('0x9')]('/:id/lists',auth['isAuthenticated'](),controller[_0x40ca('0x13')]);router[_0x40ca('0x9')](_0x40ca('0x14'),auth['isAuthenticated'](),controller[_0x40ca('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x40ca('0x16')]);router['post']('/:id/clone',auth[_0x40ca('0xa')](),controller[_0x40ca('0x17')]);router[_0x40ca('0x18')](_0x40ca('0x19'),auth[_0x40ca('0xa')](),controller[_0x40ca('0x1a')]);router['post'](_0x40ca('0x14'),auth['isAuthenticated'](),controller[_0x40ca('0x1b')]);router[_0x40ca('0x1c')](_0x40ca('0xc'),auth[_0x40ca('0xa')](),controller[_0x40ca('0x1d')]);router[_0x40ca('0x1e')]('/:id',auth[_0x40ca('0xa')](),controller[_0x40ca('0x1f')]);router[_0x40ca('0x1e')](_0x40ca('0x19'),auth[_0x40ca('0xa')](),controller[_0x40ca('0x20')]);router[_0x40ca('0x1e')](_0x40ca('0x14'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x40ca('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 ab9ad60..b53f60b 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 _0x7c79=['TEXT','getDataValue','key','sequelize','exports','STRING'];(function(_0x11f755,_0x5bf90b){var _0x11b47f=function(_0x46efb8){while(--_0x46efb8){_0x11f755['push'](_0x11f755['shift']());}};_0x11b47f(++_0x5bf90b);}(_0x7c79,0x171));var _0x97c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c79[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x97c7('0x0'));module[_0x97c7('0x1')]={'key':{'type':Sequelize[_0x97c7('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x97c7('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x97c7('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x97c7('0x4')](_0x97c7('0x5'));}}};
\ No newline at end of file
+var _0xd0d1=['sequelize','STRING','VIRTUAL','getDataValue'];(function(_0x1643cb,_0x8af3cc){var _0x2d1147=function(_0x556e53){while(--_0x556e53){_0x1643cb['push'](_0x1643cb['shift']());}};_0x2d1147(++_0x8af3cc);}(_0xd0d1,0x16c));var _0x1d0d=function(_0xaf7008,_0x5c3cf2){_0xaf7008=_0xaf7008-0x0;var _0x1196bc=_0xd0d1[_0xaf7008];return _0x1196bc;};'use strict';var Sequelize=require(_0x1d0d('0x0'));module['exports']={'key':{'type':Sequelize[_0x1d0d('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x1d0d('0x1')]},'name':{'type':Sequelize[_0x1d0d('0x2')],'get':function(){return this[_0x1d0d('0x3')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 3e3fdce..1341021 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 _0xa24a=['undefined','count','Content-Range','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','params','length','includeAll','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit'];(function(_0x1c468d,_0x50b31f){var _0x29202e=function(_0x73f11){while(--_0x73f11){_0x1c468d['push'](_0x1c468d['shift']());}};_0x29202e(++_0x50b31f);}(_0xa24a,0x97));var _0xaa24=function(_0x21e6d8,_0xa3aa85){_0x21e6d8=_0x21e6d8-0x0;var _0x42f051=_0xa24a[_0x21e6d8];return _0x42f051;};'use strict';var emlformat=require(_0xaa24('0x0'));var rimraf=require(_0xaa24('0x1'));var zipdir=require(_0xaa24('0x2'));var jsonpatch=require(_0xaa24('0x3'));var rp=require(_0xaa24('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaa24('0x5'));var path=require(_0xaa24('0x6'));var sox=require(_0xaa24('0x7'));var csv=require(_0xaa24('0x8'));var ejs=require(_0xaa24('0x9'));var fs=require('fs');var fs_extra=require(_0xaa24('0xa'));var _=require(_0xaa24('0xb'));var squel=require(_0xaa24('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa24('0xd'));var toCsv=require(_0xaa24('0x8'));var querystring=require(_0xaa24('0xe'));var Papa=require(_0xaa24('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa24('0x10'));var hardwareService=require(_0xaa24('0x11'));var logger=require(_0xaa24('0x12'))(_0xaa24('0x13'));var utils=require(_0xaa24('0x14'));var config=require(_0xaa24('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x450eaf,_0x4c8919){_0x4c8919=_0x4c8919||0xcc;return function(_0x3bea94){if(_0x3bea94){return _0x450eaf[_0xaa24('0x16')](_0x4c8919);}return _0x450eaf[_0xaa24('0x17')](_0x4c8919)['end']();};}function respondWithResult(_0xd1805c,_0x42959a){_0x42959a=_0x42959a||0xc8;return function(_0x490b00){if(_0x490b00){return _0xd1805c['status'](_0x42959a)[_0xaa24('0x18')](_0x490b00);}};}function respondWithFilteredResult(_0x59d08b,_0x458807){return function(_0x276e8d){if(_0x276e8d){var _0x238b21=typeof _0x458807[_0xaa24('0x19')]==='undefined'&&typeof _0x458807[_0xaa24('0x1a')]===_0xaa24('0x1b');var _0x1ef38e=_0x276e8d[_0xaa24('0x1c')];var _0x597f70=_0x238b21?0x0:_0x458807[_0xaa24('0x19')];var _0x5889cf=_0x238b21?_0x276e8d['count']:_0x458807[_0xaa24('0x19')]+_0x458807['limit'];var _0xf83a55;if(_0x5889cf>=_0x1ef38e){_0x5889cf=_0x1ef38e;_0xf83a55=0xc8;}else{_0xf83a55=0xce;}_0x59d08b[_0xaa24('0x17')](_0xf83a55);return _0x59d08b['set'](_0xaa24('0x1d'),_0x597f70+'-'+_0x5889cf+'/'+_0x1ef38e)[_0xaa24('0x18')](_0x276e8d);}return null;};}function patchUpdates(_0x514817){return function(_0x26972d){try{jsonpatch[_0xaa24('0x1e')](_0x26972d,_0x514817,!![]);}catch(_0x77bbb8){return BPromise[_0xaa24('0x1f')](_0x77bbb8);}return _0x26972d['save']();};}function saveUpdates(_0x57db55,_0x4b9057){return function(_0x12a939){if(_0x12a939){return _0x12a939[_0xaa24('0x20')](_0x57db55)[_0xaa24('0x21')](function(_0x4433ae){return _0x4433ae;});}return null;};}function removeEntity(_0x47bae5,_0x1a9e5d){return function(_0x100c93){if(_0x100c93){return _0x100c93[_0xaa24('0x22')]()[_0xaa24('0x21')](function(){var _0x18c3d9=_0x100c93[_0xaa24('0x23')]({'plain':!![]});var _0x2079e5=_0xaa24('0x24');return db[_0xaa24('0x25')][_0xaa24('0x22')]({'where':{'type':_0x2079e5,'resourceId':_0x18c3d9['id']}})['then'](function(){return _0x100c93;});})[_0xaa24('0x21')](function(){_0x47bae5[_0xaa24('0x17')](0xcc)[_0xaa24('0x26')]();});}};}function handleEntityNotFound(_0x51f933,_0x52318d){return function(_0x1635fa){if(!_0x1635fa){_0x51f933[_0xaa24('0x16')](0x194);}return _0x1635fa;};}function handleError(_0x154aec,_0x389a56){_0x389a56=_0x389a56||0x1f4;return function(_0x49a0d5){logger[_0xaa24('0x27')](_0x49a0d5[_0xaa24('0x28')]);if(_0x49a0d5[_0xaa24('0x29')]){delete _0x49a0d5[_0xaa24('0x29')];}_0x154aec['status'](_0x389a56)[_0xaa24('0x2a')](_0x49a0d5);};}exports[_0xaa24('0x2b')]=function(_0x3db536,_0x532a16){var _0x1a771d={},_0x17a40d={},_0xaecd7a={'count':0x0,'rows':[]};var _0x3da5fe=_['map'](db[_0xaa24('0x2c')][_0xaa24('0x2d')],function(_0x503eed){return{'name':_0x503eed[_0xaa24('0x2e')],'type':_0x503eed[_0xaa24('0x2f')][_0xaa24('0x30')]};});_0x17a40d[_0xaa24('0x31')]=_[_0xaa24('0x32')](_0x3da5fe,_0xaa24('0x29'));_0x17a40d[_0xaa24('0x33')]=_[_0xaa24('0x34')](_0x3db536[_0xaa24('0x33')]);_0x17a40d[_0xaa24('0x35')]=_[_0xaa24('0x36')](_0x17a40d[_0xaa24('0x31')],_0x17a40d[_0xaa24('0x33')]);_0x1a771d[_0xaa24('0x37')]=_[_0xaa24('0x36')](_0x17a40d[_0xaa24('0x31')],qs[_0xaa24('0x38')](_0x3db536[_0xaa24('0x33')]['fields']));_0x1a771d['attributes']=_0x1a771d[_0xaa24('0x37')]['length']?_0x1a771d[_0xaa24('0x37')]:_0x17a40d[_0xaa24('0x31')];if(!_0x3db536['query'][_0xaa24('0x39')](_0xaa24('0x3a'))){_0x1a771d[_0xaa24('0x1a')]=qs[_0xaa24('0x1a')](_0x3db536['query'][_0xaa24('0x1a')]);_0x1a771d[_0xaa24('0x19')]=qs[_0xaa24('0x19')](_0x3db536[_0xaa24('0x33')][_0xaa24('0x19')]);}_0x1a771d['order']=qs[_0xaa24('0x3b')](_0x3db536[_0xaa24('0x33')]['sort']);_0x1a771d[_0xaa24('0x3c')]=qs[_0xaa24('0x35')](_[_0xaa24('0x3d')](_0x3db536[_0xaa24('0x33')],_0x17a40d[_0xaa24('0x35')]),_0x3da5fe);if(_0x3db536[_0xaa24('0x33')][_0xaa24('0x3e')]){_0x1a771d['where']=_[_0xaa24('0x3f')](_0x1a771d[_0xaa24('0x3c')],{'$or':[{'key':{'$like':'%'+_0x3db536[_0xaa24('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0x3db536[_0xaa24('0x33')][_0xaa24('0x3e')]+'%'}}]});}_0x1a771d=_[_0xaa24('0x3f')]({},_0x1a771d,_0x3db536[_0xaa24('0x40')]);var _0x50b83b={'where':_0x1a771d[_0xaa24('0x3c')]};return db['CannedAnswer'][_0xaa24('0x1c')](_0x50b83b)[_0xaa24('0x21')](function(_0x350bc9){_0xaecd7a[_0xaa24('0x1c')]=_0x350bc9;if(_0x3db536[_0xaa24('0x33')]['includeAll']){_0x1a771d[_0xaa24('0x41')]=[{'all':!![]}];}return db[_0xaa24('0x2c')][_0xaa24('0x42')](_0x1a771d);})[_0xaa24('0x21')](function(_0x5479cd){_0xaecd7a[_0xaa24('0x43')]=_0x5479cd;return _0xaecd7a;})[_0xaa24('0x21')](respondWithFilteredResult(_0x532a16,_0x1a771d))[_0xaa24('0x44')](handleError(_0x532a16,null));};exports['show']=function(_0x18ad24,_0x888df3){var _0x44660c={'raw':!![],'where':{'id':_0x18ad24[_0xaa24('0x45')]['id']}},_0x5699e0={};_0x5699e0[_0xaa24('0x31')]=_['keys'](db[_0xaa24('0x2c')][_0xaa24('0x2d')]);_0x5699e0['query']=_['keys'](_0x18ad24[_0xaa24('0x33')]);_0x5699e0[_0xaa24('0x35')]=_[_0xaa24('0x36')](_0x5699e0[_0xaa24('0x31')],_0x5699e0['query']);_0x44660c[_0xaa24('0x37')]=_[_0xaa24('0x36')](_0x5699e0[_0xaa24('0x31')],qs[_0xaa24('0x38')](_0x18ad24[_0xaa24('0x33')][_0xaa24('0x38')]));_0x44660c[_0xaa24('0x37')]=_0x44660c[_0xaa24('0x37')][_0xaa24('0x46')]?_0x44660c[_0xaa24('0x37')]:_0x5699e0[_0xaa24('0x31')];if(_0x18ad24['query'][_0xaa24('0x47')]){_0x44660c[_0xaa24('0x41')]=[{'all':!![]}];}_0x44660c=_[_0xaa24('0x3f')]({},_0x44660c,_0x18ad24[_0xaa24('0x40')]);return db[_0xaa24('0x2c')][_0xaa24('0x48')](_0x44660c)[_0xaa24('0x21')](handleEntityNotFound(_0x888df3,null))[_0xaa24('0x21')](respondWithResult(_0x888df3,null))['catch'](handleError(_0x888df3,null));};exports['update']=function(_0xa96522,_0x4b78fa){if(_0xa96522[_0xaa24('0x49')]['id']){delete _0xa96522['body']['id'];}return db[_0xaa24('0x2c')][_0xaa24('0x48')]({'where':{'id':_0xa96522[_0xaa24('0x45')]['id']}})[_0xaa24('0x21')](handleEntityNotFound(_0x4b78fa,null))[_0xaa24('0x21')](saveUpdates(_0xa96522[_0xaa24('0x49')],null))['then'](respondWithResult(_0x4b78fa,null))[_0xaa24('0x44')](handleError(_0x4b78fa,null));};exports[_0xaa24('0x22')]=function(_0x2d7970,_0xdb43e7){return db[_0xaa24('0x2c')]['find']({'where':{'id':_0x2d7970[_0xaa24('0x45')]['id']}})[_0xaa24('0x21')](handleEntityNotFound(_0xdb43e7,null))[_0xaa24('0x21')](removeEntity(_0xdb43e7,null))['catch'](handleError(_0xdb43e7,null));};exports['create']=function(_0x53ca8c,_0x17299e){var _0x2ba345={'key':_0x53ca8c[_0xaa24('0x49')]['key']};if(_0x53ca8c[_0xaa24('0x49')][_0xaa24('0x4a')]){_0x2ba345[_0xaa24('0x4a')]=_0x53ca8c[_0xaa24('0x49')][_0xaa24('0x4a')];}else if(_0x53ca8c[_0xaa24('0x49')]['SmsAccountId']){_0x2ba345[_0xaa24('0x4b')]=_0x53ca8c['body']['SmsAccountId'];}else if(_0x53ca8c[_0xaa24('0x49')][_0xaa24('0x4c')]){_0x2ba345[_0xaa24('0x4c')]=_0x53ca8c[_0xaa24('0x49')][_0xaa24('0x4c')];}else if(_0x53ca8c[_0xaa24('0x49')][_0xaa24('0x4d')]){_0x2ba345['ChatWebsiteId']=_0x53ca8c[_0xaa24('0x49')][_0xaa24('0x4d')];}return db[_0xaa24('0x2c')]['find']({'where':_0x2ba345})[_0xaa24('0x21')](function(_0x2166d3){if(_0x2166d3){throw new db[(_0xaa24('0x4e'))][(_0xaa24('0x4f'))](_0xaa24('0x50'));}return db[_0xaa24('0x2c')][_0xaa24('0x51')](_0x53ca8c['body']);})[_0xaa24('0x21')](function(_0x5971e6){var _0x5bfc2b=_0x53ca8c[_0xaa24('0x52')][_0xaa24('0x23')]({'plain':!![]});if(!_0x5bfc2b)throw new Error(_0xaa24('0x53'));if(_0x5bfc2b[_0xaa24('0x54')]==='user'){var _0x17f3e2=_0x5971e6['get']({'plain':!![]});return db[_0xaa24('0x55')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x5bfc2b[_0xaa24('0x56')]},'raw':!![]})[_0xaa24('0x21')](function(_0x418a9d){if(_0x418a9d&&_0x418a9d[_0xaa24('0x57')]===0x0){return db[_0xaa24('0x25')][_0xaa24('0x51')]({'name':_0x17f3e2['name'],'resourceId':_0x17f3e2['id'],'type':_0x418a9d[_0xaa24('0x29')],'sectionId':_0x418a9d['id']},{})[_0xaa24('0x21')](function(){return _0x5971e6;});}else{return _0x5971e6;}})[_0xaa24('0x44')](function(_0x1dce7c){logger[_0xaa24('0x27')](_0xaa24('0x58'),_0x1dce7c);throw _0x1dce7c;});}return _0x5971e6;})['then'](respondWithResult(_0x17299e,0xc9))[_0xaa24('0x44')](handleError(_0x17299e,null));};
\ No newline at end of file
+var _0x94ff=['stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','update','destroy','then','CannedAnswers','UserProfileResource','end','error'];(function(_0x421376,_0x1b449d){var _0x396d60=function(_0x4c4876){while(--_0x4c4876){_0x421376['push'](_0x421376['shift']());}};_0x396d60(++_0x1b449d);}(_0x94ff,0x186));var _0xf94f=function(_0x15dc77,_0x54d8b8){_0x15dc77=_0x15dc77-0x0;var _0x5e592e=_0x94ff[_0x15dc77];return _0x5e592e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf94f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf94f('0x1'));var moment=require('moment');var BPromise=require(_0xf94f('0x2'));var Mustache=require(_0xf94f('0x3'));var util=require('util');var path=require(_0xf94f('0x4'));var sox=require(_0xf94f('0x5'));var csv=require('to-csv');var ejs=require(_0xf94f('0x6'));var fs=require('fs');var fs_extra=require(_0xf94f('0x7'));var _=require(_0xf94f('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf94f('0x9'));var toCsv=require('to-csv');var querystring=require(_0xf94f('0xa'));var Papa=require(_0xf94f('0xb'));var Redis=require(_0xf94f('0xc'));var authService=require(_0xf94f('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf94f('0xe'))(_0xf94f('0xf'));var utils=require('../../config/utils');var config=require(_0xf94f('0x10'));var licenseUtil=require(_0xf94f('0x11'));var db=require(_0xf94f('0x12'))['db'];function respondWithStatusCode(_0x4c6701,_0x25fc83){_0x25fc83=_0x25fc83||0xcc;return function(_0x16a04e){if(_0x16a04e){return _0x4c6701[_0xf94f('0x13')](_0x25fc83);}return _0x4c6701[_0xf94f('0x14')](_0x25fc83)['end']();};}function respondWithResult(_0x33127e,_0x147d9d){_0x147d9d=_0x147d9d||0xc8;return function(_0x3a8578){if(_0x3a8578){return _0x33127e['status'](_0x147d9d)[_0xf94f('0x15')](_0x3a8578);}};}function respondWithFilteredResult(_0x408815,_0x47070c){return function(_0x5a5d2a){if(_0x5a5d2a){var _0x22c5f5=typeof _0x47070c[_0xf94f('0x16')]===_0xf94f('0x17')&&typeof _0x47070c['limit']===_0xf94f('0x17');var _0x350b17=_0x5a5d2a[_0xf94f('0x18')];var _0x4a8c7b=_0x22c5f5?0x0:_0x47070c[_0xf94f('0x16')];var _0x1747c3=_0x22c5f5?_0x5a5d2a[_0xf94f('0x18')]:_0x47070c[_0xf94f('0x16')]+_0x47070c['limit'];var _0x13145f;if(_0x1747c3>=_0x350b17){_0x1747c3=_0x350b17;_0x13145f=0xc8;}else{_0x13145f=0xce;}_0x408815[_0xf94f('0x14')](_0x13145f);return _0x408815[_0xf94f('0x19')](_0xf94f('0x1a'),_0x4a8c7b+'-'+_0x1747c3+'/'+_0x350b17)[_0xf94f('0x15')](_0x5a5d2a);}return null;};}function patchUpdates(_0x5de797){return function(_0x3acd16){try{jsonpatch['apply'](_0x3acd16,_0x5de797,!![]);}catch(_0x2b65b4){return BPromise[_0xf94f('0x1b')](_0x2b65b4);}return _0x3acd16['save']();};}function saveUpdates(_0x5a6627,_0x3bd161){return function(_0x5e280f){if(_0x5e280f){return _0x5e280f[_0xf94f('0x1c')](_0x5a6627)['then'](function(_0x2f7b5a){return _0x2f7b5a;});}return null;};}function removeEntity(_0x35311b,_0x3c64bc){return function(_0x4f397c){if(_0x4f397c){return _0x4f397c[_0xf94f('0x1d')]()[_0xf94f('0x1e')](function(){var _0x2728de=_0x4f397c['get']({'plain':!![]});var _0x30dcf3=_0xf94f('0x1f');return db[_0xf94f('0x20')]['destroy']({'where':{'type':_0x30dcf3,'resourceId':_0x2728de['id']}})[_0xf94f('0x1e')](function(){return _0x4f397c;});})[_0xf94f('0x1e')](function(){_0x35311b[_0xf94f('0x14')](0xcc)[_0xf94f('0x21')]();});}};}function handleEntityNotFound(_0x17b420,_0x360e4c){return function(_0x4a6d28){if(!_0x4a6d28){_0x17b420[_0xf94f('0x13')](0x194);}return _0x4a6d28;};}function handleError(_0x31a09b,_0xa7f381){_0xa7f381=_0xa7f381||0x1f4;return function(_0xd5d97e){logger[_0xf94f('0x22')](_0xd5d97e[_0xf94f('0x23')]);if(_0xd5d97e[_0xf94f('0x24')]){delete _0xd5d97e[_0xf94f('0x24')];}_0x31a09b[_0xf94f('0x14')](_0xa7f381)[_0xf94f('0x25')](_0xd5d97e);};}exports['index']=function(_0x41dd6d,_0x12aa56){var _0x2e3846={},_0x1e7394={},_0x7b5bd0={'count':0x0,'rows':[]};var _0x176023=_[_0xf94f('0x26')](db[_0xf94f('0x27')][_0xf94f('0x28')],function(_0x375c17){return{'name':_0x375c17[_0xf94f('0x29')],'type':_0x375c17[_0xf94f('0x2a')][_0xf94f('0x2b')]};});_0x1e7394[_0xf94f('0x2c')]=_['map'](_0x176023,_0xf94f('0x24'));_0x1e7394[_0xf94f('0x2d')]=_[_0xf94f('0x2e')](_0x41dd6d['query']);_0x1e7394[_0xf94f('0x2f')]=_['intersection'](_0x1e7394[_0xf94f('0x2c')],_0x1e7394[_0xf94f('0x2d')]);_0x2e3846[_0xf94f('0x30')]=_[_0xf94f('0x31')](_0x1e7394['model'],qs[_0xf94f('0x32')](_0x41dd6d[_0xf94f('0x2d')][_0xf94f('0x32')]));_0x2e3846['attributes']=_0x2e3846[_0xf94f('0x30')]['length']?_0x2e3846[_0xf94f('0x30')]:_0x1e7394[_0xf94f('0x2c')];if(!_0x41dd6d['query'][_0xf94f('0x33')](_0xf94f('0x34'))){_0x2e3846[_0xf94f('0x35')]=qs['limit'](_0x41dd6d[_0xf94f('0x2d')][_0xf94f('0x35')]);_0x2e3846[_0xf94f('0x16')]=qs[_0xf94f('0x16')](_0x41dd6d[_0xf94f('0x2d')][_0xf94f('0x16')]);}_0x2e3846['order']=qs['sort'](_0x41dd6d[_0xf94f('0x2d')][_0xf94f('0x36')]);_0x2e3846[_0xf94f('0x37')]=qs['filters'](_[_0xf94f('0x38')](_0x41dd6d[_0xf94f('0x2d')],_0x1e7394[_0xf94f('0x2f')]),_0x176023);if(_0x41dd6d[_0xf94f('0x2d')][_0xf94f('0x39')]){_0x2e3846[_0xf94f('0x37')]=_[_0xf94f('0x3a')](_0x2e3846[_0xf94f('0x37')],{'$or':[{'key':{'$like':'%'+_0x41dd6d[_0xf94f('0x2d')][_0xf94f('0x39')]+'%'}},{'value':{'$like':'%'+_0x41dd6d[_0xf94f('0x2d')][_0xf94f('0x39')]+'%'}}]});}_0x2e3846=_[_0xf94f('0x3a')]({},_0x2e3846,_0x41dd6d[_0xf94f('0x3b')]);var _0x2f444e={'where':_0x2e3846[_0xf94f('0x37')]};return db['CannedAnswer'][_0xf94f('0x18')](_0x2f444e)[_0xf94f('0x1e')](function(_0x1d752f){_0x7b5bd0['count']=_0x1d752f;if(_0x41dd6d[_0xf94f('0x2d')]['includeAll']){_0x2e3846[_0xf94f('0x3c')]=[{'all':!![]}];}return db[_0xf94f('0x27')][_0xf94f('0x3d')](_0x2e3846);})[_0xf94f('0x1e')](function(_0x4adc99){_0x7b5bd0[_0xf94f('0x3e')]=_0x4adc99;return _0x7b5bd0;})[_0xf94f('0x1e')](respondWithFilteredResult(_0x12aa56,_0x2e3846))[_0xf94f('0x3f')](handleError(_0x12aa56,null));};exports[_0xf94f('0x40')]=function(_0x2b4045,_0x365bc7){var _0x1db51c={'raw':!![],'where':{'id':_0x2b4045[_0xf94f('0x41')]['id']}},_0x4356ac={};_0x4356ac[_0xf94f('0x2c')]=_[_0xf94f('0x2e')](db[_0xf94f('0x27')]['rawAttributes']);_0x4356ac['query']=_[_0xf94f('0x2e')](_0x2b4045[_0xf94f('0x2d')]);_0x4356ac[_0xf94f('0x2f')]=_[_0xf94f('0x31')](_0x4356ac[_0xf94f('0x2c')],_0x4356ac[_0xf94f('0x2d')]);_0x1db51c['attributes']=_[_0xf94f('0x31')](_0x4356ac[_0xf94f('0x2c')],qs[_0xf94f('0x32')](_0x2b4045[_0xf94f('0x2d')][_0xf94f('0x32')]));_0x1db51c[_0xf94f('0x30')]=_0x1db51c['attributes'][_0xf94f('0x42')]?_0x1db51c['attributes']:_0x4356ac['model'];if(_0x2b4045[_0xf94f('0x2d')][_0xf94f('0x43')]){_0x1db51c[_0xf94f('0x3c')]=[{'all':!![]}];}_0x1db51c=_[_0xf94f('0x3a')]({},_0x1db51c,_0x2b4045['options']);return db[_0xf94f('0x27')][_0xf94f('0x44')](_0x1db51c)['then'](handleEntityNotFound(_0x365bc7,null))[_0xf94f('0x1e')](respondWithResult(_0x365bc7,null))['catch'](handleError(_0x365bc7,null));};exports['update']=function(_0xad7f72,_0x1e9d21){if(_0xad7f72[_0xf94f('0x45')]['id']){delete _0xad7f72[_0xf94f('0x45')]['id'];}return db[_0xf94f('0x27')][_0xf94f('0x44')]({'where':{'id':_0xad7f72[_0xf94f('0x41')]['id']}})[_0xf94f('0x1e')](handleEntityNotFound(_0x1e9d21,null))[_0xf94f('0x1e')](saveUpdates(_0xad7f72[_0xf94f('0x45')],null))[_0xf94f('0x1e')](respondWithResult(_0x1e9d21,null))[_0xf94f('0x3f')](handleError(_0x1e9d21,null));};exports[_0xf94f('0x1d')]=function(_0x2c1b68,_0x573317){return db['CannedAnswer'][_0xf94f('0x44')]({'where':{'id':_0x2c1b68[_0xf94f('0x41')]['id']}})[_0xf94f('0x1e')](handleEntityNotFound(_0x573317,null))[_0xf94f('0x1e')](removeEntity(_0x573317,null))[_0xf94f('0x3f')](handleError(_0x573317,null));};exports[_0xf94f('0x46')]=function(_0x14dafe,_0x60a43){var _0x1bb64b={'key':_0x14dafe[_0xf94f('0x45')][_0xf94f('0x2b')]};if(_0x14dafe['body'][_0xf94f('0x47')]){_0x1bb64b[_0xf94f('0x47')]=_0x14dafe[_0xf94f('0x45')][_0xf94f('0x47')];}else if(_0x14dafe[_0xf94f('0x45')][_0xf94f('0x48')]){_0x1bb64b['SmsAccountId']=_0x14dafe[_0xf94f('0x45')][_0xf94f('0x48')];}else if(_0x14dafe[_0xf94f('0x45')][_0xf94f('0x49')]){_0x1bb64b['OpenchannelAccountId']=_0x14dafe['body'][_0xf94f('0x49')];}else if(_0x14dafe[_0xf94f('0x45')][_0xf94f('0x4a')]){_0x1bb64b[_0xf94f('0x4a')]=_0x14dafe[_0xf94f('0x45')]['ChatWebsiteId'];}return db[_0xf94f('0x27')]['find']({'where':_0x1bb64b})[_0xf94f('0x1e')](function(_0x39f303){if(_0x39f303){throw new db[(_0xf94f('0x4b'))][(_0xf94f('0x4c'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xf94f('0x27')][_0xf94f('0x46')](_0x14dafe[_0xf94f('0x45')]);})[_0xf94f('0x1e')](function(_0x3c7b19){var _0x203ef6=_0x14dafe[_0xf94f('0x4d')][_0xf94f('0x4e')]({'plain':!![]});if(!_0x203ef6)throw new Error(_0xf94f('0x4f'));if(_0x203ef6[_0xf94f('0x50')]===_0xf94f('0x4d')){var _0x4297d3=_0x3c7b19[_0xf94f('0x4e')]({'plain':!![]});return db[_0xf94f('0x51')]['find']({'where':{'name':_0xf94f('0x1f'),'userProfileId':_0x203ef6[_0xf94f('0x52')]},'raw':!![]})[_0xf94f('0x1e')](function(_0x1e7052){if(_0x1e7052&&_0x1e7052[_0xf94f('0x53')]===0x0){return db[_0xf94f('0x20')]['create']({'name':_0x4297d3[_0xf94f('0x24')],'resourceId':_0x4297d3['id'],'type':_0x1e7052[_0xf94f('0x24')],'sectionId':_0x1e7052['id']},{})[_0xf94f('0x1e')](function(){return _0x3c7b19;});}else{return _0x3c7b19;}})[_0xf94f('0x3f')](function(_0x1d39a2){logger['error'](_0xf94f('0x54'),_0x1d39a2);throw _0x1d39a2;});}return _0x3c7b19;})['then'](respondWithResult(_0x60a43,0xc9))['catch'](handleError(_0x60a43,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 41405f7..2ebf64f 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 _0x43b7=['request-promise','path','../../config/environment','exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x4dffc2,_0x498606){var _0x25af99=function(_0x984268){while(--_0x984268){_0x4dffc2['push'](_0x4dffc2['shift']());}};_0x25af99(++_0x498606);}(_0x43b7,0xa3));var _0x743b=function(_0x1eaade,_0xdc34){_0x1eaade=_0x1eaade-0x0;var _0x557821=_0x43b7[_0x1eaade];return _0x557821;};'use strict';var _=require(_0x743b('0x0'));var util=require(_0x743b('0x1'));var logger=require(_0x743b('0x2'))(_0x743b('0x3'));var moment=require('moment');var BPromise=require(_0x743b('0x4'));var rp=require(_0x743b('0x5'));var fs=require('fs');var path=require(_0x743b('0x6'));var rimraf=require('rimraf');var config=require(_0x743b('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x743b('0x8')]=function(_0x3de02b,_0x12d0f4){return _0x3de02b['define'](_0x743b('0x9'),attributes,{'tableName':_0x743b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x743b('0xb')});};
\ No newline at end of file
+var _0x694d=['define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports'];(function(_0x1f4b18,_0x4e777c){var _0xde3957=function(_0x1dcbbc){while(--_0x1dcbbc){_0x1f4b18['push'](_0x1f4b18['shift']());}};_0xde3957(++_0x4e777c);}(_0x694d,0x16c));var _0xd694=function(_0x4565a6,_0x5ada44){_0x4565a6=_0x4565a6-0x0;var _0x2010f8=_0x694d[_0x4565a6];return _0x2010f8;};'use strict';var _=require(_0xd694('0x0'));var util=require(_0xd694('0x1'));var logger=require(_0xd694('0x2'))(_0xd694('0x3'));var moment=require('moment');var BPromise=require(_0xd694('0x4'));var rp=require(_0xd694('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd694('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0xd694('0x7')]=function(_0x3e04f6,_0x8130f){return _0x3e04f6[_0xd694('0x8')](_0xd694('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd694('0xa'),'collate':_0xd694('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 579900a..2a25209 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(_0x464c85,_0x3b2237){var _0x4ee07c=function(_0x1371ef){while(--_0x1371ef){_0x464c85['push'](_0x464c85['shift']());}};_0x4ee07c(++_0x3b2237);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x348e63,_0x567959){var _0x17680c=function(_0x9d67c2){while(--_0x9d67c2){_0x348e63['push'](_0x348e63['shift']());}};_0x17680c(++_0x567959);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 1ca02da..9e6acdc 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 _0x8baa=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','post','put','update','delete','destroy','multer','util','path'];(function(_0x41e4eb,_0x58029b){var _0x3d54b3=function(_0x54f1ff){while(--_0x54f1ff){_0x41e4eb['push'](_0x41e4eb['shift']());}};_0x3d54b3(++_0x58029b);}(_0x8baa,0x11d));var _0xa8ba=function(_0x5b1a0a,_0x1540a9){_0x5b1a0a=_0x5b1a0a-0x0;var _0x5b9b87=_0x8baa[_0x5b1a0a];return _0x5b9b87;};'use strict';var multer=require(_0xa8ba('0x0'));var util=require(_0xa8ba('0x1'));var path=require(_0xa8ba('0x2'));var timeout=require(_0xa8ba('0x3'));var express=require(_0xa8ba('0x4'));var router=express['Router']();var fs_extra=require(_0xa8ba('0x5'));var auth=require(_0xa8ba('0x6'));var interaction=require(_0xa8ba('0x7'));var config=require(_0xa8ba('0x8'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xa8ba('0x9')](),controller['index']);router[_0xa8ba('0xa')](_0xa8ba('0xb'),auth['isAuthenticated'](),controller[_0xa8ba('0xc')]);router[_0xa8ba('0xd')]('/',auth[_0xa8ba('0x9')](),controller['create']);router[_0xa8ba('0xe')](_0xa8ba('0xb'),auth[_0xa8ba('0x9')](),controller[_0xa8ba('0xf')]);router[_0xa8ba('0x10')]('/:id',auth[_0xa8ba('0x9')](),controller[_0xa8ba('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x9fe8=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports'];(function(_0x58cf07,_0x2e3858){var _0x42afe0=function(_0x3c71ff){while(--_0x3c71ff){_0x58cf07['push'](_0x58cf07['shift']());}};_0x42afe0(++_0x2e3858);}(_0x9fe8,0x19e));var _0x89fe=function(_0x130df6,_0x12ad73){_0x130df6=_0x130df6-0x0;var _0x82df5f=_0x9fe8[_0x130df6];return _0x82df5f;};'use strict';var multer=require(_0x89fe('0x0'));var util=require(_0x89fe('0x1'));var path=require(_0x89fe('0x2'));var timeout=require(_0x89fe('0x3'));var express=require('express');var router=express[_0x89fe('0x4')]();var fs_extra=require(_0x89fe('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x89fe('0x6'));var config=require(_0x89fe('0x7'));var controller=require('./cannedAnswer.controller');router[_0x89fe('0x8')]('/',auth[_0x89fe('0x9')](),controller[_0x89fe('0xa')]);router[_0x89fe('0x8')](_0x89fe('0xb'),auth['isAuthenticated'](),controller[_0x89fe('0xc')]);router['post']('/',auth[_0x89fe('0x9')](),controller[_0x89fe('0xd')]);router[_0x89fe('0xe')]('/:id',auth[_0x89fe('0x9')](),controller['update']);router[_0x89fe('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x89fe('0x10')]);module[_0x89fe('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 32b5529..7051c48 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 _0x6002=['exports','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x6002,0x103));var _0x2600=function(_0x30f2fd,_0x1207b4){_0x30f2fd=_0x30f2fd-0x0;var _0x42adbc=_0x6002[_0x30f2fd];return _0x42adbc;};'use strict';var Sequelize=require(_0x2600('0x0'));module[_0x2600('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x2600('0x2')},'clid':{'type':Sequelize[_0x2600('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x2600('0x3')]},'dcontext':{'type':Sequelize[_0x2600('0x3')]},'channel':{'type':Sequelize[_0x2600('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x2600('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2600('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x2600('0x3')]},'sequence':{'type':Sequelize[_0x2600('0x3')]},'peeraccount':{'type':Sequelize[_0x2600('0x3')]},'type':{'type':Sequelize[_0x2600('0x3')]},'tag':{'type':Sequelize[_0x2600('0x3')]}};
\ No newline at end of file
+var _0x5081=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x101134,_0x1ed1d3){var _0xc47acc=function(_0x7ea469){while(--_0x7ea469){_0x101134['push'](_0x101134['shift']());}};_0xc47acc(++_0x1ed1d3);}(_0x5081,0x148));var _0x1508=function(_0x2a287a,_0x3cfd27){_0x2a287a=_0x2a287a-0x0;var _0x57f271=_0x5081[_0x2a287a];return _0x57f271;};'use strict';var Sequelize=require(_0x1508('0x0'));module[_0x1508('0x1')]={'calldate':{'type':Sequelize[_0x1508('0x2')],'allowNull':![],'defaultValue':_0x1508('0x3')},'clid':{'type':Sequelize[_0x1508('0x4')]},'src':{'type':Sequelize[_0x1508('0x4')]},'dst':{'type':Sequelize[_0x1508('0x4')]},'dcontext':{'type':Sequelize[_0x1508('0x4')]},'channel':{'type':Sequelize[_0x1508('0x4')]},'dstchannel':{'type':Sequelize[_0x1508('0x4')]},'lastapp':{'type':Sequelize[_0x1508('0x4')]},'lastdata':{'type':Sequelize[_0x1508('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1508('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x1508('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1508('0x4')]},'userfield':{'type':Sequelize[_0x1508('0x4')]},'uniqueid':{'type':Sequelize[_0x1508('0x4')]},'linkedid':{'type':Sequelize[_0x1508('0x4')]},'sequence':{'type':Sequelize[_0x1508('0x4')]},'peeraccount':{'type':Sequelize[_0x1508('0x4')]},'type':{'type':Sequelize['STRING']},'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 73bedd5..07ed04a 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 _0xf767=['apply','save','then','error','stack','name','map','Cdr','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','merge','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','undefined','count','limit','status','set','json'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xf767,0x76));var _0x7f76=function(_0x1b2422,_0x1e98d4){_0x1b2422=_0x1b2422-0x0;var _0x376573=_0xf767[_0x1b2422];return _0x376573;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f76('0x0'));var zipdir=require(_0x7f76('0x1'));var jsonpatch=require(_0x7f76('0x2'));var rp=require(_0x7f76('0x3'));var moment=require(_0x7f76('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7f76('0x5'));var util=require(_0x7f76('0x6'));var path=require(_0x7f76('0x7'));var sox=require(_0x7f76('0x8'));var csv=require('to-csv');var ejs=require(_0x7f76('0x9'));var fs=require('fs');var fs_extra=require(_0x7f76('0xa'));var _=require(_0x7f76('0xb'));var squel=require(_0x7f76('0xc'));var crypto=require(_0x7f76('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f76('0xe'));var toCsv=require(_0x7f76('0xf'));var querystring=require(_0x7f76('0x10'));var Papa=require(_0x7f76('0x11'));var Redis=require('ioredis');var authService=require(_0x7f76('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7f76('0x13'));var hardwareService=require(_0x7f76('0x14'));var logger=require(_0x7f76('0x15'))(_0x7f76('0x16'));var utils=require(_0x7f76('0x17'));var config=require(_0x7f76('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f76('0x19'))['db'];function respondWithStatusCode(_0x2cd1b3,_0x47403b){_0x47403b=_0x47403b||0xcc;return function(_0x32392b){if(_0x32392b){return _0x2cd1b3[_0x7f76('0x1a')](_0x47403b);}return _0x2cd1b3['status'](_0x47403b)[_0x7f76('0x1b')]();};}function respondWithResult(_0x4d8de0,_0x42a9d3){_0x42a9d3=_0x42a9d3||0xc8;return function(_0x256f79){if(_0x256f79){return _0x4d8de0['status'](_0x42a9d3)['json'](_0x256f79);}};}function respondWithFilteredResult(_0x58d2f3,_0xe81aa9){return function(_0x2df2db){if(_0x2df2db){var _0x286e96=typeof _0xe81aa9['offset']===_0x7f76('0x1c')&&typeof _0xe81aa9['limit']===_0x7f76('0x1c');var _0x3ceb6a=_0x2df2db[_0x7f76('0x1d')];var _0x4802ff=_0x286e96?0x0:_0xe81aa9['offset'];var _0x494537=_0x286e96?_0x2df2db['count']:_0xe81aa9['offset']+_0xe81aa9[_0x7f76('0x1e')];var _0xdb1407;if(_0x494537>=_0x3ceb6a){_0x494537=_0x3ceb6a;_0xdb1407=0xc8;}else{_0xdb1407=0xce;}_0x58d2f3[_0x7f76('0x1f')](_0xdb1407);return _0x58d2f3[_0x7f76('0x20')]('Content-Range',_0x4802ff+'-'+_0x494537+'/'+_0x3ceb6a)[_0x7f76('0x21')](_0x2df2db);}return null;};}function patchUpdates(_0x557c0f){return function(_0x38c4d6){try{jsonpatch[_0x7f76('0x22')](_0x38c4d6,_0x557c0f,!![]);}catch(_0x5a28b0){return BPromise['reject'](_0x5a28b0);}return _0x38c4d6[_0x7f76('0x23')]();};}function saveUpdates(_0xb647d8,_0x5efed5){return function(_0x3f2536){if(_0x3f2536){return _0x3f2536['update'](_0xb647d8)[_0x7f76('0x24')](function(_0x333056){return _0x333056;});}return null;};}function removeEntity(_0x31993d,_0x3deb00){return function(_0x3eea75){if(_0x3eea75){return _0x3eea75['destroy']()[_0x7f76('0x24')](function(){_0x31993d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x197519,_0x45f1c9){return function(_0x3492f4){if(!_0x3492f4){_0x197519['sendStatus'](0x194);}return _0x3492f4;};}function handleError(_0xbe6ac1,_0x1347bf){_0x1347bf=_0x1347bf||0x1f4;return function(_0x3e624d){logger[_0x7f76('0x25')](_0x3e624d[_0x7f76('0x26')]);if(_0x3e624d['name']){delete _0x3e624d[_0x7f76('0x27')];}_0xbe6ac1[_0x7f76('0x1f')](_0x1347bf)['send'](_0x3e624d);};}exports['index']=function(_0xe459de,_0x58829a){var _0x1dd664={},_0x3542e3={},_0xd5ba7={'count':0x0,'rows':[]};var _0x393bdd=_[_0x7f76('0x28')](db[_0x7f76('0x29')]['rawAttributes'],function(_0x3570ec){return{'name':_0x3570ec[_0x7f76('0x2a')],'type':_0x3570ec[_0x7f76('0x2b')][_0x7f76('0x2c')]};});_0x3542e3['model']=_[_0x7f76('0x28')](_0x393bdd,_0x7f76('0x27'));_0x3542e3[_0x7f76('0x2d')]=_['keys'](_0xe459de[_0x7f76('0x2d')]);_0x3542e3[_0x7f76('0x2e')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],_0x3542e3[_0x7f76('0x2d')]);_0x1dd664[_0x7f76('0x31')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0xe459de[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x1dd664[_0x7f76('0x31')]=_0x1dd664[_0x7f76('0x31')]['length']?_0x1dd664[_0x7f76('0x31')]:_0x3542e3[_0x7f76('0x30')];if(!_0xe459de[_0x7f76('0x2d')][_0x7f76('0x33')](_0x7f76('0x34'))){_0x1dd664[_0x7f76('0x1e')]=qs[_0x7f76('0x1e')](_0xe459de[_0x7f76('0x2d')]['limit']);_0x1dd664[_0x7f76('0x35')]=qs['offset'](_0xe459de['query'][_0x7f76('0x35')]);}_0x1dd664['order']=qs[_0x7f76('0x36')](_0xe459de[_0x7f76('0x2d')]['sort']);_0x1dd664[_0x7f76('0x37')]=qs['filters'](_['pick'](_0xe459de[_0x7f76('0x2d')],_0x3542e3[_0x7f76('0x2e')]),_0x393bdd);if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]){_0x1dd664[_0x7f76('0x37')]=_['merge'](_0x1dd664[_0x7f76('0x37')],{'$or':_[_0x7f76('0x28')](_0x393bdd,function(_0x4edf74){if(_0x4edf74['type']!==_0x7f76('0x39')){var _0x4ea167={};_0x4ea167[_0x4edf74[_0x7f76('0x27')]]={'$like':'%'+_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]+'%'};return _0x4ea167;}})});}_0x1dd664=_['merge']({},_0x1dd664,_0xe459de[_0x7f76('0x3a')]);var _0x26b537={'where':_0x1dd664[_0x7f76('0x37')]};return db[_0x7f76('0x29')][_0x7f76('0x1d')](_0x26b537)[_0x7f76('0x24')](function(_0x58649f){_0xd5ba7['count']=_0x58649f;if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x1dd664[_0x7f76('0x3c')]=[{'all':!![]}];}return db[_0x7f76('0x29')][_0x7f76('0x3d')](_0x1dd664);})[_0x7f76('0x24')](function(_0x401284){_0xd5ba7[_0x7f76('0x3e')]=_0x401284;return _0xd5ba7;})[_0x7f76('0x24')](respondWithFilteredResult(_0x58829a,_0x1dd664))[_0x7f76('0x3f')](handleError(_0x58829a,null));};exports[_0x7f76('0x40')]=function(_0x313d37,_0x3229b9){var _0x391d04={'raw':!![],'where':{'id':_0x313d37[_0x7f76('0x41')]['id']}},_0x2a43f1={};_0x2a43f1[_0x7f76('0x30')]=_[_0x7f76('0x42')](db['Cdr'][_0x7f76('0x43')]);_0x2a43f1[_0x7f76('0x2d')]=_[_0x7f76('0x42')](_0x313d37['query']);_0x2a43f1['filters']=_[_0x7f76('0x2f')](_0x2a43f1['model'],_0x2a43f1[_0x7f76('0x2d')]);_0x391d04['attributes']=_['intersection'](_0x2a43f1[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0x313d37[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x391d04[_0x7f76('0x31')]=_0x391d04[_0x7f76('0x31')][_0x7f76('0x44')]?_0x391d04[_0x7f76('0x31')]:_0x2a43f1[_0x7f76('0x30')];if(_0x313d37[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x391d04[_0x7f76('0x3c')]=[{'all':!![]}];}_0x391d04=_[_0x7f76('0x45')]({},_0x391d04,_0x313d37[_0x7f76('0x3a')]);return db['Cdr'][_0x7f76('0x46')](_0x391d04)['then'](handleEntityNotFound(_0x3229b9,null))[_0x7f76('0x24')](respondWithResult(_0x3229b9,null))[_0x7f76('0x3f')](handleError(_0x3229b9,null));};exports[_0x7f76('0x47')]=function(_0x39bbef,_0x487b1f){return db[_0x7f76('0x29')][_0x7f76('0x47')](_0x39bbef[_0x7f76('0x48')],{})[_0x7f76('0x24')](respondWithResult(_0x487b1f,0xc9))['catch'](handleError(_0x487b1f,null));};exports[_0x7f76('0x49')]=function(_0xd87fe7,_0x53f77a){if(_0xd87fe7[_0x7f76('0x48')]['id']){delete _0xd87fe7[_0x7f76('0x48')]['id'];}return db[_0x7f76('0x29')]['find']({'where':{'id':_0xd87fe7[_0x7f76('0x41')]['id']}})[_0x7f76('0x24')](handleEntityNotFound(_0x53f77a,null))[_0x7f76('0x24')](saveUpdates(_0xd87fe7[_0x7f76('0x48')],null))[_0x7f76('0x24')](respondWithResult(_0x53f77a,null))[_0x7f76('0x3f')](handleError(_0x53f77a,null));};exports[_0x7f76('0x4a')]=function(_0x42abd9,_0x1a4d3c){return db[_0x7f76('0x29')][_0x7f76('0x46')]({'where':{'id':_0x42abd9[_0x7f76('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a4d3c,null))[_0x7f76('0x24')](removeEntity(_0x1a4d3c,null))['catch'](handleError(_0x1a4d3c,null));};exports[_0x7f76('0x4b')]=function(_0x3bcd59,_0x171c71){return db['Cdr'][_0x7f76('0x4b')]()[_0x7f76('0x24')](respondWithResult(_0x171c71,null))['catch'](handleError(_0x171c71,null));};
\ No newline at end of file
+var _0xa990=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','json','save','update','then','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','findAll','catch','show','params','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware'];(function(_0x206f4b,_0x346117){var _0x20599c=function(_0x2f15b3){while(--_0x2f15b3){_0x206f4b['push'](_0x206f4b['shift']());}};_0x20599c(++_0x346117);}(_0xa990,0xc9));var _0x0a99=function(_0x3f1ca5,_0x4c9c36){_0x3f1ca5=_0x3f1ca5-0x0;var _0x193ab3=_0xa990[_0x3f1ca5];return _0x193ab3;};'use strict';var emlformat=require(_0x0a99('0x0'));var rimraf=require(_0x0a99('0x1'));var zipdir=require(_0x0a99('0x2'));var jsonpatch=require(_0x0a99('0x3'));var rp=require(_0x0a99('0x4'));var moment=require(_0x0a99('0x5'));var BPromise=require(_0x0a99('0x6'));var Mustache=require(_0x0a99('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0a99('0x8'));var csv=require(_0x0a99('0x9'));var ejs=require(_0x0a99('0xa'));var fs=require('fs');var fs_extra=require(_0x0a99('0xb'));var _=require(_0x0a99('0xc'));var squel=require(_0x0a99('0xd'));var crypto=require(_0x0a99('0xe'));var jsforce=require(_0x0a99('0xf'));var deskjs=require(_0x0a99('0x10'));var toCsv=require(_0x0a99('0x9'));var querystring=require(_0x0a99('0x11'));var Papa=require('papaparse');var Redis=require(_0x0a99('0x12'));var authService=require(_0x0a99('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a99('0x14'));var logger=require(_0x0a99('0x15'))(_0x0a99('0x16'));var utils=require(_0x0a99('0x17'));var config=require(_0x0a99('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a99('0x19'))['db'];function respondWithStatusCode(_0x3aaaad,_0x57ab88){_0x57ab88=_0x57ab88||0xcc;return function(_0xb6a34d){if(_0xb6a34d){return _0x3aaaad[_0x0a99('0x1a')](_0x57ab88);}return _0x3aaaad[_0x0a99('0x1b')](_0x57ab88)[_0x0a99('0x1c')]();};}function respondWithResult(_0x346061,_0x23d018){_0x23d018=_0x23d018||0xc8;return function(_0x18c124){if(_0x18c124){return _0x346061[_0x0a99('0x1b')](_0x23d018)['json'](_0x18c124);}};}function respondWithFilteredResult(_0x5a17e1,_0x2c40db){return function(_0x3ac17e){if(_0x3ac17e){var _0xb7356c=typeof _0x2c40db['offset']===_0x0a99('0x1d')&&typeof _0x2c40db['limit']==='undefined';var _0x20104c=_0x3ac17e[_0x0a99('0x1e')];var _0x3de006=_0xb7356c?0x0:_0x2c40db[_0x0a99('0x1f')];var _0x572ce5=_0xb7356c?_0x3ac17e['count']:_0x2c40db[_0x0a99('0x1f')]+_0x2c40db[_0x0a99('0x20')];var _0xbe23f3;if(_0x572ce5>=_0x20104c){_0x572ce5=_0x20104c;_0xbe23f3=0xc8;}else{_0xbe23f3=0xce;}_0x5a17e1[_0x0a99('0x1b')](_0xbe23f3);return _0x5a17e1['set']('Content-Range',_0x3de006+'-'+_0x572ce5+'/'+_0x20104c)[_0x0a99('0x21')](_0x3ac17e);}return null;};}function patchUpdates(_0x4d0c78){return function(_0x1e8d30){try{jsonpatch['apply'](_0x1e8d30,_0x4d0c78,!![]);}catch(_0x191ee4){return BPromise['reject'](_0x191ee4);}return _0x1e8d30[_0x0a99('0x22')]();};}function saveUpdates(_0x356681,_0x3b1d60){return function(_0x1c1e5c){if(_0x1c1e5c){return _0x1c1e5c[_0x0a99('0x23')](_0x356681)[_0x0a99('0x24')](function(_0x19c870){return _0x19c870;});}return null;};}function removeEntity(_0x1d803c,_0x398dd2){return function(_0x5745ca){if(_0x5745ca){return _0x5745ca['destroy']()[_0x0a99('0x24')](function(){_0x1d803c[_0x0a99('0x1b')](0xcc)[_0x0a99('0x1c')]();});}};}function handleEntityNotFound(_0x518617,_0x5d917c){return function(_0x371b31){if(!_0x371b31){_0x518617[_0x0a99('0x1a')](0x194);}return _0x371b31;};}function handleError(_0x1b0e94,_0x40e765){_0x40e765=_0x40e765||0x1f4;return function(_0x10e70f){logger[_0x0a99('0x25')](_0x10e70f[_0x0a99('0x26')]);if(_0x10e70f[_0x0a99('0x27')]){delete _0x10e70f[_0x0a99('0x27')];}_0x1b0e94['status'](_0x40e765)[_0x0a99('0x28')](_0x10e70f);};}exports['index']=function(_0x47bc34,_0x4e597b){var _0x223bdb={},_0x379c7e={},_0x13d26a={'count':0x0,'rows':[]};var _0x26c0c0=_[_0x0a99('0x29')](db[_0x0a99('0x2a')][_0x0a99('0x2b')],function(_0x47da33){return{'name':_0x47da33[_0x0a99('0x2c')],'type':_0x47da33[_0x0a99('0x2d')][_0x0a99('0x2e')]};});_0x379c7e[_0x0a99('0x2f')]=_['map'](_0x26c0c0,'name');_0x379c7e['query']=_[_0x0a99('0x30')](_0x47bc34[_0x0a99('0x31')]);_0x379c7e[_0x0a99('0x32')]=_['intersection'](_0x379c7e[_0x0a99('0x2f')],_0x379c7e[_0x0a99('0x31')]);_0x223bdb[_0x0a99('0x33')]=_[_0x0a99('0x34')](_0x379c7e[_0x0a99('0x2f')],qs[_0x0a99('0x35')](_0x47bc34[_0x0a99('0x31')]['fields']));_0x223bdb[_0x0a99('0x33')]=_0x223bdb[_0x0a99('0x33')][_0x0a99('0x36')]?_0x223bdb[_0x0a99('0x33')]:_0x379c7e[_0x0a99('0x2f')];if(!_0x47bc34['query'][_0x0a99('0x37')]('nolimit')){_0x223bdb['limit']=qs['limit'](_0x47bc34['query'][_0x0a99('0x20')]);_0x223bdb['offset']=qs[_0x0a99('0x1f')](_0x47bc34[_0x0a99('0x31')][_0x0a99('0x1f')]);}_0x223bdb[_0x0a99('0x38')]=qs[_0x0a99('0x39')](_0x47bc34[_0x0a99('0x31')][_0x0a99('0x39')]);_0x223bdb[_0x0a99('0x3a')]=qs[_0x0a99('0x32')](_[_0x0a99('0x3b')](_0x47bc34[_0x0a99('0x31')],_0x379c7e[_0x0a99('0x32')]),_0x26c0c0);if(_0x47bc34[_0x0a99('0x31')]['filter']){_0x223bdb[_0x0a99('0x3a')]=_[_0x0a99('0x3c')](_0x223bdb['where'],{'$or':_[_0x0a99('0x29')](_0x26c0c0,function(_0x549bb9){if(_0x549bb9[_0x0a99('0x2d')]!=='VIRTUAL'){var _0x541178={};_0x541178[_0x549bb9[_0x0a99('0x27')]]={'$like':'%'+_0x47bc34[_0x0a99('0x31')][_0x0a99('0x3d')]+'%'};return _0x541178;}})});}_0x223bdb=_['merge']({},_0x223bdb,_0x47bc34[_0x0a99('0x3e')]);var _0x11e046={'where':_0x223bdb[_0x0a99('0x3a')]};return db['Cdr'][_0x0a99('0x1e')](_0x11e046)[_0x0a99('0x24')](function(_0x23e4b9){_0x13d26a[_0x0a99('0x1e')]=_0x23e4b9;if(_0x47bc34['query'][_0x0a99('0x3f')]){_0x223bdb['include']=[{'all':!![]}];}return db['Cdr'][_0x0a99('0x40')](_0x223bdb);})['then'](function(_0x185495){_0x13d26a['rows']=_0x185495;return _0x13d26a;})[_0x0a99('0x24')](respondWithFilteredResult(_0x4e597b,_0x223bdb))[_0x0a99('0x41')](handleError(_0x4e597b,null));};exports[_0x0a99('0x42')]=function(_0x29da8a,_0x57b999){var _0xcee64a={'raw':!![],'where':{'id':_0x29da8a[_0x0a99('0x43')]['id']}},_0x97158c={};_0x97158c[_0x0a99('0x2f')]=_['keys'](db['Cdr']['rawAttributes']);_0x97158c[_0x0a99('0x31')]=_['keys'](_0x29da8a[_0x0a99('0x31')]);_0x97158c['filters']=_['intersection'](_0x97158c['model'],_0x97158c['query']);_0xcee64a[_0x0a99('0x33')]=_['intersection'](_0x97158c[_0x0a99('0x2f')],qs[_0x0a99('0x35')](_0x29da8a['query'][_0x0a99('0x35')]));_0xcee64a[_0x0a99('0x33')]=_0xcee64a['attributes'][_0x0a99('0x36')]?_0xcee64a['attributes']:_0x97158c[_0x0a99('0x2f')];if(_0x29da8a[_0x0a99('0x31')]['includeAll']){_0xcee64a[_0x0a99('0x44')]=[{'all':!![]}];}_0xcee64a=_['merge']({},_0xcee64a,_0x29da8a['options']);return db[_0x0a99('0x2a')][_0x0a99('0x45')](_0xcee64a)[_0x0a99('0x24')](handleEntityNotFound(_0x57b999,null))[_0x0a99('0x24')](respondWithResult(_0x57b999,null))[_0x0a99('0x41')](handleError(_0x57b999,null));};exports['create']=function(_0x476207,_0x174298){return db[_0x0a99('0x2a')][_0x0a99('0x46')](_0x476207[_0x0a99('0x47')],{})[_0x0a99('0x24')](respondWithResult(_0x174298,0xc9))[_0x0a99('0x41')](handleError(_0x174298,null));};exports[_0x0a99('0x23')]=function(_0x1cd328,_0x1621d9){if(_0x1cd328['body']['id']){delete _0x1cd328['body']['id'];}return db[_0x0a99('0x2a')][_0x0a99('0x45')]({'where':{'id':_0x1cd328[_0x0a99('0x43')]['id']}})[_0x0a99('0x24')](handleEntityNotFound(_0x1621d9,null))[_0x0a99('0x24')](saveUpdates(_0x1cd328[_0x0a99('0x47')],null))['then'](respondWithResult(_0x1621d9,null))[_0x0a99('0x41')](handleError(_0x1621d9,null));};exports[_0x0a99('0x48')]=function(_0x55fee0,_0x11ed07){return db[_0x0a99('0x2a')]['find']({'where':{'id':_0x55fee0[_0x0a99('0x43')]['id']}})[_0x0a99('0x24')](handleEntityNotFound(_0x11ed07,null))[_0x0a99('0x24')](removeEntity(_0x11ed07,null))[_0x0a99('0x41')](handleError(_0x11ed07,null));};exports[_0x0a99('0x49')]=function(_0x2411ea,_0xbdfb18){return db['Cdr'][_0x0a99('0x49')]()[_0x0a99('0x24')](respondWithResult(_0xbdfb18,null))[_0x0a99('0x41')](handleError(_0xbdfb18,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 60f2668..355e1aa 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(_0x25463d,_0x3f28fb){var _0x21ed76=function(_0x9ae3ce){while(--_0x9ae3ce){_0x25463d['push'](_0x25463d['shift']());}};_0x21ed76(++_0x3f28fb);}(_0x7a54,0x106));var _0x47a5=function(_0x5f546b,_0x594c94){_0x5f546b=_0x5f546b-0x0;var _0x11733d=_0x7a54[_0x5f546b];return _0x11733d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x189599,_0xdd106a){var _0x152ed2=function(_0x330775){while(--_0x330775){_0x189599['push'](_0x189599['shift']());}};_0x152ed2(++_0xdd106a);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 7fdb366..d627620 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 _0xfb10=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','Cdr,\x20%s,\x20%s','result','catch','util'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xfb10,0x1ed));var _0x0fb1=function(_0x405f33,_0x49fa77){_0x405f33=_0x405f33-0x0;var _0x3b9b8d=_0xfb10[_0x405f33];return _0x3b9b8d;};'use strict';var _=require('lodash');var util=require(_0x0fb1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0fb1('0x1'));var fs=require('fs');var Redis=require(_0x0fb1('0x2'));var db=require(_0x0fb1('0x3'))['db'];var utils=require(_0x0fb1('0x4'));var logger=require(_0x0fb1('0x5'))('rpc');var config=require(_0x0fb1('0x6'));var jayson=require(_0x0fb1('0x7'));var client=jayson[_0x0fb1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15a2e6,_0x5ddf18,_0x543f20){return new BPromise(function(_0x106ccd,_0x266e7c){return client['request'](_0x15a2e6,_0x543f20)[_0x0fb1('0x9')](function(_0x5d4d21){logger[_0x0fb1('0xa')]('Cdr,\x20%s,\x20%s',_0x5ddf18,'request\x20sent');logger[_0x0fb1('0xb')](_0x0fb1('0xc'),_0x5ddf18,'request\x20sent',JSON[_0x0fb1('0xd')](_0x5d4d21));if(_0x5d4d21[_0x0fb1('0xe')]){if(_0x5d4d21[_0x0fb1('0xe')]['code']===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x5ddf18,_0x5d4d21[_0x0fb1('0xe')][_0x0fb1('0xf')]);return _0x266e7c(_0x5d4d21[_0x0fb1('0xe')][_0x0fb1('0xf')]);}logger[_0x0fb1('0xe')](_0x0fb1('0x10'),_0x5ddf18,_0x5d4d21[_0x0fb1('0xe')][_0x0fb1('0xf')]);return _0x106ccd(_0x5d4d21[_0x0fb1('0xe')][_0x0fb1('0xf')]);}else{logger[_0x0fb1('0xa')](_0x0fb1('0x10'),_0x5ddf18,'request\x20sent');_0x106ccd(_0x5d4d21[_0x0fb1('0x11')][_0x0fb1('0xf')]);}})[_0x0fb1('0x12')](function(_0x465484){logger[_0x0fb1('0xe')](_0x0fb1('0x10'),_0x5ddf18,_0x465484);_0x266e7c(_0x465484);});});}
\ No newline at end of file
+var _0x97fc=['Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4042de,_0x31c003){var _0x408ce3=function(_0x37647a){while(--_0x37647a){_0x4042de['push'](_0x4042de['shift']());}};_0x408ce3(++_0x31c003);}(_0x97fc,0x193));var _0xc97f=function(_0x2ef83e,_0x3b64b4){_0x2ef83e=_0x2ef83e-0x0;var _0xdc5499=_0x97fc[_0x2ef83e];return _0xdc5499;};'use strict';var _=require(_0xc97f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc97f('0x1'));var rs=require(_0xc97f('0x2'));var fs=require('fs');var Redis=require(_0xc97f('0x3'));var db=require(_0xc97f('0x4'))['db'];var utils=require(_0xc97f('0x5'));var logger=require('../../config/logger')(_0xc97f('0x6'));var config=require('../../config/environment');var jayson=require(_0xc97f('0x7'));var client=jayson[_0xc97f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x475e52,_0x3a280b,_0x481735){return new BPromise(function(_0x3e4e65,_0x1f651e){return client[_0xc97f('0x9')](_0x475e52,_0x481735)[_0xc97f('0xa')](function(_0x5d51b6){logger[_0xc97f('0xb')](_0xc97f('0xc'),_0x3a280b,_0xc97f('0xd'));logger[_0xc97f('0xe')](_0xc97f('0xf'),_0x3a280b,_0xc97f('0xd'),JSON[_0xc97f('0x10')](_0x5d51b6));if(_0x5d51b6[_0xc97f('0x11')]){if(_0x5d51b6[_0xc97f('0x11')][_0xc97f('0x12')]===0x1f4){logger[_0xc97f('0x11')](_0xc97f('0xc'),_0x3a280b,_0x5d51b6[_0xc97f('0x11')][_0xc97f('0x13')]);return _0x1f651e(_0x5d51b6[_0xc97f('0x11')][_0xc97f('0x13')]);}logger['error'](_0xc97f('0xc'),_0x3a280b,_0x5d51b6[_0xc97f('0x11')][_0xc97f('0x13')]);return _0x3e4e65(_0x5d51b6[_0xc97f('0x11')][_0xc97f('0x13')]);}else{logger['info'](_0xc97f('0xc'),_0x3a280b,'request\x20sent');_0x3e4e65(_0x5d51b6[_0xc97f('0x14')]['message']);}})[_0xc97f('0x15')](function(_0x5b0763){logger[_0xc97f('0x11')]('Cdr,\x20%s,\x20%s',_0x3a280b,_0x5b0763);_0x1f651e(_0x5b0763);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 3cd8256..4b0cd35 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0xa06e0b,_0x6c2305){var _0x14142f=function(_0x2ac612){while(--_0x2ac612){_0xa06e0b['push'](_0xa06e0b['shift']());}};_0x14142f(++_0x6c2305);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x555bbd,_0x196748){var _0x3184d7=function(_0x274943){while(--_0x274943){_0x555bbd['push'](_0x555bbd['shift']());}};_0x3184d7(++_0x196748);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 6189207..2ce5dcb 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 _0x00a8=['*,*,*,*','sequelize','exports','STRING','TEXT'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x00a8,0x6f));var _0x800a=function(_0x411272,_0x5c5851){_0x411272=_0x411272-0x0;var _0x27f560=_0x00a8[_0x411272];return _0x27f560;};'use strict';var Sequelize=require(_0x800a('0x0'));module[_0x800a('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x800a('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x800a('0x3')]()},'description':{'type':Sequelize[_0x800a('0x2')]},'interval':{'type':Sequelize[_0x800a('0x2')],'defaultValue':_0x800a('0x4')}};
\ No newline at end of file
+var _0xfee2=['INTEGER','STRING','TEXT'];(function(_0x4df17c,_0x2d2b61){var _0x4e79b5=function(_0x2134a5){while(--_0x2134a5){_0x4df17c['push'](_0x4df17c['shift']());}};_0x4e79b5(++_0x2d2b61);}(_0xfee2,0x1ec));var _0x2fee=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xfee2[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x2fee('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x2fee('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2fee('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 42b1b80..74b8db8 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 _0xa45c=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','show','params','keys','ChatApplication','rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','request-promise','bluebird','util'];(function(_0x54bac5,_0x8d3a16){var _0xc15971=function(_0x254653){while(--_0x254653){_0x54bac5['push'](_0x54bac5['shift']());}};_0xc15971(++_0x8d3a16);}(_0xa45c,0x6d));var _0xca45=function(_0x289112,_0x36b9f2){_0x289112=_0x289112-0x0;var _0x19e669=_0xa45c[_0x289112];return _0x19e669;};'use strict';var emlformat=require(_0xca45('0x0'));var rimraf=require(_0xca45('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xca45('0x2'));var moment=require('moment');var BPromise=require(_0xca45('0x3'));var Mustache=require('mustache');var util=require(_0xca45('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xca45('0x5'));var ejs=require(_0xca45('0x6'));var fs=require('fs');var fs_extra=require(_0xca45('0x7'));var _=require(_0xca45('0x8'));var squel=require('squel');var crypto=require(_0xca45('0x9'));var jsforce=require(_0xca45('0xa'));var deskjs=require(_0xca45('0xb'));var toCsv=require(_0xca45('0x5'));var querystring=require(_0xca45('0xc'));var Papa=require('papaparse');var Redis=require(_0xca45('0xd'));var authService=require(_0xca45('0xe'));var qs=require(_0xca45('0xf'));var as=require(_0xca45('0x10'));var hardwareService=require(_0xca45('0x11'));var logger=require(_0xca45('0x12'))(_0xca45('0x13'));var utils=require('../../config/utils');var config=require(_0xca45('0x14'));var licenseUtil=require(_0xca45('0x15'));var db=require(_0xca45('0x16'))['db'];function respondWithStatusCode(_0x17ebf7,_0x580c43){_0x580c43=_0x580c43||0xcc;return function(_0x3044b1){if(_0x3044b1){return _0x17ebf7[_0xca45('0x17')](_0x580c43);}return _0x17ebf7[_0xca45('0x18')](_0x580c43)['end']();};}function respondWithResult(_0x214939,_0x569ba6){_0x569ba6=_0x569ba6||0xc8;return function(_0x22ce19){if(_0x22ce19){return _0x214939[_0xca45('0x18')](_0x569ba6)[_0xca45('0x19')](_0x22ce19);}};}function respondWithFilteredResult(_0x1c822d,_0x35b130){return function(_0x323b19){if(_0x323b19){var _0x18dd61=typeof _0x35b130['offset']===_0xca45('0x1a')&&typeof _0x35b130['limit']==='undefined';var _0x213986=_0x323b19[_0xca45('0x1b')];var _0x553af4=_0x18dd61?0x0:_0x35b130[_0xca45('0x1c')];var _0x184bbf=_0x18dd61?_0x323b19['count']:_0x35b130[_0xca45('0x1c')]+_0x35b130[_0xca45('0x1d')];var _0x446243;if(_0x184bbf>=_0x213986){_0x184bbf=_0x213986;_0x446243=0xc8;}else{_0x446243=0xce;}_0x1c822d[_0xca45('0x18')](_0x446243);return _0x1c822d['set'](_0xca45('0x1e'),_0x553af4+'-'+_0x184bbf+'/'+_0x213986)[_0xca45('0x19')](_0x323b19);}return null;};}function patchUpdates(_0x1a16f1){return function(_0xdea7de){try{jsonpatch['apply'](_0xdea7de,_0x1a16f1,!![]);}catch(_0x2c0a39){return BPromise[_0xca45('0x1f')](_0x2c0a39);}return _0xdea7de[_0xca45('0x20')]();};}function saveUpdates(_0x34bb8d,_0x2068df){return function(_0x3e8068){if(_0x3e8068){return _0x3e8068[_0xca45('0x21')](_0x34bb8d)[_0xca45('0x22')](function(_0x14cd25){return _0x14cd25;});}return null;};}function removeEntity(_0x4998b5,_0x3d9007){return function(_0x1acb89){if(_0x1acb89){return _0x1acb89[_0xca45('0x23')]()[_0xca45('0x22')](function(){_0x4998b5[_0xca45('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5927e2,_0x4d4869){return function(_0x28d9f1){if(!_0x28d9f1){_0x5927e2['sendStatus'](0x194);}return _0x28d9f1;};}function handleError(_0x5c36c7,_0x3547cd){_0x3547cd=_0x3547cd||0x1f4;return function(_0x3e3b03){logger[_0xca45('0x24')](_0x3e3b03[_0xca45('0x25')]);if(_0x3e3b03[_0xca45('0x26')]){delete _0x3e3b03['name'];}_0x5c36c7[_0xca45('0x18')](_0x3547cd)[_0xca45('0x27')](_0x3e3b03);};}exports[_0xca45('0x28')]=function(_0x4d546c,_0x4da9b6){var _0x592ad2={'raw':!![],'where':{'id':_0x4d546c[_0xca45('0x29')]['id']}},_0x430591={};_0x430591['model']=_[_0xca45('0x2a')](db[_0xca45('0x2b')][_0xca45('0x2c')]);_0x430591[_0xca45('0x2d')]=_['keys'](_0x4d546c['query']);_0x430591['filters']=_[_0xca45('0x2e')](_0x430591['model'],_0x430591['query']);_0x592ad2['attributes']=_[_0xca45('0x2e')](_0x430591['model'],qs['fields'](_0x4d546c[_0xca45('0x2d')][_0xca45('0x2f')]));_0x592ad2[_0xca45('0x30')]=_0x592ad2['attributes'][_0xca45('0x31')]?_0x592ad2[_0xca45('0x30')]:_0x430591['model'];if(_0x4d546c[_0xca45('0x2d')][_0xca45('0x32')]){_0x592ad2[_0xca45('0x33')]=[{'all':!![]}];}_0x592ad2=_[_0xca45('0x34')]({},_0x592ad2,_0x4d546c[_0xca45('0x35')]);return db[_0xca45('0x2b')][_0xca45('0x36')](_0x592ad2)[_0xca45('0x22')](handleEntityNotFound(_0x4da9b6,null))[_0xca45('0x22')](respondWithResult(_0x4da9b6,null))[_0xca45('0x37')](handleError(_0x4da9b6,null));};exports[_0xca45('0x21')]=function(_0x3045e7,_0x1d594c){if(_0x3045e7['body']['id']){delete _0x3045e7['body']['id'];}return db['ChatApplication'][_0xca45('0x36')]({'where':{'id':_0x3045e7[_0xca45('0x29')]['id']}})['then'](handleEntityNotFound(_0x1d594c,null))['then'](saveUpdates(_0x3045e7[_0xca45('0x38')],null))['then'](respondWithResult(_0x1d594c,null))[_0xca45('0x37')](handleError(_0x1d594c,null));};exports['destroy']=function(_0x4de1d0,_0x231043){return db[_0xca45('0x2b')][_0xca45('0x36')]({'where':{'id':_0x4de1d0[_0xca45('0x29')]['id']}})['then'](handleEntityNotFound(_0x231043,null))[_0xca45('0x22')](removeEntity(_0x231043,null))['catch'](handleError(_0x231043,null));};
\ No newline at end of file
+var _0x82b0=['length','attributes','includeAll','merge','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields'];(function(_0x32e2d7,_0x17e17c){var _0x356379=function(_0x2e6e5d){while(--_0x2e6e5d){_0x32e2d7['push'](_0x32e2d7['shift']());}};_0x356379(++_0x17e17c);}(_0x82b0,0x81));var _0x082b=function(_0x7abd7,_0x1ca3f9){_0x7abd7=_0x7abd7-0x0;var _0x3a2577=_0x82b0[_0x7abd7];return _0x3a2577;};'use strict';var emlformat=require(_0x082b('0x0'));var rimraf=require(_0x082b('0x1'));var zipdir=require(_0x082b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x082b('0x3'));var moment=require(_0x082b('0x4'));var BPromise=require(_0x082b('0x5'));var Mustache=require(_0x082b('0x6'));var util=require('util');var path=require(_0x082b('0x7'));var sox=require(_0x082b('0x8'));var csv=require(_0x082b('0x9'));var ejs=require(_0x082b('0xa'));var fs=require('fs');var fs_extra=require(_0x082b('0xb'));var _=require('lodash');var squel=require(_0x082b('0xc'));var crypto=require(_0x082b('0xd'));var jsforce=require(_0x082b('0xe'));var deskjs=require(_0x082b('0xf'));var toCsv=require(_0x082b('0x9'));var querystring=require(_0x082b('0x10'));var Papa=require(_0x082b('0x11'));var Redis=require(_0x082b('0x12'));var authService=require(_0x082b('0x13'));var qs=require(_0x082b('0x14'));var as=require(_0x082b('0x15'));var hardwareService=require(_0x082b('0x16'));var logger=require(_0x082b('0x17'))(_0x082b('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x082b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54bffb,_0x1c1f9d){_0x1c1f9d=_0x1c1f9d||0xcc;return function(_0x324251){if(_0x324251){return _0x54bffb['sendStatus'](_0x1c1f9d);}return _0x54bffb[_0x082b('0x1a')](_0x1c1f9d)[_0x082b('0x1b')]();};}function respondWithResult(_0x27bc44,_0x1f0c32){_0x1f0c32=_0x1f0c32||0xc8;return function(_0x40e206){if(_0x40e206){return _0x27bc44['status'](_0x1f0c32)[_0x082b('0x1c')](_0x40e206);}};}function respondWithFilteredResult(_0x1dc46e,_0x49db08){return function(_0x2c4f86){if(_0x2c4f86){var _0x588d8a=typeof _0x49db08[_0x082b('0x1d')]===_0x082b('0x1e')&&typeof _0x49db08['limit']===_0x082b('0x1e');var _0x4785fb=_0x2c4f86[_0x082b('0x1f')];var _0x3aa0ed=_0x588d8a?0x0:_0x49db08['offset'];var _0x2772e9=_0x588d8a?_0x2c4f86[_0x082b('0x1f')]:_0x49db08[_0x082b('0x1d')]+_0x49db08[_0x082b('0x20')];var _0x1e8fa5;if(_0x2772e9>=_0x4785fb){_0x2772e9=_0x4785fb;_0x1e8fa5=0xc8;}else{_0x1e8fa5=0xce;}_0x1dc46e[_0x082b('0x1a')](_0x1e8fa5);return _0x1dc46e[_0x082b('0x21')](_0x082b('0x22'),_0x3aa0ed+'-'+_0x2772e9+'/'+_0x4785fb)['json'](_0x2c4f86);}return null;};}function patchUpdates(_0x9faf2){return function(_0x2fffc3){try{jsonpatch[_0x082b('0x23')](_0x2fffc3,_0x9faf2,!![]);}catch(_0x5aab0a){return BPromise[_0x082b('0x24')](_0x5aab0a);}return _0x2fffc3[_0x082b('0x25')]();};}function saveUpdates(_0x42c0ab,_0x56fbd2){return function(_0x47c0d9){if(_0x47c0d9){return _0x47c0d9[_0x082b('0x26')](_0x42c0ab)['then'](function(_0x5cb670){return _0x5cb670;});}return null;};}function removeEntity(_0x3ae657,_0xaa7eb){return function(_0x271340){if(_0x271340){return _0x271340[_0x082b('0x27')]()[_0x082b('0x28')](function(){_0x3ae657['status'](0xcc)[_0x082b('0x1b')]();});}};}function handleEntityNotFound(_0x1254fd,_0x40d737){return function(_0x1082bf){if(!_0x1082bf){_0x1254fd[_0x082b('0x29')](0x194);}return _0x1082bf;};}function handleError(_0x8c3c9,_0x1b6dfc){_0x1b6dfc=_0x1b6dfc||0x1f4;return function(_0x4e30e8){logger[_0x082b('0x2a')](_0x4e30e8['stack']);if(_0x4e30e8[_0x082b('0x2b')]){delete _0x4e30e8['name'];}_0x8c3c9[_0x082b('0x1a')](_0x1b6dfc)[_0x082b('0x2c')](_0x4e30e8);};}exports['show']=function(_0x2279d7,_0x4b172b){var _0x228a5a={'raw':!![],'where':{'id':_0x2279d7[_0x082b('0x2d')]['id']}},_0x55d059={};_0x55d059[_0x082b('0x2e')]=_[_0x082b('0x2f')](db[_0x082b('0x30')][_0x082b('0x31')]);_0x55d059[_0x082b('0x32')]=_[_0x082b('0x2f')](_0x2279d7[_0x082b('0x32')]);_0x55d059[_0x082b('0x33')]=_[_0x082b('0x34')](_0x55d059[_0x082b('0x2e')],_0x55d059[_0x082b('0x32')]);_0x228a5a['attributes']=_[_0x082b('0x34')](_0x55d059[_0x082b('0x2e')],qs[_0x082b('0x35')](_0x2279d7[_0x082b('0x32')][_0x082b('0x35')]));_0x228a5a['attributes']=_0x228a5a['attributes'][_0x082b('0x36')]?_0x228a5a[_0x082b('0x37')]:_0x55d059['model'];if(_0x2279d7[_0x082b('0x32')][_0x082b('0x38')]){_0x228a5a['include']=[{'all':!![]}];}_0x228a5a=_[_0x082b('0x39')]({},_0x228a5a,_0x2279d7['options']);return db[_0x082b('0x30')][_0x082b('0x3a')](_0x228a5a)['then'](handleEntityNotFound(_0x4b172b,null))[_0x082b('0x28')](respondWithResult(_0x4b172b,null))[_0x082b('0x3b')](handleError(_0x4b172b,null));};exports[_0x082b('0x26')]=function(_0x16880f,_0x171bd8){if(_0x16880f['body']['id']){delete _0x16880f[_0x082b('0x3c')]['id'];}return db['ChatApplication'][_0x082b('0x3a')]({'where':{'id':_0x16880f[_0x082b('0x2d')]['id']}})[_0x082b('0x28')](handleEntityNotFound(_0x171bd8,null))[_0x082b('0x28')](saveUpdates(_0x16880f[_0x082b('0x3c')],null))[_0x082b('0x28')](respondWithResult(_0x171bd8,null))[_0x082b('0x3b')](handleError(_0x171bd8,null));};exports[_0x082b('0x27')]=function(_0x56f15c,_0x1e4745){return db[_0x082b('0x30')]['find']({'where':{'id':_0x56f15c[_0x082b('0x2d')]['id']}})[_0x082b('0x28')](handleEntityNotFound(_0x1e4745,null))[_0x082b('0x28')](removeEntity(_0x1e4745,null))[_0x082b('0x3b')](handleError(_0x1e4745,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index dd6da38..ed8fa29 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 _0xe7b3=['moment','bluebird','request-promise','rimraf','exports','define','lodash','api'];(function(_0x47872a,_0x2919a9){var _0x1cc71b=function(_0x275781){while(--_0x275781){_0x47872a['push'](_0x47872a['shift']());}};_0x1cc71b(++_0x2919a9);}(_0xe7b3,0x1b6));var _0x3e7b=function(_0x421322,_0x263804){_0x421322=_0x421322-0x0;var _0x48899e=_0xe7b3[_0x421322];return _0x48899e;};'use strict';var _=require(_0x3e7b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3e7b('0x1'));var moment=require(_0x3e7b('0x2'));var BPromise=require(_0x3e7b('0x3'));var rp=require(_0x3e7b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e7b('0x5'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0x3e7b('0x6')]=function(_0x1ac21f,_0x2506c4){return _0x1ac21f[_0x3e7b('0x7')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x20bc=['chat_applications','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','ChatApplication'];(function(_0x275cea,_0x3cc1eb){var _0x5691bd=function(_0x176fd1){while(--_0x176fd1){_0x275cea['push'](_0x275cea['shift']());}};_0x5691bd(++_0x3cc1eb);}(_0x20bc,0x1c5));var _0xc20b=function(_0x2e9b5b,_0x3e1332){_0x2e9b5b=_0x2e9b5b-0x0;var _0x734c46=_0x20bc[_0x2e9b5b];return _0x734c46;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc20b('0x0'))(_0xc20b('0x1'));var moment=require(_0xc20b('0x2'));var BPromise=require(_0xc20b('0x3'));var rp=require(_0xc20b('0x4'));var fs=require('fs');var path=require(_0xc20b('0x5'));var rimraf=require('rimraf');var config=require(_0xc20b('0x6'));var attributes=require('./chatApplication.attributes');module[_0xc20b('0x7')]=function(_0x18de6c,_0x5828da){return _0x18de6c['define'](_0xc20b('0x8'),attributes,{'tableName':_0xc20b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc20b('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 91249c2..0886366 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 _0xa923=['client','request','then','info','ChatApplication,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa923,0xa5));var _0x3a92=function(_0x511a9a,_0x2f28e6){_0x511a9a=_0x511a9a-0x0;var _0x46b11e=_0xa923[_0x511a9a];return _0x46b11e;};'use strict';var _=require(_0x3a92('0x0'));var util=require(_0x3a92('0x1'));var moment=require(_0x3a92('0x2'));var BPromise=require(_0x3a92('0x3'));var rs=require(_0x3a92('0x4'));var fs=require('fs');var Redis=require(_0x3a92('0x5'));var db=require(_0x3a92('0x6'))['db'];var utils=require(_0x3a92('0x7'));var logger=require(_0x3a92('0x8'))('rpc');var config=require(_0x3a92('0x9'));var jayson=require(_0x3a92('0xa'));var client=jayson[_0x3a92('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c9cc0,_0x389161,_0xe64a53){return new BPromise(function(_0x4c3386,_0x865afe){return client[_0x3a92('0xc')](_0x4c9cc0,_0xe64a53)[_0x3a92('0xd')](function(_0x2f4e3d){logger[_0x3a92('0xe')](_0x3a92('0xf'),_0x389161,'request\x20sent');logger[_0x3a92('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x389161,_0x3a92('0x11'),JSON['stringify'](_0x2f4e3d));if(_0x2f4e3d['error']){if(_0x2f4e3d[_0x3a92('0x12')][_0x3a92('0x13')]===0x1f4){logger['error'](_0x3a92('0xf'),_0x389161,_0x2f4e3d[_0x3a92('0x12')]['message']);return _0x865afe(_0x2f4e3d[_0x3a92('0x12')][_0x3a92('0x14')]);}logger['error'](_0x3a92('0xf'),_0x389161,_0x2f4e3d[_0x3a92('0x12')]['message']);return _0x4c3386(_0x2f4e3d[_0x3a92('0x12')][_0x3a92('0x14')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x389161,_0x3a92('0x11'));_0x4c3386(_0x2f4e3d[_0x3a92('0x15')][_0x3a92('0x14')]);}})['catch'](function(_0x41d1e5){logger['error'](_0x3a92('0xf'),_0x389161,_0x41d1e5);_0x865afe(_0x41d1e5);});});}
\ No newline at end of file
+var _0x56f4=['request\x20sent','stringify','error','code','message','catch','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','ChatApplication,\x20%s,\x20%s'];(function(_0x1b1b7b,_0xf3cb03){var _0x4d3852=function(_0x2d5494){while(--_0x2d5494){_0x1b1b7b['push'](_0x1b1b7b['shift']());}};_0x4d3852(++_0xf3cb03);}(_0x56f4,0x6f));var _0x456f=function(_0x119091,_0x118d6d){_0x119091=_0x119091-0x0;var _0x503f8c=_0x56f4[_0x119091];return _0x503f8c;};'use strict';var _=require(_0x456f('0x0'));var util=require(_0x456f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x456f('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x456f('0x3'))(_0x456f('0x4'));var config=require(_0x456f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x456f('0x6')][_0x456f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3fcec2,_0x206a99,_0x39b92e){return new BPromise(function(_0x118494,_0x2abb4c){return client['request'](_0x3fcec2,_0x39b92e)['then'](function(_0x423fa4){logger['info'](_0x456f('0x8'),_0x206a99,_0x456f('0x9'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x206a99,_0x456f('0x9'),JSON[_0x456f('0xa')](_0x423fa4));if(_0x423fa4[_0x456f('0xb')]){if(_0x423fa4['error'][_0x456f('0xc')]===0x1f4){logger['error'](_0x456f('0x8'),_0x206a99,_0x423fa4[_0x456f('0xb')][_0x456f('0xd')]);return _0x2abb4c(_0x423fa4['error'][_0x456f('0xd')]);}logger[_0x456f('0xb')](_0x456f('0x8'),_0x206a99,_0x423fa4[_0x456f('0xb')]['message']);return _0x118494(_0x423fa4['error'][_0x456f('0xd')]);}else{logger['info'](_0x456f('0x8'),_0x206a99,_0x456f('0x9'));_0x118494(_0x423fa4['result'][_0x456f('0xd')]);}})[_0x456f('0xe')](function(_0x320624){logger[_0x456f('0xb')](_0x456f('0x8'),_0x206a99,_0x320624);_0x2abb4c(_0x320624);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 556ff25..736ccb0 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 _0xf151=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','show','put','/:id','isAuthenticated','delete','destroy','exports','multer'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xf151,0x1af));var _0x1f15=function(_0x295c83,_0x3d922c){_0x295c83=_0x295c83-0x0;var _0xb99aed=_0xf151[_0x295c83];return _0xb99aed;};'use strict';var multer=require(_0x1f15('0x0'));var util=require(_0x1f15('0x1'));var path=require(_0x1f15('0x2'));var timeout=require(_0x1f15('0x3'));var express=require(_0x1f15('0x4'));var router=express[_0x1f15('0x5')]();var fs_extra=require(_0x1f15('0x6'));var auth=require(_0x1f15('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1f15('0x8'));var controller=require(_0x1f15('0x9'));router[_0x1f15('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1f15('0xb')]);router[_0x1f15('0xc')](_0x1f15('0xd'),auth[_0x1f15('0xe')](),controller['update']);router[_0x1f15('0xf')]('/:id',auth[_0x1f15('0xe')](),controller[_0x1f15('0x10')]);module[_0x1f15('0x11')]=router;
\ No newline at end of file
+var _0x1f31=['util','path','express','Router','fs-extra','../../components/interaction/service','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','destroy'];(function(_0x2e4e9f,_0x85c591){var _0x4e84dd=function(_0x27a81d){while(--_0x27a81d){_0x2e4e9f['push'](_0x2e4e9f['shift']());}};_0x4e84dd(++_0x85c591);}(_0x1f31,0xa8));var _0x11f3=function(_0xbec8e6,_0x2841b5){_0xbec8e6=_0xbec8e6-0x0;var _0x4aa6f2=_0x1f31[_0xbec8e6];return _0x4aa6f2;};'use strict';var multer=require('multer');var util=require(_0x11f3('0x0'));var path=require(_0x11f3('0x1'));var timeout=require('connect-timeout');var express=require(_0x11f3('0x2'));var router=express[_0x11f3('0x3')]();var fs_extra=require(_0x11f3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x11f3('0x5'));var config=require('../../config/environment');var controller=require(_0x11f3('0x6'));router[_0x11f3('0x7')](_0x11f3('0x8'),auth['isAuthenticated'](),controller[_0x11f3('0x9')]);router[_0x11f3('0xa')]('/:id',auth[_0x11f3('0xb')](),controller[_0x11f3('0xc')]);router['delete'](_0x11f3('0x8'),auth[_0x11f3('0xb')](),controller[_0x11f3('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 8dac48a..51a0a39 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 _0x0496=['BOOLEAN','sequelize','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0496,0x199));var _0x6049=function(_0x3d3ed3,_0x5de6fe){_0x3d3ed3=_0x3d3ed3-0x0;var _0x10223f=_0x0496[_0x3d3ed3];return _0x10223f;};'use strict';var Sequelize=require(_0x6049('0x0'));module['exports']={'name':{'type':Sequelize[_0x6049('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6049('0x1')]},'write':{'type':Sequelize[_0x6049('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x6f08=['sequelize','exports','STRING','BOOLEAN'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x6f08,0x9c));var _0x86f0=function(_0x12b21a,_0x3f846e){_0x12b21a=_0x12b21a-0x0;var _0x235760=_0x6f08[_0x12b21a];return _0x235760;};'use strict';var Sequelize=require(_0x86f0('0x0'));module[_0x86f0('0x1')]={'name':{'type':Sequelize[_0x86f0('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x86f0('0x2')]},'write':{'type':Sequelize[_0x86f0('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 0fb1a70..135ecec 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 _0x8885=['../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','then','destroy','error','name','send','index','map','ChatGroup','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','pick','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x118be1,_0x2ee67b){var _0x402517=function(_0x1a3526){while(--_0x1a3526){_0x118be1['push'](_0x118be1['shift']());}};_0x402517(++_0x2ee67b);}(_0x8885,0xab));var _0x5888=function(_0xa22f4e,_0x205c84){_0xa22f4e=_0xa22f4e-0x0;var _0xb2a0a9=_0x8885[_0xa22f4e];return _0xb2a0a9;};'use strict';var emlformat=require(_0x5888('0x0'));var rimraf=require(_0x5888('0x1'));var zipdir=require(_0x5888('0x2'));var jsonpatch=require(_0x5888('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5888('0x4'));var Mustache=require(_0x5888('0x5'));var util=require(_0x5888('0x6'));var path=require(_0x5888('0x7'));var sox=require(_0x5888('0x8'));var csv=require('to-csv');var ejs=require(_0x5888('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5888('0xa'));var squel=require(_0x5888('0xb'));var crypto=require(_0x5888('0xc'));var jsforce=require(_0x5888('0xd'));var deskjs=require(_0x5888('0xe'));var toCsv=require(_0x5888('0xf'));var querystring=require(_0x5888('0x10'));var Papa=require(_0x5888('0x11'));var Redis=require(_0x5888('0x12'));var authService=require(_0x5888('0x13'));var qs=require(_0x5888('0x14'));var as=require(_0x5888('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5888('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x5888('0x17'));var licenseUtil=require(_0x5888('0x18'));var db=require(_0x5888('0x19'))['db'];config['redis']=_['defaults'](config[_0x5888('0x1a')],{'host':_0x5888('0x1b'),'port':0x18eb});var socket=require(_0x5888('0x1c'))(new Redis(config[_0x5888('0x1a')]));require(_0x5888('0x1d'))[_0x5888('0x1e')](socket);function respondWithStatusCode(_0x52dce8,_0x1f1402){_0x1f1402=_0x1f1402||0xcc;return function(_0x123f07){if(_0x123f07){return _0x52dce8['sendStatus'](_0x1f1402);}return _0x52dce8[_0x5888('0x1f')](_0x1f1402)[_0x5888('0x20')]();};}function respondWithResult(_0x28dc21,_0x4df586){_0x4df586=_0x4df586||0xc8;return function(_0x81a3cd){if(_0x81a3cd){return _0x28dc21[_0x5888('0x1f')](_0x4df586)[_0x5888('0x21')](_0x81a3cd);}};}function respondWithFilteredResult(_0x224370,_0x1d99c2){return function(_0x4a9347){if(_0x4a9347){var _0x2616b3=typeof _0x1d99c2[_0x5888('0x22')]==='undefined'&&typeof _0x1d99c2[_0x5888('0x23')]===_0x5888('0x24');var _0x5cf452=_0x4a9347[_0x5888('0x25')];var _0x572ac8=_0x2616b3?0x0:_0x1d99c2['offset'];var _0x38098f=_0x2616b3?_0x4a9347[_0x5888('0x25')]:_0x1d99c2[_0x5888('0x22')]+_0x1d99c2[_0x5888('0x23')];var _0x233768;if(_0x38098f>=_0x5cf452){_0x38098f=_0x5cf452;_0x233768=0xc8;}else{_0x233768=0xce;}_0x224370[_0x5888('0x1f')](_0x233768);return _0x224370['set'](_0x5888('0x26'),_0x572ac8+'-'+_0x38098f+'/'+_0x5cf452)[_0x5888('0x21')](_0x4a9347);}return null;};}function patchUpdates(_0x772c14){return function(_0x5d537b){try{jsonpatch['apply'](_0x5d537b,_0x772c14,!![]);}catch(_0xede875){return BPromise[_0x5888('0x27')](_0xede875);}return _0x5d537b[_0x5888('0x28')]();};}function saveUpdates(_0x58c087,_0x5f388b){return function(_0x195e4a){if(_0x195e4a){return _0x195e4a['update'](_0x58c087)[_0x5888('0x29')](function(_0x419f5a){return _0x419f5a;});}return null;};}function removeEntity(_0x427ff2,_0x2a5deb){return function(_0x1b2bdf){if(_0x1b2bdf){return _0x1b2bdf[_0x5888('0x2a')]()[_0x5888('0x29')](function(){_0x427ff2[_0x5888('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c761d,_0x553663){return function(_0x4a660b){if(!_0x4a660b){_0x5c761d['sendStatus'](0x194);}return _0x4a660b;};}function handleError(_0x2a7357,_0x4fd949){_0x4fd949=_0x4fd949||0x1f4;return function(_0x42fbb3){logger[_0x5888('0x2b')](_0x42fbb3['stack']);if(_0x42fbb3[_0x5888('0x2c')]){delete _0x42fbb3[_0x5888('0x2c')];}_0x2a7357[_0x5888('0x1f')](_0x4fd949)[_0x5888('0x2d')](_0x42fbb3);};}exports[_0x5888('0x2e')]=function(_0x596967,_0x3d164c){var _0x35e474={},_0x1ec968={},_0xa784a4={'count':0x0,'rows':[]};var _0x3ed3e9=_[_0x5888('0x2f')](db[_0x5888('0x30')][_0x5888('0x31')],function(_0x3d67b3){return{'name':_0x3d67b3['fieldName'],'type':_0x3d67b3['type']['key']};});_0x1ec968[_0x5888('0x32')]=_['map'](_0x3ed3e9,_0x5888('0x2c'));_0x1ec968[_0x5888('0x33')]=_[_0x5888('0x34')](_0x596967['query']);_0x1ec968[_0x5888('0x35')]=_[_0x5888('0x36')](_0x1ec968[_0x5888('0x32')],_0x1ec968[_0x5888('0x33')]);_0x35e474[_0x5888('0x37')]=_[_0x5888('0x36')](_0x1ec968['model'],qs[_0x5888('0x38')](_0x596967[_0x5888('0x33')]['fields']));_0x35e474[_0x5888('0x37')]=_0x35e474['attributes'][_0x5888('0x39')]?_0x35e474[_0x5888('0x37')]:_0x1ec968['model'];if(!_0x596967[_0x5888('0x33')][_0x5888('0x3a')]('nolimit')){_0x35e474[_0x5888('0x23')]=qs[_0x5888('0x23')](_0x596967[_0x5888('0x33')][_0x5888('0x23')]);_0x35e474[_0x5888('0x22')]=qs[_0x5888('0x22')](_0x596967[_0x5888('0x33')][_0x5888('0x22')]);}_0x35e474[_0x5888('0x3b')]=qs[_0x5888('0x3c')](_0x596967['query']['sort']);_0x35e474[_0x5888('0x3d')]=qs[_0x5888('0x35')](_['pick'](_0x596967['query'],_0x1ec968[_0x5888('0x35')]),_0x3ed3e9);if(_0x596967[_0x5888('0x33')][_0x5888('0x3e')]){_0x35e474[_0x5888('0x3d')]=_[_0x5888('0x3f')](_0x35e474['where'],{'$or':_[_0x5888('0x2f')](_0x3ed3e9,function(_0x3860e4){if(_0x3860e4[_0x5888('0x40')]!==_0x5888('0x41')){var _0x426c46={};_0x426c46[_0x3860e4[_0x5888('0x2c')]]={'$like':'%'+_0x596967[_0x5888('0x33')]['filter']+'%'};return _0x426c46;}})});}_0x35e474=_[_0x5888('0x3f')]({},_0x35e474,_0x596967[_0x5888('0x42')]);var _0x43beb1={'where':_0x35e474[_0x5888('0x3d')]};return db['ChatGroup']['count'](_0x43beb1)['then'](function(_0xdd2d95){_0xa784a4[_0x5888('0x25')]=_0xdd2d95;if(_0x596967['query'][_0x5888('0x43')]){_0x35e474[_0x5888('0x44')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x35e474);})[_0x5888('0x29')](function(_0x414fc6){_0xa784a4[_0x5888('0x45')]=_0x414fc6;return _0xa784a4;})[_0x5888('0x29')](respondWithFilteredResult(_0x3d164c,_0x35e474))[_0x5888('0x46')](handleError(_0x3d164c,null));};exports[_0x5888('0x47')]=function(_0xff0313,_0x50ccd1){var _0x25eae5={'raw':!![],'where':{'id':_0xff0313[_0x5888('0x48')]['id']}},_0x28f1a0={};_0x28f1a0['model']=_[_0x5888('0x34')](db['ChatGroup'][_0x5888('0x31')]);_0x28f1a0[_0x5888('0x33')]=_[_0x5888('0x34')](_0xff0313['query']);_0x28f1a0['filters']=_[_0x5888('0x36')](_0x28f1a0['model'],_0x28f1a0['query']);_0x25eae5['attributes']=_['intersection'](_0x28f1a0[_0x5888('0x32')],qs[_0x5888('0x38')](_0xff0313[_0x5888('0x33')][_0x5888('0x38')]));_0x25eae5['attributes']=_0x25eae5['attributes'][_0x5888('0x39')]?_0x25eae5[_0x5888('0x37')]:_0x28f1a0[_0x5888('0x32')];if(_0xff0313[_0x5888('0x33')][_0x5888('0x43')]){_0x25eae5['include']=[{'all':!![]}];}_0x25eae5=_[_0x5888('0x3f')]({},_0x25eae5,_0xff0313[_0x5888('0x42')]);return db[_0x5888('0x30')][_0x5888('0x49')](_0x25eae5)[_0x5888('0x29')](handleEntityNotFound(_0x50ccd1,null))[_0x5888('0x29')](respondWithResult(_0x50ccd1,null))[_0x5888('0x46')](handleError(_0x50ccd1,null));};exports[_0x5888('0x4a')]=function(_0x5c226d,_0x2296d0){return db[_0x5888('0x30')]['create'](_0x5c226d[_0x5888('0x4b')],{})['then'](respondWithResult(_0x2296d0,0xc9))[_0x5888('0x46')](handleError(_0x2296d0,null));};exports['update']=function(_0xe076d9,_0x15de42){if(_0xe076d9[_0x5888('0x4b')]['id']){delete _0xe076d9[_0x5888('0x4b')]['id'];}return db[_0x5888('0x30')][_0x5888('0x49')]({'where':{'id':_0xe076d9[_0x5888('0x48')]['id']}})['then'](handleEntityNotFound(_0x15de42,null))[_0x5888('0x29')](saveUpdates(_0xe076d9['body'],null))[_0x5888('0x29')](respondWithResult(_0x15de42,null))[_0x5888('0x46')](handleError(_0x15de42,null));};exports[_0x5888('0x2a')]=function(_0x40ad6c,_0x8cab23){return db[_0x5888('0x30')][_0x5888('0x49')]({'where':{'id':_0x40ad6c[_0x5888('0x48')]['id']}})[_0x5888('0x29')](handleEntityNotFound(_0x8cab23,null))[_0x5888('0x29')](removeEntity(_0x8cab23,null))[_0x5888('0x46')](handleError(_0x8cab23,null));};exports['describe']=function(_0x4be6f1,_0x1356e8){return db[_0x5888('0x30')][_0x5888('0x4c')]()[_0x5888('0x29')](respondWithResult(_0x1356e8,null))[_0x5888('0x46')](handleError(_0x1356e8,null));};exports[_0x5888('0x4d')]=function(_0x4f5556,_0x5780dd,_0x1f37d4){return db[_0x5888('0x4e')]['count']({'where':{'ChatGroupId':_0x4f5556['params']['id'],'ToId':_0x4f5556[_0x5888('0x4f')]['id'],'read':![]}})[_0x5888('0x29')](function(_0x4e7473){return{'id':_[_0x5888('0x50')](_0x4f5556[_0x5888('0x48')]['id']),'count':_0x4e7473};})['then'](respondWithResult(_0x5780dd,null))[_0x5888('0x46')](handleError(_0x5780dd,null));};exports[_0x5888('0x51')]=function(_0x1a8b54,_0x4a2320,_0x36cae6){return db[_0x5888('0x30')][_0x5888('0x49')]({'where':{'id':_0x1a8b54[_0x5888('0x48')]['id']}})[_0x5888('0x29')](handleEntityNotFound(_0x4a2320,null))[_0x5888('0x29')](function(_0x4a5eeb){if(_0x4a5eeb){return _0x4a5eeb[_0x5888('0x51')](_0x1a8b54[_0x5888('0x4b')][_0x5888('0x52')],_[_0x5888('0x53')](_0x1a8b54['body'],[_0x5888('0x52'),'id'])||{});}})[_0x5888('0x29')](respondWithResult(_0x4a2320,null))[_0x5888('0x46')](handleError(_0x4a2320,null));};exports[_0x5888('0x54')]=function(_0x35ad7b,_0x284bac,_0x5bd138){var _0x3c62f8={};var _0x43a9c6={};var _0x5f412a;var _0x5d6b29;return db[_0x5888('0x30')][_0x5888('0x55')]({'where':{'id':_0x35ad7b['params']['id']}})['then'](handleEntityNotFound(_0x284bac,null))[_0x5888('0x29')](function(_0x4aa449){if(_0x4aa449){_0x5f412a=_0x4aa449;_0x43a9c6[_0x5888('0x32')]=_[_0x5888('0x34')](db[_0x5888('0x56')][_0x5888('0x31')]);_0x43a9c6[_0x5888('0x33')]=_[_0x5888('0x34')](_0x35ad7b[_0x5888('0x33')]);_0x43a9c6[_0x5888('0x35')]=_[_0x5888('0x36')](_0x43a9c6[_0x5888('0x32')],_0x43a9c6[_0x5888('0x33')]);_0x3c62f8[_0x5888('0x37')]=_[_0x5888('0x36')](_0x43a9c6[_0x5888('0x32')],qs['fields'](_0x35ad7b[_0x5888('0x33')][_0x5888('0x38')]));_0x3c62f8['attributes']=_0x3c62f8[_0x5888('0x37')]['length']?_0x3c62f8[_0x5888('0x37')]:_0x43a9c6[_0x5888('0x32')];_0x3c62f8[_0x5888('0x3b')]=qs[_0x5888('0x3c')](_0x35ad7b[_0x5888('0x33')][_0x5888('0x3c')]);_0x3c62f8[_0x5888('0x3d')]=qs[_0x5888('0x35')](_['pick'](_0x35ad7b[_0x5888('0x33')],_0x43a9c6[_0x5888('0x35')]));if(_0x35ad7b['query'][_0x5888('0x3e')]){_0x3c62f8[_0x5888('0x3d')]=_[_0x5888('0x3f')](_0x3c62f8[_0x5888('0x3d')],{'$or':_[_0x5888('0x2f')](_0x3c62f8[_0x5888('0x37')],function(_0x4947db){var _0x1083e7={};_0x1083e7[_0x4947db]={'$like':'%'+_0x35ad7b[_0x5888('0x33')]['filter']+'%'};return _0x1083e7;})});}_0x3c62f8=_[_0x5888('0x3f')]({},_0x3c62f8,_0x35ad7b[_0x5888('0x42')]);return _0x5f412a[_0x5888('0x54')](_0x3c62f8);}})[_0x5888('0x29')](function(_0x55ec97){if(_0x55ec97){_0x5d6b29=_0x55ec97[_0x5888('0x39')];if(!_0x35ad7b[_0x5888('0x33')][_0x5888('0x3a')]('nolimit')){_0x3c62f8[_0x5888('0x23')]=qs['limit'](_0x35ad7b[_0x5888('0x33')]['limit']);_0x3c62f8[_0x5888('0x22')]=qs[_0x5888('0x22')](_0x35ad7b[_0x5888('0x33')]['offset']);}return _0x5f412a[_0x5888('0x54')](_0x3c62f8);}})[_0x5888('0x29')](function(_0x2a4fa2){if(_0x2a4fa2){return _0x2a4fa2?{'count':_0x5d6b29,'rows':_0x2a4fa2}:null;}})['then'](respondWithResult(_0x284bac,null))['catch'](handleError(_0x284bac,null));};exports[_0x5888('0x57')]=function(_0x559862,_0x1ddca2,_0x368417){return db['ChatGroup'][_0x5888('0x49')]({'where':{'id':_0x559862[_0x5888('0x48')]['id']}})[_0x5888('0x29')](handleEntityNotFound(_0x1ddca2,null))[_0x5888('0x29')](function(_0x4aa10f){if(_0x4aa10f){return _0x4aa10f[_0x5888('0x57')](_0x559862[_0x5888('0x33')][_0x5888('0x52')]);}})['then'](respondWithStatusCode(_0x1ddca2,null))['catch'](handleError(_0x1ddca2,null));};exports[_0x5888('0x58')]=function(_0x53ad32,_0x272621,_0x2bf4cb){if(_0x53ad32['body']['id']){delete _0x53ad32['body']['id'];}return db[_0x5888('0x30')]['find']({'where':{'id':_0x53ad32[_0x5888('0x48')]['id']}})[_0x5888('0x29')](handleEntityNotFound(_0x272621,null))[_0x5888('0x29')](function(_0x1347a2){if(_0x1347a2){_0x53ad32[_0x5888('0x4b')][_0x5888('0x59')]=_0x1347a2['id'];return db[_0x5888('0x4e')]['create'](_0x53ad32[_0x5888('0x4b')]);}})[_0x5888('0x29')](respondWithResult(_0x272621,null))['catch'](handleError(_0x272621,null));};exports[_0x5888('0x5a')]=function(_0x3eb98f,_0x5353c6,_0x1c615a){var _0x19a25a={};var _0x5c8695={};var _0x4029d4;var _0x3b4fa6;return db['ChatGroup'][_0x5888('0x55')]({'where':{'id':_0x3eb98f[_0x5888('0x48')]['id']}})[_0x5888('0x29')](handleEntityNotFound(_0x5353c6,null))[_0x5888('0x29')](function(_0x265a61){if(_0x265a61){_0x4029d4=_0x265a61;_0x5c8695[_0x5888('0x32')]=_[_0x5888('0x34')](db['ChatInternalMessage'][_0x5888('0x31')]);_0x5c8695[_0x5888('0x33')]=_[_0x5888('0x34')](_0x3eb98f[_0x5888('0x33')]);_0x5c8695[_0x5888('0x35')]=_[_0x5888('0x36')](_0x5c8695[_0x5888('0x32')],_0x5c8695[_0x5888('0x33')]);_0x19a25a[_0x5888('0x37')]=_[_0x5888('0x36')](_0x5c8695[_0x5888('0x32')],qs['fields'](_0x3eb98f[_0x5888('0x33')][_0x5888('0x38')]));_0x19a25a[_0x5888('0x37')]=_0x19a25a[_0x5888('0x37')][_0x5888('0x39')]?_0x19a25a[_0x5888('0x37')]:_0x5c8695[_0x5888('0x32')];_0x19a25a[_0x5888('0x3b')]=qs[_0x5888('0x3c')](_0x3eb98f['query'][_0x5888('0x3c')]);_0x19a25a[_0x5888('0x3d')]=qs[_0x5888('0x35')](_[_0x5888('0x5b')](_0x3eb98f['query'],_0x5c8695[_0x5888('0x35')]));if(_0x3eb98f[_0x5888('0x33')][_0x5888('0x3e')]){_0x19a25a[_0x5888('0x3d')]=_[_0x5888('0x3f')](_0x19a25a[_0x5888('0x3d')],{'$or':_[_0x5888('0x2f')](_0x19a25a['attributes'],function(_0x4936e9){var _0x278d25={};_0x278d25[_0x4936e9]={'$like':'%'+_0x3eb98f[_0x5888('0x33')][_0x5888('0x3e')]+'%'};return _0x278d25;})});}if(_0x3eb98f[_0x5888('0x33')][_0x5888('0x5c')]){var _0x21f683=_0x3eb98f[_0x5888('0x33')][_0x5888('0x5c')][_0x5888('0x5d')](',');var _0x19bf34={};_0x19bf34[_0x21f683[0x0]]={'$gte':moment(_0x21f683[0x1])[_0x5888('0x5e')](_0x5888('0x5f'))};_0x19a25a['where']=_[_0x5888('0x3f')](_0x19a25a[_0x5888('0x3d')],_0x19bf34);}_0x19a25a=_['merge']({},_0x19a25a,_0x3eb98f[_0x5888('0x42')]);return _0x4029d4[_0x5888('0x5a')](_0x19a25a);}})[_0x5888('0x29')](function(_0x3b8825){if(_0x3b8825){_0x3b4fa6=_0x3b8825[_0x5888('0x39')];if(!_0x3eb98f['query'][_0x5888('0x3a')](_0x5888('0x60'))){_0x19a25a[_0x5888('0x23')]=qs[_0x5888('0x23')](_0x3eb98f[_0x5888('0x33')]['limit']);_0x19a25a[_0x5888('0x22')]=qs[_0x5888('0x22')](_0x3eb98f[_0x5888('0x33')]['offset']);}return _0x4029d4[_0x5888('0x5a')](_0x19a25a);}})[_0x5888('0x29')](function(_0x43ba13){if(_0x43ba13){return _0x43ba13?{'count':_0x3b4fa6,'rows':_0x43ba13}:null;}})[_0x5888('0x29')](respondWithResult(_0x5353c6,null))[_0x5888('0x46')](handleError(_0x5353c6,null));};
\ No newline at end of file
+var _0xd2b2=['rows','show','params','rawAttributes','find','catch','create','body','destroy','describe','getUnread','toInteger','addMembers','ids','omit','getMembers','findOne','User','pick','filter','addMessage','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','then','stack','name','index','map','ChatGroup','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd2b2,0x138));var _0x2d2b=function(_0x55eaf7,_0x2ddd6c){_0x55eaf7=_0x55eaf7-0x0;var _0x461760=_0xd2b2[_0x55eaf7];return _0x461760;};'use strict';var emlformat=require(_0x2d2b('0x0'));var rimraf=require(_0x2d2b('0x1'));var zipdir=require(_0x2d2b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2d2b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2d2b('0x4'));var util=require(_0x2d2b('0x5'));var path=require(_0x2d2b('0x6'));var sox=require(_0x2d2b('0x7'));var csv=require(_0x2d2b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d2b('0x9'));var _=require(_0x2d2b('0xa'));var squel=require(_0x2d2b('0xb'));var crypto=require(_0x2d2b('0xc'));var jsforce=require(_0x2d2b('0xd'));var deskjs=require(_0x2d2b('0xe'));var toCsv=require(_0x2d2b('0x8'));var querystring=require(_0x2d2b('0xf'));var Papa=require(_0x2d2b('0x10'));var Redis=require('ioredis');var authService=require(_0x2d2b('0x11'));var qs=require(_0x2d2b('0x12'));var as=require(_0x2d2b('0x13'));var hardwareService=require(_0x2d2b('0x14'));var logger=require(_0x2d2b('0x15'))(_0x2d2b('0x16'));var utils=require(_0x2d2b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2d2b('0x18'));var db=require('../../mysqldb')['db'];config[_0x2d2b('0x19')]=_[_0x2d2b('0x1a')](config[_0x2d2b('0x19')],{'host':_0x2d2b('0x1b'),'port':0x18eb});var socket=require(_0x2d2b('0x1c'))(new Redis(config[_0x2d2b('0x19')]));require(_0x2d2b('0x1d'))['register'](socket);function respondWithStatusCode(_0x33c73c,_0x97e7cb){_0x97e7cb=_0x97e7cb||0xcc;return function(_0x26b2c3){if(_0x26b2c3){return _0x33c73c[_0x2d2b('0x1e')](_0x97e7cb);}return _0x33c73c[_0x2d2b('0x1f')](_0x97e7cb)[_0x2d2b('0x20')]();};}function respondWithResult(_0x7cb236,_0x20b419){_0x20b419=_0x20b419||0xc8;return function(_0x3e5736){if(_0x3e5736){return _0x7cb236['status'](_0x20b419)['json'](_0x3e5736);}};}function respondWithFilteredResult(_0x1c104b,_0x9c5be0){return function(_0x74c6ce){if(_0x74c6ce){var _0x2ea5c5=typeof _0x9c5be0[_0x2d2b('0x21')]===_0x2d2b('0x22')&&typeof _0x9c5be0[_0x2d2b('0x23')]===_0x2d2b('0x22');var _0x598198=_0x74c6ce[_0x2d2b('0x24')];var _0x17ccc4=_0x2ea5c5?0x0:_0x9c5be0['offset'];var _0x5be82c=_0x2ea5c5?_0x74c6ce[_0x2d2b('0x24')]:_0x9c5be0[_0x2d2b('0x21')]+_0x9c5be0['limit'];var _0x50cf85;if(_0x5be82c>=_0x598198){_0x5be82c=_0x598198;_0x50cf85=0xc8;}else{_0x50cf85=0xce;}_0x1c104b[_0x2d2b('0x1f')](_0x50cf85);return _0x1c104b[_0x2d2b('0x25')]('Content-Range',_0x17ccc4+'-'+_0x5be82c+'/'+_0x598198)['json'](_0x74c6ce);}return null;};}function patchUpdates(_0x445ee1){return function(_0x600be9){try{jsonpatch[_0x2d2b('0x26')](_0x600be9,_0x445ee1,!![]);}catch(_0x2fb5dc){return BPromise[_0x2d2b('0x27')](_0x2fb5dc);}return _0x600be9['save']();};}function saveUpdates(_0x54dd46,_0xea390f){return function(_0x48e376){if(_0x48e376){return _0x48e376['update'](_0x54dd46)[_0x2d2b('0x28')](function(_0x222dd7){return _0x222dd7;});}return null;};}function removeEntity(_0x2eb048,_0x5769ae){return function(_0x15de29){if(_0x15de29){return _0x15de29['destroy']()[_0x2d2b('0x28')](function(){_0x2eb048[_0x2d2b('0x1f')](0xcc)[_0x2d2b('0x20')]();});}};}function handleEntityNotFound(_0x43b375,_0xa2a23d){return function(_0xded75){if(!_0xded75){_0x43b375[_0x2d2b('0x1e')](0x194);}return _0xded75;};}function handleError(_0x51afc6,_0x2ab2a5){_0x2ab2a5=_0x2ab2a5||0x1f4;return function(_0x343241){logger['error'](_0x343241[_0x2d2b('0x29')]);if(_0x343241['name']){delete _0x343241[_0x2d2b('0x2a')];}_0x51afc6['status'](_0x2ab2a5)['send'](_0x343241);};}exports[_0x2d2b('0x2b')]=function(_0x59fbfc,_0x486cd7){var _0x28a1d6={},_0x4498d8={},_0x5bcf31={'count':0x0,'rows':[]};var _0x2d5e1d=_[_0x2d2b('0x2c')](db[_0x2d2b('0x2d')]['rawAttributes'],function(_0x13e51a){return{'name':_0x13e51a[_0x2d2b('0x2e')],'type':_0x13e51a[_0x2d2b('0x2f')][_0x2d2b('0x30')]};});_0x4498d8['model']=_[_0x2d2b('0x2c')](_0x2d5e1d,'name');_0x4498d8[_0x2d2b('0x31')]=_[_0x2d2b('0x32')](_0x59fbfc['query']);_0x4498d8['filters']=_['intersection'](_0x4498d8[_0x2d2b('0x33')],_0x4498d8['query']);_0x28a1d6[_0x2d2b('0x34')]=_[_0x2d2b('0x35')](_0x4498d8[_0x2d2b('0x33')],qs[_0x2d2b('0x36')](_0x59fbfc['query'][_0x2d2b('0x36')]));_0x28a1d6[_0x2d2b('0x34')]=_0x28a1d6[_0x2d2b('0x34')][_0x2d2b('0x37')]?_0x28a1d6[_0x2d2b('0x34')]:_0x4498d8[_0x2d2b('0x33')];if(!_0x59fbfc['query'][_0x2d2b('0x38')](_0x2d2b('0x39'))){_0x28a1d6[_0x2d2b('0x23')]=qs[_0x2d2b('0x23')](_0x59fbfc['query'][_0x2d2b('0x23')]);_0x28a1d6['offset']=qs[_0x2d2b('0x21')](_0x59fbfc[_0x2d2b('0x31')]['offset']);}_0x28a1d6[_0x2d2b('0x3a')]=qs[_0x2d2b('0x3b')](_0x59fbfc[_0x2d2b('0x31')]['sort']);_0x28a1d6['where']=qs[_0x2d2b('0x3c')](_['pick'](_0x59fbfc[_0x2d2b('0x31')],_0x4498d8[_0x2d2b('0x3c')]),_0x2d5e1d);if(_0x59fbfc['query']['filter']){_0x28a1d6[_0x2d2b('0x3d')]=_[_0x2d2b('0x3e')](_0x28a1d6[_0x2d2b('0x3d')],{'$or':_[_0x2d2b('0x2c')](_0x2d5e1d,function(_0x247ef7){if(_0x247ef7[_0x2d2b('0x2f')]!==_0x2d2b('0x3f')){var _0x56b181={};_0x56b181[_0x247ef7[_0x2d2b('0x2a')]]={'$like':'%'+_0x59fbfc[_0x2d2b('0x31')]['filter']+'%'};return _0x56b181;}})});}_0x28a1d6=_[_0x2d2b('0x3e')]({},_0x28a1d6,_0x59fbfc[_0x2d2b('0x40')]);var _0x356415={'where':_0x28a1d6[_0x2d2b('0x3d')]};return db[_0x2d2b('0x2d')][_0x2d2b('0x24')](_0x356415)[_0x2d2b('0x28')](function(_0x2fd60a){_0x5bcf31[_0x2d2b('0x24')]=_0x2fd60a;if(_0x59fbfc[_0x2d2b('0x31')][_0x2d2b('0x41')]){_0x28a1d6[_0x2d2b('0x42')]=[{'all':!![]}];}return db[_0x2d2b('0x2d')][_0x2d2b('0x43')](_0x28a1d6);})['then'](function(_0x3a0024){_0x5bcf31[_0x2d2b('0x44')]=_0x3a0024;return _0x5bcf31;})[_0x2d2b('0x28')](respondWithFilteredResult(_0x486cd7,_0x28a1d6))['catch'](handleError(_0x486cd7,null));};exports[_0x2d2b('0x45')]=function(_0x238ffa,_0x2b0d58){var _0x512de0={'raw':!![],'where':{'id':_0x238ffa[_0x2d2b('0x46')]['id']}},_0x12d43a={};_0x12d43a[_0x2d2b('0x33')]=_[_0x2d2b('0x32')](db['ChatGroup'][_0x2d2b('0x47')]);_0x12d43a['query']=_[_0x2d2b('0x32')](_0x238ffa[_0x2d2b('0x31')]);_0x12d43a[_0x2d2b('0x3c')]=_['intersection'](_0x12d43a[_0x2d2b('0x33')],_0x12d43a[_0x2d2b('0x31')]);_0x512de0['attributes']=_[_0x2d2b('0x35')](_0x12d43a[_0x2d2b('0x33')],qs[_0x2d2b('0x36')](_0x238ffa[_0x2d2b('0x31')][_0x2d2b('0x36')]));_0x512de0['attributes']=_0x512de0[_0x2d2b('0x34')]['length']?_0x512de0[_0x2d2b('0x34')]:_0x12d43a[_0x2d2b('0x33')];if(_0x238ffa[_0x2d2b('0x31')][_0x2d2b('0x41')]){_0x512de0['include']=[{'all':!![]}];}_0x512de0=_[_0x2d2b('0x3e')]({},_0x512de0,_0x238ffa[_0x2d2b('0x40')]);return db[_0x2d2b('0x2d')][_0x2d2b('0x48')](_0x512de0)['then'](handleEntityNotFound(_0x2b0d58,null))[_0x2d2b('0x28')](respondWithResult(_0x2b0d58,null))[_0x2d2b('0x49')](handleError(_0x2b0d58,null));};exports[_0x2d2b('0x4a')]=function(_0x5723ed,_0x2370e5){return db[_0x2d2b('0x2d')]['create'](_0x5723ed[_0x2d2b('0x4b')],{})[_0x2d2b('0x28')](respondWithResult(_0x2370e5,0xc9))[_0x2d2b('0x49')](handleError(_0x2370e5,null));};exports['update']=function(_0x23e8df,_0x5c5dd2){if(_0x23e8df[_0x2d2b('0x4b')]['id']){delete _0x23e8df['body']['id'];}return db[_0x2d2b('0x2d')][_0x2d2b('0x48')]({'where':{'id':_0x23e8df[_0x2d2b('0x46')]['id']}})[_0x2d2b('0x28')](handleEntityNotFound(_0x5c5dd2,null))[_0x2d2b('0x28')](saveUpdates(_0x23e8df['body'],null))[_0x2d2b('0x28')](respondWithResult(_0x5c5dd2,null))[_0x2d2b('0x49')](handleError(_0x5c5dd2,null));};exports[_0x2d2b('0x4c')]=function(_0x4dca25,_0x531b9e){return db[_0x2d2b('0x2d')][_0x2d2b('0x48')]({'where':{'id':_0x4dca25[_0x2d2b('0x46')]['id']}})[_0x2d2b('0x28')](handleEntityNotFound(_0x531b9e,null))[_0x2d2b('0x28')](removeEntity(_0x531b9e,null))['catch'](handleError(_0x531b9e,null));};exports[_0x2d2b('0x4d')]=function(_0x81bc2c,_0x2a05f4){return db[_0x2d2b('0x2d')][_0x2d2b('0x4d')]()[_0x2d2b('0x28')](respondWithResult(_0x2a05f4,null))[_0x2d2b('0x49')](handleError(_0x2a05f4,null));};exports[_0x2d2b('0x4e')]=function(_0x590121,_0x56332e,_0x527b88){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x590121[_0x2d2b('0x46')]['id'],'ToId':_0x590121['user']['id'],'read':![]}})[_0x2d2b('0x28')](function(_0x51bd7c){return{'id':_[_0x2d2b('0x4f')](_0x590121[_0x2d2b('0x46')]['id']),'count':_0x51bd7c};})[_0x2d2b('0x28')](respondWithResult(_0x56332e,null))[_0x2d2b('0x49')](handleError(_0x56332e,null));};exports[_0x2d2b('0x50')]=function(_0xca1805,_0xbb876a,_0x57fb7c){return db[_0x2d2b('0x2d')]['find']({'where':{'id':_0xca1805[_0x2d2b('0x46')]['id']}})[_0x2d2b('0x28')](handleEntityNotFound(_0xbb876a,null))[_0x2d2b('0x28')](function(_0xebb9c1){if(_0xebb9c1){return _0xebb9c1[_0x2d2b('0x50')](_0xca1805['body'][_0x2d2b('0x51')],_[_0x2d2b('0x52')](_0xca1805[_0x2d2b('0x4b')],['ids','id'])||{});}})[_0x2d2b('0x28')](respondWithResult(_0xbb876a,null))[_0x2d2b('0x49')](handleError(_0xbb876a,null));};exports[_0x2d2b('0x53')]=function(_0x5a08fc,_0x3e59f8,_0x1fcbf6){var _0x403792={};var _0x1a300d={};var _0x2f358c;var _0x50f92c;return db[_0x2d2b('0x2d')][_0x2d2b('0x54')]({'where':{'id':_0x5a08fc[_0x2d2b('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e59f8,null))[_0x2d2b('0x28')](function(_0x315001){if(_0x315001){_0x2f358c=_0x315001;_0x1a300d[_0x2d2b('0x33')]=_[_0x2d2b('0x32')](db[_0x2d2b('0x55')][_0x2d2b('0x47')]);_0x1a300d[_0x2d2b('0x31')]=_[_0x2d2b('0x32')](_0x5a08fc['query']);_0x1a300d[_0x2d2b('0x3c')]=_['intersection'](_0x1a300d['model'],_0x1a300d[_0x2d2b('0x31')]);_0x403792['attributes']=_['intersection'](_0x1a300d[_0x2d2b('0x33')],qs[_0x2d2b('0x36')](_0x5a08fc[_0x2d2b('0x31')][_0x2d2b('0x36')]));_0x403792[_0x2d2b('0x34')]=_0x403792['attributes']['length']?_0x403792[_0x2d2b('0x34')]:_0x1a300d[_0x2d2b('0x33')];_0x403792[_0x2d2b('0x3a')]=qs[_0x2d2b('0x3b')](_0x5a08fc['query'][_0x2d2b('0x3b')]);_0x403792['where']=qs['filters'](_[_0x2d2b('0x56')](_0x5a08fc[_0x2d2b('0x31')],_0x1a300d['filters']));if(_0x5a08fc[_0x2d2b('0x31')][_0x2d2b('0x57')]){_0x403792['where']=_[_0x2d2b('0x3e')](_0x403792[_0x2d2b('0x3d')],{'$or':_[_0x2d2b('0x2c')](_0x403792['attributes'],function(_0x2f4c14){var _0x2ab14f={};_0x2ab14f[_0x2f4c14]={'$like':'%'+_0x5a08fc['query'][_0x2d2b('0x57')]+'%'};return _0x2ab14f;})});}_0x403792=_[_0x2d2b('0x3e')]({},_0x403792,_0x5a08fc['options']);return _0x2f358c[_0x2d2b('0x53')](_0x403792);}})['then'](function(_0x13d44c){if(_0x13d44c){_0x50f92c=_0x13d44c['length'];if(!_0x5a08fc[_0x2d2b('0x31')]['hasOwnProperty']('nolimit')){_0x403792[_0x2d2b('0x23')]=qs[_0x2d2b('0x23')](_0x5a08fc[_0x2d2b('0x31')][_0x2d2b('0x23')]);_0x403792[_0x2d2b('0x21')]=qs['offset'](_0x5a08fc[_0x2d2b('0x31')][_0x2d2b('0x21')]);}return _0x2f358c[_0x2d2b('0x53')](_0x403792);}})[_0x2d2b('0x28')](function(_0x9e1ff4){if(_0x9e1ff4){return _0x9e1ff4?{'count':_0x50f92c,'rows':_0x9e1ff4}:null;}})[_0x2d2b('0x28')](respondWithResult(_0x3e59f8,null))[_0x2d2b('0x49')](handleError(_0x3e59f8,null));};exports['removeMembers']=function(_0x1d4be9,_0x2a2183,_0x2dcb1a){return db[_0x2d2b('0x2d')][_0x2d2b('0x48')]({'where':{'id':_0x1d4be9['params']['id']}})[_0x2d2b('0x28')](handleEntityNotFound(_0x2a2183,null))['then'](function(_0x279cce){if(_0x279cce){return _0x279cce['removeMembers'](_0x1d4be9[_0x2d2b('0x31')][_0x2d2b('0x51')]);}})[_0x2d2b('0x28')](respondWithStatusCode(_0x2a2183,null))[_0x2d2b('0x49')](handleError(_0x2a2183,null));};exports[_0x2d2b('0x58')]=function(_0x2684eb,_0x3e215b,_0xbc86af){if(_0x2684eb[_0x2d2b('0x4b')]['id']){delete _0x2684eb['body']['id'];}return db[_0x2d2b('0x2d')][_0x2d2b('0x48')]({'where':{'id':_0x2684eb['params']['id']}})[_0x2d2b('0x28')](handleEntityNotFound(_0x3e215b,null))['then'](function(_0x37d63f){if(_0x37d63f){_0x2684eb['body']['ChatGroupId']=_0x37d63f['id'];return db[_0x2d2b('0x59')]['create'](_0x2684eb[_0x2d2b('0x4b')]);}})[_0x2d2b('0x28')](respondWithResult(_0x3e215b,null))[_0x2d2b('0x49')](handleError(_0x3e215b,null));};exports[_0x2d2b('0x5a')]=function(_0x263df0,_0x40bf4d,_0x1a74c3){var _0x16ff0f={};var _0xf08c2a={};var _0x4d09ee;var _0x201ce7;return db[_0x2d2b('0x2d')][_0x2d2b('0x54')]({'where':{'id':_0x263df0[_0x2d2b('0x46')]['id']}})[_0x2d2b('0x28')](handleEntityNotFound(_0x40bf4d,null))[_0x2d2b('0x28')](function(_0x3391b7){if(_0x3391b7){_0x4d09ee=_0x3391b7;_0xf08c2a['model']=_[_0x2d2b('0x32')](db[_0x2d2b('0x59')]['rawAttributes']);_0xf08c2a['query']=_[_0x2d2b('0x32')](_0x263df0[_0x2d2b('0x31')]);_0xf08c2a[_0x2d2b('0x3c')]=_['intersection'](_0xf08c2a[_0x2d2b('0x33')],_0xf08c2a[_0x2d2b('0x31')]);_0x16ff0f[_0x2d2b('0x34')]=_[_0x2d2b('0x35')](_0xf08c2a['model'],qs[_0x2d2b('0x36')](_0x263df0[_0x2d2b('0x31')][_0x2d2b('0x36')]));_0x16ff0f[_0x2d2b('0x34')]=_0x16ff0f[_0x2d2b('0x34')][_0x2d2b('0x37')]?_0x16ff0f[_0x2d2b('0x34')]:_0xf08c2a[_0x2d2b('0x33')];_0x16ff0f[_0x2d2b('0x3a')]=qs['sort'](_0x263df0[_0x2d2b('0x31')][_0x2d2b('0x3b')]);_0x16ff0f[_0x2d2b('0x3d')]=qs[_0x2d2b('0x3c')](_[_0x2d2b('0x56')](_0x263df0[_0x2d2b('0x31')],_0xf08c2a[_0x2d2b('0x3c')]));if(_0x263df0['query']['filter']){_0x16ff0f[_0x2d2b('0x3d')]=_[_0x2d2b('0x3e')](_0x16ff0f[_0x2d2b('0x3d')],{'$or':_[_0x2d2b('0x2c')](_0x16ff0f[_0x2d2b('0x34')],function(_0x1ce237){var _0x5778a7={};_0x5778a7[_0x1ce237]={'$like':'%'+_0x263df0[_0x2d2b('0x31')][_0x2d2b('0x57')]+'%'};return _0x5778a7;})});}if(_0x263df0[_0x2d2b('0x31')]['$gte']){var _0x3ad178=_0x263df0[_0x2d2b('0x31')][_0x2d2b('0x5b')][_0x2d2b('0x5c')](',');var _0x4adaf4={};_0x4adaf4[_0x3ad178[0x0]]={'$gte':moment(_0x3ad178[0x1])[_0x2d2b('0x5d')](_0x2d2b('0x5e'))};_0x16ff0f[_0x2d2b('0x3d')]=_['merge'](_0x16ff0f[_0x2d2b('0x3d')],_0x4adaf4);}_0x16ff0f=_[_0x2d2b('0x3e')]({},_0x16ff0f,_0x263df0[_0x2d2b('0x40')]);return _0x4d09ee[_0x2d2b('0x5a')](_0x16ff0f);}})[_0x2d2b('0x28')](function(_0x1beea8){if(_0x1beea8){_0x201ce7=_0x1beea8['length'];if(!_0x263df0[_0x2d2b('0x31')]['hasOwnProperty'](_0x2d2b('0x39'))){_0x16ff0f[_0x2d2b('0x23')]=qs[_0x2d2b('0x23')](_0x263df0[_0x2d2b('0x31')][_0x2d2b('0x23')]);_0x16ff0f['offset']=qs[_0x2d2b('0x21')](_0x263df0[_0x2d2b('0x31')][_0x2d2b('0x21')]);}return _0x4d09ee['getMessages'](_0x16ff0f);}})['then'](function(_0x745af6){if(_0x745af6){return _0x745af6?{'count':_0x201ce7,'rows':_0x745af6}:null;}})[_0x2d2b('0x28')](respondWithResult(_0x40bf4d,null))['catch'](handleError(_0x40bf4d,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 8d31580..5c643bd 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 _0x1c77=['ChatGroup','setMaxListeners','save','update','emit','hasOwnProperty','../../mysqldb'];(function(_0x4d655e,_0x4804ac){var _0x23a831=function(_0x4a0914){while(--_0x4a0914){_0x4d655e['push'](_0x4d655e['shift']());}};_0x23a831(++_0x4804ac);}(_0x1c77,0xed));var _0x71c7=function(_0x506172,_0xbc3a3){_0x506172=_0x506172-0x0;var _0x2723c0=_0x1c77[_0x506172];return _0x2723c0;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x71c7('0x0'))['db'][_0x71c7('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x71c7('0x2')](0x0);var events={'afterCreate':_0x71c7('0x3'),'afterUpdate':_0x71c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x29ab58){return function(_0x37620a,_0x1f314c,_0x305ff7){ChatGroupEvents[_0x71c7('0x5')](_0x29ab58+':'+_0x37620a['id'],_0x37620a);ChatGroupEvents[_0x71c7('0x5')](_0x29ab58,_0x37620a);_0x305ff7(null);};}for(var e in events){if(events[_0x71c7('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x7d8a=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x7d8a,0x1ca));var _0xa7d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d8a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xa7d8('0x0'));var ChatGroup=require(_0xa7d8('0x1'))['db'][_0xa7d8('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xa7d8('0x3')](0x0);var events={'afterCreate':_0xa7d8('0x4'),'afterUpdate':_0xa7d8('0x5'),'afterDestroy':_0xa7d8('0x6')};function emitEvent(_0x2b5af1){return function(_0x14a7d3,_0x199cdd,_0x1162e1){ChatGroupEvents[_0xa7d8('0x7')](_0x2b5af1+':'+_0x14a7d3['id'],_0x14a7d3);ChatGroupEvents[_0xa7d8('0x7')](_0x2b5af1,_0x14a7d3);_0x1162e1(null);};}for(var e in events){if(events[_0xa7d8('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xa7d8('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index d386fa6..5f6c219 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 _0x894f=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','../../config/logger','api','bluebird','rimraf'];(function(_0x4d1413,_0x311027){var _0x10dd2a=function(_0x19d9fd){while(--_0x19d9fd){_0x4d1413['push'](_0x4d1413['shift']());}};_0x10dd2a(++_0x311027);}(_0x894f,0x7f));var _0xf894=function(_0x55ab34,_0x18ca9f){_0x55ab34=_0x55ab34-0x0;var _0x1936da=_0x894f[_0x55ab34];return _0x1936da;};'use strict';var _=require(_0xf894('0x0'));var util=require('util');var logger=require(_0xf894('0x1'))(_0xf894('0x2'));var moment=require('moment');var BPromise=require(_0xf894('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf894('0x4'));var config=require(_0xf894('0x5'));var attributes=require(_0xf894('0x6'));module[_0xf894('0x7')]=function(_0x12e3eb,_0x10bc14){return _0x12e3eb[_0xf894('0x8')](_0xf894('0x9'),attributes,{'tableName':_0xf894('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8501=['../../config/logger','api','moment','../../config/environment','exports','ChatGroup','chat_groups','lodash','util'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x8501,0x11e));var _0x1850=function(_0x49ad79,_0x48ee93){_0x49ad79=_0x49ad79-0x0;var _0xa4e38a=_0x8501[_0x49ad79];return _0xa4e38a;};'use strict';var _=require(_0x1850('0x0'));var util=require(_0x1850('0x1'));var logger=require(_0x1850('0x2'))(_0x1850('0x3'));var moment=require(_0x1850('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1850('0x5'));var attributes=require('./chatGroup.attributes');module[_0x1850('0x6')]=function(_0x4ffcc9,_0x453fab){return _0x4ffcc9['define'](_0x1850('0x7'),attributes,{'tableName':_0x1850('0x8'),'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 12057d5..f601867 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 _0x8388=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x23ab7f,_0x4251d2){var _0x405ca9=function(_0x47e585){while(--_0x47e585){_0x23ab7f['push'](_0x23ab7f['shift']());}};_0x405ca9(++_0x4251d2);}(_0x8388,0x18d));var _0x8838=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x8388[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x8838('0x0'));var util=require(_0x8838('0x1'));var moment=require(_0x8838('0x2'));var BPromise=require(_0x8838('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8838('0x4'));var db=require(_0x8838('0x5'))['db'];var utils=require(_0x8838('0x6'));var logger=require(_0x8838('0x7'))(_0x8838('0x8'));var config=require('../../config/environment');var jayson=require(_0x8838('0x9'));var client=jayson[_0x8838('0xa')]['http']({'port':0x232a});config[_0x8838('0xb')]=_[_0x8838('0xc')](config[_0x8838('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8838('0xd'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x8838('0xe')](socket);function respondWithRpcPromise(_0x4b5419,_0x4aedc9,_0x336b66){return new BPromise(function(_0x28de3d,_0x1e728e){return client[_0x8838('0xf')](_0x4b5419,_0x336b66)['then'](function(_0xd472af){logger[_0x8838('0x10')](_0x8838('0x11'),_0x4aedc9,_0x8838('0x12'));logger['debug'](_0x8838('0x13'),_0x4aedc9,'request\x20sent',JSON['stringify'](_0xd472af));if(_0xd472af[_0x8838('0x14')]){if(_0xd472af[_0x8838('0x14')][_0x8838('0x15')]===0x1f4){logger[_0x8838('0x14')](_0x8838('0x11'),_0x4aedc9,_0xd472af[_0x8838('0x14')][_0x8838('0x16')]);return _0x1e728e(_0xd472af[_0x8838('0x14')]['message']);}logger[_0x8838('0x14')](_0x8838('0x11'),_0x4aedc9,_0xd472af['error'][_0x8838('0x16')]);return _0x28de3d(_0xd472af[_0x8838('0x14')][_0x8838('0x16')]);}else{logger['info'](_0x8838('0x11'),_0x4aedc9,'request\x20sent');_0x28de3d(_0xd472af[_0x8838('0x17')][_0x8838('0x16')]);}})[_0x8838('0x18')](function(_0x4eb6e2){logger[_0x8838('0x14')](_0x8838('0x11'),_0x4aedc9,_0x4eb6e2);_0x1e728e(_0x4eb6e2);});});}
\ No newline at end of file
+var _0x514e=['info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','request','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x442955,_0x410333){var _0x14f4b3=function(_0x3f0bc3){while(--_0x3f0bc3){_0x442955['push'](_0x442955['shift']());}};_0x14f4b3(++_0x410333);}(_0x514e,0x146));var _0xe514=function(_0x3d260d,_0x52c05d){_0x3d260d=_0x3d260d-0x0;var _0x152dc1=_0x514e[_0x3d260d];return _0x152dc1;};'use strict';var _=require(_0xe514('0x0'));var util=require(_0xe514('0x1'));var moment=require(_0xe514('0x2'));var BPromise=require(_0xe514('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe514('0x4'));var db=require(_0xe514('0x5'))['db'];var utils=require(_0xe514('0x6'));var logger=require(_0xe514('0x7'))(_0xe514('0x8'));var config=require(_0xe514('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe514('0xa')][_0xe514('0xb')]({'port':0x232a});config[_0xe514('0xc')]=_[_0xe514('0xd')](config[_0xe514('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe514('0xe'))(new Redis(config[_0xe514('0xc')]));require(_0xe514('0xf'))['register'](socket);function respondWithRpcPromise(_0x343e58,_0x1109cd,_0xc51a5d){return new BPromise(function(_0x5f07c9,_0x3f370){return client[_0xe514('0x10')](_0x343e58,_0xc51a5d)['then'](function(_0x3a6350){logger['info'](_0xe514('0x11'),_0x1109cd,_0xe514('0x12'));logger[_0xe514('0x13')](_0xe514('0x14'),_0x1109cd,'request\x20sent',JSON[_0xe514('0x15')](_0x3a6350));if(_0x3a6350['error']){if(_0x3a6350[_0xe514('0x16')][_0xe514('0x17')]===0x1f4){logger['error'](_0xe514('0x11'),_0x1109cd,_0x3a6350['error'][_0xe514('0x18')]);return _0x3f370(_0x3a6350[_0xe514('0x16')][_0xe514('0x18')]);}logger[_0xe514('0x16')](_0xe514('0x11'),_0x1109cd,_0x3a6350[_0xe514('0x16')]['message']);return _0x5f07c9(_0x3a6350[_0xe514('0x16')][_0xe514('0x18')]);}else{logger[_0xe514('0x19')]('ChatGroup,\x20%s,\x20%s',_0x1109cd,_0xe514('0x12'));_0x5f07c9(_0x3a6350['result']['message']);}})[_0xe514('0x1a')](function(_0x46d7d1){logger[_0xe514('0x16')](_0xe514('0x11'),_0x1109cd,_0x46d7d1);_0x3f370(_0x46d7d1);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 327b2b9..0738ba6 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 _0xe765=['update','emit','register','length','chatGroup:','save','remove'];(function(_0x52ef06,_0x19c8c1){var _0x3d06d2=function(_0x437fb3){while(--_0x437fb3){_0x52ef06['push'](_0x52ef06['shift']());}};_0x3d06d2(++_0x19c8c1);}(_0xe765,0x11d));var _0x5e76=function(_0x4b351e,_0xad9b86){_0x4b351e=_0x4b351e-0x0;var _0x123e52=_0xe765[_0x4b351e];return _0x123e52;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x5e76('0x0'),_0x5e76('0x1'),_0x5e76('0x2')];function createListener(_0x2e2bd9,_0x1428ba){return function(_0xd42406){_0x1428ba[_0x5e76('0x3')](_0x2e2bd9,_0xd42406);};}function removeListener(_0x579f20,_0x188d83){return function(){ChatGroupEvents['removeListener'](_0x579f20,_0x188d83);};}exports[_0x5e76('0x4')]=function(_0x3113c6){for(var _0x2f016e=0x0,_0x33656e=events[_0x5e76('0x5')];_0x2f016e<_0x33656e;_0x2f016e++){var _0x32faec=events[_0x2f016e];var _0x3ad255=createListener(_0x5e76('0x6')+_0x32faec,_0x3113c6);ChatGroupEvents['on'](_0x32faec,_0x3ad255);}};
\ No newline at end of file
+var _0x8b6b=['update','removeListener','register','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x8b6b,0x6d));var _0xb8b6=function(_0xcb93bc,_0x5e45ca){_0xcb93bc=_0xcb93bc-0x0;var _0x214eb1=_0x8b6b[_0xcb93bc];return _0x214eb1;};'use strict';var ChatGroupEvents=require(_0xb8b6('0x0'));var events=[_0xb8b6('0x1'),_0xb8b6('0x2'),_0xb8b6('0x3')];function createListener(_0x3fd6e3,_0x4e4608){return function(_0x5d461d){_0x4e4608['emit'](_0x3fd6e3,_0x5d461d);};}function removeListener(_0x40cad3,_0x411479){return function(){ChatGroupEvents[_0xb8b6('0x4')](_0x40cad3,_0x411479);};}exports[_0xb8b6('0x5')]=function(_0x339b16){for(var _0x27549c=0x0,_0x1707ce=events[_0xb8b6('0x6')];_0x27549c<_0x1707ce;_0x27549c++){var _0x6ec1d9=events[_0x27549c];var _0x275723=createListener(_0xb8b6('0x7')+_0x6ec1d9,_0x339b16);ChatGroupEvents['on'](_0x6ec1d9,_0x275723);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index bfbfaee..0ec952c 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 _0x5291=['path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','addMessage','/:id','delete','removeMembers','exports','multer','util'];(function(_0x4f13f3,_0x350d48){var _0x2921cd=function(_0xc0125c){while(--_0xc0125c){_0x4f13f3['push'](_0x4f13f3['shift']());}};_0x2921cd(++_0x350d48);}(_0x5291,0xc6));var _0x1529=function(_0x1ca579,_0x38651d){_0x1ca579=_0x1ca579-0x0;var _0x5e9ea2=_0x5291[_0x1ca579];return _0x5e9ea2;};'use strict';var multer=require(_0x1529('0x0'));var util=require(_0x1529('0x1'));var path=require(_0x1529('0x2'));var timeout=require('connect-timeout');var express=require(_0x1529('0x3'));var router=express[_0x1529('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1529('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1529('0x6'));var controller=require('./chatGroup.controller');router[_0x1529('0x7')]('/',auth[_0x1529('0x8')](),controller[_0x1529('0x9')]);router[_0x1529('0x7')](_0x1529('0xa'),auth['isAuthenticated'](),controller[_0x1529('0xb')]);router[_0x1529('0x7')]('/:id',auth[_0x1529('0x8')](),controller['show']);router[_0x1529('0x7')]('/:id/unread',auth[_0x1529('0x8')](),controller[_0x1529('0xc')]);router[_0x1529('0x7')](_0x1529('0xd'),auth['isAuthenticated'](),controller[_0x1529('0xe')]);router[_0x1529('0x7')](_0x1529('0xf'),auth[_0x1529('0x8')](),controller[_0x1529('0x10')]);router['post']('/',auth[_0x1529('0x8')](),controller[_0x1529('0x11')]);router[_0x1529('0x12')](_0x1529('0xd'),auth[_0x1529('0x8')](),controller[_0x1529('0x13')]);router[_0x1529('0x12')](_0x1529('0xf'),auth[_0x1529('0x8')](),controller[_0x1529('0x14')]);router['put'](_0x1529('0x15'),auth[_0x1529('0x8')](),controller['update']);router[_0x1529('0x16')](_0x1529('0x15'),auth[_0x1529('0x8')](),controller['destroy']);router['delete'](_0x1529('0xd'),auth[_0x1529('0x8')](),controller[_0x1529('0x17')]);module[_0x1529('0x18')]=router;
\ No newline at end of file
+var _0x9981=['removeMembers','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id/unread','getUnread','getMembers','post','create','/:id/members','/:id/messages','put','delete','/:id','destroy'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x9981,0x1bc));var _0x1998=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9981[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require('multer');var util=require(_0x1998('0x0'));var path=require(_0x1998('0x1'));var timeout=require('connect-timeout');var express=require(_0x1998('0x2'));var router=express[_0x1998('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1998('0x4'));var interaction=require(_0x1998('0x5'));var config=require(_0x1998('0x6'));var controller=require(_0x1998('0x7'));router['get']('/',auth[_0x1998('0x8')](),controller[_0x1998('0x9')]);router[_0x1998('0xa')](_0x1998('0xb'),auth[_0x1998('0x8')](),controller[_0x1998('0xc')]);router['get']('/:id',auth[_0x1998('0x8')](),controller['show']);router[_0x1998('0xa')](_0x1998('0xd'),auth[_0x1998('0x8')](),controller[_0x1998('0xe')]);router[_0x1998('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x1998('0xf')]);router[_0x1998('0xa')]('/:id/messages',auth[_0x1998('0x8')](),controller['getMessages']);router[_0x1998('0x10')]('/',auth['isAuthenticated'](),controller[_0x1998('0x11')]);router['post'](_0x1998('0x12'),auth[_0x1998('0x8')](),controller['addMembers']);router[_0x1998('0x10')](_0x1998('0x13'),auth['isAuthenticated'](),controller['addMessage']);router[_0x1998('0x14')]('/:id',auth[_0x1998('0x8')](),controller['update']);router[_0x1998('0x15')](_0x1998('0x16'),auth['isAuthenticated'](),controller[_0x1998('0x17')]);router[_0x1998('0x15')](_0x1998('0x12'),auth[_0x1998('0x8')](),controller[_0x1998('0x18')]);module[_0x1998('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 37d2434..6b67bf3 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 _0x4bde=['STRING','DATE','long','out','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x550ae2,_0x395896){_0x550ae2=_0x550ae2-0x0;var _0x236657=_0x4bde[_0x550ae2];return _0x236657;};'use strict';var Sequelize=require(_0xe4bd('0x0'));module[_0xe4bd('0x1')]={'closed':{'type':Sequelize[_0xe4bd('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xe4bd('0x3')](_0xe4bd('0x4'),_0xe4bd('0x5')),'defaultValue':_0xe4bd('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xe4bd('0x6')]},'mailTranscript':{'type':Sequelize[_0xe4bd('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xe4bd('0x8')]},'disposition':{'type':Sequelize[_0xe4bd('0x7')]},'secondDisposition':{'type':Sequelize[_0xe4bd('0x7')]},'thirdDisposition':{'type':Sequelize[_0xe4bd('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xe4bd('0x7')]},'browserVersion':{'type':Sequelize[_0xe4bd('0x7')]},'osName':{'type':Sequelize[_0xe4bd('0x7')]},'osVersion':{'type':Sequelize[_0xe4bd('0x7')]},'deviceModel':{'type':Sequelize[_0xe4bd('0x7')]},'deviceVendor':{'type':Sequelize[_0xe4bd('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xe4bd('0x6')](_0xe4bd('0x9'))},'read1stAt':{'type':Sequelize[_0xe4bd('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xe4bd('0x3')]('in',_0xe4bd('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xe4bd('0x7')]},'customerPort':{'type':Sequelize[_0xe4bd('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xe4bd('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x8e44=['BOOLEAN','star','thumb','TEXT','STRING','DATE','long','out','sequelize','exports'];(function(_0x1b1c3d,_0x1f36ce){var _0x4f2fe5=function(_0x35263e){while(--_0x35263e){_0x1b1c3d['push'](_0x1b1c3d['shift']());}};_0x4f2fe5(++_0x1f36ce);}(_0x8e44,0x1ac));var _0x48e4=function(_0x344dc4,_0x50eb33){_0x344dc4=_0x344dc4-0x0;var _0x3e722f=_0x8e44[_0x344dc4];return _0x3e722f;};'use strict';var Sequelize=require(_0x48e4('0x0'));module[_0x48e4('0x1')]={'closed':{'type':Sequelize[_0x48e4('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x48e4('0x3'),_0x48e4('0x4')),'defaultValue':_0x48e4('0x3')},'ratingMessage':{'type':Sequelize[_0x48e4('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x48e4('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x48e4('0x7')]},'disposition':{'type':Sequelize[_0x48e4('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x48e4('0x6')]},'browserName':{'type':Sequelize[_0x48e4('0x6')]},'browserVersion':{'type':Sequelize[_0x48e4('0x6')]},'osName':{'type':Sequelize[_0x48e4('0x6')]},'osVersion':{'type':Sequelize[_0x48e4('0x6')]},'deviceModel':{'type':Sequelize[_0x48e4('0x6')]},'deviceVendor':{'type':Sequelize[_0x48e4('0x6')]},'deviceType':{'type':Sequelize[_0x48e4('0x6')]},'referer':{'type':Sequelize[_0x48e4('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x48e4('0x5')](_0x48e4('0x8'))},'read1stAt':{'type':Sequelize[_0x48e4('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x48e4('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x48e4('0x6')]},'customerPort':{'type':Sequelize[_0x48e4('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x48e4('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 0fc706d..942e4d7 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 _0x3164=['unlinkSync','rimraf','bluebird','mustache','util','path','lodash','../../components/interaction/service','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','ChatInteraction,\x20%s,\x20%s','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','stack','name','merge','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','query','params','keys','attributes','intersection','fields','length','include','find','create','body','describe','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','ValidationError','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','sendStatus','Interaction\x20already\x20assigned','closed','AbandonInteraction','originalname','file','mimetype','Attachment','ChatOfflineMessageId','join','offline-chat/','basename','mailTranscript','root','format','transcript-%s.txt','Messages','User','ChatWebsite','ContactId','UserId','%s%d','agentAlias','Visitor','website_alias','agent_alias','alias','fullname','System','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','model','filters','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','secret','options','includeAgent','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','lastName','read','Account','Owner','get','mkdirSync','N.A.','disposition','browserName','osName','referer','customerIp','customerPort','createReadStream','pipe','createWriteStream','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','err'];(function(_0x23c73d,_0x357b21){var _0x36ba47=function(_0x317b8e){while(--_0x317b8e){_0x23c73d['push'](_0x23c73d['shift']());}};_0x36ba47(++_0x357b21);}(_0x3164,0x18b));var _0x4316=function(_0x3add15,_0x1556a8){_0x3add15=_0x3add15-0x0;var _0x4171d0=_0x3164[_0x3add15];return _0x4171d0;};'use strict';var rimraf=require(_0x4316('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4316('0x1'));var Mustache=require(_0x4316('0x2'));var util=require(_0x4316('0x3'));var path=require(_0x4316('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4316('0x5'));var Redis=require('ioredis');var interaction=require(_0x4316('0x6'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x4316('0x7'))('api');var config=require(_0x4316('0x8'));var db=require(_0x4316('0x9'))['db'];config[_0x4316('0xa')]=_['defaults'](config[_0x4316('0xa')],{'host':_0x4316('0xb'),'port':0x18eb});var socket=require(_0x4316('0xc'))(new Redis(config[_0x4316('0xa')]));require(_0x4316('0xd'))[_0x4316('0xe')](socket);var jayson=require(_0x4316('0xf'));var client=jayson[_0x4316('0x10')][_0x4316('0x11')]({'port':0x232b});var client9004=jayson[_0x4316('0x10')][_0x4316('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x2582f0,_0x2f7ea7,_0x47ff00,_0x349e82){return new BPromise(function(_0x45606a,_0x473fe0){var _0xdc18b7=_0x349e82||client;return _0xdc18b7[_0x4316('0x12')](_0x2582f0,_0x47ff00)[_0x4316('0x13')](function(_0x216a87){logger[_0x4316('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2f7ea7,_0x4316('0x15'));logger['debug'](_0x4316('0x16'),_0x2f7ea7,_0x4316('0x15'),JSON['stringify'](_0x216a87));if(_0x216a87[_0x4316('0x17')]){if(_0x216a87[_0x4316('0x17')][_0x4316('0x18')]===0x1f4){logger[_0x4316('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x2f7ea7,_0x216a87[_0x4316('0x17')][_0x4316('0x19')]);return _0x473fe0(_0x216a87[_0x4316('0x17')][_0x4316('0x19')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2f7ea7,_0x216a87[_0x4316('0x17')][_0x4316('0x19')]);return _0x45606a(_0x216a87[_0x4316('0x17')][_0x4316('0x19')]);}else{logger[_0x4316('0x14')](_0x4316('0x1a'),_0x2f7ea7,_0x4316('0x15'));_0x45606a(_0x216a87['result'][_0x4316('0x19')]);}})[_0x4316('0x1b')](function(_0x2b35b3){logger[_0x4316('0x17')](_0x4316('0x1a'),_0x2f7ea7,_0x2b35b3);_0x473fe0(_0x2b35b3);});});}function respondWithStatusCode(_0x3bc68c,_0x489c9c){_0x489c9c=_0x489c9c||0xcc;return function(_0x40446d){if(_0x40446d){return _0x3bc68c['sendStatus'](_0x489c9c);}return _0x3bc68c[_0x4316('0x1c')](_0x489c9c)[_0x4316('0x1d')]();};}function respondWithResult(_0x1a1dd7,_0x486a15){_0x486a15=_0x486a15||0xc8;return function(_0x170384){if(_0x170384){return _0x1a1dd7[_0x4316('0x1c')](_0x486a15)[_0x4316('0x1e')](_0x170384);}};}function respondWithFilteredResult(_0x51dccd,_0x3caeda){return function(_0x15e63d){if(_0x15e63d){var _0x388dc3=typeof _0x3caeda[_0x4316('0x1f')]==='undefined'&&typeof _0x3caeda[_0x4316('0x20')]===_0x4316('0x21');var _0x3e2eb0=_0x15e63d[_0x4316('0x22')];var _0x10e7e5=_0x388dc3?0x0:_0x3caeda['offset'];var _0x4e5670=_0x388dc3?_0x15e63d[_0x4316('0x22')]:_0x3caeda[_0x4316('0x1f')]+_0x3caeda[_0x4316('0x20')];var _0x4da7aa;if(_0x4e5670>=_0x3e2eb0){_0x4e5670=_0x3e2eb0;_0x4da7aa=0xc8;}else{_0x4da7aa=0xce;}_0x51dccd[_0x4316('0x1c')](_0x4da7aa);return _0x51dccd[_0x4316('0x23')](_0x4316('0x24'),_0x10e7e5+'-'+_0x4e5670+'/'+_0x3e2eb0)[_0x4316('0x1e')](_0x15e63d);}return null;};}function saveUpdates(_0x2b9b3f){return function(_0x32e5a6){if(_0x32e5a6){return _0x32e5a6[_0x4316('0x25')](_0x2b9b3f)[_0x4316('0x13')](function(_0x59a6e6){return _0x59a6e6;});}return null;};}function removeEntity(_0x155718){return function(_0x339008){if(_0x339008){return _0x339008[_0x4316('0x26')]()[_0x4316('0x13')](function(){_0x155718[_0x4316('0x1c')](0xcc)[_0x4316('0x1d')]();});}};}function handleEntityNotFound(_0x56cd16){return function(_0x3830a7){if(!_0x3830a7){_0x56cd16['sendStatus'](0x194);}return _0x3830a7;};}function handleError(_0x553aff,_0x301dff){_0x301dff=_0x301dff||0x1f4;return function(_0xe9c243){logger[_0x4316('0x17')](_0xe9c243[_0x4316('0x27')]);if(_0xe9c243[_0x4316('0x28')]){delete _0xe9c243[_0x4316('0x28')];}_0x553aff[_0x4316('0x1c')](_0x301dff)['send'](_0xe9c243);};}function getMustacheRender(_0x58d3e6,_0x3ea64b){return Mustache['render'](_0x58d3e6,_[_0x4316('0x29')](_0x3ea64b['body'],{'contact':_0x3ea64b[_0x4316('0x2a')],'message':_0x3ea64b[_0x4316('0x19')],'agent':_0x3ea64b[_0x4316('0x2b')],'interaction':_0x3ea64b[_0x4316('0x2c')],'account':_0x3ea64b[_0x4316('0x2d')]}))||'';}exports[_0x4316('0x2e')]=function(_0x28f59e,_0x584069){var _0x57ab81={};var _0x4af228=_[_0x4316('0x2f')](db[_0x4316('0x30')][_0x4316('0x31')],function(_0x391b6b){return{'name':_0x391b6b[_0x4316('0x32')],'type':_0x391b6b[_0x4316('0x33')][_0x4316('0x34')]};});_0x57ab81=qs[_0x4316('0x35')](_0x4af228,_0x28f59e);return interaction['findAll']('chat',_0x28f59e[_0x4316('0x36')],_0x28f59e['user'],_0x57ab81,_0x4af228)[_0x4316('0x13')](respondWithFilteredResult(_0x584069,_0x57ab81))[_0x4316('0x1b')](handleError(_0x584069,null));};exports['show']=function(_0x41b90f,_0xd7919b){var _0x1ac8f6={'raw':![],'where':{'id':_0x41b90f[_0x4316('0x37')]['id']}},_0x3883ef={};_0x3883ef['model']=_[_0x4316('0x38')](db[_0x4316('0x30')][_0x4316('0x31')]);_0x3883ef[_0x4316('0x36')]=_[_0x4316('0x38')](_0x41b90f[_0x4316('0x36')]);_0x3883ef['filters']=_['intersection'](_0x3883ef['model'],_0x3883ef[_0x4316('0x36')]);_0x1ac8f6[_0x4316('0x39')]=_[_0x4316('0x3a')](_0x3883ef['model'],qs['fields'](_0x41b90f[_0x4316('0x36')][_0x4316('0x3b')]));_0x1ac8f6[_0x4316('0x39')]=_0x1ac8f6[_0x4316('0x39')][_0x4316('0x3c')]?_0x1ac8f6[_0x4316('0x39')]:_0x3883ef['model'];if(_0x41b90f[_0x4316('0x36')]['includeAll']){_0x1ac8f6[_0x4316('0x3d')]=[{'all':!![]}];}_0x1ac8f6=_[_0x4316('0x29')]({},_0x1ac8f6,_0x41b90f['options']);return db['ChatInteraction'][_0x4316('0x3e')](_0x1ac8f6)[_0x4316('0x13')](handleEntityNotFound(_0xd7919b,null))['then'](respondWithResult(_0xd7919b,null))[_0x4316('0x1b')](handleError(_0xd7919b,null));};exports[_0x4316('0x3f')]=function(_0x2819bc,_0x2f38c1){return db[_0x4316('0x30')][_0x4316('0x3f')](_0x2819bc[_0x4316('0x40')],{})[_0x4316('0x13')](respondWithResult(_0x2f38c1,0xc9))[_0x4316('0x1b')](handleError(_0x2f38c1,null));};exports['update']=function(_0x24beb9,_0x3591de){if(_0x24beb9[_0x4316('0x40')]['id']){delete _0x24beb9[_0x4316('0x40')]['id'];}return db[_0x4316('0x30')][_0x4316('0x3e')]({'where':{'id':_0x24beb9[_0x4316('0x37')]['id']}})[_0x4316('0x13')](handleEntityNotFound(_0x3591de,null))[_0x4316('0x13')](saveUpdates(_0x24beb9[_0x4316('0x40')],null))[_0x4316('0x13')](respondWithResult(_0x3591de,null))['catch'](handleError(_0x3591de,null));};exports['destroy']=function(_0x52de26,_0x2a0da8){return db['ChatInteraction'][_0x4316('0x3e')]({'where':{'id':_0x52de26[_0x4316('0x37')]['id']}})['then'](handleEntityNotFound(_0x2a0da8,null))[_0x4316('0x13')](removeEntity(_0x2a0da8,null))[_0x4316('0x1b')](handleError(_0x2a0da8,null));};exports[_0x4316('0x41')]=function(_0x336ead,_0x4dde34){return db[_0x4316('0x30')]['describe']()[_0x4316('0x13')](respondWithResult(_0x4dde34,null))[_0x4316('0x1b')](handleError(_0x4dde34,null));};exports['createVidaooSession']=function(_0x45c72a,_0x1c47b2){var _0xd1f897=_0x45c72a[_0x4316('0x37')]['id'];var _0x18583a;var _0x2b82e1;var _0x22e422;return db[_0x4316('0x30')][_0x4316('0x42')]({'where':{'id':_0xd1f897}})[_0x4316('0x13')](function(_0x46a84){_0x18583a=_0x46a84;return db['ChatWebsite'][_0x4316('0x42')]({'where':{'id':_0x46a84[_0x4316('0x43')]},'attributes':['id',_0x4316('0x44'),_0x4316('0x45'),_0x4316('0x46'),_0x4316('0x47'),_0x4316('0x48')],'raw':!![]});})['then'](function(_0x424903){if(_0x424903&&_0x424903['vidaooApiKey']&&_0x424903[_0x4316('0x45')]){_0x2b82e1=_0x424903;var _0x1b7fc2={'interaction':{'id':_0xd1f897},'agent':{'id':_0x45c72a[_0x4316('0x49')]['id'],'name':_0x45c72a['user']['name'],'fullname':_0x45c72a[_0x4316('0x49')]['fullname'],'email':_0x45c72a['user'][_0x4316('0x4a')]},'contact':_0x45c72a['body'][_0x4316('0x2a')],'account':_0x45c72a['body'][_0x4316('0x2d')]};var _0x1adbb5={'rejectUnauthorized':![],'method':'POST','url':_0x4316('0x4b'),'headers':{'X-APIKEY':_0x424903[_0x4316('0x44')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x45c72a[_0x4316('0x49')][_0x4316('0x4a')]],'buttons':null,'topic':_0x2b82e1[_0x4316('0x46')],'note':_[_0x4316('0x4c')](_0x2b82e1['vidaooNote'])?null:getMustacheRender(_0x2b82e1[_0x4316('0x47')],_0x1b7fc2),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x4316('0x4c')](_0x2b82e1[_0x4316('0x48')])){var _0x4db346=getMustacheRender(_0x2b82e1['vidaooMetadata'],_0x1b7fc2);var _0x6f263b=JSON[_0x4316('0x4d')](_0x4db346);_0x1adbb5[_0x4316('0x40')]['metadata']=_0x6f263b;}}catch(_0x137afc){throw new db[(_0x4316('0x4e'))]['ValidationError'](_0x4316('0x4f'));}return rp(_0x1adbb5);}else{throw new db['Sequelize']['ValidationError'](_0x4316('0x50'));}})[_0x4316('0x13')](function(_0x148af6){_0x22e422=_0x148af6;if(_0x22e422['id']){var _0x4cb86c={'body':_0x22e422['join_url'],'ChatWebsiteId':_0x2b82e1['id'],'ChatInteractionId':_0x18583a['id'],'direction':_0x4316('0x51'),'UserId':_0x45c72a[_0x4316('0x49')]['id']};return db[_0x4316('0x52')][_0x4316('0x3f')](_0x4cb86c,{});}else{throw new db[(_0x4316('0x4e'))][(_0x4316('0x53'))](_0x4316('0x54'));}})[_0x4316('0x13')](function(){return _0x18583a[_0x4316('0x55')]({'vidaooSessionId':_0x22e422['id']});})[_0x4316('0x13')](respondWithResult(_0x1c47b2,null))[_0x4316('0x1b')](handleError(_0x1c47b2,null));};exports['customUpdate']=function(_0x34f555,_0x208fcf){if(_0x34f555[_0x4316('0x40')]['id']){delete _0x34f555[_0x4316('0x40')]['id'];}return db['ChatInteraction'][_0x4316('0x3e')]({'where':{'id':_0x34f555['params']['id']},'include':[{'model':db[_0x4316('0x56')],'as':_0x4316('0x57')}]})[_0x4316('0x13')](handleEntityNotFound(_0x208fcf,null))[_0x4316('0x13')](saveUpdates(_0x34f555[_0x4316('0x40')],null))[_0x4316('0x13')](respondWithResult(_0x208fcf,null))[_0x4316('0x1b')](handleError(_0x208fcf,null));};exports[_0x4316('0x58')]=function(_0x21f94c,_0x429e6c){if(_0x21f94c[_0x4316('0x40')]['id']){delete _0x21f94c[_0x4316('0x40')]['id'];}return db['ChatInteraction'][_0x4316('0x3e')]({'where':{'id':_0x21f94c[_0x4316('0x37')]['id']}})['then'](function(_0x990fb3){if(!_0x990fb3){logger[_0x4316('0x17')](_0x4316('0x59'),'abandon',0x194,'entity\x20not\x20found');_0x429e6c[_0x4316('0x5a')](0x194);}else{if(_0x990fb3['UserId']){throw new db[(_0x4316('0x4e'))]['ValidationError'](_0x4316('0x5b'));}}return _0x990fb3;})[_0x4316('0x13')](function(_0x55e732){if(_0x55e732){return _0x55e732['update']({'closed':_0x21f94c[_0x4316('0x40')][_0x4316('0x5c')],'disposition':_0x21f94c[_0x4316('0x40')]['disposition']})[_0x4316('0x13')](function(_0x1065a0){return _0x1065a0;});}})[_0x4316('0x13')](function(){return respondWithRpcPromise(_0x4316('0x5d'),_0x4316('0x58'),_0x21f94c[_0x4316('0x40')],client9004);})[_0x4316('0x13')](respondWithResult(_0x429e6c,null))[_0x4316('0x1b')](handleError(_0x429e6c,null));};exports['attachmentUpload']=function(_0x2bd942,_0x3b3cd9){_0x2bd942[_0x4316('0x40')][_0x4316('0x28')]=_0x2bd942['file'][_0x4316('0x5e')];_0x2bd942[_0x4316('0x40')]['basename']=_0x2bd942['file']['filename'];_0x2bd942[_0x4316('0x40')][_0x4316('0x33')]=_0x2bd942[_0x4316('0x5f')][_0x4316('0x60')];return db[_0x4316('0x61')][_0x4316('0x3f')](_0x2bd942[_0x4316('0x40')])['then'](respondWithResult(_0x3b3cd9,0xc9))[_0x4316('0x1b')](handleError(_0x3b3cd9,null));};exports['attachmentDownload']=function(_0x456f42,_0x53465d){return db[_0x4316('0x30')]['findOne']({'where':{'id':_0x456f42[_0x4316('0x37')]['id']},'raw':!![]})[_0x4316('0x13')](handleEntityNotFound(_0x53465d,null))['then'](function(_0x19671e){if(_0x19671e){if(_0x19671e[_0x4316('0x5c')]){return _0x53465d['status'](0x193)[_0x4316('0x1e')]({'status':0x193,'message':'Unauthorized'});}return db[_0x4316('0x61')][_0x4316('0x42')]({'where':{'id':_0x456f42[_0x4316('0x36')]['attachId']},'raw':!![]})[_0x4316('0x13')](handleEntityNotFound(_0x53465d,null));}})[_0x4316('0x13')](function(_0x11ec60){if(_0x11ec60){var _0x3cb51a=_0x11ec60[_0x4316('0x62')]!==null;var _0x2b7be6=path[_0x4316('0x63')](config['root'],'server/files/attachments/');if(_0x3cb51a){_0x2b7be6=path[_0x4316('0x63')](_0x2b7be6,_0x4316('0x64'));}var _0x2a99dc=path['join'](_0x2b7be6,_0x11ec60[_0x4316('0x65')]);return _0x53465d['download'](_0x2a99dc);}})[_0x4316('0x1b')](handleError(_0x53465d,null));};exports['close']=function(_0x391aa5,_0x55bd88){var _0x54bace=null;var _0x55408b=null;var _0x4fec6d=null;if(_0x391aa5[_0x4316('0x40')]['id']){delete _0x391aa5[_0x4316('0x40')]['id'];}if(_0x391aa5[_0x4316('0x40')][_0x4316('0x66')]){_0x4fec6d=path[_0x4316('0x63')](config[_0x4316('0x67')],'server/files/chat/upload/',util[_0x4316('0x68')](_0x4316('0x69'),Date['now']()));_0x391aa5[_0x4316('0x40')]['pathTranscript']=_0x4fec6d;}return db[_0x4316('0x30')]['find']({'where':{'id':_0x391aa5[_0x4316('0x37')]['id']},'include':[{'model':db[_0x4316('0x52')],'as':_0x4316('0x6a'),'include':[{'model':db[_0x4316('0x6b')],'as':_0x4316('0x6b')}]}]})[_0x4316('0x13')](handleEntityNotFound(_0x55bd88,null))[_0x4316('0x13')](saveUpdates(_0x391aa5[_0x4316('0x40')],null))['then'](function(_0x1182b2){if(_0x1182b2){_0x54bace=_0x1182b2;return db[_0x4316('0x6c')]['find']({'where':{'id':_0x54bace['ChatWebsiteId']}});}})[_0x4316('0x13')](function(_0x16bdfc){if(_0x16bdfc){_0x55408b=_0x16bdfc;return db[_0x4316('0x56')][_0x4316('0x3e')]({'where':{'id':_0x54bace[_0x4316('0x6d')]}});}})[_0x4316('0x13')](function(_0x3af946){if(_0x3af946){if(_0x4fec6d){var _0x3faef3=null;for(var _0x183caa=0x1;_0x183caa<_0x54bace[_0x4316('0x6a')][_0x4316('0x3c')];++_0x183caa){_0x3faef3=_0x54bace['Messages'][_0x183caa];var _0xc25d0a=_0x3faef3[_0x4316('0x6e')]?util[_0x4316('0x68')](_0x4316('0x6f'),_0x55408b[_0x4316('0x70')],_0x3faef3['UserId']):'System';var _0x49b5d8=_0x391aa5[_0x4316('0x40')]['customer']||util[_0x4316('0x68')](_0x4316('0x6f'),_0x4316('0x71'),_0x3faef3[_0x4316('0x6d')]);switch(_0x55408b['agentIdentifier']){case _0x4316('0x72'):_0xc25d0a=_0x3faef3[_0x4316('0x6e')]?util['format'](_0x4316('0x6f'),_0x55408b[_0x4316('0x70')],_0x3faef3[_0x4316('0x6e')]):'System';break;case _0x4316('0x73'):_0xc25d0a=_0x3faef3['UserId']?_0x3faef3['User'][_0x4316('0x74')]||_0x3faef3['User'][_0x4316('0x75')]:_0x4316('0x76');break;case _0x4316('0x77'):_0xc25d0a=_0x3faef3[_0x4316('0x6e')]?_0x3faef3[_0x4316('0x6b')]['fullname']:_0x4316('0x76');break;default:_0xc25d0a=_0x3faef3[_0x4316('0x6e')]?util[_0x4316('0x68')](_0x4316('0x6f'),_0x55408b[_0x4316('0x70')],_0x3faef3[_0x4316('0x6e')]):_0x4316('0x76');}var _0x5b18f8=util[_0x4316('0x68')](_0x4316('0x78'),moment(_0x3faef3[_0x4316('0x79')])['format'](_0x4316('0x7a')),_0x3faef3[_0x4316('0x7b')]==='in'?_0x49b5d8:_0xc25d0a,_0x3faef3[_0x4316('0x40')]);if(!_0x3faef3['secret']){fs['appendFileSync'](_0x4fec6d,_0x5b18f8);}}return db['MailAccount'][_0x4316('0x42')]({'where':{'service':!![]},'include':[{'model':db[_0x4316('0x7c')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4316('0x7d')],'as':_0x4316('0x7d'),'raw':!![]}]}]});}}})[_0x4316('0x13')](function(_0x534fca){if(!_0x534fca||!_0x534fca[_0x4316('0x7e')]||!_0x391aa5[_0x4316('0x40')])return _0x54bace;var _0x1b4231=_0x534fca[_0x4316('0x7f')]();return respondWithRpcPromise(_0x4316('0x80'),_0x4316('0x81'),{'account':_0x1b4231,'message':{'from':util['format'](_0x4316('0x82'),_0x534fca[_0x4316('0x28')],_0x534fca[_0x4316('0x4a')]||_0x534fca['Smtp'][_0x4316('0x49')]),'to':_0x391aa5[_0x4316('0x40')][_0x4316('0x66')],'subject':'Mail\x20Transcript','text':util[_0x4316('0x68')](_0x4316('0x83'),_0x391aa5[_0x4316('0x40')][_0x4316('0x66')]),'attachments':[{'path':_0x4fec6d}]}})['then'](function(){return _0x54bace;})['catch'](function(_0x4886fd){logger[_0x4316('0x17')](_0x4886fd);});})[_0x4316('0x13')](respondWithStatusCode(_0x55bd88,0xc8))[_0x4316('0x1b')](handleError(_0x55bd88,null));};exports[_0x4316('0x84')]=function(_0x52c7ff,_0x28e349){return db['ChatMessage'][_0x4316('0x3e')]({'where':{'id':_0x52c7ff[_0x4316('0x37')]['id']}})[_0x4316('0x13')](handleEntityNotFound(_0x28e349,null))[_0x4316('0x13')](function(_0x1d52e1){if(_0x1d52e1){return _0x1d52e1[_0x4316('0x84')](_0x52c7ff[_0x4316('0x40')]['ids'],_[_0x4316('0x85')](_0x52c7ff[_0x4316('0x40')],[_0x4316('0x86'),'id'])||{});}})[_0x4316('0x13')](respondWithResult(_0x28e349,null))[_0x4316('0x1b')](handleError(_0x28e349,null));};exports[_0x4316('0x87')]=function(_0x10368d,_0x3efa55){var _0x13b744={'raw':![],'where':{}};var _0x5d84ae={};var _0x4ac7f5={'count':0x0,'rows':[]};return db[_0x4316('0x30')][_0x4316('0x42')]({'where':{'id':_0x10368d[_0x4316('0x37')]['id']}})[_0x4316('0x13')](handleEntityNotFound(_0x3efa55,null))['then'](function(_0x3dea94){if(_0x3dea94){_0x5d84ae[_0x4316('0x88')]=_[_0x4316('0x38')](db['ChatMessage'][_0x4316('0x31')]);_0x5d84ae[_0x4316('0x36')]=_[_0x4316('0x38')](_0x10368d[_0x4316('0x36')]);_0x5d84ae[_0x4316('0x89')]=_[_0x4316('0x3a')](_0x5d84ae['model'],_0x5d84ae[_0x4316('0x36')]);_0x13b744[_0x4316('0x39')]=_['intersection'](_0x5d84ae[_0x4316('0x88')],qs['fields'](_0x10368d[_0x4316('0x36')][_0x4316('0x3b')]));_0x13b744[_0x4316('0x39')]=_0x13b744[_0x4316('0x39')][_0x4316('0x3c')]?_0x13b744[_0x4316('0x39')]:_0x5d84ae[_0x4316('0x88')];if(!_0x10368d['query'][_0x4316('0x8a')](_0x4316('0x8b'))){_0x13b744[_0x4316('0x20')]=qs['limit'](_0x10368d[_0x4316('0x36')][_0x4316('0x20')]);_0x13b744[_0x4316('0x1f')]=qs[_0x4316('0x1f')](_0x10368d[_0x4316('0x36')]['offset']);}_0x13b744[_0x4316('0x8c')]=qs[_0x4316('0x8d')](_0x10368d[_0x4316('0x36')][_0x4316('0x8d')]);_0x13b744[_0x4316('0x8e')]=qs['filters'](_[_0x4316('0x8f')](_0x10368d['query'],_0x5d84ae[_0x4316('0x89')]));_0x13b744['where'][_0x4316('0x90')]=_0x3dea94['id'];if(_0x10368d[_0x4316('0x36')][_0x4316('0x91')]){_0x13b744[_0x4316('0x8e')]=_[_0x4316('0x29')](_0x13b744['where'],{'$or':_[_0x4316('0x2f')](_0x13b744[_0x4316('0x39')],function(_0x3b928b){var _0x2cfc0c={};_0x2cfc0c[_0x3b928b]={'$like':'%'+_0x10368d[_0x4316('0x36')][_0x4316('0x91')]+'%'};return _0x2cfc0c;})});}if(_0x10368d[_0x4316('0x36')][_0x4316('0x92')]){var _0x2bc75d=_0x10368d[_0x4316('0x36')][_0x4316('0x92')][_0x4316('0x93')](',');var _0x5c8cc4={};_0x5c8cc4[_0x2bc75d[0x0]]={'$gte':moment(_0x2bc75d[0x1])['format'](_0x4316('0x94'))};_0x13b744[_0x4316('0x8e')]=_[_0x4316('0x29')](_0x13b744[_0x4316('0x8e')],_0x5c8cc4);}_0x13b744=_[_0x4316('0x29')]({},_0x13b744,_0x10368d['options']);return db[_0x4316('0x52')][_0x4316('0x22')]({'where':_0x13b744[_0x4316('0x8e')]})[_0x4316('0x13')](function(_0x4b9386){_0x4ac7f5[_0x4316('0x22')]=_0x4b9386;if(_0x10368d[_0x4316('0x36')][_0x4316('0x95')]){_0x13b744['include']=[{'all':!![]}];}return db['ChatMessage'][_0x4316('0x96')](_0x13b744);})[_0x4316('0x13')](function(_0x1aee4a){_0x4ac7f5[_0x4316('0x97')]=_0x1aee4a;return _0x4ac7f5;});}})['then'](respondWithFilteredResult(_0x3efa55,_0x13b744))[_0x4316('0x1b')](handleError(_0x3efa55,null));};exports['getMyMessages']=function(_0x11cd0d,_0x234bbb){var _0x4e3c41={'where':{}},_0xb2dca2={},_0x15872a={'count':0x0,'rows':[]};return db[_0x4316('0x30')]['findOne']({'where':{'id':_0x11cd0d[_0x4316('0x37')]['id']}})[_0x4316('0x13')](handleEntityNotFound(_0x234bbb,null))[_0x4316('0x13')](function(_0xeacd3e){if(_0xeacd3e){_0xb2dca2[_0x4316('0x88')]=_['keys'](db['ChatMessage'][_0x4316('0x31')]);_0xb2dca2['query']=_[_0x4316('0x38')](_0x11cd0d[_0x4316('0x36')]);_0xb2dca2[_0x4316('0x89')]=_[_0x4316('0x3a')](_0xb2dca2[_0x4316('0x88')],_0xb2dca2[_0x4316('0x36')]);_0x4e3c41[_0x4316('0x39')]=_[_0x4316('0x3a')](_0xb2dca2[_0x4316('0x88')],qs[_0x4316('0x3b')](_0x11cd0d[_0x4316('0x36')][_0x4316('0x3b')]));_0x4e3c41['attributes']=_0x4e3c41['attributes'][_0x4316('0x3c')]?_0x4e3c41[_0x4316('0x39')]:_0xb2dca2[_0x4316('0x88')];if(!_0x11cd0d[_0x4316('0x36')]['hasOwnProperty'](_0x4316('0x8b'))){_0x4e3c41['limit']=qs[_0x4316('0x20')](_0x11cd0d[_0x4316('0x36')][_0x4316('0x20')]);_0x4e3c41[_0x4316('0x1f')]=qs[_0x4316('0x1f')](_0x11cd0d['query'][_0x4316('0x1f')]);}_0x4e3c41[_0x4316('0x8c')]=qs[_0x4316('0x8d')](_0x11cd0d['query'][_0x4316('0x8d')]);_0x4e3c41[_0x4316('0x8e')]=qs['filters'](_[_0x4316('0x8f')](_0x11cd0d[_0x4316('0x36')],_0xb2dca2[_0x4316('0x89')]));_0x4e3c41[_0x4316('0x8e')][_0x4316('0x90')]=_0xeacd3e['id'];if(_0x11cd0d['query']['filter']){_0x4e3c41['where']=_[_0x4316('0x29')](_0x4e3c41[_0x4316('0x8e')],{'$or':_[_0x4316('0x2f')](_0x4e3c41[_0x4316('0x39')],function(_0x2ef3e8){var _0x12c40d={};_0x12c40d[_0x2ef3e8]={'$like':'%'+_0x11cd0d[_0x4316('0x36')][_0x4316('0x91')]+'%'};return _0x12c40d;})});}_0x4e3c41[_0x4316('0x8e')][_0x4316('0x98')]=![];if(_0x11cd0d[_0x4316('0x36')]['id']){_0x4e3c41[_0x4316('0x8e')]['id']={'$gt':_0x11cd0d['query']['id']};}_0x4e3c41=_[_0x4316('0x29')]({},_0x4e3c41,_0x11cd0d[_0x4316('0x99')]);return db[_0x4316('0x52')][_0x4316('0x22')]({'where':_0x4e3c41[_0x4316('0x8e')]})[_0x4316('0x13')](function(_0x250192){_0x15872a[_0x4316('0x22')]=_0x250192;_0x4e3c41['include']=[];if(_0x11cd0d[_0x4316('0x36')][_0x4316('0x9a')]){_0x4e3c41[_0x4316('0x3d')]['push']({'model':db[_0x4316('0x6b')],'as':'User','attributes':['id','fullname','alias']});}if(_0x11cd0d[_0x4316('0x36')]['includeAll']){_0x4e3c41[_0x4316('0x3d')]=[{'all':!![]}];}return db[_0x4316('0x52')]['findAll'](_0x4e3c41);})[_0x4316('0x13')](function(_0x339f40){_0x15872a[_0x4316('0x97')]=_0x339f40;return _0x15872a;});}})[_0x4316('0x13')](respondWithFilteredResult(_0x234bbb,_0x4e3c41))[_0x4316('0x1b')](handleError(_0x234bbb,null));};exports['addTags']=function(_0x1bc168,_0x4d76e0){return db[_0x4316('0x30')][_0x4316('0x3e')]({'where':{'id':_0x1bc168[_0x4316('0x37')]['id']}})['then'](handleEntityNotFound(_0x4d76e0,null))[_0x4316('0x13')](function(_0x5e9fd9){if(_0x5e9fd9){return _0x5e9fd9['setTags'](_0x1bc168['body'][_0x4316('0x86')],_['omit'](_0x1bc168[_0x4316('0x40')],[_0x4316('0x86'),'id'])||{})[_0x4316('0x9b')](function(){return db[_0x4316('0x9c')][_0x4316('0x96')]({'attributes':['id',_0x4316('0x28'),_0x4316('0x9d')],'where':{'id':_0x1bc168['body'][_0x4316('0x86')]}});})[_0x4316('0x13')](function(_0x938400){socket[_0x4316('0x9e')](_0x4316('0x9f'),{'id':Number(_0x1bc168[_0x4316('0x37')]['id']),'tags':_0x938400||[]});return{'id':Number(_0x1bc168['params']['id']),'tags':_0x938400||[]};});}})[_0x4316('0x13')](respondWithResult(_0x4d76e0,null))[_0x4316('0x1b')](handleError(_0x4d76e0,null));};exports[_0x4316('0xa0')]=function(_0x225f39,_0x4f20a8){return db[_0x4316('0x30')][_0x4316('0x3e')]({'where':{'id':_0x225f39[_0x4316('0x37')]['id']}})[_0x4316('0x13')](handleEntityNotFound(_0x4f20a8,null))[_0x4316('0x13')](function(_0x2a20e1){if(_0x2a20e1){return _0x2a20e1[_0x4316('0xa0')](_0x225f39['query'][_0x4316('0x86')]);}})['then'](respondWithStatusCode(_0x4f20a8,null))[_0x4316('0x1b')](handleError(_0x4f20a8,null));};exports[_0x4316('0xa1')]=function(_0x359965,_0x5845c1){var _0x64ca90=moment()[_0x4316('0xa2')]()[_0x4316('0xa3')]();var _0x423e57=path['join'](config['root'],_0x4316('0xa4'),_0x4316('0xa5'),_0x4316('0xa6'));var _0x395560=path[_0x4316('0x63')](config['root'],_0x4316('0xa4'),_0x4316('0xa5'),_0x4316('0xa7'));var _0x1c3eaf=path[_0x4316('0x63')](_0x423e57,_0x64ca90);var _0x466940=util[_0x4316('0x68')](_0x4316('0xa8'),_0x359965[_0x4316('0x37')]['id'],_0x64ca90);var _0x59e692=path['join'](_0x423e57,_0x466940);var _0x3f4f09=[];_0x3f4f09[_0x4316('0xa9')]({'model':db[_0x4316('0x6b')],'as':_0x4316('0x6b'),'attributes':['id',_0x4316('0x75')],'raw':!![]});_0x3f4f09[_0x4316('0xa9')]({'model':db[_0x4316('0x56')],'as':_0x4316('0x57'),'attributes':['id',_0x4316('0xaa'),_0x4316('0xab')],'raw':!![]});if(_0x359965[_0x4316('0x36')][_0x4316('0xa7')]){_0x3f4f09[_0x4316('0xa9')]({'model':db[_0x4316('0x61')],'as':_0x4316('0x61'),'raw':!![]});}var _0x236291=[{'model':db[_0x4316('0x52')],'as':_0x4316('0x6a'),'attributes':['id',_0x4316('0x40'),_0x4316('0x79'),_0x4316('0x7b'),_0x4316('0x98'),_0x4316('0xac')],'include':_0x3f4f09}];_0x236291['push']({'model':db['ChatWebsite'],'as':_0x4316('0xad'),'attributes':['id','name']});_0x236291[_0x4316('0xa9')]({'model':db['User'],'as':_0x4316('0xae'),'attributes':['id','fullname']});return db[_0x4316('0x30')][_0x4316('0x3e')]({'where':{'id':_0x359965['params']['id']},'include':_0x236291})[_0x4316('0x13')](handleEntityNotFound(_0x5845c1,null))[_0x4316('0x13')](function(_0x3348d0){if(_0x3348d0){var _0x5a993f=_0x3348d0[_0x4316('0xaf')]({'plain':!![]});fs[_0x4316('0xb0')](_0x1c3eaf);var _0x396f6b={'channel':'Chat','account':_0x5a993f[_0x4316('0xad')][_0x4316('0x28')],'agent':_0x5a993f['Owner']?_0x5a993f[_0x4316('0xae')]['fullname']:_0x4316('0xb1'),'createdAt':moment(_0x5a993f[_0x4316('0x79')])[_0x4316('0x68')](_0x4316('0x94'))[_0x4316('0xa3')](),'closedAt':_0x5a993f['closed']?moment(_0x5a993f['closedAt'])[_0x4316('0x68')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4316('0xa3')]():'','disposition':_0x5a993f[_0x4316('0xb2')],'chatInfo':{'browser':_0x5a993f[_0x4316('0xb3')],'os':_0x5a993f[_0x4316('0xb4')],'referer':_0x5a993f[_0x4316('0xb5')],'customerIp':_0x5a993f[_0x4316('0xb6')],'customerPort':_0x5a993f[_0x4316('0xb7')]?_0x5a993f[_0x4316('0xb7')]:_0x4316('0xb1')},'messages':_(_0x5a993f[_0x4316('0x6a')])['tail']()[_0x4316('0x91')]({'secret':![]})['map'](function(_0x308214){if(_0x308214[_0x4316('0x61')]){var _0x3577b3=path['join'](_0x395560,_0x308214[_0x4316('0x61')][_0x4316('0x65')]);if(fs['existsSync'](_0x3577b3)){fs[_0x4316('0xb8')](_0x3577b3)[_0x4316('0xb9')](fs[_0x4316('0xba')](path['join'](_0x1c3eaf,_0x308214[_0x4316('0x61')][_0x4316('0x65')])));}}return{'date':moment(_0x308214[_0x4316('0x79')])[_0x4316('0x68')](_0x4316('0x94'))[_0x4316('0xa3')](),'sender':_0x308214[_0x4316('0x7b')]===_0x4316('0x51')?_0x308214[_0x4316('0x6b')]?_0x308214[_0x4316('0x6b')][_0x4316('0x75')]:_0x4316('0x76'):_0x308214['Contact'][_0x4316('0xaa')]+(_0x308214[_0x4316('0x57')][_0x4316('0xab')]?'\x20'+_0x308214['Contact'][_0x4316('0xab')]:''),'body':_0x308214[_0x4316('0x61')]?_0x308214[_0x4316('0x61')][_0x4316('0x65')]:_0x308214['body'],'direction':_0x308214[_0x4316('0x7b')]===_0x4316('0x51')?'A':'C','secret':_0x308214[_0x4316('0x98')],'read':_0x308214['read'],'attachment':_0x308214['Attachment']};})[_0x4316('0xbb')]()};return ejs[_0x4316('0xbc')](path[_0x4316('0x63')](config[_0x4316('0x67')],_0x4316('0xa4'),_0x4316('0xbd'),_0x4316('0xbe')),{'interaction':_0x396f6b})['then'](function(_0x1ca6d6){var _0x23064d=path['join'](_0x1c3eaf,_0x4316('0xbf')+_0x5a993f['id']+'-'+_0x64ca90+_0x4316('0xc0'));var _0x59c24a={'path':_0x23064d,'channel':_0x4316('0xc1'),'interactionId':_0x5a993f['id']};return pdf[_0x4316('0xc2')](_0x1ca6d6,_0x59c24a);})[_0x4316('0x13')](function(){return new Promise(function(_0x4e7a84,_0x59004d){zipdir(_0x1c3eaf,{'saveTo':_0x59e692},function(_0x47addd,_0x49bd90){if(_0x47addd)return _0x59004d(_0x47addd);return _0x4e7a84(_0x49bd90);});})[_0x4316('0x13')](function(){return new BPromise(function(_0x11398e,_0x1c5e88){rimraf(_0x1c3eaf,function(_0xe540c6){if(_0xe540c6)_0x1c5e88(_0xe540c6);return _0x11398e();});});})[_0x4316('0x13')](function(){return _0x5845c1[_0x4316('0xa1')](_0x59e692,_0x466940,function(_0x570eca){if(_0x570eca){logger[_0x4316('0x17')](_0x4316('0xc3'),_0x570eca);}else{fs[_0x4316('0xc4')](_0x59e692);}});});});}else{return _0x5845c1[_0x4316('0x5a')](0xc8);}})[_0x4316('0x1b')](handleError(_0x5845c1,null));};
\ No newline at end of file
+var _0xf76c=['err','unlinkSync','rimraf','request-promise','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','status','end','json','offset','undefined','count','set','Content-Range','stack','name','send','render','merge','agent','interaction','account','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','show','model','keys','filters','attributes','fields','includeAll','create','body','update','find','params','destroy','describe','ChatInteraction','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooApiKey','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','disposition','originalname','basename','file','mimetype','Attachment','attachmentDownload','closed','attachId','join','root','offline-chat/','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','User','length','UserId','%s%d','agentAlias','System','Visitor','ContactId','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','intersection','nolimit','limit','order','sort','where','pick','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','options','include','rows','ChatInteractionId','map','includeAgent','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','toString','server','files','tmp','attachments','transcript-%d-%s.zip','push','fullname','firstName','lastName','read','Account','Owner','get','mkdirSync','N.A.','osName','referer','customerIp','customerPort','tail','createReadStream','pipe','out','renderFile','views','.pdf','createPdfFromHTML'];(function(_0x47bf73,_0x5a4957){var _0x419b53=function(_0x24ed96){while(--_0x24ed96){_0x47bf73['push'](_0x47bf73['shift']());}};_0x419b53(++_0x5a4957);}(_0xf76c,0x1a6));var _0xcf76=function(_0x386b03,_0x5d0000){_0x386b03=_0x386b03-0x0;var _0xd3d524=_0xf76c[_0x386b03];return _0xd3d524;};'use strict';var rimraf=require(_0xcf76('0x0'));var zipdir=require('zip-dir');var rp=require(_0xcf76('0x1'));var moment=require('moment');var BPromise=require(_0xcf76('0x2'));var Mustache=require(_0xcf76('0x3'));var util=require(_0xcf76('0x4'));var path=require(_0xcf76('0x5'));var ejs=require(_0xcf76('0x6'));var fs=require('fs');var _=require(_0xcf76('0x7'));var Redis=require(_0xcf76('0x8'));var interaction=require(_0xcf76('0x9'));var qs=require(_0xcf76('0xa'));var pdf=require(_0xcf76('0xb'));var logger=require(_0xcf76('0xc'))(_0xcf76('0xd'));var config=require(_0xcf76('0xe'));var db=require(_0xcf76('0xf'))['db'];config[_0xcf76('0x10')]=_[_0xcf76('0x11')](config[_0xcf76('0x10')],{'host':_0xcf76('0x12'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcf76('0x10')]));require(_0xcf76('0x13'))[_0xcf76('0x14')](socket);var jayson=require(_0xcf76('0x15'));var client=jayson[_0xcf76('0x16')][_0xcf76('0x17')]({'port':0x232b});var client9004=jayson['client'][_0xcf76('0x17')]({'port':0x232c});function respondWithRpcPromise(_0xd53272,_0x43ac07,_0x36ac3e,_0x19bef8){return new BPromise(function(_0x1d244c,_0x2c699b){var _0x257966=_0x19bef8||client;return _0x257966[_0xcf76('0x18')](_0xd53272,_0x36ac3e)[_0xcf76('0x19')](function(_0x2db105){logger[_0xcf76('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x43ac07,'request\x20sent');logger[_0xcf76('0x1b')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x43ac07,_0xcf76('0x1c'),JSON['stringify'](_0x2db105));if(_0x2db105[_0xcf76('0x1d')]){if(_0x2db105['error'][_0xcf76('0x1e')]===0x1f4){logger[_0xcf76('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x43ac07,_0x2db105[_0xcf76('0x1d')][_0xcf76('0x1f')]);return _0x2c699b(_0x2db105[_0xcf76('0x1d')][_0xcf76('0x1f')]);}logger[_0xcf76('0x1d')](_0xcf76('0x20'),_0x43ac07,_0x2db105[_0xcf76('0x1d')][_0xcf76('0x1f')]);return _0x1d244c(_0x2db105[_0xcf76('0x1d')][_0xcf76('0x1f')]);}else{logger[_0xcf76('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x43ac07,_0xcf76('0x1c'));_0x1d244c(_0x2db105[_0xcf76('0x21')][_0xcf76('0x1f')]);}})[_0xcf76('0x22')](function(_0x106a82){logger[_0xcf76('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x43ac07,_0x106a82);_0x2c699b(_0x106a82);});});}function respondWithStatusCode(_0x5d65a8,_0x283513){_0x283513=_0x283513||0xcc;return function(_0x62e6f9){if(_0x62e6f9){return _0x5d65a8['sendStatus'](_0x283513);}return _0x5d65a8[_0xcf76('0x23')](_0x283513)[_0xcf76('0x24')]();};}function respondWithResult(_0x42ee71,_0x1c2b0c){_0x1c2b0c=_0x1c2b0c||0xc8;return function(_0x591ebb){if(_0x591ebb){return _0x42ee71['status'](_0x1c2b0c)[_0xcf76('0x25')](_0x591ebb);}};}function respondWithFilteredResult(_0x51dd39,_0x28bb36){return function(_0x17f6ce){if(_0x17f6ce){var _0x242ee6=typeof _0x28bb36[_0xcf76('0x26')]===_0xcf76('0x27')&&typeof _0x28bb36['limit']===_0xcf76('0x27');var _0x17e87b=_0x17f6ce['count'];var _0x219c91=_0x242ee6?0x0:_0x28bb36[_0xcf76('0x26')];var _0x4b087c=_0x242ee6?_0x17f6ce[_0xcf76('0x28')]:_0x28bb36['offset']+_0x28bb36['limit'];var _0x112e32;if(_0x4b087c>=_0x17e87b){_0x4b087c=_0x17e87b;_0x112e32=0xc8;}else{_0x112e32=0xce;}_0x51dd39['status'](_0x112e32);return _0x51dd39[_0xcf76('0x29')](_0xcf76('0x2a'),_0x219c91+'-'+_0x4b087c+'/'+_0x17e87b)[_0xcf76('0x25')](_0x17f6ce);}return null;};}function saveUpdates(_0x153936){return function(_0x43ce25){if(_0x43ce25){return _0x43ce25['update'](_0x153936)[_0xcf76('0x19')](function(_0x23ef9e){return _0x23ef9e;});}return null;};}function removeEntity(_0x1b5635){return function(_0x9f461c){if(_0x9f461c){return _0x9f461c['destroy']()[_0xcf76('0x19')](function(){_0x1b5635['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe3c876){return function(_0x25f278){if(!_0x25f278){_0xe3c876['sendStatus'](0x194);}return _0x25f278;};}function handleError(_0x5a4c58,_0x25f3af){_0x25f3af=_0x25f3af||0x1f4;return function(_0x5f2249){logger[_0xcf76('0x1d')](_0x5f2249[_0xcf76('0x2b')]);if(_0x5f2249[_0xcf76('0x2c')]){delete _0x5f2249[_0xcf76('0x2c')];}_0x5a4c58[_0xcf76('0x23')](_0x25f3af)[_0xcf76('0x2d')](_0x5f2249);};}function getMustacheRender(_0x4f3d29,_0x4931ff){return Mustache[_0xcf76('0x2e')](_0x4f3d29,_[_0xcf76('0x2f')](_0x4931ff['body'],{'contact':_0x4931ff['contact'],'message':_0x4931ff[_0xcf76('0x1f')],'agent':_0x4931ff[_0xcf76('0x30')],'interaction':_0x4931ff[_0xcf76('0x31')],'account':_0x4931ff[_0xcf76('0x32')]}))||'';}exports['index']=function(_0x44e971,_0x5ca8c1){var _0x48cc54={};var _0x33f0cb=_['map'](db['ChatInteraction'][_0xcf76('0x33')],function(_0x406e90){return{'name':_0x406e90[_0xcf76('0x34')],'type':_0x406e90[_0xcf76('0x35')][_0xcf76('0x36')]};});_0x48cc54=qs[_0xcf76('0x37')](_0x33f0cb,_0x44e971);return interaction[_0xcf76('0x38')](_0xcf76('0x39'),_0x44e971[_0xcf76('0x3a')],_0x44e971[_0xcf76('0x3b')],_0x48cc54,_0x33f0cb)[_0xcf76('0x19')](respondWithFilteredResult(_0x5ca8c1,_0x48cc54))[_0xcf76('0x22')](handleError(_0x5ca8c1,null));};exports[_0xcf76('0x3c')]=function(_0x56edaf,_0x14ab99){var _0x5452e7={'raw':![],'where':{'id':_0x56edaf['params']['id']}},_0x241926={};_0x241926[_0xcf76('0x3d')]=_[_0xcf76('0x3e')](db['ChatInteraction'][_0xcf76('0x33')]);_0x241926[_0xcf76('0x3a')]=_[_0xcf76('0x3e')](_0x56edaf[_0xcf76('0x3a')]);_0x241926[_0xcf76('0x3f')]=_['intersection'](_0x241926[_0xcf76('0x3d')],_0x241926[_0xcf76('0x3a')]);_0x5452e7[_0xcf76('0x40')]=_['intersection'](_0x241926['model'],qs[_0xcf76('0x41')](_0x56edaf[_0xcf76('0x3a')][_0xcf76('0x41')]));_0x5452e7[_0xcf76('0x40')]=_0x5452e7[_0xcf76('0x40')]['length']?_0x5452e7[_0xcf76('0x40')]:_0x241926[_0xcf76('0x3d')];if(_0x56edaf[_0xcf76('0x3a')][_0xcf76('0x42')]){_0x5452e7['include']=[{'all':!![]}];}_0x5452e7=_[_0xcf76('0x2f')]({},_0x5452e7,_0x56edaf['options']);return db['ChatInteraction']['find'](_0x5452e7)['then'](handleEntityNotFound(_0x14ab99,null))[_0xcf76('0x19')](respondWithResult(_0x14ab99,null))['catch'](handleError(_0x14ab99,null));};exports[_0xcf76('0x43')]=function(_0x5a3f01,_0x511c9c){return db['ChatInteraction'][_0xcf76('0x43')](_0x5a3f01[_0xcf76('0x44')],{})[_0xcf76('0x19')](respondWithResult(_0x511c9c,0xc9))[_0xcf76('0x22')](handleError(_0x511c9c,null));};exports[_0xcf76('0x45')]=function(_0x55faa4,_0x292e65){if(_0x55faa4[_0xcf76('0x44')]['id']){delete _0x55faa4[_0xcf76('0x44')]['id'];}return db['ChatInteraction'][_0xcf76('0x46')]({'where':{'id':_0x55faa4[_0xcf76('0x47')]['id']}})[_0xcf76('0x19')](handleEntityNotFound(_0x292e65,null))[_0xcf76('0x19')](saveUpdates(_0x55faa4[_0xcf76('0x44')],null))[_0xcf76('0x19')](respondWithResult(_0x292e65,null))[_0xcf76('0x22')](handleError(_0x292e65,null));};exports[_0xcf76('0x48')]=function(_0x47e990,_0x88dde9){return db['ChatInteraction'][_0xcf76('0x46')]({'where':{'id':_0x47e990['params']['id']}})[_0xcf76('0x19')](handleEntityNotFound(_0x88dde9,null))[_0xcf76('0x19')](removeEntity(_0x88dde9,null))[_0xcf76('0x22')](handleError(_0x88dde9,null));};exports[_0xcf76('0x49')]=function(_0x54eb6b,_0x5d8b95){return db[_0xcf76('0x4a')][_0xcf76('0x49')]()[_0xcf76('0x19')](respondWithResult(_0x5d8b95,null))[_0xcf76('0x22')](handleError(_0x5d8b95,null));};exports[_0xcf76('0x4b')]=function(_0x1be64b,_0x50ae6a){var _0x5b4857=_0x1be64b[_0xcf76('0x47')]['id'];var _0x45dec8;var _0x4817ca;var _0x392dfc;return db['ChatInteraction'][_0xcf76('0x4c')]({'where':{'id':_0x5b4857}})['then'](function(_0x2bb951){_0x45dec8=_0x2bb951;return db[_0xcf76('0x4d')][_0xcf76('0x4c')]({'where':{'id':_0x2bb951[_0xcf76('0x4e')]},'attributes':['id','vidaooApiKey',_0xcf76('0x4f'),_0xcf76('0x50'),'vidaooNote','vidaooMetadata'],'raw':!![]});})['then'](function(_0x5bf40e){if(_0x5bf40e&&_0x5bf40e[_0xcf76('0x51')]&&_0x5bf40e[_0xcf76('0x4f')]){_0x4817ca=_0x5bf40e;var _0x385515={'interaction':{'id':_0x5b4857},'agent':{'id':_0x1be64b['user']['id'],'name':_0x1be64b[_0xcf76('0x3b')]['name'],'fullname':_0x1be64b[_0xcf76('0x3b')]['fullname'],'email':_0x1be64b[_0xcf76('0x3b')][_0xcf76('0x52')]},'contact':_0x1be64b[_0xcf76('0x44')][_0xcf76('0x53')],'account':_0x1be64b['body'][_0xcf76('0x32')]};var _0x517bce={'rejectUnauthorized':![],'method':_0xcf76('0x54'),'url':_0xcf76('0x55'),'headers':{'X-APIKEY':_0x5bf40e[_0xcf76('0x51')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1be64b['user'][_0xcf76('0x52')]],'buttons':null,'topic':_0x4817ca[_0xcf76('0x50')],'note':_[_0xcf76('0x56')](_0x4817ca[_0xcf76('0x57')])?null:getMustacheRender(_0x4817ca[_0xcf76('0x57')],_0x385515),'metadata':null},'redirect':_0xcf76('0x58'),'json':!![]};try{if(!_[_0xcf76('0x56')](_0x4817ca[_0xcf76('0x59')])){var _0x55292a=getMustacheRender(_0x4817ca['vidaooMetadata'],_0x385515);var _0x1a67d0=JSON['parse'](_0x55292a);_0x517bce['body'][_0xcf76('0x5a')]=_0x1a67d0;}}catch(_0x192a49){throw new db['Sequelize'][(_0xcf76('0x5b'))](_0xcf76('0x5c'));}return rp(_0x517bce);}else{throw new db[(_0xcf76('0x5d'))]['ValidationError'](_0xcf76('0x5e'));}})[_0xcf76('0x19')](function(_0x25753c){_0x392dfc=_0x25753c;if(_0x392dfc['id']){var _0x21db63={'body':_0x392dfc[_0xcf76('0x5f')],'ChatWebsiteId':_0x4817ca['id'],'ChatInteractionId':_0x45dec8['id'],'direction':'out','UserId':_0x1be64b[_0xcf76('0x3b')]['id']};return db[_0xcf76('0x60')][_0xcf76('0x43')](_0x21db63,{});}else{throw new db[(_0xcf76('0x5d'))][(_0xcf76('0x5b'))](_0xcf76('0x61'));}})[_0xcf76('0x19')](function(){return _0x45dec8[_0xcf76('0x62')]({'vidaooSessionId':_0x392dfc['id']});})['then'](respondWithResult(_0x50ae6a,null))[_0xcf76('0x22')](handleError(_0x50ae6a,null));};exports['customUpdate']=function(_0x323221,_0x5a76dd){if(_0x323221[_0xcf76('0x44')]['id']){delete _0x323221[_0xcf76('0x44')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x323221[_0xcf76('0x47')]['id']},'include':[{'model':db[_0xcf76('0x63')],'as':_0xcf76('0x64')}]})['then'](handleEntityNotFound(_0x5a76dd,null))[_0xcf76('0x19')](saveUpdates(_0x323221[_0xcf76('0x44')],null))[_0xcf76('0x19')](respondWithResult(_0x5a76dd,null))[_0xcf76('0x22')](handleError(_0x5a76dd,null));};exports['abandon']=function(_0x3d3319,_0x4748e3){if(_0x3d3319[_0xcf76('0x44')]['id']){delete _0x3d3319[_0xcf76('0x44')]['id'];}return db[_0xcf76('0x4a')][_0xcf76('0x46')]({'where':{'id':_0x3d3319[_0xcf76('0x47')]['id']}})[_0xcf76('0x19')](function(_0x205416){if(!_0x205416){logger[_0xcf76('0x1d')](_0xcf76('0x65'),_0xcf76('0x66'),0x194,_0xcf76('0x67'));_0x4748e3[_0xcf76('0x68')](0x194);}else{if(_0x205416['UserId']){throw new db[(_0xcf76('0x5d'))][(_0xcf76('0x5b'))](_0xcf76('0x69'));}}return _0x205416;})[_0xcf76('0x19')](function(_0x4a3fe8){if(_0x4a3fe8){return _0x4a3fe8[_0xcf76('0x45')]({'closed':_0x3d3319[_0xcf76('0x44')]['closed'],'disposition':_0x3d3319['body'][_0xcf76('0x6a')]})['then'](function(_0x1dad94){return _0x1dad94;});}})[_0xcf76('0x19')](function(){return respondWithRpcPromise('AbandonInteraction',_0xcf76('0x66'),_0x3d3319['body'],client9004);})[_0xcf76('0x19')](respondWithResult(_0x4748e3,null))[_0xcf76('0x22')](handleError(_0x4748e3,null));};exports['attachmentUpload']=function(_0x3bd8a9,_0x193c12){_0x3bd8a9[_0xcf76('0x44')][_0xcf76('0x2c')]=_0x3bd8a9['file'][_0xcf76('0x6b')];_0x3bd8a9['body'][_0xcf76('0x6c')]=_0x3bd8a9[_0xcf76('0x6d')]['filename'];_0x3bd8a9[_0xcf76('0x44')][_0xcf76('0x35')]=_0x3bd8a9[_0xcf76('0x6d')][_0xcf76('0x6e')];return db[_0xcf76('0x6f')][_0xcf76('0x43')](_0x3bd8a9['body'])[_0xcf76('0x19')](respondWithResult(_0x193c12,0xc9))['catch'](handleError(_0x193c12,null));};exports[_0xcf76('0x70')]=function(_0x39a12c,_0x2373e7){return db['ChatInteraction'][_0xcf76('0x4c')]({'where':{'id':_0x39a12c['params']['id']},'raw':!![]})[_0xcf76('0x19')](handleEntityNotFound(_0x2373e7,null))[_0xcf76('0x19')](function(_0x517f35){if(_0x517f35){if(_0x517f35[_0xcf76('0x71')]){return _0x2373e7[_0xcf76('0x23')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xcf76('0x6f')]['findOne']({'where':{'id':_0x39a12c[_0xcf76('0x3a')][_0xcf76('0x72')]},'raw':!![]})[_0xcf76('0x19')](handleEntityNotFound(_0x2373e7,null));}})[_0xcf76('0x19')](function(_0x38e7ab){if(_0x38e7ab){var _0x19d698=_0x38e7ab['ChatOfflineMessageId']!==null;var _0x2a3947=path[_0xcf76('0x73')](config[_0xcf76('0x74')],'server/files/attachments/');if(_0x19d698){_0x2a3947=path[_0xcf76('0x73')](_0x2a3947,_0xcf76('0x75'));}var _0x5dd019=path[_0xcf76('0x73')](_0x2a3947,_0x38e7ab[_0xcf76('0x6c')]);return _0x2373e7['download'](_0x5dd019);}})['catch'](handleError(_0x2373e7,null));};exports['close']=function(_0x2713bf,_0x3ff543){var _0x46bf36=null;var _0x2b20d0=null;var _0x5e3f84=null;if(_0x2713bf[_0xcf76('0x44')]['id']){delete _0x2713bf[_0xcf76('0x44')]['id'];}if(_0x2713bf[_0xcf76('0x44')][_0xcf76('0x76')]){_0x5e3f84=path[_0xcf76('0x73')](config['root'],_0xcf76('0x77'),util[_0xcf76('0x78')]('transcript-%s.txt',Date[_0xcf76('0x79')]()));_0x2713bf['body'][_0xcf76('0x7a')]=_0x5e3f84;}return db[_0xcf76('0x4a')]['find']({'where':{'id':_0x2713bf[_0xcf76('0x47')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xcf76('0x7b'),'include':[{'model':db['User'],'as':_0xcf76('0x7c')}]}]})[_0xcf76('0x19')](handleEntityNotFound(_0x3ff543,null))[_0xcf76('0x19')](saveUpdates(_0x2713bf['body'],null))[_0xcf76('0x19')](function(_0xdf40c4){if(_0xdf40c4){_0x46bf36=_0xdf40c4;return db['ChatWebsite'][_0xcf76('0x46')]({'where':{'id':_0x46bf36['ChatWebsiteId']}});}})['then'](function(_0x5e6352){if(_0x5e6352){_0x2b20d0=_0x5e6352;return db[_0xcf76('0x63')][_0xcf76('0x46')]({'where':{'id':_0x46bf36['ContactId']}});}})['then'](function(_0x57b3f7){if(_0x57b3f7){if(_0x5e3f84){var _0x47f60a=null;for(var _0x570b31=0x1;_0x570b31<_0x46bf36['Messages'][_0xcf76('0x7d')];++_0x570b31){_0x47f60a=_0x46bf36[_0xcf76('0x7b')][_0x570b31];var _0x45aa22=_0x47f60a[_0xcf76('0x7e')]?util[_0xcf76('0x78')](_0xcf76('0x7f'),_0x2b20d0[_0xcf76('0x80')],_0x47f60a[_0xcf76('0x7e')]):_0xcf76('0x81');var _0x176f25=_0x2713bf[_0xcf76('0x44')]['customer']||util[_0xcf76('0x78')]('%s%d',_0xcf76('0x82'),_0x47f60a[_0xcf76('0x83')]);switch(_0x2b20d0[_0xcf76('0x84')]){case _0xcf76('0x85'):_0x45aa22=_0x47f60a[_0xcf76('0x7e')]?util['format'](_0xcf76('0x7f'),_0x2b20d0['agentAlias'],_0x47f60a['UserId']):'System';break;case'agent_alias':_0x45aa22=_0x47f60a[_0xcf76('0x7e')]?_0x47f60a['User'][_0xcf76('0x86')]||_0x47f60a['User']['fullname']:_0xcf76('0x81');break;case _0xcf76('0x87'):_0x45aa22=_0x47f60a['UserId']?_0x47f60a['User']['fullname']:_0xcf76('0x81');break;default:_0x45aa22=_0x47f60a['UserId']?util[_0xcf76('0x78')](_0xcf76('0x7f'),_0x2b20d0['agentAlias'],_0x47f60a[_0xcf76('0x7e')]):_0xcf76('0x81');}var _0x28e923=util[_0xcf76('0x78')](_0xcf76('0x88'),moment(_0x47f60a[_0xcf76('0x89')])[_0xcf76('0x78')](_0xcf76('0x8a')),_0x47f60a[_0xcf76('0x8b')]==='in'?_0x176f25:_0x45aa22,_0x47f60a[_0xcf76('0x44')]);if(!_0x47f60a[_0xcf76('0x8c')]){fs[_0xcf76('0x8d')](_0x5e3f84,_0x28e923);}}return db[_0xcf76('0x8e')][_0xcf76('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0xcf76('0x8f')],'as':_0xcf76('0x90'),'raw':!![],'include':[{'model':db[_0xcf76('0x91')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xcf76('0x19')](function(_0x3b10fa){if(!_0x3b10fa||!_0x3b10fa[_0xcf76('0x90')]||!_0x2713bf[_0xcf76('0x44')])return _0x46bf36;var _0x3495be=_0x3b10fa['getSmtpOptions']();return respondWithRpcPromise(_0xcf76('0x92'),_0xcf76('0x93'),{'account':_0x3495be,'message':{'from':util[_0xcf76('0x78')](_0xcf76('0x94'),_0x3b10fa[_0xcf76('0x2c')],_0x3b10fa[_0xcf76('0x52')]||_0x3b10fa[_0xcf76('0x90')]['user']),'to':_0x2713bf[_0xcf76('0x44')][_0xcf76('0x76')],'subject':_0xcf76('0x95'),'text':util[_0xcf76('0x78')](_0xcf76('0x96'),_0x2713bf[_0xcf76('0x44')][_0xcf76('0x76')]),'attachments':[{'path':_0x5e3f84}]}})['then'](function(){return _0x46bf36;})[_0xcf76('0x22')](function(_0xc2e55f){logger[_0xcf76('0x1d')](_0xc2e55f);});})[_0xcf76('0x19')](respondWithStatusCode(_0x3ff543,0xc8))['catch'](handleError(_0x3ff543,null));};exports[_0xcf76('0x97')]=function(_0x1fb71c,_0x263f99){return db['ChatMessage']['find']({'where':{'id':_0x1fb71c[_0xcf76('0x47')]['id']}})['then'](handleEntityNotFound(_0x263f99,null))[_0xcf76('0x19')](function(_0x51fd5b){if(_0x51fd5b){return _0x51fd5b[_0xcf76('0x97')](_0x1fb71c['body'][_0xcf76('0x98')],_[_0xcf76('0x99')](_0x1fb71c[_0xcf76('0x44')],[_0xcf76('0x98'),'id'])||{});}})[_0xcf76('0x19')](respondWithResult(_0x263f99,null))[_0xcf76('0x22')](handleError(_0x263f99,null));};exports[_0xcf76('0x9a')]=function(_0x428358,_0x407ce3){var _0x4e120f={'raw':![],'where':{}};var _0x1ee457={};var _0x20ffb5={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xcf76('0x4c')]({'where':{'id':_0x428358[_0xcf76('0x47')]['id']}})[_0xcf76('0x19')](handleEntityNotFound(_0x407ce3,null))['then'](function(_0x42e635){if(_0x42e635){_0x1ee457[_0xcf76('0x3d')]=_[_0xcf76('0x3e')](db['ChatMessage'][_0xcf76('0x33')]);_0x1ee457[_0xcf76('0x3a')]=_['keys'](_0x428358['query']);_0x1ee457[_0xcf76('0x3f')]=_[_0xcf76('0x9b')](_0x1ee457[_0xcf76('0x3d')],_0x1ee457[_0xcf76('0x3a')]);_0x4e120f['attributes']=_[_0xcf76('0x9b')](_0x1ee457['model'],qs[_0xcf76('0x41')](_0x428358[_0xcf76('0x3a')][_0xcf76('0x41')]));_0x4e120f[_0xcf76('0x40')]=_0x4e120f['attributes'][_0xcf76('0x7d')]?_0x4e120f[_0xcf76('0x40')]:_0x1ee457[_0xcf76('0x3d')];if(!_0x428358[_0xcf76('0x3a')]['hasOwnProperty'](_0xcf76('0x9c'))){_0x4e120f['limit']=qs[_0xcf76('0x9d')](_0x428358['query'][_0xcf76('0x9d')]);_0x4e120f[_0xcf76('0x26')]=qs['offset'](_0x428358[_0xcf76('0x3a')]['offset']);}_0x4e120f[_0xcf76('0x9e')]=qs[_0xcf76('0x9f')](_0x428358[_0xcf76('0x3a')]['sort']);_0x4e120f[_0xcf76('0xa0')]=qs[_0xcf76('0x3f')](_[_0xcf76('0xa1')](_0x428358[_0xcf76('0x3a')],_0x1ee457[_0xcf76('0x3f')]));_0x4e120f['where']['ChatInteractionId']=_0x42e635['id'];if(_0x428358[_0xcf76('0x3a')][_0xcf76('0xa2')]){_0x4e120f[_0xcf76('0xa0')]=_[_0xcf76('0x2f')](_0x4e120f[_0xcf76('0xa0')],{'$or':_['map'](_0x4e120f[_0xcf76('0x40')],function(_0xc0d98a){var _0x385f23={};_0x385f23[_0xc0d98a]={'$like':'%'+_0x428358[_0xcf76('0x3a')]['filter']+'%'};return _0x385f23;})});}if(_0x428358[_0xcf76('0x3a')][_0xcf76('0xa3')]){var _0x5eae95=_0x428358['query'][_0xcf76('0xa3')]['split'](',');var _0x207a36={};_0x207a36[_0x5eae95[0x0]]={'$gte':moment(_0x5eae95[0x1])['format'](_0xcf76('0xa4'))};_0x4e120f[_0xcf76('0xa0')]=_[_0xcf76('0x2f')](_0x4e120f[_0xcf76('0xa0')],_0x207a36);}_0x4e120f=_['merge']({},_0x4e120f,_0x428358[_0xcf76('0xa5')]);return db['ChatMessage'][_0xcf76('0x28')]({'where':_0x4e120f['where']})['then'](function(_0x17d2dc){_0x20ffb5['count']=_0x17d2dc;if(_0x428358[_0xcf76('0x3a')][_0xcf76('0x42')]){_0x4e120f[_0xcf76('0xa6')]=[{'all':!![]}];}return db[_0xcf76('0x60')][_0xcf76('0x38')](_0x4e120f);})['then'](function(_0x362283){_0x20ffb5[_0xcf76('0xa7')]=_0x362283;return _0x20ffb5;});}})[_0xcf76('0x19')](respondWithFilteredResult(_0x407ce3,_0x4e120f))[_0xcf76('0x22')](handleError(_0x407ce3,null));};exports['getMyMessages']=function(_0x4bc359,_0x2a83ab){var _0x1b2705={'where':{}},_0x275e09={},_0x29a166={'count':0x0,'rows':[]};return db[_0xcf76('0x4a')][_0xcf76('0x4c')]({'where':{'id':_0x4bc359[_0xcf76('0x47')]['id']}})[_0xcf76('0x19')](handleEntityNotFound(_0x2a83ab,null))['then'](function(_0x4c1389){if(_0x4c1389){_0x275e09[_0xcf76('0x3d')]=_['keys'](db[_0xcf76('0x60')]['rawAttributes']);_0x275e09[_0xcf76('0x3a')]=_[_0xcf76('0x3e')](_0x4bc359[_0xcf76('0x3a')]);_0x275e09[_0xcf76('0x3f')]=_[_0xcf76('0x9b')](_0x275e09[_0xcf76('0x3d')],_0x275e09['query']);_0x1b2705[_0xcf76('0x40')]=_[_0xcf76('0x9b')](_0x275e09[_0xcf76('0x3d')],qs[_0xcf76('0x41')](_0x4bc359['query'][_0xcf76('0x41')]));_0x1b2705[_0xcf76('0x40')]=_0x1b2705[_0xcf76('0x40')][_0xcf76('0x7d')]?_0x1b2705[_0xcf76('0x40')]:_0x275e09[_0xcf76('0x3d')];if(!_0x4bc359[_0xcf76('0x3a')]['hasOwnProperty']('nolimit')){_0x1b2705[_0xcf76('0x9d')]=qs[_0xcf76('0x9d')](_0x4bc359[_0xcf76('0x3a')]['limit']);_0x1b2705[_0xcf76('0x26')]=qs[_0xcf76('0x26')](_0x4bc359[_0xcf76('0x3a')][_0xcf76('0x26')]);}_0x1b2705['order']=qs[_0xcf76('0x9f')](_0x4bc359[_0xcf76('0x3a')][_0xcf76('0x9f')]);_0x1b2705[_0xcf76('0xa0')]=qs[_0xcf76('0x3f')](_['pick'](_0x4bc359[_0xcf76('0x3a')],_0x275e09[_0xcf76('0x3f')]));_0x1b2705[_0xcf76('0xa0')][_0xcf76('0xa8')]=_0x4c1389['id'];if(_0x4bc359[_0xcf76('0x3a')][_0xcf76('0xa2')]){_0x1b2705[_0xcf76('0xa0')]=_[_0xcf76('0x2f')](_0x1b2705[_0xcf76('0xa0')],{'$or':_[_0xcf76('0xa9')](_0x1b2705['attributes'],function(_0x313aad){var _0x50ee9a={};_0x50ee9a[_0x313aad]={'$like':'%'+_0x4bc359['query'][_0xcf76('0xa2')]+'%'};return _0x50ee9a;})});}_0x1b2705[_0xcf76('0xa0')][_0xcf76('0x8c')]=![];if(_0x4bc359[_0xcf76('0x3a')]['id']){_0x1b2705[_0xcf76('0xa0')]['id']={'$gt':_0x4bc359[_0xcf76('0x3a')]['id']};}_0x1b2705=_[_0xcf76('0x2f')]({},_0x1b2705,_0x4bc359['options']);return db[_0xcf76('0x60')]['count']({'where':_0x1b2705[_0xcf76('0xa0')]})['then'](function(_0x4ba314){_0x29a166[_0xcf76('0x28')]=_0x4ba314;_0x1b2705[_0xcf76('0xa6')]=[];if(_0x4bc359['query'][_0xcf76('0xaa')]){_0x1b2705['include']['push']({'model':db[_0xcf76('0x7c')],'as':_0xcf76('0x7c'),'attributes':['id','fullname','alias']});}if(_0x4bc359['query'][_0xcf76('0x42')]){_0x1b2705['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x1b2705);})[_0xcf76('0x19')](function(_0x438b45){_0x29a166[_0xcf76('0xa7')]=_0x438b45;return _0x29a166;});}})[_0xcf76('0x19')](respondWithFilteredResult(_0x2a83ab,_0x1b2705))['catch'](handleError(_0x2a83ab,null));};exports[_0xcf76('0xab')]=function(_0x4d1106,_0x5ad5a0){return db[_0xcf76('0x4a')][_0xcf76('0x46')]({'where':{'id':_0x4d1106[_0xcf76('0x47')]['id']}})[_0xcf76('0x19')](handleEntityNotFound(_0x5ad5a0,null))[_0xcf76('0x19')](function(_0x46d34d){if(_0x46d34d){return _0x46d34d[_0xcf76('0xac')](_0x4d1106[_0xcf76('0x44')][_0xcf76('0x98')],_['omit'](_0x4d1106[_0xcf76('0x44')],[_0xcf76('0x98'),'id'])||{})[_0xcf76('0xad')](function(){return db[_0xcf76('0xae')]['findAll']({'attributes':['id',_0xcf76('0x2c'),_0xcf76('0xaf')],'where':{'id':_0x4d1106['body'][_0xcf76('0x98')]}});})[_0xcf76('0x19')](function(_0x34e943){socket[_0xcf76('0xb0')](_0xcf76('0xb1'),{'id':Number(_0x4d1106['params']['id']),'tags':_0x34e943||[]});return{'id':Number(_0x4d1106[_0xcf76('0x47')]['id']),'tags':_0x34e943||[]};});}})[_0xcf76('0x19')](respondWithResult(_0x5ad5a0,null))[_0xcf76('0x22')](handleError(_0x5ad5a0,null));};exports['removeTags']=function(_0x3ca927,_0x55deac){return db[_0xcf76('0x4a')][_0xcf76('0x46')]({'where':{'id':_0x3ca927['params']['id']}})[_0xcf76('0x19')](handleEntityNotFound(_0x55deac,null))['then'](function(_0x571564){if(_0x571564){return _0x571564[_0xcf76('0xb2')](_0x3ca927['query'][_0xcf76('0x98')]);}})[_0xcf76('0x19')](respondWithStatusCode(_0x55deac,null))['catch'](handleError(_0x55deac,null));};exports[_0xcf76('0xb3')]=function(_0x4416ee,_0x2089e8){var _0x4b6c51=moment()['unix']()[_0xcf76('0xb4')]();var _0x188a09=path[_0xcf76('0x73')](config[_0xcf76('0x74')],_0xcf76('0xb5'),_0xcf76('0xb6'),_0xcf76('0xb7'));var _0xb23641=path[_0xcf76('0x73')](config[_0xcf76('0x74')],'server',_0xcf76('0xb6'),_0xcf76('0xb8'));var _0x193321=path[_0xcf76('0x73')](_0x188a09,_0x4b6c51);var _0x397fd7=util[_0xcf76('0x78')](_0xcf76('0xb9'),_0x4416ee[_0xcf76('0x47')]['id'],_0x4b6c51);var _0x1c925c=path['join'](_0x188a09,_0x397fd7);var _0x40bb90=[];_0x40bb90[_0xcf76('0xba')]({'model':db[_0xcf76('0x7c')],'as':_0xcf76('0x7c'),'attributes':['id',_0xcf76('0xbb')],'raw':!![]});_0x40bb90[_0xcf76('0xba')]({'model':db[_0xcf76('0x63')],'as':_0xcf76('0x64'),'attributes':['id',_0xcf76('0xbc'),_0xcf76('0xbd')],'raw':!![]});if(_0x4416ee['query']['attachments']){_0x40bb90[_0xcf76('0xba')]({'model':db[_0xcf76('0x6f')],'as':'Attachment','raw':!![]});}var _0x3f2536=[{'model':db[_0xcf76('0x60')],'as':'Messages','attributes':['id',_0xcf76('0x44'),_0xcf76('0x89'),_0xcf76('0x8b'),_0xcf76('0x8c'),_0xcf76('0xbe')],'include':_0x40bb90}];_0x3f2536['push']({'model':db[_0xcf76('0x4d')],'as':_0xcf76('0xbf'),'attributes':['id','name']});_0x3f2536['push']({'model':db[_0xcf76('0x7c')],'as':_0xcf76('0xc0'),'attributes':['id',_0xcf76('0xbb')]});return db[_0xcf76('0x4a')][_0xcf76('0x46')]({'where':{'id':_0x4416ee[_0xcf76('0x47')]['id']},'include':_0x3f2536})[_0xcf76('0x19')](handleEntityNotFound(_0x2089e8,null))[_0xcf76('0x19')](function(_0x3e519b){if(_0x3e519b){var _0x13c394=_0x3e519b[_0xcf76('0xc1')]({'plain':!![]});fs[_0xcf76('0xc2')](_0x193321);var _0x25cf6d={'channel':'Chat','account':_0x13c394['Account'][_0xcf76('0x2c')],'agent':_0x13c394[_0xcf76('0xc0')]?_0x13c394[_0xcf76('0xc0')][_0xcf76('0xbb')]:_0xcf76('0xc3'),'createdAt':moment(_0x13c394[_0xcf76('0x89')])[_0xcf76('0x78')]('YYYY-MM-DD\x20HH:mm:ss')[_0xcf76('0xb4')](),'closedAt':_0x13c394[_0xcf76('0x71')]?moment(_0x13c394['closedAt'])[_0xcf76('0x78')](_0xcf76('0xa4'))[_0xcf76('0xb4')]():'','disposition':_0x13c394[_0xcf76('0x6a')],'chatInfo':{'browser':_0x13c394['browserName'],'os':_0x13c394[_0xcf76('0xc4')],'referer':_0x13c394[_0xcf76('0xc5')],'customerIp':_0x13c394[_0xcf76('0xc6')],'customerPort':_0x13c394[_0xcf76('0xc7')]?_0x13c394[_0xcf76('0xc7')]:_0xcf76('0xc3')},'messages':_(_0x13c394[_0xcf76('0x7b')])[_0xcf76('0xc8')]()['filter']({'secret':![]})[_0xcf76('0xa9')](function(_0x244984){if(_0x244984['Attachment']){var _0x446c2d=path[_0xcf76('0x73')](_0xb23641,_0x244984[_0xcf76('0x6f')][_0xcf76('0x6c')]);if(fs['existsSync'](_0x446c2d)){fs[_0xcf76('0xc9')](_0x446c2d)[_0xcf76('0xca')](fs['createWriteStream'](path[_0xcf76('0x73')](_0x193321,_0x244984['Attachment'][_0xcf76('0x6c')])));}}return{'date':moment(_0x244984[_0xcf76('0x89')])[_0xcf76('0x78')](_0xcf76('0xa4'))[_0xcf76('0xb4')](),'sender':_0x244984[_0xcf76('0x8b')]==='out'?_0x244984['User']?_0x244984[_0xcf76('0x7c')][_0xcf76('0xbb')]:'System':_0x244984[_0xcf76('0x64')][_0xcf76('0xbc')]+(_0x244984[_0xcf76('0x64')][_0xcf76('0xbd')]?'\x20'+_0x244984[_0xcf76('0x64')]['lastName']:''),'body':_0x244984[_0xcf76('0x6f')]?_0x244984[_0xcf76('0x6f')][_0xcf76('0x6c')]:_0x244984['body'],'direction':_0x244984[_0xcf76('0x8b')]===_0xcf76('0xcb')?'A':'C','secret':_0x244984[_0xcf76('0x8c')],'read':_0x244984[_0xcf76('0xbe')],'attachment':_0x244984[_0xcf76('0x6f')]};})['value']()};return ejs[_0xcf76('0xcc')](path['join'](config[_0xcf76('0x74')],_0xcf76('0xb5'),_0xcf76('0xcd'),'downloadInteraction.ejs'),{'interaction':_0x25cf6d})['then'](function(_0x7e08ff){var _0x3825a2=path[_0xcf76('0x73')](_0x193321,'transcript-'+_0x13c394['id']+'-'+_0x4b6c51+_0xcf76('0xce'));var _0x5876f3={'path':_0x3825a2,'channel':'Chat','interactionId':_0x13c394['id']};return pdf[_0xcf76('0xcf')](_0x7e08ff,_0x5876f3);})[_0xcf76('0x19')](function(){return new Promise(function(_0xda3d26,_0x161fe3){zipdir(_0x193321,{'saveTo':_0x1c925c},function(_0x5b1196,_0x2527fa){if(_0x5b1196)return _0x161fe3(_0x5b1196);return _0xda3d26(_0x2527fa);});})[_0xcf76('0x19')](function(){return new BPromise(function(_0x48bdb7,_0x3d5017){rimraf(_0x193321,function(_0x389774){if(_0x389774)_0x3d5017(_0x389774);return _0x48bdb7();});});})[_0xcf76('0x19')](function(){return _0x2089e8[_0xcf76('0xb3')](_0x1c925c,_0x397fd7,function(_0x33061d){if(_0x33061d){logger[_0xcf76('0x1d')](_0xcf76('0xd0'),_0x33061d);}else{fs[_0xcf76('0xd1')](_0x1c925c);}});});});}else{return _0x2089e8[_0xcf76('0x68')](0xc8);}})['catch'](handleError(_0x2089e8,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 0554189..cd6dc97 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 _0xb8c8=['Users','map','findAll','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','update','remove','getUsers','then','setDataValue'];(function(_0x2d89f8,_0x2959e7){var _0x3e6700=function(_0x37bcec){while(--_0x37bcec){_0x2d89f8['push'](_0x2d89f8['shift']());}};_0x3e6700(++_0x2959e7);}(_0xb8c8,0xbb));var _0x8b8c=function(_0x472e18,_0xd42b15){_0x472e18=_0x472e18-0x0;var _0x195882=_0xb8c8[_0x472e18];return _0x195882;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x8b8c('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x8b8c('0x0'))['db'][_0x8b8c('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8b8c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8b8c('0x3'),'afterDestroy':_0x8b8c('0x4')};function emitEvent(_0x3d5cf5){return function(_0x515260,_0x42e7c8,_0x1bac18){_0x515260[_0x8b8c('0x5')]({'attributes':['id'],'raw':!![]})[_0x8b8c('0x6')](function(_0x26f791){_0x515260[_0x8b8c('0x7')](_0x8b8c('0x8'),_0x26f791[_0x8b8c('0x9')](function(_0x17ac61){return{'id':_0x17ac61['id']};}));return ChatMessage[_0x8b8c('0xa')]({'where':{'ChatInteractionId':_0x515260['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8b8c('0x6')](function(_0x2a856e){_0x515260['setDataValue']('unreadMessages',_0x2a856e['length']);ChatInteractionEvents[_0x8b8c('0xb')](_0x3d5cf5+':'+_0x515260['id'],_0x515260);ChatInteractionEvents[_0x8b8c('0xb')](_0x3d5cf5,_0x515260);_0x1bac18(null);})['catch'](_0x1bac18(null));};}for(var e in events){if(events[_0x8b8c('0xc')](e)){var event=events[e];ChatInteraction[_0x8b8c('0xd')](e,emitEvent(event));}}module[_0x8b8c('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xe79b=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x16743a,_0x34d3ad){var _0x5bf565=function(_0x299268){while(--_0x299268){_0x16743a['push'](_0x16743a['shift']());}};_0x5bf565(++_0x34d3ad);}(_0xe79b,0x10a));var _0xbe79=function(_0x1a87b3,_0x45ba68){_0x1a87b3=_0x1a87b3-0x0;var _0x37e84d=_0xe79b[_0x1a87b3];return _0x37e84d;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xbe79('0x0'))['db'][_0xbe79('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0xbe79('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xbe79('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbe79('0x4'),'afterDestroy':_0xbe79('0x5')};function emitEvent(_0x115547){return function(_0x46e3c8,_0x22172b,_0x5c6d0c){_0x46e3c8[_0xbe79('0x6')]({'attributes':['id'],'raw':!![]})[_0xbe79('0x7')](function(_0x5777e7){_0x46e3c8[_0xbe79('0x8')](_0xbe79('0x9'),_0x5777e7[_0xbe79('0xa')](function(_0xa68265){return{'id':_0xa68265['id']};}));return ChatMessage[_0xbe79('0xb')]({'where':{'ChatInteractionId':_0x46e3c8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1835e9){_0x46e3c8[_0xbe79('0x8')](_0xbe79('0xc'),_0x1835e9[_0xbe79('0xd')]);ChatInteractionEvents[_0xbe79('0xe')](_0x115547+':'+_0x46e3c8['id'],_0x46e3c8);ChatInteractionEvents[_0xbe79('0xe')](_0x115547,_0x46e3c8);_0x5c6d0c(null);})[_0xbe79('0xf')](_0x5c6d0c(null));};}for(var e in events){if(events[_0xbe79('0x10')](e)){var event=events[e];ChatInteraction[_0xbe79('0x11')](e,emitEvent(event));}}module[_0xbe79('0x12')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index cf0640c..a63dbe6 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 _0xf914=['moment','bluebird','request-promise','path','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x37cab3,_0x3969ff){var _0x1c601f=function(_0x38b36a){while(--_0x38b36a){_0x37cab3['push'](_0x37cab3['shift']());}};_0x1c601f(++_0x3969ff);}(_0xf914,0x85));var _0x4f91=function(_0x4f7418,_0x1755cc){_0x4f7418=_0x4f7418-0x0;var _0x4afe7e=_0xf914[_0x4f7418];return _0x4afe7e;};'use strict';var _=require(_0x4f91('0x0'));var util=require(_0x4f91('0x1'));var logger=require(_0x4f91('0x2'))('api');var moment=require(_0x4f91('0x3'));var BPromise=require(_0x4f91('0x4'));var rp=require(_0x4f91('0x5'));var fs=require('fs');var path=require(_0x4f91('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4f91('0x7'));module[_0x4f91('0x8')]=function(_0x2b5be3,_0x3cf294){return _0x2b5be3['define'](_0x4f91('0x9'),attributes,{'tableName':_0x4f91('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5f5aea,_0x52069c,_0x1cd1c3){if(_0x5f5aea['changed'](_0x4f91('0xb'))){_0x5f5aea[_0x4f91('0xc')]=moment()[_0x4f91('0xd')](_0x4f91('0xe'));}_0x1cd1c3(null,_0x5f5aea);}},'charset':_0x4f91('0xf'),'collate':_0x4f91('0x10')});};
\ No newline at end of file
+var _0x06ef=['define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports'];(function(_0x528a6e,_0x15abad){var _0x2cf224=function(_0x2c4e14){while(--_0x2c4e14){_0x528a6e['push'](_0x528a6e['shift']());}};_0x2cf224(++_0x15abad);}(_0x06ef,0x1c9));var _0xf06e=function(_0x15d469,_0x533556){_0x15d469=_0x15d469-0x0;var _0x3dccfd=_0x06ef[_0x15d469];return _0x3dccfd;};'use strict';var _=require(_0xf06e('0x0'));var util=require(_0xf06e('0x1'));var logger=require(_0xf06e('0x2'))(_0xf06e('0x3'));var moment=require(_0xf06e('0x4'));var BPromise=require('bluebird');var rp=require(_0xf06e('0x5'));var fs=require('fs');var path=require(_0xf06e('0x6'));var rimraf=require(_0xf06e('0x7'));var config=require(_0xf06e('0x8'));var attributes=require(_0xf06e('0x9'));module[_0xf06e('0xa')]=function(_0x605c13,_0x275f9c){return _0x605c13[_0xf06e('0xb')](_0xf06e('0xc'),attributes,{'tableName':_0xf06e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x320266,_0x5873d4,_0x41ed9d){if(_0x320266[_0xf06e('0xe')](_0xf06e('0xf'))){_0x320266['closedAt']=moment()[_0xf06e('0x10')](_0xf06e('0x11'));}_0x41ed9d(null,_0x320266);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 0975248..c21ba16 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 _0x6ea4=['debug','AddTagsToChatInteraction','addTags','body','omit','ids','spread','AddTags','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','limit'];(function(_0x54e30f,_0x3d2450){var _0x8accde=function(_0x4eca4a){while(--_0x4eca4a){_0x54e30f['push'](_0x54e30f['shift']());}};_0x8accde(++_0x3d2450);}(_0x6ea4,0x1d6));var _0x46ea=function(_0x50ed5c,_0x38e2f2){_0x50ed5c=_0x50ed5c-0x0;var _0x42905c=_0x6ea4[_0x50ed5c];return _0x42905c;};'use strict';var _=require(_0x46ea('0x0'));var util=require('util');var moment=require(_0x46ea('0x1'));var BPromise=require(_0x46ea('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46ea('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x46ea('0x4'));var logger=require('../../config/logger')(_0x46ea('0x5'));var config=require(_0x46ea('0x6'));var jayson=require(_0x46ea('0x7'));var client=jayson['client'][_0x46ea('0x8')]({'port':0x232a});config[_0x46ea('0x9')]=_[_0x46ea('0xa')](config[_0x46ea('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x46ea('0xb'))(new Redis(config[_0x46ea('0x9')]));require(_0x46ea('0xc'))[_0x46ea('0xd')](socket);function respondWithRpcPromise(_0x6f2eb1,_0x5589fa,_0x3c1629){return new BPromise(function(_0x3d1df7,_0x590614){return client[_0x46ea('0xe')](_0x6f2eb1,_0x3c1629)[_0x46ea('0xf')](function(_0x59ded9){logger[_0x46ea('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x5589fa,_0x46ea('0x11'));logger['debug'](_0x46ea('0x12'),_0x5589fa,'request\x20sent',JSON[_0x46ea('0x13')](_0x59ded9));if(_0x59ded9[_0x46ea('0x14')]){if(_0x59ded9[_0x46ea('0x14')][_0x46ea('0x15')]===0x1f4){logger[_0x46ea('0x14')](_0x46ea('0x16'),_0x5589fa,_0x59ded9[_0x46ea('0x14')][_0x46ea('0x17')]);return _0x590614(_0x59ded9[_0x46ea('0x14')][_0x46ea('0x17')]);}logger[_0x46ea('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x5589fa,_0x59ded9[_0x46ea('0x14')][_0x46ea('0x17')]);return _0x3d1df7(_0x59ded9[_0x46ea('0x14')][_0x46ea('0x17')]);}else{logger[_0x46ea('0x10')](_0x46ea('0x16'),_0x5589fa,_0x46ea('0x11'));_0x3d1df7(_0x59ded9[_0x46ea('0x18')]['message']);}})[_0x46ea('0x19')](function(_0x566b74){logger[_0x46ea('0x14')](_0x46ea('0x16'),_0x5589fa,_0x566b74);_0x590614(_0x566b74);});});}exports[_0x46ea('0x1a')]=function(_0x18ded4){var _0x57a5f6=this;return new Promise(function(_0x4b160b,_0x25309a){return db[_0x46ea('0x1b')][_0x46ea('0x1c')](_0x18ded4['body'],{'raw':_0x18ded4[_0x46ea('0x1d')]?_0x18ded4['options'][_0x46ea('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18ded4[_0x46ea('0x1d')]?_0x18ded4[_0x46ea('0x1d')][_0x46ea('0x1f')]||null:null,'attributes':_0x18ded4['options']?_0x18ded4['options'][_0x46ea('0x20')]||null:null,'limit':_0x18ded4[_0x46ea('0x1d')]?_0x18ded4[_0x46ea('0x1d')][_0x46ea('0x21')]||null:null})['then'](function(_0x33ffb0){logger['info'](_0x46ea('0x1a'),_0x18ded4);logger[_0x46ea('0x22')](_0x46ea('0x1a'),_0x18ded4,JSON[_0x46ea('0x13')](_0x33ffb0));_0x4b160b(_0x33ffb0);})[_0x46ea('0x19')](function(_0xaaca10){logger['error'](_0x46ea('0x1a'),_0xaaca10['message'],_0x18ded4);_0x25309a(_0x57a5f6['error'](0x1f4,_0xaaca10[_0x46ea('0x17')]));});});};exports[_0x46ea('0x23')]=function(_0x571666){return new Promise(function(_0x3a2a15,_0x3bbb63){return db['ChatInteraction']['find']({'where':_0x571666[_0x46ea('0x1d')]?_0x571666[_0x46ea('0x1d')]['where']||null:null})[_0x46ea('0xf')](function(_0x59d00b){if(_0x59d00b){return _0x59d00b[_0x46ea('0x24')](_0x571666[_0x46ea('0x25')]['ids'],_[_0x46ea('0x26')](_0x571666[_0x46ea('0x25')],[_0x46ea('0x27'),'id'])||{});}})[_0x46ea('0x28')](function(_0x2b1e86){logger[_0x46ea('0x10')]('AddTags',_0x571666);logger[_0x46ea('0x22')](_0x46ea('0x29'),_0x571666,JSON[_0x46ea('0x13')](_0x2b1e86));_0x3a2a15(_0x2b1e86);})['catch'](function(_0x3d125a){logger['error'](_0x46ea('0x29'),_0x3d125a[_0x46ea('0x17')],_0x571666);_0x3bbb63(_this['error'](0x1f4,_0x3d125a['message']));});});};
\ No newline at end of file
+var _0xa831=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','lodash'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0xa831,0x18b));var _0x1a83=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xa831[_0x39e84d];return _0x1991bc;};'use strict';var _=require(_0x1a83('0x0'));var util=require('util');var moment=require(_0x1a83('0x1'));var BPromise=require(_0x1a83('0x2'));var rs=require(_0x1a83('0x3'));var fs=require('fs');var Redis=require(_0x1a83('0x4'));var db=require(_0x1a83('0x5'))['db'];var utils=require(_0x1a83('0x6'));var logger=require(_0x1a83('0x7'))('rpc');var config=require(_0x1a83('0x8'));var jayson=require(_0x1a83('0x9'));var client=jayson[_0x1a83('0xa')]['http']({'port':0x232a});config['redis']=_[_0x1a83('0xb')](config[_0x1a83('0xc')],{'host':_0x1a83('0xd'),'port':0x18eb});var socket=require(_0x1a83('0xe'))(new Redis(config[_0x1a83('0xc')]));require(_0x1a83('0xf'))[_0x1a83('0x10')](socket);function respondWithRpcPromise(_0x3b7d34,_0xebb3f4,_0x47ecf7){return new BPromise(function(_0x20e5a8,_0x5ebfd0){return client['request'](_0x3b7d34,_0x47ecf7)[_0x1a83('0x11')](function(_0x5a5233){logger[_0x1a83('0x12')](_0x1a83('0x13'),_0xebb3f4,'request\x20sent');logger[_0x1a83('0x14')](_0x1a83('0x15'),_0xebb3f4,_0x1a83('0x16'),JSON['stringify'](_0x5a5233));if(_0x5a5233[_0x1a83('0x17')]){if(_0x5a5233[_0x1a83('0x17')][_0x1a83('0x18')]===0x1f4){logger['error'](_0x1a83('0x13'),_0xebb3f4,_0x5a5233[_0x1a83('0x17')][_0x1a83('0x19')]);return _0x5ebfd0(_0x5a5233[_0x1a83('0x17')]['message']);}logger[_0x1a83('0x17')](_0x1a83('0x13'),_0xebb3f4,_0x5a5233[_0x1a83('0x17')][_0x1a83('0x19')]);return _0x20e5a8(_0x5a5233['error']['message']);}else{logger[_0x1a83('0x12')](_0x1a83('0x13'),_0xebb3f4,'request\x20sent');_0x20e5a8(_0x5a5233[_0x1a83('0x1a')]['message']);}})[_0x1a83('0x1b')](function(_0x290e1f){logger['error'](_0x1a83('0x13'),_0xebb3f4,_0x290e1f);_0x5ebfd0(_0x290e1f);});});}exports[_0x1a83('0x1c')]=function(_0x4e41ea){var _0x29f29c=this;return new Promise(function(_0x432433,_0x3e7ca8){return db[_0x1a83('0x1d')][_0x1a83('0x1e')](_0x4e41ea[_0x1a83('0x1f')],{'raw':_0x4e41ea['options']?_0x4e41ea[_0x1a83('0x20')][_0x1a83('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e41ea[_0x1a83('0x20')]?_0x4e41ea['options'][_0x1a83('0x22')]||null:null,'attributes':_0x4e41ea[_0x1a83('0x20')]?_0x4e41ea['options'][_0x1a83('0x23')]||null:null,'limit':_0x4e41ea[_0x1a83('0x20')]?_0x4e41ea['options'][_0x1a83('0x24')]||null:null})[_0x1a83('0x11')](function(_0x12cd43){logger['info'](_0x1a83('0x1c'),_0x4e41ea);logger['debug'](_0x1a83('0x1c'),_0x4e41ea,JSON[_0x1a83('0x25')](_0x12cd43));_0x432433(_0x12cd43);})[_0x1a83('0x1b')](function(_0x2f5d94){logger[_0x1a83('0x17')](_0x1a83('0x1c'),_0x2f5d94[_0x1a83('0x19')],_0x4e41ea);_0x3e7ca8(_0x29f29c[_0x1a83('0x17')](0x1f4,_0x2f5d94[_0x1a83('0x19')]));});});};exports[_0x1a83('0x26')]=function(_0x67058c){return new Promise(function(_0x48234b,_0x22b80c){return db['ChatInteraction'][_0x1a83('0x27')]({'where':_0x67058c['options']?_0x67058c[_0x1a83('0x20')][_0x1a83('0x22')]||null:null})[_0x1a83('0x11')](function(_0x461275){if(_0x461275){return _0x461275[_0x1a83('0x28')](_0x67058c[_0x1a83('0x1f')][_0x1a83('0x29')],_[_0x1a83('0x2a')](_0x67058c[_0x1a83('0x1f')],[_0x1a83('0x29'),'id'])||{});}})['spread'](function(_0x2cbbea){logger['info'](_0x1a83('0x2b'),_0x67058c);logger['debug'](_0x1a83('0x2b'),_0x67058c,JSON[_0x1a83('0x25')](_0x2cbbea));_0x48234b(_0x2cbbea);})[_0x1a83('0x1b')](function(_0x1c0d8d){logger['error'](_0x1a83('0x2b'),_0x1c0d8d[_0x1a83('0x19')],_0x67058c);_0x22b80c(_this[_0x1a83('0x17')](0x1f4,_0x1c0d8d[_0x1a83('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 8b0e42f..2597eb8 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 _0xf6ae=['./chatInteraction.events','save','remove','update','emit','removeListener','length','chatInteraction:'];(function(_0x2f2619,_0x27618f){var _0x4f958f=function(_0x3a432d){while(--_0x3a432d){_0x2f2619['push'](_0x2f2619['shift']());}};_0x4f958f(++_0x27618f);}(_0xf6ae,0x1d0));var _0xef6a=function(_0x435c0e,_0x394a4a){_0x435c0e=_0x435c0e-0x0;var _0x1742ef=_0xf6ae[_0x435c0e];return _0x1742ef;};'use strict';var ChatInteractionEvents=require(_0xef6a('0x0'));var events=[_0xef6a('0x1'),_0xef6a('0x2'),_0xef6a('0x3')];function createListener(_0x64cfb5,_0x4d18b9){return function(_0x92937a){_0x4d18b9[_0xef6a('0x4')](_0x64cfb5,_0x92937a);};}function removeListener(_0x3ba9a1,_0x40ecb6){return function(){ChatInteractionEvents[_0xef6a('0x5')](_0x3ba9a1,_0x40ecb6);};}exports['register']=function(_0x1f8c67){for(var _0xb53a73=0x0,_0x78a4f1=events[_0xef6a('0x6')];_0xb53a73<_0x78a4f1;_0xb53a73++){var _0x55c966=events[_0xb53a73];var _0x5641ba=createListener(_0xef6a('0x7')+_0x55c966,_0x1f8c67);ChatInteractionEvents['on'](_0x55c966,_0x5641ba);}};
\ No newline at end of file
+var _0x4634=['removeListener','register','length','save','remove','update','emit'];(function(_0x205a12,_0x5d1d07){var _0x2ae9cc=function(_0x3b2e01){while(--_0x3b2e01){_0x205a12['push'](_0x205a12['shift']());}};_0x2ae9cc(++_0x5d1d07);}(_0x4634,0xe3));var _0x4463=function(_0x584981,_0x879ae2){_0x584981=_0x584981-0x0;var _0x5c9992=_0x4634[_0x584981];return _0x5c9992;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x4463('0x0'),_0x4463('0x1'),_0x4463('0x2')];function createListener(_0xed2d17,_0x2458b1){return function(_0x3252a4){_0x2458b1[_0x4463('0x3')](_0xed2d17,_0x3252a4);};}function removeListener(_0x4ad792,_0x18ff63){return function(){ChatInteractionEvents[_0x4463('0x4')](_0x4ad792,_0x18ff63);};}exports[_0x4463('0x5')]=function(_0x4b7dc3){for(var _0x449d81=0x0,_0x18f97a=events[_0x4463('0x6')];_0x449d81<_0x18f97a;_0x449d81++){var _0x22a9ae=events[_0x449d81];var _0x235705=createListener('chatInteraction:'+_0x22a9ae,_0x4b7dc3);ChatInteractionEvents['on'](_0x22a9ae,_0x235705);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 0ce0ff7..831bb25 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 _0x7605=['createVidaooSession','root','server/files/attachments/','format','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','chat','chatinteraction:update','update','put','customUpdate','/:id/abandon','/:id/close','delete','chatinteraction:destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/download','create','post','/:id/vidaoo'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x7605,0x191));var _0x5760=function(_0x41ff01,_0x432b4e){_0x41ff01=_0x41ff01-0x0;var _0x165ebc=_0x7605[_0x41ff01];return _0x165ebc;};'use strict';var multer=require(_0x5760('0x0'));var util=require(_0x5760('0x1'));var path=require(_0x5760('0x2'));var timeout=require('connect-timeout');var express=require(_0x5760('0x3'));var router=express[_0x5760('0x4')]();var fs_extra=require(_0x5760('0x5'));var auth=require(_0x5760('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5760('0x7'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x5760('0x8')](),controller[_0x5760('0x9')]);router['get'](_0x5760('0xa'),auth['isAuthenticated'](),controller[_0x5760('0xb')]);router[_0x5760('0xc')](_0x5760('0xd'),auth[_0x5760('0xe')](),controller['show']);router[_0x5760('0xc')]('/:id/attachment_download',auth[_0x5760('0xe')](),controller[_0x5760('0xf')]);router[_0x5760('0xc')](_0x5760('0x10'),auth[_0x5760('0x8')](),controller[_0x5760('0x11')]);router[_0x5760('0xc')]('/:id/my_messages',auth[_0x5760('0xe')](),controller['getMyMessages']);router[_0x5760('0xc')](_0x5760('0x12'),auth[_0x5760('0x8')](),controller['download']);router['post']('/',auth[_0x5760('0x8')](),controller[_0x5760('0x13')]);router[_0x5760('0x14')](_0x5760('0x15'),auth[_0x5760('0x8')](),controller[_0x5760('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1ef837,_0x164215,_0xf67730){_0xf67730(null,path['join'](config[_0x5760('0x17')],_0x5760('0x18')));},'filename':function(_0x1aeb3f,_0x2c9b25,_0x571dad){_0x571dad(null,util[_0x5760('0x19')]('%s-%s',Date['now'](),_0x2c9b25[_0x5760('0x1a')][_0x5760('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x5760('0x1c'),upload[_0x5760('0x1d')](_0x5760('0x1e')),controller[_0x5760('0x1f')]);router[_0x5760('0x14')](_0x5760('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x5760('0x20')]);router[_0x5760('0x14')](_0x5760('0x21'),auth[_0x5760('0x8')](),interaction[_0x5760('0x22')]('chat',_0x5760('0x23')),controller['addTags']);router['put']('/:id',auth[_0x5760('0x8')](),interaction[_0x5760('0x22')](_0x5760('0x24'),_0x5760('0x25')),controller[_0x5760('0x26')]);router[_0x5760('0x27')]('/:id/custom_update',controller[_0x5760('0x28')]);router[_0x5760('0x27')](_0x5760('0x29'),auth[_0x5760('0xe')](),controller['abandon']);router[_0x5760('0x27')](_0x5760('0x2a'),controller['close']);router[_0x5760('0x2b')](_0x5760('0xd'),auth[_0x5760('0x8')](),interaction[_0x5760('0x22')](_0x5760('0x24'),_0x5760('0x2c')),controller['destroy']);router['delete'](_0x5760('0x21'),auth[_0x5760('0x8')](),controller[_0x5760('0x2d')]);module[_0x5760('0x2e')]=router;
\ No newline at end of file
+var _0xfcc9=['delete','destroy','removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','originalname','single','file','attachmentUpload','addMessage','/:id/tags','addTags','put','tracked','chat','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close'];(function(_0x3246a6,_0x2a685a){var _0x1df64d=function(_0x4868ad){while(--_0x4868ad){_0x3246a6['push'](_0x3246a6['shift']());}};_0x1df64d(++_0x2a685a);}(_0xfcc9,0x161));var _0x9fcc=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0xfcc9[_0x2d126e];return _0xcb04d3;};'use strict';var multer=require(_0x9fcc('0x0'));var util=require(_0x9fcc('0x1'));var path=require(_0x9fcc('0x2'));var timeout=require(_0x9fcc('0x3'));var express=require('express');var router=express[_0x9fcc('0x4')]();var fs_extra=require(_0x9fcc('0x5'));var auth=require(_0x9fcc('0x6'));var interaction=require(_0x9fcc('0x7'));var config=require('../../config/environment');var controller=require(_0x9fcc('0x8'));router[_0x9fcc('0x9')]('/',auth[_0x9fcc('0xa')](),controller[_0x9fcc('0xb')]);router[_0x9fcc('0x9')](_0x9fcc('0xc'),auth[_0x9fcc('0xa')](),controller['describe']);router[_0x9fcc('0x9')](_0x9fcc('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x9fcc('0xe')]);router[_0x9fcc('0x9')](_0x9fcc('0xf'),auth[_0x9fcc('0x10')](),controller['attachmentDownload']);router[_0x9fcc('0x9')](_0x9fcc('0x11'),auth[_0x9fcc('0xa')](),controller[_0x9fcc('0x12')]);router[_0x9fcc('0x9')](_0x9fcc('0x13'),auth[_0x9fcc('0x10')](),controller[_0x9fcc('0x14')]);router[_0x9fcc('0x9')](_0x9fcc('0x15'),auth[_0x9fcc('0xa')](),controller[_0x9fcc('0x16')]);router['post']('/',auth[_0x9fcc('0xa')](),controller[_0x9fcc('0x17')]);router[_0x9fcc('0x18')](_0x9fcc('0x19'),auth['isAuthenticated'](),controller[_0x9fcc('0x1a')]);var upload=multer({'storage':multer[_0x9fcc('0x1b')]({'destination':function(_0x845f5a,_0x1f7191,_0x901c64){_0x901c64(null,path[_0x9fcc('0x1c')](config[_0x9fcc('0x1d')],_0x9fcc('0x1e')));},'filename':function(_0x9b9ddf,_0x41ffa1,_0x45bba5){_0x45bba5(null,util['format']('%s-%s',Date['now'](),_0x41ffa1[_0x9fcc('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x9fcc('0x20')](_0x9fcc('0x21')),controller[_0x9fcc('0x22')]);router['post'](_0x9fcc('0x11'),auth[_0x9fcc('0x10')](),controller[_0x9fcc('0x23')]);router[_0x9fcc('0x18')](_0x9fcc('0x24'),auth[_0x9fcc('0xa')](),interaction['tracked']('chat','chatinteraction:addtags'),controller[_0x9fcc('0x25')]);router[_0x9fcc('0x26')](_0x9fcc('0xd'),auth[_0x9fcc('0xa')](),interaction[_0x9fcc('0x27')](_0x9fcc('0x28'),'chatinteraction:update'),controller[_0x9fcc('0x29')]);router['put'](_0x9fcc('0x2a'),controller[_0x9fcc('0x2b')]);router['put'](_0x9fcc('0x2c'),auth['isChatInteractionAuthorized'](),controller[_0x9fcc('0x2d')]);router['put']('/:id/close',controller[_0x9fcc('0x2e')]);router[_0x9fcc('0x2f')]('/:id',auth[_0x9fcc('0xa')](),interaction[_0x9fcc('0x27')]('chat','chatinteraction:destroy'),controller[_0x9fcc('0x30')]);router[_0x9fcc('0x2f')](_0x9fcc('0x24'),auth[_0x9fcc('0xa')](),controller[_0x9fcc('0x31')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 5fb1c5a..250bc62 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 _0xdb69=['medium','BOOLEAN','INTEGER','exports','TEXT'];(function(_0x5d0fe6,_0x40ae52){var _0x2ce912=function(_0x260da2){while(--_0x260da2){_0x5d0fe6['push'](_0x5d0fe6['shift']());}};_0x2ce912(++_0x40ae52);}(_0xdb69,0x170));var _0x9db6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xdb69[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0x9db6('0x0')]={'body':{'type':Sequelize[_0x9db6('0x1')](_0x9db6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9db6('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9db6('0x4')]}};
\ No newline at end of file
+var _0xeb15=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x4369ef,_0x33cde3){var _0xf9dac4=function(_0x3f9af1){while(--_0x3f9af1){_0x4369ef['push'](_0x4369ef['shift']());}};_0xf9dac4(++_0x33cde3);}(_0xeb15,0x10d));var _0x5eb1=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0xeb15[_0x31b5a5];return _0x364cc9;};'use strict';var Sequelize=require(_0x5eb1('0x0'));module['exports']={'body':{'type':Sequelize[_0x5eb1('0x1')](_0x5eb1('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5eb1('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5eb1('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 01d6b6c..d972fbb 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 _0xe687=['eml-format','rimraf','zip-dir','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','get','messages','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','admin','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','filter','resourceId','push','FromId','ToId','read','-createdAt','all'];(function(_0x15c667,_0x306a08){var _0x540e10=function(_0x48e90e){while(--_0x48e90e){_0x15c667['push'](_0x15c667['shift']());}};_0x540e10(++_0x306a08);}(_0xe687,0xdc));var _0x7e68=function(_0x4637cd,_0x26a717){_0x4637cd=_0x4637cd-0x0;var _0x4fa2e6=_0xe687[_0x4637cd];return _0x4fa2e6;};'use strict';var emlformat=require(_0x7e68('0x0'));var rimraf=require(_0x7e68('0x1'));var zipdir=require(_0x7e68('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7e68('0x3'));var util=require(_0x7e68('0x4'));var path=require(_0x7e68('0x5'));var sox=require(_0x7e68('0x6'));var csv=require(_0x7e68('0x7'));var ejs=require(_0x7e68('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e68('0x9'));var squel=require('squel');var crypto=require(_0x7e68('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7e68('0xb'));var toCsv=require(_0x7e68('0x7'));var querystring=require(_0x7e68('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7e68('0xd'));var qs=require(_0x7e68('0xe'));var as=require(_0x7e68('0xf'));var hardwareService=require(_0x7e68('0x10'));var logger=require(_0x7e68('0x11'))(_0x7e68('0x12'));var utils=require(_0x7e68('0x13'));var config=require(_0x7e68('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7e68('0x15'))['db'];config[_0x7e68('0x16')]=_['defaults'](config[_0x7e68('0x16')],{'host':_0x7e68('0x17'),'port':0x18eb});var socket=require(_0x7e68('0x18'))(new Redis(config[_0x7e68('0x16')]));require(_0x7e68('0x19'))[_0x7e68('0x1a')](socket);function respondWithStatusCode(_0x2952da,_0x1cb50c){_0x1cb50c=_0x1cb50c||0xcc;return function(_0x515c00){if(_0x515c00){return _0x2952da['sendStatus'](_0x1cb50c);}return _0x2952da[_0x7e68('0x1b')](_0x1cb50c)[_0x7e68('0x1c')]();};}function respondWithResult(_0x1d7020,_0x2c581b){_0x2c581b=_0x2c581b||0xc8;return function(_0x4ef9a2){if(_0x4ef9a2){return _0x1d7020[_0x7e68('0x1b')](_0x2c581b)[_0x7e68('0x1d')](_0x4ef9a2);}};}function respondWithFilteredResult(_0x187fa4,_0xbdb84a){return function(_0x14f49e){if(_0x14f49e){var _0xca7e1c=typeof _0xbdb84a[_0x7e68('0x1e')]==='undefined'&&typeof _0xbdb84a['limit']===_0x7e68('0x1f');var _0x412621=_0x14f49e['count'];var _0x455321=_0xca7e1c?0x0:_0xbdb84a['offset'];var _0x1469c5=_0xca7e1c?_0x14f49e[_0x7e68('0x20')]:_0xbdb84a[_0x7e68('0x1e')]+_0xbdb84a['limit'];var _0x491a64;if(_0x1469c5>=_0x412621){_0x1469c5=_0x412621;_0x491a64=0xc8;}else{_0x491a64=0xce;}_0x187fa4[_0x7e68('0x1b')](_0x491a64);return _0x187fa4['set'](_0x7e68('0x21'),_0x455321+'-'+_0x1469c5+'/'+_0x412621)[_0x7e68('0x1d')](_0x14f49e);}return null;};}function patchUpdates(_0x34f46b){return function(_0x75abe1){try{jsonpatch[_0x7e68('0x22')](_0x75abe1,_0x34f46b,!![]);}catch(_0x4ccdc6){return BPromise[_0x7e68('0x23')](_0x4ccdc6);}return _0x75abe1[_0x7e68('0x24')]();};}function saveUpdates(_0x208d3e,_0x574907){return function(_0x5534b5){if(_0x5534b5){return _0x5534b5[_0x7e68('0x25')](_0x208d3e)[_0x7e68('0x26')](function(_0x55d013){return _0x55d013;});}return null;};}function removeEntity(_0x2c4217,_0x7b5b28){return function(_0x399e3a){if(_0x399e3a){return _0x399e3a[_0x7e68('0x27')]()[_0x7e68('0x26')](function(){_0x2c4217[_0x7e68('0x1b')](0xcc)[_0x7e68('0x1c')]();});}};}function handleEntityNotFound(_0x1c79f5,_0x14526a){return function(_0x20d5d0){if(!_0x20d5d0){_0x1c79f5[_0x7e68('0x28')](0x194);}return _0x20d5d0;};}function handleError(_0x347a88,_0x4bcca6){_0x4bcca6=_0x4bcca6||0x1f4;return function(_0x88f291){logger[_0x7e68('0x29')](_0x88f291['stack']);if(_0x88f291[_0x7e68('0x2a')]){delete _0x88f291[_0x7e68('0x2a')];}_0x347a88['status'](_0x4bcca6)[_0x7e68('0x2b')](_0x88f291);};}exports[_0x7e68('0x2c')]=function(_0x5dd517,_0x2c07a1){var _0x1ca674={},_0x556dc1={},_0x1a4d5a={'count':0x0,'rows':[]};var _0x45effd=_[_0x7e68('0x2d')](db[_0x7e68('0x2e')][_0x7e68('0x2f')],function(_0x5abe81){return{'name':_0x5abe81[_0x7e68('0x30')],'type':_0x5abe81[_0x7e68('0x31')][_0x7e68('0x32')]};});_0x556dc1[_0x7e68('0x33')]=_['map'](_0x45effd,_0x7e68('0x2a'));_0x556dc1[_0x7e68('0x34')]=_[_0x7e68('0x35')](_0x5dd517[_0x7e68('0x34')]);_0x556dc1[_0x7e68('0x36')]=_[_0x7e68('0x37')](_0x556dc1[_0x7e68('0x33')],_0x556dc1[_0x7e68('0x34')]);_0x1ca674[_0x7e68('0x38')]=_[_0x7e68('0x37')](_0x556dc1[_0x7e68('0x33')],qs[_0x7e68('0x39')](_0x5dd517[_0x7e68('0x34')]['fields']));_0x1ca674['attributes']=_0x1ca674[_0x7e68('0x38')]['length']?_0x1ca674['attributes']:_0x556dc1[_0x7e68('0x33')];if(!_0x5dd517[_0x7e68('0x34')][_0x7e68('0x3a')](_0x7e68('0x3b'))){_0x1ca674['limit']=qs[_0x7e68('0x3c')](_0x5dd517[_0x7e68('0x34')][_0x7e68('0x3c')]);_0x1ca674[_0x7e68('0x1e')]=qs['offset'](_0x5dd517['query'][_0x7e68('0x1e')]);}_0x1ca674[_0x7e68('0x3d')]=qs[_0x7e68('0x3e')](_0x5dd517[_0x7e68('0x34')][_0x7e68('0x3e')]);_0x1ca674[_0x7e68('0x3f')]=qs['filters'](_['pick'](_0x5dd517[_0x7e68('0x34')],_0x556dc1[_0x7e68('0x36')]),_0x45effd);if(_0x5dd517[_0x7e68('0x34')]['filter']){_0x1ca674[_0x7e68('0x3f')]=_[_0x7e68('0x40')](_0x1ca674[_0x7e68('0x3f')],{'$or':_[_0x7e68('0x2d')](_0x45effd,function(_0x4490d4){if(_0x4490d4[_0x7e68('0x31')]!=='VIRTUAL'){var _0x490564={};_0x490564[_0x4490d4[_0x7e68('0x2a')]]={'$like':'%'+_0x5dd517[_0x7e68('0x34')]['filter']+'%'};return _0x490564;}})});}_0x1ca674=_[_0x7e68('0x40')]({},_0x1ca674,_0x5dd517[_0x7e68('0x41')]);var _0x36e310={'where':_0x1ca674[_0x7e68('0x3f')]};return db[_0x7e68('0x2e')][_0x7e68('0x20')](_0x36e310)[_0x7e68('0x26')](function(_0x48537f){_0x1a4d5a[_0x7e68('0x20')]=_0x48537f;if(_0x5dd517['query'][_0x7e68('0x42')]){_0x1ca674[_0x7e68('0x43')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x7e68('0x44')](_0x1ca674);})['then'](function(_0x40e201){_0x1a4d5a[_0x7e68('0x45')]=_0x40e201;return _0x1a4d5a;})[_0x7e68('0x26')](respondWithFilteredResult(_0x2c07a1,_0x1ca674))[_0x7e68('0x46')](handleError(_0x2c07a1,null));};exports[_0x7e68('0x47')]=function(_0x5f1f69,_0x3df0ad){var _0x12af1f={'raw':!![],'where':{'id':_0x5f1f69[_0x7e68('0x48')]['id']}},_0x47b5f2={};_0x47b5f2['model']=_[_0x7e68('0x35')](db[_0x7e68('0x2e')][_0x7e68('0x2f')]);_0x47b5f2[_0x7e68('0x34')]=_[_0x7e68('0x35')](_0x5f1f69['query']);_0x47b5f2[_0x7e68('0x36')]=_[_0x7e68('0x37')](_0x47b5f2[_0x7e68('0x33')],_0x47b5f2[_0x7e68('0x34')]);_0x12af1f[_0x7e68('0x38')]=_[_0x7e68('0x37')](_0x47b5f2[_0x7e68('0x33')],qs[_0x7e68('0x39')](_0x5f1f69[_0x7e68('0x34')][_0x7e68('0x39')]));_0x12af1f[_0x7e68('0x38')]=_0x12af1f[_0x7e68('0x38')][_0x7e68('0x49')]?_0x12af1f['attributes']:_0x47b5f2[_0x7e68('0x33')];if(_0x5f1f69[_0x7e68('0x34')][_0x7e68('0x42')]){_0x12af1f['include']=[{'all':!![]}];}_0x12af1f=_[_0x7e68('0x40')]({},_0x12af1f,_0x5f1f69[_0x7e68('0x41')]);return db[_0x7e68('0x2e')][_0x7e68('0x4a')](_0x12af1f)[_0x7e68('0x26')](handleEntityNotFound(_0x3df0ad,null))[_0x7e68('0x26')](respondWithResult(_0x3df0ad,null))['catch'](handleError(_0x3df0ad,null));};exports[_0x7e68('0x4b')]=function(_0x406867,_0x5991e9){return db[_0x7e68('0x2e')][_0x7e68('0x4b')](_0x406867[_0x7e68('0x4c')],{})[_0x7e68('0x26')](respondWithResult(_0x5991e9,0xc9))['catch'](handleError(_0x5991e9,null));};exports[_0x7e68('0x25')]=function(_0x54e69f,_0x41b3a1){if(_0x54e69f[_0x7e68('0x4c')]['id']){delete _0x54e69f[_0x7e68('0x4c')]['id'];}return db[_0x7e68('0x2e')][_0x7e68('0x4a')]({'where':{'id':_0x54e69f['params']['id']}})[_0x7e68('0x26')](handleEntityNotFound(_0x41b3a1,null))[_0x7e68('0x26')](saveUpdates(_0x54e69f[_0x7e68('0x4c')],null))[_0x7e68('0x26')](respondWithResult(_0x41b3a1,null))['catch'](handleError(_0x41b3a1,null));};exports[_0x7e68('0x27')]=function(_0x45df03,_0x502c20){return db[_0x7e68('0x2e')]['find']({'where':{'id':_0x45df03[_0x7e68('0x48')]['id']}})[_0x7e68('0x26')](handleEntityNotFound(_0x502c20,null))[_0x7e68('0x26')](removeEntity(_0x502c20,null))[_0x7e68('0x46')](handleError(_0x502c20,null));};exports[_0x7e68('0x4d')]=function(_0x21575d,_0x2ce3d1){return db[_0x7e68('0x2e')]['describe']()['then'](respondWithResult(_0x2ce3d1,null))[_0x7e68('0x46')](handleError(_0x2ce3d1,null));};function wrapUser(_0x4cd11f){return function(_0x5cb073){var _0x5a14db=_0x4cd11f[_0x7e68('0x4e')]({'plain':!![]});_0x5a14db[_0x7e68('0x4f')]=[];if(_0x5cb073){_0x5a14db['lastMessageAt']=_0x5cb073[_0x7e68('0x50')];_0x5a14db['lastMessage']=_0x5cb073;}else{_0x5a14db['lastMessageAt']=moment(0x0)[_0x7e68('0x51')](_0x7e68('0x52'));_0x5a14db[_0x7e68('0x53')]={};}return _0x5a14db;};}exports[_0x7e68('0x54')]=function(_0x52994f,_0x46f8b9,_0x34d6fa){var _0x1eddb0=[];return db['User'][_0x7e68('0x44')]({'where':{'role':[_0x7e68('0x55'),_0x7e68('0x56'),_0x7e68('0x57')]},'attributes':['id',_0x7e68('0x58'),_0x7e68('0x2a'),_0x7e68('0x59'),_0x7e68('0x5a'),_0x7e68('0x5b'),_0x7e68('0x5c'),'lastLoginAt',_0x7e68('0x5d'),_0x7e68('0x5e')],'order':qs[_0x7e68('0x3e')](_0x7e68('0x5f')),'include':[{'model':db[_0x7e68('0x60')],'as':_0x7e68('0x61'),'attributes':['id',_0x7e68('0x2a'),'type'],'through':{'attributes':[]}}]})[_0x7e68('0x26')](function(_0x5fab1f){if(_0x5fab1f){var _0x4e99aa=_0x52994f[_0x7e68('0x57')]['get']({'plain':!![]});if(!_0x4e99aa)throw new Error(_0x7e68('0x62'));if(_0x4e99aa[_0x7e68('0x59')]==='user'){return db['UserProfileSection'][_0x7e68('0x4a')]({'where':{'name':_0x7e68('0x63'),'userProfileId':_0x4e99aa[_0x7e68('0x64')]},'raw':!![]})[_0x7e68('0x26')](function(_0x31d34e){if(_0x31d34e){if(_0x31d34e[_0x7e68('0x65')]===0x0){return db['UserProfileResource'][_0x7e68('0x44')]({'where':{'sectionId':_0x31d34e['id']},'raw':!![]})[_0x7e68('0x26')](function(_0x2be70f){var _0x1b07da=[];if(_['isEmpty'](_0x2be70f)){_0x1b07da=_[_0x7e68('0x66')](_0x5fab1f,function(_0x417107){if(_0x417107[_0x7e68('0x59')]!==_0x7e68('0x55')){return _0x417107;}});return _0x1b07da;}else{for(var _0x4b2892=0x0;_0x4b2892<_0x5fab1f[_0x7e68('0x49')];_0x4b2892++){var _0x415d6a=_0x5fab1f[_0x4b2892];if(_0x415d6a[_0x7e68('0x59')]===_0x7e68('0x55')){var _0x3fb430=_[_0x7e68('0x4a')](_0x2be70f,function(_0x23ce15){return _0x23ce15[_0x7e68('0x67')]===_0x415d6a['id'];});if(_0x3fb430)_0x1b07da[_0x7e68('0x68')](_0x415d6a);}else{_0x1b07da[_0x7e68('0x68')](_0x415d6a);}}return _0x1b07da;}});}else{return _0x5fab1f;}}else{var _0x1fadb2=_[_0x7e68('0x66')](_0x5fab1f,function(_0x3b320e){if(_0x3b320e['role']!==_0x7e68('0x55')){return _0x3b320e;}});return _0x1fadb2;}});}else{return _0x5fab1f;}}})[_0x7e68('0x26')](function(_0x239e6b){var _0x2256ac=[];if(_0x239e6b){_0x1eddb0=_0x239e6b;for(var _0x2cfb2e=0x0;_0x2cfb2e<_0x239e6b[_0x7e68('0x49')];_0x2cfb2e+=0x1){_0x1eddb0[_0x2cfb2e]['messages']=[];_0x2256ac[_0x7e68('0x68')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x52994f[_0x7e68('0x57')]['id'],_0x239e6b[_0x2cfb2e]['id']],'ToId':[_0x52994f[_0x7e68('0x57')]['id'],_0x239e6b[_0x2cfb2e]['id']],'ChatGroupId':null},'attributes':['id',_0x7e68('0x50'),_0x7e68('0x69'),_0x7e68('0x6a'),_0x7e68('0x6b'),_0x7e68('0x4c')],'order':qs[_0x7e68('0x3e')](_0x7e68('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7e68('0x26')](wrapUser(_0x239e6b[_0x2cfb2e])));}return BPromise[_0x7e68('0x6d')](_0x2256ac);}return[];})[_0x7e68('0x26')](function(_0x2daccb){return{'rows':_0x2daccb,'count':_0x2daccb[_0x7e68('0x49')]};})[_0x7e68('0x26')](respondWithResult(_0x46f8b9,null))['catch'](handleError(_0x46f8b9,null));};
\ No newline at end of file
+var _0xe363=['userProfileId','UserProfileResource','isEmpty','agent','resourceId','push','ToId','read','-createdAt','eml-format','rimraf','zip-dir','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','catch','options','create','body','params','describe','messages','createdAt','lastMessage','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','User','findAll','admin','user','fullname','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Agents'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe363,0x1bd));var _0x3e36=function(_0x25d87d,_0xad468c){_0x25d87d=_0x25d87d-0x0;var _0x54e42b=_0xe363[_0x25d87d];return _0x54e42b;};'use strict';var emlformat=require(_0x3e36('0x0'));var rimraf=require(_0x3e36('0x1'));var zipdir=require(_0x3e36('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3e36('0x3'));var util=require('util');var path=require(_0x3e36('0x4'));var sox=require('sox');var csv=require(_0x3e36('0x5'));var ejs=require(_0x3e36('0x6'));var fs=require('fs');var fs_extra=require(_0x3e36('0x7'));var _=require(_0x3e36('0x8'));var squel=require(_0x3e36('0x9'));var crypto=require(_0x3e36('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3e36('0xb'));var Papa=require(_0x3e36('0xc'));var Redis=require(_0x3e36('0xd'));var authService=require(_0x3e36('0xe'));var qs=require(_0x3e36('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e36('0x10'));var logger=require(_0x3e36('0x11'))(_0x3e36('0x12'));var utils=require(_0x3e36('0x13'));var config=require(_0x3e36('0x14'));var licenseUtil=require(_0x3e36('0x15'));var db=require(_0x3e36('0x16'))['db'];config[_0x3e36('0x17')]=_[_0x3e36('0x18')](config[_0x3e36('0x17')],{'host':_0x3e36('0x19'),'port':0x18eb});var socket=require(_0x3e36('0x1a'))(new Redis(config[_0x3e36('0x17')]));require('./chatInternalMessage.socket')[_0x3e36('0x1b')](socket);function respondWithStatusCode(_0x5c4afe,_0x5f8ae2){_0x5f8ae2=_0x5f8ae2||0xcc;return function(_0x2f5a4e){if(_0x2f5a4e){return _0x5c4afe['sendStatus'](_0x5f8ae2);}return _0x5c4afe[_0x3e36('0x1c')](_0x5f8ae2)[_0x3e36('0x1d')]();};}function respondWithResult(_0x41654f,_0xc6970){_0xc6970=_0xc6970||0xc8;return function(_0xcda193){if(_0xcda193){return _0x41654f['status'](_0xc6970)['json'](_0xcda193);}};}function respondWithFilteredResult(_0x16b9ee,_0x3a059f){return function(_0x49c422){if(_0x49c422){var _0x5bef23=typeof _0x3a059f[_0x3e36('0x1e')]===_0x3e36('0x1f')&&typeof _0x3a059f['limit']===_0x3e36('0x1f');var _0xedf502=_0x49c422[_0x3e36('0x20')];var _0x12f0d7=_0x5bef23?0x0:_0x3a059f[_0x3e36('0x1e')];var _0x11895c=_0x5bef23?_0x49c422['count']:_0x3a059f['offset']+_0x3a059f[_0x3e36('0x21')];var _0xa23342;if(_0x11895c>=_0xedf502){_0x11895c=_0xedf502;_0xa23342=0xc8;}else{_0xa23342=0xce;}_0x16b9ee[_0x3e36('0x1c')](_0xa23342);return _0x16b9ee['set'](_0x3e36('0x22'),_0x12f0d7+'-'+_0x11895c+'/'+_0xedf502)[_0x3e36('0x23')](_0x49c422);}return null;};}function patchUpdates(_0x43386e){return function(_0x180831){try{jsonpatch[_0x3e36('0x24')](_0x180831,_0x43386e,!![]);}catch(_0x296c33){return BPromise[_0x3e36('0x25')](_0x296c33);}return _0x180831[_0x3e36('0x26')]();};}function saveUpdates(_0x2b5e90,_0xe2cbf8){return function(_0x4ff7d6){if(_0x4ff7d6){return _0x4ff7d6[_0x3e36('0x27')](_0x2b5e90)[_0x3e36('0x28')](function(_0x3df290){return _0x3df290;});}return null;};}function removeEntity(_0x2474a7,_0x3a3b79){return function(_0x5a8b62){if(_0x5a8b62){return _0x5a8b62[_0x3e36('0x29')]()[_0x3e36('0x28')](function(){_0x2474a7[_0x3e36('0x1c')](0xcc)[_0x3e36('0x1d')]();});}};}function handleEntityNotFound(_0x250f6e,_0x500a85){return function(_0xe37eaf){if(!_0xe37eaf){_0x250f6e[_0x3e36('0x2a')](0x194);}return _0xe37eaf;};}function handleError(_0x12a802,_0x146852){_0x146852=_0x146852||0x1f4;return function(_0x4aa750){logger[_0x3e36('0x2b')](_0x4aa750[_0x3e36('0x2c')]);if(_0x4aa750[_0x3e36('0x2d')]){delete _0x4aa750[_0x3e36('0x2d')];}_0x12a802[_0x3e36('0x1c')](_0x146852)[_0x3e36('0x2e')](_0x4aa750);};}exports[_0x3e36('0x2f')]=function(_0x3733a9,_0x384a22){var _0x54826d={},_0x23c644={},_0x1ed197={'count':0x0,'rows':[]};var _0x1d18d5=_[_0x3e36('0x30')](db[_0x3e36('0x31')][_0x3e36('0x32')],function(_0x49963b){return{'name':_0x49963b[_0x3e36('0x33')],'type':_0x49963b[_0x3e36('0x34')]['key']};});_0x23c644[_0x3e36('0x35')]=_[_0x3e36('0x30')](_0x1d18d5,_0x3e36('0x2d'));_0x23c644[_0x3e36('0x36')]=_[_0x3e36('0x37')](_0x3733a9[_0x3e36('0x36')]);_0x23c644[_0x3e36('0x38')]=_['intersection'](_0x23c644[_0x3e36('0x35')],_0x23c644[_0x3e36('0x36')]);_0x54826d[_0x3e36('0x39')]=_[_0x3e36('0x3a')](_0x23c644[_0x3e36('0x35')],qs[_0x3e36('0x3b')](_0x3733a9[_0x3e36('0x36')][_0x3e36('0x3b')]));_0x54826d[_0x3e36('0x39')]=_0x54826d['attributes'][_0x3e36('0x3c')]?_0x54826d[_0x3e36('0x39')]:_0x23c644['model'];if(!_0x3733a9[_0x3e36('0x36')][_0x3e36('0x3d')](_0x3e36('0x3e'))){_0x54826d[_0x3e36('0x21')]=qs[_0x3e36('0x21')](_0x3733a9[_0x3e36('0x36')]['limit']);_0x54826d[_0x3e36('0x1e')]=qs[_0x3e36('0x1e')](_0x3733a9['query'][_0x3e36('0x1e')]);}_0x54826d[_0x3e36('0x3f')]=qs[_0x3e36('0x40')](_0x3733a9[_0x3e36('0x36')]['sort']);_0x54826d[_0x3e36('0x41')]=qs[_0x3e36('0x38')](_['pick'](_0x3733a9[_0x3e36('0x36')],_0x23c644[_0x3e36('0x38')]),_0x1d18d5);if(_0x3733a9[_0x3e36('0x36')][_0x3e36('0x42')]){_0x54826d[_0x3e36('0x41')]=_[_0x3e36('0x43')](_0x54826d['where'],{'$or':_['map'](_0x1d18d5,function(_0x4ae395){if(_0x4ae395[_0x3e36('0x34')]!==_0x3e36('0x44')){var _0x1432b5={};_0x1432b5[_0x4ae395[_0x3e36('0x2d')]]={'$like':'%'+_0x3733a9[_0x3e36('0x36')][_0x3e36('0x42')]+'%'};return _0x1432b5;}})});}_0x54826d=_['merge']({},_0x54826d,_0x3733a9['options']);var _0x227af1={'where':_0x54826d[_0x3e36('0x41')]};return db['ChatInternalMessage']['count'](_0x227af1)[_0x3e36('0x28')](function(_0x2119f4){_0x1ed197[_0x3e36('0x20')]=_0x2119f4;if(_0x3733a9[_0x3e36('0x36')]['includeAll']){_0x54826d[_0x3e36('0x45')]=[{'all':!![]}];}return db[_0x3e36('0x31')]['findAll'](_0x54826d);})[_0x3e36('0x28')](function(_0x91e414){_0x1ed197['rows']=_0x91e414;return _0x1ed197;})[_0x3e36('0x28')](respondWithFilteredResult(_0x384a22,_0x54826d))[_0x3e36('0x46')](handleError(_0x384a22,null));};exports['show']=function(_0x428231,_0x258310){var _0x2147ba={'raw':!![],'where':{'id':_0x428231['params']['id']}},_0x2152ca={};_0x2152ca[_0x3e36('0x35')]=_[_0x3e36('0x37')](db[_0x3e36('0x31')]['rawAttributes']);_0x2152ca['query']=_[_0x3e36('0x37')](_0x428231[_0x3e36('0x36')]);_0x2152ca[_0x3e36('0x38')]=_[_0x3e36('0x3a')](_0x2152ca['model'],_0x2152ca[_0x3e36('0x36')]);_0x2147ba[_0x3e36('0x39')]=_[_0x3e36('0x3a')](_0x2152ca['model'],qs['fields'](_0x428231[_0x3e36('0x36')]['fields']));_0x2147ba[_0x3e36('0x39')]=_0x2147ba['attributes']['length']?_0x2147ba[_0x3e36('0x39')]:_0x2152ca[_0x3e36('0x35')];if(_0x428231[_0x3e36('0x36')]['includeAll']){_0x2147ba['include']=[{'all':!![]}];}_0x2147ba=_[_0x3e36('0x43')]({},_0x2147ba,_0x428231[_0x3e36('0x47')]);return db[_0x3e36('0x31')]['find'](_0x2147ba)['then'](handleEntityNotFound(_0x258310,null))['then'](respondWithResult(_0x258310,null))[_0x3e36('0x46')](handleError(_0x258310,null));};exports['create']=function(_0x421076,_0x51f5f3){return db['ChatInternalMessage'][_0x3e36('0x48')](_0x421076[_0x3e36('0x49')],{})[_0x3e36('0x28')](respondWithResult(_0x51f5f3,0xc9))[_0x3e36('0x46')](handleError(_0x51f5f3,null));};exports[_0x3e36('0x27')]=function(_0x2f8846,_0x2352de){if(_0x2f8846[_0x3e36('0x49')]['id']){delete _0x2f8846[_0x3e36('0x49')]['id'];}return db[_0x3e36('0x31')]['find']({'where':{'id':_0x2f8846[_0x3e36('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2352de,null))[_0x3e36('0x28')](saveUpdates(_0x2f8846[_0x3e36('0x49')],null))[_0x3e36('0x28')](respondWithResult(_0x2352de,null))[_0x3e36('0x46')](handleError(_0x2352de,null));};exports[_0x3e36('0x29')]=function(_0x5667b9,_0x3b3e13){return db[_0x3e36('0x31')]['find']({'where':{'id':_0x5667b9[_0x3e36('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b3e13,null))[_0x3e36('0x28')](removeEntity(_0x3b3e13,null))[_0x3e36('0x46')](handleError(_0x3b3e13,null));};exports[_0x3e36('0x4b')]=function(_0x338e9d,_0x5693aa){return db[_0x3e36('0x31')][_0x3e36('0x4b')]()[_0x3e36('0x28')](respondWithResult(_0x5693aa,null))[_0x3e36('0x46')](handleError(_0x5693aa,null));};function wrapUser(_0x3a5898){return function(_0x5cbcd3){var _0xa8a425=_0x3a5898['get']({'plain':!![]});_0xa8a425[_0x3e36('0x4c')]=[];if(_0x5cbcd3){_0xa8a425['lastMessageAt']=_0x5cbcd3[_0x3e36('0x4d')];_0xa8a425[_0x3e36('0x4e')]=_0x5cbcd3;}else{_0xa8a425[_0x3e36('0x4f')]=moment(0x0)['format'](_0x3e36('0x50'));_0xa8a425['lastMessage']={};}return _0xa8a425;};}exports['getUsers']=function(_0x5a6697,_0x4553cf,_0x5aefdb){var _0x2ad2a8=[];return db[_0x3e36('0x51')][_0x3e36('0x52')]({'where':{'role':['agent',_0x3e36('0x53'),_0x3e36('0x54')]},'attributes':['id',_0x3e36('0x55'),_0x3e36('0x2d'),'role',_0x3e36('0x56'),_0x3e36('0x57'),_0x3e36('0x58'),_0x3e36('0x59'),'allowmessenger',_0x3e36('0x5a')],'order':qs['sort'](_0x3e36('0x5b')),'include':[{'model':db[_0x3e36('0x5c')],'as':_0x3e36('0x5d'),'attributes':['id',_0x3e36('0x2d'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x41222d){if(_0x41222d){var _0x289e78=_0x5a6697[_0x3e36('0x54')][_0x3e36('0x5e')]({'plain':!![]});if(!_0x289e78)throw new Error(_0x3e36('0x5f'));if(_0x289e78[_0x3e36('0x60')]==='user'){return db[_0x3e36('0x61')][_0x3e36('0x62')]({'where':{'name':_0x3e36('0x63'),'userProfileId':_0x289e78[_0x3e36('0x64')]},'raw':!![]})[_0x3e36('0x28')](function(_0x2ea843){if(_0x2ea843){if(_0x2ea843['autoAssociation']===0x0){return db[_0x3e36('0x65')][_0x3e36('0x52')]({'where':{'sectionId':_0x2ea843['id']},'raw':!![]})['then'](function(_0x294c85){var _0x4108a9=[];if(_[_0x3e36('0x66')](_0x294c85)){_0x4108a9=_[_0x3e36('0x42')](_0x41222d,function(_0x49eeb4){if(_0x49eeb4[_0x3e36('0x60')]!==_0x3e36('0x67')){return _0x49eeb4;}});return _0x4108a9;}else{for(var _0x439ad3=0x0;_0x439ad3<_0x41222d['length'];_0x439ad3++){var _0x51b5e3=_0x41222d[_0x439ad3];if(_0x51b5e3['role']==='agent'){var _0x197287=_['find'](_0x294c85,function(_0x258036){return _0x258036[_0x3e36('0x68')]===_0x51b5e3['id'];});if(_0x197287)_0x4108a9[_0x3e36('0x69')](_0x51b5e3);}else{_0x4108a9[_0x3e36('0x69')](_0x51b5e3);}}return _0x4108a9;}});}else{return _0x41222d;}}else{var _0x5a54e1=_[_0x3e36('0x42')](_0x41222d,function(_0x3818a6){if(_0x3818a6[_0x3e36('0x60')]!==_0x3e36('0x67')){return _0x3818a6;}});return _0x5a54e1;}});}else{return _0x41222d;}}})[_0x3e36('0x28')](function(_0x1c4cfd){var _0x40d61c=[];if(_0x1c4cfd){_0x2ad2a8=_0x1c4cfd;for(var _0x309d64=0x0;_0x309d64<_0x1c4cfd[_0x3e36('0x3c')];_0x309d64+=0x1){_0x2ad2a8[_0x309d64][_0x3e36('0x4c')]=[];_0x40d61c['push'](db['ChatInternalMessage'][_0x3e36('0x62')]({'where':{'FromId':[_0x5a6697['user']['id'],_0x1c4cfd[_0x309d64]['id']],'ToId':[_0x5a6697[_0x3e36('0x54')]['id'],_0x1c4cfd[_0x309d64]['id']],'ChatGroupId':null},'attributes':['id',_0x3e36('0x4d'),'FromId',_0x3e36('0x6a'),_0x3e36('0x6b'),_0x3e36('0x49')],'order':qs[_0x3e36('0x40')](_0x3e36('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3e36('0x28')](wrapUser(_0x1c4cfd[_0x309d64])));}return BPromise['all'](_0x40d61c);}return[];})[_0x3e36('0x28')](function(_0x3256ea){return{'rows':_0x3256ea,'count':_0x3256ea[_0x3e36('0x3c')]};})[_0x3e36('0x28')](respondWithResult(_0x4553cf,null))[_0x3e36('0x46')](handleError(_0x4553cf,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index a15a149..b9103f2 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 _0x3176=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3176,0x1d8));var _0x6317=function(_0x2b81b6,_0x45d457){_0x2b81b6=_0x2b81b6-0x0;var _0x49d16f=_0x3176[_0x2b81b6];return _0x49d16f;};'use strict';var EventEmitter=require(_0x6317('0x0'));var ChatInternalMessage=require(_0x6317('0x1'))['db'][_0x6317('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6317('0x3')](0x0);var events={'afterCreate':_0x6317('0x4'),'afterUpdate':_0x6317('0x5'),'afterDestroy':_0x6317('0x6')};function emitEvent(_0x39565b){return function(_0x2cba9c,_0x26a4c7,_0x14cc52){ChatInternalMessageEvents[_0x6317('0x7')](_0x39565b+':'+_0x2cba9c['id'],_0x2cba9c);ChatInternalMessageEvents[_0x6317('0x7')](_0x39565b,_0x2cba9c);_0x14cc52(null);};}for(var e in events){if(events[_0x6317('0x8')](e)){var event=events[e];ChatInternalMessage[_0x6317('0x9')](e,emitEvent(event));}}module[_0x6317('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x4200=['hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0x152449,_0x49f41d){var _0x5b58b2=function(_0x226c30){while(--_0x226c30){_0x152449['push'](_0x152449['shift']());}};_0x5b58b2(++_0x49f41d);}(_0x4200,0x188));var _0x0420=function(_0x225536,_0x315c28){_0x225536=_0x225536-0x0;var _0x4c39e5=_0x4200[_0x225536];return _0x4c39e5;};'use strict';var EventEmitter=require(_0x0420('0x0'));var ChatInternalMessage=require(_0x0420('0x1'))['db'][_0x0420('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0420('0x3')](0x0);var events={'afterCreate':_0x0420('0x4'),'afterUpdate':_0x0420('0x5'),'afterDestroy':_0x0420('0x6')};function emitEvent(_0x3ab500){return function(_0x370bf7,_0x58c1d4,_0x3142a3){ChatInternalMessageEvents[_0x0420('0x7')](_0x3ab500+':'+_0x370bf7['id'],_0x370bf7);ChatInternalMessageEvents[_0x0420('0x7')](_0x3ab500,_0x370bf7);_0x3142a3(null);};}for(var e in events){if(events[_0x0420('0x8')](e)){var event=events[e];ChatInternalMessage[_0x0420('0x9')](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 e45e8e7..460ca13 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 _0x072f=['./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2529fb,_0xab4612){var _0x15f6ed=function(_0x39b93f){while(--_0x39b93f){_0x2529fb['push'](_0x2529fb['shift']());}};_0x15f6ed(++_0xab4612);}(_0x072f,0x122));var _0xf072=function(_0x4a93c9,_0x4b5005){_0x4a93c9=_0x4a93c9-0x0;var _0x42ad3f=_0x072f[_0x4a93c9];return _0x42ad3f;};'use strict';var _=require(_0xf072('0x0'));var util=require(_0xf072('0x1'));var logger=require(_0xf072('0x2'))(_0xf072('0x3'));var moment=require(_0xf072('0x4'));var BPromise=require(_0xf072('0x5'));var rp=require(_0xf072('0x6'));var fs=require('fs');var path=require(_0xf072('0x7'));var rimraf=require(_0xf072('0x8'));var config=require(_0xf072('0x9'));var attributes=require(_0xf072('0xa'));module[_0xf072('0xb')]=function(_0x5e701f,_0x244037){return _0x5e701f['define'](_0xf072('0xc'),attributes,{'tableName':_0xf072('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf072('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x7903=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x8afdd0,_0x548ad1){var _0x3de7ac=function(_0x2dc2c4){while(--_0x2dc2c4){_0x8afdd0['push'](_0x8afdd0['shift']());}};_0x3de7ac(++_0x548ad1);}(_0x7903,0x148));var _0x3790=function(_0x3fbfc4,_0x244e54){_0x3fbfc4=_0x3fbfc4-0x0;var _0x469cb9=_0x7903[_0x3fbfc4];return _0x469cb9;};'use strict';var _=require(_0x3790('0x0'));var util=require(_0x3790('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3790('0x2'));var BPromise=require(_0x3790('0x3'));var rp=require(_0x3790('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3790('0x5'));var config=require(_0x3790('0x6'));var attributes=require(_0x3790('0x7'));module[_0x3790('0x8')]=function(_0xd129fb,_0x253ae9){return _0xd129fb[_0x3790('0x9')](_0x3790('0xa'),attributes,{'tableName':_0x3790('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3790('0xc'),'collate':_0x3790('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 112ba16..728018a 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 _0x91d9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','util'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x91d9,0xe0));var _0x991d=function(_0x17020d,_0x265527){_0x17020d=_0x17020d-0x0;var _0x1623b8=_0x91d9[_0x17020d];return _0x1623b8;};'use strict';var _=require('lodash');var util=require(_0x991d('0x0'));var moment=require(_0x991d('0x1'));var BPromise=require(_0x991d('0x2'));var rs=require(_0x991d('0x3'));var fs=require('fs');var Redis=require(_0x991d('0x4'));var db=require(_0x991d('0x5'))['db'];var utils=require(_0x991d('0x6'));var logger=require('../../config/logger')(_0x991d('0x7'));var config=require(_0x991d('0x8'));var jayson=require(_0x991d('0x9'));var client=jayson[_0x991d('0xa')]['http']({'port':0x232a});config[_0x991d('0xb')]=_[_0x991d('0xc')](config[_0x991d('0xb')],{'host':_0x991d('0xd'),'port':0x18eb});var socket=require(_0x991d('0xe'))(new Redis(config[_0x991d('0xb')]));require('./chatInternalMessage.socket')[_0x991d('0xf')](socket);function respondWithRpcPromise(_0x332cbe,_0x53da15,_0x416b78){return new BPromise(function(_0x343b13,_0x4be5e8){return client[_0x991d('0x10')](_0x332cbe,_0x416b78)[_0x991d('0x11')](function(_0x15c769){logger[_0x991d('0x12')](_0x991d('0x13'),_0x53da15,_0x991d('0x14'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x53da15,'request\x20sent',JSON[_0x991d('0x15')](_0x15c769));if(_0x15c769[_0x991d('0x16')]){if(_0x15c769[_0x991d('0x16')]['code']===0x1f4){logger[_0x991d('0x16')](_0x991d('0x13'),_0x53da15,_0x15c769['error'][_0x991d('0x17')]);return _0x4be5e8(_0x15c769[_0x991d('0x16')][_0x991d('0x17')]);}logger['error'](_0x991d('0x13'),_0x53da15,_0x15c769['error'][_0x991d('0x17')]);return _0x343b13(_0x15c769['error']['message']);}else{logger[_0x991d('0x12')](_0x991d('0x13'),_0x53da15,_0x991d('0x14'));_0x343b13(_0x15c769[_0x991d('0x18')][_0x991d('0x17')]);}})['catch'](function(_0x46122f){logger['error'](_0x991d('0x13'),_0x53da15,_0x46122f);_0x4be5e8(_0x46122f);});});}
\ No newline at end of file
+var _0xd5bf=['register','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter'];(function(_0x25689f,_0x37a6fb){var _0x364094=function(_0x29b5d8){while(--_0x29b5d8){_0x25689f['push'](_0x25689f['shift']());}};_0x364094(++_0x37a6fb);}(_0xd5bf,0x66));var _0xfd5b=function(_0x5b338a,_0x254f6f){_0x5b338a=_0x5b338a-0x0;var _0x5b23f8=_0xd5bf[_0x5b338a];return _0x5b23f8;};'use strict';var _=require(_0xfd5b('0x0'));var util=require(_0xfd5b('0x1'));var moment=require(_0xfd5b('0x2'));var BPromise=require(_0xfd5b('0x3'));var rs=require(_0xfd5b('0x4'));var fs=require('fs');var Redis=require(_0xfd5b('0x5'));var db=require(_0xfd5b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfd5b('0x7'));var config=require(_0xfd5b('0x8'));var jayson=require(_0xfd5b('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xfd5b('0xa')]=_[_0xfd5b('0xb')](config[_0xfd5b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfd5b('0xc'))(new Redis(config[_0xfd5b('0xa')]));require('./chatInternalMessage.socket')[_0xfd5b('0xd')](socket);function respondWithRpcPromise(_0x40b49b,_0x5eefe8,_0x20222a){return new BPromise(function(_0x56e7e7,_0x29ee53){return client['request'](_0x40b49b,_0x20222a)[_0xfd5b('0xe')](function(_0x4b3da7){logger[_0xfd5b('0xf')](_0xfd5b('0x10'),_0x5eefe8,'request\x20sent');logger['debug'](_0xfd5b('0x11'),_0x5eefe8,_0xfd5b('0x12'),JSON['stringify'](_0x4b3da7));if(_0x4b3da7[_0xfd5b('0x13')]){if(_0x4b3da7[_0xfd5b('0x13')][_0xfd5b('0x14')]===0x1f4){logger[_0xfd5b('0x13')](_0xfd5b('0x10'),_0x5eefe8,_0x4b3da7[_0xfd5b('0x13')][_0xfd5b('0x15')]);return _0x29ee53(_0x4b3da7[_0xfd5b('0x13')][_0xfd5b('0x15')]);}logger[_0xfd5b('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x5eefe8,_0x4b3da7[_0xfd5b('0x13')][_0xfd5b('0x15')]);return _0x56e7e7(_0x4b3da7[_0xfd5b('0x13')][_0xfd5b('0x15')]);}else{logger['info'](_0xfd5b('0x10'),_0x5eefe8,'request\x20sent');_0x56e7e7(_0x4b3da7['result'][_0xfd5b('0x15')]);}})[_0xfd5b('0x16')](function(_0x4bd45e){logger[_0xfd5b('0x13')](_0xfd5b('0x10'),_0x5eefe8,_0x4bd45e);_0x29ee53(_0x4bd45e);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 3b4ef11..5b356d4 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 _0xf9ad=['remove','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf9ad,0xf1));var _0xdf9a=function(_0x58c952,_0x303f83){_0x58c952=_0x58c952-0x0;var _0x1be0b3=_0xf9ad[_0x58c952];return _0x1be0b3;};'use strict';var ChatInternalMessageEvents=require(_0xdf9a('0x0'));var events=[_0xdf9a('0x1'),_0xdf9a('0x2'),_0xdf9a('0x3')];function createListener(_0x4af242,_0x53f1fd){return function(_0x58bc7d){_0x53f1fd[_0xdf9a('0x4')](_0x4af242,_0x58bc7d);};}function removeListener(_0x25010c,_0x381dda){return function(){ChatInternalMessageEvents[_0xdf9a('0x5')](_0x25010c,_0x381dda);};}exports[_0xdf9a('0x6')]=function(_0x498c0d){for(var _0xa2f117=0x0,_0x25772e=events[_0xdf9a('0x7')];_0xa2f117<_0x25772e;_0xa2f117++){var _0x3469de=events[_0xa2f117];var _0x10fc37=createListener(_0xdf9a('0x8')+_0x3469de,_0x498c0d);ChatInternalMessageEvents['on'](_0x3469de,_0x10fc37);}};
\ No newline at end of file
+var _0x0fee=['chatInternalMessage:','emit','removeListener','register','length'];(function(_0x2067e3,_0x19bcb2){var _0x180c44=function(_0x53751f){while(--_0x53751f){_0x2067e3['push'](_0x2067e3['shift']());}};_0x180c44(++_0x19bcb2);}(_0x0fee,0x1af));var _0xe0fe=function(_0x3646b4,_0x16af8f){_0x3646b4=_0x3646b4-0x0;var _0x16184a=_0x0fee[_0x3646b4];return _0x16184a;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save','remove','update'];function createListener(_0x53cbba,_0x4ac8fc){return function(_0x12d326){_0x4ac8fc[_0xe0fe('0x0')](_0x53cbba,_0x12d326);};}function removeListener(_0x10401f,_0x24db67){return function(){ChatInternalMessageEvents[_0xe0fe('0x1')](_0x10401f,_0x24db67);};}exports[_0xe0fe('0x2')]=function(_0x6850ec){for(var _0x3ce791=0x0,_0x483415=events[_0xe0fe('0x3')];_0x3ce791<_0x483415;_0x3ce791++){var _0x3e83f0=events[_0x3ce791];var _0x157361=createListener(_0xe0fe('0x4')+_0x3e83f0,_0x6850ec);ChatInternalMessageEvents['on'](_0x3e83f0,_0x157361);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index ddb102d..f16abec 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 _0x0a0a=['Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express'];(function(_0x26dae2,_0x1fc18e){var _0xf3c9f4=function(_0x4f77d9){while(--_0x4f77d9){_0x26dae2['push'](_0x26dae2['shift']());}};_0xf3c9f4(++_0x1fc18e);}(_0x0a0a,0x11c));var _0xa0a0=function(_0x1dfdd6,_0x10b2dd){_0x1dfdd6=_0x1dfdd6-0x0;var _0x1929db=_0x0a0a[_0x1dfdd6];return _0x1929db;};'use strict';var multer=require(_0xa0a0('0x0'));var util=require(_0xa0a0('0x1'));var path=require(_0xa0a0('0x2'));var timeout=require('connect-timeout');var express=require(_0xa0a0('0x3'));var router=express[_0xa0a0('0x4')]();var fs_extra=require(_0xa0a0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa0a0('0x6'));var config=require(_0xa0a0('0x7'));var controller=require(_0xa0a0('0x8'));router['get']('/',auth[_0xa0a0('0x9')](),controller[_0xa0a0('0xa')]);router[_0xa0a0('0xb')](_0xa0a0('0xc'),auth[_0xa0a0('0x9')](),controller[_0xa0a0('0xd')]);router['get'](_0xa0a0('0xe'),auth[_0xa0a0('0x9')](),controller['getUsers']);router[_0xa0a0('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xa0a0('0xf')]);router[_0xa0a0('0x10')]('/',auth[_0xa0a0('0x9')](),controller[_0xa0a0('0x11')]);router[_0xa0a0('0x12')](_0xa0a0('0x13'),controller[_0xa0a0('0x14')]);router[_0xa0a0('0x15')]('/:id',auth[_0xa0a0('0x9')](),controller[_0xa0a0('0x16')]);module[_0xa0a0('0x17')]=router;
\ No newline at end of file
+var _0x733e=['isAuthenticated','/describe','describe','/users','getUsers','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get'];(function(_0x5305e6,_0x12781f){var _0x30c6f2=function(_0x423fe7){while(--_0x423fe7){_0x5305e6['push'](_0x5305e6['shift']());}};_0x30c6f2(++_0x12781f);}(_0x733e,0x115));var _0xe733=function(_0xe501ff,_0x955b7e){_0xe501ff=_0xe501ff-0x0;var _0x17135d=_0x733e[_0xe501ff];return _0x17135d;};'use strict';var multer=require(_0xe733('0x0'));var util=require(_0xe733('0x1'));var path=require(_0xe733('0x2'));var timeout=require(_0xe733('0x3'));var express=require('express');var router=express[_0xe733('0x4')]();var fs_extra=require(_0xe733('0x5'));var auth=require(_0xe733('0x6'));var interaction=require(_0xe733('0x7'));var config=require(_0xe733('0x8'));var controller=require(_0xe733('0x9'));router[_0xe733('0xa')]('/',auth[_0xe733('0xb')](),controller['index']);router[_0xe733('0xa')](_0xe733('0xc'),auth[_0xe733('0xb')](),controller[_0xe733('0xd')]);router['get'](_0xe733('0xe'),auth['isAuthenticated'](),controller[_0xe733('0xf')]);router['get'](_0xe733('0x10'),auth[_0xe733('0xb')](),controller[_0xe733('0x11')]);router[_0xe733('0x12')]('/',auth[_0xe733('0xb')](),controller[_0xe733('0x13')]);router['put']('/:id',controller[_0xe733('0x14')]);router[_0xe733('0x15')](_0xe733('0x10'),auth[_0xe733('0xb')](),controller[_0xe733('0x16')]);module[_0xe733('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index fc3b0d7..1a18916 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 _0xe5b5=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x347379,_0x37de29){var _0x1e6dbf=function(_0x137484){while(--_0x137484){_0x347379['push'](_0x347379['shift']());}};_0x1e6dbf(++_0x37de29);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0xe5b5[_0x15ca1a];return _0x507626;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'body':{'type':Sequelize[_0x5e5b('0x2')](_0x5e5b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5e5b('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5e5b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5e5b('0x5')]('in',_0x5e5b('0x6')),'defaultValue':_0x5e5b('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x5e5b('0x7')]},'providerName':{'type':Sequelize[_0x5e5b('0x8')]},'providerResponse':{'type':Sequelize[_0x5e5b('0x2')]}};
\ No newline at end of file
+var _0x1bd1=['BOOLEAN','DATE','STRING','sequelize','exports','TEXT'];(function(_0x2ef476,_0x19dc5a){var _0x4c11b0=function(_0x5989dc){while(--_0x5989dc){_0x2ef476['push'](_0x2ef476['shift']());}};_0x4c11b0(++_0x19dc5a);}(_0x1bd1,0x123));var _0x11bd=function(_0x10cb1e,_0x1974aa){_0x10cb1e=_0x10cb1e-0x0;var _0x51bbc9=_0x1bd1[_0x10cb1e];return _0x51bbc9;};'use strict';var Sequelize=require(_0x11bd('0x0'));module[_0x11bd('0x1')]={'body':{'type':Sequelize[_0x11bd('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x11bd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x11bd('0x4')]},'providerName':{'type':Sequelize[_0x11bd('0x5')]},'providerResponse':{'type':Sequelize[_0x11bd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 319d816..20744e7 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 _0xe2ea=['interface','motionChannel','rejectmessage','formData','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','fields','length','find','create','body','update','describe','chat-interactions','chat','read','readAt','format','UserId','user','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','agent','fullname','email','internal','manual','SIP/%s','channel','accept','EventManager','parse','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','contact'];(function(_0x76d0dd,_0x16716d){var _0x508d20=function(_0x15af09){while(--_0x15af09){_0x76d0dd['push'](_0x76d0dd['shift']());}};_0x508d20(++_0x16716d);}(_0xe2ea,0x8c));var _0xae2e=function(_0x55f075,_0x7d0cd3){_0x55f075=_0x55f075-0x0;var _0xea7256=_0xe2ea[_0x55f075];return _0xea7256;};'use strict';var emlformat=require(_0xae2e('0x0'));var rimraf=require(_0xae2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xae2e('0x2'));var rp=require(_0xae2e('0x3'));var moment=require(_0xae2e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xae2e('0x5'));var util=require(_0xae2e('0x6'));var path=require(_0xae2e('0x7'));var sox=require(_0xae2e('0x8'));var csv=require(_0xae2e('0x9'));var ejs=require(_0xae2e('0xa'));var fs=require('fs');var fs_extra=require(_0xae2e('0xb'));var _=require(_0xae2e('0xc'));var squel=require('squel');var crypto=require(_0xae2e('0xd'));var jsforce=require(_0xae2e('0xe'));var deskjs=require(_0xae2e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xae2e('0x10'));var Papa=require(_0xae2e('0x11'));var Redis=require(_0xae2e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xae2e('0x13'));var as=require(_0xae2e('0x14'));var hardwareService=require(_0xae2e('0x15'));var logger=require(_0xae2e('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xae2e('0x17'));var db=require(_0xae2e('0x18'))['db'];config[_0xae2e('0x19')]=_[_0xae2e('0x1a')](config['redis'],{'host':_0xae2e('0x1b'),'port':0x18eb});var socket=require(_0xae2e('0x1c'))(new Redis(config[_0xae2e('0x19')]));require(_0xae2e('0x1d'))[_0xae2e('0x1e')](socket);var jayson=require(_0xae2e('0x1f'));var client=jayson['client'][_0xae2e('0x20')]({'port':0x232c});var client9002=jayson[_0xae2e('0x21')][_0xae2e('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xa0e592,_0x113409,_0x2a33fb,_0x2a135f){return new BPromise(function(_0x29401c,_0x42ff52){var _0x3690f9=_0x2a135f||client;return _0x3690f9[_0xae2e('0x22')](_0xa0e592,_0x2a33fb)[_0xae2e('0x23')](function(_0x3b0570){logger[_0xae2e('0x24')]('ChatMessage,\x20%s,\x20%s',_0x113409,_0xae2e('0x25'));logger[_0xae2e('0x26')](_0xae2e('0x27'),_0x113409,_0xae2e('0x25'),JSON[_0xae2e('0x28')](_0x3b0570));if(_0x3b0570['error']){if(_0x3b0570[_0xae2e('0x29')][_0xae2e('0x2a')]===0x1f4){logger[_0xae2e('0x29')](_0xae2e('0x2b'),_0x113409,_0x3b0570[_0xae2e('0x29')]['message']);return _0x42ff52(_0x3b0570[_0xae2e('0x29')][_0xae2e('0x2c')]);}logger[_0xae2e('0x29')](_0xae2e('0x2b'),_0x113409,_0x3b0570[_0xae2e('0x29')][_0xae2e('0x2c')]);return _0x29401c(_0x3b0570['error'][_0xae2e('0x2c')]);}else{logger[_0xae2e('0x24')]('ChatMessage,\x20%s,\x20%s',_0x113409,'request\x20sent');_0x29401c(_0x3b0570[_0xae2e('0x2d')]['message']);}})[_0xae2e('0x2e')](function(_0x5297a0){logger[_0xae2e('0x29')]('ChatMessage,\x20%s,\x20%s',_0x113409,_0x5297a0);_0x42ff52(_0x5297a0);});});}function respondWithStatusCode(_0x23a959,_0x839e02){_0x839e02=_0x839e02||0xcc;return function(_0x2d54dc){if(_0x2d54dc){return _0x23a959[_0xae2e('0x2f')](_0x839e02);}return _0x23a959[_0xae2e('0x30')](_0x839e02)[_0xae2e('0x31')]();};}function respondWithResult(_0x5579ee,_0x51c003){_0x51c003=_0x51c003||0xc8;return function(_0x55b12f){if(_0x55b12f){return _0x5579ee[_0xae2e('0x30')](_0x51c003)[_0xae2e('0x32')](_0x55b12f);}};}function respondWithFilteredResult(_0x735f6d,_0x4d743b){return function(_0x369a3f){if(_0x369a3f){var _0x51c273=typeof _0x4d743b[_0xae2e('0x33')]===_0xae2e('0x34')&&typeof _0x4d743b[_0xae2e('0x35')]===_0xae2e('0x34');var _0x494c2b=_0x369a3f[_0xae2e('0x36')];var _0x1aedef=_0x51c273?0x0:_0x4d743b['offset'];var _0x516435=_0x51c273?_0x369a3f[_0xae2e('0x36')]:_0x4d743b[_0xae2e('0x33')]+_0x4d743b[_0xae2e('0x35')];var _0x30c87f;if(_0x516435>=_0x494c2b){_0x516435=_0x494c2b;_0x30c87f=0xc8;}else{_0x30c87f=0xce;}_0x735f6d[_0xae2e('0x30')](_0x30c87f);return _0x735f6d['set']('Content-Range',_0x1aedef+'-'+_0x516435+'/'+_0x494c2b)[_0xae2e('0x32')](_0x369a3f);}return null;};}function patchUpdates(_0x5746d4){return function(_0x45b3fe){try{jsonpatch[_0xae2e('0x37')](_0x45b3fe,_0x5746d4,!![]);}catch(_0x67584c){return BPromise[_0xae2e('0x38')](_0x67584c);}return _0x45b3fe[_0xae2e('0x39')]();};}function saveUpdates(_0x2dc771,_0x158685){return function(_0x3e4ad9){if(_0x3e4ad9){return _0x3e4ad9['update'](_0x2dc771)['then'](function(_0x3ee747){return _0x3ee747;});}return null;};}function removeEntity(_0x40c3c1,_0x445e4e){return function(_0x35073d){if(_0x35073d){return _0x35073d[_0xae2e('0x3a')]()[_0xae2e('0x23')](function(){_0x40c3c1[_0xae2e('0x30')](0xcc)[_0xae2e('0x31')]();});}};}function handleEntityNotFound(_0x4e7fac,_0x4994f0){return function(_0x26365c){if(!_0x26365c){_0x4e7fac[_0xae2e('0x2f')](0x194);}return _0x26365c;};}function handleError(_0x7371e5,_0x3319ba){_0x3319ba=_0x3319ba||0x1f4;return function(_0x4de38f){logger[_0xae2e('0x29')](_0x4de38f[_0xae2e('0x3b')]);if(_0x4de38f[_0xae2e('0x3c')]){delete _0x4de38f[_0xae2e('0x3c')];}_0x7371e5[_0xae2e('0x30')](_0x3319ba)[_0xae2e('0x3d')](_0x4de38f);};}exports[_0xae2e('0x3e')]=function(_0x1c547c,_0x4ca077){var _0x48f3ae={},_0x40c62e={},_0x1f684b={'count':0x0,'rows':[]};var _0x37038a=_[_0xae2e('0x3f')](db[_0xae2e('0x40')][_0xae2e('0x41')],function(_0x3a83b7){return{'name':_0x3a83b7[_0xae2e('0x42')],'type':_0x3a83b7['type']['key']};});_0x40c62e[_0xae2e('0x43')]=_[_0xae2e('0x3f')](_0x37038a,'name');_0x40c62e[_0xae2e('0x44')]=_[_0xae2e('0x45')](_0x1c547c[_0xae2e('0x44')]);_0x40c62e[_0xae2e('0x46')]=_[_0xae2e('0x47')](_0x40c62e[_0xae2e('0x43')],_0x40c62e[_0xae2e('0x44')]);_0x48f3ae['attributes']=_[_0xae2e('0x47')](_0x40c62e[_0xae2e('0x43')],qs['fields'](_0x1c547c[_0xae2e('0x44')]['fields']));_0x48f3ae[_0xae2e('0x48')]=_0x48f3ae['attributes']['length']?_0x48f3ae['attributes']:_0x40c62e['model'];if(!_0x1c547c[_0xae2e('0x44')][_0xae2e('0x49')]('nolimit')){_0x48f3ae[_0xae2e('0x35')]=qs[_0xae2e('0x35')](_0x1c547c[_0xae2e('0x44')]['limit']);_0x48f3ae[_0xae2e('0x33')]=qs[_0xae2e('0x33')](_0x1c547c['query'][_0xae2e('0x33')]);}_0x48f3ae[_0xae2e('0x4a')]=qs['sort'](_0x1c547c[_0xae2e('0x44')][_0xae2e('0x4b')]);_0x48f3ae[_0xae2e('0x4c')]=qs['filters'](_[_0xae2e('0x4d')](_0x1c547c['query'],_0x40c62e['filters']),_0x37038a);if(_0x1c547c[_0xae2e('0x44')][_0xae2e('0x4e')]){_0x48f3ae[_0xae2e('0x4c')]=_[_0xae2e('0x4f')](_0x48f3ae[_0xae2e('0x4c')],{'$or':_['map'](_0x37038a,function(_0x26d79e){if(_0x26d79e[_0xae2e('0x50')]!==_0xae2e('0x51')){var _0x333b03={};_0x333b03[_0x26d79e[_0xae2e('0x3c')]]={'$like':'%'+_0x1c547c[_0xae2e('0x44')][_0xae2e('0x4e')]+'%'};return _0x333b03;}})});}_0x48f3ae=_[_0xae2e('0x4f')]({},_0x48f3ae,_0x1c547c[_0xae2e('0x52')]);var _0x1ac2bf={'where':_0x48f3ae[_0xae2e('0x4c')]};return db[_0xae2e('0x40')][_0xae2e('0x36')](_0x1ac2bf)[_0xae2e('0x23')](function(_0x4ab85e){_0x1f684b[_0xae2e('0x36')]=_0x4ab85e;if(_0x1c547c[_0xae2e('0x44')][_0xae2e('0x53')]){_0x48f3ae[_0xae2e('0x54')]=[{'all':!![]}];}return db[_0xae2e('0x40')][_0xae2e('0x55')](_0x48f3ae);})[_0xae2e('0x23')](function(_0x3728b1){_0x1f684b['rows']=_0x3728b1;return _0x1f684b;})['then'](respondWithFilteredResult(_0x4ca077,_0x48f3ae))['catch'](handleError(_0x4ca077,null));};exports[_0xae2e('0x56')]=function(_0xdf3d88,_0x4a1415){var _0x546eeb={'raw':!![],'where':{'id':_0xdf3d88[_0xae2e('0x57')]['id']}},_0x2c1044={};_0x2c1044[_0xae2e('0x43')]=_['keys'](db['ChatMessage'][_0xae2e('0x41')]);_0x2c1044[_0xae2e('0x44')]=_[_0xae2e('0x45')](_0xdf3d88[_0xae2e('0x44')]);_0x2c1044[_0xae2e('0x46')]=_[_0xae2e('0x47')](_0x2c1044['model'],_0x2c1044[_0xae2e('0x44')]);_0x546eeb[_0xae2e('0x48')]=_['intersection'](_0x2c1044[_0xae2e('0x43')],qs['fields'](_0xdf3d88[_0xae2e('0x44')][_0xae2e('0x58')]));_0x546eeb[_0xae2e('0x48')]=_0x546eeb[_0xae2e('0x48')][_0xae2e('0x59')]?_0x546eeb[_0xae2e('0x48')]:_0x2c1044[_0xae2e('0x43')];if(_0xdf3d88[_0xae2e('0x44')][_0xae2e('0x53')]){_0x546eeb[_0xae2e('0x54')]=[{'all':!![]}];}_0x546eeb=_[_0xae2e('0x4f')]({},_0x546eeb,_0xdf3d88[_0xae2e('0x52')]);return db['ChatMessage'][_0xae2e('0x5a')](_0x546eeb)[_0xae2e('0x23')](handleEntityNotFound(_0x4a1415,null))[_0xae2e('0x23')](respondWithResult(_0x4a1415,null))[_0xae2e('0x2e')](handleError(_0x4a1415,null));};exports['create']=function(_0x19c365,_0x44918c){return db[_0xae2e('0x40')][_0xae2e('0x5b')](_0x19c365[_0xae2e('0x5c')],{})[_0xae2e('0x23')](respondWithResult(_0x44918c,0xc9))[_0xae2e('0x2e')](handleError(_0x44918c,null));};exports[_0xae2e('0x5d')]=function(_0x49b4bc,_0x1254f5){if(_0x49b4bc[_0xae2e('0x5c')]['id']){delete _0x49b4bc[_0xae2e('0x5c')]['id'];}return db['ChatMessage'][_0xae2e('0x5a')]({'where':{'id':_0x49b4bc['params']['id']}})['then'](handleEntityNotFound(_0x1254f5,null))[_0xae2e('0x23')](saveUpdates(_0x49b4bc[_0xae2e('0x5c')],null))[_0xae2e('0x23')](respondWithResult(_0x1254f5,null))[_0xae2e('0x2e')](handleError(_0x1254f5,null));};exports[_0xae2e('0x3a')]=function(_0xbf1fa6,_0x20a472){return db['ChatMessage'][_0xae2e('0x5a')]({'where':{'id':_0xbf1fa6[_0xae2e('0x57')]['id']}})[_0xae2e('0x23')](handleEntityNotFound(_0x20a472,null))[_0xae2e('0x23')](removeEntity(_0x20a472,null))['catch'](handleError(_0x20a472,null));};exports[_0xae2e('0x5e')]=function(_0x1f19f8,_0x4bb091){return db[_0xae2e('0x40')]['describe']()[_0xae2e('0x23')](respondWithResult(_0x4bb091,null))[_0xae2e('0x2e')](handleError(_0x4bb091,null));};var interaction_log=require(_0xae2e('0x16'))(_0xae2e('0x5f'));exports['accept']=function(_0x540af4,_0x38bfd9,_0x5608f7){var _0xe41b63={'agent':{},'channel':_0xae2e('0x60')};if(_0x540af4[_0xae2e('0x5c')]['id']){delete _0x540af4[_0xae2e('0x5c')]['id'];}_0x540af4[_0xae2e('0x5c')][_0xae2e('0x61')]=!![];_0x540af4['body'][_0xae2e('0x62')]=moment()[_0xae2e('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x540af4[_0xae2e('0x5c')][_0xae2e('0x64')]=_0x540af4[_0xae2e('0x5c')][_0xae2e('0x64')]||_0x540af4[_0xae2e('0x65')]['id'];_0xe41b63['agent']['id']=_0x540af4['body'][_0xae2e('0x64')];return db['ChatMessage']['find']({'where':{'id':_0x540af4[_0xae2e('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x38bfd9,null))[_0xae2e('0x23')](saveUpdates(_0x540af4[_0xae2e('0x5c')],null))['then'](function(_0x501074){if(_0x501074){_0xe41b63[_0xae2e('0x2c')]=_0x501074['get']({'plain':!![]});return db[_0xae2e('0x66')][_0xae2e('0x5a')]({'where':{'id':_0x501074[_0xae2e('0x67')]}});}return null;})[_0xae2e('0x23')](handleEntityNotFound(_0x38bfd9,null))['then'](function(_0x5d5080){if(_0x5d5080){return _0x5d5080['update']({'UserId':_0x540af4[_0xae2e('0x5c')]['UserId'],'read1stAt':_[_0xae2e('0x68')](_0x5d5080[_0xae2e('0x69')])?moment()['format'](_0xae2e('0x6a')):undefined});}return null;})[_0xae2e('0x23')](function(_0x10ae33){if(_0x10ae33){_0xe41b63[_0xae2e('0x6b')]=_0x10ae33['get']({'plain':!![]});interaction_log[_0xae2e('0x24')](_0xae2e('0x6c'),_0x540af4[_0xae2e('0x65')]['id'],_0x540af4[_0xae2e('0x65')][_0xae2e('0x3c')],_0x540af4['user'][_0xae2e('0x6d')],_0xe41b63[_0xae2e('0x6b')]['id'],_0x540af4[_0xae2e('0x5c')]?JSON[_0xae2e('0x28')](_0x540af4['body']):_0xae2e('0x6e'));return respondWithRpcPromise(_0xae2e('0x6f'),_0xae2e('0x70'),_0xe41b63);}return null;})['then'](function(_0x576b49){var _0x2d8e4d=_0xae2e('0x71')+_0x576b49[_0xae2e('0x2c')][_0xae2e('0x72')];return db[_0xae2e('0x73')][_0xae2e('0x44')](_0x2d8e4d,{'type':db[_0xae2e('0x74')][_0xae2e('0x75')][_0xae2e('0x76')],'raw':!![]})[_0xae2e('0x23')](function(_0x5f40b9){return _0x5f40b9;});})[_0xae2e('0x23')](function(_0xb43af2){if(_0xb43af2){_0xe41b63['message']['contact']=_0xb43af2[0x0];if(!_0x540af4[_0xae2e('0x5c')]['UserId'])return;return db['User'][_0xae2e('0x5a')]({'where':{'id':_0x540af4['body'][_0xae2e('0x64')],'role':_0xae2e('0x77')},'attributes':['id',_0xae2e('0x3c'),_0xae2e('0x78'),_0xae2e('0x79'),_0xae2e('0x7a')],'raw':!![]});}return null;})[_0xae2e('0x23')](function(_0x7730c0){if(!_0x7730c0)return null;_0xe41b63[_0xae2e('0x2c')]['agent']=_0x7730c0;return _0xe41b63;})[_0xae2e('0x23')](function(_0x38b488){if(_0x38b488){if(_0x540af4[_0xae2e('0x5c')][_0xae2e('0x7b')]){_0xe41b63[_0xae2e('0x2c')]['interface']=util[_0xae2e('0x63')](_0xae2e('0x7c'),_0x540af4[_0xae2e('0x65')][_0xae2e('0x3c')]);_0xe41b63['message'][_0xae2e('0x7d')]=_0xe41b63[_0xae2e('0x7d')];_0xe41b63['message']['motionChannel']=_0xe41b63[_0xae2e('0x7d')];_0xe41b63[_0xae2e('0x2c')]['event']=_0xae2e('0x7e');return respondWithRpcPromise(_0xae2e('0x7f'),_0xae2e('0x7f'),{'event':'acceptmessage','message':_['merge'](_0xe41b63[_0xae2e('0x2c')],JSON[_0xae2e('0x80')](_0xe41b63['interaction']['formData']))},client9002)[_0xae2e('0x23')](function(){return _0xe41b63;});}return _0xe41b63;}return null;})[_0xae2e('0x23')](respondWithResult(_0x38bfd9,null))['catch'](handleError(_0x38bfd9,null));};var interaction_log=require(_0xae2e('0x16'))(_0xae2e('0x5f'));exports[_0xae2e('0x38')]=function(_0x49c0ff,_0x483cf8,_0x513432){var _0x833604={'agent':{},'channel':'chat'};if(_0x49c0ff[_0xae2e('0x5c')]['id']){delete _0x49c0ff[_0xae2e('0x5c')]['id'];}_0x49c0ff[_0xae2e('0x5c')][_0xae2e('0x64')]=_0x49c0ff[_0xae2e('0x5c')][_0xae2e('0x64')]||_0x49c0ff['user']['id'];_0x833604[_0xae2e('0x77')]['id']=_0x49c0ff[_0xae2e('0x5c')][_0xae2e('0x64')];return db[_0xae2e('0x40')][_0xae2e('0x5a')]({'where':{'id':_0x49c0ff['params']['id'],'UserId':null}})[_0xae2e('0x23')](handleEntityNotFound(_0x483cf8,null))['then'](function(_0x185094){if(_0x185094){_0x833604[_0xae2e('0x2c')]=_0x185094[_0xae2e('0x81')]({'plain':!![]});return db[_0xae2e('0x66')][_0xae2e('0x5a')]({'where':{'id':_0x185094['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x483cf8,null))[_0xae2e('0x23')](function(_0x41a873){if(_0x41a873){_0x833604[_0xae2e('0x6b')]=_0x41a873['get']({'plain':!![]});interaction_log[_0xae2e('0x24')](_0xae2e('0x82'),_0x49c0ff['user']['id'],_0x49c0ff[_0xae2e('0x65')][_0xae2e('0x3c')],_0x49c0ff['user'][_0xae2e('0x6d')],_0x833604['interaction']['id'],_0x49c0ff['body']?JSON['stringify'](_0x49c0ff[_0xae2e('0x5c')]):_0xae2e('0x6e'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x833604);}return null;})[_0xae2e('0x23')](function(_0x28e20a){var _0x24cd9f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x28e20a[_0xae2e('0x2c')][_0xae2e('0x72')];return db[_0xae2e('0x73')][_0xae2e('0x44')](_0x24cd9f,{'type':db[_0xae2e('0x74')]['QueryTypes']['SELECT'],'raw':!![]})[_0xae2e('0x23')](function(_0x2864ae){return _0x2864ae;});})[_0xae2e('0x23')](function(_0x11f675){if(_0x11f675){_0x833604[_0xae2e('0x2c')][_0xae2e('0x83')]=_0x11f675[0x0];if(!_0x49c0ff[_0xae2e('0x5c')][_0xae2e('0x64')])return;return db['User'][_0xae2e('0x5a')]({'where':{'id':_0x49c0ff[_0xae2e('0x5c')][_0xae2e('0x64')],'role':'agent'},'attributes':['id','name',_0xae2e('0x78'),'email',_0xae2e('0x7a')],'raw':!![]});}return null;})[_0xae2e('0x23')](function(_0x39631){if(!_0x39631)return null;_0x833604['message']['agent']=_0x39631;return _0x833604;})['then'](function(_0x205493){if(_0x205493){_0x205493[_0xae2e('0x2c')][_0xae2e('0x84')]=util['format'](_0xae2e('0x7c'),_0x49c0ff[_0xae2e('0x65')][_0xae2e('0x3c')]);_0x205493['message'][_0xae2e('0x7d')]=_0x833604[_0xae2e('0x7d')];_0x205493['message'][_0xae2e('0x85')]=_0x833604[_0xae2e('0x7d')];_0x205493[_0xae2e('0x2c')]['event']=_0xae2e('0x38');respondWithRpcPromise('EventManager',_0xae2e('0x7f'),{'event':_0xae2e('0x86'),'message':_[_0xae2e('0x4f')](_0x833604[_0xae2e('0x2c')],JSON[_0xae2e('0x80')](_0x833604[_0xae2e('0x6b')][_0xae2e('0x87')]))},client9002);return _0x833604;}return null;})['then'](respondWithResult(_0x483cf8,null))['catch'](handleError(_0x483cf8,null));};
\ No newline at end of file
+var _0xca52=['end','status','offset','undefined','limit','count','Content-Range','json','save','update','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','destroy','describe','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','chat-interactions','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT','fullname','email','interface','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','jayson/promise','request','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xca52,0xdb));var _0x2ca5=function(_0x2ec1a2,_0x2213e8){_0x2ec1a2=_0x2ec1a2-0x0;var _0x5ee2d5=_0xca52[_0x2ec1a2];return _0x5ee2d5;};'use strict';var emlformat=require(_0x2ca5('0x0'));var rimraf=require(_0x2ca5('0x1'));var zipdir=require(_0x2ca5('0x2'));var jsonpatch=require(_0x2ca5('0x3'));var rp=require(_0x2ca5('0x4'));var moment=require(_0x2ca5('0x5'));var BPromise=require(_0x2ca5('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2ca5('0x7'));var sox=require(_0x2ca5('0x8'));var csv=require(_0x2ca5('0x9'));var ejs=require(_0x2ca5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ca5('0xb'));var squel=require(_0x2ca5('0xc'));var crypto=require(_0x2ca5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2ca5('0x9'));var querystring=require(_0x2ca5('0xe'));var Papa=require('papaparse');var Redis=require(_0x2ca5('0xf'));var authService=require(_0x2ca5('0x10'));var qs=require(_0x2ca5('0x11'));var as=require(_0x2ca5('0x12'));var hardwareService=require(_0x2ca5('0x13'));var logger=require(_0x2ca5('0x14'))(_0x2ca5('0x15'));var utils=require(_0x2ca5('0x16'));var config=require(_0x2ca5('0x17'));var licenseUtil=require(_0x2ca5('0x18'));var db=require(_0x2ca5('0x19'))['db'];config['redis']=_[_0x2ca5('0x1a')](config[_0x2ca5('0x1b')],{'host':_0x2ca5('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x2ca5('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38fe3a,_0xede778,_0xb3d1dd,_0x3c86b7){return new BPromise(function(_0x19e33e,_0x4e2e4c){var _0x14e172=_0x3c86b7||client;return _0x14e172[_0x2ca5('0x1e')](_0x38fe3a,_0xb3d1dd)[_0x2ca5('0x1f')](function(_0x5ac534){logger[_0x2ca5('0x20')](_0x2ca5('0x21'),_0xede778,'request\x20sent');logger['debug'](_0x2ca5('0x22'),_0xede778,'request\x20sent',JSON[_0x2ca5('0x23')](_0x5ac534));if(_0x5ac534[_0x2ca5('0x24')]){if(_0x5ac534[_0x2ca5('0x24')]['code']===0x1f4){logger[_0x2ca5('0x24')](_0x2ca5('0x21'),_0xede778,_0x5ac534[_0x2ca5('0x24')][_0x2ca5('0x25')]);return _0x4e2e4c(_0x5ac534[_0x2ca5('0x24')][_0x2ca5('0x25')]);}logger['error'](_0x2ca5('0x21'),_0xede778,_0x5ac534[_0x2ca5('0x24')][_0x2ca5('0x25')]);return _0x19e33e(_0x5ac534[_0x2ca5('0x24')][_0x2ca5('0x25')]);}else{logger[_0x2ca5('0x20')](_0x2ca5('0x21'),_0xede778,_0x2ca5('0x26'));_0x19e33e(_0x5ac534[_0x2ca5('0x27')][_0x2ca5('0x25')]);}})[_0x2ca5('0x28')](function(_0x3be809){logger['error'](_0x2ca5('0x21'),_0xede778,_0x3be809);_0x4e2e4c(_0x3be809);});});}function respondWithStatusCode(_0x2a9296,_0x53dfc1){_0x53dfc1=_0x53dfc1||0xcc;return function(_0x292567){if(_0x292567){return _0x2a9296['sendStatus'](_0x53dfc1);}return _0x2a9296['status'](_0x53dfc1)[_0x2ca5('0x29')]();};}function respondWithResult(_0x333f89,_0x12ae7f){_0x12ae7f=_0x12ae7f||0xc8;return function(_0xf0119){if(_0xf0119){return _0x333f89[_0x2ca5('0x2a')](_0x12ae7f)['json'](_0xf0119);}};}function respondWithFilteredResult(_0x12f410,_0xc3920){return function(_0x336ab2){if(_0x336ab2){var _0x41fb84=typeof _0xc3920[_0x2ca5('0x2b')]===_0x2ca5('0x2c')&&typeof _0xc3920[_0x2ca5('0x2d')]===_0x2ca5('0x2c');var _0x484d3c=_0x336ab2[_0x2ca5('0x2e')];var _0x592964=_0x41fb84?0x0:_0xc3920[_0x2ca5('0x2b')];var _0x2d450c=_0x41fb84?_0x336ab2[_0x2ca5('0x2e')]:_0xc3920[_0x2ca5('0x2b')]+_0xc3920[_0x2ca5('0x2d')];var _0x5f1e6b;if(_0x2d450c>=_0x484d3c){_0x2d450c=_0x484d3c;_0x5f1e6b=0xc8;}else{_0x5f1e6b=0xce;}_0x12f410[_0x2ca5('0x2a')](_0x5f1e6b);return _0x12f410['set'](_0x2ca5('0x2f'),_0x592964+'-'+_0x2d450c+'/'+_0x484d3c)[_0x2ca5('0x30')](_0x336ab2);}return null;};}function patchUpdates(_0x119f94){return function(_0x576915){try{jsonpatch['apply'](_0x576915,_0x119f94,!![]);}catch(_0x5b8106){return BPromise['reject'](_0x5b8106);}return _0x576915[_0x2ca5('0x31')]();};}function saveUpdates(_0xea4d9c,_0x929899){return function(_0x519981){if(_0x519981){return _0x519981[_0x2ca5('0x32')](_0xea4d9c)['then'](function(_0x59a941){return _0x59a941;});}return null;};}function removeEntity(_0xdef9a2,_0xc7b308){return function(_0x26e7db){if(_0x26e7db){return _0x26e7db['destroy']()[_0x2ca5('0x1f')](function(){_0xdef9a2['status'](0xcc)[_0x2ca5('0x29')]();});}};}function handleEntityNotFound(_0x39efda,_0x1d831b){return function(_0x23b13d){if(!_0x23b13d){_0x39efda[_0x2ca5('0x33')](0x194);}return _0x23b13d;};}function handleError(_0x2df45e,_0x58fe8f){_0x58fe8f=_0x58fe8f||0x1f4;return function(_0x2ce0a7){logger[_0x2ca5('0x24')](_0x2ce0a7[_0x2ca5('0x34')]);if(_0x2ce0a7[_0x2ca5('0x35')]){delete _0x2ce0a7['name'];}_0x2df45e[_0x2ca5('0x2a')](_0x58fe8f)[_0x2ca5('0x36')](_0x2ce0a7);};}exports[_0x2ca5('0x37')]=function(_0x124a8a,_0x56e541){var _0x239c75={},_0x5d00d1={},_0x44c868={'count':0x0,'rows':[]};var _0x2314f0=_[_0x2ca5('0x38')](db[_0x2ca5('0x39')][_0x2ca5('0x3a')],function(_0x19c28b){return{'name':_0x19c28b[_0x2ca5('0x3b')],'type':_0x19c28b['type'][_0x2ca5('0x3c')]};});_0x5d00d1[_0x2ca5('0x3d')]=_[_0x2ca5('0x38')](_0x2314f0,'name');_0x5d00d1['query']=_[_0x2ca5('0x3e')](_0x124a8a[_0x2ca5('0x3f')]);_0x5d00d1[_0x2ca5('0x40')]=_[_0x2ca5('0x41')](_0x5d00d1[_0x2ca5('0x3d')],_0x5d00d1['query']);_0x239c75[_0x2ca5('0x42')]=_[_0x2ca5('0x41')](_0x5d00d1['model'],qs[_0x2ca5('0x43')](_0x124a8a[_0x2ca5('0x3f')][_0x2ca5('0x43')]));_0x239c75[_0x2ca5('0x42')]=_0x239c75['attributes']['length']?_0x239c75[_0x2ca5('0x42')]:_0x5d00d1[_0x2ca5('0x3d')];if(!_0x124a8a[_0x2ca5('0x3f')][_0x2ca5('0x44')](_0x2ca5('0x45'))){_0x239c75[_0x2ca5('0x2d')]=qs[_0x2ca5('0x2d')](_0x124a8a[_0x2ca5('0x3f')][_0x2ca5('0x2d')]);_0x239c75['offset']=qs[_0x2ca5('0x2b')](_0x124a8a['query'][_0x2ca5('0x2b')]);}_0x239c75['order']=qs[_0x2ca5('0x46')](_0x124a8a['query'][_0x2ca5('0x46')]);_0x239c75['where']=qs[_0x2ca5('0x40')](_['pick'](_0x124a8a[_0x2ca5('0x3f')],_0x5d00d1[_0x2ca5('0x40')]),_0x2314f0);if(_0x124a8a[_0x2ca5('0x3f')][_0x2ca5('0x47')]){_0x239c75[_0x2ca5('0x48')]=_['merge'](_0x239c75[_0x2ca5('0x48')],{'$or':_['map'](_0x2314f0,function(_0x566483){if(_0x566483['type']!==_0x2ca5('0x49')){var _0x4201fb={};_0x4201fb[_0x566483[_0x2ca5('0x35')]]={'$like':'%'+_0x124a8a[_0x2ca5('0x3f')][_0x2ca5('0x47')]+'%'};return _0x4201fb;}})});}_0x239c75=_[_0x2ca5('0x4a')]({},_0x239c75,_0x124a8a[_0x2ca5('0x4b')]);var _0x174a2f={'where':_0x239c75[_0x2ca5('0x48')]};return db[_0x2ca5('0x39')][_0x2ca5('0x2e')](_0x174a2f)[_0x2ca5('0x1f')](function(_0x42c081){_0x44c868[_0x2ca5('0x2e')]=_0x42c081;if(_0x124a8a[_0x2ca5('0x3f')][_0x2ca5('0x4c')]){_0x239c75[_0x2ca5('0x4d')]=[{'all':!![]}];}return db[_0x2ca5('0x39')][_0x2ca5('0x4e')](_0x239c75);})[_0x2ca5('0x1f')](function(_0x43e057){_0x44c868[_0x2ca5('0x4f')]=_0x43e057;return _0x44c868;})['then'](respondWithFilteredResult(_0x56e541,_0x239c75))[_0x2ca5('0x28')](handleError(_0x56e541,null));};exports[_0x2ca5('0x50')]=function(_0x177513,_0x440438){var _0x47dbfb={'raw':!![],'where':{'id':_0x177513[_0x2ca5('0x51')]['id']}},_0x2c9305={};_0x2c9305['model']=_[_0x2ca5('0x3e')](db['ChatMessage'][_0x2ca5('0x3a')]);_0x2c9305[_0x2ca5('0x3f')]=_['keys'](_0x177513[_0x2ca5('0x3f')]);_0x2c9305[_0x2ca5('0x40')]=_[_0x2ca5('0x41')](_0x2c9305[_0x2ca5('0x3d')],_0x2c9305['query']);_0x47dbfb[_0x2ca5('0x42')]=_[_0x2ca5('0x41')](_0x2c9305[_0x2ca5('0x3d')],qs['fields'](_0x177513['query']['fields']));_0x47dbfb[_0x2ca5('0x42')]=_0x47dbfb['attributes']['length']?_0x47dbfb[_0x2ca5('0x42')]:_0x2c9305[_0x2ca5('0x3d')];if(_0x177513['query'][_0x2ca5('0x4c')]){_0x47dbfb[_0x2ca5('0x4d')]=[{'all':!![]}];}_0x47dbfb=_[_0x2ca5('0x4a')]({},_0x47dbfb,_0x177513[_0x2ca5('0x4b')]);return db['ChatMessage'][_0x2ca5('0x52')](_0x47dbfb)['then'](handleEntityNotFound(_0x440438,null))[_0x2ca5('0x1f')](respondWithResult(_0x440438,null))['catch'](handleError(_0x440438,null));};exports['create']=function(_0x17a9e2,_0x4c2510){return db['ChatMessage'][_0x2ca5('0x53')](_0x17a9e2[_0x2ca5('0x54')],{})['then'](respondWithResult(_0x4c2510,0xc9))[_0x2ca5('0x28')](handleError(_0x4c2510,null));};exports[_0x2ca5('0x32')]=function(_0x3f9fce,_0x5b6df2){if(_0x3f9fce['body']['id']){delete _0x3f9fce[_0x2ca5('0x54')]['id'];}return db['ChatMessage'][_0x2ca5('0x52')]({'where':{'id':_0x3f9fce[_0x2ca5('0x51')]['id']}})['then'](handleEntityNotFound(_0x5b6df2,null))[_0x2ca5('0x1f')](saveUpdates(_0x3f9fce['body'],null))[_0x2ca5('0x1f')](respondWithResult(_0x5b6df2,null))[_0x2ca5('0x28')](handleError(_0x5b6df2,null));};exports[_0x2ca5('0x55')]=function(_0x334166,_0x1fd6da){return db[_0x2ca5('0x39')]['find']({'where':{'id':_0x334166[_0x2ca5('0x51')]['id']}})[_0x2ca5('0x1f')](handleEntityNotFound(_0x1fd6da,null))[_0x2ca5('0x1f')](removeEntity(_0x1fd6da,null))[_0x2ca5('0x28')](handleError(_0x1fd6da,null));};exports[_0x2ca5('0x56')]=function(_0x2cdcef,_0xd7c5ab){return db[_0x2ca5('0x39')][_0x2ca5('0x56')]()[_0x2ca5('0x1f')](respondWithResult(_0xd7c5ab,null))['catch'](handleError(_0xd7c5ab,null));};var interaction_log=require(_0x2ca5('0x14'))('chat-interactions');exports['accept']=function(_0x48ae13,_0x243d1d,_0xfb8589){var _0x4c58d7={'agent':{},'channel':_0x2ca5('0x57')};if(_0x48ae13[_0x2ca5('0x54')]['id']){delete _0x48ae13['body']['id'];}_0x48ae13[_0x2ca5('0x54')][_0x2ca5('0x58')]=!![];_0x48ae13[_0x2ca5('0x54')][_0x2ca5('0x59')]=moment()[_0x2ca5('0x5a')](_0x2ca5('0x5b'));_0x48ae13[_0x2ca5('0x54')][_0x2ca5('0x5c')]=_0x48ae13['body']['UserId']||_0x48ae13[_0x2ca5('0x5d')]['id'];_0x4c58d7[_0x2ca5('0x5e')]['id']=_0x48ae13['body']['UserId'];return db[_0x2ca5('0x39')][_0x2ca5('0x52')]({'where':{'id':_0x48ae13[_0x2ca5('0x51')]['id'],'UserId':null}})[_0x2ca5('0x1f')](handleEntityNotFound(_0x243d1d,null))['then'](saveUpdates(_0x48ae13[_0x2ca5('0x54')],null))[_0x2ca5('0x1f')](function(_0x4634c5){if(_0x4634c5){_0x4c58d7['message']=_0x4634c5[_0x2ca5('0x5f')]({'plain':!![]});return db[_0x2ca5('0x60')][_0x2ca5('0x52')]({'where':{'id':_0x4634c5[_0x2ca5('0x61')]}});}return null;})[_0x2ca5('0x1f')](handleEntityNotFound(_0x243d1d,null))[_0x2ca5('0x1f')](function(_0x2ae0fa){if(_0x2ae0fa){return _0x2ae0fa[_0x2ca5('0x32')]({'UserId':_0x48ae13[_0x2ca5('0x54')][_0x2ca5('0x5c')],'read1stAt':_[_0x2ca5('0x62')](_0x2ae0fa['read1stAt'])?moment()[_0x2ca5('0x5a')](_0x2ca5('0x5b')):undefined});}return null;})['then'](function(_0x1dc608){if(_0x1dc608){_0x4c58d7[_0x2ca5('0x63')]=_0x1dc608[_0x2ca5('0x5f')]({'plain':!![]});interaction_log[_0x2ca5('0x20')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x48ae13[_0x2ca5('0x5d')]['id'],_0x48ae13[_0x2ca5('0x5d')][_0x2ca5('0x35')],_0x48ae13[_0x2ca5('0x5d')][_0x2ca5('0x64')],_0x4c58d7[_0x2ca5('0x63')]['id'],_0x48ae13[_0x2ca5('0x54')]?JSON['stringify'](_0x48ae13[_0x2ca5('0x54')]):_0x2ca5('0x65'));return respondWithRpcPromise(_0x2ca5('0x66'),_0x2ca5('0x67'),_0x4c58d7);}return null;})[_0x2ca5('0x1f')](function(_0x49d7ed){var _0xa9847c=_0x2ca5('0x68')+_0x49d7ed[_0x2ca5('0x25')][_0x2ca5('0x69')];return db[_0x2ca5('0x6a')][_0x2ca5('0x3f')](_0xa9847c,{'type':db[_0x2ca5('0x6b')][_0x2ca5('0x6c')]['SELECT'],'raw':!![]})[_0x2ca5('0x1f')](function(_0x261ae3){return _0x261ae3;});})[_0x2ca5('0x1f')](function(_0x4f6c77){if(_0x4f6c77){_0x4c58d7[_0x2ca5('0x25')][_0x2ca5('0x6d')]=_0x4f6c77[0x0];if(!_0x48ae13[_0x2ca5('0x54')][_0x2ca5('0x5c')])return;return db[_0x2ca5('0x6e')]['find']({'where':{'id':_0x48ae13[_0x2ca5('0x54')][_0x2ca5('0x5c')],'role':_0x2ca5('0x5e')},'attributes':['id',_0x2ca5('0x35'),'fullname','email',_0x2ca5('0x6f')],'raw':!![]});}return null;})['then'](function(_0x1e57d5){if(!_0x1e57d5)return null;_0x4c58d7[_0x2ca5('0x25')][_0x2ca5('0x5e')]=_0x1e57d5;return _0x4c58d7;})[_0x2ca5('0x1f')](function(_0x13f122){if(_0x13f122){if(_0x48ae13[_0x2ca5('0x54')][_0x2ca5('0x70')]){_0x4c58d7[_0x2ca5('0x25')]['interface']=util[_0x2ca5('0x5a')](_0x2ca5('0x71'),_0x48ae13['user'][_0x2ca5('0x35')]);_0x4c58d7[_0x2ca5('0x25')][_0x2ca5('0x72')]=_0x4c58d7[_0x2ca5('0x72')];_0x4c58d7[_0x2ca5('0x25')][_0x2ca5('0x73')]=_0x4c58d7[_0x2ca5('0x72')];_0x4c58d7['message'][_0x2ca5('0x74')]=_0x2ca5('0x75');return respondWithRpcPromise(_0x2ca5('0x76'),_0x2ca5('0x76'),{'event':_0x2ca5('0x77'),'message':_[_0x2ca5('0x4a')](_0x4c58d7[_0x2ca5('0x25')],JSON[_0x2ca5('0x78')](_0x4c58d7[_0x2ca5('0x63')]['formData']))},client9002)['then'](function(){return _0x4c58d7;});}return _0x4c58d7;}return null;})[_0x2ca5('0x1f')](respondWithResult(_0x243d1d,null))[_0x2ca5('0x28')](handleError(_0x243d1d,null));};var interaction_log=require(_0x2ca5('0x14'))(_0x2ca5('0x79'));exports[_0x2ca5('0x7a')]=function(_0x4c6e49,_0x104ead,_0x5ad1be){var _0x5a12f2={'agent':{},'channel':_0x2ca5('0x57')};if(_0x4c6e49['body']['id']){delete _0x4c6e49[_0x2ca5('0x54')]['id'];}_0x4c6e49['body'][_0x2ca5('0x5c')]=_0x4c6e49[_0x2ca5('0x54')][_0x2ca5('0x5c')]||_0x4c6e49['user']['id'];_0x5a12f2[_0x2ca5('0x5e')]['id']=_0x4c6e49[_0x2ca5('0x54')][_0x2ca5('0x5c')];return db[_0x2ca5('0x39')][_0x2ca5('0x52')]({'where':{'id':_0x4c6e49[_0x2ca5('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x104ead,null))[_0x2ca5('0x1f')](function(_0x5af326){if(_0x5af326){_0x5a12f2[_0x2ca5('0x25')]=_0x5af326[_0x2ca5('0x5f')]({'plain':!![]});return db[_0x2ca5('0x60')][_0x2ca5('0x52')]({'where':{'id':_0x5af326[_0x2ca5('0x61')]}});}return null;})[_0x2ca5('0x1f')](handleEntityNotFound(_0x104ead,null))[_0x2ca5('0x1f')](function(_0x18738b){if(_0x18738b){_0x5a12f2[_0x2ca5('0x63')]=_0x18738b[_0x2ca5('0x5f')]({'plain':!![]});interaction_log[_0x2ca5('0x20')](_0x2ca5('0x7b'),_0x4c6e49[_0x2ca5('0x5d')]['id'],_0x4c6e49[_0x2ca5('0x5d')][_0x2ca5('0x35')],_0x4c6e49['user'][_0x2ca5('0x64')],_0x5a12f2[_0x2ca5('0x63')]['id'],_0x4c6e49[_0x2ca5('0x54')]?JSON[_0x2ca5('0x23')](_0x4c6e49['body']):_0x2ca5('0x65'));return respondWithRpcPromise('RejectMessage',_0x2ca5('0x7c'),_0x5a12f2);}return null;})['then'](function(_0x3075aa){var _0x21190d=_0x2ca5('0x68')+_0x3075aa['message'][_0x2ca5('0x69')];return db[_0x2ca5('0x6a')][_0x2ca5('0x3f')](_0x21190d,{'type':db[_0x2ca5('0x6b')][_0x2ca5('0x6c')][_0x2ca5('0x7d')],'raw':!![]})['then'](function(_0x257614){return _0x257614;});})[_0x2ca5('0x1f')](function(_0x4b6a0f){if(_0x4b6a0f){_0x5a12f2[_0x2ca5('0x25')][_0x2ca5('0x6d')]=_0x4b6a0f[0x0];if(!_0x4c6e49[_0x2ca5('0x54')][_0x2ca5('0x5c')])return;return db[_0x2ca5('0x6e')][_0x2ca5('0x52')]({'where':{'id':_0x4c6e49['body']['UserId'],'role':'agent'},'attributes':['id',_0x2ca5('0x35'),_0x2ca5('0x7e'),_0x2ca5('0x7f'),_0x2ca5('0x6f')],'raw':!![]});}return null;})[_0x2ca5('0x1f')](function(_0x42f2a6){if(!_0x42f2a6)return null;_0x5a12f2[_0x2ca5('0x25')][_0x2ca5('0x5e')]=_0x42f2a6;return _0x5a12f2;})[_0x2ca5('0x1f')](function(_0x28d618){if(_0x28d618){_0x28d618[_0x2ca5('0x25')][_0x2ca5('0x80')]=util[_0x2ca5('0x5a')](_0x2ca5('0x71'),_0x4c6e49[_0x2ca5('0x5d')][_0x2ca5('0x35')]);_0x28d618[_0x2ca5('0x25')]['channel']=_0x5a12f2[_0x2ca5('0x72')];_0x28d618[_0x2ca5('0x25')]['motionChannel']=_0x5a12f2[_0x2ca5('0x72')];_0x28d618['message'][_0x2ca5('0x74')]='reject';respondWithRpcPromise(_0x2ca5('0x76'),'EventManager',{'event':'rejectmessage','message':_[_0x2ca5('0x4a')](_0x5a12f2['message'],JSON['parse'](_0x5a12f2[_0x2ca5('0x63')][_0x2ca5('0x81')]))},client9002);return _0x5a12f2;}return null;})[_0x2ca5('0x1f')](respondWithResult(_0x104ead,null))['catch'](handleError(_0x104ead,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index ade88bb..5b135c3 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 _0x9db1=['emit','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x17babc,_0x5c68f3){var _0x2bb70b=function(_0x428fdd){while(--_0x428fdd){_0x17babc['push'](_0x17babc['shift']());}};_0x2bb70b(++_0x5c68f3);}(_0x9db1,0x142));var _0x19db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9db1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x19db('0x0'));var ChatMessage=require(_0x19db('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x19db('0x2')](0x0);var events={'afterCreate':_0x19db('0x3'),'afterUpdate':_0x19db('0x4'),'afterDestroy':_0x19db('0x5')};function emitEvent(_0x185178){return function(_0x19d39a,_0x39a20b,_0x232b51){ChatMessageEvents[_0x19db('0x6')](_0x185178+':'+_0x19d39a['id'],_0x19d39a);ChatMessageEvents[_0x19db('0x6')](_0x185178,_0x19d39a);_0x232b51(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x19db('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0xce5a=['hook','exports','../../mysqldb','ChatMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0xb113d7,_0x2fc306){var _0xd5a08d=function(_0x873634){while(--_0x873634){_0xb113d7['push'](_0xb113d7['shift']());}};_0xd5a08d(++_0x2fc306);}(_0xce5a,0xfe));var _0xace5=function(_0x5951e8,_0x42b9a7){_0x5951e8=_0x5951e8-0x0;var _0x20a1f5=_0xce5a[_0x5951e8];return _0x20a1f5;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xace5('0x0'))['db'][_0xace5('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xace5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xace5('0x3'),'afterDestroy':_0xace5('0x4')};function emitEvent(_0x5f19f0){return function(_0x1b43ac,_0x463116,_0x53a469){ChatMessageEvents[_0xace5('0x5')](_0x5f19f0+':'+_0x1b43ac['id'],_0x1b43ac);ChatMessageEvents[_0xace5('0x5')](_0x5f19f0,_0x1b43ac);_0x53a469(null);};}for(var e in events){if(events[_0xace5('0x6')](e)){var event=events[e];ChatMessage[_0xace5('0x7')](e,emitEvent(event));}}module[_0xace5('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index fd90f7d..dc3ccc6 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 _0x69e5=['direction','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','toLowerCase'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x69e5,0x123));var _0x569e=function(_0x4d521e,_0x58ba39){_0x4d521e=_0x4d521e-0x0;var _0x3beb42=_0x69e5[_0x4d521e];return _0x3beb42;};'use strict';var _=require(_0x569e('0x0'));var util=require(_0x569e('0x1'));var logger=require(_0x569e('0x2'))(_0x569e('0x3'));var moment=require(_0x569e('0x4'));var BPromise=require(_0x569e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x569e('0x6'));var rimraf=require(_0x569e('0x7'));var config=require(_0x569e('0x8'));var attributes=require(_0x569e('0x9'));module[_0x569e('0xa')]=function(_0x599a33,_0x4642a1){return _0x599a33[_0x569e('0xb')](_0x569e('0xc'),attributes,{'tableName':_0x569e('0xd'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x569e('0xe')],'type':_0x569e('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x762a2c,_0x34654a,_0x483674){var _0x4945b9=_0x599a33[_0x569e('0x10')];var _0x3fb853=_0x762a2c[_0x569e('0x11')]({'plain':!![]});if(_0x3fb853['direction'][_0x569e('0x12')]()==='in'||_0x3fb853[_0x569e('0x13')][_0x569e('0x12')]()===_0x569e('0x14')&&!_0x3fb853['secret']&&!_[_0x569e('0x15')](_0x3fb853[_0x569e('0x16')])){_0x4945b9[_0x569e('0x17')][_0x569e('0x18')]({'where':{'id':_0x3fb853[_0x569e('0x19')]}})[_0x569e('0x1a')](function(_0xe42b1a){if(_0xe42b1a){_0xe42b1a['update']({'lastMsgAt':_0x3fb853[_0x569e('0x1b')],'lastMsgDirection':_0x3fb853[_0x569e('0x13')]['toLowerCase']()});}})[_0x569e('0x1c')](function(_0x1ac433){console[_0x569e('0x1d')](_0x1ac433);});}_0x483674();}},'charset':_0x569e('0x1e'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xdec1=['ChatInteractionId','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne'];(function(_0x26073a,_0x4652df){var _0x2ab2ad=function(_0x4a378e){while(--_0x4a378e){_0x26073a['push'](_0x26073a['shift']());}};_0x2ab2ad(++_0x4652df);}(_0xdec1,0x11d));var _0x1dec=function(_0x2c2784,_0x36faed){_0x2c2784=_0x2c2784-0x0;var _0x1a8b32=_0xdec1[_0x2c2784];return _0x1a8b32;};'use strict';var _=require(_0x1dec('0x0'));var util=require('util');var logger=require(_0x1dec('0x1'))(_0x1dec('0x2'));var moment=require(_0x1dec('0x3'));var BPromise=require(_0x1dec('0x4'));var rp=require(_0x1dec('0x5'));var fs=require('fs');var path=require(_0x1dec('0x6'));var rimraf=require(_0x1dec('0x7'));var config=require(_0x1dec('0x8'));var attributes=require(_0x1dec('0x9'));module[_0x1dec('0xa')]=function(_0x8f8be1,_0x108f91){return _0x8f8be1[_0x1dec('0xb')](_0x1dec('0xc'),attributes,{'tableName':_0x1dec('0xd'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x1dec('0xe')],'type':_0x1dec('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49420c,_0x2eca5c,_0x12f4ef){var _0x3aa428=_0x8f8be1[_0x1dec('0x10')];var _0x4c1222=_0x49420c[_0x1dec('0x11')]({'plain':!![]});if(_0x4c1222[_0x1dec('0x12')][_0x1dec('0x13')]()==='in'||_0x4c1222[_0x1dec('0x12')][_0x1dec('0x13')]()==='out'&&!_0x4c1222[_0x1dec('0x14')]&&!_[_0x1dec('0x15')](_0x4c1222[_0x1dec('0x16')])){_0x3aa428[_0x1dec('0x17')][_0x1dec('0x18')]({'where':{'id':_0x4c1222[_0x1dec('0x19')]}})['then'](function(_0x3c1fa5){if(_0x3c1fa5){_0x3c1fa5['update']({'lastMsgAt':_0x4c1222[_0x1dec('0x1a')],'lastMsgDirection':_0x4c1222[_0x1dec('0x12')][_0x1dec('0x13')]()});}})[_0x1dec('0x1b')](function(_0x22656d){console[_0x1dec('0x1c')](_0x22656d);});}_0x12f4ef();}},'charset':_0x1dec('0x1d'),'collate':_0x1dec('0x1e')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 9313124..ce2e30d 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 _0x612a=['body','options','raw','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','CreateChatMessage','ChatMessage','create'];(function(_0x26e8bf,_0x5054d7){var _0x15a67b=function(_0x329fd3){while(--_0x329fd3){_0x26e8bf['push'](_0x26e8bf['shift']());}};_0x15a67b(++_0x5054d7);}(_0x612a,0xa4));var _0xa612=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0x612a[_0x52e363];return _0x3fc2b5;};'use strict';var _=require('lodash');var util=require(_0xa612('0x0'));var moment=require(_0xa612('0x1'));var BPromise=require(_0xa612('0x2'));var rs=require(_0xa612('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa612('0x4'))['db'];var utils=require(_0xa612('0x5'));var logger=require(_0xa612('0x6'))(_0xa612('0x7'));var config=require(_0xa612('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa612('0x9')][_0xa612('0xa')]({'port':0x232a});config[_0xa612('0xb')]=_[_0xa612('0xc')](config[_0xa612('0xb')],{'host':_0xa612('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0xa612('0xe')](socket);function respondWithRpcPromise(_0x1bbe8f,_0x505311,_0x2fff63){return new BPromise(function(_0x423cf8,_0x1c3cc8){return client[_0xa612('0xf')](_0x1bbe8f,_0x2fff63)[_0xa612('0x10')](function(_0x555ccb){logger[_0xa612('0x11')](_0xa612('0x12'),_0x505311,_0xa612('0x13'));logger[_0xa612('0x14')](_0xa612('0x15'),_0x505311,_0xa612('0x13'),JSON[_0xa612('0x16')](_0x555ccb));if(_0x555ccb[_0xa612('0x17')]){if(_0x555ccb[_0xa612('0x17')]['code']===0x1f4){logger[_0xa612('0x17')]('ChatMessage,\x20%s,\x20%s',_0x505311,_0x555ccb[_0xa612('0x17')]['message']);return _0x1c3cc8(_0x555ccb[_0xa612('0x17')][_0xa612('0x18')]);}logger[_0xa612('0x17')](_0xa612('0x12'),_0x505311,_0x555ccb[_0xa612('0x17')]['message']);return _0x423cf8(_0x555ccb['error'][_0xa612('0x18')]);}else{logger[_0xa612('0x11')](_0xa612('0x12'),_0x505311,_0xa612('0x13'));_0x423cf8(_0x555ccb['result']['message']);}})['catch'](function(_0x4df57c){logger[_0xa612('0x17')]('ChatMessage,\x20%s,\x20%s',_0x505311,_0x4df57c);_0x1c3cc8(_0x4df57c);});});}exports[_0xa612('0x19')]=function(_0x3de6f9){var _0x516221=this;return new Promise(function(_0x33de7d,_0x53d2d7){return db[_0xa612('0x1a')][_0xa612('0x1b')](_0x3de6f9[_0xa612('0x1c')],{'raw':_0x3de6f9[_0xa612('0x1d')]?_0x3de6f9[_0xa612('0x1d')][_0xa612('0x1e')]===undefined?!![]:![]:!![]})[_0xa612('0x10')](function(_0x4221b2){logger[_0xa612('0x11')](_0xa612('0x19'),_0x3de6f9);logger[_0xa612('0x14')](_0xa612('0x19'),_0x3de6f9,JSON[_0xa612('0x16')](_0x4221b2));_0x33de7d(_0x4221b2);})[_0xa612('0x1f')](function(_0x1409b8){logger[_0xa612('0x17')](_0xa612('0x19'),_0x1409b8[_0xa612('0x18')],_0x3de6f9);_0x53d2d7(_0x516221[_0xa612('0x17')](0x1f4,_0x1409b8[_0xa612('0x18')]));});});};
\ No newline at end of file
+var _0x26e4=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateChatMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x57c067,_0x147938){var _0x1fb541=function(_0x34fa73){while(--_0x34fa73){_0x57c067['push'](_0x57c067['shift']());}};_0x1fb541(++_0x147938);}(_0x26e4,0xe1));var _0x426e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x26e4[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x426e('0x0'));var util=require('util');var moment=require(_0x426e('0x1'));var BPromise=require(_0x426e('0x2'));var rs=require(_0x426e('0x3'));var fs=require('fs');var Redis=require(_0x426e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x426e('0x5'));var logger=require(_0x426e('0x6'))(_0x426e('0x7'));var config=require(_0x426e('0x8'));var jayson=require(_0x426e('0x9'));var client=jayson[_0x426e('0xa')][_0x426e('0xb')]({'port':0x232a});config[_0x426e('0xc')]=_[_0x426e('0xd')](config[_0x426e('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x426e('0xe'))[_0x426e('0xf')](socket);function respondWithRpcPromise(_0xa1bffd,_0x218bed,_0x4fc6c7){return new BPromise(function(_0xde24ff,_0x37350c){return client[_0x426e('0x10')](_0xa1bffd,_0x4fc6c7)[_0x426e('0x11')](function(_0x458af8){logger['info'](_0x426e('0x12'),_0x218bed,_0x426e('0x13'));logger[_0x426e('0x14')](_0x426e('0x15'),_0x218bed,_0x426e('0x13'),JSON['stringify'](_0x458af8));if(_0x458af8[_0x426e('0x16')]){if(_0x458af8['error'][_0x426e('0x17')]===0x1f4){logger[_0x426e('0x16')]('ChatMessage,\x20%s,\x20%s',_0x218bed,_0x458af8[_0x426e('0x16')][_0x426e('0x18')]);return _0x37350c(_0x458af8['error']['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x218bed,_0x458af8[_0x426e('0x16')][_0x426e('0x18')]);return _0xde24ff(_0x458af8[_0x426e('0x16')][_0x426e('0x18')]);}else{logger[_0x426e('0x19')](_0x426e('0x12'),_0x218bed,_0x426e('0x13'));_0xde24ff(_0x458af8[_0x426e('0x1a')][_0x426e('0x18')]);}})[_0x426e('0x1b')](function(_0x39322d){logger[_0x426e('0x16')](_0x426e('0x12'),_0x218bed,_0x39322d);_0x37350c(_0x39322d);});});}exports[_0x426e('0x1c')]=function(_0x486701){var _0x119cb8=this;return new Promise(function(_0x11a096,_0x23b031){return db['ChatMessage'][_0x426e('0x1d')](_0x486701[_0x426e('0x1e')],{'raw':_0x486701[_0x426e('0x1f')]?_0x486701[_0x426e('0x1f')][_0x426e('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x51cff4){logger[_0x426e('0x19')]('CreateChatMessage',_0x486701);logger['debug'](_0x426e('0x1c'),_0x486701,JSON['stringify'](_0x51cff4));_0x11a096(_0x51cff4);})[_0x426e('0x1b')](function(_0x218024){logger[_0x426e('0x16')](_0x426e('0x1c'),_0x218024[_0x426e('0x18')],_0x486701);_0x23b031(_0x119cb8[_0x426e('0x16')](0x1f4,_0x218024[_0x426e('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 4cfe8fe..ee852c2 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 _0xee14=['length','chatMessage:','remove','update','emit','removeListener'];(function(_0x38a660,_0x3a6593){var _0x5a601c=function(_0x2190a8){while(--_0x2190a8){_0x38a660['push'](_0x38a660['shift']());}};_0x5a601c(++_0x3a6593);}(_0xee14,0x13a));var _0x4ee1=function(_0x52021d,_0x1f0186){_0x52021d=_0x52021d-0x0;var _0x349db=_0xee14[_0x52021d];return _0x349db;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x4ee1('0x0'),_0x4ee1('0x1')];function createListener(_0x34e49d,_0x1fa407){return function(_0x18e3c4){_0x1fa407[_0x4ee1('0x2')](_0x34e49d,_0x18e3c4);};}function removeListener(_0x34a0ae,_0x1e5fb6){return function(){ChatMessageEvents[_0x4ee1('0x3')](_0x34a0ae,_0x1e5fb6);};}exports['register']=function(_0xba6d36){for(var _0x573700=0x0,_0x327c18=events[_0x4ee1('0x4')];_0x573700<_0x327c18;_0x573700++){var _0x187656=events[_0x573700];var _0x293d5f=createListener(_0x4ee1('0x5')+_0x187656,_0xba6d36);ChatMessageEvents['on'](_0x187656,_0x293d5f);}};
\ No newline at end of file
+var _0x7da7=['save','remove','register','chatMessage:','./chatMessage.events'];(function(_0x78dc83,_0x3c0e2f){var _0x6532ee=function(_0x247a8f){while(--_0x247a8f){_0x78dc83['push'](_0x78dc83['shift']());}};_0x6532ee(++_0x3c0e2f);}(_0x7da7,0x10d));var _0x77da=function(_0x3a21c0,_0x348451){_0x3a21c0=_0x3a21c0-0x0;var _0x411e84=_0x7da7[_0x3a21c0];return _0x411e84;};'use strict';var ChatMessageEvents=require(_0x77da('0x0'));var events=[_0x77da('0x1'),_0x77da('0x2'),'update'];function createListener(_0x59892b,_0x37667b){return function(_0xaaefb1){_0x37667b['emit'](_0x59892b,_0xaaefb1);};}function removeListener(_0x3a9fa6,_0x37b3d9){return function(){ChatMessageEvents['removeListener'](_0x3a9fa6,_0x37b3d9);};}exports[_0x77da('0x3')]=function(_0xc54a12){for(var _0x47da81=0x0,_0x30afe0=events['length'];_0x47da81<_0x30afe0;_0x47da81++){var _0x1191de=events[_0x47da81];var _0x13992e=createListener(_0x77da('0x4')+_0x1191de,_0xc54a12);ChatMessageEvents['on'](_0x1191de,_0x13992e);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 3cee03e..372c111 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 _0xa079=['create','put','update','/:id/accept','accept','/:id/reject','delete','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','show','tracked','chat'];(function(_0x42b1f6,_0x3df91b){var _0x37ee4f=function(_0x55df2){while(--_0x55df2){_0x42b1f6['push'](_0x42b1f6['shift']());}};_0x37ee4f(++_0x3df91b);}(_0xa079,0x1b8));var _0x9a07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa079[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9a07('0x0'));var util=require(_0x9a07('0x1'));var path=require(_0x9a07('0x2'));var timeout=require('connect-timeout');var express=require(_0x9a07('0x3'));var router=express[_0x9a07('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9a07('0x5'));var config=require(_0x9a07('0x6'));var controller=require(_0x9a07('0x7'));router[_0x9a07('0x8')]('/',auth[_0x9a07('0x9')](),controller[_0x9a07('0xa')]);router[_0x9a07('0x8')](_0x9a07('0xb'),auth[_0x9a07('0x9')](),controller['describe']);router['get'](_0x9a07('0xc'),auth[_0x9a07('0x9')](),controller[_0x9a07('0xd')]);router['post']('/',auth[_0x9a07('0x9')](),interaction[_0x9a07('0xe')](_0x9a07('0xf'),'chatmessage:create'),controller[_0x9a07('0x10')]);router[_0x9a07('0x11')](_0x9a07('0xc'),controller[_0x9a07('0x12')]);router[_0x9a07('0x11')](_0x9a07('0x13'),auth['isAuthenticated'](),controller[_0x9a07('0x14')]);router[_0x9a07('0x11')](_0x9a07('0x15'),auth[_0x9a07('0x9')](),controller['reject']);router[_0x9a07('0x16')]('/:id',auth[_0x9a07('0x9')](),controller['destroy']);module[_0x9a07('0x17')]=router;
\ No newline at end of file
+var _0x958d=['accept','/:id/reject','reject','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','post','tracked','chat','create','put','update','/:id/accept'];(function(_0x14114a,_0x143008){var _0x212e1f=function(_0x15b714){while(--_0x15b714){_0x14114a['push'](_0x14114a['shift']());}};_0x212e1f(++_0x143008);}(_0x958d,0xb3));var _0xd958=function(_0xe4da3a,_0x701be1){_0xe4da3a=_0xe4da3a-0x0;var _0x53de02=_0x958d[_0xe4da3a];return _0x53de02;};'use strict';var multer=require(_0xd958('0x0'));var util=require(_0xd958('0x1'));var path=require(_0xd958('0x2'));var timeout=require('connect-timeout');var express=require(_0xd958('0x3'));var router=express[_0xd958('0x4')]();var fs_extra=require(_0xd958('0x5'));var auth=require(_0xd958('0x6'));var interaction=require(_0xd958('0x7'));var config=require('../../config/environment');var controller=require(_0xd958('0x8'));router[_0xd958('0x9')]('/',auth[_0xd958('0xa')](),controller[_0xd958('0xb')]);router[_0xd958('0x9')]('/describe',auth[_0xd958('0xa')](),controller[_0xd958('0xc')]);router['get'](_0xd958('0xd'),auth[_0xd958('0xa')](),controller['show']);router[_0xd958('0xe')]('/',auth[_0xd958('0xa')](),interaction[_0xd958('0xf')](_0xd958('0x10'),'chatmessage:create'),controller[_0xd958('0x11')]);router[_0xd958('0x12')]('/:id',controller[_0xd958('0x13')]);router['put'](_0xd958('0x14'),auth[_0xd958('0xa')](),controller[_0xd958('0x15')]);router[_0xd958('0x12')](_0xd958('0x16'),auth[_0xd958('0xa')](),controller[_0xd958('0x17')]);router[_0xd958('0x18')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index d767749..eddf552 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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3aaef5,_0x16cdc8){_0x3aaef5=_0x3aaef5-0x0;var _0x4c0ed5=_0x0b0e[_0x3aaef5];return _0x4c0ed5;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x47378a,_0x20bc70){var _0x120fdb=function(_0x2885ec){while(--_0x2885ec){_0x47378a['push'](_0x47378a['shift']());}};_0x120fdb(++_0x20bc70);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2f368d,_0x419bc2){_0x2f368d=_0x2f368d-0x0;var _0x14860b=_0x5f2f[_0x2f368d];return _0x14860b;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 2e6d01e..cd8641f 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(_0x5ba4c5,_0x4f3319){var _0x3209aa=function(_0x576cae){while(--_0x576cae){_0x5ba4c5['push'](_0x5ba4c5['shift']());}};_0x3209aa(++_0x4f3319);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+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(_0x540824,_0x3b1ae6){var _0x17134b=function(_0x2fec92){while(--_0x2fec92){_0x540824['push'](_0x540824['shift']());}};_0x17134b(++_0x3b1ae6);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index a4cbd84..b2d7d26 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3930=['hook','exports','../../mysqldb','setMaxListeners','update','emit'];(function(_0x1bb030,_0x27d05f){var _0x28ef4f=function(_0xb1150e){while(--_0xb1150e){_0x1bb030['push'](_0x1bb030['shift']());}};_0x28ef4f(++_0x27d05f);}(_0x3930,0x12e));var _0x0393=function(_0x3239f5,_0x50e77c){_0x3239f5=_0x3239f5-0x0;var _0x3559c8=_0x3930[_0x3239f5];return _0x3559c8;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x0393('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x0393('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0393('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1f9762){return function(_0x4da057,_0x4f603f,_0x288d3a){ChatOfflineMessageEvents[_0x0393('0x3')](_0x1f9762+':'+_0x4da057['id'],_0x4da057);ChatOfflineMessageEvents[_0x0393('0x3')](_0x1f9762,_0x4da057);_0x288d3a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x0393('0x4')](e,emitEvent(event));}}module[_0x0393('0x5')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x02b6=['hook','exports','events','ChatOfflineMessage','setMaxListeners','save','emit'];(function(_0x3194b5,_0x495239){var _0x50f2dc=function(_0x13abed){while(--_0x13abed){_0x3194b5['push'](_0x3194b5['shift']());}};_0x50f2dc(++_0x495239);}(_0x02b6,0xfe));var _0x602b=function(_0x3a5715,_0x3d13e6){_0x3a5715=_0x3a5715-0x0;var _0x3460a9=_0x02b6[_0x3a5715];return _0x3460a9;};'use strict';var EventEmitter=require(_0x602b('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x602b('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x602b('0x2')](0x0);var events={'afterCreate':_0x602b('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x8291f){return function(_0x31f4a4,_0x33cc82,_0x2eec97){ChatOfflineMessageEvents['emit'](_0x8291f+':'+_0x31f4a4['id'],_0x31f4a4);ChatOfflineMessageEvents[_0x602b('0x4')](_0x8291f,_0x31f4a4);_0x2eec97(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x602b('0x5')](e,emitEvent(event));}}module[_0x602b('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 86b3d98..6b0d17b 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 _0x279f=['exports','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x4839eb,_0x364008){var _0x2982e4=function(_0x4b370c){while(--_0x4b370c){_0x4839eb['push'](_0x4839eb['shift']());}};_0x2982e4(++_0x364008);}(_0x279f,0x18b));var _0xf279=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x279f[_0x1928c9];return _0x51b5fb;};'use strict';var attributes=require(_0xf279('0x0'));module[_0xf279('0x1')]=function(_0x379d6c){return _0x379d6c[_0xf279('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0xf279('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf279('0x4'),'collate':_0xf279('0x5')});};
\ No newline at end of file
+var _0xc998=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc998,0xe4));var _0x8c99=function(_0x28acd6,_0x1ea44b){_0x28acd6=_0x28acd6-0x0;var _0x49e00d=_0xc998[_0x28acd6];return _0x49e00d;};'use strict';var attributes=require(_0x8c99('0x0'));module[_0x8c99('0x1')]=function(_0x4d9209){return _0x4d9209[_0x8c99('0x2')](_0x8c99('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8c99('0x4'),'collate':_0x8c99('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index c6f042e..af7d13b 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 _0x3d32=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','../../mysqldb','../../config/utils','../../config/logger','rpc','client','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0x3d32,0x13c));var _0x23d3=function(_0x43e218,_0x41ef9b){_0x43e218=_0x43e218-0x0;var _0xf1d7e=_0x3d32[_0x43e218];return _0xf1d7e;};'use strict';var _=require(_0x23d3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23d3('0x1'))['db'];var utils=require(_0x23d3('0x2'));var logger=require(_0x23d3('0x3'))(_0x23d3('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x23d3('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14d62f,_0x5a2af9,_0x4c9b7f){return new BPromise(function(_0x5265d9,_0x39aa95){return client['request'](_0x14d62f,_0x4c9b7f)['then'](function(_0x426e17){logger[_0x23d3('0x6')](_0x23d3('0x7'),_0x5a2af9,_0x23d3('0x8'));logger['debug'](_0x23d3('0x9'),_0x5a2af9,_0x23d3('0x8'),JSON['stringify'](_0x426e17));if(_0x426e17[_0x23d3('0xa')]){if(_0x426e17['error']['code']===0x1f4){logger[_0x23d3('0xa')](_0x23d3('0x7'),_0x5a2af9,_0x426e17[_0x23d3('0xa')]['message']);return _0x39aa95(_0x426e17[_0x23d3('0xa')][_0x23d3('0xb')]);}logger[_0x23d3('0xa')](_0x23d3('0x7'),_0x5a2af9,_0x426e17[_0x23d3('0xa')][_0x23d3('0xb')]);return _0x5265d9(_0x426e17['error']['message']);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x5a2af9,_0x23d3('0x8'));_0x5265d9(_0x426e17['result'][_0x23d3('0xb')]);}})[_0x23d3('0xc')](function(_0xcb2a9){logger[_0x23d3('0xa')](_0x23d3('0x7'),_0x5a2af9,_0xcb2a9);_0x39aa95(_0xcb2a9);});});}
\ No newline at end of file
+var _0x9aed=['message','result','catch','moment','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x50ef26,_0x10e500){var _0x34c395=function(_0x53b312){while(--_0x53b312){_0x50ef26['push'](_0x50ef26['shift']());}};_0x34c395(++_0x10e500);}(_0x9aed,0x9c));var _0xd9ae=function(_0x43a464,_0xeea76d){_0x43a464=_0x43a464-0x0;var _0x38d98a=_0x9aed[_0x43a464];return _0x38d98a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd9ae('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9ae('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd9ae('0x2'))(_0xd9ae('0x3'));var config=require(_0xd9ae('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xd9ae('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39c9e7,_0x344903,_0xa638c9){return new BPromise(function(_0x2ec7a4,_0x243e6c){return client['request'](_0x39c9e7,_0xa638c9)[_0xd9ae('0x6')](function(_0x290eb3){logger[_0xd9ae('0x7')](_0xd9ae('0x8'),_0x344903,_0xd9ae('0x9'));logger['debug'](_0xd9ae('0xa'),_0x344903,_0xd9ae('0x9'),JSON[_0xd9ae('0xb')](_0x290eb3));if(_0x290eb3[_0xd9ae('0xc')]){if(_0x290eb3['error'][_0xd9ae('0xd')]===0x1f4){logger[_0xd9ae('0xc')](_0xd9ae('0x8'),_0x344903,_0x290eb3['error'][_0xd9ae('0xe')]);return _0x243e6c(_0x290eb3[_0xd9ae('0xc')][_0xd9ae('0xe')]);}logger['error'](_0xd9ae('0x8'),_0x344903,_0x290eb3['error'][_0xd9ae('0xe')]);return _0x2ec7a4(_0x290eb3[_0xd9ae('0xc')]['message']);}else{logger[_0xd9ae('0x7')]('ChatOfflineMessage,\x20%s,\x20%s',_0x344903,_0xd9ae('0x9'));_0x2ec7a4(_0x290eb3[_0xd9ae('0xf')][_0xd9ae('0xe')]);}})[_0xd9ae('0x10')](function(_0x46450e){logger[_0xd9ae('0xc')](_0xd9ae('0x8'),_0x344903,_0x46450e);_0x243e6c(_0x46450e);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 2f14270..b8cc221 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 _0xb9ea=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','destroy','exports','multer'];(function(_0x17a80c,_0xfad831){var _0x4d7e6b=function(_0x5739e6){while(--_0x5739e6){_0x17a80c['push'](_0x17a80c['shift']());}};_0x4d7e6b(++_0xfad831);}(_0xb9ea,0x131));var _0xab9e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb9ea[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xab9e('0x0'));var util=require('util');var path=require(_0xab9e('0x1'));var timeout=require('connect-timeout');var express=require(_0xab9e('0x2'));var router=express[_0xab9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xab9e('0x4'));var interaction=require(_0xab9e('0x5'));var config=require(_0xab9e('0x6'));var controller=require(_0xab9e('0x7'));router[_0xab9e('0x8')]('/',auth[_0xab9e('0x9')](),controller['index']);router[_0xab9e('0x8')](_0xab9e('0xa'),auth['isAuthenticated'](),controller[_0xab9e('0xb')]);router[_0xab9e('0x8')](_0xab9e('0xc'),auth[_0xab9e('0x9')](),controller[_0xab9e('0xd')]);router[_0xab9e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xab9e('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xab9e('0x10')]);module[_0xab9e('0x11')]=router;
\ No newline at end of file
+var _0xc665=['path','express','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x2ca83c,_0x45190a){var _0xe0648f=function(_0x4f8247){while(--_0x4f8247){_0x2ca83c['push'](_0x2ca83c['shift']());}};_0xe0648f(++_0x45190a);}(_0xc665,0x19e));var _0x5c66=function(_0x4c4cbf,_0x1e6e6){_0x4c4cbf=_0x4c4cbf-0x0;var _0xa65774=_0xc665[_0x4c4cbf];return _0xa65774;};'use strict';var multer=require(_0x5c66('0x0'));var util=require(_0x5c66('0x1'));var path=require(_0x5c66('0x2'));var timeout=require('connect-timeout');var express=require(_0x5c66('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5c66('0x4'));var controller=require(_0x5c66('0x5'));router[_0x5c66('0x6')]('/',auth[_0x5c66('0x7')](),controller[_0x5c66('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x5c66('0x7')](),controller[_0x5c66('0x9')]);router['post']('/',auth[_0x5c66('0x7')](),controller[_0x5c66('0xa')]);router[_0x5c66('0xb')](_0x5c66('0xc'),auth[_0x5c66('0x7')](),controller[_0x5c66('0xd')]);router[_0x5c66('0xe')](_0x5c66('0xc'),auth[_0x5c66('0x7')](),controller[_0x5c66('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index c2df612..38eb5ed 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 _0xacfc=['STRING','ENUM','mouseOver','timeout','INTEGER','exports'];(function(_0x403ce7,_0x5e2728){var _0x550430=function(_0x11ee32){while(--_0x11ee32){_0x403ce7['push'](_0x403ce7['shift']());}};_0x550430(++_0x5e2728);}(_0xacfc,0x77));var _0xcacf=function(_0x3a861c,_0xf07f4c){_0x3a861c=_0x3a861c-0x0;var _0xbb4383=_0xacfc[_0x3a861c];return _0xbb4383;};'use strict';var Sequelize=require('sequelize');module[_0xcacf('0x0')]={'name':{'type':Sequelize[_0xcacf('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xcacf('0x2')](_0xcacf('0x3'),_0xcacf('0x4')),'defaultValue':_0xcacf('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xcacf('0x5')]}};
\ No newline at end of file
+var _0x760b=['sequelize','exports','ENUM','timeout','mouseOver','STRING'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x760b,0x14a));var _0xb760=function(_0x470cae,_0x82f4a2){_0x470cae=_0x470cae-0x0;var _0x11e17e=_0x760b[_0x470cae];return _0x11e17e;};'use strict';var Sequelize=require(_0xb760('0x0'));module[_0xb760('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb760('0x2')]('mouseOver',_0xb760('0x3')),'defaultValue':_0xb760('0x4')},'selector':{'type':Sequelize[_0xb760('0x5')]},'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 8af5c19..8b3d28a 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 _0x394e=['find','then','catch','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','sendStatus','error','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options'];(function(_0xba4dfb,_0x443432){var _0x3952d4=function(_0x10d738){while(--_0x10d738){_0xba4dfb['push'](_0xba4dfb['shift']());}};_0x3952d4(++_0x443432);}(_0x394e,0x88));var _0xe394=function(_0x28202e,_0x5d0604){_0x28202e=_0x28202e-0x0;var _0x126f8b=_0x394e[_0x28202e];return _0x126f8b;};'use strict';var emlformat=require(_0xe394('0x0'));var rimraf=require(_0xe394('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe394('0x2'));var rp=require(_0xe394('0x3'));var moment=require(_0xe394('0x4'));var BPromise=require(_0xe394('0x5'));var Mustache=require('mustache');var util=require(_0xe394('0x6'));var path=require(_0xe394('0x7'));var sox=require(_0xe394('0x8'));var csv=require(_0xe394('0x9'));var ejs=require(_0xe394('0xa'));var fs=require('fs');var fs_extra=require(_0xe394('0xb'));var _=require(_0xe394('0xc'));var squel=require(_0xe394('0xd'));var crypto=require(_0xe394('0xe'));var jsforce=require(_0xe394('0xf'));var deskjs=require(_0xe394('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe394('0x11'));var authService=require(_0xe394('0x12'));var qs=require(_0xe394('0x13'));var as=require(_0xe394('0x14'));var hardwareService=require(_0xe394('0x15'));var logger=require(_0xe394('0x16'))(_0xe394('0x17'));var utils=require(_0xe394('0x18'));var config=require(_0xe394('0x19'));var licenseUtil=require(_0xe394('0x1a'));var db=require(_0xe394('0x1b'))['db'];function respondWithStatusCode(_0x383e2c,_0x575a03){_0x575a03=_0x575a03||0xcc;return function(_0x5730b5){if(_0x5730b5){return _0x383e2c['sendStatus'](_0x575a03);}return _0x383e2c[_0xe394('0x1c')](_0x575a03)[_0xe394('0x1d')]();};}function respondWithResult(_0x4f1bf8,_0x996771){_0x996771=_0x996771||0xc8;return function(_0x61e157){if(_0x61e157){return _0x4f1bf8[_0xe394('0x1c')](_0x996771)[_0xe394('0x1e')](_0x61e157);}};}function respondWithFilteredResult(_0x1f4f71,_0x1c26db){return function(_0x56aafa){if(_0x56aafa){var _0x47afc4=typeof _0x1c26db[_0xe394('0x1f')]===_0xe394('0x20')&&typeof _0x1c26db[_0xe394('0x21')]===_0xe394('0x20');var _0x4a7a5b=_0x56aafa[_0xe394('0x22')];var _0x4b0d41=_0x47afc4?0x0:_0x1c26db[_0xe394('0x1f')];var _0x25c3b1=_0x47afc4?_0x56aafa[_0xe394('0x22')]:_0x1c26db['offset']+_0x1c26db[_0xe394('0x21')];var _0x28ab96;if(_0x25c3b1>=_0x4a7a5b){_0x25c3b1=_0x4a7a5b;_0x28ab96=0xc8;}else{_0x28ab96=0xce;}_0x1f4f71[_0xe394('0x1c')](_0x28ab96);return _0x1f4f71['set'](_0xe394('0x23'),_0x4b0d41+'-'+_0x25c3b1+'/'+_0x4a7a5b)[_0xe394('0x1e')](_0x56aafa);}return null;};}function patchUpdates(_0x1066a3){return function(_0x203a91){try{jsonpatch[_0xe394('0x24')](_0x203a91,_0x1066a3,!![]);}catch(_0x1a9004){return BPromise[_0xe394('0x25')](_0x1a9004);}return _0x203a91[_0xe394('0x26')]();};}function saveUpdates(_0x39ce6d,_0x36ef72){return function(_0x402fd5){if(_0x402fd5){return _0x402fd5[_0xe394('0x27')](_0x39ce6d)['then'](function(_0x133c8b){return _0x133c8b;});}return null;};}function removeEntity(_0x459bfe,_0x11c795){return function(_0x1b766c){if(_0x1b766c){return _0x1b766c[_0xe394('0x28')]()['then'](function(){_0x459bfe[_0xe394('0x1c')](0xcc)[_0xe394('0x1d')]();});}};}function handleEntityNotFound(_0x156f6b,_0x44c3e7){return function(_0x4ebf7d){if(!_0x4ebf7d){_0x156f6b[_0xe394('0x29')](0x194);}return _0x4ebf7d;};}function handleError(_0x446a53,_0x22597b){_0x22597b=_0x22597b||0x1f4;return function(_0xc6cb2d){logger[_0xe394('0x2a')](_0xc6cb2d['stack']);if(_0xc6cb2d[_0xe394('0x2b')]){delete _0xc6cb2d[_0xe394('0x2b')];}_0x446a53[_0xe394('0x1c')](_0x22597b)[_0xe394('0x2c')](_0xc6cb2d);};}exports[_0xe394('0x2d')]=function(_0x24146d,_0x3d7693){var _0xdd67a6={'raw':!![],'where':{'id':_0x24146d['params']['id']}},_0x1abc74={};_0x1abc74[_0xe394('0x2e')]=_[_0xe394('0x2f')](db[_0xe394('0x30')][_0xe394('0x31')]);_0x1abc74[_0xe394('0x32')]=_['keys'](_0x24146d['query']);_0x1abc74[_0xe394('0x33')]=_[_0xe394('0x34')](_0x1abc74[_0xe394('0x2e')],_0x1abc74['query']);_0xdd67a6[_0xe394('0x35')]=_['intersection'](_0x1abc74['model'],qs[_0xe394('0x36')](_0x24146d[_0xe394('0x32')][_0xe394('0x36')]));_0xdd67a6[_0xe394('0x35')]=_0xdd67a6[_0xe394('0x35')][_0xe394('0x37')]?_0xdd67a6[_0xe394('0x35')]:_0x1abc74[_0xe394('0x2e')];if(_0x24146d[_0xe394('0x32')][_0xe394('0x38')]){_0xdd67a6[_0xe394('0x39')]=[{'all':!![]}];}_0xdd67a6=_['merge']({},_0xdd67a6,_0x24146d[_0xe394('0x3a')]);return db[_0xe394('0x30')][_0xe394('0x3b')](_0xdd67a6)[_0xe394('0x3c')](handleEntityNotFound(_0x3d7693,null))[_0xe394('0x3c')](respondWithResult(_0x3d7693,null))[_0xe394('0x3d')](handleError(_0x3d7693,null));};exports['create']=function(_0x4beed1,_0x33d225){return db[_0xe394('0x30')][_0xe394('0x3e')](_0x4beed1[_0xe394('0x3f')],{})[_0xe394('0x3c')](respondWithResult(_0x33d225,0xc9))[_0xe394('0x3d')](handleError(_0x33d225,null));};exports[_0xe394('0x27')]=function(_0x36c37f,_0x2e3a1e){if(_0x36c37f[_0xe394('0x3f')]['id']){delete _0x36c37f[_0xe394('0x3f')]['id'];}return db[_0xe394('0x30')][_0xe394('0x3b')]({'where':{'id':_0x36c37f[_0xe394('0x40')]['id']}})[_0xe394('0x3c')](handleEntityNotFound(_0x2e3a1e,null))['then'](saveUpdates(_0x36c37f[_0xe394('0x3f')],null))[_0xe394('0x3c')](respondWithResult(_0x2e3a1e,null))[_0xe394('0x3d')](handleError(_0x2e3a1e,null));};exports[_0xe394('0x28')]=function(_0x44b00a,_0x4b7152){return db['ChatProactiveAction'][_0xe394('0x3b')]({'where':{'id':_0x44b00a['params']['id']}})[_0xe394('0x3c')](handleEntityNotFound(_0x4b7152,null))[_0xe394('0x3c')](removeEntity(_0x4b7152,null))[_0xe394('0x3d')](handleError(_0x4b7152,null));};
\ No newline at end of file
+var _0x9417=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','show','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x5cd042,_0xba348){var _0x10490b=function(_0xce382f){while(--_0xce382f){_0x5cd042['push'](_0x5cd042['shift']());}};_0x10490b(++_0xba348);}(_0x9417,0xb4));var _0x7941=function(_0x9fb081,_0x48f480){_0x9fb081=_0x9fb081-0x0;var _0x43f8b0=_0x9417[_0x9fb081];return _0x43f8b0;};'use strict';var emlformat=require(_0x7941('0x0'));var rimraf=require(_0x7941('0x1'));var zipdir=require(_0x7941('0x2'));var jsonpatch=require(_0x7941('0x3'));var rp=require('request-promise');var moment=require(_0x7941('0x4'));var BPromise=require(_0x7941('0x5'));var Mustache=require(_0x7941('0x6'));var util=require(_0x7941('0x7'));var path=require(_0x7941('0x8'));var sox=require(_0x7941('0x9'));var csv=require(_0x7941('0xa'));var ejs=require(_0x7941('0xb'));var fs=require('fs');var fs_extra=require(_0x7941('0xc'));var _=require(_0x7941('0xd'));var squel=require('squel');var crypto=require(_0x7941('0xe'));var jsforce=require(_0x7941('0xf'));var deskjs=require(_0x7941('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7941('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7941('0x12'));var qs=require(_0x7941('0x13'));var as=require(_0x7941('0x14'));var hardwareService=require(_0x7941('0x15'));var logger=require(_0x7941('0x16'))(_0x7941('0x17'));var utils=require(_0x7941('0x18'));var config=require(_0x7941('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7941('0x1a'))['db'];function respondWithStatusCode(_0x51aab8,_0x12b674){_0x12b674=_0x12b674||0xcc;return function(_0x46a86a){if(_0x46a86a){return _0x51aab8['sendStatus'](_0x12b674);}return _0x51aab8['status'](_0x12b674)[_0x7941('0x1b')]();};}function respondWithResult(_0x59f371,_0x18936d){_0x18936d=_0x18936d||0xc8;return function(_0x45c08f){if(_0x45c08f){return _0x59f371[_0x7941('0x1c')](_0x18936d)[_0x7941('0x1d')](_0x45c08f);}};}function respondWithFilteredResult(_0x1da410,_0x41b098){return function(_0x55320b){if(_0x55320b){var _0x11623c=typeof _0x41b098[_0x7941('0x1e')]===_0x7941('0x1f')&&typeof _0x41b098[_0x7941('0x20')]===_0x7941('0x1f');var _0x256f45=_0x55320b[_0x7941('0x21')];var _0x573b44=_0x11623c?0x0:_0x41b098[_0x7941('0x1e')];var _0x533559=_0x11623c?_0x55320b['count']:_0x41b098[_0x7941('0x1e')]+_0x41b098['limit'];var _0x17442f;if(_0x533559>=_0x256f45){_0x533559=_0x256f45;_0x17442f=0xc8;}else{_0x17442f=0xce;}_0x1da410[_0x7941('0x1c')](_0x17442f);return _0x1da410[_0x7941('0x22')]('Content-Range',_0x573b44+'-'+_0x533559+'/'+_0x256f45)['json'](_0x55320b);}return null;};}function patchUpdates(_0x645e4c){return function(_0x4d3b28){try{jsonpatch[_0x7941('0x23')](_0x4d3b28,_0x645e4c,!![]);}catch(_0x57809b){return BPromise[_0x7941('0x24')](_0x57809b);}return _0x4d3b28[_0x7941('0x25')]();};}function saveUpdates(_0x42ff1f,_0x45ae78){return function(_0x3c2ae5){if(_0x3c2ae5){return _0x3c2ae5[_0x7941('0x26')](_0x42ff1f)[_0x7941('0x27')](function(_0x5287e0){return _0x5287e0;});}return null;};}function removeEntity(_0x20dd64,_0x531f20){return function(_0x36ff77){if(_0x36ff77){return _0x36ff77[_0x7941('0x28')]()[_0x7941('0x27')](function(){_0x20dd64[_0x7941('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55f679,_0x1e61e0){return function(_0x5ad836){if(!_0x5ad836){_0x55f679['sendStatus'](0x194);}return _0x5ad836;};}function handleError(_0x5f09c1,_0x43caf0){_0x43caf0=_0x43caf0||0x1f4;return function(_0x1b59e2){logger[_0x7941('0x29')](_0x1b59e2[_0x7941('0x2a')]);if(_0x1b59e2[_0x7941('0x2b')]){delete _0x1b59e2['name'];}_0x5f09c1[_0x7941('0x1c')](_0x43caf0)[_0x7941('0x2c')](_0x1b59e2);};}exports[_0x7941('0x2d')]=function(_0x240052,_0x23f617){var _0x24cc75={'raw':!![],'where':{'id':_0x240052['params']['id']}},_0xd2b022={};_0xd2b022[_0x7941('0x2e')]=_[_0x7941('0x2f')](db[_0x7941('0x30')]['rawAttributes']);_0xd2b022[_0x7941('0x31')]=_['keys'](_0x240052[_0x7941('0x31')]);_0xd2b022[_0x7941('0x32')]=_[_0x7941('0x33')](_0xd2b022['model'],_0xd2b022[_0x7941('0x31')]);_0x24cc75[_0x7941('0x34')]=_['intersection'](_0xd2b022[_0x7941('0x2e')],qs[_0x7941('0x35')](_0x240052['query'][_0x7941('0x35')]));_0x24cc75[_0x7941('0x34')]=_0x24cc75['attributes'][_0x7941('0x36')]?_0x24cc75[_0x7941('0x34')]:_0xd2b022[_0x7941('0x2e')];if(_0x240052[_0x7941('0x31')][_0x7941('0x37')]){_0x24cc75[_0x7941('0x38')]=[{'all':!![]}];}_0x24cc75=_[_0x7941('0x39')]({},_0x24cc75,_0x240052['options']);return db[_0x7941('0x30')][_0x7941('0x3a')](_0x24cc75)['then'](handleEntityNotFound(_0x23f617,null))[_0x7941('0x27')](respondWithResult(_0x23f617,null))[_0x7941('0x3b')](handleError(_0x23f617,null));};exports[_0x7941('0x3c')]=function(_0x1d03d7,_0x1173b8){return db[_0x7941('0x30')]['create'](_0x1d03d7[_0x7941('0x3d')],{})[_0x7941('0x27')](respondWithResult(_0x1173b8,0xc9))[_0x7941('0x3b')](handleError(_0x1173b8,null));};exports[_0x7941('0x26')]=function(_0x469317,_0x1ff304){if(_0x469317[_0x7941('0x3d')]['id']){delete _0x469317['body']['id'];}return db[_0x7941('0x30')][_0x7941('0x3a')]({'where':{'id':_0x469317['params']['id']}})['then'](handleEntityNotFound(_0x1ff304,null))[_0x7941('0x27')](saveUpdates(_0x469317[_0x7941('0x3d')],null))[_0x7941('0x27')](respondWithResult(_0x1ff304,null))[_0x7941('0x3b')](handleError(_0x1ff304,null));};exports[_0x7941('0x28')]=function(_0x2a59f6,_0x234554){return db[_0x7941('0x30')]['find']({'where':{'id':_0x2a59f6[_0x7941('0x3e')]['id']}})['then'](handleEntityNotFound(_0x234554,null))[_0x7941('0x27')](removeEntity(_0x234554,null))[_0x7941('0x3b')](handleError(_0x234554,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 2b84a74..0a5feba 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 _0xce3d=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','define','chat_proactive_actions','lodash','util'];(function(_0x5cd900,_0x351efb){var _0x5c71f6=function(_0x44b444){while(--_0x44b444){_0x5cd900['push'](_0x5cd900['shift']());}};_0x5c71f6(++_0x351efb);}(_0xce3d,0x1e2));var _0xdce3=function(_0x261931,_0x5b654a){_0x261931=_0x261931-0x0;var _0x11083a=_0xce3d[_0x261931];return _0x11083a;};'use strict';var _=require(_0xdce3('0x0'));var util=require(_0xdce3('0x1'));var logger=require(_0xdce3('0x2'))(_0xdce3('0x3'));var moment=require('moment');var BPromise=require(_0xdce3('0x4'));var rp=require(_0xdce3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdce3('0x6'));var config=require(_0xdce3('0x7'));var attributes=require(_0xdce3('0x8'));module['exports']=function(_0x4cd2d7,_0x3b946b){return _0x4cd2d7[_0xdce3('0x9')]('ChatProactiveAction',attributes,{'tableName':_0xdce3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe272=['rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x25c659,_0x553ea8){var _0x14fee9=function(_0x17403c){while(--_0x17403c){_0x25c659['push'](_0x25c659['shift']());}};_0x14fee9(++_0x553ea8);}(_0xe272,0x1e7));var _0x2e27=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xe272[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x2e27('0x0'));var util=require(_0x2e27('0x1'));var logger=require(_0x2e27('0x2'))(_0x2e27('0x3'));var moment=require(_0x2e27('0x4'));var BPromise=require(_0x2e27('0x5'));var rp=require(_0x2e27('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e27('0x7'));var config=require(_0x2e27('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0x2e27('0x9')]=function(_0x4a66dc,_0x307412){return _0x4a66dc[_0x2e27('0xa')](_0x2e27('0xb'),attributes,{'tableName':_0x2e27('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 68448c6..3adb5c1 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 _0xd932=['client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x114d05,_0x2c629d){var _0x3e444c=function(_0x51a55d){while(--_0x51a55d){_0x114d05['push'](_0x114d05['shift']());}};_0x3e444c(++_0x2c629d);}(_0xd932,0x6a));var _0x2d93=function(_0x53eb44,_0x32e433){_0x53eb44=_0x53eb44-0x0;var _0x2bb889=_0xd932[_0x53eb44];return _0x2bb889;};'use strict';var _=require(_0x2d93('0x0'));var util=require(_0x2d93('0x1'));var moment=require(_0x2d93('0x2'));var BPromise=require(_0x2d93('0x3'));var rs=require(_0x2d93('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2d93('0x5'));var logger=require('../../config/logger')(_0x2d93('0x6'));var config=require(_0x2d93('0x7'));var jayson=require(_0x2d93('0x8'));var client=jayson[_0x2d93('0x9')][_0x2d93('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f2863,_0x5efc29,_0x5b7d00){return new BPromise(function(_0x238b0e,_0x36f272){return client[_0x2d93('0xb')](_0x2f2863,_0x5b7d00)[_0x2d93('0xc')](function(_0x27407a){logger[_0x2d93('0xd')](_0x2d93('0xe'),_0x5efc29,_0x2d93('0xf'));logger[_0x2d93('0x10')](_0x2d93('0x11'),_0x5efc29,_0x2d93('0xf'),JSON[_0x2d93('0x12')](_0x27407a));if(_0x27407a['error']){if(_0x27407a['error']['code']===0x1f4){logger[_0x2d93('0x13')](_0x2d93('0xe'),_0x5efc29,_0x27407a[_0x2d93('0x13')][_0x2d93('0x14')]);return _0x36f272(_0x27407a['error'][_0x2d93('0x14')]);}logger[_0x2d93('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x5efc29,_0x27407a[_0x2d93('0x13')]['message']);return _0x238b0e(_0x27407a['error'][_0x2d93('0x14')]);}else{logger['info'](_0x2d93('0xe'),_0x5efc29,_0x2d93('0xf'));_0x238b0e(_0x27407a[_0x2d93('0x15')]['message']);}})[_0x2d93('0x16')](function(_0x387772){logger[_0x2d93('0x13')](_0x2d93('0xe'),_0x5efc29,_0x387772);_0x36f272(_0x387772);});});}
\ No newline at end of file
+var _0x682e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0x682e,0x119));var _0xe682=function(_0xfb2f7d,_0x58d8fa){_0xfb2f7d=_0xfb2f7d-0x0;var _0x164866=_0x682e[_0xfb2f7d];return _0x164866;};'use strict';var _=require(_0xe682('0x0'));var util=require('util');var moment=require(_0xe682('0x1'));var BPromise=require(_0xe682('0x2'));var rs=require(_0xe682('0x3'));var fs=require('fs');var Redis=require(_0xe682('0x4'));var db=require(_0xe682('0x5'))['db'];var utils=require(_0xe682('0x6'));var logger=require(_0xe682('0x7'))(_0xe682('0x8'));var config=require(_0xe682('0x9'));var jayson=require(_0xe682('0xa'));var client=jayson[_0xe682('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x82fa21,_0x1d766a,_0x214393){return new BPromise(function(_0x283937,_0x5d9cd5){return client[_0xe682('0xc')](_0x82fa21,_0x214393)[_0xe682('0xd')](function(_0xc6d5fe){logger[_0xe682('0xe')](_0xe682('0xf'),_0x1d766a,_0xe682('0x10'));logger['debug'](_0xe682('0x11'),_0x1d766a,_0xe682('0x10'),JSON['stringify'](_0xc6d5fe));if(_0xc6d5fe[_0xe682('0x12')]){if(_0xc6d5fe[_0xe682('0x12')][_0xe682('0x13')]===0x1f4){logger[_0xe682('0x12')](_0xe682('0xf'),_0x1d766a,_0xc6d5fe[_0xe682('0x12')][_0xe682('0x14')]);return _0x5d9cd5(_0xc6d5fe['error'][_0xe682('0x14')]);}logger[_0xe682('0x12')](_0xe682('0xf'),_0x1d766a,_0xc6d5fe[_0xe682('0x12')][_0xe682('0x14')]);return _0x283937(_0xc6d5fe[_0xe682('0x12')][_0xe682('0x14')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x1d766a,_0xe682('0x10'));_0x283937(_0xc6d5fe[_0xe682('0x15')][_0xe682('0x14')]);}})['catch'](function(_0x11b0aa){logger[_0xe682('0x12')](_0xe682('0xf'),_0x1d766a,_0x11b0aa);_0x5d9cd5(_0x11b0aa);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index d5ed268..bb35a23 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 _0x8d0e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','/:id','delete','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x35c2ba,_0x46f478){_0x35c2ba=_0x35c2ba-0x0;var _0x44a7fa=_0x8d0e[_0x35c2ba];return _0x44a7fa;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/:id',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xb')]);router[_0xe8d0('0xc')]('/',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xe')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['update']);router[_0xe8d0('0x10')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x2fd7d9,_0x585704){var _0xd3d662=function(_0x1dc7eb){while(--_0x1dc7eb){_0x2fd7d9['push'](_0x2fd7d9['shift']());}};_0xd3d662(++_0x585704);}(_0xd8fb,0x99));var _0xbd8f=function(_0x46f334,_0x2c63fa){_0x46f334=_0x46f334-0x0;var _0x3db125=_0xd8fb[_0x46f334];return _0x3db125;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('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 9c5ad86..e639046 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 _0x1033=['rrmemory','beepall','roundrobin','exports','STRING','name','ENUM'];(function(_0x3743af,_0xada0ec){var _0x2d19a2=function(_0x42fef1){while(--_0x42fef1){_0x3743af['push'](_0x3743af['shift']());}};_0x2d19a2(++_0xada0ec);}(_0x1033,0xe3));var _0x3103=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x1033[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require('sequelize');module[_0x3103('0x0')]={'name':{'type':Sequelize[_0x3103('0x1')],'unique':_0x3103('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3103('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3103('0x3')](_0x3103('0x4'),_0x3103('0x5'),_0x3103('0x6'))}};
\ No newline at end of file
+var _0x6023=['STRING','INTEGER','ENUM','beepall','roundrobin','sequelize','exports','name'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x6023,0x105));var _0x3602=function(_0x30f160,_0x185cea){_0x30f160=_0x30f160-0x0;var _0x87795=_0x6023[_0x30f160];return _0x87795;};'use strict';var Sequelize=require(_0x3602('0x0'));module[_0x3602('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3602('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3602('0x3')]},'timeout':{'type':Sequelize[_0x3602('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3602('0x5')]('rrmemory',_0x3602('0x6'),_0x3602('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 0e77332..45675cd 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 _0x7757=['offset','limit','count','Content-Range','json','apply','save','update','destroy','ChatQueues','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end'];(function(_0x33b30e,_0x11d1e6){var _0x17693e=function(_0x2e7c76){while(--_0x2e7c76){_0x33b30e['push'](_0x33b30e['shift']());}};_0x17693e(++_0x11d1e6);}(_0x7757,0x109));var _0x7775=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x7757[_0x465028];return _0xb783d4;};'use strict';var emlformat=require(_0x7775('0x0'));var rimraf=require(_0x7775('0x1'));var zipdir=require(_0x7775('0x2'));var jsonpatch=require(_0x7775('0x3'));var rp=require(_0x7775('0x4'));var moment=require(_0x7775('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7775('0x6'));var util=require(_0x7775('0x7'));var path=require(_0x7775('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7775('0x9'));var fs=require('fs');var fs_extra=require(_0x7775('0xa'));var _=require(_0x7775('0xb'));var squel=require(_0x7775('0xc'));var crypto=require('crypto');var jsforce=require(_0x7775('0xd'));var deskjs=require(_0x7775('0xe'));var toCsv=require(_0x7775('0xf'));var querystring=require(_0x7775('0x10'));var Papa=require(_0x7775('0x11'));var Redis=require(_0x7775('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7775('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7775('0x14'));var logger=require(_0x7775('0x15'))(_0x7775('0x16'));var utils=require(_0x7775('0x17'));var config=require(_0x7775('0x18'));var licenseUtil=require(_0x7775('0x19'));var db=require('../../mysqldb')['db'];config[_0x7775('0x1a')]=_['defaults'](config[_0x7775('0x1a')],{'host':_0x7775('0x1b'),'port':0x18eb});var socket=require(_0x7775('0x1c'))(new Redis(config[_0x7775('0x1a')]));require(_0x7775('0x1d'))[_0x7775('0x1e')](socket);var jayson=require(_0x7775('0x1f'));var client=jayson[_0x7775('0x20')][_0x7775('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2d72c2,_0x94a3b3,_0x4f1e8a,_0x4109c8){return new BPromise(function(_0x334fda,_0x394278){var _0xafaa68=_0x4109c8||client;return _0xafaa68[_0x7775('0x22')](_0x2d72c2,_0x4f1e8a)[_0x7775('0x23')](function(_0xec3f9d){logger[_0x7775('0x24')](_0x7775('0x25'),_0x94a3b3,_0x7775('0x26'));logger[_0x7775('0x27')](_0x7775('0x28'),_0x94a3b3,_0x7775('0x26'),JSON[_0x7775('0x29')](_0xec3f9d));if(_0xec3f9d[_0x7775('0x2a')]){if(_0xec3f9d[_0x7775('0x2a')][_0x7775('0x2b')]===0x1f4){logger[_0x7775('0x2a')](_0x7775('0x25'),_0x94a3b3,_0xec3f9d[_0x7775('0x2a')][_0x7775('0x2c')]);return _0x394278(_0xec3f9d[_0x7775('0x2a')]['message']);}logger[_0x7775('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x94a3b3,_0xec3f9d[_0x7775('0x2a')]['message']);return _0x334fda(_0xec3f9d[_0x7775('0x2a')][_0x7775('0x2c')]);}else{logger[_0x7775('0x24')](_0x7775('0x25'),_0x94a3b3,_0x7775('0x26'));_0x334fda(_0xec3f9d[_0x7775('0x2d')]['message']);}})['catch'](function(_0x5ae5d6){logger['error'](_0x7775('0x25'),_0x94a3b3,_0x5ae5d6);_0x394278(_0x5ae5d6);});});}function respondWithStatusCode(_0x4cdc03,_0x5206af){_0x5206af=_0x5206af||0xcc;return function(_0x3d8056){if(_0x3d8056){return _0x4cdc03[_0x7775('0x2e')](_0x5206af);}return _0x4cdc03[_0x7775('0x2f')](_0x5206af)[_0x7775('0x30')]();};}function respondWithResult(_0xb0705f,_0x5b5833){_0x5b5833=_0x5b5833||0xc8;return function(_0x2c1c9a){if(_0x2c1c9a){return _0xb0705f[_0x7775('0x2f')](_0x5b5833)['json'](_0x2c1c9a);}};}function respondWithFilteredResult(_0x8982a5,_0x1c9520){return function(_0x291f18){if(_0x291f18){var _0x1c338d=typeof _0x1c9520[_0x7775('0x31')]==='undefined'&&typeof _0x1c9520[_0x7775('0x32')]==='undefined';var _0x2bdca9=_0x291f18[_0x7775('0x33')];var _0x561c22=_0x1c338d?0x0:_0x1c9520['offset'];var _0x3a152e=_0x1c338d?_0x291f18['count']:_0x1c9520[_0x7775('0x31')]+_0x1c9520['limit'];var _0x4e076e;if(_0x3a152e>=_0x2bdca9){_0x3a152e=_0x2bdca9;_0x4e076e=0xc8;}else{_0x4e076e=0xce;}_0x8982a5[_0x7775('0x2f')](_0x4e076e);return _0x8982a5['set'](_0x7775('0x34'),_0x561c22+'-'+_0x3a152e+'/'+_0x2bdca9)[_0x7775('0x35')](_0x291f18);}return null;};}function patchUpdates(_0x2ed364){return function(_0x5cd1a0){try{jsonpatch[_0x7775('0x36')](_0x5cd1a0,_0x2ed364,!![]);}catch(_0x27ff80){return BPromise['reject'](_0x27ff80);}return _0x5cd1a0[_0x7775('0x37')]();};}function saveUpdates(_0x3134da,_0x59d20b){return function(_0xa12dce){if(_0xa12dce){return _0xa12dce[_0x7775('0x38')](_0x3134da)[_0x7775('0x23')](function(_0x116606){return _0x116606;});}return null;};}function removeEntity(_0xf0e931,_0x364b92){return function(_0x30fe83){if(_0x30fe83){return _0x30fe83[_0x7775('0x39')]()['then'](function(){var _0x19cb23=_0x30fe83['get']({'plain':!![]});var _0x31bca2=_0x7775('0x3a');return db['UserProfileResource'][_0x7775('0x39')]({'where':{'type':_0x31bca2,'resourceId':_0x19cb23['id']}})[_0x7775('0x23')](function(){return _0x30fe83;});})[_0x7775('0x23')](function(){_0xf0e931['status'](0xcc)[_0x7775('0x30')]();});}};}function handleEntityNotFound(_0x3a090b,_0x5bdb82){return function(_0x407085){if(!_0x407085){_0x3a090b[_0x7775('0x2e')](0x194);}return _0x407085;};}function handleError(_0x24b764,_0x7ec77c){_0x7ec77c=_0x7ec77c||0x1f4;return function(_0x2720a7){logger[_0x7775('0x2a')](_0x2720a7[_0x7775('0x3b')]);if(_0x2720a7['name']){delete _0x2720a7[_0x7775('0x3c')];}_0x24b764[_0x7775('0x2f')](_0x7ec77c)[_0x7775('0x3d')](_0x2720a7);};}exports[_0x7775('0x3e')]=function(_0x1a2ce0,_0x4dfe77){var _0x45bb82={},_0xb9b90c={},_0x3a69a0={'count':0x0,'rows':[]};var _0x17c5e1=_[_0x7775('0x3f')](db[_0x7775('0x40')][_0x7775('0x41')],function(_0x5a44f9){return{'name':_0x5a44f9[_0x7775('0x42')],'type':_0x5a44f9[_0x7775('0x43')][_0x7775('0x44')]};});_0xb9b90c[_0x7775('0x45')]=_[_0x7775('0x3f')](_0x17c5e1,_0x7775('0x3c'));_0xb9b90c[_0x7775('0x46')]=_[_0x7775('0x47')](_0x1a2ce0[_0x7775('0x46')]);_0xb9b90c[_0x7775('0x48')]=_[_0x7775('0x49')](_0xb9b90c['model'],_0xb9b90c[_0x7775('0x46')]);_0x45bb82[_0x7775('0x4a')]=_['intersection'](_0xb9b90c[_0x7775('0x45')],qs[_0x7775('0x4b')](_0x1a2ce0[_0x7775('0x46')][_0x7775('0x4b')]));_0x45bb82[_0x7775('0x4a')]=_0x45bb82[_0x7775('0x4a')][_0x7775('0x4c')]?_0x45bb82[_0x7775('0x4a')]:_0xb9b90c[_0x7775('0x45')];if(!_0x1a2ce0['query'][_0x7775('0x4d')](_0x7775('0x4e'))){_0x45bb82['limit']=qs[_0x7775('0x32')](_0x1a2ce0[_0x7775('0x46')]['limit']);_0x45bb82[_0x7775('0x31')]=qs[_0x7775('0x31')](_0x1a2ce0[_0x7775('0x46')][_0x7775('0x31')]);}_0x45bb82[_0x7775('0x4f')]=qs[_0x7775('0x50')](_0x1a2ce0[_0x7775('0x46')]['sort']);_0x45bb82['where']=qs[_0x7775('0x48')](_[_0x7775('0x51')](_0x1a2ce0[_0x7775('0x46')],_0xb9b90c[_0x7775('0x48')]),_0x17c5e1);if(_0x1a2ce0[_0x7775('0x46')][_0x7775('0x52')]){_0x45bb82[_0x7775('0x53')]=_[_0x7775('0x54')](_0x45bb82['where'],{'$or':_['map'](_0x17c5e1,function(_0x17de1b){if(_0x17de1b[_0x7775('0x43')]!==_0x7775('0x55')){var _0x34da5c={};_0x34da5c[_0x17de1b[_0x7775('0x3c')]]={'$like':'%'+_0x1a2ce0['query']['filter']+'%'};return _0x34da5c;}})});}_0x45bb82=_['merge']({},_0x45bb82,_0x1a2ce0[_0x7775('0x56')]);var _0x22268a={'where':_0x45bb82[_0x7775('0x53')]};return db[_0x7775('0x40')][_0x7775('0x33')](_0x22268a)[_0x7775('0x23')](function(_0x4f265c){_0x3a69a0[_0x7775('0x33')]=_0x4f265c;if(_0x1a2ce0[_0x7775('0x46')]['includeAll']){_0x45bb82[_0x7775('0x57')]=[{'all':!![]}];}return db[_0x7775('0x40')][_0x7775('0x58')](_0x45bb82);})[_0x7775('0x23')](function(_0x590f03){_0x3a69a0[_0x7775('0x59')]=_0x590f03;return _0x3a69a0;})[_0x7775('0x23')](respondWithFilteredResult(_0x4dfe77,_0x45bb82))['catch'](handleError(_0x4dfe77,null));};exports[_0x7775('0x5a')]=function(_0x2899db,_0x5f3310){var _0x214bc4={'raw':!![],'where':{'id':_0x2899db[_0x7775('0x5b')]['id']}},_0x1c1dea={};_0x1c1dea[_0x7775('0x45')]=_[_0x7775('0x47')](db[_0x7775('0x40')][_0x7775('0x41')]);_0x1c1dea['query']=_['keys'](_0x2899db[_0x7775('0x46')]);_0x1c1dea[_0x7775('0x48')]=_[_0x7775('0x49')](_0x1c1dea[_0x7775('0x45')],_0x1c1dea[_0x7775('0x46')]);_0x214bc4[_0x7775('0x4a')]=_[_0x7775('0x49')](_0x1c1dea[_0x7775('0x45')],qs[_0x7775('0x4b')](_0x2899db['query'][_0x7775('0x4b')]));_0x214bc4['attributes']=_0x214bc4[_0x7775('0x4a')][_0x7775('0x4c')]?_0x214bc4['attributes']:_0x1c1dea[_0x7775('0x45')];if(_0x2899db[_0x7775('0x46')][_0x7775('0x5c')]){_0x214bc4['include']=[{'all':!![]}];}_0x214bc4=_[_0x7775('0x54')]({},_0x214bc4,_0x2899db[_0x7775('0x56')]);return db[_0x7775('0x40')][_0x7775('0x5d')](_0x214bc4)[_0x7775('0x23')](handleEntityNotFound(_0x5f3310,null))[_0x7775('0x23')](respondWithResult(_0x5f3310,null))[_0x7775('0x5e')](handleError(_0x5f3310,null));};exports[_0x7775('0x5f')]=function(_0x14a323,_0x17fdfa){return db[_0x7775('0x40')]['create'](_0x14a323[_0x7775('0x60')],{})[_0x7775('0x23')](function(_0x142cb4){var _0x46fd10=_0x14a323[_0x7775('0x61')]['get']({'plain':!![]});if(!_0x46fd10)throw new Error(_0x7775('0x62'));if(_0x46fd10[_0x7775('0x63')]===_0x7775('0x61')){var _0x38c1be=_0x142cb4[_0x7775('0x64')]({'plain':!![]});var _0x774e72=_0x7775('0x3a');return db[_0x7775('0x65')][_0x7775('0x5d')]({'where':{'name':_0x774e72,'userProfileId':_0x46fd10['userProfileId']},'raw':!![]})['then'](function(_0x3da737){if(_0x3da737&&_0x3da737['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x38c1be[_0x7775('0x3c')],'resourceId':_0x38c1be['id'],'type':_0x3da737['name'],'sectionId':_0x3da737['id']},{})[_0x7775('0x23')](function(){return _0x142cb4;});}else{return _0x142cb4;}})[_0x7775('0x5e')](function(_0x410cc1){logger[_0x7775('0x2a')](_0x7775('0x66'),_0x410cc1);throw _0x410cc1;});}return _0x142cb4;})[_0x7775('0x23')](respondWithResult(_0x17fdfa,0xc9))['catch'](handleError(_0x17fdfa,null));};exports[_0x7775('0x38')]=function(_0xa1b0db,_0x2ff700){if(_0xa1b0db[_0x7775('0x60')]['id']){delete _0xa1b0db[_0x7775('0x60')]['id'];}return db[_0x7775('0x40')][_0x7775('0x5d')]({'where':{'id':_0xa1b0db['params']['id']}})[_0x7775('0x23')](handleEntityNotFound(_0x2ff700,null))[_0x7775('0x23')](saveUpdates(_0xa1b0db[_0x7775('0x60')],null))[_0x7775('0x23')](respondWithResult(_0x2ff700,null))[_0x7775('0x5e')](handleError(_0x2ff700,null));};exports[_0x7775('0x39')]=function(_0x30fc06,_0x25c2aa){return db[_0x7775('0x40')][_0x7775('0x5d')]({'where':{'id':_0x30fc06[_0x7775('0x5b')]['id']}})[_0x7775('0x23')](handleEntityNotFound(_0x25c2aa,null))['then'](removeEntity(_0x25c2aa,null))[_0x7775('0x5e')](handleError(_0x25c2aa,null));};exports[_0x7775('0x67')]=function(_0x10e794,_0x132548){return db[_0x7775('0x40')][_0x7775('0x67')]()['then'](respondWithResult(_0x132548,null))[_0x7775('0x5e')](handleError(_0x132548,null));};exports['getMembers']=function(_0xe888b7,_0x4dbb69,_0x1a2163){var _0xc051a0={'raw':!![],'where':{}},_0x10eba6={},_0x982264;return db[_0x7775('0x40')][_0x7775('0x68')]({'where':{'id':_0xe888b7[_0x7775('0x5b')]['id']}})[_0x7775('0x23')](handleEntityNotFound(_0x4dbb69,null))['then'](function(_0x50941b){if(_0x50941b){_0x982264=_0x50941b[_0x7775('0x64')]({'plain':!![]});_0x10eba6[_0x7775('0x45')]=_['keys'](db['UserChatQueue'][_0x7775('0x41')]);_0x10eba6[_0x7775('0x46')]=_[_0x7775('0x47')](_0xe888b7[_0x7775('0x46')]);_0x10eba6[_0x7775('0x48')]=_[_0x7775('0x49')](_0x10eba6[_0x7775('0x45')],_0x10eba6[_0x7775('0x46')]);_0xc051a0[_0x7775('0x4a')]=_[_0x7775('0x49')](_0x10eba6[_0x7775('0x45')],qs[_0x7775('0x4b')](_0xe888b7[_0x7775('0x46')]['fields']));_0xc051a0[_0x7775('0x4a')]=_0xc051a0['attributes'][_0x7775('0x4c')]?_0xc051a0['attributes']:_0x10eba6[_0x7775('0x45')];if(!_0xe888b7[_0x7775('0x46')][_0x7775('0x4d')](_0x7775('0x4e'))){_0xc051a0['limit']=qs[_0x7775('0x32')](_0xe888b7[_0x7775('0x46')]['limit']);_0xc051a0['offset']=qs[_0x7775('0x31')](_0xe888b7[_0x7775('0x46')][_0x7775('0x31')]);}_0xc051a0[_0x7775('0x4f')]=qs[_0x7775('0x50')](_0xe888b7[_0x7775('0x46')]['sort']);_0xc051a0['where']=qs['filters'](_[_0x7775('0x51')](_0xe888b7[_0x7775('0x46')],_0x10eba6[_0x7775('0x48')]));_0xc051a0['where']['ChatQueueId']=_0x50941b['id'];if(_0xe888b7[_0x7775('0x46')][_0x7775('0x52')]){_0xc051a0[_0x7775('0x53')]=_[_0x7775('0x54')](_0xc051a0[_0x7775('0x53')],{'$or':_['map'](_0xc051a0[_0x7775('0x4a')],function(_0xe50d87){var _0x443da6={};_0x443da6[_0xe50d87]={'$like':'%'+_0xe888b7['query'][_0x7775('0x52')]+'%'};return _0x443da6;})});}_0xc051a0=_[_0x7775('0x54')]({},_0xc051a0,_0xe888b7['options']);return db[_0x7775('0x69')][_0x7775('0x58')](_0xc051a0);}})['then'](function(_0x49f035){if(_0x49f035){return db[_0x7775('0x6a')][_0x7775('0x6b')]({'where':{'id':_[_0x7775('0x3f')](_0x49f035,_0x7775('0x6c')),'role':_0x7775('0x6d')},'attributes':['id','name',_0x7775('0x6e'),_0x7775('0x6f'),_0x7775('0x70')]});}})[_0x7775('0x23')](function(_0x5774f3){if(_0x5774f3){return{'count':_0x5774f3[_0x7775('0x33')],'rows':_[_0x7775('0x3f')](_0x5774f3['rows'],function(_0x3cbc31){return{'membername':_0x3cbc31[_0x7775('0x3c')],'UserId':_0x3cbc31['id'],'queue_name':_0x982264[_0x7775('0x3c')],'ChatQueueId':_0x982264['id'],'interface':util[_0x7775('0x71')](_0x7775('0x72'),_0x7775('0x73'),_0x3cbc31['name']),'penalty':0x0,'paused':_0x3cbc31[_0x7775('0x6e')],'createdAt':_0x3cbc31[_0x7775('0x70')],'updatedAt':_0x3cbc31[_0x7775('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7775('0x23')](respondWithFilteredResult(_0x4dbb69,_0xc051a0))[_0x7775('0x5e')](handleError(_0x4dbb69,null));};exports[_0x7775('0x74')]=function(_0xa29bf,_0x1044bf,_0x2b186d){var _0x26001f={};var _0x213b4a={};var _0x1aa42c;var _0x105438;return db[_0x7775('0x40')]['findOne']({'where':{'id':_0xa29bf[_0x7775('0x5b')]['id']}})[_0x7775('0x23')](handleEntityNotFound(_0x1044bf,null))[_0x7775('0x23')](function(_0x529940){if(_0x529940){_0x1aa42c=_0x529940;_0x213b4a[_0x7775('0x45')]=_[_0x7775('0x47')](db[_0x7775('0x75')][_0x7775('0x41')]);_0x213b4a[_0x7775('0x46')]=_[_0x7775('0x47')](_0xa29bf[_0x7775('0x46')]);_0x213b4a['filters']=_['intersection'](_0x213b4a['model'],_0x213b4a[_0x7775('0x46')]);_0x26001f[_0x7775('0x4a')]=_[_0x7775('0x49')](_0x213b4a[_0x7775('0x45')],qs['fields'](_0xa29bf[_0x7775('0x46')][_0x7775('0x4b')]));_0x26001f[_0x7775('0x4a')]=_0x26001f[_0x7775('0x4a')][_0x7775('0x4c')]?_0x26001f[_0x7775('0x4a')]:_0x213b4a[_0x7775('0x45')];_0x26001f['order']=qs[_0x7775('0x50')](_0xa29bf[_0x7775('0x46')]['sort']);_0x26001f['where']=qs[_0x7775('0x48')](_[_0x7775('0x51')](_0xa29bf['query'],_0x213b4a[_0x7775('0x48')]));if(_0xa29bf[_0x7775('0x46')][_0x7775('0x52')]){_0x26001f['where']=_['merge'](_0x26001f['where'],{'$or':_[_0x7775('0x3f')](_0x26001f[_0x7775('0x4a')],function(_0x274c9c){var _0x595193={};_0x595193[_0x274c9c]={'$like':'%'+_0xa29bf[_0x7775('0x46')]['filter']+'%'};return _0x595193;})});}_0x26001f=_[_0x7775('0x54')]({},_0x26001f,_0xa29bf[_0x7775('0x56')]);return _0x1aa42c[_0x7775('0x74')](_0x26001f);}})['then'](function(_0x3fcc86){if(_0x3fcc86){_0x105438=_0x3fcc86[_0x7775('0x4c')];if(!_0xa29bf[_0x7775('0x46')]['hasOwnProperty'](_0x7775('0x4e'))){_0x26001f['limit']=qs['limit'](_0xa29bf[_0x7775('0x46')][_0x7775('0x32')]);_0x26001f[_0x7775('0x31')]=qs[_0x7775('0x31')](_0xa29bf[_0x7775('0x46')][_0x7775('0x31')]);}return _0x1aa42c['getTeams'](_0x26001f);}})['then'](function(_0x119de1){if(_0x119de1){return _0x119de1?{'count':_0x105438,'rows':_0x119de1}:null;}})[_0x7775('0x23')](respondWithResult(_0x1044bf,null))[_0x7775('0x5e')](handleError(_0x1044bf,null));};exports['addTeams']=function(_0x5011fc,_0xeec62e,_0x31bb93){var _0x4dad75=_0x5011fc[_0x7775('0x60')][_0x7775('0x76')];return db['Team'][_0x7775('0x58')]({'where':{'id':_0x4dad75},'attributes':['id'],'include':[{'model':db[_0x7775('0x6a')],'as':_0x7775('0x77'),'attributes':['id',_0x7775('0x3c'),_0x7775('0x78'),_0x7775('0x79'),_0x7775('0x7a')],'raw':!![]}]})[_0x7775('0x23')](function(_0x3ebb09){if(_0x3ebb09){var _0x4dae19=_[_0x7775('0x7b')](_0x3ebb09,function(_0x3c81ca){var _0x5cb556=_0x3c81ca[_0x7775('0x64')]({'plain':!![]});return _0x5cb556[_0x7775('0x77')];});return db[_0x7775('0x40')][_0x7775('0x5d')]({'where':{'id':_0x5011fc[_0x7775('0x5b')]['id']}})[_0x7775('0x23')](function(_0x3b3e68){return db[_0x7775('0x7c')]['transaction'](function(_0x39d8bc){return _0x3b3e68[_0x7775('0x7d')](_0x4dad75,{'transaction':_0x39d8bc})[_0x7775('0x23')](function(){return BPromise[_0x7775('0x7e')](_0x4dae19,function(_0x448229){return db[_0x7775('0x69')][_0x7775('0x7f')]({'where':{'UserId':_0x448229['id'],'ChatQueueId':_0x5011fc[_0x7775('0x5b')]['id']},'transaction':_0x39d8bc});});})['then'](function(){_0x4dae19[_0x7775('0x80')](function(_0x1613cc){socket[_0x7775('0x81')](_0x7775('0x82'),{'UserId':_0x1613cc['id'],'ChatQueueId':_0x3b3e68['id']});});});});});}})[_0x7775('0x23')](respondWithStatusCode(_0xeec62e,null))['catch'](handleError(_0xeec62e,null));};exports[_0x7775('0x83')]=function(_0x2939b0,_0xdafde0,_0x40bed0){return db[_0x7775('0x75')][_0x7775('0x58')]({'where':{'id':_0x2939b0[_0x7775('0x46')][_0x7775('0x76')]},'attributes':['id'],'include':[{'model':db[_0x7775('0x6a')],'as':_0x7775('0x77'),'attributes':['id'],'raw':!![]}]})[_0x7775('0x23')](handleEntityNotFound(_0xdafde0,null))['then'](function(_0x1faa73){var _0x1b274a=_[_0x7775('0x3f')](_0x1faa73,'id');var _0x37d582=[];var _0x30210d=[];var _0x53c5c2=squel['select']();_0x53c5c2[_0x7775('0x84')](_0x7775('0x85'))[_0x7775('0x86')](_0x7775('0x87'),'tq')[_0x7775('0x88')](_0x7775('0x89'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7775('0x53')](_0x7775('0x8a'),_0x2939b0[_0x7775('0x5b')]['id']);for(var _0x5590fc=0x0;_0x5590fc<_0x1faa73[_0x7775('0x4c')];_0x5590fc+=0x1){let _0x55d2d2=_0x1faa73[_0x5590fc];for(var _0x67cbb9=0x0;_0x67cbb9<_0x55d2d2[_0x7775('0x77')][_0x7775('0x4c')];_0x67cbb9+=0x1){let _0x3dabf7=_0x55d2d2[_0x7775('0x77')][_0x67cbb9];var _0x10f7af=_0x53c5c2['clone']();_0x10f7af[_0x7775('0x53')](_0x7775('0x8b'),_0x3dabf7['id']);_0x30210d['push'](db[_0x7775('0x7c')][_0x7775('0x46')](_0x10f7af[_0x7775('0x8c')](),{'type':db[_0x7775('0x7c')][_0x7775('0x8d')][_0x7775('0x8e')]})[_0x7775('0x23')](function(_0x33cd6f){if(_0x33cd6f['length']===0x1){return _0x3dabf7['id'];}else{var _0x248b87=_[_0x7775('0x8f')](_[_0x7775('0x3f')](_0x33cd6f,_0x7775('0x90')),function(_0x273345){return _[_0x7775('0x91')](_0x1b274a,_0x273345);});if(_0x248b87){return _0x3dabf7['id'];}}}));}}return BPromise[_0x7775('0x92')](_0x30210d)[_0x7775('0x23')](function(_0x30de88){_0x37d582=_(_0x37d582)[_0x7775('0x93')](_0x30de88)[_0x7775('0x94')]()[_0x7775('0x95')]();return db[_0x7775('0x40')][_0x7775('0x5d')]({'where':{'id':_0x2939b0[_0x7775('0x5b')]['id']}})[_0x7775('0x23')](function(_0x5ca750){return db[_0x7775('0x7c')][_0x7775('0x96')](function(_0xcf1f85){return _0x5ca750[_0x7775('0x83')](_0x2939b0['query']['ids'],{'transaction':_0xcf1f85})[_0x7775('0x23')](function(){if(!_[_0x7775('0x97')](_0x37d582)){return _0x5ca750[_0x7775('0x98')](_0x37d582,{'transaction':_0xcf1f85});}})[_0x7775('0x23')](function(){_0x37d582[_0x7775('0x80')](function(_0x597080){socket[_0x7775('0x81')](_0x7775('0x99'),{'UserId':_0x597080,'ChatQueueId':_0x5ca750['id']});});});});});});})[_0x7775('0x23')](respondWithStatusCode(_0xdafde0,null))[_0x7775('0x5e')](handleError(_0xdafde0,null));};exports[_0x7775('0x9a')]=function(_0x1e949d,_0x5dab76,_0x81f90f){return db['ChatQueue'][_0x7775('0x5d')]({'where':{'id':_0x1e949d[_0x7775('0x5b')]['id']}})[_0x7775('0x23')](handleEntityNotFound(_0x5dab76,null))[_0x7775('0x23')](function(_0x142d2c){if(_0x142d2c){return _0x142d2c[_0x7775('0x9a')](_0x1e949d[_0x7775('0x60')][_0x7775('0x76')],_[_0x7775('0x9b')](_0x1e949d[_0x7775('0x60')],['ids','id'])||{})['spread'](function(_0x312007){for(var _0x570a26=0x0;_0x570a26<_0x1e949d[_0x7775('0x60')]['ids'][_0x7775('0x4c')];_0x570a26+=0x1){socket[_0x7775('0x81')]('userChatQueue:save',{'UserId':Number(_0x1e949d[_0x7775('0x60')][_0x7775('0x76')][_0x570a26]),'ChatQueueId':Number(_0x1e949d['params']['id'])});}return _0x312007;});}})['then'](respondWithResult(_0x5dab76,null))[_0x7775('0x5e')](handleError(_0x5dab76,null));};exports[_0x7775('0x98')]=function(_0x139d19,_0x11298b,_0x66aedb){return db[_0x7775('0x40')]['find']({'where':{'id':_0x139d19[_0x7775('0x5b')]['id']}})['then'](handleEntityNotFound(_0x11298b,null))['then'](function(_0x3c5393){if(_0x3c5393){return _0x3c5393[_0x7775('0x98')](_0x139d19[_0x7775('0x46')][_0x7775('0x76')])[_0x7775('0x23')](function(){if(_['isArray'](_0x139d19[_0x7775('0x46')][_0x7775('0x76')])){for(var _0x12795b=0x0;_0x12795b<_0x139d19[_0x7775('0x46')][_0x7775('0x76')][_0x7775('0x4c')];_0x12795b+=0x1){socket['emit'](_0x7775('0x99'),{'UserId':Number(_0x139d19[_0x7775('0x46')][_0x7775('0x76')][_0x12795b]),'ChatQueueId':Number(_0x139d19[_0x7775('0x5b')]['id'])});}}else{socket['emit'](_0x7775('0x99'),{'UserId':Number(_0x139d19[_0x7775('0x46')][_0x7775('0x76')]),'ChatQueueId':Number(_0x139d19[_0x7775('0x5b')]['id'])});}});}})[_0x7775('0x23')](respondWithStatusCode(_0x11298b,null))[_0x7775('0x5e')](handleError(_0x11298b,null));};exports['getAgents']=function(_0x55b838,_0x20630c,_0x493168){var _0xcc37ee={};var _0x1ce2fb={};var _0x323259;var _0x4f48cd;return db[_0x7775('0x40')][_0x7775('0x68')]({'where':{'id':_0x55b838[_0x7775('0x5b')]['id']}})[_0x7775('0x23')](handleEntityNotFound(_0x20630c,null))[_0x7775('0x23')](function(_0x2fe2e7){if(_0x2fe2e7){_0x323259=_0x2fe2e7;_0x1ce2fb[_0x7775('0x45')]=_[_0x7775('0x47')](db[_0x7775('0x6a')][_0x7775('0x41')]);_0x1ce2fb[_0x7775('0x46')]=_[_0x7775('0x47')](_0x55b838['query']);_0x1ce2fb[_0x7775('0x48')]=_[_0x7775('0x49')](_0x1ce2fb['model'],_0x1ce2fb[_0x7775('0x46')]);_0xcc37ee[_0x7775('0x4a')]=_[_0x7775('0x49')](_0x1ce2fb[_0x7775('0x45')],qs[_0x7775('0x4b')](_0x55b838['query'][_0x7775('0x4b')]));_0xcc37ee['attributes']=_0xcc37ee[_0x7775('0x4a')][_0x7775('0x4c')]?_0xcc37ee[_0x7775('0x4a')]:_0x1ce2fb['model'];_0xcc37ee[_0x7775('0x4f')]=qs[_0x7775('0x50')](_0x55b838[_0x7775('0x46')][_0x7775('0x50')]);_0xcc37ee[_0x7775('0x53')]=qs[_0x7775('0x48')](_[_0x7775('0x51')](_0x55b838[_0x7775('0x46')],_0x1ce2fb[_0x7775('0x48')]));if(_0x55b838['query'][_0x7775('0x52')]){_0xcc37ee[_0x7775('0x53')]=_[_0x7775('0x54')](_0xcc37ee['where'],{'$or':_[_0x7775('0x3f')](_0xcc37ee[_0x7775('0x4a')],function(_0x500579){var _0x1c5f6={};_0x1c5f6[_0x500579]={'$like':'%'+_0x55b838[_0x7775('0x46')][_0x7775('0x52')]+'%'};return _0x1c5f6;})});}_0xcc37ee=_[_0x7775('0x54')]({},_0xcc37ee,_0x55b838[_0x7775('0x56')]);return _0x323259[_0x7775('0x9c')](_0xcc37ee);}})[_0x7775('0x23')](function(_0x3ee2f6){if(_0x3ee2f6){_0x4f48cd=_0x3ee2f6['length'];if(!_0x55b838[_0x7775('0x46')][_0x7775('0x4d')](_0x7775('0x4e'))){_0xcc37ee[_0x7775('0x32')]=qs['limit'](_0x55b838[_0x7775('0x46')]['limit']);_0xcc37ee[_0x7775('0x31')]=qs['offset'](_0x55b838[_0x7775('0x46')][_0x7775('0x31')]);}return _0x323259[_0x7775('0x9c')](_0xcc37ee);}})['then'](function(_0xd62005){if(_0xd62005){return _0xd62005?{'count':_0x4f48cd,'rows':_0xd62005}:null;}})[_0x7775('0x23')](respondWithResult(_0x20630c,null))[_0x7775('0x5e')](handleError(_0x20630c,null));};
\ No newline at end of file
+var _0xb0a5=['fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','order','ChatQueueId','findAll','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','findOne','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','all','union','removeAgents','addAgents','spread','userChatQueue:remove','getAgents','fast-json-patch','request-promise','bluebird','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','sendStatus','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes'];(function(_0x1296f0,_0x4331c3){var _0x4b2a0f=function(_0x316f53){while(--_0x316f53){_0x1296f0['push'](_0x1296f0['shift']());}};_0x4b2a0f(++_0x4331c3);}(_0xb0a5,0x1e3));var _0x5b0a=function(_0x5d160,_0xa4838e){_0x5d160=_0x5d160-0x0;var _0x1d180d=_0xb0a5[_0x5d160];return _0x1d180d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5b0a('0x0'));var rp=require(_0x5b0a('0x1'));var moment=require('moment');var BPromise=require(_0x5b0a('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5b0a('0x3'));var sox=require('sox');var csv=require(_0x5b0a('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b0a('0x5'));var _=require('lodash');var squel=require(_0x5b0a('0x6'));var crypto=require('crypto');var jsforce=require(_0x5b0a('0x7'));var deskjs=require(_0x5b0a('0x8'));var toCsv=require(_0x5b0a('0x4'));var querystring=require(_0x5b0a('0x9'));var Papa=require(_0x5b0a('0xa'));var Redis=require(_0x5b0a('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x5b0a('0xc'));var as=require(_0x5b0a('0xd'));var hardwareService=require(_0x5b0a('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0x5b0a('0xf'));var config=require(_0x5b0a('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b0a('0x11'))['db'];config[_0x5b0a('0x12')]=_[_0x5b0a('0x13')](config[_0x5b0a('0x12')],{'host':_0x5b0a('0x14'),'port':0x18eb});var socket=require(_0x5b0a('0x15'))(new Redis(config['redis']));require(_0x5b0a('0x16'))['register'](socket);var jayson=require(_0x5b0a('0x17'));var client=jayson[_0x5b0a('0x18')][_0x5b0a('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x212794,_0x47557e,_0x5dee57,_0x1630ac){return new BPromise(function(_0x37ebdf,_0x43f620){var _0x43253b=_0x1630ac||client;return _0x43253b[_0x5b0a('0x1a')](_0x212794,_0x5dee57)['then'](function(_0x4aa8af){logger['info'](_0x5b0a('0x1b'),_0x47557e,_0x5b0a('0x1c'));logger[_0x5b0a('0x1d')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x47557e,_0x5b0a('0x1c'),JSON[_0x5b0a('0x1e')](_0x4aa8af));if(_0x4aa8af[_0x5b0a('0x1f')]){if(_0x4aa8af[_0x5b0a('0x1f')]['code']===0x1f4){logger[_0x5b0a('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x47557e,_0x4aa8af[_0x5b0a('0x1f')]['message']);return _0x43f620(_0x4aa8af['error'][_0x5b0a('0x20')]);}logger[_0x5b0a('0x1f')](_0x5b0a('0x1b'),_0x47557e,_0x4aa8af['error'][_0x5b0a('0x20')]);return _0x37ebdf(_0x4aa8af['error'][_0x5b0a('0x20')]);}else{logger[_0x5b0a('0x21')](_0x5b0a('0x1b'),_0x47557e,_0x5b0a('0x1c'));_0x37ebdf(_0x4aa8af[_0x5b0a('0x22')][_0x5b0a('0x20')]);}})['catch'](function(_0x595113){logger[_0x5b0a('0x1f')](_0x5b0a('0x1b'),_0x47557e,_0x595113);_0x43f620(_0x595113);});});}function respondWithStatusCode(_0x2a3c5d,_0x4701e9){_0x4701e9=_0x4701e9||0xcc;return function(_0xacb9aa){if(_0xacb9aa){return _0x2a3c5d[_0x5b0a('0x23')](_0x4701e9);}return _0x2a3c5d[_0x5b0a('0x24')](_0x4701e9)['end']();};}function respondWithResult(_0x3dc282,_0x5e4a9e){_0x5e4a9e=_0x5e4a9e||0xc8;return function(_0x46d685){if(_0x46d685){return _0x3dc282[_0x5b0a('0x24')](_0x5e4a9e)[_0x5b0a('0x25')](_0x46d685);}};}function respondWithFilteredResult(_0x586861,_0x418ad1){return function(_0x2bc069){if(_0x2bc069){var _0x466d0d=typeof _0x418ad1[_0x5b0a('0x26')]===_0x5b0a('0x27')&&typeof _0x418ad1['limit']===_0x5b0a('0x27');var _0xb07541=_0x2bc069[_0x5b0a('0x28')];var _0x5e995c=_0x466d0d?0x0:_0x418ad1[_0x5b0a('0x26')];var _0x1b422e=_0x466d0d?_0x2bc069[_0x5b0a('0x28')]:_0x418ad1['offset']+_0x418ad1[_0x5b0a('0x29')];var _0x40b380;if(_0x1b422e>=_0xb07541){_0x1b422e=_0xb07541;_0x40b380=0xc8;}else{_0x40b380=0xce;}_0x586861[_0x5b0a('0x24')](_0x40b380);return _0x586861['set'](_0x5b0a('0x2a'),_0x5e995c+'-'+_0x1b422e+'/'+_0xb07541)[_0x5b0a('0x25')](_0x2bc069);}return null;};}function patchUpdates(_0x2e9916){return function(_0x21d964){try{jsonpatch['apply'](_0x21d964,_0x2e9916,!![]);}catch(_0xead213){return BPromise[_0x5b0a('0x2b')](_0xead213);}return _0x21d964[_0x5b0a('0x2c')]();};}function saveUpdates(_0x1df966,_0x18d91e){return function(_0x21d0f8){if(_0x21d0f8){return _0x21d0f8[_0x5b0a('0x2d')](_0x1df966)[_0x5b0a('0x2e')](function(_0x523635){return _0x523635;});}return null;};}function removeEntity(_0x56f0bf,_0x513930){return function(_0x2e2189){if(_0x2e2189){return _0x2e2189[_0x5b0a('0x2f')]()[_0x5b0a('0x2e')](function(){var _0x5099b7=_0x2e2189[_0x5b0a('0x30')]({'plain':!![]});var _0x421af2=_0x5b0a('0x31');return db[_0x5b0a('0x32')][_0x5b0a('0x2f')]({'where':{'type':_0x421af2,'resourceId':_0x5099b7['id']}})[_0x5b0a('0x2e')](function(){return _0x2e2189;});})[_0x5b0a('0x2e')](function(){_0x56f0bf[_0x5b0a('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5acb63,_0xa4d8c0){return function(_0x15191a){if(!_0x15191a){_0x5acb63[_0x5b0a('0x23')](0x194);}return _0x15191a;};}function handleError(_0x38d47e,_0xcef7ea){_0xcef7ea=_0xcef7ea||0x1f4;return function(_0x2f01b1){logger[_0x5b0a('0x1f')](_0x2f01b1['stack']);if(_0x2f01b1[_0x5b0a('0x33')]){delete _0x2f01b1[_0x5b0a('0x33')];}_0x38d47e[_0x5b0a('0x24')](_0xcef7ea)[_0x5b0a('0x34')](_0x2f01b1);};}exports[_0x5b0a('0x35')]=function(_0x41f746,_0x1ce2cd){var _0x7927c4={},_0x3b0fc5={},_0x266b94={'count':0x0,'rows':[]};var _0x3efc54=_[_0x5b0a('0x36')](db[_0x5b0a('0x37')][_0x5b0a('0x38')],function(_0x3a7cdc){return{'name':_0x3a7cdc[_0x5b0a('0x39')],'type':_0x3a7cdc[_0x5b0a('0x3a')]['key']};});_0x3b0fc5[_0x5b0a('0x3b')]=_[_0x5b0a('0x36')](_0x3efc54,'name');_0x3b0fc5[_0x5b0a('0x3c')]=_[_0x5b0a('0x3d')](_0x41f746[_0x5b0a('0x3c')]);_0x3b0fc5[_0x5b0a('0x3e')]=_[_0x5b0a('0x3f')](_0x3b0fc5['model'],_0x3b0fc5[_0x5b0a('0x3c')]);_0x7927c4[_0x5b0a('0x40')]=_[_0x5b0a('0x3f')](_0x3b0fc5[_0x5b0a('0x3b')],qs[_0x5b0a('0x41')](_0x41f746[_0x5b0a('0x3c')][_0x5b0a('0x41')]));_0x7927c4[_0x5b0a('0x40')]=_0x7927c4[_0x5b0a('0x40')][_0x5b0a('0x42')]?_0x7927c4[_0x5b0a('0x40')]:_0x3b0fc5[_0x5b0a('0x3b')];if(!_0x41f746[_0x5b0a('0x3c')][_0x5b0a('0x43')](_0x5b0a('0x44'))){_0x7927c4['limit']=qs[_0x5b0a('0x29')](_0x41f746[_0x5b0a('0x3c')][_0x5b0a('0x29')]);_0x7927c4['offset']=qs[_0x5b0a('0x26')](_0x41f746['query']['offset']);}_0x7927c4['order']=qs[_0x5b0a('0x45')](_0x41f746[_0x5b0a('0x3c')]['sort']);_0x7927c4[_0x5b0a('0x46')]=qs[_0x5b0a('0x3e')](_[_0x5b0a('0x47')](_0x41f746['query'],_0x3b0fc5[_0x5b0a('0x3e')]),_0x3efc54);if(_0x41f746[_0x5b0a('0x3c')]['filter']){_0x7927c4[_0x5b0a('0x46')]=_[_0x5b0a('0x48')](_0x7927c4[_0x5b0a('0x46')],{'$or':_[_0x5b0a('0x36')](_0x3efc54,function(_0x1b2edc){if(_0x1b2edc[_0x5b0a('0x3a')]!==_0x5b0a('0x49')){var _0x27d83a={};_0x27d83a[_0x1b2edc[_0x5b0a('0x33')]]={'$like':'%'+_0x41f746['query'][_0x5b0a('0x4a')]+'%'};return _0x27d83a;}})});}_0x7927c4=_[_0x5b0a('0x48')]({},_0x7927c4,_0x41f746[_0x5b0a('0x4b')]);var _0x2f3696={'where':_0x7927c4['where']};return db['ChatQueue'][_0x5b0a('0x28')](_0x2f3696)[_0x5b0a('0x2e')](function(_0x27f47f){_0x266b94['count']=_0x27f47f;if(_0x41f746[_0x5b0a('0x3c')][_0x5b0a('0x4c')]){_0x7927c4[_0x5b0a('0x4d')]=[{'all':!![]}];}return db[_0x5b0a('0x37')]['findAll'](_0x7927c4);})[_0x5b0a('0x2e')](function(_0x37fb99){_0x266b94[_0x5b0a('0x4e')]=_0x37fb99;return _0x266b94;})[_0x5b0a('0x2e')](respondWithFilteredResult(_0x1ce2cd,_0x7927c4))[_0x5b0a('0x4f')](handleError(_0x1ce2cd,null));};exports[_0x5b0a('0x50')]=function(_0x8f23cf,_0x562c0f){var _0x292ab9={'raw':!![],'where':{'id':_0x8f23cf[_0x5b0a('0x51')]['id']}},_0x3e688d={};_0x3e688d[_0x5b0a('0x3b')]=_[_0x5b0a('0x3d')](db[_0x5b0a('0x37')]['rawAttributes']);_0x3e688d[_0x5b0a('0x3c')]=_[_0x5b0a('0x3d')](_0x8f23cf[_0x5b0a('0x3c')]);_0x3e688d[_0x5b0a('0x3e')]=_[_0x5b0a('0x3f')](_0x3e688d[_0x5b0a('0x3b')],_0x3e688d[_0x5b0a('0x3c')]);_0x292ab9[_0x5b0a('0x40')]=_['intersection'](_0x3e688d[_0x5b0a('0x3b')],qs['fields'](_0x8f23cf[_0x5b0a('0x3c')]['fields']));_0x292ab9['attributes']=_0x292ab9[_0x5b0a('0x40')][_0x5b0a('0x42')]?_0x292ab9[_0x5b0a('0x40')]:_0x3e688d[_0x5b0a('0x3b')];if(_0x8f23cf[_0x5b0a('0x3c')][_0x5b0a('0x4c')]){_0x292ab9[_0x5b0a('0x4d')]=[{'all':!![]}];}_0x292ab9=_[_0x5b0a('0x48')]({},_0x292ab9,_0x8f23cf[_0x5b0a('0x4b')]);return db['ChatQueue'][_0x5b0a('0x52')](_0x292ab9)[_0x5b0a('0x2e')](handleEntityNotFound(_0x562c0f,null))[_0x5b0a('0x2e')](respondWithResult(_0x562c0f,null))[_0x5b0a('0x4f')](handleError(_0x562c0f,null));};exports[_0x5b0a('0x53')]=function(_0x1a247c,_0x289954){return db['ChatQueue']['create'](_0x1a247c[_0x5b0a('0x54')],{})[_0x5b0a('0x2e')](function(_0x598da2){var _0x40b3ba=_0x1a247c[_0x5b0a('0x55')][_0x5b0a('0x30')]({'plain':!![]});if(!_0x40b3ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40b3ba[_0x5b0a('0x56')]===_0x5b0a('0x55')){var _0x45bd49=_0x598da2[_0x5b0a('0x30')]({'plain':!![]});var _0x1df356=_0x5b0a('0x31');return db['UserProfileSection']['find']({'where':{'name':_0x1df356,'userProfileId':_0x40b3ba[_0x5b0a('0x57')]},'raw':!![]})[_0x5b0a('0x2e')](function(_0x2bdc20){if(_0x2bdc20&&_0x2bdc20['autoAssociation']===0x0){return db['UserProfileResource'][_0x5b0a('0x53')]({'name':_0x45bd49['name'],'resourceId':_0x45bd49['id'],'type':_0x2bdc20[_0x5b0a('0x33')],'sectionId':_0x2bdc20['id']},{})['then'](function(){return _0x598da2;});}else{return _0x598da2;}})['catch'](function(_0x10d297){logger['error'](_0x5b0a('0x58'),_0x10d297);throw _0x10d297;});}return _0x598da2;})[_0x5b0a('0x2e')](respondWithResult(_0x289954,0xc9))[_0x5b0a('0x4f')](handleError(_0x289954,null));};exports[_0x5b0a('0x2d')]=function(_0x4490c7,_0xf4cd05){if(_0x4490c7[_0x5b0a('0x54')]['id']){delete _0x4490c7[_0x5b0a('0x54')]['id'];}return db['ChatQueue'][_0x5b0a('0x52')]({'where':{'id':_0x4490c7['params']['id']}})[_0x5b0a('0x2e')](handleEntityNotFound(_0xf4cd05,null))[_0x5b0a('0x2e')](saveUpdates(_0x4490c7[_0x5b0a('0x54')],null))['then'](respondWithResult(_0xf4cd05,null))[_0x5b0a('0x4f')](handleError(_0xf4cd05,null));};exports[_0x5b0a('0x2f')]=function(_0x5b2210,_0x4704f4){return db[_0x5b0a('0x37')]['find']({'where':{'id':_0x5b2210[_0x5b0a('0x51')]['id']}})['then'](handleEntityNotFound(_0x4704f4,null))['then'](removeEntity(_0x4704f4,null))[_0x5b0a('0x4f')](handleError(_0x4704f4,null));};exports[_0x5b0a('0x59')]=function(_0x3fa50a,_0x4e7346){return db[_0x5b0a('0x37')]['describe']()[_0x5b0a('0x2e')](respondWithResult(_0x4e7346,null))[_0x5b0a('0x4f')](handleError(_0x4e7346,null));};exports[_0x5b0a('0x5a')]=function(_0x56a4c7,_0x39c6ed,_0x21a5e6){var _0x258b0e={'raw':!![],'where':{}},_0x1df42f={},_0x349556;return db[_0x5b0a('0x37')]['findOne']({'where':{'id':_0x56a4c7[_0x5b0a('0x51')]['id']}})['then'](handleEntityNotFound(_0x39c6ed,null))[_0x5b0a('0x2e')](function(_0x2e89d2){if(_0x2e89d2){_0x349556=_0x2e89d2[_0x5b0a('0x30')]({'plain':!![]});_0x1df42f[_0x5b0a('0x3b')]=_[_0x5b0a('0x3d')](db[_0x5b0a('0x5b')][_0x5b0a('0x38')]);_0x1df42f['query']=_[_0x5b0a('0x3d')](_0x56a4c7[_0x5b0a('0x3c')]);_0x1df42f[_0x5b0a('0x3e')]=_[_0x5b0a('0x3f')](_0x1df42f[_0x5b0a('0x3b')],_0x1df42f[_0x5b0a('0x3c')]);_0x258b0e[_0x5b0a('0x40')]=_[_0x5b0a('0x3f')](_0x1df42f[_0x5b0a('0x3b')],qs[_0x5b0a('0x41')](_0x56a4c7[_0x5b0a('0x3c')][_0x5b0a('0x41')]));_0x258b0e[_0x5b0a('0x40')]=_0x258b0e[_0x5b0a('0x40')][_0x5b0a('0x42')]?_0x258b0e[_0x5b0a('0x40')]:_0x1df42f[_0x5b0a('0x3b')];if(!_0x56a4c7[_0x5b0a('0x3c')][_0x5b0a('0x43')]('nolimit')){_0x258b0e['limit']=qs[_0x5b0a('0x29')](_0x56a4c7[_0x5b0a('0x3c')]['limit']);_0x258b0e[_0x5b0a('0x26')]=qs[_0x5b0a('0x26')](_0x56a4c7[_0x5b0a('0x3c')][_0x5b0a('0x26')]);}_0x258b0e[_0x5b0a('0x5c')]=qs[_0x5b0a('0x45')](_0x56a4c7[_0x5b0a('0x3c')]['sort']);_0x258b0e[_0x5b0a('0x46')]=qs['filters'](_[_0x5b0a('0x47')](_0x56a4c7['query'],_0x1df42f[_0x5b0a('0x3e')]));_0x258b0e[_0x5b0a('0x46')][_0x5b0a('0x5d')]=_0x2e89d2['id'];if(_0x56a4c7['query'][_0x5b0a('0x4a')]){_0x258b0e['where']=_[_0x5b0a('0x48')](_0x258b0e['where'],{'$or':_[_0x5b0a('0x36')](_0x258b0e[_0x5b0a('0x40')],function(_0x2db562){var _0x41db0d={};_0x41db0d[_0x2db562]={'$like':'%'+_0x56a4c7[_0x5b0a('0x3c')][_0x5b0a('0x4a')]+'%'};return _0x41db0d;})});}_0x258b0e=_[_0x5b0a('0x48')]({},_0x258b0e,_0x56a4c7[_0x5b0a('0x4b')]);return db[_0x5b0a('0x5b')][_0x5b0a('0x5e')](_0x258b0e);}})['then'](function(_0x4e064c){if(_0x4e064c){return db[_0x5b0a('0x5f')][_0x5b0a('0x60')]({'where':{'id':_[_0x5b0a('0x36')](_0x4e064c,'UserId'),'role':_0x5b0a('0x61')},'attributes':['id',_0x5b0a('0x33'),_0x5b0a('0x62'),_0x5b0a('0x63'),_0x5b0a('0x64')]});}})[_0x5b0a('0x2e')](function(_0x5b9dc1){if(_0x5b9dc1){return{'count':_0x5b9dc1[_0x5b0a('0x28')],'rows':_['map'](_0x5b9dc1[_0x5b0a('0x4e')],function(_0x1a3f4a){return{'membername':_0x1a3f4a[_0x5b0a('0x33')],'UserId':_0x1a3f4a['id'],'queue_name':_0x349556[_0x5b0a('0x33')],'ChatQueueId':_0x349556['id'],'interface':util['format'](_0x5b0a('0x65'),_0x5b0a('0x66'),_0x1a3f4a['name']),'penalty':0x0,'paused':_0x1a3f4a['chatPause'],'createdAt':_0x1a3f4a[_0x5b0a('0x64')],'updatedAt':_0x1a3f4a[_0x5b0a('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5b0a('0x2e')](respondWithFilteredResult(_0x39c6ed,_0x258b0e))[_0x5b0a('0x4f')](handleError(_0x39c6ed,null));};exports['getTeams']=function(_0x2ec51b,_0x2d572f,_0x2288fe){var _0x2f525d={};var _0x86293={};var _0x5d92fb;var _0x25fb9e;return db['ChatQueue'][_0x5b0a('0x67')]({'where':{'id':_0x2ec51b['params']['id']}})[_0x5b0a('0x2e')](handleEntityNotFound(_0x2d572f,null))['then'](function(_0x2d65c5){if(_0x2d65c5){_0x5d92fb=_0x2d65c5;_0x86293[_0x5b0a('0x3b')]=_[_0x5b0a('0x3d')](db['Team'][_0x5b0a('0x38')]);_0x86293['query']=_[_0x5b0a('0x3d')](_0x2ec51b['query']);_0x86293['filters']=_['intersection'](_0x86293[_0x5b0a('0x3b')],_0x86293['query']);_0x2f525d['attributes']=_[_0x5b0a('0x3f')](_0x86293[_0x5b0a('0x3b')],qs[_0x5b0a('0x41')](_0x2ec51b[_0x5b0a('0x3c')][_0x5b0a('0x41')]));_0x2f525d['attributes']=_0x2f525d[_0x5b0a('0x40')]['length']?_0x2f525d[_0x5b0a('0x40')]:_0x86293[_0x5b0a('0x3b')];_0x2f525d[_0x5b0a('0x5c')]=qs[_0x5b0a('0x45')](_0x2ec51b['query'][_0x5b0a('0x45')]);_0x2f525d[_0x5b0a('0x46')]=qs[_0x5b0a('0x3e')](_['pick'](_0x2ec51b[_0x5b0a('0x3c')],_0x86293[_0x5b0a('0x3e')]));if(_0x2ec51b[_0x5b0a('0x3c')][_0x5b0a('0x4a')]){_0x2f525d['where']=_[_0x5b0a('0x48')](_0x2f525d['where'],{'$or':_[_0x5b0a('0x36')](_0x2f525d[_0x5b0a('0x40')],function(_0x3d70b5){var _0x2d0f38={};_0x2d0f38[_0x3d70b5]={'$like':'%'+_0x2ec51b[_0x5b0a('0x3c')][_0x5b0a('0x4a')]+'%'};return _0x2d0f38;})});}_0x2f525d=_[_0x5b0a('0x48')]({},_0x2f525d,_0x2ec51b['options']);return _0x5d92fb[_0x5b0a('0x68')](_0x2f525d);}})[_0x5b0a('0x2e')](function(_0x3a20d2){if(_0x3a20d2){_0x25fb9e=_0x3a20d2[_0x5b0a('0x42')];if(!_0x2ec51b[_0x5b0a('0x3c')]['hasOwnProperty']('nolimit')){_0x2f525d[_0x5b0a('0x29')]=qs[_0x5b0a('0x29')](_0x2ec51b[_0x5b0a('0x3c')]['limit']);_0x2f525d[_0x5b0a('0x26')]=qs[_0x5b0a('0x26')](_0x2ec51b['query'][_0x5b0a('0x26')]);}return _0x5d92fb[_0x5b0a('0x68')](_0x2f525d);}})['then'](function(_0x1b3acd){if(_0x1b3acd){return _0x1b3acd?{'count':_0x25fb9e,'rows':_0x1b3acd}:null;}})['then'](respondWithResult(_0x2d572f,null))[_0x5b0a('0x4f')](handleError(_0x2d572f,null));};exports[_0x5b0a('0x69')]=function(_0x2c5b4c,_0xf7472a,_0x257924){var _0x56da7e=_0x2c5b4c[_0x5b0a('0x54')][_0x5b0a('0x6a')];return db[_0x5b0a('0x6b')][_0x5b0a('0x5e')]({'where':{'id':_0x56da7e},'attributes':['id'],'include':[{'model':db[_0x5b0a('0x5f')],'as':_0x5b0a('0x6c'),'attributes':['id',_0x5b0a('0x33'),_0x5b0a('0x6d'),_0x5b0a('0x6e'),_0x5b0a('0x6f')],'raw':!![]}]})[_0x5b0a('0x2e')](function(_0x45f724){if(_0x45f724){var _0x206265=_[_0x5b0a('0x70')](_0x45f724,function(_0xb9b775){var _0x294495=_0xb9b775['get']({'plain':!![]});return _0x294495[_0x5b0a('0x6c')];});return db[_0x5b0a('0x37')][_0x5b0a('0x52')]({'where':{'id':_0x2c5b4c[_0x5b0a('0x51')]['id']}})[_0x5b0a('0x2e')](function(_0x4500f3){return db[_0x5b0a('0x71')][_0x5b0a('0x72')](function(_0x1e2b1b){return _0x4500f3[_0x5b0a('0x69')](_0x56da7e,{'transaction':_0x1e2b1b})['then'](function(){return BPromise['each'](_0x206265,function(_0x312e89){return db[_0x5b0a('0x5b')][_0x5b0a('0x73')]({'where':{'UserId':_0x312e89['id'],'ChatQueueId':_0x2c5b4c[_0x5b0a('0x51')]['id']},'transaction':_0x1e2b1b});});})['then'](function(){_0x206265[_0x5b0a('0x74')](function(_0x44ad98){socket[_0x5b0a('0x75')](_0x5b0a('0x76'),{'UserId':_0x44ad98['id'],'ChatQueueId':_0x4500f3['id']});});});});});}})['then'](respondWithStatusCode(_0xf7472a,null))[_0x5b0a('0x4f')](handleError(_0xf7472a,null));};exports[_0x5b0a('0x77')]=function(_0x13aaca,_0x59a310,_0x22435c){return db[_0x5b0a('0x6b')][_0x5b0a('0x5e')]({'where':{'id':_0x13aaca[_0x5b0a('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5b0a('0x5f')],'as':_0x5b0a('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x5b0a('0x2e')](handleEntityNotFound(_0x59a310,null))[_0x5b0a('0x2e')](function(_0x326195){var _0x37a1c4=_[_0x5b0a('0x36')](_0x326195,'id');var _0x3c6db8=[];var _0x170179=[];var _0x453e06=squel[_0x5b0a('0x78')]();_0x453e06[_0x5b0a('0x79')](_0x5b0a('0x7a'))['from']('team_has_chat_queues','tq')['join'](_0x5b0a('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x5b0a('0x46')](_0x5b0a('0x7c'),_0x13aaca[_0x5b0a('0x51')]['id']);for(var _0x2cb6f7=0x0;_0x2cb6f7<_0x326195['length'];_0x2cb6f7+=0x1){let _0x1356b9=_0x326195[_0x2cb6f7];for(var _0x3860ad=0x0;_0x3860ad<_0x1356b9['Agents']['length'];_0x3860ad+=0x1){let _0x217d39=_0x1356b9[_0x5b0a('0x6c')][_0x3860ad];var _0x25cb35=_0x453e06[_0x5b0a('0x7d')]();_0x25cb35[_0x5b0a('0x46')](_0x5b0a('0x7e'),_0x217d39['id']);_0x170179[_0x5b0a('0x7f')](db[_0x5b0a('0x71')][_0x5b0a('0x3c')](_0x25cb35['toString'](),{'type':db[_0x5b0a('0x71')][_0x5b0a('0x80')]['SELECT']})['then'](function(_0x30b298){if(_0x30b298[_0x5b0a('0x42')]===0x1){return _0x217d39['id'];}else{var _0x52c551=_[_0x5b0a('0x81')](_['map'](_0x30b298,'TeamId'),function(_0x40021c){return _['includes'](_0x37a1c4,_0x40021c);});if(_0x52c551){return _0x217d39['id'];}}}));}}return BPromise[_0x5b0a('0x82')](_0x170179)['then'](function(_0x14c1df){_0x3c6db8=_(_0x3c6db8)[_0x5b0a('0x83')](_0x14c1df)['compact']()['value']();return db[_0x5b0a('0x37')][_0x5b0a('0x52')]({'where':{'id':_0x13aaca[_0x5b0a('0x51')]['id']}})[_0x5b0a('0x2e')](function(_0x1118f4){return db[_0x5b0a('0x71')][_0x5b0a('0x72')](function(_0x807b5a){return _0x1118f4[_0x5b0a('0x77')](_0x13aaca[_0x5b0a('0x3c')][_0x5b0a('0x6a')],{'transaction':_0x807b5a})[_0x5b0a('0x2e')](function(){if(!_['isEmpty'](_0x3c6db8)){return _0x1118f4[_0x5b0a('0x84')](_0x3c6db8,{'transaction':_0x807b5a});}})['then'](function(){_0x3c6db8['forEach'](function(_0x2179e0){socket['emit']('userChatQueue:remove',{'UserId':_0x2179e0,'ChatQueueId':_0x1118f4['id']});});});});});});})[_0x5b0a('0x2e')](respondWithStatusCode(_0x59a310,null))[_0x5b0a('0x4f')](handleError(_0x59a310,null));};exports['addAgents']=function(_0x43724a,_0x4fe728,_0x445fa0){return db[_0x5b0a('0x37')][_0x5b0a('0x52')]({'where':{'id':_0x43724a[_0x5b0a('0x51')]['id']}})[_0x5b0a('0x2e')](handleEntityNotFound(_0x4fe728,null))[_0x5b0a('0x2e')](function(_0x27f004){if(_0x27f004){return _0x27f004[_0x5b0a('0x85')](_0x43724a[_0x5b0a('0x54')]['ids'],_['omit'](_0x43724a[_0x5b0a('0x54')],['ids','id'])||{})[_0x5b0a('0x86')](function(_0x5462a4){for(var _0x51c988=0x0;_0x51c988<_0x43724a[_0x5b0a('0x54')][_0x5b0a('0x6a')][_0x5b0a('0x42')];_0x51c988+=0x1){socket[_0x5b0a('0x75')](_0x5b0a('0x76'),{'UserId':Number(_0x43724a[_0x5b0a('0x54')][_0x5b0a('0x6a')][_0x51c988]),'ChatQueueId':Number(_0x43724a[_0x5b0a('0x51')]['id'])});}return _0x5462a4;});}})[_0x5b0a('0x2e')](respondWithResult(_0x4fe728,null))[_0x5b0a('0x4f')](handleError(_0x4fe728,null));};exports[_0x5b0a('0x84')]=function(_0x28d001,_0x362aaa,_0x47f0c9){return db[_0x5b0a('0x37')][_0x5b0a('0x52')]({'where':{'id':_0x28d001[_0x5b0a('0x51')]['id']}})['then'](handleEntityNotFound(_0x362aaa,null))['then'](function(_0x44fec1){if(_0x44fec1){return _0x44fec1['removeAgents'](_0x28d001[_0x5b0a('0x3c')][_0x5b0a('0x6a')])[_0x5b0a('0x2e')](function(){if(_['isArray'](_0x28d001[_0x5b0a('0x3c')][_0x5b0a('0x6a')])){for(var _0x3047c0=0x0;_0x3047c0<_0x28d001['query'][_0x5b0a('0x6a')]['length'];_0x3047c0+=0x1){socket[_0x5b0a('0x75')](_0x5b0a('0x87'),{'UserId':Number(_0x28d001['query'][_0x5b0a('0x6a')][_0x3047c0]),'ChatQueueId':Number(_0x28d001[_0x5b0a('0x51')]['id'])});}}else{socket[_0x5b0a('0x75')](_0x5b0a('0x87'),{'UserId':Number(_0x28d001[_0x5b0a('0x3c')]['ids']),'ChatQueueId':Number(_0x28d001[_0x5b0a('0x51')]['id'])});}});}})['then'](respondWithStatusCode(_0x362aaa,null))[_0x5b0a('0x4f')](handleError(_0x362aaa,null));};exports[_0x5b0a('0x88')]=function(_0x1bacc5,_0x12e36f,_0x65ddf4){var _0x3d7247={};var _0x134a6f={};var _0x5da1dd;var _0x27f3b1;return db['ChatQueue'][_0x5b0a('0x67')]({'where':{'id':_0x1bacc5[_0x5b0a('0x51')]['id']}})['then'](handleEntityNotFound(_0x12e36f,null))['then'](function(_0x4caf7b){if(_0x4caf7b){_0x5da1dd=_0x4caf7b;_0x134a6f[_0x5b0a('0x3b')]=_[_0x5b0a('0x3d')](db[_0x5b0a('0x5f')][_0x5b0a('0x38')]);_0x134a6f[_0x5b0a('0x3c')]=_[_0x5b0a('0x3d')](_0x1bacc5[_0x5b0a('0x3c')]);_0x134a6f['filters']=_[_0x5b0a('0x3f')](_0x134a6f[_0x5b0a('0x3b')],_0x134a6f[_0x5b0a('0x3c')]);_0x3d7247[_0x5b0a('0x40')]=_[_0x5b0a('0x3f')](_0x134a6f[_0x5b0a('0x3b')],qs['fields'](_0x1bacc5[_0x5b0a('0x3c')][_0x5b0a('0x41')]));_0x3d7247[_0x5b0a('0x40')]=_0x3d7247['attributes'][_0x5b0a('0x42')]?_0x3d7247[_0x5b0a('0x40')]:_0x134a6f[_0x5b0a('0x3b')];_0x3d7247['order']=qs[_0x5b0a('0x45')](_0x1bacc5['query'][_0x5b0a('0x45')]);_0x3d7247[_0x5b0a('0x46')]=qs[_0x5b0a('0x3e')](_[_0x5b0a('0x47')](_0x1bacc5[_0x5b0a('0x3c')],_0x134a6f[_0x5b0a('0x3e')]));if(_0x1bacc5['query']['filter']){_0x3d7247[_0x5b0a('0x46')]=_['merge'](_0x3d7247['where'],{'$or':_[_0x5b0a('0x36')](_0x3d7247[_0x5b0a('0x40')],function(_0x17360f){var _0x3fdfa5={};_0x3fdfa5[_0x17360f]={'$like':'%'+_0x1bacc5[_0x5b0a('0x3c')][_0x5b0a('0x4a')]+'%'};return _0x3fdfa5;})});}_0x3d7247=_[_0x5b0a('0x48')]({},_0x3d7247,_0x1bacc5[_0x5b0a('0x4b')]);return _0x5da1dd['getAgents'](_0x3d7247);}})[_0x5b0a('0x2e')](function(_0x49251a){if(_0x49251a){_0x27f3b1=_0x49251a['length'];if(!_0x1bacc5[_0x5b0a('0x3c')][_0x5b0a('0x43')](_0x5b0a('0x44'))){_0x3d7247['limit']=qs[_0x5b0a('0x29')](_0x1bacc5[_0x5b0a('0x3c')]['limit']);_0x3d7247['offset']=qs[_0x5b0a('0x26')](_0x1bacc5['query']['offset']);}return _0x5da1dd[_0x5b0a('0x88')](_0x3d7247);}})[_0x5b0a('0x2e')](function(_0x5603b6){if(_0x5603b6){return _0x5603b6?{'count':_0x27f3b1,'rows':_0x5603b6}:null;}})[_0x5b0a('0x2e')](respondWithResult(_0x12e36f,null))['catch'](handleError(_0x12e36f,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 9b00253..309cfc3 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 _0x59a0=['exports','events','../../mysqldb','ChatQueue','save','update','remove','emit','hook'];(function(_0x37a887,_0x5abb88){var _0x52ff95=function(_0x4065ee){while(--_0x4065ee){_0x37a887['push'](_0x37a887['shift']());}};_0x52ff95(++_0x5abb88);}(_0x59a0,0x184));var _0x059a=function(_0x2717e6,_0x397bff){_0x2717e6=_0x2717e6-0x0;var _0x2944f1=_0x59a0[_0x2717e6];return _0x2944f1;};'use strict';var EventEmitter=require(_0x059a('0x0'));var ChatQueue=require(_0x059a('0x1'))['db'][_0x059a('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x059a('0x3'),'afterUpdate':_0x059a('0x4'),'afterDestroy':_0x059a('0x5')};function emitEvent(_0x36e384){return function(_0x542f60,_0x5a637e,_0x5d1a34){ChatQueueEvents['emit'](_0x36e384+':'+_0x542f60['id'],_0x542f60);ChatQueueEvents[_0x059a('0x6')](_0x36e384,_0x542f60);_0x5d1a34(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x059a('0x7')](e,emitEvent(event));}}module[_0x059a('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x8734=['update','emit','events','ChatQueue','setMaxListeners','save'];(function(_0x2a7ed0,_0x23e60f){var _0x56c2cb=function(_0x429885){while(--_0x429885){_0x2a7ed0['push'](_0x2a7ed0['shift']());}};_0x56c2cb(++_0x23e60f);}(_0x8734,0x134));var _0x4873=function(_0xd6df5e,_0x4a4e46){_0xd6df5e=_0xd6df5e-0x0;var _0x155b12=_0x8734[_0xd6df5e];return _0x155b12;};'use strict';var EventEmitter=require(_0x4873('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x4873('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4873('0x2')](0x0);var events={'afterCreate':_0x4873('0x3'),'afterUpdate':_0x4873('0x4'),'afterDestroy':'remove'};function emitEvent(_0x35bd54){return function(_0x5bcb32,_0x1ae455,_0x2528ff){ChatQueueEvents['emit'](_0x35bd54+':'+_0x5bcb32['id'],_0x5bcb32);ChatQueueEvents[_0x4873('0x5')](_0x35bd54,_0x5bcb32);_0x2528ff(null);};}for(var e in events){if(events['hasOwnProperty'](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 a31c146..a03d4e1 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 _0x1ddb=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','ChatQueue','lodash','util','../../config/logger','api'];(function(_0x5165a2,_0x2fc38d){var _0x5edefb=function(_0x275942){while(--_0x275942){_0x5165a2['push'](_0x5165a2['shift']());}};_0x5edefb(++_0x2fc38d);}(_0x1ddb,0x125));var _0xb1dd=function(_0x2de564,_0x14ac58){_0x2de564=_0x2de564-0x0;var _0x5b7809=_0x1ddb[_0x2de564];return _0x5b7809;};'use strict';var _=require(_0xb1dd('0x0'));var util=require(_0xb1dd('0x1'));var logger=require(_0xb1dd('0x2'))(_0xb1dd('0x3'));var moment=require(_0xb1dd('0x4'));var BPromise=require(_0xb1dd('0x5'));var rp=require(_0xb1dd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb1dd('0x7'));var config=require(_0xb1dd('0x8'));var attributes=require(_0xb1dd('0x9'));module['exports']=function(_0xe9628,_0x17b35d){return _0xe9628['define'](_0xb1dd('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x70a0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','util','../../config/logger','api'];(function(_0x5cc231,_0x40002f){var _0x1f48c2=function(_0x32a83f){while(--_0x32a83f){_0x5cc231['push'](_0x5cc231['shift']());}};_0x1f48c2(++_0x40002f);}(_0x70a0,0x1d6));var _0x070a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x70a0[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x070a('0x0'));var logger=require(_0x070a('0x1'))(_0x070a('0x2'));var moment=require(_0x070a('0x3'));var BPromise=require(_0x070a('0x4'));var rp=require(_0x070a('0x5'));var fs=require('fs');var path=require(_0x070a('0x6'));var rimraf=require(_0x070a('0x7'));var config=require(_0x070a('0x8'));var attributes=require(_0x070a('0x9'));module[_0x070a('0xa')]=function(_0x1ebed0,_0x112fe0){return _0x1ebed0['define']('ChatQueue',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 540f4d4..3225ae9 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 _0x9bb3=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','map','include','model','debug','ShowChatQueue','lodash','util','moment','bluebird'];(function(_0xaca3f,_0x52732c){var _0x386c4d=function(_0x3542ad){while(--_0x3542ad){_0xaca3f['push'](_0xaca3f['shift']());}};_0x386c4d(++_0x52732c);}(_0x9bb3,0x134));var _0x39bb=function(_0x19f5a7,_0x5c99bc){_0x19f5a7=_0x19f5a7-0x0;var _0x6f4800=_0x9bb3[_0x19f5a7];return _0x6f4800;};'use strict';var _=require(_0x39bb('0x0'));var util=require(_0x39bb('0x1'));var moment=require(_0x39bb('0x2'));var BPromise=require(_0x39bb('0x3'));var rs=require(_0x39bb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x39bb('0x5'));var logger=require(_0x39bb('0x6'))(_0x39bb('0x7'));var config=require(_0x39bb('0x8'));var jayson=require(_0x39bb('0x9'));var client=jayson[_0x39bb('0xa')][_0x39bb('0xb')]({'port':0x232a});config[_0x39bb('0xc')]=_[_0x39bb('0xd')](config[_0x39bb('0xc')],{'host':_0x39bb('0xe'),'port':0x18eb});var socket=require(_0x39bb('0xf'))(new Redis(config[_0x39bb('0xc')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x3eb2f9,_0x39362a,_0x4b7e6f){return new BPromise(function(_0x15c485,_0x5215fb){return client[_0x39bb('0x10')](_0x3eb2f9,_0x4b7e6f)[_0x39bb('0x11')](function(_0x2fce1c){logger['info'](_0x39bb('0x12'),_0x39362a,'request\x20sent');logger['debug'](_0x39bb('0x13'),_0x39362a,_0x39bb('0x14'),JSON[_0x39bb('0x15')](_0x2fce1c));if(_0x2fce1c[_0x39bb('0x16')]){if(_0x2fce1c[_0x39bb('0x16')][_0x39bb('0x17')]===0x1f4){logger[_0x39bb('0x16')]('ChatQueue,\x20%s,\x20%s',_0x39362a,_0x2fce1c['error'][_0x39bb('0x18')]);return _0x5215fb(_0x2fce1c['error'][_0x39bb('0x18')]);}logger[_0x39bb('0x16')](_0x39bb('0x12'),_0x39362a,_0x2fce1c[_0x39bb('0x16')][_0x39bb('0x18')]);return _0x15c485(_0x2fce1c[_0x39bb('0x16')][_0x39bb('0x18')]);}else{logger[_0x39bb('0x19')](_0x39bb('0x12'),_0x39362a,_0x39bb('0x14'));_0x15c485(_0x2fce1c['result'][_0x39bb('0x18')]);}})[_0x39bb('0x1a')](function(_0x369be0){logger['error'](_0x39bb('0x12'),_0x39362a,_0x369be0);_0x5215fb(_0x369be0);});});}exports[_0x39bb('0x1b')]=function(_0xd92981){var _0x1b90a4=this;return new Promise(function(_0x148fe1,_0xfa6090){return db[_0x39bb('0x1c')][_0x39bb('0x1d')]({'raw':_0xd92981['options']?_0xd92981[_0x39bb('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xd92981['options']?_0xd92981[_0x39bb('0x1e')][_0x39bb('0x1f')]||null:null,'attributes':_0xd92981['options']?_0xd92981['options'][_0x39bb('0x20')]||null:null,'limit':_0xd92981[_0x39bb('0x1e')]?_0xd92981['options'][_0x39bb('0x21')]||null:null,'include':_0xd92981[_0x39bb('0x1e')]?_0xd92981[_0x39bb('0x1e')]['include']?_[_0x39bb('0x22')](_0xd92981['options'][_0x39bb('0x23')],function(_0x3d1cef){return{'model':db[_0x3d1cef[_0x39bb('0x24')]],'as':_0x3d1cef['as'],'attributes':_0x3d1cef[_0x39bb('0x20')],'include':_0x3d1cef[_0x39bb('0x23')]?_['map'](_0x3d1cef['include'],function(_0xe597b8){return{'model':db[_0xe597b8[_0x39bb('0x24')]],'as':_0xe597b8['as'],'attributes':_0xe597b8['attributes'],'include':_0xe597b8['include']?_[_0x39bb('0x22')](_0xe597b8[_0x39bb('0x23')],function(_0x14440b){return{'model':db[_0x14440b['model']],'as':_0x14440b['as'],'attributes':_0x14440b[_0x39bb('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f9fe2){logger[_0x39bb('0x19')]('GetChatQueue',_0xd92981);logger[_0x39bb('0x25')](_0x39bb('0x1b'),_0xd92981,JSON[_0x39bb('0x15')](_0x1f9fe2));_0x148fe1(_0x1f9fe2);})[_0x39bb('0x1a')](function(_0x1cdef1){logger[_0x39bb('0x16')](_0x39bb('0x1b'),_0x1cdef1[_0x39bb('0x18')],_0xd92981);_0xfa6090(_0x1b90a4[_0x39bb('0x16')](0x1f4,_0x1cdef1[_0x39bb('0x18')]));});});};exports[_0x39bb('0x26')]=function(_0x3e137a){var _0x370d22=this;return new Promise(function(_0x5e0ae8,_0x182460){return db[_0x39bb('0x1c')]['find']({'raw':_0x3e137a[_0x39bb('0x1e')]?_0x3e137a[_0x39bb('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3e137a[_0x39bb('0x1e')]?_0x3e137a[_0x39bb('0x1e')][_0x39bb('0x1f')]||null:null,'attributes':_0x3e137a['options']?_0x3e137a['options']['attributes']||null:null,'include':_0x3e137a[_0x39bb('0x1e')]?_0x3e137a[_0x39bb('0x1e')][_0x39bb('0x23')]?_[_0x39bb('0x22')](_0x3e137a['options'][_0x39bb('0x23')],function(_0x4cd284){return{'model':db[_0x4cd284[_0x39bb('0x24')]],'as':_0x4cd284['as'],'attributes':_0x4cd284['attributes'],'include':_0x4cd284['include']?_['map'](_0x4cd284['include'],function(_0x16e8ea){return{'model':db[_0x16e8ea[_0x39bb('0x24')]],'as':_0x16e8ea['as'],'attributes':_0x16e8ea['attributes'],'include':_0x16e8ea[_0x39bb('0x23')]?_[_0x39bb('0x22')](_0x16e8ea['include'],function(_0x4c62a0){return{'model':db[_0x4c62a0[_0x39bb('0x24')]],'as':_0x4c62a0['as'],'attributes':_0x4c62a0[_0x39bb('0x20')]};}):[]};}):[]};}):[]:[]})[_0x39bb('0x11')](function(_0x119ac7){logger[_0x39bb('0x19')](_0x39bb('0x26'),_0x3e137a);logger[_0x39bb('0x25')](_0x39bb('0x26'),_0x3e137a,JSON[_0x39bb('0x15')](_0x119ac7));_0x5e0ae8(_0x119ac7);})[_0x39bb('0x1a')](function(_0x94de2b){logger['error']('ShowChatQueue',_0x94de2b[_0x39bb('0x18')],_0x3e137a);_0x182460(_0x370d22[_0x39bb('0x16')](0x1f4,_0x94de2b[_0x39bb('0x18')]));});});};
\ No newline at end of file
+var _0x0664=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatQueue.socket','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','model','ShowChatQueue','find','then','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x252699,_0x134b4e){var _0x56d0c6=function(_0x5551a8){while(--_0x5551a8){_0x252699['push'](_0x252699['shift']());}};_0x56d0c6(++_0x134b4e);}(_0x0664,0x93));var _0x4066=function(_0x3790c1,_0x596e3a){_0x3790c1=_0x3790c1-0x0;var _0x334c6d=_0x0664[_0x3790c1];return _0x334c6d;};'use strict';var _=require('lodash');var util=require(_0x4066('0x0'));var moment=require('moment');var BPromise=require(_0x4066('0x1'));var rs=require(_0x4066('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4066('0x3'))['db'];var utils=require(_0x4066('0x4'));var logger=require(_0x4066('0x5'))(_0x4066('0x6'));var config=require(_0x4066('0x7'));var jayson=require(_0x4066('0x8'));var client=jayson[_0x4066('0x9')][_0x4066('0xa')]({'port':0x232a});config[_0x4066('0xb')]=_[_0x4066('0xc')](config['redis'],{'host':_0x4066('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4066('0xb')]));require(_0x4066('0xe'))['register'](socket);function respondWithRpcPromise(_0x5f3d44,_0x1da4d8,_0x3ea971){return new BPromise(function(_0x16a1f7,_0x41ad8b){return client['request'](_0x5f3d44,_0x3ea971)['then'](function(_0x52d31c){logger['info'](_0x4066('0xf'),_0x1da4d8,_0x4066('0x10'));logger[_0x4066('0x11')](_0x4066('0x12'),_0x1da4d8,_0x4066('0x10'),JSON[_0x4066('0x13')](_0x52d31c));if(_0x52d31c[_0x4066('0x14')]){if(_0x52d31c[_0x4066('0x14')]['code']===0x1f4){logger[_0x4066('0x14')](_0x4066('0xf'),_0x1da4d8,_0x52d31c['error'][_0x4066('0x15')]);return _0x41ad8b(_0x52d31c['error'][_0x4066('0x15')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x1da4d8,_0x52d31c[_0x4066('0x14')][_0x4066('0x15')]);return _0x16a1f7(_0x52d31c[_0x4066('0x14')][_0x4066('0x15')]);}else{logger[_0x4066('0x16')](_0x4066('0xf'),_0x1da4d8,_0x4066('0x10'));_0x16a1f7(_0x52d31c[_0x4066('0x17')][_0x4066('0x15')]);}})[_0x4066('0x18')](function(_0x511cfa){logger['error'](_0x4066('0xf'),_0x1da4d8,_0x511cfa);_0x41ad8b(_0x511cfa);});});}exports[_0x4066('0x19')]=function(_0x5b02a4){var _0x414e6c=this;return new Promise(function(_0x215d68,_0x382950){return db[_0x4066('0x1a')][_0x4066('0x1b')]({'raw':_0x5b02a4[_0x4066('0x1c')]?_0x5b02a4['options']['raw']===undefined?!![]:![]:!![],'where':_0x5b02a4['options']?_0x5b02a4['options'][_0x4066('0x1d')]||null:null,'attributes':_0x5b02a4[_0x4066('0x1c')]?_0x5b02a4[_0x4066('0x1c')][_0x4066('0x1e')]||null:null,'limit':_0x5b02a4[_0x4066('0x1c')]?_0x5b02a4['options'][_0x4066('0x1f')]||null:null,'include':_0x5b02a4[_0x4066('0x1c')]?_0x5b02a4[_0x4066('0x1c')][_0x4066('0x20')]?_[_0x4066('0x21')](_0x5b02a4['options']['include'],function(_0x2984ef){return{'model':db[_0x2984ef[_0x4066('0x22')]],'as':_0x2984ef['as'],'attributes':_0x2984ef[_0x4066('0x1e')],'include':_0x2984ef[_0x4066('0x20')]?_[_0x4066('0x21')](_0x2984ef[_0x4066('0x20')],function(_0x1f9e34){return{'model':db[_0x1f9e34[_0x4066('0x22')]],'as':_0x1f9e34['as'],'attributes':_0x1f9e34[_0x4066('0x1e')],'include':_0x1f9e34[_0x4066('0x20')]?_[_0x4066('0x21')](_0x1f9e34[_0x4066('0x20')],function(_0x540a9){return{'model':db[_0x540a9[_0x4066('0x22')]],'as':_0x540a9['as'],'attributes':_0x540a9[_0x4066('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x80e095){logger['info']('GetChatQueue',_0x5b02a4);logger['debug'](_0x4066('0x19'),_0x5b02a4,JSON['stringify'](_0x80e095));_0x215d68(_0x80e095);})[_0x4066('0x18')](function(_0x2a39e7){logger[_0x4066('0x14')]('GetChatQueue',_0x2a39e7[_0x4066('0x15')],_0x5b02a4);_0x382950(_0x414e6c['error'](0x1f4,_0x2a39e7[_0x4066('0x15')]));});});};exports[_0x4066('0x23')]=function(_0x5eaaca){var _0x4924cf=this;return new Promise(function(_0x3363e8,_0x10dbde){return db['ChatQueue'][_0x4066('0x24')]({'raw':_0x5eaaca[_0x4066('0x1c')]?_0x5eaaca[_0x4066('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5eaaca[_0x4066('0x1c')]?_0x5eaaca['options'][_0x4066('0x1d')]||null:null,'attributes':_0x5eaaca[_0x4066('0x1c')]?_0x5eaaca[_0x4066('0x1c')][_0x4066('0x1e')]||null:null,'include':_0x5eaaca[_0x4066('0x1c')]?_0x5eaaca[_0x4066('0x1c')][_0x4066('0x20')]?_[_0x4066('0x21')](_0x5eaaca[_0x4066('0x1c')][_0x4066('0x20')],function(_0x219010){return{'model':db[_0x219010[_0x4066('0x22')]],'as':_0x219010['as'],'attributes':_0x219010['attributes'],'include':_0x219010[_0x4066('0x20')]?_[_0x4066('0x21')](_0x219010['include'],function(_0x1e1134){return{'model':db[_0x1e1134[_0x4066('0x22')]],'as':_0x1e1134['as'],'attributes':_0x1e1134['attributes'],'include':_0x1e1134[_0x4066('0x20')]?_[_0x4066('0x21')](_0x1e1134[_0x4066('0x20')],function(_0x470fa6){return{'model':db[_0x470fa6[_0x4066('0x22')]],'as':_0x470fa6['as'],'attributes':_0x470fa6[_0x4066('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4066('0x25')](function(_0x178ca2){logger[_0x4066('0x16')]('ShowChatQueue',_0x5eaaca);logger[_0x4066('0x11')](_0x4066('0x23'),_0x5eaaca,JSON['stringify'](_0x178ca2));_0x3363e8(_0x178ca2);})[_0x4066('0x18')](function(_0x3c0e01){logger[_0x4066('0x14')]('ShowChatQueue',_0x3c0e01[_0x4066('0x15')],_0x5eaaca);_0x10dbde(_0x4924cf[_0x4066('0x14')](0x1f4,_0x3c0e01[_0x4066('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index ccada0f..0ae441c 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 _0x72b1=['register','length','./chatQueue.events','remove','update','emit','removeListener'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x72b1,0x16e));var _0x172b=function(_0x44e4fa,_0x2df5b5){_0x44e4fa=_0x44e4fa-0x0;var _0x2c3c0f=_0x72b1[_0x44e4fa];return _0x2c3c0f;};'use strict';var ChatQueueEvents=require(_0x172b('0x0'));var events=['save',_0x172b('0x1'),_0x172b('0x2')];function createListener(_0x42b795,_0x18fd16){return function(_0x23bc7a){_0x18fd16[_0x172b('0x3')](_0x42b795,_0x23bc7a);};}function removeListener(_0x2c1d6e,_0x558038){return function(){ChatQueueEvents[_0x172b('0x4')](_0x2c1d6e,_0x558038);};}exports[_0x172b('0x5')]=function(_0x475fd6){for(var _0x222624=0x0,_0x571994=events[_0x172b('0x6')];_0x222624<_0x571994;_0x222624++){var _0x517363=events[_0x222624];var _0x1f98e9=createListener('chatQueue:'+_0x517363,_0x475fd6);ChatQueueEvents['on'](_0x517363,_0x1f98e9);}};
\ No newline at end of file
+var _0x7bae=['remove','update','emit','removeListener','register','length','chatQueue:'];(function(_0x3765ff,_0x16916e){var _0x333f28=function(_0x208816){while(--_0x208816){_0x3765ff['push'](_0x3765ff['shift']());}};_0x333f28(++_0x16916e);}(_0x7bae,0x13b));var _0xe7ba=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x7bae[_0xa8883];return _0x479426;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xe7ba('0x0'),_0xe7ba('0x1')];function createListener(_0x503803,_0x3963c7){return function(_0x4f2e91){_0x3963c7[_0xe7ba('0x2')](_0x503803,_0x4f2e91);};}function removeListener(_0x10908b,_0x166acb){return function(){ChatQueueEvents[_0xe7ba('0x3')](_0x10908b,_0x166acb);};}exports[_0xe7ba('0x4')]=function(_0xfd3a22){for(var _0x2d31df=0x0,_0x3c5e59=events[_0xe7ba('0x5')];_0x2d31df<_0x3c5e59;_0x2d31df++){var _0x34fb18=events[_0x2d31df];var _0x160565=createListener(_0xe7ba('0x6')+_0x34fb18,_0xfd3a22);ChatQueueEvents['on'](_0x34fb18,_0x160565);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 7d33abb..41e8611 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x359d00,_0x215da8){var _0x511edd=function(_0x105448){while(--_0x105448){_0x359d00['push'](_0x359d00['shift']());}};_0x511edd(++_0x215da8);}(_0xe14b,0x93));var _0xbe14=function(_0x2f7819,_0x4303da){_0x2f7819=_0x2f7819-0x0;var _0x2c418d=_0xe14b[_0x2f7819];return _0x2c418d;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0xdb627f,_0x364a0c){var _0x2233a8=function(_0xfac23e){while(--_0xfac23e){_0xdb627f['push'](_0xdb627f['shift']());}};_0x2233a8(++_0x364a0c);}(_0x55ca,0x126));var _0xa55c=function(_0x465533,_0x56ab66){_0x465533=_0x465533-0x0;var _0x49489b=_0x55ca[_0x465533];return _0x49489b;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 58f2d15..890e57f 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 _0xfead=['STRING','DATE','moment','sequelize','exports'];(function(_0x228fcc,_0x491886){var _0x19d09c=function(_0x459fd5){while(--_0x459fd5){_0x228fcc['push'](_0x228fcc['shift']());}};_0x19d09c(++_0x491886);}(_0xfead,0x1d8));var _0xdfea=function(_0x5f30c1,_0x5c9c25){_0x5f30c1=_0x5f30c1-0x0;var _0xd3c44d=_0xfead[_0x5f30c1];return _0xd3c44d;};'use strict';var moment=require(_0xdfea('0x0'));var Sequelize=require(_0xdfea('0x1'));module[_0xdfea('0x2')]={'uniqueid':{'type':Sequelize[_0xdfea('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xdfea('0x3')]},'joinAt':{'type':Sequelize[_0xdfea('0x4')]},'leaveAt':{'type':Sequelize[_0xdfea('0x4')]},'acceptAt':{'type':Sequelize[_0xdfea('0x4')]},'exitAt':{'type':Sequelize[_0xdfea('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb6be=['STRING','DATE','moment','sequelize'];(function(_0x562785,_0x9bb9c4){var _0x303a17=function(_0x225660){while(--_0x225660){_0x562785['push'](_0x562785['shift']());}};_0x303a17(++_0x9bb9c4);}(_0xb6be,0x132));var _0xeb6b=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xb6be[_0x1ae5ab];return _0x1ce001;};'use strict';var moment=require(_0xeb6b('0x0'));var Sequelize=require(_0xeb6b('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xeb6b('0x2')]},'joinAt':{'type':Sequelize[_0xeb6b('0x3')]},'leaveAt':{'type':Sequelize[_0xeb6b('0x3')]},'acceptAt':{'type':Sequelize[_0xeb6b('0x3')]},'exitAt':{'type':Sequelize[_0xeb6b('0x3')]},'reason':{'type':Sequelize[_0xeb6b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index ea25516..38e699d 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 _0x9fd4=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','ChatQueueReport','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','include','findAll','rows','catch','params','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0x9fd4,0x16c));var _0x49fd=function(_0x5c72ee,_0x5a8bf8){_0x5c72ee=_0x5c72ee-0x0;var _0x231876=_0x9fd4[_0x5c72ee];return _0x231876;};'use strict';var emlformat=require(_0x49fd('0x0'));var rimraf=require(_0x49fd('0x1'));var zipdir=require(_0x49fd('0x2'));var jsonpatch=require(_0x49fd('0x3'));var rp=require(_0x49fd('0x4'));var moment=require(_0x49fd('0x5'));var BPromise=require(_0x49fd('0x6'));var Mustache=require(_0x49fd('0x7'));var util=require(_0x49fd('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x49fd('0x9'));var ejs=require(_0x49fd('0xa'));var fs=require('fs');var fs_extra=require(_0x49fd('0xb'));var _=require(_0x49fd('0xc'));var squel=require('squel');var crypto=require(_0x49fd('0xd'));var jsforce=require(_0x49fd('0xe'));var deskjs=require(_0x49fd('0xf'));var toCsv=require(_0x49fd('0x9'));var querystring=require(_0x49fd('0x10'));var Papa=require('papaparse');var Redis=require(_0x49fd('0x11'));var authService=require(_0x49fd('0x12'));var qs=require(_0x49fd('0x13'));var as=require(_0x49fd('0x14'));var hardwareService=require(_0x49fd('0x15'));var logger=require(_0x49fd('0x16'))(_0x49fd('0x17'));var utils=require('../../config/utils');var config=require(_0x49fd('0x18'));var licenseUtil=require(_0x49fd('0x19'));var db=require(_0x49fd('0x1a'))['db'];function respondWithStatusCode(_0x40d1b0,_0x15dabd){_0x15dabd=_0x15dabd||0xcc;return function(_0x206bd8){if(_0x206bd8){return _0x40d1b0[_0x49fd('0x1b')](_0x15dabd);}return _0x40d1b0[_0x49fd('0x1c')](_0x15dabd)[_0x49fd('0x1d')]();};}function respondWithResult(_0x652890,_0x157b09){_0x157b09=_0x157b09||0xc8;return function(_0x44c18c){if(_0x44c18c){return _0x652890[_0x49fd('0x1c')](_0x157b09)[_0x49fd('0x1e')](_0x44c18c);}};}function respondWithFilteredResult(_0x264ab1,_0x201109){return function(_0x2859f2){if(_0x2859f2){var _0x3ca675=typeof _0x201109[_0x49fd('0x1f')]===_0x49fd('0x20')&&typeof _0x201109[_0x49fd('0x21')]===_0x49fd('0x20');var _0x320fe5=_0x2859f2[_0x49fd('0x22')];var _0xb55d24=_0x3ca675?0x0:_0x201109[_0x49fd('0x1f')];var _0x598793=_0x3ca675?_0x2859f2[_0x49fd('0x22')]:_0x201109[_0x49fd('0x1f')]+_0x201109['limit'];var _0x5c323a;if(_0x598793>=_0x320fe5){_0x598793=_0x320fe5;_0x5c323a=0xc8;}else{_0x5c323a=0xce;}_0x264ab1[_0x49fd('0x1c')](_0x5c323a);return _0x264ab1['set'](_0x49fd('0x23'),_0xb55d24+'-'+_0x598793+'/'+_0x320fe5)[_0x49fd('0x1e')](_0x2859f2);}return null;};}function patchUpdates(_0x599315){return function(_0xf7efcf){try{jsonpatch[_0x49fd('0x24')](_0xf7efcf,_0x599315,!![]);}catch(_0x5ae3bc){return BPromise[_0x49fd('0x25')](_0x5ae3bc);}return _0xf7efcf[_0x49fd('0x26')]();};}function saveUpdates(_0x2e1c40,_0x290f59){return function(_0x20fa0d){if(_0x20fa0d){return _0x20fa0d[_0x49fd('0x27')](_0x2e1c40)['then'](function(_0x46019d){return _0x46019d;});}return null;};}function removeEntity(_0xd43815,_0x8f202b){return function(_0x4bf811){if(_0x4bf811){return _0x4bf811[_0x49fd('0x28')]()[_0x49fd('0x29')](function(){_0xd43815[_0x49fd('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x597161,_0x497469){return function(_0x13c5a8){if(!_0x13c5a8){_0x597161[_0x49fd('0x1b')](0x194);}return _0x13c5a8;};}function handleError(_0x4ec190,_0x302ab2){_0x302ab2=_0x302ab2||0x1f4;return function(_0x9587b9){logger[_0x49fd('0x2a')](_0x9587b9[_0x49fd('0x2b')]);if(_0x9587b9[_0x49fd('0x2c')]){delete _0x9587b9['name'];}_0x4ec190[_0x49fd('0x1c')](_0x302ab2)['send'](_0x9587b9);};}exports[_0x49fd('0x2d')]=function(_0x89badc,_0x54acb5){var _0x203038={},_0x2c8568={},_0x23374c={'count':0x0,'rows':[]};var _0x43826f=_[_0x49fd('0x2e')](db[_0x49fd('0x2f')][_0x49fd('0x30')],function(_0x242203){return{'name':_0x242203['fieldName'],'type':_0x242203[_0x49fd('0x31')]['key']};});_0x2c8568[_0x49fd('0x32')]=_['map'](_0x43826f,_0x49fd('0x2c'));_0x2c8568[_0x49fd('0x33')]=_[_0x49fd('0x34')](_0x89badc['query']);_0x2c8568['filters']=_['intersection'](_0x2c8568[_0x49fd('0x32')],_0x2c8568[_0x49fd('0x33')]);_0x203038['attributes']=_[_0x49fd('0x35')](_0x2c8568['model'],qs['fields'](_0x89badc[_0x49fd('0x33')][_0x49fd('0x36')]));_0x203038[_0x49fd('0x37')]=_0x203038[_0x49fd('0x37')][_0x49fd('0x38')]?_0x203038['attributes']:_0x2c8568['model'];if(!_0x89badc[_0x49fd('0x33')][_0x49fd('0x39')](_0x49fd('0x3a'))){_0x203038[_0x49fd('0x21')]=qs['limit'](_0x89badc[_0x49fd('0x33')][_0x49fd('0x21')]);_0x203038[_0x49fd('0x1f')]=qs[_0x49fd('0x1f')](_0x89badc[_0x49fd('0x33')][_0x49fd('0x1f')]);}_0x203038[_0x49fd('0x3b')]=qs[_0x49fd('0x3c')](_0x89badc[_0x49fd('0x33')][_0x49fd('0x3c')]);_0x203038[_0x49fd('0x3d')]=qs['filters'](_[_0x49fd('0x3e')](_0x89badc[_0x49fd('0x33')],_0x2c8568[_0x49fd('0x3f')]),_0x43826f);if(_0x89badc[_0x49fd('0x33')][_0x49fd('0x40')]){_0x203038[_0x49fd('0x3d')]=_[_0x49fd('0x41')](_0x203038[_0x49fd('0x3d')],{'$or':_[_0x49fd('0x2e')](_0x43826f,function(_0x4a1856){if(_0x4a1856[_0x49fd('0x31')]!=='VIRTUAL'){var _0x46e84c={};_0x46e84c[_0x4a1856[_0x49fd('0x2c')]]={'$like':'%'+_0x89badc['query'][_0x49fd('0x40')]+'%'};return _0x46e84c;}})});}_0x203038=_[_0x49fd('0x41')]({},_0x203038,_0x89badc['options']);var _0x1f9a65={'where':_0x203038['where']};return db['ChatQueueReport']['count'](_0x1f9a65)[_0x49fd('0x29')](function(_0x32982e){_0x23374c[_0x49fd('0x22')]=_0x32982e;if(_0x89badc[_0x49fd('0x33')]['includeAll']){_0x203038[_0x49fd('0x42')]=[{'all':!![]}];}return db[_0x49fd('0x2f')][_0x49fd('0x43')](_0x203038);})[_0x49fd('0x29')](function(_0x115c5a){_0x23374c[_0x49fd('0x44')]=_0x115c5a;return _0x23374c;})[_0x49fd('0x29')](respondWithFilteredResult(_0x54acb5,_0x203038))[_0x49fd('0x45')](handleError(_0x54acb5,null));};exports['show']=function(_0x255a73,_0x2c8ab1){var _0x4dce94={'raw':!![],'where':{'id':_0x255a73[_0x49fd('0x46')]['id']}},_0x3be41b={};_0x3be41b['model']=_[_0x49fd('0x34')](db['ChatQueueReport'][_0x49fd('0x30')]);_0x3be41b[_0x49fd('0x33')]=_[_0x49fd('0x34')](_0x255a73[_0x49fd('0x33')]);_0x3be41b['filters']=_['intersection'](_0x3be41b[_0x49fd('0x32')],_0x3be41b['query']);_0x4dce94[_0x49fd('0x37')]=_[_0x49fd('0x35')](_0x3be41b[_0x49fd('0x32')],qs[_0x49fd('0x36')](_0x255a73['query'][_0x49fd('0x36')]));_0x4dce94[_0x49fd('0x37')]=_0x4dce94[_0x49fd('0x37')][_0x49fd('0x38')]?_0x4dce94[_0x49fd('0x37')]:_0x3be41b[_0x49fd('0x32')];if(_0x255a73[_0x49fd('0x33')][_0x49fd('0x47')]){_0x4dce94[_0x49fd('0x42')]=[{'all':!![]}];}_0x4dce94=_[_0x49fd('0x41')]({},_0x4dce94,_0x255a73[_0x49fd('0x48')]);return db[_0x49fd('0x2f')][_0x49fd('0x49')](_0x4dce94)[_0x49fd('0x29')](handleEntityNotFound(_0x2c8ab1,null))['then'](respondWithResult(_0x2c8ab1,null))['catch'](handleError(_0x2c8ab1,null));};exports[_0x49fd('0x4a')]=function(_0xa3518f,_0x42287e){return db[_0x49fd('0x2f')]['create'](_0xa3518f[_0x49fd('0x4b')],{})[_0x49fd('0x29')](respondWithResult(_0x42287e,0xc9))['catch'](handleError(_0x42287e,null));};exports[_0x49fd('0x27')]=function(_0x270360,_0xaac56f){if(_0x270360[_0x49fd('0x4b')]['id']){delete _0x270360[_0x49fd('0x4b')]['id'];}return db[_0x49fd('0x2f')][_0x49fd('0x49')]({'where':{'id':_0x270360[_0x49fd('0x46')]['id']}})[_0x49fd('0x29')](handleEntityNotFound(_0xaac56f,null))[_0x49fd('0x29')](saveUpdates(_0x270360[_0x49fd('0x4b')],null))['then'](respondWithResult(_0xaac56f,null))[_0x49fd('0x45')](handleError(_0xaac56f,null));};exports[_0x49fd('0x28')]=function(_0x32694b,_0x263cf3){return db[_0x49fd('0x2f')][_0x49fd('0x49')]({'where':{'id':_0x32694b['params']['id']}})['then'](handleEntityNotFound(_0x263cf3,null))[_0x49fd('0x29')](removeEntity(_0x263cf3,null))[_0x49fd('0x45')](handleError(_0x263cf3,null));};exports[_0x49fd('0x4c')]=function(_0x5c34c0,_0x31783f){return db[_0x49fd('0x2f')]['describe']()['then'](respondWithResult(_0x31783f,null))['catch'](handleError(_0x31783f,null));};
\ No newline at end of file
+var _0x6f44=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','map','ChatQueueReport','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','where','count','includeAll','include','rows','catch','params','keys','rawAttributes','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x34ea04,_0x165a66){var _0x2b6576=function(_0x23de38){while(--_0x23de38){_0x34ea04['push'](_0x34ea04['shift']());}};_0x2b6576(++_0x165a66);}(_0x6f44,0x1ea));var _0x46f4=function(_0x176095,_0x5ccb73){_0x176095=_0x176095-0x0;var _0x2f80a4=_0x6f44[_0x176095];return _0x2f80a4;};'use strict';var emlformat=require(_0x46f4('0x0'));var rimraf=require(_0x46f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46f4('0x2'));var rp=require(_0x46f4('0x3'));var moment=require(_0x46f4('0x4'));var BPromise=require(_0x46f4('0x5'));var Mustache=require(_0x46f4('0x6'));var util=require(_0x46f4('0x7'));var path=require(_0x46f4('0x8'));var sox=require(_0x46f4('0x9'));var csv=require(_0x46f4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46f4('0xb'));var _=require(_0x46f4('0xc'));var squel=require(_0x46f4('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x46f4('0xe'));var toCsv=require(_0x46f4('0xa'));var querystring=require('querystring');var Papa=require(_0x46f4('0xf'));var Redis=require('ioredis');var authService=require(_0x46f4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x46f4('0x11'));var hardwareService=require(_0x46f4('0x12'));var logger=require(_0x46f4('0x13'))(_0x46f4('0x14'));var utils=require(_0x46f4('0x15'));var config=require(_0x46f4('0x16'));var licenseUtil=require(_0x46f4('0x17'));var db=require(_0x46f4('0x18'))['db'];function respondWithStatusCode(_0x21d4a6,_0x1f4748){_0x1f4748=_0x1f4748||0xcc;return function(_0x1dd233){if(_0x1dd233){return _0x21d4a6[_0x46f4('0x19')](_0x1f4748);}return _0x21d4a6['status'](_0x1f4748)[_0x46f4('0x1a')]();};}function respondWithResult(_0x33f73c,_0x52db86){_0x52db86=_0x52db86||0xc8;return function(_0x44a55b){if(_0x44a55b){return _0x33f73c[_0x46f4('0x1b')](_0x52db86)[_0x46f4('0x1c')](_0x44a55b);}};}function respondWithFilteredResult(_0x4dd2fb,_0x3dc516){return function(_0x4e0661){if(_0x4e0661){var _0x4e84ce=typeof _0x3dc516[_0x46f4('0x1d')]===_0x46f4('0x1e')&&typeof _0x3dc516[_0x46f4('0x1f')]==='undefined';var _0x5c191a=_0x4e0661['count'];var _0x5d3471=_0x4e84ce?0x0:_0x3dc516[_0x46f4('0x1d')];var _0x433297=_0x4e84ce?_0x4e0661['count']:_0x3dc516[_0x46f4('0x1d')]+_0x3dc516[_0x46f4('0x1f')];var _0x2232d6;if(_0x433297>=_0x5c191a){_0x433297=_0x5c191a;_0x2232d6=0xc8;}else{_0x2232d6=0xce;}_0x4dd2fb[_0x46f4('0x1b')](_0x2232d6);return _0x4dd2fb['set'](_0x46f4('0x20'),_0x5d3471+'-'+_0x433297+'/'+_0x5c191a)[_0x46f4('0x1c')](_0x4e0661);}return null;};}function patchUpdates(_0x1627db){return function(_0x6476f0){try{jsonpatch[_0x46f4('0x21')](_0x6476f0,_0x1627db,!![]);}catch(_0xdb9f25){return BPromise['reject'](_0xdb9f25);}return _0x6476f0[_0x46f4('0x22')]();};}function saveUpdates(_0x2b88d3,_0x39760b){return function(_0x4ba21a){if(_0x4ba21a){return _0x4ba21a[_0x46f4('0x23')](_0x2b88d3)[_0x46f4('0x24')](function(_0x185ec2){return _0x185ec2;});}return null;};}function removeEntity(_0x47528b,_0x36092e){return function(_0x41be5e){if(_0x41be5e){return _0x41be5e[_0x46f4('0x25')]()[_0x46f4('0x24')](function(){_0x47528b[_0x46f4('0x1b')](0xcc)[_0x46f4('0x1a')]();});}};}function handleEntityNotFound(_0x2ad553,_0x16cd7f){return function(_0x197e55){if(!_0x197e55){_0x2ad553['sendStatus'](0x194);}return _0x197e55;};}function handleError(_0x46e96d,_0x30d4fc){_0x30d4fc=_0x30d4fc||0x1f4;return function(_0xb23194){logger[_0x46f4('0x26')](_0xb23194[_0x46f4('0x27')]);if(_0xb23194[_0x46f4('0x28')]){delete _0xb23194['name'];}_0x46e96d[_0x46f4('0x1b')](_0x30d4fc)['send'](_0xb23194);};}exports['index']=function(_0x53ac21,_0x2cf22c){var _0x57ff78={},_0x1fb343={},_0x183f0c={'count':0x0,'rows':[]};var _0x3c8c91=_[_0x46f4('0x29')](db[_0x46f4('0x2a')]['rawAttributes'],function(_0x1d512b){return{'name':_0x1d512b[_0x46f4('0x2b')],'type':_0x1d512b[_0x46f4('0x2c')]['key']};});_0x1fb343[_0x46f4('0x2d')]=_[_0x46f4('0x29')](_0x3c8c91,_0x46f4('0x28'));_0x1fb343['query']=_['keys'](_0x53ac21[_0x46f4('0x2e')]);_0x1fb343[_0x46f4('0x2f')]=_[_0x46f4('0x30')](_0x1fb343['model'],_0x1fb343[_0x46f4('0x2e')]);_0x57ff78[_0x46f4('0x31')]=_['intersection'](_0x1fb343[_0x46f4('0x2d')],qs['fields'](_0x53ac21[_0x46f4('0x2e')][_0x46f4('0x32')]));_0x57ff78[_0x46f4('0x31')]=_0x57ff78[_0x46f4('0x31')][_0x46f4('0x33')]?_0x57ff78['attributes']:_0x1fb343[_0x46f4('0x2d')];if(!_0x53ac21[_0x46f4('0x2e')]['hasOwnProperty'](_0x46f4('0x34'))){_0x57ff78[_0x46f4('0x1f')]=qs[_0x46f4('0x1f')](_0x53ac21[_0x46f4('0x2e')]['limit']);_0x57ff78[_0x46f4('0x1d')]=qs['offset'](_0x53ac21[_0x46f4('0x2e')][_0x46f4('0x1d')]);}_0x57ff78[_0x46f4('0x35')]=qs[_0x46f4('0x36')](_0x53ac21['query'][_0x46f4('0x36')]);_0x57ff78['where']=qs['filters'](_[_0x46f4('0x37')](_0x53ac21['query'],_0x1fb343['filters']),_0x3c8c91);if(_0x53ac21[_0x46f4('0x2e')][_0x46f4('0x38')]){_0x57ff78['where']=_[_0x46f4('0x39')](_0x57ff78['where'],{'$or':_[_0x46f4('0x29')](_0x3c8c91,function(_0x190c1a){if(_0x190c1a[_0x46f4('0x2c')]!==_0x46f4('0x3a')){var _0x5c6662={};_0x5c6662[_0x190c1a[_0x46f4('0x28')]]={'$like':'%'+_0x53ac21[_0x46f4('0x2e')][_0x46f4('0x38')]+'%'};return _0x5c6662;}})});}_0x57ff78=_['merge']({},_0x57ff78,_0x53ac21['options']);var _0x4a44a6={'where':_0x57ff78[_0x46f4('0x3b')]};return db[_0x46f4('0x2a')][_0x46f4('0x3c')](_0x4a44a6)[_0x46f4('0x24')](function(_0x57bfd2){_0x183f0c[_0x46f4('0x3c')]=_0x57bfd2;if(_0x53ac21[_0x46f4('0x2e')][_0x46f4('0x3d')]){_0x57ff78[_0x46f4('0x3e')]=[{'all':!![]}];}return db[_0x46f4('0x2a')]['findAll'](_0x57ff78);})[_0x46f4('0x24')](function(_0x306400){_0x183f0c[_0x46f4('0x3f')]=_0x306400;return _0x183f0c;})[_0x46f4('0x24')](respondWithFilteredResult(_0x2cf22c,_0x57ff78))[_0x46f4('0x40')](handleError(_0x2cf22c,null));};exports['show']=function(_0x549af3,_0x4e11cb){var _0x21ce83={'raw':!![],'where':{'id':_0x549af3[_0x46f4('0x41')]['id']}},_0x1c0513={};_0x1c0513['model']=_[_0x46f4('0x42')](db[_0x46f4('0x2a')][_0x46f4('0x43')]);_0x1c0513[_0x46f4('0x2e')]=_[_0x46f4('0x42')](_0x549af3[_0x46f4('0x2e')]);_0x1c0513[_0x46f4('0x2f')]=_[_0x46f4('0x30')](_0x1c0513[_0x46f4('0x2d')],_0x1c0513[_0x46f4('0x2e')]);_0x21ce83[_0x46f4('0x31')]=_[_0x46f4('0x30')](_0x1c0513[_0x46f4('0x2d')],qs['fields'](_0x549af3[_0x46f4('0x2e')][_0x46f4('0x32')]));_0x21ce83[_0x46f4('0x31')]=_0x21ce83[_0x46f4('0x31')][_0x46f4('0x33')]?_0x21ce83[_0x46f4('0x31')]:_0x1c0513['model'];if(_0x549af3['query']['includeAll']){_0x21ce83[_0x46f4('0x3e')]=[{'all':!![]}];}_0x21ce83=_[_0x46f4('0x39')]({},_0x21ce83,_0x549af3[_0x46f4('0x44')]);return db[_0x46f4('0x2a')][_0x46f4('0x45')](_0x21ce83)[_0x46f4('0x24')](handleEntityNotFound(_0x4e11cb,null))[_0x46f4('0x24')](respondWithResult(_0x4e11cb,null))[_0x46f4('0x40')](handleError(_0x4e11cb,null));};exports[_0x46f4('0x46')]=function(_0xf73c15,_0x21319d){return db[_0x46f4('0x2a')]['create'](_0xf73c15[_0x46f4('0x47')],{})[_0x46f4('0x24')](respondWithResult(_0x21319d,0xc9))[_0x46f4('0x40')](handleError(_0x21319d,null));};exports['update']=function(_0x5a6d1f,_0x1fedc8){if(_0x5a6d1f[_0x46f4('0x47')]['id']){delete _0x5a6d1f[_0x46f4('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x5a6d1f[_0x46f4('0x41')]['id']}})[_0x46f4('0x24')](handleEntityNotFound(_0x1fedc8,null))[_0x46f4('0x24')](saveUpdates(_0x5a6d1f[_0x46f4('0x47')],null))[_0x46f4('0x24')](respondWithResult(_0x1fedc8,null))[_0x46f4('0x40')](handleError(_0x1fedc8,null));};exports['destroy']=function(_0x18f0e0,_0x2bbb25){return db[_0x46f4('0x2a')]['find']({'where':{'id':_0x18f0e0[_0x46f4('0x41')]['id']}})[_0x46f4('0x24')](handleEntityNotFound(_0x2bbb25,null))[_0x46f4('0x24')](removeEntity(_0x2bbb25,null))[_0x46f4('0x40')](handleError(_0x2bbb25,null));};exports['describe']=function(_0x26f39a,_0x478dd7){return db[_0x46f4('0x2a')][_0x46f4('0x48')]()[_0x46f4('0x24')](respondWithResult(_0x478dd7,null))['catch'](handleError(_0x478dd7,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 1dfbadd..ed0b803 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x4deae2,_0x124e5c){var _0x140c9f=function(_0x59d15f){while(--_0x59d15f){_0x4deae2['push'](_0x4deae2['shift']());}};_0x140c9f(++_0x124e5c);}(_0x757a,0xde));var _0xa757=function(_0x3f7cb6,_0x2241fe){_0x3f7cb6=_0x3f7cb6-0x0;var _0x1f8011=_0x757a[_0x3f7cb6];return _0x1f8011;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x497809,_0x451ba0){var _0x865565=function(_0x5428c1){while(--_0x5428c1){_0x497809['push'](_0x497809['shift']());}};_0x865565(++_0x451ba0);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xb7e7[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index cee4eef..6d2f27f 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 _0x8145=['result','catch','CreateChatQueueReport','ChatQueueReport','options','raw','debug','UpdateChatQueueReport','update','body','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x551fce,_0x131ca9){var _0x485540=function(_0x45176e){while(--_0x45176e){_0x551fce['push'](_0x551fce['shift']());}};_0x485540(++_0x131ca9);}(_0x8145,0xdd));var _0x5814=function(_0x59ccfd,_0x2e888d){_0x59ccfd=_0x59ccfd-0x0;var _0xb7ac6=_0x8145[_0x59ccfd];return _0xb7ac6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5814('0x0'));var BPromise=require(_0x5814('0x1'));var rs=require(_0x5814('0x2'));var fs=require('fs');var Redis=require(_0x5814('0x3'));var db=require(_0x5814('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5814('0x5'))(_0x5814('0x6'));var config=require('../../config/environment');var jayson=require(_0x5814('0x7'));var client=jayson['client'][_0x5814('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x201f77,_0x3d199e,_0x282ab7){return new BPromise(function(_0x567751,_0x1aad8f){return client[_0x5814('0x9')](_0x201f77,_0x282ab7)[_0x5814('0xa')](function(_0x5dd689){logger[_0x5814('0xb')](_0x5814('0xc'),_0x3d199e,_0x5814('0xd'));logger['debug'](_0x5814('0xe'),_0x3d199e,_0x5814('0xd'),JSON[_0x5814('0xf')](_0x5dd689));if(_0x5dd689[_0x5814('0x10')]){if(_0x5dd689[_0x5814('0x10')][_0x5814('0x11')]===0x1f4){logger[_0x5814('0x10')](_0x5814('0xc'),_0x3d199e,_0x5dd689[_0x5814('0x10')][_0x5814('0x12')]);return _0x1aad8f(_0x5dd689[_0x5814('0x10')]['message']);}logger[_0x5814('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x3d199e,_0x5dd689[_0x5814('0x10')][_0x5814('0x12')]);return _0x567751(_0x5dd689[_0x5814('0x10')]['message']);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x3d199e,_0x5814('0xd'));_0x567751(_0x5dd689[_0x5814('0x13')][_0x5814('0x12')]);}})[_0x5814('0x14')](function(_0x38f48a){logger[_0x5814('0x10')](_0x5814('0xc'),_0x3d199e,_0x38f48a);_0x1aad8f(_0x38f48a);});});}exports[_0x5814('0x15')]=function(_0x3e2d8e){var _0x4c243d=this;return new Promise(function(_0x2a1ce5,_0x3c79e6){return db[_0x5814('0x16')]['create'](_0x3e2d8e['body'],{'raw':_0x3e2d8e[_0x5814('0x17')]?_0x3e2d8e[_0x5814('0x17')][_0x5814('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x30c3e6){logger[_0x5814('0xb')]('CreateChatQueueReport',_0x3e2d8e);logger[_0x5814('0x19')]('CreateChatQueueReport',_0x3e2d8e,JSON[_0x5814('0xf')](_0x30c3e6));_0x2a1ce5(_0x30c3e6);})['catch'](function(_0x5ea866){logger['error'](_0x5814('0x15'),_0x5ea866[_0x5814('0x12')],_0x3e2d8e);_0x3c79e6(_0x4c243d['error'](0x1f4,_0x5ea866[_0x5814('0x12')]));});});};exports[_0x5814('0x1a')]=function(_0xa9d511){var _0x591ece=this;return new Promise(function(_0x135529,_0x193a76){return db[_0x5814('0x16')][_0x5814('0x1b')](_0xa9d511[_0x5814('0x1c')],{'raw':_0xa9d511[_0x5814('0x17')]?_0xa9d511[_0x5814('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa9d511[_0x5814('0x17')]?_0xa9d511[_0x5814('0x17')][_0x5814('0x1d')]||null:null,'attributes':_0xa9d511['options']?_0xa9d511['options']['attributes']||null:null,'limit':_0xa9d511[_0x5814('0x17')]?_0xa9d511[_0x5814('0x17')]['limit']||null:null})[_0x5814('0xa')](function(_0x352b69){logger[_0x5814('0xb')](_0x5814('0x1a'),_0xa9d511);logger['debug']('UpdateChatQueueReport',_0xa9d511,JSON[_0x5814('0xf')](_0x352b69));_0x135529(_0x352b69);})[_0x5814('0x14')](function(_0x590a0b){logger['error'](_0x5814('0x1a'),_0x590a0b[_0x5814('0x12')],_0xa9d511);_0x193a76(_0x591ece[_0x5814('0x10')](0x1f4,_0x590a0b[_0x5814('0x12')]));});});};
\ No newline at end of file
+var _0x2408=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','CreateChatQueueReport','ChatQueueReport','options','UpdateChatQueueReport','update','raw','where','limit','then','lodash','util'];(function(_0x238d75,_0x7681cc){var _0x1244b7=function(_0x169db4){while(--_0x169db4){_0x238d75['push'](_0x238d75['shift']());}};_0x1244b7(++_0x7681cc);}(_0x2408,0x172));var _0x8240=function(_0x12dc5d,_0x262f06){_0x12dc5d=_0x12dc5d-0x0;var _0x3dc618=_0x2408[_0x12dc5d];return _0x3dc618;};'use strict';var _=require(_0x8240('0x0'));var util=require(_0x8240('0x1'));var moment=require('moment');var BPromise=require(_0x8240('0x2'));var rs=require(_0x8240('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8240('0x4'))['db'];var utils=require(_0x8240('0x5'));var logger=require('../../config/logger')(_0x8240('0x6'));var config=require(_0x8240('0x7'));var jayson=require(_0x8240('0x8'));var client=jayson[_0x8240('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d7377,_0x475136,_0x48831b){return new BPromise(function(_0x6922b2,_0x2cc931){return client[_0x8240('0xa')](_0x1d7377,_0x48831b)['then'](function(_0x232acc){logger['info'](_0x8240('0xb'),_0x475136,'request\x20sent');logger[_0x8240('0xc')](_0x8240('0xd'),_0x475136,'request\x20sent',JSON[_0x8240('0xe')](_0x232acc));if(_0x232acc[_0x8240('0xf')]){if(_0x232acc[_0x8240('0xf')][_0x8240('0x10')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x475136,_0x232acc[_0x8240('0xf')][_0x8240('0x11')]);return _0x2cc931(_0x232acc[_0x8240('0xf')][_0x8240('0x11')]);}logger[_0x8240('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x475136,_0x232acc[_0x8240('0xf')][_0x8240('0x11')]);return _0x6922b2(_0x232acc[_0x8240('0xf')][_0x8240('0x11')]);}else{logger[_0x8240('0x12')](_0x8240('0xb'),_0x475136,_0x8240('0x13'));_0x6922b2(_0x232acc[_0x8240('0x14')]['message']);}})[_0x8240('0x15')](function(_0x178683){logger[_0x8240('0xf')](_0x8240('0xb'),_0x475136,_0x178683);_0x2cc931(_0x178683);});});}exports[_0x8240('0x16')]=function(_0x19dde1){var _0xfa76f5=this;return new Promise(function(_0xda231c,_0x1162fa){return db[_0x8240('0x17')]['create'](_0x19dde1['body'],{'raw':_0x19dde1[_0x8240('0x18')]?_0x19dde1[_0x8240('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4c3910){logger[_0x8240('0x12')](_0x8240('0x16'),_0x19dde1);logger[_0x8240('0xc')]('CreateChatQueueReport',_0x19dde1,JSON[_0x8240('0xe')](_0x4c3910));_0xda231c(_0x4c3910);})['catch'](function(_0x2c27a9){logger[_0x8240('0xf')](_0x8240('0x16'),_0x2c27a9[_0x8240('0x11')],_0x19dde1);_0x1162fa(_0xfa76f5[_0x8240('0xf')](0x1f4,_0x2c27a9[_0x8240('0x11')]));});});};exports[_0x8240('0x19')]=function(_0x56ce24){var _0x4737e1=this;return new Promise(function(_0x541e44,_0x3c1f06){return db['ChatQueueReport'][_0x8240('0x1a')](_0x56ce24['body'],{'raw':_0x56ce24['options']?_0x56ce24['options'][_0x8240('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56ce24[_0x8240('0x18')]?_0x56ce24[_0x8240('0x18')][_0x8240('0x1c')]||null:null,'attributes':_0x56ce24[_0x8240('0x18')]?_0x56ce24[_0x8240('0x18')]['attributes']||null:null,'limit':_0x56ce24[_0x8240('0x18')]?_0x56ce24[_0x8240('0x18')][_0x8240('0x1d')]||null:null})[_0x8240('0x1e')](function(_0x1efefc){logger[_0x8240('0x12')](_0x8240('0x19'),_0x56ce24);logger['debug'](_0x8240('0x19'),_0x56ce24,JSON[_0x8240('0xe')](_0x1efefc));_0x541e44(_0x1efefc);})[_0x8240('0x15')](function(_0x3106c5){logger['error'](_0x8240('0x19'),_0x3106c5[_0x8240('0x11')],_0x56ce24);_0x3c1f06(_0x4737e1['error'](0x1f4,_0x3106c5[_0x8240('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 9c2cf8f..0be6e40 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 _0x50c6=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x2fe0fe,_0x46da20){var _0x62d3f2=function(_0x3b722c){while(--_0x3b722c){_0x2fe0fe['push'](_0x2fe0fe['shift']());}};_0x62d3f2(++_0x46da20);}(_0x50c6,0x113));var _0x650c=function(_0x3650d1,_0x4d275e){_0x3650d1=_0x3650d1-0x0;var _0x32f21e=_0x50c6[_0x3650d1];return _0x32f21e;};'use strict';var multer=require(_0x650c('0x0'));var util=require(_0x650c('0x1'));var path=require(_0x650c('0x2'));var timeout=require(_0x650c('0x3'));var express=require(_0x650c('0x4'));var router=express[_0x650c('0x5')]();var fs_extra=require(_0x650c('0x6'));var auth=require(_0x650c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x650c('0x8'));var controller=require('./chatQueueReport.controller');router[_0x650c('0x9')]('/',auth[_0x650c('0xa')](),controller[_0x650c('0xb')]);router['get'](_0x650c('0xc'),auth[_0x650c('0xa')](),controller[_0x650c('0xd')]);router[_0x650c('0x9')](_0x650c('0xe'),auth[_0x650c('0xa')](),controller[_0x650c('0xf')]);router[_0x650c('0x10')]('/',auth[_0x650c('0xa')](),controller[_0x650c('0x11')]);router[_0x650c('0x12')](_0x650c('0xe'),auth['isAuthenticated'](),controller[_0x650c('0x13')]);router[_0x650c('0x14')]('/:id',auth[_0x650c('0xa')](),controller[_0x650c('0x15')]);module[_0x650c('0x16')]=router;
\ No newline at end of file
+var _0x10eb=['get','isAuthenticated','/describe','/:id','show','post','create','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./chatQueueReport.controller'];(function(_0x24b283,_0x510549){var _0x23d8a1=function(_0xc309f){while(--_0xc309f){_0x24b283['push'](_0x24b283['shift']());}};_0x23d8a1(++_0x510549);}(_0x10eb,0x106));var _0xb10e=function(_0x296e52,_0x428515){_0x296e52=_0x296e52-0x0;var _0x286070=_0x10eb[_0x296e52];return _0x286070;};'use strict';var multer=require(_0xb10e('0x0'));var util=require(_0xb10e('0x1'));var path=require(_0xb10e('0x2'));var timeout=require(_0xb10e('0x3'));var express=require('express');var router=express[_0xb10e('0x4')]();var fs_extra=require(_0xb10e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb10e('0x6'));var controller=require(_0xb10e('0x7'));router[_0xb10e('0x8')]('/',auth[_0xb10e('0x9')](),controller['index']);router['get'](_0xb10e('0xa'),auth[_0xb10e('0x9')](),controller['describe']);router['get'](_0xb10e('0xb'),auth[_0xb10e('0x9')](),controller[_0xb10e('0xc')]);router[_0xb10e('0xd')]('/',auth[_0xb10e('0x9')](),controller[_0xb10e('0xe')]);router['put'](_0xb10e('0xb'),auth[_0xb10e('0x9')](),controller[_0xb10e('0xf')]);router[_0xb10e('0x10')](_0xb10e('0xb'),auth[_0xb10e('0x9')](),controller['destroy']);module[_0xb10e('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index d8b9fe1..8f8129f 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x39215e,_0x3938b9){var _0x443f38=function(_0x399f47){while(--_0x399f47){_0x39215e['push'](_0x39215e['shift']());}};_0x443f38(++_0x3938b9);}(_0xedd9,0xfc));var _0x9edd=function(_0x3431e2,_0x13b280){_0x3431e2=_0x3431e2-0x0;var _0x2cacfa=_0xedd9[_0x3431e2];return _0x2cacfa;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x418815,_0x524351){var _0x3ab866=function(_0x2078e8){while(--_0x2078e8){_0x418815['push'](_0x418815['shift']());}};_0x3ab866(++_0x524351);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x541a67,_0x50728d){_0x541a67=_0x541a67-0x0;var _0x45da2a=_0xcb91[_0x541a67];return _0x45da2a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 30be5ee..6f4a70d 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 _0x9d6e=['end','error','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','destroy','then'];(function(_0x58a31f,_0x568175){var _0x4986a1=function(_0x29263e){while(--_0x29263e){_0x58a31f['push'](_0x58a31f['shift']());}};_0x4986a1(++_0x568175);}(_0x9d6e,0x111));var _0xe9d6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9d6e[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9d6('0x0'));var zipdir=require(_0xe9d6('0x1'));var jsonpatch=require(_0xe9d6('0x2'));var rp=require(_0xe9d6('0x3'));var moment=require(_0xe9d6('0x4'));var BPromise=require(_0xe9d6('0x5'));var Mustache=require(_0xe9d6('0x6'));var util=require('util');var path=require(_0xe9d6('0x7'));var sox=require(_0xe9d6('0x8'));var csv=require(_0xe9d6('0x9'));var ejs=require(_0xe9d6('0xa'));var fs=require('fs');var fs_extra=require(_0xe9d6('0xb'));var _=require(_0xe9d6('0xc'));var squel=require('squel');var crypto=require(_0xe9d6('0xd'));var jsforce=require(_0xe9d6('0xe'));var deskjs=require(_0xe9d6('0xf'));var toCsv=require(_0xe9d6('0x9'));var querystring=require(_0xe9d6('0x10'));var Papa=require('papaparse');var Redis=require(_0xe9d6('0x11'));var authService=require(_0xe9d6('0x12'));var qs=require(_0xe9d6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9d6('0x14'))(_0xe9d6('0x15'));var utils=require(_0xe9d6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe9d6('0x17'));var db=require(_0xe9d6('0x18'))['db'];function respondWithStatusCode(_0x21f5e9,_0x3784a6){_0x3784a6=_0x3784a6||0xcc;return function(_0x4ca6f5){if(_0x4ca6f5){return _0x21f5e9[_0xe9d6('0x19')](_0x3784a6);}return _0x21f5e9[_0xe9d6('0x1a')](_0x3784a6)['end']();};}function respondWithResult(_0x6a2634,_0x48bb43){_0x48bb43=_0x48bb43||0xc8;return function(_0x4a8058){if(_0x4a8058){return _0x6a2634['status'](_0x48bb43)['json'](_0x4a8058);}};}function respondWithFilteredResult(_0x41f905,_0x2e7781){return function(_0x228856){if(_0x228856){var _0xe8f2ad=typeof _0x2e7781['offset']===_0xe9d6('0x1b')&&typeof _0x2e7781[_0xe9d6('0x1c')]==='undefined';var _0x15aad0=_0x228856[_0xe9d6('0x1d')];var _0x3f71a3=_0xe8f2ad?0x0:_0x2e7781[_0xe9d6('0x1e')];var _0x18b506=_0xe8f2ad?_0x228856['count']:_0x2e7781['offset']+_0x2e7781[_0xe9d6('0x1c')];var _0x1d2999;if(_0x18b506>=_0x15aad0){_0x18b506=_0x15aad0;_0x1d2999=0xc8;}else{_0x1d2999=0xce;}_0x41f905['status'](_0x1d2999);return _0x41f905[_0xe9d6('0x1f')](_0xe9d6('0x20'),_0x3f71a3+'-'+_0x18b506+'/'+_0x15aad0)[_0xe9d6('0x21')](_0x228856);}return null;};}function patchUpdates(_0x296146){return function(_0x5417c3){try{jsonpatch[_0xe9d6('0x22')](_0x5417c3,_0x296146,!![]);}catch(_0x2ef86e){return BPromise['reject'](_0x2ef86e);}return _0x5417c3[_0xe9d6('0x23')]();};}function saveUpdates(_0x1dd090,_0x1b62c9){return function(_0x939813){if(_0x939813){return _0x939813[_0xe9d6('0x24')](_0x1dd090)['then'](function(_0x4b111d){return _0x4b111d;});}return null;};}function removeEntity(_0x2a3f9f,_0x16d5de){return function(_0x26bbaa){if(_0x26bbaa){return _0x26bbaa[_0xe9d6('0x25')]()[_0xe9d6('0x26')](function(){_0x2a3f9f[_0xe9d6('0x1a')](0xcc)[_0xe9d6('0x27')]();});}};}function handleEntityNotFound(_0x48155d,_0x36aa1e){return function(_0xef0156){if(!_0xef0156){_0x48155d[_0xe9d6('0x19')](0x194);}return _0xef0156;};}function handleError(_0x222fb4,_0x2f863a){_0x2f863a=_0x2f863a||0x1f4;return function(_0x228b61){logger[_0xe9d6('0x28')](_0x228b61[_0xe9d6('0x29')]);if(_0x228b61['name']){delete _0x228b61[_0xe9d6('0x2a')];}_0x222fb4[_0xe9d6('0x1a')](_0x2f863a)[_0xe9d6('0x2b')](_0x228b61);};}exports[_0xe9d6('0x2c')]=function(_0x4457ee,_0x2badf2){var _0x48d710={},_0x413f1a={},_0x14ba78={'count':0x0,'rows':[]};var _0x448a4e=_['map'](db[_0xe9d6('0x2d')][_0xe9d6('0x2e')],function(_0xdbd372){return{'name':_0xdbd372[_0xe9d6('0x2f')],'type':_0xdbd372[_0xe9d6('0x30')][_0xe9d6('0x31')]};});_0x413f1a[_0xe9d6('0x32')]=_[_0xe9d6('0x33')](_0x448a4e,_0xe9d6('0x2a'));_0x413f1a[_0xe9d6('0x34')]=_[_0xe9d6('0x35')](_0x4457ee[_0xe9d6('0x34')]);_0x413f1a[_0xe9d6('0x36')]=_['intersection'](_0x413f1a[_0xe9d6('0x32')],_0x413f1a[_0xe9d6('0x34')]);_0x48d710['attributes']=_[_0xe9d6('0x37')](_0x413f1a[_0xe9d6('0x32')],qs[_0xe9d6('0x38')](_0x4457ee['query']['fields']));_0x48d710[_0xe9d6('0x39')]=_0x48d710['attributes'][_0xe9d6('0x3a')]?_0x48d710[_0xe9d6('0x39')]:_0x413f1a['model'];if(!_0x4457ee[_0xe9d6('0x34')][_0xe9d6('0x3b')]('nolimit')){_0x48d710[_0xe9d6('0x1c')]=qs[_0xe9d6('0x1c')](_0x4457ee[_0xe9d6('0x34')]['limit']);_0x48d710[_0xe9d6('0x1e')]=qs[_0xe9d6('0x1e')](_0x4457ee[_0xe9d6('0x34')][_0xe9d6('0x1e')]);}_0x48d710[_0xe9d6('0x3c')]=qs[_0xe9d6('0x3d')](_0x4457ee['query'][_0xe9d6('0x3d')]);_0x48d710[_0xe9d6('0x3e')]=qs['filters'](_[_0xe9d6('0x3f')](_0x4457ee['query'],_0x413f1a[_0xe9d6('0x36')]),_0x448a4e);if(_0x4457ee[_0xe9d6('0x34')][_0xe9d6('0x40')]){_0x48d710[_0xe9d6('0x3e')]=_[_0xe9d6('0x41')](_0x48d710[_0xe9d6('0x3e')],{'$or':_[_0xe9d6('0x33')](_0x448a4e,function(_0x115cb9){if(_0x115cb9[_0xe9d6('0x30')]!==_0xe9d6('0x42')){var _0x31b9c9={};_0x31b9c9[_0x115cb9[_0xe9d6('0x2a')]]={'$like':'%'+_0x4457ee[_0xe9d6('0x34')][_0xe9d6('0x40')]+'%'};return _0x31b9c9;}})});}_0x48d710=_[_0xe9d6('0x41')]({},_0x48d710,_0x4457ee[_0xe9d6('0x43')]);var _0x548789={'where':_0x48d710[_0xe9d6('0x3e')]};return db[_0xe9d6('0x2d')]['count'](_0x548789)[_0xe9d6('0x26')](function(_0x31f890){_0x14ba78[_0xe9d6('0x1d')]=_0x31f890;if(_0x4457ee[_0xe9d6('0x34')][_0xe9d6('0x44')]){_0x48d710['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0xe9d6('0x45')](_0x48d710);})[_0xe9d6('0x26')](function(_0x47c8d7){_0x14ba78[_0xe9d6('0x46')]=_0x47c8d7;return _0x14ba78;})[_0xe9d6('0x26')](respondWithFilteredResult(_0x2badf2,_0x48d710))[_0xe9d6('0x47')](handleError(_0x2badf2,null));};exports['show']=function(_0x3428c6,_0x31f95b){var _0x443ebf={'raw':!![],'where':{'id':_0x3428c6[_0xe9d6('0x48')]['id']}},_0x3a2331={};_0x3a2331['model']=_[_0xe9d6('0x35')](db[_0xe9d6('0x2d')][_0xe9d6('0x2e')]);_0x3a2331[_0xe9d6('0x34')]=_[_0xe9d6('0x35')](_0x3428c6[_0xe9d6('0x34')]);_0x3a2331[_0xe9d6('0x36')]=_[_0xe9d6('0x37')](_0x3a2331[_0xe9d6('0x32')],_0x3a2331[_0xe9d6('0x34')]);_0x443ebf[_0xe9d6('0x39')]=_['intersection'](_0x3a2331[_0xe9d6('0x32')],qs[_0xe9d6('0x38')](_0x3428c6['query'][_0xe9d6('0x38')]));_0x443ebf[_0xe9d6('0x39')]=_0x443ebf[_0xe9d6('0x39')][_0xe9d6('0x3a')]?_0x443ebf['attributes']:_0x3a2331[_0xe9d6('0x32')];if(_0x3428c6['query'][_0xe9d6('0x44')]){_0x443ebf[_0xe9d6('0x49')]=[{'all':!![]}];}_0x443ebf=_[_0xe9d6('0x41')]({},_0x443ebf,_0x3428c6['options']);return db[_0xe9d6('0x2d')][_0xe9d6('0x4a')](_0x443ebf)['then'](handleEntityNotFound(_0x31f95b,null))['then'](respondWithResult(_0x31f95b,null))[_0xe9d6('0x47')](handleError(_0x31f95b,null));};exports['create']=function(_0xac3382,_0x21247b){return db['ChatTransferReport'][_0xe9d6('0x4b')](_0xac3382[_0xe9d6('0x4c')],{})['then'](respondWithResult(_0x21247b,0xc9))[_0xe9d6('0x47')](handleError(_0x21247b,null));};exports[_0xe9d6('0x24')]=function(_0x28aee5,_0x4a7237){if(_0x28aee5[_0xe9d6('0x4c')]['id']){delete _0x28aee5[_0xe9d6('0x4c')]['id'];}return db[_0xe9d6('0x2d')][_0xe9d6('0x4a')]({'where':{'id':_0x28aee5['params']['id']}})[_0xe9d6('0x26')](handleEntityNotFound(_0x4a7237,null))[_0xe9d6('0x26')](saveUpdates(_0x28aee5[_0xe9d6('0x4c')],null))[_0xe9d6('0x26')](respondWithResult(_0x4a7237,null))[_0xe9d6('0x47')](handleError(_0x4a7237,null));};exports[_0xe9d6('0x25')]=function(_0x4325e1,_0x45c685){return db[_0xe9d6('0x2d')][_0xe9d6('0x4a')]({'where':{'id':_0x4325e1[_0xe9d6('0x48')]['id']}})[_0xe9d6('0x26')](handleEntityNotFound(_0x45c685,null))[_0xe9d6('0x26')](removeEntity(_0x45c685,null))[_0xe9d6('0x47')](handleError(_0x45c685,null));};exports[_0xe9d6('0x4d')]=function(_0x1a26fe,_0x5c2d6c){return db[_0xe9d6('0x2d')][_0xe9d6('0x4d')]()['then'](respondWithResult(_0x5c2d6c,null))[_0xe9d6('0x47')](handleError(_0x5c2d6c,null));};
\ No newline at end of file
+var _0x4faa=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','then','destroy','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','params','catch','describe','eml-format','rimraf','moment'];(function(_0x3b5067,_0x402005){var _0x43a3b0=function(_0x4278c6){while(--_0x4278c6){_0x3b5067['push'](_0x3b5067['shift']());}};_0x43a3b0(++_0x402005);}(_0x4faa,0x8f));var _0xa4fa=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x4faa[_0x311c35];return _0x5cc50c;};'use strict';var emlformat=require(_0xa4fa('0x0'));var rimraf=require(_0xa4fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa4fa('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa4fa('0x3'));var util=require(_0xa4fa('0x4'));var path=require(_0xa4fa('0x5'));var sox=require('sox');var csv=require(_0xa4fa('0x6'));var ejs=require(_0xa4fa('0x7'));var fs=require('fs');var fs_extra=require(_0xa4fa('0x8'));var _=require(_0xa4fa('0x9'));var squel=require(_0xa4fa('0xa'));var crypto=require(_0xa4fa('0xb'));var jsforce=require(_0xa4fa('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa4fa('0x6'));var querystring=require(_0xa4fa('0xd'));var Papa=require(_0xa4fa('0xe'));var Redis=require('ioredis');var authService=require(_0xa4fa('0xf'));var qs=require(_0xa4fa('0x10'));var as=require(_0xa4fa('0x11'));var hardwareService=require(_0xa4fa('0x12'));var logger=require(_0xa4fa('0x13'))(_0xa4fa('0x14'));var utils=require(_0xa4fa('0x15'));var config=require(_0xa4fa('0x16'));var licenseUtil=require(_0xa4fa('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a9bfd,_0x431690){_0x431690=_0x431690||0xcc;return function(_0x3e8020){if(_0x3e8020){return _0x1a9bfd[_0xa4fa('0x18')](_0x431690);}return _0x1a9bfd[_0xa4fa('0x19')](_0x431690)[_0xa4fa('0x1a')]();};}function respondWithResult(_0x2cf4b5,_0x37b346){_0x37b346=_0x37b346||0xc8;return function(_0xf4b493){if(_0xf4b493){return _0x2cf4b5[_0xa4fa('0x19')](_0x37b346)[_0xa4fa('0x1b')](_0xf4b493);}};}function respondWithFilteredResult(_0x1f1871,_0x31fcce){return function(_0xa1c46d){if(_0xa1c46d){var _0x413a62=typeof _0x31fcce[_0xa4fa('0x1c')]===_0xa4fa('0x1d')&&typeof _0x31fcce[_0xa4fa('0x1e')]==='undefined';var _0xf75196=_0xa1c46d[_0xa4fa('0x1f')];var _0xb9b90d=_0x413a62?0x0:_0x31fcce[_0xa4fa('0x1c')];var _0x2bfd0c=_0x413a62?_0xa1c46d[_0xa4fa('0x1f')]:_0x31fcce[_0xa4fa('0x1c')]+_0x31fcce['limit'];var _0x456448;if(_0x2bfd0c>=_0xf75196){_0x2bfd0c=_0xf75196;_0x456448=0xc8;}else{_0x456448=0xce;}_0x1f1871[_0xa4fa('0x19')](_0x456448);return _0x1f1871['set']('Content-Range',_0xb9b90d+'-'+_0x2bfd0c+'/'+_0xf75196)[_0xa4fa('0x1b')](_0xa1c46d);}return null;};}function patchUpdates(_0x2de93c){return function(_0x114431){try{jsonpatch[_0xa4fa('0x20')](_0x114431,_0x2de93c,!![]);}catch(_0x4c3978){return BPromise['reject'](_0x4c3978);}return _0x114431['save']();};}function saveUpdates(_0x478ae2,_0x948f85){return function(_0x91fb2e){if(_0x91fb2e){return _0x91fb2e['update'](_0x478ae2)[_0xa4fa('0x21')](function(_0x337ae6){return _0x337ae6;});}return null;};}function removeEntity(_0x113524,_0x42c676){return function(_0x36af3f){if(_0x36af3f){return _0x36af3f[_0xa4fa('0x22')]()[_0xa4fa('0x21')](function(){_0x113524[_0xa4fa('0x19')](0xcc)[_0xa4fa('0x1a')]();});}};}function handleEntityNotFound(_0x52e14c,_0x4e430e){return function(_0x528a3c){if(!_0x528a3c){_0x52e14c[_0xa4fa('0x18')](0x194);}return _0x528a3c;};}function handleError(_0x18dd3f,_0x302d80){_0x302d80=_0x302d80||0x1f4;return function(_0x182b10){logger[_0xa4fa('0x23')](_0x182b10[_0xa4fa('0x24')]);if(_0x182b10[_0xa4fa('0x25')]){delete _0x182b10[_0xa4fa('0x25')];}_0x18dd3f['status'](_0x302d80)[_0xa4fa('0x26')](_0x182b10);};}exports['index']=function(_0x2a96d2,_0xd28914){var _0x3f9974={},_0x110011={},_0xf987a6={'count':0x0,'rows':[]};var _0x3c2953=_[_0xa4fa('0x27')](db[_0xa4fa('0x28')][_0xa4fa('0x29')],function(_0x3be477){return{'name':_0x3be477[_0xa4fa('0x2a')],'type':_0x3be477['type'][_0xa4fa('0x2b')]};});_0x110011[_0xa4fa('0x2c')]=_['map'](_0x3c2953,'name');_0x110011['query']=_[_0xa4fa('0x2d')](_0x2a96d2[_0xa4fa('0x2e')]);_0x110011['filters']=_[_0xa4fa('0x2f')](_0x110011[_0xa4fa('0x2c')],_0x110011[_0xa4fa('0x2e')]);_0x3f9974[_0xa4fa('0x30')]=_[_0xa4fa('0x2f')](_0x110011[_0xa4fa('0x2c')],qs['fields'](_0x2a96d2[_0xa4fa('0x2e')]['fields']));_0x3f9974[_0xa4fa('0x30')]=_0x3f9974['attributes'][_0xa4fa('0x31')]?_0x3f9974[_0xa4fa('0x30')]:_0x110011[_0xa4fa('0x2c')];if(!_0x2a96d2[_0xa4fa('0x2e')][_0xa4fa('0x32')](_0xa4fa('0x33'))){_0x3f9974[_0xa4fa('0x1e')]=qs[_0xa4fa('0x1e')](_0x2a96d2[_0xa4fa('0x2e')]['limit']);_0x3f9974[_0xa4fa('0x1c')]=qs[_0xa4fa('0x1c')](_0x2a96d2[_0xa4fa('0x2e')][_0xa4fa('0x1c')]);}_0x3f9974[_0xa4fa('0x34')]=qs[_0xa4fa('0x35')](_0x2a96d2[_0xa4fa('0x2e')][_0xa4fa('0x35')]);_0x3f9974['where']=qs[_0xa4fa('0x36')](_[_0xa4fa('0x37')](_0x2a96d2[_0xa4fa('0x2e')],_0x110011[_0xa4fa('0x36')]),_0x3c2953);if(_0x2a96d2['query'][_0xa4fa('0x38')]){_0x3f9974[_0xa4fa('0x39')]=_[_0xa4fa('0x3a')](_0x3f9974[_0xa4fa('0x39')],{'$or':_[_0xa4fa('0x27')](_0x3c2953,function(_0x478450){if(_0x478450[_0xa4fa('0x3b')]!==_0xa4fa('0x3c')){var _0x353f0c={};_0x353f0c[_0x478450[_0xa4fa('0x25')]]={'$like':'%'+_0x2a96d2[_0xa4fa('0x2e')][_0xa4fa('0x38')]+'%'};return _0x353f0c;}})});}_0x3f9974=_['merge']({},_0x3f9974,_0x2a96d2[_0xa4fa('0x3d')]);var _0x50ee29={'where':_0x3f9974[_0xa4fa('0x39')]};return db[_0xa4fa('0x28')][_0xa4fa('0x1f')](_0x50ee29)[_0xa4fa('0x21')](function(_0x27f5f1){_0xf987a6[_0xa4fa('0x1f')]=_0x27f5f1;if(_0x2a96d2[_0xa4fa('0x2e')][_0xa4fa('0x3e')]){_0x3f9974[_0xa4fa('0x3f')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xa4fa('0x40')](_0x3f9974);})[_0xa4fa('0x21')](function(_0x2473b5){_0xf987a6[_0xa4fa('0x41')]=_0x2473b5;return _0xf987a6;})[_0xa4fa('0x21')](respondWithFilteredResult(_0xd28914,_0x3f9974))['catch'](handleError(_0xd28914,null));};exports[_0xa4fa('0x42')]=function(_0x103d88,_0x285e88){var _0x370198={'raw':!![],'where':{'id':_0x103d88['params']['id']}},_0x5aa283={};_0x5aa283[_0xa4fa('0x2c')]=_[_0xa4fa('0x2d')](db['ChatTransferReport'][_0xa4fa('0x29')]);_0x5aa283[_0xa4fa('0x2e')]=_[_0xa4fa('0x2d')](_0x103d88[_0xa4fa('0x2e')]);_0x5aa283[_0xa4fa('0x36')]=_['intersection'](_0x5aa283[_0xa4fa('0x2c')],_0x5aa283[_0xa4fa('0x2e')]);_0x370198[_0xa4fa('0x30')]=_[_0xa4fa('0x2f')](_0x5aa283['model'],qs['fields'](_0x103d88[_0xa4fa('0x2e')]['fields']));_0x370198[_0xa4fa('0x30')]=_0x370198['attributes'][_0xa4fa('0x31')]?_0x370198['attributes']:_0x5aa283['model'];if(_0x103d88[_0xa4fa('0x2e')][_0xa4fa('0x3e')]){_0x370198['include']=[{'all':!![]}];}_0x370198=_[_0xa4fa('0x3a')]({},_0x370198,_0x103d88[_0xa4fa('0x3d')]);return db['ChatTransferReport'][_0xa4fa('0x43')](_0x370198)['then'](handleEntityNotFound(_0x285e88,null))['then'](respondWithResult(_0x285e88,null))['catch'](handleError(_0x285e88,null));};exports[_0xa4fa('0x44')]=function(_0x4ce7a4,_0x393e7f){return db[_0xa4fa('0x28')]['create'](_0x4ce7a4[_0xa4fa('0x45')],{})['then'](respondWithResult(_0x393e7f,0xc9))['catch'](handleError(_0x393e7f,null));};exports['update']=function(_0x49b382,_0x533c8a){if(_0x49b382['body']['id']){delete _0x49b382['body']['id'];}return db[_0xa4fa('0x28')]['find']({'where':{'id':_0x49b382[_0xa4fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x533c8a,null))[_0xa4fa('0x21')](saveUpdates(_0x49b382[_0xa4fa('0x45')],null))[_0xa4fa('0x21')](respondWithResult(_0x533c8a,null))[_0xa4fa('0x47')](handleError(_0x533c8a,null));};exports[_0xa4fa('0x22')]=function(_0x581366,_0x4535f0){return db[_0xa4fa('0x28')]['find']({'where':{'id':_0x581366['params']['id']}})['then'](handleEntityNotFound(_0x4535f0,null))[_0xa4fa('0x21')](removeEntity(_0x4535f0,null))[_0xa4fa('0x47')](handleError(_0x4535f0,null));};exports[_0xa4fa('0x48')]=function(_0x54463f,_0x233928){return db['ChatTransferReport'][_0xa4fa('0x48')]()[_0xa4fa('0x21')](respondWithResult(_0x233928,null))[_0xa4fa('0x47')](handleError(_0x233928,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 61b9b5e..309b547 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 _0x0544=['path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x26ba35,_0x3816f5){var _0x1d073e=function(_0x7ff982){while(--_0x7ff982){_0x26ba35['push'](_0x26ba35['shift']());}};_0x1d073e(++_0x3816f5);}(_0x0544,0x6b));var _0x4054=function(_0x2136a6,_0x35af63){_0x2136a6=_0x2136a6-0x0;var _0x55b948=_0x0544[_0x2136a6];return _0x55b948;};'use strict';var _=require('lodash');var util=require(_0x4054('0x0'));var logger=require(_0x4054('0x1'))('api');var moment=require(_0x4054('0x2'));var BPromise=require(_0x4054('0x3'));var rp=require(_0x4054('0x4'));var fs=require('fs');var path=require(_0x4054('0x5'));var rimraf=require(_0x4054('0x6'));var config=require(_0x4054('0x7'));var attributes=require(_0x4054('0x8'));module[_0x4054('0x9')]=function(_0x37e492,_0x4ef540){return _0x37e492[_0x4054('0xa')](_0x4054('0xb'),attributes,{'tableName':_0x4054('0xc'),'paranoid':![],'indexes':[{'name':_0x4054('0xd'),'fields':[_0x4054('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9db8=['lodash','util','../../config/logger','moment','request-promise','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid'];(function(_0x512a50,_0x3057c2){var _0x57c236=function(_0x59338c){while(--_0x59338c){_0x512a50['push'](_0x512a50['shift']());}};_0x57c236(++_0x3057c2);}(_0x9db8,0x14a));var _0x89db=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x9db8[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require(_0x89db('0x0'));var util=require(_0x89db('0x1'));var logger=require(_0x89db('0x2'))('api');var moment=require(_0x89db('0x3'));var BPromise=require('bluebird');var rp=require(_0x89db('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x89db('0x5'));var attributes=require(_0x89db('0x6'));module[_0x89db('0x7')]=function(_0x3e5a70,_0x2ae77e){return _0x3e5a70[_0x89db('0x8')](_0x89db('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x89db('0xa'),'fields':[_0x89db('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 19dce5f..d2774cb 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 _0x305f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util'];(function(_0x47e41e,_0x12bf58){var _0xf81f18=function(_0x217456){while(--_0x217456){_0x47e41e['push'](_0x47e41e['shift']());}};_0xf81f18(++_0x12bf58);}(_0x305f,0x1c6));var _0xf305=function(_0x1b0bd0,_0xbbe219){_0x1b0bd0=_0x1b0bd0-0x0;var _0x2a0018=_0x305f[_0x1b0bd0];return _0x2a0018;};'use strict';var _=require(_0xf305('0x0'));var util=require(_0xf305('0x1'));var moment=require(_0xf305('0x2'));var BPromise=require(_0xf305('0x3'));var rs=require(_0xf305('0x4'));var fs=require('fs');var Redis=require(_0xf305('0x5'));var db=require(_0xf305('0x6'))['db'];var utils=require(_0xf305('0x7'));var logger=require('../../config/logger')(_0xf305('0x8'));var config=require('../../config/environment');var jayson=require(_0xf305('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x176f8c,_0xd87da6,_0x2e1d5b){return new BPromise(function(_0x29d811,_0x338014){return client[_0xf305('0xa')](_0x176f8c,_0x2e1d5b)['then'](function(_0x33a479){logger[_0xf305('0xb')](_0xf305('0xc'),_0xd87da6,_0xf305('0xd'));logger[_0xf305('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xd87da6,_0xf305('0xd'),JSON['stringify'](_0x33a479));if(_0x33a479[_0xf305('0xf')]){if(_0x33a479[_0xf305('0xf')][_0xf305('0x10')]===0x1f4){logger[_0xf305('0xf')](_0xf305('0xc'),_0xd87da6,_0x33a479[_0xf305('0xf')][_0xf305('0x11')]);return _0x338014(_0x33a479[_0xf305('0xf')][_0xf305('0x11')]);}logger['error'](_0xf305('0xc'),_0xd87da6,_0x33a479['error'][_0xf305('0x11')]);return _0x29d811(_0x33a479[_0xf305('0xf')][_0xf305('0x11')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0xd87da6,_0xf305('0xd'));_0x29d811(_0x33a479[_0xf305('0x12')]['message']);}})['catch'](function(_0x42edb8){logger[_0xf305('0xf')](_0xf305('0xc'),_0xd87da6,_0x42edb8);_0x338014(_0x42edb8);});});}
\ No newline at end of file
+var _0x737f=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','lodash','util','moment'];(function(_0xd72e20,_0x1b7c31){var _0xe99992=function(_0x33f902){while(--_0x33f902){_0xd72e20['push'](_0xd72e20['shift']());}};_0xe99992(++_0x1b7c31);}(_0x737f,0x1d8));var _0xf737=function(_0x14a36e,_0x43c479){_0x14a36e=_0x14a36e-0x0;var _0x958c2c=_0x737f[_0x14a36e];return _0x958c2c;};'use strict';var _=require(_0xf737('0x0'));var util=require(_0xf737('0x1'));var moment=require(_0xf737('0x2'));var BPromise=require('bluebird');var rs=require(_0xf737('0x3'));var fs=require('fs');var Redis=require(_0xf737('0x4'));var db=require(_0xf737('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf737('0x6'));var config=require(_0xf737('0x7'));var jayson=require(_0xf737('0x8'));var client=jayson['client'][_0xf737('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x331837,_0x289eaa,_0x493942){return new BPromise(function(_0xc9e977,_0x5bdb46){return client['request'](_0x331837,_0x493942)[_0xf737('0xa')](function(_0x2f2e29){logger[_0xf737('0xb')](_0xf737('0xc'),_0x289eaa,'request\x20sent');logger[_0xf737('0xd')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x289eaa,_0xf737('0xe'),JSON[_0xf737('0xf')](_0x2f2e29));if(_0x2f2e29['error']){if(_0x2f2e29['error']['code']===0x1f4){logger[_0xf737('0x10')](_0xf737('0xc'),_0x289eaa,_0x2f2e29[_0xf737('0x10')][_0xf737('0x11')]);return _0x5bdb46(_0x2f2e29[_0xf737('0x10')][_0xf737('0x11')]);}logger[_0xf737('0x10')](_0xf737('0xc'),_0x289eaa,_0x2f2e29['error'][_0xf737('0x11')]);return _0xc9e977(_0x2f2e29[_0xf737('0x10')][_0xf737('0x11')]);}else{logger[_0xf737('0xb')](_0xf737('0xc'),_0x289eaa,_0xf737('0xe'));_0xc9e977(_0x2f2e29['result']['message']);}})[_0xf737('0x12')](function(_0x2be4bd){logger[_0xf737('0x10')](_0xf737('0xc'),_0x289eaa,_0x2be4bd);_0x5bdb46(_0x2be4bd);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 4de85b8..ea13ccf 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 _0x4911=['get','describe','/:id','show','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index'];(function(_0x5b8c2f,_0x20bb13){var _0x425952=function(_0x5c604a){while(--_0x5c604a){_0x5b8c2f['push'](_0x5b8c2f['shift']());}};_0x425952(++_0x20bb13);}(_0x4911,0x7c));var _0x1491=function(_0x5d289a,_0x352880){_0x5d289a=_0x5d289a-0x0;var _0x14bd5f=_0x4911[_0x5d289a];return _0x14bd5f;};'use strict';var multer=require(_0x1491('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1491('0x1'));var express=require(_0x1491('0x2'));var router=express[_0x1491('0x3')]();var fs_extra=require(_0x1491('0x4'));var auth=require(_0x1491('0x5'));var interaction=require(_0x1491('0x6'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0x1491('0x7')](),controller[_0x1491('0x8')]);router[_0x1491('0x9')]('/describe',auth[_0x1491('0x7')](),controller[_0x1491('0xa')]);router[_0x1491('0x9')](_0x1491('0xb'),auth['isAuthenticated'](),controller[_0x1491('0xc')]);router['post']('/',auth[_0x1491('0x7')](),controller[_0x1491('0xd')]);router[_0x1491('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x1491('0xf')]);router[_0x1491('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1491('0x11')]);module[_0x1491('0x12')]=router;
\ No newline at end of file
+var _0x83d4=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','delete'];(function(_0x3ba537,_0x56b969){var _0x585c1a=function(_0x1dd30b){while(--_0x1dd30b){_0x3ba537['push'](_0x3ba537['shift']());}};_0x585c1a(++_0x56b969);}(_0x83d4,0x178));var _0x483d=function(_0x149cb4,_0x400116){_0x149cb4=_0x149cb4-0x0;var _0x3c7207=_0x83d4[_0x149cb4];return _0x3c7207;};'use strict';var multer=require(_0x483d('0x0'));var util=require(_0x483d('0x1'));var path=require(_0x483d('0x2'));var timeout=require(_0x483d('0x3'));var express=require(_0x483d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x483d('0x5'));var interaction=require(_0x483d('0x6'));var config=require(_0x483d('0x7'));var controller=require(_0x483d('0x8'));router[_0x483d('0x9')]('/',auth[_0x483d('0xa')](),controller[_0x483d('0xb')]);router['get'](_0x483d('0xc'),auth[_0x483d('0xa')](),controller['describe']);router[_0x483d('0x9')]('/:id',auth[_0x483d('0xa')](),controller[_0x483d('0xd')]);router[_0x483d('0xe')]('/',auth[_0x483d('0xa')](),controller[_0x483d('0xf')]);router[_0x483d('0x10')](_0x483d('0x11'),auth[_0x483d('0xa')](),controller[_0x483d('0x12')]);router[_0x483d('0x13')](_0x483d('0x11'),auth[_0x483d('0xa')](),controller[_0x483d('0x14')]);module[_0x483d('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index bb914e9..f529284 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 _0xf3cd=['rounded','squared','We\x20are\x20here!','Chat','Send','INTEGER','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM'];(function(_0x255cab,_0x53a59e){var _0x53fd8b=function(_0x4268c4){while(--_0x4268c4){_0x255cab['push'](_0x255cab['shift']());}};_0x53fd8b(++_0x53a59e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4131da,_0x124783){_0x4131da=_0x4131da-0x0;var _0x583242=_0xf3cd[_0x4131da];return _0x583242;};'use strict';var Sequelize=require(_0xdf3c('0x0'));var rs=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'name':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![],'unique':_0xdf3c('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0x5')},'mapKeyOffline':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0x6')},'customerAlias':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![],'defaultValue':_0xdf3c('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdf3c('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![],'defaultValue':_0xdf3c('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xdf3c('0x3')]},'animation':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xdf3c('0xa')](_0xdf3c('0xb'),_0xdf3c('0xc')),'defaultValue':_0xdf3c('0xb')},'header_online':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0xd')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xdf3c('0xe')},'offline_chat_button':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0xf')},'header_offline':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xdf3c('0x10')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xdf3c('0x11')]},'closingQuestion':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0x14')},'noteTitle':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xdf3c('0x16')},'closingMessage':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0x17')},'closingMessageButton':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0xf')},'skipMessageButton':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0x18')},'conditionAgreement':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0x19')},'ratingType':{'type':Sequelize['ENUM']('star',_0xdf3c('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xdf3c('0x10')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xdf3c('0x11')],'defaultValue':function(){return JSON[_0xdf3c('0x1b')]({'items':[{'type':_0xdf3c('0x1c'),'variable':null,'config':{'placeholder':_0xdf3c('0x1d'),'type':_0xdf3c('0x1e'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xdf3c('0x1c'),'props':{'title':_0xdf3c('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xdf3c('0x5'),'type':_0xdf3c('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xdf3c('0x1f')](_0xdf3c('0x20'))?JSON[_0xdf3c('0x21')](this[_0xdf3c('0x1f')](_0xdf3c('0x20'))):{};},'set':function(_0x1adee4){return this['setDataValue'](_0xdf3c('0x20'),JSON[_0xdf3c('0x1b')](_0x1adee4));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xdf3c('0x1b')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xdf3c('0x5')},'variable':null},{'type':_0xdf3c('0x22'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0xdf3c('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xdf3c('0x1f')](_0xdf3c('0x24'))?JSON[_0xdf3c('0x21')](this['getDataValue'](_0xdf3c('0x24'))):{};},'set':function(_0x2a2d94){return this['setDataValue']('offlineForm',JSON[_0xdf3c('0x1b')](_0x2a2d94));}},'token':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':function(){return rs[_0xdf3c('0x25')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xdf3c('0x3')]},'forwardOffline':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0x26')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xdf3c('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0x28')},'offlineMessageBody':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0x29')},'skipUnmanaged':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0xf')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xdf3c('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xdf3c('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xdf3c('0x2b')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0x2c')},'messagesAlignment':{'type':Sequelize[_0xdf3c('0x3')],'defaultValue':_0xdf3c('0x2d')},'defaultTitle':{'type':Sequelize[_0xdf3c('0x3')]},'customerAvatar':{'type':Sequelize[_0xdf3c('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xdf3c('0x10')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdf3c('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xdf3c('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdf3c('0x10')],'comment':_0xdf3c('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':![],'comment':_0xdf3c('0x30'),'set':function(_0x3098cb){if(!_0x3098cb)this[_0xdf3c('0x31')](_0xdf3c('0x32'),null);this[_0xdf3c('0x31')](_0xdf3c('0x33'),_0x3098cb);}},'vidaooEscalation':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xdf3c('0x3')]},'vidaooTopic':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xdf3c('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xdf3c('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xdf3c('0x11')]}};
\ No newline at end of file
+var _0xf109=['#011F6A','#ffffff','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','INTEGER','stringify','input','name','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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.','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','Agent'];(function(_0x4d6dba,_0x2769b9){var _0x5680ff=function(_0x5dc8b5){while(--_0x5dc8b5){_0x4d6dba['push'](_0x4d6dba['shift']());}};_0x5680ff(++_0x2769b9);}(_0xf109,0xce));var _0x9f10=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xf109[_0x82129b];return _0x2ae5dc;};'use strict';var Sequelize=require(_0x9f10('0x0'));var rs=require(_0x9f10('0x1'));module[_0x9f10('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x9f10('0x3')]},'mapKey':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x4')},'mapKeyOffline':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x4')},'key':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x5')},'customerAlias':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9f10('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9f10('0x3')]},'animation':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9f10('0x9')]('rounded','squared'),'defaultValue':_0x9f10('0xa')},'header_online':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0xc')},'offline_chat_button':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0xe')},'download_transcript':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x12')},'noteTitle':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x16')},'ratingType':{'type':Sequelize[_0x9f10('0x9')](_0x9f10('0x17'),_0x9f10('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x9f10('0x19')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x9f10('0x1a')]({'items':[{'type':_0x9f10('0x1b'),'variable':null,'config':{'placeholder':_0x9f10('0x1c'),'type':'text','required':!![]},'props':{'title':_0x9f10('0x1c'),'helpText':''}},{'type':_0x9f10('0x1b'),'props':{'title':_0x9f10('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x9f10('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9f10('0x1d')](_0x9f10('0x1e'))?JSON['parse'](this[_0x9f10('0x1d')](_0x9f10('0x1e'))):{};},'set':function(_0x11cae7){return this[_0x9f10('0x1f')]('onlineForm',JSON['stringify'](_0x11cae7));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x9f10('0x1a')]({'items':[{'type':'input','props':{'title':_0x9f10('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9f10('0x4'),'type':_0x9f10('0x4')},'variable':null},{'type':_0x9f10('0x20'),'config':{'placeholder':_0x9f10('0x21')},'props':{'title':'Comments','helpText':_0x9f10('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x9f10('0x1d')](_0x9f10('0x23'))?JSON[_0x9f10('0x24')](this[_0x9f10('0x1d')](_0x9f10('0x23'))):{};},'set':function(_0x581b1d){return this[_0x9f10('0x1f')](_0x9f10('0x23'),JSON[_0x9f10('0x1a')](_0x581b1d));}},'token':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x25')},'waitingMessage':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x26')},'offlineMessageBody':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x15')},'sendUnmanaged':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9f10('0x29')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9f10('0x3')]},'notificationTemplate':{'type':Sequelize[_0x9f10('0x29')],'defaultValue':function(){return _0x9f10('0x2a');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2c')},'verticalAlignment':{'type':Sequelize[_0x9f10('0x19')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2d')},'messagesAlignment':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2e')},'defaultTitle':{'type':Sequelize[_0x9f10('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9f10('0x19')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9f10('0x19')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9f10('0x19')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x9f10('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![],'comment':_0x9f10('0x31'),'set':function(_0x433e70){if(!_0x433e70)this[_0x9f10('0x1f')](_0x9f10('0x32'),null);this[_0x9f10('0x1f')](_0x9f10('0x33'),_0x433e70);}},'vidaooEscalation':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9f10('0x3')]},'vidaooTopic':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x9f10('0x8')],'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 9b5aec1..3eee0af 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 _0xd73b=['sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','finally','getApplications','addProactiveActions','omit','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','status','json','undefined','limit','offset','count','Content-Range','update','destroy','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','map','ChatWebsite','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','findAll','catch','show','mandatoryDispositionPause','includeAll','options','create','body','user','get','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','sort','include','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','ValidationError','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','Applications','list','applications','priority','asc','account','Contacts','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','lastName','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','firstName','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','basename','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','forwardOfflineAddress','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','email','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','../../config/license/util','virtual','License','increment','chatLicenseExceeded','some','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','textButtonColor','backgroundColor','hideWhenOffline','addApplications'];(function(_0x4d235a,_0x581a63){var _0x261f27=function(_0x44e838){while(--_0x44e838){_0x4d235a['push'](_0x4d235a['shift']());}};_0x261f27(++_0x581a63);}(_0xd73b,0x14c));var _0xbd73=function(_0x405227,_0x52d46a){_0x405227=_0x405227-0x0;var _0x667fee=_0xd73b[_0x405227];return _0x667fee;};'use strict';var BPromise=require(_0xbd73('0x0'));var Mustache=require(_0xbd73('0x1'));var util=require(_0xbd73('0x2'));var path=require(_0xbd73('0x3'));var ejs=require(_0xbd73('0x4'));var fs=require('fs');var fs_extra=require(_0xbd73('0x5'));var _=require(_0xbd73('0x6'));var querystring=require(_0xbd73('0x7'));var Redis=require(_0xbd73('0x8'));var qs=require(_0xbd73('0x9'));var logger=require(_0xbd73('0xa'))(_0xbd73('0xb'));var config=require(_0xbd73('0xc'));var db=require(_0xbd73('0xd'))['db'];config[_0xbd73('0xe')]=_[_0xbd73('0xf')](config['redis'],{'host':_0xbd73('0x10'),'port':0x18eb});var socket=require(_0xbd73('0x11'))(new Redis(config[_0xbd73('0xe')]));require(_0xbd73('0x12'))[_0xbd73('0x13')](socket);var htmlToText=require(_0xbd73('0x14'));var jayson=require(_0xbd73('0x15'));var client=jayson[_0xbd73('0x16')][_0xbd73('0x17')]({'port':0x232c});var client9002=jayson[_0xbd73('0x16')][_0xbd73('0x17')]({'port':0x232a});var client9003=jayson[_0xbd73('0x16')][_0xbd73('0x17')]({'port':0x232b});var client9001=jayson['client'][_0xbd73('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x40f731,_0x1d6fd3,_0x2025f8,_0x192569){return new BPromise(function(_0x30105f,_0x577266){var _0x105c3f=_0x192569||client;return _0x105c3f[_0xbd73('0x18')](_0x40f731,_0x2025f8)[_0xbd73('0x19')](function(_0x2eb35c){logger[_0xbd73('0x1a')](_0xbd73('0x1b'),_0x1d6fd3,'request\x20sent');logger[_0xbd73('0x1c')](_0xbd73('0x1d'),_0x1d6fd3,'request\x20sent',JSON[_0xbd73('0x1e')](_0x2eb35c));if(_0x2eb35c[_0xbd73('0x1f')]){if(_0x2eb35c['error'][_0xbd73('0x20')]===0x1f4){logger['error'](_0xbd73('0x1b'),_0x1d6fd3,_0x2eb35c[_0xbd73('0x1f')][_0xbd73('0x21')]);return _0x577266(_0x2eb35c[_0xbd73('0x1f')][_0xbd73('0x21')]);}logger[_0xbd73('0x1f')](_0xbd73('0x1b'),_0x1d6fd3,_0x2eb35c[_0xbd73('0x1f')]['message']);return _0x30105f(_0x2eb35c[_0xbd73('0x1f')][_0xbd73('0x21')]);}else{logger[_0xbd73('0x1a')](_0xbd73('0x1b'),_0x1d6fd3,_0xbd73('0x22'));_0x30105f(_0x2eb35c[_0xbd73('0x23')][_0xbd73('0x21')]);}})['catch'](function(_0x5cd2cc){logger[_0xbd73('0x1f')](_0xbd73('0x1b'),_0x1d6fd3,_0x5cd2cc);_0x577266(_0x5cd2cc);});});}function respondWithStatusCode(_0x439da1,_0x58b575){_0x58b575=_0x58b575||0xcc;return function(_0x588a26){if(_0x588a26){return _0x439da1['sendStatus'](_0x58b575);}return _0x439da1[_0xbd73('0x24')](_0x58b575)['end']();};}function respondWithResult(_0x83ab9f,_0x127581){_0x127581=_0x127581||0xc8;return function(_0x3069c3){if(_0x3069c3){return _0x83ab9f[_0xbd73('0x24')](_0x127581)[_0xbd73('0x25')](_0x3069c3);}};}function respondWithFilteredResult(_0x18f58d,_0x468e6a){return function(_0x22c2ab){if(_0x22c2ab){var _0x3d966a=typeof _0x468e6a['offset']===_0xbd73('0x26')&&typeof _0x468e6a[_0xbd73('0x27')]===_0xbd73('0x26');var _0x151795=_0x22c2ab['count'];var _0x23ffd8=_0x3d966a?0x0:_0x468e6a[_0xbd73('0x28')];var _0x9d69b=_0x3d966a?_0x22c2ab[_0xbd73('0x29')]:_0x468e6a['offset']+_0x468e6a[_0xbd73('0x27')];var _0x49cd51;if(_0x9d69b>=_0x151795){_0x9d69b=_0x151795;_0x49cd51=0xc8;}else{_0x49cd51=0xce;}_0x18f58d['status'](_0x49cd51);return _0x18f58d['set'](_0xbd73('0x2a'),_0x23ffd8+'-'+_0x9d69b+'/'+_0x151795)['json'](_0x22c2ab);}return null;};}function saveUpdates(_0x40248a){return function(_0x2a8077){if(_0x2a8077){return _0x2a8077[_0xbd73('0x2b')](_0x40248a)['then'](function(_0xd23d15){return _0xd23d15;});}return null;};}function removeEntity(_0x1c24eb){return function(_0x283813){if(_0x283813){return _0x283813[_0xbd73('0x2c')]()[_0xbd73('0x19')](function(){var _0x1da9a3=_0x283813['get']({'plain':!![]});var _0xce5b35=_0xbd73('0x2d');return db[_0xbd73('0x2e')][_0xbd73('0x2c')]({'where':{'type':_0xce5b35,'resourceId':_0x1da9a3['id']}})[_0xbd73('0x19')](function(){return _0x283813;});})[_0xbd73('0x19')](function(){_0x1c24eb[_0xbd73('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36fa65){return function(_0x540a8c){if(!_0x540a8c){_0x36fa65['sendStatus'](0x194);}return _0x540a8c;};}function handleError(_0x29dec0,_0x245bcd){_0x245bcd=_0x245bcd||0x1f4;return function(_0x39f22f){logger[_0xbd73('0x1f')](_0x39f22f[_0xbd73('0x2f')]);if(_0x39f22f[_0xbd73('0x30')]){delete _0x39f22f['name'];}_0x29dec0['status'](_0x245bcd)[_0xbd73('0x31')](_0x39f22f);};}exports[_0xbd73('0x32')]=function(_0x51f52b,_0x3c15b5){var _0x2bfeb6={'include':[{'model':db[_0xbd73('0x33')],'as':'mandatoryDispositionPause'}]},_0x579845={},_0x315e53={'count':0x0,'rows':[]};var _0x3a13e1=_[_0xbd73('0x34')](db[_0xbd73('0x35')][_0xbd73('0x36')],function(_0x133bbb){return{'name':_0x133bbb[_0xbd73('0x37')],'type':_0x133bbb['type']['key']};});_0x579845[_0xbd73('0x38')]=_[_0xbd73('0x34')](_0x3a13e1,'name');_0x579845[_0xbd73('0x39')]=_[_0xbd73('0x3a')](_0x51f52b['query']);_0x579845[_0xbd73('0x3b')]=_['intersection'](_0x579845[_0xbd73('0x38')],_0x579845[_0xbd73('0x39')]);_0x2bfeb6[_0xbd73('0x3c')]=_[_0xbd73('0x3d')](_0x579845[_0xbd73('0x38')],qs[_0xbd73('0x3e')](_0x51f52b[_0xbd73('0x39')][_0xbd73('0x3e')]));_0x2bfeb6[_0xbd73('0x3c')]=_0x2bfeb6[_0xbd73('0x3c')][_0xbd73('0x3f')]?_0x2bfeb6[_0xbd73('0x3c')]:_0x579845['model'];if(!_0x51f52b[_0xbd73('0x39')][_0xbd73('0x40')](_0xbd73('0x41'))){_0x2bfeb6['limit']=qs[_0xbd73('0x27')](_0x51f52b[_0xbd73('0x39')][_0xbd73('0x27')]);_0x2bfeb6[_0xbd73('0x28')]=qs['offset'](_0x51f52b[_0xbd73('0x39')]['offset']);}_0x2bfeb6[_0xbd73('0x42')]=qs['sort'](_0x51f52b[_0xbd73('0x39')]['sort']);_0x2bfeb6[_0xbd73('0x43')]=qs['filters'](_[_0xbd73('0x44')](_0x51f52b['query'],_0x579845['filters']),_0x3a13e1);if(_0x51f52b['query'][_0xbd73('0x45')]){_0x2bfeb6[_0xbd73('0x43')]=_[_0xbd73('0x46')](_0x2bfeb6[_0xbd73('0x43')],{'$or':_[_0xbd73('0x34')](_0x3a13e1,function(_0x63bb35){if(_0x63bb35[_0xbd73('0x47')]!==_0xbd73('0x48')){var _0x8611ac={};_0x8611ac[_0x63bb35[_0xbd73('0x30')]]={'$like':'%'+_0x51f52b[_0xbd73('0x39')][_0xbd73('0x45')]+'%'};return _0x8611ac;}})});}_0x2bfeb6=_[_0xbd73('0x46')]({},_0x2bfeb6,_0x51f52b['options']);var _0x89c288={'where':_0x2bfeb6[_0xbd73('0x43')]};return db['ChatWebsite'][_0xbd73('0x29')](_0x89c288)[_0xbd73('0x19')](function(_0x5c8009){_0x315e53[_0xbd73('0x29')]=_0x5c8009;if(_0x51f52b[_0xbd73('0x39')]['includeAll']){_0x2bfeb6['include']=[{'all':!![]}];}return db[_0xbd73('0x35')][_0xbd73('0x49')](_0x2bfeb6);})[_0xbd73('0x19')](function(_0x5ef664){_0x315e53['rows']=_0x5ef664;return _0x315e53;})['then'](respondWithFilteredResult(_0x3c15b5,_0x2bfeb6))[_0xbd73('0x4a')](handleError(_0x3c15b5,null));};exports[_0xbd73('0x4b')]=function(_0x3d3ae0,_0x994ba5){var _0x1668d5={'raw':![],'where':{'id':_0x3d3ae0['params']['id']},'include':[{'model':db[_0xbd73('0x33')],'as':_0xbd73('0x4c')}]},_0x3e6997={};_0x3e6997[_0xbd73('0x38')]=_['keys'](db[_0xbd73('0x35')]['rawAttributes']);_0x3e6997[_0xbd73('0x39')]=_[_0xbd73('0x3a')](_0x3d3ae0[_0xbd73('0x39')]);_0x3e6997[_0xbd73('0x3b')]=_[_0xbd73('0x3d')](_0x3e6997[_0xbd73('0x38')],_0x3e6997[_0xbd73('0x39')]);_0x1668d5[_0xbd73('0x3c')]=_[_0xbd73('0x3d')](_0x3e6997[_0xbd73('0x38')],qs[_0xbd73('0x3e')](_0x3d3ae0[_0xbd73('0x39')][_0xbd73('0x3e')]));_0x1668d5[_0xbd73('0x3c')]=_0x1668d5['attributes']['length']?_0x1668d5[_0xbd73('0x3c')]:_0x3e6997['model'];if(_0x3d3ae0['query'][_0xbd73('0x4d')]){_0x1668d5['include']=[{'all':!![]}];}_0x1668d5=_[_0xbd73('0x46')]({},_0x1668d5,_0x3d3ae0[_0xbd73('0x4e')]);return db[_0xbd73('0x35')]['find'](_0x1668d5)[_0xbd73('0x19')](handleEntityNotFound(_0x994ba5,null))[_0xbd73('0x19')](respondWithResult(_0x994ba5,null))[_0xbd73('0x4a')](handleError(_0x994ba5,null));};exports[_0xbd73('0x4f')]=function(_0x54da4d,_0x2ecbf8){return db[_0xbd73('0x35')][_0xbd73('0x4f')](_0x54da4d[_0xbd73('0x50')],{})[_0xbd73('0x19')](function(_0x429b27){var _0x5b067e=_0x54da4d[_0xbd73('0x51')][_0xbd73('0x52')]({'plain':!![]});if(!_0x5b067e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b067e[_0xbd73('0x53')]===_0xbd73('0x51')){var _0x5634e4=_0x429b27[_0xbd73('0x52')]({'plain':!![]});var _0x340b03='ChatWebsites';return db['UserProfileSection'][_0xbd73('0x54')]({'where':{'name':_0x340b03,'userProfileId':_0x5b067e['userProfileId']},'raw':!![]})[_0xbd73('0x19')](function(_0x283015){if(_0x283015&&_0x283015[_0xbd73('0x55')]===0x0){return db[_0xbd73('0x2e')]['create']({'name':_0x5634e4[_0xbd73('0x30')],'resourceId':_0x5634e4['id'],'type':_0x283015[_0xbd73('0x30')],'sectionId':_0x283015['id']},{})[_0xbd73('0x19')](function(){return _0x429b27;});}else{return _0x429b27;}})[_0xbd73('0x4a')](function(_0x5e909f){logger[_0xbd73('0x1f')](_0xbd73('0x56'),_0x5e909f);throw _0x5e909f;});}return _0x429b27;})[_0xbd73('0x19')](respondWithResult(_0x2ecbf8,0xc9))[_0xbd73('0x4a')](handleError(_0x2ecbf8,null));};exports[_0xbd73('0x2b')]=function(_0x514d37,_0x37dd32){if(_0x514d37['body']['id']){delete _0x514d37[_0xbd73('0x50')]['id'];}return db[_0xbd73('0x35')][_0xbd73('0x54')]({'where':{'id':_0x514d37[_0xbd73('0x57')]['id']},'include':[{'model':db[_0xbd73('0x33')],'as':'mandatoryDispositionPause'}]})[_0xbd73('0x19')](handleEntityNotFound(_0x37dd32,null))['then'](saveUpdates(_0x514d37[_0xbd73('0x50')],null))['then'](respondWithResult(_0x37dd32,null))[_0xbd73('0x4a')](handleError(_0x37dd32,null));};exports['destroy']=function(_0x1ed76f,_0x2a8cae){return db['ChatWebsite'][_0xbd73('0x54')]({'where':{'id':_0x1ed76f[_0xbd73('0x57')]['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0x2a8cae,null))[_0xbd73('0x19')](removeEntity(_0x2a8cae,null))[_0xbd73('0x4a')](handleError(_0x2a8cae,null));};exports[_0xbd73('0x58')]=function(_0x2a2b35,_0x3c10bd){return db[_0xbd73('0x35')][_0xbd73('0x58')]()[_0xbd73('0x19')](respondWithResult(_0x3c10bd,null))[_0xbd73('0x4a')](handleError(_0x3c10bd,null));};exports[_0xbd73('0x59')]=function(_0x90d9de,_0x3de0ec){if(_0x90d9de[_0xbd73('0x50')]['id']){delete _0x90d9de[_0xbd73('0x50')]['id'];}return db[_0xbd73('0x35')][_0xbd73('0x54')]({'where':{'id':_0x90d9de[_0xbd73('0x57')]['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0x3de0ec,null))[_0xbd73('0x19')](function(_0x4b7326){if(_0x4b7326){_0x90d9de[_0xbd73('0x50')][_0xbd73('0x5a')]=_0x4b7326['id'];return db[_0xbd73('0x5b')][_0xbd73('0x4f')](_0x90d9de[_0xbd73('0x50')]);}})[_0xbd73('0x19')](respondWithResult(_0x3de0ec,null))[_0xbd73('0x4a')](handleError(_0x3de0ec,null));};exports['getDispositions']=function(_0x149bd4,_0x3d2e65){var _0xb3dc86={'raw':![],'where':{}};var _0x82179={};var _0x4f3980={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x149bd4[_0xbd73('0x57')]['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0x3d2e65,null))[_0xbd73('0x19')](function(_0x4181bb){if(_0x4181bb){_0x82179[_0xbd73('0x38')]=_[_0xbd73('0x3a')](db['Disposition'][_0xbd73('0x36')]);_0x82179['query']=_[_0xbd73('0x3a')](_0x149bd4[_0xbd73('0x39')]);_0x82179[_0xbd73('0x3b')]=_[_0xbd73('0x3d')](_0x82179[_0xbd73('0x38')],_0x82179[_0xbd73('0x39')]);_0xb3dc86[_0xbd73('0x3c')]=_[_0xbd73('0x3d')](_0x82179[_0xbd73('0x38')],qs['fields'](_0x149bd4[_0xbd73('0x39')][_0xbd73('0x3e')]));_0xb3dc86[_0xbd73('0x3c')]=_0xb3dc86['attributes'][_0xbd73('0x3f')]?_0xb3dc86[_0xbd73('0x3c')]:_0x82179[_0xbd73('0x38')];if(!_0x149bd4[_0xbd73('0x39')]['hasOwnProperty'](_0xbd73('0x41'))){_0xb3dc86[_0xbd73('0x27')]=qs[_0xbd73('0x27')](_0x149bd4[_0xbd73('0x39')][_0xbd73('0x27')]);_0xb3dc86[_0xbd73('0x28')]=qs[_0xbd73('0x28')](_0x149bd4[_0xbd73('0x39')][_0xbd73('0x28')]);}_0xb3dc86['order']=qs[_0xbd73('0x5c')](_0x149bd4['query']['sort']);_0xb3dc86[_0xbd73('0x43')]=qs['filters'](_['pick'](_0x149bd4[_0xbd73('0x39')],_0x82179[_0xbd73('0x3b')]));_0xb3dc86['where'][_0xbd73('0x5a')]=_0x4181bb['id'];if(_0x149bd4[_0xbd73('0x39')][_0xbd73('0x45')]){_0xb3dc86[_0xbd73('0x43')]=_['merge'](_0xb3dc86[_0xbd73('0x43')],{'$or':_[_0xbd73('0x34')](_0xb3dc86[_0xbd73('0x3c')],function(_0xe7ad22){var _0xb2e3cc={};_0xb2e3cc[_0xe7ad22]={'$like':'%'+_0x149bd4['query'][_0xbd73('0x45')]+'%'};return _0xb2e3cc;})});}_0xb3dc86=_[_0xbd73('0x46')]({},_0xb3dc86,_0x149bd4[_0xbd73('0x4e')]);return db[_0xbd73('0x5b')][_0xbd73('0x29')]({'where':_0xb3dc86['where']})[_0xbd73('0x19')](function(_0x26b58b){_0x4f3980['count']=_0x26b58b;if(_0x149bd4[_0xbd73('0x39')][_0xbd73('0x4d')]){_0xb3dc86[_0xbd73('0x5d')]=[{'all':!![]}];}return db[_0xbd73('0x5b')][_0xbd73('0x49')](_0xb3dc86);})[_0xbd73('0x19')](function(_0x352eca){_0x4f3980[_0xbd73('0x5e')]=_0x352eca;return _0x4f3980;});}})[_0xbd73('0x19')](respondWithFilteredResult(_0x3d2e65,_0xb3dc86))[_0xbd73('0x4a')](handleError(_0x3d2e65,null));};exports[_0xbd73('0x5f')]=function(_0x56516c,_0x131790){return db[_0xbd73('0x35')][_0xbd73('0x54')]({'where':{'id':_0x56516c[_0xbd73('0x57')]['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0x131790,null))['then'](function(_0x538b73){if(_0x538b73){return _0x538b73[_0xbd73('0x5f')](_0x56516c[_0xbd73('0x39')]['ids']);}})[_0xbd73('0x19')](respondWithStatusCode(_0x131790,null))[_0xbd73('0x4a')](handleError(_0x131790,null));};exports[_0xbd73('0x60')]=function(_0x48cadd,_0x3b203f){if(_0x48cadd['body']['id']){delete _0x48cadd[_0xbd73('0x50')]['id'];}return db[_0xbd73('0x35')][_0xbd73('0x54')]({'where':{'id':_0x48cadd[_0xbd73('0x57')]['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0x3b203f,null))[_0xbd73('0x19')](function(_0x317e5c){if(_0x317e5c){_0x48cadd[_0xbd73('0x50')]['ChatWebsiteId']=_0x317e5c['id'];return db[_0xbd73('0x61')][_0xbd73('0x4f')](_0x48cadd[_0xbd73('0x50')]);}})[_0xbd73('0x19')](respondWithResult(_0x3b203f,null))[_0xbd73('0x4a')](handleError(_0x3b203f,null));};exports[_0xbd73('0x62')]=function(_0x1e06d1,_0xb10f66){var _0x21edf5={'raw':![],'where':{}};var _0x588c81={};var _0x5c0bdc={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xbd73('0x63')]({'where':{'id':_0x1e06d1[_0xbd73('0x57')]['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0xb10f66,null))[_0xbd73('0x19')](function(_0x250c52){if(_0x250c52){_0x588c81[_0xbd73('0x38')]=_[_0xbd73('0x3a')](db[_0xbd73('0x61')][_0xbd73('0x36')]);_0x588c81['query']=_[_0xbd73('0x3a')](_0x1e06d1[_0xbd73('0x39')]);_0x588c81[_0xbd73('0x3b')]=_[_0xbd73('0x3d')](_0x588c81[_0xbd73('0x38')],_0x588c81['query']);_0x21edf5[_0xbd73('0x3c')]=_['intersection'](_0x588c81[_0xbd73('0x38')],qs[_0xbd73('0x3e')](_0x1e06d1[_0xbd73('0x39')]['fields']));_0x21edf5[_0xbd73('0x3c')]=_0x21edf5[_0xbd73('0x3c')][_0xbd73('0x3f')]?_0x21edf5[_0xbd73('0x3c')]:_0x588c81[_0xbd73('0x38')];if(!_0x1e06d1['query']['hasOwnProperty'](_0xbd73('0x41'))){_0x21edf5[_0xbd73('0x27')]=qs[_0xbd73('0x27')](_0x1e06d1[_0xbd73('0x39')][_0xbd73('0x27')]);_0x21edf5[_0xbd73('0x28')]=qs[_0xbd73('0x28')](_0x1e06d1[_0xbd73('0x39')][_0xbd73('0x28')]);}_0x21edf5[_0xbd73('0x42')]=qs[_0xbd73('0x5c')](_0x1e06d1[_0xbd73('0x39')]['sort']);_0x21edf5[_0xbd73('0x43')]=qs[_0xbd73('0x3b')](_[_0xbd73('0x44')](_0x1e06d1[_0xbd73('0x39')],_0x588c81['filters']));_0x21edf5[_0xbd73('0x43')][_0xbd73('0x5a')]=_0x250c52['id'];if(_0x1e06d1['query']['filter']){_0x21edf5['where']=_['merge'](_0x21edf5[_0xbd73('0x43')],{'$or':_[_0xbd73('0x34')](_0x21edf5[_0xbd73('0x3c')],function(_0xc7f152){var _0x2b00c3={};_0x2b00c3[_0xc7f152]={'$like':'%'+_0x1e06d1['query'][_0xbd73('0x45')]+'%'};return _0x2b00c3;})});}_0x21edf5=_[_0xbd73('0x46')]({},_0x21edf5,_0x1e06d1['options']);return db[_0xbd73('0x61')][_0xbd73('0x29')]({'where':_0x21edf5[_0xbd73('0x43')]})[_0xbd73('0x19')](function(_0x5fb170){_0x5c0bdc[_0xbd73('0x29')]=_0x5fb170;if(_0x1e06d1[_0xbd73('0x39')]['includeAll']){_0x21edf5['include']=[{'all':!![]}];}return db[_0xbd73('0x61')][_0xbd73('0x49')](_0x21edf5);})[_0xbd73('0x19')](function(_0x53440d){_0x5c0bdc[_0xbd73('0x5e')]=_0x53440d;return _0x5c0bdc;});}})['then'](respondWithFilteredResult(_0xb10f66,_0x21edf5))[_0xbd73('0x4a')](handleError(_0xb10f66,null));};exports[_0xbd73('0x64')]=function(_0x58d25c,_0xaac3){return db[_0xbd73('0x35')][_0xbd73('0x54')]({'where':{'id':_0x58d25c[_0xbd73('0x57')]['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0xaac3,null))[_0xbd73('0x19')](function(_0x303ce8){if(_0x303ce8){return _0x303ce8[_0xbd73('0x64')](_0x58d25c[_0xbd73('0x39')][_0xbd73('0x65')]);}})[_0xbd73('0x19')](respondWithStatusCode(_0xaac3,null))[_0xbd73('0x4a')](handleError(_0xaac3,null));};exports[_0xbd73('0x66')]=function(_0xc0fef0,_0x38bc03){_0xc0fef0[_0xbd73('0x50')][_0xbd73('0x67')]=_0xc0fef0[_0xbd73('0x68')][_0xbd73('0x69')];return db[_0xbd73('0x35')]['find']({'where':{'id':_0xc0fef0[_0xbd73('0x57')]['id']}})['then'](handleEntityNotFound(_0x38bc03,null))['then'](saveUpdates(_0xc0fef0['body'],null))[_0xbd73('0x19')](respondWithResult(_0x38bc03,null))['catch'](handleError(_0x38bc03,null));};exports[_0xbd73('0x6a')]=function(_0x2b10ab,_0x576bc3){_0x2b10ab[_0xbd73('0x50')]['agentAvatar']=_0x2b10ab[_0xbd73('0x68')][_0xbd73('0x69')];return db[_0xbd73('0x35')][_0xbd73('0x54')]({'where':{'id':_0x2b10ab['params']['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0x576bc3,null))[_0xbd73('0x19')](saveUpdates(_0x2b10ab[_0xbd73('0x50')],null))[_0xbd73('0x19')](respondWithResult(_0x576bc3,null))[_0xbd73('0x4a')](handleError(_0x576bc3,null));};exports[_0xbd73('0x6b')]=function(_0xea8b95,_0xcb20d7){_0xea8b95[_0xbd73('0x50')][_0xbd73('0x6c')]=_0xea8b95[_0xbd73('0x68')][_0xbd73('0x69')];return db[_0xbd73('0x35')][_0xbd73('0x54')]({'where':{'id':_0xea8b95['params']['id']}})['then'](handleEntityNotFound(_0xcb20d7,null))[_0xbd73('0x19')](saveUpdates(_0xea8b95[_0xbd73('0x50')],null))[_0xbd73('0x19')](respondWithResult(_0xcb20d7,null))[_0xbd73('0x4a')](handleError(_0xcb20d7,null));};exports[_0xbd73('0x6d')]=function(_0x89bd9c,_0x4f73c0){_0x89bd9c[_0xbd73('0x50')][_0xbd73('0x6e')]=_0x89bd9c[_0xbd73('0x68')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x89bd9c[_0xbd73('0x57')]['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0x4f73c0,null))[_0xbd73('0x19')](saveUpdates(_0x89bd9c[_0xbd73('0x50')],null))['then'](respondWithResult(_0x4f73c0,null))[_0xbd73('0x4a')](handleError(_0x4f73c0,null));};exports[_0xbd73('0x6f')]=function(_0x21bc9f,_0x24e22a){var _0x4b04f4=path[_0xbd73('0x70')](config['root'],_0xbd73('0x71'));var _0x24cc8b={'where':{'id':_0x21bc9f['params']['id']},'attributes':['id',_0xbd73('0x67')],'raw':!![]};var _0x1e1a9e=![];return require('../../config/license/util')[_0xbd73('0x72')]()['then'](function(_0x67cb04){if(_0x67cb04){_0x1e1a9e=_0x67cb04[_0xbd73('0x73')];}})[_0xbd73('0x19')](function(){return db['ChatWebsite']['find'](_0x24cc8b);})['then'](handleEntityNotFound(_0x24e22a,null))[_0xbd73('0x19')](function(_0x224c92){if(_0x224c92){if(!_[_0xbd73('0x74')](_0x224c92[_0xbd73('0x67')])){if(fs[_0xbd73('0x75')](path[_0xbd73('0x70')](config[_0xbd73('0x76')],_0xbd73('0x77'),_0x224c92[_0xbd73('0x67')]))&&_0x1e1a9e){_0x4b04f4=path[_0xbd73('0x70')](config[_0xbd73('0x76')],_0xbd73('0x77'),_0x224c92[_0xbd73('0x67')]);}}return _0x24e22a[_0xbd73('0x78')](_0x4b04f4);}})[_0xbd73('0x4a')](handleError(_0x24e22a,null));};exports[_0xbd73('0x79')]=function(_0x54ba11,_0x2930ba){var _0x1ecc76=path[_0xbd73('0x70')](config[_0xbd73('0x76')],_0xbd73('0x7a'));var _0x1cdbea={'where':{'id':_0x54ba11[_0xbd73('0x57')]['id']},'attributes':['id',_0xbd73('0x7b')],'raw':!![]};return db[_0xbd73('0x35')][_0xbd73('0x54')](_0x1cdbea)[_0xbd73('0x19')](handleEntityNotFound(_0x2930ba,null))['then'](function(_0x4af797){if(_0x4af797){if(!_[_0xbd73('0x74')](_0x4af797['agentAvatar'])){if(fs[_0xbd73('0x75')](path[_0xbd73('0x70')](config[_0xbd73('0x76')],'server/files/images/avatars/',_0x4af797['agentAvatar']))){_0x1ecc76=path[_0xbd73('0x70')](config['root'],_0xbd73('0x7c'),_0x4af797[_0xbd73('0x7b')]);}}return _0x2930ba['download'](_0x1ecc76);}})[_0xbd73('0x4a')](handleError(_0x2930ba,null));};exports[_0xbd73('0x7d')]=function(_0x288826,_0x492aed){var _0x484239=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x34d64d={'where':{'id':_0x288826[_0xbd73('0x57')]['id']},'attributes':['id','customerAvatar',_0xbd73('0x7e')],'raw':!![]};return db[_0xbd73('0x35')][_0xbd73('0x54')](_0x34d64d)['then'](handleEntityNotFound(_0x492aed,null))[_0xbd73('0x19')](function(_0x31d267){if(_0x31d267){if(!_['isNil'](_0x31d267[_0xbd73('0x6c')])){if(fs[_0xbd73('0x75')](path[_0xbd73('0x70')](config[_0xbd73('0x76')],_0xbd73('0x7c'),_0x31d267[_0xbd73('0x6c')]))&&_0x31d267[_0xbd73('0x7e')]){_0x484239=path['join'](config['root'],'server/files/images/avatars/',_0x31d267[_0xbd73('0x6c')]);}}return _0x492aed[_0xbd73('0x78')](_0x484239);}})[_0xbd73('0x4a')](handleError(_0x492aed,null));};exports['getSystemAvatar']=function(_0x2615d7,_0x13680a){var _0x5b1ffd=path[_0xbd73('0x70')](config[_0xbd73('0x76')],_0xbd73('0x7f'));var _0x4e2efc={'where':{'id':_0x2615d7[_0xbd73('0x57')]['id']},'attributes':['id',_0xbd73('0x6e')],'raw':!![]};return db[_0xbd73('0x35')]['find'](_0x4e2efc)['then'](handleEntityNotFound(_0x13680a,null))[_0xbd73('0x19')](function(_0x46ebd4){if(_0x46ebd4){if(!_[_0xbd73('0x74')](_0x46ebd4['systemAvatar'])){if(fs[_0xbd73('0x75')](path[_0xbd73('0x70')](config[_0xbd73('0x76')],_0xbd73('0x7c'),_0x46ebd4[_0xbd73('0x6e')]))){_0x5b1ffd=path['join'](config[_0xbd73('0x76')],'server/files/images/avatars/',_0x46ebd4[_0xbd73('0x6e')]);}}return _0x13680a[_0xbd73('0x78')](_0x5b1ffd);}})['catch'](handleError(_0x13680a,null));};exports[_0xbd73('0x80')]=function(_0x1a8677,_0x5a4851){var _0x51611b=require(_0xbd73('0x81'));var _0x4d7ece=new _0x51611b();var _0x192c35=_0x4d7ece[_0xbd73('0x82')](_0x1a8677[_0xbd73('0x83')][_0xbd73('0x84')])[_0xbd73('0x85')]();var _0xb29ea4={'body':_0x1a8677['body'],'channel':_0xbd73('0x86')};var _0x22a2e0=[];var _0x1c4945=[];var _0x2600af={};var _0x4b331c=![];return db[_0xbd73('0x87')]['describe']()['then'](function(_0x468cf6){if(!_0x468cf6){throw new db[(_0xbd73('0x88'))]['ValidationError'](_0xbd73('0x89'));}_0x22a2e0=_[_0xbd73('0x8a')](_[_0xbd73('0x3a')](_0x468cf6),[_0xbd73('0x8b'),_0xbd73('0x8c')]);_0x1c4945=_['difference'](_[_0xbd73('0x3a')](_0x468cf6),[_0xbd73('0x8b'),_0xbd73('0x8c'),'CompanyId',_0xbd73('0x8d')]);if(_0x1a8677[_0xbd73('0x50')]['id']){delete _0x1a8677[_0xbd73('0x50')]['id'];}if(_[_0xbd73('0x74')](_0x1a8677[_0xbd73('0x50')][_0xbd73('0x8e')])){throw new db[(_0xbd73('0x88'))]['ValidationError'](_0xbd73('0x8f'));}if(_['isNil'](_0x1a8677[_0xbd73('0x50')][_0xbd73('0x50')])||_0x1a8677[_0xbd73('0x50')]['body']===''){throw new db[(_0xbd73('0x88'))]['ValidationError'](_0xbd73('0x90'));}if(_[_0xbd73('0x74')](_0x1a8677['body']['mapKey'])){throw new db[(_0xbd73('0x88'))][(_0xbd73('0x91'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c4945);}if(!_[_0xbd73('0x92')](_0x1c4945,_0x1a8677[_0xbd73('0x50')][_0xbd73('0x93')])){throw new db[(_0xbd73('0x88'))][(_0xbd73('0x91'))](_0xbd73('0x94')+_0x1c4945);}_0x2600af[_0x1a8677[_0xbd73('0x50')][_0xbd73('0x93')]]=_0x1a8677[_0xbd73('0x50')][_0xbd73('0x8e')];})[_0xbd73('0x19')](function(){return db[_0xbd73('0x35')][_0xbd73('0x54')]({'where':{'id':_0x1a8677[_0xbd73('0x57')]['id']},'include':[{'model':db[_0xbd73('0x95')],'as':_0xbd73('0x96'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x2600af,'limit':0x1,'order':[[_0xbd73('0x8c'),_0xbd73('0x97')]]}]},{'model':db['ChatApplication'],'as':_0xbd73('0x98')}]});})['then'](handleEntityNotFound(_0x5a4851,null))['then'](function(_0x2af548){if(_0x2af548&&_0x2af548[_0xbd73('0x96')]){_0xb29ea4['account']=_0x2af548;_0xb29ea4['applications']=_0x2af548['Applications'];_0xb29ea4[_0xbd73('0x99')]=_0x2af548[_0xbd73('0x96')];_0xb29ea4['applications']=_['orderBy'](_0xb29ea4[_0xbd73('0x9a')],[_0xbd73('0x9b')],[_0xbd73('0x9c')]);if(_0xb29ea4[_0xbd73('0x9d')]['Applications']){delete _0xb29ea4[_0xbd73('0x9d')]['Applications'];}if(_0xb29ea4[_0xbd73('0x9d')][_0xbd73('0x96')]&&_0xb29ea4['account'][_0xbd73('0x96')][_0xbd73('0x9e')]['length']){return _0xb29ea4[_0xbd73('0x9d')][_0xbd73('0x96')][_0xbd73('0x9e')][0x0];}var _0x38ae88=_[_0xbd73('0xf')](_0x1a8677[_0xbd73('0x50')],{'firstName':_0x1a8677[_0xbd73('0x50')][_0xbd73('0x8e')],'ListId':_0x2af548[_0xbd73('0x8d')]});_0x38ae88[_0x1a8677[_0xbd73('0x50')]['mapKey']]=_0x1a8677['body'][_0xbd73('0x8e')];return db[_0xbd73('0x87')][_0xbd73('0x4f')](_0x38ae88,{'fields':_0x22a2e0,'raw':!![]});}})[_0xbd73('0x19')](handleEntityNotFound(_0x5a4851,null))[_0xbd73('0x19')](function(_0x13207f){_0xb29ea4[_0xbd73('0x9f')]=_0x13207f;var _0x52eae7=_0x1a8677['body'][_0xbd73('0xa0')];if(_0x1a8677[_0xbd73('0x83')][_0xbd73('0xa1')]){_0x52eae7=_0x1a8677['headers']['cf-connecting-ip'];}else if(_0x1a8677[_0xbd73('0x83')][_0xbd73('0xa2')]){_0x52eae7=_['first'](_0x1a8677[_0xbd73('0x83')][_0xbd73('0xa2')][_0xbd73('0xa3')](','));}if(_0x13207f){var _0x38b05c={'ContactId':_0x13207f['id'],'ChatWebsiteId':_0x1a8677[_0xbd73('0x57')]['id'],'from':(_0x13207f['firstName']||'')+'\x20'+(_0x13207f[_0xbd73('0xa4')]||''),'customerIp':_0x52eae7,'customerPort':_0x1a8677[_0xbd73('0x83')]['x-real-port']?_0x1a8677[_0xbd73('0x83')]['x-real-port']:null,'referer':_0x1a8677[_0xbd73('0x50')][_0xbd73('0xa5')],'browserName':_0x192c35[_0xbd73('0xa6')][_0xbd73('0x30')]&&_0x192c35['browser'][_0xbd73('0xa7')]?util[_0xbd73('0xa8')](_0xbd73('0xa9'),_0x192c35[_0xbd73('0xa6')][_0xbd73('0x30')],_0x192c35[_0xbd73('0xa6')][_0xbd73('0xa7')]):_0xbd73('0xaa'),'browserVersion':_0x192c35[_0xbd73('0xa6')][_0xbd73('0xa7')]||_0xbd73('0xaa'),'osName':util[_0xbd73('0xa8')](_0xbd73('0xa9'),_0x192c35['os'][_0xbd73('0x30')],_0x192c35['os'][_0xbd73('0xa7')]),'osVersion':_0x192c35['os'][_0xbd73('0xa7')],'deviceModel':_0x192c35[_0xbd73('0xab')][_0xbd73('0x38')]&&_0x192c35['device']['vendor']?util['format'](_0xbd73('0xac'),_0x192c35[_0xbd73('0xab')]['model'],_0x192c35[_0xbd73('0xab')]['vendor'],_0x192c35[_0xbd73('0xab')][_0xbd73('0x47')]):null,'deviceVendor':_0x192c35[_0xbd73('0xab')][_0xbd73('0xad')],'deviceType':_0x192c35[_0xbd73('0xab')][_0xbd73('0x47')],'formData':JSON[_0xbd73('0x1e')](_0x1a8677[_0xbd73('0x50')])};var _0x4f7732={'ChatWebsiteId':_0x1a8677[_0xbd73('0x57')]['id'],'closed':![]};if(_0x1a8677[_0xbd73('0x50')][_0xbd73('0xae')]){_0x4f7732[_0xbd73('0xae')]=_0x1a8677[_0xbd73('0x50')][_0xbd73('0xae')];return db[_0xbd73('0xaf')]['find']({'where':_0x4f7732})[_0xbd73('0x19')](function(_0x403faf){if(_0x403faf){return[_0x403faf,![]];}_0x38b05c[_0xbd73('0xae')]=_0x1a8677['body'][_0xbd73('0xae')];_0x38b05c[_0xbd73('0xb0')]=_0x1a8677[_0xbd73('0x50')][_0xbd73('0xb0')];return db[_0xbd73('0xaf')][_0xbd73('0x4f')](_0x38b05c)[_0xbd73('0x19')](function(_0x2297d7){return[_0x2297d7,!![]];});});}_0x4f7732['ContactId']=_0x13207f['id'];if(_0x1a8677[_0xbd73('0x50')][_0xbd73('0xb1')]&&_0x1a8677['body'][_0xbd73('0xb1')]['id']){_0x4f7732['id']=_0x1a8677['body'][_0xbd73('0xb1')]['id'];return db[_0xbd73('0xaf')][_0xbd73('0x54')]({'where':_0x4f7732})[_0xbd73('0x19')](function(_0x3b0c4d){if(_0x3b0c4d){return[_0x3b0c4d,![]];}return db[_0xbd73('0xaf')][_0xbd73('0x4f')](_0x38b05c)[_0xbd73('0x19')](function(_0x151316){return[_0x151316,!![]];});});}return db['ChatInteraction'][_0xbd73('0x4f')](_0x38b05c)[_0xbd73('0x19')](function(_0x518e70){return[_0x518e70,!![]];});}})[_0xbd73('0xb2')](function(_0x835d19,_0x487ffc){if(_0x835d19){_0x4b331c=_0x487ffc;if(!_0x487ffc){var _0x59e3bd={'from':(_0xb29ea4[_0xbd73('0x9f')][_0xbd73('0xb3')]||'')+'\x20'+(_0xb29ea4[_0xbd73('0x9f')][_0xbd73('0xa4')]||'')};if(_0x1a8677[_0xbd73('0x50')]['threadId']&&_0x1a8677['body'][_0xbd73('0xb4')]&&_0x1a8677[_0xbd73('0x50')][_0xbd73('0xae')]!=_0x1a8677[_0xbd73('0x50')][_0xbd73('0xb4')]){_0x59e3bd[_0xbd73('0xae')]=_0x1a8677['body'][_0xbd73('0xb4')];}return _0x835d19[_0xbd73('0x2b')](_0x59e3bd);}else{return _0x835d19;}}})[_0xbd73('0x19')](function(_0xbb616){_0xb29ea4[_0xbd73('0xb1')]=_0xbb616[_0xbd73('0x52')]({'plain':!![]});_0xb29ea4[_0xbd73('0xb1')][_0xbd73('0xb5')]=_0x4b331c;if(_0xb29ea4[_0xbd73('0xb1')][_0xbd73('0xb5')]){if(_0xb29ea4[_0xbd73('0x9d')]['autoclose']){_0xb29ea4[_0xbd73('0x9a')][_0xbd73('0xb6')]({'id':0x0,'priority':_0xb29ea4[_0xbd73('0x9a')]['length']+0x1,'app':_0xbd73('0xb7'),'appdata':_0xbd73('0xb8'),'interval':_0xbd73('0xb9')});}}return db[_0xbd73('0xba')][_0xbd73('0x4f')]({'body':_0x1a8677[_0xbd73('0x50')][_0xbd73('0x50')],'ChatWebsiteId':_0x1a8677[_0xbd73('0x57')]['id'],'ChatInteractionId':_0xbb616['id'],'direction':'in','ContactId':_0xb29ea4['contact']['id'],'AttachmentId':_0x1a8677[_0xbd73('0x50')]['AttachmentId']});})[_0xbd73('0x19')](function(_0x9942cd){_0xb29ea4[_0xbd73('0x21')]=_0x9942cd;if(_0xb29ea4[_0xbd73('0xb1')]['UserId']){return db[_0xbd73('0xbb')][_0xbd73('0x54')]({'attributes':['id',_0xbd73('0x30')],'where':{'id':_0xb29ea4[_0xbd73('0xb1')]['UserId']}})[_0xbd73('0x19')](function(_0x28935a){if(_0x28935a){_0xb29ea4['applications'][_0xbd73('0xbc')]({'id':0x0,'priority':0x0,'app':_0xbd73('0xbd'),'appdata':_0x28935a[_0xbd73('0x30')]+','+(_0xb29ea4[_0xbd73('0x9d')][_0xbd73('0xbe')]||0xa),'interval':_0xbd73('0xb9')});_0xb29ea4[_0xbd73('0xbf')]=!![];}return respondWithRpcPromise(_0xbd73('0xc0'),_0xbd73('0xc1'),_0xb29ea4);});}return respondWithRpcPromise('Start',_0xbd73('0xc1'),_0xb29ea4);})[_0xbd73('0x19')](function(_0x57636c){respondWithRpcPromise(_0xbd73('0xc2'),_0xbd73('0xc2'),{'event':'notify','message':_0x57636c},client9002);return _0x57636c;})[_0xbd73('0x19')](respondWithResult(_0x5a4851,null))[_0xbd73('0x4a')](handleError(_0x5a4851,null));};exports[_0xbd73('0xc3')]=function(_0x1d210e,_0x31b627){var _0x434d81,_0x1d4675,_0x170643;var _0x4dd8c1=[];var _0x55b94b={};var _0x514a7b=_0x1d210e[_0xbd73('0xc4')]||[];var _0x2c9a0d=[];var _0x1f6d69;return db[_0xbd73('0x87')][_0xbd73('0x58')]()[_0xbd73('0x19')](function(_0x4a8902){if(!_0x4a8902){throw new db[(_0xbd73('0x88'))][(_0xbd73('0x91'))]('no\x20available\x20attributes');}_0x4dd8c1=_[_0xbd73('0x8a')](_['keys'](_0x4a8902),[_0xbd73('0x8b'),_0xbd73('0x8c'),_0xbd73('0xc5'),_0xbd73('0x8d')]);if(_0x1d210e[_0xbd73('0x50')]['id']){delete _0x1d210e[_0xbd73('0x50')]['id'];}if(_[_0xbd73('0x74')](_0x1d210e[_0xbd73('0x50')][_0xbd73('0x8e')])){throw _0x31b627[_0xbd73('0x24')](0x1f4)['send'](new db[(_0xbd73('0x88'))][(_0xbd73('0x91'))](_0xbd73('0x8f')));}if(_[_0xbd73('0x74')](_0x1d210e[_0xbd73('0x50')][_0xbd73('0x50')])||_0x1d210e[_0xbd73('0x50')]['body']===''){throw _0x31b627[_0xbd73('0x24')](0x1f4)['send'](new db[(_0xbd73('0x88'))]['ValidationError'](_0xbd73('0x90')));}if(_[_0xbd73('0x74')](_0x1d210e[_0xbd73('0x50')][_0xbd73('0xc6')])){throw _0x31b627['status'](0x1f4)[_0xbd73('0x31')](new db['Sequelize'][(_0xbd73('0x91'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4dd8c1));}if(!_[_0xbd73('0x92')](_0x4dd8c1,_0x1d210e[_0xbd73('0x50')]['mapKeyOffline'])){throw _0x31b627['status'](0x1f4)[_0xbd73('0x31')](new db[(_0xbd73('0x88'))][(_0xbd73('0x91'))](_0xbd73('0xc7')+_0x4dd8c1));}_0x55b94b[_0x1d210e['body'][_0xbd73('0xc6')]]=_0x1d210e[_0xbd73('0x50')][_0xbd73('0x8e')];})[_0xbd73('0x19')](function(){return db[_0xbd73('0x35')][_0xbd73('0x54')]({'where':{'id':_0x1d210e[_0xbd73('0x57')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db['MailAccount'],'as':_0xbd73('0xc8')}]});})['then'](handleEntityNotFound(_0x31b627,null))[_0xbd73('0x19')](function(_0x59e2ac){if(_0x59e2ac&&_0x59e2ac['List']){_0x1d4675=_0x59e2ac;var _0x294f53=_['defaults'](_0x1d210e[_0xbd73('0x50')],{'firstName':_0x1d210e[_0xbd73('0x50')][_0xbd73('0x8e')],'phone':_0x1d210e[_0xbd73('0x50')][_0xbd73('0x8e')],'ListId':_0x59e2ac[_0xbd73('0x8d')]});_0x294f53[_0x1d210e[_0xbd73('0x50')][_0xbd73('0xc6')]]=_0x1d210e['body'][_0xbd73('0x8e')];return db[_0xbd73('0x87')]['findOrCreate']({'where':_0x55b94b,'defaults':_0x294f53});}})[_0xbd73('0xb2')](function(_0x274d26){if(_0x274d26){_0x170643=_0x274d26;var _0x156f4e=fs[_0xbd73('0xc9')](path[_0xbd73('0x70')](config[_0xbd73('0x76')],_0xbd73('0xca')),_0xbd73('0xcb'));var _0x10c9a6=ejs[_0xbd73('0xcc')](_0x156f4e,{'body':_[_0xbd73('0xcd')](_0x1d210e[_0xbd73('0x50')][_0xbd73('0x50')]),'bodyTitle':_0x1d4675[_0xbd73('0xce')]});return db[_0xbd73('0xcf')]['create']({'body':_0x10c9a6,'plainBody':htmlToText[_0xbd73('0xd0')](_0x10c9a6),'ContactId':_0x274d26['id'],'ChatWebsiteId':_0x1d4675['id']});}})[_0xbd73('0x19')](function(_0x4a6c0f){_0x1f6d69=_0x4a6c0f;if(_0x514a7b[_0xbd73('0x3f')]){var _0x31ab84=_0x514a7b['map'](function(_0x29e476){return{'name':_0x29e476[_0xbd73('0xd1')],'basename':_0x29e476['filename'],'type':_0x29e476[_0xbd73('0xd2')],'ChatOfflineMessageId':_0x4a6c0f['id']};});_0x2c9a0d=_0x31ab84[_0xbd73('0x34')](_0x618d20=>{var _0x46277a={'filename':_0x618d20[_0xbd73('0x30')],'path':path[_0xbd73('0x70')](config[_0xbd73('0x76')],_0xbd73('0xd3'),_0xbd73('0xc4'),_0xbd73('0xd4'),'offline-chat',_0x618d20[_0xbd73('0xd5')])};return _0x46277a;});if(!_0x1d4675['openNewInteraction']){return db['sequelize'][_0xbd73('0xd6')](function(_0x585404){return db[_0xbd73('0xd7')][_0xbd73('0xd8')](_0x31ab84,{'transaction':_0x585404});});}}})[_0xbd73('0x19')](function(){if(_0x1f6d69){_0x434d81=_0x1f6d69;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xbd73('0xd9')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xbd73('0xda')],'as':_0xbd73('0xda'),'raw':!![]}]}]});}})['then'](function(_0x392b3f){if(_0x392b3f&&_0x392b3f[_0xbd73('0xdb')]&&_0x1d4675[_0xbd73('0xdc')]&&_0x1d4675['forwardOfflineAddress']){var _0xfc4cf2=_0x392b3f[_0xbd73('0xdd')]();return respondWithRpcPromise(_0xbd73('0xde'),_0xbd73('0xdf'),{'account':_0xfc4cf2,'message':{'from':util[_0xbd73('0xa8')](_0xbd73('0xe0'),_0x392b3f[_0xbd73('0x30')],_0x392b3f['email']||_0x392b3f[_0xbd73('0xdb')][_0xbd73('0x51')]),'to':_0x1d4675[_0xbd73('0xe1')],'subject':_0x1d4675[_0xbd73('0xe2')],'html':_0x434d81[_0xbd73('0x50')],'attachments':_0x2c9a0d}},client9003)[_0xbd73('0x19')](function(){return _0x434d81;})['catch'](function(_0x56a623){logger[_0xbd73('0x1f')](_0x56a623);});}})['then'](function(){if(_0x1d4675&&_0x1d4675['openNewInteraction']&&_0x1d4675[_0xbd73('0xe3')]){var _0x5593f8=[];if(_0x514a7b[_0xbd73('0x3f')]){_0x5593f8=_0x514a7b['map'](function(_0xc54f8c){return{'name':_0xc54f8c[_0xbd73('0xd1')],'basename':_0xc54f8c['filename'],'type':_0xc54f8c[_0xbd73('0xd2')],'ChatOfflineMessageId':_0x1f6d69['id']};});}var _0x16ca38;if(!_['isNil'](_0x1d4675['subjectOffline'])){var _0x30d4f=_['map'](_0x1d210e['body'],function(_0x3bf4ac){return _0x3bf4ac;});var _0x3bf752=_[_0xbd73('0xe4')](_0x30d4f)[0x0];var _0x2326e4=_[_0xbd73('0xe5')](_0x3bf752,function(_0x9d9bd3){return _0x9d9bd3;});_0x16ca38=_0x2326e4[0x1][_0x1d4675[_0xbd73('0xe6')]];}var _0x21c2da={'from':_0x170643[_0xbd73('0xe7')],'firstName':_0x170643[_0xbd73('0xb3')],'lastName':_0x170643[_0xbd73('0xa4')],'mapKey':_0xbd73('0xe7'),'message':{'from':_0x170643[_0xbd73('0xe7')],'to':_0x1d4675[_0xbd73('0xc8')][_0xbd73('0xe7')],'cc':'','subject':_[_0xbd73('0x74')](_0x16ca38)?_0x1d4675[_0xbd73('0xe2')]:_0x16ca38,'messageId':'','sentAt':new Date(),'attach':_0x5593f8[_0xbd73('0x3f')],'attachments':_0x5593f8,'originChannel':_0xbd73('0xe8'),'ChatWebsiteId':_0x1d4675['id'],'ChatOfflineMessageId':_0x434d81['id'],'originTo':_0x1d4675[_0xbd73('0xc8')][_0xbd73('0xe7')]},'body':_0x434d81[_0xbd73('0x50')]};var _0x360f6c={'account':{'id':_0x1d4675[_0xbd73('0xe3')]},'body':_0x21c2da,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xbd73('0xe9'),_0xbd73('0xea'),_0x360f6c,client9001)['then'](function(){return _0x434d81;})[_0xbd73('0x4a')](function(_0xa5c37a){logger[_0xbd73('0x1f')](_0xa5c37a);});}return;})[_0xbd73('0x19')](function(){if(_0x434d81){return _0x434d81;}})[_0xbd73('0x19')](respondWithResult(_0x31b627,null))[_0xbd73('0x4a')](function(_0x4d08ec){logger[_0xbd73('0x1f')]('catch',_0x4d08ec);for(var _0x1300a6 of _0x514a7b){var _0x44f796=path[_0xbd73('0x70')](config[_0xbd73('0x76')],_0xbd73('0xd3'),_0xbd73('0xc4'),'attachments',_0xbd73('0xeb'),_0x1300a6[_0xbd73('0x69')]);fs_extra[_0xbd73('0xec')](_0x44f796)[_0xbd73('0x4a')](function(_0x46219a){logger[_0xbd73('0x1f')](_0xbd73('0xed'),_0x44f796,_0x46219a);});}});};exports[_0xbd73('0xee')]=function(_0x9888,_0x24a20f){return db[_0xbd73('0xaf')][_0xbd73('0x54')]({'where':{'id':_0x9888[_0xbd73('0x57')]['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0x24a20f,null))[_0xbd73('0x19')](function(_0x250eb4){if(_0x250eb4){return _0x250eb4['addInteraction'](_0x9888[_0xbd73('0x50')][_0xbd73('0x65')],_['omit'](_0x9888[_0xbd73('0x50')],['ids','id'])||{});}})[_0xbd73('0x19')](respondWithResult(_0x24a20f,null))[_0xbd73('0x4a')](handleError(_0x24a20f,null));};exports['getInteractions']=function(_0x38f052,_0x30da80){var _0x2a2e9a={'raw':![],'where':{}};var _0x3ddaf4={};var _0x23fcba={'count':0x0,'rows':[]};return db[_0xbd73('0x35')][_0xbd73('0x63')]({'where':{'id':_0x38f052[_0xbd73('0x57')]['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0x30da80,null))[_0xbd73('0x19')](function(_0x5c649f){if(_0x5c649f){_0x3ddaf4[_0xbd73('0x38')]=_[_0xbd73('0x3a')](db['ChatInteraction'][_0xbd73('0x36')]);_0x3ddaf4['query']=_[_0xbd73('0x3a')](_0x38f052[_0xbd73('0x39')]);_0x3ddaf4['filters']=_[_0xbd73('0x3d')](_0x3ddaf4[_0xbd73('0x38')],_0x3ddaf4[_0xbd73('0x39')]);_0x2a2e9a['attributes']=_[_0xbd73('0x3d')](_0x3ddaf4[_0xbd73('0x38')],qs['fields'](_0x38f052[_0xbd73('0x39')]['fields']));_0x2a2e9a[_0xbd73('0x3c')]=_0x2a2e9a[_0xbd73('0x3c')][_0xbd73('0x3f')]?_0x2a2e9a[_0xbd73('0x3c')]:_0x3ddaf4[_0xbd73('0x38')];if(!_0x38f052[_0xbd73('0x39')][_0xbd73('0x40')](_0xbd73('0x41'))){_0x2a2e9a[_0xbd73('0x27')]=qs[_0xbd73('0x27')](_0x38f052[_0xbd73('0x39')][_0xbd73('0x27')]);_0x2a2e9a[_0xbd73('0x28')]=qs[_0xbd73('0x28')](_0x38f052['query'][_0xbd73('0x28')]);}_0x2a2e9a[_0xbd73('0x42')]=qs[_0xbd73('0x5c')](_0x38f052['query'][_0xbd73('0x5c')]);_0x2a2e9a[_0xbd73('0x43')]=qs[_0xbd73('0x3b')](_['pick'](_0x38f052[_0xbd73('0x39')],_0x3ddaf4[_0xbd73('0x3b')]));_0x2a2e9a[_0xbd73('0x43')][_0xbd73('0x5a')]=_0x5c649f['id'];if(_0x38f052[_0xbd73('0x39')][_0xbd73('0x45')]){_0x2a2e9a[_0xbd73('0x43')]=_[_0xbd73('0x46')](_0x2a2e9a[_0xbd73('0x43')],{'$or':_[_0xbd73('0x34')](_0x2a2e9a[_0xbd73('0x3c')],function(_0x2efcc0){var _0x4e2a1d={};_0x4e2a1d[_0x2efcc0]={'$like':'%'+_0x38f052[_0xbd73('0x39')][_0xbd73('0x45')]+'%'};return _0x4e2a1d;})});}_0x2a2e9a=_[_0xbd73('0x46')]({},_0x2a2e9a,_0x38f052['options']);return db['ChatInteraction'][_0xbd73('0x29')]({'where':_0x2a2e9a[_0xbd73('0x43')]})['then'](function(_0x13d599){_0x23fcba[_0xbd73('0x29')]=_0x13d599;if(_0x38f052[_0xbd73('0x39')]['includeAll']){_0x2a2e9a[_0xbd73('0x5d')]=[{'model':db[_0xbd73('0x87')],'as':_0xbd73('0xef'),'required':![]},{'model':db[_0xbd73('0xbb')],'as':_0xbd73('0xf0'),'attributes':[_0xbd73('0x30'),_0xbd73('0xf1'),_0xbd73('0xf2')],'required':![]},{'model':db[_0xbd73('0xf3')],'as':_0xbd73('0xf4'),'attributes':['id',_0xbd73('0x30'),_0xbd73('0xf5')],'where':_0x38f052[_0xbd73('0x39')][_0xbd73('0xf6')]?{'id':_0x38f052[_0xbd73('0x39')][_0xbd73('0xf6')]}:undefined,'required':_0x38f052['query'][_0xbd73('0xf6')]?!![]:![]}];}return db['ChatInteraction'][_0xbd73('0x49')](_0x2a2e9a);})[_0xbd73('0x19')](function(_0x4fe8cb){_0x23fcba[_0xbd73('0x5e')]=_0x4fe8cb;return _0x23fcba;});}})['then'](respondWithFilteredResult(_0x30da80,_0x2a2e9a))[_0xbd73('0x4a')](handleError(_0x30da80,null));};function iftimePromise(_0x1d6503,_0x1ba7b3){return respondWithRpcPromise(_0xbd73('0xf7'),_0xbd73('0xf8'),{'command':_0x1ba7b3[_0xbd73('0xf9')]?util[_0xbd73('0xa8')](_0xbd73('0xfa'),_0x1d6503[_0xbd73('0xfb')],_0x1ba7b3['timezone']):util[_0xbd73('0xa8')](_0xbd73('0xfc'),_0x1d6503[_0xbd73('0xfb')])},client9002)['then'](function(_0x11d058){var _0x54f405=_0x11d058&&_0x11d058['indexOf'](_0xbd73('0xfd'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1ba7b3['id'],_0x1d6503['id'],_0x1d6503[_0xbd73('0xfb')],_0x54f405?_0xbd73('0xfe'):'OFFLINE',_0x1ba7b3[_0xbd73('0xf9')]?_0x1ba7b3[_0xbd73('0xf9')]:_0xbd73('0xff'));return _0x54f405;})['catch'](function(_0x10ab87){logger[_0xbd73('0x1f')](_0xbd73('0x100'),_0x1ba7b3['id'],_0x1d6503['id'],_0x1d6503[_0xbd73('0xfb')],util[_0xbd73('0x101')](_0x10ab87,{'showHidden':![],'depth':null}),_0x1ba7b3[_0xbd73('0xf9')]?_0x1ba7b3[_0xbd73('0xf9')]:_0xbd73('0xff'));return![];});}exports['getSnippet']=function(_0x2ab827,_0x206764){var _0x3d0761=0x0;var _0x170125=0x0;var _0xb9fce1=![];var _0x2595b2;var _0x45852b;return db[_0xbd73('0x35')][_0xbd73('0x54')]({'where':{'id':_0x2ab827['params']['id']},'include':[{'model':db[_0xbd73('0x102')],'as':_0xbd73('0x102'),'include':[{'model':db['Interval'],'as':_0xbd73('0x103'),'attributes':['id',_0xbd73('0xfb')],'raw':!![]}]}]})[_0xbd73('0x19')](handleEntityNotFound(_0x206764,null))[_0xbd73('0x19')](function(_0x3f40f2){if(_0x3f40f2){_0x2595b2=_0x3f40f2;return _0x3f40f2['getProactiveActions']({'raw':!![]});}})[_0xbd73('0x19')](function(_0x5e2814){if(_0x2595b2){if(_0x5e2814){_0x45852b=_0x5e2814;}}return require(_0xbd73('0x104'))[_0xbd73('0x72')]();})['then'](function(_0x2340a2){if(_0x2340a2){_0x170125=_0x2340a2[_0xbd73('0x105')];_0xb9fce1=_0x2340a2[_0xbd73('0x73')];}})[_0xbd73('0x19')](function(){return db['ChatInteraction'][_0xbd73('0x29')]({'where':{'closed':![]}});})[_0xbd73('0x19')](function(_0x4db64b){_0x3d0761=_0x4db64b;if(_0x170125&&_0x4db64b>_0x170125){return db[_0xbd73('0x106')][_0xbd73('0x63')]({'where':{'id':0x1}})[_0xbd73('0x19')](function(_0x4bd356){if(_0x4bd356){_0x4bd356[_0xbd73('0x107')](_0xbd73('0x108'));}});}})[_0xbd73('0x19')](function(){if(_0x2595b2['Interval']&&_0x2595b2[_0xbd73('0x102')]['Intervals']){var _0x5e5ef1=[];for(var _0x2e8b35=0x0;_0x2e8b35<_0x2595b2['Interval'][_0xbd73('0x103')][_0xbd73('0x3f')];_0x2e8b35++){var _0x198a81=_0x2595b2[_0xbd73('0x102')][_0xbd73('0x103')][_0x2e8b35][_0xbd73('0x52')]({'plain':!![]});_0x5e5ef1[_0xbd73('0xb6')](iftimePromise(_0x198a81,_0x2595b2));}return BPromise['all'](_0x5e5ef1)[_0xbd73('0x19')](function(_0x337211){return _[_0xbd73('0x109')](_0x337211);});}else{return!![];}})[_0xbd73('0x19')](function(_0x45a588){var _0x414b1f=fs['readFileSync'](path[_0xbd73('0x70')](config['root'],'server/files/chat/iframe.ejs'),'utf8');var _0x45a820={'remote':_0x2595b2[_0xbd73('0x10a')],'query':querystring['stringify'](_[_0xbd73('0x46')](_0x2595b2[_0xbd73('0x52')]({'plain':!![]}),{'customerIp':_0x2ab827['headers'][_0xbd73('0xa2')]||_0x2ab827[_0xbd73('0x83')][_0xbd73('0x10b')]||_0x2ab827[_0xbd73('0x10c')][_0xbd73('0x10d')]||_0x2ab827['ip'],'referer':_0x2ab827[_0xbd73('0x83')]['referer'],'openedInteractions':_0x3d0761,'maxInteractions':_0x170125,'virtual':_0xb9fce1[_0xbd73('0x105')],'online':_0x45a588,'custom':_0xb9fce1}))[_0xbd73('0x10e')](/'/g,'\x5c\x27')};_0x206764[_0xbd73('0x31')](ejs[_0xbd73('0xcc')](Mustache[_0xbd73('0xcc')](_0x414b1f,_0x45a820),{'proactiveActions':_0x45852b,'alignment':_0x2595b2[_0xbd73('0x10f')],'verticalAlignment':_0x2595b2[_0xbd73('0x110')],'div_color':_0x2595b2[_0xbd73('0xf5')],'labelText':_0x2595b2['labelText'],'text_color':_0x2595b2[_0xbd73('0x111')],'text_button_color':_0x2595b2[_0xbd73('0x112')],'button_color':_0x2595b2['color_button'],'background_color':_0x2595b2[_0xbd73('0x113')],'hideWhenOffline':_0x2595b2[_0xbd73('0x114')],'interval':_0x2595b2['IntervalId']}));})[_0xbd73('0x4a')](handleError(_0x206764,null));};exports[_0xbd73('0x115')]=function(_0x489a73,_0x909c24){var _0x51de11=_0x489a73[_0xbd73('0x57')]['id'];var _0x3a3615=_0x489a73[_0xbd73('0x50')];var _0x431aee=0xc8;var _0x575071=null;return db[_0xbd73('0x116')][_0xbd73('0xd6')]({'isolationLevel':db[_0xbd73('0x116')][_0xbd73('0x117')][_0xbd73('0x118')][_0xbd73('0x119')]},function(_0x35a138){return db['ChatWebsite']['findOne']({'where':{'id':_0x51de11},'transaction':_0x35a138})[_0xbd73('0x19')](function(_0x44d626){if(_0x44d626){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x51de11},'transaction':_0x35a138})[_0xbd73('0x19')](function(){var _0x389250=_[_0xbd73('0x34')](_0x3a3615,function(_0x1b37e2){_0x1b37e2[_0xbd73('0x5a')]=_0x51de11;return _0x1b37e2;});return db[_0xbd73('0x11a')][_0xbd73('0xd8')](_0x389250,{'transaction':_0x35a138});});}else{_0x431aee=0x194;_0x575071=[];}});})[_0xbd73('0x19')](function(){if(_0x431aee!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x51de11},'order':_0xbd73('0x9b')})[_0xbd73('0x19')](function(_0x2f3113){_0x575071=_0x2f3113;});}})['catch'](function(_0x4e1107){_0x431aee=0x1f4;logger[_0xbd73('0x1f')](_0x4e1107[_0xbd73('0x2f')]);if(_0x4e1107['name']){delete _0x4e1107[_0xbd73('0x30')];}_0x575071=_0x4e1107;})[_0xbd73('0x11b')](function(){if(_0x575071===null){_0x909c24['sendStatus'](_0x431aee);}else{if(_0x431aee===0x1f4){_0x909c24[_0xbd73('0x24')](_0x431aee)[_0xbd73('0x31')](_0x575071);}else{_0x909c24[_0xbd73('0x24')](_0x431aee)[_0xbd73('0x25')](_0x575071);}}});};exports[_0xbd73('0x11c')]=function(_0xf7a018,_0x3e68f5){var _0x1f9076={};var _0x460a34={};var _0x70fe38;var _0x16004b;return db[_0xbd73('0x35')]['findOne']({'where':{'id':_0xf7a018['params']['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0x3e68f5,null))[_0xbd73('0x19')](function(_0x143869){if(_0x143869){_0x70fe38=_0x143869;_0x460a34[_0xbd73('0x38')]=_['keys'](db[_0xbd73('0x11a')][_0xbd73('0x36')]);_0x460a34['query']=_[_0xbd73('0x3a')](_0xf7a018['query']);_0x460a34[_0xbd73('0x3b')]=_[_0xbd73('0x3d')](_0x460a34['model'],_0x460a34[_0xbd73('0x39')]);_0x1f9076[_0xbd73('0x3c')]=_[_0xbd73('0x3d')](_0x460a34[_0xbd73('0x38')],qs[_0xbd73('0x3e')](_0xf7a018[_0xbd73('0x39')]['fields']));_0x1f9076['attributes']=_0x1f9076['attributes'][_0xbd73('0x3f')]?_0x1f9076[_0xbd73('0x3c')]:_0x460a34[_0xbd73('0x38')];_0x1f9076[_0xbd73('0x42')]=qs[_0xbd73('0x5c')](_0xf7a018[_0xbd73('0x39')][_0xbd73('0x5c')]);_0x1f9076[_0xbd73('0x43')]=qs['filters'](_[_0xbd73('0x44')](_0xf7a018[_0xbd73('0x39')],_0x460a34['filters']));if(_0xf7a018[_0xbd73('0x39')]['filter']){_0x1f9076[_0xbd73('0x43')]=_['merge'](_0x1f9076[_0xbd73('0x43')],{'$or':_[_0xbd73('0x34')](_0x1f9076[_0xbd73('0x3c')],function(_0x30622d){var _0x720df1={};_0x720df1[_0x30622d]={'$like':'%'+_0xf7a018['query'][_0xbd73('0x45')]+'%'};return _0x720df1;})});}_0x1f9076=_[_0xbd73('0x46')]({},_0x1f9076,_0xf7a018[_0xbd73('0x4e')]);return _0x70fe38['getApplications'](_0x1f9076);}})['then'](function(_0x4b4e56){if(_0x4b4e56){_0x16004b=_0x4b4e56['length'];if(!_0xf7a018[_0xbd73('0x39')][_0xbd73('0x40')](_0xbd73('0x41'))){_0x1f9076[_0xbd73('0x27')]=qs[_0xbd73('0x27')](_0xf7a018['query'][_0xbd73('0x27')]);_0x1f9076[_0xbd73('0x28')]=qs[_0xbd73('0x28')](_0xf7a018[_0xbd73('0x39')][_0xbd73('0x28')]);}return _0x70fe38[_0xbd73('0x11c')](_0x1f9076);}})['then'](function(_0x1d7198){if(_0x1d7198){return _0x1d7198?{'count':_0x16004b,'rows':_0x1d7198}:null;}})[_0xbd73('0x19')](respondWithResult(_0x3e68f5,null))[_0xbd73('0x4a')](handleError(_0x3e68f5,null));};exports['addProactiveActions']=function(_0x510e86,_0x3899b7){return db['chatProactiveAction'][_0xbd73('0x54')]({'where':{'id':_0x510e86['params']['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0x3899b7,null))[_0xbd73('0x19')](function(_0x4a39b7){if(_0x4a39b7){return _0x4a39b7[_0xbd73('0x11d')](_0x510e86[_0xbd73('0x50')][_0xbd73('0x65')],_[_0xbd73('0x11e')](_0x510e86[_0xbd73('0x50')],['ids','id'])||{});}})[_0xbd73('0x19')](respondWithResult(_0x3899b7,null))['catch'](handleError(_0x3899b7,null));};exports[_0xbd73('0x11f')]=function(_0x2a80bc,_0x1f3f35){var _0x3fb346={};var _0x398e6b={};var _0x44568d;var _0x5a84b7;return db[_0xbd73('0x35')][_0xbd73('0x63')]({'where':{'id':_0x2a80bc[_0xbd73('0x57')]['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0x1f3f35,null))[_0xbd73('0x19')](function(_0xf8fb9e){if(_0xf8fb9e){_0x44568d=_0xf8fb9e;_0x398e6b[_0xbd73('0x38')]=_[_0xbd73('0x3a')](db[_0xbd73('0x120')]['rawAttributes']);_0x398e6b['query']=_['keys'](_0x2a80bc[_0xbd73('0x39')]);_0x398e6b[_0xbd73('0x3b')]=_[_0xbd73('0x3d')](_0x398e6b[_0xbd73('0x38')],_0x398e6b[_0xbd73('0x39')]);_0x3fb346[_0xbd73('0x3c')]=_[_0xbd73('0x3d')](_0x398e6b[_0xbd73('0x38')],qs[_0xbd73('0x3e')](_0x2a80bc[_0xbd73('0x39')]['fields']));_0x3fb346[_0xbd73('0x3c')]=_0x3fb346['attributes']['length']?_0x3fb346[_0xbd73('0x3c')]:_0x398e6b[_0xbd73('0x38')];_0x3fb346['order']=qs[_0xbd73('0x5c')](_0x2a80bc[_0xbd73('0x39')][_0xbd73('0x5c')]);_0x3fb346[_0xbd73('0x43')]=qs[_0xbd73('0x3b')](_[_0xbd73('0x44')](_0x2a80bc['query'],_0x398e6b['filters']));if(_0x2a80bc['query'][_0xbd73('0x45')]){_0x3fb346[_0xbd73('0x43')]=_[_0xbd73('0x46')](_0x3fb346[_0xbd73('0x43')],{'$or':_[_0xbd73('0x34')](_0x3fb346[_0xbd73('0x3c')],function(_0x42d039){var _0x3a3a8a={};_0x3a3a8a[_0x42d039]={'$like':'%'+_0x2a80bc[_0xbd73('0x39')]['filter']+'%'};return _0x3a3a8a;})});}_0x3fb346=_[_0xbd73('0x46')]({},_0x3fb346,_0x2a80bc[_0xbd73('0x4e')]);return _0x44568d[_0xbd73('0x11f')](_0x3fb346);}})[_0xbd73('0x19')](function(_0x4eeb4e){if(_0x4eeb4e){_0x5a84b7=_0x4eeb4e[_0xbd73('0x3f')];if(!_0x2a80bc[_0xbd73('0x39')][_0xbd73('0x40')](_0xbd73('0x41'))){_0x3fb346[_0xbd73('0x27')]=qs[_0xbd73('0x27')](_0x2a80bc[_0xbd73('0x39')][_0xbd73('0x27')]);_0x3fb346[_0xbd73('0x28')]=qs[_0xbd73('0x28')](_0x2a80bc[_0xbd73('0x39')]['offset']);}return _0x44568d[_0xbd73('0x11f')](_0x3fb346);}})[_0xbd73('0x19')](function(_0x5e56d6){if(_0x5e56d6){return _0x5e56d6?{'count':_0x5a84b7,'rows':_0x5e56d6}:null;}})[_0xbd73('0x19')](respondWithResult(_0x1f3f35,null))[_0xbd73('0x4a')](handleError(_0x1f3f35,null));};exports[_0xbd73('0x121')]=function(_0x30f07f,_0x40a24b){var _0x192f3f=_0x30f07f[_0xbd73('0x39')][_0xbd73('0x122')]===_0xbd73('0x123')?_0xbd73('0x124'):_0xbd73('0x125');return db[_0xbd73('0x35')][_0xbd73('0x54')]({'attributes':['id',_0x192f3f],'where':{'id':_0x30f07f[_0xbd73('0x57')]['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0x40a24b,null))[_0xbd73('0x19')](function(_0x2062a4){if(_0x2062a4){var _0x364785=_0x2062a4[_0x192f3f];var _0x1f37af=_0x364785&&_0x364785['items']?_0x364785[_0xbd73('0x126')]:[];_0x40a24b[_0xbd73('0x31')]({'fromKey':_[_0xbd73('0x74')](_0x364785[_0xbd73('0x127')])?undefined:_0x364785[_0xbd73('0x127')],'count':_0x1f37af[_0xbd73('0x3f')],'rows':_0x1f37af});}})['catch'](handleError(_0x40a24b,null));};exports[_0xbd73('0x128')]=function(_0x367a14,_0x6ac66e){var _0x283ea7={'raw':![],'where':{}};var _0x2dcba3={};var _0x4bc7cc={'count':0x0,'rows':[]};return db[_0xbd73('0x35')][_0xbd73('0x63')]({'where':{'id':_0x367a14[_0xbd73('0x57')]['id']}})['then'](handleEntityNotFound(_0x6ac66e,null))[_0xbd73('0x19')](function(_0x19cb76){if(_0x19cb76){_0x2dcba3['model']=_['keys'](db[_0xbd73('0xcf')]['rawAttributes']);_0x2dcba3['query']=_[_0xbd73('0x3a')](_0x367a14[_0xbd73('0x39')]);_0x2dcba3[_0xbd73('0x3b')]=_['intersection'](_0x2dcba3[_0xbd73('0x38')],_0x2dcba3[_0xbd73('0x39')]);_0x283ea7[_0xbd73('0x3c')]=_[_0xbd73('0x3d')](_0x2dcba3[_0xbd73('0x38')],qs[_0xbd73('0x3e')](_0x367a14[_0xbd73('0x39')][_0xbd73('0x3e')]));_0x283ea7[_0xbd73('0x3c')]=_0x283ea7[_0xbd73('0x3c')][_0xbd73('0x3f')]?_0x283ea7[_0xbd73('0x3c')]:_0x2dcba3[_0xbd73('0x38')];if(!_0x367a14[_0xbd73('0x39')]['hasOwnProperty'](_0xbd73('0x41'))){_0x283ea7['limit']=qs['limit'](_0x367a14['query']['limit']);_0x283ea7[_0xbd73('0x28')]=qs[_0xbd73('0x28')](_0x367a14[_0xbd73('0x39')][_0xbd73('0x28')]);}_0x283ea7[_0xbd73('0x42')]=qs[_0xbd73('0x5c')](_0x367a14[_0xbd73('0x39')][_0xbd73('0x5c')]);_0x283ea7[_0xbd73('0x43')]=qs[_0xbd73('0x3b')](_[_0xbd73('0x44')](_0x367a14['query'],_0x2dcba3[_0xbd73('0x3b')]));_0x283ea7[_0xbd73('0x43')][_0xbd73('0x5a')]=_0x19cb76['id'];if(_0x367a14['query']['filter']){_0x283ea7[_0xbd73('0x43')]=_['merge'](_0x283ea7[_0xbd73('0x43')],{'$or':_[_0xbd73('0x34')](_0x283ea7[_0xbd73('0x3c')],function(_0x23c4a1){var _0x366caf={};_0x366caf[_0x23c4a1]={'$like':'%'+_0x367a14['query'][_0xbd73('0x45')]+'%'};return _0x366caf;})});}_0x283ea7=_[_0xbd73('0x46')]({},_0x283ea7,_0x367a14['options']);return db[_0xbd73('0xcf')][_0xbd73('0x29')]({'where':_0x283ea7[_0xbd73('0x43')]})[_0xbd73('0x19')](function(_0x2e82bb){_0x4bc7cc[_0xbd73('0x29')]=_0x2e82bb;if(_0x367a14[_0xbd73('0x39')]['includeAll']){_0x283ea7[_0xbd73('0x5d')]=[{'all':!![]}];}else{_0x283ea7['include']=[{'model':db[_0xbd73('0x87')],'as':_0xbd73('0xef'),'required':![]},{'model':db[_0xbd73('0xd7')],'as':_0xbd73('0x129'),'required':![]}];}return db[_0xbd73('0xcf')][_0xbd73('0x49')](_0x283ea7);})[_0xbd73('0x19')](function(_0x58d8ee){_0x4bc7cc[_0xbd73('0x5e')]=_0x58d8ee;return _0x4bc7cc;});}})[_0xbd73('0x19')](respondWithFilteredResult(_0x6ac66e,_0x283ea7))[_0xbd73('0x4a')](handleError(_0x6ac66e,null));};exports[_0xbd73('0x12a')]=function(_0x5f13cc,_0x5e24b0){return db[_0xbd73('0x35')][_0xbd73('0x54')]({'where':{'id':_0x5f13cc[_0xbd73('0x57')]['id']}})['then'](handleEntityNotFound(_0x5e24b0,null))[_0xbd73('0x19')](function(_0x446e5e){if(_0x446e5e){return _0x446e5e[_0xbd73('0x12a')](_0x5f13cc['body'][_0xbd73('0x65')],_[_0xbd73('0x11e')](_0x5f13cc[_0xbd73('0x50')],['ids','id'])||{})[_0xbd73('0xb2')](function(_0x1bc924){for(var _0x4b1903=0x0;_0x4b1903<_0x5f13cc[_0xbd73('0x50')][_0xbd73('0x65')][_0xbd73('0x3f')];_0x4b1903+=0x1){socket[_0xbd73('0x12b')](_0xbd73('0x12c'),{'UserId':Number(_0x5f13cc['body']['ids'][_0x4b1903]),'ChatWebsiteId':Number(_0x5f13cc[_0xbd73('0x57')]['id'])});}return _0x1bc924;});}})[_0xbd73('0x19')](respondWithResult(_0x5e24b0,null))[_0xbd73('0x4a')](handleError(_0x5e24b0,null));};exports[_0xbd73('0x12d')]=function(_0x46f545,_0x35026d){return db['ChatWebsite']['find']({'where':{'id':_0x46f545[_0xbd73('0x57')]['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0x35026d,null))['then'](function(_0x482bc1){if(_0x482bc1){return _0x482bc1[_0xbd73('0x12d')](_0x46f545[_0xbd73('0x39')][_0xbd73('0x65')])['then'](function(){if(_[_0xbd73('0x12e')](_0x46f545['query'][_0xbd73('0x65')])){for(var _0x100972=0x0;_0x100972<_0x46f545['query'][_0xbd73('0x65')][_0xbd73('0x3f')];_0x100972+=0x1){socket['emit'](_0xbd73('0x12f'),{'UserId':Number(_0x46f545[_0xbd73('0x39')]['ids'][_0x100972]),'ChatWebsiteId':Number(_0x46f545[_0xbd73('0x57')]['id'])});}}else{socket[_0xbd73('0x12b')]('userChatWebsite:remove',{'UserId':Number(_0x46f545[_0xbd73('0x39')][_0xbd73('0x65')]),'ChatWebsiteId':Number(_0x46f545[_0xbd73('0x57')]['id'])});}});}})[_0xbd73('0x19')](respondWithStatusCode(_0x35026d,null))[_0xbd73('0x4a')](handleError(_0x35026d,null));};exports[_0xbd73('0x130')]=function(_0x20ba2d,_0xc2fd83){var _0x5e7892={};var _0x39b05d={};var _0x5f1907;var _0x230045;return db['ChatWebsite'][_0xbd73('0x63')]({'where':{'id':_0x20ba2d[_0xbd73('0x57')]['id']}})[_0xbd73('0x19')](handleEntityNotFound(_0xc2fd83,null))[_0xbd73('0x19')](function(_0x58eb9f){if(_0x58eb9f){_0x5f1907=_0x58eb9f;_0x39b05d[_0xbd73('0x38')]=_[_0xbd73('0x3a')](db[_0xbd73('0xbb')]['rawAttributes']);_0x39b05d['query']=_['keys'](_0x20ba2d[_0xbd73('0x39')]);_0x39b05d[_0xbd73('0x3b')]=_[_0xbd73('0x3d')](_0x39b05d[_0xbd73('0x38')],_0x39b05d[_0xbd73('0x39')]);_0x5e7892[_0xbd73('0x3c')]=_['intersection'](_0x39b05d[_0xbd73('0x38')],qs['fields'](_0x20ba2d[_0xbd73('0x39')]['fields']));_0x5e7892[_0xbd73('0x3c')]=_0x5e7892[_0xbd73('0x3c')]['length']?_0x5e7892[_0xbd73('0x3c')]:_0x39b05d[_0xbd73('0x38')];_0x5e7892[_0xbd73('0x42')]=qs[_0xbd73('0x5c')](_0x20ba2d['query']['sort']);_0x5e7892['where']=qs[_0xbd73('0x3b')](_['pick'](_0x20ba2d[_0xbd73('0x39')],_0x39b05d['filters']));if(_0x20ba2d[_0xbd73('0x39')]['filter']){_0x5e7892[_0xbd73('0x43')]=_['merge'](_0x5e7892[_0xbd73('0x43')],{'$or':_[_0xbd73('0x34')](_0x5e7892[_0xbd73('0x3c')],function(_0x332022){var _0x3f1ee4={};_0x3f1ee4[_0x332022]={'$like':'%'+_0x20ba2d[_0xbd73('0x39')][_0xbd73('0x45')]+'%'};return _0x3f1ee4;})});}_0x5e7892=_['merge']({},_0x5e7892,_0x20ba2d[_0xbd73('0x4e')]);return _0x5f1907[_0xbd73('0x130')](_0x5e7892);}})[_0xbd73('0x19')](function(_0x56422f){if(_0x56422f){_0x230045=_0x56422f[_0xbd73('0x3f')];if(!_0x20ba2d['query'][_0xbd73('0x40')](_0xbd73('0x41'))){_0x5e7892['limit']=qs[_0xbd73('0x27')](_0x20ba2d[_0xbd73('0x39')][_0xbd73('0x27')]);_0x5e7892['offset']=qs[_0xbd73('0x28')](_0x20ba2d['query']['offset']);}return _0x5f1907[_0xbd73('0x130')](_0x5e7892);}})[_0xbd73('0x19')](function(_0x7b24fc){if(_0x7b24fc){return _0x7b24fc?{'count':_0x230045,'rows':_0x7b24fc}:null;}})[_0xbd73('0x19')](respondWithResult(_0xc2fd83,null))[_0xbd73('0x4a')](handleError(_0xc2fd83,null));};
\ No newline at end of file
+var _0x22ea=['includes','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy','priority','asc','defaults','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','version','format','%s\x20%s','browser','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','files','send','mapKeyOffline','MailAccount','findOrCreate','readFileSync','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','NotifyMailAccount','notifyMail','server','addInteraction','Contact','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','fs-extra','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','catch','sendStatus','status','json','undefined','limit','count','offset','set','update','destroy','get','end','stack','name','map','ChatWebsite','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','Pause','mandatoryDispositionPause','keys','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','sort','options','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','custom','isNil','existsSync','join','server/files/images/logos/','getAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey'];(function(_0x2ccc71,_0x1c458a){var _0x20fa15=function(_0x320e61){while(--_0x320e61){_0x2ccc71['push'](_0x2ccc71['shift']());}};_0x20fa15(++_0x1c458a);}(_0x22ea,0x98));var _0xa22e=function(_0x5706c9,_0x536d73){_0x5706c9=_0x5706c9-0x0;var _0x46a585=_0x22ea[_0x5706c9];return _0x46a585;};'use strict';var BPromise=require(_0xa22e('0x0'));var Mustache=require(_0xa22e('0x1'));var util=require(_0xa22e('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa22e('0x3'));var _=require('lodash');var querystring=require('querystring');var Redis=require('ioredis');var qs=require(_0xa22e('0x4'));var logger=require(_0xa22e('0x5'))(_0xa22e('0x6'));var config=require(_0xa22e('0x7'));var db=require(_0xa22e('0x8'))['db'];config[_0xa22e('0x9')]=_['defaults'](config[_0xa22e('0x9')],{'host':_0xa22e('0xa'),'port':0x18eb});var socket=require(_0xa22e('0xb'))(new Redis(config[_0xa22e('0x9')]));require(_0xa22e('0xc'))['register'](socket);var htmlToText=require(_0xa22e('0xd'));var jayson=require(_0xa22e('0xe'));var client=jayson[_0xa22e('0xf')][_0xa22e('0x10')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson['client'][_0xa22e('0x10')]({'port':0x232b});var client9001=jayson[_0xa22e('0xf')][_0xa22e('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x592c72,_0x5051e3,_0x1c3306,_0x214476){return new BPromise(function(_0x4b7db6,_0x439b0b){var _0x38bbfa=_0x214476||client;return _0x38bbfa[_0xa22e('0x11')](_0x592c72,_0x1c3306)[_0xa22e('0x12')](function(_0xcf2dac){logger[_0xa22e('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x5051e3,'request\x20sent');logger[_0xa22e('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5051e3,_0xa22e('0x15'),JSON[_0xa22e('0x16')](_0xcf2dac));if(_0xcf2dac['error']){if(_0xcf2dac[_0xa22e('0x17')][_0xa22e('0x18')]===0x1f4){logger[_0xa22e('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5051e3,_0xcf2dac[_0xa22e('0x17')][_0xa22e('0x19')]);return _0x439b0b(_0xcf2dac[_0xa22e('0x17')][_0xa22e('0x19')]);}logger[_0xa22e('0x17')](_0xa22e('0x1a'),_0x5051e3,_0xcf2dac['error'][_0xa22e('0x19')]);return _0x4b7db6(_0xcf2dac[_0xa22e('0x17')][_0xa22e('0x19')]);}else{logger[_0xa22e('0x13')](_0xa22e('0x1a'),_0x5051e3,_0xa22e('0x15'));_0x4b7db6(_0xcf2dac['result'][_0xa22e('0x19')]);}})[_0xa22e('0x1b')](function(_0x1f11b0){logger[_0xa22e('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5051e3,_0x1f11b0);_0x439b0b(_0x1f11b0);});});}function respondWithStatusCode(_0x592ab1,_0x2eec4e){_0x2eec4e=_0x2eec4e||0xcc;return function(_0x475d0f){if(_0x475d0f){return _0x592ab1[_0xa22e('0x1c')](_0x2eec4e);}return _0x592ab1[_0xa22e('0x1d')](_0x2eec4e)['end']();};}function respondWithResult(_0x278292,_0x1b12c2){_0x1b12c2=_0x1b12c2||0xc8;return function(_0x21ee85){if(_0x21ee85){return _0x278292[_0xa22e('0x1d')](_0x1b12c2)[_0xa22e('0x1e')](_0x21ee85);}};}function respondWithFilteredResult(_0x227d6c,_0x133038){return function(_0x3cb97e){if(_0x3cb97e){var _0x145299=typeof _0x133038['offset']===_0xa22e('0x1f')&&typeof _0x133038[_0xa22e('0x20')]===_0xa22e('0x1f');var _0x47522b=_0x3cb97e[_0xa22e('0x21')];var _0x13d055=_0x145299?0x0:_0x133038[_0xa22e('0x22')];var _0x1387f3=_0x145299?_0x3cb97e[_0xa22e('0x21')]:_0x133038[_0xa22e('0x22')]+_0x133038[_0xa22e('0x20')];var _0x5abb32;if(_0x1387f3>=_0x47522b){_0x1387f3=_0x47522b;_0x5abb32=0xc8;}else{_0x5abb32=0xce;}_0x227d6c[_0xa22e('0x1d')](_0x5abb32);return _0x227d6c[_0xa22e('0x23')]('Content-Range',_0x13d055+'-'+_0x1387f3+'/'+_0x47522b)[_0xa22e('0x1e')](_0x3cb97e);}return null;};}function saveUpdates(_0x2a045c){return function(_0x21e539){if(_0x21e539){return _0x21e539[_0xa22e('0x24')](_0x2a045c)['then'](function(_0x337f09){return _0x337f09;});}return null;};}function removeEntity(_0x421e9c){return function(_0x140e08){if(_0x140e08){return _0x140e08[_0xa22e('0x25')]()[_0xa22e('0x12')](function(){var _0x3f5c89=_0x140e08[_0xa22e('0x26')]({'plain':!![]});var _0x2de1f8='ChatWebsites';return db['UserProfileResource'][_0xa22e('0x25')]({'where':{'type':_0x2de1f8,'resourceId':_0x3f5c89['id']}})[_0xa22e('0x12')](function(){return _0x140e08;});})[_0xa22e('0x12')](function(){_0x421e9c['status'](0xcc)[_0xa22e('0x27')]();});}};}function handleEntityNotFound(_0x52b9dd){return function(_0x565569){if(!_0x565569){_0x52b9dd[_0xa22e('0x1c')](0x194);}return _0x565569;};}function handleError(_0x15434c,_0x2683af){_0x2683af=_0x2683af||0x1f4;return function(_0x2127c4){logger[_0xa22e('0x17')](_0x2127c4[_0xa22e('0x28')]);if(_0x2127c4[_0xa22e('0x29')]){delete _0x2127c4[_0xa22e('0x29')];}_0x15434c[_0xa22e('0x1d')](_0x2683af)['send'](_0x2127c4);};}exports['index']=function(_0x4eca7c,_0x1c79a5){var _0x4a0cdd={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2fc728={},_0x5435b4={'count':0x0,'rows':[]};var _0x29fb3f=_[_0xa22e('0x2a')](db[_0xa22e('0x2b')]['rawAttributes'],function(_0x2c18a6){return{'name':_0x2c18a6['fieldName'],'type':_0x2c18a6[_0xa22e('0x2c')][_0xa22e('0x2d')]};});_0x2fc728['model']=_['map'](_0x29fb3f,_0xa22e('0x29'));_0x2fc728[_0xa22e('0x2e')]=_['keys'](_0x4eca7c[_0xa22e('0x2e')]);_0x2fc728['filters']=_[_0xa22e('0x2f')](_0x2fc728['model'],_0x2fc728[_0xa22e('0x2e')]);_0x4a0cdd['attributes']=_[_0xa22e('0x2f')](_0x2fc728[_0xa22e('0x30')],qs['fields'](_0x4eca7c['query'][_0xa22e('0x31')]));_0x4a0cdd[_0xa22e('0x32')]=_0x4a0cdd[_0xa22e('0x32')][_0xa22e('0x33')]?_0x4a0cdd[_0xa22e('0x32')]:_0x2fc728[_0xa22e('0x30')];if(!_0x4eca7c[_0xa22e('0x2e')][_0xa22e('0x34')](_0xa22e('0x35'))){_0x4a0cdd[_0xa22e('0x20')]=qs[_0xa22e('0x20')](_0x4eca7c[_0xa22e('0x2e')][_0xa22e('0x20')]);_0x4a0cdd[_0xa22e('0x22')]=qs['offset'](_0x4eca7c['query']['offset']);}_0x4a0cdd[_0xa22e('0x36')]=qs['sort'](_0x4eca7c[_0xa22e('0x2e')]['sort']);_0x4a0cdd[_0xa22e('0x37')]=qs[_0xa22e('0x38')](_[_0xa22e('0x39')](_0x4eca7c[_0xa22e('0x2e')],_0x2fc728['filters']),_0x29fb3f);if(_0x4eca7c[_0xa22e('0x2e')][_0xa22e('0x3a')]){_0x4a0cdd[_0xa22e('0x37')]=_[_0xa22e('0x3b')](_0x4a0cdd[_0xa22e('0x37')],{'$or':_[_0xa22e('0x2a')](_0x29fb3f,function(_0x3aeec8){if(_0x3aeec8[_0xa22e('0x2c')]!==_0xa22e('0x3c')){var _0x56955e={};_0x56955e[_0x3aeec8['name']]={'$like':'%'+_0x4eca7c[_0xa22e('0x2e')][_0xa22e('0x3a')]+'%'};return _0x56955e;}})});}_0x4a0cdd=_['merge']({},_0x4a0cdd,_0x4eca7c['options']);var _0x3e5943={'where':_0x4a0cdd[_0xa22e('0x37')]};return db['ChatWebsite'][_0xa22e('0x21')](_0x3e5943)[_0xa22e('0x12')](function(_0x96d2a9){_0x5435b4[_0xa22e('0x21')]=_0x96d2a9;if(_0x4eca7c[_0xa22e('0x2e')][_0xa22e('0x3d')]){_0x4a0cdd[_0xa22e('0x3e')]=[{'all':!![]}];}return db['ChatWebsite'][_0xa22e('0x3f')](_0x4a0cdd);})['then'](function(_0x332ab4){_0x5435b4['rows']=_0x332ab4;return _0x5435b4;})[_0xa22e('0x12')](respondWithFilteredResult(_0x1c79a5,_0x4a0cdd))[_0xa22e('0x1b')](handleError(_0x1c79a5,null));};exports['show']=function(_0x46a9cf,_0x50e76a){var _0x451519={'raw':![],'where':{'id':_0x46a9cf['params']['id']},'include':[{'model':db[_0xa22e('0x40')],'as':_0xa22e('0x41')}]},_0x5e05ee={};_0x5e05ee[_0xa22e('0x30')]=_[_0xa22e('0x42')](db[_0xa22e('0x2b')][_0xa22e('0x43')]);_0x5e05ee['query']=_['keys'](_0x46a9cf[_0xa22e('0x2e')]);_0x5e05ee[_0xa22e('0x38')]=_['intersection'](_0x5e05ee['model'],_0x5e05ee[_0xa22e('0x2e')]);_0x451519['attributes']=_[_0xa22e('0x2f')](_0x5e05ee[_0xa22e('0x30')],qs[_0xa22e('0x31')](_0x46a9cf[_0xa22e('0x2e')][_0xa22e('0x31')]));_0x451519[_0xa22e('0x32')]=_0x451519[_0xa22e('0x32')][_0xa22e('0x33')]?_0x451519[_0xa22e('0x32')]:_0x5e05ee['model'];if(_0x46a9cf[_0xa22e('0x2e')]['includeAll']){_0x451519[_0xa22e('0x3e')]=[{'all':!![]}];}_0x451519=_[_0xa22e('0x3b')]({},_0x451519,_0x46a9cf['options']);return db[_0xa22e('0x2b')][_0xa22e('0x44')](_0x451519)[_0xa22e('0x12')](handleEntityNotFound(_0x50e76a,null))[_0xa22e('0x12')](respondWithResult(_0x50e76a,null))[_0xa22e('0x1b')](handleError(_0x50e76a,null));};exports[_0xa22e('0x45')]=function(_0x1f0b41,_0x5916a7){return db[_0xa22e('0x2b')][_0xa22e('0x45')](_0x1f0b41[_0xa22e('0x46')],{})[_0xa22e('0x12')](function(_0x39be68){var _0xc980c4=_0x1f0b41['user']['get']({'plain':!![]});if(!_0xc980c4)throw new Error(_0xa22e('0x47'));if(_0xc980c4[_0xa22e('0x48')]==='user'){var _0x1fa320=_0x39be68[_0xa22e('0x26')]({'plain':!![]});var _0x52568b=_0xa22e('0x49');return db[_0xa22e('0x4a')][_0xa22e('0x44')]({'where':{'name':_0x52568b,'userProfileId':_0xc980c4[_0xa22e('0x4b')]},'raw':!![]})['then'](function(_0x7101c8){if(_0x7101c8&&_0x7101c8[_0xa22e('0x4c')]===0x0){return db[_0xa22e('0x4d')][_0xa22e('0x45')]({'name':_0x1fa320[_0xa22e('0x29')],'resourceId':_0x1fa320['id'],'type':_0x7101c8[_0xa22e('0x29')],'sectionId':_0x7101c8['id']},{})[_0xa22e('0x12')](function(){return _0x39be68;});}else{return _0x39be68;}})[_0xa22e('0x1b')](function(_0x4d467e){logger[_0xa22e('0x17')](_0xa22e('0x4e'),_0x4d467e);throw _0x4d467e;});}return _0x39be68;})[_0xa22e('0x12')](respondWithResult(_0x5916a7,0xc9))[_0xa22e('0x1b')](handleError(_0x5916a7,null));};exports[_0xa22e('0x24')]=function(_0x2d5255,_0x26d9fa){if(_0x2d5255[_0xa22e('0x46')]['id']){delete _0x2d5255[_0xa22e('0x46')]['id'];}return db[_0xa22e('0x2b')]['find']({'where':{'id':_0x2d5255[_0xa22e('0x4f')]['id']},'include':[{'model':db[_0xa22e('0x40')],'as':_0xa22e('0x41')}]})['then'](handleEntityNotFound(_0x26d9fa,null))[_0xa22e('0x12')](saveUpdates(_0x2d5255['body'],null))[_0xa22e('0x12')](respondWithResult(_0x26d9fa,null))['catch'](handleError(_0x26d9fa,null));};exports[_0xa22e('0x25')]=function(_0x4255a6,_0xaebe7e){return db[_0xa22e('0x2b')][_0xa22e('0x44')]({'where':{'id':_0x4255a6[_0xa22e('0x4f')]['id']}})['then'](handleEntityNotFound(_0xaebe7e,null))['then'](removeEntity(_0xaebe7e,null))['catch'](handleError(_0xaebe7e,null));};exports[_0xa22e('0x50')]=function(_0x38e41a,_0x1aacf4){return db[_0xa22e('0x2b')][_0xa22e('0x50')]()[_0xa22e('0x12')](respondWithResult(_0x1aacf4,null))['catch'](handleError(_0x1aacf4,null));};exports[_0xa22e('0x51')]=function(_0x131ff0,_0x3f5a0e){if(_0x131ff0[_0xa22e('0x46')]['id']){delete _0x131ff0[_0xa22e('0x46')]['id'];}return db[_0xa22e('0x2b')][_0xa22e('0x44')]({'where':{'id':_0x131ff0['params']['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x3f5a0e,null))[_0xa22e('0x12')](function(_0x59ec6a){if(_0x59ec6a){_0x131ff0['body'][_0xa22e('0x52')]=_0x59ec6a['id'];return db[_0xa22e('0x53')][_0xa22e('0x45')](_0x131ff0[_0xa22e('0x46')]);}})[_0xa22e('0x12')](respondWithResult(_0x3f5a0e,null))['catch'](handleError(_0x3f5a0e,null));};exports[_0xa22e('0x54')]=function(_0x1df760,_0x38ea33){var _0xa4777b={'raw':![],'where':{}};var _0x5d3273={};var _0x4ec2d3={'count':0x0,'rows':[]};return db[_0xa22e('0x2b')][_0xa22e('0x55')]({'where':{'id':_0x1df760['params']['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x38ea33,null))['then'](function(_0x42643c){if(_0x42643c){_0x5d3273['model']=_['keys'](db[_0xa22e('0x53')][_0xa22e('0x43')]);_0x5d3273[_0xa22e('0x2e')]=_[_0xa22e('0x42')](_0x1df760[_0xa22e('0x2e')]);_0x5d3273[_0xa22e('0x38')]=_[_0xa22e('0x2f')](_0x5d3273[_0xa22e('0x30')],_0x5d3273[_0xa22e('0x2e')]);_0xa4777b['attributes']=_[_0xa22e('0x2f')](_0x5d3273[_0xa22e('0x30')],qs[_0xa22e('0x31')](_0x1df760['query'][_0xa22e('0x31')]));_0xa4777b[_0xa22e('0x32')]=_0xa4777b['attributes'][_0xa22e('0x33')]?_0xa4777b['attributes']:_0x5d3273['model'];if(!_0x1df760[_0xa22e('0x2e')][_0xa22e('0x34')](_0xa22e('0x35'))){_0xa4777b[_0xa22e('0x20')]=qs['limit'](_0x1df760[_0xa22e('0x2e')][_0xa22e('0x20')]);_0xa4777b['offset']=qs['offset'](_0x1df760[_0xa22e('0x2e')][_0xa22e('0x22')]);}_0xa4777b[_0xa22e('0x36')]=qs[_0xa22e('0x56')](_0x1df760[_0xa22e('0x2e')]['sort']);_0xa4777b[_0xa22e('0x37')]=qs[_0xa22e('0x38')](_[_0xa22e('0x39')](_0x1df760['query'],_0x5d3273[_0xa22e('0x38')]));_0xa4777b[_0xa22e('0x37')][_0xa22e('0x52')]=_0x42643c['id'];if(_0x1df760[_0xa22e('0x2e')][_0xa22e('0x3a')]){_0xa4777b['where']=_[_0xa22e('0x3b')](_0xa4777b[_0xa22e('0x37')],{'$or':_['map'](_0xa4777b[_0xa22e('0x32')],function(_0x443823){var _0x51ddf2={};_0x51ddf2[_0x443823]={'$like':'%'+_0x1df760[_0xa22e('0x2e')][_0xa22e('0x3a')]+'%'};return _0x51ddf2;})});}_0xa4777b=_[_0xa22e('0x3b')]({},_0xa4777b,_0x1df760[_0xa22e('0x57')]);return db[_0xa22e('0x53')]['count']({'where':_0xa4777b['where']})[_0xa22e('0x12')](function(_0x4ee193){_0x4ec2d3[_0xa22e('0x21')]=_0x4ee193;if(_0x1df760[_0xa22e('0x2e')][_0xa22e('0x3d')]){_0xa4777b[_0xa22e('0x3e')]=[{'all':!![]}];}return db[_0xa22e('0x53')][_0xa22e('0x3f')](_0xa4777b);})[_0xa22e('0x12')](function(_0x5c3947){_0x4ec2d3[_0xa22e('0x58')]=_0x5c3947;return _0x4ec2d3;});}})[_0xa22e('0x12')](respondWithFilteredResult(_0x38ea33,_0xa4777b))[_0xa22e('0x1b')](handleError(_0x38ea33,null));};exports[_0xa22e('0x59')]=function(_0x378fdc,_0x5c5240){return db[_0xa22e('0x2b')]['find']({'where':{'id':_0x378fdc[_0xa22e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5c5240,null))['then'](function(_0x5bf6ae){if(_0x5bf6ae){return _0x5bf6ae[_0xa22e('0x59')](_0x378fdc[_0xa22e('0x2e')][_0xa22e('0x5a')]);}})[_0xa22e('0x12')](respondWithStatusCode(_0x5c5240,null))[_0xa22e('0x1b')](handleError(_0x5c5240,null));};exports[_0xa22e('0x5b')]=function(_0x2be1c1,_0x404b67){if(_0x2be1c1[_0xa22e('0x46')]['id']){delete _0x2be1c1[_0xa22e('0x46')]['id'];}return db[_0xa22e('0x2b')][_0xa22e('0x44')]({'where':{'id':_0x2be1c1[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x404b67,null))[_0xa22e('0x12')](function(_0x37b2b9){if(_0x37b2b9){_0x2be1c1[_0xa22e('0x46')]['ChatWebsiteId']=_0x37b2b9['id'];return db[_0xa22e('0x5c')][_0xa22e('0x45')](_0x2be1c1[_0xa22e('0x46')]);}})['then'](respondWithResult(_0x404b67,null))[_0xa22e('0x1b')](handleError(_0x404b67,null));};exports[_0xa22e('0x5d')]=function(_0x226b3a,_0x302855){var _0x3d1ac9={'raw':![],'where':{}};var _0x468549={};var _0x458bf6={'count':0x0,'rows':[]};return db[_0xa22e('0x2b')][_0xa22e('0x55')]({'where':{'id':_0x226b3a[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x302855,null))[_0xa22e('0x12')](function(_0x1fb819){if(_0x1fb819){_0x468549['model']=_[_0xa22e('0x42')](db[_0xa22e('0x5c')][_0xa22e('0x43')]);_0x468549[_0xa22e('0x2e')]=_['keys'](_0x226b3a['query']);_0x468549[_0xa22e('0x38')]=_[_0xa22e('0x2f')](_0x468549['model'],_0x468549['query']);_0x3d1ac9[_0xa22e('0x32')]=_[_0xa22e('0x2f')](_0x468549[_0xa22e('0x30')],qs[_0xa22e('0x31')](_0x226b3a[_0xa22e('0x2e')][_0xa22e('0x31')]));_0x3d1ac9['attributes']=_0x3d1ac9[_0xa22e('0x32')]['length']?_0x3d1ac9[_0xa22e('0x32')]:_0x468549[_0xa22e('0x30')];if(!_0x226b3a[_0xa22e('0x2e')][_0xa22e('0x34')]('nolimit')){_0x3d1ac9['limit']=qs[_0xa22e('0x20')](_0x226b3a['query'][_0xa22e('0x20')]);_0x3d1ac9[_0xa22e('0x22')]=qs[_0xa22e('0x22')](_0x226b3a[_0xa22e('0x2e')]['offset']);}_0x3d1ac9[_0xa22e('0x36')]=qs[_0xa22e('0x56')](_0x226b3a['query'][_0xa22e('0x56')]);_0x3d1ac9[_0xa22e('0x37')]=qs['filters'](_[_0xa22e('0x39')](_0x226b3a[_0xa22e('0x2e')],_0x468549[_0xa22e('0x38')]));_0x3d1ac9[_0xa22e('0x37')][_0xa22e('0x52')]=_0x1fb819['id'];if(_0x226b3a[_0xa22e('0x2e')][_0xa22e('0x3a')]){_0x3d1ac9['where']=_[_0xa22e('0x3b')](_0x3d1ac9[_0xa22e('0x37')],{'$or':_[_0xa22e('0x2a')](_0x3d1ac9[_0xa22e('0x32')],function(_0xb52c3a){var _0x260b08={};_0x260b08[_0xb52c3a]={'$like':'%'+_0x226b3a['query'][_0xa22e('0x3a')]+'%'};return _0x260b08;})});}_0x3d1ac9=_[_0xa22e('0x3b')]({},_0x3d1ac9,_0x226b3a[_0xa22e('0x57')]);return db[_0xa22e('0x5c')][_0xa22e('0x21')]({'where':_0x3d1ac9[_0xa22e('0x37')]})[_0xa22e('0x12')](function(_0x127945){_0x458bf6[_0xa22e('0x21')]=_0x127945;if(_0x226b3a[_0xa22e('0x2e')][_0xa22e('0x3d')]){_0x3d1ac9[_0xa22e('0x3e')]=[{'all':!![]}];}return db[_0xa22e('0x5c')][_0xa22e('0x3f')](_0x3d1ac9);})[_0xa22e('0x12')](function(_0x4afd01){_0x458bf6[_0xa22e('0x58')]=_0x4afd01;return _0x458bf6;});}})[_0xa22e('0x12')](respondWithFilteredResult(_0x302855,_0x3d1ac9))[_0xa22e('0x1b')](handleError(_0x302855,null));};exports[_0xa22e('0x5e')]=function(_0x2f385e,_0x8efd0){return db['ChatWebsite']['find']({'where':{'id':_0x2f385e[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x8efd0,null))[_0xa22e('0x12')](function(_0x57e8ad){if(_0x57e8ad){return _0x57e8ad[_0xa22e('0x5e')](_0x2f385e[_0xa22e('0x2e')]['ids']);}})[_0xa22e('0x12')](respondWithStatusCode(_0x8efd0,null))[_0xa22e('0x1b')](handleError(_0x8efd0,null));};exports[_0xa22e('0x5f')]=function(_0x153031,_0x58281c){_0x153031[_0xa22e('0x46')]['sitepic']=_0x153031[_0xa22e('0x60')][_0xa22e('0x61')];return db[_0xa22e('0x2b')]['find']({'where':{'id':_0x153031['params']['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x58281c,null))[_0xa22e('0x12')](saveUpdates(_0x153031['body'],null))[_0xa22e('0x12')](respondWithResult(_0x58281c,null))[_0xa22e('0x1b')](handleError(_0x58281c,null));};exports[_0xa22e('0x62')]=function(_0x531aef,_0x177d05){_0x531aef[_0xa22e('0x46')][_0xa22e('0x63')]=_0x531aef[_0xa22e('0x60')][_0xa22e('0x61')];return db['ChatWebsite']['find']({'where':{'id':_0x531aef['params']['id']}})['then'](handleEntityNotFound(_0x177d05,null))[_0xa22e('0x12')](saveUpdates(_0x531aef['body'],null))[_0xa22e('0x12')](respondWithResult(_0x177d05,null))[_0xa22e('0x1b')](handleError(_0x177d05,null));};exports[_0xa22e('0x64')]=function(_0x1c6894,_0x52014e){_0x1c6894[_0xa22e('0x46')][_0xa22e('0x65')]=_0x1c6894[_0xa22e('0x60')][_0xa22e('0x61')];return db[_0xa22e('0x2b')][_0xa22e('0x44')]({'where':{'id':_0x1c6894[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x52014e,null))[_0xa22e('0x12')](saveUpdates(_0x1c6894['body'],null))['then'](respondWithResult(_0x52014e,null))[_0xa22e('0x1b')](handleError(_0x52014e,null));};exports[_0xa22e('0x66')]=function(_0x401683,_0x48ab17){_0x401683[_0xa22e('0x46')][_0xa22e('0x67')]=_0x401683[_0xa22e('0x60')][_0xa22e('0x61')];return db[_0xa22e('0x2b')][_0xa22e('0x44')]({'where':{'id':_0x401683[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x48ab17,null))[_0xa22e('0x12')](saveUpdates(_0x401683[_0xa22e('0x46')],null))[_0xa22e('0x12')](respondWithResult(_0x48ab17,null))[_0xa22e('0x1b')](handleError(_0x48ab17,null));};exports['getLogo']=function(_0x5e4500,_0x45cbb2){var _0x46196c=path['join'](config[_0xa22e('0x68')],_0xa22e('0x69'));var _0x1c66b2={'where':{'id':_0x5e4500[_0xa22e('0x4f')]['id']},'attributes':['id',_0xa22e('0x6a')],'raw':!![]};var _0x1b2581=![];return require(_0xa22e('0x6b'))['getLicense']()[_0xa22e('0x12')](function(_0xf800e1){if(_0xf800e1){_0x1b2581=_0xf800e1[_0xa22e('0x6c')];}})[_0xa22e('0x12')](function(){return db[_0xa22e('0x2b')][_0xa22e('0x44')](_0x1c66b2);})['then'](handleEntityNotFound(_0x45cbb2,null))['then'](function(_0x127947){if(_0x127947){if(!_[_0xa22e('0x6d')](_0x127947[_0xa22e('0x6a')])){if(fs[_0xa22e('0x6e')](path['join'](config[_0xa22e('0x68')],'server/files/images/logos/',_0x127947[_0xa22e('0x6a')]))&&_0x1b2581){_0x46196c=path[_0xa22e('0x6f')](config[_0xa22e('0x68')],_0xa22e('0x70'),_0x127947[_0xa22e('0x6a')]);}}return _0x45cbb2['download'](_0x46196c);}})[_0xa22e('0x1b')](handleError(_0x45cbb2,null));};exports[_0xa22e('0x71')]=function(_0x4fd2c6,_0x4b265d){var _0x1536a9=path[_0xa22e('0x6f')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x4d0a11={'where':{'id':_0x4fd2c6[_0xa22e('0x4f')]['id']},'attributes':['id',_0xa22e('0x63')],'raw':!![]};return db[_0xa22e('0x2b')][_0xa22e('0x44')](_0x4d0a11)[_0xa22e('0x12')](handleEntityNotFound(_0x4b265d,null))[_0xa22e('0x12')](function(_0x320837){if(_0x320837){if(!_['isNil'](_0x320837[_0xa22e('0x63')])){if(fs[_0xa22e('0x6e')](path[_0xa22e('0x6f')](config[_0xa22e('0x68')],_0xa22e('0x72'),_0x320837[_0xa22e('0x63')]))){_0x1536a9=path[_0xa22e('0x6f')](config[_0xa22e('0x68')],_0xa22e('0x72'),_0x320837[_0xa22e('0x63')]);}}return _0x4b265d[_0xa22e('0x73')](_0x1536a9);}})[_0xa22e('0x1b')](handleError(_0x4b265d,null));};exports[_0xa22e('0x74')]=function(_0x47f554,_0x5f0b97){var _0x2da203=path[_0xa22e('0x6f')](config['root'],_0xa22e('0x75'));var _0x5e27d5={'where':{'id':_0x47f554[_0xa22e('0x4f')]['id']},'attributes':['id',_0xa22e('0x65'),_0xa22e('0x76')],'raw':!![]};return db[_0xa22e('0x2b')][_0xa22e('0x44')](_0x5e27d5)[_0xa22e('0x12')](handleEntityNotFound(_0x5f0b97,null))[_0xa22e('0x12')](function(_0x17d742){if(_0x17d742){if(!_['isNil'](_0x17d742[_0xa22e('0x65')])){if(fs[_0xa22e('0x6e')](path[_0xa22e('0x6f')](config[_0xa22e('0x68')],_0xa22e('0x72'),_0x17d742[_0xa22e('0x65')]))&&_0x17d742[_0xa22e('0x76')]){_0x2da203=path[_0xa22e('0x6f')](config[_0xa22e('0x68')],_0xa22e('0x72'),_0x17d742[_0xa22e('0x65')]);}}return _0x5f0b97['download'](_0x2da203);}})[_0xa22e('0x1b')](handleError(_0x5f0b97,null));};exports[_0xa22e('0x77')]=function(_0x36f1cc,_0x537fc9){var _0x568ea4=path[_0xa22e('0x6f')](config[_0xa22e('0x68')],_0xa22e('0x78'));var _0x4724cd={'where':{'id':_0x36f1cc[_0xa22e('0x4f')]['id']},'attributes':['id',_0xa22e('0x67')],'raw':!![]};return db['ChatWebsite'][_0xa22e('0x44')](_0x4724cd)['then'](handleEntityNotFound(_0x537fc9,null))['then'](function(_0x42b25e){if(_0x42b25e){if(!_[_0xa22e('0x6d')](_0x42b25e['systemAvatar'])){if(fs[_0xa22e('0x6e')](path[_0xa22e('0x6f')](config[_0xa22e('0x68')],_0xa22e('0x72'),_0x42b25e[_0xa22e('0x67')]))){_0x568ea4=path[_0xa22e('0x6f')](config['root'],_0xa22e('0x72'),_0x42b25e[_0xa22e('0x67')]);}}return _0x537fc9[_0xa22e('0x73')](_0x568ea4);}})[_0xa22e('0x1b')](handleError(_0x537fc9,null));};exports[_0xa22e('0x79')]=function(_0x1b36db,_0x506c63){var _0x153117=require(_0xa22e('0x7a'));var _0x3ed0fa=new _0x153117();var _0x3b6a33=_0x3ed0fa[_0xa22e('0x7b')](_0x1b36db['headers'][_0xa22e('0x7c')])[_0xa22e('0x7d')]();var _0xf65ff0={'body':_0x1b36db[_0xa22e('0x46')],'channel':'chat'};var _0x34debb=[];var _0x11c05a=[];var _0x125634={};var _0x1f0fe4=![];return db[_0xa22e('0x7e')]['describe']()[_0xa22e('0x12')](function(_0x49c55c){if(!_0x49c55c){throw new db[(_0xa22e('0x7f'))][(_0xa22e('0x80'))](_0xa22e('0x81'));}_0x34debb=_[_0xa22e('0x82')](_[_0xa22e('0x42')](_0x49c55c),[_0xa22e('0x83'),_0xa22e('0x84')]);_0x11c05a=_[_0xa22e('0x82')](_['keys'](_0x49c55c),[_0xa22e('0x83'),_0xa22e('0x84'),_0xa22e('0x85'),_0xa22e('0x86')]);if(_0x1b36db[_0xa22e('0x46')]['id']){delete _0x1b36db[_0xa22e('0x46')]['id'];}if(_['isNil'](_0x1b36db[_0xa22e('0x46')][_0xa22e('0x87')])){throw new db[(_0xa22e('0x7f'))][(_0xa22e('0x80'))](_0xa22e('0x88'));}if(_[_0xa22e('0x6d')](_0x1b36db['body'][_0xa22e('0x46')])||_0x1b36db[_0xa22e('0x46')][_0xa22e('0x46')]===''){throw new db[(_0xa22e('0x7f'))][(_0xa22e('0x80'))](_0xa22e('0x89'));}if(_[_0xa22e('0x6d')](_0x1b36db[_0xa22e('0x46')][_0xa22e('0x8a')])){throw new db[(_0xa22e('0x7f'))][(_0xa22e('0x80'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x11c05a);}if(!_[_0xa22e('0x8b')](_0x11c05a,_0x1b36db['body'][_0xa22e('0x8a')])){throw new db[(_0xa22e('0x7f'))][(_0xa22e('0x80'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x11c05a);}_0x125634[_0x1b36db[_0xa22e('0x46')][_0xa22e('0x8a')]]=_0x1b36db[_0xa22e('0x46')][_0xa22e('0x87')];})['then'](function(){return db[_0xa22e('0x2b')]['find']({'where':{'id':_0x1b36db[_0xa22e('0x4f')]['id']},'include':[{'model':db[_0xa22e('0x8c')],'as':_0xa22e('0x8d'),'include':[{'model':db[_0xa22e('0x7e')],'as':_0xa22e('0x8e'),'where':_0x125634,'limit':0x1,'order':[[_0xa22e('0x84'),_0xa22e('0x8f')]]}]},{'model':db[_0xa22e('0x90')],'as':_0xa22e('0x91')}]});})[_0xa22e('0x12')](handleEntityNotFound(_0x506c63,null))['then'](function(_0x105aa5){if(_0x105aa5&&_0x105aa5[_0xa22e('0x8d')]){_0xf65ff0[_0xa22e('0x92')]=_0x105aa5;_0xf65ff0[_0xa22e('0x93')]=_0x105aa5[_0xa22e('0x91')];_0xf65ff0['list']=_0x105aa5['List'];_0xf65ff0[_0xa22e('0x93')]=_[_0xa22e('0x94')](_0xf65ff0[_0xa22e('0x93')],[_0xa22e('0x95')],[_0xa22e('0x96')]);if(_0xf65ff0[_0xa22e('0x92')][_0xa22e('0x91')]){delete _0xf65ff0[_0xa22e('0x92')][_0xa22e('0x91')];}if(_0xf65ff0[_0xa22e('0x92')]['List']&&_0xf65ff0[_0xa22e('0x92')][_0xa22e('0x8d')][_0xa22e('0x8e')][_0xa22e('0x33')]){return _0xf65ff0[_0xa22e('0x92')][_0xa22e('0x8d')][_0xa22e('0x8e')][0x0];}var _0x44005d=_[_0xa22e('0x97')](_0x1b36db[_0xa22e('0x46')],{'firstName':_0x1b36db[_0xa22e('0x46')][_0xa22e('0x87')],'ListId':_0x105aa5[_0xa22e('0x86')]});_0x44005d[_0x1b36db[_0xa22e('0x46')][_0xa22e('0x8a')]]=_0x1b36db[_0xa22e('0x46')]['from'];return db['CmContact'][_0xa22e('0x45')](_0x44005d,{'fields':_0x34debb,'raw':!![]});}})[_0xa22e('0x12')](handleEntityNotFound(_0x506c63,null))[_0xa22e('0x12')](function(_0x567651){_0xf65ff0[_0xa22e('0x98')]=_0x567651;var _0x24fed9=_0x1b36db[_0xa22e('0x46')][_0xa22e('0x99')];if(_0x1b36db[_0xa22e('0x9a')][_0xa22e('0x9b')]){_0x24fed9=_0x1b36db[_0xa22e('0x9a')][_0xa22e('0x9b')];}else if(_0x1b36db['headers'][_0xa22e('0x9c')]){_0x24fed9=_[_0xa22e('0x9d')](_0x1b36db['headers'][_0xa22e('0x9c')][_0xa22e('0x9e')](','));}if(_0x567651){var _0x23654e={'ContactId':_0x567651['id'],'ChatWebsiteId':_0x1b36db[_0xa22e('0x4f')]['id'],'from':(_0x567651[_0xa22e('0x9f')]||'')+'\x20'+(_0x567651[_0xa22e('0xa0')]||''),'customerIp':_0x24fed9,'customerPort':_0x1b36db[_0xa22e('0x9a')][_0xa22e('0xa1')]?_0x1b36db['headers'][_0xa22e('0xa1')]:null,'referer':_0x1b36db[_0xa22e('0x46')][_0xa22e('0xa2')],'browserName':_0x3b6a33['browser'][_0xa22e('0x29')]&&_0x3b6a33['browser'][_0xa22e('0xa3')]?util[_0xa22e('0xa4')](_0xa22e('0xa5'),_0x3b6a33[_0xa22e('0xa6')][_0xa22e('0x29')],_0x3b6a33[_0xa22e('0xa6')][_0xa22e('0xa3')]):_0xa22e('0xa7'),'browserVersion':_0x3b6a33[_0xa22e('0xa6')][_0xa22e('0xa3')]||_0xa22e('0xa7'),'osName':util['format'](_0xa22e('0xa5'),_0x3b6a33['os'][_0xa22e('0x29')],_0x3b6a33['os']['version']),'osVersion':_0x3b6a33['os'][_0xa22e('0xa3')],'deviceModel':_0x3b6a33[_0xa22e('0xa8')][_0xa22e('0x30')]&&_0x3b6a33[_0xa22e('0xa8')][_0xa22e('0xa9')]?util['format'](_0xa22e('0xaa'),_0x3b6a33[_0xa22e('0xa8')][_0xa22e('0x30')],_0x3b6a33['device'][_0xa22e('0xa9')],_0x3b6a33['device'][_0xa22e('0x2c')]):null,'deviceVendor':_0x3b6a33[_0xa22e('0xa8')][_0xa22e('0xa9')],'deviceType':_0x3b6a33['device']['type'],'formData':JSON['stringify'](_0x1b36db[_0xa22e('0x46')])};var _0x1be673={'ChatWebsiteId':_0x1b36db['params']['id'],'closed':![]};if(_0x1b36db[_0xa22e('0x46')][_0xa22e('0xab')]){_0x1be673[_0xa22e('0xab')]=_0x1b36db[_0xa22e('0x46')]['threadId'];return db[_0xa22e('0xac')][_0xa22e('0x44')]({'where':_0x1be673})[_0xa22e('0x12')](function(_0x3cfcd7){if(_0x3cfcd7){return[_0x3cfcd7,![]];}_0x23654e[_0xa22e('0xab')]=_0x1b36db[_0xa22e('0x46')][_0xa22e('0xab')];_0x23654e[_0xa22e('0xad')]=_0x1b36db[_0xa22e('0x46')][_0xa22e('0xad')];return db[_0xa22e('0xac')]['create'](_0x23654e)[_0xa22e('0x12')](function(_0x192926){return[_0x192926,!![]];});});}_0x1be673[_0xa22e('0xae')]=_0x567651['id'];if(_0x1b36db['body']['interaction']&&_0x1b36db[_0xa22e('0x46')][_0xa22e('0xaf')]['id']){_0x1be673['id']=_0x1b36db['body']['interaction']['id'];return db[_0xa22e('0xac')][_0xa22e('0x44')]({'where':_0x1be673})[_0xa22e('0x12')](function(_0x3385b4){if(_0x3385b4){return[_0x3385b4,![]];}return db['ChatInteraction'][_0xa22e('0x45')](_0x23654e)[_0xa22e('0x12')](function(_0x3d1bc9){return[_0x3d1bc9,!![]];});});}return db[_0xa22e('0xac')][_0xa22e('0x45')](_0x23654e)[_0xa22e('0x12')](function(_0x453a46){return[_0x453a46,!![]];});}})[_0xa22e('0xb0')](function(_0x188a18,_0x29551a){if(_0x188a18){_0x1f0fe4=_0x29551a;if(!_0x29551a){var _0x3ce2ee={'from':(_0xf65ff0['contact'][_0xa22e('0x9f')]||'')+'\x20'+(_0xf65ff0['contact'][_0xa22e('0xa0')]||'')};if(_0x1b36db[_0xa22e('0x46')][_0xa22e('0xab')]&&_0x1b36db[_0xa22e('0x46')][_0xa22e('0xb1')]&&_0x1b36db['body'][_0xa22e('0xab')]!=_0x1b36db['body'][_0xa22e('0xb1')]){_0x3ce2ee['threadId']=_0x1b36db[_0xa22e('0x46')][_0xa22e('0xb1')];}return _0x188a18[_0xa22e('0x24')](_0x3ce2ee);}else{return _0x188a18;}}})['then'](function(_0x41b291){_0xf65ff0[_0xa22e('0xaf')]=_0x41b291[_0xa22e('0x26')]({'plain':!![]});_0xf65ff0[_0xa22e('0xaf')]['created']=_0x1f0fe4;if(_0xf65ff0[_0xa22e('0xaf')]['created']){if(_0xf65ff0[_0xa22e('0x92')]['autoclose']){_0xf65ff0[_0xa22e('0x93')][_0xa22e('0xb2')]({'id':0x0,'priority':_0xf65ff0['applications']['length']+0x1,'app':_0xa22e('0xb3'),'appdata':_0xa22e('0xb4'),'interval':_0xa22e('0xb5')});}}return db[_0xa22e('0xb6')][_0xa22e('0x45')]({'body':_0x1b36db[_0xa22e('0x46')][_0xa22e('0x46')],'ChatWebsiteId':_0x1b36db[_0xa22e('0x4f')]['id'],'ChatInteractionId':_0x41b291['id'],'direction':'in','ContactId':_0xf65ff0[_0xa22e('0x98')]['id'],'AttachmentId':_0x1b36db[_0xa22e('0x46')][_0xa22e('0xb7')]});})[_0xa22e('0x12')](function(_0x494b77){_0xf65ff0[_0xa22e('0x19')]=_0x494b77;if(_0xf65ff0[_0xa22e('0xaf')][_0xa22e('0xb8')]){return db[_0xa22e('0xb9')]['find']({'attributes':['id',_0xa22e('0x29')],'where':{'id':_0xf65ff0[_0xa22e('0xaf')][_0xa22e('0xb8')]}})[_0xa22e('0x12')](function(_0xc14603){if(_0xc14603){_0xf65ff0[_0xa22e('0x93')][_0xa22e('0xba')]({'id':0x0,'priority':0x0,'app':_0xa22e('0xbb'),'appdata':_0xc14603['name']+','+(_0xf65ff0[_0xa22e('0x92')][_0xa22e('0xbc')]||0xa),'interval':_0xa22e('0xb5')});_0xf65ff0[_0xa22e('0xbd')]=!![];}return respondWithRpcPromise('Start',_0xa22e('0xbe'),_0xf65ff0);});}return respondWithRpcPromise(_0xa22e('0xbf'),'startRouting',_0xf65ff0);})[_0xa22e('0x12')](function(_0x5e1011){respondWithRpcPromise(_0xa22e('0xc0'),'EventManager',{'event':_0xa22e('0x79'),'message':_0x5e1011},client9002);return _0x5e1011;})['then'](respondWithResult(_0x506c63,null))[_0xa22e('0x1b')](handleError(_0x506c63,null));};exports[_0xa22e('0xc1')]=function(_0x48c572,_0x1cd053){var _0x57c47a,_0x354e15,_0x4077ab;var _0x3f46e0=[];var _0x4d4831={};var _0x2605db=_0x48c572[_0xa22e('0xc2')]||[];var _0x1063c9=[];var _0x41874d;return db['CmContact'][_0xa22e('0x50')]()['then'](function(_0x4e2b39){if(!_0x4e2b39){throw new db[(_0xa22e('0x7f'))][(_0xa22e('0x80'))]('no\x20available\x20attributes');}_0x3f46e0=_['difference'](_[_0xa22e('0x42')](_0x4e2b39),[_0xa22e('0x83'),_0xa22e('0x84'),'CompanyId',_0xa22e('0x86')]);if(_0x48c572[_0xa22e('0x46')]['id']){delete _0x48c572['body']['id'];}if(_['isNil'](_0x48c572[_0xa22e('0x46')][_0xa22e('0x87')])){throw _0x1cd053[_0xa22e('0x1d')](0x1f4)[_0xa22e('0xc3')](new db['Sequelize']['ValidationError'](_0xa22e('0x88')));}if(_[_0xa22e('0x6d')](_0x48c572[_0xa22e('0x46')][_0xa22e('0x46')])||_0x48c572[_0xa22e('0x46')][_0xa22e('0x46')]===''){throw _0x1cd053['status'](0x1f4)[_0xa22e('0xc3')](new db[(_0xa22e('0x7f'))][(_0xa22e('0x80'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xa22e('0x6d')](_0x48c572[_0xa22e('0x46')][_0xa22e('0xc4')])){throw _0x1cd053[_0xa22e('0x1d')](0x1f4)[_0xa22e('0xc3')](new db[(_0xa22e('0x7f'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3f46e0));}if(!_[_0xa22e('0x8b')](_0x3f46e0,_0x48c572['body'][_0xa22e('0xc4')])){throw _0x1cd053[_0xa22e('0x1d')](0x1f4)[_0xa22e('0xc3')](new db[(_0xa22e('0x7f'))][(_0xa22e('0x80'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3f46e0));}_0x4d4831[_0x48c572[_0xa22e('0x46')][_0xa22e('0xc4')]]=_0x48c572['body'][_0xa22e('0x87')];})[_0xa22e('0x12')](function(){return db['ChatWebsite'][_0xa22e('0x44')]({'where':{'id':_0x48c572['params']['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0xa22e('0xc5')],'as':'MailAccount'}]});})[_0xa22e('0x12')](handleEntityNotFound(_0x1cd053,null))[_0xa22e('0x12')](function(_0x168550){if(_0x168550&&_0x168550[_0xa22e('0x8d')]){_0x354e15=_0x168550;var _0xeb9dcc=_[_0xa22e('0x97')](_0x48c572[_0xa22e('0x46')],{'firstName':_0x48c572[_0xa22e('0x46')][_0xa22e('0x87')],'phone':_0x48c572[_0xa22e('0x46')][_0xa22e('0x87')],'ListId':_0x168550[_0xa22e('0x86')]});_0xeb9dcc[_0x48c572[_0xa22e('0x46')][_0xa22e('0xc4')]]=_0x48c572['body'][_0xa22e('0x87')];return db[_0xa22e('0x7e')][_0xa22e('0xc6')]({'where':_0x4d4831,'defaults':_0xeb9dcc});}})['spread'](function(_0x499d3e){if(_0x499d3e){_0x4077ab=_0x499d3e;var _0x3f6e5a=fs[_0xa22e('0xc7')](path[_0xa22e('0x6f')](config[_0xa22e('0x68')],'server/files/templates/chatOfflineMessage.ejs'),_0xa22e('0xc8'));var _0x53fc94=ejs['render'](_0x3f6e5a,{'body':_[_0xa22e('0xc9')](_0x48c572['body'][_0xa22e('0x46')]),'bodyTitle':_0x354e15[_0xa22e('0xca')]});return db[_0xa22e('0xcb')]['create']({'body':_0x53fc94,'plainBody':htmlToText[_0xa22e('0xcc')](_0x53fc94),'ContactId':_0x499d3e['id'],'ChatWebsiteId':_0x354e15['id']});}})[_0xa22e('0x12')](function(_0x4e795c){_0x41874d=_0x4e795c;if(_0x2605db[_0xa22e('0x33')]){var _0x5a0283=_0x2605db[_0xa22e('0x2a')](function(_0x4e4497){return{'name':_0x4e4497[_0xa22e('0xcd')],'basename':_0x4e4497[_0xa22e('0x61')],'type':_0x4e4497[_0xa22e('0xce')],'ChatOfflineMessageId':_0x4e795c['id']};});_0x1063c9=_0x5a0283[_0xa22e('0x2a')](_0x1f8029=>{var _0x15e90c={'filename':_0x1f8029['name'],'path':path['join'](config[_0xa22e('0x68')],'server',_0xa22e('0xc2'),_0xa22e('0xcf'),_0xa22e('0xd0'),_0x1f8029[_0xa22e('0xd1')])};return _0x15e90c;});if(!_0x354e15[_0xa22e('0xd2')]){return db[_0xa22e('0xd3')][_0xa22e('0xd4')](function(_0x220bb0){return db[_0xa22e('0xd5')][_0xa22e('0xd6')](_0x5a0283,{'transaction':_0x220bb0});});}}})[_0xa22e('0x12')](function(){if(_0x41874d){_0x57c47a=_0x41874d;return db[_0xa22e('0xc5')][_0xa22e('0x55')]({'where':{'service':!![]},'include':[{'model':db[_0xa22e('0xd7')],'as':_0xa22e('0xd8'),'raw':!![],'include':[{'model':db[_0xa22e('0xd9')],'as':_0xa22e('0xd9'),'raw':!![]}]}]});}})[_0xa22e('0x12')](function(_0x30cac4){if(_0x30cac4&&_0x30cac4[_0xa22e('0xd8')]&&_0x354e15['forwardOffline']&&_0x354e15['forwardOfflineAddress']){var _0xdd7780=_0x30cac4[_0xa22e('0xda')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0xdd7780,'message':{'from':util[_0xa22e('0xa4')](_0xa22e('0xdb'),_0x30cac4[_0xa22e('0x29')],_0x30cac4[_0xa22e('0xdc')]||_0x30cac4[_0xa22e('0xd8')]['user']),'to':_0x354e15[_0xa22e('0xdd')],'subject':_0x354e15[_0xa22e('0xde')],'html':_0x57c47a[_0xa22e('0x46')],'attachments':_0x1063c9}},client9003)[_0xa22e('0x12')](function(){return _0x57c47a;})[_0xa22e('0x1b')](function(_0x166cd1){logger[_0xa22e('0x17')](_0x166cd1);});}})[_0xa22e('0x12')](function(){if(_0x354e15&&_0x354e15['openNewInteraction']&&_0x354e15[_0xa22e('0xdf')]){var _0x5c634b=[];if(_0x2605db[_0xa22e('0x33')]){_0x5c634b=_0x2605db[_0xa22e('0x2a')](function(_0x19fa9b){return{'name':_0x19fa9b[_0xa22e('0xcd')],'basename':_0x19fa9b[_0xa22e('0x61')],'type':_0x19fa9b['mimetype'],'ChatOfflineMessageId':_0x41874d['id']};});}var _0x323066;if(!_[_0xa22e('0x6d')](_0x354e15[_0xa22e('0xe0')])){var _0x459e52=_[_0xa22e('0x2a')](_0x48c572['body'],function(_0x34524b){return _0x34524b;});var _0x4f520b=_[_0xa22e('0xe1')](_0x459e52)[0x0];var _0x3e1cf7=_['mapValues'](_0x4f520b,function(_0x56f001){return _0x56f001;});_0x323066=_0x3e1cf7[0x1][_0x354e15['subjectOffline']];}var _0x3f487f={'from':_0x4077ab[_0xa22e('0xdc')],'firstName':_0x4077ab[_0xa22e('0x9f')],'lastName':_0x4077ab['lastName'],'mapKey':'email','message':{'from':_0x4077ab['email'],'to':_0x354e15[_0xa22e('0xc5')][_0xa22e('0xdc')],'cc':'','subject':_[_0xa22e('0x6d')](_0x323066)?_0x354e15[_0xa22e('0xde')]:_0x323066,'messageId':'','sentAt':new Date(),'attach':_0x5c634b[_0xa22e('0x33')],'attachments':_0x5c634b,'originChannel':'Chat','ChatWebsiteId':_0x354e15['id'],'ChatOfflineMessageId':_0x57c47a['id'],'originTo':_0x354e15['MailAccount'][_0xa22e('0xdc')]},'body':_0x57c47a[_0xa22e('0x46')]};var _0x2a7935={'account':{'id':_0x354e15['MailAccountId']},'body':_0x3f487f,'log':_0xa22e('0xe2')};return respondWithRpcPromise(_0xa22e('0xe2'),_0xa22e('0xe3'),_0x2a7935,client9001)[_0xa22e('0x12')](function(){return _0x57c47a;})['catch'](function(_0x5c02d){logger[_0xa22e('0x17')](_0x5c02d);});}return;})[_0xa22e('0x12')](function(){if(_0x57c47a){return _0x57c47a;}})[_0xa22e('0x12')](respondWithResult(_0x1cd053,null))[_0xa22e('0x1b')](function(_0x5c4c66){logger['error']('catch',_0x5c4c66);for(var _0x1a2592 of _0x2605db){var _0x173284=path[_0xa22e('0x6f')](config['root'],_0xa22e('0xe4'),'files','attachments','offline-chat',_0x1a2592[_0xa22e('0x61')]);fs_extra['remove'](_0x173284)[_0xa22e('0x1b')](function(_0x131d90){logger[_0xa22e('0x17')]('Could\x20not\x20remove\x20attachment\x20file',_0x173284,_0x131d90);});}});};exports[_0xa22e('0xe5')]=function(_0x205ffc,_0x26a3ca){return db[_0xa22e('0xac')][_0xa22e('0x44')]({'where':{'id':_0x205ffc[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x26a3ca,null))[_0xa22e('0x12')](function(_0x3d63b5){if(_0x3d63b5){return _0x3d63b5['addInteraction'](_0x205ffc[_0xa22e('0x46')]['ids'],_['omit'](_0x205ffc[_0xa22e('0x46')],[_0xa22e('0x5a'),'id'])||{});}})[_0xa22e('0x12')](respondWithResult(_0x26a3ca,null))[_0xa22e('0x1b')](handleError(_0x26a3ca,null));};exports['getInteractions']=function(_0x1a68f5,_0x36423b){var _0x251308={'raw':![],'where':{}};var _0x32ad72={};var _0x31df37={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xa22e('0x55')]({'where':{'id':_0x1a68f5['params']['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x36423b,null))[_0xa22e('0x12')](function(_0x2e8274){if(_0x2e8274){_0x32ad72[_0xa22e('0x30')]=_[_0xa22e('0x42')](db[_0xa22e('0xac')][_0xa22e('0x43')]);_0x32ad72[_0xa22e('0x2e')]=_[_0xa22e('0x42')](_0x1a68f5['query']);_0x32ad72[_0xa22e('0x38')]=_[_0xa22e('0x2f')](_0x32ad72[_0xa22e('0x30')],_0x32ad72[_0xa22e('0x2e')]);_0x251308[_0xa22e('0x32')]=_[_0xa22e('0x2f')](_0x32ad72[_0xa22e('0x30')],qs[_0xa22e('0x31')](_0x1a68f5[_0xa22e('0x2e')][_0xa22e('0x31')]));_0x251308[_0xa22e('0x32')]=_0x251308[_0xa22e('0x32')][_0xa22e('0x33')]?_0x251308['attributes']:_0x32ad72[_0xa22e('0x30')];if(!_0x1a68f5[_0xa22e('0x2e')][_0xa22e('0x34')](_0xa22e('0x35'))){_0x251308[_0xa22e('0x20')]=qs[_0xa22e('0x20')](_0x1a68f5[_0xa22e('0x2e')][_0xa22e('0x20')]);_0x251308[_0xa22e('0x22')]=qs['offset'](_0x1a68f5[_0xa22e('0x2e')][_0xa22e('0x22')]);}_0x251308['order']=qs[_0xa22e('0x56')](_0x1a68f5[_0xa22e('0x2e')]['sort']);_0x251308[_0xa22e('0x37')]=qs[_0xa22e('0x38')](_['pick'](_0x1a68f5[_0xa22e('0x2e')],_0x32ad72[_0xa22e('0x38')]));_0x251308[_0xa22e('0x37')][_0xa22e('0x52')]=_0x2e8274['id'];if(_0x1a68f5['query'][_0xa22e('0x3a')]){_0x251308[_0xa22e('0x37')]=_[_0xa22e('0x3b')](_0x251308['where'],{'$or':_[_0xa22e('0x2a')](_0x251308['attributes'],function(_0x3bd1b7){var _0x2b93c2={};_0x2b93c2[_0x3bd1b7]={'$like':'%'+_0x1a68f5['query'][_0xa22e('0x3a')]+'%'};return _0x2b93c2;})});}_0x251308=_[_0xa22e('0x3b')]({},_0x251308,_0x1a68f5['options']);return db['ChatInteraction'][_0xa22e('0x21')]({'where':_0x251308[_0xa22e('0x37')]})['then'](function(_0x2186c6){_0x31df37[_0xa22e('0x21')]=_0x2186c6;if(_0x1a68f5[_0xa22e('0x2e')]['includeAll']){_0x251308['include']=[{'model':db[_0xa22e('0x7e')],'as':_0xa22e('0xe6'),'required':![]},{'model':db[_0xa22e('0xb9')],'as':'Owner','attributes':['name','fullname','internal'],'required':![]},{'model':db[_0xa22e('0xe7')],'as':_0xa22e('0xe8'),'attributes':['id',_0xa22e('0x29'),_0xa22e('0xe9')],'where':_0x1a68f5['query']['tag']?{'id':_0x1a68f5[_0xa22e('0x2e')]['tag']}:undefined,'required':_0x1a68f5[_0xa22e('0x2e')][_0xa22e('0xea')]?!![]:![]}];}return db['ChatInteraction'][_0xa22e('0x3f')](_0x251308);})['then'](function(_0xf0c383){_0x31df37[_0xa22e('0x58')]=_0xf0c383;return _0x31df37;});}})[_0xa22e('0x12')](respondWithFilteredResult(_0x36423b,_0x251308))[_0xa22e('0x1b')](handleError(_0x36423b,null));};function iftimePromise(_0x48f40e,_0x4b9b3c){return respondWithRpcPromise(_0xa22e('0xeb'),_0xa22e('0xec'),{'command':_0x4b9b3c[_0xa22e('0xed')]?util['format'](_0xa22e('0xee'),_0x48f40e[_0xa22e('0xef')],_0x4b9b3c[_0xa22e('0xed')]):util[_0xa22e('0xa4')]('iftime\x20%s',_0x48f40e['interval'])},client9002)[_0xa22e('0x12')](function(_0x1c8e5b){var _0x71e596=_0x1c8e5b&&_0x1c8e5b[_0xa22e('0xf0')](_0xa22e('0xf1'))>=0x0?!![]:![];logger[_0xa22e('0x13')](_0xa22e('0xf2'),_0x4b9b3c['id'],_0x48f40e['id'],_0x48f40e['interval'],_0x71e596?_0xa22e('0xf3'):'OFFLINE',_0x4b9b3c['timezone']?_0x4b9b3c[_0xa22e('0xed')]:_0xa22e('0xf4'));return _0x71e596;})[_0xa22e('0x1b')](function(_0x2e802a){logger[_0xa22e('0x17')](_0xa22e('0xf2'),_0x4b9b3c['id'],_0x48f40e['id'],_0x48f40e['interval'],util[_0xa22e('0xf5')](_0x2e802a,{'showHidden':![],'depth':null}),_0x4b9b3c[_0xa22e('0xed')]?_0x4b9b3c[_0xa22e('0xed')]:'No\x20timezone');return![];});}exports[_0xa22e('0xec')]=function(_0x2839e9,_0x4204f3){var _0x4fc5fe=0x0;var _0x19294e=0x0;var _0x1bcb4a=![];var _0x46bce4;var _0x2e3cbf;return db[_0xa22e('0x2b')][_0xa22e('0x44')]({'where':{'id':_0x2839e9[_0xa22e('0x4f')]['id']},'include':[{'model':db[_0xa22e('0xf6')],'as':'Interval','include':[{'model':db[_0xa22e('0xf6')],'as':_0xa22e('0xf7'),'attributes':['id',_0xa22e('0xef')],'raw':!![]}]}]})[_0xa22e('0x12')](handleEntityNotFound(_0x4204f3,null))[_0xa22e('0x12')](function(_0xabac88){if(_0xabac88){_0x46bce4=_0xabac88;return _0xabac88[_0xa22e('0xf8')]({'raw':!![]});}})[_0xa22e('0x12')](function(_0x19c45c){if(_0x46bce4){if(_0x19c45c){_0x2e3cbf=_0x19c45c;}}return require(_0xa22e('0x6b'))['getLicense']();})[_0xa22e('0x12')](function(_0x5400a1){if(_0x5400a1){_0x19294e=_0x5400a1[_0xa22e('0xf9')];_0x1bcb4a=_0x5400a1[_0xa22e('0x6c')];}})[_0xa22e('0x12')](function(){return db[_0xa22e('0xac')][_0xa22e('0x21')]({'where':{'closed':![]}});})['then'](function(_0x12a587){_0x4fc5fe=_0x12a587;if(_0x19294e&&_0x12a587>_0x19294e){return db[_0xa22e('0xfa')][_0xa22e('0x55')]({'where':{'id':0x1}})[_0xa22e('0x12')](function(_0x68b5e9){if(_0x68b5e9){_0x68b5e9[_0xa22e('0xfb')]('chatLicenseExceeded');}});}})[_0xa22e('0x12')](function(){if(_0x46bce4[_0xa22e('0xf6')]&&_0x46bce4[_0xa22e('0xf6')]['Intervals']){var _0x58c750=[];for(var _0x136a2f=0x0;_0x136a2f<_0x46bce4[_0xa22e('0xf6')][_0xa22e('0xf7')][_0xa22e('0x33')];_0x136a2f++){var _0x460da0=_0x46bce4[_0xa22e('0xf6')][_0xa22e('0xf7')][_0x136a2f][_0xa22e('0x26')]({'plain':!![]});_0x58c750[_0xa22e('0xb2')](iftimePromise(_0x460da0,_0x46bce4));}return BPromise[_0xa22e('0xfc')](_0x58c750)[_0xa22e('0x12')](function(_0x549295){return _[_0xa22e('0xfd')](_0x549295);});}else{return!![];}})[_0xa22e('0x12')](function(_0x31679d){var _0x252ba8=fs[_0xa22e('0xc7')](path['join'](config[_0xa22e('0x68')],_0xa22e('0xfe')),_0xa22e('0xc8'));var _0x4e8099={'remote':_0x46bce4[_0xa22e('0xff')],'query':querystring['stringify'](_[_0xa22e('0x3b')](_0x46bce4[_0xa22e('0x26')]({'plain':!![]}),{'customerIp':_0x2839e9[_0xa22e('0x9a')][_0xa22e('0x9c')]||_0x2839e9[_0xa22e('0x9a')][_0xa22e('0x100')]||_0x2839e9[_0xa22e('0x101')][_0xa22e('0x102')]||_0x2839e9['ip'],'referer':_0x2839e9['headers'][_0xa22e('0xa2')],'openedInteractions':_0x4fc5fe,'maxInteractions':_0x19294e,'virtual':_0x1bcb4a[_0xa22e('0xf9')],'online':_0x31679d,'custom':_0x1bcb4a}))[_0xa22e('0x103')](/'/g,'\x5c\x27')};_0x4204f3[_0xa22e('0xc3')](ejs['render'](Mustache[_0xa22e('0x104')](_0x252ba8,_0x4e8099),{'proactiveActions':_0x2e3cbf,'alignment':_0x46bce4[_0xa22e('0x105')],'verticalAlignment':_0x46bce4['verticalAlignment'],'div_color':_0x46bce4['color'],'labelText':_0x46bce4[_0xa22e('0x106')],'text_color':_0x46bce4[_0xa22e('0x107')],'text_button_color':_0x46bce4[_0xa22e('0x108')],'button_color':_0x46bce4[_0xa22e('0x109')],'background_color':_0x46bce4['backgroundColor'],'hideWhenOffline':_0x46bce4[_0xa22e('0x10a')],'interval':_0x46bce4[_0xa22e('0x10b')]}));})[_0xa22e('0x1b')](handleError(_0x4204f3,null));};exports[_0xa22e('0x10c')]=function(_0x47500b,_0x30bd85){var _0x11106d=_0x47500b[_0xa22e('0x4f')]['id'];var _0x596448=_0x47500b['body'];var _0x3ce862=0xc8;var _0x24434f=null;return db['sequelize'][_0xa22e('0xd4')]({'isolationLevel':db[_0xa22e('0xd3')]['Transaction']['ISOLATION_LEVELS'][_0xa22e('0x10d')]},function(_0x30cf32){return db['ChatWebsite'][_0xa22e('0x55')]({'where':{'id':_0x11106d},'transaction':_0x30cf32})['then'](function(_0x2f9056){if(_0x2f9056){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x11106d},'transaction':_0x30cf32})[_0xa22e('0x12')](function(){var _0x384329=_[_0xa22e('0x2a')](_0x596448,function(_0x17c08d){_0x17c08d[_0xa22e('0x52')]=_0x11106d;return _0x17c08d;});return db[_0xa22e('0x90')][_0xa22e('0xd6')](_0x384329,{'transaction':_0x30cf32});});}else{_0x3ce862=0x194;_0x24434f=[];}});})['then'](function(){if(_0x3ce862!==0x194){return db[_0xa22e('0x90')][_0xa22e('0x10e')]({'where':{'ChatWebsiteId':_0x11106d},'order':_0xa22e('0x95')})[_0xa22e('0x12')](function(_0x439bde){_0x24434f=_0x439bde;});}})[_0xa22e('0x1b')](function(_0x4a836e){_0x3ce862=0x1f4;logger['error'](_0x4a836e[_0xa22e('0x28')]);if(_0x4a836e[_0xa22e('0x29')]){delete _0x4a836e['name'];}_0x24434f=_0x4a836e;})['finally'](function(){if(_0x24434f===null){_0x30bd85[_0xa22e('0x1c')](_0x3ce862);}else{if(_0x3ce862===0x1f4){_0x30bd85[_0xa22e('0x1d')](_0x3ce862)['send'](_0x24434f);}else{_0x30bd85[_0xa22e('0x1d')](_0x3ce862)['json'](_0x24434f);}}});};exports[_0xa22e('0x10f')]=function(_0x467feb,_0x5bef63){var _0x2f2b5e={};var _0x1c7e18={};var _0x177ca8;var _0x2ad8a9;return db['ChatWebsite']['findOne']({'where':{'id':_0x467feb['params']['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x5bef63,null))[_0xa22e('0x12')](function(_0x28e515){if(_0x28e515){_0x177ca8=_0x28e515;_0x1c7e18[_0xa22e('0x30')]=_['keys'](db['ChatApplication'][_0xa22e('0x43')]);_0x1c7e18[_0xa22e('0x2e')]=_['keys'](_0x467feb[_0xa22e('0x2e')]);_0x1c7e18['filters']=_[_0xa22e('0x2f')](_0x1c7e18[_0xa22e('0x30')],_0x1c7e18[_0xa22e('0x2e')]);_0x2f2b5e['attributes']=_[_0xa22e('0x2f')](_0x1c7e18['model'],qs[_0xa22e('0x31')](_0x467feb[_0xa22e('0x2e')]['fields']));_0x2f2b5e['attributes']=_0x2f2b5e[_0xa22e('0x32')]['length']?_0x2f2b5e[_0xa22e('0x32')]:_0x1c7e18['model'];_0x2f2b5e['order']=qs[_0xa22e('0x56')](_0x467feb[_0xa22e('0x2e')][_0xa22e('0x56')]);_0x2f2b5e['where']=qs[_0xa22e('0x38')](_[_0xa22e('0x39')](_0x467feb[_0xa22e('0x2e')],_0x1c7e18[_0xa22e('0x38')]));if(_0x467feb[_0xa22e('0x2e')][_0xa22e('0x3a')]){_0x2f2b5e[_0xa22e('0x37')]=_[_0xa22e('0x3b')](_0x2f2b5e[_0xa22e('0x37')],{'$or':_[_0xa22e('0x2a')](_0x2f2b5e[_0xa22e('0x32')],function(_0x1d2b5c){var _0x50f148={};_0x50f148[_0x1d2b5c]={'$like':'%'+_0x467feb['query']['filter']+'%'};return _0x50f148;})});}_0x2f2b5e=_[_0xa22e('0x3b')]({},_0x2f2b5e,_0x467feb[_0xa22e('0x57')]);return _0x177ca8[_0xa22e('0x10f')](_0x2f2b5e);}})[_0xa22e('0x12')](function(_0x4a785c){if(_0x4a785c){_0x2ad8a9=_0x4a785c[_0xa22e('0x33')];if(!_0x467feb[_0xa22e('0x2e')][_0xa22e('0x34')](_0xa22e('0x35'))){_0x2f2b5e[_0xa22e('0x20')]=qs[_0xa22e('0x20')](_0x467feb['query']['limit']);_0x2f2b5e[_0xa22e('0x22')]=qs[_0xa22e('0x22')](_0x467feb['query'][_0xa22e('0x22')]);}return _0x177ca8['getApplications'](_0x2f2b5e);}})[_0xa22e('0x12')](function(_0x30ecaa){if(_0x30ecaa){return _0x30ecaa?{'count':_0x2ad8a9,'rows':_0x30ecaa}:null;}})[_0xa22e('0x12')](respondWithResult(_0x5bef63,null))[_0xa22e('0x1b')](handleError(_0x5bef63,null));};exports[_0xa22e('0x110')]=function(_0xe13136,_0x1b14e0){return db[_0xa22e('0x111')][_0xa22e('0x44')]({'where':{'id':_0xe13136[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x1b14e0,null))['then'](function(_0x5d2387){if(_0x5d2387){return _0x5d2387['addProactiveActions'](_0xe13136[_0xa22e('0x46')]['ids'],_[_0xa22e('0x112')](_0xe13136[_0xa22e('0x46')],['ids','id'])||{});}})[_0xa22e('0x12')](respondWithResult(_0x1b14e0,null))[_0xa22e('0x1b')](handleError(_0x1b14e0,null));};exports[_0xa22e('0xf8')]=function(_0x1e88a4,_0x29605b){var _0x403f70={};var _0x32b2f9={};var _0x3974f0;var _0x4c1148;return db[_0xa22e('0x2b')]['findOne']({'where':{'id':_0x1e88a4[_0xa22e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x29605b,null))[_0xa22e('0x12')](function(_0x5c6ab0){if(_0x5c6ab0){_0x3974f0=_0x5c6ab0;_0x32b2f9['model']=_[_0xa22e('0x42')](db[_0xa22e('0x113')]['rawAttributes']);_0x32b2f9[_0xa22e('0x2e')]=_[_0xa22e('0x42')](_0x1e88a4['query']);_0x32b2f9[_0xa22e('0x38')]=_[_0xa22e('0x2f')](_0x32b2f9[_0xa22e('0x30')],_0x32b2f9[_0xa22e('0x2e')]);_0x403f70[_0xa22e('0x32')]=_[_0xa22e('0x2f')](_0x32b2f9['model'],qs[_0xa22e('0x31')](_0x1e88a4[_0xa22e('0x2e')][_0xa22e('0x31')]));_0x403f70[_0xa22e('0x32')]=_0x403f70['attributes'][_0xa22e('0x33')]?_0x403f70[_0xa22e('0x32')]:_0x32b2f9['model'];_0x403f70[_0xa22e('0x36')]=qs['sort'](_0x1e88a4['query'][_0xa22e('0x56')]);_0x403f70[_0xa22e('0x37')]=qs[_0xa22e('0x38')](_[_0xa22e('0x39')](_0x1e88a4[_0xa22e('0x2e')],_0x32b2f9[_0xa22e('0x38')]));if(_0x1e88a4['query']['filter']){_0x403f70[_0xa22e('0x37')]=_[_0xa22e('0x3b')](_0x403f70['where'],{'$or':_[_0xa22e('0x2a')](_0x403f70[_0xa22e('0x32')],function(_0x362187){var _0x2d1ee3={};_0x2d1ee3[_0x362187]={'$like':'%'+_0x1e88a4[_0xa22e('0x2e')][_0xa22e('0x3a')]+'%'};return _0x2d1ee3;})});}_0x403f70=_[_0xa22e('0x3b')]({},_0x403f70,_0x1e88a4[_0xa22e('0x57')]);return _0x3974f0['getProactiveActions'](_0x403f70);}})[_0xa22e('0x12')](function(_0x579d31){if(_0x579d31){_0x4c1148=_0x579d31[_0xa22e('0x33')];if(!_0x1e88a4['query'][_0xa22e('0x34')](_0xa22e('0x35'))){_0x403f70[_0xa22e('0x20')]=qs[_0xa22e('0x20')](_0x1e88a4[_0xa22e('0x2e')][_0xa22e('0x20')]);_0x403f70[_0xa22e('0x22')]=qs[_0xa22e('0x22')](_0x1e88a4[_0xa22e('0x2e')][_0xa22e('0x22')]);}return _0x3974f0[_0xa22e('0xf8')](_0x403f70);}})[_0xa22e('0x12')](function(_0x1e2329){if(_0x1e2329){return _0x1e2329?{'count':_0x4c1148,'rows':_0x1e2329}:null;}})['then'](respondWithResult(_0x29605b,null))['catch'](handleError(_0x29605b,null));};exports[_0xa22e('0x114')]=function(_0x57a5c3,_0x538b94){var _0xf13519=_0x57a5c3['query'][_0xa22e('0x115')]===_0xa22e('0x116')?'offlineForm':_0xa22e('0x117');return db['ChatWebsite'][_0xa22e('0x44')]({'attributes':['id',_0xf13519],'where':{'id':_0x57a5c3[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x538b94,null))[_0xa22e('0x12')](function(_0x49683c){if(_0x49683c){var _0x39b930=_0x49683c[_0xf13519];var _0x15f9bd=_0x39b930&&_0x39b930[_0xa22e('0x118')]?_0x39b930[_0xa22e('0x118')]:[];_0x538b94['send']({'fromKey':_['isNil'](_0x39b930[_0xa22e('0x119')])?undefined:_0x39b930[_0xa22e('0x119')],'count':_0x15f9bd[_0xa22e('0x33')],'rows':_0x15f9bd});}})[_0xa22e('0x1b')](handleError(_0x538b94,null));};exports[_0xa22e('0x11a')]=function(_0x394b15,_0x26f89c){var _0x35c69e={'raw':![],'where':{}};var _0x5b59ae={};var _0x3afe03={'count':0x0,'rows':[]};return db[_0xa22e('0x2b')][_0xa22e('0x55')]({'where':{'id':_0x394b15[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x26f89c,null))['then'](function(_0x5dbb11){if(_0x5dbb11){_0x5b59ae['model']=_[_0xa22e('0x42')](db['ChatOfflineMessage'][_0xa22e('0x43')]);_0x5b59ae['query']=_['keys'](_0x394b15[_0xa22e('0x2e')]);_0x5b59ae[_0xa22e('0x38')]=_['intersection'](_0x5b59ae[_0xa22e('0x30')],_0x5b59ae['query']);_0x35c69e[_0xa22e('0x32')]=_[_0xa22e('0x2f')](_0x5b59ae[_0xa22e('0x30')],qs[_0xa22e('0x31')](_0x394b15[_0xa22e('0x2e')][_0xa22e('0x31')]));_0x35c69e[_0xa22e('0x32')]=_0x35c69e[_0xa22e('0x32')]['length']?_0x35c69e['attributes']:_0x5b59ae[_0xa22e('0x30')];if(!_0x394b15['query'][_0xa22e('0x34')](_0xa22e('0x35'))){_0x35c69e[_0xa22e('0x20')]=qs[_0xa22e('0x20')](_0x394b15[_0xa22e('0x2e')][_0xa22e('0x20')]);_0x35c69e[_0xa22e('0x22')]=qs['offset'](_0x394b15[_0xa22e('0x2e')][_0xa22e('0x22')]);}_0x35c69e['order']=qs['sort'](_0x394b15[_0xa22e('0x2e')][_0xa22e('0x56')]);_0x35c69e[_0xa22e('0x37')]=qs[_0xa22e('0x38')](_[_0xa22e('0x39')](_0x394b15[_0xa22e('0x2e')],_0x5b59ae[_0xa22e('0x38')]));_0x35c69e['where']['ChatWebsiteId']=_0x5dbb11['id'];if(_0x394b15['query'][_0xa22e('0x3a')]){_0x35c69e[_0xa22e('0x37')]=_[_0xa22e('0x3b')](_0x35c69e[_0xa22e('0x37')],{'$or':_[_0xa22e('0x2a')](_0x35c69e[_0xa22e('0x32')],function(_0x461ff5){var _0x1784c7={};_0x1784c7[_0x461ff5]={'$like':'%'+_0x394b15[_0xa22e('0x2e')][_0xa22e('0x3a')]+'%'};return _0x1784c7;})});}_0x35c69e=_[_0xa22e('0x3b')]({},_0x35c69e,_0x394b15[_0xa22e('0x57')]);return db[_0xa22e('0xcb')]['count']({'where':_0x35c69e['where']})[_0xa22e('0x12')](function(_0x256a94){_0x3afe03[_0xa22e('0x21')]=_0x256a94;if(_0x394b15[_0xa22e('0x2e')][_0xa22e('0x3d')]){_0x35c69e['include']=[{'all':!![]}];}else{_0x35c69e[_0xa22e('0x3e')]=[{'model':db[_0xa22e('0x7e')],'as':_0xa22e('0xe6'),'required':![]},{'model':db[_0xa22e('0xd5')],'as':_0xa22e('0x11b'),'required':![]}];}return db[_0xa22e('0xcb')][_0xa22e('0x3f')](_0x35c69e);})[_0xa22e('0x12')](function(_0x81b77){_0x3afe03[_0xa22e('0x58')]=_0x81b77;return _0x3afe03;});}})['then'](respondWithFilteredResult(_0x26f89c,_0x35c69e))['catch'](handleError(_0x26f89c,null));};exports[_0xa22e('0x11c')]=function(_0x4f4b91,_0x545f1f){return db[_0xa22e('0x2b')][_0xa22e('0x44')]({'where':{'id':_0x4f4b91[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x545f1f,null))[_0xa22e('0x12')](function(_0x1b74a3){if(_0x1b74a3){return _0x1b74a3['addAgents'](_0x4f4b91[_0xa22e('0x46')][_0xa22e('0x5a')],_[_0xa22e('0x112')](_0x4f4b91['body'],[_0xa22e('0x5a'),'id'])||{})[_0xa22e('0xb0')](function(_0x46d0aa){for(var _0x186c23=0x0;_0x186c23<_0x4f4b91[_0xa22e('0x46')][_0xa22e('0x5a')]['length'];_0x186c23+=0x1){socket[_0xa22e('0x11d')](_0xa22e('0x11e'),{'UserId':Number(_0x4f4b91['body'][_0xa22e('0x5a')][_0x186c23]),'ChatWebsiteId':Number(_0x4f4b91[_0xa22e('0x4f')]['id'])});}return _0x46d0aa;});}})[_0xa22e('0x12')](respondWithResult(_0x545f1f,null))['catch'](handleError(_0x545f1f,null));};exports[_0xa22e('0x11f')]=function(_0x51662f,_0x315595){return db['ChatWebsite'][_0xa22e('0x44')]({'where':{'id':_0x51662f[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x315595,null))[_0xa22e('0x12')](function(_0x336f20){if(_0x336f20){return _0x336f20[_0xa22e('0x11f')](_0x51662f[_0xa22e('0x2e')][_0xa22e('0x5a')])['then'](function(){if(_[_0xa22e('0x120')](_0x51662f[_0xa22e('0x2e')]['ids'])){for(var _0x34f947=0x0;_0x34f947<_0x51662f[_0xa22e('0x2e')]['ids'][_0xa22e('0x33')];_0x34f947+=0x1){socket['emit'](_0xa22e('0x121'),{'UserId':Number(_0x51662f[_0xa22e('0x2e')][_0xa22e('0x5a')][_0x34f947]),'ChatWebsiteId':Number(_0x51662f['params']['id'])});}}else{socket[_0xa22e('0x11d')](_0xa22e('0x121'),{'UserId':Number(_0x51662f[_0xa22e('0x2e')][_0xa22e('0x5a')]),'ChatWebsiteId':Number(_0x51662f[_0xa22e('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0x315595,null))[_0xa22e('0x1b')](handleError(_0x315595,null));};exports[_0xa22e('0x122')]=function(_0x5761e9,_0xd7e1c3){var _0x2f75a4={};var _0xf87a8c={};var _0x3794fd;var _0x3e9787;return db[_0xa22e('0x2b')][_0xa22e('0x55')]({'where':{'id':_0x5761e9[_0xa22e('0x4f')]['id']}})['then'](handleEntityNotFound(_0xd7e1c3,null))['then'](function(_0x13654){if(_0x13654){_0x3794fd=_0x13654;_0xf87a8c[_0xa22e('0x30')]=_[_0xa22e('0x42')](db[_0xa22e('0xb9')][_0xa22e('0x43')]);_0xf87a8c[_0xa22e('0x2e')]=_[_0xa22e('0x42')](_0x5761e9['query']);_0xf87a8c['filters']=_[_0xa22e('0x2f')](_0xf87a8c['model'],_0xf87a8c[_0xa22e('0x2e')]);_0x2f75a4[_0xa22e('0x32')]=_[_0xa22e('0x2f')](_0xf87a8c[_0xa22e('0x30')],qs['fields'](_0x5761e9[_0xa22e('0x2e')][_0xa22e('0x31')]));_0x2f75a4[_0xa22e('0x32')]=_0x2f75a4[_0xa22e('0x32')]['length']?_0x2f75a4[_0xa22e('0x32')]:_0xf87a8c[_0xa22e('0x30')];_0x2f75a4[_0xa22e('0x36')]=qs['sort'](_0x5761e9[_0xa22e('0x2e')]['sort']);_0x2f75a4[_0xa22e('0x37')]=qs[_0xa22e('0x38')](_[_0xa22e('0x39')](_0x5761e9[_0xa22e('0x2e')],_0xf87a8c['filters']));if(_0x5761e9[_0xa22e('0x2e')][_0xa22e('0x3a')]){_0x2f75a4[_0xa22e('0x37')]=_[_0xa22e('0x3b')](_0x2f75a4[_0xa22e('0x37')],{'$or':_[_0xa22e('0x2a')](_0x2f75a4['attributes'],function(_0x5c9d21){var _0x91f83c={};_0x91f83c[_0x5c9d21]={'$like':'%'+_0x5761e9[_0xa22e('0x2e')][_0xa22e('0x3a')]+'%'};return _0x91f83c;})});}_0x2f75a4=_[_0xa22e('0x3b')]({},_0x2f75a4,_0x5761e9['options']);return _0x3794fd[_0xa22e('0x122')](_0x2f75a4);}})[_0xa22e('0x12')](function(_0x577574){if(_0x577574){_0x3e9787=_0x577574[_0xa22e('0x33')];if(!_0x5761e9[_0xa22e('0x2e')][_0xa22e('0x34')](_0xa22e('0x35'))){_0x2f75a4[_0xa22e('0x20')]=qs[_0xa22e('0x20')](_0x5761e9[_0xa22e('0x2e')][_0xa22e('0x20')]);_0x2f75a4[_0xa22e('0x22')]=qs[_0xa22e('0x22')](_0x5761e9[_0xa22e('0x2e')][_0xa22e('0x22')]);}return _0x3794fd[_0xa22e('0x122')](_0x2f75a4);}})[_0xa22e('0x12')](function(_0x502c03){if(_0x502c03){return _0x502c03?{'count':_0x3e9787,'rows':_0x502c03}:null;}})['then'](respondWithResult(_0xd7e1c3,null))[_0xa22e('0x1b')](handleError(_0xd7e1c3,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 484ef37..4f5fb9d 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 _0x5089=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x22afe1,_0x2a6f2d){var _0x3bb5b9=function(_0x177218){while(--_0x177218){_0x22afe1['push'](_0x22afe1['shift']());}};_0x3bb5b9(++_0x2a6f2d);}(_0x5089,0x1bb));var _0x9508=function(_0x3b2244,_0x54873f){_0x3b2244=_0x3b2244-0x0;var _0x2dcc14=_0x5089[_0x3b2244];return _0x2dcc14;};'use strict';var EventEmitter=require(_0x9508('0x0'));var ChatWebsite=require(_0x9508('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9508('0x2')](0x0);var events={'afterCreate':_0x9508('0x3'),'afterUpdate':_0x9508('0x4'),'afterDestroy':_0x9508('0x5')};function emitEvent(_0x172549){return function(_0x59d3ee,_0x86540d,_0x5e80fa){ChatWebsiteEvents[_0x9508('0x6')](_0x172549+':'+_0x59d3ee['id'],_0x59d3ee);ChatWebsiteEvents[_0x9508('0x6')](_0x172549,_0x59d3ee);_0x5e80fa(null);};}for(var e in events){if(events[_0x9508('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x9508('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xcee8=['hasOwnProperty','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','emit'];(function(_0x381dbb,_0x4a1419){var _0x301378=function(_0xd1993c){while(--_0xd1993c){_0x381dbb['push'](_0x381dbb['shift']());}};_0x301378(++_0x4a1419);}(_0xcee8,0xb1));var _0x8cee=function(_0x2f1f74,_0x4a884e){_0x2f1f74=_0x2f1f74-0x0;var _0x1170fc=_0xcee8[_0x2f1f74];return _0x1170fc;};'use strict';var EventEmitter=require(_0x8cee('0x0'));var ChatWebsite=require(_0x8cee('0x1'))['db'][_0x8cee('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8cee('0x3')](0x0);var events={'afterCreate':_0x8cee('0x4'),'afterUpdate':_0x8cee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x127360){return function(_0x4e4143,_0xffd42d,_0x1ec415){ChatWebsiteEvents['emit'](_0x127360+':'+_0x4e4143['id'],_0x4e4143);ChatWebsiteEvents[_0x8cee('0x6')](_0x127360,_0x4e4143);_0x1ec415(null);};}for(var e in events){if(events[_0x8cee('0x7')](e)){var event=events[e];ChatWebsite['hook'](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 54f4594..54b84ef 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 _0x7bd5=['lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite'];(function(_0x90142b,_0x3b8e05){var _0x49d6cd=function(_0x1a72b6){while(--_0x1a72b6){_0x90142b['push'](_0x90142b['shift']());}};_0x49d6cd(++_0x3b8e05);}(_0x7bd5,0x82));var _0x57bd=function(_0x313f18,_0x317e02){_0x313f18=_0x313f18-0x0;var _0x592fbb=_0x7bd5[_0x313f18];return _0x592fbb;};'use strict';var _=require(_0x57bd('0x0'));var util=require(_0x57bd('0x1'));var logger=require('../../config/logger')(_0x57bd('0x2'));var moment=require('moment');var BPromise=require(_0x57bd('0x3'));var rp=require(_0x57bd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57bd('0x5'));var config=require(_0x57bd('0x6'));var attributes=require(_0x57bd('0x7'));module[_0x57bd('0x8')]=function(_0x4527c,_0x162094){return _0x4527c['define'](_0x57bd('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa8de=['chat_websites','util','../../config/logger','moment','bluebird','request-promise','rimraf','./chatWebsite.attributes','exports','ChatWebsite'];(function(_0x20fc79,_0x35186d){var _0x39a80e=function(_0x3c756a){while(--_0x3c756a){_0x20fc79['push'](_0x20fc79['shift']());}};_0x39a80e(++_0x35186d);}(_0xa8de,0x187));var _0xea8d=function(_0x2c4be0,_0x41af29){_0x2c4be0=_0x2c4be0-0x0;var _0xf2a3dc=_0xa8de[_0x2c4be0];return _0xf2a3dc;};'use strict';var _=require('lodash');var util=require(_0xea8d('0x0'));var logger=require(_0xea8d('0x1'))('api');var moment=require(_0xea8d('0x2'));var BPromise=require(_0xea8d('0x3'));var rp=require(_0xea8d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xea8d('0x5'));var config=require('../../config/environment');var attributes=require(_0xea8d('0x6'));module[_0xea8d('0x7')]=function(_0x540548,_0x49f1d4){return _0x540548['define'](_0xea8d('0x8'),attributes,{'tableName':_0xea8d('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 39d5508..95e0b6f 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 _0x6b25=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6b25,0xdf));var _0x56b2=function(_0x2cafdb,_0x15833a){_0x2cafdb=_0x2cafdb-0x0;var _0x4d4970=_0x6b25[_0x2cafdb];return _0x4d4970;};'use strict';var _=require(_0x56b2('0x0'));var util=require(_0x56b2('0x1'));var moment=require(_0x56b2('0x2'));var BPromise=require(_0x56b2('0x3'));var rs=require(_0x56b2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x56b2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x56b2('0x6'))(_0x56b2('0x7'));var config=require(_0x56b2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x56b2('0x9')][_0x56b2('0xa')]({'port':0x232a});config[_0x56b2('0xb')]=_[_0x56b2('0xc')](config[_0x56b2('0xb')],{'host':_0x56b2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x56b2('0xb')]));require(_0x56b2('0xe'))[_0x56b2('0xf')](socket);function respondWithRpcPromise(_0x5cfc6c,_0x66bbb2,_0xc0bf8a){return new BPromise(function(_0x344005,_0x458fbc){return client[_0x56b2('0x10')](_0x5cfc6c,_0xc0bf8a)[_0x56b2('0x11')](function(_0x5d4c9a){logger['info'](_0x56b2('0x12'),_0x66bbb2,_0x56b2('0x13'));logger[_0x56b2('0x14')](_0x56b2('0x15'),_0x66bbb2,'request\x20sent',JSON[_0x56b2('0x16')](_0x5d4c9a));if(_0x5d4c9a['error']){if(_0x5d4c9a[_0x56b2('0x17')]['code']===0x1f4){logger[_0x56b2('0x17')](_0x56b2('0x12'),_0x66bbb2,_0x5d4c9a[_0x56b2('0x17')][_0x56b2('0x18')]);return _0x458fbc(_0x5d4c9a['error'][_0x56b2('0x18')]);}logger[_0x56b2('0x17')](_0x56b2('0x12'),_0x66bbb2,_0x5d4c9a[_0x56b2('0x17')][_0x56b2('0x18')]);return _0x344005(_0x5d4c9a['error'][_0x56b2('0x18')]);}else{logger[_0x56b2('0x19')](_0x56b2('0x12'),_0x66bbb2,_0x56b2('0x13'));_0x344005(_0x5d4c9a[_0x56b2('0x1a')][_0x56b2('0x18')]);}})[_0x56b2('0x1b')](function(_0x49bcdb){logger[_0x56b2('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x66bbb2,_0x49bcdb);_0x458fbc(_0x49bcdb);});});}
\ No newline at end of file
+var _0xef27=['../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','util','bluebird','randomstring','../../mysqldb'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xef27,0x17c));var _0x7ef2=function(_0x908522,_0x37d960){_0x908522=_0x908522-0x0;var _0x50c7a8=_0xef27[_0x908522];return _0x50c7a8;};'use strict';var _=require('lodash');var util=require(_0x7ef2('0x0'));var moment=require('moment');var BPromise=require(_0x7ef2('0x1'));var rs=require(_0x7ef2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ef2('0x3'))['db'];var utils=require(_0x7ef2('0x4'));var logger=require(_0x7ef2('0x5'))(_0x7ef2('0x6'));var config=require(_0x7ef2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7ef2('0x8')]['http']({'port':0x232a});config[_0x7ef2('0x9')]=_['defaults'](config[_0x7ef2('0x9')],{'host':_0x7ef2('0xa'),'port':0x18eb});var socket=require(_0x7ef2('0xb'))(new Redis(config[_0x7ef2('0x9')]));require(_0x7ef2('0xc'))[_0x7ef2('0xd')](socket);function respondWithRpcPromise(_0x2ec3ec,_0x146eb9,_0x3d8261){return new BPromise(function(_0xc69d6c,_0xc2ff54){return client[_0x7ef2('0xe')](_0x2ec3ec,_0x3d8261)[_0x7ef2('0xf')](function(_0x44bbee){logger[_0x7ef2('0x10')](_0x7ef2('0x11'),_0x146eb9,'request\x20sent');logger[_0x7ef2('0x12')](_0x7ef2('0x13'),_0x146eb9,_0x7ef2('0x14'),JSON['stringify'](_0x44bbee));if(_0x44bbee[_0x7ef2('0x15')]){if(_0x44bbee[_0x7ef2('0x15')][_0x7ef2('0x16')]===0x1f4){logger['error'](_0x7ef2('0x11'),_0x146eb9,_0x44bbee['error'][_0x7ef2('0x17')]);return _0xc2ff54(_0x44bbee['error']['message']);}logger[_0x7ef2('0x15')](_0x7ef2('0x11'),_0x146eb9,_0x44bbee[_0x7ef2('0x15')]['message']);return _0xc69d6c(_0x44bbee[_0x7ef2('0x15')][_0x7ef2('0x17')]);}else{logger[_0x7ef2('0x10')](_0x7ef2('0x11'),_0x146eb9,_0x7ef2('0x14'));_0xc69d6c(_0x44bbee['result'][_0x7ef2('0x17')]);}})['catch'](function(_0x34392b){logger[_0x7ef2('0x15')](_0x7ef2('0x11'),_0x146eb9,_0x34392b);_0xc2ff54(_0x34392b);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index d0a03a6..b9b43f9 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 _0xa8e9=['emit','removeListener','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xa8e9,0x168));var _0x9a8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa8e9[_0x3dd15e];return _0x231fd0;};'use strict';var ChatWebsiteEvents=require(_0x9a8e('0x0'));var events=[_0x9a8e('0x1'),_0x9a8e('0x2'),_0x9a8e('0x3')];function createListener(_0x817b5d,_0x4d1176){return function(_0x519352){_0x4d1176[_0x9a8e('0x4')](_0x817b5d,_0x519352);};}function removeListener(_0x40e3e0,_0x50e862){return function(){ChatWebsiteEvents[_0x9a8e('0x5')](_0x40e3e0,_0x50e862);};}exports['register']=function(_0x40246f){for(var _0x1b0528=0x0,_0x1d2cd0=events['length'];_0x1b0528<_0x1d2cd0;_0x1b0528++){var _0xb2d343=events[_0x1b0528];var _0x4df3ef=createListener(_0x9a8e('0x6')+_0xb2d343,_0x40246f);ChatWebsiteEvents['on'](_0xb2d343,_0x4df3ef);}};
\ No newline at end of file
+var _0x0154=['removeListener','register','chatWebsite:','save','remove','update','emit'];(function(_0x594e11,_0x28f652){var _0x5418ad=function(_0x5dcfa7){while(--_0x5dcfa7){_0x594e11['push'](_0x594e11['shift']());}};_0x5418ad(++_0x28f652);}(_0x0154,0x73));var _0x4015=function(_0x35ba14,_0x31f105){_0x35ba14=_0x35ba14-0x0;var _0x102ca7=_0x0154[_0x35ba14];return _0x102ca7;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x4015('0x0'),_0x4015('0x1'),_0x4015('0x2')];function createListener(_0x53dc12,_0x5e97c6){return function(_0xcd8249){_0x5e97c6[_0x4015('0x3')](_0x53dc12,_0xcd8249);};}function removeListener(_0x5e8e7d,_0xf18edf){return function(){ChatWebsiteEvents[_0x4015('0x4')](_0x5e8e7d,_0xf18edf);};}exports[_0x4015('0x5')]=function(_0x50120f){for(var _0x1ec2ea=0x0,_0x59d2ea=events['length'];_0x1ec2ea<_0x59d2ea;_0x1ec2ea++){var _0x5d3bcc=events[_0x1ec2ea];var _0x1e326e=createListener(_0x4015('0x6')+_0x5d3bcc,_0x50120f);ChatWebsiteEvents['on'](_0x5d3bcc,_0x1e326e);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index c8b5330..af59b37 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 _0xe612=['getAnswers','/:id/logo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','addDisposition','addAnswer','diskStorage','root','%s-%s','originalname','single','addLogo','join','server/files/images/avatars/','format','now','file','addAvatar','addCustomerAvatar','addSystemAvatar','notify','attachments','offline-chat','ensureDir','replace','extname','any','offline','/:id/interactions','addInteraction','addApplications','/:id/users','addAgents','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x1c2362,_0x397a51){var _0x44300d=function(_0x309430){while(--_0x309430){_0x1c2362['push'](_0x1c2362['shift']());}};_0x44300d(++_0x397a51);}(_0xe612,0x19d));var _0x2e61=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe612[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x2e61('0x0'));var util=require(_0x2e61('0x1'));var path=require(_0x2e61('0x2'));var timeout=require(_0x2e61('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2e61('0x4'));var auth=require(_0x2e61('0x5'));var interaction=require(_0x2e61('0x6'));var config=require(_0x2e61('0x7'));var controller=require(_0x2e61('0x8'));router[_0x2e61('0x9')]('/',auth[_0x2e61('0xa')](),controller[_0x2e61('0xb')]);router[_0x2e61('0x9')](_0x2e61('0xc'),auth[_0x2e61('0xa')](),controller[_0x2e61('0xd')]);router['get'](_0x2e61('0xe'),auth[_0x2e61('0xa')](),controller[_0x2e61('0xf')]);router[_0x2e61('0x9')](_0x2e61('0x10'),auth[_0x2e61('0xa')](),controller[_0x2e61('0x11')]);router[_0x2e61('0x9')](_0x2e61('0x12'),auth[_0x2e61('0xa')](),controller[_0x2e61('0x13')]);router[_0x2e61('0x9')](_0x2e61('0x14'),controller['getLogo']);router[_0x2e61('0x9')](_0x2e61('0x15'),controller['getAvatar']);router[_0x2e61('0x9')](_0x2e61('0x16'),controller[_0x2e61('0x17')]);router[_0x2e61('0x9')](_0x2e61('0x18'),controller[_0x2e61('0x19')]);router['get']('/:id/interactions',auth[_0x2e61('0xa')](),controller[_0x2e61('0x1a')]);router['get'](_0x2e61('0x1b'),controller[_0x2e61('0x1c')]);router[_0x2e61('0x9')](_0x2e61('0x1d'),auth[_0x2e61('0xa')](),controller['getApplications']);router[_0x2e61('0x9')](_0x2e61('0x1e'),auth[_0x2e61('0xa')](),controller['getProactiveActions']);router[_0x2e61('0x9')](_0x2e61('0x1f'),controller[_0x2e61('0x20')]);router[_0x2e61('0x9')](_0x2e61('0x21'),auth[_0x2e61('0xa')](),controller[_0x2e61('0x22')]);router[_0x2e61('0x9')]('/:id/users',auth[_0x2e61('0xa')](),controller[_0x2e61('0x23')]);router[_0x2e61('0x24')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2e61('0x24')](_0x2e61('0x10'),auth[_0x2e61('0xa')](),controller[_0x2e61('0x25')]);router[_0x2e61('0x24')](_0x2e61('0x12'),auth[_0x2e61('0xa')](),controller[_0x2e61('0x26')]);var upload=multer({'storage':multer[_0x2e61('0x27')]({'destination':function(_0x1b4a4f,_0x457795,_0x558947){_0x558947(null,path['join'](config[_0x2e61('0x28')],'server/files/images/logos/'));},'filename':function(_0x11fd4f,_0x10bd67,_0x4c7232){_0x4c7232(null,util['format'](_0x2e61('0x29'),Date['now'](),_0x10bd67[_0x2e61('0x2a')]));}})});router[_0x2e61('0x24')](_0x2e61('0x14'),upload[_0x2e61('0x2b')]('file'),controller[_0x2e61('0x2c')]);var upload=multer({'storage':multer[_0x2e61('0x27')]({'destination':function(_0x993e56,_0x179661,_0x40097d){_0x40097d(null,path[_0x2e61('0x2d')](config[_0x2e61('0x28')],_0x2e61('0x2e')));},'filename':function(_0x597254,_0x4752f8,_0x3508e1){_0x3508e1(null,util[_0x2e61('0x2f')](_0x2e61('0x29'),Date[_0x2e61('0x30')](),_0x4752f8[_0x2e61('0x2a')]));}})});router[_0x2e61('0x24')]('/:id/avatar',upload[_0x2e61('0x2b')](_0x2e61('0x31')),controller[_0x2e61('0x32')]);var upload=multer({'storage':multer[_0x2e61('0x27')]({'destination':function(_0x413e77,_0x5d37f5,_0x5eae91){_0x5eae91(null,path[_0x2e61('0x2d')](config[_0x2e61('0x28')],_0x2e61('0x2e')));},'filename':function(_0x5a04dd,_0x44c1a2,_0x127e18){_0x127e18(null,util[_0x2e61('0x2f')](_0x2e61('0x29'),Date[_0x2e61('0x30')](),_0x44c1a2['originalname']));}})});router[_0x2e61('0x24')](_0x2e61('0x16'),upload['single'](_0x2e61('0x31')),controller[_0x2e61('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x314aec,_0x437d51,_0x505ff4){_0x505ff4(null,path[_0x2e61('0x2d')](config[_0x2e61('0x28')],'server/files/images/avatars/'));},'filename':function(_0x5ac3e8,_0x2146ad,_0x37a5d4){_0x37a5d4(null,util[_0x2e61('0x2f')]('%s-%s',Date[_0x2e61('0x30')](),_0x2146ad[_0x2e61('0x2a')]));}})});router[_0x2e61('0x24')](_0x2e61('0x18'),upload[_0x2e61('0x2b')]('file'),controller[_0x2e61('0x34')]);router['post']('/:id/notify',controller[_0x2e61('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x2e61('0x27')]({'destination':function(_0x2f1f2d,_0x3d77c0,_0x4528ae){const _0x15849f=path[_0x2e61('0x2d')](config['root'],'server/files',_0x2e61('0x36'),_0x2e61('0x37'));fs_extra[_0x2e61('0x38')](_0x15849f,function(){_0x4528ae(null,_0x15849f);});},'filename':function(_0x125a84,_0x2b6060,_0x5adb3b){const _0x4735d8=_0x2b6060[_0x2e61('0x2a')][_0x2e61('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2f9cbc=path[_0x2e61('0x3a')](_0x4735d8);const _0x2d6cec=Date[_0x2e61('0x30')]()+'-'+_0x4735d8[_0x2e61('0x39')](_0x2f9cbc,'')+_0x2f9cbc;_0x5adb3b(null,_0x2d6cec);}})});router[_0x2e61('0x24')]('/:id/offline',offlineUploadMulter[_0x2e61('0x3b')](),controller[_0x2e61('0x3c')]);router['post'](_0x2e61('0x3d'),auth[_0x2e61('0xa')](),controller[_0x2e61('0x3e')]);router['post'](_0x2e61('0x1d'),auth[_0x2e61('0xa')](),controller[_0x2e61('0x3f')]);router['post']('/:id/proactive_actions',auth[_0x2e61('0xa')](),controller['addProactiveActions']);router[_0x2e61('0x24')](_0x2e61('0x40'),auth['isAuthenticated'](),controller[_0x2e61('0x41')]);router[_0x2e61('0x42')](_0x2e61('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x2e61('0x43')](_0x2e61('0xe'),auth['isAuthenticated'](),controller[_0x2e61('0x44')]);router[_0x2e61('0x43')](_0x2e61('0x10'),auth['isAuthenticated'](),controller[_0x2e61('0x45')]);router[_0x2e61('0x43')](_0x2e61('0x12'),auth[_0x2e61('0xa')](),controller[_0x2e61('0x46')]);router['delete'](_0x2e61('0x40'),auth[_0x2e61('0xa')](),controller[_0x2e61('0x47')]);module['exports']=router;
\ No newline at end of file
+var _0x633f=['destroy','/:id/dispositions','removeDispositions','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','getOfflineMessages','/:id/users','create','post','addDisposition','addAnswer','join','format','%s-%s','now','originalname','single','addLogo','diskStorage','server/files/images/avatars/','/:id/avatar','file','addAvatar','addCustomerAvatar','/:id/notify','notify','root','server/files','offline-chat','ensureDir','replace','any','offline','/:id/interactions','/:id/applications','addApplications','addProactiveActions','addAgents','put','update','delete'];(function(_0x485de1,_0x5df409){var _0x53647e=function(_0x4f4f2d){while(--_0x4f4f2d){_0x485de1['push'](_0x485de1['shift']());}};_0x53647e(++_0x5df409);}(_0x633f,0x8d));var _0xf633=function(_0x3aa6c9,_0x498f87){_0x3aa6c9=_0x3aa6c9-0x0;var _0x4e48a7=_0x633f[_0x3aa6c9];return _0x4e48a7;};'use strict';var multer=require(_0xf633('0x0'));var util=require(_0xf633('0x1'));var path=require(_0xf633('0x2'));var timeout=require('connect-timeout');var express=require(_0xf633('0x3'));var router=express['Router']();var fs_extra=require(_0xf633('0x4'));var auth=require(_0xf633('0x5'));var interaction=require(_0xf633('0x6'));var config=require(_0xf633('0x7'));var controller=require(_0xf633('0x8'));router[_0xf633('0x9')]('/',auth[_0xf633('0xa')](),controller[_0xf633('0xb')]);router[_0xf633('0x9')]('/describe',auth[_0xf633('0xa')](),controller[_0xf633('0xc')]);router[_0xf633('0x9')](_0xf633('0xd'),auth[_0xf633('0xa')](),controller['show']);router[_0xf633('0x9')]('/:id/dispositions',auth[_0xf633('0xa')](),controller['getDispositions']);router[_0xf633('0x9')]('/:id/canned_answers',auth[_0xf633('0xa')](),controller[_0xf633('0xe')]);router['get'](_0xf633('0xf'),controller[_0xf633('0x10')]);router['get']('/:id/avatar',controller[_0xf633('0x11')]);router['get'](_0xf633('0x12'),controller[_0xf633('0x13')]);router[_0xf633('0x9')](_0xf633('0x14'),controller[_0xf633('0x15')]);router[_0xf633('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xf633('0x16')]);router['get']('/:id/snippet',controller[_0xf633('0x17')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0xf633('0x9')](_0xf633('0x18'),auth[_0xf633('0xa')](),controller[_0xf633('0x19')]);router['get']('/:id/fields',controller['getFields']);router[_0xf633('0x9')](_0xf633('0x1a'),auth[_0xf633('0xa')](),controller[_0xf633('0x1b')]);router['get'](_0xf633('0x1c'),auth[_0xf633('0xa')](),controller['getAgents']);router['post']('/',auth[_0xf633('0xa')](),controller[_0xf633('0x1d')]);router[_0xf633('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf633('0x1f')]);router[_0xf633('0x1e')]('/:id/canned_answers',auth[_0xf633('0xa')](),controller[_0xf633('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x127948,_0x81c529,_0x4fd86d){_0x4fd86d(null,path[_0xf633('0x21')](config['root'],'server/files/images/logos/'));},'filename':function(_0x1d0a36,_0x1a3e4d,_0x190c51){_0x190c51(null,util[_0xf633('0x22')](_0xf633('0x23'),Date[_0xf633('0x24')](),_0x1a3e4d[_0xf633('0x25')]));}})});router[_0xf633('0x1e')]('/:id/logo',upload[_0xf633('0x26')]('file'),controller[_0xf633('0x27')]);var upload=multer({'storage':multer[_0xf633('0x28')]({'destination':function(_0x8db2b2,_0x37487d,_0x1e824b){_0x1e824b(null,path['join'](config['root'],_0xf633('0x29')));},'filename':function(_0x4eb597,_0x11cd60,_0x46e7b4){_0x46e7b4(null,util['format'](_0xf633('0x23'),Date[_0xf633('0x24')](),_0x11cd60[_0xf633('0x25')]));}})});router['post'](_0xf633('0x2a'),upload[_0xf633('0x26')](_0xf633('0x2b')),controller[_0xf633('0x2c')]);var upload=multer({'storage':multer[_0xf633('0x28')]({'destination':function(_0x4886bb,_0x9a89d0,_0x40fa7c){_0x40fa7c(null,path[_0xf633('0x21')](config['root'],_0xf633('0x29')));},'filename':function(_0x207696,_0x37a37d,_0x5c2eff){_0x5c2eff(null,util[_0xf633('0x22')](_0xf633('0x23'),Date[_0xf633('0x24')](),_0x37a37d[_0xf633('0x25')]));}})});router[_0xf633('0x1e')](_0xf633('0x12'),upload[_0xf633('0x26')](_0xf633('0x2b')),controller[_0xf633('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x395754,_0x386b41,_0x52bbcc){_0x52bbcc(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x593f30,_0xb65ebd,_0x568182){_0x568182(null,util[_0xf633('0x22')](_0xf633('0x23'),Date[_0xf633('0x24')](),_0xb65ebd['originalname']));}})});router[_0xf633('0x1e')](_0xf633('0x14'),upload['single'](_0xf633('0x2b')),controller['addSystemAvatar']);router[_0xf633('0x1e')](_0xf633('0x2e'),controller[_0xf633('0x2f')]);const offlineUploadMulter=multer({'storage':multer[_0xf633('0x28')]({'destination':function(_0x514b42,_0x33caec,_0x41a471){const _0x597b5c=path[_0xf633('0x21')](config[_0xf633('0x30')],_0xf633('0x31'),'attachments',_0xf633('0x32'));fs_extra[_0xf633('0x33')](_0x597b5c,function(){_0x41a471(null,_0x597b5c);});},'filename':function(_0x10e589,_0x3632f9,_0x157d2c){const _0x5a0c8b=_0x3632f9[_0xf633('0x25')][_0xf633('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x12341b=path['extname'](_0x5a0c8b);const _0x29e94d=Date[_0xf633('0x24')]()+'-'+_0x5a0c8b[_0xf633('0x34')](_0x12341b,'')+_0x12341b;_0x157d2c(null,_0x29e94d);}})});router['post']('/:id/offline',offlineUploadMulter[_0xf633('0x35')](),controller[_0xf633('0x36')]);router[_0xf633('0x1e')](_0xf633('0x37'),auth[_0xf633('0xa')](),controller['addInteraction']);router[_0xf633('0x1e')](_0xf633('0x38'),auth['isAuthenticated'](),controller[_0xf633('0x39')]);router[_0xf633('0x1e')](_0xf633('0x18'),auth[_0xf633('0xa')](),controller[_0xf633('0x3a')]);router[_0xf633('0x1e')](_0xf633('0x1c'),auth[_0xf633('0xa')](),controller[_0xf633('0x3b')]);router[_0xf633('0x3c')](_0xf633('0xd'),auth['isAuthenticated'](),controller[_0xf633('0x3d')]);router[_0xf633('0x3e')](_0xf633('0xd'),auth[_0xf633('0xa')](),controller[_0xf633('0x3f')]);router[_0xf633('0x3e')](_0xf633('0x40'),auth[_0xf633('0xa')](),controller[_0xf633('0x41')]);router[_0xf633('0x3e')]('/:id/canned_answers',auth[_0xf633('0xa')](),controller['removeAnswers']);router[_0xf633('0x3e')](_0xf633('0x1c'),auth[_0xf633('0xa')](),controller[_0xf633('0x42')]);module[_0xf633('0x43')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 372641f..dee79b5 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9423=['use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x4f95f8,_0xb3da1b){var _0x3b41ec=function(_0x3fb5f1){while(--_0x3fb5f1){_0x4f95f8['push'](_0x4f95f8['shift']());}};_0x3b41ec(++_0xb3da1b);}(_0x9423,0x1e3));var _0x3942=function(_0x14e366,_0x5177ce){_0x14e366=_0x14e366-0x0;var _0x52c7ff=_0x9423[_0x14e366];return _0x52c7ff;};var beaverLogger=require(_0x3942('0x0'));var express=require('express');var auth=require(_0x3942('0x1'));var config=require(_0x3942('0x2'));var router=express[_0x3942('0x3')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x1b996b,_0x748db,_0x2212c4){var _0x46f013=_0x1b996b[_0x3942('0x4')]['get'](_0x3942('0x5'));if(!_0x46f013){throw new Error(_0x3942('0x6'));}return beaverLogger[_0x3942('0x7')]({'uri':_0x3942('0x8'),'logger':_0x46f013,'enableCors':!isProduction})(_0x1b996b,_0x748db,_0x2212c4);}router[_0x3942('0x9')](auth[_0x3942('0xa')](),clientSideLogs);module[_0x3942('0xb')]=router;
\ No newline at end of file
+var _0x3c93=['production','app','get','Client-Side\x20logger\x20not\x20found!','/client-logs','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','env'];(function(_0x4f454d,_0x23628e){var _0x3b260=function(_0x19d6f6){while(--_0x19d6f6){_0x4f454d['push'](_0x4f454d['shift']());}};_0x3b260(++_0x23628e);}(_0x3c93,0x1c3));var _0x33c9=function(_0x2e58fe,_0x1bb5c3){_0x2e58fe=_0x2e58fe-0x0;var _0x2f297e=_0x3c93[_0x2e58fe];return _0x2f297e;};var beaverLogger=require(_0x33c9('0x0'));var express=require(_0x33c9('0x1'));var auth=require(_0x33c9('0x2'));var config=require(_0x33c9('0x3'));var router=express['Router']();var isProduction=config[_0x33c9('0x4')]===_0x33c9('0x5')||![];function clientSideLogs(_0x5bc320,_0x5e6b1b,_0x1ac6de){var _0x1d0944=_0x5bc320[_0x33c9('0x6')][_0x33c9('0x7')]('client-side-logger');if(!_0x1d0944){throw new Error(_0x33c9('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0x33c9('0x9'),'logger':_0x1d0944,'enableCors':!isProduction})(_0x5bc320,_0x5e6b1b,_0x1ac6de);}router['use'](auth[_0x33c9('0xa')](),clientSideLogs);module[_0x33c9('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 47acc00..21bea80 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 _0x8ea7=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x3d92cb,_0x11aa36){var _0x50026d=function(_0x43df54){while(--_0x43df54){_0x3d92cb['push'](_0x3d92cb['shift']());}};_0x50026d(++_0x11aa36);}(_0x8ea7,0x19e));var _0x78ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x78ea('0x0'));module[_0x78ea('0x1')]={'name':{'type':Sequelize[_0x78ea('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x78ea('0x3')](_0x78ea('0x4'),_0x78ea('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x78ea('0x3')](_0x78ea('0x6'),_0x78ea('0x7'))},'data1':{'type':Sequelize[_0x78ea('0x2')],'comment':_0x78ea('0x8')},'data2':{'type':Sequelize[_0x78ea('0x2')],'comment':_0x78ea('0x9')},'data3':{'type':Sequelize[_0x78ea('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x78ea('0x2')],'comment':_0x78ea('0xa')},'data5':{'type':Sequelize[_0x78ea('0xb')],'comment':_0x78ea('0xc')},'data6':{'type':Sequelize[_0x78ea('0xb')],'comment':_0x78ea('0xd')},'data7':{'type':Sequelize[_0x78ea('0xb')],'comment':_0x78ea('0xe')}};
\ No newline at end of file
+var _0x38fc=['TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x1f8f66,_0x5dc25a){var _0x3b992d=function(_0x25dadb){while(--_0x25dadb){_0x1f8f66['push'](_0x1f8f66['shift']());}};_0x3b992d(++_0x5dc25a);}(_0x38fc,0xb7));var _0xc38f=function(_0x27e43d,_0x3841bf){_0x27e43d=_0x27e43d-0x0;var _0xaa45f2=_0x38fc[_0x27e43d];return _0xaa45f2;};'use strict';var Sequelize=require(_0xc38f('0x0'));module[_0xc38f('0x1')]={'name':{'type':Sequelize[_0xc38f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xc38f('0x3'),_0xc38f('0x4'),_0xc38f('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xc38f('0x6')](_0xc38f('0x7'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0xc38f('0x8')},'data2':{'type':Sequelize[_0xc38f('0x2')],'comment':_0xc38f('0x9')},'data3':{'type':Sequelize['STRING'],'comment':_0xc38f('0xa')},'data4':{'type':Sequelize[_0xc38f('0x2')],'comment':_0xc38f('0xb')},'data5':{'type':Sequelize[_0xc38f('0xc')],'comment':_0xc38f('0xd')},'data6':{'type':Sequelize[_0xc38f('0xc')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xc38f('0xc')],'comment':_0xc38f('0xe')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index a398fbd..dd4ba99 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 _0xf0f6=['data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','update','then','destroy','name','padEnd','slice','CloudProvider','fieldName','type','model','map','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','merge','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','rawAttributes','length','options','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error','state','Invalid\x20state\x20parameter','parse','from','toString','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code'];(function(_0x35c2fc,_0xabea37){var _0x4727fd=function(_0x4eccfe){while(--_0x4eccfe){_0x35c2fc['push'](_0x35c2fc['shift']());}};_0x4727fd(++_0xabea37);}(_0xf0f6,0x1db));var _0x6f0f=function(_0x2685da,_0x3c928b){_0x2685da=_0x2685da-0x0;var _0x3b43f5=_0xf0f6[_0x2685da];return _0x3b43f5;};'use strict';var _=require(_0x6f0f('0x0'));var Redis=require(_0x6f0f('0x1'));var qs=require(_0x6f0f('0x2'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require('../../config/logger')(_0x6f0f('0x3'));var db=require(_0x6f0f('0x4'))['db'];var oauth=require(_0x6f0f('0x5'));config[_0x6f0f('0x6')]=_[_0x6f0f('0x7')](config[_0x6f0f('0x6')],{'host':_0x6f0f('0x8'),'port':0x18eb});var socket=require(_0x6f0f('0x9'))(new Redis(config[_0x6f0f('0x6')]));var redis=new Redis(config[_0x6f0f('0x6')]);function respondWithStatusCode(_0x54648a,_0x1e0fae){_0x1e0fae=_0x1e0fae||0xcc;return function(_0x33b0ab){if(_0x33b0ab){return _0x54648a[_0x6f0f('0xa')](_0x1e0fae);}return _0x54648a['status'](_0x1e0fae)[_0x6f0f('0xb')]();};}function respondWithResult(_0x177cb5,_0xfbf9ec){_0xfbf9ec=_0xfbf9ec||0xc8;return function(_0x291767){if(_0x291767){return _0x177cb5[_0x6f0f('0xc')](_0xfbf9ec)[_0x6f0f('0xd')](_0x291767);}};}function respondWithFilteredResult(_0x2b4e07,_0x409680){return function(_0x6010fa){if(_0x6010fa){var _0x3e41d6=typeof _0x409680[_0x6f0f('0xe')]==='undefined'&&typeof _0x409680['limit']===_0x6f0f('0xf');var _0x2c7c9b=_0x6010fa['count'];var _0x3edcbd=_0x3e41d6?0x0:_0x409680[_0x6f0f('0xe')];var _0x38b5fb=_0x3e41d6?_0x6010fa[_0x6f0f('0x10')]:_0x409680['offset']+_0x409680[_0x6f0f('0x11')];var _0x278ca3;if(_0x38b5fb>=_0x2c7c9b){_0x38b5fb=_0x2c7c9b;_0x278ca3=0xc8;}else{_0x278ca3=0xce;}_0x2b4e07[_0x6f0f('0xc')](_0x278ca3);return _0x2b4e07['set'](_0x6f0f('0x12'),_0x3edcbd+'-'+_0x38b5fb+'/'+_0x2c7c9b)[_0x6f0f('0xd')](_0x6010fa);}return null;};}function saveUpdates(_0x4ac85c){return function(_0x1d00c2){if(_0x1d00c2){return _0x1d00c2[_0x6f0f('0x13')](_0x4ac85c)[_0x6f0f('0x14')](function(_0x31b890){return _0x31b890;});}return null;};}function removeEntity(_0x20c560){return function(_0x5caa97){if(_0x5caa97){return _0x5caa97[_0x6f0f('0x15')]()[_0x6f0f('0x14')](function(){_0x20c560[_0x6f0f('0xc')](0xcc)[_0x6f0f('0xb')]();});}};}function handleEntityNotFound(_0x39f20f){return function(_0x1e1ce4){if(!_0x1e1ce4){_0x39f20f[_0x6f0f('0xa')](0x194);}return _0x1e1ce4;};}function handleError(_0x4dbc2f,_0x13ad64){_0x13ad64=_0x13ad64||0x1f4;return function(_0x53974a){logger['error'](_0x53974a['stack']);if(_0x53974a[_0x6f0f('0x16')]){delete _0x53974a['name'];}_0x4dbc2f['status'](_0x13ad64)['send'](_0x53974a);};}function maskClientSecret(_0x2614fe){return _[_0x6f0f('0x17')](_0x2614fe[_0x6f0f('0x18')](0x0,0x3),0x14,'*');}exports['index']=function(_0x36666d,_0x4df79){var _0x160a4e={},_0x4e327f={},_0x497f4f={'count':0x0,'rows':[]};var _0x34dac4=_['map'](db[_0x6f0f('0x19')]['rawAttributes'],function(_0xb1d805){return{'name':_0xb1d805[_0x6f0f('0x1a')],'type':_0xb1d805[_0x6f0f('0x1b')]['key']};});_0x4e327f[_0x6f0f('0x1c')]=_[_0x6f0f('0x1d')](_0x34dac4,'name');_0x4e327f['query']=_[_0x6f0f('0x1e')](_0x36666d['query']);_0x4e327f['filters']=_[_0x6f0f('0x1f')](_0x4e327f[_0x6f0f('0x1c')],_0x4e327f[_0x6f0f('0x20')]);_0x160a4e[_0x6f0f('0x21')]=_['intersection'](_0x4e327f[_0x6f0f('0x1c')],qs[_0x6f0f('0x22')](_0x36666d[_0x6f0f('0x20')]['fields']));_0x160a4e['attributes']=_0x160a4e['attributes']['length']?_0x160a4e['attributes']:_0x4e327f[_0x6f0f('0x1c')];if(!_0x36666d['query'][_0x6f0f('0x23')](_0x6f0f('0x24'))){_0x160a4e[_0x6f0f('0x11')]=qs['limit'](_0x36666d[_0x6f0f('0x20')]['limit']);_0x160a4e[_0x6f0f('0xe')]=qs[_0x6f0f('0xe')](_0x36666d['query'][_0x6f0f('0xe')]);}_0x160a4e[_0x6f0f('0x25')]=qs['sort'](_0x36666d[_0x6f0f('0x20')][_0x6f0f('0x26')]);_0x160a4e[_0x6f0f('0x27')]=qs['filters'](_['pick'](_0x36666d[_0x6f0f('0x20')],_0x4e327f[_0x6f0f('0x28')]),_0x34dac4);if(_0x36666d['query']['filter']){_0x160a4e['where']=_['merge'](_0x160a4e[_0x6f0f('0x27')],{'$or':_[_0x6f0f('0x1d')](_0x34dac4,function(_0x4ccb42){if(_0x4ccb42['type']!==_0x6f0f('0x29')){var _0x2256c8={};_0x2256c8[_0x4ccb42[_0x6f0f('0x16')]]={'$like':'%'+_0x36666d[_0x6f0f('0x20')]['filter']+'%'};return _0x2256c8;}})});}_0x160a4e=_[_0x6f0f('0x2a')]({},_0x160a4e,_0x36666d['options']);var _0x3ba548={'where':_0x160a4e[_0x6f0f('0x27')]};return db[_0x6f0f('0x19')][_0x6f0f('0x10')](_0x3ba548)[_0x6f0f('0x14')](function(_0x31f981){_0x497f4f[_0x6f0f('0x10')]=_0x31f981;if(_0x36666d['query'][_0x6f0f('0x2b')]){_0x160a4e[_0x6f0f('0x2c')]=[{'all':!![]}];}return db[_0x6f0f('0x19')][_0x6f0f('0x2d')](_0x160a4e);})[_0x6f0f('0x14')](function(_0x23f51a){_0x497f4f[_0x6f0f('0x2e')]=_['map'](_0x23f51a,function(_0x57325e){if(_0x57325e[_0x6f0f('0x2f')]===_0x6f0f('0x30')){var _0x21e5de=encryptor[_0x6f0f('0x31')](_0x57325e['data3']);_0x57325e[_0x6f0f('0x32')]=maskClientSecret(_0x21e5de);}return _0x57325e;});return _0x497f4f;})[_0x6f0f('0x14')](respondWithFilteredResult(_0x4df79,_0x160a4e))[_0x6f0f('0x33')](handleError(_0x4df79,null));};exports[_0x6f0f('0x34')]=function(_0x33ae08,_0x2f2bff){var _0x4080d2={'raw':!![],'where':{'id':_0x33ae08[_0x6f0f('0x35')]['id']}},_0x12e19d={};_0x12e19d[_0x6f0f('0x1c')]=_['keys'](db[_0x6f0f('0x19')][_0x6f0f('0x36')]);_0x12e19d['query']=_[_0x6f0f('0x1e')](_0x33ae08[_0x6f0f('0x20')]);_0x12e19d['filters']=_[_0x6f0f('0x1f')](_0x12e19d['model'],_0x12e19d[_0x6f0f('0x20')]);_0x4080d2[_0x6f0f('0x21')]=_[_0x6f0f('0x1f')](_0x12e19d['model'],qs[_0x6f0f('0x22')](_0x33ae08[_0x6f0f('0x20')][_0x6f0f('0x22')]));_0x4080d2['attributes']=_0x4080d2[_0x6f0f('0x21')][_0x6f0f('0x37')]?_0x4080d2[_0x6f0f('0x21')]:_0x12e19d[_0x6f0f('0x1c')];if(_0x33ae08[_0x6f0f('0x20')][_0x6f0f('0x2b')]){_0x4080d2[_0x6f0f('0x2c')]=[{'all':!![]}];}_0x4080d2=_[_0x6f0f('0x2a')]({},_0x4080d2,_0x33ae08[_0x6f0f('0x38')]);return db[_0x6f0f('0x19')][_0x6f0f('0x39')](_0x4080d2)['then'](handleEntityNotFound(_0x2f2bff,null))[_0x6f0f('0x14')](function(_0x5e386a){if(_0x5e386a[_0x6f0f('0x2f')]===_0x6f0f('0x30')){var _0x2246d4=encryptor['decryptString'](_0x5e386a[_0x6f0f('0x32')]);_0x5e386a[_0x6f0f('0x32')]=maskClientSecret(_0x2246d4);}return _0x5e386a;})[_0x6f0f('0x14')](respondWithResult(_0x2f2bff,null))[_0x6f0f('0x33')](handleError(_0x2f2bff,null));};exports[_0x6f0f('0x3a')]=function(_0x1c11e3,_0x3ae2d1){if(!_0x1c11e3[_0x6f0f('0x3b')][_0x6f0f('0x16')])throw new Error(_0x6f0f('0x3c'));if(!_0x1c11e3['body']['service'])throw new Error(_0x6f0f('0x3d'));var _0x504d05=db[_0x6f0f('0x19')][_0x6f0f('0x36')]['service'][_0x6f0f('0x3e')];if(!_0x504d05[_0x6f0f('0x3f')](_0x1c11e3['body'][_0x6f0f('0x2f')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x504d05[_0x6f0f('0x40')](',\x20'));if(_0x1c11e3['body'][_0x6f0f('0x2f')]===_0x6f0f('0x30')&&_0x1c11e3['body']['data3']){_0x1c11e3[_0x6f0f('0x3b')][_0x6f0f('0x32')]=encryptor['encryptString'](_0x1c11e3[_0x6f0f('0x3b')]['data3']);}return db[_0x6f0f('0x19')][_0x6f0f('0x3a')](_0x1c11e3[_0x6f0f('0x3b')],{})[_0x6f0f('0x14')](respondWithResult(_0x3ae2d1,0xc9))[_0x6f0f('0x33')](handleError(_0x3ae2d1,null));};exports['update']=function(_0x2cc512,_0x56f4f8){if(_0x2cc512['body']['id']){delete _0x2cc512[_0x6f0f('0x3b')]['id'];}return db['CloudProvider'][_0x6f0f('0x39')]({'where':{'id':_0x2cc512[_0x6f0f('0x35')]['id']}})[_0x6f0f('0x14')](handleEntityNotFound(_0x56f4f8,null))[_0x6f0f('0x14')](function(_0x39640f){if(_0x39640f['service']==='MicrosoftAzure'&&_0x2cc512['body'][_0x6f0f('0x32')]){_0x2cc512['body'][_0x6f0f('0x32')]=encryptor[_0x6f0f('0x41')](_0x2cc512[_0x6f0f('0x3b')][_0x6f0f('0x32')]);}return _0x39640f;})[_0x6f0f('0x14')](saveUpdates(_0x2cc512[_0x6f0f('0x3b')],null))[_0x6f0f('0x14')](respondWithResult(_0x56f4f8,null))[_0x6f0f('0x33')](handleError(_0x56f4f8,null));};exports[_0x6f0f('0x15')]=function(_0x5d5705,_0x4ca897){return db[_0x6f0f('0x19')][_0x6f0f('0x39')]({'where':{'id':_0x5d5705[_0x6f0f('0x35')]['id']}})[_0x6f0f('0x14')](handleEntityNotFound(_0x4ca897,null))['then'](removeEntity(_0x4ca897,null))['catch'](handleError(_0x4ca897,null));};exports[_0x6f0f('0x42')]=function(_0x3d2daf,_0x25ee49){return db[_0x6f0f('0x19')][_0x6f0f('0x43')]({'where':{'id':_0x3d2daf['params']['id']},'raw':!![]})['then'](function(_0x5abf2f){if(!_0x5abf2f)return _0x25ee49[_0x6f0f('0xa')](0x194);return{'url':oauth[_0x6f0f('0x44')](_0x5abf2f,_0x3d2daf['user']['id'])};})[_0x6f0f('0x14')](respondWithResult(_0x25ee49,null))[_0x6f0f('0x33')](handleError(_0x25ee49,null));};exports[_0x6f0f('0x45')]=function(_0x2230c4,_0x2a561a){var _0x631492=_0x2230c4[_0x6f0f('0x3b')];var _0x305c48;var _0x518739;if(_0x631492[_0x6f0f('0x46')])throw _0x631492;redis['get'](_0x631492[_0x6f0f('0x47')])[_0x6f0f('0x14')](function(_0x37cac8){if(!_0x37cac8)throw new Error(_0x6f0f('0x48'));_0x305c48=JSON[_0x6f0f('0x49')](_0x37cac8);var _0x5db4ad=Buffer[_0x6f0f('0x4a')](_0x631492['state'],'base64')[_0x6f0f('0x4b')]('ascii');_0x518739=JSON[_0x6f0f('0x49')](_0x5db4ad);if(!oauth[_0x6f0f('0x4c')](_0x631492[_0x6f0f('0x4d')],_0x305c48[_0x6f0f('0x4e')]))throw new Error(_0x6f0f('0x4f'));redis[_0x6f0f('0x50')](_0x631492[_0x6f0f('0x47')]);return oauth[_0x6f0f('0x51')](_0x631492[_0x6f0f('0x52')],_0x305c48);})[_0x6f0f('0x14')](function(_0x160301){_0x305c48[_0x6f0f('0x53')]=_0x160301[_0x6f0f('0x54')];_0x305c48[_0x6f0f('0x55')]=_0x160301[_0x6f0f('0x56')];return db[_0x6f0f('0x19')][_0x6f0f('0x13')]({'data5':_0x305c48[_0x6f0f('0x53')],'data6':_0x305c48[_0x6f0f('0x55')]},{'where':{'id':_0x305c48['id']}});})['then'](function(){oauth[_0x6f0f('0x57')](_0x305c48);socket[_0x6f0f('0x58')]('microsoftAuthorization:success',{'id':_0x518739['id']});return;})['then'](respondWithStatusCode(_0x2a561a,null))[_0x6f0f('0x33')](function(_0x24ba77){if(_0x518739){socket[_0x6f0f('0x58')](_0x6f0f('0x59'),{'id':_0x518739['id']});}if(!_0x305c48){logger[_0x6f0f('0x46')]('Invalid\x20authentication\x20state\x20parameter',_0x24ba77);return _0x2a561a[_0x6f0f('0xc')](0x1f4)['send'](_0x24ba77[_0x6f0f('0x5a')]);}logger[_0x6f0f('0x46')](_0x6f0f('0x5b'),_0x305c48['id'],JSON[_0x6f0f('0x5c')](_0x24ba77));});};
\ No newline at end of file
+var _0x25c3=['parse','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','microsoftAuthorization:success','emit','microsoftAuthorization:error','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','socket.io-emitter','redis','status','end','json','offset','undefined','limit','count','set','update','then','sendStatus','error','name','send','index','CloudProvider','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','rows','MicrosoftAzure','data3','catch','show','params','keys','length','includeAll','options','service','decryptString','create','body','Name\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter'];(function(_0x292456,_0x9a9d5){var _0x2e4bfe=function(_0x3a4584){while(--_0x3a4584){_0x292456['push'](_0x292456['shift']());}};_0x2e4bfe(++_0x9a9d5);}(_0x25c3,0xd0));var _0x325c=function(_0x445908,_0x106a15){_0x445908=_0x445908-0x0;var _0x37da57=_0x25c3[_0x445908];return _0x37da57;};'use strict';var _=require(_0x325c('0x0'));var Redis=require(_0x325c('0x1'));var qs=require(_0x325c('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x325c('0x3'));var logger=require(_0x325c('0x4'))(_0x325c('0x5'));var db=require(_0x325c('0x6'))['db'];var oauth=require(_0x325c('0x7'));config['redis']=_[_0x325c('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x325c('0x9'))(new Redis(config[_0x325c('0xa')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x3d0af6,_0x20fe50){_0x20fe50=_0x20fe50||0xcc;return function(_0xe4b9a5){if(_0xe4b9a5){return _0x3d0af6['sendStatus'](_0x20fe50);}return _0x3d0af6[_0x325c('0xb')](_0x20fe50)[_0x325c('0xc')]();};}function respondWithResult(_0x316aac,_0xee9709){_0xee9709=_0xee9709||0xc8;return function(_0x10a55d){if(_0x10a55d){return _0x316aac[_0x325c('0xb')](_0xee9709)[_0x325c('0xd')](_0x10a55d);}};}function respondWithFilteredResult(_0x5e1d44,_0x39b41e){return function(_0x874b7c){if(_0x874b7c){var _0x3959f9=typeof _0x39b41e[_0x325c('0xe')]===_0x325c('0xf')&&typeof _0x39b41e[_0x325c('0x10')]===_0x325c('0xf');var _0x22ab65=_0x874b7c[_0x325c('0x11')];var _0x2da61a=_0x3959f9?0x0:_0x39b41e[_0x325c('0xe')];var _0x2f3b80=_0x3959f9?_0x874b7c[_0x325c('0x11')]:_0x39b41e[_0x325c('0xe')]+_0x39b41e[_0x325c('0x10')];var _0x212291;if(_0x2f3b80>=_0x22ab65){_0x2f3b80=_0x22ab65;_0x212291=0xc8;}else{_0x212291=0xce;}_0x5e1d44[_0x325c('0xb')](_0x212291);return _0x5e1d44[_0x325c('0x12')]('Content-Range',_0x2da61a+'-'+_0x2f3b80+'/'+_0x22ab65)[_0x325c('0xd')](_0x874b7c);}return null;};}function saveUpdates(_0x47b12f){return function(_0x4be8ec){if(_0x4be8ec){return _0x4be8ec[_0x325c('0x13')](_0x47b12f)[_0x325c('0x14')](function(_0x54d2d4){return _0x54d2d4;});}return null;};}function removeEntity(_0xda5727){return function(_0x4b07d3){if(_0x4b07d3){return _0x4b07d3['destroy']()[_0x325c('0x14')](function(){_0xda5727[_0x325c('0xb')](0xcc)[_0x325c('0xc')]();});}};}function handleEntityNotFound(_0x372155){return function(_0xb1f22f){if(!_0xb1f22f){_0x372155[_0x325c('0x15')](0x194);}return _0xb1f22f;};}function handleError(_0x3de9fa,_0x5dfbde){_0x5dfbde=_0x5dfbde||0x1f4;return function(_0x396e7c){logger[_0x325c('0x16')](_0x396e7c['stack']);if(_0x396e7c[_0x325c('0x17')]){delete _0x396e7c[_0x325c('0x17')];}_0x3de9fa[_0x325c('0xb')](_0x5dfbde)[_0x325c('0x18')](_0x396e7c);};}function maskClientSecret(_0x3c458f){return _['padEnd'](_0x3c458f['slice'](0x0,0x3),0x14,'*');}exports[_0x325c('0x19')]=function(_0x326d69,_0x5a741b){var _0x3d28a5={},_0x184841={},_0x599936={'count':0x0,'rows':[]};var _0x5777eb=_['map'](db[_0x325c('0x1a')][_0x325c('0x1b')],function(_0x40485c){return{'name':_0x40485c[_0x325c('0x1c')],'type':_0x40485c['type'][_0x325c('0x1d')]};});_0x184841[_0x325c('0x1e')]=_[_0x325c('0x1f')](_0x5777eb,_0x325c('0x17'));_0x184841[_0x325c('0x20')]=_['keys'](_0x326d69[_0x325c('0x20')]);_0x184841[_0x325c('0x21')]=_[_0x325c('0x22')](_0x184841[_0x325c('0x1e')],_0x184841['query']);_0x3d28a5['attributes']=_[_0x325c('0x22')](_0x184841[_0x325c('0x1e')],qs[_0x325c('0x23')](_0x326d69[_0x325c('0x20')]['fields']));_0x3d28a5['attributes']=_0x3d28a5['attributes']['length']?_0x3d28a5[_0x325c('0x24')]:_0x184841[_0x325c('0x1e')];if(!_0x326d69[_0x325c('0x20')]['hasOwnProperty']('nolimit')){_0x3d28a5[_0x325c('0x10')]=qs['limit'](_0x326d69['query']['limit']);_0x3d28a5[_0x325c('0xe')]=qs[_0x325c('0xe')](_0x326d69[_0x325c('0x20')][_0x325c('0xe')]);}_0x3d28a5[_0x325c('0x25')]=qs[_0x325c('0x26')](_0x326d69[_0x325c('0x20')]['sort']);_0x3d28a5[_0x325c('0x27')]=qs[_0x325c('0x21')](_[_0x325c('0x28')](_0x326d69['query'],_0x184841['filters']),_0x5777eb);if(_0x326d69[_0x325c('0x20')][_0x325c('0x29')]){_0x3d28a5[_0x325c('0x27')]=_[_0x325c('0x2a')](_0x3d28a5['where'],{'$or':_[_0x325c('0x1f')](_0x5777eb,function(_0x1449b8){if(_0x1449b8[_0x325c('0x2b')]!==_0x325c('0x2c')){var _0x4313ff={};_0x4313ff[_0x1449b8[_0x325c('0x17')]]={'$like':'%'+_0x326d69['query'][_0x325c('0x29')]+'%'};return _0x4313ff;}})});}_0x3d28a5=_[_0x325c('0x2a')]({},_0x3d28a5,_0x326d69['options']);var _0x676cfe={'where':_0x3d28a5[_0x325c('0x27')]};return db[_0x325c('0x1a')][_0x325c('0x11')](_0x676cfe)[_0x325c('0x14')](function(_0x4c4c1c){_0x599936[_0x325c('0x11')]=_0x4c4c1c;if(_0x326d69['query']['includeAll']){_0x3d28a5[_0x325c('0x2d')]=[{'all':!![]}];}return db[_0x325c('0x1a')][_0x325c('0x2e')](_0x3d28a5);})['then'](function(_0x2b6c3a){_0x599936[_0x325c('0x2f')]=_['map'](_0x2b6c3a,function(_0x3b259e){if(_0x3b259e['service']===_0x325c('0x30')){var _0x1cb6f0=encryptor['decryptString'](_0x3b259e[_0x325c('0x31')]);_0x3b259e[_0x325c('0x31')]=maskClientSecret(_0x1cb6f0);}return _0x3b259e;});return _0x599936;})[_0x325c('0x14')](respondWithFilteredResult(_0x5a741b,_0x3d28a5))[_0x325c('0x32')](handleError(_0x5a741b,null));};exports[_0x325c('0x33')]=function(_0x15fe82,_0x561080){var _0x48f9c3={'raw':!![],'where':{'id':_0x15fe82[_0x325c('0x34')]['id']}},_0x45b72b={};_0x45b72b[_0x325c('0x1e')]=_['keys'](db[_0x325c('0x1a')][_0x325c('0x1b')]);_0x45b72b[_0x325c('0x20')]=_[_0x325c('0x35')](_0x15fe82[_0x325c('0x20')]);_0x45b72b['filters']=_[_0x325c('0x22')](_0x45b72b[_0x325c('0x1e')],_0x45b72b[_0x325c('0x20')]);_0x48f9c3['attributes']=_[_0x325c('0x22')](_0x45b72b[_0x325c('0x1e')],qs[_0x325c('0x23')](_0x15fe82[_0x325c('0x20')][_0x325c('0x23')]));_0x48f9c3[_0x325c('0x24')]=_0x48f9c3[_0x325c('0x24')][_0x325c('0x36')]?_0x48f9c3[_0x325c('0x24')]:_0x45b72b[_0x325c('0x1e')];if(_0x15fe82[_0x325c('0x20')][_0x325c('0x37')]){_0x48f9c3[_0x325c('0x2d')]=[{'all':!![]}];}_0x48f9c3=_[_0x325c('0x2a')]({},_0x48f9c3,_0x15fe82[_0x325c('0x38')]);return db[_0x325c('0x1a')]['find'](_0x48f9c3)['then'](handleEntityNotFound(_0x561080,null))[_0x325c('0x14')](function(_0xa4f6b5){if(_0xa4f6b5[_0x325c('0x39')]===_0x325c('0x30')){var _0x5def82=encryptor[_0x325c('0x3a')](_0xa4f6b5[_0x325c('0x31')]);_0xa4f6b5[_0x325c('0x31')]=maskClientSecret(_0x5def82);}return _0xa4f6b5;})[_0x325c('0x14')](respondWithResult(_0x561080,null))[_0x325c('0x32')](handleError(_0x561080,null));};exports[_0x325c('0x3b')]=function(_0x2f4d7e,_0x5b9a09){if(!_0x2f4d7e[_0x325c('0x3c')][_0x325c('0x17')])throw new Error(_0x325c('0x3d'));if(!_0x2f4d7e['body'][_0x325c('0x39')])throw new Error('Service\x20parameter\x20not\x20specified');var _0xde6da0=db[_0x325c('0x1a')][_0x325c('0x1b')][_0x325c('0x39')][_0x325c('0x3e')];if(!_0xde6da0[_0x325c('0x3f')](_0x2f4d7e['body'][_0x325c('0x39')]))throw new Error(_0x325c('0x40')+_0xde6da0[_0x325c('0x41')](',\x20'));if(_0x2f4d7e[_0x325c('0x3c')][_0x325c('0x39')]===_0x325c('0x30')&&_0x2f4d7e[_0x325c('0x3c')]['data3']){_0x2f4d7e[_0x325c('0x3c')][_0x325c('0x31')]=encryptor[_0x325c('0x42')](_0x2f4d7e['body'][_0x325c('0x31')]);}return db[_0x325c('0x1a')]['create'](_0x2f4d7e[_0x325c('0x3c')],{})[_0x325c('0x14')](respondWithResult(_0x5b9a09,0xc9))['catch'](handleError(_0x5b9a09,null));};exports[_0x325c('0x13')]=function(_0x347958,_0x1a1489){if(_0x347958[_0x325c('0x3c')]['id']){delete _0x347958[_0x325c('0x3c')]['id'];}return db['CloudProvider'][_0x325c('0x43')]({'where':{'id':_0x347958[_0x325c('0x34')]['id']}})['then'](handleEntityNotFound(_0x1a1489,null))[_0x325c('0x14')](function(_0x2f9ead){if(_0x2f9ead[_0x325c('0x39')]===_0x325c('0x30')&&_0x347958[_0x325c('0x3c')][_0x325c('0x31')]){_0x347958[_0x325c('0x3c')][_0x325c('0x31')]=encryptor[_0x325c('0x42')](_0x347958['body'][_0x325c('0x31')]);}return _0x2f9ead;})[_0x325c('0x14')](saveUpdates(_0x347958['body'],null))[_0x325c('0x14')](respondWithResult(_0x1a1489,null))[_0x325c('0x32')](handleError(_0x1a1489,null));};exports['destroy']=function(_0x3cc348,_0x714bbd){return db['CloudProvider'][_0x325c('0x43')]({'where':{'id':_0x3cc348['params']['id']}})[_0x325c('0x14')](handleEntityNotFound(_0x714bbd,null))[_0x325c('0x14')](removeEntity(_0x714bbd,null))[_0x325c('0x32')](handleError(_0x714bbd,null));};exports['oauth2MicrosoftAuthorize']=function(_0x44ce46,_0x472666){return db['CloudProvider'][_0x325c('0x44')]({'where':{'id':_0x44ce46[_0x325c('0x34')]['id']},'raw':!![]})['then'](function(_0x183d75){if(!_0x183d75)return _0x472666['sendStatus'](0x194);return{'url':oauth[_0x325c('0x45')](_0x183d75,_0x44ce46[_0x325c('0x46')]['id'])};})[_0x325c('0x14')](respondWithResult(_0x472666,null))[_0x325c('0x32')](handleError(_0x472666,null));};exports[_0x325c('0x47')]=function(_0x46f619,_0xa4933c){var _0x518396=_0x46f619['body'];var _0x519c27;var _0x3b5fa7;if(_0x518396[_0x325c('0x16')])throw _0x518396;redis['get'](_0x518396[_0x325c('0x48')])[_0x325c('0x14')](function(_0x1289c1){if(!_0x1289c1)throw new Error(_0x325c('0x49'));_0x519c27=JSON[_0x325c('0x4a')](_0x1289c1);var _0x5e31ff=Buffer['from'](_0x518396[_0x325c('0x48')],_0x325c('0x4b'))[_0x325c('0x4c')](_0x325c('0x4d'));_0x3b5fa7=JSON[_0x325c('0x4a')](_0x5e31ff);if(!oauth[_0x325c('0x4e')](_0x518396[_0x325c('0x4f')],_0x519c27[_0x325c('0x50')]))throw new Error(_0x325c('0x51'));redis[_0x325c('0x52')](_0x518396[_0x325c('0x48')]);return oauth[_0x325c('0x53')](_0x518396[_0x325c('0x54')],_0x519c27);})[_0x325c('0x14')](function(_0x266a25){_0x519c27[_0x325c('0x55')]=_0x266a25[_0x325c('0x56')];_0x519c27[_0x325c('0x57')]=_0x266a25[_0x325c('0x58')];return db[_0x325c('0x1a')][_0x325c('0x13')]({'data5':_0x519c27[_0x325c('0x55')],'data6':_0x519c27[_0x325c('0x57')]},{'where':{'id':_0x519c27['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x519c27);socket['emit'](_0x325c('0x59'),{'id':_0x3b5fa7['id']});return;})[_0x325c('0x14')](respondWithStatusCode(_0xa4933c,null))[_0x325c('0x32')](function(_0x1b5de5){if(_0x3b5fa7){socket[_0x325c('0x5a')](_0x325c('0x5b'),{'id':_0x3b5fa7['id']});}if(!_0x519c27){logger[_0x325c('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x1b5de5);return _0xa4933c[_0x325c('0xb')](0x1f4)[_0x325c('0x18')](_0x1b5de5['message']);}logger['error'](_0x325c('0x5c'),_0x519c27['id'],JSON[_0x325c('0x5d')](_0x1b5de5));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index ba92521..1e26266 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 _0x2e98=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define'];(function(_0x6d8384,_0x31ccaf){var _0x59dac7=function(_0x442093){while(--_0x442093){_0x6d8384['push'](_0x6d8384['shift']());}};_0x59dac7(++_0x31ccaf);}(_0x2e98,0x8c));var _0x82e9=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2e98[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x82e9('0x0'))(_0x82e9('0x1'));var moment=require(_0x82e9('0x2'));var BPromise=require(_0x82e9('0x3'));var rp=require(_0x82e9('0x4'));var fs=require('fs');var path=require(_0x82e9('0x5'));var rimraf=require('rimraf');var config=require(_0x82e9('0x6'));var attributes=require(_0x82e9('0x7'));module[_0x82e9('0x8')]=function(_0x37e969,_0x7249e2){return _0x37e969[_0x82e9('0x9')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x096a=['../../config/environment','./cloudProvider.attributes','exports','cloud_providers','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x096a,0x1b2));var _0xa096=function(_0x51235c,_0x310731){_0x51235c=_0x51235c-0x0;var _0x43d852=_0x096a[_0x51235c];return _0x43d852;};'use strict';var _=require(_0xa096('0x0'));var util=require('util');var logger=require(_0xa096('0x1'))(_0xa096('0x2'));var moment=require('moment');var BPromise=require(_0xa096('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa096('0x4'));var rimraf=require(_0xa096('0x5'));var config=require(_0xa096('0x6'));var attributes=require(_0xa096('0x7'));module[_0xa096('0x8')]=function(_0x14f3c1,_0x5a9350){return _0x14f3c1['define']('CloudProvider',attributes,{'tableName':_0xa096('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 29b5e0d..e00e158 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1663=['then','refresh_token','data6','POST','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','data4','decryptString','intervals','findAll','all','inspect','error','jsonwebtoken','moment','request-promise','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','Dynamics365','push','/.default','join','Outlook365','data7','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','data1','redirect_uri','response_mode','form_post','state','nonce','prompt','key','value','oauth2Claims','replace','oauth2/','set','iss','issuer','aud','audience','isAfter','unix','exp','resolve','data3','CloudProvider'];(function(_0x5020fa,_0x2c6b89){var _0x5f0706=function(_0x94da7b){while(--_0x94da7b){_0x5020fa['push'](_0x5020fa['shift']());}};_0x5f0706(++_0x2c6b89);}(_0x1663,0xa2));var _0x3166=function(_0x333151,_0x347994){_0x333151=_0x333151-0x0;var _0x52ead1=_0x1663[_0x333151];return _0x52ead1;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0x3166('0x0'));var moment=require(_0x3166('0x1'));var Redis=require('ioredis');var rp=require(_0x3166('0x2'));var util=require('util');var encryptor=require('../../components/encryptor');var config=require(_0x3166('0x3'));var logger=require(_0x3166('0x4'))(_0x3166('0x5'));var schedule=require(_0x3166('0x6'));var db=require(_0x3166('0x7'))['db'];config[_0x3166('0x8')]=_['defaults'](config[_0x3166('0x8')],{'host':_0x3166('0x9'),'port':0x18eb});var redis=new Redis(config[_0x3166('0x8')]);var MICROSOFT_AUTH_URL=_0x3166('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0x3166('0xb'),'profile',_0x3166('0xc'),_0x3166('0xd'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x3166('0xe'),_0x3166('0xf')],'Dynamics365':[_0x3166('0xb'),_0x3166('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0x3166('0x10');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1cf199){var _0x46a4a2=_[_0x3166('0x11')](AZURE_AUTH_SCOPES[_0x1cf199[_0x3166('0x12')]]);if(_0x1cf199[_0x3166('0x12')]===_0x3166('0x13'))_0x46a4a2[_0x3166('0x14')](_0x1cf199['data7']+_0x3166('0x15'));return _0x46a4a2[_0x3166('0x16')]('\x20');}function getAccessTokenScope(_0x161c9b){if(_0x161c9b[_0x3166('0x12')]===_0x3166('0x17'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x161c9b['type']==='Dynamics365')return _0x161c9b[_0x3166('0x18')]+_0x3166('0x15');}function generateMicrosoftAuthorizationUrl(_0x2e1fed,_0x1fc373){var _0x17ba06=MICROSOFT_AUTH_URL['replace'](_0x3166('0x19'),_0x2e1fed[_0x3166('0x1a')]);var _0x41df46=[_0x3166('0x1b'),_0x3166('0x1c')];var _0x52a160=Buffer[_0x3166('0x1d')](JSON[_0x3166('0x1e')]({'id':_0x1fc373}))[_0x3166('0x1f')](_0x3166('0x20'));var _0x293e2e=crypto[_0x3166('0x21')](0x10)[_0x3166('0x1f')]('hex');var _0x1bc29c=getAuthorizationScopes(_0x2e1fed);var _0xcae2f8=[{'key':'client_id','value':_0x2e1fed[_0x3166('0x22')]},{'key':'response_type','value':encodeURIComponent(_0x41df46[_0x3166('0x16')]('\x20'))},{'key':_0x3166('0x23'),'value':_0x2e1fed['data4']},{'key':_0x3166('0x24'),'value':_0x3166('0x25')},{'key':'scope','value':encodeURIComponent(_0x1bc29c)},{'key':_0x3166('0x26'),'value':_0x52a160},{'key':_0x3166('0x27'),'value':_0x293e2e},{'key':_0x3166('0x28'),'value':'login'}];var _0x4c975d=_0x17ba06+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x3166('0x11')](_0xcae2f8,function(_0x43fee7){return _0x43fee7[_0x3166('0x29')]+'='+_0x43fee7[_0x3166('0x2a')];})[_0x3166('0x16')]('&');_0x2e1fed[_0x3166('0x2b')]={'issuer':_0x17ba06[_0x3166('0x2c')](_0x3166('0x2d'),''),'audience':_0x2e1fed[_0x3166('0x22')],'state':_0x52a160,'nonce':_0x293e2e};redis[_0x3166('0x2e')](_0x52a160,JSON[_0x3166('0x1e')](_0x2e1fed));return _0x4c975d;}function isValidIdToken(_0x22e705,_0x1a1450){try{var _0x3373af=jwt['decode'](_0x22e705,{'complete':!![]});var _0x5a33c6=_0x3373af['payload'];if(_0x5a33c6[_0x3166('0x2f')]!==_0x1a1450[_0x3166('0x30')])return![];if(_0x5a33c6[_0x3166('0x31')]!==_0x1a1450[_0x3166('0x32')])return![];if(_0x5a33c6[_0x3166('0x27')]!==_0x1a1450[_0x3166('0x27')])return![];if(moment()[_0x3166('0x33')](moment[_0x3166('0x34')](_0x5a33c6[_0x3166('0x35')])))return![];return!![];}catch(_0x453afa){throw _0x453afa;}}function refreshOauth2MicrosoftAccessToken(_0x4ca94d){return Promise[_0x3166('0x36')]()['then'](function(){if(_0x4ca94d[_0x3166('0x37')])return _0x4ca94d;return db[_0x3166('0x38')]['findOne']({'where':{'id':_0x4ca94d['id']},'raw':!![]});})[_0x3166('0x39')](function(_0x40036f){var _0x12acb7={'grant_type':_0x3166('0x3a'),'refresh_token':_0x40036f[_0x3166('0x3b')],'scope':getAccessTokenScope(_0x40036f),'redirect_uri':_0x40036f['data4'],'client_id':_0x40036f[_0x3166('0x22')],'client_secret':encryptor['decryptString'](_0x40036f['data3'])};var _0x306f0a={'method':_0x3166('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x3166('0x2c')]('{TENANT_ID}',_0x40036f['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x12acb7,'json':!![]};return rp(_0x306f0a);})[_0x3166('0x39')](function(_0x43250a){_0x4ca94d[_0x3166('0x3d')]=_0x43250a[_0x3166('0x3e')];_0x4ca94d[_0x3166('0x3b')]=_0x43250a[_0x3166('0x3a')];return db[_0x3166('0x38')][_0x3166('0x3f')]({'data5':_0x4ca94d[_0x3166('0x3d')],'data6':_0x4ca94d[_0x3166('0x3b')]},{'where':{'id':_0x4ca94d['id']}});})[_0x3166('0x39')](function(){return _0x4ca94d;})[_0x3166('0x40')](function(_0x571ce3){logger['error'](_0x3166('0x41'),_0x4ca94d['id'],_0x571ce3);});}function getOauth2MicrosoftAccessToken(_0x1d4e37,_0x58fec0){var _0x30cbab={'grant_type':'authorization_code','code':_0x1d4e37,'scope':getAccessTokenScope(_0x58fec0),'redirect_uri':_0x58fec0[_0x3166('0x42')],'client_id':_0x58fec0[_0x3166('0x22')],'client_secret':encryptor[_0x3166('0x43')](_0x58fec0[_0x3166('0x37')])};var _0x42bc91={'method':_0x3166('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x3166('0x2c')](_0x3166('0x19'),_0x58fec0[_0x3166('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x30cbab,'json':!![]};return rp(_0x42bc91);}function startRefreshInterval(_0x30b44c){var _0x3c4505=schedule['intervals'];if(_0x3c4505[_0x30b44c['id']])clearInterval(_0x3c4505[_0x30b44c['id']]);_0x3c4505[_0x30b44c['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x30b44c['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x3166('0x44')]=_0x3c4505;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x3166('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x597cd0){var _0x5dd612=_0x597cd0[_0x3166('0x11')](function(_0x4acf91){return refreshOauth2MicrosoftAccessToken(_0x4acf91)['then'](function(_0x520d5a){startRefreshInterval(_0x520d5a);});});return Promise[_0x3166('0x46')](_0x5dd612);})[_0x3166('0x40')](function(_0x3017bb){var _0x5ed9b4=_0x3017bb?util[_0x3166('0x47')](_0x3017bb,{'showHidden':![],'depth':null}):'';logger[_0x3166('0x48')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x5ed9b4);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xb222=['util','../../config/logger','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','offline_access','/authorize','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','id_token','from','stringify','toString','base64','hex','client_id','response_type','redirect_uri','data4','response_mode','form_post','scope','nonce','prompt','login','key','value','oauth2/','data1','set','decode','payload','iss','issuer','aud','audience','isAfter','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','access_token','update','catch','error','authorization_code','intervals','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise'];(function(_0x9f27ef,_0xf53771){var _0x5ed282=function(_0x1fb91a){while(--_0x1fb91a){_0x9f27ef['push'](_0x9f27ef['shift']());}};_0x5ed282(++_0xf53771);}(_0xb222,0xe4));var _0x2b22=function(_0x1707af,_0x17ab07){_0x1707af=_0x1707af-0x0;var _0x44b17c=_0xb222[_0x1707af];return _0x44b17c;};'use strict';var _=require(_0x2b22('0x0'));var crypto=require(_0x2b22('0x1'));var jwt=require(_0x2b22('0x2'));var moment=require(_0x2b22('0x3'));var Redis=require(_0x2b22('0x4'));var rp=require(_0x2b22('0x5'));var util=require(_0x2b22('0x6'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x2b22('0x7'))('api');var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x2b22('0x8'))['db'];config[_0x2b22('0x9')]=_[_0x2b22('0xa')](config[_0x2b22('0x9')],{'host':_0x2b22('0xb'),'port':0x18eb});var redis=new Redis(config[_0x2b22('0x9')]);var MICROSOFT_AUTH_URL=_0x2b22('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x2b22('0xd'),_0x2b22('0xe'),_0x2b22('0xf'),'offline_access',_0x2b22('0x10'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x2b22('0xd'),_0x2b22('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x2b22('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2d878d){var _0x4d5bcc=_[_0x2b22('0x13')](AZURE_AUTH_SCOPES[_0x2d878d[_0x2b22('0x14')]]);if(_0x2d878d[_0x2b22('0x14')]===_0x2b22('0x15'))_0x4d5bcc[_0x2b22('0x16')](_0x2d878d[_0x2b22('0x17')]+_0x2b22('0x18'));return _0x4d5bcc[_0x2b22('0x19')]('\x20');}function getAccessTokenScope(_0x12b246){if(_0x12b246[_0x2b22('0x14')]===_0x2b22('0x1a'))return _0x2b22('0x10');if(_0x12b246['type']===_0x2b22('0x15'))return _0x12b246[_0x2b22('0x17')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x2dad0e,_0x4cb62e){var _0x2cc364=MICROSOFT_AUTH_URL[_0x2b22('0x1b')](_0x2b22('0x1c'),_0x2dad0e[_0x2b22('0x1d')]);var _0x517fe3=['code',_0x2b22('0x1e')];var _0x1f85ba=Buffer[_0x2b22('0x1f')](JSON[_0x2b22('0x20')]({'id':_0x4cb62e}))[_0x2b22('0x21')](_0x2b22('0x22'));var _0x2e9040=crypto['randomBytes'](0x10)[_0x2b22('0x21')](_0x2b22('0x23'));var _0x4c5c4d=getAuthorizationScopes(_0x2dad0e);var _0x306f49=[{'key':_0x2b22('0x24'),'value':_0x2dad0e['data1']},{'key':_0x2b22('0x25'),'value':encodeURIComponent(_0x517fe3[_0x2b22('0x19')]('\x20'))},{'key':_0x2b22('0x26'),'value':_0x2dad0e[_0x2b22('0x27')]},{'key':_0x2b22('0x28'),'value':_0x2b22('0x29')},{'key':_0x2b22('0x2a'),'value':encodeURIComponent(_0x4c5c4d)},{'key':'state','value':_0x1f85ba},{'key':_0x2b22('0x2b'),'value':_0x2e9040},{'key':_0x2b22('0x2c'),'value':_0x2b22('0x2d')}];var _0x53d5c9=_0x2cc364+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x2b22('0x13')](_0x306f49,function(_0x4e07ec){return _0x4e07ec[_0x2b22('0x2e')]+'='+_0x4e07ec[_0x2b22('0x2f')];})[_0x2b22('0x19')]('&');_0x2dad0e['oauth2Claims']={'issuer':_0x2cc364['replace'](_0x2b22('0x30'),''),'audience':_0x2dad0e[_0x2b22('0x31')],'state':_0x1f85ba,'nonce':_0x2e9040};redis[_0x2b22('0x32')](_0x1f85ba,JSON[_0x2b22('0x20')](_0x2dad0e));return _0x53d5c9;}function isValidIdToken(_0x38f73e,_0x499db2){try{var _0x47a939=jwt[_0x2b22('0x33')](_0x38f73e,{'complete':!![]});var _0x19dc22=_0x47a939[_0x2b22('0x34')];if(_0x19dc22[_0x2b22('0x35')]!==_0x499db2[_0x2b22('0x36')])return![];if(_0x19dc22[_0x2b22('0x37')]!==_0x499db2[_0x2b22('0x38')])return![];if(_0x19dc22[_0x2b22('0x2b')]!==_0x499db2['nonce'])return![];if(moment()[_0x2b22('0x39')](moment['unix'](_0x19dc22[_0x2b22('0x3a')])))return![];return!![];}catch(_0x533d3a){throw _0x533d3a;}}function refreshOauth2MicrosoftAccessToken(_0xf08860){return Promise[_0x2b22('0x3b')]()[_0x2b22('0x3c')](function(){if(_0xf08860[_0x2b22('0x3d')])return _0xf08860;return db[_0x2b22('0x3e')][_0x2b22('0x3f')]({'where':{'id':_0xf08860['id']},'raw':!![]});})[_0x2b22('0x3c')](function(_0x12ab20){var _0xf45e62={'grant_type':_0x2b22('0x40'),'refresh_token':_0x12ab20[_0x2b22('0x41')],'scope':getAccessTokenScope(_0x12ab20),'redirect_uri':_0x12ab20[_0x2b22('0x27')],'client_id':_0x12ab20['data1'],'client_secret':encryptor[_0x2b22('0x42')](_0x12ab20[_0x2b22('0x3d')])};var _0x1b41f5={'method':_0x2b22('0x43'),'uri':MICROSOFT_AUTH_URL[_0x2b22('0x1b')](_0x2b22('0x1c'),_0x12ab20['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xf45e62,'json':!![]};return rp(_0x1b41f5);})[_0x2b22('0x3c')](function(_0x33efa6){_0xf08860[_0x2b22('0x44')]=_0x33efa6[_0x2b22('0x45')];_0xf08860[_0x2b22('0x41')]=_0x33efa6[_0x2b22('0x40')];return db[_0x2b22('0x3e')][_0x2b22('0x46')]({'data5':_0xf08860[_0x2b22('0x44')],'data6':_0xf08860[_0x2b22('0x41')]},{'where':{'id':_0xf08860['id']}});})['then'](function(){return _0xf08860;})[_0x2b22('0x47')](function(_0x20a85a){logger[_0x2b22('0x48')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0xf08860['id'],_0x20a85a);});}function getOauth2MicrosoftAccessToken(_0x1e2162,_0x3a8af5){var _0x227e0b={'grant_type':_0x2b22('0x49'),'code':_0x1e2162,'scope':getAccessTokenScope(_0x3a8af5),'redirect_uri':_0x3a8af5['data4'],'client_id':_0x3a8af5[_0x2b22('0x31')],'client_secret':encryptor[_0x2b22('0x42')](_0x3a8af5[_0x2b22('0x3d')])};var _0x2b04a1={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x2b22('0x1b')](_0x2b22('0x1c'),_0x3a8af5['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x227e0b,'json':!![]};return rp(_0x2b04a1);}function startRefreshInterval(_0x15f24d){var _0x4e6e2d=schedule[_0x2b22('0x4a')];if(_0x4e6e2d[_0x15f24d['id']])clearInterval(_0x4e6e2d[_0x15f24d['id']]);_0x4e6e2d[_0x15f24d['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x15f24d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x2b22('0x4a')]=_0x4e6e2d;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x2b22('0x3c')](function(_0x179feb){var _0x569ae2=_0x179feb[_0x2b22('0x13')](function(_0x3fa54c){return refreshOauth2MicrosoftAccessToken(_0x3fa54c)['then'](function(_0x12bbf5){startRefreshInterval(_0x12bbf5);});});return Promise[_0x2b22('0x4b')](_0x569ae2);})[_0x2b22('0x47')](function(_0x145c96){var _0x2bedde=_0x145c96?util['inspect'](_0x145c96,{'showHidden':![],'depth':null}):'';logger[_0x2b22('0x48')](_0x2b22('0x4c'),_0x2bedde);});}module[_0x2b22('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index d115c40..2351bdc 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 _0xba6f=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','CloudProvider,\x20%s,\x20%s','request\x20sent'];(function(_0x57db2b,_0x21397e){var _0x381abb=function(_0x210534){while(--_0x210534){_0x57db2b['push'](_0x57db2b['shift']());}};_0x381abb(++_0x21397e);}(_0xba6f,0x1d0));var _0xfba6=function(_0x23f8c8,_0xb536b9){_0x23f8c8=_0x23f8c8-0x0;var _0x3dc718=_0xba6f[_0x23f8c8];return _0x3dc718;};'use strict';var _=require(_0xfba6('0x0'));var util=require('util');var moment=require(_0xfba6('0x1'));var BPromise=require(_0xfba6('0x2'));var rs=require(_0xfba6('0x3'));var fs=require('fs');var Redis=require(_0xfba6('0x4'));var db=require(_0xfba6('0x5'))['db'];var utils=require(_0xfba6('0x6'));var logger=require(_0xfba6('0x7'))(_0xfba6('0x8'));var config=require(_0xfba6('0x9'));var jayson=require(_0xfba6('0xa'));var client=jayson[_0xfba6('0xb')][_0xfba6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x99e213,_0x5d86c3,_0x1b3c5c){return new BPromise(function(_0x2bd0e6,_0x4dd2a2){return client['request'](_0x99e213,_0x1b3c5c)['then'](function(_0x3effea){logger[_0xfba6('0xd')](_0xfba6('0xe'),_0x5d86c3,_0xfba6('0xf'));logger[_0xfba6('0x10')](_0xfba6('0x11'),_0x5d86c3,_0xfba6('0xf'),JSON[_0xfba6('0x12')](_0x3effea));if(_0x3effea[_0xfba6('0x13')]){if(_0x3effea[_0xfba6('0x13')][_0xfba6('0x14')]===0x1f4){logger['error'](_0xfba6('0xe'),_0x5d86c3,_0x3effea[_0xfba6('0x13')][_0xfba6('0x15')]);return _0x4dd2a2(_0x3effea[_0xfba6('0x13')]['message']);}logger[_0xfba6('0x13')]('CloudProvider,\x20%s,\x20%s',_0x5d86c3,_0x3effea['error'][_0xfba6('0x15')]);return _0x2bd0e6(_0x3effea[_0xfba6('0x13')][_0xfba6('0x15')]);}else{logger[_0xfba6('0xd')](_0xfba6('0xe'),_0x5d86c3,_0xfba6('0xf'));_0x2bd0e6(_0x3effea[_0xfba6('0x16')][_0xfba6('0x15')]);}})[_0xfba6('0x17')](function(_0x228add){logger[_0xfba6('0x13')](_0xfba6('0xe'),_0x5d86c3,_0x228add);_0x4dd2a2(_0x228add);});});}
\ No newline at end of file
+var _0xb4f4=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x78d8b4,_0x1c9824){var _0x49b14a=function(_0x3f5d35){while(--_0x3f5d35){_0x78d8b4['push'](_0x78d8b4['shift']());}};_0x49b14a(++_0x1c9824);}(_0xb4f4,0xda));var _0x4b4f=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xb4f4[_0x3740fe];return _0x55492b;};'use strict';var _=require(_0x4b4f('0x0'));var util=require(_0x4b4f('0x1'));var moment=require('moment');var BPromise=require(_0x4b4f('0x2'));var rs=require(_0x4b4f('0x3'));var fs=require('fs');var Redis=require(_0x4b4f('0x4'));var db=require(_0x4b4f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b4f('0x6'))(_0x4b4f('0x7'));var config=require(_0x4b4f('0x8'));var jayson=require(_0x4b4f('0x9'));var client=jayson[_0x4b4f('0xa')][_0x4b4f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x405321,_0x58c1e5,_0x5ba9b0){return new BPromise(function(_0x108b4e,_0x2c647f){return client[_0x4b4f('0xc')](_0x405321,_0x5ba9b0)[_0x4b4f('0xd')](function(_0x25e0c9){logger['info'](_0x4b4f('0xe'),_0x58c1e5,_0x4b4f('0xf'));logger[_0x4b4f('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x58c1e5,_0x4b4f('0xf'),JSON[_0x4b4f('0x11')](_0x25e0c9));if(_0x25e0c9['error']){if(_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x13')]===0x1f4){logger[_0x4b4f('0x12')](_0x4b4f('0xe'),_0x58c1e5,_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);return _0x2c647f(_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x58c1e5,_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);return _0x108b4e(_0x25e0c9['error'][_0x4b4f('0x14')]);}else{logger[_0x4b4f('0x15')](_0x4b4f('0xe'),_0x58c1e5,'request\x20sent');_0x108b4e(_0x25e0c9[_0x4b4f('0x16')][_0x4b4f('0x14')]);}})[_0x4b4f('0x17')](function(_0x57d09a){logger[_0x4b4f('0x12')](_0x4b4f('0xe'),_0x58c1e5,_0x57d09a);_0x2c647f(_0x57d09a);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 8dfb7b5..8bd1d85 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 _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x214cdf,_0x458085){var _0x232d5b=function(_0x1546d8){while(--_0x1546d8){_0x214cdf['push'](_0x214cdf['shift']());}};_0x232d5b(++_0x458085);}(_0x2ef3,0xba));var _0x32ef=function(_0x5bc03d,_0x274ed1){_0x5bc03d=_0x5bc03d-0x0;var _0x30285d=_0x2ef3[_0x5bc03d];return _0x30285d;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
+var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0x1261,0x144));var _0x1126=function(_0x2effa6,_0x1440d7){_0x2effa6=_0x2effa6-0x0;var _0x226598=_0x1261[_0x2effa6];return _0x226598;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 8366015..e111d6a 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 _0x4829=['name','exports','STRING'];(function(_0x4291c8,_0x496c13){var _0x40ee75=function(_0x3ac215){while(--_0x3ac215){_0x4291c8['push'](_0x4291c8['shift']());}};_0x40ee75(++_0x496c13);}(_0x4829,0xcd));var _0x9482=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0x4829[_0x3d4876];return _0x58ca9d;};'use strict';var Sequelize=require('sequelize');module[_0x9482('0x0')]={'name':{'type':Sequelize[_0x9482('0x1')],'unique':_0x9482('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9482('0x1')]},'companyId':{'type':Sequelize[_0x9482('0x1')]},'website':{'type':Sequelize[_0x9482('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x9482('0x1')]},'type':{'type':Sequelize[_0x9482('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x9482('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9482('0x1')]},'email':{'type':Sequelize[_0x9482('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9482('0x1')]},'sStreet':{'type':Sequelize[_0x9482('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x9482('0x1')]},'sCountry':{'type':Sequelize[_0x9482('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7a30=['sequelize','exports','STRING','name'];(function(_0xb03c1c,_0x2f98ed){var _0x507e93=function(_0xbb4f3f){while(--_0xbb4f3f){_0xb03c1c['push'](_0xb03c1c['shift']());}};_0x507e93(++_0x2f98ed);}(_0x7a30,0x8c));var _0x07a3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7a30[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x07a3('0x0'));module[_0x07a3('0x1')]={'name':{'type':Sequelize[_0x07a3('0x2')],'unique':_0x07a3('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x07a3('0x2')]},'companyId':{'type':Sequelize[_0x07a3('0x2')]},'website':{'type':Sequelize[_0x07a3('0x2')]},'phone':{'type':Sequelize[_0x07a3('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x07a3('0x2')]},'street':{'type':Sequelize[_0x07a3('0x2')]},'postalCode':{'type':Sequelize[_0x07a3('0x2')]},'city':{'type':Sequelize[_0x07a3('0x2')]},'country':{'type':Sequelize[_0x07a3('0x2')]},'email':{'type':Sequelize[_0x07a3('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x07a3('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x07a3('0x2')]},'sCity':{'type':Sequelize[_0x07a3('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x07a3('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 6c5dc03..2b5b190 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 _0x6f8f=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Companies','error','stack','name','send','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','filter','merge','options','CmCompany','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','addContacts','ids','omit','getContacts','findOne','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0x6f8f,0x90));var _0xf6f8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f8f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf6f8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf6f8('0x1'));var rp=require(_0xf6f8('0x2'));var moment=require(_0xf6f8('0x3'));var BPromise=require(_0xf6f8('0x4'));var Mustache=require(_0xf6f8('0x5'));var util=require(_0xf6f8('0x6'));var path=require(_0xf6f8('0x7'));var sox=require(_0xf6f8('0x8'));var csv=require('to-csv');var ejs=require(_0xf6f8('0x9'));var fs=require('fs');var fs_extra=require(_0xf6f8('0xa'));var _=require(_0xf6f8('0xb'));var squel=require(_0xf6f8('0xc'));var crypto=require('crypto');var jsforce=require(_0xf6f8('0xd'));var deskjs=require(_0xf6f8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf6f8('0xf'));var Papa=require(_0xf6f8('0x10'));var Redis=require(_0xf6f8('0x11'));var authService=require(_0xf6f8('0x12'));var qs=require(_0xf6f8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf6f8('0x14'));var logger=require(_0xf6f8('0x15'))(_0xf6f8('0x16'));var utils=require('../../config/utils');var config=require(_0xf6f8('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e6ca0,_0x556b93){_0x556b93=_0x556b93||0xcc;return function(_0x42d711){if(_0x42d711){return _0x2e6ca0['sendStatus'](_0x556b93);}return _0x2e6ca0[_0xf6f8('0x18')](_0x556b93)[_0xf6f8('0x19')]();};}function respondWithResult(_0x213998,_0x2e6ae2){_0x2e6ae2=_0x2e6ae2||0xc8;return function(_0x5a71d3){if(_0x5a71d3){return _0x213998[_0xf6f8('0x18')](_0x2e6ae2)[_0xf6f8('0x1a')](_0x5a71d3);}};}function respondWithFilteredResult(_0x3f9b6b,_0x19b107){return function(_0x2dadf0){if(_0x2dadf0){var _0x19ef31=typeof _0x19b107[_0xf6f8('0x1b')]===_0xf6f8('0x1c')&&typeof _0x19b107[_0xf6f8('0x1d')]===_0xf6f8('0x1c');var _0x16dc05=_0x2dadf0[_0xf6f8('0x1e')];var _0x15cf16=_0x19ef31?0x0:_0x19b107[_0xf6f8('0x1b')];var _0x4310fe=_0x19ef31?_0x2dadf0[_0xf6f8('0x1e')]:_0x19b107[_0xf6f8('0x1b')]+_0x19b107['limit'];var _0x4b9752;if(_0x4310fe>=_0x16dc05){_0x4310fe=_0x16dc05;_0x4b9752=0xc8;}else{_0x4b9752=0xce;}_0x3f9b6b['status'](_0x4b9752);return _0x3f9b6b[_0xf6f8('0x1f')](_0xf6f8('0x20'),_0x15cf16+'-'+_0x4310fe+'/'+_0x16dc05)[_0xf6f8('0x1a')](_0x2dadf0);}return null;};}function patchUpdates(_0x30b27e){return function(_0x4dea46){try{jsonpatch[_0xf6f8('0x21')](_0x4dea46,_0x30b27e,!![]);}catch(_0x145dc4){return BPromise[_0xf6f8('0x22')](_0x145dc4);}return _0x4dea46[_0xf6f8('0x23')]();};}function saveUpdates(_0x17acbe,_0x1aa550){return function(_0x3b6a39){if(_0x3b6a39){return _0x3b6a39[_0xf6f8('0x24')](_0x17acbe)['then'](function(_0x238627){return _0x238627;});}return null;};}function removeEntity(_0x3eea5d,_0x3f6721){return function(_0x5a4c9c){if(_0x5a4c9c){return _0x5a4c9c[_0xf6f8('0x25')]()[_0xf6f8('0x26')](function(){var _0x2de292=_0x5a4c9c[_0xf6f8('0x27')]({'plain':!![]});var _0x2e0144=_0xf6f8('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x2e0144,'resourceId':_0x2de292['id']}})[_0xf6f8('0x26')](function(){return _0x5a4c9c;});})[_0xf6f8('0x26')](function(){_0x3eea5d['status'](0xcc)[_0xf6f8('0x19')]();});}};}function handleEntityNotFound(_0x4f1a62,_0x36c8d9){return function(_0x52647a){if(!_0x52647a){_0x4f1a62['sendStatus'](0x194);}return _0x52647a;};}function handleError(_0x3e3fb7,_0x59ca24){_0x59ca24=_0x59ca24||0x1f4;return function(_0x20d7c1){logger[_0xf6f8('0x29')](_0x20d7c1[_0xf6f8('0x2a')]);if(_0x20d7c1['name']){delete _0x20d7c1[_0xf6f8('0x2b')];}_0x3e3fb7['status'](_0x59ca24)[_0xf6f8('0x2c')](_0x20d7c1);};}exports['index']=function(_0x183d35,_0x302fd3){var _0x5e6ae5={},_0x4af85b={},_0x1359da={'count':0x0,'rows':[]};return db['CmCompany'][_0xf6f8('0x2d')]()[_0xf6f8('0x26')](function(_0x125a9e){_0x4af85b[_0xf6f8('0x2e')]=_[_0xf6f8('0x2f')](_0x125a9e);_0x4af85b[_0xf6f8('0x30')]=_[_0xf6f8('0x2f')](_0x183d35[_0xf6f8('0x30')]);_0x4af85b[_0xf6f8('0x31')]=_[_0xf6f8('0x32')](_0x4af85b['model'],_0x4af85b[_0xf6f8('0x30')]);_0x5e6ae5[_0xf6f8('0x33')]=_[_0xf6f8('0x32')](_0x4af85b[_0xf6f8('0x2e')],qs[_0xf6f8('0x34')](_0x183d35[_0xf6f8('0x30')]['fields']));_0x5e6ae5[_0xf6f8('0x33')]=_0x5e6ae5['attributes'][_0xf6f8('0x35')]?_0x5e6ae5[_0xf6f8('0x33')]:_0x4af85b[_0xf6f8('0x2e')];if(!_0x183d35[_0xf6f8('0x30')][_0xf6f8('0x36')](_0xf6f8('0x37'))){_0x5e6ae5['limit']=qs['limit'](_0x183d35[_0xf6f8('0x30')]['limit']);_0x5e6ae5[_0xf6f8('0x1b')]=qs[_0xf6f8('0x1b')](_0x183d35[_0xf6f8('0x30')]['offset']);}_0x5e6ae5[_0xf6f8('0x38')]=qs['sort'](_0x183d35['query'][_0xf6f8('0x39')]);_0x5e6ae5[_0xf6f8('0x3a')]=qs[_0xf6f8('0x31')](_[_0xf6f8('0x3b')](_0x183d35[_0xf6f8('0x30')],_0x4af85b[_0xf6f8('0x31')]),_0x125a9e);if(_0x183d35[_0xf6f8('0x30')]['filter']){_0x5e6ae5[_0xf6f8('0x3a')]=_['merge'](_0x5e6ae5['where'],{'$or':_[_0xf6f8('0x3c')](_0x5e6ae5[_0xf6f8('0x33')],function(_0xa09bcf){var _0x173247={};_0x173247[_0xa09bcf]={'$like':'%'+_0x183d35['query'][_0xf6f8('0x3d')]+'%'};return _0x173247;})});}_0x5e6ae5=_[_0xf6f8('0x3e')]({},_0x5e6ae5,_0x183d35[_0xf6f8('0x3f')]);var _0x497d93={'where':_0x5e6ae5['where']};return db[_0xf6f8('0x40')]['count'](_0x497d93)[_0xf6f8('0x26')](function(_0x164548){_0x1359da[_0xf6f8('0x1e')]=_0x164548;if(_0x183d35[_0xf6f8('0x30')][_0xf6f8('0x41')]){_0x5e6ae5[_0xf6f8('0x42')]=[{'all':!![]}];}return db[_0xf6f8('0x40')][_0xf6f8('0x43')](_0x5e6ae5);})[_0xf6f8('0x26')](function(_0x15fe9d){_0x1359da[_0xf6f8('0x44')]=_0x15fe9d;return _0x1359da;})['then'](respondWithFilteredResult(_0x302fd3,_0x5e6ae5))[_0xf6f8('0x45')](handleError(_0x302fd3,null));})[_0xf6f8('0x45')](handleError(_0x302fd3,null));};exports[_0xf6f8('0x46')]=function(_0x5157d2,_0x234a8c){var _0x2c9b97={'raw':![],'where':{'id':_0x5157d2[_0xf6f8('0x47')]['id']}},_0x42683b={};_0x42683b['model']=_['keys'](db[_0xf6f8('0x40')]['rawAttributes']);_0x42683b[_0xf6f8('0x30')]=_[_0xf6f8('0x2f')](_0x5157d2[_0xf6f8('0x30')]);_0x42683b['filters']=_[_0xf6f8('0x32')](_0x42683b[_0xf6f8('0x2e')],_0x42683b[_0xf6f8('0x30')]);_0x2c9b97[_0xf6f8('0x33')]=_[_0xf6f8('0x32')](_0x42683b[_0xf6f8('0x2e')],qs[_0xf6f8('0x34')](_0x5157d2[_0xf6f8('0x30')][_0xf6f8('0x34')]));_0x2c9b97[_0xf6f8('0x33')]=_0x2c9b97[_0xf6f8('0x33')][_0xf6f8('0x35')]?_0x2c9b97[_0xf6f8('0x33')]:_0x42683b['model'];if(_0x5157d2[_0xf6f8('0x30')][_0xf6f8('0x41')]){_0x2c9b97['include']=[{'all':!![]}];}_0x2c9b97=_['merge']({},_0x2c9b97,_0x5157d2[_0xf6f8('0x3f')]);return db['CmCompany'][_0xf6f8('0x48')](_0x2c9b97)[_0xf6f8('0x26')](handleEntityNotFound(_0x234a8c,null))[_0xf6f8('0x26')](respondWithResult(_0x234a8c,null))[_0xf6f8('0x45')](handleError(_0x234a8c,null));};exports[_0xf6f8('0x49')]=function(_0x457f16,_0x3013bc){return db['CmCompany'][_0xf6f8('0x49')](_0x457f16[_0xf6f8('0x4a')],{})[_0xf6f8('0x26')](function(_0x85bc34){var _0x3decd7=_0x457f16['user'][_0xf6f8('0x27')]({'plain':!![]});if(!_0x3decd7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3decd7['role']===_0xf6f8('0x4b')){var _0x12bba8=_0x85bc34[_0xf6f8('0x27')]({'plain':!![]});var _0x3a1056=_0xf6f8('0x28');return db[_0xf6f8('0x4c')][_0xf6f8('0x48')]({'where':{'name':_0x3a1056,'userProfileId':_0x3decd7[_0xf6f8('0x4d')]},'raw':!![]})[_0xf6f8('0x26')](function(_0xa4a051){if(_0xa4a051&&_0xa4a051[_0xf6f8('0x4e')]===0x0){return db[_0xf6f8('0x4f')][_0xf6f8('0x49')]({'name':_0x12bba8[_0xf6f8('0x2b')],'resourceId':_0x12bba8['id'],'type':_0xa4a051['name'],'sectionId':_0xa4a051['id']},{})['then'](function(){return _0x85bc34;});}else{return _0x85bc34;}})[_0xf6f8('0x45')](function(_0x558f24){logger[_0xf6f8('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x558f24);throw _0x558f24;});}return _0x85bc34;})[_0xf6f8('0x26')](respondWithResult(_0x3013bc,0xc9))[_0xf6f8('0x45')](handleError(_0x3013bc,null));};exports[_0xf6f8('0x24')]=function(_0x89662f,_0x499850){if(_0x89662f[_0xf6f8('0x4a')]['id']){delete _0x89662f[_0xf6f8('0x4a')]['id'];}return db[_0xf6f8('0x40')]['find']({'where':{'id':_0x89662f[_0xf6f8('0x47')]['id']}})[_0xf6f8('0x26')](handleEntityNotFound(_0x499850,null))[_0xf6f8('0x26')](saveUpdates(_0x89662f[_0xf6f8('0x4a')],null))[_0xf6f8('0x26')](respondWithResult(_0x499850,null))['catch'](handleError(_0x499850,null));};exports[_0xf6f8('0x25')]=function(_0x5a4041,_0x1aac88){return db[_0xf6f8('0x40')]['find']({'where':{'id':_0x5a4041['params']['id']}})[_0xf6f8('0x26')](handleEntityNotFound(_0x1aac88,null))['then'](removeEntity(_0x1aac88,null))[_0xf6f8('0x45')](handleError(_0x1aac88,null));};exports[_0xf6f8('0x2d')]=function(_0x3192af,_0x528d73){return db[_0xf6f8('0x40')]['describe']()[_0xf6f8('0x26')](respondWithResult(_0x528d73,null))[_0xf6f8('0x45')](handleError(_0x528d73,null));};exports[_0xf6f8('0x50')]=function(_0x89bbd6,_0x39d0f4,_0x36a31d){return db['CmContact'][_0xf6f8('0x48')]({'where':{'id':_0x89bbd6[_0xf6f8('0x47')]['id']}})[_0xf6f8('0x26')](handleEntityNotFound(_0x39d0f4,null))['then'](function(_0x9ebf7){if(_0x9ebf7){return _0x9ebf7[_0xf6f8('0x50')](_0x89bbd6[_0xf6f8('0x4a')][_0xf6f8('0x51')],_[_0xf6f8('0x52')](_0x89bbd6['body'],[_0xf6f8('0x51'),'id'])||{});}})[_0xf6f8('0x26')](respondWithResult(_0x39d0f4,null))['catch'](handleError(_0x39d0f4,null));};exports[_0xf6f8('0x53')]=function(_0x426432,_0x3d5873,_0x5aed59){var _0x108b60={};var _0x193e04={};var _0x8a591e;var _0x35f355;return db['CmCompany'][_0xf6f8('0x54')]({'where':{'id':_0x426432[_0xf6f8('0x47')]['id']}})[_0xf6f8('0x26')](handleEntityNotFound(_0x3d5873,null))[_0xf6f8('0x26')](function(_0x39faf2){if(_0x39faf2){_0x8a591e=_0x39faf2;_0x193e04['model']=_[_0xf6f8('0x2f')](db['CmContact']['rawAttributes']);_0x193e04[_0xf6f8('0x30')]=_[_0xf6f8('0x2f')](_0x426432[_0xf6f8('0x30')]);_0x193e04[_0xf6f8('0x31')]=_[_0xf6f8('0x32')](_0x193e04[_0xf6f8('0x2e')],_0x193e04[_0xf6f8('0x30')]);_0x108b60['attributes']=_[_0xf6f8('0x32')](_0x193e04[_0xf6f8('0x2e')],qs[_0xf6f8('0x34')](_0x426432[_0xf6f8('0x30')]['fields']));_0x108b60[_0xf6f8('0x33')]=_0x108b60[_0xf6f8('0x33')]['length']?_0x108b60[_0xf6f8('0x33')]:_0x193e04[_0xf6f8('0x2e')];_0x108b60[_0xf6f8('0x38')]=qs[_0xf6f8('0x39')](_0x426432[_0xf6f8('0x30')][_0xf6f8('0x39')]);_0x108b60[_0xf6f8('0x3a')]=qs[_0xf6f8('0x31')](_[_0xf6f8('0x3b')](_0x426432[_0xf6f8('0x30')],_0x193e04[_0xf6f8('0x31')]));if(_0x426432['query']['filter']){_0x108b60['where']=_[_0xf6f8('0x3e')](_0x108b60[_0xf6f8('0x3a')],{'$or':_[_0xf6f8('0x3c')](_0x108b60[_0xf6f8('0x33')],function(_0x5b2d8d){var _0x472dc5={};_0x472dc5[_0x5b2d8d]={'$like':'%'+_0x426432[_0xf6f8('0x30')][_0xf6f8('0x3d')]+'%'};return _0x472dc5;})});}_0x108b60=_['merge']({},_0x108b60,_0x426432[_0xf6f8('0x3f')]);return _0x8a591e[_0xf6f8('0x53')](_0x108b60);}})[_0xf6f8('0x26')](function(_0x7004e7){if(_0x7004e7){_0x35f355=_0x7004e7[_0xf6f8('0x35')];if(!_0x426432[_0xf6f8('0x30')][_0xf6f8('0x36')](_0xf6f8('0x37'))){_0x108b60['limit']=qs[_0xf6f8('0x1d')](_0x426432[_0xf6f8('0x30')]['limit']);_0x108b60[_0xf6f8('0x1b')]=qs[_0xf6f8('0x1b')](_0x426432['query'][_0xf6f8('0x1b')]);}return _0x8a591e[_0xf6f8('0x53')](_0x108b60);}})[_0xf6f8('0x26')](function(_0x17aeb6){if(_0x17aeb6){return _0x17aeb6?{'count':_0x35f355,'rows':_0x17aeb6}:null;}})[_0xf6f8('0x26')](respondWithResult(_0x3d5873,null))[_0xf6f8('0x45')](handleError(_0x3d5873,null));};
\ No newline at end of file
+var _0xa79c=['Companies','destroy','error','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','length','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','then','get'];(function(_0x236487,_0x39046f){var _0x1c64cc=function(_0x5e1bfb){while(--_0x5e1bfb){_0x236487['push'](_0x236487['shift']());}};_0x1c64cc(++_0x39046f);}(_0xa79c,0xd8));var _0xca79=function(_0x332a8a,_0x47c675){_0x332a8a=_0x332a8a-0x0;var _0x5c287a=_0xa79c[_0x332a8a];return _0x5c287a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca79('0x0'));var zipdir=require(_0xca79('0x1'));var jsonpatch=require(_0xca79('0x2'));var rp=require(_0xca79('0x3'));var moment=require(_0xca79('0x4'));var BPromise=require(_0xca79('0x5'));var Mustache=require(_0xca79('0x6'));var util=require('util');var path=require(_0xca79('0x7'));var sox=require('sox');var csv=require(_0xca79('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca79('0x9'));var _=require(_0xca79('0xa'));var squel=require(_0xca79('0xb'));var crypto=require(_0xca79('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xca79('0x8'));var querystring=require(_0xca79('0xd'));var Papa=require(_0xca79('0xe'));var Redis=require('ioredis');var authService=require(_0xca79('0xf'));var qs=require(_0xca79('0x10'));var as=require(_0xca79('0x11'));var hardwareService=require(_0xca79('0x12'));var logger=require(_0xca79('0x13'))(_0xca79('0x14'));var utils=require(_0xca79('0x15'));var config=require(_0xca79('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xca79('0x17'))['db'];function respondWithStatusCode(_0x568a1f,_0x25dd8e){_0x25dd8e=_0x25dd8e||0xcc;return function(_0x4e5913){if(_0x4e5913){return _0x568a1f[_0xca79('0x18')](_0x25dd8e);}return _0x568a1f[_0xca79('0x19')](_0x25dd8e)[_0xca79('0x1a')]();};}function respondWithResult(_0x35986e,_0xc61781){_0xc61781=_0xc61781||0xc8;return function(_0x122cfe){if(_0x122cfe){return _0x35986e['status'](_0xc61781)[_0xca79('0x1b')](_0x122cfe);}};}function respondWithFilteredResult(_0x548739,_0x19cb88){return function(_0x1db4ca){if(_0x1db4ca){var _0x2bea05=typeof _0x19cb88[_0xca79('0x1c')]==='undefined'&&typeof _0x19cb88[_0xca79('0x1d')]===_0xca79('0x1e');var _0x1642a5=_0x1db4ca['count'];var _0x90dade=_0x2bea05?0x0:_0x19cb88[_0xca79('0x1c')];var _0x292f67=_0x2bea05?_0x1db4ca[_0xca79('0x1f')]:_0x19cb88[_0xca79('0x1c')]+_0x19cb88[_0xca79('0x1d')];var _0x4b199d;if(_0x292f67>=_0x1642a5){_0x292f67=_0x1642a5;_0x4b199d=0xc8;}else{_0x4b199d=0xce;}_0x548739[_0xca79('0x19')](_0x4b199d);return _0x548739[_0xca79('0x20')]('Content-Range',_0x90dade+'-'+_0x292f67+'/'+_0x1642a5)[_0xca79('0x1b')](_0x1db4ca);}return null;};}function patchUpdates(_0x3b4597){return function(_0x43f928){try{jsonpatch[_0xca79('0x21')](_0x43f928,_0x3b4597,!![]);}catch(_0x3cf25b){return BPromise['reject'](_0x3cf25b);}return _0x43f928['save']();};}function saveUpdates(_0x59c6d2,_0x4338d1){return function(_0x4e0c39){if(_0x4e0c39){return _0x4e0c39['update'](_0x59c6d2)['then'](function(_0x3c5658){return _0x3c5658;});}return null;};}function removeEntity(_0x2c6ca4,_0x8e25e3){return function(_0x13aad6){if(_0x13aad6){return _0x13aad6['destroy']()[_0xca79('0x22')](function(){var _0x5d2233=_0x13aad6[_0xca79('0x23')]({'plain':!![]});var _0x2bf4e0=_0xca79('0x24');return db['UserProfileResource'][_0xca79('0x25')]({'where':{'type':_0x2bf4e0,'resourceId':_0x5d2233['id']}})[_0xca79('0x22')](function(){return _0x13aad6;});})[_0xca79('0x22')](function(){_0x2c6ca4[_0xca79('0x19')](0xcc)[_0xca79('0x1a')]();});}};}function handleEntityNotFound(_0x5d304b,_0x4cd7ce){return function(_0x1856f1){if(!_0x1856f1){_0x5d304b['sendStatus'](0x194);}return _0x1856f1;};}function handleError(_0x3600fd,_0x2f2811){_0x2f2811=_0x2f2811||0x1f4;return function(_0x3919d1){logger[_0xca79('0x26')](_0x3919d1['stack']);if(_0x3919d1[_0xca79('0x27')]){delete _0x3919d1[_0xca79('0x27')];}_0x3600fd[_0xca79('0x19')](_0x2f2811)[_0xca79('0x28')](_0x3919d1);};}exports[_0xca79('0x29')]=function(_0x3b834f,_0x1e48be){var _0x1584bb={},_0x3b31bc={},_0x2d355f={'count':0x0,'rows':[]};return db[_0xca79('0x2a')][_0xca79('0x2b')]()[_0xca79('0x22')](function(_0x389670){_0x3b31bc[_0xca79('0x2c')]=_[_0xca79('0x2d')](_0x389670);_0x3b31bc[_0xca79('0x2e')]=_[_0xca79('0x2d')](_0x3b834f[_0xca79('0x2e')]);_0x3b31bc[_0xca79('0x2f')]=_[_0xca79('0x30')](_0x3b31bc[_0xca79('0x2c')],_0x3b31bc['query']);_0x1584bb[_0xca79('0x31')]=_[_0xca79('0x30')](_0x3b31bc[_0xca79('0x2c')],qs[_0xca79('0x32')](_0x3b834f[_0xca79('0x2e')][_0xca79('0x32')]));_0x1584bb[_0xca79('0x31')]=_0x1584bb[_0xca79('0x31')]['length']?_0x1584bb[_0xca79('0x31')]:_0x3b31bc[_0xca79('0x2c')];if(!_0x3b834f[_0xca79('0x2e')][_0xca79('0x33')](_0xca79('0x34'))){_0x1584bb[_0xca79('0x1d')]=qs[_0xca79('0x1d')](_0x3b834f[_0xca79('0x2e')][_0xca79('0x1d')]);_0x1584bb[_0xca79('0x1c')]=qs['offset'](_0x3b834f[_0xca79('0x2e')][_0xca79('0x1c')]);}_0x1584bb[_0xca79('0x35')]=qs[_0xca79('0x36')](_0x3b834f[_0xca79('0x2e')][_0xca79('0x36')]);_0x1584bb[_0xca79('0x37')]=qs[_0xca79('0x2f')](_[_0xca79('0x38')](_0x3b834f[_0xca79('0x2e')],_0x3b31bc['filters']),_0x389670);if(_0x3b834f[_0xca79('0x2e')][_0xca79('0x39')]){_0x1584bb[_0xca79('0x37')]=_[_0xca79('0x3a')](_0x1584bb[_0xca79('0x37')],{'$or':_[_0xca79('0x3b')](_0x1584bb[_0xca79('0x31')],function(_0x4a5655){var _0x53f883={};_0x53f883[_0x4a5655]={'$like':'%'+_0x3b834f['query']['filter']+'%'};return _0x53f883;})});}_0x1584bb=_['merge']({},_0x1584bb,_0x3b834f[_0xca79('0x3c')]);var _0x332e87={'where':_0x1584bb[_0xca79('0x37')]};return db[_0xca79('0x2a')][_0xca79('0x1f')](_0x332e87)[_0xca79('0x22')](function(_0x425327){_0x2d355f['count']=_0x425327;if(_0x3b834f[_0xca79('0x2e')][_0xca79('0x3d')]){_0x1584bb[_0xca79('0x3e')]=[{'all':!![]}];}return db[_0xca79('0x2a')]['findAll'](_0x1584bb);})[_0xca79('0x22')](function(_0x16fb5f){_0x2d355f[_0xca79('0x3f')]=_0x16fb5f;return _0x2d355f;})['then'](respondWithFilteredResult(_0x1e48be,_0x1584bb))['catch'](handleError(_0x1e48be,null));})['catch'](handleError(_0x1e48be,null));};exports[_0xca79('0x40')]=function(_0x69d714,_0x186d66){var _0x1e908d={'raw':![],'where':{'id':_0x69d714[_0xca79('0x41')]['id']}},_0x527f1d={};_0x527f1d[_0xca79('0x2c')]=_[_0xca79('0x2d')](db[_0xca79('0x2a')]['rawAttributes']);_0x527f1d[_0xca79('0x2e')]=_[_0xca79('0x2d')](_0x69d714[_0xca79('0x2e')]);_0x527f1d['filters']=_['intersection'](_0x527f1d[_0xca79('0x2c')],_0x527f1d['query']);_0x1e908d[_0xca79('0x31')]=_['intersection'](_0x527f1d[_0xca79('0x2c')],qs[_0xca79('0x32')](_0x69d714['query'][_0xca79('0x32')]));_0x1e908d[_0xca79('0x31')]=_0x1e908d[_0xca79('0x31')]['length']?_0x1e908d[_0xca79('0x31')]:_0x527f1d[_0xca79('0x2c')];if(_0x69d714[_0xca79('0x2e')][_0xca79('0x3d')]){_0x1e908d[_0xca79('0x3e')]=[{'all':!![]}];}_0x1e908d=_['merge']({},_0x1e908d,_0x69d714[_0xca79('0x3c')]);return db[_0xca79('0x2a')][_0xca79('0x42')](_0x1e908d)['then'](handleEntityNotFound(_0x186d66,null))[_0xca79('0x22')](respondWithResult(_0x186d66,null))[_0xca79('0x43')](handleError(_0x186d66,null));};exports[_0xca79('0x44')]=function(_0x19719e,_0x24449d){return db[_0xca79('0x2a')][_0xca79('0x44')](_0x19719e[_0xca79('0x45')],{})['then'](function(_0x5bd3f5){var _0x4c6d23=_0x19719e[_0xca79('0x46')]['get']({'plain':!![]});if(!_0x4c6d23)throw new Error(_0xca79('0x47'));if(_0x4c6d23[_0xca79('0x48')]===_0xca79('0x46')){var _0x38d884=_0x5bd3f5['get']({'plain':!![]});var _0x41ffc9='Companies';return db[_0xca79('0x49')][_0xca79('0x42')]({'where':{'name':_0x41ffc9,'userProfileId':_0x4c6d23[_0xca79('0x4a')]},'raw':!![]})['then'](function(_0x58799){if(_0x58799&&_0x58799[_0xca79('0x4b')]===0x0){return db['UserProfileResource'][_0xca79('0x44')]({'name':_0x38d884[_0xca79('0x27')],'resourceId':_0x38d884['id'],'type':_0x58799['name'],'sectionId':_0x58799['id']},{})['then'](function(){return _0x5bd3f5;});}else{return _0x5bd3f5;}})[_0xca79('0x43')](function(_0x205b10){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x205b10);throw _0x205b10;});}return _0x5bd3f5;})[_0xca79('0x22')](respondWithResult(_0x24449d,0xc9))['catch'](handleError(_0x24449d,null));};exports['update']=function(_0x3cdd36,_0x1dfa18){if(_0x3cdd36['body']['id']){delete _0x3cdd36[_0xca79('0x45')]['id'];}return db[_0xca79('0x2a')]['find']({'where':{'id':_0x3cdd36[_0xca79('0x41')]['id']}})[_0xca79('0x22')](handleEntityNotFound(_0x1dfa18,null))[_0xca79('0x22')](saveUpdates(_0x3cdd36[_0xca79('0x45')],null))[_0xca79('0x22')](respondWithResult(_0x1dfa18,null))['catch'](handleError(_0x1dfa18,null));};exports[_0xca79('0x25')]=function(_0x48a741,_0x86358b){return db['CmCompany']['find']({'where':{'id':_0x48a741[_0xca79('0x41')]['id']}})['then'](handleEntityNotFound(_0x86358b,null))[_0xca79('0x22')](removeEntity(_0x86358b,null))[_0xca79('0x43')](handleError(_0x86358b,null));};exports[_0xca79('0x2b')]=function(_0x2f8bbb,_0x4e3cf0){return db[_0xca79('0x2a')][_0xca79('0x2b')]()['then'](respondWithResult(_0x4e3cf0,null))[_0xca79('0x43')](handleError(_0x4e3cf0,null));};exports[_0xca79('0x4c')]=function(_0x5bda30,_0x412866,_0xb2142){return db[_0xca79('0x4d')][_0xca79('0x42')]({'where':{'id':_0x5bda30[_0xca79('0x41')]['id']}})[_0xca79('0x22')](handleEntityNotFound(_0x412866,null))[_0xca79('0x22')](function(_0x3eecce){if(_0x3eecce){return _0x3eecce['addContacts'](_0x5bda30[_0xca79('0x45')][_0xca79('0x4e')],_[_0xca79('0x4f')](_0x5bda30[_0xca79('0x45')],[_0xca79('0x4e'),'id'])||{});}})[_0xca79('0x22')](respondWithResult(_0x412866,null))[_0xca79('0x43')](handleError(_0x412866,null));};exports[_0xca79('0x50')]=function(_0x3b6f67,_0x2381b6,_0xf9a53){var _0x5de678={};var _0x4d1178={};var _0x135ac3;var _0x1a0e5d;return db[_0xca79('0x2a')][_0xca79('0x51')]({'where':{'id':_0x3b6f67[_0xca79('0x41')]['id']}})['then'](handleEntityNotFound(_0x2381b6,null))['then'](function(_0x6ddce6){if(_0x6ddce6){_0x135ac3=_0x6ddce6;_0x4d1178[_0xca79('0x2c')]=_[_0xca79('0x2d')](db['CmContact'][_0xca79('0x52')]);_0x4d1178[_0xca79('0x2e')]=_[_0xca79('0x2d')](_0x3b6f67['query']);_0x4d1178[_0xca79('0x2f')]=_['intersection'](_0x4d1178[_0xca79('0x2c')],_0x4d1178['query']);_0x5de678[_0xca79('0x31')]=_[_0xca79('0x30')](_0x4d1178[_0xca79('0x2c')],qs[_0xca79('0x32')](_0x3b6f67[_0xca79('0x2e')][_0xca79('0x32')]));_0x5de678[_0xca79('0x31')]=_0x5de678[_0xca79('0x31')]['length']?_0x5de678[_0xca79('0x31')]:_0x4d1178[_0xca79('0x2c')];_0x5de678[_0xca79('0x35')]=qs[_0xca79('0x36')](_0x3b6f67[_0xca79('0x2e')][_0xca79('0x36')]);_0x5de678[_0xca79('0x37')]=qs[_0xca79('0x2f')](_[_0xca79('0x38')](_0x3b6f67[_0xca79('0x2e')],_0x4d1178[_0xca79('0x2f')]));if(_0x3b6f67[_0xca79('0x2e')]['filter']){_0x5de678[_0xca79('0x37')]=_[_0xca79('0x3a')](_0x5de678[_0xca79('0x37')],{'$or':_[_0xca79('0x3b')](_0x5de678[_0xca79('0x31')],function(_0x581864){var _0x1189db={};_0x1189db[_0x581864]={'$like':'%'+_0x3b6f67[_0xca79('0x2e')]['filter']+'%'};return _0x1189db;})});}_0x5de678=_['merge']({},_0x5de678,_0x3b6f67['options']);return _0x135ac3['getContacts'](_0x5de678);}})[_0xca79('0x22')](function(_0x401ea0){if(_0x401ea0){_0x1a0e5d=_0x401ea0[_0xca79('0x53')];if(!_0x3b6f67['query']['hasOwnProperty'](_0xca79('0x34'))){_0x5de678[_0xca79('0x1d')]=qs['limit'](_0x3b6f67[_0xca79('0x2e')][_0xca79('0x1d')]);_0x5de678['offset']=qs[_0xca79('0x1c')](_0x3b6f67['query'][_0xca79('0x1c')]);}return _0x135ac3[_0xca79('0x50')](_0x5de678);}})[_0xca79('0x22')](function(_0x1d7a98){if(_0x1d7a98){return _0x1d7a98?{'count':_0x1a0e5d,'rows':_0x1d7a98}:null;}})['then'](respondWithResult(_0x2381b6,null))[_0xca79('0x43')](handleError(_0x2381b6,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 96728ee..c839952 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 _0xef5b=['./cmCompany.attributes','exports','define','cm_companies','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x40e59a,_0x2608dd){var _0x571c0d=function(_0x563802){while(--_0x563802){_0x40e59a['push'](_0x40e59a['shift']());}};_0x571c0d(++_0x2608dd);}(_0xef5b,0x70));var _0xbef5=function(_0x3d75df,_0x286e7a){_0x3d75df=_0x3d75df-0x0;var _0x25d327=_0xef5b[_0x3d75df];return _0x25d327;};'use strict';var _=require('lodash');var util=require(_0xbef5('0x0'));var logger=require('../../config/logger')(_0xbef5('0x1'));var moment=require(_0xbef5('0x2'));var BPromise=require(_0xbef5('0x3'));var rp=require(_0xbef5('0x4'));var fs=require('fs');var path=require(_0xbef5('0x5'));var rimraf=require(_0xbef5('0x6'));var config=require(_0xbef5('0x7'));var attributes=require(_0xbef5('0x8'));module[_0xbef5('0x9')]=function(_0x4ea6f0,_0x135b2f){return _0x4ea6f0[_0xbef5('0xa')]('CmCompany',attributes,{'tableName':_0xbef5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea98=['util','api','moment','path','../../config/environment','define','CmCompany','cm_companies'];(function(_0xf9fcc9,_0x46350e){var _0x396114=function(_0x3418fe){while(--_0x3418fe){_0xf9fcc9['push'](_0xf9fcc9['shift']());}};_0x396114(++_0x46350e);}(_0xea98,0x180));var _0x8ea9=function(_0x25e4c7,_0x3986c5){_0x25e4c7=_0x25e4c7-0x0;var _0x333f1e=_0xea98[_0x25e4c7];return _0x333f1e;};'use strict';var _=require('lodash');var util=require(_0x8ea9('0x0'));var logger=require('../../config/logger')(_0x8ea9('0x1'));var moment=require(_0x8ea9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ea9('0x3'));var rimraf=require('rimraf');var config=require(_0x8ea9('0x4'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x422cf5,_0x1ce77e){return _0x422cf5[_0x8ea9('0x5')](_0x8ea9('0x6'),attributes,{'tableName':_0x8ea9('0x7'),'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 a8c6959..1c29845 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 _0x2a5d=['code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x420746,_0x26dd66){var _0x1c6de2=function(_0x1162d7){while(--_0x1162d7){_0x420746['push'](_0x420746['shift']());}};_0x1c6de2(++_0x26dd66);}(_0x2a5d,0x6d));var _0xd2a5=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x2a5d[_0x176329];return _0x31997c;};'use strict';var _=require(_0xd2a5('0x0'));var util=require('util');var moment=require(_0xd2a5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2a5('0x2'));var db=require(_0xd2a5('0x3'))['db'];var utils=require(_0xd2a5('0x4'));var logger=require(_0xd2a5('0x5'))('rpc');var config=require(_0xd2a5('0x6'));var jayson=require(_0xd2a5('0x7'));var client=jayson[_0xd2a5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e599c,_0x5746ed,_0x1efbbb){return new BPromise(function(_0x437e81,_0xb18eda){return client['request'](_0x5e599c,_0x1efbbb)[_0xd2a5('0x9')](function(_0x5219c3){logger[_0xd2a5('0xa')](_0xd2a5('0xb'),_0x5746ed,_0xd2a5('0xc'));logger[_0xd2a5('0xd')](_0xd2a5('0xe'),_0x5746ed,_0xd2a5('0xc'),JSON[_0xd2a5('0xf')](_0x5219c3));if(_0x5219c3[_0xd2a5('0x10')]){if(_0x5219c3['error'][_0xd2a5('0x11')]===0x1f4){logger[_0xd2a5('0x10')](_0xd2a5('0xb'),_0x5746ed,_0x5219c3['error'][_0xd2a5('0x12')]);return _0xb18eda(_0x5219c3[_0xd2a5('0x10')][_0xd2a5('0x12')]);}logger[_0xd2a5('0x10')](_0xd2a5('0xb'),_0x5746ed,_0x5219c3['error']['message']);return _0x437e81(_0x5219c3[_0xd2a5('0x10')][_0xd2a5('0x12')]);}else{logger[_0xd2a5('0xa')](_0xd2a5('0xb'),_0x5746ed,_0xd2a5('0xc'));_0x437e81(_0x5219c3[_0xd2a5('0x13')]['message']);}})[_0xd2a5('0x14')](function(_0x5edb54){logger[_0xd2a5('0x10')](_0xd2a5('0xb'),_0x5746ed,_0x5edb54);_0xb18eda(_0x5edb54);});});}
\ No newline at end of file
+var _0xa29a=['request\x20sent','error','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x54f3e8,_0x3ed493){var _0x267b37=function(_0x58247e){while(--_0x58247e){_0x54f3e8['push'](_0x54f3e8['shift']());}};_0x267b37(++_0x3ed493);}(_0xa29a,0xd5));var _0xaa29=function(_0x2d98ac,_0x4e6161){_0x2d98ac=_0x2d98ac-0x0;var _0x444708=_0xa29a[_0x2d98ac];return _0x444708;};'use strict';var _=require(_0xaa29('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaa29('0x1'));var rs=require(_0xaa29('0x2'));var fs=require('fs');var Redis=require(_0xaa29('0x3'));var db=require(_0xaa29('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa29('0x5'))('rpc');var config=require(_0xaa29('0x6'));var jayson=require(_0xaa29('0x7'));var client=jayson[_0xaa29('0x8')][_0xaa29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35f2fb,_0x1283d1,_0x39c0c3){return new BPromise(function(_0x108a38,_0x12d7c0){return client[_0xaa29('0xa')](_0x35f2fb,_0x39c0c3)[_0xaa29('0xb')](function(_0x52df12){logger[_0xaa29('0xc')](_0xaa29('0xd'),_0x1283d1,'request\x20sent');logger['debug'](_0xaa29('0xe'),_0x1283d1,_0xaa29('0xf'),JSON['stringify'](_0x52df12));if(_0x52df12[_0xaa29('0x10')]){if(_0x52df12[_0xaa29('0x10')]['code']===0x1f4){logger[_0xaa29('0x10')](_0xaa29('0xd'),_0x1283d1,_0x52df12[_0xaa29('0x10')][_0xaa29('0x11')]);return _0x12d7c0(_0x52df12[_0xaa29('0x10')][_0xaa29('0x11')]);}logger[_0xaa29('0x10')](_0xaa29('0xd'),_0x1283d1,_0x52df12[_0xaa29('0x10')][_0xaa29('0x11')]);return _0x108a38(_0x52df12[_0xaa29('0x10')][_0xaa29('0x11')]);}else{logger[_0xaa29('0xc')]('CmCompany,\x20%s,\x20%s',_0x1283d1,_0xaa29('0xf'));_0x108a38(_0x52df12['result'][_0xaa29('0x11')]);}})[_0xaa29('0x12')](function(_0x406a86){logger[_0xaa29('0x10')](_0xaa29('0xd'),_0x1283d1,_0x406a86);_0x12d7c0(_0x406a86);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 727208e..6fcfd1a 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 _0x0291=['destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','./cmCompany.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete'];(function(_0x544d7a,_0x3be1fd){var _0x46fc8c=function(_0x34ec20){while(--_0x34ec20){_0x544d7a['push'](_0x544d7a['shift']());}};_0x46fc8c(++_0x3be1fd);}(_0x0291,0x162));var _0x1029=function(_0x523a3b,_0x21e2b5){_0x523a3b=_0x523a3b-0x0;var _0x1b113d=_0x0291[_0x523a3b];return _0x1b113d;};'use strict';var multer=require(_0x1029('0x0'));var util=require(_0x1029('0x1'));var path=require('path');var timeout=require(_0x1029('0x2'));var express=require('express');var router=express[_0x1029('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1029('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1029('0x5'));router['get']('/',auth[_0x1029('0x6')](),controller['index']);router[_0x1029('0x7')](_0x1029('0x8'),auth[_0x1029('0x6')](),controller[_0x1029('0x9')]);router[_0x1029('0x7')](_0x1029('0xa'),auth['isAuthenticated'](),controller[_0x1029('0xb')]);router['get'](_0x1029('0xc'),auth[_0x1029('0x6')](),controller[_0x1029('0xd')]);router[_0x1029('0xe')]('/',auth[_0x1029('0x6')](),controller[_0x1029('0xf')]);router['post'](_0x1029('0xc'),auth[_0x1029('0x6')](),controller[_0x1029('0x10')]);router[_0x1029('0x11')]('/:id',auth[_0x1029('0x6')](),controller[_0x1029('0x12')]);router[_0x1029('0x13')](_0x1029('0xa'),auth['isAuthenticated'](),controller[_0x1029('0x14')]);module[_0x1029('0x15')]=router;
\ No newline at end of file
+var _0x83d0=['/:id/contacts','getContacts','create','addContacts','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','/:id','show'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x83d0,0x76));var _0x083d=function(_0x2d497f,_0x2f5113){_0x2d497f=_0x2d497f-0x0;var _0x58eb02=_0x83d0[_0x2d497f];return _0x58eb02;};'use strict';var multer=require(_0x083d('0x0'));var util=require(_0x083d('0x1'));var path=require(_0x083d('0x2'));var timeout=require(_0x083d('0x3'));var express=require('express');var router=express[_0x083d('0x4')]();var fs_extra=require(_0x083d('0x5'));var auth=require(_0x083d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x083d('0x7'));var controller=require(_0x083d('0x8'));router[_0x083d('0x9')]('/',auth[_0x083d('0xa')](),controller['index']);router[_0x083d('0x9')](_0x083d('0xb'),auth[_0x083d('0xa')](),controller['describe']);router[_0x083d('0x9')](_0x083d('0xc'),auth[_0x083d('0xa')](),controller[_0x083d('0xd')]);router[_0x083d('0x9')](_0x083d('0xe'),auth['isAuthenticated'](),controller[_0x083d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x083d('0x10')]);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0x083d('0x11')]);router[_0x083d('0x12')]('/:id',auth[_0x083d('0xa')](),controller[_0x083d('0x13')]);router['delete'](_0x083d('0xc'),auth[_0x083d('0xa')](),controller[_0x083d('0x14')]);module[_0x083d('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index c655cf0..2979506 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 _0xf62d=['STRING','TEXT','INTEGER','UNSIGNED','NOW','sequelize','exports'];(function(_0x26fd67,_0x510e30){var _0x840207=function(_0x1372c9){while(--_0x1372c9){_0x26fd67['push'](_0x26fd67['shift']());}};_0x840207(++_0x510e30);}(_0xf62d,0x1b7));var _0xdf62=function(_0x4eab97,_0x52a55f){_0x4eab97=_0x4eab97-0x0;var _0x41f8b2=_0xf62d[_0x4eab97];return _0x41f8b2;};'use strict';var _=require('lodash');var Sequelize=require(_0xdf62('0x0'));module[_0xdf62('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xdf62('0x2')]},'postalCode':{'type':Sequelize[_0xdf62('0x2')]},'city':{'type':Sequelize[_0xdf62('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xdf62('0x2')]},'description':{'type':Sequelize[_0xdf62('0x3')]},'phone':{'type':Sequelize[_0xdf62('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xdf62('0x2')]},'url':{'type':Sequelize[_0xdf62('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xdf62('0x2')]},'skype':{'type':Sequelize[_0xdf62('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xdf62('0x2')]},'line':{'type':Sequelize[_0xdf62('0x2')]},'wechat':{'type':Sequelize[_0xdf62('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xdf62('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xdf62('0x2')]},'priority':{'type':Sequelize[_0xdf62('0x4')](0x2)[_0xdf62('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xdf62('0x6')]},'dialTimezone':{'type':Sequelize[_0xdf62('0x2')]},'utcOffset':{'type':Sequelize[_0xdf62('0x4')]}};
\ No newline at end of file
+var _0x66ef=['exports','STRING','TEXT','UNSIGNED','DATE','NOW','INTEGER','sequelize'];(function(_0x45eee2,_0x4d8c9e){var _0x4eb329=function(_0x3d99a5){while(--_0x3d99a5){_0x45eee2['push'](_0x45eee2['shift']());}};_0x4eb329(++_0x4d8c9e);}(_0x66ef,0x147));var _0xf66e=function(_0x20dc38,_0x371fbf){_0x20dc38=_0x20dc38-0x0;var _0x42a113=_0x66ef[_0x20dc38];return _0x42a113;};'use strict';var _=require('lodash');var Sequelize=require(_0xf66e('0x0'));module[_0xf66e('0x1')]={'firstName':{'type':Sequelize[_0xf66e('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf66e('0x2')]},'street':{'type':Sequelize[_0xf66e('0x2')]},'postalCode':{'type':Sequelize[_0xf66e('0x2')]},'city':{'type':Sequelize[_0xf66e('0x2')]},'country':{'type':Sequelize[_0xf66e('0x2')]},'dateOfBirth':{'type':Sequelize[_0xf66e('0x2')]},'description':{'type':Sequelize[_0xf66e('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xf66e('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf66e('0x2')]},'url':{'type':Sequelize[_0xf66e('0x2')]},'facebook':{'type':Sequelize[_0xf66e('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xf66e('0x2')]},'skype':{'type':Sequelize[_0xf66e('0x2')]},'teams':{'type':Sequelize[_0xf66e('0x2')]},'viber':{'type':Sequelize[_0xf66e('0x2')]},'line':{'type':Sequelize[_0xf66e('0x2')]},'wechat':{'type':Sequelize[_0xf66e('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xf66e('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xf66e('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf66e('0x5')],'defaultValue':Sequelize[_0xf66e('0x6')]},'dialTimezone':{'type':Sequelize[_0xf66e('0x2')]},'utcOffset':{'type':Sequelize[_0xf66e('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index a7efcbe..732abb1 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Title','Data','user=','auth=Bearer\x20','join','utf-8','toString','randomstring'];(function(_0x3e8fa1,_0x8c055c){var _0x5e1ab8=function(_0x4205f4){while(--_0x4205f4){_0x3e8fa1['push'](_0x3e8fa1['shift']());}};_0x5e1ab8(++_0x8c055c);}(_0xd24a,0x1c7));var _0xad24=function(_0x4953ea,_0x20a7bc){_0x4953ea=_0x4953ea-0x0;var _0x115f04=_0xd24a[_0x4953ea];return _0x115f04;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0xad24('0x0'));var fs=require('fs');var path=require(_0xad24('0x1'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0xad24('0x2'))(_0xad24('0x3'));var config=require('../../../config/environment');function getAddress(_0x34c86d){var _0x4d8f4a=_['head'](_0x34c86d[_0xad24('0x4')]);return _0x4d8f4a&&_0x4d8f4a['address']?_0x4d8f4a[_0xad24('0x5')]:_0xad24('0x6')+random['generate'](0x6)+_0xad24('0x7');}function getFirstName(_0x184a0c){var _0x2cfcc6=_[_0xad24('0x8')](_0x184a0c['value']);if(_0x2cfcc6&&_0x2cfcc6['name']){if(_0x2cfcc6['name']==_0x2cfcc6['address']){return _0x2cfcc6[_0xad24('0x9')][_0xad24('0xa')](0x0,_0x2cfcc6[_0xad24('0x9')][_0xad24('0xb')]('@'));}var _0x152774=_0x2cfcc6[_0xad24('0x9')][_0xad24('0xc')](/\s+/);return _0x152774['length']>0x1?_0x152774[_0xad24('0xd')](0x0,-0x1)['join']('\x20'):_0x2cfcc6[_0xad24('0x9')];}return _0xad24('0xe');}function getLastName(_0x2f62b1){var _0x11ea90=_[_0xad24('0x8')](_0x2f62b1[_0xad24('0x4')]);if(_0x11ea90&&_0x11ea90[_0xad24('0x9')]){var _0x298b14=_0x11ea90['name'][_0xad24('0xc')](/\s+/);return _0x298b14[_0xad24('0xf')]>0x1?_0x298b14[_0xad24('0x10')]():'';}return'';}function getMails(_0x31e323,_0x4c2f11){var _0x512786='';for(var _0x10a9b7=0x0;_0x10a9b7<_0x4c2f11[_0xad24('0x4')]['length'];_0x10a9b7+=0x1){if(_0x4c2f11[_0xad24('0x4')][_0x10a9b7][_0xad24('0x5')]!==_0x31e323){if(!_[_0xad24('0x11')](_0x512786)){_0x512786+=',';}_0x512786+=_0x4c2f11['value'][_0x10a9b7]['name']||_0x4c2f11[_0xad24('0x4')][_0x10a9b7][_0xad24('0x5')]||'';_0x512786+='\x20<';_0x512786+=_0x4c2f11[_0xad24('0x4')][_0x10a9b7]['address']?_0x4c2f11['value'][_0x10a9b7]['address']:_0xad24('0x6')+random[_0xad24('0x12')](0x6)+_0xad24('0x7');_0x512786+='>';}}return _0x512786;}function parseEmail(_0x1762e1,_0x1c4117,_0x506606){if(_0x1c4117[_0xad24('0x13')]){var _0x380926=/